You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
width
...
If the property applies to the element or pseudo-element and the resolved value of the display property is not none or contents, then the resolved value is the used value. Otherwise the resolved value is the computed value.
I would expect the same behavior as when an element does not generate boxes due to display: none or display: contents. In fact the spec is also missing the case of an element whose display is not none or contents but no box is generated due to a display: none ancestor. Then, all Firefox, Chrome and Edge return the computed value, but according to the spec it seems it should be the used value.
Yup, it should be the same as a display:none element. (In other words, the pseudo-element always exists, but most of the time just doesn't generate a box due to content.)
https://drafts.csswg.org/cssom/#resolved-values
See web-platform-tests/wpt#7020
What should happen for
getComputedStyle(el, '::before').width
if el has no::before
box generated? This appears to not be particularly well defined.https://drafts.csswg.org/cssom/#terminology says
The text was updated successfully, but these errors were encountered: