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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp

Issue 2107233002: Reland "Implement FullScreen using top layer." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: new untested DCHECK Created 4 years, 5 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 unified diff | Download patch
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 15 matching lines...) Expand all
26 * Boston, MA 02110-1301, USA. 26 * Boston, MA 02110-1301, USA.
27 */ 27 */
28 28
29 #include "core/css/resolver/StyleAdjuster.h" 29 #include "core/css/resolver/StyleAdjuster.h"
30 30
31 #include "core/HTMLNames.h" 31 #include "core/HTMLNames.h"
32 #include "core/SVGNames.h" 32 #include "core/SVGNames.h"
33 #include "core/dom/ContainerNode.h" 33 #include "core/dom/ContainerNode.h"
34 #include "core/dom/Document.h" 34 #include "core/dom/Document.h"
35 #include "core/dom/Element.h" 35 #include "core/dom/Element.h"
36 #include "core/dom/Fullscreen.h"
37 #include "core/frame/FrameHost.h"
36 #include "core/frame/FrameView.h" 38 #include "core/frame/FrameView.h"
37 #include "core/frame/Settings.h" 39 #include "core/frame/Settings.h"
38 #include "core/frame/UseCounter.h" 40 #include "core/frame/UseCounter.h"
41 #include "core/frame/VisualViewport.h"
39 #include "core/html/HTMLIFrameElement.h" 42 #include "core/html/HTMLIFrameElement.h"
40 #include "core/html/HTMLInputElement.h" 43 #include "core/html/HTMLInputElement.h"
41 #include "core/html/HTMLPlugInElement.h" 44 #include "core/html/HTMLPlugInElement.h"
42 #include "core/html/HTMLTableCellElement.h" 45 #include "core/html/HTMLTableCellElement.h"
43 #include "core/html/HTMLTextAreaElement.h" 46 #include "core/html/HTMLTextAreaElement.h"
44 #include "core/layout/LayoutTheme.h" 47 #include "core/layout/LayoutTheme.h"
48 #include "core/page/Page.h"
45 #include "core/style/ComputedStyle.h" 49 #include "core/style/ComputedStyle.h"
46 #include "core/style/ComputedStyleConstants.h" 50 #include "core/style/ComputedStyleConstants.h"
47 #include "core/svg/SVGSVGElement.h" 51 #include "core/svg/SVGSVGElement.h"
48 #include "platform/Length.h" 52 #include "platform/Length.h"
49 #include "platform/transforms/TransformOperations.h" 53 #include "platform/transforms/TransformOperations.h"
50 #include "wtf/Assertions.h" 54 #include "wtf/Assertions.h"
51 55
52 namespace blink { 56 namespace blink {
53 57
54 using namespace HTMLNames; 58 using namespace HTMLNames;
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 // We don't adjust the first letter style earlier because we may change the display setting in 357 // We don't adjust the first letter style earlier because we may change the display setting in
354 // adjustStyeForTagName() above. 358 // adjustStyeForTagName() above.
355 adjustStyleForFirstLetter(style); 359 adjustStyleForFirstLetter(style);
356 360
357 adjustStyleForDisplay(style, parentStyle, element ? &element->document() : 0); 361 adjustStyleForDisplay(style, parentStyle, element ? &element->document() : 0);
358 362
359 // Paint containment forces a block formatting context, so we must coerc e from inline. 363 // Paint containment forces a block formatting context, so we must coerc e from inline.
360 // https://drafts.csswg.org/css-containment/#containment-paint 364 // https://drafts.csswg.org/css-containment/#containment-paint
361 if (style.containsPaint() && style.display() == INLINE) 365 if (style.containsPaint() && style.display() == INLINE)
362 style.setDisplay(BLOCK); 366 style.setDisplay(BLOCK);
367
368 if (element && Fullscreen::isActiveFullScreenElement(*element)) {
369 // We need to size the fullscreen element to the inner viewport and not to the
370 // outer viewport (what percentage would do). Unfortunately CSS can' t handle
371 // that as we don't expose the inner viewport information.
372 //
373 // TODO(dsinclair): We should find a way to get this standardized. c rbug.com/534924
374 IntSize viewportSize = element->document().page()->frameHost().visua lViewport().size();
375 style.setWidth(Length(viewportSize.width(), Fixed));
376 style.setHeight(Length(viewportSize.height(), Fixed));
377 }
363 } else { 378 } else {
364 adjustStyleForFirstLetter(style); 379 adjustStyleForFirstLetter(style);
365 } 380 }
366 381
367 if (element && element->hasCompositorProxy()) 382 if (element && element->hasCompositorProxy())
368 style.setHasCompositorProxy(true); 383 style.setHasCompositorProxy(true);
369 384
370 // Make sure our z-index value is only applied if the object is positioned. 385 // Make sure our z-index value is only applied if the object is positioned.
371 if (style.position() == StaticPosition && !parentStyleForcesZIndexToCreateSt ackingContext(parentStyle)) { 386 if (style.position() == StaticPosition && !parentStyleForcesZIndexToCreateSt ackingContext(parentStyle)) {
372 style.setIsStackingContext(false); 387 style.setIsStackingContext(false);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 style.setDisplay(BLOCK); 425 style.setDisplay(BLOCK);
411 426
412 // Columns don't apply to svg text elements. 427 // Columns don't apply to svg text elements.
413 if (isSVGTextElement(*element)) 428 if (isSVGTextElement(*element))
414 style.clearMultiCol(); 429 style.clearMultiCol();
415 } 430 }
416 adjustStyleForAlignment(style, parentStyle); 431 adjustStyleForAlignment(style, parentStyle);
417 } 432 }
418 433
419 } // namespace blink 434 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/html.css ('k') | third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698