style: Allow passing an nth-index-cache to the invalidation code.

This commit is contained in:
Emilio Cobos Álvarez 2017-10-02 10:56:48 +02:00
parent e13f5a656a
commit aba1cf8cd5
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
4 changed files with 114 additions and 73 deletions

View file

@ -4058,7 +4058,17 @@ pub extern "C" fn Servo_ProcessInvalidations(set: RawServoStyleSetBorrowed,
let mut data = data.as_mut().map(|d| &mut **d);
if let Some(ref mut data) = data {
let result = data.invalidate_style_if_needed(element, &shared_style_context, None);
// FIXME(emilio): an nth-index cache could be worth here, even
// if temporary?
//
// Also, ideally we could share them across all the elements?
let result = data.invalidate_style_if_needed(
element,
&shared_style_context,
None,
None,
);
if result.has_invalidated_siblings() {
let parent = element.traversal_parent().expect("How could we invalidate siblings without a common parent?");
unsafe {