<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>84875</bug_id>
          
          <creation_ts>2012-04-25 10:59:44 -0700</creation_ts>
          <short_desc>[Qt][WK2] Virtual keyboard is not showing when user clicks inside of &lt;input&gt; tag</short_desc>
          <delta_ts>2012-11-02 09:46:08 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Qt</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.7</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Alex Bravo">alex.bravo</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>allan.jensen</cc>
    
    <cc>cmarcelo</cc>
    
    <cc>hugo.lima</cc>
    
    <cc>humitos</cc>
    
    <cc>jesus</cc>
    
    <cc>kenneth</cc>
    
    <cc>lauro.neto</cc>
    
    <cc>menard</cc>
    
    <cc>noam</cc>
    
    <cc>rafael.lobo</cc>
    
    <cc>webkit.review.bot</cc>
    
    <cc>zoltan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>609911</commentid>
    <comment_count>0</comment_count>
    <who name="Alex Bravo">alex.bravo</who>
    <bug_when>2012-04-25 10:59:44 -0700</bug_when>
    <thetext>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-&gt;inputPanel(), SIGNAL(visibleChanged()), this, SLOT(inputPanelVisibleChanged()));
    m_webView-&gt;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&amp; editor = m_webPageProxy-&gt;editorState();

    if (!m_webView-&gt;hasFocus())
        return;

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

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

    m_postponeTextInputStateChanged = false;

    if (!wasEventHandled || !m_webView-&gt;hasFocus())
        return;

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

    m_webView-&gt;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 &lt;input&gt; 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-&gt;hasFocus() || !qApp-&gt;inputPanel()-&gt;visible())
        return;

    const EditorState&amp; editor = m_webPageProxy-&gt;editorState();

//AB    if (editor.isContentEditable)
//AB        m_interactionEngine-&gt;focusEditableArea(QRectF(editor.cursorRect), QRectF(editor.editorRect));
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>609924</commentid>
    <comment_count>1</comment_count>
    <who name="Jesus Sanchez-Palencia">jesus</who>
    <bug_when>2012-04-25 11:14:19 -0700</bug_when>
    <thetext>Alex, thanks for looking into this!

Do you plan to submit a patch for review following webkit guidelines?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>609932</commentid>
    <comment_count>2</comment_count>
    <who name="Alex Bravo">alex.bravo</who>
    <bug_when>2012-04-25 11:24:29 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; Alex, thanks for looking into this!
&gt; 
&gt; Do you plan to submit a patch for review following webkit guidelines?

I wanted to get first the feedback on wheach of mentioned two ways of adding ItemAcceptsInputMethod is better before I do a patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>609962</commentid>
    <comment_count>3</comment_count>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2012-04-25 12:19:36 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; (In reply to comment #1)
&gt; &gt; Alex, thanks for looking into this!
&gt; &gt; 
&gt; &gt; Do you plan to submit a patch for review following webkit guidelines?
&gt; 
&gt; I wanted to get first the feedback on wheach of mentioned two ways of adding ItemAcceptsInputMethod is better before I do a patch.

Even if it is not for review, it would be so much easier to give comments if it was uploaded as a patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>610197</commentid>
    <comment_count>4</comment_count>
      <attachid>138906</attachid>
    <who name="Alex Bravo">alex.bravo</who>
    <bug_when>2012-04-25 17:21:19 -0700</bug_when>
    <thetext>Created attachment 138906
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>610201</commentid>
    <comment_count>5</comment_count>
    <who name="Alex Bravo">alex.bravo</who>
    <bug_when>2012-04-25 17:26:23 -0700</bug_when>
    <thetext>In the proccess of testing this patch I found out that the trunk works without this patch just fine - vkb is show and hidden.
Which means that more investigation is needed on my part to find out which of the other of my changes are needed for this patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>610746</commentid>
    <comment_count>6</comment_count>
    <who name="Lauro Moura Maranhao Neto">lauro.neto</who>
    <bug_when>2012-04-26 11:13:56 -0700</bug_when>
    <thetext>How did you test it? I&apos;ve just tested revision 115325 against the latest pinned Qt5 hash (From early April) and VKB is not shown. I tested using a release build with both Snowshoe[1] and Femto[2] on a PR1.2 N9.

[1] http://github.com/snowshoe/snowshoe/
[2] https://gitorious.org/femto/femto</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>610768</commentid>
    <comment_count>7</comment_count>
    <who name="Alex Bravo">alex.bravo</who>
    <bug_when>2012-04-26 11:38:25 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; How did you test it? 

I&apos;m using MiniBrowser. I tested yesterday with trunk at  ebfce6a90080fe64aa07d009354ff4a975267782 on desktop.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>610769</commentid>
    <comment_count>8</comment_count>
    <who name="Noam Rosenthal">noam</who>
    <bug_when>2012-04-26 11:40:47 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; (In reply to comment #6)
&gt; &gt; How did you test it? 
&gt; 
&gt; I&apos;m using MiniBrowser. I tested yesterday with trunk at  ebfce6a90080fe64aa07d009354ff4a975267782 on desktop.

You mean, on desktop with maliit enabled :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>610775</commentid>
    <comment_count>9</comment_count>
    <who name="Rafael Brandao">rafael.lobo</who>
    <bug_when>2012-04-26 11:44:00 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; (In reply to comment #6)
&gt; &gt; &gt; How did you test it? 
&gt; &gt; 
&gt; &gt; I&apos;m using MiniBrowser. I tested yesterday with trunk at  ebfce6a90080fe64aa07d009354ff4a975267782 on desktop.
&gt; 
&gt; You mean, on desktop with maliit enabled :)

Did you run MiniBrowser in desktop mode or mobile?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>610784</commentid>
    <comment_count>10</comment_count>
    <who name="Alex Bravo">alex.bravo</who>
    <bug_when>2012-04-26 11:52:30 -0700</bug_when>
    <thetext>&gt; Did you run MiniBrowser in desktop mode or mobile?

I&apos;m not using --desktop switch, which I guess makes it run in mobile mode?
What&apos;s the difference?

@No&apos;am Yes, I malliit was installed. Abd Qt compiled with dbus.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>612038</commentid>
    <comment_count>11</comment_count>
    <who name="Alex Bravo">alex.bravo</who>
    <bug_when>2012-04-27 17:12:22 -0700</bug_when>
    <thetext>I verified that vkb is shown and hidden in MiniBrowser using revision 115493.
There&apos;s still an issue with zooming in when the WebView is not the same size as the whole window, but that&apos;s a separate bug.

So I&apos;m marking this bug as resolved.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>613070</commentid>
    <comment_count>12</comment_count>
      <attachid>138906</attachid>
    <who name="Noam Rosenthal">noam</who>
    <bug_when>2012-04-30 16:50:09 -0700</bug_when>
    <thetext>Comment on attachment 138906
Patch

Clearing review flag.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>757247</commentid>
    <comment_count>13</comment_count>
      <attachid>172077</attachid>
    <who name="Manuel Kaufmann">humitos</who>
    <bug_when>2012-11-02 09:07:27 -0700</bug_when>
    <thetext>Created attachment 172077
Test case for type=&quot;text&quot; and type=&quot;password&quot; &lt;input&gt; tags

Test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>757248</commentid>
    <comment_count>14</comment_count>
      <attachid>172077</attachid>
    <who name="Manuel Kaufmann">humitos</who>
    <bug_when>2012-11-02 09:08:13 -0700</bug_when>
    <thetext>Comment on attachment 172077
Test case for type=&quot;text&quot; and type=&quot;password&quot; &lt;input&gt; tags

I&apos;m having a similar issue in Browse[1] (from the OLPC / Sugar Platform). It shows the Maliit virtual keyboard on &lt;input type=&quot;text&quot;&gt; tags but it doesn&apos;t for &lt;input type=&quot;password&quot;&gt;.

I create a simple script as test case. It shows a webpage that has two &lt;input&gt; tags, one is type=&quot;text&quot; which reveals the virtual keyboard and the other one is type=&quot;password&quot; that doesn&apos;t reveal the VK. It&apos;s attached.

Any clue where I can take a look?

[1] http://git.sugarlabs.org/browse</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>757276</commentid>
    <comment_count>15</comment_count>
    <who name="Manuel Kaufmann">humitos</who>
    <bug_when>2012-11-02 09:46:08 -0700</bug_when>
    <thetext>(In reply to comment #14)
&gt; Any clue where I can take a look?

I found this bug that deals with this specific issue:

 * https://bugs.webkit.org/show_bug.cgi?id=34285</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>138906</attachid>
            <date>2012-04-25 17:21:19 -0700</date>
            <delta_ts>2012-04-30 16:50:09 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-84875-20120425172115.patch</filename>
            <type>text/plain</type>
            <size>2056</size>
            <attacher name="Alex Bravo">alex.bravo</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTE1MjUwCmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViS2l0Mi9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViS2l0Mi9DaGFuZ2VMb2cKaW5kZXggZWFmZGYzNTdjOTM2YWY5
NjM3YzMyZDcxNWVhYTFiMTZkM2JhZTBmOC4uMGRiM2RkZGJiZDVkMzZiYTIwZGU0MjcwNTkwNjFh
NDBkNGEyYmU5MCAxMDA2NDQKLS0tIGEvU291cmNlL1dlYktpdDIvQ2hhbm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KGNvbnN0IFdlYkdlc3R1cmVFdmVudCYgZXZlbnQsIGIK
ICAgICBjb25zdCBFZGl0b3JTdGF0ZSYgZWRpdG9yID0gbV93ZWJQYWdlUHJveHktPmVkaXRvclN0
YXRlKCk7CiAgICAgYm9vbCBuZXdWaXNpYmxlID0gZWRpdG9yLmlzQ29udGVudEVkaXRhYmxlOwog
CisgICAgbV93ZWJWaWV3LT5zZXRGbGFnKFFRdWlja0l0ZW06Okl0ZW1BY2NlcHRzSW5wdXRNZXRo
b2QsIG5ld1Zpc2libGUpOwogICAgIHNldElucHV0UGFuZWxWaXNpYmxlKG5ld1Zpc2libGUpOwog
fQogCg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>172077</attachid>
            <date>2012-11-02 09:07:27 -0700</date>
            <delta_ts>2012-11-02 09:08:13 -0700</delta_ts>
            <desc>Test case for type=&quot;text&quot; and type=&quot;password&quot; &lt;input&gt; tags</desc>
            <filename>webkit_webview.py</filename>
            <type>text/x-python</type>
            <size>902</size>
            <attacher name="Manuel Kaufmann">humitos</attacher>
            
              <data encoding="base64">ZnJvbSBnaS5yZXBvc2l0b3J5IGltcG9ydCBHdGsKZnJvbSBnaS5yZXBvc2l0b3J5IGltcG9ydCBX
ZWJLaXQKCgpIVE1MID0gJycnCjxIVE1MPgo8SEVBRD4KICA8VElUTEU+VGVzdCBQYWdlPC9USVRM
RT4KPC9IRUFEPgoKPFRBQkxFIEJPUkRFUj0iMCIgQ0VMTFNQQUNJTkc9IjIiIENFTExQQURESU5H
PSIyIj4KICA8VFI+CiAgICA8VEQgQUxJR049IlJJR0hUIj48Rk9OVCBTSVpFPSItMSI+VXNlciBu
YW1lOjwvRk9OVD48L1REPgogICAgPFREPjxJTlBVVCBOQU1FPSJsb2dpbm5hbWUiIFNJWkU9IjMw
IiBUWVBFPSJ0ZXh0Ij48L1REPgogIDwvVFI+CiAgPFRSPgogICAgPFREIEFMSUdOPSJSSUdIVCI+
PEZPTlQgU0laRT0iLTEiPlBhc3N3b3JkOjwvRk9OVD48L1REPgogICAgPFREPjxJTlBVVCBOQU1F
PSJwYXNzd29yZCIgVFlQRT0icGFzc3dvcmQiIFNJWkU9IjMwIj48L1REPgogIDwvVFI+CjwvVEFC
TEU+PEJSPgoKPC9IVE1MPgonJycKCgpjbGFzcyBNeVdpbmRvdyhHdGsuV2luZG93KToKCiAgICBk
ZWYgX19pbml0X18oc2VsZik6CiAgICAgICAgR3RrLldpbmRvdy5fX2luaXRfXyhzZWxmLCB0aXRs
ZT0iV2ViS2l0IE1hbGlpdCBJbnB1dCIpCiAgICAgICAgc2VsZi5zZXRfZGVmYXVsdF9zaXplKDI1
MCwgMjAwKQogICAgICAgIHNlbGYuY29ubmVjdCgiZGVsZXRlLWV2ZW50IiwgR3RrLm1haW5fcXVp
dCkKCiAgICAgICAgd2VidmlldyA9IFdlYktpdC5XZWJWaWV3KCkKICAgICAgICB3ZWJ2aWV3Lmxv
YWRfc3RyaW5nKEhUTUwsICd0ZXh0L2h0bWwnLCAndXRmOCcsICd0ZXN0JykKCiAgICAgICAgc2Vs
Zi5hZGQod2VidmlldykKICAgICAgICBzZWxmLnNob3dfYWxsKCkKCgppZiBfX25hbWVfXyA9PSAn
X19tYWluX18nOgogICAgd2luID0gTXlXaW5kb3coKQogICAgR3RrLm1haW4oKQo=
</data>

          </attachment>
      

    </bug>

</bugzilla>