<!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>[259703] 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/259703">259703</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2020-04-07 21:45:45 -0700 (Tue, 07 Apr 2020)</dd>
</dl>

<h3>Log Message</h3>
<pre>[css-values-4] Support font-relative lh and rlh unit
https://bugs.webkit.org/show_bug.cgi?id=195180

Patch by Tyler Wilcock <twilco.o@protonmail.com> on 2020-04-07
Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Pass all 'lh' and 'rlh' tests, minus the '2rlh in font-size on root' test which may be a bug in the test itself: https://github.com/web-platform-tests/wpt/issues/22055

* web-platform-tests/css/css-values/lh-rlh-on-root-001-expected.txt:

Source/WebCore:

Implement support for 'lh' and 'rlh' units.
https://www.w3.org/TR/css-values-4/#font-relative-lengths

* css/CSSCalculationValue.cpp:
(WebCore::calcUnitCategory):
(WebCore::calculationCategoryForCombination):
(WebCore::hasDoubleValue):
* css/CSSGradientValue.cpp:
(WebCore::CSSLinearGradientValue::createGradient):
(WebCore::CSSRadialGradientValue::createGradient):
(WebCore::CSSConicGradientValue::createGradient):
* css/CSSPrimitiveValue.cpp:
(WebCore::isValidCSSUnitTypeForDoubleConversion):
(WebCore::isStringType):
(WebCore::CSSPrimitiveValue::cleanup):
(WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble):
(WebCore::CSSPrimitiveValue::unitTypeString):
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const):
(WebCore::CSSPrimitiveValue::equals const):
(WebCore::CSSPrimitiveValue::collectDirectComputationalDependencies const):
(WebCore::CSSPrimitiveValue::collectDirectRootComputationalDependencies const):
* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::isFontRelativeLength):
(WebCore::CSSPrimitiveValue::isLength):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::convertingToLengthRequiresNonNullStyle const):
* css/CSSToLengthConversionData.cpp:
(WebCore::CSSToLengthConversionData::viewportWidthFactor const):
(WebCore::CSSToLengthConversionData::viewportHeightFactor const):
(WebCore::CSSToLengthConversionData::viewportMinFactor const):
(WebCore::CSSToLengthConversionData::viewportMaxFactor const):
* css/CSSToLengthConversionData.h: Replace bool 'm_computingFontSize' with Optional<CSSPropertyID> that indicates the property being computed, where none means the property being computed is unknown or unimportant to know.
(WebCore::CSSToLengthConversionData::CSSToLengthConversionData): Add 'parentStyle' parameter, necessary for calculating lh/rlh unit values.
(WebCore::CSSToLengthConversionData::parentStyle const):
(WebCore::CSSToLengthConversionData::computingFontSize const):
(WebCore::CSSToLengthConversionData::computingLineHeight const):
(WebCore::CSSToLengthConversionData::copyWithAdjustedZoom const):
(WebCore::CSSToLengthConversionData::copyWithAdjustedZoomAndPropertyToCompute const):
* css/CSSUnits.cpp:
(WebCore::operator<<):
* css/CSSUnits.h:
* css/MediaQueryEvaluator.cpp:
(WebCore::MediaQueryEvaluator::evaluate const):
* css/parser/CSSParserToken.cpp:
(WebCore::cssPrimitiveValueUnitFromTrie):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeLength):
* css/parser/SizesAttributeParser.cpp:
(WebCore::SizesAttributeParser::computeLength):
(WebCore::SizesAttributeParser::effectiveSizeDefaultValue):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerElement::resolveCustomStyle):
* rendering/RenderElement.h:
(WebCore::RenderElement::parentStyle const):
* rendering/RenderThemeIOS.mm:
(WebCore::applyCommonButtonPaddingToStyle):
(WebCore::RenderThemeIOS::adjustButtonStyle const):
* rendering/style/RenderStyle.cpp: Extract 'computedLineHeight' behavior into separate 'computeLineHeight' function so logic can be reused elsewhere.
(WebCore::RenderStyle::computedLineHeight const):
(WebCore::RenderStyle::computeLineHeight const):
* rendering/style/RenderStyle.h:
* style/StyleBuilderConverter.h: Extract zoom calculation logic out of 'csstoLengthConversionDataWithTextZoomFactor' into separate 'zoomWithTextZoomFactor' function so logic can be reused elsewhere.
(WebCore::Style::zoomWithTextZoomFactor):
(WebCore::Style::BuilderConverter::csstoLengthConversionDataWithTextZoomFactor):
(WebCore::Style::BuilderConverter::convertLineHeight):
* style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueFontSize):
* style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::BuilderState):

LayoutTests:

Implement support for the font-relative 'lh' and 'rlh' units.
https://www.w3.org/TR/css-values-4/#font-relative-lengths</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssvalueslhrlhonroot001expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-values/lh-rlh-on-root-001-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiosimportedw3cwebplatformtestscsscssvalueslhrlhonroot001expectedtxt">trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-values/lh-rlh-on-root-001-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSCalculationValuecpp">trunk/Source/WebCore/css/CSSCalculationValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSGradientValuecpp">trunk/Source/WebCore/css/CSSGradientValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSPrimitiveValuecpp">trunk/Source/WebCore/css/CSSPrimitiveValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSPrimitiveValueh">trunk/Source/WebCore/css/CSSPrimitiveValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSPrimitiveValueMappingsh">trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSToLengthConversionDatacpp">trunk/Source/WebCore/css/CSSToLengthConversionData.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSToLengthConversionDatah">trunk/Source/WebCore/css/CSSToLengthConversionData.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSUnitscpp">trunk/Source/WebCore/css/CSSUnits.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSUnitsh">trunk/Source/WebCore/css/CSSUnits.h</a></li>
<li><a href="#trunkSourceWebCorecssMediaQueryEvaluatorcpp">trunk/Source/WebCore/css/MediaQueryEvaluator.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserTokencpp">trunk/Source/WebCore/css/parser/CSSParserToken.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSPropertyParserHelperscpp">trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserSizesAttributeParsercpp">trunk/Source/WebCore/css/parser/SizesAttributeParser.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlshadowTextControlInnerElementscpp">trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementh">trunk/Source/WebCore/rendering/RenderElement.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeIOSmm">trunk/Source/WebCore/rendering/RenderThemeIOS.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStylecpp">trunk/Source/WebCore/rendering/style/RenderStyle.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleh">trunk/Source/WebCore/rendering/style/RenderStyle.h</a></li>
<li><a href="#trunkSourceWebCorestyleStyleBuilderConverterh">trunk/Source/WebCore/style/StyleBuilderConverter.h</a></li>
<li><a href="#trunkSourceWebCorestyleStyleBuilderCustomh">trunk/Source/WebCore/style/StyleBuilderCustom.h</a></li>
<li><a href="#trunkSourceWebCorestyleStyleBuilderStatecpp">trunk/Source/WebCore/style/StyleBuilderState.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/LayoutTests/ChangeLog 2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2020-04-07  Tyler Wilcock  <twilco.o@protonmail.com>
+
+        [css-values-4] Support font-relative lh and rlh unit
+        https://bugs.webkit.org/show_bug.cgi?id=195180
+
+        Reviewed by Antti Koivisto.
+
+        Implement support for the font-relative 'lh' and 'rlh' units.
+        https://www.w3.org/TR/css-values-4/#font-relative-lengths
+
</ins><span class="cx"> 2020-04-07  Ryan Haddad  <ryanhaddad@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [iOS] webrtc/h265.html is consistently timing out
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations       2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/LayoutTests/TestExpectations  2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -3104,8 +3104,8 @@
</span><span class="cx"> webkit.org/b/203334 imported/w3c/web-platform-tests/css/css-values/ic-unit-010.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/203334 imported/w3c/web-platform-tests/css/css-values/ic-unit-011.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/203334 imported/w3c/web-platform-tests/css/css-values/ic-unit-012.html [ ImageOnlyFailure ]
</span><del>-webkit.org/b/203336 imported/w3c/web-platform-tests/css/css-values/lh-unit-001.html [ ImageOnlyFailure ]
-webkit.org/b/203336 imported/w3c/web-platform-tests/css/css-values/lh-unit-002.html [ ImageOnlyFailure ]
</del><ins>+webkit.org/b/203336 imported/w3c/web-platform-tests/css/css-values/lh-unit-001.html [ Pass ]
+webkit.org/b/203336 imported/w3c/web-platform-tests/css/css-values/lh-unit-002.html [ Pass ]
</ins><span class="cx"> webkit.org/b/203337 imported/w3c/web-platform-tests/css/css-values/vh-support-atviewport.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/203338 imported/w3c/web-platform-tests/css/css-values/vh_not_refreshing_on_chrome.html [ ImageOnlyFailure ]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog 2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/LayoutTests/imported/w3c/ChangeLog    2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2020-04-07  Tyler Wilcock  <twilco.o@protonmail.com>
+
+        [css-values-4] Support font-relative lh and rlh unit
+        https://bugs.webkit.org/show_bug.cgi?id=195180
+
+        Reviewed by Antti Koivisto.
+
+        Pass all 'lh' and 'rlh' tests, minus the '2rlh in font-size on root' test which may be a bug in the test itself: https://github.com/web-platform-tests/wpt/issues/22055
+
+        * web-platform-tests/css/css-values/lh-rlh-on-root-001-expected.txt:
+
</ins><span class="cx"> 2020-04-07  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         documentFragment.getElementById() should not work for empty-string IDs
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssvalueslhrlhonroot001expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-values/lh-rlh-on-root-001-expected.txt (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-values/lh-rlh-on-root-001-expected.txt 2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-values/lh-rlh-on-root-001-expected.txt    2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -1,11 +1,11 @@
</span><span class="cx">  
</span><span class="cx"> 
</span><del>-FAIL lh in line-height on root assert_approx_equals: the lh unit on the root element's line-height property uses font metrics corresponding to the initial values of the font or line-height properties expected 18 +/- 1 but got 164
-FAIL rlh in line-height on root assert_approx_equals: the rlh unit on the root element's line-height property uses font metrics corresponding to the initial values of the font or line-height properties expected 18 +/- 1 but got 164
-FAIL lh in font-size on root assert_approx_equals: the lh unit on the root element's font-size property uses font metrics corresponding to the initial values of the font or line-height properties expected 18 +/- 1 but got 16
-FAIL rlh in font-size on root assert_approx_equals: the rlh unit on the root element's font-size property uses font metrics corresponding to the initial values of the font or line-height properties expected 18 +/- 1 but got 16
-FAIL 2lh in line-height on root assert_approx_equals: the lh unit on the root element's line-height property actually works as a unit and doesn't merely cause a fallback that doesn't take the number of units into account expected 36 +/- 1 but got 164
-FAIL 2rlh in line-height on root assert_approx_equals: the rlh unit on the root element's line-height property actually works as a unit and doesn't merely cause a fallback that doesn't take the number of units into account expected 36 +/- 1 but got 164
-FAIL 2lh in font-size on root assert_approx_equals: the lh unit on the root element's font-size property actually works as a unit and doesn't merely cause a fallback that doesn't take the number of units into account expected 36 +/- 1 but got 16
-FAIL 2rlh in font-size on root assert_approx_equals: the rlh unit on the root element's font-size property actually works as a unit and doesn't merely cause a fallback that doesn't take the number of units into account expected 32 +/- 1 but got 16
</del><ins>+PASS lh in line-height on root 
+PASS rlh in line-height on root 
+PASS lh in font-size on root 
+PASS rlh in font-size on root 
+PASS 2lh in line-height on root 
+PASS 2rlh in line-height on root 
+PASS 2lh in font-size on root 
+FAIL 2rlh in font-size on root assert_approx_equals: the rlh unit on the root element's font-size property actually works as a unit and doesn't merely cause a fallback that doesn't take the number of units into account expected 32 +/- 1 but got 36
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiosimportedw3cwebplatformtestscsscssvalueslhrlhonroot001expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-values/lh-rlh-on-root-001-expected.txt (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-values/lh-rlh-on-root-001-expected.txt    2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-values/lh-rlh-on-root-001-expected.txt       2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -1,11 +1,11 @@
</span><span class="cx">  
</span><span class="cx"> 
</span><del>-FAIL lh in line-height on root assert_approx_equals: the lh unit on the root element's line-height property uses font metrics corresponding to the initial values of the font or line-height properties expected 20 +/- 1 but got 165
-FAIL rlh in line-height on root assert_approx_equals: the rlh unit on the root element's line-height property uses font metrics corresponding to the initial values of the font or line-height properties expected 20 +/- 1 but got 165
-FAIL lh in font-size on root assert_approx_equals: the lh unit on the root element's font-size property uses font metrics corresponding to the initial values of the font or line-height properties expected 20 +/- 1 but got 16
-FAIL rlh in font-size on root assert_approx_equals: the rlh unit on the root element's font-size property uses font metrics corresponding to the initial values of the font or line-height properties expected 20 +/- 1 but got 16
-FAIL 2lh in line-height on root assert_approx_equals: the lh unit on the root element's line-height property actually works as a unit and doesn't merely cause a fallback that doesn't take the number of units into account expected 40 +/- 1 but got 165
-FAIL 2rlh in line-height on root assert_approx_equals: the rlh unit on the root element's line-height property actually works as a unit and doesn't merely cause a fallback that doesn't take the number of units into account expected 40 +/- 1 but got 165
-FAIL 2lh in font-size on root assert_approx_equals: the lh unit on the root element's font-size property actually works as a unit and doesn't merely cause a fallback that doesn't take the number of units into account expected 40 +/- 1 but got 16
-FAIL 2rlh in font-size on root assert_approx_equals: the rlh unit on the root element's font-size property actually works as a unit and doesn't merely cause a fallback that doesn't take the number of units into account expected 32 +/- 1 but got 16
</del><ins>+PASS lh in line-height on root 
+PASS rlh in line-height on root 
+PASS lh in font-size on root 
+PASS rlh in font-size on root 
+PASS 2lh in line-height on root 
+PASS 2rlh in line-height on root 
+PASS 2lh in font-size on root 
+FAIL 2rlh in font-size on root assert_approx_equals: the rlh unit on the root element's font-size property actually works as a unit and doesn't merely cause a fallback that doesn't take the number of units into account expected 32 +/- 1 but got 40
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/ChangeLog      2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -1,3 +1,80 @@
</span><ins>+2020-04-07  Tyler Wilcock  <twilco.o@protonmail.com>
+
+        [css-values-4] Support font-relative lh and rlh unit
+        https://bugs.webkit.org/show_bug.cgi?id=195180
+
+        Reviewed by Antti Koivisto.
+
+        Implement support for 'lh' and 'rlh' units.
+        https://www.w3.org/TR/css-values-4/#font-relative-lengths
+
+        * css/CSSCalculationValue.cpp:
+        (WebCore::calcUnitCategory):
+        (WebCore::calculationCategoryForCombination):
+        (WebCore::hasDoubleValue):
+        * css/CSSGradientValue.cpp:
+        (WebCore::CSSLinearGradientValue::createGradient):
+        (WebCore::CSSRadialGradientValue::createGradient):
+        (WebCore::CSSConicGradientValue::createGradient):
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::isValidCSSUnitTypeForDoubleConversion):
+        (WebCore::isStringType):
+        (WebCore::CSSPrimitiveValue::cleanup):
+        (WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble):
+        (WebCore::CSSPrimitiveValue::unitTypeString):
+        (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const):
+        (WebCore::CSSPrimitiveValue::equals const):
+        (WebCore::CSSPrimitiveValue::collectDirectComputationalDependencies const):
+        (WebCore::CSSPrimitiveValue::collectDirectRootComputationalDependencies const):
+        * css/CSSPrimitiveValue.h:
+        (WebCore::CSSPrimitiveValue::isFontRelativeLength):
+        (WebCore::CSSPrimitiveValue::isLength):
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::convertingToLengthRequiresNonNullStyle const):
+        * css/CSSToLengthConversionData.cpp:
+        (WebCore::CSSToLengthConversionData::viewportWidthFactor const):
+        (WebCore::CSSToLengthConversionData::viewportHeightFactor const):
+        (WebCore::CSSToLengthConversionData::viewportMinFactor const):
+        (WebCore::CSSToLengthConversionData::viewportMaxFactor const):
+        * css/CSSToLengthConversionData.h: Replace bool 'm_computingFontSize' with Optional<CSSPropertyID> that indicates the property being computed, where none means the property being computed is unknown or unimportant to know.
+        (WebCore::CSSToLengthConversionData::CSSToLengthConversionData): Add 'parentStyle' parameter, necessary for calculating lh/rlh unit values.
+        (WebCore::CSSToLengthConversionData::parentStyle const):
+        (WebCore::CSSToLengthConversionData::computingFontSize const):
+        (WebCore::CSSToLengthConversionData::computingLineHeight const):
+        (WebCore::CSSToLengthConversionData::copyWithAdjustedZoom const):
+        (WebCore::CSSToLengthConversionData::copyWithAdjustedZoomAndPropertyToCompute const):
+        * css/CSSUnits.cpp:
+        (WebCore::operator<<):
+        * css/CSSUnits.h:
+        * css/MediaQueryEvaluator.cpp:
+        (WebCore::MediaQueryEvaluator::evaluate const):
+        * css/parser/CSSParserToken.cpp:
+        (WebCore::cssPrimitiveValueUnitFromTrie):
+        * css/parser/CSSPropertyParserHelpers.cpp:
+        (WebCore::CSSPropertyParserHelpers::consumeLength):
+        * css/parser/SizesAttributeParser.cpp:
+        (WebCore::SizesAttributeParser::computeLength):
+        (WebCore::SizesAttributeParser::effectiveSizeDefaultValue):
+        * html/shadow/TextControlInnerElements.cpp:
+        (WebCore::TextControlInnerElement::resolveCustomStyle):
+        * rendering/RenderElement.h:
+        (WebCore::RenderElement::parentStyle const):
+        * rendering/RenderThemeIOS.mm:
+        (WebCore::applyCommonButtonPaddingToStyle):
+        (WebCore::RenderThemeIOS::adjustButtonStyle const):
+        * rendering/style/RenderStyle.cpp: Extract 'computedLineHeight' behavior into separate 'computeLineHeight' function so logic can be reused elsewhere.
+        (WebCore::RenderStyle::computedLineHeight const):
+        (WebCore::RenderStyle::computeLineHeight const):
+        * rendering/style/RenderStyle.h:
+        * style/StyleBuilderConverter.h: Extract zoom calculation logic out of 'csstoLengthConversionDataWithTextZoomFactor' into separate 'zoomWithTextZoomFactor' function so logic can be reused elsewhere.
+        (WebCore::Style::zoomWithTextZoomFactor):
+        (WebCore::Style::BuilderConverter::csstoLengthConversionDataWithTextZoomFactor):
+        (WebCore::Style::BuilderConverter::convertLineHeight):
+        * style/StyleBuilderCustom.h:
+        (WebCore::Style::BuilderCustom::applyValueFontSize):
+        * style/StyleBuilderState.cpp:
+        (WebCore::Style::BuilderState::BuilderState):
+
</ins><span class="cx"> 2020-04-07  Zalan Bujtas  <zalan@apple.com>
</span><span class="cx"> 
</span><span class="cx">         fastclick.com: A Gradient banner is missing
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSCalculationValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSCalculationValue.cpp (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSCalculationValue.cpp 2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/css/CSSCalculationValue.cpp    2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -80,6 +80,8 @@
</span><span class="cx">     case CSSUnitType::CSS_PT:
</span><span class="cx">     case CSSUnitType::CSS_PC:
</span><span class="cx">     case CSSUnitType::CSS_Q:
</span><ins>+    case CSSUnitType::CSS_LHS:
+    case CSSUnitType::CSS_RLHS:
</ins><span class="cx">     case CSSUnitType::CSS_REMS:
</span><span class="cx">     case CSSUnitType::CSS_CHS:
</span><span class="cx">     case CSSUnitType::CSS_VW:
</span><span class="lines">@@ -133,7 +135,9 @@
</span><span class="cx">         return CalculationCategory::Frequency;
</span><span class="cx">     case CSSUnitType::CSS_EMS:
</span><span class="cx">     case CSSUnitType::CSS_EXS:
</span><ins>+    case CSSUnitType::CSS_LHS:
</ins><span class="cx">     case CSSUnitType::CSS_REMS:
</span><ins>+    case CSSUnitType::CSS_RLHS:
</ins><span class="cx">     case CSSUnitType::CSS_CHS:
</span><span class="cx">     case CSSUnitType::CSS_VW:
</span><span class="cx">     case CSSUnitType::CSS_VH:
</span><span class="lines">@@ -195,6 +199,8 @@
</span><span class="cx">     case CSSUnitType::CSS_DPCM:
</span><span class="cx">     case CSSUnitType::CSS_FR:
</span><span class="cx">     case CSSUnitType::CSS_Q:
</span><ins>+    case CSSUnitType::CSS_LHS:
+    case CSSUnitType::CSS_RLHS:
</ins><span class="cx">         return true;
</span><span class="cx">     case CSSUnitType::CSS_UNKNOWN:
</span><span class="cx">     case CSSUnitType::CSS_STRING:
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSGradientValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGradientValue.cpp (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSGradientValue.cpp    2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/css/CSSGradientValue.cpp       2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -807,7 +807,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!size.isEmpty());
</span><span class="cx"> 
</span><del>-    CSSToLengthConversionData conversionData(&renderer.style(), renderer.document().documentElement()->renderStyle(), &renderer.view());
</del><ins>+    CSSToLengthConversionData conversionData(&renderer.style(), renderer.document().documentElement()->renderStyle(), renderer.parentStyle(), &renderer.view());
</ins><span class="cx"> 
</span><span class="cx">     FloatPoint firstPoint;
</span><span class="cx">     FloatPoint secondPoint;
</span><span class="lines">@@ -1056,7 +1056,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!size.isEmpty());
</span><span class="cx"> 
</span><del>-    CSSToLengthConversionData conversionData(&renderer.style(), renderer.document().documentElement()->renderStyle(), &renderer.view());
</del><ins>+    CSSToLengthConversionData conversionData(&renderer.style(), renderer.document().documentElement()->renderStyle(), renderer.parentStyle(), &renderer.view());
</ins><span class="cx"> 
</span><span class="cx">     FloatPoint firstPoint = computeEndPoint(firstX(), firstY(), conversionData, size);
</span><span class="cx">     if (!firstX())
</span><span class="lines">@@ -1247,7 +1247,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!size.isEmpty());
</span><span class="cx"> 
</span><del>-    CSSToLengthConversionData conversionData(&renderer.style(), renderer.document().documentElement()->renderStyle(), &renderer.view());
</del><ins>+    CSSToLengthConversionData conversionData(&renderer.style(), renderer.document().documentElement()->renderStyle(), renderer.parentStyle(), &renderer.view());
</ins><span class="cx"> 
</span><span class="cx">     FloatPoint centerPoint = computeEndPoint(firstX(), firstY(), conversionData, size);
</span><span class="cx">     if (!firstX())
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.cpp (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValue.cpp   2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.cpp      2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -71,6 +71,8 @@
</span><span class="cx">     case CSSUnitType::CSS_PT:
</span><span class="cx">     case CSSUnitType::CSS_PX:
</span><span class="cx">     case CSSUnitType::CSS_Q:
</span><ins>+    case CSSUnitType::CSS_LHS:
+    case CSSUnitType::CSS_RLHS:
</ins><span class="cx">     case CSSUnitType::CSS_QUIRKY_EMS:
</span><span class="cx">     case CSSUnitType::CSS_RAD:
</span><span class="cx">     case CSSUnitType::CSS_REMS:
</span><span class="lines">@@ -147,6 +149,8 @@
</span><span class="cx">     case CSSUnitType::CSS_PT:
</span><span class="cx">     case CSSUnitType::CSS_PX:
</span><span class="cx">     case CSSUnitType::CSS_Q:
</span><ins>+    case CSSUnitType::CSS_LHS:
+    case CSSUnitType::CSS_RLHS:
</ins><span class="cx">     case CSSUnitType::CSS_QUAD:
</span><span class="cx">     case CSSUnitType::CSS_QUIRKY_EMS:
</span><span class="cx">     case CSSUnitType::CSS_RAD:
</span><span class="lines">@@ -502,6 +506,8 @@
</span><span class="cx">     case CSSUnitType::CSS_DPCM:
</span><span class="cx">     case CSSUnitType::CSS_FR:
</span><span class="cx">     case CSSUnitType::CSS_Q:
</span><ins>+    case CSSUnitType::CSS_LHS:
+    case CSSUnitType::CSS_RLHS:
</ins><span class="cx">     case CSSUnitType::CSS_IDENT:
</span><span class="cx">     case CSSUnitType::CSS_UNKNOWN:
</span><span class="cx">     case CSSUnitType::CSS_UNICODE_RANGE:
</span><span class="lines">@@ -631,6 +637,23 @@
</span><span class="cx">     case CSSUnitType::CSS_Q:
</span><span class="cx">         factor = cssPixelsPerInch / QPerInch;
</span><span class="cx">         break;
</span><ins>+    case CSSUnitType::CSS_LHS:
+        ASSERT(conversionData.style());
+        if (conversionData.computingLineHeight() || conversionData.computingFontSize()) {
+            // Try to get the parent's computed line-height, or fall back to the initial line-height of this element's font spacing.
+            factor = conversionData.parentStyle() ? conversionData.parentStyle()->computedLineHeight() : conversionData.style()->fontMetrics().lineSpacing();
+        } else
+            factor = conversionData.style()->computedLineHeight();
+        break;
+    case CSSUnitType::CSS_RLHS:
+        if (conversionData.rootStyle()) {
+            if (conversionData.computingLineHeight() || conversionData.computingFontSize())
+                factor = conversionData.rootStyle()->computeLineHeight(conversionData.rootStyle()->specifiedLineHeight());
+            else
+                factor = conversionData.rootStyle()->computedLineHeight();
+        } else
+            factor = 1.0;
+        break;
</ins><span class="cx">     case CSSUnitType::CSS_IN:
</span><span class="cx">         factor = cssPixelsPerInch;
</span><span class="cx">         break;
</span><span class="lines">@@ -925,6 +948,8 @@
</span><span class="cx">         case CSSUnitType::CSS_DPCM: return "dpcm";
</span><span class="cx">         case CSSUnitType::CSS_FR: return "fr";
</span><span class="cx">         case CSSUnitType::CSS_Q: return "q";
</span><ins>+        case CSSUnitType::CSS_LHS: return "lh";
+        case CSSUnitType::CSS_RLHS: return "rlh";
</ins><span class="cx">         case CSSUnitType::CSS_TURN: return "turn";
</span><span class="cx">         case CSSUnitType::CSS_REMS: return "rem";
</span><span class="cx">         case CSSUnitType::CSS_CHS: return "ch";
</span><span class="lines">@@ -1012,6 +1037,10 @@
</span><span class="cx">         return formatNumberValue("fr");
</span><span class="cx">     case CSSUnitType::CSS_Q:
</span><span class="cx">         return formatNumberValue("q");
</span><ins>+    case CSSUnitType::CSS_LHS:
+        return formatNumberValue("lh");
+    case CSSUnitType::CSS_RLHS:
+        return formatNumberValue("rlh");
</ins><span class="cx">     case CSSUnitType::CSS_DIMENSION:
</span><span class="cx">         // FIXME: We currently don't handle CSSUnitType::CSS_DIMENSION properly as we don't store
</span><span class="cx">         // the actual dimension, just the numeric value as a string.
</span><span class="lines">@@ -1139,6 +1168,8 @@
</span><span class="cx">     case CSSUnitType::CSS_VMAX:
</span><span class="cx">     case CSSUnitType::CSS_FR:
</span><span class="cx">     case CSSUnitType::CSS_Q:
</span><ins>+    case CSSUnitType::CSS_LHS:
+    case CSSUnitType::CSS_RLHS:
</ins><span class="cx">         return m_value.num == other.m_value.num;
</span><span class="cx">     case CSSUnitType::CSS_PROPERTY_ID:
</span><span class="cx">         return propertyName(m_value.propertyID) == propertyName(other.m_value.propertyID);
</span><span class="lines">@@ -1182,7 +1213,7 @@
</span><span class="cx">     return DeprecatedCSSOMPrimitiveValue::create(*this, styleDeclaration);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// https://drafts.css-houdini.org/css-properties-values-api/#dependency-cycles-via-relative-units
</del><ins>+// https://drafts.css-houdini.org/css-properties-values-api/#dependency-cycles
</ins><span class="cx"> void CSSPrimitiveValue::collectDirectComputationalDependencies(HashSet<CSSPropertyID>& values) const
</span><span class="cx"> {
</span><span class="cx">     switch (primitiveUnitType()) {
</span><span class="lines">@@ -1192,6 +1223,10 @@
</span><span class="cx">     case CSSUnitType::CSS_CHS:
</span><span class="cx">         values.add(CSSPropertyFontSize);
</span><span class="cx">         break;
</span><ins>+    case CSSUnitType::CSS_LHS:
+        values.add(CSSPropertyFontSize);
+        values.add(CSSPropertyLineHeight);
+        break;
</ins><span class="cx">     case CSSUnitType::CSS_CALC:
</span><span class="cx">         m_value.calc->collectDirectComputationalDependencies(values);
</span><span class="cx">         break;
</span><span class="lines">@@ -1206,6 +1241,10 @@
</span><span class="cx">     case CSSUnitType::CSS_REMS:
</span><span class="cx">         values.add(CSSPropertyFontSize);
</span><span class="cx">         break;
</span><ins>+    case CSSUnitType::CSS_RLHS:
+        values.add(CSSPropertyFontSize);
+        values.add(CSSPropertyLineHeight);
+        break;
</ins><span class="cx">     case CSSUnitType::CSS_CALC:
</span><span class="cx">         m_value.calc->collectDirectRootComputationalDependencies(values);
</span><span class="cx">         break;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.h (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValue.h     2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.h        2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -260,6 +260,8 @@
</span><span class="cx"> {
</span><span class="cx">     return type == CSSUnitType::CSS_EMS
</span><span class="cx">         || type == CSSUnitType::CSS_EXS
</span><ins>+        || type == CSSUnitType::CSS_LHS
+        || type == CSSUnitType::CSS_RLHS
</ins><span class="cx">         || type == CSSUnitType::CSS_REMS
</span><span class="cx">         || type == CSSUnitType::CSS_CHS
</span><span class="cx">         || type == CSSUnitType::CSS_QUIRKY_EMS;
</span><span class="lines">@@ -271,6 +273,8 @@
</span><span class="cx">         || type == CSSUnitType::CSS_REMS
</span><span class="cx">         || type == CSSUnitType::CSS_CHS
</span><span class="cx">         || type == CSSUnitType::CSS_Q
</span><ins>+        || type == CSSUnitType::CSS_LHS
+        || type == CSSUnitType::CSS_RLHS
</ins><span class="cx">         || isViewportPercentageLength(type)
</span><span class="cx">         || type == CSSUnitType::CSS_QUIRKY_EMS;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValueMappingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h     2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h        2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -4514,6 +4514,7 @@
</span><span class="cx">     case CSSUnitType::CSS_EMS:
</span><span class="cx">     case CSSUnitType::CSS_EXS:
</span><span class="cx">     case CSSUnitType::CSS_CHS:
</span><ins>+    case CSSUnitType::CSS_LHS:
</ins><span class="cx">         return lengthConversion & (FixedIntegerConversion | FixedFloatConversion);
</span><span class="cx">     default:
</span><span class="cx">         return false;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSToLengthConversionDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSToLengthConversionData.cpp (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSToLengthConversionData.cpp   2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/css/CSSToLengthConversionData.cpp      2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> 
</span><span class="cx"> double CSSToLengthConversionData::viewportWidthFactor() const
</span><span class="cx"> {
</span><del>-    if (m_style && !m_computingFontSize)
</del><ins>+    if (m_style && !computingFontSize())
</ins><span class="cx">         const_cast<RenderStyle*>(m_style)->setHasViewportUnits();
</span><span class="cx"> 
</span><span class="cx">     if (!m_renderView)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx"> 
</span><span class="cx"> double CSSToLengthConversionData::viewportHeightFactor() const
</span><span class="cx"> {
</span><del>-    if (m_style && !m_computingFontSize)
</del><ins>+    if (m_style && !computingFontSize())
</ins><span class="cx">         const_cast<RenderStyle*>(m_style)->setHasViewportUnits();
</span><span class="cx"> 
</span><span class="cx">     if (!m_renderView)
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx"> 
</span><span class="cx"> double CSSToLengthConversionData::viewportMinFactor() const
</span><span class="cx"> {
</span><del>-    if (m_style && !m_computingFontSize)
</del><ins>+    if (m_style && !computingFontSize())
</ins><span class="cx">         const_cast<RenderStyle*>(m_style)->setHasViewportUnits();
</span><span class="cx"> 
</span><span class="cx">     if (!m_renderView)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx"> 
</span><span class="cx"> double CSSToLengthConversionData::viewportMaxFactor() const
</span><span class="cx"> {
</span><del>-    if (m_style && !m_computingFontSize)
</del><ins>+    if (m_style && !computingFontSize())
</ins><span class="cx">         const_cast<RenderStyle*>(m_style)->setHasViewportUnits();
</span><span class="cx"> 
</span><span class="cx">     if (!m_renderView)
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSToLengthConversionDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSToLengthConversionData.h (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSToLengthConversionData.h     2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/css/CSSToLengthConversionData.h        2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -30,7 +30,9 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#include "CSSPropertyNames.h"
</ins><span class="cx"> #include <wtf/Assertions.h>
</span><ins>+#include <wtf/Optional.h>
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -39,36 +41,40 @@
</span><span class="cx"> 
</span><span class="cx"> class CSSToLengthConversionData {
</span><span class="cx"> public:
</span><del>-    CSSToLengthConversionData(const RenderStyle* style, const RenderStyle* rootStyle, const RenderView* renderView, float zoom, bool computingFontSize = false)
</del><ins>+    CSSToLengthConversionData(const RenderStyle* style, const RenderStyle* rootStyle, const RenderStyle* parentStyle, const RenderView* renderView, float zoom, Optional<CSSPropertyID> propertyToCompute = WTF::nullopt)
</ins><span class="cx">         : m_style(style)
</span><span class="cx">         , m_rootStyle(rootStyle)
</span><ins>+        , m_parentStyle(parentStyle)
</ins><span class="cx">         , m_renderView(renderView)
</span><span class="cx">         , m_zoom(zoom)
</span><span class="cx">         , m_useEffectiveZoom(false)
</span><del>-        , m_computingFontSize(computingFontSize)
</del><ins>+        , m_propertyToCompute(propertyToCompute)
</ins><span class="cx">     {
</span><span class="cx">         ASSERT(zoom > 0);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    CSSToLengthConversionData(const RenderStyle* style, const RenderStyle* rootStyle, const RenderView* renderView, bool computingFontSize = false)
</del><ins>+    CSSToLengthConversionData(const RenderStyle* style, const RenderStyle* rootStyle, const RenderStyle* parentStyle, const RenderView* renderView, Optional<CSSPropertyID> propertyToCompute = WTF::nullopt)
</ins><span class="cx">         : m_style(style)
</span><span class="cx">         , m_rootStyle(rootStyle)
</span><ins>+        , m_parentStyle(parentStyle)
</ins><span class="cx">         , m_renderView(renderView)
</span><span class="cx">         , m_zoom(1)
</span><span class="cx">         , m_useEffectiveZoom(true)
</span><del>-        , m_computingFontSize(computingFontSize)
</del><ins>+        , m_propertyToCompute(propertyToCompute)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     CSSToLengthConversionData()
</span><del>-        : CSSToLengthConversionData(nullptr, nullptr, nullptr)
</del><ins>+        : CSSToLengthConversionData(nullptr, nullptr, nullptr, nullptr)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     const RenderStyle* style() const { return m_style; }
</span><span class="cx">     const RenderStyle* rootStyle() const { return m_rootStyle; }
</span><ins>+    const RenderStyle* parentStyle() const { return m_parentStyle; }
</ins><span class="cx">     float zoom() const;
</span><del>-    bool computingFontSize() const { return m_computingFontSize; }
</del><ins>+    bool computingFontSize() const { return m_propertyToCompute == CSSPropertyFontSize; }
+    bool computingLineHeight() const { return m_propertyToCompute == CSSPropertyLineHeight; }
</ins><span class="cx"> 
</span><span class="cx">     double viewportWidthFactor() const;
</span><span class="cx">     double viewportHeightFactor() const;
</span><span class="lines">@@ -77,16 +83,22 @@
</span><span class="cx"> 
</span><span class="cx">     CSSToLengthConversionData copyWithAdjustedZoom(float newZoom) const
</span><span class="cx">     {
</span><del>-        return CSSToLengthConversionData(m_style, m_rootStyle, m_renderView, newZoom, m_computingFontSize);
</del><ins>+        return CSSToLengthConversionData(m_style, m_rootStyle, m_parentStyle, m_renderView, newZoom, m_propertyToCompute);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    CSSToLengthConversionData copyWithAdjustedZoomAndPropertyToCompute(float zoom, Optional<CSSPropertyID> propertyToCompute) const
+    {
+        return CSSToLengthConversionData(m_style, m_rootStyle, m_parentStyle, m_renderView, zoom, propertyToCompute);
+    }
+
</ins><span class="cx"> private:
</span><span class="cx">     const RenderStyle* m_style;
</span><span class="cx">     const RenderStyle* m_rootStyle;
</span><ins>+    const RenderStyle* m_parentStyle;
</ins><span class="cx">     const RenderView* m_renderView;
</span><span class="cx">     float m_zoom;
</span><span class="cx">     bool m_useEffectiveZoom;
</span><del>-    bool m_computingFontSize;
</del><ins>+    Optional<CSSPropertyID> m_propertyToCompute;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSUnitscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSUnits.cpp (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSUnits.cpp    2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/css/CSSUnits.cpp       2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -142,6 +142,8 @@
</span><span class="cx">     case CSSUnitType::CSS_DPCM: ts << "dpcm"; break;
</span><span class="cx">     case CSSUnitType::CSS_FR: ts << "fr"; break;
</span><span class="cx">     case CSSUnitType::CSS_Q: ts << "q"; break;
</span><ins>+    case CSSUnitType::CSS_LHS: ts << "lh"; break;
+    case CSSUnitType::CSS_RLHS: ts << "rlh"; break;
</ins><span class="cx">     case CSSUnitType::CSS_PAIR: ts << "pair"; break;
</span><span class="cx">     case CSSUnitType::CSS_UNICODE_RANGE: ts << "unicode_range"; break;
</span><span class="cx">     case CSSUnitType::CSS_TURN: ts << "turn"; break;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSUnitsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSUnits.h (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSUnits.h      2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/css/CSSUnits.h 2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -63,6 +63,8 @@
</span><span class="cx">     CSS_DPCM = 32,
</span><span class="cx">     CSS_FR = 33,
</span><span class="cx">     CSS_Q = 34,
</span><ins>+    CSS_LHS = 35,
+    CSS_RLHS = 36,
</ins><span class="cx">     CSS_PAIR = 100, // We envision this being exposed as a means of getting computed style values for pairs (border-spacing/radius, background-position, etc.)
</span><span class="cx">     CSS_UNICODE_RANGE = 102,
</span><span class="cx">     CSS_TURN = 107,
</span></span></pre></div>
<a id="trunkSourceWebCorecssMediaQueryEvaluatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/MediaQueryEvaluator.cpp (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/MediaQueryEvaluator.cpp 2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/css/MediaQueryEvaluator.cpp    2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -899,7 +899,9 @@
</span><span class="cx"> 
</span><span class="cx">     if (!document.documentElement())
</span><span class="cx">         return false;
</span><del>-    return function(expression.value(), { m_style, document.documentElement()->renderStyle(), document.renderView(), 1, false }, *frame, NoPrefix);
</del><ins>+    
+    // Pass `nullptr` for `parentStyle` because we are in the context of a media query.
+    return function(expression.value(), { m_style, document.documentElement()->renderStyle(), nullptr, document.renderView(), 1, WTF::nullopt }, *frame, NoPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MediaQueryEvaluator::mediaAttributeMatches(Document& document, const String& attributeValue)
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserTokencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserToken.cpp (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserToken.cpp       2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/css/parser/CSSParserToken.cpp  2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -83,6 +83,10 @@
</span><span class="cx">             if (toASCIILower(data[1]) == 'n')
</span><span class="cx">                 return CSSUnitType::CSS_IN;
</span><span class="cx">             break;
</span><ins>+        case 'l':
+            if (toASCIILower(data[1]) == 'h')
+                return CSSUnitType::CSS_LHS;
+            break;
</ins><span class="cx">         case 'm':
</span><span class="cx">             switch (toASCIILower(data[1])) {
</span><span class="cx">             case 'm':
</span><span class="lines">@@ -139,6 +143,10 @@
</span><span class="cx">                 if (toASCIILower(data[2]) == 'm')
</span><span class="cx">                     return CSSUnitType::CSS_REMS;
</span><span class="cx">                 break;
</span><ins>+            case 'l':
+                if (toASCIILower(data[2]) == 'h')
+                    return CSSUnitType::CSS_RLHS;
+                break;
</ins><span class="cx">             }
</span><span class="cx">         break;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSPropertyParserHelperscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp     2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp        2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -253,6 +253,8 @@
</span><span class="cx">             FALLTHROUGH;
</span><span class="cx">         case CSSUnitType::CSS_EMS:
</span><span class="cx">         case CSSUnitType::CSS_REMS:
</span><ins>+        case CSSUnitType::CSS_LHS:
+        case CSSUnitType::CSS_RLHS:
</ins><span class="cx">         case CSSUnitType::CSS_CHS:
</span><span class="cx">         case CSSUnitType::CSS_EXS:
</span><span class="cx">         case CSSUnitType::CSS_PX:
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserSizesAttributeParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/SizesAttributeParser.cpp (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/SizesAttributeParser.cpp 2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/css/parser/SizesAttributeParser.cpp    2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -51,8 +51,7 @@
</span><span class="cx">         return 0;
</span><span class="cx">     auto& style = renderer->style();
</span><span class="cx"> 
</span><del>-    CSSToLengthConversionData conversionData(&style, &style, renderer);
-    
</del><ins>+    CSSToLengthConversionData conversionData(&style, &style, renderer->parentStyle(), renderer);
</ins><span class="cx">     // Because we evaluate "sizes" at parse time (before style has been resolved), the font metrics used for these specific units
</span><span class="cx">     // are not available. The font selector's internal consistency isn't guaranteed just yet, so we can just temporarily clear
</span><span class="cx">     // the pointer to it for the duration of the unit evaluation. This is acceptible because the style always comes from the
</span><span class="lines">@@ -65,7 +64,6 @@
</span><span class="cx">         style.fontCascade().update(fontSelector.get());
</span><span class="cx">         return result;
</span><span class="cx">     }
</span><del>-    
</del><span class="cx">     return clampTo<float>(CSSPrimitiveValue::computeNonCalcLengthDouble(conversionData, type, value));
</span><span class="cx"> }
</span><span class="cx">     
</span><span class="lines">@@ -159,7 +157,7 @@
</span><span class="cx">     if (!renderer)
</span><span class="cx">         return 0;
</span><span class="cx">     auto& style = renderer->style();
</span><del>-    return clampTo<float>(CSSPrimitiveValue::computeNonCalcLengthDouble({ &style, &style, renderer }, CSSUnitType::CSS_VW, 100.0));
</del><ins>+    return clampTo<float>(CSSPrimitiveValue::computeNonCalcLengthDouble({ &style, &style, renderer->parentStyle(), renderer }, CSSUnitType::CSS_VW, 100.0));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlshadowTextControlInnerElementscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp    2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp       2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -121,9 +121,9 @@
</span><span class="cx"> 
</span><span class="cx">         // Set "flex-basis: 1em". Note that CSSPrimitiveValue::computeLengthInt() only needs the element's
</span><span class="cx">         // style to calculate em lengths. Since the element might not be in a document, just pass nullptr
</span><del>-        // for the root element style and the render view.
</del><ins>+        // for the root element style, the parent element style, and the render view.
</ins><span class="cx">         auto emSize = CSSPrimitiveValue::create(1, CSSUnitType::CSS_EMS);
</span><del>-        int pixels = emSize->computeLength<int>(CSSToLengthConversionData { newStyle.get(), nullptr, nullptr, 1.0, false });
</del><ins>+        int pixels = emSize->computeLength<int>(CSSToLengthConversionData { newStyle.get(), nullptr, nullptr, nullptr, 1.0, WTF::nullopt });
</ins><span class="cx">         newStyle->setFlexBasis(Length { pixels, Fixed });
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.h (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.h   2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/rendering/RenderElement.h      2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx">     bool hasInitializedStyle() const { return m_hasInitializedStyle; }
</span><span class="cx"> 
</span><span class="cx">     const RenderStyle& style() const { return m_style; }
</span><ins>+    const RenderStyle* parentStyle() const { return !m_parent ? nullptr : &m_parent->style(); }
</ins><span class="cx">     const RenderStyle& firstLineStyle() const;
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Style shouldn't be mutated.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm 2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm    2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -563,7 +563,8 @@
</span><span class="cx"> {
</span><span class="cx">     Document& document = element.document();
</span><span class="cx">     auto emSize = CSSPrimitiveValue::create(0.5, CSSUnitType::CSS_EMS);
</span><del>-    int pixels = emSize->computeLength<int>(CSSToLengthConversionData(&style, document.renderStyle(), document.renderView(), document.frame()->pageZoomFactor()));
</del><ins>+    // We don't need this element's parent style to calculate `em` units, so it's okay to pass nullptr for it here.
+    int pixels = emSize->computeLength<int>(CSSToLengthConversionData(&style, document.renderStyle(), nullptr, document.renderView(), document.frame()->pageZoomFactor()));
</ins><span class="cx">     style.setPaddingBox(LengthBox(0, pixels, 0, pixels));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1023,10 +1024,10 @@
</span><span class="cx"> 
</span><span class="cx">     // Set padding: 0 1.0em; on buttons.
</span><span class="cx">     // CSSPrimitiveValue::computeLengthInt only needs the element's style to calculate em lengths.
</span><del>-    // Since the element might not be in a document, just pass nullptr for the root element style
-    // and the render view.
</del><ins>+    // Since the element might not be in a document, just pass nullptr for the root element style,
+    // the parent element style, and the render view.
</ins><span class="cx">     auto emSize = CSSPrimitiveValue::create(1.0, CSSUnitType::CSS_EMS);
</span><del>-    int pixels = emSize->computeLength<int>(CSSToLengthConversionData(&style, nullptr, nullptr, 1.0, false));
</del><ins>+    int pixels = emSize->computeLength<int>(CSSToLengthConversionData(&style, nullptr, nullptr, nullptr, 1.0, WTF::nullopt));
</ins><span class="cx">     style.setPaddingBox(LengthBox(0, pixels, 0, pixels));
</span><span class="cx"> 
</span><span class="cx">     if (!element)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp     2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp        2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -1776,16 +1776,19 @@
</span><span class="cx"> 
</span><span class="cx"> int RenderStyle::computedLineHeight() const
</span><span class="cx"> {
</span><del>-    const Length& lh = lineHeight();
</del><ins>+    return computeLineHeight(lineHeight());
+}
</ins><span class="cx"> 
</span><ins>+int RenderStyle::computeLineHeight(const Length& lineHeightLength) const
+{
</ins><span class="cx">     // Negative value means the line height is not set. Use the font's built-in spacing.
</span><del>-    if (lh.isNegative())
</del><ins>+    if (lineHeightLength.isNegative())
</ins><span class="cx">         return fontMetrics().lineSpacing();
</span><span class="cx"> 
</span><del>-    if (lh.isPercentOrCalculated())
-        return minimumValueForLength(lh, computedFontPixelSize());
</del><ins>+    if (lineHeightLength.isPercentOrCalculated())
+        return minimumValueForLength(lineHeightLength, computedFontPixelSize());
</ins><span class="cx"> 
</span><del>-    return clampTo<int>(lh.value());
</del><ins>+    return clampTo<int>(lineHeightLength.value());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderStyle::setWordSpacing(Length&& value)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.h       2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h  2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -391,6 +391,7 @@
</span><span class="cx">     const Length& specifiedLineHeight() const;
</span><span class="cx">     WEBCORE_EXPORT const Length& lineHeight() const;
</span><span class="cx">     WEBCORE_EXPORT int computedLineHeight() const;
</span><ins>+    int computeLineHeight(const Length&) const;
</ins><span class="cx"> 
</span><span class="cx">     WhiteSpace whiteSpace() const { return static_cast<WhiteSpace>(m_inheritedFlags.whiteSpace); }
</span><span class="cx">     static bool autoWrap(WhiteSpace);
</span><span class="lines">@@ -1508,6 +1509,7 @@
</span><span class="cx">     static Length initialOneLength() { return Length(1, Fixed); }
</span><span class="cx">     static short initialWidows() { return 2; }
</span><span class="cx">     static short initialOrphans() { return 2; }
</span><ins>+    // Returning -100% percent here means the line-height is not set.
</ins><span class="cx">     static Length initialLineHeight() { return Length(-100.0f, Percent); }
</span><span class="cx">     static TextAlignMode initialTextAlign() { return TextAlignMode::Start; }
</span><span class="cx">     static OptionSet<TextDecoration> initialTextDecoration() { return OptionSet<TextDecoration> { }; }
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleBuilderConverterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleBuilderConverter.h (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleBuilderConverter.h       2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/style/StyleBuilderConverter.h  2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -1167,15 +1167,24 @@
</span><span class="cx">     return autoFlow;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline CSSToLengthConversionData BuilderConverter::csstoLengthConversionDataWithTextZoomFactor(BuilderState& builderState)
</del><ins>+inline float zoomWithTextZoomFactor(BuilderState& builderState)
</ins><span class="cx"> {
</span><span class="cx">     if (auto* frame = builderState.document().frame()) {
</span><span class="cx">         float textZoomFactor = builderState.style().textZoom() != TextZoom::Reset ? frame->textZoomFactor() : 1.0f;
</span><del>-        return builderState.cssToLengthConversionData().copyWithAdjustedZoom(builderState.style().effectiveZoom() * textZoomFactor);
</del><ins>+        return builderState.style().effectiveZoom() * textZoomFactor;
</ins><span class="cx">     }
</span><del>-    return builderState.cssToLengthConversionData();
</del><ins>+    return builderState.cssToLengthConversionData().zoom();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+inline CSSToLengthConversionData BuilderConverter::csstoLengthConversionDataWithTextZoomFactor(BuilderState& builderState)
+{
+    float zoom = zoomWithTextZoomFactor(builderState);
+    if (zoom == builderState.cssToLengthConversionData().zoom())
+        return builderState.cssToLengthConversionData();
+
+    return builderState.cssToLengthConversionData().copyWithAdjustedZoom(zoom);
+}
+
</ins><span class="cx"> inline Optional<Length> BuilderConverter::convertWordSpacing(BuilderState& builderState, const CSSValue& value)
</span><span class="cx"> {
</span><span class="cx">     Optional<Length> wordSpacing;
</span><span class="lines">@@ -1511,7 +1520,8 @@
</span><span class="cx">         return RenderStyle::initialLineHeight();
</span><span class="cx"> 
</span><span class="cx">     if (primitiveValue.isLength()) {
</span><del>-        Length length = primitiveValue.computeLength<Length>(BuilderConverter::csstoLengthConversionDataWithTextZoomFactor(builderState));
</del><ins>+        auto conversionData = builderState.cssToLengthConversionData().copyWithAdjustedZoomAndPropertyToCompute(zoomWithTextZoomFactor(builderState), CSSPropertyLineHeight);
+        Length length = primitiveValue.computeLength<Length>(conversionData);
</ins><span class="cx">         if (multiplier != 1.f)
</span><span class="cx">             length = Length(length.value() * multiplier, Fixed);
</span><span class="cx">         return length;
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleBuilderCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleBuilderCustom.h (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleBuilderCustom.h  2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/style/StyleBuilderCustom.h     2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -1622,7 +1622,7 @@
</span><span class="cx">     } else {
</span><span class="cx">         fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize || !(primitiveValue.isPercentage() || primitiveValue.isFontRelativeLength()));
</span><span class="cx">         if (primitiveValue.isLength()) {
</span><del>-            size = primitiveValue.computeLength<float>(CSSToLengthConversionData(&builderState.parentStyle(), builderState.rootElementStyle(), builderState.document().renderView(), 1.0f, true));
</del><ins>+            size = primitiveValue.computeLength<float>(CSSToLengthConversionData(&builderState.parentStyle(), builderState.rootElementStyle(), &builderState.parentStyle(), builderState.document().renderView(), 1.0f, CSSPropertyFontSize));
</ins><span class="cx">             if (primitiveValue.isViewportPercentageLength())
</span><span class="cx">                 builderState.style().setHasViewportUnits();
</span><span class="cx">         } else if (primitiveValue.isPercentage())
</span><span class="lines">@@ -1629,7 +1629,7 @@
</span><span class="cx">             size = (primitiveValue.floatValue() * parentSize) / 100.0f;
</span><span class="cx">         else if (primitiveValue.isCalculatedPercentageWithLength()) {
</span><span class="cx">             const auto& conversionData = builderState.cssToLengthConversionData();
</span><del>-            CSSToLengthConversionData parentConversionData { &builderState.parentStyle(), conversionData.rootStyle(), builderState.document().renderView(), 1.0f, true };
</del><ins>+            CSSToLengthConversionData parentConversionData { &builderState.parentStyle(), conversionData.rootStyle(), &builderState.parentStyle(), builderState.document().renderView(), 1.0f, CSSPropertyFontSize };
</ins><span class="cx">             size = primitiveValue.cssCalcValue()->createCalculationValue(parentConversionData)->evaluate(parentSize);
</span><span class="cx">         } else
</span><span class="cx">             return;
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleBuilderStatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleBuilderState.cpp (259702 => 259703)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleBuilderState.cpp 2020-04-08 03:59:00 UTC (rev 259702)
+++ trunk/Source/WebCore/style/StyleBuilderState.cpp    2020-04-08 04:45:45 UTC (rev 259703)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx">     , m_styleMap(*this)
</span><span class="cx">     , m_style(style)
</span><span class="cx">     , m_context(WTFMove(context))
</span><del>-    , m_cssToLengthConversionData(&style, rootElementStyle(), document().renderView())
</del><ins>+    , m_cssToLengthConversionData(&style, rootElementStyle(), &parentStyle(), document().renderView())
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>