mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Remove many explicit reflow calls (#33067)
* Remove explicit reflow for iframe content updates. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Remove explicit reflow for timers. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Remove explicit reflow for MouseEvent. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Remove explicit reflow for key events. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Remove explicit reflow for document load. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Remove explicit reflow for iframe load. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Remove unused reflow reasons. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
a34920b605
commit
3cc91e655f
3 changed files with 1 additions and 27 deletions
|
@ -1352,9 +1352,6 @@ impl Document {
|
||||||
self.commit_focus_transaction(FocusType::Element);
|
self.commit_focus_transaction(FocusType::Element);
|
||||||
self.maybe_fire_dblclick(client_point, node, pressed_mouse_buttons);
|
self.maybe_fire_dblclick(client_point, node, pressed_mouse_buttons);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.window
|
|
||||||
.reflow(ReflowGoal::Full, ReflowReason::MouseEvent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn maybe_fire_dblclick(
|
fn maybe_fire_dblclick(
|
||||||
|
@ -1570,8 +1567,6 @@ impl Document {
|
||||||
// If the target has changed then store the current mouse over target for next frame.
|
// If the target has changed then store the current mouse over target for next frame.
|
||||||
if target_has_changed {
|
if target_has_changed {
|
||||||
prev_mouse_over_target.set(maybe_new_target.as_deref());
|
prev_mouse_over_target.set(maybe_new_target.as_deref());
|
||||||
self.window
|
|
||||||
.reflow(ReflowGoal::Full, ReflowReason::MouseEvent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1772,8 +1767,6 @@ impl Document {
|
||||||
let event = event.upcast::<Event>();
|
let event = event.upcast::<Event>();
|
||||||
let result = event.fire(&target);
|
let result = event.fire(&target);
|
||||||
|
|
||||||
window.reflow(ReflowGoal::Full, ReflowReason::MouseEvent);
|
|
||||||
|
|
||||||
match result {
|
match result {
|
||||||
EventStatus::Canceled => TouchEventResult::Processed(false),
|
EventStatus::Canceled => TouchEventResult::Processed(false),
|
||||||
EventStatus::NotCanceled => TouchEventResult::Processed(true),
|
EventStatus::NotCanceled => TouchEventResult::Processed(true),
|
||||||
|
@ -1857,8 +1850,6 @@ impl Document {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.window.reflow(ReflowGoal::Full, ReflowReason::KeyEvent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn ime_dismissed(&self) {
|
pub fn ime_dismissed(&self) {
|
||||||
|
@ -2363,8 +2354,6 @@ impl Document {
|
||||||
// http://w3c.github.io/navigation-timing/#widl-PerformanceNavigationTiming-loadEventEnd
|
// http://w3c.github.io/navigation-timing/#widl-PerformanceNavigationTiming-loadEventEnd
|
||||||
update_with_current_time_ms(&document.load_event_end);
|
update_with_current_time_ms(&document.load_event_end);
|
||||||
|
|
||||||
window.reflow(ReflowGoal::Full, ReflowReason::DocumentLoaded);
|
|
||||||
|
|
||||||
if let Some(fragment) = document.url().fragment() {
|
if let Some(fragment) = document.url().fragment() {
|
||||||
document.check_and_scroll_fragment(fragment);
|
document.check_and_scroll_fragment(fragment);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@ use dom_struct::dom_struct;
|
||||||
use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
|
use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
|
||||||
use js::rust::HandleObject;
|
use js::rust::HandleObject;
|
||||||
use profile_traits::ipc as ProfiledIpc;
|
use profile_traits::ipc as ProfiledIpc;
|
||||||
use script_layout_interface::ReflowGoal;
|
|
||||||
use script_traits::IFrameSandboxState::{IFrameSandboxed, IFrameUnsandboxed};
|
use script_traits::IFrameSandboxState::{IFrameSandboxed, IFrameUnsandboxed};
|
||||||
use script_traits::{
|
use script_traits::{
|
||||||
HistoryEntryReplacement, IFrameLoadInfo, IFrameLoadInfoWithData, JsEvalResult, LoadData,
|
HistoryEntryReplacement, IFrameLoadInfo, IFrameLoadInfoWithData, JsEvalResult, LoadData,
|
||||||
|
@ -40,7 +39,6 @@ use crate::dom::node::{
|
||||||
document_from_node, window_from_node, BindContext, Node, NodeDamage, UnbindContext,
|
document_from_node, window_from_node, BindContext, Node, NodeDamage, UnbindContext,
|
||||||
};
|
};
|
||||||
use crate::dom::virtualmethods::VirtualMethods;
|
use crate::dom::virtualmethods::VirtualMethods;
|
||||||
use crate::dom::window::ReflowReason;
|
|
||||||
use crate::dom::windowproxy::WindowProxy;
|
use crate::dom::windowproxy::WindowProxy;
|
||||||
use crate::script_thread::ScriptThread;
|
use crate::script_thread::ScriptThread;
|
||||||
|
|
||||||
|
@ -420,7 +418,7 @@ impl HTMLIFrameElement {
|
||||||
|
|
||||||
self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
|
self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
|
||||||
let window = window_from_node(self);
|
let window = window_from_node(self);
|
||||||
window.reflow(ReflowGoal::Full, ReflowReason::FramedContentChanged);
|
window.add_pending_reflow();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn new_inherited(
|
fn new_inherited(
|
||||||
|
@ -500,9 +498,6 @@ impl HTMLIFrameElement {
|
||||||
LoadBlocker::terminate(&mut blocker);
|
LoadBlocker::terminate(&mut blocker);
|
||||||
|
|
||||||
// TODO Step 5 - unset child document `mut iframe load` flag
|
// TODO Step 5 - unset child document `mut iframe load` flag
|
||||||
|
|
||||||
let window = window_from_node(self);
|
|
||||||
window.reflow(ReflowGoal::Full, ReflowReason::IFrameLoadEvent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -164,23 +164,14 @@ enum WindowState {
|
||||||
#[derive(Debug, MallocSizeOf)]
|
#[derive(Debug, MallocSizeOf)]
|
||||||
pub enum ReflowReason {
|
pub enum ReflowReason {
|
||||||
CachedPageNeededReflow,
|
CachedPageNeededReflow,
|
||||||
DOMContentLoaded,
|
|
||||||
DocumentLoaded,
|
|
||||||
ElementStateChanged,
|
ElementStateChanged,
|
||||||
FirstLoad,
|
FirstLoad,
|
||||||
FramedContentChanged,
|
|
||||||
IFrameLoadEvent,
|
|
||||||
ImageLoaded,
|
|
||||||
KeyEvent,
|
|
||||||
MissingExplicitReflow,
|
MissingExplicitReflow,
|
||||||
MouseEvent,
|
|
||||||
PendingReflow,
|
PendingReflow,
|
||||||
Query,
|
Query,
|
||||||
RefreshTick,
|
RefreshTick,
|
||||||
RequestAnimationFrame,
|
RequestAnimationFrame,
|
||||||
ScrollFromScript,
|
ScrollFromScript,
|
||||||
StylesheetLoaded,
|
|
||||||
Timer,
|
|
||||||
Viewport,
|
Viewport,
|
||||||
WindowResize,
|
WindowResize,
|
||||||
WorkletLoaded,
|
WorkletLoaded,
|
||||||
|
@ -2320,7 +2311,6 @@ impl Window {
|
||||||
|
|
||||||
pub fn handle_fire_timer(&self, timer_id: TimerEventId) {
|
pub fn handle_fire_timer(&self, timer_id: TimerEventId) {
|
||||||
self.upcast::<GlobalScope>().fire_timer(timer_id);
|
self.upcast::<GlobalScope>().fire_timer(timer_id);
|
||||||
self.reflow(ReflowGoal::Full, ReflowReason::Timer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_window_size(&self, size: WindowSizeData) {
|
pub fn set_window_size(&self, size: WindowSizeData) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue