getComputedStyle and nested absolute DIV tags

VERIFIED DUPLICATE of bug 49942

Status

()

Core
DOM: CSS Object Model
P3
major
VERIFIED DUPLICATE of bug 49942
18 years ago
17 years ago

People

(Reporter: Scott Severtson, Assigned: jst)

Tracking

Trunk
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

18 years ago
getComputedStyle returns incorrect values on nested absolute DIV tags. For 
example:

<HTML>
<HEAD>
<STYLE>
.abs {
  position: absolute;
}
</STYLE>
<SCRIPT>
  function showWidth(strName) {
    alert(getComputedStyle(document.getElementById(strName), 
null).getPropertyValue('width'));
  }
</SCRIPT>
</HEAD>
<BODY>
<DIV CLASS="abs" ID="foo">
  Single &lt;DIV&gt;
</DIV><BR><BR>
<INPUT TYPE="Button" VALUE="Test" onClick="showWidth('foo');">
<BR>
<DIV CLASS="abs">
  <DIV CLASS="abs" ID="bar">
    Nested &lt;DIV&gt;s
  </DIV>
</DIV><BR><BR>
<INPUT TYPE="Button" VALUE="Test" onClick="showWidth('bar');">
</BODY>
</HTML>

Affected properties:
width, height, right, bottom

Probably related in some way to Bug #49942.
(Assignee)

Comment 1

18 years ago
I'd say this is related to bug 49942 enough to dupe this. Fixing bug 49942 will
fix this one too.

*** This bug has been marked as a duplicate of 49942 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → DUPLICATE

Comment 2

17 years ago
Verified dupe.
Status: RESOLVED → VERIFIED
Component: DOM Level 2 → DOM Style
You need to log in before you can comment on or make changes to this bug.