| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
| 5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 6 * (C) 2007 David Smith (catfish.man@gmail.com) | 6 * (C) 2007 David Smith (catfish.man@gmail.com) |
| 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. |
| 8 * (C) 2007 Eric Seidel (eric@webkit.org) | 8 * (C) 2007 Eric Seidel (eric@webkit.org) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 2407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2418 // animations) is difficult, for now we match IE's heuristic and bring | 2418 // animations) is difficult, for now we match IE's heuristic and bring |
| 2419 // up the keyboard if there's been any gesture since load. | 2419 // up the keyboard if there's been any gesture since load. |
| 2420 document().page()->chromeClient().showImeIfNeeded(); | 2420 document().page()->chromeClient().showImeIfNeeded(); |
| 2421 } | 2421 } |
| 2422 } | 2422 } |
| 2423 | 2423 |
| 2424 void Element::updateFocusAppearance(SelectionBehaviorOnFocus selectionBehavior) | 2424 void Element::updateFocusAppearance(SelectionBehaviorOnFocus selectionBehavior) |
| 2425 { | 2425 { |
| 2426 if (selectionBehavior == SelectionBehaviorOnFocus::None) | 2426 if (selectionBehavior == SelectionBehaviorOnFocus::None) |
| 2427 return; | 2427 return; |
| 2428 if (isRootEditableElement()) { | 2428 if (isRootEditableElement(*this)) { |
| 2429 LocalFrame* frame = document().frame(); | 2429 LocalFrame* frame = document().frame(); |
| 2430 if (!frame) | 2430 if (!frame) |
| 2431 return; | 2431 return; |
| 2432 | 2432 |
| 2433 // When focusing an editable element in an iframe, don't reset the selec
tion if it already contains a selection. | 2433 // When focusing an editable element in an iframe, don't reset the selec
tion if it already contains a selection. |
| 2434 if (this == frame->selection().rootEditableElement()) | 2434 if (this == frame->selection().rootEditableElement()) |
| 2435 return; | 2435 return; |
| 2436 | 2436 |
| 2437 // FIXME: We should restore the previous selection if there is one. | 2437 // FIXME: We should restore the previous selection if there is one. |
| 2438 VisibleSelection newSelection = VisibleSelection(firstPositionInOrBefore
Node(this), TextAffinity::Downstream); | 2438 VisibleSelection newSelection = VisibleSelection(firstPositionInOrBefore
Node(this), TextAffinity::Downstream); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2458 } | 2458 } |
| 2459 | 2459 |
| 2460 bool Element::supportsFocus() const | 2460 bool Element::supportsFocus() const |
| 2461 { | 2461 { |
| 2462 // FIXME: supportsFocus() can be called when layout is not up to date. | 2462 // FIXME: supportsFocus() can be called when layout is not up to date. |
| 2463 // Logic that deals with the layoutObject should be moved to layoutObjectIsF
ocusable(). | 2463 // Logic that deals with the layoutObject should be moved to layoutObjectIsF
ocusable(). |
| 2464 // But supportsFocus must return true when the element is editable, or else | 2464 // But supportsFocus must return true when the element is editable, or else |
| 2465 // it won't be focusable. Furthermore, supportsFocus cannot just return true | 2465 // it won't be focusable. Furthermore, supportsFocus cannot just return true |
| 2466 // always or else tabIndex() will change for all HTML elements. | 2466 // always or else tabIndex() will change for all HTML elements. |
| 2467 return hasElementFlag(TabIndexWasSetExplicitly) | 2467 return hasElementFlag(TabIndexWasSetExplicitly) |
| 2468 || isRootEditableElement() | 2468 || isRootEditableElement(*this) |
| 2469 || (isShadowHost(this) && authorShadowRoot() && authorShadowRoot()->dele
gatesFocus()) | 2469 || (isShadowHost(this) && authorShadowRoot() && authorShadowRoot()->dele
gatesFocus()) |
| 2470 || supportsSpatialNavigationFocus(); | 2470 || supportsSpatialNavigationFocus(); |
| 2471 } | 2471 } |
| 2472 | 2472 |
| 2473 bool Element::supportsSpatialNavigationFocus() const | 2473 bool Element::supportsSpatialNavigationFocus() const |
| 2474 { | 2474 { |
| 2475 // This function checks whether the element satisfies the extended criteria | 2475 // This function checks whether the element satisfies the extended criteria |
| 2476 // for the element to be focusable, introduced by spatial navigation feature
, | 2476 // for the element to be focusable, introduced by spatial navigation feature
, |
| 2477 // i.e. checks if click or keyboard event handler is specified. | 2477 // i.e. checks if click or keyboard event handler is specified. |
| 2478 // This is the way to make it possible to navigate to (focus) elements | 2478 // This is the way to make it possible to navigate to (focus) elements |
| (...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3738 | 3738 |
| 3739 DEFINE_TRACE_WRAPPERS(Element) | 3739 DEFINE_TRACE_WRAPPERS(Element) |
| 3740 { | 3740 { |
| 3741 if (hasRareData()) { | 3741 if (hasRareData()) { |
| 3742 visitor->traceWrappers(elementRareData()); | 3742 visitor->traceWrappers(elementRareData()); |
| 3743 } | 3743 } |
| 3744 ContainerNode::traceWrappers(visitor); | 3744 ContainerNode::traceWrappers(visitor); |
| 3745 } | 3745 } |
| 3746 | 3746 |
| 3747 } // namespace blink | 3747 } // namespace blink |
| OLD | NEW |