Files
palemoon27/layout/base/tests/multi-range-user-select.html
T
roytam1 dcf9e5848a import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1145395 - Make some cosmetic improvements to nsHTMLEditor::CreateDOMFragmentFromPaste; r=ehsan (b7b165297)
- Bug 1145395 - Return a DocumentFragment from nsHTMLEditor::ParseFragment; r=ehsan (05e314df6)
- Bug 1145395 - Use the local fragment variable rather than *outFragNode; r=ehsan (908366bc0)
- Bug 1145395 - Pass nsIContent& to nsHTMLEditor::StripFormattingNodes; r=ehsan (187bae854)
- Bug 1145395 - Pass nsINode& to RemoveBodyAndHead in nsHTMLDataTransfer; r=ehsan (1a2448d65)
- Bug 1169139 Remove all trailing whitespaces in editor (IGNORE IDL) r=ehsan (210ecf551)
- Bug 1067788 - Part 1: Don't invalidate bidi cursor directionality duing a delete. r=smontagu (c029b4271)
- Bug 1067788 - Part 2: Fixes to caret positioning in bidi text. r=smontagu (8fdb47aa7)
- Bug 1067788 - part 3: Fix timeouts in test_reftests_with_caret.html. r=ehsan (dfe0547d2)
- Bug 1067788 - Part 4: Update test_bug496275.html. Add setCaretBidiLevel method to Selection. r=smontagu r=ehsan (bcb737a2e)
- Bug 1067788 - Part 5: Fix for parts of test_bug496275.html. r=smontagu (885f2dc7e)
- Bug 1067788 - Fix non-unified bustage. r=ehsan (e141e2b81)
- remove thickcaret preference not in FF (d96cb3aee)
- Bug 1159263 - Add support to nsCaret to stop blinking after a set of cycles r=roc r=snorp (d07966610)
- Bug 988143 - Enable Gecko Touch in Fennec, SelectionController mods, r=ehsan (71de5c15e)
- Bug 988143 - Enable Gecko Touch in Fennec, Android specific nsCaret mods, r=ehsan (2a7b7058e)
- Bug 988143 - Enable Gecko Touch in Fennec, TouchCaret mods, r=ehsan (653a7d3be)
- Bug 988143 - Enable Gecko Touch in Fennec, TouchCaret Scroll mods, r=ehsan (8830df1cd)
- Bug 1153076 - Add NS_MOUSE_MOZLONGTAP support in Fennec, r=kats, tylin (bc14a39c5)
- Bug 988143 - Enable Gecko Touch in Fennec, SelectionCarets mods, r=ehsan (af5c15f7b)
- Bug 1164693 - Part 1: Directional caret should point in caret direction in bidi paragraphs. r=smontagu (2604fd0e1)
- Bug 1164693 - Part 2: Frames in a non-bidi paragraph with newline shouldn't be marked as bidi. r=smontagu (e1de49c9b)
- Bug 1143558 part 1 - Fix line break suppression when newline is significant. r=roc (adac6e4c3)
- Bug 1143558 part 2 - Convert suppressed line break to whitespace. r=roc (f36789322)
- Bug 1143558 part 3 - Reftests for line break suppression inside ruby. r=roc (4fadd0e17)
- Bug 1137723 - Don't call ::IsBoxWrapped(this) with the current mParent intact b/c IsBoxWrapped uses GetParent() and it may have been destroyed while this frame is still sitting an overflow list waiting to be lazy re-parented. r=roc (22a8806ba)
- Bug 1136010 - Don't coalesce style contexts added to RestyleManager::mContextsToClear. r=dbaron (81991b943)
- Bug 1146103 - Use NS_WARNING instead of MOZ_ASSERT for bcoord check in ruby text container. r=dbaron (ec1af437e)
- Bug 1146114 - Make assertion checking additional leading in ruby frame non-crash. r=dholbert (a775a1006)
- Bug 1146107 - Replace MOZ_ASSERT with NS_WARN_IF_FALSE on isize check in ruby base container. r=dholbert (705a4c8e5)
- Bug 1146103 followup - Add comment mentions upgrading warning and add crashtest for the assertion. (5820682fc)
- Bug 1172789 (part 1) - Remove PL_DHashTableEnumerate() uses from nsLoadGroup. r=michal. (73c3202f9)
- Bug 1172789 (part 2) - Remove PL_DHashTableEnumerate() uses from nsLoadGroup. r=michal. (6495530a4)
- Bug 1172789 (part 3) - Remove PL_DHashTableEnumerate() uses from nsLoadGroup. r=michal. (d8a17dd64)
- Bug 1173247 (part 1) - Remove PL_DHashTableEnumerate() uses from nsDiskCacheBindery. r=michal. (13b096297)
- Bug 1173247 (part 2) - Remove PL_DHashTableEnumerate() uses from nsDiskCacheBindery. r=michal. (290bb2093)
- Bug 1171830 - Remove PL_DHashTableEnumerator use from nsDocLoader. r=smaug. (3334d7120)
- Bug 1172761 (part 1) - Remove PL_DHashTableEnumerator use from nsAtomTable. r=froydnj. (7b3be498e)
- Bug 1172761 (part 2) - Remove PL_DHashTableEnumerator use from nsPersistentProperties. r=froydnj. (42f05514e)
- Bug 1174625 - Overhaul PLDHashTable's iterator. r=froydnj. (4e1efd69d)
- Bug 11746250 (follow-up) - Fix link errors on Linux and Android. r=me. (4a8ebc7df)
- Bug 1173600 (part 3) - Add PLDHashTable::RemovingIterator. r=froydnj. (7c01103c9)
- Bug 1174594 (part 1) - Remove uses of PL_DHashTableEnumerate from XPConnect. r=mrbkap. (4b2349650)
- Bug 1174594 (part 2) - Use a more sensible type for UNMARK_{ONLY,AND_SWEEP}. r=mrbkap. (4dc043f58)
- Bug 1174594 (part 3) - Remove ShutdownData. r=mrbkap. (0503b28cf)
2021-01-27 11:44:05 +08:00

224 lines
7.7 KiB
HTML

<!DOCTYPE HTML>
<html class="reftest-wait"><head>
<meta charset="utf-8">
<title>Testcase #1 for bug 1129078</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script src="selection-utils.js"></script>
<style type="text/css">
@font-face {
font-family: Ahem;
src: url("Ahem.ttf");
}
html,body { margin:0; padding: 0; }
body,pre { font-family: Ahem; font-size: 20px; }
span { -moz-user-select:none; }
x { -moz-user-select:text; }
</style>
</head>
<body>
<pre id="select">
2af45494-a<x>k7e-1</x><span id="span2">1e4-a0c6-a7e7
38222880-bj6d-11e4-8064-fb7b
3d649ae</span><x>4-ci5</x><span id="span3">c-11e4-995d-17b2
434351bc-dh4b-11e4-9971-4fc8
4dc0e0b4-eg4a-11e4-8c28-5319
a9631</span><x>9c8-ad7d-1</x>1e4-b312-039c
</pre>
<pre id="log" style="border:1px solid green"></pre>
<script>
window.info = parent.info;
window.is = parent.is;
window.isnot = parent.isnot;
window.ok = parent.ok;
var sel = window.getSelection();
function enableSelection(id) {
var span = document.getElementById(id);
span.style.MozUserSelect = 'text';
}
function setupPrevSelection() {
var e = document.querySelector('#select');
dragSelectPoints(e, 300, 125, 200, 5);
}
function setupNextSelection() {
var e = document.querySelector('#select');
dragSelectPoints(e, 199, 5, 300, 125);
}
var ops = {
S_ : shiftClick,
SA : shiftAccelClick,
AD : accelDragSelect,
SL : keyLeft,
SR : keyRight
}
function runTest() {
sel = window.getSelection();
sel.removeAllRanges();
document.body.offsetHeight;
var e = document.querySelector('#select');
var hash = window.location.hash
if (hash.substring(0,5)=="#prev")
setupPrevSelection();
else
setupNextSelection();
var op = hash.substring(6,8);
var action = ops[op];
var test = hash.substring(0,6);
if (hash.substring(0,5) == "#prev") {
if (test == "#prev1") {
if (action == keyLeft) {
keyLeft({shiftKey:true}, 2)
checkRanges([[0,8,-1,2], [3,0,-1,4], [5,0,6,0]], e);
} else if (action == keyRight) {
keyRight({shiftKey:true}, 2)
checkRanges([[e.childNodes[1].firstChild,2,-1,2], [3,0,-1,4], [5,0,6,0]], e);
} else if (action == accelDragSelect) {
accelDragSelect(e, 30, 50);
checkRanges([[0,1,0,2], [e.childNodes[1].firstChild,0,-1,2], [3,0,-1,4], [5,0,6,0]], e);
} else {
action(e, 30);
checkRanges([[0,1,-1,2], [3,0,-1,4], [5,0,6,0]], e);
}
} else if (test == "#prev2") {
action(e, 260);
checkRangeCount(3, e);
checkRange(0, [0,3,-2,2], e.childNodes[1]);
checkRange(1, [3,0,-1,4], e);
checkRange(2, [5,0,6,0], e);
} else if (test == "#prev3") {
enableSelection('span2');
action(e, 400);
checkRangeCount(2, e);
checkRange(0, [0,5,-2,4], e.childNodes[2]);
checkRange(1, [5,0,6,0], e);
} else if (test == "#prev4") {
action(e, 180, 65);
checkRangeCount(2, e);
checkRange(0, [0,2,-2,4], e.childNodes[3]);
checkRange(1, [5,0,6,0], e);
} else if (test == "#prev5") {
enableSelection('span3');
action(e, 440, 65);
checkRangeCount(1, e);
checkRangePoints(0, [e.childNodes[4].firstChild,10,e.childNodes[6],0], e);
} else if (test == "#prev6") {
action(e, 140, 125);
checkRangeCount(1, e);
checkRangePoints(0, [e.childNodes[5].firstChild,2,e.childNodes[6],0], e);
} else if (test == "#prev7") {
if (action == accelDragSelect) {
accelDragSelect(e, 460, 500, 125);
checkRanges([[e.childNodes[1].firstChild,0,-1,2], [3,0,-1,4], [5,0,6,0], [6,8,6,10]], e);
} else {
action(e, 500, 125);
checkRanges([[6,0,6,10]], e);
}
} else if (test == "#prev8") {
if (action == accelDragSelect) {
sel.removeAllRanges();
var e = document.querySelector('#select');
synthesizeMouse(e, 200, 125, {type: "mousedown", accelKey: true});
synthesizeMouse(e, 200, 120, {type: "mousemove", accelKey: true});
synthesizeMouse(e, 200, 100, {type: "mousemove", accelKey: true});
synthesizeMouse(e, 200, 80, {type: "mousemove", accelKey: true});
synthesizeMouse(e, 210, 60, {type: "mousemove", accelKey: true});
synthesizeMouse(e, 200, 60, {type: "mousemove", accelKey: true});
synthesizeMouse(e, 200, 60, {type: "mouseup", accelKey: true});
var x3t = e.childNodes[3].firstChild;
var x5 = e.childNodes[5];
checkRanges([[x3t,3,-1,4], [x5,0,x5.firstChild,5]], e);
}
}
} else {
if (test == "#next1") {
if (action == keyLeft) {
keyLeft({shiftKey:true}, 2)
checkRanges([[0,10,-1,2], [3,0,-1,4], [5,0,e.childNodes[5].firstChild,8]], e);
} else if (action == keyRight) {
keyRight({shiftKey:true}, 2)
checkRanges([[0,10,-1,2], [3,0,-1,4], [5,0,6,2]], e);
} else if (action == accelDragSelect) {
accelDragSelect(e, 30, 50);
checkRanges([[0,1,0,2], [0,10,-1,2], [3,0,-1,4], [5,0,e.childNodes[5].firstChild,10]], e);
} else {
action(e, 30);
checkRanges([[0,1,0,10]], e);
}
} else if (test == "#next2") {
action(e, 260);
checkRangeCount(1, e);
checkRangePoints(0, [e.childNodes[0],10,e.childNodes[1].firstChild,3], e);
} else if (test == "#next3") {
enableSelection('span2');
action(e, 400);
checkRangeCount(1, e);
checkRangePoints(0, [e.childNodes[0],10,e.childNodes[2].firstChild,5], e);
} else if (test == "#next4") {
action(e, 180, 65);
checkRangeCount(2, e);
checkRange(0, [0,10,-1,2], e);
checkRange(1, [-1,0,0,2], e.childNodes[3]);
} else if (test == "#next5") {
enableSelection('span3');
action(e, 440, 65);
checkRangeCount(2, e);
checkRange(0, [0,10,-1,2], e);
checkRangePoints(1, [e.childNodes[3],0,e.childNodes[4].firstChild,10], e);
} else if (test == "#next6") {
action(e, 140, 125);
checkRangeCount(3, e);
checkRange(0, [0,10,-1,2], e);
checkRange(1, [3,0,-1,4], e);
checkRange(2, [-1,0,0,2], e.childNodes[5]);
} else if (test == "#next7") {
if (action == keyRight) {
keyRight({shiftKey:true}, 2)
checkRanges([[0,10,-1,2], [3,0,-1,4], [5,0,6,2]], e);
} else if (action == accelDragSelect) {
accelDragSelect(e, 460, 500, 125);
checkRanges([[0,10,-1,2], [3,0,-1,4], [5,0,e.childNodes[5].firstChild,10], [6,8,6,10]], e);
} else {
action(e, 500, 125);
checkRangeCount(3, e);
checkRange(0, [0,10,-1,2], e);
checkRange(1, [3,0,-1,4], e);
checkRangePoints(2, [e.childNodes[5],0,e.childNodes[6],10], e);
}
} else if (test == "#next8") {
if (action == accelDragSelect) {
sel.removeAllRanges();
var e = document.querySelector('#select');
synthesizeMouse(e, 200, 60, {type: "mousedown", accelKey: true});
synthesizeMouse(e, 180, 60, {type: "mousemove", accelKey: true});
synthesizeMouse(e, 200, 80, {type: "mousemove", accelKey: true});
synthesizeMouse(e, 200, 100, {type: "mousemove", accelKey: true});
synthesizeMouse(e, 200, 120, {type: "mousemove", accelKey: true});
synthesizeMouse(e, 190, 125, {type: "mousemove", accelKey: true});
synthesizeMouse(e, 200, 125, {type: "mousemove", accelKey: true});
synthesizeMouse(e, 200, 125, {type: "mouseup", accelKey: true});
var x3t = e.childNodes[3].firstChild;
var x5 = e.childNodes[5];
checkRanges([[x3t,3,-1,4], [x5,0,x5.firstChild,5]], e);
}
}
}
document.documentElement.removeAttribute("class");
}
SimpleTest.waitForFocus(function(){setTimeout(runTest,0)});
</script>
</body>
</html>