OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 exceptionState.throwTypeError("setDragImage: Invalid first argument"); | 221 exceptionState.throwTypeError("setDragImage: Invalid first argument"); |
222 return; | 222 return; |
223 } | 223 } |
224 IntPoint location(x, y); | 224 IntPoint location(x, y); |
225 if (isHTMLImageElement(*image) && !image->inDocument()) | 225 if (isHTMLImageElement(*image) && !image->inDocument()) |
226 setDragImageResource(toHTMLImageElement(*image).cachedImage(), location)
; | 226 setDragImageResource(toHTMLImageElement(*image).cachedImage(), location)
; |
227 else | 227 else |
228 setDragImageElement(image, location); | 228 setDragImageElement(image, location); |
229 } | 229 } |
230 | 230 |
| 231 void Clipboard::clearDragImage() |
| 232 { |
| 233 if (!canSetDragImage()) |
| 234 return; |
| 235 |
| 236 m_dragImage = 0; |
| 237 m_dragLoc = IntPoint(); |
| 238 m_dragImageElement = nullptr; |
| 239 } |
| 240 |
231 void Clipboard::setDragImageResource(ImageResource* img, const IntPoint& loc) | 241 void Clipboard::setDragImageResource(ImageResource* img, const IntPoint& loc) |
232 { | 242 { |
233 setDragImage(img, 0, loc); | 243 setDragImage(img, 0, loc); |
234 } | 244 } |
235 | 245 |
236 void Clipboard::setDragImageElement(Node* node, const IntPoint& loc) | 246 void Clipboard::setDragImageElement(Node* node, const IntPoint& loc) |
237 { | 247 { |
238 setDragImage(0, node, loc); | 248 setDragImage(0, node, loc); |
239 } | 249 } |
240 | 250 |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 return String("copy"); | 533 return String("copy"); |
524 } | 534 } |
525 } | 535 } |
526 | 536 |
527 void Clipboard::trace(Visitor* visitor) | 537 void Clipboard::trace(Visitor* visitor) |
528 { | 538 { |
529 visitor->trace(m_dataObject); | 539 visitor->trace(m_dataObject); |
530 } | 540 } |
531 | 541 |
532 } // namespace WebCore | 542 } // namespace WebCore |
OLD | NEW |