Diff
Modified: trunk/LayoutTests/ChangeLog (286145 => 286146)
--- trunk/LayoutTests/ChangeLog 2021-11-24 10:02:19 UTC (rev 286145)
+++ trunk/LayoutTests/ChangeLog 2021-11-24 13:41:00 UTC (rev 286146)
@@ -1,3 +1,13 @@
+2021-11-24 Manuel Rego Casasnovas <[email protected]>
+
+ [selectors] Import 2 new :focus-visible tests from WPT
+ https://bugs.webkit.org/show_bug.cgi?id=233446
+
+ Reviewed by Antti Koivisto.
+
+ * platform/ios/TestExpectations: Skip one test in iOS.
+ * tests-options.json:
+
2021-11-23 Carlos Garcia Campos <[email protected]>
CSP: security policy violation event is always using document as target
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (286145 => 286146)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-11-24 10:02:19 UTC (rev 286145)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2021-11-24 13:41:00 UTC (rev 286146)
@@ -1,3 +1,18 @@
+2021-11-24 Manuel Rego Casasnovas <[email protected]>
+
+ [selectors] Import 2 new :focus-visible tests from WPT
+ https://bugs.webkit.org/show_bug.cgi?id=233446
+
+ Reviewed by Antti Koivisto.
+
+ We're slightly tweaking the tests due to bug webkit.org/b/233470.
+
+ * web-platform-tests/css/selectors/focus-visible-017-2-expected.txt: Added.
+ * web-platform-tests/css/selectors/focus-visible-017-2.html: Added.
+ * web-platform-tests/css/selectors/focus-visible-018-2-expected.txt: Added.
+ * web-platform-tests/css/selectors/focus-visible-018-2.html: Added.
+ * web-platform-tests/css/selectors/w3c-import.log:
+
2021-11-23 Carlos Garcia Campos <[email protected]>
CSP: security policy violation event is always using document as target
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-017-2-expected.txt (0 => 286146)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-017-2-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-017-2-expected.txt 2021-11-24 13:41:00 UTC (rev 286146)
@@ -0,0 +1,72 @@
+This test checks that by default, if using _javascript_ to focus an element triggers :focus-visible matching, then the element should show a focus ring with outline-style: auto.
+
+Focus the following elements with the keyaboard navigation (pressing TAB), if the elements show a focus ring with outline-style: auto, then the test result is SUCCESS.
+abbr
+address
+a bdi
+blockquote
+code
+dd
+summary
+div
+dl
+dt
+em legend
+figcaption
+figure
+form
+ label
+li
+mark
+ol
+pre
+
+p
+
+small s strong sub sup
+caption
+table
+td
+time
+ul
+u
+
+PASS ":focus-visible" should be a valid selector
+PASS By default initial programatic focus matches ':focus-visible', so the element ABBR shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element ADDRESS shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element BDI shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element BLOCKQUOTE shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element CODE shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element DD shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element SUMMARY shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element DETAILS shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element DIV shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element DL shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element DT shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element EM shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element LEGEND shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element FIGCAPTION shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element FIGURE shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element FORM shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element HR shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element IMG shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element LABEL shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element LI shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element MARK shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element METER shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element OL shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element PRE shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element PROGRESS shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element P shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element SMALL shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element S shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element STRONG shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element SUB shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element SUP shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element CAPTION shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element TABLE shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element TD shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element TIME shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element UL shows a focus ring with 'outline-style: auto'
+PASS By default initial programatic focus matches ':focus-visible', so the element U shows a focus ring with 'outline-style: auto'
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-017-2.html (0 => 286146)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-017-2.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-017-2.html 2021-11-24 13:41:00 UTC (rev 286146)
@@ -0,0 +1,93 @@
+<!DOCTYPE html>
+<meta charset="utf-8" />
+<title>CSS Test (Selectors): By default programatic focus matches :focus-visible and it shows an auto focus ring</title>
+<link rel="author" title="Manuel Rego Casasnovas" href=""
+<link rel="help" href="" />
+<link rel="help" href="" />
+<meta name="timeout" content="long">
+<script src=""
+<script src=""
+<script src=""
+<style>
+ #warning {
+ display: none;
+ background: red;
+ }
+
+ @supports not selector(:focus-visible) {
+ #instructions {
+ display: none;
+ }
+
+ #warning {
+ display: block;
+ }
+ }
+</style>
+
+<p>This test checks that by default, if using _javascript_ to focus an element triggers <code>:focus-visible</code> matching, then the element should show a focus ring with <code>outline-style: auto</code>.</p>
+<ol id="instructions">
+ <li>Focus the following elements with the keyaboard navigation (pressing TAB), if the elements show a focus ring with <code>outline-style: auto</code>, then the test result is SUCCESS.</li>
+</ol>
+<p id="warning">Your user-agent does not support <code>:focus-visible</code> pseudo-class, please SKIP this test.</p>
+
+<abbr tabindex="0">abbr</abbr>
+<address tabindex="0">address</address>
+<a href=""
+<bdi tabindex="0">bdi</bdi>
+<blockquote tabindex="0">blockquote</blockquote>
+<code tabindex="0">code</code>
+<dd tabindex="0">dd</dd>
+<details open><summary tabindex="0">summary</summary></details>
+<details tabindex="0"></details>
+<div tabindex="0">div</div>
+<dl tabindex="0">dl</dl>
+<dt tabindex="0">dt</dt>
+<em tabindex="0">em</em>
+<fieldset><legend tabindex="0">legend</legend></fieldset>
+<figcaption tabindex="0">figcaption</figcaption>
+<figure tabindex="0">figure</figure>
+<form tabindex="0">form</form>
+<hr tabindex="0" />
+<img tabindex="0" src="" />
+<label tabindex="0">label</label>
+<li tabindex="0">li</li>
+<mark tabindex="0">mark</mark>
+<meter tabindex="0"></meter>
+<ol tabindex="0">ol</ol>
+<pre tabindex="0">pre</pre>
+<progress tabindex="0"></progress>
+<p tabindex="0">p</p>
+<small tabindex="0">small</small>
+<s tabindex="0">s</s>
+<strong tabindex="0">strong</strong>
+<sub tabindex="0">sub</sub>
+<sup tabindex="0">sup</sup>
+<table><caption tabindex="0">caption</caption></table>
+<table tabindex="0"><td>table</td></table>
+<table><td tabindex="0">td</td></table>
+<time tabindex="0">time</time>
+<ul tabindex="0">ul</ul>
+<u tabindex="0">u</u>
+
+<script>
+ setup({ explicit_done: true });
+
+ // Check that :focus-visible is supported.
+ test_valid_selector(':focus-visible');
+
+ const elements = document.querySelectorAll("[tabindex]");
+ for (let i = 0; i < elements.length; i++) {
+ const target = elements[i];
+ promise_test(() => {
+ return new Promise(resolve => {
+ target.addEventListener("focus", resolve);
+ target.focus();
+ if (i == (elements.length - 1))
+ done();
+ }).then(() => {
+ assert_equals(getComputedStyle(target).outlineStyle, "auto", `outline-style for ${target.tagName} should be auto`);
+ });
+ }, `By default initial programatic focus matches ':focus-visible', so the element ${target.tagName} shows a focus ring with 'outline-style: auto'`);
+ }
+</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-018-2-expected.txt (0 => 286146)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-018-2-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-018-2-expected.txt 2021-11-24 13:41:00 UTC (rev 286146)
@@ -0,0 +1,73 @@
+This test checks that by default, using the mouse to focus a generic element does not show a focus ring (because it does not trigger :focus-visible matching).
+
+Click on the elements below"
+If the elements do not have a focus ring, then the test result is SUCCESS.
+abbr
+address
+a bdi
+blockquote
+code
+dd
+summary
+div
+dl
+dt
+em legend
+figcaption
+figure
+form
+ label
+li
+mark
+ol
+pre
+
+p
+
+small s strong sub sup
+caption
+table
+td
+time
+ul
+u
+
+PASS ":focus-visible" should be a valid selector
+FAIL Mouse focus does not show a focus ring by default in element ABBR assert_equals: outline-style for ABBR should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element ADDRESS assert_equals: outline-style for ADDRESS should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element BDI assert_equals: outline-style for BDI should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element BLOCKQUOTE assert_equals: outline-style for BLOCKQUOTE should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element CODE assert_equals: outline-style for CODE should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element DD assert_equals: outline-style for DD should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element SUMMARY assert_equals: outline-style for SUMMARY should be none expected "none" but got "auto"
+PASS Mouse focus does not show a focus ring by default in element DETAILS
+FAIL Mouse focus does not show a focus ring by default in element DIV assert_equals: outline-style for DIV should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element DL assert_equals: outline-style for DL should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element DT assert_equals: outline-style for DT should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element EM assert_equals: outline-style for EM should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element LEGEND assert_equals: outline-style for LEGEND should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element FIGCAPTION assert_equals: outline-style for FIGCAPTION should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element FIGURE assert_equals: outline-style for FIGURE should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element FORM assert_equals: outline-style for FORM should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element HR assert_equals: outline-style for HR should be none expected "none" but got "auto"
+PASS Mouse focus does not show a focus ring by default in element IMG
+FAIL Mouse focus does not show a focus ring by default in element LABEL assert_equals: outline-style for LABEL should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element LI assert_equals: outline-style for LI should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element MARK assert_equals: outline-style for MARK should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element METER assert_equals: outline-style for METER should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element OL assert_equals: outline-style for OL should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element PRE assert_equals: outline-style for PRE should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element PROGRESS assert_equals: outline-style for PROGRESS should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element P assert_equals: outline-style for P should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element SMALL assert_equals: outline-style for SMALL should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element S assert_equals: outline-style for S should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element STRONG assert_equals: outline-style for STRONG should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element SUB assert_equals: outline-style for SUB should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element SUP assert_equals: outline-style for SUP should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element CAPTION assert_equals: outline-style for CAPTION should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element TABLE assert_equals: outline-style for TABLE should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element TD assert_equals: outline-style for TD should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element TIME assert_equals: outline-style for TIME should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element UL assert_equals: outline-style for UL should be none expected "none" but got "auto"
+FAIL Mouse focus does not show a focus ring by default in element U assert_equals: outline-style for U should be none expected "none" but got "auto"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-018-2.html (0 => 286146)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-018-2.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-018-2.html 2021-11-24 13:41:00 UTC (rev 286146)
@@ -0,0 +1,98 @@
+<!DOCTYPE html>
+<meta charset="utf-8" />
+<title>CSS Test (Selectors): Mouse focus does not show a focus ring by default</title>
+<link rel="author" title="Manuel Rego Casasnovas" href=""
+<link rel="help" href="" />
+<link rel="help" href="" />
+<meta name="timeout" content="long">
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<style>
+ #warning {
+ display: none;
+ background: red;
+ }
+
+ @supports not selector(:focus-visible) {
+ #instructions {
+ display: none;
+ }
+
+ #warning {
+ display: block;
+ }
+ }
+</style>
+
+<p>This test checks that by default, using the mouse to focus a generic element does not show a focus ring (because it does not trigger <code>:focus-visible</code> matching).</p>
+<ol id="instructions">
+ <li>Click on the elements below"</li>
+ <li>If the elements do not have a focus ring, then the test result is SUCCESS.</li>
+</ol>
+<p id="warning">Your user-agent does not support <code>:focus-visible</code> pseudo-class, please SKIP this test.</p>
+
+<abbr tabindex="0">abbr</abbr>
+<address tabindex="0">address</address>
+<a href=""
+<bdi tabindex="0">bdi</bdi>
+<blockquote tabindex="0">blockquote</blockquote>
+<code tabindex="0">code</code>
+<dd tabindex="0">dd</dd>
+<details open><summary tabindex="0">summary</summary></details>
+<details tabindex="0"></details>
+<div tabindex="0">div</div>
+<dl tabindex="0">dl</dl>
+<dt tabindex="0">dt</dt>
+<em tabindex="0">em</em>
+<fieldset><legend tabindex="0">legend</legend></fieldset>
+<figcaption tabindex="0">figcaption</figcaption>
+<figure tabindex="0">figure</figure>
+<form tabindex="0">form</form>
+<hr tabindex="0" />
+<img tabindex="0" src="" />
+<label tabindex="0">label</label>
+<li tabindex="0">li</li>
+<mark tabindex="0">mark</mark>
+<meter tabindex="0"></meter>
+<ol tabindex="0">ol</ol>
+<pre tabindex="0">pre</pre>
+<progress tabindex="0"></progress>
+<p tabindex="0">p</p>
+<small tabindex="0">small</small>
+<s tabindex="0">s</s>
+<strong tabindex="0">strong</strong>
+<sub tabindex="0">sub</sub>
+<sup tabindex="0">sup</sup>
+<table><caption tabindex="0">caption</caption></table>
+<table tabindex="0"><td>table</td></table>
+<table><td tabindex="0">td</td></table>
+<time tabindex="0">time</time>
+<ul tabindex="0">ul</ul>
+<u tabindex="0">u</u>
+
+<script>
+ setup({ explicit_done: true });
+
+ // Check that :focus-visible is supported.
+ test_valid_selector(':focus-visible');
+
+ const elements = document.querySelectorAll("[tabindex]");
+ for (let i = 0; i < elements.length; i++) {
+ const target = elements[i];
+ promise_test(() => {
+ return new Promise(resolve => {
+ target.addEventListener("focus", resolve);
+ test_driver.click(target).then(() => {
+ if (i == (elements.length - 1))
+ done();
+ }).catch(resolve);
+ }).then(() => {
+ assert_equals(getComputedStyle(target).outlineStyle, "none", `outline-style for ${target.tagName} should be none`);
+ });
+ }, `Mouse focus does not show a focus ring by default in element ${target.tagName}`);
+ }
+</script>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/w3c-import.log (286145 => 286146)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/w3c-import.log 2021-11-24 10:02:19 UTC (rev 286145)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/w3c-import.log 2021-11-24 13:41:00 UTC (rev 286146)
@@ -48,7 +48,9 @@
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-014.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-015.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-016.html
+/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-017-2.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-017.html
+/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-018-2.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-018.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-019.html
/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-020.html
Modified: trunk/LayoutTests/platform/ios/TestExpectations (286145 => 286146)
--- trunk/LayoutTests/platform/ios/TestExpectations 2021-11-24 10:02:19 UTC (rev 286145)
+++ trunk/LayoutTests/platform/ios/TestExpectations 2021-11-24 13:41:00 UTC (rev 286146)
@@ -3236,6 +3236,7 @@
webkit.org/b/209734 imported/w3c/web-platform-tests/css/selectors/focus-visible-011.html [ Skip ]
webkit.org/b/209734 imported/w3c/web-platform-tests/css/selectors/focus-visible-012.html [ Skip ]
webkit.org/b/209734 imported/w3c/web-platform-tests/css/selectors/focus-visible-013.html [ Skip ]
+webkit.org/b/209734 imported/w3c/web-platform-tests/css/selectors/focus-visible-018-2.html [ Skip ]
webkit.org/b/209734 imported/w3c/web-platform-tests/css/selectors/focus-visible-019.html [ Skip ]
webkit.org/b/209734 imported/w3c/web-platform-tests/css/selectors/focus-visible-021.html [ Skip ]
webkit.org/b/209734 imported/w3c/web-platform-tests/css/selectors/focus-visible-022.tentative.html [ Skip ]
Modified: trunk/LayoutTests/tests-options.json (286145 => 286146)
--- trunk/LayoutTests/tests-options.json 2021-11-24 10:02:19 UTC (rev 286145)
+++ trunk/LayoutTests/tests-options.json 2021-11-24 13:41:00 UTC (rev 286146)
@@ -1646,6 +1646,12 @@
"imported/w3c/web-platform-tests/css/selectors/focus-visible-002.html": [
"slow"
],
+ "imported/w3c/web-platform-tests/css/selectors/focus-visible-017-2.html": [
+ "slow"
+ ],
+ "imported/w3c/web-platform-tests/css/selectors/focus-visible-018-2.html": [
+ "slow"
+ ],
"imported/w3c/web-platform-tests/dom/events/Event-dispatch-on-disabled-elements.html": [
"slow"
],