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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/svg/transforms/will-change-transform-expected.svg ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleAdjuster.cpp
diff --git a/Source/core/css/resolver/StyleAdjuster.cpp b/Source/core/css/resolver/StyleAdjuster.cpp
index 733e50a61fb46c2684ba9ef0e8434d79e1581285..19c3d4d940e1ea95ac68fb61ccf522425472266e 100644
--- a/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/Source/core/css/resolver/StyleAdjuster.cpp
@@ -197,7 +197,9 @@ void StyleAdjuster::adjustComputedStyle(ComputedStyle& style, const ComputedStyl
// will-change:transform should result in the same rendering behavior as having a transform,
// including the creation of a containing block for fixed position descendants.
- if (!style.hasTransform() && (style.willChangeProperties().contains(CSSPropertyWebkitTransform) || style.willChangeProperties().contains(CSSPropertyTransform))) {
+ // SVG elements can skip this because they implicitly have transforms.
+ bool isSVGElement = e && e->isSVGElement();
+ if (!isSVGElement && !style.hasTransform() && (style.willChangeProperties().contains(CSSPropertyWebkitTransform) || style.willChangeProperties().contains(CSSPropertyTransform))) {
bool makeIdentity = true;
style.setTransform(TransformOperations(makeIdentity));
}
@@ -228,7 +230,7 @@ void StyleAdjuster::adjustComputedStyle(ComputedStyle& style, const ComputedStyl
|| style.hasFilter()))
style.setTransformStyle3D(TransformStyle3DFlat);
- if (e && e->isSVGElement()) {
+ if (isSVGElement) {
// Only the root <svg> element in an SVG document fragment tree honors css position
if (!(isSVGSVGElement(*e) && e->parentNode() && !e->parentNode()->isSVGElement()))
style.setPosition(ComputedStyle::initialPosition());
« 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