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

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
information)

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
implementations.

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:
-2em"><span>A</span><span>B</span><span>C</span></div>

is different from

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

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.



Cheers,
Kenny
-- 
Web Specialist, Oupeng Browser, Beijing
Try Oupeng: http://www.oupeng.com/

Received on Wednesday, 15 August 2012 15:43:18 UTC