mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 633762. Only bail early if we have an async scroll pending so the ScrollTo call can update mDestination. r=roc a=roc
This commit is contained in:
parent
d320742fb3
commit
084c19569c
@ -2442,7 +2442,8 @@ void nsGfxScrollFrameInner::CurPosAttributeChanged(nsIContent* aContent)
|
||||
-scrolledRect.y) +
|
||||
scrolledRect.y;
|
||||
|
||||
if (dest == GetScrollPosition()) {
|
||||
// If we have an async scroll pending don't stomp on that by calling ScrollTo.
|
||||
if (mAsyncScroll && dest == GetScrollPosition()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -125,6 +125,8 @@ _TEST_FILES = \
|
||||
test_bug589621.html \
|
||||
test_bug589623.html \
|
||||
test_bug632379.xul \
|
||||
test_bug633762.html \
|
||||
bug633762_iframe.html \
|
||||
$(srcdir)/../../reftests/backgrounds/blue-32x32.png \
|
||||
$(srcdir)/../../reftests/backgrounds/fuchsia-32x32.png \
|
||||
$(NULL)
|
||||
|
8
layout/generic/test/bug633762_iframe.html
Normal file
8
layout/generic/test/bug633762_iframe.html
Normal file
@ -0,0 +1,8 @@
|
||||
<html>
|
||||
<body>
|
||||
<div style="background: red; height: 4000px;">hi</div>
|
||||
<div id="b" style="background: blue; height: 10000px;"></div>
|
||||
<div id="a" style="background: yellow; height: 100px;"></div>
|
||||
<div style="background: green; height: 4000px;"></div>
|
||||
</body>
|
||||
</html>
|
55
layout/generic/test/test_bug633762.html
Normal file
55
layout/generic/test/test_bug633762.html
Normal file
@ -0,0 +1,55 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=633762
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 633762</title>
|
||||
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p><a target="_blank" href="https://bugzilla.mozilla.org/show_bug?id=633762">Mozilla Bug 633762</a>
|
||||
|
||||
<iframe id="i" src="bug633762_iframe.html#a"></iframe>
|
||||
|
||||
<pre id="test">
|
||||
<script>
|
||||
|
||||
var doc;
|
||||
|
||||
function runTests() {
|
||||
var i = document.getElementById("i");
|
||||
doc = i.contentDocument;
|
||||
var win = i.contentWindow;
|
||||
// set display none on b
|
||||
doc.getElementById("b").style.display = "none";
|
||||
// flush layout
|
||||
doc.documentElement.offsetLeft;
|
||||
// click in middle of iframe document to give it focus
|
||||
synthesizeMouseAtCenter(i, {}, win);
|
||||
win.focus();
|
||||
// record scrolltop
|
||||
scrollTopBefore = doc.body.scrollTop;
|
||||
// send up arrow key event
|
||||
sendKey("UP", doc.body);
|
||||
|
||||
setTimeout("finish();", 0);
|
||||
}
|
||||
|
||||
function finish() {
|
||||
// assert that scroll top is now less than before
|
||||
ok(scrollTopBefore > doc.body.scrollTop, "pressing up arrow should scroll up");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SimpleTest.waitForFocus(runTests);
|
||||
</script>
|
||||
</pre>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user