[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
simon.fraser at apple.com
simon.fraser at apple.com
Wed Dec 22 11:09:22 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 1df2d10b98e4b40d264a717a3f67d688b6004347
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Jul 14 00:04:46 2010 +0000
2010-07-13 Simon Fraser <simon.fraser at apple.com>
Reviewed by Dan Bernstein.
<rdar://problem/8186963> Expose RenderLayer hierarchy via Obj-C for debugging.
Add a WebRenderLayer class that reflects the RenderLayer tree into a hierarchy
of Objective-C objects suitable for display in an outline view.
* WebKit.exp: Export the WebRenderLayer Objective-C class.
* WebView/WebRenderLayer.h: Added.
* WebView/WebRenderLayer.mm: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63263 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 38b1c43..b76ad27 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,13 @@
+2010-07-13 Simon Fraser <simon.fraser at apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ <rdar://problem/8186963> Expose RenderLayer hierarchy via Obj-C for debugging.
+
+ Add WebRenderLayer files.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
2010-07-13 Rafael Antognolli <antognolli at profusion.mobi>
Reviewed by Antonio Gomes.
diff --git a/WebKit/WebKit.xcodeproj/project.pbxproj b/WebKit/WebKit.xcodeproj/project.pbxproj
index 4c470e6..1e6ef26 100644
--- a/WebKit/WebKit.xcodeproj/project.pbxproj
+++ b/WebKit/WebKit.xcodeproj/project.pbxproj
@@ -18,6 +18,8 @@
0ACE917310FE47E30096A45F /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0ACE917210FE47E30096A45F /* OpenGL.framework */; };
0AEBFF630F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AEBFF610F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
0AEBFF640F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0AEBFF620F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.mm */; };
+ 0F30985F11ECFE4500F559DF /* WebRenderLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F30985D11ECFE4400F559DF /* WebRenderLayer.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0F30986011ECFE4500F559DF /* WebRenderLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F30985E11ECFE4500F559DF /* WebRenderLayer.mm */; };
0FD3B0F21076C3E900039B96 /* WebVideoFullscreenController.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD3B0EE1076C3E900039B96 /* WebVideoFullscreenController.h */; };
0FD3B0F31076C3E900039B96 /* WebVideoFullscreenController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FD3B0EF1076C3E900039B96 /* WebVideoFullscreenController.mm */; };
0FD3B0F41076C3E900039B96 /* WebVideoFullscreenHUDWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD3B0F01076C3E900039B96 /* WebVideoFullscreenHUDWindowController.h */; };
@@ -371,6 +373,8 @@
0ACE917210FE47E30096A45F /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
0AEBFF610F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = WebNetscapeContainerCheckPrivate.h; sourceTree = "<group>"; };
0AEBFF620F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNetscapeContainerCheckPrivate.mm; sourceTree = "<group>"; };
+ 0F30985D11ECFE4400F559DF /* WebRenderLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebRenderLayer.h; sourceTree = "<group>"; };
+ 0F30985E11ECFE4500F559DF /* WebRenderLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebRenderLayer.mm; sourceTree = "<group>"; };
0FD3B0EE1076C3E900039B96 /* WebVideoFullscreenController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenController.h; sourceTree = "<group>"; };
0FD3B0EF1076C3E900039B96 /* WebVideoFullscreenController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebVideoFullscreenController.mm; sourceTree = "<group>"; };
0FD3B0F01076C3E900039B96 /* WebVideoFullscreenHUDWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenHUDWindowController.h; sourceTree = "<group>"; };
@@ -1148,6 +1152,8 @@
3944606E020F50ED0ECA1767 /* WebPreferences.h */,
F5AEBB3D024A527601C1A526 /* WebPreferences.mm */,
9CAE9D070252A4130ECA16EA /* WebPreferencesPrivate.h */,
+ 0F30985D11ECFE4400F559DF /* WebRenderLayer.h */,
+ 0F30985E11ECFE4500F559DF /* WebRenderLayer.mm */,
F5F81C3902B67C26018635CA /* WebRenderNode.h */,
F5F81C3A02B67C26018635CA /* WebRenderNode.mm */,
84311A1205EAAAF00088EDA4 /* WebResource.h */,
@@ -1550,6 +1556,7 @@
41F4484F10338E8C0030E55E /* WebWorkersPrivate.h in Headers */,
C0C5B3EE1177A4A0002B0AEF /* WebUserContentURLPattern.h in Headers */,
1AA879B611CBE9BF003C664F /* WebPlatformStrategies.h in Headers */,
+ 0F30985F11ECFE4500F559DF /* WebRenderLayer.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1908,6 +1915,7 @@
41F4485010338E8C0030E55E /* WebWorkersPrivate.mm in Sources */,
C0C5B3EF1177A4A0002B0AEF /* WebUserContentURLPattern.mm in Sources */,
1AA879B711CBE9BF003C664F /* WebPlatformStrategies.mm in Sources */,
+ 0F30986011ECFE4500F559DF /* WebRenderLayer.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index adb6f23..76f8602 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,16 @@
+2010-07-13 Simon Fraser <simon.fraser at apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ <rdar://problem/8186963> Expose RenderLayer hierarchy via Obj-C for debugging.
+
+ Add a WebRenderLayer class that reflects the RenderLayer tree into a hierarchy
+ of Objective-C objects suitable for display in an outline view.
+
+ * WebKit.exp: Export the WebRenderLayer Objective-C class.
+ * WebView/WebRenderLayer.h: Added.
+ * WebView/WebRenderLayer.mm: Added.
+
2010-07-07 Tor Arne Vestbø <tor.arne.vestbo at nokia.com>
Reviewed by Darin Adler.
diff --git a/WebKit/mac/WebKit.exp b/WebKit/mac/WebKit.exp
index b2ddb18..a22179f 100644
--- a/WebKit/mac/WebKit.exp
+++ b/WebKit/mac/WebKit.exp
@@ -25,6 +25,7 @@
.objc_class_name_WebPanelAuthenticationHandler
.objc_class_name_WebPluginDatabase
.objc_class_name_WebPreferences
+.objc_class_name_WebRenderLayer
.objc_class_name_WebRenderNode
.objc_class_name_WebResource
.objc_class_name_WebScriptCallFrame
diff --git a/WebKit/mac/WebView/WebRenderLayer.h b/WebKit/mac/WebView/WebRenderLayer.h
new file mode 100644
index 0000000..10d38df
--- /dev/null
+++ b/WebKit/mac/WebView/WebRenderLayer.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 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. ``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 COMPUTER, INC. OR
+ * 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.
+ */
+
+#import <Foundation/Foundation.h>
+
+ at class WebFrame;
+
+ at interface WebRenderLayer : NSObject
+{
+ NSArray *children;
+ NSString *name;
+ NSRect bounds;
+ BOOL composited;
+}
+
+- (id)initWithWebFrame:(WebFrame *)frame;
+
+- (NSArray *)children;
+
+- (NSString *)name;
+- (NSString *)positionString;
+- (NSString *)widthString;
+- (NSString *)heightString;
+- (BOOL)composited;
+
+ at end
diff --git a/WebKit/mac/WebView/WebRenderLayer.mm b/WebKit/mac/WebView/WebRenderLayer.mm
new file mode 100644
index 0000000..f70738f
--- /dev/null
+++ b/WebKit/mac/WebView/WebRenderLayer.mm
@@ -0,0 +1,193 @@
+/*
+ * Copyright (C) 2010 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. ``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 COMPUTER, INC. OR
+ * 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.
+ */
+
+#import "WebRenderLayer.h"
+
+#import "WebFrameInternal.h"
+#import <WebCore/Frame.h>
+#import <WebCore/FrameLoaderClient.h>
+#import <WebCore/PlatformString.h>
+#import <WebCore/RenderLayer.h>
+#import <WebCore/RenderView.h>
+#import <WebCore/RenderView.h>
+
+using namespace WebCore;
+
+
+ at interface WebRenderLayer(Private)
+
+- (id)initWithRenderLayer:(RenderLayer *)layer;
+- (void)buildDescendantLayers:(RenderLayer*)rootLayer;
+
+ at end
+
+ at implementation WebRenderLayer
+
++ (NSString *)nameForLayer:(RenderLayer*)layer;
+{
+ RenderObject* renderer = layer->renderer();
+ NSString *name = [NSString stringWithUTF8String:renderer->renderName()];
+
+ if (Node* node = renderer->node()) {
+ if (node->isElementNode())
+ name = [name stringByAppendingFormat:@" %@", (NSString *)static_cast<Element*>(node)->tagName()];
+
+ if (node->hasID())
+ name = [name stringByAppendingFormat:@" ‘%@’", (NSString *)static_cast<Element*>(node)->getIdAttribute()];
+ }
+
+ if (layer->isReflection())
+ name = [name stringByAppendingString:@" (reflection)"];
+
+ return name;
+}
+
+- (id)initWithRenderLayer:(RenderLayer*)layer
+{
+ if ((self = [super init])) {
+ name = [[WebRenderLayer nameForLayer:layer] retain];
+ bounds = layer->absoluteBoundingBox();
+ composited = layer->isComposited();
+ }
+
+ return self;
+}
+
+// Only called on the root.
+- (id)initWithWebFrame:(WebFrame *)webFrame
+{
+ self = [super init];
+
+ Frame* frame = core(webFrame);
+ if (!frame->loader()->client()->hasHTMLView()) {
+ [self release];
+ return nil;
+ }
+
+ RenderObject* renderer = frame->contentRenderer();
+ if (!renderer) {
+ [self release];
+ return nil;
+ }
+
+ if (renderer->hasLayer()) {
+ RenderLayer* layer = toRenderBoxModelObject(renderer)->layer();
+
+ name = [[WebRenderLayer nameForLayer:layer] retain];
+ bounds = layer->absoluteBoundingBox();
+ composited = layer->isComposited();
+
+ [self buildDescendantLayers:layer];
+ }
+
+ return self;
+}
+
+- (void)dealloc
+{
+ [children release];
+ [name release];
+ [super dealloc];
+}
+
+- (void)buildDescendantLayers:(RenderLayer*)layer
+{
+ NSMutableArray *childWebLayers = [[NSMutableArray alloc] init];
+
+ // Build children in back to front order.
+
+ if (Vector<RenderLayer*>* negZOrderList = layer->negZOrderList()) {
+ size_t listSize = negZOrderList->size();
+ for (size_t i = 0; i < listSize; ++i) {
+ RenderLayer* curLayer = negZOrderList->at(i);
+
+ WebRenderLayer* newLayer = [[WebRenderLayer alloc] initWithRenderLayer:curLayer];
+ [newLayer buildDescendantLayers:curLayer];
+
+ [childWebLayers addObject:newLayer];
+ [newLayer release];
+ }
+ }
+
+ if (Vector<RenderLayer*>* normalFlowList = layer->normalFlowList()) {
+ size_t listSize = normalFlowList->size();
+ for (size_t i = 0; i < listSize; ++i) {
+ RenderLayer* curLayer = normalFlowList->at(i);
+
+ WebRenderLayer* newLayer = [[WebRenderLayer alloc] initWithRenderLayer:curLayer];
+ [newLayer buildDescendantLayers:curLayer];
+
+ [childWebLayers addObject:newLayer];
+ [newLayer release];
+ }
+ }
+
+ if (Vector<RenderLayer*>* posZOrderList = layer->posZOrderList()) {
+ size_t listSize = posZOrderList->size();
+ for (size_t i = 0; i < listSize; ++i) {
+ RenderLayer* curLayer = posZOrderList->at(i);
+
+ WebRenderLayer* newLayer = [[WebRenderLayer alloc] initWithRenderLayer:curLayer];
+ [newLayer buildDescendantLayers:curLayer];
+
+ [childWebLayers addObject:newLayer];
+ [newLayer release];
+ }
+ }
+
+ children = childWebLayers;
+}
+
+- (NSArray *)children
+{
+ return children;
+}
+
+- (NSString *)name
+{
+ return name;
+}
+
+- (NSString *)positionString
+{
+ return [NSString stringWithFormat:@"(%.0f, %.0f)", bounds.origin.x, bounds.origin.y];
+}
+
+- (NSString *)widthString
+{
+ return [NSString stringWithFormat:@"%.0f", bounds.size.width];
+}
+
+- (NSString *)heightString
+{
+ return [NSString stringWithFormat:@"%.0f", bounds.size.height];
+}
+
+- (BOOL)composited
+{
+ return composited;
+}
+
+ at end
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list