*/
private void startTypingSequence(Point.Tx<Node> previousSelectionStart)
throws HtmlMissing, HtmlInserted {
Text node = previousSelectionStart.getContainer().cast();
ContentView renderedContent = renderedContentView;
HtmlView filteredHtml = filteredHtmlView;
try {
// This might throw an exception
ContentTextNode wrapper = manager.findTextWrapper(node, true);
// No exception -> already a wrapper for this node (we're editing some existing text)
firstWrapper = wrapper;
lastWrapper = wrapper;
checkNeighbouringTextNodes(previousSelectionStart);
contentRange = RestrictedRange.around(renderedContent, firstWrapper, lastWrapper);
// Ensure methods we call on the text node operate on the same view as us
assert wrapper.getFilteredHtmlView() == filteredHtml;
Node htmlNodeBefore = filteredHtml.getPreviousSibling(firstWrapper.getImplNodelet());
Element htmlParent = filteredHtml.getParentElement(node);
ContentNode cnodeAfter = contentRange.getNodeAfter();
Node htmlNodeAfter = cnodeAfter == null ? null : cnodeAfter.getImplNodelet();
htmlRange = RestrictedRange.between(
htmlNodeBefore, Point.inElement(htmlParent, htmlNodeAfter));
if (partOfMutatingRange(filteredHtml.asText(previousSelectionStart.getContainer()))) {
// This must be true if getWrapper worked correctly. Program error
// otherwise (not browser error)
assert firstWrapper.getImplNodelet() == htmlRange.getStartNode(filteredHtml);
// NOTE(danilatos): We are asking the firstWrapper to give us the offset of