OLD | NEW |
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 Loading... |
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 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 UpdateDrawsContent(); | 1132 UpdateDrawsContent(); |
1132 UpdateElementId(); | 1133 UpdateElementId(); |
1133 UpdateBackgroundPaintsOntoScrollingContentsLayer(); | 1134 UpdateBackgroundPaintsOntoScrollingContentsLayer(); |
1134 UpdateContentsOpaque(); | 1135 UpdateContentsOpaque(); |
1135 UpdateRasterizationPolicy(); | 1136 UpdateRasterizationPolicy(); |
1136 UpdateAfterPartResize(); | 1137 UpdateAfterPartResize(); |
1137 UpdateRenderingContext(); | 1138 UpdateRenderingContext(); |
1138 UpdateShouldFlattenTransform(); | 1139 UpdateShouldFlattenTransform(); |
1139 UpdateChildrenTransform(); | 1140 UpdateChildrenTransform(); |
1140 UpdateScrollParent(ScrollParent()); | 1141 UpdateScrollParent(ScrollParent()); |
| 1142 UpdateScrollBoundaryBehavior(); |
1141 RegisterScrollingLayers(); | 1143 RegisterScrollingLayers(); |
1142 | 1144 |
1143 UpdateCompositingReasons(); | 1145 UpdateCompositingReasons(); |
1144 } | 1146 } |
1145 | 1147 |
| 1148 void CompositedLayerMapping::UpdateScrollBoundaryBehavior() { |
| 1149 EScrollBoundaryBehavior behavior_x = |
| 1150 GetLayoutObject().StyleRef().ScrollBoundaryBehaviorX(); |
| 1151 EScrollBoundaryBehavior behavior_y = |
| 1152 GetLayoutObject().StyleRef().ScrollBoundaryBehaviorY(); |
| 1153 if (scrolling_contents_layer_) { |
| 1154 scrolling_contents_layer_->SetScrollBoundaryBehavior( |
| 1155 WebScrollBoundaryBehavior( |
| 1156 static_cast<WebScrollBoundaryBehavior::ScrollBoundaryBehaviorType>( |
| 1157 behavior_x), |
| 1158 static_cast<WebScrollBoundaryBehavior::ScrollBoundaryBehaviorType>( |
| 1159 behavior_y))); |
| 1160 } |
| 1161 } |
| 1162 |
1146 void CompositedLayerMapping::UpdateMainGraphicsLayerGeometry( | 1163 void CompositedLayerMapping::UpdateMainGraphicsLayerGeometry( |
1147 const IntRect& relative_compositing_bounds, | 1164 const IntRect& relative_compositing_bounds, |
1148 const IntRect& local_compositing_bounds, | 1165 const IntRect& local_compositing_bounds, |
1149 const IntPoint& graphics_layer_parent_location) { | 1166 const IntPoint& graphics_layer_parent_location) { |
1150 // Find and remove the offset applied for sticky position if the compositor | 1167 // Find and remove the offset applied for sticky position if the compositor |
1151 // will shift the layer for sticky position to avoid offsetting the layer | 1168 // will shift the layer for sticky position to avoid offsetting the layer |
1152 // twice. | 1169 // twice. |
1153 FloatSize offset_for_sticky_position; | 1170 FloatSize offset_for_sticky_position; |
1154 if (UsesCompositedStickyPosition()) { | 1171 if (UsesCompositedStickyPosition()) { |
1155 const StickyConstraintsMap& constraints_map = | 1172 const StickyConstraintsMap& constraints_map = |
(...skipping 2442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3598 } else if (graphics_layer == decoration_outline_layer_.get()) { | 3615 } else if (graphics_layer == decoration_outline_layer_.get()) { |
3599 name = "Decoration Layer"; | 3616 name = "Decoration Layer"; |
3600 } else { | 3617 } else { |
3601 NOTREACHED(); | 3618 NOTREACHED(); |
3602 } | 3619 } |
3603 | 3620 |
3604 return name; | 3621 return name; |
3605 } | 3622 } |
3606 | 3623 |
3607 } // namespace blink | 3624 } // namespace blink |
OLD | NEW |