Skip to content

Truly independent web browser

LibWeb: Drop the guards against reads nested inside a layout pass

Aliaksandr Kalenikdf86933beb80
diff --git a/Libraries/LibWeb/Layout/Node.cpp b/Libraries/LibWeb/Layout/Node.cpp
index 1e30126850e..26d174ea781 100644
--- a/Libraries/LibWeb/Layout/Node.cpp
+++ b/Libraries/LibWeb/Layout/Node.cpp
@@ -523,7 +523,6 @@ bool Node::is_fragmented_inline() const
void NodeWithStyle::set_computed_values(Layout::BegunRead const& read, NonnullRefPtr<CSS::ComputedValues const> computed_values)
{
- VERIFY(!RustFFI::render_state_layout_pass_is_running(document_host()));
CSS::StyleRecordID record;
if (is_generated_for_pseudo_element())
record = document().style_computer().intern_computed_style_inputs(read, { *pseudo_element_generator(), generated_for_pseudo_element() }, *computed_values);
diff --git a/Libraries/LibWeb/Rust/src/layout/layout_node_arena.rs b/Libraries/LibWeb/Rust/src/layout/layout_node_arena.rs
index 2cc53f2b224..0a5b8cd2381 100644
--- a/Libraries/LibWeb/Rust/src/layout/layout_node_arena.rs
+++ b/Libraries/LibWeb/Rust/src/layout/layout_node_arena.rs
@@ -6262,11 +6262,6 @@ pub unsafe extern "C" fn document_host_set_style_record_host_callbacks(
.set(Some((callbacks.context, callbacks.shell_style_changed)));
}
-#[unsafe(no_mangle)]
-pub extern "C" fn render_state_layout_pass_is_running(host: &DocumentHost) -> bool {
- read_arena(host, node_read(), (), |arena, ()| arena.layout_pass_is_running())
-}
-
#[unsafe(no_mangle)]
pub extern "C" fn render_state_needs_full_layout_tree_update(
host: &DocumentHost,
@@ -6327,12 +6322,8 @@ pub extern "C" fn render_state_layout_is_known_stale(host: &DocumentHost, docume
}
/// Refreshes the text content and replaced-content facts of every node enrolled since the last
-/// sync, ahead of a pass that caches them. A pass already on the stack owns those caches, so a
-/// request nested inside one is a no-op.
+/// sync, ahead of a pass that caches them.
pub(crate) fn sync_enrolled_content_for_layout(arena: &mut LayoutNodeArena) {
- if arena.layout_pass_is_running() {
- return;
- }
for node in arena.pending_text_nodes_for_content_sync() {
// Detached nodes retain enrollment until a parent supplies their style.
if !arena.slot_is_live(node) || arena.data(node).parent.get().is_invalid() {
diff --git a/Libraries/LibWeb/Rust/src/layout/row_reads.rs b/Libraries/LibWeb/Rust/src/layout/row_reads.rs
index 4fe1b30d80d..c83aed5b1ed 100644
--- a/Libraries/LibWeb/Rust/src/layout/row_reads.rs
+++ b/Libraries/LibWeb/Rust/src/layout/row_reads.rs
@@ -248,10 +248,9 @@ impl RowIdentities {
impl LayoutNodeArena {
/// The rows as they are now, for the host to read, once every row's scrollable overflow is measured where
- /// `measure_overflow` says so. A host callback a layout pass makes reads the rows as the pass has left them so far,
- /// and measures nothing: the pass is not done with the geometry overflow is measured from.
+ /// `measure_overflow` says so.
pub(crate) fn publish_row_snapshot(&mut self, measure_overflow: bool) -> RowSnapshot {
- if measure_overflow && !self.layout_pass_is_running() {
+ if measure_overflow {
self.measure_scrollable_overflow();
}
let paintable = self.publish_rows();