Last Comment Bug 169078 - .class:hover should be ignored for non-links in quirks mode
: .class:hover should be ignored for non-links in quirks mode
Product: Core
Classification: Components
Component: CSS Parsing and Computation (show other bugs)
: Trunk
: All All
P2 normal (vote)
: mozilla1.3beta
Assigned To: David Baron :dbaron: ⌚️UTC-8
: Hixie (not reading bugmail)
: Jet Villegas (:jet)
: 159720 189507 191772 192678 (view as bug list)
Depends on: 448783
Blocks: 118291
  Show dependency treegraph
Reported: 2002-09-16 17:50 PDT by (gone - use instead)
Modified: 2008-08-01 10:12 PDT (History)
10 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch (1.17 KB, patch)
2003-01-14 06:21 PST, David Baron :dbaron: ⌚️UTC-8
bzbarsky: review+
bzbarsky: superreview+
Details | Diff | Splinter Review

Description User image (gone - use instead) 2002-09-16 17:50:39 PDT
Build ID: 2002-09-16-08, All OSs.

Summary: On, all of the sub-categories  

Steps to Reproduce:

1. Load
2. Mouseover any element under a bolded heading (eg. 'Video Games' under 'Games'

Expected Results:

In NS 7.0 RTM and Opera/IE 6 for Windows, this is correct (each element gets
TEXT-DECORATION: underline applied on :hover)

Actual Results:

Using the trunk Mozilla/Netscape 7.x builds, we apply TEXT-DECORATION: underline
to all of the elements when you're only mousing over one.

From, here are the style rules:

.odpcat {FONT: 12px arial,geneva; TEXT-DECORATION: none}
.odpcat:hover {TEXT-DECORATION: underline}

Here are the table elements:

<td class=odpcat width=25%>
										<a href="nscp_browse.adp?gn=gwd/Top/Arts&source=NSCPIndex"
class=size2b>Arts</a><br>								&nbsp;<a
&nbsp;<a href="nscp_browse.adp?gn=gwd/Top/Arts/Television&source=NSCPIndex"
&nbsp;<a href="nscp_browse.adp?gn=gwd/Top/Arts/Music&source=NSCPIndex"
Comment 1 User image Doron Rosenberg (IBM) 2003-01-02 13:31:57 PST
Eric - regression or css coding issue?
Comment 2 User image Eric A. Meyer (dead account) 2003-01-02 13:52:36 PST
Coding issue.  The rules should be:

a.odpcat {FONT: 12px arial,geneva; TEXT-DECORATION: none}
a.odpcat:hover {TEXT-DECORATION: underline}

...or else:

.odpcat a {FONT: 12px arial,geneva; TEXT-DECORATION: none}
.odpcat a:hover {TEXT-DECORATION: underline}

As written, the hover styles are being applied to the 'td' cell (since it has a
class of 'odpcat'), and thus getting pixked up by the entire content of the
cell.  This is another case of "hover applies to more than links" surprising a
designer.  I have an action item to write a DevEdge piece on the topic.
Comment 3 User image Susie Wyshak 2003-01-02 14:12:54 PST
I don't see this in a 11/4 branch build (rv:1.0.2). Eric do you have an old
branch you can try this on?

Comment 4 User image Eric A. Meyer (dead account) 2003-01-02 14:56:33 PST
All my back versions are trunk builds.  My Windows version of Netscape 7.01
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120]
doesn't show the reported behavior, but trunk builds from before 11/20 do.

I still believe this to be a site-design error, because the text is content of
the 'td' element and so should be affected by 'text-decoration' changes to their
parent.  However, I'm cc:ing David Baron and Ian Hickson on this in case I'm
wrong about how text decoration is supposed to be applied to inline elements of
a 'table-cell' element, and this is a bug after all.
Comment 5 User image David Baron :dbaron: ⌚️UTC-8 2003-01-02 15:03:52 PST
I suspect the change that triggered this was a change to our :hover behavior --
allowing hover to apply to non-links in more cases (we have some quirks to
prevent :hover from applying to non-links in quirks mode).  I weakened them with
the fix to bug 96984, and I'm hesitant to readd quirks just for one site that
could, one hopes, be easily convinced to change (perhaps with a change as small
as changing ".odpcat:hover" to "a.odpcat:hover").
Comment 6 User image Susie Wyshak 2003-01-02 17:58:02 PST
This works for me on 11/20 branch (Netscape 7.01). 
Comment 7 User image Eric A. Meyer (dead account) 2003-01-10 14:03:20 PST
Given the number of sites (small but noticeable) that will have one of the
following two:

  :hover {color: red;}
  .class:hover {color: red;} would make a lot of sense to change quirks mode so that selectors of the
above two forms are applied only to hyperlinks.  In other words, a hover
selector by itself, or in conjunction with a class value but no element, should
not be applied to non-links.  In standards mode and almost-standards we should
continue applying :hover to everything, of course.

I'd like to formally request this behavior, so where would you prefer it go-- a
reopened 96984, a new bug, or right here?
Comment 8 User image David Baron :dbaron: ⌚️UTC-8 2003-01-10 14:19:52 PST
We already have a quirk for the former, and if you want one for the latter,
reassigning this bug seems fine.
Comment 9 User image Eric A. Meyer (dead account) 2003-01-14 06:13:18 PST
Per comment 8, reassigning bug and changing summary.  See comment 7 for the
proposed change in quirks mode.
Comment 10 User image David Baron :dbaron: ⌚️UTC-8 2003-01-14 06:21:42 PST
Created attachment 111503 [details] [diff] [review]
Comment 11 User image David Baron :dbaron: ⌚️UTC-8 2003-01-14 06:22:11 PST
Really reassigning.
Comment 12 User image Boris Zbarsky [:bz] (still a bit busy) 2003-01-14 10:52:02 PST
Comment on attachment 111503 [details] [diff] [review]

yeah.... we have far too many evang bugs on this issue...
Comment 13 User image David Baron :dbaron: ⌚️UTC-8 2003-01-14 13:51:03 PST
Fix checked in to trunk, 2003-01-14 13:50 PDT.
Comment 14 User image David Baron :dbaron: ⌚️UTC-8 2003-01-19 05:17:13 PST
*** Bug 189507 has been marked as a duplicate of this bug. ***
Comment 15 User image Sander 2003-02-03 11:52:43 PST
*** Bug 191772 has been marked as a duplicate of this bug. ***
Comment 16 User image guanxi 2003-02-03 12:00:06 PST
*** Bug 159720 has been marked as a duplicate of this bug. ***
Comment 17 User image Boris Zbarsky [:bz] (still a bit busy) 2003-02-11 13:46:46 PST
*** Bug 192678 has been marked as a duplicate of this bug. ***
Comment 18 User image Madhur Bhatia 2003-02-21 17:14:47 PST
verified on linux trunk build 2002-02-17-05

Comment 19 User image (gone - use instead) 2003-02-21 17:16:48 PST
...mac, win32?
Comment 20 User image djk 2003-03-28 06:02:29 PST
A bug was just filed which seems like it should have been taken care of by this
bug (at least from the description of this bug).

Bug 199584 notes a page in quirks mode which uses .class:hover.  The :hover
style is still being applied to things like textareas and submit buttons.

Note You need to log in before you can comment on or make changes to this bug.