| 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 /** |
| 971 * @param {!WebInspector.DOMNode} node |
| 972 * @param {!WebInspector.ContextMenu} contextMenu |
| 973 */ |
| 974 function populateNodeContextMenu(node, contextMenu) |
| 975 { |
| 976 if (node.pseudoType()) |
| 977 return; |
| 978 |
| 979 var nodeBreakpoints = WebInspector.domBreakpointManager.nodeBreakpoi
nts(node); |
| 980 |
| 981 /** |
| 982 * @param {!DOMDebuggerAgent.DOMBreakpointType} type |
| 983 */ |
| 984 function toggleBreakpoint(type) |
| 985 { |
| 986 WebInspector.domBreakpointManager.toggleBreakpoint(node, type); |
| 987 } |
| 988 var breakpointsMenu = contextMenu.appendSubMenuItem(WebInspector.UIS
tring("Break on...")); |
| 989 for (var key in WebInspector.DOMBreakpointsSidebarPane.BreakpointTyp
es) { |
| 990 var type = WebInspector.DOMBreakpointsSidebarPane.BreakpointType
s[key]; |
| 991 var label = WebInspector.DOMBreakpointsSidebarPane.ContextMenuLa
bels[type]; |
| 992 breakpointsMenu.appendCheckboxItem(label, toggleBreakpoint.bind(
null, type), nodeBreakpoints.get(type)); |
| 993 } |
| 994 } |
| 995 |
| 996 // Add debugging-related actions |
| 973 if (object instanceof WebInspector.DOMNode) { | 997 if (object instanceof WebInspector.DOMNode) { |
| 974 contextMenu.appendSeparator(); | 998 contextMenu.appendSeparator(); |
| 975 WebInspector.domBreakpointsSidebarPane.populateNodeContextMenu(objec
t, contextMenu, true); | 999 populateNodeContextMenu(object, contextMenu); |
| 976 } | 1000 } |
| 977 | 1001 |
| 978 // Skip adding "Reveal..." menu item for our own tree outline. | 1002 // Skip adding "Reveal..." menu item for our own tree outline. |
| 979 if (WebInspector.ElementsPanel.instance().element.isAncestor(/** @type {
!Node} */ (event.target))) | 1003 if (WebInspector.ElementsPanel.instance().element.isAncestor(/** @type {
!Node} */ (event.target))) |
| 980 return; | 1004 return; |
| 981 var commandCallback = WebInspector.Revealer.reveal.bind(WebInspector.Rev
ealer, object); | 1005 var commandCallback = WebInspector.Revealer.reveal.bind(WebInspector.Rev
ealer, object); |
| 982 contextMenu.appendItem(WebInspector.UIString.capitalize("Reveal in Eleme
nts ^panel"), commandCallback); | 1006 contextMenu.appendItem(WebInspector.UIString.capitalize("Reveal in Eleme
nts ^panel"), commandCallback); |
| 983 } | 1007 } |
| 984 } | 1008 } |
| 985 | 1009 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1119 /** | 1143 /** |
| 1120 * @override | 1144 * @override |
| 1121 * @param {!WebInspector.DOMNode} node | 1145 * @param {!WebInspector.DOMNode} node |
| 1122 * @return {?{title: string, color: string}} | 1146 * @return {?{title: string, color: string}} |
| 1123 */ | 1147 */ |
| 1124 decorate: function(node) | 1148 decorate: function(node) |
| 1125 { | 1149 { |
| 1126 return { color: "orange", title: WebInspector.UIString("Element state: %
s", ":" + WebInspector.CSSModel.fromNode(node).pseudoState(node).join(", :")) }; | 1150 return { color: "orange", title: WebInspector.UIString("Element state: %
s", ":" + WebInspector.CSSModel.fromNode(node).pseudoState(node).join(", :")) }; |
| 1127 } | 1151 } |
| 1128 } | 1152 } |
| OLD | NEW |