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

Side by Side Diff: cc/layers/layer_sticky_position_constraint.h

Issue 2251303003: Implement position: sticky updates on compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with master and add comments to WebLayerStickyPositionConstraint members. Created 4 years, 3 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/layers/layer_impl_test_properties.h ('k') | cc/layers/layer_sticky_position_constraint.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CC_LAYERS_LAYER_STICKY_POSITION_CONSTRAINT_H_
6 #define CC_LAYERS_LAYER_STICKY_POSITION_CONSTRAINT_H_
7
8 #include "cc/base/cc_export.h"
9
10 #include "ui/gfx/geometry/rect.h"
11
12 namespace cc {
13
14 namespace proto {
15 class LayerStickyPositionConstraint;
16 }
17
18 struct CC_EXPORT LayerStickyPositionConstraint {
19 LayerStickyPositionConstraint();
20 LayerStickyPositionConstraint(const LayerStickyPositionConstraint& other);
21
22 bool is_sticky : 1;
23 bool is_anchored_left : 1;
24 bool is_anchored_right : 1;
25 bool is_anchored_top : 1;
26 bool is_anchored_bottom : 1;
27
28 // The offset from each edge of the ancestor scroller (or the viewport) to
29 // try to maintain to the sticky box as we scroll.
30 float left_offset;
31 float right_offset;
32 float top_offset;
33 float bottom_offset;
34
35 // The rectangle corresponding to original layout position of the sticky box
36 // relative to the scroll ancestor. The sticky box is only offset once the
37 // scroll has passed its initial position (e.g. top_offset will only push
38 // the element down from its original position).
39 gfx::Rect scroll_container_relative_sticky_box_rect;
40
41 // The layout rectangle of the sticky box's containing block relative to the
42 // scroll ancestor. The sticky box is only moved as far as its containing
43 // block boundary.
44 gfx::Rect scroll_container_relative_containing_block_rect;
45
46 void ToProtobuf(proto::LayerStickyPositionConstraint* proto) const;
47 void FromProtobuf(const proto::LayerStickyPositionConstraint& proto);
48
49 bool operator==(const LayerStickyPositionConstraint&) const;
50 bool operator!=(const LayerStickyPositionConstraint&) const;
51 };
52
53 } // namespace cc
54
55 #endif // CC_LAYERS_LAYER_STICKY_POSITION_CONSTRAINT_H_
OLDNEW
« no previous file with comments | « cc/layers/layer_impl_test_properties.h ('k') | cc/layers/layer_sticky_position_constraint.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698