mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 17:19:13 +00:00
LibWeb: Implement CSS 'contain' property
This commit is contained in:
parent
c53c781745
commit
67ed676831
Notes:
github-actions[bot]
2025-01-28 11:25:39 +00:00
Author: https://github.com/Psychpsyo
Commit: 67ed676831
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3296
Reviewed-by: https://github.com/AtkinsSJ ✅
154 changed files with 4200 additions and 117 deletions
|
@ -94,7 +94,14 @@ bool FormattingContext::creates_block_formatting_context(Box const& box)
|
|||
if (box.display().is_flow_root_inside())
|
||||
return true;
|
||||
|
||||
// FIXME: Elements with contain: layout, content, or paint.
|
||||
// https://drafts.csswg.org/css-contain-2/#containment-types
|
||||
// 1. The layout containment box establishes an independent formatting context.
|
||||
// 4. The paint containment box establishes an independent formatting context.
|
||||
if (box.dom_node() && box.dom_node()->is_element()) {
|
||||
auto element = as<DOM::Element>(box.dom_node());
|
||||
if (element->has_layout_containment() || element->has_paint_containment())
|
||||
return true;
|
||||
}
|
||||
|
||||
if (box.parent()) {
|
||||
auto parent_display = box.parent()->display();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue