Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script: Expose NodeTraits::owner_global / Window::as_global_scope #34843

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

mrobinson
Copy link
Member

Expose two new helpers and start using them as much as possible.

  • NodeTraits::owner_global: which gets the GlobalScope that currenty
    owns a Node. This may be different than .global() in the case that
    the Node was adopted by a different Document.
  • Window::as_global_scope: A helper to avoid having to cast so much
    when treating a Window like a GlobalScope.

Signed-off-by: Martin Robinson mrobinson@igalia.com


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes do not require tests because they just expose two new helpers that don't change the way code works.

@mrobinson mrobinson requested a review from gterzian as a code owner January 6, 2025 09:48
@mrobinson mrobinson force-pushed the owner-global-as-global-scope branch 2 times, most recently from 51861fd to 80c31e4 Compare January 6, 2025 16:12
Expose two new helpers and start using them as much as possible.

- `NodeTraits::owner_global`: which gets the `GlobalScope` that currenty
 owns a `Node`. This may be different than `.global()` in the case that
 the `Node` was adopted by a different `Document`.
- `Window::as_global_scope`: A helper to avoid having to cast so much
  when treating a `Window` like a `GlobalScope`.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
@mrobinson mrobinson force-pushed the owner-global-as-global-scope branch from 80c31e4 to e6415e9 Compare January 7, 2025 09:17
@mrobinson mrobinson enabled auto-merge January 7, 2025 09:18
@mrobinson mrobinson added this pull request to the merge queue Jan 7, 2025
Merged via the queue into servo:main with commit e42b4b7 Jan 7, 2025
22 checks passed
@mrobinson mrobinson deleted the owner-global-as-global-scope branch January 7, 2025 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants