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

Changeset 245900 in webkit


Ignore:
Timestamp:
May 30, 2019, 12:41:53 PM (7 years ago)
Author:
Alan Bujtas
Message:

[iOS] Do not linkify telephone numbers inside <a> elements.
https://bugs.webkit.org/show_bug.cgi?id=198378

Reviewed by Chris Dumez.

Source/WebCore:

Phone number linkifying mutates the DOM in a potentially unexpected way triggering different kinds of failures with JS, CSS selectors etc.
This patch tightens the linkifying rule so that content inside an <a> element won't get linkified even when the <a> has no valid href attribute.

Test: fast/dom/linkify-phone-numbers.html

  • html/parser/HTMLTreeBuilder.cpp:

(WebCore::disallowTelephoneNumberParsing):

LayoutTests:

  • fast/dom/linkify-phone-numbers-expected.html: Added.
  • fast/dom/linkify-phone-numbers.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r245887 r245900  
     12019-05-30  Zalan Bujtas  <zalan@apple.com>
     2
     3        [iOS] Do not linkify telephone numbers inside <a> elements.
     4        https://bugs.webkit.org/show_bug.cgi?id=198378
     5
     6        Reviewed by Chris Dumez.
     7
     8        * fast/dom/linkify-phone-numbers-expected.html: Added.
     9        * fast/dom/linkify-phone-numbers.html: Added.
     10
    1112019-05-30  Jer Noble  <jer.noble@apple.com>
    212
  • trunk/LayoutTests/TestExpectations

    r245623 r245900  
    31023102
    31033103webkit.org/b/198103 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/offsets-into-the-media-resource/currentTime.html [ Pass Failure ]
     3104
     3105# iOS only
     3106fast/dom/linkify-phone-numbers.html [ ImageOnlyFailure ]
  • trunk/LayoutTests/platform/ios/TestExpectations

    r245483 r245900  
    22252225webkit.org/b/148806 imported/w3c/web-platform-tests/css/css-multicol/multicol-span-all-margin-nested-firstchild-001.xht [ ImageOnlyFailure ]
    22262226
     2227# Enable "phone number linkifying" test for iOS
     2228fast/dom/linkify-phone-numbers.html [ Pass ]
     2229
    22272230# Enable "aria-current" test for iOS
    22282231webkit.org/b/149297 accessibility/aria-current.html [ Pass ]
  • trunk/Source/WebCore/ChangeLog

    r245897 r245900  
     12019-05-30  Zalan Bujtas  <zalan@apple.com>
     2
     3        [iOS] Do not linkify telephone numbers inside <a> elements.
     4        https://bugs.webkit.org/show_bug.cgi?id=198378
     5
     6        Reviewed by Chris Dumez.
     7
     8        Phone number linkifying mutates the DOM in a potentially unexpected way triggering different kinds of failures with JS, CSS selectors etc.
     9        This patch tightens the linkifying rule so that content inside an <a> element won't get linkified even when the <a> has no valid href attribute.
     10
     11        Test: fast/dom/linkify-phone-numbers.html
     12
     13        * html/parser/HTMLTreeBuilder.cpp:
     14        (WebCore::disallowTelephoneNumberParsing):
     15
    1162019-05-30  Truitt Savell  <tsavell@apple.com>
    217
  • trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp

    r243782 r245900  
    22592259{
    22602260    return node.isLink()
     2261        || node.hasTagName(aTag)
    22612262        || node.hasTagName(scriptTag)
    22622263        || is<HTMLFormControlElement>(node)
Note: See TracChangeset for help on using the changeset viewer.