[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:34:48 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit e978232084472e338b258480409ee2f8392a7971
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Aug 27 23:25:36 2002 +0000
- fixed 3021018 -- Crash selecting from popup just after choosing radio button
* kwq/KWQComboBox.mm:
(QComboBox::QComboBox): Pass the widget in when creating the cell.
(-[KWQPopUpButtonCell initWithWidget:]): Store a widget pointer.
(-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Get to the bridge
and tell it to defer loading while we track the mouse.
* kwq/KWQKHTMLPartImpl.h: Add bridgeForWidget.
* kwq/KWQKHTMLPartImpl.mm:
(KWQKHTMLPartImpl::nextKeyViewForWidget): Use nodeForWidget and partForNode.
(KWQKHTMLPartImpl::bridgeForWidget): Added. Use nodeForWidget and partForNode.
(KWQKHTMLPartImpl::partForNode): Move code here from nextKeyViewForWidget.
(KWQKHTMLPartImpl::nodeForWidget): Move code here from nextKeyViewForWidget.
* kwq/WebCoreBridge.h: Add defersLoading and setDefersLoading. Both are already
in WebKit.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 3dbd811..7b50889 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,23 @@
+2002-08-27 Darin Adler <darin at apple.com>
+
+ - fixed 3021018 -- Crash selecting from popup just after choosing radio button
+
+ * kwq/KWQComboBox.mm:
+ (QComboBox::QComboBox): Pass the widget in when creating the cell.
+ (-[KWQPopUpButtonCell initWithWidget:]): Store a widget pointer.
+ (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Get to the bridge
+ and tell it to defer loading while we track the mouse.
+
+ * kwq/KWQKHTMLPartImpl.h: Add bridgeForWidget.
+ * kwq/KWQKHTMLPartImpl.mm:
+ (KWQKHTMLPartImpl::nextKeyViewForWidget): Use nodeForWidget and partForNode.
+ (KWQKHTMLPartImpl::bridgeForWidget): Added. Use nodeForWidget and partForNode.
+ (KWQKHTMLPartImpl::partForNode): Move code here from nextKeyViewForWidget.
+ (KWQKHTMLPartImpl::nodeForWidget): Move code here from nextKeyViewForWidget.
+
+ * kwq/WebCoreBridge.h: Add defersLoading and setDefersLoading. Both are already
+ in WebKit.
+
2002-08-26 David Hyatt <hyatt at apple.com>
Fix for 3026006. Ensure that TABLES inside <div>s with align="right"
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 3dbd811..7b50889 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,23 @@
+2002-08-27 Darin Adler <darin at apple.com>
+
+ - fixed 3021018 -- Crash selecting from popup just after choosing radio button
+
+ * kwq/KWQComboBox.mm:
+ (QComboBox::QComboBox): Pass the widget in when creating the cell.
+ (-[KWQPopUpButtonCell initWithWidget:]): Store a widget pointer.
+ (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Get to the bridge
+ and tell it to defer loading while we track the mouse.
+
+ * kwq/KWQKHTMLPartImpl.h: Add bridgeForWidget.
+ * kwq/KWQKHTMLPartImpl.mm:
+ (KWQKHTMLPartImpl::nextKeyViewForWidget): Use nodeForWidget and partForNode.
+ (KWQKHTMLPartImpl::bridgeForWidget): Added. Use nodeForWidget and partForNode.
+ (KWQKHTMLPartImpl::partForNode): Move code here from nextKeyViewForWidget.
+ (KWQKHTMLPartImpl::nodeForWidget): Move code here from nextKeyViewForWidget.
+
+ * kwq/WebCoreBridge.h: Add defersLoading and setDefersLoading. Both are already
+ in WebKit.
+
2002-08-26 David Hyatt <hyatt at apple.com>
Fix for 3026006. Ensure that TABLES inside <div>s with align="right"
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 3dbd811..7b50889 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,23 @@
+2002-08-27 Darin Adler <darin at apple.com>
+
+ - fixed 3021018 -- Crash selecting from popup just after choosing radio button
+
+ * kwq/KWQComboBox.mm:
+ (QComboBox::QComboBox): Pass the widget in when creating the cell.
+ (-[KWQPopUpButtonCell initWithWidget:]): Store a widget pointer.
+ (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Get to the bridge
+ and tell it to defer loading while we track the mouse.
+
+ * kwq/KWQKHTMLPartImpl.h: Add bridgeForWidget.
+ * kwq/KWQKHTMLPartImpl.mm:
+ (KWQKHTMLPartImpl::nextKeyViewForWidget): Use nodeForWidget and partForNode.
+ (KWQKHTMLPartImpl::bridgeForWidget): Added. Use nodeForWidget and partForNode.
+ (KWQKHTMLPartImpl::partForNode): Move code here from nextKeyViewForWidget.
+ (KWQKHTMLPartImpl::nodeForWidget): Move code here from nextKeyViewForWidget.
+
+ * kwq/WebCoreBridge.h: Add defersLoading and setDefersLoading. Both are already
+ in WebKit.
+
2002-08-26 David Hyatt <hyatt at apple.com>
Fix for 3026006. Ensure that TABLES inside <div>s with align="right"
diff --git a/WebCore/kwq/KWQComboBox.mm b/WebCore/kwq/KWQComboBox.mm
index 5595c11..9bc9219 100644
--- a/WebCore/kwq/KWQComboBox.mm
+++ b/WebCore/kwq/KWQComboBox.mm
@@ -26,6 +26,8 @@
#import <qcombobox.h>
#import <kwqdebug.h>
+#import <KWQKHTMLPartImpl.h>
+#import <WebCoreBridge.h>
// We empirically determined that combo boxes have these extra pixels on all
// sides. It would be better to get this info from AppKit somehow.
@@ -43,26 +45,15 @@
{
QComboBox *box;
}
-
- initWithQComboBox:(QComboBox *)b;
- (void)action:(id)sender;
-
@end
@interface KWQPopUpButtonCell : NSPopUpButtonCell
{
+ QWidget *widget;
}
- at end
-
- at implementation KWQPopUpButtonCell
-
-- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
-{
- cellFrame.origin.y += TEXT_VERTICAL_NUDGE;
- cellFrame.size.height -= TEXT_VERTICAL_NUDGE;
- [super drawInteriorWithFrame:cellFrame inView:controlView];
-}
-
+- initWithWidget:(QWidget *)widget;
@end
QComboBox::QComboBox()
@@ -71,7 +62,7 @@ QComboBox::QComboBox()
{
NSPopUpButton *button = [[NSPopUpButton alloc] init];
- KWQPopUpButtonCell *cell = [[KWQPopUpButtonCell alloc] init];
+ KWQPopUpButtonCell *cell = [[KWQPopUpButtonCell alloc] initWithWidget:this];
[button setCell:cell];
[cell release];
@@ -172,3 +163,41 @@ int QComboBox::currentItem() const
}
@end
+
+ at implementation KWQPopUpButtonCell
+
+- initWithWidget:(QWidget *)w
+{
+ [super init];
+ widget = w;
+ return self;
+}
+
+- (BOOL)trackMouse:(NSEvent *)event inRect:(NSRect)rect ofView:(NSView *)view untilMouseUp:(BOOL)flag
+{
+ // We need to "defer loading" while we are tracking the menu.
+ // That's because we don't want the new page to load while the user is holding the mouse down.
+ // Normally, this is not a problem because we use a different run loop mode, but pop-up menus
+ // use a Carbon implementation, and it uses the default run loop mode.
+ // See bug 3021018 for more information.
+
+ WebCoreBridge *bridge = KWQKHTMLPartImpl::bridgeForWidget(widget);
+ BOOL wasDeferringLoading = [bridge defersLoading];
+ if (!wasDeferringLoading) {
+ [bridge setDefersLoading:YES];
+ }
+ BOOL result = [super trackMouse:event inRect:rect ofView:view untilMouseUp:flag];
+ if (!wasDeferringLoading) {
+ [bridge setDefersLoading:NO];
+ }
+ return result;
+}
+
+- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
+{
+ cellFrame.origin.y += TEXT_VERTICAL_NUDGE;
+ cellFrame.size.height -= TEXT_VERTICAL_NUDGE;
+ [super drawInteriorWithFrame:cellFrame inView:controlView];
+}
+
+ at end
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index 1b43940..3694a66 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -108,6 +108,8 @@ public:
NSView *nextKeyViewInFrameHierarchy(DOM::NodeImpl *startingPoint, KWQSelectionDirection);
static NSView *nextKeyViewForWidget(QWidget *startingPoint, KWQSelectionDirection);
+ static WebCoreBridge *bridgeForWidget(QWidget *);
+
// Incoming calls, used by the bridge.
DOM::DocumentImpl *document();
@@ -121,6 +123,8 @@ private:
WebCoreBridge *bridgeForFrameName(const QString &frameName);
NSView *nextKeyViewInFrame(DOM::NodeImpl *startingPoint, KWQSelectionDirection);
+ static DOM::NodeImpl *nodeForWidget(QWidget *);
+ static KWQKHTMLPartImpl *partForNode(DOM::NodeImpl *);
KHTMLPart *part;
KHTMLPartPrivate *d;
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index ff06876..6bd3e6a 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -618,6 +618,21 @@ NSView *KWQKHTMLPartImpl::nextKeyViewForWidget(QWidget *startingWidget, KWQSelec
{
// Use the event filter object to figure out which RenderWidget owns this QWidget and get to the DOM.
// Then get the next key view in the order determined by the DOM.
- NodeImpl *node = static_cast<const RenderWidget *>(startingWidget->eventFilterObject())->element();
- return node->getDocument()->view()->part()->impl->nextKeyView(node, direction);
+ NodeImpl *node = nodeForWidget(startingWidget);
+ return partForNode(node)->nextKeyView(node, direction);
+}
+
+WebCoreBridge *KWQKHTMLPartImpl::bridgeForWidget(QWidget *widget)
+{
+ return partForNode(nodeForWidget(widget))->bridge();
+}
+
+KWQKHTMLPartImpl *KWQKHTMLPartImpl::partForNode(NodeImpl *node)
+{
+ return node->getDocument()->view()->part()->impl;
+}
+
+NodeImpl *KWQKHTMLPartImpl::nodeForWidget(QWidget *widget)
+{
+ return static_cast<const RenderWidget *>(widget->eventFilterObject())->element();
}
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.h b/WebCore/kwq/KWQKHTMLPartImpl.h
index 1b43940..3694a66 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.h
+++ b/WebCore/kwq/KWQKHTMLPartImpl.h
@@ -108,6 +108,8 @@ public:
NSView *nextKeyViewInFrameHierarchy(DOM::NodeImpl *startingPoint, KWQSelectionDirection);
static NSView *nextKeyViewForWidget(QWidget *startingPoint, KWQSelectionDirection);
+ static WebCoreBridge *bridgeForWidget(QWidget *);
+
// Incoming calls, used by the bridge.
DOM::DocumentImpl *document();
@@ -121,6 +123,8 @@ private:
WebCoreBridge *bridgeForFrameName(const QString &frameName);
NSView *nextKeyViewInFrame(DOM::NodeImpl *startingPoint, KWQSelectionDirection);
+ static DOM::NodeImpl *nodeForWidget(QWidget *);
+ static KWQKHTMLPartImpl *partForNode(DOM::NodeImpl *);
KHTMLPart *part;
KHTMLPartPrivate *d;
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index ff06876..6bd3e6a 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -618,6 +618,21 @@ NSView *KWQKHTMLPartImpl::nextKeyViewForWidget(QWidget *startingWidget, KWQSelec
{
// Use the event filter object to figure out which RenderWidget owns this QWidget and get to the DOM.
// Then get the next key view in the order determined by the DOM.
- NodeImpl *node = static_cast<const RenderWidget *>(startingWidget->eventFilterObject())->element();
- return node->getDocument()->view()->part()->impl->nextKeyView(node, direction);
+ NodeImpl *node = nodeForWidget(startingWidget);
+ return partForNode(node)->nextKeyView(node, direction);
+}
+
+WebCoreBridge *KWQKHTMLPartImpl::bridgeForWidget(QWidget *widget)
+{
+ return partForNode(nodeForWidget(widget))->bridge();
+}
+
+KWQKHTMLPartImpl *KWQKHTMLPartImpl::partForNode(NodeImpl *node)
+{
+ return node->getDocument()->view()->part()->impl;
+}
+
+NodeImpl *KWQKHTMLPartImpl::nodeForWidget(QWidget *widget)
+{
+ return static_cast<const RenderWidget *>(widget->eventFilterObject())->element();
}
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index e2dde34..5eedb08 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -181,6 +181,9 @@ typedef khtml::RenderPart KHTMLRenderPart;
- (NSView *)nextKeyViewOutsideWebViews;
- (NSView *)previousKeyViewOutsideWebViews;
+- (BOOL)defersLoading;
+- (void)setDefersLoading:(BOOL)loading;
+
@end
// This interface definition allows those who hold a WebCoreBridge * to call all the methods
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list