Changeset 221778 in webkit
- Timestamp:
- Sep 7, 2017 11:21:29 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r221773 r221778 1 2017-09-07 Joseph Pecoraro <pecoraro@apple.com> 2 3 WebKit should claim that it can show responses for a broader range of JSON MIMETypes 4 https://bugs.webkit.org/show_bug.cgi?id=176252 5 <rdar://problem/34212885> 6 7 Reviewed by Ryosuke Niwa. 8 9 * platform/MIMETypeRegistry.h: 10 * platform/MIMETypeRegistry.cpp: 11 (WebCore::MIMETypeRegistry::canShowMIMEType): 12 Extend this to support JavaScript and JSON MIMETypes that WebKit 13 knows how to treat as text. 14 1 15 2017-09-07 Andy Estes <aestes@apple.com> 2 16 -
trunk/Source/WebCore/platform/MIMETypeRegistry.cpp
r219595 r221778 103 103 // But Mail relies on at least image/tif reported as being supported (should be image/tiff). 104 104 // This can be removed when Mail addresses: 105 // <rdar://problem/7879510> Mail should use standard image mimetypes 105 // <rdar://problem/7879510> Mail should use standard image mimetypes 106 106 // and we fix sniffing so that it corrects items such as image/jpg -> image/jpeg. 107 107 static const char* const malformedMIMETypes[] = { … … 638 638 { 639 639 if (isSupportedImageMIMEType(mimeType) || isSupportedNonImageMIMEType(mimeType) || isSupportedMediaMIMEType(mimeType)) 640 return true; 641 642 if (isSupportedJavaScriptMIMEType(mimeType) || isSupportedJSONMIMEType(mimeType)) 640 643 return true; 641 644 -
trunk/Source/WebCore/platform/MIMETypeRegistry.h
r217247 r221778 59 59 60 60 // Check to see if a MIME type is suitable for being loaded as a JavaScript or JSON resource. 61 static bool isSupportedJavaScriptMIMEType(const String& mimeType);62 static bool isSupportedJSONMIMEType(const String& mimeType);61 WEBCORE_EXPORT static bool isSupportedJavaScriptMIMEType(const String& mimeType); 62 WEBCORE_EXPORT static bool isSupportedJSONMIMEType(const String& mimeType); 63 63 64 64 // Check to see if a MIME type is suitable for being loaded as a style sheet. … … 69 69 70 70 // Check to see if a non-image MIME type is suitable for being loaded as a 71 // document in a frame. Includes supported JavaScriptMIME types.71 // document in a frame. Does not include supported JavaScript and JSON MIME types. 72 72 WEBCORE_EXPORT static bool isSupportedNonImageMIMEType(const String& mimeType); 73 73 … … 89 89 90 90 // Check to see if a MIME type is suitable for being shown inside a page. 91 // Returns true if any of isSupportedImageMIMEType(), isSupportedNonImageMIMEType(), or 92 // isSupportedMediaMIMEType() returns true or if the given MIME type begins with 93 // "text/" and isUnsupportedTextMIMEType() returns false. 91 // Returns true if any of isSupportedImageMIMEType(), isSupportedNonImageMIMEType(), 92 // isSupportedMediaMIMEType(), isSupportedJavaScriptMIMEType(), isSupportedJSONMIMEType(), 93 // returns true or if the given MIME type begins with "text/" and 94 // isUnsupportedTextMIMEType() returns false. 94 95 WEBCORE_EXPORT static bool canShowMIMEType(const String& mimeType); 95 96 -
trunk/Tools/ChangeLog
r221777 r221778 1 2017-09-07 Joseph Pecoraro <pecoraro@apple.com> 2 3 WebKit should claim that it can show responses for a broader range of JSON MIMETypes 4 https://bugs.webkit.org/show_bug.cgi?id=176252 5 <rdar://problem/34212885> 6 7 Reviewed by Ryosuke Niwa. 8 9 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 10 * TestWebKitAPI/Tests/WebKitCocoa/WKNavigationResponse.mm: Added. 11 (-[WKNavigationResponseTestNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]): 12 (-[WKNavigationResponseTestNavigationDelegate webView:didCommitNavigation:]): 13 (-[WKNavigationResponseTestSchemeHandler webView:startURLSchemeTask:]): 14 (-[WKNavigationResponseTestSchemeHandler webView:stopURLSchemeTask:]): 15 (TEST): 16 Test for canShowMIMEType with multiple JSON mime types and a garbage mime type. 17 Previously canShowMIMEType would have been YES for "application/json" but 18 NO for "application/vnd.api+json". Now it shows YES for both. 19 20 * TestWebKitAPI/PlatformGTK.cmake: 21 * TestWebKitAPI/PlatformWPE.cmake: 22 * TestWebKitAPI/PlatformWin.cmake: 23 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 24 * TestWebKitAPI/Tests/WebCore/MIMETypeRegistry.cpp: Added. 25 (TestWebKitAPI::TEST): 26 Tests for MIMETypeRegistry's dynamic JSON mime type detection. 27 1 28 2017-09-07 Matthew Stewart <matthew_r_stewart@apple.com> 2 29 -
trunk/Tools/TestWebKitAPI/PlatformGTK.cmake
r221219 r221778 137 137 ${TESTWEBKITAPI_DIR}/Tests/WebCore/HTMLParserIdioms.cpp 138 138 ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp 139 ${TESTWEBKITAPI_DIR}/Tests/WebCore/MIMETypeRegistry.cpp 139 140 ${TESTWEBKITAPI_DIR}/Tests/WebCore/PublicSuffix.cpp 140 141 ${TESTWEBKITAPI_DIR}/Tests/WebCore/SecurityOrigin.cpp -
trunk/Tools/TestWebKitAPI/PlatformWPE.cmake
r221069 r221778 46 46 ${TESTWEBKITAPI_DIR}/Tests/WebCore/HTMLParserIdioms.cpp 47 47 ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp 48 ${TESTWEBKITAPI_DIR}/Tests/WebCore/MIMETypeRegistry.cpp 48 49 ${TESTWEBKITAPI_DIR}/Tests/WebCore/URL.cpp 49 50 ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBuffer.cpp -
trunk/Tools/TestWebKitAPI/PlatformWin.cmake
r221463 r221778 58 58 ${TESTWEBKITAPI_DIR}/Tests/WebCore/IntSize.cpp 59 59 ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp 60 ${TESTWEBKITAPI_DIR}/Tests/WebCore/MIMETypeRegistry.cpp 60 61 ${TESTWEBKITAPI_DIR}/Tests/WebCore/ParsedContentRange.cpp 61 62 ${TESTWEBKITAPI_DIR}/Tests/WebCore/SecurityOrigin.cpp -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r221751 r221778 570 570 A57D54F61F3395D000A97AA7 /* Logger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A57D54F41F3395D000A97AA7 /* Logger.cpp */; }; 571 571 A57D54F91F3397B400A97AA7 /* LifecycleLogger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A57D54F71F3397B400A97AA7 /* LifecycleLogger.cpp */; }; 572 A5A729F11F622AA700DE5A28 /* WKNavigationResponse.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5A729F01F622A9A00DE5A28 /* WKNavigationResponse.mm */; }; 573 A5B149DE1F5A19EA00C6DAFF /* MIMETypeRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5B149DD1F5A19DC00C6DAFF /* MIMETypeRegistry.cpp */; }; 572 574 A5E2027515B21F6E00C13E14 /* WindowlessWebViewWithMedia.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = A5E2027015B2180600C13E14 /* WindowlessWebViewWithMedia.html */; }; 573 575 AD57AC201DA7465000FF1BDE /* DidRemoveFrameFromHiearchyInPageCache_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD57AC1E1DA7464D00FF1BDE /* DidRemoveFrameFromHiearchyInPageCache_Bundle.cpp */; }; … … 1513 1515 A57D54F71F3397B400A97AA7 /* LifecycleLogger.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LifecycleLogger.cpp; sourceTree = "<group>"; }; 1514 1516 A57D54F81F3397B400A97AA7 /* LifecycleLogger.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LifecycleLogger.h; sourceTree = "<group>"; }; 1517 A5A729F01F622A9A00DE5A28 /* WKNavigationResponse.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKNavigationResponse.mm; sourceTree = "<group>"; }; 1518 A5B149DD1F5A19DC00C6DAFF /* MIMETypeRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MIMETypeRegistry.cpp; sourceTree = "<group>"; }; 1515 1519 A5E2027015B2180600C13E14 /* WindowlessWebViewWithMedia.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = WindowlessWebViewWithMedia.html; sourceTree = "<group>"; }; 1516 1520 A5E2027215B2181900C13E14 /* WindowlessWebViewWithMedia.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WindowlessWebViewWithMedia.mm; sourceTree = "<group>"; }; … … 1991 1995 370CE2291F57343400E7410B /* WKContentViewTargetForAction.mm */, 1992 1996 51D124971E763AF8002B2820 /* WKHTTPCookieStore.mm */, 1997 A5A729F01F622A9A00DE5A28 /* WKNavigationResponse.mm */, 1993 1998 375E0E151D66674400EFEC2C /* WKNSNumber.mm */, 1994 1999 37B47E2E1D64E7CA005F4EFF /* WKObject.mm */, … … 2068 2073 14464012167A8305000BD218 /* LayoutUnit.cpp */, 2069 2074 076E507E1F45031E006E9F5A /* Logging.cpp */, 2075 A5B149DD1F5A19DC00C6DAFF /* MIMETypeRegistry.cpp */, 2070 2076 CD225C071C45A69200140761 /* ParsedContentRange.cpp */, 2071 2077 CDCFA7A91E45122F00C2433D /* SampleMap.cpp */, … … 3265 3271 7C83E0B71D0A64B800FEBCF3 /* MenuTypesForMouseEvents.cpp in Sources */, 3266 3272 5C0BF8941DD599C900B00328 /* MenuTypesForMouseEvents.mm in Sources */, 3273 A5B149DE1F5A19EA00C6DAFF /* MIMETypeRegistry.cpp in Sources */, 3267 3274 51CD1C6C1B38CE4300142CA5 /* ModalAlerts.mm in Sources */, 3268 3275 7C83E0B61D0A64B300FEBCF3 /* ModalAlertsSPI.cpp in Sources */, … … 3401 3408 51D124981E763B02002B2820 /* WKHTTPCookieStore.mm in Sources */, 3402 3409 7CCE7F1D1A411AE600447C4C /* WKImageCreateCGImageCrash.cpp in Sources */, 3410 A5A729F11F622AA700DE5A28 /* WKNavigationResponse.mm in Sources */, 3403 3411 375E0E171D66674400EFEC2C /* WKNSNumber.mm in Sources */, 3404 3412 37B47E301D64E7CA005F4EFF /* WKObject.mm in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.