<?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>15127</bug_id>
          
          <creation_ts>2007-08-31 21:20:28 -0700</creation_ts>
          <short_desc>getElementById enhancement request</short_desc>
          <delta_ts>2007-11-07 13:03:10 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>523.x (Safari 3)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>6006</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="jason hu">jason.hu</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>mitz</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1061</commentid>
    <comment_count>0</comment_count>
    <who name="jason hu">jason.hu</who>
    <bug_when>2007-08-31 21:20:28 -0700</bug_when>
    <thetext>getElementById function retrieves element by the &quot;id&quot; attribute, but IE browser also checks &quot;name&quot; attribute too if the &quot;id&quot; doesn&apos;t exist. 
I noticed many web pages were code in the way, it calls &quot;getElementById&quot; and only &quot;name&quot; attribute exist for the element, 

so can you add this simple check if the &quot;id&quot; exist, use &quot;id&quot;, otherwise use &quot;name&quot;?

thanks</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1063</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2007-09-01 00:36:55 -0700</bug_when>
    <thetext>Could you please give examples of real sites coded this way?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1066</commentid>
    <comment_count>2</comment_count>
    <who name="">mitz</who>
    <bug_when>2007-09-01 00:57:53 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; Could you please give examples of real sites coded this way?

The customer service section of the Israeli Orange franchise, &lt;https://direct.orange.co.il/selfservice/&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1060</commentid>
    <comment_count>3</comment_count>
    <who name="jason hu">jason.hu</who>
    <bug_when>2007-09-01 06:39:06 -0700</bug_when>
    <thetext>the reason why some sites are coded this way is because of some Web Framwork, such as &quot;Struts&quot; doesn&apos;t generate &quot;id&quot; attribute by default, but it generates &quot;name&quot; attribute all the time, and  getElementById works fine in IE even without &quot;id&quot; attribute, some lazy developers don&apos;t even bother to go back fix this.
Struts was so popular, I saw this problem since begining.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57833</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2007-10-05 04:35:34 -0700</bug_when>
    <thetext>Opera is apparently going to remove this quirk from their 9.50 release:

&quot;Removed IE-compatibility where Document.getElementById treated name and id attributes the same, which caused problems with jQuery.&quot;

Still, this is a compatibility issue that we should consider fixing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60588</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2007-11-07 13:03:10 -0800</bug_when>
    <thetext>

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

    </bug>

</bugzilla>