mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
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:
parent
75a4dcf293
commit
0380431157
9 changed files with 177 additions and 267 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue