Bug 1389215 - Don't layerize in response to margin changes. r=mattwoodrow

MozReview-Commit-ID: Ahr3g1NAoQ7

--HG--
extra : rebase_source : a6462769096b8737e58227259ac1f72581c6ed70
This commit is contained in:
Markus Stange 2017-08-12 18:42:04 -04:00
Родитель 26c1def56b
Коммит 82bda631f5
4 изменённых файлов: 4 добавлений и 18 удалений

Просмотреть файл

@ -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;
}
}

Просмотреть файл

@ -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.

Просмотреть файл

@ -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;

Просмотреть файл

@ -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) {