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 12 matching lines...) Expand all Loading... |
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 */ | 25 */ |
26 | 26 |
27 #include "core/editing/Editor.h" | 27 #include "core/editing/Editor.h" |
28 | 28 |
29 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 29 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
30 #include "core/CSSPropertyNames.h" | 30 #include "core/CSSPropertyNames.h" |
31 #include "core/EventNames.h" | 31 #include "core/EventNames.h" |
32 #include "core/HTMLNames.h" | 32 #include "core/HTMLNames.h" |
33 #include "core/XLinkNames.h" | |
34 #include "core/clipboard/DataObject.h" | 33 #include "core/clipboard/DataObject.h" |
35 #include "core/clipboard/DataTransfer.h" | 34 #include "core/clipboard/DataTransfer.h" |
36 #include "core/clipboard/Pasteboard.h" | 35 #include "core/clipboard/Pasteboard.h" |
37 #include "core/css/CSSComputedStyleDeclaration.h" | 36 #include "core/css/CSSComputedStyleDeclaration.h" |
38 #include "core/css/StylePropertySet.h" | 37 #include "core/css/StylePropertySet.h" |
39 #include "core/dom/AXObjectCache.h" | 38 #include "core/dom/AXObjectCache.h" |
40 #include "core/dom/DocumentFragment.h" | 39 #include "core/dom/DocumentFragment.h" |
41 #include "core/dom/ElementTraversal.h" | 40 #include "core/dom/ElementTraversal.h" |
42 #include "core/dom/NodeTraversal.h" | 41 #include "core/dom/NodeTraversal.h" |
43 #include "core/dom/ParserContentPolicy.h" | 42 #include "core/dom/ParserContentPolicy.h" |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 | 451 |
453 RefPtr<Image> image = imageFromNode(*node); | 452 RefPtr<Image> image = imageFromNode(*node); |
454 if (!image.get()) | 453 if (!image.get()) |
455 return; | 454 return; |
456 | 455 |
457 // FIXME: This should probably be reconciled with HitTestResult::absoluteIma
geURL. | 456 // FIXME: This should probably be reconciled with HitTestResult::absoluteIma
geURL. |
458 AtomicString urlString; | 457 AtomicString urlString; |
459 if (isHTMLImageElement(*node) || isHTMLInputElement(*node)) | 458 if (isHTMLImageElement(*node) || isHTMLInputElement(*node)) |
460 urlString = toHTMLElement(node)->getAttribute(srcAttr); | 459 urlString = toHTMLElement(node)->getAttribute(srcAttr); |
461 else if (isSVGImageElement(*node)) | 460 else if (isSVGImageElement(*node)) |
462 urlString = toSVGElement(node)->getAttribute(XLinkNames::hrefAttr); | 461 urlString = toSVGElement(node)->imageSourceURL(); |
463 else if (isHTMLEmbedElement(*node) || isHTMLObjectElement(*node) || isHTMLCa
nvasElement(*node)) | 462 else if (isHTMLEmbedElement(*node) || isHTMLObjectElement(*node) || isHTMLCa
nvasElement(*node)) |
464 urlString = toHTMLElement(node)->imageSourceURL(); | 463 urlString = toHTMLElement(node)->imageSourceURL(); |
465 KURL url = urlString.isEmpty() ? KURL() : node->document().completeURL(strip
LeadingAndTrailingHTMLSpaces(urlString)); | 464 KURL url = urlString.isEmpty() ? KURL() : node->document().completeURL(strip
LeadingAndTrailingHTMLSpaces(urlString)); |
466 | 465 |
467 pasteboard->writeImage(image.get(), url, title); | 466 pasteboard->writeImage(image.get(), url, title); |
468 } | 467 } |
469 | 468 |
470 // Returns whether caller should continue with "the default processing", which i
s the same as | 469 // Returns whether caller should continue with "the default processing", which i
s the same as |
471 // the event handler NOT setting the return value to false | 470 // the event handler NOT setting the return value to false |
472 bool Editor::dispatchCPPEvent(const AtomicString& eventType, DataTransferAccessP
olicy policy, PasteMode pasteMode) | 471 bool Editor::dispatchCPPEvent(const AtomicString& eventType, DataTransferAccessP
olicy policy, PasteMode pasteMode) |
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1380 } | 1379 } |
1381 | 1380 |
1382 DEFINE_TRACE(Editor) | 1381 DEFINE_TRACE(Editor) |
1383 { | 1382 { |
1384 visitor->trace(m_frame); | 1383 visitor->trace(m_frame); |
1385 visitor->trace(m_lastEditCommand); | 1384 visitor->trace(m_lastEditCommand); |
1386 visitor->trace(m_mark); | 1385 visitor->trace(m_mark); |
1387 } | 1386 } |
1388 | 1387 |
1389 } // namespace blink | 1388 } // namespace blink |
OLD | NEW |