mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:28:12 +00:00
LibWeb: Move textarea cols rows attr size from css to create_layout_node
This commit is contained in:
parent
7e76358a99
commit
110e74b9c1
2 changed files with 6 additions and 2 deletions
|
@ -38,8 +38,6 @@ textarea {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
width: attr(cols ch, 20ch);
|
|
||||||
height: attr(rows lh, 2lh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
input::placeholder, textarea::placeholder {
|
input::placeholder, textarea::placeholder {
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include <LibWeb/Bindings/Intrinsics.h>
|
#include <LibWeb/Bindings/Intrinsics.h>
|
||||||
#include <LibWeb/CSS/StyleProperties.h>
|
#include <LibWeb/CSS/StyleProperties.h>
|
||||||
#include <LibWeb/CSS/StyleValues/DisplayStyleValue.h>
|
#include <LibWeb/CSS/StyleValues/DisplayStyleValue.h>
|
||||||
|
#include <LibWeb/CSS/StyleValues/LengthStyleValue.h>
|
||||||
#include <LibWeb/DOM/Document.h>
|
#include <LibWeb/DOM/Document.h>
|
||||||
#include <LibWeb/DOM/ElementFactory.h>
|
#include <LibWeb/DOM/ElementFactory.h>
|
||||||
#include <LibWeb/DOM/Event.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())
|
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)));
|
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);
|
return Element::create_layout_node_for_display_type(document(), style->display(), style, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue