Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/OpenLayers/Format/WPSExecute.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ OpenLayers.Format.WPSExecute = OpenLayers.Class(OpenLayers.Format.XML,
*/
write: function(options) {
var doc;
if (window.ActiveXObject) {
if (OpenLayers.Format.XML.supportActiveX) {
doc = new ActiveXObject("Microsoft.XMLDOM");
this.xmldom = doc;
} else {
Expand Down
16 changes: 13 additions & 3 deletions lib/OpenLayers/Format/XML.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ OpenLayers.Format.XML = OpenLayers.Class(OpenLayers.Format, {
* the object.
*/
initialize: function(options) {
if(window.ActiveXObject) {
if (OpenLayers.Format.XML.supportActiveX) {
this.xmldom = new ActiveXObject("Microsoft.XMLDOM");
}
OpenLayers.Format.prototype.initialize.apply(this, [options]);
Expand Down Expand Up @@ -138,7 +138,7 @@ OpenLayers.Format.XML = OpenLayers.Class(OpenLayers.Format, {
* Since we want to be able to call this method on the prototype
* itself, this.xmldom may not exist even if in IE.
*/
if(window.ActiveXObject && !this.xmldom) {
if (OpenLayers.Format.XML.supportActiveX && !this.xmldom) {
xmldom = new ActiveXObject("Microsoft.XMLDOM");
} else {
xmldom = this.xmldom;
Expand Down Expand Up @@ -871,7 +871,7 @@ OpenLayers.Format.XML = OpenLayers.Class(OpenLayers.Format, {
if (document.implementation && document.implementation.createDocument) {
OpenLayers.Format.XML.document =
document.implementation.createDocument("", "", null);
} else if (!this.xmldom && window.ActiveXObject) {
} else if (!this.xmldom && OpenLayers.Format.XML.supportActiveX) {
this.xmldom = new ActiveXObject("Microsoft.XMLDOM");
}
}
Expand Down Expand Up @@ -916,3 +916,13 @@ OpenLayers.Format.XML.lookupNamespaceURI = OpenLayers.Function.bind(
* like document.createCDATASection.
*/
OpenLayers.Format.XML.document = null;

/**
* APIFunction: OpenLayers.Format.XML.supportActiveX
* Returns a poolean flag to check if this browser uses ActiveX.
*/
OpenLayers.Format.XML.supportActiveX = (function () {
return (Object.getOwnPropertyDescriptor &&
Object.getOwnPropertyDescriptor(window, "ActiveXObject")) ||
("ActiveXObject" in window);
})();