mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
353b3ac952
The focus event listener in editor is system group, so synthesizeKey and/or synthesizeMouse doesn't work on focus event since editor doesn't initialize selection yet. So use setTimeout to work synthesizeKey and etc well. Differential Revision: https://phabricator.services.mozilla.com/D15926 --HG-- extra : rebase_source : bbedd32278c94f009c7ab0e9d685979887b2f031
23 lines
675 B
HTML
23 lines
675 B
HTML
<!DOCTYPE html>
|
|
<html class="reftest-wait">
|
|
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<script src="/tests/SimpleTest/EventUtils.js"></script>
|
|
<script>
|
|
function focused() {
|
|
document.documentElement.removeAttribute("class");
|
|
}
|
|
</script>
|
|
<body>
|
|
<div contenteditable spellcheck="false" onfocus="focused()"
|
|
style="outline: none">foo<span contenteditable=false
|
|
style="-moz-user-select: none">bar</span>baz</div>
|
|
<script>
|
|
SimpleTest.waitForFocus(() => {
|
|
SimpleTest.executeSoon(() => {
|
|
synthesizeMouseAtCenter(document.querySelector("span"), {});
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|