// redoing it
// 2. It blatantly disregards transparent nodes. It should "work" with them
// around, but it might mess them up.
// 3. The code is too complicated
ContentView renderedContent = renderedView;
assert end == null || end.getContainer() == start.getContainer() :
"No reverting across elements";
ContentNode before = Point.nodeBefore(renderedContent, start);
Node nodeletBefore = before == null ? null : before.getImplNodelet();
Element parentNodelet;
if (nodeletBefore == null) {
parentNodelet = renderedContent.getVisibleNode(start.getContainer()).getImplNodelet().cast();
} else {
parentNodelet = nodeletBefore.getParentElement();
}
ContentNode first = start.getNodeAfter();
ContentNode last = end == null ? null : end.getNodeAfter();
assert renderedContent.getVisibleNode(first) == first;
assert renderedContent.getVisibleNode(last) == last;
assert last == null
|| renderedContent.getParentElement(first) == renderedContent.getParentElement(last)
: "First and last are expected to have same parent";
{
ContentNode node;
for (node = first; node != last; node = renderedContent.getNextSibling(node)) {
// If node is consistent, we assume the ones after are ok.
if (end == null && node.isConsistent()) {
break;
}