[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.18-1-697-g2f78b87
bweinstein at apple.com
bweinstein at apple.com
Wed Jan 20 22:24:54 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit b99e126423994b3063cf026128990af8a23a18b5
Author: bweinstein at apple.com <bweinstein at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jan 15 00:06:18 2010 +0000
Drag and Drop source/destination code needs cleanup.
<https://bugs.webkit.org/show_bug.cgi?id=33691>.
Reviewed by Adam Roben.
WebCore:
Cleaned up some Drag and Drop code that deals with getting
source and destination operations, and added some ASSERTS to make
sure we don't get in bad states.
* dom/Clipboard.cpp:
(WebCore::Clipboard::sourceOperation): Make this return the operation itself.
(WebCore::Clipboard::destinationOperation): Ditto.
(WebCore::Clipboard::setSourceOperation): Add an assert to make sure we're valud.
(WebCore::Clipboard::setDestinationOperation): Ditto.
* dom/Clipboard.h:
* page/DragController.cpp:
(WebCore::DragController::tryDHTMLDrag):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleDrag):
WebKit/chromium:
Update to new way of calling sourceOperation.
* src/DragClientImpl.cpp:
(WebKit::DragClientImpl::startDrag):
WebKit/qt:
Update to new way of calling sourceOperation.
* WebCoreSupport/DragClientQt.cpp:
(WebCore::DragClientQt::startDrag):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 29b12eb..c125082 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-01-14 Brian Weinstein <bweinstein at apple.com>
+
+ Reviewed by Adam Roben.
+
+ Drag and Drop source/destination code needs cleanup.
+ <https://bugs.webkit.org/show_bug.cgi?id=33691>.
+
+ Cleaned up some Drag and Drop code that deals with getting
+ source and destination operations, and added some ASSERTS to make
+ sure we don't get in bad states.
+
+ * dom/Clipboard.cpp:
+ (WebCore::Clipboard::sourceOperation): Make this return the operation itself.
+ (WebCore::Clipboard::destinationOperation): Ditto.
+ (WebCore::Clipboard::setSourceOperation): Add an assert to make sure we're valud.
+ (WebCore::Clipboard::setDestinationOperation): Ditto.
+ * dom/Clipboard.h:
+ * page/DragController.cpp:
+ (WebCore::DragController::tryDHTMLDrag):
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::handleDrag):
+
2010-01-14 Timothy Hatcher <timothy at apple.com>
Make the Web Inspector's JavaScript debugger work with isolated worlds.
diff --git a/WebCore/dom/Clipboard.cpp b/WebCore/dom/Clipboard.cpp
index 64c70d0..4d8fa96 100644
--- a/WebCore/dom/Clipboard.cpp
+++ b/WebCore/dom/Clipboard.cpp
@@ -100,27 +100,29 @@ static String IEOpFromDragOp(DragOperation op)
return "none";
}
-bool Clipboard::sourceOperation(DragOperation& op) const
+DragOperation Clipboard::sourceOperation() const
{
- op = dragOpFromIEOp(m_effectAllowed);
+ DragOperation op = dragOpFromIEOp(m_effectAllowed);
ASSERT(op != DragOperationPrivate);
- return true;
+ return op;
}
-bool Clipboard::destinationOperation(DragOperation& op) const
+DragOperation Clipboard::destinationOperation() const
{
- op = dragOpFromIEOp(m_dropEffect);
- ASSERT(op == DragOperationCopy || op == DragOperationNone || op == DragOperationLink || op == DragOperationMove);
- return true;
+ DragOperation op = dragOpFromIEOp(m_dropEffect);
+ ASSERT_ARG(op, op == DragOperationCopy || op == DragOperationNone || op == DragOperationLink || op == DragOperationGeneric);
+ return op;
}
void Clipboard::setSourceOperation(DragOperation op)
{
+ ASSERT_ARG(op, op != DragOperationPrivate);
m_effectAllowed = IEOpFromDragOp(op);
}
void Clipboard::setDestinationOperation(DragOperation op)
{
+ ASSERT(op == DragOperationCopy || op == DragOperationNone || op == DragOperationLink || op == DragOperationMove);
m_dropEffect = IEOpFromDragOp(op);
}
diff --git a/WebCore/dom/Clipboard.h b/WebCore/dom/Clipboard.h
index f6c09b2..042cd82 100644
--- a/WebCore/dom/Clipboard.h
+++ b/WebCore/dom/Clipboard.h
@@ -74,8 +74,8 @@ namespace WebCore {
void setAccessPolicy(ClipboardAccessPolicy);
- bool sourceOperation(DragOperation&) const;
- bool destinationOperation(DragOperation&) const;
+ DragOperation sourceOperation() const;
+ DragOperation destinationOperation() const;
void setSourceOperation(DragOperation);
void setDestinationOperation(DragOperation);
diff --git a/WebCore/page/DragController.cpp b/WebCore/page/DragController.cpp
index 634595a..bde38bc 100644
--- a/WebCore/page/DragController.cpp
+++ b/WebCore/page/DragController.cpp
@@ -482,21 +482,6 @@ bool DragController::canProcessDrag(DragData* dragData)
return true;
}
-static DragOperation defaultOperationForDrag(DragOperation srcOpMask)
-{
- // This is designed to match IE's operation fallback for the case where
- // the page calls preventDefault() in a drag event but doesn't set dropEffect.
- if (srcOpMask & DragOperationCopy)
- return DragOperationCopy;
- if (srcOpMask & DragOperationMove || srcOpMask & DragOperationGeneric)
- return DragOperationMove;
- if (srcOpMask & DragOperationLink)
- return DragOperationLink;
-
- // FIXME: Does IE really return "generic" even if no operations were allowed by the source?
- return DragOperationGeneric;
-}
-
bool DragController::tryDHTMLDrag(DragData* dragData, DragOperation& operation)
{
ASSERT(dragData);
@@ -517,10 +502,8 @@ bool DragController::tryDHTMLDrag(DragData* dragData, DragOperation& operation)
return false;
}
- if (!clipboard->destinationOperation(operation)) {
- // The element accepted but they didn't pick an operation, so we pick one (to match IE).
- operation = defaultOperationForDrag(srcOpMask);
- } else if (!(srcOpMask & operation)) {
+ operation = clipboard->destinationOperation();
+ if (!(srcOpMask & operation)) {
// The element picked an operation which is not supported by the source
operation = DragOperationNone;
}
diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp
index add5ade..e99720e 100644
--- a/WebCore/page/EventHandler.cpp
+++ b/WebCore/page/EventHandler.cpp
@@ -2333,7 +2333,7 @@ bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event)
if (m_mouseDownMayStartDrag) {
// gather values from DHTML element, if it set any
- dragState().m_dragClipboard->sourceOperation(srcOp);
+ srcOp = dragState().m_dragClipboard->sourceOperation();
// Yuck, a draggedImage:moveTo: message can be fired as a result of kicking off the
// drag with dragImage! Because of that dumb reentrancy, we may think we've not
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index d55647e..3f56683 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,15 @@
+2010-01-14 Brian Weinstein <bweinstein at apple.com>
+
+ Reviewed by Adam Roben.
+
+ Drag and Drop source/destination code needs cleanup.
+ <https://bugs.webkit.org/show_bug.cgi?id=33691>.
+
+ Update to new way of calling sourceOperation.
+
+ * src/DragClientImpl.cpp:
+ (WebKit::DragClientImpl::startDrag):
+
2010-01-14 Nate Chapin <japhet at chromium.org>
Reviewed by Dimitri Glazkov.
diff --git a/WebKit/chromium/src/DragClientImpl.cpp b/WebKit/chromium/src/DragClientImpl.cpp
index 5d8a9c3..671e7ca 100644
--- a/WebKit/chromium/src/DragClientImpl.cpp
+++ b/WebKit/chromium/src/DragClientImpl.cpp
@@ -79,9 +79,7 @@ void DragClientImpl::startDrag(DragImageRef dragImage,
WebDragData dragData = static_cast<ClipboardChromium*>(clipboard)->dataObject();
- DragOperation dragOperationMask;
- if (!clipboard->sourceOperation(dragOperationMask))
- dragOperationMask = DragOperationEvery;
+ DragOperation dragOperationMask = clipboard->sourceOperation();
m_webView->startDragging(
eventPos, dragData, static_cast<WebDragOperationsMask>(dragOperationMask));
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index b74b34b..62f2b64 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,15 @@
+2010-01-14 Brian Weinstein <bweinstein at apple.com>
+
+ Reviewed by Adam Roben.
+
+ Drag and Drop source/destination code needs cleanup.
+ <https://bugs.webkit.org/show_bug.cgi?id=33691>.
+
+ Update to new way of calling sourceOperation.
+
+ * WebCoreSupport/DragClientQt.cpp:
+ (WebCore::DragClientQt::startDrag):
+
2010-01-14 Simon Hausmann <simon.hausmann at nokia.com>
Reviewed by Tor Arne Vestbø.
diff --git a/WebKit/qt/WebCoreSupport/DragClientQt.cpp b/WebKit/qt/WebCoreSupport/DragClientQt.cpp
index a50bc5e..e48c3e3 100644
--- a/WebKit/qt/WebCoreSupport/DragClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/DragClientQt.cpp
@@ -96,8 +96,7 @@ void DragClientQt::startDrag(DragImageRef, const IntPoint&, const IntPoint&, Cli
QDrag *drag = new QDrag(view);
if (clipboardData && clipboardData->hasImage())
drag->setPixmap(qvariant_cast<QPixmap>(clipboardData->imageData()));
- DragOperation dragOperationMask = DragOperationEvery;
- clipboard->sourceOperation(dragOperationMask);
+ DragOperation dragOperationMask = clipboard->sourceOperation();
drag->setMimeData(clipboardData);
Qt::DropAction actualDropAction = drag->exec(dragOperationsToDropActions(dragOperationMask));
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list