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

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

Created:
7 years, 7 months ago by rune
Modified:
7 years, 7 months ago
Reviewers:
SeRya
CC:
blink-reviews, apavlov+blink_chromium.org, darktears
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Improved parse error handling for CSSMQ. Implemented media query error handling as specified in CSS Media Queries. As part of that, implemented a stack that keeps track of matching brackets to do correct error handling for matching brackets/parentheses as specified in CSS2.1 and Media Queries. Matching brackets is only done for Media Queries error handling for now to avoid the patch getting too big, but it should be simple to implement better error handling for other parts of the grammar on top of this. Also, the bracket stack emits unmatched brackets at the end of the token stream to handle unexpected end-of-file as specified in CSS2.1. Do recognize "and(" as function tokens. The existing code erroneously split it into "and" and "(" inside media queries. This patch does not address HTML5 compliant parsing of media attributes as media query lists. BUG=236302

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+394 lines, -115 lines) Patch
M LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-at-rule-invalid-expected.txt View 1 chunk +0 lines, -5 lines 0 comments Download
M LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-at-rule-valid-expected.txt View 1 chunk +9 lines, -0 lines 0 comments Download
M LayoutTests/css3/filters/custom-with-at-rule-syntax/script-tests/parsing-at-rule-invalid.js View 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/css3/filters/custom-with-at-rule-syntax/script-tests/parsing-at-rule-valid.js View 1 chunk +3 lines, -0 lines 0 comments Download
M LayoutTests/fast/css/media-rule-no-whitespace.html View 1 chunk +2 lines, -1 line 0 comments Download
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
M LayoutTests/fast/media/matchmedium-query-api.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/media/matchmedium-query-api-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/media/media-descriptor-syntax-01.html View 1 chunk +4 lines, -4 lines 0 comments Download
M LayoutTests/fast/media/media-descriptor-syntax-01-expected.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/media/media-descriptor-syntax-02.html View 1 chunk +4 lines, -5 lines 0 comments Download
M LayoutTests/fast/media/media-descriptor-syntax-02-expected.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/media/media-descriptor-syntax-03.html View 1 chunk +4 lines, -5 lines 0 comments Download
M LayoutTests/fast/media/media-descriptor-syntax-03-expected.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/media/media-descriptor-syntax-05.html View 1 chunk +4 lines, -4 lines 0 comments Download
M LayoutTests/fast/media/media-descriptor-syntax-05-expected.html View 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/fast/media/media-query-and.html View 1 chunk +24 lines, -0 lines 0 comments Download
A LayoutTests/fast/media/media-query-and-expected.html View 1 chunk +3 lines, -0 lines 0 comments Download
M LayoutTests/fast/media/media-query-list-01.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/media/media-query-list-01-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/fast/media/media-query-list-syntax.html View 1 chunk +40 lines, -0 lines 0 comments Download
A LayoutTests/fast/media/media-query-list-syntax-expected.txt View 1 chunk +8 lines, -0 lines 0 comments Download
M LayoutTests/fast/media/mq-invalid-syntax-01.html View 1 chunk +3 lines, -3 lines 0 comments Download
M LayoutTests/fast/media/mq-invalid-syntax-01-expected.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/media/mq-invalid-syntax-02.html View 1 chunk +3 lines, -3 lines 0 comments Download
M LayoutTests/fast/media/mq-invalid-syntax-02-expected.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/media/mq-js-media-except-02.html View 2 chunks +2 lines, -1 line 0 comments Download
M LayoutTests/fast/media/mq-js-media-except-02-expected.html View 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/fast/media/mq-js-media-forward-syntax.html View 1 chunk +6 lines, -15 lines 0 comments Download
M LayoutTests/fast/media/mq-js-media-forward-syntax-expected.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/media/mq-js-stylesheet-media-01.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/media/mq-js-stylesheet-media-01-expected.html View 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/media/mq-js-stylesheet-media-02.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/media/mq-js-stylesheet-media-02-expected.html View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/css/CSSGrammar.y.in View 7 chunks +54 lines, -28 lines 0 comments Download
M Source/core/css/CSSParser.h View 5 chunks +93 lines, -0 lines 0 comments Download
M Source/core/css/CSSParser.cpp View 15 chunks +90 lines, -22 lines 0 comments Download
M Source/core/css/MediaList.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/css/MediaList.cpp View 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
SeRya
You introduce new method for handling unmatched braces while other parts of grammar use another ...
7 years, 7 months ago (2013-04-29 16:32:45 UTC) #1
rune
On 2013/04/29 16:32:45, SeRya wrote: > You introduce new method for handling unmatched braces while ...
7 years, 7 months ago (2013-04-30 09:42:27 UTC) #2
SeRya
On 2013/04/30 09:42:27, rune wrote: > On 2013/04/29 16:32:45, SeRya wrote: > > You introduce ...
7 years, 7 months ago (2013-04-30 12:28:06 UTC) #3
rune
On 2013/04/30 12:28:06, SeRya wrote: > On 2013/04/30 09:42:27, rune wrote: > > On 2013/04/29 ...
7 years, 7 months ago (2013-05-02 07:58:38 UTC) #4
SeRya
On 2013/05/02 07:58:38, rune wrote: > On 2013/04/30 12:28:06, SeRya wrote: > > On 2013/04/30 ...
7 years, 7 months ago (2013-05-05 10:10:41 UTC) #5
rune
On 2013/05/05 10:10:41, SeRya wrote: > There is my prototype what handles this issue in ...
7 years, 7 months ago (2013-05-06 09:23:07 UTC) #6
rune
7 years, 7 months ago (2013-05-08 15:18:53 UTC) #7
Message was sent while issue was closed.
On 2013/05/06 09:23:07, rune wrote:
> On 2013/05/05 10:10:41, SeRya wrote:
> > There is my prototype what handles this issue in the grammar. It doesn't
look
> > awkward for me. Have a look please: https://codereview.chromium.org/14926003
> 
> Yeah, that looks ok. Can I take your approach into this patch then, and fix
the
> mq syntax at the same time?
> 
> I think I'll split out the "and(" change since it's a separate issue.

Superseeded by 14620012

Powered by Google App Engine
This is Rietveld 408576698