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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h

Issue 1308273010: Adapt and reland old position sticky implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Merge and attempt to fix base URL Created 5 years, 2 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
Index: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h
index 4eb861390945b560eef81cecbd34962362a71cf0..7e1d0e96d97c820972880f796c11883969010be5 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h
@@ -62,6 +62,7 @@ enum ContentChangeType {
};
class InlineFlowBox;
+class StickyPositionViewportConstraints;
// This class is the base class for all CSS objects.
//
@@ -140,6 +141,12 @@ public:
LayoutSize relativePositionOffset() const;
LayoutSize relativePositionLogicalOffset() const { return style()->isHorizontalWritingMode() ? relativePositionOffset() : relativePositionOffset().transposedSize(); }
+ // Populates StickyPositionConstraints, setting the sticky box rect, containing block rect and updating
+ // the constraint offsets according to the available space.
+ void computeStickyPositionConstraints(StickyPositionViewportConstraints&, const LayoutRect& constrainingRect) const;
+ LayoutRect computeStickyConstrainingRect() const;
+ LayoutSize stickyPositionOffset() const;
+
LayoutSize offsetForInFlowPosition() const;
// IE extensions. Used to calculate offsetWidth/Height. Overridden by inlines (LayoutFlow)
@@ -350,6 +357,10 @@ private:
LayoutUnit computedCSSPadding(const Length&) const;
bool isBoxModelObject() const final { return true; }
+ // Returns the bounding rectangle to be used when determining sticky positioning offset. This is the frame rect
+ // for box objects and the lines bounding box for inline objects.
+ virtual LayoutRect frameRectForStickyPositioning() const = 0;
+
// The PaintLayer associated with this object.
// |m_layer| can be nullptr depending on the return value of layerTypeRequired().
OwnPtr<PaintLayer> m_layer;

Powered by Google App Engine
This is Rietveld 408576698