Repository navigation
Tests for SVG tabindex/focus/blur - #10149
Conversation
Adapted from html/editing/focus/sequential-focus-navigation-and-the-tabindex-attribute/focus-tabindex-default-value.html
Adapted from HTML version at /html/editing/focus/focus-management/focus-events.html
Based on HTML's composed.window.js
Build ERROREDStarted: 2018-03-24 01:20:42 Failing Jobs
View more information about this build on: |
|
Hmmm works on my machine :D |
|
Thanks for this, David! (When I discovered Edge's I agree it makes sense to put these in the For Some thoughts:
Additional tests still required for full coverage of this section (not necessarily in this PR, just keeping note):
|
|
Yeah, I think some of these would probably be a separate PR as they're not covered by the HTML versions either (presumably :focus is in a CSS test for example), and perhaps the existing tests in this PR would be enough to get the HTML PR merged for adding the mixin we require to move these definitions into HTML. I'll look into an additional PR though that adds things that don't need to be in here. the (Edge is fixing our reflect bugs. Now our tree work is done we're working on improving how we deal with attributes) |
|
Re: should vs must: I don't think so. Edge passes them at least :D My understanding from HTML is most of the focusable by default elements are "should" anyway (or at least there is language about being up to the user agent/platform conventions, so it is probably fine to include them. re: blank.html. The text mentioned valid (nested) browsing context, so I added a document. I guess I could add a data URI or such too but I just copied what was used in other tests and didn't want to deal with encoding quotes and angle brackets. I wasn't 100% sure if the definition meant if it is just an iframe with no html/svg document that it shouldn't be focusable. Re: controls: do you mean zoomAndPan or video/audio, as it isn't 100% clean that the latter means the controls attribute? Re: non root SVG: I thought I added a basic test for this but may be mistaken. I'll look into it. |
This exposes dataset, tabIndex, focus(), and blur() on SVG elements. It also does away with NoncedElement. Tests: web-platform-tests/wpt#10110 and web-platform-tests/wpt#10149 (dataset tests for SVG already exist). Fixes #3471 and fixes w3c/svgwg#60.
Ah, I was thinking of the CSS test metadata. I'd like to get to the point of adding similar metadata for all SVG tests (plus SVG-specific metadata, like which processing modes the test is relevant to), but that will wait until we have an agreed-upon metadata system.
Ah, ok. Makes sense.
I meant zoomAndPan, but the general wording is used for both, and for the same reasons. For audio/video controls, the user agent is supposed to add controls even without the attribute if scripting is disabled, and may add controls regardless (in practice, that is usually with a context menu option), so again the focusability rule just focused on whether the controls are there. But if the default behavior in HTML is to not make the element focusable just for context menu controls, then we can match that. Or leave out the no-attribute test & only test that the elements are focusable if the author has specifically requested user-agent controls.
You had a test of |
|
Makes sense. I'll remove the test that tests audio/video fail if no controls as you mention as there is no way of detecting if the UI adds their own except with [controls]. |
Remove test for audio/video without controls and add non root svg
This exposes dataset, tabIndex, focus(), and blur() on SVG elements. It also does away with NoncedElement. Tests: web-platform-tests/wpt#10110 and web-platform-tests/wpt#10149 (dataset tests for SVG already exist). Fixes whatwg#3471 and fixes w3c/svgwg#60.
|
Hmm looks like the error is caused by WPT moving to a new repo. |
svgeesus
left a comment
There was a problem hiding this comment.
Yes, let's fix up any details after merge.
|
@foolip I think this old PR needs admin to override the Travis CI failure caused by the repo having moved. |
|
@svgeesus, I've merged in origin/master into the review branch, which has re-triggered Travis. Just make sure to squash this when merging as the history will be very silly otherwise. |
|
Still getting Travis CI failure from chrome:dev stability failure, (but not getting the "repo moved" failure, thanks!) |
|
@svgeesus Travis last ran 2 months ago. Those checks are no longer blocking. I restarted but it's not picking up changes to the Travis config that have happened on master it seems. I'll just merge in origin/master again. |
|
Alright, everything is fine now :) |
|
Bah! I picked the "rebase and merge" option, but that failed. When I hit the "try again" button eventually it was merged, but squashed. So there's now just a single commit in history, where it's not as clear which comments refer to which test files. Sorry :( |
This exposes dataset, tabIndex, focus(), and blur() on SVG elements. It also does away with NoncedElement. Tests: web-platform-tests/wpt#10110 and web-platform-tests/wpt#10149 (dataset tests for SVG already exist). Fixes whatwg#3471 and fixes w3c/svgwg#60.
SVG defines focus/blur/tabindex as behaving the same as HTML.
This takes some tests from HTML and adapts to the SVG template used in the SVG folder. I included them in the interact folder as that page (scripting) is the one that defines which elements are focusable in SVG.
Apologies if I got the folder structure wrong. I believe I suppose to put the tests in the in the scripted folder.
Note: SVG say that the following are focusable by default:
https://svgwg.org/svg2-draft/interact.html#Focus
I only included a test for the root-most SVG element, as SVG further defines that zoom and pan controls only work on the root most SVG element, so it will pass with or without that control.
I also assumed that video/audio with user controls meant the controls attribute.
These tests match the behavior of the HTML equivalents. Edge fails the tabindex tests when checking the content attribute as there is a non-tabindex related bug with attribute reflection in SVG where the canonical case is lowercase. Otherwise those tests would pass.
I couldn't find any HTML tests specific to blur() so I reused the composed test. blur() passes in Edge, but doesn't support event.composed.
I didn't add tests for dataset (which is in the same section of the spec) as there are already tests in HTML that detect dataset on SVG