Index: Source/core/dom/custom/CustomElement.cpp |
diff --git a/Source/core/dom/custom/CustomElement.cpp b/Source/core/dom/custom/CustomElement.cpp |
index 4253c5fea893093d0354146864b2c070599e7442..e526bff26b43e5c958a0bc9a40ef3fcbf1927bf0 100644 |
--- a/Source/core/dom/custom/CustomElement.cpp |
+++ b/Source/core/dom/custom/CustomElement.cpp |
@@ -66,6 +66,24 @@ void CustomElement::addEmbedderCustomElementName(const AtomicString& name) |
embedderCustomElementNames().append(lower); |
} |
+static inline bool isValidNCName(const AtomicString& name) |
+{ |
+ if (kNotFound != name.find(':')) |
+ return false; |
+ |
+ if (!name.string().is8Bit()) { |
+ const UChar32 c = name.characters16()[0]; |
+ // These characters comes under CombiningChar in NCName and according to |
+ // NCName only BaseChar and Ideodgraphic can come as first chars. |
+ // Also these characters come under Letter_Other in UnicodeData, thats |
+ // why they pass as valid document name. |
+ if (c == 0x0B83 || c == 0x0F88 || c == 0x0F89 || c == 0x0F8A || c == 0x0F8B) |
+ return false; |
+ } |
+ |
+ return Document::isValidName(name.string()); |
+} |
+ |
bool CustomElement::isValidName(const AtomicString& name, NameSet validNames) |
{ |
if ((validNames & EmbedderNames) && kNotFound != embedderCustomElementNames().find(name)) |
@@ -79,7 +97,7 @@ bool CustomElement::isValidName(const AtomicString& name, NameSet validNames) |
} |
if (kNotFound == reservedNames.find(name)) |
- return Document::isValidName(name.string()); |
+ return isValidNCName(name); |
} |
return false; |