summaryrefslogtreecommitdiff
path: root/core/fxcrt
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt')
-rw-r--r--core/fxcrt/DEPS3
-rw-r--r--core/fxcrt/css/cfx_cssselector.cpp4
-rw-r--r--core/fxcrt/fx_extension.h5
3 files changed, 8 insertions, 4 deletions
diff --git a/core/fxcrt/DEPS b/core/fxcrt/DEPS
new file mode 100644
index 0000000000..2be03524b6
--- /dev/null
+++ b/core/fxcrt/DEPS
@@ -0,0 +1,3 @@
+include_rules = [
+ '+third_party/icu',
+]
diff --git a/core/fxcrt/css/cfx_cssselector.cpp b/core/fxcrt/css/cfx_cssselector.cpp
index 76cb846890..8a22b12287 100644
--- a/core/fxcrt/css/cfx_cssselector.cpp
+++ b/core/fxcrt/css/cfx_cssselector.cpp
@@ -16,9 +16,9 @@ namespace {
int32_t GetCSSNameLen(const wchar_t* psz, const wchar_t* pEnd) {
const wchar_t* pStart = psz;
while (psz < pEnd) {
- wchar_t wch = *psz;
- if (!FXSYS_iswASCIIalnum(wch) && wch != '_' && wch != '-')
+ if (!isascii(*psz) || (!isalnum(*psz) && *psz != '_' && *psz != '-')) {
break;
+ }
++psz;
}
return psz - pStart;
diff --git a/core/fxcrt/fx_extension.h b/core/fxcrt/fx_extension.h
index 491d4b29b7..bd0ac8b303 100644
--- a/core/fxcrt/fx_extension.h
+++ b/core/fxcrt/fx_extension.h
@@ -12,6 +12,7 @@
#include <memory>
#include "core/fxcrt/fx_string.h"
+#include "third_party/icu/source/common/unicode/uchar.h"
#define FX_INVALID_OFFSET static_cast<uint32_t>(-1)
@@ -45,8 +46,8 @@ inline bool FXSYS_iswASCIIalpha(wchar_t wch) {
return FXSYS_isASCIIupper(wch) || FXSYS_isASCIIlower(wch);
}
-inline bool FXSYS_iswASCIIalnum(wchar_t wch) {
- return FXSYS_iswASCIIalpha(wch) || std::iswdigit(wch);
+inline bool FXSYS_iswalnum(wchar_t c) {
+ return u_isalnum(c);
}
inline bool FXSYS_iswASCIIspace(wchar_t c) {