*/
public void somethingHappened(Point<Node> previousSelectionStart)
throws HtmlMissing, HtmlInserted {
Preconditions.checkNotNull(previousSelectionStart,
"Typing extractor notified with null selection");
Text node = previousSelectionStart.isInTextNode()
? previousSelectionStart.getContainer().<Text>cast()
: null;
// Attempt to associate our location with a node
// This should be a last resort, ideally we should be given selections
// in the correct text node, when the selection is at a text node boundary
if (node == null) {
HtmlView filteredHtml = filteredHtmlView;
Node nodeBefore = Point.nodeBefore(filteredHtml, previousSelectionStart.asElementPoint());
Node nodeAfter = previousSelectionStart.getNodeAfter();
//TODO(danilatos): Usually we would want nodeBefore as a preference, but
// not always...
if (nodeBefore != null && DomHelper.isTextNode(nodeBefore)) {
node = nodeBefore.cast();
previousSelectionStart = Point.<Node>inText(node, 0);
} else if (nodeAfter != null && DomHelper.isTextNode(nodeAfter)) {
node = nodeAfter.cast();
previousSelectionStart = Point.<Node>inText(node, node.getLength());
}
}
TypingState t = findTypingState(previousSelectionStart);