Use the video element's video box when getting the inline video rect in WebVideoFulls...
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-06-10  Ada Chan  <adachan@apple.com>
2
3         Use the video element's video box when getting the inline video rect in WebVideoFullscreenManager
4         https://bugs.webkit.org/show_bug.cgi?id=158351
5         <rdar://problem/26567938>
6
7         Reviewed by Darin Adler.
8
9         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
10         (WebKit::inlineVideoFrame):
11         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
12         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement):
13         (WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline):
14         (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced):
15         (WebKit::clientRectForElement): Deleted.
16
17 2016-06-10  Benjamin Poulain  <bpoulain@apple.com>
18
19         Add support for passive event listeners on touch events
20         https://bugs.webkit.org/show_bug.cgi?id=158601
21
22         Reviewed by Simon Fraser.
23
24         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
25         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
26         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
27         (WebKit::dump):
28         * Shared/WebCoreArgumentCoders.cpp:
29         (IPC::ArgumentCoder<EventTrackingRegions>::encode):
30         (IPC::ArgumentCoder<EventTrackingRegions>::decode):
31         * Shared/WebCoreArgumentCoders.h:
32         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
33         (WebKit::RemoteScrollingCoordinatorProxy::eventTrackingTypeForPoint):
34         (WebKit::RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion): Deleted.
35         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
36         * UIProcess/WebPageProxy.cpp:
37         (WebKit::WebPageProxy::touchEventTrackingType):
38         The type is the most restrictive type of all the touch points.
39         If any touch point needs synchronous tracking, everything has to be synchronous.
40
41         (WebKit::WebPageProxy::handleTouchEventSynchronously):
42         This is a very unfortunate design.
43
44         The upper layer dealing with UIKit knows about gesture and when something
45         can be dispatched asynchrnously because a gesture has started.
46         This layer knows about tracking and can use that extra inforamtion
47         to dispatch an event asynchrnously anyway.
48
49         In the future, we should refactor this to let WebPageProxy
50         always decide of the dispatch type. I am just concerned changing
51         the upper layer while we are stabilizing WebKit.
52
53         (WebKit::WebPageProxy::handleTouchEventAsynchronously):
54         (WebKit::WebPageProxy::handleTouchEvent):
55         (WebKit::WebPageProxy::resetState):
56         (WebKit::WebPageProxy::WebPageProxy): Deleted.
57         (WebKit::WebPageProxy::shouldStartTrackingTouchEvents): Deleted.
58         * UIProcess/WebPageProxy.h:
59
60 2016-06-10  Beth Dakin  <bdakin@apple.com>
61
62         Add requestExitFullScreen to WKFullScreenWindowController
63         https://bugs.webkit.org/show_bug.cgi?id=158633
64         -and corresponding-
65         rdar://problem/26564036
66
67         Reviewed by Tim Horton.
68
69         * UIProcess/mac/WKFullScreenWindowController.h:
70         * UIProcess/mac/WKFullScreenWindowController.mm:
71         (-[WKFullScreenWindowController requestExitFullScreen]):
72
73 2016-06-10  Alex Christensen  <achristensen@webkit.org>
74
75         Reduce ResourceResponse copying
76         https://bugs.webkit.org/show_bug.cgi?id=158232
77
78         Reviewed by Darin Adler.
79
80         * NetworkProcess/Downloads/PendingDownload.h:
81         * NetworkProcess/NetworkDataTask.h:
82         * NetworkProcess/NetworkLoad.cpp:
83         (WebKit::NetworkLoad::continueDidReceiveResponse):
84         (WebKit::NetworkLoad::sharedDidReceiveResponse):
85         (WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
86         (WebKit::NetworkLoad::didReceiveChallenge):
87         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
88         (WebKit::NetworkLoad::didReceiveResponseAsync):
89         * NetworkProcess/NetworkLoad.h:
90         * NetworkProcess/NetworkLoadClient.h:
91         * NetworkProcess/NetworkResourceLoader.cpp:
92         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
93         (WebKit::NetworkResourceLoader::abort):
94         * NetworkProcess/NetworkResourceLoader.h:
95         * NetworkProcess/PingLoad.h:
96         * NetworkProcess/cache/NetworkCacheCoders.h:
97         (WebKit::NetworkCache::Coder<Optional<T>>::encode):
98         (WebKit::NetworkCache::Coder<Optional<T>>::decode):
99         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
100         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
101         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
102         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
103         (WebKit::NetworkDataTask::didCompleteWithError):
104         (WebKit::NetworkDataTask::didReceiveResponse):
105         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
106         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
107         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
108         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
109         * WebProcess/WebPage/WebFrame.cpp:
110         (WebKit::WebFrame::url):
111         (WebKit::WebFrame::certificateInfo):
112         (WebKit::WebFrame::innerText):
113
114 2016-06-09  Ryosuke Niwa  <rniwa@webkit.org>
115
116         Add SPI to disable spellchecking on auto-fillable text fields
117         https://bugs.webkit.org/show_bug.cgi?id=158611
118
119         Reviewed by Anders Carlsson.
120
121         Added WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled to disable spellchecking on a text field.
122
123         This is used by WebKit2 client which desires to disable spellchecking and notably autocorrection on
124         login forms, etc... where such feature would interfere with user's actions.
125
126         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
127         (WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled): Added.
128         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
129         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
130         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementSpellcheckEnabled): Added.
131         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
132
133 2016-06-10  Alex Christensen  <achristensen@webkit.org>
134
135         Introduce WTF::UniqueRef
136         https://bugs.webkit.org/show_bug.cgi?id=158596
137
138         Reviewed by Brady Eidson.
139
140         * WebProcess/WebPage/WebPage.cpp:
141         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
142
143 2016-06-10  Anders Carlsson  <andersca@apple.com>
144
145         Remove CommandLine class
146         https://bugs.webkit.org/show_bug.cgi?id=158628
147
148         Reviewed by Tim Horton.
149
150         * Shared/CommandLine.h: Removed.
151         (WebKit::CommandLine::operator[]): Deleted.
152         * Shared/posix/CommandLinePOSIX.cpp: Removed.
153         (WebKit::CommandLine::parse): Deleted.
154         * WebKit2.xcodeproj/project.pbxproj:
155
156 2016-06-10  Simon Fraser  <simon.fraser@apple.com>
157
158         [iOS WK2] Rare RELEASE_ASSERT under RemoteLayerTreeDrawingArea::flushLayers()
159         https://bugs.webkit.org/show_bug.cgi?id=158622
160         rdar://problem/26609452
161
162         Reviewed by Tim Horton.
163         
164         It's possible for a CADisplayLink to fire after being paused sometimes, possibly
165         when an app is running another CADisplayLink whose callback takes some time. When
166         this happens, RemoteLayerTreeDrawingAreaProxy could erroneously send a second
167         didUpdate() to the web process between commits, which would clear the m_waitingForBackingStoreSwap
168         flag too early, and allow a subsequent RemoteLayerTreeDrawingArea::flushLayers()
169         to proceed when the m_pendingBackingStoreFlusher was still flushing.
170
171         Fix by preventing two didUpdates from being sent from the UI process between
172         commits.
173         
174         Not easily testable.
175
176         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
177         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
178         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
179         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
180
181 2016-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
182
183         [Threaded Compositor] Content and viewport sizes are mixed
184         https://bugs.webkit.org/show_bug.cgi?id=158564
185
186         Reviewed by Žan Doberšek.
187
188         Make ThreadedCoordinatedLayerTreeHost::sizeDidChange() update the viewport size for consistency with all other
189         LayerTreeHost implementations and rename viewportSizeChanged() as contentsSizeChanged() and update the contents
190         size.
191
192         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
193         (WebKit::WebChromeClient::contentsSizeChanged): Remove ifdefed code here, the drawing area is notified two lines below.
194         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
195         (WebKit::CoordinatedDrawingArea::mainFrameContentSizeChanged): Update the viewport size to the contents size
196         only when using a fixed layout here instead of in cross-platform code.
197         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
198         (WebKit::ThreadedCoordinatedLayerTreeHost::contentsSizeChanged):
199         (WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange):
200         (WebKit::ThreadedCoordinatedLayerTreeHost::viewportSizeChanged): Deleted.
201         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
202         * WebProcess/WebPage/DrawingAreaImpl.cpp:
203         (WebKit::DrawingAreaImpl::mainFrameContentSizeChanged): Call LayerTreeHost::contentsSizeChanged().
204         (WebKit::DrawingAreaImpl::updateBackingStoreState): Remove ifdefed code for the threadecd compositor since it's
205         now consistent with all other LayerTreeHost implementations.
206         * WebProcess/WebPage/LayerTreeHost.h:
207
208 2016-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
209
210         [Threaded Compositor] Make it clear that compositing thread operations are always scheduled from the main thread
211         https://bugs.webkit.org/show_bug.cgi?id=158562
212
213         Reviewed by Žan Doberšek.
214
215         The code is written as if the compositor thread could also call callOnCompositingRunLoop() which makes the code
216         confusing. This patch no longer checks if the task was scheduled in the compositing thread, and instead it adds
217         an ASSERT to ensure it's always called from the main thread as expected. It also adds some more ASSERTS to ensure
218         and clarify the methods are called from the expected thread.
219
220         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
221         (WebKit::CompositingRunLoop::performTask):
222         (WebKit::CompositingRunLoop::callOnCompositingRunLoop): Deleted.
223         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
224         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
225         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing):
226         (WebKit::ThreadedCompositor::setDeviceScaleFactor):
227         (WebKit::ThreadedCompositor::didChangeViewportSize):
228         (WebKit::ThreadedCompositor::didChangeViewportAttribute):
229         (WebKit::ThreadedCompositor::didChangeContentsSize):
230         (WebKit::ThreadedCompositor::scrollTo):
231         (WebKit::ThreadedCompositor::scrollBy):
232         (WebKit::ThreadedCompositor::glContext):
233         (WebKit::ThreadedCompositor::didChangeVisibleRect):
234         (WebKit::ThreadedCompositor::renderLayerTree):
235         (WebKit::ThreadedCompositor::updateSceneState):
236         (WebKit::ThreadedCompositor::callOnCompositingThread): Deleted.
237         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
238
239 2016-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
240
241         [GTK] Browser plugins crash under Wayland
242         https://bugs.webkit.org/show_bug.cgi?id=157605
243
244         Reviewed by Michael Catanzaro.
245
246         Fail the initialization of windowed plugins if we don't have a platform implementation.
247
248         * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp:
249         (WebKit::NetscapePlugin::platformPostInitialize):
250
251 2016-06-09  Antoine Quint  <graouts@apple.com>
252
253         [iOS] -webkit-overflow-scrolling: touch; ignores pointer-events: none;
254         https://bugs.webkit.org/show_bug.cgi?id=119839
255         <rdar://problem/9671514>
256
257         Reviewed by Simon Fraser.
258
259         Propagate a "userInteractionEnabled" flag from the Web process which is used to turn off
260         user interaction on a UIScrollView created for -webkit-overflow-scrolling: touch.
261
262         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
263         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
264         * Shared/mac/RemoteLayerTreeTransaction.h:
265         * Shared/mac/RemoteLayerTreeTransaction.mm:
266         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
267         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
268         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
269         (WebKit::dumpChangedLayers):
270         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
271         (WebKit::PlatformCALayerRemote::userInteractionEnabled):
272         (WebKit::PlatformCALayerRemote::setUserInteractionEnabled):
273         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
274
275 2016-06-09  Anders Carlsson  <andersca@apple.com>
276
277         Remove OriginAndDatabases.cpp, it's unused
278         https://bugs.webkit.org/show_bug.cgi?id=158595
279
280         Reviewed by Sam Weinig.
281
282         * CMakeLists.txt:
283         * Shared/OriginAndDatabases.cpp: Removed.
284         (WebKit::OriginAndDatabases::encode): Deleted.
285         (WebKit::OriginAndDatabases::decode): Deleted.
286         * Shared/OriginAndDatabases.h: Removed.
287         * WebKit2.xcodeproj/project.pbxproj:
288
289 2016-06-09  Alex Christensen  <achristensen@webkit.org>
290
291         Clean up EditorClient lifetime
292         https://bugs.webkit.org/show_bug.cgi?id=158588
293
294         Reviewed by Anders Carlsson.
295
296         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
297         (WebKit::generateTextCheckingRequestID):
298         (WebKit::WebEditorClient::shouldDeleteRange):
299         (WebKit::WebEditorClient::pageDestroyed): Deleted.
300         * WebProcess/WebCoreSupport/WebEditorClient.h:
301         (WebKit::WebEditorClient::WebEditorClient):
302         * WebProcess/WebPage/WebPage.cpp:
303         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
304
305 2016-06-09  Andy Estes  <aestes@apple.com>
306
307         WKWebView does not render PDF pages in AirPrint
308         https://bugs.webkit.org/show_bug.cgi?id=151386
309         rdar://problem/22499157
310
311         Reviewed by Tim Horton.
312
313         _WKWebViewPrintFormatter originally attempted to handle PDFs, but the code path was never
314         properly tested since Safari prints PDFs by setting a printingItem on the
315         UIPrintInteractionController instead of going through a print formatter. The existing code
316         almost worked, if it weren't for CGContextScaleCTM() scaling each page into oblivion due to
317         _totalScaleFactor equaling 0.
318
319         This patch properly implements -[_WKWebViewPrintFormatter drawInRect:forPageAtIndex:] to
320         handle drawing both PDFs generated by WebKit and PDFs loaded in the main frame. It also
321         takes the opportunity to clean up a number of issues in the existing code:
322
323         - Handling of -[_WKWebViewPrintFormatter startPage] is now correct. I had previously assumed
324           this property represented the first page of output to print, but it actually represents
325           the first page in the overall print job that the print formatter renders. In other words,
326           regardless of -startPage, the print formatter should always print all its pages.
327         - Code specific to webpage and PDF printing was factored out into WKContentView and
328           WKPDFView, respectively. Each conforms to @protocol(_WKWebViewPrintProvider), and
329           _WKWebViewPrintFormatter accesses the provider via -[WKWebView _printProvider].
330         - Instead of piping the printed PDF data from WebPageProxy to WKWebView via PageClient, use
331           the GenericCallback mechanism to have WebPageProxy call a lambda specified by
332           WKContentView when the printed PDF is available.
333         - Removed _totalScaleFactor and used CGPDFPageGetDrawingTransform() to transform both
334           webpages and PDFs. For webpages, _totalScaleFactor will always equal the ratio of the
335           paper width to the PDF page width, so CGPDFPageGetDrawingTransform() will apply the same
336           scaling as CGContextScaleCTM(_totalScaleFactor, _totalScaleFactor) would.
337
338         * UIProcess/API/Cocoa/WKWebView.mm:
339         (-[WKWebView _printProvider]): Added. Returns _currentContentView if it conforms to
340         @protocol(_WKWebViewPrintProvider).
341         (-[WKWebView _computePageCountAndStartDrawingToPDFForFrame:printInfo:firstPage:computedTotalScaleFactor:]):
342         Moved code to _wk_pageCountForPrintFormatter in WKContentView and WKPDFView.
343         (-[WKWebView _endPrinting]): Deleted.
344         (-[WKWebView _printedDocument]): Deleted.
345         (-[WKWebView _setPrintedDocument:]): Deleted.
346         * UIProcess/API/Cocoa/WKWebViewInternal.h: Declared the _printProvider property.
347         * UIProcess/PageClient.h: Removed didFinishDrawingPagesToPDF().
348         * UIProcess/WebPageProxy.h: Declared computePagesForPrintingAndDrawToPDF() and
349         drawToPDFCallback().
350         * UIProcess/WebPageProxy.messages.in: Renamed DidFinishDrawingPagesToPDF to
351         DrawToPDFCallback.
352         * UIProcess/_WKWebViewPrintFormatter.mm: Backed the frameToPrint property with a RetainPtr
353         ivar so that it doesn't need to be released manually in -dealloc; removed _totalScaleFactor
354         and _printInfo ivars and added a _printedDocument ivar; removed the property declaration for
355         webView.
356         (-[_WKWebViewPrintFormatter frameToPrint]): Added a custom getter for the frameToPrint
357         property.
358         (-[_WKWebViewPrintFormatter setFrameToPrint:]): Added a custom setter for the frameToPrint
359         property.
360         (-[_WKWebViewPrintFormatter _webView]): Renamed from webView; added an underscore since this
361         is a private method.
362         (-[_WKWebViewPrintFormatter _recalcPageCount]): Retrieved the page count from the print
363         provider and clamped its value to NSIntegerMax.
364         (-[_WKWebViewPrintFormatter drawInRect:forPageAtIndex:]): Retrieved the printed document
365         from the print provider if needed; modified the CTM transformations to work for both
366         webpages and PDFs.
367         (-[_WKWebViewPrintFormatter dealloc]): Deleted.
368         (-[_WKWebViewPrintFormatter webView]): Renamed to _webView.
369         (-[_WKWebViewPrintFormatter rectForPageAtIndex:]): Deleted.
370         * UIProcess/_WKWebViewPrintFormatterInternal.h: Added. Moved a UIPrintFormatter internal
371         method declaration to here and defined the _WKWebViewPrintProvider protocol.
372         * UIProcess/ios/PageClientImplIOS.h: Removed didFinishDrawingPagesToPDF().
373         * UIProcess/ios/PageClientImplIOS.mm: Ditto.
374         (WebKit::PageClientImpl::didFinishDrawingPagesToPDF): Deleted.
375         * UIProcess/ios/WKContentView.mm: Conformed to @protocol(_WKWebViewPrintProvider).
376         (-[WKContentView _wk_pageCountForPrintFormatter:]): Moved the code to compute page count
377         from WKWebView to here.
378         (-[WKContentView _wk_printedDocument]): Moved the code to get the printed document from
379         WKWebView to here.
380         * UIProcess/ios/WKPDFView.mm:
381         (-[WKPDFView _wk_pageCountForPrintFormatter:]): Moved the code to compute the page count
382         from WKWebView to here; added a call to CGPDFDocumentAllowsPrinting(), returning 0 if
383         printing is not allowed.
384         (-[WKPDFView _wk_printedDocument]): Moved the code to get the printed document from
385         WKWebView to here.
386         * UIProcess/ios/WebPageProxyIOS.mm:
387         (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF): Registered the callback with
388         m_callbacks and sent Messages::WebPage::ComputePagesForPrintingAndDrawToPDF; returned the
389         synchronously-returned page count.
390         (WebKit::WebPageProxy::drawToPDFCallback): Added to perform the callback when drawing to PDF
391         is complete.
392         (WebKit::WebPageProxy::didFinishDrawingPagesToPDF): Deleted.
393         * WebKit2.xcodeproj/project.pbxproj: Added _WKWebViewPrintFormatterInternal.h.
394         * WebProcess/WebPage/WebPage.h: Renamed computePagesForPrintingAndStartDrawingToPDF() to
395         computePagesForPrintingAndDrawToPDF().
396         * WebProcess/WebPage/WebPage.messages.in: Renamed
397         ComputePagesForPrintingAndStartDrawingToPDF to ComputePagesForPrintingAndDrawToPDF. Removed
398         the startPage parameter and added a callbackID.
399         * WebProcess/WebPage/ios/WebPageIOS.mm:
400         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF): Renamed from
401         computePagesForPrintingAndStartDrawingToPDF(). Added a call to endPrinting() after sending
402         Messages::WebPageProxy::DrawToPDFCallback.
403         (WebKit::WebPage::computePagesForPrintingAndStartDrawingToPDF): Renamed to
404         computePagesForPrintingAndDrawToPDF.
405
406 2016-06-09  Alex Christensen  <achristensen@webkit.org>
407
408         Clean up WebSocket code
409         https://bugs.webkit.org/show_bug.cgi?id=158551
410
411         Reviewed by Darin Adler.
412
413         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
414         (WebKit::BlobRegistryProxy::registerFileBlobURL):
415         * WebProcess/FileAPI/BlobRegistryProxy.h:
416
417 2016-06-09  David Kilzer  <ddkilzer@apple.com>
418
419         Update properties for UIWKTextInteractionAssistant
420         <https://webkit.org/b/158559>
421
422         Reviewed by Darin Adler.
423
424         * Platform/spi/ios/UIKitSPI.h:
425         (UIWKTextInteractionAssistant.loupeGesture):
426         (UIWKTextInteractionAssistant.singleTapGesture):
427         Change from retain to assign since UIWKTextInteractionAssistant
428         is not responsible for their lifetime.  Sort alphabetically.
429
430 2016-06-09  Michael Saboff  <msaboff@apple.com>
431
432         WebKitTestRunner and DumpRenderTree do not handle dangling surrogate characters
433         https://bugs.webkit.org/show_bug.cgi?id=154863
434
435         Reviewed by Alexey Proskuryakov.
436
437         Added a non-strict verions of WKStringGetUTF8CString() that will handle dangling
438         surrogates called WKStringGetUTF8CStringNonStrict().
439
440         * Shared/API/c/WKString.cpp:
441         (WKStringGetUTF8CStringImpl):
442         (WKStringGetUTF8CString):
443         (WKStringGetUTF8CStringNonStrict):
444         * Shared/API/c/WKString.h:
445
446 2016-06-09  Carlos Garcia Campos  <cgarcia@igalia.com>
447
448         [Threaded Compositor] Many layout tests crash when threaded compositor is enabled
449         https://bugs.webkit.org/show_bug.cgi?id=158560
450
451         Reviewed by Žan Doberšek.
452
453         This is because CoordinatedGraphicsLayer::notifyFlushRequired() assumes it has a valid compositor when it's
454         called. But the compositor is only present when GraphicsLayer::create() is called with a
455         GraphicsLayerFactory. When running the layout tests, layers are created without a factory because DrawingAreaImpl
456         is not entering AC mode as expected and the layer tree host is not created, making
457         DrawingAreaImpl::graphicsLayerFactory() always return nullptr. This happens because DrawingAreaImpl is checking
458         acceleratedDrawingEnabled setting to decide whether to always use compositing mode or not, and WTR sets that
459         setting to false (changing its default value). The thing is that acceleratedDrawingEnabled setting doesn't have
460         any effect in non-Mac ports, what we really want to check there is whether acceleratedCompositingEnabled is true
461         or false.
462
463         * WebProcess/WebPage/DrawingAreaImpl.cpp:
464         (WebKit::DrawingAreaImpl::updatePreferences):
465
466 2016-06-09  Carlos Garcia Campos  <cgarcia@igalia.com>
467
468         [Threaded Compositor] Remove ThreadedCompositor::setNeedsDisplay()
469         https://bugs.webkit.org/show_bug.cgi?id=158523
470
471         Reviewed by Michael Catanzaro.
472
473         ThreadedCompositor::setNeedsDisplay() is always called from the main thread and schedules a task to the
474         compositing thread to schedule an immediate update. But RunLoop::Timer is thread-safe so we don't really need to
475         schedule a task to the update the timer in the compositing thread, we can do that directly in the main
476         thread. And that's exactly what scheduleDisplayImmediately() does, so we can use it instead of setNeedsDisplay().
477
478         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
479         (WebKit::ThreadedCompositor::setNeedsDisplay(): Deleted.
480         (WebKit::ThreadedCompositor::updateSceneState):
481         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
482
483 2016-06-08  Antti Koivisto  <antti@apple.com>
484
485         Increase disk cache capacity when there is lots of free space
486         https://bugs.webkit.org/show_bug.cgi?id=158526
487
488         Reviewed by Chris Dumez.
489
490         Our maximum disk cache capacity has been 175MB for a very long time. Meanwhile the average resource size has grown
491         massively. 175MB is now enough for cacheable resources of a few dozen sites at most. Using bigger caches when there is
492         room for it can reduce network traffic, reduce disk writes, save battery and speed up page loading.
493
494         This patch changes cache size for PrimaryWebBrowser cache model
495
496         >=16GB free: 175MB -> 500MB
497         8-16GB free: 150MB -> 250MB
498
499         and modestly for DocumentBrowser
500
501         >=16GB free: 50MB -> 75MB
502
503         Note that if system (on Cocoa platforms) really needs disk space it will wipe out caches so this doesn't reduce
504         available disk space in scenarios like software installation.
505
506         * Shared/CacheModel.cpp:
507         (WebKit::calculateCacheSizes):
508
509 2016-06-08  Youenn Fablet  <youenn.fablet@crf.canon.fr>
510
511         Introduce ResourceErrorBase::type
512         https://bugs.webkit.org/show_bug.cgi?id=158299
513
514         Reviewed by Alex Christensen.
515
516         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
517         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
518         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
519
520 2016-06-08  Beth Dakin  <bdakin@apple.com>
521
522         _web_didAddMediaControlsManager should take a controlsManager as a parameter 
523         https://bugs.webkit.org/show_bug.cgi?id=158545
524
525         Reviewed by Tim Horton.
526
527         * UIProcess/Cocoa/WebViewImpl.h:
528
529 2016-06-06  Antti Koivisto  <antti@apple.com>
530
531         WebKit memory cache doesn't respect Vary header
532         https://bugs.webkit.org/show_bug.cgi?id=71509
533         <rdar://problem/26651033>
534
535         Reviewed by Sam Weinig.
536
537         * NetworkProcess/cache/NetworkCache.cpp:
538         (WebKit::NetworkCache::makeCacheKey):
539         (WebKit::NetworkCache::cachePolicyAllowsExpired):
540         (WebKit::NetworkCache::makeUseDecision):
541         (WebKit::NetworkCache::Cache::retrieve):
542         (WebKit::NetworkCache::Cache::store):
543         (WebKit::NetworkCache::Cache::storeRedirect):
544         (WebKit::NetworkCache::Cache::update):
545         (WebKit::NetworkCache::headerValueForVary): Deleted.
546         (WebKit::NetworkCache::collectVaryingRequestHeaders): Deleted.
547         (WebKit::NetworkCache::verifyVaryingRequestHeaders): Deleted.
548
549             These move to WebCore.
550
551 2016-06-08  Carlos Garcia Campos  <cgarcia@igalia.com>
552
553         Unreviewed. Fix GTK+ build with threaded compositor enabled after r201802.
554
555         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
556         (WebKit::ThreadedCoordinatedLayerTreeHost::create):
557
558 2016-06-08  Carlos Garcia Campos  <cgarcia@igalia.com>
559
560         LayerTreeHost should be created with a WebPage reference instead of a pointer
561         https://bugs.webkit.org/show_bug.cgi?id=158520
562
563         Reviewed by Žan Doberšek.
564
565         We are indeed creating the LayerTreeHost always from a WebPage reference but getting its address to pass it to
566         the LayerTreeHost create() function.
567
568         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
569         (WebKit::CoordinatedDrawingArea::enterAcceleratedCompositingMode):
570         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
571         (WebKit::CoordinatedLayerTreeHost::create):
572         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
573         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
574         (WebKit::CoordinatedLayerTreeHost::performScheduledLayerFlush):
575         (WebKit::CoordinatedLayerTreeHost::commitSceneState):
576         (WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
577         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
578         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
579         (WebKit::ThreadedCoordinatedLayerTreeHost::create):
580         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):
581         (WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
582         (WebKit::ThreadedCoordinatedLayerTreeHost::compositorDidFlushLayers):
583         (WebKit::ThreadedCoordinatedLayerTreeHost::didScaleFactorChanged):
584         (WebKit::ThreadedCoordinatedLayerTreeHost::setVisibleContentsRect):
585         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
586         * WebProcess/WebPage/DrawingAreaImpl.cpp:
587         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
588         * WebProcess/WebPage/LayerTreeHost.cpp:
589         (WebKit::LayerTreeHost::create):
590         (WebKit::LayerTreeHost::LayerTreeHost):
591         * WebProcess/WebPage/LayerTreeHost.h:
592         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
593         (WebKit::LayerTreeHostGtk::create):
594         (WebKit::LayerTreeHostGtk::LayerTreeHostGtk):
595         (WebKit::LayerTreeHostGtk::makeContextCurrent):
596         (WebKit::LayerTreeHostGtk::deviceOrPageScaleFactorChanged):
597         (WebKit::LayerTreeHostGtk::paintContents):
598         (WebKit::LayerTreeHostGtk::deviceScaleFactor):
599         (WebKit::LayerTreeHostGtk::pageScaleFactor):
600         (WebKit::LayerTreeHostGtk::flushPendingLayerChanges):
601         (WebKit::LayerTreeHostGtk::flushAndRenderLayers):
602         (WebKit::LayerTreeHostGtk::pageBackgroundTransparencyChanged):
603         (WebKit::LayerTreeHostGtk::initialize): Deleted.
604         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
605
606 2016-06-07  Sam Weinig  <sam@webkit.org>
607
608         Fix 10.10 build.
609
610         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
611         (WebKit::addAnimationToLayer):
612
613 2016-06-06  Alex Christensen  <achristensen@webkit.org>
614
615         Modernize loading code
616         https://bugs.webkit.org/show_bug.cgi?id=158332
617
618         Reviewed by Darin Adler.
619
620         * NetworkProcess/Downloads/PendingDownload.h:
621         * NetworkProcess/NetworkDataTask.h:
622         (WebKit::NetworkDataTask::client):
623         * NetworkProcess/NetworkLoad.cpp:
624         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
625         (WebKit::NetworkLoad::didReceiveData):
626         (WebKit::NetworkLoad::didReceiveBuffer):
627         * NetworkProcess/NetworkLoad.h:
628         * NetworkProcess/NetworkLoadClient.h:
629         * NetworkProcess/NetworkResourceLoader.cpp:
630         (WebKit::NetworkResourceLoader::didReceiveBuffer):
631         (WebKit::NetworkResourceLoader::didFinishLoading):
632         * NetworkProcess/NetworkResourceLoader.h:
633         * NetworkProcess/PingLoad.h:
634         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
635         (WebKit::NetworkCache::SpeculativeLoad::didReceiveBuffer):
636         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
637         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
638         (WebKit::NetworkDataTask::didReceiveResponse):
639         (WebKit::NetworkDataTask::didReceiveData):
640         * Shared/WebHitTestResultData.cpp:
641         * WebProcess/Network/WebResourceLoader.cpp:
642         (WebKit::WebResourceLoader::didReceiveResource):
643
644 2016-06-05  Sam Weinig  <sam@webkit.org>
645
646         Add experimental support for spring based CSS animations
647         https://bugs.webkit.org/show_bug.cgi?id=158403
648
649         Reviewed by Dean Jackson.
650
651         * Shared/WebCoreArgumentCoders.cpp:
652         (IPC::ArgumentCoder<StepsTimingFunction>::decode):
653         (IPC::ArgumentCoder<SpringTimingFunction>::encode):
654         (IPC::ArgumentCoder<SpringTimingFunction>::decode):
655         (IPC::ArgumentCoder<FloatPoint>::encode):
656         * Shared/WebCoreArgumentCoders.h:
657         * Shared/WebPreferencesDefinitions.h:
658         * WebProcess/WebPage/WebPage.cpp:
659         (WebKit::WebPage::updatePreferences):
660         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
661         (WebKit::PlatformCAAnimationRemote::Properties::encode):
662         (WebKit::PlatformCAAnimationRemote::Properties::decode):
663         (WebKit::addAnimationToLayer):
664         Pipe through support for the Spring animation.
665
666 2016-06-07  Michael Catanzaro  <mcatanzaro@igalia.com>
667
668         [GTK] Hide GTK+ 2 plugins if GTK+ 2 plugin process was built but is not installed
669         https://bugs.webkit.org/show_bug.cgi?id=158419
670
671         Reviewed by Carlos Garcia Campos.
672
673         Patch by Alberto Garcia <berto@igalia.com>
674
675         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
676         (WebKit::PluginInfoStore::getPluginInfo):
677         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
678         (WebKit::PluginProcessProxy::scanPlugin):
679
680 2016-06-06  Antoine Quint  <graouts@apple.com>
681
682         Position of WebGL <canvas> on iOS is incorrect with CSS borders
683         https://bugs.webkit.org/show_bug.cgi?id=156790
684
685         Reviewed by Simon Fraser.
686
687         WebGL layers on iOS are hosted by a WKRemoteView, which applies a transform scaling
688         its content by the inverse of the device pixel ratio, which affects how positions are
689         applied to the WebGL layer. The container layer of the layer hosted by a WKRemoteView
690         then has an inverse transform applied to it in the PlatformCALayerRemoteCustom
691         constructor. However, the position of a CALayer is not affected by its transform.
692
693         The fix for <rdar://problem/18316542> should be specific to video, so we only apply the
694         scaling in the case of a LayerTypeAVPlayerLayer.
695
696         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
697         (-[WKRemoteView initWithFrame:contextID:]):
698         (WebKit::RemoteLayerTreeHost::createLayer):
699         (-[WKRemoteView initWithFrame:contextID:hostingDeviceScaleFactor:]): Deleted.
700         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
701         (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
702
703 2016-06-06  Brady Eidson  <beidson@apple.com>
704
705         Fix build after r201717
706
707         Unreviewed.
708
709         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
710         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
711
712         * NetworkProcess/NetworkProcess.cpp:
713         (WebKit::NetworkProcess::grantSandboxExtensionsToDatabaseProcessForBlobs):
714         * NetworkProcess/NetworkProcess.h:
715         
716 2016-06-06  Brady Eidson  <beidson@apple.com>
717
718         Modern IDB: Crash seen in IDBConnectionProxy::putOrAdd on GuardMalloc bot
719         https://bugs.webkit.org/show_bug.cgi?id=158124
720
721         Reviewed by Darin Adler.
722         
723         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
724         (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
725         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
726         
727         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
728         (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
729         * WebProcess/FileAPI/BlobRegistryProxy.h:
730         
731         * WebProcess/Network/NetworkProcessConnection.cpp:
732         (WebKit::NetworkProcessConnection::didClose):
733         (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
734         * WebProcess/Network/NetworkProcessConnection.h:
735
736 2016-06-06  Commit Queue  <commit-queue@webkit.org>
737
738         Unreviewed, rolling out r201706.
739         https://bugs.webkit.org/show_bug.cgi?id=158427
740
741         This change broke the Yosemite build and its LayoutTest is
742         failing on Mac and iOS testers (Requested by ryanhaddad on
743         #webkit).
744
745         Reverted changeset:
746
747         "Add experimental support for spring based CSS animations"
748         https://bugs.webkit.org/show_bug.cgi?id=158403
749         http://trac.webkit.org/changeset/201706
750
751 2016-06-06  Alex Christensen  <achristensen@webkit.org>
752
753         Reduce ResourceRequest copying in loading code
754         https://bugs.webkit.org/show_bug.cgi?id=158251
755
756         Reviewed by Darin Adler.
757
758         * NetworkProcess/Downloads/DownloadManager.cpp:
759         (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
760         (WebKit::DownloadManager::continueWillSendRequest):
761         (WebKit::DownloadManager::willDecidePendingDownloadDestination):
762         * NetworkProcess/Downloads/DownloadManager.h:
763         * NetworkProcess/Downloads/PendingDownload.cpp:
764         (WebKit::PendingDownload::PendingDownload):
765         (WebKit::PendingDownload::willSendRedirectedRequest):
766         (WebKit::PendingDownload::continueWillSendRequest):
767         (WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync):
768         * NetworkProcess/Downloads/PendingDownload.h:
769         * NetworkProcess/NetworkDataTask.h:
770         (WebKit::NetworkDataTask::firstRequest):
771         * NetworkProcess/NetworkLoad.cpp:
772         (WebKit::NetworkLoad::cancel):
773         (WebKit::NetworkLoad::continueWillSendRequest):
774         (WebKit::NetworkLoad::sharedDidReceiveResponse):
775         (WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
776         (WebKit::NetworkLoad::setPendingDownload):
777         (WebKit::NetworkLoad::willPerformHTTPRedirection):
778         (WebKit::NetworkLoad::didReceiveChallenge):
779         (WebKit::NetworkLoad::didFail):
780         (WebKit::NetworkLoad::willSendRequestAsync):
781         * NetworkProcess/NetworkLoad.h:
782         (WebKit::NetworkLoad::currentRequest):
783         (WebKit::NetworkLoad::clearCurrentRequest):
784         (WebKit::NetworkLoad::pendingDownloadID):
785         * NetworkProcess/NetworkLoadClient.h:
786         * NetworkProcess/NetworkProcess.cpp:
787         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
788         (WebKit::NetworkProcess::continueWillSendRequest):
789         (WebKit::NetworkProcess::pendingDownloadCanceled):
790         * NetworkProcess/NetworkProcess.h:
791         * NetworkProcess/NetworkResourceLoader.cpp:
792         (WebKit::NetworkResourceLoader::didFailLoading):
793         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
794         (WebKit::NetworkResourceLoader::continueWillSendRequest):
795         (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
796         * NetworkProcess/NetworkResourceLoader.h:
797         * NetworkProcess/PingLoad.h:
798         (WebKit::PingLoad::PingLoad):
799         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
800         (WebKit::NetworkCache::SpeculativeLoad::~SpeculativeLoad):
801         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
802         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
803         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
804         (WebKit::NetworkDataTask::didBecomeDownload):
805         (WebKit::NetworkDataTask::willPerformHTTPRedirection):
806         * WebProcess/Network/WebResourceLoader.cpp:
807         (WebKit::WebResourceLoader::detachFromCoreLoader):
808         (WebKit::WebResourceLoader::willSendRequest):
809         * WebProcess/Network/WebResourceLoader.h:
810
811 2016-06-05  Sam Weinig  <sam@webkit.org>
812
813         Add experimental support for spring based CSS animations
814         https://bugs.webkit.org/show_bug.cgi?id=158403
815
816         Reviewed by Dean Jackson.
817
818         * Shared/WebCoreArgumentCoders.cpp:
819         (IPC::ArgumentCoder<StepsTimingFunction>::decode):
820         (IPC::ArgumentCoder<SpringTimingFunction>::encode):
821         (IPC::ArgumentCoder<SpringTimingFunction>::decode):
822         (IPC::ArgumentCoder<FloatPoint>::encode):
823         * Shared/WebCoreArgumentCoders.h:
824         * Shared/WebPreferencesDefinitions.h:
825         * WebProcess/WebPage/WebPage.cpp:
826         (WebKit::WebPage::updatePreferences):
827         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
828         (WebKit::PlatformCAAnimationRemote::Properties::encode):
829         (WebKit::PlatformCAAnimationRemote::Properties::decode):
830         (WebKit::addAnimationToLayer):
831         Pipe through support for the Spring animation.
832
833 2016-06-05  Yusuke Suzuki  <utatane.tea@gmail.com>
834
835         Change ProxyObject.[[Get]] not to use custom accessor
836         https://bugs.webkit.org/show_bug.cgi?id=157080
837
838         Reviewed by Darin Adler.
839
840         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
841         (WebKit::JSNPObject::propertyGetter):
842         (WebKit::JSNPObject::methodGetter):
843         * WebProcess/Plugins/Netscape/JSNPObject.h:
844
845 2016-06-05  Brady Eidson  <beidson@apple.com>
846
847         Unreviewed, rolling out r201694.
848
849         201693
850
851         Reverted changeset:
852
853         "Fix the build after r201693."
854         https://bugs.webkit.org/show_bug.cgi?id=158394
855         http://trac.webkit.org/changeset/201694
856
857 2016-06-05  Brady Eidson  <beidson@apple.com>
858
859         Fix the build after r201693.
860         https://bugs.webkit.org/show_bug.cgi?id=158394
861
862         Reviewed by NOBODY (Build fix).
863
864         r201693 landed without the Source/WebKit2 changes, and I didn't have EWS/CQ available to check myself. *sigh*
865         
866         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
867         (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
868         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
869         
870         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
871         (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
872         * WebProcess/FileAPI/BlobRegistryProxy.h:
873         
874         * WebProcess/Network/NetworkProcessConnection.cpp:
875         (WebKit::NetworkProcessConnection::didClose):
876         (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
877         * WebProcess/Network/NetworkProcessConnection.h:
878
879 2016-06-03  Commit Queue  <commit-queue@webkit.org>
880
881         Unreviewed, rolling out r201663.
882         https://bugs.webkit.org/show_bug.cgi?id=158374
883
884         Broke the Windows build (Requested by andersca on #webkit).
885
886         Reverted changeset:
887
888         "Rename NoncopyableFunction to Function"
889         https://bugs.webkit.org/show_bug.cgi?id=158354
890         http://trac.webkit.org/changeset/201663
891
892 2016-06-03  Anders Carlsson  <andersca@apple.com>
893
894         Rename NoncopyableFunction to Function
895         https://bugs.webkit.org/show_bug.cgi?id=158354
896
897         Reviewed by Chris Dumez.
898
899         * NetworkProcess/NetworkProcess.cpp:
900         (WebKit::fetchDiskCacheEntries):
901         (WebKit::NetworkProcess::fetchWebsiteData):
902         (WebKit::clearDiskCacheEntries):
903         * NetworkProcess/NetworkProcess.h:
904         * NetworkProcess/cache/NetworkCache.cpp:
905         (WebKit::NetworkCache::Cache::traverse):
906         * NetworkProcess/cache/NetworkCache.h:
907         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
908         (WebKit::NetworkCache::runTaskInQueue):
909         * NetworkProcess/cache/NetworkCacheStorage.h:
910
911 2016-06-03  Chris Dumez  <cdumez@apple.com>
912
913         Unreviewed, roll out r196633 as it broke PageCache on iOS for WebKit.org
914         <rdar://problem/26521101>
915
916         * WebProcess/WebPage/VisitedLinkTableController.cpp:
917         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
918         (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
919         (WebKit::VisitedLinkTableController::allVisitedLinkStateChanged):
920         (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
921
922 2016-06-03  Csaba Osztrogonác  <ossy@webkit.org>
923
924         Fix the !ENABLE(INDEXED_DATABASE) build after r201575
925         https://bugs.webkit.org/show_bug.cgi?id=158346
926
927         Reviewed by Brady Eidson.
928
929         * DatabaseProcess/DatabaseProcess.cpp:
930         (WebKit::DatabaseProcess::fetchWebsiteData):
931         (WebKit::DatabaseProcess::deleteWebsiteData):
932         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
933
934 2016-06-02  Chris Dumez  <cdumez@apple.com>
935
936         Crash under WebProcess::registerWithStateDumper()
937         https://bugs.webkit.org/show_bug.cgi?id=158304
938         <rdar://problem/25329276>
939
940         Reviewed by Anders Carlsson.
941
942         The issue is that the block in registerWithStateDumper() was executed in
943         a background thread and is iterating over m_pageMap HashMap. The crash
944         occurs when a page gets removed from the m_pageMap HashMap while the
945         block is iterating over this same HashMap in another thread.
946
947         The solution proposed is to execute the registerWithStateDumper()'s
948         block in the main thread.
949
950         * WebProcess/cocoa/WebProcessCocoa.mm:
951         (WebKit::WebProcess::registerWithStateDumper):
952
953 2016-06-02  Brady Eidson  <beidson@apple.com>
954
955         Overhaul cross-thread use of ResourceRequest, ResourceResponse, and ResourceError.
956         https://bugs.webkit.org/show_bug.cgi?id=158293
957
958         Reviewed by Darin Adler.
959
960         * NetworkProcess/cache/NetworkCacheEntry.cpp:
961         (WebKit::NetworkCache::Entry::Entry):
962
963 2016-06-02  Chris Dumez  <cdumez@apple.com>
964
965         Modernize various lambda captures
966         https://bugs.webkit.org/show_bug.cgi?id=158292
967
968         Reviewed by Brady Eidson.
969
970         Modernize various lambda captures, especially the ones unnecessarily
971         allocating objects on the heap and destroying them in the lambda.
972
973         * NetworkProcess/NetworkProcess.cpp:
974         (WebKit::fetchDiskCacheEntries):
975         (WebKit::clearDiskCacheEntries):
976         (WebKit::NetworkProcess::fetchWebsiteData): Deleted.
977         * NetworkProcess/cache/NetworkCache.cpp:
978         (WebKit::NetworkCache::Cache::traverse):
979         * NetworkProcess/cache/NetworkCache.h:
980         * NetworkProcess/cache/NetworkCacheStorage.cpp:
981         (WebKit::NetworkCache::Storage::TraverseOperation::TraverseOperation):
982         * NetworkProcess/cache/NetworkCacheStorage.h:
983
984 2016-06-02  Chris Dumez  <cdumez@apple.com>
985
986         Speculative revalidated request returns 200 instead of 304
987         https://bugs.webkit.org/show_bug.cgi?id=158256
988
989         Reviewed by Antti Koivisto and Carlos Garcia Campos.
990
991         Already conditional requests coming from WebCore should bypass the
992         SpeculativeLoadManager. This is because the validation is requested
993         by WebCore (usually the memory cache) and not our network cache. As
994         a result, we need to pipe the revalidation response (e.g. 304 status
995         code) back to WebCore instead of resolving it as disk cache level.
996
997         This should fix the /webkit2/WebKitWebResource/response unit test.
998
999         * NetworkProcess/cache/NetworkCache.cpp:
1000         (WebKit::NetworkCache::Cache::retrieve):
1001         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1002         (WebKit::NetworkCache::requestsHeadersMatch):
1003
1004 2016-06-02  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1005
1006         Use more references in ResourceLoader related code
1007         https://bugs.webkit.org/show_bug.cgi?id=158222
1008
1009         Reviewed by Darin Adler.
1010
1011         * WebProcess/Network/WebLoaderStrategy.cpp:
1012         (WebKit::WebLoaderStrategy::loadResource):
1013         (WebKit::WebLoaderStrategy::schedulePluginStreamLoad):
1014         (WebKit::WebLoaderStrategy::scheduleLoad):
1015         (WebKit::WebLoaderStrategy::scheduleInternallyFailedLoad):
1016         (WebKit::WebLoaderStrategy::startLocalLoad):
1017         (WebKit::WebLoaderStrategy::networkProcessCrashed):
1018         * WebProcess/Network/WebLoaderStrategy.h:
1019         * WebProcess/Network/WebResourceLoader.cpp:
1020         (WebKit::WebResourceLoader::create):
1021         (WebKit::WebResourceLoader::WebResourceLoader):
1022         * WebProcess/Network/WebResourceLoader.h:
1023         * WebProcess/Plugins/PluginView.cpp:
1024         (WebKit::PluginView::Stream::start):
1025
1026 2016-06-01  Yongjun Zhang  <yongjun_zhang@apple.com>
1027
1028         Notify client immediately if network session doesn't exist for a synchronous XHR load.
1029         https://bugs.webkit.org/show_bug.cgi?id=158239
1030         <rdar://problem/26344251>
1031
1032         Reviewed by Brady Eidson.
1033
1034         For a synchronous XHR load, if the network session doesn't exist, we should notify NetworkLoadClient.
1035         Otherwise the Web process could hang when waiting for the synchronous load to finish.
1036
1037         * NetworkProcess/NetworkLoad.cpp:
1038         (WebKit::NetworkLoad::NetworkLoad):
1039
1040 2016-05-31  Brian Burg  <bburg@apple.com>
1041   
1042         REGRESSION(r191907): Can't enter combining diacritic marks in Web Inspector fields
1043         https://bugs.webkit.org/show_bug.cgi?id=158227
1044         <rdar://problem/26232464>
1045
1046         Reviewed by Darin Adler and Alexey Proskuryakov.
1047
1048         Web Inspector uses a WKWebView subclass for the inspector frontend interface.
1049         Since r191907, WKWebView does not have an inner WKView, and instead shares
1050         a WebViewImpl to implement the same methods as WKView. So, WKView is no longer
1051         involved at all when delivering keystrokes to the Web Inspector interface.
1052
1053         This caused a subtle regression where some keystrokes were not being interpreted
1054         in the same way by AppKit because WKWebView does not conform to NSTextInputClient
1055         but WKView does. AppKit won't automatically create a NSTextInputContext for a NSView
1056         unless the subclass is declared as conforming to NSTextInputClient. Thus, the keystroke
1057         never goes through NSTextInputContext machinery which converts the keystroke into
1058         a combining diacritic character.
1059
1060         This regression is covered by a new API test.
1061
1062         * UIProcess/API/Cocoa/WKWebView.mm: mark WKWebView as conforming to NSTextInputClient.
1063
1064 2016-06-01  Dan Bernstein  <mitz@apple.com>
1065
1066         Try to fix ENABLE(IOS_TOUCH_EVENTS) builds.
1067
1068         * WebProcess/WebPage/EventDispatcher.cpp:
1069         (WebKit::EventDispatcher::touchEvent):
1070
1071 2016-05-31  Darin Adler  <darin@apple.com>
1072
1073         Audit RenderObject casts and fix problems and style issues found
1074         https://bugs.webkit.org/show_bug.cgi?id=158221
1075
1076         Reviewed by Chris Dumez.
1077
1078         * Shared/WebRenderObject.cpp:
1079         (WebKit::WebRenderObject::WebRenderObject): Tightened up the code that
1080         builds the tree of objects; fewer local variables.
1081
1082         * WebProcess/Plugins/PluginView.cpp:
1083         (WebKit::PluginView::invalidateRect): Cast to RenderEmbeddedObject since
1084         that is the class used for plug-ins.
1085         (WebKit::PluginView::pluginProcessCrashed): Ditto.
1086         * WebProcess/WebPage/WebPage.cpp:
1087         (WebKit::WebPage::createPlugin): Ditto.
1088         (WebKit::WebPage::plugInIsPrimarySize): Check the renderer for null here.
1089         Did not change this to RenderEmbeddedObject, though, because I wasn't
1090         absolute certain this is only called with that type of renderer.
1091
1092         * WebProcess/WebPage/ios/WebPageIOS.mm:
1093         (WebKit::WebPage::rangeForWebSelectionAtPosition): Tweaked.
1094
1095 2016-06-01  Brady Eidson  <beidson@apple.com>
1096
1097         Modernize lambda usage for all callers of RunLoop::dispatch() (take 2).
1098         https://bugs.webkit.org/show_bug.cgi?id=158277
1099
1100         Reviewed by Chris Dumez.
1101
1102         * NetworkProcess/cache/NetworkCache.cpp:
1103         (WebKit::NetworkCache::Cache::deleteDumpFile):
1104
1105         * Platform/IPC/Connection.cpp:
1106         (IPC::Connection::addWorkQueueMessageReceiver):
1107         (IPC::Connection::removeWorkQueueMessageReceiver):
1108         (IPC::Connection::invalidate):
1109         (IPC::Connection::sendMessage):
1110         (IPC::Connection::processIncomingMessage):
1111         (IPC::Connection::postConnectionDidCloseOnConnectionWorkQueue):
1112
1113         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1114         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
1115
1116         * UIProcess/Storage/StorageManager.cpp:
1117         (WebKit::StorageManager::createSessionStorageNamespace):
1118         (WebKit::StorageManager::destroySessionStorageNamespace):
1119         (WebKit::StorageManager::setAllowedSessionStorageNamespaceConnection):
1120         (WebKit::StorageManager::cloneSessionStorageNamespace):
1121         (WebKit::StorageManager::processDidCloseConnection):
1122
1123         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1124         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
1125
1126         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1127         (WebKit::WebsiteDataStore::fetchData):
1128         (WebKit::WebsiteDataStore::removeData):
1129
1130 2016-06-01  Chris Dumez  <cdumez@apple.com>
1131
1132         [iOS] Regression(r200972): Crash under WebKit::WebPage::selectTextWithGranularityAtPoint()
1133         https://bugs.webkit.org/show_bug.cgi?id=158284
1134         <rdar://problem/26573954>
1135
1136         Reviewed by Ryosuke Niwa.
1137
1138         range can be null but r200972 started dereferencing it without null
1139         check. This patch adds a null check for range and uses the pre-r200972
1140         code path if range is null.
1141
1142         * WebProcess/WebPage/ios/WebPageIOS.mm:
1143         (WebKit::WebPage::selectTextWithGranularityAtPoint):
1144
1145 2016-06-01  Brady Eidson  <beidson@apple.com>
1146
1147         Modernize lambda usage for all callers of RunLoop::dispatch().
1148         https://bugs.webkit.org/show_bug.cgi?id=158265
1149
1150         Reviewed by Chris Dumez.
1151
1152         * DatabaseProcess/DatabaseProcess.cpp:
1153         (WebKit::DatabaseProcess::fetchWebsiteData):
1154         (WebKit::DatabaseProcess::deleteWebsiteData):
1155         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
1156         
1157         * NetworkProcess/NetworkProcess.cpp:
1158         (WebKit::fetchDiskCacheEntries):
1159         (WebKit::NetworkProcess::fetchWebsiteData):
1160         
1161         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1162         (WebKit::NetworkCache::Storage::remove):
1163         (WebKit::NetworkCache::retrieveFromMemory):
1164         
1165         * Platform/IPC/Connection.cpp:
1166         (IPC::Connection::SyncMessageState::processIncomingMessage):
1167         (IPC::Connection::processIncomingMessage):
1168         (IPC::Connection::connectionDidClose):
1169         (IPC::Connection::enqueueIncomingMessage):
1170         * Platform/IPC/mac/ConnectionMac.mm:
1171         (IPC::Connection::receiveSourceEventHandler):
1172         
1173         * Shared/mac/CookieStorageShim.mm:
1174         (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]):
1175         * UIProcess/API/APIUserContentExtensionStore.cpp:
1176         (API::UserContentExtensionStore::lookupContentExtension):
1177         (API::UserContentExtensionStore::compileContentExtension):
1178         (API::UserContentExtensionStore::removeContentExtension):
1179         
1180         * UIProcess/Launcher/ProcessLauncher.cpp:
1181         (WebKit::ProcessLauncher::ProcessLauncher):
1182         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1183         (WebKit::connectToService):
1184         
1185         * UIProcess/Storage/StorageManager.cpp:
1186         (WebKit::StorageManager::getSessionStorageOrigins):
1187         (WebKit::StorageManager::deleteSessionStorageOrigins):
1188         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
1189         (WebKit::StorageManager::getLocalStorageOrigins):
1190         (WebKit::StorageManager::getLocalStorageOriginDetails):
1191         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
1192         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
1193         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
1194         
1195         * UIProcess/WebPageProxy.cpp:
1196         (WebKit::WebPageProxy::isWebProcessResponsive):
1197         
1198         * UIProcess/WebProcessProxy.cpp:
1199         (WebKit::WebProcessProxy::isResponsive):
1200         
1201         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1202         (WebKit::WebsiteDataStore::fetchData):
1203         
1204         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1205         (WebKit::NetscapePlugin::pluginThreadAsyncCall):
1206         
1207         * WebProcess/Plugins/PluginView.cpp:
1208         (WebKit::PluginView::unprotectPluginFromDestruction):
1209         
1210         * WebProcess/WebPage/EventDispatcher.cpp:
1211         (WebKit::EventDispatcher::wheelEvent):
1212         (WebKit::EventDispatcher::gestureEvent):
1213         (WebKit::EventDispatcher::touchEvent):
1214         
1215         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
1216         (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):
1217
1218 2016-05-31  Yusuke Suzuki  <utatane.tea@gmail.com>
1219
1220         Unreviewed, roll out r201481, r201523: 0.3% regression in Octane code-load
1221         https://bugs.webkit.org/show_bug.cgi?id=158249
1222
1223         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1224         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1225
1226 2016-05-31  Beth Dakin  <bdakin@apple.com>
1227
1228         Add two optional items to WebViewImplDelegate
1229         https://bugs.webkit.org/show_bug.cgi?id=158242
1230         -and corresponding-
1231         rdar://problem/26473095
1232
1233         Reviewed by Tim Horton.
1234
1235         * UIProcess/Cocoa/WebViewImpl.h:
1236
1237 2016-05-31  Jer Noble  <jer.noble@apple.com>
1238
1239         REGRESSION (r201405): trailers.apple.com HUD is missing in fullscreen
1240         https://bugs.webkit.org/show_bug.cgi?id=158156
1241         <rdar://problem/26519589>
1242
1243         Reviewed by Darin Adler.
1244
1245         Only increase the frame of the webView (to account for top content inset) in one dimension.
1246
1247         * UIProcess/mac/WKFullScreenWindowController.mm:
1248         (-[WKFullScreenWindowController enterFullScreen:]):
1249
1250 2016-05-31  Chris Dumez  <cdumez@apple.com>
1251
1252         [iOS] Better deal with WebProcess suspension due to screen locking
1253         https://bugs.webkit.org/show_bug.cgi?id=158229
1254         <rdar://problem/17665473>
1255         <rdar://problem/26554699>
1256
1257         Reviewed by Tim Horton.
1258
1259         When locking the screen while MobileSafari is front-most, we would try keep
1260         trying to mark IOSurfaces as volatile until the 30 seconds timeout was
1261         reached. This patch deals more cleanly with this situation by only trying
1262         to mark IOSurfaces as volatile once if the suspension is due to screen
1263         locking. In such case, it is apparently expected that some IOSurfaces cannot
1264         be marked as volatile so it is enough to try once and let ourselves get
1265         suspended.
1266
1267         This patch also reduces the timeout from 30 seconds to ~3 seconds in the
1268         other suspension cases (e.g. homing out of MobileSafari). If we fail to mark
1269         them as purgeable for 3 seconds for a reason or another, it is no use in
1270         retrying, it is simply not going to happen and there is no reason to delay
1271         process suspension any further.
1272
1273         * WebProcess/WebPage/WebPage.cpp:
1274         (WebKit::WebPage::callVolatilityCompletionHandlers):
1275         (WebKit::WebPage::layerVolatilityTimerFired):
1276         (WebKit::WebPage::markLayersVolatileImmediatelyIfPossible):
1277         (WebKit::WebPage::markLayersVolatile):
1278         * WebProcess/WebPage/WebPage.h:
1279         (WebKit::WebPage::markLayersVolatile):
1280         * WebProcess/WebPage/ios/WebPageIOS.mm:
1281         (WebKit::WebPage::applicationDidEnterBackground):
1282         (WebKit::WebPage::applicationWillEnterForeground):
1283
1284 2016-05-31  Brady Eidson  <beidson@apple.com>
1285
1286         Make createCrossThreadTask() functions return on the stack instead of the heap.
1287         https://bugs.webkit.org/show_bug.cgi?id=158215
1288
1289         Reviewed by Darin Adler.
1290
1291         * DatabaseProcess/DatabaseProcess.cpp:
1292         (WebKit::DatabaseProcess::postDatabaseTask):
1293         (WebKit::DatabaseProcess::performNextDatabaseTask):
1294         (WebKit::DatabaseProcess::fetchWebsiteData):
1295         * DatabaseProcess/DatabaseProcess.h:
1296
1297 2016-05-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1298
1299         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.13.1 release.
1300
1301         * gtk/NEWS: Add release notes for 2.13.1.
1302
1303 2016-05-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1304
1305         Unreviewed. Fix GTK+ clean build after r201504.
1306
1307         * DatabaseProcess/DatabaseProcess.cpp: Add missing include.
1308
1309 2016-05-30  Brady Eidson  <beidson@apple.com>
1310
1311         Move CrossThreadCopier/CrossThreadTask to WTF.
1312         https://bugs.webkit.org/show_bug.cgi?id=158207
1313
1314         Reviewed by Alex Christensen.
1315
1316         * CMakeLists.txt:
1317         * WebKit2.xcodeproj/project.pbxproj:
1318
1319         * DatabaseProcess/DatabaseProcess.cpp:
1320         * DatabaseProcess/DatabaseProcess.h:
1321
1322         * Shared/WebCrossThreadCopier.cpp: Removed.
1323         * Shared/WebCrossThreadCopier.h: Removed.
1324
1325 2016-05-28  Chris Dumez  <cdumez@apple.com>
1326
1327         Templatize NoncopyableFunction class similarly to std::function
1328         https://bugs.webkit.org/show_bug.cgi?id=158185
1329
1330         Reviewed by Darin Adler.
1331
1332         Templatize NoncopyableFunction class similarly to std::function, so
1333         that it can be used as a std::function replacement in more places.
1334
1335         Previously, NoncopyableFunction could only support "void()" lambdas.
1336
1337         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1338         (WebKit::NetworkCache::runTaskInQueue):
1339
1340 2016-05-28  Alexey Proskuryakov  <ap@apple.com>
1341
1342         Fix the build with newer clang and other custom configuration options
1343         https://bugs.webkit.org/show_bug.cgi?id=158161
1344
1345         Reviewed by Dan Bernstein.
1346
1347         * NetworkProcess/ios/NetworkProcessIOS.mm: -setAllowsSpecificHTTPSCertificate:forHost:
1348         is now in CFNetworkSPI.h
1349         * NetworkProcess/mac/NetworkProcessMac.mm: Ditto.
1350         * Shared/mac/CookieStorageShimLibrary.cpp:
1351         (WebKit::WebKitCookieStorageShimInitialize): Use more portable std::call_once.
1352
1353 2016-05-28  Chris Dumez  <cdumez@apple.com>
1354
1355         Modernize lambda captures in the network disk cache implementation
1356         https://bugs.webkit.org/show_bug.cgi?id=158179
1357
1358         Reviewed by Darin Adler.
1359
1360         Modernize lambda captures in the network disk cache implementation.
1361
1362         * NetworkProcess/cache/NetworkCache.cpp:
1363         (WebKit::NetworkCache::Cache::retrieve):
1364         (WebKit::NetworkCache::Cache::store):
1365         (WebKit::NetworkCache::Cache::traverse):
1366         * NetworkProcess/cache/NetworkCache.h:
1367         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1368         (WebKit::NetworkCache::inputStreamReadReadyCallback):
1369         (WebKit::NetworkCache::outputStreamWriteReadyCallback):
1370         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1371         (WebKit::NetworkCache::Statistics::initialize):
1372         (WebKit::NetworkCache::Statistics::shrinkIfNeeded):
1373         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
1374         * NetworkProcess/cache/NetworkCacheStatistics.h:
1375         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1376         (WebKit::NetworkCache::Storage::updateFileModificationTime):
1377         (WebKit::NetworkCache::Storage::clear):
1378
1379 2016-05-27  Caitlin Potter  <caitp@igalia.com>
1380
1381         [JSC] implement async functions proposal
1382         https://bugs.webkit.org/show_bug.cgi?id=156147
1383
1384         Reviewed by Yusuke Suzuki.
1385
1386         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1387         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1388
1389 2016-05-27  Chris Dumez  <cdumez@apple.com>
1390
1391         Improve lambda capture in NetworkCache::Storage::synchronize()
1392         https://bugs.webkit.org/show_bug.cgi?id=158176
1393
1394         Reviewed by Brady Eidson.
1395
1396         Improve lambda capture in NetworkCache::Storage::synchronize(). We can
1397         now capture the std::unique_ptr<> variables directly thanks to:
1398         1. C++14's support for initializer's in lambda captures
1399         2. RunLoop::dispatch() now takes a NoncopyableFunction in instead of
1400            a std::function, allowing us to capture non-copyable variables.
1401
1402         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1403         (WebKit::NetworkCache::Storage::synchronize):
1404
1405 2016-05-27  Jeremy Jones  <jeremyj@apple.com>
1406
1407         Decrease flicker when changing video presentation mode.
1408         https://bugs.webkit.org/show_bug.cgi?id=158148
1409         rdar://problem/24476949
1410
1411         Reviewed by Tim Horton.
1412
1413         Prevent flicker by using setVideoFullscreenLayer with a completion handler to delay 
1414         enter fullscreen and cleanup fullscreen until the video layer has completely been
1415         installed or removed.
1416
1417         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
1418         (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
1419         (WebKit::WebVideoFullscreenManager::didExitFullscreen):
1420
1421 2016-05-27  Chris Dumez  <cdumez@apple.com>
1422
1423         WorkQueue::dispatch() / RunLoop::dispatch() should not copy captured lambda variables
1424         https://bugs.webkit.org/show_bug.cgi?id=158111
1425
1426         Reviewed by Darin Adler.
1427
1428         WorkQueue::dispatch() / RunLoop::dispatch() should not copy captured lambda variables.
1429         These are often used cross-thread and copying the captured lambda variables can be
1430         dangerous (e.g. we do not want to copy a String after calling isolatedCopy() upon
1431         capture).
1432
1433         * NetworkProcess/NetworkProcess.cpp:
1434         (WebKit::clearDiskCacheEntries):
1435         * NetworkProcess/cache/NetworkCache.cpp:
1436         (WebKit::NetworkCache::Cache::clear):
1437         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1438         (WebKit::NetworkCache::runTaskInQueue):
1439         * Platform/IPC/Connection.cpp:
1440         (IPC::Connection::processIncomingMessage):
1441         * UIProcess/Storage/StorageManager.cpp:
1442         (WebKit::StorageManager::getSessionStorageOrigins):
1443         (WebKit::StorageManager::deleteSessionStorageOrigins):
1444         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
1445         (WebKit::StorageManager::getLocalStorageOrigins):
1446         (WebKit::StorageManager::getLocalStorageOriginDetails):
1447         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
1448         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
1449         * UIProcess/Storage/StorageManager.h:
1450
1451 2016-05-27  Alex Christensen  <achristensen@webkit.org>
1452
1453         Expose content extension failure error codes in SPI
1454         https://bugs.webkit.org/show_bug.cgi?id=158095
1455         rdar://problem/26475651
1456
1457         Reviewed by Anders Carlsson.
1458
1459         * UIProcess/API/APIUserContentExtensionStore.cpp:
1460         (API::UserContentExtensionStore::synchronousRemoveAllContentExtensions):
1461         (API::UserContentExtensionStore::invalidateContentExtensionVersion):
1462         Added for testing.
1463         (API::userContentExtensionStoreErrorCategory):
1464         * UIProcess/API/APIUserContentExtensionStore.h:
1465         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
1466         Added the new enum, _WKUserContentExtensionStoreErrorCode.
1467         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
1468         (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
1469         Sometimes the error code returned by UserContentExtensionStore::compileContentExtension has the error code from compileRuleList.
1470         When this happens, we want to get the message from the internal compiler error, but we want the NSError's code to always be CompileFailed.
1471         (-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
1472         (-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
1473         (-[_WKUserContentExtensionStore _removeAllContentExtensions]):
1474         (-[_WKUserContentExtensionStore _invalidateContentExtensionVersionForIdentifier:]):
1475         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
1476         Added new invalidator for testing.
1477
1478 2016-05-27  Zalan Bujtas  <zalan@apple.com>
1479
1480         Regression(r200972): Webcore::Range::collectSelectionsRects() asserts in startContainer() while selecting text.
1481         https://bugs.webkit.org/show_bug.cgi?id=158155
1482         <rdar://problem/26502712>
1483
1484         Reviewed by Chris Dumez.
1485
1486         This patch ensures that we still have a valid paragraphRange after returning from enclosingTextUnitOfGranularity().
1487
1488         * WebProcess/WebPage/ios/WebPageIOS.mm:
1489         (WebKit::WebPage::selectTextWithGranularityAtPoint):
1490
1491 2016-05-26  Brady Eidson  <beidson@apple.com>
1492
1493         Certain NetworkResourceLoader callbacks can deref a null m_networkLoad.
1494         https://bugs.webkit.org/show_bug.cgi?id=158134
1495
1496         Reviewed by Alex Christensen.
1497
1498         It's legit for m_networkLoad to be null in these callbacks.
1499         
1500         We need null checks, just like we have in many other callbacks in this class.
1501         
1502         * NetworkProcess/NetworkResourceLoader.cpp:
1503         (WebKit::NetworkResourceLoader::continueWillSendRequest):
1504         (WebKit::NetworkResourceLoader::continueCanAuthenticateAgainstProtectionSpace):
1505
1506 2016-05-26  Darin Adler  <darin@apple.com>
1507
1508         Media queries and platform screen modernization and streamlining
1509         https://bugs.webkit.org/show_bug.cgi?id=158067
1510
1511         Reviewed by Alex Christensen.
1512
1513         * Shared/mac/WebEventFactory.mm:
1514         (WebKit::screenForWindow): Deleted.
1515         (WebKit::flipScreenPoint): Deleted.
1516         (WebKit::globalPoint): Deleted.
1517         (WebKit::globalPointForEvent): Use globalPoint function from WebCore so we don't need
1518         copies of everything in here.
1519
1520         * UIProcess/Cocoa/WebViewImpl.mm:
1521         (WebKit::WebViewImpl::windowDidChangeScreen): Removed unneeded type cast.
1522         (WebKit::WebViewImpl::draggedImage): Added type cast since globalPoint now returns an
1523         NSPoint rather than an IntPoint.
1524
1525         * UIProcess/WebPageProxy.h: Use pragma once. Add a WebCore prefix to a use of
1526         PlatformDisplayID, since that is now inside the WebCore namespace.
1527         * WebProcess/WebCoreSupport/WebChromeClient.h: Ditto.
1528         * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.h: Ditto.
1529         * WebProcess/WebPage/DrawingArea.h: Ditto.
1530         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: Ditto.
1531
1532 2016-05-26  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1533
1534         Purge PassRefPtr in Modules/battery
1535         https://bugs.webkit.org/show_bug.cgi?id=157062
1536
1537         Reviewed by Darin Adler.
1538
1539         Use RefPtr<>& to reduce uses of PassRefPtr in WebKit.
1540
1541         * WebProcess/Battery/WebBatteryManager.cpp:
1542         (WebKit::WebBatteryManager::didChangeBatteryStatus):
1543         (WebKit::WebBatteryManager::updateBatteryStatus):
1544         * WebProcess/WebPage/WebPage.cpp:
1545         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
1546
1547 2016-05-26  Myles C. Maxfield  <mmaxfield@apple.com>
1548
1549         Build fix
1550
1551         Rubber stamped by Lucas Forschler.
1552
1553         * Configurations/DebugRelease.xcconfig:
1554
1555 2016-05-25  Jer Noble  <jer.noble@apple.com>
1556
1557         Flashiness and jumpiness when entering fullscreen
1558         https://bugs.webkit.org/show_bug.cgi?id=158087
1559
1560         Reviewed by Beth Dakin.
1561
1562         Multiple independant sources of jumpiness and flashiness are addressed here:
1563
1564         - Setting the top content inset on the WKView cause a vertical jump during fullscreen
1565         transition. Instead of setting the content inset to 0, take the existing inset into account
1566         when placing the WKView in the NSWindow.
1567
1568         - The enter fullscreen transition causes a white flash due to the NSWindow needing
1569         display before ordering onscreen. Ensure the window has a backing by calling -displayIfNeeded
1570         before entering fullscreen mode.
1571
1572         - The exit fullscreen transition causes a white background color flash for an unknown
1573         reason, but is solved by not making the window's content view layer-backed. Rather than
1574         directly animating the contentView's background color, create a specific background view
1575         and animate it's background color instead.
1576
1577         * UIProcess/mac/WKFullScreenWindowController.h:
1578         * UIProcess/mac/WKFullScreenWindowController.mm:
1579         (-[WKFullScreenWindowController initWithWindow:webView:page:]):
1580         (-[WKFullScreenWindowController enterFullScreen:]):
1581         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
1582         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
1583         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
1584         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
1585         * WebProcess/FullScreen/WebFullScreenManager.cpp:
1586         (WebKit::WebFullScreenManager::saveScrollPosition): Deleted.
1587         (WebKit::WebFullScreenManager::restoreScrollPosition): Deleted.
1588
1589 2016-05-25  Alex Christensen  <achristensen@webkit.org>
1590
1591         Fix CMake build.
1592
1593         * PlatformMac.cmake:
1594
1595 2016-05-25  Chris Dumez  <cdumez@apple.com>
1596
1597         Simplify a few lambda captures in the network cache code
1598         https://bugs.webkit.org/show_bug.cgi?id=158076
1599
1600         Reviewed by Antti Koivisto.
1601
1602         Simplify a few lambda captures in the network cache code by WTFMoving
1603         upon capture.
1604
1605         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1606         (WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
1607         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
1608         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
1609         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
1610         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1611         (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
1612         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
1613         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
1614         (WebKit::NetworkCache::Statistics::writeTimerFired):
1615         (WebKit::NetworkCache::Statistics::addHashesToDatabase):
1616         (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase):
1617         * NetworkProcess/cache/NetworkCacheStatistics.h:
1618
1619 2016-05-25  Fujii Hironori  <Hironori.Fujii@sony.com>
1620
1621         [Unix] Potential buffer overrun of m_fileDescriptors in readBytesFromSocket of ConnectionUnix.cpp
1622         https://bugs.webkit.org/show_bug.cgi?id=158058
1623
1624         Reviewed by Carlos Garcia Campos.
1625
1626         Memcpy does not check the boundary of m_fileDescriptors in
1627         readBytesFromSocket of ConnectionUnix.cpp.  This is not a problem
1628         in normal cases, but in the case when Web process is hijacked and
1629         malicious IPC packets were sent.  WTF::Vector already has two
1630         members m_capacity and m_size.  There is no need to have a
1631         separate member m_fileDescriptorsSize to remember the number of
1632         remaining data.
1633
1634         * Platform/IPC/Connection.h: Remove members m_readBufferSize and
1635         m_fileDescriptorsSize.
1636         * Platform/IPC/unix/ConnectionUnix.cpp:
1637         (IPC::Connection::platformInitialize): Removed initialization of
1638         m_readBufferSize and m_fileDescriptorsSize.  Reserve initial
1639         capacity for m_readBuffer and m_fileDescriptors.
1640         (IPC::Connection::processMessage): Replace m_readBufferSize and
1641         m_fileDescriptorsSize with m_readBuffer.size() and
1642         m_fileDescriptors.size().  Use Vector::shrink() to reset the
1643         number of remaining data in the buffers.
1644         (IPC::readBytesFromSocket) : Change argument types to WTF::Vector
1645         instead of pointers and sizes.
1646         (IPC::Connection::readyReadHandler): Call new readBytesFromSocket
1647
1648 2016-05-25  Chris Dumez  <cdumez@apple.com>
1649
1650         Update constructRevalidationRequest() to stop returning a unique_ptr<ResourceRequest>
1651         https://bugs.webkit.org/show_bug.cgi?id=158046
1652
1653         Reviewed by Darin Adler.
1654
1655         Update constructRevalidationRequest() to stop returning a unique_ptr<ResourceRequest>
1656         and to return a ResourceRequest instead. There is no reason for it to return a
1657         pointer.
1658
1659         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1660         (WebKit::NetworkCache::constructRevalidationRequest):
1661         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry):
1662         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::revalidationRequest):
1663         (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
1664         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
1665         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
1666
1667 2016-05-25  Antoine Quint  <graouts@apple.com>
1668
1669         Elements with backdrop-filter cannot be clipped with clip-path or mask
1670         https://bugs.webkit.org/show_bug.cgi?id=142662
1671         <rdar://problem/20150192>
1672
1673         Reviewed by Dean Jackson.
1674
1675         Ensure layer clones are set up with the same shape path as their original layer.
1676
1677         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1678         (WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
1679
1680 2016-05-24  Chris Dumez  <cdumez@apple.com>
1681
1682         Simplify a couple of lambda captures in the network cache code
1683         https://bugs.webkit.org/show_bug.cgi?id=158053
1684
1685         Reviewed by Brady Eidson.
1686
1687         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1688         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
1689         Just capture subResourceInfo instead of allocating a new copy
1690         on the heap. There is no reason we cannot simply capture
1691         subResourceInfo here.
1692
1693         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1694         (WebKit::NetworkCache::Storage::clear):
1695         Use new C++14 capture with initialization to make the code a
1696         bit nicer.
1697
1698 2016-05-24  Conrad Shultz  <conrad_shultz@apple.com>
1699
1700         _WKThumbnailView should expose its snapshot size
1701         https://bugs.webkit.org/show_bug.cgi?id=158049
1702
1703         Reviewed by Tim Horton.
1704
1705         * UIProcess/API/Cocoa/_WKThumbnailView.h:
1706         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
1707         (-[_WKThumbnailView _didTakeSnapshot:]):
1708         Update the new snapshotSize property in a KVO-compliant manner.
1709
1710 2016-05-24  Ryan Haddad  <ryanhaddad@apple.com>
1711
1712         Unreviewed, rolling out r201349.
1713
1714         This change caused compositing tests to assert on iOS
1715         simulator
1716
1717         Reverted changeset:
1718
1719         "Elements with backdrop-filter cannot be clipped with clip-
1720         path or mask"
1721         https://bugs.webkit.org/show_bug.cgi?id=142662
1722         http://trac.webkit.org/changeset/201349
1723
1724 2016-05-24  Ryan Haddad  <ryanhaddad@apple.com>
1725
1726         Unreviewed, rolling out r201341.
1727
1728         This change may have caused LayoutTests to crash on Mac and
1729         iOS
1730
1731         Reverted changeset:
1732
1733         "Use lambda capture with initializer instead of StringCapture"
1734         https://bugs.webkit.org/show_bug.cgi?id=158010
1735         http://trac.webkit.org/changeset/201341
1736
1737 2016-05-24  Alex Christensen  <achristensen@webkit.org>
1738
1739         Fix null pointer dereferencing in WebViewImpl::inputContext
1740         https://bugs.webkit.org/show_bug.cgi?id=158026
1741         rdar://problem/25994093
1742
1743         Reviewed by Tim Horton.
1744
1745         * UIProcess/API/Cocoa/WKWebView.mm:
1746         (-[WKWebView inputContext]):
1747         this was null sometimes in WebViewImpl::inputContext.
1748
1749 2016-05-24  Antoine Quint  <graouts@apple.com>
1750
1751         Elements with backdrop-filter cannot be clipped with clip-path or mask
1752         https://bugs.webkit.org/show_bug.cgi?id=142662
1753         <rdar://problem/20150192>
1754
1755         Reviewed by Dean Jackson.
1756
1757         Ensure layer clones are set up with the same shape path as their original layer.
1758
1759         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1760         (WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
1761
1762 2016-05-24  Chelsea Pugh  <cpugh@apple.com>
1763
1764         [iOS] Allow clients to override the type of an input field
1765         https://bugs.webkit.org/show_bug.cgi?id=157995
1766
1767         Reviewed by Dan Bernstein.
1768
1769         * UIProcess/API/Cocoa/_WKFormInputSession.h:
1770         * UIProcess/ios/WKContentViewInteraction.mm:
1771         (-[WKFormInputSession textContentType]): Getter for textContentType.
1772         (-[WKFormInputSession setTextContentType:]): Set the textContentType and reload
1773         input views.
1774         (contentTypeFromFieldName): Factor out switch statement to get text content type
1775         from autofill field name into its own function.
1776         (-[WKContentView textInputTraits]): If the client has set a text content type,
1777         set the traits' content type to that. Otherwise, set the text content type if
1778         there is one based on the assisted node information's autofill field name. If
1779         neither the form input session nor the assisted node info yields a text content
1780         type, set the text content type to nil, its default value.
1781
1782 2016-05-24  Chris Dumez  <cdumez@apple.com>
1783
1784         Use lambda capture with initializer instead of StringCapture
1785         https://bugs.webkit.org/show_bug.cgi?id=158010
1786
1787         Reviewed by Antti Koivisto.
1788
1789         Use lambda capture with initializer instead of StringCapture now that 
1790         we support C++14.
1791
1792         * NetworkProcess/cache/NetworkCache.cpp:
1793         (WebKit::NetworkCache::Cache::deleteDumpFile):
1794         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1795         (WebKit::NetworkCache::Statistics::initialize):
1796         (WebKit::NetworkCache::Statistics::shrinkIfNeeded):
1797         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1798         (WebKit::NetworkCache::Storage::updateFileModificationTime):
1799         (WebKit::NetworkCache::Storage::clear):
1800         * UIProcess/API/APIUserContentExtensionStore.cpp:
1801         (API::UserContentExtensionStore::lookupContentExtension):
1802         (API::UserContentExtensionStore::compileContentExtension):
1803         (API::UserContentExtensionStore::removeContentExtension):
1804         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1805         (WebKit::WebsiteDataStore::fetchData):
1806         (WebKit::WebsiteDataStore::removeData):
1807
1808 2016-05-24  Chris Dumez  <cdumez@apple.com>
1809
1810         Use auto for some of our lambda function parameters
1811         https://bugs.webkit.org/show_bug.cgi?id=158001
1812
1813         Reviewed by Darin Adler.
1814
1815         Use auto for some of our lambda function parameters now that we build with c++14.
1816
1817         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1818         (WebKit::WebIDBConnectionToClient::didGetRecord):
1819         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1820         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
1821         * NetworkProcess/NetworkProcess.cpp:
1822         (WebKit::fetchDiskCacheEntries):
1823         (WebKit::NetworkProcess::fetchWebsiteData):
1824         (WebKit::clearDiskCacheEntries):
1825         * NetworkProcess/NetworkResourceLoader.cpp:
1826         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
1827         (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
1828         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1829         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
1830         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1831         (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
1832         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
1833         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
1834         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
1835         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
1836         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1837         (WebKit::NetworkCache::Storage::removeFromPendingWriteOperations):
1838         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1839         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1840         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
1841         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
1842         (-[_WKRemoteObjectInterface debugDescription]):
1843         * UIProcess/API/C/WKApplicationCacheManager.cpp:
1844         (WKApplicationCacheManagerGetApplicationCacheOrigins):
1845         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1846         (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
1847         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
1848         * UIProcess/API/C/WKResourceCacheManager.cpp:
1849         (WKResourceCacheManagerGetCacheOrigins):
1850         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1851         (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
1852         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
1853         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
1854         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
1855         (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
1856         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1857         (WebKit::PlatformCALayerRemote::removeAnimationForKey):
1858
1859 2016-05-23  Yusuke Suzuki  <utatane.tea@gmail.com>
1860
1861         Assertion failure for Reflect.get with Proxy and primitive value as explicit receiver
1862         https://bugs.webkit.org/show_bug.cgi?id=157080
1863
1864         Reviewed by Saam Barati.
1865
1866         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1867         (WebKit::JSNPObject::propertyGetter):
1868         (WebKit::JSNPObject::methodGetter):
1869         * WebProcess/Plugins/Netscape/JSNPObject.h:
1870
1871 2016-05-23  Chris Dumez  <cdumez@apple.com>
1872
1873         Generate bindings code for EventTarget.addEventListener() / removeEventListener()
1874         https://bugs.webkit.org/show_bug.cgi?id=157882
1875
1876         Reviewed by Darin Adler.
1877
1878         Generate bindings code for EventTarget.addEventListener() / removeEventListener()
1879         instead of hardcoding them in the bindings generator.
1880
1881         * WebProcess/Plugins/PDF/PDFPluginAnnotation.h:
1882         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
1883         (WebKit::PDFPluginAnnotation::attach):
1884         (WebKit::PDFPluginAnnotation::~PDFPluginAnnotation):
1885         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm:
1886         (WebKit::PDFPluginPasswordField::~PDFPluginPasswordField):
1887         (WebKit::PDFPluginPasswordField::createAnnotationElement):
1888         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
1889         (WebKit::PDFPluginTextAnnotation::~PDFPluginTextAnnotation):
1890         (WebKit::PDFPluginTextAnnotation::createAnnotationElement):
1891
1892 2016-05-23  Beth Dakin  <bdakin@apple.com>
1893
1894         Need SPI for clients to require a user action to get an editing controls 
1895         manager
1896         https://bugs.webkit.org/show_bug.cgi?id=157992
1897         -and corresponding-
1898         rdar://problem/26379927
1899
1900         Reviewed by Tim Horton.
1901
1902         New SPI _setRequiresUserActionForEditingControlsManager. The SPI defaults to 
1903         False, which means that by default there is no user action requirement to 
1904         have an editing controls manager. The SPI is on WKViewPrivate and 
1905         WKWebViewConfigurationPrivate, and it’s implemented in WebViewImpl.
1906         * UIProcess/API/Cocoa/WKViewPrivate.h:
1907         * UIProcess/API/Cocoa/WKWebView.mm:
1908         (-[WKWebView _initializeWithConfiguration:]):
1909         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1910         (-[WKWebViewConfiguration init]):
1911         (-[WKWebViewConfiguration copyWithZone:]):
1912         (-[WKWebViewConfiguration _requiresUserActionForEditingControlsManager]):
1913         (-[WKWebViewConfiguration _setRequiresUserActionForEditingControlsManager:]):
1914         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1915         * UIProcess/API/mac/WKView.mm:
1916         (-[WKView _requiresUserActionForEditingControlsManager]):
1917         (-[WKView _setRequiresUserActionForEditingControlsManager:]):
1918         * UIProcess/Cocoa/WebViewImpl.h:
1919         (WebKit::WebViewImpl::setRequiresUserActionForEditingControlsManager):
1920         (WebKit::WebViewImpl::requiresUserActionForEditingControlsManager):
1921
1922         New message allows the WebProcess to tell the UI process whether the current 
1923         web page has had any selection changes based on user interaction.
1924         * UIProcess/WebPageProxy.cpp:
1925         (WebKit::WebPageProxy::setHasHadSelectionChangesFromUserInteraction):
1926         * UIProcess/WebPageProxy.h:
1927         (WebKit::WebPageProxy::hasHadSelectionChangesFromUserInteraction):
1928         * UIProcess/WebPageProxy.messages.in:
1929
1930         m_userIsInteracting m_hasFocusedDueToUserInteraction used to be iOS only, but 
1931         now we want to track them for Mac as well.
1932         * WebProcess/WebPage/WebPage.cpp:
1933
1934         Handling mouse events and key events will toggle m_userIsInteracting.
1935         (WebKit::WebPage::mouseEvent):
1936         (WebKit::WebPage::keyEvent):
1937
1938         m_userIsInteracting is no longer iOS-only.
1939         (WebKit::WebPage::setInitialFocus):
1940
1941         Send a message to the UI process on page transition to re-set 
1942         hasHadSelectionChangesFromUserInteraction to false.
1943         (WebKit::WebPage::didStartPageTransition):
1944
1945         Send a message to the UI process if this is the first selection change to 
1946         happen as a result of a user action.
1947         (WebKit::WebPage::didChangeSelection):
1948         * WebProcess/WebPage/WebPage.h:
1949
1950 2016-05-23  Alex Christensen  <achristensen@webkit.org>
1951
1952         Add logging for NSURLSession calls
1953         https://bugs.webkit.org/show_bug.cgi?id=157996
1954
1955         Reviewed by Brady Eidson.
1956
1957         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1958         (WebKit::NetworkDataTask::NetworkDataTask):
1959         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1960         (toNSURLSessionResponseDisposition):
1961         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1962         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
1963         (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]):
1964         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1965         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
1966         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
1967         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
1968         * Platform/Logging.h:
1969
1970 2016-05-23  Chris Fleizach  <cfleizach@apple.com>
1971
1972         AX: iOS: when bringing focus to a text field we may zoom the page even if author wanted max scale = 1
1973         https://bugs.webkit.org/show_bug.cgi?id=157771
1974
1975         Reviewed by Tim Horton.
1976
1977         * Shared/AssistedNodeInformation.cpp:
1978         (WebKit::AssistedNodeInformation::encode):
1979         (WebKit::AssistedNodeInformation::decode):
1980         * Shared/AssistedNodeInformation.h:
1981         * UIProcess/ios/WKContentViewInteraction.mm:
1982         (-[WKContentView _displayFormNodeInputView]):
1983         * WebProcess/WebPage/ios/WebPageIOS.mm:
1984         (WebKit::WebPage::getAssistedNodeInformation):
1985
1986 2016-05-23  Miguel Gomez  <magomez@igalia.com>
1987
1988         [ThreadedCompositor] Ensure that the BitmapTexture used by CoordinatedBackingStoreTile matches the opacity of the painted surface
1989         https://bugs.webkit.org/show_bug.cgi?id=157942
1990
1991         Reviewed by Žan Doberšek.
1992
1993         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
1994         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
1995         Reset the BitmapTexture if it doesn't match the opacity required by the surface
1996         that's being painted.
1997
1998 2016-05-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1999
2000         [GTK] Disk cache: enable speculative revalidation
2001         https://bugs.webkit.org/show_bug.cgi?id=157125
2002
2003         Reviewed by Sergio Villar Senin.
2004
2005         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2006         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
2007         * UIProcess/API/gtk/WebKitWebContext.cpp:
2008         (webkitWebContextConstructed):
2009         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2010         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2011         * UIProcess/WebProcessPool.cpp:
2012         (WebKit::WebProcessPool::ensureNetworkProcess):
2013         * config.h:
2014
2015 2016-05-22  Brady Eidson  <beidson@apple.com>
2016
2017         Move to C++14.
2018         https://bugs.webkit.org/show_bug.cgi?id=157948
2019
2020         Reviewed by Michael Catanzaro.
2021
2022         * Configurations/Base.xcconfig:
2023
2024         Replace time literal suffixes that have underscores to the forms without
2025         (e.g. 0_ms becomes 0ms):
2026         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2027         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
2028
2029         * NetworkProcess/NetworkResourceLoader.cpp:
2030         (WebKit::NetworkResourceLoader::startNetworkLoad):
2031
2032         * NetworkProcess/cache/NetworkCache.cpp:
2033         (WebKit::NetworkCache::responseHasExpired):
2034         (WebKit::NetworkCache::responseNeedsRevalidation):
2035         (WebKit::NetworkCache::makeStoreDecision):
2036
2037         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2038         (WebKit::NetworkCache::responseNeedsRevalidation):
2039
2040         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2041         (WebKit::NetworkCache::Storage::dispatchReadOperation):
2042         (WebKit::NetworkCache::Storage::store):
2043         (WebKit::NetworkCache::computeRecordWorth):
2044
2045         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
2046
2047         * UIProcess/ViewGestureController.cpp:
2048
2049         * WebProcess/Network/WebLoaderStrategy.cpp:
2050         (WebKit::maximumBufferingTime):
2051
2052         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2053         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately):
2054         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
2055
2056 2016-05-21  Andy Estes  <aestes@apple.com>
2057
2058         REGRESSION (r188642): All pages are blank when printing a webpage in iOS Safari
2059         https://bugs.webkit.org/show_bug.cgi?id=157924
2060         rdar://problem/22524550
2061
2062         Reviewed by Sam Weinig.
2063
2064         When UIPrintInteractionController asks WKWebView to print a webpage, it does so in several phases. First we're
2065         asked to compute the page count, followed later by a series of messages asking us to draw each page into a
2066         provided CGContext.
2067
2068         When asked for the page count, we send a message to the Web process instructing it to compute and
2069         return the page count synchronously and then immediately start drawing the page for printing. If the drawing has
2070         finished by the time we're asked to print the first page, then we can do so without waiting. But if it hasn't
2071         then we block by calling Connection::waitForMessage(), passing std::chromo::milliseconds::max() as the relative
2072         timeout.
2073         
2074         Prior to r188642, Connection::waitForMessage() called std::condition_variable::wait_for(), which takes a
2075         relative timeout value. r188642 replaced this with WTF::Condition::waitUntil(), which takes an absolute timeout
2076         instead. To convert from relative to absolute, this line was added to Connection::waitForMessage():
2077
2078             Condition::Clock::time_point absoluteTimeout = Condition::Clock::now() + timeout;
2079
2080         std::chrono will convert both operands to a common duration type before performing the addition. When timeout
2081         equals something very large, like milliseconds::max(), this conversion results in signed integer overflow,
2082         giving absoluteTimeout a value less than Clock::now() and making waitForMessage time out immediately.
2083         
2084         To fix this, compute how many milliseconds remain on our clock, and add the smaller of that and the timeout
2085         value to Clock::now() to arrive at an absolute timeout.
2086
2087         * Platform/IPC/Connection.cpp:
2088         (IPC::Connection::waitForMessage):
2089         * UIProcess/API/Cocoa/WKWebView.mm:
2090         (-[WKWebView _printedDocument]): Removed an unnecessary nanoseconds-to-milliseconds conversion.
2091
2092 2016-05-20  Enrica Casucci  <enrica@apple.com>
2093
2094         Drag cannot start if no drag data or custom data is available in the Pasteboard.
2095         https://bugs.webkit.org/show_bug.cgi?id=157911
2096         rdar://problem/24577706
2097
2098         Reviewed by Tim Horton.
2099
2100         We need to make sure there is always one item in common between source and target
2101         of the drag and drop operation.
2102
2103         * UIProcess/Cocoa/WebViewImpl.mm:
2104         (WebKit::WebViewImpl::dragImageForView):
2105
2106 2016-05-20  John Wilander  <wilander@apple.com>
2107
2108         Remove unnecessary PageOverlay client function pageOverlayDestroyed
2109         https://bugs.webkit.org/show_bug.cgi?id=157388
2110         <rdar://problem/25471523>
2111
2112         Reviewed by Tim Horton.
2113
2114         Remove dead PageOverlay code. Almost all of these overrides were empty and
2115         never called. In the case of WebPageOverlay it was never called but had a
2116         function body, causing confusion. There was a fear of dangling pointers in
2117         WebPageOverlay's static hash map between PageOverlays and WebPageOverlays.
2118         Only WebPageOverlay's constructor creates its PageOverlay object and adds it
2119         to the hash map. Its client object is kept in a unique pointer member which
2120         is automatically deleted when the WebPageOverlay object itself is deleted.
2121         This explains why PageOverlayClientImpl::pageOverlayDestroyed in
2122         WKBundlePageOverlay can safely be removed. Finally, WebPageOverlay's
2123         destructor clears the hash map entry for its PageOverlay object. Thus, there
2124         is no need to call WebPageOverlay::pageOverlayDestroyed nor a need for
2125         WebPageOverlay's destructor to call pageOverlayDestroyed on its client.
2126
2127         No new tests. I tried to come up with a WebKit API test for this but I
2128         wasn't able to test presence/absence of WebPageOverlay's map entries since
2129         the map is not exposed.
2130
2131         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
2132         (WebKit::PageOverlayClientImpl::pageOverlayDestroyed): Deleted.
2133         * WebProcess/Plugins/PDF/PDFPlugin.h:
2134         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2135         (WebKit::PDFPlugin::HUD::pageOverlayDestroyed): Deleted.
2136         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2137         * WebProcess/WebCoreSupport/WebInspectorClient.h:
2138         (WebKit::WebInspectorClient::pageOverlayDestroyed): Deleted.
2139         * WebProcess/WebPage/FindController.cpp:
2140         * WebProcess/WebPage/FindController.h:
2141         (WebKit::FindController::pageOverlayDestroyed): Deleted.
2142         * WebProcess/WebPage/WebPageOverlay.cpp:
2143         * WebProcess/WebPage/WebPageOverlay.h:
2144         (WebKit::WebPageOverlay::pageOverlayDestroyed): Deleted.
2145         * WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
2146         (WebKit::FindIndicatorOverlayClientIOS::pageOverlayDestroyed): Deleted.
2147
2148 2016-05-19  Chris Dumez  <cdumez@apple.com>
2149
2150         Improve compile-time assertions in is<>() / downcast<>()
2151         https://bugs.webkit.org/show_bug.cgi?id=157817
2152
2153         Reviewed by Darin Adler.
2154
2155         Add missing includes.
2156
2157         * WebProcess/WebPage/WebFrame.cpp:
2158         * WebProcess/WebPage/WebPage.cpp:
2159
2160 2016-05-19  Tim Horton  <timothy_horton@apple.com>
2161
2162         Mail crashes under TiledCoreAnimationDrawingAreaProxy::createFenceForGeometryUpdate() when the Web process crashes
2163         https://bugs.webkit.org/show_bug.cgi?id=157927
2164         <rdar://problem/24793374>
2165
2166         Reviewed by Dean Jackson.
2167
2168         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2169         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
2170         With just the right combination of layout mechanisms and Web Content process
2171         crash timing, it is possible to get a frame change underneath WebPageProxy::processDidCrash,
2172         before the DrawingArea has been nulled out but after the Connection has.
2173         This can lead to a null dereference. I had a lot of trouble writing a API
2174         test for this, though I'm certain it's possible.
2175
2176 2016-05-16  Enrica Casucci  <enrica@apple.com>
2177
2178         No candidate punctuation when typing punctuation in WK2 text field.
2179         https://bugs.webkit.org/show_bug.cgi?id=157773
2180         rdar://problem/23084603
2181
2182         Reviewed by Sam Weinig.
2183
2184         We need to adopt the new addInputString:withFlags:withInputManagerHint function
2185         for this to work propertly.
2186
2187         * Platform/spi/ios/UIKitSPI.h:
2188         * UIProcess/ios/WKContentViewInteraction.mm:
2189         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
2190
2191 2016-05-19  Brady Eidson  <beidson@apple.com>
2192
2193         Finishing off: Modern IDB: Website data store management.
2194         https://bugs.webkit.org/show_bug.cgi?id=157626
2195
2196         Reviewed by Alex Christensen.
2197
2198         * DatabaseProcess/DatabaseProcess.cpp:
2199         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
2200         (WebKit::removeAllDatabasesForOriginPath): Deleted.
2201         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigins): Deleted.
2202         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedSince): Deleted.
2203         * DatabaseProcess/DatabaseProcess.h:
2204
2205 2016-05-19  Brent Fulgham  <bfulgham@apple.com>
2206
2207         [OS X][WK2] Expand sandbox for new mach endpoints
2208         https://bugs.webkit.org/show_bug.cgi?id=157919
2209         <rdar://problem/25238336>
2210
2211         Reviewed by Alexey Proskuryakov.
2212
2213         Grant the WebContent and Networking processes the mach lookup capability for
2214         various Security-related mach endpoints..
2215
2216         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2217         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2218
2219 2016-05-19  Brian Burg  <bburg@apple.com>
2220
2221         Web Inspector: CRASH when closing a page while element selection mode is enabled via Develop menu
2222         https://bugs.webkit.org/show_bug.cgi?id=157925
2223         <rdar://problem/26259618>
2224
2225         Reviewed by Joseph Pecoraro.
2226
2227         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2228         (WebKit::WebInspectorClient::elementSelectionChanged):
2229         Null-check m_page->inspector() since it will return nullptr if the page
2230         is closed but not yet destructed. This is triggered by teardown code
2231         in InspectorDOMAgent::willDestroyFrontendAndBackend.
2232
2233 2016-05-19  Enrica Casucci  <enrica@apple.com>
2234
2235         Drag cannot start if no drag data is available in the Pasteboard.
2236         https://bugs.webkit.org/show_bug.cgi?id=157911
2237         rdar://problem/24577706
2238
2239         Reviewed by Tim Horton.
2240
2241         Setting dummy data to allow drag to start.
2242
2243         * Shared/mac/PasteboardTypes.h:
2244         * Shared/mac/PasteboardTypes.mm:
2245         * UIProcess/Cocoa/WebViewImpl.mm:
2246         (WebKit::WebViewImpl::registerDraggedTypes):
2247         (WebKit::WebViewImpl::dragImageForView):
2248
2249 2016-05-19  Jer Noble  <jer.noble@apple.com>
2250
2251         [IOS] Add setting to allow playback to continue inline after exiting fullscreen.
2252         https://bugs.webkit.org/show_bug.cgi?id=157912
2253
2254         Reviewed by Eric Carlson.
2255
2256         Add a preference and configuration property to control whether media should be allowed to continue
2257         playing inline when exiting fullscreen.
2258
2259         * Shared/WebPreferencesDefinitions.h:
2260         * UIProcess/API/Cocoa/WKWebView.mm:
2261         (-[WKWebView _initializeWithConfiguration:]):
2262         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2263         (-[WKWebViewConfiguration init]):
2264         (-[WKWebViewConfiguration encodeWithCoder:]):
2265         (-[WKWebViewConfiguration initWithCoder:]):
2266         (-[WKWebViewConfiguration copyWithZone:]):
2267         (-[WKWebViewConfiguration _allowsInlineMediaPlaybackAfterFullscreen]):
2268         (-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackAfterFullscreen:]):
2269         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2270         * UIProcess/mac/WKFullScreenWindowController.mm:
2271         (disableScreenUpdates):
2272         (enableScreenUpdates):
2273         (-[WKFullScreenWindowController enterFullScreen:]):
2274         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
2275         (-[WKFullScreenWindowController exitFullScreen]):
2276         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
2277         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
2278         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
2279         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
2280         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
2281         * WebProcess/WebPage/WebPage.cpp:
2282         (WebKit::WebPage::updatePreferences):
2283
2284 2016-05-19  Brian Burg  <bburg@apple.com>
2285
2286         Web Inspector: timelines should not update via requestAnimationFrame unless Web Inspector is visible
2287         https://bugs.webkit.org/show_bug.cgi?id=157897
2288         <rdar://problem/26330802>
2289
2290         Reviewed by Timothy Hatcher.
2291
2292         The UIProcess needs to notify the Inspector frontend when it is truly visible.
2293         The frontend can't use document.visibilityState because it doesn't seem to work
2294         if the inspector frontend's WKWebView is created but not attached to a window.
2295
2296         * UIProcess/WebInspectorProxy.cpp:
2297         (WebKit::WebInspectorProxy::open):
2298         (WebKit::WebInspectorProxy::didClose):
2299         Send visibility updates to the inspector process when the inspector becomes
2300         "visible" or "not visible". It becomes visible if it is attached to the
2301         inspected page's window, or gets its own native window.
2302
2303         * WebProcess/WebPage/WebInspectorUI.cpp:
2304         (WebKit::WebInspectorUI::frontendLoaded):
2305         (WebKit::WebInspectorUI::setDockingUnavailable):
2306         (WebKit::WebInspectorUI::setIsVisible):
2307         Call InspectorFrontendAPI.updateVisibilityState to let the frontend know.
2308
2309         * WebProcess/WebPage/WebInspectorUI.h:
2310         * WebProcess/WebPage/WebInspectorUI.messages.in:
2311         Add new message.
2312
2313 2016-05-19  Brian Burg  <bburg@apple.com>
2314
2315         Web Inspector: use a consistent prefix for injected scripts
2316         https://bugs.webkit.org/show_bug.cgi?id=157715
2317         <rdar://problem/26287188>
2318
2319         Reviewed by Timothy Hatcher.
2320
2321         * CMakeLists.txt:
2322         * DerivedSources.make:
2323         * WebProcess/Automation/WebAutomationSessionProxy.js:
2324
2325 2016-05-18  Anders Carlsson  <andersca@apple.com>
2326
2327         Add WKPreferencesRef getter/setter pair to set RTL mode
2328         https://bugs.webkit.org/show_bug.cgi?id=157873
2329         rdar://problem/26329970
2330
2331         Reviewed by Tim Horton.
2332
2333         * UIProcess/API/C/WKPreferences.cpp:
2334         (WKPreferencesSetUserInterfaceDirectionPolicy):
2335         (WKPreferencesGetUserInterfaceDirectionPolicy):
2336         * UIProcess/API/C/WKPreferencesRef.h:
2337
2338 2016-05-18  Alex Christensen  <achristensen@webkit.org>
2339
2340         Clean up CSS code
2341         https://bugs.webkit.org/show_bug.cgi?id=157808
2342
2343         Reviewed by Chris Dumez.
2344
2345         * UIProcess/Cocoa/WebViewImpl.mm:
2346
2347 2016-05-18  Jer Noble  <jer.noble@apple.com>
2348
2349         Disable default user gesture requirement for audio playback on Mac
2350         https://bugs.webkit.org/show_bug.cgi?id=157820
2351
2352         Reviewed by Sam Weinig.
2353
2354         Disable the WebPreferences and matching WKWebViewConfiguration.mediaTypesRequiringUserActionForPlayback
2355         settings on Mac (and other non-iOS ports).
2356
2357         * Shared/WebPreferencesDefinitions.h:
2358         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2359         (-[WKWebViewConfiguration init]):
2360
2361 2016-05-18  Alex Christensen  <achristensen@webkit.org>
2362
2363         Build fix when not using CredentialStorage with NetworkSession.
2364
2365         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2366         (WebKit::NetworkSession::clearCredentials):
2367
2368 2016-05-18  Brady Eidson  <beidson@apple.com>
2369
2370         Fix null-deref crash sporadically seen after http://trac.webkit.org/changeset/201098
2371
2372         No review.
2373
2374         * DatabaseProcess/DatabaseProcess.cpp:
2375         (WebKit::DatabaseProcess::deleteWebsiteData): Don't access m_idbServer directly, as calling
2376           the idbServer() accessor is how you actually get your IDBServer created for you.
2377
2378 2016-05-18  Brian Burg  <bburg@apple.com>
2379
2380         Web Inspector: InspectorFrontendAPI.setTimelineProfilingEnabled should not implicitly show Timelines tab
2381         https://bugs.webkit.org/show_bug.cgi?id=157846
2382
2383         Reviewed by Timothy Hatcher.
2384
2385         Add a separate ShowTimelines message to WebInspector and WebInspectorUI. Have the
2386         start/stop profiling methods in public APIs explicitly call showTimelines() rather than
2387         relying on InspectorFrontendAPI to do it.
2388
2389         * UIProcess/API/C/WKInspector.cpp:
2390         (WKInspectorTogglePageProfiling):
2391         * UIProcess/WebInspectorProxy.cpp:
2392         (WebKit::WebInspectorProxy::showTimelines):
2393         * UIProcess/WebInspectorProxy.h:
2394         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
2395         (WKBundleInspectorSetPageProfilingEnabled):
2396         * WebProcess/WebPage/WebInspector.cpp:
2397         (WebKit::WebInspector::showTimelines):
2398         * WebProcess/WebPage/WebInspector.h:
2399         * WebProcess/WebPage/WebInspector.messages.in:
2400         * WebProcess/WebPage/WebInspectorUI.cpp:
2401         (WebKit::WebInspectorUI::showTimelines):
2402         * WebProcess/WebPage/WebInspectorUI.h:
2403         * WebProcess/WebPage/WebInspectorUI.messages.in:
2404
2405 2016-05-18  Brady Eidson  <beidson@apple.com>
2406
2407         Modern IDB: Add support for server side closing of open database connections.
2408         https://bugs.webkit.org/show_bug.cgi?id=157843
2409
2410         Reviewed by Alex Christensen.
2411
2412         - Implement the required IDB delegate code.
2413         - Make DatabaseProcess::deleteWebsiteData call the right method in IDB server.
2414
2415         * DatabaseProcess/DatabaseProcess.cpp:
2416         (WebKit::DatabaseProcess::deleteWebsiteData):
2417
2418         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2419         (WebKit::WebIDBConnectionToClient::didGetRecord):
2420         (WebKit::WebIDBConnectionToClient::didCloseFromServer):
2421         (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
2422         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
2423         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
2424
2425         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2426         (WebKit::WebIDBConnectionToServer::confirmDidCloseFromServer):
2427         (WebKit::WebIDBConnectionToServer::didStartTransaction):
2428         (WebKit::WebIDBConnectionToServer::didCloseFromServer):
2429         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2430         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
2431
2432 2016-05-18  Brady Eidson  <beidson@apple.com>
2433
2434         Modern IDB: Make TestRunner.clearAllDatabases also delete IndexedDB databases (once doing so is supported).
2435         https://bugs.webkit.org/show_bug.cgi?id=157823
2436
2437         Reviewed by Alex Christensen.
2438
2439         * CMakeLists.txt:
2440         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2441         (WKWebsiteDataStoreRemoveAllIndexedDatabases):
2442         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2443
2444 2016-05-18  Brian Burg  <bburg@apple.com>
2445
2446         REGRESSION(r200959): "Start Timeline Recording" menu item doesn't start recording
2447         https://bugs.webkit.org/show_bug.cgi?id=157821
2448         <rdar://problem/26335429>
2449
2450         Reviewed by Timothy Hatcher.
2451
2452         In r200959, WebInspectorProxy started sending start/stop profiling
2453         messages directly to the frontend process to avoid the inspected page
2454         process from implicitly showing the frontend. To compensate, the WebKit
2455         API layer was changed to call show() in togglePageProfiling().
2456
2457         Unfortunately, this fix was not quite right, because the ordering of
2458         the Show and StartPageProfiling messages is undefined. The latter has to bounce
2459         from UI to inspected to inspector processes, so the frontend may try
2460         to start profiling before the frontend is shown, causing it to be ignored.
2461
2462         This patch takes a different approach: just remove all implicit show()
2463         calls in the inspected page processes, and bounce both the Show and
2464         StartPageProfiling messages through the inspected page process to ensure
2465         they are handled in order by the frontend process.
2466
2467         * UIProcess/WebInspectorProxy.cpp:
2468         (WebKit::WebInspectorProxy::togglePageProfiling):
2469         Revert to sending to the inspected page process.
2470
2471         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
2472         (WKBundleInspectorSetPageProfilingEnabled):
2473         Add a call to show() now that the implementation doesn't do it implicitly.
2474
2475         * WebProcess/WebPage/WebInspector.cpp:
2476         (WebKit::WebInspector::startPageProfiling):
2477         (WebKit::WebInspector::stopPageProfiling):
2478         Don't implicitly show the inspector. These methods are only called
2479         through the WKBundleInspector API and via IPC from WebInspectorProxy.
2480
2481 2016-05-17  Beth Dakin  <bdakin@apple.com>
2482
2483         Make handleAcceptedCandidate a public function
2484         https://bugs.webkit.org/show_bug.cgi?id=157763
2485         -and corresponding-
2486         rdar://problem/26206397
2487
2488         Reviewed by Tim Horton.
2489
2490         This patch makes handleAcceptedCandidate a public member of WebViewImpl 
2491         instead of a private member. 
2492         * UIProcess/Cocoa/WebViewImpl.h:
2493         (WebKit::WebViewImpl::createWeakPtr):
2494
2495 2016-05-17  Dean Jackson  <dino@apple.com>
2496
2497         Remove ES6_GENERATORS flag
2498         https://bugs.webkit.org/show_bug.cgi?id=157815
2499         <rdar://problem/26332894>
2500
2501         Reviewed by Geoffrey Garen.
2502
2503         This flag isn't needed. Generators are enabled everywhere and
2504         part of a stable specification.
2505
2506         * Configurations/FeatureDefines.xcconfig:
2507
2508 2016-05-17  Dean Jackson  <dino@apple.com>
2509
2510         Temporarily enable Experimental Features
2511         https://bugs.webkit.org/show_bug.cgi?id=157810
2512         <rdar://problem/26330804>
2513
2514         Reviewed by Anders Carlsson.
2515
2516         We currently don't have good UI for enabling these features,
2517         which would mean Safari Technology Preview users would
2518         never be able to turn them on… unless we enable them by
2519         default temporarily.
2520
2521         * Shared/WebPreferencesDefinitions.h:
2522
2523 2016-05-17  Filip Pizlo  <fpizlo@apple.com>
2524
2525         WTF should know about Language
2526         https://bugs.webkit.org/show_bug.cgi?id=157756
2527
2528         Reviewed by Geoffrey Garen and Alexey Proskuryakov.
2529
2530         Rewires a bunch of includes/imports.
2531
2532         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
2533         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2534         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2535         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
2536
2537 2016-05-17  Jer Noble  <jer.noble@apple.com>
2538
2539         Unreviewed GTK+ and EFL bulid fix; make the audio playback user gesture requirement
2540         Cocoa-only.
2541
2542         * Shared/WebPreferencesDefinitions.h:
2543
2544 2016-05-16  Anders Carlsson  <andersca@apple.com>
2545
2546         Add a WKA extension point for WKPreferences SPI
2547         https://bugs.webkit.org/show_bug.cgi?id=157762
2548         rdar://problem/24529203
2549
2550         Reviewed by Sam Weinig.
2551
2552         * UIProcess/API/Cocoa/WKPreferences.mm:
2553
2554 2016-05-16  David Kilzer  <ddkilzer@apple.com>
2555
2556         Action sheets don’t work in presented view controllers
2557         <https://webkit.org/b/157754>
2558         <rdar://problem/26304845>
2559
2560         Reviewed by Anders Carlsson.
2561
2562         * UIProcess/ios/WKActionSheet.mm:
2563         (-[WKActionSheet presentSheetFromRect:]):
2564         (-[WKActionSheet willRotate]):
2565         - Call SPI to get the presenting view controller, since it may
2566           not always be the root view controller.
2567
2568 2016-05-13  Enrica Casucci  <enrica@apple.com>
2569
2570         Text selection is basically impossible on plain text pages.
2571         https://bugs.webkit.org/show_bug.cgi?id=157681
2572         rdar://problem/26065660
2573
2574         Reviewed by Darin Adler.
2575
2576         When dealing with a plain text file, the rules for deciding whether
2577         a position is selectable should be different and we should never
2578         switch to block selection.
2579
2580         * WebProcess/WebPage/ios/WebPageIOS.mm:
2581         (WebKit::WebPage::shouldSwitchToBlockModeForHandle):
2582         (WebKit::rectIsTooBigForSelection): Added helper function.
2583         (WebKit::WebPage::selectTextWithGranularityAtPoint):
2584         (WebKit::WebPage::getPositionInformation):
2585
2586 2016-05-16  Chelsea Pugh  <cpugh@apple.com>
2587
2588         [iOS] Remove dispatch_after in -[WKFormInputSession setSuggestions:]
2589         https://bugs.webkit.org/show_bug.cgi?id=157745
2590
2591         Reviewed by Dan Bernstein.
2592
2593         * UIProcess/ios/WKContentViewInteraction.mm:
2594         (-[WKFormInputSession setSuggestions:]): Remove the dispatch_after since
2595         there is no longer a chance of keyboard suggestions replacing the
2596         suggestions set here.
2597
2598 2016-05-16  Brian Burg  <bburg@apple.com>
2599
2600         Crash simulating keystrokes at WebKit::WebAutomationSession::platformSimulateKeyStroke
2601         https://bugs.webkit.org/show_bug.cgi?id=157737
2602         <rdar://problem/26292946>
2603
2604         Reviewed by Timothy Hatcher.
2605
2606         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
2607         (WebKit::WebAutomationSession::platformSimulateKeyStroke):
2608         AppKit expects characters passed to [NSEvent keyEventWithType:...]
2609         to be non-nil even if there are no characters. Initialize characters
2610         to the empty string @"". It will be overwritten if the keystroke should
2611         produce any unicode characters.
2612
2613 2016-05-16  Brian Burg  <bburg@apple.com>
2614
2615         Web Automation: Automation.inspectBrowsingContext should automatically start page profiling
2616         https://bugs.webkit.org/show_bug.cgi?id=157739
2617
2618         Reviewed by Timothy Hatcher.
2619
2620         * UIProcess/API/C/WKInspector.cpp:
2621         (WKInspectorTogglePageProfiling):
2622         Implicitly show the Web Inspector in the C API command to preserve existing behavior.
2623
2624         * UIProcess/Automation/WebAutomationSession.cpp:
2625         (WebKit::WebAutomationSession::inspectorFrontendLoaded):
2626         If the frontend loaded, it was either because the user opened Web Inspector (and
2627         turning on page profiling is harmless), or it was loaded but not shown by the
2628         inspectBrowsingContext command. For the latter, we want to start page profiling
2629         before processing any additional commands so subsequent execution is captured.
2630
2631         * UIProcess/WebInspectorProxy.cpp:
2632         (WebKit::WebInspectorProxy::togglePageProfiling):
2633         Send the start/stop profiling messages directly to the WebInspectorUI process instead of
2634         bouncing through the inspected page's process, which does an implicit show() we don't want.
2635
2636         * UIProcess/WebPageProxy.cpp:
2637         (WebKit::WebPageProxy::inspector): Make it const.
2638         * UIProcess/WebPageProxy.h:
2639
2640 2016-05-16  Conrad Shultz  <conrad_shultz@apple.com>
2641
2642         Fix some deprecation warnings.
2643
2644         * UIProcess/mac/WKPrintingView.mm:
2645         (-[WKPrintingView _drawPDFDocument:page:atPoint:]):
2646         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
2647         (WebKit::PDFPlugin::setActiveAnnotation):
2648         (WebKit::PDFPlugin::lookupTextAtLocation):
2649         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h:
2650         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
2651         (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement):
2652         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h:
2653         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
2654         (WebKit::PDFPluginTextAnnotation::createAnnotationElement):
2655         * WebProcess/WebPage/mac/WebPageMac.mm:
2656         (WebKit::drawPDFPage):
2657
2658 2016-04-06  Jer Noble  <jer.noble@apple.com>
2659
2660         [WK2] Add API to WKWebViewConfiguration to control autoplay policy.
2661         https://bugs.webkit.org/show_bug.cgi?id=156312
2662
2663         Reviewed by Dan Bernstein.
2664
2665         Add a new API to WKWebViewConfiguration to allow fine-grained control over when media is allowed
2666         to play without a user gesture, and simultaneously deprecate the existing, all-or-nothing API,
2667         and deprecated the equivalent SPIs.
2668
2669         * UIProcess/API/Cocoa/WKWebView.mm:
2670         (-[WKWebView _initializeWithConfiguration:]):
2671         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2672         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2673         (-[WKWebViewConfiguration init]):
2674         (-[WKWebViewConfiguration encodeWithCoder:]):
2675         (-[WKWebViewConfiguration initWithCoder:]):
2676         (-[WKWebViewConfiguration copyWithZone:]):
2677         (-[WKWebViewConfiguration _requiresUserActionForVideoPlayback]):
2678         (-[WKWebViewConfiguration _setRequiresUserActionForVideoPlayback:]):
2679         (-[WKWebViewConfiguration _requiresUserActionForAudioPlayback]):
2680         (-[WKWebViewConfiguration _setRequiresUserActionForAudioPlayback:]):
2681         (-[WKWebViewConfiguration requiresUserActionForMediaPlayback]):
2682         (-[WKWebViewConfiguration setRequiresUserActionForMediaPlayback:]):
2683         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2684
2685 2016-05-16  Brian Burg  <bburg@apple.com>
2686
2687         Web Automation: WebAutomationSessionProxy.js gets injected more than once sometimes
2688         https://bugs.webkit.org/show_bug.cgi?id=157716
2689         <rdar://problem/26287306>
2690
2691         Reviewed by Timothy Hatcher.
2692
2693         Whenever a script was injected into a non-normal world by a WebKit client,
2694         the WebProcess's WebAutomationSessionProxy singleton would get a
2695         notification that the window was cleared from the relevant frame.
2696         This notification happens when creating the world's window shell for
2697         the first time.
2698
2699         This code should ignore such notifications that originate from non-main world
2700         contexts. Web Inspector's instrumentation already ignored this, but
2701         the automation session notification comes in via a different WebKit2 layer.
2702
2703         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2704         (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
2705
2706 2016-05-13  Dean Jackson  <dino@apple.com>
2707
2708         Fix iOS Build.
2709
2710         * Shared/AssistedNodeInformation.h:
2711         (WebKit::OptionItem::OptionItem):
2712
2713 2016-05-13  Sam Weinig  <sam@webkit.org>
2714
2715         REGRESSION (r200463): Autofill Credit Card expected but got Autofill Contact
2716         <rdar://problem/26251538>
2717         https://bugs.webkit.org/show_bug.cgi?id=157701
2718
2719         Reviewed by Dan Bernstein.
2720
2721         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
2722         (-[WKWebProcessPlugInFrame _certificateChain]):
2723         We need to do a retain-autorelease here now because the CertificateInfo's that contain the
2724         cached certificate chain, are being destroyed, and therefore destroying the chain, before this
2725         function returns. This used to work when the chain wasn't just a cache, because there was still
2726         a strong reference to it being held by the ResourceResponse's CertificateInfo copy, but now
2727         there is none.
2728
2729 2016-05-13  Dean Jackson  <dino@apple.com>
2730
2731         [iOS] <select> elements popover should render right-aligned when in RTL mode
2732         https://bugs.webkit.org/show_bug.cgi?id=157699
2733         <rdar://problem/26282319>
2734
2735         Reviewed by Simon Fraser.
2736
2737         Some follow-up changes as suggested by Darin in review.
2738
2739         * Shared/AssistedNodeInformation.h: Use initializers so we can
2740         remove the constructors.
2741         (WebKit::OptionItem::OptionItem): Deleted.
2742         (WebKit::AssistedNodeInformation::AssistedNodeInformation): Deleted.
2743         * UIProcess/ios/forms/WKFormSelectPopover.mm: Add a comment to explain
2744         why we are explicitly setting the language.
2745         (-[WKSelectTableViewController initWithView:hasGroups:]):
2746
2747 2016-05-13  Chris Dumez  <cdumez@apple.com>
2748
2749         [NetworkCache] Avoid having to re-parse URLs after deserializing them
2750         https://bugs.webkit.org/show_bug.cgi?id=157660
2751
2752         Reviewed by Darin Adler.
2753
2754         * NetworkProcess/cache/NetworkCacheCoders.cpp:
2755         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::encode): Deleted.
2756         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode): Deleted.
2757         * NetworkProcess/cache/NetworkCacheCoders.h:
2758         Drop template specializations used by our network cache for encoding
2759         / decoding URLs as Strings. This causes us to now rely on
2760         URL::encode() / URL::decode() instead.
2761
2762         * Shared/WebCoreArgumentCoders.cpp:
2763         (IPC::ArgumentCoder<BlobPart>::decode):
2764         Fix bug in BlobPart encoding / decoding. It was encoding the url member
2765         as a URL but decoding it as a String.
2766
2767 2016-05-13  Dan Bernstein  <mitz@apple.com>
2768
2769         Try to fix some non-iOS builds.
2770
2771         * mac/postprocess-framework-headers.sh:
2772
2773 2016-05-13  Ryan Haddad  <ryanhaddad@apple.com>
2774
2775         Attempt to fix the iOS build after r200874
2776
2777         Unreviewed build fix.
2778
2779         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2780
2781 2016-05-13  Sam Weinig  <sam@webkit.org>
2782
2783         Rename WKDataDetectorTypeSpotlightSuggestion to WKDataDetectorTypeLookupSuggestion
2784         <rdar://problem/26269611>
2785
2786         Reviewed by Dan Bernstein and Enrica Casucci. 
2787
2788         * Shared/API/Cocoa/WKFoundation.h:
2789         * Shared/API/c/WKDeclarationSpecifiers.h:
2790         * UIProcess/API/Cocoa/WKWebView.mm:
2791         (fromWKDataDetectorTypes):
2792         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2793         * mac/postprocess-framework-headers.sh:
2794
2795 2016-05-13  Beth Dakin  <bdakin@apple.com>
2796
2797         Add dyldSPI.h for linked on or after checks, and add one for link preview
2798         https://bugs.webkit.org/show_bug.cgi?id=157401
2799
2800         Reviewed by Darin Adler.
2801
2802         Set _allowsLinkPreview to YES for programs linked on or after 
2803         firstSDKVersionWithLinkPreviewEnabledByDefault.
2804         * UIProcess/API/Cocoa/WKWebView.h:
2805         * UIProcess/API/Cocoa/WKWebView.mm:
2806         (-[WKWebView _initializeWithConfiguration:]):
2807
2808 2016-05-13  Jer Noble  <jer.noble@apple.com>
2809
2810         Fullscreen view attempts to resize when in 2-up mode
2811         https://bugs.webkit.org/show_bug.cgi?id=157558
2812
2813         Reviewed by Darin Adler.
2814
2815         No need to react to NSApplicationDidChangeScreenParametersNotification to resize the
2816         fullscreen window when the screen parameters change; the NSWindow fullscreen machinery
2817         will do that on our behalf.
2818
2819         * UIProcess/mac/WKFullScreenWindowController.mm:
2820         (-[WKFullScreenWindowController windowDidLoad]): Deleted.
2821         (-[WKFullScreenWindowController applicationDidChangeScreenParameters:]): Deleted.
2822
2823 2016-05-13  Antoine Quint  <graouts@apple.com>
2824
2825         [iOS] <select> elements popover should render right-aligned when in RTL mode
2826         https://bugs.webkit.org/show_bug.cgi?id=157672
2827         <rdar://problem/26193442>
2828
2829         Reviewed by Darin Adler.
2830
2831         Add a new isRTL field to the AssistedNodeInformation as specified by the assisted
2832         node's render style and account for it when displaying the table view shown in the
2833         popover attached to the assisted node using the UIView semanticContentAttribute
2834         property.
2835
2836         * Shared/AssistedNodeInformation.cpp:
2837         (WebKit::AssistedNodeInformation::encode):
2838         (WebKit::AssistedNodeInformation::decode):
2839         * Shared/AssistedNodeInformation.h:
2840         (WebKit::AssistedNodeInformation::AssistedNodeInformation):
2841         * UIProcess/ios/forms/WKFormSelectPopover.mm:
2842         (-[WKSelectTableViewController initWithView:hasGroups:]):
2843         (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
2844         * WebProcess/WebPage/ios/WebPageIOS.mm:
2845         (WebKit::WebPage::getAssistedNodeInformation):
2846
2847 2016-05-13  Tina Liu  <iting_liu@apple.com>
2848
2849         Revert r199691.
2850         https://bugs.webkit.org/show_bug.cgi?id=157645
2851         <rdar://problem/26235373>
2852
2853         Reviewed by Darin Adler.
2854
2855         * Shared/WebProcessCreationParameters.cpp:
2856         (WebKit::WebProcessCreationParameters::encode): Deleted.
2857         (WebKit::WebProcessCreationParameters::decode): Deleted.
2858         * Shared/WebProcessCreationParameters.h:
2859         * UIProcess/API/C/mac/WKContextPrivateMac.h:
2860         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
2861         (WKContextSetPrivateBrowsingPluginLoadClientPolicy): Deleted.
2862         * UIProcess/WebProcessPool.cpp:
2863         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
2864         (WebKit::WebProcessPool::createNewWebProcess): Deleted.
2865         (WebKit::WebProcessPool::setPluginLoadClientPolicyForPrivateBrowsing): Deleted.
2866         (WebKit::WebProcessPool::setPrivateBrowsingPluginLoadClientPolicy): Deleted.
2867         (WebKit::WebProcessPool::clearPluginClientPolicies): Deleted.
2868         * UIProcess/WebProcessPool.h:
2869         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2870         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
2871         (WebKit::WebPlatformStrategies::longestMatchedWildcardHostForHost):
2872         (WebKit::WebPlatformStrategies::replaceHostWithMatchedWildcardHost):
2873         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost):
2874         (WebKit::WebPlatformStrategies::populatePluginCache):
2875         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicyForPrivateBrowsing): Deleted.
2876         (WebKit::WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy): Deleted.
2877         (WebKit::WebPlatformStrategies::clearPluginClientPolicies): Deleted.
2878         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHostForPrivateBrowsing): Deleted.
2879         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2880         * WebProcess/WebProcess.cpp:
2881         (WebKit::WebProcess::initializeWebProcess):
2882         (WebKit::WebProcess::setPluginLoadClientPolicies): Deleted.
2883         (WebKit::WebProcess::setPrivateBrowsingPluginLoadClientPolicy): Deleted.
2884         * WebProcess/WebProcess.h:
2885         * WebProcess/WebProcess.messages.in:
2886
2887 2016-05-12  Daniel Bates  <dabates@apple.com>
2888
2889         Use SecTask SPI to retrieve code signing identifier for user directory suffix
2890         https://bugs.webkit.org/show_bug.cgi?id=157570
2891         <rdar://problem/25706517>
2892
2893         Reviewed by Darin Adler.
2894
2895         It is sufficient to make use of the SecTask SPI to retrieve the code signing
2896         identifier of the embedding client for use in the user directory suffix. This
2897         avoids the need to allow Code Signing Services to have access to the bundle
2898         of the embedding client.
2899
2900         * Shared/mac/ChildProcessMac.mm:
2901         (WebKit::ChildProcess::initializeSandbox): Use the code signing identifier of the
2902         embedding client as part of the user directory suffix if available.
2903         * Shared/mac/CodeSigning.h: Update comment and include header wtf/spi/darwin/XPCSPI.h
2904         for the definition of xpc_connection_t. Renamed codeSigningIdentifier() to codeSigningIdentifierForCurrentProcess()
2905         to convey that it returns the code signing identifier for the current process. Repurposed
2906         the name codeSigningIdentifier for the variant of this function that takes a xpc_connection_t.
2907         * Shared/mac/CodeSigning.mm:
2908         (WebKit::codeSigningIdentifier): Added. Uses the audit token associated with the specified
2909         XPC connection to get the code signing identifier for the embedding client.
2910         (WebKit::codeSigningIdentifierForCurrentProcess): Renamed; formerly named codeSigningIdentifier.
2911         Implemented in terms of the SecTask API.
2912         (WebKit::secCodeForCurrentProcess): Deleted.
2913         (WebKit::secCodeForProcess): Deleted.
2914         (WebKit::secCodeSigningInformation): Deleted.
2915         (WebKit::appleSignedOrMacAppStoreSignedOrAppleDeveloperSignedRequirement): Deleted.
2916         (WebKit::secCodeSigningIdentifier): Deleted.
2917         (WebKit::codeSigningIdentifierForProcess): Deleted.
2918         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2919         (WebKit::connectToService): Update code due to renaming.
2920
2921 2016-05-12  Konstantin Tokarev  <annulen@yandex.ru>
2922
2923         Use reference instead of pointer in FrameLoaderClient::saveViewStateToItem.
2924         https://bugs.webkit.org/show_bug.cgi?id=157624
2925
2926         Reviewed by Darin Adler.
2927
2928         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2929         (WebKit::WebFrameLoaderClient::saveViewStateToItem):
2930         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2931
2932 2016-05-12  Csaba Osztrogonác  <ossy@webkit.org>
2933
2934         Remove ENABLE(ES6_ARROWFUNCTION_SYNTAX) guards
2935         https://bugs.webkit.org/show_bug.cgi?id=157564
2936
2937         Reviewed by Darin Adler.
2938
2939         * Configurations/FeatureDefines.xcconfig:
2940
2941 2016-05-11  Anders Carlsson  <andersca@apple.com>
2942
2943         We have two different types of contextual menus in iBooks
2944         https://bugs.webkit.org/show_bug.cgi?id=157587
2945         rdar://problem/25904169
2946
2947         Reviewed by Darin Adler.
2948
2949         Give clients the option to bypass the WebKit context menu machinery.
2950
2951         * UIProcess/mac/WebContextMenuProxyMac.mm:
2952         (WebKit::WebContextMenuProxyMac::showContextMenu):
2953
2954 2016-05-10  Brian Burg  <bburg@apple.com>
2955
2956         Web Automation: add command to asynchronously load the Web Inspector frontend in the background
2957         https://bugs.webkit.org/show_bug.cgi?id=157509
2958
2959         Reviewed by Timothy Hatcher and Joseph Pecoraro.
2960
2961         In order to make it easier to debug code that executes as a result of an automation
2962         command, this patch adds a new Automation command to asynchronously load the debugger
2963         and Inspector frontend. It is designed for use by automation clients to implement an
2964         auto-inspection feature to aid in debugging automation scripts.
2965
2966         * UIProcess/Automation/Automation.json: Add new command.
2967         * UIProcess/Automation/WebAutomationSession.cpp:
2968         (WebKit::WebAutomationSession::inspectBrowsingContext): Added.
2969         (WebKit::WebAutomationSession::inspectorFrontendLoaded): Added.
2970         This message is forwarded by WebInspectorProxy to the inspected page's session.
2971
2972         * UIProcess/Automation/WebAutomationSession.h:
2973         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
2974         (WebKit::WebAutomationSession::sendSynthesizedEventsToPage):
2975         Force the active automation window to become key and bring to front prior to
2976         sending each NSEvent. This way, if the Inspector pauses while a command executes,
2977         the automation window will get back focus when the Inspector unpauses just before
2978         the next synthesized mouse or keyboard NSEvent is sent to its NSWindow.
2979
2980         * UIProcess/WebInspectorProxy.cpp:
2981         (WebKit::WebInspectorProxy::frontendLoaded):
2982         Forward to the inspected page's session.
2983
2984         * UIProcess/WebInspectorProxy.h:
2985         * UIProcess/WebInspectorProxy.messages.in: Add notification of the frontend's load.
2986
2987         * WebProcess/WebPage/WebInspectorUI.cpp:
2988         (WebKit::WebInspectorUI::frontendLoaded):
2989         Kick off notifying the automation session in UIProcess that the inspector loaded.
2990
2991         (WebKit::WebInspectorUI::closeWindow):
2992         In some circumstances, the Web Inspector can be loaded without showing
2993         the window. If this hidden page closes, make sure the frontend host gets
2994         a chance to disconnect its InspectorFrontendClient. Normally this happens
2995         when the window closes, but unshown Inspectors do not get window instances.
2996
2997 2016-05-11  Chris Dumez  <cdumez@apple.com>
2998
2999         Update Node::appendChild() / replaceChild() / removeChild() / insertBefore() to take references instead of pointers
3000         https://bugs.webkit.org/show_bug.cgi?id=157556
3001
3002         Reviewed by Darin Adler.
3003
3004         * WebProcess/InjectedBundle/API/mac/WKDOMNode.mm:
3005         (-[WKDOMNode insertNode:before:]):
3006         (-[WKDOMNode appendChild:]):
3007         (-[WKDOMNode removeChild:]):
3008         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
3009         (WebKit::PDFPlugin::PDFPlugin):
3010         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
3011         (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement):
3012
3013 2016-05-11  Brady Eidson  <beidson@apple.com>
3014
3015         Modern IDB: IDBOpenDBRequests that are stop()'ed don't notify the IDBServer of that fact.
3016         https://bugs.webkit.org/show_bug.cgi?id=157448
3017
3018         Reviewed by Alex Christensen.
3019
3020         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
3021         (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
3022         (WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
3023         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
3024         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
3025
3026         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3027         (WebKit::WebIDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
3028         (WebKit::WebIDBConnectionToServer::openDBRequestCancelled):
3029         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
3030
3031 2016-05-11  Myles C. Maxfield  <mmaxfield@apple.com>
3032
3033         Fix a typo in r200330
3034
3035         Unreviewed.
3036
3037         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
3038
3039 2016-05-10  Sam Weinig  <sam@webkit.org>
3040
3041         Only expose WKDataDetectorTypes and -[WKWebViewConfiguration dataDetectorTypes] on iOS
3042         for now, since we don't have it fully implemented on Mac.
3043
3044         Reviewed by Tim Horton.
3045
3046         * UIProcess/API/Cocoa/WKWebView.mm:
3047         (fromWKDataDetectorTypes):
3048         (-[WKWebView _initializeWithConfiguration:]):
3049         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
3050         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3051         (-[WKWebViewConfiguration encodeWithCoder:]):
3052         (-[WKWebViewConfiguration initWithCoder:]):
3053         (-[WKWebViewConfiguration copyWithZone:]):
3054
3055 2016-05-10  Sam Weinig  <sam@webkit.org>
3056
3057         Add SPI for Data Detectors to get ranges of text around an existing range.
3058         <rdar://problem/26009749>
3059
3060         Reviewed by Enrica Casucci.
3061
3062         * WebProcess/InjectedBundle/API/mac/WKDOMRange.h:
3063         * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
3064         (-[WKDOMRange rangeByExpandingToWordBoundaryByCharacters:inDirection:]):
3065
3066 2016-05-10  Enrica Casucci  <enrica@apple.com>
3067
3068         Numerous block selection issues on iOS.
3069         https://bugs.webkit.org/show_bug.cgi?id=157490
3070         rdar://problem/25717977
3071         rdar://problem/23042215
3072
3073         Reviewed by Tim Horton.
3074
3075         This patch fixes a number of issues with block selection on iOS.
3076         We no longer eagerly choose block selection vs text selection and we
3077         make sure we are capable of switching back to text selection from block
3078         under every circumstance. The patch also fixes the logic used to decide
3079         when to switch to block selection. It now computes the rectangle for the
3080         paragraph containing the initial text selection to decide when we are
3081         actually dragging outside the boundaries of the paragraph block.
3082
3083         * UIProcess/WebPageProxy.h:
3084         * UIProcess/WebPageProxy.messages.in:
3085         * UIProcess/ios/WKContentViewInteraction.mm:
3086         (selectionChangedWithGesture):
3087         (selectionChangedWithTouch):
3088         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
3089         * UIProcess/ios/WebPageProxyIOS.mm:
3090         (WebKit::WebPageProxy::gestureCallback):
3091         (WebKit::WebPageProxy::touchesCallback):
3092         (WebKit::WebPageProxy::autocorrectionDataCallback):
3093         (WebKit::WebPageProxy::selectWithGesture):
3094         (WebKit::WebPageProxy::updateSelectionWithTouches):
3095         * WebProcess/WebPage/WebPage.h:
3096         * WebProcess/WebPage/ios/WebPageIOS.mm:
3097         (WebKit::selectionBoxForRange):
3098         (WebKit::canShrinkToTextSelection):
3099         (WebKit::hasCustomLineHeight):
3100         (WebKit::WebPage::rangeForWebSelectionAtPosition):
3101         (WebKit::WebPage::contractedRangeFromHandle):
3102         (WebKit::WebPage::updateBlockSelectionWithTouch):
3103         (WebKit::WebPage::clearSelection):
3104         (WebKit::WebPage::switchToBlockSelectionAtPoint):
3105         (WebKit::WebPage::shouldSwitchToBlockModeForHandle):
3106         (WebKit::WebPage::updateSelectionWithTouches):
3107         (WebKit::WebPage::selectWithTwoTouches):
3108
3109 2016-05-10  Alex Christensen  <achristensen@webkit.org>
3110
3111         Handle _schemeUpgraded delegate callbacks in NSURLSessionDataDelegate
3112         https://bugs.webkit.org/show_bug.cgi?id=157354
3113         rdar://problem/25842107
3114
3115         Reviewed by Darin Adler.
3116
3117         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3118         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
3119         When we make a request to a http url and CFNetwork determines that that url would have redirected to an HSTS site
3120         and it is going to change the request to an https request, this delegate callback is called.  We need to call the
3121         redirection code to have the same behavior as the NSURLConnection-based loader.
3122
3123 2016-05-10  Csaba Osztrogonác  <ossy@webkit.org>
3124
3125         Fix the !ENABLE(VIDEO) build
3126         https://bugs.webkit.org/show_bug.cgi?id=157518
3127
3128         Reviewed by Alex Christensen.
3129
3130         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3131         (WebKit::WebsiteDataStore::fetchData):
3132         (WebKit::WebsiteDataStore::removeData):
3133         * WebProcess/WebProcess.cpp:
3134         (WebKit::WebProcess::initializeWebProcess):
3135
3136 2016-05-10  Anders Carlsson  <andersca@apple.com>
3137
3138         Fix more deprecation warnings.
3139
3140         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
3141         (NetworkServiceInitializer):
3142         * PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm:
3143         (PluginServiceInitializer):
3144         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
3145         (WebContentServiceInitializer):
3146
3147 2016-05-10  Chris Dumez  <cdumez@apple.com>
3148
3149         [SpeculativeValidation] Do not start a preload if there is already one pending
3150         https://bugs.webkit.org/show_bug.cgi?id=157522
3151         <rdar://problem/26156083>
3152
3153         Reviewed by Alex Christensen.
3154
3155         Do not start a preload if there is already one pending. We failed to check in
3156         SpeculativeLoadManager::preloadEntry() if there was already a pending preload.
3157         As a result, we would sometimes cancel an already pending preload and start
3158         one from scratch which is inefficient. It would also sometimes lead to hitting
3159         an assertion in the SpeculativeLoad destructor because we could destroy the
3160         SpeculativeLoad without finishing or cancelling the load.
3161
3162         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3163         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
3164
3165 2016-05-10  Anders Carlsson  <andersca@apple.com>
3166
3167         Fix a deprecation warning.
3168
3169         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm:
3170         (DatabaseServiceInitializer):
3171
3172 2016-05-10  Tim Horton  <timothy_horton@apple.com>
3173
3174         Clicks do not work in Safari after pressing the Track package button in Gmail
3175         https://bugs.webkit.org/show_bug.cgi?id=157508
3176         <rdar://problem/22646404>
3177
3178         Reviewed by Anders Carlsson.
3179
3180         * UIProcess/Cocoa/WebViewImpl.mm:
3181         (WebKit::WebViewImpl::viewDidMoveToWindow):
3182         Explicitly cancel the force-click animation when we're removing the gesture
3183         recognizer due to the WK*View being unparented. This works around a bug
3184         where we don't get the cancellation callback in this situation, causing
3185         Safari to be left in an inconsistent and unexpected state.
3186
3187 2016-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
3188
3189         [Linux] Remove seccomp filters support
3190         https://bugs.webkit.org/show_bug.cgi?id=157380
3191
3192         Reviewed by Darin Adler.
3193
3194         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3195         (WebKit::NetworkProcessCreationParameters::encode): Deleted.
3196         (WebKit::NetworkProcessCreationParameters::decode): Deleted.
3197         * NetworkProcess/NetworkProcessCreationParameters.h:
3198         * PlatformEfl.cmake:
3199         * PlatformGTK.cmake:
3200         * Shared/WebProcessCreationParameters.cpp:
3201         (WebKit::WebProcessCreationParameters::encode): Deleted.
3202         (WebKit::WebProcessCreationParameters::decode): Deleted.
3203         * Shared/WebProcessCreationParameters.h:
3204         * Shared/linux/SeccompFilters/OpenSyscall.cpp: Removed.
3205         * Shared/linux/SeccompFilters/OpenSyscall.h: Removed.
3206         * Shared/linux/SeccompFilters/SeccompBroker.cpp: Removed.
3207         * Shared/linux/SeccompFilters/SeccompBroker.h: Removed.
3208         * Shared/linux/SeccompFilters/SeccompFilters.cpp: Removed.
3209         * Shared/linux/SeccompFilters/SeccompFilters.h: Removed.
3210         * Shared/linux/SeccompFilters/SigactionSyscall.cpp: Removed.
3211         * Shared/linux/SeccompFilters/SigactionSyscall.h: Removed.
3212         * Shared/linux/SeccompFilters/SigprocmaskSyscall.cpp: Removed.
3213         * Shared/linux/SeccompFilters/SigprocmaskSyscall.h: Removed.
3214         * Shared/linux/SeccompFilters/Syscall.cpp: Removed.
3215         * Shared/linux/SeccompFilters/Syscall.h: Removed.
3216         * Shared/linux/SeccompFilters/SyscallPolicy.cpp: Removed.
3217         * Shared/linux/SeccompFilters/SyscallPolicy.h: Removed.
3218         * Shared/linux/SeccompFilters/XDGBaseDirectory.h: Removed.
3219         * Shared/linux/SeccompFilters/XDGBaseDirectoryGLib.cpp: Removed.
3220         * UIProcess/WebProcessPool.cpp:
3221         (WebKit::WebProcessPool::ensureNetworkProcess): Deleted.
3222         (WebKit::WebProcessPool::createNewWebProcess): Deleted.
3223         (WebKit::WebProcessPool::cookieStorageDirectory): Deleted.
3224         * UIProcess/WebProcessPool.h:
3225         * WebProcess/efl/SeccompFiltersWebProcessEfl.cpp: Removed.
3226         * WebProcess/efl/SeccompFiltersWebProcessEfl.h: Removed.
3227         * WebProcess/gtk/SeccompFiltersWebProcessGtk.cpp: Removed.
3228         * WebProcess/gtk/SeccompFiltersWebProcessGtk.h: Removed.
3229         * WebProcess/soup/WebProcessSoup.cpp:
3230         (WebKit::WebProcess::platformInitializeWebProcess): Deleted.
3231
3232 2016-05-09  Tim Horton  <timothy_horton@apple.com>
3233
3234         REGRESSION (r191922): Zoom in/Zoom Out is not working for PDFs
3235         https://bugs.webkit.org/show_bug.cgi?id=157503
3236         <rdar://problem/23736297>
3237
3238         Reviewed by Anders Carlsson.
3239
3240         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
3241         Restore a requiresUnifiedScaleFactor that was lost in r191922.
3242
3243         * UIProcess/WebPageProxy.cpp:
3244         (WebKit::WebPageProxy::didCommitLoadForFrame):
3245         (WebKit::WebPageProxy::mainFramePluginHandlesPageScaleGestureDidChange):
3246         * UIProcess/WebPageProxy.h:
3247         * UIProcess/WebPageProxy.messages.in:        
3248         * WebProcess/Plugins/PluginView.cpp:
3249         (WebKit::PluginView::didInitializePlugin):
3250         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3251         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
3252         Separate mainFramePluginHandlesPageScaleGesture changes out from didCommitLoadForFrame,
3253         because the PluginView doesn't exist at this point, so it can't answer
3254         the handlesPageScaleGesture question correctly (or at all).
3255         Instead, we'll send the message when the main-frame PluginView is initialized.
3256
3257 2016-05-09  Simon Fraser  <simon.fraser@apple.com>
3258
3259         [iOS] visibility:hidden -webkit-overflow-scrolling: touch divs can interfere with page scrolling
3260         https://bugs.webkit.org/show_bug.cgi?id=157496
3261         rdar://problem/22963278
3262
3263         Reviewed by Tim Horton.
3264
3265         UIScrollViews are constructed in the UI process for visibility:hidden scrollable elements
3266         with -webkit-overflow-scrolling: touch, and these intercept user events when they should not.
3267
3268         Fix by propagating a "contentsHidden" flag from the web process which is used to turn off
3269         user interaction on these views.
3270
3271         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
3272         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
3273         * Shared/mac/RemoteLayerTreeTransaction.h:
3274         * Shared/mac/RemoteLayerTreeTransaction.mm:
3275         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
3276         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
3277         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
3278         (WebKit::dumpChangedLayers):
3279         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
3280         (-[UIView _recursiveFindDescendantScrollViewAtPoint:withEvent:]): Our custom hit
3281         test needs to take view.isUserInteractionEnabled into account.
3282         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3283         (WebKit::PlatformCALayerRemote::setHidden):
3284         (WebKit::PlatformCALayerRemote::contentsHidden):
3285         (WebKit::PlatformCALayerRemote::setContentsHidden):
3286         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
3287
3288 2016-05-09  Ada Chan  <adachan@apple.com>
3289
3290         Introduce WebVideoFullscreenInterfaceMac::isPlayingVideoInEnhancedFullscreen() and use it in WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen()
3291         https://bugs.webkit.org/show_bug.cgi?id=157493
3292
3293         Reviewed by Dan Bernstein.
3294
3295         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
3296         (WebKit::WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen):
3297
3298 2016-05-06  Ada Chan  <adachan@apple.com>
3299
3300         Add WKPageRef SPI to tell whether there's a video playing in enhanced fullscreen
3301         https://bugs.webkit.org/show_bug.cgi?id=157434
3302
3303         Reviewed by Darin Adler.
3304
3305         * UIProcess/API/C/mac/WKPagePrivateMac.h:
3306         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
3307         (WKPageIsPlayingVideoInEnhancedFullscreen):
3308         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
3309         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
3310         (WebKit::WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen):
3311         * UIProcess/WebPageProxy.cpp:
3312         (WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen):
3313         * UIProcess/WebPageProxy.h:
3314
3315 2016-05-09  Anders Carlsson  <andersca@apple.com>
3316
3317         Add injected bundle SPI for getting favicon and touch icon URLs
3318         https://bugs.webkit.org/show_bug.cgi?id=157435
3319
3320         Reviewed by Darin Adler.
3321
3322         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
3323         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
3324         (collectIcons):
3325         New helper function that calls into the WebCore LinkCollector.
3326
3327         (-[WKWebProcessPlugInFrame appleTouchIconURLs]):
3328         Call collectIcons.
3329
3330         (-[WKWebProcessPlugInFrame faviconURLs]):
3331         Ditto.
3332
3333 2016-05-06  Simon Fraser  <simon.fraser@apple.com>
3334
3335         [iOS WK2] Font size increases on some pages after navigating then going back
3336         https://bugs.webkit.org/show_bug.cgi?id=157441
3337         rdar://problem/22873240
3338
3339         Reviewed by Darin Adler.
3340
3341         There's an ordering dependency between setting the viewport configuration and doing
3342         layouts when going back to a page from the page cache that is incorrectly handled.
3343
3344         In FrameLoader::commitProvisionalLoad(), CachedPage::restore() triggers a layout under
3345         updateContentsSize(), but this happens before dispatchDidCommitLoad() which updates
3346         the viewport arguments via ViewportConfiguration::setViewportArguments().
3347
3348         This issue is not addressed by the current commit. But a second problem is:
3349         if the inputs to text autosizing change, we need to invalidate the autosizing state.
3350         The relevant input here is the fixed layout width (which is determined from the viewport
3351         configuration).
3352
3353         The current code invalidated text autosizing when m_viewportConfiguration.minimumLayoutSize()
3354         changed, but the correct behavior is to invalidate based on fixed layout size changing.
3355
3356         * WebProcess/WebPage/WebPage.cpp:
3357         (WebKit::WebPage::sendViewportAttributesChanged):
3358         (WebKit::WebPage::setFixedLayoutSize):
3359         * WebProcess/WebPage/WebPage.h:
3360         * WebProcess/WebPage/ios/WebPageIOS.mm:
3361         (WebKit::WebPage::resetTextAutosizing):
3362         (WebKit::WebPage::dynamicViewportSizeUpdate):
3363         (WebKit::WebPage::viewportConfigurationChanged):
3364         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize): Deleted.
3365         (WebKit::WebPage::resetTextAutosizingBeforeLayoutIfNeeded): Deleted.
3366
3367 2016-05-09  Alex Christensen  <achristensen@webkit.org>
3368
3369         Don't use DiskCache for media resource loads
3370         https://bugs.webkit.org/show_bug.cgi?id=157405
3371
3372         Reviewed by Darin Adler.
3373
3374         * NetworkProcess/cache/NetworkCache.cpp:
3375         (WebKit::NetworkCache::makeRetrieveDecision):
3376         (WebKit::NetworkCache::makeStoreDecision):
3377         * NetworkProcess/cache/NetworkCache.h:
3378         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
3379         (WebKit::NetworkCache::retrieveDecisionToDiagnosticKey):
3380
3381 2016-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
3382
3383         [OS X] Migrate our Font classes entirely off of NSFont
3384         https://bugs.webkit.org/show_bug.cgi?id=157464
3385
3386         Reviewed by Darin Adler.
3387
3388         * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
3389         (WebKit::WebPopupMenu::setUpPlatformData):
3390         * WebProcess/WebPage/mac/WebPageMac.mm:
3391         (WebKit::WebPage::fontAtSelection):
3392
3393 2016-05-06  Joseph Pecoraro  <pecoraro@apple.com>
3394
3395         Rename HitTestRequest DisallowShadowContent to DisallowUserAgentShadowContent
3396         https://bugs.webkit.org/show_bug.cgi?id=157447
3397
3398         Reviewed by Ryosuke Niwa.
3399
3400         * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp:
3401         (WebKit::WebPage::findZoomableAreaForPoint):
3402         * WebProcess/WebPage/WebFrame.cpp:
3403         (WebKit::WebFrame::hitTest):
3404         * WebProcess/WebPage/WebPage.cpp:
3405         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
3406         * WebProcess/WebPage/ios/WebPageIOS.mm:
3407         (WebKit::WebPage::rangeForWebSelectionAtPosition):
3408         (WebKit::WebPage::rangeForBlockAtPoint):
3409         (WebKit::WebPage::getPositionInformation):
3410
3411 2016-05-06  Simon Fraser  <simon.fraser@apple.com>
3412
3413         Enable IOS_TEXT_AUTOSIZING on Mac and make it testable
3414         https://bugs.webkit.org/show_bug.cgi?id=157432
3415         rdar://problem/16406720
3416
3417         Reviewed by Dean Jackson.
3418
3419         Enable IOS_TEXT_AUTOSIZING on Mac so it can be tested.
3420         
3421         Make the setTextAutosizingEnabled() Setting work, and plumb it through WK1 and WK2
3422         preferences for WTR and DRT. Make textAutosizingWindowSizeOverride() work, for layout tests.
3423         These two settings are shared with TEXT_AUTOSIZING.
3424
3425         Add a TextAutosizing log channel, which is useful for generated -expected.html results.
3426
3427         Move adjustComputedFontSizesOnBlocks() and related code from RenderObject to RenderElement
3428         without changes.
3429
3430         An implication of this set of changes is that the way clients enable text autosizing
3431         has changed. Previously, they set the "MinimumZoomFontSize" preference to 0.
3432         Settings::defaultMinimumZoomFontSize() used to do this in order to enable text autosizing
3433         on iPhone only, not iPad.
3434
3435         Now the preferred technique is to leave minimumZoomFontSize alone, and to use textAutosizingEnabled()
3436         instead. Settings::defaultTextAutosizingEnabled() now does the check for iPhone.
3437
3438         UIWebView calls WebKitGetMinimumZoomFontSize() to setup the default minimum font zoom size,
3439         which will now always return 15, but had no other code that toggled this. So it's safe to just rely
3440         on Settings::defaultTextAutosizingEnabled() doing the right thing for iPhone/iPad.
3441
3442         * Configurations/FeatureDefines.xcconfig:
3443         * Shared/WebPreferencesDefinitions.h:
3444         * UIProcess/API/Cocoa/WKPreferences.mm:
3445         (-[WKPreferences _textAutosizingEnabled]):
3446         (-[WKPreferences _setTextAutosizingEnabled:]):
3447         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3448         * WebProcess/WebPage/WebPage.cpp:
3449         (WebKit::WebPage::updatePreferences):
3450
3451 2016-05-06  Dean Jackson  <dino@apple.com>
3452
3453         Regions, Shapes and Tracks don't need runtime features
3454         https://bugs.webkit.org/show_bug.cgi?id=157426
3455         <rdar://problem/26146262>
3456
3457         Reviewed by Simon Fraser.
3458
3459         The following RuntimeEnabledFeatures can be removed since
3460         we have no need to disable them (they are stable and have
3461         shipped for a while):
3462         - CSS Regions
3463         - CSS Shapes
3464         - Media tracks
3465
3466         * Shared/WebPreferencesDefinitions.h:
3467         * UIProcess/API/C/WKPreferences.cpp:
3468       &