Index: third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.h |
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.h b/third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.h |
index 254c1359484696d8c716ac1973e30f587e1b0d25..66ed2e85b9e71be90ac94bcdc8dfc6a4d0b2b8d1 100644 |
--- a/third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.h |
+++ b/third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.h |
@@ -62,6 +62,24 @@ class SVGResourcesCache { |
StyleDifference, |
const ComputedStyle& new_style); |
+ class TemporaryStyleScope { |
+ WTF_MAKE_NONCOPYABLE(TemporaryStyleScope); |
+ STACK_ALLOCATED(); |
+ |
+ public: |
+ TemporaryStyleScope(LayoutObject&, |
+ const ComputedStyle& original_style, |
+ const ComputedStyle& temporary_style); |
+ ~TemporaryStyleScope() { SwitchTo(original_style_); } |
+ |
+ private: |
+ void SwitchTo(const ComputedStyle&); |
+ |
+ LayoutObject& layout_object_; |
+ const ComputedStyle& original_style_; |
+ const bool styles_are_equal_; |
+ }; |
+ |
private: |
void AddResourcesFromLayoutObject(LayoutObject*, const ComputedStyle&); |
void RemoveResourcesFromLayoutObject(LayoutObject*); |