fix a hang in editing/selection/extend-by-word-002.html
authorlars <lars@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Oct 2007 10:25:31 +0000 (10:25 +0000)
committerlars <lars@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Oct 2007 10:25:31 +0000 (10:25 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@26066 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/qt/Skipped
WebCore/ChangeLog
WebCore/platform/qt/TextBreakIteratorQt.cpp

index 0f21969ae9f1d142f300850a98fc2679be038c4c..53afeefbfe525d40b5c009902dcf7788ab321fad 100644 (file)
@@ -1,3 +1,11 @@
+2007-10-05  Lars Knoll  <lars@trolltech.com>
+
+        Reviewed by olliej.
+
+        fix a hang in editing/selection/extend-by-word-002.html
+
+        * platform/qt/Skipped:
+
 2007-10-05  Lars Knoll  <lars@trolltech.com>
 
         Add a dummy plugin to DRT  to fix fast/dom/Window/Plug-Ins.html.
index 690901a253ebe089dfca3ac4a790df341c642722..3cd9ada2a71ae7666b7df9c5cfffe48f2e952f38 100644 (file)
@@ -1,9 +1,6 @@
 # ------- many missing features in DRT
 editing
 
-# ------- infinite hangs
-editing/selection/extend-by-word-002.html
-
 # ------- tests that fail against Qt 4.3 due to bugs and missing features in QXmlStream
 fast/dom/set-innerHTML.xhtml
 dom/xhtml/level3/core/nodelookupnamespaceuri01.xhtml
index 3a1f933ecd973888602d91364d94fc3f3b8f1322..19ec69fabdb0852edbfc5a23b81d8d4bc064be56 100644 (file)
@@ -1,3 +1,13 @@
+2007-10-05  Lars Knoll  <lars@trolltech.com>
+
+        Reviewed by olliej.
+
+        fix a hang in editing/selection/extend-by-word-002.html
+
+        * platform/qt/TextBreakIteratorQt.cpp:
+        (WebCore::CharBreakIteratorQt::next):
+        (WebCore::characterBreakIterator):
+
 2007-10-04  Mark Rowe  <mrowe@apple.com>
 
         Reviewed by Oliver.
index 2cd23bafda8ab2d737c5f365f0545606e0c85358..f8e8f4f4c7d333022eca14fd6b3bbac7c6271bb5 100644 (file)
@@ -67,7 +67,7 @@ namespace WebCore {
     }
 
     int WordBreakIteratorQt::next() {
-        if (currentPos == length) {
+        if (currentPos >= length) {
             currentPos = -1;
             return currentPos;
         }
@@ -82,7 +82,7 @@ namespace WebCore {
         return currentPos;
     }
     int WordBreakIteratorQt::previous() {
-        if (currentPos == 0) {
+        if (currentPos <= 0) {
             currentPos = -1;
             return currentPos;
         }
@@ -103,13 +103,13 @@ namespace WebCore {
     }
 
     int CharBreakIteratorQt::next() {
-        if (currentPos == length)
+        if (currentPos >= length)
             return -1;
         currentPos = layout.nextCursorPosition(currentPos);
         return currentPos;
     }
     int CharBreakIteratorQt::previous() {
-        if (currentPos == 0)
+        if (currentPos <= 0)
             return -1;
         currentPos = layout.previousCursorPosition(currentPos);
         return currentPos;
@@ -139,7 +139,7 @@ TextBreakIterator* characterBreakIterator(const UChar* string, int length)
     iterator->length = length;
     iterator->currentPos = 0;
     iterator->layout.setText(QString(reinterpret_cast<const QChar*>(string), length));
-
+    
     return iterator;
 }