<!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>[179119] trunk/Source/WebCore</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/179119">179119</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-01-26 09:52:35 -0800 (Mon, 26 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Demote 'line-height' to a low priority property.
https://bugs.webkit.org/show_bug.cgi?id=140817

Reviewed by Andreas Kling.

Our special handling of the 'line-height' property is no longer
required, since the 'font' shorthand is now expanded in the parser
in all cases (also for system fonts).

This patch is based on the following Blink revision:
https://src.chromium.org/viewvc/blink?revision=184629&amp;view=revision

No new tests, already covered by:
fast/css/font-shorthand-line-height.html
fast/css/line-height-font-order.html

* css/CSSPropertyNames.in:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleForKeyframe):
(WebCore::StyleResolver::styleForPage):
(WebCore::StyleResolver::applyMatchedProperties):
(WebCore::StyleResolver::initializeFontStyle):
(WebCore::StyleResolver::CascadedProperties::Property::apply):
* css/StyleResolver.h:
(WebCore::StyleResolver::State::State):
(WebCore::StyleResolver::State::setLineHeightValue): Deleted.
(WebCore::StyleResolver::State::lineHeightValue): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSPropertyNamesin">trunk/Source/WebCore/css/CSSPropertyNames.in</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolverh">trunk/Source/WebCore/css/StyleResolver.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (179118 => 179119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-26 17:51:56 UTC (rev 179118)
+++ trunk/Source/WebCore/ChangeLog        2015-01-26 17:52:35 UTC (rev 179119)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2015-01-26  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Demote 'line-height' to a low priority property.
+        https://bugs.webkit.org/show_bug.cgi?id=140817
+
+        Reviewed by Andreas Kling.
+
+        Our special handling of the 'line-height' property is no longer
+        required, since the 'font' shorthand is now expanded in the parser
+        in all cases (also for system fonts).
+
+        This patch is based on the following Blink revision:
+        https://src.chromium.org/viewvc/blink?revision=184629&amp;view=revision
+
+        No new tests, already covered by:
+        fast/css/font-shorthand-line-height.html
+        fast/css/line-height-font-order.html
+
+        * css/CSSPropertyNames.in:
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::styleForKeyframe):
+        (WebCore::StyleResolver::styleForPage):
+        (WebCore::StyleResolver::applyMatchedProperties):
+        (WebCore::StyleResolver::initializeFontStyle):
+        (WebCore::StyleResolver::CascadedProperties::Property::apply):
+        * css/StyleResolver.h:
+        (WebCore::StyleResolver::State::State):
+        (WebCore::StyleResolver::State::setLineHeightValue): Deleted.
+        (WebCore::StyleResolver::State::lineHeightValue): Deleted.
+
</ins><span class="cx"> 2015-01-26  Michael Catanzaro  &lt;mcatanzaro@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] gtkdoc does not appear in DevHelp
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPropertyNamesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (179118 => 179119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPropertyNames.in        2015-01-26 17:51:56 UTC (rev 179118)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in        2015-01-26 17:52:35 UTC (rev 179119)
</span><span class="lines">@@ -119,13 +119,6 @@
</span><span class="cx"> -epub-writing-mode = -webkit-writing-mode
</span><span class="cx"> zoom [Custom=All]
</span><span class="cx"> 
</span><del>-// line height needs to be right after the above high-priority properties
-#if defined(ENABLE_IOS_TEXT_AUTOSIZING) &amp;&amp; ENABLE_IOS_TEXT_AUTOSIZING
-line-height [Inherited, Custom=All]
-#else
-line-height [Inherited, Getter=specifiedLineHeight, ConditionalConverter=LineHeight]
-#endif
-
</del><span class="cx"> // Keep this in between the highest priority props and the lower ones.
</span><span class="cx"> -webkit-ruby-position [Inherited]
</span><span class="cx"> 
</span><span class="lines">@@ -244,6 +237,11 @@
</span><span class="cx"> left [Initial=initialOffset, Converter=LengthOrAuto]
</span><span class="cx"> letter-spacing [Inherited, Converter=Spacing]
</span><span class="cx"> lighting-color [SVG, Converter=SVGColor]
</span><ins>+#if defined(ENABLE_IOS_TEXT_AUTOSIZING) &amp;&amp; ENABLE_IOS_TEXT_AUTOSIZING
+line-height [Inherited, Custom=All]
+#else
+line-height [Inherited, Getter=specifiedLineHeight, ConditionalConverter=LineHeight]
+#endif
</ins><span class="cx"> list-style [Inherited, Longhands=list-style-type|list-style-position|list-style-image]
</span><span class="cx"> list-style-image [Inherited, Converter=StyleImage&lt;CSSPropertyListStyleImage&gt;]
</span><span class="cx"> list-style-position [Inherited]
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (179118 => 179119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2015-01-26 17:51:56 UTC (rev 179118)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2015-01-26 17:52:35 UTC (rev 179119)
</span><span class="lines">@@ -168,7 +168,8 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace HTMLNames;
</span><span class="cx"> 
</span><del>-static const CSSPropertyID firstLowPriorityProperty = static_cast&lt;CSSPropertyID&gt;(CSSPropertyLineHeight + 1);
</del><ins>+static const CSSPropertyID lastHighPriorityProperty = CSSPropertyZoom;
+static const CSSPropertyID firstLowPriorityProperty = static_cast&lt;CSSPropertyID&gt;(lastHighPriorityProperty + 1);
</ins><span class="cx"> 
</span><span class="cx"> class StyleResolver::CascadedProperties {
</span><span class="cx"> public:
</span><span class="lines">@@ -820,7 +821,6 @@
</span><span class="cx">     // Create the style
</span><span class="cx">     state.setStyle(RenderStyle::clone(elementStyle));
</span><span class="cx">     state.setParentStyle(RenderStyle::clone(elementStyle));
</span><del>-    state.setLineHeightValue(0);
</del><span class="cx"> 
</span><span class="cx">     TextDirection direction;
</span><span class="cx">     WritingMode writingMode;
</span><span class="lines">@@ -831,15 +831,11 @@
</span><span class="cx">     CascadedProperties cascade(direction, writingMode);
</span><span class="cx">     cascade.addMatches(result, false, 0, result.matchedProperties.size() - 1);
</span><span class="cx"> 
</span><del>-    applyCascadedProperties(cascade, firstCSSProperty, CSSPropertyLineHeight);
</del><ins>+    applyCascadedProperties(cascade, firstCSSProperty, lastHighPriorityProperty);
</ins><span class="cx"> 
</span><span class="cx">     // If our font got dirtied, go ahead and update it now.
</span><span class="cx">     updateFont();
</span><span class="cx"> 
</span><del>-    // Line-height is set when we are sure we decided on the font-size
-    if (state.lineHeightValue())
-        applyProperty(CSSPropertyLineHeight, state.lineHeightValue());
-
</del><span class="cx">     // Now do rest of the properties.
</span><span class="cx">     applyCascadedProperties(cascade, firstLowPriorityProperty, lastCSSProperty);
</span><span class="cx"> 
</span><span class="lines">@@ -991,7 +987,6 @@
</span><span class="cx"> 
</span><span class="cx">     PageRuleCollector collector(m_state, m_ruleSets);
</span><span class="cx">     collector.matchAllPageRules(pageIndex);
</span><del>-    m_state.setLineHeightValue(0);
</del><span class="cx"> 
</span><span class="cx">     MatchResult&amp; result = collector.matchedResult();
</span><span class="cx"> 
</span><span class="lines">@@ -1002,15 +997,11 @@
</span><span class="cx">     CascadedProperties cascade(direction, writingMode);
</span><span class="cx">     cascade.addMatches(result, false, 0, result.matchedProperties.size() - 1);
</span><span class="cx"> 
</span><del>-    applyCascadedProperties(cascade, firstCSSProperty, CSSPropertyLineHeight);
</del><ins>+    applyCascadedProperties(cascade, firstCSSProperty, lastHighPriorityProperty);
</ins><span class="cx"> 
</span><span class="cx">     // If our font got dirtied, go ahead and update it now.
</span><span class="cx">     updateFont();
</span><span class="cx"> 
</span><del>-    // Line-height is set when we are sure we decided on the font-size.
-    if (m_state.lineHeightValue())
-        applyProperty(CSSPropertyLineHeight, m_state.lineHeightValue());
-
</del><span class="cx">     applyCascadedProperties(cascade, firstLowPriorityProperty, lastCSSProperty);
</span><span class="cx"> 
</span><span class="cx">     cascade.applyDeferredProperties(*this);
</span><span class="lines">@@ -1751,7 +1742,6 @@
</span><span class="cx">         // Find out if there's a -webkit-appearance property in effect from the UA sheet.
</span><span class="cx">         // If so, we cache the border and background styles so that RenderTheme::adjustStyle()
</span><span class="cx">         // can look at them later to figure out if this is a styled form control or not.
</span><del>-        state.setLineHeightValue(nullptr);
</del><span class="cx">         CascadedProperties cascade(direction, writingMode);
</span><span class="cx">         if (!cascade.addMatches(matchResult, false, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly)
</span><span class="cx">             || !cascade.addMatches(matchResult, true, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly))
</span><span class="lines">@@ -1761,7 +1751,7 @@
</span><span class="cx">         adjustStyleForInterCharacterRuby();
</span><span class="cx"> 
</span><span class="cx">         // Start by applying properties that other properties may depend on.
</span><del>-        applyCascadedProperties(cascade, firstCSSProperty, CSSPropertyLineHeight);
</del><ins>+        applyCascadedProperties(cascade, firstCSSProperty, lastHighPriorityProperty);
</ins><span class="cx">     
</span><span class="cx">         updateFont();
</span><span class="cx">         applyCascadedProperties(cascade, firstLowPriorityProperty, lastCSSProperty);
</span><span class="lines">@@ -1776,15 +1766,13 @@
</span><span class="cx">         || !cascade.addMatches(matchResult, true, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly))
</span><span class="cx">         return applyMatchedProperties(matchResult, element, DoNotUseMatchedPropertiesCache);
</span><span class="cx"> 
</span><del>-    state.setLineHeightValue(nullptr);
-
</del><span class="cx">     applyCascadedProperties(cascade, CSSPropertyWebkitRubyPosition, CSSPropertyWebkitRubyPosition);
</span><span class="cx">     
</span><span class="cx">     // Adjust the font size to be smaller if ruby-position is inter-character.
</span><span class="cx">     adjustStyleForInterCharacterRuby();
</span><span class="cx"> 
</span><span class="cx">     // Start by applying properties that other properties may depend on.
</span><del>-    applyCascadedProperties(cascade, firstCSSProperty, CSSPropertyLineHeight);
</del><ins>+    applyCascadedProperties(cascade, firstCSSProperty, lastHighPriorityProperty);
</ins><span class="cx"> 
</span><span class="cx">     // If the effective zoom value changes, we can't use the matched properties cache. Start over.
</span><span class="cx">     if (cacheItem &amp;&amp; cacheItem-&gt;renderStyle-&gt;effectiveZoom() != state.style()-&gt;effectiveZoom())
</span><span class="lines">@@ -1793,10 +1781,6 @@
</span><span class="cx">     // If our font got dirtied, go ahead and update it now.
</span><span class="cx">     updateFont();
</span><span class="cx"> 
</span><del>-    // Line-height is set when we are sure we decided on the font-size.
-    if (state.lineHeightValue())
-        applyProperty(CSSPropertyLineHeight, state.lineHeightValue());
-
</del><span class="cx">     // If the font changed, we can't use the matched properties cache. Start over.
</span><span class="cx">     if (cacheItem &amp;&amp; cacheItem-&gt;renderStyle-&gt;fontDescription() != state.style()-&gt;fontDescription())
</span><span class="cx">         return applyMatchedProperties(matchResult, element, DoNotUseMatchedPropertiesCache);
</span><span class="lines">@@ -2099,8 +2083,6 @@
</span><span class="cx">     fontDescription.setOneFamily(standardFamily);
</span><span class="cx">     fontDescription.setKeywordSizeFromIdentifier(CSSValueMedium);
</span><span class="cx">     setFontSize(fontDescription, Style::fontSizeForKeyword(CSSValueMedium, false, document()));
</span><del>-    m_state.style()-&gt;setLineHeight(RenderStyle::initialLineHeight());
-    m_state.setLineHeightValue(0);
</del><span class="cx">     setFontDescription(fontDescription);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2688,13 +2670,6 @@
</span><span class="cx"> {
</span><span class="cx">     State&amp; state = resolver.state();
</span><span class="cx"> 
</span><del>-    // FIXME: It would be nice if line-height were less of a special snowflake.
-    if (id == CSSPropertyLineHeight) {
-        if (auto value = state.style()-&gt;insideLink() == NotInsideLink ? cssValue[0] : cssValue[SelectorChecker::MatchLink])
-            state.setLineHeightValue(value);
-        return;
-    }
-
</del><span class="cx">     if (cssValue[0]) {
</span><span class="cx">         state.setApplyPropertyToRegularStyle(true);
</span><span class="cx">         state.setApplyPropertyToVisitedLinkStyle(false);
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolverh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.h (179118 => 179119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.h        2015-01-26 17:51:56 UTC (rev 179118)
+++ trunk/Source/WebCore/css/StyleResolver.h        2015-01-26 17:52:35 UTC (rev 179119)
</span><span class="lines">@@ -344,7 +344,6 @@
</span><span class="cx">             , m_elementAffectedByClassRules(false)
</span><span class="cx">             , m_applyPropertyToRegularStyle(true)
</span><span class="cx">             , m_applyPropertyToVisitedLinkStyle(false)
</span><del>-            , m_lineHeightValue(nullptr)
</del><span class="cx">             , m_fontDirty(false)
</span><span class="cx">             , m_fontSizeHasViewportUnits(false)
</span><span class="cx">             , m_hasUAAppearance(false)
</span><span class="lines">@@ -382,8 +381,6 @@
</span><span class="cx">         Vector&lt;RefPtr&lt;ReferenceFilterOperation&gt;&gt;&amp; filtersWithPendingSVGDocuments() { return m_filtersWithPendingSVGDocuments; }
</span><span class="cx">         Vector&lt;RefPtr&lt;MaskImageOperation&gt;&gt;&amp; maskImagesWithPendingSVGDocuments() { return m_maskImagesWithPendingSVGDocuments; }
</span><span class="cx"> 
</span><del>-        void setLineHeightValue(CSSValue* value) { m_lineHeightValue = value; }
-        CSSValue* lineHeightValue() { return m_lineHeightValue; }
</del><span class="cx">         void setFontDirty(bool isDirty) { m_fontDirty = isDirty; }
</span><span class="cx">         bool fontDirty() const { return m_fontDirty; }
</span><span class="cx">         void setFontSizeHasViewportUnits(bool hasViewportUnits) { m_fontSizeHasViewportUnits = hasViewportUnits; }
</span><span class="lines">@@ -431,7 +428,6 @@
</span><span class="cx">         Vector&lt;RefPtr&lt;ReferenceFilterOperation&gt;&gt; m_filtersWithPendingSVGDocuments;
</span><span class="cx">         Vector&lt;RefPtr&lt;MaskImageOperation&gt;&gt; m_maskImagesWithPendingSVGDocuments;
</span><span class="cx"> 
</span><del>-        CSSValue* m_lineHeightValue;
</del><span class="cx">         bool m_fontDirty;
</span><span class="cx">         bool m_fontSizeHasViewportUnits;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>