[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
Fri Feb 2 08:36:29 PST 2018


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

--- Comment #4 from David Quesada <david_quesada at apple.com> ---
(In reply to Ryosuke Niwa from comment #3)
> Comment on attachment 332910 [details]
> 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.

That's a lot cleaner. I'll use that instead.

> 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/20180202/c75e35cf/attachment.html>


More information about the webkit-unassigned mailing list