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

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: Remove the old resource 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/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/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..a79b0ef368db447b2cc6859ef204190305a64d2f 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp
@@ -85,6 +85,28 @@ void LayoutSVGResourceContainer::styleDidChange(StyleDifference diff,
const ComputedStyle* oldStyle) {
LayoutSVGHiddenContainer::styleDidChange(diff, oldStyle);
+ for (auto* client : m_clients) {
+ // Check whether delete the old resource or not for client that is NoChange.
+ // If ResourceContainer is visible, client is visible, width and height
+ // are '0', the old cache should be removed and set pending resource.
+ LayoutRect boundingBox = client->visualRect();
+ if (style()->visibility() == EVisibility::Visible &&
fs 2017/01/05 17:01:47 I think this may be starting to approach the right
+ client->style()->visibility() == EVisibility::Visible &&
+ !boundingBox.width() && !boundingBox.height())
+ {
+ SVGResources* resources =
+ SVGResourcesCache::cachedResourcesForLayoutObject(client);
+ if (resources) {
+ // Remove the old resource.
fs 2017/01/05 17:01:47 This looks too heavy-handed, if you wanted to inva
+ resources->resourceDestroyed(this);
+ Element* clientElement = toElement(client->node());
+ svgExtensionsFromElement(clientElement)
+ .addPendingResource(m_id, clientElement);
+ m_registered = false;
+ }
+ }
+ }
+
if (!m_registered) {
m_registered = true;
registerResource();
« 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