Index: third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp |
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp |
index cffe90e1a6a699f5bde5aa09d48f237edde15443..2491ba415fdd9c02e33a8a8d09d1c1fc365d449d 100644 |
--- a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp |
+++ b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp |
@@ -34,6 +34,8 @@ |
#include "core/dom/ContainerNode.h" |
#include "core/dom/Document.h" |
#include "core/dom/Element.h" |
+#include "core/dom/Fullscreen.h" |
+#include "core/frame/FrameHost.h" |
#include "core/frame/FrameView.h" |
#include "core/frame/Settings.h" |
#include "core/frame/UseCounter.h" |
@@ -44,6 +46,7 @@ |
#include "core/html/HTMLTextAreaElement.h" |
#include "core/layout/LayoutReplaced.h" |
#include "core/layout/LayoutTheme.h" |
+#include "core/page/Page.h" |
#include "core/style/ComputedStyle.h" |
#include "core/style/ComputedStyleConstants.h" |
#include "core/svg/SVGSVGElement.h" |
@@ -177,6 +180,17 @@ void StyleAdjuster::adjustComputedStyle(ComputedStyle& style, const ComputedStyl |
adjustStyleForFirstLetter(style); |
adjustStyleForDisplay(style, parentStyle, e ? &e->document() : 0); |
+ |
+ if (e && Fullscreen::isActiveFullScreenElement(*e)) { |
+ // We need to size the fullscreen element to the inner viewport and not to the |
+ // outer viewport (what percentage would do). Unfortunately CSS can't handle |
+ // that as we don't expose the inner viewport information. |
+ // |
+ // TODO(dsinclair): We should find a way to get this standardized. crbug.com/534924 |
+ IntSize viewportSize = e->document().page()->frameHost().visualViewport().size(); |
+ style.setWidth(Length(viewportSize.width(), Fixed)); |
+ style.setHeight(Length(viewportSize.height(), Fixed)); |
+ } |
} else { |
adjustStyleForFirstLetter(style); |
} |