Commit 1b8d7f16 authored by Joey Arhar's avatar Joey Arhar Committed by Chromium LUCI CQ

Update <link> pseudo selector WPTs

In these spec PRs [1][2], the <link> element will no longer match :link,
:visited, or :any-link, and it will no longer navigate the page when
clicked.

This patch also modifies the TestExpectations for one of the modified
tests navigation.sub.html. There was one test case which was
consistently timing out which I removed, which would stop the test from
timing out. However, there are an additional two test cases which time
out when run with run_web_tests.py but pass just fine with
run_wpt_tests.py. In addition, the flags passed to run_web_tests.py on
the trybots make it so that those two test cases which time out get
written to a failure file instead of making the whole test runner time
out, which would count as a failure in TestExpectations. Since the
default flags for run_web_tests.py make it an actual timeout according to
TestExpectations, I left the timeout expectation in there as well.

Hopefully this test can just be run with run_wpt_tests.py in the future
and we can get rid of this TestExpectation.

[1] https://github.com/whatwg/html/pull/6269
[2] https://github.com/w3c/csswg-drafts/pull/5839

Bug: 611093
Change-Id: I7234eb6024450e28c1ca6ec1ede7fdfc8f2ece52
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2628037Reviewed-by: default avatarDomenic Denicola <domenic@chromium.org>
Reviewed-by: default avatarMason Freed <masonfreed@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844921}
parent 12065a27
......@@ -2859,7 +2859,6 @@ crbug.com/626703 external/wpt/webrtc/RTCPeerConnection-setRemoteDescription-trac
crbug.com/626703 external/wpt/webrtc/RTCPeerConnection-remote-track-mute.https.html [ Timeout ]
crbug.com/626703 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/counter-styles-3/system-cyclic-invalid.html [ Pass Failure Timeout ]
crbug.com/626703 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/counter-styles-3/system-alphabetic-invalid.html [ Pass Failure Timeout ]
crbug.com/626703 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=windows-1252 [ Timeout ]
crbug.com/626703 external/wpt/css/css-values/ch-unit-011.html [ Failure ]
crbug.com/626703 [ Mac ] external/wpt/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-width-height.html [ Crash Timeout ]
crbug.com/626703 external/wpt/css/css-values/ic-unit-010.html [ Failure ]
......@@ -2997,8 +2996,12 @@ crbug.com/626703 external/wpt/svg/rendering/order/z-index.svg [ Failure ]
crbug.com/626703 external/wpt/web-animations/timing-model/timelines/update-and-send-events.html [ Failure ]
crbug.com/626703 external/wpt/screen-orientation/orientation-reading.html [ Timeout ]
crbug.com/626703 external/wpt/html/browsers/browsing-the-web/unloading-documents/prompt-and-unload-script-closeable.html [ Failure ]
crbug.com/626703 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=x-cp1251 [ Timeout ]
crbug.com/626703 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=utf8 [ Timeout ]
# navigation.sub.html fails or times out when run with run_web_tests.py but passes with run_wpt_tests.py
crbug.com/626703 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=windows-1252 [ Timeout Failure ]
crbug.com/626703 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=x-cp1251 [ Timeout Failure ]
crbug.com/626703 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=utf8 [ Timeout Failure ]
crbug.com/626703 external/wpt/css/css-transforms/transform-box/view-box-mutation-001.html [ Failure ]
crbug.com/626703 external/wpt/fetch/security/redirect-to-url-with-credentials.https.html [ Timeout ]
crbug.com/843084 external/wpt/css/css-masking/clip-path-svg-content/clip-path-shape-circle-003.svg [ Failure ]
......
......@@ -2546,9 +2546,12 @@ crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-enc
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/attributes.sub.html?encoding=x-cp1251 [ Failure Pass ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/location.sub.html?encoding=windows-1252 [ Failure Pass ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/location.sub.html?encoding=x-cp1251 [ Failure Pass ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=utf8 [ Timeout ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=windows-1252 [ Timeout ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=x-cp1251 [ Timeout ]
# navigation.sub.html fails or times out when run with run_web_tests.py but passes with run_wpt_tests.py
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=utf8 [ Timeout Failure ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=windows-1252 [ Timeout Failure ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=x-cp1251 [ Timeout Failure ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/utf-16be.html?include=appcache [ Failure Pass ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/utf-16be.html?include=history [ Failure Pass ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/utf-16be.html?include=loading [ Failure Pass ]
......
......@@ -2509,9 +2509,12 @@ crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-enc
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/attributes.sub.html?encoding=x-cp1251 [ Failure Pass ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/location.sub.html?encoding=windows-1252 [ Failure Pass ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/location.sub.html?encoding=x-cp1251 [ Failure Pass ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=utf8 [ Timeout ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=windows-1252 [ Timeout ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=x-cp1251 [ Timeout ]
# navigation.sub.html fails or times out when run with run_web_tests.py but passes with run_wpt_tests.py
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=utf8 [ Timeout Failure ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=windows-1252 [ Timeout Failure ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=x-cp1251 [ Timeout Failure ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/utf-16be.html?include=appcache [ Failure Pass ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/utf-16be.html?include=history [ Failure Pass ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/utf-16be.html?include=loading [ Failure Pass ]
......
......@@ -2699,9 +2699,12 @@ crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-enc
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/attributes.sub.html?encoding=x-cp1251 [ Failure Pass ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/location.sub.html?encoding=windows-1252 [ Failure Pass ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/location.sub.html?encoding=x-cp1251 [ Failure Pass ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=utf8 [ Timeout ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=windows-1252 [ Timeout ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=x-cp1251 [ Timeout ]
# navigation.sub.html fails or times out when run with run_web_tests.py but passes with run_wpt_tests.py
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=utf8 [ Timeout Failure ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=windows-1252 [ Timeout Failure ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html?encoding=x-cp1251 [ Timeout Failure ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/utf-16be.html?include=appcache [ Failure Pass ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/utf-16be.html?include=history [ Failure Pass ]
crbug.com/1050754 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/utf-16be.html?include=loading [ Failure Pass ]
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -219,7 +219,7 @@ var validSelectors = [
// Implementations may treat all visited links as unvisited, so these cannot be tested separately.
// The only guarantee is that ":link,:visited" matches the set of all visited and unvisited links and that they are individually mutually exclusive sets.
{name: ":link and :visited pseudo-class selectors, matching a and area elements with href attributes", selector: "#pseudo-link :link, #pseudo-link :visited", expect: ["pseudo-link-a1", "pseudo-link-a2", "pseudo-link-area1"], level: 1, testType: TEST_QSA | TEST_MATCH},
{name: ":link and :visited pseudo-class selectors, matching link elements with href attributes", selector: "#head :link, #head :visited", expect: ["pseudo-link-link1", "pseudo-link-link2"], exclude: ["element", "fragment", "detached"], level: 1, testType: TEST_QSA | TEST_MATCH},
{name: ":link and :visited pseudo-class selectors, matching no elements", selector: "#head :link, #head :visited", expect: [] /*no matches*/, exclude: ["element", "fragment", "detached"], level: 1, testType: TEST_QSA | TEST_MATCH},
{name: ":link and :visited pseudo-class selectors, not matching link elements with href attributes", selector: "#head :link, #head :visited", expect: [] /*no matches*/, exclude: ["document"], level: 1, testType: TEST_QSA},
{name: ":link and :visited pseudo-class selectors, chained, mutually exclusive pseudo-classes match nothing", selector: ":link:visited", expect: [] /*no matches*/, exclude: ["document"], level: 1, testType: TEST_QSA},
......@@ -600,7 +600,7 @@ var scopedSelectors = [
// Implementations may treat all visited links as unvisited, so these cannot be tested separately.
// The only guarantee is that ":link,:visited" matches the set of all visited and unvisited links and that they are individually mutually exclusive sets.
{name: ":link and :visited pseudo-class selectors, matching a and area elements with href attributes", selector: " :link, #pseudo-link :visited", ctx: "#pseudo-link", expect: ["pseudo-link-a1", "pseudo-link-a2", "pseudo-link-area1"], level: 1, testType: TEST_FIND | TEST_MATCH},
{name: ":link and :visited pseudo-class selectors, matching link elements with href attributes", selector: " :link, #head :visited", ctx: "#head", expect: ["pseudo-link-link1", "pseudo-link-link2"], exclude: ["element", "fragment", "detached"], level: 1, testType: TEST_FIND | TEST_MATCH},
{name: ":link and :visited pseudo-class selectors, matching no elements", selector: " :link, #head :visited", ctx: "#head", expect: [] /*no matches*/, exclude: ["element", "fragment", "detached"], level: 1, testType: TEST_FIND | TEST_MATCH},
{name: ":link and :visited pseudo-class selectors, not matching link elements with href attributes", selector: " :link, #head :visited", ctx: "#head", expect: [] /*no matches*/, exclude: ["document"], level: 1, testType: TEST_FIND},
{name: ":link and :visited pseudo-class selectors, chained, mutually exclusive pseudo-classes match nothing", selector: ":link:visited", ctx: "#html", expect: [] /*no matches*/, exclude: ["document"], level: 1, testType: TEST_FIND},
......
......@@ -81,10 +81,42 @@ function test_follow_link(tag) {
}, 'follow hyperlink <'+tag+' href>');
}
'a, area, link'.split(', ').forEach(function(str) {
'a, area'.split(', ').forEach(function(str) {
test_follow_link(str);
});
async_test(function() {
const iframe = document.createElement('iframe');
iframe.name = 'test_dont_follow_link';
document.body.appendChild(iframe);
const link = document.createElement('link');
link.target = iframe.name;
link.setAttribute('href', input_url_html);
document.body.appendChild(link);
const anchor = document.createElement('a');
anchor.target = iframe.name;
anchor.setAttribute('href', blank);
document.body.appendChild(anchor);
this.add_cleanup(function() {
iframe.remove();
link.remove();
anchor.remove();
});
iframe.onload = this.step_func_done(() => {
assert_equals(
iframe.contentDocument.location.pathname,
'/html/infrastructure/urls/resolving-urls/query-encoding/resources/blank.py',
'The <a> navigation should occur instead of the <link> navigation.');
});
anchor.click();
link.click();
}, `don't follow hyperlink <link href>`);
// follow hyperlink with ping attribute
function test_follow_link_ping(tag) {
async_test(function() {
......
This is a testharness.js-based test.
FAIL Only <a>s, <area>s and <link>s that have a href attribute match ':link' assert_array_equals: lengths differ, expected array [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, got [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
FAIL ':link' doesn't match elements whos href attribute has been removed assert_array_equals: lengths differ, expected array [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 <a href="http://[" id="link10"></a>] length 6, got [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
Harness: the test ran to completion.
......@@ -17,8 +17,5 @@
<a href="http://[" id=link10></a>
<script>
testSelectorIdsMatch(":link", ["link1", "link2", "link3", "link7", "link8", "link9", "link10"], "Only <a>s, <area>s and <link>s that have a href attribute match ':link'");
document.getElementById("link9").removeAttribute("href");
testSelectorIdsMatch(":link", ["link1", "link2", "link3", "link7", "link8", "link10"], "':link' doesn't match elements whos href attribute has been removed");
testSelectorIdsMatch(":link", ["link7", "link8", "link10"], "Only <a>s and <area>s that have a href attribute match ':link'");
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment