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

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

Issue 145353004: Build HTMLFormElement::m_associatedElements lazily (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix crash Created 6 years, 11 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/IdTargetObserverRegistry.h ('k') | Source/core/html/HTMLFormElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/IdTargetObserverRegistry.cpp
diff --git a/Source/core/dom/IdTargetObserverRegistry.cpp b/Source/core/dom/IdTargetObserverRegistry.cpp
index 19d297ad5e7d24be1f802fb74b6b45670db0c828..45ad4dc1a758096bfe12a44374f2e32a31f5beaf 100644
--- a/Source/core/dom/IdTargetObserverRegistry.cpp
+++ b/Source/core/dom/IdTargetObserverRegistry.cpp
@@ -82,4 +82,12 @@ void IdTargetObserverRegistry::notifyObserversInternal(const AtomicString& id)
m_notifyingObserversInSet = 0;
}
+bool IdTargetObserverRegistry::hasObservers(const AtomicString& id) const
+{
+ if (id.isEmpty() || m_registry.isEmpty())
+ return false;
+ ObserverSet* set = m_registry.get(id.impl());
+ return set && !set->isEmpty();
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/dom/IdTargetObserverRegistry.h ('k') | Source/core/html/HTMLFormElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698