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

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: Fix up that no render SVG shape when change clip-path to visible after hidden. Created 3 years, 9 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/LayoutTests/svg/clip-path/clip-path-visible-element-as-visible-shape-element-expected.html ('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 60408d1260a700f5abf3a978392be07a101a808b..3a0bd64a3d3ee20b4d7f012245a70cca3b65c357 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,14 @@ void SVGResourcesCache::clientStyleChanged(LayoutObject* layoutObject,
cache.addResourcesFromLayoutObject(layoutObject, newStyle);
}
+ // If this layoutObject is the child of ResourceContainer and it require
+ // repainting that changes of CSS properties such as 'visibility',
+ // request repainting.
+ bool needsLayout = diff.needsFullPaintInvalidation() &&
+ isLayoutObjectOfResourceContainer(layoutObject);
+
LayoutSVGResourceContainer::markForLayoutAndParentResourceInvalidation(
- layoutObject, false);
+ layoutObject, needsLayout);
}
void SVGResourcesCache::clientWasAddedToTree(LayoutObject* layoutObject,
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/clip-path/clip-path-visible-element-as-visible-shape-element-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698