[webkit-reviews] review granted: [Bug 180539] ApplicationManifestParser should strip whitespace from the raw input : [Attachment 328735] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 7 16:41:49 PST 2017

Joseph Pecoraro <joepeck at webkit.org> has granted David Quesada
<david_quesada at apple.com>'s request for review:
Bug 180539: ApplicationManifestParser should strip whitespace from the raw

Attachment 328735: Patch


--- Comment #3 from Joseph Pecoraro <joepeck at webkit.org> ---
Comment on attachment 328735
  --> https://bugs.webkit.org/attachment.cgi?id=328735

View in context: https://bugs.webkit.org/attachment.cgi?id=328735&action=review


> Source/WebCore/Modules/applicationmanifest/ApplicationManifestParser.cpp:60
>      RefPtr<JSON::Value> jsonValue;
> -    if (!JSON::Value::parseJSON(text, jsonValue)) {
> +    if (!JSON::Value::parseJSON(text.stripWhiteSpace(), jsonValue)) {

Does this actually change behavior? parseJSON looks to ignore leading

> Token parseToken(const UChar* start, const UChar* end, const UChar**
tokenStart, const UChar** tokenEnd)
> {
>     while (start < end && isSpaceOrNewline(*start))
>	  ++start;
>     ...

It might also be good to have a link to the spec at the top of this file
somewhere for quick reference. I suspect that is:

This part appears to be:

1. Let json be the result of parsing text. If parsing throws an error: ...

And here parseJSON(text) should satisfy this without the stripWhiteSpace.

More information about the webkit-reviews mailing list