Skip to content

Commit

Permalink
Rename RecalcStyleAndConstructFlows to RecalcStyle
Browse files Browse the repository at this point in the history
It doesn't construct flows anymore.
  • Loading branch information
nox committed Sep 11, 2019
1 parent eaf08ef commit be0e84b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
8 changes: 4 additions & 4 deletions components/layout_2020/traversal.rs
Expand Up @@ -11,13 +11,13 @@ use style::dom::{NodeInfo, TElement, TNode};
use style::traversal::PerLevelTraversalData;
use style::traversal::{recalc_style_at, DomTraversal};

pub struct RecalcStyleAndConstructFlows<'a> {
pub struct RecalcStyle<'a> {
context: LayoutContext<'a>,
}

impl<'a> RecalcStyleAndConstructFlows<'a> {
impl<'a> RecalcStyle<'a> {
pub fn new(context: LayoutContext<'a>) -> Self {
RecalcStyleAndConstructFlows { context: context }
RecalcStyle { context: context }
}

pub fn destroy(self) -> LayoutContext<'a> {
Expand All @@ -26,7 +26,7 @@ impl<'a> RecalcStyleAndConstructFlows<'a> {
}

#[allow(unsafe_code)]
impl<'a, E> DomTraversal<E> for RecalcStyleAndConstructFlows<'a>
impl<'a, E> DomTraversal<E> for RecalcStyle<'a>
where
E: TElement,
E::ConcreteNode: LayoutNode,
Expand Down
15 changes: 5 additions & 10 deletions components/layout_thread_2020/lib.rs
Expand Up @@ -44,7 +44,7 @@ use layout::query::{
process_offset_parent_query, process_resolved_style_request, process_style_query,
process_text_index_request,
};
use layout::traversal::RecalcStyleAndConstructFlows;
use layout::traversal::RecalcStyle;
use layout_traits::LayoutThreadFactory;
use libc::c_void;
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
Expand Down Expand Up @@ -1066,19 +1066,14 @@ impl LayoutThread {
// Create a layout context for use throughout the following passes.
let mut layout_context = self.build_layout_context(guards.clone(), &map);

let traversal = RecalcStyleAndConstructFlows::new(layout_context);
let traversal = RecalcStyle::new(layout_context);
let token = {
let shared =
<RecalcStyleAndConstructFlows as DomTraversal<ServoLayoutElement>>::shared_context(
&traversal,
);
RecalcStyleAndConstructFlows::pre_traverse(element, shared)
let shared = DomTraversal::<ServoLayoutElement>::shared_context(&traversal);
RecalcStyle::pre_traverse(element, shared)
};

if token.should_traverse() {
driver::traverse_dom::<ServoLayoutElement, RecalcStyleAndConstructFlows>(
&traversal, token, None,
);
driver::traverse_dom(&traversal, token, None);
}

for element in elements_with_snapshot {
Expand Down

0 comments on commit be0e84b

Please sign in to comment.