Implements reflow events debugging.

Start servo with -Z relayout-event and you should have
reflow events printed to the terminal.
This commit is contained in:
Adenilson Cavalcanti 2015-03-04 15:45:34 -08:00
parent 34289943e3
commit 618f56410d
4 changed files with 70 additions and 18 deletions

View file

@ -56,7 +56,7 @@ use dom::processinginstruction::ProcessingInstruction;
use dom::range::Range;
use dom::treewalker::TreeWalker;
use dom::uievent::UIEvent;
use dom::window::{Window, WindowHelpers};
use dom::window::{Window, WindowHelpers, ReflowReason};
use layout_interface::{HitTestResponse, MouseOverResponse};
use msg::compositor_msg::ScriptListener;
@ -523,7 +523,7 @@ impl<'a> DocumentHelpers<'a> for JSRef<'a, Document> {
el.authentic_click_activation(event);
self.commit_focus_transaction();
window.r().reflow(ReflowGoal::ForDisplay, ReflowQueryType::NoQuery);
window.r().reflow(ReflowGoal::ForDisplay, ReflowQueryType::NoQuery, ReflowReason::MouseEvent);
}
/// Return need force reflow or not
@ -664,7 +664,7 @@ impl<'a> DocumentHelpers<'a> for JSRef<'a, Document> {
_ => ()
}
window.r().reflow(ReflowGoal::ForDisplay, ReflowQueryType::NoQuery);
window.r().reflow(ReflowGoal::ForDisplay, ReflowQueryType::NoQuery, ReflowReason::KeyEvent);
}
fn set_current_script(self, script: Option<JSRef<HTMLScriptElement>>) {