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

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

Issue 1330633003: Intersection Observer first draft Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix segfault on null input. 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
Index: Source/core/dom/IntersectionObserverEntry.cpp
diff --git a/Source/core/dom/IntersectionObserverEntry.cpp b/Source/core/dom/IntersectionObserverEntry.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..bbe3a7b519578a204048cf30613bbf6b6ecc6753
--- /dev/null
+++ b/Source/core/dom/IntersectionObserverEntry.cpp
@@ -0,0 +1,45 @@
+// Copyright 2015 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.
+
+#include "config.h"
+#include "core/dom/IntersectionObserverEntry.h"
+
+#include "core/dom/Element.h"
+
+namespace blink {
+
+PassRefPtrWillBeRawPtr<IntersectionObserverEntry> IntersectionObserverEntry::create(double time, const Vector<FloatRect>& quads, const FloatRect& viewport, Element* target)
+{
+ return adoptRefWillBeNoop(new IntersectionObserverEntry(time, quads, viewport, target));
+}
+
+IntersectionObserverEntry::IntersectionObserverEntry(double time, const Vector<FloatRect>& quads, const FloatRect& viewport, Element* target)
+ : m_time(time)
+ , m_quads(quads)
+ , m_viewport(viewport)
+ , m_target(target)
+
+{
+}
+
+IntersectionObserverEntry::~IntersectionObserverEntry()
+{
+}
+/*
+const HeapVector<Member<DOMRect>> IntersectionObserverEntry::quads()
+{
+ HeapVector<Member<DOMRect>> quads;
+ for (const auto quad : m_quads) {
+ quads.append(DOMRect::create(quad));
+ }
+ return quads;
+}
+*/
+DEFINE_TRACE(IntersectionObserverEntry)
+{
+ visitor->trace(m_target);
+}
+
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698