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

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

Issue 2733633002: Handle nested position:sticky elements correctly (compositor) (Closed)
Patch Set: Fix unittest Created 3 years, 9 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 // 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 struct StickyPositionNodeData { 108 struct StickyPositionNodeData {
109 int scroll_ancestor; 109 int scroll_ancestor;
110 LayerStickyPositionConstraint constraints; 110 LayerStickyPositionConstraint constraints;
111 111
112 // This is the offset that blink has already applied to counteract the main 112 // This is the offset that blink has already applied to counteract the main
113 // thread scroll offset of the scroll ancestor. We need to account for this 113 // thread scroll offset of the scroll ancestor. We need to account for this
114 // by computing the additional offset necessary to keep the element stuck. 114 // by computing the additional offset necessary to keep the element stuck.
115 gfx::Vector2dF main_thread_offset; 115 gfx::Vector2dF main_thread_offset;
116 116
117 StickyPositionNodeData() : scroll_ancestor(-1) {} 117 int nearest_node_shifting_sticky_box;
flackr 2017/03/09 20:22:08 nit: Add a comment about these new members.
smcgruer 2017/03/10 16:37:10 Done.
118 int nearest_node_shifting_containing_block;
119
120 StickyPositionNodeData()
121 : scroll_ancestor(-1),
122 nearest_node_shifting_sticky_box(-1),
123 nearest_node_shifting_containing_block(-1) {}
118 }; 124 };
119 125
120 class CC_EXPORT TransformTree final : public PropertyTree<TransformNode> { 126 class CC_EXPORT TransformTree final : public PropertyTree<TransformNode> {
121 public: 127 public:
122 TransformTree(); 128 TransformTree();
123 129
124 // These C++ special member functions cannot be implicit inline because 130 // These C++ special member functions cannot be implicit inline because
125 // they are exported by CC_EXPORT. They will be instantiated in every 131 // they are exported by CC_EXPORT. They will be instantiated in every
126 // compilation units that included this header, and compilation can fail 132 // compilation units that included this header, and compilation can fail
127 // because TransformCachedNodeData may be incomplete. 133 // because TransformCachedNodeData may be incomplete.
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 DrawTransforms& GetDrawTransforms(int transform_id, int effect_id) const; 669 DrawTransforms& GetDrawTransforms(int transform_id, int effect_id) const;
664 DrawTransformData& FetchDrawTransformsDataFromCache(int transform_id, 670 DrawTransformData& FetchDrawTransformsDataFromCache(int transform_id,
665 int effect_id) const; 671 int effect_id) const;
666 672
667 PropertyTreesCachedData cached_data_; 673 PropertyTreesCachedData cached_data_;
668 }; 674 };
669 675
670 } // namespace cc 676 } // namespace cc
671 677
672 #endif // CC_TREES_PROPERTY_TREE_H_ 678 #endif // CC_TREES_PROPERTY_TREE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698