<!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>[176369] 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/176369">176369</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2014-11-19 17:02:12 -0800 (Wed, 19 Nov 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Move the 'quotes' CSS property to the new StyleBuilder
https://bugs.webkit.org/show_bug.cgi?id=138788
Reviewed by Chris Dumez.
Source/WebCore:
Test: fast/css/content/content-quotes-07.html
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
Fix the parser to only accept none as a valid primitive identifier. Tested in
the newly added content-quotes-07.html.
* css/CSSPropertyNames.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertQuotes):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
Move "quotes" to the new style builder.
* rendering/style/RenderStyle.h:
Add an initialQuotes() function for use in the auto-generated style builder.
LayoutTests:
Add a test for the behavior of non-valid primitive identifiers being
used with the quotes property.
* fast/css/content/content-quotes-07-expected.txt: Added.
* fast/css/content/content-quotes-07.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSPropertyNamesin">trunk/Source/WebCore/css/CSSPropertyNames.in</a></li>
<li><a href="#trunkSourceWebCorecssStyleBuilderConverterh">trunk/Source/WebCore/css/StyleBuilderConverter.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleh">trunk/Source/WebCore/rendering/style/RenderStyle.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcsscontentcontentquotes07expectedtxt">trunk/LayoutTests/fast/css/content/content-quotes-07-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcsscontentcontentquotes07html">trunk/LayoutTests/fast/css/content/content-quotes-07.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (176368 => 176369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-11-20 00:59:09 UTC (rev 176368)
+++ trunk/LayoutTests/ChangeLog        2014-11-20 01:02:12 UTC (rev 176369)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-11-16 Sam Weinig <sam@webkit.org>
+
+ Move the 'quotes' CSS property to the new StyleBuilder
+ https://bugs.webkit.org/show_bug.cgi?id=138788
+
+ Reviewed by Chris Dumez.
+
+ Add a test for the behavior of non-valid primitive identifiers being
+ used with the quotes property.
+
+ * fast/css/content/content-quotes-07-expected.txt: Added.
+ * fast/css/content/content-quotes-07.html: Added.
+
</ins><span class="cx"> 2014-11-19 Dean Jackson <dino@apple.com>
</span><span class="cx">
</span><span class="cx"> Handle unprefixed @keyframes rule
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscontentcontentquotes07expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/content/content-quotes-07-expected.txt (0 => 176369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/content/content-quotes-07-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/css/content/content-quotes-07-expected.txt        2014-11-20 01:02:12 UTC (rev 176369)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+The texts between the markers should be identical.
+
+========Marker1========
+
+ab        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+========Marker2========
+
+WWaWWbWWWWWWWW        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+========Marker3========
+
+PASSED
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcsscontentcontentquotes07htmlfromrev176166trunkLayoutTestsfastcsscontentcontentquotes01html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/fast/css/content/content-quotes-07.html (from rev 176166, trunk/LayoutTests/fast/css/content/content-quotes-01.html) (0 => 176369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/content/content-quotes-07.html         (rev 0)
+++ trunk/LayoutTests/fast/css/content/content-quotes-07.html        2014-11-20 01:02:12 UTC (rev 176369)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+<html>
+ <head>
+ <style type="text/css">
+ body { quotes: "WW" "WWWW"; }
+ body { quotes: baseline; } /* This should be ignored, as "baseline" is not a vaild value for quotes */
+ </style>
+ <script type="text/javascript">
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ function run() {
+ testWidth = window.getComputedStyle(document.getElementById("testContainer"), null).getPropertyValue("width");
+ referenceWidth = window.getComputedStyle(document.getElementById("reference"), null).getPropertyValue("width");
+ if (testWidth == referenceWidth)
+ document.getElementById("console").innerText = "PASSED";
+ else
+ document.getElementById("console").innerText = "FAILED: testWidth=" + testWidth +"; expected " + referenceWidth;
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }
+ </script>
+ </head>
+
+ <body onload="setTimeout('run()', 0);">
+ <p id="onlyInBrowser">The texts between the markers should be identical.</p>
+ <p>========Marker1========</p>
+ <table>
+ <tr>
+ <td id="testContainer"><q>a<q>b</q></q></td>
+ <td>1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1</td>
+ </tr>
+ </table>
+ <p>========Marker2========</p>
+ <table>
+ <tr>
+ <td id="reference">WWaWWbWWWWWWWW</td>
+ <td>1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1</td>
+ </tr>
+ </table>
+ <p>========Marker3========</p>
+ <pre id="console"/>
+ </body>
+</html>
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (176368 => 176369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-11-20 00:59:09 UTC (rev 176368)
+++ trunk/Source/WebCore/ChangeLog        2014-11-20 01:02:12 UTC (rev 176369)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2014-11-16 Sam Weinig <sam@webkit.org>
+
+ Move the 'quotes' CSS property to the new StyleBuilder
+ https://bugs.webkit.org/show_bug.cgi?id=138788
+
+ Reviewed by Chris Dumez.
+
+ Test: fast/css/content/content-quotes-07.html
+
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ Fix the parser to only accept none as a valid primitive identifier. Tested in
+ the newly added content-quotes-07.html.
+
+ * css/CSSPropertyNames.in:
+ * css/StyleBuilderConverter.h:
+ (WebCore::StyleBuilderConverter::convertQuotes):
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::applyProperty):
+ Move "quotes" to the new style builder.
+
+ * rendering/style/RenderStyle.h:
+ Add an initialQuotes() function for use in the auto-generated style builder.
+
</ins><span class="cx"> 2014-11-19 Dean Jackson <dino@apple.com>
</span><span class="cx">
</span><span class="cx"> Handle unprefixed @keyframes rule
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (176368 => 176369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2014-11-20 00:59:09 UTC (rev 176368)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2014-11-20 01:02:12 UTC (rev 176369)
</span><span class="lines">@@ -1850,7 +1850,7 @@
</span><span class="cx"> return parseSize(propId, important);
</span><span class="cx">
</span><span class="cx"> case CSSPropertyQuotes: // [<string> <string>]+ | none | inherit
</span><del>- if (id)
</del><ins>+ if (id == CSSValueNone)
</ins><span class="cx"> validPrimitive = true;
</span><span class="cx"> else
</span><span class="cx"> return parseQuotes(propId, important);
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPropertyNamesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (176368 => 176369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPropertyNames.in        2014-11-20 00:59:09 UTC (rev 176368)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in        2014-11-20 01:02:12 UTC (rev 176369)
</span><span class="lines">@@ -220,7 +220,7 @@
</span><span class="cx"> paint-order
</span><span class="cx"> pointer-events [Inherited, NewStyleBuilder]
</span><span class="cx"> position [NewStyleBuilder]
</span><del>-quotes [Inherited]
</del><ins>+quotes [Inherited, NewStyleBuilder, Converter=Quotes]
</ins><span class="cx"> resize [Inherited, NewStyleBuilder, Converter=Resize]
</span><span class="cx"> right [NewStyleBuilder, Initial=initialOffset, Converter=LengthOrAuto]
</span><span class="cx"> size [NewStyleBuilder, Custom=All]
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderConverterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderConverter.h (176368 => 176369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderConverter.h        2014-11-20 00:59:09 UTC (rev 176368)
+++ trunk/Source/WebCore/css/StyleBuilderConverter.h        2014-11-20 01:02:12 UTC (rev 176369)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include "CSSPrimitiveValue.h"
</span><span class="cx"> #include "Length.h"
</span><span class="cx"> #include "Pair.h"
</span><ins>+#include "QuotesData.h"
</ins><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><span class="cx"> #include "TransformFunctions.h"
</span><span class="lines">@@ -65,6 +66,7 @@
</span><span class="cx"> static EResize convertResize(StyleResolver&, CSSValue&);
</span><span class="cx"> static int convertMarqueeRepetition(StyleResolver&, CSSValue&);
</span><span class="cx"> static int convertMarqueeSpeed(StyleResolver&, CSSValue&);
</span><ins>+ static PassRefPtr<QuotesData> convertQuotes(StyleResolver&, CSSValue&);
</ins><span class="cx"> static TextUnderlinePosition convertTextUnderlinePosition(StyleResolver&, CSSValue&);
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="lines">@@ -429,6 +431,29 @@
</span><span class="cx"> return speed;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+inline PassRefPtr<QuotesData> StyleBuilderConverter::convertQuotes(StyleResolver&, CSSValue& value)
+{
+ if (is<CSSPrimitiveValue>(value)) {
+ ASSERT(downcast<CSSPrimitiveValue>(value).getValueID() == CSSValueNone);
+ return QuotesData::create(Vector<std::pair<String, String>>());
+ }
+
+ CSSValueList& list = downcast<CSSValueList>(value);
+ Vector<std::pair<String, String>> quotes;
+ quotes.reserveInitialCapacity(list.length() / 2);
+ for (unsigned i = 0; i < list.length(); i += 2) {
+ CSSValue* first = list.itemWithoutBoundsCheck(i);
+ // item() returns null if out of bounds so this is safe.
+ CSSValue* second = list.item(i + 1);
+ if (!second)
+ break;
+ String startQuote = downcast<CSSPrimitiveValue>(*first).getStringValue();
+ String endQuote = downcast<CSSPrimitiveValue>(*second).getStringValue();
+ quotes.append(std::make_pair(startQuote, endQuote));
+ }
+ return QuotesData::create(quotes);
+}
+
</ins><span class="cx"> inline TextUnderlinePosition StyleBuilderConverter::convertTextUnderlinePosition(StyleResolver&, CSSValue& value)
</span><span class="cx"> {
</span><span class="cx"> // This is true if value is 'auto' or 'alphabetic'.
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (176368 => 176369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2014-11-20 00:59:09 UTC (rev 176368)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2014-11-20 01:02:12 UTC (rev 176369)
</span><span class="lines">@@ -2265,37 +2265,6 @@
</span><span class="cx"> state.style()->setContentAltText(emptyAtom);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><del>-
- case CSSPropertyQuotes:
- if (isInherit) {
- state.style()->setQuotes(state.parentStyle()->quotes());
- return;
- }
- if (isInitial) {
- state.style()->setQuotes(nullptr);
- return;
- }
- if (is<CSSValueList>(*value)) {
- CSSValueList& list = downcast<CSSValueList>(*value);
- Vector<std::pair<String, String>> quotes;
- for (size_t i = 0; i < list.length(); i += 2) {
- CSSValue* first = list.itemWithoutBoundsCheck(i);
- // item() returns null if out of bounds so this is safe.
- CSSValue* second = list.item(i + 1);
- if (!second)
- continue;
- String startQuote = downcast<CSSPrimitiveValue>(*first).getStringValue();
- String endQuote = downcast<CSSPrimitiveValue>(*second).getStringValue();
- quotes.append(std::make_pair(startQuote, endQuote));
- }
- state.style()->setQuotes(QuotesData::create(quotes));
- return;
- }
- if (primitiveValue) {
- if (primitiveValue->getValueID() == CSSValueNone)
- state.style()->setQuotes(QuotesData::create(Vector<std::pair<String, String>>()));
- }
- return;
</del><span class="cx"> // Shorthand properties.
</span><span class="cx"> case CSSPropertyFont:
</span><span class="cx"> if (isInherit) {
</span><span class="lines">@@ -3065,6 +3034,7 @@
</span><span class="cx"> case CSSPropertyPageBreakInside:
</span><span class="cx"> case CSSPropertyPointerEvents:
</span><span class="cx"> case CSSPropertyPosition:
</span><ins>+ case CSSPropertyQuotes:
</ins><span class="cx"> case CSSPropertyResize:
</span><span class="cx"> case CSSPropertyRight:
</span><span class="cx"> case CSSPropertySize:
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (176368 => 176369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.h        2014-11-20 00:59:09 UTC (rev 176368)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h        2014-11-20 01:02:12 UTC (rev 176369)
</span><span class="lines">@@ -1949,6 +1949,7 @@
</span><span class="cx"> static StyleImage* initialBorderImageSource() { return 0; }
</span><span class="cx"> static StyleImage* initialMaskBoxImageSource() { return 0; }
</span><span class="cx"> static PrintColorAdjust initialPrintColorAdjust() { return PrintColorAdjustEconomy; }
</span><ins>+ static QuotesData* initialQuotes() { return nullptr; }
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><span class="cx"> static ScrollSnapType initialScrollSnapType() { return ScrollSnapType::None; }
</span></span></pre>
</div>
</div>
</body>
</html>