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

Unified Diff: Source/core/rendering/RenderBoxModelObject.cpp

Issue 168823003: Take padding into account during calculation of overflow constraining rect for sticky positioning. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased patch. Created 6 years, 10 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 | « LayoutTests/fast/css/sticky/sticky-bottom-overflow-padding-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBoxModelObject.cpp
diff --git a/Source/core/rendering/RenderBoxModelObject.cpp b/Source/core/rendering/RenderBoxModelObject.cpp
index b48e46fa3f563c3b63756aed356161944f40261c..bae01cbfebfa2248c829e08f2e9cd5a0a95509ad 100644
--- a/Source/core/rendering/RenderBoxModelObject.cpp
+++ b/Source/core/rendering/RenderBoxModelObject.cpp
@@ -337,6 +337,9 @@ LayoutSize RenderBoxModelObject::stickyPositionOffset() const
if (enclosingClippingLayer) {
RenderBox* enclosingClippingBox = toRenderBox(enclosingClippingLayer->renderer());
LayoutRect clipRect = enclosingClippingBox->overflowClipRect(LayoutPoint());
+ clipRect.move(enclosingClippingBox->paddingLeft(), enclosingClippingBox->paddingTop());
+ clipRect.contract(LayoutSize(enclosingClippingBox->paddingLeft() + enclosingClippingBox->paddingRight(),
+ enclosingClippingBox->paddingTop() + enclosingClippingBox->paddingBottom()));
constrainingRect = enclosingClippingBox->localToContainerQuad(FloatRect(clipRect), view()).boundingBox();
} else {
LayoutRect viewportRect = view()->frameView()->viewportConstrainedVisibleContentRect();
« no previous file with comments | « LayoutTests/fast/css/sticky/sticky-bottom-overflow-padding-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698