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

Unified Diff: Source/core/page/DOMWindow.cpp

Issue 19272007: Update parent layout when child frame requests innerHeight/innerWidth. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Only force layout in innerWidth/innerHeight Created 7 years, 5 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 | « LayoutTests/fast/frames/frame-dimensions-before-parent-layout-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/DOMWindow.cpp
diff --git a/Source/core/page/DOMWindow.cpp b/Source/core/page/DOMWindow.cpp
index 6c42964bc50503e55d17007900d91533941f21ed..3d850317f4779a222fcf1da5ba1a4766f0b15cb0 100644
--- a/Source/core/page/DOMWindow.cpp
+++ b/Source/core/page/DOMWindow.cpp
@@ -1025,6 +1025,10 @@ int DOMWindow::innerHeight() const
if (!view)
return 0;
+ // FIXME: This is potentially too much work. We really only need to know the dimensions of the parent frame's renderer.
esprehn 2013/07/16 02:58:50 I don't think you need the fixme, this is true of
+ if (Frame* parent = m_frame->tree()->parent())
+ parent->document()->updateLayoutIgnorePendingStylesheets();
+
// If the device height is overridden, do not include the horizontal scrollbar into the innerHeight (since it is absent on the real device).
bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenHeightOverride(m_frame);
return view->mapFromLayoutToCSSUnits(static_cast<int>(view->visibleContentRect(includeScrollbars ? ScrollableArea::IncludeScrollbars : ScrollableArea::ExcludeScrollbars).height()));
@@ -1039,6 +1043,10 @@ int DOMWindow::innerWidth() const
if (!view)
return 0;
+ // FIXME: This is potentially too much work. We really only need to know the dimensions of the parent frame's renderer.
+ if (Frame* parent = m_frame->tree()->parent())
+ parent->document()->updateLayoutIgnorePendingStylesheets();
+
// If the device width is overridden, do not include the vertical scrollbar into the innerWidth (since it is absent on the real device).
bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenWidthOverride(m_frame);
return view->mapFromLayoutToCSSUnits(static_cast<int>(view->visibleContentRect(includeScrollbars ? ScrollableArea::IncludeScrollbars : ScrollableArea::ExcludeScrollbars).width()));
« no previous file with comments | « LayoutTests/fast/frames/frame-dimensions-before-parent-layout-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698