mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 19:25:43 +00:00
2caa18fcc1
This is the closest to the spec behavior, I think, and less likely to cause interop issues, but if you prefer me to stop the 'inheritance' chain at contenteditable elements or what not I can also do that. Differential Revision: https://phabricator.services.mozilla.com/D15963 --HG-- extra : moz-landing-system : lando
26 lines
686 B
HTML
26 lines
686 B
HTML
<!doctype html>
|
|
<html class="reftest-wait">
|
|
<title>Test reference</title>
|
|
<script src="/tests/SimpleTest/EventUtils.js"></script>
|
|
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<style>
|
|
div {
|
|
-webkit-user-select: all;
|
|
-moz-user-select: all;
|
|
user-select: all;
|
|
}
|
|
</style>
|
|
<div contenteditable="true">
|
|
<div>
|
|
You should be able to select <b>all</b> of me.
|
|
</div>
|
|
</div>
|
|
<script>
|
|
SimpleTest.waitForFocus(function() {
|
|
const editable = document.querySelector('div[contenteditable="true"]');
|
|
editable.focus();
|
|
synthesizeMouseAtCenter(editable.querySelector("b"), {});
|
|
setTimeout(() => document.documentElement.removeAttribute("class"), 0);
|
|
});
|
|
</script>
|