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

Side by Side 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: 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 337
338 LayoutSize RenderBoxModelObject::stickyPositionOffset() const 338 LayoutSize RenderBoxModelObject::stickyPositionOffset() const
339 { 339 {
340 FloatRect constrainingRect; 340 FloatRect constrainingRect;
341 341
342 ASSERT(hasLayer()); 342 ASSERT(hasLayer());
343 RenderLayer* enclosingClippingLayer = layer()->enclosingOverflowClipLayer(Ex cludeSelf); 343 RenderLayer* enclosingClippingLayer = layer()->enclosingOverflowClipLayer(Ex cludeSelf);
344 if (enclosingClippingLayer) { 344 if (enclosingClippingLayer) {
345 RenderBox* enclosingClippingBox = toRenderBox(enclosingClippingLayer->re nderer()); 345 RenderBox* enclosingClippingBox = toRenderBox(enclosingClippingLayer->re nderer());
346 LayoutRect clipRect = enclosingClippingBox->overflowClipRect(LayoutPoint (), 0); // FIXME: make this work in regions. 346 LayoutRect clipRect = enclosingClippingBox->overflowClipRect(LayoutPoint (), 0); // FIXME: make this work in regions.
347 clipRect.move(enclosingClippingBox->paddingLeft(), enclosingClippingBox- >paddingTop());
ojan 2014/02/19 20:03:24 The equivalent webkit patch didn't have this (http
ostap 2014/02/19 20:50:00 Webkit takes padding into account for the position
348 clipRect.contract(LayoutSize(enclosingClippingBox->paddingLeft() + enclo singClippingBox->paddingRight(),
349 enclosingClippingBox->paddingTop() + enclosingClippingBox->paddingBo ttom()));
347 constrainingRect = enclosingClippingBox->localToContainerQuad(FloatRect( clipRect), view()).boundingBox(); 350 constrainingRect = enclosingClippingBox->localToContainerQuad(FloatRect( clipRect), view()).boundingBox();
348 } else { 351 } else {
349 LayoutRect viewportRect = view()->frameView()->viewportConstrainedVisibl eContentRect(); 352 LayoutRect viewportRect = view()->frameView()->viewportConstrainedVisibl eContentRect();
350 constrainingRect = viewportRect; 353 constrainingRect = viewportRect;
351 } 354 }
352 355
353 StickyPositionViewportConstraints constraints; 356 StickyPositionViewportConstraints constraints;
354 computeStickyPositionConstraints(constraints, constrainingRect); 357 computeStickyPositionConstraints(constraints, constrainingRect);
355 358
356 // The sticky offset is physical, so we can just return the delta computed i n absolute coords (though it may be wrong with transforms). 359 // The sticky offset is physical, so we can just return the delta computed i n absolute coords (though it may be wrong with transforms).
(...skipping 2439 matching lines...) Expand 10 before | Expand all | Expand 10 after
2796 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); 2799 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent());
2797 for (RenderObject* child = startChild; child && child != endChild; ) { 2800 for (RenderObject* child = startChild; child && child != endChild; ) {
2798 // Save our next sibling as moveChildTo will clear it. 2801 // Save our next sibling as moveChildTo will clear it.
2799 RenderObject* nextSibling = child->nextSibling(); 2802 RenderObject* nextSibling = child->nextSibling();
2800 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); 2803 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert);
2801 child = nextSibling; 2804 child = nextSibling;
2802 } 2805 }
2803 } 2806 }
2804 2807
2805 } // namespace WebCore 2808 } // namespace WebCore
OLDNEW
« 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