Commit 37717da4 authored by mitz@apple.com's avatar mitz@apple.com

WebCore:

        Reviewed by Darin Adler.

        - make centered text in right-to-left blocks spill over to the left

        Test: fast/text/align-center-rtl-spill.html

        * rendering/bidi.cpp:
        (WebCore::RenderBlock::computeHorizontalPositionsForLine):

LayoutTests:

        Reviewed by Darin Adler.

        - test that centered text in right-to-left blocks spills over to the left

        * fast/text/align-center-rtl-spill.html: Added.
        * platform/mac/fast/text/align-center-rtl-spill-expected.checksum: Added.
        * platform/mac/fast/text/align-center-rtl-spill-expected.png: Added.
        * platform/mac/fast/text/align-center-rtl-spill-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2442270a
2008-02-27 Dan Bernstein <mitz@apple.com>
Reviewed by Darin Adler.
- test that centered text in right-to-left blocks spills over to the left
* fast/text/align-center-rtl-spill.html: Added.
* platform/mac/fast/text/align-center-rtl-spill-expected.checksum: Added.
* platform/mac/fast/text/align-center-rtl-spill-expected.png: Added.
* platform/mac/fast/text/align-center-rtl-spill-expected.txt: Added.
2008-02-27 Eric Seidel <eric@webkit.org>
Rubber-stamped by Adam.
<div style="display: inline-block; width: 50px; height: 100px; background-color: red;"></div><div style="display: inline-block; width: 50px; text-align: center; direction: rtl;">
<div style="display: inline-block; width: 100px; height: 100px; background-color: green;"></div>
</div>
18f1f64eab31dfb69467a497de9442d7
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderBlock {DIV} at (0,0) size 50x100 [bgcolor=#FF0000]
RenderBlock {DIV} at (50,0) size 50x100
RenderBlock {DIV} at (-50,0) size 100x100 [bgcolor=#008000]
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
2008-02-27 Dan Bernstein <mitz@apple.com>
Reviewed by Darin Adler.
- make centered text in right-to-left blocks spill over to the left
Test: fast/text/align-center-rtl-spill.html
* rendering/bidi.cpp:
(WebCore::RenderBlock::computeHorizontalPositionsForLine):
2008-02-27 Dan Bernstein <mitz@apple.com>
Reviewed by Darin Adler.
......@@ -644,8 +644,10 @@ void RenderBlock::computeHorizontalPositionsForLine(RootInlineBox* lineBox, Bidi
break;
case CENTER:
case WEBKIT_CENTER:
// FIXME: It is inconsistent to pin to the left even in RTL blocks.
x += max((availableWidth - totWidth) / 2, 0);
if (style()->direction() == LTR)
x += max((availableWidth - totWidth) / 2, 0);
else
x += totWidth > availableWidth ? (availableWidth - totWidth) : (availableWidth - totWidth) / 2;
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment