OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 static String cssPropertyName(const Identifier& propertyName, bool* hadPixelOrPo
sPrefix = 0) | 70 static String cssPropertyName(const Identifier& propertyName, bool* hadPixelOrPo
sPrefix = 0) |
71 { | 71 { |
72 if (hadPixelOrPosPrefix) | 72 if (hadPixelOrPosPrefix) |
73 *hadPixelOrPosPrefix = false; | 73 *hadPixelOrPosPrefix = false; |
74 | 74 |
75 unsigned length = propertyName.size(); | 75 unsigned length = propertyName.size(); |
76 if (!length) | 76 if (!length) |
77 return String(); | 77 return String(); |
78 | 78 |
79 Vector<UChar> name; | 79 Vector<UChar> name; |
80 name.reserveCapacity(length); | 80 name.reserveInitialCapacity(length); |
81 | 81 |
82 unsigned i = 0; | 82 unsigned i = 0; |
83 | 83 |
84 if (hasCSSPropertyNamePrefix(propertyName, "css")) | 84 if (hasCSSPropertyNamePrefix(propertyName, "css")) |
85 i += 3; | 85 i += 3; |
86 else if (hasCSSPropertyNamePrefix(propertyName, "pixel")) { | 86 else if (hasCSSPropertyNamePrefix(propertyName, "pixel")) { |
87 i += 5; | 87 i += 5; |
88 if (hadPixelOrPosPrefix) | 88 if (hadPixelOrPosPrefix) |
89 *hadPixelOrPosPrefix = true; | 89 *hadPixelOrPosPrefix = true; |
90 } else if (hasCSSPropertyNamePrefix(propertyName, "pos")) { | 90 } else if (hasCSSPropertyNamePrefix(propertyName, "pos")) { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 String propValue = valueToStringWithNullCheck(exec, value); | 166 String propValue = valueToStringWithNullCheck(exec, value); |
167 if (pixelOrPos) | 167 if (pixelOrPos) |
168 propValue += "px"; | 168 propValue += "px"; |
169 ExceptionCode ec = 0; | 169 ExceptionCode ec = 0; |
170 impl()->setProperty(prop, propValue, ec); | 170 impl()->setProperty(prop, propValue, ec); |
171 setDOMException(exec, ec); | 171 setDOMException(exec, ec); |
172 return true; | 172 return true; |
173 } | 173 } |
174 | 174 |
175 } // namespace WebCore | 175 } // namespace WebCore |
OLD | NEW |