haikuwebkit/LayoutTests/fast/harness/render-tree-as-text-options...

55 lines
1.3 KiB
HTML
Raw Permalink Normal View History

Make it possible to control the renderTreeAsText output by setting options on testRunner https://bugs.webkit.org/show_bug.cgi?id=197133 Reviewed by Sam Weinig. Add testRunner.setRenderTreeDumpOptions() and expose the subset of RenderAsTextFlag flags that make sense in testing (those that don't dump unstable data like addresses), and plumb these flags through the various framework layers. Convert RenderAsTextBehavior to an OptionSet<RenderAsTextFlag>. Fix code generation in WebKitTestRunner to generate bindings for IDL const values, and hand-code DumpRenderTree bindings. Some cleanup of the TestRunners, using member initializers. Source/WebCore: Test: fast/harness/render-tree-as-text-options.html * rendering/RenderLayer.cpp: (WebCore::showLayerTree): * rendering/RenderTreeAsText.cpp: (WebCore::RenderTreeAsText::writeRenderObject): (WebCore::writeDebugInfo): (WebCore::write): (WebCore::writeLayer): (WebCore::writeLayerRenderers): (WebCore::writeLayers): (WebCore::externalRepresentation): * rendering/RenderTreeAsText.h: (WebCore::externalRepresentation): (WebCore::write): (WebCore::writeDebugInfo): (): Deleted. * rendering/svg/SVGRenderTreeAsText.cpp: (WebCore::writePositionAndStyle): (WebCore::writeStandardPrefix): (WebCore::writeChildren): (WebCore::writeSVGResourceContainer): (WebCore::writeSVGContainer): (WebCore::write): (WebCore::writeSVGText): (WebCore::writeSVGInlineText): (WebCore::writeSVGImage): (WebCore::writeSVGGradientStop): (WebCore::writeResources): * rendering/svg/SVGRenderTreeAsText.h: Source/WebKit: * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageCopyRenderTreeExternalRepresentation): * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::toRenderAsTextFlags): (WebKit::WebPage::renderTreeExternalRepresentation const): (WebKit::WebPage::renderTreeExternalRepresentationForPrinting const): * WebProcess/WebPage/WebPage.h: Source/WebKitLegacy/mac: * Misc/WebCoreStatistics.h: * Misc/WebCoreStatistics.mm: (-[WebFrame renderTreeAsExternalRepresentationForPrinting]): (toRenderAsTextFlags): (-[WebFrame renderTreeAsExternalRepresentationWithOptions:]): (-[WebFrame renderTreeAsExternalRepresentationForPrinting:]): Deleted. Source/WebKitLegacy/win: * Interfaces/IWebFramePrivate.idl: * WebFrame.cpp: (toRenderAsTextFlags): (WebFrame::renderTreeAsExternalRepresentation): (WebFrame::renderTreeAsExternalRepresentationForPrinting): * WebFrame.h: Tools: * DumpRenderTree/TestRunner.cpp: (TestRunner::TestRunner): (setRenderTreeDumpOptionsCallback): (TestRunner::staticFunctions): (TestRunner::setRenderTreeDumpOptions): * DumpRenderTree/TestRunner.h: (TestRunner::renderTreeDumpOptions const): * DumpRenderTree/mac/DumpRenderTree.mm: (dump): * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: (WTR::InjectedBundlePage::dump): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::TestRunner): (WTR::TestRunner::setRenderTreeDumpOptions): * WebKitTestRunner/InjectedBundle/TestRunner.h: (WTR::TestRunner::renderTreeDumpOptions const): LayoutTests: * fast/harness/render-tree-as-text-options-expected.txt: Added. * fast/harness/render-tree-as-text-options.html: Added. * resources/testrunner-constants.js: Added. Canonical link: https://commits.webkit.org/211459@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244599 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-04-24 18:25:26 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
body {
height: 500px;
}
.overflowing {
width: 200px;
height: 250px;
}
.contents {
position: relative;
z-index: 1;
height: 400px;
}
.negative-z {
position: absolute;
width: 100px;
height: 50px;
z-index: -1;
border: 1px solid black;
}
.composited {
transform: translateZ(0);
}
</style>
<script>
if (window.testRunner) {
testRunner.setRenderTreeDumpOptions(testRunner.RENDER_TREE_SHOW_ALL_LAYERS
| testRunner.RENDER_TREE_SHOW_LAYER_NESTING
| testRunner.RENDER_TREE_SHOW_COMPOSITED_LAYERS
| testRunner.RENDER_TREE_SHOW_OVERFLOW
| testRunner.RENDER_TREE_SHOW_SVG_GEOMETRY
| testRunner.RENDER_TREE_SHOW_LAYER_FRAGMENTS);
}
</script>
</head>
<body>
<div class="overflowing">
<div class="contents"></div>
</div>
<div class="negative-z composited"></div>
<div style="height: 200px">
<svg>
<rect x="10" y="20" width="100" height="100" fill="blue"/>
</svg>
</div>
</body>
</html>