[webkit-changes] cvs commit: WebCore/kwq KWQComboBox.mm KWQKHTMLPart.mm

Timothy thatcher at opensource.apple.com
Mon Dec 12 16:12:36 PST 2005


thatcher    05/12/12 16:12:35

  Modified:    .        Tag: Safari-1-3-branch ChangeLog
               kwq      Tag: Safari-1-3-branch KWQComboBox.mm
                        KWQKHTMLPart.mm
  Log:
          Merged fix from TOT to Safari-1-3-branch
  
      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.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.335.2.53 +23 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.335.2.52
  retrieving revision 1.335.2.53
  diff -u -r1.335.2.52 -r1.335.2.53
  --- ChangeLog	13 Dec 2005 00:05:20 -0000	1.335.2.52
  +++ ChangeLog	13 Dec 2005 00:12:21 -0000	1.335.2.53
  @@ -2,6 +2,29 @@
   
           Merged fix from TOT to Safari-1-3-branch
   
  +    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.
  +        
  +2005-12-12  Timothy Hatcher  <timothy at apple.com>
  +
  +        Merged fix from TOT to Safari-1-3-branch
  +
       2005-12-12  Adele Peterson  <adele at apple.com>
   
           Reviewed by Dave Harrison.
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.59.8.5  +5 -0      WebCore/kwq/KWQComboBox.mm
  
  Index: KWQComboBox.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQComboBox.mm,v
  retrieving revision 1.59.8.4
  retrieving revision 1.59.8.5
  diff -u -r1.59.8.4 -r1.59.8.5
  --- KWQComboBox.mm	1 Dec 2005 23:55:38 -0000	1.59.8.4
  +++ KWQComboBox.mm	13 Dec 2005 00:12:30 -0000	1.59.8.5
  @@ -393,6 +393,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
  @@ -400,6 +404,7 @@
           // at this point!
           [bridge part]->sendFakeEventsAfterWidgetTracking(event);
       }
  +    [event release];
       [bridge release];
       return result;
   }
  
  
  
  1.628.4.5 +46 -45    WebCore/kwq/KWQKHTMLPart.mm
  
  Index: KWQKHTMLPart.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQKHTMLPart.mm,v
  retrieving revision 1.628.4.4
  retrieving revision 1.628.4.5
  diff -u -r1.628.4.4 -r1.628.4.5
  --- KWQKHTMLPart.mm	28 Nov 2005 18:49:28 -0000	1.628.4.4
  +++ KWQKHTMLPart.mm	13 Dec 2005 00:12:30 -0000	1.628.4.5
  @@ -2528,11 +2528,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;
  @@ -2683,48 +2683,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