mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Layout: minor optimizations and bugfix for non-functional details (#38197)
This change adds some minor optimizations and bugfix for non-functional details with seperated commits: - fix the omission that stop use `Rayon` in single-thread mode - add trace for incremental box tree construction - fix the bug that failed to skip reflow entirely when there is no need for `restyle` and a fragment tree has already been built. - add trace for stylist preparation during reflow. In certain scenarios, this phase might take up a significant amount of time, such as when there are a large number of shadow trees. Testing: This should not change observable behavior and is thus covered by existing WPT tests. --------- Signed-off-by: sharpshooter_pt <ibluegalaxy_taoj@163.com>
This commit is contained in:
parent
19a121e829
commit
8a1cc69717
3 changed files with 8 additions and 2 deletions
|
@ -1179,7 +1179,11 @@ fn do_initial_flex_line_layout<'items>(
|
|||
// We didn't reach the end of the last line, so add all remaining items there.
|
||||
lines.push((items, line_size_so_far));
|
||||
|
||||
lines.par_drain(..).map(construct_line).collect()
|
||||
if flex_context.layout_context.use_rayon {
|
||||
lines.par_drain(..).map(construct_line).collect()
|
||||
} else {
|
||||
lines.drain(..).map(construct_line).collect()
|
||||
}
|
||||
}
|
||||
|
||||
/// The result of splitting the flex items into lines using their intrinsic sizes and doing an
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue