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

Unified Diff: third_party/WebKit/Source/core/layout/ScrollAnchor.cpp

Issue 2662443003: Fix treatment of layout overflow rect in ScrollAnchor bounds computation. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
diff --git a/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp b/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
index 84badd5c5795f83e255c1b6f76b63f61b0f38687..68b2bb225f5e830dd7e6b97e28d2e673c0f73e29 100644
--- a/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
+++ b/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
@@ -76,18 +76,17 @@ static LayoutRect relativeBounds(const LayoutObject* layoutObject,
localBounds = toLayoutBox(layoutObject)->borderBoxRect();
if (!layoutObject->hasOverflowClip()) {
// borderBoxRect doesn't include overflow content and floats.
- LayoutUnit maxHeight =
- std::max(localBounds.height(),
- toLayoutBox(layoutObject)->layoutOverflowRect().height());
+ LayoutUnit maxY =
+ std::max(localBounds.maxY(),
+ toLayoutBox(layoutObject)->layoutOverflowRect().maxY());
if (layoutObject->isLayoutBlockFlow() &&
toLayoutBlockFlow(layoutObject)->containsFloats()) {
// Note that lowestFloatLogicalBottom doesn't include floating
// grandchildren.
- maxHeight = std::max(
- maxHeight,
- toLayoutBlockFlow(layoutObject)->lowestFloatLogicalBottom());
+ maxY = std::max(
+ maxY, toLayoutBlockFlow(layoutObject)->lowestFloatLogicalBottom());
}
- localBounds.setHeight(maxHeight);
+ localBounds.shiftMaxYEdgeTo(maxY);
}
} else if (layoutObject->isText()) {
// TODO(skobes): Use first and last InlineTextBox only?
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698