Image is not defined
Reported by nickg | March 15th, 2010 @ 11:47 AM | in 1.2.x
looks like Image is missing in envjs.
Image is a weirdo in the DOM, since it actually has a constructor, and doesn't need an OwnerDocument.
For ref, https://developer.mozilla.org/En/DOM/Image
$ ./tester.sh
Rhino 1.7 release 2 2009 03 22
js> load("client9-env-js/dist/env.rhino.js");
[ Envjs/1.6 (Rhino; U; Mac OS X x86_64 10.6.2; en-US; rv:1.7.0.rc2) Resig/20070309 PilotFish/1.2.0.6 ]
js> Image
js: "<stdin>", line 3: uncaught JavaScript runtime exception: ReferenceError: "Image" is not defined.
at <stdin>:3
js>
Comments and changes to this ticket
-
nickg March 15th, 2010 @ 11:57 AM
In my envjs-like thing, I did something like the following:
// img // http://dev.w3.org/html5/spec/Overview.html#the-img-element Image = function(width, height) { // Image can free form create nodes //var tmp= window.document.createElement('img'); this._dom = tmp._dom; this.width = width; this.height = height; this.src = null; }; Image.prototype = HTMLImageElement.prototype;
-
nickg March 15th, 2010 @ 11:57 AM
- Tag changed from image to htmlimageelement, image
-
nickg March 15th, 2010 @ 07:19 PM
- Assigned user set to Thatcher
Patch:
http://github.com/client9/env-js/commit/0f09339ee05702558f14ecee987...this has unit tests even!
-
Thatcher March 16th, 2010 @ 04:46 PM
Great work. Im going to just stay up and apply as many of these as I can
tonight. -
Thatcher March 16th, 2010 @ 07:38 PM
thanks again for the patch and even more so the tests. the tests helped
show that the Option interface hasnt been committed. I adjusted the tests
and patch to apply specifically to the ticket issue. I'll close the ticket
with a speciicf link to the commit. -
Thatcher March 17th, 2010 @ 03:01 AM
- Milestone set to 1.2.x
- Tag changed from htmlimageelement, image to htmlimageelement, image, option
- State changed from new to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
a javascript browser environment