| 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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 callback(this.children()); | 345 callback(this.children()); |
| 346 return; | 346 return; |
| 347 } | 347 } |
| 348 | 348 |
| 349 /** | 349 /** |
| 350 * @this {WebInspector.DOMNode} | 350 * @this {WebInspector.DOMNode} |
| 351 * @param {?Protocol.Error} error | 351 * @param {?Protocol.Error} error |
| 352 */ | 352 */ |
| 353 function mycallback(error) | 353 function mycallback(error) |
| 354 { | 354 { |
| 355 if (!this._children) { |
| 356 // By this moment children should have been pushed in case there
were any. |
| 357 // Fall back for nodes with no children. |
| 358 this._children = []; |
| 359 } |
| 355 if (callback) | 360 if (callback) |
| 356 callback(error ? null : this.children()); | 361 callback(error ? null : this.children()); |
| 357 } | 362 } |
| 358 | 363 |
| 359 DOMAgent.requestChildNodes(this.id, undefined, mycallback.bind(this)); | 364 DOMAgent.requestChildNodes(this.id, undefined, mycallback.bind(this)); |
| 360 }, | 365 }, |
| 361 | 366 |
| 362 /** | 367 /** |
| 363 * @param {number} depth | 368 * @param {number} depth |
| 364 * @param {function(Array.<WebInspector.DOMNode>)=} callback | 369 * @param {function(Array.<WebInspector.DOMNode>)=} callback |
| (...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1735 setInspectModeEnabled: function(enabled, inspectShadowDOM, config, callback) | 1740 setInspectModeEnabled: function(enabled, inspectShadowDOM, config, callback) |
| 1736 { | 1741 { |
| 1737 DOMAgent.setInspectModeEnabled(enabled, inspectShadowDOM, config, callba
ck); | 1742 DOMAgent.setInspectModeEnabled(enabled, inspectShadowDOM, config, callba
ck); |
| 1738 } | 1743 } |
| 1739 } | 1744 } |
| 1740 | 1745 |
| 1741 /** | 1746 /** |
| 1742 * @type {?WebInspector.DOMAgent} | 1747 * @type {?WebInspector.DOMAgent} |
| 1743 */ | 1748 */ |
| 1744 WebInspector.domAgent = null; | 1749 WebInspector.domAgent = null; |
| OLD | NEW |