<?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>62693</bug_id>
          
          <creation_ts>2011-06-14 20:42:02 -0700</creation_ts>
          <short_desc>windowsKeyCodeForKeyEvent should be robust against NSFlagsChanged events</short_desc>
          <delta_ts>2011-06-14 22:40:55 -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>WebKit2</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="John Sullivan">sullivan</reporter>
          <assigned_to name="John Sullivan">sullivan</assigned_to>
          <cc>ap</cc>
    
    <cc>darin</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>420989</commentid>
    <comment_count>0</comment_count>
    <who name="John Sullivan">sullivan</who>
    <bug_when>2011-06-14 20:42:02 -0700</bug_when>
    <thetext>The function windowsKeyCodeForKeyEvent() in WebEventFactory.mm does not explicitly check for NSFlagsChanged events before calling -charactersIgnoringModifiers. -[NSEvent charactersIgnoringModifiers] throws an exception for NSFlagsChanged events. We should make this function avoid this possibility.

In Radar as &lt;rdar://problem/9601436&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>420991</commentid>
    <comment_count>1</comment_count>
      <attachid>97227</attachid>
    <who name="John Sullivan">sullivan</who>
    <bug_when>2011-06-14 20:45:55 -0700</bug_when>
    <thetext>Created attachment 97227
Patch to bail out of windowsKeyCodeForKeyEvent for NSFlagsChanged events</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>420996</commentid>
    <comment_count>2</comment_count>
    <who name="John Sullivan">sullivan</who>
    <bug_when>2011-06-14 20:53:27 -0700</bug_when>
    <thetext>Fixed in http://trac.webkit.org/changeset/88903</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>421005</commentid>
    <comment_count>3</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2011-06-14 21:45:02 -0700</bug_when>
    <thetext>John, is there a particular key combination that produces this exception.  If so, we should consider at least documenting it here, and if possible, writing an API test for this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>421006</commentid>
    <comment_count>4</comment_count>
    <who name="John Sullivan">sullivan</who>
    <bug_when>2011-06-14 21:47:17 -0700</bug_when>
    <thetext>Don’t know of the key code that’s causing the exception, but stack traces from crashes show that it is happening.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>421013</commentid>
    <comment_count>5</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-06-14 22:20:43 -0700</bug_when>
    <thetext>Wouldn’t a white list be better than a black list for event types?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>421017</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-06-14 22:35:35 -0700</bug_when>
    <thetext>If this is reproducible, can you just post what event causes this, and a stack trace?

A switch above this code seems to handle all keys that can cause NSFlagsChanged. And if it misses some, we should find out which ones, and return a proper Windows key code for these, not a zero.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>421019</commentid>
    <comment_count>7</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-06-14 22:40:55 -0700</bug_when>
    <thetext>Actually, I see this info in Radar, and it seems like the NSEvent is somehow invalid. I don&apos;t know how an event could have key code 49808. Are we dealing with some sort of a memory consistency issue here?</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>97227</attachid>
            <date>2011-06-14 20:45:55 -0700</date>
            <delta_ts>2011-06-14 20:51:13 -0700</delta_ts>
            <desc>Patch to bail out of windowsKeyCodeForKeyEvent for NSFlagsChanged events</desc>
            <filename>62693_patch.txt</filename>
            <type>text/plain</type>
            <size>1366</size>
            <attacher name="John Sullivan">sullivan</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJLaXQyL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
S2l0Mi9DaGFuZ2VMb2cJKHJldmlzaW9uIDg4OTAxKQorKysgU291cmNlL1dlYktpdDIvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTYgQEAKKzIwMTEtMDYtMTQgIEpvaG4gU3Vs
bGl2YW4gIDxzdWxsaXZhbkBhcHBsZS5jb20+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZ
IChPT1BTISkuCisKKyAgICAgICAgPGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNn
aT9pZD02MjY5Mz4KKyAgICAgICAgPHJkYXI6Ly9wcm9ibGVtLzk2MDE0MzY+CisgICAgICAgIHdp
bmRvd3NLZXlDb2RlRm9yS2V5RXZlbnQgc2hvdWxkIGJlIHJvYnVzdCBhZ2FpbnN0IE5TRmxhZ3ND
aGFuZ2VkIGV2ZW50cworCisgICAgICAgICogU2hhcmVkL21hYy9XZWJFdmVudEZhY3RvcnkubW06
CisgICAgICAgIChXZWJLaXQ6OndpbmRvd3NLZXlDb2RlRm9yS2V5RXZlbnQpOgorICAgICAgICBF
eHBsaWNpdGx5IGNoZWNrIGZvciBOU0ZsYWdzQ2hhbmdlZCBiZWZvcmUgY2FsbGluZyAtY2hhcmFj
dGVyc0lnbm9yaW5nTW9kaWZpZXJzLCBzaW5jZQorICAgICAgICBjaGFyYWN0ZXJzSWdub3JpbmdN
b2RpZmllcnMgdGhyb3dzIGFuIGV4Y2VwdGlvbiBmb3IgTlNGbGFnc0NoYW5nZWQgZXZlbnRzLgor
CiAyMDExLTA2LTE0ICBBbmRlcnMgQ2FybHNzb24gIDxhbmRlcnNjYUBhcHBsZS5jb20+CiAKICAg
ICAgICAgUmV2aWV3ZWQgYnkgU2FtIFdlaW5pZy4KSW5kZXg6IFNvdXJjZS9XZWJLaXQyL1NoYXJl
ZC9tYWMvV2ViRXZlbnRGYWN0b3J5Lm1tCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFNvdXJjZS9XZWJLaXQyL1No
YXJlZC9tYWMvV2ViRXZlbnRGYWN0b3J5Lm1tCShyZXZpc2lvbiA4ODg1NSkKKysrIFNvdXJjZS9X
ZWJLaXQyL1NoYXJlZC9tYWMvV2ViRXZlbnRGYWN0b3J5Lm1tCSh3b3JraW5nIGNvcHkpCkBAIC02
OTYsNiArNjk2LDkgQEAgc3RhdGljIGludCB3aW5kb3dzS2V5Q29kZUZvcktleUV2ZW50KE5TRQog
ICAgICAgICAvLyBWS19ESVZJREUgKDZGKSBEaXZpZGUga2V5CiAgICAgICAgIGNhc2UgNzU6IHJl
dHVybiAweDZGOwogICAgICB9CisgICAgCisgICAgaWYgKFtldmVudCB0eXBlXSA9PSBOU0ZsYWdz
Q2hhbmdlZCkKKyAgICAgICAgcmV0dXJuIDA7CiAKICAgICBOU1N0cmluZyogcyA9IFtldmVudCBj
aGFyYWN0ZXJzSWdub3JpbmdNb2RpZmllcnNdOwogICAgIGlmIChbcyBsZW5ndGhdICE9IDEpCg==
</data>
<flag name="review"
          id="91104"
          type_id="1"
          status="+"
          setter="adachan"
    />
          </attachment>
      

    </bug>

</bugzilla>