Closed Bug 93437 Opened 23 years ago Closed 23 years ago

getComputedStyle returns relative values instead of absolute ones

Categories

(Core :: DOM: CSS Object Model, defect)

defect
Not set
major

Tracking

()

VERIFIED INVALID

People

(Reporter: andorxor, Assigned: jst)

Details

Attachments

(1 file)

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.
Attached file 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.
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
Closed: 23 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.

Attachment

General

Created:
Updated:
Size: