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

rniwa at webkit.org rniwa at webkit.org
Wed Dec 22 13:45:26 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 82ac98e895dc7c634baf396b97d573f9ad4a22e5
Author: rniwa at webkit.org <rniwa at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 24 23:22:02 2010 +0000

    2010-09-24  Ryosuke Niwa  <rniwa at webkit.org>
    
            Reviewed by Tony Chang.
    
            [chromium] Implement TextInputController::firstRectForCharacterRange
            https://bugs.webkit.org/show_bug.cgi?id=38100
    
            The following test now passes on chromium DumpRenderTree:
            platform/mac/editing/input/caret-primary-bidi.html
            platform/mac/editing/input/firstrectforcharacterrange-plain.html
            platform/mac/editing/input/range-for-empty-document.html
            editing/inserting/caret-position.html
    
            * platform/chromium/test_expectations.txt:
    2010-09-24  Ryosuke Niwa  <rniwa at webkit.org>
    
            Reviewed by Tony Chang.
    
            [chromium] Implement TextInputController::firstRectForCharacterRange
            https://bugs.webkit.org/show_bug.cgi?id=38100
    
            Implemented TextInputController::firstRectForCharacterRange for chromium platform.
            Because the function needs to return an array of integers, added makeIntArray to WebBindings.
            makeIntArray does not take Vector because WebBindings.h is included in plugin glue code
            where it cannot find wtf/Vector.h.
    
            No new tests are added since we need to implement the same feature in chromium side
            in order to enable any tests that uses this function.
    
            * public/WebBindings.h:
            * public/WebFrame.h:
            * src/WebBindings.cpp:
            (WebKit::makeIntArrayImpl): Added.
            (WebKit::WebBindings::makeIntArray): Added.
            * src/WebFrameImpl.cpp:
            (WebKit::WebFrameImpl::firstRectForCharacterRange): Added.
            * src/WebFrameImpl.h:
    2010-09-24  Ryosuke Niwa  <rniwa at webkit.org>
    
            Reviewed by Tony Chang.
    
            [chromium] Implement TextInputController::firstRectForCharacterRange
            https://bugs.webkit.org/show_bug.cgi?id=38100
    
            Implemented TextInputController::firstRectForCharacterRange for chromium platform.
            No new tests are added since we need to implement the same feature in chromium side
            in order to enable any tests that uses this function.
    
            * DumpRenderTree/chromium/TextInputController.cpp:
            (TextInputController::firstRectForCharacterRange): Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68312 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 95d33e7..89d495a 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-09-24  Ryosuke Niwa  <rniwa at webkit.org>
+
+        Reviewed by Tony Chang.
+
+        [chromium] Implement TextInputController::firstRectForCharacterRange
+        https://bugs.webkit.org/show_bug.cgi?id=38100
+
+        The following test now passes on chromium DumpRenderTree:
+        platform/mac/editing/input/caret-primary-bidi.html
+        platform/mac/editing/input/firstrectforcharacterrange-plain.html
+        platform/mac/editing/input/range-for-empty-document.html
+        editing/inserting/caret-position.html
+
+        * platform/chromium/test_expectations.txt:
+
 2010-09-24  Tony Chang  <tony at chromium.org>
 
         Reviewed by Dimitri Glazkov.
diff --git a/LayoutTests/platform/chromium/test_expectations.txt b/LayoutTests/platform/chromium/test_expectations.txt
index a974198..7d05923 100644
--- a/LayoutTests/platform/chromium/test_expectations.txt
+++ b/LayoutTests/platform/chromium/test_expectations.txt
@@ -964,9 +964,11 @@ BUG10318 WIN LINUX : fast/canvas/toDataURL-supportedTypes.html = FAIL
 
 // Issue 3273: TextInputController::firstRectForCharacterRange not implemented.
 BUG3273 : editing/selection/move-left-right.html = FAIL
-BUG3273 MAC : platform/mac/editing/input/caret-primary-bidi.html = FAIL
-BUG3273 MAC : platform/mac/editing/input/firstrectforcharacterrange-plain.html = FAIL
-BUG3273 MAC : platform/mac/editing/input/range-for-empty-document.html = FAIL
+BUG3273 MAC : platform/mac/editing/input/caret-primary-bidi.html = FAIL PASS
+BUG3273 MAC : platform/mac/editing/input/firstrectforcharacterrange-plain.html = FAIL PASS
+BUG3273 MAC : platform/mac/editing/input/range-for-empty-document.html = FAIL PASS
+BUGWK38100 : editing/inserting/caret-position.html = TEXT PASS
+
 // WebKit 50358:50395
 BUG3273 : fast/text/international/thai-cursor-position.html = TEXT
 // WebKit roll 51512:51524
@@ -2455,9 +2457,6 @@ BUG8729 MAC : http/tests/multipart/invalid-image-data.html = IMAGE
 // Started failing at r58152
 BUGWK38038 WIN LINUX MAC : fast/url/file-http-base.html = TEXT
 
-// Started failing at r58191
-BUGWK38100 WIN LINUX MAC : editing/inserting/caret-position.html = TEXT
-
 // New test, may be safe to just rebaseline.
 
 // Started failing at 58212
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 416ca31..564eac1 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,27 @@
+2010-09-24  Ryosuke Niwa  <rniwa at webkit.org>
+
+        Reviewed by Tony Chang.
+
+        [chromium] Implement TextInputController::firstRectForCharacterRange
+        https://bugs.webkit.org/show_bug.cgi?id=38100
+
+        Implemented TextInputController::firstRectForCharacterRange for chromium platform.
+        Because the function needs to return an array of integers, added makeIntArray to WebBindings.
+        makeIntArray does not take Vector because WebBindings.h is included in plugin glue code
+        where it cannot find wtf/Vector.h.
+
+        No new tests are added since we need to implement the same feature in chromium side
+        in order to enable any tests that uses this function.
+
+        * public/WebBindings.h:
+        * public/WebFrame.h:
+        * src/WebBindings.cpp:
+        (WebKit::makeIntArrayImpl): Added.
+        (WebKit::WebBindings::makeIntArray): Added.
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::firstRectForCharacterRange): Added.
+        * src/WebFrameImpl.h:
+
 2010-09-24  Tony Chang  <tony at chromium.org>
 
         Unreviewed, fix chromium compile after r68276 which renamed
diff --git a/WebKit/chromium/public/WebBindings.h b/WebKit/chromium/public/WebBindings.h
index bca4095..147ce45 100644
--- a/WebKit/chromium/public/WebBindings.h
+++ b/WebKit/chromium/public/WebBindings.h
@@ -32,6 +32,7 @@
 #define WebBindings_h
 
 #include "WebCommon.h"
+#include "WebVector.h"
 #include <bindings/npruntime.h>
 
 namespace WebKit {
@@ -144,6 +145,8 @@ public:
     // If so, return that element as a WebElement object.
     WEBKIT_API static bool getElement(NPObject* element, WebElement*);
 
+    WEBKIT_API static NPObject* makeIntArray(const WebVector<int>&);
+
     // Exceptions -------------------------------------------------------------
 
     typedef void (ExceptionHandler)(void* data, const NPUTF8* message);
diff --git a/WebKit/chromium/public/WebFrame.h b/WebKit/chromium/public/WebFrame.h
index 8a4b4ec..5d41d10 100644
--- a/WebKit/chromium/public/WebFrame.h
+++ b/WebKit/chromium/public/WebFrame.h
@@ -355,6 +355,8 @@ public:
 
     virtual WebRange markedRange() const = 0;
 
+    virtual bool firstRectForCharacterRange(unsigned location, unsigned length, WebRect&) const = 0;
+
     // Supports commands like Undo, Redo, Cut, Copy, Paste, SelectAll,
     // Unselect, etc. See EditorCommand.cpp for the full list of supported
     // commands.
diff --git a/WebKit/chromium/src/WebBindings.cpp b/WebKit/chromium/src/WebBindings.cpp
index 4bb9022..c25c31b 100644
--- a/WebKit/chromium/src/WebBindings.cpp
+++ b/WebKit/chromium/src/WebBindings.cpp
@@ -312,6 +312,17 @@ static bool getElementImpl(NPObject* npObj, WebElement* webElement)
     return true;
 }
 
+static NPObject* makeIntArrayImpl(const WebVector<int>& data)
+{
+    v8::HandleScope handleScope;
+    v8::Handle<v8::Array> result = v8::Array::New(data.size());
+    for (size_t i = 0; i < data.size(); i++)
+        result->Set(i, v8::Number::New(data[i]));
+
+    WebCore::DOMWindow* window = WebCore::V8Proxy::retrieveWindow(WebCore::V8Proxy::currentContext());
+    return npCreateV8ScriptObject(0, result, window);
+}
+
 #endif
 
 bool WebBindings::getDragData(NPObject* event, int* eventId, WebDragData* data)
@@ -350,6 +361,16 @@ bool WebBindings::getElement(NPObject* element, WebElement* webElement)
 #endif
 }
 
+NPObject* WebBindings::makeIntArray(const WebVector<int> & data)
+{
+#if USE(V8)
+    return makeIntArrayImpl(data);
+#else
+    // Not supported on other ports (JSC, etc.).
+    return 0;
+#endif
+}
+
 void WebBindings::pushExceptionHandler(ExceptionHandler handler, void* data)
 {
     WebCore::pushExceptionHandler(handler, data);
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp
index d8f559e..1b64e5a 100644
--- a/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/WebKit/chromium/src/WebFrameImpl.cpp
@@ -1082,6 +1082,22 @@ WebRange WebFrameImpl::markedRange() const
     return frame()->editor()->compositionRange();
 }
 
+bool WebFrameImpl::firstRectForCharacterRange(unsigned location, unsigned length, WebRect& rect) const
+{
+    if ((location + length < location) && (location + length))
+        length = 0;
+
+    Element* selectionRoot = frame()->selection()->rootEditableElement();
+    Element* scope = selectionRoot ? selectionRoot : frame()->document()->documentElement();
+    RefPtr<Range> range = TextIterator::rangeFromLocationAndLength(scope, location, length);
+    if (!range)
+        return false;
+    IntRect intRect = frame()->editor()->firstRectForRange(range.get());
+    rect = WebRect(intRect.x(), intRect.y(), intRect.width(), intRect.height());
+
+    return true;
+}
+
 bool WebFrameImpl::executeCommand(const WebString& name)
 {
     ASSERT(frame());
diff --git a/WebKit/chromium/src/WebFrameImpl.h b/WebKit/chromium/src/WebFrameImpl.h
index f4932c2..d93254b 100644
--- a/WebKit/chromium/src/WebFrameImpl.h
+++ b/WebKit/chromium/src/WebFrameImpl.h
@@ -137,6 +137,7 @@ public:
     virtual void unmarkText();
     virtual bool hasMarkedText() const;
     virtual WebRange markedRange() const;
+    virtual bool firstRectForCharacterRange(unsigned location, unsigned length, WebRect&) const;
     virtual bool executeCommand(const WebString&);
     virtual bool executeCommand(const WebString&, const WebString& value);
     virtual bool isCommandEnabled(const WebString&) const;
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index bcda7e4..cc49a77 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,17 @@
+2010-09-24  Ryosuke Niwa  <rniwa at webkit.org>
+
+        Reviewed by Tony Chang.
+
+        [chromium] Implement TextInputController::firstRectForCharacterRange
+        https://bugs.webkit.org/show_bug.cgi?id=38100
+
+        Implemented TextInputController::firstRectForCharacterRange for chromium platform.
+        No new tests are added since we need to implement the same feature in chromium side
+        in order to enable any tests that uses this function.
+
+        * DumpRenderTree/chromium/TextInputController.cpp:
+        (TextInputController::firstRectForCharacterRange): Added.
+
 2010-09-24  Adam Barth  <abarth at webkit.org>
 
         Reviewed by Eric Seidel.
diff --git a/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp b/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
index 16f1575..4f06874 100644
--- a/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
@@ -32,6 +32,7 @@
 #include "TextInputController.h"
 
 #include "TestShell.h"
+#include "public/WebBindings.h"
 #include "public/WebFrame.h"
 #include "public/WebRange.h"
 #include "public/WebString.h"
@@ -186,10 +187,27 @@ void TextInputController::selectedRange(const CppArgumentList&, CppVariant* resu
     result->set(string(buffer));
 }
 
-void TextInputController::firstRectForCharacterRange(const CppArgumentList&, CppVariant* result)
+void TextInputController::firstRectForCharacterRange(const CppArgumentList& arguments, CppVariant* result)
 {
-    // FIXME: Implement this.
     result->setNull();
+
+    WebFrame* mainFrame = getMainFrame();
+    if (!mainFrame)
+        return;
+
+    if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber())
+        return;
+
+    WebRect rect;
+    if (!mainFrame->firstRectForCharacterRange(arguments[0].toInt32(), arguments[1].toInt32(), rect))
+        return;
+
+    Vector<int> intArray(4);
+    intArray[0] = rect.x;
+    intArray[1] = rect.y;
+    intArray[2] = rect.width;
+    intArray[3] = rect.height;
+    result->set(WebBindings::makeIntArray(intArray));
 }
 
 void TextInputController::characterIndexForPoint(const CppArgumentList&, CppVariant* result)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list