Add a class for parsing application manifests
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Dec 2017 00:57:33 +0000 (00:57 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Dec 2017 00:57:33 +0000 (00:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=177973
rdar://problem/34747949

Patch by David Quesada <david_quesada@apple.com> on 2017-12-04
Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLICATION_MANIFEST feature flag.

Source/WebCore:

Add a new struct ApplicationManifest, along with ApplicationManifestParser to initialize
ApplicationManifests from JSON data, according to the App Manifest spec. Just a basic subset
of the manifests's properties are implemented to start with.

ApplicationManifestParser is tested by new unit tests in TestWebKitAPI.

* Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLICATION_MANIFEST feature flag.
* Modules/applicationmanifest/ApplicationManifest.h: Added.
* Modules/applicationmanifest/ApplicationManifestParser.cpp: Added.
(WebCore::ApplicationManifestParser::parse):
The main entry point for eventual clients (and currently the unit tests) to invoke
ApplicationManifestParser. There is a variant that accepts a ScriptExecutionContext that
uses the context exclusively for logging console warnings while parsing the manifest, and
not for actually executing any scripts.
(WebCore::ApplicationManifestParser::ApplicationManifestParser):
(WebCore::ApplicationManifestParser::parseManifest):
(WebCore::ApplicationManifestParser::logManifestPropertyNotAString):
(WebCore::ApplicationManifestParser::logManifestPropertyInvalidURL):
(WebCore::ApplicationManifestParser::logDeveloperWarning):
(WebCore::ApplicationManifestParser::parseStartURL):
(WebCore::ApplicationManifestParser::parseName):
(WebCore::ApplicationManifestParser::parseDescription):
(WebCore::ApplicationManifestParser::parseShortName):
(WebCore::isInScope):
(WebCore::ApplicationManifestParser::parseScope):
(WebCore::ApplicationManifestParser::parseGenericString):
* Modules/applicationmanifest/ApplicationManifestParser.h: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* features.json: Change the Web App Manifest feature status to "In Development"

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLICATION_MANIFEST feature flag.

Source/WebKit:

* Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLICATION_MANIFEST feature flag.

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLICATION_MANIFEST feature flag.

Tools:

Add basic unit tests for ApplicationManifestParser. For each of the implemented top-level properties,
attempt to parse manifests with varying types of valid and invalid data to ensure the resulting
ApplicationManifest is configured with the appropriate values per the spec.

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLICATION_MANIFEST feature flag.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/ApplicationManifestParser.cpp: Added.
(ApplicationManifestParserTest::SetUp):
(ApplicationManifestParserTest::parseString):
(ApplicationManifestParserTest::parseTopLevelProperty):
(ApplicationManifestParserTest::testStartURL):
(ApplicationManifestParserTest::testName):
(ApplicationManifestParserTest::testDescription):
(ApplicationManifestParserTest::testShortName):
(ApplicationManifestParserTest::testScope):
(assertManifestHasDefaultValues):
(TEST_F):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225507 268f45cc-cd09-0410-ab3c-d52691b4dbfc

20 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h [new file with mode: 0644]
Source/WebCore/Modules/applicationmanifest/ApplicationManifestParser.cpp [new file with mode: 0644]
Source/WebCore/Modules/applicationmanifest/ApplicationManifestParser.h [new file with mode: 0644]
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/features.json
Source/WebKit/ChangeLog
Source/WebKit/Configurations/FeatureDefines.xcconfig
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig
Tools/ChangeLog
Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebCore/ApplicationManifestParser.cpp [new file with mode: 0644]

index adb5c78..a0df8b4 100644 (file)
@@ -1,3 +1,13 @@
+2017-12-04  David Quesada  <david_quesada@apple.com>
+
+        Add a class for parsing application manifests
+        https://bugs.webkit.org/show_bug.cgi?id=177973
+        rdar://problem/34747949
+
+        Reviewed by Geoffrey Garen.
+
+        * Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLICATION_MANIFEST feature flag.
+
 2017-12-04  JF Bastien  <jfbastien@apple.com>
 
         Update std::expected to match libc++ coding style
index f5a766b..7c555dd 100644 (file)
@@ -66,6 +66,7 @@ ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_ = $(ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_NO);
 ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_NO = ENABLE_APPLE_PAY_SESSION_V3;
 ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_YES = ;
 
+ENABLE_APPLICATION_MANIFEST = ;
 ENABLE_ATTACHMENT_ELEMENT = ENABLE_ATTACHMENT_ELEMENT;
 ENABLE_AVF_CAPTIONS = ENABLE_AVF_CAPTIONS;
 ENABLE_CACHE_PARTITIONING = ENABLE_CACHE_PARTITIONING;
@@ -250,4 +251,4 @@ ENABLE_DATA_INTERACTION_iphonesimulator = ENABLE_DATA_INTERACTION;
 ENABLE_DATA_INTERACTION[sdk=iphoneos10*] = ;
 ENABLE_DATA_INTERACTION[sdk=iphonesimulator10*] = ;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_ALTERNATIVE_PRESENTATION_BUTTON_ELEMENT) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_ASYNC_ITERATION) $(ENABLE_FULLSCREEN_API) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_ALTERNATIVE_PRESENTATION_BUTTON_ELEMENT) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_ASYNC_ITERATION) $(ENABLE_FULLSCREEN_API) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
\ No newline at end of file
index 24966b0..52b9a60 100644 (file)
@@ -1,3 +1,42 @@
+2017-12-04  David Quesada  <david_quesada@apple.com>
+
+        Add a class for parsing application manifests
+        https://bugs.webkit.org/show_bug.cgi?id=177973
+        rdar://problem/34747949
+
+        Reviewed by Geoffrey Garen.
+
+        Add a new struct ApplicationManifest, along with ApplicationManifestParser to initialize
+        ApplicationManifests from JSON data, according to the App Manifest spec. Just a basic subset
+        of the manifests's properties are implemented to start with.
+
+        ApplicationManifestParser is tested by new unit tests in TestWebKitAPI.
+
+        * Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLICATION_MANIFEST feature flag.
+        * Modules/applicationmanifest/ApplicationManifest.h: Added.
+        * Modules/applicationmanifest/ApplicationManifestParser.cpp: Added.
+        (WebCore::ApplicationManifestParser::parse):
+        The main entry point for eventual clients (and currently the unit tests) to invoke
+        ApplicationManifestParser. There is a variant that accepts a ScriptExecutionContext that
+        uses the context exclusively for logging console warnings while parsing the manifest, and
+        not for actually executing any scripts.
+        (WebCore::ApplicationManifestParser::ApplicationManifestParser):
+        (WebCore::ApplicationManifestParser::parseManifest):
+        (WebCore::ApplicationManifestParser::logManifestPropertyNotAString):
+        (WebCore::ApplicationManifestParser::logManifestPropertyInvalidURL):
+        (WebCore::ApplicationManifestParser::logDeveloperWarning):
+        (WebCore::ApplicationManifestParser::parseStartURL):
+        (WebCore::ApplicationManifestParser::parseName):
+        (WebCore::ApplicationManifestParser::parseDescription):
+        (WebCore::ApplicationManifestParser::parseShortName):
+        (WebCore::isInScope):
+        (WebCore::ApplicationManifestParser::parseScope):
+        (WebCore::ApplicationManifestParser::parseGenericString):
+        * Modules/applicationmanifest/ApplicationManifestParser.h: Added.
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * features.json: Change the Web App Manifest feature status to "In Development"
+
 2017-12-04  Zalan Bujtas  <zalan@apple.com>
 
         RenderMultiColumnFlow::fragmentedFlowDescendantInserted should not destroy incoming newDescendant
index f5a766b..7c555dd 100644 (file)
@@ -66,6 +66,7 @@ ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_ = $(ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_NO);
 ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_NO = ENABLE_APPLE_PAY_SESSION_V3;
 ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_YES = ;
 
+ENABLE_APPLICATION_MANIFEST = ;
 ENABLE_ATTACHMENT_ELEMENT = ENABLE_ATTACHMENT_ELEMENT;
 ENABLE_AVF_CAPTIONS = ENABLE_AVF_CAPTIONS;
 ENABLE_CACHE_PARTITIONING = ENABLE_CACHE_PARTITIONING;
@@ -250,4 +251,4 @@ ENABLE_DATA_INTERACTION_iphonesimulator = ENABLE_DATA_INTERACTION;
 ENABLE_DATA_INTERACTION[sdk=iphoneos10*] = ;
 ENABLE_DATA_INTERACTION[sdk=iphonesimulator10*] = ;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_ALTERNATIVE_PRESENTATION_BUTTON_ELEMENT) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_ASYNC_ITERATION) $(ENABLE_FULLSCREEN_API) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_ALTERNATIVE_PRESENTATION_BUTTON_ELEMENT) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_ASYNC_ITERATION) $(ENABLE_FULLSCREEN_API) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
\ No newline at end of file
diff --git a/Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h b/Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h
new file mode 100644 (file)
index 0000000..ef96269
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(APPLICATION_MANIFEST)
+
+#include "URL.h"
+
+namespace WebCore {
+
+struct ApplicationManifest {
+    String name;
+    String shortName;
+    String description;
+    URL scope;
+    URL startURL;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(APPLICATION_MANIFEST)
+
diff --git a/Source/WebCore/Modules/applicationmanifest/ApplicationManifestParser.cpp b/Source/WebCore/Modules/applicationmanifest/ApplicationManifestParser.cpp
new file mode 100644 (file)
index 0000000..467e568
--- /dev/null
@@ -0,0 +1,219 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ApplicationManifestParser.h"
+
+#if ENABLE(APPLICATION_MANIFEST)
+
+#include "SecurityOrigin.h"
+#include <JavaScriptCore/ConsoleMessage.h>
+
+namespace WebCore {
+
+ApplicationManifest ApplicationManifestParser::parse(ScriptExecutionContext& scriptExecutionContext, const String& source, const URL& manifestURL, const URL& documentURL)
+{
+    ApplicationManifestParser parser { &scriptExecutionContext };
+    return parser.parseManifest(source, manifestURL, documentURL);
+}
+
+ApplicationManifest ApplicationManifestParser::parse(const String& source, const URL& manifestURL, const URL& documentURL)
+{
+    ApplicationManifestParser parser { nullptr };
+    return parser.parseManifest(source, manifestURL, documentURL);
+}
+
+ApplicationManifestParser::ApplicationManifestParser(RefPtr<ScriptExecutionContext> consoleContext)
+    : m_consoleContext(consoleContext)
+{
+}
+
+ApplicationManifest ApplicationManifestParser::parseManifest(const String& text, const URL& manifestURL, const URL& documentURL)
+{
+    m_manifestURL = manifestURL;
+
+    RefPtr<JSON::Value> jsonValue;
+    if (!JSON::Value::parseJSON(text, jsonValue)) {
+        logDeveloperWarning(ASCIILiteral("The manifest is not valid JSON data."));
+        jsonValue = JSON::Object::create();
+    }
+
+    RefPtr<JSON::Object> manifest;
+    if (!jsonValue->asObject(manifest)) {
+        logDeveloperWarning(ASCIILiteral("The manifest is not a JSON value of type \"object\"."));
+        manifest = JSON::Object::create();
+    }
+
+    ApplicationManifest parsedManifest;
+
+    parsedManifest.startURL = parseStartURL(*manifest, documentURL);
+    parsedManifest.name = parseName(*manifest);
+    parsedManifest.description = parseDescription(*manifest);
+    parsedManifest.shortName = parseShortName(*manifest);
+    parsedManifest.scope = parseScope(*manifest, documentURL, parsedManifest.startURL);
+
+    return parsedManifest;
+}
+
+void ApplicationManifestParser::logManifestPropertyNotAString(const String& propertyName)
+{
+    logDeveloperWarning("The \"" + propertyName + "\" application manifest property is not a string.");
+}
+
+void ApplicationManifestParser::logManifestPropertyInvalidURL(const String& propertyName)
+{
+    logDeveloperWarning("The \"" + propertyName + "\" application manifest property is not a valid URL.");
+}
+
+void ApplicationManifestParser::logDeveloperWarning(const String& message)
+{
+    if (m_consoleContext)
+        m_consoleContext->addConsoleMessage(std::make_unique<Inspector::ConsoleMessage>(JSC::MessageSource::Other, JSC::MessageType::Log, JSC::MessageLevel::Warning, ASCIILiteral("Parsing application manifest ") + m_manifestURL.string() + ASCIILiteral(": ") + message));
+}
+
+URL ApplicationManifestParser::parseStartURL(const JSON::Object& manifest, const URL& documentURL)
+{
+    RefPtr<JSON::Value> value;
+    if (!manifest.getValue("start_url", value))
+        return documentURL;
+
+    String stringValue;
+    if (!value->asString(stringValue)) {
+        logManifestPropertyNotAString(ASCIILiteral("start_url"));
+        return documentURL;
+    }
+
+    if (stringValue.isEmpty())
+        return documentURL;
+
+    URL startURL(m_manifestURL, stringValue);
+    if (!startURL.isValid()) {
+        logManifestPropertyInvalidURL(ASCIILiteral("start_url"));
+        return documentURL;
+    }
+
+    if (!protocolHostAndPortAreEqual(startURL, documentURL)) {
+        auto startURLOrigin = SecurityOrigin::create(startURL);
+        auto documentOrigin = SecurityOrigin::create(documentURL);
+        logDeveloperWarning(ASCIILiteral("The start_url's origin of \"") + startURLOrigin->toString() + ASCIILiteral("\" is different from the document's origin of \"") + documentOrigin->toString() + ASCIILiteral("\"."));
+        return documentURL;
+    }
+
+    return startURL;
+}
+
+String ApplicationManifestParser::parseName(const JSON::Object& manifest)
+{
+    return parseGenericString(manifest, ASCIILiteral("name"));
+}
+
+String ApplicationManifestParser::parseDescription(const JSON::Object& manifest)
+{
+    return parseGenericString(manifest, ASCIILiteral("description"));
+}
+
+String ApplicationManifestParser::parseShortName(const JSON::Object& manifest)
+{
+    return parseGenericString(manifest, ASCIILiteral("short_name"));
+}
+
+static bool isInScope(const URL& scopeURL, const URL& targetURL)
+{
+    // 1. If scopeURL is undefined (i.e., it is unbounded because of an error or it was not declared in the manifest), return true.
+    if (scopeURL.isNull() || scopeURL.isEmpty())
+        return true;
+
+    // 2. Let target be a new URL using targetURL as input. If target is failure, return false.
+    if (!targetURL.isValid())
+        return false;
+
+    // 3. Let scopePath be the elements of scopes's path, separated by U+002F (/).
+    auto scopePath = scopeURL.path();
+
+    // 4. Let targetPath be the elements of target's path, separated by U+002F (/).
+    auto targetPath = targetURL.path();
+
+    // 5. If target is same origin as scope and targetPath starts with scopePath, return true.
+    if (protocolHostAndPortAreEqual(scopeURL, targetURL) && targetPath.startsWith(scopePath))
+        return true;
+
+    // 6. Otherwise, return false.
+    return false;
+}
+
+URL ApplicationManifestParser::parseScope(const JSON::Object& manifest, const URL& documentURL, const URL& startURL)
+{
+    RefPtr<JSON::Value> value;
+    if (!manifest.getValue("scope", value))
+        return { };
+
+    String stringValue;
+    if (!value->asString(stringValue)) {
+        logManifestPropertyNotAString(ASCIILiteral("scope"));
+        return { };
+    }
+
+    if (stringValue.isEmpty())
+        return { };
+
+    URL scopeURL(m_manifestURL, stringValue);
+    if (!scopeURL.isValid()) {
+        logManifestPropertyInvalidURL(ASCIILiteral("scope"));
+        return { };
+    }
+
+    if (!protocolHostAndPortAreEqual(scopeURL, documentURL)) {
+        auto scopeURLOrigin = SecurityOrigin::create(scopeURL);
+        auto documentOrigin = SecurityOrigin::create(documentURL);
+        logDeveloperWarning(ASCIILiteral("The scope's origin of \"") + scopeURLOrigin->toString() + ASCIILiteral("\" is different from the document's origin of \"") + documentOrigin->toString() + ASCIILiteral("\"."));
+        return { };
+    }
+
+    if (!isInScope(scopeURL, startURL)) {
+        logDeveloperWarning(ASCIILiteral("The start URL is not within scope of the provided scope URL."));
+        return { };
+    }
+
+    return scopeURL;
+}
+
+String ApplicationManifestParser::parseGenericString(const JSON::Object& manifest, const String& propertyName)
+{
+    RefPtr<JSON::Value> value;
+    if (!manifest.getValue(propertyName, value))
+        return { };
+
+    String stringValue;
+    if (!value->asString(stringValue)) {
+        logManifestPropertyNotAString(propertyName);
+        return { };
+    }
+
+    return stringValue.stripWhiteSpace();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(APPLICATION_MANIFEST)
diff --git a/Source/WebCore/Modules/applicationmanifest/ApplicationManifestParser.h b/Source/WebCore/Modules/applicationmanifest/ApplicationManifestParser.h
new file mode 100644 (file)
index 0000000..69a11dc
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(APPLICATION_MANIFEST)
+
+#include "ApplicationManifest.h"
+#include "ScriptExecutionContext.h"
+#include <wtf/JSONValues.h>
+
+namespace WebCore {
+
+class ApplicationManifestParser {
+public:
+    WEBCORE_EXPORT static ApplicationManifest parse(ScriptExecutionContext&, const String&, const URL& manifestURL, const URL& documentURL);
+    WEBCORE_EXPORT static ApplicationManifest parse(const String&, const URL& manifestURL, const URL& documentURL);
+
+private:
+    ApplicationManifestParser(RefPtr<ScriptExecutionContext>);
+    ApplicationManifest parseManifest(const String&, const URL&, const URL&);
+
+    URL parseStartURL(const JSON::Object&, const URL&);
+    String parseName(const JSON::Object&);
+    String parseDescription(const JSON::Object&);
+    String parseShortName(const JSON::Object&);
+    URL parseScope(const JSON::Object&, const URL&, const URL&);
+
+    String parseGenericString(const JSON::Object&, const String&);
+
+    void logManifestPropertyNotAString(const String&);
+    void logManifestPropertyInvalidURL(const String&);
+    void logDeveloperWarning(const String& message);
+
+    RefPtr<ScriptExecutionContext> m_consoleContext;
+    URL m_manifestURL;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(APPLICATION_MANIFEST)
index 632a51f..a548a8b 100644 (file)
@@ -1,3 +1,13 @@
+2017-12-04  David Quesada  <david_quesada@apple.com>
+
+        Add a class for parsing application manifests
+        https://bugs.webkit.org/show_bug.cgi?id=177973
+        rdar://problem/34747949
+
+        Reviewed by Geoffrey Garen.
+
+        * Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLICATION_MANIFEST feature flag.
+
 2017-12-04  Zan Dobersek  <zdobersek@igalia.com>
 
         Unreviewed WPE build fix.
index f5a766b..7c555dd 100644 (file)
@@ -66,6 +66,7 @@ ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_ = $(ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_NO);
 ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_NO = ENABLE_APPLE_PAY_SESSION_V3;
 ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_YES = ;
 
+ENABLE_APPLICATION_MANIFEST = ;
 ENABLE_ATTACHMENT_ELEMENT = ENABLE_ATTACHMENT_ELEMENT;
 ENABLE_AVF_CAPTIONS = ENABLE_AVF_CAPTIONS;
 ENABLE_CACHE_PARTITIONING = ENABLE_CACHE_PARTITIONING;
@@ -250,4 +251,4 @@ ENABLE_DATA_INTERACTION_iphonesimulator = ENABLE_DATA_INTERACTION;
 ENABLE_DATA_INTERACTION[sdk=iphoneos10*] = ;
 ENABLE_DATA_INTERACTION[sdk=iphonesimulator10*] = ;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_ALTERNATIVE_PRESENTATION_BUTTON_ELEMENT) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_ASYNC_ITERATION) $(ENABLE_FULLSCREEN_API) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_ALTERNATIVE_PRESENTATION_BUTTON_ELEMENT) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_ASYNC_ITERATION) $(ENABLE_FULLSCREEN_API) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
\ No newline at end of file
index d00d5b3..c3deada 100644 (file)
 
 Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp
 
+#if ENABLE_APPLICATION_MANIFEST
+
+Modules/applicationmanifest/ApplicationManifestParser.cpp
+
+#endif
+
 Modules/beacon/NavigatorBeacon.cpp
 
 Modules/cache/CacheStorageConnection.cpp
index 033bfbb..925c8ed 100644 (file)
                62C1217D11AB9E77003C462C /* SuspendableTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 62C1217B11AB9E77003C462C /* SuspendableTimer.h */; settings = {ATTRIBUTES = (Private, ); }; };
                62CD325A1157E57C0063B0A7 /* CustomEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 62CD32571157E57C0063B0A7 /* CustomEvent.h */; };
                63189AE30E83A33300012E41 /* NodeRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = 63189AE20E83A33300012E41 /* NodeRareData.h */; settings = {ATTRIBUTES = (); }; };
+               6354F4C91F7AFC9400D89DF3 /* ApplicationManifestParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 6354F4C71F7AFC9400D89DF3 /* ApplicationManifestParser.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               63BD4A5F1F778E9F00438722 /* ApplicationManifest.h in Headers */ = {isa = PBXBuildFile; fileRef = 63BD4A5D1F778E9F00438722 /* ApplicationManifest.h */; settings = {ATTRIBUTES = (Private, ); }; };
                63D7B32D0E78CD3F00F7617C /* NodeRenderStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 63D7B32C0E78CD3F00F7617C /* NodeRenderStyle.h */; settings = {ATTRIBUTES = (Private, ); }; };
                63F5D4F70E8C4B7100C0BD04 /* ElementRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = 637B7ADE0E8767B800E32194 /* ElementRareData.h */; };
                650FBF2B0D9AF047008FC292 /* SVGHKernElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 650FBF280D9AF047008FC292 /* SVGHKernElement.h */; };
                62CD32571157E57C0063B0A7 /* CustomEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomEvent.h; sourceTree = "<group>"; };
                62CD32581157E57C0063B0A7 /* CustomEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CustomEvent.idl; sourceTree = "<group>"; };
                63189AE20E83A33300012E41 /* NodeRareData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NodeRareData.h; sourceTree = "<group>"; };
+               6354F4C71F7AFC9400D89DF3 /* ApplicationManifestParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ApplicationManifestParser.h; sourceTree = "<group>"; };
+               6354F4C81F7AFC9400D89DF3 /* ApplicationManifestParser.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ApplicationManifestParser.cpp; sourceTree = "<group>"; };
                637B7ADE0E8767B800E32194 /* ElementRareData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementRareData.h; sourceTree = "<group>"; };
+               63BD4A5D1F778E9F00438722 /* ApplicationManifest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ApplicationManifest.h; sourceTree = "<group>"; };
                63D7B32C0E78CD3F00F7617C /* NodeRenderStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NodeRenderStyle.h; sourceTree = "<group>"; };
                650FBF270D9AF046008FC292 /* SVGHKernElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGHKernElement.cpp; sourceTree = "<group>"; };
                650FBF280D9AF047008FC292 /* SVGHKernElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGHKernElement.h; sourceTree = "<group>"; };
                        path = plugins;
                        sourceTree = "<group>";
                };
+               63BD4A5C1F778E8400438722 /* applicationmanifest */ = {
+                       isa = PBXGroup;
+                       children = (
+                               63BD4A5D1F778E9F00438722 /* ApplicationManifest.h */,
+                               6354F4C81F7AFC9400D89DF3 /* ApplicationManifestParser.cpp */,
+                               6354F4C71F7AFC9400D89DF3 /* ApplicationManifestParser.h */,
+                       );
+                       path = applicationmanifest;
+                       sourceTree = "<group>";
+               };
                656580EC09D12B20000E61D7 /* Derived Sources */ = {
                        isa = PBXGroup;
                        children = (
                        children = (
                                CE26169D187E6554007955F3 /* airplay */,
                                1A58E8611D19D37300C0EA73 /* applepay */,
+                               63BD4A5C1F778E8400438722 /* applicationmanifest */,
                                832150791F27E96B0095B136 /* beacon */,
                                41380C1E1F34366000155FDA /* cache */,
                                57C7A6881E56946D00C67D71 /* credentials */,
                                24F54EAD101FE914000AE741 /* ApplicationCacheHost.h in Headers */,
                                1A8F6BC10DB55CDC001DB794 /* ApplicationCacheResource.h in Headers */,
                                1A2AAC590DC2A3B100A20D9A /* ApplicationCacheStorage.h in Headers */,
+                               63BD4A5F1F778E9F00438722 /* ApplicationManifest.h in Headers */,
+                               6354F4C91F7AFC9400D89DF3 /* ApplicationManifestParser.h in Headers */,
                                9B417064125662B3006B28FC /* ApplyBlockElementCommand.h in Headers */,
                                93309DD9099E64920056E581 /* ApplyStyleCommand.h in Headers */,
                                512DD8F60D91E6AF000F89EE /* Archive.h in Headers */,
index ab80d0c..44aef51 100644 (file)
     {
         "name": "Web App Manifest",
         "status": {
-            "status": "Under Consideration",
+            "status": "In Development",
             "enabled-by-default": false
         },
         "url": "https://www.w3.org/TR/appmanifest/",
index 29d916e..93acba5 100644 (file)
@@ -1,3 +1,13 @@
+2017-12-04  David Quesada  <david_quesada@apple.com>
+
+        Add a class for parsing application manifests
+        https://bugs.webkit.org/show_bug.cgi?id=177973
+        rdar://problem/34747949
+
+        Reviewed by Geoffrey Garen.
+
+        * Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLICATION_MANIFEST feature flag.
+
 2017-12-04  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Rename a static helper in TouchBarMenuItemData.cpp to match style guidelines.
index f5a766b..7c555dd 100644 (file)
@@ -66,6 +66,7 @@ ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_ = $(ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_NO);
 ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_NO = ENABLE_APPLE_PAY_SESSION_V3;
 ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_YES = ;
 
+ENABLE_APPLICATION_MANIFEST = ;
 ENABLE_ATTACHMENT_ELEMENT = ENABLE_ATTACHMENT_ELEMENT;
 ENABLE_AVF_CAPTIONS = ENABLE_AVF_CAPTIONS;
 ENABLE_CACHE_PARTITIONING = ENABLE_CACHE_PARTITIONING;
@@ -250,4 +251,4 @@ ENABLE_DATA_INTERACTION_iphonesimulator = ENABLE_DATA_INTERACTION;
 ENABLE_DATA_INTERACTION[sdk=iphoneos10*] = ;
 ENABLE_DATA_INTERACTION[sdk=iphonesimulator10*] = ;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_ALTERNATIVE_PRESENTATION_BUTTON_ELEMENT) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_ASYNC_ITERATION) $(ENABLE_FULLSCREEN_API) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_ALTERNATIVE_PRESENTATION_BUTTON_ELEMENT) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_ASYNC_ITERATION) $(ENABLE_FULLSCREEN_API) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
\ No newline at end of file
index 8f8d59c..b4105ef 100644 (file)
@@ -1,3 +1,13 @@
+2017-12-04  David Quesada  <david_quesada@apple.com>
+
+        Add a class for parsing application manifests
+        https://bugs.webkit.org/show_bug.cgi?id=177973
+        rdar://problem/34747949
+
+        Reviewed by Geoffrey Garen.
+
+        * Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLICATION_MANIFEST feature flag.
+
 2017-11-30  Stephan Szabo  <stephan.szabo@sony.com>
 
         Make LegacyCustomProtocolManager optional for network process
index f5a766b..7c555dd 100644 (file)
@@ -66,6 +66,7 @@ ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_ = $(ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_NO);
 ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_NO = ENABLE_APPLE_PAY_SESSION_V3;
 ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_YES = ;
 
+ENABLE_APPLICATION_MANIFEST = ;
 ENABLE_ATTACHMENT_ELEMENT = ENABLE_ATTACHMENT_ELEMENT;
 ENABLE_AVF_CAPTIONS = ENABLE_AVF_CAPTIONS;
 ENABLE_CACHE_PARTITIONING = ENABLE_CACHE_PARTITIONING;
@@ -250,4 +251,4 @@ ENABLE_DATA_INTERACTION_iphonesimulator = ENABLE_DATA_INTERACTION;
 ENABLE_DATA_INTERACTION[sdk=iphoneos10*] = ;
 ENABLE_DATA_INTERACTION[sdk=iphonesimulator10*] = ;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_ALTERNATIVE_PRESENTATION_BUTTON_ELEMENT) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_ASYNC_ITERATION) $(ENABLE_FULLSCREEN_API) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_ALTERNATIVE_PRESENTATION_BUTTON_ELEMENT) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_ASYNC_ITERATION) $(ENABLE_FULLSCREEN_API) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
\ No newline at end of file
index de20a0d..e0c22c0 100644 (file)
@@ -1,3 +1,29 @@
+2017-12-04  David Quesada  <david_quesada@apple.com>
+
+        Add a class for parsing application manifests
+        https://bugs.webkit.org/show_bug.cgi?id=177973
+        rdar://problem/34747949
+
+        Reviewed by Geoffrey Garen.
+
+        Add basic unit tests for ApplicationManifestParser. For each of the implemented top-level properties,
+        attempt to parse manifests with varying types of valid and invalid data to ensure the resulting
+        ApplicationManifest is configured with the appropriate values per the spec.
+
+        * TestWebKitAPI/Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLICATION_MANIFEST feature flag.
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebCore/ApplicationManifestParser.cpp: Added.
+        (ApplicationManifestParserTest::SetUp):
+        (ApplicationManifestParserTest::parseString):
+        (ApplicationManifestParserTest::parseTopLevelProperty):
+        (ApplicationManifestParserTest::testStartURL):
+        (ApplicationManifestParserTest::testName):
+        (ApplicationManifestParserTest::testDescription):
+        (ApplicationManifestParserTest::testShortName):
+        (ApplicationManifestParserTest::testScope):
+        (assertManifestHasDefaultValues):
+        (TEST_F):
+
 2017-12-04  Aakash Jain  <aakash_jain@apple.com>
 
         Add docstring in EarlyWarningSystemTask to explain return values
index f5a766b..7c555dd 100644 (file)
@@ -66,6 +66,7 @@ ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_ = $(ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_NO);
 ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_NO = ENABLE_APPLE_PAY_SESSION_V3;
 ENABLE_APPLE_PAY_SESSION_V3_IF_NOT_YES = ;
 
+ENABLE_APPLICATION_MANIFEST = ;
 ENABLE_ATTACHMENT_ELEMENT = ENABLE_ATTACHMENT_ELEMENT;
 ENABLE_AVF_CAPTIONS = ENABLE_AVF_CAPTIONS;
 ENABLE_CACHE_PARTITIONING = ENABLE_CACHE_PARTITIONING;
@@ -250,4 +251,4 @@ ENABLE_DATA_INTERACTION_iphonesimulator = ENABLE_DATA_INTERACTION;
 ENABLE_DATA_INTERACTION[sdk=iphoneos10*] = ;
 ENABLE_DATA_INTERACTION[sdk=iphonesimulator10*] = ;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_ALTERNATIVE_PRESENTATION_BUTTON_ELEMENT) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_ASYNC_ITERATION) $(ENABLE_FULLSCREEN_API) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_ALTERNATIVE_PRESENTATION_BUTTON_ELEMENT) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS_ANIMATIONS_LEVEL_2) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS3_TEXT) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FAST_JIT_PERMISSIONS) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FTL_JIT) $(ENABLE_ASYNC_ITERATION) $(ENABLE_FULLSCREEN_API) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_INTL) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_JIT) $(ENABLE_KEYBOARD_KEY_ATTRIBUTE) $(ENABLE_KEYBOARD_CODE_ATTRIBUTE) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_MAC_VIDEO_TOOLBOX) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_RTC) $(ENABLE_WEBASSEMBLY) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
\ No newline at end of file
index c52d7e9..8c6a717 100644 (file)
                5E4B1D2E1D404C6100053621 /* WKScrollViewDelegateCrash.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5E4B1D2C1D404C6100053621 /* WKScrollViewDelegateCrash.mm */; };
                631EFFF61E7B5E8D00D2EBB8 /* Geolocation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 631EFFF51E7B5E8D00D2EBB8 /* Geolocation.mm */; };
                634910E01E9D3FF300880309 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 634910DF1E9D3FF300880309 /* CoreLocation.framework */; };
+               6354F4D11F7C3AB500D89DF3 /* ApplicationManifestParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6354F4D01F7C3AB500D89DF3 /* ApplicationManifestParser.cpp */; };
                6356FB221EC4E0BA0044BF18 /* VisibleContentRect.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6356FB211EC4E0BA0044BF18 /* VisibleContentRect.mm */; };
                636353A71E98665D0009F8AF /* GeolocationGetCurrentPositionResult.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 636353A61E9861940009F8AF /* GeolocationGetCurrentPositionResult.html */; };
                6BFD294C1D5E6C1D008EC968 /* HashCountedSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A38D7E51C752D5F004F157D /* HashCountedSet.cpp */; };
                5E4B1D2C1D404C6100053621 /* WKScrollViewDelegateCrash.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKScrollViewDelegateCrash.mm; path = ../ios/WKScrollViewDelegateCrash.mm; sourceTree = "<group>"; };
                631EFFF51E7B5E8D00D2EBB8 /* Geolocation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Geolocation.mm; sourceTree = "<group>"; };
                634910DF1E9D3FF300880309 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
+               6354F4D01F7C3AB500D89DF3 /* ApplicationManifestParser.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ApplicationManifestParser.cpp; sourceTree = "<group>"; };
                6356FB211EC4E0BA0044BF18 /* VisibleContentRect.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = VisibleContentRect.mm; sourceTree = "<group>"; };
                636353A61E9861940009F8AF /* GeolocationGetCurrentPositionResult.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = GeolocationGetCurrentPositionResult.html; sourceTree = "<group>"; };
                751B05D51F8EAC1A0028A09E /* DatabaseTrackerTest.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = DatabaseTrackerTest.mm; sourceTree = "<group>"; };
                                A1EC11851F4253D900D0146E /* ios */,
                                3162AE9A1E6F2F8F000E4DBC /* mac */,
                                7A909A6F1D877475007E10F8 /* AffineTransform.cpp */,
+                               6354F4D01F7C3AB500D89DF3 /* ApplicationManifestParser.cpp */,
                                93A720E518F1A0E800A848E1 /* CalculationValue.cpp */,
                                07C046C91E42573E007201E7 /* CARingBuffer.cpp */,
                                7C3965051CDD74F90094DBB8 /* Color.cpp */,
                                7A909A7D1D877480007E10F8 /* AffineTransform.cpp in Sources */,
                                A1DF74321C41B65800A2F4D0 /* AlwaysRevalidatedURLSchemes.mm in Sources */,
                                2DE71AFE1D49C0BD00904094 /* AnimatedResize.mm in Sources */,
+                               6354F4D11F7C3AB500D89DF3 /* ApplicationManifestParser.cpp in Sources */,
                                7CCE7EB41A411A7E00447C4C /* AttributedString.mm in Sources */,
                                CDC8E48D1BC5CB4500594FEC /* AudioSessionCategoryIOS.mm in Sources */,
                                7C83E0B91D0A64F100FEBCF3 /* AutoLayoutIntegration.mm in Sources */,
diff --git a/Tools/TestWebKitAPI/Tests/WebCore/ApplicationManifestParser.cpp b/Tools/TestWebKitAPI/Tests/WebCore/ApplicationManifestParser.cpp
new file mode 100644 (file)
index 0000000..749b33e
--- /dev/null
@@ -0,0 +1,248 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(APPLICATION_MANIFEST)
+
+#include <JavaScriptCore/InitializeThreading.h>
+#include <WebCore/ApplicationManifestParser.h>
+#include <wtf/RunLoop.h>
+
+using namespace WTF;
+using namespace WebCore;
+
+class ApplicationManifestParserTest : public testing::Test {
+public:
+    URL m_manifestURL;
+    URL m_documentURL;
+
+    virtual void SetUp()
+    {
+        JSC::initializeThreading();
+        RunLoop::initializeMainRunLoop();
+
+        m_manifestURL = { { }, "https://example.com/manifest.json" };
+        m_documentURL = { { }, "https://example.com/" };
+    }
+
+    ApplicationManifest parseString(const String& data)
+    {
+        return ApplicationManifestParser::parse(data, m_manifestURL, m_documentURL);
+    }
+
+    ApplicationManifest parseTopLevelProperty(const String& key, const String& value)
+    {
+        String manifestContent = "{ \"" + key + "\" : " + value + " }";
+        return parseString(manifestContent);
+    }
+
+    void testStartURL(const String& rawJSON, const String& expectedValue)
+    {
+        testStartURL(rawJSON, { { }, expectedValue });
+    }
+
+    void testStartURL(const String& rawJSON, const URL& expectedValue)
+    {
+        auto manifest = parseTopLevelProperty("start_url", rawJSON);
+        auto value = manifest.startURL;
+        EXPECT_STREQ(expectedValue.string().utf8().data(), value.string().utf8().data());
+    }
+
+    void testName(const String& rawJSON, const String& expectedValue)
+    {
+        auto manifest = parseTopLevelProperty("name", rawJSON);
+        auto value = manifest.name;
+        EXPECT_STREQ(expectedValue.utf8().data(), value.utf8().data());
+    }
+
+    void testDescription(const String& rawJSON, const String& expectedValue)
+    {
+        auto manifest = parseTopLevelProperty("description", rawJSON);
+        auto value = manifest.description;
+        EXPECT_STREQ(expectedValue.utf8().data(), value.utf8().data());
+    }
+
+    void testShortName(const String& rawJSON, const String& expectedValue)
+    {
+        auto manifest = parseTopLevelProperty("short_name", rawJSON);
+        auto value = manifest.shortName;
+        EXPECT_STREQ(expectedValue.utf8().data(), value.utf8().data());
+    }
+
+    void testScope(const String& rawJSON, const String& startURL, const String& expectedValue)
+    {
+        String manifestContent = "{ \"scope\" : " + rawJSON + ", \"start_url\" : \"" + startURL + "\" }";
+        auto manifest = parseString(manifestContent);
+        auto value = manifest.scope;
+        EXPECT_STREQ(expectedValue.utf8().data(), value.string().utf8().data());
+    }
+
+    void testScope(const String& rawJSON, const String& expectedValue)
+    {
+        testScope(rawJSON, String(), expectedValue);
+    }
+
+};
+
+static void assertManifestHasDefaultValues(const URL& manifestURL, const URL& documentURL, const ApplicationManifest& manifest)
+{
+    EXPECT_TRUE(manifest.name.isNull());
+    EXPECT_TRUE(manifest.shortName.isNull());
+    EXPECT_TRUE(manifest.description.isNull());
+    EXPECT_TRUE(manifest.scope.isEmpty());
+    EXPECT_STREQ(manifest.startURL.string().utf8().data(), documentURL.string().utf8().data());
+}
+
+TEST_F(ApplicationManifestParserTest, DefaultManifest)
+{
+    assertManifestHasDefaultValues(m_manifestURL, m_documentURL, parseString(String()));
+    assertManifestHasDefaultValues(m_manifestURL, m_documentURL, parseString(""));
+    assertManifestHasDefaultValues(m_manifestURL, m_documentURL, parseString("{ }"));
+    assertManifestHasDefaultValues(m_manifestURL, m_documentURL, parseString("This is 100% not JSON."));
+}
+
+TEST_F(ApplicationManifestParserTest, StartURL)
+{
+    m_documentURL = { { }, "https://example.com/home" };
+    m_manifestURL = { { }, "https://example.com/manifest.json" };
+
+    testStartURL("123", m_documentURL);
+    testStartURL("null", m_documentURL);
+    testStartURL("true", m_documentURL);
+    testStartURL("{ }", m_documentURL);
+    testStartURL("[ ]", m_documentURL);
+    testStartURL("[ \"http://example.com/somepage\" ]", m_documentURL);
+    testStartURL("\"\"", m_documentURL);
+    testStartURL("\"http:?\"", m_documentURL);
+
+    testStartURL("\"appstartpage\"", "https://example.com/appstartpage");
+    testStartURL("\"a/b/cdefg\"", "https://example.com/a/b/cdefg");
+
+    m_documentURL = { { }, "https://example.com/subfolder/home" };
+    m_manifestURL = { { }, "https://example.com/resources/manifest.json" };
+
+    testStartURL("\"resource-relative-to-manifest-url\"", "https://example.com/resources/resource-relative-to-manifest-url");
+    testStartURL("\"http://different-page.com/12/34\"", m_documentURL);
+
+    m_documentURL = { { }, "https://example.com/home" };
+    m_manifestURL = { { }, "https://other-domain.com/manifiest.json" };
+
+    testStartURL("\"resource_on_other_domain\"", m_documentURL);
+    testStartURL("\"http://example.com/scheme-does-not-match-document\"", m_documentURL);
+    testStartURL("\"https://example.com:123/port-does-not-match-document", m_documentURL);
+    testStartURL("\"https://example.com/page2\"", "https://example.com/page2");
+    testStartURL("\"//example.com/page2\"", "https://example.com/page2");
+
+    m_documentURL = { { }, "https://example.com/a" };
+    m_manifestURL = { { }, "https://example.com/z/manifest.json" };
+
+    testStartURL("\"b/c\"", "https://example.com/z/b/c");
+    testStartURL("\"/b/c\"", "https://example.com/b/c");
+    testStartURL("\"?query\"", "https://example.com/z/manifest.json?query");
+
+    m_documentURL = { { }, "https://example.com/dir1/dir2/page1" };
+    m_manifestURL = { { }, "https://example.com/dir3/manifest.json" };
+
+    testStartURL("\"../page2\"", "https://example.com/page2");
+}
+
+TEST_F(ApplicationManifestParserTest, Name)
+{
+    testName("123", String());
+    testName("null", String());
+    testName("true", String());
+    testName("{ }", String());
+    testName("[ ]", String());
+    testName("\"\"", "");
+    testName("\"example\"", "example");
+    testName("\"\\t Hello\\nWorld\\t \"", "Hello\nWorld");
+}
+
+TEST_F(ApplicationManifestParserTest, Description)
+{
+    testDescription("123", String());
+    testDescription("null", String());
+    testDescription("true", String());
+    testDescription("{ }", String());
+    testDescription("[ ]", String());
+    testDescription("\"\"", "");
+    testDescription("\"example\"", "example");
+    testDescription("\"\\t Hello\\nWorld\\t \"", "Hello\nWorld");
+}
+
+TEST_F(ApplicationManifestParserTest, ShortName)
+{
+    testShortName("123", String());
+    testShortName("null", String());
+    testShortName("true", String());
+    testShortName("{ }", String());
+    testShortName("[ ]", String());
+    testShortName("\"\"", "");
+    testShortName("\"example\"", "example");
+    testShortName("\"\\t Hello\\nWorld\\t \"", "Hello\nWorld");
+}
+
+TEST_F(ApplicationManifestParserTest, Scope)
+{
+    testScope("123", String());
+    testScope("null", String());
+    testScope("true", String());
+    testScope("{ }", String());
+    testScope("[ ]", String());
+    testScope("\"\"", String());
+
+    testScope("\"http:?\"", String());
+
+    // If scope URL is not same origin as document URL, return undefined.
+    m_documentURL = { { }, "https://example.com/home" };
+    m_manifestURL = { { }, "https://other-site.com/manifest.json" };
+    testScope("\"https://other-site.com/some-scope\"", String());
+
+    m_documentURL = { { }, "https://example.com/app/home" };
+    m_manifestURL = { { }, "https://example.com/app/manifest.json" };
+
+    // If start URL is not within scope of scope URL, return undefined
+    testScope("\"https://example.com/subdirectory\"", String());
+    testScope("\"https://example.com/app\"", "https://example.com/app");
+    testScope("\"https://example.com/APP\"", String());
+    testScope("\"https://example.com/a\"", "https://example.com/a");
+
+    m_documentURL = { { }, "https://example.com/a/b/c/index" };
+    m_manifestURL = { { }, "https://example.com/a/manifest.json" };
+
+    testScope("\"./b/c/index\"", "https://example.com/a/b/c/index");
+    testScope("\"b/somewhere-else/../c\"", "https://example.com/a/b/c");
+    testScope("\"b\"", "https://example.com/a/b");
+    testScope("\"b/\"", "https://example.com/a/b/");
+
+    m_documentURL = { { }, "https://example.com/documents/home" };
+    m_manifestURL = { { }, "https://example.com/resources/manifest.json" };
+
+    // It's fine if the document URL or manifest URL aren't within the application scope - only the start URL needs to be.
+    testScope("\"https://example.com/other\"", String("https://example.com/other/start-url"), "https://example.com/other");
+}
+
+#endif