[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 06:42:23 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 50d5f459fef9a97ba6d8a8b4904705fa46ea467e
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Sep 23 04:31:30 2002 +0000

    	- fixed 3057380 -- insertion point shows through elements in front of text fields
    
            * WebView.subproj/WebHTMLViewPrivate.m:
            (+[WebHTMLView initialize]): Make WebNSTextView pose as NSTextView.
            (-[WebNSTextView _web_inHTMLView]): Helper method.
            (-[WebNSTextView isOpaque]): Override to return NO for all text views that are inside
    	an WebHTMLView, so they don't try to do insertion point caching.
            (-[WebNSTextView drawInsertionPointInRect:color:turnedOn:]): Use setNeedsDisplayInRect
    	to trigger insertion point drawing outside drawRect instead of drawing right away.
            (-[WebNSTextView _drawRect:clip:]): Set flag so the above can know when it's inside
    	drawRect and when it's not.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2119 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index f92dbf2..8612d0d 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,17 @@
+2002-09-22  Darin Adler  <darin at apple.com>
+
+	- fixed 3057380 -- insertion point shows through elements in front of text fields
+
+        * WebView.subproj/WebHTMLViewPrivate.m:
+        (+[WebHTMLView initialize]): Make WebNSTextView pose as NSTextView.
+        (-[WebNSTextView _web_inHTMLView]): Helper method.
+        (-[WebNSTextView isOpaque]): Override to return NO for all text views that are inside
+	an WebHTMLView, so they don't try to do insertion point caching.
+        (-[WebNSTextView drawInsertionPointInRect:color:turnedOn:]): Use setNeedsDisplayInRect
+	to trigger insertion point drawing outside drawRect instead of drawing right away.
+        (-[WebNSTextView _drawRect:clip:]): Set flag so the above can know when it's inside
+	drawRect and when it's not.
+
 2002-09-21  Darin Adler  <darin at apple.com>
 
 	WebKit part of the new approach to AppKit drawing control.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index f92dbf2..8612d0d 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,17 @@
+2002-09-22  Darin Adler  <darin at apple.com>
+
+	- fixed 3057380 -- insertion point shows through elements in front of text fields
+
+        * WebView.subproj/WebHTMLViewPrivate.m:
+        (+[WebHTMLView initialize]): Make WebNSTextView pose as NSTextView.
+        (-[WebNSTextView _web_inHTMLView]): Helper method.
+        (-[WebNSTextView isOpaque]): Override to return NO for all text views that are inside
+	an WebHTMLView, so they don't try to do insertion point caching.
+        (-[WebNSTextView drawInsertionPointInRect:color:turnedOn:]): Use setNeedsDisplayInRect
+	to trigger insertion point drawing outside drawRect instead of drawing right away.
+        (-[WebNSTextView _drawRect:clip:]): Set flag so the above can know when it's inside
+	drawRect and when it's not.
+
 2002-09-21  Darin Adler  <darin at apple.com>
 
 	WebKit part of the new approach to AppKit drawing control.
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.m b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
index 570c63e..66119c7 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.m
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
@@ -28,7 +28,8 @@
 - (void)_recursiveDisplayRectIfNeededIgnoringOpacity:(NSRect)rect isVisibleRect:(BOOL)isVisibleRect rectIsVisibleRectForView:(NSView *)visibleView topView:(BOOL)topView;
 - (void)_recursiveDisplayAllDirtyWithLockFocus:(BOOL)needsLockFocus visRect:(NSRect)visRect;
 - (NSRect)_dirtyRect;
-- (NSRect)_convertRectToSuperview:(NSRect)aRect;
+- (NSRect)_convertRectToSuperview:(NSRect)rect;
+- (void)_drawRect:(NSRect)rect clip:(BOOL)clip;
 @end
 
 @interface NSView (WebNSViewDisplayExtras)
@@ -36,6 +37,11 @@
 - (void)_web_propagateDirtyRectToAncestor;
 @end
 
+ at interface WebNSTextView : NSTextView
+{
+}
+ at end
+
 @implementation WebHTMLViewPrivate
 
 - (void)dealloc
@@ -48,6 +54,11 @@
 
 @implementation WebHTMLView (WebPrivate)
 
++ (void)initialize
+{
+    [[WebNSTextView class] poseAsClass:[NSTextView class]];
+}
+
 - (void)_adjustFrames
 {
     // Ick!  khtml set the frame size during layout and
@@ -228,3 +239,69 @@ BOOL _modifierTrackingEnabled = FALSE;
 }
 
 @end
+
+ at implementation WebNSTextView
+
+static BOOL inDrawRect;
+
+// This code is here to make insertion point drawing work in a way that respects the
+// HTML view layering. If we can find a way to make it work without poseAsClass, we
+// should do that.
+
+- (BOOL)_web_inHTMLView
+{
+    NSView *view = self;
+    for (;;) {
+        NSView *superview = [view superview];
+        if (!superview) {
+            return NO;
+        }
+        view = superview;
+        if ([view isKindOfClass:[WebHTMLView class]]) {
+            return YES;
+        }
+    }
+}
+
+- (BOOL)isOpaque
+{
+    if (![self _web_inHTMLView]) {
+        return [super isOpaque];
+    }
+
+    // Text views in the HTML view all say they are not opaque.
+    // This prevents the insertion point rect cache from being used,
+    // and all the side effects are good since we want the view to act
+    // opaque anyway. This could go in NSView instead of NSTextView,
+    // but we need to pose as NSTextView anyway for the other override.
+    // If we did this in NSView, we wouldn't need to call _web_propagateDirtyRectToAncestor.
+    return NO;
+}
+
+- (void)drawInsertionPointInRect:(NSRect)rect color:(NSColor *)color turnedOn:(BOOL)turnedOn
+{
+    if (![self _web_inHTMLView]) {
+        [super drawInsertionPointInRect:rect color:color turnedOn:turnedOn];
+        return;
+    }
+    
+    // Use the display mechanism to do all insertion point drawing in the web view.
+    if (inDrawRect) {
+        [super drawInsertionPointInRect:rect color:color turnedOn:turnedOn];
+        return;
+    }
+    [super drawInsertionPointInRect:rect color:color turnedOn:NO];
+    if (turnedOn) {
+        rect.size.width = 1;
+        [self setNeedsDisplayInRect:rect];
+    }
+}
+
+- (void)_drawRect:(NSRect)rect clip:(BOOL)clip
+{
+    inDrawRect = YES;
+    [super _drawRect:rect clip:clip];
+    inDrawRect = NO;
+}
+
+ at end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list