// 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);
<div id="div0">Test selection count</div>
</br>
<div id="div1">Test adding two equal selections </div>
<div id="div2">Test adding 3 selections one adjacent </div>
<div id="div3">Test adding 2 selections, remove first one </div>
<div id="div4">Test extending a selection </div>
<div id="div5">Test moving a selection </div>
</br>
<div id="div7">Test adding selections to parent element
<div id="div71">Test adding selections to inner element1 </div>
<div id="div72">Test adding selections to inner element2 </div>
</div>
<style>
#div8:before {
content: 'hello ';
}
#div8:after {
content: ', i love you';
}
</style>
<div id="div8">world</div>
<ol>
<li id="li">Number one</li>
</ol>
</body>
</html>
Messung V0.5
¤ 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.0.10Bemerkung:
(vorverarbeitet)
¤
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.