Allow setting id, class, style without a full reflow

Instead we do selector matching again, then diff the style structs to set the
"restyle damage" bits which are used to prune reflow traversals.

Also don't force a reflow when timers finish, because individual DOM methods
should already take care of that.
This commit is contained in:
Keegan McAllister 2013-12-10 15:15:43 -08:00
parent 93e10eaf20
commit 0238410b47
4 changed files with 16 additions and 9 deletions

View file

@ -12,7 +12,7 @@ use dom::node::{AbstractNode, ScriptView};
use dom::location::Location;
use dom::navigator::Navigator;
use layout_interface::{ReflowForDisplay, ContentChangedDocumentDamage};
use layout_interface::{ReflowForDisplay, DocumentDamageLevel};
use script_task::{ExitWindowMsg, FireTimerMsg, Page, ScriptChan};
use servo_msg::compositor_msg::ScriptListener;
use servo_net::image_cache_task::ImageCacheTask;
@ -185,11 +185,11 @@ impl Window {
self.active_timers.remove(&handle);
}
pub fn content_changed(&self) {
pub fn damage_and_reflow(&self, damage: DocumentDamageLevel) {
// 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.damage(ContentChangedDocumentDamage);
self.page.damage(damage);
self.page.reflow(ReflowForDisplay, self.script_chan.clone(), self.compositor);
}