Beispiel #1
0
void DataTransfer::setDragImage(Element* image, int x, int y) {
  ASSERT(image);

  if (!isForDragAndDrop())
    return;

  IntPoint location(x, y);
  if (isHTMLImageElement(*image) && !image->isConnected())
    setDragImageResource(toHTMLImageElement(*image).cachedImage(), location);
  else
    setDragImageElement(image, location);
}
void DataTransfer::setDragImage(Element* image, int x, int y, ExceptionState& exceptionState)
{
    if (!isForDragAndDrop())
        return;

    if (!image) {
        exceptionState.throwTypeError("setDragImage: Invalid first argument");
        return;
    }
    IntPoint location(x, y);
    if (isHTMLImageElement(*image) && !image->inDocument())
        setDragImageResource(toHTMLImageElement(*image).cachedImage(), location);
    else
        setDragImageElement(image, location);
}