New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 648730 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Not on Chrome anymore
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

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.
 

Comment 1 by tkent@chromium.org, Sep 20 2016

Components: Blink>CSS
Summary: 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)

Comment 2 by timloh@chromium.org, Sep 20 2016

These properties aren't specified to return the used value

https://drafts.csswg.org/cssom/#resolved-values

Comment 3 by suzyh@chromium.org, Sep 21 2016

Labels: Hotlist-Interop
Owner: timloh@chromium.org
Status: Assigned (was: Unconfirmed)

Comment 4 by timloh@chromium.org, Sep 22 2016

Owner: nainar@chromium.org

Comment 5 by nainar@chromium.org, Sep 22 2016

Status: WontFix (was: Assigned)
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. 
In my opinion this should be fixed in terms of browser interoperability.

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