[Webkit-unassigned] [Bug 182363] WebAppManifest scope should default to the containing directory of start_url if 'scope' is not specified

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 1 15:38:17 PST 2018


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

Ryosuke Niwa <rniwa at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rniwa at webkit.org

--- Comment #3 from Ryosuke Niwa <rniwa at webkit.org> ---
Comment on attachment 332910
  --> https://bugs.webkit.org/attachment.cgi?id=332910
Patch

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

> Source/WebCore/Modules/applicationmanifest/ApplicationManifestParser.cpp:211
> +    URL result { url };
> +
> +    result.removeQueryAndFragmentIdentifier();
> +
> +    auto path = result.path();
> +    if (path.endsWith('/'))
> +        return result;
> +
> +    auto lastSlash = path.reverseFind('/');
> +    if (lastSlash == WTF::notFound) {
> +        result.setPath({ });
> +        return result;
> +    }
> +
> +    result.setPath(path.substring(0, lastSlash + 1));
> +    return result;

Just do: URL(url, "./"). What's what service worker code does.
Also, we should this help function scopeURL or computeScopeURL or something.
"containing URL" is not really a nominal terminology.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180201/cbb32ec1/attachment-0001.html>


More information about the webkit-unassigned mailing list