Open Bug 625088 Opened 12 years ago Updated 6 months ago

Including javascript file causes problems with firefox4 video tag controls


(Firefox :: General, defect)

4.0 Branch





(Reporter: benderamp, Unassigned)


User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:2.0b8) Gecko/20101214 Firefox/4.0b8
Build Identifier: Mozilla/5.0 (X11; Linux x86_64; rv:2.0b8) Gecko/20101214 Firefox/4.0b8


I am using rightjs ( js library on my page which also contains <video> tag and came across rather strange issue. If I include right.js script on the page with <video> tag, the built-in player does not show playback controls. 

The simplest case - taken from : 
<script src=""></script> 
 <video id="video"  width="640" height="360" controls="controls"> 
 <source src=" 
 FF3.6_Screencast_FINAL.ogv" type="video/ogg; codecs=&quot;theora, 
 vorbis&quot;" /> 
Just paste this to test.html and open locally with firefox latest beta 
 (I have 4.0b8 from opensuse repo). Video playback controls will not 
 show up and error console would show error related somewhere to xul 
If remove the 1st script include line or even just change "right.js" 
 to "right-1.js", so the script file will not load, the video controls 
 would show up. 

Reproducible: Always

Steps to Reproduce:
1. Include js file on the page ""
2. Add video tag with enabled controls
Actual Results:  
Video playback controls will not show up.

Expected Results:  
Video playback controls should show up.

Error console shows some messages from xul engine.
Error: document.getAnonymousElementByAttribute is not a function
Source File: chrome://global/content/bindings/videocontrols.xml
Line: 892


Error: element is null
Source File: chrome://global/content/bindings/videocontrols.xml
Line: 706

Remove the rightjs.js node and all works well. I am thinking that the rightjs.js file replaces some dom methods or changes what they return. 

This does not seem to be a bug in Firefox, but a bug in rightjs.
Okay, I've boiled it down, the problem is in Firefox not in RightJS :)

A simple script like that does the trick.

var Element = function() {};
Element.prototype.document = 'something';
And just in case. RightJS uses dom-wrappers and doesn't extend any dom methods/prototypes.
Version: unspecified → 4.0 Branch
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.