summaryrefslogtreecommitdiff
path: root/Source/WebCore/html
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/html')
-rw-r--r--Source/WebCore/html/HTMLAnchorElement.cpp10
-rw-r--r--Source/WebCore/html/HTMLLinkElement.cpp8
-rw-r--r--Source/WebCore/html/HTMLScriptElement.idl2
-rw-r--r--Source/WebCore/html/HTMLStyleElement.idl2
4 files changed, 12 insertions, 10 deletions
diff --git a/Source/WebCore/html/HTMLAnchorElement.cpp b/Source/WebCore/html/HTMLAnchorElement.cpp
index bc100a870..75eb7a2a3 100644
--- a/Source/WebCore/html/HTMLAnchorElement.cpp
+++ b/Source/WebCore/html/HTMLAnchorElement.cpp
@@ -46,6 +46,7 @@
#include "SecurityOrigin.h"
#include "SecurityPolicy.h"
#include "Settings.h"
+#include "URLUtils.h"
#include <wtf/text/StringBuilder.h>
namespace WebCore {
@@ -76,15 +77,6 @@ HTMLAnchorElement::~HTMLAnchorElement()
clearRootEditableElementForSelectionOnMouseDown();
}
-// This function does not allow leading spaces before the port number.
-static unsigned parsePortFromStringPosition(const String& value, unsigned portStart, unsigned& portEnd)
-{
- portEnd = portStart;
- while (isASCIIDigit(value[portEnd]))
- ++portEnd;
- return value.substring(portStart, portEnd - portStart).toUInt();
-}
-
bool HTMLAnchorElement::supportsFocus() const
{
if (hasEditableStyle())
diff --git a/Source/WebCore/html/HTMLLinkElement.cpp b/Source/WebCore/html/HTMLLinkElement.cpp
index 49c15ce12..4a73e530d 100644
--- a/Source/WebCore/html/HTMLLinkElement.cpp
+++ b/Source/WebCore/html/HTMLLinkElement.cpp
@@ -32,6 +32,7 @@
#include "CachedResource.h"
#include "CachedResourceLoader.h"
#include "CachedResourceRequest.h"
+#include "ContentSecurityPolicy.h"
#include "Document.h"
#include "Event.h"
#include "EventSender.h"
@@ -245,6 +246,13 @@ void HTMLLinkElement::process()
priority = ResourceLoadPriority::VeryLow;
CachedResourceRequest request(ResourceRequest(document().completeURL(url)), charset, priority);
request.setInitiator(this);
+
+ if (document().contentSecurityPolicy()->allowStyleWithNonce(fastGetAttribute(HTMLNames::nonceAttr))) {
+ ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
+ options.setContentSecurityPolicyImposition(ContentSecurityPolicyImposition::SkipPolicyCheck);
+ request.setOptions(options);
+ }
+
m_cachedSheet = document().cachedResourceLoader().requestCSSStyleSheet(request);
if (m_cachedSheet)
diff --git a/Source/WebCore/html/HTMLScriptElement.idl b/Source/WebCore/html/HTMLScriptElement.idl
index 1365d12bf..ff0b30aac 100644
--- a/Source/WebCore/html/HTMLScriptElement.idl
+++ b/Source/WebCore/html/HTMLScriptElement.idl
@@ -27,5 +27,5 @@ interface HTMLScriptElement : HTMLElement {
[Reflect, URL] attribute DOMString src;
[Reflect] attribute DOMString type;
[Reflect] attribute DOMString crossOrigin;
- [Reflect, Conditional=CSP_NEXT] attribute DOMString nonce;
+ [Reflect] attribute DOMString nonce;
};
diff --git a/Source/WebCore/html/HTMLStyleElement.idl b/Source/WebCore/html/HTMLStyleElement.idl
index 7abf3839f..fd3f7c0d3 100644
--- a/Source/WebCore/html/HTMLStyleElement.idl
+++ b/Source/WebCore/html/HTMLStyleElement.idl
@@ -25,5 +25,7 @@ interface HTMLStyleElement : HTMLElement {
// DOM Level 2 Style
readonly attribute StyleSheet sheet;
+
+ [Reflect] attribute DOMString nonce;
};