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
Ladybird text input display issue #23915
Comments
both
input has a good next step for fixing the bug might be to find out why BFC and IFC end up assigning wrong width. |
Random guess... Does putting the parent in absolute position trigger shrink to fit layout? Then the width: 100% doesn't resolve correctly because the parent width is not set yet? So it ends up set to 0? |
I think this happens because of the following mechanism in 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)));
} For input elements with a non- In your repro above, there's no Because there is also a Note that |
One possible approach to this would be to let input elements have a natural/intrinsic layout size, derived from the |
Thank you all for the ideas! My team and I have started working on this issue and we found that moving the line
up out of the if statement fixes the specific web page in the original post. However, this obviously causes a lot of text inputs on other web pages to be formatted incorrectly. We are trying to add an if statement to the beginning of the adjust_computed_style method, something like
however, we haven't found a way to access the parent HTML element nor its stylings in the adjust_computed_style method. If that approach seems reasonable, any advice on that would be appreciated. We also looked into the idea mentioned in the post right before this ("special-casing input elements in layout width calculation."), but we haven't found where exactly the layout width calculator presently takes place, so if that approach is preferred we'd appreciate any direction on where to look for that. Thank you again for your help! |
This is definitely a non-trivial issue, perhaps not suitable for newcomers to the codebase. Width calculation is not performed in a single location in layout, there are many different places and ways we determine widths, depending on a number of circumstances (which formatting context is used, the type of box being sized, etc) One way that might work is to piggyback on replaced element layout by making This specific behavior makes sense for text-based |
Thanks @awesomekling, we'll try that. It seems to make sense, input elements usually are rendered as replaced content with natural width and height on other OSes. Buttons and images are too but agreed that it's less clear exactly how big those should be. |
Hello, I'm a University of Utah student working on Ladybird as part of my final project for CS 4560 Web Browser Internals. While using the browser, I found a bug in how it displays a search bar of certain web pages, specifically the length of the search bar (pictured below are how Chrome displays the search bar and how Ladybird displays the same search bar)
Chrome:
Ladybird:
I minimized the bug down to this simple html and css. Screenshots of how Chrome and Ladybird render this webpage are below
Chrome:
Ladybird:
I am interested in taking a stab at resolving this issue. I am not super familiar with the code yet, but I’d appreciate any pointers on how to proceed if anyone has ideas, thanks!
The text was updated successfully, but these errors were encountered: