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

Unified Diff: Source/core/css/resolver/StyleAdjuster.cpp

Issue 1139033006: Implement FullScreen using top layer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase to master Created 5 years, 3 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 | « Source/core/css/fullscreen.css ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleAdjuster.cpp
diff --git a/Source/core/css/resolver/StyleAdjuster.cpp b/Source/core/css/resolver/StyleAdjuster.cpp
index cffe90e1a6a699f5bde5aa09d48f237edde15443..3adb76cc96f55837bee250e90ee6f3cca2c26b89 100644
--- a/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/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,18 @@ void StyleAdjuster::adjustComputedStyle(ComputedStyle& style, const ComputedStyl
adjustStyleForFirstLetter(style);
adjustStyleForDisplay(style, parentStyle, e ? &e->document() : 0);
+
+ if (e) {
+ if (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 this information. FIXME: We should find a way to
+ // get this standardized.
+ IntSize viewportSize = e->document().page()->frameHost().visualViewport().size();
+ style.setWidth(Length(viewportSize.width(), Fixed));
+ style.setHeight(Length(viewportSize.height(), Fixed));
+ }
+ }
} else {
adjustStyleForFirstLetter(style);
}
« no previous file with comments | « Source/core/css/fullscreen.css ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698