Closed
Bug 479936
Opened 15 years ago
Closed 15 years ago
video with width= or height= does not scale container (although it scales the video itself)
Categories
(Core :: Audio/Video, defect, P2)
Tracking
()
RESOLVED
FIXED
People
(Reporter: blizzard, Assigned: roc)
Details
(Keywords: fixed1.9.1)
Attachments
(3 files, 1 obsolete file)
160 bytes,
text/html
|
Details | |
92.96 KB,
image/jpeg
|
Details | |
5.93 KB,
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
This is easy to reproduce. Do something like: <video src="http://people.mozilla.org/~blizzard/screencasts/screencast-video-2009-02-23.ogv" width="300" controls="true"> in your HTML. Note that it will scale the video down from its original size but the height and width of the box that contains the video will be the full height of the video. Seems like some maths are missing somewhere.
Flags: blocking1.9.1?
Assignee | ||
Updated•15 years ago
|
Flags: blocking1.9.1? → blocking1.9.1+
Priority: -- → P2
Assignee | ||
Updated•15 years ago
|
Assignee: nobody → roc
Assignee | ||
Comment 1•15 years ago
|
||
I don't see this bug on trunk as you describe it. I think this testcase covers what you're describing. It seems to work fine; the green border-box is the intrinsic height of the video and 300px wide.
Reporter | ||
Comment 2•15 years ago
|
||
I caught it on both the 1.9.1 branch and trunk - screenshot attached. I was able to reproduce on trunk by clearing the cache and reloading. It doesn't happen every time but it does happen. (And when I was using it on my blog it _did_ happen every time which is why I noticed it.)
Reporter | ||
Comment 3•15 years ago
|
||
Adding bz + dbaron for some reflow/resizing love.
Comment 4•15 years ago
|
||
So nsVideoFrame::GetIntrinsicSize uses the video size but overrides the width or height based on the attributes set, if any. This gives the behavior roc describes in comment 1 and shown in the screenshots in comment 2. Neither matches the description in comment 0; in particular the width used is the one specified by the attribute, not the height of the video as comment 0 says. The HTML5 spec doesn't actually say what the width and height attributes on <video> do, so I have no idea what the right behavior here is. The current behavior _does_ seem a bit odd to me. If we want them to act more like equivalent attributes on <img>, then we need to map the width and height attributes into style and not have them affect the intrinsic size. But again, that's a spec question.
Comment 5•15 years ago
|
||
Ah, sorry. The spec has this "The video element supports dimension attributes." thing very well hidden in the text. Of course the spec doesn't define what those do.
Reporter | ||
Comment 6•15 years ago
|
||
Hmm, interesting. The principal-of-least-surprise would expect it to do exactly what an <img> does when you specify only a width or only a height. It's the easy way to fit-to-width for a lot of pages. Who are the right spec people? (I can't imagine that anyone would want anything else, frankly.)
Comment 7•15 years ago
|
||
I've posted to public-html and whatwg requesting clarification, but it seems to me that the intent of the spec is in fact that these attributes behave on <video> as they do on <img>.
Comment 8•15 years ago
|
||
And to be more precise, it just happens to not define what they do on <img> either.
Comment 9•15 years ago
|
||
An extra fun question. Should hspace/vspace/border be supported on <video>? They're not in the HTML5 spec at all, for anything... I'd guess "no".
Comment 10•15 years ago
|
||
This still needs tests; I'd appreciate it if someone more familiar with when it's ok to take a snapshot would put those together...
Attachment #364144 -
Flags: superreview?(roc)
Attachment #364144 -
Flags: review?(roc)
Assignee | ||
Updated•15 years ago
|
Attachment #364144 -
Flags: superreview?(roc)
Attachment #364144 -
Flags: superreview+
Attachment #364144 -
Flags: review?(roc)
Attachment #364144 -
Flags: review-
Assignee | ||
Comment 11•15 years ago
|
||
Comment on attachment 364144 [details] [diff] [review] Like so, perhaps oops
Attachment #364144 -
Flags: review- → review+
Assignee | ||
Comment 12•15 years ago
|
||
Attachment #364144 -
Attachment is obsolete: true
Attachment #364164 -
Flags: superreview+
Attachment #364164 -
Flags: review+
Assignee | ||
Updated•15 years ago
|
Whiteboard: [needs landing]
Comment 13•15 years ago
|
||
Pushed 98f8aef2dce4.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing] → [needs 191 landing]
Assignee | ||
Updated•15 years ago
|
Flags: in-testsuite+
Assignee | ||
Comment 14•15 years ago
|
||
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/11e11905e4ba
Keywords: fixed1.9.1
Whiteboard: [needs 191 landing]
You need to log in
before you can comment on or make changes to this bug.
Description
•