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

Unified Diff: Source/core/svg/SVGRectElement.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.h ('k') | Source/core/svg/SVGSVGElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGRectElement.cpp
diff --git a/Source/core/svg/SVGRectElement.cpp b/Source/core/svg/SVGRectElement.cpp
index 6ae42852ef31f367f695c155417e277b00861076..a065f71d6d688881731b84d6b1bf834870a1f574 100644
--- a/Source/core/svg/SVGRectElement.cpp
+++ b/Source/core/svg/SVGRectElement.cpp
@@ -75,6 +75,25 @@ void SVGRectElement::parseAttribute(const QualifiedName& name, const AtomicStrin
parseAttributeNew(name, value);
}
+bool SVGRectElement::isPresentationAttribute(const QualifiedName& attrName) const
+{
+ if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr)
+ return true;
+ return SVGGeometryElement::isPresentationAttribute(attrName);
+}
+
+void SVGRectElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style)
+{
+ 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 (!property) {
+ SVGGeometryElement::collectStyleForPresentationAttribute(name, value, style);
+ }
+}
+
void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName)
{
if (!isSupportedAttribute(attrName)) {
@@ -84,8 +103,16 @@ void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName)
SVGElement::InvalidationGuard invalidationGuard(this);
- bool isLengthAttribute = attrName == SVGNames::xAttr
- || attrName == SVGNames::yAttr
+ bool isLengthAttributeXY =
+ attrName == SVGNames::xAttr
+ || attrName == SVGNames::yAttr;
+ if (isLengthAttributeXY) {
+ invalidateSVGPresentationAttributeStyle();
+ setNeedsStyleRecalc(LocalStyleChange,
+ StyleChangeReasonForTracing::fromAttribute(attrName));
+ }
+
+ bool isLengthAttribute = isLengthAttributeXY
|| attrName == SVGNames::widthAttr
|| attrName == SVGNames::heightAttr
|| attrName == SVGNames::rxAttr
« no previous file with comments | « Source/core/svg/SVGRectElement.h ('k') | Source/core/svg/SVGSVGElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698