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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 this._isInShadowTree = isInShadowTree; | 46 this._isInShadowTree = isInShadowTree; |
47 | 47 |
48 this.id = payload.nodeId; | 48 this.id = payload.nodeId; |
49 domModel._idToDOMNode[this.id] = this; | 49 domModel._idToDOMNode[this.id] = this; |
50 this._nodeType = payload.nodeType; | 50 this._nodeType = payload.nodeType; |
51 this._nodeName = payload.nodeName; | 51 this._nodeName = payload.nodeName; |
52 this._localName = payload.localName; | 52 this._localName = payload.localName; |
53 this._nodeValue = payload.nodeValue; | 53 this._nodeValue = payload.nodeValue; |
54 this._pseudoType = payload.pseudoType; | 54 this._pseudoType = payload.pseudoType; |
55 this._shadowRootType = payload.shadowRootType; | 55 this._shadowRootType = payload.shadowRootType; |
56 this._frameId = payload.frameId || null; | 56 this._frameOwnerFrameId = payload.frameId || null; |
57 this._xmlVersion = payload.xmlVersion; | 57 this._xmlVersion = payload.xmlVersion; |
58 | 58 |
59 this._shadowRoots = []; | 59 this._shadowRoots = []; |
60 | 60 |
61 this._attributes = []; | 61 this._attributes = []; |
62 this._attributesMap = {}; | 62 this._attributesMap = {}; |
63 if (payload.attributes) | 63 if (payload.attributes) |
64 this._setAttributesPayload(payload.attributes); | 64 this._setAttributesPayload(payload.attributes); |
65 | 65 |
66 /** @type {!Map<string, ?>} */ | 66 /** @type {!Map<string, ?>} */ |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 isDescendant: function(descendant) | 596 isDescendant: function(descendant) |
597 { | 597 { |
598 return descendant !== null && descendant.isAncestor(this); | 598 return descendant !== null && descendant.isAncestor(this); |
599 }, | 599 }, |
600 | 600 |
601 /** | 601 /** |
602 * @return {?PageAgent.FrameId} | 602 * @return {?PageAgent.FrameId} |
603 */ | 603 */ |
604 frameId: function() | 604 frameId: function() |
605 { | 605 { |
606 var node = this; | 606 var node = this.parentNode || this; |
607 while (!node._frameId && node.parentNode) | 607 while (!node._frameOwnerFrameId && node.parentNode) |
608 node = node.parentNode; | 608 node = node.parentNode; |
609 return node._frameId; | 609 return node._frameOwnerFrameId; |
610 }, | 610 }, |
611 | 611 |
612 /** | 612 /** |
613 * @param {!Array.<string>} attrs | 613 * @param {!Array.<string>} attrs |
614 * @return {boolean} | 614 * @return {boolean} |
615 */ | 615 */ |
616 _setAttributesPayload: function(attrs) | 616 _setAttributesPayload: function(attrs) |
617 { | 617 { |
618 var attributesChanged = !this._attributes || attrs.length !== this._attr
ibutes.length * 2; | 618 var attributesChanged = !this._attributes || attrs.length !== this._attr
ibutes.length * 2; |
619 var oldAttributesMap = this._attributesMap || {}; | 619 var oldAttributesMap = this._attributesMap || {}; |
(...skipping 1660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2280 } | 2280 } |
2281 | 2281 |
2282 /** | 2282 /** |
2283 * @param {!WebInspector.Target} target | 2283 * @param {!WebInspector.Target} target |
2284 * @return {?WebInspector.DOMModel} | 2284 * @return {?WebInspector.DOMModel} |
2285 */ | 2285 */ |
2286 WebInspector.DOMModel.fromTarget = function(target) | 2286 WebInspector.DOMModel.fromTarget = function(target) |
2287 { | 2287 { |
2288 return /** @type {?WebInspector.DOMModel} */ (target.model(WebInspector.DOMM
odel)); | 2288 return /** @type {?WebInspector.DOMModel} */ (target.model(WebInspector.DOMM
odel)); |
2289 } | 2289 } |
OLD | NEW |