mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-19 02:10:26 +00:00
LibWeb: Implement auto_content_box_size for textarea and input
This allows default and attribute-based sizing when an axis is auto, without overriding extrinsic sizing.
This commit is contained in:
parent
7c819460ce
commit
d3cdeb3ac5
Notes:
github-actions[bot]
2026-02-06 10:41:00 +00:00
Author: https://github.com/jonbgamble
Commit: d3cdeb3ac5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7028
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/circl-lastname
Reviewed-by: https://github.com/shannonbooth
29 changed files with 386 additions and 102 deletions
|
|
@ -48,6 +48,7 @@
|
|||
#include <LibWeb/Layout/CheckBox.h>
|
||||
#include <LibWeb/Layout/ImageBox.h>
|
||||
#include <LibWeb/Layout/RadioButton.h>
|
||||
#include <LibWeb/Layout/TextInputBox.h>
|
||||
#include <LibWeb/MimeSniff/MimeType.h>
|
||||
#include <LibWeb/MimeSniff/Resource.h>
|
||||
#include <LibWeb/Namespace.h>
|
||||
|
|
@ -136,16 +137,28 @@ GC::Ptr<Layout::Node> HTMLInputElement::create_layout_node(GC::Ref<CSS::Computed
|
|||
return Element::create_layout_node_for_display_type(document(), style->display(), style, this);
|
||||
}
|
||||
|
||||
if (type_state() == TypeAttributeState::SubmitButton || type_state() == TypeAttributeState::Button || type_state() == TypeAttributeState::ResetButton)
|
||||
switch (type_state()) {
|
||||
|
||||
case TypeAttributeState::SubmitButton:
|
||||
case TypeAttributeState::Button:
|
||||
case TypeAttributeState::ResetButton:
|
||||
return heap().allocate<Layout::BlockContainer>(document(), this, move(style));
|
||||
|
||||
if (type_state() == TypeAttributeState::Checkbox)
|
||||
case TypeAttributeState::Checkbox:
|
||||
return heap().allocate<Layout::CheckBox>(document(), *this, move(style));
|
||||
|
||||
if (type_state() == TypeAttributeState::RadioButton)
|
||||
case TypeAttributeState::RadioButton:
|
||||
return heap().allocate<Layout::RadioButton>(document(), *this, move(style));
|
||||
|
||||
return Element::create_layout_node_for_display_type(document(), style->display(), style, this);
|
||||
case TypeAttributeState::Text:
|
||||
case TypeAttributeState::Search:
|
||||
case TypeAttributeState::URL:
|
||||
case TypeAttributeState::Telephone:
|
||||
case TypeAttributeState::Email:
|
||||
case TypeAttributeState::Password:
|
||||
case TypeAttributeState::Number:
|
||||
// FIXME: text padding issues
|
||||
return heap().allocate<Layout::TextInputBox>(document(), *this, move(style));
|
||||
default:
|
||||
return Element::create_layout_node_for_display_type(document(), style->display(), style, this);
|
||||
}
|
||||
}
|
||||
|
||||
void HTMLInputElement::adjust_computed_style(CSS::ComputedProperties& style)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue