Commit 6970fb79 authored by mitz@apple.com's avatar mitz@apple.com

WebCore:

        Reviewed by John Sullivan.

        - fix <rdar://problem/6020930> Bidi Problem When Resizing Window

        Test: fast/text/international/bidi-AN-after-empty-run.html

        * platform/text/BidiResolver.h:
        (WebCore::::appendRun): Changed to reset the current direction and
        "end of run" direction even in the empty run case.
        * rendering/bidi.cpp:
        (WebCore::BidiState::appendRun): Ditto.

LayoutTests:

        Reviewed by John Sullivan.

        - test for <rdar://problem/6020930> Bidi Problem When Resizing Window

        * fast/text/international/bidi-AN-after-empty-run.html: Added.
        * platform/mac/fast/text/international/bidi-AN-after-empty-run-expected.checksum: Added.
        * platform/mac/fast/text/international/bidi-AN-after-empty-run-expected.png: Added.
        * platform/mac/fast/text/international/bidi-AN-after-empty-run-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34989 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9a433b9c
2008-07-03 Dan Bernstein <mitz@apple.com>
Reviewed by John Sullivan.
- test for <rdar://problem/6020930> Bidi Problem When Resizing Window
* fast/text/international/bidi-AN-after-empty-run.html: Added.
* platform/mac/fast/text/international/bidi-AN-after-empty-run-expected.checksum: Added.
* platform/mac/fast/text/international/bidi-AN-after-empty-run-expected.png: Added.
* platform/mac/fast/text/international/bidi-AN-after-empty-run-expected.txt: Added.
2008-07-02 Jon Honeycutt <jhoneycutt@apple.com>
Test for <rdar://5983747> Safari crashes trying to load the SilverLight plugin
<style>
div { width: 80px; border: 1px solid blue; padding: 4px; margin: 4p;x }
</style>
<p>
Test for <i><a href="rdar://problem/6020930">rdar://problem/6020930</a> Bidi Problem When Resizing Window</i>.
</p>
<p>
The boxes below should be identical to each other.
</p>
<div style="-webkit-line-break: after-white-space;">
&#x0627;&#x0644;&#x0645;&#x0627;&#x0626;&#x0629; &#x0645;&#x0644;&#x064a;&#x0627;&#x0631; 12345 &#x0645;&#x0646;
</div>
<div>
&#x0627;&#x0644;&#x0645;&#x0627;&#x0626;&#x0629; &#x0645;&#x0644;&#x064a;&#x0627;&#x0631; 12345 &#x0645;&#x0646;
</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 {P} at (0,0) size 784x18
RenderText {#text} at (0,0) size 53x18
text run at (0,0) width 53: "Test for "
RenderInline {I} at (0,0) size 396x18
RenderInline {A} at (0,0) size 154x18 [color=#0000EE]
RenderText {#text} at (53,0) size 154x18
text run at (53,0) width 154: "rdar://problem/6020930"
RenderText {#text} at (207,0) size 242x18
text run at (207,0) width 242: " Bidi Problem When Resizing Window"
RenderText {#text} at (449,0) size 4x18
text run at (449,0) width 4: "."
RenderBlock {P} at (0,34) size 784x18
RenderText {#text} at (0,0) size 320x18
text run at (0,0) width 320: "The boxes below should be identical to each other."
RenderBlock {DIV} at (0,68) size 90x46 [border: (1px solid #0000FF)]
RenderText {#text} at (5,5) size 58x36
text run at (5,5) width 49 RTL: "\x{627}\x{644}\x{645}\x{627}\x{626}\x{629} \x{645}\x{644}\x{64A}\x{627}\x{631}"
text run at (54,5) width 4: " "
text run at (5,23) width 18 RTL: " \x{645}\x{646}"
text run at (23,23) width 40: "12345"
RenderBlock {DIV} at (0,114) size 90x46 [border: (1px solid #0000FF)]
RenderText {#text} at (5,5) size 58x36
text run at (5,5) width 49 RTL: "\x{627}\x{644}\x{645}\x{627}\x{626}\x{629} \x{645}\x{644}\x{64A}\x{627}\x{631}"
text run at (5,23) width 18 RTL: " \x{645}\x{646}"
text run at (23,23) width 40: "12345"
2008-07-03 Dan Bernstein <mitz@apple.com>
Reviewed by John Sullivan.
- fix <rdar://problem/6020930> Bidi Problem When Resizing Window
Test: fast/text/international/bidi-AN-after-empty-run.html
* platform/text/BidiResolver.h:
(WebCore::::appendRun): Changed to reset the current direction and
"end of run" direction even in the empty run case.
* rendering/bidi.cpp:
(WebCore::BidiState::appendRun): Ditto.
2008-07-02 Jon Honeycutt <jhoneycutt@apple.com>
<rdar://5983747> Safari crashes trying to load the SilverLight plugin
......@@ -244,13 +244,13 @@ inline void BidiResolver<Iterator, Run>::moveRunToBeginning(Run* run)
template <class Iterator, class Run>
void BidiResolver<Iterator, Run>::appendRun()
{
if (emptyRun || eor.atEnd())
return;
if (!emptyRun && !eor.atEnd()) {
addRun(new Run(sor.offset(), eor.offset() + 1, context(), m_direction));
addRun(new Run(sor.offset(), eor.offset() + 1, context(), m_direction));
eor.increment();
sor = eor;
}
eor.increment();
sor = eor;
m_direction = WTF::Unicode::OtherNeutral;
m_status.eor = WTF::Unicode::OtherNeutral;
}
......
......@@ -427,29 +427,29 @@ static void appendRunsForObject(int start, int end, RenderObject* obj, BidiState
template <>
void BidiState::appendRun()
{
if (emptyRun || eor.atEnd())
return;
int start = sor.pos;
RenderObject *obj = sor.obj;
while (obj && obj != eor.obj && obj != endOfLine.obj) {
appendRunsForObject(start, obj->length(), obj, *this);
start = 0;
obj = bidiNext(sor.block, obj);
}
if (obj) {
unsigned pos = obj == eor.obj ? eor.pos : UINT_MAX;
if (obj == endOfLine.obj && endOfLine.pos <= pos) {
reachedEndOfLine = true;
pos = endOfLine.pos;
if (!emptyRun && !eor.atEnd()) {
int start = sor.pos;
RenderObject *obj = sor.obj;
while (obj && obj != eor.obj && obj != endOfLine.obj) {
appendRunsForObject(start, obj->length(), obj, *this);
start = 0;
obj = bidiNext(sor.block, obj);
}
if (obj) {
unsigned pos = obj == eor.obj ? eor.pos : UINT_MAX;
if (obj == endOfLine.obj && endOfLine.pos <= pos) {
reachedEndOfLine = true;
pos = endOfLine.pos;
}
// It's OK to add runs for zero-length RenderObjects, just don't make the run larger than it should be
int end = obj->length() ? pos+1 : 0;
appendRunsForObject(start, end, obj, *this);
}
// It's OK to add runs for zero-length RenderObjects, just don't make the run larger than it should be
int end = obj->length() ? pos+1 : 0;
appendRunsForObject(start, end, obj, *this);
eor.increment();
sor = eor;
}
eor.increment();
sor = eor;
m_direction = OtherNeutral;
m_status.eor = OtherNeutral;
}
......
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