KDE Bug Tracking System
Home
Report New Wish or Bug
Query Existing Reports
First
Last
Prev
Next
No search results available
Search page
Bug
91955
:
[test case] Bidi algorithm: incorrect implement...
P
roduct
:
konqueror
Co
m
ponent
:
khtml renderer
Status
:
RESOLVED
Resolution
:
FIXED
Target
:
---
Version
:
unspecified
Pr
i
ority
:
NOR
Severity
:
normal
V
otes
:
50
Description
:
Opened:
2004-10-23 15:16
Last Changed:
2004-11-04 23:31:32
Version: (using KDE Devel) Installed from: Compiled sources OS: I Don't Know The directionality of a neutral character at the beginning of a paragraph (or after a hard line break) is decided incorrectly if the first non-neutral character in the paragraph has directionality opposite to the paragraph directionality. For example, if the paragraph direction is LTR, the first character on the paragraph is a question mark and the next one is a Hebrew character, then the question mark will is considered right-to-left and appears to the right of the Hebrew character. The rule to follow is 3.3.4.N2 in the Unicode Standard's Bidirectional Algorithm <
http://www.unicode.org/reports/tr9/#Resolving_Neutral_Types
>. For example (uppercase letters are R, lowercase are L), <DIV dir="ltr"> ? SLOM hello </DIV> should be rendered as: ? MOLS hello but is currently rendered as: MOLS ? hello and <DIV dir="rtl"> ? hello SLOM </DIV> should be rendered as: MOLS hello ? but is currently rendered as: MOLS ? hello The relevant code seems to be in RenderBlock::bidiReorderLine in khtml/rendering/bidi.cpp, specifically in the handling of the cases ( dirCurrent, status.last ) == ( [L|AL|R], [ES|ET|CS|BN|B|S|WS|ON] ).
Comment
#1
Allan Sandfeld 2004-11-02 23:28:38
Created an attachment (id=8143)
[details]
test case
Comment
#2
Mitz Pettel 2004-11-02 23:50:33
Created an attachment (id=8146)
[details]
Proposed patch for bidi.cpp r1.198 OK, I'm not sure this is the proper way to submit a patch... I cleaned up the code at two places in bidiReorderLine, then I corrected the dirCurrent==[AL|R], bidi.status.last==[ET|ES|CS|BN|B|S|WS|ON] case, then I adapted the same logic to the dirCurrent==L, bidi.status.last==[ET|ES|CS|BN|B|S|WS|ON] case. Also set dir and status.eor after the appendRun in the dirCurrent==L, bidi.status.last==[R|AL|EN|AN] case, for consistency and clarity.
Comment
#3
Stephan Kulow 2004-11-03 00:04:02
you should post your patch to
kfm-devel@kde.org
. Not all developers read the bug list - due to the mass of bug reports we get and the little time developers have.
Comment
#4
Mitz Pettel 2004-11-03 00:23:18
Patch posted to kfm-devel.
http://lists.kde.org/?l=kfm-devel&m=109943744500671&w=2
Comment
#5
Mitz Pettel 2004-11-03 12:31:13
Created an attachment (id=8149)
[details]
Proposed patch for bidi.cpp r1.198
Comment
#6
Mitz Pettel 2004-11-03 12:32:40
(From update of
attachment 8149
[details]
) The previous patch was completely wrong. Sorry.
Comment
#7
Mitz Pettel 2004-11-04 00:42:16
Created an attachment (id=8153)
[details]
Proposed patch for bidi.cpp r1.198 Revised patch
Comment
#8
Mitz Pettel 2004-11-04 19:16:52
Created an attachment (id=8170)
[details]
Proposed patch for bidi.cpp r1.198 Revised patch
Comment
#9
Stephan Kulow 2004-11-04 23:31:14
CVS commit by coolo: applying the patch BUG: 91955 M +5 -0 ChangeLog 1.327 M +18 -21 rendering/bidi.cpp 1.199 --- kdelibs/khtml/ChangeLog #1.326:1.327 @@ -1,2 +1,7 @@ +2004-11-04 Stephan Kulow <
coolo@kde.org
> + + * rendering/bidi.cpp (bidiReorderLine): applying patch by Mitz Pettel + to fix neutral types at beginning of context + 2004-11-03 Germain Garand <
germain@ebooksfrance.com
> --- kdelibs/khtml/rendering/bidi.cpp #1.198:1.199 @@ -857,24 +857,23 @@ void RenderBlock::bidiReorderLine(const 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 { @@ -912,5 +911,6 @@ void RenderBlock::bidiReorderLine(const 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; @@ -918,4 +918,5 @@ void RenderBlock::bidiReorderLine(const bidi.status.eor = QChar::DirR; } else { + dir = QChar::DirL; bidi.eor = bidi.last; appendRun( bidi ); @@ -941,7 +942,4 @@ void RenderBlock::bidiReorderLine(const // 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; } @@ -1116,5 +1114,4 @@ void RenderBlock::bidiReorderLine(const case QChar::DirEN: if ( bidi.status.last == QChar::DirL ) { - bidi.status.last = QChar::DirL; break; }
Comment
#10
Stephan Kulow 2004-11-04 23:31:32
CVS commit by coolo: updating baseline of fixed test cases CCBUG: 91955 A baseline/unsorted/91955.html-dump.png 1.1 A baseline/unsorted/91955.html-render 1.1 A tests/unsorted/91955.html 1.1 M baseline/meyerweb.com/css2-tests/sec09-10a.htm-dump.png 1.7 M +2 -1 baseline/meyerweb.com/css2-tests/sec09-10a.htm-render 1.9 M baseline/meyerweb.com/css2-tests/sec09-10b.htm-dump.png 1.8 M +12 -9 baseline/meyerweb.com/css2-tests/sec09-10b.htm-render 1.9 M +1 -0 baseline/unsorted/.cvsignore 1.17 M baseline/unsorted/62904.html-dump.png 1.2 M +4 -3 baseline/unsorted/62904.html-render 1.2 M +0 -3 baseline/unsorted/minheight.html-render 1.4 M +1 -1 baseline/webcore/fast/lists/001.html-render 1.10
P
latform
:
Compiled Sources
O
S
:
other
K
eywords
:
People
Reporter
:
Mitz Pettel
Assigned To
:
Konqueror Developers
CC
:
bugs mano mail-central com
Related actions
View Bug Activity
Format For Printing
XML
Clone This Bug
Note
You need to
log in
before you can comment on or make changes to this bug.
Attachments
test case
(179 bytes, text/html)
2004-11-02 23:28
,
Allan Sandfeld
Details
Proposed patch for bidi.cpp r1.198
(4.01 KB, patch)
2004-11-02 23:50
,
Mitz Pettel
Details
Proposed patch for bidi.cpp r1.198
(4.01 KB, patch)
2004-11-03 12:31
,
Mitz Pettel
Details
Proposed patch for bidi.cpp r1.198
(4.20 KB, patch)
2004-11-04 00:42
,
Mitz Pettel
Details
Proposed patch for bidi.cpp r1.198
(4.24 KB, patch)
2004-11-04 19:16
,
Mitz Pettel
Details
Hide Obsolete
(3) |
View All
Add an attachment
(proposed patch, testcase, etc.)
Depends on
:
B
locks
:
Show dependency tree
-
Show dependency graph
First
Last
Prev
Next
No search results available
Search page
Actions
Reports
Requests
Reports
Bugs reported today
Bugs reported in the last 3 days
Bug reports with patches
Weekly Bug statistics
The most hated bugs
The most severe bugs
The most frequently reported bugs
The most wanted features
Junior Jobs
Report ownership counts and charts
My Account
New Account
Log In