| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 if (RuntimeEnabledFeatures::cssCompositingEnabled()) | 150 if (RuntimeEnabledFeatures::cssCompositingEnabled()) |
| 151 return true; | 151 return true; |
| 152 break; | 152 break; |
| 153 default: | 153 default: |
| 154 break; | 154 break; |
| 155 } | 155 } |
| 156 } | 156 } |
| 157 return false; | 157 return false; |
| 158 } | 158 } |
| 159 | 159 |
| 160 void StyleAdjuster::adjustComputedStyle(ComputedStyle& style, const ComputedStyl
e& parentStyle, Element *e) | 160 void StyleAdjuster::adjustComputedStyle(ComputedStyle& style, const ComputedStyl
e& parentStyle, Element *e, const AuthorStyleInfo& authorStyle) |
| 161 { | 161 { |
| 162 if (style.display() != NONE) { | 162 if (style.display() != NONE) { |
| 163 if (e && e->isHTMLElement()) | 163 if (e && e->isHTMLElement()) |
| 164 adjustStyleForHTMLElement(style, parentStyle, toHTMLElement(*e)); | 164 adjustStyleForHTMLElement(style, parentStyle, toHTMLElement(*e)); |
| 165 | 165 |
| 166 // Per the spec, position 'static' and 'relative' in the top layer compu
te to 'absolute'. | 166 // Per the spec, position 'static' and 'relative' in the top layer compu
te to 'absolute'. |
| 167 if (isInTopLayer(e, style) && (style.position() == StaticPosition || sty
le.position() == RelativePosition)) | 167 if (isInTopLayer(e, style) && (style.position() == StaticPosition || sty
le.position() == RelativePosition)) |
| 168 style.setPosition(AbsolutePosition); | 168 style.setPosition(AbsolutePosition); |
| 169 | 169 |
| 170 // Absolute/fixed positioned elements, floating elements and the documen
t element need block-like outside display. | 170 // Absolute/fixed positioned elements, floating elements and the documen
t element need block-like outside display. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE) | 218 if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE) |
| 219 adjustOverflow(style); | 219 adjustOverflow(style); |
| 220 | 220 |
| 221 // Cull out any useless layers and also repeat patterns into additional laye
rs. | 221 // Cull out any useless layers and also repeat patterns into additional laye
rs. |
| 222 style.adjustBackgroundLayers(); | 222 style.adjustBackgroundLayers(); |
| 223 style.adjustMaskLayers(); | 223 style.adjustMaskLayers(); |
| 224 | 224 |
| 225 // Let the theme also have a crack at adjusting the style. | 225 // Let the theme also have a crack at adjusting the style. |
| 226 if (style.hasAppearance()) | 226 if (style.hasAppearance()) |
| 227 LayoutTheme::theme().adjustStyle(style, e); | 227 LayoutTheme::theme().adjustStyle(style, e, authorStyle); |
| 228 | 228 |
| 229 // If we have first-letter pseudo style, transitions, or animations, do not
share this style. | 229 // If we have first-letter pseudo style, transitions, or animations, do not
share this style. |
| 230 if (style.hasPseudoStyle(FIRST_LETTER) || style.transitions() || style.anima
tions()) | 230 if (style.hasPseudoStyle(FIRST_LETTER) || style.transitions() || style.anima
tions()) |
| 231 style.setUnique(); | 231 style.setUnique(); |
| 232 | 232 |
| 233 // FIXME: when dropping the -webkit prefix on transform-style, we should als
o have opacity < 1 cause flattening. | 233 // FIXME: when dropping the -webkit prefix on transform-style, we should als
o have opacity < 1 cause flattening. |
| 234 if (style.preserves3D() && (style.overflowX() != OVISIBLE | 234 if (style.preserves3D() && (style.overflowX() != OVISIBLE |
| 235 || style.overflowY() != OVISIBLE | 235 || style.overflowY() != OVISIBLE |
| 236 || style.hasFilter())) | 236 || style.hasFilter())) |
| 237 style.setTransformStyle3D(TransformStyle3DFlat); | 237 style.setTransformStyle3D(TransformStyle3DFlat); |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 if (style.writingMode() != TopToBottomWritingMode && (style.display() == BOX
|| style.display() == INLINE_BOX)) | 494 if (style.writingMode() != TopToBottomWritingMode && (style.display() == BOX
|| style.display() == INLINE_BOX)) |
| 495 style.setWritingMode(TopToBottomWritingMode); | 495 style.setWritingMode(TopToBottomWritingMode); |
| 496 | 496 |
| 497 if (parentStyle.isDisplayFlexibleOrGridBox()) { | 497 if (parentStyle.isDisplayFlexibleOrGridBox()) { |
| 498 style.setFloating(NoFloat); | 498 style.setFloating(NoFloat); |
| 499 style.setDisplay(equivalentBlockDisplay(style.display(), style.isFloatin
g(), !m_useQuirksModeStyles)); | 499 style.setDisplay(equivalentBlockDisplay(style.display(), style.isFloatin
g(), !m_useQuirksModeStyles)); |
| 500 } | 500 } |
| 501 } | 501 } |
| 502 | 502 |
| 503 } | 503 } |
| OLD | NEW |