style: Make a bloom filter arrive to restyle hint computation.

This commit is contained in:
Emilio Cobos Álvarez 2017-05-19 05:00:29 +02:00
parent 1cea4e7942
commit a12996f030
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
4 changed files with 107 additions and 38 deletions

View file

@ -4,13 +4,11 @@
//! Per-node data used in style calculation.
#![deny(missing_docs)]
use context::SharedStyleContext;
use dom::TElement;
use properties::ComputedValues;
use properties::longhands::display::computed_value as display;
use restyle_hints::{RestyleReplacements, RestyleHint};
use restyle_hints::{HintComputationContext, RestyleReplacements, RestyleHint};
use rule_tree::StrongRuleNode;
use selector_parser::{EAGER_PSEUDO_COUNT, PseudoElement, RestyleDamage};
use shared_lock::StylesheetGuards;
@ -372,15 +370,16 @@ impl ElementData {
/// explicit sibling restyle hints from the stored restyle hint.
///
/// Returns true if later siblings must be restyled.
pub fn compute_final_hint<E: TElement>(
pub fn compute_final_hint<'a, E: TElement>(
&mut self,
element: E,
context: &SharedStyleContext)
shared_context: &SharedStyleContext,
hint_context: HintComputationContext<'a, E>)
-> bool
{
debug!("compute_final_hint: {:?}, {:?}",
element,
context.traversal_flags);
shared_context.traversal_flags);
let mut hint = match self.get_restyle() {
Some(r) => r.hint.0.clone(),
@ -395,7 +394,11 @@ impl ElementData {
element.implemented_pseudo_element());
if element.has_snapshot() && !element.handled_snapshot() {
hint.insert(context.stylist.compute_restyle_hint(&element, context.snapshot_map));
let snapshot_hint =
shared_context.stylist.compute_restyle_hint(&element,
shared_context,
hint_context);
hint.insert(snapshot_hint);
unsafe { element.set_handled_snapshot() }
debug_assert!(element.handled_snapshot());
}