[Pkg-javascript-commits] [dojo] 08/12: Committing backports of IE9/FF4 fixes to 1.4 branch, under SitePen CCLA. Fixes #15508 !strict
David Prévot
taffit at moszumanska.debian.org
Thu Aug 21 17:39:01 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag 1.4.5
in repository dojo.
commit 0a47241f5a35e5928f036bb1107c305a21aac2b1
Author: Kenneth G. Franqueiro <kenneth.franqueiro at gmail.com>
Date: Thu Jun 14 19:44:56 2012 +0000
Committing backports of IE9/FF4 fixes to 1.4 branch, under SitePen CCLA. Fixes #15508 !strict
git-svn-id: http://svn.dojotoolkit.org/src/branches/1.4/dojo@28860 560b804f-0ae3-0310-86f3-f6aa0a117693
---
_base/event.js | 17 +++++++++--------
_base/html.js | 6 +++---
_base/query.js | 2 +-
io/iframe.js | 44 ++++++++------------------------------------
4 files changed, 21 insertions(+), 48 deletions(-)
diff --git a/_base/event.js b/_base/event.js
index 408da37..0aa47af 100644
--- a/_base/event.js
+++ b/_base/event.js
@@ -12,7 +12,6 @@ dojo.require("dojo._base.connect");
if(!node){return;}
name = del._normalizeEventName(name);
fp = del._fixCallback(name, fp);
- var oname = name;
if(
//>>excludeStart("webkitMobile", kwArgs.webkitMobile);
!dojo.isIE &&
@@ -20,11 +19,9 @@ dojo.require("dojo._base.connect");
(name == "mouseenter" || name == "mouseleave")
){
var ofp = fp;
- //oname = name;
name = (name == "mouseenter") ? "mouseover" : "mouseout";
fp = function(e){
if(!dojo.isDescendant(e.relatedTarget, node)){
- // e.type = oname; // FIXME: doesn't take? SJM: event.type is generally immutable.
return ofp.call(this, e);
}
}
@@ -76,7 +73,7 @@ dojo.require("dojo._base.connect");
return evt;
},
_setKeyChar: function(evt){
- evt.keyChar = evt.charCode ? String.fromCharCode(evt.charCode) : '';
+ evt.keyChar = evt.charCode >= 32 ? String.fromCharCode(evt.charCode) : '';
evt.charOrCode = evt.keyChar || evt.keyCode;
},
// For IE and Safari: some ctrl-key combinations (mostly w/punctuation) do not emit a char code in IE
@@ -276,7 +273,7 @@ dojo.require("dojo._base.connect");
=====*/
//>>excludeStart("webkitMobile", kwArgs.webkitMobile);
- if(dojo.isIE){
+ if(dojo.isIE < 9 || (dojo.isIE && dojo.isQuirks)){
dojo.mouseButtons = {
LEFT: 1,
MIDDLE: 4,
@@ -425,8 +422,10 @@ dojo.require("dojo._base.connect");
if(evt.type == "mouseout"){
evt.relatedTarget = evt.toElement;
}
+ if (dojo.isIE < 9 || dojo.isQuirks) {
evt.stopPropagation = del._stopPropagation;
evt.preventDefault = del._preventDefault;
+ }
return del._fixKeys(evt);
},
_fixKeys: function(evt){
@@ -460,7 +459,7 @@ dojo.require("dojo._base.connect");
var k=evt.keyCode;
// These are Windows Virtual Key Codes
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/UserInput/VirtualKeyCodes.asp
- var unprintable = k!=13 && k!=32 && k!=27 && (k<48||k>90) && (k<96||k>111) && (k<186||k>192) && (k<219||k>222);
+ var unprintable = (k!=13 || (dojo.isIE >= 9 && !dojo.isQuirks)) && k!=32 && k!=27 && (k<48||k>90) && (k<96||k>111) && (k<186||k>192) && (k<219||k>222);
// synthesize keypress for most unprintables and CTRL-keys
if(unprintable||evt.ctrlKey){
var c = unprintable ? 0 : k;
@@ -478,7 +477,9 @@ dojo.require("dojo._base.connect");
// simulate a keypress event
var faux = del._synthesizeEvent(evt, {type: 'keypress', faux: true, charCode: c});
kp.call(evt.currentTarget, faux);
+ if(dojo.isIE < 9 || (dojo.isIE && dojo.isQuirks)){
evt.cancelBubble = faux.cancelBubble;
+ }
evt.returnValue = faux.returnValue;
_trySetKeyCode(evt, faux.keyCode);
}
@@ -501,11 +502,11 @@ dojo.require("dojo._base.connect");
});
// override stopEvent for IE
- dojo.stopEvent = function(evt){
+ dojo.stopEvent = (dojo.isIE < 9 || dojo.isQuirks) ? function(evt){
evt = evt || window.event;
del._stopPropagation.call(evt);
del._preventDefault.call(evt);
- }
+ } : dojo.stopEvent;
}
//>>excludeEnd("webkitMobile");
diff --git a/_base/html.js b/_base/html.js
index 730cd55..c61062f 100644
--- a/_base/html.js
+++ b/_base/html.js
@@ -472,7 +472,7 @@ if(dojo.isIE || dojo.isOpera){
//>>excludeEnd("webkitMobile");
dojo._getOpacity =
//>>excludeStart("webkitMobile", kwArgs.webkitMobile);
- d.isIE ? function(node){
+ d.isIE < 9 || (d.isIE && d.isQuirks) ? function(node){
try{
return af(node).Opacity / 100; // Number
}catch(e){
@@ -501,7 +501,7 @@ if(dojo.isIE || dojo.isOpera){
dojo._setOpacity =
//>>excludeStart("webkitMobile", kwArgs.webkitMobile);
- d.isIE ? function(/*DomNode*/node, /*Number*/opacity){
+ d.isIE < 9 || (d.isIE && d.isQuirks) ? function(/*DomNode*/node, /*Number*/opacity){
var ov = opacity * 100;
node.style.zoom = 1.0;
@@ -799,7 +799,7 @@ if(dojo.isIE || dojo.isOpera){
}
}
}
- }else if(d.isOpera || (d.isIE > 7 && !d.isQuirks)){
+ }else if(d.isOpera || (d.isIE == 8 && !d.isQuirks)){
// On Opera and IE 8, offsetLeft/Top includes the parent's border
if(p){
be = d._getBorderExtents(p);
diff --git a/_base/query.js b/_base/query.js
index 5b045d8..ca12c21 100644
--- a/_base/query.js
+++ b/_base/query.js
@@ -736,7 +736,7 @@ if(typeof dojo != "undefined"){
}
};
- var defaultGetter = (d.isIE) ? function(cond){
+ var defaultGetter = (d.isIE < 9 || (dojo.isIE && dojo.isQuirks)) ? function(cond){
var clc = cond.toLowerCase();
if(clc == "class"){ cond = "className"; }
return function(elem){
diff --git a/io/iframe.js b/io/iframe.js
index 04221a3..4a2ca8d 100644
--- a/io/iframe.js
+++ b/io/iframe.js
@@ -70,31 +70,12 @@ dojo.io.iframe = {
}
turi = (dojo.config["dojoBlankHtmlUrl"]||dojo.moduleUrl("dojo", "resources/blank.html"));
}
- var ifrstr = dojo.isIE ? '<iframe name="'+fname+'" src="'+turi+'" onload="'+onloadstr+'">' : 'iframe';
- cframe = dojo.doc.createElement(ifrstr);
- with(cframe){
- name = fname;
- setAttribute("name", fname);
- id = fname;
- }
- dojo.body().appendChild(cframe);
- window[fname] = cframe;
-
- with(cframe.style){
- if(!(dojo.isSafari < 3)){
- //We can't change the src in Safari 2.0.3 if absolute position. Bizarro.
- position = "absolute";
- }
- left = top = "1px";
- height = width = "1px";
- visibility = "hidden";
- }
-
- if(!dojo.isIE){
- this.setSrc(cframe, turi, true);
- cframe.onload = new Function(onloadstr);
- }
+ var cframe = dojo.place(
+ '<iframe id="'+fname+'" name="'+fname+'" src="'+turi+'" onload="'+onloadstr+
+ '" style="position: absolute; left: 1px; top: 1px; height: 1px; width: 1px; visibility: hidden">',
+ dojo.body());
+ window[fname] = cframe;
return cframe;
},
@@ -186,8 +167,8 @@ dojo.io.iframe = {
if(handleAs != "html"){
if(handleAs == "xml"){
// FF, Saf 3+ and Opera all seem to be fine with ifd being xml. We have to
- // do it manually for IE. Refs #6334.
- if(dojo.isIE){
+ // do it manually for IE6-8. Refs #6334.
+ if(dojo.isIE < 9 || (dojo.isIE && dojo.isQuirks)){
dojo.query("a", dii._frame.contentWindow.document.documentElement).orphan();
var xmlText=(dii._frame.contentWindow.document).documentElement.innerText;
xmlText=xmlText.replace(/>\s+</g, "><");
@@ -288,16 +269,7 @@ dojo.io.iframe = {
// if we have things in content, we need to add them to the form
// before submission
var pHandler = function(name, value) {
- var tn;
- if(dojo.isIE){
- tn = dojo.doc.createElement("<input type='hidden' name='"+name+"'>");
- }else{
- tn = dojo.doc.createElement("input");
- tn.type = "hidden";
- tn.name = name;
- }
- tn.value = value;
- fn.appendChild(tn);
+ dojo.create("input", {type: "hidden", name: name, value: value}, fn);
ioArgs._contentToClean.push(name);
};
for(var x in content){
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git
More information about the Pkg-javascript-commits
mailing list