WebKit Bugzilla
Attachment 339660 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]
Patch
bug-185347-20180505175629.patch (text/plain), 15.22 KB, created by
Wenson Hsieh
on 2018-05-05 17:56:30 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2018-05-05 17:56:30 PDT
Size:
15.22 KB
patch
obsolete
>Subversion Revision: 231396 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 23f537a439114e842d1eb3ed7afc199d790a8459..8d834401fa9897c257f89233e50152a7e3d137ea 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,44 @@ >+2018-05-05 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, >+ `allow-layout-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-change-min-device-width.html. >+ >+ * dom/ViewportArguments.cpp: >+ (WebCore::setViewportFeature): >+ * dom/ViewportArguments.h: >+ (WebCore::ViewportArguments::operator== const): >+ * page/RuntimeEnabledFeatures.h: >+ (WebCore::RuntimeEnabledFeatures::setAllowLayoutScalingViewportArgumentEnabled): >+ (WebCore::RuntimeEnabledFeatures::allowLayoutScalingViewportArgumentEnabled const): >+ >+ Add a new runtime-enabled feature for `allow-layout-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 >+ `allow-layout-scaling`. In extra zoom mode, if `allow-layout-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 `allow-layout-scaling` viewport property to determine whether to allow shrink-to-fit. >+ >+ If extra zoom mode is not enabled, then `allow-layout-scaling` achieves the same effect as `shrink-to-fit` >+ though the former takes precedence over the latter. >+ >+ * page/ViewportConfiguration.h: >+ > 2018-05-04 Wenson Hsieh <wenson_hsieh@apple.com> > > Consolidate WebContentReaderIOS and WebContentReaderMac into WebContentReaderCocoa >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 6bc61b61b4fa0246738dc1fa2eae9f8e23d6f533..9db2f054f0049a46084d7a9d742780a25153b990 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,17 @@ >+2018-05-05 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 `allow-layout-scaling` viewport argument. Enabled by default in >+ extra zoom mode. >+ >+ * Shared/WebPreferences.yaml: >+ * Shared/WebPreferencesDefaultValues.h: >+ > 2018-05-04 Tim Horton <timothy_horton@apple.com> > > Shift to a lower-level framework for simplifying URLs >diff --git a/Source/WebCore/dom/ViewportArguments.cpp b/Source/WebCore/dom/ViewportArguments.cpp >index 28d2f591c2d2cf97c24fe02409d60b62c76f13fc..dcc95b321e525b496f8c7556ad6fde88a118888a 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, "allow-layout-scaling") && RuntimeEnabledFeatures::sharedFeatures().allowLayoutScalingViewportArgumentEnabled()) >+ arguments.allowLayoutScaling = 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..68d02b1726266d10b70bcc53796f15f7fb109cf8 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 allowLayoutScaling { ValueAuto }; > ViewportFit viewportFit { ViewportFit::Auto }; > bool widthWasExplicit { false }; > >@@ -121,6 +122,7 @@ struct ViewportArguments { > && userZoom == other.userZoom > && orientation == other.orientation > && shrinkToFit == other.shrinkToFit >+ && allowLayoutScaling == other.allowLayoutScaling > && viewportFit == other.viewportFit > && widthWasExplicit == other.widthWasExplicit; > } >diff --git a/Source/WebCore/page/RuntimeEnabledFeatures.h b/Source/WebCore/page/RuntimeEnabledFeatures.h >index 7df0ac0689c46a10586a6af68215c450562c62b1..a2b7c0c4077bdb9683219c419665883d8f83b9e5 100644 >--- a/Source/WebCore/page/RuntimeEnabledFeatures.h >+++ b/Source/WebCore/page/RuntimeEnabledFeatures.h >@@ -256,6 +256,9 @@ public: > void setWebGLCompressedTextureASTCSupportEnabled(bool isEnabled) { m_isWebGLCompressedTextureASTCSupportEnabled = isEnabled; } > bool webGLCompressedTextureASTCSupportEnabled() const { return m_isWebGLCompressedTextureASTCSupportEnabled; } > >+ void setAllowLayoutScalingViewportArgumentEnabled(bool isEnabled) { m_allowLayoutScalingViewportArgumentEnabled = isEnabled; } >+ bool allowLayoutScalingViewportArgumentEnabled() const { return m_allowLayoutScalingViewportArgumentEnabled; } >+ > WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures(); > > private: >@@ -394,6 +397,8 @@ private: > > bool m_isWebGLCompressedTextureASTCSupportEnabled { false }; > >+ bool m_allowLayoutScalingViewportArgumentEnabled { false }; >+ > friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>; > }; > >diff --git a/Source/WebCore/page/ViewportConfiguration.cpp b/Source/WebCore/page/ViewportConfiguration.cpp >index 3126d9f7b9cc93a4062981b2ad9e7db133e6bfd5..2a3ba3502b0928eb62c25d4b1822adb79a170213 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.allowLayoutScaling != 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.allowLayoutScaling)) >+ m_configuration.allowsShrinkToFit = m_viewportArguments.allowLayoutScaling != 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 0e04ccd9dce6a0b16aa08b215e3d85028ba92ab1..69f51efddbc2957c2d9a9e75aa3ed1d3b090031f 100644 >--- a/Source/WebKit/Shared/WebPreferences.yaml >+++ b/Source/WebKit/Shared/WebPreferences.yaml >@@ -1259,3 +1259,11 @@ WebGLCompressedTextureASTCSupportEnabled: > humanReadableDescription: "Support for ASTC compressed texture formats in WebGL" > category: experimental > webcoreBinding: RuntimeEnabledFeatures >+ >+AllowLayoutScalingViewportArgumentEnabled: >+ type: bool >+ defaultValue: ALLOW_LAYOUT_SCALING_VIEWPORT_ARGUMENT_ENABLED >+ humanReadableName: "allow-layout-scaling" >+ humanReadableDescription: "Enable the 'allow-layout-scaling' viewport argument" >+ category: experimental >+ webcoreBinding: RuntimeEnabledFeatures >diff --git a/Source/WebKit/Shared/WebPreferencesDefaultValues.h b/Source/WebKit/Shared/WebPreferencesDefaultValues.h >index 194e026413b562134fa51132d0c7749da27d600d..9826dc0507288c8f7b3fffdc39d9ab6cfefd58ae 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 ALLOW_LAYOUT_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 ALLOW_LAYOUT_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 c898d3795aad6b0628fc521d8da2690b48512b28..84c21fa5f0b83ba01dd545112bc821e5b7e415ff 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2018-05-05 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 `allow-layout-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-change-min-device-width.html: >+ > 2018-05-04 Youenn Fablet <youenn@apple.com> > > webrtc/addICECandidate-closed.html is timing out >diff --git a/LayoutTests/fast/viewport/extrazoom/viewport-change-min-device-width.html b/LayoutTests/fast/viewport/extrazoom/viewport-change-min-device-width.html >index ca7b1dbd89e780d409399396956f83db2f198055..af20aab5809d7b5f45f8d68943b0021b1b980637 100644 >--- a/LayoutTests/fast/viewport/extrazoom/viewport-change-min-device-width.html >+++ b/LayoutTests/fast/viewport/extrazoom/viewport-change-min-device-width.html >@@ -32,24 +32,31 @@ > debug("1. Default viewport"); > await logWindowDimensionsAfterSettingViewportContent("width=150"); > await logWindowDimensionsAfterSettingViewportContent("width=device-width"); >- scaleAtDeviceWidthWithInitialShrinkToFit = parseFloat(await UIHelper.zoomScale()).toFixed(3); >+ scaleAtDeviceWidthWithInitialLayoutScaling = parseFloat(await UIHelper.zoomScale()).toFixed(3); > await logWindowDimensionsAfterSettingViewportContent("width=600"); > >- debug("\n2. shrink-to-fit explicitly disabled"); >+ debug("\n2. allow-layout-scaling explicitly disabled"); >+ await logWindowDimensionsAfterSettingViewportContent("width=150, allow-layout-scaling=no"); >+ await logWindowDimensionsAfterSettingViewportContent("width=device-width, allow-layout-scaling=0"); >+ scaleAtDeviceWidthWithLayoutScalingDisabled = parseFloat(await UIHelper.zoomScale()).toFixed(3); >+ await logWindowDimensionsAfterSettingViewportContent("width=600, allow-layout-scaling=-0.5"); >+ >+ debug("\n3. allow-layout-scaling explicitly enabled"); >+ await logWindowDimensionsAfterSettingViewportContent("width=150, allow-layout-scaling=yes"); >+ await logWindowDimensionsAfterSettingViewportContent("width=device-width, allow-layout-scaling=1"); >+ scaleAtDeviceWidthWithLayoutScalingEnabled = parseFloat(await UIHelper.zoomScale()).toFixed(3); >+ await logWindowDimensionsAfterSettingViewportContent("width=600, allow-layout-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"); > >- 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'"); >+ shouldBe("scaleAtDeviceWidthWithInitialLayoutScaling", "'0.488'"); >+ shouldBe("scaleAtDeviceWidthWithLayoutScalingDisabled", "'1.000'"); >+ shouldBe("scaleAtDeviceWidthWithLayoutScalingEnabled", "'0.488'"); >+ shouldBe("scaleAtDeviceWidthWithShrinkToFitDisabled", "'0.488'"); > > finishJSTest(); > }
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