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

Side by Side Diff: third_party/WebKit/public/platform/WebLayerStickyPositionConstraint.h

Issue 2733633002: Handle nested position:sticky elements correctly (compositor) (Closed)
Patch Set: Addressed the easier reviewer comments. 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 13 matching lines...) Expand all
24 */ 24 */
25 25
26 #ifndef WebLayerStickyPositionConstraint_h 26 #ifndef WebLayerStickyPositionConstraint_h
27 #define WebLayerStickyPositionConstraint_h 27 #define WebLayerStickyPositionConstraint_h
28 28
29 #include "public/platform/WebPoint.h" 29 #include "public/platform/WebPoint.h"
30 #include "public/platform/WebRect.h" 30 #include "public/platform/WebRect.h"
31 31
32 namespace blink { 32 namespace blink {
33 33
34 class WebLayer;
35
34 // TODO(flackr): Combine with WebLayerPositionConstraint. 36 // TODO(flackr): Combine with WebLayerPositionConstraint.
35 struct WebLayerStickyPositionConstraint { 37 struct WebLayerStickyPositionConstraint {
36 // True if the layer is sticky. 38 // True if the layer is sticky.
37 bool isSticky : 1; 39 bool isSticky : 1;
38 40
39 // For each edge, true if the layer should stick to that edge of its 41 // For each edge, true if the layer should stick to that edge of its
40 // ancestor scroller (or the viewport). 42 // ancestor scroller (or the viewport).
41 bool isAnchoredLeft : 1; 43 bool isAnchoredLeft : 1;
42 bool isAnchoredRight : 1; 44 bool isAnchoredRight : 1;
43 bool isAnchoredTop : 1; 45 bool isAnchoredTop : 1;
(...skipping 11 matching lines...) Expand all
55 WebPoint parentRelativeStickyBoxOffset; 57 WebPoint parentRelativeStickyBoxOffset;
56 58
57 // The layout rectangle of the sticky element before it has been shifted 59 // The layout rectangle of the sticky element before it has been shifted
58 // to stick. 60 // to stick.
59 WebRect scrollContainerRelativeStickyBoxRect; 61 WebRect scrollContainerRelativeStickyBoxRect;
60 62
61 // The layout rectangle of the containing block edges which this sticky 63 // The layout rectangle of the containing block edges which this sticky
62 // element should not be shifted beyond. 64 // element should not be shifted beyond.
63 WebRect scrollContainerRelativeContainingBlockRect; 65 WebRect scrollContainerRelativeContainingBlockRect;
64 66
67 WebLayer* nearestLayerShiftingStickyBox;
68 WebLayer* nearestLayerShiftingContainingBlock;
69
70 WebFloatSize localStickyOffset;
71
65 WebLayerStickyPositionConstraint() 72 WebLayerStickyPositionConstraint()
66 : isSticky(false), 73 : isSticky(false),
67 isAnchoredLeft(false), 74 isAnchoredLeft(false),
68 isAnchoredRight(false), 75 isAnchoredRight(false),
69 isAnchoredTop(false), 76 isAnchoredTop(false),
70 isAnchoredBottom(false), 77 isAnchoredBottom(false),
71 leftOffset(0.f), 78 leftOffset(0.f),
72 rightOffset(0.f), 79 rightOffset(0.f),
73 topOffset(0.f), 80 topOffset(0.f),
74 bottomOffset(0.f) {} 81 bottomOffset(0.f),
82 nearestLayerShiftingStickyBox(nullptr),
83 nearestLayerShiftingContainingBlock(nullptr) {}
75 }; 84 };
76 85
77 } // namespace blink 86 } // namespace blink
78 87
79 #endif // WebLayerStickyPositionConstraint_h 88 #endif // WebLayerStickyPositionConstraint_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698