<?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>31234</bug_id>
          
          <creation_ts>2009-11-07 19:36:02 -0800</creation_ts>
          <short_desc>Make tests http/tests/misc/isindex-with-no-form-base-href.html and isindex-with-no-form.html work using DOM keyboard events</short_desc>
          <delta_ts>2023-06-03 21:31:16 -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>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</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>
          <dependson>16735</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Daniel Bates">dbates</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>andersca</cc>
    
    <cc>ap</cc>
    
    <cc>aroben</cc>
    
    <cc>bdakin</cc>
    
    <cc>darin</cc>
    
    <cc>dbates</cc>
    
    <cc>vicki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>161390</commentid>
    <comment_count>0</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2009-11-07 19:36:02 -0800</bug_when>
    <thetext>Following up from bug #30491, we should make the test cases:
http/tests/misc/isindex-with-no-form-base-href.html
http/tests/misc/isindex-with-no-form.html

work without using DRT&apos;s EventSender. Instead, we should rewrite these tests to use DOM keyboard events.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>163706</commentid>
    <comment_count>1</comment_count>
      <attachid>43241</attachid>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2009-11-14 21:52:12 -0800</bug_when>
    <thetext>Created attachment 43241
Example

Example.

Tries to programmatically fire a keypress DOM KeyboardEvent at an HTMLInputElement with keyIdentifier = &quot;Enter&quot; to submit the form (that is, to simulate what equivalent action when the user gives the input focus and then presses the Return/Enter key on the keyboard)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>163707</commentid>
    <comment_count>2</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2009-11-14 21:52:55 -0800</bug_when>
    <thetext>Using a debugger to trace the execution of DOM KeyboardEvents, we need to fix bug #16735 in order to fix this bug.

Running the attachment Example &lt;https://bugs.webkit.org/attachment.cgi?id=43241&gt;, we see that the call flow is as follows (*):

WebCore::jsNodePrototypeFunctionDispatchEvent-&gt;EventTarget::dispatchEvent-&gt;Node::dispatchEvent-&gt;Node::dispatchGenericEvent-&gt;HTMLInputElement::defaultEventHandler

By line 1412 of HTMLInputElement.cpp &lt;http://trac.webkit.org/browser/trunk/WebCore/html/HTMLInputElement.cpp?rev=50996#L1412&gt;, we call KeyboardEvent::charCode(). Notice, this KeyboardEvent was generated programmatically by JavaScript (as opposed to a physical key press). Hence, this KeyboardEvent has no associated PlatformKeyboardEvent (i.e. KeyboardEvent::m_keyEvent == null). And by line 138 of KeyboardEvent.cpp &lt;http://trac.webkit.org/browser/trunk/WebCore/dom/KeyboardEvent.cpp?rev=38094#L138&gt; method KeyboardEvent::charCode returns 0 if !KeyboardEvent::m_keyEvent. So, for this example, KeyboardEvent::charCode always returns 0. Therefore, we cannot resolve this bug until we resolve bug #16735.

For completeness, before executing (*), the DOM keyboard event is first instantiated via the following call flow:

WebCore::jsDocumentPrototypeFunctionCreateEvent-&gt;Document::createEvent-&gt;KeyboardEvent::create-&gt;KeyboardEvent::KeyboardEvent()

Note, specifically the constructor KeyboardEvent::KeyboardEvent() is called. Hence, m_keyEvent := 0.

Then, the DOM keyboard event is initialized via the call flow: 

WebCore::jsKeyboardEventPrototypeFunctionInitKeyboardEvent-&gt;KeyboardEvent::initKeyboardEvent</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1959741</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-06-03 21:31:16 -0700</bug_when>
    <thetext>&apos;isindex&apos; is removed and now historical.

https://github.com/WebKit/WebKit/commit/c92f223d57abd60e7bc682985a103744f3760672

WPT test showing it as historical - http://wpt.live/html/semantics/forms/historical.html

and both of these tests are now removed (in above commit).

So marking this as &apos;RESOLVED WONTFIX&apos;.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>43241</attachid>
            <date>2009-11-14 21:52:12 -0800</date>
            <delta_ts>2009-11-14 21:52:12 -0800</delta_ts>
            <desc>Example</desc>
            <filename>keyeventTest.html</filename>
            <type>text/html</type>
            <size>2185</size>
            <attacher name="Daniel Bates">dbates</attacher>
            
              <data encoding="base64">PGh0bWw+CjxoZWFkPgo8Ym9keT4KPHA+T24gbG9hZGluZyB0aGlzIHBhZ2UsIHRoZSBmb3JtIChi
ZWxvdykgc2hvdWxkIGJlIGF1dG9tYXRpY2FsbHkgc3VibWl0dGVkIHZpYSBhIHNpbXVsYXRlZCBr
ZXkgcHJlc3Mgb2YgdGhlIGVudGVyIGtleS4gT24gc3VjY2VzcywgeW91IHNob3VsZCBzZWUgdGhl
IGFsZXJ0ICJUZXN0IHBhc3NlZC4iIElmIHlvdSBkbyBub3Qgc2VlIGFuIGFsZXJ0LCB0aGVuIHRo
ZSB0ZXN0IGZhaWxlZC48L3A+CjxwPkZvciBjb21wYXJpc29uLCB0cnkgbWFudWFsbHkgc3VibWl0
dGluZyB0aGlzIGZvcm0uIFRoZW4gY29tcGFyZSB0aGUgY2FwdHVyZWQga2V5IGV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