Permalink
Browse files

refactoring, bugfixing and some new [beta] functions. + extras/XHR2 (…

…work in progress)

a.js:
[no a.noextras.js for now]
+ UNSTABLE_FUNCTIONS GCC option (default=false)
+ JQUERY_COMPATIBLE GCC option (default=false)
+ UNSTABLE_FUNCTIONS: find and findAll Element.prototype and document methods (work in progress)
* stopImmediatePropagation implementation: save service listeners to object associated with original element
* [bugfix] HTMLElement.prototype.insertAdjacentHTML with "afterbegin"
* new dom4_mutationMacro for after, before, append, prepend and replac with live NodeList support
* matchesSelector second parameter refNodes support and + new name - "matches"
* new inherit NodeList from Array method

a.ie8.js:
+ UNSTABLE_FUNCTIONS GCC option (default=false)
+ JQUERY_COMPATIBLE GCC option (default=false)
+ UNSTABLE_FUNCTIONS: useCaption option in [add|remove]EventListener and caption phase in dispachEvent (work in progress)
+ event.defaultPrevented=false in fixEvent and event.defaultPrevented=true in preventDefault()
+ NodeList.prototype inherited from Array
+ document.querySelectorAll and document.querySelector now return NodeList
+ [IE8 only] getElementsByClassName
+ [IE8 only] CSSStyleDeclaration.prototype.opacity
* UNSTABLE_FUNCTIONS: Node.prototype.contains fixing {need more tests)
* BROKEN: offsetLeft and offsetTop (need more work)
* [bugfixing] document.createElement

a.ielt8.js
+ all from a.ie8.js except [IE8 only]
+ New beautiful and fast querySelector[All], getElementsByClassName, matchesSelector (matchesSelector without second parameter refNodes support for now)
+ export querySelector[All], getElementsByClassName to document and matches[Selector] to document.documentElement
* XMLHttpRequest
  • Loading branch information...
1 parent fb609f7 commit 4146ac298783445d4c705e88aed5cbf1d47aa31f @termi committed Jul 21, 2012
Showing with 3,116 additions and 1,485 deletions.
  1. +43 −32 __COMPILE/a.ie8.js
  2. +60 −50 __COMPILE/a.ielt8.js
  3. +56 −42 __COMPILE/a.js
  4. +589 −234 __SRC/a.ie8.js
  5. +1,258 −910 __SRC/a.ielt8.js
  6. +349 −210 __SRC/a.js
  7. +7 −7 example/simple/index.html
  8. +754 −0 extras/XHR2.js
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -16,12 +16,12 @@
</style>
<!-- https://raw.github.com/termi/ES5-DOM-SHIM/master/__COMPILE/a.js -->
<!--[if lt IE 8]>
-<script src="../../__COMPILE/a.ielt8.js"></script>
+<script src="../../__SRC/a.ielt8.js"></script>
<![endif]-->
<!--[if IE 8]>
-<script src="../../__COMPILE/a.ie8.js"></script>
+<script src="../../__SRC/a.ie8.js"></script>
<![endif]-->
-<script src="../../__COMPILE/a.js"></script>
+<script src="../../__SRC/a.js"></script>
<script>
document.createElement("j");
document.createElement("c");
@@ -104,19 +104,19 @@
var dosome1;
document.addEventListener("someEvent", dosome1 = function(event) {
- console.log((this === document ? "document" : "window") + " someEvent " + (event.eventPhase === Event.BUBBLING_PHASE ? "bubble" : event.eventPhase === Event.AT_TARGET ? "target" : "capture") + "" + event.timeStamp)
+ console.log(1, (this === document ? "document" : "window") + " someEvent " + (event.eventPhase === Event.BUBBLING_PHASE ? "bubble" : event.eventPhase === Event.AT_TARGET ? "target" : "capture") + "" + event.timeStamp)
}, false);
document.addEventListener("someEvent", dosome1, true);
window.addEventListener("someEvent", dosome1, false);
- document.addEventListener("someEvent", dosome1, false);
+ document.addEventListener("someEvent", dosome1, false);//the duplicate instances are discarde
var j = document.getElementsByClassName("test")[0];
j.addEventListener("someEvent", function(e) {
- console.log("j someEvent bubble");
+ console.log(2, "j someEvent bubble | ", event.eventPhase == Event.AT_TARGET ? "at target" : "");
} , false);
j = document.querySelector(".test");
- j.addEventListener("someEvent", function(){console.log("j someEvent capture")}, true);
+ j.addEventListener("someEvent", function(){console.log(3, "j someEvent capture")}, true);
//$("test2").addEventListener("someEvent", console.log.bind(null, "test2 someEvent capture"), true);
Oops, something went wrong.

0 comments on commit 4146ac2

Please sign in to comment.