| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 void Clipboard::setDragImage(Element* image, int x, int y, ExceptionState& excep
tionState) | 214 void Clipboard::setDragImage(Element* image, int x, int y, ExceptionState& excep
tionState) |
| 215 { | 215 { |
| 216 if (!isForDragAndDrop()) | 216 if (!isForDragAndDrop()) |
| 217 return; | 217 return; |
| 218 | 218 |
| 219 if (!image) { | 219 if (!image) { |
| 220 exceptionState.throwTypeError("setDragImage: Invalid first argument"); | 220 exceptionState.throwTypeError("setDragImage: Invalid first argument"); |
| 221 return; | 221 return; |
| 222 } | 222 } |
| 223 IntPoint location(x, y); | 223 IntPoint location(x, y); |
| 224 if (image->hasTagName(HTMLNames::imgTag) && !image->inDocument()) | 224 if (isHTMLImageElement(*image) && !image->inDocument()) |
| 225 setDragImageResource(toHTMLImageElement(image)->cachedImage(), location)
; | 225 setDragImageResource(toHTMLImageElement(*image).cachedImage(), location)
; |
| 226 else | 226 else |
| 227 setDragImageElement(image, location); | 227 setDragImageElement(image, location); |
| 228 } | 228 } |
| 229 | 229 |
| 230 void Clipboard::setDragImageResource(ImageResource* img, const IntPoint& loc) | 230 void Clipboard::setDragImageResource(ImageResource* img, const IntPoint& loc) |
| 231 { | 231 { |
| 232 setDragImage(img, 0, loc); | 232 setDragImage(img, 0, loc); |
| 233 } | 233 } |
| 234 | 234 |
| 235 void Clipboard::setDragImageElement(Node* node, const IntPoint& loc) | 235 void Clipboard::setDragImageElement(Node* node, const IntPoint& loc) |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 return String("copy"); | 521 return String("copy"); |
| 522 } | 522 } |
| 523 } | 523 } |
| 524 | 524 |
| 525 void Clipboard::trace(Visitor* visitor) | 525 void Clipboard::trace(Visitor* visitor) |
| 526 { | 526 { |
| 527 visitor->trace(m_dataObject); | 527 visitor->trace(m_dataObject); |
| 528 } | 528 } |
| 529 | 529 |
| 530 } // namespace WebCore | 530 } // namespace WebCore |
| OLD | NEW |