[GTK] Let DrawingArea manages setAcceleratedCompositingWindowId
https://bugs.webkit.org/show_bug.cgi?id=117230

Reviewed by Anders Carlsson.

This is a preparation patch for Threaded Coordinated Graphics.

LayerTreeHostGtk uses a native window handle to make glContext for
accelerated compositing. Therefore it is natural for DrawingArea to take
responsibility for the native window handle. And, in Coordinated
Graphics case, WebPage creates LayerTreeHost before receiving a native
window handle from UIProcess. It means we need a method to pass the
native window handle to already created LayerTreeHost.

This patch uses DrawingAreaProxy::setNativeSurfaceHandleForCompositing
instead of WebCoreProxy::setAcceleratedCompositingWindowId to set window
ID for accelerated compositing.

Also, this patch renames the setAcceleratedCompositingWindowId with a
more generic name, setNativeSurfaceHandleForCompositing.

No new tests. No change in functionality.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseCreateWebPage):
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::setNativeSurfaceHandleForCompositing):
* UIProcess/DrawingAreaProxyImpl.h:
* UIProcess/WebPageProxy.h:
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::setAcceleratedCompositingWindowId): Deleted.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::nativeSurfaceHandleForCompositing):
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::setNativeSurfaceHandleForCompositing):
* WebProcess/WebPage/DrawingAreaImpl.h:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
(WebKit::LayerTreeHostGtk::glContext):
(WebKit::LayerTreeHostGtk::initialize):
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::platformInitialize):
(WebKit::WebPage::setAcceleratedCompositingWindowId): Deleted.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176954 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Attempt to fix the public SDK build after <https://trac.webkit.org/r176841>
(https://bugs.webkit.org/show_bug.cgi?id=139227)

* platform/spi/ios/AVKitSPI.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176955 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a stub implementation of WebsiteDataStore::removeDataModifiedSince
https://bugs.webkit.org/show_bug.cgi?id=139406

Reviewed by Antti Koivisto.

Change _WKWebsiteDataStore to call the newly added function.

* UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
(toWebsiteDataTypes):
(toSystemClockTime):
(-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeDataModifiedSince):
* UIProcess/WebsiteData/WebsiteDataStore.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176956 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Grid Layout] Grid items must set a new formatting context.
https://bugs.webkit.org/show_bug.cgi?id=139150

Reviewed by David Hyatt.

Source/WebCore:

Grid item's margins must not collapse even when they may be adjoining to
its content's margins. Also, setting a new formatting context prevents any
'float' protruding content on the adjoining grid items.

This patch also renames the expandsToEncloseOverhangingFloats to be more generic now,
determining whether a new formatting context is set or not. This affects not only to
how floats behave, but whether margins should collapse or not.

Tests: fast/css-grid-layout/float-not-protruding-into-next-grid-item.html
       fast/css-grid-layout/grid-item-margins-not-collapse.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::avoidsFloats): Using the new createsNewFormattingContext function.
(WebCore::RenderBlock::expandsToEncloseOverhangingFloats): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::MarginInfo::MarginInfo): Using the new createsNewFormattingContext function.
(WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats): Using the new createsNewFormattingContext function.
(WebCore::RenderBlockFlow::layoutBlock): Using the new createsNewFormattingContext function.
(WebCore::RenderBlockFlow::computeOverflow): Using the new createsNewFormattingContext function.
(WebCore::RenderBlockFlow::addOverhangingFloats): Using the new createsNewFormattingContext function.
(WebCore::RenderBlockFlow::needsLayoutAfterRegionRangeChange): Using the new createsNewFormattingContext function.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::createsNewFormattingContext): Added.
(WebCore::RenderBox::avoidsFloats): Removed checks already defined in the new createsNewFormattingContext function.
* rendering/RenderBox.h:
(WebCore::RenderBox::isGridItem): Added.

LayoutTests:

Test to verify that grid items's margin don't collapese with its parent's margin
and there is no 'float' protruding content on the adjoining grid items.

I had to rebaseline the form-hides-table.html test because table-caption, which
is supposed to establish a new formatting context, does not allow margins collapsing.

* fast/css-grid-layout/float-not-protruding-into-next-grid-item-expected.html: Added.
* fast/css-grid-layout/float-not-protruding-into-next-grid-item.html: Added.
* fast/css-grid-layout/grid-item-margins-not-collapse-expected.html: Added.
* fast/css-grid-layout/grid-item-margins-not-collapse.html: Added.
* platform/gtk/fast/forms/form-hides-table-expected.txt: Rebaseline needed.
* platform/mac/fast/forms/form-hides-table-expected.txt: Rebaseline needed.
* platform/efl/TestExpectations: Mark fast/forms/form-hides-table-expected as failure.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176957 268f45cc-cd09-0410-ab3c-d52691b4dbfc
URTBF after r176953, add an unreachable return to make GCC happy.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::subresourceCachePolicy):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add action menu tests
https://bugs.webkit.org/show_bug.cgi?id=139156

Reviewed by Dean Jackson.

* TestWebKitAPI/PlatformWebView.h:
* TestWebKitAPI/mac/PlatformWebViewMac.mm:
(TestWebKitAPI::PlatformWebView::PlatformWebView):
Add a mechanism allowing tests to provide their own WKView subclass.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/action-menu-targets.html: Added.
Add a file with lots of menu targets.

* TestWebKitAPI/Tests/WebKit2ObjC/ActionMenus.mm: Added.
(-[ActionMenusTestWKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:userData:]):
(-[ActionMenusTestWKView runMenuSequenceAtPoint:preMenuNeedsUpdateHandler:preWillOpenMenuHandler:preDidCloseMenuHandler:]):
(-[ActionMenusTestWKView runMenuSequenceAtPoint:preDidCloseMenuHandler:]):
Run through the normal sequence of callbacks, recording what items and type were returned, and give clients a chance to do work at various points in the process.

(-[ActionMenusTestWKView _setOverrideActionMenuItems:]):

(TestWebKitAPI::didFinishLoadForFrameCallback):
(TestWebKitAPI::didFinishDownloadCallback):
(TestWebKitAPI::didCreateDownloadDestinationCallback):
Watch downloads and ensure that they match the content we expect.

(TestWebKitAPI::watchPasteboardForString):
(TestWebKitAPI::watchPasteboardForImage):
(TestWebKitAPI::JavaScriptStringCallbackContext::JavaScriptStringCallbackContext):
(TestWebKitAPI::JavaScriptBoolCallbackContext::JavaScriptBoolCallbackContext):
(TestWebKitAPI::javaScriptStringCallback):
(TestWebKitAPI::javaScriptBoolCallback):
(TestWebKitAPI::callJavaScriptReturningString):
(TestWebKitAPI::callJavaScriptReturningBool):
(TestWebKitAPI::watchEditableAreaForString):
(TestWebKitAPI::waitForVideoReady):
(TestWebKitAPI::retrieveSelection):
(TestWebKitAPI::retrieveSelectionInElement):
(TestWebKitAPI::performMenuItemAtIndexOfTypeAsync):
(TestWebKitAPI::ensureMenuItemAtIndexOfTypeIsDisabled):
Add many helpers for testing, especially to make asynchronous things synchronous.

(TestWebKitAPI::windowPointForTarget):
(TestWebKitAPI::inset8):
Hard-code points in action-menu-targets.html for hit testing.

(TestWebKitAPI::TEST):
Add a suite of tests for WebKit2 action menus.

* TestWebKitAPI/Tests/WebKit2ObjC/ActionMenusBundle.mm: Added.
(TestWebKitAPI::createActionContextForPhoneNumber):
(TestWebKitAPI::ActionMenuTest::ActionMenuTest):
(TestWebKitAPI::ActionMenuTest::prepareForActionMenu):
(TestWebKitAPI::ActionMenuTest::actionContextForResultAtPoint):
(TestWebKitAPI::ActionMenuTest::drawRect):
(TestWebKitAPI::ActionMenuTest::didCreatePage):
Add a bundle with a PageOverlay and a actionContextForResultAtPoint override,
so that we can test that infrastructure.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176959 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move the callback invocation outside of the loop.

Rubber-stamped by Tim Horton.

* UIProcess/WebKeyValueStorageManager.cpp:
(WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176960 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make deleting all cookies after a given date a little more sane
https://bugs.webkit.org/show_bug.cgi?id=139409

Reviewed by Antti Koivisto.

Source/WebCore:

* WebCore.exp.in:
Update exports.

* platform/network/PlatformCookieJar.h:
* platform/network/cf/CookieJarCFNet.cpp:
* platform/network/curl/CookieJarCurl.cpp:
* platform/network/soup/CookieJarSoup.cpp:
Rename deleteAllCookiesModifiedAfterDate to deleteAllCookiesModifiedSince and change it
to take an std::chrono::system_clock::time_point instead.

* platform/network/mac/CookieJarMac.mm:
(WebCore::cookieStorage):
Helper function that returns an NSHTTPCookieStorage given a network session.

(WebCore::deleteAllCookiesModifiedSince):
Get the cookie storage from the network storage instead of just getting the global one.

Source/WebKit2:

Change all the doubles to std::chrono::system_clock::time_points instead.

* Platform/IPC/ArgumentCoders.cpp:
(IPC::ArgumentCoder<std::chrono::system_clock::time_point>::encode):
(IPC::ArgumentCoder<std::chrono::system_clock::time_point>::decode):
* Platform/IPC/ArgumentCoders.h:
* Scripts/webkit/messages.py:
(headers_for_type):
* UIProcess/API/C/WKCookieManager.cpp:
(WKCookieManagerDeleteAllCookiesModifiedAfterDate):
* UIProcess/API/C/WKCookieManager.h:
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
(WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedAfterDate): Deleted.
* UIProcess/WebCookieManagerProxy.h:
* WebProcess/Cookies/WebCookieManager.cpp:
(WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
(WebKit::WebCookieManager::deleteAllCookiesModifiedAfterDate): Deleted.
* WebProcess/Cookies/WebCookieManager.h:
* WebProcess/Cookies/WebCookieManager.messages.in:

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