[webkit-reviews] review granted: [Bug 74784] Add support for 8 bits strings to Document::isValidName() : [Attachment 119719] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Dec 17 09:28:44 PST 2011


Andreas Kling <kling at webkit.org> has granted Benjamin Poulain
<benjamin at webkit.org>'s request for review:
Bug 74784: Add support for 8 bits strings to Document::isValidName()
https://bugs.webkit.org/show_bug.cgi?id=74784

Attachment 119719: Patch
https://bugs.webkit.org/attachment.cgi?id=119719&action=review

------- Additional Comments from Andreas Kling <kling at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=119719&action=review


Ahh, these 8-bit string hacks are just great! :)

> Source/WebCore/ChangeLog:9
> +	   The valid name has a fast path for ASCII, and a slow path
> +	   taking into account Unicode characters.

... a slow path taking Unicode characters into account.

> Source/WebCore/ChangeLog:12
> +	   For 8 bits strings, we do not need to test again the slow path
> +	   as it should never succeed if the fast path does not succed.

Since the slow path here is really the non-ASCII path, you could be more
specific, e.g:
"For 8-bit strings, we don't need to take the non-ASCII path as it could never
succeed if the ASCII path didn't."

> Source/WebCore/dom/Document.cpp:3802
> +    return isValidNameASCII(name.characters16(), length) ||
isValidNameNonASCII(name.characters16(), length);

We should cache the return value from characters16() to avoid doing the
String::m_impl null check again.


More information about the webkit-reviews mailing list