IE thinks that window and document.body are really the same thing -- even
though one has a style property and the other doesn't. This means that when we pass in 'window' to pagePosition, it blows up, but it didin't before a recent reorganization. Here, we create a short term preventative measure to ensure that old apps don't break -- this should be fixed in 2.6. (See #1034, #1051) git-svn-id: http://svn.openlayers.org/trunk/openlayers@4783 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -991,7 +991,12 @@ OpenLayers.Util.pagePosition = function(forElement) {
|
||||
while(element) {
|
||||
|
||||
if(element == document.body) {
|
||||
if(OpenLayers.Element.getStyle(child, 'position') == 'absolute') {
|
||||
// FIXME: IE, when passed 'window' as the forElement, treats it as
|
||||
// equal to document.body, but window.style fails, so getStyle
|
||||
// fails, so we are paranoid and check this here. This check should
|
||||
// probably move into element.getStyle in 2.6.
|
||||
if(child && child.style &&
|
||||
OpenLayers.Element.getStyle(child, 'position') == 'absolute') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user