OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 if (isValidName(lower, EmbedderNames)) | 63 if (isValidName(lower, EmbedderNames)) |
64 return; | 64 return; |
65 embedderCustomElementNames().append(lower); | 65 embedderCustomElementNames().append(lower); |
66 } | 66 } |
67 | 67 |
68 static inline bool isValidNCName(const AtomicString& name) | 68 static inline bool isValidNCName(const AtomicString& name) |
69 { | 69 { |
70 if (kNotFound != name.find(':')) | 70 if (kNotFound != name.find(':')) |
71 return false; | 71 return false; |
72 | 72 |
73 if (!name.string().is8Bit()) { | 73 if (!name.getString().is8Bit()) { |
74 const UChar32 c = name.characters16()[0]; | 74 const UChar32 c = name.characters16()[0]; |
75 // These characters comes under CombiningChar in NCName and according to | 75 // These characters comes under CombiningChar in NCName and according to |
76 // NCName only BaseChar and Ideodgraphic can come as first chars. | 76 // NCName only BaseChar and Ideodgraphic can come as first chars. |
77 // Also these characters come under Letter_Other in UnicodeData, thats | 77 // Also these characters come under Letter_Other in UnicodeData, thats |
78 // why they pass as valid document name. | 78 // why they pass as valid document name. |
79 if (c == 0x0B83 || c == 0x0F88 || c == 0x0F89 || c == 0x0F8A || c == 0x0
F8B) | 79 if (c == 0x0B83 || c == 0x0F88 || c == 0x0F89 || c == 0x0F8A || c == 0x0
F8B) |
80 return false; | 80 return false; |
81 } | 81 } |
82 | 82 |
83 return Document::isValidName(name.string()); | 83 return Document::isValidName(name.getString()); |
84 } | 84 } |
85 | 85 |
86 bool CustomElement::isValidName(const AtomicString& name, NameSet validNames) | 86 bool CustomElement::isValidName(const AtomicString& name, NameSet validNames) |
87 { | 87 { |
88 if ((validNames & EmbedderNames) && kNotFound != embedderCustomElementNames(
).find(name)) | 88 if ((validNames & EmbedderNames) && kNotFound != embedderCustomElementNames(
).find(name)) |
89 return Document::isValidName(name); | 89 return Document::isValidName(name); |
90 | 90 |
91 if ((validNames & StandardNames) && kNotFound != name.find('-')) { | 91 if ((validNames & StandardNames) && kNotFound != name.find('-')) { |
92 DEFINE_STATIC_LOCAL(Vector<AtomicString>, reservedNames, ()); | 92 DEFINE_STATIC_LOCAL(Vector<AtomicString>, reservedNames, ()); |
93 if (reservedNames.isEmpty()) { | 93 if (reservedNames.isEmpty()) { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 break; | 149 break; |
150 | 150 |
151 case Element::WaitingForUpgrade: | 151 case Element::WaitingForUpgrade: |
152 case Element::Upgraded: | 152 case Element::Upgraded: |
153 CustomElementObserver::notifyElementWasDestroyed(element); | 153 CustomElementObserver::notifyElementWasDestroyed(element); |
154 break; | 154 break; |
155 } | 155 } |
156 } | 156 } |
157 | 157 |
158 } // namespace blink | 158 } // namespace blink |
OLD | NEW |