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

Side by Side Diff: WebCore/svg/SVGLength.cpp

Issue 6117004: Merge 75026 - Merge 74788 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 9 years, 11 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 | « no previous file | 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 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2007 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 ASSERT_NOT_REACHED(); 85 ASSERT_NOT_REACHED();
86 return String(); 86 return String();
87 } 87 }
88 88
89 inline SVGLengthType stringToLengthType(const UChar*& ptr, const UChar* end) 89 inline SVGLengthType stringToLengthType(const UChar*& ptr, const UChar* end)
90 { 90 {
91 if (ptr == end) 91 if (ptr == end)
92 return LengthTypeNumber; 92 return LengthTypeNumber;
93 93
94 const UChar firstChar = *ptr; 94 const UChar firstChar = *ptr;
95 ++ptr;
96 95
97 if (firstChar == '%') { 96 if (++ptr == end)
98 if (ptr == end) 97 return firstChar == '%' ? LengthTypePercentage : LengthTypeUnknown;
99 return LengthTypePercentage;
100 return LengthTypeUnknown;
101 }
102 98
103 const UChar secondChar = *ptr; 99 const UChar secondChar = *ptr;
104 100
105 if (++ptr != end) 101 if (++ptr != end)
106 return LengthTypeUnknown; 102 return LengthTypeUnknown;
107 103
108 if (firstChar == 'e' && secondChar == 'm') 104 if (firstChar == 'e' && secondChar == 'm')
109 return LengthTypeEMS; 105 return LengthTypeEMS;
110 if (firstChar == 'e' && secondChar == 'x') 106 if (firstChar == 'e' && secondChar == 'x')
111 return LengthTypeEXS; 107 return LengthTypeEXS;
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 cssType = CSSPrimitiveValue::CSS_PC; 552 cssType = CSSPrimitiveValue::CSS_PC;
557 break; 553 break;
558 }; 554 };
559 555
560 return CSSPrimitiveValue::create(length.valueInSpecifiedUnits(), cssType); 556 return CSSPrimitiveValue::create(length.valueInSpecifiedUnits(), cssType);
561 } 557 }
562 558
563 } 559 }
564 560
565 #endif 561 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698