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

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

Issue 1974953002: Descend into node with overflow and floating content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/layout/ScrollAnchor.cpp
diff --git a/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp b/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
index 54a0ed6038e088ab2d9485421ceac7a778233693..566951ee6049eab0999e8050c0934a24939ad20a 100644
--- a/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
+++ b/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
@@ -73,6 +73,14 @@ static LayoutRect relativeBounds(const LayoutObject* layoutObject, const Scrolla
LayoutRect localBounds;
if (layoutObject->isBox()) {
localBounds = toLayoutBox(layoutObject)->borderBoxRect();
+ // borderBoxRect doesn't include overflow content and floats.
+ LayoutUnit maxHeight = std::max(localBounds.height(), toLayoutBox(layoutObject)->layoutOverflowRect().height());
+ if (layoutObject->isLayoutBlockFlow() && toLayoutBlockFlow(layoutObject)->containsFloats()) {
+ // Note that lowestFloatLogicalBottom doesn't include floating
+ // grandchildren.
+ maxHeight = std::max(maxHeight, toLayoutBlockFlow(layoutObject)->lowestFloatLogicalBottom());
+ }
+ localBounds.setHeight(maxHeight);
} else if (layoutObject->isText()) {
// TODO(skobes): Use first and last InlineTextBox only?
for (InlineTextBox* box = toLayoutText(layoutObject)->firstTextBox(); box; box = box->nextTextBox())
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.h ('k') | third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698