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

Issue 14620012: Improved parse error handling for CSSMQ. (Closed)

Created:
7 years, 7 months ago by rune
Modified:
7 years, 6 months ago
CC:
blink-reviews, apavlov+blink_chromium.org, eae+blinkwatch, darktears
Base URL:
https://chromium.googlesource.com/chromium/blink.git@query-selector-performance
Visibility:
Public.

Description

Improved parse error handling for CSSMQ. Corrected the grammar for media queries and media query lists. Do recognize "and(" as function tokens. The existing code erroneously split it into "and" and "(" inside media queries. Keep returning 0 instead of "not all" for @-webkit-mediaquery parse errors to avoid that things like deleteMedium("#?:/") delete "not all" queries. BUG=236302 NOTRY=true Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=151842

Patch Set 1 #

Total comments: 1

Patch Set 2 : Patch based on new error recovery. #

Patch Set 3 : Removed unused error_location nterm #

Patch Set 4 : Added proposed append/deleteMedium tests. #

Patch Set 5 : Moved error recovery for media_query_exp to where it belongs. #

Total comments: 11

Patch Set 6 : Fixed review issues. #

Total comments: 2

Patch Set 7 : Introduced valid_media_query. #

Total comments: 1

Patch Set 8 : Action on separate line. #

Patch Set 9 : Reverted fix for requiring space after "and". #

Patch Set 10 : Let expected result for "and(" be the current implementation. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+138 lines, -42 lines) Patch
A LayoutTests/fast/media/import-media-01.html View 1 chunk +12 lines, -0 lines 0 comments Download
A LayoutTests/fast/media/import-media-01-expected.html View 1 chunk +2 lines, -0 lines 0 comments Download
A LayoutTests/fast/media/media-query-list-syntax.html View 1 2 3 4 5 6 7 8 9 1 chunk +40 lines, -0 lines 0 comments Download
A LayoutTests/fast/media/media-query-list-syntax-expected.txt View 1 2 3 4 9 1 chunk +9 lines, -0 lines 0 comments Download
M LayoutTests/fast/media/mq-append-delete.html View 1 2 3 2 chunks +14 lines, -0 lines 0 comments Download
M LayoutTests/fast/media/mq-append-delete-expected.txt View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M Source/core/css/CSSGrammar.y.in View 1 2 3 4 5 6 7 8 9 chunks +50 lines, -40 lines 0 comments Download
M Source/core/css/CSSParser.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/css/CSSParser.cpp View 1 2 3 4 5 6 7 8 3 chunks +8 lines, -2 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
SeRya
Diff tool doesn't work for me for some reason so I'm answering in comments. 1. ...
7 years, 7 months ago (2013-05-09 16:47:42 UTC) #1
kenneth.r.christiansen
https://codereview.chromium.org/14620012/diff/1/LayoutTests/fast/media/media-descriptor-syntax-01.html File LayoutTests/fast/media/media-descriptor-syntax-01.html (right): https://codereview.chromium.org/14620012/diff/1/LayoutTests/fast/media/media-descriptor-syntax-01.html#newcode13 LayoutTests/fast/media/media-descriptor-syntax-01.html:13: <p> This text should not be red. </p> Maybe ...
7 years, 6 months ago (2013-05-30 17:30:47 UTC) #2
kenneth.r.christiansen
For some reason I cannot see the changes in Source/core/css/CSSGrammar.y.in
7 years, 6 months ago (2013-05-30 17:33:10 UTC) #3
rune
New patch on top of Serya's error recovery fixes. I've done less piggy-backing this time ...
7 years, 6 months ago (2013-05-31 08:51:54 UTC) #4
rune
On 2013/05/30 17:30:47, kenneth.r.christiansen wrote: > https://codereview.chromium.org/14620012/diff/1/LayoutTests/fast/media/media-descriptor-syntax-01.html > File LayoutTests/fast/media/media-descriptor-syntax-01.html (right): > > https://codereview.chromium.org/14620012/diff/1/LayoutTests/fast/media/media-descriptor-syntax-01.html#newcode13 > ...
7 years, 6 months ago (2013-05-31 08:53:37 UTC) #5
rune
On 2013/05/09 16:47:42, SeRya wrote: > Diff tool doesn't work for me for some reason ...
7 years, 6 months ago (2013-05-31 09:24:01 UTC) #6
kenneth.r.christiansen
> to avoid that things like deleteMedium("#?:/") delete "not all" queries. There is a test ...
7 years, 6 months ago (2013-05-31 09:39:14 UTC) #7
rune
On 2013/05/31 09:39:14, kenneth.r.christiansen wrote: > > to avoid that things like deleteMedium("#?:/") delete "not ...
7 years, 6 months ago (2013-05-31 10:12:22 UTC) #8
rune
On 2013/05/31 09:24:01, rune wrote: > On 2013/05/09 16:47:42, SeRya wrote: > > 4. Please ...
7 years, 6 months ago (2013-05-31 22:53:46 UTC) #9
SeRya
https://codereview.chromium.org/14620012/diff/20001/Source/core/css/CSSGrammar.y.in File Source/core/css/CSSGrammar.y.in (right): https://codereview.chromium.org/14620012/diff/20001/Source/core/css/CSSGrammar.y.in#newcode578 Source/core/css/CSSGrammar.y.in:578: media_feature: May be use just IDENT rather than media_feature? ...
7 years, 6 months ago (2013-06-01 06:28:03 UTC) #10
kenneth.r.christiansen
How does this patch affect our pass rate of http://www.w3.org/Style/CSS/Test/MediaQueries/20120229/test_media_queries.html ?
7 years, 6 months ago (2013-06-01 10:12:24 UTC) #11
rune
https://codereview.chromium.org/14620012/diff/20001/Source/core/css/CSSGrammar.y.in File Source/core/css/CSSGrammar.y.in (right): https://codereview.chromium.org/14620012/diff/20001/Source/core/css/CSSGrammar.y.in#newcode578 Source/core/css/CSSGrammar.y.in:578: media_feature: On 2013/06/01 06:28:03, SeRya wrote: > May be ...
7 years, 6 months ago (2013-06-03 09:08:11 UTC) #12
rune
On 2013/06/01 10:12:24, kenneth.r.christiansen wrote: > How does this patch affect our pass rate of ...
7 years, 6 months ago (2013-06-03 09:36:53 UTC) #13
apavlov
https://codereview.chromium.org/14620012/diff/29001/LayoutTests/fast/css/media-rule-no-whitespace.html File LayoutTests/fast/css/media-rule-no-whitespace.html (right): https://codereview.chromium.org/14620012/diff/29001/LayoutTests/fast/css/media-rule-no-whitespace.html#newcode5 LayoutTests/fast/css/media-rule-no-whitespace.html:5: @media all and(min-width: 2px) { #styled { color: red; ...
7 years, 6 months ago (2013-06-03 11:03:44 UTC) #14
rune
On 2013/06/03 11:03:44, apavlov wrote: > https://codereview.chromium.org/14620012/diff/29001/LayoutTests/fast/css/media-rule-no-whitespace.html > File LayoutTests/fast/css/media-rule-no-whitespace.html (right): > > https://codereview.chromium.org/14620012/diff/29001/LayoutTests/fast/css/media-rule-no-whitespace.html#newcode5 > ...
7 years, 6 months ago (2013-06-03 11:17:26 UTC) #15
SeRya
Looks almost OK. https://codereview.chromium.org/14620012/diff/20001/Source/core/css/CSSGrammar.y.in File Source/core/css/CSSGrammar.y.in (right): https://codereview.chromium.org/14620012/diff/20001/Source/core/css/CSSGrammar.y.in#newcode734 Source/core/css/CSSGrammar.y.in:734: | before_media_rule MEDIA_SYM maybe_space media_list ';' ...
7 years, 6 months ago (2013-06-03 11:31:26 UTC) #16
rune
On 2013/06/03 11:31:26, SeRya wrote: > My suggestion is: > > valid_media_query: > ...; > ...
7 years, 6 months ago (2013-06-03 11:40:36 UTC) #17
rune
On 2013/06/03 11:40:36, rune wrote: > On 2013/06/03 11:31:26, SeRya wrote: > > I think ...
7 years, 6 months ago (2013-06-03 11:47:31 UTC) #18
SeRya
LGTM with nits, but would be good to get LGTM from anyone of the reviewers ...
7 years, 6 months ago (2013-06-03 12:58:07 UTC) #19
kenneth.r.christiansen
lgtm
7 years, 6 months ago (2013-06-03 16:59:00 UTC) #20
rune
I did modify the original code for media query tokenization to skip parenthesis for AND ...
7 years, 6 months ago (2013-06-05 11:02:03 UTC) #21
apavlov
lgtm
7 years, 6 months ago (2013-06-05 11:34:45 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rune@opera.com/14620012/49001
7 years, 6 months ago (2013-06-05 11:34:56 UTC) #23
commit-bot: I haz the power
Retried try job too often on win_layout_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_layout_rel&number=8776
7 years, 6 months ago (2013-06-05 13:04:51 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rune@opera.com/14620012/49001
7 years, 6 months ago (2013-06-05 14:25:28 UTC) #25
commit-bot: I haz the power
7 years, 6 months ago (2013-06-05 14:25:54 UTC) #26
Message was sent while issue was closed.
Change committed as 151842

Powered by Google App Engine
This is Rietveld 408576698