aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_thread/lib.rs
diff options
context:
space:
mode:
authorShing Lyu <shing.lyu@gmail.com>2016-06-22 16:44:04 +0800
committerShing Lyu <shing.lyu@gmail.com>2016-07-18 11:01:42 +0800
commitf754cacbd53c47c63639e1d1226812427ef1eaad (patch)
tree4572aa2e175f5f081537e4022c9500583b6560c6 /components/layout_thread/lib.rs
parente7a55ae55ee0091095b8a460b3088440f352dd2e (diff)
downloadservo-f754cacbd53c47c63639e1d1226812427ef1eaad.tar.gz
servo-f754cacbd53c47c63639e1d1226812427ef1eaad.zip
Only restyle viewport-relative nodes on viewport size change
Diffstat (limited to 'components/layout_thread/lib.rs')
-rw-r--r--components/layout_thread/lib.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs
index fe1f82f533b..e670d214e03 100644
--- a/components/layout_thread/lib.rs
+++ b/components/layout_thread/lib.rs
@@ -1072,9 +1072,15 @@ impl LayoutThread {
.send(ConstellationMsg::ViewportConstrained(self.id, constraints))
.unwrap();
}
- // FIXME (#10104): Only dirty nodes affected by vh/vw/vmin/vmax styles.
if data.document_stylesheets.iter().any(|sheet| sheet.dirty_on_viewport_size_change) {
- needs_dirtying = true;
+ for node in node.traverse_preorder() {
+ if node.needs_dirty_on_viewport_size_changed() {
+ node.dirty_self();
+ node.dirty_descendants();
+ // TODO(shinglyu): We can skip the traversal if the descendants were already
+ // dirtied
+ }
+ }
}
}