https://bugs.webkit.org/show_bug.cgi?id=76808
Reviewed by Timothy Hatcher.
Source/WebCore:
Test: http/tests/inspector/inspect-element.html
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::innerParentNode):
* inspector/front-end/DOMAgent.js:
(WebInspector.DOMNode.prototype.getChildNodes.mycallback):
(WebInspector.DOMNode.prototype.getChildNodes):
(WebInspector.DOMNode.prototype._setChildrenPayload):
* inspector/front-end/ElementsTreeOutline.js:
(WebInspector.ElementsTreeOutline.prototype._selectedNodeChanged):
LayoutTests:
* http/tests/inspector/inspect-element-expected.txt: Added.
* http/tests/inspector/inspect-element.html: Added.
* http/tests/inspector/resources/inspect-element-iframe.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105620
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-01-23 Pavel Feldman <pfeldman@google.com>
+
+ Web Inspector: Inspecting an element inside an iframe no longer works
+ https://bugs.webkit.org/show_bug.cgi?id=76808
+
+ Reviewed by Timothy Hatcher.
+
+ * http/tests/inspector/inspect-element-expected.txt: Added.
+ * http/tests/inspector/inspect-element.html: Added.
+ * http/tests/inspector/resources/inspect-element-iframe.html: Added.
+
2012-01-23 Anton Muhin <antonm@chromium.org>
Unreviewed tweaking of test expectations: it should be IMAGE instead of IMAGE+TEXT.
--- /dev/null
+Tests that inspect element action works for iframe children (https://bugs.webkit.org/show_bug.cgi?id=76808).
+
+
+div#div
+
--- /dev/null
+<html>
+<head>
+<script src="inspector-test.js"></script>
+<script src="elements-test.js"></script>
+<script>
+
+function test()
+{
+ WebInspector.inspectorView.setCurrentPanel(WebInspector.panels.elements);
+ WebInspector.panels.elements.treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, selectedNodeChanged, this);
+ function selectedNodeChanged(event)
+ {
+ var node = event.data;
+ if (node.getAttribute("id") == "div") {
+ InspectorTest.addResult(node.appropriateSelectorFor());
+ InspectorTest.completeTest();
+ }
+ }
+ InspectorTest.evaluateInConsole("inspect(iframeDivElement)");
+}
+
+</script>
+</head>
+
+<body>
+<p>
+Tests that inspect element action works for iframe children (https://bugs.webkit.org/show_bug.cgi?id=76808).
+</p>
+
+<iframe src="resources/inspect-element-iframe.html" onload="runTest()"></iframe>
+
+</body>
+</html>
--- /dev/null
+<html>
+
+<body>
+<div id="div">Element to inspect</div>
+</body>
+
+<script>
+top.iframeDivElement = document.getElementById("div");
+</script>
+
+</html>
+2012-01-23 Pavel Feldman <pfeldman@google.com>
+
+ Web Inspector: Inspecting an element inside an iframe no longer works
+ https://bugs.webkit.org/show_bug.cgi?id=76808
+
+ Reviewed by Timothy Hatcher.
+
+ Test: http/tests/inspector/inspect-element.html
+
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::innerParentNode):
+ * inspector/front-end/DOMAgent.js:
+ (WebInspector.DOMNode.prototype.getChildNodes.mycallback):
+ (WebInspector.DOMNode.prototype.getChildNodes):
+ (WebInspector.DOMNode.prototype._setChildrenPayload):
+ * inspector/front-end/ElementsTreeOutline.js:
+ (WebInspector.ElementsTreeOutline.prototype._selectedNodeChanged):
+
2012-01-23 Andrey Kosyakov <caseq@chromium.org>
Web Inspector: response.bodySize in HAR is invalid (negative) for cached resources
Node* InspectorDOMAgent::innerParentNode(Node* node)
{
+ if (node->isDocumentNode()) {
+ Document* document = static_cast<Document*>(node);
+ return document->ownerElement();
+ }
return node->parentNode();
}
*/
_setChildrenPayload: function(payloads)
{
+ // We set children in the constructor.
+ if (this._contentDocument)
+ return;
+
this.children = [];
for (var i = 0; i < payloads.length; ++i) {
var payload = payloads[i];
_selectedNodeChanged: function()
{
- this._eventSupport.dispatchEventToListeners(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged);
+ this._eventSupport.dispatchEventToListeners(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, this._selectedDOMNode);
},
findTreeElement: function(node)