Example #1
0
bool SVGAElement::isFocusable() const
{
    if (isContentEditable())
        return SVGStyledTransformableElement::isFocusable();

    // FIXME: Even if we are not visible, we might have a child that is visible.
    // Dave wants to fix that some day with a "has visible content" flag or the like.
    if (!renderer() || !(renderer()->style()->visibility() == VISIBLE))
        return false;

    return !renderer()->absoluteClippedOverflowRect().isEmpty();
}
void AppendNodeCommand::doApply()
{
    ASSERT(m_childToAppend);
    ASSERT(m_parentNode);
    // If the child to append is already in a tree, appending it will remove it from it's old location
    // in an non-undoable way.  We might eventually find it useful to do an undoable remove in this case.
    ASSERT(!m_childToAppend->parent());
    ASSERT(isContentEditable(m_parentNode.get()) || enclosingNodeOfType(m_parentNode.get(), &isContentEditable) || !m_parentNode->attached());

    ExceptionCode ec = 0;
    m_parentNode->appendChild(m_childToAppend.get(), ec);
    ASSERT(ec == 0);
}
Example #3
0
void HTMLElement::handleKeypressEvent(KeyboardEvent* event)
{
    if (!isSpatialNavigationEnabled(document().frame()) || !supportsFocus())
        return;
    // if the element is a text form control (like <input type=text> or <textarea>)
    // or has contentEditable attribute on, we should enter a space or newline
    // even in spatial navigation mode instead of handling it as a "click" action.
    if (isTextFormControl() || isContentEditable())
        return;
    int charCode = event->charCode();
    if (charCode == '\r' || charCode == ' ') {
        dispatchSimulatedClick(event);
        event->setDefaultHandled();
    }
}
Example #4
0
bool HTMLElement::isFocusable() const
{
    return Element::isFocusable() || (isContentEditable() && parent() && !parent()->isContentEditable());
}
Example #5
0
bool SVGAElement::supportsFocus() const
{
    if (isContentEditable())
        return SVGStyledTransformableElement::supportsFocus();
    return true;
}
Example #6
0
bool SVGAElement::supportsFocus() const
{
    if (isContentEditable())
        return SVGStyledTransformableElement::supportsFocus();
    return isFocusable() || (document() && !document()->haveStylesheetsLoaded());
}