Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SVG] Escape non-ASCII characters in console messages #6402

Closed
wants to merge 1 commit into from

Conversation

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Nov 11, 2022
@Ahmad-S792 Ahmad-S792 closed this Nov 11, 2022
@@ -243,7 +244,7 @@ void SVGElement::reportAttributeParsingError(SVGParsingError error, const Qualif
if (error == NoError)
return;

String errorString = "<" + tagName() + "> attribute " + name.toString() + "=\"" + value + "\"";
String errorString = "<" + tagName() + "> attribute " + name.toString() + "=" + JSON::Value::escapeString(value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add this static function to JSON::Value and it will make things compile:

String Value::escapeString(StringView string)
{
    StringBuilder result;
    escapeString(result, string);
    return result.toString();
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I will reopen and push an update.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried but it didn't work and then I tried to look into Chromium implementation and trying to see if it works but I think it would be difficult. My local build environment is also not working.

[SVG] Escape non-ASCII characters in console messages
https://bugs.webkit.org/show_bug.cgi?id=247814

Reviewed by NOBODY (OOPS!).

Merge - https://src.chromium.org/viewvc/blink?view=revision&revision=196815

This is to align with Blink / Chrome behavior to allow escape non-ASCII characters in console messages.

* Source/WebCore/svg/SVGElement.cpp: Add "JSONValues.h" header
(SVGElement::reportAttributeParsingError): Update errorString to escape non-ASCII characters
* Source/WTF/wtf/JSONValue.cpp: Add "quoteString" function
* Source/WTF/wtf/JSONValues.h: Add definition for 'quoteString'
@Ahmad-S792 Ahmad-S792 closed this Dec 12, 2022
@Ahmad-S792 Ahmad-S792 deleted the fix247814 branch October 2, 2023 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merging-blocked Applied to prevent a change from being merged
Projects
None yet
4 participants