Bug 193198 - Wrong root element dimensions when page with overflowing elements being scaled down in split screen
Summary: Wrong root element dimensions when page with overflowing elements being scale...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari 12
Hardware: Mac macOS 10.14
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-01-07 08:07 PST by Rikumi Yu
Modified: 2019-01-07 12:47 PST (History)
4 users (show)

See Also:


Attachments
Screenshot (552.02 KB, image/png)
2019-01-07 08:07 PST, Rikumi Yu
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rikumi Yu 2019-01-07 08:07:24 PST
Created attachment 358497 [details]
Screenshot

Steps to reproduce:

1. Construct a page with at least one element overflowing viewport:
    ```
    <html><head><style>
    body {
        width: 100%;
        margin: 10px;
    }
    body::before {
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        background: #777;
    }
    </style></head><body></body></html>
    ```
2. On Safari 12, go to Safari -> Preferences -> Websites -> Page Zoom, and scale the current page down (50% is best to reproduce the bug).
3. Set Safari to fullscreen.
4. Open the constructed page.
5. Split the screen with another window (or the devtools).
6. Drag the separator to give the Safari window enough width (>= 1100pt).
7. Drag the separator again to reduce the width (< 1100pt).
8. The page turns into bad layout, where the root element is half the width of viewport (when the zoom factor is 50%).

Since tons of public sites does not use `overflow:hidden` for `<html>`, this bug can be easily reproduced.
Comment 1 Radar WebKit Bug Importer 2019-01-07 12:47:48 PST
<rdar://problem/47093395>