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

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

Issue 1318273003: Prevent will-change:transform from changing the computed value of transform (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 | Annotate | Revision Log
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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 || style.clipPath() 194 || style.clipPath()
195 || style.boxReflect() 195 || style.boxReflect()
196 || style.hasFilter() 196 || style.hasFilter()
197 || style.hasBlendMode() 197 || style.hasBlendMode()
198 || style.hasIsolation() 198 || style.hasIsolation()
199 || style.position() == FixedPosition 199 || style.position() == FixedPosition
200 || isInTopLayer(e, style) 200 || isInTopLayer(e, style)
201 || hasWillChangeThatCreatesStackingContext(style))) 201 || hasWillChangeThatCreatesStackingContext(style)))
202 style.setZIndex(0); 202 style.setZIndex(0);
203 203
204 // will-change:transform should result in the same rendering behavior as hav ing a transform,
205 // including the creation of a containing block for fixed position descendan ts.
206 // SVG elements can skip this because they implicitly have transforms.
207 bool isSVGElement = e && e->isSVGElement();
208 if (!isSVGElement && !style.hasTransform() && (style.willChangeProperties(). contains(CSSPropertyAliasWebkitTransform) || style.willChangeProperties().contai ns(CSSPropertyTransform))) {
209 bool makeIdentity = true;
210 style.setTransform(TransformOperations(makeIdentity));
211 }
212
213 if (doesNotInheritTextDecoration(style, e)) 204 if (doesNotInheritTextDecoration(style, e))
214 style.clearAppliedTextDecorations(); 205 style.clearAppliedTextDecorations();
215 206
216 style.applyTextDecorations(); 207 style.applyTextDecorations();
217 208
218 if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE) 209 if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE)
219 adjustOverflow(style); 210 adjustOverflow(style);
220 211
221 // Cull out any useless layers and also repeat patterns into additional laye rs. 212 // Cull out any useless layers and also repeat patterns into additional laye rs.
222 style.adjustBackgroundLayers(); 213 style.adjustBackgroundLayers();
223 style.adjustMaskLayers(); 214 style.adjustMaskLayers();
224 215
225 // Let the theme also have a crack at adjusting the style. 216 // Let the theme also have a crack at adjusting the style.
226 if (style.hasAppearance()) 217 if (style.hasAppearance())
227 LayoutTheme::theme().adjustStyle(style, e, authorStyle); 218 LayoutTheme::theme().adjustStyle(style, e, authorStyle);
228 219
229 // If we have first-letter pseudo style, transitions, or animations, do not share this style. 220 // 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()) 221 if (style.hasPseudoStyle(FIRST_LETTER) || style.transitions() || style.anima tions())
231 style.setUnique(); 222 style.setUnique();
232 223
233 // FIXME: when dropping the -webkit prefix on transform-style, we should als o have opacity < 1 cause flattening. 224 // 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 225 if (style.preserves3D() && (style.overflowX() != OVISIBLE
235 || style.overflowY() != OVISIBLE 226 || style.overflowY() != OVISIBLE
236 || style.hasFilter())) 227 || style.hasFilter()))
237 style.setTransformStyle3D(TransformStyle3DFlat); 228 style.setTransformStyle3D(TransformStyle3DFlat);
238 229
230 bool isSVGElement = e && e->isSVGElement();
239 if (isSVGElement) { 231 if (isSVGElement) {
240 // Only the root <svg> element in an SVG document fragment tree honors c ss position 232 // Only the root <svg> element in an SVG document fragment tree honors c ss position
241 if (!(isSVGSVGElement(*e) && e->parentNode() && !e->parentNode()->isSVGE lement())) 233 if (!(isSVGSVGElement(*e) && e->parentNode() && !e->parentNode()->isSVGE lement()))
242 style.setPosition(ComputedStyle::initialPosition()); 234 style.setPosition(ComputedStyle::initialPosition());
243 235
244 // SVG text layout code expects us to be a block-level style element. 236 // SVG text layout code expects us to be a block-level style element.
245 if ((isSVGForeignObjectElement(*e) || isSVGTextElement(*e)) && style.isD isplayInlineType()) 237 if ((isSVGForeignObjectElement(*e) || isSVGTextElement(*e)) && style.isD isplayInlineType())
246 style.setDisplay(BLOCK); 238 style.setDisplay(BLOCK);
247 239
248 // Columns don't apply to svg text elements. 240 // Columns don't apply to svg text elements.
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 if (style.writingMode() != TopToBottomWritingMode && (style.display() == BOX || style.display() == INLINE_BOX)) 486 if (style.writingMode() != TopToBottomWritingMode && (style.display() == BOX || style.display() == INLINE_BOX))
495 style.setWritingMode(TopToBottomWritingMode); 487 style.setWritingMode(TopToBottomWritingMode);
496 488
497 if (parentStyle.isDisplayFlexibleOrGridBox()) { 489 if (parentStyle.isDisplayFlexibleOrGridBox()) {
498 style.setFloating(NoFloat); 490 style.setFloating(NoFloat);
499 style.setDisplay(equivalentBlockDisplay(style.display(), style.isFloatin g(), !m_useQuirksModeStyles)); 491 style.setDisplay(equivalentBlockDisplay(style.display(), style.isFloatin g(), !m_useQuirksModeStyles));
500 } 492 }
501 } 493 }
502 494
503 } 495 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698