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

weinig at apple.com weinig at apple.com
Wed Dec 22 11:37:44 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 03e699201e2df316786b7e28a76a70163756346f
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Jul 31 22:37:35 2010 +0000

    Patch for https://bugs.webkit.org/show_bug.cgi?id=43305
    Add back WKBundleFrameCopyInnerText to fix ~50 test failures
    due to SVGElements not having the innerText function.
    
    Reviewed by Dan Bernstein.
    
    WebKit2:
    
    * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
    (WKBundleFrameCopyInnerText):
    * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
    * WebProcess/WebPage/WebFrame.cpp:
    (WebKit::WebFrame::innerText):
    * WebProcess/WebPage/WebFrame.h:
    
    WebKitTools:
    
    * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
    (WTR::dumpFrameText):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64426 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 2e02226..f086d4d 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,18 @@
+2010-07-31  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Dan Bernstein.
+
+        Patch for https://bugs.webkit.org/show_bug.cgi?id=43305
+        Add back WKBundleFrameCopyInnerText to fix ~50 test failures
+        due to SVGElements not having the innerText function.
+
+        * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
+        (WKBundleFrameCopyInnerText):
+        * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
+        * WebProcess/WebPage/WebFrame.cpp:
+        (WebKit::WebFrame::innerText):
+        * WebProcess/WebPage/WebFrame.h:
+
 2010-07-27  Luiz Agostini  <luiz.agostini at openbossa.org>
 
         Reviewed by Darin Fisher.
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
index 5da8bae..707a249 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
@@ -88,3 +88,8 @@ WKStringRef WKBundleFrameCopyMarkerText(WKBundleFrameRef frameRef, JSObjectRef e
 {
     return toCopiedRef(toWK(frameRef)->markerText(element));
 }
+
+WKStringRef WKBundleFrameCopyInnerText(WKBundleFrameRef frameRef)
+{
+    return toCopiedRef(toWK(frameRef)->innerText());
+}
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h
index 3a6ed44..055e7cd 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h
@@ -38,6 +38,7 @@
 extern "C" {
 #endif
 
+WK_EXPORT WKStringRef WKBundleFrameCopyInnerText(WKBundleFrameRef frame);
 WK_EXPORT WKStringRef WKBundleFrameCopyCounterValue(WKBundleFrameRef frame, JSObjectRef element);
 WK_EXPORT WKStringRef WKBundleFrameCopyMarkerText(WKBundleFrameRef frame, JSObjectRef element);
 WK_EXPORT JSValueRef WKBundleFrameGetComputedStyleIncludingVisitedInfo(WKBundleFrameRef frame, JSObjectRef element);
diff --git a/WebKit2/WebProcess/WebPage/WebFrame.cpp b/WebKit2/WebProcess/WebPage/WebFrame.cpp
index 7d82a19..6b3b221 100644
--- a/WebKit2/WebProcess/WebPage/WebFrame.cpp
+++ b/WebKit2/WebProcess/WebPage/WebFrame.cpp
@@ -185,6 +185,14 @@ String WebFrame::url() const
     return m_coreFrame->loader()->url().string();
 }
 
+String WebFrame::innerText() const
+{
+    if (!m_coreFrame)
+        return String();
+
+    return m_coreFrame->document()->documentElement()->innerText();
+}
+
 PassRefPtr<ImmutableArray> WebFrame::childFrames()
 {
     if (!m_coreFrame)
diff --git a/WebKit2/WebProcess/WebPage/WebFrame.h b/WebKit2/WebProcess/WebPage/WebFrame.h
index 419bd73..6a018ee 100644
--- a/WebKit2/WebProcess/WebPage/WebFrame.h
+++ b/WebKit2/WebProcess/WebPage/WebFrame.h
@@ -70,6 +70,7 @@ public:
     bool isMainFrame() const;
     WebCore::String name() const;
     WebCore::String url() const;
+    WebCore::String innerText() const;
     PassRefPtr<ImmutableArray> childFrames();
     JSValueRef computedStyleIncludingVisitedInfo(JSObjectRef element);
     JSGlobalContextRef jsContext();
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 48773fd..47f9d9e 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,14 @@
+2010-07-31  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Dan Bernstein.
+
+        Patch for https://bugs.webkit.org/show_bug.cgi?id=43305
+        Add back WKBundleFrameCopyInnerText to fix ~50 test failures
+        due to SVGElements not having the innerText function.
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::dumpFrameText):
+
 2010-07-30  Sam Weinig  <sam at webkit.org>
 
         Reviewed by Maciej Stachowiak.
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index ca01c14..f5570f6 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -29,6 +29,7 @@
 #include <JavaScriptCore/JSRetainPtr.h>
 #include <WebKit2/WKArray.h>
 #include <WebKit2/WKBundleFrame.h>
+#include <WebKit2/WKBundleFramePrivate.h>
 #include <WebKit2/WKBundleNode.h>
 #include <WebKit2/WKBundlePagePrivate.h>
 #include <WebKit2/WKRetainPtr.h>
@@ -72,21 +73,6 @@ static ostream& operator<<(ostream& out, const WKRetainPtr<WKStringRef>& stringR
     return out << stringRef.get();
 }
 
-static ostream& operator<<(ostream& out, JSStringRef stringRef)
-{
-    if (!stringRef)
-        return out;
-    CFIndex bufferLength = JSStringGetMaximumUTF8CStringSize(stringRef) + 1;
-    Vector<char> buffer(bufferLength);
-    JSStringGetUTF8CString(stringRef, buffer.data(), bufferLength);
-    return out << buffer.data();
-}
-
-static ostream& operator<<(ostream& out, const JSRetainPtr<JSStringRef>& stringRef)
-{
-    return out << stringRef.get();
-}
-
 static string dumpPath(WKBundleNodeRef node)
 {
     if (!node)
@@ -238,23 +224,6 @@ static JSValueRef propertyValue(JSContextRef context, JSObjectRef object, const
     return JSObjectGetProperty(context, object, propertyNameString.get(), &exception);
 }
 
-static JSObjectRef propertyObject(JSContextRef context, JSObjectRef object, const char* propertyName)
-{
-    JSValueRef value = propertyValue(context, object, propertyName);
-    if (!value || !JSValueIsObject(context, value))
-        return 0;
-    return const_cast<JSObjectRef>(value);
-}
-
-static JSRetainPtr<JSStringRef> propertyString(JSContextRef context, JSObjectRef object, const char* propertyName)
-{
-    JSValueRef value = propertyValue(context, object, propertyName);
-    if (!value)
-        return 0;
-    JSValueRef exception;
-    return JSRetainPtr<JSStringRef>(Adopt, JSValueToStringCopy(context, value, &exception));
-}
-
 static double numericWindowPropertyValue(WKBundleFrameRef frame, const char* propertyName)
 {
     JSGlobalContextRef context = WKBundleFrameGetJavaScriptContext(frame);
@@ -300,10 +269,8 @@ void InjectedBundlePage::dumpAllFrameScrollPositions()
 
 static void dumpFrameText(WKBundleFrameRef frame)
 {
-    JSGlobalContextRef context = WKBundleFrameGetJavaScriptContext(frame);
-    JSObjectRef document = propertyObject(context, JSContextGetGlobalObject(context), "document");
-    JSObjectRef documentElement = propertyObject(context, document, "documentElement");
-    InjectedBundle::shared().os() << propertyString(context, documentElement, "innerText") << "\n";
+    WKRetainPtr<WKStringRef> text(AdoptWK, WKBundleFrameCopyInnerText(frame));
+    InjectedBundle::shared().os() << text << "\n";
 }
 
 static void dumpDescendantFramesText(WKBundleFrameRef frame)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list