underlined text returns incorrect value for offsetHeight

RESOLVED INVALID

Status

()

Core
DOM: CSS Object Model
RESOLVED INVALID
15 years ago
13 years ago

People

(Reporter: derrida17, Unassigned)

Tracking

({testcase})

Trunk
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

15 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)
Build Identifier: Mozilla/5.0

When the text-decoration in an anchor is set to underline, the javascript 
engine determines the offsetHeight for the anchor *excluding* the underline, 
when it should *include* the underline. This creates problems when trying to 
dynamically position elements relative to anchors.

Reproducible: Always

Steps to Reproduce:
1. Create an anchor tag with style="text-decoration: underline"
2. Identify the tag using the XHTML id element.
3. Attempt to load the tag's offsetHeight using document.getElementById
(...).offsetHeight

Actual Results:  
The value of offsetHeight excludes the underline part of the anchor tag.

Expected Results:  
Mozilla should include the actual underline when computing the offsetHeight, so 
as to produce more accurate values.

Comment 1

15 years ago
Can you provide with a testcase?

Comment 2

15 years ago
---> DOM Style component
Assignee: rogerl → dom_bugs
Component: JavaScript Engine → DOM Style
QA Contact: pschwartau → ian
If you put a border on the anchor, does the underline lie inside or outside the
border?  Depending on the markup, the underline may well effectively lie outside
the anchor...

Comment 4

13 years ago
Created attachment 178033 [details]
Testcase

offsetHeight is the same for links with underline and without.

Adding a border to a link shows the underline within the border, but then the
offsetHeight will be bigger

IE and Opera does the same as Mozilla here

Updated

13 years ago
Attachment #178033 - Attachment mime type: text/plain → text/html

Updated

13 years ago
Keywords: testcase
OK, if we're compatible with IE then we're doing the right thing, since the
definition of offsetHeight is "do what IE does"...
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.