Changeset 149106 in webkit
- Timestamp:
- Apr 25, 2013 6:43:33 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r149104 r149106 1 2013-04-25 Andreas Kling <akling@apple.com> 2 3 CSS parser: Add error recovery while parsing @-webkit-keyframes key values. 4 <http://webkit.org/b/115175> 5 6 From Blink r148714 by <apavlov@chromium.org>. 7 8 * animations/keyframes-invalid-keys-expected.txt: Added. 9 * animations/keyframes-invalid-keys.html: Added. 10 * fast/css/webkit-keyframes-errors-expected.html: Added. 11 * fast/css/webkit-keyframes-errors.html: Added. 12 1 13 2013-04-25 Ádám Kallai <kadam@inf.u-szeged.hu> 2 14 -
trunk/Source/WebCore/ChangeLog
r149105 r149106 1 2013-04-25 Andreas Kling <akling@apple.com> 2 3 CSS parser: Add error recovery while parsing @-webkit-keyframes key values. 4 <http://webkit.org/b/115175> 5 6 From Blink r148714 by <apavlov@chromium.org>: 7 8 If not a percentage, "from", or "to" value is used in a key list, the rule is erroneous, 9 and due to the absense of recovery, the parser skips the following, valid CSS rule. 10 11 On a related note, keyframes, whose selectors contain invalid keys, should be discarded 12 altogether, according to <http://www.w3.org/TR/css3-animations/#keyframes> 13 14 Tests: animations/keyframes-invalid-keys.html 15 fast/css/webkit-keyframes-errors.html 16 17 * css/CSSGrammar.y.in: 18 * css/CSSParser.cpp: 19 (WebCore::CSSParser::rewriteSpecifiers): 20 1 21 2013-04-25 Antti Koivisto <antti@apple.com> 2 22 -
trunk/Source/WebCore/css/CSSGrammar.y.in
r147028 r149106 877 877 else if (str.equalIgnoringCase("to")) 878 878 $$.fValue = 100; 879 else 879 else { 880 $$.unit = 0; 880 881 YYERROR; 882 } 883 } 884 | error { 885 $$.unit = 0; 881 886 } 882 887 ; -
trunk/Source/WebCore/css/CSSParser.cpp
r148949 r149106 11792 11792 StringBuilder keyString; 11793 11793 for (unsigned i = 0; i < keys->size(); ++i) { 11794 // Just as per the comment below, we ignore keyframes with 11795 // invalid key values (plain numbers or unknown identifiers) 11796 // marked as CSSPrimitiveValue::CSS_UNKNOWN during parsing. 11797 if (keys->valueAt(i)->unit == CSSPrimitiveValue::CSS_UNKNOWN) { 11798 clearProperties(); 11799 return 0; 11800 } 11801 11802 ASSERT(keys->valueAt(i)->unit == CSSPrimitiveValue::CSS_NUMBER); 11794 11803 float key = static_cast<float>(keys->valueAt(i)->fValue); 11804 if (key < 0 || key > 100) { 11805 // As per http://www.w3.org/TR/css3-animations/#keyframes, 11806 // "If a keyframe selector specifies negative percentage values 11807 // or values higher than 100%, then the keyframe will be ignored." 11808 clearProperties(); 11809 return 0; 11810 } 11795 11811 if (i != 0) 11796 11812 keyString.append(',');
Note: See TracChangeset
for help on using the changeset viewer.