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

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

Issue 2202493002: NOT FOR REVIEW: Fullscreen WIP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 1 month 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. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 17 matching lines...) Expand all
28 * Boston, MA 02110-1301, USA. 28 * Boston, MA 02110-1301, USA.
29 */ 29 */
30 30
31 #include "core/css/resolver/StyleAdjuster.h" 31 #include "core/css/resolver/StyleAdjuster.h"
32 32
33 #include "core/HTMLNames.h" 33 #include "core/HTMLNames.h"
34 #include "core/SVGNames.h" 34 #include "core/SVGNames.h"
35 #include "core/dom/ContainerNode.h" 35 #include "core/dom/ContainerNode.h"
36 #include "core/dom/Document.h" 36 #include "core/dom/Document.h"
37 #include "core/dom/Element.h" 37 #include "core/dom/Element.h"
38 #include "core/dom/Fullscreen.h"
39 #include "core/frame/FrameHost.h"
38 #include "core/frame/FrameView.h" 40 #include "core/frame/FrameView.h"
39 #include "core/frame/Settings.h" 41 #include "core/frame/Settings.h"
40 #include "core/frame/UseCounter.h" 42 #include "core/frame/UseCounter.h"
43 #include "core/frame/VisualViewport.h"
41 #include "core/html/HTMLIFrameElement.h" 44 #include "core/html/HTMLIFrameElement.h"
42 #include "core/html/HTMLInputElement.h" 45 #include "core/html/HTMLInputElement.h"
43 #include "core/html/HTMLPlugInElement.h" 46 #include "core/html/HTMLPlugInElement.h"
44 #include "core/html/HTMLTableCellElement.h" 47 #include "core/html/HTMLTableCellElement.h"
45 #include "core/html/HTMLTextAreaElement.h" 48 #include "core/html/HTMLTextAreaElement.h"
46 #include "core/layout/LayoutTheme.h" 49 #include "core/layout/LayoutTheme.h"
50 #include "core/page/Page.h"
47 #include "core/style/ComputedStyle.h" 51 #include "core/style/ComputedStyle.h"
48 #include "core/style/ComputedStyleConstants.h" 52 #include "core/style/ComputedStyleConstants.h"
49 #include "core/svg/SVGSVGElement.h" 53 #include "core/svg/SVGSVGElement.h"
50 #include "platform/Length.h" 54 #include "platform/Length.h"
51 #include "platform/transforms/TransformOperations.h" 55 #include "platform/transforms/TransformOperations.h"
52 #include "wtf/Assertions.h" 56 #include "wtf/Assertions.h"
53 57
54 namespace blink { 58 namespace blink {
55 59
56 using namespace HTMLNames; 60 using namespace HTMLNames;
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 // display setting in adjustStyeForTagName() above. 400 // display setting in adjustStyeForTagName() above.
397 adjustStyleForFirstLetter(style); 401 adjustStyleForFirstLetter(style);
398 402
399 adjustStyleForDisplay(style, parentStyle, 403 adjustStyleForDisplay(style, parentStyle,
400 element ? &element->document() : 0); 404 element ? &element->document() : 0);
401 405
402 // Paint containment forces a block formatting context, so we must coerce 406 // Paint containment forces a block formatting context, so we must coerce
403 // from inline. https://drafts.csswg.org/css-containment/#containment-paint 407 // from inline. https://drafts.csswg.org/css-containment/#containment-paint
404 if (style.containsPaint() && style.display() == EDisplay::Inline) 408 if (style.containsPaint() && style.display() == EDisplay::Inline)
405 style.setDisplay(EDisplay::Block); 409 style.setDisplay(EDisplay::Block);
410
411 if (element && Fullscreen::isFullscreenElement(*element)) {
412 // We need to size the fullscreen element to the inner viewport and not to
413 // the outer viewport (what percentage would do). Unfortunately CSS can't
414 // handle that as we don't expose the inner viewport information.
415 //
416 // TODO(dsinclair): We should find a way to get this standardized.
417 // crbug.com/534924
418 IntSize viewportSize =
419 element->document().page()->frameHost().visualViewport().size();
420 style.setWidth(Length(viewportSize.width(), Fixed));
421 style.setHeight(Length(viewportSize.height(), Fixed));
422 }
406 } else { 423 } else {
407 adjustStyleForFirstLetter(style); 424 adjustStyleForFirstLetter(style);
408 } 425 }
409 426
410 if (element && element->hasCompositorProxy()) 427 if (element && element->hasCompositorProxy())
411 style.setHasCompositorProxy(true); 428 style.setHasCompositorProxy(true);
412 429
413 // Make sure our z-index value is only applied if the object is positioned. 430 // Make sure our z-index value is only applied if the object is positioned.
414 if (style.position() == StaticPosition && 431 if (style.position() == StaticPosition &&
415 !parentStyleForcesZIndexToCreateStackingContext(parentStyle)) { 432 !parentStyleForcesZIndexToCreateStackingContext(parentStyle)) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 style.setDisplay(EDisplay::Block); 479 style.setDisplay(EDisplay::Block);
463 480
464 // Columns don't apply to svg text elements. 481 // Columns don't apply to svg text elements.
465 if (isSVGTextElement(*element)) 482 if (isSVGTextElement(*element))
466 style.clearMultiCol(); 483 style.clearMultiCol();
467 } 484 }
468 adjustStyleForAlignment(style, parentStyle); 485 adjustStyleForAlignment(style, parentStyle);
469 } 486 }
470 487
471 } // namespace blink 488 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698