WebKit doesn't parse "#" as delimiter for fragment identifier in data URIs
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Oct 2020 19:36:22 +0000 (19:36 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Oct 2020 19:36:22 +0000 (19:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=68089

Patch by Rob Buis <rbuis@igalia.com> on 2020-10-05
Reviewed by Alex Christensen, Ryosuke Niwa, and Darin Adler.

LayoutTests/imported/w3c:

Update improved test results.

* web-platform-tests/fetch/data-urls/processing.any-expected.txt:
* web-platform-tests/fetch/data-urls/processing.any.worker-expected.txt:
* web-platform-tests/url/data-uri-fragment-expected.txt:

Source/WebCore:

To maintain compatibility with existing iOS and macOS apps, we only do this for apps linked
with the SDK after the change.

Covered by newly passing web platform tests (which Chrome and Firefox already passed).

* loader/ResourceLoader.cpp:
(WebCore::shouldStripFragmentIdentifier):
(WebCore::ResourceLoader::loadDataURL):
* platform/cocoa/VersionChecks.h:

Source/WTF:

* wtf/URL.h:
* wtf/spi/darwin/dyldSPI.h:

LayoutTests:

Adjusts tests thats use data URIs to escape the # character.

* accessibility/ios-simulator/iframe-access.html:
* accessibility/ios-simulator/unobscured-content-rect.html:
* accessibility/resources/iframe.html:
* accessibility/scroll-to-global-point-iframe.html:
* accessibility/scroll-to-make-visible-iframe-offscreen.html:
* accessibility/scroll-to-make-visible-iframe.html:
* css3/blending/background-blend-mode-crossfade-image.html:
* css3/blending/background-blend-mode-data-uri-svg-image.html:
* css3/blending/background-blend-mode-tiled-layers.html:
* css3/flexbox/flexitem.html:
* css3/shapes/shape-outside/shape-image/shape-image-002.html:
* css3/shapes/shape-outside/shape-image/shape-image-005.html:
* editing/pasteboard/data-transfer-set-data-sanitize-url-when-copying-in-null-origin.html:
* editing/pasteboard/data-transfer-set-data-sanitize-url-when-dragging-in-null-origin.html:
* fast/css-grid-layout/grid-item-display.html:
* fast/css/import-style-update.html:
* fast/css/link-media-attr.html:
* fast/dom/HTMLLinkElement/link-stylesheet-media-type.html:
* fast/events/attribute-listener-cloned-from-frameless-doc-context-2.html:
* fast/events/attribute-listener-cloned-from-frameless-doc-context.html:
* fast/events/attribute-listener-extracted-from-frameless-doc-context-2.html:
* fast/events/attribute-listener-extracted-from-frameless-doc-context.html:
* fast/hidpi/image-srcset-data-escaped-srcset.html:
* fast/html/link-rel-stylesheet.html:
* fast/loader/data-url-encoding-html.html:
* fast/loader/data-url-encoding-svg.html:
* fast/spatial-navigation/resources/iframe.html:
* http/tests/security/top-level-unique-origin.https.html:
* platform/ios/css3/flexbox/flexitem-expected.txt:
* platform/win/css3/flexbox/flexitem-expected.txt:
* security/contentSecurityPolicy/link-with-data-url-allowed-by-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html:
* svg/animations/css-animation-background-svg.html:
* svg/animations/css-animation-embedded-svg.html:
* svg/animations/css-animation-hover-svg.html:
* svg/as-image/svg-canvas-data-url-svg-with-feimage-not-tainted.html:
* svg/custom/object-data-href.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267995 268f45cc-cd09-0410-ab3c-d52691b4dbfc

47 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/ios-simulator/iframe-access.html
LayoutTests/accessibility/ios-simulator/unobscured-content-rect.html
LayoutTests/accessibility/resources/iframe.html
LayoutTests/accessibility/scroll-to-global-point-iframe.html
LayoutTests/accessibility/scroll-to-make-visible-iframe-offscreen.html
LayoutTests/accessibility/scroll-to-make-visible-iframe.html
LayoutTests/css3/blending/background-blend-mode-crossfade-image.html
LayoutTests/css3/blending/background-blend-mode-data-uri-svg-image.html
LayoutTests/css3/blending/background-blend-mode-tiled-layers.html
LayoutTests/css3/flexbox/flexitem.html
LayoutTests/css3/shapes/shape-outside/shape-image/shape-image-002.html
LayoutTests/css3/shapes/shape-outside/shape-image/shape-image-005.html
LayoutTests/editing/pasteboard/data-transfer-set-data-sanitize-url-when-copying-in-null-origin.html
LayoutTests/editing/pasteboard/data-transfer-set-data-sanitize-url-when-dragging-in-null-origin.html
LayoutTests/fast/css-grid-layout/grid-item-display.html
LayoutTests/fast/css/import-style-update.html
LayoutTests/fast/css/link-media-attr.html
LayoutTests/fast/dom/HTMLLinkElement/link-stylesheet-media-type.html
LayoutTests/fast/events/attribute-listener-cloned-from-frameless-doc-context-2.html
LayoutTests/fast/events/attribute-listener-cloned-from-frameless-doc-context.html
LayoutTests/fast/events/attribute-listener-extracted-from-frameless-doc-context-2.html
LayoutTests/fast/events/attribute-listener-extracted-from-frameless-doc-context.html
LayoutTests/fast/hidpi/image-srcset-data-escaped-srcset.html
LayoutTests/fast/html/link-rel-stylesheet.html
LayoutTests/fast/loader/data-url-encoding-html.html
LayoutTests/fast/loader/data-url-encoding-svg.html
LayoutTests/fast/spatial-navigation/resources/iframe.html
LayoutTests/http/tests/security/top-level-unique-origin.https.html
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/fetch/data-urls/processing.any-expected.txt
LayoutTests/imported/w3c/web-platform-tests/fetch/data-urls/processing.any.worker-expected.txt
LayoutTests/imported/w3c/web-platform-tests/url/data-uri-fragment-expected.txt
LayoutTests/platform/ios/css3/flexbox/flexitem-expected.txt
LayoutTests/platform/win/css3/flexbox/flexitem-expected.txt
LayoutTests/security/contentSecurityPolicy/link-with-data-url-allowed-by-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html
LayoutTests/svg/animations/css-animation-background-svg.html
LayoutTests/svg/animations/css-animation-embedded-svg.html
LayoutTests/svg/animations/css-animation-hover-svg.html
LayoutTests/svg/as-image/svg-canvas-data-url-svg-with-feimage-not-tainted.html
LayoutTests/svg/custom/object-data-href.html
Source/WTF/ChangeLog
Source/WTF/wtf/URL.h
Source/WTF/wtf/spi/darwin/dyldSPI.h
Source/WebCore/ChangeLog
Source/WebCore/loader/ResourceLoader.cpp
Source/WebCore/platform/cocoa/VersionChecks.h

index ad0ba6b10957e0c7b740f785c52709289a1868a6..baeb303335641400d9aa90da7c8113e2608a6ebe 100644 (file)
@@ -1,3 +1,49 @@
+2020-10-05  Rob Buis  <rbuis@igalia.com>
+
+        WebKit doesn't parse "#" as delimiter for fragment identifier in data URIs
+        https://bugs.webkit.org/show_bug.cgi?id=68089
+
+        Reviewed by Alex Christensen, Ryosuke Niwa, and Darin Adler.
+
+        Adjusts tests thats use data URIs to escape the # character.
+
+        * accessibility/ios-simulator/iframe-access.html:
+        * accessibility/ios-simulator/unobscured-content-rect.html:
+        * accessibility/resources/iframe.html:
+        * accessibility/scroll-to-global-point-iframe.html:
+        * accessibility/scroll-to-make-visible-iframe-offscreen.html:
+        * accessibility/scroll-to-make-visible-iframe.html:
+        * css3/blending/background-blend-mode-crossfade-image.html:
+        * css3/blending/background-blend-mode-data-uri-svg-image.html:
+        * css3/blending/background-blend-mode-tiled-layers.html:
+        * css3/flexbox/flexitem.html:
+        * css3/shapes/shape-outside/shape-image/shape-image-002.html:
+        * css3/shapes/shape-outside/shape-image/shape-image-005.html:
+        * editing/pasteboard/data-transfer-set-data-sanitize-url-when-copying-in-null-origin.html:
+        * editing/pasteboard/data-transfer-set-data-sanitize-url-when-dragging-in-null-origin.html:
+        * fast/css-grid-layout/grid-item-display.html:
+        * fast/css/import-style-update.html:
+        * fast/css/link-media-attr.html:
+        * fast/dom/HTMLLinkElement/link-stylesheet-media-type.html:
+        * fast/events/attribute-listener-cloned-from-frameless-doc-context-2.html:
+        * fast/events/attribute-listener-cloned-from-frameless-doc-context.html:
+        * fast/events/attribute-listener-extracted-from-frameless-doc-context-2.html:
+        * fast/events/attribute-listener-extracted-from-frameless-doc-context.html:
+        * fast/hidpi/image-srcset-data-escaped-srcset.html:
+        * fast/html/link-rel-stylesheet.html:
+        * fast/loader/data-url-encoding-html.html:
+        * fast/loader/data-url-encoding-svg.html:
+        * fast/spatial-navigation/resources/iframe.html:
+        * http/tests/security/top-level-unique-origin.https.html:
+        * platform/ios/css3/flexbox/flexitem-expected.txt:
+        * platform/win/css3/flexbox/flexitem-expected.txt:
+        * security/contentSecurityPolicy/link-with-data-url-allowed-by-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html:
+        * svg/animations/css-animation-background-svg.html:
+        * svg/animations/css-animation-embedded-svg.html:
+        * svg/animations/css-animation-hover-svg.html:
+        * svg/as-image/svg-canvas-data-url-svg-with-feimage-not-tainted.html:
+        * svg/custom/object-data-href.html:
+
 2020-10-05  Sergio Villar Senin  <svillar@igalia.com>
 
         [css-flex] Fix expectations of a test which is actually passing
index 1244e631536ea02b9e836b95b98387fb57723461..b66b10f45d5c022d25130f317a55b917369ca013 100644 (file)
@@ -9,7 +9,7 @@ var successfullyParsed = false;
 <body id="body">
 
 <div id="content">
-<iframe id="iframe" onload="startTest();" src="data:text/html,<body><button id='frame-button'>Click me</button><a href='#' id='frame-link'>a</a></body>"></iframe>
+<iframe id="iframe" onload="startTest();" src="data:text/html,<body><button id='frame-button'>Click me</button><a href='%23' id='frame-link'>a</a></body>"></iframe>
 </div>
 
 <p id="description"></p>
index b7f351e32a847817062f66c73e9e7990b9e15433..76ed9c80cc4661a865b16fb3ca925d550c4d9e57 100644 (file)
@@ -6,7 +6,7 @@
 <div id="content">
 <button id="button">test</button>
 
-<iframe id="iframe" onload="startTest();" width="200" height="200" src="data:text/html,<body><button id='frame-button'>Click me</button><a href='#' id='frame-link'>a</a></body>"></iframe>
+<iframe id="iframe" onload="startTest();" width="200" height="200" src="data:text/html,<body><button id='frame-button'>Click me</button><a href='%23' id='frame-link'>a</a></body>"></iframe>
 
 </div>
 
index 92d118073bc5ea17e84d9379a2996f160efefba6..46709b02e7551f1c3eb01aacc2480cc488c0822f 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 <body>
 <div id="box" style='border: 1px solid #000; height: 1000px;'>1000-pixel box</div>
-<iframe id="iframe" src="data:text/html,<body><div style='border: 1px solid #000; height: 5000px;'>5000-pixel box</div><button id='button'>Test Button</button></button></body>"></iframe>
+<iframe id="iframe" src="data:text/html,<body><div style='border: 1px solid %23000; height: 5000px;'>5000-pixel box</div><button id='button'>Test Button</button></button></body>"></iframe>
 </body>
 </html>
index 8d382a5f66f4796951d3040adcee0e96dcde14fa..85cfeaec73cb67cfdf5de63aa6b9b3bb77c3bfaa 100644 (file)
@@ -11,9 +11,9 @@
 <iframe id="frame" src="data:text/html,
     <body>
         <style>button { border: 0; }</style>
-        <div style='border: 1px solid #000; height: 5000px;'>5000-pixel box</div>
+        <div style='border: 1px solid %23000; height: 5000px;'>5000-pixel box</div>
         <button id='target'>Target</button>
-        <div style='border: 1px solid #000; height: 5000px;'>5000-pixel box</div>
+        <div style='border: 1px solid %23000; height: 5000px;'>5000-pixel box</div>
     </body>"></iframe>
 
 <div style="border: 1px solid #000; height: 5000px;">5000-pixel box</div>
index d25f24706f2ebad1c0627120e88241c22a1b311c..35da10f940e655418047f7a4dd921243936ab4b8 100644 (file)
@@ -8,7 +8,7 @@
 
 <div style='border: 1px solid #000; height: 5000px;'>5000-pixel box</div>
 
-<iframe id="frame" src="data:text/html,<body><button id='upper_target'>Upper Target</button><div style='border: 1px solid #000; height: 5000px;'>5000-pixel box</div><button id='lower_target'>Lower Target</button></body>"></iframe>
+<iframe id="frame" src="data:text/html,<body><button id='upper_target'>Upper Target</button><div style='border: 1px solid %23000; height: 5000px;'>5000-pixel box</div><button id='lower_target'>Lower Target</button></body>"></iframe>
 
 <br>
 <iframe id="frame2" src="./resources/iframe.html"></iframe>
index bcd65e96c6151b06e58b22f7b03978408b9f5b17..fe1aa234955b7948ecb039382ccaee1360639739 100644 (file)
@@ -6,7 +6,7 @@
 
 <p id="description"></p>
 
-<iframe id="frame" src="data:text/html,<body><button id='upper_target'>Upper Target</button><div style='border: 1px solid #000; height: 5000px;'>5000-pixel box</div><button id='lower_target'>Lower Target</button></body>"></iframe>
+<iframe id="frame" src="data:text/html,<body><button id='upper_target'>Upper Target</button><div style='border: 1px solid %23000; height: 5000px;'>5000-pixel box</div><button id='lower_target'>Lower Target</button></body>"></iframe>
 
 <div id="console"></div>
 
index 1de7df6dbe39a12ae7d90a8364ef8ce1dcbf6d0a..d5881dc8eafde39d4dcb5a377abde681f759d949 100644 (file)
@@ -8,11 +8,11 @@ The test passes if you can see two green rectangles drawn on the screen. The tes
     div {
         background-image: -webkit-cross-fade(url('data:image/svg+xml;utf8, \
             <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"> \
-                <rect width="100" height="100" fill="#F00"/> \
+                <rect width="100" height="100" fill="%23F00"/> \
             </svg>'
             ), url('data:image/svg+xml;utf8, \
             <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"> \
-                <rect width="100" height="100" fill="#F00"/> \
+                <rect width="100" height="100" fill="%23F00"/> \
             </svg>'
             ), 100%);
         background-blend-mode: difference, normal
index d106c1851dfa55526cb14424197a89f3d7c1ab93..e86cd2195000a31a3a9dd774da2cfd1f1c5d2c8e 100644 (file)
@@ -9,7 +9,7 @@
         border-style: dotted double;
         background: url('data:image/svg+xml;utf8, \
             <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 100 100"> \
-                <rect width="100" height="100" fill="#F00"/> \
+                <rect width="100" height="100" fill="%23F00"/> \
             </svg>'
             ), #FF0;
         background-blend-mode: difference, normal
index 5cb41df9ec1ff0c210059033ce2ebc2d4ed044d5..b37153e5571b46f138c96a0d880714030da19046 100644 (file)
@@ -15,7 +15,7 @@
     .tiledSVG {
         background: url('data:image/svg+xml;utf8, \
             <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"> \
-                <rect width="100" height="100" fill="#F00"/> \
+                <rect width="100" height="100" fill="%23F00"/> \
             </svg>'
             ) 0 0 /50% 50%, #FF0;
     }
     .tiledCrossfadeImage {
         background: -webkit-cross-fade(url('data:image/svg+xml;utf8, \
             <svg xmlns="http://www.w3.org/2000/svg" width="100px" height="100px"> \
-                <rect width="100" height="100" fill="#F00"/> \
+                <rect width="100" height="100" fill="%23F00"/> \
             </svg>'
             ), url('data:image/svg+xml;utf8, \
             <svg xmlns="http://www.w3.org/2000/svg" width="100px" height="100px"> \
-                <rect width="100" height="100" fill="#F00"/> \
+                <rect width="100" height="100" fill="%23F00"/> \
             </svg>'
             ), 100%) 0 0 /50% 50%, #FF0;
     }
index 7c52f60b0e9a4e6b9fac3e2b1ca0ca4e9ed6c69c..10225a45020760680b8ce825e53e5585ea8b563c 100644 (file)
@@ -25,7 +25,7 @@
 <div class="flexbox" style="height:200px">
   <button data-expected-display="block" data-expected-width="100" data-expected-height="200">button</button>
   <canvas data-expected-display="block" data-expected-width="100" data-expected-height="200">canvas</canvas>
-  <iframe data-expected-display="block" data-expected-width="100" data-expected-height="200" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
+  <iframe data-expected-display="block" data-expected-width="100" data-expected-height="200" src="data:text/html,<body bgcolor=%23fff>iframe</body>"></iframe>
   <object data-expected-display="block" data-expected-width="100" data-expected-height="200">object</object>
   <select data-expected-display="block" data-expected-width="100" data-expected-height="200">
     <option>select</option>
 </div>
 
 <div class="flexbox" style="height:200px">
-  <iframe data-expected-display="block" data-expected-height="200" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
-  <iframe seamless data-expected-display="block" data-expected-height="200" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
+  <iframe data-expected-display="block" data-expected-height="200" src="data:text/html,<body bgcolor=%23fff>iframe</body>"></iframe>
+  <iframe seamless data-expected-display="block" data-expected-height="200" src="data:text/html,<body bgcolor=%23fff>iframe</body>"></iframe>
 </div>
 
 <div class="flexbox" style="height:100px">
-  <iframe data-expected-display="block" data-expected-height="100" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
-  <iframe seamless data-expected-display="block" data-expected-height="100" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
+  <iframe data-expected-display="block" data-expected-height="100" src="data:text/html,<body bgcolor=%23fff>iframe</body>"></iframe>
+  <iframe seamless data-expected-display="block" data-expected-height="100" src="data:text/html,<body bgcolor=%23fff>iframe</body>"></iframe>
 </div>
 
 <div class="flexbox column" style="width:100px">
-  <iframe data-expected-display="block" data-expected-width="100" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
-  <iframe seamless data-expected-display="block" data-expected-width="100" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
+  <iframe data-expected-display="block" data-expected-width="100" src="data:text/html,<body bgcolor=%23fff>iframe</body>"></iframe>
+  <iframe seamless data-expected-display="block" data-expected-width="100" src="data:text/html,<body bgcolor=%23fff>iframe</body>"></iframe>
 </div>
 
 <div class="flexbox column" style="height:210px">
   <button data-expected-display="block" data-expected-width="600" data-expected-height="30">button</button>
   <canvas data-expected-display="block" data-expected-width="600" data-expected-height="30" style="height:30px">canvas</canvas>
-  <iframe data-expected-display="block" data-expected-width="600" data-expected-height="30" style="height:30px" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
-  <iframe seamless data-expected-display="block" data-expected-width="600" data-expected-height="30" style="height:30px" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
+  <iframe data-expected-display="block" data-expected-width="600" data-expected-height="30" style="height:30px" src="data:text/html,<body bgcolor=%23fff>iframe</body>"></iframe>
+  <iframe seamless data-expected-display="block" data-expected-width="600" data-expected-height="30" style="height:30px" src="data:text/html,<body bgcolor=%23fff>iframe</body>"></iframe>
   <object data-expected-display="block" data-expected-width="600" data-expected-height="30">object</object>
   <select data-expected-display="block" data-expected-width="600" data-expected-height="30">
     <option>select</option>
index 872484770151771230a0c0b5a71aa89cca581269..cc8beae67fbafe8a566fbae15cb0b573f2ed3c40 100644 (file)
@@ -22,7 +22,7 @@
         }
         #image {
             float: left;
-            -webkit-shape-outside: url('data:image/svg+xml;utf8,<svg width="100px" height="100px" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#006400" d=" M 0.00 0.00 L 50.00 0.00 C 50.00 33.33 50.00 66.67 50.00 100.00 L 0.00 100.00 L 0.00 0.00 Z" /></svg>');
+            -webkit-shape-outside: url('data:image/svg+xml;utf8,<svg width="100px" height="100px" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="%23006400" d=" M 0.00 0.00 L 50.00 0.00 C 50.00 33.33 50.00 66.67 50.00 100.00 L 0.00 100.00 L 0.00 0.00 Z" /></svg>');
         }
     </style>
 </head>
@@ -31,7 +31,7 @@
         The test passes if you see a solid green square. There should be no red.
     </p>
     <div id="test" class="container">
-        <img id="image" src='data:image/svg+xml;utf8,<svg width="100px" height="100px" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#006400" d=" M 0.00 0.00 L 50.00 0.00 C 50.00 33.33 50.00 66.67 50.00 100.00 L 0.00 100.00 L 0.00 0.00 Z" /></svg>'/>
+        <img id="image" src='data:image/svg+xml;utf8,<svg width="100px" height="100px" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="%23006400" d=" M 0.00 0.00 L 50.00 0.00 C 50.00 33.33 50.00 66.67 50.00 100.00 L 0.00 100.00 L 0.00 0.00 Z" /></svg>'/>
         X
         X
     </div>
index 8c19fc220fabbc23a8b5c8f8c24494c32982510c..340e5ca336bea96c19016d6889d4739804224ba0 100644 (file)
@@ -22,7 +22,7 @@
         }
         #image {
             float: left;
-            -webkit-shape-outside: url('data:image/svg+xml;utf8,<svg width="100px" height="100px" style="background-color: rgba(0,0,0,0.7)" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#006400" d=" M 0.00 0.00 L 50.00 0.00 C 50.00 33.33 50.00 66.67 50.00 100.00 L 0.00 100.00 L 0.00 0.00 Z" /></svg>');
+            -webkit-shape-outside: url('data:image/svg+xml;utf8,<svg width="100px" height="100px" style="background-color: rgba(0,0,0,0.7)" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="%23006400" d=" M 0.00 0.00 L 50.00 0.00 C 50.00 33.33 50.00 66.67 50.00 100.00 L 0.00 100.00 L 0.00 0.00 Z" /></svg>');
             -webkit-shape-image-threshold: 0.8;
         }
     </style>
@@ -32,7 +32,7 @@
         The test passes if you see a solid green square. There should be no red.
     </p>
     <div id="test" class="container">
-        <img id="image" src='data:image/svg+xml;utf8,<svg width="100px" height="100px" style="background-color: rgba(0,0,0,0.7)" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#006400" d=" M 0.00 0.00 L 50.00 0.00 C 50.00 33.33 50.00 66.67 50.00 100.00 L 0.00 100.00 L 0.00 0.00 Z" /></svg>'/>
+        <img id="image" src='data:image/svg+xml;utf8,<svg width="100px" height="100px" style="background-color: rgba(0,0,0,0.7)" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="%23006400" d=" M 0.00 0.00 L 50.00 0.00 C 50.00 33.33 50.00 66.67 50.00 100.00 L 0.00 100.00 L 0.00 0.00 Z" /></svg>'/>
         X
         X
     </div>
index 00368a4e5e3c6b965a7fe210fae400a846ac80dd..d784da5a2ee7aa566af0df0330b1b10e744654ad 100644 (file)
@@ -15,7 +15,7 @@ document.body.appendChild(iframe);
 iframe.src = `data:text/html;charset=utf-8,<!DOCTYPE html>
 <button onclick="runTest()">1. Copy</button>
 <div><br></div>
-<div id="source" oncopy="copy(event)" contenteditable>http://webkit.org/b/&#x1F914;?x=8 + 6<</div>
+<div id="source" oncopy="copy(event)" contenteditable>http://webkit.org/b/&%23x1F914;?x=8 + 6<</div>
 <div id="destination" onpaste="paste(event)" contenteditable>2. Paste here</div>
 <script>
 
index aa1ccdc32a7e773ef77a3a0d1b5f886eda2c8a9a..8a616bc1fc54fd0f388e1f6b199d5df37af223fb 100644 (file)
@@ -21,7 +21,7 @@ const destination = document.getElementById('destination');
 document.getElementById('container').prepend(iframe);
 
 iframe.src = `data:text/html;charset=utf-8,<!DOCTYPE html>
-<div id="source" draggable="true" data-value="http://webkit.org/b/&#x1F914;?x=8 + 6">1. Drag this</div>
+<div id="source" draggable="true" data-value="http://webkit.org/b/&%23x1F914;?x=8 + 6">1. Drag this</div>
 <div id="destination" onpaste="paste(event)">2. Drop here</div>
 <script>
 
index e28782672ce1fed963bee93bca4011993c844812..ef673f9855c2392e9566828a1e85b039fae134d4 100644 (file)
@@ -43,8 +43,8 @@
         <!-- Elements with custom renderers. -->
         <button data-expected-display="block" data-offset-x="50" data-offset-y="150"></button>
         <canvas data-expected-display="block" data-offset-x="50" data-offset-y="150">canvas</canvas>
-        <iframe data-expected-display="block" data-offset-x="50" data-offset-y="150" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
-        <iframe seamless data-expected-display="block" data-offset-x="50" data-offset-y="150" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
+        <iframe data-expected-display="block" data-offset-x="50" data-offset-y="150" src="data:text/html,<body bgcolor=%23fff>iframe</body>"></iframe>
+        <iframe seamless data-expected-display="block" data-offset-x="50" data-offset-y="150" src="data:text/html,<body bgcolor=%23fff>iframe</body>"></iframe>
         <object data-expected-display="block" data-offset-x="50" data-offset-y="150">object</object>
         <select data-expected-display="block" data-offset-x="50" data-offset-y="150">
             <option>select</option>
index 681e670f06933d4dfa4f27df27090da6cb6aa739..f49d31a9db14b50b4a1c28277de0b420b94df559 100644 (file)
@@ -1,6 +1,6 @@
 <head>
 <style>
-@import url("data:text/css,#test{display:none;}");
+@import url("data:text/css,%23test{display:none;}");
 </style>
 <script>
 if (window.testRunner)
index b7e43f5eef153c1b01744cbb5238ea62ea829ab2..2a2ff1539922e600d1284f61c0eb824fbff6c415 100644 (file)
@@ -2,7 +2,7 @@
 <html>
 <head>
 <meta charset="utf-8">
-<link id="link" rel="stylesheet" href="data:text/css,#target{color:red}" media="print">
+<link id="link" rel="stylesheet" href="data:text/css,%23target{color:red}" media="print">
 <script src="../../resources/js-test-pre.js"></script>
 </head>
 <body>
index d675431549f1d11b7ffc3a81561009fd882f0349..462516540901bf88c32780b5d56d7f911c2b8766 100644 (file)
@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<link rel=stylesheet href="data:text/css,#test { width: 100px }" media="screen">
+<link rel=stylesheet href="data:text/css,%23test { width: 100px }" media="screen">
 <div id=result></div>
 <div id=test></div>
 <script>
index 2086141b9f9bef12164a147e870c26b056382646..f5a37cf82e4a15a0fefa1bfe529395d0071922dc 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 <body onload="test()">
-<iframe src='data:text/html,<a id="a" href="#" onclick="document.write(window != top ? &apos;<p>FAIL</p>&apos; : &apos;<p>PASS</p>&apos;); return false">link</a>'></iframe>
+<iframe src='data:text/html,<a id="a" href="%23" onclick="document.write(window != top ? &apos;<p>FAIL</p>&apos; : &apos;<p>PASS</p>&apos;); return false">link</a>'></iframe>
 <script>
 if (window.testRunner) {
     testRunner.dumpAsText();
index 578181436592edcdd65ee79cbec6625bca195623..baab7ab8f07d246a365eb689f8f42039b45cfb93 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 <body onload="test()">
-<iframe src='data:text/html,<a id="a" href="#" onclick="document.write(window != top ? &apos;<p>FAIL</p>&apos; : &apos;<p>PASS</p>&apos;); return false">link</a>'></iframe>
+<iframe src='data:text/html,<a id="a" href="%23" onclick="document.write(window != top ? &apos;<p>FAIL</p>&apos; : &apos;<p>PASS</p>&apos;); return false">link</a>'></iframe>
 <script>
 if (window.testRunner) {
     testRunner.dumpAsText();
index 342ad9493a7cc9db0a5142b4740d74e207b91bb5..ba68a9dbda40eb8d238030d9c400b1619dbae895 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 <body onload="test()">
-<iframe src='data:text/html,<a id="a" href="#" onclick="document.write(window != top ? &apos;<p>FAIL</p>&apos; : &apos;<p>PASS</p>&apos;); return false">link</a>'></iframe>
+<iframe src='data:text/html,<a id="a" href="%23" onclick="document.write(window != top ? &apos;<p>FAIL</p>&apos; : &apos;<p>PASS</p>&apos;); return false">link</a>'></iframe>
 <script>
 if (window.testRunner) {
     testRunner.dumpAsText();
index 05ae7f5daad4dfe60e9f4f9d5c993ff2d301aa48..52df1e19084d1b04b243d12eccacc633cddd0b76 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 <body onload="test()">
-<iframe src='data:text/html,<a id="a" href="#" onclick="document.write(window != top ? &apos;<p>FAIL</p>&apos; : &apos;<p>PASS</p>&apos;); return false">link</a>'></iframe>
+<iframe src='data:text/html,<a id="a" href="%23" onclick="document.write(window != top ? &apos;<p>FAIL</p>&apos; : &apos;<p>PASS</p>&apos;); return false">link</a>'></iframe>
 <script>
 if (window.testRunner) {
     testRunner.dumpAsText();
index a37c88aaa43344c9b39ed4939f0259cf618c337b..98edfb53c99b6b5ba563bf7fb8ef749b811acca7 100644 (file)
@@ -13,6 +13,6 @@
 </head>
 <body id="body">
     <div>This test passes if the image below is not empty. It ensures that the srcset attribute support data URI schemes with escaped characters.</div>
-    <img id="foo" src="" srcset="data:image/svg+xml,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='100'%20height='100'><linearGradient%20id='gradient'><stop%20offset='10%'%20stop-color='#F00'/><stop%20offset='90%'%20stop-color='#fcc'/></linearGradient><rect%20fill='url(#gradient)'%20x='0'%20y='0'%20width='100%'%20height='100%'/></svg> 2x">
+    <img id="foo" src="" srcset="data:image/svg+xml,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='100'%20height='100'><linearGradient%20id='gradient'><stop%20offset='10%'%20stop-color='%23F00'/><stop%20offset='90%'%20stop-color='%23fcc'/></linearGradient><rect%20fill='url(%23gradient)'%20x='0'%20y='0'%20width='100%'%20height='100%'/></svg> 2x">
 </body>
 </html>
index 8e631eef436ec116f3ec7562d9a7a17fbda866c3..0653a4cacf82186cfecbc386d6765531c27de0d0 100644 (file)
@@ -2,10 +2,10 @@
 <html>
 <head>
 <title>Test for importing styles via incorrect link element</title>
-<link type="text/css" href="data:text/css;charset=utf-8,p#one%20%7Bbackground-color%3A%20red%3B%7D%0D%0A"/>
-<link rel="stylesheet" href="data:text/css;charset=utf-8,p#two%20%7Bbackground-color%3A%20lime%3B%7D%0D%0A"/>
-<link href="data:text/css;charset=utf-8,p#three%20%7Bbackground-color%3A%20red%3B%7D%0D%0A"/>
-<link type="text/css" rel="stylesheet" href="data:text/css;charset=utf-8,p#four%20%7Bbackground-color%3A%20lime%3B%7D%0D%0A"/>
+<link type="text/css" href="data:text/css;charset=utf-8,p%23one%20%7Bbackground-color%3A%20red%3B%7D%0D%0A"/>
+<link rel="stylesheet" href="data:text/css;charset=utf-8,p%23two%20%7Bbackground-color%3A%20lime%3B%7D%0D%0A"/>
+<link href="data:text/css;charset=utf-8,p%23three%20%7Bbackground-color%3A%20red%3B%7D%0D%0A"/>
+<link type="text/css" rel="stylesheet" href="data:text/css;charset=utf-8,p%23four%20%7Bbackground-color%3A%20lime%3B%7D%0D%0A"/>
 </head>
 <body>
 <p id="one">This line should not have red background</p>
index dc4d14e78f917de795357074245e9b247332f580..2760419c41126d900b64e1e4fb3d947074c4dce2 100644 (file)
@@ -13,6 +13,6 @@ function test() {
 }
 </script>
 <iframe src="data:text/html;charset=utf-8,<body>ðÒÏ×ÅÒËÁ</body>"></iframe>
-<iframe src="data:text/html;charset=utf-8,<body foo='#'>ðÒÏ×ÅÒËÁ</body>"></iframe>
+<iframe src="data:text/html;charset=utf-8,<body foo='%23'>ðÒÏ×ÅÒËÁ</body>"></iframe>
 <iframe src="data:text/html;charset=utf-8,<body>%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0</body>"></iframe>
 </body>
index 25282191911bdca7b6be9d8dc46b4ae712bcab05..0ae31d8e68747dbe686ec0be7c1493f31af83577 100644 (file)
@@ -17,6 +17,6 @@ function test() {
 <p>Test that non-ASCII data: URLs are handled correctly.</p>
 <pre id=result></pre>
 <iframe src="data:image/svg+xml;charset=utf-8,<svg xmlns=%22http://www.w3.org/2000/svg%22 test='ðÒÏ×ÅÒËÁ'></svg>"></iframe>
-<iframe src="data:image/svg+xml;charset=utf-8,<svg xmlns=%22http://www.w3.org/2000/svg%22 foo='#' test='ðÒÏ×ÅÒËÁ'></svg>"></iframe>
-<iframe src="data:image/svg+xml;charset=utf-8,<svg xmlns=%22http://www.w3.org/2000/svg%22 foo='#' test='%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0'></svg>"></iframe>
+<iframe src="data:image/svg+xml;charset=utf-8,<svg xmlns=%22http://www.w3.org/2000/svg%22 foo='%23' test='ðÒÏ×ÅÒËÁ'></svg>"></iframe>
+<iframe src="data:image/svg+xml;charset=utf-8,<svg xmlns=%22http://www.w3.org/2000/svg%22 foo='%23' test='%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0'></svg>"></iframe>
 </body>
index 30388d51dfb91eb12d3eadc8ff3230c1206a1b54..09e1e6fa2fb5ae820c5fc3a37293feab6b1e1b8e 100644 (file)
@@ -2,14 +2,14 @@
 <body>
   <iframe width='80%' height="70px" frameborder="0" src="data:text/html,
   <body>
-    <a id='1' href='#'>b</a>
-    <a id='2' href='#'>c</a>
-    <a id='3' href='#'>d</a>
-    <a id='4' href='#'>e</a>
-    <a id='5' href='#'>f</a>
-    <a id='6' href='#'>g</a>
-    <a id='7' href='#'>h</a>
-    <a id='8' href='#'>i</a>
+    <a id='1' href='%23'>b</a>
+    <a id='2' href='%23'>c</a>
+    <a id='3' href='%23'>d</a>
+    <a id='4' href='%23'>e</a>
+    <a id='5' href='%23'>f</a>
+    <a id='6' href='%23'>g</a>
+    <a id='7' href='%23'>h</a>
+    <a id='8' href='%23'>i</a>
   </body>
  "></iframe>
 </body>
index ba39ad47110eaab7ed2aec4f8957b46ddabed58c..30e7fd93dc4c6c99c05332e9ae42c7745891d867 100644 (file)
@@ -8,7 +8,7 @@
     function doTest()
     {
         if (window.location.hash === "") {
-            window.location = "data:text/html,<"+ "script>window.location = '" + window.location.href + "#' + window.isSecureContext;<" + "/script>"
+            window.location = "data:text/html,<"+ "script>window.location = '" + window.location.href + "%23' + window.isSecureContext;<" + "/script>"
             return;
         }
         onload = () => {
index 57ce95cc09738ac9ee4b9ee6072eb45ac7da9b10..f2a121c28c7fd00c34e9ca1efe4ecee43b3e8713 100644 (file)
@@ -1,3 +1,16 @@
+2020-10-05  Rob Buis  <rbuis@igalia.com>
+
+        WebKit doesn't parse "#" as delimiter for fragment identifier in data URIs
+        https://bugs.webkit.org/show_bug.cgi?id=68089
+
+        Reviewed by Alex Christensen, Ryosuke Niwa, and Darin Adler.
+
+        Update improved test results.
+
+        * web-platform-tests/fetch/data-urls/processing.any-expected.txt:
+        * web-platform-tests/fetch/data-urls/processing.any.worker-expected.txt:
+        * web-platform-tests/url/data-uri-fragment-expected.txt:
+
 2020-10-05  Sergio Villar Senin  <svillar@igalia.com>
 
         [css-flex] Fix expectations of a test which is actually passing
index e6e663c3f88aefdede03c280bf10d8afd1d11ce1..665ddbc6e49c12e884b01d203adf21adca4f20e9 100644 (file)
@@ -7,7 +7,7 @@ PASS "data:"
 PASS "data:text/html"
 PASS "data:text/html    ;charset=x   "
 PASS "data:,"
-FAIL "data:,X#X" assert_array_equals: lengths differ, expected array [88] length 1, got object "88,35,88" length 3
+PASS "data:,X#X"
 PASS "data:,%FF"
 PASS "data:text/plain,X"
 PASS "data:text/plain ,X"
index e6e663c3f88aefdede03c280bf10d8afd1d11ce1..665ddbc6e49c12e884b01d203adf21adca4f20e9 100644 (file)
@@ -7,7 +7,7 @@ PASS "data:"
 PASS "data:text/html"
 PASS "data:text/html    ;charset=x   "
 PASS "data:,"
-FAIL "data:,X#X" assert_array_equals: lengths differ, expected array [88] length 1, got object "88,35,88" length 3
+PASS "data:,X#X"
 PASS "data:,%FF"
 PASS "data:text/plain,X"
 PASS "data:text/plain ,X"
index d41137a3896d6a5ad617066647b562ceb5750861..e369c76728d35b75237d8bd3e448e1198e5a8402 100644 (file)
@@ -1,4 +1,4 @@
 
 
-FAIL Data URI parsing of fragments assert_equals: expected "<p id=\"foo\">This should be the only visible text.</p>" but got "<p id=\"foo\">This should be the only visible text.</p>#foo"
+PASS Data URI parsing of fragments
 
index 5e3a8208fe7a65ec2fcbbc12339b23e487adcc92..2e63b2edda1fcd295d0f224d74ef7b1e26697b4d 100644 (file)
@@ -31,7 +31,7 @@ FAIL .flexbox 18 assert_equals:
 <div class="flexbox" style="height:200px">
   <button data-expected-display="block" data-expected-width="100" data-expected-height="200">button</button>
   <canvas data-expected-display="block" data-expected-width="100" data-expected-height="200">canvas</canvas>
-  <iframe data-expected-display="block" data-expected-width="100" data-expected-height="200" src="data:text/html,&lt;body bgcolor=#fff&gt;iframe&lt;/body&gt;"></iframe>
+  <iframe data-expected-display="block" data-expected-width="100" data-expected-height="200" src="data:text/html,&lt;body bgcolor=%23fff&gt;iframe&lt;/body&gt;"></iframe>
   <object data-expected-display="block" data-expected-width="100" data-expected-height="200">object</object>
   <select data-expected-display="block" data-expected-width="100" data-expected-height="200">
     <option>select</option>
index 49a64606aea576fc5c9472efb8dd5ac15226b8aa..a7fe566b268c1ae82ffbb71a82ab74f0fe6d6fe6 100644 (file)
@@ -10,8 +10,8 @@ FAIL .flexbox 8 assert_equals:
 <div class="flexbox column" style="height:210px">
   <button data-expected-display="block" data-expected-width="600" data-expected-height="30">button</button>
   <canvas data-expected-display="block" data-expected-width="600" data-expected-height="30" style="height:30px">canvas</canvas>
-  <iframe data-expected-display="block" data-expected-width="600" data-expected-height="30" style="height:30px" src="data:text/html,&lt;body bgcolor=#fff&gt;iframe&lt;/body&gt;"></iframe>
-  <iframe seamless="" data-expected-display="block" data-expected-width="600" data-expected-height="30" style="height:30px" src="data:text/html,&lt;body bgcolor=#fff&gt;iframe&lt;/body&gt;"></iframe>
+  <iframe data-expected-display="block" data-expected-width="600" data-expected-height="30" style="height:30px" src="data:text/html,&lt;body bgcolor=%23fff&gt;iframe&lt;/body&gt;"></iframe>
+  <iframe seamless="" data-expected-display="block" data-expected-width="600" data-expected-height="30" style="height:30px" src="data:text/html,&lt;body bgcolor=%23fff&gt;iframe&lt;/body&gt;"></iframe>
   <object data-expected-display="block" data-expected-width="600" data-expected-height="30">object</object>
   <select data-expected-display="block" data-expected-width="600" data-expected-height="30">
     <option>select</option>
@@ -32,7 +32,7 @@ FAIL .flexbox 18 assert_equals:
 <div class="flexbox" style="height:200px">
   <button data-expected-display="block" data-expected-width="100" data-expected-height="200">button</button>
   <canvas data-expected-display="block" data-expected-width="100" data-expected-height="200">canvas</canvas>
-  <iframe data-expected-display="block" data-expected-width="100" data-expected-height="200" src="data:text/html,&lt;body bgcolor=#fff&gt;iframe&lt;/body&gt;"></iframe>
+  <iframe data-expected-display="block" data-expected-width="100" data-expected-height="200" src="data:text/html,&lt;body bgcolor=%23fff&gt;iframe&lt;/body&gt;"></iframe>
   <object data-expected-display="block" data-expected-width="100" data-expected-height="200">object</object>
   <select data-expected-display="block" data-expected-width="100" data-expected-height="200">
     <option>select</option>
index 9db2693518e02c8cf89c1346efbeb9cf836ab741..90b828f4c868be9429fbd794b3ea64e402089e91 100644 (file)
@@ -13,7 +13,7 @@
 if (window.internals && window.internals.settings)
     internals.settings.setAllowContentSecurityPolicySourceStarToMatchAnyProtocol(true);
 </script>
-<link rel="stylesheet" href="data:text/css, #test { background-color: green !important; }">
+<link rel="stylesheet" href="data:text/css, %23test { background-color: green !important; }">
 </head>
 <body>
 <p>This tests that loading a stylesheet with a data URL is allowed when the page has Content Security Policy &quot;style-src *&quot; and the WebKit setting AllowContentSecurityPolicySourceStarToMatchAnyProtocol is enabled. This test PASSED if you see a green square below. Otherwise, it FAILED.</p>
index c854c52dd1675f92e0118a67942c48de3ad695ee..5fd558683f76f34d06d0c2d68f5f80b42bdca787 100644 (file)
@@ -9,7 +9,7 @@
                         from { opacity:0; } \
                         to { opacity:1; } \
                     } \
-                    #green { \
+                    %23green { \
                         animation: fadein 16ms; \
                     } \
                 %3C/style%3E \
index a8b37f641a56696333f50662af099529d5ed5ca9..48ca5a55cd4acac0586abd791db101fc7f40ecd2 100644 (file)
@@ -12,7 +12,7 @@
                     from { opacity:0; }
                     to { opacity:1; }
                 }
-                #green { 
+                %23green { 
                     animation: fadein 16ms;
                 }
             </style>
index dd73665899ae3b5bb2cd5f7d7bcec7947a1f07bc..a24cc4c92f97159d3f8b8f025da210b9578ebe5c 100644 (file)
@@ -12,7 +12,7 @@
                         from { opacity:0; } \
                         to { opacity:1; } \
                     } \
-                    #green { \
+                    %23green { \
                         animation: fadein 16ms; \
                     } \
                 %3C/style%3E \
index 31e5efd9531a6b7e56e6a7fca6a05450dda1f601..8820eda5eb74658f97986e555fa21cf7c5ebeb51 100644 (file)
@@ -23,7 +23,7 @@
                 + '            </feImage>'
                 + '        </filter>'
                 + '    </defs>'
-                + '    <rect width="100%" height="100%" style="filter:url(#image);"/>'
+                + '    <rect width="100%" height="100%" style="filter:url(%23image);"/>'
                 + '</svg>';
 
         var svg = new Image();
index 779dadc77bf8414e6910029be081d8301bf2bc23..1025a23a1fdba85a9f653e9573030b50e123409c 100644 (file)
@@ -7,7 +7,7 @@
       <defs>
         <rect id='rect' width='100' height='100' fill='green'/>
       </defs>
-      <use xlink:href='#rect'/>
+      <use xlink:href='%23rect'/>
     </svg>
   "></object>
 </body>
index 86ee6e8a6066500e2b39780307aaf338e90518dc..e49756f140afc91ec14b090f674d766196392614 100644 (file)
@@ -1,3 +1,13 @@
+2020-10-05  Rob Buis  <rbuis@igalia.com>
+
+        WebKit doesn't parse "#" as delimiter for fragment identifier in data URIs
+        https://bugs.webkit.org/show_bug.cgi?id=68089
+
+        Reviewed by Alex Christensen, Ryosuke Niwa, and Darin Adler.
+
+        * wtf/URL.h:
+        * wtf/spi/darwin/dyldSPI.h:
+
 2020-10-05  Aditya Keerthi  <akeerthi@apple.com>
 
         [Contact Picker API] Introduce bindings for the Contact Picker API
index edcfd21e9eda910dfd921029efa119d97801c826..54dfc4ada73ad6401528f174331d312a0a565f49 100644 (file)
@@ -107,7 +107,7 @@ public:
     WTF_EXPORT_PRIVATE StringView queryWithLeadingQuestionMark() const;
     WTF_EXPORT_PRIVATE StringView fragmentIdentifierWithLeadingNumberSign() const;
     WTF_EXPORT_PRIVATE StringView stringWithoutQueryOrFragmentIdentifier() const;
-    StringView stringWithoutFragmentIdentifier() const;
+    WTF_EXPORT_PRIVATE StringView stringWithoutFragmentIdentifier() const;
 
     WTF_EXPORT_PRIVATE String protocolHostAndPort() const;
     WTF_EXPORT_PRIVATE String hostAndPort() const;
index 3ba081cb15315555ab0e5874084dab5adc9b2d4c..1f7336095a0a5b2026fc1a0b316322035118246a 100644 (file)
 #define DYLD_IOS_VERSION_14_0 0x000E0000
 #endif
 
+#ifndef DYLD_IOS_VERSION_14_5
+#define DYLD_IOS_VERSION_14_5 0x000E0500
+#endif
+
 #ifndef DYLD_MACOSX_VERSION_10_13
 #define DYLD_MACOSX_VERSION_10_13 0x000A0D00
 #endif
 #define DYLD_MACOSX_VERSION_10_16 0x000A1000
 #endif
 
+#ifndef DYLD_MACOSX_VERSION_11_3
+#define DYLD_MACOSX_VERSION_11_3 0x000B0300
+#endif
+
 #else
 
 #define DYLD_IOS_VERSION_3_0 0x00030000
 #define DYLD_IOS_VERSION_13_2 0x000D0200
 #define DYLD_IOS_VERSION_13_4 0x000D0400
 #define DYLD_IOS_VERSION_14_0 0x000E0000
+#define DYLD_IOS_VERSION_14_5 0x000E0500
 
 #define DYLD_MACOSX_VERSION_10_11 0x000A0B00
 #define DYLD_MACOSX_VERSION_10_12 0x000A0C00
 #define DYLD_MACOSX_VERSION_10_15_1 0x000A0F01
 #define DYLD_MACOSX_VERSION_10_15_4 0x000A0F04
 #define DYLD_MACOSX_VERSION_10_16 0x000A1000
+#define DYLD_MACOSX_VERSION_11_3 0x000B0300
 
 #endif
 
index 84cf19318387009926c9f1620b8d382444ed5554..f96b4d27cb2be0ebf43b5748a0b16af7ec720f2d 100644 (file)
@@ -1,3 +1,20 @@
+2020-10-05  Rob Buis  <rbuis@igalia.com>
+
+        WebKit doesn't parse "#" as delimiter for fragment identifier in data URIs
+        https://bugs.webkit.org/show_bug.cgi?id=68089
+
+        Reviewed by Alex Christensen, Ryosuke Niwa, and Darin Adler.
+
+        To maintain compatibility with existing iOS and macOS apps, we only do this for apps linked
+        with the SDK after the change.
+
+        Covered by newly passing web platform tests (which Chrome and Firefox already passed).
+
+        * loader/ResourceLoader.cpp:
+        (WebCore::shouldStripFragmentIdentifier):
+        (WebCore::ResourceLoader::loadDataURL):
+        * platform/cocoa/VersionChecks.h:
+
 2020-10-05  Aditya Keerthi  <akeerthi@apple.com>
 
         [Contact Picker API] Introduce bindings for the Contact Picker API
index b354e7aaaf795ea5f674a112b4dddd5a0ed081cd..30b08a8dce1cdfd22babc4e833af4cb8dddbfe7b 100644 (file)
 #include <wtf/CompletionHandler.h>
 #include <wtf/Ref.h>
 
+#if PLATFORM(COCOA)
+#include "VersionChecks.h"
+#endif
+
 #if ENABLE(CONTENT_EXTENSIONS)
 #include "UserContentController.h"
 #endif
@@ -248,6 +252,15 @@ FrameLoader* ResourceLoader::frameLoader() const
     return &m_frame->loader();
 }
 
+static bool shouldStripFragmentIdentifier()
+{
+#if PLATFORM(COCOA)
+    return linkedOnOrAfter(SDKVersion::FirstWithDataURLFragmentRemoval);
+#else
+    return true;
+#endif
+}
+
 void ResourceLoader::loadDataURL()
 {
     auto url = m_request.url();
@@ -261,6 +274,8 @@ void ResourceLoader::loadDataURL()
     auto mode = DataURLDecoder::Mode::Legacy;
     if (m_request.requester() == ResourceRequest::Requester::Fetch)
         mode = DataURLDecoder::Mode::ForgivingBase64;
+    if (shouldStripFragmentIdentifier())
+        url.removeFragmentIdentifier();
     DataURLDecoder::decode(url, scheduleContext, mode, [this, protectedThis = makeRef(*this), url](auto decodeResult) mutable {
         if (this->reachedTerminalState())
             return;
index 1e0bba5cbc518619d18321219cfb1220efd5b065..e172135095bb034cb7bac62e128e2e02b7f7eccd 100644 (file)
@@ -64,6 +64,7 @@ enum class SDKVersion : uint32_t {
     FirstWithInitializeWebKit2MainThreadAssertion = DYLD_IOS_VERSION_14_0,
     FirstWithWKWebsiteDataStoreInitReturningNil = DYLD_IOS_VERSION_14_0,
     FirstVersionWithiOSAppsOnMacOS = DYLD_IOS_VERSION_FIRST_WITH_IOS_APPS_ON_MACOS,
+    FirstWithDataURLFragmentRemoval = DYLD_IOS_VERSION_14_5,
 #elif PLATFORM(MAC)
     FirstWithNetworkCache = DYLD_MACOSX_VERSION_10_11,
     FirstWithExceptionsForDuplicateCompletionHandlerCalls = DYLD_MACOSX_VERSION_10_13,
@@ -79,6 +80,7 @@ enum class SDKVersion : uint32_t {
     FirstWithSessionCleanupByDefault = DYLD_MACOSX_VERSION_10_16,
     FirstWithInitializeWebKit2MainThreadAssertion = DYLD_MACOSX_VERSION_10_16,
     FirstWithWKWebsiteDataStoreInitReturningNil = DYLD_MACOSX_VERSION_10_16,
+    FirstWithDataURLFragmentRemoval = DYLD_MACOSX_VERSION_11_3,
 #endif
 };