Re: [css3-text] Behavior of text-decoration with differing font sizes, subscript, superscript, etc.

On 08/13/2012 05:08 AM, Aryeh Gregor wrote:
> Mozilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=778796
>
> Test-case 1: data:text/html,<!doctype html><s>foo<font size=7>bar</font>baz</s>
>
> The spec currently requires the line to be of consistent height and
> thickness in all three cases:
>
> """
> In determining the position and thickness of text decoration lines,
> user agents may consider the font sizes and dominant baselines of
> descendants, but for a given element's decoration must use the same
> position and thickness throughout each line box.
> """
> http://dev.w3.org/csswg/css3-text/#line-decoration
>
>
> I would like this reconsidered.  As fantasai points out on the linked
> bug, the requirement here usually makes sense with underline, because
> Western scripts are aligned along their baselines, which is where we
> put underlines.  But for line-through and overline, you can't put the
> line in a place that makes sense for both 12pt text and 36pt text.  If
> font sizes vary, you have to break up the line.  Also, even for
> underline, it makes sense to lower it for subscripts.
>
> I suggest one of the following two changes:
>
> * Mandate the behavior of IE and LibreOffice in my test-cases above.
> For a given element's decoration, an underline must remain at a
> consistent position and thickness throughout each continuous run of
> text in a single line box that has a consistent baseline.  (But if the
> baseline varies, the underline may be broken up.)  However,
> line-through and overline should be drawn at a height appropriate to
> the text and may differ in height or thickness within a line box.
> (Except maybe overlines should align for 'vertical-align: top',
> although it's a corner case.  Line-through is normally not drawn at
> the 50% mark, so we probably can't require line-throughs align for
> 'vertical-align: middle'.)
> * Remove the requirement entirely, so behavior is undefined.  I like
> undefined behavior a lot less, but we might have to do that if anyone
> thinks their behavior is better than IE's, or if it's too annoying to
> define (accounting for vertical-align, etc.).
>
> Basically, I think IE's behavior here should at least be legal, even
> if it's not mandated.  The Firefox/Opera behavior in the first
> test-case is clearly wrong, IMO, but it's what the spec currently
> requires.  IE's(/LibreOffice's) behavior makes the most sense to me.

Hi Aryeh,

The CSSWG discussed your issue. We didn't go with either suggestion,
because of additional considerations about maintaining a consistent
line position and thickness when, for example, the font face changes
without the font size changes.

The discussion starts in
   http://lists.w3.org/Archives/Public/www-style/2012Oct/0115.html
and concludes in
   http://lists.w3.org/Archives/Public/www-style/2012Oct/0489.html

The current spec text is available in the editor's draft at
   http://dev.w3.org/csswg/css-text-decor-3/#line-position

Please let us know if this is satisfactory or if you have further
comments on this issue (including any suggested clarifications to
the new prose).

Thanks~

~fantasai

Received on Friday, 9 November 2012 02:19:04 UTC