OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> |
4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1430 if (!isShadowRoot) | 1430 if (!isShadowRoot) |
1431 contextMenu.appendItem(WebInspector.UIString("Copy as HTML"), this._ copyHTML.bind(this)); | 1431 contextMenu.appendItem(WebInspector.UIString("Copy as HTML"), this._ copyHTML.bind(this)); |
1432 | 1432 |
1433 // Place it here so that all "Copy"-ing items stick together. | 1433 // Place it here so that all "Copy"-ing items stick together. |
1434 if (this.representedObject.nodeType() === Node.ELEMENT_NODE) | 1434 if (this.representedObject.nodeType() === Node.ELEMENT_NODE) |
1435 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCa seMenuTitles() ? "Copy CSS path" : "Copy CSS Path"), this._copyCSSPath.bind(this )); | 1435 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCa seMenuTitles() ? "Copy CSS path" : "Copy CSS Path"), this._copyCSSPath.bind(this )); |
1436 if (!isShadowRoot) | 1436 if (!isShadowRoot) |
1437 contextMenu.appendItem(WebInspector.UIString("Copy XPath"), this._co pyXPath.bind(this)); | 1437 contextMenu.appendItem(WebInspector.UIString("Copy XPath"), this._co pyXPath.bind(this)); |
1438 if (isEditable) | 1438 if (isEditable) |
1439 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCa seMenuTitles() ? "Delete node" : "Delete Node"), this.remove.bind(this)); | 1439 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCa seMenuTitles() ? "Delete node" : "Delete Node"), this.remove.bind(this)); |
1440 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMe nuTitles() ? "Inspect DOM properties" : "Inspect DOM Properties"), this._inspect DOMProperties.bind(this)); | |
apavlov
2014/03/21 14:22:55
This one is also not quite clear to me. It was int
| |
1441 }, | 1440 }, |
1442 | 1441 |
1443 _startEditing: function() | 1442 _startEditing: function() |
1444 { | 1443 { |
1445 if (this.treeOutline.selectedDOMNode() !== this._node) | 1444 if (this.treeOutline.selectedDOMNode() !== this._node) |
1446 return; | 1445 return; |
1447 | 1446 |
1448 var listItem = this._listItemNode; | 1447 var listItem = this._listItemNode; |
1449 | 1448 |
1450 if (this._canAddAttributes) { | 1449 if (this._canAddAttributes) { |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2329 _copyCSSPath: function() | 2328 _copyCSSPath: function() |
2330 { | 2329 { |
2331 InspectorFrontendHost.copyText(WebInspector.DOMPresentationUtils.cssPath (this._node, true)); | 2330 InspectorFrontendHost.copyText(WebInspector.DOMPresentationUtils.cssPath (this._node, true)); |
2332 }, | 2331 }, |
2333 | 2332 |
2334 _copyXPath: function() | 2333 _copyXPath: function() |
2335 { | 2334 { |
2336 InspectorFrontendHost.copyText(WebInspector.DOMPresentationUtils.xPath(t his._node, true)); | 2335 InspectorFrontendHost.copyText(WebInspector.DOMPresentationUtils.xPath(t his._node, true)); |
2337 }, | 2336 }, |
2338 | 2337 |
2339 _inspectDOMProperties: function() | |
2340 { | |
2341 WebInspector.RemoteObject.resolveNode(this._node, "console", callback); | |
2342 | |
2343 /** | |
2344 * @param {?WebInspector.RemoteObject} nodeObject | |
2345 */ | |
2346 function callback(nodeObject) | |
2347 { | |
2348 if (!nodeObject) | |
2349 return; | |
2350 | |
2351 var message = new WebInspector.ConsoleMessage( | |
2352 WebInspector.ConsoleMessage.MessageSource.ConsoleAPI, | |
2353 WebInspector.ConsoleMessage.MessageLevel.Log, | |
2354 "", | |
2355 WebInspector.ConsoleMessage.MessageType.Dir, | |
2356 undefined, | |
2357 undefined, | |
2358 undefined, | |
2359 undefined, | |
2360 undefined, | |
2361 [nodeObject]); | |
2362 WebInspector.console.addMessage(message); | |
2363 WebInspector.console.show(); | |
2364 } | |
2365 }, | |
2366 | |
2367 _highlightSearchResults: function() | 2338 _highlightSearchResults: function() |
2368 { | 2339 { |
2369 if (!this._searchQuery || !this._searchHighlightsVisible) | 2340 if (!this._searchQuery || !this._searchHighlightsVisible) |
2370 return; | 2341 return; |
2371 if (this._highlightResult) { | 2342 if (this._highlightResult) { |
2372 this._updateSearchHighlight(true); | 2343 this._updateSearchHighlight(true); |
2373 return; | 2344 return; |
2374 } | 2345 } |
2375 | 2346 |
2376 var text = this.listItemElement.textContent; | 2347 var text = this.listItemElement.textContent; |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2659 var treeOutline = new WebInspector.ElementsTreeOutline(false, false); | 2630 var treeOutline = new WebInspector.ElementsTreeOutline(false, false); |
2660 treeOutline.rootDOMNode = /** @type {!WebInspector.DOMNode} */ (object); | 2631 treeOutline.rootDOMNode = /** @type {!WebInspector.DOMNode} */ (object); |
2661 treeOutline.element.classList.add("outline-disclosure"); | 2632 treeOutline.element.classList.add("outline-disclosure"); |
2662 if (!treeOutline.children[0].hasChildren) | 2633 if (!treeOutline.children[0].hasChildren) |
2663 treeOutline.element.classList.add("single-node"); | 2634 treeOutline.element.classList.add("single-node"); |
2664 treeOutline.setVisible(true); | 2635 treeOutline.setVisible(true); |
2665 treeOutline.element.treeElementForTest = treeOutline.children[0]; | 2636 treeOutline.element.treeElementForTest = treeOutline.children[0]; |
2666 return treeOutline.element; | 2637 return treeOutline.element; |
2667 } | 2638 } |
2668 } | 2639 } |
OLD | NEW |