-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LibWeb: Specify input box width when parent does not #24490
base: master
Are you sure you want to change the base?
Conversation
Hello! One or more of the commit messages in this PR do not match the SerenityOS code submission policy, please check the |
6cd2552
to
1771116
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes are spread across three separate commits even though they're just iterating on the same places again and again. I think it would be better to just squash them all into one commit that gets to the end state immediately. :)
StringBuilder builder; | ||
builder.append(dom_node()->class_name()); | ||
if (MUST(builder.to_string()) == "HTMLInputElement") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be:
if (dom_node()->is_html_input_element()) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did something similar elsewhere, but it took the form if (foo.dom_node() && foo.dom_node()->is_html_input_element())
. Is this okay?
1771116
to
5bf19aa
Compare
5bf19aa
to
e5ccc7b
Compare
@awesomekling I performed the changes as you requested. There's still the issue with input box height: It appears as though using natural_height doesn't account for borders/padding. Any recommendations? |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! |
Text input boxes inside a parent with no defined width, such as the following, appear too short in Ladybird.
See #23915, which this fixes.
The fix was two parts: remove some hacky code from
HTMLInputElement::adjust_computed_style()
that set the width of any input box container with <... width:auto> and instead useset_natural_width()
andset_natural_height()
in the Layout::BlockContainer constructor.NOTES/Pending issues
1lh
, some text boxes (such as the one on the ladybird home screen) are now too short. I believe natural width and height might ignore padding/margins/borders, but I'm not sure.