-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial scale of a page is not respected when both initial scale and …
…viewport width are set https://bugs.webkit.org/show_bug.cgi?id=258663 rdar://111515914 Reviewed by Wenson Hsieh. In 256476@main, we introduce a viewport sizing heuristic to clamp the maximum initial scale of a page. This was necessitated by Wikipedia's dynamic initial scale assignment (to maintain their viewport width invariant of 1000) leading to Wiki articles being excessively zoomed in on large screens (such as when an iPad is connected to an external display). However, the somewhat arbitrarily chosen initial scale cap of 1.2 leads to a sub-optimal web development experience because we perform the initial scale clamping on every page (when the `IgnoreMetaViewport` is enabled), meaning it isn't clear why the initial scale is not being respected, even when a developer may have had a valid use-case. To mitigate this situation, we only apply this initial scale clamping as a quirk for pages on the "wikipedia.org" domain. This is a relatively safe decision given that Wikipedia is probably the only top site that performs a dynamic initial scale assignment (that too with potentially *large* scale values). We also introduce an API test to assert this behavior is only limited to Wikipedia. * LayoutTests/fast/viewport/ios/adjust-fixed-width-and-initial-scale-to-avoid-excessive-zooming.html: Removed. This layout test is no longer valid. * Source/WebCore/page/Quirks.cpp: (WebCore::isWikipediaDomain): (WebCore::Quirks::shouldIgnoreViewportArgumentsToAvoidExcessiveZoom const): (WebCore::Quirks::shouldLayOutAtMinimumWindowWidthWhenIgnoringScalingConstraints const): * Source/WebCore/page/Quirks.h: * Source/WebKit/WebProcess/WebPage/WebPage.cpp: (WebKit::setCanIgnoreViewportArgumentsToAvoidExcessiveZoomIfNeeded): (WebKit::WebPage::didCommitLoad): (WebKit::WebPage::updateWebsitePolicies): * Tools/TestWebKitAPI/Tests/ios/Viewport.mm: (TestWebKitAPI::makeViewportMetaTag): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/265804@main
- Loading branch information
Showing
5 changed files
with
78 additions
and
38 deletions.
There are no files selected for viewing
34 changes: 0 additions & 34 deletions
34
...ts/fast/viewport/ios/adjust-fixed-width-and-initial-scale-to-avoid-excessive-zooming.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters