Closed
Bug 96984
Opened 25 years ago
Closed 24 years ago
:hover pseudo-class, on other than link, not applied unless type selector included.
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Core
CSS Parsing and Computation
Tracking
()
VERIFIED
FIXED
mozilla1.1alpha
People
(Reporter: val, Assigned: dbaron)
References
Details
(Keywords: testcase)
Attachments
(3 files)
|
1.58 KB,
text/html
|
Details | |
|
3.70 KB,
patch
|
bzbarsky
:
review+
attinasi
:
superreview+
|
Details | Diff | Splinter Review |
|
550 bytes,
text/html
|
Details |
From Bugzilla Helper:
User-Agent: Mozilla/4.6 [en-gb]C-CCK-MCD NetscapeOnline.co.uk (Win98; I)
BuildID: 2001080110
If a :hover pseudo-class selector is used on an element other than a link, then
a Class or Id selector is not sufficient for the selector to be applied - the
Type selector is also required.
So, for example, '.special:hover' won't work with a DIV with 'class="special"',
but 'div.special:hover' will.
The link pseudo-classes (:link & :visited) obviously refer to A elements, and
the CSS Recommendation provides an example of simply a Class selector with a
link pseudo-class.
It's true that the only examples for the :hover, :active & :focus pseudo-classes
include a Type selector i.e. A.
But given that a Class or Id selector is usually sufficient without a Type
selector then, for a specific pseudo-element such as :hover, it is surely
inconsistent to require a Type selector for all elements except A.
Reproducible: Always
Steps to Reproduce:
The attached testcase illustrates this situation.
Comment 2•25 years ago
|
||
hmm... looks like a dupe of bug 5693
Just about every angle has been considered for :hover. :-)
*** This bug has been marked as a duplicate of 5693 ***
Status: UNCONFIRMED → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
Comment 3•25 years ago
|
||
David: not conviced this is a dup of bug 5693, since that one is very complex.
Please verify this yourself. (Testcase observed on Linux, marking all/all.)
OS: Windows 98 → All
Hardware: PC → All
| Assignee | ||
Comment 4•25 years ago
|
||
I think that was intentionally done as a performance hack because we performed
really badly on W3C pages. Once we fix hierarchical :hover and fix the
performance problems hopefully we can remove this hack. Reopening, marking
future, and adding dependency to bug 5693.
| Assignee | ||
Updated•25 years ago
|
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: -- → P2
Target Milestone: --- → Future
| Assignee | ||
Updated•24 years ago
|
Priority: P2 → P3
| Assignee | ||
Comment 7•24 years ago
|
||
CSS3 selectors testsuite testcase:
http://www.w3.org/Style/CSS/Test/CSS3/Selectors/20020115/html/tests/css3-modsel-63.html
| Assignee | ||
Comment 8•24 years ago
|
||
I think this could be fixed now after the changes I made for bug 5693, so
targetting at 1.1beta.
Note the comment in nsCSSStyleSheet.cpp:
// ALSO NOTE: we used to do this only in Quirks mode, but because of
// performance problems we do it all the time now (bug 68821)
// When style resolution due to state changes is optimized this
// should go back to QuirksMode only behavour (see also bug 75559)
Target Milestone: Future → mozilla1.1beta
| Assignee | ||
Updated•24 years ago
|
Target Milestone: mozilla1.1beta → mozilla1.1alpha
| Assignee | ||
Comment 9•24 years ago
|
||
I tested, and there are no performance problems on http://www.w3.org/ .
The changes in bug 5693 made :hover hierarchical and they made it so that
HasStateDependentStyle is event-specific. The latter change means that the
performance problems happening when moving the mouse (for which this was done)
can only occur for :hover selectors (not :active, as happened on
http://www.w3.org/), and the former change means that it won't happen for
:hover since the root node won't constantly go in and out of :hover, but will
rather always be in :hover.
Thus this patch limits the quirk to quirks mode, to selectors that have no ID,
class, tag, or attribute selectors (on the same simple selector), and to the
:hover and :active selectors (and no longer to :focus). It should be :hover
only once we make :active work correctly (see bug 65917).
Comment 10•24 years ago
|
||
And, er, why do we have that quirk again?
Updated•24 years ago
|
Attachment #83342 -
Flags: superreview+
Comment 11•24 years ago
|
||
Comment on attachment 83342 [details] [diff] [review]
patch
Thank your for removing that awful hack I put in! sr=attinasi
| Assignee | ||
Comment 12•24 years ago
|
||
We have the quirk so people who put ":hover" in their stylesheets don't get
behavior that's too unexpected. Do you think we should remove that? I expect
we'd get a bunch of bug reports if we did, but I could be wrong...
Comment 13•24 years ago
|
||
So.. with this patch in quirks mode we apply :hover and :active to:
1) Links
2) <button>, <img>, <input>, <label>, <select>, <textarea>
I suspect the reason the form controls were in the list was because the list was
being used for :focus as well as :hover/:active... I can see applying :active to
buttons in quirks, I guess.... Other than that, I don't really see a reason to
apply :hover/:active to these elements but no others in quirks mode, other than
backwards compat with ourselves.
Not sure what the deal with <img> is.
Why was <li> in the list (and why was it removed)?
| Assignee | ||
Comment 14•24 years ago
|
||
As a quirk, it could be just for links, but authors might want to use styles on
form controls. Furthermore, we don't want to break our own UA.css styles. I'm
considering removing the quirk completely, but I'd want (1) bug 65917 to be
fixed first and (2) not to do it the day before a milestone closure. So I'd
rather not make the quirk more quirky than it was before (so perhaps I should
undo the mIsHTMLLink / nsHTMLAtoms::a switch).
I have no idea why li was there -- it was probably some sort of typo, and it
didn't make any sense to me, so I removed it.
Comment 15•24 years ago
|
||
Comment on attachment 83342 [details] [diff] [review]
patch
ah, right. I forgot that html.css uses this stuff...
r=bzbarsky
Attachment #83342 -
Flags: review+
| Assignee | ||
Comment 16•24 years ago
|
||
Fix checked in 2002-05-18 19:05 PDT.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago → 24 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 17•24 years ago
|
||
*** Bug 161547 has been marked as a duplicate of this bug. ***
| Assignee | ||
Comment 18•24 years ago
|
||
*** Bug 179611 has been marked as a duplicate of this bug. ***
Comment 20•23 years ago
|
||
Comment 21•23 years ago
|
||
I attached a test case showing that the bug still exists in Mozilla 1.4 and 1.5.
If the element (for example P or TD) is not specified, hover does not work.
Thanks for reopening this issue.
Comment 22•23 years ago
|
||
Patrick, the testcase you attached is in quirks mode, where the bug was
purposefully left in. See
http://www.mozilla.org/docs/web-developer/quirks/quirklist.html the last item
under "Miscellaneous & Style". Unfortunately, far too many pages out there
heavily rely on the buggy quirks mode behavior.
Comment 23•21 years ago
|
||
*** Bug 297950 has been marked as a duplicate of this bug. ***
Comment 24•21 years ago
|
||
Is that patch there still any good? Needs approval if so.
Comment 25•21 years ago
|
||
When was this patch checked in?
Comment 26•21 years ago
|
||
Sorry, nvm. bug 297950 was duped against this originally, which ended up
confusing me.
You need to log in
before you can comment on or make changes to this bug.
Description
•