OLD | NEW |
---|---|
1 /* | 1 /* |
2 Copyright (C) 1997 Martin Jones (mjones@kde.org) | 2 Copyright (C) 1997 Martin Jones (mjones@kde.org) |
3 (C) 1998 Waldo Bastian (bastian@kde.org) | 3 (C) 1998 Waldo Bastian (bastian@kde.org) |
4 (C) 1998, 1999 Torben Weis (weis@kde.org) | 4 (C) 1998, 1999 Torben Weis (weis@kde.org) |
5 (C) 1999 Lars Knoll (knoll@kde.org) | 5 (C) 1999 Lars Knoll (knoll@kde.org) |
6 (C) 1999 Antti Koivisto (koivisto@kde.org) | 6 (C) 1999 Antti Koivisto (koivisto@kde.org) |
7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights | 7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights |
8 reserved. | 8 reserved. |
9 | 9 |
10 This library is free software; you can redistribute it and/or | 10 This library is free software; you can redistribute it and/or |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
95 class PrintContext; | 95 class PrintContext; |
96 class ScrollingCoordinator; | 96 class ScrollingCoordinator; |
97 class TracedValue; | 97 class TracedValue; |
98 class TransformState; | 98 class TransformState; |
99 struct AnnotatedRegionValue; | 99 struct AnnotatedRegionValue; |
100 struct CompositedSelection; | 100 struct CompositedSelection; |
101 | 101 |
102 typedef unsigned long long DOMTimeStamp; | 102 typedef unsigned long long DOMTimeStamp; |
103 | 103 |
104 class CORE_EXPORT FrameView final | 104 class CORE_EXPORT FrameView final |
105 : public FrameViewBase, | 105 : public GarbageCollectedFinalized<FrameView>, |
106 public FrameViewBase, | |
106 public FrameOrPlugin, | 107 public FrameOrPlugin, |
107 public PaintInvalidationCapableScrollableArea { | 108 public PaintInvalidationCapableScrollableArea { |
108 USING_GARBAGE_COLLECTED_MIXIN(FrameView); | 109 USING_GARBAGE_COLLECTED_MIXIN(FrameView); |
109 | 110 |
110 friend class PaintControllerPaintTestBase; | 111 friend class PaintControllerPaintTestBase; |
111 friend class Internals; | 112 friend class Internals; |
112 friend class LayoutPart; // for invalidateTreeIfNeeded | 113 friend class LayoutPart; // for invalidateTreeIfNeeded |
113 | 114 |
114 public: | 115 public: |
115 static FrameView* Create(LocalFrame&); | 116 static FrameView* Create(LocalFrame&); |
116 static FrameView* Create(LocalFrame&, const IntSize& initial_size); | 117 static FrameView* Create(LocalFrame&, const IntSize& initial_size); |
117 | 118 |
118 ~FrameView() override; | 119 ~FrameView() override; |
119 | 120 |
120 void Invalidate() { InvalidateRect(IntRect(0, 0, Width(), Height())); } | 121 void Invalidate() { InvalidateRect(IntRect(0, 0, Width(), Height())); } |
121 void InvalidateRect(const IntRect&); | 122 void InvalidateRect(const IntRect&); |
122 void SetFrameRect(const IntRect&) override; | 123 void SetFrameRect(const IntRect&) override; |
123 const IntRect& FrameRect() const override { | 124 const IntRect& FrameRect() const override { return frame_rect_; } |
124 return FrameViewBase::FrameRect(); | 125 int X() const { return frame_rect_.X(); } |
126 int Y() const { return frame_rect_.Y(); } | |
127 int Width() const { return frame_rect_.Width(); } | |
128 int Height() const { return frame_rect_.Height(); } | |
129 IntSize Size() const { return frame_rect_.Size(); } | |
130 IntPoint Location() const override { return frame_rect_.Location(); } | |
131 void Resize(int w, int h) { | |
haraken
2017/04/26 07:42:14
width
height
joelhockey
2017/04/26 07:48:37
Done
| |
132 SetFrameRect(IntRect(frame_rect_.X(), frame_rect_.Y(), w, h)); | |
125 } | 133 } |
134 void Resize(const IntSize& s) { SetFrameRect(IntRect(Location(), s)); } | |
haraken
2017/04/26 07:42:14
size
joelhockey
2017/04/26 07:48:37
Done
| |
126 | 135 |
127 LocalFrame& GetFrame() const { | 136 LocalFrame& GetFrame() const { |
128 ASSERT(frame_); | 137 ASSERT(frame_); |
129 return *frame_; | 138 return *frame_; |
130 } | 139 } |
131 | 140 |
132 Page* GetPage() const; | 141 Page* GetPage() const; |
133 | 142 |
134 // TODO(pilgrim) replace all instances of layoutView() with layoutViewItem() | 143 // TODO(pilgrim) replace all instances of layoutView() with layoutViewItem() |
135 // https://crbug.com/499321 | 144 // https://crbug.com/499321 |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
467 | 476 |
468 // The window that hosts the FrameView. The FrameView will communicate scrolls | 477 // The window that hosts the FrameView. The FrameView will communicate scrolls |
469 // and repaints to the host window in the window's coordinate space. | 478 // and repaints to the host window in the window's coordinate space. |
470 PlatformChromeClient* GetChromeClient() const; | 479 PlatformChromeClient* GetChromeClient() const; |
471 | 480 |
472 typedef HeapHashSet<Member<FrameViewBase>> ChildrenSet; | 481 typedef HeapHashSet<Member<FrameViewBase>> ChildrenSet; |
473 typedef HeapHashSet<Member<PluginView>> PluginsSet; | 482 typedef HeapHashSet<Member<PluginView>> PluginsSet; |
474 typedef HeapHashSet<Member<Scrollbar>> ScrollbarsSet; | 483 typedef HeapHashSet<Member<Scrollbar>> ScrollbarsSet; |
475 | 484 |
476 // Functions for child manipulation and inspection. | 485 // Functions for child manipulation and inspection. |
486 bool IsSelfVisible() const { | |
487 return self_visible_; | |
488 } // Whether or not we have been explicitly marked as visible or not. | |
489 bool IsParentVisible() const { | |
490 return parent_visible_; | |
491 } // Whether or not our parent is visible. | |
492 bool IsVisible() const { | |
493 return self_visible_ && parent_visible_; | |
494 } // Whether or not we are actually visible. | |
495 void SetParentVisible(bool); | |
496 void SetSelfVisible(bool v) { self_visible_ = v; } | |
477 void SetParent(FrameViewBase*) override; | 497 void SetParent(FrameViewBase*) override; |
498 FrameViewBase* Parent() const override { return parent_; } | |
499 FrameView* Root() const; | |
478 void RemoveChild(FrameViewBase*); | 500 void RemoveChild(FrameViewBase*); |
479 void AddChild(FrameViewBase*); | 501 void AddChild(FrameViewBase*); |
480 const ChildrenSet* Children() const { return &children_; } | 502 const ChildrenSet* Children() const { return &children_; } |
481 void RemovePlugin(PluginView*); | 503 void RemovePlugin(PluginView*); |
482 void AddPlugin(PluginView*); | 504 void AddPlugin(PluginView*); |
483 const PluginsSet* Plugins() const { return &plugins_; } | 505 const PluginsSet* Plugins() const { return &plugins_; } |
484 void RemoveScrollbar(Scrollbar*); | 506 void RemoveScrollbar(Scrollbar*); |
485 void AddScrollbar(Scrollbar*); | 507 void AddScrollbar(Scrollbar*); |
486 const ScrollbarsSet* Scrollbars() const { return &scrollbars_; } | 508 const ScrollbarsSet* Scrollbars() const { return &scrollbars_; } |
487 | 509 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
633 IntPoint ConvertSelfToChild(const FrameViewBase*, const IntPoint&) const; | 655 IntPoint ConvertSelfToChild(const FrameViewBase*, const IntPoint&) const; |
634 | 656 |
635 // FrameViewBase override. Handles painting of the contents of the view as | 657 // FrameViewBase override. Handles painting of the contents of the view as |
636 // well as the scrollbars. | 658 // well as the scrollbars. |
637 void Paint(GraphicsContext&, const CullRect&) const override; | 659 void Paint(GraphicsContext&, const CullRect&) const override; |
638 void Paint(GraphicsContext&, const GlobalPaintFlags, const CullRect&) const; | 660 void Paint(GraphicsContext&, const GlobalPaintFlags, const CullRect&) const; |
639 void PaintContents(GraphicsContext&, | 661 void PaintContents(GraphicsContext&, |
640 const GlobalPaintFlags, | 662 const GlobalPaintFlags, |
641 const IntRect& damage_rect) const; | 663 const IntRect& damage_rect) const; |
642 | 664 |
643 // FrameViewBase overrides to ensure that our children's visibility status is | |
644 // kept up to date when we get shown and hidden. | |
645 void Show() override; | 665 void Show() override; |
646 void Hide() override; | 666 void Hide() override; |
647 void SetParentVisible(bool) override; | |
648 | 667 |
649 bool IsPointInScrollbarCorner(const IntPoint&); | 668 bool IsPointInScrollbarCorner(const IntPoint&); |
650 bool ScrollbarCornerPresent() const; | 669 bool ScrollbarCornerPresent() const; |
651 IntRect ScrollCornerRect() const override; | 670 IntRect ScrollCornerRect() const override; |
652 | 671 |
653 IntPoint ConvertFromContainingFrameViewBaseToScrollbar( | 672 IntPoint ConvertFromContainingFrameViewBaseToScrollbar( |
654 const Scrollbar&, | 673 const Scrollbar&, |
655 const IntPoint&) const override; | 674 const IntPoint&) const override; |
656 | 675 |
657 bool IsFrameView() const override { return true; } | 676 bool IsFrameView() const override { return true; } |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
868 : scope_(&view->in_update_scrollbars_, true) {} | 887 : scope_(&view->in_update_scrollbars_, true) {} |
869 | 888 |
870 private: | 889 private: |
871 AutoReset<bool> scope_; | 890 AutoReset<bool> scope_; |
872 }; | 891 }; |
873 | 892 |
874 // Only for LayoutPart to traverse into sub frames during paint invalidation. | 893 // Only for LayoutPart to traverse into sub frames during paint invalidation. |
875 void InvalidateTreeIfNeeded(const PaintInvalidationState&); | 894 void InvalidateTreeIfNeeded(const PaintInvalidationState&); |
876 | 895 |
877 private: | 896 private: |
878 explicit FrameView(LocalFrame&); | 897 explicit FrameView(LocalFrame&, IntRect); |
879 class ScrollbarManager : public blink::ScrollbarManager { | 898 class ScrollbarManager : public blink::ScrollbarManager { |
880 DISALLOW_NEW(); | 899 DISALLOW_NEW(); |
881 | 900 |
882 // Helper class to manage the life cycle of Scrollbar objects. | 901 // Helper class to manage the life cycle of Scrollbar objects. |
883 public: | 902 public: |
884 ScrollbarManager(FrameView& scroller) : blink::ScrollbarManager(scroller) {} | 903 ScrollbarManager(FrameView& scroller) : blink::ScrollbarManager(scroller) {} |
885 | 904 |
886 void SetHasHorizontalScrollbar(bool has_scrollbar) override; | 905 void SetHasHorizontalScrollbar(bool has_scrollbar) override; |
887 void SetHasVerticalScrollbar(bool has_scrollbar) override; | 906 void SetHasVerticalScrollbar(bool has_scrollbar) override; |
888 | 907 |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1047 | 1066 |
1048 typedef HashSet<RefPtr<LayoutEmbeddedObject>> EmbeddedObjectSet; | 1067 typedef HashSet<RefPtr<LayoutEmbeddedObject>> EmbeddedObjectSet; |
1049 EmbeddedObjectSet part_update_set_; | 1068 EmbeddedObjectSet part_update_set_; |
1050 | 1069 |
1051 // FIXME: These are just "children" of the FrameView and should be | 1070 // FIXME: These are just "children" of the FrameView and should be |
1052 // Member<FrameViewBase> instead. | 1071 // Member<FrameViewBase> instead. |
1053 HashSet<RefPtr<LayoutPart>> parts_; | 1072 HashSet<RefPtr<LayoutPart>> parts_; |
1054 | 1073 |
1055 Member<LocalFrame> frame_; | 1074 Member<LocalFrame> frame_; |
1056 | 1075 |
1076 IntRect frame_rect_; | |
1077 Member<FrameView> parent_; | |
1078 bool self_visible_; | |
1079 bool parent_visible_; | |
1080 | |
1057 WebDisplayMode display_mode_; | 1081 WebDisplayMode display_mode_; |
1058 | 1082 |
1059 DisplayShape display_shape_; | 1083 DisplayShape display_shape_; |
1060 | 1084 |
1061 bool can_have_scrollbars_; | 1085 bool can_have_scrollbars_; |
1062 | 1086 |
1063 bool has_pending_layout_; | 1087 bool has_pending_layout_; |
1064 LayoutSubtreeRootList layout_subtree_root_list_; | 1088 LayoutSubtreeRootList layout_subtree_root_list_; |
1065 DepthOrderedLayoutObjectList orthogonal_writing_mode_root_list_; | 1089 DepthOrderedLayoutObjectList orthogonal_writing_mode_root_list_; |
1066 | 1090 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1249 frameViewBase.IsFrameView()); | 1273 frameViewBase.IsFrameView()); |
1250 DEFINE_TYPE_CASTS(FrameView, | 1274 DEFINE_TYPE_CASTS(FrameView, |
1251 ScrollableArea, | 1275 ScrollableArea, |
1252 scrollableArea, | 1276 scrollableArea, |
1253 scrollableArea->IsFrameView(), | 1277 scrollableArea->IsFrameView(), |
1254 scrollableArea.IsFrameView()); | 1278 scrollableArea.IsFrameView()); |
1255 | 1279 |
1256 } // namespace blink | 1280 } // namespace blink |
1257 | 1281 |
1258 #endif // FrameView_h | 1282 #endif // FrameView_h |
OLD | NEW |