Skip to content

Truly independent web browser

LibWeb: Stop preparing inline content ahead of laying out children

Aliaksandr Kalenikabd151ab5d7a
diff --git a/Libraries/LibWeb/Rust/src/layout/block_formatting_context.rs b/Libraries/LibWeb/Rust/src/layout/block_formatting_context.rs
index f264a7af66b..648e01e53d6 100644
--- a/Libraries/LibWeb/Rust/src/layout/block_formatting_context.rs
+++ b/Libraries/LibWeb/Rust/src/layout/block_formatting_context.rs
@@ -4674,29 +4674,6 @@ impl<'pass> BlockFormattingContext<'pass> {
.store(node.slot_index(), entry, committed_identity);
}
- fn prepare_inline_content_of_children_ahead(&self, block_container: Node) {
- let callbacks = self.run.callbacks;
- if callbacks.lays_out_with_position_option() {
- return;
- }
- let memos = callbacks.prepared_inline_content_memos();
- let children = parallel_layout::fork_candidates(&callbacks, callbacks.children(block_container), |child| child)
- .into_iter()
- .filter(|&child| {
- let facts = self.facts(child);
- facts.is_block_container()
- && facts.children_are_inline()
- && !facts.is_floating()
- && !facts.is_absolutely_positioned()
- && formatting_context::formatting_context_type_created_by_box(facts).is_none()
- && memos
- .kept(child, fc_run_cache::run_root_validity(&callbacks, child))
- .is_none()
- })
- .collect();
- parallel_layout::prepare_inline_content_ahead(&callbacks, children);
- }
-
/// Whether a float placed so far reaches below `block_offset` in `block_container`.
fn float_reaches_below(
&self,
@@ -5060,9 +5037,6 @@ impl<'pass> BlockFormattingContext<'pass> {
if block_container.node == self.run.box_ {
self.root_flow_children.borrow_mut().clear();
}
- if fragmentainer.is_none() {
- self.prepare_inline_content_of_children_ahead(block_container.node);
- }
let mut lays_out_children_ahead = fragmentainer.is_none();
let mut summary = ChildrenSummary::default();
for child in self
diff --git a/Libraries/LibWeb/Rust/src/layout/parallel_layout.rs b/Libraries/LibWeb/Rust/src/layout/parallel_layout.rs
index c3351dafb2e..8e0f0b3b728 100644
--- a/Libraries/LibWeb/Rust/src/layout/parallel_layout.rs
+++ b/Libraries/LibWeb/Rust/src/layout/parallel_layout.rs
@@ -104,17 +104,6 @@ pub(crate) fn lay_out_shapes_ahead(pass: &LayoutPass<'_>, shapes: Vec<formatting
);
}
-pub(crate) fn prepare_inline_content_ahead(pass: &LayoutPass<'_>, block_containers: Vec<Node>) {
- let _ = lay_out_in_parallel(
- pass,
- block_containers,
- |&block_container| block_container,
- |callbacks, block_container| {
- prepared_inline_content::PreparedInlineContent::for_block_container(callbacks, block_container);
- },
- );
-}
-
pub(crate) struct ForkedTask<R> {
pub(crate) result: R,
pub(crate) host_findings: run_state::HostFindings,