RESOLVED FIXED 228283
Fix aspect-ratio-intrinsic-size-004.html
https://bugs.webkit.org/show_bug.cgi?id=228283
Summary Fix aspect-ratio-intrinsic-size-004.html
Rob Buis
Reported 2021-07-26 09:34:18 PDT
Fix aspect-ratio-intrinsic-size-00?.html.
Attachments
Patch (4.77 KB, patch)
2021-07-26 09:36 PDT, Rob Buis
no flags
Patch (2.53 KB, patch)
2021-07-27 00:47 PDT, Rob Buis
no flags
Patch (5.41 KB, patch)
2021-07-27 04:29 PDT, Rob Buis
no flags
Patch (5.33 KB, patch)
2021-07-27 04:32 PDT, Rob Buis
ews-feeder: commit-queue-
Patch (5.34 KB, patch)
2021-07-27 04:48 PDT, Rob Buis
no flags
Patch (5.27 KB, patch)
2021-08-14 13:56 PDT, Rob Buis
no flags
Patch (3.39 KB, patch)
2021-08-14 22:52 PDT, Rob Buis
no flags
Patch (4.39 KB, patch)
2021-08-27 02:19 PDT, Rob Buis
no flags
Patch (4.46 KB, patch)
2021-08-27 03:57 PDT, Rob Buis
no flags
Patch (5.38 KB, patch)
2021-08-27 05:15 PDT, Rob Buis
no flags
Patch (6.17 KB, patch)
2021-08-27 09:21 PDT, Rob Buis
no flags
Patch (5.51 KB, patch)
2021-08-30 00:40 PDT, Rob Buis
no flags
Patch (3.96 KB, patch)
2021-08-31 03:12 PDT, Rob Buis
ews-feeder: commit-queue-
Patch (3.70 KB, patch)
2021-08-31 05:56 PDT, Rob Buis
no flags
Patch (3.67 KB, patch)
2021-09-01 02:28 PDT, Rob Buis
no flags
Patch (2.29 KB, patch)
2021-09-02 04:42 PDT, Rob Buis
no flags
Patch (6.18 KB, patch)
2021-09-02 10:25 PDT, Rob Buis
no flags
Patch (2.83 KB, patch)
2021-09-03 12:37 PDT, Rob Buis
no flags
Patch (2.04 KB, patch)
2021-09-07 02:38 PDT, Rob Buis
no flags
Patch (3.67 KB, patch)
2021-09-07 02:41 PDT, Rob Buis
no flags
Patch (4.09 KB, patch)
2021-09-07 03:27 PDT, Rob Buis
no flags
Patch (4.57 KB, patch)
2021-09-07 05:44 PDT, Rob Buis
no flags
Patch (3.34 KB, patch)
2021-09-10 00:49 PDT, Rob Buis
no flags
Rob Buis
Comment 1 2021-07-26 09:36:07 PDT
Rob Buis
Comment 2 2021-07-26 09:38:14 PDT
Rough fix for now, I hope this bug could also fix aspect-ratio-intrinsic-size-005.html.
Rob Buis
Comment 3 2021-07-27 00:47:58 PDT
Rob Buis
Comment 4 2021-07-27 04:29:22 PDT
Rob Buis
Comment 5 2021-07-27 04:32:47 PDT
Rob Buis
Comment 6 2021-07-27 04:48:41 PDT
Radar WebKit Bug Importer
Comment 7 2021-08-02 09:35:17 PDT
Rob Buis
Comment 8 2021-08-14 13:56:45 PDT
Rob Buis
Comment 9 2021-08-14 22:52:18 PDT
Rob Buis
Comment 10 2021-08-27 02:19:19 PDT
Rob Buis
Comment 11 2021-08-27 03:57:42 PDT
Rob Buis
Comment 12 2021-08-27 05:15:17 PDT
EWS Watchlist
Comment 13 2021-08-27 05:16:10 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Rob Buis
Comment 14 2021-08-27 09:21:25 PDT
Rob Buis
Comment 15 2021-08-30 00:40:20 PDT
Sergio Villar Senin
Comment 16 2021-08-30 01:14:12 PDT
Comment on attachment 436759 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=436759&action=review I've serious doubts about two call sites added by this patch and thus the r-. > Source/WebCore/rendering/RenderFlexibleBox.cpp:353 > + dirtyForLayoutFromPercentageHeightDescendants(); This looks pretty interesting indeed. I haven't realized before that it's only called from RenderBlockFlow and thus never for flexboxes. I wonder whether we should call it from RenderFlexibleBox::layoutAndPlaceChildren() to kind of mimic the location where it's called in RenderBlockFlow... > Source/WebCore/rendering/RenderFlexibleBox.cpp:966 > + return percentageLogicalHeightIsResolvable(); Hmm I am not sure we could call percentageLogicalHeightIsResolvable() here. This method could start the following sequence: percentageLogicalHeightIsResolvable()->computePercentageLogicalHeight()->availableLogicalHeightForPercentageComputation()->useChildOverridingLogicalHeightForPercentageResolution()->useChildOverridingMainSizeForPercentageResolution()->canComputePercentageFlexBasis()->computePercentageLogicalHeight()->availableLogicalHeightForPercentageComputation() ... entering a loop of calls. Do you have a test for this case? > Source/WebCore/rendering/RenderFlexibleBox.cpp:1056 > + addPercentHeightDescendant(*child); Doesn't look 100% correct. A content dependent size (like min-content, max-content etc...) isn't also definite but it isn't a percentage. Also it shouldn't be really called from RenderFlexibleBox, looks something we're missing in RenderBox to handle the case of items with aspect ratio.
Rob Buis
Comment 17 2021-08-31 03:12:38 PDT
Rob Buis
Comment 18 2021-08-31 05:56:21 PDT
Rob Buis
Comment 19 2021-09-01 02:28:52 PDT
Rob Buis
Comment 20 2021-09-02 04:42:43 PDT
Rob Buis
Comment 21 2021-09-02 10:25:28 PDT
Rob Buis
Comment 22 2021-09-03 12:37:02 PDT
Rob Buis
Comment 23 2021-09-07 02:38:42 PDT
Rob Buis
Comment 24 2021-09-07 02:41:04 PDT
Rob Buis
Comment 25 2021-09-07 03:27:07 PDT
Rob Buis
Comment 26 2021-09-07 05:44:00 PDT
Sergio Villar Senin
Comment 27 2021-09-09 02:31:47 PDT
Comment on attachment 437492 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=437492&action=review We're getting there, thanks for your patience providing alternatives :) > Source/WebCore/rendering/RenderFlexibleBox.cpp:1789 > + I'd better not use this name as is too similar to RenderBlock's needsPreferredWidthsRecalculation(). I'd go for a more specific name like childHasAspectRatioAndStretchedLogicalHeight() or the like. However this method is so specific and used just once that I think we can get rid of it (or at the most convert it into a lambda in the place you use it) > Source/WebCore/rendering/RenderFlexibleBox.cpp:1874 > + child.setPreferredLogicalWidthsDirty(true, MarkOnlyThis); The setPreferredLogicalWidthsDirty() is done by updateBlockChildDirtyBitsBeforeLayout(), you just need to set forceChildRelayout to true as in the block above for percentage children. So something like this: if (!forceChildRelayout && (childHasPercentHeightDescendants(child) || (child.style().hasAspectRatio() && child.hasStretchedLogicalHeight()))) { [...] forceChildRelayout = true; } should do the job.
Rob Buis
Comment 28 2021-09-10 00:49:47 PDT
Sergio Villar Senin
Comment 29 2021-09-10 04:30:02 PDT
Comment on attachment 437849 [details] Patch Awesome thanks!
EWS
Comment 30 2021-09-10 05:23:23 PDT
Committed r282264 (241542@main): <https://commits.webkit.org/241542@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 437849 [details].
Note You need to log in before you can comment on or make changes to this bug.