⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 263841 in webkit


Ignore:
Timestamp:
Jul 2, 2020, 5:38:08 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Fragment navigation involving fragment identifiers does not match specification
https://bugs.webkit.org/show_bug.cgi?id=83930

Patch by Rob Buis <rbuis@igalia.com> on 2020-07-02
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Update improved test results and import scroll-frag-non-utf8-encoded-document.html.

  • web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding-2-expected.txt:
  • web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding-expected.txt:
  • web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-non-utf8-encoded-document-expected.txt: Added.
  • web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-non-utf8-encoded-document.html: Added.
  • web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name-expected.txt:

Source/WebCore:

Implement step 5 and 6 of [1] to allow fragment identifier lookup
using percent-decoding, after normal lookup failed.

Behavior matches Chrome and Firefox.

[1] https://html.spec.whatwg.org/multipage/browsing-the-web.html#the-indicated-part-of-the-document

Tests: imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name.html

imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding-2.html
imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding.html
imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-non-utf8-encoded-document.html

  • page/FrameView.cpp:

(WebCore::FrameView::scrollToFragmentInternal):

LayoutTests:

Replace anchor-frames-gbk.html by scroll-frag-non-utf8-encoded-document.html.

  • http/tests/navigation/anchor-frames-gbk-expected.txt: Removed.
  • http/tests/navigation/anchor-frames-gbk.html: Removed.
  • http/tests/navigation/resources/frame-with-anchor-gbk.html: Removed.
  • platform/ios-wk1/TestExpectations:
  • platform/ios-wk2/TestExpectations:
Location:
trunk
Files:
2 added
3 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r263840 r263841  
     12020-07-02  Rob Buis  <rbuis@igalia.com>
     2
     3        Fragment navigation involving fragment identifiers does not match specification
     4        https://bugs.webkit.org/show_bug.cgi?id=83930
     5
     6        Reviewed by Darin Adler.
     7
     8        Replace anchor-frames-gbk.html by scroll-frag-non-utf8-encoded-document.html.
     9
     10        * http/tests/navigation/anchor-frames-gbk-expected.txt: Removed.
     11        * http/tests/navigation/anchor-frames-gbk.html: Removed.
     12        * http/tests/navigation/resources/frame-with-anchor-gbk.html: Removed.
     13        * platform/ios-wk1/TestExpectations:
     14        * platform/ios-wk2/TestExpectations:
     15
    1162020-07-02  Enrique Ocaña González  <eocanha@igalia.com>
    217
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r263661 r263841  
     12020-07-02  Rob Buis  <rbuis@igalia.com>
     2
     3        Fragment navigation involving fragment identifiers does not match specification
     4        https://bugs.webkit.org/show_bug.cgi?id=83930
     5
     6        Reviewed by Darin Adler.
     7
     8        Update improved test results and import scroll-frag-non-utf8-encoded-document.html.
     9
     10        * web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding-2-expected.txt:
     11        * web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding-expected.txt:
     12        * web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-non-utf8-encoded-document-expected.txt: Added.
     13        * web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-non-utf8-encoded-document.html: Added.
     14        * web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name-expected.txt:
     15
    1162020-06-29  Chris Dumez  <cdumez@apple.com>
    217
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding-2-expected.txt

    r249886 r263841  
    11
    2 FAIL Invalid percent-encoded UTF-8 byte should decode as U+FFFD assert_greater_than: #%C2 expected a number greater than 1000 but got 0
    3 FAIL Percent-encoded UTF-8 BOM followed by invalid UTF-8 byte should decode as U+FEFF U+FFFD assert_greater_than: #%EF%BB%BF%C2 expected a number greater than 1000 but got 0
    4 FAIL Percent-encoded UTF-8 byte sequence for U+FFFD should decode as U+FFFD assert_greater_than: #%EF%BF%BD expected a number greater than 1000 but got 0
     2PASS Invalid percent-encoded UTF-8 byte should decode as U+FFFD
     3PASS Percent-encoded UTF-8 BOM followed by invalid UTF-8 byte should decode as U+FEFF U+FFFD
     4PASS Percent-encoded UTF-8 byte sequence for U+FFFD should decode as U+FFFD
    55
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding-expected.txt

    r249886 r263841  
    11
    2 FAIL U+00FF should find U+00FF assert_greater_than: #%C3%BF expected a number greater than 1000 but got 0
    3 FAIL Percent-encoded UTF-8 BOM should find U+FEFF as BOM is not stripped when decoding assert_greater_than: #%EF%BB%BF expected a number greater than 1000 but got 0
    4 FAIL %FF should not find U+00FF as decoding it gives U+FFFD assert_equals: #%FF expected 0 but got 9416
     2PASS U+00FF should find U+00FF
     3PASS Percent-encoded UTF-8 BOM should find U+FEFF as BOM is not stripped when decoding
     4PASS %FF should not find U+00FF as decoding it gives U+FFFD
    55PASS Valid UTF-8 + invalid UTF-8 should not be matched to the utf8-decoded former + the isomorphic-decoded latter
    66
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name-expected.txt

    r230445 r263841  
    11
    2 FAIL Fragment Navigation: scroll to anchor name is lower priority than equal id assert_equals: expected 400 but got 300
     2PASS Fragment Navigation: scroll to anchor name is lower priority than equal id
    33
  • trunk/LayoutTests/platform/ios-wk1/TestExpectations

    r262056 r263841  
    10621062http/tests/navigation/anchor-basic.html
    10631063http/tests/navigation/anchor-frames-cross-origin.html
    1064 http/tests/navigation/anchor-frames-gbk.html
    10651064http/tests/security/contentSecurityPolicy/media-src-blocked.html
    10661065http/tests/security/contentSecurityPolicy/media-src-track-block.html
  • trunk/LayoutTests/platform/ios-wk2/TestExpectations

    r263822 r263841  
    324324http/tests/misc/redirect-to-external-url.html [ Failure ]
    325325http/tests/misc/slow-loading-image-in-pattern.html [ Failure ]
    326 http/tests/navigation/anchor-frames-gbk.html [ Failure ]
    327326http/tests/navigation/anchor-frames-same-origin.html [ Failure ]
    328327http/tests/navigation/anchor-frames.html [ Failure ]
  • trunk/Source/WebCore/ChangeLog

    r263838 r263841  
     12020-07-02  Rob Buis  <rbuis@igalia.com>
     2
     3        Fragment navigation involving fragment identifiers does not match specification
     4        https://bugs.webkit.org/show_bug.cgi?id=83930
     5
     6        Reviewed by Darin Adler.
     7
     8        Implement step 5 and 6 of [1] to allow fragment identifier lookup
     9        using percent-decoding, after normal lookup failed.
     10
     11        Behavior matches Chrome and Firefox.
     12
     13        [1] https://html.spec.whatwg.org/multipage/browsing-the-web.html#the-indicated-part-of-the-document
     14
     15        Tests: imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name.html
     16               imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding-2.html
     17               imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding.html
     18               imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-non-utf8-encoded-document.html
     19
     20        * page/FrameView.cpp:
     21        (WebCore::FrameView::scrollToFragmentInternal):
     22
    1232020-07-02  Alexander Mikhaylenko  <alexm@gnome.org>
    224
  • trunk/Source/WebCore/page/FrameView.cpp

    r263776 r263841  
    21822182        return true;
    21832183
    2184     // Try again after decoding the ref, based on the document's encoding.
    2185     if (TextResourceDecoder* decoder = frame().document()->decoder()) {
    2186         if (scrollToFragmentInternal(decodeURLEscapeSequences(fragmentIdentifier, decoder->encoding())))
    2187             return true;
    2188     }
     2184    if (scrollToFragmentInternal(decodeURLEscapeSequences(fragmentIdentifier)))
     2185        return true;
    21892186
    21902187    resetScrollAnchor();
Note: See TracChangeset for help on using the changeset viewer.