OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 if (!attributeName.startsWith("data-")) | 76 if (!attributeName.startsWith("data-")) |
77 return false; | 77 return false; |
78 | 78 |
79 unsigned propertyLength = propertyName.length(); | 79 unsigned propertyLength = propertyName.length(); |
80 unsigned attributeLength = attributeName.length(); | 80 unsigned attributeLength = attributeName.length(); |
81 | 81 |
82 unsigned a = 5; | 82 unsigned a = 5; |
83 unsigned p = 0; | 83 unsigned p = 0; |
84 bool wordBoundary = false; | 84 bool wordBoundary = false; |
85 while (a < attributeLength && p < propertyLength) { | 85 while (a < attributeLength && p < propertyLength) { |
86 if (attributeName[a] == '-' && a + 1 < attributeLength && attributeName[
a + 1] != '-') | 86 if (attributeName[a] == '-' && a + 1 < attributeLength && isASCIILower(a
ttributeName[a + 1])) |
87 wordBoundary = true; | 87 wordBoundary = true; |
88 else { | 88 else { |
89 if ((wordBoundary ? toASCIIUpper(attributeName[a]) : attributeName[a
]) != propertyName[p]) | 89 if ((wordBoundary ? toASCIIUpper(attributeName[a]) : attributeName[a
]) != propertyName[p]) |
90 return false; | 90 return false; |
91 p++; | 91 p++; |
92 wordBoundary = false; | 92 wordBoundary = false; |
93 } | 93 } |
94 a++; | 94 a++; |
95 } | 95 } |
96 | 96 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 { | 192 { |
193 if (!isValidPropertyName(name)) { | 193 if (!isValidPropertyName(name)) { |
194 es.throwDOMException(SyntaxError, ExceptionMessages::failedToDelete(name
, "DOMStringMap", "'" + name + "' is not a valid property name.")); | 194 es.throwDOMException(SyntaxError, ExceptionMessages::failedToDelete(name
, "DOMStringMap", "'" + name + "' is not a valid property name.")); |
195 return; | 195 return; |
196 } | 196 } |
197 | 197 |
198 m_element->removeAttribute(convertPropertyNameToAttributeName(name)); | 198 m_element->removeAttribute(convertPropertyNameToAttributeName(name)); |
199 } | 199 } |
200 | 200 |
201 } // namespace WebCore | 201 } // namespace WebCore |
OLD | NEW |