Feature requests
chemerisuk opened this issue · 9 comments
Hi Andrea!
What do you think about including fixes below into the project:
children
property fixgetElementsByClassName
fix viaquerySelectorAll
pageX
andpageY
properties for eventscloneNode
fixinnerHTML
fix for HTML5 elements (see html5shiv.js)insertRule
viaaddRule
I think that children
, together with [http://www.w3.org/TR/ElementTraversal/](W3C ElementTraversal) would be a nice plus.
insertRule
via addRule
I am not sure is worth it, for the simple reason addRule
is implemented in Safari, Chrome, and other browsers too since it's easier to use, IMO.
pageX
and pageY
fix is a nonsense because IE8 is already slow and wrapping every event to fix those two properties that requires a lot of work for the browser per each interaction is a killer for RAM and performance.
I don't want to make IE8 slower than it is already in old hardware too, sorry, use screenX
or clientX
or what's available there and fix only when/if necessary to fix calculating pageX/Y
when needed.
cloneNode
fix ... need to dig, I don't remember what's the problem in there.
innerHTML
if already fixed in html5shiv.js
does not need to be fixed in this repo too, it would be duplicated code/work/tests for no reason.
What do you say?
Sorry for a delay.. Actually I'll probably start to work on similar [sub]project to simplify my library for working with DOM because I need all features above.
Looked at the code deeply and noticed that you are using event callback lists for implementing custom events. Why in this way? They are unsafe and not standard-friendly (recommend to read http://dean.edwards.name/weblog/2009/03/callbacks-vs-events/)
I care about performance and I don't want to put a try catch around neither use Dean approach (it does not simply work in some case this library solves those too) plus this is the only library I know that truly solves problem in IE8 ... everything before, included Dean effort, is not as compact in size and W3C compatible in terms of features and fast, in term of performance, as this one but feel free to create yet another IE8 thing based on old Dean studies (I know Dean site since ... like ever)
Good luck, and cheers. Feel free to close this whenever you want.
one more thing, grab the test suite and compare it with Firefox: http://webreflection.github.io/ie8/test/ .. at least you dont' start from the scratch. Then you can go on with DOM4 http://webreflection.github.io/dom4/test/ and if you really wanna go further, go eddy http://webreflection.github.io/eddy/test/ all compatible 100% with real IE8, no emulators ;-)
In better-dom I'm using the Prototype's approach for custom events, e.g. ondataavailable, which allows to create custom events in old IEs without try/catch. May be not worth to look at...
Did some experimenting yesterday and seems like wine's IE8 throws unexpected exception on patching prototypes, need to look deeply.
Closing for now, anyway I guess you could grab some ideas for future improvements.
better-dom sounds like another wrapper while the goal of this repository is to use W3C standards as these are.
The Dean approach does not work as expected, it does not bubble, as example, and requires extra code in between event triggering that makes debugging even harder with a mix of unknown errors and userland errors.
Prototype is death, IMHO, but it seems you come from 2004 ... pointing at Dean's site (read the date on that article) and talking about the Prototype solution so here a quick summary of what this is:
- this is a painless drop in for IE8 only so that you don't have to care about it but eventually test the rest against it
- this has been tested with real installation of IE8 and there is no problems with the test suite as well as no problems with extending the prototype
- it is not a bad practice to polyfill and ie8 is a partial and reasonable W3C polyfill for most used/needed things
- IE8 is slow and made slower by all libraries that tried to fix it in a greedy way .... this repository will never follow that road and it is indeed a new approach maybe you'll might consider to llook for new ideas together with DOM4 integration and what's tested and fully compatible with eddy too
Thanks in any case for any concrete/real/effective bug report you might have in the future for real IE8 (no simulators).
Best Regards
Prototype is death, IMHO, but it seems you come from 2004
By Prototype's approach for custom events I mentioned using just their solution with ondataavailable which bubbles. I'd recommend you to look at their codebase. Didn't want to reborn it, the main idea of patching prototypes is wrong imo.
Callback lists are unsafe. According to standards any event handler should not prevent others in case of exception (as pointed in the Deans article). If one of the goals for your library is to polyfil W3C behavior than may be not worse to get rid of callback lists. It's up to you of course.
I'm using wine's IE8 during development for quick testing, so if it fails than it hurts me (the exception is not related to your project). Therefore still need to investigate if I can patch prototypes for IE8.
you have a trusting problem because I've said this work on real IE8 and yes, emulators are not the way to test older IE so everything you are doing there is a waste of time. Go with proper images or grab, as I've done, an old machine, put Windows XP or whatever updated to IE8 in there and have fun ^_^
P.S. there is nothing unsafe ... if something breaks is already a problem plus IE8 is already unsafe by itself. We should get real these days and move on ... this repository, will never waste time on that browser providing something nobody needed for real 'till today. 2013, towards 2014, IE8 should die in peace, this repo makes it easier to forget about it and it works . Still feel free to file bugs if needed