mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Add NodeExt::as_opaque
This commit is contained in:
parent
22ea33cb37
commit
fb1891f436
1 changed files with 6 additions and 1 deletions
|
@ -14,7 +14,7 @@ use script_layout_interface::wrapper_traits::{LayoutNode, ThreadSafeLayoutNode};
|
|||
use servo_arc::Arc as ServoArc;
|
||||
use std::marker::PhantomData as marker;
|
||||
use std::sync::Arc;
|
||||
use style::dom::TNode;
|
||||
use style::dom::{OpaqueNode, TNode};
|
||||
use style::properties::ComputedValues;
|
||||
use style::selector_parser::PseudoElement;
|
||||
|
||||
|
@ -307,6 +307,7 @@ pub(crate) trait NodeExt<'dom>: 'dom + Copy + LayoutNode + Send + Sync {
|
|||
fn parent_node(self) -> Option<Self>;
|
||||
fn style(self, context: &LayoutContext) -> ServoArc<ComputedValues>;
|
||||
|
||||
fn as_opaque(self) -> OpaqueNode;
|
||||
fn layout_data_mut(&self) -> AtomicRefMut<LayoutDataForElement>;
|
||||
fn element_box_slot(&self) -> BoxSlot<'dom>;
|
||||
fn pseudo_element_box_slot(&self, which: WhichPseudoElement) -> BoxSlot<'dom>;
|
||||
|
@ -366,6 +367,10 @@ where
|
|||
self.to_threadsafe().style(context.shared_context())
|
||||
}
|
||||
|
||||
fn as_opaque(self) -> OpaqueNode {
|
||||
self.opaque()
|
||||
}
|
||||
|
||||
fn layout_data_mut(&self) -> AtomicRefMut<LayoutDataForElement> {
|
||||
self.get_raw_data()
|
||||
.map(|d| d.layout_data.borrow_mut())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue