Chromium Code Reviews| 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 265 shadowRootType: function() | 265 shadowRootType: function() |
| 266 { | 266 { |
| 267 return this._shadowRootType || null; | 267 return this._shadowRootType || null; |
| 268 }, | 268 }, |
| 269 | 269 |
| 270 /** | 270 /** |
| 271 * @return {string} | 271 * @return {string} |
| 272 */ | 272 */ |
| 273 nodeNameInCorrectCase: function() | 273 nodeNameInCorrectCase: function() |
| 274 { | 274 { |
| 275 var shadowRootType = this.shadowRootType(); | |
| 276 if (shadowRootType) | |
| 277 return "#shadow-root" + (shadowRootType === WebInspector.DOMNode.Sha dowRootTypes.UserAgent ? " (user-agent)" : ""); | |
| 275 return this.isXMLNode() ? this.nodeName() : this.nodeName().toLowerCase( ); | 278 return this.isXMLNode() ? this.nodeName() : this.nodeName().toLowerCase( ); |
| 276 }, | 279 }, |
| 277 | 280 |
| 278 /** | 281 /** |
| 279 * @param {string} name | 282 * @param {string} name |
| 280 * @param {function(?Protocol.Error)=} callback | 283 * @param {function(?Protocol.Error)=} callback |
| 281 */ | 284 */ |
| 282 setNodeName: function(name, callback) | 285 setNodeName: function(name, callback) |
| 283 { | 286 { |
| 284 DOMAgent.setNodeName(this.id, name, WebInspector.domAgent._markRevision( this, callback)); | 287 DOMAgent.setNodeName(this.id, name, WebInspector.domAgent._markRevision( this, callback)); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 459 eventListeners: function(objectGroupId, callback) | 462 eventListeners: function(objectGroupId, callback) |
| 460 { | 463 { |
| 461 DOMAgent.getEventListenersForNode(this.id, objectGroupId, callback); | 464 DOMAgent.getEventListenersForNode(this.id, objectGroupId, callback); |
| 462 }, | 465 }, |
| 463 | 466 |
| 464 /** | 467 /** |
| 465 * @return {string} | 468 * @return {string} |
| 466 */ | 469 */ |
| 467 path: function() | 470 path: function() |
| 468 { | 471 { |
| 472 /** | |
| 473 * @param {?WebInspector.DOMNode} node | |
| 474 */ | |
| 475 function canPush(node) | |
| 476 { | |
| 477 return node && ("index" in node || (node.isShadowRoot() && node.pare ntNode)) && node._nodeName.length; | |
| 478 } | |
| 479 | |
| 469 var path = []; | 480 var path = []; |
| 470 var node = this; | 481 var node = this; |
| 471 while (node && "index" in node && node._nodeName.length) { | 482 while (canPush(node)) { |
| 472 path.push([node.index, node._nodeName]); | 483 var index = typeof node.index === "number" ? node.index : (node.shad owRootType() === WebInspector.DOMNode.ShadowRootTypes.UserAgent ? "u" : "a"); |
|
pfeldman
2014/03/21 15:02:52
Where is this used though?
apavlov
2014/03/21 15:26:46
This is used in WebInspector.DOMNode.prototype.pat
| |
| 484 path.push([index, node._nodeName]); | |
| 473 node = node.parentNode; | 485 node = node.parentNode; |
| 474 } | 486 } |
| 475 path.reverse(); | 487 path.reverse(); |
| 476 return path.join(","); | 488 return path.join(","); |
| 477 }, | 489 }, |
| 478 | 490 |
| 479 /** | 491 /** |
| 480 * @param {!WebInspector.DOMNode} node | 492 * @param {!WebInspector.DOMNode} node |
| 481 * @return {boolean} | 493 * @return {boolean} |
| 482 */ | 494 */ |
| (...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1668 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, config, callbac k) | 1680 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, config, callbac k) |
| 1669 { | 1681 { |
| 1670 DOMAgent.setInspectModeEnabled(enabled, inspectUAShadowDOM, config, call back); | 1682 DOMAgent.setInspectModeEnabled(enabled, inspectUAShadowDOM, config, call back); |
| 1671 } | 1683 } |
| 1672 } | 1684 } |
| 1673 | 1685 |
| 1674 /** | 1686 /** |
| 1675 * @type {!WebInspector.DOMAgent} | 1687 * @type {!WebInspector.DOMAgent} |
| 1676 */ | 1688 */ |
| 1677 WebInspector.domAgent; | 1689 WebInspector.domAgent; |
| OLD | NEW |