Commit 191b1d5e authored by benjamin@webkit.org's avatar benjamin@webkit.org

Modernize fast/events/autoscroll.html

https://bugs.webkit.org/show_bug.cgi?id=112508

Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-04-05
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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0c8e191b
2013-04-05 Benjamin Poulain <bpoulain@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 <aestes@apple.com>
Returning NULL from willSendRequest should cancel a load from the memory cache
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.
<html>
<head>
<script src="../js/resources/js-test-pre.js"></script>
<script>
jsTestIsAsync = true;
description('Verify selecting text does not cause any scrolling.');
var originalPageYOffset;
var originalBodyScrollTop;
function test()
{
if (window.testRunner) {
testRunner.waitUntilDone();
setTimeout(autoscrollTestPart1, 0);
}
setTimeout(autoscrollTestPart1, 0);
}
function autoscrollTestPart1()
{
var ta = document.getElementById('ta');
ta.scrollIntoView();
originalPageYOffset = pageYOffset;
originalBodyScrollTop = document.body.scrollTop;
if (window.eventSender) {
ta.scrollIntoView();
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, h);
eventSender.mouseMoveTo(20, verticalOffset);
eventSender.mouseDown();
eventSender.mouseMoveTo(20, h);
eventSender.mouseMoveTo(100, h);
eventSender.mouseMoveTo(20, verticalOffset);
eventSender.mouseMoveTo(100, verticalOffset);
}
setTimeout(autoscrollTestPart2, 100);
}
......@@ -26,13 +36,16 @@
{
if (window.eventSender)
eventSender.mouseUp();
if (window.testRunner)
testRunner.notifyDone();
}
function log(msg)
{
var res = document.getElementById('res');
res.innerHTML = res.innerHTML + msg + "<br>";
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>
......@@ -43,4 +56,5 @@
<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="../js/resources/js-test-post.js"></script>
</html>
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
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
......@@ -97,7 +97,6 @@ fast/events/5056619.html
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
......
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment