WebKit Bugzilla
Attachment 339919 Details for
Bug 185347
: [Extra zoom mode] Google search results are excessively zoomed in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Actually rebase on trunk
bug-185347-20180508193028.patch (text/plain), 18.45 KB, created by
Wenson Hsieh
on 2018-05-08 19:30:29 PDT
(
hide
)
Description:
Actually rebase on trunk
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2018-05-08 19:30:29 PDT
Size:
18.45 KB
patch
obsolete
>Subversion Revision: 231536 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b2de2420ee9a62c92458f46180a38604435da8e3..a4c46af414658d04839ccf699f3694057f8c0aa5 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,44 @@ >+2018-05-08 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [Extra zoom mode] Google search results are excessively zoomed in >+ https://bugs.webkit.org/show_bug.cgi?id=185347 >+ <rdar://problem/39999778> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ It turns out that basing minimum layout size and shrink-to-fit behaviors off of the `shrink-to-fit` viewport >+ argument poses compatibility risks with web pages that already specify `shrink-to-fit` to opt out of default >+ viewport shrinking behaviors in 1/3 multitasking mode on iPad. Instead, introduce a new viewport argument, >+ `device-width-scaling`, that encompasses both `shrink-to-fit` behavior and minimum layout width scaling in extra >+ zoom mode. See changes below for more detail. >+ >+ Augmented an existing layout test: fast/viewport/extrazoom/viewport-device-width-scaling.html. >+ >+ * dom/ViewportArguments.cpp: >+ (WebCore::setViewportFeature): >+ * dom/ViewportArguments.h: >+ (WebCore::ViewportArguments::operator== const): >+ * page/RuntimeEnabledFeatures.h: >+ (WebCore::RuntimeEnabledFeatures::setDeviceWidthScalingViewportArgumentEnabled): >+ (WebCore::RuntimeEnabledFeatures::deviceWidthScalingViewportArgumentEnabled const): >+ >+ Add a new runtime-enabled feature for `device-width-scaling`, and gate the parsing of this viewport argument on >+ the feature being enabled. >+ >+ * page/ViewportConfiguration.cpp: >+ (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthAndShrinkToFit const): >+ (WebCore::ViewportConfiguration::updateConfiguration): >+ >+ Adjust logic for updating whether or not we should allow `shrink-to-fit` heuristics to account for >+ `device-width-scaling`. In extra zoom mode, if `device-width-scaling` is unspecified, we always allow >+ shrink-to-fit, regardless of the value of the `shrink-to-fit` viewport argument. Otherwise, we use the value of >+ the `device-width-scaling` viewport property to determine whether to allow shrink-to-fit. >+ >+ If extra zoom mode is not enabled, then `device-width-scaling` achieves the same effect as `shrink-to-fit` >+ though the former takes precedence over the latter. >+ >+ * page/ViewportConfiguration.h: >+ > 2018-05-08 Ryan Haddad <ryanhaddad@apple.com> > > Unreviewed, rolling out r231486. >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 013a18a36bd2992d4250de8ddfc6b16827bc896d..4f70efdb55c68835f8f3e7c31907872b86595de9 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,17 @@ >+2018-05-08 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [Extra zoom mode] Google search results are excessively zoomed in >+ https://bugs.webkit.org/show_bug.cgi?id=185347 >+ <rdar://problem/39999778> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add an experimental feature to gate the new `device-width-scaling` viewport argument. Enabled by default in >+ extra zoom mode. >+ >+ * Shared/WebPreferences.yaml: >+ * Shared/WebPreferencesDefaultValues.h: >+ > 2018-05-08 Sihui Liu <sihui_liu@apple.com> > > Adopt new async _savecookies SPI for keeping networking process active during flushing cookies >diff --git a/Source/WebCore/dom/ViewportArguments.cpp b/Source/WebCore/dom/ViewportArguments.cpp >index 28d2f591c2d2cf97c24fe02409d60b62c76f13fc..cb949bd3b4d66f98f7966f6519b3fdf070446fa2 100644 >--- a/Source/WebCore/dom/ViewportArguments.cpp >+++ b/Source/WebCore/dom/ViewportArguments.cpp >@@ -421,6 +421,8 @@ void setViewportFeature(ViewportArguments& arguments, Document& document, String > arguments.shrinkToFit = findBooleanValue(document, key, value); > else if (equalLettersIgnoringASCIICase(key, "viewport-fit") && document.settings().viewportFitEnabled()) > arguments.viewportFit = parseViewportFitValue(document, key, value); >+ else if (equalLettersIgnoringASCIICase(key, "device-width-scaling") && RuntimeEnabledFeatures::sharedFeatures().deviceWidthScalingViewportArgumentEnabled()) >+ arguments.deviceWidthScaling = findBooleanValue(document, key, value); > else > reportViewportWarning(document, UnrecognizedViewportArgumentKeyError, key); > } >diff --git a/Source/WebCore/dom/ViewportArguments.h b/Source/WebCore/dom/ViewportArguments.h >index 4f1afea34001b8bbd9c26fa20b1c167de79582fb..603d550cd16d32d6d8d071d997019266277c5e6d 100644 >--- a/Source/WebCore/dom/ViewportArguments.h >+++ b/Source/WebCore/dom/ViewportArguments.h >@@ -102,6 +102,7 @@ struct ViewportArguments { > float userZoom { ValueAuto }; > float orientation { ValueAuto }; > float shrinkToFit { ValueAuto }; >+ float deviceWidthScaling { ValueAuto }; > ViewportFit viewportFit { ViewportFit::Auto }; > bool widthWasExplicit { false }; > >@@ -121,6 +122,7 @@ struct ViewportArguments { > && userZoom == other.userZoom > && orientation == other.orientation > && shrinkToFit == other.shrinkToFit >+ && deviceWidthScaling == other.deviceWidthScaling > && viewportFit == other.viewportFit > && widthWasExplicit == other.widthWasExplicit; > } >diff --git a/Source/WebCore/page/RuntimeEnabledFeatures.h b/Source/WebCore/page/RuntimeEnabledFeatures.h >index f692e57fd027a245b847bce70569aea020a87691..f59bd93feeda1900a6710bb2865adbf20409b931 100644 >--- a/Source/WebCore/page/RuntimeEnabledFeatures.h >+++ b/Source/WebCore/page/RuntimeEnabledFeatures.h >@@ -259,6 +259,9 @@ public: > void setStorageAccessPromptsEnabled(bool isEnabled) { m_promptForStorageAccessAPIEnabled = isEnabled; } > bool storageAccessPromptsEnabled() const { return m_promptForStorageAccessAPIEnabled; } > >+ void setDeviceWidthScalingViewportArgumentEnabled(bool isEnabled) { m_deviceWidthScalingViewportArgumentEnabled = isEnabled; } >+ bool deviceWidthScalingViewportArgumentEnabled() const { return m_deviceWidthScalingViewportArgumentEnabled; } >+ > WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures(); > > private: >@@ -399,6 +402,8 @@ private: > > bool m_promptForStorageAccessAPIEnabled { false }; > >+ bool m_deviceWidthScalingViewportArgumentEnabled { false }; >+ > friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>; > }; > >diff --git a/Source/WebCore/page/ViewportConfiguration.cpp b/Source/WebCore/page/ViewportConfiguration.cpp >index 3126d9f7b9cc93a4062981b2ad9e7db133e6bfd5..ebbd60b90800054c9e8a02403004f3030ad8a604 100644 >--- a/Source/WebCore/page/ViewportConfiguration.cpp >+++ b/Source/WebCore/page/ViewportConfiguration.cpp >@@ -135,7 +135,7 @@ IntSize ViewportConfiguration::layoutSize() const > bool ViewportConfiguration::shouldOverrideDeviceWidthAndShrinkToFit() const > { > auto viewWidth = m_viewLayoutSize.width(); >- return m_viewportArguments.shrinkToFit != 0. && 0 < viewWidth && viewWidth < platformDeviceWidthOverride(); >+ return m_viewportArguments.deviceWidthScaling != 0. && 0 < viewWidth && viewWidth < platformDeviceWidthOverride(); > } > > bool ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints() const >@@ -368,7 +368,11 @@ void ViewportConfiguration::updateConfiguration() > if (booleanViewportArgumentIsSet(m_viewportArguments.userZoom)) > m_configuration.allowsUserScaling = m_viewportArguments.userZoom != 0.; > >- if (booleanViewportArgumentIsSet(m_viewportArguments.shrinkToFit)) >+ if (shouldOverrideDeviceWidthAndShrinkToFit()) >+ m_configuration.allowsShrinkToFit = true; >+ else if (booleanViewportArgumentIsSet(m_viewportArguments.deviceWidthScaling)) >+ m_configuration.allowsShrinkToFit = m_viewportArguments.deviceWidthScaling != 0.; >+ else if (booleanViewportArgumentIsSet(m_viewportArguments.shrinkToFit)) > m_configuration.allowsShrinkToFit = m_viewportArguments.shrinkToFit != 0.; > > m_configuration.avoidsUnsafeArea = m_viewportArguments.viewportFit != ViewportFit::Cover; >diff --git a/Source/WebCore/page/ViewportConfiguration.h b/Source/WebCore/page/ViewportConfiguration.h >index f790cf60db838dd8c5c677fc9fa494a6fa1bed6d..098657385c3c3d99fc1c4a1a1d8d51a1a1a37c56 100644 >--- a/Source/WebCore/page/ViewportConfiguration.h >+++ b/Source/WebCore/page/ViewportConfiguration.h >@@ -82,8 +82,6 @@ public: > const ViewportArguments& viewportArguments() const { return m_viewportArguments; } > WEBCORE_EXPORT bool setViewportArguments(const ViewportArguments&); > >- bool shouldOverrideDeviceWidthAndShrinkToFit() const; >- > WEBCORE_EXPORT bool setCanIgnoreScalingConstraints(bool); > void setForceAlwaysUserScalable(bool forceAlwaysUserScalable) { m_forceAlwaysUserScalable = forceAlwaysUserScalable; } > >@@ -116,6 +114,7 @@ private: > int layoutWidth() const; > int layoutHeight() const; > >+ bool shouldOverrideDeviceWidthAndShrinkToFit() const; > bool shouldIgnoreScalingConstraintsRegardlessOfContentSize() const; > bool shouldIgnoreScalingConstraints() const; > bool shouldIgnoreVerticalScalingConstraints() const; >diff --git a/Source/WebKit/Shared/WebPreferences.yaml b/Source/WebKit/Shared/WebPreferences.yaml >index 3189575a8d78d04e6c86d4414a63c5b6d2b376bb..10c1f85a4849b02c07a033905b3943918d68069f 100644 >--- a/Source/WebKit/Shared/WebPreferences.yaml >+++ b/Source/WebKit/Shared/WebPreferences.yaml >@@ -1267,3 +1267,11 @@ StorageAccessPromptsEnabled: > humanReadableDescription: "Prompt the user when Storage Access API calls are made" > category: experimental > webcoreBinding: RuntimeEnabledFeatures >+ >+DeviceWidthScalingViewportArgumentEnabled: >+ type: bool >+ defaultValue: DEVICE_WIDTH_SCALING_VIEWPORT_ARGUMENT_ENABLED >+ humanReadableName: "device-width-scaling" >+ humanReadableDescription: "Enable the 'device-width-scaling' viewport argument" >+ category: experimental >+ webcoreBinding: RuntimeEnabledFeatures >diff --git a/Source/WebKit/Shared/WebPreferencesDefaultValues.h b/Source/WebKit/Shared/WebPreferencesDefaultValues.h >index 194e026413b562134fa51132d0c7749da27d600d..1477dab549e3e96f0b2e9123bf266a87d68f46e7 100644 >--- a/Source/WebKit/Shared/WebPreferencesDefaultValues.h >+++ b/Source/WebKit/Shared/WebPreferencesDefaultValues.h >@@ -173,14 +173,10 @@ > > #if ENABLE(EXTRA_ZOOM_MODE) > #define DEFAULT_VISUAL_VIEWPORT_HEIGHT_EXPANSION_FACTOR 1 >+#define DEVICE_WIDTH_SCALING_VIEWPORT_ARGUMENT_ENABLED true > #else > #define DEFAULT_VISUAL_VIEWPORT_HEIGHT_EXPANSION_FACTOR 0 >-#endif >- >-#if ENABLE(EXTRA_ZOOM_MODE) >-#define DEFAULT_MIN_DEVICE_WIDTH_ENABLED 1 >-#else >-#define DEFAULT_MIN_DEVICE_WIDTH_ENABLED 0 >+#define DEVICE_WIDTH_SCALING_VIEWPORT_ARGUMENT_ENABLED false > #endif > > // Cocoa ports must disable experimental features on release branches for now. >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index c933768b7ef7c8777e75b0e00caea4249943790d..42d24b41a01b0d622895059337f1b1045bd27e80 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2018-05-08 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [Extra zoom mode] Google search results are excessively zoomed in >+ https://bugs.webkit.org/show_bug.cgi?id=185347 >+ <rdar://problem/39999778> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Augment and adjust an existing layout test to use `device-width-scaling` instead of `shrink-to-fit`. >+ Additionally, verify that setting `shrink-to-fit=no` is insufficient to disable minimum layout width scaling >+ heuristics in extra zoom mode. >+ >+ * fast/viewport/extrazoom/viewport-device-width-scaling.html: Renamed from LayoutTests/fast/viewport/extrazoom/viewport-change-min-device-width.html. >+ > 2018-05-08 Daniel Bates <dabates@apple.com> > > Do not apply X-Frame-Options and CSP frame-ancestors to Quick Look-applicable responses in NetworkProcess >diff --git a/LayoutTests/fast/viewport/extrazoom/viewport-change-min-device-width.html b/LayoutTests/fast/viewport/extrazoom/viewport-change-min-device-width.html >deleted file mode 100644 >index ca7b1dbd89e780d409399396956f83db2f198055..0000000000000000000000000000000000000000 >--- a/LayoutTests/fast/viewport/extrazoom/viewport-change-min-device-width.html >+++ /dev/null >@@ -1,60 +0,0 @@ >-<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] --> >-<html> >-<meta name="viewport" id="meta"> >-<head> >- <script src="../../../resources/js-test.js"></script> >- <script src="../../../resources/ui-helper.js"></script> >- <style> >- body, html { >- margin: 0; >- width: 100%; >- height: 100%; >- } >- </style> >- <script> >- jsTestIsAsync = true; >- >- function logWindowDimensionsAfterSettingViewportContent(content) { >- return new Promise(async resolve => { >- meta.setAttribute("content", content); >- await UIHelper.ensurePresentationUpdate(); >- debug(`[${meta.getAttribute("content")}] (${innerWidth}, ${innerHeight})`); >- resolve(); >- }); >- } >- >- async function runTest() { >- if (!window.testRunner) { >- description("Please use WebKitTestRunner to run this test."); >- return; >- } >- >- debug("1. Default viewport"); >- await logWindowDimensionsAfterSettingViewportContent("width=150"); >- await logWindowDimensionsAfterSettingViewportContent("width=device-width"); >- scaleAtDeviceWidthWithInitialShrinkToFit = parseFloat(await UIHelper.zoomScale()).toFixed(3); >- await logWindowDimensionsAfterSettingViewportContent("width=600"); >- >- debug("\n2. shrink-to-fit explicitly disabled"); >- await logWindowDimensionsAfterSettingViewportContent("width=150, shrink-to-fit=no"); >- await logWindowDimensionsAfterSettingViewportContent("width=device-width, shrink-to-fit=0"); >- scaleAtDeviceWidthWithShrinkToFitDisabled = parseFloat(await UIHelper.zoomScale()).toFixed(3); >- await logWindowDimensionsAfterSettingViewportContent("width=600, shrink-to-fit=-0.5"); >- >- debug("\n3. shrink-to-fit explicitly enabled"); >- await logWindowDimensionsAfterSettingViewportContent("width=150, shrink-to-fit=yes"); >- await logWindowDimensionsAfterSettingViewportContent("width=device-width, shrink-to-fit=1"); >- scaleAtDeviceWidthWithShrinkToFitEnabled = parseFloat(await UIHelper.zoomScale()).toFixed(3); >- await logWindowDimensionsAfterSettingViewportContent("width=600, shrink-to-fit=device-width"); >- >- shouldBe("scaleAtDeviceWidthWithInitialShrinkToFit", "'0.488'"); >- shouldBe("scaleAtDeviceWidthWithShrinkToFitDisabled", "'1.000'"); >- shouldBe("scaleAtDeviceWidthWithShrinkToFitEnabled", "'0.488'"); >- >- finishJSTest(); >- } >- </script> >-</head> >-<body onload="runTest()"> >-</body> >-</html> >diff --git a/LayoutTests/fast/viewport/extrazoom/viewport-device-width-scaling.html b/LayoutTests/fast/viewport/extrazoom/viewport-device-width-scaling.html >new file mode 100644 >index 0000000000000000000000000000000000000000..483d2697689f1b96a7c75ea0df945c16003a12e4 >--- /dev/null >+++ b/LayoutTests/fast/viewport/extrazoom/viewport-device-width-scaling.html >@@ -0,0 +1,67 @@ >+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] --> >+<html> >+<meta name="viewport" id="meta"> >+<head> >+ <script src="../../../resources/js-test.js"></script> >+ <script src="../../../resources/ui-helper.js"></script> >+ <style> >+ body, html { >+ margin: 0; >+ width: 100%; >+ height: 100%; >+ } >+ </style> >+ <script> >+ jsTestIsAsync = true; >+ >+ function logWindowDimensionsAfterSettingViewportContent(content) { >+ return new Promise(async resolve => { >+ meta.setAttribute("content", content); >+ await UIHelper.ensurePresentationUpdate(); >+ debug(`[${meta.getAttribute("content")}] (${innerWidth}, ${innerHeight})`); >+ resolve(); >+ }); >+ } >+ >+ async function runTest() { >+ if (!window.testRunner) { >+ description("Please use WebKitTestRunner to run this test."); >+ return; >+ } >+ >+ debug("1. Default viewport"); >+ await logWindowDimensionsAfterSettingViewportContent("width=150"); >+ await logWindowDimensionsAfterSettingViewportContent("width=device-width"); >+ scaleAtDeviceWidthWithInitialLayoutScaling = parseFloat(await UIHelper.zoomScale()).toFixed(3); >+ await logWindowDimensionsAfterSettingViewportContent("width=600"); >+ >+ debug("\n2. device-width-scaling explicitly disabled"); >+ await logWindowDimensionsAfterSettingViewportContent("width=150, device-width-scaling=no"); >+ await logWindowDimensionsAfterSettingViewportContent("width=device-width, device-width-scaling=0"); >+ scaleAtDeviceWidthWithLayoutScalingDisabled = parseFloat(await UIHelper.zoomScale()).toFixed(3); >+ await logWindowDimensionsAfterSettingViewportContent("width=600, device-width-scaling=-0.5"); >+ >+ debug("\n3. device-width-scaling explicitly enabled"); >+ await logWindowDimensionsAfterSettingViewportContent("width=150, device-width-scaling=yes"); >+ await logWindowDimensionsAfterSettingViewportContent("width=device-width, device-width-scaling=1"); >+ scaleAtDeviceWidthWithLayoutScalingEnabled = parseFloat(await UIHelper.zoomScale()).toFixed(3); >+ await logWindowDimensionsAfterSettingViewportContent("width=600, device-width-scaling=device-width"); >+ >+ debug("\n4. shrink-to-fit explicitly disabled"); >+ await logWindowDimensionsAfterSettingViewportContent("width=150, shrink-to-fit=no"); >+ await logWindowDimensionsAfterSettingViewportContent("width=device-width, shrink-to-fit=0"); >+ scaleAtDeviceWidthWithShrinkToFitDisabled = parseFloat(await UIHelper.zoomScale()).toFixed(3); >+ await logWindowDimensionsAfterSettingViewportContent("width=600, shrink-to-fit=-0.5"); >+ >+ shouldBe("scaleAtDeviceWidthWithInitialLayoutScaling", "'0.488'"); >+ shouldBe("scaleAtDeviceWidthWithLayoutScalingDisabled", "'1.000'"); >+ shouldBe("scaleAtDeviceWidthWithLayoutScalingEnabled", "'0.488'"); >+ shouldBe("scaleAtDeviceWidthWithShrinkToFitDisabled", "'0.488'"); >+ >+ finishJSTest(); >+ } >+ </script> >+</head> >+<body onload="runTest()"> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185347
:
339660
|
339665
|
339913
|
339915
|
339919
|
340340
|
340349