Closed Bug 938772 Opened 11 years ago Closed 11 years ago

empty <video> tag attempts to load href of <base> tag

Categories

(Core :: Audio/Video, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: jon, Assigned: roc)

References

Details

(Whiteboard: [qa-])

Attachments

(2 files)

If you have a page with a <base> tag and an empty <video> tag, Firefox will attempt to load the href of the <base> tag into the <video> src.

Chrome 31 and Safari 7 do not attempt to load the <base> tag value in the video element.
Blocks: 938648
roc: any ideas what's up here?
Flags: needinfo?(roc)
Not off the top of my head.
Flags: needinfo?(roc)
Perhaps HTMLMediaElement::MediaLoadListener listens to too much stuff and picks up something related to the BASE tag?
FWIW, "attempts to load" seems to be somewhat incorrect - I made a test case with a BASE href pointing to a video file, it doesn't get loaded into the <video> element and the error event still fires. So I assume <video> doesn't *actually* try to load the referenced URL, it just gets some logic wrong in the "was something loading/loaded" department?
Attachment #832444 - Attachment mime type: text/plain → text/html
What's happening here is that the video element contains an anonymous <img> element to show the poster image. There is no poster attribute in this case, of course, but we set the poster 'src' attribute to the empty string anyway. The poster <img> then tries to resolve the empty string against the base URI (against the HTML5 spec), and tries to load that. In the attached testcase the load fails and the resulting error event is fired against the video element for some reason. If you change the base href to a valid image URL, the image will actually load as the poster.
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #5)
> In the attached testcase the load fails and the resulting error event is fired
> against the video element for some reason.

That part is bug 516811.
Attached patch fixSplinter Review
Assignee: nobody → roc
Attachment #8340891 - Flags: review?(cpearce)
Comment on attachment 8340891 [details] [diff] [review]
fix

Review of attachment 8340891 [details] [diff] [review]:
-----------------------------------------------------------------

::: layout/generic/test/mochitest.ini
@@ +78,5 @@
>  [test_bug791616.html]
>  [test_bug831780.html]
>  [test_bug841361.html]
>  [test_bug904810.html]
> +[test_bug938772.html]

You forgot to add the test file to the patch. I'll assume it's sensible. ;)
Attachment #8340891 - Flags: review?(cpearce) → review+
(In reply to Chris Pearce (:cpearce) from comment #8)
> You forgot to add the test file to the patch. I'll assume it's sensible. ;)

Nah, it's actually there :-)
Oh wait, no it's not. It's in my patch locally though. Sorry.
Hi,

sorry had to backout this changes in https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=9b8364f50488 for test failures in mochitest 5 on windows like https://tbpl.mozilla.org/php/getParsedLog.php?id=31430804&tree=Mozilla-Inbound (timeout) and also on Android like https://tbpl.mozilla.org/php/getParsedLog.php?id=31430347&tree=Mozilla-Inbound - ERROR TEST-UNEXPECTED-FAIL | /tests/layout/xul/test/test_bug511075.html | function () {
It's possible for the iframe load event to fire before the script adds the load event handler (though I would have expected that to be rare). Here's a try push with that fixed:
https://tbpl.mozilla.org/?tree=Try&rev=d8b522213de5
That try push seems to have worked.
hey roc, sorry had to back this out again, seems it was causing https://tbpl.mozilla.org/php/getParsedLog.php?id=31560952&tree=Mozilla-Inbound on windows 7 and xp debug builds, opt was fine
Somehow I managed to check in the wrong patch :-(.
https://hg.mozilla.org/mozilla-central/rev/6aca1511c1bb
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: