mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-29 15:58:47 +00:00
LibWeb: Add element adjust_computed_style and move set_property() to it
This commit is contained in:
parent
928287b782
commit
69e4f924b7
Notes:
sideshowbarker
2024-07-17 08:34:29 +09:00
Author: https://github.com/bplaat
Commit: 69e4f924b7
Pull-request: https://github.com/SerenityOS/serenity/pull/23512
9 changed files with 30 additions and 23 deletions
|
@ -48,14 +48,12 @@ void HTMLSelectElement::visit_edges(Cell::Visitor& visitor)
|
|||
visitor.visit(m_chevron_icon_element);
|
||||
}
|
||||
|
||||
JS::GCPtr<Layout::Node> HTMLSelectElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
||||
void HTMLSelectElement::adjust_computed_style(CSS::StyleProperties& style)
|
||||
{
|
||||
// AD-HOC: We rewrite `display: inline` to `display: inline-block`.
|
||||
// This is required for the internal shadow tree to work correctly in layout.
|
||||
if (style->display().is_inline_outside() && style->display().is_flow_inside())
|
||||
style->set_property(CSS::PropertyID::Display, CSS::DisplayStyleValue::create(CSS::Display::from_short(CSS::Display::Short::InlineBlock)));
|
||||
|
||||
return Element::create_layout_node_for_display_type(document(), style->display(), style, this);
|
||||
if (style.display().is_inline_outside() && style.display().is_flow_inside())
|
||||
style.set_property(CSS::PropertyID::Display, CSS::DisplayStyleValue::create(CSS::Display::from_short(CSS::Display::Short::InlineBlock)));
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-elements.html#dom-select-options
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue