| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/paint/PaintPropertyTreeBuilder.h" | 5 #include "core/paint/PaintPropertyTreeBuilder.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include "core/dom/DOMNodeIds.h" | 8 #include "core/dom/DOMNodeIds.h" |
| 9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 | 872 |
| 873 void PaintPropertyTreeBuilder::UpdateScrollAndScrollTranslation( | 873 void PaintPropertyTreeBuilder::UpdateScrollAndScrollTranslation( |
| 874 const LayoutObject& object, | 874 const LayoutObject& object, |
| 875 PaintPropertyTreeBuilderContext& context) { | 875 PaintPropertyTreeBuilderContext& context) { |
| 876 if (object.NeedsPaintPropertyUpdate() || context.force_subtree_update) { | 876 if (object.NeedsPaintPropertyUpdate() || context.force_subtree_update) { |
| 877 bool needs_scroll_properties = false; | 877 bool needs_scroll_properties = false; |
| 878 if (object.HasOverflowClip()) { | 878 if (object.HasOverflowClip()) { |
| 879 auto ancestor_reasons = | 879 auto ancestor_reasons = |
| 880 context.current.scroll->GetMainThreadScrollingReasons(); | 880 context.current.scroll->GetMainThreadScrollingReasons(); |
| 881 auto reasons = GetMainThreadScrollingReasons(object, ancestor_reasons); | 881 auto reasons = GetMainThreadScrollingReasons(object, ancestor_reasons); |
| 882 bool scroll_node_needed_for_main_thread_reasons = | |
| 883 ancestor_reasons != reasons; | |
| 884 | 882 |
| 885 const LayoutBox& box = ToLayoutBox(object); | 883 const LayoutBox& box = ToLayoutBox(object); |
| 886 auto* scrollable_area = box.GetScrollableArea(); | 884 auto* scrollable_area = box.GetScrollableArea(); |
| 887 IntSize scroll_offset = box.ScrolledContentOffset(); | 885 IntSize scroll_offset = box.ScrolledContentOffset(); |
| 888 if (scroll_node_needed_for_main_thread_reasons || | 886 if (!scroll_offset.IsZero() || scrollable_area->ScrollsOverflow()) { |
| 889 !scroll_offset.IsZero() || scrollable_area->ScrollsOverflow()) { | |
| 890 needs_scroll_properties = true; | 887 needs_scroll_properties = true; |
| 891 auto& properties = | 888 auto& properties = |
| 892 object.GetMutableForPainting().EnsurePaintProperties(); | 889 object.GetMutableForPainting().EnsurePaintProperties(); |
| 893 | 890 |
| 894 IntSize scroll_clip = scrollable_area->VisibleContentRect().Size(); | 891 IntSize scroll_clip = scrollable_area->VisibleContentRect().Size(); |
| 895 IntSize scroll_bounds = scrollable_area->ContentsSize(); | 892 IntSize scroll_bounds = scrollable_area->ContentsSize(); |
| 896 bool user_scrollable_horizontal = | 893 bool user_scrollable_horizontal = |
| 897 scrollable_area->UserInputScrollable(kHorizontalScrollbar); | 894 scrollable_area->UserInputScrollable(kHorizontalScrollbar); |
| 898 bool user_scrollable_vertical = | 895 bool user_scrollable_vertical = |
| 899 scrollable_area->UserInputScrollable(kVerticalScrollbar); | 896 scrollable_area->UserInputScrollable(kVerticalScrollbar); |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1157 UpdateOverflowClip(object, context); | 1154 UpdateOverflowClip(object, context); |
| 1158 UpdatePerspective(object, context); | 1155 UpdatePerspective(object, context); |
| 1159 UpdateSvgLocalToBorderBoxTransform(object, context); | 1156 UpdateSvgLocalToBorderBoxTransform(object, context); |
| 1160 UpdateScrollAndScrollTranslation(object, context); | 1157 UpdateScrollAndScrollTranslation(object, context); |
| 1161 UpdateOutOfFlowContext(object, context); | 1158 UpdateOutOfFlowContext(object, context); |
| 1162 | 1159 |
| 1163 context.force_subtree_update |= object.SubtreeNeedsPaintPropertyUpdate(); | 1160 context.force_subtree_update |= object.SubtreeNeedsPaintPropertyUpdate(); |
| 1164 } | 1161 } |
| 1165 | 1162 |
| 1166 } // namespace blink | 1163 } // namespace blink |
| OLD | NEW |