RESOLVED FIXED 5468
CSS3: only-child and only-of-type pseudo-selectors (affects Acid3)
https://bugs.webkit.org/show_bug.cgi?id=5468
Summary CSS3: only-child and only-of-type pseudo-selectors (affects Acid3)
Timothy Hatcher
Reported 2005-10-23 08:46:17 PDT
Attachments
patch to *remove* support for these properties (99.07 KB, patch)
2007-02-07 06:52 PST, Nicholas Shanks
hyatt: review-
lets see if dave likes this one any better (101.80 KB, patch)
2007-02-07 18:13 PST, Nicholas Shanks
hyatt: review-
aye aye cap'n! (102.83 KB, patch)
2007-02-08 21:59 PST, Nicholas Shanks
no flags
Implement :only-child and :only-of-type (147.89 KB, patch)
2008-02-02 11:58 PST, Dave Hyatt
no flags
Patch (148.00 KB, patch)
2008-02-02 12:21 PST, Dave Hyatt
oliver: review+
Eric Seidel (no email)
Comment 1 2005-12-27 15:41:55 PST
Joost also just filed a bug asking for the nth- selectors as well.
Nicholas Shanks
Comment 3 2006-11-20 16:17:42 PST
*** Bug 11385 has been marked as a duplicate of this bug. ***
Nicholas Shanks
Comment 4 2006-11-20 16:18:10 PST
*** Bug 11386 has been marked as a duplicate of this bug. ***
mitz
Comment 5 2006-12-08 12:53:32 PST
*** Bug 11785 has been marked as a duplicate of this bug. ***
Nicholas Shanks
Comment 6 2007-02-07 06:52:39 PST
Created attachment 12999 [details] patch to *remove* support for these properties Until such time as a correct implementation can be developed, I believe it would be better to not support these at all rather than to support them incorrectly. The current behaviour of :last-child behaving like a base element selector, and :only-child behaving like :first-child is highly detrimental.
Maciej Stachowiak
Comment 7 2007-02-07 08:05:02 PST
This might not be a bad idea, though I think hyatt would be the best judge.
Gabe da Silveira
Comment 8 2007-02-07 08:13:15 PST
I'll put in my vote for that idea as well since this bug bit me in the ass hard a few months ago.
Dave Hyatt
Comment 9 2007-02-07 15:31:08 PST
Comment on attachment 12999 [details] patch to *remove* support for these properties Yeah, I agree with removing support for these. You haven't adequately removed them unless the rules are rejected. You need to go further and actually yank the names from the list of pseudo types completely. For example: :last-child, div { color: red } should be rejected since last-child is unrecognized. Also, :not(:last-child) needs to also be rejected. With your patch :last-child just always returns a failed match, which will cause :not(:last-child) to always match.
Nicholas Shanks
Comment 10 2007-02-07 18:13:52 PST
Created attachment 13032 [details] lets see if dave likes this one any better
Dave Hyatt
Comment 11 2007-02-08 21:15:10 PST
Comment on attachment 13032 [details] lets see if dave likes this one any better Patch looks good. Since the tests that are being landed are expected failures, I'd prefer they go under css3/expected_failures/ (as we did with table tests that have failing results), so that there's no confusion about the fact that we're deliberately checking in failing test cases. I'll r+ once the tests are moved.
Dave Hyatt
Comment 12 2007-02-08 21:16:25 PST
(Also changelog typo, I assume you meant "erroneously")
Nicholas Shanks
Comment 13 2007-02-08 21:59:04 PST
Created attachment 13078 [details] aye aye cap'n!
Dave Hyatt
Comment 14 2007-02-08 22:19:17 PST
Comment on attachment 13078 [details] aye aye cap'n! r=me
Mark Rowe (bdash)
Comment 15 2007-02-09 06:06:37 PST
Patch to remove support landed in r19528.
Mark Rowe (bdash)
Comment 16 2007-02-09 06:07:17 PST
Comment on attachment 13078 [details] aye aye cap'n! Marking obsolete to get it out of the commit queue.
Mark Rowe (bdash)
Comment 17 2007-02-09 06:08:54 PST
Comment on attachment 13078 [details] aye aye cap'n! Apparently being obsolete doesn't matter to the commit queue... Removing review flag to make it go away.
Eric Seidel (no email)
Comment 18 2007-12-28 22:22:31 PST
Acid3, test0 depends on dynamic :last-child support.
Eric Seidel (no email)
Comment 19 2008-01-01 22:22:32 PST
:last-of-type causes test 39 to fail as well. selectorTest(function (doc, add, expect) { builder(doc); var match = add(":last-of-type"); var values = [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1]; for (var i = 0; i < elements.length; i += 1) expect(elements[i], values[i] ? match : 0, "part 2:" + i); }); i = 7 when we fail.
Eric Seidel (no email)
Comment 20 2008-01-09 01:34:15 PST
Returning this to unassigned as it's seen no activity from the assignee in 11 months.
Dave Hyatt
Comment 21 2008-02-02 11:53:05 PST
*** Bug 17155 has been marked as a duplicate of this bug. ***
Dave Hyatt
Comment 22 2008-02-02 11:58:21 PST
Created attachment 18871 [details] Implement :only-child and :only-of-type
Dave Hyatt
Comment 23 2008-02-02 12:21:51 PST
Oliver Hunt
Comment 24 2008-02-02 15:04:19 PST
Comment on attachment 18872 [details] Patch r=me
Dave Hyatt
Comment 25 2008-02-02 18:31:33 PST
Fixed in r29944.
Note You need to log in before you can comment on or make changes to this bug.