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)
<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

index 095c6ab160b8e4e397856b9018e83faddf018c9d..e53b958a2cc76ee6fa83cb1f27f6749520f22b7c 100644 (file)
@@ -155,6 +155,7 @@ SET(WebKit2_SOURCES
     Shared/WebPopupItem.cpp
     Shared/WebPreferencesStore.cpp
     Shared/WebProcessCreationParameters.cpp
+    Shared/WebRenderLayer.cpp
     Shared/WebRenderObject.cpp
     Shared/WebTouchEvent.cpp
     Shared/WebURLRequest.cpp
@@ -174,6 +175,7 @@ SET(WebKit2_SOURCES
     Shared/API/c/WKMutableArray.cpp
     Shared/API/c/WKMutableDictionary.cpp
     Shared/API/c/WKNumber.cpp
+    Shared/API/c/WKRenderLayer.cpp
     Shared/API/c/WKRenderObject.cpp
     Shared/API/c/WKSecurityOrigin.cpp
     Shared/API/c/WKSerializedScriptValue.cpp
index 17ff991a6a36fcfcd2b201ea1d60b8cf19f2acb2..6a0259f53e3a81573168a5562790749f27c6f026 100644 (file)
@@ -1,3 +1,75 @@
+2012-03-11  Dan Bernstein  <mitz@apple.com>
+
+        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:
+
 2012-03-11  Joseph Pecoraro  <pecoraro@apple.com>
 
         <http://webkit.org/b/80782> Web Inspector: Crash using released frontendClient when resizing window with closed inspector
index 9800ff56ab1961c69f7ec09c69304542cc6f40e7..a601aef75767a2e24a0f460fac5c0404e9523100 100644 (file)
@@ -19,6 +19,7 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_HEA
        $(WebKit2)/Shared/API/c/WKMutableDictionary.h \
        $(WebKit2)/Shared/API/c/WKNumber.h \
        $(WebKit2)/Shared/API/c/WKPageLoadTypes.h \
+       $(WebKit2)/Shared/API/c/WKRenderLayer.h \
        $(WebKit2)/Shared/API/c/WKRenderObject.h \
        $(WebKit2)/Shared/API/c/WKSecurityOrigin.h \
        $(WebKit2)/Shared/API/c/WKSerializedScriptValue.h \
@@ -289,6 +290,8 @@ webkit2_sources += \
        Source/WebKit2/Shared/API/c/WKNumber.cpp \
        Source/WebKit2/Shared/API/c/WKNumber.h \
        Source/WebKit2/Shared/API/c/WKPageLoadTypes.h \
+       Source/WebKit2/Shared/API/c/WKRenderLayer.cpp \
+       Source/WebKit2/Shared/API/c/WKRenderLayer.h \
        Source/WebKit2/Shared/API/c/WKRenderObject.cpp \
        Source/WebKit2/Shared/API/c/WKRenderObject.h \
        Source/WebKit2/Shared/API/c/WKSecurityOrigin.cpp \
@@ -438,6 +441,8 @@ webkit2_sources += \
        Source/WebKit2/Shared/WebPreferencesStore.h \
        Source/WebKit2/Shared/WebProcessCreationParameters.cpp \
        Source/WebKit2/Shared/WebProcessCreationParameters.h \
+       Source/WebKit2/Shared/WebRenderLayer.cpp \
+       Source/WebKit2/Shared/WebRenderLayer.h \
        Source/WebKit2/Shared/WebRenderObject.cpp \
        Source/WebKit2/Shared/WebRenderObject.h \
        Source/WebKit2/Shared/WebSecurityOrigin.h \
index 5200beabd35a54c055de8e4132f3f414f7a4b93f..c8656e4a3f7734c6619a7834c05833a90f0ba18d 100644 (file)
@@ -59,6 +59,7 @@ typedef const struct OpaqueWKGraphicsContext* WKGraphicsContextRef;
 typedef const struct OpaqueWKImage* WKImageRef;
 typedef const struct OpaqueWKPointRef* WKPointRef;
 typedef const struct OpaqueWKRectRef* WKRectRef;
+typedef const struct OpaqueWKRenderLayer* WKRenderLayerRef;
 typedef const struct OpaqueWKRenderObject* WKRenderObjectRef;
 typedef const struct OpaqueWKSecurityOrigin* WKSecurityOriginRef;
 typedef const struct OpaqueWKSerializedScriptValue* WKSerializedScriptValueRef;
diff --git a/Source/WebKit2/Shared/API/c/WKRenderLayer.cpp b/Source/WebKit2/Shared/API/c/WKRenderLayer.cpp
new file mode 100644 (file)
index 0000000..7c27651
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKRenderLayer.h"
+
+#include "WKAPICast.h"
+#include "WebRenderLayer.h"
+
+using namespace WebCore;
+using namespace WebKit;
+
+WKTypeID WKRenderLayerGetTypeID()
+{
+    return toAPI(WebRenderLayer::APIType);
+}
+
+WKStringRef WKRenderLayerCopyRendererName(WKRenderLayerRef renderLayerRef)
+{
+    return toCopiedAPI(toImpl(renderLayerRef)->renderObjectName());
+}
+
+WKStringRef WKRenderLayerCopyElementTagName(WKRenderLayerRef renderLayerRef)
+{
+    WebRenderLayer* renderLayer = toImpl(renderLayerRef);
+    if (!renderLayer->elementTagName().isNull())
+        return toCopiedAPI(toImpl(renderLayerRef)->elementTagName());
+
+    return 0;
+}
+
+WKStringRef WKRenderLayerCopyElementID(WKRenderLayerRef renderLayerRef)
+{
+    WebRenderLayer* renderLayer = toImpl(renderLayerRef);
+    if (!renderLayer->elementID().isNull())
+        return toCopiedAPI(toImpl(renderLayerRef)->elementID());
+
+    return 0;
+}
+
+WKArrayRef WKRenderLayerGetElementClassNames(WKRenderLayerRef renderLayerRef)
+{
+    return toAPI(toImpl(renderLayerRef)->elementClassNames());
+}
+
+WKRect WKRenderLayerGetAbsoluteBounds(WKRenderLayerRef renderLayerRef)
+{
+    IntRect bounds = toImpl(renderLayerRef)->absoluteBoundingBox();
+    return WKRectMake(bounds.x(), bounds.y(), bounds.width(), bounds.height());
+}
+
+bool WKRenderLayerIsClipping(WKRenderLayerRef renderLayerRef)
+{
+    return toImpl(renderLayerRef)->isClipping();
+}
+
+bool WKRenderLayerIsClipped(WKRenderLayerRef renderLayerRef)
+{
+    return toImpl(renderLayerRef)->isClipped();
+}
+
+bool WKRenderLayerIsReflection(WKRenderLayerRef renderLayerRef)
+{
+    return toImpl(renderLayerRef)->isReflection();
+}
+
+WKCompositingLayerType WKRenderLayerGetCompositingLayerType(WKRenderLayerRef renderLayerRef)
+{
+    switch (toImpl(renderLayerRef)->compositingLayerType()) {
+    case WebRenderLayer::None:
+        return kWKCompositingLayerTypeNone;
+    case WebRenderLayer::Normal:
+        return kWKCompositingLayerTypeNormal;
+    case WebRenderLayer::Tiled:
+        return kWKCompositingLayerTypeTiled;
+    case WebRenderLayer::Media:
+        return kWKCompositingLayerTypeMedia;
+    case WebRenderLayer::Container:
+        return kWKCompositingLayerTypeContainer;
+    }
+
+    ASSERT_NOT_REACHED();
+    return kWKCompositingLayerTypeNone;
+}
+
+WKArrayRef WKRenderLayerGetNegativeZOrderList(WKRenderLayerRef renderLayerRef)
+{
+    return toAPI(toImpl(renderLayerRef)->negativeZOrderList());
+}
+
+WKArrayRef WKRenderLayerGetNormalFlowList(WKRenderLayerRef renderLayerRef)
+{
+    return toAPI(toImpl(renderLayerRef)->normalFlowList());
+}
+
+WKArrayRef WKRenderLayerGetPositiveZOrderList(WKRenderLayerRef renderLayerRef)
+{
+    return toAPI(toImpl(renderLayerRef)->positiveZOrderList());
+}
diff --git a/Source/WebKit2/Shared/API/c/WKRenderLayer.h b/Source/WebKit2/Shared/API/c/WKRenderLayer.h
new file mode 100644 (file)
index 0000000..6683d87
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKRenderLayer_h
+#define WKRenderLayer_h
+
+
+#include <WebKit2/WKBase.h>
+#include <WebKit2/WKGeometry.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKRenderLayerGetTypeID();
+
+WK_EXPORT WKStringRef WKRenderLayerCopyRendererName(WKRenderLayerRef renderLayer);
+
+WK_EXPORT WKStringRef WKRenderLayerCopyElementTagName(WKRenderLayerRef renderLayer);
+WK_EXPORT WKStringRef WKRenderLayerCopyElementID(WKRenderLayerRef renderLayer);
+WK_EXPORT WKArrayRef WKRenderLayerGetElementClassNames(WKRenderLayerRef renderLayer);
+
+WK_EXPORT WKRect WKRenderLayerGetAbsoluteBounds(WKRenderLayerRef renderLayer);
+
+WK_EXPORT bool WKRenderLayerIsClipping(WKRenderLayerRef renderLayer);
+WK_EXPORT bool WKRenderLayerIsClipped(WKRenderLayerRef renderLayer);
+WK_EXPORT bool WKRenderLayerIsReflection(WKRenderLayerRef renderLayer);
+
+enum WKCompositingLayerType {
+    kWKCompositingLayerTypeNone,
+    kWKCompositingLayerTypeNormal,
+    kWKCompositingLayerTypeTiled,
+    kWKCompositingLayerTypeMedia,
+    kWKCompositingLayerTypeContainer
+};
+typedef enum WKCompositingLayerType WKCompositingLayerType;
+
+WK_EXPORT WKCompositingLayerType WKRenderLayerGetCompositingLayerType(WKRenderLayerRef renderLayer);
+
+WK_EXPORT WKArrayRef WKRenderLayerGetNegativeZOrderList(WKRenderLayerRef renderLayer);
+WK_EXPORT WKArrayRef WKRenderLayerGetNormalFlowList(WKRenderLayerRef renderLayer);
+WK_EXPORT WKArrayRef WKRenderLayerGetPositiveZOrderList(WKRenderLayerRef renderLayer);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // WKRenderLayer_h
index 48d1d82fb96f64e8542ce0174dd662dd2bcba5ca..d6cc03043df3b2a7fcef6f4a4db2dc969b726620 100644 (file)
@@ -48,6 +48,7 @@ public:
         TypeGraphicsContext,
         TypeImage,
         TypeProtectionSpace,
+        TypeRenderLayer,
         TypeRenderObject,
         TypeSecurityOrigin,
         TypeSerializedScriptValue,
index 47bce57f3dbde90654ba28b538b0e5f202a3f488..9672f28df37aab911fdc281be2c6820005c2abf1 100644 (file)
@@ -38,6 +38,7 @@
 #include "WebGeometry.h"
 #include "WebImage.h"
 #include "WebNumber.h"
+#include "WebRenderLayer.h"
 #include "WebRenderObject.h"
 #include "WebSerializedScriptValue.h"
 #include "WebString.h"
@@ -57,6 +58,7 @@ namespace WebKit {
 //   - WebData -> WebData
 //   - WebDouble -> WebDouble
 //   - WebImage -> WebImage
+//   - WebRenderLayer -> WebRenderLayer
 //   - WebRenderObject -> WebRenderObject
 //   - WebUInt64 -> WebUInt64
 //   - WebURL -> WebURL
@@ -141,6 +143,22 @@ public:
             encoder->encode(rectObject->rect().size.height);
             return true;
         }
+        case APIObject::TypeRenderLayer: {
+            WebRenderLayer* renderLayer = static_cast<WebRenderLayer*>(m_root);
+            encoder->encode(renderLayer->renderObjectName());
+            encoder->encode(renderLayer->elementTagName());
+            encoder->encode(renderLayer->elementID());
+            encoder->encode(Owner(renderLayer->elementClassNames()));
+            encoder->encode(renderLayer->isReflection());
+            encoder->encode(renderLayer->isClipping());
+            encoder->encode(renderLayer->isClipped());
+            encoder->encode(static_cast<uint32_t>(renderLayer->compositingLayerType()));
+            encoder->encode(renderLayer->absoluteBoundingBox());
+            encoder->encode(Owner(renderLayer->negativeZOrderList()));
+            encoder->encode(Owner(renderLayer->normalFlowList()));
+            encoder->encode(Owner(renderLayer->positiveZOrderList()));
+            return true;
+        }
         case APIObject::TypeRenderObject: {
             WebRenderObject* renderObject = static_cast<WebRenderObject*>(m_root);
             encoder->encode(renderObject->name());
@@ -348,6 +366,54 @@ public:
             coder.m_root = WebRect::create(WKRectMake(x, y, width, height));
             break;
         }
+        case APIObject::TypeRenderLayer: {
+            String renderObjectName;
+            String elementTagName;
+            String elementID;
+            RefPtr<APIObject> elementClassNames;
+            bool isReflection;
+            bool isClipping;
+            bool isClipped;
+            uint32_t compositingLayerTypeAsUInt32;
+            WebCore::IntRect absoluteBoundingBox;
+            RefPtr<APIObject> negativeZOrderList;
+            RefPtr<APIObject> normalFlowList;
+            RefPtr<APIObject> positiveZOrderList;
+
+            if (!decoder->decode(renderObjectName))
+                return false;
+            if (!decoder->decode(elementTagName))
+                return false;
+            if (!decoder->decode(elementID))
+                return false;
+            Owner classNamesCoder(coder, elementClassNames);
+            if (!decoder->decode(classNamesCoder))
+                return false;
+            if (!decoder->decodeBool(isReflection))
+                return false;
+            if (!decoder->decodeBool(isClipping))
+                return false;
+            if (!decoder->decodeBool(isClipped))
+                return false;
+            if (!decoder->decodeUInt32(compositingLayerTypeAsUInt32))
+                return false;
+            if (!decoder->decode(absoluteBoundingBox))
+                return false;
+            Owner negativeZOrderListCoder(coder, negativeZOrderList);
+            if (!decoder->decode(negativeZOrderListCoder))
+                return false;
+            Owner normalFlowListCoder(coder, normalFlowList);
+            if (!decoder->decode(normalFlowListCoder))
+                return false;
+            Owner positiveZOrderListCoder(coder, positiveZOrderList);
+            if (!decoder->decode(positiveZOrderListCoder))
+                return false;
+            coder.m_root = WebRenderLayer::create(renderObjectName, elementTagName, elementID, static_pointer_cast<MutableArray>(elementClassNames),
+                isReflection, isClipping, isClipped, static_cast<WebRenderLayer::CompositingLayerType>(compositingLayerTypeAsUInt32),
+                absoluteBoundingBox, static_pointer_cast<MutableArray>(negativeZOrderList), static_pointer_cast<MutableArray>(normalFlowList),
+                static_pointer_cast<MutableArray>(positiveZOrderList));
+            break;
+        }
         case APIObject::TypeRenderObject: {
             String name;
             WebCore::IntPoint absolutePosition;
diff --git a/Source/WebKit2/Shared/WebRenderLayer.cpp b/Source/WebKit2/Shared/WebRenderLayer.cpp
new file mode 100644 (file)
index 0000000..586f136
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebRenderLayer.h"
+
+#include "WebPage.h"
+#include "WebString.h"
+#include <WebCore/Frame.h>
+#include <WebCore/FrameLoaderClient.h>
+#include <WebCore/RenderLayer.h>
+#include <WebCore/RenderLayerBacking.h>
+#include <WebCore/RenderView.h>
+#include <WebCore/StyledElement.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+PassRefPtr<WebRenderLayer> WebRenderLayer::create(WebPage* page)
+{
+    Frame* mainFrame = page->mainFrame();
+    if (!mainFrame)
+        return 0;
+
+    if (!mainFrame->loader()->client()->hasHTMLView())
+        return 0;
+
+    RenderView* contentRenderer = mainFrame->contentRenderer();
+    if (!contentRenderer)
+        return 0;
+
+    RenderLayer* rootLayer = contentRenderer->layer();
+    if (!rootLayer)
+        return 0;
+
+    return adoptRef(new WebRenderLayer(rootLayer));
+}
+
+PassRefPtr<MutableArray> WebRenderLayer::createArrayFromLayerList(Vector<RenderLayer*>* list)
+{
+    if (!list || !list->size())
+        return 0;
+
+    RefPtr<MutableArray> array = MutableArray::create();
+    for (size_t i = 0; i < list->size(); ++i) {
+        RefPtr<WebRenderLayer> layer = adoptRef(new WebRenderLayer(list->at(i)));
+        array->append(layer.get());
+    }
+
+    return array.release();
+}
+
+WebRenderLayer::WebRenderLayer(RenderLayer* layer)
+{
+    RenderBoxModelObject* renderer = layer->renderer();
+
+    m_renderObjectName = renderer->renderName();
+
+    if (Node* node = renderer->node()) {
+        if (node->isElementNode()) {
+            Element* element = toElement(node);
+            m_elementTagName = element->tagName();
+            m_elementID = element->getIdAttribute();
+            if (element->isStyledElement() && element->hasClass()) {
+                StyledElement* styledElement = static_cast<StyledElement*>(element);
+                if (size_t classNameCount = styledElement->classNames().size()) {
+                    m_elementClassNames = MutableArray::create();
+                    for (size_t i = 0; i < classNameCount; ++i)
+                        m_elementClassNames->append(WebString::create(styledElement->classNames()[i]).get());
+                }
+            }
+
+        }
+    }
+
+    m_isReflection = layer->isReflection();
+
+#if USE(ACCELERATED_COMPOSITING)
+    if (layer->isComposited()) {
+        RenderLayerBacking* backing = layer->backing();
+        m_isClipping = backing->hasClippingLayer();
+        m_isClipped = backing->hasAncestorClippingLayer();
+        switch (backing->compositingLayerType()) {
+        case NormalCompositingLayer:
+            m_compositingLayerType = Normal;
+            break;
+        case TiledCompositingLayer:
+            m_compositingLayerType = Tiled;
+            break;
+        case MediaCompositingLayer:
+            m_compositingLayerType = Media;
+            break;
+        case ContainerCompositingLayer:
+            m_compositingLayerType = Container;
+            break;
+        }
+    } else {
+#endif
+        m_isClipping = false;
+        m_isClipped = false;
+        m_compositingLayerType = None;
+#if USE(ACCELERATED_COMPOSITING)
+    }
+#endif
+
+    m_absoluteBoundingBox = layer->absoluteBoundingBox();
+
+    m_negativeZOrderList = createArrayFromLayerList(layer->negZOrderList());
+    m_normalFlowList = createArrayFromLayerList(layer->normalFlowList());
+    m_positiveZOrderList = createArrayFromLayerList(layer->posZOrderList());
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/Shared/WebRenderLayer.h b/Source/WebKit2/Shared/WebRenderLayer.h
new file mode 100644 (file)
index 0000000..f3323bc
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebRenderLayer_h
+#define WebRenderLayer_h
+
+#include "APIObject.h"
+#include "MutableArray.h"
+#include <WebCore/IntRect.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+    class RenderLayer;
+}
+
+namespace WebKit {
+
+class WebPage;
+
+class WebRenderLayer : public APIObject {
+public:
+    static const Type APIType = TypeRenderLayer;
+
+    enum CompositingLayerType { None, Normal, Tiled, Media, Container };
+
+    static PassRefPtr<WebRenderLayer> create(WebPage*);
+    static PassRefPtr<WebRenderLayer> create(const String& renderObjectName, const String& elementTagName, const String& elementID, PassRefPtr<MutableArray> elementClassNames,
+        bool isReflection, bool isClipping, bool isClipped, CompositingLayerType type, WebCore::IntRect absoluteBoundingBox,
+        PassRefPtr<MutableArray> negativeZOrderList, PassRefPtr<MutableArray> normalFlowList, PassRefPtr<MutableArray> positiveZOrderList)
+    {
+        return adoptRef(new WebRenderLayer(renderObjectName, elementTagName, elementID, elementClassNames, isReflection, isClipping, isClipped,
+            type, absoluteBoundingBox, negativeZOrderList, normalFlowList, positiveZOrderList));
+    }
+
+    ImmutableArray* negativeZOrderList() const { return m_negativeZOrderList.get(); }
+    ImmutableArray* normalFlowList() const { return m_normalFlowList.get(); }
+    ImmutableArray* positiveZOrderList() const { return m_positiveZOrderList.get(); }
+
+    const String& renderObjectName() const { return m_renderObjectName; }
+    const String& elementTagName() const { return m_elementTagName; }
+    const String& elementID() const { return m_elementID; }
+    ImmutableArray* elementClassNames() const { return m_elementClassNames.get(); }
+    bool isReflection() const { return m_isReflection; }
+    bool isClipping() const { return m_isClipping; }
+    bool isClipped() const { return m_isClipped; }
+    CompositingLayerType compositingLayerType() const { return m_compositingLayerType; } 
+    WebCore::IntRect absoluteBoundingBox() const { return m_absoluteBoundingBox; }
+
+private:
+    WebRenderLayer(WebCore::RenderLayer*);
+    WebRenderLayer(const String& renderObjectName, const String& elementTagName, const String& elementID, PassRefPtr<MutableArray> elementClassNames,
+        bool isReflection, bool isClipping, bool isClipped, CompositingLayerType type, WebCore::IntRect absoluteBoundingBox,
+        PassRefPtr<MutableArray> negativeZOrderList, PassRefPtr<MutableArray> normalFlowList, PassRefPtr<MutableArray> positiveZOrderList)
+        : m_renderObjectName(renderObjectName)
+        , m_elementTagName(elementTagName)
+        , m_elementID(elementID)
+        , m_elementClassNames(elementClassNames)
+        , m_isReflection(isReflection)
+        , m_isClipping(isClipping)
+        , m_isClipped(isClipped)
+        , m_compositingLayerType(type)
+        , m_absoluteBoundingBox(absoluteBoundingBox)
+        , m_negativeZOrderList(negativeZOrderList)
+        , m_normalFlowList(normalFlowList)
+        , m_positiveZOrderList(positiveZOrderList)
+    {
+    }
+
+    virtual Type type() const OVERRIDE { return APIType; }
+
+    static PassRefPtr<MutableArray> createArrayFromLayerList(Vector<WebCore::RenderLayer*>*);
+
+    String m_renderObjectName;
+    String m_elementTagName;
+    String m_elementID;
+    RefPtr<MutableArray> m_elementClassNames;
+    bool m_isReflection;
+    bool m_isClipping;
+    bool m_isClipped;
+    CompositingLayerType m_compositingLayerType;
+    WebCore::IntRect m_absoluteBoundingBox;
+
+    RefPtr<MutableArray> m_negativeZOrderList;
+    RefPtr<MutableArray> m_normalFlowList;
+    RefPtr<MutableArray> m_positiveZOrderList;
+};
+
+} // namespace WebKit
+
+#endif // WebRenderLayer_h
index c001be9a77a7335b4450e19d04aa3dc8350b4ed2..5968237a1c61fa8f22945726ad9d3a2baf0e40a7 100644 (file)
@@ -49,6 +49,7 @@ HEADERS += \
     Shared/API/c/WKMutableDictionary.h \
     Shared/API/c/WKNumber.h \
     Shared/API/c/WKPageLoadTypes.h \
+    Shared/API/c/WKRenderLayer.h \
     Shared/API/c/WKRenderObject.h \
     Shared/API/c/WKSecurityOrigin.h \
     Shared/API/c/WKSerializedScriptValue.h \
@@ -113,6 +114,7 @@ HEADERS += \
     Shared/WebPopupItem.h \
     Shared/WebPreferencesStore.h \
     Shared/WebProcessCreationParameters.h \
+    Shared/WebRenderLayer.h \
     Shared/WebRenderObject.h \
     Shared/WebURLRequest.h \
     Shared/WebURLResponse.h \
@@ -395,6 +397,7 @@ SOURCES += \
     Shared/API/c/WKImage.cpp \
     Shared/API/c/WKMutableDictionary.cpp \
     Shared/API/c/WKNumber.cpp \
+    Shared/API/c/WKRenderLayer.cpp \
     Shared/API/c/WKRenderObject.cpp \
     Shared/API/c/WKSecurityOrigin.cpp \
     Shared/API/c/WKSerializedScriptValue.cpp \
@@ -458,6 +461,7 @@ SOURCES += \
     Shared/WebPopupItem.cpp \
     Shared/WebPreferencesStore.cpp \
     Shared/WebProcessCreationParameters.cpp \
+    Shared/WebRenderLayer.cpp \
     Shared/WebRenderObject.cpp \
     Shared/WebTouchEvent.cpp \
     Shared/WebURLRequest.cpp \
index 296cd8648c3d1a3254bfb07bf063bf650c7a6ba8..bd3fa2d74dbc5540e74d1aa011e6cf18cbff134e 100644 (file)
@@ -83,6 +83,7 @@ class WebPageProxy;
 class WebPluginSiteDataManager;
 class WebPreferences;
 class WebProtectionSpace;
+class WebRenderLayer;
 class WebRenderObject;
 class WebTextChecker;
 
@@ -120,6 +121,7 @@ WK_ADD_API_MAPPING(WKPageRef, WebPageProxy)
 WK_ADD_API_MAPPING(WKPluginSiteDataManagerRef, WebPluginSiteDataManager)
 WK_ADD_API_MAPPING(WKPreferencesRef, WebPreferences)
 WK_ADD_API_MAPPING(WKProtectionSpaceRef, WebProtectionSpace)
+WK_ADD_API_MAPPING(WKRenderLayerRef, WebRenderLayer)
 WK_ADD_API_MAPPING(WKRenderObjectRef, WebRenderObject)
 WK_ADD_API_MAPPING(WKTextCheckerRef, WebTextChecker)
 
index 7c94beea562b70e3699a9d53a5cd7e8e21fe340e..179c961f47da793df418e075e387b33baa3b56be 100644 (file)
                37608822150414F700FC82C7 /* WKRenderObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37608820150414F700FC82C7 /* WKRenderObject.cpp */; };
                37608823150414F700FC82C7 /* WKRenderObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 37608821150414F700FC82C7 /* WKRenderObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
                3788A05C14743C90006319E5 /* WKBrowsingContextControllerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 3788A05B14743C90006319E5 /* WKBrowsingContextControllerPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               37948403150C350600E52CE9 /* WebRenderLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37948401150C350600E52CE9 /* WebRenderLayer.cpp */; };
+               37948404150C350600E52CE9 /* WebRenderLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 37948402150C350600E52CE9 /* WebRenderLayer.h */; };
+               37948408150C4B9700E52CE9 /* WKRenderLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37948406150C4B9600E52CE9 /* WKRenderLayer.cpp */; };
+               37948409150C4B9700E52CE9 /* WKRenderLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 37948407150C4B9600E52CE9 /* WKRenderLayer.h */; settings = {ATTRIBUTES = (Private, ); }; };
                37C4E9F6131C6E7E0029BD5A /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = B396EA5512E0ED2D00F4FEB7 /* config.h */; };
                37F623B812A57B6200E3FDF6 /* WKFindOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 37F623B712A57B6200E3FDF6 /* WKFindOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
                37F90DE31376560E0051CF68 /* HTTPCookieAcceptPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = F638954F133BEF38008941D5 /* HTTPCookieAcceptPolicy.h */; };
                37608820150414F700FC82C7 /* WKRenderObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKRenderObject.cpp; sourceTree = "<group>"; };
                37608821150414F700FC82C7 /* WKRenderObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKRenderObject.h; sourceTree = "<group>"; };
                3788A05B14743C90006319E5 /* WKBrowsingContextControllerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBrowsingContextControllerPrivate.h; sourceTree = "<group>"; };
+               37948401150C350600E52CE9 /* WebRenderLayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebRenderLayer.cpp; sourceTree = "<group>"; };
+               37948402150C350600E52CE9 /* WebRenderLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebRenderLayer.h; sourceTree = "<group>"; };
+               37948406150C4B9600E52CE9 /* WKRenderLayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKRenderLayer.cpp; sourceTree = "<group>"; };
+               37948407150C4B9600E52CE9 /* WKRenderLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKRenderLayer.h; sourceTree = "<group>"; };
                37F623B712A57B6200E3FDF6 /* WKFindOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKFindOptions.h; sourceTree = "<group>"; };
                510031F61379CACB00C8DFE4 /* WebProcessShim.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = WebProcessShim.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
                51021E9B12B16788005C033C /* WebContextMenuClientMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContextMenuClientMac.mm; sourceTree = "<group>"; };
                6546A82A13000164000CEB1C /* InjectedBundlePageResourceLoadClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePageResourceLoadClient.h; sourceTree = "<group>"; };
                65B86F1712F11D7B00B7DD8A /* WKBundleInspector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundleInspector.cpp; sourceTree = "<group>"; };
                65B86F1812F11D7B00B7DD8A /* WKBundleInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleInspector.h; sourceTree = "<group>"; };
-               6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb.in */ = {isa = PBXFileReference; fileEncoding = 4; name = com.apple.WebProcess.sb.in; path = WebProcess/com.apple.WebProcess.sb.in; sourceTree = "<group>"; };
+               6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = com.apple.WebProcess.sb.in; path = WebProcess/com.apple.WebProcess.sb.in; sourceTree = "<group>"; };
                6EE849C61368D92D0038D481 /* WKInspectorPrivateMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKInspectorPrivateMac.h; path = mac/WKInspectorPrivateMac.h; sourceTree = "<group>"; };
                762B7481120BBA0100819339 /* FontSmoothingLevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontSmoothingLevel.h; sourceTree = "<group>"; };
                762B7484120BBA2D00819339 /* WKPreferencesPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPreferencesPrivate.h; sourceTree = "<group>"; };
                E179FD9E134D38250015B883 /* ArgumentCodersMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ArgumentCodersMac.mm; sourceTree = "<group>"; };
                E17BF99514D0A73E00A5A069 /* NetscapeSandboxFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetscapeSandboxFunctions.h; sourceTree = "<group>"; };
                E17BF99714D0AA8300A5A069 /* NetscapeSandboxFunctions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetscapeSandboxFunctions.mm; sourceTree = "<group>"; };
-               E17BF99914D0CBF100A5A069 /* com.apple.WebKit.PluginProcess.sb.in */ = {isa = PBXFileReference; fileEncoding = 4; path = com.apple.WebKit.PluginProcess.sb.in; sourceTree = "<group>"; };
+               E17BF99914D0CBF100A5A069 /* com.apple.WebKit.PluginProcess.sb.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.apple.WebKit.PluginProcess.sb.in; sourceTree = "<group>"; };
                E18C92F312DB9E7100CF2AEB /* PrintInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PrintInfo.cpp; sourceTree = "<group>"; };
                E1967E35150AB5D500C73169 /* com.apple.WebKit.PluginProcess.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.apple.WebKit.PluginProcess.sb; sourceTree = "<group>"; };
                E1967E37150AB5E200C73169 /* com.apple.WebProcess.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.apple.WebProcess.sb; sourceTree = "<group>"; };
                                BCD598AA112B7FDF00EC8C23 /* WebPreferencesStore.h */,
                                BC306823125A6B9400E71278 /* WebProcessCreationParameters.cpp */,
                                BC306822125A6B9400E71278 /* WebProcessCreationParameters.h */,
+                               37948401150C350600E52CE9 /* WebRenderLayer.cpp */,
+                               37948402150C350600E52CE9 /* WebRenderLayer.h */,
                                3760881C150413E900FC82C7 /* WebRenderObject.cpp */,
                                3760881D150413E900FC82C7 /* WebRenderObject.h */,
                                F634445512A885C8000612D8 /* WebSecurityOrigin.h */,
                                BC4075E5124FF0270068F20A /* WKNumber.cpp */,
                                BC4075E6124FF0270068F20A /* WKNumber.h */,
                                BC2D021812AC426C00E732A3 /* WKPageLoadTypes.h */,
+                               37948406150C4B9600E52CE9 /* WKRenderLayer.cpp */,
+                               37948407150C4B9600E52CE9 /* WKRenderLayer.h */,
                                37608820150414F700FC82C7 /* WKRenderObject.cpp */,
                                37608821150414F700FC82C7 /* WKRenderObject.h */,
                                F634445A12A885E9000612D8 /* WKSecurityOrigin.cpp */,
                                296BD85D15019BC30071F424 /* StringUtilities.h in Headers */,
                                3760881F150413E900FC82C7 /* WebRenderObject.h in Headers */,
                                37608823150414F700FC82C7 /* WKRenderObject.h in Headers */,
+                               37948404150C350600E52CE9 /* WebRenderLayer.h in Headers */,
+                               37948409150C4B9700E52CE9 /* WKRenderLayer.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                296BD85E15019BC30071F424 /* StringUtilities.mm in Sources */,
                                3760881E150413E900FC82C7 /* WebRenderObject.cpp in Sources */,
                                37608822150414F700FC82C7 /* WKRenderObject.cpp in Sources */,
+                               37948403150C350600E52CE9 /* WebRenderLayer.cpp in Sources */,
+                               37948408150C4B9700E52CE9 /* WKRenderLayer.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 79e4e752f081d7cce0b8c52246c94b45cfdc854f..4a9ee05546c16ea74ca8ecaf9ac39f150ca30fec 100644 (file)
@@ -34,6 +34,7 @@
 #include "WebFullScreenManager.h"
 #include "WebImage.h"
 #include "WebPage.h"
+#include "WebRenderLayer.h"
 #include "WebRenderObject.h"
 #include "WebURL.h"
 #include "WebURLRequest.h"
@@ -334,6 +335,11 @@ WKRenderObjectRef WKBundlePageCopyRenderTree(WKBundlePageRef pageRef)
     return toAPI(WebRenderObject::create(toImpl(pageRef)).leakRef());
 }
 
+WKRenderLayerRef WKBundlePageCopyRenderLayerTree(WKBundlePageRef pageRef)
+{
+    return toAPI(WebRenderLayer::create(toImpl(pageRef)).leakRef());
+}
+
 void WKBundlePageSetPaintedObjectsCounterThreshold(WKBundlePageRef page, uint64_t threshold)
 {
     toImpl(page)->setPaintedObjectsCounterThreshold(threshold);
index 6462e9d57a75b38a1f814d1379da7c083e9113e2..6baf7860e204f96103544478fdc2ce9de40dc967 100644 (file)
@@ -56,6 +56,7 @@ WK_EXPORT void WKBundlePageSimulateMouseMotion(WKBundlePageRef page, WKPoint pos
 WK_EXPORT uint64_t WKBundlePageGetRenderTreeSize(WKBundlePageRef page);
 
 WK_EXPORT WKRenderObjectRef WKBundlePageCopyRenderTree(WKBundlePageRef page);
+WK_EXPORT WKRenderLayerRef WKBundlePageCopyRenderLayerTree(WKBundlePageRef page);
 
 // FIXME: This is temporary. Ultimately WebKit should choose the threshold itself.
 WK_EXPORT void WKBundlePageSetPaintedObjectsCounterThreshold(WKBundlePageRef page, uint64_t threshold);
index 719eb562062a81e0232477023ba4203ddd543996..fb95a9d8f768f056bb03ec9270d92613432e5e54 100755 (executable)
                                RelativePath="..\Shared\WebProcessCreationParameters.h"
                                >
                        </File>
+                       <File
+                               RelativePath="..\Shared\WebRenderLayer.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\Shared\WebRenderLayer.h"
+                               >
+                       </File>
                        <File
                                RelativePath="..\Shared\WebRenderObject.cpp"
                                >
                                        RelativePath="..\Shared\API\c\WKPageLoadTypes.h"
                                        >
                                </File>
+                               <File
+                                       RelativePath="..\Shared\API\c\WKRenderLayer.cpp"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\Shared\API\c\WKRenderLayer.h"
+                                       >
+                               </File>
                                <File
                                        RelativePath="..\Shared\API\c\WKRenderObject.cpp"
                                        >