<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[225277] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/225277">225277</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2017-11-29 10:59:39 -0800 (Wed, 29 Nov 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>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.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSPrimitiveValuecpp">trunk/Source/WebCore/css/CSSPrimitiveValue.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsMiniBrowsermacMainMenuxib">trunk/Tools/MiniBrowser/mac/MainMenu.xib</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssviewportunitszoomexpectedhtml">trunk/LayoutTests/fast/css/viewport-units-zoom-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssviewportunitszoomhtml">trunk/LayoutTests/fast/css/viewport-units-zoom.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (225276 => 225277)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2017-11-29 18:59:01 UTC (rev 225276)
+++ trunk/LayoutTests/ChangeLog 2017-11-29 18:59:39 UTC (rev 225277)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2017-11-29  Simon Fraser  <simon.fraser@apple.com>
+
+        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.
+
</ins><span class="cx"> 2017-11-29  Ms2ger  <Ms2ger@igalia.com>
</span><span class="cx"> 
</span><span class="cx">         Enable imported/w3c/web-platform-tests/resource-timing/single-entry-per-resource.html.
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssviewportunitszoomexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/viewport-units-zoom-expected.html (0 => 225277)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/viewport-units-zoom-expected.html                             (rev 0)
+++ trunk/LayoutTests/fast/css/viewport-units-zoom-expected.html        2017-11-29 18:59:39 UTC (rev 225277)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        body {
+            margin: 0;
+        }
+        .box {
+            background-color: green;
+            margin-top: 10px;
+        }
+        
+        .width {
+            width: 50vw;
+            height: 100px;
+        }
+    </style>
+</head>
+<body>
+<p>Both boxes should be the same width.</p>
+<div class="box width"></div>
+<div class="box width" style="height: 200px; margin-top: 20px"></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssviewportunitszoomhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/viewport-units-zoom.html (0 => 225277)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/viewport-units-zoom.html                              (rev 0)
+++ trunk/LayoutTests/fast/css/viewport-units-zoom.html 2017-11-29 18:59:39 UTC (rev 225277)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        body {
+            margin: 0;
+        }
+        .box {
+            background-color: green;
+            margin-top: 10px;
+        }
+        
+        .width {
+            width: 50vw;
+            height: 100px;
+        }
+    </style>
+</head>
+<body>
+<p>Both boxes should be the same width.</p>
+<div class="box width"></div>
+<div class="box width" style="zoom:2"></div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (225276 => 225277)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2017-11-29 18:59:01 UTC (rev 225276)
+++ trunk/Source/WebCore/ChangeLog      2017-11-29 18:59:39 UTC (rev 225277)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2017-11-29  Simon Fraser  <simon.fraser@apple.com>
+
+        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):
+
</ins><span class="cx"> 2017-11-29  Brent Fulgham  <bfulgham@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Unreviewed test fix after r225264.
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.cpp (225276 => 225277)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValue.cpp   2017-11-29 18:59:01 UTC (rev 225276)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.cpp      2017-11-29 18:59:39 UTC (rev 225277)
</span><span class="lines">@@ -640,6 +640,7 @@
</span><span class="cx"> double CSSPrimitiveValue::computeNonCalcLengthDouble(const CSSToLengthConversionData& conversionData, UnitType primitiveType, double value)
</span><span class="cx"> {
</span><span class="cx">     double factor;
</span><ins>+    bool applyZoom = true;
</ins><span class="cx"> 
</span><span class="cx">     switch (primitiveType) {
</span><span class="cx">     case CSS_EMS:
</span><span class="lines">@@ -692,15 +693,19 @@
</span><span class="cx">         return -1.0;
</span><span class="cx">     case CSS_VH:
</span><span class="cx">         factor = conversionData.viewportHeightFactor();
</span><ins>+        applyZoom = false;
</ins><span class="cx">         break;
</span><span class="cx">     case CSS_VW:
</span><span class="cx">         factor = conversionData.viewportWidthFactor();
</span><ins>+        applyZoom = false;
</ins><span class="cx">         break;
</span><span class="cx">     case CSS_VMAX:
</span><span class="cx">         factor = conversionData.viewportMaxFactor();
</span><ins>+        applyZoom = false;
</ins><span class="cx">         break;
</span><span class="cx">     case CSS_VMIN:
</span><span class="cx">         factor = conversionData.viewportMinFactor();
</span><ins>+        applyZoom = false;
</ins><span class="cx">         break;
</span><span class="cx">     default:
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="lines">@@ -714,7 +719,10 @@
</span><span class="cx">     if (conversionData.computingFontSize() || isFontRelativeLength(primitiveType))
</span><span class="cx">         return result;
</span><span class="cx"> 
</span><del>-    return result * conversionData.zoom();
</del><ins>+    if (applyZoom)
+        result *= conversionData.zoom();
+
+    return result;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr<void> CSSPrimitiveValue::setFloatValue(unsigned short, double)
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (225276 => 225277)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2017-11-29 18:59:01 UTC (rev 225276)
+++ trunk/Tools/ChangeLog       2017-11-29 18:59:39 UTC (rev 225277)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2017-11-29  Simon Fraser  <simon.fraser@apple.com>
+
+        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:
+
</ins><span class="cx"> 2017-11-29  Alex Christensen  <achristensen@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         Add test for _WKVisitedLinkStore.addVisitedLinkWithString
</span></span></pre></div>
<a id="trunkToolsMiniBrowsermacMainMenuxib"></a>
<div class="modfile"><h4>Modified: trunk/Tools/MiniBrowser/mac/MainMenu.xib (225276 => 225277)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/MiniBrowser/mac/MainMenu.xib 2017-11-29 18:59:01 UTC (rev 225276)
+++ trunk/Tools/MiniBrowser/mac/MainMenu.xib    2017-11-29 18:59:39 UTC (rev 225277)
</span><span class="lines">@@ -1,8 +1,7 @@
</span><span class="cx"> <?xml version="1.0" encoding="UTF-8"?>
</span><del>-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11521.1" systemVersion="16B2648a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
</del><ins>+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13168.4" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
</ins><span class="cx">     <dependencies>
</span><del>-        <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11521.1"/>
</del><ins>+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13168.4"/>
</ins><span class="cx">     </dependencies>
</span><span class="cx">     <objects>
</span><span class="cx">         <customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
</span><span class="lines">@@ -396,12 +395,14 @@
</span><span class="cx">                                             </connections>
</span><span class="cx">                                         </menuItem>
</span><span class="cx">                                         <menuItem isSeparatorItem="YES" id="dKY-wH-ZAW"/>
</span><del>-                                        <menuItem title="Bigger" tag="3" keyEquivalent="+" id="V0U-mA-5AK">
</del><ins>+                                        <menuItem title="Bigger" tag="3" id="V0U-mA-5AK">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
</ins><span class="cx">                                             <connections>
</span><span class="cx">                                                 <action selector="modifyFont:" target="420" id="hmF-PZ-vVH"/>
</span><span class="cx">                                             </connections>
</span><span class="cx">                                         </menuItem>
</span><del>-                                        <menuItem title="Smaller" tag="4" keyEquivalent="-" id="hWP-7f-ZV3">
</del><ins>+                                        <menuItem title="Smaller" tag="4" id="hWP-7f-ZV3">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
</ins><span class="cx">                                             <connections>
</span><span class="cx">                                                 <action selector="modifyFont:" target="420" id="pnr-Yn-h6p"/>
</span><span class="cx">                                             </connections>
</span></span></pre>
</div>
</div>

</body>
</html>