Pull up patches for the following bugs from trunk:

#385: building for windows users (fix license)
#453: IE gives new DOM elements a parent with fragment node type
#454: Fix tests which are breaking in Opera
#455: Util.isEquivalentUrl broken in Opera
#463: map.setBaseLayer is a bit funky
#464: Overview Map dissappears when on permalinked page
#465: allow controls to live outside viewport (for real)
#466: HTMLDivElement is still undefined in IE7 (but 
      OpenLayers.Util.alphaHack() is now false)
#467: isEquivalentURL() not complete for IE
#468: Overview MapLosing Rectangle
#469: Default marker is incorrectly centered
#470: Can not use "search" property IE7
#473: Remove call to checkImgURL
#474: overview map isn't properly updated when the argparser kicks in


git-svn-id: http://svn.openlayers.org/branches/openlayers/2.3@2181 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-01-22 23:26:32 +00:00
parent 2642f000fd
commit 7232cfa3a0
14 changed files with 213 additions and 80 deletions

View File

@@ -24,16 +24,14 @@
t.eq( cloned.url, "b", "cloned.url does change when edited" );
}
function test_02_Marker_setOpacity(t) {
function test_03_Marker_setOpacity(t) {
t.plan( 2 );
icon = new OpenLayers.Icon("a",new OpenLayers.Size(5,6));
t.ok(!icon.imageDiv.style.opacity, "default icon has no opacity");
icon.setOpacity(0.5);
t.eq(icon.imageDiv.style.opacity + "", "0.5", "icon.setOpacity() works");
t.eq(parseFloat(icon.imageDiv.style.opacity), 0.5, "icon.setOpacity() works");
}
// -->

View File

@@ -3,6 +3,7 @@
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript"><!--
var isMozilla = (navigator.userAgent.indexOf("compatible") == -1);
var isOpera = (navigator.userAgent.indexOf("Opera") != -1);
var layer;
function test_01_Layer_EventPane_constructor (t) {
@@ -56,7 +57,7 @@
// MOUSEMOVE test does not seem to work...
// t.plan( 2 );
if (document.createEventObject) {
if (!isMozilla || isOpera) {
t.plan(4);
} else {
t.plan(3);

View File

@@ -181,14 +181,14 @@
map.addLayer(tLayer);
map.zoomToMaxExtent();
t.eq(tLayer.opacity, "0.5", "Opacity is set correctly");
t.eq(tLayer.div.firstChild.style.opacity, "0.5", "Opacity on tile is correct");
t.eq(parseFloat(tLayer.div.firstChild.style.opacity), 0.5, "Opacity on tile is correct");
tLayer.setOpacity("0.6");
t.eq(tLayer.opacity, "0.6", "setOpacity works properly");
t.eq(tLayer.div.firstChild.style.opacity, "0.6", "Opacity on tile is changed correctly");
t.eq(parseFloat(tLayer.div.firstChild.style.opacity), 0.6, "Opacity on tile is changed correctly");
var pixel = new OpenLayers.Pixel(5,6);
var tile = tLayer.addTile(new OpenLayers.Bounds(1,2,3,4), pixel);
tile.draw();
t.eq(tile.imgDiv.style.opacity, "0.6", "Tile opacity is set correctly");
t.eq(parseFloat(tile.imgDiv.style.opacity), 0.6, "Tile opacity is set correctly");
}

View File

@@ -45,7 +45,7 @@
}
function test_02_Marker_setOpacity(t) {
function test_03_Marker_setOpacity(t) {
t.plan( 2 );
var map = new OpenLayers.Map("map");
@@ -69,7 +69,7 @@
marker.setOpacity(0.5);
t.eq(marker.icon.imageDiv.style.opacity + "", "0.5", "marker.setOpacity() works");
t.eq(parseFloat(marker.icon.imageDiv.style.opacity), 0.5, "marker.setOpacity() works");
}
// -->

View File

@@ -61,6 +61,7 @@
var h = 400;
var content = "charlie";
var color = "red";
var hexColor = "#ff0000";
var opacity = 0.5;
var border = "1px solid";
@@ -89,7 +90,9 @@
t.eq(contentDiv.style.overflow, "hidden", "correct content div overflow");
t.eq(contentDiv.innerHTML, content, "correct content div content");
t.eq(popup.div.style.backgroundColor, color, "good default popup.backgroundColor");
var bColor = popup.div.style.backgroundColor;
var goodColor = ( (bColor == color) || (bColor == hexColor));
t.ok(goodColor, "good default popup.backgroundColor");
if (navigator.appName.indexOf("Microsoft") == -1) {
t.eq(parseFloat(popup.div.style.opacity), opacity, "good default popup.opacity");

View File

@@ -67,12 +67,15 @@
t.eq( div.style.width, sz.w + "px", "div.style.width set correctly");
t.eq( div.style.height, sz.h + "px", "div.style.height set correctly");
t.eq( div.style.backgroundImage, "url(" + img + ")", "div.style.backgroundImage correctly");
bImg = div.style.backgroundImage;
imgCorrect = ( (bImg == "url(" + img + ")") ||
(bImg == "url(\"" + img + "\")") );
t.ok(imgCorrect, "div.style.backgroundImage correctly");
t.eq( div.style.position, position, "div.style.positionset correctly");
t.ok( (div.style.border.indexOf(border) != -1), "div.style.border set correctly");
t.eq( div.style.overflow, overflow, "div.style.overflow set correctly");
t.eq( div.style.opacity + "", opacity + "", "elemnt.style.opacity set correctly");
t.eq( parseFloat(div.style.opacity), opacity, "element.style.opacity set correctly");
var filterString = 'alpha(opacity=' + (opacity * 100) + ')';
t.eq( div.style.filter, filterString, "element.style.filter set correctly");
@@ -95,7 +98,7 @@
t.eq( div.style.position, "absolute", "div.style.positionset correctly");
t.eq( div.style.border, "", "div.style.border set correctly");
t.eq(div.style.overflow, "", "div.style.overflow set correctly");
t.ok( !div.style.opacity, "elemnt.style.opacity set correctly");
t.ok( !div.style.opacity, "element.style.opacity set correctly");
t.ok( !div.style.filter, "element.style.filter set correctly");
}
@@ -116,7 +119,7 @@
if (!isMozilla)
t.ok( true, "skipping element test outside of Mozilla");
else
t.ok( image instanceof HTMLImageElement, "createImage creates a valid HTMLImageElement" );
t.ok( image.nodeName == "IMG", "createImage creates a valid HTMLImageElement" );
t.eq( image.id, id, "image.id set correctly");
t.eq( image.style.left, xy.x + "px", "image.style.left set correctly");
t.eq( image.style.top, xy.y + "px", "image.style.top set correctly");
@@ -127,7 +130,7 @@
t.ok( (image.style.border.indexOf(border) != -1), "image.style.border set correctly");
t.eq( image.src, img, "image.style.backgroundImage correctly");
t.eq( image.style.position, position, "image.style.position set correctly");
t.eq( image.style.opacity+"", opacity + "", "image.style.opacity set correctly");
t.eq( parseFloat(image.style.opacity), opacity, "image.style.opacity set correctly");
var filterString = 'alpha(opacity=' + (opacity * 100) + ')';
t.eq( image.style.filter, filterString, "element.style.filter set correctly");
@@ -137,7 +140,7 @@
if (!isMozilla)
t.ok( true, "skipping element test outside of Mozilla");
else
t.ok( image instanceof HTMLImageElement, "createDiv creates a valid HTMLDivElement" );
t.ok( image.nodeName == "IMG", "createDiv creates a valid HTMLDivElement" );
t.ok( (image.id != ""), "image.id set to something");
t.eq( image.style.left, "", "image.style.left set correctly");
t.eq( image.style.top, "", "image.style.top set correctly");
@@ -148,7 +151,7 @@
t.ok((image.style.border == ""), "image.style.border set correctly");
t.eq(image.src, "", "image.style.backgroundImage correctly");
t.eq( image.style.position, "relative", "image.style.positionset correctly");
t.ok( !image.style.opacity, "elemnt.style.opacity default unset");
t.ok( !image.style.opacity, "element.style.opacity default unset");
t.ok( !image.style.filter, "element.style.filter default unset");
}
@@ -211,7 +214,7 @@
t.eq( imageDiv.style.height, sz.h + "px", "image.style.height set correctly");
t.eq( imageDiv.style.position, position, "image.style.positionset correctly");
t.eq( imageDiv.style.opacity+"", opacity + "", "elemnt.style.opacity set correctly");
t.eq( parseFloat(imageDiv.style.opacity), opacity, "element.style.opacity set correctly");
var filterString;
if (OpenLayers.Util.alphaHack()) {
@@ -223,11 +226,10 @@
image = imageDiv.firstChild;
if (!isMozilla)
t.ok( true, "skipping element test outside of Mozilla");
else
t.ok( image instanceof HTMLImageElement, "createImage creates a valid HTMLImageElement" );
t.ok( image.nodeName == "IMG", "createImage creates a valid HTMLImageElement" );
t.eq( image.id, id + "_innerImage", "image.id set correctly");
t.eq( image.style.width, sz.w + "px", "image.style.width set correctly");
@@ -293,7 +295,7 @@
t.eq( element.style.position, position, "element.style.position set correctly");
t.ok( (element.style.border.indexOf(border) != -1), "element.style.border set correctly");
t.eq( element.style.overflow, overflow, "element.style.overflow set correctly");
t.eq( element.style.opacity+"", opacity + "", "elemnt.style.opacity set correctly");
t.eq( parseFloat(element.style.opacity), opacity, "element.style.opacity set correctly");
var filterString = 'alpha(opacity=' + (opacity * 100) + ')';
t.eq( element.style.filter, filterString, "element.style.filter set correctly");
}
@@ -313,11 +315,10 @@
var opacity = 0.5;
OpenLayers.Util.modifyAlphaImageDiv(imageDiv, id, xy, sz, img, position, border, sizing, opacity);
if (OpenLayers.Util.alphaHack())
t.ok( true, "skipping element test outside of Mozilla");
else
t.ok( imageDiv instanceof HTMLDivElement, "createDiv creates a valid HTMLDivElement" );
t.ok( imageDiv.nodeName == "DIV", "createDiv creates a valid HTMLDivElement" );
t.eq( imageDiv.id, id, "image.id set correctly");
t.eq( imageDiv.style.left, xy.x + "px", "image.style.left set correctly");
@@ -327,7 +328,7 @@
t.eq( imageDiv.style.height, sz.h + "px", "image.style.height set correctly");
t.eq( imageDiv.style.position, position, "image.style.position set correctly");
t.eq( imageDiv.style.opacity+"", opacity + "", "elemnt.style.opacity set correctly");
t.eq( parseFloat(imageDiv.style.opacity), opacity, "element.style.opacity set correctly");
@@ -339,7 +340,7 @@
t.ok( true, "skipping element test outside of Mozilla");
} else {
var filterString = 'alpha(opacity=' + (opacity * 100) + ')';
t.ok( image instanceof HTMLImageElement, "createImage creates a valid HTMLImageElement" );
t.ok( image.nodeName == "IMG", "createImage creates a valid HTMLImageElement" );
}
t.eq( imageDiv.style.filter, filterString, "element.style.filter set correctly");
t.eq( image.id, id + "_innerImage", "image.id set correctly");
@@ -516,14 +517,14 @@
url2 = "http://www.openlayers.org";
t.ok(OpenLayers.Util.isEquivalentUrl(url1, url2), "default ignorePort80 works");
options = {
'ignorePort80': false
}
url1 = "http://www.openlayers.org:80";
url2 = "http://www.openlayers.org:50";
t.ok(!OpenLayers.Util.isEquivalentUrl(url1, url2), "port check works");
t.ok(!OpenLayers.Util.isEquivalentUrl(url1, url2, options), "port check works");
//HASH
@@ -546,8 +547,8 @@
//PATHNAME
url1 = "foo.html";
url2 = "../tests/foo.html";
url1 = "foo.html?bar=now#go";
url2 = "../tests/../tests/foo.html?bar=now#go";
t.ok(OpenLayers.Util.isEquivalentUrl(url1, url2), "relative vs. absolute paths works");