| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 } | 104 } |
| 105 | 105 |
| 106 // CSS requires text-decoration to be reset at each DOM element for | 106 // CSS requires text-decoration to be reset at each DOM element for |
| 107 // inline blocks, inline tables, shadow DOM crossings, floating elements, | 107 // inline blocks, inline tables, shadow DOM crossings, floating elements, |
| 108 // and absolute or relatively positioned elements. Outermost <svg> roots are | 108 // and absolute or relatively positioned elements. Outermost <svg> roots are |
| 109 // considered to be atomic inline-level. | 109 // considered to be atomic inline-level. |
| 110 static bool doesNotInheritTextDecoration(const ComputedStyle& style, const Eleme
nt* e) | 110 static bool doesNotInheritTextDecoration(const ComputedStyle& style, const Eleme
nt* e) |
| 111 { | 111 { |
| 112 return style.display() == INLINE_TABLE | 112 return style.display() == INLINE_TABLE |
| 113 || style.display() == INLINE_BLOCK || style.display() == INLINE_BOX || i
sAtShadowBoundary(e) | 113 || style.display() == INLINE_BLOCK || style.display() == INLINE_BOX || i
sAtShadowBoundary(e) |
| 114 || style.isFloating() || style.hasOutOfFlowPosition() || isOutermostSVGE
lement(e); | 114 || style.isFloating() || style.hasOutOfFlowPosition() || isOutermostSVGE
lement(e) |
| 115 || isHTMLRTElement(e); |
| 116 } |
| 117 |
| 118 // Certain elements (<a>, <font>) bind strongly to text decoration colors, for l
egacy reasons. |
| 119 static bool overridesTextDecorationColors(const Element* e) |
| 120 { |
| 121 return e && (isHTMLFontElement(e) || isHTMLAnchorElement(e)); |
| 115 } | 122 } |
| 116 | 123 |
| 117 // FIXME: This helper is only needed because pseudoStyleForElement passes a null | 124 // FIXME: This helper is only needed because pseudoStyleForElement passes a null |
| 118 // element to adjustComputedStyle, so we can't just use element->isInTopLayer(). | 125 // element to adjustComputedStyle, so we can't just use element->isInTopLayer(). |
| 119 static bool isInTopLayer(const Element* element, const ComputedStyle& style) | 126 static bool isInTopLayer(const Element* element, const ComputedStyle& style) |
| 120 { | 127 { |
| 121 return (element && element->isInTopLayer()) || style.styleType() == BACKDROP
; | 128 return (element && element->isInTopLayer()) || style.styleType() == BACKDROP
; |
| 122 } | 129 } |
| 123 | 130 |
| 124 static bool parentStyleForcesZIndexToCreateStackingContext(const ComputedStyle&
parentStyle) | 131 static bool parentStyleForcesZIndexToCreateStackingContext(const ComputedStyle&
parentStyle) |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 || style.hasFilter() | 204 || style.hasFilter() |
| 198 || style.hasBlendMode() | 205 || style.hasBlendMode() |
| 199 || style.hasIsolation() | 206 || style.hasIsolation() |
| 200 || style.position() == FixedPosition | 207 || style.position() == FixedPosition |
| 201 || isInTopLayer(e, style) | 208 || isInTopLayer(e, style) |
| 202 || hasWillChangeThatCreatesStackingContext(style))) | 209 || hasWillChangeThatCreatesStackingContext(style))) |
| 203 style.setZIndex(0); | 210 style.setZIndex(0); |
| 204 | 211 |
| 205 if (doesNotInheritTextDecoration(style, e)) | 212 if (doesNotInheritTextDecoration(style, e)) |
| 206 style.clearAppliedTextDecorations(); | 213 style.clearAppliedTextDecorations(); |
| 207 | 214 style.applyTextDecorations(overridesTextDecorationColors(e)); |
| 208 style.applyTextDecorations(); | |
| 209 | 215 |
| 210 if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE) | 216 if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE) |
| 211 adjustOverflow(style); | 217 adjustOverflow(style); |
| 212 | 218 |
| 213 // Cull out any useless layers and also repeat patterns into additional laye
rs. | 219 // Cull out any useless layers and also repeat patterns into additional laye
rs. |
| 214 style.adjustBackgroundLayers(); | 220 style.adjustBackgroundLayers(); |
| 215 style.adjustMaskLayers(); | 221 style.adjustMaskLayers(); |
| 216 | 222 |
| 217 // Let the theme also have a crack at adjusting the style. | 223 // Let the theme also have a crack at adjusting the style. |
| 218 if (style.hasAppearance()) | 224 if (style.hasAppearance()) |
| (...skipping 265 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 | 490 // 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. | 491 // behavior is different from the spec and we want to gather compatibili
ty data. |
| 486 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen
t()) | 492 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen
t()) |
| 487 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert
ical); | 493 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert
ical); |
| 488 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent(
)) | 494 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent(
)) |
| 489 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti
cal); | 495 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti
cal); |
| 490 } | 496 } |
| 491 } | 497 } |
| 492 | 498 |
| 493 } | 499 } |
| OLD | NEW |