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

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

Issue 1901673003: Improve default value handling for SVGSVGElement.width/height (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move to parseAttribute Created 4 years, 8 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 if (setListener) 187 if (setListener)
188 return; 188 return;
189 } 189 }
190 190
191 if (name == HTMLNames::onabortAttr) { 191 if (name == HTMLNames::onabortAttr) {
192 document().setWindowAttributeEventListener(EventTypeNames::abort, create AttributeEventListener(document().frame(), name, value, eventParameterName())); 192 document().setWindowAttributeEventListener(EventTypeNames::abort, create AttributeEventListener(document().frame(), name, value, eventParameterName()));
193 } else if (name == HTMLNames::onerrorAttr) { 193 } else if (name == HTMLNames::onerrorAttr) {
194 document().setWindowAttributeEventListener(EventTypeNames::error, create AttributeEventListener(document().frame(), name, value, eventParameterName())); 194 document().setWindowAttributeEventListener(EventTypeNames::error, create AttributeEventListener(document().frame(), name, value, eventParameterName()));
195 } else if (SVGZoomAndPan::parseAttribute(name, value)) { 195 } else if (SVGZoomAndPan::parseAttribute(name, value)) {
196 } else if (name == SVGNames::widthAttr || name == SVGNames::heightAttr) {
197 SVGAnimatedLength* property = name == SVGNames::widthAttr ? m_width : m_ height;
198 SVGParsingError parseError;
199 if (!value.isNull())
200 parseError = property->setBaseValueAsString(value);
201 if (parseError != SVGParseStatus::NoError || value.isNull())
202 property->setDefaultValueAsString("100%");
203 reportAttributeParsingError(parseError, name, value);
196 } else { 204 } else {
197 SVGElement::parseAttribute(name, oldValue, value); 205 SVGElement::parseAttribute(name, oldValue, value);
198 } 206 }
199 } 207 }
200 208
201 bool SVGSVGElement::isPresentationAttribute(const QualifiedName& name) const 209 bool SVGSVGElement::isPresentationAttribute(const QualifiedName& name) const
202 { 210 {
203 if (isOutermostSVGSVGElement() && (name == SVGNames::widthAttr || name == SV GNames::heightAttr)) 211 if (isOutermostSVGSVGElement() && (name == SVGNames::widthAttr || name == SV GNames::heightAttr))
204 return true; 212 return true;
205 else if (name == SVGNames::xAttr || name == SVGNames::yAttr) 213 else if (name == SVGNames::xAttr || name == SVGNames::yAttr)
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 visitor->trace(m_width); 739 visitor->trace(m_width);
732 visitor->trace(m_height); 740 visitor->trace(m_height);
733 visitor->trace(m_translation); 741 visitor->trace(m_translation);
734 visitor->trace(m_timeContainer); 742 visitor->trace(m_timeContainer);
735 visitor->trace(m_viewSpec); 743 visitor->trace(m_viewSpec);
736 SVGGraphicsElement::trace(visitor); 744 SVGGraphicsElement::trace(visitor);
737 SVGFitToViewBox::trace(visitor); 745 SVGFitToViewBox::trace(visitor);
738 } 746 }
739 747
740 } // namespace blink 748 } // 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