WebAppManifest scope should default to the containing directory of start_url if ...
authordavid_quesada@apple.com <david_quesada@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 Feb 2018 00:49:56 +0000 (00:49 +0000)
committerdavid_quesada@apple.com <david_quesada@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 Feb 2018 00:49:56 +0000 (00:49 +0000)
commit6f690d60db75ded44e3f094c163a35230968e79f
tree4a3a14624cb6c823ed6d8542429b539c7d94d9e2
parentbb84b9d7bfa12dbc564b5ef3854cbb99dc8d921d
WebAppManifest scope should default to the containing directory of start_url if 'scope' is not specified
https://bugs.webkit.org/show_bug.cgi?id=182363
rdar://problem/37093498

Reviewed by Ryosuke Niwa.

Source/WebCore:

If an app manifest doesn't specify a scope, we should default to the "parent directory" of
the start URL, rather than leaving the app unbounded. This is more reasonable than using the
entire internet as the app scope.

No new tests, updates to the existing tests verify the new behavior.

* Modules/applicationmanifest/ApplicationManifestParser.cpp:
(WebCore::ApplicationManifestParser::parseScope):

Tools:

Updated ApplicationManifestParserTests to account for the new default scope behavior.

* TestWebKitAPI/Tests/WebCore/ApplicationManifestParser.cpp:
(assertManifestHasDefaultValues):
(TEST_F):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/applicationmanifest/ApplicationManifestParser.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/ApplicationManifestParser.cpp