Index: third_party/WebKit/Source/core/dom/Element.cpp |
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp |
index 2351061beffa6fe31b4f88515be7642791eec300..fe161c8e022bbab6367c99ef43fa88e1ea10090e 100644 |
--- a/third_party/WebKit/Source/core/dom/Element.cpp |
+++ b/third_party/WebKit/Source/core/dom/Element.cpp |
@@ -973,18 +973,35 @@ void Element::scrollFrameTo(const ScrollToOptions& scrollToOptions) |
viewport->setScrollPosition(DoublePoint(scaledLeft, scaledTop), ProgrammaticScroll, scrollBehavior); |
} |
-void Element::incrementProxyCount() |
+bool Element::hasCompositorProxy() const |
{ |
- if (ensureElementRareData().incrementProxyCount() == 1) |
+ return hasRareData() && elementRareData()->proxiedPropertyCounts(); |
+} |
+ |
+void Element::incrementProxiedPropertyCounts(uint32_t mutableProperties) |
+{ |
+ const bool hadProxy = hasCompositorProxy(); |
+ ensureElementRareData().incrementProxiedPropertyCounts(mutableProperties); |
+ if (!hadProxy && hasCompositorProxy()) |
setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::CompositorProxy)); |
chrishtr
2015/11/24 16:22:50
Incrementing a count can cause a style recalc? Tha
Ian Vollick
2015/11/25 18:28:45
Yes, it's like saying that you "will change" a pro
|
} |
-void Element::decrementProxyCount() |
+void Element::decrementProxiedPropertyCounts(uint32_t mutableProperties) |
{ |
- if (ensureElementRareData().decrementProxyCount() == 0) |
+ ASSERT(hasRareData()); |
+ const bool hadProxy = hasCompositorProxy(); |
+ elementRareData()->decrementProxiedPropertyCounts(mutableProperties); |
+ if (hadProxy && !hasCompositorProxy()) |
setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::CompositorProxy)); |
} |
+uint32_t Element::mutableProperties() const |
+{ |
+ if (!hasCompositorProxy()) |
+ return WebCompositorMutablePropertyNone; |
+ return elementRareData()->proxiedPropertyCounts()->proxiedProperties(); |
+} |
+ |
bool Element::hasNonEmptyLayoutSize() const |
{ |
document().updateLayoutIgnorePendingStylesheets(); |
@@ -1686,9 +1703,6 @@ PassRefPtr<ComputedStyle> Element::styleForLayoutObject() |
style->setHasInlineTransform(inlineStyle->hasProperty(CSSPropertyTransform)); |
} |
- if (hasRareData() && elementRareData()->proxyCount() > 0) |
- style->setHasCompositorProxy(true); |
- |
document().didRecalculateStyleForElement(); |
return style.release(); |
} |