Only restyle viewport-relative nodes on viewport size change

This commit is contained in:
Shing Lyu 2016-06-22 16:44:04 +08:00
parent e7a55ae55e
commit f754cacbd5
28 changed files with 515 additions and 11 deletions

View file

@ -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
}
}
}
}