Skip to content
Permalink
Browse files
2010-03-04 Tony Chang <tony@chromium.org>
        Reviewed by Eric Seidel.

        https://bugs.webkit.org/show_bug.cgi?id=18819
        Pressing option+page{down,up} should move the cursor and scroll in
        content editable areas.  On other platforms, pressing page{down,up}
        should move the cursor and scroll in content editable areas.

        * editing/input/option-page-up-down-expected.txt: Added.
        * editing/input/option-page-up-down.html: Added.
2010-03-04  Tony Chang  <tony@chromium.org>

        Reviewed by Eric Seidel.

        https://bugs.webkit.org/show_bug.cgi?id=18819
        Pressing option+page{down,up} should move the cursor and scroll in
        content editable areas.  On other platforms, pressing page{down,up}
        should move the cursor and scroll in content editable areas.

        Test: editing/input/option-page-up-down.html

        * editing/EditorCommand.cpp:
        (WebCore::verticalScrollDistance):

Canonical link: https://commits.webkit.org/46863@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@55566 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
idealisms committed Mar 5, 2010
1 parent c8abed4 commit 9680e9881ecb28cd25d38c987acf4e8e77f314b8
Showing 5 changed files with 79 additions and 1 deletion.
@@ -1,3 +1,15 @@
2010-03-04 Tony Chang <tony@chromium.org>

Reviewed by Eric Seidel.

https://bugs.webkit.org/show_bug.cgi?id=18819
Pressing option+page{down,up} should move the cursor and scroll in
content editable areas. On other platforms, pressing page{down,up}
should move the cursor and scroll in content editable areas.

* editing/input/option-page-up-down-expected.txt: Added.
* editing/input/option-page-up-down.html: Added.

2010-03-03 Oliver Hunt <oliver@apple.com>

Reviewed by Gavin Barraclough.
@@ -0,0 +1,3 @@
On Mac, option+pagedown should move the mouse cursor and scroll in text areas. On other platforms, pagedown should move the mouse cursor and scroll in text areas. This test requires DRT to pass.

PASS
@@ -0,0 +1,49 @@
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}

function runTest()
{
var frame = frames[0];
var doc = frame.document;
var body = doc.body;
for (var i = 0; i < 10; ++i)
body.innerHTML += "<p>line " + i + "</p>\n";
frame.focus();
frame.getSelection().setPosition(body.firstChild, 0);

var onMacPlatform = navigator.userAgent.search(/\bMac OS X\b/) != -1;
var modifiers = onMacPlatform ? ["altKey"] : [];

if (!window.eventSender)
return;

eventSender.keyDown("pageDown", modifiers);
var line = frame.getSelection().baseNode.nodeValue;
if (line != "line 8")
throw "cursor should be at line 8, not " + line;

eventSender.keyDown("pageDown", modifiers);
var line = frame.getSelection().baseNode.nodeValue;
if (line != "line 9")
throw "cursor should be at line 9, not " + line;

eventSender.keyDown("pageUp", modifiers);
var line = frame.getSelection().baseNode.nodeValue;
if (line != "line 1")
throw "cursor should be at line 1, not " + line;

document.getElementById("results").innerText = "PASS";

if (window.layoutTestController)
window.layoutTestController.notifyDone();
}
</script>

<div>On Mac, option+pagedown should move the mouse cursor and scroll in text areas. On
other platforms, pagedown should move the mouse cursor and scroll in text areas. This
test requires DRT to pass.</div>
<iframe src="../resources/contenteditable-iframe-src.html" onload="runTest()"></iframe>
<div id="results">FAIL</div>
@@ -1,3 +1,17 @@
2010-03-04 Tony Chang <tony@chromium.org>

Reviewed by Eric Seidel.

https://bugs.webkit.org/show_bug.cgi?id=18819
Pressing option+page{down,up} should move the cursor and scroll in
content editable areas. On other platforms, pressing page{down,up}
should move the cursor and scroll in content editable areas.

Test: editing/input/option-page-up-down.html

* editing/EditorCommand.cpp:
(WebCore::verticalScrollDistance):

2010-03-03 Oliver Hunt <oliver@apple.com>

Reviewed by Gavin Barraclough.
@@ -257,7 +257,7 @@ static int verticalScrollDistance(Frame* frame)
RenderStyle* style = renderer->style();
if (!style)
return 0;
if (!(style->overflowY() == OSCROLL || style->overflowY() == OAUTO || renderer->isTextArea()))
if (!(style->overflowY() == OSCROLL || style->overflowY() == OAUTO || focusedNode->isContentEditable()))
return 0;
int height = toRenderBox(renderer)->clientHeight();
return max(max<int>(height * Scrollbar::minFractionToStepWhenPaging(), height - Scrollbar::maxOverlapBetweenPages()), 1);

0 comments on commit 9680e98

Please sign in to comment.