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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.h

Issue 2065233002: Force flattening for elements with non-initial value of opacity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix assert. (overflow needs to be adjusted prior to querying used transform-style) Created 4 years, 6 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 | « third_party/WebKit/Source/core/paint/PaintLayer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/style/ComputedStyle.h
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h
index 2bb0089bbef25e81bb5f7f2cf72c94a9a6c4def6..8c75e18187bde16ebd69f20fe887d36019399b9f 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.h
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -457,6 +457,17 @@ public:
// used (including, but not limited to, 'filter').
bool hasFilterInducingProperty() const { return hasFilter() || (RuntimeEnabledFeatures::cssBoxReflectFilterEnabled() && hasBoxReflect()); }
+ // Returns |true| if opacity should be considered to have non-initial value for the purpose
+ // of creating stacking contexts.
+ bool hasNonInitialOpacity() const { return hasOpacity() || hasWillChangeOpacityHint() || hasCurrentOpacityAnimation(); }
+
+ // Returns whether this style contains any grouping property as defined by [css-transforms].
+ // The main purpose of this is to adjust the used value of transform-style property.
+ // Note: We currently don't include every grouping property on the spec to maintain
+ // backward compatibility.
+ // [css-transforms] https://drafts.csswg.org/css-transforms/#grouping-property-values
+ bool hasGroupingProperty() const { return !isOverflowVisible() || hasFilterInducingProperty() || hasNonInitialOpacity(); }
+
Order rtlOrdering() const { return static_cast<Order>(inherited_flags.m_rtlOrdering); }
void setRTLOrdering(Order o) { inherited_flags.m_rtlOrdering = o; }
@@ -962,7 +973,8 @@ public:
CSSTransitionData& accessTransitions();
ETransformStyle3D transformStyle3D() const { return static_cast<ETransformStyle3D>(rareNonInheritedData->m_transformStyle3D); }
- bool preserves3D() const { return rareNonInheritedData->m_transformStyle3D == TransformStyle3DPreserve3D; }
+ ETransformStyle3D usedTransformStyle3D() const { return hasGroupingProperty() ? TransformStyle3DFlat : transformStyle3D(); }
+ bool preserves3D() const { return usedTransformStyle3D() != TransformStyle3DFlat; }
EBackfaceVisibility backfaceVisibility() const { return static_cast<EBackfaceVisibility>(rareNonInheritedData->m_backfaceVisibility); }
float perspective() const { return rareNonInheritedData->m_perspective; }
@@ -1030,6 +1042,7 @@ public:
bool willChangeContents() const { return rareNonInheritedData->m_willChange->m_contents; }
bool willChangeScrollPosition() const { return rareNonInheritedData->m_willChange->m_scrollPosition; }
bool hasWillChangeCompositingHint() const;
+ bool hasWillChangeOpacityHint() const { return willChangeProperties().contains(CSSPropertyOpacity); }
bool hasWillChangeTransformHint() const;
bool subtreeWillChangeContents() const { return rareInheritedData->m_subtreeWillChangeContents; }
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698