Skip to content

constellation: Track top-level pipeline changes in webviews#43013

Merged
delan merged 1 commit intoservo:mainfrom
delan:constellation-track-active-top-level-pipeline
Mar 6, 2026
Merged

constellation: Track top-level pipeline changes in webviews#43013
delan merged 1 commit intoservo:mainfrom
delan:constellation-track-active-top-level-pipeline

Conversation

@delan
Copy link
Copy Markdown
Member

@delan delan commented Mar 4, 2026

whenever a browsing context loads a new document or otherwise navigates, the constellation sends a new frame tree to the compositor, giving us a nice, relatively central way to detect when we may need to update the graft node in a webview’s AccessKit subtree. but we only want to update that graft node when the pipeline in its top-level browsing context has changed, not just when the pipeline in any of its browsing contexts has changed.

this patch adds a field to the ConstellationWebView that tracks the active top-level pipeline for each webview, allowing us to check when a set_frame_tree_for_webview() call actually involves navigation in the top-level browsing context.

Testing: will be covered by accessibility tree tests in a later patch
Fixes: part of #4344, extracted from our work in #42338

@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 4, 2026
@delan delan changed the title constellation: Track changes to the top-level pipeline in a webview constellation: Track top-level pipeline changes in webviews Mar 4, 2026
@delan delan requested a review from mrobinson March 4, 2026 08:11
Copy link
Copy Markdown
Member

@mrobinson mrobinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable.

@servo-highfive servo-highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-awaiting-review There is new code that needs to be reviewed. labels Mar 5, 2026
@delan delan force-pushed the constellation-track-active-top-level-pipeline branch from c0fb60c to 65d9ffe Compare March 6, 2026 05:03
@delan delan force-pushed the constellation-track-active-top-level-pipeline branch from bb2c6bd to 6074622 Compare March 6, 2026 10:03
@delan delan enabled auto-merge March 6, 2026 10:03
@delan delan added this pull request to the merge queue Mar 6, 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 Mar 6, 2026
Merged via the queue into servo:main with commit ec55e83 Mar 6, 2026
30 checks passed
@delan delan deleted the constellation-track-active-top-level-pipeline branch March 6, 2026 12:04
@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 Mar 6, 2026
github-merge-queue bot pushed a commit that referenced this pull request Mar 26, 2026
in #43029, we defined an accessibility tree for each webview. we create
those trees when accessibility is activated for that webview, then the
embedder can graft it into their main accessibility tree. at the time,
this accessibility tree was empty, but we ultimately want it to contain
the accessibility tree of the documents loaded in the webview at any
given time. to do that, we need to graft the active top-level pipeline’s
accessibility tree into the webview accessibility tree. we should be
able to ignore nested documents inside iframes here, and leave it to
their parent documents to graft those in as part of layout
accessibility.

this patch hooks into the moment in the constellation where we detect
that the top-level document has changed (#43013), and notifies libservo
of the new AccessKit TreeId for the webview-to-pipeline graft node. this
moment covers navigating to a new top-level document and navigating back
or forward, but not the initial document loaded in the webview, so we
also hook into the moment a ConstellationWebView is created, and do the
same for that initial document. now the accessibility tree for a webview
with accessibility activated should look like this:

- embedder’s main tree
  - graft node for webview tree → webview tree
    - ~~graft node for document back in history~~
    - graft node for active top-level document → (nothing yet)
    - ~~graft node for document forward in history~~

Testing: this patch updates the relevant accessibility test in libservo
Fixes: part of #4344, extracted from our work in #42338

---------

Signed-off-by: Alice Boxhall <[email protected]>
Signed-off-by: delan azabani <[email protected]>
Co-authored-by: Alice Boxhall <[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.

3 participants