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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2769793002: Implement CSS: scroll-boundary-behavior (Closed)
Patch Set: update the tests Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 #include "platform/graphics/GraphicsContext.h" 74 #include "platform/graphics/GraphicsContext.h"
75 #include "platform/graphics/paint/ClipDisplayItem.h" 75 #include "platform/graphics/paint/ClipDisplayItem.h"
76 #include "platform/graphics/paint/CullRect.h" 76 #include "platform/graphics/paint/CullRect.h"
77 #include "platform/graphics/paint/DrawingRecorder.h" 77 #include "platform/graphics/paint/DrawingRecorder.h"
78 #include "platform/graphics/paint/PaintController.h" 78 #include "platform/graphics/paint/PaintController.h"
79 #include "platform/graphics/paint/PaintRecordBuilder.h" 79 #include "platform/graphics/paint/PaintRecordBuilder.h"
80 #include "platform/graphics/paint/TransformDisplayItem.h" 80 #include "platform/graphics/paint/TransformDisplayItem.h"
81 #include "platform/wtf/CurrentTime.h" 81 #include "platform/wtf/CurrentTime.h"
82 #include "platform/wtf/text/StringBuilder.h" 82 #include "platform/wtf/text/StringBuilder.h"
83 #include "public/platform/WebLayerStickyPositionConstraint.h" 83 #include "public/platform/WebLayerStickyPositionConstraint.h"
84 #include "public/platform/WebScrollBoundaryBehavior.h"
84 85
85 namespace blink { 86 namespace blink {
86 87
87 using namespace HTMLNames; 88 using namespace HTMLNames;
88 89
89 static IntRect ClipBox(LayoutBox& layout_object); 90 static IntRect ClipBox(LayoutBox& layout_object);
90 91
91 static IntRect ContentsRect(const LayoutObject& layout_object) { 92 static IntRect ContentsRect(const LayoutObject& layout_object) {
92 if (!layout_object.IsBox()) 93 if (!layout_object.IsBox())
93 return IntRect(); 94 return IntRect();
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 UpdateDrawsContent(); 1133 UpdateDrawsContent();
1133 UpdateElementId(); 1134 UpdateElementId();
1134 UpdateBackgroundPaintsOntoScrollingContentsLayer(); 1135 UpdateBackgroundPaintsOntoScrollingContentsLayer();
1135 UpdateContentsOpaque(); 1136 UpdateContentsOpaque();
1136 UpdateRasterizationPolicy(); 1137 UpdateRasterizationPolicy();
1137 UpdateAfterPartResize(); 1138 UpdateAfterPartResize();
1138 UpdateRenderingContext(); 1139 UpdateRenderingContext();
1139 UpdateShouldFlattenTransform(); 1140 UpdateShouldFlattenTransform();
1140 UpdateChildrenTransform(); 1141 UpdateChildrenTransform();
1141 UpdateScrollParent(ScrollParent()); 1142 UpdateScrollParent(ScrollParent());
1143 UpdateScrollBoundaryBehavior();
1142 RegisterScrollingLayers(); 1144 RegisterScrollingLayers();
1143 1145
1144 UpdateCompositingReasons(); 1146 UpdateCompositingReasons();
1145 } 1147 }
1146 1148
1149 void CompositedLayerMapping::UpdateScrollBoundaryBehavior() {
1150 EScrollBoundaryBehavior behavior_x =
1151 GetLayoutObject().StyleRef().ScrollBoundaryBehaviorX();
1152 EScrollBoundaryBehavior behavior_y =
1153 GetLayoutObject().StyleRef().ScrollBoundaryBehaviorY();
1154 if (scrolling_contents_layer_) {
1155 using ScrollBoundaryBehavior =
1156 WebScrollBoundaryBehavior::ScrollBoundaryBehaviorType;
majidvp 2017/07/05 21:30:03 nit: I don't feel like this using declaration is h
sunyunjia 2017/07/14 02:59:01 Done.
1157 scrolling_contents_layer_->SetScrollBoundaryBehavior(
1158 WebScrollBoundaryBehavior(
1159 static_cast<ScrollBoundaryBehavior>(behavior_x),
1160 static_cast<ScrollBoundaryBehavior>(behavior_y)));
1161 }
1162 }
1163
1147 void CompositedLayerMapping::UpdateMainGraphicsLayerGeometry( 1164 void CompositedLayerMapping::UpdateMainGraphicsLayerGeometry(
1148 const IntRect& relative_compositing_bounds, 1165 const IntRect& relative_compositing_bounds,
1149 const IntRect& local_compositing_bounds, 1166 const IntRect& local_compositing_bounds,
1150 const IntPoint& graphics_layer_parent_location) { 1167 const IntPoint& graphics_layer_parent_location) {
1151 // Find and remove the offset applied for sticky position if the compositor 1168 // Find and remove the offset applied for sticky position if the compositor
1152 // will shift the layer for sticky position to avoid offsetting the layer 1169 // will shift the layer for sticky position to avoid offsetting the layer
1153 // twice. 1170 // twice.
1154 FloatSize offset_for_sticky_position; 1171 FloatSize offset_for_sticky_position;
1155 if (UsesCompositedStickyPosition()) { 1172 if (UsesCompositedStickyPosition()) {
1156 const StickyConstraintsMap& constraints_map = 1173 const StickyConstraintsMap& constraints_map =
(...skipping 2442 matching lines...) Expand 10 before | Expand all | Expand 10 after
3599 } else if (graphics_layer == decoration_outline_layer_.get()) { 3616 } else if (graphics_layer == decoration_outline_layer_.get()) {
3600 name = "Decoration Layer"; 3617 name = "Decoration Layer";
3601 } else { 3618 } else {
3602 NOTREACHED(); 3619 NOTREACHED();
3603 } 3620 }
3604 3621
3605 return name; 3622 return name;
3606 } 3623 }
3607 3624
3608 } // namespace blink 3625 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698