Bug 1010445 - Fix instanceof checks in CastingApps. r=mfinkle
authorNick Alexander <nalexander@mozilla.com>
Wed, 14 May 2014 15:03:04 -0700
changeset 183196 fa6489a53b497568b662035228208dcd3709dc64
parent 183195 69e3f129484a1de854a4ebd0e010823f3878048a
child 183197 49859608dbb8165cfd757269551da4d5c19a03f1
push idunknown
push userunknown
push dateunknown
reviewersmfinkle
bugs1010445
milestone32.0a1
Bug 1010445 - Fix instanceof checks in CastingApps. r=mfinkle
mobile/android/chrome/content/CastingApps.js
--- a/mobile/android/chrome/content/CastingApps.js
+++ b/mobile/android/chrome/content/CastingApps.js
@@ -102,17 +102,17 @@ var CastingApps = {
     event.initCustomEvent("media-videoCasting", false, true, JSON.stringify(aData));
     aElement.dispatchEvent(event);
   },
 
   handleVideoBindingAttached: function handleVideoBindingAttached(aTab, aEvent) {
     // Let's figure out if we have everything needed to cast a video. The binding
     // defaults to |false| so we only need to send an event if |true|.
     let video = aEvent.target;
-    if (!video instanceof HTMLVideoElement) {
+    if (!(video instanceof HTMLVideoElement)) {
       return;
     }
 
     if (SimpleServiceDiscovery.services.length == 0) {
       return;
     }
 
     if (!this.getVideo(video, 0, 0)) {
@@ -121,17 +121,17 @@ var CastingApps = {
 
     // Let the binding know casting is allowed
     this._sendEventToVideo(video, { allow: true });
   },
 
   handleVideoBindingCast: function handleVideoBindingCast(aTab, aEvent) {
     // The binding wants to start a casting session
     let video = aEvent.target;
-    if (!video instanceof HTMLVideoElement) {
+    if (!(video instanceof HTMLVideoElement)) {
       return;
     }
 
     // Close an existing session first. closeExternal has checks for an exsting
     // session and handles remote and video binding shutdown.
     this.closeExternal();
 
     // Start the new session
@@ -167,17 +167,17 @@ var CastingApps = {
       }
     } catch(e) {}
 
     // Could be null
     return video;
   },
 
   _getVideo: function(aElement) {
-    if (!aElement instanceof HTMLVideoElement) {
+    if (!(aElement instanceof HTMLVideoElement)) {
       return null;
     }
 
     // Allow websites to opt-out using the Apple airplay attribute
     // https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/AirPlayGuide/OptingInorOutofAirPlay/OptingInorOutofAirPlay.html
     if (aElement.getAttribute("x-webkit-airplay") === "deny") {
       return null;
     }