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

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2532223003: Forces stacking context for computed value of transform-style:preserve-3d (Closed)
Patch Set: Switch to unit test & rephrase comment Created 4 years 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 | « no previous file | third_party/WebKit/Source/core/style/ComputedStyleTest.cpp » ('j') | 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 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
4 * reserved. 4 * reserved.
5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 } 1200 }
1201 } 1201 }
1202 return false; 1202 return false;
1203 } 1203 }
1204 1204
1205 void ComputedStyle::updateIsStackingContext(bool isDocumentElement, 1205 void ComputedStyle::updateIsStackingContext(bool isDocumentElement,
1206 bool isInTopLayer) { 1206 bool isInTopLayer) {
1207 if (isStackingContext()) 1207 if (isStackingContext())
1208 return; 1208 return;
1209 1209
1210 // Force a stacking context for transform-style: preserve-3d. This happens
1211 // even if preserves-3d is ignored due to a 'grouping property' being present
1212 // which requires flattening. See ComputedStyle::usedTransformStyle3D() and
1213 // ComputedStyle::hasGroupingProperty().
1214 // This is legacy behavior that is left ambiguous in the official specs.
1215 // See crbug.com/663650 for more details."
1216 if (transformStyle3D() == TransformStyle3DPreserve3D) {
1217 setIsStackingContext(true);
1218 return;
1219 }
1220
1210 if (isDocumentElement || isInTopLayer || styleType() == PseudoIdBackdrop || 1221 if (isDocumentElement || isInTopLayer || styleType() == PseudoIdBackdrop ||
1211 hasOpacity() || hasTransformRelatedProperty() || hasMask() || 1222 hasOpacity() || hasTransformRelatedProperty() || hasMask() ||
1212 clipPath() || boxReflect() || hasFilterInducingProperty() || 1223 clipPath() || boxReflect() || hasFilterInducingProperty() ||
1213 hasBackdropFilter() || hasBlendMode() || hasIsolation() || 1224 hasBackdropFilter() || hasBlendMode() || hasIsolation() ||
1214 hasViewportConstrainedPosition() || 1225 hasViewportConstrainedPosition() ||
1215 hasPropertyThatCreatesStackingContext(willChangeProperties()) || 1226 hasPropertyThatCreatesStackingContext(willChangeProperties()) ||
1216 containsPaint()) { 1227 containsPaint()) {
1217 setIsStackingContext(true); 1228 setIsStackingContext(true);
1218 } 1229 }
1219 } 1230 }
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after
2445 if (value < 0) 2456 if (value < 0)
2446 fvalue -= 0.5f; 2457 fvalue -= 0.5f;
2447 else 2458 else
2448 fvalue += 0.5f; 2459 fvalue += 0.5f;
2449 } 2460 }
2450 2461
2451 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 2462 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
2452 } 2463 }
2453 2464
2454 } // namespace blink 2465 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/style/ComputedStyleTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698