mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +00:00
LibWeb: Make style containment influence quotes
This commit is contained in:
parent
6a4d80b9b6
commit
402d8220dd
Notes:
github-actions[bot]
2025-02-06 17:45:51 +00:00
Author: https://github.com/Psychpsyo
Commit: 402d8220dd
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3480
Reviewed-by: https://github.com/AtkinsSJ ✅
19 changed files with 380 additions and 0 deletions
|
@ -573,6 +573,8 @@ void TreeBuilder::update_layout_tree(DOM::Node& dom_node, TreeBuilder::Context&
|
|||
return false;
|
||||
}();
|
||||
|
||||
auto prior_quote_nesting_level = m_quote_nesting_level;
|
||||
|
||||
if (should_create_layout_node)
|
||||
update_layout_tree_before_children(dom_node, *layout_node, context, element_has_content_visibility_hidden);
|
||||
|
||||
|
@ -617,6 +619,14 @@ void TreeBuilder::update_layout_tree(DOM::Node& dom_node, TreeBuilder::Context&
|
|||
restructure_block_node_in_inline_parent(static_cast<NodeWithStyleAndBoxModelMetrics&>(*layout_node));
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/css-contain-2/#containment-style
|
||||
// Giving an element style containment has the following effects:
|
||||
// 2. The effects of the 'content' property’s 'open-quote', 'close-quote', 'no-open-quote' and 'no-close-quote' must
|
||||
// be scoped to the element’s sub-tree.
|
||||
if (dom_node.is_element() && (static_cast<DOM::Element&>(dom_node)).has_style_containment()) {
|
||||
m_quote_nesting_level = prior_quote_nesting_level;
|
||||
}
|
||||
|
||||
dom_node.set_needs_layout_tree_update(false);
|
||||
dom_node.set_child_needs_layout_tree_update(false);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue