[Pkg-javascript-commits] [dojo] 12/16: Committing backports of IE9/FF4 fixes to 1.5 branch, under SitePen CCLA. Fixes #14199 !strict
David Prévot
taffit at moszumanska.debian.org
Thu Aug 21 17:39:04 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag 1.5.3
in repository dojo.
commit 950dfb3f8dc34b7dc807a3e842d396925cb53ee8
Author: Kenneth G. Franqueiro <kenneth.franqueiro at gmail.com>
Date: Thu Nov 3 02:01:54 2011 +0000
Committing backports of IE9/FF4 fixes to 1.5 branch, under SitePen CCLA. Fixes #14199 !strict
git-svn-id: http://svn.dojotoolkit.org/src/branches/1.5/dojo@26956 560b804f-0ae3-0310-86f3-f6aa0a117693
---
_base/event.js | 23 ++---
_base/html.js | 6 +-
_base/query.js | 2 +-
io/iframe.js | 43 ++--------
tests/window/test_scroll.html | 195 ++++++++++++++++++------------------------
uacss.js | 1 +
window.js | 12 +--
7 files changed, 114 insertions(+), 168 deletions(-)
diff --git a/_base/event.js b/_base/event.js
index 408da37..f1ebd39 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,7 +19,6 @@ 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)){
@@ -76,7 +74,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 +274,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 +423,10 @@ dojo.require("dojo._base.connect");
if(evt.type == "mouseout"){
evt.relatedTarget = evt.toElement;
}
- evt.stopPropagation = del._stopPropagation;
- evt.preventDefault = del._preventDefault;
+ if (dojo.isIE < 9 || dojo.isQuirks) {
+ evt.stopPropagation = del._stopPropagation;
+ evt.preventDefault = del._preventDefault;
+ }
return del._fixKeys(evt);
},
_fixKeys: function(evt){
@@ -460,7 +460,8 @@ 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 +479,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);
- evt.cancelBubble = faux.cancelBubble;
+ if(dojo.isIE < 9 || (dojo.isIE && dojo.isQuirks)){
+ evt.cancelBubble = faux.cancelBubble;
+ }
evt.returnValue = faux.returnValue;
_trySetKeyCode(evt, faux.keyCode);
}
@@ -501,11 +504,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 1542fe2..53665ac 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, opaque = opacity == 1;
node.style.zoom = opaque ? "" : 1;
@@ -802,7 +802,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..531a899 100644
--- a/io/iframe.js
+++ b/io/iframe.js
@@ -70,30 +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";
- }
+ 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());
- if(!dojo.isIE){
- this.setSrc(cframe, turi, true);
- cframe.onload = new Function(onloadstr);
- }
+ window[fname] = cframe;
return cframe;
},
@@ -186,8 +168,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 +270,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){
diff --git a/tests/window/test_scroll.html b/tests/window/test_scroll.html
index 4a4d4ba..c5d8fc6 100644
--- a/tests/window/test_scroll.html
+++ b/tests/window/test_scroll.html
@@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
-<html>
+<html style="overflow-y:scroll;border:0px none;padding:0;margin:0;">
<head>
<title>dojo.window.scrollIntoView Test</title>
@@ -17,9 +17,22 @@
dojo.require("dojo.window");
var usingNative = !(dojo.isMoz || dojo.isIE || dojo.isWebKit || dojo.isOpera);
+ var loading = new doh.Deferred();
+ var count = 0;
dojo.addOnLoad(function(){
+ innerScrollBarSize = dojo.byId("nonscroll").clientWidth - dojo.byId("withscroll").clientWidth;
+ console.debug('inner scrollbar size = ' + innerScrollBarSize);
+ outerScrollBarSize = (dojo.isIE >= 9) ? ((dojo.position(document.documentElement).w - document.documentElement.clientWidth) || innerScrollBarSize) : innerScrollBarSize;
+ console.debug('outer scrollbar size = ' + outerScrollBarSize);
doh.register("dojo.window.scroll",
[
+ {
+ name: "wait for iframes to load",
+ timeout: 20000,
+ runTest: function(){
+ return loading;
+ }
+ },
function checkAttrs(){
var body = dojo.body();
dojo.window.scrollIntoView(body);
@@ -34,7 +47,7 @@
},
function test_8284(){
var minScroll, maxScroll, fudge=0;
- if(dojo.isIE){
+ if(dojo.isIE <= 8){
minScroll = maxScroll = 11;
if(dojo.isIE <= 6){
fudge = dojo.byId('8284_quirks').contentWindow.document.body.clientHeight-100; // needed for running inside DOH runner
@@ -44,49 +57,17 @@
}
generateTestXY('8284_quirks', "0", -maxScroll+fudge, "0", minScroll-fudge);
generateTestXY('8284_quirks_rtl', "0", -maxScroll+fudge, "0", minScroll-fudge);
- if(dojo.isIE >= 8){
- maxScroll--;
- minScroll--;
+ if(dojo.isIE == 8){
+ minScroll = maxScroll = 10;
}
generateTestXY('8284_strict', "0", -maxScroll, "0", minScroll);
generateTestXY('8284_loose_rtl', "0", -maxScroll, "0", minScroll);
},
function test_absContent(){
- var minScrollX, minScrollY, maxScrollX, maxScrollY;
- if(dojo.isIE){
- maxScrollX = -10 - sb;
- maxScrollY = (dojo.isIE >= 8)? maxScrollX : (-38 - sb);
- }else{
- maxScrollX = maxScrollY = -10 - sb;
- }
- minScrollX = minScrollY = sb + 10;
- generateTestXY('absContent_strict', maxScrollX, maxScrollY, minScrollX, minScrollY);
- if(dojo.isIE < 7){
- maxScrollX -= (sb & 1); // odd sized sb adds 1 more
- minScrollX -= (sb & 1); // odd sized sb adds 1 more
- }
- if(dojo.isIE == 7){ minScrollX = -90; }
- if(dojo.isOpera){
- maxScrollX = 90;
- }
- generateTestXY('absContent_loose_rtl', maxScrollX, maxScrollY, minScrollX, minScrollY);
- if(dojo.isIE){
- maxScrollX = (dojo.isIE >= 7? -10 : -6) - sb;
- maxScrollY = (dojo.isIE >= 7? -38 : -34) - sb;
- minScrollY = minScrollX = -maxScrollX;
- }else{
- maxScrollX = maxScrollY = -(sb+10);
- minScrollX = minScrollY = sb+10;
- }
- generateTestXY('absContent_quirks', maxScrollX, maxScrollY, minScrollX, minScrollY);
- if(dojo.isIE < 8){
- maxScrollX = (dojo.isIE >= 7 ? -10 : -6) - sb - (sb & 1);
- minScrollX = "+" + ((dojo.isIE >= 7? 10 : 6) + sb - (sb & 1));
- }
- if(dojo.isOpera){
- maxScrollX = 90;
- }
- generateTestXY('absContent_quirks_rtl', maxScrollX, maxScrollY, minScrollX, minScrollY);
+ generateTestXY('absContent_strict', 0, -10, 0, 10);
+ generateTestXY('absContent_loose_rtl', 0, -10, 0, 10);
+ generateTestXY('absContent_quirks', 0, -10, 0, 10);
+ generateTestXY('absContent_quirks_rtl', 0, -10, 0, 10);
},
function test_fixedNode(){
if(!(dojo.isIE <= 6)){
@@ -109,30 +90,20 @@
}
},
function test_7036_8665(){
- var maxScroll;
- var minScroll;
+ var maxScroll = 39;
+ var minScroll = 38;
if(dojo.isIE <= 7){
maxScroll = 54;
minScroll = 39;
- }else{
- maxScroll = 39;
- minScroll = 38;
}
generateTest('7036_8665_strict', "(0,-"+maxScroll+")(0,-1)", "(0,+"+minScroll+")(0,+1)");
- if(dojo.isIE){
+ generateTest('7036_8665_loose_rtl', "(0,-"+maxScroll+")(0,-1)", "(0,+"+minScroll+")(0,+1)");
+ if(dojo.isIE == 8){
maxScroll = 54;
minScroll = 39;
- }else{
- maxScroll = 39;
- minScroll = 38;
}
generateTest('7036_8665_quirks', "(0,-"+maxScroll+")(0,-1)", "(0,+"+minScroll+")(0,+1)");
generateTest('7036_8665_quirks_rtl', "(0,-"+maxScroll+")(0,-1)", "(0,+"+minScroll+")(0,+1)");
- if(dojo.isIE >= 8){
- maxScroll = 39;
- minScroll = 38;
- }
- generateTest('7036_8665_loose_rtl', "(0,-"+maxScroll+")(0,-1)", "(0,+"+minScroll+")(0,+1)");
},
function test_innerNoScrollBars(){
var scroll;
@@ -144,7 +115,7 @@
scroll = 39;
}
generateTestXY('innerNoScrollBars_strict', scroll, -29, scroll, -29);
- if(dojo.isIE){
+ if(dojo.isIE <= 8){
scroll = -38;
}
generateTestXY('innerNoScrollBars_quirks', scroll, -29, scroll, -29);
@@ -160,7 +131,7 @@
scroll = 39;
}
generateTestXY('innerNoScrollBars_loose_rtl', scroll, -29, scroll, -29);
- if(dojo.isIE){
+ if(dojo.isIE <= 8){
scroll = -38;
}
generateTestXY('innerNoScrollBars_quirks_rtl', scroll, -29, scroll, -29);
@@ -171,12 +142,6 @@
generateTest('noScrollBars_loose_rtl', "(0,0)", "(0,0)");
generateTest('noScrollBars_quirks_rtl', "(0,0)", "(0,0)");
},
- function test_bottomFloated(){
- generateTest('bottomFloated_strict', "(+0,-0)", "(+0,-0)");
- generateTest('bottomFloated_quirks', "(+0,-0)", "(+0,-0)");
- generateTest('bottomFloated_loose_rtl', "("+(dojo.isOpera? -1 : (((dojo.isIE >= 8 || dojo.isWebKit)? "+" : "-")+0))+",-0)", "("+(dojo.isOpera? (sb+20) : (((dojo.isIE < 8 || dojo.isMoz)?"-":"+")+0))+",-0)");
- generateTest('bottomFloated_quirks_rtl', "("+(dojo.isOpera? -1 : ((dojo.isWebKit? "+" : "-")+0))+",-0)", "("+(dojo.isOpera? (sb+20) : (((dojo.isIE || dojo.isMoz)?"-":"+")+0))+",-0)");
- },
function test_table(){
var minScroll, maxScroll;
minScroll = "(0,+15)";
@@ -192,7 +157,7 @@
generateTest('table_quirks_rtl', maxScroll, minScroll);
},
function test_innerScrollbars(){
- var scroll = sb - 5;
+ var scroll = innerScrollBarSize - 5;
generateTestXY('innerScrollbars_strict', -scroll, -scroll, scroll, scroll);
generateTestXY('innerScrollbars_loose_rtl', -scroll, -scroll, dojo.isIE == 7 ? -25 : scroll, scroll);
generateTestXY('innerScrollbars_quirks', -scroll, -scroll, scroll, scroll);
@@ -211,38 +176,40 @@
function test_tooBig(){
var fudge = 0;
if(dojo.isIE <= 6){
- fudge = dojo.byId('tooBig_quirks').contentWindow.document.body.clientHeight-100+sb; // needed for running inside DOH runner
+ fudge = dojo.byId('tooBig_quirks').contentWindow.document.body.clientHeight-100+innerScrollBarSize; // needed for running inside DOH runner
}
var minScroll, maxScroll;
- generateTestXY('tooBig_strict', sb+10,sb+20, 1,1);
- generateTestXY('tooBig_quirks', sb+10-fudge,sb+20-fudge, 1,1);
- if(dojo.isIE <= 7 || dojo.isMoz){
+ generateTestXY('tooBig_strict', outerScrollBarSize+10,outerScrollBarSize+20, 1,1);
+ generateTestXY('tooBig_quirks', outerScrollBarSize+10-fudge,outerScrollBarSize+20-fudge, 1,1);
+ if(dojo.isIE <= 7 || dojo.isMoz || dojo.isChrome){
maxScroll = -1;
}else if(dojo.isIE){
maxScroll = +20;
}else if(dojo.isOpera){
maxScroll = -90;
}else{
- maxScroll = sb+10;
+ maxScroll = outerScrollBarSize+10;
}
- if(dojo.isIE <= 7 || dojo.isMoz){
+ if(dojo.isIE <= 7 || dojo.isMoz || dojo.isChrome){
minScroll = -20;
}else if(dojo.isOpera){
- minScroll = 80 + sb;
+ minScroll = 80 + outerScrollBarSize;
}else{
minScroll = 1;
}
- generateTestXY('tooBig_loose_rtl', maxScroll,sb+20, minScroll,1);
+ generateTestXY('tooBig_loose_rtl', maxScroll,outerScrollBarSize+20, minScroll,1);
if(dojo.isIE >= 8){
maxScroll = -1;
+ }
+ if(dojo.isIE == 8){
minScroll = -20;
}
- generateTestXY('tooBig_quirks_rtl', maxScroll,sb+20-fudge, minScroll,1);
+ generateTestXY('tooBig_quirks_rtl', maxScroll,outerScrollBarSize+20-fudge, minScroll,1);
},
function test_htmlPadding(){
var fudge = 0;
if(dojo.isIE <= 6){
- fudge = dojo.byId('tooBig_quirks').contentWindow.document.body.clientHeight-100+sb; // needed for running inside DOH runner
+ fudge = dojo.byId('tooBig_quirks').contentWindow.document.body.clientHeight-100+innerScrollBarSize; // needed for running inside DOH runner
}
var minScroll, maxScroll;
if(dojo.isIE <= 7){
@@ -252,7 +219,7 @@
}
generateTest('htmlPadding_strict', "(0,-"+maxScroll+")", "(0,+"+minScroll+")");
generateTest('htmlPadding_loose_rtl', "(0,-"+maxScroll+")", "(0,+"+minScroll+")");
- if(dojo.isIE){
+ if(dojo.isIE <= 8){
maxScroll = minScroll = 34;
}
generateTest('htmlPadding_quirks', "(0,-"+(maxScroll-fudge)+")", "(0,+"+(minScroll-fudge)+")");
@@ -262,22 +229,23 @@
doh.run();
});
function generateTest(id, maxVal, minVal){
- var expectedScroll, actualScroll, compare = usingNative? "isNot" : "is";
+ var compare = usingNative? "isNot" : "is";
with(dojo.byId(id)){
scrollMin();
scrollMax();
scrollIntoView();
- actualScroll = getScroll();
- expectedScroll = usingNative? "(-1,-1)" : maxVal;
- doh[compare](expectedScroll, actualScroll, id+" max failed");
+ var maxActualScroll = getScroll();
+ var maxExpectedScroll = usingNative? "(-1,-1)" : maxVal;
scrollIntoView(); // make sure the value sticks
- actualScroll = getScroll();
- doh[compare](expectedScroll, actualScroll, id+" repeat max failed");
+ var repMaxActualScroll = getScroll();
scrollMin();
scrollIntoView();
- actualScroll = getScroll();
- expectedScroll = usingNative? "(+1,+1)" : minVal;
- doh[compare](expectedScroll, actualScroll, id+" min failed");
+ var minActualScroll = getScroll();
+ var minExpectedScroll = usingNative? "(+1,+1)" : minVal;
+ dojo.byId(id).style.visibility = 'visible';
+ doh[compare](maxExpectedScroll, maxActualScroll, id+" max failed");
+ doh[compare](maxExpectedScroll, repMaxActualScroll, id+" repeat max failed");
+ doh[compare](minExpectedScroll, minActualScroll, id+" min failed");
}
}
function generateTestXY(id, maxScrollX, maxScrollY, minScrollX, minScrollY){
@@ -296,10 +264,6 @@
<tr><td><div id="nonscroll" style="width:100px;overflow:hidden;border:1px solid blue;"> </div></td></tr>
<tr><td><div id="withscroll" style="width:100px;overflow-x:hidden;overflow-y:scroll;border:1px solid red;"> </div></td></tr>
</table>
-<script type="text/javascript">
-sb = dojo.byId("nonscroll").clientWidth - dojo.byId("withscroll").clientWidth;
-console.debug('!!!!!!!!!!!! scrollbar size = ' + sb);
-</script>
<!-- The test templates are below -->
<fieldset>
<label for="8249">Scrollable parent != offsetParent:</label>
@@ -331,11 +295,9 @@ console.debug('!!!!!!!!!!!! scrollbar size = ' + sb);
<fieldset>
<label for="absContent">Absolute-positioned content:</label>
<div type="testIframe" id="absContent">
- <iframestyle>INPUT { L_left:90px; R_right:90px; WKR_FF2R_left:90px; WKR_FF2R_right:auto; }
- HTML { overflow:scroll !important; /*IE6*/ }</iframestyle>
- <hr style="height:100px;width:200px;float:left;"/>
- <hr style="height:100px;width:200px;float:right;"/>
- <input id=it style="position:absolute;top:90px;">
+ <iframestyle>HTML { overflow-x:hidden !important; /*IE6*/ }</iframestyle>
+ <div style="height:200px;width:20px;"></div>
+ <input id=it style="position:absolute;left:10px;top:90px;">
</div>
</fieldset>
<fieldset>
@@ -372,8 +334,9 @@ console.debug('!!!!!!!!!!!! scrollbar size = ' + sb);
<fieldset>
<label for="innerNoScrollBars">Complex scrollable inner content, no scrollbars:</label>
<div type="testIframe" id="innerNoScrollBars">
- <iframestyle>DIV { width:20px; IEQ_width:26px; height:20px; IEQ_height:24px; }</iframestyle>
- <div style="overflow:hidden; margin:10px;border:1px solid red;border-width:1px 2px 3px 4px;"
+ <iframestyle>BODY { overflow:hidden !important; /*IE9*/ }</iframestyle>
+ <fieldset style="overflow:hidden; margin:10px;border:1px solid red;border-width:1px 2px 3px 4px;display:inline;"
+ ><div style="overflow:hidden; width:20px;height:20px;"
><fieldset style="width:59px;overflow:visible;"
><input style="background-color:green;height:15px;float:left;"
><nobr style="margin:7px;padding:3px;border:5px solid pink;overflow:visible;display:block;width:90px;float:left;"
@@ -383,25 +346,21 @@ console.debug('!!!!!!!!!!!! scrollbar size = ' + sb);
></nobr
><input style="background-color:cyan;height:10px;float:left;"
></fieldset
- ></div>
+ ></div
+ ></fieldset>
</div>
</fieldset>
<fieldset>
<label for="noScrollBars">Nothing to do:</label>
<div type="testIframe" id="noScrollBars">
+ <iframestyle>
+ HTML { overflow:hidden !important; /*IE6*/ }
+ BODY { overflow:hidden !important; /*IE9*/ }
+ </iframestyle>
<input id=it style="margin:25px;">
</div>
</fieldset>
<fieldset>
-<label for="bottomFloated">Bottom, floated:</label>
-<div type="testIframe" id="bottomFloated">
- <iframestyle>INPUT { L_float:left; R_float:right; WKR_FF2R_float:left; }</iframestyle>
- <hr style="float:left;height:50px;"/>
- <hr style="float:right;height:50px;"/>
- <input id=it style="clear:both;">
-</div>
-</fieldset>
-<fieldset>
<label for="table">Table:</label>
<div type="testIframe" id="table">
<iframestyle>HTML { overflow-x:hidden !important; /*IE6*/ }</iframestyle>
@@ -474,7 +433,7 @@ console.debug('!!!!!!!!!!!! scrollbar size = ' + sb);
n._scrollMinY = n.scrollTop;
n._scrollMinX = n.scrollLeft;
n.scrollTop++;
- if(((n._scrollMaxX||0)-n._scrollMinX) == sb && (n.scrollWidth <= n.clientWidth || n.scrollWidth <= n.offsetWidth)){ // ignore fake scrolls
+ if(((n._scrollMaxX||0)-n._scrollMinX) == innerScrollBarSize && (n.scrollWidth <= n.clientWidth || n.scrollWidth <= n.offsetWidth)){ // ignore fake scrolls
}else if((n._scrollMaxX||0) > n._scrollMinX){
n.scrollLeft++;
}
@@ -490,7 +449,7 @@ console.debug('!!!!!!!!!!!! scrollbar size = ' + sb);
n._scrollMaxY = n.scrollTop;
n._scrollMaxX = n.scrollLeft;
n.scrollTop--;
- if((n._scrollMaxX-(n._scrollMinX||0)) == sb && (n.scrollWidth <= n.clientWidth || n.scrollWidth <= n.offsetWidth)){
+ if((n._scrollMaxX-(n._scrollMinX||0)) == innerScrollBarSize && (n.scrollWidth <= n.clientWidth || n.scrollWidth <= n.offsetWidth)){
n._scrollMaxX = n.scrollLeft = (n._scrollMinX || 0); // ignore fake scrolls
}else{
n.scrollLeft--;
@@ -523,6 +482,9 @@ console.debug('!!!!!!!!!!!! scrollbar size = ' + sb);
_scrollIntoView(win);
alert(_getScroll(win));
}
+ function iframeLoaded(){
+ if(--count == 0){ loading.callback(true); }
+ }
function initIframeMethods(iframeWin, parentWin){
iframeWin.frameElement.findInput = function(){ return parentWin._findInput(iframeWin) };
iframeWin.frameElement.scrollMin = function(){ parentWin._scrollMin(iframeWin) };
@@ -583,13 +545,15 @@ console.debug('!!!!!!!!!!!! scrollbar size = ' + sb);
'HR { width:120px;height:1px;visibility:hidden;display:block; }\n'+
style+
'<\/STYLE>'+
+ '<\/HEAD>'+
+ '<BODY BGCOLOR=#ffffff>'+
+ content+
'<SCRIPT type=text/javascript>'+
- 'var win = frameElement.ownerDocument.defaultView||frameElement.document.parentWindow;'+
+ 'win=frameElement.ownerDocument.defaultView||frameElement.document.parentWindow;'+
'win.initIframeMethods(window, win);'+
+ 'win.iframeLoaded();'+
+ 'document.body.onclick=frameElement.onClick;'+
'<\/SCRIPT>'+
- '<\/HEAD>'+
- '<BODY BGCOLOR=#ffffff onclick=\'frameElement.onClick()\'>'+
- content+
'<\/BODY>'+
'<\/HTML>"';
return iframeSrc;
@@ -604,19 +568,24 @@ console.debug('!!!!!!!!!!!! scrollbar size = ' + sb);
dojo.style(container, "cssText", "display:inline;border:1px ridge gray;padding:0px;margin:0px;background-color:"+color+";text-align:"+(rtl?"right;":"left;"));
container.appendChild(document.createTextNode(text));
var iframe = document.createElement('iframe');
- if(dojo.isOpera){ iframe.setAttribute('src', iframeSrc); }
+ iframe.setAttribute('src', iframeSrc);
iframe.setAttribute('frameBorder', "0");
iframe.setAttribute('scrolling', "auto");
iframe.setAttribute('allowTransparency', "true");
iframe.setAttribute('id', id + idSuffix);
iframe.setAttribute('name', id + idSuffix);
iframe.className = className;
- dojo.style(iframe, "cssText", "display:block;border:2px solid "+color+";background-color:transparent;margin:0px;padding:3px;"+style);
+ dojo.style(iframe, "cssText", "visibility:hidden;display:block;border:2px solid "+color+";background-color:transparent;margin:0px;padding:3px;"+style);
container.appendChild(iframe);
srcNode.appendChild(container);
- if(!dojo.isOpera){ iframe.setAttribute('src', iframeSrc); }
+ var src = iframe.getAttribute("src");
+ if(!src || src.indexOf("javascript") == -1){
+ // set it again if it didn't stick the first time: esp. older Opera and WebKit
+ setTimeout(function(){ iframe.setAttribute('src', iframeSrc); }, 0);
+ }
}
var testIframes = dojo.query('DIV[type="testIframe"]');
+ count = testIframes.length * 4;
for(var i=0; i < testIframes.length; i++){
var srcNode = testIframes[i];
var content = srcNode.innerHTML || '';
diff --git a/uacss.js b/uacss.js
index f5da940..b788ab1 100644
--- a/uacss.js
+++ b/uacss.js
@@ -24,6 +24,7 @@ dojo.provide("dojo.uacss");
dj_ie6: maj(ie) == 6,
dj_ie7: maj(ie) == 7,
dj_ie8: maj(ie) == 8,
+ dj_ie9: maj(ie) == 9,
dj_quirks: d.isQuirks,
dj_iequirks: ie && d.isQuirks,
diff --git a/window.js b/window.js
index e2c498b..9a262c7 100644
--- a/window.js
+++ b/window.js
@@ -53,7 +53,9 @@ dojo.window.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
return;
}
var backCompat = doc.compatMode == 'BackCompat',
- clientAreaRoot = backCompat? body : html,
+ clientAreaRoot = (isIE >= 9 && node.ownerDocument.parentWindow.frameElement)
+ ? ((html.clientHeight > 0 && html.clientWidth > 0 && (body.clientHeight == 0 || body.clientWidth == 0 || body.clientHeight > html.clientHeight || body.clientWidth > html.clientWidth)) ? html : body)
+ : (backCompat ? body : html),
scrollRoot = isWK ? body : clientAreaRoot,
rootWidth = clientAreaRoot.clientWidth,
rootHeight = clientAreaRoot.clientHeight,
@@ -78,14 +80,11 @@ dojo.window.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
}else{
var pb = dojo._getPadBorderExtents(el);
elPos.w -= pb.w; elPos.h -= pb.h; elPos.x += pb.l; elPos.y += pb.t;
- }
-
- if(el != scrollRoot){ // body, html sizes already have the scrollbar removed
var clientSize = el.clientWidth,
scrollBarSize = elPos.w - clientSize;
if(clientSize > 0 && scrollBarSize > 0){
elPos.w = clientSize;
- if(isIE && rtl){ elPos.x += scrollBarSize; }
+ elPos.x += (rtl && (isIE || el.clientLeft > pb.l/*Chrome*/)) ? scrollBarSize : 0;
}
clientSize = el.clientHeight;
scrollBarSize = elPos.h - clientSize;
@@ -114,8 +113,9 @@ dojo.window.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
bot = t + nodePos.h - elPos.h; // beyond bottom: > 0
if(r * l > 0){
var s = Math[l < 0? "max" : "min"](l, r);
+ if(rtl && ((isIE == 8 && !backCompat) || isIE >= 9)){ s = -s; }
nodePos.x += el.scrollLeft;
- el.scrollLeft += (isIE >= 8 && !backCompat && rtl)? -s : s;
+ el.scrollLeft += s;
nodePos.x -= el.scrollLeft;
}
if(bot * t > 0){
--
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