<?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>223712</bug_id>
          
          <creation_ts>2021-03-24 13:55:52 -0700</creation_ts>
          <short_desc>HTMLFormElement.elements should not return images</short_desc>
          <delta_ts>2021-03-27 08:39:52 -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>Forms</component>
          <version>Safari 14</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>87834</dup_id>
          
          <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>1</everconfirmed>
          <reporter name="Marvin Scholz">epirat07</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cdumez</cc>
    
    <cc>gsnedders</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1743529</commentid>
    <comment_count>0</comment_count>
    <who name="Marvin Scholz">epirat07</who>
    <bug_when>2021-03-24 13:55:52 -0700</bug_when>
    <thetext>According to https://html.spec.whatwg.org/multipage/forms.html#category-listed the HTMLFormElement elements
property should not list img elements in forms, this does seem to work fine, except when explicitly accessing by ID.

For example given the following HTML:

    &lt;form id=&quot;test_form&quot;&gt;
        &lt;input type=&quot;text&quot; name=&quot;example_text_input&quot;&gt;
        &lt;img alt=&quot;example&quot; id=&quot;test_img&quot; width=&quot;10&quot; height=&quot;10&quot; src=&quot;…&quot;&gt;
    &lt;/form&gt;

Querying the elements with the img id like this:

    document.forms[&apos;test_form&apos;].elements[&apos;test_img&apos;]

should return undefined, like it happens in other browsers (tested with Firefox and Chrome), but it actually returns the img element.

Possibly related to #87834</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1744506</commentid>
    <comment_count>1</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2021-03-27 08:39:52 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 87834 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>