LibWeb: Move textarea cols rows attr size from css to create_layout_node
This commit is contained in:
parent
7e76358a99
commit
110e74b9c1
Notes:
sideshowbarker
2024-07-17 07:35:03 +09:00
Author: https://github.com/bplaat Commit: https://github.com/SerenityOS/serenity/commit/110e74b9c1 Pull-request: https://github.com/SerenityOS/serenity/pull/23506 Issue: https://github.com/SerenityOS/serenity/issues/23215 Reviewed-by: https://github.com/AtkinsSJ ✅
2 changed files with 6 additions and 2 deletions
Userland/Libraries/LibWeb
|
@ -38,8 +38,6 @@ textarea {
|
|||
display: inline-block;
|
||||
overflow: auto;
|
||||
font-family: monospace;
|
||||
width: attr(cols ch, 20ch);
|
||||
height: attr(rows lh, 2lh);
|
||||
}
|
||||
|
||||
input::placeholder, textarea::placeholder {
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/CSS/StyleProperties.h>
|
||||
#include <LibWeb/CSS/StyleValues/DisplayStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/LengthStyleValue.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/ElementFactory.h>
|
||||
#include <LibWeb/DOM/Event.h>
|
||||
|
@ -37,6 +38,11 @@ JS::GCPtr<Layout::Node> HTMLTextAreaElement::create_layout_node(NonnullRefPtr<CS
|
|||
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 (style->property(CSS::PropertyID::Width)->has_auto())
|
||||
style->set_property(CSS::PropertyID::Width, CSS::LengthStyleValue::create(CSS::Length(cols(), CSS::Length::Type::Ch)));
|
||||
if (style->property(CSS::PropertyID::Height)->has_auto())
|
||||
style->set_property(CSS::PropertyID::Height, CSS::LengthStyleValue::create(CSS::Length(rows(), CSS::Length::Type::Lh)));
|
||||
|
||||
return Element::create_layout_node_for_display_type(document(), style->display(), style, this);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue