Last Comment Bug 109184 - Style "a:hover text-decoration:underline' works intermittently
: Style "a:hover text-decoration:underline' works intermittently
: css2
Product: Core
Classification: Components
Component: Layout (show other bugs)
: Trunk
: Other Linux
P3 major with 2 votes (vote)
: Future
Assigned To: David Baron :dbaron: ⌚️UTC-8
: Jet Villegas (:jet)
: 270961 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2001-11-08 16:41 PST by Travis Saling
Modified: 2009-10-20 11:55 PDT (History)
9 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

screenshot of the problem (18.92 KB, image/png)
2001-11-08 17:51 PST, Travis Saling
no flags Details

Description User image Travis Saling 2001-11-08 16:41:51 PST
The URL I gave is for demo purposes - I've seen this happen on other pages as
well (note that the navigation links on the left side aren't supposed to "hover
underline", but the other links on the page are).

When you have a style that indicates a link you're hovering over should be
underlined, Mozilla does not always render it - sometimes the underline appears,
and sometimes it doesn't. It does consistently reflect the color attribute
correctly though, so it's recognizing the hover state.

I've tried it with both 0.9.4 and 0.9.5 and gotten the same result. The pages
work correctly in Internet Explorer, so I'm sure the CSS is coded correctly.
Comment 1 User image David Baron :dbaron: ⌚️UTC-8 2001-11-08 16:59:45 PST
Don't be so sure the CSS is coded correctly.  IE has a bug where it gives :hover
a higher specificity than other pseudo-classes, or something like that.  See .  Is that the
problem here?
Comment 2 User image David Baron :dbaron: ⌚️UTC-8 2001-11-08 17:01:45 PST
Or could the problem be that the line below is obscuring part of the underline?
 (Although the problem that I can think of that would have caused that would
have been fixed before 0.9.5, and I think also before 0.9.4, although I'm less
sure of that).

I don't see any problems on a current Linux build. 
Comment 3 User image Travis Saling 2001-11-08 17:32:29 PST
> ------- Additional Comments From  2001-11-08 16:59
> Don't be so sure the CSS is coded correctly.  IE has a bug where it gives :hover
> a higher specificity than other pseudo-classes, or something like that.  See
> .  Is that the
> problem here?

I'll try not to take it personally, since I wrote the styles on that
page I used for a demo.  ;-)  Hey it's possible, I'll admit I'm not

But I think there's a few problems with this.  First, I believe this
USED to work correctly in Mozilla on Linux. Second, it works correctly
in Opera on Linux, and it works as expected in Netscape 6 on Windows (I
have mozilla 0.9.5/Windows at home, and I'll check that ASAP). Third, on
a link that wraps over several lines (on that page I originally gave, there's
one link whose text reads "Where are the leaders in the post-PC revolution?"),
some parts of that single link get underlined and some parts don't. The style
doesn't vary within a single link, obviously.
Comment 4 User image David Baron :dbaron: ⌚️UTC-8 2001-11-08 17:35:08 PST
Could you attach a screenshot of the problem?
Comment 5 User image Travis Saling 2001-11-08 17:51:13 PST
Created attachment 57161 [details]
screenshot of the problem

Unfortunately the mouse doesn't appear in the screenshot, but you'll see the
effect I'm talking about in the lower right section ("where are the
Comment 6 User image David Baron :dbaron: ⌚️UTC-8 2001-11-08 18:39:05 PST
Do you know what font that text gets displayed in?  (TrueType, bitmap,
Postscript, etc.?)
Comment 7 User image Travis Saling 2001-11-09 11:02:59 PST
The font is "Lucida".  The style declaration I'm using is

font-family: Lucida, Helvetica, Arial, sans-serif;

But I don't really know enough about how Red Hat 7.2 manages fonts to tell you
whether it's using True-Type, Type 1 or whatever, because I don't see a likely
file in any of my font directories - unless it's one of Abiword's
cryptically-named font files.

Anyway, Lucida seems to be the issue. I set up a test page whose only difference
is the removal of the Lucida font-family style entry, and the problem disappears:

Since Windows browsers don't seem to be using Lucida anyway, I'm moving the
"problem" page that uses Lucida (just in case you need to check this) to

I'm going to pull Lucida out of my default style sheet, so the original URL I
gave in the opening report will soon not reflect the problem anymore.

BTW this does seem to be a Linux-only issue, probably because of the font. On
Mozilla 0.9.5/Windows this problem doesn't occur.


Comment 8 User image David Baron :dbaron: ⌚️UTC-8 2001-11-19 09:32:01 PST
Does the problem get better if you somehow obscure the window and cause it to
repaint while keeping the link in the :hover state?  (Maybe an easier thing to
test would be if the underlines show up properly if they're the non-:hover style.)
Comment 9 User image David Baron :dbaron: ⌚️UTC-8 2002-02-17 08:02:52 PST
This wasn't the bug I meant to accept.
Comment 10 User image David Baron :dbaron: ⌚️UTC-8 2002-04-09 19:19:47 PDT
I suspect this could be an invalidation problem when the underline is outside
the bounds of the text frame.  I see a similar problem for the edge of the "r"
in attachment 1810 [details] (on bug 5693, with my fix for bug 5693).
Comment 11 User image Hixie (not reading bugmail) 2002-04-10 08:18:31 PDT
In which case the fix for this might be similar to the fix for 'outline'.
Comment 12 User image David Baron :dbaron: ⌚️UTC-8 2002-04-11 16:28:26 PDT
Bug 136935 is about a similar problem on windows (a regression due to recent
changes), although the fix for that is likely not to be useful here.  I never
know, though.  (This, in fact, could be a regression from my font metrics
changes that prevented text frames from overflowing their containers, bug 91794.)
Comment 13 User image Kai Lahmann (is there, where MNG is) 2002-07-11 14:21:46 PDT
am I to stupid to see it? ;)

Linux, 2002070508 and no problem!
Comment 14 User image David Baron :dbaron: ⌚️UTC-8 2002-07-11 14:22:48 PDT
This is expected to be unreproducable on most machines.
Comment 15 User image Luis Miguel Lagoa Baptista Ferro 2003-10-02 12:31:27 PDT
It's happening to me in build 2003082704, on windows 2000. The css i'm using is:

a:link {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10pt;
	color: #FFFFFF;
	text-decoration: none;
a:visited {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10pt;
	color: #FFFFFF;
	text-decoration: none;
a:hover {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10pt;
	color: #FFFFFF;
	text-decoration: none;
a:visited:hover {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10pt;
	color: #FFFFFF;
	text-decoration: underline;
a:active {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10pt;
	color: #FFFFFF;
	text-decoration: none;

Then i've a page with the following code:

<a href="link1.html">link1</a>
<a href="link2.html">link2</a>

Of notice, the link1.html exists in the same directory as the page that contains
the html. link2.html doesn't exist at all.

What i've observed is that the first link will appear underlined when the mouse
overs it. BUT link 2 will stay in normal (no underline at all).

Comment 16 User image Hixie (not reading bugmail) 2003-10-03 02:45:14 PDT
The last comment is almost certainly caused by the fact that the style rules ask
for underlining only when the link is visited.
Comment 17 User image Anne (:annevk) 2003-11-29 15:39:55 PST
Is this still a problem?
Comment 18 User image David Ot 2004-03-03 09:15:38 PST
(Win2k, Firefox 0.8) - I get this problem too when I use a font-size of 75% with
a padding-top value of less than 1em or a line-height value of less than 1.5em.
At larger font sizes (16px) a short underline may appear on wrapped lines. It
doesn't happen on every line and if you change em values from say .8 to .99 the
affected lines may change.

I can't see any obvious relationship to the shape of the font (e.g. descenders),
but it only happens with my monospaced font ("Courier New").
Comment 19 User image Ted Mielczarek [:ted.mielczarek] 2004-07-01 06:57:47 PDT
is bug 249402 a dupe of this?
Comment 20 User image Erik Fabert 2004-11-20 09:10:58 PST
*** Bug 270961 has been marked as a duplicate of this bug. ***
Comment 21 User image José Jeria 2004-11-20 09:16:40 PST
Testcase from the bug that was duped to this one:
Comment 22 User image Martijn Wargers [:mwargers] 2007-06-24 16:09:38 PDT
Is this still an issue now on trunk?
Comment 23 User image Travis Saling 2007-06-24 19:27:37 PDT
I don't think it's been a problem for a while, even though it doesn't appear anyone worked on it directly. I can't see the problem on the original test page:
Comment 24 User image Martijn Wargers [:mwargers] 2007-06-25 02:47:24 PDT
Yeah, unfortunately that happens. Bugs that get worksforme without any developer working on it.
Anyone else who saw the bug, can he also test?
Comment 25 User image d 2009-10-20 11:55:18 PDT
I think we can close this one. It appears to be working correctly for me too, with Firefox 3.5.3 on Mac.

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