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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGElement.cpp

Issue 2685113002: Cleanup SVGElement::layoutObjectIsNeeded. (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann
3 * <zimmermann@kde.org> 3 * <zimmermann@kde.org>
4 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> 4 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org>
5 * Copyright (C) 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2008 Apple Inc. All rights reserved.
6 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 6 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
7 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> 7 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 const ComputedStyle* style = nullptr; 1019 const ComputedStyle* style = nullptr;
1020 if (Element* parent = parentOrShadowHostElement()) { 1020 if (Element* parent = parentOrShadowHostElement()) {
1021 if (LayoutObject* layoutObject = parent->layoutObject()) 1021 if (LayoutObject* layoutObject = parent->layoutObject())
1022 style = layoutObject->style(); 1022 style = layoutObject->style();
1023 } 1023 }
1024 1024
1025 return document().ensureStyleResolver().styleForElement( 1025 return document().ensureStyleResolver().styleForElement(
1026 correspondingElement(), style, DisallowStyleSharing); 1026 correspondingElement(), style, DisallowStyleSharing);
1027 } 1027 }
1028 1028
1029 bool SVGElement::layoutObjectIsNeeded(const ComputedStyle& style) {
1030 // SVG elements only render when inside <svg>, or if the element is an <svg>
1031 // itself.
1032 if (!isSVGSVGElement(*this) &&
1033 (!parentOrShadowHostElement() ||
1034 !parentOrShadowHostElement()->isSVGElement())) {
rune 2017/02/09 18:09:28 Shouldn't this have been the flat tree parent? Alt
1035 return false;
1036 }
1037
1038 if (!isValid())
1039 return false;
1040
1041 return Element::layoutObjectIsNeeded(style);
1042 }
1043
1029 MutableStylePropertySet* SVGElement::animatedSMILStyleProperties() const { 1044 MutableStylePropertySet* SVGElement::animatedSMILStyleProperties() const {
1030 if (hasSVGRareData()) 1045 if (hasSVGRareData())
1031 return svgRareData()->animatedSMILStyleProperties(); 1046 return svgRareData()->animatedSMILStyleProperties();
1032 return nullptr; 1047 return nullptr;
1033 } 1048 }
1034 1049
1035 MutableStylePropertySet* SVGElement::ensureAnimatedSMILStyleProperties() { 1050 MutableStylePropertySet* SVGElement::ensureAnimatedSMILStyleProperties() {
1036 return ensureSVGRareData()->ensureAnimatedSMILStyleProperties(); 1051 return ensureSVGRareData()->ensureAnimatedSMILStyleProperties();
1037 } 1052 }
1038 1053
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 visitor->trace(m_className); 1304 visitor->trace(m_className);
1290 Element::trace(visitor); 1305 Element::trace(visitor);
1291 } 1306 }
1292 1307
1293 const AtomicString& SVGElement::eventParameterName() { 1308 const AtomicString& SVGElement::eventParameterName() {
1294 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt")); 1309 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt"));
1295 return evtString; 1310 return evtString;
1296 } 1311 }
1297 1312
1298 } // namespace blink 1313 } // namespace blink
OLDNEW
« 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