Log Message
Web Inspector: remove existing LayerTreeAgent protocol APIs https://bugs.webkit.org/show_bug.cgi?id=111251
Source/WebCore: In order to eventually provide a more useful API for the LayerTreeAgent that will be done in followup bugs, we remove the current API exposed by the agent providing a clean slate that will make future patches easier to read. Additionally, we remove the "childLayers" property on the Layer object since we will no longer be providing a hierarchy of layers, but rather a flat list of layers attached to a node and its descendants. No new tests since we're removing the APIs exposed by the LayerTreeAgent. Subsequent patches will add tests as new APIs are added. Reviewed by Timothy Hatcher. * inspector/Inspector.json: * inspector/InspectorDOMAgent.cpp: * inspector/InspectorDOMAgent.h: * inspector/InspectorLayerTreeAgent.cpp: (WebCore::InspectorLayerTreeAgent::buildObjectForLayer): * inspector/InspectorLayerTreeAgent.h: (InspectorLayerTreeAgent): LayoutTests: Remove existing tests since they're testing API that we're removing. Reviewed by Timothy Hatcher. * inspector-protocol/layer-tree-expected.txt: Removed. * inspector-protocol/layer-tree-generated-content-expected.txt: Removed. * inspector-protocol/layer-tree-generated-content.html: Removed. * inspector-protocol/layer-tree.html: Removed.
Modified Paths
- trunk/LayoutTests/ChangeLog
- trunk/Source/WebCore/ChangeLog
- trunk/Source/WebCore/inspector/Inspector.json
- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp
- trunk/Source/WebCore/inspector/InspectorDOMAgent.h
- trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp
- trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.h
Removed Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (144623 => 144624)
--- trunk/LayoutTests/ChangeLog 2013-03-04 13:54:52 UTC (rev 144623)
+++ trunk/LayoutTests/ChangeLog 2013-03-04 14:07:57 UTC (rev 144624)
@@ -1,3 +1,18 @@
+2013-03-04 Antoine Quint <[email protected]>
+
+ Web Inspector: remove existing LayerTreeAgent protocol APIs
+ https://bugs.webkit.org/show_bug.cgi?id=111251
+
+ Remove existing tests since they're testing API that we're
+ removing.
+
+ Reviewed by Timothy Hatcher.
+
+ * inspector-protocol/layer-tree-expected.txt: Removed.
+ * inspector-protocol/layer-tree-generated-content-expected.txt: Removed.
+ * inspector-protocol/layer-tree-generated-content.html: Removed.
+ * inspector-protocol/layer-tree.html: Removed.
+
2013-03-04 Li Yin <[email protected]>
MediaStream.ended must return true when it is created with ended tracks.
Deleted: trunk/LayoutTests/inspector-protocol/layer-tree-expected.txt (144623 => 144624)
--- trunk/LayoutTests/inspector-protocol/layer-tree-expected.txt 2013-03-04 13:54:52 UTC (rev 144623)
+++ trunk/LayoutTests/inspector-protocol/layer-tree-expected.txt 2013-03-04 14:07:57 UTC (rev 144624)
@@ -1,376 +0,0 @@
-
-=== Get the Document ===
-
-PASS
-
-=== Enable the LayerTree agent ===
-
-PASS
-
-=== Get the initial layer tree ===
-
-PASS
-
-{
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": "number",
- "height": "number"
- },
- "isComposited": true,
- "memory": "number",
- "compositedBounds": {
- "x": 0,
- "y": 0,
- "width": "number",
- "height": "number"
- },
- "paintCount": "number",
- "childLayers": [
- {
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": "number",
- "height": "number"
- },
- "isComposited": false,
- "childLayers": [
- {
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": 100,
- "height": 100
- },
- "isComposited": false,
- "childLayers": []
- },
- {
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": 50,
- "height": 50
- },
- "isComposited": true,
- "memory": "number",
- "compositedBounds": {
- "x": 0,
- "y": 0,
- "width": 50,
- "height": 50
- },
- "paintCount": "number",
- "childLayers": [
- {
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": 50,
- "height": 50
- },
- "isComposited": true,
- "memory": "number",
- "compositedBounds": {
- "x": 0,
- "y": 0,
- "width": 50,
- "height": 50
- },
- "paintCount": "number",
- "childLayers": []
- }
- ]
- },
- {
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": 100,
- "height": 100
- },
- "isComposited": true,
- "memory": "number",
- "compositedBounds": {
- "x": 0,
- "y": 0,
- "width": 100,
- "height": 100
- },
- "paintCount": "number",
- "childLayers": [
- {
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": 50,
- "height": 50
- },
- "isComposited": true,
- "memory": "number",
- "compositedBounds": {
- "x": 0,
- "y": 0,
- "width": 50,
- "height": 50
- },
- "paintCount": "number",
- "childLayers": []
- }
- ]
- },
- {
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": 0,
- "height": 0
- },
- "isComposited": false,
- "childLayers": []
- },
- {
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": 0,
- "height": 0
- },
- "isComposited": false,
- "childLayers": []
- },
- {
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": "number",
- "height": "number"
- },
- "isComposited": true,
- "memory": "number",
- "compositedBounds": {
- "x": 0,
- "y": 0,
- "width": "number",
- "height": "number"
- },
- "paintCount": "number",
- "childLayers": []
- }
- ]
- }
- ]
-}
-
-=== Message the page to add a new composited layer ===
-
-PASS
-
-=== Get the modified layer tree ===
-
-PASS
-
-{
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": "number",
- "height": "number"
- },
- "isComposited": true,
- "memory": "number",
- "compositedBounds": {
- "x": 0,
- "y": 0,
- "width": "number",
- "height": "number"
- },
- "paintCount": "number",
- "childLayers": [
- {
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": "number",
- "height": "number"
- },
- "isComposited": false,
- "childLayers": [
- {
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": 100,
- "height": 100
- },
- "isComposited": false,
- "childLayers": []
- },
- {
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": 50,
- "height": 50
- },
- "isComposited": true,
- "memory": "number",
- "compositedBounds": {
- "x": 0,
- "y": 0,
- "width": 50,
- "height": 50
- },
- "paintCount": "number",
- "childLayers": [
- {
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": 50,
- "height": 50
- },
- "isComposited": true,
- "memory": "number",
- "compositedBounds": {
- "x": 0,
- "y": 0,
- "width": 50,
- "height": 50
- },
- "paintCount": "number",
- "childLayers": []
- }
- ]
- },
- {
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": 100,
- "height": 100
- },
- "isComposited": true,
- "memory": "number",
- "compositedBounds": {
- "x": 0,
- "y": 0,
- "width": 100,
- "height": 100
- },
- "paintCount": "number",
- "childLayers": [
- {
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": 50,
- "height": 50
- },
- "isComposited": true,
- "memory": "number",
- "compositedBounds": {
- "x": 0,
- "y": 0,
- "width": 50,
- "height": 50
- },
- "paintCount": "number",
- "childLayers": []
- }
- ]
- },
- {
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": 0,
- "height": 0
- },
- "isComposited": false,
- "childLayers": []
- },
- {
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": 0,
- "height": 0
- },
- "isComposited": false,
- "childLayers": []
- },
- {
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": "number",
- "height": "number"
- },
- "isComposited": true,
- "memory": "number",
- "compositedBounds": {
- "x": 0,
- "y": 0,
- "width": "number",
- "height": "number"
- },
- "paintCount": "number",
- "childLayers": []
- },
- {
- "layerId": "string",
- "bounds": {
- "x": 0,
- "y": 0,
- "width": 50,
- "height": 50
- },
- "isComposited": true,
- "memory": "number",
- "compositedBounds": {
- "x": 0,
- "y": 0,
- "width": 50,
- "height": 50
- },
- "paintCount": "number",
- "childLayers": []
- }
- ]
- }
- ]
-}
-
-=== Obtain the node id for the newly inserted layer ===
-
-PASS
-
-=== Get attributes for the newly inserted node ===
-
-PASS
-
-=== Test complete, all expected conditions met ===
-
Deleted: trunk/LayoutTests/inspector-protocol/layer-tree-generated-content-expected.txt (144623 => 144624)
--- trunk/LayoutTests/inspector-protocol/layer-tree-generated-content-expected.txt 2013-03-04 13:54:52 UTC (rev 144623)
+++ trunk/LayoutTests/inspector-protocol/layer-tree-generated-content-expected.txt 2013-03-04 14:07:57 UTC (rev 144624)
@@ -1,17 +0,0 @@
-
-=== Get the Document ===
-
-PASS
-
-=== Enable the LayerTree agent ===
-
-PASS
-
-=== Get the layer tree ===
-
-PASS
-
-=== Obtain all node IDs for layers in the tree ===
-
-PASS
-
Deleted: trunk/LayoutTests/inspector-protocol/layer-tree-generated-content.html (144623 => 144624)
--- trunk/LayoutTests/inspector-protocol/layer-tree-generated-content.html 2013-03-04 13:54:52 UTC (rev 144623)
+++ trunk/LayoutTests/inspector-protocol/layer-tree-generated-content.html 2013-03-04 14:07:57 UTC (rev 144624)
@@ -1,159 +0,0 @@
-<html>
-<head>
-<script type="text/_javascript_" src=""
-<script type="text/_javascript_">
-
-function test()
-{
-
- getDocument();
-
- function getDocument()
- {
- // We must first get the document so that later on we may get sensible nodeIds.
- step({
- name: "Get the Document",
- command: "DOM.getDocument",
- parameters: {},
- callback: enableLayerTreeAgent
- });
- };
-
- function enableLayerTreeAgent(result)
- {
- step({
- name: "Enable the LayerTree agent",
- command: "LayerTree.enable",
- parameters: {},
- callback: getLayerTree
- });
- };
-
- function getLayerTree(result)
- {
- step({
- name: "Get the layer tree",
- command: "LayerTree.getLayerTree",
- parameters: {},
- callback: gotLayerTree
- });
- };
-
- var layerCount;
-
- function gotLayerTree(result)
- {
- var flatTree = flattenedLayerTree(result.layerTree);
- var layerIds = Object.keys(flatTree);
-
- layerCount = layerIds.length;
-
- logTestName("Obtain all node IDs for layers in the tree");
-
- function obtainNodeIdForLayerId(layerId)
- {
- runCommand({
- command: "LayerTree.nodeIdForLayerId",
- parameters: {"layerId": layerId},
- callback: gotNodeIdForLayer
- });
- };
-
- layerIds.forEach(obtainNodeIdForLayerId);
- };
-
- var nodeIds = [];
-
- function gotNodeIdForLayer(result)
- {
- var id = result.nodeId;
-
- nodeIds.push(id);
-
- if (!--layerCount)
- finishTest();
- };
-
- function finishTest()
- {
- // We pass if we got this far and we have some node IDs reported to be 0,
- // which is what is expected to be returned for layers not associated with
- // a Node, for instance CSS generated content.
- if (nodeIds.indexOf(0) !== -1)
- InspectorTest.log("PASS");
- else
- InspectorTest.log("FAIL: Did not get any node ID equal to 0.");
-
- InspectorTest.completeTest();
- };
-
- function flattenedLayerTree(layerTree)
- {
- var layerByIds = {};
-
- function recurse(layer)
- {
- layerByIds[layer.layerId] = layer;
- if (layer.childLayers)
- layer.childLayers.forEach(recurse);
- };
-
- recurse(layerTree);
-
- return layerByIds;
- };
-
- function step(test)
- {
- logTestName(test.name);
- runCommand(test);
- };
-
- function logTestName(name)
- {
- InspectorTest.log("\n=== " + name + " ===\n");
- };
-
- function runCommand(command)
- {
- InspectorTest.sendCommand(command.command, command.parameters, function(messageObject) {
- if (messageObject.hasOwnProperty("error")) {
- InspectorTest.log("FAIL: " + messageObject.error.message + " (" + messageObject.error.code + ")");
- InspectorTest.completeTest();
- return;
- }
-
- if (command.name)
- InspectorTest.log("PASS");
-
- command.callback(messageObject.result);
- });
- };
-
-};
-
-window.addEventListener("DOMContentLoaded", function()
-{
- runTest();
-}, false);
-
-</script>
-<style type="text/css">
-
- div::after {
- position: absolute;
- width: 100px;
- height: 100px;
- background-color: black;
- -webkit-transform: translateZ(0);
- content: "";
- }
-
-</style>
-</head>
-<body>
-
- <div></div>
-
-</body>
-</html>
Deleted: trunk/LayoutTests/inspector-protocol/layer-tree.html (144623 => 144624)
--- trunk/LayoutTests/inspector-protocol/layer-tree.html 2013-03-04 13:54:52 UTC (rev 144623)
+++ trunk/LayoutTests/inspector-protocol/layer-tree.html 2013-03-04 14:07:57 UTC (rev 144624)
@@ -1,250 +0,0 @@
-<html>
-<head>
-<script type="text/_javascript_" src=""
-<script type="text/_javascript_">
-
-function addCompositedLayer()
-{
- var element = document.createElement("div");
- element.className = "composited";
- element.id = "last-element";
- document.body.appendChild(element);
-};
-
-function test()
-{
- var initialLayerTree;
- var eventsCount = 0;
-
- InspectorTest.eventHandler["LayerTree.layerTreeDidChange"] = function (messageObject) {
- eventsCount++;
- };
-
- getDocument();
-
- function getDocument()
- {
- // We must first get the document so that later on we may get sensible nodeIds.
- step({
- name: "Get the Document",
- command: "DOM.getDocument",
- parameters: {},
- callback: enableLayerTreeAgent
- });
- };
-
- function enableLayerTreeAgent(result)
- {
- step({
- name: "Enable the LayerTree agent",
- command: "LayerTree.enable",
- parameters: {},
- callback: getInitialLayerTree
- });
- };
-
- function getInitialLayerTree(result)
- {
- step({
- name: "Get the initial layer tree",
- command: "LayerTree.getLayerTree",
- parameters: {},
- callback: gotInitialLayerTree
- });
- };
-
- function gotInitialLayerTree(result)
- {
- initialLayerTree = result.layerTree;
-
- dumpLayerTree(initialLayerTree);
-
- step({
- name: "Message the page to add a new composited layer",
- command: "Runtime.evaluate",
- parameters: {"_expression_": "addCompositedLayer()"},
- callback: getModifiedLayerTree
- });
- };
-
- function getModifiedLayerTree(result)
- {
- step({
- name: "Get the modified layer tree",
- command: "LayerTree.getLayerTree",
- parameters: {},
- callback: gotModifiedLayerTree
- });
- };
-
- var layerCount = 0;
-
- function gotModifiedLayerTree(result)
- {
- dumpLayerTree(result.layerTree);
-
- var mutations = layerTreeMutations(initialLayerTree, result.layerTree);
- var lastId = mutations.additions[0];
-
- step({
- name: "Obtain the node id for the newly inserted layer",
- command: "LayerTree.nodeIdForLayerId",
- parameters: {"layerId": lastId},
- callback: gotNodeIdForLastLayer
- });
- };
-
- function gotNodeIdForLastLayer(result)
- {
- var id = result.nodeId;
- step({
- name: "Get attributes for the newly inserted node",
- command: "DOM.getAttributes",
- parameters: {"nodeId": id},
- callback: gotNodeAttributes
- });
- };
-
- function gotNodeAttributes(result)
- {
- var attributes = attributesDictionaryFromArray(result.attributes);
- if (attributes.id !== "last-element")
- InspectorTest.log("FAIL: Did not obtain the expected element for the last inserted layer.");
-
- finishTest();
- };
-
- function finishTest()
- {
- if (!eventsCount)
- InspectorTest.log("FAIL: Did not receive layerTreeDidChange events.");
- else
- InspectorTest.log("\n=== Test complete, all expected conditions met ===");
-
- InspectorTest.completeTest();
- };
-
- function layerTreeMutations(oldLayerTree, newLayerTree)
- {
- var oldKeys = Object.keys(flattenedLayerTree(oldLayerTree));
- var newKeys = Object.keys(flattenedLayerTree(newLayerTree));
-
- return {
- additions: newKeys.filter(function (key) {
- return (oldKeys.indexOf(key) === -1);
- }),
- removals: oldKeys.filter(function (key) {
- return (newKeys.indexOf(key) === -1);
- })
- };
- };
-
- function flattenedLayerTree(layerTree)
- {
- var layerByIds = {};
-
- function recurse(layer)
- {
- layerByIds[layer.layerId] = layer;
- if (layer.childLayers)
- layer.childLayers.forEach(recurse);
- };
-
- recurse(layerTree);
-
- return layerByIds;
- };
-
- function attributesDictionaryFromArray(attributes)
- {
- var dictionary = {}
- for (var i = 0, count = attributes.length; i < count; i += 2) {
- dictionary[attributes[i]] = attributes[i + 1];
- }
- return dictionary;
- };
-
- function dumpLayerTree(layerTree)
- {
- function replacer(key, value)
- {
- if (key === "layerId" || key === "memory" || key === "paintCount")
- return typeof(value);
-
- // some values differ based on port, but the ones we most
- // care about will always be less or equal 100.
- if ((key === "width" || key === "height") && value > 100)
- return typeof(value);
-
- return value;
- };
-
- InspectorTest.log("\n" + JSON.stringify(layerTree, replacer, " "));
- };
-
- function step(test)
- {
- InspectorTest.log("\n=== " + test.name + " ===\n")
- InspectorTest.sendCommand(test.command, test.parameters, function(messageObject) {
- if (messageObject.hasOwnProperty("error")) {
- InspectorTest.log("FAIL: " + messageObject.error.message + " (" + messageObject.error.code + ")");
- InspectorTest.completeTest();
- return;
- }
-
- InspectorTest.log("PASS");
- test.callback(messageObject.result);
- });
- };
-
-};
-
-window.addEventListener("DOMContentLoaded", function () {
- runTest();
-}, false);
-
-</script>
-<style type="text/css">
-
- div {
- position: absolute;
- top: 0;
- left: 0;
- }
-
- .regular {
- width: 100px;
- height: 100px;
- background-color: black;
- }
-
- .composited {
- top: 25px;
- left: 25px;
- width: 50px;
- height: 50px;
- background-color: blue;
- -webkit-transform: translateZ(0);
- }
-
- .offset {
- left: 200px;
- -webkit-transform: translateZ(0);
- }
-
-</style>
-</head>
-<body>
-
- <div class="regular"></div>
-
- <div class="composited">
- <div class="composited"></div>
- </div>
-
- <div class="regular offset">
- <div class="composited"></div>
- </div>
-
-</body>
-</html>
Modified: trunk/Source/WebCore/ChangeLog (144623 => 144624)
--- trunk/Source/WebCore/ChangeLog 2013-03-04 13:54:52 UTC (rev 144623)
+++ trunk/Source/WebCore/ChangeLog 2013-03-04 14:07:57 UTC (rev 144624)
@@ -1,3 +1,28 @@
+2013-03-04 Antoine Quint <[email protected]>
+
+ Web Inspector: remove existing LayerTreeAgent protocol APIs
+ https://bugs.webkit.org/show_bug.cgi?id=111251
+
+ In order to eventually provide a more useful API for the LayerTreeAgent
+ that will be done in followup bugs, we remove the current API exposed by
+ the agent providing a clean slate that will make future patches easier
+ to read. Additionally, we remove the "childLayers" property on the Layer
+ object since we will no longer be providing a hierarchy of layers, but
+ rather a flat list of layers attached to a node and its descendants.
+
+ No new tests since we're removing the APIs exposed by the LayerTreeAgent.
+ Subsequent patches will add tests as new APIs are added.
+
+ Reviewed by Timothy Hatcher.
+
+ * inspector/Inspector.json:
+ * inspector/InspectorDOMAgent.cpp:
+ * inspector/InspectorDOMAgent.h:
+ * inspector/InspectorLayerTreeAgent.cpp:
+ (WebCore::InspectorLayerTreeAgent::buildObjectForLayer):
+ * inspector/InspectorLayerTreeAgent.h:
+ (InspectorLayerTreeAgent):
+
2013-03-04 Li Yin <[email protected]>
MediaStream.ended must return true when it is created with ended tracks.
Modified: trunk/Source/WebCore/inspector/Inspector.json (144623 => 144624)
--- trunk/Source/WebCore/inspector/Inspector.json 2013-03-04 13:54:52 UTC (rev 144623)
+++ trunk/Source/WebCore/inspector/Inspector.json 2013-03-04 14:07:57 UTC (rev 144624)
@@ -3663,11 +3663,10 @@
"properties": [
{ "name": "layerId", "$ref": "LayerId", "description": "The unique id for this layer." },
{ "name": "bounds", "$ref": "IntRect", "description": "Bounds of the layer." },
- { "name": "isComposited", "type": "boolean", "description": "Indicates whether this layer is composited." },
+ { "name": "isComposited", "type": "boolean", "optional": true, "description": "Indicates whether this layer is composited." },
{ "name": "paintCount", "type": "integer", "optional": true, "description": "Indicates how many time this layer has painted." },
{ "name": "memory", "type": "integer", "optional": true, "description": "Estimated memory used by this layer." },
- { "name": "compositedBounds", "$ref": "IntRect", "optional": true, "description": "The bounds of the composited layer." },
- { "name": "childLayers", "type": "array", "optional": true, "items": { "$ref": "Layer" }, "description": "Child layers." }
+ { "name": "compositedBounds", "$ref": "IntRect", "optional": true, "description": "The bounds of the composited layer." }
]
}
],
@@ -3679,23 +3678,6 @@
{
"name": "disable",
"description": "Disables compositing tree inspection."
- },
- {
- "name": "getLayerTree",
- "description": "Returns the layer tree structure of the current page.",
- "returns": [
- { "name": "layerTree", "$ref": "Layer", "description": "Layer tree structure of the current page." }
- ]
- },
- {
- "name": "nodeIdForLayerId",
- "description": "Returns the node id for a given layer id.",
- "parameters": [
- { "name": "layerId", "$ref": "LayerId" }
- ],
- "returns": [
- { "name": "nodeId", "$ref": "DOM.NodeId", "description": "The node id for the given layer id." }
- ]
}
],
"events": [
Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (144623 => 144624)
--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp 2013-03-04 13:54:52 UTC (rev 144623)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp 2013-03-04 14:07:57 UTC (rev 144624)
@@ -599,18 +599,6 @@
return map->get(nodeToPush);
}
-int InspectorDOMAgent::pushNodePathForRenderLayerToFrontend(const RenderLayer* renderLayer)
-{
- Node* node = renderLayer->renderer()->node();
-
- // RenderLayers may not be associated with a Node, for instance
- // in the case of CSS generated content.
- if (!node)
- return 0;
-
- return pushNodePathToFrontend(node);
-}
-
int InspectorDOMAgent::boundNodeId(Node* node)
{
return m_documentNodeToIdMap.get(node);
Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.h (144623 => 144624)
--- trunk/Source/WebCore/inspector/InspectorDOMAgent.h 2013-03-04 13:54:52 UTC (rev 144623)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.h 2013-03-04 14:07:57 UTC (rev 144624)
@@ -203,7 +203,6 @@
// Methods called from other agents.
InspectorPageAgent* pageAgent() { return m_pageAgent; }
- int pushNodePathForRenderLayerToFrontend(const RenderLayer*);
private:
InspectorDOMAgent(InstrumentingAgents*, InspectorPageAgent*, InspectorCompositeState*, InjectedScriptManager*, InspectorOverlay*, InspectorClient*);
Modified: trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp (144623 => 144624)
--- trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp 2013-03-04 13:54:52 UTC (rev 144623)
+++ trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp 2013-03-04 14:07:57 UTC (rev 144624)
@@ -44,7 +44,6 @@
#include "Page.h"
#include "RenderLayer.h"
#include "RenderLayerBacking.h"
-#include "RenderLayerCompositor.h"
#include "RenderView.h"
namespace WebCore {
@@ -112,67 +111,22 @@
unbind(renderLayer);
}
-void InspectorLayerTreeAgent::getLayerTree(ErrorString*, RefPtr<TypeBuilder::LayerTree::Layer>& object)
-{
- object = buildObjectForRootLayer();
-}
-
-PassRefPtr<TypeBuilder::LayerTree::Layer> InspectorLayerTreeAgent::buildObjectForRootLayer()
-{
- return buildObjectForLayer(m_inspectedPage->mainFrame()->contentRenderer()->compositor()->rootRenderLayer());
-}
-
PassRefPtr<TypeBuilder::LayerTree::Layer> InspectorLayerTreeAgent::buildObjectForLayer(RenderLayer* renderLayer)
{
- bool isComposited = renderLayer->isComposited();
-
// Basic set of properties.
RefPtr<TypeBuilder::LayerTree::Layer> layerObject = TypeBuilder::LayerTree::Layer::create()
.setLayerId(bind(renderLayer))
- .setBounds(buildObjectForIntRect(enclosingIntRect(renderLayer->localBoundingBox())))
- .setIsComposited(isComposited);
+ .setBounds(buildObjectForIntRect(enclosingIntRect(renderLayer->localBoundingBox())));
// Optional properties for composited layers only.
- if (isComposited) {
+ if (renderLayer->isComposited()) {
RenderLayerBacking* backing = renderLayer->backing();
layerObject->setMemory(backing->backingStoreMemoryEstimate());
layerObject->setCompositedBounds(buildObjectForIntRect(backing->compositedBounds()));
layerObject->setPaintCount(backing->graphicsLayer()->repaintCount());
+ layerObject->setIsComposited(true);
}
- // Process children layers.
- RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > childrenArray = TypeBuilder::Array<TypeBuilder::LayerTree::Layer>::create();
-
- renderLayer->updateLayerListsIfNeeded();
-
- // Check if we have a reflection layer.
- if (renderLayer->reflectionLayer())
- childrenArray->addItem(buildObjectForLayer(renderLayer->reflectionLayer()));
-
- if (renderLayer->isStackingContainer()) {
- if (Vector<RenderLayer*>* negZOrderList = renderLayer->negZOrderList()) {
- size_t listSize = negZOrderList->size();
- for (size_t i = 0; i < listSize; ++i)
- childrenArray->addItem(buildObjectForLayer(negZOrderList->at(i)));
- }
- }
-
- if (Vector<RenderLayer*>* normalFlowList = renderLayer->normalFlowList()) {
- size_t listSize = normalFlowList->size();
- for (size_t i = 0; i < listSize; ++i)
- childrenArray->addItem(buildObjectForLayer(normalFlowList->at(i)));
- }
-
- if (renderLayer->isStackingContainer()) {
- if (Vector<RenderLayer*>* posZOrderList = renderLayer->posZOrderList()) {
- size_t listSize = posZOrderList->size();
- for (size_t i = 0; i < listSize; ++i)
- childrenArray->addItem(buildObjectForLayer(posZOrderList->at(i)));
- }
- }
-
- layerObject->setChildLayers(childrenArray);
-
return layerObject;
}
@@ -208,22 +162,6 @@
m_idToLayer.remove(identifier);
}
-void InspectorLayerTreeAgent::nodeIdForLayerId(ErrorString* errorString, const String& layerId, int* resultNodeId)
-{
- // Obtain the RenderLayer from the identifier provided.
- const RenderLayer* renderLayer = m_idToLayer.get(layerId);
-
- // Send an error if there is no such registered layer id.
- if (!renderLayer) {
- *errorString = "Could not find a bound layer for the provided id";
- return;
- }
-
- // Get the node id from the DOM agent and return it to the front-end.
- InspectorDOMAgent* inspectorDOMAgent = m_instrumentingAgents->inspectorDOMAgent();
- *resultNodeId = inspectorDOMAgent->pushNodePathForRenderLayerToFrontend(renderLayer);
-}
-
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
Modified: trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.h (144623 => 144624)
--- trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.h 2013-03-04 13:54:52 UTC (rev 144623)
+++ trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.h 2013-03-04 14:07:57 UTC (rev 144624)
@@ -67,8 +67,6 @@
// Called from the front-end.
virtual void enable(ErrorString*);
virtual void disable(ErrorString*);
- virtual void getLayerTree(ErrorString*, RefPtr<TypeBuilder::LayerTree::Layer>&);
- virtual void nodeIdForLayerId(ErrorString*, const String& layerId, int* resultNodeId);
private:
InspectorLayerTreeAgent(InstrumentingAgents*, InspectorCompositeState*, Page*);
@@ -77,7 +75,6 @@
String bind(const RenderLayer*);
void unbind(const RenderLayer*);
- PassRefPtr<TypeBuilder::LayerTree::Layer> buildObjectForRootLayer();
PassRefPtr<TypeBuilder::LayerTree::Layer> buildObjectForLayer(RenderLayer*);
PassRefPtr<TypeBuilder::LayerTree::IntRect> buildObjectForIntRect(const IntRect&);
_______________________________________________ webkit-changes mailing list [email protected] https://lists.webkit.org/mailman/listinfo/webkit-changes
