W3C home > Mailing lists > Public > www-style@w3.org > August 2012

[css3-text] the width of an inline non-replaced element

From: Kang-Hao (Kenny) Lu <kanghaol@oupeng.com>
Date: Wed, 15 Aug 2012 23:42:44 +0800
Message-ID: <502BC374.3000002@oupeng.com>
To: WWW Style <www-style@w3.org>
For the used width of a non-replaced 'inline', CSS 2.1 has this to say
(after the property table for 'width')

  # This property does not apply to non-replaced inline elements. The
  # content width of a non-replaced inline element's boxes is that of
  # the rendered content within them (before any relative offset of
  # children).

I read this as "the content width of a non-replaced inline element is
undefined in CSS 2.1" (although I have no idea why we don't just admit
that in CSS 2.1 and get rid of this sentence, which conveys very little

I wonder if we should try to say something about the 'width' of a
'inline' in css3-text, as it is the only CSS3 module that seems relevant
(this module talks about "advance width" for example). Some random
reasons why we would want to do that:

1. Having text about 'width' might help implementers evaluate the
implement-ability of the current 'letter-spacing'/'word-spacing' model.
For example, the current 'letter-spacing' model seems to indicate that
the 'width' of a 'inlinethat contains a single one-grapheme-cluster (and
not a 'word-spacing' character) would be a constant value regardless of
what 'letter-spacing' that 'inline' has. This is not matching

2. The presence of <span></span> would affect the layout result in some
edge cases:

  data:text/html,<div style="word-spacing: -1em;">a<span> </span>b</div>

is different from

  data:text/html,<div style="word-spacing: -1em;">a b</div>

in Firefox, but not in WebKit browsers.

  data:text/html,<div style="width: 10em; margin: auto;letter-spacing:

is different from

  data:text/html,<div style="width: 10em; margin: auto;letter-spacing:

in both Firefox and WebKit. Defining the 'width' of the <span> </span>
in the former example might help implementations converge.

3. Theoretically speaking, given that none of 'width', 'max-width' and
'min-width' apply to a 'inline'. I think there's no normative text in
CSS 2.1 that says that the used width of an 'inline' can't be negative,
but it seems like an important invariant which should be backed up with
some normative prose.

I am not exactly sure how much we can specify this but we might be able
to do this by adding more and more restrictions.

Web Specialist, Oupeng Browser, Beijing
Try Oupeng: http://www.oupeng.com/
Received on Wednesday, 15 August 2012 15:43:18 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 16:28:47 UTC