- Revision
- 217496
- Author
- [email protected]
- Date
- 2017-05-26 10:18:50 -0700 (Fri, 26 May 2017)
Log Message
Media documents inside iframes should not get controls in the TouchBar unless the
video is playing
https://bugs.webkit.org/show_bug.cgi?id=172620
-and corresponding-
rdar://problem/32165477
Reviewed by Jon Lee.
Source/WebCore:
Media documents get to return early with true, but that should only apply to
mainframe media documents.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager):
Tools:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/offscreen-iframe-of-media-document.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (217495 => 217496)
--- trunk/Source/WebCore/ChangeLog 2017-05-26 17:12:25 UTC (rev 217495)
+++ trunk/Source/WebCore/ChangeLog 2017-05-26 17:18:50 UTC (rev 217496)
@@ -1,3 +1,18 @@
+2017-05-26 Beth Dakin <[email protected]>
+
+ Media documents inside iframes should not get controls in the TouchBar unless the
+ video is playing
+ https://bugs.webkit.org/show_bug.cgi?id=172620
+ -and corresponding-
+ rdar://problem/32165477
+
+ Reviewed by Jon Lee.
+
+ Media documents get to return early with true, but that should only apply to
+ mainframe media documents.
+ * html/MediaElementSession.cpp:
+ (WebCore::MediaElementSession::canShowControlsManager):
+
2017-05-26 Youenn Fablet <[email protected]>
Minor clean-up related to DocumentThreadableLoader redirections
Modified: trunk/Source/WebCore/html/MediaElementSession.cpp (217495 => 217496)
--- trunk/Source/WebCore/html/MediaElementSession.cpp 2017-05-26 17:12:25 UTC (rev 217495)
+++ trunk/Source/WebCore/html/MediaElementSession.cpp 2017-05-26 17:18:50 UTC (rev 217496)
@@ -275,7 +275,7 @@
return false;
}
- if (m_element.document().isMediaDocument()) {
+ if (m_element.document().isMediaDocument() && (m_element.document().frame() && m_element.document().frame()->isMainFrame())) {
LOG(Media, "MediaElementSession::canShowControlsManager - returning TRUE: Is media document");
return true;
}
Modified: trunk/Tools/ChangeLog (217495 => 217496)
--- trunk/Tools/ChangeLog 2017-05-26 17:12:25 UTC (rev 217495)
+++ trunk/Tools/ChangeLog 2017-05-26 17:18:50 UTC (rev 217496)
@@ -1,3 +1,18 @@
+2017-05-26 Beth Dakin <[email protected]>
+
+ Media documents inside iframes should not get controls in the TouchBar unless the
+ video is playing
+ https://bugs.webkit.org/show_bug.cgi?id=172620
+ -and corresponding-
+ rdar://problem/32165477
+
+ Reviewed by Jon Lee.
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm:
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WebKit2Cocoa/offscreen-iframe-of-media-document.html: Added.
+
2017-05-25 Joseph Pecoraro <[email protected]>
_WKUserStyleSheet and WKUserScript leak string data
Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (217495 => 217496)
--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj 2017-05-26 17:12:25 UTC (rev 217495)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj 2017-05-26 17:18:50 UTC (rev 217496)
@@ -491,6 +491,7 @@
93AF4ECE1506F064007FD57E /* NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93AF4ECD1506F064007FD57E /* NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp */; };
93AF4ED11506F130007FD57E /* lots-of-images.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 93AF4ECF1506F123007FD57E /* lots-of-images.html */; };
93CFA8671CEB9E38000565A8 /* autofocused-text-input.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 93CFA8661CEB9DE1000565A8 /* autofocused-text-input.html */; };
+ 93E2D2761ED7D53200FA76F6 /* offscreen-iframe-of-media-document.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 93E2D2751ED7D51700FA76F6 /* offscreen-iframe-of-media-document.html */; };
93F1DB3414DA20870024C362 /* NewFirstVisuallyNonEmptyLayout_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F1DB3314DA20870024C362 /* NewFirstVisuallyNonEmptyLayout_Bundle.cpp */; };
93F1DB5714DB1B840024C362 /* NewFirstVisuallyNonEmptyLayoutFails_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F1DB5614DB1B840024C362 /* NewFirstVisuallyNonEmptyLayoutFails_Bundle.cpp */; };
93F56DA71E5F9174003EDE84 /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 7C83E0331D0A5F2700FEBCF3 /* libicucore.dylib */; };
@@ -617,8 +618,6 @@
F4451C761EB8FD890020C5DA /* two-paragraph-contenteditable.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4451C751EB8FD7C0020C5DA /* two-paragraph-contenteditable.html */; };
F4538EF71E8473E600B5C953 /* large-red-square.png in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4538EF01E846B4100B5C953 /* large-red-square.png */; };
F47728991E4AE3C1007ABF6A /* full-page-contenteditable.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F47728981E4AE3AD007ABF6A /* full-page-contenteditable.html */; };
- F47D30EC1ED28631000482E1 /* apple.gif in Copy Resources */ = {isa = PBXBuildFile; fileRef = F47D30EB1ED28619000482E1 /* apple.gif */; };
- F47D30EE1ED28E7D000482E1 /* gif-and-file-input.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F47D30ED1ED28A6C000482E1 /* gif-and-file-input.html */; };
F4856CA31E649EA8009D7EE7 /* attachment-element.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4856CA21E6498A8009D7EE7 /* attachment-element.html */; };
F4BFA68E1E4AD08000154298 /* DragAndDropPasteboardTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4BFA68C1E4AD08000154298 /* DragAndDropPasteboardTests.mm */; };
F4C2AB221DD6D95E00E06D5B /* enormous-video-with-sound.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4C2AB211DD6D94100E06D5B /* enormous-video-with-sound.html */; };
@@ -700,6 +699,7 @@
dstPath = TestWebKitAPI.resources;
dstSubfolderSpec = 7;
files = (
+ 93E2D2761ED7D53200FA76F6 /* offscreen-iframe-of-media-document.html in Copy Resources */,
CDA3159A1ED548F1009F60D3 /* MediaPlaybackSleepAssertion.html in Copy Resources */,
C9B1043E1ECF9848000520FA /* autoplay-inherits-gesture-from-document.html in Copy Resources */,
3FCC4FE81EC4E8CA0076E37C /* PictureInPictureDelegate.html in Copy Resources */,
@@ -1307,6 +1307,7 @@
93CFA8681CEBCFED000565A8 /* CandidateTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CandidateTests.mm; sourceTree = "<group>"; };
93D3D19B17B1A7B000C7C415 /* all-content-in-one-iframe.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "all-content-in-one-iframe.html"; sourceTree = "<group>"; };
93D3D19D17B1A84200C7C415 /* LayoutMilestonesWithAllContentInFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutMilestonesWithAllContentInFrame.cpp; sourceTree = "<group>"; };
+ 93E2D2751ED7D51700FA76F6 /* offscreen-iframe-of-media-document.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "offscreen-iframe-of-media-document.html"; sourceTree = "<group>"; };
93E943F11CD3E87E00AC08C2 /* VideoControlsManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = VideoControlsManager.mm; sourceTree = "<group>"; };
93F1DB3014DA20760024C362 /* NewFirstVisuallyNonEmptyLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewFirstVisuallyNonEmptyLayout.cpp; sourceTree = "<group>"; };
93F1DB3314DA20870024C362 /* NewFirstVisuallyNonEmptyLayout_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewFirstVisuallyNonEmptyLayout_Bundle.cpp; sourceTree = "<group>"; };
@@ -1995,6 +1996,7 @@
46C519E31D35629600DAA51A /* LocalStorageNullEntries.localstorage */,
46C519E41D35629600DAA51A /* LocalStorageNullEntries.localstorage-shm */,
7A6A2C711DCCFB0200C0D085 /* LocalStorageQuirkEnabled.html */,
+ 93E2D2751ED7D51700FA76F6 /* offscreen-iframe-of-media-document.html */,
7CCB99221D3B44E7003922F6 /* open-multiple-external-url.html */,
CEBCA1341E3A803400C73293 /* page-with-csp-iframe.html */,
CEBCA1351E3A803400C73293 /* page-with-csp.html */,
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm (217495 => 217496)
--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm 2017-05-26 17:12:25 UTC (rev 217495)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm 2017-05-26 17:18:50 UTC (rev 217496)
@@ -413,6 +413,15 @@
// We expect the media controller to be present because this is a media document.
EXPECT_TRUE([webView _hasActiveVideoForControlsManager]);
}
+
+TEST(VideoControlsManager, VideoControlsManagerOffscreenIframeMediaDocument)
+{
+ RetainPtr<VideoControlsManagerTestWebView*> webView = setUpWebViewForTestingVideoControlsManager(NSMakeRect(0, 0, 800, 600));
+ [webView loadTestPageNamed:@"offscreen-iframe-of-media-document"];
+
+ // We do not expect a controls manager becuase the media document is in an iframe.
+ [webView expectControlsManager:NO afterReceivingMessage:@"loaded"];
+}
TEST(VideoControlsManager, VideoControlsManagerLongSkinnyVideoInWideMainFrame)
{
Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/offscreen-iframe-of-media-document.html (0 => 217496)
--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/offscreen-iframe-of-media-document.html (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/offscreen-iframe-of-media-document.html 2017-05-26 17:18:50 UTC (rev 217496)
@@ -0,0 +1,17 @@
+<html>
+<head>
+<script>
+ function loaded() {
+ try {
+ window.webkit.messageHandlers.testHandler.postMessage("loaded");
+ } catch(e) { }
+ }
+</script>
+</head>
+<body _onload_="loaded()">
+
+<div style="width:25px; height:800px;"></div>
+<iframe width="320" height="240" src="" />
+
+</body>
+</html>