mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
layout: Cache applicable-declarations-to-computed-values mappings.
If the cache is hit, then we can only compute inherited properties. This is a WebKit optimization.
This commit is contained in:
parent
1678cc9a88
commit
0fa0940ce9
8 changed files with 453 additions and 78 deletions
|
@ -5,7 +5,7 @@
|
|||
//! The layout task. Performs layout on the DOM, builds display lists and sends them to be
|
||||
/// rendered.
|
||||
|
||||
use css::matching::{ApplicableDeclarations, MatchMethods};
|
||||
use css::matching::{ApplicableDeclarations, ApplicableDeclarationsCache, MatchMethods};
|
||||
use css::select::new_stylist;
|
||||
use css::node_style::StyledNode;
|
||||
use layout::construct::{FlowConstructionResult, FlowConstructor, NoConstructionResult};
|
||||
|
@ -568,10 +568,13 @@ impl LayoutTask {
|
|||
match self.parallel_traversal {
|
||||
None => {
|
||||
let mut applicable_declarations = ApplicableDeclarations::new();
|
||||
let mut applicable_declarations_cache =
|
||||
ApplicableDeclarationsCache::new();
|
||||
node.match_and_cascade_subtree(self.stylist,
|
||||
&layout_ctx.layout_chan,
|
||||
&mut applicable_declarations,
|
||||
layout_ctx.initial_css_values.get(),
|
||||
&mut applicable_declarations_cache,
|
||||
None)
|
||||
}
|
||||
Some(ref mut traversal) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue