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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 | 379 |
380 var treeOutline = WebInspector.ElementsTreeOutline.forDOMModel(domModel)
; | 380 var treeOutline = WebInspector.ElementsTreeOutline.forDOMModel(domModel)
; |
381 treeOutline.rootDOMNode = inspectedRootDocument; | 381 treeOutline.rootDOMNode = inspectedRootDocument; |
382 | 382 |
383 if (!inspectedRootDocument) { | 383 if (!inspectedRootDocument) { |
384 if (this.isShowing()) | 384 if (this.isShowing()) |
385 domModel.requestDocument(); | 385 domModel.requestDocument(); |
386 return; | 386 return; |
387 } | 387 } |
388 | 388 |
389 WebInspector.domBreakpointsSidebarPane.restoreBreakpoints(domModel); | |
390 | |
391 /** | 389 /** |
392 * @this {WebInspector.ElementsPanel} | 390 * @this {WebInspector.ElementsPanel} |
393 * @param {?WebInspector.DOMNode} candidateFocusNode | 391 * @param {?WebInspector.DOMNode} candidateFocusNode |
394 */ | 392 */ |
395 function selectNode(candidateFocusNode) | 393 function selectNode(candidateFocusNode) |
396 { | 394 { |
397 if (!candidateFocusNode) | 395 if (!candidateFocusNode) |
398 candidateFocusNode = inspectedRootDocument.body || inspectedRoot
Document.documentElement; | 396 candidateFocusNode = inspectedRootDocument.body || inspectedRoot
Document.documentElement; |
399 | 397 |
400 if (!candidateFocusNode) | 398 if (!candidateFocusNode) |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 * @param {!Object} object | 960 * @param {!Object} object |
963 */ | 961 */ |
964 appendApplicableItems: function(event, contextMenu, object) | 962 appendApplicableItems: function(event, contextMenu, object) |
965 { | 963 { |
966 if (!(object instanceof WebInspector.RemoteObject && (/** @type {!WebIns
pector.RemoteObject} */ (object)).isNode()) | 964 if (!(object instanceof WebInspector.RemoteObject && (/** @type {!WebIns
pector.RemoteObject} */ (object)).isNode()) |
967 && !(object instanceof WebInspector.DOMNode) | 965 && !(object instanceof WebInspector.DOMNode) |
968 && !(object instanceof WebInspector.DeferredDOMNode)) { | 966 && !(object instanceof WebInspector.DeferredDOMNode)) { |
969 return; | 967 return; |
970 } | 968 } |
971 | 969 |
972 // Add debbuging-related actions | 970 // Add debugging-related actions |
973 if (object instanceof WebInspector.DOMNode) { | 971 if (object instanceof WebInspector.DOMNode) { |
974 contextMenu.appendSeparator(); | 972 contextMenu.appendSeparator(); |
975 WebInspector.domBreakpointsSidebarPane.populateNodeContextMenu(objec
t, contextMenu, true); | 973 WebInspector.domBreakpointsSidebarPane.populateNodeContextMenu(objec
t, contextMenu, true); |
976 } | 974 } |
977 | 975 |
978 // Skip adding "Reveal..." menu item for our own tree outline. | 976 // Skip adding "Reveal..." menu item for our own tree outline. |
979 if (WebInspector.ElementsPanel.instance().element.isAncestor(/** @type {
!Node} */ (event.target))) | 977 if (WebInspector.ElementsPanel.instance().element.isAncestor(/** @type {
!Node} */ (event.target))) |
980 return; | 978 return; |
981 var commandCallback = WebInspector.Revealer.reveal.bind(WebInspector.Rev
ealer, object); | 979 var commandCallback = WebInspector.Revealer.reveal.bind(WebInspector.Rev
ealer, object); |
982 contextMenu.appendItem(WebInspector.UIString.capitalize("Reveal in Eleme
nts ^panel"), commandCallback); | 980 contextMenu.appendItem(WebInspector.UIString.capitalize("Reveal in Eleme
nts ^panel"), commandCallback); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1119 /** | 1117 /** |
1120 * @override | 1118 * @override |
1121 * @param {!WebInspector.DOMNode} node | 1119 * @param {!WebInspector.DOMNode} node |
1122 * @return {?{title: string, color: string}} | 1120 * @return {?{title: string, color: string}} |
1123 */ | 1121 */ |
1124 decorate: function(node) | 1122 decorate: function(node) |
1125 { | 1123 { |
1126 return { color: "orange", title: WebInspector.UIString("Element state: %
s", ":" + WebInspector.CSSModel.fromNode(node).pseudoState(node).join(", :")) }; | 1124 return { color: "orange", title: WebInspector.UIString("Element state: %
s", ":" + WebInspector.CSSModel.fromNode(node).pseudoState(node).join(", :")) }; |
1127 } | 1125 } |
1128 } | 1126 } |
OLD | NEW |