Closed Bug 270458 Opened 20 years ago Closed 20 years ago

CSS for anchor incorrectly handles table cell containing a named anchor

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: hwsw, Assigned: dbaron)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a5) Gecko/20041117
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a5) Gecko/20041117

When a style has been defined for the anchor element (i.e.
  a:hover { background: yellow; }
an empty named anchor within a table cell causes that defined anchor style to be
applied from the anchor on to the end of the cell.

Reproducible: Always
Steps to Reproduce:
1. Load the attached sample document with the Mozilla browser
2. Hover with the mouse over each cell.


Actual Results:  
Table cell one does not contain a named anchor.  Hovering over it does not have
any effect.
Table cell two contains a named anchor between the first and second line.
Howering over the second line displayes the background as yellow.
Table cell three contains a named anchor at the beginning of the cell.  Hovering
over the cell displayes the background of the cell as yellow.

Expected Results:  
The background color should not change for table cell two or three.

Sample test document 
====================

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
 <HEAD>
  <title>arch_dictionary</title>
  <STYLE type="text/css">
     A:hover  {
	background : yellow;
	}
  </STYLE>
 </HEAD>
 <body>
	 Jump to <a href="#one">One</a> or <a href="#foo">foo</a>.
  <table border="1">
   <tr>
    <td>
     10-propargyl-10-deazaaminopterin [ENGLISH/Patient]
     <br>
     A substance that is being studied in the treatment of cancer.  
     It belongs to the family of drugs called folate analogs.
    </td>
   </tr>
   <tr>
    <td>
     12-O-tetradecanoylphorbol-13-acetate [ENGLISH/Patient]
     <br>
     <a name='one'/>
     TPA. A drug that is being studied in the  treatment of hematologic 
     cancer.
    </td>
   </tr>
   <tr>
    <td>
     <a name='two' />
     13-cis retinoic acid[ENGLISH/ Patient/]
     <br>
     A drug that is used in the treatment of acne and psoriasis and is being 
     studied in cancer prevention. It belongs to the family of drugs called 
     retinoids. Also called isotretinoin.<a name='foo'/></span>
    </td>
   </tr>
  </table>
 </body>
</HTML>
a:hover applies to anchors as well as links.  So since you haven't closed the
anchors (you can't use <a /> in an HTML document, the anchor is open in the
table cell and :hover affects the color appropriately.

This is what should happen given your code.  Invalid.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.