WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-168049-20170209172455.patch (text/plain), 7.20 KB, created by
Antoine Quint
on 2017-02-09 08:27:22 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Antoine Quint
Created:
2017-02-09 08:27:22 PST
Size:
7.20 KB
patch
obsolete
>Subversion Revision: 211955 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 17077b1161f188c7e7d840cdf5a4ca8e18b771d6..8d77635169f0689b6c37c8905e119c95eefe68c3 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,5 +1,24 @@ > 2017-02-09 Antoine Quint <graouts@apple.com> > >+ [Modern Media Controls] Tapping the skip back button on iOS inline media controls make the controls disappear >+ https://bugs.webkit.org/show_bug.cgi?id=168049 >+ <rdar://problem/30442660> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Calling elementAtPoint() on the Document will not return an element in the ShadowRoot, >+ we need to call it on the ShadowRoot. So we now iterate over ancestors of the controls >+ bar to find the ShadowRoot, if any, and check whether the tapped element is contained >+ within the controls bar. We only fade the controls bar out if the tapped element is >+ outside of the controls bar hierarchy. >+ >+ Test: media/modern-media-controls/media-controller/media-controller-ios-do-not-hide-controls-when-tapping-button.html >+ >+ * Modules/modern-media-controls/controls/controls-bar.js: >+ (ControlsBar.prototype.gestureRecognizerStateDidChange): >+ >+2017-02-09 Antoine Quint <graouts@apple.com> >+ > [Modern Media Controls] Playing an <audio> element on iOS makes the controls disappear > https://bugs.webkit.org/show_bug.cgi?id=168047 > <rdar://problem/30441939> >diff --git a/Source/WebCore/Modules/modern-media-controls/controls/controls-bar.js b/Source/WebCore/Modules/modern-media-controls/controls/controls-bar.js >index a9cc5355f962591658ea5b75ae9076b3c11ce128..2a89959421d20a3b74dff883d9254d9fe5731578 100644 >--- a/Source/WebCore/Modules/modern-media-controls/controls/controls-bar.js >+++ b/Source/WebCore/Modules/modern-media-controls/controls/controls-bar.js >@@ -176,8 +176,16 @@ class ControlsBar extends LayoutNode > if (this.faded) > this.faded = false; > else { >+ let ancestor = this.element.parentNode; >+ while (ancestor && !(ancestor instanceof ShadowRoot)) >+ ancestor = ancestor.parentNode; >+ >+ const shadowRoot = ancestor; >+ if (!shadowRoot) >+ return; >+ > const tapLocation = recognizer.locationInClient(); >- const tappedElement = document.elementFromPoint(tapLocation.x, tapLocation.y); >+ const tappedElement = shadowRoot.elementFromPoint(tapLocation.x, tapLocation.y); > if (!this.element.contains(tappedElement)) > this.faded = true; > } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index df3bca0a3c0bcdbacb975091f5f86506e002c6a3..eedd083db8bf14552b844ed31587bc2505691298 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,5 +1,19 @@ > 2017-02-09 Antoine Quint <graouts@apple.com> > >+ [Modern Media Controls] Tapping the skip back button on iOS inline media controls make the controls disappear >+ https://bugs.webkit.org/show_bug.cgi?id=168049 >+ <rdar://problem/30442660> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a new iOS-specific test that checks that tapping a button does not automatically dismisses the controls bar. >+ >+ * media/modern-media-controls/media-controller/media-controller-ios-do-not-hide-controls-when-tapping-button-expected.txt: Added. >+ * media/modern-media-controls/media-controller/media-controller-ios-do-not-hide-controls-when-tapping-button.html: Added. >+ * platform/mac/TestExpectations: >+ >+2017-02-09 Antoine Quint <graouts@apple.com> >+ > [Modern Media Controls] Playing an <audio> element on iOS makes the controls disappear > https://bugs.webkit.org/show_bug.cgi?id=168047 > <rdar://problem/30441939> >diff --git a/LayoutTests/media/modern-media-controls/media-controller/media-controller-ios-do-not-hide-controls-when-tapping-button-expected.txt b/LayoutTests/media/modern-media-controls/media-controller/media-controller-ios-do-not-hide-controls-when-tapping-button-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..203669163b42b0a027e4778f3bca90e6da8dafad >--- /dev/null >+++ b/LayoutTests/media/modern-media-controls/media-controller/media-controller-ios-do-not-hide-controls-when-tapping-button-expected.txt >@@ -0,0 +1,10 @@ >+Testing that tapping on the skip back button while playing on iOS does not fade the controls. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS window.internals.shadowRoot(media).querySelector('.controls-bar').classList.contains('faded') is false >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/media/modern-media-controls/media-controller/media-controller-ios-do-not-hide-controls-when-tapping-button.html b/LayoutTests/media/modern-media-controls/media-controller/media-controller-ios-do-not-hide-controls-when-tapping-button.html >new file mode 100644 >index 0000000000000000000000000000000000000000..7735c5986d71059a42342f7600f2fc8c904e4014 >--- /dev/null >+++ b/LayoutTests/media/modern-media-controls/media-controller/media-controller-ios-do-not-hide-controls-when-tapping-button.html >@@ -0,0 +1,25 @@ >+<script src="../../../resources/js-test-pre.js"></script> >+<script src="../resources/media-controls-utils.js" type="text/javascript"></script> >+<meta name="viewport" content="width=device-width, initial-scale=1"> >+<body> >+<video src="../../content/test.mp4" style="width: 300px; position: absolute; left: 0; top: 0;" type="video/mp4" playsinline muted autoplay controls></video> >+<script type="text/javascript"> >+ >+window.jsTestIsAsync = true; >+ >+description("Testing that tapping on the skip back button while playing on iOS does not fade the controls."); >+ >+const media = document.querySelector("video"); >+ >+media.addEventListener("play", event => { >+ pressOnElement(window.internals.shadowRoot(media).querySelector("button.skip-back"), () => { >+ window.requestAnimationFrame(() => { >+ shouldBeFalse("window.internals.shadowRoot(media).querySelector('.controls-bar').classList.contains('faded')"); >+ finishJSTest(); >+ }); >+ }); >+}); >+ >+</script> >+<script src="../../../resources/js-test-post.js"></script> >+</body> >diff --git a/LayoutTests/platform/mac/TestExpectations b/LayoutTests/platform/mac/TestExpectations >index 3ef44fd2e90b7771d8b0f0dd9c0e32f78cc68d30..bbf64387aa9b0673f87116bd171d5e31645d92cd 100644 >--- a/LayoutTests/platform/mac/TestExpectations >+++ b/LayoutTests/platform/mac/TestExpectations >@@ -1469,6 +1469,7 @@ media/modern-media-controls/placard-support/ipad/placard-support-pip.html [ Skip > media/modern-media-controls/scrubber-support/ipad/scrubber-support-drag.html [ Skip ] > media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-audio-background.html [ Skip ] > media/modern-media-controls/media-controller/media-controller-ios-only-enable-tap-gesture-recognizer-with-fades-when-idle.html [ Skip ] >+media/modern-media-controls/media-controller/media-controller-ios-do-not-hide-controls-when-tapping-button.html [ Skip ] > > # This one always times out on the bots, cannot reproduce locally. > webkit.org/b/165234 media/modern-media-controls/audio/audio-controls-buttons.html [ Skip ]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 168049
: 301042