Combine ReflowGoal and ReflowQueryType

This simplifies the logic in the layout_thread and makes it clearer
which types of reflows generate display lists and cause display updates.
This commit is contained in:
Martin Robinson 2017-09-30 14:57:59 +02:00
parent 75a4dcf293
commit 0380431157
9 changed files with 177 additions and 267 deletions

View file

@ -11,8 +11,7 @@ use dom::eventtarget::EventTarget;
use dom::mouseevent::MouseEvent;
use dom::node::window_from_node;
use dom::window::ReflowReason;
use script_layout_interface::message::ReflowQueryType;
use style::context::ReflowGoal;
use script_layout_interface::message::ReflowGoal;
/// Trait for elements with defined activation behavior
pub trait Activatable {
@ -38,18 +37,14 @@ pub trait Activatable {
self.as_element().set_active_state(true);
let win = window_from_node(self.as_element());
win.reflow(ReflowGoal::ForDisplay,
ReflowQueryType::NoQuery,
ReflowReason::ElementStateChanged);
win.reflow(ReflowGoal::Full, ReflowReason::ElementStateChanged);
}
fn exit_formal_activation_state(&self) {
self.as_element().set_active_state(false);
let win = window_from_node(self.as_element());
win.reflow(ReflowGoal::ForDisplay,
ReflowQueryType::NoQuery,
ReflowReason::ElementStateChanged);
win.reflow(ReflowGoal::Full, ReflowReason::ElementStateChanged);
}
}