Bug 52103

Summary: Video with object-fit: cover can spill outside the box
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Layout and RenderingAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, divya, eric.carlson, esprehn+autocc, glenn, jer.noble, kondapallykalyan, simon.fraser, zcorpan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
Patch
none
Patch dino: review+

Simon Fraser (smfr)
Reported 2011-01-07 22:07:07 PST
Follow-on from bug 52040 : With object-fit: cover, <video> may spill outside the box, and we don't have a layer we can set masksToBounds on to clip it.
Attachments
Patch (54.99 KB, patch)
2013-08-30 16:20 PDT, Simon Fraser (smfr)
no flags
Patch (57.06 KB, patch)
2013-08-30 16:35 PDT, Simon Fraser (smfr)
dino: review+
Simon Pieters (:zcorpan)
Comment 1 2011-01-12 10:22:48 PST
object-fit:cover is supposed to spill outside the box when overflow:visible. No?
Simon Fraser (smfr)
Comment 2 2011-01-12 10:39:32 PST
So says the spec (not that I agree with it). But with overflow:hidden we'll have to fix this anyway.
Simon Pieters (:zcorpan)
Comment 3 2011-01-12 11:08:07 PST
We have the opposite problem in Opera, <video> is always clipped. However we could always change the spec to say that the content is always clipped regardless of 'overflow' if people think overflowing is useless/annoying.
Simon Pieters (:zcorpan)
Comment 4 2011-01-12 11:55:16 PST
...though maybe that ship has sailed for SVG content anyway.
Simon Fraser (smfr)
Comment 5 2011-01-12 12:36:06 PST
I think authors would not expect overflow for elements like <img> and <video>.
Simon Pieters (:zcorpan)
Comment 6 2011-01-13 00:08:15 PST
We could add overflow:hidden to the UA style sheet for those elements, maybe?
Simon Pieters (:zcorpan)
Comment 7 2011-01-13 06:42:12 PST
Simon Fraser (smfr)
Comment 8 2013-08-30 16:20:43 PDT
WebKit Commit Bot
Comment 9 2013-08-30 16:22:37 PDT
Attachment 210173 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/compositing/images/direct-image-object-fit-expected.txt', u'LayoutTests/compositing/images/direct-image-object-fit.html', u'LayoutTests/compositing/reflections/direct-image-object-fit-reflected-expected.txt', u'LayoutTests/compositing/reflections/direct-image-object-fit-reflected.html', u'LayoutTests/compositing/video/video-object-fit-expected.txt', u'LayoutTests/compositing/video/video-object-fit.html', u'LayoutTests/platform/mac/compositing/images/direct-image-object-fit-expected.txt', u'LayoutTests/platform/mac/compositing/reflections/direct-image-object-fit-reflected-expected.txt', u'LayoutTests/platform/mac/compositing/video/video-object-fit-expected.txt', u'Source/WebCore/ChangeLog', u'Source/WebCore/page/Frame.h', u'Source/WebCore/platform/graphics/GraphicsLayer.h', u'Source/WebCore/platform/graphics/MediaPlayer.cpp', u'Source/WebCore/platform/graphics/MediaPlayer.h', u'Source/WebCore/platform/graphics/MediaPlayerPrivate.h', u'Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp', u'Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h', u'Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp', u'Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h', u'Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h', u'Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm', u'Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp', u'Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h', u'Source/WebCore/rendering/RenderLayerBacking.cpp', u'Source/WebCore/rendering/RenderLayerCompositor.cpp', u'Source/WebCore/rendering/RenderVideo.cpp', u'Source/WebCore/testing/Internals.cpp', u'Source/WebCore/testing/Internals.h', u'Source/WebCore/testing/Internals.idl']" exit_code: 1 Source/WebCore/testing/Internals.h:228: enum members should use InterCaps with an initial capital letter. [readability/enum_casing] [4] Source/WebCore/testing/Internals.h:229: enum members should use InterCaps with an initial capital letter. [readability/enum_casing] [4] Total errors found: 2 in 30 files If any of these errors are false positives, please file a bug against check-webkit-style.
Simon Fraser (smfr)
Comment 10 2013-08-30 16:35:51 PDT
WebKit Commit Bot
Comment 11 2013-08-30 16:43:35 PDT
Attachment 210175 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/compositing/images/direct-image-object-fit-expected.txt', u'LayoutTests/compositing/images/direct-image-object-fit.html', u'LayoutTests/compositing/reflections/direct-image-object-fit-reflected-expected.txt', u'LayoutTests/compositing/reflections/direct-image-object-fit-reflected.html', u'LayoutTests/compositing/video/video-object-fit-expected.txt', u'LayoutTests/compositing/video/video-object-fit.html', u'LayoutTests/media/video-object-fit-change.html', u'LayoutTests/platform/mac/TestExpectations', u'LayoutTests/platform/mac/compositing/images/direct-image-object-fit-expected.txt', u'LayoutTests/platform/mac/compositing/reflections/direct-image-object-fit-reflected-expected.txt', u'LayoutTests/platform/mac/compositing/video/video-object-fit-expected.txt', u'Source/WebCore/ChangeLog', u'Source/WebCore/page/Frame.h', u'Source/WebCore/platform/graphics/GraphicsLayer.h', u'Source/WebCore/platform/graphics/MediaPlayer.cpp', u'Source/WebCore/platform/graphics/MediaPlayer.h', u'Source/WebCore/platform/graphics/MediaPlayerPrivate.h', u'Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp', u'Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h', u'Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp', u'Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h', u'Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h', u'Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm', u'Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp', u'Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h', u'Source/WebCore/rendering/RenderLayerBacking.cpp', u'Source/WebCore/rendering/RenderLayerCompositor.cpp', u'Source/WebCore/rendering/RenderVideo.cpp', u'Source/WebCore/testing/Internals.cpp', u'Source/WebCore/testing/Internals.h', u'Source/WebCore/testing/Internals.idl']" exit_code: 1 Source/WebCore/testing/Internals.h:228: enum members should use InterCaps with an initial capital letter. [readability/enum_casing] [4] Source/WebCore/testing/Internals.h:229: enum members should use InterCaps with an initial capital letter. [readability/enum_casing] [4] Total errors found: 2 in 31 files If any of these errors are false positives, please file a bug against check-webkit-style.
Dean Jackson
Comment 12 2013-08-30 16:46:28 PDT
Comment on attachment 210175 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=210175&action=review > Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:1797 > + bool needContentsClippingLayer = !m_contentsClippingRect.contains(m_contentsRect); > + bool gainedOrLostClippingLayer = false; > + if (needContentsClippingLayer) { You don't need needContentsClippingLayer. > LayoutTests/compositing/video/video-object-fit.html:52 > + }, 1500); 1.5s :(
Simon Fraser (smfr)
Comment 13 2013-08-30 17:13:56 PDT
Note You need to log in before you can comment on or make changes to this bug.