Closed Bug 23209 Opened 21 years ago Closed 20 years ago

Mozilla incorrectly highlights text on a click!


(Core :: Layout, defect, P3)






(Reporter: dejong, Assigned: attinasi)



(2 files)

I ran into this bug while surfing around. After some trial and error, I
trimmed the offending HTML down to this small bit o code.

<BODY ALINK="#FF0000">
<a name="main">Leading items and editorials</a>
Hi there

Using a CVS build from today (Jan 5th), I found that clicking on the
text "Leading items ..." will turn the text red even though it is not
a link. If you click on the text "Hi there" it will not turn red.
The ALINK parameter is to blame here. If you remove it, the text will
not change color when clicked. I tried this with netscape 4 and I
got the expected result (text not changing color). I also noticed
that if you take the text out of the <a ...>...</a> block it will not
change colors when clicked. This is not a crasher, but it is very easy
to reproduce. I am also going to include a screen shot I took in the
middle of the click. I was running on a RedHat 6.0 system when I got
these results.
Assignee: nobody → rickg
Component: Browser-General → HTML Element
QA Contact: nobody → petersen
The ALINK attribute on <BODY> is certainly a precondition, but the cause
is a problem with <A> elements: ALINK, and for that matter LINK and VLINK
on BODY should affect the rendering of links... and <A> elements are only
hyperlinks if they have an HREF attribute. In other words, <A> elements should
only pay attention to clicks if they have HREF attributes.

Confirmed on: 2000-01-05-08-M13 nightly binary on Windows NT 4.0sp3.

Changing component to "HTML Element" from "Browser-General"

I'm sure I saw this reported before, but perhaps it was in a dreaded multibug.
Assignee: rickg → pierre
This also occurs on NT. Pierre, this is a style issue, right?
It has got to be a style issue - I have seen code that tries to deal with 
anchors that are not links... I'll take it and investigate.
Assignee: pierre → attinasi
Target Milestone: M15
There was a problem in the nsCSSStyleSheet::SelectorMatches method where a tag 
of <a> was not first checking if it had a link before looking at the state of 
the link. Unfortunately, the code was setup to handle the other link states 
(visited, unvisited, outOfDate) but not Active, hence the bug. I have fixed this 
and will check it in once the tree is non-red. (r=karnaze)
Closed: 20 years ago
Resolution: --- → FIXED
Fix checked in (nsCSSStyleSheet.cpp).
Fixed in the May 30th Linux build.
SPAM. HTML Element component deprecated, changing component to Layout. See bug
88132 for details.
Component: HTML Element → Layout
You need to log in before you can comment on or make changes to this bug.