mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
style: Lazily tweak the traversal root to account for sibling invalidations.
Bug: 1403078 Reviewed-by: heycam MozReview-Commit-ID: Ij3nMOKu5FO Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
parent
1282e0d808
commit
07d55a4bf8
5 changed files with 69 additions and 63 deletions
|
@ -1268,15 +1268,11 @@ impl LayoutThread {
|
|||
None
|
||||
};
|
||||
|
||||
// NB: Type inference falls apart here for some reason, so we need to be very verbose. :-(
|
||||
let traversal = RecalcStyleAndConstructFlows::new(layout_context);
|
||||
let token = {
|
||||
let context = <RecalcStyleAndConstructFlows as
|
||||
DomTraversal<ServoLayoutElement>>::shared_context(&traversal);
|
||||
<RecalcStyleAndConstructFlows as
|
||||
DomTraversal<ServoLayoutElement>>::pre_traverse(element,
|
||||
context,
|
||||
TraversalFlags::empty())
|
||||
let shared =
|
||||
<RecalcStyleAndConstructFlows as DomTraversal<ServoLayoutElement>>::shared_context(&traversal);
|
||||
RecalcStyleAndConstructFlows::pre_traverse(element, shared)
|
||||
};
|
||||
|
||||
if token.should_traverse() {
|
||||
|
@ -1287,7 +1283,10 @@ impl LayoutThread {
|
|||
|| {
|
||||
// Perform CSS selector matching and flow construction.
|
||||
driver::traverse_dom::<ServoLayoutElement, RecalcStyleAndConstructFlows>(
|
||||
&traversal, element, token, thread_pool);
|
||||
&traversal,
|
||||
token,
|
||||
thread_pool,
|
||||
);
|
||||
});
|
||||
// TODO(pcwalton): Measure energy usage of text shaping, perhaps?
|
||||
let text_shaping_time =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue