Changeset 57140 in webkit
- Timestamp:
- Apr 6, 2010 3:37:25 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r57136 r57140 1 2010-04-06 Dirk Schulze <krit@webkit.org> 2 3 Reviewed by Oliver Hunt. 4 5 SVG/SMIL parse failure on attribute keySplines 6 https://bugs.webkit.org/show_bug.cgi?id=37071 7 8 Test correct parsing of keySplines. 9 10 * svg/animations/animate-keySplines-expected.txt: Added. 11 * svg/animations/animate-keySplines.html: Added. 12 * svg/animations/script-tests/animate-keySplines.js: Added. 13 (sample1): 14 (sample2): 15 (sample3): 16 (executeTest): 17 1 18 2010-04-06 Pavel Feldman <pfeldman@chromium.org> 2 19 -
trunk/WebCore/ChangeLog
r57134 r57140 1 2010-04-06 Dirk Schulze <krit@webkit.org> 2 3 Reviewed by Oliver Hunt. 4 5 SVG/SMIL parse failure on attribute keySplines 6 https://bugs.webkit.org/show_bug.cgi?id=37071 7 8 Test: svg/animations/animate-keySplines.html 9 10 The String in 'keySplines' can have multiple spaces between numbers 11 and delimiters. The parsing code is inspired by SVGParserUtilities 12 and respects this. 13 14 * svg/SVGAnimationElement.cpp: 15 (WebCore::parseKeySplines): 16 1 17 2010-04-06 Yury Semikhatsky <yurys@chromium.org> 2 18 -
trunk/WebCore/svg/SVGAnimationElement.cpp
r56775 r57140 5 5 Copyright (C) 2008 Apple Inc. All rights reserved. 6 6 Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> 7 Copyright (C) Research In Motion Limited 2010. All rights reserved. 7 8 8 9 This library is free software; you can redistribute it and/or … … 37 38 #include "HTMLNames.h" 38 39 #include "MappedAttribute.h" 40 #include "PlatformString.h" 39 41 #include "RenderObject.h" 40 42 #include "SVGElementInstance.h" 41 43 #include "SVGNames.h" 44 #include "SVGParserUtilities.h" 42 45 #include "SVGURIReference.h" 43 46 #include "SVGUseElement.h" … … 90 93 { 91 94 result.clear(); 92 Vector<String> parseList; 93 parse.split(';', parseList); 94 for (unsigned n = 0; n < parseList.size(); ++n) { 95 Vector<String> parseSpline; 96 parseList[n].split(',', parseSpline); 97 // The spec says the sepator is a space, all tests use commas. Weird. 98 if (parseSpline.size() == 1) 99 parseList[n].split(' ', parseSpline); 100 if (parseSpline.size() != 4) 101 goto fail; 102 double curveValues[4]; 103 for (unsigned i = 0; i < 4; ++i) { 104 String parseNumber = parseSpline[i]; 105 bool ok; 106 curveValues[i] = parseNumber.toDouble(&ok); 107 if (!ok || curveValues[i] < 0.0 || curveValues[i] > 1.0) 108 goto fail; 109 } 110 result.append(UnitBezier(curveValues[0], curveValues[1], curveValues[2], curveValues[3])); 111 } 112 return; 113 fail: 114 result.clear(); 95 if (parse.isEmpty()) 96 return; 97 const UChar* cur = parse.characters(); 98 const UChar* end = cur + parse.length(); 99 100 skipOptionalSpaces(cur, end); 101 102 bool delimParsed = false; 103 while (cur < end) { 104 delimParsed = false; 105 float posA = 0.0f; 106 if (!parseNumber(cur, end, posA)) { 107 result.clear(); 108 return; 109 } 110 111 float posB = 0.0f; 112 if (!parseNumber(cur, end, posB)) { 113 result.clear(); 114 return; 115 } 116 117 float posC = 0.0f; 118 if (!parseNumber(cur, end, posC)) { 119 result.clear(); 120 return; 121 } 122 123 float posD = 0.0f; 124 if (!parseNumber(cur, end, posD, false)) { 125 result.clear(); 126 return; 127 } 128 129 skipOptionalSpaces(cur, end); 130 131 if (cur < end && *cur == ';') { 132 delimParsed = true; 133 cur++; 134 } 135 skipOptionalSpaces(cur, end); 136 137 result.append(UnitBezier(posA, posB, posC, posD)); 138 } 139 if (!(cur == end && !delimParsed)) 140 result.clear(); 115 141 } 116 142
Note: See TracChangeset
for help on using the changeset viewer.