Chromium Code Reviews| Index: Source/core/dom/Document.cpp |
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
| index 4b97db5687594905c5098d97a830f72460741aa7..2c24d0f76f36da5bbe38fc421f3cecb33840e009 100644 |
| --- a/Source/core/dom/Document.cpp |
| +++ b/Source/core/dom/Document.cpp |
| @@ -4105,16 +4105,11 @@ static bool isValidNameNonASCII(const LChar* characters, unsigned length) |
| static bool isValidNameNonASCII(const UChar* characters, unsigned length) |
| { |
| - unsigned i = 0; |
| - |
| - UChar32 c; |
| - U16_NEXT(characters, i, length, c) |
| - if (!isValidNameStart(c)) |
| - return false; |
| - |
| - while (i < length) { |
| - U16_NEXT(characters, i, length, c) |
| - if (!isValidNamePart(c)) |
| + for (unsigned i = 0; i < length;) { |
|
fs
2014/09/04 12:01:18
Some might be alarmed by a for lacking an update e
|
| + bool first = i == 0; |
|
fs
2014/09/04 12:01:18
I suppose this could also be:
bool nameStart = tr
|
| + UChar32 c; |
| + U16_NEXT(characters, i, length, c); // Increments i. |
| + if (first ? !isValidNameStart(c) : !isValidNamePart(c)) |
| return false; |
| } |