Read max-height / max-width / min-height / min-width PERCENT COMPUTED values
Reported by
king-s...@hotmail.de,
Sep 20 2016
|
||||
Issue description
Chrome Version : 53.0.2785.116 (Offizieller Build) m (32-Bit)
URLs (if applicable) :
Other browsers tested:
Add OK or FAIL, along with the version, after other browsers where you
have tested this issue:
Safari: -
Firefox: OK
IE: >8 = OK | <=8 = FAIL
What steps will reproduce the problem?
(1) Set max-height / max-width / min-height / min-width in PERCENT on a element
(2) Read one of these values via Javascript => window.getComputedStyle(<el>).getPropertyValue(<max-value> || <min-value>);
(3) You will get the PERCENT Value as a string e.g. "100%". In FF or IE you will get the actual computed value in PIXEL e.g. "337px".
What is the expected result?
Get the computed values as PIXEL insted as PERCENT.
What happens instead?
We get the values in PERCENT (not computed).
This issue happens only with PERCENT values. I've tested it also with "vh" and "vw" units. With these units you get the computed Size in pixel.
I've created a fiddle for you: https://jsfiddle.net/5qpLppow/
Open the console to see the results.
,
Sep 20 2016
These properties aren't specified to return the used value https://drafts.csswg.org/cssom/#resolved-values
,
Sep 21 2016
,
Sep 22 2016
,
Sep 22 2016
For (min/max)-(width/height) the spec (https://www.w3.org/TR/CSS22/visudet.html#min-max-widths) mentions that the computed value is "the percentage as specified or the absolute length" So our current implementation is correct and this seems like a WontFix. Comment here or change status if I am incorrect in this regard.
,
Sep 22 2016
In my opinion this should be fixed in terms of browser interoperability.
,
Sep 22 2016
Besides the spec of "height" and "width" mentions the same behavior. But the these properties are returned always as computed pixel value. |
||||
►
Sign in to add a comment |
||||
Comment 1 by tkent@chromium.org
, Sep 20 2016Summary: Read max-height / max-width / min-height / min-width PERCENT COMPUTED values (was: Javascript - Read max-height / max-width / min-height / min-width PERCENT COMPUTED values)