style: Remove a few more unuseful traversals now we can.

This commit is contained in:
Emilio Cobos Álvarez 2016-07-25 21:16:53 -07:00
parent 354dc66029
commit c3a727ebda
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
5 changed files with 64 additions and 73 deletions

View file

@ -268,16 +268,17 @@ pub fn recalc_style_at<'a, N, C>(context: &'a C,
// NB: flow construction updates the bloom filter on the way up.
put_thread_local_bloom_filter(bf, &unsafe_layout_node, context.shared_context());
// Mark the node as DIRTY_ON_VIEWPORT_SIZE_CHANGE is it uses viewport percentage units.
if let Some(element) = node.as_element() {
if let Some(ref property_declaration_block) = *element.style_attribute() {
if property_declaration_block.declarations().any(|d| d.0.has_viewport_percentage()) {
unsafe {
node.set_dirty_on_viewport_size_changed();
// Mark the node as DIRTY_ON_VIEWPORT_SIZE_CHANGE is it uses viewport
// percentage units.
if !node.needs_dirty_on_viewport_size_changed() {
if let Some(element) = node.as_element() {
if let Some(ref property_declaration_block) = *element.style_attribute() {
if property_declaration_block.declarations().any(|d| d.0.has_viewport_percentage()) {
unsafe {
node.set_dirty_on_viewport_size_changed();
}
}
node.set_descendants_dirty_on_viewport_size_changed();
}
}
}
}