Created attachment 579181 [details] testcase > I should get (like every other browser) '10%' Well, I get "102px" in Opera 11.5
The spec for this is still in flux. Once it looks like it may be stabilizing, we'll align to it wholesale. Note that per spec the correct answer here used to be a pixel length, which is what we implement at the moment. But as I said, the spec has been changing.
The "resolved value" of "left" is the "computed value" http://dev.w3.org/csswg/cssom/#resolved-value The computed value of "left" is: if specified as a ‘<percentage>’, the specified value; http://dev.w3.org/csswg/css3-positioning/#box-offsets-trbl
Yes, I know what the current CSSOM drafts say. For this particular property it's different than what the combination of DOM2 CSS and CSS2 used to say, as comment 2 notes.
(In reply to j.j. from comment #1) > Created attachment 579181 [details] > testcase > > > I should get (like every other browser) '10%' > Well, I get "102px" in Opera 11.5 Sorry, I had to specify.. on every other browser on mac osx (opera 11.5 included => http://i39.tinypic.com/2z6847n.png) On linux (Opera 11.5) I get value in pixel.. it's weird.. and on firefox 7 (on winXP) I get the %.. This is happening because of the spec still in flux? So, there's no way atm to retrieve % value on firefox (without parsing the css stylesheet) ?
> and on firefox 7 (on winXP) I get the %.. That's .... quite odd. Shouldn't happen. > So, there's no way atm to retrieve % value on firefox (without parsing the css > stylesheet) ? At the moment, no.
You should get a % if the element is display:none or inside something that's display:none. Perhaps there's a timing issue causing that to be the case some of the time?
(In reply to David Baron [:dbaron] from comment #7) > You should get a % if the element is display:none or inside something that's > display:none. Perhaps there's a timing issue causing that to be the case > some of the time? That works! Perfect, thanks.. btw, it's not clear why the behav is different depending on the OS (same browser/version).. Timinng issue, could it be something related to when the 'domready' is called ?
(In reply to Boris Zbarsky (:bz) from comment #6) > > and on firefox 7 (on winXP) I get the %.. > > That's .... quite odd. Shouldn't happen. > Yea that's really odd.. it also happens on opera (11.5 mac os/ubuntu, different behav). > > So, there's no way atm to retrieve % value on firefox (without parsing the css > > stylesheet) ? > > At the moment, no. Like David said, setting display:none solves the problem