Incorrect underlining of text when using CSS and <a /> tags

RESOLVED INVALID

Status

()

Core
CSS Parsing and Computation
RESOLVED INVALID
13 years ago
13 years ago

People

(Reporter: Albert Astals Cid, Assigned: dbaron)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040804
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040804

Open that code in mozilla, place the mouse over HELLO and see how it gets
underlined, it should not as it is not part of the <a>, the code is correct
according w3c validator

Code

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
	<head>
		<style type="text/css">
			a:hover { text-decoration: underline; }
		</style>
		<title>Mozilla testcase</title>
	</head>
	<body>
		<a id="foo" />
		HELLO
	</body>
</html>


Reproducible: Always

Steps to Reproduce:
1. Write that code to a html page
2. Open the html page in mozilla
3. Place the cursor over HELLO

Actual Results:  
HELLO gets underlined

Expected Results:  
HELLO should not get underlined as it is not part of <a> in any way
(Assignee)

Comment 1

13 years ago
If you're serving XHTML as text/html, you need to follow the guidelines in
Appendix C of XHTML 1.0.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → INVALID
(Reporter)

Comment 2

13 years ago
So you can add lots of code to accept badly coded sites but then a "correct" 
code does not get correctly rendered because i named my page .html 
instead .xhtml? 
 
Thank god i don't use mozilla as my primary browser. 
 
And of course is not "my" page that i want you to fix. There are pages out 
there i can not control and use that code so if you don't fix it you are doing 
bad for your users not for my, my browser is not so strict. 
(Assignee)

Comment 3

13 years ago
No, we do it that way because the XHTML spec says that that's what we're
supposed to do.  It says that something sent as text/html should not be treated
as XHTML by browsers:  http://www.w3.org/TR/2002/REC-xhtml1-20020801/#guidelines
You need to log in before you can comment on or make changes to this bug.