Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Unified Diff: Source/core/dom/Element.cpp

Issue 917613004: Add isTabStop attribute to Element (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/Element.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/Element.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698