[webkit-changes] cvs commit: WebCore/kwq KWQComboBox.mm
KWQKHTMLPart.mm
David
harrison at opensource.apple.com
Thu Dec 8 13:44:29 PST 2005
harrison 05/12/08 13:44:29
Modified: . Tag: Safari-2-0-branch ChangeLog
kwq Tag: Safari-2-0-branch KWQComboBox.mm
KWQKHTMLPart.mm
Log:
Reviewed by Geoff.
<rdar://problem/4366496> 10.4.4 Regression: "Corel Painter IX (v9.1)" crashed
when going from the "Open a template" menu to "Select recent Document" in the
"Welcome to Corel XI!" window.
* kwq/KWQComboBox.mm:
(-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]):
Retain the event because it is the [NSApp currentEvent], which can change and therefore be released during [super trackMouse:...].
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::passSubframeEventToSubframe):
Check isWidget() rather than using a dynamic_cast to RenderPart*.
(KWQKHTMLPart::sendFakeEventsAfterWidgetTracking):
Allow for the event not being leftmousedown or keydown.
Revision Changes Path
No revision
No revision
1.1.2.96 +19 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.1.2.95
retrieving revision 1.1.2.96
diff -u -r1.1.2.95 -r1.1.2.96
--- ChangeLog 6 Dec 2005 23:33:45 -0000 1.1.2.95
+++ ChangeLog 8 Dec 2005 21:44:24 -0000 1.1.2.96
@@ -1,3 +1,22 @@
+2005-12-08 David Harrison <harrison at apple.com>
+
+ Reviewed by Geoff.
+
+ <rdar://problem/4366496> 10.4.4 Regression: "Corel Painter IX (v9.1)" crashed
+ when going from the "Open a template" menu to "Select recent Document" in the
+ "Welcome to Corel XI!" window.
+
+ * kwq/KWQComboBox.mm:
+ (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]):
+ Retain the event because it is the [NSApp currentEvent], which can change and therefore be released during [super trackMouse:...].
+
+ * kwq/KWQKHTMLPart.mm:
+ (KWQKHTMLPart::passSubframeEventToSubframe):
+ Check isWidget() rather than using a dynamic_cast to RenderPart*.
+
+ (KWQKHTMLPart::sendFakeEventsAfterWidgetTracking):
+ Allow for the event not being leftmousedown or keydown.
+
=== WebCore-417.10 ===
2005-12-05 Timothy Hatcher <timothy at apple.com>
No revision
No revision
1.59.10.8 +5 -0 WebCore/kwq/KWQComboBox.mm
Index: KWQComboBox.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQComboBox.mm,v
retrieving revision 1.59.10.7
retrieving revision 1.59.10.8
diff -u -r1.59.10.7 -r1.59.10.8
--- KWQComboBox.mm 17 Nov 2005 18:29:07 -0000 1.59.10.7
+++ KWQComboBox.mm 8 Dec 2005 21:44:27 -0000 1.59.10.8
@@ -403,6 +403,10 @@
- (BOOL)trackMouse:(NSEvent *)event inRect:(NSRect)rect ofView:(NSView *)view untilMouseUp:(BOOL)flag
{
WebCoreBridge *bridge = box ? [KWQKHTMLPart::bridgeForWidget(box) retain] : nil;
+
+ // we need to retain the event because it is the [NSApp currentEvent], which can change
+ // and therefore be released during [super trackMouse:...]
+ [event retain];
BOOL result = [super trackMouse:event inRect:rect ofView:view untilMouseUp:flag];
if (result && bridge) {
// Give KHTML a chance to fix up its event state, since the popup eats all the
@@ -410,6 +414,7 @@
// at this point!
[bridge part]->sendFakeEventsAfterWidgetTracking(event);
}
+ [event release];
[bridge release];
return result;
}
1.628.6.14 +46 -45 WebCore/kwq/KWQKHTMLPart.mm
Index: KWQKHTMLPart.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQKHTMLPart.mm,v
retrieving revision 1.628.6.13
retrieving revision 1.628.6.14
diff -u -r1.628.6.13 -r1.628.6.14
--- KWQKHTMLPart.mm 19 Nov 2005 02:35:41 -0000 1.628.6.13
+++ KWQKHTMLPart.mm 8 Dec 2005 21:44:27 -0000 1.628.6.14
@@ -2569,11 +2569,11 @@
if (!node) {
return false;
}
- RenderPart *renderPart = dynamic_cast<RenderPart *>(node->renderer());
- if (!renderPart) {
+ RenderObject *renderer = node->renderer();
+ if (!renderer || !renderer->isWidget()) {
return false;
}
- if (!passWidgetMouseDownEventToWidget(renderPart)) {
+ if (!passWidgetMouseDownEventToWidget(static_cast<RenderWidget *>(renderer))) {
return false;
}
_mouseDownWasInSubframe = true;
@@ -2750,48 +2750,49 @@
_sendingEventToSubview = false;
int eventType = [initiatingEvent type];
- ASSERT(eventType == NSLeftMouseDown || eventType == NSKeyDown);
- NSEvent *fakeEvent = nil;
- if (eventType == NSLeftMouseDown) {
- fakeEvent = [NSEvent mouseEventWithType:NSLeftMouseUp
- location:[initiatingEvent locationInWindow]
- modifierFlags:[initiatingEvent modifierFlags]
- timestamp:[initiatingEvent timestamp]
- windowNumber:[initiatingEvent windowNumber]
- context:[initiatingEvent context]
- eventNumber:[initiatingEvent eventNumber]
- clickCount:[initiatingEvent clickCount]
- pressure:[initiatingEvent pressure]];
-
- mouseUp(fakeEvent);
- }
- else { // eventType == NSKeyDown
- fakeEvent = [NSEvent keyEventWithType:NSKeyUp
- location:[initiatingEvent locationInWindow]
- modifierFlags:[initiatingEvent modifierFlags]
- timestamp:[initiatingEvent timestamp]
- windowNumber:[initiatingEvent windowNumber]
- context:[initiatingEvent context]
- characters:[initiatingEvent characters]
- charactersIgnoringModifiers:[initiatingEvent charactersIgnoringModifiers]
- isARepeat:[initiatingEvent isARepeat]
- keyCode:[initiatingEvent keyCode]];
- keyEvent(fakeEvent);
- }
- // FIXME: We should really get the current modifierFlags here, but there's no way to poll
- // them in Cocoa, and because the event stream was stolen by the Carbon menu code we have
- // no up-to-date cache of them anywhere.
- fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved
- location:[[_bridge window] convertScreenToBase:[NSEvent mouseLocation]]
- modifierFlags:[initiatingEvent modifierFlags]
- timestamp:[initiatingEvent timestamp]
- windowNumber:[initiatingEvent windowNumber]
- context:[initiatingEvent context]
- eventNumber:0
- clickCount:0
- pressure:0];
- mouseMoved(fakeEvent);
-
+ if (eventType == NSLeftMouseDown || eventType == NSKeyDown) {
+ NSEvent *fakeEvent = nil;
+ if (eventType == NSLeftMouseDown) {
+ fakeEvent = [NSEvent mouseEventWithType:NSLeftMouseUp
+ location:[initiatingEvent locationInWindow]
+ modifierFlags:[initiatingEvent modifierFlags]
+ timestamp:[initiatingEvent timestamp]
+ windowNumber:[initiatingEvent windowNumber]
+ context:[initiatingEvent context]
+ eventNumber:[initiatingEvent eventNumber]
+ clickCount:[initiatingEvent clickCount]
+ pressure:[initiatingEvent pressure]];
+
+ mouseUp(fakeEvent);
+ }
+ else { // eventType == NSKeyDown
+ fakeEvent = [NSEvent keyEventWithType:NSKeyUp
+ location:[initiatingEvent locationInWindow]
+ modifierFlags:[initiatingEvent modifierFlags]
+ timestamp:[initiatingEvent timestamp]
+ windowNumber:[initiatingEvent windowNumber]
+ context:[initiatingEvent context]
+ characters:[initiatingEvent characters]
+ charactersIgnoringModifiers:[initiatingEvent charactersIgnoringModifiers]
+ isARepeat:[initiatingEvent isARepeat]
+ keyCode:[initiatingEvent keyCode]];
+ keyEvent(fakeEvent);
+ }
+ // FIXME: We should really get the current modifierFlags here, but there's no way to poll
+ // them in Cocoa, and because the event stream was stolen by the Carbon menu code we have
+ // no up-to-date cache of them anywhere.
+ fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved
+ location:[[_bridge window] convertScreenToBase:[NSEvent mouseLocation]]
+ modifierFlags:[initiatingEvent modifierFlags]
+ timestamp:[initiatingEvent timestamp]
+ windowNumber:[initiatingEvent windowNumber]
+ context:[initiatingEvent context]
+ eventNumber:0
+ clickCount:0
+ pressure:0];
+ mouseMoved(fakeEvent);
+ }
+
KWQ_UNBLOCK_EXCEPTIONS;
}
More information about the webkit-changes
mailing list