Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp |
| index 6bfb64b4d40e99dad8fb6f6fbf6be7633253c801..efb188698aff89de5663f265f56f1dc02e7430a7 100644 |
| --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp |
| +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp |
| @@ -316,4 +316,43 @@ void LayoutSVGResourceContainer::markForLayoutAndParentResourceInvalidation( |
| } |
| } |
| +void LayoutSVGResourceContainer::markForLayoutAndParentResourceInvalidation( |
|
fs
2017/02/06 10:17:35
The way this is written it doesn't need to duplica
|
| + LayoutObject* object, |
| + StyleDifference diff) { |
| + DCHECK(object); |
| + DCHECK(object->node()); |
| + |
| + bool needsLayout = false; |
| + |
| + LayoutObject* current = object; |
| + while (current) { |
| + if (current->isSVGResourceContainer()) { |
| + needsLayout = diff.needsPaintInvalidation(); |
| + break; |
| + } |
| + current = current->parent(); |
| + } |
| + |
| + if (needsLayout && !object->documentBeingDestroyed()) { |
| + object->setNeedsLayoutAndFullPaintInvalidation( |
| + LayoutInvalidationReason::SvgResourceInvalidated); |
| + } |
| + |
| + removeFromCacheAndInvalidateDependencies(object, needsLayout); |
| + |
| + // Invalidate resources in ancestor chain, if needed. |
| + current = object->parent(); |
| + while (current) { |
| + removeFromCacheAndInvalidateDependencies(current, needsLayout); |
| + |
| + if (current->isSVGResourceContainer()) { |
| + // This will process the rest of the ancestors. |
| + toLayoutSVGResourceContainer(current)->removeAllClientsFromCache(); |
| + break; |
| + } |
| + |
| + current = current->parent(); |
| + } |
| +} |
| + |
| } // namespace blink |