忘记了,还有几个小的修改
Source/core/editing/Editor.cpp
bool isSelectionInTextField(const VisibleSelection& selection)
{
HTMLTextFormControlElement* textControl = enclosingTextFormControl(selection.start());
return textControl && textControl->hasTagName(inputTag) && toHTMLInputElement(textControl)->isTextField();
}
#if ENABLE(WML)
bool isSelectionInWMLTextField(const VisibleSelection& selection)
{
WMLFormControlElement* textControl = enclosingFormControl(selection.start());
return textControl && textControl->hasTagName(WMLNames::inputTag) && toWMLInputElement(textControl)->isTextField();
}
#endif
} // namespace
// When an event handler has moved the selection outside of a text control
// we should use the target control’s selection for this editing operation.
VisibleSelection Editor::selectionForCommand(Event* event)
{
VisibleSelection selection = m_frame->selection()->selection();
if (!event)
return selection;
// If the target is a text control, and the current selection is outside of its shadow tree,
// then use the saved selection for that text control.
#if ENABLE(WML)
if (m_frame->document()->isWMLDocument()) {
WMLFormControlElement* textFormControlOfSelectionStart = enclosingFormControl(selection.start());
WMLFormControlElement* textFromControlOfTarget = isWMLFormControlElement(event->target()->toNode()) ? toWMLFormControlElement(event->target()->toNode()) : 0;
if (textFromControlOfTarget && (selection.start().isNull() || textF