Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(520)

Unified Diff: third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.cpp

Issue 2375043002: Fix up that no render SVG shape when change clip-path to visible after hidden. (Closed)
Patch Set: rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698