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

Unified Diff: third_party/WebKit/public/platform/WebLayerStickyPositionConstraint.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/public/platform/WebLayer.h ('k') | ui/gfx/transform.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/public/platform/WebLayerStickyPositionConstraint.h
diff --git a/third_party/WebKit/public/platform/WebLayerStickyPositionConstraint.h b/third_party/WebKit/public/platform/WebLayerStickyPositionConstraint.h
new file mode 100644
index 0000000000000000000000000000000000000000..880260b8f8d593bf7317908451322a46d46ffcc5
--- /dev/null
+++ b/third_party/WebKit/public/platform/WebLayerStickyPositionConstraint.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebLayerStickyPositionConstraint_h
+#define WebLayerStickyPositionConstraint_h
+
+namespace blink {
+
+// TODO(flackr): Combine with WebLayerPositionConstraint.
+struct WebLayerStickyPositionConstraint {
+ // True if the layer is sticky.
+ bool isSticky : 1;
+
+ // For each edge, true if the layer should stick to that edge of its
+ // ancestor scroller (or the viewport).
+ bool isAnchoredLeft : 1;
+ bool isAnchoredRight : 1;
+ bool isAnchoredTop : 1;
+ bool isAnchoredBottom : 1;
+
+ // For each edge, when the anchored bit above is set this gives the distance
+ // to keep the element from that edge of the ancestor scroller or viewport.
+ float leftOffset;
+ float rightOffset;
+ float topOffset;
+ float bottomOffset;
+
+ // The layout rectangle of the sticky element before it has been shifted
+ // to stick.
+ WebRect scrollContainerRelativeStickyBoxRect;
+
+ // The layout rectangle of the containing block edges which this sticky
+ // element should not be shifted beyond.
+ WebRect scrollContainerRelativeContainingBlockRect;
+
+ WebLayerStickyPositionConstraint()
+ : isSticky(false)
+ , isAnchoredLeft(false)
+ , isAnchoredRight(false)
+ , isAnchoredTop(false)
+ , isAnchoredBottom(false)
+ , leftOffset(0.f)
+ , rightOffset(0.f)
+ , topOffset(0.f)
+ , bottomOffset(0.f)
+ {
+ }
+};
+
+} // namespace blink
+
+#endif // WebLayerStickyPositionConstraint_h
+
« no previous file with comments | « third_party/WebKit/public/platform/WebLayer.h ('k') | ui/gfx/transform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698