mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
script: Clean up Window::force_reflow
a little (#37725)
- Move some of the image handling code to a separate function. - Move reflow event debugging into layout itself and use the `Debug` implementation to print the event. - A few other small cleanups Testing: This should not change behavior and is thus covered by existing WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
a93d977020
commit
5e44582277
5 changed files with 96 additions and 108 deletions
|
@ -617,9 +617,28 @@ impl LayoutThread {
|
|||
!self.need_new_display_list.get()
|
||||
}
|
||||
|
||||
fn maybe_print_reflow_event(&self, reflow_request: &ReflowRequest) {
|
||||
if !self.debug.relayout_event {
|
||||
return;
|
||||
}
|
||||
|
||||
println!(
|
||||
"**** Reflow({}) => {:?}, {:?}",
|
||||
self.id,
|
||||
reflow_request.reflow_goal,
|
||||
reflow_request
|
||||
.restyle
|
||||
.as_ref()
|
||||
.map(|restyle| restyle.reason)
|
||||
.unwrap_or_default()
|
||||
);
|
||||
}
|
||||
|
||||
/// The high-level routine that performs layout.
|
||||
#[servo_tracing::instrument(skip_all)]
|
||||
fn handle_reflow(&mut self, mut reflow_request: ReflowRequest) -> Option<ReflowResult> {
|
||||
self.maybe_print_reflow_event(&reflow_request);
|
||||
|
||||
if self.can_skip_reflow_request_entirely(&reflow_request) {
|
||||
if let ReflowGoal::UpdateScrollNode(external_scroll_id, offset) =
|
||||
reflow_request.reflow_goal
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue