Fix encoding of the string returned from Node::ToString().
https://chromium-review.googlesource.com/c/chromium/src/+/920776 caused regressions. Strings dumped from LayoutObject::DumpLayoutObject() used to escape newlines, non-ASCII characters and other special characters, but not after this CL. The code depended on a special std::ostream& operator<<(std::ostream& out, const String& string) overload, which took care of this string conversion. Since we no longer use std::ostream, introduce add String::EncodeForDebugging() and have Node::ToString() (and the aforementioned operator<< overload) use that. Added a unit test so that we don't accidentally break this again. Change-Id: I62172bf1ebd12da1fdb71f78768e17aa937ea5cb Reviewed-on: https://chromium-review.googlesource.com/925271Reviewed-by:Kent Tamura <tkent@chromium.org> Reviewed-by:
Xiaocheng Hu <xiaochengh@chromium.org> Commit-Queue: Morten Stenshorne <mstensho@chromium.org> Cr-Commit-Position: refs/heads/master@{#537719}
Showing
Please register or sign in to comment