WebKit2 lacks API for obtaining a representation of the RenderLayer tree of a page...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 11 Mar 2012 19:50:14 +0000 (19:50 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 11 Mar 2012 19:50:14 +0000 (19:50 +0000)
commit848071ebe40fbe2570faf32b8272922cc9e37221
tree426d6dff107205dfdbc2768fb95b383cec2915f5
parente30ae514441c750cac48bc548847cfb21c494f25
WebKit2 lacks API for obtaining a representation of the RenderLayer tree of a page, like WebRenderLayer
<http://webkit.org/b/80791>

Reviewed by Anders Carlsson.

* CMakeLists.txt:
* GNUmakefile.am:

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

* Shared/API/c/WKRenderLayer.cpp: Added.
(WKRenderLayerGetTypeID): Added. Returns the WKRenderLayer type ID.
(WKRenderLayerCopyRendererName): Added this getter wrapper.
(WKRenderLayerCopyElementTagName): Ditto.
(WKRenderLayerCopyElementID): Ditto.
(WKRenderLayerGetElementClassNames): Ditto.
(WKRenderLayerGetAbsoluteBounds): Ditto.
(WKRenderLayerIsClipping): Ditto.
(WKRenderLayerIsClipped): Ditto.
(WKRenderLayerIsReflection): Ditto.
(WKRenderLayerGetCompositingLayerType): Ditto.
(WKRenderLayerGetNegativeZOrderList): Ditto.
(WKRenderLayerGetNormalFlowList): Ditto.
(WKRenderLayerGetPositiveZOrderList): Ditto.

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

* Shared/APIObject.h: Added TypeRenderLayer to the APIObject::Type enum.

* Shared/UserMessageCoders.h:
(WebKit::UserMessageEncoder::baseEncode): Added WebRenderLayer encoding.
(WebKit::UserMessageDecoder::baseDecode): Added WebRenderLayer decoding.

* Shared/WebRenderLayer.cpp: Added.
(WebKit::WebRenderLayer::create): Added. Creates a WebRenderLayer for the page’s main
frame’s root layer.
(WebKit::WebRenderLayer::createArrayFromLayerList): Added this helper function.
(WebKit::WebRenderLayer::WebRenderLayer): Added. Constructs a WebRenderLayer with the
renderer name, element tag, ID and class names, metrics, child lists, and compositing
layer properties of the given RenderLayer.

* Shared/WebRenderLayer.h: Added.
(WebKit::WebRenderLayer::create):
(WebKit::WebRenderLayer::negativeZOrderList):
(WebKit::WebRenderLayer::normalFlowList):
(WebKit::WebRenderLayer::positiveZOrderList):
(WebKit::WebRenderLayer::renderObjectName):
(WebKit::WebRenderLayer::elementTagName):
(WebKit::WebRenderLayer::elementID):
(WebKit::WebRenderLayer::elementClassNames):
(WebKit::WebRenderLayer::isReflection):
(WebKit::WebRenderLayer::isClipping):
(WebKit::WebRenderLayer::isClipped):
(WebKit::WebRenderLayer::compositingLayerType):
(WebKit::WebRenderLayer::absoluteBoundingBox):
(WebKit::WebRenderLayer::WebRenderLayer):

* Target.pri

* UIProcess/API/C/WKAPICast.h: Added a mapping between WKRenderLayerRef and WebRenderLayer.

* WebKit2.xcodeproj/project.pbxproj: Added WebRenderLayer.{cpp,h} and WKRenderLayer.{cpp,h}.

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

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

* win/WebKit2.vcproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110397 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/WKRenderLayer.cpp [new file with mode: 0644]
Source/WebKit2/Shared/API/c/WKRenderLayer.h [new file with mode: 0644]
Source/WebKit2/Shared/APIObject.h
Source/WebKit2/Shared/UserMessageCoders.h
Source/WebKit2/Shared/WebRenderLayer.cpp [new file with mode: 0644]
Source/WebKit2/Shared/WebRenderLayer.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