Title: [288840] trunk
Revision
288840
Author
[email protected]
Date
2022-01-31 13:37:14 -0800 (Mon, 31 Jan 2022)

Log Message

Delete runtime flag for subresource integrity
https://bugs.webkit.org/show_bug.cgi?id=235876

Reviewed by Darin Adler.

Source/WebCore:

* dom/ScriptElement.cpp:
(WebCore::ScriptElement::requestClassicScript):
(WebCore::ScriptElement::requestModuleScript):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
* html/HTMLLinkElement.idl:
* html/HTMLScriptElement.idl:

Source/WTF:

Deleted the runtime flag.

* Scripts/Preferences/WebPreferences.yaml:

LayoutTests:

Deleted the test which was testing the behavior of WebKit when subresource integrity is disabled.

* http/tests/subresource-integrity/sri-disabled-with-setting-expected.txt: Removed.
* http/tests/subresource-integrity/sri-disabled-with-setting.html: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (288839 => 288840)


--- trunk/LayoutTests/ChangeLog	2022-01-31 21:17:48 UTC (rev 288839)
+++ trunk/LayoutTests/ChangeLog	2022-01-31 21:37:14 UTC (rev 288840)
@@ -1,3 +1,15 @@
+2022-01-31  Ryosuke Niwa  <[email protected]>
+
+        Delete runtime flag for subresource integrity
+        https://bugs.webkit.org/show_bug.cgi?id=235876
+
+        Reviewed by Darin Adler.
+
+        Deleted the test which was testing the behavior of WebKit when subresource integrity is disabled.
+
+        * http/tests/subresource-integrity/sri-disabled-with-setting-expected.txt: Removed.
+        * http/tests/subresource-integrity/sri-disabled-with-setting.html: Removed.
+
 2022-01-31  Takeshi Sone  <[email protected]>
 
         Added a test to verify that setting undefined to video.playbackRate

Deleted: trunk/LayoutTests/http/tests/subresource-integrity/sri-disabled-with-setting-expected.txt (288839 => 288840)


--- trunk/LayoutTests/http/tests/subresource-integrity/sri-disabled-with-setting-expected.txt	2022-01-31 21:17:48 UTC (rev 288839)
+++ trunk/LayoutTests/http/tests/subresource-integrity/sri-disabled-with-setting-expected.txt	2022-01-31 21:37:14 UTC (rev 288840)
@@ -1,6 +0,0 @@
-
-PASS Test that Subresource Integrity's 'integrity' property is not exposed on the <link> element.
-PASS Test that Subresource Integrity's 'integrity' property is not exposed on the <script> element.
-PASS Script: Same-origin with incorrect hash, but should evaluate successfully due to Subresource Integrity being disabled.
-PASS Style: Same-origin with incorrect hash, but should evaluate successfully due to Subresource Integrity being disabled.
-

Deleted: trunk/LayoutTests/http/tests/subresource-integrity/sri-disabled-with-setting.html (288839 => 288840)


--- trunk/LayoutTests/http/tests/subresource-integrity/sri-disabled-with-setting.html	2022-01-31 21:17:48 UTC (rev 288839)
+++ trunk/LayoutTests/http/tests/subresource-integrity/sri-disabled-with-setting.html	2022-01-31 21:37:14 UTC (rev 288840)
@@ -1,49 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <meta charset="utf-8">
-    <script>
-        if (window.internals)
-            window.internals.settings.setSubresourceIntegrityEnabled(false);
-    </script>
-    <script src=""
-    <script src=""
-    <script src=""
-</head>
-<body>
-    <div id="log"></div>
-    <div id="container"></div>
-<script>
-
-test(function() {
-    var linkElement = document.createElement("link");
-    assert_false("integrity" in linkElement, "integrity", "The 'integrity' property is not exposed on the link element.");
-}, "Test that Subresource Integrity's 'integrity' property is not exposed on the <link> element.");
-
-test(function() {
-    var scriptElement = document.createElement("script");
-    assert_false("integrity" in scriptElement, "The 'integrity' property is not exposed on the script element.");
-    
-}, "Test that Subresource Integrity's 'integrity' property is not exposed on the <script> element.");
-
-new SRIScriptTest(
-    true,
-    "Same-origin with incorrect hash, but should evaluate successfully due to Subresource Integrity being disabled.",
-    "resources/non-matching-digest.js",
-    "sha256-deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdead"
-);
-
-new SRIStyleTest(
-    true,
-    "Same-origin with incorrect hash, but should evaluate successfully due to Subresource Integrity being disabled.",
-    {
-        href: "resources/style.css",
-        integrity: "sha256-deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdead"
-    }
-);
-
-SRITests.execute();
-
-</script>
-</body>
-</html>

Modified: trunk/Source/WTF/ChangeLog (288839 => 288840)


--- trunk/Source/WTF/ChangeLog	2022-01-31 21:17:48 UTC (rev 288839)
+++ trunk/Source/WTF/ChangeLog	2022-01-31 21:37:14 UTC (rev 288840)
@@ -1,3 +1,14 @@
+2022-01-31  Ryosuke Niwa  <[email protected]>
+
+        Delete runtime flag for subresource integrity
+        https://bugs.webkit.org/show_bug.cgi?id=235876
+
+        Reviewed by Darin Adler.
+
+        Deleted the runtime flag.
+
+        * Scripts/Preferences/WebPreferences.yaml:
+
 2022-01-31  Aditya Keerthi  <[email protected]>
 
         [iOS] SharePlay is shown prominently for system-provided Share Sheets

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml (288839 => 288840)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml	2022-01-31 21:17:48 UTC (rev 288839)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml	2022-01-31 21:37:14 UTC (rev 288840)
@@ -2194,16 +2194,6 @@
     WebKit:
       default: WebCore::StorageBlockingPolicy::BlockThirdParty
 
-SubresourceIntegrityEnabled:
-  type: bool
-  defaultValue:
-    WebKitLegacy:
-      default: true
-    WebKit:
-      default: true
-    WebCore:
-      default: true
-
 SuppressesIncrementalRendering:
   type: bool
   defaultValue:

Modified: trunk/Source/WebCore/ChangeLog (288839 => 288840)


--- trunk/Source/WebCore/ChangeLog	2022-01-31 21:17:48 UTC (rev 288839)
+++ trunk/Source/WebCore/ChangeLog	2022-01-31 21:37:14 UTC (rev 288840)
@@ -1,3 +1,18 @@
+2022-01-31  Ryosuke Niwa  <[email protected]>
+
+        Delete runtime flag for subresource integrity
+        https://bugs.webkit.org/show_bug.cgi?id=235876
+
+        Reviewed by Darin Adler.
+
+        * dom/ScriptElement.cpp:
+        (WebCore::ScriptElement::requestClassicScript):
+        (WebCore::ScriptElement::requestModuleScript):
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::process):
+        * html/HTMLLinkElement.idl:
+        * html/HTMLScriptElement.idl:
+
 2022-01-31  Antti Koivisto  <[email protected]>
 
         LineLayout::collectOverflow() should null check m_inlineContent

Modified: trunk/Source/WebCore/dom/ScriptElement.cpp (288839 => 288840)


--- trunk/Source/WebCore/dom/ScriptElement.cpp	2022-01-31 21:17:48 UTC (rev 288839)
+++ trunk/Source/WebCore/dom/ScriptElement.cpp	2022-01-31 21:37:14 UTC (rev 288840)
@@ -290,7 +290,7 @@
     if (!stripLeadingAndTrailingHTMLSpaces(sourceURL).isEmpty()) {
         auto script = LoadableClassicScript::create(
             m_element.nonce(),
-            m_element.document().settings().subresourceIntegrityEnabled() ? m_element.attributeWithoutSynchronization(HTMLNames::integrityAttr).string() : emptyString(),
+            m_element.attributeWithoutSynchronization(HTMLNames::integrityAttr).string(),
             referrerPolicy(),
             m_element.attributeWithoutSynchronization(HTMLNames::crossoriginAttr),
             scriptCharset(),
@@ -347,7 +347,7 @@
         m_isExternalScript = true;
         auto script = LoadableModuleScript::create(
             nonce,
-            m_element.document().settings().subresourceIntegrityEnabled() ? m_element.attributeWithoutSynchronization(HTMLNames::integrityAttr).string() : emptyString(),
+            m_element.attributeWithoutSynchronization(HTMLNames::integrityAttr).string(),
             referrerPolicy(),
             crossOriginMode,
             scriptCharset(),

Modified: trunk/Source/WebCore/html/HTMLLinkElement.cpp (288839 => 288840)


--- trunk/Source/WebCore/html/HTMLLinkElement.cpp	2022-01-31 21:17:48 UTC (rev 288839)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp	2022-01-31 21:37:14 UTC (rev 288840)
@@ -311,8 +311,7 @@
         if (!isActive)
             priority = DefaultResourceLoadPriority::inactiveStyleSheet;
 
-        if (document().settings().subresourceIntegrityEnabled())
-            m_integrityMetadataForPendingSheetRequest = attributeWithoutSynchronization(HTMLNames::integrityAttr);
+        m_integrityMetadataForPendingSheetRequest = attributeWithoutSynchronization(HTMLNames::integrityAttr);
 
         ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
         options.nonce = attributeWithoutSynchronization(HTMLNames::nonceAttr);

Modified: trunk/Source/WebCore/html/HTMLLinkElement.idl (288839 => 288840)


--- trunk/Source/WebCore/html/HTMLLinkElement.idl	2022-01-31 21:17:48 UTC (rev 288839)
+++ trunk/Source/WebCore/html/HTMLLinkElement.idl	2022-01-31 21:37:14 UTC (rev 288840)
@@ -46,6 +46,6 @@
     [PutForwards=value] readonly attribute DOMTokenList relList;
 
     [Reflect] attribute DOMString nonce;
-    [CEReactions=NotNeeded, Reflect, EnabledBySetting=SubresourceIntegrityEnabled] attribute DOMString integrity;
+    [CEReactions=NotNeeded, Reflect] attribute DOMString integrity;
 };
 

Modified: trunk/Source/WebCore/html/HTMLScriptElement.idl (288839 => 288840)


--- trunk/Source/WebCore/html/HTMLScriptElement.idl	2022-01-31 21:17:48 UTC (rev 288839)
+++ trunk/Source/WebCore/html/HTMLScriptElement.idl	2022-01-31 21:37:14 UTC (rev 288840)
@@ -31,7 +31,7 @@
     [CEReactions=NotNeeded, Reflect] attribute DOMString type;
     [CEReactions=NotNeeded] attribute DOMString? crossOrigin;
     [CEReactions=NotNeeded, Reflect] attribute boolean noModule;
-    [CEReactions=NotNeeded, Reflect, EnabledBySetting=SubresourceIntegrityEnabled] attribute DOMString integrity;
+    [CEReactions=NotNeeded, Reflect] attribute DOMString integrity;
     [EnabledBySetting=ReferrerPolicyAttributeEnabled, ImplementedAs=referrerPolicyForBindings, CEReactions=NotNeeded] attribute DOMString referrerPolicy;
 
     static boolean supports(DOMString type);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to