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

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

Issue 1075093002: will-change on SVG elements should not reset transforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: edit a comment. Created 5 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
« no previous file with comments | « LayoutTests/svg/transforms/will-change-transform-expected.svg ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 || style.hasFilter() 190 || style.hasFilter()
191 || style.hasBlendMode() 191 || style.hasBlendMode()
192 || style.hasIsolation() 192 || style.hasIsolation()
193 || style.position() == FixedPosition 193 || style.position() == FixedPosition
194 || isInTopLayer(e, style) 194 || isInTopLayer(e, style)
195 || hasWillChangeThatCreatesStackingContext(style))) 195 || hasWillChangeThatCreatesStackingContext(style)))
196 style.setZIndex(0); 196 style.setZIndex(0);
197 197
198 // will-change:transform should result in the same rendering behavior as hav ing a transform, 198 // will-change:transform should result in the same rendering behavior as hav ing a transform,
199 // including the creation of a containing block for fixed position descendan ts. 199 // including the creation of a containing block for fixed position descendan ts.
200 if (!style.hasTransform() && (style.willChangeProperties().contains(CSSPrope rtyWebkitTransform) || style.willChangeProperties().contains(CSSPropertyTransfor m))) { 200 // SVG elements can skip this because they implicitly have transforms.
201 bool isSVGElement = e && e->isSVGElement();
202 if (!isSVGElement && !style.hasTransform() && (style.willChangeProperties(). contains(CSSPropertyWebkitTransform) || style.willChangeProperties().contains(CS SPropertyTransform))) {
201 bool makeIdentity = true; 203 bool makeIdentity = true;
202 style.setTransform(TransformOperations(makeIdentity)); 204 style.setTransform(TransformOperations(makeIdentity));
203 } 205 }
204 206
205 if (doesNotInheritTextDecoration(style, e)) 207 if (doesNotInheritTextDecoration(style, e))
206 style.clearAppliedTextDecorations(); 208 style.clearAppliedTextDecorations();
207 209
208 style.applyTextDecorations(); 210 style.applyTextDecorations();
209 211
210 if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE) 212 if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE)
(...skipping 10 matching lines...) Expand all
221 // If we have first-letter pseudo style, transitions, or animations, do not share this style. 223 // If we have first-letter pseudo style, transitions, or animations, do not share this style.
222 if (style.hasPseudoStyle(FIRST_LETTER) || style.transitions() || style.anima tions()) 224 if (style.hasPseudoStyle(FIRST_LETTER) || style.transitions() || style.anima tions())
223 style.setUnique(); 225 style.setUnique();
224 226
225 // FIXME: when dropping the -webkit prefix on transform-style, we should als o have opacity < 1 cause flattening. 227 // FIXME: when dropping the -webkit prefix on transform-style, we should als o have opacity < 1 cause flattening.
226 if (style.preserves3D() && (style.overflowX() != OVISIBLE 228 if (style.preserves3D() && (style.overflowX() != OVISIBLE
227 || style.overflowY() != OVISIBLE 229 || style.overflowY() != OVISIBLE
228 || style.hasFilter())) 230 || style.hasFilter()))
229 style.setTransformStyle3D(TransformStyle3DFlat); 231 style.setTransformStyle3D(TransformStyle3DFlat);
230 232
231 if (e && e->isSVGElement()) { 233 if (isSVGElement) {
232 // Only the root <svg> element in an SVG document fragment tree honors c ss position 234 // Only the root <svg> element in an SVG document fragment tree honors c ss position
233 if (!(isSVGSVGElement(*e) && e->parentNode() && !e->parentNode()->isSVGE lement())) 235 if (!(isSVGSVGElement(*e) && e->parentNode() && !e->parentNode()->isSVGE lement()))
234 style.setPosition(ComputedStyle::initialPosition()); 236 style.setPosition(ComputedStyle::initialPosition());
235 237
236 // SVG text layout code expects us to be a block-level style element. 238 // SVG text layout code expects us to be a block-level style element.
237 if ((isSVGForeignObjectElement(*e) || isSVGTextElement(*e)) && style.isD isplayInlineType()) 239 if ((isSVGForeignObjectElement(*e) || isSVGTextElement(*e)) && style.isD isplayInlineType())
238 style.setDisplay(BLOCK); 240 style.setDisplay(BLOCK);
239 241
240 // Columns don't apply to svg text elements. 242 // Columns don't apply to svg text elements.
241 if (isSVGTextElement(*e)) 243 if (isSVGTextElement(*e))
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 if (style.writingMode() != TopToBottomWritingMode && (style.display() == BOX || style.display() == INLINE_BOX)) 488 if (style.writingMode() != TopToBottomWritingMode && (style.display() == BOX || style.display() == INLINE_BOX))
487 style.setWritingMode(TopToBottomWritingMode); 489 style.setWritingMode(TopToBottomWritingMode);
488 490
489 if (parentStyle.isDisplayFlexibleOrGridBox()) { 491 if (parentStyle.isDisplayFlexibleOrGridBox()) {
490 style.setFloating(NoFloat); 492 style.setFloating(NoFloat);
491 style.setDisplay(equivalentBlockDisplay(style.display(), style.isFloatin g(), !m_useQuirksModeStyles)); 493 style.setDisplay(equivalentBlockDisplay(style.display(), style.isFloatin g(), !m_useQuirksModeStyles));
492 } 494 }
493 } 495 }
494 496
495 } 497 }
OLDNEW
« no previous file with comments | « LayoutTests/svg/transforms/will-change-transform-expected.svg ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698