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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 { | 413 { |
414 KURL url = frame().document()->url(); | 414 KURL url = frame().document()->url(); |
415 String html = frame().selection().selectedHTMLForClipboard(); | 415 String html = frame().selection().selectedHTMLForClipboard(); |
416 String plainText = frame().selectedTextForClipboard(); | 416 String plainText = frame().selectedTextForClipboard(); |
417 Pasteboard::generalPasteboard()->writeHTML(html, url, plainText, canSmartCop
yOrDelete()); | 417 Pasteboard::generalPasteboard()->writeHTML(html, url, plainText, canSmartCop
yOrDelete()); |
418 } | 418 } |
419 | 419 |
420 static PassRefPtr<Image> imageFromNode(const Node& node) | 420 static PassRefPtr<Image> imageFromNode(const Node& node) |
421 { | 421 { |
422 node.document().updateLayoutIgnorePendingStylesheets(); | 422 node.document().updateLayoutIgnorePendingStylesheets(); |
423 LayoutObject* renderer = node.layoutObject(); | 423 LayoutObject* layoutObject = node.layoutObject(); |
424 if (!renderer) | 424 if (!layoutObject) |
425 return nullptr; | 425 return nullptr; |
426 | 426 |
427 if (renderer->isCanvas()) | 427 if (layoutObject->isCanvas()) |
428 return toHTMLCanvasElement(node).copiedImage(FrontBuffer); | 428 return toHTMLCanvasElement(node).copiedImage(FrontBuffer); |
429 | 429 |
430 if (renderer->isImage()) { | 430 if (layoutObject->isImage()) { |
431 LayoutImage* layoutImage = toLayoutImage(renderer); | 431 LayoutImage* layoutImage = toLayoutImage(layoutObject); |
432 if (!layoutImage) | 432 if (!layoutImage) |
433 return nullptr; | 433 return nullptr; |
434 | 434 |
435 ImageResource* cachedImage = layoutImage->cachedImage(); | 435 ImageResource* cachedImage = layoutImage->cachedImage(); |
436 if (!cachedImage || cachedImage->errorOccurred()) | 436 if (!cachedImage || cachedImage->errorOccurred()) |
437 return nullptr; | 437 return nullptr; |
438 return cachedImage->imageForLayoutObject(layoutImage); | 438 return cachedImage->imageForLayoutObject(layoutImage); |
439 } | 439 } |
440 | 440 |
441 return nullptr; | 441 return nullptr; |
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1273 } | 1273 } |
1274 | 1274 |
1275 DEFINE_TRACE(Editor) | 1275 DEFINE_TRACE(Editor) |
1276 { | 1276 { |
1277 visitor->trace(m_frame); | 1277 visitor->trace(m_frame); |
1278 visitor->trace(m_lastEditCommand); | 1278 visitor->trace(m_lastEditCommand); |
1279 visitor->trace(m_mark); | 1279 visitor->trace(m_mark); |
1280 } | 1280 } |
1281 | 1281 |
1282 } // namespace blink | 1282 } // namespace blink |
OLD | NEW |