Changeset 57473 in webkit
- Timestamp:
- Apr 12, 2010 8:49:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r57465 r57473 1 2010-04-12 Jeff Schiller <codedread@gmail.com> 2 3 Reviewed by Dirk Schulze. 4 5 Add tests to handle that comma/whitespace around arc flags are optional 6 and that arc flags can only be 0 or 1 in SVG path syntax: 7 https://bugs.webkit.org/show_bug.cgi?id=37431 8 9 * svg/dom/fuzz-path-parser-expected.txt: One test now fails due to flags not 0 or 1 10 * svg/dom/path-parser-expected.txt: Add test results for missing whitespace and flags not 0 or 1 11 * svg/dom/script-tests/path-parser.js: Add 6 tests to check that whitespace is optional after flags and flags must be 0 or 1 12 1 13 2010-04-11 Tony Chang <tony@chromium.org> 2 14 -
trunk/LayoutTests/svg/dom/fuzz-path-parser-expected.txt
r39819 r57473 4 4 CONSOLE MESSAGE: line 97: Error: Problem parsing d="M1,1s6 3,8,h9 q5,5 1 4,4,h0 T5 t3,6 s8 5 8 2 zS0 7,7,s6,3,1," 5 5 CONSOLE MESSAGE: line 97: Error: Problem parsing d="M1,1t4 4 l6 6 a4 2,3,0,1,2 1,Q1,1,0,3,H8 C7,9 8 4,0 t5,2,H9,zHq1 5,9,T6 8," 6 CONSOLE MESSAGE: line 97: Error: Problem parsing d="M1,1t1 0 Zc3,8,8 7 3,4 zzQ5,3 4,4 H0 v8,v1,C0,1,6,2,5,4 q2 7 5 3 a7,4 7 9,7,2 9,ZL6 6," 6 7 CONSOLE MESSAGE: line 97: Error: Problem parsing d="M1,1L5,9,t3 7 Q6 1 1,1 T3,0 s4 6 8 1,s8 3,8 9,a5 4 3 2,4,2 3,6 " 7 8 CONSOLE MESSAGE: line 97: Error: Problem parsing d="M1,1a9,2 6 1 2 2 2,za9 0 2 8,2,3,3 s5,8,8 1,HC5 8 5,8,4 2 c8 4 5 2 5 9,l3 9,H7 s6 2,0 0 a4 9,1 6,3,7,0,M6," … … 213 214 Could not parse: M1,1t4 4 l6 6 a4 2,3,0,1,2 1,Q1,1,0,3,H8 C7,9 8 4,0 t5,2,H9,zHq1 5,9,T6 8, 214 215 Parsed as 1 command(s) [M]: M1,1 215 Parsed as 16 command(s) [MCZCZZCLLLCCCCZL]: M1,1t1 0 Zc3,8,8 7 3,4 zzQ5,3 4,4 H0 v8,v1,C0,1,6,2,5,4 q2 7 5 3 a7,4 7 9,7,2 9,ZL6 6,216 Could not parse: M1,1t1 0 Zc3,8,8 7 3,4 zzQ5,3 4,4 H0 v8,v1,C0,1,6,2,5,4 q2 7 5 3 a7,4 7 9,7,2 9,ZL6 6, 216 217 Could not parse: M1,1L5,9,t3 7 Q6 1 1,1 T3,0 s4 6 8 1,s8 3,8 9,a5 4 3 2,4,2 3,6 217 218 Parsed as 6 command(s) [MCLLCC]: M1,1t8 9,l3 5 l9,5 s6,9,2 9,T1 9 -
trunk/LayoutTests/svg/dom/path-parser-expected.txt
r48393 r57473 1 CONSOLE MESSAGE: line 9: Error: Problem parsing d="M100,200 a3,4,5,2,1,6,7" 2 CONSOLE MESSAGE: line 9: Error: Problem parsing d="M100,200 a3,4,5,1,2,6,7" 1 3 CONSOLE MESSAGE: line 9: Error: Problem parsing d=" 2 4 M1,2" … … 40 42 PASS parsePath('M100,200 a3,4,5,1,0,6,7') is 'M100,200 C98.5,202.3,98.6,205.7,100.2,207.7 C101.9,209.6,104.5,209.3,106,207' 41 43 PASS parsePath('M100,200 a3,4,5,1,1,6,7') is 'M100,200 C101.5,197.7,104.1,197.4,105.8,199.3 C107.4,201.3,107.5,204.7,106,207' 44 PASS parsePath('M100,200 a3,4,5,006,7') is 'M100,200 C98.5,202.3,98.6,205.7,100.2,207.7 C101.9,209.6,104.5,209.3,106,207' 45 PASS parsePath('M100,200 a3,4,5,016,7') is 'M100,200 C101.5,197.7,104.1,197.4,105.8,199.3 C107.4,201.3,107.5,204.7,106,207' 46 PASS parsePath('M100,200 a3,4,5,106,7') is 'M100,200 C98.5,202.3,98.6,205.7,100.2,207.7 C101.9,209.6,104.5,209.3,106,207' 47 PASS parsePath('M100,200 a3,4,5,116,7') is 'M100,200 C101.5,197.7,104.1,197.4,105.8,199.3 C107.4,201.3,107.5,204.7,106,207' 48 PASS parsePath('M100,200 a3,4,5,2,1,6,7') is '' 49 PASS parsePath('M100,200 a3,4,5,1,2,6,7') is '' 42 50 PASS parsePath('M1,2,3,4') is 'M1,2 L3,4' 43 51 PASS parsePath('m100,200,3,4') is 'M100,200 L103,204' -
trunk/LayoutTests/svg/dom/script-tests/path-parser.js
r48554 r57473 84 84 shouldBe("parsePath('M100,200 a3,4,5,1,0,6,7')", "'M100,200 C98.5,202.3,98.6,205.7,100.2,207.7 C101.9,209.6,104.5,209.3,106,207'"); 85 85 shouldBe("parsePath('M100,200 a3,4,5,1,1,6,7')", "'M100,200 C101.5,197.7,104.1,197.4,105.8,199.3 C107.4,201.3,107.5,204.7,106,207'"); 86 shouldBe("parsePath('M100,200 a3,4,5,006,7')", "'M100,200 C98.5,202.3,98.6,205.7,100.2,207.7 C101.9,209.6,104.5,209.3,106,207'"); 87 shouldBe("parsePath('M100,200 a3,4,5,016,7')", "'M100,200 C101.5,197.7,104.1,197.4,105.8,199.3 C107.4,201.3,107.5,204.7,106,207'"); 88 shouldBe("parsePath('M100,200 a3,4,5,106,7')", "'M100,200 C98.5,202.3,98.6,205.7,100.2,207.7 C101.9,209.6,104.5,209.3,106,207'"); 89 shouldBe("parsePath('M100,200 a3,4,5,116,7')", "'M100,200 C101.5,197.7,104.1,197.4,105.8,199.3 C107.4,201.3,107.5,204.7,106,207'"); 90 shouldBe("parsePath('M100,200 a3,4,5,2,1,6,7')", "''"); 91 shouldBe("parsePath('M100,200 a3,4,5,1,2,6,7')", "''"); 86 92 87 93 shouldBe("parsePath('M1,2,3,4')", "'M1,2 L3,4'"); -
trunk/WebCore/ChangeLog
r57469 r57473 1 2010-04-12 Jeff Schiller <codedread@gmail.com> 2 3 Reviewed by Dirk Schulze. 4 5 Make comma/whitespace around arc flags optional in SVG path syntax and ensure flags are 6 either 0 or 1: https://bugs.webkit.org/show_bug.cgi?id=37431 7 8 * svg/SVGParserUtilities.cpp: 9 (WebCore::parseArcFlag): function to read in a 0 or 1 for largeArcFlag and sweepFlag 10 (WebCore::SVGPathParser::parseSVG): modify/simplify arc parsing by using parseArcFlag() 11 1 12 2010-04-11 Sheriff Bot <webkit.review.bot@gmail.com> 2 13 -
trunk/WebCore/svg/SVGParserUtilities.cpp
r48393 r57473 141 141 } 142 142 143 // only used to parse largeArcFlag and sweepFlag which must be a "0" or "1" 144 // and might not have any whitespace/comma after it 145 bool parseArcFlag(const UChar*& ptr, const UChar* end, bool& flag) 146 { 147 const UChar flagChar = *ptr++; 148 if (flagChar == '0') 149 flag = false; 150 else if (flagChar == '1') 151 flag = true; 152 else 153 return false; 154 155 skipOptionalSpacesOrDelimiter(ptr, end); 156 157 return true; 158 } 159 143 160 bool parseNumberOptionalNumber(const String& s, float& x, float& y) 144 161 { … … 479 496 bool largeArc, sweep; 480 497 double angle, rx, ry; 481 if (!parseNumber(ptr, end, rx) || !parseNumber(ptr, end, ry) || 482 !parseNumber(ptr, end, angle) || !parseNumber(ptr, end, tox)) 483 return false; 484 largeArc = tox == 1; 485 if (!parseNumber(ptr, end, tox)) 486 return false; 487 sweep = tox == 1; 488 if (!parseNumber(ptr, end, tox) || !parseNumber(ptr, end, toy)) 498 if (!parseNumber(ptr, end, rx) || !parseNumber(ptr, end, ry) 499 || !parseNumber(ptr, end, angle) 500 || !parseArcFlag(ptr, end, largeArc) || !parseArcFlag(ptr, end, sweep) 501 || !parseNumber(ptr, end, tox) || !parseNumber(ptr, end, toy)) 489 502 return false; 490 503
Note: See TracChangeset
for help on using the changeset viewer.