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

Unified Diff: Source/core/svg/SVGSVGElement.cpp

Issue 898873002: CL for perf tryjob (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 | « Source/core/svg/SVGRectElement.cpp ('k') | Source/core/svg/SVGUseElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGSVGElement.cpp
diff --git a/Source/core/svg/SVGSVGElement.cpp b/Source/core/svg/SVGSVGElement.cpp
index b7a0cede99bb43d915b8b90896b1e7701ae070e7..de723e86e85badcfcd2f131c42a4f46fe9e85e1b 100644
--- a/Source/core/svg/SVGSVGElement.cpp
+++ b/Source/core/svg/SVGSVGElement.cpp
@@ -243,19 +243,27 @@ bool SVGSVGElement::isPresentationAttribute(const QualifiedName& name) const
{
if (isOutermostSVGSVGElement() && (name == SVGNames::widthAttr || name == SVGNames::heightAttr))
return true;
+ else if (name == SVGNames::xAttr || name == SVGNames::yAttr)
+ return true;
+
return SVGGraphicsElement::isPresentationAttribute(name);
}
void SVGSVGElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style)
{
- if (isOutermostSVGSVGElement() && (name == SVGNames::widthAttr || name == SVGNames::heightAttr)) {
+ RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> property = propertyFromAttribute(name);
+ if (property == m_x) {
+ addPropertyToPresentationAttributeStyle(style, CSSPropertyX, m_x->currentValue()->valueInSpecifiedUnits(), m_x->currentValue()->cssUnitTypeQuirk());
+ } else if (property == m_y) {
+ addPropertyToPresentationAttributeStyle(style, CSSPropertyY, m_y->currentValue()->valueInSpecifiedUnits(), m_y->currentValue()->cssUnitTypeQuirk());
+ } else if (isOutermostSVGSVGElement() && (property == m_width || property == m_height)) {
RefPtrWillBeRawPtr<SVGLength> length = SVGLength::create(LengthModeOther);
TrackExceptionState exceptionState;
length->setValueAsString(value, exceptionState);
if (!exceptionState.hadException()) {
- if (name == SVGNames::widthAttr)
+ if (property == m_width)
addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, value);
- else if (name == SVGNames::heightAttr)
+ else if (property == m_height)
addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, value);
}
} else {
@@ -288,6 +296,10 @@ void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName)
invalidateSVGPresentationAttributeStyle();
setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::SVGContainerSizeChange));
}
+ } else {
+ invalidateSVGPresentationAttributeStyle();
+ setNeedsStyleRecalc(LocalStyleChange,
+ StyleChangeReasonForTracing::fromAttribute(attrName));
}
}
« no previous file with comments | « Source/core/svg/SVGRectElement.cpp ('k') | Source/core/svg/SVGUseElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698