Closed Bug 967803 Opened 11 years ago Closed 11 years ago

getComputedStyle(el).top returns length rather than auto for position:absolute;top:auto (different from WebKit)

Categories

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

26 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: elie.roux, Unassigned)

Details

Attachments

(1 file)

Attached file index.html
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0 Iceweasel/26.0 (Beta/Release) Build ID: 20131215090532 Steps to reproduce: I tested the attached simple code with Firefox 24 and 26. Actual results: the result is first auto then 8px Expected results: In webkit, the result is auto then auto. An application I'm using was relying on webkit's behaviour (see https://github.com/chaosim/splitter/issues/1).
Summary: setting css position absolute make css top behave different as webkit → getComputedStyle(el).top returns length rather than auto for position:absolute;top:auto (different from WebKit)
http://dev.w3.org/csswg/cssom/#resolved-value lists "top" in the list of properties for which getComputedStyle returns the used value, not the computed value. So I believe our behavior is in fact correct per that spec draft.
Also see https://bugs.webkit.org/show_bug.cgi?id=29084 (which jQuery is currently working around, apparently)
Ok, it indeed seems to be a bug in Webkit, sorry for the noise! I don't seem to be able to close it as "invalid", can someone please do it? Thank you,
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: