From: simon.fraser@apple.com Date: Wed, 29 Nov 2017 18:59:39 +0000 (+0000) Subject: Viewport unit values affected by Comand-+ zoom X-Git-Url: http://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=20d1177ef8cff8627c51be30cd7570b04d1b77c0 Viewport unit values affected by Comand-+ zoom https://bugs.webkit.org/show_bug.cgi?id=145614 Reviewed by Zalan Bujtas. Source/WebCore: Don't apply zooming when resolving viewport-relative lengths, since they should not change based on the zoom level. Test: fast/css/viewport-units-zoom.html * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble): Tools: Fix Command+ and Command- in MiniBrowser to do zooming, rather than being tied to editing commands. * MiniBrowser/mac/MainMenu.xib: LayoutTests: * fast/css/viewport-units-zoom-expected.html: Added. * fast/css/viewport-units-zoom.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225277 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 884a60f..d50804c 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,13 @@ +2017-11-29 Simon Fraser + + Viewport unit values affected by Comand-+ zoom + https://bugs.webkit.org/show_bug.cgi?id=145614 + + Reviewed by Zalan Bujtas. + + * fast/css/viewport-units-zoom-expected.html: Added. + * fast/css/viewport-units-zoom.html: Added. + 2017-11-29 Ms2ger Enable imported/w3c/web-platform-tests/resource-timing/single-entry-per-resource.html. diff --git a/LayoutTests/fast/css/viewport-units-zoom-expected.html b/LayoutTests/fast/css/viewport-units-zoom-expected.html new file mode 100644 index 0000000..f6bd46d --- /dev/null +++ b/LayoutTests/fast/css/viewport-units-zoom-expected.html @@ -0,0 +1,25 @@ + + + + + + + +

Both boxes should be the same width.

+
+
+ + diff --git a/LayoutTests/fast/css/viewport-units-zoom.html b/LayoutTests/fast/css/viewport-units-zoom.html new file mode 100644 index 0000000..0b38ba8 --- /dev/null +++ b/LayoutTests/fast/css/viewport-units-zoom.html @@ -0,0 +1,25 @@ + + + + + + + +

Both boxes should be the same width.

+
+
+ + diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index efd29b2..3066157 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,18 @@ +2017-11-29 Simon Fraser + + Viewport unit values affected by Comand-+ zoom + https://bugs.webkit.org/show_bug.cgi?id=145614 + + Reviewed by Zalan Bujtas. + + Don't apply zooming when resolving viewport-relative lengths, since they should not + change based on the zoom level. + + Test: fast/css/viewport-units-zoom.html + + * css/CSSPrimitiveValue.cpp: + (WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble): + 2017-11-29 Brent Fulgham Unreviewed test fix after r225264. diff --git a/Source/WebCore/css/CSSPrimitiveValue.cpp b/Source/WebCore/css/CSSPrimitiveValue.cpp index 9c3e690..a761276 100644 --- a/Source/WebCore/css/CSSPrimitiveValue.cpp +++ b/Source/WebCore/css/CSSPrimitiveValue.cpp @@ -640,6 +640,7 @@ double CSSPrimitiveValue::computeLengthDouble(const CSSToLengthConversionData& c double CSSPrimitiveValue::computeNonCalcLengthDouble(const CSSToLengthConversionData& conversionData, UnitType primitiveType, double value) { double factor; + bool applyZoom = true; switch (primitiveType) { case CSS_EMS: @@ -692,15 +693,19 @@ double CSSPrimitiveValue::computeNonCalcLengthDouble(const CSSToLengthConversion return -1.0; case CSS_VH: factor = conversionData.viewportHeightFactor(); + applyZoom = false; break; case CSS_VW: factor = conversionData.viewportWidthFactor(); + applyZoom = false; break; case CSS_VMAX: factor = conversionData.viewportMaxFactor(); + applyZoom = false; break; case CSS_VMIN: factor = conversionData.viewportMinFactor(); + applyZoom = false; break; default: ASSERT_NOT_REACHED(); @@ -714,7 +719,10 @@ double CSSPrimitiveValue::computeNonCalcLengthDouble(const CSSToLengthConversion if (conversionData.computingFontSize() || isFontRelativeLength(primitiveType)) return result; - return result * conversionData.zoom(); + if (applyZoom) + result *= conversionData.zoom(); + + return result; } ExceptionOr CSSPrimitiveValue::setFloatValue(unsigned short, double) diff --git a/Tools/ChangeLog b/Tools/ChangeLog index b30c83c..1027017 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,3 +1,15 @@ +2017-11-29 Simon Fraser + + Viewport unit values affected by Comand-+ zoom + https://bugs.webkit.org/show_bug.cgi?id=145614 + + Reviewed by Zalan Bujtas. + + Fix Command+ and Command- in MiniBrowser to do zooming, rather than being tied + to editing commands. + + * MiniBrowser/mac/MainMenu.xib: + 2017-11-29 Alex Christensen Add test for _WKVisitedLinkStore.addVisitedLinkWithString diff --git a/Tools/MiniBrowser/mac/MainMenu.xib b/Tools/MiniBrowser/mac/MainMenu.xib index 3fe2a1d..0ae3716 100644 --- a/Tools/MiniBrowser/mac/MainMenu.xib +++ b/Tools/MiniBrowser/mac/MainMenu.xib @@ -1,8 +1,7 @@ - + - - + @@ -396,12 +395,14 @@ - + + - + +