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

Unified Diff: third_party/WebKit/Source/core/observer/ResizeObserverController.h

Issue 2188983003: ResizeObserver pt5: size change notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review fixes Created 4 years, 5 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: third_party/WebKit/Source/core/observer/ResizeObserverController.h
diff --git a/third_party/WebKit/Source/core/observer/ResizeObserverController.h b/third_party/WebKit/Source/core/observer/ResizeObserverController.h
index e84ef621ee747c31a93d6245c504355aaccd05e0..4017941afb7333d757872b3c298546f22290d57d 100644
--- a/third_party/WebKit/Source/core/observer/ResizeObserverController.h
+++ b/third_party/WebKit/Source/core/observer/ResizeObserverController.h
@@ -13,17 +13,34 @@ class ResizeObserver;
// ResizeObserverController keeps track of all ResizeObservers
// in a single Document.
+//
+// The observation API is used to integrate ResizeObserver
+// and the event loop. It delivers notification in a loop.
+// In each iteration, only notifications deeper than the
+// shallowest notification from previous iteration are delivered.
class ResizeObserverController final : public GarbageCollected<ResizeObserverController> {
public:
+ static const size_t kDepthBottom = 4096;
+
ResizeObserverController();
void addObserver(ResizeObserver&);
+ // observation API
+ // Returns depth of shallowest observed node, kDepthLimit if none.
+ size_t gatherObservations(size_t deeperThan);
+ bool skippedObservations();
ikilpatrick 2016/07/29 23:18:39 comment?
atotic1 2016/07/30 03:16:29 Done. I just did not upload changes before waiting
+ void deliverObservations();
+ void clearObservations();
+ void observerChanged() { m_observersChanged = true; }
+
DECLARE_TRACE();
private:
// Active observers
HeapHashSet<WeakMember<ResizeObserver>> m_observers;
+ // True if observers were changed since last notification
ikilpatrick 2016/07/29 23:18:39 clarify comment, is this the set of observers that
atotic1 2016/07/30 03:16:29 Changed to: // True if ANY observers were changed
+ bool m_observersChanged;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698