WebKit Bugzilla
Attachment 370949 Details for
Bug 198378
: [iOS] Do not linkify telephone numbers inside <a> elements.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198378-20190530100257.patch (text/plain), 5.23 KB, created by
zalan
on 2019-05-30 10:02:58 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-05-30 10:02:58 PDT
Size:
5.23 KB
patch
obsolete
>Subversion Revision: 245816 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a5b3cf9b0989a879872eacedce7ad32361f4135f..1f28256543f1796955b287310a1616ce62360885 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2019-05-30 Zalan Bujtas <zalan@apple.com> >+ >+ [iOS] Do not linkify telephone numbers inside <a> elements. >+ https://bugs.webkit.org/show_bug.cgi?id=198378 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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): >+ > 2019-05-28 Zalan Bujtas <zalan@apple.com> > > [LFC][Verification] Add additional inline and block checks >diff --git a/Source/WebCore/html/parser/HTMLTreeBuilder.cpp b/Source/WebCore/html/parser/HTMLTreeBuilder.cpp >index dedb8a59de5f66bd16575701ce6cd79f4bfa50c4..18fbe4042d4feec6f7fcf32a1372119b531534b8 100644 >--- a/Source/WebCore/html/parser/HTMLTreeBuilder.cpp >+++ b/Source/WebCore/html/parser/HTMLTreeBuilder.cpp >@@ -2258,6 +2258,7 @@ void HTMLTreeBuilder::linkifyPhoneNumbers(const String& string) > static inline bool disallowTelephoneNumberParsing(const ContainerNode& node) > { > return node.isLink() >+ || node.hasTagName(aTag) > || node.hasTagName(scriptTag) > || is<HTMLFormControlElement>(node) > || node.hasTagName(styleTag) >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index f25cbbca484b80edf9224ee4cfc0c14ed82c49dd..24a9e3236d0ab14240cf90dfada582f1433397f6 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2019-05-30 Zalan Bujtas <zalan@apple.com> >+ >+ [iOS] Do not linkify telephone numbers inside <a> elements. >+ https://bugs.webkit.org/show_bug.cgi?id=198378 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/dom/linkify-phone-numbers-expected.html: Added. >+ * fast/dom/linkify-phone-numbers.html: Added. >+ > 2019-05-27 Takashi Komori <Takashi.Komori@sony.com> > > [CURL] Fix crashing SocketStreamHandle. >diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations >index d7dc37c885f9235a1837e585ec91be0530f0fb29..d9293c2a516e0e5a35a3d0fe7e6d1ccf706ec4e2 100644 >--- a/LayoutTests/TestExpectations >+++ b/LayoutTests/TestExpectations >@@ -3101,3 +3101,6 @@ webkit.org/b/196274 imported/w3c/web-platform-tests/xhr/send-redirect-post-uploa > webkit.org/b/157743 imported/w3c/web-platform-tests/resize-observer/eventloop.html [ Pass Failure ] > > webkit.org/b/198103 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/offsets-into-the-media-resource/currentTime.html [ Pass Failure ] >+ >+# iOS only >+fast/dom/linkify-phone-numbers.html [ ImageOnlyFailure ] >diff --git a/LayoutTests/fast/dom/linkify-phone-numbers-expected.html b/LayoutTests/fast/dom/linkify-phone-numbers-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..649b5852d245d4880f01b062580fd96f76c53753 >--- /dev/null >+++ b/LayoutTests/fast/dom/linkify-phone-numbers-expected.html >@@ -0,0 +1,15 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<title>This tests the most common cases of linkifying/not linkifying phone numbers on iOS</title> >+</head> >+<body> >+<a href="tel:408 111 222">408 111 222</a><br> >+<span><a href="tel:408 111 222">408 111 222</a></span> >+<div><a href="tel:408 111 222">408 111 222</a></div> >+<a>408 111 222</a><br> >+<a href="foobar.html">408 111 222</a> >+<pre>408 111 222</pre> >+<code>408 111 222</code> >+</body> >+</html> >diff --git a/LayoutTests/fast/dom/linkify-phone-numbers.html b/LayoutTests/fast/dom/linkify-phone-numbers.html >new file mode 100644 >index 0000000000000000000000000000000000000000..af2a9e434358e80a12421e0161f457646211d6d7 >--- /dev/null >+++ b/LayoutTests/fast/dom/linkify-phone-numbers.html >@@ -0,0 +1,15 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<title>This tests the most common cases of linkifying/not linkifying phone numbers on iOS</title> >+</head> >+<body> >+408 111 222<br> >+<span>408 111 222</span> >+<div>408 111 222</div> >+<a>408 111 222</a><br> >+<a href="foobar.html">408 111 222</a> >+<pre>408 111 222</pre> >+<code>408 111 222</code> >+</body> >+</html> >diff --git a/LayoutTests/platform/ios/TestExpectations b/LayoutTests/platform/ios/TestExpectations >index b5bf208c44ff671ebe74b91a0837937c79790071..d9fed774c6fbad9ee70db2b4277de3e7b3a72f81 100644 >--- a/LayoutTests/platform/ios/TestExpectations >+++ b/LayoutTests/platform/ios/TestExpectations >@@ -2224,6 +2224,9 @@ webkit.org/b/148806 imported/w3c/web-platform-tests/css/css-multicol/multicol-sh > webkit.org/b/148806 imported/w3c/web-platform-tests/css/css-multicol/multicol-span-all-block-sibling-003.xht [ ImageOnlyFailure ] > webkit.org/b/148806 imported/w3c/web-platform-tests/css/css-multicol/multicol-span-all-margin-nested-firstchild-001.xht [ ImageOnlyFailure ] > >+# Enable "phone number linkifying" test for iOS >+fast/dom/linkify-phone-numbers.html [ Pass ] >+ > # Enable "aria-current" test for iOS > webkit.org/b/149297 accessibility/aria-current.html [ Pass ] >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198378
:
370949
|
370957