Changeset 279818 in webkit
- Timestamp:
- Jul 11, 2021 9:08:46 PM (12 months ago)
- Location:
- trunk
- Files:
-
- 14 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/css/link-basics-expected.html (modified) (1 diff)
-
LayoutTests/fast/css/link-basics.html (modified) (1 diff)
-
LayoutTests/fast/selectors/any-link-basics-expected.txt (modified) (1 diff)
-
LayoutTests/fast/selectors/link-basics-expected.txt (modified) (1 diff)
-
LayoutTests/fast/selectors/link-basics-xhtml-expected.txt (modified) (1 diff)
-
LayoutTests/fast/selectors/resources/html-link-type-tests.js (modified) (1 diff)
-
LayoutTests/fast/selectors/webkit-any-link-basics-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/ParentNode-querySelector-All-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/ParentNode-querySelector-All-xht-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/link-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/HTMLLinkElement.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r279816 r279818 1 2021-07-11 Chris Dumez <cdumez@apple.com> 2 3 :link and :visited pseudo-class selectors should not match <link> elements 4 https://bugs.webkit.org/show_bug.cgi?id=227847 5 6 Reviewed by Sam Weinig. 7 8 Update / Rebaseline existing tests due to behavior change. 9 10 * fast/css/link-basics-expected.html: 11 * fast/css/link-basics.html: 12 * fast/selectors/any-link-basics-expected.txt: 13 * fast/selectors/link-basics-expected.txt: 14 * fast/selectors/link-basics-xhtml-expected.txt: 15 * fast/selectors/resources/html-link-type-tests.js: 16 (testHTMLTagsForLink): 17 * fast/selectors/webkit-any-link-basics-expected.txt: 18 1 19 2021-07-11 Fujii Hironori <Hironori.Fujii@sony.com> 2 20 -
trunk/LayoutTests/fast/css/link-basics-expected.html
r174878 r279818 18 18 <p>Test styling with the :link selector. Any type the text is <em>GREEN</em>, its color should be green.</p> 19 19 <p><a>WebKit</a> <a style="color:lime" href=" ">GREEN</a> <a style="color:lime" href="http://www.webkit.org/notvisited.html">GREEN</a></p> 20 <p><link class="webkit"> <link class="green" style="color:lime" href=" "> <link class="green" style="color:lime" href="http://www.webkit.org/notvisited.html"></p>21 20 <p><area class="webkit"> <area class="green" style="color:lime" href=" "> <area class="green" style="color:lime" href="http://www.webkit.org/notvisited.html"></p> 22 21 </body> -
trunk/LayoutTests/fast/css/link-basics.html
r174878 r279818 21 21 <p>Test styling with the :link selector. Any type the text is <em>GREEN</em>, its color should be green.</p> 22 22 <p><a>WebKit</a> <a href=" ">GREEN</a> <a href="http://www.webkit.org/notvisited.html">GREEN</a></p> 23 <p><link> <link href=" "> <link href="http://www.webkit.org/notvisited.html"></p>24 23 <p><area> <area href=" "> <area href="http://www.webkit.org/notvisited.html"></p> 25 24 </body> -
trunk/LayoutTests/fast/selectors/any-link-basics-expected.txt
r175301 r279818 1160 1160 PASS document.querySelectorAll("#target:any-link").length is 0 1161 1161 PASS document.querySelectorAll(".target:any-link").length is 0 1162 PASS document.getElementById("target").matches(":any-link") is true1163 PASS document.querySelectorAll("#target:any-link").length is 11164 PASS document.querySelectorAll(".target:any-link").length is 11165 PASS document.getElementById("target").matches(":any-link") is true1166 PASS document.querySelectorAll("#target:any-link").length is 11167 PASS document.querySelectorAll(".target:any-link").length is 11162 PASS document.getElementById("target").matches(":any-link") is false 1163 PASS document.querySelectorAll("#target:any-link").length is 0 1164 PASS document.querySelectorAll(".target:any-link").length is 0 1165 PASS document.getElementById("target").matches(":any-link") is false 1166 PASS document.querySelectorAll("#target:any-link").length is 0 1167 PASS document.querySelectorAll(".target:any-link").length is 0 1168 1168 PASS document.getElementById("target").matches(":any-link") is false 1169 1169 PASS document.querySelectorAll("#target:any-link").length is 0 -
trunk/LayoutTests/fast/selectors/link-basics-expected.txt
r175301 r279818 1160 1160 PASS document.querySelectorAll("#target:link").length is 0 1161 1161 PASS document.querySelectorAll(".target:link").length is 0 1162 PASS document.getElementById("target").matches(":link") is true1163 PASS document.querySelectorAll("#target:link").length is 11164 PASS document.querySelectorAll(".target:link").length is 11165 PASS document.getElementById("target").matches(":link") is true1166 PASS document.querySelectorAll("#target:link").length is 11167 PASS document.querySelectorAll(".target:link").length is 11162 PASS document.getElementById("target").matches(":link") is false 1163 PASS document.querySelectorAll("#target:link").length is 0 1164 PASS document.querySelectorAll(".target:link").length is 0 1165 PASS document.getElementById("target").matches(":link") is false 1166 PASS document.querySelectorAll("#target:link").length is 0 1167 PASS document.querySelectorAll(".target:link").length is 0 1168 1168 PASS document.getElementById("target").matches(":link") is false 1169 1169 PASS document.querySelectorAll("#target:link").length is 0 -
trunk/LayoutTests/fast/selectors/link-basics-xhtml-expected.txt
r175301 r279818 1160 1160 PASS document.querySelectorAll("#target:link").length is 0 1161 1161 PASS document.querySelectorAll(".target:link").length is 0 1162 PASS document.getElementById("target").matches(":link") is true1163 PASS document.querySelectorAll("#target:link").length is 11164 PASS document.querySelectorAll(".target:link").length is 11165 PASS document.getElementById("target").matches(":link") is true1166 PASS document.querySelectorAll("#target:link").length is 11167 PASS document.querySelectorAll(".target:link").length is 11162 PASS document.getElementById("target").matches(":link") is false 1163 PASS document.querySelectorAll("#target:link").length is 0 1164 PASS document.querySelectorAll(".target:link").length is 0 1165 PASS document.getElementById("target").matches(":link") is false 1166 PASS document.querySelectorAll("#target:link").length is 0 1167 PASS document.querySelectorAll(".target:link").length is 0 1168 1168 PASS document.getElementById("target").matches(":link") is false 1169 1169 PASS document.querySelectorAll("#target:link").length is 0 -
trunk/LayoutTests/fast/selectors/resources/html-link-type-tests.js
r175301 r279818 41 41 for (var i = 0; i < htmlTags.length; ++i) { 42 42 var tag = htmlTags[i]; 43 var shouldMatch = tag === 'a' || tag === 'area' || tag === 'link';43 var shouldMatch = tag === 'a' || tag === 'area'; 44 44 testHTMLElement(tag, selector, shouldMatch); 45 45 } -
trunk/LayoutTests/fast/selectors/webkit-any-link-basics-expected.txt
r175301 r279818 1160 1160 PASS document.querySelectorAll("#target:-webkit-any-link").length is 0 1161 1161 PASS document.querySelectorAll(".target:-webkit-any-link").length is 0 1162 PASS document.getElementById("target").matches(":-webkit-any-link") is true1163 PASS document.querySelectorAll("#target:-webkit-any-link").length is 11164 PASS document.querySelectorAll(".target:-webkit-any-link").length is 11165 PASS document.getElementById("target").matches(":-webkit-any-link") is true1166 PASS document.querySelectorAll("#target:-webkit-any-link").length is 11167 PASS document.querySelectorAll(".target:-webkit-any-link").length is 11162 PASS document.getElementById("target").matches(":-webkit-any-link") is false 1163 PASS document.querySelectorAll("#target:-webkit-any-link").length is 0 1164 PASS document.querySelectorAll(".target:-webkit-any-link").length is 0 1165 PASS document.getElementById("target").matches(":-webkit-any-link") is false 1166 PASS document.querySelectorAll("#target:-webkit-any-link").length is 0 1167 PASS document.querySelectorAll(".target:-webkit-any-link").length is 0 1168 1168 PASS document.getElementById("target").matches(":-webkit-any-link") is false 1169 1169 PASS document.querySelectorAll("#target:-webkit-any-link").length is 0 -
trunk/LayoutTests/imported/w3c/ChangeLog
r279815 r279818 1 2021-07-11 Chris Dumez <cdumez@apple.com> 2 3 :link and :visited pseudo-class selectors should not match <link> elements 4 https://bugs.webkit.org/show_bug.cgi?id=227847 5 6 Reviewed by Sam Weinig. 7 8 Rebaseline WPT tests now that more checks are passing. 9 10 * web-platform-tests/dom/nodes/ParentNode-querySelector-All-expected.txt: 11 * web-platform-tests/dom/nodes/ParentNode-querySelector-All-xht-expected.txt: 12 * web-platform-tests/html/semantics/selectors/pseudo-classes/link-expected.txt: 13 1 14 2021-07-11 Chris Dumez <cdumez@apple.com> 2 15 -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/ParentNode-querySelector-All-expected.txt
r274167 r279818 596 596 PASS Document.querySelectorAll: :link and :visited pseudo-class selectors, matching a and area elements with href attributes: #pseudo-link :link, #pseudo-link :visited 597 597 PASS Document.querySelector: :link and :visited pseudo-class selectors, matching a and area elements with href attributes: #pseudo-link :link, #pseudo-link :visited 598 FAIL Document.querySelectorAll: :link and :visited pseudo-class selectors, matching no elements: #head :link, #head :visited assert_equals: The method should return the expected number of matches. expected 0 but got 2 599 FAIL Document.querySelector: :link and :visited pseudo-class selectors, matching no elements: #head :link, #head :visited assert_equals: The method should not match anything. expected null but got Element node <link id="pseudo-link-link1" href=""></link> 598 PASS Document.querySelectorAll: :link and :visited pseudo-class selectors, matching no elements: #head :link, #head :visited 599 PASS Document.querySelector: :link and :visited pseudo-class selectors, matching no elements: #head :link, #head :visited 600 600 PASS Document.querySelectorAll: :target pseudo-class selector, matching the element referenced by the URL fragment identifier: :target 601 601 PASS Document.querySelector: :target pseudo-class selector, matching the element referenced by the URL fragment identifier: :target -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/ParentNode-querySelector-All-xht-expected.txt
r274167 r279818 596 596 PASS Document.querySelectorAll: :link and :visited pseudo-class selectors, matching a and area elements with href attributes: #pseudo-link :link, #pseudo-link :visited 597 597 PASS Document.querySelector: :link and :visited pseudo-class selectors, matching a and area elements with href attributes: #pseudo-link :link, #pseudo-link :visited 598 FAIL Document.querySelectorAll: :link and :visited pseudo-class selectors, matching no elements: #head :link, #head :visited assert_equals: The method should return the expected number of matches. expected 0 but got 2 599 FAIL Document.querySelector: :link and :visited pseudo-class selectors, matching no elements: #head :link, #head :visited assert_equals: The method should not match anything. expected null but got Element node <link id="pseudo-link-link1" href=""></link> 598 PASS Document.querySelectorAll: :link and :visited pseudo-class selectors, matching no elements: #head :link, #head :visited 599 PASS Document.querySelector: :link and :visited pseudo-class selectors, matching no elements: #head :link, #head :visited 600 600 PASS Document.querySelectorAll: :target pseudo-class selector, matching the element referenced by the URL fragment identifier: :target 601 601 PASS Document.querySelector: :target pseudo-class selector, matching the element referenced by the URL fragment identifier: :target -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/link-expected.txt
r279223 r279818 1 1 2 FAIL Only <a>s and <area>s that have a href attribute match ':link' assert_array_equals: lengths differ, expected array [Element node <a href="http://www.w3.org" id="link7"></a>, Element node <area href="http://www.w3.org" id="link8"></area>, Element node <a href="http://[" id="link10"></a>] length 3, got [Element node <link rel="author" title="Denis Ah-Kang" href="mailto:den..., Element node <link rel="help" href="https://html.spec.whatwg.org/multi..., Element node <link rel="stylesheet" href="non-existent.css" id="link3"..., Element node <a href="http://www.w3.org" id="link7"></a>, Element node <area href="http://www.w3.org" id="link8"></area>, Element node <link href="http://www.w3.org" id="link9"></link>, Element node <a href="http://[" id="link10"></a>] length 7 2 PASS Only <a>s and <area>s that have a href attribute match ':link' 3 3 -
trunk/Source/WebCore/ChangeLog
r279815 r279818 1 2021-07-11 Chris Dumez <cdumez@apple.com> 2 3 :link and :visited pseudo-class selectors should not match <link> elements 4 https://bugs.webkit.org/show_bug.cgi?id=227847 5 6 Reviewed by Sam Weinig. 7 8 :link, :visited and :any-link should only match <a> and <area> elements as per: 9 - https://drafts.csswg.org/selectors/#the-any-link-pseudo 10 11 Blink and Gecko match the specification. However, WebKit was incorrectly matching 12 <link> elements too. 13 14 No new tests, rebaselined existing tests. 15 16 * html/HTMLLinkElement.cpp: 17 (WebCore::HTMLLinkElement::parseAttribute): 18 1 19 2021-07-11 Chris Dumez <cdumez@apple.com> 2 20 -
trunk/Source/WebCore/html/HTMLLinkElement.cpp
r279383 r279818 172 172 } 173 173 if (name == hrefAttr) { 174 bool wasLink = isLink();175 setIsLink(!value.isNull() && !shouldProhibitLinks(this));176 if (wasLink != isLink())177 invalidateStyleForSubtree();178 174 process(); 179 175 return;
Note: See TracChangeset
for help on using the changeset viewer.