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 642b37ec1613f5c21cb729a55778a05187885cf5..2d805f19d6f25979023b1f490169cb57cc4a0e4d 100644 |
--- a/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp |
+++ b/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp |
@@ -28,6 +28,8 @@ ScrollAnchor::~ScrollAnchor() |
{ |
} |
+// TODO(pilgrim) replace all instances of scrollerLayoutBox with scrollerLayoutBoxItem |
+// https://crbug.com/499321 |
static LayoutBox* scrollerLayoutBox(const ScrollableArea* scroller) |
{ |
LayoutBox* box = scroller->isFrameView() |
@@ -37,6 +39,15 @@ static LayoutBox* scrollerLayoutBox(const ScrollableArea* scroller) |
return box; |
} |
+static LayoutBoxItem scrollerLayoutBoxItem(const ScrollableArea* scroller) |
+{ |
+ LayoutBoxItem box = scroller->isFrameView() |
+ ? toFrameView(scroller)->layoutViewItem() |
+ : LayoutBoxItem(&toPaintLayerScrollableArea(scroller)->box()); |
+ ASSERT(!box.isNull()); |
+ return box; |
+} |
+ |
static Corner cornerFromCandidateRect(LayoutRect candidateRect, LayoutRect visibleRect) |
{ |
if (visibleRect.contains(candidateRect.minXMinYCorner())) |
@@ -110,7 +121,7 @@ ScrollAnchor::ExamineResult ScrollAnchor::examine(const LayoutObject* candidate) |
return ExamineResult(Skip); |
LayoutRect candidateRect = relativeBounds(candidate, m_scroller); |
- LayoutRect visibleRect = scrollerLayoutBox(m_scroller)->overflowClipRect(LayoutPoint()); |
+ LayoutRect visibleRect = scrollerLayoutBoxItem(m_scroller).overflowClipRect(LayoutPoint()); |
bool occupiesSpace = candidateRect.width() > 0 && candidateRect.height() > 0; |
if (occupiesSpace && visibleRect.intersects(candidateRect)) { |