WebKit Bugzilla
Attachment 339117 Details for
Bug 185132
: [Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min-device-width
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Try to fix GTK/WPE builds
bug-185132-20180430094939.patch (text/plain), 15.88 KB, created by
Wenson Hsieh
on 2018-04-30 09:49:40 PDT
(
hide
)
Description:
Try to fix GTK/WPE builds
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2018-04-30 09:49:40 PDT
Size:
15.88 KB
patch
obsolete
>Subversion Revision: 231141 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a9717c7e5088cd9207ceb416b4e236a9bdfeb962..00d1d2403b61d590f6f56f1b9594db90d3ac644d 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,52 @@ >+2018-04-30 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min-device-width >+ https://bugs.webkit.org/show_bug.cgi?id=185132 >+ <rdar://problem/39834562> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Removes the `min-device-width` attribute added in r231095. Instead, we key this behavior off of the >+ `shrink-to-fit` attribute introduced for multitasking on iPad, such that `shrink-to-fit=no` achieves the same >+ behavior as `min-device-width=0` in extra zoom mode. See comments below for more detail. >+ >+ Adjusted an existing layout test: fast/viewport/extrazoom/viewport-change-min-device-width.html. >+ >+ * dom/ViewportArguments.cpp: >+ (WebCore::setViewportFeature): >+ (WebCore::operator<<): >+ * dom/ViewportArguments.h: >+ >+ Removes the `minDeviceWidth` viewport argument. >+ >+ * page/RuntimeEnabledFeatures.h: >+ (WebCore::RuntimeEnabledFeatures::setMinDeviceWidthEnabled): Deleted. >+ (WebCore::RuntimeEnabledFeatures::minDeviceWidthEnabled const): Deleted. >+ >+ Removes the runtime switch for `min-device-width`. >+ >+ * page/ViewportConfiguration.cpp: >+ (WebCore::platformDeviceWidthOverride): >+ >+ Hard-code the override device width in extra zoom mode. >+ >+ (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthAndShrinkToFit const): >+ >+ In extra zoom mode, override the device width only if shrink-to-fit has not been expliticly disabled, and the >+ device width is less than the override device width. >+ >+ (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const): >+ (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraintsRegardlessOfContentSize const): >+ (WebCore::ViewportConfiguration::updateConfiguration): >+ (WebCore::ViewportConfiguration::updateMinimumLayoutSize): >+ >+ Do not override the minimum layout size if `shrink-to-fit` has been explicitly explicitly disabled, or if the >+ device width is greater than the override device width. >+ >+ (WebCore::computedMinDeviceWidth): Deleted. >+ (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth const): Deleted. >+ * page/ViewportConfiguration.h: >+ > 2018-04-28 Zalan Bujtas <zalan@apple.com> > > [LFC] Add LayoutTreeBuilder class to generate the layout tree >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 9f66cac027dba12685418881ffa0df44c2a1a1a7..4bcf1479380397e1276f2bfa1d5686f2e7f9c225 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,15 @@ >+2018-04-30 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min-device-width >+ https://bugs.webkit.org/show_bug.cgi?id=185132 >+ <rdar://problem/39834562> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove the experimental feature for `min-device-width`. >+ >+ * Shared/WebPreferences.yaml: >+ > 2018-04-28 Andy Estes <aestes@apple.com> > > [iOS] Allow com.apple.WebKit.Networking to look up com.apple.wifi.manager >diff --git a/Source/WebCore/dom/ViewportArguments.cpp b/Source/WebCore/dom/ViewportArguments.cpp >index a77b979ca8586da9577fbb21dd8e88c1afa4581f..28d2f591c2d2cf97c24fe02409d60b62c76f13fc 100644 >--- a/Source/WebCore/dom/ViewportArguments.cpp >+++ b/Source/WebCore/dom/ViewportArguments.cpp >@@ -421,8 +421,6 @@ 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, "min-device-width") && RuntimeEnabledFeatures::sharedFeatures().minDeviceWidthEnabled()) >- arguments.minDeviceWidth = numericPrefix(document, key, value); > else > reportViewportWarning(document, UnrecognizedViewportArgumentKeyError, key); > } >@@ -478,7 +476,7 @@ TextStream& operator<<(TextStream& ts, const ViewportArguments& viewportArgument > { > TextStream::IndentScope indentScope(ts); > >- ts << "\n" << indent << "(width " << viewportArguments.width << ", minWidth " << viewportArguments.minWidth << ", maxWidth " << viewportArguments.maxWidth << ", minDeviceWidth " << viewportArguments.minDeviceWidth << ")"; >+ ts << "\n" << indent << "(width " << viewportArguments.width << ", minWidth " << viewportArguments.minWidth << ", maxWidth " << viewportArguments.maxWidth << ")"; > ts << "\n" << indent << "(height " << viewportArguments.height << ", minHeight " << viewportArguments.minHeight << ", maxHeight " << viewportArguments.maxHeight << ")"; > ts << "\n" << indent << "(zoom " << viewportArguments.zoom << ", minZoom " << viewportArguments.minZoom << ", maxZoom " << viewportArguments.maxZoom << ")"; > >diff --git a/Source/WebCore/dom/ViewportArguments.h b/Source/WebCore/dom/ViewportArguments.h >index 4a8e8cbdf433cf3887248a524d44af122b167aa5..4f1afea34001b8bbd9c26fa20b1c167de79582fb 100644 >--- a/Source/WebCore/dom/ViewportArguments.h >+++ b/Source/WebCore/dom/ViewportArguments.h >@@ -93,7 +93,6 @@ struct ViewportArguments { > float width { ValueAuto }; > float minWidth { ValueAuto }; > float maxWidth { ValueAuto }; >- float minDeviceWidth { ValueAuto }; > float height { ValueAuto }; > float minHeight { ValueAuto }; > float maxHeight { ValueAuto }; >diff --git a/Source/WebCore/page/RuntimeEnabledFeatures.h b/Source/WebCore/page/RuntimeEnabledFeatures.h >index 29c49d144b97a279859c968f10d23b510df4a030..2e60b0c38e5416364722ec2bdccf129d4132b88c 100644 >--- a/Source/WebCore/page/RuntimeEnabledFeatures.h >+++ b/Source/WebCore/page/RuntimeEnabledFeatures.h >@@ -253,9 +253,6 @@ public: > void setFromOriginResponseHeaderEnabled(bool isEnabled) { m_fromOriginResponseHeaderEnabled = isEnabled; } > bool fromOriginResponseHeaderEnabled() const { return m_fromOriginResponseHeaderEnabled; } > >- void setMinDeviceWidthEnabled(bool isEnabled) { m_minDeviceWidthEnabled = isEnabled; } >- bool minDeviceWidthEnabled() const { return m_minDeviceWidthEnabled; } >- > WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures(); > > private: >diff --git a/Source/WebCore/page/ViewportConfiguration.cpp b/Source/WebCore/page/ViewportConfiguration.cpp >index 648b8d307c7517d601a770905b2f0c8c425840ac..3126d9f7b9cc93a4062981b2ad9e7db133e6bfd5 100644 >--- a/Source/WebCore/page/ViewportConfiguration.cpp >+++ b/Source/WebCore/page/ViewportConfiguration.cpp >@@ -45,11 +45,8 @@ static bool constraintsAreAllRelative(const ViewportConfiguration::Parameters& c > } > #endif > >-static float computedMinDeviceWidth(float minDeviceWidth) >+static float platformDeviceWidthOverride() > { >- if (minDeviceWidth != ViewportArguments::ValueAuto) >- return minDeviceWidth; >- > #if ENABLE(EXTRA_ZOOM_MODE) > return 320; > #else >@@ -135,9 +132,10 @@ IntSize ViewportConfiguration::layoutSize() const > return IntSize(layoutWidth(), layoutHeight()); > } > >-bool ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth() const >+bool ViewportConfiguration::shouldOverrideDeviceWidthAndShrinkToFit() const > { >- return m_viewLayoutSize.width() < computedMinDeviceWidth(m_viewportArguments.minDeviceWidth); >+ auto viewWidth = m_viewLayoutSize.width(); >+ return m_viewportArguments.shrinkToFit != 0. && 0 < viewWidth && viewWidth < platformDeviceWidthOverride(); > } > > bool ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints() const >@@ -145,7 +143,7 @@ bool ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints() const > if (!m_canIgnoreScalingConstraints) > return false; > >- if (shouldOverrideDeviceWidthWithMinDeviceWidth()) >+ if (shouldOverrideDeviceWidthAndShrinkToFit()) > return true; > > if (!m_configuration.allowsShrinkToFit) >@@ -183,7 +181,7 @@ bool ViewportConfiguration::shouldIgnoreScalingConstraints() const > > bool ViewportConfiguration::shouldIgnoreScalingConstraintsRegardlessOfContentSize() const > { >- return m_canIgnoreScalingConstraints && shouldOverrideDeviceWidthWithMinDeviceWidth(); >+ return m_canIgnoreScalingConstraints && shouldOverrideDeviceWidthAndShrinkToFit(); > } > > double ViewportConfiguration::initialScaleFromSize(double width, double height, bool shouldIgnoreScalingConstraints) const >@@ -371,7 +369,7 @@ void ViewportConfiguration::updateConfiguration() > m_configuration.allowsUserScaling = m_viewportArguments.userZoom != 0.; > > if (booleanViewportArgumentIsSet(m_viewportArguments.shrinkToFit)) >- m_configuration.allowsShrinkToFit = shouldOverrideDeviceWidthWithMinDeviceWidth() || m_viewportArguments.shrinkToFit != 0.; >+ m_configuration.allowsShrinkToFit = m_viewportArguments.shrinkToFit != 0.; > > m_configuration.avoidsUnsafeArea = m_viewportArguments.viewportFit != ViewportFit::Cover; > >@@ -380,12 +378,12 @@ void ViewportConfiguration::updateConfiguration() > > void ViewportConfiguration::updateMinimumLayoutSize() > { >- if (!m_viewLayoutSize.width() || !shouldOverrideDeviceWidthWithMinDeviceWidth()) { >+ if (!shouldOverrideDeviceWidthAndShrinkToFit()) { > m_minimumLayoutSize = m_viewLayoutSize; > return; > } > >- auto minDeviceWidth = computedMinDeviceWidth(m_viewportArguments.minDeviceWidth); >+ float minDeviceWidth = platformDeviceWidthOverride(); > m_minimumLayoutSize = FloatSize(minDeviceWidth, std::roundf(m_viewLayoutSize.height() * (minDeviceWidth / m_viewLayoutSize.width()))); > } > >diff --git a/Source/WebCore/page/ViewportConfiguration.h b/Source/WebCore/page/ViewportConfiguration.h >index bff1007677f2345c9a9517a52765abd370babd1e..f790cf60db838dd8c5c677fc9fa494a6fa1bed6d 100644 >--- a/Source/WebCore/page/ViewportConfiguration.h >+++ b/Source/WebCore/page/ViewportConfiguration.h >@@ -82,7 +82,7 @@ public: > const ViewportArguments& viewportArguments() const { return m_viewportArguments; } > WEBCORE_EXPORT bool setViewportArguments(const ViewportArguments&); > >- bool shouldOverrideDeviceWidthWithMinDeviceWidth() const; >+ bool shouldOverrideDeviceWidthAndShrinkToFit() const; > > WEBCORE_EXPORT bool setCanIgnoreScalingConstraints(bool); > void setForceAlwaysUserScalable(bool forceAlwaysUserScalable) { m_forceAlwaysUserScalable = forceAlwaysUserScalable; } >diff --git a/Source/WebKit/Shared/WebPreferences.yaml b/Source/WebKit/Shared/WebPreferences.yaml >index f44c7d78b393d794e0d6919b2a2332c9a1ee0f55..f6be259d8bc2c3414f179523db8437b61b3e562b 100644 >--- a/Source/WebKit/Shared/WebPreferences.yaml >+++ b/Source/WebKit/Shared/WebPreferences.yaml >@@ -1248,11 +1248,3 @@ FromOriginResponseHeaderEnabled: > humanReadableDescription: "Support for the From-Origin Response Header" > category: experimental > webcoreBinding: RuntimeEnabledFeatures >- >-MinDeviceWidthEnabled: >- type: bool >- defaultValue: DEFAULT_MIN_DEVICE_WIDTH_ENABLED >- humanReadableName: "Minimum device width" >- humanReadableDescription: "Enable the min-device-width viewport parameter" >- category: experimental >- webcoreBinding: RuntimeEnabledFeatures >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index c0b2e457f0f773484941def29ca239fc425e2832..dc0301c757365b4946f485cae236370f8098905f 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,19 @@ >+2018-04-30 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min-device-width >+ https://bugs.webkit.org/show_bug.cgi?id=185132 >+ <rdar://problem/39834562> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Modifies an existing layout test to try out different values of `shrink-to-fit` instead of using the >+ `min-device-width` attribute. This test now begins with the default viewport configuration, then explicitly >+ disables `shrink-to-fit` by setting the attribute to a few different values (which should all achieve the same >+ effect), and lastly explicitly re-enables `shrink-to-fit` by setting the attribute value to several values that >+ should behave the same as `shrink-to-fit=yes`. >+ >+ * fast/viewport/extrazoom/viewport-change-min-device-width.html: >+ > 2018-04-27 Ryan Haddad <ryanhaddad@apple.com> > > Unreviewed test gardening for iOS and macOS. >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 1531a922a0c613c118211248c27a51565a3a61bc..ca7b1dbd89e780d409399396956f83db2f198055 100644 >--- a/LayoutTests/fast/viewport/extrazoom/viewport-change-min-device-width.html >+++ b/LayoutTests/fast/viewport/extrazoom/viewport-change-min-device-width.html >@@ -29,27 +29,27 @@ > return; > } > >- debug("1. Initial min-device-width"); >+ debug("1. Default viewport"); > await logWindowDimensionsAfterSettingViewportContent("width=150"); > await logWindowDimensionsAfterSettingViewportContent("width=device-width"); >- scaleAtDeviceWidthForInitialMinDeviceWidth = parseFloat(await UIHelper.zoomScale()).toFixed(3); >+ scaleAtDeviceWidthWithInitialShrinkToFit = parseFloat(await UIHelper.zoomScale()).toFixed(3); > await logWindowDimensionsAfterSettingViewportContent("width=600"); > >- debug("\n2. min-device-width=0"); >- await logWindowDimensionsAfterSettingViewportContent("width=150, min-device-width=0"); >- await logWindowDimensionsAfterSettingViewportContent("width=device-width, min-device-width=0"); >- scaleAtDeviceWidthForMinDeviceWidth0 = parseFloat(await UIHelper.zoomScale()).toFixed(3); >- await logWindowDimensionsAfterSettingViewportContent("width=600, min-device-width=0"); >+ 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. min-device-width=500"); >- await logWindowDimensionsAfterSettingViewportContent("width=150, min-device-width=500"); >- await logWindowDimensionsAfterSettingViewportContent("width=device-width, min-device-width=500"); >- scaleAtDeviceWidthForMinDeviceWidth500 = parseFloat(await UIHelper.zoomScale()).toFixed(3); >- await logWindowDimensionsAfterSettingViewportContent("width=600, min-device-width=500"); >+ 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("scaleAtDeviceWidthForInitialMinDeviceWidth", "'0.488'"); >- shouldBe("scaleAtDeviceWidthForMinDeviceWidth0", "'1.000'"); >- shouldBe("scaleAtDeviceWidthForMinDeviceWidth500", "'0.312'"); >+ shouldBe("scaleAtDeviceWidthWithInitialShrinkToFit", "'0.488'"); >+ shouldBe("scaleAtDeviceWidthWithShrinkToFitDisabled", "'1.000'"); >+ shouldBe("scaleAtDeviceWidthWithShrinkToFitEnabled", "'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 185132
:
339111
| 339117