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

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: Issue 590153 Created 3 years, 10 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 5422c57f26f73dbef20bcc70007e23e968304288..55462d247fe2b8277fae2bf12ce21289221a5835 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,11 @@ void SVGResourcesCache::clientStyleChanged(LayoutObject* layoutObject,
cache.addResourcesFromLayoutObject(layoutObject, newStyle);
}
+ bool needsLayout = diff.needsPaintInvalidation() &&
fs 2017/02/20 09:07:43 It would be good to add a comment here to describe
hyunjunekim2 2017/03/13 10:40:11 Done. Added a comment. Could you check it? Thank y
+ 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