Changeset 99108 in webkit
- Timestamp:
- Nov 2, 2011 3:32:26 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 35 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r99105 r99108 1 2011-11-02 Jon Lee <jonlee@apple.com> 2 3 Expand DragController to provide more information about the dragging session 4 https://bugs.webkit.org/show_bug.cgi?id=71324 5 <rdar://problem/10379175> 6 7 Reviewed by Darin Adler. 8 9 * editing/pasteboard/script-tests/file-input-files-access.js: 10 (runTest): Change the expected behavior of the test-- dragging a file over a disabled 11 control should not load that file. Instead, the file should be ignored, and the page 12 remains as is. 13 1 14 2011-11-02 Tony Chang <tony@chromium.org> 2 15 -
trunk/LayoutTests/editing/pasteboard/script-tests/file-input-files-access.js
r74510 r99108 111 111 debug("Dragging to a disabled file input control:"); 112 112 fileInput.disabled = true; 113 window.onbeforeunload = function() { 114 // Since the drop triggered a navigation, verify the properties of the file input here. 115 shouldBeEqualToString("fileInput.value", ""); 116 filesShouldBe([]); 117 shouldBeTrue("successfullyParsed"); 118 debug('<br /><span class="pass">TEST COMPLETE</span>'); 113 draggingPathsShouldResultInFiles(['DRTFakeFile'], []); 119 114 120 121 115 // Clean up after ourselves 116 fileInput.parentNode.removeChild(fileInput); 122 117 123 layoutTestController.notifyDone(); 124 125 window.onbeforeunload = null; 126 }; 127 draggingPathsShouldResultInFiles(['DRTFakeFile'], []); 128 testFailed("The final test case should have resulted in navigation"); 118 layoutTestController.notifyDone(); 129 119 } 130 120 -
trunk/Source/WebCore/ChangeLog
r99104 r99108 1 2011-11-02 Jon Lee <jonlee@apple.com> 2 3 Expand DragController to provide more information about the dragging session 4 https://bugs.webkit.org/show_bug.cgi?id=71324 5 <rdar://problem/10379175> 6 7 Reviewed by Darin Adler. 8 9 * WebCore.xcodeproj/project.pbxproj: 10 * page/DragController.cpp: 11 (WebCore::DragController::dragEntered): 12 (WebCore::DragController::dragUpdated): 13 (WebCore::DragController::dragEnteredOrUpdated): 14 (WebCore::DragController::tryDocumentDrag): In addition to determining the 15 drag operation, DragSession is updated with data regarding whether the mouse 16 is over a file input, and the number of items that would be accepted based on 17 the mouse's location. 18 * page/DragController.h: 19 * page/DragSession.h: Added. 20 (WebCore::DragSession::DragSession): Keep track of current operation, whether 21 the mouse is over a file input element, and how many files would be accepted if 22 dropped. 23 * platform/DragData.h: Added numberOfFiles() 24 * platform/chromium/DragDataChromium.cpp: 25 (WebCore::DragData::numberOfFiles): 26 * platform/efl/DragDataEfl.cpp: 27 (WebCore::DragData::numberOfFiles): 28 * platform/gtk/DragDataGtk.cpp: 29 (WebCore::DragData::numberOfFiles): 30 * platform/mac/DragDataMac.mm: 31 (WebCore::DragData::numberOfFiles): 32 * platform/qt/DragDataQt.cpp: 33 (WebCore::DragData::numberOfFiles): 34 * platform/win/DragDataWin.cpp: 35 (WebCore::DragData::numberOfFiles): 36 * platform/wince/DragDataWinCE.cpp: 37 (WebCore::DragData::numberOfFiles): 38 * platform/wx/DragDataWx.cpp: 39 (WebCore::DragData::numberOfFiles): 40 1 41 2011-11-02 Alexey Proskuryakov <ap@apple.com> 2 42 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r98853 r99108 779 779 31611E620E1C4E1400F6A579 /* DOMWebKitCSSTransformValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31611E5F0E1C4E1400F6A579 /* DOMWebKitCSSTransformValue.mm */; }; 780 780 31611E630E1C4E1400F6A579 /* DOMWebKitCSSTransformValueInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 31611E600E1C4E1400F6A579 /* DOMWebKitCSSTransformValueInternal.h */; }; 781 3169379C14609C6C00C01362 /* DragSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 3169379A14609C5B00C01362 /* DragSession.h */; settings = {ATTRIBUTES = (Private, ); }; }; 781 782 316FE0710E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 316FE06D0E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.cpp */; }; 782 783 316FE0720E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 316FE06E0E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.h */; }; … … 7856 7857 31611E5F0E1C4E1400F6A579 /* DOMWebKitCSSTransformValue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMWebKitCSSTransformValue.mm; sourceTree = "<group>"; }; 7857 7858 31611E600E1C4E1400F6A579 /* DOMWebKitCSSTransformValueInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWebKitCSSTransformValueInternal.h; sourceTree = "<group>"; }; 7859 3169379A14609C5B00C01362 /* DragSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragSession.h; sourceTree = "<group>"; }; 7858 7860 316FE06D0E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitCSSKeyframeRule.cpp; sourceTree = "<group>"; }; 7859 7861 316FE06E0E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitCSSKeyframeRule.h; sourceTree = "<group>"; }; … … 15438 15440 A7CA595B0B27BD9E00FA021D /* DragController.h */, 15439 15441 81F65FF513788FAA00FF6F2D /* DragState.h */, 15442 3169379A14609C5B00C01362 /* DragSession.h */, 15440 15443 1AF326770D78B9440068F0C4 /* EditorClient.h */, 15441 15444 93C09A800B064F00005ABD4D /* EventHandler.cpp */, … … 24542 24545 FD62F52E145898D80094B0ED /* AudioSourceProviderClient.h in Headers */, 24543 24546 2D8FEBDD143E3EF70072502B /* CSSCrossfadeValue.h in Headers */, 24547 3169379C14609C6C00C01362 /* DragSession.h in Headers */, 24544 24548 ); 24545 24549 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebCore/page/DragController.cpp
r99085 r99108 37 37 #include "DragClient.h" 38 38 #include "DragData.h" 39 #include "DragSession.h" 39 40 #include "Editor.h" 40 41 #include "EditorClient.h" … … 163 164 } 164 165 165 Drag Operation DragController::dragEntered(DragData* dragData)166 DragSession DragController::dragEntered(DragData* dragData) 166 167 { 167 168 return dragEnteredOrUpdated(dragData); … … 183 184 } 184 185 185 Drag Operation DragController::dragUpdated(DragData* dragData)186 DragSession DragController::dragUpdated(DragData* dragData) 186 187 { 187 188 return dragEnteredOrUpdated(dragData); … … 233 234 } 234 235 235 Drag Operation DragController::dragEnteredOrUpdated(DragData* dragData)236 DragSession DragController::dragEnteredOrUpdated(DragData* dragData) 236 237 { 237 238 ASSERT(dragData); … … 242 243 if (m_dragDestinationAction == DragDestinationActionNone) { 243 244 cancelDrag(); // FIXME: Why not call mouseMovedIntoDocument(0)? 244 return Drag OperationNone;245 } 246 247 Drag Operation operation = DragOperationNone;248 bool handledByDocument = tryDocumentDrag(dragData, m_dragDestinationAction, operation);245 return DragSession(); 246 } 247 248 DragSession dragSession; 249 bool handledByDocument = tryDocumentDrag(dragData, m_dragDestinationAction, dragSession); 249 250 if (!handledByDocument && (m_dragDestinationAction & DragDestinationActionLoad)) 250 returnoperationForLoad(dragData);251 return operation;251 dragSession.operation = operationForLoad(dragData); 252 return dragSession; 252 253 } 253 254 … … 285 286 } 286 287 287 bool DragController::tryDocumentDrag(DragData* dragData, DragDestinationAction actionMask, Drag Operation& operation)288 bool DragController::tryDocumentDrag(DragData* dragData, DragDestinationAction actionMask, DragSession& dragSession) 288 289 { 289 290 ASSERT(dragData); … … 297 298 m_isHandlingDrag = false; 298 299 if (actionMask & DragDestinationActionDHTML) { 299 m_isHandlingDrag = tryDHTMLDrag(dragData, operation);300 m_isHandlingDrag = tryDHTMLDrag(dragData, dragSession.operation); 300 301 // Do not continue if m_documentUnderMouse has been reset by tryDHTMLDrag. 301 302 // tryDHTMLDrag fires dragenter event. The event listener that listens … … 318 319 } else if ((actionMask & DragDestinationActionEdit) && canProcessDrag(dragData)) { 319 320 if (dragData->containsColor()) { 320 operation = DragOperationGeneric;321 dragSession.operation = DragOperationGeneric; 321 322 return true; 322 323 } … … 326 327 if (!element) 327 328 return false; 328 if (!asFileInput(element)) 329 330 HTMLInputElement* elementAsFileInput = asFileInput(element); 331 if (!elementAsFileInput) 329 332 m_page->dragCaretController()->setCaretPosition(m_documentUnderMouse->frame()->visiblePositionForPoint(point)); 330 333 331 334 Frame* innerFrame = element->document()->frame(); 332 operation = dragIsMove(innerFrame->selection(), dragData) ? DragOperationMove : DragOperationCopy; 335 dragSession.operation = dragIsMove(innerFrame->selection(), dragData) ? DragOperationMove : DragOperationCopy; 336 dragSession.mouseIsOverFileInput = elementAsFileInput; 337 dragSession.numberOfItemsToBeAccepted = 0; 338 339 unsigned numberOfFiles = dragData->numberOfFiles(); 340 if (elementAsFileInput) { 341 if (elementAsFileInput->disabled()) 342 dragSession.numberOfItemsToBeAccepted = 0; 343 else if (elementAsFileInput->multiple()) 344 dragSession.numberOfItemsToBeAccepted = numberOfFiles; 345 else 346 dragSession.numberOfItemsToBeAccepted = 1; 347 348 if (!dragSession.numberOfItemsToBeAccepted) 349 dragSession.operation = DragOperationNone; 350 } else { 351 // We are not over a file input element. The dragged item(s) will only 352 // be loaded into the view the number of dragged items is 1. 353 dragSession.numberOfItemsToBeAccepted = numberOfFiles != 1 ? 0 : 1; 354 } 355 333 356 return true; 334 357 } -
trunk/Source/WebCore/page/DragController.h
r86472 r99108 38 38 class DragClient; 39 39 class DragData; 40 struct DragSession; 40 41 struct DragState; 41 42 class Element; … … 56 57 DragClient* client() const { return m_client; } 57 58 58 Drag Operation dragEntered(DragData*);59 DragSession dragEntered(DragData*); 59 60 void dragExited(DragData*); 60 Drag Operation dragUpdated(DragData*);61 DragSession dragUpdated(DragData*); 61 62 bool performDrag(DragData*); 62 63 … … 95 96 bool canProcessDrag(DragData*); 96 97 bool concludeEditDrag(DragData*); 97 Drag Operation dragEnteredOrUpdated(DragData*);98 DragSession dragEnteredOrUpdated(DragData*); 98 99 DragOperation operationForLoad(DragData*); 99 bool tryDocumentDrag(DragData*, DragDestinationAction, Drag Operation&);100 bool tryDocumentDrag(DragData*, DragDestinationAction, DragSession&); 100 101 bool tryDHTMLDrag(DragData*, DragOperation&); 101 102 DragOperation dragOperation(DragData*); -
trunk/Source/WebCore/page/DragSession.h
r99107 r99108 1 1 /* 2 * Copyright (C) 20 07, 2008Apple Inc. All rights reserved.2 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #i nclude "config.h"27 # include "DragData.h"26 #ifndef DragSession_h 27 #define DragSession_h 28 28 29 #include "Document.h" 30 #include "DocumentFragment.h" 31 #include "Range.h" 29 #include "DragActions.h" 32 30 33 31 namespace WebCore { 32 33 struct DragSession { 34 DragOperation operation; 35 bool mouseIsOverFileInput; 36 unsigned numberOfItemsToBeAccepted; 34 37 35 bool DragData::canSmartReplace() const 36 { 37 return false;38 } 39 40 bool DragData::containsColor() const 41 { 42 return false; 38 DragSession() 39 : operation(DragOperationNone) 40 , mouseIsOverFileInput(false) 41 , numberOfItemsToBeAccepted(0) 42 { 43 } 44 }; 45 43 46 } 44 47 45 bool DragData::containsFiles() const 46 { 47 return false; 48 } 49 50 void DragData::asFilenames(Vector<String>& result) const 51 { 52 } 53 54 bool DragData::containsPlainText() const 55 { 56 return false; 57 } 58 59 String DragData::asPlainText(Frame*) const 60 { 61 return String(); 62 } 63 64 Color DragData::asColor() const 65 { 66 return Color(); 67 } 68 69 bool DragData::containsCompatibleContent() const 70 { 71 return false; 72 } 73 74 bool DragData::containsURL(Frame*, FilenameConversionPolicy filenamePolicy) const 75 { 76 return false; 77 } 78 79 String DragData::asURL(Frame*, FilenameConversionPolicy filenamePolicy, String* title) const 80 { 81 return String(); 82 } 83 84 85 PassRefPtr<DocumentFragment> DragData::asFragment(Frame*, PassRefPtr<Range>, bool, bool&) const 86 { 87 return 0; 88 } 89 90 } 91 48 #endif -
trunk/Source/WebCore/platform/DragData.h
r97012 r99108 117 117 bool containsColor() const; 118 118 bool containsFiles() const; 119 unsigned numberOfFiles() const; 119 120 #if PLATFORM(MAC) 120 121 NSPasteboard *pasteboard() { return m_pasteboard.get(); } -
trunk/Source/WebCore/platform/chromium/DragDataChromium.cpp
r95901 r99108 72 72 { 73 73 return m_platformDragData->containsFilenames(); 74 } 75 76 unsigned DragData::numberOfFiles() const 77 { 78 return m_platformDragData->filenames().size(); 74 79 } 75 80 -
trunk/Source/WebCore/platform/efl/DragDataEfl.cpp
r95901 r99108 42 42 } 43 43 44 unsigned DragData::numberOfFiles() const 45 { 46 return 0; 47 } 48 44 49 void DragData::asFilenames(Vector<String>& result) const 45 50 { -
trunk/Source/WebCore/platform/gtk/DragDataGtk.cpp
r76039 r99108 40 40 { 41 41 return m_platformDragData->hasFilenames(); 42 } 43 44 unsigned DragData::numberOfFiles() const 45 { 46 return m_platformDragData->filenames().size(); 42 47 } 43 48 -
trunk/Source/WebCore/platform/mac/DragDataMac.mm
r85036 r99108 75 75 { 76 76 return [[m_pasteboard.get() types] containsObject:NSFilenamesPboardType]; 77 } 78 79 unsigned DragData::numberOfFiles() const 80 { 81 if (![[m_pasteboard.get() types] containsObject:NSFilenamesPboardType]) 82 return 0; 83 return [[m_pasteboard.get() propertyListForType:NSFilenamesPboardType] count]; 77 84 } 78 85 -
trunk/Source/WebCore/platform/qt/DragDataQt.cpp
r78438 r99108 61 61 } 62 62 return false; 63 } 64 65 unsigned DragData::numberOfFiles() const 66 { 67 return 0; 63 68 } 64 69 -
trunk/Source/WebCore/platform/win/DragDataWin.cpp
r86477 r99108 111 111 } 112 112 113 unsigned DragData::numberOfFiles() const 114 { 115 return 0; 116 } 117 113 118 void DragData::asFilenames(Vector<String>& result) const 114 119 { -
trunk/Source/WebCore/platform/wince/DragDataWinCE.cpp
r76854 r99108 48 48 } 49 49 50 unsigned DragData::numberOfFiles() const 51 { 52 return 0; 53 } 54 50 55 void DragData::asFilenames(Vector<String>&) const 51 56 { -
trunk/Source/WebCore/platform/wx/DragDataWx.cpp
r80287 r99108 48 48 } 49 49 50 unsigned DragData::numberOfFiles() const 51 { 52 return 0; 53 } 54 50 55 void DragData::asFilenames(Vector<String>& result) const 51 56 { -
trunk/Source/WebKit/chromium/ChangeLog
r99100 r99108 1 2011-11-02 Jon Lee <jonlee@apple.com> 2 3 Expand DragController to provide more information about the dragging session 4 https://bugs.webkit.org/show_bug.cgi?id=71324 5 <rdar://problem/10379175> 6 7 Reviewed by Darin Adler. 8 9 * src/WebViewImpl.cpp: 10 (WebKit::WebViewImpl::dragTargetDragEnterOrOver): The drag operation is contained 11 within the new DragSession struct. Minor refactor. 12 1 13 2011-10-31 Nat Duca <nduca@chromium.org> 2 14 -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r99033 r99108 51 51 #include "DragData.h" 52 52 #include "DragScrollTimer.h" 53 #include "DragSession.h" 53 54 #include "Editor.h" 54 55 #include "EventHandler.h" … … 2068 2069 static_cast<DragOperation>(m_operationsAllowed)); 2069 2070 2070 Drag Operation dropEffect;2071 DragSession dragSession; 2071 2072 if (dragAction == DragEnter) 2072 dr opEffect= m_page->dragController()->dragEntered(&dragData);2073 dragSession = m_page->dragController()->dragEntered(&dragData); 2073 2074 else 2074 dropEffect = m_page->dragController()->dragUpdated(&dragData); 2075 dragSession = m_page->dragController()->dragUpdated(&dragData); 2076 2077 DragOperation dropEffect = dragSession.operation; 2075 2078 2076 2079 // Mask the drop effect operation against the drag source's allowed operations. -
trunk/Source/WebKit/gtk/ChangeLog
r99096 r99108 1 2011-11-02 Jon Lee <jonlee@apple.com> 2 3 Expand DragController to provide more information about the dragging session 4 https://bugs.webkit.org/show_bug.cgi?id=71324 5 <rdar://problem/10379175> 6 7 Reviewed by Darin Adler. 8 9 * webkit/webkitwebview.cpp: 10 (webkit_web_view_drag_motion): Minor refactoring. 11 (webkit_web_view_drag_data_received): Minor refactoring. 12 1 13 2011-11-02 Tom Sepez <tsepez@chromium.org> 2 14 -
trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp
r98827 r99108 48 48 #include "DragController.h" 49 49 #include "DragData.h" 50 #include "DragSession.h" 50 51 #include "DumpRenderTreeSupportGtk.h" 51 52 #include "Editor.h" … … 1442 1443 return TRUE; 1443 1444 1444 DragOperation operation = core(webView)->dragController()->dragUpdated(dragData.get()) ;1445 DragOperation operation = core(webView)->dragController()->dragUpdated(dragData.get()).operation; 1445 1446 gdk_drag_status(context, dragOperationToSingleGdkDragAction(operation), time); 1446 1447 return TRUE; … … 1454 1455 return; 1455 1456 1456 DragOperation operation = core(webView)->dragController()->dragEntered(dragData.get()) ;1457 DragOperation operation = core(webView)->dragController()->dragEntered(dragData.get()).operation; 1457 1458 gdk_drag_status(context, dragOperationToSingleGdkDragAction(operation), time); 1458 1459 } -
trunk/Source/WebKit/mac/ChangeLog
r99096 r99108 1 2011-11-02 Jon Lee <jonlee@apple.com> 2 3 Expand DragController to provide more information about the dragging session 4 https://bugs.webkit.org/show_bug.cgi?id=71324 5 <rdar://problem/10379175> 6 7 Reviewed by Darin Adler. 8 9 * WebView/WebView.mm: 10 (-[WebView draggingEntered:]): DragOperation is now inside the DragSession struct. 11 (-[WebView draggingUpdated:]): 12 1 13 2011-11-02 Tom Sepez <tsepez@chromium.org> 2 14 -
trunk/Source/WebKit/mac/WebView/WebView.mm
r99096 r99108 118 118 #import <WebCore/DragController.h> 119 119 #import <WebCore/DragData.h> 120 #import <WebCore/DragSession.h> 120 121 #import <WebCore/Editor.h> 121 122 #import <WebCore/EventHandler.h> … … 3866 3867 IntPoint global(globalPoint([draggingInfo draggingLocation], [self window])); 3867 3868 DragData dragData(draggingInfo, client, global, static_cast<DragOperation>([draggingInfo draggingSourceOperationMask]), [self applicationFlags:draggingInfo]); 3868 return core(self)->dragController()->dragEntered(&dragData) ;3869 return core(self)->dragController()->dragEntered(&dragData).operation; 3869 3870 } 3870 3871 … … 3878 3879 IntPoint global(globalPoint([draggingInfo draggingLocation], [self window])); 3879 3880 DragData dragData(draggingInfo, client, global, static_cast<DragOperation>([draggingInfo draggingSourceOperationMask]), [self applicationFlags:draggingInfo]); 3880 return page->dragController()->dragUpdated(&dragData) ;3881 return page->dragController()->dragUpdated(&dragData).operation; 3881 3882 } 3882 3883 -
trunk/Source/WebKit/qt/Api/qwebpage.cpp
r98951 r99108 52 52 #include "DragController.h" 53 53 #include "DragData.h" 54 #include "DragSession.h" 54 55 #include "Editor.h" 55 56 #include "EditorClientQt.h" … … 992 993 DragData dragData(ev->mimeData(), QPointF(ev->pos()).toPoint(), 993 994 QCursor::pos(), dropActionToDragOp(ev->possibleActions())); 994 Qt::DropAction action = dragOpToDropAction(page->dragController()->dragEntered(&dragData) );995 Qt::DropAction action = dragOpToDropAction(page->dragController()->dragEntered(&dragData).operation); 995 996 ev->setDropAction(action); 996 997 ev->acceptProposedAction(); … … 1014 1015 DragData dragData(ev->mimeData(), QPointF(ev->pos()).toPoint(), 1015 1016 QCursor::pos(), dropActionToDragOp(ev->possibleActions())); 1016 m_lastDropAction = dragOpToDropAction(page->dragController()->dragUpdated(&dragData) );1017 m_lastDropAction = dragOpToDropAction(page->dragController()->dragUpdated(&dragData).operation); 1017 1018 ev->setDropAction(m_lastDropAction); 1018 1019 if (m_lastDropAction != Qt::IgnoreAction) -
trunk/Source/WebKit/qt/ChangeLog
r99096 r99108 1 2011-11-02 Jon Lee <jonlee@apple.com> 2 3 Expand DragController to provide more information about the dragging session 4 https://bugs.webkit.org/show_bug.cgi?id=71324 5 <rdar://problem/10379175> 6 7 Reviewed by Darin Adler. 8 9 * Api/qwebpage.cpp: 10 (QWebPagePrivate::dragEnterEvent): Minor refactoring because operation is stored in 11 new DragSession struct. 12 (QWebPagePrivate::dragMoveEvent): Ditto. 13 1 14 2011-11-02 Tom Sepez <tsepez@chromium.org> 2 15 -
trunk/Source/WebKit/win/ChangeLog
r99096 r99108 1 2011-11-02 Jon Lee <jonlee@apple.com> 2 3 Expand DragController to provide more information about the dragging session 4 https://bugs.webkit.org/show_bug.cgi?id=71324 5 <rdar://problem/10379175> 6 7 Reviewed by Darin Adler. 8 9 * WebView.cpp: 10 (WebView::DragEnter): Minor refactoring because operation is stored in 11 new DragSession struct. 12 (WebView::DragOver): Ditto. 13 1 14 2011-11-02 Tom Sepez <tsepez@chromium.org> 2 15 -
trunk/Source/WebKit/win/WebView.cpp
r98730 r99108 79 79 #include <WebCore/DragController.h> 80 80 #include <WebCore/DragData.h> 81 #include <WebCore/DragSession.h> 81 82 #include <WebCore/Editor.h> 82 83 #include <WebCore/EventHandler.h> … … 5085 5086 DragData data(pDataObject, IntPoint(localpt.x, localpt.y), 5086 5087 IntPoint(pt.x, pt.y), keyStateToDragOperation(grfKeyState)); 5087 *pdwEffect = dragOperationToDragCursor(m_page->dragController()->dragEntered(&data) );5088 *pdwEffect = dragOperationToDragCursor(m_page->dragController()->dragEntered(&data).operation); 5088 5089 5089 5090 m_lastDropEffect = *pdwEffect; … … 5104 5105 DragData data(m_dragData.get(), IntPoint(localpt.x, localpt.y), 5105 5106 IntPoint(pt.x, pt.y), keyStateToDragOperation(grfKeyState)); 5106 *pdwEffect = dragOperationToDragCursor(m_page->dragController()->dragUpdated(&data) );5107 *pdwEffect = dragOperationToDragCursor(m_page->dragController()->dragUpdated(&data).operation); 5107 5108 } else 5108 5109 *pdwEffect = DROPEFFECT_NONE; -
trunk/Source/WebKit2/ChangeLog
r99107 r99108 1 2011-11-02 Jon Lee <jonlee@apple.com> 2 3 Expand DragController to provide more information about the dragging session 4 https://bugs.webkit.org/show_bug.cgi?id=71324 5 <rdar://problem/10379175> 6 7 Reviewed by Darin Adler. 8 9 We now pass the DragSession struct from the Web to the UI process, instead of the 10 DragOperation enum. 11 12 * Scripts/webkit2/messages.py: 13 * Shared/WebCoreArgumentCoders.cpp: 14 (CoreIPC::::encode): 15 (CoreIPC::::decode): 16 * Shared/WebCoreArgumentCoders.h: 17 * UIProcess/API/mac/WKView.mm: 18 (-[WKView draggingUpdated:]): 19 * UIProcess/WebPageProxy.cpp: 20 (WebKit::WebPageProxy::WebPageProxy): We now cache the last known DragSession state 21 (WebKit::WebPageProxy::didPerformDragControllerAction): 22 * UIProcess/WebPageProxy.h: 23 (WebKit::WebPageProxy::dragSession): 24 (WebKit::WebPageProxy::resetDragOperation): 25 * UIProcess/WebPageProxy.messages.in: 26 * UIProcess/win/WebView.cpp: 27 (WebKit::WebView::keyStateToDragOperation): 28 (WebKit::WebView::DragEnter): 29 (WebKit::WebView::DragOver): 30 * WebProcess/WebPage/WebPage.cpp: 31 (WebKit::WebPage::performDragControllerAction): 32 1 33 2011-11-02 Anders Carlsson <andersca@apple.com> 2 34 -
trunk/Source/WebKit2/Scripts/webkit2/messages.py
r97639 r99108 171 171 'WebCore::EditorCommandsForKeyEvent', 172 172 'WebCore::CompositionUnderline', 173 'WebCore::DragSession', 173 174 'WebCore::FloatPoint3D', 174 175 'WebCore::FileChooserSettings', -
trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
r98923 r99108 32 32 #include <WebCore/Cursor.h> 33 33 #include <WebCore/DatabaseDetails.h> 34 #include <WebCore/DragSession.h> 34 35 #include <WebCore/Editor.h> 35 36 #include <WebCore/FileChooser.h> … … 601 602 return false; 602 603 if (!decoder->decode(result.replacement)) 604 return false; 605 return true; 606 } 607 608 void ArgumentCoder<DragSession>::encode(ArgumentEncoder* encoder, const DragSession& result) 609 { 610 encoder->encodeEnum(result.operation); 611 encoder->encode(result.mouseIsOverFileInput); 612 encoder->encode(result.numberOfItemsToBeAccepted); 613 } 614 615 bool ArgumentCoder<DragSession>::decode(ArgumentDecoder* decoder, DragSession& result) 616 { 617 if (!decoder->decodeEnum(result.operation)) 618 return false; 619 if (!decoder->decode(result.mouseIsOverFileInput)) 620 return false; 621 if (!decoder->decode(result.numberOfItemsToBeAccepted)) 603 622 return false; 604 623 return true; -
trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h
r98923 r99108 48 48 class ResourceResponse; 49 49 struct CompositionUnderline; 50 struct DragSession; 50 51 struct FileChooserSettings; 51 52 struct GrammarDetail; … … 214 215 static bool decode(ArgumentDecoder*, WebCore::TextCheckingResult&); 215 216 }; 217 218 template<> struct ArgumentCoder<WebCore::DragSession> { 219 static void encode(ArgumentEncoder*, const WebCore::DragSession&); 220 static bool decode(ArgumentDecoder*, WebCore::DragSession&); 221 }; 216 222 217 223 #if PLATFORM(QT) -
trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm
r98184 r99108 62 62 #import <WebCore/DragController.h> 63 63 #import <WebCore/DragData.h> 64 #import <WebCore/DragSession.h> 64 65 #import <WebCore/FloatRect.h> 65 66 #import <WebCore/IntRect.h> … … 1587 1588 DragData dragData(draggingInfo, client, global, static_cast<DragOperation>([draggingInfo draggingSourceOperationMask]), [self applicationFlags:draggingInfo]); 1588 1589 _data->_page->dragUpdated(&dragData, [[draggingInfo draggingPasteboard] name]); 1589 return _data->_page->dragOperation(); 1590 1591 WebCore::DragSession dragSession = _data->_page->dragSession(); 1592 return dragSession.operation; 1590 1593 } 1591 1594 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r99096 r99108 72 72 #include "WebSecurityOrigin.h" 73 73 #include "WebURLRequest.h" 74 #include <WebCore/DragController.h> 74 75 #include <WebCore/DragData.h> 76 #include <WebCore/DragSession.h> 75 77 #include <WebCore/FloatRect.h> 76 78 #include <WebCore/FocusDirection.h> … … 182 184 , m_pendingLearnOrIgnoreWordMessageCount(0) 183 185 , m_mainFrameHasCustomRepresentation(false) 184 , m_currentDragOperation(DragOperationNone)185 186 , m_mainFrameHasHorizontalScrollbar(false) 186 187 , m_mainFrameHasVerticalScrollbar(false) … … 851 852 } 852 853 853 void WebPageProxy::didPerformDragControllerAction( uint64_t resultOperation)854 { 855 m_currentDrag Operation = static_cast<DragOperation>(resultOperation);854 void WebPageProxy::didPerformDragControllerAction(WebCore::DragSession dragSession) 855 { 856 m_currentDragSession = dragSession; 856 857 } 857 858 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r99096 r99108 55 55 #include "WebUIClient.h" 56 56 #include <WebCore/DragActions.h> 57 #include <WebCore/DragSession.h> 57 58 #include <WebCore/HitTestResult.h> 58 59 #include <WebCore/PlatformScreen.h> … … 468 469 void performDrag(WebCore::DragData*, const String& dragStorageName, const SandboxExtension::Handle&); 469 470 470 void didPerformDragControllerAction( uint64_t resultOperation);471 void didPerformDragControllerAction(WebCore::DragSession); 471 472 void dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation); 472 473 #if PLATFORM(MAC) … … 506 507 bool isValid(); 507 508 508 WebCore::Drag Operation dragOperation() { return m_currentDragOperation; }509 void resetDragOperation() { m_currentDrag Operation = WebCore::DragOperationNone; }509 WebCore::DragSession dragSession() const { return m_currentDragSession; } 510 void resetDragOperation() { m_currentDragSession = WebCore::DragSession(); } 510 511 511 512 void preferencesDidChange(); … … 926 927 927 928 bool m_mainFrameHasCustomRepresentation; 928 WebCore::Drag Operation m_currentDragOperation;929 WebCore::DragSession m_currentDragSession; 929 930 930 931 String m_pendingAPIRequestURL; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r99096 r99108 207 207 208 208 # Drag and drop messages 209 DidPerformDragControllerAction( uint64_t resultOperation)209 DidPerformDragControllerAction(WebCore::DragSession dragSession) 210 210 #if PLATFORM(MAC) 211 211 SetDragImage(WebCore::IntPoint clientPosition, WebKit::ShareableBitmap::Handle dragImage, bool linkDrag) -
trunk/Source/WebKit2/UIProcess/win/WebView.cpp
r98472 r99108 47 47 #include <WebCore/BitmapInfo.h> 48 48 #include <WebCore/Cursor.h> 49 #include <WebCore/DragSession.h> 49 50 #include <WebCore/Editor.h> 50 51 #include <WebCore/FloatRect.h> … … 1642 1643 // state of the keyboard modifier keys on the keyboard. See: 1643 1644 // <http://msdn.microsoft.com/en-us/library/ms680129(VS.85).aspx>. 1644 DragOperation operation = m_page->drag Operation();1645 DragOperation operation = m_page->dragSession().operation; 1645 1646 1646 1647 if ((grfKeyState & (MK_CONTROL | MK_SHIFT)) == (MK_CONTROL | MK_SHIFT)) … … 1666 1667 DragData data(pDataObject, IntPoint(localpt.x, localpt.y), IntPoint(pt.x, pt.y), keyStateToDragOperation(grfKeyState)); 1667 1668 m_page->dragEntered(&data); 1668 *pdwEffect = dragOperationToDragCursor(m_page->drag Operation());1669 *pdwEffect = dragOperationToDragCursor(m_page->dragSession().operation); 1669 1670 1670 1671 m_lastDropEffect = *pdwEffect; … … 1684 1685 DragData data(m_dragData.get(), IntPoint(localpt.x, localpt.y), IntPoint(pt.x, pt.y), keyStateToDragOperation(grfKeyState)); 1685 1686 m_page->dragUpdated(&data); 1686 *pdwEffect = dragOperationToDragCursor(m_page->drag Operation());1687 *pdwEffect = dragOperationToDragCursor(m_page->dragSession().operation); 1687 1688 } else 1688 1689 *pdwEffect = DROPEFFECT_NONE; -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r99051 r99108 80 80 #include <WebCore/DragController.h> 81 81 #include <WebCore/DragData.h> 82 #include <WebCore/DragSession.h> 82 83 #include <WebCore/EventHandler.h> 83 84 #include <WebCore/FocusController.h> … … 1816 1817 { 1817 1818 if (!m_page) { 1818 send(Messages::WebPageProxy::DidPerformDragControllerAction(Drag OperationNone));1819 send(Messages::WebPageProxy::DidPerformDragControllerAction(DragSession()); 1819 1820 return; 1820 1821 } … … 1847 1848 { 1848 1849 if (!m_page) { 1849 send(Messages::WebPageProxy::DidPerformDragControllerAction(Drag OperationNone));1850 send(Messages::WebPageProxy::DidPerformDragControllerAction(DragSession())); 1850 1851 #if PLATFORM(QT) 1851 1852 QMimeData* data = const_cast<QMimeData*>(dragData.platformData()); … … 1891 1892 { 1892 1893 if (!m_page) { 1893 send(Messages::WebPageProxy::DidPerformDragControllerAction(Drag OperationNone));1894 send(Messages::WebPageProxy::DidPerformDragControllerAction(DragSession())); 1894 1895 return; 1895 1896 }
Note: See TracChangeset
for help on using the changeset viewer.