<?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>83330</bug_id>
          
          <creation_ts>2012-04-05 16:55:41 -0700</creation_ts>
          <short_desc>Allow certain Char events in fullscreen</short_desc>
          <delta_ts>2012-04-12 13:23:50 -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>UI Events</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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>
          
          <blocked>83014</blocked>
          <everconfirmed>0</everconfirmed>
          <reporter name="Cem Kocagil">cem.kocagil+webkit</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>cem.kocagil+webkit</cc>
    
    <cc>darin</cc>
    
    <cc>jer.noble</cc>
    
    <cc>rniwa</cc>
    
    <cc>sam</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>597035</commentid>
    <comment_count>0</comment_count>
    <who name="Cem Kocagil">cem.kocagil+webkit</who>
    <bug_when>2012-04-05 16:55:41 -0700</bug_when>
    <thetext>Currently only KeyDown/KeyUp/RawKeyDown are allowed. Char events should be allowed for processing space key events of type Char.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>597038</commentid>
    <comment_count>1</comment_count>
      <attachid>135938</attachid>
    <who name="Cem Kocagil">cem.kocagil+webkit</who>
    <bug_when>2012-04-05 16:59:23 -0700</bug_when>
    <thetext>Created attachment 135938
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>597446</commentid>
    <comment_count>2</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-04-06 10:17:46 -0700</bug_when>
    <thetext>What is the rationale for this change? Is there any spec for this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>597463</commentid>
    <comment_count>3</comment_count>
    <who name="Cem Kocagil">cem.kocagil+webkit</who>
    <bug_when>2012-04-06 10:32:36 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; What is the rationale for this change? Is there any spec for this?

According to PlatformKeyboardEvent.h, PlatformKeyboardEvent::windowsVirtualKeyCode() returns zero for Char events. Therefore, space events of type Char are currently not allowed in fullscreen mode. They should be allowed, because there are tests that expect this and Firefox also does this.

However, these tests that seem to check space key events currently pass on Chromium because Chromium doesn&apos;t implement windowsVirtualKeyCode as specified in PlatformKeyboardEvent.h. I have not investigated how it works in other ports. Perhaps the windowsVirtualKeyCode() specification in the header is incorrect?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>597500</commentid>
    <comment_count>4</comment_count>
      <attachid>135938</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-04-06 11:16:49 -0700</bug_when>
    <thetext>Comment on attachment 135938
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=135938&amp;action=review

It is expected behavior that keypress events (corresponding to Char) have a character code, but no virtual key code.

It&apos;s quite unfortunate that information about key bindings is hardcoded here. In fact, existing code below makes me quite suspicious (why VK_BACK? why VK_OEM_1?)

&gt; Source/WebCore/page/EventHandler.cpp:2728
&gt; +        char character = keyEvent.text()[0];

This character is Unicode, so converting to char loses high bits. Also, this should check that length of text is 1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>597606</commentid>
    <comment_count>5</comment_count>
    <who name="Cem Kocagil">cem.kocagil+webkit</who>
    <bug_when>2012-04-06 13:25:18 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (From update of attachment 135938 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=135938&amp;action=review
&gt; 
&gt; It is expected behavior that keypress events (corresponding to Char) have a character code, but no virtual key code.

In that case, is PlatformKeyboardEvent.h inaccurate? Or by &quot;no virtual key code&quot; do you mean a windowsVirtualKeyCode value of zero?

&gt; It&apos;s quite unfortunate that information about key bindings is hardcoded here. In fact, existing code below makes me quite suspicious (why VK_BACK? why VK_OEM_1?)

Without VK_BACK, backspace on textboxes do not work and takes us back to the previous page. Without VK_OEM_1, I think the semicolon key wouldn&apos;t work.

&gt; &gt; Source/WebCore/page/EventHandler.cpp:2728
&gt; &gt; +        char character = keyEvent.text()[0];
&gt; 
&gt; This character is Unicode, so converting to char loses high bits. Also, this should check that length of text is 1.

Can we not assume that the string always has a null character?
If windowsVirtualKeyCode is supposed to give us the char code, should we use it instead of &quot;.text()[0]&quot;?

I&apos;ll fix these and character type and resubmit a new patch, if these are the reasons for the r-. Please let me know if there&apos;s any particular refactoring that you think should be done.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>597819</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-04-06 16:58:26 -0700</bug_when>
    <thetext>&gt; Or by &quot;no virtual key code&quot; do you mean a windowsVirtualKeyCode value of zero?

I mean that text events such as keypress don&apos;t have a virtual key code conceptually - they may not even be initiated by a keyboard. At code level, that corresponds to a zero value.

&gt; Without VK_BACK, backspace on textboxes do not work and takes us back to the previous page. Without VK_OEM_1, I think the semicolon key wouldn&apos;t work.

Why is the semicolon expected to work, in the first place?

Backspace is an example of why this is a very poor place to hardcode key behaviors - it may or may not cause a navigation, but that&apos;s decided elsewhere.

&gt; Can we not assume that the string always has a null character?

I&apos;m not sure about that, but I know that it can be longer than 1 character.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>598075</commentid>
    <comment_count>7</comment_count>
      <attachid>136163</attachid>
    <who name="Cem Kocagil">cem.kocagil+webkit</who>
    <bug_when>2012-04-08 17:06:09 -0700</bug_when>
    <thetext>Created attachment 136163
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>598078</commentid>
    <comment_count>8</comment_count>
    <who name="Cem Kocagil">cem.kocagil+webkit</who>
    <bug_when>2012-04-08 17:28:49 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; Why is the semicolon expected to work, in the first place?

You&apos;re right, I can&apos;t see a reason for that either.

&gt; &gt; Can we not assume that the string always has a null character?
&gt; 
&gt; I&apos;m not sure about that, but I know that it can be longer than 1 character.

I changed the type to UChar and it checks the length now. Could you review this patch so we can fix the current implementation?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>598097</commentid>
    <comment_count>9</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-04-08 18:54:46 -0700</bug_when>
    <thetext>Jer Noble is our fullscreen expert, I&apos;d like him to do review.

Please mark the patch as r? to make sure it doesn&apos;t get overlooked.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>598313</commentid>
    <comment_count>10</comment_count>
    <who name="Jer Noble">jer.noble</who>
    <bug_when>2012-04-09 09:11:00 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; Jer Noble is our fullscreen expert, I&apos;d like him to do review.
&gt; 
&gt; Please mark the patch as r? to make sure it doesn&apos;t get overlooked.

This looks fine, though the next revision of the W3C Full Screen spec does not include any keyboard limitations (all key press events will be supported in full screen).  So it&apos;s likely this code will eventually be obsoleted.  In the meantime, this patch should be fine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>601474</commentid>
    <comment_count>11</comment_count>
      <attachid>136163</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-04-12 13:23:45 -0700</bug_when>
    <thetext>Comment on attachment 136163
Patch

Clearing flags on attachment: 136163

Committed r114024: &lt;http://trac.webkit.org/changeset/114024&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>601475</commentid>
    <comment_count>12</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-04-12 13:23:50 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>135938</attachid>
            <date>2012-04-05 16:59:23 -0700</date>
            <delta_ts>2012-04-08 17:06:09 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>fullscreen.patch</filename>
            <type>text/plain</type>
            <size>1305</size>
            <attacher name="Cem Kocagil">cem.kocagil+webkit</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZw0KPT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KLS0tIFNvdXJjZS9X
ZWJDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTEzMzk1KQorKysgU291cmNlL1dlYkNvcmUvQ2hh
bmdlTG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTMgQEAKKzIwMTItMDQtMDUgIENlbSBL
b2NhZ2lsICA8Y2VtLmtvY2FnaWxAZ21haWwuY29tPgorCisgICAgICAgIEFsbG93IGNlcnRhaW4g
Q2hhciBldmVudHMgaW4gZnVsbHNjcmVlbgorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9y
Zy9zaG93X2J1Zy5jZ2k/aWQ9ODMzMzAKKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9P
UFMhKS4KKworICAgICAgICAqIHBhZ2UvRXZlbnRIYW5kbGVyLmNwcDoKKyAgICAgICAgKFdlYkNv
cmU6OkV2ZW50SGFuZGxlcjo6aXNLZXlFdmVudEFsbG93ZWRJbkZ1bGxTY3JlZW4pOgorCiAyMDEy
LTA0LTA1ICBKb3NodWEgQmVsbCAgPGpzYmVsbEBjaHJvbWl1bS5vcmc+CiAKICAgICAgICAgSW5k
ZXhlZERCOiBTdXBwb3J0IHN0cmluZy5sZW5ndGggaW4ga2V5UGF0aHMKSW5kZXg6IFNvdXJjZS9X
ZWJDb3JlL3BhZ2UvRXZlbnRIYW5kbGVyLmNwcA0KPT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KLS0tIFNvdXJjZS9XZWJD
b3JlL3BhZ2UvRXZlbnRIYW5kbGVyLmNwcAkocmV2aXNpb24gMTEzMzkyKQorKysgU291cmNlL1dl
YkNvcmUvcGFnZS9FdmVudEhhbmRsZXIuY3BwCSh3b3JraW5nIGNvcHkpCkBAIC0yNzI0LDYgKzI3
MjQsMTEgQEAgYm9vbCBFdmVudEhhbmRsZXI6OmlzS2V5RXZlbnRBbGxvd2VkSW5GdQogICAgIGlm
IChkb2N1bWVudC0+d2Via2l0RnVsbFNjcmVlbktleWJvYXJkSW5wdXRBbGxvd2VkKCkpCiAgICAg
ICAgIHJldHVybiB0cnVlOwogCisgICAgaWYgKGtleUV2ZW50LnR5cGUoKSA9PSBQbGF0Zm9ybUtl
eWJvYXJkRXZlbnQ6OkNoYXIpIHsKKyAgICAgICAgY2hhciBjaGFyYWN0ZXIgPSBrZXlFdmVudC50
ZXh0KClbMF07CisgICAgICAgIHJldHVybiBjaGFyYWN0ZXIgPT0gJyAnOworICAgIH0KKwogICAg
IGludCBrZXlDb2RlID0ga2V5RXZlbnQud2luZG93c1ZpcnR1YWxLZXlDb2RlKCk7CiAgICAgcmV0
dXJuIChrZXlDb2RlID49IFZLX0JBQ0sgJiYga2V5Q29kZSA8PSBWS19DQVBJVEFMKQogICAgICAg
ICB8fCAoa2V5Q29kZSA+PSBWS19TUEFDRSAmJiBrZXlDb2RlIDw9IFZLX0RFTEVURSkK
</data>
<flag name="review"
          id="140651"
          type_id="1"
          status="-"
          setter="ap"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>136163</attachid>
            <date>2012-04-08 17:06:09 -0700</date>
            <delta_ts>2012-04-12 13:23:45 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>windowsvk.patch</filename>
            <type>text/plain</type>
            <size>1376</size>
            <attacher name="Cem Kocagil">cem.kocagil+webkit</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZw0KPT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KLS0tIFNvdXJjZS9X
ZWJDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTEzNTUwKQorKysgU291cmNlL1dlYkNvcmUvQ2hh
bmdlTG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTMgQEAKKzIwMTItMDQtMDcgIENlbSBL
b2NhZ2lsICA8Y2VtLmtvY2FnaWxAZ21haWwuY29tPgorCisgICAgICAgIEFsbG93IGNlcnRhaW4g
Q2hhciBldmVudHMgaW4gZnVsbHNjcmVlbgorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9y
Zy9zaG93X2J1Zy5jZ2k/aWQ9ODMzMzAKKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9P
UFMhKS4KKworICAgICAgICAqIHBhZ2UvRXZlbnRIYW5kbGVyLmNwcDoKKyAgICAgICAgKFdlYkNv
cmU6OkV2ZW50SGFuZGxlcjo6aXNLZXlFdmVudEFsbG93ZWRJbkZ1bGxTY3JlZW4pOgorCiAyMDEy
LTA0LTA3ICBQYXRyaWNrIEdhbnN0ZXJlciAgPHBhcm9nYUB3ZWJraXQub3JnPgogCiAgICAgICAg
IFtDTWFrZV0gQ2xlYW51cCBXVEYgaW5jbHVkZSBkaXJlY3RvcmllcwpJbmRleDogU291cmNlL1dl
YkNvcmUvcGFnZS9FdmVudEhhbmRsZXIuY3BwDQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQotLS0gU291cmNlL1dlYkNv
cmUvcGFnZS9FdmVudEhhbmRsZXIuY3BwCShyZXZpc2lvbiAxMTM1NTApCisrKyBTb3VyY2UvV2Vi
Q29yZS9wYWdlL0V2ZW50SGFuZGxlci5jcHAJKHdvcmtpbmcgY29weSkKQEAgLTI3MjQsNiArMjcy
NCwxMyBAQCBib29sIEV2ZW50SGFuZGxlcjo6aXNLZXlFdmVudEFsbG93ZWRJbkZ1CiAgICAgaWYg
KGRvY3VtZW50LT53ZWJraXRGdWxsU2NyZWVuS2V5Ym9hcmRJbnB1dEFsbG93ZWQoKSkKICAgICAg
ICAgcmV0dXJuIHRydWU7CiAKKyAgICBpZiAoa2V5RXZlbnQudHlwZSgpID09IFBsYXRmb3JtS2V5
Ym9hcmRFdmVudDo6Q2hhcikgeworICAgICAgICBpZiAoa2V5RXZlbnQudGV4dCgpLmxlbmd0aCgp
ICE9IDEpCisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIFVDaGFyIGNoYXJhY3Rl
ciA9IGtleUV2ZW50LnRleHQoKVswXTsKKyAgICAgICAgcmV0dXJuIGNoYXJhY3RlciA9PSAnICc7
CisgICAgfQorCiAgICAgaW50IGtleUNvZGUgPSBrZXlFdmVudC53aW5kb3dzVmlydHVhbEtleUNv
ZGUoKTsKICAgICByZXR1cm4gKGtleUNvZGUgPj0gVktfQkFDSyAmJiBrZXlDb2RlIDw9IFZLX0NB
UElUQUwpCiAgICAgICAgIHx8IChrZXlDb2RlID49IFZLX1NQQUNFICYmIGtleUNvZGUgPD0gVktf
REVMRVRFKQo=
</data>

          </attachment>
      

    </bug>

</bugzilla>