Title: [200976] trunk
- Revision
- 200976
- Author
- [email protected]
- Date
- 2016-05-16 16:08:05 -0700 (Mon, 16 May 2016)
Log Message
REGRESSION (r200441): Yahoo sports, finance and news pages automatically scroll
https://bugs.webkit.org/show_bug.cgi?id=157692
<rdar://problem/26231897>
Patch by Aaron Chu <[email protected]> on 2016-05-16
Reviewed by Eric Carlson.
Source/WebCore:
Test: media/video-controls-to-not-scroll-page-on-load.html
This bug was due to the fact that showControls button was shown and focused
when the video controls are hidden. The showControls button is used by FKA or
screen readers to make the video controls reappear after they have faded out.
When the showControls button is shown, a focus() is called on it to ensure that
the screen reader is focusing on the button instead of <body> or the video chrome.
To fix this bug, I added the shouldHaveControls() check before calling focus() on
the showControls button.
* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.showShowControlsButton):
LayoutTests:
Added Layout test to make sure that the page does not scroll automatically because
of the focus() on showControlsButton in the video shadow DOM.
* media/video-controls-to-not-scroll-page-on-load-expected.txt: Added.
* media/video-controls-to-not-scroll-page-on-load.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (200975 => 200976)
--- trunk/LayoutTests/ChangeLog 2016-05-16 22:53:21 UTC (rev 200975)
+++ trunk/LayoutTests/ChangeLog 2016-05-16 23:08:05 UTC (rev 200976)
@@ -1,3 +1,17 @@
+2016-05-16 Aaron Chu <[email protected]>
+
+ REGRESSION (r200441): Yahoo sports, finance and news pages automatically scroll
+ https://bugs.webkit.org/show_bug.cgi?id=157692
+ <rdar://problem/26231897>
+
+ Reviewed by Eric Carlson.
+
+ Added Layout test to make sure that the page does not scroll automatically because
+ of the focus() on showControlsButton in the video shadow DOM.
+
+ * media/video-controls-to-not-scroll-page-on-load-expected.txt: Added.
+ * media/video-controls-to-not-scroll-page-on-load.html: Added.
+
2016-05-16 Joseph Pecoraro <[email protected]>
Unreviewed rollout r200924. Caused js/regress/string-replace-generic.html to fail.
Added: trunk/LayoutTests/media/video-controls-to-not-scroll-page-on-load-expected.txt (0 => 200976)
--- trunk/LayoutTests/media/video-controls-to-not-scroll-page-on-load-expected.txt (rev 0)
+++ trunk/LayoutTests/media/video-controls-to-not-scroll-page-on-load-expected.txt 2016-05-16 23:08:05 UTC (rev 200976)
@@ -0,0 +1,2 @@
+
+PASS
Added: trunk/LayoutTests/media/video-controls-to-not-scroll-page-on-load.html (0 => 200976)
--- trunk/LayoutTests/media/video-controls-to-not-scroll-page-on-load.html (rev 0)
+++ trunk/LayoutTests/media/video-controls-to-not-scroll-page-on-load.html 2016-05-16 23:08:05 UTC (rev 200976)
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<body _onload_="testScroll()">
+<div style="width: 256px; height: 2096px; background-color: blue"></div> <!-- Dummy content to help make the page scrollable vertically. -->
+<video src="" style="width: 256px; height: 256px; background-color: yellow">
+ <track src="" kind="captions"></track>
+</video>
+
+<div id="result">FAILED: Test did not run.</div>
+
+<script>
+
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+var result = document.getElementById("result");
+
+result.innerHTML = "";
+
+function testScroll () {
+ result.innerHTML += (document.body.scrollTop <= 0)? `PASS`: `FAILED: ${document.body.scrollTop} > 0, the page scrolled automatically.`;
+
+ testRunner.notifyDone();
+}
+</script>
+</body>
+</html>
\ No newline at end of file
Modified: trunk/Source/WebCore/ChangeLog (200975 => 200976)
--- trunk/Source/WebCore/ChangeLog 2016-05-16 22:53:21 UTC (rev 200975)
+++ trunk/Source/WebCore/ChangeLog 2016-05-16 23:08:05 UTC (rev 200976)
@@ -1,3 +1,24 @@
+2016-05-16 Aaron Chu <[email protected]>
+
+ REGRESSION (r200441): Yahoo sports, finance and news pages automatically scroll
+ https://bugs.webkit.org/show_bug.cgi?id=157692
+ <rdar://problem/26231897>
+
+ Reviewed by Eric Carlson.
+
+ Test: media/video-controls-to-not-scroll-page-on-load.html
+
+ This bug was due to the fact that showControls button was shown and focused
+ when the video controls are hidden. The showControls button is used by FKA or
+ screen readers to make the video controls reappear after they have faded out.
+ When the showControls button is shown, a focus() is called on it to ensure that
+ the screen reader is focusing on the button instead of <body> or the video chrome.
+ To fix this bug, I added the shouldHaveControls() check before calling focus() on
+ the showControls button.
+
+ * Modules/mediacontrols/mediaControlsApple.js:
+ (Controller.prototype.showShowControlsButton):
+
2016-05-16 Joseph Pecoraro <[email protected]>
Unreviewed rollout r200924. Caused js/regress/string-replace-generic.html to fail.
Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js (200975 => 200976)
--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js 2016-05-16 22:53:21 UTC (rev 200975)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js 2016-05-16 23:08:05 UTC (rev 200976)
@@ -1530,7 +1530,7 @@
showShowControlsButton: function (shouldShow) {
this.showControlsButton.hidden = !shouldShow;
- if (shouldShow)
+ if (shouldShow && this.shouldHaveControls())
this.showControlsButton.focus();
},
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes