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

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

Issue 1918753002: Improve default value handling for SVGSVGElement.width/height (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/custom/disallow-non-lengths-in-attrs-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2007 Apple Inc. All rights reserved.
5 * Copyright (C) 2014 Google, Inc. 5 * Copyright (C) 2014 Google, Inc.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 198
199 if (setListener) 199 if (setListener)
200 return; 200 return;
201 } 201 }
202 202
203 if (name == HTMLNames::onabortAttr) { 203 if (name == HTMLNames::onabortAttr) {
204 document().setWindowAttributeEventListener(EventTypeNames::abort, create AttributeEventListener(document().frame(), name, value, eventParameterName())); 204 document().setWindowAttributeEventListener(EventTypeNames::abort, create AttributeEventListener(document().frame(), name, value, eventParameterName()));
205 } else if (name == HTMLNames::onerrorAttr) { 205 } else if (name == HTMLNames::onerrorAttr) {
206 document().setWindowAttributeEventListener(EventTypeNames::error, create AttributeEventListener(document().frame(), name, value, eventParameterName())); 206 document().setWindowAttributeEventListener(EventTypeNames::error, create AttributeEventListener(document().frame(), name, value, eventParameterName()));
207 } else if (SVGZoomAndPan::parseAttribute(name, value)) { 207 } else if (SVGZoomAndPan::parseAttribute(name, value)) {
208 } else if (name == SVGNames::widthAttr || name == SVGNames::heightAttr) {
209 SVGAnimatedLength* property = name == SVGNames::widthAttr ? m_width : m_ height;
210 SVGParsingError parseError;
211 if (!value.isNull())
212 parseError = property->setBaseValueAsString(value);
213 if (parseError != SVGParseStatus::NoError || value.isNull())
214 property->setDefaultValueAsString("100%");
215 reportAttributeParsingError(parseError, name, value);
208 } else { 216 } else {
209 SVGElement::parseAttribute(name, oldValue, value); 217 SVGElement::parseAttribute(name, oldValue, value);
210 } 218 }
211 } 219 }
212 220
213 bool SVGSVGElement::isPresentationAttribute(const QualifiedName& name) const 221 bool SVGSVGElement::isPresentationAttribute(const QualifiedName& name) const
214 { 222 {
215 if (isOutermostSVGSVGElement() && (name == SVGNames::widthAttr || name == SV GNames::heightAttr)) 223 if (isOutermostSVGSVGElement() && (name == SVGNames::widthAttr || name == SV GNames::heightAttr))
216 return true; 224 return true;
217 else if (name == SVGNames::xAttr || name == SVGNames::yAttr) 225 else if (name == SVGNames::xAttr || name == SVGNames::yAttr)
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 visitor->trace(m_width); 751 visitor->trace(m_width);
744 visitor->trace(m_height); 752 visitor->trace(m_height);
745 visitor->trace(m_translation); 753 visitor->trace(m_translation);
746 visitor->trace(m_timeContainer); 754 visitor->trace(m_timeContainer);
747 visitor->trace(m_viewSpec); 755 visitor->trace(m_viewSpec);
748 SVGGraphicsElement::trace(visitor); 756 SVGGraphicsElement::trace(visitor);
749 SVGFitToViewBox::trace(visitor); 757 SVGFitToViewBox::trace(visitor);
750 } 758 }
751 759
752 } // namespace blink 760 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/custom/disallow-non-lengths-in-attrs-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698