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

Unified Diff: third_party/WebKit/Source/core/frame/VisualViewport.cpp

Issue 1431433005: Check for main frame existence in VisualViewport::setScaleAndLocation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | 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/frame/VisualViewport.cpp
diff --git a/third_party/WebKit/Source/core/frame/VisualViewport.cpp b/third_party/WebKit/Source/core/frame/VisualViewport.cpp
index 4acde963848833fb9315a0602ede962ac9cee9a4..ae02f2f064a914fc292389186f955c8e681a4fb3 100644
--- a/third_party/WebKit/Source/core/frame/VisualViewport.cpp
+++ b/third_party/WebKit/Source/core/frame/VisualViewport.cpp
@@ -195,6 +195,9 @@ void VisualViewport::setScale(float scale)
void VisualViewport::setScaleAndLocation(float scale, const FloatPoint& location)
{
+ if (!mainFrame())
+ return;
+
bool valuesChanged = false;
if (scale != m_scale) {
@@ -213,8 +216,8 @@ void VisualViewport::setScaleAndLocation(float scale, const FloatPoint& location
if (ScrollingCoordinator* coordinator = frameHost().page().scrollingCoordinator())
coordinator->scrollableAreaScrollLayerDidChange(this);
- Document* document = mainFrame()->document();
- document->enqueueScrollEventForNode(document);
+ if (Document* document = mainFrame()->document())
+ document->enqueueScrollEventForNode(document);
mainFrame()->loader().client()->didChangeScrollOffset();
valuesChanged = true;
« 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