| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2014 Apple Inc. All rights reserved. | 3 * Copyright (C) 2014 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2014 Samsung Electronics. All rights reserved. | 4 * Copyright (C) 2014 Samsung Electronics. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions are | 7 * modification, are permitted provided that the following conditions are |
| 8 * met: | 8 * met: |
| 9 * | 9 * |
| 10 * * Redistributions of source code must retain the above copyright | 10 * * Redistributions of source code must retain the above copyright |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 bool should_ignore_attribute_case) const { | 197 bool should_ignore_attribute_case) const { |
| 198 // Continue to checking case-insensitively and/or full namespaced names if | 198 // Continue to checking case-insensitively and/or full namespaced names if |
| 199 // necessary: | 199 // necessary: |
| 200 iterator end = this->end(); | 200 iterator end = this->end(); |
| 201 unsigned index = 0; | 201 unsigned index = 0; |
| 202 for (iterator it = begin(); it != end; ++it, ++index) { | 202 for (iterator it = begin(); it != end; ++it, ++index) { |
| 203 // FIXME: Why check the prefix? Namespace is all that should matter | 203 // FIXME: Why check the prefix? Namespace is all that should matter |
| 204 // and all HTML/SVG attributes have a null namespace! | 204 // and all HTML/SVG attributes have a null namespace! |
| 205 if (!it->GetName().HasPrefix()) { | 205 if (!it->GetName().HasPrefix()) { |
| 206 if (should_ignore_attribute_case && | 206 if (should_ignore_attribute_case && |
| 207 EqualIgnoringCase(name, it->LocalName())) | 207 DeprecatedEqualIgnoringCase(name, it->LocalName())) |
| 208 return index; | 208 return index; |
| 209 } else { | 209 } else { |
| 210 // FIXME: Would be faster to do this comparison without calling toString, | 210 // FIXME: Would be faster to do this comparison without calling toString, |
| 211 // which generates a temporary string by concatenation. But this branch is | 211 // which generates a temporary string by concatenation. But this branch is |
| 212 // only reached if the attribute name has a prefix, which is rare in HTML. | 212 // only reached if the attribute name has a prefix, which is rare in HTML. |
| 213 if (EqualPossiblyIgnoringCase(name, it->GetName().ToString(), | 213 if (EqualPossiblyIgnoringCase(name, it->GetName().ToString(), |
| 214 should_ignore_attribute_case)) | 214 should_ignore_attribute_case)) |
| 215 return index; | 215 return index; |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 return kNotFound; | 218 return kNotFound; |
| 219 } | 219 } |
| 220 | 220 |
| 221 } // namespace blink | 221 } // namespace blink |
| 222 | 222 |
| 223 #endif // AttributeCollection_h | 223 #endif // AttributeCollection_h |
| OLD | NEW |