Closed
Bug 128585
Opened 23 years ago
Closed 16 years ago
Support CSS :first-of-type, :only-of-type, and :last-of-type pseudo-class selectors
Categories
(Core :: CSS Parsing and Computation, enhancement, P2)
Core
CSS Parsing and Computation
Tracking
()
VERIFIED
FIXED
mozilla1.9.1a1
People
(Reporter: imz, Assigned: dbaron)
References
Details
(4 keywords)
Attachments
(2 files, 1 obsolete file)
915 bytes,
text/html
|
Details | |
6.52 KB,
patch
|
Details | Diff | Splinter Review |
Mozilla 0.9.8 doesn't accept ":last-of-type" selector as specified in http://www.w3.org/TR/2001/CR-css3-selectors-20011113/. When viewing an XHTML 1.1 page with a stylesheet that uses a selector like: li:last-of-type one doesn't see the effect of this style rule. (An example of such a page you can find at the URL linked with this report.) Note, that a similar ":last-child" pseudoclass selector seems to be processed by Mozilla the right way.
Reporter | ||
Comment 1•23 years ago
|
||
The same as at the URL given in the bug report.
Reporter | ||
Comment 2•23 years ago
|
||
There is also an official test by W3C (on which Mozilla fails) for the same thing: http://www.w3.org/Style/CSS/Test/CSS3/Selectors/20020115/xhtml/tests/css3-modsel-35.xml
Assignee | ||
Comment 3•23 years ago
|
||
-> enhancement; glazman (although this probably requires adding some interesting lazily constructed data structures to the RuleProcessorData).
Assignee: dbaron → glazman
Severity: normal → enhancement
Updated•23 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Reconfirmed using FizzillaCFM/2002071508. Setting Platform=All.
Hardware: PC → All
Updated•21 years ago
|
Blocks: selectors3
Updated•21 years ago
|
Summary: CSS3: ":last-of-type" pseudoclass selectors are not processed → Support :last-of-type pseudo-class selector
Updated•20 years ago
|
Alias: css-last-of-type
Assignee | ||
Updated•17 years ago
|
QA Contact: ian → style-system
Comment 5•16 years ago
|
||
Is there a bug for :first-of-type? or is it covered within some other bug? I can't seem to find any specific reference to it.
Assignee | ||
Comment 7•16 years ago
|
||
This bug should cover all three; there's no reason we'd implement one without the others.
Summary: Support :last-of-type pseudo-class selector → Support CSS :first-of-type, :only-of-type, and :last-of-type pseudo-class selectors
Assignee | ||
Updated•16 years ago
|
Alias: css-last-of-type
Updated•16 years ago
|
Flags: blocking1.9?
Assignee | ||
Updated•16 years ago
|
Assignee: daniel → dbaron
Assignee | ||
Comment 10•16 years ago
|
||
Applies on top of attachment 308228 [details] [diff] [review], attachment 308230 [details] [diff] [review], and attachment 308231 [details] [diff] [review], all from bug 75375.
Assignee | ||
Updated•16 years ago
|
Attachment #308232 -
Flags: superreview?(bzbarsky)
Attachment #308232 -
Flags: review?(bzbarsky)
Comment 13•16 years ago
|
||
Comment on attachment 308232 [details] [diff] [review] patch >+++ b/layout/style/nsCSSRuleProcessor.cpp >+ else if (nsCSSPseudoClasses::firstOfType == pseudoClass->mAtom || >+ nsCSSPseudoClasses::lastOfType == pseudoClass->mAtom || >+ nsCSSPseudoClasses::onlyOfType == pseudoClass->mAtom) { Would it make sense to also combine firstChild/lastChild/onlyChild like this as well, now that we have this index-caching thing in place? Followup bug is fine. r+sr=bzbarsky
Attachment #308232 -
Flags: superreview?(bzbarsky)
Attachment #308232 -
Flags: superreview+
Attachment #308232 -
Flags: review?(bzbarsky)
Attachment #308232 -
Flags: review+
Assignee | ||
Comment 14•16 years ago
|
||
(In reply to comment #13) > Would it make sense to also combine firstChild/lastChild/onlyChild like this as > well, now that we have this index-caching thing in place? Followup bug is > fine. I don't see why -- those are computationally much less complex (except for bizarre edge cases with ridiculous amounts of text or comments -- though maybe that's not quite as bizarre as I think) since the looping over children can stop at the first/last child element.
Assignee | ||
Comment 15•16 years ago
|
||
Merged on top of the revised patch in bug 75375.
Attachment #308232 -
Attachment is obsolete: true
Comment 16•16 years ago
|
||
With the changes in this patch, GetNthIndex will also stop at the first/last child element if we're doing the aCheckEdgeOnly case. So I think the computational complexity for a single selector occurrence is about the same. The difference is that GetNthIndex will cache, so if the selector occurs more than once we win. And yeah, having a lot of text is not that bizarre, really.
Assignee | ||
Comment 17•16 years ago
|
||
http://hg.mozilla.org/mozilla-central/index.cgi/rev/84d1f9d39ac3 -> fixed (for the release after Firefox 3.0.*)
Status: NEW → RESOLVED
Closed: 16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0
Updated•16 years ago
|
Status: RESOLVED → VERIFIED
Updated•16 years ago
|
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
Comment 18•16 years ago
|
||
Sorry, I hit the wrong button. not verified yet.
Status: REOPENED → RESOLVED
Closed: 16 years ago → 16 years ago
Resolution: --- → FIXED
Comment 19•16 years ago
|
||
marking wanted1.9.1? to get this in the triage queue. P2. Please change if you disagree.
Flags: wanted1.9.1?
Priority: -- → P2
Assignee | ||
Updated•16 years ago
|
Target Milestone: mozilla2.0 → mozilla1.9.1
Updated•16 years ago
|
Keywords: dev-doc-needed
Comment 20•16 years ago
|
||
These are documented now: http://developer.mozilla.org/en/docs/CSS::first-of-type http://developer.mozilla.org/en/docs/CSS::last-of-type http://developer.mozilla.org/en/docs/CSS::only-of-type
Keywords: dev-doc-needed → dev-doc-complete
Comment 21•16 years ago
|
||
(In reply to comment #13) > (From update of attachment 308232 [details] [diff] [review]) > >+++ b/layout/style/nsCSSRuleProcessor.cpp > >+ else if (nsCSSPseudoClasses::firstOfType == pseudoClass->mAtom || > >+ nsCSSPseudoClasses::lastOfType == pseudoClass->mAtom || > >+ nsCSSPseudoClasses::onlyOfType == pseudoClass->mAtom) { > > Would it make sense to also combine firstChild/lastChild/onlyChild like this as > well, now that we have this index-caching thing in place? Followup bug is > fine. > > r+sr=bzbarsky > :first-child and :last-child are already implemented in Firefox 2, I use them all the time.
Comment 22•16 years ago
|
||
Yes; the point of my comment was that we should make those use the new code as well, instead of the implementation they use right now.
Assignee | ||
Updated•16 years ago
|
Target Milestone: mozilla1.9.1 → mozilla1.9.1a1
Comment 23•16 years ago
|
||
Verified with: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1a1pre) Gecko/2008070902 Minefield/3.1a1pre Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1a1pre) Gecko/2008070903 Minefield/3.1a1pre ID:2008070903
Status: RESOLVED → VERIFIED
Flags: wanted1.9.1? → wanted1.9.1+
Keywords: fixed1.9.1
Updated•16 years ago
|
Keywords: verified1.9.1
Updated•16 years ago
|
Keywords: fixed1.9.1
Reporter | ||
Comment 24•15 years ago
|
||
Thanks! It works in Epiphany 2.26.3 (Mozilla/5.0 (X11; U; Linux i686; en; rv:1.9.1.4pre) Gecko/20080528 Epiphany/2.22 Firefox/3.5). Should I somehow close this bugreport now?
Comment 25•15 years ago
|
||
VERIFIED FIXED means that the report has been closed with the resolution that code has been changed to fix it and that someone has subsequently verified that it has indeed been fixed.
You need to log in
before you can comment on or make changes to this bug.
Description
•