Chromium Code Reviews| Index: Source/core/dom/Element.cpp |
| diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp |
| index 0308c86a5a355803496dc8aa5c298f7c7fcef8b5..de71ef60a97a71d80c5c03c445746d0e56d5e148 100644 |
| --- a/Source/core/dom/Element.cpp |
| +++ b/Source/core/dom/Element.cpp |
| @@ -149,6 +149,7 @@ PassRefPtrWillBeRawPtr<Element> Element::create(const QualifiedName& tagName, Do |
| Element::Element(const QualifiedName& tagName, Document* document, ConstructionType type) |
| : ContainerNode(document, type) |
| , m_tagName(tagName) |
| + , m_isTabStop(true) |
| { |
| } |
| @@ -217,6 +218,8 @@ void Element::clearTabIndexExplicitlyIfNeeded() |
| void Element::setTabIndexExplicitly(short tabIndex) |
| { |
| ensureElementRareData().setTabIndexExplicitly(tabIndex); |
| + // isTabStop is overridden by setting tabindex. |
| + m_isTabStop = (tabIndex >= 0); |
| } |
| void Element::setTabIndex(int value) |
| @@ -2250,6 +2253,17 @@ bool Element::isMouseFocusable() const |
| return isFocusable(); |
| } |
| +bool Element::isTabStop() const |
| +{ |
| + // Any element which never supports focus will always return false. |
| + return supportsFocus() ? m_isTabStop : false; |
|
vivekg
2015/02/13 10:28:36
nit: return supportsFocus() && m_isTabStop;
kochi
2015/02/19 06:10:47
Done.
|
| +} |
| + |
| +void Element::setIsTabStop(bool flag) |
| +{ |
| + m_isTabStop = flag; |
| +} |
| + |
| void Element::dispatchFocusEvent(Element* oldFocusedElement, WebFocusType type) |
| { |
| RefPtrWillBeRawPtr<FocusEvent> event = FocusEvent::create(EventTypeNames::focus, false, false, document().domWindow(), 0, oldFocusedElement); |