Chromium Code Reviews| Index: Source/core/frame/LocalDOMWindow.cpp |
| diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp |
| index 6f4e6ec346538fefab490d39a3bed0beb2a49eda..758e2bbebfa433ad9022fbf3b7bf5ba410b5b995 100644 |
| --- a/Source/core/frame/LocalDOMWindow.cpp |
| +++ b/Source/core/frame/LocalDOMWindow.cpp |
| @@ -945,6 +945,13 @@ int LocalDOMWindow::innerHeight() const |
| if (!host) |
| return 0; |
| + // The main frame's innerHeight depends on the page scale. Since the initial |
| + // page scale depends on the content width and is set after a layout, |
| + // perform one now so queries before the first layout reflect the true size |
| + // of the window. |
|
rune
2015/04/16 22:02:12
The initial scale can be adjusted multiple times a
bokan
2015/04/20 17:47:24
Done.
|
| + if (host->settings().viewportEnabled() && frame()->isMainFrame()) |
| + frame()->document()->updateLayoutIgnorePendingStylesheets(); |
| + |
| // FIXME: This is potentially too much work. We really only need to know the dimensions of the parent frame's renderer. |
| if (Frame* parent = frame()->tree().parent()) { |
| if (parent && parent->isLocalFrame()) |
| @@ -971,6 +978,13 @@ int LocalDOMWindow::innerWidth() const |
| if (!host) |
| return 0; |
| + // The main frame's innerHeight depends on the page scale. Since the initial |
| + // page scale depends on the content width and is set after a layout, |
| + // perform one now so queries before the first layout reflect the true size |
| + // of the window. |
| + if (host->settings().viewportEnabled() && frame()->isMainFrame()) |
| + frame()->document()->updateLayoutIgnorePendingStylesheets(); |
| + |
|
rune
2015/04/16 22:02:12
Most code and comments in innerWidth and innerHeig
bokan
2015/04/20 17:47:24
Done.
|
| // FIXME: This is potentially too much work. We really only need to know the dimensions of the parent frame's renderer. |
| if (Frame* parent = frame()->tree().parent()) { |
| if (parent && parent->isLocalFrame()) |