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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js

Issue 2206153002: DevTools: make iframe nodes report correct frame they belong to (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename + test Created 4 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
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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 }
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/elements/selected-element-changes-execution-context-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698