Diff
Modified: branches/safari-534.54-branch/LayoutTests/ChangeLog (104052 => 104053)
--- branches/safari-534.54-branch/LayoutTests/ChangeLog 2012-01-04 19:36:11 UTC (rev 104052)
+++ branches/safari-534.54-branch/LayoutTests/ChangeLog 2012-01-04 19:38:42 UTC (rev 104053)
@@ -1,5 +1,19 @@
2011-1-4 Lucas Forschler <[email protected]>
+ Merge 95071
+
+ 2011-09-13 Adam Klein <[email protected]>
+
+ Fix cssText property of counter-valued CSSPrimitiveValue and avoid uninitialized read
+ https://bugs.webkit.org/show_bug.cgi?id=68021
+
+ Reviewed by Tony Chang.
+
+ * fast/css/counters/counter-cssText-expected.txt: Added.
+ * fast/css/counters/counter-cssText.html: Added.
+
+2011-1-4 Lucas Forschler <[email protected]>
+
Merge 95059
2011-09-13 Jeremy Apthorp <[email protected]>
Copied: branches/safari-534.54-branch/LayoutTests/fast/css/counters/counter-cssText-expected.txt (from rev 95071, trunk/LayoutTests/fast/css/counters/counter-cssText-expected.txt) (0 => 104053)
--- branches/safari-534.54-branch/LayoutTests/fast/css/counters/counter-cssText-expected.txt (rev 0)
+++ branches/safari-534.54-branch/LayoutTests/fast/css/counters/counter-cssText-expected.txt 2012-01-04 19:38:42 UTC (rev 104053)
@@ -0,0 +1,13 @@
+Test the cssText output of counter-valued CSSPrimitiveValues
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS rules[2].style.cssText is "content: counter(section, decimal); "
+PASS rules[3].style.cssText is "content: counters(section, ':', decimal); "
+PASS rules[4].style.cssText is "content: counter(section, lower-roman); "
+PASS rules[5].style.cssText is "content: counters(section, ',', upper-roman); "
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Copied: branches/safari-534.54-branch/LayoutTests/fast/css/counters/counter-cssText.html (from rev 95071, trunk/LayoutTests/fast/css/counters/counter-cssText.html) (0 => 104053)
--- branches/safari-534.54-branch/LayoutTests/fast/css/counters/counter-cssText.html (rev 0)
+++ branches/safari-534.54-branch/LayoutTests/fast/css/counters/counter-cssText.html 2012-01-04 19:38:42 UTC (rev 104053)
@@ -0,0 +1,39 @@
+<html>
+<head>
+<link rel=stylesheet href=""
+<script src=""
+<style>
+body {
+ counter-reset: section;
+}
+h1 {
+ counter-increment: section;
+}
+h2:before {
+ content: counter(section);
+}
+h2:after {
+ content: counters(section, ":", decimal);
+}
+h3:before {
+ content: counter(section, lower-roman);
+}
+h3:after {
+ content: counters(section, ",", upper-roman);
+}
+</style>
+</head>
+<p id=description></p>
+<div id=console></div>
+<script>
+description("Test the cssText output of counter-valued CSSPrimitiveValues");
+var rules = document.styleSheets[1].cssRules;
+shouldBeEqualToString("rules[2].style.cssText", "content: counter(section, decimal); ");
+shouldBeEqualToString("rules[3].style.cssText", "content: counters(section, ':', decimal); ");
+shouldBeEqualToString("rules[4].style.cssText", "content: counter(section, lower-roman); ");
+shouldBeEqualToString("rules[5].style.cssText", "content: counters(section, ',', upper-roman); ");
+window.successfullyParsed = true;
+</script>
+<script src=""
+</body>
+</html>
Modified: branches/safari-534.54-branch/Source/WebCore/ChangeLog (104052 => 104053)
--- branches/safari-534.54-branch/Source/WebCore/ChangeLog 2012-01-04 19:36:11 UTC (rev 104052)
+++ branches/safari-534.54-branch/Source/WebCore/ChangeLog 2012-01-04 19:38:42 UTC (rev 104053)
@@ -1,5 +1,26 @@
2011-1-4 Lucas Forschler <[email protected]>
+ Merge 95071
+
+ 2011-09-13 Adam Klein <[email protected]>
+
+ Fix cssText property of counter-valued CSSPrimitiveValue and avoid uninitialized read
+ https://bugs.webkit.org/show_bug.cgi?id=68021
+
+ Reviewed by Tony Chang.
+
+ Reported by valgrind in http://crbug.com/60653.
+
+ Besides fixing the uninitialized read, add support for outputting the
+ list separator for counters() calls and the list-style name.
+
+ Test: fast/css/counters/counter-cssText.html
+
+ * css/CSSPrimitiveValue.cpp:
+ (WebCore::CSSPrimitiveValue::cssText):
+
+2011-1-4 Lucas Forschler <[email protected]>
+
Merge 95059
2011-09-13 Jeremy Apthorp <[email protected]>
Modified: branches/safari-534.54-branch/Source/WebCore/css/CSSPrimitiveValue.cpp (104052 => 104053)
--- branches/safari-534.54-branch/Source/WebCore/css/CSSPrimitiveValue.cpp 2012-01-04 19:36:11 UTC (rev 104052)
+++ branches/safari-534.54-branch/Source/WebCore/css/CSSPrimitiveValue.cpp 2012-01-04 19:38:42 UTC (rev 104053)
@@ -739,12 +739,22 @@
text += m_value.string;
text += ")";
break;
- case CSS_COUNTER:
- text = "counter(";
- text += String::number(m_value.num);
+ case CSS_COUNTER: {
+ String separator = m_value.counter->separator();
+ text = separator.isEmpty() ? "counter(" : "counters(";
+ text += m_value.counter->identifier();
+ if (!separator.isEmpty()) {
+ text += ", ";
+ text += quoteCSSStringIfNeeded(separator);
+ }
+ const char* listStyleName = getValueName(m_value.counter->listStyleNumber() + CSSValueDisc);
+ if (listStyleName) {
+ text += ", ";
+ text += listStyleName;
+ }
text += ")";
- // FIXME: Add list-style and separator
break;
+ }
case CSS_RECT: {
DEFINE_STATIC_LOCAL(const String, rectParen, ("rect("));