blob: ef5d1dae510189def3119bfe6419e8d9486424ed [file] [log] [blame] [edit]
<!-- webkit-test-runner [ textExtractionEnabled=true ] -->
<!DOCTYPE html>
<html>
<head>
<style>
body {
white-space: pre-wrap;
}
.transparent {
opacity: 0;
}
</style>
<script src="../../resources/ui-helper.js"></script>
</head>
<body>
<div>Hello <a href="https://apple.com">world</a></div>
<input placeholder="Email" value="foo@bar.net" />
<ul>
<li>Plain text in list item</li>
<li><a href="https://example.com">Link in list item</a></li>
<li><img src="../images/resources/green-256x256.jpg" alt="Green square" /></li>
</ul>
<div class="transparent"><p>This transparent text should not be extracted</p></div>
<div contenteditable="true">This is an editable area: <a href="https://webkit.org">WebKit</a> <a href="https://webkit.org/downloads">downloads</a>.</div>
<script>
addEventListener("load", async () => {
document.querySelector("input").focus();
document.querySelector("input").setSelectionRange(4, 7);
if (!window.testRunner)
return;
testRunner.dumpAsText();
testRunner.waitUntilDone();
document.body.textContent = await UIHelper.requestTextExtraction({
mergeParagraphs: true,
skipNearlyTransparentContent: true
});
testRunner.notifyDone();
});
</script>
</body>
</html>