• kojii@chromium.org's avatar
    Fix Japanese line breaking rule before and after ruby · 65c13376
    kojii@chromium.org authored
    This patch fixes Japanese line breaking rules before and after ruby
    elements. This patch is a port of http://wkb.ug/91588 with the
    following changes:
    * The WebKit patch sets ruby base text to the prior context for breaks
      after the ruby. Since U+FFFD Object Replacement Character can cover
      most of the common cases that this patch does not include that part.
    * canBreakBefore() is fixed to include the correct UAX#14[1] classes
      that prohibit line breaks after. The original patch is a mix of
      before and after, and lacks some important after classes.
    
    This patch fixes the common use cases in CJK, but it's hard to say this
    is the right way to fix. There are two issues that block doing so at
    this moment:
    1. RubyRun is LayoutBlockFlow, but after WebKit implemented, the ruby
       spec was updated to allow line breaking within ruby, so it should be
       like inline, not a replaced element.
    2. The CSS WG discussed on line breaking around replaced elements, but
       the discussion is not making much progress.
    Changes in this patch should be updated when these issues are resolved.
    
    [1] http://unicode.org/reports/tr14/
    
    BUG=522826
    
    Review URL: https://codereview.chromium.org/1304993003
    
    git-svn-id: svn://svn.chromium.org/blink/trunk@201073 bbb929c8-8fbe-4397-9dbb-9b2b20218538
    65c13376
line-break-ruby.html 1.26 KB