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.
object-fit:cover is supposed to spill outside the box when overflow:visible. No?
So says the spec (not that I agree with it). But with overflow:hidden we'll have to fix this anyway.
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.
...though maybe that ship has sailed for SVG content anyway.
I think authors would not expect overflow for elements like <img> and <video>.
We could add overflow:hidden to the UA style sheet for those elements, maybe?
(spec bug http://www.w3.org/Bugs/Public/show_bug.cgi?id=11746 )
Created attachment 210173 [details] Patch
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.
Created attachment 210175 [details] Patch
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.
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 :(
https://trac.webkit.org/r154921