[webkit-dev] Ruby Text Enhancements
emader at apple.com
Fri Sep 17 18:07:45 PDT 2010
I'm working on making the following enhancements to Ruby Text:
1) Implement the behavior of ruby-overhang:auto
2) implement the behavior of ruby-line-stacking:exclude-ruby
3) Add some Mac OS specific character properties to the ruby text
4) Turn off the underline when the ruby text is in a link
I've looked at the code enough to know that the layout or ruby text is done by the normal block stacking in BlockLayout. I'm guessing that I can do at lest the first two tasks by changing the RenderRuby code to report a different width and / or height for the ruby block. Does this seem like the right way to do what I want?
Assuming for the moment that it is, I have some questions:
1) What methods should I subclass to report the adjusted width and height?
2) If the ruby text is wider than the ruby base and I report the width of the base as the width of the whole block will some of the ruby text get clipped, or will it all still draw?
3) Ruby text is only allowed to overhang the base in some cases. To know when it's OK, I'll need to examine the neighboring text. Can I always find the neighboring text by walking the render tree?
About turning off the underline if the ruby is in a link: I've looked at the styles and tried adding code to change the parts that I think relate to this, but haven't found anything that makes a difference. It's also occurred to me that I might be able to do this by writing a rule in <WebKit>WebCore/css/html.css, but I can't figure out exactly what the rule would look like. I tried adding "text-decoration: none" to the "ruby > rt" section, but that doesn't do it.
(at first, I thought that is was probably overkill, but now I think that turning text-decoration off for all ruby text is probably right.)
More information about the webkit-dev