mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
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:
parent
93e10eaf20
commit
0238410b47
4 changed files with 16 additions and 9 deletions
|
@ -23,6 +23,7 @@ use dom::htmltitleelement::HTMLTitleElement;
|
|||
use html::hubbub_html_parser::build_element_from_tag;
|
||||
use js::jsapi::{JSObject, JSContext, JSTracer};
|
||||
use servo_util::tree::{TreeNodeRef, ElementLike};
|
||||
use layout_interface::{DocumentDamageLevel, ContentChangedDocumentDamage};
|
||||
|
||||
use std::hashmap::HashMap;
|
||||
|
||||
|
@ -319,7 +320,11 @@ impl Document {
|
|||
}
|
||||
|
||||
pub fn content_changed(&self) {
|
||||
self.window.content_changed();
|
||||
self.damage_and_reflow(ContentChangedDocumentDamage);
|
||||
}
|
||||
|
||||
pub fn damage_and_reflow(&self, damage: DocumentDamageLevel) {
|
||||
self.window.damage_and_reflow(damage);
|
||||
}
|
||||
|
||||
pub fn wait_until_safe_to_modify_dom(&self) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue