W3C home > Mailing lists > Public > www-style@w3.org > June 2014

[css-sizing] Preferred minimum width of replaced content with intrinsic ratio

From: David Vest <davve@opera.com>
Date: Wed, 11 Jun 2014 16:42:59 +0200
Message-ID: <CAHsiBXufWV8e-ZumCK-gO1pKJH4EPZU59ODeb0n6xvvLTqWV+Q@mail.gmail.com>
To: www-style@w3.org, "Tab Atkins Jr." <jackalmage@gmail.com>, fantasai <fantasai.lists@inkedblade.net>

http://dev.w3.org/csswg/css-sizing/#replaced-intrinsic says:

 "For replaced elements, the min-content size and max-content size are
  equivalent and correspond to the appropriate dimension of the
  concrete object size returned by the default sizing algorithm
  [CSS3-IMAGES] of the element, calculated with an unconstrained
  specified size."

(min-content size is preferred minimum width, max-content size is
preferred width in CSS 2.1 lingo.)


 "If 'height' and 'width' both have computed values of 'auto' and the
  element has an intrinsic ratio but no intrinsic height or width,
  then the used value of 'width' is undefined in CSS 2.1. However, it
  is suggested that, if the containing block's width does not itself
  depend on the replaced element's width, then the used value of
  'width' is calculated from the constraint equation used for
  block-level, non-replaced elements in normal flow."

Assume a user agent implements the suggestion above and is given an
example like this:

<!doctype html>
<div style="width: 100px">
     <svg viewBox="0 0 2 1" style="background: blue"></svg>

What is the preferred minimum width of the <svg>? Have I understood it
correctly that, according to default sizing algorithm, the preferred
minimum width would be 300px (the default object size width after
'contain constraint')?

0px or 100px would be better choices, because of suggestion mentioned,
since at least in Blink/WebKit the width of a replaced element must be
larger or equal to the preferred minimal width, meaning this SVG would
be sized to 300x150, not 100x50 (the latter is what browsers do,
including Blink/WebKit). 100px might be hard to spec to I'd settle for
0px in this case. :)

Received on Wednesday, 11 June 2014 14:43:27 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:22 UTC