selection
editWPT coverage of the tests of selection at the revision 5602b0f210e3. The tests link to their results in the browsers on wpt.fyi. The tentative tests (experimental features) and the reftests are listed separately from the stable tests.
| Group | Passing | Tests | Disabled | Pass rate |
|---|---|---|---|---|
| Stable | 83 | 91 | 0 | 91% |
| Tentative | 26 | 33 | 0 | 79% |
| Reftests | 19 | 19 | 0 | 100% |
| All | 128 | 143 | 0 | 90% |
Failure reasons
The tests that do not pass (failing or disabled), by kind of reason. A test with several reasons counts once per kind.
- BUG: 2
- TEST BUG: 9
- NOT IMPLEMENTED: 4
Stable tests
| Test | Result | Subtests | Kind | Description |
|---|---|---|---|---|
Document-open.html | Pass | 1 / 1 | ||
addRange-00.html | Pass | 1,624 / 1,624 | ||
addRange-04.html | Pass | 1,624 / 1,624 | ||
addRange-08.html | Pass | 232 / 232 | ||
addRange-12.html | Pass | 928 / 928 | ||
addRange-16.html | Pass | 1,276 / 1,276 | ||
addRange-20.html | Pass | 928 / 928 | ||
addRange-24.html | Pass | 928 / 928 | ||
addRange-28.html | Pass | 1,624 / 1,624 | ||
addRange-32.html | Pass | 1,276 / 1,276 | ||
addRange-36.html | Pass | 1,624 / 1,624 | ||
addRange-40.html | Pass | 232 / 232 | ||
addRange-44.html | Pass | 232 / 232 | ||
addRange-48.html | Pass | 232 / 232 | ||
addRange-52.html | Pass | 232 / 232 | ||
addRange-56.html | Pass | 116 / 116 | ||
addRange.htm | Pass | 1 / 1 | ||
anchor-removal.html | Pass | 2 / 2 | ||
anonymous/details-ancestor.html | Pass | 1 / 1 | ||
anonymous/details-mutate.html | Pass | 1 / 1 | ||
anonymous/setBaseAndExtent-start-or-end-in-anonymous-shadow-container.html | Pass | 11 / 11 | ||
bidi/modify-extend-by-character.html | Pass | 28 / 28 | ||
bidi/modify-move-by-character.html | Pass | 28 / 28 | ||
canvas-click.html | Pass | 1 / 1 | ||
canvas-drag.html | Pass | 1 / 1 | ||
caret-position-should-be-correct-while-moveup-movedown.html | Pass | 24 / 24 | ||
caret/empty-elements.html | Pass | 1 / 1 | ||
caret/move-around-contenteditable-false.html | Fail | 9 / 11 | NOT IMPLEMENTED | an empty editable block (without line box) has no caret position: the caret moving out of an empty paragraph skips the position before the non-editable content that starts the next paragraph |
caret/move-around-generated-content.html | Pass | 15 / 15 | ||
collapse-00.html | Pass | 2,655 / 2,655 | ||
collapse-15.html | Pass | 2,655 / 2,655 | ||
collapse-30.html | Pass | 5,133 / 5,133 | ||
collapse-45.html | Pass | 2,655 / 2,655 | ||
collapse.htm | Pass | 1 / 1 | ||
collapseToStartEnd.html | Pass | 57 / 57 | ||
contenteditable/cefalse-on-boundaries.html | Pass | 4 / 4 | ||
contenteditable/collapse.html | Fail | 0 / 3 | NOT IMPLEMENTED | Selection.collapse() into an editing host does not move the focus to it (document.activeElement stays the button): the Selection API does not say that the selection changes the focus; Chrome and Firefox focus the editing host for sibling hosts (1 subtest), only Firefox for a host nested in content that is not editable (2 subtests); Safari fails the three. |
contenteditable/initial-selection-during-focus-event-propagation.html | Pass | 3 / 3 | ||
contenteditable/modify-around-non-editable-span.html | Pass | 16 / 16 | ||
deleteFromDocument-HTMLDetails.html | Pass | 30 / 30 | ||
deleteFromDocument.html | Pass | 60 / 60 | ||
document-selectionchange.html | Pass | 5 / 5 | ||
drag-disabled-textarea-shadow-dom.html | Pass | 1 / 1 | ||
drag-out-of-floated-content.html | Pass | 1 / 1 | ||
drag-selection-contenteditable-to-out-of-flow-user-select-none.html | Pass | 1 / 1 | ||
drag-selection-extend-to-user-select-none.html | Pass | 4 / 4 | ||
extend-00.html | Pass | 2,024 / 2,024 | ||
extend-20.html | Pass | 2,376 / 2,376 | ||
extend-40.html | Pass | 176 / 176 | ||
extend-exception.html | Pass | 1 / 1 | ||
extend-selection-backward-on-input.html | Pass | 1 / 1 | ||
extend-selection-in-shadow-tree.html | Pass | 1 / 1 | ||
fire-selectionchange-event-on-deleting-single-character-inside-inline-element.html | Pass | 3 / 3 | ||
fire-selectionchange-event-on-document-if-textcontrol-element-is-in-shadow-tree.html | Fail | 0 / 1 | TEST BUG | execCommand("delete") in a focused <input> of a shadow tree deletes the character and fires selectionchange at the input, as the Selection API specifies for a text control (the event bubbles and is composed to the document, retargeted to the shadow host). The test expects no event at the input and one event whose target is the document, which only Chrome does. |
fire-selectionchange-event-on-pressing-backspace.html | Pass | 2 / 2 | ||
fire-selectionchange-event-on-textcontrol-element-on-pressing-backspace.html | Pass | 1 / 1 | ||
getRangeAt.html | Pass | 4 / 4 | ||
getSelection.html | Pass | 18 / 18 | ||
idlharness.window.js | Pass | 112 / 112 | ||
isCollapsed.html | Pass | 29 / 29 | ||
longpress-selection.html | Pass | 1 / 1 | ||
move-by-word-korean.html | Pass | 4 / 4 | ||
move-by-word-with-symbol.html | Pass | 6 / 6 | ||
onselectionchange-on-distinct-text-controls.html | Pass | 2 / 2 | ||
onselectionchange-on-document.html | Fail | 3 / 4 | BUG | the selectionchange task queued by a selectionchange listener runs before the setTimeout(0) task scheduled earlier (timer task ordering: a timer that elapses is queued again by the task that promotes it; queuing its handler directly lets a 0 ms timer run between the navigate event and the commit of a same-document traversal, which breaks navigation-api/navigation-methods/traverseTo-target-made-current-by-earlier-traversal.html) |
onselectstart-on-key-in-contenteditable.html | Pass | 60 / 60 | ||
removeAllRanges.html | Pass | 116 / 116 | ||
removeRange.html | Pass | 29 / 29 | ||
script-and-style-elements.html | Fail | 0 / 1 | BUG | the text of the <script> and the <style> displayed as blocks is in Selection.toString(), but its line breaks differ from the browsers: the text of a range starting before a block (selectNode()) has no leading line break, and a single line break separates the <script> block from the <pre> that follows it (the browsers write two) |
selectAllChildren.html | Pass | 2,242 / 2,242 | ||
selection-content-visibility-hidden.html | Pass | 1 / 1 | ||
selection-direction-on-single-click.html | Pass | 1 / 1 | ||
selection-focused-element-becomes-nonfocusable.html | Pass | 2 / 2 | ||
selection-modify-extend-word-generated-content.html | Pass | 2 / 2 | ||
selection-nested-video.html | Pass | 1 / 1 | ||
selection-range-after-editinghost-removed.html | Pass | 4 / 4 | ||
selection-range-after-textcontrol-removed.html | Pass | 8 / 8 | ||
setBaseAndExtent.html | Pass | 120 / 120 | ||
shadow-dom/cross-shadow-boundary-extend.html | Fail | 0 / 1 | TEST BUG | the test expects rangeCount to be 1 after extend() moves the focus into a shadow tree: the Selection API returns null from anchorNode and focusNode, 0 from rangeCount and throws an IndexSizeError from getRangeAt() when the anchor or the focus is not in the document tree (https://w3c.github.io/selection-api/#dom-selection-rangecount), and addRange() ignores a range whose root is not the document |
shadow-dom/selection-at-nodes-not-part-of-flattened-tree.html | Fail | 13 / 24 | TEST BUG | 11 of 24 subtests: the test expects containsNode() to return false for a child of a shadow host that is not assigned to a slot, while the selection contains it in the node tree (https://w3c.github.io/selection-api/#dom-selection-containsnode compares the boundary points of the range with the node, the flat tree is not involved), and reads getRangeAt(0) of a selection in a shadow tree (the slot fallback content): the Selection API returns 0 from rangeCount and throws an IndexSizeError from getRangeAt() when the anchor or the focus is not in the document tree (https://w3c.github.io/selection-api/#dom-selection-rangecount) |
textcontrols/click-input-after-iframe-focus.html | Pass | 1 / 1 | ||
textcontrols/focus.html | Pass | 1 / 1 | ||
textcontrols/initial-selection-during-focus-event-propagation.html | Pass | 9 / 9 | ||
textcontrols/onselectionchange-content-attribute.html | Pass | 2 / 2 | ||
textcontrols/selectionchange-bubble.html | Pass | 4 / 4 | ||
textcontrols/selectionchange-on-shadow-dom.html | Pass | 1 / 1 | ||
textcontrols/selectionchange.html | Pass | 60 / 60 | ||
toString-ff-bug-001.html | Pass | 1 / 1 | ||
toString-user-select-none.html | Fail | 0 / 3 | NOT IMPLEMENTED | Selection.toString() does not exclude the content with user-select: none |
type.html | Pass | 29 / 29 | ||
user-select-on-input-and-contenteditable.html | Pass | 5 / 5 |
Tentative tests
| Test | Result | Subtests | Kind | Description |
|---|---|---|---|---|
addRange.tentative.html | Pass | 1 / 1 | ||
bidi/modify.tentative.html | Pass | 36 / 36 | ||
contenteditable/initial-selection-on-focus.tentative.html | Pass | 151 / 151 | ||
contenteditable/modify-around-inline-element-boundary.tentative.html | Pass | 36 / 36 | ||
contenteditable/modify.tentative.html | Pass | 15 / 15 | ||
contenteditable/modifying-selection-with-non-primary-mouse-button.tentative.html | Pass | 14 / 14 | ||
contenteditable/modifying-selection-with-primary-mouse-button.tentative.html | Pass | 7 / 7 | ||
contenteditable/selection-outside-focused-editing-host.tentative.html | Pass | 3 / 3 | ||
modify-extend-word-trailing-inline-block.tentative.html | Pass | 1 / 1 | ||
modify-line-flex-column.tentative.html | Pass | 2 / 2 | ||
modify-line-flex-row.tentative.html | Pass | 2 / 2 | ||
modify-line-grid-basic.tentative.html | Pass | 2 / 2 | ||
modify.tentative.html | Pass | 7 / 7 | ||
move-paragraph-cross-editing-boundary.tentative.html | Pass | 2 / 2 | ||
move-paragraphboundary-cross-editing-boundary.tentative.html | Pass | 2 / 2 | ||
move-selection-range-into-different-root.tentative.html | Pass | 16 / 16 | ||
select-end-of-line-image.tentative.html | Pass | 1 / 1 | ||
selection-direction-on-double-click.tentative.html | Pass | 1 / 1 | ||
selection-direction-on-triple-click.tentative.html | Pass | 1 / 1 | ||
selection-range-in-shadow-after-the-shadow-removed.tentative.html | Fail | 0 / 8 | TEST BUG | the tentative test selects the text of a shadow tree and reads the range with getRangeAt(0) before it removes the host: the Selection API returns null from anchorNode and focusNode, 0 from rangeCount and throws an IndexSizeError from getRangeAt() when the anchor or the focus is not in the document tree (https://w3c.github.io/selection-api/#dom-selection-rangecount), and addRange() ignores a range whose root is not the document |
shadow-dom/tentative/Range-isPointInRange.html | Fail | 1 / 2 | TEST BUG | 1 of 2 subtests: the tentative test reads getRangeAt(0) of a selection collapsed in a shadow tree (setBaseAndExtent() with the focus in the shadow tree, after the anchor): the Selection API returns null from anchorNode and focusNode, 0 from rangeCount and throws an IndexSizeError from getRangeAt() when the anchor or the focus is not in the document tree (https://w3c.github.io/selection-api/#dom-selection-rangecount) |
shadow-dom/tentative/Selection-collapse-and-extend.html | Pass | 4 / 4 | ||
shadow-dom/tentative/Selection-deleteFromDocument-around-shadow.html | Fail | 30 / 31 | TEST BUG | 1 of 31 subtests: the tentative test reads getRangeAt(0) of a selection whose focus is in a shadow tree: the Selection API returns null from anchorNode and focusNode, 0 from rangeCount and throws an IndexSizeError from getRangeAt() when the anchor or the focus is not in the document tree (https://w3c.github.io/selection-api/#dom-selection-rangecount), and addRange() ignores a range whose root is not the document |
shadow-dom/tentative/Selection-direction.html | Pass | 7 / 7 | ||
shadow-dom/tentative/Selection-getComposedRanges-collapsed.html | Fail | 0 / 1 | TEST BUG | the tentative test reads getRangeAt(0) of a selection whose focus is in a shadow tree: the Selection API returns null from anchorNode and focusNode, 0 from rangeCount and throws an IndexSizeError from getRangeAt() when the anchor or the focus is not in the document tree (https://w3c.github.io/selection-api/#dom-selection-rangecount), and addRange() ignores a range whose root is not the document |
shadow-dom/tentative/Selection-getComposedRanges-dom-mutations-removal.html | Pass | 12 / 12 | ||
shadow-dom/tentative/Selection-getComposedRanges-range-update.html | Fail | 3 / 9 | TEST BUG | 6 of 9 subtests: the tentative test expects anchorNode and focusNode to return the nodes of a shadow tree after addRange() or a change of the live range of the selection: the Selection API returns null from anchorNode and focusNode, 0 from rangeCount and throws an IndexSizeError from getRangeAt() when the anchor or the focus is not in the document tree (https://w3c.github.io/selection-api/#dom-selection-rangecount), and addRange() ignores a range whose root is not the document |
shadow-dom/tentative/Selection-getComposedRanges-slot.html | Pass | 3 / 3 | ||
shadow-dom/tentative/Selection-getComposedRanges.html | Pass | 12 / 12 | ||
shadow-dom/tentative/Selection-isCollapsed.html | Fail | 2 / 4 | TEST BUG | 2 of 4 subtests: the tentative test expects anchorNode and focusNode to return the nodes of a shadow tree: the Selection API returns null from anchorNode and focusNode, 0 from rangeCount and throws an IndexSizeError from getRangeAt() when the anchor or the focus is not in the document tree (https://w3c.github.io/selection-api/#dom-selection-rangecount), and addRange() ignores a range whose root is not the document |
shadow-dom/tentative/Selection-later-become-slotted-content.html | Pass | 1 / 1 | ||
stringifier.tentative.html | Pass | 1 / 1 | ||
stringifier_editable_element.tentative.html | Error | 3 / 12 | NOT IMPLEMENTED | the tentative behavior of selection-api#83: select() does not focus the text control (the active element stays the previous control, so toString() does not return the selected text of the control), and a click does not move the selection (the last subtests do not run: the harness stops on the error of a click handler) |
Reftests
| Test | Result | Variants | Kind | Description |
|---|---|---|---|---|
caret/after-designMode-off.html | Pass | 1 / 1 | ||
caret/collapse-pre-linestart-1.html | Pass | 1 / 1 | ||
caret/collapse-pre-linestart-2.html | Pass | 1 / 1 | ||
caret/editing-host-has-only-invisible-br.html | Pass | 1 / 1 | ||
collapse-common-ancestor-1.html | Pass | 1 / 1 | ||
collapse-common-ancestor-2.html | Pass | 1 / 1 | ||
collapse-common-ancestor-3.html | Pass | 1 / 1 | ||
selection-incremental-change-repaint.html | Pass | 1 / 1 | ||
selection-range-painting-after-splitText.html | Pass | 6 / 6 | ||
selection-shadow-dom-crash-print.html | Pass | 1 / 1 | ||
shadow-dom/cross-shadow-boundary-1.html | Pass | 1 / 1 | ||
shadow-dom/cross-shadow-boundary-2.html | Pass | 1 / 1 | ||
shadow-dom/cross-shadow-boundary-3.html | Pass | 1 / 1 | ||
shadow-dom/cross-shadow-boundary-4.html | Pass | 1 / 1 | ||
shadow-dom/cross-shadow-boundary-5.html | Pass | 1 / 1 | ||
shadow-dom/cross-shadow-boundary-6.html | Pass | 1 / 1 | ||
shadow-dom/cross-shadow-boundary-img.html | Pass | 1 / 1 | ||
shadow-dom/cross-shadow-boundary-select-document.html | Pass | 1 / 1 | ||
shadow-dom/cross-shadow-boundary-select-root.html | Pass | 1 / 1 |