mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Rename Arc to ServoArc in layout_2020::dom_traversal
This commit is contained in:
parent
c156bf2dd9
commit
10eccc8beb
1 changed files with 10 additions and 10 deletions
|
@ -8,7 +8,7 @@ use crate::style_ext::{Display, DisplayGeneratingBox, DisplayInside, DisplayOuts
|
||||||
use crate::wrapper::GetRawData;
|
use crate::wrapper::GetRawData;
|
||||||
use atomic_refcell::{AtomicRefCell, AtomicRefMut};
|
use atomic_refcell::{AtomicRefCell, AtomicRefMut};
|
||||||
use script_layout_interface::wrapper_traits::{LayoutNode, ThreadSafeLayoutNode};
|
use script_layout_interface::wrapper_traits::{LayoutNode, ThreadSafeLayoutNode};
|
||||||
use servo_arc::Arc;
|
use servo_arc::Arc as ServoArc;
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
use std::marker::PhantomData as marker;
|
use std::marker::PhantomData as marker;
|
||||||
use style::context::SharedStyleContext;
|
use style::context::SharedStyleContext;
|
||||||
|
@ -49,12 +49,12 @@ pub(super) trait TraversalHandler<'dom, Node>
|
||||||
where
|
where
|
||||||
Node: 'dom,
|
Node: 'dom,
|
||||||
{
|
{
|
||||||
fn handle_text(&mut self, text: String, parent_style: &Arc<ComputedValues>);
|
fn handle_text(&mut self, text: String, parent_style: &ServoArc<ComputedValues>);
|
||||||
|
|
||||||
/// Or pseudo-element
|
/// Or pseudo-element
|
||||||
fn handle_element(
|
fn handle_element(
|
||||||
&mut self,
|
&mut self,
|
||||||
style: &Arc<ComputedValues>,
|
style: &ServoArc<ComputedValues>,
|
||||||
display: DisplayGeneratingBox,
|
display: DisplayGeneratingBox,
|
||||||
contents: Contents<Node>,
|
contents: Contents<Node>,
|
||||||
box_slot: BoxSlot<'dom>,
|
box_slot: BoxSlot<'dom>,
|
||||||
|
@ -144,7 +144,7 @@ fn traverse_pseudo_element<'dom, Node>(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn traverse_pseudo_element_contents<'dom, Node>(
|
fn traverse_pseudo_element_contents<'dom, Node>(
|
||||||
pseudo_element_style: &Arc<ComputedValues>,
|
pseudo_element_style: &ServoArc<ComputedValues>,
|
||||||
context: &SharedStyleContext,
|
context: &SharedStyleContext,
|
||||||
handler: &mut impl TraversalHandler<'dom, Node>,
|
handler: &mut impl TraversalHandler<'dom, Node>,
|
||||||
items: Vec<PseudoElementContentItem>,
|
items: Vec<PseudoElementContentItem>,
|
||||||
|
@ -213,7 +213,7 @@ where
|
||||||
{
|
{
|
||||||
pub(crate) fn traverse(
|
pub(crate) fn traverse(
|
||||||
self,
|
self,
|
||||||
inherited_style: &Arc<ComputedValues>,
|
inherited_style: &ServoArc<ComputedValues>,
|
||||||
context: &SharedStyleContext,
|
context: &SharedStyleContext,
|
||||||
handler: &mut impl TraversalHandler<'dom, Node>,
|
handler: &mut impl TraversalHandler<'dom, Node>,
|
||||||
) {
|
) {
|
||||||
|
@ -230,7 +230,7 @@ fn pseudo_element_style<'dom, Node>(
|
||||||
_which: WhichPseudoElement,
|
_which: WhichPseudoElement,
|
||||||
_element: Node,
|
_element: Node,
|
||||||
_context: &SharedStyleContext,
|
_context: &SharedStyleContext,
|
||||||
) -> Option<Arc<ComputedValues>>
|
) -> Option<ServoArc<ComputedValues>>
|
||||||
where
|
where
|
||||||
Node: NodeExt<'dom>,
|
Node: NodeExt<'dom>,
|
||||||
{
|
{
|
||||||
|
@ -253,12 +253,12 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct BoxSlot<'dom> {
|
pub struct BoxSlot<'dom> {
|
||||||
slot: Option<Arc<AtomicRefCell<Option<LayoutBox>>>>,
|
slot: Option<ServoArc<AtomicRefCell<Option<LayoutBox>>>>,
|
||||||
marker: marker<&'dom ()>,
|
marker: marker<&'dom ()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BoxSlot<'_> {
|
impl BoxSlot<'_> {
|
||||||
pub(crate) fn new(slot: Arc<AtomicRefCell<Option<LayoutBox>>>) -> Self {
|
pub(crate) fn new(slot: ServoArc<AtomicRefCell<Option<LayoutBox>>>) -> Self {
|
||||||
*slot.borrow_mut() = None;
|
*slot.borrow_mut() = None;
|
||||||
let slot = Some(slot);
|
let slot = Some(slot);
|
||||||
Self { slot, marker }
|
Self { slot, marker }
|
||||||
|
@ -290,7 +290,7 @@ pub trait NodeExt<'dom>: 'dom + Copy + LayoutNode + Send + Sync {
|
||||||
fn first_child(self) -> Option<Self>;
|
fn first_child(self) -> Option<Self>;
|
||||||
fn next_sibling(self) -> Option<Self>;
|
fn next_sibling(self) -> Option<Self>;
|
||||||
fn parent_node(self) -> Option<Self>;
|
fn parent_node(self) -> Option<Self>;
|
||||||
fn style(self, context: &SharedStyleContext) -> Arc<ComputedValues>;
|
fn style(self, context: &SharedStyleContext) -> ServoArc<ComputedValues>;
|
||||||
|
|
||||||
fn layout_data_mut(&self) -> AtomicRefMut<LayoutDataForElement>;
|
fn layout_data_mut(&self) -> AtomicRefMut<LayoutDataForElement>;
|
||||||
fn element_box_slot(&self) -> BoxSlot<'dom>;
|
fn element_box_slot(&self) -> BoxSlot<'dom>;
|
||||||
|
@ -327,7 +327,7 @@ where
|
||||||
TNode::parent_node(&self)
|
TNode::parent_node(&self)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn style(self, context: &SharedStyleContext) -> Arc<ComputedValues> {
|
fn style(self, context: &SharedStyleContext) -> ServoArc<ComputedValues> {
|
||||||
self.to_threadsafe().style(context)
|
self.to_threadsafe().style(context)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue