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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 if (RuntimeEnabledFeatures::cssCompositingEnabled()) | 144 if (RuntimeEnabledFeatures::cssCompositingEnabled()) |
145 return true; | 145 return true; |
146 break; | 146 break; |
147 default: | 147 default: |
148 break; | 148 break; |
149 } | 149 } |
150 } | 150 } |
151 return false; | 151 return false; |
152 } | 152 } |
153 | 153 |
154 void StyleAdjuster::adjustLayoutStyle(LayoutStyle& style, const LayoutStyle& par
entStyle, Element *e, const CachedUAStyle* cachedUAStyle) | 154 void StyleAdjuster::adjustLayoutStyle(LayoutStyle& style, const LayoutStyle& par
entStyle, Element *e, const AuthorStyleInfo& authorStyle) |
155 { | 155 { |
156 if (style.display() != NONE) { | 156 if (style.display() != NONE) { |
157 if (e && e->isHTMLElement()) | 157 if (e && e->isHTMLElement()) |
158 adjustStyleForHTMLElement(style, parentStyle, toHTMLElement(*e)); | 158 adjustStyleForHTMLElement(style, parentStyle, toHTMLElement(*e)); |
159 | 159 |
160 // Per the spec, position 'static' and 'relative' in the top layer compu
te to 'absolute'. | 160 // Per the spec, position 'static' and 'relative' in the top layer compu
te to 'absolute'. |
161 if (isInTopLayer(e, style) && (style.position() == StaticPosition || sty
le.position() == RelativePosition)) | 161 if (isInTopLayer(e, style) && (style.position() == StaticPosition || sty
le.position() == RelativePosition)) |
162 style.setPosition(AbsolutePosition); | 162 style.setPosition(AbsolutePosition); |
163 | 163 |
164 // Absolute/fixed positioned elements, floating elements and the documen
t element need block-like outside display. | 164 // Absolute/fixed positioned elements, floating elements and the documen
t element need block-like outside display. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 209 |
210 if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE) | 210 if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE) |
211 adjustOverflow(style); | 211 adjustOverflow(style); |
212 | 212 |
213 // Cull out any useless layers and also repeat patterns into additional laye
rs. | 213 // Cull out any useless layers and also repeat patterns into additional laye
rs. |
214 style.adjustBackgroundLayers(); | 214 style.adjustBackgroundLayers(); |
215 style.adjustMaskLayers(); | 215 style.adjustMaskLayers(); |
216 | 216 |
217 // Let the theme also have a crack at adjusting the style. | 217 // Let the theme also have a crack at adjusting the style. |
218 if (style.hasAppearance()) | 218 if (style.hasAppearance()) |
219 LayoutTheme::theme().adjustStyle(style, e, cachedUAStyle); | 219 LayoutTheme::theme().adjustStyle(style, e, authorStyle); |
220 | 220 |
221 // If we have first-letter pseudo style, transitions, or animations, do not
share this style. | 221 // If we have first-letter pseudo style, transitions, or animations, do not
share this style. |
222 if (style.hasPseudoStyle(FIRST_LETTER) || style.transitions() || style.anima
tions()) | 222 if (style.hasPseudoStyle(FIRST_LETTER) || style.transitions() || style.anima
tions()) |
223 style.setUnique(); | 223 style.setUnique(); |
224 | 224 |
225 // FIXME: when dropping the -webkit prefix on transform-style, we should als
o have opacity < 1 cause flattening. | 225 // FIXME: when dropping the -webkit prefix on transform-style, we should als
o have opacity < 1 cause flattening. |
226 if (style.preserves3D() && (style.overflowX() != OVISIBLE | 226 if (style.preserves3D() && (style.overflowX() != OVISIBLE |
227 || style.overflowY() != OVISIBLE | 227 || style.overflowY() != OVISIBLE |
228 || style.hasFilter())) | 228 || style.hasFilter())) |
229 style.setTransformStyle3D(TransformStyle3DFlat); | 229 style.setTransformStyle3D(TransformStyle3DFlat); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 if (style.writingMode() != TopToBottomWritingMode && (style.display() == BOX
|| style.display() == INLINE_BOX)) | 486 if (style.writingMode() != TopToBottomWritingMode && (style.display() == BOX
|| style.display() == INLINE_BOX)) |
487 style.setWritingMode(TopToBottomWritingMode); | 487 style.setWritingMode(TopToBottomWritingMode); |
488 | 488 |
489 if (parentStyle.isDisplayFlexibleOrGridBox()) { | 489 if (parentStyle.isDisplayFlexibleOrGridBox()) { |
490 style.setFloating(NoFloat); | 490 style.setFloating(NoFloat); |
491 style.setDisplay(equivalentBlockDisplay(style.display(), style.isFloatin
g(), !m_useQuirksModeStyles)); | 491 style.setDisplay(equivalentBlockDisplay(style.display(), style.isFloatin
g(), !m_useQuirksModeStyles)); |
492 } | 492 } |
493 } | 493 } |
494 | 494 |
495 } | 495 } |
OLD | NEW |