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..3c6de37ca65400be5e6b919056bb2dbb3ffee249 100644 |
| --- a/third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.cpp |
| +++ b/third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.cpp |
| @@ -20,6 +20,7 @@ |
| #include "core/layout/svg/SVGResourcesCache.h" |
| #include "core/HTMLNames.h" |
| +#include "core/dom/ElementTraversal.h" |
| #include "core/layout/svg/LayoutSVGResourceContainer.h" |
| #include "core/layout/svg/SVGResources.h" |
| #include "core/layout/svg/SVGResourcesCycleSolver.h" |
| @@ -117,6 +118,26 @@ void SVGResourcesCache::clientStyleChanged(LayoutObject* layoutObject, |
| if (layoutObject->isSVGResourceFilterPrimitive() && !diff.needsLayout()) |
| return; |
| + LayoutObject* current = layoutObject->parent(); |
| + while (current) { |
| + if (current->isSVGResourceContainer()) { |
| + if (newStyle.visibility() == EVisibility::kVisible) { |
| + LayoutSVGResourceContainer* container = |
| + toLayoutSVGResourceContainer(current); |
| + for (auto client : container->clients()) { |
| + if (client) { |
| + LayoutRect boundingBox = client->visualRect(); |
| + if (client->style()->visibility() == EVisibility::Visible && |
| + !boundingBox.width() && !boundingBox.height()) |
| + LayoutSVGResourceContainer::markForLayoutAndParentResourceInvalidation(client, true); |
|
fs
2017/01/16 10:03:10
Why isn't this handled by the call to markForLayou
|
| + } |
| + } |
| + } |
| + break; |
| + } |
| + current = current->parent(); |
| + } |
| + |
| // Dynamic changes of CSS properties like 'clip-path' may require us to |
| // recompute the associated resources for a LayoutObject. |
| // TODO(fs): Avoid passing in a useless StyleDifference, but instead compare |