WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
innerText.diff (text/plain), 6.54 KB, created by
Sam Weinig
on 2010-07-31 15:28:12 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Sam Weinig
Created:
2010-07-31 15:28:12 PDT
Size:
6.54 KB
patch
obsolete
>Index: WebKit2/ChangeLog >=================================================================== >--- WebKit2/ChangeLog (revision 64424) >+++ WebKit2/ChangeLog (working copy) >@@ -1,3 +1,17 @@ >+2010-07-31 Sam Weinig <sam@webkit.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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-31 Sheriff Bot <webkit.review.bot@gmail.com> > > Unreviewed, rolling out r64422. >Index: WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp >=================================================================== >--- WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp (revision 64400) >+++ WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp (working copy) >@@ -88,3 +88,8 @@ WKStringRef WKBundleFrameCopyMarkerText( > { > return toCopiedRef(toWK(frameRef)->markerText(element)); > } >+ >+WKStringRef WKBundleFrameCopyInnerText(WKBundleFrameRef frameRef) >+{ >+ return toCopiedRef(toWK(frameRef)->innerText()); >+} >Index: WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h >=================================================================== >--- WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h (revision 64400) >+++ WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h (working copy) >@@ -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); >Index: WebKit2/WebProcess/WebPage/WebFrame.cpp >=================================================================== >--- WebKit2/WebProcess/WebPage/WebFrame.cpp (revision 64400) >+++ WebKit2/WebProcess/WebPage/WebFrame.cpp (working copy) >@@ -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) >Index: WebKit2/WebProcess/WebPage/WebFrame.h >=================================================================== >--- WebKit2/WebProcess/WebPage/WebFrame.h (revision 64400) >+++ WebKit2/WebProcess/WebPage/WebFrame.h (working copy) >@@ -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(); >Index: WebKitTools/ChangeLog >=================================================================== >--- WebKitTools/ChangeLog (revision 64425) >+++ WebKitTools/ChangeLog (working copy) >@@ -1,3 +1,13 @@ >+2010-07-31 Sam Weinig <sam@webkit.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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@webkit.org> > > Reviewed by Maciej Stachowiak. >Index: WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp >=================================================================== >--- WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (revision 64400) >+++ WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (working copy) >@@ -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, > 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(JSContex > 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::dumpAllFrameScr > > 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)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
mitz:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 43305
: 63159