[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75
hausmann at webkit.org
hausmann at webkit.org
Thu Oct 29 20:37:21 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 6b841ef564a9fd10f9d3a6d3527756f63d473bbe
Author: hausmann at webkit.org <hausmann at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Oct 1 12:43:49 2009 +0000
Fixed software input panel support on web input elements.
Patch by Kristian Amlie <kristian.amlie at nokia.com> on 2009-10-01
Reviewed by Simon Hausmann.
Send the RequestSoftwareInputPanel event if the element supports focus
and the element is clicked.
* Api/qwebpage.cpp:
(QWebPagePrivate::QWebPagePrivate):
(QWebPagePrivate::mousePressEvent):
(QWebPagePrivate::mouseReleaseEvent):
* Api/qwebpage_p.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48968 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index 000b895..d1a4059 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -267,6 +267,7 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
, inspector(0)
, inspectorIsInternalOnly(false)
, viewportSize(QSize(0, 0))
+ , clickCausedFocus(false)
{
WebCore::InitializeLoggingChannelsIfNecessary();
JSC::initializeThreading();
@@ -632,6 +633,11 @@ void QWebPagePrivate::mousePressEvent(QMouseEvent *ev)
if (!frame->view())
return;
+ RefPtr<WebCore::Node> oldNode;
+ if (page->focusController()->focusedFrame()
+ && page->focusController()->focusedFrame()->document())
+ oldNode = page->focusController()->focusedFrame()->document()->focusedNode();
+
if (tripleClickTimer.isActive()
&& (ev->pos() - tripleClick).manhattanLength()
< QApplication::startDragDistance()) {
@@ -645,6 +651,14 @@ void QWebPagePrivate::mousePressEvent(QMouseEvent *ev)
if (mev.button() != NoButton)
accepted = frame->eventHandler()->handleMousePressEvent(mev);
ev->setAccepted(accepted);
+
+ RefPtr<WebCore::Node> newNode;
+ if (page->focusController()->focusedFrame()
+ && page->focusController()->focusedFrame()->document())
+ newNode = page->focusController()->focusedFrame()->document()->focusedNode();
+
+ if (newNode && oldNode != newNode)
+ clickCausedFocus = true;
}
void QWebPagePrivate::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *ev)
@@ -750,6 +764,20 @@ void QWebPagePrivate::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev)
ev->setAccepted(accepted);
handleClipboard(ev, ev->button());
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ if (view && view->testAttribute(Qt::WA_InputMethodEnabled)
+ && ev->button() == Qt::LeftButton && qApp->autoSipEnabled()) {
+ QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel(
+ view->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel));
+ if (!clickCausedFocus || behavior == QStyle::RSIP_OnMouseClick) {
+ QEvent event(QEvent::RequestSoftwareInputPanel);
+ QApplication::sendEvent(view, &event);
+ }
+ }
+
+ clickCausedFocus = false;
+#endif
}
void QWebPagePrivate::mouseReleaseEvent(QMouseEvent *ev)
diff --git a/WebKit/qt/Api/qwebpage_p.h b/WebKit/qt/Api/qwebpage_p.h
index 9f4216a..d41471a 100644
--- a/WebKit/qt/Api/qwebpage_p.h
+++ b/WebKit/qt/Api/qwebpage_p.h
@@ -143,6 +143,8 @@ public:
QPoint tripleClick;
QBasicTimer tripleClickTimer;
+ bool clickCausedFocus;
+
#if QT_VERSION < 0x040400
bool acceptNavigationRequest(QWebFrame *frame, const QWebNetworkRequest &request, QWebPage::NavigationType type);
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index f2c8bed..3934f0a 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,18 @@
+2009-10-01 Kristian Amlie <kristian.amlie at nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fixed software input panel support on web input elements.
+
+ Send the RequestSoftwareInputPanel event if the element supports focus
+ and the element is clicked.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::mousePressEvent):
+ (QWebPagePrivate::mouseReleaseEvent):
+ * Api/qwebpage_p.h:
+
2009-10-01 Joe Ligman <joseph.ligman at nokia.com>
Reviewed by Simon Hausmann.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list