mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibWeb/Layout: Only apply ::before/::after creation rules to them
This commit is contained in:
parent
c1d4323cf7
commit
9c656dd7d1
Notes:
github-actions[bot]
2025-06-19 11:36:51 +00:00
Author: https://github.com/AtkinsSJ
Commit: 9c656dd7d1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5132
Reviewed-by: https://github.com/tcl3
1 changed files with 4 additions and 3 deletions
|
@ -195,9 +195,10 @@ void TreeBuilder::create_pseudo_element_if_needed(DOM::Element& element, CSS::Ps
|
|||
auto pseudo_element_display = pseudo_element_style->display();
|
||||
// ::before and ::after only exist if they have content. `content: normal` computes to `none` for them.
|
||||
// We also don't create them if they are `display: none`.
|
||||
if (pseudo_element_display.is_none()
|
||||
|| pseudo_element_content.type == CSS::ContentData::Type::Normal
|
||||
|| pseudo_element_content.type == CSS::ContentData::Type::None)
|
||||
if (first_is_one_of(pseudo_element, CSS::PseudoElement::Before, CSS::PseudoElement::After)
|
||||
&& (pseudo_element_display.is_none()
|
||||
|| pseudo_element_content.type == CSS::ContentData::Type::Normal
|
||||
|| pseudo_element_content.type == CSS::ContentData::Type::None))
|
||||
return;
|
||||
|
||||
auto pseudo_element_node = DOM::Element::create_layout_node_for_display_type(document, pseudo_element_display, *pseudo_element_style, nullptr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue