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

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

Issue 455223002: Make anchors mouse-focusable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move m_wasFocusedByMouse to elementData().m_shouldHideFocusRingOnMouseFocus Created 6 years, 4 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
Index: Source/core/dom/Element.h
diff --git a/Source/core/dom/Element.h b/Source/core/dom/Element.h
index 8136281da8dc93da17bacc4be952a70105514f63..e905d24d29f3c3d6fc5ad57398f4bfb393cf4aae 100644
--- a/Source/core/dom/Element.h
+++ b/Source/core/dom/Element.h
@@ -235,6 +235,8 @@ public:
// Should be called only by Document::createElementNS to fix up m_tagName immediately after construction.
void setTagNameForCreateElementNS(const QualifiedName&);
+ bool shouldHideFocusRingOnMouseFocus() const;
+
// A fast function for checking the local name against another atomic string.
bool hasLocalName(const AtomicString& other) const { return m_tagName.localName() == other; }
@@ -371,10 +373,13 @@ public:
// rendererIsFocusable(), this method may be called when layout is not up to
// date, so it must not use the renderer to determine focusability.
virtual bool supportsFocus() const;
+ virtual bool shouldShowFocusRingOnMouseFocus() const { return true; };
+ virtual bool shouldHaveFocusAppearance() const OVERRIDE FINAL;
// Whether the node can actually be focused.
bool isFocusable() const;
virtual bool isKeyboardFocusable() const;
virtual bool isMouseFocusable() const;
+ virtual void willCallDefaultEventHandler(const Event&) OVERRIDE FINAL;
virtual void dispatchFocusEvent(Element* oldFocusedElement, FocusType);
virtual void dispatchBlurEvent(Element* newFocusedElement);
void dispatchFocusInEvent(const AtomicString& eventType, Element* oldFocusedElement);
@@ -827,6 +832,11 @@ inline void Element::setTagNameForCreateElementNS(const QualifiedName& tagName)
m_tagName = tagName;
}
+inline bool Element::shouldHideFocusRingOnMouseFocus() const
+{
+ return elementData() && elementData()->m_shouldHideFocusRingOnMouseFocus;
+}
+
inline bool isShadowHost(const Node* node)
{
return node && node->isElementNode() && toElement(node)->shadow();

Powered by Google App Engine
This is Rietveld 408576698