Diff
Modified: trunk/LayoutTests/ChangeLog (147829 => 147830)
--- trunk/LayoutTests/ChangeLog 2013-04-06 03:09:25 UTC (rev 147829)
+++ trunk/LayoutTests/ChangeLog 2013-04-06 03:33:54 UTC (rev 147830)
@@ -1,3 +1,28 @@
+2013-04-05 Benjamin Poulain <bpoul...@apple.com>
+
+ Modernize fast/events/autoscroll.html
+ https://bugs.webkit.org/show_bug.cgi?id=112508
+
+ Reviewed by Jer Noble.
+
+ The test fast/events/autoscroll.html was introduced in
+ https://bugs.webkit.org/show_bug.cgi?id=12331 (r19102) to verify the page
+ does not scroll when the text is selected.
+
+ It seems reasonable to test the use case with a text dump instead of a pixel test.
+ This should reduces the maintenance needed to keep the test useful.
+
+ * fast/events/autoscroll.html: Removed.
+ * fast/events/no-scroll-on-input-text-selection-expected.txt: Added.
+ * fast/events/no-scroll-on-input-text-selection.html: Added.
+ * platform/efl/fast/events/autoscroll-expected.png: Removed.
+ * platform/efl/fast/events/autoscroll-expected.txt: Removed.
+ * platform/gtk/fast/events/autoscroll-expected.png: Removed.
+ * platform/gtk/fast/events/autoscroll-expected.txt: Removed.
+ * platform/mac-wk2/TestExpectations:
+ * platform/mac/fast/events/autoscroll-expected.png: Removed.
+ * platform/mac/fast/events/autoscroll-expected.txt: Removed.
+
2013-04-05 Andy Estes <aes...@apple.com>
Returning NULL from willSendRequest should cancel a load from the memory cache
Deleted: trunk/LayoutTests/fast/events/autoscroll.html (147829 => 147830)
--- trunk/LayoutTests/fast/events/autoscroll.html 2013-04-06 03:09:25 UTC (rev 147829)
+++ trunk/LayoutTests/fast/events/autoscroll.html 2013-04-06 03:33:54 UTC (rev 147830)
@@ -1,46 +0,0 @@
-<html>
- <head>
- <script>
- function test()
- {
- if (window.testRunner) {
- testRunner.waitUntilDone();
- setTimeout(autoscrollTestPart1, 0);
- }
- }
- function autoscrollTestPart1()
- {
- var ta = document.getElementById('ta');
- if (window.eventSender) {
- ta.scrollIntoView();
- var h = ta.offsetTop - document.body.scrollTop + 10;
- eventSender.dragMode = false;
- eventSender.mouseMoveTo(20, h);
- eventSender.mouseDown();
- eventSender.mouseMoveTo(20, h);
- eventSender.mouseMoveTo(100, h);
- }
- setTimeout(autoscrollTestPart2, 100);
- }
- function autoscrollTestPart2()
- {
- if (window.eventSender)
- eventSender.mouseUp();
- if (window.testRunner)
- testRunner.notifyDone();
- }
- function log(msg)
- {
- var res = document.getElementById('res');
- res.innerHTML = res.innerHTML + msg + "<br>";
- }
- </script>
- </head>
- <body _onload_="test()">
- <p>Test for <a href="" 12331</a>.</p>
- <p>To test manually, scroll down until you find the input element. Select some text. If the bug occurs, the page will scroll back up to the top.</p>
- <div style="height:3000px"></div>
- <input id="ta" value="select some of this text"></input>
- <p>If the bug does not occur, you'll be left down here at the bottom.</p>
- </body>
-</html>
Added: trunk/LayoutTests/fast/events/no-scroll-on-input-text-selection-expected.txt (0 => 147830)
--- trunk/LayoutTests/fast/events/no-scroll-on-input-text-selection-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/events/no-scroll-on-input-text-selection-expected.txt 2013-04-06 03:33:54 UTC (rev 147830)
@@ -0,0 +1,21 @@
+Verify selecting text does not cause any scrolling.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.getSelection().toString().length > 1 is true
+PASS pageXOffset is 0
+PASS pageYOffset is originalPageYOffset
+PASS document.body.scrollLeft is 0
+PASS document.body.scrollTop is originalBodyScrollTop
+PASS pageYOffset is document.body.scrollTop
+PASS pageYOffset > 2000 is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+Test for bug 12331.
+
+To test manually, scroll down until you find the input element. Select some text. If the bug occurs, the page will scroll back up to the top.
+
+
+If the bug does not occur, you'll be left down here at the bottom.
Added: trunk/LayoutTests/fast/events/no-scroll-on-input-text-selection.html (0 => 147830)
--- trunk/LayoutTests/fast/events/no-scroll-on-input-text-selection.html (rev 0)
+++ trunk/LayoutTests/fast/events/no-scroll-on-input-text-selection.html 2013-04-06 03:33:54 UTC (rev 147830)
@@ -0,0 +1,60 @@
+<html>
+ <head>
+ <script src=""
+ <script>
+ jsTestIsAsync = true;
+
+ description('Verify selecting text does not cause any scrolling.');
+
+ var originalPageYOffset;
+ var originalBodyScrollTop;
+ function test()
+ {
+ setTimeout(autoscrollTestPart1, 0);
+ }
+ function autoscrollTestPart1()
+ {
+ var ta = document.getElementById('ta');
+ ta.scrollIntoView();
+
+ originalPageYOffset = pageYOffset;
+ originalBodyScrollTop = document.body.scrollTop;
+
+ if (window.eventSender) {
+ var taClientRect = ta.getBoundingClientRect();
+ var verticalOffset = taClientRect.top + (taClientRect.height / 2);
+ var h = ta.offsetTop - document.body.scrollTop + 10;
+ eventSender.dragMode = false;
+ eventSender.mouseMoveTo(20, verticalOffset);
+ eventSender.mouseDown();
+ eventSender.mouseMoveTo(20, verticalOffset);
+ eventSender.mouseMoveTo(100, verticalOffset);
+ }
+ setTimeout(autoscrollTestPart2, 100);
+ }
+ function autoscrollTestPart2()
+ {
+ if (window.eventSender)
+ eventSender.mouseUp();
+
+ shouldBeTrue('document.getSelection().toString().length > 1');
+ shouldBe('pageXOffset', '0');
+ shouldBe('pageYOffset', 'originalPageYOffset');
+ shouldBe('document.body.scrollLeft', '0');
+ shouldBe('document.body.scrollTop', 'originalBodyScrollTop');
+ shouldBe('pageYOffset', 'document.body.scrollTop');
+ shouldBeTrue('pageYOffset > 2000');
+
+ finishJSTest();
+ }
+ </script>
+ </head>
+ <body _onload_="test()">
+ <p>Test for <a href="" 12331</a>.</p>
+ <p>To test manually, scroll down until you find the input element. Select some text. If the bug occurs, the page will scroll back up to the top.</p>
+ <div style="height:3000px"></div>
+ <input id="ta" value="select some of this text"></input>
+ <p>If the bug does not occur, you'll be left down here at the bottom.</p>
+ </body>
+ <script src=""
+</html>
Deleted: trunk/LayoutTests/platform/efl/fast/events/autoscroll-expected.png
(Binary files differ)
Deleted: trunk/LayoutTests/platform/efl/fast/events/autoscroll-expected.txt (147829 => 147830)
--- trunk/LayoutTests/platform/efl/fast/events/autoscroll-expected.txt 2013-04-06 03:09:25 UTC (rev 147829)
+++ trunk/LayoutTests/platform/efl/fast/events/autoscroll-expected.txt 2013-04-06 03:33:54 UTC (rev 147830)
@@ -1,31 +0,0 @@
-layer at (0,0) size 785x3176
- RenderView at (0,0) size 785x600
-layer at (0,0) size 785x3176
- RenderBlock {HTML} at (0,0) size 785x3176
- RenderBody {BODY} at (8,8) size 769x3152
- RenderBlock {P} at (0,0) size 769x18
- RenderText {#text} at (0,0) size 53x17
- text run at (0,0) width 53: "Test for "
- RenderInline {A} at (0,0) size 68x17 [color=#0000EE]
- RenderText {#text} at (53,0) size 68x17
- text run at (53,0) width 68: "bug 12331"
- RenderText {#text} at (121,0) size 4x17
- text run at (121,0) width 4: "."
- RenderBlock {P} at (0,34) size 769x36
- RenderText {#text} at (0,0) size 739x35
- text run at (0,0) width 739: "To test manually, scroll down until you find the input element. Select some text. If the bug occurs, the page will scroll"
- text run at (0,18) width 117: "back up to the top."
- RenderBlock {DIV} at (0,86) size 769x3000
- RenderBlock (anonymous) at (0,3086) size 769x32
- RenderTextControl {INPUT} at (2,2) size 192x28 [bgcolor=#FFFFFF]
- RenderText {#text} at (0,0) size 0x0
- RenderBlock {P} at (0,3134) size 769x18
- RenderText {#text} at (0,0) size 404x17
- text run at (0,0) width 404: "If the bug does not occur, you'll be left down here at the bottom."
-layer at (14,3102) size 185x18
- RenderBlock {DIV} at (4,6) size 185x18
- RenderText {#text} at (0,0) size 160x17
- text run at (0,0) width 160: "select some of this text"
-selection start: position 1 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 7 {INPUT} of body
-selection end: position 11 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 7 {INPUT} of body
-scrolled to 0,2576
Deleted: trunk/LayoutTests/platform/gtk/fast/events/autoscroll-expected.png
(Binary files differ)
Deleted: trunk/LayoutTests/platform/gtk/fast/events/autoscroll-expected.txt (147829 => 147830)
--- trunk/LayoutTests/platform/gtk/fast/events/autoscroll-expected.txt 2013-04-06 03:09:25 UTC (rev 147829)
+++ trunk/LayoutTests/platform/gtk/fast/events/autoscroll-expected.txt 2013-04-06 03:33:54 UTC (rev 147830)
@@ -1,31 +0,0 @@
-layer at (0,0) size 785x3172
- RenderView at (0,0) size 785x600
-layer at (0,0) size 785x3172
- RenderBlock {HTML} at (0,0) size 785x3172
- RenderBody {BODY} at (8,8) size 769x3148
- RenderBlock {P} at (0,0) size 769x18
- RenderText {#text} at (0,0) size 53x19
- text run at (0,0) width 53: "Test for "
- RenderInline {A} at (0,0) size 68x19 [color=#0000EE]
- RenderText {#text} at (53,0) size 68x19
- text run at (53,0) width 68: "bug 12331"
- RenderText {#text} at (121,0) size 4x19
- text run at (121,0) width 4: "."
- RenderBlock {P} at (0,34) size 769x36
- RenderText {#text} at (0,0) size 739x37
- text run at (0,0) width 739: "To test manually, scroll down until you find the input element. Select some text. If the bug occurs, the page will scroll"
- text run at (0,18) width 117: "back up to the top."
- RenderBlock {DIV} at (0,86) size 769x3000
- RenderBlock (anonymous) at (0,3086) size 769x28
- RenderTextControl {INPUT} at (2,2) size 192x24 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
- RenderText {#text} at (0,0) size 0x0
- RenderBlock {P} at (0,3130) size 769x18
- RenderText {#text} at (0,0) size 404x19
- text run at (0,0) width 404: "If the bug does not occur, you'll be left down here at the bottom."
-layer at (13,3099) size 186x18 scrollHeight 19
- RenderBlock {DIV} at (3,3) size 186x18
- RenderText {#text} at (0,0) size 160x19
- text run at (0,0) width 160: "select some of this text"
-selection start: position 1 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 7 {INPUT} of body
-selection end: position 11 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 7 {INPUT} of body
-scrolled to 0,2572
Deleted: trunk/LayoutTests/platform/mac/fast/events/autoscroll-expected.png
(Binary files differ)
Deleted: trunk/LayoutTests/platform/mac/fast/events/autoscroll-expected.txt (147829 => 147830)
--- trunk/LayoutTests/platform/mac/fast/events/autoscroll-expected.txt 2013-04-06 03:09:25 UTC (rev 147829)
+++ trunk/LayoutTests/platform/mac/fast/events/autoscroll-expected.txt 2013-04-06 03:33:54 UTC (rev 147830)
@@ -1,31 +0,0 @@
-layer at (0,0) size 785x3167
- RenderView at (0,0) size 785x600
-layer at (0,0) size 785x3167
- RenderBlock {HTML} at (0,0) size 785x3167
- RenderBody {BODY} at (8,8) size 769x3143
- RenderBlock {P} at (0,0) size 769x18
- RenderText {#text} at (0,0) size 53x18
- text run at (0,0) width 53: "Test for "
- RenderInline {A} at (0,0) size 68x18 [color=#0000EE]
- RenderText {#text} at (53,0) size 68x18
- text run at (53,0) width 68: "bug 12331"
- RenderText {#text} at (121,0) size 4x18
- text run at (121,0) width 4: "."
- RenderBlock {P} at (0,34) size 769x36
- RenderText {#text} at (0,0) size 739x36
- text run at (0,0) width 739: "To test manually, scroll down until you find the input element. Select some text. If the bug occurs, the page will scroll"
- text run at (0,18) width 117: "back up to the top."
- RenderBlock {DIV} at (0,86) size 769x3000
- RenderBlock (anonymous) at (0,3086) size 769x23
- RenderTextControl {INPUT} at (2,2) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
- RenderText {#text} at (0,0) size 0x0
- RenderBlock {P} at (0,3125) size 769x18
- RenderText {#text} at (0,0) size 404x18
- text run at (0,0) width 404: "If the bug does not occur, you'll be left down here at the bottom."
-layer at (13,3099) size 117x13 scrollWidth 127
- RenderBlock {DIV} at (3,3) size 117x13
- RenderText {#text} at (0,0) size 126x13
- text run at (0,0) width 126: "select some of this text"
-selection start: position 1 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 7 {INPUT} of body
-selection end: position 16 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 7 {INPUT} of body
-scrolled to 0,2567
Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (147829 => 147830)
--- trunk/LayoutTests/platform/mac-wk2/TestExpectations 2013-04-06 03:09:25 UTC (rev 147829)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations 2013-04-06 03:33:54 UTC (rev 147830)
@@ -97,7 +97,6 @@
fast/events/autoscroll-in-textfield.html
fast/events/autoscroll-nonscrollable-iframe-in-scrollable-div.html
fast/events/autoscroll-with-non-scrollable-parent.html
-fast/events/autoscroll.html
fast/events/bogus-dropEffect-effectAllowed.html
fast/events/click-count.html
fast/events/content-changed-during-drop.html