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

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

Issue 933663002: Make use of new method for setting lengths in presentation style. (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 | « no previous file | Source/core/svg/SVGImageElement.cpp » ('j') | Source/core/svg/SVGSVGElement.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGForeignObjectElement.cpp
diff --git a/Source/core/svg/SVGForeignObjectElement.cpp b/Source/core/svg/SVGForeignObjectElement.cpp
index a549ff8327d17e5dc0e13b08801148a210d6f8cc..21dc887e93c12e5dbe01e6cad51eb529a3b5a3ee 100644
--- a/Source/core/svg/SVGForeignObjectElement.cpp
+++ b/Source/core/svg/SVGForeignObjectElement.cpp
@@ -91,23 +91,16 @@ bool SVGForeignObjectElement::isPresentationAttributeWithSVGDOM(const QualifiedN
void SVGForeignObjectElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style)
{
RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> property = propertyFromAttribute(name);
- if (property == m_width || property == m_height) {
- RefPtrWillBeRawPtr<SVGLength> length = SVGLength::create(LengthModeOther);
- TrackExceptionState exceptionState;
- length->setValueAsString(value, exceptionState);
- if (!exceptionState.hadException()) {
- if (property == m_width)
- addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, value);
- else if (property == m_height)
- addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, value);
- }
- } else if (property == m_x) {
+ if (property == m_width)
+ addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, *m_width->currentValue());
+ else if (property == m_height)
+ addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, *m_height->currentValue());
+ else if (property == m_x)
addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyX, *m_x->currentValue());
- } else if (property == m_y) {
+ else if (property == m_y)
addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyY, *m_y->currentValue());
- } else {
+ else
SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, style);
- }
}
void SVGForeignObjectElement::svgAttributeChanged(const QualifiedName& attrName)
« no previous file with comments | « no previous file | Source/core/svg/SVGImageElement.cpp » ('j') | Source/core/svg/SVGSVGElement.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698