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

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

Issue 788073004: Replace RenderFullscreen with top layer - Take II (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated after review comments. Created 6 years 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
Index: Source/core/css/resolver/StyleAdjuster.cpp
diff --git a/Source/core/css/resolver/StyleAdjuster.cpp b/Source/core/css/resolver/StyleAdjuster.cpp
index b89efa29db5f8431d53608348e330ccbc5e27b04..7f87ebfde9041a61b192ecf377bf605221f18811 100644
--- a/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/Source/core/css/resolver/StyleAdjuster.cpp
@@ -34,13 +34,16 @@
#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/html/HTMLIFrameElement.h"
#include "core/html/HTMLInputElement.h"
#include "core/html/HTMLPlugInElement.h"
#include "core/html/HTMLTableCellElement.h"
#include "core/html/HTMLTextAreaElement.h"
-#include "core/frame/FrameView.h"
-#include "core/frame/Settings.h"
+#include "core/page/Page.h"
#include "core/rendering/RenderReplaced.h"
#include "core/rendering/RenderTheme.h"
#include "core/rendering/style/GridPosition.h"
@@ -172,6 +175,18 @@ void StyleAdjuster::adjustRenderStyle(RenderStyle* style, RenderStyle* parentSty
adjustStyleForFirstLetter(style);
adjustStyleForDisplay(style, parentStyle);
+
+ if (e && e->document().page()->settings().pinchVirtualViewportEnabled()) {
+ 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().pinchViewport().size();
+ style->setWidth(Length(viewportSize.width(), Fixed));
+ style->setHeight(Length(viewportSize.height(), Fixed));
rune 2014/12/16 19:10:24 This looks very weird to me. If I understand corre
aelias_OOO_until_Jul13 2014/12/16 19:34:33 We don't support pinch zoom in fullscreen; page sc
+ }
+ }
} else {
adjustStyleForFirstLetter(style);
}

Powered by Google App Engine
This is Rietveld 408576698