Skip to content
Permalink
Browse files

Rename RecalcStyleAndConstructFlows to RecalcStyle

It doesn't construct flows anymore.
  • Loading branch information...
nox committed Aug 22, 2019
1 parent eaf08ef commit be0e84b30f5b3ffa708b81348e66748ec43dfc8a
Showing with 9 additions and 14 deletions.
  1. +4 −4 components/layout_2020/traversal.rs
  2. +5 −10 components/layout_thread_2020/lib.rs
@@ -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> {
@@ -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,
@@ -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};
@@ -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 {

0 comments on commit be0e84b

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