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

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

Powered by Google App Engine
This is Rietveld 408576698