Changeset 43890 in webkit
- Timestamp:
- May 20, 2009 12:32:26 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 4 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r43887 r43890 1 2009-05-18 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Oliver Hunt. 4 5 Remove layoutTestController.addFileToPasteboardOnDrag and add eventSender.beginDragWithFiles 6 https://bugs.webkit.org/show_bug.cgi?id=25852 7 8 Add new tests for multi-file dragging: 9 https://bugs.webkit.org/show_bug.cgi?id=25862 10 11 I've removed the old tests in fast/forms which used layoutTestController.addFileToPasteboardOnDrag 12 and have added a new test in editing/pasteboard/ (where all the other drag-drop tests are) 13 which tests more than the previous two tests did. 14 15 Mac was the only platform running the old layoutTestController.addFileToPasteboardOnDrag tests 16 I've updated all the Skipped files to skip this new test instead. 17 18 * editing/pasteboard/file-input-files-access-expected.txt: Added. 19 * editing/pasteboard/file-input-files-access.html: Added. 20 * editing/pasteboard/resources/File With Spaces! For Dragging?.gif: Copied from LayoutTests/fast/canvas/resources/apple.gif. 21 * editing/pasteboard/resources/apple.gif: Copied from LayoutTests/fast/canvas/resources/apple.gif. 22 * editing/pasteboard/resources/file-input-files-access.js: Added. 23 (moveMouseToCenterOfElement): 24 (dragFilesOntoInput): 25 (fileListShouldBe): 26 (filesShouldBe): 27 (draggingPathsShouldResultInFiles): 28 (runTest): 29 * editing/pasteboard/resources/mozilla.gif: Copied from LayoutTests/fast/dom/resources/mozilla.gif. 30 * fast/forms/dragging-to-disabled-file-input-expected.txt: Removed. 31 * fast/forms/dragging-to-disabled-file-input.html: Removed. 32 * fast/forms/dragging-to-file-input-expected.txt: Removed. 33 * fast/forms/dragging-to-file-input.html: Removed. 34 * platform/gtk/Skipped: 35 * platform/qt/Skipped: 36 * platform/win/Skipped: 37 1 38 2009-05-19 Yichao Yin <yichao.yin@torchmobile.com.cn> 2 39 -
trunk/LayoutTests/platform/gtk/Skipped
r43887 r43890 1231 1231 editing/pasteboard/emacs-ctrl-a-k-y.html 1232 1232 editing/pasteboard/emacs-ctrl-k-y-001.html 1233 editing/pasteboard/file-input-files-access.html 1233 1234 editing/pasteboard/innerText-inline-table.html 1234 1235 editing/pasteboard/input-field-1.html … … 1715 1716 fast/forms/drag-into-textarea.html 1716 1717 fast/forms/drag-out-of-textarea.html 1717 fast/forms/dragging-to-disabled-file-input.html1718 fast/forms/dragging-to-file-input.html1719 1718 fast/forms/enter-clicks-buttons.html 1720 1719 fast/forms/focus2.html -
trunk/LayoutTests/platform/qt/Skipped
r43887 r43890 10 10 11 11 # -------- crashes 12 13 # ------- missing eventSender.beginDragWithFiles 14 editing/pasteboard/file-input-files-access.html 12 15 13 16 # ------- failing editing tests … … 163 166 fast/forms/control-restrict-line-height.html 164 167 fast/forms/drag-into-textarea.html 165 fast/forms/dragging-to-file-input.html166 168 fast/forms/focus-control-to-page.html 167 169 fast/forms/focus-selection-input.html -
trunk/LayoutTests/platform/win/Skipped
r43887 r43890 182 182 http/tests/webarchive 183 183 184 # <rdar://problem/5230396> layoutTestController.addFileToPasteboardOnDragis unimplemented185 fast/forms/dragging-to-file-input.html184 # <rdar://problem/5230396> eventSender.beginDragWithFiles is unimplemented 185 editing/pasteboard/file-input-files-access.html 186 186 187 187 # Need to add functionality to DumpRenderTree to test IDN <rdar://problem/5301954> -
trunk/WebKitTools/ChangeLog
r43873 r43890 1 2009-05-18 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Oliver Hunt. 4 5 Remove layoutTestController.addFileToPasteboardOnDrag and add eventSender.beginDragWithFiles 6 https://bugs.webkit.org/show_bug.cgi?id=25852 7 8 This allows us to now test multi-file file drags in DumpRenderTree per: 9 https://bugs.webkit.org/show_bug.cgi?id=25862 10 11 I removed the existing tests using addFileToPasteboardOnDrag() 12 and replaced them with a new test (editing/pasteboard/file-input-files-access) 13 which covers several more drag-drop cases. 14 15 I added a DumpRenderTreeFileDraggingSource class to avoid 16 the hack of if (!draggingSource) in [DumpRenderTreeDraggingInfo draggingSourceOperationMask] 17 18 New Test: editing/pasteboard/file-input-files-access.html 19 20 * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: 21 * DumpRenderTree/DumpRenderTreeFileDraggingSource.h: Added. 22 * DumpRenderTree/DumpRenderTreeFileDraggingSource.m: Added. 23 (-[DumpRenderTreeFileDraggingSource draggingSourceOperationMaskForLocal:]): 24 * DumpRenderTree/LayoutTestController.cpp: 25 (LayoutTestController::LayoutTestController): 26 (LayoutTestController::staticValues): removed addFileToPasteboardOnDrag support 27 (LayoutTestController::staticFunctions): removed addFileToPasteboardOnDrag support 28 * DumpRenderTree/LayoutTestController.h: 29 * DumpRenderTree/mac/DumpRenderTree.mm: 30 (runTest): ASSERT that draggingInfo has been cleared 31 * DumpRenderTree/mac/EventSendingController.mm: 32 (+[EventSendingController isSelectorExcludedFromWebScript:]): Sorted selectors. 33 (+[EventSendingController webScriptNameForSelector:]): Sorted selectors. 34 (-[EventSendingController beginDragWithFiles:]): 35 (-[EventSendingController mouseMoveToX:Y:]): 36 (-[EventSendingController keyDown:withModifiers:]): 37 (-[EventSendingController fireKeyboardEventsToElement:]): removed spurious { } 38 * DumpRenderTree/mac/UIDelegate.mm: 39 (-[UIDelegate webView:dragImage:at:offset:event:pasteboard:source:slideBack:forView:]): removed addFileToPasteboardOnDrag support 40 1 41 2009-05-19 Kevin Ollivier <kevino@theolliviers.com> 2 42 -
trunk/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
r42681 r43890 58 58 A8B91BFD0CF522B4008F91FF /* CheckedMalloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8B91BF70CF522B4008F91FF /* CheckedMalloc.cpp */; }; 59 59 A8B91BFF0CF522B4008F91FF /* CheckedMalloc.h in Headers */ = {isa = PBXBuildFile; fileRef = A8B91BF90CF522B4008F91FF /* CheckedMalloc.h */; }; 60 A8D79CEA0FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.h in Headers */ = {isa = PBXBuildFile; fileRef = A8D79CE80FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.h */; }; 61 A8D79CEB0FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.m in Sources */ = {isa = PBXBuildFile; fileRef = A8D79CE90FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.m */; }; 60 62 AE8259F308D22463000507AB /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE8257EF08D22389000507AB /* Carbon.framework */; }; 61 63 AE8259F408D22463000507AB /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE8257EF08D22389000507AB /* Carbon.framework */; }; … … 192 194 A8B91BF70CF522B4008F91FF /* CheckedMalloc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckedMalloc.cpp; path = mac/CheckedMalloc.cpp; sourceTree = "<group>"; }; 193 195 A8B91BF90CF522B4008F91FF /* CheckedMalloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CheckedMalloc.h; path = mac/CheckedMalloc.h; sourceTree = "<group>"; }; 196 A8D79CE80FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DumpRenderTreeFileDraggingSource.h; sourceTree = "<group>"; }; 197 A8D79CE90FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DumpRenderTreeFileDraggingSource.m; sourceTree = "<group>"; }; 194 198 AA7F10C20CB3C1030003BDC9 /* AHEM____.TTF */ = {isa = PBXFileReference; lastKnownFileType = file; name = "AHEM____.TTF"; path = "qt/fonts/AHEM____.TTF"; sourceTree = "<group>"; }; 195 199 AE8257EF08D22389000507AB /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; }; … … 307 311 BCA18B730C9B08F100114369 /* DumpRenderTreeDraggingInfo.h */, 308 312 BCA18B740C9B08F100114369 /* DumpRenderTreeDraggingInfo.mm */, 313 A8D79CE80FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.h */, 314 A8D79CE90FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.m */, 309 315 BC9D90210C97472D0099A4A3 /* WorkQueue.cpp */, 310 316 BC9D90220C97472E0099A4A3 /* WorkQueue.h */, … … 514 520 BC9D90260C97472E0099A4A3 /* WorkQueueItem.h in Headers */, 515 521 933BF5AB0F93FA5C000F0441 /* PlainTextController.h in Headers */, 522 A8D79CEA0FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.h in Headers */, 516 523 ); 517 524 runOnlyForDeploymentPostprocessing = 0; … … 659 666 BCA18B260C9B015C00114369 /* WorkQueueItemMac.mm in Sources */, 660 667 933BF5AC0F93FA5C000F0441 /* PlainTextController.mm in Sources */, 668 A8D79CEB0FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.m in Sources */, 661 669 ); 662 670 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebKitTools/DumpRenderTree/LayoutTestController.cpp
r42082 r43890 52 52 , m_dumpResourceLoadCallbacks(false) 53 53 , m_dumpFrameLoadCallbacks(false) 54 , m_addFileToPasteboardOnDrag(false)55 54 , m_callCloseOnWebViews(true) 56 55 , m_canOpenWindows(false) … … 225 224 } 226 225 227 static JSValueRef addFileToPasteboardOnDragCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)228 {229 LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));230 controller->setAddFileToPasteboardOnDrag(true);231 return JSValueMakeUndefined(context);232 }233 234 226 static JSValueRef addDisallowedURLCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 235 227 { … … 826 818 }; 827 819 return staticValues; 828 829 820 } 830 821 … … 833 824 static JSStaticFunction staticFunctions[] = { 834 825 { "addDisallowedURL", addDisallowedURLCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 835 { "addFileToPasteboardOnDrag", addFileToPasteboardOnDragCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },836 826 { "clearAllDatabases", clearAllDatabasesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 837 827 { "clearBackForwardList", clearBackForwardListCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -
trunk/WebKitTools/DumpRenderTree/LayoutTestController.h
r42082 r43890 123 123 void setDumpFrameLoadCallbacks(bool dumpFrameLoadCallbacks) { m_dumpFrameLoadCallbacks = dumpFrameLoadCallbacks; } 124 124 125 bool addFileToPasteboardOnDrag() const { return m_addFileToPasteboardOnDrag; }126 void setAddFileToPasteboardOnDrag(bool addFileToPasteboardOnDrag) { m_addFileToPasteboardOnDrag = addFileToPasteboardOnDrag; }127 128 125 bool callCloseOnWebViews() const { return m_callCloseOnWebViews; } 129 126 void setCallCloseOnWebViews(bool callCloseOnWebViews) { m_callCloseOnWebViews = callCloseOnWebViews; } … … 178 175 bool m_dumpResourceLoadCallbacks; 179 176 bool m_dumpFrameLoadCallbacks; 180 bool m_addFileToPasteboardOnDrag;181 177 bool m_callCloseOnWebViews; 182 178 bool m_canOpenWindows; -
trunk/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
r43721 r43890 27 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 */ 29 29 30 30 #import "DumpRenderTree.h" 31 31 32 32 #import "AccessibilityController.h" 33 33 #import "CheckedMalloc.h" 34 #import "DumpRenderTreeDraggingInfo.h" 34 35 #import "DumpRenderTreePasteboard.h" 35 36 #import "DumpRenderTreeWindow.h" … … 1092 1093 gLayoutTestController = new LayoutTestController(testURL, expectedPixelHash); 1093 1094 topLoadingFrame = nil; 1095 ASSERT(!draggingInfo); // the previous test should have called eventSender.mouseUp to drop! 1096 releaseAndZero(&draggingInfo); 1094 1097 done = NO; 1095 1098 -
trunk/WebKitTools/DumpRenderTree/mac/EventSendingController.mm
r39377 r43890 34 34 #import "DumpRenderTree.h" 35 35 #import "DumpRenderTreeDraggingInfo.h" 36 #import "DumpRenderTreeFileDraggingSource.h" 36 37 37 38 #import <Carbon/Carbon.h> // for GetCurrentEventTime() … … 119 120 + (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector 120 121 { 121 if (aSelector == @selector( mouseDown:)122 || aSelector == @selector( mouseUp:)122 if (aSelector == @selector(beginDragWithFiles:) 123 || aSelector == @selector(clearKillRing) 123 124 || aSelector == @selector(contextClick) 124 || aSelector == @selector(scheduleAsynchronousClick)125 || aSelector == @selector(mouseMoveToX:Y:)126 || aSelector == @selector(leapForward:)127 || aSelector == @selector(keyDown:withModifiers:)128 125 || aSelector == @selector(enableDOMUIEventLogging:) 129 126 || aSelector == @selector(fireKeyboardEventsToElement:) 130 || aSelector == @selector(clearKillRing) 127 || aSelector == @selector(keyDown:withModifiers:) 128 || aSelector == @selector(leapForward:) 129 || aSelector == @selector(mouseDown:) 130 || aSelector == @selector(mouseMoveToX:Y:) 131 || aSelector == @selector(mouseUp:) 132 || aSelector == @selector(scheduleAsynchronousClick) 131 133 || aSelector == @selector(textZoomIn) 132 134 || aSelector == @selector(textZoomOut) … … 146 148 + (NSString *)webScriptNameForSelector:(SEL)aSelector 147 149 { 150 if (aSelector == @selector(beginDragWithFiles:)) 151 return @"beginDragWithFiles"; 152 if (aSelector == @selector(enableDOMUIEventLogging:)) 153 return @"enableDOMUIEventLogging"; 154 if (aSelector == @selector(fireKeyboardEventsToElement:)) 155 return @"fireKeyboardEventsToElement"; 156 if (aSelector == @selector(keyDown:withModifiers:)) 157 return @"keyDown"; 158 if (aSelector == @selector(leapForward:)) 159 return @"leapForward"; 148 160 if (aSelector == @selector(mouseDown:)) 149 161 return @"mouseDown"; … … 152 164 if (aSelector == @selector(mouseMoveToX:Y:)) 153 165 return @"mouseMoveTo"; 154 if (aSelector == @selector(leapForward:))155 return @"leapForward";156 if (aSelector == @selector(keyDown:withModifiers:))157 return @"keyDown";158 if (aSelector == @selector(enableDOMUIEventLogging:))159 return @"enableDOMUIEventLogging";160 if (aSelector == @selector(fireKeyboardEventsToElement:))161 return @"fireKeyboardEventsToElement";162 166 if (aSelector == @selector(setDragMode:)) 163 167 return @"setDragMode"; … … 239 243 } 240 244 245 - (void)beginDragWithFiles:(WebScriptObject*)jsFilePaths 246 { 247 assert(!draggingInfo); 248 assert([jsFilePaths isKindOfClass:[WebScriptObject class]]); 249 250 NSPasteboard *pboard = [NSPasteboard pasteboardWithUniqueName]; 251 [pboard declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType] owner:nil]; 252 253 NSURL *currentTestURL = [NSURL URLWithString:[[mainFrame webView] mainFrameURL]]; 254 255 NSMutableArray *filePaths = [NSMutableArray array]; 256 for (unsigned i = 0; [[jsFilePaths webScriptValueAtIndex:i] isKindOfClass:[NSString class]]; i++) { 257 NSString *filePath = (NSString *)[jsFilePaths webScriptValueAtIndex:i]; 258 // Have NSURL encode the name so that we handle '?' in file names correctly. 259 NSURL *fileURL = [NSURL fileURLWithPath:filePath]; 260 NSURL *absoluteFileURL = [NSURL URLWithString:[fileURL relativeString] relativeToURL:currentTestURL]; 261 [filePaths addObject:[absoluteFileURL path]]; 262 } 263 264 [pboard setPropertyList:filePaths forType:NSFilenamesPboardType]; 265 assert([pboard propertyListForType:NSFilenamesPboardType]); // setPropertyList will silently fail on error, assert that it didn't fail 266 267 // Provide a source, otherwise [DumpRenderTreeDraggingInfo draggingSourceOperationMask] defaults to NSDragOperationNone 268 DumpRenderTreeFileDraggingSource *source = [[[DumpRenderTreeFileDraggingSource alloc] init] autorelease]; 269 draggingInfo = [[DumpRenderTreeDraggingInfo alloc] initWithImage:nil offset:NSZeroSize pasteboard:pboard source:source]; 270 [[mainFrame webView] draggingEntered:draggingInfo]; 271 272 dragMode = NO; // dragMode saves events and then replays them later. We don't need/want that. 273 leftMouseButtonDown = YES; // Make the rest of eventSender think a drag is in progress 274 } 275 241 276 - (void)updateClickCountForButton:(int)buttonNumber 242 277 { … … 340 375 else 341 376 [webView draggingExited:draggingInfo]; 342 [[draggingInfo draggingSource] draggedImage:[draggingInfo draggedImage] endedAt:lastMousePosition operation:dragOperation]; 377 // Per NSDragging.h: draggingSources may not implement draggedImage:endedAt:operation: 378 if ([[draggingInfo draggingSource] respondsToSelector:@selector(draggedImage:endedAt:operation:)]) 379 [[draggingInfo draggingSource] draggedImage:[draggingInfo draggedImage] endedAt:lastMousePosition operation:dragOperation]; 343 380 [draggingInfo release]; 344 381 draggingInfo = nil; … … 356 393 357 394 [EventSendingController saveEvent:invocation]; 358 359 395 return; 360 396 } … … 377 413 [subView mouseDragged:event]; 378 414 if (draggingInfo) { 379 [[draggingInfo draggingSource] draggedImage:[draggingInfo draggedImage] movedTo:lastMousePosition]; 415 // Per NSDragging.h: draggingSources may not implement draggedImage:movedTo: 416 if ([[draggingInfo draggingSource] respondsToSelector:@selector(draggedImage:movedTo:)]) 417 [[draggingInfo draggingSource] draggedImage:[draggingInfo draggedImage] movedTo:lastMousePosition]; 380 418 [[mainFrame webView] draggingUpdated:draggingInfo]; 381 419 } … … 477 515 } 478 516 479 if ([modifiers isKindOfClass:[WebScriptObject class]]) 517 if ([modifiers isKindOfClass:[WebScriptObject class]]) { 480 518 for (unsigned i = 0; [[modifiers webScriptValueAtIndex:i] isKindOfClass:[NSString class]]; i++) { 481 519 NSString *modifier = (NSString *)[modifiers webScriptValueAtIndex:i]; … … 489 527 modifierFlags |= NSCommandKeyMask; 490 528 } 529 } 491 530 492 531 [[[mainFrame frameView] documentView] layout]; … … 618 657 - (void)fireKeyboardEventsToElement:(WebScriptObject *)element { 619 658 620 if (![element isKindOfClass:[DOMHTMLElement class]]) {659 if (![element isKindOfClass:[DOMHTMLElement class]]) 621 660 return; 622 }623 661 624 662 DOMHTMLElement *target = (DOMHTMLElement*)element; -
trunk/WebKitTools/DumpRenderTree/mac/UIDelegate.mm
r43821 r43890 96 96 { 97 97 assert(!draggingInfo); 98 if (gLayoutTestController->addFileToPasteboardOnDrag()) {99 [pboard declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType] owner:nil];100 [pboard setPropertyList:[NSArray arrayWithObject:@"DRTFakeFile"] forType:NSFilenamesPboardType];101 }102 98 draggingInfo = [[DumpRenderTreeDraggingInfo alloc] initWithImage:anImage offset:initialOffset pasteboard:pboard source:sourceObj]; 103 99 [sender draggingUpdated:draggingInfo];
Note: See TracChangeset
for help on using the changeset viewer.