Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Unified Diff: third_party/WebKit/Source/platform/text/Character.h

Issue 2288653002: Make custom element name checks faster and fewer (Closed)
Patch Set: More feedback Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/custom/CustomElementTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/text/Character.h
diff --git a/third_party/WebKit/Source/platform/text/Character.h b/third_party/WebKit/Source/platform/text/Character.h
index 1bef1a6713bfa6b0ebe72430d5ece69e1dd9587b..7db813cd4a8e76d887121af31db455cfae769a8b 100644
--- a/third_party/WebKit/Source/platform/text/Character.h
+++ b/third_party/WebKit/Source/platform/text/Character.h
@@ -36,6 +36,7 @@
#include "platform/text/TextDirection.h"
#include "platform/text/TextPath.h"
#include "platform/text/TextRun.h"
+#include "wtf/ASCIICType.h"
#include "wtf/Allocator.h"
#include "wtf/HashSet.h"
#include "wtf/text/CharacterNames.h"
@@ -81,6 +82,13 @@ public:
static bool isUprightInMixedVertical(UChar32 character);
// https://html.spec.whatwg.org/multipage/scripting.html#prod-potentialcustomelementname
+ static bool isPotentialCustomElementName8BitChar(LChar ch)
+ {
+ return isASCIILower(ch)
+ || isASCIIDigit(ch)
+ || ch == '-' || ch == '.' || ch == '_' || ch == 0xb7
esprehn 2016/09/07 03:54:05 what char is 0xb7?
+ || (0xc0 <= ch && ch != 0xd7 && ch != 0xf7);
esprehn 2016/09/07 03:54:05 What latin1 chars are these?
+ }
static bool isPotentialCustomElementNameChar(UChar32 character);
static bool treatAsSpace(UChar32 c)
« no previous file with comments | « third_party/WebKit/Source/core/dom/custom/CustomElementTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698