const AtomicString& HTMLTextFormControlElement::selectionDirection() const
{
    if (!isTextFormControl())
        return directionString(SelectionHasNoDirection);
    if (document()->focusedNode() != this && hasCachedSelection())
        return directionString(m_cachedSelectionDirection);

    return directionString(computeSelectionDirection());
}
const AtomicString& HTMLTextFormControlElement::selectionDirection() const
{
    if (!isTextFormControl())
        return directionString(SelectionHasNoDirection);
#if defined(S_CLEAR_SELECTION_ONAUTOFOCUS)
    if (document().focusedElement() != this)
#else
    if (document().focusedElement() != this && hasCachedSelection())
#endif
        return directionString(m_cachedSelectionDirection);

    return directionString(computeSelectionDirection());
}
Пример #3
0
std::string Grid::buildMoveString() const {
    std::stringstream stream;
    for (auto move : _moves) {
        stream << std::to_string(move.first) << directionString(move.second) << " ";
    }
    return stream.str();
}