[Webkit-unassigned] [Bug 52508] [gtk] strip NUL characters when copying text/html on GTK+

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


https://bugs.webkit.org/show_bug.cgi?id=52508


Ryosuke Niwa <rniwa at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #80218|review?                     |review+
               Flag|                            |




--- Comment #2 from Ryosuke Niwa <rniwa at webkit.org>  2011-01-26 14:14:27 PST ---
(From update of attachment 80218)
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+.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list