[Webkit-unassigned] [Bug 84875] New: Virtual keyboard is not showing when user clicks inside of <input> tag

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 25 10:59:44 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=84875

           Summary: Virtual keyboard is not showing when user clicks
                    inside of <input> tag
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Mac OS X 10.7
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: WebKit Qt
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: alex.bravo at nokia.com
                CC: kenneth at webkit.org


This problem happens on both Linux (11.10 x64) and Harmattan/N9.

One simple solution is to either add ItemAcceptsInputMethod permanently in here (new line is marked with //AB).

>From Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp:

QtWebPageEventHandler::QtWebPageEventHandler(WKPageRef pageRef, QQuickWebPage* qmlWebPage, QQuickWebView* qmlWebView)
    : m_webPageProxy(toImpl(pageRef))
    , m_interactionEngine(0)
    , m_panGestureRecognizer(this)
    , m_pinchGestureRecognizer(this)
    , m_tapGestureRecognizer(this)
    , m_webPage(qmlWebPage)
    , m_webView(qmlWebView)
    , m_previousClickButton(Qt::NoButton)
    , m_clickCount(0)
    , m_postponeTextInputStateChanged(false)
{
    connect(qApp->inputPanel(), SIGNAL(visibleChanged()), this, SLOT(inputPanelVisibleChanged()));
    m_webView->setFlag(QQuickItem::ItemAcceptsInputMethod, true);  //AB
}

Or alternatively add this flag only if editor content is editable:

void QtWebPageEventHandler::updateTextInputState()
{
    if (m_postponeTextInputStateChanged)
        return;

    const EditorState& editor = m_webPageProxy->editorState();

    if (!m_webView->hasFocus())
        return;

    // Ignore input method requests not due to a tap gesture.
    if (!editor.isContentEditable) {
        m_webView->setFlag(QQuickItem::ItemAcceptsInputMethod, false);  //AB
        setInputPanelVisible(false);
    }
}

void QtWebPageEventHandler::doneWithGestureEvent(const WebGestureEvent& event, bool wasEventHandled)
{
    if (event.type() != WebEvent::GestureSingleTap)
        return;

    m_postponeTextInputStateChanged = false;

    if (!wasEventHandled || !m_webView->hasFocus())
        return;

    const EditorState& editor = m_webPageProxy->editorState();
    bool newVisible = editor.isContentEditable;

    m_webView->setFlag(QQuickItem::ItemAcceptsInputMethod, newVisible);  //AB
}

Note: Once this issue with ItemAcceptsInputMethod is solved, another bug in focusEditableArea() (called from QtWebPageEventHandler::inputPanelVisibleChanged())
shows up. This bug prevents Virtual keyboard from showing when user clicks inside of <input> tag second time (after Edit area is zoomed in once.)
To temporary fix this problem and be able to use ZVirtual keyborad repeatedly, either zoom page manually or comment out two lines marked with //AB as shown below:

void QtWebPageEventHandler::inputPanelVisibleChanged()
{
    if (!m_interactionEngine)
        return;

    // We only respond to the input panel becoming visible.
    if (!m_webView->hasFocus() || !qApp->inputPanel()->visible())
        return;

    const EditorState& editor = m_webPageProxy->editorState();

//AB    if (editor.isContentEditable)
//AB        m_interactionEngine->focusEditableArea(QRectF(editor.cursorRect), QRectF(editor.editorRect));
}

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list