[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
kocienda
kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:58:59 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 157e740c0bfb56066d85484552754755a551521f
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Oct 1 18:48:13 2003 +0000
Reviewed by Maciej
Fix for these bugs:
<rdar://problem/3439736>: WebCore form button widgets do not accept focus
<rdar://problem/3440770>: WebCore form button widgets do not take part in tabbing order
* kwq/KWQButton.h: Add focusPolicy function declaration.
* kwq/KWQButton.mm:
(-[KWQButton nextKeyView]): Add tabbing support for buttons.
(-[KWQButton previousKeyView]): Ditto
(-[KWQButton nextValidKeyView]): Ditto
(-[KWQButton previousValidKeyView]): Ditto
(QButton::focusPolicy): Add focusPolicy implementation. This calls through
to the recently-added accessor for full keyboard access to help in the
determination for focus policy. For now, full keyboard access must be
turned on for buttons to receive focus.
* kwq/KWQTextEdit.h: Remove focusPolicy specialization from this class. The
implementation in QWidget now serves this class well.
* kwq/KWQTextEdit.mm: Ditto
* kwq/KWQWidget.h: Added isEnabled function. Small, unrelated cleanup to
move the no-implementation setFocusPolicy() and setFocusProxy() functions
fully into the header file.
* kwq/KWQWidget.mm:
(QWidget::isEnabled): Added. Calls through to the Cocoa view to retrieve
this information.
(QWidget::focusPolicy): Much improved focus policy function is now more
general in stipulating the conditions for focus policy, and will work for
more widgets.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5102 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 871cdc8..04f738c 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,35 @@
+2003-10-01 Ken Kocienda <kocienda at apple.com>
+
+ Reviewed by Maciej
+
+ Fix for these bugs:
+
+ <rdar://problem/3439736>: WebCore form button widgets do not accept focus
+ <rdar://problem/3440770>: WebCore form button widgets do not take part in tabbing order
+
+ * kwq/KWQButton.h: Add focusPolicy function declaration.
+ * kwq/KWQButton.mm:
+ (-[KWQButton nextKeyView]): Add tabbing support for buttons.
+ (-[KWQButton previousKeyView]): Ditto
+ (-[KWQButton nextValidKeyView]): Ditto
+ (-[KWQButton previousValidKeyView]): Ditto
+ (QButton::focusPolicy): Add focusPolicy implementation. This calls through
+ to the recently-added accessor for full keyboard access to help in the
+ determination for focus policy. For now, full keyboard access must be
+ turned on for buttons to receive focus.
+ * kwq/KWQTextEdit.h: Remove focusPolicy specialization from this class. The
+ implementation in QWidget now serves this class well.
+ * kwq/KWQTextEdit.mm: Ditto
+ * kwq/KWQWidget.h: Added isEnabled function. Small, unrelated cleanup to
+ move the no-implementation setFocusPolicy() and setFocusProxy() functions
+ fully into the header file.
+ * kwq/KWQWidget.mm:
+ (QWidget::isEnabled): Added. Calls through to the Cocoa view to retrieve
+ this information.
+ (QWidget::focusPolicy): Much improved focus policy function is now more
+ general in stipulating the conditions for focus policy, and will work for
+ more widgets.
+
2003-10-01 David Hyatt <hyatt at apple.com>
Fix for 3440804, broken scrollbars in downloads window. Make Auto be the default
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 871cdc8..04f738c 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,35 @@
+2003-10-01 Ken Kocienda <kocienda at apple.com>
+
+ Reviewed by Maciej
+
+ Fix for these bugs:
+
+ <rdar://problem/3439736>: WebCore form button widgets do not accept focus
+ <rdar://problem/3440770>: WebCore form button widgets do not take part in tabbing order
+
+ * kwq/KWQButton.h: Add focusPolicy function declaration.
+ * kwq/KWQButton.mm:
+ (-[KWQButton nextKeyView]): Add tabbing support for buttons.
+ (-[KWQButton previousKeyView]): Ditto
+ (-[KWQButton nextValidKeyView]): Ditto
+ (-[KWQButton previousValidKeyView]): Ditto
+ (QButton::focusPolicy): Add focusPolicy implementation. This calls through
+ to the recently-added accessor for full keyboard access to help in the
+ determination for focus policy. For now, full keyboard access must be
+ turned on for buttons to receive focus.
+ * kwq/KWQTextEdit.h: Remove focusPolicy specialization from this class. The
+ implementation in QWidget now serves this class well.
+ * kwq/KWQTextEdit.mm: Ditto
+ * kwq/KWQWidget.h: Added isEnabled function. Small, unrelated cleanup to
+ move the no-implementation setFocusPolicy() and setFocusProxy() functions
+ fully into the header file.
+ * kwq/KWQWidget.mm:
+ (QWidget::isEnabled): Added. Calls through to the Cocoa view to retrieve
+ this information.
+ (QWidget::focusPolicy): Much improved focus policy function is now more
+ general in stipulating the conditions for focus policy, and will work for
+ more widgets.
+
2003-10-01 David Hyatt <hyatt at apple.com>
Fix for 3440804, broken scrollbars in downloads window. Make Auto be the default
diff --git a/WebCore/kwq/KWQButton.h b/WebCore/kwq/KWQButton.h
index 7df1f97..25d9654 100644
--- a/WebCore/kwq/KWQButton.h
+++ b/WebCore/kwq/KWQButton.h
@@ -43,6 +43,8 @@ public:
// QWidget overrides
virtual void setFont(const QFont &);
+ virtual QWidget::FocusPolicy QButton::focusPolicy() const;
+
private:
KWQSignal m_clicked;
};
diff --git a/WebCore/kwq/KWQButton.mm b/WebCore/kwq/KWQButton.mm
index 4c0c051..ed119ef 100644
--- a/WebCore/kwq/KWQButton.mm
+++ b/WebCore/kwq/KWQButton.mm
@@ -26,6 +26,8 @@
#import "KWQButton.h"
#import "KWQCheckBox.h"
+#import "KWQKHTMLPart.h"
+#import "WebCoreBridge.h"
#import "render_form.h"
@@ -33,6 +35,7 @@
{
QButton *button;
BOOL needToSendConsumedMouseUp;
+ BOOL inNextValidKeyView;
}
- (id)initWithQButton:(QButton *)b;
@@ -70,6 +73,36 @@
[self sendConsumedMouseUpIfNeeded];
}
+-(NSView *)nextKeyView
+{
+ return button && inNextValidKeyView
+ ? KWQKHTMLPart::nextKeyViewForWidget(button, KWQSelectingNext)
+ : [super nextKeyView];
+}
+
+-(NSView *)previousKeyView
+{
+ return button && inNextValidKeyView
+ ? KWQKHTMLPart::nextKeyViewForWidget(button, KWQSelectingPrevious)
+ : [super previousKeyView];
+}
+
+-(NSView *)nextValidKeyView
+{
+ inNextValidKeyView = YES;
+ NSView *view = [super nextValidKeyView];
+ inNextValidKeyView = NO;
+ return view;
+}
+
+-(NSView *)previousValidKeyView
+{
+ inNextValidKeyView = YES;
+ NSView *view = [super previousValidKeyView];
+ inNextValidKeyView = NO;
+ return view;
+}
+
@end
QButton::QButton()
@@ -150,3 +183,15 @@ NSControlSize KWQNSControlSizeForFont(const QFont &f)
return NSMiniControlSize;
#endif
}
+
+QWidget::FocusPolicy QButton::focusPolicy() const
+{
+ // Add an additional check here.
+ // For now, buttons are only focused when full
+ // keyboard access is turned on.
+ if ([KWQKHTMLPart::bridgeForWidget(this) keyboardUIMode] != WebCoreFullKeyboardAccess)
+ return NoFocus;
+
+ return QWidget::focusPolicy();
+}
+
diff --git a/WebCore/kwq/KWQTextEdit.h b/WebCore/kwq/KWQTextEdit.h
index fcc9f51..b382bf0 100644
--- a/WebCore/kwq/KWQTextEdit.h
+++ b/WebCore/kwq/KWQTextEdit.h
@@ -49,8 +49,6 @@ class QTextEdit : public QScrollView
void setCursorPosition(int, int);
void getCursorPosition(int *, int *) const;
- FocusPolicy focusPolicy() const;
-
void setFont(const QFont &);
void setReadOnly(bool);
diff --git a/WebCore/kwq/KWQTextEdit.mm b/WebCore/kwq/KWQTextEdit.mm
index 311da4c..6fa2a26 100644
--- a/WebCore/kwq/KWQTextEdit.mm
+++ b/WebCore/kwq/KWQTextEdit.mm
@@ -112,11 +112,6 @@ void QTextEdit::setFont(const QFont &font)
[textView setFont:font.getNSFont()];
}
-QWidget::FocusPolicy QTextEdit::focusPolicy() const
-{
- return TabFocus;
-}
-
void QTextEdit::clicked()
{
_clicked.call();
diff --git a/WebCore/kwq/KWQWidget.h b/WebCore/kwq/KWQWidget.h
index 6d694f4..93af5e7 100644
--- a/WebCore/kwq/KWQWidget.h
+++ b/WebCore/kwq/KWQWidget.h
@@ -69,6 +69,7 @@ public:
virtual QSize sizeHint() const;
virtual void setEnabled(bool);
+ virtual bool isEnabled() const;
void setActiveWindow();
@@ -101,9 +102,9 @@ public:
void clearFocus();
virtual FocusPolicy focusPolicy() const;
- virtual void setFocusPolicy(FocusPolicy);
+ void setFocusPolicy(FocusPolicy) {};
- virtual void setFocusProxy(QWidget *);
+ virtual void setFocusProxy(QWidget *) {};
const QPalette& palette() const;
virtual void setPalette(const QPalette &);
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index 73c4441..30d5600 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -33,6 +33,7 @@
#import "khtmlview.h"
#import "render_canvas.h"
#import "render_replaced.h"
+#import "render_style.h"
#import "KWQKHTMLPart.h"
#import "WebCoreBridge.h"
@@ -102,6 +103,15 @@ void QWidget::setEnabled(bool enabled)
}
}
+bool QWidget::isEnabled() const
+{
+ id view = data->view;
+ if ([view respondsToSelector:@selector(isEnabled)]) {
+ return [view isEnabled];
+ }
+ return true;
+}
+
long QWidget::winId() const
{
return (long)this;
@@ -220,27 +230,24 @@ void QWidget::clearFocus()
QWidget::FocusPolicy QWidget::focusPolicy() const
{
- // This is the AppKit rule for what can be tabbed to.
- // An NSControl that accepts first responder, and has an editable, enabled cell.
-
- NSView *view = getView();
- if (![view acceptsFirstResponder] || ![view isKindOfClass:[NSControl class]]) {
- return NoFocus;
- }
- NSControl *control = (NSControl *)view;
- NSCell *cell = [control cell];
- if (![cell isEditable] || ![cell isEnabled]) {
+ // This provides support for controlling the widgets that take
+ // part in tab navigation. Widgets must not be:
+ // 1. hidden by css
+ // 2. enabled
+ // 3. accept first responder
+
+ RenderWidget *widget = const_cast<RenderWidget *>
+ (static_cast<const RenderWidget *>(eventFilterObject()));
+ if (widget->style()->visibility() != khtml::VISIBLE)
return NoFocus;
- }
- return TabFocus;
-}
-void QWidget::setFocusPolicy(FocusPolicy fp)
-{
-}
+ if (!isEnabled())
+ return NoFocus;
-void QWidget::setFocusProxy(QWidget *w)
-{
+ if (![getView() acceptsFirstResponder])
+ return NoFocus;
+
+ return TabFocus;
}
const QPalette& QWidget::palette() const
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list