| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 /** @type {!Object.<number, !WebInspector.DOMNode>} */ | 896 /** @type {!Object.<number, !WebInspector.DOMNode>} */ |
| 897 this._idToDOMNode = {}; | 897 this._idToDOMNode = {}; |
| 898 /** @type {?WebInspector.DOMDocument} */ | 898 /** @type {?WebInspector.DOMDocument} */ |
| 899 this._document = null; | 899 this._document = null; |
| 900 /** @type {!Object.<number, boolean>} */ | 900 /** @type {!Object.<number, boolean>} */ |
| 901 this._attributeLoadNodeIds = {}; | 901 this._attributeLoadNodeIds = {}; |
| 902 target.registerDOMDispatcher(new WebInspector.DOMDispatcher(this)); | 902 target.registerDOMDispatcher(new WebInspector.DOMDispatcher(this)); |
| 903 | 903 |
| 904 this._defaultHighlighter = new WebInspector.DefaultDOMNodeHighlighter(this._
agent); | 904 this._defaultHighlighter = new WebInspector.DefaultDOMNodeHighlighter(this._
agent); |
| 905 this._highlighter = this._defaultHighlighter; | 905 this._highlighter = this._defaultHighlighter; |
| 906 |
| 907 if (WebInspector.experimentsSettings.disableAgentsWhenProfile.isEnabled()) |
| 908 target.profilingLock.addEventListener(WebInspector.Lock.Events.StateChan
ged, this._profilingStateChanged, this); |
| 909 |
| 906 this._agent.enable(); | 910 this._agent.enable(); |
| 907 } | 911 } |
| 908 | 912 |
| 909 WebInspector.DOMModel.Events = { | 913 WebInspector.DOMModel.Events = { |
| 910 AttrModified: "AttrModified", | 914 AttrModified: "AttrModified", |
| 911 AttrRemoved: "AttrRemoved", | 915 AttrRemoved: "AttrRemoved", |
| 912 CharacterDataModified: "CharacterDataModified", | 916 CharacterDataModified: "CharacterDataModified", |
| 913 NodeInserted: "NodeInserted", | 917 NodeInserted: "NodeInserted", |
| 914 NodeRemoved: "NodeRemoved", | 918 NodeRemoved: "NodeRemoved", |
| 915 DocumentUpdated: "DocumentUpdated", | 919 DocumentUpdated: "DocumentUpdated", |
| 916 ChildNodeCountUpdated: "ChildNodeCountUpdated", | 920 ChildNodeCountUpdated: "ChildNodeCountUpdated", |
| 917 UndoRedoRequested: "UndoRedoRequested", | 921 UndoRedoRequested: "UndoRedoRequested", |
| 918 UndoRedoCompleted: "UndoRedoCompleted", | 922 UndoRedoCompleted: "UndoRedoCompleted", |
| 919 } | 923 } |
| 920 | 924 |
| 921 WebInspector.DOMModel.prototype = { | 925 WebInspector.DOMModel.prototype = { |
| 926 _profilingStateChanged: function() |
| 927 { |
| 928 if (this.target().profilingLock.isAcquired()) |
| 929 this._agent.disable(); |
| 930 else |
| 931 this._agent.enable(); |
| 932 }, |
| 933 |
| 922 /** | 934 /** |
| 923 * @param {function(!WebInspector.DOMDocument)=} callback | 935 * @param {function(!WebInspector.DOMDocument)=} callback |
| 924 */ | 936 */ |
| 925 requestDocument: function(callback) | 937 requestDocument: function(callback) |
| 926 { | 938 { |
| 927 if (this._document) { | 939 if (this._document) { |
| 928 if (callback) | 940 if (callback) |
| 929 callback(this._document); | 941 callback(this._document); |
| 930 return; | 942 return; |
| 931 } | 943 } |
| (...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1858 { | 1870 { |
| 1859 WebInspector.overridesSupport.setTouchEmulationSuspended(enabled); | 1871 WebInspector.overridesSupport.setTouchEmulationSuspended(enabled); |
| 1860 this._agent.setInspectModeEnabled(enabled, inspectUAShadowDOM, config, c
allback); | 1872 this._agent.setInspectModeEnabled(enabled, inspectUAShadowDOM, config, c
allback); |
| 1861 } | 1873 } |
| 1862 } | 1874 } |
| 1863 | 1875 |
| 1864 /** | 1876 /** |
| 1865 * @type {!WebInspector.DOMModel} | 1877 * @type {!WebInspector.DOMModel} |
| 1866 */ | 1878 */ |
| 1867 WebInspector.domModel; | 1879 WebInspector.domModel; |
| OLD | NEW |