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 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 * @return {?WebInspector.ElementsTreeOutline} | 780 * @return {?WebInspector.ElementsTreeOutline} |
781 */ | 781 */ |
782 _treeOutlineForNode: function(node) | 782 _treeOutlineForNode: function(node) |
783 { | 783 { |
784 if (!node) | 784 if (!node) |
785 return null; | 785 return null; |
786 return WebInspector.ElementsTreeOutline.forDOMModel(node.domModel()); | 786 return WebInspector.ElementsTreeOutline.forDOMModel(node.domModel()); |
787 }, | 787 }, |
788 | 788 |
789 /** | 789 /** |
790 * @return {?WebInspector.ElementsTreeOutline} | |
791 */ | |
792 _focusedTreeOutline: function() | |
793 { | |
794 for (var i = 0; i < this._treeOutlines.length; ++i) { | |
795 if (this._treeOutlines[i].hasFocus()) | |
796 return this._treeOutlines[i]; | |
797 } | |
798 return null; | |
799 }, | |
800 | |
801 /** | |
802 * @param {!WebInspector.DOMNode} node | 790 * @param {!WebInspector.DOMNode} node |
803 * @return {?WebInspector.ElementsTreeElement} | 791 * @return {?WebInspector.ElementsTreeElement} |
804 */ | 792 */ |
805 _treeElementForNode: function(node) | 793 _treeElementForNode: function(node) |
806 { | 794 { |
807 var treeOutline = this._treeOutlineForNode(node); | 795 var treeOutline = this._treeOutlineForNode(node); |
808 return /** @type {?WebInspector.ElementsTreeElement} */ (treeOutline.fin
dTreeElement(node)); | 796 return /** @type {?WebInspector.ElementsTreeElement} */ (treeOutline.fin
dTreeElement(node)); |
809 }, | 797 }, |
810 | 798 |
811 /** | 799 /** |
812 * @param {!Event} event | |
813 */ | |
814 handleCopyEvent: function(event) | |
815 { | |
816 var treeOutline = this._focusedTreeOutline(); | |
817 if (treeOutline) | |
818 treeOutline.handleCopyOrCutKeyboardEvent(false, event); | |
819 }, | |
820 | |
821 /** | |
822 * @param {!Event} event | |
823 */ | |
824 handleCutEvent: function(event) | |
825 { | |
826 var treeOutline = this._focusedTreeOutline(); | |
827 if (treeOutline) | |
828 treeOutline.handleCopyOrCutKeyboardEvent(true, event); | |
829 }, | |
830 | |
831 /** | |
832 * @param {!Event} event | |
833 */ | |
834 handlePasteEvent: function(event) | |
835 { | |
836 var treeOutline = this._focusedTreeOutline(); | |
837 if (treeOutline) | |
838 treeOutline.handlePasteKeyboardEvent(event); | |
839 }, | |
840 | |
841 /** | |
842 * @param {!WebInspector.DOMNode} node | 800 * @param {!WebInspector.DOMNode} node |
843 * @return {!WebInspector.DOMNode} | 801 * @return {!WebInspector.DOMNode} |
844 */ | 802 */ |
845 _leaveUserAgentShadowDOM: function(node) | 803 _leaveUserAgentShadowDOM: function(node) |
846 { | 804 { |
847 var userAgentShadowRoot; | 805 var userAgentShadowRoot; |
848 while ((userAgentShadowRoot = node.ancestorUserAgentShadowRoot()) && use
rAgentShadowRoot.parentNode) | 806 while ((userAgentShadowRoot = node.ancestorUserAgentShadowRoot()) && use
rAgentShadowRoot.parentNode) |
849 node = userAgentShadowRoot.parentNode; | 807 node = userAgentShadowRoot.parentNode; |
850 return node; | 808 return node; |
851 }, | 809 }, |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1209 /** | 1167 /** |
1210 * @override | 1168 * @override |
1211 * @param {!WebInspector.DOMNode} node | 1169 * @param {!WebInspector.DOMNode} node |
1212 * @return {?{title: string, color: string}} | 1170 * @return {?{title: string, color: string}} |
1213 */ | 1171 */ |
1214 decorate: function(node) | 1172 decorate: function(node) |
1215 { | 1173 { |
1216 return { color: "orange", title: WebInspector.UIString("Element state: %
s", ":" + WebInspector.CSSModel.fromNode(node).pseudoState(node).join(", :")) }; | 1174 return { color: "orange", title: WebInspector.UIString("Element state: %
s", ":" + WebInspector.CSSModel.fromNode(node).pseudoState(node).join(", :")) }; |
1217 } | 1175 } |
1218 } | 1176 } |
OLD | NEW |