<!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>[196075] 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/196075">196075</a></dd>
<dt>Author</dt> <dd>hyatt@apple.com</dd>
<dt>Date</dt> <dd>2016-02-03 12:54:30 -0800 (Wed, 03 Feb 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Implement hanging-punctuation property parsing.
https://bugs.webkit.org/show_bug.cgi?id=18109.

Reviewed by Zalan Bujtas.

Source/WebCore:

Added parsing test in fast/css.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::renderEmphasisPositionFlagsToCSSValue):
(WebCore::hangingPunctuationToCSSValue):
(WebCore::fillRepeatToCSSValue):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseTextIndent):
(WebCore::CSSParser::parseHangingPunctuation):
(WebCore::CSSParser::parseLineBoxContain):
* css/CSSParser.h:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator HangingPunctuation):
(WebCore::CSSPrimitiveValue::operator LineBreak):
* css/CSSPropertyNames.in:
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertRegionBreakInside):
(WebCore::StyleBuilderConverter::convertHangingPunctuation):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayout):
* rendering/style/RenderStyle.h:
* rendering/style/RenderStyleConstants.h:
(WebCore::operator| ):
(WebCore::operator|= ):
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==):
* rendering/style/StyleRareInheritedData.h:

LayoutTests:

* fast/css/parsing-hanging-punctuation-expected.txt: Added.
* fast/css/parsing-hanging-punctuation.html: Added.
* fast/css/resources/parsing-hanging-punctuation.js: Added.
(test):</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="#trunkSourceWebCorecssCSSComputedStyleDeclarationcpp">trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSParserh">trunk/Source/WebCore/css/CSSParser.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSPrimitiveValueMappingsh">trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSPropertyNamesin">trunk/Source/WebCore/css/CSSPropertyNames.in</a></li>
<li><a href="#trunkSourceWebCorecssCSSValueKeywordsin">trunk/Source/WebCore/css/CSSValueKeywords.in</a></li>
<li><a href="#trunkSourceWebCorecssStyleBuilderConverterh">trunk/Source/WebCore/css/StyleBuilderConverter.h</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="#trunkSourceWebCorerenderingstyleRenderStyleConstantsh">trunk/Source/WebCore/rendering/style/RenderStyleConstants.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleStyleRareInheritedDatacpp">trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleStyleRareInheritedDatah">trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssparsinghangingpunctuationexpectedtxt">trunk/LayoutTests/fast/css/parsing-hanging-punctuation-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssparsinghangingpunctuationhtml">trunk/LayoutTests/fast/css/parsing-hanging-punctuation.html</a></li>
<li><a href="#trunkLayoutTestsfastcssresourcesparsinghangingpunctuationjs">trunk/LayoutTests/fast/css/resources/parsing-hanging-punctuation.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (196074 => 196075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-02-03 20:15:05 UTC (rev 196074)
+++ trunk/LayoutTests/ChangeLog        2016-02-03 20:54:30 UTC (rev 196075)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-02-03  Dave Hyatt  &lt;hyatt@apple.com&gt;
+
+        Implement hanging-punctuation property parsing.
+        https://bugs.webkit.org/show_bug.cgi?id=18109.
+
+        Reviewed by Zalan Bujtas.
+
+        * fast/css/parsing-hanging-punctuation-expected.txt: Added.
+        * fast/css/parsing-hanging-punctuation.html: Added.
+        * fast/css/resources/parsing-hanging-punctuation.js: Added.
+        (test):
+
</ins><span class="cx"> 2016-02-03  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Skip fast/forms/input-user-input-sanitization.html on ios-simulator
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssparsinghangingpunctuationexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-hanging-punctuation-expected.txt (0 => 196075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-hanging-punctuation-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-hanging-punctuation-expected.txt        2016-02-03 20:54:30 UTC (rev 196075)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+This tests checks that all of the input values for hanging-punctuation parse correctly.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS test(&quot;hanging-punctuation: none;&quot;) is &quot;none&quot;
+PASS test(&quot;hanging-punctuation: first;&quot;) is &quot;first&quot;
+PASS test(&quot;hanging-punctuation: last;&quot;) is &quot;last&quot;
+PASS test(&quot;hanging-punctuation: allow-end;&quot;) is &quot;allow-end&quot;
+PASS test(&quot;hanging-punctuation: force-end;&quot;) is &quot;force-end&quot;
+PASS test(&quot;hanging-punctuation: first last;&quot;) is &quot;first last&quot;
+PASS test(&quot;hanging-punctuation: last first;&quot;) is &quot;last first&quot;
+PASS test(&quot;hanging-punctuation: first allow-end;&quot;) is &quot;first allow-end&quot;
+PASS test(&quot;hanging-punctuation: first force-end;&quot;) is &quot;first force-end&quot;
+PASS test(&quot;hanging-punctuation: first allow-end last;&quot;) is &quot;first allow-end last&quot;
+PASS test(&quot;hanging-punctuation: last allow-end;&quot;) is &quot;last allow-end&quot;
+PASS test(&quot;hanging-punctuation: first first;&quot;) is &quot;&quot;
+PASS test(&quot;hanging-punctuation: nonsense;&quot;) is &quot;&quot;
+PASS test(&quot;hanging-punctuation: allow-end force-end;&quot;) is &quot;&quot;
+PASS test(&quot;hanging-punctuation: force-end allow-end;&quot;) is &quot;&quot;
+PASS test(&quot;hanging-punctuation: last last;&quot;) is &quot;&quot;
+PASS test(&quot;hanging-punctuation: 20px;&quot;) is &quot;&quot;
+PASS test(&quot;hanging-punctuation: first allow-end force-end last;&quot;) is &quot;&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssparsinghangingpunctuationhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-hanging-punctuation.html (0 => 196075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-hanging-punctuation.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-hanging-punctuation.html        2016-02-03 20:54:30 UTC (rev 196075)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/parsing-hanging-punctuation.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssresourcesparsinghangingpunctuationjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/resources/parsing-hanging-punctuation.js (0 => 196075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/resources/parsing-hanging-punctuation.js                                (rev 0)
+++ trunk/LayoutTests/fast/css/resources/parsing-hanging-punctuation.js        2016-02-03 20:54:30 UTC (rev 196075)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+description(&quot;This tests checks that all of the input values for hanging-punctuation parse correctly.&quot;);
+
+function test(value)
+{
+    var div = document.createElement(&quot;div&quot;);
+    div.setAttribute(&quot;style&quot;, value);
+    document.body.appendChild(div);
+    
+    var result = div.style.getPropertyValue(&quot;hanging-punctuation&quot;);
+    document.body.removeChild(div);
+    return result;
+}
+
+shouldBe('test(&quot;hanging-punctuation: none;&quot;)', '&quot;none&quot;');
+shouldBe('test(&quot;hanging-punctuation: first;&quot;)', '&quot;first&quot;');
+shouldBe('test(&quot;hanging-punctuation: last;&quot;)', '&quot;last&quot;');
+shouldBe('test(&quot;hanging-punctuation: allow-end;&quot;)', '&quot;allow-end&quot;');
+shouldBe('test(&quot;hanging-punctuation: force-end;&quot;)', '&quot;force-end&quot;');
+shouldBe('test(&quot;hanging-punctuation: first last;&quot;)', '&quot;first last&quot;');
+shouldBe('test(&quot;hanging-punctuation: last first;&quot;)', '&quot;last first&quot;');
+shouldBe('test(&quot;hanging-punctuation: first allow-end;&quot;)', '&quot;first allow-end&quot;');
+shouldBe('test(&quot;hanging-punctuation: first force-end;&quot;)', '&quot;first force-end&quot;');
+shouldBe('test(&quot;hanging-punctuation: first allow-end last;&quot;)', '&quot;first allow-end last&quot;');
+shouldBe('test(&quot;hanging-punctuation: last allow-end;&quot;)', '&quot;last allow-end&quot;');
+
+shouldBeEqualToString('test(&quot;hanging-punctuation: first first;&quot;)', '');
+shouldBeEqualToString('test(&quot;hanging-punctuation: nonsense;&quot;)', '');
+shouldBeEqualToString('test(&quot;hanging-punctuation: allow-end force-end;&quot;)', '');
+shouldBeEqualToString('test(&quot;hanging-punctuation: force-end allow-end;&quot;)', '');
+shouldBeEqualToString('test(&quot;hanging-punctuation: last last;&quot;)', '');
+shouldBeEqualToString('test(&quot;hanging-punctuation: 20px;&quot;)', '');
+shouldBeEqualToString('test(&quot;hanging-punctuation: first allow-end force-end last;&quot;)', '');
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (196074 => 196075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-02-03 20:15:05 UTC (rev 196074)
+++ trunk/Source/WebCore/ChangeLog        2016-02-03 20:54:30 UTC (rev 196075)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2016-02-03  Dave Hyatt  &lt;hyatt@apple.com&gt;
+
+        Implement hanging-punctuation property parsing.
+        https://bugs.webkit.org/show_bug.cgi?id=18109.
+
+        Reviewed by Zalan Bujtas.
+
+        Added parsing test in fast/css.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::renderEmphasisPositionFlagsToCSSValue):
+        (WebCore::hangingPunctuationToCSSValue):
+        (WebCore::fillRepeatToCSSValue):
+        (WebCore::ComputedStyleExtractor::propertyValue):
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue):
+        (WebCore::CSSParser::parseTextIndent):
+        (WebCore::CSSParser::parseHangingPunctuation):
+        (WebCore::CSSParser::parseLineBoxContain):
+        * css/CSSParser.h:
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        (WebCore::CSSPrimitiveValue::operator HangingPunctuation):
+        (WebCore::CSSPrimitiveValue::operator LineBreak):
+        * css/CSSPropertyNames.in:
+        * css/CSSValueKeywords.in:
+        * css/StyleBuilderConverter.h:
+        (WebCore::StyleBuilderConverter::convertRegionBreakInside):
+        (WebCore::StyleBuilderConverter::convertHangingPunctuation):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::changeRequiresLayout):
+        * rendering/style/RenderStyle.h:
+        * rendering/style/RenderStyleConstants.h:
+        (WebCore::operator| ):
+        (WebCore::operator|= ):
+        * rendering/style/StyleRareInheritedData.cpp:
+        (WebCore::StyleRareInheritedData::StyleRareInheritedData):
+        (WebCore::StyleRareInheritedData::operator==):
+        * rendering/style/StyleRareInheritedData.h:
+
</ins><span class="cx"> 2016-02-03  Jessie Berlin  &lt;jberlin@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Build fix.
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (196074 => 196075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2016-02-03 20:15:05 UTC (rev 196074)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2016-02-03 20:54:30 UTC (rev 196075)
</span><span class="lines">@@ -1695,6 +1695,23 @@
</span><span class="cx">     return list.releaseNonNull();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static Ref&lt;CSSValue&gt; hangingPunctuationToCSSValue(HangingPunctuation hangingPunctuation)
+{
+    auto&amp; cssValuePool = CSSValuePool::singleton();
+    RefPtr&lt;CSSValueList&gt; list = CSSValueList::createSpaceSeparated();
+    if (hangingPunctuation &amp; FirstHangingPunctuation)
+        list-&gt;append(cssValuePool.createIdentifierValue(CSSValueFirst));
+    if (hangingPunctuation &amp; AllowEndHangingPunctuation)
+        list-&gt;append(cssValuePool.createIdentifierValue(CSSValueAllowEnd));
+    if (hangingPunctuation &amp; ForceEndHangingPunctuation)
+        list-&gt;append(cssValuePool.createIdentifierValue(CSSValueForceEnd));
+    if (hangingPunctuation &amp; LastHangingPunctuation)
+        list-&gt;append(cssValuePool.createIdentifierValue(CSSValueLast));
+    if (!list-&gt;length())
+        return cssValuePool.createIdentifierValue(CSSValueNone);
+    return list.releaseNonNull();
+}
+    
</ins><span class="cx"> static Ref&lt;CSSValue&gt; fillRepeatToCSSValue(EFillRepeat xRepeat, EFillRepeat yRepeat)
</span><span class="cx"> {
</span><span class="cx">     // For backwards compatibility, if both values are equal, just return one of them. And
</span><span class="lines">@@ -3018,6 +3035,8 @@
</span><span class="cx">             return cssValuePool.createValue(style-&gt;breakBefore());
</span><span class="cx">         case CSSPropertyBreakInside:
</span><span class="cx">             return cssValuePool.createValue(style-&gt;breakInside());
</span><ins>+        case CSSPropertyHangingPunctuation:
+            return hangingPunctuationToCSSValue(style-&gt;hangingPunctuation());
</ins><span class="cx">         case CSSPropertyPosition:
</span><span class="cx">             return cssValuePool.createValue(style-&gt;position());
</span><span class="cx">         case CSSPropertyRight:
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (196074 => 196075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2016-02-03 20:15:05 UTC (rev 196074)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2016-02-03 20:54:30 UTC (rev 196075)
</span><span class="lines">@@ -3087,6 +3087,8 @@
</span><span class="cx">             validPrimitive = true;
</span><span class="cx">         break;
</span><span class="cx"> 
</span><ins>+    case CSSPropertyHangingPunctuation:
+        return parseHangingPunctuation(important);
</ins><span class="cx">     case CSSPropertyWebkitLineBoxContain:
</span><span class="cx">         if (id == CSSValueNone)
</span><span class="cx">             validPrimitive = true;
</span><span class="lines">@@ -10511,6 +10513,50 @@
</span><span class="cx">     return list.release();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool CSSParser::parseHangingPunctuation(bool important)
+{
+    CSSParserValue* value = m_valueList-&gt;current();
+    if (value &amp;&amp; value-&gt;id == CSSValueNone) {
+        addProperty(CSSPropertyHangingPunctuation, CSSValuePool::singleton().createIdentifierValue(CSSValueNone), important);
+        m_valueList-&gt;next();
+        return true;
+    }
+    
+    RefPtr&lt;CSSValueList&gt; list = CSSValueList::createSpaceSeparated();
+    bool isValid = true;
+    std::bitset&lt;numCSSValueKeywords&gt; seenValues;
+    while (isValid &amp;&amp; value) {
+        if (seenValues[value-&gt;id]
+            || (value-&gt;id == CSSValueAllowEnd &amp;&amp; seenValues[CSSValueForceEnd])
+            || (value-&gt;id == CSSValueForceEnd &amp;&amp; seenValues[CSSValueAllowEnd])) {
+            isValid = false;
+            break;
+        }
+        switch (value-&gt;id) {
+        case CSSValueAllowEnd:
+        case CSSValueFirst:
+        case CSSValueForceEnd:
+        case CSSValueLast:
+            list-&gt;append(CSSValuePool::singleton().createIdentifierValue(value-&gt;id));
+            seenValues.set(value-&gt;id);
+            break;
+        default:
+            isValid = false;
+            break;
+        }
+        if (isValid)
+            value = m_valueList-&gt;next();
+    }
+    
+    // Values are either valid or in shorthand scope.
+    if (list-&gt;length() &amp;&amp; isValid) {
+        addProperty(CSSPropertyHangingPunctuation, list.release(), important);
+        return true;
+    }
+    
+    return false;
+}
+
</ins><span class="cx"> bool CSSParser::parseLineBoxContain(bool important)
</span><span class="cx"> {
</span><span class="cx">     LineBoxContain lineBoxContain = LineBoxContainNone;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.h (196074 => 196075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.h        2016-02-03 20:15:05 UTC (rev 196074)
+++ trunk/Source/WebCore/css/CSSParser.h        2016-02-03 20:54:30 UTC (rev 196075)
</span><span class="lines">@@ -337,6 +337,8 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CSSValue&gt; parseTextIndent();
</span><span class="cx">     
</span><ins>+    bool parseHangingPunctuation(bool important);
+
</ins><span class="cx">     bool parseLineBoxContain(bool important);
</span><span class="cx">     RefPtr&lt;CSSCalcValue&gt; parseCalculation(CSSParserValue&amp;, CalculationPermittedValueRange);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValueMappingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h (196074 => 196075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h        2016-02-03 20:15:05 UTC (rev 196074)
+++ trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h        2016-02-03 20:54:30 UTC (rev 196075)
</span><span class="lines">@@ -1626,6 +1626,29 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template&lt;&gt; inline CSSPrimitiveValue::operator HangingPunctuation() const
+{
+    ASSERT(isValueID());
+    
+    switch (m_value.valueID) {
+    case CSSValueNone:
+        return NoHangingPunctuation;
+    case CSSValueFirst:
+        return FirstHangingPunctuation;
+    case CSSValueLast:
+        return LastHangingPunctuation;
+    case CSSValueAllowEnd:
+        return AllowEndHangingPunctuation;
+    case CSSValueForceEnd:
+        return ForceEndHangingPunctuation;
+    default:
+        break;
+    }
+    
+    ASSERT_NOT_REACHED();
+    return NoHangingPunctuation;
+}
+
</ins><span class="cx"> template&lt;&gt; inline CSSPrimitiveValue::operator LineBreak() const
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isValueID());
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPropertyNamesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (196074 => 196075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPropertyNames.in        2016-02-03 20:15:05 UTC (rev 196074)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in        2016-02-03 20:54:30 UTC (rev 196075)
</span><span class="lines">@@ -236,6 +236,7 @@
</span><span class="cx"> font-stretch [SkipBuilder]
</span><span class="cx"> glyph-orientation-horizontal [Inherited, SVG, Converter=GlyphOrientation]
</span><span class="cx"> glyph-orientation-vertical [Inherited, SVG, Converter=GlyphOrientationOrAuto]
</span><ins>+hanging-punctuation [Inherited, Converter=HangingPunctuation]
</ins><span class="cx"> height [Initial=initialSize, Converter=LengthSizing]
</span><span class="cx"> #if defined(ENABLE_CSS_IMAGE_ORIENTATION) &amp;&amp; ENABLE_CSS_IMAGE_ORIENTATION
</span><span class="cx"> image-orientation [Inherited]
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValueKeywordsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (196074 => 196075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValueKeywords.in        2016-02-03 20:15:05 UTC (rev 196074)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in        2016-02-03 20:54:30 UTC (rev 196075)
</span><span class="lines">@@ -1191,3 +1191,9 @@
</span><span class="cx"> // touch-action
</span><span class="cx"> manipulation
</span><span class="cx"> #endif
</span><ins>+
+// hanging-punctuation
+allow-end
+first
+force-end
+last
</ins></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderConverterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderConverter.h (196074 => 196075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderConverter.h        2016-02-03 20:15:05 UTC (rev 196074)
+++ trunk/Source/WebCore/css/StyleBuilderConverter.h        2016-02-03 20:54:30 UTC (rev 196075)
</span><span class="lines">@@ -135,6 +135,8 @@
</span><span class="cx">     static BreakBetween convertRegionBreakBetween(StyleResolver&amp;, CSSValue&amp;);
</span><span class="cx">     static BreakInside convertRegionBreakInside(StyleResolver&amp;, CSSValue&amp;);
</span><span class="cx"> #endif
</span><ins>+    
+    static HangingPunctuation convertHangingPunctuation(StyleResolver&amp;, CSSValue&amp;);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     friend class StyleBuilderCustom;
</span><span class="lines">@@ -1279,6 +1281,16 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+inline HangingPunctuation StyleBuilderConverter::convertHangingPunctuation(StyleResolver&amp;, CSSValue&amp; value)
+{
+    HangingPunctuation result = RenderStyle::initialHangingPunctuation();
+    if (is&lt;CSSValueList&gt;(value)) {
+        for (auto&amp; currentValue : downcast&lt;CSSValueList&gt;(value))
+            result |= downcast&lt;CSSPrimitiveValue&gt;(currentValue.get());
+    }
+    return result;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // StyleBuilderConverter_h
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (196074 => 196075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp        2016-02-03 20:15:05 UTC (rev 196074)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp        2016-02-03 20:54:30 UTC (rev 196075)
</span><span class="lines">@@ -613,6 +613,7 @@
</span><span class="cx"> #endif
</span><span class="cx">             || rareInheritedData-&gt;m_lineSnap != other.rareInheritedData-&gt;m_lineSnap
</span><span class="cx">             || rareInheritedData-&gt;m_lineAlign != other.rareInheritedData-&gt;m_lineAlign
</span><ins>+            || rareInheritedData-&gt;m_hangingPunctuation != other.rareInheritedData-&gt;m_hangingPunctuation
</ins><span class="cx"> #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
</span><span class="cx">             || rareInheritedData-&gt;useTouchOverflowScrolling != other.rareInheritedData-&gt;useTouchOverflowScrolling
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (196074 => 196075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.h        2016-02-03 20:15:05 UTC (rev 196074)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h        2016-02-03 20:54:30 UTC (rev 196075)
</span><span class="lines">@@ -879,6 +879,8 @@
</span><span class="cx">     BreakInside breakInside() const { return static_cast&lt;BreakInside&gt;(rareNonInheritedData-&gt;m_breakInside); }
</span><span class="cx">     BreakBetween breakBefore() const { return static_cast&lt;BreakBetween&gt;(rareNonInheritedData-&gt;m_breakBefore); }
</span><span class="cx">     BreakBetween breakAfter() const { return static_cast&lt;BreakBetween&gt;(rareNonInheritedData-&gt;m_breakAfter); }
</span><ins>+    
+    HangingPunctuation hangingPunctuation() const { return static_cast&lt;HangingPunctuation&gt;(rareInheritedData-&gt;m_hangingPunctuation); }
</ins><span class="cx"> 
</span><span class="cx">     float outlineOffset() const
</span><span class="cx">     {
</span><span class="lines">@@ -1622,6 +1624,8 @@
</span><span class="cx">     void setBreakBefore(BreakBetween breakBehavior) { SET_VAR(rareNonInheritedData, m_breakBefore, breakBehavior); }
</span><span class="cx">     void setBreakAfter(BreakBetween breakBehavior) { SET_VAR(rareNonInheritedData, m_breakAfter, breakBehavior); }
</span><span class="cx">     void setBreakInside(BreakInside breakBehavior) { SET_VAR(rareNonInheritedData, m_breakInside, breakBehavior); }
</span><ins>+    
+    void setHangingPunctuation(HangingPunctuation punctuation) { SET_VAR(rareInheritedData, m_hangingPunctuation, punctuation); }
</ins><span class="cx"> 
</span><span class="cx">     // End CSS3 Setters
</span><span class="cx"> 
</span><span class="lines">@@ -1881,6 +1885,7 @@
</span><span class="cx">     static EFloat initialFloating() { return NoFloat; }
</span><span class="cx">     static BreakBetween initialBreakBetween() { return AutoBreakBetween; }
</span><span class="cx">     static BreakInside initialBreakInside() { return AutoBreakInside; }
</span><ins>+    static HangingPunctuation initialHangingPunctuation() { return NoHangingPunctuation; }
</ins><span class="cx">     static ETableLayout initialTableLayout() { return TAUTO; }
</span><span class="cx">     static EBorderCollapse initialBorderCollapse() { return BSEPARATE; }
</span><span class="cx">     static EBorderStyle initialBorderStyle() { return BNONE; }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleConstantsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.h (196074 => 196075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.h        2016-02-03 20:15:05 UTC (rev 196074)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.h        2016-02-03 20:54:30 UTC (rev 196075)
</span><span class="lines">@@ -483,7 +483,17 @@
</span><span class="cx"> enum BreakInside {
</span><span class="cx">     AutoBreakInside, AvoidBreakInside, AvoidColumnBreakInside, AvoidPageBreakInside, AvoidRegionBreakInside
</span><span class="cx"> };
</span><del>-    
</del><ins>+
+enum HangingPunctuation {
+    NoHangingPunctuation = 0,
+    FirstHangingPunctuation = 1 &lt;&lt; 0,
+    LastHangingPunctuation = 1 &lt;&lt; 1,
+    AllowEndHangingPunctuation = 1 &lt;&lt; 2,
+    ForceEndHangingPunctuation = 1 &lt;&lt; 3
+};
+inline HangingPunctuation operator| (HangingPunctuation a, HangingPunctuation b) { return HangingPunctuation(int(a) | int(b)); }
+inline HangingPunctuation&amp; operator|= (HangingPunctuation&amp; a, HangingPunctuation b) { return a = a | b; }
+
</ins><span class="cx"> enum EEmptyCell {
</span><span class="cx">     SHOW, HIDE
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleStyleRareInheritedDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp (196074 => 196075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp        2016-02-03 20:15:05 UTC (rev 196074)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp        2016-02-03 20:54:30 UTC (rev 196075)
</span><span class="lines">@@ -125,6 +125,7 @@
</span><span class="cx"> #if ENABLE(CSS_TRAILING_WORD)
</span><span class="cx">     , trailingWord(static_cast&lt;unsigned&gt;(RenderStyle::initialTrailingWord()))
</span><span class="cx"> #endif
</span><ins>+    , m_hangingPunctuation(RenderStyle::initialHangingPunctuation())
</ins><span class="cx">     , hyphenationLimitBefore(-1)
</span><span class="cx">     , hyphenationLimitAfter(-1)
</span><span class="cx">     , hyphenationLimitLines(-1)
</span><span class="lines">@@ -207,6 +208,7 @@
</span><span class="cx"> #if ENABLE(CSS_TRAILING_WORD)
</span><span class="cx">     , trailingWord(o.trailingWord)
</span><span class="cx"> #endif
</span><ins>+    , m_hangingPunctuation(o.m_hangingPunctuation)
</ins><span class="cx">     , hyphenationString(o.hyphenationString)
</span><span class="cx">     , hyphenationLimitBefore(o.hyphenationLimitBefore)
</span><span class="cx">     , hyphenationLimitAfter(o.hyphenationLimitAfter)
</span><span class="lines">@@ -313,6 +315,7 @@
</span><span class="cx"> #if ENABLE(CSS_TRAILING_WORD)
</span><span class="cx">         &amp;&amp; trailingWord == o.trailingWord
</span><span class="cx"> #endif
</span><ins>+        &amp;&amp; m_hangingPunctuation == o.m_hangingPunctuation
</ins><span class="cx">         &amp;&amp; m_customProperties == o.m_customProperties
</span><span class="cx">         &amp;&amp; arePointingToEqualData(listStyleImage, o.listStyleImage);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleStyleRareInheritedDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h (196074 => 196075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h        2016-02-03 20:15:05 UTC (rev 196074)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h        2016-02-03 20:54:30 UTC (rev 196075)
</span><span class="lines">@@ -137,6 +137,8 @@
</span><span class="cx">     unsigned trailingWord : 1;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    unsigned m_hangingPunctuation : 4;
+
</ins><span class="cx">     AtomicString hyphenationString;
</span><span class="cx">     short hyphenationLimitBefore;
</span><span class="cx">     short hyphenationLimitAfter;
</span></span></pre>
</div>
</div>

</body>
</html>