OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
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 | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 | 473 |
474 static PassRefPtr<Image> imageFromNode(const Node& node) { | 474 static PassRefPtr<Image> imageFromNode(const Node& node) { |
475 DCHECK(!node.document().needsLayoutTreeUpdate()); | 475 DCHECK(!node.document().needsLayoutTreeUpdate()); |
476 DocumentLifecycle::DisallowTransitionScope disallowTransition( | 476 DocumentLifecycle::DisallowTransitionScope disallowTransition( |
477 node.document().lifecycle()); | 477 node.document().lifecycle()); |
478 | 478 |
479 LayoutObject* layoutObject = node.layoutObject(); | 479 LayoutObject* layoutObject = node.layoutObject(); |
480 if (!layoutObject) | 480 if (!layoutObject) |
481 return nullptr; | 481 return nullptr; |
482 | 482 |
483 if (layoutObject->isCanvas()) | 483 if (layoutObject->isCanvas()) { |
484 return toHTMLCanvasElement(node).copiedImage(FrontBuffer, | 484 return toHTMLCanvasElement(node).copiedImage( |
485 PreferNoAcceleration); | 485 FrontBuffer, PreferNoAcceleration, SnapshotReasonCopyToClipboard); |
| 486 } |
486 | 487 |
487 if (layoutObject->isImage()) { | 488 if (layoutObject->isImage()) { |
488 LayoutImage* layoutImage = toLayoutImage(layoutObject); | 489 LayoutImage* layoutImage = toLayoutImage(layoutObject); |
489 if (!layoutImage) | 490 if (!layoutImage) |
490 return nullptr; | 491 return nullptr; |
491 | 492 |
492 ImageResource* cachedImage = layoutImage->cachedImage(); | 493 ImageResource* cachedImage = layoutImage->cachedImage(); |
493 if (!cachedImage || cachedImage->errorOccurred()) | 494 if (!cachedImage || cachedImage->errorOccurred()) |
494 return nullptr; | 495 return nullptr; |
495 return cachedImage->getImage(); | 496 return cachedImage->getImage(); |
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1660 } | 1661 } |
1661 | 1662 |
1662 DEFINE_TRACE(Editor) { | 1663 DEFINE_TRACE(Editor) { |
1663 visitor->trace(m_frame); | 1664 visitor->trace(m_frame); |
1664 visitor->trace(m_lastEditCommand); | 1665 visitor->trace(m_lastEditCommand); |
1665 visitor->trace(m_undoStack); | 1666 visitor->trace(m_undoStack); |
1666 visitor->trace(m_mark); | 1667 visitor->trace(m_mark); |
1667 } | 1668 } |
1668 | 1669 |
1669 } // namespace blink | 1670 } // namespace blink |
OLD | NEW |