From 82bda631f5f3b7901a7fe70c132c9b73a860e67b Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Sat, 12 Aug 2017 18:42:04 -0400 Subject: [PATCH] Bug 1389215 - Don't layerize in response to margin changes. r=mattwoodrow MozReview-Commit-ID: Ahr3g1NAoQ7 --HG-- extra : rebase_source : a6462769096b8737e58227259ac1f72581c6ed70 --- layout/painting/ActiveLayerTracker.cpp | 16 ++-------------- layout/painting/ActiveLayerTracker.h | 2 +- layout/painting/nsDisplayList.cpp | 2 +- layout/style/nsDOMCSSAttrDeclaration.cpp | 2 -- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/layout/painting/ActiveLayerTracker.cpp b/layout/painting/ActiveLayerTracker.cpp index be379f97f18f..0710f5900bbc 100644 --- a/layout/painting/ActiveLayerTracker.cpp +++ b/layout/painting/ActiveLayerTracker.cpp @@ -45,10 +45,6 @@ public: ACTIVITY_TOP, ACTIVITY_RIGHT, ACTIVITY_BOTTOM, - ACTIVITY_MARGIN_LEFT, - ACTIVITY_MARGIN_TOP, - ACTIVITY_MARGIN_RIGHT, - ACTIVITY_MARGIN_BOTTOM, ACTIVITY_BACKGROUND_POSITION, ACTIVITY_SCALE, @@ -80,10 +76,6 @@ public: case eCSSProperty_top: return ACTIVITY_TOP; case eCSSProperty_right: return ACTIVITY_RIGHT; case eCSSProperty_bottom: return ACTIVITY_BOTTOM; - case eCSSProperty_margin_left: return ACTIVITY_MARGIN_LEFT; - case eCSSProperty_margin_top: return ACTIVITY_MARGIN_TOP; - case eCSSProperty_margin_right: return ACTIVITY_MARGIN_RIGHT; - case eCSSProperty_margin_bottom: return ACTIVITY_MARGIN_BOTTOM; case eCSSProperty_background_position: return ACTIVITY_BACKGROUND_POSITION; case eCSSProperty_background_position_x: return ACTIVITY_BACKGROUND_POSITION; case eCSSProperty_background_position_y: return ACTIVITY_BACKGROUND_POSITION; @@ -449,18 +441,14 @@ ActiveLayerTracker::IsStyleAnimated(nsDisplayListBuilder* aBuilder, } /* static */ bool -ActiveLayerTracker::IsOffsetOrMarginStyleAnimated(nsIFrame* aFrame) +ActiveLayerTracker::IsOffsetStyleAnimated(nsIFrame* aFrame) { LayerActivity* layerActivity = GetLayerActivity(aFrame); if (layerActivity) { if (layerActivity->mRestyleCounts[LayerActivity::ACTIVITY_LEFT] >= 2 || layerActivity->mRestyleCounts[LayerActivity::ACTIVITY_TOP] >= 2 || layerActivity->mRestyleCounts[LayerActivity::ACTIVITY_RIGHT] >= 2 || - layerActivity->mRestyleCounts[LayerActivity::ACTIVITY_BOTTOM] >= 2 || - layerActivity->mRestyleCounts[LayerActivity::ACTIVITY_MARGIN_LEFT] >= 2 || - layerActivity->mRestyleCounts[LayerActivity::ACTIVITY_MARGIN_TOP] >= 2 || - layerActivity->mRestyleCounts[LayerActivity::ACTIVITY_MARGIN_RIGHT] >= 2 || - layerActivity->mRestyleCounts[LayerActivity::ACTIVITY_MARGIN_BOTTOM] >= 2) { + layerActivity->mRestyleCounts[LayerActivity::ACTIVITY_BOTTOM] >= 2) { return true; } } diff --git a/layout/painting/ActiveLayerTracker.h b/layout/painting/ActiveLayerTracker.h index 145f5481efd6..2fa8708d57e2 100644 --- a/layout/painting/ActiveLayerTracker.h +++ b/layout/painting/ActiveLayerTracker.h @@ -86,7 +86,7 @@ public: * Return true if any of aFrame's offset property styles should be considered * as being animated for constructing active layers. */ - static bool IsOffsetOrMarginStyleAnimated(nsIFrame* aFrame); + static bool IsOffsetStyleAnimated(nsIFrame* aFrame); /** * Return true if aFrame's background-position-x or background-position-y * property is animated. diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index d955036f2166..8617203a6b6a 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -1501,7 +1501,7 @@ nsDisplayListBuilder::IsAnimatedGeometryRoot(nsIFrame* aFrame, if (nsLayoutUtils::IsPopup(aFrame)) return AGR_YES; - if (ActiveLayerTracker::IsOffsetOrMarginStyleAnimated(aFrame)) { + if (ActiveLayerTracker::IsOffsetStyleAnimated(aFrame)) { const bool inBudget = AddToAGRBudget(aFrame); if (inBudget) { return AGR_YES; diff --git a/layout/style/nsDOMCSSAttrDeclaration.cpp b/layout/style/nsDOMCSSAttrDeclaration.cpp index 468d48003ae6..6e05a5a2238e 100644 --- a/layout/style/nsDOMCSSAttrDeclaration.cpp +++ b/layout/style/nsDOMCSSAttrDeclaration.cpp @@ -211,8 +211,6 @@ nsDOMCSSAttributeDeclaration::SetPropertyValue(const nsCSSPropertyID aPropID, if (aPropID == eCSSProperty_opacity || aPropID == eCSSProperty_transform || aPropID == eCSSProperty_left || aPropID == eCSSProperty_top || aPropID == eCSSProperty_right || aPropID == eCSSProperty_bottom || - aPropID == eCSSProperty_margin_left || aPropID == eCSSProperty_margin_top || - aPropID == eCSSProperty_margin_right || aPropID == eCSSProperty_margin_bottom || aPropID == eCSSProperty_background_position_x || aPropID == eCSSProperty_background_position_y || aPropID == eCSSProperty_background_position) {