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

Unified Diff: third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.h

Issue 2733633002: Handle nested position:sticky elements correctly (compositor) (Closed)
Patch Set: Add comment referencing crbug.com/702229 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.h
diff --git a/third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.h b/third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.h
index 84dab3cc2f76ad7170d18bed9235375e5dc16c62..c31d9e89ab371e497a0c2ca1fe1c5e82168651c9 100644
--- a/third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.h
+++ b/third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.h
@@ -48,7 +48,8 @@ class StickyPositionScrollingConstraints final {
other.m_nearestStickyBoxShiftingContainingBlock),
m_totalStickyBoxStickyOffset(other.m_totalStickyBoxStickyOffset),
m_totalContainingBlockStickyOffset(
- other.m_totalContainingBlockStickyOffset) {}
+ other.m_totalContainingBlockStickyOffset),
+ m_localStickyOffset(other.m_localStickyOffset) {}
FloatSize computeStickyOffset(
const FloatRect& viewportRect,
@@ -113,6 +114,12 @@ class StickyPositionScrollingConstraints final {
return m_totalContainingBlockStickyOffset;
}
+ const LayoutBoxModelObject* nearestStickyAncestor() const {
+ return m_nearestStickyBoxShiftingStickyBox
+ ? m_nearestStickyBoxShiftingStickyBox
+ : m_nearestStickyBoxShiftingContainingBlock;
+ }
+
bool operator==(const StickyPositionScrollingConstraints& other) const {
return m_leftOffset == other.m_leftOffset &&
m_rightOffset == other.m_rightOffset &&
@@ -128,7 +135,8 @@ class StickyPositionScrollingConstraints final {
other.m_nearestStickyBoxShiftingContainingBlock &&
m_totalStickyBoxStickyOffset == other.m_totalStickyBoxStickyOffset &&
m_totalContainingBlockStickyOffset ==
- other.m_totalContainingBlockStickyOffset;
+ other.m_totalContainingBlockStickyOffset &&
+ m_localStickyOffset == other.m_localStickyOffset;
}
bool operator!=(const StickyPositionScrollingConstraints& other) const {
@@ -163,6 +171,8 @@ class StickyPositionScrollingConstraints final {
// LayoutBoxModelObjectTest.cpp.
FloatSize m_totalStickyBoxStickyOffset;
FloatSize m_totalContainingBlockStickyOffset;
+
+ FloatSize m_localStickyOffset;
flackr 2017/03/17 15:01:56 This seems unused, remove it?
smcgruer 2017/03/17 17:36:52 Done.
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698