From bed6cfa853677283443c040d7b071f2b98169af0 Mon Sep 17 00:00:00 2001 From: Mark Salsbery <> Date: Wed, 10 Mar 2021 17:18:17 -0800 Subject: [PATCH] Removed a bit more IE<11 code --- changelog.txt | 2 +- src/imagetilesource.js | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/changelog.txt b/changelog.txt index d08aaf53..7e0a34df 100644 --- a/changelog.txt +++ b/changelog.txt @@ -34,7 +34,7 @@ OPENSEADRAGON CHANGELOG * MouseTracker: added contextMenuHandler option for handling contextmenu events (#1872 @msalsbery) * Viewer: added a canvas-contextmenu event (#1872 @msalsbery) * Added additional documentation for the zoomPerSecond viewer option (#1872 @msalsbery) -* MouseTracker: Per #1863, dropped support for Internet Explorer < 11 (#1872 @msalsbery) (#1950 @rmontroy) +* MouseTracker: Per #1863, dropped support for Internet Explorer < 11 (#1872 @msalsbery) (#1950 @rmontroy) (#1951 @msalsbery) * Fixed simulated drag events in navigator tests (#1949 @msalsbery) * Added preventDefault option to MouseTracker.contextMenuHandler and Viewer 'canvas-contextmenu' event args (#1951 @msalsbery) * MouseTracker: Added preProcessEventHandler for keydown, keyup, keypress, focus, blur Events (#1951 @msalsbery) diff --git a/src/imagetilesource.js b/src/imagetilesource.js index da1c201b..25f67988 100644 --- a/src/imagetilesource.js +++ b/src/imagetilesource.js @@ -114,9 +114,8 @@ } $.addEvent(image, 'load', function () { - /* IE8 fix since it has no naturalWidth and naturalHeight */ - _this.width = Object.prototype.hasOwnProperty.call(image, 'naturalWidth') ? image.naturalWidth : image.width; - _this.height = Object.prototype.hasOwnProperty.call(image, 'naturalHeight') ? image.naturalHeight : image.height; + _this.width = image.naturalWidth; + _this.height = image.naturalHeight; _this.aspectRatio = _this.width / _this.height; _this.dimensions = new $.Point(_this.width, _this.height); _this._tileWidth = _this.width; @@ -210,9 +209,8 @@ _buildLevels: function () { var levels = [{ url: this._image.src, - /* IE8 fix since it has no naturalWidth and naturalHeight */ - width: Object.prototype.hasOwnProperty.call(this._image, 'naturalWidth') ? this._image.naturalWidth : this._image.width, - height: Object.prototype.hasOwnProperty.call(this._image, 'naturalHeight') ? this._image.naturalHeight : this._image.height + width: this._image.naturalWidth, + height: this._image.naturalHeight }]; if (!this.buildPyramid || !$.supportsCanvas || !this.useCanvas) { @@ -221,9 +219,8 @@ return levels; } - /* IE8 fix since it has no naturalWidth and naturalHeight */ - var currentWidth = Object.prototype.hasOwnProperty.call(this._image, 'naturalWidth') ? this._image.naturalWidth : this._image.width; - var currentHeight = Object.prototype.hasOwnProperty.call(this._image, 'naturalHeight') ? this._image.naturalHeight : this._image.height; + var currentWidth = this._image.naturalWidth; + var currentHeight = this._image.naturalHeight; var bigCanvas = document.createElement("canvas");