<rdar://problem/8494396> WebKit2 lacks API for obtaining a representation of the...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Mar 2012 20:23:37 +0000 (20:23 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Mar 2012 20:23:37 +0000 (20:23 +0000)
commitdcc56c6a1bf57819da914770bacfdcc8744b7042
tree64928da5d4f5808bbaf7bf0e018f8ab3190666e5
parent42554e907bcdf7870f96531788b8b15532ba6662
<rdar://problem/8494396> WebKit2 lacks API for obtaining a representation of the render tree of a page, like WebRenderNode
https://bugs.webkit.org/show_bug.cgi?id=80230

Reviewed by Beth Dakin.

* CMakeLists.txt:
* GNUmakefile.am:

* Shared/API/c/WKBase.h: Added a type definition of WKRenderObjectRef.

* Shared/API/c/WKRenderObject.cpp: Added.
(WKRenderObjectGetTypeID): Added. Returns the WKRenderObject type ID.
(WKRenderObjectCopyName): Added this getter wrapper.
(WKRenderObjectGetAbsolutePosition): Ditto.
(WKRenderObjectGetFrameRect): Ditto.
(WKRenderObjectGetChildren): Ditto.

* Shared/API/c/WKRenderObject.h: Added.

* Shared/APIObject.h: Added TypeRenderObject to the APIObject::Type enum.
* Shared/UserMessageCoders.h:
(WebKit::UserMessageEncoder::baseEncode): Added WebRenderObject encoding.
(WebKit::UserMessageDecoder::baseDecode): Added WebRenderObject decoding.
* Shared/WebRenderObject.cpp: Added.
(WebKit::WebRenderObject::create): Added. Creates a WebRenderObject for the page’s main
frame content renderer.
(WebKit::WebRenderObject::WebRenderObject): Added. Constructs a WebRenderObject with the
name, metrics and children of the given RenderObject, following the rules used in WebKit1
WebRenderNode. In particular, a RenderWidget representing a frame gets the frame’s content
renderer as a child.

* Shared/WebRenderObject.h: Added.
(WebKit::WebRenderObject::create):
(WebKit::WebRenderObject::children):
(WebKit::WebRenderObject::name):
(WebKit::WebRenderObject::absolutePosition):
(WebKit::WebRenderObject::frameRect):
(WebKit::WebRenderObject::WebRenderObject):

* Target.pri:

* UIProcess/API/C/WKAPICast.h: Added a mapping between WKRenderObjectRef and WebRenderObject.

* WebKit2.xcodeproj/project.pbxproj: Added WebRenderObject.{cpp,h} and WKRenderObject.{cpp.h}.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageCopyRenderTree): Added this bundle API for getting the render tree.

* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:

* win/WebKit2.vcproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110085 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/GNUmakefile.am
Source/WebKit2/Shared/API/c/WKBase.h
Source/WebKit2/Shared/API/c/WKRenderObject.cpp [new file with mode: 0644]
Source/WebKit2/Shared/API/c/WKRenderObject.h [new file with mode: 0644]
Source/WebKit2/Shared/APIObject.h
Source/WebKit2/Shared/UserMessageCoders.h
Source/WebKit2/Shared/WebRenderObject.cpp [new file with mode: 0644]
Source/WebKit2/Shared/WebRenderObject.h [new file with mode: 0644]
Source/WebKit2/Target.pri
Source/WebKit2/UIProcess/API/C/WKAPICast.h
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h
Source/WebKit2/win/WebKit2.vcproj