summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-02-10 18:04:22 +0100
committerAndrea Diamantini <adjam7@gmail.com>2012-02-10 18:04:22 +0100
commit8fd5412cc0474540878a57ec13674abc620fcd98 (patch)
tree7eb28ccf1f554e5e25f327bc5b3212fb21ef1b5e
parentConsider option && ~option as null rules when option is not implemented (diff)
downloadrekonq-8fd5412cc0474540878a57ec13674abc620fcd98.tar.xz
Finally fix GMail & G+ on content editable?? We'll see user response...
-rw-r--r--src/webview.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index f2328be5..0b171aa7 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -671,11 +671,14 @@ void WebView::keyPressEvent(QKeyEvent *event)
&& tagName != QL1S("TEXTAREA")
)
{
- // NOTE: I'm doing this check here to prevent this to be done EVERYTIME
- // we'll do it just when SHIFT has been pressed in an element NOT usually editable
- bool isContentEditable = page()->mainFrame()->hitTestContent(QCursor::pos()).isContentEditable();
-
- if (!isContentEditable)
+ // NOTE and FIXME
+ // This check is doabled because it presents strange behavior: QtWebKit check works well in pages like gmail
+ // and fails on sites like g+. The opposite is true for javascript check.
+ // Please, help me finding the right way to check this EVERY TIME.
+ bool isContentEditableQW = page()->mainFrame()->hitTestContent(QCursor::pos()).isContentEditable();
+ bool isContentEditableJS = page()->mainFrame()->evaluateJavaScript("document.activeElement.isContentEditable").toBool();
+
+ if (!isContentEditableQW && !isContentEditableJS)
{
if (event->key() == Qt::Key_Up)
{
@@ -752,9 +755,11 @@ void WebView::keyPressEvent(QKeyEvent *event)
&& tagName != QL1S("TEXTAREA")
)
{
- bool isContentEditable = page()->mainFrame()->hitTestContent(QCursor::pos()).isContentEditable();
+ // See note up!
+ bool isContentEditableQW = page()->mainFrame()->hitTestContent(QCursor::pos()).isContentEditable();
+ bool isContentEditableJS = page()->mainFrame()->evaluateJavaScript("document.activeElement.isContentEditable").toBool();
- if (!isContentEditable)
+ if (!isContentEditableQW && !isContentEditableJS)
{
switch (event->key())
{