Skip to content

Commit

Permalink
Don't force reflow on content changes
Browse files Browse the repository at this point in the history
This fixes a performance regression caused by the previous patches.  Once we
allowed script and layout to run during parsing, it was running too often
(every time the document changed and called window.reflow).

Fixes #1269.
  • Loading branch information
mbrubeck committed Oct 29, 2014
1 parent fe123ad commit f39e01b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions components/script/dom/window.rs
Expand Up @@ -19,7 +19,7 @@ use dom::location::Location;
use dom::navigator::Navigator;
use dom::performance::Performance;
use dom::screen::Screen;
use layout_interface::{ReflowGoal, ReflowForDisplay};
use layout_interface::ReflowGoal;
use page::Page;
use script_task::{ExitWindowMsg, ScriptChan, TriggerLoadMsg, TriggerFragmentMsg};
use script_task::FromWindow;
Expand Down Expand Up @@ -348,10 +348,6 @@ impl<'a> WindowHelpers for JSRef<'a, Window> {

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) {
Expand Down

0 comments on commit f39e01b

Please sign in to comment.