Chromium Code Reviews| Index: Source/core/dom/Element.cpp |
| diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp |
| index 7ed385f12649b8ee4e6a28001d6003723a18e56c..449de0bc73c23771442ea3050f65d4366c9fa205 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. |
|
hayato
2015/02/20 08:46:31
Not sure how setting taxIndex attribute from JavaS
kochi
2015/02/20 09:43:05
A) isTabStop = true
B) isTabStop = false
This is
hayato
2015/02/20 10:28:45
I understand the intention, however, I'm not sure
|
| + 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; |
| +} |
| + |
| +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); |