Skip to content

script: Implement CTRL-A to select all - #48025

Merged
jdm merged 2 commits into
servo:mainfrom
dzfrias:ctrl-a-select
Sep 23, 2026
Merged

jdm merged 2 commits into
servo:mainfrom
dzfrias:ctrl-a-select

Conversation

@dzfrias

@dzfrias dzfrias commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

This change adds support for selecting all document text with the CTRL+A keyboard shortcut.

Testing: two tests for CTRL-A. One testing the normal case, and the other testing when the body is removed from the DOM.
Fixes: #47897

@dzfrias
dzfrias requested a review from gterzian as a code owner September 12, 2026 21:56
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Sep 12, 2026
@dzfrias

dzfrias commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor Author

I have a few questions from writing this PR:

  • @jdm suggested implementing VirtualMethods for Document and reading CTRL-A there. I tried this, but after investigating how key bind targets are selected, I saw that Body is implicitly selected as the target here:
    pub(crate) fn target_for_events_following_focus(&self) -> DomRoot<EventTarget> {
    let document = self.window.Document();
    match &*document.focus_handler().focused_area() {
    FocusableArea::Node { node, .. } => DomRoot::from_ref(node.upcast()),
    FocusableArea::IFrameViewport { iframe_element, .. } => {
    DomRoot::from_ref(iframe_element.upcast())
    },
    FocusableArea::Viewport => document
    .GetBody()
    .map(DomRoot::upcast)
    .unwrap_or_else(|| DomRoot::from_ref(self.window.upcast())),
    }
    }
    So I instead I implemented CTRL-A as a default key bind on HTMLBodyElement. Is this a worse approach for some reason?
  • Is Selection.SelectAllChildren the best way to select everything in the document?

@webbedspace

webbedspace commented Sep 13, 2026 •

Copy link
Copy Markdown

Hm, is selecting everything in <body> actually the correct behaviour, instead of selecting everything in the document?

Consider this:

<!doctype html>
<head>
<style>/* This is selected in Chrome. */ * { display:block }</style>
</head>
<body bgcolor=white>
<script>
document.body.after(`This is selected in Chrome.`);
document.head.before(`This is selected in Chrome.`);
document.body.remove();
</script>
</body>

All the text is selected when you hit Ctrl+A in Chrome even though none of it is in <body>.

@dzfrias

dzfrias commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

Everything in the document is indeed selected (if you remove the body.remove() from your example, CTRL-A will still select everything in Servo), but you're right that removing the body causes issues. So it seems like implementing VirtualMethods for Document is necessary.

@dzfrias

dzfrias commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor Author

I moved logic into components/script/dom/document/document_event_handler.rs because I noticed that keyboard scrolling was implemented there, instead of doing the VirtualMethods approach. I also changed target_for_events_following_focus to return the document when no body is in the DOM and focus is on the viewport, as opposed to returning the window. I think this matches the spec better and was also necessary for getting CTRL-A to work when the body was removed (the link to the relevant part is in the comments of the code).

The example from @webbedspace works now

@mrobinson mrobinson changed the title script: Implement CTRl-A to select all script: Implement CTRL-A to select all Sep 14, 2026
@mrobinson mrobinson added the T-linux-wpt Do a try run of the WPT label Sep 15, 2026
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label Sep 15, 2026
@github-actions

Copy link
Copy Markdown

🔨 Triggering try run (#34978546466) for Linux (WPT)

@github-actions

Copy link
Copy Markdown

⚠️ Try run (#34978546466) failed!

@mrobinson mrobinson added the T-linux-wpt Do a try run of the WPT label Sep 15, 2026
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label Sep 15, 2026
@github-actions

Copy link
Copy Markdown

🔨 Triggering try run (#34982604300) for Linux (WPT)

@github-actions

Copy link
Copy Markdown

Test results for linux-wpt from try job (#34982604300):

Flaky unexpected result (31)
  • CRASH [expected OK] /IndexedDB/idbcursor_update_objectstore.any.html
  • OK /IndexedDB/idbtransaction-oncomplete.any.sharedworker.html (#45911)
    • FAIL [expected PASS] subtest: IDBTransaction - complete event

      assert_array_equals: lengths differ, expected array ["upgradeneeded", "complete", "success", "opencursor"] length 4, got ["upgradeneeded", "complete", "success"] length 3
      

  • TIMEOUT [expected OK] /_webgl/conformance/reading/read-pixels-test.html
  • TIMEOUT [expected OK] /_webgl/conformance/uniforms/no-over-optimization-on-uniform-array-06.html
    • NOTRUN [expected PASS] subtest: Overall test
  • TIMEOUT [expected OK] /_webgl/conformance2/state/gl-object-get-calls.html
    • NOTRUN [expected PASS] subtest: Overall test
  • CRASH [expected OK] /_webgl/conformance2/wasm/readpixels-2gb-in-4gb-wasm-memory.html
  • OK /css/CSS2/linebox/inline-negative-margin-001.html (#43763)
    • FAIL [expected PASS] subtest: [data-expected-height] 3

      assert_equals: 
      &lt;div class="w4" data-expected-height="10"&gt;123 &lt;span style="margin-left: -4ch"&gt;1234 &lt;/span&gt;&lt;/div&gt;
      height expected 10 but got 20
      

    • FAIL [expected PASS] subtest: [data-expected-height] 4

      assert_equals: 
      &lt;div class="w4" data-expected-height="10"&gt;123 &lt;span style="margin-left: -4ch"&gt;123 &lt;/span&gt;&lt;/div&gt;
      height expected 10 but got 20
      

    • FAIL [expected PASS] subtest: [data-expected-height] 5

      assert_equals: 
      &lt;div class="w4" data-expected-height="10"&gt;&lt;img class="w4"&gt;&lt;span style="margin-left: -4ch"&gt;123&lt;/span&gt;&lt;/div&gt;
      height expected 10 but got 20
      

    • FAIL [expected PASS] subtest: [data-expected-height] 6

      assert_equals: 
      &lt;div class="w4" data-expected-height="10"&gt;&lt;img class="w5"&gt;&lt;span style="margin-left: -5ch"&gt;123&lt;/span&gt;&lt;/div&gt;
      height expected 10 but got 20
      

  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • FAIL [expected PASS] subtest: Matching font-style: 'oblique 20deg' should prefer 'oblique 40deg 50deg' over 'oblique 10deg'

      assert_equals: Unexpected font on test element expected 487 but got 532
      

  • OK /dom/nodes/moveBefore/iframe-document-preserve.window.html (#43152)
    • FAIL [expected PASS] subtest: moveBefore(): cross-origin iframe is preserved: remove new parent

      assert_equals: iframe does not fire a second load event expected 1 but got 0
      

  • OK [expected TIMEOUT] /fetch/api/redirect/redirect-keepalive.https.any.html (#32153)
    • PASS [expected TIMEOUT] subtest: [keepalive][iframe][load] mixed content redirect; setting up
  • OK /html/browsers/browsing-the-web/navigating-across-documents/008.html (#24456)
    • PASS [expected FAIL] subtest: Link with onclick form submit to javascript url and href navigation
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment.html (#20768)
    • PASS [expected FAIL] subtest: Tests that a fragment navigation in the unload handler will not block the initial navigation
  • OK /html/browsers/browsing-the-web/navigating-across-documents/refresh/same-document-refresh.html (#34597)
    • PASS [expected FAIL] subtest: Same-Document Referrer from Refresh
  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-requestsubmit.html (#44098)
    • FAIL [expected TIMEOUT] subtest: Replace before load, triggered by formElement.requestSubmit()

      assert_equals: expected "http://web-platform.test:8000/common/blank.html?thereplacement=" but got "http://web-platform.test:8000/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/code-injector.html?pipe=sub(none)&amp;code=%0A%20%20%20%20const%20form%20%3D%20document.createElement(%22form%22)%3B%0A%20%20%20%20form.action%20%3D%20%22%2Fcommon%2Fblank.html%22%3B%0A%0A%20%20%20%20const%20input%20%3D%20document.createElement(%22input%22)%3B%0A%20%20%20%20input.type%20%3D%20%22hidden%22%3B%0A%20%20%20%20input.name%20%3D%20%22thereplacement%22%3B%0A%20%20%20%20form.append(input)%3B%0A%0A%20%20%20%20document.currentScript.before(form)%3B%0A%20%20%20%20form.requestSubmit()%3B%0A%20%20"
      

  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-button-click.html (#44099)
    • FAIL [expected TIMEOUT] subtest: Replace before load, triggered by submitButton.click()

      assert_equals: expected "http://web-platform.test:8000/common/blank.html?thereplacement=" but got "http://web-platform.test:8000/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/code-injector.html?pipe=sub(none)&amp;code=%0A%20%20%20%20const%20form%20%3D%20document.createElement(%22form%22)%3B%0A%20%20%20%20form.action%20%3D%20%22%2Fcommon%2Fblank.html%22%3B%0A%0A%20%20%20%20const%20input%20%3D%20document.createElement(%22input%22)%3B%0A%20%20%20%20input.type%20%3D%20%22hidden%22%3B%0A%20%20%20%20input.name%20%3D%20%22thereplacement%22%3B%0A%20%20%20%20form.append(input)%3B%0A%0A%20%20%20%20const%20button%20%3D%20document.createElement(%22button%22)%3B%0A%20%20%20%20button.type%20%3D%20%22submit%22%3B%0A%20%20%20%20form.append(button)%3B%0A%0A%20%20%20%20document.currentScript.before(form)%3B%0A%20%20%20%20button.click()%3B%0A%20%20"
      

  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit.html (#44028)
  • TIMEOUT [expected ERROR] /html/browsers/history/the-location-interface/location_replace_session_history.html (#41896)
  • TIMEOUT [expected OK] /html/semantics/embedded-content/media-elements/autoplay-allowed-by-permissions-policy.https.sub.html (#46803)
    • TIMEOUT [expected PASS] subtest: Permissions-Policy header: autoplay * allows the top-level document.

      Test timed out
      

    • TIMEOUT [expected PASS] subtest: Permissions-Policy header: autoplay * allows same-origin iframes.

      Test timed out
      

  • CRASH [expected ERROR] /html/semantics/forms/the-select-element/customizable-select/select-appearance-button-after-span.html
  • OK /html/syntax/speculative-parsing/expect-no-linked-resources/no-speculative-fetch.tentative.optional.html (#47290)
    • PASS [expected FAIL] subtest: expect-no-linked-resources hint was ignored
  • TIMEOUT [expected OK] /html/user-activation/navigation-state-reset-sameorigin.html (#45151)
    • TIMEOUT [expected FAIL] subtest: Post-navigation state reset.

      Test timed out
      

  • OK /infrastructure/testdriver/click_iframe.html (#47688)
    • FAIL [expected PASS] subtest: TestDriver click on a document in an iframe

      Unhandled rejection: assert_unreached: click failed Reached unreachable code
      

  • TIMEOUT [expected OK] /pointerevents/compat/pointerevent_touch-action_two-finger_interaction.html (#44693)
    • NOTRUN [expected PASS] subtest: touch two-finger pan on 'touch-action: pan-x pan-y'
    • NOTRUN [expected FAIL] subtest: touch two-finger pan on 'touch-action: pinch-zoom'
  • OK /pointerevents/compat/pointerevent_touch_target_after_pointerdown_target_removed.tentative.html (#42813)
    • PASS [expected FAIL] subtest: After a pointerdown listener moves the target to different position, touch events should be fired on the pointerdown target, but pointer events should be fired on the pointerdown target parent
    • PASS [expected FAIL] subtest: After a pointerdown listener moves the target to different position, touchmove event should be fired on the pointerdown target parent
  • OK /resource-timing/test_resource_timing.https.html (#25216)
    • PASS [expected FAIL] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (script)
  • OK /sanitizer-api/sanitizer-inert-document.html (#45260)
    • PASS [expected FAIL] subtest: Test whether setHTML loads the image.
    • FAIL [expected PASS] subtest: Test whether setHTMLUnsafe loads the image.

      promise_test: Unhandled rejection with value: "The server observed a request. It shouldn't have."
      

  • OK /visual-viewport/resize-event-order.html (#41981)
    • PASS [expected FAIL] subtest: Popup: DOMWindow resize fired before VisualViewport.
  • OK /webdriver/tests/classic/dismiss_alert/dismiss.py (#39098)
    • ERROR [expected PASS] subtest: test_no_top_browsing_context

      setup error: webdriver.error.NoSuchElementException: no such element (404)
      

  • CRASH [expected OK] /webstorage/storage_local_setitem_quotaexceedederr.window.html
  • TIMEOUT [expected OK] /webstorage/storage_session_setitem_quotaexceedederr.window.html
  • OK /webxr/xrSession_features_deviceSupport.https.html (#24357)
    • FAIL [expected PASS] subtest: Immersive XRSession requests with no supported device should reject

      assert_unreached: Should have rejected: undefined Reached unreachable code
      

Stable unexpected results that are known to be intermittent (10)
  • TIMEOUT [expected OK] /_mozilla/mozilla/window-resize-event.html (#36741)
    • TIMEOUT [expected PASS] subtest: Popup onresize event fires after resizeTo

      Test timed out
      

  • OK /_webgl/conformance/textures/misc/texture-upload-size.html (#21770)
    • PASS [expected FAIL] subtest: WebGL test #77
    • PASS [expected FAIL] subtest: WebGL test #79
    • PASS [expected FAIL] subtest: WebGL test #81
    • PASS [expected FAIL] subtest: WebGL test #83
  • TIMEOUT /fetch/metadata/generated/css-images.sub.tentative.html (#29047)
    • TIMEOUT [expected PASS] subtest: background-image sec-fetch-mode - Not sent to non-trustworthy same-origin destination

      Test timed out
      

    • TIMEOUT [expected PASS] subtest: background-image sec-fetch-mode - Not sent to non-trustworthy same-site destination

      Test timed out
      

  • CRASH [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-reload-location-reload.html (#32595)
  • CRASH [expected OK] /html/semantics/forms/form-submission-0/form-submit-iframe-then-location-navigate.html (#29634)
  • OK /html/semantics/forms/form-submission-0/jsurl-form-submit.tentative.html (#36489)
    • PASS [expected FAIL] subtest: Verifies that form submissions scheduled inside javascript: urls take precedence over the javascript: url's return value.
  • OK /infrastructure/testdriver/click_window.html (#47303)
    • PASS [expected FAIL] subtest: TestDriver click method in window
  • OK /pointerevents/pointerevent_pointercapture_in_frame.html?touch (#45445)
    • PASS [expected FAIL] subtest: Test touchpointer capture in same-origin frame: Pointer down at inner frame and set pointer capture.
    • PASS [expected FAIL] subtest: Test touchpointer capture in same-origin frame: Pointer down at inner frame and set pointer capture to outer frame should not capture.
  • OK /resource-timing/test_resource_timing.html (#25720)
    • PASS [expected FAIL] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (iframe)
    • PASS [expected FAIL] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (script)
  • OK [expected TIMEOUT] /trusted-types/trusted-types-navigation.html?31-35 (#38034)
    • PASS [expected TIMEOUT] subtest: Navigate a frame via form-submission with javascript:-urls in report-only mode.
    • PASS [expected NOTRUN] subtest: Navigate a frame via form-submission with javascript:-urls w/ default policy in report-only mode.
    • FAIL [expected NOTRUN] subtest: Navigate a window via form-submission with javascript:-urls w/ a default policy throwing an exception in enforcing mode.

      promise_test: Unhandled rejection with value: "Unexpected message received: \"No securitypolicyviolation reported!\""
      

    • FAIL [expected NOTRUN] subtest: Navigate a window via form-submission with javascript:-urls w/ a default policy throwing an exception in report-only mode.

      promise_test: Unhandled rejection with value: "Unexpected message received: \"No securitypolicyviolation reported!\""
      

    • FAIL [expected NOTRUN] subtest: Navigate a window via form-submission with javascript:-urls w/ a default policy making the URL invalid in enforcing mode.

      promise_test: Unhandled rejection with value: "Unexpected message received: \"No securitypolicyviolation reported!\""
      

Stable unexpected results (35)
  • OK /_mozilla/input-events/sequential-focus-navigation-across-documents-001.html
    • FAIL [expected PASS] subtest: Sequential focus navigation works across local iframe boundaries

      assert_equals: expected Element node &lt;iframe id="frame" srcdoc="&lt;input id=frameinput1&gt;&lt;input i... but got Element node &lt;input class="text" id="input2"&gt;&lt;/input&gt;
      

  • OK /_mozilla/input-events/sequential-focus-navigation-across-documents-002.html
    • FAIL [expected PASS] subtest: Sequential focus navigation works across sandboxed iframe boundaries

      assert_equals: expected Element node &lt;input class="text" id="input1"&gt;&lt;/input&gt; but got Element node &lt;input class="text" id="input2"&gt;&lt;/input&gt;
      

  • OK /_mozilla/input-events/sequential-focus-navigation-across-documents-003.html
    • FAIL [expected PASS] subtest: Sequential focus navigation works across local iframe boundaries and respects tabindex

      assert_equals: expected Element node &lt;iframe id="frame" srcdoc="&lt;input id=frameinput1 tabindex... but got Element node &lt;input class="text" id="input2"&gt;&lt;/input&gt;
      

  • OK /_mozilla/input-events/sequential-focus-navigation-across-documents-004.html
    • FAIL [expected PASS] subtest: Sequential focus navigation works across local iframe boundaries with no sequentially focusable element

      assert_equals: expected true but got false
      

  • OK /_mozilla/input-events/sequential-focus-navigation-from-document-001.html
    • FAIL [expected PASS] subtest: Sequential focus navigation works when starting from viewport

      assert_equals: expected Element node &lt;input class="text" tabindex="2" id="input2"&gt;&lt;/input&gt; but got Element node &lt;input class="text" tabindex="3" id="input3"&gt;&lt;/input&gt;
      

  • OK /_mozilla/input-events/sequential-focus-navigation-from-document-002.html
    • FAIL [expected PASS] subtest: Sequential focus navigation starting from viewport operates in DOM order

      assert_equals: expected Element node &lt;input class="text" tabindex="2" id="input1"&gt;&lt;/input&gt; but got Element node &lt;input class="text" tabindex="3" id="input3"&gt;&lt;/input&gt;
      

  • OK /_mozilla/input-events/sequential-focus-navigation-non-sequentially-focusable-starting-point-001.html
    • FAIL [expected PASS] subtest: Sequential focus navigation starting non-sequentially focusable element

      assert_equals: expected Element node &lt;input class="text" tabindex="100" id="input2"&gt;&lt;/input&gt; but got Element node &lt;input class="text" tabindex="-1" id="input3"&gt;&lt;/input&gt;
      

  • OK /_mozilla/input-events/sequential-focus-navigation-starting-point-001.html
    • FAIL [expected PASS] subtest: Clicking on a non-focusable node should move the sequential focus navigation starting point

      assert_equals: expected Element node &lt;input class="text" id="input1" value="123456"&gt;&lt;/input&gt; but got Element node &lt;body&gt;&lt;input class="text" id="input1" value="123456"&gt;
      &lt;sp...
      

  • OK /_mozilla/input-events/sequential-focus-navigation-starting-point-002.html
    • FAIL [expected PASS] subtest: Clicking on a non-focusable node inside a focusable node should move the sequential focus navigation starting point

      assert_equals: expected Element node &lt;input class="text" id="input1" value="123456"&gt;&lt;/input&gt; but got Element node &lt;div id="focusable" tabindex="0"&gt;
          &lt;input class="text"...
      

  • OK /html/interaction/focus/focusgroup/tentative/sequential-navigation/directional-input-handler-only-item.html
    • FAIL [expected PASS] subtest: Segment with only native directional input handler navigates correctly based on focus state

      assert_equals: expected Element node &lt;input id="search" type="search" placeholder="Search"&gt;&lt;/i... but got Element node &lt;button tabindex="0" id="after"&gt;After&lt;/button&gt;
      

  • OK /html/interaction/focus/focusgroup/tentative/sequential-navigation/directional-input-handler-radio.html
    • FAIL [expected PASS] subtest: Shift+Tab from radio moves to previous segment entry

      assert_equals: Shift+Tab from radio should move to previous segment entry expected Element node &lt;button tabindex="0" id="btn1" type="button"&gt;Bold&lt;/button&gt; but got Element node &lt;input id="r1" type="radio" name="group" checked="" value...
      

  • OK /html/interaction/focus/focusgroup/tentative/sequential-navigation/directional-input-handler-tab-escape-adjacency.html
    • FAIL [expected PASS] subtest: Shift+Tab from directional input handler at end goes to immediately previous item

      assert_equals: Shift+Tab from directional input handler at end should go to adjacent item (B), not first item (A) expected Element node &lt;button tabindex="0" id="end_B" type="button"&gt;B&lt;/button&gt; but got Element node &lt;input id="end_input" type="text" value="text"&gt;&lt;/input&gt;
      

    • FAIL [expected PASS] subtest: Shift+Tab from directional input handler in middle goes to immediately previous item

      assert_equals: Shift+Tab from directional input handler in middle should go to adjacent item (B), not first item (A) expected Element node &lt;button tabindex="0" id="mid_B" type="button"&gt;B&lt;/button&gt; but got Element node &lt;select id="mid_select"&gt;
          &lt;option&gt;12px&lt;/option&gt;
          &lt;o...
      

    • FAIL [expected PASS] subtest: Shift+Tab from directional input handler does not skip focusable content in opted-out subtree

      assert_equals: Shift+Tab from directional input handler should not skip focusable opted-out content expected Element node &lt;button tabindex="0" id="back_optedout" type="button"&gt;Opt... but got Element node &lt;select id="back_select"&gt;
          &lt;option&gt;12px&lt;/option&gt;
          &lt;...
      

  • OK /html/interaction/focus/focusgroup/tentative/sequential-navigation/directional-input-handler-tab-escape.html
    • FAIL [expected PASS] subtest: Shift+Tab from native directional input handler goes to previous adjacent item

      assert_equals: Shift+Tab from native directional input handler should go to previous adjacent focusgroup item expected Element node &lt;button tabindex="0" id="bold" type="button"&gt;Bold&lt;/button&gt; but got Element node &lt;input id="search" type="text" value="Search"&gt;&lt;/input&gt;
      

  • OK /html/interaction/focus/focusgroup/tentative/sequential-navigation/segment-barrier-tabindex-minus1.html
    • FAIL [expected PASS] subtest: Direct opt-out tabindex=-1: Shift+Tab enters previous segment

      assert_equals: Shift+Tab from direct_middle should move to direct_first expected Element node &lt;button id="direct_first"&gt;first&lt;/button&gt; but got Element node &lt;button id="direct_middle" tabindex="-1" focusgroup="none...
      

    • FAIL [expected PASS] subtest: Nested opt-out tabindex=-1: Shift+Tab enters previous segment

      assert_equals: Shift+Tab from nested_middle should move to nested_first expected Element node &lt;button id="nested_first"&gt;first&lt;/button&gt; but got Element node &lt;button id="nested_middle" tabindex="-1"&gt;middle&lt;/button&gt;
      

    • FAIL [expected PASS] subtest: Deeply nested opt-out tabindex=-1: Shift+Tab enters previous segment

      assert_equals: Shift+Tab from deep_grandchild should move to deep_first expected Element node &lt;button id="deep_first"&gt;first&lt;/button&gt; but got Element node &lt;button id="deep_grandchild" tabindex="-1"&gt;grandchild&lt;/bu...
      

  • OK /html/interaction/focus/sequential-focus-navigation-starting-point.tentative.html
    • FAIL [expected PASS] subtest: Focus navigation starting point should stay on element when it is disabled and re-enabled.

      assert_equals: Backwards sequential focus navigation should go to BUTTON# expected Element node &lt;button data-prev="" tabindex="0"&gt;button1&lt;/button&gt; but got Element node &lt;button data-focus="" data-disable="" data-reenable="" ta...
      

    • FAIL [expected PASS] subtest: Focus navigation starting point should be set when scrolling to fragment (and should not be overwritten when &lt;a&gt; is blurred).

      assert_equals: Backwards sequential focus navigation should go to BUTTON#button-1 expected Element node &lt;button id="button-1" data-prev="" tabindex="0"&gt;button 1&lt;... but got Element node &lt;body&gt;
      &lt;button id="before-container" tabindex="0"&gt;(before...
      

    • FAIL [expected PASS] subtest: Focus navigation starting point should be used when it's a descendant of the focused element.

      assert_equals: Backwards sequential focus navigation should go to BUTTON#button1 expected Element node &lt;button data-prev="" id="button1" tabindex="0"&gt;button 1&lt;/... but got Element node &lt;div tabindex="0" data-focus=""&gt;
          &lt;button data-prev=""...
      

    • FAIL [expected PASS] subtest: Should start from focused element if it was focused after the selection was set.

      assert_equals: Backwards sequential focus navigation should go to BUTTON#button3 expected Element node &lt;button id="button3" data-prev="" tabindex="0"&gt;button 3&lt;/... but got Element node &lt;div tabindex="0" id="focusable" data-focus2=""&gt;focusable...
      

  • OK /html/interaction/focus/tab-table-caption.html?caption-side=bottom
    • FAIL [expected PASS] subtest: Shift+Tab on &lt;span tabindex="0"&gt;Tabbable in caption&lt;/span&gt; should move focus to &lt;span tabindex="0"&gt;Tabbable in cell&lt;span&gt;&lt;/span&gt;&lt;/span&gt;

      assert_equals: expected Element node &lt;span tabindex="0"&gt;Tabbable in cell&lt;span&gt;&lt;/span&gt;&lt;/span&gt; but got Element node &lt;span tabindex="0"&gt;Tabbable in caption&lt;/span&gt;
      

    • FAIL [expected PASS] subtest: Shift+Tab on &lt;span tabindex="0"&gt;Tabbable in cell&lt;span&gt;&lt;/span&gt;&lt;/span&gt; should move focus to &lt;span tabindex="0"&gt;First tabbable span&lt;/span&gt;

      assert_equals: expected Element node &lt;span tabindex="0"&gt;First tabbable span&lt;/span&gt; but got Element node &lt;span tabindex="0"&gt;Tabbable in cell&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
      

    • FAIL [expected PASS] subtest: Shift+Tab on &lt;span tabindex="0"&gt;Last tabbable span&lt;/span&gt; should move focus to &lt;span tabindex="0"&gt;Tabbable in caption&lt;/span&gt;

      assert_equals: expected Element node &lt;span tabindex="0"&gt;Tabbable in caption&lt;/span&gt; but got Element node &lt;span tabindex="0"&gt;Last tabbable span&lt;/span&gt;
      

  • OK /html/interaction/focus/tab-table-caption.html?caption-side=top
    • FAIL [expected PASS] subtest: Shift+Tab on &lt;span tabindex="0"&gt;Tabbable in caption&lt;/span&gt; should move focus to &lt;span tabindex="0"&gt;Tabbable in cell&lt;span&gt;&lt;/span&gt;&lt;/span&gt;

      assert_equals: expected Element node &lt;span tabindex="0"&gt;Tabbable in cell&lt;span&gt;&lt;/span&gt;&lt;/span&gt; but got Element node &lt;span tabindex="0"&gt;Tabbable in caption&lt;/span&gt;
      

    • FAIL [expected PASS] subtest: Shift+Tab on &lt;span tabindex="0"&gt;Tabbable in cell&lt;span&gt;&lt;/span&gt;&lt;/span&gt; should move focus to &lt;span tabindex="0"&gt;First tabbable span&lt;/span&gt;

      assert_equals: expected Element node &lt;span tabindex="0"&gt;First tabbable span&lt;/span&gt; but got Element node &lt;span tabindex="0"&gt;Tabbable in cell&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
      

    • FAIL [expected PASS] subtest: Shift+Tab on &lt;span tabindex="0"&gt;Last tabbable span&lt;/span&gt; should move focus to &lt;span tabindex="0"&gt;Tabbable in caption&lt;/span&gt;

      assert_equals: expected Element node &lt;span tabindex="0"&gt;Tabbable in caption&lt;/span&gt; but got Element node &lt;span tabindex="0"&gt;Last tabbable span&lt;/span&gt;
      

  • OK /html/rendering/the-details-element/details-focus-steps.html
    • FAIL [expected PASS] subtest: Focus flows into second when details is open

      assert_equals: expected Element node &lt;a id="second" href="#"&gt;Second&lt;/a&gt; but got Element node &lt;button id="third"&gt;Third&lt;/button&gt;
      

    • FAIL [expected PASS] subtest: Focus flows into third when details is closed

      assert_equals: expected Element node &lt;summary id="first"&gt;First&lt;/summary&gt; but got Element node &lt;button id="third"&gt;Third&lt;/button&gt;
      

  • OK /html/semantics/popovers/popover-focus-harness.html
    • FAIL [expected PASS] subtest: Test sendShiftTab

      assert_equals: Shift-Tab should move back to button 1 expected Element node &lt;button id="button1" tabindex="0"&gt;Button1&lt;/button&gt; but got Element node &lt;button id="button2" tabindex="0"&gt;Button2&lt;/button&gt;
      

  • OK /shadow-dom/focus-navigation/delegatesFocus-highlight-sibling.html
    • FAIL [expected PASS] subtest: crbug/474687 :focus style should properly be applied to shadow hosts.

      assert_equals: expected "XMenu3" but got "XMenu4"
      

  • OK /shadow-dom/focus-navigation/focus-navigation-slot-nested-2levels.html
    • FAIL [expected PASS] subtest: Focus controller should treat each slot as a focus scope.

      assert_equals: Focus should move backward from i1 to outer/outer-after expected Element node &lt;input id="outer-after"&gt;&lt;/input&gt; but got Element node &lt;input id="i1"&gt;&lt;/input&gt;
      

  • OK /shadow-dom/focus-navigation/focus-navigation-slot-nested-delegatesFocus.html
    • FAIL [expected PASS] subtest: Focus controller should treat each slot as a focus scope.

      assert_equals: Focus should move backward from i1 to x-foo/inner-after expected Element node &lt;input id="inner-after"&gt;&lt;/input&gt; but got Element node &lt;input id="i1"&gt;&lt;/input&gt;
      

  • OK /shadow-dom/focus-navigation/focus-navigation-slot-nested-fallback.html
    • FAIL [expected PASS] subtest: Focus should cover assigned elements of an assigned slot espacially there are fallback contents.

      assert_equals: Focus should move backward from sixth to host/fifth expected Element node &lt;div id="fifth" tabindex="0"&gt;5. Inner Shadow Host.
            ... but got Element node &lt;div id="sixth" slot="slot7" tabindex="0"&gt;6. Assigned to ...
      

  • OK /shadow-dom/focus-navigation/focus-navigation-slot-nested.html
    • FAIL [expected PASS] subtest: Focus controller should treat each slot as a focus scope.

      assert_equals: Focus should move backward from i1 to x-foo/inner-after expected Element node &lt;input id="inner-after"&gt;&lt;/input&gt; but got Element node &lt;input id="i1"&gt;&lt;/input&gt;
      

  • OK /shadow-dom/focus-navigation/focus-navigation-slots-in-slot.html
    • FAIL [expected PASS] subtest: Focus should cover assigned nodes of slot, especially for nested slots in slot scope.

      assert_equals: Focus should move backward from b2 to 3F expected Element node &lt;div id="3F" tabindex="0"&gt;single nested slot&lt;/div&gt; but got Element node &lt;div id="b2" tabindex="0"&gt;outside&lt;/div&gt;
      

  • OK /shadow-dom/focus-navigation/focus-navigation-web-component-radio.html
    • FAIL [expected PASS] subtest: Focus for web component input type elements should be bound by &lt;form&gt; inside shadow DOM

      assert_equals: expected "D" but got "end"
      

  • OK /shadow-dom/focus-navigation/focus-navigation-with-delegatesFocus.html
    • FAIL [expected PASS] subtest: Testing tab navigation order with mode open, no tabindex and delegatesFocus=false.

      assert_equals: Focus should move backward from input-after to host-div/inner-input expected Element node &lt;input id="inner-input"&gt;&lt;/input&gt; but got Element node &lt;input id="input-after"&gt;&lt;/input&gt;
      

    • FAIL [expected PASS] subtest: Testing tab navigation order with mode open, no tabindex and delegatesFocus=true.

      assert_equals: Focus should move backward from input-after to host-div/inner-input expected Element node &lt;input id="inner-input"&gt;&lt;/input&gt; but got Element node &lt;input id="input-after"&gt;&lt;/input&gt;
      

    • FAIL [expected PASS] subtest: Testing tab navigation order with mode open, tabindex=0 and delegatesFocus=false.

      assert_equals: Focus should move backward from input-after to host-div/inner-input expected Element node &lt;input id="inner-input"&gt;&lt;/input&gt; but got Element node &lt;input id="input-after"&gt;&lt;/input&gt;
      

    • FAIL [expected PASS] subtest: Testing tab navigation order with mode open, tabindex=0 and delegatesFocus=true.

      assert_equals: Focus should move backward from input-after to host-div/inner-input expected Element node &lt;input id="inner-input"&gt;&lt;/input&gt; but got Element node &lt;input id="input-after"&gt;&lt;/input&gt;
      

    • FAIL [expected PASS] subtest: Testing tab navigation order with mode open, tabindex=-1 and delegatesFocus=false.

      assert_equals: Focus should move backward from input-after to input-before expected Element node &lt;input id="input-before"&gt;&lt;/input&gt; but got Element node &lt;input id="input-after"&gt;&lt;/input&gt;
      

    • FAIL [expected PASS] subtest: Testing tab navigation order with mode open, tabindex=-1 and delegatesFocus=true.

      assert_equals: Focus should move backward from input-after to input-before expected Element node &lt;input id="input-before"&gt;&lt;/input&gt; but got Element node &lt;input id="input-after"&gt;&lt;/input&gt;
      

    • FAIL [expected PASS] subtest: Testing tab navigation order with mode open, tabindex=1 and delegatesFocus=false.

      assert_equals: Focus should move backward from input-after to input-before expected Element node &lt;input id="input-before"&gt;&lt;/input&gt; but got Element node &lt;input id="input-after"&gt;&lt;/input&gt;
      

    • FAIL [expected PASS] subtest: Testing tab navigation order with mode open, tabindex=1 and delegatesFocus=true.

      assert_equals: Focus should move backward from input-after to input-before expected Element node &lt;input id="input-before"&gt;&lt;/input&gt; but got Element node &lt;input id="input-after"&gt;&lt;/input&gt;
      

    • FAIL [expected PASS] subtest: Testing tab navigation order with mode closed, no tabindex and delegatesFocus=false.

      assert_equals: Focus should move backward from input-after to inner-input expected Element node &lt;input id="inner-input"&gt;&lt;/input&gt; but got Element node &lt;input id="input-after"&gt;&lt;/input&gt;
      

    • FAIL [expected PASS] subtest: Testing tab navigation order with mode closed, no tabindex and delegatesFocus=true.

      assert_equals: Focus should move backward from input-after to inner-input expected Element node &lt;input id="inner-input"&gt;&lt;/input&gt; but got Element node &lt;input id="input-after"&gt;&lt;/input&gt;
      

    • And 6 more unexpected results...
  • OK /shadow-dom/focus-navigation/focus-navigation.html
    • FAIL [expected PASS] subtest: Focus controller should treat slots as a focus scope.

      assert_equals: Focus should move backward from x-foo/j6 to x-foo/j0 expected Element node &lt;input id="j0" slot="s2" tabindex="0" value="j0"&gt;&lt;/input&gt; but got Element node &lt;input id="j6" tabindex="4" value="j6"&gt;&lt;/input&gt;
      

  • OK /shadow-dom/focus-navigation/focus-nested-slots.html
    • FAIL [expected PASS] subtest: Verifies that focus order goes in flat tree order with buttons inside nested slots which have a mixture of assigned and unassigned states.

      assert_equals: expected Element node &lt;div id="div4" tabindex="0"&gt;four&lt;/div&gt; but got Element node &lt;div id="div5" tabindex="0"&gt;five&lt;/div&gt;
      

  • OK /shadow-dom/focus-navigation/focus-reverse-unassignable-slot.html
    • FAIL [expected PASS] subtest: Verifies that focusing backwards from an input inside a slot which has no shadow root goes to the previous focusable element in light DOM.

      assert_equals: expected Element node &lt;input id="input1"&gt;&lt;/input&gt; but got Element node &lt;input id="input2"&gt;&lt;/input&gt;
      

  • OK /shadow-dom/focus-navigation/focus-reverse-unassigned-slot.html
    • FAIL [expected PASS] subtest: Verifies that focusing backwards from a button inside a slot which has no assigned nodes goes to the previous focusable element.

      assert_equals: Focus should move backward from i2 to outer/i1 expected Element node &lt;input id="i1" value="i1"&gt;&lt;/input&gt; but got Element node &lt;input id="i2" value="i2"&gt;&lt;/input&gt;
      

  • OK /shadow-dom/focus-navigation/reading-flow/tentative/flex-visual-order.html
    • FAIL [expected PASS] subtest: Flex items in flexbox should follow flex-visual reading flow

      assert_equals: Focus should move backward from C to B expected Element node &lt;button id="B"&gt;B&lt;/button&gt; but got Element node &lt;button id="C"&gt;C&lt;/button&gt;
      

  • OK /shadow-dom/focus-navigation/reading-flow/tentative/grid-order.html
    • FAIL [expected PASS] subtest: Grid items without order property

      assert_equals: Focus should move backward from e1 to d1 expected Element node &lt;button id="d1"&gt;Item D&lt;/button&gt; but got Element node &lt;button id="e1"&gt;Item E&lt;/button&gt;
      

  • OK /shadow-dom/focus-navigation/reading-flow/tentative/normal.html
    • FAIL [expected PASS] subtest: Block elements. Focus should be in DOM tabindexed-order.

      assert_equals: Focus should move backward from t6-b to t6-a expected Element node &lt;button id="t6-a" style="order: 1; reading-order: 1" tabi... but got Element node &lt;button id="t6-b" style="order: -1; reading-order: -1" ta...
      

  • OK /shadow-dom/focus-navigation/reading-flow/tentative/source-order-invalid.html
    • FAIL [expected PASS] subtest: Inline elements. Focus should be in DOM tabindexed-order.

      assert_equals: Focus should move backward from c to b expected Element node &lt;button id="b" style="reading-order: -1"&gt;Item B&lt;/button&gt; but got Element node &lt;button id="c" style="reading-order: 0"&gt;Item C&lt;/button&gt;
      

@github-actions

Copy link
Copy Markdown

⚠️ Try run (#34982604300) failed!

@dzfrias

dzfrias commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

Turns out that the reason the tests were failing was relatively simple. Should be ready for re-review @mrobinson.

Successful mach try run: https://github.com/dzfrias/servo/actions/runs/35038597427

@mrobinson

Copy link
Copy Markdown
Member

Turns out that the reason the tests were failing was relatively simple.

What was the reason?

@dzfrias

dzfrias commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor Author

I didn't read the tab sequential focusing code very carefully and forgot to include shift tab as a case in the shortcut matcher.

Also, for the future: would it be preferred for me to squash/amend commits ahead of time?

@dzfrias

dzfrias commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on top of main and used the EditingContext implementation of select_all.

@dzfrias

dzfrias commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

@mrobinson
mrobinson force-pushed the ctrl-a-select branch 3 times, most recently from 25f28bd to cbdffe1 Compare September 21, 2026 10:59
@mrobinson
mrobinson enabled auto-merge September 21, 2026 10:59
Signed-off-by: Martin Robinson <[email protected]>
@mrobinson

mrobinson commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

@mrobinson The line you reverted causes the window to be targeted instead the document when the body isn't present, which is why one of the WPT tests I added in this PR is now failing. I am going to remove that test from this PR and make a follow-up PR that correctly targets the document when the body is removed when this PR is merged.

There's no need to remove the test. When making edits to this PR I regressed it, which means it was a good test! The issue here is that the change in target_for_events_following_focus modifies where events are sent in a way that I think violates the UIEvent specification. It should really be falling back to the root element (documentElement). I've pushed that as a targeted fix (restoring the great test you wrote). Let's see what the CI thinks.

@mrobinson mrobinson added the T-linux-wpt Do a try run of the WPT label Sep 22, 2026
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label Sep 22, 2026
@github-actions

Copy link
Copy Markdown

🔨 Triggering try run (#35752895867) for Linux (WPT)

@dzfrias

dzfrias commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

There's no need to remove the test. When making edits to this PR I regressed it, which means it was a good test! The issue here is that the change in target_for_events_following_focus modifies where events are sent in a way that I think violates the UIEvent specification. It should really be falling back to the root element (documentElement). I've pushed that as a targeted fix (restoring the great test you wrote). Let's see what the CI thinks.

Ah, ok. I had the wrong impression because my work in this PR originally included changing the target_for_events_following_focus fallback to the document, but I read your edits as a sign that it should be implemented in a different PR. Apologies for the confusion.

@github-actions

Copy link
Copy Markdown

Test results for linux-wpt from try job (#35752895867):

Flaky unexpected result (34)
  • CRASH [expected OK] /_mozilla/mozilla/iframe-contentDocument.html
  • OK [expected TIMEOUT] /_webgl/conformance/textures/misc/tex-video-using-tex-unit-non-zero.html (#39735)
    • PASS [expected NOTRUN] subtest: Overall test
    • PASS [expected FAIL] subtest: WebGL test #2
  • TIMEOUT [expected OK] /_webgl/conformance2/state/gl-object-get-calls.html
  • TIMEOUT [expected OK] /console/console-log-large-array.any.worker.html
    • TIMEOUT [expected PASS] subtest: Logging large arrays works

      Test timed out
      

  • CRASH [expected OK] /content-security-policy/frame-ancestors/frame-ancestors-nested-same-in-same-star-allow.html
  • CRASH [expected OK] /content-security-policy/frame-ancestors/frame-ancestors-sandbox-same-origin-self.html (#48268)
  • CRASH [expected PASS] /css/CSS2/borders/border-right-width-058.xht
  • FAIL [expected PASS] /css/css-backgrounds/background-size-042.html
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • FAIL [expected PASS] subtest: Matching font-weight: '430' should prefer '400 425' over '350 399'

      assert_equals: Unexpected font on test element expected 487 but got 532
      

    • FAIL [expected PASS] subtest: Matching font-weight: '500' should prefer '400' over '350 399'

      assert_equals: Unexpected font on test element expected 487 but got 532
      

    • FAIL [expected PASS] subtest: Matching font-style: 'oblique 21deg' should prefer 'oblique -50deg -20deg' over 'oblique -40deg -30deg'

      assert_equals: Unexpected font on test element expected 487 but got 532
      

    • PASS [expected FAIL] subtest: Matching font-style: 'oblique 21deg' should prefer 'oblique -40deg -30deg' over 'italic'
    • FAIL [expected PASS] subtest: Matching font-style: 'oblique -20deg' should prefer 'oblique -60deg -40deg' over 'oblique -10deg'

      assert_equals: Unexpected font on test element expected 487 but got 532
      

  • OK [expected ERROR] /css/selectors/invalidation/media-loading-pseudo-classes-in-has.sub.html
  • OK /fetch/api/abort/general.any.sharedworker.html
    • FAIL [expected PASS] subtest: Stream errors once aborted with abort reason. Underlying connection closed.

      step_wait_func: underlying connection should close Timed out waiting on condition
      

  • TIMEOUT [expected OK] /fetch/content-encoding/zstd/big-zstd-body.https.any.worker.html
    • TIMEOUT [expected PASS] subtest: large zstd data should be decompressed successfully

      Test timed out
      

    • NOTRUN [expected FAIL] subtest: large zstd data should be decompressed successfully with byte stream
  • OK /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click.html (#28697)
    • PASS [expected FAIL] subtest: aElement.click() before the load event must NOT replace
  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-button-click.html (#44099)
    • FAIL [expected TIMEOUT] subtest: Replace before load, triggered by submitButton.click()

      assert_equals: expected "http://web-platform.test:8000/common/blank.html?thereplacement=" but got "http://web-platform.test:8000/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/code-injector.html?pipe=sub(none)&amp;code=%0A%20%20%20%20const%20form%20%3D%20document.createElement(%22form%22)%3B%0A%20%20%20%20form.action%20%3D%20%22%2Fcommon%2Fblank.html%22%3B%0A%0A%20%20%20%20const%20input%20%3D%20document.createElement(%22input%22)%3B%0A%20%20%20%20input.type%20%3D%20%22hidden%22%3B%0A%20%20%20%20input.name%20%3D%20%22thereplacement%22%3B%0A%20%20%20%20form.append(input)%3B%0A%0A%20%20%20%20const%20button%20%3D%20document.createElement(%22button%22)%3B%0A%20%20%20%20button.type%20%3D%20%22submit%22%3B%0A%20%20%20%20form.append(button)%3B%0A%0A%20%20%20%20document.currentScript.before(form)%3B%0A%20%20%20%20button.click()%3B%0A%20%20"
      

  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit.html (#44028)
  • OK /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-popup.html (#47829, #47850)
    • FAIL [expected PASS] subtest: No replace before load, triggered by window.open() on a non-_self window

      promise_test: Unhandled rejection with value: object "SecurityError: Location's relevant Document is not same origin-domain with the entry settings object's origin"
      

  • TIMEOUT /html/browsers/history/the-history-interface/001.html (#12580)
    • FAIL [expected PASS] subtest: traversing history must also traverse hash changes

      assert_equals: (this could cause other failures later on) expected "" but got "test"
      

  • CRASH [expected OK] /html/browsers/sandboxing/sandbox-initial-empty-document-toward-same-origin.html (#35948)
  • OK /html/semantics/embedded-content/media-elements/media_fragment_seek.html (#24114)
    • FAIL [expected PASS] subtest: Video should seek to time specified in media fragment syntax

      assert_equals: expected 4 but got 0
      

  • OK [expected CRASH] /html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-reload-location-reload.html (#32595)
  • OK /html/semantics/forms/form-submission-0/jsurl-form-submit.tentative.html (#36489)
    • PASS [expected FAIL] subtest: Verifies that form submissions scheduled inside javascript: urls take precedence over the javascript: url's return value.
  • CRASH [expected FAIL] /html/semantics/interestfor/interestfor-plain-inline-element.tentative.html
  • TIMEOUT [expected OK] /html/user-activation/navigation-state-reset-sameorigin.html (#45151)
    • TIMEOUT [expected FAIL] subtest: Post-navigation state reset.

      Test timed out
      

  • OK /mixed-content/tentative/autoupgrades/audio-upgrade.https.sub.html (#41697)
    • FAIL [expected PASS] subtest: Audio autoupgraded

      assert_equals: Length expected 1 but got Infinity
      

  • TIMEOUT [expected OK] /pointerevents/compat/pointerevent_touch-action_two-finger_interaction.html (#44693)
    • NOTRUN [expected PASS] subtest: touch two-finger pan on 'touch-action: pan-x pan-y'
    • NOTRUN [expected FAIL] subtest: touch two-finger pan on 'touch-action: pinch-zoom'
  • OK /pointerevents/pointerevent_pointercapture_in_frame.html?pen (#45536)
    • PASS [expected FAIL] subtest: Test penpointer capture in same-origin frame: Pointer down at inner frame and set pointer capture.
    • PASS [expected FAIL] subtest: Test penpointer capture in same-origin frame: Pointer down at inner frame and set pointer capture to outer frame should not capture.
  • OK /pointerevents/pointerevent_pointercapture_in_frame.html?touch (#45445)
    • FAIL [expected PASS] subtest: Test touchpointer capture in same-origin frame: Pointer down at inner frame and set pointer capture.

      assert_true: Timed out waiting for lostpointercapture expected true got false
      

    • FAIL [expected PASS] subtest: Test touchpointer capture in same-origin frame: Pointer down at inner frame and set pointer capture to outer frame should not capture.

      assert_array_equals: Received events: innerFrame received pointerdown,innerFrame received pointermove,innerFrame received pointerup,innerFrame received lostpointercapture lengths differ, expected array ["innerFrame received pointerdown", "innerFrame received pointermove", "innerFrame received pointerup"] length 3, got ["innerFrame received pointerdown", "innerFrame received pointermove", "innerFrame received pointerup", "innerFrame received lostpointercapture"] length 4
      

  • OK /preload/prefetch-document.html (#37210)
    • PASS [expected FAIL] subtest: different-site document prefetch with 'as=document' should not be consumed
  • OK /resource-timing/buffer-full-add-then-clear.html (#40819)
    • FAIL [expected PASS] subtest: Test that if the buffer is cleared after entries were added to the secondary buffer, those entries make it into the primary one

      assert_equals: Number of entries does not match the expected value. expected 3 but got 0
      

  • OK /resource-timing/buffer-full-then-increased.html (#44408)
    • FAIL [expected PASS] subtest: Test that overflowing the buffer and immediately increasing its limit does not trigger the resourcetimingbufferfull event

      assert_equals: Number of entries does not match the expected value. expected 3 but got 1
      

  • OK /sanitizer-api/sanitizer-inert-document.html (#45260)
    • PASS [expected FAIL] subtest: Test whether setHTML loads the image.
    • FAIL [expected PASS] subtest: Test whether setHTMLUnsafe loads the image.

      promise_test: Unhandled rejection with value: "The server observed a request. It shouldn't have."
      

  • OK /touch-events/mouseevents-after-touchend.tentative.html (#46497)
    • PASS [expected FAIL] subtest: Single tap should cause a click
    • PASS [expected FAIL] subtest: Tapping too far points should not cause a dblclick
  • OK [expected TIMEOUT] /trusted-types/trusted-types-navigation.html?06-10 (#37920)
    • PASS [expected TIMEOUT] subtest: Navigate a frame via anchor with javascript:-urls in report-only mode.
    • PASS [expected NOTRUN] subtest: Navigate a frame via anchor with javascript:-urls w/ default policy in report-only mode.
    • FAIL [expected NOTRUN] subtest: Navigate a window via anchor with javascript:-urls w/ a default policy throwing an exception in enforcing mode.

      promise_test: Unhandled rejection with value: "Unexpected message received: \"No securitypolicyviolation reported!\""
      

    • FAIL [expected NOTRUN] subtest: Navigate a window via anchor with javascript:-urls w/ a default policy throwing an exception in report-only mode.

      promise_test: Unhandled rejection with value: "Unexpected message received: \"No securitypolicyviolation reported!\""
      

  • OK [expected TIMEOUT] /trusted-types/trusted-types-navigation.html?16-20 (#44835)
    • PASS [expected TIMEOUT] subtest: Navigate a frame via area with javascript:-urls in report-only mode.
    • PASS [expected NOTRUN] subtest: Navigate a frame via area with javascript:-urls w/ default policy in report-only mode.
Stable unexpected results that are known to be intermittent (11)
  • TIMEOUT [expected OK] /_mozilla/mozilla/window-resize-event.html (#36741)
    • TIMEOUT [expected PASS] subtest: Popup onresize event fires after resizeTo

      Test timed out
      

  • OK /beacon/beacon-basic.https.window.html (#41723)
    • PASS [expected FAIL] subtest: Payload size restriction should be accumulated: type = string
  • OK /dom/nodes/moveBefore/iframe-document-preserve.window.html (#43152)
    • FAIL [expected PASS] subtest: moveBefore(): cross-origin iframe is preserved: remove self

      assert_equals: iframe does not fire a second load event expected 1 but got 0
      

  • OK [expected TIMEOUT] /fetch/api/redirect/redirect-keepalive.https.any.html (#32153)
    • PASS [expected TIMEOUT] subtest: [keepalive][iframe][load] mixed content redirect; setting up
  • OK /html/browsers/browsing-the-web/navigating-across-documents/refresh/same-document-refresh.html (#34597)
    • FAIL [expected PASS] subtest: Same-Document Referrer from Refresh

      assert_equals: original page loads expected "http://web-platform.test:8000/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refresh-with-section.sub.html?url=%23section" but got "http://web-platform.test:8000/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refresh-with-section.sub.html?url=%23section#section"
      

  • CRASH [expected TIMEOUT] /html/browsers/history/the-location-interface/location_replace_session_history.html (#41896)
  • OK [expected CRASH] /html/browsers/history/the-location-interface/replace-with-nested-iframe.html (#48219)
  • TIMEOUT [expected OK] /html/semantics/embedded-content/media-elements/autoplay-disabled-by-permissions-policy.https.sub.html (#46012, #46804)
    • TIMEOUT [expected FAIL] subtest: Permissions-Policy header: autoplay "none" disallows same-origin iframes.

      Test timed out
      

  • OK /html/webappapis/user-prompts/print-during-unload.html (#35944)
    • PASS [expected FAIL] subtest: print() during unload
  • TIMEOUT [expected OK] /trusted-types/trusted-types-navigation.html?31-35 (#38034)
    • TIMEOUT [expected PASS] subtest: Navigate a frame via form-submission with javascript:-urls in report-only mode.

      Test timed out
      

    • NOTRUN [expected PASS] subtest: Navigate a frame via form-submission with javascript:-urls w/ default policy in report-only mode.
    • NOTRUN [expected FAIL] subtest: Navigate a window via form-submission with javascript:-urls w/ a default policy throwing an exception in enforcing mode.
    • NOTRUN [expected FAIL] subtest: Navigate a window via form-submission with javascript:-urls w/ a default policy throwing an exception in report-only mode.
    • NOTRUN [expected FAIL] subtest: Navigate a window via form-submission with javascript:-urls w/ a default policy making the URL invalid in enforcing mode.
  • OK [expected TIMEOUT] /webstorage/localstorage-about-blank-3P-iframe-opens-3P-window.partitioned.html (#29053)
    • FAIL [expected TIMEOUT] subtest: StorageKey: test 3P about:blank window opened from a 3P iframe

      assert_true: about:blank window opened by 3P iframe does not inherit 3P iframe's StorageKey expected true got false
      

@github-actions

Copy link
Copy Markdown

✨ Try run (#35752895867) succeeded.

@mrobinson
mrobinson added this pull request to the merge queue Sep 22, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Sep 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 22, 2026
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Sep 22, 2026
@jdm
jdm added this pull request to the merge queue Sep 23, 2026
@servo-highfive servo-highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Sep 23, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 23, 2026
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Sep 23, 2026
@jdm
jdm added this pull request to the merge queue Sep 23, 2026
@servo-highfive servo-highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Sep 23, 2026
Merged via the queue into servo:main with commit c4762b9 Sep 23, 2026
85 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Sep 23, 2026
@dzfrias
dzfrias deleted the ctrl-a-select branch September 25, 2026 18:25
RichardTjokroutomo pushed a commit to RichardTjokroutomo/servo that referenced this pull request Oct 6, 2026
This change adds support for selecting all document text with the CTRL+A
keyboard shortcut.

Testing: two tests for CTRL-A. One testing the normal case, and the
other testing when the body is removed from the DOM.
Fixes: servo#47897

---------

Signed-off-by: Diego Frias <[email protected]>
Signed-off-by: Martin Robinson <[email protected]>
Co-authored-by: Martin Robinson <[email protected]>
hhhwsqhhh pushed a commit to hhhwsqhhh/servo that referenced this pull request Oct 12, 2026
This change adds support for selecting all document text with the CTRL+A
keyboard shortcut.

Testing: two tests for CTRL-A. One testing the normal case, and the
other testing when the body is removed from the DOM.
Fixes: servo#47897

---------

Signed-off-by: Diego Frias <[email protected]>
Signed-off-by: Martin Robinson <[email protected]>
Co-authored-by: Martin Robinson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Ctrl+A "Select All" to select all text in a page

5 participants