--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x576
+ RenderBlock {P} at (0,0) size 784x18
+ RenderText {TEXT} at (0,0) size 569x18
+ text run at (0,0) width 569: "Mitz Pettel contributed this fix to KDE, and now we're rolling it in. Here's his explanation:"
+ RenderBlock {P} at (0,34) size 784x72
+ RenderText {TEXT} at (0,0) size 777x72
+ text run at (0,0) width 766: "The directionality of a neutral character at the beginning of a paragraph (or after a hard line break) is decided incorrectly if"
+ text run at (0,18) width 777: "the first non-neutral character in the paragraph has directionality opposite to the paragraph directionality. For example, if the"
+ text run at (0,36) width 768: "paragraph direction is LTR, the first character on the paragraph is a question mark and the next one is a Hebrew character,"
+ text run at (0,54) width 643: "then the question mark will is considered right-to-left and appears to the right of the Hebrew character."
+ RenderBlock {P} at (0,122) size 784x36
+ RenderText {TEXT} at (0,0) size 508x18
+ text run at (0,0) width 508: "The rule to follow is 3.3.4.N2 in the Unicode Standard's Bidirectional Algorithm"
+ RenderInline {A} at (0,0) size 397x18 [color=#0000EE]
+ RenderText {TEXT} at (0,18) size 397x18
+ text run at (0,18) width 397: "http://www.unicode.org/reports/tr9/#Resolving_Neutral_Types"
+ RenderText {TEXT} at (397,18) size 4x18
+ text run at (397,18) width 4: "."
+ RenderBlock {P} at (0,174) size 784x18
+ RenderText {TEXT} at (0,0) size 676x18
+ text run at (0,0) width 676: "If the test is successful, the question marks should be on the far left and far right of the next two paragraphs."
+ RenderBlock {P} at (0,208) size 784x18
+ RenderText {TEXT} at (0,0) size 65x18
+ text run at (0,0) width 11: "? "
+ text run at (11,0) width 23: "\x{FEB2} \x{FEED}"
+ text run at (34,0) width 31: "hello"
+ RenderBlock {P} at (0,242) size 784x18
+ RenderText {TEXT} at (715,0) size 69x18
+ text run at (715,0) width 27: " \x{FEB2} \x{FEED}"
+ text run at (742,0) width 31: "hello"
+ text run at (773,0) width 11: "? "
+2005-05-26 Darin Adler <darin@apple.com>
+
+ Reviewed by me, patch by Mitz Pettel.
+
+ - fixed <rdar://problem/4106907> bidi algorithm bug fixed for KHTML should be fixed in WebCore too
+
+ * khtml/rendering/bidi.cpp: (khtml::RenderBlock::bidiReorderLine): Integrated the patch that Mitz did
+ for the KDE bug, details at <http://www.mitzpettel.com/software/WebCorePatch2.html>.
+
+ Test cases added:
+ * layout-tests/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt: Added.
+ * layout-tests/fast/text/international/bidi-neutral-directionality-paragraph-start.html: Added.
+
2005-05-26 Darin Adler <darin@apple.com>
Reviewed by Richard and Dave Harrison.
case QChar::DirS:
case QChar::DirWS:
case QChar::DirON:
- if(dir != QChar::DirL) {
+ if( bidi.status.eor != QChar::DirL ) {
//last stuff takes embedding dir
- if( bidi.context->dir == QChar::DirR ) {
- if(!(bidi.status.eor == QChar::DirR)) {
- // AN or EN
- appendRun( bidi );
- dir = QChar::DirR;
- }
- else
- bidi.eor = bidi.last;
+ if(bidi.context->dir == QChar::DirL || bidi.status.lastStrong == QChar::DirL) {
+ if ( bidi.status.eor != QChar::DirEN && bidi.status.eor != QChar::DirAN && bidi.status.eor != QChar::DirON )
appendRun( bidi );
dir = QChar::DirL;
+ bidi.eor = bidi.current;
bidi.status.eor = QChar::DirL;
} else {
- if(bidi.status.eor == QChar::DirR) {
+ if ( bidi.status.eor == QChar::DirEN || bidi.status.eor == QChar::DirAN )
+ {
+ dir = bidi.status.eor;
appendRun( bidi );
- dir = QChar::DirL;
- } else {
- bidi.eor = bidi.current; bidi.status.eor = QChar::DirL; break;
}
+ dir = QChar::DirR;
+ bidi.eor = bidi.last;
+ appendRun( bidi );
+ dir = QChar::DirL;
+ bidi.status.eor = QChar::DirL;
}
} else {
bidi.eor = bidi.current; bidi.status.eor = QChar::DirL;
case QChar::DirON:
if( !(bidi.status.eor == QChar::DirR) && !(bidi.status.eor == QChar::DirAL) ) {
//last stuff takes embedding dir
- if(bidi.context->dir == QChar::DirR || bidi.status.lastStrong == QChar::DirR) {
+ if(bidi.context->dir == QChar::DirR || bidi.status.lastStrong == QChar::DirR
+ || bidi.status.lastStrong == QChar::DirAL) {
appendRun( bidi );
dir = QChar::DirR;
bidi.eor = bidi.current;
bidi.status.eor = QChar::DirR;
} else {
+ dir = QChar::DirL;
bidi.eor = bidi.last;
appendRun( bidi );
dir = QChar::DirR;
if(!(bidi.status.lastStrong == QChar::DirAL)) {
// if last strong was AL change EN to AN
if(dir == QChar::DirON) {
- if(bidi.status.lastStrong == QChar::DirAL)
- dir = QChar::DirAN;
- else
dir = QChar::DirL;
}
switch(bidi.status.last)
break;
case QChar::DirEN:
if ( bidi.status.last == QChar::DirL ) {
- bidi.status.last = QChar::DirL;
break;
}
// fall through