mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
LibWeb: Move input size attr width from css to create_layout_node
This commit is contained in:
committed by
Sam Atkins
parent
749dcac196
commit
7e76358a99
Notes:
sideshowbarker
2024-07-17 09:41:18 +09:00
Author: https://github.com/bplaat Commit: https://github.com/SerenityOS/serenity/commit/7e76358a99 Pull-request: https://github.com/SerenityOS/serenity/pull/23506 Issue: https://github.com/SerenityOS/serenity/issues/23215 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -12,6 +12,7 @@
|
||||
#include <LibJS/Runtime/NativeFunction.h>
|
||||
#include <LibWeb/CSS/StyleValues/DisplayStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/LengthStyleValue.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/ElementFactory.h>
|
||||
#include <LibWeb/DOM/Event.h>
|
||||
@@ -101,6 +102,11 @@ JS::GCPtr<Layout::Node> HTMLInputElement::create_layout_node(NonnullRefPtr<CSS::
|
||||
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)));
|
||||
|
||||
if (type_state() != TypeAttributeState::FileUpload) {
|
||||
if (style->property(CSS::PropertyID::Width)->has_auto())
|
||||
style->set_property(CSS::PropertyID::Width, CSS::LengthStyleValue::create(CSS::Length(size(), CSS::Length::Type::Ch)));
|
||||
}
|
||||
|
||||
return Element::create_layout_node_for_display_type(document(), style->display(), style, this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user