[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

andreas.kling at nokia.com andreas.kling at nokia.com
Wed Dec 22 15:18:55 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 3d31fe2e565d7e27de9ce53c0da9863a072a96da
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Oct 30 14:51:34 2010 +0000

    2010-10-30  Andreas Kling  <kling at webkit.org>
    
            Reviewed by Antonio Gomes.
    
            [Qt] IM: Don't manipulate selection via RenderTextControl
            https://bugs.webkit.org/show_bug.cgi?id=48700
    
            Go directly through the Frame's SelectionController instead.
    
            No new tests, this is covered by tst_QWebPage::inputMethods.
    
            * Api/qwebpage.cpp:
            (QWebPagePrivate::inputMethodEvent):
            (QWebPage::inputMethodQuery):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70982 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index 40f41c5..6a288d5 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -1024,9 +1024,9 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
         return;
     }
 
-    RenderObject* renderer = 0;
+    Node* node = 0;
     if (frame->selection()->rootEditableElement())
-        renderer = frame->selection()->rootEditableElement()->shadowAncestorNode()->renderer();
+        node = frame->selection()->rootEditableElement()->shadowAncestorNode();
 
     Vector<CompositionUnderline> underlines;
     bool hasSelection = false;
@@ -1054,8 +1054,8 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
         case QInputMethodEvent::Selection: {
             hasSelection = true;
             // A selection in the inputMethodEvent is always reflected in the visible text
-            if (renderer && renderer->node())
-                setSelectionRange(renderer->node(), qMin(a.start, (a.start + a.length)), qMax(a.start, (a.start + a.length)));
+            if (node)
+                setSelectionRange(node, qMin(a.start, (a.start + a.length)), qMax(a.start, (a.start + a.length)));
 
             if (!ev->preeditString().isEmpty()) {
                 editor->setComposition(ev->preeditString(), underlines,
@@ -1319,14 +1319,11 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const
             return QVariant(QFont());
         }
         case Qt::ImCursorPosition: {
-            if (renderTextControl) {
-                if (editor->hasComposition()) {
-                    RefPtr<Range> range = editor->compositionRange();
-                    return QVariant(renderTextControl->selectionEnd() - TextIterator::rangeLength(range.get()));
-                }
-                return QVariant(frame->selection()->extent().offsetInContainerNode());
+            if (editor->hasComposition()) {
+                RefPtr<Range> range = editor->compositionRange();
+                return QVariant(frame->selection()->end().offsetInContainerNode() - TextIterator::rangeLength(range.get()));
             }
-            return QVariant();
+            return QVariant(frame->selection()->extent().offsetInContainerNode());
         }
         case Qt::ImSurroundingText: {
             if (renderTextControl) {
@@ -1340,23 +1337,20 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const
         }
         case Qt::ImCurrentSelection: {
             if (renderTextControl) {
-                int start = renderTextControl->selectionStart();
-                int end = renderTextControl->selectionEnd();
+                int start = frame->selection()->start().offsetInContainerNode();
+                int end = frame->selection()->end().offsetInContainerNode();
                 if (end > start)
-                    return QVariant(QString(renderTextControl->text()).mid(start,end-start));
+                    return QVariant(QString(renderTextControl->text()).mid(start, end - start));
             }
             return QVariant();
 
         }
         case Qt::ImAnchorPosition: {
-            if (renderTextControl) {
-                if (editor->hasComposition()) {
-                    RefPtr<Range> range = editor->compositionRange();
-                    return QVariant(renderTextControl->selectionStart() - TextIterator::rangeLength(range.get()));
-                }
-                return QVariant(frame->selection()->base().offsetInContainerNode());
+            if (editor->hasComposition()) {
+                RefPtr<Range> range = editor->compositionRange();
+                return QVariant(frame->selection()->start().offsetInContainerNode() - TextIterator::rangeLength(range.get()));
             }
-            return QVariant();
+            return QVariant(frame->selection()->base().offsetInContainerNode());
         }
         case Qt::ImMaximumTextLength: {
             if (frame->selection()->isContentEditable()) {
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 9c64e70..c3ce3de 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,18 @@
+2010-10-30  Andreas Kling  <kling at webkit.org>
+
+        Reviewed by Antonio Gomes.
+
+        [Qt] IM: Don't manipulate selection via RenderTextControl
+        https://bugs.webkit.org/show_bug.cgi?id=48700
+
+        Go directly through the Frame's SelectionController instead.
+
+        No new tests, this is covered by tst_QWebPage::inputMethods.
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::inputMethodEvent):
+        (QWebPage::inputMethodQuery):
+
 2010-10-29  Daniel Bates  <dbates at rim.com>
 
         No review, rolling out 70971.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list