Issue metadata
Sign in to add a comment
|
CSS-tag “object-fit:cover” does not crop/clip videos in Chrome
Reported by
batoma...@googlemail.com,
Apr 17 2016
|
||||||||||||||||||||||||
Issue descriptionChrome Version : 50.0.2661.75 (Offizieller Build) (64-Bit) URLs (if applicable) : https://jsfiddle.net/xt0xcxzu/5/ Other browsers tested: Firefox 45.0.2, Safari 9.1, both on Mac Add OK or FAIL, along with the version, after other browsers where you have tested this issue: Safari: OK (Mac: Safari 9.1) Firefox: OK (Mac: Firefox 45.0.2) IE: (not tested) What steps will reproduce the problem? CSS-tag "object-fit:cover" does not clip/crop videos in Chrome as expected. I have created a demo that shows the wrong behavior: https://jsfiddle.net/xt0xcxzu/5/ You see the effect when you change the browser window size. With large height and small width (as well as with small height and large width) the videos start to overlap which is wrong. The images don't overlap and are therefore correct. What is the expected result? The behavior should be as shown in this image (top right): https://www.w3.org/TR/2011/WD-css3-images-20110217/img_scale.png => Videos should be cropped. This happens only for videos and only in Chrome. Images are OK in Chrome. In all other tested browsers, images and videos are both working fine. What happens instead? Videos overlap the surrounding div. Please provide any additional information below. Attach a screenshot if possible Screenshot attached. Code from the demo: HTML: <div class="main"> <div class="container" style="top:0; left:0"> <video autoplay loop> <source src="http://www.w3schools.com/html/movie.mp4" type="video/mp4"> </video> </div> <div class="container" style="top:0%; left:50%"> <video autoplay loop> <source src="http://www.w3schools.com/html/movie.mp4" type="video/mp4"> </video> </div> <div class="container" style="top:25%; left:0;"> <video autoplay loop> <source src="http://www.w3schools.com/html/movie.mp4" type="video/mp4"> </video> </div> <div class="container" style="top:25%; left:50%"> <video autoplay loop> <source src="http://www.w3schools.com/html/movie.mp4" type="video/mp4"> </video> </div> <div class="container" style="top:50%; left:0"> <img src="https://upload.wikimedia.org/wikipedia/commons/c/c4/PM5544_with_non-PAL_signals.png"/> </div> <div class="container" style="top:50%; left:50%"> <img src="https://upload.wikimedia.org/wikipedia/commons/c/c4/PM5544_with_non-PAL_signals.png"/> </div> <div class="container" style="top:75%; left:0"> <img src="https://upload.wikimedia.org/wikipedia/commons/c/c4/PM5544_with_non-PAL_signals.png"/> </div> <div class="container" style="top:75%; left:50%"> <img src="https://upload.wikimedia.org/wikipedia/commons/c/c4/PM5544_with_non-PAL_signals.png"/> </div> </div> CSS: html, body{ margin:0; padding:0; height:100%; width:100%; overflow:hidden; } .main{ position:relative; width: 100%; height: 100%; } .container{ position:absolute; width:50%; height:25%; } img, video{ position: relative; object-fit:cover; overflow:hidden; width:100%; height:100%; }
,
Apr 18 2016
yup, confirmed.
,
Apr 19 2016
,
Apr 19 2016
This also affects webRTC.
,
Apr 19 2016
Created this bug in parallel here: https://bugs.chromium.org/p/webrtc/issues/detail?id=5807
,
Apr 26 2016
,
Jun 1 2016
Moving this nonessential bug to the next milestone. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 13 2016
This issue has been moved once and is lower than Pri-1. Removing the milestone. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 19 2016
Doesn't seem to be an issue with the video element, rather the CSS issue.
,
Jul 19 2016
This isn't CSS, I'm redirecting to Layout.
,
Jul 22 2016
Works fine for all non-video content, including images as demonstrated in the test case. Back to media team.
,
Jul 25 2016
Emil, any guesses on why the video element would be different from the layout point of view?
,
Aug 2 2016
Issue 633375 has been merged into this issue.
,
Aug 2 2016
Just found another version of this bug: bug 400829 .
,
Aug 2 2016
|
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by msrchandra@chromium.org
, Apr 18 2016Components: Blink
Labels: M-52
Status: Untriaged (was: Unconfirmed)