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

Unified Diff: Source/core/rendering/style/RenderStyle.cpp

Issue 175263002: Implement will-change-based creation of layers, stacking contexts, and containing blocks (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Always create a stacking context for will-change:position Created 6 years, 10 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
Index: Source/core/rendering/style/RenderStyle.cpp
diff --git a/Source/core/rendering/style/RenderStyle.cpp b/Source/core/rendering/style/RenderStyle.cpp
index dd038901323beff4ea13f628e031ea0377bd54aa..75558d6645ce33b6fce395b5cdfca14d44e878f5 100644
--- a/Source/core/rendering/style/RenderStyle.cpp
+++ b/Source/core/rendering/style/RenderStyle.cpp
@@ -650,7 +650,8 @@ StyleDifference RenderStyle::repaintOnlyDiff(const RenderStyle* other, unsigned&
|| rareNonInheritedData->m_backfaceVisibility != other->rareNonInheritedData->m_backfaceVisibility
|| rareNonInheritedData->m_perspective != other->rareNonInheritedData->m_perspective
|| rareNonInheritedData->m_perspectiveOriginX != other->rareNonInheritedData->m_perspectiveOriginX
- || rareNonInheritedData->m_perspectiveOriginY != other->rareNonInheritedData->m_perspectiveOriginY)
+ || rareNonInheritedData->m_perspectiveOriginY != other->rareNonInheritedData->m_perspectiveOriginY
+ || hasWillChangeCompositingHint() != other->hasWillChangeCompositingHint())
return StyleDifferenceRecompositeLayer;
}
@@ -831,6 +832,25 @@ bool RenderStyle::hasIsolation() const
return false;
}
+bool RenderStyle::hasWillChangeCompositingHint() const
+{
+ for (size_t i = 0; i < rareNonInheritedData->m_willChange->m_properties.size(); ++i) {
+ switch (rareNonInheritedData->m_willChange->m_properties[i]) {
+ case CSSPropertyOpacity:
+ case CSSPropertyWebkitTransform:
+ case CSSPropertyLeft:
+ case CSSPropertyTop:
+ case CSSPropertyRight:
+ case CSSPropertyBottom:
+ case CSSPropertyWebkitFilter:
+ return true;
+ default:
+ break;
+ }
+ }
+ return false;
+}
+
inline bool requireTransformOrigin(const Vector<RefPtr<TransformOperation> >& transformOperations, RenderStyle::ApplyTransformOrigin applyOrigin)
{
// transform-origin brackets the transform with translate operations.

Powered by Google App Engine
This is Rietveld 408576698