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

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

Issue 2375043002: Fix up that no render SVG shape when change clip-path to visible after hidden. (Closed)
Patch Set: Fix up that no render SVG shape when change clip-path to visible after hidden. 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
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

Powered by Google App Engine
This is Rietveld 408576698