selection

edit

WPT coverage of the tests of selection at the revision c8fa86fb13d4. The tests link to their results in the browsers on wpt.fyi. The tentative tests (experimental features), the reftests and the crash tests are listed separately from the stable tests.

GroupPassingTestsDisabledPass rate
Stable9398095%
Tentative2634076%
Reftests20200100%
Crash tests3637097%
All175189093%

Failure reasons

The tests that do not pass (failing or disabled), by kind of reason. A test with several reasons counts once per kind.

  • TEST BUG: 11
  • NOT IMPLEMENTED: 3

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
caret/move-through-overflow-scroll.htmlPass2 / 2
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.htmlPass3 / 3
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.htmlPass4 / 4
onselectstart-on-key-in-contenteditable.htmlPass60 / 60
removeAllRanges.htmlPass116 / 116
removeRange.htmlPass29 / 29
script-and-style-elements.htmlFail0 / 1TEST BUGexpects the line breaks of Gecko's serializer (a leading line break for a range starting before a block, two line breaks between the <script> block and the <pre>); the Selection API defines toString() as "the rendered text" without more details, and the library uses the rendered text of HTML (the innerText algorithm: no leading or trailing required line break, one line break between two blocks); Chrome and Safari fail it too
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-across-minimum-table.htmlPass12 / 12
selection-modify-across-table-containing-caption.htmlPass12 / 12
selection-modify-across-table-containing-col.htmlPass12 / 12
selection-modify-across-table-containing-tfoot-after-tbody.htmlPass12 / 12
selection-modify-across-table-containing-tfoot-before-tbody.htmlPass12 / 12
selection-modify-across-table-containing-thead.htmlPass12 / 12
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.htmlPass3 / 3
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-anchor-focus-rescoping.tentative.htmlFail5 / 21TEST BUG16 of 21 subtests: the tentative test ("for investigation only", https://github.com/w3c/selection-api/issues/361) expects anchorNode and focusNode of a selection in a shadow tree to be rescoped to the parent of the shadow host, as getComposedRanges() does; 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); the test says that no browser passes it
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
visible-selection-form-controls.htmlPass1 / 1

Crash tests

TestResultVariantsKindDescription
crashtests/find-soft-hyphen-crash.htmlPass1 / 1
crashtests/find-whole-word-crash.htmlPass1 / 1
crashtests/find-with-moving-iframe.htmlPass1 / 1
crashtests/move-track-from-video-after-selection-setBaseAndExtent-from-outside-video-to-before-track.htmlPass1 / 1
crashtests/selectall-and-find-svg-text-on-selectstart.htmlTimeout0 / 1NOT IMPLEMENTEDwindow.find(): the test-wait class is never removed
crashtests/selection-add-range-collapsed-in-unassigned-node-and-shadow-has-no-content.htmlPass1 / 1
crashtests/selection-clip-crash.htmlPass1 / 1
crashtests/selection-delete-list-item-crash.htmlPass1 / 1
crashtests/selection-deleteFromDocument-after-audio-control-visible-when-selecting-audio-children.htmlPass1 / 1
crashtests/selection-deleteFromDocument-after-extend-from-summary-to-outside-details.htmlPass1 / 1
crashtests/selection-deleteFromDocument-starting-from-details-ends-in-data.htmlPass1 / 1
crashtests/selection-detached-range-find-crash.htmlPass1 / 1
crashtests/selection-details-editor-ui.htmlPass1 / 1
crashtests/selection-extend-into-input-from-inside-button.htmlPass1 / 1
crashtests/selection-extend-to-area-after-attaching-shadow-to-scrollingElement.htmlPass1 / 1
crashtests/selection-from-svg-use-to-its-child.htmlPass1 / 1
crashtests/selection-modify-around-details-not-having-summary.htmlPass1 / 1
crashtests/selection-modify-around-input.htmlPass1 / 1
crashtests/selection-modify-around-textarea.htmlPass1 / 1
crashtests/selection-modify-extend-forward-on-option.htmlPass1 / 1
crashtests/selection-modify-extend-foward-line-across-video-in-html.htmlPass1 / 1
crashtests/selection-modify-line-boundary-around-empty-details.htmlPass1 / 1
crashtests/selection-modify-line-boundary-around-shadow.htmlPass1 / 1
crashtests/selection-modify-line-from-contenteditable-to-textarea.htmlPass1 / 1
crashtests/selection-modify-line-from-optgroup-in-video-to-details-without-summary.htmlPass1 / 1
crashtests/selection-modify-line-into-svg-use.htmlPass1 / 1
crashtests/selection-modify-line-next-to-input-and-make-it-invisible.htmlPass1 / 1
crashtests/selection-modify-line-next-to-textarea.htmlPass1 / 1
crashtests/selection-modify-per-word-in-table-header-group.htmlPass1 / 1
crashtests/selection-modify-word-left-with-selecting-editable-select.htmlPass1 / 1
crashtests/selection-setBaseAndExtent-from-end-of-video-to-child-of-video.htmlPass1 / 1
crashtests/selection-setBaseAndExtent-from-label-to-end-of-audio-and-hide-audio-controls.htmlPass1 / 1
crashtests/selection-setBaseAndExtent-unassigned-nodes-backward.htmlPass1 / 1
crashtests/selection-setBaseAndExtent-video-in-shadow-and-another-shadowroot.htmlPass1 / 1
crashtests/table.htmlPass1 / 1
range-larger-than-u32-crash.htmlPass1 / 1
selection-select-all-move-input-crash.htmlPass1 / 1