aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2025-01-03 19:55:01 +0100
committerGitHub <noreply@github.com>2025-01-03 18:55:01 +0000
commite8f75c9aea37d49d988f209281169af1fed05d8e (patch)
treefeb84b30238157c296b83c8a04394c853d5052f6 /components/script/script_thread.rs
parent621ddd749c7655a93547f52a438f2e2941d7df15 (diff)
downloadservo-e8f75c9aea37d49d988f209281169af1fed05d8e.tar.gz
servo-e8f75c9aea37d49d988f209281169af1fed05d8e.zip
script: Expose node helpers as `NodeTraits` and give more descriptive names (#34832)
This puts a few commonly used `Node` helpers into a trait (`NodeTraits`) and gives them more descriptive names and documentation. The renames: - `document_from_node` -> `NodeTraits::owner_document` - `window_from_node` -> `NodeTraits::owner_window` - `stylesheets_owner_from_node<T:` -> `NodeTraits::stylesheet_list_owner` - `containing_shadow_root` -> `NodeTraits::containing_shadow_root` Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r--components/script/script_thread.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 8a820a7b6bd..f970d351d35 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -130,7 +130,7 @@ use crate::dom::globalscope::GlobalScope;
use crate::dom::htmlanchorelement::HTMLAnchorElement;
use crate::dom::htmliframeelement::HTMLIFrameElement;
use crate::dom::mutationobserver::MutationObserver;
-use crate::dom::node::{window_from_node, Node, ShadowIncluding};
+use crate::dom::node::{Node, NodeTraits, ShadowIncluding};
use crate::dom::performanceentry::PerformanceEntry;
use crate::dom::performancepainttiming::PerformancePaintTiming;
use crate::dom::servoparser::{ParserContext, ServoParser};
@@ -3062,7 +3062,7 @@ impl ScriptThread {
.find_iframe(parent_id, browsing_context_id)
});
let parent_browsing_context = match (parent_info, iframe.as_ref()) {
- (_, Some(iframe)) => Some(window_from_node(&**iframe).window_proxy()),
+ (_, Some(iframe)) => Some(iframe.owner_window().window_proxy()),
(Some(parent_id), _) => self.remote_window_proxy(
window.upcast(),
top_level_browsing_context_id,