diff --git a/core/display.js b/core/display.js index 6b036ff5..07997cba 100644 --- a/core/display.js +++ b/core/display.js @@ -10,7 +10,6 @@ /*jslint browser: true, white: false */ /*global Util, Base64, changeCursor */ -import { browserSupportsCursorURIs as cursorURIsSupported } from './util/browsers.js'; import { set_defaults, make_properties } from './util/properties.js'; import * as Log from './util/logging.js'; import Base64 from "./base64.js"; @@ -77,12 +76,6 @@ export default function Display(target, defaults) { throw new Error("Canvas does not support createImageData"); } - // Determine browser support for setting the cursor via data URI scheme - if (this._cursor_uri || this._cursor_uri === null || - this._cursor_uri === undefined) { - this._cursor_uri = cursorURIsSupported(); - } - Log.Debug("<< Display.constructor"); }; @@ -483,11 +476,6 @@ Display.prototype = { }, changeCursor: function (pixels, mask, hotx, hoty, w, h) { - if (this._cursor_uri === false) { - Log.Warn("changeCursor called but no cursor data URI support"); - return; - } - Display.changeCursor(this._target, pixels, mask, hotx, hoty, w, h); }, @@ -681,8 +669,6 @@ make_properties(Display, [ ['width', 'ro', 'int'], // Display area width ['height', 'ro', 'int'], // Display area height - ['cursor_uri', 'rw', 'raw'], // Can we render cursor using data URI - ['onFlush', 'rw', 'func'], // onFlush(): A flush request has finished ]); diff --git a/core/rfb.js b/core/rfb.js index 59f0c4cd..55a9650f 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -14,6 +14,7 @@ import * as Log from './util/logging.js'; import _ from './util/localization.js'; import { decodeUTF8 } from './util/strings.js'; import { set_defaults, make_properties } from './util/properties.js'; +import { browserSupportsCursorURIs } from './util/browsers.js'; import Display from "./display.js"; import Keyboard from "./input/keyboard.js"; import Mouse from "./input/mouse.js"; @@ -1470,7 +1471,7 @@ RFB.prototype.set_local_cursor = function (cursor) { this._local_cursor = false; this._display.disableLocalCursor(); //Only show server-side cursor } else { - if (this._display.get_cursor_uri()) { + if (browserSupportsCursorURIs()) { this._local_cursor = true; } else { Log.Warn("Browser does not support local cursor"); diff --git a/core/util/browsers.js b/core/util/browsers.js index 77fca12f..50f59863 100644 --- a/core/util/browsers.js +++ b/core/util/browsers.js @@ -43,11 +43,3 @@ export function browserSupportsCursorURIs () { return _cursor_uris_supported; }; - -export function _forceCursorURIs(enabled) { - if (enabled === undefined || enabled) { - _cursor_uris_supported = true; - } else { - _cursor_uris_supported = false; - } -} diff --git a/docs/API-internal.md b/docs/API-internal.md index e33f8069..b9f3be8c 100644 --- a/docs/API-internal.md +++ b/docs/API-internal.md @@ -97,7 +97,6 @@ None | viewport | bool | RW | false | Use viewport clipping | width | int | RO | | Display area width | height | int | RO | | Display area height -| cursor_uri | raw | RW | | Can we render cursor using data URI ### 2.3.2 Methods diff --git a/tests/test.display.js b/tests/test.display.js index 3a8c13d1..32d054e3 100644 --- a/tests/test.display.js +++ b/tests/test.display.js @@ -3,7 +3,6 @@ var expect = chai.expect; import Base64 from '../core/base64.js'; import Display from '../core/display.js'; -import { _forceCursorURIs, browserSupportsCursorURIs } from '../core/util/browsers.js'; import sinon from '../vendor/sinon.js'; @@ -37,26 +36,6 @@ describe('Display/Canvas Helper', function () { return Base64.decode(data); } - describe('checking for cursor uri support', function () { - it('should disable cursor URIs if there is no support', function () { - _forceCursorURIs(false); - var display = new Display(document.createElement('canvas'), { viewport: false }); - expect(display._cursor_uri).to.be.false; - }); - - it('should enable cursor URIs if there is support', function () { - _forceCursorURIs(true); - var display = new Display(document.createElement('canvas'), { viewport: false }); - expect(display._cursor_uri).to.be.true; - }); - - it('respect the cursor_uri option if there is support', function () { - _forceCursorURIs(false); - var display = new Display(document.createElement('canvas'), { viewport: false, cursor_uri: false }); - expect(display._cursor_uri).to.be.false; - }); - }); - describe('viewport handling', function () { var display; beforeEach(function () {