| 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 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 break; | 954 break; |
| 955 ancestor = node.ancestorShadowHost(); | 955 ancestor = node.ancestorShadowHost(); |
| 956 if (!ancestor) | 956 if (!ancestor) |
| 957 break | 957 break |
| 958 // User agent shadow root, keep climbing up. | 958 // User agent shadow root, keep climbing up. |
| 959 node = ancestor; | 959 node = ancestor; |
| 960 } | 960 } |
| 961 this._agent.setInspectedNode(node.id); | 961 this._agent.setInspectedNode(node.id); |
| 962 }, | 962 }, |
| 963 | 963 |
| 964 /** |
| 965 * @return {?WebInspector.DOMNode} |
| 966 */ |
| 967 enclosingElementOrSelf: function() |
| 968 { |
| 969 var node = this; |
| 970 if (node && node.nodeType() === Node.TEXT_NODE && node.parentNode) |
| 971 node = node.parentNode; |
| 972 |
| 973 if (node && node.nodeType() !== Node.ELEMENT_NODE) |
| 974 node = null; |
| 975 return node; |
| 976 }, |
| 977 |
| 964 __proto__: WebInspector.SDKObject.prototype | 978 __proto__: WebInspector.SDKObject.prototype |
| 965 } | 979 } |
| 966 | 980 |
| 967 /** | 981 /** |
| 968 * @param {!WebInspector.Target} target | 982 * @param {!WebInspector.Target} target |
| 969 * @param {number} backendNodeId | 983 * @param {number} backendNodeId |
| 970 * @constructor | 984 * @constructor |
| 971 */ | 985 */ |
| 972 WebInspector.DeferredDOMNode = function(target, backendNodeId) | 986 WebInspector.DeferredDOMNode = function(target, backendNodeId) |
| 973 { | 987 { |
| (...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2263 } | 2277 } |
| 2264 | 2278 |
| 2265 /** | 2279 /** |
| 2266 * @param {!WebInspector.Target} target | 2280 * @param {!WebInspector.Target} target |
| 2267 * @return {?WebInspector.DOMModel} | 2281 * @return {?WebInspector.DOMModel} |
| 2268 */ | 2282 */ |
| 2269 WebInspector.DOMModel.fromTarget = function(target) | 2283 WebInspector.DOMModel.fromTarget = function(target) |
| 2270 { | 2284 { |
| 2271 return /** @type {?WebInspector.DOMModel} */ (target.model(WebInspector.DOMM
odel)); | 2285 return /** @type {?WebInspector.DOMModel} */ (target.model(WebInspector.DOMM
odel)); |
| 2272 } | 2286 } |
| OLD | NEW |