<rdar://problem/8902740> Expand ruby base when it is shorter than the ruby text
https://bugs.webkit.org/show_bug.cgi?id=55183

Reviewed by Dave Hyatt.

Source/WebCore: 

Test: fast/ruby/base-shorter-than-text.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::availableLogicalWidthForLine):
* rendering/RenderBlock.h:
(WebCore::RenderBlock::adjustInlineDirectionLineBounds): Added. The base clase implementation does nothing.
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::textAlignmentForLine): Added. Implements the logic that changes "justify" to "auto" for
the last line or a line that ends with a hard break.
(WebCore::RenderBlock::computeInlineDirectionPositionsForLine): Use textAlignmentForLine(), compute the available
width more efficiently, and call adjustInlineDirectionLineBounds() for justified lines.
* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::rubyRun): Added.
(WebCore::RenderRubyBase::textAlignmentForLine): Added. Alwyas returns "justify".
(WebCore::RenderRubyBase::adjustInlineDirectionLineBounds): Added. Insets the line such that the inset is
half the width of a single intra-line expansion.
* rendering/RenderRubyBase.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::addChild): 

LayoutTests: 

* fast/ruby/base-shorter-than-text.html: Added.
* platform/mac/fast/ruby/base-shorter-than-text-expected.checksum: Added.
* platform/mac/fast/ruby/base-shorter-than-text-expected.png: Added.
* platform/mac/fast/ruby/base-shorter-than-text-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@79629 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed