Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
2008-08-21 Maxime Britto <britto@apple.com>
Reviewed by Kevin McCullough. Test: fast/events/autoscroll-nonscrollable-iframe-in-scrollable-div.html https://bugs.webkit.org/show_bug.cgi?id=20451 rdar://problem/6166435 Inspector doesn't auto scroll when selecting text (20451) When we climb up the rendering tree looking for a scrollable renderer, we need to be able to jump outside of an iframe. This way we can see if what is embedding the iframe can be scrolled even if the iframe content can't. * page/EventHandler.cpp: (WebCore::EventHandler::handleMouseDraggedEvent): when we reach the document node and it can't be scrolled we set the next parent as the document's owner element if it exists. (WebCore::EventHandler::handleMousePressEvent): ditto 2008-08-21 Maxime Britto <britto@apple.com> Reviewed by Kevin McCullough. rdar://problem/6166435 Inspector doesn't auto scroll when selecting text (20451) https://bugs.webkit.org/show_bug.cgi?id=20451 This test can be run automatically or manually as well. * fast/events/autoscroll-nonscrollable-iframe-in-scrollable-div-expected.txt: Added. * fast/events/autoscroll-nonscrollable-iframe-in-scrollable-div.html: Added. * fast/events/resources/big-page-with-overflow-hidden.html: Added. Canonical link: https://commits.webkit.org/28288@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@35882 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Maxime Britto
committed
Aug 22, 2008
1 parent
233102a
commit 190caa76babde76e3b0a9db83f09835909ea4890
Showing
6 changed files
with
124 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,6 @@ | ||
|
||
rdar://problem/6166435 Inspector doesn't auto scroll when selecting text (20451) | ||
To do the test manually you have to try triggering the autoscroll by starting the dragging from within the blue iframe. If the autoscroll occurs the text has passed, if the autoscroll isn't working, the test has failed | ||
nb: Knowing that the iframe document has a overflow: hidden on his body but the whole iframe is embedded in scrollable div, the scrollable div have to be able to trigger the autoscroll | ||
Though you should be able to write some long text in the input and to trigger the autoscroll within the input. | ||
PASSED : the autoscroll has worked ! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,66 @@ | ||
<html> | ||
<head> | ||
<script> | ||
function log(msg) | ||
{ | ||
document.getElementById('console').appendChild(document.createTextNode(msg + '\n')); | ||
} | ||
|
||
function test() | ||
{ | ||
if (window.layoutTestController) { | ||
layoutTestController.waitUntilDone(); | ||
layoutTestController.dumpAsText(); | ||
setTimeout(autoscrollTestPart1, 0); | ||
} | ||
} | ||
|
||
function autoscrollTestPart1() | ||
{ | ||
var iframe = document.getElementById('NoScrolliFrame'); | ||
var iframeDocument = iframe.contentDocument; | ||
var textInIframe = iframeDocument.getElementById('textInFrame'); | ||
if (window.eventSender) { | ||
var x = iframe.offsetLeft + textInIframe.offsetLeft + 7; | ||
var y = iframe.offsetLeft + textInIframe.offsetTop + 7; | ||
eventSender.dragMode = false; | ||
eventSender.mouseMoveTo(x, y); | ||
eventSender.mouseDown(); | ||
eventSender.mouseMoveTo(x + 220, y + 220); | ||
} | ||
setTimeout(autoscrollTestPart2, 100); | ||
} | ||
|
||
function autoscrollTestPart2() | ||
{ | ||
if (window.eventSender) | ||
eventSender.mouseUp(); | ||
var sd = document.getElementById('scrollableDiv'); | ||
if (sd.scrollLeft != 0) | ||
log("PASSED : the autoscroll has worked !"); | ||
else | ||
log("FAILED : the autoscroll has not worked :-("); | ||
|
||
if (window.layoutTestController) | ||
layoutTestController.notifyDone(); | ||
} | ||
</script> | ||
</head> | ||
<body onload="test()"> | ||
|
||
<div id="scrollableDiv" style="height: 100px; overflow-x: auto; overflow-y: auto; width: 100px"> | ||
<div style=" height: 1000px; width: 1000px"> | ||
<iframe id="NoScrolliFrame" src="resources/big-page-with-overflow-hidden.html" style="height: 1000px; width: 1000px"></iframe> | ||
</div> | ||
</div> | ||
|
||
<div id="console"> | ||
rdar://problem/6166435 Inspector doesn't auto scroll when selecting text (20451) <br> | ||
To do the test manually you have to try triggering the autoscroll by starting the dragging from within the blue iframe. If the autoscroll occurs the text has passed, if the autoscroll isn't working, the test has failed<br> | ||
nb: Knowing that the iframe document has a overflow: hidden on his body but the whole iframe is embedded in scrollable div, the scrollable div have to be able to trigger the autoscroll<br> | ||
Though you should be able to write some long text in the input and to trigger the autoscroll within the input.<br> | ||
</div> | ||
|
||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,10 @@ | ||
<html> | ||
<body style="overflow: hidden"> | ||
<div style="width: 1000px; height: 1000px; background-color: blue"> | ||
<span id='textInFrame'> Try to autoscroll this text.<br> | ||
this page is a 1000px by 1000px page with the CSS overflow hidden attribute setted </span> | ||
<br><br><br><br> | ||
PASSED PASSED PASSED PASSED PASSED PASSED PASSED PASSED PASSED PASSED PASSED PASSED PASSED PASSED PASSED PASSED PASSED PASSED PASSED PASSED PASSED PASSED | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters