<rdar://problem/7709452> Implement Default Ruby Overhang Behavior
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Apr 2011 05:21:16 +0000 (05:21 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Apr 2011 05:21:16 +0000 (05:21 +0000)
commit243dcc0bb89b3c7fd7218aa6c301edeb9f19403e
tree445009cb39a1fa1935068553fa95b66d49a57f56
parent96254ea5385326ec2b9fd9ff27fb79cb8ca92650
<rdar://problem/7709452> Implement Default Ruby Overhang Behavior
https://bugs.webkit.org/show_bug.cgi?id=49334

Reviewed by Simon Fraser.

Source/WebCore:

Tests: fast/ruby/overhang-horizontal.html
       fast/ruby/overhang-vertical.html

This is a first cut at ruby overhang. It allows ruby text to hang over other
text of equal or smaller size. Two notable omissions are that max preferred
width computation was not patched, so it will overshoot, and that overhang
ignores the width of the adjoining text runs.

* rendering/RenderBlock.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::computeInlineDirectionPositionsForLine): Adjust margins
of ruby runs for overhang.
(WebCore::RenderBlock::fitBelowFloats): Maintain the increase in line width to
compensate for overhang.
(WebCore::RenderBlock::findNextLineBreak): When encountering
a ruby run, increase the line width to account for the fact that overhang will be
collapsed.
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::getOverhang): Added. Allows ruby to overhang if
the adjoining renderer is text with equal or smaller font size.
* rendering/RenderRubyRun.h:
(WebCore::toRenderRubyRun):

LayoutTests:

* fast/ruby/overhang-horizontal-expected.checksum: Added.
* fast/ruby/overhang-horizontal-expected.png: Added.
* fast/ruby/overhang-horizontal-expected.txt: Added.
* fast/ruby/overhang-horizontal.html: Added.
* fast/ruby/overhang-vertical-expected.checksum: Added.
* fast/ruby/overhang-vertical-expected.png: Added.
* fast/ruby/overhang-vertical-expected.txt: Added.
* fast/ruby/overhang-vertical.html: Added.
* platform/mac/fast/blockflow/Kusa-Makura-background-canvas-expected.checksum:
* platform/mac/fast/blockflow/Kusa-Makura-background-canvas-expected.png:
* platform/mac/fast/blockflow/Kusa-Makura-background-canvas-expected.txt:
* platform/mac/fast/blockflow/english-lr-text-expected.checksum:
* platform/mac/fast/blockflow/english-lr-text-expected.png:
* platform/mac/fast/ruby/ruby-beforeafter-expected.checksum:
* platform/mac/fast/ruby/ruby-beforeafter-expected.png:
* platform/mac/fast/ruby/ruby-beforeafter-expected.txt:
* platform/mac/fast/ruby/ruby-length-expected.checksum:
* platform/mac/fast/ruby/ruby-length-expected.png:
* platform/mac/fast/ruby/ruby-length-expected.txt:
* platform/mac/fast/ruby/ruby-run-break-expected.checksum:
* platform/mac/fast/ruby/ruby-run-break-expected.png:
* platform/mac/fast/ruby/ruby-run-break-expected.txt:
* platform/mac/fast/ruby/ruby-runs-expected.checksum:
* platform/mac/fast/ruby/ruby-runs-expected.png:
* platform/mac/fast/ruby/ruby-runs-expected.txt:
* platform/mac/fast/ruby/ruby-runs-spans-expected.checksum:
* platform/mac/fast/ruby/ruby-runs-spans-expected.png:
* platform/mac/fast/ruby/ruby-runs-spans-expected.txt:
* platform/mac/fast/ruby/ruby-trailing-expected.checksum:
* platform/mac/fast/ruby/ruby-trailing-expected.png:
* platform/mac/fast/ruby/ruby-trailing-expected.txt:
* platform/mac/fast/ruby/rubyDOM-insert-rt-expected.checksum:
* platform/mac/fast/ruby/rubyDOM-insert-rt-expected.png:
* platform/mac/fast/ruby/rubyDOM-insert-rt-expected.txt:
* platform/mac/fast/ruby/rubyDOM-insert-text1-expected.checksum:
* platform/mac/fast/ruby/rubyDOM-insert-text1-expected.png:
* platform/mac/fast/ruby/rubyDOM-insert-text1-expected.txt:
* platform/mac/fast/ruby/rubyDOM-insert-text2-expected.checksum:
* platform/mac/fast/ruby/rubyDOM-insert-text2-expected.png:
* platform/mac/fast/ruby/rubyDOM-insert-text2-expected.txt:
* platform/mac/fast/ruby/rubyDOM-insert-text3-expected.checksum:
* platform/mac/fast/ruby/rubyDOM-insert-text3-expected.png:
* platform/mac/fast/ruby/rubyDOM-insert-text3-expected.txt:
* platform/mac/fast/ruby/rubyDOM-remove-rt1-expected.checksum:
* platform/mac/fast/ruby/rubyDOM-remove-rt1-expected.png:
* platform/mac/fast/ruby/rubyDOM-remove-rt1-expected.txt:
* platform/mac/fast/ruby/rubyDOM-remove-rt2-expected.checksum:
* platform/mac/fast/ruby/rubyDOM-remove-rt2-expected.png:
* platform/mac/fast/ruby/rubyDOM-remove-rt2-expected.txt:
* platform/mac/fast/ruby/rubyDOM-remove-text1-expected.checksum:
* platform/mac/fast/ruby/rubyDOM-remove-text1-expected.png:
* platform/mac/fast/ruby/rubyDOM-remove-text1-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@82903 268f45cc-cd09-0410-ab3c-d52691b4dbfc
58 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/ruby/overhang-horizontal-expected.checksum [new file with mode: 0644]
LayoutTests/fast/ruby/overhang-horizontal-expected.png [new file with mode: 0644]
LayoutTests/fast/ruby/overhang-horizontal-expected.txt [new file with mode: 0644]
LayoutTests/fast/ruby/overhang-horizontal.html [new file with mode: 0644]
LayoutTests/fast/ruby/overhang-vertical-expected.checksum [new file with mode: 0644]
LayoutTests/fast/ruby/overhang-vertical-expected.png [new file with mode: 0644]
LayoutTests/fast/ruby/overhang-vertical-expected.txt [new file with mode: 0644]
LayoutTests/fast/ruby/overhang-vertical.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/blockflow/Kusa-Makura-background-canvas-expected.checksum
LayoutTests/platform/mac/fast/blockflow/Kusa-Makura-background-canvas-expected.png
LayoutTests/platform/mac/fast/blockflow/Kusa-Makura-background-canvas-expected.txt
LayoutTests/platform/mac/fast/blockflow/english-lr-text-expected.checksum
LayoutTests/platform/mac/fast/blockflow/english-lr-text-expected.png
LayoutTests/platform/mac/fast/ruby/ruby-beforeafter-expected.checksum
LayoutTests/platform/mac/fast/ruby/ruby-beforeafter-expected.png
LayoutTests/platform/mac/fast/ruby/ruby-beforeafter-expected.txt
LayoutTests/platform/mac/fast/ruby/ruby-length-expected.checksum
LayoutTests/platform/mac/fast/ruby/ruby-length-expected.png
LayoutTests/platform/mac/fast/ruby/ruby-length-expected.txt
LayoutTests/platform/mac/fast/ruby/ruby-run-break-expected.checksum
LayoutTests/platform/mac/fast/ruby/ruby-run-break-expected.png
LayoutTests/platform/mac/fast/ruby/ruby-run-break-expected.txt
LayoutTests/platform/mac/fast/ruby/ruby-runs-expected.checksum
LayoutTests/platform/mac/fast/ruby/ruby-runs-expected.png
LayoutTests/platform/mac/fast/ruby/ruby-runs-expected.txt
LayoutTests/platform/mac/fast/ruby/ruby-runs-spans-expected.checksum
LayoutTests/platform/mac/fast/ruby/ruby-runs-spans-expected.png
LayoutTests/platform/mac/fast/ruby/ruby-runs-spans-expected.txt
LayoutTests/platform/mac/fast/ruby/ruby-trailing-expected.checksum
LayoutTests/platform/mac/fast/ruby/ruby-trailing-expected.png
LayoutTests/platform/mac/fast/ruby/ruby-trailing-expected.txt
LayoutTests/platform/mac/fast/ruby/rubyDOM-insert-rt-expected.checksum
LayoutTests/platform/mac/fast/ruby/rubyDOM-insert-rt-expected.png
LayoutTests/platform/mac/fast/ruby/rubyDOM-insert-rt-expected.txt
LayoutTests/platform/mac/fast/ruby/rubyDOM-insert-text1-expected.checksum
LayoutTests/platform/mac/fast/ruby/rubyDOM-insert-text1-expected.png
LayoutTests/platform/mac/fast/ruby/rubyDOM-insert-text1-expected.txt
LayoutTests/platform/mac/fast/ruby/rubyDOM-insert-text2-expected.checksum
LayoutTests/platform/mac/fast/ruby/rubyDOM-insert-text2-expected.png
LayoutTests/platform/mac/fast/ruby/rubyDOM-insert-text2-expected.txt
LayoutTests/platform/mac/fast/ruby/rubyDOM-insert-text3-expected.checksum
LayoutTests/platform/mac/fast/ruby/rubyDOM-insert-text3-expected.png
LayoutTests/platform/mac/fast/ruby/rubyDOM-insert-text3-expected.txt
LayoutTests/platform/mac/fast/ruby/rubyDOM-remove-rt1-expected.checksum
LayoutTests/platform/mac/fast/ruby/rubyDOM-remove-rt1-expected.png
LayoutTests/platform/mac/fast/ruby/rubyDOM-remove-rt1-expected.txt
LayoutTests/platform/mac/fast/ruby/rubyDOM-remove-rt2-expected.checksum
LayoutTests/platform/mac/fast/ruby/rubyDOM-remove-rt2-expected.png
LayoutTests/platform/mac/fast/ruby/rubyDOM-remove-rt2-expected.txt
LayoutTests/platform/mac/fast/ruby/rubyDOM-remove-text1-expected.checksum
LayoutTests/platform/mac/fast/ruby/rubyDOM-remove-text1-expected.png
LayoutTests/platform/mac/fast/ruby/rubyDOM-remove-text1-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderBlockLineLayout.cpp
Source/WebCore/rendering/RenderRubyRun.cpp
Source/WebCore/rendering/RenderRubyRun.h