Fix fake mouse move event on scroll

We made LayoutObject::previousPaintInvalidationRect() private but
DeprecatedPaintLayerScrollArea is a friend of LayoutObject, so missed
the change. This caused incorrect fake mouse move event on composited
scroll.

Will fix the friend access issue in
https://codereview.chromium.org/1306993002/.

BUG=516016
TEST=fast/events/overflow-composited-scroll-fake-mouse-move.html

Review URL: https://codereview.chromium.org/1309983002

git-svn-id: svn://svn.chromium.org/blink/trunk@201028 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 40e35903
<!DOCTYPE html>
<script src="../../resources/run-after-layout-and-paint.js"></script>
<div id="container" style="overflow: auto; height: 200px; width: 200px; backface-visibility: hidden">
<div id="target" style="margin: 50px 0; overflow: auto; height: 250px; width: 100px">
<div onmouseover="mouseOver(event)" style="margin: 250px 0; width: 20px; height: 20px; background-color: blue;"></div>
</div>
</div>
<div id="result">Test needs DumpRenderTree</div>
<script>
function mouseOver(event) {
document.getElementById("result").innerText = "PASS";
testRunner.notifyDone();
}
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
onload = function() {
document.getElementById("container").scrollTop = 50;
runAfterLayoutAndPaint(function() {
eventSender.mouseMoveTo(10, 10);
document.getElementById("target").scrollTop = 250;
});
};
}
</script>
<div id="target" style="overflow: auto; height: 200px; width: 200px;">
<div onmouseover="mouseOver(event)" style="margin: 300px 0; width: 100px; height: 100px; background-color: blue;"></div>
</div>
<div id="result">Test did not run</div>
<div id="result">Test needs DumpRenderTree</div>
<script>
var passed = false;
function mouseOver(event)
{
passed = true;
}
function finish()
{
document.getElementById("result").innerText = passed ? "PASS" : "FAIL";
document.getElementById("result").innerText = "PASS";
testRunner.notifyDone();
}
......@@ -20,14 +13,10 @@
testRunner.dumpAsText();
testRunner.waitUntilDone();
// WebKit schedules a fake mouse move event as part of installing the WebView in
// a window. For the test to be valid, it must begin only after that event
// gets dispatched.
setTimeout(function()
onload = function()
{
eventSender.mouseMoveTo(50, 100);
document.getElementById("target").scrollTop = 250;
setTimeout(finish, 200);
}, 200);
};
}
</script>
......@@ -413,7 +413,7 @@ void DeprecatedPaintLayerScrollableArea::setScrollOffset(const DoublePoint& newS
// The caret rect needs to be invalidated after scrolling
frame->selection().setCaretRectNeedsUpdate();
FloatQuad quadForFakeMouseMoveEvent = FloatQuad(layer()->layoutObject()->previousPaintInvalidationRect());
FloatQuad quadForFakeMouseMoveEvent = FloatQuad(layer()->layoutObject()->previousPaintInvalidationRectIncludingCompositedScrolling(*paintInvalidationContainer));
quadForFakeMouseMoveEvent = paintInvalidationContainer->localToAbsoluteQuad(quadForFakeMouseMoveEvent);
frame->eventHandler().dispatchFakeMouseMoveEventSoonInQuad(quadForFakeMouseMoveEvent);
......
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