Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
-
CI results over the last 21 days
- Manifest: editor/libeditor/tests/edit-context/mochitest.toml
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>EditContext anonymous content should not be in-flow with other document-level anonymous content</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
<style>
body { margin: 0; }
</style>
</head>
<body>
<div></div>
<script>
'use strict';
const host = document.querySelector('div');
host.editContext = new EditContext({text: 'test'});
const anonymousDiv = document.createElement('div');
const anonymousContent = SpecialPowers.wrap(document).insertAnonymousContent();
anonymousContent.root.append(anonymousDiv);
const rect = anonymousDiv.getBoundingClientRect();
is(`${rect.x},${rect.y}`, '0,0',
'EditContext anonymous content should not be in-flow with other document-level anonymous content.');
host.editContext.updateText(0, host.editContext.text.length,
'W'.repeat(2000) + '\n'.repeat(1000));
const root = document.documentElement;
is(root.scrollWidth, root.clientWidth,
'EditContext text should not add horizontal overflow to the document.');
is(root.scrollHeight, root.clientHeight,
'EditContext text should not add vertical overflow to the document.');
</script>
</body>
</html>