mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 14:28:49 +00:00
LibWeb: Compute display: contents
as none
for unusual elements
https://drafts.csswg.org/css-display-3/#unbox-html specifies certain elements that have their `display` style computed as `none` when specified as `contents`. This fixes at least one WPT test: http://wpt.live/css/css-display/display-contents-suppression-dynamic-001.html
This commit is contained in:
parent
eef9a53eec
commit
3b1d1d4582
Notes:
github-actions[bot]
2024-11-13 10:12:00 +00:00
Author: https://github.com/mikewatt 🔰
Commit: 3b1d1d4582
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2224
31 changed files with 156 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
|||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibWeb/Bindings/HTMLVideoElementPrototype.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/CSS/StyleValues/DisplayStyleValue.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/Fetch/Fetching/Fetching.h>
|
||||
#include <LibWeb/Fetch/Infrastructure/FetchAlgorithms.h>
|
||||
|
@ -67,6 +68,13 @@ JS::GCPtr<Layout::Node> HTMLVideoElement::create_layout_node(CSS::StylePropertie
|
|||
return heap().allocate_without_realm<Layout::VideoBox>(document(), *this, move(style));
|
||||
}
|
||||
|
||||
void HTMLVideoElement::adjust_computed_style(CSS::StyleProperties& style)
|
||||
{
|
||||
// https://drafts.csswg.org/css-display-3/#unbox
|
||||
if (style.display().is_contents())
|
||||
style.set_property(CSS::PropertyID::Display, CSS::DisplayStyleValue::create(CSS::Display::from_short(CSS::Display::Short::None)));
|
||||
}
|
||||
|
||||
Layout::VideoBox* HTMLVideoElement::layout_node()
|
||||
{
|
||||
return static_cast<Layout::VideoBox*>(Node::layout_node());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue