| Summary: | Element with aspect-ratio, padding and height: 100% grow in size when repainted | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Gordon <gordonclark127> | ||||||||||||||
| Component: | Layout and Rendering | Assignee: | Rob Buis <rbuis> | ||||||||||||||
| Status: | RESOLVED FIXED | ||||||||||||||||
| Severity: | Minor | CC: | ap, bfulgham, changseok, clopez, darin, esprehn+autocc, ews-watchlist, glenn, kondapallykalyan, pdr, rbuis, simon.fraser, webkit-bug-importer, webkit-layout-noreply, youennf, zalan | ||||||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||||||
| Version: | Safari 15 | ||||||||||||||||
| Hardware: | Mac (Intel) | ||||||||||||||||
| OS: | macOS 12 | ||||||||||||||||
| Attachments: |
|
||||||||||||||||
|
Description
Gordon
2022-06-27 23:54:50 PDT
In case anybody else is looking, this seems specific to grid, I tried display:flex and display:block for example and the issue is not there. Created attachment 460712 [details]
Patch
Created attachment 461040 [details]
Patch
Created attachment 461041 [details]
Patch
Created attachment 461135 [details]
Patch
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 Comment on attachment 461135 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=461135&action=review > COMMIT_MESSAGE:1 > +Element with aspect-ratio, padding and height: 100% grow in size when repainted "when repainted" seems wrong. This is per layout, right? Created attachment 461147 [details]
Patch
Comment on attachment 461135 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=461135&action=review >> COMMIT_MESSAGE:1 >> +Element with aspect-ratio, padding and height: 100% grow in size when repainted > > "when repainted" seems wrong. This is per layout, right? Right, layout is wrong so as a consequence the (re)paint problem is visible. I stuck to the original bug title since I had a hard time making a terse first line, but I did another attempt. Comment on attachment 461147 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=461147&action=review > Source/WebCore/rendering/RenderBox.cpp:5489 > + if (style().logicalWidth().isPercentOrCalculated() && parent()->style().logicalWidth().isFixed()) Wait, the rest of this function does not dereference parent(). Is this guaranteed to be non-null? (In reply to Darin Adler from comment #11) > Comment on attachment 461147 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=461147&action=review > > > Source/WebCore/rendering/RenderBox.cpp:5489 > > + if (style().logicalWidth().isPercentOrCalculated() && parent()->style().logicalWidth().isFixed()) > > Wait, the rest of this function does not dereference parent(). Is this > guaranteed to be non-null? Also in block layout, the canonical way to get to "parent" is by calling containingBlock() (i.e parent in the renderer tree is not necessarily the "parent" in CSS terms.) It's rarely the case when you specifically want "tree parent" and not containing block in block layout (the confusion comes from the fact that containing block translates to "tree parent" in most cases, so it's easy to just call parent() instead of containingBlock()). Committed 252819@main (39aa8ef8099b): <https://commits.webkit.org/252819@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 461147 [details]. Comment on attachment 461147 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=461147&action=review >>> Source/WebCore/rendering/RenderBox.cpp:5489 >>> + if (style().logicalWidth().isPercentOrCalculated() && parent()->style().logicalWidth().isFixed()) >> >> Wait, the rest of this function does not dereference parent(). Is this guaranteed to be non-null? > > Also in block layout, the canonical way to get to "parent" is by calling containingBlock() (i.e parent in the renderer tree is not necessarily the "parent" in CSS terms.) It's rarely the case when you specifically want "tree parent" and not containing block in block layout (the confusion comes from the fact that containing block translates to "tree parent" in most cases, so it's easy to just call parent() instead of containingBlock()). In this case I rely on isGridItem, which established parent() exists and is a RenderGrid. That is the container I want to test the percentage against and see if the percentage turns out to be definite. |