Commit 2028aa44 authored by rjw's avatar rjw

Fix for 3139120. This patch was contributed by Mitz Pettel. It correctly

        handles the visually ordered encodings.  The patch also picks up changes
        from kde that accounts for european numbers correctly in bidiReorderLine().

        Reviewed by Dave.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 31d40d53
2003-01-13 Richard Williamson <rjw@apple.com>
Fix for 3139120. This patch was contributed by Mitz Pettel. It correctly
handles the visually ordered encodings. The patch also picks up changes
from kde that accounts for european numbers correctly in bidiReorderLine().
Reviewed by Dave.
* khtml/html/html_formimpl.cpp:
(HTMLFormElementImpl::formData):
* khtml/misc/decoder.cpp:
(Decoder::setEncoding):
* khtml/rendering/bidi.cpp:
(RenderFlow::bidiReorderLine):
* khtml/rendering/bidi.h:
2003-01-13 Darin Adler <darin@apple.com>
Reviewed by Ken.
......
2003-01-13 Richard Williamson <rjw@apple.com>
Fix for 3139120. This patch was contributed by Mitz Pettel. It correctly
handles the visually ordered encodings. The patch also picks up changes
from kde that accounts for european numbers correctly in bidiReorderLine().
Reviewed by Dave.
* khtml/html/html_formimpl.cpp:
(HTMLFormElementImpl::formData):
* khtml/misc/decoder.cpp:
(Decoder::setEncoding):
* khtml/rendering/bidi.cpp:
(RenderFlow::bidiReorderLine):
* khtml/rendering/bidi.h:
2003-01-13 Darin Adler <darin@apple.com>
Reviewed by Ken.
......
......@@ -245,11 +245,6 @@ QByteArray HTMLFormElementImpl::formData(bool& ok)
if(!codec)
codec = QTextCodec::codecForLocale();
// we need to map visual hebrew to logical hebrew, as the web
// server alsways expects responses in logical ordering
if ( codec->mibEnum() == 11 )
codec = QTextCodec::codecForMib( 85 );
#if APPLE_CHANGES
QString encCharset = codec->name();
QChar encChars[encCharset.length()];
......
......@@ -303,13 +303,14 @@ void Decoder::setEncoding(const char *_encoding, bool force)
#endif
bool b;
m_codec = KGlobal::charsets()->codecForName(enc, b);
#if !APPLE_CHANGES
if(m_codec->mibEnum() == 11) {
// iso8859-8 (visually ordered)
m_codec = QTextCodec::codecForName("iso8859-8-i");
visualRTL = true;
// visually ordered unless one of the following
if( !(enc == "iso-8859-8-i" || enc == "iso_8859-8-i"
|| enc == "csiso88598i" || enc == "logical") )
visualRTL = true;
}
#endif
if( !b ) // in case the codec didn't exist, we keep the old one (fixes some sites specifying invalid codecs)
m_codec = old;
else
......
......@@ -491,6 +491,8 @@ void RenderFlow::bidiReorderLine(const BidiIterator &start, const BidiIterator &
else
eor = last;
appendRun();
dir = QChar::DirL;
status.eor = QChar::DirL;
} else {
if(status.eor == QChar::DirR) {
appendRun();
......@@ -572,8 +574,8 @@ void RenderFlow::bidiReorderLine(const BidiIterator &start, const BidiIterator &
case QChar::DirET:
if ( status.lastStrong == QChar::DirR || status.lastStrong == QChar::DirAL ) {
appendRun();
dir = QChar::DirAN;
status.eor = QChar::DirAN;
dir = QChar::DirEN;
status.eor = QChar::DirEN;
}
// fall through
case QChar::DirEN:
......@@ -586,7 +588,7 @@ void RenderFlow::bidiReorderLine(const BidiIterator &start, const BidiIterator &
case QChar::DirAN:
appendRun();
status.eor = QChar::DirEN;
dir = QChar::DirAN; break;
dir = QChar::DirEN; break;
case QChar::DirES:
case QChar::DirCS:
if(status.eor == QChar::DirEN) {
......@@ -601,7 +603,8 @@ void RenderFlow::bidiReorderLine(const BidiIterator &start, const BidiIterator &
// neutrals go to R
eor = last;
appendRun();
dir = QChar::DirAN;
dir = QChar::DirEN;
status.eor = QChar::DirEN;
}
else if( status.eor == QChar::DirL ||
(status.eor == QChar::DirEN && status.lastStrong == QChar::DirL)) {
......@@ -613,7 +616,8 @@ void RenderFlow::bidiReorderLine(const BidiIterator &start, const BidiIterator &
eor = last;
dir = QChar::DirR;
appendRun();
dir = QChar::DirAN;
dir = QChar::DirEN;
status.eor = QChar::DirEN;
} else {
eor = current; status.eor = dirCurrent;
}
......@@ -635,6 +639,7 @@ void RenderFlow::bidiReorderLine(const BidiIterator &start, const BidiIterator &
case QChar::DirAL:
case QChar::DirEN:
appendRun();
dir = QChar::DirAN; status.eor = QChar::DirAN;
break;
case QChar::DirCS:
if(status.eor == QChar::DirAN) {
......@@ -652,6 +657,7 @@ void RenderFlow::bidiReorderLine(const BidiIterator &start, const BidiIterator &
eor = last;
appendRun();
dir = QChar::DirAN;
status.eor = QChar::DirAN;
} else if( status.eor == QChar::DirL ||
(status.eor == QChar::DirEN && status.lastStrong == QChar::DirL)) {
eor = current; status.eor = dirCurrent;
......@@ -663,6 +669,7 @@ void RenderFlow::bidiReorderLine(const BidiIterator &start, const BidiIterator &
dir = QChar::DirR;
appendRun();
dir = QChar::DirAN;
status.eor = QChar::DirAN;
} else {
eor = current; status.eor = dirCurrent;
}
......@@ -730,6 +737,12 @@ void RenderFlow::bidiReorderLine(const BidiIterator &start, const BidiIterator &
case QChar::DirBN:
// ignore these
break;
case QChar::DirEN:
if ( status.last == QChar::DirL ) {
status.last = QChar::DirL;
break;
}
// fall through
default:
status.last = dirCurrent;
}
......
......@@ -62,12 +62,12 @@ namespace khtml {
// add level of run (cases I1 & I2)
if( level % 2 ) {
if(dir == QChar::DirL || dir == QChar::DirAN)
if(dir == QChar::DirL || dir == QChar::DirAN || dir == QChar::DirEN)
level++;
} else {
if( dir == QChar::DirR )
level++;
else if( dir == QChar::DirAN )
else if( dir == QChar::DirAN || dir == QChar::DirEN)
level += 2;
}
}
......
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