haikuwebkit/LayoutTests/pageoverlay/overlay-installation.html

17 lines
518 B
HTML
Raw Permalink Normal View History

Make it possible to test page overlays https://bugs.webkit.org/show_bug.cgi?id=137339 Reviewed by Dan Bernstein. Tests: pageoverlay/overlay-installation.html pageoverlay/overlay-large-document-scrolled.html pageoverlay/overlay-large-document.html Do some initial work to make page overlays testable. There are many more tests to be written, but this lays the groundwork. * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj: * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: * CMakeLists.txt: Add MockPageOverlayClient. * platform/graphics/GraphicsLayer.h: * page/PageOverlayController.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::shouldSkipLayerInDump): Don't skip PageOverlayController-owned layers in the layer tree dump if the layerTreeAsText behavior says that we should include them. * platform/graphics/GraphicsLayer.cpp: (WebCore::dumpChildren): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldSkipLayerInDump): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldSkipLayerInDump): * rendering/RenderLayerBacking.h: Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Uninstall all page overlays when resetting to a consistent state. (WebCore::Internals::installMockPageOverlay): (WebCore::Internals::pageOverlayLayerTreeAsText): Expose two new internals functions. installMockPageOverlay takes "view" or "document", allowing script to choose the appropriate overlay type. pageOverlayLayerTreeAsText dumps both view and document-relative overlays, from each overlay container layer. * testing/Internals.h: * testing/Internals.idl: Fix some typos. * testing/MockPageOverlayClient.cpp: Added. (WebCore::MockPageOverlayClient::shared): (WebCore::MockPageOverlayClient::MockPageOverlayClient): (WebCore::MockPageOverlayClient::installOverlay): (WebCore::MockPageOverlayClient::uninstallAllOverlays): (WebCore::MockPageOverlayClient::layerTreeAsText): (WebCore::MockPageOverlayClient::pageOverlayDestroyed): (WebCore::MockPageOverlayClient::willMoveToPage): (WebCore::MockPageOverlayClient::didMoveToPage): When the overlay is parented, mark it as needing repaint. Future tests might want to test overlays without content, but for now this is a reasonable default behavior. (WebCore::MockPageOverlayClient::drawRect): Paint the overlay rects as described in the LayoutTests ChangeLog. (WebCore::MockPageOverlayClient::mouseEvent): (WebCore::MockPageOverlayClient::didScrollFrame): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint): (WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames): * testing/MockPageOverlayClient.h: Added. * pageoverlay/overlay-installation.html: Added. Add a test which just installs one view-relative and one document-relative overlay, and dumps the layer tree and pixel results. The mock overlay strokes a blue rectangle (inset a little from the overlay bounds) for view-relative overlays, and a green rectangle (inset a bit more) for document-relative overlays. * pageoverlay/overlay-large-document.html: Added. * pageoverlay/overlay-large-document-scrolled.html: Added. Tests that do the same as the -installation test, but with a larger document; the view-relative overlay should be the same size (or slightly smaller, because we have scrollbars now), but the document-relative overlay should be the size of the document. The second test scrolls to maxX, maxY, and the document-relative overlay should scroll along with it, while the view-relative overlay should remain fixed. * pageoverlay/overlay-installation-expected.txt: Added. * pageoverlay/overlay-large-document-expected.txt: Added. * pageoverlay/overlay-large-document-scrolled-expected.txt: Added. "Normal" layer tree expectations. * platform/mac-wk1/pageoverlay/overlay-installation-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-installation-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-expected.txt: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.png: Added. * platform/mac-wk1/pageoverlay/overlay-large-document-scrolled-expected.txt: Added. Expected results for WebKit1 differ for view-relative overlays, because we don't currently hook up view-relative overlays for WebKit1. * platform/mac/pageoverlay/overlay-installation-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-expected.png: Added. * platform/mac/pageoverlay/overlay-large-document-scrolled-expected.png: Added. "Normal" pixel dump expectations. Canonical link: https://commits.webkit.org/155229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 08:47:04 +00:00
<html>
<script>
window.onload = function () {
if (window.testRunner && window.internals) {
testRunner.dumpAsText(true);
internals.installMockPageOverlay("document");
internals.installMockPageOverlay("view");
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>