diff options
author | Clark Gaebel <cgaebel@mozilla.com> | 2014-10-06 11:40:05 -0400 |
---|---|---|
committer | Clark Gaebel <cgaebel@mozilla.com> | 2014-10-09 12:55:21 -0400 |
commit | d12c6e7383e0be0a64a4f00f1416323038516395 (patch) | |
tree | 1b959fd51cd51a91a8a562c91423a9af724897bb /components/script/dom/window.rs | |
parent | 510f8a817f8144dd5046886d4ca7c612f19a3d08 (diff) | |
download | servo-d12c6e7383e0be0a64a4f00f1416323038516395.tar.gz servo-d12c6e7383e0be0a64a4f00f1416323038516395.zip |
Incremental Style Recalc
This patch puts in the initial framework for incremental reflow. Nodes' styles
are no longer recalculated unless the node has changed.
I've been hacking on the general problem of incremental reflow for the past
couple weeks, and I've yet to get a full implementation that actually passes all
the reftests + wikipedia + cnn. Therefore, I'm going to try to land the different
parts of it one by one.
This patch only does incremental style recalc, without incremental flow
construction, inline-size bubbling, reflow, or display lists. Those will be coming
in that order as I finish them.
At least with this strategy, I can land a working version of incremental reflow,
even if not yet complete.
r? @pcwalton
Diffstat (limited to 'components/script/dom/window.rs')
-rw-r--r-- | components/script/dom/window.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 0c29b1be815..02166f328e4 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -18,7 +18,7 @@ use dom::location::Location; use dom::navigator::Navigator; use dom::performance::Performance; use dom::screen::Screen; -use layout_interface::{ReflowGoal, DocumentDamageLevel}; +use layout_interface::{ReflowGoal, ReflowForDisplay}; use page::Page; use script_task::{ExitWindowMsg, FireTimerMsg, ScriptChan, TriggerLoadMsg, TriggerFragmentMsg}; use script_traits::ScriptControlChan; @@ -366,7 +366,7 @@ impl Reflectable for Window { } pub trait WindowHelpers { - fn damage_and_reflow(self, damage: DocumentDamageLevel); + fn reflow(self); fn flush_layout(self, goal: ReflowGoal); fn wait_until_safe_to_modify_dom(self); fn init_browser_context(self, doc: JSRef<Document>); @@ -399,9 +399,12 @@ impl<'a> WindowHelpers for JSRef<'a, Window> { }) } - fn damage_and_reflow(self, damage: DocumentDamageLevel) { - self.page().damage(damage); - self.page().avoided_reflows.set(self.page().avoided_reflows.get() + 1); + fn reflow(self) { + self.page().damage(); + // FIXME This should probably be ReflowForQuery, not Display. All queries currently + // currently rely on the display list, which means we can't destroy it by + // doing a query reflow. + self.page().reflow(ReflowForDisplay, self.control_chan.clone(), &*self.compositor); } fn flush_layout(self, goal: ReflowGoal) { |