[Webkit-unassigned] [Bug 62684] Regression: font-size: 100% may cause ruby text to overlap

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jul 27 00:40:50 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=62684





--- Comment #5 from Kentaro Hara <haraken at google.com>  2011-07-27 00:40:50 PST ---
Mitz, thank you very much for the comments.

(In reply to comment #3)
> (From update of attachment 102092 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=102092&action=review
> 
> This bug is about the overlap, but the patch changes other things. Most notably, it allows greater overhang (more than half a ruby) in some cases. If you want to change the maximum amount of overhang allowed, file a separate bug and explain why you want to change that. The current implementation follows the example in <http://www.w3.org/TR/2009/NOTE-jlreq-20090604/#en-subheading2_3_6>.

Sorry, I wanted to fix the bug in this patch, but my change was wrong. I fixed the patch as follows:

before:
logicalLeftOverhang = min<int>(toRenderText(startRenderer)->minLogicalWidth(), startRenderer->style(firstLine)->fontSize()) / 2;

after:
logicalLeftOverhang = min<int>(toRenderText(startRenderer)->minLogicalWidth(), rubyText->style(firstLine)->fontSize()) / 2;

My intention is that the length of a ruby overhang should be no more than the width of the ruby "and no more than the width of the neighboring text block". 

I confirmed that the test case attached above and http://people.pwf.cam.ac.uk/ssb22/zhimo.html (reported by http://code.google.com/p/chromium/issues/detail?id=86079) are rendered correctly with my patch. 

> > Source/WebCore/rendering/RenderRubyRun.cpp:298
> > +    int logicalLeftOverhang = 0;
> > +    if (startRenderer && startRenderer->isText())
> > +        logicalLeftOverhang = min<int>(toRenderText(startRenderer)->minLogicalWidth(), startRenderer->style(firstLine)->fontSize()) / 2;
> > +    int logicalRightOverhang = 0;
> > +    if (endRenderer && endRenderer->isText())
> > +        logicalRightOverhang = min<int>(toRenderText(endRenderer)->minLogicalWidth(), endRenderer->style(firstLine)->fontSize()) / 2;
> 
> Why is it okay to set the logical left overhang based on the startRenderer regardless of writing direction?

There are two places where call getOverhang(). 

One place is RenderBlock::setMarginsForRubyRun() and it swaps startRenderer and endRenderer before calling getOverhang(). It is OK. 

The other place is RenderBlock::LineBreaker::nextLineBreak() (it calls applyOverhang() and the applyOverhang() calls getOverhang()), but it does not swap them. So I added the code to swap them when RenderBlock::LineBreaker::nextLineBreak() calls applyOverhang().

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list