[webkit-dev] Ruby Text Enhancements
hyatt at apple.com
Tue Sep 21 09:05:37 PDT 2010
On Sep 21, 2010, at 2:52 AM, Roland Steiner wrote:
> We'd probably need to add a new value to that property if Ruby is supposed to be skipped.
> Ergh.... Looking at it, I'm not sure that's a good proposal at all - at least it has still lots to address (it doesn't address list bullets, or :before/:after generated content, for one). I think that the best approach for ruby would be to view the whole ruby run (i.e., base and text combined) as the main object for text-decoration, and not the base and text individually. That is:
> .) underline: line painted below the base only, over the width of base and text (but excluding any overhangs!)
> .) overline: overline painted above the text, same as above - note that the line width doesn't (!) change
> .) line-through: either just the base is decorated, or both base and text. I can see arguments for either way, although I think painting a line-through through the text may overly obscure it, since it's quite small - note that the line width for the ruby text would need to be different in this case as well, which in turn probably means amending the spec.
> .) blink: all blinks ;)
> This however means that a rule for <rt> would need to affect the ruby text separately, independent of the decoration of the whole thing (which IMHO would be a good thing anyway).
Yeah the main point I was trying to make with text-decoration is that in the strict mode model it's the element with text-decoration on it that draws the line. So right now if you have:
<a>....[some ruby].... </a>
It's the line boxes for the <a> element that draw a line, and it just cuts through the ruby no matter where the ruby happens to be (just as it might cut through any other objects like images that might have a different vertical alignment). We have no concept of making that line skip elements or do something different, so it's a fair bit of work to customize the behavior.
Even more annoying is that text-decoration has two completely different code paths for quirks vs. strict mode. In quirks mode, the underlines are drawn by the elements themselves (so e.g., you get no underlines under images in quirks mode), and so customizing the line drawing behavior will be easier to do in quirks mode.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev