mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Bug 1355343: Take all the snapshots into account. r=bholley
I've chosen this approach mainly because there's no other good way to guarantee the model is correct than holding the snapshots alive until a style refresh. What I tried before this (storing them in a sort of "immutable element data") is a pain, since we call into style from the frame constructor and other content notifications, which makes keeping track of which snapshots should be cleared an which shouldn't an insane task. Ideally we'd have a single entry-point for style, but that's not the case right now, and changing that requires pretty non-trivial changes to the frame constructor. MozReview-Commit-ID: FF1KWZv2iBM Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
parent
7d45aad9b4
commit
46bf5d61f0
16 changed files with 439 additions and 308 deletions
|
@ -22,7 +22,7 @@ use properties::INHERIT_ALL;
|
|||
use properties::PropertyDeclarationBlock;
|
||||
use restyle_hints::{RestyleHint, DependencySet};
|
||||
use rule_tree::{CascadeLevel, RuleTree, StrongRuleNode, StyleSource};
|
||||
use selector_parser::{SelectorImpl, PseudoElement, Snapshot};
|
||||
use selector_parser::{SelectorImpl, PseudoElement, SnapshotMap};
|
||||
use selectors::Element;
|
||||
use selectors::bloom::BloomFilter;
|
||||
use selectors::matching::{AFFECTED_BY_STYLE_ATTRIBUTE, AFFECTED_BY_PRESENTATIONAL_HINTS};
|
||||
|
@ -894,16 +894,16 @@ impl Stylist {
|
|||
results
|
||||
}
|
||||
|
||||
/// Given an element, and a snapshot that represents a previous state of the
|
||||
/// element, compute the appropriate restyle hint, that is, the kind of
|
||||
/// Given an element, and a snapshot table that represents a previous state
|
||||
/// of the tree, compute the appropriate restyle hint, that is, the kind of
|
||||
/// restyle we need to do.
|
||||
pub fn compute_restyle_hint<E>(&self,
|
||||
element: &E,
|
||||
snapshot: &Snapshot)
|
||||
snapshots: &SnapshotMap)
|
||||
-> RestyleHint
|
||||
where E: TElement,
|
||||
{
|
||||
self.dependencies.compute_hint(element, snapshot)
|
||||
self.dependencies.compute_hint(element, snapshots)
|
||||
}
|
||||
|
||||
/// Computes styles for a given declaration with parent_style.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue