WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
138310
Add parsing for :role()
https://bugs.webkit.org/show_bug.cgi?id=138310
Summary
Add parsing for :role()
Sukolsak Sakshuwong
Reported
2014-11-03 06:16:34 PST
See
https://bugs.webkit.org/show_bug.cgi?id=138196
Attachments
Patch
(7.00 KB, patch)
2014-11-03 06:21 PST
,
Sukolsak Sakshuwong
no flags
Details
Formatted Diff
Diff
Patch
(16.91 KB, patch)
2014-11-15 16:05 PST
,
Sukolsak Sakshuwong
no flags
Details
Formatted Diff
Diff
Test for case sensitivity
(17.53 KB, patch)
2014-11-15 16:32 PST
,
Sukolsak Sakshuwong
no flags
Details
Formatted Diff
Diff
Remove doubled changelog
(17.08 KB, patch)
2014-11-17 17:06 PST
,
Sukolsak Sakshuwong
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Sukolsak Sakshuwong
Comment 1
2014-11-03 06:21:36 PST
Created
attachment 240847
[details]
Patch
Benjamin Poulain
Comment 2
2014-11-04 23:41:56 PST
Comment on
attachment 240847
[details]
Patch First round or review. Sorry for the delay, I have a huge backlog on my review queue :( The patch looks good but: -The new selector should be under ENABLE(CSS_SELECTORS_LEVEL4). Sorry I did not mention that by mail, :role() is part of the new selectors we are adding for Level 4 :( -You should also include test for things that can go wrong, invalid input. For example, :role(), :role()), :role(25), :role(a, b), etc. We need to ensure we do not generate valid CSSSelector for invalid input. -You should include tests covering uppercase and lowercase. We still need to define how case-sensitivity will work with :role(), in the meantime we should make sure the behavior is tested so that some tests would break when the behavior changes. -I have recently added the test fast/selectors/invalid-functional-pseudo-class.html for functional pseudo class. Can you add :role() there too and extend the results? I am a bit surprised you did not need to modify the parser.
Benjamin Poulain
Comment 3
2014-11-14 20:04:43 PST
Any update? I can help if you have questions.
Sukolsak Sakshuwong
Comment 4
2014-11-15 16:05:37 PST
Created
attachment 241664
[details]
Patch
Sukolsak Sakshuwong
Comment 5
2014-11-15 16:32:59 PST
Created
attachment 241666
[details]
Test for case sensitivity
Sukolsak Sakshuwong
Comment 6
2014-11-15 16:39:58 PST
Sorry for the delay. I was busy with school work. Thank you very much for the review. (In reply to
comment #2
)
> -The new selector should be under ENABLE(CSS_SELECTORS_LEVEL4). Sorry I did > not mention that by mail, :role() is part of the new selectors we are adding > for Level 4 :(
Done.
> -You should also include test for things that can go wrong, invalid input. > For example, :role(), :role()), :role(25), :role(a, b), etc. We need to > ensure we do not generate valid CSSSelector for invalid input.
Done.
> -You should include tests covering uppercase and lowercase. We still need to > define how case-sensitivity will work with :role(), in the meantime we > should make sure the behavior is tested so that some tests would break when > the behavior changes.
Done?
> -I have recently added the test > fast/selectors/invalid-functional-pseudo-class.html for functional pseudo > class. Can you add :role() there too and extend the results?
Done.
> I am a bit surprised you did not need to modify the parser.
That seemed to be wrong. The first patch generated valid CSSSelector for invalid input such as :role(42).
Darin Adler
Comment 7
2014-11-16 19:58:14 PST
Comment on
attachment 241666
[details]
Test for case sensitivity View in context:
https://bugs.webkit.org/attachment.cgi?id=241666&action=review
> LayoutTests/ChangeLog:18 > + Add parsing for :role() > +
https://bugs.webkit.org/show_bug.cgi?id=138310
Doubled change log here.
Benjamin Poulain
Comment 8
2014-11-17 16:20:19 PST
Comment on
attachment 241666
[details]
Test for case sensitivity View in context:
https://bugs.webkit.org/attachment.cgi?id=241666&action=review
Looks great. Some minor comments. The tests look good, you'll just need to clean up the changelog.
> Source/WebCore/css/CSSGrammar.y.in:67 > + case ROLEFUNCTION:
I don't think you need to define a new token type. The type "FUNCTION should work.
> Source/WebCore/css/CSSParser.cpp:10703 > + m_token = ROLEFUNCTION;
You still need this, but I think the token type could be simply FUNCTION.
> Source/WebCore/css/CSSSelector.h:162 > + PseudoClassRole,
Uh, I should really sort this enum some day :)
Sukolsak Sakshuwong
Comment 9
2014-11-17 16:57:42 PST
Thank you for the review. (In reply to
comment #7
)
> > LayoutTests/ChangeLog:18 > > + Add parsing for :role() > > +
https://bugs.webkit.org/show_bug.cgi?id=138310
> > Doubled change log here.
I will fix this. (In reply to
comment #8
)
> > Source/WebCore/css/CSSGrammar.y.in:67 > > + case ROLEFUNCTION: > > I don't think you need to define a new token type. The type "FUNCTION > should work. > > > Source/WebCore/css/CSSParser.cpp:10703 > > + m_token = ROLEFUNCTION; > > You still need this, but I think the token type could be simply FUNCTION.
If I use "FUNCTION", :role(42) will be valid because there is "| ':' FUNCTION maybe_space maybe_unary_operator INTEGER maybe_space ')' {" in the grammar.
Sukolsak Sakshuwong
Comment 10
2014-11-17 17:06:16 PST
Created
attachment 241754
[details]
Remove doubled changelog
Benjamin Poulain
Comment 11
2014-11-17 17:41:56 PST
(In reply to
comment #9
)
> > I don't think you need to define a new token type. The type "FUNCTION > > should work. > > > > > Source/WebCore/css/CSSParser.cpp:10703 > > > + m_token = ROLEFUNCTION; > > > > You still need this, but I think the token type could be simply FUNCTION. > > If I use "FUNCTION", :role(42) will be valid because there is > > "| ':' FUNCTION maybe_space maybe_unary_operator INTEGER maybe_space ')' {" > > in the grammar.
Oh, of course. I was wondering how :lang() got away with it...but Dhi recently changed lang to have its own token type.
Benjamin Poulain
Comment 12
2014-11-17 17:42:28 PST
Comment on
attachment 241754
[details]
Remove doubled changelog Let's do it!
WebKit Commit Bot
Comment 13
2014-11-17 18:21:39 PST
Comment on
attachment 241754
[details]
Remove doubled changelog Clearing flags on attachment: 241754 Committed
r176241
: <
http://trac.webkit.org/changeset/176241
>
WebKit Commit Bot
Comment 14
2014-11-17 18:21:47 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug