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

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

Issue 1413953002: Add unit test for SVG path parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Drop line-wrap. Created 5 years, 2 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/Source/core/svg/SVGPathStringSource.h ('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) Research In Motion Limited 2010. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 14 matching lines...) Expand all
25 #include "platform/geometry/FloatPoint.h" 25 #include "platform/geometry/FloatPoint.h"
26 26
27 namespace blink { 27 namespace blink {
28 28
29 SVGPathStringSource::SVGPathStringSource(const String& string) 29 SVGPathStringSource::SVGPathStringSource(const String& string)
30 : m_string(string) 30 : m_string(string)
31 , m_is8BitSource(string.is8Bit()) 31 , m_is8BitSource(string.is8Bit())
32 , m_seenError(false) 32 , m_seenError(false)
33 , m_previousCommand(PathSegUnknown) 33 , m_previousCommand(PathSegUnknown)
34 { 34 {
35 ASSERT(!string.isEmpty()); 35 ASSERT(!string.isNull());
36 36
37 if (m_is8BitSource) { 37 if (m_is8BitSource) {
38 m_current.m_character8 = string.characters8(); 38 m_current.m_character8 = string.characters8();
39 m_end.m_character8 = m_current.m_character8 + string.length(); 39 m_end.m_character8 = m_current.m_character8 + string.length();
40 } else { 40 } else {
41 m_current.m_character16 = string.characters16(); 41 m_current.m_character16 = string.characters16();
42 m_end.m_character16 = m_current.m_character16 + string.length(); 42 m_end.m_character16 = m_current.m_character16 + string.length();
43 } 43 }
44 eatWhitespace(); 44 eatWhitespace();
45 } 45 }
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 case PathSegUnknown: 228 case PathSegUnknown:
229 ASSERT_NOT_REACHED(); 229 ASSERT_NOT_REACHED();
230 } 230 }
231 231
232 if (UNLIKELY(m_seenError)) 232 if (UNLIKELY(m_seenError))
233 segment.command = PathSegUnknown; 233 segment.command = PathSegUnknown;
234 return segment; 234 return segment;
235 } 235 }
236 236
237 } // namespace blink 237 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGPathStringSource.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698