Summary: | document.body.scrollHeight is different after resizing the window down and up | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Tobi Reif <tobi> | ||||||||
Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> | ||||||||
Status: | RESOLVED CONFIGURATION CHANGED | ||||||||||
Severity: | Major | CC: | bfulgham, cdumez, jond, simon.fraser, webkit-bug-importer, zalan | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | Safari 11 | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
Tobi Reif
2018-04-17 08:19:02 PDT
(Please set the correct Component, it might be Layout instead of DOM.) Created attachment 338118 [details]
the page
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]
Test reduction
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]
Test reduction
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 :) It would be great if this could get fixed :) It would be great if this could get fixed. Actually, I can't reproduce this anymore (neither with the linked page nor with the supplied attachment). If you agree that the issue got resolved you can close this ticket. Confirmed, can no longer reproduce. Thanks! |