[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:14:11 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 2da8a2a493228e16f1a1794d9663d17243367985
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 12 10:31:40 2002 +0000

    WebCore:
    
            Reviewed by Maciej.
    
    	- fixed 3125504 -- REGRESSION: Selection not working correctly for text area on http://glish.com/css/7.asp
    
            * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::khtmlMousePressEvent): Call makeFirstResponder here explicitly,
    	since we are disabling the makeFirstResponder that normally happens during window event dispatching
    	in WebKit.
    
            * kwq/KWQScrollView.h: Define getDocumentView().
            * kwq/KWQScrollView.mm: Use getDocumentView() everywhere.
            (QScrollView::getDocumentView): Define it here.
    
    WebKit:
    
            Reviewed by Maciej.
    
    	- fixed 3125504 -- REGRESSION: Selection not working correctly for text area on http://glish.com/css/7.asp
    
    	The problem is that the text area lost its first responder status because WebHTMLView took the click,
    	and NSWindow wanted WebHTMLView to become first responder too.
    
            * WebView.subproj/WebHTMLView.m: (-[WebHTMLView acceptsFirstResponder]):
    	Don't allow the NSWindow to make this the first responder during the early part of mouseDown event
    	handling. But do allow anyone else to make this the first responder, for example from keyboard events,
    	or from calls back from WebCore once we begin mouse-down event handling.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3017 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 0bf4676..46f5ee6 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,19 @@
 2002-12-12  Darin Adler  <darin at apple.com>
 
+        Reviewed by Maciej.
+
+	- fixed 3125504 -- REGRESSION: Selection not working correctly for text area on http://glish.com/css/7.asp
+
+        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::khtmlMousePressEvent): Call makeFirstResponder here explicitly,
+	since we are disabling the makeFirstResponder that normally happens during window event dispatching
+	in WebKit.
+
+        * kwq/KWQScrollView.h: Define getDocumentView().
+        * kwq/KWQScrollView.mm: Use getDocumentView() everywhere.
+        (QScrollView::getDocumentView): Define it here.
+
+2002-12-12  Darin Adler  <darin at apple.com>
+
         Reviewed by Maciej and Richard.
 
 	- fixed 3125497 -- REGRESSION: Infinite recursion with mouseUp: events
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 0bf4676..46f5ee6 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,19 @@
 2002-12-12  Darin Adler  <darin at apple.com>
 
+        Reviewed by Maciej.
+
+	- fixed 3125504 -- REGRESSION: Selection not working correctly for text area on http://glish.com/css/7.asp
+
+        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::khtmlMousePressEvent): Call makeFirstResponder here explicitly,
+	since we are disabling the makeFirstResponder that normally happens during window event dispatching
+	in WebKit.
+
+        * kwq/KWQScrollView.h: Define getDocumentView().
+        * kwq/KWQScrollView.mm: Use getDocumentView() everywhere.
+        (QScrollView::getDocumentView): Define it here.
+
+2002-12-12  Darin Adler  <darin at apple.com>
+
         Reviewed by Maciej and Richard.
 
 	- fixed 3125497 -- REGRESSION: Infinite recursion with mouseUp: events
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 26f4920..5fc04ac 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -722,6 +722,11 @@ bool KWQKHTMLPart::closeURL()
 void KWQKHTMLPart::khtmlMousePressEvent(MousePressEvent *event)
 {
     if (!passWidgetMouseDownEventToWidget(event)) {
+        // We don't do this at the start of mouse down handling, because we don't want to do it until
+        // we know we didn't hit a widget.
+        NSView *documentView = view()->getDocumentView();
+        [[documentView window] makeFirstResponder:documentView];
+        
         KHTMLPart::khtmlMousePressEvent(event);
     }
 }
diff --git a/WebCore/kwq/KWQScrollView.h b/WebCore/kwq/KWQScrollView.h
index 1b7d475..5595fa4 100644
--- a/WebCore/kwq/KWQScrollView.h
+++ b/WebCore/kwq/KWQScrollView.h
@@ -77,7 +77,7 @@ public:
     void ensureVisible(int,int);
     void ensureVisible(int,int,int,int);
     
-    NSView *getDocumentView();
+    NSView *getDocumentView() const;
 };
 
 #endif
diff --git a/WebCore/kwq/KWQScrollView.mm b/WebCore/kwq/KWQScrollView.mm
index 80debe2..4adee2b 100644
--- a/WebCore/kwq/KWQScrollView.mm
+++ b/WebCore/kwq/KWQScrollView.mm
@@ -44,7 +44,6 @@
 
 @interface NSView (KWQExtensions)
 - (BOOL)_KWQ_isScrollView;
-- (NSView *)_KWQ_getDocumentView;
 @end
 
 @implementation NSView (KWQExtensions)
@@ -54,15 +53,6 @@
     return [self isKindOfClass:[NSScrollView class]];
 }
 
-- (NSView *)_KWQ_getDocumentView
-{
-    if ([self respondsToSelector: @selector(documentView)]) {
-        NSScrollView *sv = (NSScrollView *)self; // Compiler complains about in-line cast.
-        return [sv documentView];
-    }
-    return nil;
-}
-
 @end
 
 QWidget* QScrollView::viewport() const
@@ -100,7 +90,7 @@ int QScrollView::visibleHeight() const
 int QScrollView::contentsWidth() const
 {
     NSView *docView, *view = getView();
-    docView = [view _KWQ_getDocumentView];
+    docView = getDocumentView();
     if (docView)
         return (int)[docView bounds].size.width;
     return (int)[view bounds].size.width;
@@ -109,7 +99,7 @@ int QScrollView::contentsWidth() const
 int QScrollView::contentsHeight() const
 {
     NSView *docView, *view = getView();
-    docView = [view _KWQ_getDocumentView];
+    docView = getDocumentView();
     if (docView)
         return (int)[docView bounds].size.height;
     return (int)[view bounds].size.height;
@@ -159,7 +149,7 @@ void QScrollView::scrollBy(int dx, int dy)
 void QScrollView::setContentsPos(int x, int y)
 {
     NSView *docView, *view = getView();    
-    docView = [view _KWQ_getDocumentView];
+    docView = getDocumentView();
     if (docView)
         view = docView;
         
@@ -189,7 +179,7 @@ void QScrollView::addChild(QWidget* child, int x, int y)
     child->move(x, y);
     
     thisView = getView();
-    thisDocView = [thisView _KWQ_getDocumentView];
+    thisDocView = getDocumentView();
     if (thisDocView)
         thisView = thisDocView;
 
@@ -217,7 +207,7 @@ void QScrollView::resizeContents(int w, int h)
     LOG(Frames, "%p %@ at w %d h %d\n", getView(), [[getView() class] className], w, h);
     NSView *view = getView();
     if ([view _KWQ_isScrollView]){
-        view = [view _KWQ_getDocumentView];
+        view = getDocumentView();
         
         LOG(Frames, "%p %@ at w %d h %d\n", view, [[view class] className], w, h);
         if (w < 0)
@@ -240,7 +230,7 @@ void QScrollView::updateContents(const QRect &rect, bool now)
     NSView *view = getView();
 
     if ([view _KWQ_isScrollView])
-        view = [view _KWQ_getDocumentView];
+        view = getDocumentView();
 
     if (now)
         [view displayRect: rect];
@@ -264,7 +254,7 @@ void QScrollView::contentsToViewport(int x, int y, int& vx, int& vy)
 {
     NSView *docView, *view = getView();    
      
-    docView = [view _KWQ_getDocumentView];
+    docView = getDocumentView();
     if (docView)
         view = docView;
         
@@ -278,7 +268,7 @@ void QScrollView::viewportToContents(int vx, int vy, int& x, int& y)
 {
     NSView *docView, *view = getView();    
 
-    docView = [view _KWQ_getDocumentView];
+    docView = getDocumentView();
     if (docView)
         view = docView;
         
@@ -308,3 +298,9 @@ void QScrollView::ensureVisible(int,int,int,int)
 {
     LOG(NotYetImplemented, "not yet implemented");
 }
+
+NSView *QScrollView::getDocumentView() const
+{
+    id view = getView();
+    return [view respondsToSelector:@selector(documentView)] ? [view documentView] : nil;
+}
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index b95a758..4542d65 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,19 @@
 2002-12-12  Darin Adler  <darin at apple.com>
 
+        Reviewed by Maciej.
+
+	- fixed 3125504 -- REGRESSION: Selection not working correctly for text area on http://glish.com/css/7.asp
+
+	The problem is that the text area lost its first responder status because WebHTMLView took the click,
+	and NSWindow wanted WebHTMLView to become first responder too.
+
+        * WebView.subproj/WebHTMLView.m: (-[WebHTMLView acceptsFirstResponder]):
+	Don't allow the NSWindow to make this the first responder during the early part of mouseDown event
+	handling. But do allow anyone else to make this the first responder, for example from keyboard events,
+	or from calls back from WebCore once we begin mouse-down event handling.
+
+2002-12-12  Darin Adler  <darin at apple.com>
+
         Reviewed by Maciej and Richard.
 
         - fixed reentrancy crash I ran into while debugging infinite recursion bugs
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 41861ef..0de2afc 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -146,6 +146,14 @@
 
 - (BOOL)acceptsFirstResponder
 {
+    // Don't accept first responder when we first click on this view.
+    // We have to pass the event down through WebCore first to be sure we don't hit a subview.
+    // Do accept first responder at any other time, for example from keyboard events,
+    // or from calls back from WebCore once we begin mouse-down event handling.
+    NSEvent *event = [NSApp currentEvent];
+    if ([event type] == NSLeftMouseDown && event != _private->mouseDownEvent) {
+        return NO;
+    }
     return YES;
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list