[webkit-reviews] review granted: [Bug 52508] [gtk] strip NUL characters when copying text/html on GTK+ : [Attachment 80218] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 26 14:14:27 PST 2011


Ryosuke Niwa <rniwa at webkit.org> has granted Tony Chang <tony at chromium.org>'s
request for review:
Bug 52508: [gtk] strip NUL characters when copying text/html on GTK+
https://bugs.webkit.org/show_bug.cgi?id=52508

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

------- Additional Comments from Ryosuke Niwa <rniwa at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=80218&action=review

> Source/WebCore/ChangeLog:7
> +

Please elaborate on what caused the bug and what fix you're doing.

> Source/WebCore/editing/markup.cpp:188
> -    return String::adopt(result);
> +    // We remove '\0' characters because they are not visibly rendered to
the user.
> +    return String::adopt(result).replace(0, "");

I don't think this is an efficient way of removing nulls but I don't have an
alternative offer.  Also, replace doesn't replicate the string when there's no
match so this doesn't regress the performance when there are no null
characters.  In addition, any algorithm to strip null characters will require
traversing through the entire string so I'd say r+.


More information about the webkit-reviews mailing list