Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 // We don't adjust the first letter style earlier because we may change the display setting in | 170 // We don't adjust the first letter style earlier because we may change the display setting in |
| 167 // adjustStyeForTagName() above. | 171 // adjustStyeForTagName() above. |
| 168 adjustStyleForFirstLetter(style); | 172 adjustStyleForFirstLetter(style); |
| 169 | 173 |
| 170 adjustStyleForDisplay(style, parentStyle, element ? &element->document() : 0); | 174 adjustStyleForDisplay(style, parentStyle, element ? &element->document() : 0); |
| 171 | 175 |
| 172 // Paint containment forces a block formatting context, so we must coerc e from inline. | 176 // Paint containment forces a block formatting context, so we must coerc e from inline. |
| 173 // https://drafts.csswg.org/css-containment/#containment-paint | 177 // https://drafts.csswg.org/css-containment/#containment-paint |
| 174 if (style.containsPaint() && style.display() == INLINE) | 178 if (style.containsPaint() && style.display() == INLINE) |
| 175 style.setDisplay(BLOCK); | 179 style.setDisplay(BLOCK); |
| 180 | |
| 181 if (element && Fullscreen::isActiveFullScreenElement(*element)) { | |
| 182 // We need to size the fullscreen element to the inner viewport and not to the | |
| 183 // outer viewport (what percentage would do). Unfortunately CSS can' t handle | |
| 184 // that as we don't expose the inner viewport information. | |
| 185 // | |
| 186 // TODO(dsinclair): We should find a way to get this standardized. c rbug.com/534924 | |
|
foolip
2016/06/29 20:11:00
dsinclair@, can you fill me in about the purpose o
dsinclair
2016/06/29 20:14:47
I'm not sure if this is what causes the scrollbar
foolip
2016/06/30 14:33:24
I tried reverting this and running test to underst
dsinclair
2016/07/06 13:32:31
I was never really clear on viewport. There is an
foolip
2016/07/06 14:14:51
Thanks, I'll do that if I can't figure this out.
| |
| 187 IntSize viewportSize = element->document().page()->frameHost().visua lViewport().size(); | |
| 188 style.setWidth(Length(viewportSize.width(), Fixed)); | |
| 189 style.setHeight(Length(viewportSize.height(), Fixed)); | |
| 190 } | |
| 176 } else { | 191 } else { |
| 177 adjustStyleForFirstLetter(style); | 192 adjustStyleForFirstLetter(style); |
| 178 } | 193 } |
| 179 | 194 |
| 180 if (element && element->hasCompositorProxy()) | 195 if (element && element->hasCompositorProxy()) |
| 181 style.setHasCompositorProxy(true); | 196 style.setHasCompositorProxy(true); |
| 182 | 197 |
| 183 // Make sure our z-index value is only applied if the object is positioned. | 198 // Make sure our z-index value is only applied if the object is positioned. |
| 184 if (style.position() == StaticPosition && !parentStyleForcesZIndexToCreateSt ackingContext(parentStyle)) | 199 if (style.position() == StaticPosition && !parentStyleForcesZIndexToCreateSt ackingContext(parentStyle)) |
| 185 style.setHasAutoZIndex(); | 200 style.setHasAutoZIndex(); |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 452 // We want to count vertical percentage paddings/margins on flex items b ecause our current | 467 // We want to count vertical percentage paddings/margins on flex items b ecause our current |
| 453 // behavior is different from the spec and we want to gather compatibili ty data. | 468 // behavior is different from the spec and we want to gather compatibili ty data. |
| 454 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen t()) | 469 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen t()) |
| 455 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert ical); | 470 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert ical); |
| 456 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent( )) | 471 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent( )) |
| 457 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti cal); | 472 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti cal); |
| 458 } | 473 } |
| 459 } | 474 } |
| 460 | 475 |
| 461 } // namespace blink | 476 } // namespace blink |
| OLD | NEW |