Skip to content

Commit

Permalink
Merge branch '0.7' into 0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
termi committed Oct 15, 2012
2 parents 0acff2b + 706c3e3 commit bb939c7
Show file tree
Hide file tree
Showing 6 changed files with 181 additions and 120 deletions.
77 changes: 39 additions & 38 deletions __COMPILED/a.ie8.js

Large diffs are not rendered by default.

104 changes: 52 additions & 52 deletions __COMPILED/a.ielt8.js

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions __COMPILED/a.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 43 additions & 9 deletions __SRC/a.ie8.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@ var _ = global["_"]["ielt9shims"]//"_" - container for shims what should be use
}
}

, ATTRIBUTES_CUSTOM = {
'for': 'htmlFor',
'class': 'className',
'value': 'defaultValue'
}

// ------------------------------ ================== Events ================== ------------------------------
, _ielt9_Event
/** @type {Object} */
Expand Down Expand Up @@ -759,14 +765,14 @@ _Event_prototype = function_tmp.prototype = {
"preventDefault" : function() {
if(this.cancelable === false)return;

_ielt9_Event.getNativeEvent.call(this)["returnValue"] = false;
_ielt9_Event.getNativeEvent.call(this)["returnValue"] = this["returnValue"] = false;
_ielt9_Event.destroyLinkToNativeEvent.call(this);
this["defaultPrevented"] = true;
} ,

/** @this {_ielt9_Event} */
"stopPropagation" : function() {
_ielt9_Event.getNativeEvent.call(this)["cancelBubble"] = true;
_ielt9_Event.getNativeEvent.call(this)["cancelBubble"] = this["cancelBubble"] = true;
_ielt9_Event.destroyLinkToNativeEvent.call(this);
} ,

Expand Down Expand Up @@ -972,7 +978,7 @@ function commonHandler(nativeEvent) {
// save event properties in fake 'event' object to allow store 'event' and use it in future
_event = nativeEvent["__customEvent__"] = new _ielt9_Event(nativeEvent);
_event.initEvent(nativeEvent.type, nativeEvent.bubbles, nativeEvent.cancelable);
fixEvent(_event);
fixEvent.call(this, _event);
_event.isTrusted = true;
_event["__custom_event"] = void 0;
}
Expand Down Expand Up @@ -2361,17 +2367,37 @@ if(_Function_call.call(document_createElement, document, "x-x").cloneNode().oute
/* ================================= Only for IE8 ======================================= */

/** @const */
var RE_REPLACER_FOR_ELEMENTS_BY_CLASSNAME = /\s+(?=\S)|^/g;
var RE_REPLACER_FOR_ELEMENTS_BY_CLASSNAME = /\s+(?=\S)|^/g

, _native_Node_getAttribute = _Element_prototype.getAttribute

, _native_Node_setAttribute = _Element_prototype.setAttribute

, _native_Node_removeAttribute = _Element_prototype.removeAttribute
;

//separate properties and attributes
_Element_prototype.setAttribute = function(name, value) {
this[name.toUpperCase()] = value + "";
if(ATTRIBUTES_CUSTOM[name] !== void 0) {
name = ATTRIBUTES_CUSTOM[name];
}
else {
name = name.toUpperCase();
}
return _native_Node_setAttribute.call(this, name, value + "");
};
_Element_prototype.getAttribute = function(name) {
var upperName = name.toUpperCase()
, result = this[upperName]
var upperName
, result
;

if(ATTRIBUTES_CUSTOM[name] !== void 0) {
return _native_Node_getAttribute.call(this, ATTRIBUTES_CUSTOM[name])
}

upperName = name.toUpperCase();
result = this[upperName];

if(!result) {
if(!(upperName in this) && (typeof (result = this[name]) === "string")) {
result = this[upperName] = this[name];
Expand All @@ -2383,11 +2409,19 @@ _Element_prototype.getAttribute = function(name) {
return result ? result + "" : null;
};
_Element_prototype.removeAttribute = function(name) {
var upperName = name.toUpperCase()
, result = upperName in this
var upperName
, result
;

if(ATTRIBUTES_CUSTOM[name] !== void 0) {
return _native_Node_removeAttribute.call(this, ATTRIBUTES_CUSTOM[name])
}

upperName = name.toUpperCase();
result = upperName in this;

if(result || this.getAttribute(name) !== null) {
_native_Node_removeAttribute.call(this, upperName);
delete this[upperName];
}

Expand Down
38 changes: 31 additions & 7 deletions __SRC/a.ielt8.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,12 @@ var _ = global["_"]["ielt9shims"]//"_" - container for shims what should be use
}
}

, ATTRIBUTES_CUSTOM = {
'for': 'htmlFor',
'class': 'className',
'value': 'defaultValue'
}

// ------------------------------ ================== Events ================== ------------------------------
, _ielt9_Event
/** @type {Object} */
Expand Down Expand Up @@ -754,14 +760,14 @@ if(!("pageXOffset" in global)) {
"preventDefault" : function() {
if(this.cancelable === false)return;

_ielt9_Event.getNativeEvent.call(this)["returnValue"] = false;
_ielt9_Event.getNativeEvent.call(this)["returnValue"] = this["returnValue"] = false;
_ielt9_Event.destroyLinkToNativeEvent.call(this);
this["defaultPrevented"] = true;
} ,

/** @this {_ielt9_Event} */
"stopPropagation" : function() {
_ielt9_Event.getNativeEvent.call(this)["cancelBubble"] = true;
_ielt9_Event.getNativeEvent.call(this)["cancelBubble"] = this["cancelBubble"] = true;
_ielt9_Event.destroyLinkToNativeEvent.call(this);
} ,

Expand Down Expand Up @@ -967,7 +973,7 @@ function commonHandler(nativeEvent) {
// save event properties in fake 'event' object to allow store 'event' and use it in future
_event = nativeEvent["__customEvent__"] = new _ielt9_Event(nativeEvent);
_event.initEvent(nativeEvent.type, nativeEvent.bubbles, nativeEvent.cancelable);
fixEvent(_event);
fixEvent.call(this, _event);
_event.isTrusted = true;
_event["__custom_event"] = void 0;
}
Expand Down Expand Up @@ -3020,23 +3026,35 @@ if(!document[_tmp_]) {

_Element_prototype.setAttribute = function(name, val, flag) {
if(flag == void 0) {
name = name.toUpperCase();
if(ATTRIBUTES_CUSTOM[name] !== void 0) {
name = ATTRIBUTES_CUSTOM[name];
}
else {
name = name.toUpperCase();
}
val = val + "";
flag = 1;
}

return Function.prototype.call.call(this["__setAttribute__"], this, name, val, flag);
};
_Element_prototype.getAttribute = function(name, flag) {
var upperName = name.toUpperCase()
var upperName
, result
, needAttributeShim
;

if(needAttributeShim = (flag == void 0)) {
upperName = name.toUpperCase();
flag = 1;
}

if(ATTRIBUTES_CUSTOM[name] !== void 0) {
upperName = ATTRIBUTES_CUSTOM[name];
}
else {
upperName = name.toUpperCase();
}

result = _Function_call.call(this["__getAttribute__"], this, upperName, flag);
if(result !== null) {
if(needAttributeShim)result += "";
Expand All @@ -3059,7 +3077,13 @@ _Element_prototype.removeAttribute = function(name, flag) {

if(flag == void 0) {
flag = 1;
upperName = name.toUpperCase();
if(ATTRIBUTES_CUSTOM[name] !== void 0) {
name = ATTRIBUTES_CUSTOM[name];
}
else {
upperName = name.toUpperCase();
}

result = upperName in this;

if(!result && this.getAttribute(name) !== null) {
Expand Down
19 changes: 10 additions & 9 deletions __SRC/a.js
Original file line number Diff line number Diff line change
Expand Up @@ -2415,16 +2415,17 @@ if(!_Element_prototype.matchesSelector) {
}
}
}
else {
if(!/([,>+~ ])/.test(selector) && (parent = thisObj.parentNode) && parent.querySelector) {
match = parent.querySelector(selector) === thisObj;
}

if(!/([,>+~ ])/.test(selector) && (parent = thisObj.parentNode) && parent.querySelector) {
match = parent.querySelector(selector) === thisObj;
}

if(!match && (parent = thisObj.ownerDocument)) {
tmp = parent.querySelectorAll(selector);
i = -1;
while(!match && tmp[++i]) {
match = tmp[i] === thisObj;
if(!match && (parent = thisObj.ownerDocument)) {
tmp = parent.querySelectorAll(selector);
i = -1;
while(!match && tmp[++i]) {
match = tmp[i] === thisObj;
}
}
}
}
Expand Down

0 comments on commit bb939c7

Please sign in to comment.