selection

edit

WPT 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.

GroupPassingTestsDisabledPass rate
Stable8391091%
Tentative2633079%
Reftests19190100%
All128143090%

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

TestResultSubtestsKindDescription
Document-open.htmlPass1 / 1
addRange-00.htmlPass1,624 / 1,624
addRange-04.htmlPass1,624 / 1,624
addRange-08.htmlPass232 / 232
addRange-12.htmlPass928 / 928
addRange-16.htmlPass1,276 / 1,276
addRange-20.htmlPass928 / 928
addRange-24.htmlPass928 / 928
addRange-28.htmlPass1,624 / 1,624
addRange-32.htmlPass1,276 / 1,276
addRange-36.htmlPass1,624 / 1,624
addRange-40.htmlPass232 / 232
addRange-44.htmlPass232 / 232
addRange-48.htmlPass232 / 232
addRange-52.htmlPass232 / 232
addRange-56.htmlPass116 / 116
addRange.htmPass1 / 1
anchor-removal.htmlPass2 / 2
anonymous/details-ancestor.htmlPass1 / 1
anonymous/details-mutate.htmlPass1 / 1
anonymous/setBaseAndExtent-start-or-end-in-anonymous-shadow-container.htmlPass11 / 11
bidi/modify-extend-by-character.htmlPass28 / 28
bidi/modify-move-by-character.htmlPass28 / 28
canvas-click.htmlPass1 / 1
canvas-drag.htmlPass1 / 1
caret-position-should-be-correct-while-moveup-movedown.htmlPass24 / 24
caret/empty-elements.htmlPass1 / 1
caret/move-around-contenteditable-false.htmlFail9 / 11NOT IMPLEMENTEDan 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.htmlPass15 / 15
collapse-00.htmlPass2,655 / 2,655
collapse-15.htmlPass2,655 / 2,655
collapse-30.htmlPass5,133 / 5,133
collapse-45.htmlPass2,655 / 2,655
collapse.htmPass1 / 1
collapseToStartEnd.htmlPass57 / 57
contenteditable/cefalse-on-boundaries.htmlPass4 / 4
contenteditable/collapse.htmlFail0 / 3NOT IMPLEMENTEDSelection.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.htmlPass3 / 3
contenteditable/modify-around-non-editable-span.htmlPass16 / 16
deleteFromDocument-HTMLDetails.htmlPass30 / 30
deleteFromDocument.htmlPass60 / 60
document-selectionchange.htmlPass5 / 5
drag-disabled-textarea-shadow-dom.htmlPass1 / 1
drag-out-of-floated-content.htmlPass1 / 1
drag-selection-contenteditable-to-out-of-flow-user-select-none.htmlPass1 / 1
drag-selection-extend-to-user-select-none.htmlPass4 / 4
extend-00.htmlPass2,024 / 2,024
extend-20.htmlPass2,376 / 2,376
extend-40.htmlPass176 / 176
extend-exception.htmlPass1 / 1
extend-selection-backward-on-input.htmlPass1 / 1
extend-selection-in-shadow-tree.htmlPass1 / 1
fire-selectionchange-event-on-deleting-single-character-inside-inline-element.htmlPass3 / 3
fire-selectionchange-event-on-document-if-textcontrol-element-is-in-shadow-tree.htmlFail0 / 1TEST BUGexecCommand("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.htmlPass2 / 2
fire-selectionchange-event-on-textcontrol-element-on-pressing-backspace.htmlPass1 / 1
getRangeAt.htmlPass4 / 4
getSelection.htmlPass18 / 18
idlharness.window.jsPass112 / 112
isCollapsed.htmlPass29 / 29
longpress-selection.htmlPass1 / 1
move-by-word-korean.htmlPass4 / 4
move-by-word-with-symbol.htmlPass6 / 6
onselectionchange-on-distinct-text-controls.htmlPass2 / 2
onselectionchange-on-document.htmlFail3 / 4BUGthe 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.htmlPass60 / 60
removeAllRanges.htmlPass116 / 116
removeRange.htmlPass29 / 29
script-and-style-elements.htmlFail0 / 1BUGthe 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.htmlPass2,242 / 2,242
selection-content-visibility-hidden.htmlPass1 / 1
selection-direction-on-single-click.htmlPass1 / 1
selection-focused-element-becomes-nonfocusable.htmlPass2 / 2
selection-modify-extend-word-generated-content.htmlPass2 / 2
selection-nested-video.htmlPass1 / 1
selection-range-after-editinghost-removed.htmlPass4 / 4
selection-range-after-textcontrol-removed.htmlPass8 / 8
setBaseAndExtent.htmlPass120 / 120
shadow-dom/cross-shadow-boundary-extend.htmlFail0 / 1TEST BUGthe 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.htmlFail13 / 24TEST BUG11 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.htmlPass1 / 1
textcontrols/focus.htmlPass1 / 1
textcontrols/initial-selection-during-focus-event-propagation.htmlPass9 / 9
textcontrols/onselectionchange-content-attribute.htmlPass2 / 2
textcontrols/selectionchange-bubble.htmlPass4 / 4
textcontrols/selectionchange-on-shadow-dom.htmlPass1 / 1
textcontrols/selectionchange.htmlPass60 / 60
toString-ff-bug-001.htmlPass1 / 1
toString-user-select-none.htmlFail0 / 3NOT IMPLEMENTEDSelection.toString() does not exclude the content with user-select: none
type.htmlPass29 / 29
user-select-on-input-and-contenteditable.htmlPass5 / 5

Tentative tests

TestResultSubtestsKindDescription
addRange.tentative.htmlPass1 / 1
bidi/modify.tentative.htmlPass36 / 36
contenteditable/initial-selection-on-focus.tentative.htmlPass151 / 151
contenteditable/modify-around-inline-element-boundary.tentative.htmlPass36 / 36
contenteditable/modify.tentative.htmlPass15 / 15
contenteditable/modifying-selection-with-non-primary-mouse-button.tentative.htmlPass14 / 14
contenteditable/modifying-selection-with-primary-mouse-button.tentative.htmlPass7 / 7
contenteditable/selection-outside-focused-editing-host.tentative.htmlPass3 / 3
modify-extend-word-trailing-inline-block.tentative.htmlPass1 / 1
modify-line-flex-column.tentative.htmlPass2 / 2
modify-line-flex-row.tentative.htmlPass2 / 2
modify-line-grid-basic.tentative.htmlPass2 / 2
modify.tentative.htmlPass7 / 7
move-paragraph-cross-editing-boundary.tentative.htmlPass2 / 2
move-paragraphboundary-cross-editing-boundary.tentative.htmlPass2 / 2
move-selection-range-into-different-root.tentative.htmlPass16 / 16
select-end-of-line-image.tentative.htmlPass1 / 1
selection-direction-on-double-click.tentative.htmlPass1 / 1
selection-direction-on-triple-click.tentative.htmlPass1 / 1
selection-range-in-shadow-after-the-shadow-removed.tentative.htmlFail0 / 8TEST BUGthe 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.htmlFail1 / 2TEST BUG1 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.htmlPass4 / 4
shadow-dom/tentative/Selection-deleteFromDocument-around-shadow.htmlFail30 / 31TEST BUG1 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.htmlPass7 / 7
shadow-dom/tentative/Selection-getComposedRanges-collapsed.htmlFail0 / 1TEST BUGthe 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.htmlPass12 / 12
shadow-dom/tentative/Selection-getComposedRanges-range-update.htmlFail3 / 9TEST BUG6 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.htmlPass3 / 3
shadow-dom/tentative/Selection-getComposedRanges.htmlPass12 / 12
shadow-dom/tentative/Selection-isCollapsed.htmlFail2 / 4TEST BUG2 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.htmlPass1 / 1
stringifier.tentative.htmlPass1 / 1
stringifier_editable_element.tentative.htmlError3 / 12NOT IMPLEMENTEDthe 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

TestResultVariantsKindDescription
caret/after-designMode-off.htmlPass1 / 1
caret/collapse-pre-linestart-1.htmlPass1 / 1
caret/collapse-pre-linestart-2.htmlPass1 / 1
caret/editing-host-has-only-invisible-br.htmlPass1 / 1
collapse-common-ancestor-1.htmlPass1 / 1
collapse-common-ancestor-2.htmlPass1 / 1
collapse-common-ancestor-3.htmlPass1 / 1
selection-incremental-change-repaint.htmlPass1 / 1
selection-range-painting-after-splitText.htmlPass6 / 6
selection-shadow-dom-crash-print.htmlPass1 / 1
shadow-dom/cross-shadow-boundary-1.htmlPass1 / 1
shadow-dom/cross-shadow-boundary-2.htmlPass1 / 1
shadow-dom/cross-shadow-boundary-3.htmlPass1 / 1
shadow-dom/cross-shadow-boundary-4.htmlPass1 / 1
shadow-dom/cross-shadow-boundary-5.htmlPass1 / 1
shadow-dom/cross-shadow-boundary-6.htmlPass1 / 1
shadow-dom/cross-shadow-boundary-img.htmlPass1 / 1
shadow-dom/cross-shadow-boundary-select-document.htmlPass1 / 1
shadow-dom/cross-shadow-boundary-select-root.htmlPass1 / 1