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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 return BLOCK; | 130 return BLOCK; |
131 } | 131 } |
132 | 132 |
133 // CSS requires text-decoration to be reset at each DOM element for tables, | 133 // CSS requires text-decoration to be reset at each DOM element for tables, |
134 // inline blocks, inline tables, shadow DOM crossings, floating elements, | 134 // inline blocks, inline tables, shadow DOM crossings, floating elements, |
135 // and absolute or relatively positioned elements. | 135 // and absolute or relatively positioned elements. |
136 static bool doesNotInheritTextDecoration(const RenderStyle* style, const Element
* e) | 136 static bool doesNotInheritTextDecoration(const RenderStyle* style, const Element
* e) |
137 { | 137 { |
138 return style->display() == TABLE || style->display() == INLINE_TABLE | 138 return style->display() == TABLE || style->display() == INLINE_TABLE |
139 || style->display() == INLINE_BLOCK || style->display() == INLINE_BOX ||
isAtShadowBoundary(e) | 139 || style->display() == INLINE_BLOCK || style->display() == INLINE_BOX ||
isAtShadowBoundary(e) |
140 || style->isFloating() || style->hasOutOfFlowPosition(); | 140 || style->isFloating() || style->hasOutOfFlowPosition() || isHTMLRTEleme
nt(e); |
141 } | 141 } |
142 | 142 |
143 // FIXME: This helper is only needed because pseudoStyleForElement passes a null | 143 // FIXME: This helper is only needed because pseudoStyleForElement passes a null |
144 // element to adjustRenderStyle, so we can't just use element->isInTopLayer(). | 144 // element to adjustRenderStyle, so we can't just use element->isInTopLayer(). |
145 static bool isInTopLayer(const Element* element, const RenderStyle* style) | 145 static bool isInTopLayer(const Element* element, const RenderStyle* style) |
146 { | 146 { |
147 return (element && element->isInTopLayer()) || (style && style->styleType()
== BACKDROP); | 147 return (element && element->isInTopLayer()) || (style && style->styleType()
== BACKDROP); |
148 } | 148 } |
149 | 149 |
150 static bool isDisplayFlexibleBox(EDisplay display) | 150 static bool isDisplayFlexibleBox(EDisplay display) |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 style->setZIndex(0); | 238 style->setZIndex(0); |
239 | 239 |
240 // will-change:transform should result in the same rendering behavior as hav
ing a transform, | 240 // will-change:transform should result in the same rendering behavior as hav
ing a transform, |
241 // including the creation of a containing block for fixed position descendan
ts. | 241 // including the creation of a containing block for fixed position descendan
ts. |
242 if (!style->hasTransform() && (style->willChangeProperties().contains(CSSPro
pertyWebkitTransform) || style->willChangeProperties().contains(CSSPropertyTrans
form))) { | 242 if (!style->hasTransform() && (style->willChangeProperties().contains(CSSPro
pertyWebkitTransform) || style->willChangeProperties().contains(CSSPropertyTrans
form))) { |
243 bool makeIdentity = true; | 243 bool makeIdentity = true; |
244 style->setTransform(TransformOperations(makeIdentity)); | 244 style->setTransform(TransformOperations(makeIdentity)); |
245 } | 245 } |
246 | 246 |
247 if (doesNotInheritTextDecoration(style, e)) | 247 if (doesNotInheritTextDecoration(style, e)) |
248 style->setTextDecorationsInEffect(style->textDecoration()); | 248 style->clearAppliedTextDecorations(); |
249 else | 249 |
250 style->addToTextDecorationsInEffect(style->textDecoration()); | 250 style->applyTextDecorations(); |
251 | 251 |
252 if (style->overflowX() != OVISIBLE || style->overflowY() != OVISIBLE) | 252 if (style->overflowX() != OVISIBLE || style->overflowY() != OVISIBLE) |
253 adjustOverflow(style); | 253 adjustOverflow(style); |
254 | 254 |
255 // Cull out any useless layers and also repeat patterns into additional laye
rs. | 255 // Cull out any useless layers and also repeat patterns into additional laye
rs. |
256 style->adjustBackgroundLayers(); | 256 style->adjustBackgroundLayers(); |
257 style->adjustMaskLayers(); | 257 style->adjustMaskLayers(); |
258 | 258 |
259 // Let the theme also have a crack at adjusting the style. | 259 // Let the theme also have a crack at adjusting the style. |
260 if (style->hasAppearance()) | 260 if (style->hasAppearance()) |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 if (style->writingMode() != TopToBottomWritingMode && (style->display() == B
OX || style->display() == INLINE_BOX)) | 446 if (style->writingMode() != TopToBottomWritingMode && (style->display() == B
OX || style->display() == INLINE_BOX)) |
447 style->setWritingMode(TopToBottomWritingMode); | 447 style->setWritingMode(TopToBottomWritingMode); |
448 | 448 |
449 if (isDisplayFlexibleBox(parentStyle->display()) || isDisplayGridBox(parentS
tyle->display())) { | 449 if (isDisplayFlexibleBox(parentStyle->display()) || isDisplayGridBox(parentS
tyle->display())) { |
450 style->setFloating(NoFloat); | 450 style->setFloating(NoFloat); |
451 style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloa
ting(), !m_useQuirksModeStyles)); | 451 style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloa
ting(), !m_useQuirksModeStyles)); |
452 } | 452 } |
453 } | 453 } |
454 | 454 |
455 } | 455 } |
OLD | NEW |