* @param event a dom mutation event
*/
public void handleMutationEvent(SignalEvent event) {
// TODO(user): Do we care about other types of events?
if (event.getType().equals("DOMNodeRemoved")) {
Node target = event.getTarget();
boolean ignorableWhenEmpty = DomHelper.isTextNode(target)
|| !NodeManager.hasBackReference(target.<Element>cast());
if (ignorableWhenEmpty && entries.isEmpty()) {
// If it's a text node, or a non-backreferenced element,
// and we don't already have entries, then we just ignore it as regular typing. Ok.
} else {
EditorStaticDeps.logger.trace().log("REVERT REMOVAL: " + (DomHelper.isTextNode(target)
? target.<Text>cast().getData() : target.<Element>cast().getTagName()));
addEntry(new RemovalEntry(target, target.getParentElement(), target.getNextSibling(),
ignorableWhenEmpty));
}
}
}