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

Unified Diff: third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp

Issue 2332383002: Handle anonymous layout objects correctly in SnapCoordinator (Closed)
Patch Set: rebase Created 4 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp
diff --git a/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp b/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp
index 7eb7f145dc8471019a597414e47fe64e844328db..ad27eae93f1cd9aa888c8602c6fb324511d27984 100644
--- a/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.cpp
@@ -30,15 +30,15 @@ static LayoutBox* findSnapContainer(const LayoutBox& snapArea) {
// "Snap positions must only affect the nearest ancestor (on the element’s
// containing block chain) scroll container".
Element* viewportDefiningElement =
- snapArea.node()->document().viewportDefiningElement();
+ snapArea.document().viewportDefiningElement();
LayoutBox* box = snapArea.containingBlock();
while (box && !box->hasOverflowClip() && !box->isLayoutView() &&
box->node() != viewportDefiningElement)
box = box->containingBlock();
// If we reach to viewportDefiningElement then we dispatch to viewport
- if (box->node() == viewportDefiningElement)
- return snapArea.node()->document().layoutView();
+ if (box && box->node() == viewportDefiningElement)
+ return snapArea.document().layoutView();
return box;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698