LibWeb: Allow style inheritance through slots
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

When a subtree is projected through a slot, its root now inherits style
from the slot's parent, rather than the parent of the unprojected root.

This fixes a ton of subtle issues, and is very noticeable on Reddit.
This commit is contained in:
Andreas Kling 2025-08-16 14:08:35 +02:00 committed by Andreas Kling
commit 9208a54b0b
Notes: github-actions[bot] 2025-08-16 19:04:51 +00:00
7 changed files with 64 additions and 34 deletions

View file

@ -40,6 +40,11 @@ GC::Ptr<Element const> AbstractElement::parent_element() const
return m_element->parent_element();
}
GC::Ptr<Element const> AbstractElement::element_to_inherit_style_from() const
{
return m_element->element_to_inherit_style_from(m_pseudo_element);
}
Optional<AbstractElement> AbstractElement::walk_layout_tree(WalkMethod walk_method)
{
GC::Ptr<Layout::Node> node = layout_node();