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 16 matching lines...) Expand all Loading... | |
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" | |
37 #include "core/frame/FrameView.h" | 39 #include "core/frame/FrameView.h" |
38 #include "core/frame/Settings.h" | 40 #include "core/frame/Settings.h" |
39 #include "core/frame/UseCounter.h" | 41 #include "core/frame/UseCounter.h" |
40 #include "core/html/HTMLIFrameElement.h" | 42 #include "core/html/HTMLIFrameElement.h" |
41 #include "core/html/HTMLInputElement.h" | 43 #include "core/html/HTMLInputElement.h" |
42 #include "core/html/HTMLPlugInElement.h" | 44 #include "core/html/HTMLPlugInElement.h" |
43 #include "core/html/HTMLTableCellElement.h" | 45 #include "core/html/HTMLTableCellElement.h" |
44 #include "core/html/HTMLTextAreaElement.h" | 46 #include "core/html/HTMLTextAreaElement.h" |
45 #include "core/layout/LayoutReplaced.h" | 47 #include "core/layout/LayoutReplaced.h" |
46 #include "core/layout/LayoutTheme.h" | 48 #include "core/layout/LayoutTheme.h" |
49 #include "core/page/Page.h" | |
47 #include "core/style/ComputedStyle.h" | 50 #include "core/style/ComputedStyle.h" |
48 #include "core/style/ComputedStyleConstants.h" | 51 #include "core/style/ComputedStyleConstants.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 |
54 namespace blink { | 57 namespace blink { |
55 | 58 |
56 using namespace HTMLNames; | 59 using namespace HTMLNames; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
170 | 173 |
171 // Absolute/fixed positioned elements, floating elements and the documen t element need block-like outside display. | 174 // Absolute/fixed positioned elements, floating elements and the documen t element need block-like outside display. |
172 if (style.hasOutOfFlowPosition() || style.isFloating() || (e && e->docum ent().documentElement() == e)) | 175 if (style.hasOutOfFlowPosition() || style.isFloating() || (e && e->docum ent().documentElement() == e)) |
173 style.setDisplay(equivalentBlockDisplay(style.display(), style.isFlo ating(), !m_useQuirksModeStyles)); | 176 style.setDisplay(equivalentBlockDisplay(style.display(), style.isFlo ating(), !m_useQuirksModeStyles)); |
174 | 177 |
175 // We don't adjust the first letter style earlier because we may change the display setting in | 178 // We don't adjust the first letter style earlier because we may change the display setting in |
176 // adjustStyeForTagName() above. | 179 // adjustStyeForTagName() above. |
177 adjustStyleForFirstLetter(style); | 180 adjustStyleForFirstLetter(style); |
178 | 181 |
179 adjustStyleForDisplay(style, parentStyle, e ? &e->document() : 0); | 182 adjustStyleForDisplay(style, parentStyle, e ? &e->document() : 0); |
183 | |
184 if (e) { | |
185 if (Fullscreen::isActiveFullScreenElement(*e)) { | |
esprehn
2015/09/24 20:17:01
don't double nest, so this should be:
if (e && Fu
dsinclair
2015/09/28 17:14:58
Done.
| |
186 // We need to size the fullscreen element to the inner viewport and not to the | |
187 // outer viewport (what percentage would do). Unfortunately CSS can't handle | |
188 // that as we don't expose the inner viewport information. | |
189 // | |
190 // TODO(dsinclair): We should find a way to get this standardize d. crbug.com/534924 | |
191 IntSize viewportSize = e->document().page()->frameHost().visualV iewport().size(); | |
192 style.setWidth(Length(viewportSize.width(), Fixed)); | |
193 style.setHeight(Length(viewportSize.height(), Fixed)); | |
esprehn
2015/09/24 20:17:01
this seems bad, what if I resize my window? I don'
dsinclair
2015/09/28 17:14:58
So, override styleDidChange on LayoutView, get the
| |
194 } | |
195 } | |
180 } else { | 196 } else { |
181 adjustStyleForFirstLetter(style); | 197 adjustStyleForFirstLetter(style); |
182 } | 198 } |
183 | 199 |
184 // Make sure our z-index value is only applied if the object is positioned. | 200 // Make sure our z-index value is only applied if the object is positioned. |
185 if (style.position() == StaticPosition && !parentStyleForcesZIndexToCreateSt ackingContext(parentStyle)) | 201 if (style.position() == StaticPosition && !parentStyleForcesZIndexToCreateSt ackingContext(parentStyle)) |
186 style.setHasAutoZIndex(); | 202 style.setHasAutoZIndex(); |
187 | 203 |
188 // Auto z-index becomes 0 for the root element and transparent objects. This prevents | 204 // Auto z-index becomes 0 for the root element and transparent objects. This prevents |
189 // cases where objects that should be blended as a single unit end up with a non-transparent | 205 // cases where objects that should be blended as a single unit end up with a non-transparent |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
484 // We want to count vertical percentage paddings/margins on flex items b ecause our current | 500 // We want to count vertical percentage paddings/margins on flex items b ecause our current |
485 // behavior is different from the spec and we want to gather compatibili ty data. | 501 // behavior is different from the spec and we want to gather compatibili ty data. |
486 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen t()) | 502 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen t()) |
487 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert ical); | 503 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert ical); |
488 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent( )) | 504 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent( )) |
489 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti cal); | 505 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti cal); |
490 } | 506 } |
491 } | 507 } |
492 | 508 |
493 } | 509 } |
OLD | NEW |