Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
index 0893b67b0d59e7013896a1dce6d7647599e72786..000967d10b512a47036d14bfe7ede77622b4cbab 100644 |
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
@@ -1795,7 +1795,7 @@ WebLocalFrameImpl* WebLocalFrameImpl::localRoot() |
// when the WebLocalFrame exists but the core LocalFrame does not. |
// TODO(alexmos, dcheng): Clean this up to only calculate this in one place. |
WebLocalFrameImpl* localRoot = this; |
- while (!localRoot->frameWidget()) |
+ while (localRoot->parent() && localRoot->parent()->isWebLocalFrame()) |
localRoot = toWebLocalFrameImpl(localRoot->parent()); |
return localRoot; |
} |