W3C home > Mailing lists > Public > public-css-archive@w3.org > September 2016

Re: [csswg-drafts] [cssom] Resolved value for width et al should be computed value for display:contents

From: Mats Palmgren via GitHub <sysbot+gh@w3.org>
Date: Wed, 14 Sep 2016 18:24:42 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-247109034-1473877479-sysbot+gh@w3.org>
FYI, the relevant Gecko code is:
https://hg.mozilla.org/mozilla-central/annotate/8a494adbc5cc/layout/style/nsComputedDOMStyle.cpp#l4863

So, yes, when the element doesn't have a box, or is a non-replaced or 
SVG inline,
then 'calcWidth' is false and we use the else-branch on line 4887, 
which uses
the computed values.  But note that min-/max-* are used as well, so it
 seems to be
a little more than just "use the computed 'width' value".

A few examples:
`data:text/html,<div style="display:none; min-width:10px">`
I get a resolved 'width' of 1293px (the content-width of the implicit 
<body>)
`data:text/html,<div style="display:none; max-width:10px">`
results in width = 'auto'
`data:text/html,<div style="display:none; width:20px; 
max-width:10px">`
width = 10px
`data:text/html,<div style="display:none; min-width:20px; 
max-width:10px;">`
width = 'auto'
`data:text/html,<div style="display:none; width:0; min-width:20px; 
max-width:10px;">`
width = 20px

What do other UAs do in these cases?

-- 
GitHub Notification of comment by MatsPalmgren
Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/482#issuecomment-247109034 
using your GitHub account
Received on Wednesday, 14 September 2016 18:24:48 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:03 UTC