Bug 242550 - A vertical scrollbar is shown when none is necessary
Summary: A vertical scrollbar is shown when none is necessary
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-07-08 20:47 PDT by Simon Fraser (smfr)
Modified: 2023-05-04 13:43 PDT (History)
4 users (show)

See Also:


Attachments
Testcase (781 bytes, text/html)
2022-07-08 20:47 PDT, Simon Fraser (smfr)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2022-07-08 20:47:32 PDT
Created attachment 460775 [details]
Testcase

When the content size matches the view size (or the iframe size), then we'll create a vertical scrollbar and trigger vertical scrolling when it's not necessary (when scrollbars take space, i.e. non-overlay scrollbars).

Turn on always-on scrollbars.
Load the attached testcase
Size the window so that the gray rectangle just covers the web view.
Reload; note how a vertical scrollbar appears.
Now size the window from the bottom, making it slightly taller then shorter, back to the original size. Note how you can make the scrollbar go away.
Comment 1 Simon Fraser (smfr) 2022-07-08 20:48:27 PDT
This is about code in in `FrameView::adjustScrollbarsForLayout()` that forces on the vertical scrollbar for the first layout, but doesn't compute that it can remove it again and still fit the content.

The state is unstable; some future layout can cause the scrollbar to disappear.
Comment 2 Radar WebKit Bug Importer 2022-07-15 20:48:14 PDT
<rdar://problem/97108398>