[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:41:19 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 81136ec6c55332222b43e48f51ffb78f230a4cb2
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Sep 21 23:54:05 2002 +0000
WebCore:
WebCore part of the new approach to AppKit drawing control.
Works better than the previous try. Once we fix anomalies with focus rectangles
and a minor problems with subframes this should work perfectly.
* kwq/qt/qwidget.h: The paint() method isn't virtual any more. Also remove flushDrawing().
* kwq/KWQWidget.mm: (QWidget::enableFlushDrawing): Do a flushWindowIfNeeded instead
of requiring a separate flushDrawing() call to do a flushWindow.
(QWidget::paint): Added. Calls displayRectIgnoringOpacity.
* kwq/qt/qbutton.h: Remove paint() override.
* kwq/KWQButton.mm: (QButton::QButton): No need for a subclass any more, so
drop KWQNSButton. Also remove paint().
* kwq/qt/qcombobox.h: Remove paint() override.
* kwq/KWQComboBox.mm: (QComboBox::QComboBox): No need for a subclass any more, so
drop KWQNSPopUpButton. Also remove paint() method.
* kwq/qt/qlineedit.h: Remove paint() override.
* kwq/KWQLineEdit.mm: Remove paint().
* kwq/KWQFileButton.mm: (KWQFileButton::clicked): Fix typo. Was calling paint
instead of clicked on the base class.
* kwq/KWQNSTextField.h: Remove paint method.
* kwq/KWQNSTextField.mm:
(-[KWQNSTextField display]): Add a display method that does nothing to work around
bug 2753974.
(-[KWQSecureTextField display]): Ditto.
* khtml/rendering/render_frames.cpp: (RenderFrameSet::userResize): Remove call to flushDrawing.
WebKit:
WebKit part of the new approach to AppKit drawing control.
Works better than the previous try. Once we fix anomalies with focus rectangles
and a some remaining problems with subframes this should work perfectly.
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView isOpaque]): Return NO for frames other than the main frame.
(-[WebHTMLView drawRect:]): Restore the subviews that were set aside.
* WebView.subproj/WebHTMLViewPrivate.h: Add _isMainFrame. Add savedSubviews and subviewsSetAside.
* WebView.subproj/WebHTMLViewPrivate.m:
(-[WebHTMLView _isMainFrame]): Added.
(-[WebHTMLView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]):
Added. If this is the main frame, get all the dirty rects from the subviews and then set
them aside so the AppKit machinery won't draw them.
(-[WebHTMLView _recursiveDisplayAllDirtyWithLockFocus:visRect:]): Ditto.
(-[NSView _web_propagateDirtyRectToAncestor]): Added. Propagates dirty rects the same
way that AppKit does, but always does it, ignoring the value of isOpaque.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index b98e793..b0ba378 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,36 @@
+2002-09-21 Darin Adler <darin at apple.com>
+
+ WebCore part of the new approach to AppKit drawing control.
+ Works better than the previous try. Once we fix anomalies with focus rectangles
+ and a minor problems with subframes this should work perfectly.
+
+ * kwq/qt/qwidget.h: The paint() method isn't virtual any more. Also remove flushDrawing().
+ * kwq/KWQWidget.mm: (QWidget::enableFlushDrawing): Do a flushWindowIfNeeded instead
+ of requiring a separate flushDrawing() call to do a flushWindow.
+ (QWidget::paint): Added. Calls displayRectIgnoringOpacity.
+
+ * kwq/qt/qbutton.h: Remove paint() override.
+ * kwq/KWQButton.mm: (QButton::QButton): No need for a subclass any more, so
+ drop KWQNSButton. Also remove paint().
+
+ * kwq/qt/qcombobox.h: Remove paint() override.
+ * kwq/KWQComboBox.mm: (QComboBox::QComboBox): No need for a subclass any more, so
+ drop KWQNSPopUpButton. Also remove paint() method.
+
+ * kwq/qt/qlineedit.h: Remove paint() override.
+ * kwq/KWQLineEdit.mm: Remove paint().
+
+ * kwq/KWQFileButton.mm: (KWQFileButton::clicked): Fix typo. Was calling paint
+ instead of clicked on the base class.
+
+ * kwq/KWQNSTextField.h: Remove paint method.
+ * kwq/KWQNSTextField.mm:
+ (-[KWQNSTextField display]): Add a display method that does nothing to work around
+ bug 2753974.
+ (-[KWQSecureTextField display]): Ditto.
+
+ * khtml/rendering/render_frames.cpp: (RenderFrameSet::userResize): Remove call to flushDrawing.
+
2002-09-20 Richard Williamson <rjw at apple.com>
Don't modify selection if no appropriate DOM::Node under
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index b98e793..b0ba378 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,36 @@
+2002-09-21 Darin Adler <darin at apple.com>
+
+ WebCore part of the new approach to AppKit drawing control.
+ Works better than the previous try. Once we fix anomalies with focus rectangles
+ and a minor problems with subframes this should work perfectly.
+
+ * kwq/qt/qwidget.h: The paint() method isn't virtual any more. Also remove flushDrawing().
+ * kwq/KWQWidget.mm: (QWidget::enableFlushDrawing): Do a flushWindowIfNeeded instead
+ of requiring a separate flushDrawing() call to do a flushWindow.
+ (QWidget::paint): Added. Calls displayRectIgnoringOpacity.
+
+ * kwq/qt/qbutton.h: Remove paint() override.
+ * kwq/KWQButton.mm: (QButton::QButton): No need for a subclass any more, so
+ drop KWQNSButton. Also remove paint().
+
+ * kwq/qt/qcombobox.h: Remove paint() override.
+ * kwq/KWQComboBox.mm: (QComboBox::QComboBox): No need for a subclass any more, so
+ drop KWQNSPopUpButton. Also remove paint() method.
+
+ * kwq/qt/qlineedit.h: Remove paint() override.
+ * kwq/KWQLineEdit.mm: Remove paint().
+
+ * kwq/KWQFileButton.mm: (KWQFileButton::clicked): Fix typo. Was calling paint
+ instead of clicked on the base class.
+
+ * kwq/KWQNSTextField.h: Remove paint method.
+ * kwq/KWQNSTextField.mm:
+ (-[KWQNSTextField display]): Add a display method that does nothing to work around
+ bug 2753974.
+ (-[KWQSecureTextField display]): Ditto.
+
+ * khtml/rendering/render_frames.cpp: (RenderFrameSet::userResize): Remove call to flushDrawing.
+
2002-09-20 Richard Williamson <rjw at apple.com>
Don't modify selection if no appropriate DOM::Node under
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index b98e793..b0ba378 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,36 @@
+2002-09-21 Darin Adler <darin at apple.com>
+
+ WebCore part of the new approach to AppKit drawing control.
+ Works better than the previous try. Once we fix anomalies with focus rectangles
+ and a minor problems with subframes this should work perfectly.
+
+ * kwq/qt/qwidget.h: The paint() method isn't virtual any more. Also remove flushDrawing().
+ * kwq/KWQWidget.mm: (QWidget::enableFlushDrawing): Do a flushWindowIfNeeded instead
+ of requiring a separate flushDrawing() call to do a flushWindow.
+ (QWidget::paint): Added. Calls displayRectIgnoringOpacity.
+
+ * kwq/qt/qbutton.h: Remove paint() override.
+ * kwq/KWQButton.mm: (QButton::QButton): No need for a subclass any more, so
+ drop KWQNSButton. Also remove paint().
+
+ * kwq/qt/qcombobox.h: Remove paint() override.
+ * kwq/KWQComboBox.mm: (QComboBox::QComboBox): No need for a subclass any more, so
+ drop KWQNSPopUpButton. Also remove paint() method.
+
+ * kwq/qt/qlineedit.h: Remove paint() override.
+ * kwq/KWQLineEdit.mm: Remove paint().
+
+ * kwq/KWQFileButton.mm: (KWQFileButton::clicked): Fix typo. Was calling paint
+ instead of clicked on the base class.
+
+ * kwq/KWQNSTextField.h: Remove paint method.
+ * kwq/KWQNSTextField.mm:
+ (-[KWQNSTextField display]): Add a display method that does nothing to work around
+ bug 2753974.
+ (-[KWQSecureTextField display]): Ditto.
+
+ * khtml/rendering/render_frames.cpp: (RenderFrameSet::userResize): Remove call to flushDrawing.
+
2002-09-20 Richard Williamson <rjw at apple.com>
Don't modify selection if no appropriate DOM::Node under
diff --git a/WebCore/khtml/rendering/render_frames.cpp b/WebCore/khtml/rendering/render_frames.cpp
index 6f59fe1..90ed339 100644
--- a/WebCore/khtml/rendering/render_frames.cpp
+++ b/WebCore/khtml/rendering/render_frames.cpp
@@ -506,7 +506,6 @@ bool RenderFrameSet::userResize( MouseEventImpl *evt )
#ifdef APPLE_CHANGES
v->unlockDrawingFocus();
v->enableFlushDrawing();
- v->flushDrawing();
#endif
}
diff --git a/WebCore/kwq/KWQButton.h b/WebCore/kwq/KWQButton.h
index 0dbd244..dba87da 100644
--- a/WebCore/kwq/KWQButton.h
+++ b/WebCore/kwq/KWQButton.h
@@ -45,7 +45,6 @@ public:
QString text() const;
virtual void clicked();
- virtual void paint();
private:
KWQSignal m_clicked;
diff --git a/WebCore/kwq/KWQButton.mm b/WebCore/kwq/KWQButton.mm
index 77f833e..6ce0cdb 100644
--- a/WebCore/kwq/KWQButton.mm
+++ b/WebCore/kwq/KWQButton.mm
@@ -37,20 +37,11 @@
@end
- at interface KWQNSButton : NSButton
-{
-}
-
-- (void)paint;
-- (void)drawRect: (NSRect)rect;
-
- at end
-
QButton::QButton()
: m_clicked(this, SIGNAL(clicked()))
, m_adapter([[KWQButtonAdapter alloc] initWithQButton:this])
{
- KWQNSButton *button = [[KWQNSButton alloc] init];
+ NSButton *button = [[NSButton alloc] init];
[button setTarget:m_adapter];
[button setAction:@selector(action:)];
@@ -71,12 +62,6 @@ QButton::~QButton()
[m_adapter release];
}
-void QButton::paint()
-{
- KWQNSButton* button = (KWQNSButton*)getView();
- [button paint];
-}
-
void QButton::setText(const QString &s)
{
NSButton *button = (NSButton *)getView();
@@ -108,19 +93,3 @@ void QButton::clicked()
}
@end
-
- at implementation KWQNSButton
-
-- (void)drawRect: (NSRect)rect
-{
-}
-
-- (void)paint
-{
- [self lockFocus];
- [super drawRect: [self bounds]];
- [self unlockFocus];
-}
-
- at end
-
diff --git a/WebCore/kwq/KWQComboBox.h b/WebCore/kwq/KWQComboBox.h
index 0dc99e8..21a2160 100644
--- a/WebCore/kwq/KWQComboBox.h
+++ b/WebCore/kwq/KWQComboBox.h
@@ -49,8 +49,6 @@ public:
QListBox *listBox() const { return 0; }
void popup() { }
- virtual void paint();
-
QSize sizeHint() const;
QRect frameGeometry() const;
void setFrameGeometry(const QRect &);
diff --git a/WebCore/kwq/KWQComboBox.mm b/WebCore/kwq/KWQComboBox.mm
index 9e5e4fe..bd6249a 100644
--- a/WebCore/kwq/KWQComboBox.mm
+++ b/WebCore/kwq/KWQComboBox.mm
@@ -55,35 +55,11 @@
- initWithWidget:(QWidget *)widget;
@end
- at interface KWQNSPopUpButton : NSPopUpButton
-{
-}
-
-- (void)paint;
-- (void)drawRect: (NSRect)rect;
-
- at end
-
- at implementation KWQNSPopUpButton
-
-- (void)drawRect: (NSRect)rect
-{
-}
-
-- (void)paint
-{
- [self lockFocus];
- [super drawRect: [self bounds]];
- [self unlockFocus];
-}
-
- at end
-
QComboBox::QComboBox()
: m_activated(this, SIGNAL(activated(int)))
, m_adapter([[KWQComboBoxAdapter alloc] initWithQComboBox:this])
{
- KWQNSPopUpButton *button = [[KWQNSPopUpButton alloc] init];
+ NSPopUpButton *button = [[NSPopUpButton alloc] init];
KWQPopUpButtonCell *cell = [[KWQPopUpButtonCell alloc] initWithWidget:this];
[button setCell:cell];
@@ -124,12 +100,6 @@ void QComboBox::insertItem(const QString &text, int index)
[[button itemAtIndex:index] setTitle:text.getNSString()];
}
-void QComboBox::paint()
-{
- KWQNSPopUpButton *button = (NSPopUpButton *)getView();
- [button paint];
-}
-
QSize QComboBox::sizeHint() const
{
NSPopUpButton *button = (NSPopUpButton *)getView();
diff --git a/WebCore/kwq/KWQFileButton.mm b/WebCore/kwq/KWQFileButton.mm
index a2660db..d3fbcde 100644
--- a/WebCore/kwq/KWQFileButton.mm
+++ b/WebCore/kwq/KWQFileButton.mm
@@ -95,7 +95,7 @@ void KWQFileButton::clicked()
didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:)
contextInfo:nil];
- QPushButton::paint();
+ QPushButton::clicked();
}
QSize KWQFileButton::sizeHint() const
diff --git a/WebCore/kwq/KWQLineEdit.h b/WebCore/kwq/KWQLineEdit.h
index 00b8828..dc002b5 100644
--- a/WebCore/kwq/KWQLineEdit.h
+++ b/WebCore/kwq/KWQLineEdit.h
@@ -54,8 +54,6 @@ public:
void setFont(const QFont &font);
- virtual void paint();
-
QSize sizeForCharacterWidth(int numCharacters) const;
QRect frameGeometry() const;
void setFrameGeometry(const QRect &);
diff --git a/WebCore/kwq/KWQLineEdit.mm b/WebCore/kwq/KWQLineEdit.mm
index 988da2d..49c503f 100644
--- a/WebCore/kwq/KWQLineEdit.mm
+++ b/WebCore/kwq/KWQLineEdit.mm
@@ -47,12 +47,6 @@ void QLineEdit::setEchoMode(EchoMode mode)
[textField setPasswordMode:mode == Password];
}
-void QLineEdit::paint()
-{
- KWQNSTextField *textField = (KWQNSTextField *)getView();
- [textField paint];
-}
-
void QLineEdit::setCursorPosition(int)
{
// Don't do anything here.
diff --git a/WebCore/kwq/KWQNSTextField.h b/WebCore/kwq/KWQNSTextField.h
index eecf5be..fbe9bcc 100644
--- a/WebCore/kwq/KWQNSTextField.h
+++ b/WebCore/kwq/KWQNSTextField.h
@@ -28,7 +28,7 @@
class QLineEdit;
@class KWQTextFieldFormatter;
-#define FOCUS_BORDER_SIZE 3
+#define FOCUS_BORDER_SIZE 4
@interface KWQNSTextField : NSTextField
{
@@ -42,9 +42,6 @@ class QLineEdit;
- initWithQLineEdit:(QLineEdit *)widget;
-- (void)drawRect:(NSRect)rect;
-- (void)paint;
-
- (void)setPasswordMode:(BOOL)flag;
- (BOOL)passwordMode;
- (void)setMaximumLength:(int)len;
diff --git a/WebCore/kwq/KWQNSTextField.mm b/WebCore/kwq/KWQNSTextField.mm
index 3c84923..6a4471d 100644
--- a/WebCore/kwq/KWQNSTextField.mm
+++ b/WebCore/kwq/KWQNSTextField.mm
@@ -123,17 +123,6 @@
[secureField setFrame:NSInsetRect([self bounds], FOCUS_BORDER_SIZE, FOCUS_BORDER_SIZE)];
}
-- (void)drawRect:(NSRect)rect;
-{
-}
-
--(void)paint
-{
- [self lockFocus];
- [super drawRect: [self bounds]];
- [self unlockFocus];
-}
-
- (void)setFrameSize:(NSSize)size
{
[super setFrameSize:size];
@@ -298,6 +287,10 @@
[super textDidEndEditing:notification];
}
+- (void)display
+{
+}
+
@end
// This cell is used so that our frame includes the place where the focus rectangle is drawn.
@@ -471,4 +464,8 @@
[super textDidEndEditing:notification];
}
+- (void)display
+{
+}
+
@end
diff --git a/WebCore/kwq/KWQTextField.h b/WebCore/kwq/KWQTextField.h
index eecf5be..fbe9bcc 100644
--- a/WebCore/kwq/KWQTextField.h
+++ b/WebCore/kwq/KWQTextField.h
@@ -28,7 +28,7 @@
class QLineEdit;
@class KWQTextFieldFormatter;
-#define FOCUS_BORDER_SIZE 3
+#define FOCUS_BORDER_SIZE 4
@interface KWQNSTextField : NSTextField
{
@@ -42,9 +42,6 @@ class QLineEdit;
- initWithQLineEdit:(QLineEdit *)widget;
-- (void)drawRect:(NSRect)rect;
-- (void)paint;
-
- (void)setPasswordMode:(BOOL)flag;
- (BOOL)passwordMode;
- (void)setMaximumLength:(int)len;
diff --git a/WebCore/kwq/KWQTextField.mm b/WebCore/kwq/KWQTextField.mm
index 3c84923..6a4471d 100644
--- a/WebCore/kwq/KWQTextField.mm
+++ b/WebCore/kwq/KWQTextField.mm
@@ -123,17 +123,6 @@
[secureField setFrame:NSInsetRect([self bounds], FOCUS_BORDER_SIZE, FOCUS_BORDER_SIZE)];
}
-- (void)drawRect:(NSRect)rect;
-{
-}
-
--(void)paint
-{
- [self lockFocus];
- [super drawRect: [self bounds]];
- [self unlockFocus];
-}
-
- (void)setFrameSize:(NSSize)size
{
[super setFrameSize:size];
@@ -298,6 +287,10 @@
[super textDidEndEditing:notification];
}
+- (void)display
+{
+}
+
@end
// This cell is used so that our frame includes the place where the focus rectangle is drawn.
@@ -471,4 +464,8 @@
[super textDidEndEditing:notification];
}
+- (void)display
+{
+}
+
@end
diff --git a/WebCore/kwq/KWQWidget.h b/WebCore/kwq/KWQWidget.h
index 769f3e2..927b49e 100644
--- a/WebCore/kwq/KWQWidget.h
+++ b/WebCore/kwq/KWQWidget.h
@@ -87,7 +87,7 @@ public:
void move(int, int);
void move(const QPoint &);
- virtual void paint() {};
+ virtual void paint();
virtual QRect frameGeometry() const;
virtual void setFrameGeometry(const QRect &);
@@ -149,7 +149,6 @@ public:
void unlockDrawingFocus();
void enableFlushDrawing();
void disableFlushDrawing();
- void flushDrawing();
void setDrawingAlpha(float alpha);
private:
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index a806d8b..f4c157c 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -372,30 +372,24 @@ void QWidget::unlockDrawingFocus()
[getView() unlockFocus];
}
-void QWidget::flushDrawing()
+void QWidget::disableFlushDrawing()
{
- [[getView() window] flushWindow];
+ [[getView() window] disableFlushWindow];
}
void QWidget::enableFlushDrawing()
{
[[getView() window] enableFlushWindow];
-}
-
-
-void QWidget::disableFlushDrawing()
-{
- [[getView() window] disableFlushWindow];
+ [[getView() window] flushWindowIfNeeded];
}
void QWidget::setDrawingAlpha(float alpha)
{
- CGContextRef cgContext;
- cgContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
- CGContextSetAlpha(cgContext, alpha);
+ CGContextSetAlpha((CGContextRef)[[NSGraphicsContext currentContext] graphicsPort], alpha);
}
-void QWidget::displayRect(int x, int y, int w, int h)
+void QWidget::paint()
{
- [getView() displayRect: NSMakeRect (x,y,w,h)];
+ // FIXME: Should pass in a rectangle and display less.
+ [getView() displayRectIgnoringOpacity:[getView() bounds]];
}
diff --git a/WebCore/kwq/qt/qbutton.h b/WebCore/kwq/qt/qbutton.h
index 0dbd244..dba87da 100644
--- a/WebCore/kwq/qt/qbutton.h
+++ b/WebCore/kwq/qt/qbutton.h
@@ -45,7 +45,6 @@ public:
QString text() const;
virtual void clicked();
- virtual void paint();
private:
KWQSignal m_clicked;
diff --git a/WebCore/kwq/qt/qcombobox.h b/WebCore/kwq/qt/qcombobox.h
index 0dc99e8..21a2160 100644
--- a/WebCore/kwq/qt/qcombobox.h
+++ b/WebCore/kwq/qt/qcombobox.h
@@ -49,8 +49,6 @@ public:
QListBox *listBox() const { return 0; }
void popup() { }
- virtual void paint();
-
QSize sizeHint() const;
QRect frameGeometry() const;
void setFrameGeometry(const QRect &);
diff --git a/WebCore/kwq/qt/qlineedit.h b/WebCore/kwq/qt/qlineedit.h
index 00b8828..dc002b5 100644
--- a/WebCore/kwq/qt/qlineedit.h
+++ b/WebCore/kwq/qt/qlineedit.h
@@ -54,8 +54,6 @@ public:
void setFont(const QFont &font);
- virtual void paint();
-
QSize sizeForCharacterWidth(int numCharacters) const;
QRect frameGeometry() const;
void setFrameGeometry(const QRect &);
diff --git a/WebCore/kwq/qt/qwidget.h b/WebCore/kwq/qt/qwidget.h
index 769f3e2..927b49e 100644
--- a/WebCore/kwq/qt/qwidget.h
+++ b/WebCore/kwq/qt/qwidget.h
@@ -87,7 +87,7 @@ public:
void move(int, int);
void move(const QPoint &);
- virtual void paint() {};
+ virtual void paint();
virtual QRect frameGeometry() const;
virtual void setFrameGeometry(const QRect &);
@@ -149,7 +149,6 @@ public:
void unlockDrawingFocus();
void enableFlushDrawing();
void disableFlushDrawing();
- void flushDrawing();
void setDrawingAlpha(float alpha);
private:
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 19d09af..f92dbf2 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,22 @@
+2002-09-21 Darin Adler <darin at apple.com>
+
+ WebKit part of the new approach to AppKit drawing control.
+ Works better than the previous try. Once we fix anomalies with focus rectangles
+ and a some remaining problems with subframes this should work perfectly.
+
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView isOpaque]): Return NO for frames other than the main frame.
+ (-[WebHTMLView drawRect:]): Restore the subviews that were set aside.
+ * WebView.subproj/WebHTMLViewPrivate.h: Add _isMainFrame. Add savedSubviews and subviewsSetAside.
+ * WebView.subproj/WebHTMLViewPrivate.m:
+ (-[WebHTMLView _isMainFrame]): Added.
+ (-[WebHTMLView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]):
+ Added. If this is the main frame, get all the dirty rects from the subviews and then set
+ them aside so the AppKit machinery won't draw them.
+ (-[WebHTMLView _recursiveDisplayAllDirtyWithLockFocus:visRect:]): Ditto.
+ (-[NSView _web_propagateDirtyRectToAncestor]): Added. Propagates dirty rects the same
+ way that AppKit does, but always does it, ignoring the value of isOpaque.
+
2002-09-20 Darin Adler <darin at apple.com>
* History.subproj/WebHistory.m: (-[WebHistory addEntryForURLString:]):
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 19d09af..f92dbf2 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,22 @@
+2002-09-21 Darin Adler <darin at apple.com>
+
+ WebKit part of the new approach to AppKit drawing control.
+ Works better than the previous try. Once we fix anomalies with focus rectangles
+ and a some remaining problems with subframes this should work perfectly.
+
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView isOpaque]): Return NO for frames other than the main frame.
+ (-[WebHTMLView drawRect:]): Restore the subviews that were set aside.
+ * WebView.subproj/WebHTMLViewPrivate.h: Add _isMainFrame. Add savedSubviews and subviewsSetAside.
+ * WebView.subproj/WebHTMLViewPrivate.m:
+ (-[WebHTMLView _isMainFrame]): Added.
+ (-[WebHTMLView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]):
+ Added. If this is the main frame, get all the dirty rects from the subviews and then set
+ them aside so the AppKit machinery won't draw them.
+ (-[WebHTMLView _recursiveDisplayAllDirtyWithLockFocus:visRect:]): Ditto.
+ (-[NSView _web_propagateDirtyRectToAncestor]): Added. Propagates dirty rects the same
+ way that AppKit does, but always does it, ignoring the value of isOpaque.
+
2002-09-20 Darin Adler <darin at apple.com>
* History.subproj/WebHistory.m: (-[WebHistory addEntryForURLString:]):
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 5c00e34..1f0151c 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -309,7 +309,7 @@
- (BOOL)isOpaque
{
- return YES;
+ return [self _isMainFrame];
}
@@ -338,6 +338,12 @@
{
LOG(View, "%@ drawing", self);
+ if (_private->savedSubviews) {
+ ASSERT(_subviews == nil);
+ _subviews = _private->savedSubviews;
+ _private->savedSubviews = nil;
+ }
+
if ([self inLiveResize]){
if (!NSEqualRects(rect, [self visibleRect])){
rect = [self visibleRect];
@@ -386,6 +392,12 @@
double thisTime = CFAbsoluteTimeGetCurrent() - start;
LOG(Timing, "%s draw seconds = %f", widget->part()->baseURL().URL().latin1(), thisTime);
#endif
+
+ if (_private->subviewsSetAside) {
+ ASSERT(_private->savedSubviews == nil);
+ _private->savedSubviews = _subviews;
+ _subviews = nil;
+ }
}
- (BOOL)isFlipped
@@ -706,7 +718,4 @@
{
}
-
-
-
@end
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.h b/WebKit/WebView.subproj/WebHTMLViewPrivate.h
index 39cb071..5dfdd5f 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.h
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.h
@@ -24,6 +24,9 @@
BOOL inWindow;
BOOL inNextValidKeyView;
NSURL *draggedURL;
+
+ id savedSubviews;
+ BOOL subviewsSetAside;
}
@end
@@ -31,6 +34,7 @@
- (void)_reset;
- (WebController *)_controller;
- (WebFrame *)_frame;
+- (BOOL)_isMainFrame;
- (WebBridge *)_bridge;
- (void)_adjustFrames;
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.m b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
index 1dce93b..570c63e 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.m
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
@@ -10,6 +10,8 @@
#import <AppKit/NSResponder_Private.h>
+#import <WebFoundation/WebAssertions.h>
+
#import <WebKit/WebBridge.h>
#import <WebKit/WebContextMenuHandler.h>
#import <WebKit/WebController.h>
@@ -22,18 +24,16 @@
#import <WebKit/WebViewPrivate.h>
#import <WebKit/WebWindowContext.h>
- at interface NSView (WebHTMLViewPrivate)
-- (void)_web_stopIfPluginView;
+ at interface NSView (AppKitSecretsIKnowAbout)
+- (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;
@end
- at implementation NSView (WebHTMLViewPrivate)
-- (void)_web_stopIfPluginView
-{
- if ([self isKindOfClass:[WebNetscapePluginView class]]) {
- WebNetscapePluginView *pluginView = (WebNetscapePluginView *)self;
- [pluginView stop];
- }
-}
+ at interface NSView (WebNSViewDisplayExtras)
+- (void)_web_stopIfPluginView;
+- (void)_web_propagateDirtyRectToAncestor;
@end
@implementation WebHTMLViewPrivate
@@ -77,6 +77,12 @@
return [[webView _controller] frameForView:webView];
}
+- (BOOL)_isMainFrame
+{
+ WebFrame *frame = [self _frame];
+ return frame == [[frame controller] mainFrame];
+}
+
// Required so view can access the part's selection.
- (WebBridge *)_bridge
{
@@ -149,4 +155,76 @@ BOOL _modifierTrackingEnabled = FALSE;
return NO;
}
+
+// Don't let AppKit even draw subviews. We take care of that.
+- (void)_recursiveDisplayRectIfNeededIgnoringOpacity:(NSRect)rect isVisibleRect:(BOOL)isVisibleRect rectIsVisibleRectForView:(NSView *)visibleView topView:(BOOL)topView
+{
+ BOOL setAsideSubviews = [self _isMainFrame];
+
+ if (setAsideSubviews) {
+ [_subviews makeObjectsPerformSelector:@selector(_web_propagateDirtyRectToAncestor)];
+
+ ASSERT(!_private->subviewsSetAside);
+ ASSERT(_private->savedSubviews == nil);
+ _private->savedSubviews = _subviews;
+ _subviews = nil;
+ _private->subviewsSetAside = YES;
+ }
+
+ [super _recursiveDisplayRectIfNeededIgnoringOpacity:rect isVisibleRect:isVisibleRect
+ rectIsVisibleRectForView:visibleView topView:topView];
+
+ if (setAsideSubviews) {
+ ASSERT(_subviews == nil);
+ _subviews = _private->savedSubviews;
+ _private->savedSubviews = nil;
+ _private->subviewsSetAside = NO;
+ }
+}
+
+// Don't let AppKit even draw subviews. We take care of that.
+- (void)_recursiveDisplayAllDirtyWithLockFocus:(BOOL)needsLockFocus visRect:(NSRect)visRect
+{
+ BOOL setAsideSubviews = [self _isMainFrame] && !_private->subviewsSetAside;
+
+ if (setAsideSubviews) {
+ [_subviews makeObjectsPerformSelector:@selector(_web_propagateDirtyRectToAncestor)];
+
+ ASSERT(!_private->subviewsSetAside);
+ ASSERT(_private->savedSubviews == nil);
+ _private->savedSubviews = _subviews;
+ _subviews = nil;
+ _private->subviewsSetAside = YES;
+ }
+
+ [super _recursiveDisplayAllDirtyWithLockFocus:needsLockFocus visRect:visRect];
+
+ if (setAsideSubviews) {
+ ASSERT(_subviews == nil);
+ _subviews = _private->savedSubviews;
+ _private->savedSubviews = nil;
+ _private->subviewsSetAside = NO;
+ }
+}
+
+ at end
+
+ at implementation NSView (WebHTMLViewPrivate)
+
+- (void)_web_stopIfPluginView
+{
+ if ([self isKindOfClass:[WebNetscapePluginView class]]) {
+ WebNetscapePluginView *pluginView = (WebNetscapePluginView *)self;
+ [pluginView stop];
+ }
+}
+
+- (void)_web_propagateDirtyRectToAncestor
+{
+ [_subviews makeObjectsPerformSelector:@selector(_web_propagateDirtyRectToAncestor)];
+ if ([self needsDisplay]) {
+ [[self superview] setNeedsDisplayInRect:[self _convertRectToSuperview:[self _dirtyRect]]];
+ }
+}
+
@end
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list