Closed Bug 292363 Opened 19 years ago Closed 19 years ago

text-decoration doesn't apply to style interacts with css position:absolute

Categories

(Core :: Layout: Form Controls, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 219516

People

(Reporter: jdudeck, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.7) Gecko/20050414
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.7) Gecko/20050414

Using JavaScript to modify a form button's text-decoration:underline style does
not have expected effect UNLESS a css attribute of position:abosolute or
float:left or float:right is applied to the button.

Example code:

<!DOCTYPE html public "-//w3c//dtd html 4.01 transitional//en" 
		"http://www.w3.org/TR/html4/loose.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
input.btn1{border:none;}
input.btn2{border:none; position:absolute;}
</style>
</head>
<body>
Demonstration of bug in Mozilla.<br>
Both buttons contain JavaScript code to change the<br>
text-decoration attribute on mouseover.<br>
However it only works on the second button.<br>
<form action="somepage.php" name="test">

<input class="btn1" type="submit" name="Submit1" value="Test 1"
onmouseover="document.test.Submit1.style.textDecoration='underline'"
onmouseout="document.test.Submit1.style.textDecoration='none'">
<input class="btn2" type="submit" name="Submit2" value="Test 2"
onmouseover="document.test.Submit2.style.textDecoration='underline'"
onmouseout="document.test.Submit2.style.textDecoration='none'">

</form>
</body>
</html>

Reproducible: Always

Steps to Reproduce:
1.View the example code in Details above in Mozilla browser.
2.
3.

Actual Results:  
On all versions of Mozilla and Firefox, on all platforms, the first button's
text is not underlined on a mouse-over, but the second button's text is
underlined. On IE both buttons' text is underlined.

Expected Results:  
Both buttons' text should be underlined on mouse-over.
Attached file testcase
comment #0 testcase
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b2) Gecko/20050429
Firefox/1.0+

I can confirm the behaviour

if you remove the <!doctype ...> it works
Maybe it's illegal in html4.01
Component: General → Layout: Form Controls
Product: Firefox → Core
QA Contact: general → layout.form-controls
Version: unspecified → Trunk
The Javascript bit isn't required to see the bug.

*** This bug has been marked as a duplicate of 219516 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
Summary: JavaScript modification of text-decoration style interacts with css position:absolute → text-decoration doesn't apply to style interacts with css position:absolute
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: