⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 179366 in webkit


Ignore:
Timestamp:
Jan 29, 2015, 2:03:40 PM (12 years ago)
Author:
hyatt@apple.com
Message:

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.

Japanese line breaking rules need to be respected before and after Ruby.
​https://bugs.webkit.org/show_bug.cgi?id=91588
<rdar://problem/17306535>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/ruby/ruby-punctuation-avoid-breaking.html.

This patch has to add support for following line breaking rules at both
sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
just hard-code the rules (and apply this hard-coding only to Ruby and not
to other inline replaced elements).

For breaking after a Ruby we do better. The Ruby run caches its prior characters
and line layout is able to obtain them and use them when deciding whether or not
to break. This means for the "after" side of a Ruby, we're able to behave the same
as if no Ruby was used.

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):

  • rendering/RenderRubyBase.cpp:

(WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):

  • rendering/RenderRubyBase.h:
  • rendering/RenderRubyRun.cpp:

(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
(WebCore::RenderRubyRun::canBreakBefore):

  • rendering/RenderRubyRun.h:
  • rendering/RenderRubyText.cpp:

(WebCore::RenderRubyText::canBreakBefore):

  • rendering/RenderRubyText.h:
  • rendering/line/BreakingContextInlineHeaders.h:

(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::canBreakAtThisPosition):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):

LayoutTests:

  • fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
  • fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
  • fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
  • fast/ruby/ruby-punctuation-avoid-breaking.html: Added.
Location:
trunk
Files:
2 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r179350 r179366  
     12015-01-20  David Hyatt  <hyatt@apple.com>
     2
     3        Japanese line breaking rules need to be respected before and after Ruby.
     4        https://bugs.webkit.org/show_bug.cgi?id=91588
     5        <rdar://problem/17306535>
     6
     7        Reviewed by Dean Jackson.
     8
     9        * fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt:
     10        * fast/ruby/ruby-block-style-not-updated-with-before-after-content.html:
     11        * fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt:
     12        * fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html:
     13        * fast/ruby/ruby-punctuation-avoid-breaking-expected.html: Added.
     14        * fast/ruby/ruby-punctuation-avoid-breaking.html: Added.
     15
    1162015-01-29  Alexey Proskuryakov  <ap@apple.com>
    217
  • trunk/LayoutTests/fast/ruby/ruby-block-style-not-updated-with-before-after-content-expected.txt

    r94543 r179366  
    55    RenderBody {BODY} at (8,8) size 784x584
    66      RenderRuby (block) {RUBY} at (0,0) size 784x384 [color=#0000FF]
    7         RenderInline (generated) at (0,0) size 512x128 [color=#FFA500]
    8           RenderText at (0,0) size 512x128
    9             text run at (0,0) width 512: "1234"
     7        RenderInline (generated) at (0,0) size 640x128 [color=#FFA500]
     8          RenderText at (0,0) size 640x128
     9            text run at (0,0) width 640: "1234 "
    1010        RenderRubyRun (anonymous) at (0,128) size 512x128
    1111          RenderRubyBase (anonymous) at (0,0) size 512x128
  • trunk/LayoutTests/fast/ruby/ruby-block-style-not-updated-with-before-after-content.html

    r94582 r179366  
    55#test::before
    66{
    7     content: "1234";
     7    content: "1234 ";
    88    color: orange;
    99}
    1010#test::after
    1111{
    12     content: "4578";
     12    content: " 4578";
    1313    color: yellow;
    1414}
  • trunk/LayoutTests/fast/ruby/ruby-inline-style-not-updated-with-before-after-content-expected.txt

    r94543 r179366  
    55    RenderBody {BODY} at (8,8) size 784x584
    66      RenderBlock (anonymous) at (0,0) size 784x384
    7         RenderRuby (inline) {RUBY} at (0,0) size 512x384 [color=#0000FF]
    8           RenderInline (generated) at (0,0) size 512x128 [color=#FFA500]
    9             RenderText at (0,0) size 512x128
    10               text run at (0,0) width 512: "1234"
     7        RenderRuby (inline) {RUBY} at (0,0) size 640x384 [color=#0000FF]
     8          RenderInline (generated) at (0,0) size 640x128 [color=#FFA500]
     9            RenderText at (0,0) size 640x128
     10              text run at (0,0) width 640: "1234 "
    1111          RenderRubyRun (anonymous) at (0,128) size 512x128
    1212            RenderRubyBase (anonymous) at (0,0) size 512x128
  • trunk/LayoutTests/fast/ruby/ruby-inline-style-not-updated-with-before-after-content.html

    r94582 r179366  
    55#test::before
    66{
    7     content: "1234";
     7    content: "1234 ";
    88    color: orange;
    99}
    1010#test::after
    1111{
    12     content: "4578";
     12    content: " 4578";
    1313    color: yellow;
    1414}
  • trunk/Source/WebCore/ChangeLog

    r179364 r179366  
     12015-01-20  David Hyatt  <hyatt@apple.com>
     2
     3        Japanese line breaking rules need to be respected before and after Ruby.
     4        https://bugs.webkit.org/show_bug.cgi?id=91588
     5        <rdar://problem/17306535>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Added fast/ruby/ruby-punctuation-avoid-breaking.html.
     10
     11        This patch has to add support for following line breaking rules at both
     12        sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
     13        just hard-code the rules (and apply this hard-coding only to Ruby and not
     14        to other inline replaced elements).
     15
     16        For breaking after a Ruby we do better. The Ruby run caches its prior characters
     17        and line layout is able to obtain them and use them when deciding whether or not
     18        to break. This means for the "after" side of a Ruby, we're able to behave the same
     19        as if no Ruby was used.
     20
     21        * rendering/RenderBlockFlow.h:
     22        (WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):
     23        * rendering/RenderBlockLineLayout.cpp:
     24        (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
     25        * rendering/RenderRubyBase.cpp:
     26        (WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):
     27        * rendering/RenderRubyBase.h:
     28        * rendering/RenderRubyRun.cpp:
     29        (WebCore::RenderRubyRun::RenderRubyRun):
     30        (WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
     31        (WebCore::RenderRubyRun::canBreakBefore):
     32        * rendering/RenderRubyRun.h:
     33        * rendering/RenderRubyText.cpp:
     34        (WebCore::RenderRubyText::canBreakBefore):
     35        * rendering/RenderRubyText.h:
     36        * rendering/line/BreakingContextInlineHeaders.h:
     37        (WebCore::BreakingContext::handleReplaced):
     38        (WebCore::BreakingContext::canBreakAtThisPosition):
     39        (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
     40
    1412015-01-28  Beth Dakin  <bdakin@apple.com>
    242
  • trunk/Source/WebCore/rendering/RenderBlockFlow.h

    r177377 r179366  
    458458    virtual void computeColumnCountAndWidth();
    459459    virtual bool requiresColumns(int) const;
    460 
     460   
     461    virtual void cachePriorCharactersIfNeeded(const LazyLineBreakIterator&) {};
     462   
    461463private:
    462464    bool recomputeLogicalWidthAndColumnWidth();
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r178940 r179366  
    11791179        WordMeasurements wordMeasurements;
    11801180        end = lineBreaker.nextLineBreak(resolver, layoutState.lineInfo(), renderTextInfo, lastFloatFromPreviousLine, consecutiveHyphenatedLines, wordMeasurements);
     1181        cachePriorCharactersIfNeeded(renderTextInfo.m_lineBreakIterator);
    11811182        renderTextInfo.m_lineBreakIterator.resetPriorContext();
    11821183        if (resolver.position().atEnd()) {
  • trunk/Source/WebCore/rendering/RenderRubyBase.cpp

    r177377 r179366  
    161161}
    162162
     163void RenderRubyBase::cachePriorCharactersIfNeeded(const LazyLineBreakIterator& lineBreakIterator)
     164{
     165    auto* run = rubyRun();
     166    if (run)
     167        run->setCachedPriorCharacters(lineBreakIterator.lastCharacter(), lineBreakIterator.secondToLastCharacter());
     168}
     169
    163170} // namespace WebCore
  • trunk/Source/WebCore/rendering/RenderRubyBase.h

    r177377 r179366  
    5757        m_isAfterExpansion = true;
    5858    }
     59   
     60    virtual void cachePriorCharactersIfNeeded(const LazyLineBreakIterator&) override;
    5961
    6062private:
  • trunk/Source/WebCore/rendering/RenderRubyRun.cpp

    r178510 r179366  
    4646RenderRubyRun::RenderRubyRun(Document& document, Ref<RenderStyle>&& style)
    4747    : RenderBlockFlow(document, WTF::move(style))
     48    , m_lastCharacter(0)
     49    , m_secondToLastCharacter(0)
    4850{
    4951    setReplaced(true);
    … …  
    350352}
    351353
     354void RenderRubyRun::updatePriorContextFromCachedBreakIterator(LazyLineBreakIterator& iterator) const
     355{
     356    iterator.setPriorContext(m_lastCharacter, m_secondToLastCharacter);
     357}
     358
     359bool RenderRubyRun::canBreakBefore(const LazyLineBreakIterator& iterator) const
     360{
     361    RenderRubyText* rubyText = this->rubyText();
     362    if (!rubyText)
     363        return true;
     364    return rubyText->canBreakBefore(iterator);
     365}
     366
    352367} // namespace WebCore
  • trunk/Source/WebCore/rendering/RenderRubyRun.h

    r177398 r179366  
    6868    static RenderRubyRun* staticCreateRubyRun(const RenderObject* parentRuby);
    6969   
     70    void updatePriorContextFromCachedBreakIterator(LazyLineBreakIterator&) const;
     71    void setCachedPriorCharacters(UChar last, UChar secondToLast)
     72    {
     73        m_lastCharacter = last;
     74        m_secondToLastCharacter = secondToLast;
     75    }
     76    bool canBreakBefore(const LazyLineBreakIterator&) const;
     77   
    7078protected:
    7179    RenderRubyBase* createRubyBase() const;
    … …  
    7684    virtual bool createsAnonymousWrapper() const override { return true; }
    7785    virtual void removeLeftoverAnonymousBlock(RenderBlock*) override { }
     86
     87private:
     88    UChar m_lastCharacter;
     89    UChar m_secondToLastCharacter;
    7890};
    7991
  • trunk/Source/WebCore/rendering/RenderRubyText.cpp

    r177259 r179366  
    9494}
    9595
     96bool RenderRubyText::canBreakBefore(const LazyLineBreakIterator& iterator) const
     97{
     98    // FIXME: It would be nice to improve this so that it isn't just hard-coded, but lookahead in this
     99    // case is particularly problematic.
     100
     101    if (!iterator.priorContextLength())
     102        return true;
     103    UChar ch = iterator.lastCharacter();
     104    ULineBreak lineBreak = (ULineBreak)u_getIntPropertyValue(ch, UCHAR_LINE_BREAK);
     105    // UNICODE LINE BREAKING ALGORITHM
     106    // http://www.unicode.org/reports/tr14/
     107    // And Requirements for Japanese Text Layout, 3.1.7 Characters Not Starting a Line
     108    // http://www.w3.org/TR/2012/NOTE-jlreq-20120403/#characters_not_starting_a_line
     109    switch (lineBreak) {
     110    case U_LB_NONSTARTER:
     111    case U_LB_CLOSE_PARENTHESIS:
     112    case U_LB_CLOSE_PUNCTUATION:
     113    case U_LB_EXCLAMATION:
     114    case U_LB_BREAK_SYMBOLS:
     115    case U_LB_INFIX_NUMERIC:
     116    case U_LB_ZWSPACE:
     117    case U_LB_WORD_JOINER:
     118        return false;
     119    default:
     120        break;
     121    }
     122    // Special care for Requirements for Japanese Text Layout
     123    switch (ch) {
     124    case 0x2019: // RIGHT SINGLE QUOTATION MARK
     125    case 0x201D: // RIGHT DOUBLE QUOTATION MARK
     126    case 0x00BB: // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
     127    case 0x2010: // HYPHEN
     128    case 0x2013: // EN DASH
     129    case 0x300C: // LEFT CORNER BRACKET
     130        return false;
     131    default:
     132        break;
     133    }
     134    return true;
     135}
     136
    96137} // namespace WebCore
  • trunk/Source/WebCore/rendering/RenderRubyText.h

    r177259 r179366  
    4646   
    4747    RenderRubyRun* rubyRun() const;
    48 
     48   
     49    bool canBreakBefore(const LazyLineBreakIterator&) const;
     50   
    4951private:
    5052    virtual const char* renderName() const override { return "RenderRubyText"; }
  • trunk/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h

    r178940 r179366  
    423423
    424424    // Break on replaced elements if either has normal white-space.
    425     if ((m_autoWrap || RenderStyle::autoWrap(m_lastWS)) && (!m_current.renderer()->isImage() || m_allowImagesToBreak)) {
     425    if ((m_autoWrap || RenderStyle::autoWrap(m_lastWS)) && (!m_current.renderer()->isImage() || m_allowImagesToBreak)
     426        && (!m_current.renderer()->isRubyRun() || downcast<RenderRubyRun>(m_current.renderer())->canBreakBefore(m_renderTextInfo.m_lineBreakIterator))) {
    426427        m_width.commit();
    427428        m_lineBreak.moveToStartOf(m_current.renderer());
    … …  
    452453    } else
    453454        m_width.addUncommittedWidth(replacedLogicalWidth);
    454     if (is<RenderRubyRun>(*m_current.renderer()))
     455    if (is<RenderRubyRun>(*m_current.renderer())) {
    455456        m_width.applyOverhang(downcast<RenderRubyRun>(m_current.renderer()), m_lastObject, m_nextObject);
    456     // Update prior line break context characters, using U+FFFD (OBJECT REPLACEMENT CHARACTER) for replaced element.
    457     m_renderTextInfo.m_lineBreakIterator.updatePriorContext(replacementCharacter);
     457        downcast<RenderRubyRun>(m_current.renderer())->updatePriorContextFromCachedBreakIterator(m_renderTextInfo.m_lineBreakIterator);
     458    } else {
     459        // Update prior line break context characters, using U+FFFD (OBJECT REPLACEMENT CHARACTER) for replaced element.
     460        m_renderTextInfo.m_lineBreakIterator.updatePriorContext(replacementCharacter);
     461    }
    458462}
    459463
    … …  
    960964    bool currentIsTextOrEmptyInline = is<RenderText>(*m_current.renderer()) || (is<RenderInline>(*m_current.renderer()) && isEmptyInline(downcast<RenderInline>(*m_current.renderer())));
    961965    if (!currentIsTextOrEmptyInline)
    962         return m_autoWrap;
     966        return m_autoWrap && !m_current.renderer()->isRubyRun();
    963967
    964968    bool canBreakHere = !m_currentCharacterIsSpace && textBeginsWithBreakablePosition(nextRenderText);
    … …  
    10071011    if (!m_current.renderer()->isFloatingOrOutOfFlowPositioned()) {
    10081012        m_lastObject = m_current.renderer();
    1009         if (m_lastObject->isReplaced() && m_autoWrap && (!m_lastObject->isImage() || m_allowImagesToBreak) && (!is<RenderListMarker>(*m_lastObject) || downcast<RenderListMarker>(*m_lastObject).isInside())) {
     1013        if (m_lastObject->isReplaced() && m_autoWrap && !m_lastObject->isRubyRun() && (!m_lastObject->isImage() || m_allowImagesToBreak) && (!is<RenderListMarker>(*m_lastObject) || downcast<RenderListMarker>(*m_lastObject).isInside())) {
    10101014            m_width.commit();
    10111015            m_lineBreak.moveToStartOf(m_nextObject);
Note: See TracChangeset for help on using the changeset viewer.