haikuwebkit/LayoutTests/pageoverlay/overlay-small-frame-mouse-e...

28 lines
700 B
HTML
Raw Permalink Normal View History

REGRESSION (r191849): There's no yellow bouncy highlight when using Find on Page on iOS https://bugs.webkit.org/show_bug.cgi?id=152241 <rdar://problem/23642574> Reviewed by Simon Fraser. Tests: pageoverlay/overlay-small-frame-mouse-events.html pageoverlay/overlay-small-frame-paints.html * page/PageOverlay.cpp: (WebCore::PageOverlay::bounds): Revert r191849's change that made bounds() actually return the frame() if we frame is manually overriden. (WebCore::PageOverlay::mouseEvent): Convert the mouse event the rest of the way into overlay coordinates (by applying the overlay's frame origin) before deciding whether to handle the event. * page/PageOverlay.h: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * testing/Internals.cpp: (WebCore::Internals::installMockPageOverlay): * testing/Internals.h: * testing/Internals.idl: * testing/MockPageOverlay.cpp: Added. (WebCore::MockPageOverlay::create): (WebCore::MockPageOverlay::MockPageOverlay): (WebCore::MockPageOverlay::setFrame): * testing/MockPageOverlay.h: Added. (WebCore::MockPageOverlay::overlay): * testing/MockPageOverlay.idl: Added. * testing/MockPageOverlayClient.cpp: (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::uninstallAllOverlays): (WebCore::MockPageOverlayClient::pageOverlayDestroyed): (WebCore::MockPageOverlayClient::drawRect): (WebCore::MockPageOverlayClient::mouseEvent): * testing/MockPageOverlayClient.h: Make internals.installMockPageOverlay return a MockPageOverlay object so tests can manipulate their overlay. For now, expose setFrame. Also, log when MockPageOverlayClient gets asked to paint or receives a mouse event, which will show up in test output. Slightly unconventional, but very convenient. * pageoverlay/overlay-small-frame-mouse-events-expected.txt: Added. * pageoverlay/overlay-small-frame-mouse-events.html: Added. Add a test ensuring that small-frame overlays get mouse events. * pageoverlay/overlay-small-frame-paints-expected.txt: Added. * pageoverlay/overlay-small-frame-paints.html: Added. Add a test ensuring that small-frame overlays get paint callbacks. Canonical link: https://commits.webkit.org/170422@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-15 22:46:02 +00:00
<html>
<style>
body {
height: 5000px;
width: 5000px;
}
</style>
<script>
window.onload = function () {
if (window.testRunner && window.internals) {
testRunner.dumpAsText(true);
var overlay = internals.installMockPageOverlay("document");
overlay.setFrame(100, 100, 10, 10);
eventSender.mouseMoveTo(105, 105);
eventSender.mouseDown();
eventSender.mouseUp();
var layersResult = document.getElementById('layers');
layersResult.innerText = window.internals.pageOverlayLayerTreeAsText();
}
}
</script>
<body>
<pre id="layers" style="position: absolute; height: 1px; width: 1px; overflow: hidden;"></pre>
</body>
</html>