- From: Mike Sherov <mike.sherov@gmail.com>
- Date: Thu, 12 Jul 2012 02:35:59 -0400
- To: www-style@w3.org
- Message-ID: <CAD1Dv_JNTh-EDQXLr3kLoC0zREMhEJXyTGYuaaBQipvgpdwfYw@mail.gmail.com>
I'm working with Ryosuke Niwa on correcting the behavior of getComputedStyle(elem).top/left/right/bottom in Chrome. It led us to a discussion about whether or not "auto" is a valid used value, and whether it should be returned by getComputedStyle if get computed style is returning a "used value" for a specific property. The discussion is https://bugs.webkit.org/show_bug.cgi?id=29084 and https://www.w3.org/Bugs/Public/show_bug.cgi?id=16389 Basically, IE9/FF/Opera/Webkit all currently have different behaviors with regards to this test: https://bug-29084-attachments.webkit.org/attachment.cgi?id=151525 Opera 11.6: Passes all tests as written FF13: Converts "auto" to pixels so fails when expecting "auto". IE9/IE10: incorrectly accounts for padding so fails on the padding tests. Webkit: doesn't convert to pixels so fails when expecting pixels. Obviously, we want Webkit to return pixels when percentages are specified. This makes us believe "used value" should be used, and more specifically, that the "resolved value" for top/left/bottom/right should be brought into line with margin/padding/border (in that they all use "used value" if display is not "none"). However, we're unsure if "auto" is a "used value", or if "used value" should be pixels, as is seen in FF13's current implementation. I summed up the argument thusly: According to http://www.w3.org/TR/CSS2/cascade.html#used-value, " The used value is the result of taking the computed value and resolving any remaining dependencies into an absolute value." and then subsequently "A used value is in principle the value used for rendering," Is "auto" an absolute value or the value used for rendering? I don't personally believe so. Is "auto" a useful value to return? I personally don't believe so. Is "auto" consistent with MOST of the other browsers? yes. The crux of my question is this: is "auto" considered a "used value"? If not, should it be converted to pixels for top/left/bottom/right (like FF13)? Any insights here would be extremely helpful. -- Mike Sherov Lead Developer SNAP Interactive, Inc. Ticker: STVI.OB
Received on Thursday, 12 July 2012 06:36:51 UTC