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

Issue 217423005: Get Media Query parser to handle parens, brackets and braces blocks correctly (Closed)

Created:
6 years, 8 months ago by Yoav Weiss
Modified:
6 years, 8 months ago
Reviewers:
rune, eseidel
CC:
blink-reviews, kenneth.christiansen, ed+blinkwatch_opera.com, dglazkov+blink, apavlov+blink_chromium.org, darktears, rune+blink, rwlbuis, simonp
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Get Media Query parser to handle parens, brackets and braces blocks correctly According to the specification, parenthesis, brackets and braces blocks inside media queries should be observed and ignored as a malformed media query. This CL fixes the previous behavior that didn't take that into account. BUG=358041 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=170633

Patch Set 1 #

Patch Set 2 : Fixed algorithm and more tests #

Total comments: 2

Patch Set 3 : Refactored observeBlocks #

Total comments: 3

Patch Set 4 : Added more tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+127 lines, -9 lines) Patch
M Source/build/scripts/make_mediaquery_tokenizer_codepoints.py View 1 chunk +4 lines, -0 lines 0 comments Download
M Source/core/css/MediaQuerySetTest.cpp View 1 2 3 1 chunk +19 lines, -0 lines 0 comments Download
M Source/core/css/parser/MediaQueryParser.h View 1 2 3 3 chunks +24 lines, -2 lines 0 comments Download
M Source/core/css/parser/MediaQueryParser.cpp View 1 2 3 4 chunks +42 lines, -5 lines 0 comments Download
M Source/core/css/parser/MediaQueryToken.h View 1 chunk +6 lines, -2 lines 0 comments Download
M Source/core/css/parser/MediaQueryTokenizer.h View 1 chunk +4 lines, -0 lines 0 comments Download
M Source/core/css/parser/MediaQueryTokenizer.cpp View 1 chunk +20 lines, -0 lines 0 comments Download
M Source/core/css/parser/MediaQueryTokenizerTest.cpp View 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
Yoav Weiss
According to the spec at http://www.w3.org/TR/css3-mediaqueries/#error-handling blocks should be handled while observing "the rules of ...
6 years, 8 months ago (2014-03-30 22:56:54 UTC) #1
rune
Doesn't look like this is handling multiple levels of parentheses/braces correctly. Does this work as ...
6 years, 8 months ago (2014-03-31 09:23:55 UTC) #2
Yoav Weiss
On 2014/03/31 09:23:55, rune - CET wrote: > Doesn't look like this is handling multiple ...
6 years, 8 months ago (2014-03-31 09:30:07 UTC) #3
Yoav Weiss
On 2014/03/31 09:30:07, Yoav Weiss wrote: > On 2014/03/31 09:23:55, rune - CET wrote: > ...
6 years, 8 months ago (2014-03-31 09:44:55 UTC) #4
Yoav Weiss
On 2014/03/31 09:44:55, Yoav Weiss wrote: > On 2014/03/31 09:30:07, Yoav Weiss wrote: > > ...
6 years, 8 months ago (2014-03-31 15:43:14 UTC) #5
eseidel
https://codereview.chromium.org/217423005/diff/20001/Source/core/css/parser/MediaQueryParser.cpp File Source/core/css/parser/MediaQueryParser.cpp (right): https://codereview.chromium.org/217423005/diff/20001/Source/core/css/parser/MediaQueryParser.cpp#newcode165 Source/core/css/parser/MediaQueryParser.cpp:165: if (!m_blockStack.isEmpty() && m_blockStack.last() == ParenthesisBlock) These ifs are ...
6 years, 8 months ago (2014-03-31 16:05:34 UTC) #6
Yoav Weiss
On 2014/03/31 16:05:34, eseidel wrote: > https://codereview.chromium.org/217423005/diff/20001/Source/core/css/parser/MediaQueryParser.cpp > File Source/core/css/parser/MediaQueryParser.cpp (right): > > https://codereview.chromium.org/217423005/diff/20001/Source/core/css/parser/MediaQueryParser.cpp#newcode165 > ...
6 years, 8 months ago (2014-04-01 12:42:11 UTC) #7
eseidel
https://codereview.chromium.org/217423005/diff/40001/Source/core/css/parser/MediaQueryParser.cpp File Source/core/css/parser/MediaQueryParser.cpp (right): https://codereview.chromium.org/217423005/diff/40001/Source/core/css/parser/MediaQueryParser.cpp#newcode154 Source/core/css/parser/MediaQueryParser.cpp:154: if (m_blockStack.isEmpty()) I'm not sure I understand this. I ...
6 years, 8 months ago (2014-04-01 21:15:08 UTC) #8
eseidel
I think this is OK. I would like to see more testing of skipping (possibly ...
6 years, 8 months ago (2014-04-01 21:26:41 UTC) #9
eseidel
Nevermind, I better understand what { and [ do now that you've explained it to ...
6 years, 8 months ago (2014-04-01 21:28:17 UTC) #10
Yoav Weiss
6 years, 8 months ago (2014-04-01 21:43:07 UTC) #11
Yoav Weiss
I've added more tests and fixed the typo.
6 years, 8 months ago (2014-04-01 22:11:41 UTC) #12
eseidel
lgtm
6 years, 8 months ago (2014-04-01 22:11:43 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yoav@yoav.ws/217423005/50001
6 years, 8 months ago (2014-04-01 22:42:42 UTC) #14
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-01 22:54:46 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on win_blink_rel
6 years, 8 months ago (2014-04-01 22:54:46 UTC) #16
Yoav Weiss
The CQ bit was checked by yoav@yoav.ws
6 years, 8 months ago (2014-04-02 03:47:49 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yoav@yoav.ws/217423005/50001
6 years, 8 months ago (2014-04-02 03:47:55 UTC) #18
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-02 04:15:17 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on win_blink_compile_dbg
6 years, 8 months ago (2014-04-02 04:15:17 UTC) #20
Yoav Weiss
The CQ bit was checked by yoav@yoav.ws
6 years, 8 months ago (2014-04-02 04:37:22 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yoav@yoav.ws/217423005/50001
6 years, 8 months ago (2014-04-02 04:37:26 UTC) #22
commit-bot: I haz the power
6 years, 8 months ago (2014-04-02 05:18:20 UTC) #23
Message was sent while issue was closed.
Change committed as 170633

Powered by Google App Engine
This is Rietveld 408576698