- Revision
- 140560
- Author
- [email protected]
- Date
- 2013-01-23 11:27:38 -0800 (Wed, 23 Jan 2013)
Log Message
transition-property accepts incorrect "all, none" as value
https://bugs.webkit.org/show_bug.cgi?id=105428
Reviewed by Dean Jackson.
Source/WebCore:
http://www.w3.org/TR/css3-transitions/#transition-property-property
disallows any value like none, all or all, none as it doesn't make
sense. This patch fixes the problem by rejecting the value if set by
the user.
Test: transitions/transitions-parsing.html
* css/CSSParser.cpp:
(WebCore::CSSParser::parseAnimationProperty):
* css/CSSParser.h:
LayoutTests:
Extend the existing tests to cover the bug.
* transitions/transitions-parsing-expected.txt:
* transitions/transitions-parsing.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (140559 => 140560)
--- trunk/LayoutTests/ChangeLog 2013-01-23 19:23:41 UTC (rev 140559)
+++ trunk/LayoutTests/ChangeLog 2013-01-23 19:27:38 UTC (rev 140560)
@@ -1,3 +1,15 @@
+2013-01-23 Alexis Menard <[email protected]>
+
+ transition-property accepts incorrect "all, none" as value
+ https://bugs.webkit.org/show_bug.cgi?id=105428
+
+ Reviewed by Dean Jackson.
+
+ Extend the existing tests to cover the bug.
+
+ * transitions/transitions-parsing-expected.txt:
+ * transitions/transitions-parsing.html:
+
2013-01-23 Andrey Lushnikov <[email protected]>
Web Inspector: speedup highlight regex API in DefaultTextEditor
Modified: trunk/LayoutTests/transitions/transitions-parsing-expected.txt (140559 => 140560)
--- trunk/LayoutTests/transitions/transitions-parsing-expected.txt 2013-01-23 19:23:41 UTC (rev 140559)
+++ trunk/LayoutTests/transitions/transitions-parsing-expected.txt 2013-01-23 19:27:38 UTC (rev 140560)
@@ -59,6 +59,26 @@
PASS computedStyle.transitionProperty is 'all'
PASS style.webkitTransitionProperty is ''
PASS computedStyle.webkitTransitionProperty is 'all'
+PASS style.transitionProperty is ''
+PASS computedStyle.transitionProperty is 'all'
+PASS style.webkitTransitionProperty is ''
+PASS computedStyle.webkitTransitionProperty is 'all'
+PASS style.transitionProperty is ''
+PASS computedStyle.transitionProperty is 'all'
+PASS style.webkitTransitionProperty is ''
+PASS computedStyle.webkitTransitionProperty is 'all'
+PASS style.transitionProperty is ''
+PASS computedStyle.transitionProperty is 'all'
+PASS style.webkitTransitionProperty is ''
+PASS computedStyle.webkitTransitionProperty is 'all'
+PASS style.transitionProperty is ''
+PASS computedStyle.transitionProperty is 'all'
+PASS style.webkitTransitionProperty is ''
+PASS computedStyle.webkitTransitionProperty is 'all'
+PASS style.transitionProperty is ''
+PASS computedStyle.transitionProperty is 'all'
+PASS style.webkitTransitionProperty is ''
+PASS computedStyle.webkitTransitionProperty is 'all'
Valid transition-duration values.
PASS computedStyle.transitionDuration is '0s'
PASS computedStyle.webkitTransitionDuration is '0s'
Modified: trunk/LayoutTests/transitions/transitions-parsing.html (140559 => 140560)
--- trunk/LayoutTests/transitions/transitions-parsing.html 2013-01-23 19:23:41 UTC (rev 140559)
+++ trunk/LayoutTests/transitions/transitions-parsing.html 2013-01-23 19:27:38 UTC (rev 140560)
@@ -110,13 +110,36 @@
shouldBe("style.webkitTransitionProperty", "''");
shouldBe("computedStyle.webkitTransitionProperty", "'all'");
-// Tracked by https://bugs.webkit.org/show_bug.cgi?id=105428.
-/*style.transitionProperty = "all, none";
+style.transitionProperty = "all, none";
shouldBe("style.transitionProperty", "''");
shouldBe("computedStyle.transitionProperty", "'all'");
shouldBe("style.webkitTransitionProperty", "''");
-shouldBe("computedStyle.webkitTransitionProperty", "'all'");*/
+shouldBe("computedStyle.webkitTransitionProperty", "'all'");
+style.transitionProperty = "none, none";
+shouldBe("style.transitionProperty", "''");
+shouldBe("computedStyle.transitionProperty", "'all'");
+shouldBe("style.webkitTransitionProperty", "''");
+shouldBe("computedStyle.webkitTransitionProperty", "'all'");
+
+style.transitionProperty = "none, all";
+shouldBe("style.transitionProperty", "''");
+shouldBe("computedStyle.transitionProperty", "'all'");
+shouldBe("style.webkitTransitionProperty", "''");
+shouldBe("computedStyle.webkitTransitionProperty", "'all'");
+
+style.transitionProperty = "width, none";
+shouldBe("style.transitionProperty", "''");
+shouldBe("computedStyle.transitionProperty", "'all'");
+shouldBe("style.webkitTransitionProperty", "''");
+shouldBe("computedStyle.webkitTransitionProperty", "'all'");
+
+style.transitionProperty = "none, width";
+shouldBe("style.transitionProperty", "''");
+shouldBe("computedStyle.transitionProperty", "'all'");
+shouldBe("style.webkitTransitionProperty", "''");
+shouldBe("computedStyle.webkitTransitionProperty", "'all'");
+
// Tracked by https://bugs.webkit.org/show_bug.cgi?id=105430.
/*style.transitionProperty = "background, font-size, all";
shouldBe("style.transitionProperty", "''");
Modified: trunk/Source/WebCore/ChangeLog (140559 => 140560)
--- trunk/Source/WebCore/ChangeLog 2013-01-23 19:23:41 UTC (rev 140559)
+++ trunk/Source/WebCore/ChangeLog 2013-01-23 19:27:38 UTC (rev 140560)
@@ -1,3 +1,21 @@
+2013-01-23 Alexis Menard <[email protected]>
+
+ transition-property accepts incorrect "all, none" as value
+ https://bugs.webkit.org/show_bug.cgi?id=105428
+
+ Reviewed by Dean Jackson.
+
+ http://www.w3.org/TR/css3-transitions/#transition-property-property
+ disallows any value like none, all or all, none as it doesn't make
+ sense. This patch fixes the problem by rejecting the value if set by
+ the user.
+
+ Test: transitions/transitions-parsing.html
+
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseAnimationProperty):
+ * css/CSSParser.h:
+
2013-01-23 Eric Seidel <[email protected]>
Clarify some usage of shouldUseThreading vs m_haveBackgroundParser, fixing about:blank parsing
Modified: trunk/Source/WebCore/css/CSSParser.cpp (140559 => 140560)
--- trunk/Source/WebCore/css/CSSParser.cpp 2013-01-23 19:23:41 UTC (rev 140559)
+++ trunk/Source/WebCore/css/CSSParser.cpp 2013-01-23 19:27:38 UTC (rev 140560)
@@ -4310,7 +4310,7 @@
return 0;
}
-PassRefPtr<CSSValue> CSSParser::parseAnimationProperty()
+PassRefPtr<CSSValue> CSSParser::parseAnimationProperty(bool& allowAnimationProperty)
{
CSSParserValue* value = m_valueList->current();
if (value->unit != CSSPrimitiveValue::CSS_IDENT)
@@ -4320,8 +4320,10 @@
return cssValuePool().createIdentifierValue(result);
if (equalIgnoringCase(value->string, "all"))
return cssValuePool().createIdentifierValue(CSSValueAll);
- if (equalIgnoringCase(value->string, "none"))
+ if (equalIgnoringCase(value->string, "none")) {
+ allowAnimationProperty = false;
return cssValuePool().createIdentifierValue(CSSValueNone);
+ }
return 0;
}
@@ -4434,6 +4436,7 @@
CSSParserValue* val;
RefPtr<CSSValue> value;
bool allowComma = false;
+ bool allowAnimationProperty = true;
result = 0;
@@ -4485,7 +4488,10 @@
m_valueList->next();
break;
case CSSPropertyWebkitTransitionProperty:
- currValue = parseAnimationProperty();
+ if (allowAnimationProperty)
+ currValue = parseAnimationProperty(allowAnimationProperty);
+ if (value && !allowAnimationProperty)
+ return false;
if (currValue)
m_valueList->next();
break;
Modified: trunk/Source/WebCore/css/CSSParser.h (140559 => 140560)
--- trunk/Source/WebCore/css/CSSParser.h 2013-01-23 19:23:41 UTC (rev 140559)
+++ trunk/Source/WebCore/css/CSSParser.h 2013-01-23 19:27:38 UTC (rev 140560)
@@ -140,7 +140,7 @@
PassRefPtr<CSSValue> parseAnimationIterationCount();
PassRefPtr<CSSValue> parseAnimationName();
PassRefPtr<CSSValue> parseAnimationPlayState();
- PassRefPtr<CSSValue> parseAnimationProperty();
+ PassRefPtr<CSSValue> parseAnimationProperty(bool& allowAnimationProperty);
PassRefPtr<CSSValue> parseAnimationTimingFunction();
bool parseTransformOriginShorthand(RefPtr<CSSValue>&, RefPtr<CSSValue>&, RefPtr<CSSValue>&);