// Test addition: adding two equal selections, the second one should
// not be added.
testTextAddSelection("div1", 7, 9, 1); // Test ad|di|ng two...
testTextAddSelection("div1", 7, 9, 1); // Test ad|di|ng two...
testTextGetSelection("div1", 7, 9, 0);
// Test selection re-ordering: adding two selections.
// NOTE: removeSelections aSelectionIndex is from start of document.
testTextAddSelection("div3", 0, 3, 1); // |Tes|t adding 2...
testTextAddSelection("div3", 7, 9, 2); // |Tes|t ad|di|ng 2...
testTextRemoveSelection("div3", 4, 1); // Test ad|di|ng 2...
// Test extending existing selection.
// NOTE: setSelectionBounds aSelectionIndex is from start of document.
testTextAddSelection("div4", 4, 5, 1); // Test| |extending...
testTextSetSelection("div4", 4, 9, 6, 1); // Test| exte|nding...
// Test moving an existing selection.
// NOTE: setSelectionBounds aSelectionIndex is from start of document.
testTextAddSelection("div5", 1, 3, 1); // T|es|t moving...
testTextSetSelection("div5", 5, 9, 6, 1); // Test |movi|ng...
// Test adding selection to parent element.
// NOTE: If inner elements are represented as embedded chars
// we count their internal selections.
testTextAddSelection("div7", 7, 8, 5); // Test ad|d|ing...
// Test attempt to selected generated content.
// range's start is clipped to end of generated content.
testTextAddSelection("div8", 1, 8, 1);
testTextGetSelection("div8", 6, 8, 0);
// range's end is expanded to end of container hypertext.
testTextAddSelection("div8", 10, 15, 2);
testTextGetSelection("div8", 10, 23, 1);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.