Unreviewed, fix iOS build with recent SDKs.
[WebKit-https.git] / Source / WebKit / ChangeLog
index 27041b6..51dc8da 100644 (file)
@@ -1,3 +1,481 @@
+2019-04-20  Chris Dumez  <cdumez@apple.com>
+
+        Unreviewed, fix iOS build with recent SDKs.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (deviceOrientation):
+        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
+        (-[WKFullScreenViewController initWithWebView:]):
+        (-[WKFullScreenViewController viewWillTransitionToSize:withTransitionCoordinator:]):
+        (-[WKFullScreenViewController _statusBarFrameDidChange:]):
+
+2019-04-19  John Wilander  <wilander@apple.com>
+
+        Disable Ad Click Attribution in ephemeral sessions and make sure conversion requests use an ephemeral, stateless session
+        https://bugs.webkit.org/show_bug.cgi?id=197108
+        <rdar://problem/49918702>
+
+        Reviewed by Alex Christensen.
+
+        This patch introduces a new NSURLSession in WebKit::NetworkSessionCocoa called
+        m_ephemeralStatelessCookielessSession. As its name implies, it's ephemeral, 
+        stateless, and has a NSHTTPCookieAcceptPolicyNever cookie policy.
+
+        The new session can be invoked with the new enum value of
+        WebCore::StoredCredentialsPolicy called EphemeralStatelessCookieless.
+
+        WebKit::AdClickAttributionManager::fireConversionRequest() makes use of
+        the new session for its conversion requests.
+
+        This patch also makes sure that Ad Click Attributions cannot be stored in
+        ephemeral sessions and already stored attributions cannot be converted in
+        ephemeral sessions.
+
+        * NetworkProcess/AdClickAttributionManager.cpp:
+        (WebKit::AdClickAttributionManager::fireConversionRequest):
+        (WebKit::AdClickAttributionManager::toString const):
+        * NetworkProcess/NetworkLoadChecker.h:
+        * NetworkProcess/NetworkProcess.h:
+        * NetworkProcess/NetworkProcess.messages.in:
+        * NetworkProcess/NetworkResourceLoader.cpp:
+        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
+        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
+        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
+            Calls NetworkSessionCocoa::initializeEphemeralStatelessCookielessSession() lazily.
+        (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
+        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
+        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (WebKit::NetworkSessionCocoa::initializeEphemeralStatelessCookielessSession):
+        (WebKit::NetworkSessionCocoa::invalidateAndCancel):
+        * Shared/WebCoreArgumentCoders.h:
+
+2019-04-19  Daniel Bates  <dabates@apple.com>
+
+        Use RetainPtr and rename +autocorrectionRectsWithRects:lastRect: to +autocorrectionRectsWithFirstCGRect:lastCGRect:
+        https://bugs.webkit.org/show_bug.cgi?id=197122
+
+        Reviewed by Wenson Hsieh.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]): Renamed; formerly named +autocorrectionRectsWithRects:lastRect:.
+        While I am here use else-branch to initialize firstRect and lastRect just to make the code closer to the optimal
+        assembly. Also use Vector::{isEmpty, first, last}() instead of using the index operator overload and size() for
+        emptiness checks. The code is more readable at the cost being ever so slightly slower (due to the overflow checks
+        in first() and last()), but this code is likely not hot enough for it to matter.
+        (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]): Update for renaming.
+        (+[WKAutocorrectionRects autocorrectionRectsWithFirstCGRect:lastCGRect:]): Ditto.
+        (+[WKAutocorrectionRects autocorrectionRectsWithRects:lastRect:]): Deleted.
+
+2019-04-19  Daniel Bates  <dabates@apple.com>
+
+        -[WKAutocorrectionContext emptyAutocorrectionContext:] generates invalid empty context
+        https://bugs.webkit.org/show_bug.cgi?id=197119
+
+        Reviewed by Wenson Hsieh.
+
+        Use the existing EditingRange type to represent the location and length of the marked text
+        range for an autocorrection instead of managing integers. This type avoid the need to handle
+        the special case for an empty range represented as NSMakeRange(NSNotFound, 0). Currently
+        WKAutocorrectionContext incorrectly represents the empty range as NSMakeRange(WTF::notFound, 0).
+
+        While I am here, simplify the existing WebAutocorrectionContext encoder/decoder code and rename
+        +[WKAutocorrectionContext autocorrectionContextWithContext:] to +autocorrectionContextWithWebContext
+        to better reflect the expected source of the conversion: a Web-type.
+
+        * Shared/ios/WebAutocorrectionContext.h:
+        (WebKit::WebAutocorrectionContext::encode const): Reformat while I am here to make this logic easy
+        to amend without losing SVN history.
+        (WebKit::WebAutocorrectionContext::decode): Simplify the code while I am here.
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _handleAutocorrectionContext:]): Update for renaming.
+        (+[WKAutocorrectionContext emptyAutocorrectionContext]): Update for renaming.
+        (+[WKAutocorrectionContext autocorrectionContextWithWebContext:]): Renamed; formerly named autocorrectionContextWithContext.
+        (+[WKAutocorrectionContext autocorrectionContextWithContext:]): Deleted.
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::autocorrectionContext): Update to make use of EditingRange. Also instantiate
+        the struct and return it, initializing its fields individually instead of using the constructor to
+        make this code less error prone. It's easy to introduce an error with the constructor notation when
+        amending the the struct because so many of the arguments are of the same data type. Individually
+        initializing the struct fields makes it less likely for an ordering mistake to be introduced.
+
+2019-04-19  Dean Jackson  <dino@apple.com>
+
+        Add more _WKElementActionTypes and provide API to create with custom types
+        https://bugs.webkit.org/show_bug.cgi?id=197117
+        <rdar://problem/50059548>
+
+        Reviewed by Tim Horton.
+
+        We were missing a few obvious types that are well-known
+        browser actions, and/or should be visible in share sheets.
+        Also, clean up the API for constructing new types.
+
+        * UIProcess/API/Cocoa/_WKElementAction.h: Add new types for opening
+        in new tabs, windows and downloading.
+        * UIProcess/API/Cocoa/_WKElementAction.mm:
+        (+[_WKElementAction elementActionWithType:title:actionHandler:]): New constructor
+        with type, title and action.
+        (+[_WKElementAction elementActionWithType:]): Call new method.
+
+2019-04-18  Daniel Bates  <dabates@apple.com>
+
+        Use existing KeyEventCodesIOS constants instead of duplicating them
+        https://bugs.webkit.org/show_bug.cgi?id=197081
+
+        Rubber-stamped by Wenson Hsieh.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _interpretKeyEvent:isCharEvent:]): While I am here, remove the case for the space key
+        as it is identical to the default switch case.
+
+2019-04-19  Keith Rollin  <krollin@apple.com>
+
+        Add postprocess-header-rule scripts
+        https://bugs.webkit.org/show_bug.cgi?id=197072
+        <rdar://problem/50027299>
+
+        Reviewed by Brent Fulgham.
+
+        Several projects have post-processing build phases where exported
+        headers are tweaked after they've been copied. This post-processing is
+        performed via scripts called postprocess-headers.sh. For reasons
+        related to XCBuild, we are now transitioning to a build process where
+        the post-processing is performed at the same time as the
+        exporting/copying. To support this process, add similar scripts named
+        postprocess-header-rule, which are geared towards processing a single
+        file at a time rather than all exported files at once. Also add a
+        build rule that makes use of these scripts. These scripts and build
+        rules are not used at the moment; they will come into use in an
+        imminent patch.
+
+        Note that I've named these postprocess-header-rule rather than
+        postprocess-header-rule.sh. Scripts in Tools/Scripts do not have
+        suffixes indicating how the tool is implemented. Scripts in
+        per-project Scripts folders appear to be mixed regarding the use of
+        suffixes. I'm opting here to follow the Tools/Scripts convention, with
+        the expectation that over time we completely standardize on that.
+
+        * Scripts/postprocess-header-rule: Added.
+        * WebKit.xcodeproj/project.pbxproj:
+
+2019-04-19  Brady Eidson  <beidson@apple.com>
+
+        Deprecate WebKit2 plug-in support.
+        <rdar://problem/43812306> and https://bugs.webkit.org/show_bug.cgi?id=197080
+
+        Reviewed by Andy Estes.
+
+        * UIProcess/API/Cocoa/WKPreferences.h:
+        * UIProcess/API/Cocoa/WKPreferences.mm:
+        (-[WKPreferences encodeWithCoder:]):
+        (-[WKPreferences initWithCoder:]):
+        (-[WKPreferences javaEnabled]):
+        (-[WKPreferences setJavaEnabled:]):
+        (-[WKPreferences plugInsEnabled]):
+        (-[WKPreferences setPlugInsEnabled:]):
+
+2019-04-19  Chris Dumez  <cdumez@apple.com>
+
+        Minor PSON release logging improvements
+        https://bugs.webkit.org/show_bug.cgi?id=197104
+
+        Reviewed by Darin Adler.
+
+        * UIProcess/SuspendedPageProxy.cpp:
+        (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::continueNavigationInNewProcess):
+
+2019-04-19  Tim Horton  <timothy_horton@apple.com>
+
+        YouTube and Twitter embeds don't load in News
+        https://bugs.webkit.org/show_bug.cgi?id=197111
+        <rdar://problem/50010081>
+
+        Reviewed by Timothy Hatcher.
+
+        * WebProcess/com.apple.WebProcess.sb.in:
+        Adjust this sandbox exception to include both platforms.
+
+2019-04-19  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        [iOS] Add quirks to disable autocorrection and autocapitalization in hidden editable areas on some websites
+        https://bugs.webkit.org/show_bug.cgi?id=197102
+        <rdar://problem/49864669>
+
+        Reviewed by Ryosuke Niwa.
+
+        If the quirk for disabling autocorrection and autocapitalization in hidden editable areas is active, then check
+        whether the focused element is hidden, and turn off autocorrection and autocapitalization if needed.
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::getFocusedElementInformation):
+
+2019-04-19  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r244447.
+        https://bugs.webkit.org/show_bug.cgi?id=197103
+
+        Caused build failures with Internal and Opensource builders
+        (Requested by ShawnRoberts on #webkit).
+
+        Reverted changeset:
+
+        "Deprecate WebKit2 plug-in support."
+        https://bugs.webkit.org/show_bug.cgi?id=197080
+        https://trac.webkit.org/changeset/244447
+
+2019-04-18  Brady Eidson  <beidson@apple.com>
+
+        Deprecate WebKit2 plug-in support.
+        <rdar://problem/43812306> and https://bugs.webkit.org/show_bug.cgi?id=197080
+
+        Reviewed by Andy Estes.
+
+        * UIProcess/API/Cocoa/WKPreferences.h:
+        * UIProcess/API/Cocoa/WKPreferences.mm:
+        (-[WKPreferences encodeWithCoder:]):
+        (-[WKPreferences initWithCoder:]):
+        (-[WKPreferences javaEnabled]):
+        (-[WKPreferences setJavaEnabled:]):
+        (-[WKPreferences plugInsEnabled]):
+        (-[WKPreferences setPlugInsEnabled:]):
+
+2019-04-18  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r244434.
+        https://bugs.webkit.org/show_bug.cgi?id=197089
+
+        caused 1 API test failure (Requested by zalan on #webkit).
+
+        Reverted changeset:
+
+        "Regression (r244291): Broken API Test
+        AutoLayoutRenderingProgressRelativeOrdering"
+        https://bugs.webkit.org/show_bug.cgi?id=196948
+        https://trac.webkit.org/changeset/244434
+
+2019-04-18  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Add new compatibility mode API on WKNavigation
+        https://bugs.webkit.org/show_bug.cgi?id=197069
+        <rdar://problem/50025800>
+
+        Reviewed by Tim Horton.
+
+        Adds a new property on WKNavigation.
+
+        * Shared/WebCompatibilityMode.h:
+
+        Drive-by fix: make this enum class 8 bits wide.
+
+        * UIProcess/API/APINavigation.h:
+        (API::Navigation::setEffectiveCompatibilityMode):
+        (API::Navigation::effectiveCompatibilityMode const):
+
+        Add a new member variable to API::Navigation.
+
+        * UIProcess/API/Cocoa/WKNavigation.h:
+        * UIProcess/API/Cocoa/WKNavigation.mm:
+        * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
+        * UIProcess/API/Cocoa/WKWebpagePreferencesInternal.h:
+
+        Add various hooks into WebKitAdditions.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
+
+        Set API::Navigation's effective compatibility mode.
+
+        (WebKit::WebPageProxy::effectiveCompatibilityModeAfterAdjustingPolicies):
+
+        Renamed and refactored this method to return the effective compatibility mode, chosen while adjusting website
+        policies.
+
+        (WebKit::WebPageProxy::adjustPoliciesForCompatibilityMode): Deleted.
+        * UIProcess/WebPageProxy.h:
+
+2019-04-18  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Make WebCore headers copies
+        https://bugs.webkit.org/show_bug.cgi?id=182512
+        <rdar://problem/37510435>
+
+        Reviewed by Alex Christensen.
+
+        WebCore now uses WebCore_PRIVATE_INCLUDE_DIRECTORIES for all ports. This revealed
+        problems with WebKit's usage of WebCore headers. All include directories directly
+        referencing the WebCore source tree we're removed from the CMake files. Any includes
+        of WebCore headers using "*.h" were modified to <WebCore/*.h>
+
+        Removed generation of forwarding headers for WebCore using the perl script.
+
+        * CMakeLists.txt:
+        * NetworkProcess/curl/NetworkDataTaskCurl.h:
+        * PlatformWPE.cmake:
+        * PlatformWin.cmake:
+        * Scripts/generate-forwarding-headers.pl:
+        * UIProcess/API/glib/WebKitUserContentFilterStore.cpp:
+        * UIProcess/API/wpe/WebKitColorPrivate.h:
+        * UIProcess/WebsiteData/win/WebsiteDataStoreWin.cpp:
+        * UIProcess/win/PageClientImpl.cpp:
+
+2019-04-18  Chris Dumez  <cdumez@apple.com>
+
+        [iOS] Improve detection of when web views go to background / foreground
+        https://bugs.webkit.org/show_bug.cgi?id=197035
+        <rdar://problem/45281182>
+
+        Reviewed by Tim Horton.
+
+        Improve detection of when web views go to background / foreground on iOS.
+
+        * UIProcess/ApplicationStateTracker.mm:
+        (WebKit::ApplicationStateTracker::ApplicationStateTracker): Deleted.
+        (WebKit::ApplicationStateTracker::~ApplicationStateTracker): Deleted.
+        (WebKit::ApplicationStateTracker::applicationDidEnterBackground): Deleted.
+        (WebKit::ApplicationStateTracker::applicationDidFinishSnapshottingAfterEnteringBackground): Deleted.
+        (WebKit::ApplicationStateTracker::applicationWillEnterForeground): Deleted.
+
+2019-04-18  Jer Noble  <jer.noble@apple.com>
+
+        Refactoring: Pull all fullscreen code out of Document and into its own helper class
+        https://bugs.webkit.org/show_bug.cgi?id=197017
+
+        Reviewed by Eric Carlson.
+
+        * WebProcess/FullScreen/WebFullScreenManager.cpp:
+        (WebKit::WebFullScreenManager::willEnterFullScreen):
+        (WebKit::WebFullScreenManager::didEnterFullScreen):
+        (WebKit::WebFullScreenManager::willExitFullScreen):
+        (WebKit::WebFullScreenManager::didExitFullScreen):
+        (WebKit::WebFullScreenManager::setAnimatingFullScreen):
+        (WebKit::WebFullScreenManager::requestExitFullScreen):
+        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
+        (webkit_dom_document_webkit_cancel_fullscreen):
+        (webkit_dom_document_webkit_exit_fullscreen):
+        (webkit_dom_document_get_webkit_is_fullscreen):
+        (webkit_dom_document_get_webkit_fullscreen_keyboard_input_allowed):
+        (webkit_dom_document_get_webkit_current_fullscreen_element):
+        (webkit_dom_document_get_webkit_fullscreen_element):
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::createWindow):
+
+2019-04-18  Megan Gardner  <megan_gardner@apple.com>
+
+        Update UIKit when a cut causes a selection change
+        https://bugs.webkit.org/show_bug.cgi?id=197047
+        <rdar://problem/36311563>
+
+        Reviewed by Wenson Hsieh.
+
+        We need to let UIKit know when a cut causes a selection change (always),
+        so that is can appropriately update the button on the keyboard bar.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView cutForWebView:]):
+
+2019-04-18  Brent Fulgham  <bfulgham@apple.com>
+
+        InjectedBundle parameters often need initialization function called before unarchiving
+        https://bugs.webkit.org/show_bug.cgi?id=189709
+        <rdar://problem/44573653>
+
+        Reviewed by Ryosuke Niwa.
+
+        Handle the case where the InjectedBundle parameters do not successfully decode because they contain
+        an unexpected class from the embedding program. If this happens, try decoding the bundle parameters
+        after the bundle initialiation function runs, which gives the embedding program the opportunity to
+        register additional classes that are safe for serialization.
+
+        Extend WKWebProcessPlugIn with a method that returns the names of any custom classes that need
+        to be serialized by the InjectedBundle.
+        
+        Create a new 'decodeBundleParameters' method that contains the logic that used to live in 'initialize'.
+        Revise 'initialize' to call this new method.
+
+        * WebProcess/InjectedBundle/InjectedBundle.h:
+        * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
+        (WebKit::InjectedBundle::initialize): Use the new method.
+        (WebKit::InjectedBundle::decodeBundleParameters): Added.
+        (WebKit::InjectedBundle::setBundleParameters): Use 'decodeObjectOfClasses' with the more complete
+        'classesForCoder' method to unarchive the passed bundle parameters, rather than the
+        NSDictionary-specific method, since InjectedBundles often encode other types of objects, and the
+        NSDictionary object may itself hold other kinds of objects.
+        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
+        (WebKit::WKWebProcessPlugIn::additionalClassesForParameterCoder): Added.
+
+2019-04-18  Zalan Bujtas  <zalan@apple.com>
+
+        Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
+        https://bugs.webkit.org/show_bug.cgi?id=196948
+        <rdar://problem/49927131>
+
+        Reviewed by Tim Horton.
+
+        Move intrinsicContentSizeDidChange out of DrawingArea. Intrinsic content size is a layout concept and
+        after r244291 there's no reason to have it in DrawingArea.
+
+        * UIProcess/DrawingAreaProxy.h:
+        (WebKit::DrawingAreaProxy::didUpdateGeometry):
+        (WebKit::DrawingAreaProxy::intrinsicContentSizeDidChange): Deleted.
+        * UIProcess/DrawingAreaProxy.messages.in:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::didChangeIntrinsicContentSize):
+        (WebKit::WebPageProxy::setViewLayoutSize):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
+        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
+        (WebKit::TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange): Deleted.
+        * UIProcess/mac/WebPageProxyMac.mm:
+        (WebKit::WebPageProxy::intrinsicContentSizeDidChange): Deleted.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updateIntrinsicContentSizeIfNeeded):
+        (WebKit::WebPage::dispatchDidReachLayoutMilestone):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
+        (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded): Deleted.
+
+2019-04-18  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r244299.
+
+        Breaks internal tests.
+
+        Reverted changeset:
+
+        "InjectedBundle parameters often need initialization function
+        called before unarchiving"
+        https://bugs.webkit.org/show_bug.cgi?id=189709
+        https://trac.webkit.org/changeset/244299
+
+2019-04-18  Shawn Roberts  <sroberts@apple.com>
+
+        Unreviewed manual rollout of r244248 and r244409
+        Causing assertion failures on Mac WK2 Debug builds
+        https://bugs.webkit.org/show_bug.cgi?id=195623
+
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::lowMemoryHandler):
+        * NetworkProcess/NetworkProcess.h:
+        (WebKit::NetworkProcess::prefetchCache): Deleted.
+        * NetworkProcess/NetworkResourceLoader.cpp:
+        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
+        (WebKit::NetworkResourceLoader::didReceiveResponse):
+        (WebKit::NetworkResourceLoader::didReceiveBuffer):
+        (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
+        (WebKit::NetworkResourceLoader::isCrossOriginPrefetch const): Deleted.
+        * NetworkProcess/NetworkResourceLoader.h:
+        * NetworkProcess/cache/PrefetchCache.cpp: Removed.
+        * NetworkProcess/cache/PrefetchCache.h: Removed.
+        * Shared/WebPreferences.yaml:
+        * Sources.txt:
+        * WebKit.xcodeproj/project.pbxproj:
+
 2019-04-18  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Canvas: enable WebGL2 for inspector page