Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 766 return offset; | 766 return offset; |
| 767 } | 767 } |
| 768 | 768 |
| 769 void LayoutBoxModelObject::updateStickyPositionConstraints() const { | 769 void LayoutBoxModelObject::updateStickyPositionConstraints() const { |
| 770 const FloatSize constrainingSize = computeStickyConstrainingRect().size(); | 770 const FloatSize constrainingSize = computeStickyConstrainingRect().size(); |
| 771 | 771 |
| 772 PaintLayerScrollableArea* scrollableArea = | 772 PaintLayerScrollableArea* scrollableArea = |
| 773 layer()->ancestorOverflowLayer()->getScrollableArea(); | 773 layer()->ancestorOverflowLayer()->getScrollableArea(); |
| 774 StickyPositionScrollingConstraints constraints; | 774 StickyPositionScrollingConstraints constraints; |
| 775 FloatSize skippedContainersOffset; | 775 FloatSize skippedContainersOffset; |
| 776 LayoutBlock* containingBlock = this->containingBlock(); | 776 LayoutBlock* containingBlock = this->containingBlock(); |
|
chrishtr
2017/01/20 19:20:57
Sort of unrelated to your CL:
LayoutObject::conta
flackr
2017/01/23 23:33:43
Hmm, this was definitely necessary at the time (an
| |
| 777 // Add offset from containing block contributed by location containers. | |
| 778 if (!isLayoutInline()) { | |
| 779 LayoutBox* locationContainer = toLayoutBox(this)->locationContainer(); | |
| 780 while (locationContainer && locationContainer != containingBlock) { | |
|
chrishtr
2017/01/20 19:20:57
I think this and other code in this method may be
Xianzhu
2017/01/20 23:04:01
I think localToAncestorPoint should work.
flackr
2017/01/23 23:33:43
Sure, although I need a version that excludes tran
Xianzhu
2017/01/24 00:00:39
I'm not familiar with the code here. Can you expla
flackr
2017/01/24 22:37:11
Sticky position offsets are computed in terms of l
| |
| 781 skippedContainersOffset += | |
| 782 toFloatSize(FloatPoint(locationContainer->frameRect().location())); | |
| 783 locationContainer = locationContainer->locationContainer(); | |
| 784 } | |
| 785 } | |
| 777 // Skip anonymous containing blocks. | 786 // Skip anonymous containing blocks. |
| 778 while (containingBlock->isAnonymous()) { | 787 while (containingBlock->isAnonymous()) { |
| 779 skippedContainersOffset += | 788 skippedContainersOffset += |
| 780 toFloatSize(FloatPoint(containingBlock->frameRect().location())); | 789 toFloatSize(FloatPoint(containingBlock->frameRect().location())); |
| 781 containingBlock = containingBlock->containingBlock(); | 790 containingBlock = containingBlock->containingBlock(); |
| 782 } | 791 } |
| 783 LayoutBox* scrollAncestor = | 792 LayoutBox* scrollAncestor = |
| 784 layer()->ancestorOverflowLayer()->isRootLayer() | 793 layer()->ancestorOverflowLayer()->isRootLayer() |
| 785 ? nullptr | 794 ? nullptr |
| 786 : toLayoutBox(layer()->ancestorOverflowLayer()->layoutObject()); | 795 : toLayoutBox(layer()->ancestorOverflowLayer()->layoutObject()); |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1340 if (rootElementStyle->hasBackground()) | 1349 if (rootElementStyle->hasBackground()) |
| 1341 return false; | 1350 return false; |
| 1342 | 1351 |
| 1343 if (node() != document().firstBodyElement()) | 1352 if (node() != document().firstBodyElement()) |
| 1344 return false; | 1353 return false; |
| 1345 | 1354 |
| 1346 return true; | 1355 return true; |
| 1347 } | 1356 } |
| 1348 | 1357 |
| 1349 } // namespace blink | 1358 } // namespace blink |
| OLD | NEW |