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

Side by Side Diff: cc/trees/property_tree.h

Issue 2911463002: Unify the calculation of main thread offset of sticky element (Closed)
Patch Set: Bug fix Created 3 years, 6 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
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CC_TREES_PROPERTY_TREE_H_ 5 #ifndef CC_TREES_PROPERTY_TREE_H_
6 #define CC_TREES_PROPERTY_TREE_H_ 6 #define CC_TREES_PROPERTY_TREE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 std::vector<int> nodes_affected_by_inner_viewport_bounds_delta_; 321 std::vector<int> nodes_affected_by_inner_viewport_bounds_delta_;
322 std::vector<int> nodes_affected_by_outer_viewport_bounds_delta_; 322 std::vector<int> nodes_affected_by_outer_viewport_bounds_delta_;
323 std::vector<TransformCachedNodeData> cached_data_; 323 std::vector<TransformCachedNodeData> cached_data_;
324 std::vector<StickyPositionNodeData> sticky_position_data_; 324 std::vector<StickyPositionNodeData> sticky_position_data_;
325 }; 325 };
326 326
327 struct StickyPositionNodeData { 327 struct StickyPositionNodeData {
328 int scroll_ancestor; 328 int scroll_ancestor;
329 LayerStickyPositionConstraint constraints; 329 LayerStickyPositionConstraint constraints;
330 330
331 // This is the offset that blink has already applied to counteract the main
332 // thread scroll offset of the scroll ancestor. We need to account for this
333 // by computing the additional offset necessary to keep the element stuck.
334 gfx::Vector2dF main_thread_offset;
335
336 // In order to properly compute the sticky offset, we need to know if we have 331 // In order to properly compute the sticky offset, we need to know if we have
337 // any sticky ancestors both between ourselves and our containing block and 332 // any sticky ancestors both between ourselves and our containing block and
338 // between our containing block and the viewport. These ancestors are then 333 // between our containing block and the viewport. These ancestors are then
339 // used to correct the constraining rect locations. 334 // used to correct the constraining rect locations.
340 int nearest_node_shifting_sticky_box; 335 int nearest_node_shifting_sticky_box;
341 int nearest_node_shifting_containing_block; 336 int nearest_node_shifting_containing_block;
342 337
343 // For performance we cache our accumulated sticky offset to allow descendant 338 // For performance we cache our accumulated sticky offset to allow descendant
344 // sticky elements to offset their constraint rects. Because we can either 339 // sticky elements to offset their constraint rects. Because we can either
345 // affect the sticky box constraint rect or the containing block constraint 340 // affect the sticky box constraint rect or the containing block constraint
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 DrawTransforms& GetDrawTransforms(int transform_id, int effect_id) const; 750 DrawTransforms& GetDrawTransforms(int transform_id, int effect_id) const;
756 DrawTransformData& FetchDrawTransformsDataFromCache(int transform_id, 751 DrawTransformData& FetchDrawTransformsDataFromCache(int transform_id,
757 int effect_id) const; 752 int effect_id) const;
758 753
759 PropertyTreesCachedData cached_data_; 754 PropertyTreesCachedData cached_data_;
760 }; 755 };
761 756
762 } // namespace cc 757 } // namespace cc
763 758
764 #endif // CC_TREES_PROPERTY_TREE_H_ 759 #endif // CC_TREES_PROPERTY_TREE_H_
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698