Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: Source/devtools/front_end/DOMAgent.js

Issue 26586002: [devtools] Return empty array from DOMNode.children() rather than null. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Provisional fix. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/inspector/elements/inspect-deep-shadow-element.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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;
OLDNEW
« no previous file with comments | « LayoutTests/inspector/elements/inspect-deep-shadow-element.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698