[webkit-changes] cvs commit: WebCore/khtml/rendering bidi.cpp
Darin
darin at opensource.apple.com
Fri Dec 16 10:18:52 PST 2005
darin 05/12/16 10:18:52
Modified: . ChangeLog
khtml/rendering bidi.cpp
Log:
Reviewed and landed by Darin.
Test: fast/text/international/bidi-european-terminators.html
Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=6014
Bidi algorithm: incorrect resolved levels for neutrals between R and
ET ON L
* khtml/rendering/bidi.cpp:
(khtml::RenderBlock::bidiReorderLine):
Keep track of the last position before the current run of ETs directly
using a new BidiState member, lastBeforeET.
Revision Changes Path
1.549 +15 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.548
retrieving revision 1.549
diff -u -r1.548 -r1.549
--- ChangeLog 16 Dec 2005 16:40:12 -0000 1.548
+++ ChangeLog 16 Dec 2005 18:18:43 -0000 1.549
@@ -2,6 +2,21 @@
Reviewed and landed by Darin.
+ Test: fast/text/international/bidi-european-terminators.html
+
+ Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=6014
+ Bidi algorithm: incorrect resolved levels for neutrals between R and
+ ET ON L
+
+ * khtml/rendering/bidi.cpp:
+ (khtml::RenderBlock::bidiReorderLine):
+ Keep track of the last position before the current run of ETs directly
+ using a new BidiState member, lastBeforeET.
+
+2005-12-16 Mitz Pettel <opendarwin.org at mitzpettel.com>
+
+ Reviewed and landed by Darin.
+
- fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5486
DumpRenderTree should print the RTL and directional override flags for text runs
1.162 +6 -21 WebCore/khtml/rendering/bidi.cpp
Index: bidi.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/bidi.cpp,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -r1.161 -r1.162
--- bidi.cpp 7 Dec 2005 22:48:56 -0000 1.161
+++ bidi.cpp 16 Dec 2005 18:18:50 -0000 1.162
@@ -71,6 +71,7 @@
bool adjustEmbedding;
BidiIterator endOfLine;
bool reachedEndOfLine;
+ BidiIterator lastBeforeET;
};
inline bool operator==(const BidiStatus& status1, const BidiStatus& status2)
@@ -1125,12 +1126,6 @@
if (bidi.status.lastStrong != QChar::DirAL) {
// if last strong was AL change EN to AN
switch (bidi.status.last) {
- case QChar::DirET:
- if (bidi.status.lastStrong == QChar::DirR || bidi.status.lastStrong == QChar::DirAL) {
- appendRun(bidi);
- bidi.dir = QChar::DirEN;
- }
- // fall through
case QChar::DirEN:
case QChar::DirL:
break;
@@ -1145,6 +1140,7 @@
case QChar::DirCS:
if (bidi.status.eor == QChar::DirEN)
break;
+ case QChar::DirET:
case QChar::DirBN:
case QChar::DirB:
case QChar::DirS:
@@ -1152,7 +1148,7 @@
case QChar::DirON:
if (bidi.status.eor == QChar::DirR) {
// neutrals go to R
- bidi.eor = bidi.last;
+ bidi.eor = bidi.status.last == QChar::DirET ? bidi.lastBeforeET : bidi.last;
appendRun(bidi);
bidi.dir = QChar::DirEN;
} else if (bidi.status.eor != QChar::DirL &&
@@ -1160,7 +1156,7 @@
bidi.dir != QChar::DirL) {
// numbers on both sides, neutrals get right to left direction
appendRun(bidi);
- bidi.eor = bidi.last;
+ bidi.eor = bidi.status.last == QChar::DirET ? bidi.lastBeforeET : bidi.last;
bidi.dir = QChar::DirR;
appendRun(bidi);
bidi.dir = QChar::DirEN;
@@ -1232,19 +1228,8 @@
dirCurrent = QChar::DirEN;
bidi.eor = bidi.current;
bidi.status.eor = dirCurrent;
- break;
- } else if ((bidi.status.eor == QChar::DirR || bidi.status.eor == QChar::DirAL || bidi.status.eor == QChar::DirAN || (bidi.status.eor == QChar::DirEN && bidi.status.lastStrong == QChar::DirR)) && bidi.last!=bidi.current) {
- // most of the time this is unnecessary, but we need to secure the R run in case
- // the ET ends up being neutral and followed by L
- if (bidi.status.last!=QChar::DirET) {
- bidi.dir = bidi.status.eor;
- appendRun(bidi);
- bidi.eor = bidi.last;
- }
- bidi.status.eor = QChar::DirR;
- bidi.dir = QChar::DirR;
- break;
- }
+ } else if (bidi.status.last != QChar::DirET)
+ bidi.lastBeforeET = emptyRun ? bidi.eor : bidi.last;
break;
// boundary neutrals should be ignored
More information about the webkit-changes
mailing list