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 22 matching lines...) Expand all Loading... | |
33 #include "core/frame/FrameViewAutoSizeInfo.h" | 33 #include "core/frame/FrameViewAutoSizeInfo.h" |
34 #include "core/frame/LayoutSubtreeRootList.h" | 34 #include "core/frame/LayoutSubtreeRootList.h" |
35 #include "core/frame/RootFrameViewport.h" | 35 #include "core/frame/RootFrameViewport.h" |
36 #include "core/layout/MapCoordinatesFlags.h" | 36 #include "core/layout/MapCoordinatesFlags.h" |
37 #include "core/layout/ScrollAnchor.h" | 37 #include "core/layout/ScrollAnchor.h" |
38 #include "core/paint/FirstMeaningfulPaintDetector.h" | 38 #include "core/paint/FirstMeaningfulPaintDetector.h" |
39 #include "core/paint/ObjectPaintProperties.h" | 39 #include "core/paint/ObjectPaintProperties.h" |
40 #include "core/paint/PaintInvalidationCapableScrollableArea.h" | 40 #include "core/paint/PaintInvalidationCapableScrollableArea.h" |
41 #include "core/paint/PaintPhase.h" | 41 #include "core/paint/PaintPhase.h" |
42 #include "core/paint/ScrollbarManager.h" | 42 #include "core/paint/ScrollbarManager.h" |
43 #include "core/plugins/PluginView.h" | |
44 #include "platform/FrameViewBase.h" | 43 #include "platform/FrameViewBase.h" |
45 #include "platform/RuntimeEnabledFeatures.h" | 44 #include "platform/RuntimeEnabledFeatures.h" |
46 #include "platform/animation/CompositorAnimationHost.h" | 45 #include "platform/animation/CompositorAnimationHost.h" |
47 #include "platform/animation/CompositorAnimationTimeline.h" | 46 #include "platform/animation/CompositorAnimationTimeline.h" |
48 #include "platform/geometry/IntRect.h" | 47 #include "platform/geometry/IntRect.h" |
49 #include "platform/geometry/LayoutRect.h" | 48 #include "platform/geometry/LayoutRect.h" |
50 #include "platform/graphics/Color.h" | 49 #include "platform/graphics/Color.h" |
51 #include "platform/graphics/CompositorElementId.h" | 50 #include "platform/graphics/CompositorElementId.h" |
52 #include "platform/graphics/GraphicsLayerClient.h" | 51 #include "platform/graphics/GraphicsLayerClient.h" |
53 #include "platform/scroll/ScrollTypes.h" | 52 #include "platform/scroll/ScrollTypes.h" |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
471 | 470 |
472 LayoutRect ScrollIntoView(const LayoutRect& rect_in_content, | 471 LayoutRect ScrollIntoView(const LayoutRect& rect_in_content, |
473 const ScrollAlignment& align_x, | 472 const ScrollAlignment& align_x, |
474 const ScrollAlignment& align_y, | 473 const ScrollAlignment& align_y, |
475 ScrollType = kProgrammaticScroll) override; | 474 ScrollType = kProgrammaticScroll) override; |
476 | 475 |
477 // The window that hosts the FrameView. The FrameView will communicate scrolls | 476 // The window that hosts the FrameView. The FrameView will communicate scrolls |
478 // and repaints to the host window in the window's coordinate space. | 477 // and repaints to the host window in the window's coordinate space. |
479 PlatformChromeClient* GetChromeClient() const; | 478 PlatformChromeClient* GetChromeClient() const; |
480 | 479 |
481 typedef HeapHashSet<Member<FrameViewBase>> ChildrenSet; | 480 typedef HeapHashSet<Member<FrameOrPlugin>> ChildrenSet; |
482 typedef HeapHashSet<Member<PluginView>> PluginsSet; | |
483 typedef HeapHashSet<Member<Scrollbar>> ScrollbarsSet; | 481 typedef HeapHashSet<Member<Scrollbar>> ScrollbarsSet; |
484 | 482 |
485 // Functions for child manipulation and inspection. | 483 // Functions for child manipulation and inspection. |
486 bool IsSelfVisible() const { | 484 bool IsSelfVisible() const { |
487 return self_visible_; | 485 return self_visible_; |
488 } // Whether or not we have been explicitly marked as visible or not. | 486 } // Whether or not we have been explicitly marked as visible or not. |
489 bool IsParentVisible() const { | 487 bool IsParentVisible() const { |
490 return parent_visible_; | 488 return parent_visible_; |
491 } // Whether or not our parent is visible. | 489 } // Whether or not our parent is visible. |
492 bool IsVisible() const { | 490 bool IsVisible() const { |
493 return self_visible_ && parent_visible_; | 491 return self_visible_ && parent_visible_; |
494 } // Whether or not we are actually visible. | 492 } // Whether or not we are actually visible. |
495 void SetParentVisible(bool); | 493 void SetParentVisible(bool) override; |
496 void SetSelfVisible(bool v) { self_visible_ = v; } | 494 void SetSelfVisible(bool v) { self_visible_ = v; } |
497 void SetParent(FrameViewBase*) override; | 495 void SetParent(FrameView*) override; |
498 FrameViewBase* Parent() const override { return parent_; } | 496 FrameView* Parent() const override { return parent_; } |
499 FrameView* Root() const; | 497 FrameView* Root() const; |
500 void RemoveChild(FrameViewBase*); | 498 void RemoveChild(FrameOrPlugin*); |
501 void AddChild(FrameViewBase*); | 499 void AddChild(FrameOrPlugin*); |
502 const ChildrenSet* Children() const { return &children_; } | 500 const ChildrenSet& Children() const { return children_; } |
503 void RemovePlugin(PluginView*); | |
joelhockey
2017/05/01 23:04:35
Scrollbar is still a special-case child of FrameVi
| |
504 void AddPlugin(PluginView*); | |
505 const PluginsSet* Plugins() const { return &plugins_; } | |
506 void RemoveScrollbar(Scrollbar*); | 501 void RemoveScrollbar(Scrollbar*); |
507 void AddScrollbar(Scrollbar*); | 502 void AddScrollbar(Scrollbar*); |
508 const ScrollbarsSet* Scrollbars() const { return &scrollbars_; } | 503 const ScrollbarsSet& Scrollbars() const { return scrollbars_; } |
509 | 504 |
510 // If the scroll view does not use a native widget, then it will have | 505 // If the scroll view does not use a native widget, then it will have |
511 // cross-platform Scrollbars. These functions can be used to obtain those | 506 // cross-platform Scrollbars. These functions can be used to obtain those |
512 // scrollbars. | 507 // scrollbars. |
513 Scrollbar* HorizontalScrollbar() const override { | 508 Scrollbar* HorizontalScrollbar() const override { |
514 return scrollbar_manager_.HorizontalScrollbar(); | 509 return scrollbar_manager_.HorizontalScrollbar(); |
515 } | 510 } |
516 Scrollbar* VerticalScrollbar() const override { | 511 Scrollbar* VerticalScrollbar() const override { |
517 return scrollbar_manager_.VerticalScrollbar(); | 512 return scrollbar_manager_.VerticalScrollbar(); |
518 } | 513 } |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
645 | 640 |
646 // Functions for converting to screen coordinates. | 641 // Functions for converting to screen coordinates. |
647 IntRect ContentsToScreen(const IntRect&) const; | 642 IntRect ContentsToScreen(const IntRect&) const; |
648 | 643 |
649 // For platforms that need to hit test scrollbars from within the engine's | 644 // For platforms that need to hit test scrollbars from within the engine's |
650 // event handlers (like Win32). | 645 // event handlers (like Win32). |
651 Scrollbar* ScrollbarAtFramePoint(const IntPoint&); | 646 Scrollbar* ScrollbarAtFramePoint(const IntPoint&); |
652 | 647 |
653 IntRect ConvertToRootFrame(const IntRect&) const; | 648 IntRect ConvertToRootFrame(const IntRect&) const; |
654 IntPoint ConvertToRootFrame(const IntPoint&) const; | 649 IntPoint ConvertToRootFrame(const IntPoint&) const; |
655 IntPoint ConvertSelfToChild(const FrameViewBase*, const IntPoint&) const; | 650 IntPoint ConvertSelfToChild(const IntPoint&, const IntPoint&) const; |
joelhockey
2017/05/01 23:04:35
The method was only calling FrameViewBase::Locatio
dcheng
2017/05/09 07:50:51
I prefer the original: it's hard to get it wrong i
joelhockey
2017/05/10 02:35:43
Sorry, my comment didn't make it clear that the re
dcheng
2017/05/10 07:08:28
I understand that, but maybe this is an argument f
joelhockey
2017/05/10 09:40:46
I've changed to use the FrameOrPlugin class rather
| |
656 | 651 |
657 // FrameViewBase override. Handles painting of the contents of the view as | 652 // Handles painting of the contents of the view as well as the scrollbars. |
658 // well as the scrollbars. | |
659 void Paint(GraphicsContext&, const CullRect&) const override; | 653 void Paint(GraphicsContext&, const CullRect&) const override; |
660 void Paint(GraphicsContext&, const GlobalPaintFlags, const CullRect&) const; | 654 void Paint(GraphicsContext&, const GlobalPaintFlags, const CullRect&) const; |
661 void PaintContents(GraphicsContext&, | 655 void PaintContents(GraphicsContext&, |
662 const GlobalPaintFlags, | 656 const GlobalPaintFlags, |
663 const IntRect& damage_rect) const; | 657 const IntRect& damage_rect) const; |
664 | 658 |
665 void Show() override; | 659 void Show() override; |
666 void Hide() override; | 660 void Hide() override; |
667 | 661 |
668 bool IsPointInScrollbarCorner(const IntPoint&); | 662 bool IsPointInScrollbarCorner(const IntPoint&); |
669 bool ScrollbarCornerPresent() const; | 663 bool ScrollbarCornerPresent() const; |
670 IntRect ScrollCornerRect() const override; | 664 IntRect ScrollCornerRect() const override; |
671 | 665 |
672 IntPoint ConvertFromContainingFrameViewBaseToScrollbar( | 666 IntPoint ConvertFromContainingFrameViewToScrollbar( |
joelhockey
2017/05/01 23:04:35
I changed a few Convert...FrameViewBase... methods
dcheng
2017/05/09 07:50:51
For future CLs, let's separate out renaming change
joelhockey
2017/05/10 02:35:43
I've backed out the renaming for this CL, and I'll
| |
673 const Scrollbar&, | 667 const Scrollbar&, |
674 const IntPoint&) const override; | 668 const IntPoint&) const override; |
675 | 669 |
676 bool IsFrameView() const override { return true; } | 670 bool IsFrameView() const override { return true; } |
677 | 671 |
678 DECLARE_VIRTUAL_TRACE(); | 672 DECLARE_VIRTUAL_TRACE(); |
679 void NotifyPageThatContentAreaWillPaint() const; | 673 void NotifyPageThatContentAreaWillPaint() const; |
680 FrameView* ParentFrameView() const; | 674 FrameView* ParentFrameView() const; |
681 | 675 |
682 // Returns the scrollable area for the frame. For the root frame, this will | 676 // Returns the scrollable area for the frame. For the root frame, this will |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
964 | 958 |
965 void RecordDeferredLoadingStats(); | 959 void RecordDeferredLoadingStats(); |
966 | 960 |
967 DocumentLifecycle& Lifecycle() const; | 961 DocumentLifecycle& Lifecycle() const; |
968 | 962 |
969 void ContentsResized() override; | 963 void ContentsResized() override; |
970 void ScrollbarExistenceDidChange(); | 964 void ScrollbarExistenceDidChange(); |
971 | 965 |
972 // Methods to do point conversion via layoutObjects, in order to take | 966 // Methods to do point conversion via layoutObjects, in order to take |
973 // transforms into account. | 967 // transforms into account. |
974 IntRect ConvertToContainingFrameViewBase(const IntRect&) const; | 968 IntRect ConvertToContainingFrameView(const IntRect&) const; |
975 IntPoint ConvertToContainingFrameViewBase(const IntPoint&) const; | 969 IntPoint ConvertToContainingFrameView(const IntPoint&) const; |
976 IntRect ConvertFromContainingFrameViewBase(const IntRect&) const; | 970 IntRect ConvertFromContainingFrameView(const IntRect&) const; |
977 IntPoint ConvertFromContainingFrameViewBase(const IntPoint&) const; | 971 IntPoint ConvertFromContainingFrameView(const IntPoint&) const; |
978 | 972 |
979 void DidChangeGlobalRootScroller() override; | 973 void DidChangeGlobalRootScroller() override; |
980 | 974 |
981 void UpdateGeometriesIfNeeded(); | 975 void UpdateGeometriesIfNeeded(); |
982 | 976 |
983 bool WasViewportResized(); | 977 bool WasViewportResized(); |
984 void SendResizeEventIfNeeded(); | 978 void SendResizeEventIfNeeded(); |
985 | 979 |
986 void UpdateParentScrollableAreaSet(); | 980 void UpdateParentScrollableAreaSet(); |
987 | 981 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1061 bool CheckLayoutInvalidationIsAllowed() const; | 1055 bool CheckLayoutInvalidationIsAllowed() const; |
1062 | 1056 |
1063 PaintController* GetPaintController() { return paint_controller_.get(); } | 1057 PaintController* GetPaintController() { return paint_controller_.get(); } |
1064 | 1058 |
1065 LayoutSize size_; | 1059 LayoutSize size_; |
1066 | 1060 |
1067 typedef HashSet<RefPtr<LayoutEmbeddedObject>> EmbeddedObjectSet; | 1061 typedef HashSet<RefPtr<LayoutEmbeddedObject>> EmbeddedObjectSet; |
1068 EmbeddedObjectSet part_update_set_; | 1062 EmbeddedObjectSet part_update_set_; |
1069 | 1063 |
1070 // FIXME: These are just "children" of the FrameView and should be | 1064 // FIXME: These are just "children" of the FrameView and should be |
1071 // Member<FrameViewBase> instead. | 1065 // Member<FrameView> instead. |
joelhockey
2017/05/01 23:04:35
I've tried to update comments to be more accurate.
| |
1072 HashSet<RefPtr<LayoutPart>> parts_; | 1066 HashSet<RefPtr<LayoutPart>> parts_; |
1073 | 1067 |
1074 Member<LocalFrame> frame_; | 1068 Member<LocalFrame> frame_; |
1075 | 1069 |
1076 IntRect frame_rect_; | 1070 IntRect frame_rect_; |
1077 Member<FrameView> parent_; | 1071 Member<FrameView> parent_; |
1078 bool self_visible_; | 1072 bool self_visible_; |
1079 bool parent_visible_; | 1073 bool parent_visible_; |
1080 | 1074 |
1081 WebDisplayMode display_mode_; | 1075 WebDisplayMode display_mode_; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1141 bool has_been_disposed_ = false; | 1135 bool has_been_disposed_ = false; |
1142 #endif | 1136 #endif |
1143 | 1137 |
1144 ScrollbarMode horizontal_scrollbar_mode_; | 1138 ScrollbarMode horizontal_scrollbar_mode_; |
1145 ScrollbarMode vertical_scrollbar_mode_; | 1139 ScrollbarMode vertical_scrollbar_mode_; |
1146 | 1140 |
1147 bool horizontal_scrollbar_lock_; | 1141 bool horizontal_scrollbar_lock_; |
1148 bool vertical_scrollbar_lock_; | 1142 bool vertical_scrollbar_lock_; |
1149 | 1143 |
1150 ChildrenSet children_; | 1144 ChildrenSet children_; |
1151 PluginsSet plugins_; | |
1152 ScrollbarsSet scrollbars_; | 1145 ScrollbarsSet scrollbars_; |
1153 | 1146 |
1154 ScrollOffset pending_scroll_delta_; | 1147 ScrollOffset pending_scroll_delta_; |
1155 ScrollOffset scroll_offset_; | 1148 ScrollOffset scroll_offset_; |
1156 IntSize contents_size_; | 1149 IntSize contents_size_; |
1157 | 1150 |
1158 bool scrollbars_suppressed_; | 1151 bool scrollbars_suppressed_; |
1159 | 1152 |
1160 bool in_update_scrollbars_; | 1153 bool in_update_scrollbars_; |
1161 | 1154 |
(...skipping 10 matching lines...) Expand all Loading... | |
1172 | 1165 |
1173 // The following members control rendering pipeline throttling for this | 1166 // The following members control rendering pipeline throttling for this |
1174 // frame. They are only updated in response to intersection observer | 1167 // frame. They are only updated in response to intersection observer |
1175 // notifications, i.e., not in the middle of the lifecycle. | 1168 // notifications, i.e., not in the middle of the lifecycle. |
1176 bool hidden_for_throttling_; | 1169 bool hidden_for_throttling_; |
1177 bool subtree_throttled_; | 1170 bool subtree_throttled_; |
1178 bool lifecycle_updates_throttled_; | 1171 bool lifecycle_updates_throttled_; |
1179 | 1172 |
1180 // Paint properties for SPv2 Only. | 1173 // Paint properties for SPv2 Only. |
1181 // The hierarchy of transform subtree created by a FrameView. | 1174 // The hierarchy of transform subtree created by a FrameView. |
1182 // [ preTranslation ] The offset from FrameViewBase::frameRect. | 1175 // [ preTranslation ] The offset from FrameView::FrameRect. |
1183 // | Establishes viewport. | 1176 // | Establishes viewport. |
1184 // +---[ scrollTranslation ] Frame scrolling. | 1177 // +---[ scrollTranslation ] Frame scrolling. |
1185 // TODO(trchen): These will not be needed once settings->rootLayerScrolls() is | 1178 // TODO(trchen): These will not be needed once settings->rootLayerScrolls() is |
1186 // enabled. | 1179 // enabled. |
1187 RefPtr<TransformPaintPropertyNode> pre_translation_; | 1180 RefPtr<TransformPaintPropertyNode> pre_translation_; |
1188 RefPtr<TransformPaintPropertyNode> scroll_translation_; | 1181 RefPtr<TransformPaintPropertyNode> scroll_translation_; |
1189 // The content clip clips the document (= LayoutView) but not the scrollbars. | 1182 // The content clip clips the document (= LayoutView) but not the scrollbars. |
1190 // TODO(trchen): This will not be needed once settings->rootLayerScrolls() is | 1183 // TODO(trchen): This will not be needed once settings->rootLayerScrolls() is |
1191 // enabled. | 1184 // enabled. |
1192 RefPtr<ClipPaintPropertyNode> content_clip_; | 1185 RefPtr<ClipPaintPropertyNode> content_clip_; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1265 if (visually_non_empty_pixel_count_ > kVisualPixelThreshold) | 1258 if (visually_non_empty_pixel_count_ > kVisualPixelThreshold) |
1266 SetIsVisuallyNonEmpty(); | 1259 SetIsVisuallyNonEmpty(); |
1267 } | 1260 } |
1268 | 1261 |
1269 DEFINE_TYPE_CASTS(FrameView, | 1262 DEFINE_TYPE_CASTS(FrameView, |
1270 FrameViewBase, | 1263 FrameViewBase, |
1271 frameViewBase, | 1264 frameViewBase, |
1272 frameViewBase->IsFrameView(), | 1265 frameViewBase->IsFrameView(), |
1273 frameViewBase.IsFrameView()); | 1266 frameViewBase.IsFrameView()); |
1274 DEFINE_TYPE_CASTS(FrameView, | 1267 DEFINE_TYPE_CASTS(FrameView, |
1268 FrameOrPlugin, | |
1269 frame_or_plugin, | |
1270 frame_or_plugin->IsFrameView(), | |
1271 frame_or_plugin.IsFrameView()); | |
1272 DEFINE_TYPE_CASTS(FrameView, | |
1275 ScrollableArea, | 1273 ScrollableArea, |
1276 scrollableArea, | 1274 scrollable_area, |
1277 scrollableArea->IsFrameView(), | 1275 scrollable_area->IsFrameView(), |
1278 scrollableArea.IsFrameView()); | 1276 scrollable_area.IsFrameView()); |
1279 | 1277 |
1280 } // namespace blink | 1278 } // namespace blink |
1281 | 1279 |
1282 #endif // FrameView_h | 1280 #endif // FrameView_h |
OLD | NEW |