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

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

Issue 1323243002: WIP - Rough draft of style observation in style of apply hooks. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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/core.gypi ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.h
diff --git a/Source/core/dom/Document.h b/Source/core/dom/Document.h
index 96e20f72241a9861250a8c4c4f6b7215b9868736..2c56e601083d71dfcda5e88778b4350cb4f5179c 100644
--- a/Source/core/dom/Document.h
+++ b/Source/core/dom/Document.h
@@ -54,6 +54,7 @@
#include "core/html/CollectionType.h"
#include "core/html/parser/ParserSynchronizationPolicy.h"
#include "core/page/PageVisibilityState.h"
+#include "core/style/StyleObserver.h"
#include "platform/Length.h"
#include "platform/Timer.h"
#include "platform/heap/Handle.h"
@@ -1002,6 +1003,11 @@ public:
void registerVisibilityObserver(DocumentVisibilityObserver*);
void unregisterVisibilityObserver(DocumentVisibilityObserver*);
+ bool hasStyleObserver();
+ void notifyStyleObservers(const Element*, const ComputedStyle* oldStyle, const ComputedStyle* newStyle);
+ void registerStyleObserver(StyleObserver*);
+ void unregisterStyleObserver(StyleObserver*);
+
void updateStyleInvalidationIfNeeded();
DECLARE_VIRTUAL_TRACE();
@@ -1366,6 +1372,8 @@ private:
DOMTimerCoordinator m_timers;
bool m_hasViewportUnits;
+ using StyleObserverSet = WillBeHeapHashSet<RawPtrWillBeWeakMember<StyleObserver>>;
+ StyleObserverSet m_styleObservers;
using DocumentVisibilityObserverSet = WillBeHeapHashSet<RawPtrWillBeWeakMember<DocumentVisibilityObserver>>;
DocumentVisibilityObserverSet m_visibilityObservers;
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698