Bug 1132768 - Consider non-editable regions in contenteditable elements as user-select:all even if the editable region doesn't have the focus; r=roc

This commit is contained in:
Ehsan Akhgari 2015-02-23 18:18:16 -05:00
parent bca7e7be13
commit c86a381d66
5 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<script>
function test() {
getSelection().selectAllChildren(document.querySelector("span"));
}
</script>
<body onload="test()">
<div>foo<span>bar</span>baz</div>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html class="reftest-wait">
<script src="/tests/SimpleTest/EventUtils.js"></script>
<script>
function test() {
synthesizeMouseAtCenter(document.querySelector("span"), {});
}
function focused() {
document.documentElement.removeAttribute("class");
}
</script>
<body onload="setTimeout(test, 0)">
<div contenteditable spellcheck="false" onfocus="focused()"
style="outline: none">foo<span contenteditable=false>bar</span>baz</div>
</body>
</html>

View File

@ -70,6 +70,8 @@ support-files =
bug1123067-2.html
bug1123067-3.html
bug1123067-ref.html
bug1132768-1.html
bug1132768-1-ref.html
selection-utils.js
multi-range-user-select.html
multi-range-user-select-ref.html

View File

@ -152,6 +152,7 @@ var tests = [
// [ 'bug1123067-1.html' , 'bug1123067-ref.html' ] , TODO: bug 1129205
[ 'bug1123067-2.html' , 'bug1123067-ref.html' ] ,
[ 'bug1123067-3.html' , 'bug1123067-ref.html' ] ,
[ 'bug1132768-1.html' , 'bug1132768-1-ref.html'] ,
function() {SpecialPowers.pushPrefEnv({'clear': [['touchcaret.enabled']]}, nextTest);} ,
];

View File

@ -9,7 +9,7 @@
cursor: text;
}
*|*:focus:-moz-read-write :-moz-read-only {
*|*:-moz-read-write :-moz-read-only {
-moz-user-select: all !important;
}