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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 var treeOutline = Elements.ElementsTreeOutline.forDOMModel(domModel); | 410 var treeOutline = Elements.ElementsTreeOutline.forDOMModel(domModel); |
411 treeOutline.rootDOMNode = inspectedRootDocument; | 411 treeOutline.rootDOMNode = inspectedRootDocument; |
412 | 412 |
413 if (!inspectedRootDocument) { | 413 if (!inspectedRootDocument) { |
414 if (this.isShowing()) | 414 if (this.isShowing()) |
415 domModel.requestDocument(); | 415 domModel.requestDocument(); |
416 return; | 416 return; |
417 } | 417 } |
418 | 418 |
419 this._hasNonDefaultSelectedNode = false; | 419 this._hasNonDefaultSelectedNode = false; |
420 Components.domBreakpointsSidebarPane.restoreBreakpoints(inspectedRootDocumen
t); | |
421 | 420 |
422 if (this._omitDefaultSelection) | 421 if (this._omitDefaultSelection) |
423 return; | 422 return; |
424 | 423 |
425 var savedSelectedNodeOnReset = this._selectedNodeOnReset; | 424 var savedSelectedNodeOnReset = this._selectedNodeOnReset; |
426 restoreNode.call(this, domModel, this._selectedNodeOnReset); | 425 restoreNode.call(this, domModel, this._selectedNodeOnReset); |
427 | 426 |
428 /** | 427 /** |
429 * @param {!SDK.DOMModel} domModel | 428 * @param {!SDK.DOMModel} domModel |
430 * @param {?SDK.DOMNode} staleNode | 429 * @param {?SDK.DOMNode} staleNode |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 * @override | 957 * @override |
959 * @param {!Event} event | 958 * @param {!Event} event |
960 * @param {!UI.ContextMenu} contextMenu | 959 * @param {!UI.ContextMenu} contextMenu |
961 * @param {!Object} object | 960 * @param {!Object} object |
962 */ | 961 */ |
963 appendApplicableItems(event, contextMenu, object) { | 962 appendApplicableItems(event, contextMenu, object) { |
964 if (!(object instanceof SDK.RemoteObject && (/** @type {!SDK.RemoteObject} *
/ (object)).isNode()) && | 963 if (!(object instanceof SDK.RemoteObject && (/** @type {!SDK.RemoteObject} *
/ (object)).isNode()) && |
965 !(object instanceof SDK.DOMNode) && !(object instanceof SDK.DeferredDOMN
ode)) | 964 !(object instanceof SDK.DOMNode) && !(object instanceof SDK.DeferredDOMN
ode)) |
966 return; | 965 return; |
967 | 966 |
968 | |
969 // Add debbuging-related actions | |
970 if (object instanceof SDK.DOMNode) { | |
971 contextMenu.appendSeparator(); | |
972 Components.domBreakpointsSidebarPane.populateNodeContextMenu(object, conte
xtMenu, true); | |
973 } | |
974 | |
975 // Skip adding "Reveal..." menu item for our own tree outline. | 967 // Skip adding "Reveal..." menu item for our own tree outline. |
976 if (Elements.ElementsPanel.instance().element.isAncestor(/** @type {!Node} *
/ (event.target))) | 968 if (Elements.ElementsPanel.instance().element.isAncestor(/** @type {!Node} *
/ (event.target))) |
977 return; | 969 return; |
978 var commandCallback = Common.Revealer.reveal.bind(Common.Revealer, object); | 970 var commandCallback = Common.Revealer.reveal.bind(Common.Revealer, object); |
979 contextMenu.appendItem(Common.UIString.capitalize('Reveal in Elements ^panel
'), commandCallback); | 971 contextMenu.appendItem(Common.UIString.capitalize('Reveal in Elements ^panel
'), commandCallback); |
980 } | 972 } |
981 }; | 973 }; |
982 | 974 |
983 /** | 975 /** |
984 * @implements {Common.Revealer} | 976 * @implements {Common.Revealer} |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1090 * @param {!SDK.DOMNode} node | 1082 * @param {!SDK.DOMNode} node |
1091 * @return {?{title: string, color: string}} | 1083 * @return {?{title: string, color: string}} |
1092 */ | 1084 */ |
1093 decorate(node) { | 1085 decorate(node) { |
1094 return { | 1086 return { |
1095 color: 'orange', | 1087 color: 'orange', |
1096 title: Common.UIString('Element state: %s', ':' + node.domModel().cssModel
().pseudoState(node).join(', :')) | 1088 title: Common.UIString('Element state: %s', ':' + node.domModel().cssModel
().pseudoState(node).join(', :')) |
1097 }; | 1089 }; |
1098 } | 1090 } |
1099 }; | 1091 }; |
OLD | NEW |