We'll use this function to position the caret when the user taps a text
input control.
Very little of the code in this patch is actually new. Most of it is
restoring code that we previously removed from the engine. I've made
some small changes to the restored code to handle the lack of a DOM. The
only major change is to RenderObject::createPositionWithAffinity, which
now just returns the values it captures instead of trying to compute a
DOM position.
TextAffinity and TextPosition are lifted from package:flutter. Once this
patch rolls into package:flutter, I'll remove the declarations there.
Remove all code relating to shadow trees, insertion points, shadow
boundaries, traversing composed trees, distribution, template
documents, custom elements, registering elements, element registries,
element factories, shadow roots, etc.
Remove the following features from the IDLs and from the binding
generators: CustomElementCallbacks, Reflect*, EventHandler.
Remove the CSS custom pseudo-element concept, since we no longer have
a UA style sheet worth talking about, no longer have shadow trees or
custom elements, no longer use pseudo-elements, and generally
therefore don't use this code at all.
This removes the bulk of core/editing/*.
The following files remain, because they might be useful yet:
EditingBoundary.h
FindOptions.h
htmlediting.cpp
htmlediting.h
PlainTextRange.cpp
PlainTextRange.h
PositionWithAffinity.cpp
PositionWithAffinity.h
RenderedPosition.cpp
RenderedPosition.h
TextAffinity.h
TextGranularity.h
TextIterator.cpp
TextIterator.h
VisiblePosition.cpp
VisiblePosition.h
VisibleSelection.cpp
VisibleSelection.h
VisibleUnits.cpp
VisibleUnits.h
In addition to remove obviously editing-related stuff like
"ApplyBlockElementCommand.cpp" and "InsertLineBreakCommand.cpp", this
also removes the DOM side of selection, all the caret management and
painting code, composition support (IME) including the relevant
events, spelling checker support, and the undo stack.
Outside the core/editing/* directory, I also deleted the EditorClient,
SpellCheckerClient, and EmptyClients classes. The other changes
outside of editing/ are mostly just about removing mentions of the
selection or carets.
I tried to leave the code for _painting_ selections and composition
runs, though that code is mostly disconnected now.