Skip to content

Conversation

@jonbgamble
Copy link

@jonbgamble jonbgamble commented Dec 5, 2025

Instead, compute them in accessors.

Add TextAreaBox and TextInputBox to Layout so that textarea and text inputs can be stretched when auto.

Fix #634, fix #6040, fix #7070, and possibly related issues involving baseline, cross axis sizing, aspect ratio, canvas, size containment, and textarea

@ladybird-bot
Copy link
Collaborator

Hello!

One or more of the commit messages in this PR do not match the Ladybird code submission policy, please check the lint_commits CI job for more details on which commits were flagged and why.
Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.

@jonbgamble jonbgamble changed the title LibWeb: dont inject replaced sizes from Layout::X constructors LibWeb: dont inject replaced sizes from Layout constructors Dec 5, 2025
@jonbgamble jonbgamble force-pushed the libweb-lazy-replaced-sizing branch 2 times, most recently from 720f705 to 84abc88 Compare December 5, 2025 05:01
@jonbgamble jonbgamble changed the title LibWeb: dont inject replaced sizes from Layout constructors LibWeb: dont inject Layout sizes from constructors or prepare methods Dec 5, 2025
@jonbgamble jonbgamble changed the title LibWeb: dont inject Layout sizes from constructors or prepare methods LibWeb: dont inject natural sizes from prepare_for_replaced_layout Dec 5, 2025
@jonbgamble jonbgamble marked this pull request as draft December 6, 2025 17:21
@jonbgamble jonbgamble force-pushed the libweb-lazy-replaced-sizing branch 3 times, most recently from c25e0ee to f36a1fc Compare December 7, 2025 15:43
@jonbgamble jonbgamble marked this pull request as ready for review December 7, 2025 15:45
@jonbgamble jonbgamble requested a review from AtkinsSJ as a code owner December 7, 2025 17:15
@github-actions github-actions bot added the conflicts Pull request has merge conflicts that need resolution label Dec 8, 2025
@github-actions
Copy link

github-actions bot commented Dec 8, 2025

Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest master.

@jonbgamble jonbgamble force-pushed the libweb-lazy-replaced-sizing branch from 5520ff6 to 2e9c8cb Compare December 8, 2025 15:42
@github-actions github-actions bot removed the conflicts Pull request has merge conflicts that need resolution label Dec 8, 2025
@jonbgamble jonbgamble force-pushed the libweb-lazy-replaced-sizing branch 2 times, most recently from 43f93ae to 0f8b840 Compare December 9, 2025 06:13
@Gingeh
Copy link
Contributor

Gingeh commented Dec 9, 2025

I can't comment on the implementation itself, but this patch fixes the page I opened #6040 for

@gmta
Copy link
Collaborator

gmta commented Dec 9, 2025

Hi! Please check our contribution guidelines, and particularly:

Split your changes into separate, atomic commits (i.e. A commit per feature or fix, where the build, tests and the system are all functioning).

Basically, whenever your commit message starts to describe more than one thing, it's very likely that we'd like to see separate commits. You should split them up to discern between non-functional changes involving code cleanup, refactors to prepare for changes, bugfixes and functional changes.

@jonbgamble jonbgamble force-pushed the libweb-lazy-replaced-sizing branch 2 times, most recently from a4be658 to 76cefaa Compare December 10, 2025 00:35
@jonbgamble jonbgamble force-pushed the libweb-lazy-replaced-sizing branch 3 times, most recently from 7b28372 to 572d31e Compare December 10, 2025 00:56
Ditch prepare_for_replaced_layout size value injection in favor of
virtual accessors that compute the same. This affects ReplacedBox
and all its subclasses.

Distinguish between:
  - Natural size - always from media sources
  - Intrinsic content box size (i.e. replaced-like) - could be natural
    size or could be calculated from attributes like size, rows, cols
Don't overwrite them with aspect ratio calculations.
The is_textarea_box() flag in Node.h is unfortunate, but it's
marginally better than an include & cast. textarea has specific
baseline handling compared to other inline-block elements.
@jonbgamble jonbgamble force-pushed the libweb-lazy-replaced-sizing branch from 572d31e to 16f5830 Compare December 10, 2025 01:00
@jonbgamble
Copy link
Author

I will say this about your commit message linter - I have had more enjoyable interactions with the rust borrow checker.

@gmta
Copy link
Collaborator

gmta commented Dec 10, 2025

@jonbgamble

I will say this about your commit message linter - I have had more enjoyable interactions with the rust borrow checker.

Did you use pre-commit locally to lint your commits before pushing?

If there's anything in particular that we should improve with the commit linter, feel free to raise an issue or submit a PR.

@jonbgamble
Copy link
Author

Did you use pre-commit locally to lint your commits before pushing?

I did not, and thanks for the heads up about it. I am just now remembering to run lint-clang-format.py

If there's anything in particular that we should improve with the commit linter, feel free to raise an issue or submit a PR.

Oh, it was just frustration from trying to force push a bunch of pseudo-historical commits carefully constructed from manual edits of git add -p hunks, only to be told "such and such commit message first line ends with a period" or "commit message isn't capital after the colon".

I'm miles away from an actionable suggestion.

@jonbgamble
Copy link
Author

I wonder if it makes sense to require Category in the PR only. The commits themselves are ostensibly be related to this owning Category, and if they diverge then the true scope of each is readily available from the paths of their changed files. It could claw back 8-12 precious characters per commit for more context that may be less redundant.

But maybe there is automated reporting going on where commit titles are readily available and files are not. I did notice the contributing.md mentions joining categories with + which sounds rather reporty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants