In a full-size window load https://tobireif.com/demos/ .
Note that the page is short.
Resize the window to be narrow, and back.
Note that the same page at the same full width as before now is much longer than before.
The issue does not occur in Chrome, Firefox, and Opera.
The related code probably is "function setCanvasSize()" -> "document.body.scrollHeight".
I hope you can ensure that it will work as in Chrome & Firefox & Opera where the reported height is the same after downsize-upsize.
(Please set the correct Component, it might be Layout instead of DOM.)
Created attachment 338118 [details]
I hope you can update this ticket as soon as <rdar://problem/39618561> got set to fixed, so that I can check the fix in the latest Safari (in addition to your tests).
Created attachment 339609 [details]
Interestingly both FF and Chrome behave the same as Safari in quirks mode.
Test reduction ->
1. resize the page until all boxes wrap
2. resize it back until all boxes are on the same line
-> check for scrolling.
Created attachment 339610 [details]
So this bug is about the value of scrollHeight during the resize handler?
> So this bug is about the value of scrollHeight during the resize handler?
Yep - when you insert "console.log(document.body.scrollHeight);" into "function setCanvasSize()", then open the page in eg Chrome, you always get ~ the same value after you downsize upsize the window. In Safari you'll get very different much larger values after downsize upsize.
document.body.scrollHeight seems incompatible between Safari and Chrome/Firefox. In Safari, it's max(view height, contents height), but in other browsers it's just contents height.
This is odd, since scrollHeight is max(box height, contents height) for an overflow scroll div.
scrollHeight on the body comes from the ScrollView contentsSize, and that is computed via RenderView::unscaledDocumentRect() which uses layoutOverflowRect(). If not overflowing, we use height and width of the RenderView (which is not the body!).
Thanks for investigating!
I hope this can get fixed
The issue still exists in Safari 12.0.1 (14606.2.104.1.1) and in Safari Technology Preview Release 69 (Safari 12.1, WebKit 14607.1.12) :
After sizing the window to be narrow and back, the page is longer than before == longer than it should be.
It would be great if this could get fixed :)