Commit 51017321 authored by mitz@apple.com's avatar mitz@apple.com

WebCore:

        Reviewed by Sam Weinig.

        - fix http://bugs.webkit.org/show_bug.cgi?id=17152
          Paragraphs indented with :first-letter and text-align CSS render incorrectly

        Test: fast/text/apply-start-width-after-skipped-text.html

        * rendering/bidi.cpp:
        (WebCore::RenderBlock::findNextLineBreak): Improved the logic for when
        to figure in the padding, border and margin before a text node when the
        line begins inside a text node.

LayoutTests:

        Reviewed by Sam Weinig.

        - test for http://bugs.webkit.org/show_bug.cgi?id=17152
          Paragraphs indented with :first-letter and text-align CSS render incorrectly

        * fast/text/apply-start-width-after-skipped-text.html: Added.
        * platform/mac/fast/text/apply-start-width-after-skipped-text-expected.checksum: Added.
        * platform/mac/fast/text/apply-start-width-after-skipped-text-expected.png: Added.
        * platform/mac/fast/text/apply-start-width-after-skipped-text-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30590 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 06b9bcbd
2008-02-25 Dan Bernstein <mitz@apple.com>
Reviewed by Sam Weinig.
- test for http://bugs.webkit.org/show_bug.cgi?id=17152
Paragraphs indented with :first-letter and text-align CSS render incorrectly
* fast/text/apply-start-width-after-skipped-text.html: Added.
* platform/mac/fast/text/apply-start-width-after-skipped-text-expected.checksum: Added.
* platform/mac/fast/text/apply-start-width-after-skipped-text-expected.png: Added.
* platform/mac/fast/text/apply-start-width-after-skipped-text-expected.txt: Added.
2008-02-25 Beth Dakin <bdakin@apple.com> 2008-02-25 Beth Dakin <bdakin@apple.com>
Reviewed by Geoff. Reviewed by Geoff.
<style>
div { width: 100px; background-color: lightgreen; color: lightblue; font: 20px 'Ahem'; }
span { border-left: 40px solid silver; }
</style>
<div>
xx<span> x</span> x x
</div>
<div>
<span> x</span> x x
</div>
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 100x60 [color=#ADD8E6] [bgcolor=#90EE90]
RenderText {#text} at (0,0) size 40x20
text run at (0,0) width 40: "xx"
RenderInline {SPAN} at (0,0) size 60x20 [border: (40px solid #C0C0C0)]
RenderText {#text} at (40,20) size 20x20
text run at (40,20) width 20: "x"
RenderText {#text} at (60,20) size 100x40
text run at (60,20) width 40: " x"
text run at (0,40) width 20: "x"
RenderBlock {DIV} at (0,60) size 100x40 [color=#ADD8E6] [bgcolor=#90EE90]
RenderInline {SPAN} at (0,0) size 60x20 [border: (40px solid #C0C0C0)]
RenderText {#text} at (40,0) size 20x20
text run at (40,0) width 20: "x"
RenderText {#text} at (60,0) size 100x40
text run at (60,0) width 40: " x"
text run at (0,20) width 20: "x"
2008-02-25 Dan Bernstein <mitz@apple.com>
Reviewed by Sam Weinig.
- fix http://bugs.webkit.org/show_bug.cgi?id=17152
Paragraphs indented with :first-letter and text-align CSS render incorrectly
Test: fast/text/apply-start-width-after-skipped-text.html
* rendering/bidi.cpp:
(WebCore::RenderBlock::findNextLineBreak): Improved the logic for when
to figure in the padding, border and margin before a text node when the
line begins inside a text node.
2008-02-25 Kevin Ollivier <kevino@theolliviers.com> 2008-02-25 Kevin Ollivier <kevino@theolliviers.com>
Windows build fix for wx port. Windows build fix for wx port.
...@@ -1353,6 +1353,8 @@ void RenderBlock::fitBelowFloats(int widthToFit, int& availableWidth) ...@@ -1353,6 +1353,8 @@ void RenderBlock::fitBelowFloats(int widthToFit, int& availableWidth)
BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi) BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi)
{ {
bool appliedStartWidth = start.pos > 0;
// eliminate spaces at beginning of line // eliminate spaces at beginning of line
int width = skipWhitespace(start, bidi); int width = skipWhitespace(start, bidi);
int w = 0; int w = 0;
...@@ -1542,6 +1544,9 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi ...@@ -1542,6 +1544,9 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
} else } else
tmpW += o->width() + o->marginLeft() + o->marginRight() + inlineWidth(o); tmpW += o->width() + o->marginLeft() + o->marginRight() + inlineWidth(o);
} else if (o->isText()) { } else if (o->isText()) {
if (!pos)
appliedStartWidth = false;
RenderText* t = static_cast<RenderText*>(o); RenderText* t = static_cast<RenderText*>(o);
int strlen = t->textLength(); int strlen = t->textLength();
...@@ -1554,8 +1559,6 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi ...@@ -1554,8 +1559,6 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
int wordSpacing = o->style()->wordSpacing(); int wordSpacing = o->style()->wordSpacing();
int lastSpaceWordSpacing = 0; int lastSpaceWordSpacing = 0;
bool appliedStartWidth = pos > 0; // If the span originated on a previous line,
// then assume the start width has been applied.
int wrapW = tmpW + inlineWidth(o, !appliedStartWidth, true); int wrapW = tmpW + inlineWidth(o, !appliedStartWidth, true);
int charWidth = 0; int charWidth = 0;
int nextBreakable = -1; int nextBreakable = -1;
......
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