Changeset 267995 in webkit


Ignore:
Timestamp:
Oct 5, 2020 12:36:22 PM (4 years ago)
Author:
achristensen@apple.com
Message:

WebKit doesn't parse "#" as delimiter for fragment identifier in data URIs
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:
Location:
trunk
Files:
47 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r267994 r267995  
     12020-10-05  Rob Buis  <rbuis@igalia.com>
     2
     3        WebKit doesn't parse "#" as delimiter for fragment identifier in data URIs
     4        https://bugs.webkit.org/show_bug.cgi?id=68089
     5
     6        Reviewed by Alex Christensen, Ryosuke Niwa, and Darin Adler.
     7
     8        Adjusts tests thats use data URIs to escape the # character.
     9
     10        * accessibility/ios-simulator/iframe-access.html:
     11        * accessibility/ios-simulator/unobscured-content-rect.html:
     12        * accessibility/resources/iframe.html:
     13        * accessibility/scroll-to-global-point-iframe.html:
     14        * accessibility/scroll-to-make-visible-iframe-offscreen.html:
     15        * accessibility/scroll-to-make-visible-iframe.html:
     16        * css3/blending/background-blend-mode-crossfade-image.html:
     17        * css3/blending/background-blend-mode-data-uri-svg-image.html:
     18        * css3/blending/background-blend-mode-tiled-layers.html:
     19        * css3/flexbox/flexitem.html:
     20        * css3/shapes/shape-outside/shape-image/shape-image-002.html:
     21        * css3/shapes/shape-outside/shape-image/shape-image-005.html:
     22        * editing/pasteboard/data-transfer-set-data-sanitize-url-when-copying-in-null-origin.html:
     23        * editing/pasteboard/data-transfer-set-data-sanitize-url-when-dragging-in-null-origin.html:
     24        * fast/css-grid-layout/grid-item-display.html:
     25        * fast/css/import-style-update.html:
     26        * fast/css/link-media-attr.html:
     27        * fast/dom/HTMLLinkElement/link-stylesheet-media-type.html:
     28        * fast/events/attribute-listener-cloned-from-frameless-doc-context-2.html:
     29        * fast/events/attribute-listener-cloned-from-frameless-doc-context.html:
     30        * fast/events/attribute-listener-extracted-from-frameless-doc-context-2.html:
     31        * fast/events/attribute-listener-extracted-from-frameless-doc-context.html:
     32        * fast/hidpi/image-srcset-data-escaped-srcset.html:
     33        * fast/html/link-rel-stylesheet.html:
     34        * fast/loader/data-url-encoding-html.html:
     35        * fast/loader/data-url-encoding-svg.html:
     36        * fast/spatial-navigation/resources/iframe.html:
     37        * http/tests/security/top-level-unique-origin.https.html:
     38        * platform/ios/css3/flexbox/flexitem-expected.txt:
     39        * platform/win/css3/flexbox/flexitem-expected.txt:
     40        * security/contentSecurityPolicy/link-with-data-url-allowed-by-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html:
     41        * svg/animations/css-animation-background-svg.html:
     42        * svg/animations/css-animation-embedded-svg.html:
     43        * svg/animations/css-animation-hover-svg.html:
     44        * svg/as-image/svg-canvas-data-url-svg-with-feimage-not-tainted.html:
     45        * svg/custom/object-data-href.html:
     46
    1472020-10-05  Sergio Villar Senin  <svillar@igalia.com>
    248
  • trunk/LayoutTests/accessibility/ios-simulator/iframe-access.html

    r187904 r267995  
    1010
    1111<div id="content">
    12 <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>
     12<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>
    1313</div>
    1414
  • trunk/LayoutTests/accessibility/ios-simulator/unobscured-content-rect.html

    r231113 r267995  
    77<button id="button">test</button>
    88
    9 <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>
     9<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>
    1010
    1111</div>
  • trunk/LayoutTests/accessibility/resources/iframe.html

    r231628 r267995  
    22<body>
    33<div id="box" style='border: 1px solid #000; height: 1000px;'>1000-pixel box</div>
    4 <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>
     4<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>
    55</body>
    66</html>
  • trunk/LayoutTests/accessibility/scroll-to-global-point-iframe.html

    r211573 r267995  
    1212    <body>
    1313        <style>button { border: 0; }</style>
    14         <div style='border: 1px solid #000; height: 5000px;'>5000-pixel box</div>
     14        <div style='border: 1px solid %23000; height: 5000px;'>5000-pixel box</div>
    1515        <button id='target'>Target</button>
    16         <div style='border: 1px solid #000; height: 5000px;'>5000-pixel box</div>
     16        <div style='border: 1px solid %23000; height: 5000px;'>5000-pixel box</div>
    1717    </body>"></iframe>
    1818
  • trunk/LayoutTests/accessibility/scroll-to-make-visible-iframe-offscreen.html

    r231628 r267995  
    99<div style='border: 1px solid #000; height: 5000px;'>5000-pixel box</div>
    1010
    11 <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>
     11<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>
    1212
    1313<br>
  • trunk/LayoutTests/accessibility/scroll-to-make-visible-iframe.html

    r211573 r267995  
    77<p id="description"></p>
    88
    9 <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>
     9<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>
    1010
    1111<div id="console"></div>
  • trunk/LayoutTests/css3/blending/background-blend-mode-crossfade-image.html

    r171295 r267995  
    99        background-image: -webkit-cross-fade(url('data:image/svg+xml;utf8, \
    1010            <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"> \
    11                 <rect width="100" height="100" fill="#F00"/> \
     11                <rect width="100" height="100" fill="%23F00"/> \
    1212            </svg>'
    1313            ), url('data:image/svg+xml;utf8, \
    1414            <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"> \
    15                 <rect width="100" height="100" fill="#F00"/> \
     15                <rect width="100" height="100" fill="%23F00"/> \
    1616            </svg>'
    1717            ), 100%);
  • trunk/LayoutTests/css3/blending/background-blend-mode-data-uri-svg-image.html

    r171295 r267995  
    1010        background: url('data:image/svg+xml;utf8, \
    1111            <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 100 100"> \
    12                 <rect width="100" height="100" fill="#F00"/> \
     12                <rect width="100" height="100" fill="%23F00"/> \
    1313            </svg>'
    1414            ), #FF0;
  • trunk/LayoutTests/css3/blending/background-blend-mode-tiled-layers.html

    r171295 r267995  
    1616        background: url('data:image/svg+xml;utf8, \
    1717            <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"> \
    18                 <rect width="100" height="100" fill="#F00"/> \
     18                <rect width="100" height="100" fill="%23F00"/> \
    1919            </svg>'
    2020            ) 0 0 /50% 50%, #FF0;
     
    2828        background: -webkit-cross-fade(url('data:image/svg+xml;utf8, \
    2929            <svg xmlns="http://www.w3.org/2000/svg" width="100px" height="100px"> \
    30                 <rect width="100" height="100" fill="#F00"/> \
     30                <rect width="100" height="100" fill="%23F00"/> \
    3131            </svg>'
    3232            ), url('data:image/svg+xml;utf8, \
    3333            <svg xmlns="http://www.w3.org/2000/svg" width="100px" height="100px"> \
    34                 <rect width="100" height="100" fill="#F00"/> \
     34                <rect width="100" height="100" fill="%23F00"/> \
    3535            </svg>'
    3636            ), 100%) 0 0 /50% 50%, #FF0;
  • trunk/LayoutTests/css3/flexbox/flexitem.html

    r213831 r267995  
    2626  <button data-expected-display="block" data-expected-width="100" data-expected-height="200">button</button>
    2727  <canvas data-expected-display="block" data-expected-width="100" data-expected-height="200">canvas</canvas>
    28   <iframe data-expected-display="block" data-expected-width="100" data-expected-height="200" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
     28  <iframe data-expected-display="block" data-expected-width="100" data-expected-height="200" src="data:text/html,<body bgcolor=%23fff>iframe</body>"></iframe>
    2929  <object data-expected-display="block" data-expected-width="100" data-expected-height="200">object</object>
    3030  <select data-expected-display="block" data-expected-width="100" data-expected-height="200">
     
    8585
    8686<div class="flexbox" style="height:200px">
    87   <iframe data-expected-display="block" data-expected-height="200" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
    88   <iframe seamless data-expected-display="block" data-expected-height="200" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
     87  <iframe data-expected-display="block" data-expected-height="200" src="data:text/html,<body bgcolor=%23fff>iframe</body>"></iframe>
     88  <iframe seamless data-expected-display="block" data-expected-height="200" src="data:text/html,<body bgcolor=%23fff>iframe</body>"></iframe>
    8989</div>
    9090
    9191<div class="flexbox" style="height:100px">
    92   <iframe data-expected-display="block" data-expected-height="100" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
    93   <iframe seamless data-expected-display="block" data-expected-height="100" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
     92  <iframe data-expected-display="block" data-expected-height="100" src="data:text/html,<body bgcolor=%23fff>iframe</body>"></iframe>
     93  <iframe seamless data-expected-display="block" data-expected-height="100" src="data:text/html,<body bgcolor=%23fff>iframe</body>"></iframe>
    9494</div>
    9595
    9696<div class="flexbox column" style="width:100px">
    97   <iframe data-expected-display="block" data-expected-width="100" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
    98   <iframe seamless data-expected-display="block" data-expected-width="100" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
     97  <iframe data-expected-display="block" data-expected-width="100" src="data:text/html,<body bgcolor=%23fff>iframe</body>"></iframe>
     98  <iframe seamless data-expected-display="block" data-expected-width="100" src="data:text/html,<body bgcolor=%23fff>iframe</body>"></iframe>
    9999</div>
    100100
     
    102102  <button data-expected-display="block" data-expected-width="600" data-expected-height="30">button</button>
    103103  <canvas data-expected-display="block" data-expected-width="600" data-expected-height="30" style="height:30px">canvas</canvas>
    104   <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>
    105   <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>
     104  <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>
     105  <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>
    106106  <object data-expected-display="block" data-expected-width="600" data-expected-height="30">object</object>
    107107  <select data-expected-display="block" data-expected-width="600" data-expected-height="30">
  • trunk/LayoutTests/css3/shapes/shape-outside/shape-image/shape-image-002.html

    r175255 r267995  
    2323        #image {
    2424            float: left;
    25             -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>');
     25            -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>');
    2626        }
    2727    </style>
     
    3232    </p>
    3333    <div id="test" class="container">
    34         <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>'/>
     34        <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>'/>
    3535        X
    3636        X
  • trunk/LayoutTests/css3/shapes/shape-outside/shape-image/shape-image-005.html

    r175255 r267995  
    2323        #image {
    2424            float: left;
    25             -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>');
     25            -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>');
    2626            -webkit-shape-image-threshold: 0.8;
    2727        }
     
    3333    </p>
    3434    <div id="test" class="container">
    35         <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>'/>
     35        <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>'/>
    3636        X
    3737        X
  • trunk/LayoutTests/editing/pasteboard/data-transfer-set-data-sanitize-url-when-copying-in-null-origin.html

    r223278 r267995  
    1616<button onclick="runTest()">1. Copy</button>
    1717<div><br></div>
    18 <div id="source" oncopy="copy(event)" contenteditable>http://webkit.org/b/&#x1F914;?x=8 + 6<</div>
     18<div id="source" oncopy="copy(event)" contenteditable>http://webkit.org/b/&%23x1F914;?x=8 + 6<</div>
    1919<div id="destination" onpaste="paste(event)" contenteditable>2. Paste here</div>
    2020<script>
  • trunk/LayoutTests/editing/pasteboard/data-transfer-set-data-sanitize-url-when-dragging-in-null-origin.html

    r223440 r267995  
    2222
    2323iframe.src = `data:text/html;charset=utf-8,<!DOCTYPE html>
    24 <div id="source" draggable="true" data-value="http://webkit.org/b/&#x1F914;?x=8 + 6">1. Drag this</div>
     24<div id="source" draggable="true" data-value="http://webkit.org/b/&%23x1F914;?x=8 + 6">1. Drag this</div>
    2525<div id="destination" onpaste="paste(event)">2. Drop here</div>
    2626<script>
  • trunk/LayoutTests/fast/css-grid-layout/grid-item-display.html

    r216466 r267995  
    4444        <button data-expected-display="block" data-offset-x="50" data-offset-y="150"></button>
    4545        <canvas data-expected-display="block" data-offset-x="50" data-offset-y="150">canvas</canvas>
    46         <iframe data-expected-display="block" data-offset-x="50" data-offset-y="150" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
    47         <iframe seamless data-expected-display="block" data-offset-x="50" data-offset-y="150" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
     46        <iframe data-expected-display="block" data-offset-x="50" data-offset-y="150" src="data:text/html,<body bgcolor=%23fff>iframe</body>"></iframe>
     47        <iframe seamless data-expected-display="block" data-offset-x="50" data-offset-y="150" src="data:text/html,<body bgcolor=%23fff>iframe</body>"></iframe>
    4848        <object data-expected-display="block" data-offset-x="50" data-offset-y="150">object</object>
    4949        <select data-expected-display="block" data-offset-x="50" data-offset-y="150">
  • trunk/LayoutTests/fast/css/import-style-update.html

    r120683 r267995  
    11<head>
    22<style>
    3 @import url("data:text/css,#test{display:none;}");
     3@import url("data:text/css,%23test{display:none;}");
    44</style>
    55<script>
  • trunk/LayoutTests/fast/css/link-media-attr.html

    r189060 r267995  
    33<head>
    44<meta charset="utf-8">
    5 <link id="link" rel="stylesheet" href="data:text/css,#target{color:red}" media="print">
     5<link id="link" rel="stylesheet" href="data:text/css,%23target{color:red}" media="print">
    66<script src="../../resources/js-test-pre.js"></script>
    77</head>
  • trunk/LayoutTests/fast/dom/HTMLLinkElement/link-stylesheet-media-type.html

    r198004 r267995  
    11<!DOCTYPE html>
    2 <link rel=stylesheet href="data:text/css,#test { width: 100px }" media="screen">
     2<link rel=stylesheet href="data:text/css,%23test { width: 100px }" media="screen">
    33<div id=result></div>
    44<div id=test></div>
  • trunk/LayoutTests/fast/events/attribute-listener-cloned-from-frameless-doc-context-2.html

    r120792 r267995  
    11<html>
    22<body onload="test()">
    3 <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>
     3<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>
    44<script>
    55if (window.testRunner) {
  • trunk/LayoutTests/fast/events/attribute-listener-cloned-from-frameless-doc-context.html

    r120792 r267995  
    11<html>
    22<body onload="test()">
    3 <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>
     3<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>
    44<script>
    55if (window.testRunner) {
  • trunk/LayoutTests/fast/events/attribute-listener-extracted-from-frameless-doc-context-2.html

    r120792 r267995  
    11<html>
    22<body onload="test()">
    3 <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>
     3<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>
    44<script>
    55if (window.testRunner) {
  • trunk/LayoutTests/fast/events/attribute-listener-extracted-from-frameless-doc-context.html

    r120792 r267995  
    11<html>
    22<body onload="test()">
    3 <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>
     3<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>
    44<script>
    55if (window.testRunner) {
  • trunk/LayoutTests/fast/hidpi/image-srcset-data-escaped-srcset.html

    r163415 r267995  
    1414<body id="body">
    1515    <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>
    16     <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">
     16    <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">
    1717</body>
    1818</html>
  • trunk/LayoutTests/fast/html/link-rel-stylesheet.html

    r30673 r267995  
    33<head>
    44<title>Test for importing styles via incorrect link element</title>
    5 <link type="text/css" href="data:text/css;charset=utf-8,p#one%20%7Bbackground-color%3A%20red%3B%7D%0D%0A"/>
    6 <link rel="stylesheet" href="data:text/css;charset=utf-8,p#two%20%7Bbackground-color%3A%20lime%3B%7D%0D%0A"/>
    7 <link href="data:text/css;charset=utf-8,p#three%20%7Bbackground-color%3A%20red%3B%7D%0D%0A"/>
    8 <link type="text/css" rel="stylesheet" href="data:text/css;charset=utf-8,p#four%20%7Bbackground-color%3A%20lime%3B%7D%0D%0A"/>
     5<link type="text/css" href="data:text/css;charset=utf-8,p%23one%20%7Bbackground-color%3A%20red%3B%7D%0D%0A"/>
     6<link rel="stylesheet" href="data:text/css;charset=utf-8,p%23two%20%7Bbackground-color%3A%20lime%3B%7D%0D%0A"/>
     7<link href="data:text/css;charset=utf-8,p%23three%20%7Bbackground-color%3A%20red%3B%7D%0D%0A"/>
     8<link type="text/css" rel="stylesheet" href="data:text/css;charset=utf-8,p%23four%20%7Bbackground-color%3A%20lime%3B%7D%0D%0A"/>
    99</head>
    1010<body>
  • trunk/LayoutTests/fast/loader/data-url-encoding-html.html

    r122687 r267995  
    1414</script>
    1515<iframe src="data:text/html;charset=utf-8,<body>ðÒÏ×ÅÒËÁ</body>"></iframe>
    16 <iframe src="data:text/html;charset=utf-8,<body foo='#'>ðÒÏ×ÅÒËÁ</body>"></iframe>
     16<iframe src="data:text/html;charset=utf-8,<body foo='%23'>ðÒÏ×ÅÒËÁ</body>"></iframe>
    1717<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>
    1818</body>
  • trunk/LayoutTests/fast/loader/data-url-encoding-svg.html

    r122687 r267995  
    1818<pre id=result></pre>
    1919<iframe src="data:image/svg+xml;charset=utf-8,<svg xmlns=%22http://www.w3.org/2000/svg%22 test='ðÒÏ×ÅÒËÁ'></svg>"></iframe>
    20 <iframe src="data:image/svg+xml;charset=utf-8,<svg xmlns=%22http://www.w3.org/2000/svg%22 foo='#' test='ðÒÏ×ÅÒËÁ'></svg>"></iframe>
    21 <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>
     20<iframe src="data:image/svg+xml;charset=utf-8,<svg xmlns=%22http://www.w3.org/2000/svg%22 foo='%23' test='ðÒÏ×ÅÒËÁ'></svg>"></iframe>
     21<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>
    2222</body>
  • trunk/LayoutTests/fast/spatial-navigation/resources/iframe.html

    r72880 r267995  
    33  <iframe width='80%' height="70px" frameborder="0" src="data:text/html,
    44  <body>
    5     <a id='1' href='#'>b</a>
    6     <a id='2' href='#'>c</a>
    7     <a id='3' href='#'>d</a>
    8     <a id='4' href='#'>e</a>
    9     <a id='5' href='#'>f</a>
    10     <a id='6' href='#'>g</a>
    11     <a id='7' href='#'>h</a>
    12     <a id='8' href='#'>i</a>
     5    <a id='1' href='%23'>b</a>
     6    <a id='2' href='%23'>c</a>
     7    <a id='3' href='%23'>d</a>
     8    <a id='4' href='%23'>e</a>
     9    <a id='5' href='%23'>f</a>
     10    <a id='6' href='%23'>g</a>
     11    <a id='7' href='%23'>h</a>
     12    <a id='8' href='%23'>i</a>
    1313  </body>
    1414 "></iframe>
  • trunk/LayoutTests/http/tests/security/top-level-unique-origin.https.html

    r253563 r267995  
    99    {
    1010        if (window.location.hash === "") {
    11             window.location = "data:text/html,<"+ "script>window.location = '" + window.location.href + "#' + window.isSecureContext;<" + "/script>"
     11            window.location = "data:text/html,<"+ "script>window.location = '" + window.location.href + "%23' + window.isSecureContext;<" + "/script>"
    1212            return;
    1313        }
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r267994 r267995  
     12020-10-05  Rob Buis  <rbuis@igalia.com>
     2
     3        WebKit doesn't parse "#" as delimiter for fragment identifier in data URIs
     4        https://bugs.webkit.org/show_bug.cgi?id=68089
     5
     6        Reviewed by Alex Christensen, Ryosuke Niwa, and Darin Adler.
     7
     8        Update improved test results.
     9
     10        * web-platform-tests/fetch/data-urls/processing.any-expected.txt:
     11        * web-platform-tests/fetch/data-urls/processing.any.worker-expected.txt:
     12        * web-platform-tests/url/data-uri-fragment-expected.txt:
     13
    1142020-10-05  Sergio Villar Senin  <svillar@igalia.com>
    215
  • trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/data-urls/processing.any-expected.txt

    r267730 r267995  
    88PASS "data:text/html    ;charset=x   "
    99PASS "data:,"
    10 FAIL "data:,X#X" assert_array_equals: lengths differ, expected array [88] length 1, got object "88,35,88" length 3
     10PASS "data:,X#X"
    1111PASS "data:,%FF"
    1212PASS "data:text/plain,X"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/data-urls/processing.any.worker-expected.txt

    r267730 r267995  
    88PASS "data:text/html    ;charset=x   "
    99PASS "data:,"
    10 FAIL "data:,X#X" assert_array_equals: lengths differ, expected array [88] length 1, got object "88,35,88" length 3
     10PASS "data:,X#X"
    1111PASS "data:,%FF"
    1212PASS "data:text/plain,X"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/url/data-uri-fragment-expected.txt

    r264197 r267995  
    11
    22
    3 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"
     3PASS Data URI parsing of fragments
    44
  • trunk/LayoutTests/platform/ios/css3/flexbox/flexitem-expected.txt

    r267644 r267995  
    3232  <button data-expected-display="block" data-expected-width="100" data-expected-height="200">button</button>
    3333  <canvas data-expected-display="block" data-expected-width="100" data-expected-height="200">canvas</canvas>
    34   <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>
     34  <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>
    3535  <object data-expected-display="block" data-expected-width="100" data-expected-height="200">object</object>
    3636  <select data-expected-display="block" data-expected-width="100" data-expected-height="200">
  • trunk/LayoutTests/platform/win/css3/flexbox/flexitem-expected.txt

    r267644 r267995  
    1111  <button data-expected-display="block" data-expected-width="600" data-expected-height="30">button</button>
    1212  <canvas data-expected-display="block" data-expected-width="600" data-expected-height="30" style="height:30px">canvas</canvas>
    13   <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>
    14   <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>
     13  <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>
     14  <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>
    1515  <object data-expected-display="block" data-expected-width="600" data-expected-height="30">object</object>
    1616  <select data-expected-display="block" data-expected-width="600" data-expected-height="30">
     
    3333  <button data-expected-display="block" data-expected-width="100" data-expected-height="200">button</button>
    3434  <canvas data-expected-display="block" data-expected-width="100" data-expected-height="200">canvas</canvas>
    35   <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>
     35  <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>
    3636  <object data-expected-display="block" data-expected-width="100" data-expected-height="200">object</object>
    3737  <select data-expected-display="block" data-expected-width="100" data-expected-height="200">
  • trunk/LayoutTests/security/contentSecurityPolicy/link-with-data-url-allowed-by-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html

    r202150 r267995  
    1414    internals.settings.setAllowContentSecurityPolicySourceStarToMatchAnyProtocol(true);
    1515</script>
    16 <link rel="stylesheet" href="data:text/css, #test { background-color: green !important; }">
     16<link rel="stylesheet" href="data:text/css, %23test { background-color: green !important; }">
    1717</head>
    1818<body>
  • trunk/LayoutTests/svg/animations/css-animation-background-svg.html

    r259830 r267995  
    1010                        to { opacity:1; } \
    1111                    } \
    12                     #green { \
     12                    %23green { \
    1313                        animation: fadein 16ms; \
    1414                    } \
  • trunk/LayoutTests/svg/animations/css-animation-embedded-svg.html

    r259830 r267995  
    1313                    to { opacity:1; }
    1414                }
    15                 #green {
     15                %23green {
    1616                    animation: fadein 16ms;
    1717                }
  • trunk/LayoutTests/svg/animations/css-animation-hover-svg.html

    r259830 r267995  
    1313                        to { opacity:1; } \
    1414                    } \
    15                     #green { \
     15                    %23green { \
    1616                        animation: fadein 16ms; \
    1717                    } \
  • trunk/LayoutTests/svg/as-image/svg-canvas-data-url-svg-with-feimage-not-tainted.html

    r226599 r267995  
    2424                + '        </filter>'
    2525                + '    </defs>'
    26                 + '    <rect width="100%" height="100%" style="filter:url(#image);"/>'
     26                + '    <rect width="100%" height="100%" style="filter:url(%23image);"/>'
    2727                + '</svg>';
    2828
  • trunk/LayoutTests/svg/custom/object-data-href.html

    r128702 r267995  
    88        <rect id='rect' width='100' height='100' fill='green'/>
    99      </defs>
    10       <use xlink:href='#rect'/>
     10      <use xlink:href='%23rect'/>
    1111    </svg>
    1212  "></object>
  • trunk/Source/WTF/ChangeLog

    r267988 r267995  
     12020-10-05  Rob Buis  <rbuis@igalia.com>
     2
     3        WebKit doesn't parse "#" as delimiter for fragment identifier in data URIs
     4        https://bugs.webkit.org/show_bug.cgi?id=68089
     5
     6        Reviewed by Alex Christensen, Ryosuke Niwa, and Darin Adler.
     7
     8        * wtf/URL.h:
     9        * wtf/spi/darwin/dyldSPI.h:
     10
    1112020-10-05  Aditya Keerthi  <akeerthi@apple.com>
    212
  • trunk/Source/WTF/wtf/URL.h

    r267837 r267995  
    108108    WTF_EXPORT_PRIVATE StringView fragmentIdentifierWithLeadingNumberSign() const;
    109109    WTF_EXPORT_PRIVATE StringView stringWithoutQueryOrFragmentIdentifier() const;
    110     StringView stringWithoutFragmentIdentifier() const;
     110    WTF_EXPORT_PRIVATE StringView stringWithoutFragmentIdentifier() const;
    111111
    112112    WTF_EXPORT_PRIVATE String protocolHostAndPort() const;
  • trunk/Source/WTF/wtf/spi/darwin/dyldSPI.h

    r266836 r267995  
    6262#endif
    6363
     64#ifndef DYLD_IOS_VERSION_14_5
     65#define DYLD_IOS_VERSION_14_5 0x000E0500
     66#endif
     67
    6468#ifndef DYLD_MACOSX_VERSION_10_13
    6569#define DYLD_MACOSX_VERSION_10_13 0x000A0D00
     
    8690#endif
    8791
     92#ifndef DYLD_MACOSX_VERSION_11_3
     93#define DYLD_MACOSX_VERSION_11_3 0x000B0300
     94#endif
     95
    8896#else
    8997
     
    103111#define DYLD_IOS_VERSION_13_4 0x000D0400
    104112#define DYLD_IOS_VERSION_14_0 0x000E0000
     113#define DYLD_IOS_VERSION_14_5 0x000E0500
    105114
    106115#define DYLD_MACOSX_VERSION_10_11 0x000A0B00
     
    112121#define DYLD_MACOSX_VERSION_10_15_4 0x000A0F04
    113122#define DYLD_MACOSX_VERSION_10_16 0x000A1000
     123#define DYLD_MACOSX_VERSION_11_3 0x000B0300
    114124
    115125#endif
  • trunk/Source/WebCore/ChangeLog

    r267988 r267995  
     12020-10-05  Rob Buis  <rbuis@igalia.com>
     2
     3        WebKit doesn't parse "#" as delimiter for fragment identifier in data URIs
     4        https://bugs.webkit.org/show_bug.cgi?id=68089
     5
     6        Reviewed by Alex Christensen, Ryosuke Niwa, and Darin Adler.
     7
     8        To maintain compatibility with existing iOS and macOS apps, we only do this for apps linked
     9        with the SDK after the change.
     10
     11        Covered by newly passing web platform tests (which Chrome and Firefox already passed).
     12
     13        * loader/ResourceLoader.cpp:
     14        (WebCore::shouldStripFragmentIdentifier):
     15        (WebCore::ResourceLoader::loadDataURL):
     16        * platform/cocoa/VersionChecks.h:
     17
    1182020-10-05  Aditya Keerthi  <akeerthi@apple.com>
    219
  • trunk/Source/WebCore/loader/ResourceLoader.cpp

    r266705 r267995  
    5555#include <wtf/Ref.h>
    5656
     57#if PLATFORM(COCOA)
     58#include "VersionChecks.h"
     59#endif
     60
    5761#if ENABLE(CONTENT_EXTENSIONS)
    5862#include "UserContentController.h"
     
    249253}
    250254
     255static bool shouldStripFragmentIdentifier()
     256{
     257#if PLATFORM(COCOA)
     258    return linkedOnOrAfter(SDKVersion::FirstWithDataURLFragmentRemoval);
     259#else
     260    return true;
     261#endif
     262}
     263
    251264void ResourceLoader::loadDataURL()
    252265{
     
    262275    if (m_request.requester() == ResourceRequest::Requester::Fetch)
    263276        mode = DataURLDecoder::Mode::ForgivingBase64;
     277    if (shouldStripFragmentIdentifier())
     278        url.removeFragmentIdentifier();
    264279    DataURLDecoder::decode(url, scheduleContext, mode, [this, protectedThis = makeRef(*this), url](auto decodeResult) mutable {
    265280        if (this->reachedTerminalState())
  • trunk/Source/WebCore/platform/cocoa/VersionChecks.h

    r267966 r267995  
    6565    FirstWithWKWebsiteDataStoreInitReturningNil = DYLD_IOS_VERSION_14_0,
    6666    FirstVersionWithiOSAppsOnMacOS = DYLD_IOS_VERSION_FIRST_WITH_IOS_APPS_ON_MACOS,
     67    FirstWithDataURLFragmentRemoval = DYLD_IOS_VERSION_14_5,
    6768#elif PLATFORM(MAC)
    6869    FirstWithNetworkCache = DYLD_MACOSX_VERSION_10_11,
     
    8081    FirstWithInitializeWebKit2MainThreadAssertion = DYLD_MACOSX_VERSION_10_16,
    8182    FirstWithWKWebsiteDataStoreInitReturningNil = DYLD_MACOSX_VERSION_10_16,
     83    FirstWithDataURLFragmentRemoval = DYLD_MACOSX_VERSION_11_3,
    8284#endif
    8385};
Note: See TracChangeset for help on using the changeset viewer.