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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 16 matching lines...) Expand all
27 */ 27 */
28 28
29 #include "config.h" 29 #include "config.h"
30 #include "core/css/resolver/StyleAdjuster.h" 30 #include "core/css/resolver/StyleAdjuster.h"
31 31
32 #include "core/HTMLNames.h" 32 #include "core/HTMLNames.h"
33 #include "core/SVGNames.h" 33 #include "core/SVGNames.h"
34 #include "core/dom/ContainerNode.h" 34 #include "core/dom/ContainerNode.h"
35 #include "core/dom/Document.h" 35 #include "core/dom/Document.h"
36 #include "core/dom/Element.h" 36 #include "core/dom/Element.h"
37 #include "core/dom/Fullscreen.h"
38 #include "core/frame/FrameHost.h"
39 #include "core/frame/FrameView.h"
40 #include "core/frame/Settings.h"
37 #include "core/html/HTMLIFrameElement.h" 41 #include "core/html/HTMLIFrameElement.h"
38 #include "core/html/HTMLInputElement.h" 42 #include "core/html/HTMLInputElement.h"
39 #include "core/html/HTMLPlugInElement.h" 43 #include "core/html/HTMLPlugInElement.h"
40 #include "core/html/HTMLTableCellElement.h" 44 #include "core/html/HTMLTableCellElement.h"
41 #include "core/html/HTMLTextAreaElement.h" 45 #include "core/html/HTMLTextAreaElement.h"
42 #include "core/frame/FrameView.h" 46 #include "core/page/Page.h"
43 #include "core/frame/Settings.h"
44 #include "core/rendering/RenderReplaced.h" 47 #include "core/rendering/RenderReplaced.h"
45 #include "core/rendering/RenderTheme.h" 48 #include "core/rendering/RenderTheme.h"
46 #include "core/rendering/style/GridPosition.h" 49 #include "core/rendering/style/GridPosition.h"
47 #include "core/rendering/style/RenderStyle.h" 50 #include "core/rendering/style/RenderStyle.h"
48 #include "core/rendering/style/RenderStyleConstants.h" 51 #include "core/rendering/style/RenderStyleConstants.h"
49 #include "core/svg/SVGSVGElement.h" 52 #include "core/svg/SVGSVGElement.h"
50 #include "platform/Length.h" 53 #include "platform/Length.h"
51 #include "platform/transforms/TransformOperations.h" 54 #include "platform/transforms/TransformOperations.h"
52 #include "wtf/Assertions.h" 55 #include "wtf/Assertions.h"
53 56
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 168
166 // Absolute/fixed positioned elements, floating elements and the documen t element need block-like outside display. 169 // Absolute/fixed positioned elements, floating elements and the documen t element need block-like outside display.
167 if (style->hasOutOfFlowPosition() || style->isFloating() || (e && e->doc ument().documentElement() == e)) 170 if (style->hasOutOfFlowPosition() || style->isFloating() || (e && e->doc ument().documentElement() == e))
168 style->setDisplay(equivalentBlockDisplay(style->display(), style->is Floating(), !m_useQuirksModeStyles)); 171 style->setDisplay(equivalentBlockDisplay(style->display(), style->is Floating(), !m_useQuirksModeStyles));
169 172
170 // We don't adjust the first letter style earlier because we may change the display setting in 173 // We don't adjust the first letter style earlier because we may change the display setting in
171 // adjustStyeForTagName() above. 174 // adjustStyeForTagName() above.
172 adjustStyleForFirstLetter(style); 175 adjustStyleForFirstLetter(style);
173 176
174 adjustStyleForDisplay(style, parentStyle); 177 adjustStyleForDisplay(style, parentStyle);
178
179 if (e && e->document().page()->settings().pinchVirtualViewportEnabled()) {
180 if (Fullscreen::isActiveFullScreenElement(*e)) {
181 // We need to size the fullscreen element to the inner viewport and not to the
182 // outer viewport (what percentage would do). Unfortunately CSS can't handle
183 // that as we don't expose this information. FIXME: We should fi nd a way to
184 // get this standardized.
185 IntSize viewportSize = e->document().page()->frameHost().pinchVi ewport().size();
186 style->setWidth(Length(viewportSize.width(), Fixed));
187 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
188 }
189 }
175 } else { 190 } else {
176 adjustStyleForFirstLetter(style); 191 adjustStyleForFirstLetter(style);
177 } 192 }
178 193
179 // Make sure our z-index value is only applied if the object is positioned. 194 // Make sure our z-index value is only applied if the object is positioned.
180 if (style->position() == StaticPosition && !parentStyleForcesZIndexToCreateS tackingContext(parentStyle)) 195 if (style->position() == StaticPosition && !parentStyleForcesZIndexToCreateS tackingContext(parentStyle))
181 style->setHasAutoZIndex(); 196 style->setHasAutoZIndex();
182 197
183 // Auto z-index becomes 0 for the root element and transparent objects. This prevents 198 // Auto z-index becomes 0 for the root element and transparent objects. This prevents
184 // cases where objects that should be blended as a single unit end up with a non-transparent 199 // cases where objects that should be blended as a single unit end up with a non-transparent
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 if (style->writingMode() != TopToBottomWritingMode && (style->display() == B OX || style->display() == INLINE_BOX)) 490 if (style->writingMode() != TopToBottomWritingMode && (style->display() == B OX || style->display() == INLINE_BOX))
476 style->setWritingMode(TopToBottomWritingMode); 491 style->setWritingMode(TopToBottomWritingMode);
477 492
478 if (parentStyle->isDisplayFlexibleOrGridBox()) { 493 if (parentStyle->isDisplayFlexibleOrGridBox()) {
479 style->setFloating(NoFloat); 494 style->setFloating(NoFloat);
480 style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloa ting(), !m_useQuirksModeStyles)); 495 style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloa ting(), !m_useQuirksModeStyles));
481 } 496 }
482 } 497 }
483 498
484 } 499 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698