Issue 43: Exception is thrown when instantiate Image object if there is an  
element has id="Image" in HTML.
http://code.google.com/p/v8/issues/detail?id=43

New issue report by asdftf:
Hi,

I wrote the following JavaScript and HTML. And opened it by Chrome browser.
Then I clicked the image, Chrome threw Exception('TypeError: #<an
HTMLImageElement>" is not a constructor'). Excepted behavior is that 1.jpg  
is
replaced by 2.jpg.
--
<html><head><title>Image object</title>
   <script type="text/javascript">
     var s = "./2.jpg";
     function changeImg() {
       var img;
       try {
         img = new Image();
       } catch(e) {
         alert(e);
       }

       img.onload = function() {
         var i = document.getElementById("Image");
         i.src = this.src;
       };
       img.src = s;
     }
   </script>
</head><body>
<a href="#" onClick="changeImg();"><img id="Image" src="./1.jpg" /></a>
</body></html>
--
I confirmed that this code worked with Safari and Firefox.

When I changed id string of img tag(like id="thm"), it worked properly with
Chrome. So, It seems that img[id=Image] overrides Image object constructor.  
Is
this normal behavior?

My Chrome version is the below.
Official Build 1798
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.13 (KHTML,  
like
Gecko) Chrome/0.2.149.29 Safari/525.13

Thanks in advance.

Best Regards,

Takayoshi Fujiki




Issue attributes:
        Status: New
        Owner: ----

-- 
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to