WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
17248
:nth-child() and :lang() should allow spaces before, after and inside the expression
https://bugs.webkit.org/show_bug.cgi?id=17248
Summary
:nth-child() and :lang() should allow spaces before, after and inside the exp...
mitz
Reported
2008-02-08 18:29:39 PST
fast/css/css3-nth-child.html is failing because :nth-child(-n + 2) fails to parse because of the spaces around the "+". According to the spec, spaces should be allowed before and after each part of the expression in the parentheses. Similarly, :lang() should allow leading and trailing space.
Attachments
Allow leading/trailing space for CSS nth-*() and lang()
(4.89 KB, patch)
2010-01-05 23:58 PST
,
Yuzo Fujishima
no flags
Details
Formatted Diff
Diff
Allow leading/trailing space for CSS :nth-*() and :lang()
(5.38 KB, patch)
2010-01-06 22:11 PST
,
Yuzo Fujishima
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
mitz
Comment 1
2008-02-09 11:00:02 PST
<
rdar://problem/5733761
>
Dave Hyatt
Comment 2
2008-03-11 11:26:35 PDT
CSS WG is proposing to amend this so that whitespace is only allowed after the '(' and before the ')'. HEre is the text of Daniel's email to www-style: The CSS Working Group discussed today the grammar of the :nth-child() and friends functional pseudo-classes included in the Selectors spec. Because of the CSS lexical scanner, parsing :nth-child(an+b) can be very complex if, as always in CSS, we allow whitespaces everywhere, including between the sign of a and its numeral part and so on. We also would like at some point in the future to discuss real math expressions in CSS, so we don't want to make today choices that could be harmful to that future discussion. We then propose to restrict whitespaces in the nth-child()'s argument to ONLY after the '(' and before the ')'. Since this is not the common practice in CSS - whitespace is usually allowed everywhere - we would like the web designers community to let us know if they think it's an acceptable compromise or if you think for instance that web authors will make a lot of mistakes putting invalid whitespaces inside the expression. Thanks for your valuable feedback. Feel free to forward the question as soon as the answer is sent to the mailing-list. </Daniel>
Yuzo Fujishima
Comment 3
2010-01-05 23:58:41 PST
Created
attachment 45956
[details]
Allow leading/trailing space for CSS nth-*() and lang()
WebKit Review Bot
Comment 4
2010-01-05 23:59:37 PST
style-queue ran check-webkit-style on
attachment 45956
[details]
without any errors.
Darin Adler
Comment 5
2010-01-06 07:53:57 PST
Comment on
attachment 45956
[details]
Allow leading/trailing space for CSS nth-*() and lang() New test cases would be better than changing existing ones. Why remove the testing of the no-spaces cases?
Yuzo Fujishima
Comment 6
2010-01-06 22:11:08 PST
Created
attachment 46021
[details]
Allow leading/trailing space for CSS :nth-*() and :lang()
Yuzo Fujishima
Comment 7
2010-01-06 22:14:16 PST
Thank you for reviewing this. I've added a dedicated test for this bug. Can you take another look? Yuzo
WebKit Review Bot
Comment 8
2010-01-06 22:15:38 PST
style-queue ran check-webkit-style on
attachment 46021
[details]
without any errors.
Darin Adler
Comment 9
2010-01-07 09:44:08 PST
Comment on
attachment 46021
[details]
Allow leading/trailing space for CSS :nth-*() and :lang() r=me Two thoughts on how to improve in the future or with a followup: 1) This doesn't need to be a non-text test. It would be good to make a test of this that dumps as text instead of a render tree. There are plenty of ways to check that CSS has been parsed other than actually dumping out the render tree. 2) We should have a test of the "spaces inside the expression" case, even though we're not changing behavior of that. We want to test all the significant cases, and that clearly is significant, given the discussion in this bug.
WebKit Commit Bot
Comment 10
2010-01-07 12:58:21 PST
Comment on
attachment 46021
[details]
Allow leading/trailing space for CSS :nth-*() and :lang() Clearing flags on attachment: 46021 Committed
r52943
: <
http://trac.webkit.org/changeset/52943
>
WebKit Commit Bot
Comment 11
2010-01-07 12:58:27 PST
All reviewed patches have been landed. Closing bug.
Alexey Proskuryakov
Comment 12
2010-01-07 13:12:57 PST
This was landed without pixel results. Please land those, or better yet, change the test to a dumpAsText one.
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