Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.cpp b/third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.cpp |
| index 5422c57f26f73dbef20bcc70007e23e968304288..55462d247fe2b8277fae2bf12ce21289221a5835 100644 |
| --- a/third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.cpp |
| +++ b/third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.cpp |
| @@ -101,6 +101,17 @@ static inline bool layoutObjectCanHaveResources(LayoutObject* layoutObject) { |
| !layoutObject->isSVGInlineText(); |
| } |
| +static inline bool isLayoutObjectOfResourceContainer(LayoutObject* layoutObject) { |
| + LayoutObject* current = layoutObject; |
| + while (current) { |
| + if (current->isSVGResourceContainer()) { |
| + return true; |
| + } |
| + current = current->parent(); |
| + } |
| + return false; |
| +} |
| + |
| void SVGResourcesCache::clientStyleChanged(LayoutObject* layoutObject, |
| StyleDifference diff, |
| const ComputedStyle& newStyle) { |
| @@ -128,8 +139,11 @@ void SVGResourcesCache::clientStyleChanged(LayoutObject* layoutObject, |
| cache.addResourcesFromLayoutObject(layoutObject, newStyle); |
| } |
| + bool needsLayout = diff.needsPaintInvalidation() && |
|
fs
2017/02/20 09:07:43
It would be good to add a comment here to describe
hyunjunekim2
2017/03/13 10:40:11
Done. Added a comment. Could you check it? Thank y
|
| + isLayoutObjectOfResourceContainer(layoutObject); |
| + |
| LayoutSVGResourceContainer::markForLayoutAndParentResourceInvalidation( |
| - layoutObject, false); |
| + layoutObject, needsLayout); |
| } |
| void SVGResourcesCache::clientWasAddedToTree(LayoutObject* layoutObject, |