Skip to content
Permalink
Browse files

Add NodeExt::as_opaque

  • Loading branch information
nox committed Dec 11, 2019
1 parent 22ea33c commit fb1891f43602ac61ac61079467c9dbd7ef0513a5
Showing with 6 additions and 1 deletion.
  1. +6 −1 components/layout_2020/dom_traversal.rs
@@ -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())

0 comments on commit fb1891f

Please sign in to comment.
You can’t perform that action at this time.