mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 02:09:24 +00:00
LibWeb: Compute pseudo-element style when computing element style
Previously, pseudo-elements had their style computed while the layout tree was being built. Instead, do so inside Element::recompute_style(), using the same invalidation mechanism that the element itself uses. This also has the effect of invalidating the layout much less often.
This commit is contained in:
parent
d58c1c1176
commit
3abd3ef5e2
Notes:
github-actions[bot]
2024-07-31 10:16:35 +00:00
Author: https://github.com/AtkinsSJ
Commit: 3abd3ef5e2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/908
3 changed files with 54 additions and 28 deletions
|
@ -191,9 +191,8 @@ void TreeBuilder::insert_node_into_inline_or_block_ancestor(Layout::Node& node,
|
|||
void TreeBuilder::create_pseudo_element_if_needed(DOM::Element& element, CSS::Selector::PseudoElement::Type pseudo_element, AppendOrPrepend mode)
|
||||
{
|
||||
auto& document = element.document();
|
||||
auto& style_computer = document.style_computer();
|
||||
|
||||
auto pseudo_element_style = style_computer.compute_pseudo_element_style_if_needed(element, pseudo_element);
|
||||
auto pseudo_element_style = element.pseudo_element_computed_css_values(pseudo_element);
|
||||
if (!pseudo_element_style)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue