| Summary: | display: flex element not ignore font (content) like as other browser engines. | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Józsa Márton <morfyum> | ||||||||
| Component: | Layout and Rendering | Assignee: | zalan <zalan> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Normal | CC: | bfulgham, changseok, esprehn+autocc, ews-watchlist, glenn, karlcow, koivisto, kondapallykalyan, pdr, simon.fraser, webkit-bug-importer, wenson_hsieh, zalan | ||||||||
| Priority: | P2 | Keywords: | BrowserCompat, HTML5, InRadar | ||||||||
| Version: | Safari 16 | ||||||||||
| Hardware: | All | ||||||||||
| OS: | All | ||||||||||
| URL: | https://morfyum.github.io/maincss/ | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Józsa Márton
2023-03-28 09:15:42 PDT
Created attachment 465651 [details]
Test reduction
interestingly we recover when forcing in-flow on the flex item.
document.body.offsetHeight;
show_this.classList.toggle("show");
document.body.offsetHeight;
show_this.style.position = "static";
document.body.offsetHeight;
show_this.style.position = "absolute";
We construct the following tree structure for the flexbox:
B-------- -- DIV RenderFlexibleBox at (0,0) size 1185x20
B---YG--- -- RenderBlock at (0,0) size 21.61x20
I-------- -- #text RenderText ("PASS if no")
BA----L-- -- DIV RenderBlock at (8,22) size 21.61x14
I-------- -- #text RenderText ("gap.")
(note that the incorrectly positioned out-of-flow box is nested inside the anon flex item)
When the incorrectly positioned out-of-flow box starts as:
position: absolute;
(or use the "recover case" above at comment #3)
we've got the following tree structure for the flexbox:
B-------- -- DIV RenderFlexibleBox at (0,0) size 1185x20
B-------- -- DIV RenderBlock at (0,0) size 21.61x20
I-------- -- #text RenderText ("PASS if no")
BA----L-- -- DIV RenderBlock at (8,8) size 21.61x14
I-------- -- #text RenderText ("gap.")
(note that now the out-of-flow box is a sibling to the flex item)
We also seem to produce the same structure when the text content ("Pass if...") is nested inside a block container (<div>PASS if no</div>)
It looks like the incorrect rendering is actually caused by this incorrect tree structure.
Created attachment 465679 [details]
Patch
Committed 262341@main (3906ca99d0cf): <https://commits.webkit.org/262341@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 465679 [details]. Created attachment 465682 [details]
Screenshot with the fix
Thank you for filing this issue. It is fixed now on trunk (I am a bit puzzled by what "Árvíztűrő tükörfúrógép" is :). |