Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: Source/core/css/resolver/StyleAdjuster.cpp

Issue 219633002: Proper support for multiple text decorations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 return BLOCK; 129 return BLOCK;
130 } 130 }
131 131
132 // CSS requires text-decoration to be reset at each DOM element for tables, 132 // CSS requires text-decoration to be reset at each DOM element for tables,
133 // inline blocks, inline tables, shadow DOM crossings, floating elements, 133 // inline blocks, inline tables, shadow DOM crossings, floating elements,
134 // and absolute or relatively positioned elements. 134 // and absolute or relatively positioned elements.
135 static bool doesNotInheritTextDecoration(const RenderStyle* style, const Element * e) 135 static bool doesNotInheritTextDecoration(const RenderStyle* style, const Element * e)
136 { 136 {
137 return style->display() == TABLE || style->display() == INLINE_TABLE 137 return style->display() == TABLE || style->display() == INLINE_TABLE
138 || style->display() == INLINE_BLOCK || style->display() == INLINE_BOX || isAtShadowBoundary(e) 138 || style->display() == INLINE_BLOCK || style->display() == INLINE_BOX || isAtShadowBoundary(e)
139 || style->isFloating() || style->hasOutOfFlowPosition(); 139 || style->isFloating() || style->hasOutOfFlowPosition() || isHTMLRTEleme nt(e);
140 } 140 }
141 141
142 // FIXME: This helper is only needed because pseudoStyleForElement passes a null 142 // FIXME: This helper is only needed because pseudoStyleForElement passes a null
143 // element to adjustRenderStyle, so we can't just use element->isInTopLayer(). 143 // element to adjustRenderStyle, so we can't just use element->isInTopLayer().
144 static bool isInTopLayer(const Element* element, const RenderStyle* style) 144 static bool isInTopLayer(const Element* element, const RenderStyle* style)
145 { 145 {
146 return (element && element->isInTopLayer()) || (style && style->styleType() == BACKDROP); 146 return (element && element->isInTopLayer()) || (style && style->styleType() == BACKDROP);
147 } 147 }
148 148
149 static bool isDisplayFlexibleBox(EDisplay display) 149 static bool isDisplayFlexibleBox(EDisplay display)
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 style->setZIndex(0); 235 style->setZIndex(0);
236 236
237 // will-change:transform should result in the same rendering behavior as hav ing a transform, 237 // will-change:transform should result in the same rendering behavior as hav ing a transform,
238 // including the creation of a containing block for fixed position descendan ts. 238 // including the creation of a containing block for fixed position descendan ts.
239 if (!style->hasTransform() && style->willChangeProperties().contains(CSSProp ertyWebkitTransform)) { 239 if (!style->hasTransform() && style->willChangeProperties().contains(CSSProp ertyWebkitTransform)) {
240 bool makeIdentity = true; 240 bool makeIdentity = true;
241 style->setTransform(TransformOperations(makeIdentity)); 241 style->setTransform(TransformOperations(makeIdentity));
242 } 242 }
243 243
244 if (doesNotInheritTextDecoration(style, e)) 244 if (doesNotInheritTextDecoration(style, e))
245 style->setTextDecorationsInEffect(style->textDecoration()); 245 style->clearAppliedTextDecorations();
246 else 246
247 style->addToTextDecorationsInEffect(style->textDecoration()); 247 style->applyTextDecorations();
248 248
249 if (style->overflowX() != OVISIBLE || style->overflowY() != OVISIBLE) 249 if (style->overflowX() != OVISIBLE || style->overflowY() != OVISIBLE)
250 adjustOverflow(style, e); 250 adjustOverflow(style, e);
251 251
252 // Cull out any useless layers and also repeat patterns into additional laye rs. 252 // Cull out any useless layers and also repeat patterns into additional laye rs.
253 style->adjustBackgroundLayers(); 253 style->adjustBackgroundLayers();
254 style->adjustMaskLayers(); 254 style->adjustMaskLayers();
255 255
256 // Let the theme also have a crack at adjusting the style. 256 // Let the theme also have a crack at adjusting the style.
257 if (style->hasAppearance()) 257 if (style->hasAppearance())
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 if (style->writingMode() != TopToBottomWritingMode && (style->display() == B OX || style->display() == INLINE_BOX)) 449 if (style->writingMode() != TopToBottomWritingMode && (style->display() == B OX || style->display() == INLINE_BOX))
450 style->setWritingMode(TopToBottomWritingMode); 450 style->setWritingMode(TopToBottomWritingMode);
451 451
452 if (isDisplayFlexibleBox(parentStyle->display()) || isDisplayGridBox(parentS tyle->display())) { 452 if (isDisplayFlexibleBox(parentStyle->display()) || isDisplayGridBox(parentS tyle->display())) {
453 style->setFloating(NoFloat); 453 style->setFloating(NoFloat);
454 style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloa ting(), !m_useQuirksModeStyles)); 454 style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloa ting(), !m_useQuirksModeStyles));
455 } 455 }
456 } 456 }
457 457
458 } 458 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698