If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

getComputedStyle returns relative values instead of absolute ones

VERIFIED INVALID

Status

()

Core
DOM: CSS Object Model
--
major
VERIFIED INVALID
16 years ago
16 years ago

People

(Reporter: Stephan Tolksdorf, Assigned: jst)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

16 years ago
getComputedStyle returns relative values for left and top when a nested 
object's position is declared as "absolute", but getComputedStyle should return 
absolute values (relative to the document).
Netscape 6 hadn't this bug.

See http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS-
OverrideAndComputed
and the attached testcase.
(Reporter)

Comment 1

16 years ago
Created attachment 44557 [details]
Testcase
er... wouldn't getComputedStyle return top and left relative to the containing
block?  That's what those offsets are measured with respect to when those
properties are set....

I believe this is invalid.
(Reporter)

Comment 3

16 years ago
The DOM specification (see the link in my my bug report) says
--
getComputedStyle:
  (...)
  Return Value: 
    CSSStyleDeclaration
    The computed style. The CSSStyleDeclaration is read-only
    and contains only _absolute_ values.
--
And as I said, that was the behaviour until recently...
 
No, this in INVALID.  Sorry for misunderstanding what you were talking about
earlier.  The computed value of 'top' is still '50px', since top means the
offset from the containing block, which in this case is the outer positioned
element and not the viewport (which it is when there is no intervening
positioned element).
Status: UNCONFIRMED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → INVALID
VERIFIED -- 'px' is an absolute unit, as opposed to 'em' and 'ex' which are
relative. That's what the spec is referring to.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.