From 3cb41c77864ef20109ad309a896d19110c9f7c69 Mon Sep 17 00:00:00 2001 From: Matthew McClure <mmcclure@brightcove.com> Date: Thu, 6 Feb 2014 17:15:01 -0800 Subject: [PATCH] Close GH-971: Quiet down deprecation warnings. --- src/js/events.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/js/events.js b/src/js/events.js index 53589f3dd..74498eb15 100644 --- a/src/js/events.js +++ b/src/js/events.js @@ -179,8 +179,13 @@ vjs.fixEvent = function(event) { // TODO: Probably best to create a whitelist of event props for (var key in old) { // Safari 6.0.3 warns you if you try to copy deprecated layerX/Y - if (key !== 'layerX' && key !== 'layerY') { - event[key] = old[key]; + // Chrome warns you if you try to copy deprecated keyboardEvent.keyLocation + if (key !== 'layerX' && key !== 'layerY' && key !== 'keyboardEvent.keyLocation') { + // Chrome 32+ warns if you try to copy deprecated returnValue, but + // we still want to if preventDefault isn't supported (IE8). + if (!(key == 'returnValue' && old.preventDefault)) { + event[key] = old[key]; + } } }