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

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

Issue 2005593002: Initial ResizeObserver implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Observe content box, not clientWidth Created 4 years, 7 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/ResizeObservation.h
diff --git a/third_party/WebKit/Source/core/observer/ResizeObservation.h b/third_party/WebKit/Source/core/observer/ResizeObservation.h
new file mode 100644
index 0000000000000000000000000000000000000000..d8cf920c246df0ae6d04d04a504304de8ec71da5
--- /dev/null
+++ b/third_party/WebKit/Source/core/observer/ResizeObservation.h
@@ -0,0 +1,48 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ResizeObservation_h
+#define ResizeObservation_h
+
+#include "core/observer/ResizeObserverEntry.h"
+#include "platform/geometry/LayoutSize.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class Element;
+class ResizeObserver;
+
+// ResizeObservation represents an element that is being observed.
+class ResizeObservation : public GarbageCollectedFinalized<ResizeObservation> {
szager1 2016/06/02 20:52:41 No Finalized, no destructor; see preceding comment
atotic1 2016/06/08 18:59:21 Done.
+
szager1 2016/06/02 20:52:41 Still too many blank lines.
atotic1 2016/06/08 18:59:21 Done.
+public:
+ ResizeObservation(Element* target, ResizeObserver*);
+
+ virtual ~ResizeObservation() {};
+
+ // True if target was resized since last broadcast
+ bool hasResized() const;
+
+ Element* target() const { return m_target; }
+
+ LayoutSize broadcastSize() const { return m_broadcastSize; }
+
+ void setBroadcastSize(const LayoutSize& size) { m_broadcastSize = size; }
+
+ DECLARE_TRACE();
+
+private:
+
+ WeakMember<Element> m_target;
+ Member<ResizeObserver> m_observer; // Used for GC only.
szager1 2016/06/02 20:52:41 // This member is unused; its purpose is to mainta
atotic1 2016/06/08 18:59:21 Done.
+
+ LayoutSize m_broadcastSize;
+};
+
+
+
+} // namespace blink
+
+#endif // ResizeObservation_h

Powered by Google App Engine
This is Rietveld 408576698