Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5fc310e87e86d023ade0d28e09a954085f0ec176
      
https://github.com/WebKit/WebKit/commit/5fc310e87e86d023ade0d28e09a954085f0ec176
  Author: Wenson Hsieh <[email protected]>
  Date:   2025-01-07 (Tue, 07 Jan 2025)

  Changed paths:
    A 
LayoutTests/fast/viewport/ios/no-unnecessary-horizontal-scrolling-after-changing-view-scale-expected.txt
    A 
LayoutTests/fast/viewport/ios/no-unnecessary-horizontal-scrolling-after-changing-view-scale.html
    M Source/WebCore/page/ViewportConfiguration.cpp

  Log Message:
  -----------
  REGRESSION (286043@main): [iOS] Adjusting page zoom with -/+ causes page to 
become too wide or too narrow
https://bugs.webkit.org/show_bug.cgi?id=285488
rdar://140818892

Reviewed by Aditya Keerthi.

After the changes in 286043@main, adjusting view scale using -/+ buttons in the 
Safari Page menu now
correctly increase or decrease the layout width of a webpage that has a fixed 
viewport width, by
forcing the fixed width to be scaled by the (explicitly-set) layout size scale 
factor.

However, in the case where the viewport is responsive, `m_configuration.width` 
has already been set
relative to the minimum layout size, which accounts for the view scale 
(effective layout size scale
factor). As such, we end up doubly scaling `m_configuration.width` by the 
layout size scale factor,
which leads to excessive horizontal scrolling when zooming out (e.g., zooming 
out to 0.5 view scale
when the viewport and content are both 1000 px causes the body to become twice 
as wide as the
viewport).

To address this, we limit the aforementioned change to the case where the 
viewport argument had
explicitly specified a fixed width — as opposed to `ValueAuto` or 
`ValueDeviceWidth`.

* 
LayoutTests/fast/viewport/ios/no-unnecessary-horizontal-scrolling-after-changing-view-scale-expected.txt:
 Added.
* 
LayoutTests/fast/viewport/ios/no-unnecessary-horizontal-scrolling-after-changing-view-scale.html:
 Added.

Add a layout test to exercise this change, by sanity checking the width of 
`document.body` against
the visual viewport width.

* Source/WebCore/page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::updateConfiguration):

Canonical link: https://commits.webkit.org/288510@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to