videoWidth and videoHeight should be valid when loadedmetadata fires

RESOLVED FIXED

Status

()

P2
normal
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: kinetik, Assigned: roc)

Tracking

({fixed1.9.1})

Trunk
fixed1.9.1
Points:
---
Bug Flags:
blocking1.9.1 +
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 2 obsolete attachments)

(Reporter)

Description

10 years ago
Per section 4.8.10.5.11.4, where it talks about firing the loadedmetadata, "Once enough of the media data has been fetched to determine the duration of the media resource, its dimensions, and other metadata".
(Reporter)

Comment 1

10 years ago
Created attachment 349697 [details] [diff] [review]
mochitest

This happens because nsOggDecoder updates the videoWidth and videoHeight during invalidate, which may not have happened by the time loadedmetadata fires.  In some cases, it's possible for invalidate never to occur, e.g. if the video is created outside of the document and never attached or if the element is set to display: none.
(Reporter)

Comment 2

10 years ago
Created attachment 349698 [details] [diff] [review]
mochitest

Test display: none case too.
Attachment #349697 - Attachment is obsolete: true
(Reporter)

Comment 3

10 years ago
I posted a message to the WhatWG spec list requesting clarification on this: http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2008-November/017412.html
Flags: blocking1.9.1+
Priority: -- → P2
Created attachment 357295 [details] [diff] [review]
fix

This makes the size valid when metadataloaded fires.
Assignee: nobody → roc
Attachment #357295 - Flags: review?(chris.double)
Whiteboard: [needs review]

Updated

10 years ago
Attachment #357295 - Flags: review?(chris.double) → review+
Whiteboard: [needs review] → [needs landing]
Pushed http://hg.mozilla.org/mozilla-central/rev/e6566d187edd
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [needs landing]
This seems to have caused reftest failures in ogg-video/basic-1.html' and 'ogg-video/zoomed-1.html' on the linux unittest box:
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1232599526.1232605622.2267.gz
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1232600679.1232605576.2202.gz

Backed out to fix bustage:
http://hg.mozilla.org/mozilla-central/rev/c0d1d49217cc
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Created attachment 358992 [details] [diff] [review]
updated patch

The frame was not being reflowed after the video intrinsic size became known, because we were just calling UpdateMediaSize and then setting mSizeChanged to false, but we need to do what Invalidate does and also mark the frame as needing reflow. So in this version of the patch I just call Invalidate to do all those things.
Attachment #357295 - Attachment is obsolete: true
Whiteboard: [needs landing]
Pushed http://hg.mozilla.org/mozilla-central/rev/4bc1bd14f5a0
Status: REOPENED → RESOLVED
Last Resolved: 10 years ago10 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing] → [needs 191 landing]
You need to log in before you can comment on or make changes to this bug.