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

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

Issue 2769793002: Implement CSS: scroll-boundary-behavior (Closed)
Patch Set: Update WebScrollBoundaryBehavior. Created 3 years, 7 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 #include "platform/graphics/GraphicsContext.h" 72 #include "platform/graphics/GraphicsContext.h"
73 #include "platform/graphics/paint/ClipDisplayItem.h" 73 #include "platform/graphics/paint/ClipDisplayItem.h"
74 #include "platform/graphics/paint/CullRect.h" 74 #include "platform/graphics/paint/CullRect.h"
75 #include "platform/graphics/paint/DrawingRecorder.h" 75 #include "platform/graphics/paint/DrawingRecorder.h"
76 #include "platform/graphics/paint/PaintController.h" 76 #include "platform/graphics/paint/PaintController.h"
77 #include "platform/graphics/paint/PaintRecordBuilder.h" 77 #include "platform/graphics/paint/PaintRecordBuilder.h"
78 #include "platform/graphics/paint/TransformDisplayItem.h" 78 #include "platform/graphics/paint/TransformDisplayItem.h"
79 #include "platform/wtf/CurrentTime.h" 79 #include "platform/wtf/CurrentTime.h"
80 #include "platform/wtf/text/StringBuilder.h" 80 #include "platform/wtf/text/StringBuilder.h"
81 #include "public/platform/WebLayerStickyPositionConstraint.h" 81 #include "public/platform/WebLayerStickyPositionConstraint.h"
82 #include "public/platform/WebScrollBoundaryBehavior.h"
82 83
83 namespace blink { 84 namespace blink {
84 85
85 using namespace HTMLNames; 86 using namespace HTMLNames;
86 87
87 static IntRect ClipBox(LayoutBox& layout_object); 88 static IntRect ClipBox(LayoutBox& layout_object);
88 89
89 static IntRect ContentsRect(const LayoutObject& layout_object) { 90 static IntRect ContentsRect(const LayoutObject& layout_object) {
90 if (!layout_object.IsBox()) 91 if (!layout_object.IsBox())
91 return IntRect(); 92 return IntRect();
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 UpdateDrawsContent(); 1149 UpdateDrawsContent();
1149 UpdateElementIdAndCompositorMutableProperties(); 1150 UpdateElementIdAndCompositorMutableProperties();
1150 UpdateBackgroundPaintsOntoScrollingContentsLayer(); 1151 UpdateBackgroundPaintsOntoScrollingContentsLayer();
1151 UpdateContentsOpaque(); 1152 UpdateContentsOpaque();
1152 UpdateRasterizationPolicy(); 1153 UpdateRasterizationPolicy();
1153 UpdateAfterPartResize(); 1154 UpdateAfterPartResize();
1154 UpdateRenderingContext(); 1155 UpdateRenderingContext();
1155 UpdateShouldFlattenTransform(); 1156 UpdateShouldFlattenTransform();
1156 UpdateChildrenTransform(); 1157 UpdateChildrenTransform();
1157 UpdateScrollParent(ScrollParent()); 1158 UpdateScrollParent(ScrollParent());
1159 UpdateScrollBoundaryBehavior();
1158 RegisterScrollingLayers(); 1160 RegisterScrollingLayers();
1159 1161
1160 UpdateCompositingReasons(); 1162 UpdateCompositingReasons();
1161 } 1163 }
1162 1164
1165 void CompositedLayerMapping::UpdateScrollBoundaryBehavior() {
1166 EScrollBoundaryBehavior behavior_x =
1167 GetLayoutObject().StyleRef().ScrollBoundaryBehaviorX();
1168 EScrollBoundaryBehavior behavior_y =
1169 GetLayoutObject().StyleRef().ScrollBoundaryBehaviorY();
1170 if (scrolling_contents_layer_) {
1171 using ScrollBoundaryBehavior =
1172 WebScrollBoundaryBehavior::ScrollBoundaryBehaviorType;
1173 scrolling_contents_layer_->SetScrollBoundaryBehavior(
1174 WebScrollBoundaryBehavior(
1175 static_cast<ScrollBoundaryBehavior>(behavior_x),
1176 static_cast<ScrollBoundaryBehavior>(behavior_y)));
1177 }
1178 }
1179
1163 void CompositedLayerMapping::UpdateMainGraphicsLayerGeometry( 1180 void CompositedLayerMapping::UpdateMainGraphicsLayerGeometry(
1164 const IntRect& relative_compositing_bounds, 1181 const IntRect& relative_compositing_bounds,
1165 const IntRect& local_compositing_bounds, 1182 const IntRect& local_compositing_bounds,
1166 const IntPoint& graphics_layer_parent_location) { 1183 const IntPoint& graphics_layer_parent_location) {
1167 graphics_layer_->SetPosition(FloatPoint( 1184 graphics_layer_->SetPosition(FloatPoint(
1168 relative_compositing_bounds.Location() - graphics_layer_parent_location)); 1185 relative_compositing_bounds.Location() - graphics_layer_parent_location));
1169 graphics_layer_->SetOffsetFromLayoutObject( 1186 graphics_layer_->SetOffsetFromLayoutObject(
1170 ToIntSize(local_compositing_bounds.Location())); 1187 ToIntSize(local_compositing_bounds.Location()));
1171 1188
1172 FloatSize old_size = graphics_layer_->Size(); 1189 FloatSize old_size = graphics_layer_->Size();
(...skipping 2461 matching lines...) Expand 10 before | Expand all | Expand 10 after
3634 } else if (graphics_layer == decoration_outline_layer_.get()) { 3651 } else if (graphics_layer == decoration_outline_layer_.get()) {
3635 name = "Decoration Layer"; 3652 name = "Decoration Layer";
3636 } else { 3653 } else {
3637 NOTREACHED(); 3654 NOTREACHED();
3638 } 3655 }
3639 3656
3640 return name; 3657 return name;
3641 } 3658 }
3642 3659
3643 } // namespace blink 3660 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698