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

Unified Diff: sky/engine/core/dom/Document.cpp

Issue 754043004: Remove autofocus. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « sky/engine/core/dom/Document.h ('k') | sky/engine/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/Document.cpp
diff --git a/sky/engine/core/dom/Document.cpp b/sky/engine/core/dom/Document.cpp
index 78b5c89ab0579b14fa690b67b8e726fee8c3cd1d..9bfc473d5dffab5d6950ee8b167518b93a32a3bc 100644
--- a/sky/engine/core/dom/Document.cpp
+++ b/sky/engine/core/dom/Document.cpp
@@ -253,9 +253,7 @@ Document::Document(const DocumentInit& initializer, DocumentClassFlags documentC
, m_importsController(initializer.importsController())
, m_activeParserCount(0)
, m_executeScriptsWaitingForResourcesTimer(this, &Document::executeScriptsWaitingForResourcesTimerFired)
- , m_hasAutofocused(false)
, m_clearFocusedElementTimer(this, &Document::clearFocusedElementTimerFired)
- , m_focusAutofocusElementTimer(this, &Document::focusAutofocusElementTimerFired)
, m_listenerTypes(0)
, m_mutationObserverTypes(0)
, m_readyState(Complete)
@@ -1295,7 +1293,6 @@ void Document::detach(const AttachContext& context)
m_hoverNode = nullptr;
m_focusedElement = nullptr;
m_activeHoverElement = nullptr;
- m_autofocusElement = nullptr;
m_renderView = 0;
ContainerNode::detach(context);
@@ -2755,29 +2752,6 @@ void Document::modifiedStyleSheet(StyleSheet* sheet, StyleResolverUpdateMode upd
styleResolverChanged(updateMode);
}
-void Document::focusAutofocusElementTimerFired(Timer<Document>*)
-{
- if (RefPtr<Element> element = autofocusElement()) {
- setAutofocusElement(nullptr);
- element->focus();
- }
-}
-
-void Document::setAutofocusElement(Element* element)
-{
- if (!element) {
- m_autofocusElement = nullptr;
- return;
- }
- if (m_hasAutofocused)
- return;
- m_hasAutofocused = true;
- ASSERT(!m_autofocusElement);
- m_autofocusElement = element;
- if (!m_focusAutofocusElementTimer.isActive())
- m_focusAutofocusElementTimer.startOneShot(0, FROM_HERE);
-}
-
Element* Document::activeElement() const
{
if (Element* element = treeScope().adjustedFocusedElement())
« no previous file with comments | « sky/engine/core/dom/Document.h ('k') | sky/engine/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698