OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> |
4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 | 304 |
305 this.performCopyOrCut(isCut, targetNode); | 305 this.performCopyOrCut(isCut, targetNode); |
306 }, | 306 }, |
307 | 307 |
308 /** | 308 /** |
309 * @param {boolean} isCut | 309 * @param {boolean} isCut |
310 * @param {?WebInspector.DOMNode} node | 310 * @param {?WebInspector.DOMNode} node |
311 */ | 311 */ |
312 performCopyOrCut: function(isCut, node) | 312 performCopyOrCut: function(isCut, node) |
313 { | 313 { |
314 if (isCut && (node.isShadowRoot() || node.ancestorUserAgentShadowRoot())
) | 314 if (isCut && (node.isShadowRoot() || node.ancestorClosedShadowRoot())) |
315 return; | 315 return; |
316 | 316 |
317 node.copyNode(); | 317 node.copyNode(); |
318 this._setClipboardData({ node: node, isCut: isCut }); | 318 this._setClipboardData({ node: node, isCut: isCut }); |
319 }, | 319 }, |
320 | 320 |
321 /** | 321 /** |
322 * @param {!WebInspector.DOMNode} targetNode | 322 * @param {!WebInspector.DOMNode} targetNode |
323 * @return {boolean} | 323 * @return {boolean} |
324 */ | 324 */ |
325 canPaste: function(targetNode) | 325 canPaste: function(targetNode) |
326 { | 326 { |
327 if (targetNode.isShadowRoot() || targetNode.ancestorUserAgentShadowRoot(
)) | 327 if (targetNode.isShadowRoot() || targetNode.ancestorClosedShadowRoot()) |
328 return false; | 328 return false; |
329 | 329 |
330 if (!this._clipboardNodeData) | 330 if (!this._clipboardNodeData) |
331 return false; | 331 return false; |
332 | 332 |
333 var node = this._clipboardNodeData.node; | 333 var node = this._clipboardNodeData.node; |
334 if (this._clipboardNodeData.isCut && (node === targetNode || node.isAnce
stor(targetNode))) | 334 if (this._clipboardNodeData.isCut && (node === targetNode || node.isAnce
stor(targetNode))) |
335 return false; | 335 return false; |
336 | 336 |
337 if (targetNode.target() !== node.target()) | 337 if (targetNode.target() !== node.target()) |
(...skipping 1841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2179 treeOutline.rootDOMNode = node; | 2179 treeOutline.rootDOMNode = node; |
2180 if (!treeOutline.children[0].hasChildren) | 2180 if (!treeOutline.children[0].hasChildren) |
2181 treeOutline._element.classList.add("single-node"); | 2181 treeOutline._element.classList.add("single-node"); |
2182 treeOutline.setVisible(true); | 2182 treeOutline.setVisible(true); |
2183 treeOutline.element.treeElementForTest = treeOutline.children[0]
; | 2183 treeOutline.element.treeElementForTest = treeOutline.children[0]
; |
2184 resolve(treeOutline.element); | 2184 resolve(treeOutline.element); |
2185 } | 2185 } |
2186 } | 2186 } |
2187 } | 2187 } |
2188 } | 2188 } |
OLD | NEW |