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

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

Issue 22548006: DevTools: Improve performance of the element breadcrumbs. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed the test Created 7 years, 4 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 | Annotate | Revision Log
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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 /** 357 /**
358 * @param {string} html 358 * @param {string} html
359 * @param {function(?Protocol.Error)=} callback 359 * @param {function(?Protocol.Error)=} callback
360 */ 360 */
361 setOuterHTML: function(html, callback) 361 setOuterHTML: function(html, callback)
362 { 362 {
363 DOMAgent.setOuterHTML(this.id, html, WebInspector.domAgent._markRevision (this, callback)); 363 DOMAgent.setOuterHTML(this.id, html, WebInspector.domAgent._markRevision (this, callback));
364 }, 364 },
365 365
366 /** 366 /**
367 * @param {function(?Protocol.Error)=} callback 367 * @param {function(?Protocol.Error, DOMAgent.NodeId=)=} callback
368 */ 368 */
369 removeNode: function(callback) 369 removeNode: function(callback)
370 { 370 {
371 DOMAgent.removeNode(this.id, WebInspector.domAgent._markRevision(this, c allback)); 371 DOMAgent.removeNode(this.id, WebInspector.domAgent._markRevision(this, c allback));
372 }, 372 },
373 373
374 copyNode: function() 374 copyNode: function()
375 { 375 {
376 function copy(error, text) 376 function copy(error, text)
377 { 377 {
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 var attr = this._attributesMap[name]; 589 var attr = this._attributesMap[name];
590 if (attr) { 590 if (attr) {
591 this._attributes.remove(attr); 591 this._attributes.remove(attr);
592 delete this._attributesMap[name]; 592 delete this._attributesMap[name];
593 } 593 }
594 }, 594 },
595 595
596 /** 596 /**
597 * @param {WebInspector.DOMNode} targetNode 597 * @param {WebInspector.DOMNode} targetNode
598 * @param {?WebInspector.DOMNode} anchorNode 598 * @param {?WebInspector.DOMNode} anchorNode
599 * @param {function(?Protocol.Error)=} callback 599 * @param {function(?Protocol.Error, DOMAgent.NodeId=)=} callback
600 */ 600 */
601 moveTo: function(targetNode, anchorNode, callback) 601 moveTo: function(targetNode, anchorNode, callback)
602 { 602 {
603 DOMAgent.moveTo(this.id, targetNode.id, anchorNode ? anchorNode.id : und efined, WebInspector.domAgent._markRevision(this, callback)); 603 DOMAgent.moveTo(this.id, targetNode.id, anchorNode ? anchorNode.id : und efined, WebInspector.domAgent._markRevision(this, callback));
604 }, 604 },
605 605
606 /** 606 /**
607 * @return {boolean} 607 * @return {boolean}
608 */ 608 */
609 isXMLNode: function() 609 isXMLNode: function()
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 823
824 WebInspector.DOMDocument.prototype = { 824 WebInspector.DOMDocument.prototype = {
825 __proto__: WebInspector.DOMNode.prototype 825 __proto__: WebInspector.DOMNode.prototype
826 } 826 }
827 827
828 /** 828 /**
829 * @extends {WebInspector.Object} 829 * @extends {WebInspector.Object}
830 * @constructor 830 * @constructor
831 */ 831 */
832 WebInspector.DOMAgent = function() { 832 WebInspector.DOMAgent = function() {
833 /** @type {Object|undefined} */ 833 /** @type {!Object.<number, !WebInspector.DOMNode>} */
834 this._idToDOMNode = {}; 834 this._idToDOMNode = {};
835 /** @type {?WebInspector.DOMDocument} */
835 this._document = null; 836 this._document = null;
837 /** @type {!Object.<number, boolean>} */
836 this._attributeLoadNodeIds = {}; 838 this._attributeLoadNodeIds = {};
837 InspectorBackend.registerDOMDispatcher(new WebInspector.DOMDispatcher(this)) ; 839 InspectorBackend.registerDOMDispatcher(new WebInspector.DOMDispatcher(this)) ;
838 } 840 }
839 841
840 WebInspector.DOMAgent.Events = { 842 WebInspector.DOMAgent.Events = {
841 AttrModified: "AttrModified", 843 AttrModified: "AttrModified",
842 AttrRemoved: "AttrRemoved", 844 AttrRemoved: "AttrRemoved",
843 CharacterDataModified: "CharacterDataModified", 845 CharacterDataModified: "CharacterDataModified",
844 NodeInserted: "NodeInserted", 846 NodeInserted: "NodeInserted",
845 NodeRemoved: "NodeRemoved", 847 NodeRemoved: "NodeRemoved",
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 highlightConfig.marginColor = WebInspector.Color.PageHighlight.Margi n.toProtocolRGBA(); 1344 highlightConfig.marginColor = WebInspector.Color.PageHighlight.Margi n.toProtocolRGBA();
1343 1345
1344 if (mode === "all") 1346 if (mode === "all")
1345 highlightConfig.eventTargetColor = WebInspector.Color.PageHighlight. EventTarget.toProtocolRGBA(); 1347 highlightConfig.eventTargetColor = WebInspector.Color.PageHighlight. EventTarget.toProtocolRGBA();
1346 1348
1347 return highlightConfig; 1349 return highlightConfig;
1348 }, 1350 },
1349 1351
1350 /** 1352 /**
1351 * @param {WebInspector.DOMNode} node 1353 * @param {WebInspector.DOMNode} node
1352 * @param {function(?Protocol.Error)=} callback 1354 * @param {function(?Protocol.Error, A=, B=)=} callback
1353 * @return {function(?Protocol.Error)} 1355 * @return {function(?Protocol.Error, A=, B=)}
1356 * @template A,B
1354 */ 1357 */
1355 _markRevision: function(node, callback) 1358 _markRevision: function(node, callback)
1356 { 1359 {
1357 function wrapperFunction(error) 1360 function wrapperFunction(error)
1358 { 1361 {
1359 if (!error) 1362 if (!error)
1360 this.markUndoableState(); 1363 this.markUndoableState();
1361 1364
1362 if (callback) 1365 if (callback)
1363 callback.apply(this, arguments); 1366 callback.apply(this, arguments);
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
1553 shadowRootPopped: function(hostId, rootId) 1556 shadowRootPopped: function(hostId, rootId)
1554 { 1557 {
1555 this._domAgent._shadowRootPopped(hostId, rootId); 1558 this._domAgent._shadowRootPopped(hostId, rootId);
1556 } 1559 }
1557 } 1560 }
1558 1561
1559 /** 1562 /**
1560 * @type {?WebInspector.DOMAgent} 1563 * @type {?WebInspector.DOMAgent}
1561 */ 1564 */
1562 WebInspector.domAgent = null; 1565 WebInspector.domAgent = null;
OLDNEW
« no previous file with comments | « LayoutTests/inspector/elements/breadcrumb-updates.html ('k') | Source/devtools/front_end/ElementsPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698