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

Side by Side Diff: third_party/WebKit/Source/core/dom/IntersectionGeometry.h

Issue 2511143006: Detect change on the intersection of video and viewport. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef IntersectionGeometry_h
6 #define IntersectionGeometry_h
7
8 #include "platform/Length.h"
9 #include "platform/geometry/LayoutRect.h"
10 #include "platform/heap/Handle.h"
11 #include "wtf/Vector.h"
12
13 namespace blink {
14
15 class Node;
16 class Element;
17 class LayoutObject;
18
19 class IntersectionGeometry final
20 : public GarbageCollectedFinalized<IntersectionGeometry> {
21 public:
22 IntersectionGeometry(Node* root,
23 Element* target,
24 const Vector<Length>& rootMargin,
25 bool shouldReportRootBounds);
26 ~IntersectionGeometry();
27
28 void computeGeometry();
29 LayoutRect targetRect() const { return m_targetRect; }
30 LayoutRect intersectionRect() const { return m_intersectionRect; }
31 LayoutRect rootRect() const { return m_rootRect; }
32 bool doesIntersect() const { return m_doesIntersect; }
33
34 DECLARE_TRACE();
35
36 private:
37 void initializeGeometry();
38 void initializeTargetRect();
39 void initializeRootRect();
40 void clipToRoot();
41 void mapTargetRectToTargetFrameCoordinates();
42 void mapRootRectToRootFrameCoordinates();
43 void mapRootRectToTargetFrameCoordinates();
44 Element* root() const;
45 LayoutObject* getRootLayoutObject() const;
46 void applyRootMargin();
47
48 Member<Node> m_root;
49 Member<Element> m_target;
50 const Vector<Length> m_rootMargin;
51 bool m_shouldReportRootBounds;
52 LayoutRect m_targetRect;
53 LayoutRect m_intersectionRect;
54 LayoutRect m_rootRect;
55 bool m_doesIntersect = false;
56 };
57
58 } // namespace blink
59
60 #endif // IntersectionGeometry_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698