New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[selectors4] Upstream WebKit test for :focus-within #5261

Merged
merged 1 commit into from Apr 5, 2017

Conversation

Projects
None yet
5 participants
@mrego
Member

mrego commented Mar 29, 2017

This patch adds a new test for :focus-within based on an original test
by Benjamin Poulain (@BenjaminPoulain) that was committed into WebKit in:
https://trac.webkit.org/changeset/202358

The original test can be found at:
https://trac.webkit.org/browser/webkit/trunk/LayoutTests/fast/selectors/focus-within-style-update.html
This new version uses testharness.js but is basically a port of that test.

Please @frivoal could you take a look? Thanks!


This change is Reviewable

[selectors4] Upstream WebKit test for :focus-within
This patch adds a new test for :focus-within based on an original test
by Benjamin Poulain (@BenjaminPoulain) that was committed into WebKit in:
https://trac.webkit.org/changeset/202358

The original test can be found at:
https://trac.webkit.org/browser/webkit/trunk/LayoutTests/fast/selectors/focus-within-style-update.html
This new version uses testharness.js but is basically a port of that test.
@wpt-pr-bot

This comment has been minimized.

Show comment
Hide comment
Collaborator

wpt-pr-bot commented Mar 29, 2017

@w3c-bots

This comment has been minimized.

Show comment
Hide comment
@w3c-bots

w3c-bots Mar 29, 2017

View the complete job log.

Firefox (nightly channel)

Testing web-platform-tests at revision e1fb1e3
Using browser at version BuildID 20170329100319; SourceStamp 272ce6c2572164f5f6a9fba2a980ba9ccf50770c
Starting 10 test iterations
All results were stable

All results

23 tests ran
/content-security-policy/style-src/style-src-error-event-fires.html
Subtest Results Messages
TIMEOUT
Test error event fires on stylesheet link PASS
Test error event fires on inline style NOTRUN
/content-security-policy/style-src/style-src-hash-allowed.html
Subtest Results Messages
OK
All style elements should load because they have proper hashes PASS
/content-security-policy/style-src/style-src-hash-blocked.html
Subtest Results Messages
TIMEOUT
Should load the style with a correct hash PASS
Should not load style that does not match hash PASS
Should fire a securitypolicyviolation event NOTRUN
/content-security-policy/style-src/style-src-hash-default-src-allowed.html
Subtest Results Messages
OK
All style elements should load because they have proper hashes FAIL assert_true: expected true got false
/content-security-policy/style-src/style-src-imported-style-allowed.sub.html
Subtest Results Messages
OK
Imported style that violates policy should not load PASS
/content-security-policy/style-src/style-src-imported-style-blocked.html
Subtest Results Messages
TIMEOUT
@import stylesheet should not load because it does not match style-src PASS
Should fire a securitypolicyviolation event NOTRUN
/content-security-policy/style-src/style-src-injected-inline-style-allowed.html
Subtest Results Messages
OK
Injected inline style should load with 'unsafe-inline' PASS
/content-security-policy/style-src/style-src-injected-inline-style-blocked.html
Subtest Results Messages
TIMEOUT
Injected style attributes should not be applied PASS
Should fire a securitypolicyviolation event NOTRUN
/content-security-policy/style-src/style-src-injected-stylesheet-allowed.sub.html
Subtest Results Messages
OK
Programatically injected stylesheet should load PASS
/content-security-policy/style-src/style-src-injected-stylesheet-blocked.sub.html
Subtest Results Messages
TIMEOUT
Programatically injected stylesheet should not load PASS
Should fire a securitypolicyviolation event NOTRUN
/content-security-policy/style-src/style-src-inline-style-allowed.html
Subtest Results Messages
OK
Inline style should apply with 'unsafe-inline' PASS
/content-security-policy/style-src/style-src-inline-style-attribute-allowed.html
Subtest Results Messages
OK
Inline style attribute should apply with 'unsafe-inline' PASS
/content-security-policy/style-src/style-src-inline-style-attribute-blocked.html
Subtest Results Messages
TIMEOUT
Inline style attribute should not be applied without 'unsafe-inline' PASS
Should fire a securitypolicyviolation event NOTRUN
/content-security-policy/style-src/style-src-inline-style-blocked.html
Subtest Results Messages
TIMEOUT
Inline style element should not load without 'unsafe-inline' PASS
Should fire a securitypolicyviolation event NOTRUN
/content-security-policy/style-src/style-src-inline-style-nonce-allowed.html
Subtest Results Messages
OK
Style with correct nonce should load PASS
/content-security-policy/style-src/style-src-inline-style-nonce-blocked-error-event.html
Subtest Results Messages
TIMEOUT
Should fire a securitypolicyviolation event NOTRUN
Test that paragraph remains unmodified and error events received. NOTRUN
/content-security-policy/style-src/style-src-inline-style-nonce-blocked.html
Subtest Results Messages
TIMEOUT
Should not load inline style element with invalid nonce PASS
Should fire a securitypolicyviolation event NOTRUN
/content-security-policy/style-src/style-src-none-blocked.html
Subtest Results Messages
TIMEOUT
Should not stylesheet when style-src is 'none' PASS
Should fire a securitypolicyviolation event NOTRUN
/content-security-policy/style-src/style-src-star-allowed.html
Subtest Results Messages
OK
* should allow any style PASS
/content-security-policy/style-src/style-src-stylesheet-nonce-allowed.html
Subtest Results Messages
OK
Stylesheet link should load with correct nonce PASS
/content-security-policy/style-src/style-src-stylesheet-nonce-blocked.html
Subtest Results Messages
TIMEOUT
Should not load stylesheet without correct nonce PASS
Should fire a securitypolicyviolation event NOTRUN
/css/selectors4/focus-within-009.html
Subtest Results Messages
OK
Initial State PASS
Focus 'target1' PASS
Focus 'target2' PASS
Set display none on 'target2' PASS
Focus 'target1' again PASS
Try to focus 'target2' PASS
Set display back on 'target2' PASS
Focus 'target2' again PASS
Set display none on 'container2' PASS
Focus 'target1' once again PASS
Try to focus 'target2' again PASS
Set display back on 'container2' PASS
Detach 'container1' from the document PASS
Try to focus 'target1' PASS
Focus 'target2' once again PASS
Attach 'container1' in 'container2' PASS
Focus 'target1' for the last time PASS
Move 'target1' in 'container2' PASS
/service-workers/service-worker/controller-on-load.https.html
Subtest Results Messages
OK
controller is set for a controlled document PASS

View the complete job log.

Firefox (nightly channel)

Testing web-platform-tests at revision e1fb1e3
Using browser at version BuildID 20170329100319; SourceStamp 272ce6c2572164f5f6a9fba2a980ba9ccf50770c
Starting 10 test iterations
All results were stable

All results

23 tests ran
/content-security-policy/style-src/style-src-error-event-fires.html
Subtest Results Messages
TIMEOUT
Test error event fires on stylesheet link PASS
Test error event fires on inline style NOTRUN
/content-security-policy/style-src/style-src-hash-allowed.html
Subtest Results Messages
OK
All style elements should load because they have proper hashes PASS
/content-security-policy/style-src/style-src-hash-blocked.html
Subtest Results Messages
TIMEOUT
Should load the style with a correct hash PASS
Should not load style that does not match hash PASS
Should fire a securitypolicyviolation event NOTRUN
/content-security-policy/style-src/style-src-hash-default-src-allowed.html
Subtest Results Messages
OK
All style elements should load because they have proper hashes FAIL assert_true: expected true got false
/content-security-policy/style-src/style-src-imported-style-allowed.sub.html
Subtest Results Messages
OK
Imported style that violates policy should not load PASS
/content-security-policy/style-src/style-src-imported-style-blocked.html
Subtest Results Messages
TIMEOUT
@import stylesheet should not load because it does not match style-src PASS
Should fire a securitypolicyviolation event NOTRUN
/content-security-policy/style-src/style-src-injected-inline-style-allowed.html
Subtest Results Messages
OK
Injected inline style should load with 'unsafe-inline' PASS
/content-security-policy/style-src/style-src-injected-inline-style-blocked.html
Subtest Results Messages
TIMEOUT
Injected style attributes should not be applied PASS
Should fire a securitypolicyviolation event NOTRUN
/content-security-policy/style-src/style-src-injected-stylesheet-allowed.sub.html
Subtest Results Messages
OK
Programatically injected stylesheet should load PASS
/content-security-policy/style-src/style-src-injected-stylesheet-blocked.sub.html
Subtest Results Messages
TIMEOUT
Programatically injected stylesheet should not load PASS
Should fire a securitypolicyviolation event NOTRUN
/content-security-policy/style-src/style-src-inline-style-allowed.html
Subtest Results Messages
OK
Inline style should apply with 'unsafe-inline' PASS
/content-security-policy/style-src/style-src-inline-style-attribute-allowed.html
Subtest Results Messages
OK
Inline style attribute should apply with 'unsafe-inline' PASS
/content-security-policy/style-src/style-src-inline-style-attribute-blocked.html
Subtest Results Messages
TIMEOUT
Inline style attribute should not be applied without 'unsafe-inline' PASS
Should fire a securitypolicyviolation event NOTRUN
/content-security-policy/style-src/style-src-inline-style-blocked.html
Subtest Results Messages
TIMEOUT
Inline style element should not load without 'unsafe-inline' PASS
Should fire a securitypolicyviolation event NOTRUN
/content-security-policy/style-src/style-src-inline-style-nonce-allowed.html
Subtest Results Messages
OK
Style with correct nonce should load PASS
/content-security-policy/style-src/style-src-inline-style-nonce-blocked-error-event.html
Subtest Results Messages
TIMEOUT
Should fire a securitypolicyviolation event NOTRUN
Test that paragraph remains unmodified and error events received. NOTRUN
/content-security-policy/style-src/style-src-inline-style-nonce-blocked.html
Subtest Results Messages
TIMEOUT
Should not load inline style element with invalid nonce PASS
Should fire a securitypolicyviolation event NOTRUN
/content-security-policy/style-src/style-src-none-blocked.html
Subtest Results Messages
TIMEOUT
Should not stylesheet when style-src is 'none' PASS
Should fire a securitypolicyviolation event NOTRUN
/content-security-policy/style-src/style-src-star-allowed.html
Subtest Results Messages
OK
* should allow any style PASS
/content-security-policy/style-src/style-src-stylesheet-nonce-allowed.html
Subtest Results Messages
OK
Stylesheet link should load with correct nonce PASS
/content-security-policy/style-src/style-src-stylesheet-nonce-blocked.html
Subtest Results Messages
TIMEOUT
Should not load stylesheet without correct nonce PASS
Should fire a securitypolicyviolation event NOTRUN
/css/selectors4/focus-within-009.html
Subtest Results Messages
OK
Initial State PASS
Focus 'target1' PASS
Focus 'target2' PASS
Set display none on 'target2' PASS
Focus 'target1' again PASS
Try to focus 'target2' PASS
Set display back on 'target2' PASS
Focus 'target2' again PASS
Set display none on 'container2' PASS
Focus 'target1' once again PASS
Try to focus 'target2' again PASS
Set display back on 'container2' PASS
Detach 'container1' from the document PASS
Try to focus 'target1' PASS
Focus 'target2' once again PASS
Attach 'container1' in 'container2' PASS
Focus 'target1' for the last time PASS
Move 'target1' in 'container2' PASS
/service-workers/service-worker/controller-on-load.https.html
Subtest Results Messages
OK
controller is set for a controlled document PASS
@w3c-bots

This comment has been minimized.

Show comment
Hide comment
@w3c-bots

w3c-bots Mar 29, 2017

View the complete job log.

Chrome (unstable channel)

Testing web-platform-tests at revision e1fb1e3
Using browser at version 59.0.3053.3 dev
Starting 10 test iterations
All results were stable

All results

23 tests ran
/content-security-policy/style-src/style-src-error-event-fires.html
Subtest Results Messages
OK
Test error event fires on stylesheet link PASS
Test error event fires on inline style PASS
/content-security-policy/style-src/style-src-hash-allowed.html
Subtest Results Messages
OK
All style elements should load because they have proper hashes PASS
/content-security-policy/style-src/style-src-hash-blocked.html
Subtest Results Messages
OK
Should load the style with a correct hash PASS
Should not load style that does not match hash PASS
Should fire a securitypolicyviolation event PASS
/content-security-policy/style-src/style-src-hash-default-src-allowed.html
Subtest Results Messages
OK
All style elements should load because they have proper hashes PASS
/content-security-policy/style-src/style-src-imported-style-allowed.sub.html
Subtest Results Messages
OK
Imported style that violates policy should not load PASS
/content-security-policy/style-src/style-src-imported-style-blocked.html
Subtest Results Messages
OK
@import stylesheet should not load because it does not match style-src PASS
Should fire a securitypolicyviolation event PASS
/content-security-policy/style-src/style-src-injected-inline-style-allowed.html
Subtest Results Messages
OK
Injected inline style should load with 'unsafe-inline' PASS
/content-security-policy/style-src/style-src-injected-inline-style-blocked.html
Subtest Results Messages
OK
Injected style attributes should not be applied PASS
Should fire a securitypolicyviolation event PASS
/content-security-policy/style-src/style-src-injected-stylesheet-allowed.sub.html
Subtest Results Messages
OK
Programatically injected stylesheet should load PASS
/content-security-policy/style-src/style-src-injected-stylesheet-blocked.sub.html
Subtest Results Messages
OK
Programatically injected stylesheet should not load PASS
Should fire a securitypolicyviolation event PASS
/content-security-policy/style-src/style-src-inline-style-allowed.html
Subtest Results Messages
OK
Inline style should apply with 'unsafe-inline' PASS
/content-security-policy/style-src/style-src-inline-style-attribute-allowed.html
Subtest Results Messages
OK
Inline style attribute should apply with 'unsafe-inline' PASS
/content-security-policy/style-src/style-src-inline-style-attribute-blocked.html
Subtest Results Messages
OK
Inline style attribute should not be applied without 'unsafe-inline' PASS
Should fire a securitypolicyviolation event PASS
/content-security-policy/style-src/style-src-inline-style-blocked.html
Subtest Results Messages
OK
Inline style element should not load without 'unsafe-inline' PASS
Should fire a securitypolicyviolation event PASS
/content-security-policy/style-src/style-src-inline-style-nonce-allowed.html
Subtest Results Messages
OK
Style with correct nonce should load PASS
/content-security-policy/style-src/style-src-inline-style-nonce-blocked-error-event.html
Subtest Results Messages
OK
Should fire a securitypolicyviolation event PASS
Test that paragraph remains unmodified and error events received. PASS
/content-security-policy/style-src/style-src-inline-style-nonce-blocked.html
Subtest Results Messages
OK
Should not load inline style element with invalid nonce PASS
Should fire a securitypolicyviolation event PASS
/content-security-policy/style-src/style-src-none-blocked.html
Subtest Results Messages
OK
Should not stylesheet when style-src is 'none' PASS
Should fire a securitypolicyviolation event PASS
/content-security-policy/style-src/style-src-star-allowed.html
Subtest Results Messages
OK
* should allow any style PASS
/content-security-policy/style-src/style-src-stylesheet-nonce-allowed.html
Subtest Results Messages
OK
Stylesheet link should load with correct nonce PASS
/content-security-policy/style-src/style-src-stylesheet-nonce-blocked.html
Subtest Results Messages
OK
Should not load stylesheet without correct nonce PASS
Should fire a securitypolicyviolation event PASS
/css/selectors4/focus-within-009.html
Subtest Results Messages
OK
Initial State FAIL Failed to execute 'querySelectorAll' on 'Document': ':focus-within' is not a valid selector.
Focus 'target1' FAIL assert_array_equals: lengths differ, expected 6 got 0
Focus 'target2' FAIL assert_array_equals: lengths differ, expected 6 got 0
Set display none on 'target2' FAIL assert_array_equals: lengths differ, expected 6 got 0
Focus 'target1' again FAIL assert_array_equals: lengths differ, expected 6 got 0
Try to focus 'target2' FAIL assert_array_equals: lengths differ, expected 6 got 0
Set display back on 'target2' FAIL assert_array_equals: lengths differ, expected 6 got 0
Focus 'target2' again FAIL assert_array_equals: lengths differ, expected 6 got 0
Set display none on 'container2' FAIL assert_array_equals: lengths differ, expected 6 got 0
Focus 'target1' once again FAIL assert_array_equals: lengths differ, expected 6 got 0
Try to focus 'target2' again FAIL assert_array_equals: lengths differ, expected 6 got 0
Set display back on 'container2' FAIL assert_array_equals: lengths differ, expected 6 got 0
Detach 'container1' from the document FAIL Failed to execute 'querySelectorAll' on 'Document': ':focus-within' is not a valid selector.
Try to focus 'target1' FAIL Failed to execute 'querySelectorAll' on 'Document': ':focus-within' is not a valid selector.
Focus 'target2' once again FAIL assert_array_equals: lengths differ, expected 6 got 0
Attach 'container1' in 'container2' FAIL assert_array_equals: lengths differ, expected 6 got 0
Focus 'target1' for the last time FAIL assert_array_equals: lengths differ, expected 7 got 0
Move 'target1' in 'container2' FAIL Failed to execute 'querySelectorAll' on 'Document': ':focus-within' is not a valid selector.
/service-workers/service-worker/controller-on-load.https.html
Subtest Results Messages
OK
controller is set for a controlled document PASS

View the complete job log.

Chrome (unstable channel)

Testing web-platform-tests at revision e1fb1e3
Using browser at version 59.0.3053.3 dev
Starting 10 test iterations
All results were stable

All results

23 tests ran
/content-security-policy/style-src/style-src-error-event-fires.html
Subtest Results Messages
OK
Test error event fires on stylesheet link PASS
Test error event fires on inline style PASS
/content-security-policy/style-src/style-src-hash-allowed.html
Subtest Results Messages
OK
All style elements should load because they have proper hashes PASS
/content-security-policy/style-src/style-src-hash-blocked.html
Subtest Results Messages
OK
Should load the style with a correct hash PASS
Should not load style that does not match hash PASS
Should fire a securitypolicyviolation event PASS
/content-security-policy/style-src/style-src-hash-default-src-allowed.html
Subtest Results Messages
OK
All style elements should load because they have proper hashes PASS
/content-security-policy/style-src/style-src-imported-style-allowed.sub.html
Subtest Results Messages
OK
Imported style that violates policy should not load PASS
/content-security-policy/style-src/style-src-imported-style-blocked.html
Subtest Results Messages
OK
@import stylesheet should not load because it does not match style-src PASS
Should fire a securitypolicyviolation event PASS
/content-security-policy/style-src/style-src-injected-inline-style-allowed.html
Subtest Results Messages
OK
Injected inline style should load with 'unsafe-inline' PASS
/content-security-policy/style-src/style-src-injected-inline-style-blocked.html
Subtest Results Messages
OK
Injected style attributes should not be applied PASS
Should fire a securitypolicyviolation event PASS
/content-security-policy/style-src/style-src-injected-stylesheet-allowed.sub.html
Subtest Results Messages
OK
Programatically injected stylesheet should load PASS
/content-security-policy/style-src/style-src-injected-stylesheet-blocked.sub.html
Subtest Results Messages
OK
Programatically injected stylesheet should not load PASS
Should fire a securitypolicyviolation event PASS
/content-security-policy/style-src/style-src-inline-style-allowed.html
Subtest Results Messages
OK
Inline style should apply with 'unsafe-inline' PASS
/content-security-policy/style-src/style-src-inline-style-attribute-allowed.html
Subtest Results Messages
OK
Inline style attribute should apply with 'unsafe-inline' PASS
/content-security-policy/style-src/style-src-inline-style-attribute-blocked.html
Subtest Results Messages
OK
Inline style attribute should not be applied without 'unsafe-inline' PASS
Should fire a securitypolicyviolation event PASS
/content-security-policy/style-src/style-src-inline-style-blocked.html
Subtest Results Messages
OK
Inline style element should not load without 'unsafe-inline' PASS
Should fire a securitypolicyviolation event PASS
/content-security-policy/style-src/style-src-inline-style-nonce-allowed.html
Subtest Results Messages
OK
Style with correct nonce should load PASS
/content-security-policy/style-src/style-src-inline-style-nonce-blocked-error-event.html
Subtest Results Messages
OK
Should fire a securitypolicyviolation event PASS
Test that paragraph remains unmodified and error events received. PASS
/content-security-policy/style-src/style-src-inline-style-nonce-blocked.html
Subtest Results Messages
OK
Should not load inline style element with invalid nonce PASS
Should fire a securitypolicyviolation event PASS
/content-security-policy/style-src/style-src-none-blocked.html
Subtest Results Messages
OK
Should not stylesheet when style-src is 'none' PASS
Should fire a securitypolicyviolation event PASS
/content-security-policy/style-src/style-src-star-allowed.html
Subtest Results Messages
OK
* should allow any style PASS
/content-security-policy/style-src/style-src-stylesheet-nonce-allowed.html
Subtest Results Messages
OK
Stylesheet link should load with correct nonce PASS
/content-security-policy/style-src/style-src-stylesheet-nonce-blocked.html
Subtest Results Messages
OK
Should not load stylesheet without correct nonce PASS
Should fire a securitypolicyviolation event PASS
/css/selectors4/focus-within-009.html
Subtest Results Messages
OK
Initial State FAIL Failed to execute 'querySelectorAll' on 'Document': ':focus-within' is not a valid selector.
Focus 'target1' FAIL assert_array_equals: lengths differ, expected 6 got 0
Focus 'target2' FAIL assert_array_equals: lengths differ, expected 6 got 0
Set display none on 'target2' FAIL assert_array_equals: lengths differ, expected 6 got 0
Focus 'target1' again FAIL assert_array_equals: lengths differ, expected 6 got 0
Try to focus 'target2' FAIL assert_array_equals: lengths differ, expected 6 got 0
Set display back on 'target2' FAIL assert_array_equals: lengths differ, expected 6 got 0
Focus 'target2' again FAIL assert_array_equals: lengths differ, expected 6 got 0
Set display none on 'container2' FAIL assert_array_equals: lengths differ, expected 6 got 0
Focus 'target1' once again FAIL assert_array_equals: lengths differ, expected 6 got 0
Try to focus 'target2' again FAIL assert_array_equals: lengths differ, expected 6 got 0
Set display back on 'container2' FAIL assert_array_equals: lengths differ, expected 6 got 0
Detach 'container1' from the document FAIL Failed to execute 'querySelectorAll' on 'Document': ':focus-within' is not a valid selector.
Try to focus 'target1' FAIL Failed to execute 'querySelectorAll' on 'Document': ':focus-within' is not a valid selector.
Focus 'target2' once again FAIL assert_array_equals: lengths differ, expected 6 got 0
Attach 'container1' in 'container2' FAIL assert_array_equals: lengths differ, expected 6 got 0
Focus 'target1' for the last time FAIL assert_array_equals: lengths differ, expected 7 got 0
Move 'target1' in 'container2' FAIL Failed to execute 'querySelectorAll' on 'Document': ':focus-within' is not a valid selector.
/service-workers/service-worker/controller-on-load.https.html
Subtest Results Messages
OK
controller is set for a controlled document PASS
@frivoal

frivoal approved these changes Apr 5, 2017

I had a little doubt that specs supported the assertion that you cannot focus a display:none element, but they do indeed. See https://html.spec.whatwg.org/multipage/interaction.html#focusing-steps the requirement to be either a ..... or a focusable area, which it turns required the element to be rendered. So we're good.

Everything else in the test is fine as well.

@frivoal frivoal merged commit 6561405 into web-platform-tests:master Apr 5, 2017

1 of 2 checks passed

code-review/reviewable 1 file left
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@mrego mrego deleted the mrego:focus-within-test branch Apr 5, 2017

@gsnedders gsnedders added selectors and removed selectors4 labels Nov 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment