mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
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>
This commit is contained in:
parent
621ddd749c
commit
e8f75c9aea
66 changed files with 415 additions and 426 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue