Changeset 18012 in webkit
- Timestamp:
- Dec 4, 2006 5:29:07 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r18009 r18012 1 2006-12-04 Darin Adler <darin@apple.com> 2 3 Reviewed by Adele. 4 5 - test the part of http://bugs.webkit.org/show_bug.cgi?id=11628 6 REGRESSION (r17597): Command-return in text fields doesn't open a new tab or window 7 that can easily be tested from the DOM -- this only checks that 8 simulated mouse events from clicking on a link have the key state 9 from the Enter key keyboard event, which is one part of the fix 10 for the bug above 11 12 * fast/events/simulated-key-state-expected.txt: Added. 13 * fast/events/simulated-key-state.html: Added. 14 1 15 2006-12-02 Geoffrey Garen <ggaren@apple.com> 2 16 -
trunk/WebCore/CMakeLists.txt
r17993 r18012 797 797 dom/TreeWalker.cpp 798 798 dom/UIEvent.cpp 799 dom/UIEventWithKeyState.cpp 799 800 dom/WheelEvent.cpp 800 801 dom/XMLTokenizer.cpp -
trunk/WebCore/ChangeLog
r18011 r18012 1 2006-12-04 Darin Adler <darin@apple.com> 2 3 Reviewed by Adele. 4 5 - fix another part of http://bugs.webkit.org/show_bug.cgi?id=11628 6 REGRESSION (r17597): Command-return in text fields doesn't open a new tab or window 7 8 This fixes command-return when the focus is on a link. 9 Despite the title of the bug, Mitz wanted me to fix both, and I will not 10 say no to him! 11 12 Test: fast/events/simulated-key-state.html 13 14 * dom/EventTargetNode.cpp: 15 (WebCore::EventTargetNode::dispatchSimulatedMouseEvent): Instead of always passing 16 false for all the key state in simulated mouse events, pass the state from the 17 first underlying event in the chain that has key state; in the case in the bug, 18 the keyboard event will be the underlying event itself and we'll propagate the 19 alt key modifier to the mouse event, resulting in the effect we want. It's nice 20 that JavaScript also gets to see the proper modifiers in the mouse event. 21 22 * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::defaultEventHandler): 23 Added code to pass in an underlying event to dispatchSimulatedClick. After looking 24 at all the other callers, this seems to be the only one that needs to pass an 25 event that is currently passing 0. Also removed the code that only simulated a 26 click when the event has a PlatformKeyboardEvent -- no reason for that and it 27 prevented me from writing a layout test for the fix. 28 29 * dom/UIEventWithKeyState.h: Added findEventWithKeyState function that walks the 30 underlyingEvent chain to find the first event that has key state. This already 31 existed in WebKit, but I wanted to use it in dispatchSimulatedMouseEvent. 32 * dom/UIEventWithKeyState.cpp: Added. 33 34 * CMakeLists.txt: Added UIEventWithKeyState.cpp. 35 * WebCore.vcproj/WebCore/WebCore.vcproj: Added UIEventWithKeyState.cpp. 36 * WebCore.xcodeproj/project.pbxproj: Added UIEventWithKeyState.cpp. 37 * WebCoreSources.bkl: Added UIEventWithKeyState.cpp. 38 39 * WebCore.exp: Added findEventWithKeyState, used by WebKit. 40 1 41 2006-12-04 Kevin McCullough <KMcCullough@apple.com> 2 42 -
trunk/WebCore/WebCore.exp
r17984 r18012 222 222 __ZN7WebCore19SelectionController9selectAllEv 223 223 __ZN7WebCore21PlatformKeyboardEventC1EP7NSEventb 224 __ZN7WebCore21findEventWithKeyStateEPNS_5EventE 224 225 __ZN7WebCore21isBackForwardLoadTypeENS_13FrameLoadTypeE 225 226 __ZN7WebCore26NetscapePlugInStreamLoader6createEPNS_5FrameEP11objc_object -
trunk/WebCore/WebCore.vcproj/WebCore/WebCore.vcproj
r18000 r18012 4216 4216 </File> 4217 4217 <File 4218 RelativePath="..\..\dom\UIEventWithKeyState.cpp" 4219 > 4220 </File> 4221 <File 4218 4222 RelativePath="..\..\dom\UIEventWithKeyState.h" 4219 4223 > -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r18005 r18012 1423 1423 93309EA3099EB78C0056E581 /* SharedTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 93309EA0099EB78C0056E581 /* SharedTimer.h */; }; 1424 1424 93309EA4099EB78C0056E581 /* Timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93309EA1099EB78C0056E581 /* Timer.cpp */; }; 1425 93354A3C0B24F8C9003F6DEA /* UIEventWithKeyState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93354A3B0B24F8C9003F6DEA /* UIEventWithKeyState.cpp */; }; 1425 1426 934706AB0AACD809002C1D43 /* TextDecoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 932CA7420AAA198E00AD1FAD /* TextDecoder.h */; }; 1426 1427 9352071909BD3BA500F2038D /* StaticConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = 9352071709BD3BA500F2038D /* StaticConstructors.h */; }; … … 4399 4400 93309EA0099EB78C0056E581 /* SharedTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SharedTimer.h; sourceTree = "<group>"; }; 4400 4401 93309EA1099EB78C0056E581 /* Timer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Timer.cpp; sourceTree = "<group>"; }; 4402 93354A3B0B24F8C9003F6DEA /* UIEventWithKeyState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIEventWithKeyState.cpp; sourceTree = "<group>"; }; 4401 4403 9352071709BD3BA500F2038D /* StaticConstructors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticConstructors.h; sourceTree = "<group>"; }; 4402 4404 9352071809BD3BA500F2038D /* TextBoundaries.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextBoundaries.h; sourceTree = "<group>"; }; … … 9361 9363 85031B370A44EFC700F992E0 /* UIEvent.cpp */, 9362 9364 85031B380A44EFC700F992E0 /* UIEvent.h */, 9365 93354A3B0B24F8C9003F6DEA /* UIEventWithKeyState.cpp */, 9363 9366 85031B390A44EFC700F992E0 /* UIEventWithKeyState.h */, 9364 9367 141B94EE09EC425A000E9413 /* UIEvent.idl */, … … 12124 12127 B277B4040B22F37C0004BEC6 /* GraphicsContextMac.mm in Sources */, 12125 12128 ED501DC60B249F2900AE18D9 /* EditorMac.mm in Sources */, 12129 93354A3C0B24F8C9003F6DEA /* UIEventWithKeyState.cpp in Sources */, 12126 12130 ); 12127 12131 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/WebCoreSources.bkl
r17743 r18012 530 530 dom/TreeWalker.cpp 531 531 dom/UIEvent.cpp 532 dom/UIEventWithKeyState.cpp 532 533 dom/WheelEvent.cpp 533 534 dom/XMLTokenizer.cpp -
trunk/WebCore/dom/EventTargetNode.cpp
r17976 r18012 386 386 { 387 387 assert(!eventDispatchForbidden()); 388 389 bool ctrlKey = false; 390 bool altKey = false; 391 bool shiftKey = false; 392 bool metaKey = false; 393 if (UIEventWithKeyState* keyStateEvent = findEventWithKeyState(underlyingEvent.get())) { 394 ctrlKey = keyStateEvent->ctrlKey(); 395 altKey = keyStateEvent->altKey(); 396 shiftKey = keyStateEvent->shiftKey(); 397 metaKey = keyStateEvent->metaKey(); 398 } 399 388 400 // Like Gecko, we just pass 0 for everything when we make a fake mouse event. 389 401 // Internet Explorer instead gives the current mouse position and state. 390 402 dispatchMouseEvent(eventType, 0, 0, 0, 0, 0, 0, 391 false, false, false, false, true, 0, underlyingEvent);403 ctrlKey, altKey, shiftKey, metaKey, true, 0, underlyingEvent); 392 404 } 393 405 -
trunk/WebCore/dom/UIEventWithKeyState.h
r17597 r18012 64 64 }; 65 65 66 UIEventWithKeyState* findEventWithKeyState(Event*); 67 66 68 } // namespace WebCore 67 69 -
trunk/WebCore/html/HTMLAnchorElement.cpp
r17976 r18012 181 181 return; 182 182 } 183 if (k->keyEvent()) { 184 evt->setDefaultHandled(); 185 dispatchSimulatedClick(0); 186 return; 187 } 183 evt->setDefaultHandled(); 184 dispatchSimulatedClick(evt); 185 return; 188 186 } 189 187 -
trunk/WebKit/ChangeLog
r18010 r18012 1 2006-12-04 Darin Adler <darin@apple.com> 2 3 Reviewed by Adele. 4 5 * WebCoreSupport/WebFrameLoaderClient.mm: 6 (WebFrameLoaderClient::actionDictionary): Changed to use the new 7 findEventWithKeyState function in WebCore instead of a local function 8 in this file. 9 1 10 2006-12-04 Geoffrey Garen <ggaren@apple.com> 2 11 -
trunk/WebKit/WebCoreSupport/WebFrameLoaderClient.mm
r17976 r18012 1171 1171 } 1172 1172 1173 static const UIEventWithKeyState* findKeyStateEvent(const Event* event)1174 {1175 for (const Event* e = event; e; e = e->underlyingEvent())1176 if (e->isMouseEvent() || e->isKeyboardEvent())1177 return static_cast<const UIEventWithKeyState*>(e);1178 return 0;1179 }1180 1181 1173 static const MouseEvent* findMouseEvent(const Event* event) 1182 1174 { … … 1191 1183 unsigned modifierFlags = 0; 1192 1184 const Event* event = action.event(); 1193 if (const UIEventWithKeyState* keyStateEvent = find KeyStateEvent(event)) {1185 if (const UIEventWithKeyState* keyStateEvent = findEventWithKeyState(const_cast<Event*>(event))) { 1194 1186 if (keyStateEvent->ctrlKey()) 1195 1187 modifierFlags |= NSControlKeyMask;
Note: See TracChangeset
for help on using the changeset viewer.