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

Unified Diff: third_party/WebKit/Source/core/svg/SVGElement.cpp

Issue 2685113002: Cleanup SVGElement::layoutObjectIsNeeded. (Closed)
Patch Set: Preserving behavior 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/Source/core/svg/SVGElement.h ('k') | third_party/WebKit/Source/core/svg/SVGGElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/svg/SVGElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGElement.cpp
index 88b13cabd79b091f5a2cf4d69f8c1e4987973a16..961d67e3d0c115786343754399437aa026e4dc1b 100644
--- a/third_party/WebKit/Source/core/svg/SVGElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGElement.cpp
@@ -1026,6 +1026,21 @@ PassRefPtr<ComputedStyle> SVGElement::customStyleForLayoutObject() {
correspondingElement(), style, DisallowStyleSharing);
}
+bool SVGElement::layoutObjectIsNeeded(const ComputedStyle& style) {
+ // SVG elements only render when inside <svg>, or if the element is an <svg>
+ // itself.
+ if (!isSVGSVGElement(*this)) {
+ ContainerNode* parent = FlatTreeTraversal::parent(*this);
+ if (!parent || !parent->isSVGElement())
+ return false;
+ }
+
+ if (!isValid())
+ return false;
+
+ return Element::layoutObjectIsNeeded(style);
+}
+
MutableStylePropertySet* SVGElement::animatedSMILStyleProperties() const {
if (hasSVGRareData())
return svgRareData()->animatedSMILStyleProperties();
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGElement.h ('k') | third_party/WebKit/Source/core/svg/SVGGElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698