| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 } | 105 } |
| 106 | 106 |
| 107 // CSS requires text-decoration to be reset at each DOM element for | 107 // CSS requires text-decoration to be reset at each DOM element for |
| 108 // inline blocks, inline tables, shadow DOM crossings, floating elements, | 108 // inline blocks, inline tables, shadow DOM crossings, floating elements, |
| 109 // and absolute or relatively positioned elements. Outermost <svg> roots are | 109 // and absolute or relatively positioned elements. Outermost <svg> roots are |
| 110 // considered to be atomic inline-level. | 110 // considered to be atomic inline-level. |
| 111 static bool doesNotInheritTextDecoration(const ComputedStyle& style, const Eleme
nt* element) | 111 static bool doesNotInheritTextDecoration(const ComputedStyle& style, const Eleme
nt* element) |
| 112 { | 112 { |
| 113 return style.display() == INLINE_TABLE | 113 return style.display() == INLINE_TABLE |
| 114 || style.display() == INLINE_BLOCK || style.display() == INLINE_BOX || i
sAtShadowBoundary(element) | 114 || style.display() == INLINE_BLOCK || style.display() == INLINE_BOX || i
sAtShadowBoundary(element) |
| 115 || style.isFloating() || style.hasOutOfFlowPosition() || isOutermostSVGE
lement(element); | 115 || style.isFloating() || style.hasOutOfFlowPosition() || isOutermostSVGE
lement(element) |
| 116 || isHTMLRTElement(element); |
| 117 } |
| 118 |
| 119 // Certain elements (<a>, <font>) override text decoration colors. |
| 120 // "The font element is expected to override the color of any text decoration th
at |
| 121 // spans the text of the element to the used value of the element's 'color' prop
erty." |
| 122 // (from https://html.spec.whatwg.org/multipage/rendering.html#phrasing-content-
3) |
| 123 // The <a> behavior is non-standard. |
| 124 static bool overridesTextDecorationColors(const Element* element) |
| 125 { |
| 126 return element && (isHTMLFontElement(element) || isHTMLAnchorElement(element
)); |
| 116 } | 127 } |
| 117 | 128 |
| 118 // FIXME: This helper is only needed because pseudoStyleForElement passes a null | 129 // FIXME: This helper is only needed because pseudoStyleForElement passes a null |
| 119 // element to adjustComputedStyle, so we can't just use element->isInTopLayer(). | 130 // element to adjustComputedStyle, so we can't just use element->isInTopLayer(). |
| 120 static bool isInTopLayer(const Element* element, const ComputedStyle& style) | 131 static bool isInTopLayer(const Element* element, const ComputedStyle& style) |
| 121 { | 132 { |
| 122 return (element && element->isInTopLayer()) || style.styleType() == BACKDROP
; | 133 return (element && element->isInTopLayer()) || style.styleType() == BACKDROP
; |
| 123 } | 134 } |
| 124 | 135 |
| 125 static bool parentStyleForcesZIndexToCreateStackingContext(const ComputedStyle&
parentStyle) | 136 static bool parentStyleForcesZIndexToCreateStackingContext(const ComputedStyle&
parentStyle) |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 || style.hasBlendMode() | 213 || style.hasBlendMode() |
| 203 || style.hasIsolation() | 214 || style.hasIsolation() |
| 204 || style.position() == FixedPosition | 215 || style.position() == FixedPosition |
| 205 || isInTopLayer(element, style) | 216 || isInTopLayer(element, style) |
| 206 || hasWillChangeThatCreatesStackingContext(style))) | 217 || hasWillChangeThatCreatesStackingContext(style))) |
| 207 style.setZIndex(0); | 218 style.setZIndex(0); |
| 208 | 219 |
| 209 if (doesNotInheritTextDecoration(style, element)) | 220 if (doesNotInheritTextDecoration(style, element)) |
| 210 style.clearAppliedTextDecorations(); | 221 style.clearAppliedTextDecorations(); |
| 211 | 222 |
| 212 style.applyTextDecorations(); | 223 style.applyTextDecorations(parentStyle.visitedDependentColor(CSSPropertyText
DecorationColor), overridesTextDecorationColors(element)); |
| 213 | 224 |
| 214 if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE) | 225 if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE) |
| 215 adjustOverflow(style); | 226 adjustOverflow(style); |
| 216 | 227 |
| 217 // Cull out any useless layers and also repeat patterns into additional laye
rs. | 228 // Cull out any useless layers and also repeat patterns into additional laye
rs. |
| 218 style.adjustBackgroundLayers(); | 229 style.adjustBackgroundLayers(); |
| 219 style.adjustMaskLayers(); | 230 style.adjustMaskLayers(); |
| 220 | 231 |
| 221 // Let the theme also have a crack at adjusting the style. | 232 // Let the theme also have a crack at adjusting the style. |
| 222 if (style.hasAppearance()) | 233 if (style.hasAppearance()) |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 // We want to count vertical percentage paddings/margins on flex items b
ecause our current | 499 // We want to count vertical percentage paddings/margins on flex items b
ecause our current |
| 489 // behavior is different from the spec and we want to gather compatibili
ty data. | 500 // behavior is different from the spec and we want to gather compatibili
ty data. |
| 490 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen
t()) | 501 if (style.paddingBefore().hasPercent() || style.paddingAfter().hasPercen
t()) |
| 491 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert
ical); | 502 UseCounter::count(document, UseCounter::FlexboxPercentagePaddingVert
ical); |
| 492 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent(
)) | 503 if (style.marginBefore().hasPercent() || style.marginAfter().hasPercent(
)) |
| 493 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti
cal); | 504 UseCounter::count(document, UseCounter::FlexboxPercentageMarginVerti
cal); |
| 494 } | 505 } |
| 495 } | 506 } |
| 496 | 507 |
| 497 } | 508 } |
| OLD | NEW |