Re: [RC6] text-decoration-applies-to-005 is incorrect; text-decoration applicability with inline-block

On 11/09/2011 10:59 AM, Gérard Talbot wrote:
> Øyvind Stenhaug <oyvinds@opera.com> a écrit :
>>> 16.3.1 Underlining, overlining, striking, and blinking: the
>>> 'text-decoration' property
>>> http://www.w3.org/TR/CSS21/text.html#decoration
>>
>> Propagation is only an issue in text-decoration-089, though.
>
> I mentioned text-decoration-089 only because it had both declarations (text-decoration: underline and display: inline-block)
> and had the proper code for inline-block (block containers as descendants of an inline box)
>
>> In text-decoration-applies-to-005, text-decoration is set on the inline-block itself, so an underline is expected.
>
> Øyvind, this is not what I understand from reading §16.3.1. 'text-decoration' is not supposed to affect, to style the
> inline-block itself.
>
> "
> Underlines, overlines, and line-throughs are applied only to text (including white space, letter spacing, and word spacing):
> margins, borders, and padding are skipped. User agents must not render these text decorations on content that is not text. For
> example, images and inline blocks must not be underlined.
> "

Øyvind is correct. Inline blocks break propagation from above, but
if an underline is specified directly on the inline block, it takes
effect on its descendants. The relevant text is this:

"For block containers that establish an inline formatting context, the
decorations are propagated to an anonymous inline element that wraps
all the in-flow inline-level children of the block container."

An inline block is a block container, so when specified on the inline
block the underline propagates to its contents. Note the underline is
not applied to the inline block -- it is only propagated from it to
the anonymous inline boxes inside it.

~fantasai

Received on Wednesday, 9 November 2011 22:13:40 UTC