Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 263 { | 263 { |
| 264 if (isOutermostSVGSVGElement() && (name == SVGNames::widthAttr || name == SV GNames::heightAttr)) | 264 if (isOutermostSVGSVGElement() && (name == SVGNames::widthAttr || name == SV GNames::heightAttr)) |
| 265 return true; | 265 return true; |
| 266 return SVGGraphicsElement::isPresentationAttribute(name); | 266 return SVGGraphicsElement::isPresentationAttribute(name); |
| 267 } | 267 } |
| 268 | 268 |
| 269 void SVGSVGElement::collectStyleForPresentationAttribute(const QualifiedName& na me, const AtomicString& value, MutableStylePropertySet* style) | 269 void SVGSVGElement::collectStyleForPresentationAttribute(const QualifiedName& na me, const AtomicString& value, MutableStylePropertySet* style) |
| 270 { | 270 { |
| 271 if (isOutermostSVGSVGElement() && (name == SVGNames::widthAttr || name == SV GNames::heightAttr)) { | 271 if (isOutermostSVGSVGElement() && (name == SVGNames::widthAttr || name == SV GNames::heightAttr)) { |
| 272 RefPtr<SVGLength> length = SVGLength::create(LengthModeOther); | 272 RefPtr<SVGLength> length = SVGLength::create(LengthModeOther); |
| 273 length->setValueAsString(value, IGNORE_EXCEPTION); | 273 TrackExceptionState exceptionState; |
| 274 if (length->unitType() != LengthTypeUnknown) { | 274 length->setValueAsString(value, exceptionState); |
| 275 if (!exceptionState.hadException()) { | |
|
rwlbuis
2014/05/05 18:15:51
Is the exception actually thrown/printed? If not s
davve
2014/05/06 07:05:19
It's already printed when the attribute is parsed,
| |
| 275 if (name == SVGNames::widthAttr) | 276 if (name == SVGNames::widthAttr) |
| 276 addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, value); | 277 addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, value); |
| 277 else if (name == SVGNames::heightAttr) | 278 else if (name == SVGNames::heightAttr) |
| 278 addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight , value); | 279 addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight , value); |
| 279 } | 280 } |
| 280 } else { | 281 } else { |
| 281 SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, st yle); | 282 SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, st yle); |
| 282 } | 283 } |
| 283 } | 284 } |
| 284 | 285 |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 764 view->preserveAspectRatio()->baseValue()->setMeetOrSlice(preserveAspectR atio()->currentValue()->meetOrSlice()); | 765 view->preserveAspectRatio()->baseValue()->setMeetOrSlice(preserveAspectR atio()->currentValue()->meetOrSlice()); |
| 765 } | 766 } |
| 766 | 767 |
| 767 if (viewElement->hasAttribute(SVGNames::zoomAndPanAttr)) | 768 if (viewElement->hasAttribute(SVGNames::zoomAndPanAttr)) |
| 768 view->setZoomAndPan(viewElement->zoomAndPan()); | 769 view->setZoomAndPan(viewElement->zoomAndPan()); |
| 769 else | 770 else |
| 770 view->setZoomAndPan(zoomAndPan()); | 771 view->setZoomAndPan(zoomAndPan()); |
| 771 } | 772 } |
| 772 | 773 |
| 773 } | 774 } |
| OLD | NEW |