Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Issue 13871007: Add CSS parser recovery from errors while parsing @-webkit-keyframes key values. (Closed)

Created:
7 years, 8 months ago by apavlov
Modified:
7 years, 8 months ago
CC:
blink-reviews, apavlov+blink_chromium.org, Julien - ping for review
Visibility:
Public.

Description

Add CSS parser recovery from errors while parsing @-webkit-keyframes key values. If not a percentage, "from", or "to" value is used in a key list, the rule is erroneous, and due to the absense of recovery, the parser skips the following, valid CSS rule. On a related note, keyframes, whose selectors contain invalid keys, should be discarded altogether, according to http://www.w3.org/TR/css3-animations/#keyframes BUG=228870 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=148714

Patch Set 1 #

Patch Set 2 : Brought the behavior closer to the spec, added another test #

Total comments: 1

Patch Set 3 : Introduced + made use of the CSSParserValue::Invalid enum value to avoid overloading isInt #

Total comments: 1

Patch Set 4 : Use CSSPrimitiveValue::CSS_UNKNOWN to denote invalid CSSParserValues for bad keys #

Patch Set 5 : Comment + formatting fixed #

Total comments: 2

Patch Set 6 : Added tests for out-of-range percentage key values #

Unified diffs Side-by-side diffs Delta from patch set Stats (+121 lines, -18 lines) Patch
A + LayoutTests/animations/keyframes-invalid-keys.html View 1 2 3 4 5 2 chunks +27 lines, -17 lines 0 comments Download
A LayoutTests/animations/keyframes-invalid-keys-expected.txt View 1 1 chunk +4 lines, -0 lines 0 comments Download
A LayoutTests/fast/css/webkit-keyframes-errors.html View 1 2 3 4 5 1 chunk +42 lines, -0 lines 0 comments Download
A LayoutTests/fast/css/webkit-keyframes-errors-expected.html View 1 2 3 4 5 1 chunk +26 lines, -0 lines 0 comments Download
M Source/core/css/CSSGrammar.y.in View 1 2 3 1 chunk +6 lines, -1 line 0 comments Download
M Source/core/css/CSSParser.cpp View 1 2 3 4 5 1 chunk +16 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
apavlov
A devtools user was recently unable to edit his styles due to the CSS parser ...
7 years, 8 months ago (2013-04-16 15:29:10 UTC) #1
abarth-chromium
I'm probably not the right person to review this CL.
7 years, 8 months ago (2013-04-16 17:01:55 UTC) #2
eseidel
Tab is probably the person with the most familiarity with CSS parsers. :) We don't ...
7 years, 8 months ago (2013-04-17 00:35:50 UTC) #3
hayato
Unofficial lgtm since I am not an OWNER. https://codereview.chromium.org/13871007/diff/2001/Source/WebCore/css/CSSGrammar.y.in File Source/WebCore/css/CSSGrammar.y.in (right): https://codereview.chromium.org/13871007/diff/2001/Source/WebCore/css/CSSGrammar.y.in#newcode859 Source/WebCore/css/CSSGrammar.y.in:859: $$.isInt ...
7 years, 8 months ago (2013-04-17 04:01:18 UTC) #4
hayato
https://codereview.chromium.org/13871007/diff/8001/Source/core/css/CSSParserValues.h File Source/core/css/CSSParserValues.h (right): https://codereview.chromium.org/13871007/diff/8001/Source/core/css/CSSParserValues.h#newcode119 Source/core/css/CSSParserValues.h:119: Invalid = 0x100000, I am wondering why we need ...
7 years, 8 months ago (2013-04-17 08:22:56 UTC) #5
dglazkov
LGTM after Mike gives his blessing.
7 years, 8 months ago (2013-04-17 18:11:41 UTC) #6
TabAtkins
This is a genuine (and terrible) bug. I'm not 100% sure that the patch does ...
7 years, 8 months ago (2013-04-17 19:47:20 UTC) #7
apavlov
On 2013/04/17 19:47:20, tabatkins wrote: > This is a genuine (and terrible) bug. I'm not ...
7 years, 8 months ago (2013-04-17 20:38:21 UTC) #8
Mike Lawther (Google)
Thanks for fixing this!
7 years, 8 months ago (2013-04-17 22:26:15 UTC) #9
Mike Lawther (Google)
https://codereview.chromium.org/13871007/diff/15001/Source/core/css/CSSParser.cpp File Source/core/css/CSSParser.cpp (right): https://codereview.chromium.org/13871007/diff/15001/Source/core/css/CSSParser.cpp#newcode11298 Source/core/css/CSSParser.cpp:11298: } Nice catch! I can't see where these cases ...
7 years, 8 months ago (2013-04-17 22:26:37 UTC) #10
apavlov
https://codereview.chromium.org/13871007/diff/15001/Source/core/css/CSSParser.cpp File Source/core/css/CSSParser.cpp (right): https://codereview.chromium.org/13871007/diff/15001/Source/core/css/CSSParser.cpp#newcode11298 Source/core/css/CSSParser.cpp:11298: } On 2013/04/17 22:26:37, mikelawther wrote: > Nice catch! ...
7 years, 8 months ago (2013-04-18 04:33:49 UTC) #11
darktears
On 2013/04/18 04:33:49, apavlov wrote: > https://codereview.chromium.org/13871007/diff/15001/Source/core/css/CSSParser.cpp > File Source/core/css/CSSParser.cpp (right): > > https://codereview.chromium.org/13871007/diff/15001/Source/core/css/CSSParser.cpp#newcode11298 > ...
7 years, 8 months ago (2013-04-18 14:29:19 UTC) #12
Mike Lawther (Google)
lgtm Thanks for the updated tests.
7 years, 8 months ago (2013-04-18 23:44:15 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/apavlov@chromium.org/13871007/24001
7 years, 8 months ago (2013-04-19 08:11:18 UTC) #14
commit-bot: I haz the power
Presubmit check for 13871007-24001 failed and returned exit status -2001. The presubmit check was hung. ...
7 years, 8 months ago (2013-04-19 08:17:21 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/apavlov@chromium.org/13871007/24001
7 years, 8 months ago (2013-04-19 08:32:26 UTC) #16
commit-bot: I haz the power
Presubmit check for 13871007-24001 failed and returned exit status -2001. The presubmit check was hung. ...
7 years, 8 months ago (2013-04-19 08:38:30 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/apavlov@chromium.org/13871007/24001
7 years, 8 months ago (2013-04-19 08:44:09 UTC) #18
commit-bot: I haz the power
Presubmit check for 13871007-24001 failed and returned exit status -2001. The presubmit check was hung. ...
7 years, 8 months ago (2013-04-19 08:50:14 UTC) #19
apavlov
7 years, 8 months ago (2013-04-19 09:52:20 UTC) #20
Message was sent while issue was closed.
Committed patchset #6 manually as r148714 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698