66c6dee050a09e8e680959ff4e85751c5c916888
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-05-23  Beth Dakin  <bdakin@apple.com>
2
3         Need SPI for clients to require a user action to get an editing controls 
4         manager
5         https://bugs.webkit.org/show_bug.cgi?id=157992
6         -and corresponding-
7         rdar://problem/26379927
8
9         Reviewed by Tim Horton.
10
11         New SPI _setRequiresUserActionForEditingControlsManager. The SPI defaults to 
12         False, which means that by default there is no user action requirement to 
13         have an editing controls manager. The SPI is on WKViewPrivate and 
14         WKWebViewConfigurationPrivate, and it’s implemented in WebViewImpl.
15         * UIProcess/API/Cocoa/WKViewPrivate.h:
16         * UIProcess/API/Cocoa/WKWebView.mm:
17         (-[WKWebView _initializeWithConfiguration:]):
18         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
19         (-[WKWebViewConfiguration init]):
20         (-[WKWebViewConfiguration copyWithZone:]):
21         (-[WKWebViewConfiguration _requiresUserActionForEditingControlsManager]):
22         (-[WKWebViewConfiguration _setRequiresUserActionForEditingControlsManager:]):
23         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
24         * UIProcess/API/mac/WKView.mm:
25         (-[WKView _requiresUserActionForEditingControlsManager]):
26         (-[WKView _setRequiresUserActionForEditingControlsManager:]):
27         * UIProcess/Cocoa/WebViewImpl.h:
28         (WebKit::WebViewImpl::setRequiresUserActionForEditingControlsManager):
29         (WebKit::WebViewImpl::requiresUserActionForEditingControlsManager):
30
31         New message allows the WebProcess to tell the UI process whether the current 
32         web page has had any selection changes based on user interaction.
33         * UIProcess/WebPageProxy.cpp:
34         (WebKit::WebPageProxy::setHasHadSelectionChangesFromUserInteraction):
35         * UIProcess/WebPageProxy.h:
36         (WebKit::WebPageProxy::hasHadSelectionChangesFromUserInteraction):
37         * UIProcess/WebPageProxy.messages.in:
38
39         m_userIsInteracting m_hasFocusedDueToUserInteraction used to be iOS only, but 
40         now we want to track them for Mac as well.
41         * WebProcess/WebPage/WebPage.cpp:
42
43         Handling mouse events and key events will toggle m_userIsInteracting.
44         (WebKit::WebPage::mouseEvent):
45         (WebKit::WebPage::keyEvent):
46
47         m_userIsInteracting is no longer iOS-only.
48         (WebKit::WebPage::setInitialFocus):
49
50         Send a message to the UI process on page transition to re-set 
51         hasHadSelectionChangesFromUserInteraction to false.
52         (WebKit::WebPage::didStartPageTransition):
53
54         Send a message to the UI process if this is the first selection change to 
55         happen as a result of a user action.
56         (WebKit::WebPage::didChangeSelection):
57         * WebProcess/WebPage/WebPage.h:
58
59 2016-05-23  Alex Christensen  <achristensen@webkit.org>
60
61         Add logging for NSURLSession calls
62         https://bugs.webkit.org/show_bug.cgi?id=157996
63
64         Reviewed by Brady Eidson.
65
66         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
67         (WebKit::NetworkDataTask::NetworkDataTask):
68         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
69         (toNSURLSessionResponseDisposition):
70         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
71         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
72         (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]):
73         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
74         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
75         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
76         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
77         * Platform/Logging.h:
78
79 2016-05-23  Chris Fleizach  <cfleizach@apple.com>
80
81         AX: iOS: when bringing focus to a text field we may zoom the page even if author wanted max scale = 1
82         https://bugs.webkit.org/show_bug.cgi?id=157771
83
84         Reviewed by Tim Horton.
85
86         * Shared/AssistedNodeInformation.cpp:
87         (WebKit::AssistedNodeInformation::encode):
88         (WebKit::AssistedNodeInformation::decode):
89         * Shared/AssistedNodeInformation.h:
90         * UIProcess/ios/WKContentViewInteraction.mm:
91         (-[WKContentView _displayFormNodeInputView]):
92         * WebProcess/WebPage/ios/WebPageIOS.mm:
93         (WebKit::WebPage::getAssistedNodeInformation):
94
95 2016-05-23  Miguel Gomez  <magomez@igalia.com>
96
97         [ThreadedCompositor] Ensure that the BitmapTexture used by CoordinatedBackingStoreTile matches the opacity of the painted surface
98         https://bugs.webkit.org/show_bug.cgi?id=157942
99
100         Reviewed by Žan Doberšek.
101
102         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
103         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
104         Reset the BitmapTexture if it doesn't match the opacity required by the surface
105         that's being painted.
106
107 2016-05-22  Carlos Garcia Campos  <cgarcia@igalia.com>
108
109         [GTK] Disk cache: enable speculative revalidation
110         https://bugs.webkit.org/show_bug.cgi?id=157125
111
112         Reviewed by Sergio Villar Senin.
113
114         * NetworkProcess/soup/NetworkProcessSoup.cpp:
115         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
116         * UIProcess/API/gtk/WebKitWebContext.cpp:
117         (webkitWebContextConstructed):
118         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
119         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
120         * UIProcess/WebProcessPool.cpp:
121         (WebKit::WebProcessPool::ensureNetworkProcess):
122         * config.h:
123
124 2016-05-22  Brady Eidson  <beidson@apple.com>
125
126         Move to C++14.
127         https://bugs.webkit.org/show_bug.cgi?id=157948
128
129         Reviewed by Michael Catanzaro.
130
131         * Configurations/Base.xcconfig:
132
133         Replace time literal suffixes that have underscores to the forms without
134         (e.g. 0_ms becomes 0ms):
135         * NetworkProcess/NetworkResourceLoadParameters.cpp:
136         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
137
138         * NetworkProcess/NetworkResourceLoader.cpp:
139         (WebKit::NetworkResourceLoader::startNetworkLoad):
140
141         * NetworkProcess/cache/NetworkCache.cpp:
142         (WebKit::NetworkCache::responseHasExpired):
143         (WebKit::NetworkCache::responseNeedsRevalidation):
144         (WebKit::NetworkCache::makeStoreDecision):
145
146         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
147         (WebKit::NetworkCache::responseNeedsRevalidation):
148
149         * NetworkProcess/cache/NetworkCacheStorage.cpp:
150         (WebKit::NetworkCache::Storage::dispatchReadOperation):
151         (WebKit::NetworkCache::Storage::store):
152         (WebKit::NetworkCache::computeRecordWorth):
153
154         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
155
156         * UIProcess/ViewGestureController.cpp:
157
158         * WebProcess/Network/WebLoaderStrategy.cpp:
159         (WebKit::maximumBufferingTime):
160
161         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
162         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately):
163         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
164
165 2016-05-21  Andy Estes  <aestes@apple.com>
166
167         REGRESSION (r188642): All pages are blank when printing a webpage in iOS Safari
168         https://bugs.webkit.org/show_bug.cgi?id=157924
169         rdar://problem/22524550
170
171         Reviewed by Sam Weinig.
172
173         When UIPrintInteractionController asks WKWebView to print a webpage, it does so in several phases. First we're
174         asked to compute the page count, followed later by a series of messages asking us to draw each page into a
175         provided CGContext.
176
177         When asked for the page count, we send a message to the Web process instructing it to compute and
178         return the page count synchronously and then immediately start drawing the page for printing. If the drawing has
179         finished by the time we're asked to print the first page, then we can do so without waiting. But if it hasn't
180         then we block by calling Connection::waitForMessage(), passing std::chromo::milliseconds::max() as the relative
181         timeout.
182         
183         Prior to r188642, Connection::waitForMessage() called std::condition_variable::wait_for(), which takes a
184         relative timeout value. r188642 replaced this with WTF::Condition::waitUntil(), which takes an absolute timeout
185         instead. To convert from relative to absolute, this line was added to Connection::waitForMessage():
186
187             Condition::Clock::time_point absoluteTimeout = Condition::Clock::now() + timeout;
188
189         std::chrono will convert both operands to a common duration type before performing the addition. When timeout
190         equals something very large, like milliseconds::max(), this conversion results in signed integer overflow,
191         giving absoluteTimeout a value less than Clock::now() and making waitForMessage time out immediately.
192         
193         To fix this, compute how many milliseconds remain on our clock, and add the smaller of that and the timeout
194         value to Clock::now() to arrive at an absolute timeout.
195
196         * Platform/IPC/Connection.cpp:
197         (IPC::Connection::waitForMessage):
198         * UIProcess/API/Cocoa/WKWebView.mm:
199         (-[WKWebView _printedDocument]): Removed an unnecessary nanoseconds-to-milliseconds conversion.
200
201 2016-05-20  Enrica Casucci  <enrica@apple.com>
202
203         Drag cannot start if no drag data or custom data is available in the Pasteboard.
204         https://bugs.webkit.org/show_bug.cgi?id=157911
205         rdar://problem/24577706
206
207         Reviewed by Tim Horton.
208
209         We need to make sure there is always one item in common between source and target
210         of the drag and drop operation.
211
212         * UIProcess/Cocoa/WebViewImpl.mm:
213         (WebKit::WebViewImpl::dragImageForView):
214
215 2016-05-20  John Wilander  <wilander@apple.com>
216
217         Remove unnecessary PageOverlay client function pageOverlayDestroyed
218         https://bugs.webkit.org/show_bug.cgi?id=157388
219         <rdar://problem/25471523>
220
221         Reviewed by Tim Horton.
222
223         Remove dead PageOverlay code. Almost all of these overrides were empty and
224         never called. In the case of WebPageOverlay it was never called but had a
225         function body, causing confusion. There was a fear of dangling pointers in
226         WebPageOverlay's static hash map between PageOverlays and WebPageOverlays.
227         Only WebPageOverlay's constructor creates its PageOverlay object and adds it
228         to the hash map. Its client object is kept in a unique pointer member which
229         is automatically deleted when the WebPageOverlay object itself is deleted.
230         This explains why PageOverlayClientImpl::pageOverlayDestroyed in
231         WKBundlePageOverlay can safely be removed. Finally, WebPageOverlay's
232         destructor clears the hash map entry for its PageOverlay object. Thus, there
233         is no need to call WebPageOverlay::pageOverlayDestroyed nor a need for
234         WebPageOverlay's destructor to call pageOverlayDestroyed on its client.
235
236         No new tests. I tried to come up with a WebKit API test for this but I
237         wasn't able to test presence/absence of WebPageOverlay's map entries since
238         the map is not exposed.
239
240         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
241         (WebKit::PageOverlayClientImpl::pageOverlayDestroyed): Deleted.
242         * WebProcess/Plugins/PDF/PDFPlugin.h:
243         * WebProcess/Plugins/PDF/PDFPlugin.mm:
244         (WebKit::PDFPlugin::HUD::pageOverlayDestroyed): Deleted.
245         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
246         * WebProcess/WebCoreSupport/WebInspectorClient.h:
247         (WebKit::WebInspectorClient::pageOverlayDestroyed): Deleted.
248         * WebProcess/WebPage/FindController.cpp:
249         * WebProcess/WebPage/FindController.h:
250         (WebKit::FindController::pageOverlayDestroyed): Deleted.
251         * WebProcess/WebPage/WebPageOverlay.cpp:
252         * WebProcess/WebPage/WebPageOverlay.h:
253         (WebKit::WebPageOverlay::pageOverlayDestroyed): Deleted.
254         * WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
255         (WebKit::FindIndicatorOverlayClientIOS::pageOverlayDestroyed): Deleted.
256
257 2016-05-19  Chris Dumez  <cdumez@apple.com>
258
259         Improve compile-time assertions in is<>() / downcast<>()
260         https://bugs.webkit.org/show_bug.cgi?id=157817
261
262         Reviewed by Darin Adler.
263
264         Add missing includes.
265
266         * WebProcess/WebPage/WebFrame.cpp:
267         * WebProcess/WebPage/WebPage.cpp:
268
269 2016-05-19  Tim Horton  <timothy_horton@apple.com>
270
271         Mail crashes under TiledCoreAnimationDrawingAreaProxy::createFenceForGeometryUpdate() when the Web process crashes
272         https://bugs.webkit.org/show_bug.cgi?id=157927
273         <rdar://problem/24793374>
274
275         Reviewed by Dean Jackson.
276
277         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
278         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
279         With just the right combination of layout mechanisms and Web Content process
280         crash timing, it is possible to get a frame change underneath WebPageProxy::processDidCrash,
281         before the DrawingArea has been nulled out but after the Connection has.
282         This can lead to a null dereference. I had a lot of trouble writing a API
283         test for this, though I'm certain it's possible.
284
285 2016-05-16  Enrica Casucci  <enrica@apple.com>
286
287         No candidate punctuation when typing punctuation in WK2 text field.
288         https://bugs.webkit.org/show_bug.cgi?id=157773
289         rdar://problem/23084603
290
291         Reviewed by Sam Weinig.
292
293         We need to adopt the new addInputString:withFlags:withInputManagerHint function
294         for this to work propertly.
295
296         * Platform/spi/ios/UIKitSPI.h:
297         * UIProcess/ios/WKContentViewInteraction.mm:
298         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
299
300 2016-05-19  Brady Eidson  <beidson@apple.com>
301
302         Finishing off: Modern IDB: Website data store management.
303         https://bugs.webkit.org/show_bug.cgi?id=157626
304
305         Reviewed by Alex Christensen.
306
307         * DatabaseProcess/DatabaseProcess.cpp:
308         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
309         (WebKit::removeAllDatabasesForOriginPath): Deleted.
310         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigins): Deleted.
311         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedSince): Deleted.
312         * DatabaseProcess/DatabaseProcess.h:
313
314 2016-05-19  Brent Fulgham  <bfulgham@apple.com>
315
316         [OS X][WK2] Expand sandbox for new mach endpoints
317         https://bugs.webkit.org/show_bug.cgi?id=157919
318         <rdar://problem/25238336>
319
320         Reviewed by Alexey Proskuryakov.
321
322         Grant the WebContent and Networking processes the mach lookup capability for
323         various Security-related mach endpoints..
324
325         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
326         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
327
328 2016-05-19  Brian Burg  <bburg@apple.com>
329
330         Web Inspector: CRASH when closing a page while element selection mode is enabled via Develop menu
331         https://bugs.webkit.org/show_bug.cgi?id=157925
332         <rdar://problem/26259618>
333
334         Reviewed by Joseph Pecoraro.
335
336         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
337         (WebKit::WebInspectorClient::elementSelectionChanged):
338         Null-check m_page->inspector() since it will return nullptr if the page
339         is closed but not yet destructed. This is triggered by teardown code
340         in InspectorDOMAgent::willDestroyFrontendAndBackend.
341
342 2016-05-19  Enrica Casucci  <enrica@apple.com>
343
344         Drag cannot start if no drag data is available in the Pasteboard.
345         https://bugs.webkit.org/show_bug.cgi?id=157911
346         rdar://problem/24577706
347
348         Reviewed by Tim Horton.
349
350         Setting dummy data to allow drag to start.
351
352         * Shared/mac/PasteboardTypes.h:
353         * Shared/mac/PasteboardTypes.mm:
354         * UIProcess/Cocoa/WebViewImpl.mm:
355         (WebKit::WebViewImpl::registerDraggedTypes):
356         (WebKit::WebViewImpl::dragImageForView):
357
358 2016-05-19  Jer Noble  <jer.noble@apple.com>
359
360         [IOS] Add setting to allow playback to continue inline after exiting fullscreen.
361         https://bugs.webkit.org/show_bug.cgi?id=157912
362
363         Reviewed by Eric Carlson.
364
365         Add a preference and configuration property to control whether media should be allowed to continue
366         playing inline when exiting fullscreen.
367
368         * Shared/WebPreferencesDefinitions.h:
369         * UIProcess/API/Cocoa/WKWebView.mm:
370         (-[WKWebView _initializeWithConfiguration:]):
371         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
372         (-[WKWebViewConfiguration init]):
373         (-[WKWebViewConfiguration encodeWithCoder:]):
374         (-[WKWebViewConfiguration initWithCoder:]):
375         (-[WKWebViewConfiguration copyWithZone:]):
376         (-[WKWebViewConfiguration _allowsInlineMediaPlaybackAfterFullscreen]):
377         (-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackAfterFullscreen:]):
378         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
379         * UIProcess/mac/WKFullScreenWindowController.mm:
380         (disableScreenUpdates):
381         (enableScreenUpdates):
382         (-[WKFullScreenWindowController enterFullScreen:]):
383         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
384         (-[WKFullScreenWindowController exitFullScreen]):
385         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
386         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
387         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
388         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
389         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
390         * WebProcess/WebPage/WebPage.cpp:
391         (WebKit::WebPage::updatePreferences):
392
393 2016-05-19  Brian Burg  <bburg@apple.com>
394
395         Web Inspector: timelines should not update via requestAnimationFrame unless Web Inspector is visible
396         https://bugs.webkit.org/show_bug.cgi?id=157897
397         <rdar://problem/26330802>
398
399         Reviewed by Timothy Hatcher.
400
401         The UIProcess needs to notify the Inspector frontend when it is truly visible.
402         The frontend can't use document.visibilityState because it doesn't seem to work
403         if the inspector frontend's WKWebView is created but not attached to a window.
404
405         * UIProcess/WebInspectorProxy.cpp:
406         (WebKit::WebInspectorProxy::open):
407         (WebKit::WebInspectorProxy::didClose):
408         Send visibility updates to the inspector process when the inspector becomes
409         "visible" or "not visible". It becomes visible if it is attached to the
410         inspected page's window, or gets its own native window.
411
412         * WebProcess/WebPage/WebInspectorUI.cpp:
413         (WebKit::WebInspectorUI::frontendLoaded):
414         (WebKit::WebInspectorUI::setDockingUnavailable):
415         (WebKit::WebInspectorUI::setIsVisible):
416         Call InspectorFrontendAPI.updateVisibilityState to let the frontend know.
417
418         * WebProcess/WebPage/WebInspectorUI.h:
419         * WebProcess/WebPage/WebInspectorUI.messages.in:
420         Add new message.
421
422 2016-05-19  Brian Burg  <bburg@apple.com>
423
424         Web Inspector: use a consistent prefix for injected scripts
425         https://bugs.webkit.org/show_bug.cgi?id=157715
426         <rdar://problem/26287188>
427
428         Reviewed by Timothy Hatcher.
429
430         * CMakeLists.txt:
431         * DerivedSources.make:
432         * WebProcess/Automation/WebAutomationSessionProxy.js:
433
434 2016-05-18  Anders Carlsson  <andersca@apple.com>
435
436         Add WKPreferencesRef getter/setter pair to set RTL mode
437         https://bugs.webkit.org/show_bug.cgi?id=157873
438         rdar://problem/26329970
439
440         Reviewed by Tim Horton.
441
442         * UIProcess/API/C/WKPreferences.cpp:
443         (WKPreferencesSetUserInterfaceDirectionPolicy):
444         (WKPreferencesGetUserInterfaceDirectionPolicy):
445         * UIProcess/API/C/WKPreferencesRef.h:
446
447 2016-05-18  Alex Christensen  <achristensen@webkit.org>
448
449         Clean up CSS code
450         https://bugs.webkit.org/show_bug.cgi?id=157808
451
452         Reviewed by Chris Dumez.
453
454         * UIProcess/Cocoa/WebViewImpl.mm:
455
456 2016-05-18  Jer Noble  <jer.noble@apple.com>
457
458         Disable default user gesture requirement for audio playback on Mac
459         https://bugs.webkit.org/show_bug.cgi?id=157820
460
461         Reviewed by Sam Weinig.
462
463         Disable the WebPreferences and matching WKWebViewConfiguration.mediaTypesRequiringUserActionForPlayback
464         settings on Mac (and other non-iOS ports).
465
466         * Shared/WebPreferencesDefinitions.h:
467         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
468         (-[WKWebViewConfiguration init]):
469
470 2016-05-18  Alex Christensen  <achristensen@webkit.org>
471
472         Build fix when not using CredentialStorage with NetworkSession.
473
474         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
475         (WebKit::NetworkSession::clearCredentials):
476
477 2016-05-18  Brady Eidson  <beidson@apple.com>
478
479         Fix null-deref crash sporadically seen after http://trac.webkit.org/changeset/201098
480
481         No review.
482
483         * DatabaseProcess/DatabaseProcess.cpp:
484         (WebKit::DatabaseProcess::deleteWebsiteData): Don't access m_idbServer directly, as calling
485           the idbServer() accessor is how you actually get your IDBServer created for you.
486
487 2016-05-18  Brian Burg  <bburg@apple.com>
488
489         Web Inspector: InspectorFrontendAPI.setTimelineProfilingEnabled should not implicitly show Timelines tab
490         https://bugs.webkit.org/show_bug.cgi?id=157846
491
492         Reviewed by Timothy Hatcher.
493
494         Add a separate ShowTimelines message to WebInspector and WebInspectorUI. Have the
495         start/stop profiling methods in public APIs explicitly call showTimelines() rather than
496         relying on InspectorFrontendAPI to do it.
497
498         * UIProcess/API/C/WKInspector.cpp:
499         (WKInspectorTogglePageProfiling):
500         * UIProcess/WebInspectorProxy.cpp:
501         (WebKit::WebInspectorProxy::showTimelines):
502         * UIProcess/WebInspectorProxy.h:
503         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
504         (WKBundleInspectorSetPageProfilingEnabled):
505         * WebProcess/WebPage/WebInspector.cpp:
506         (WebKit::WebInspector::showTimelines):
507         * WebProcess/WebPage/WebInspector.h:
508         * WebProcess/WebPage/WebInspector.messages.in:
509         * WebProcess/WebPage/WebInspectorUI.cpp:
510         (WebKit::WebInspectorUI::showTimelines):
511         * WebProcess/WebPage/WebInspectorUI.h:
512         * WebProcess/WebPage/WebInspectorUI.messages.in:
513
514 2016-05-18  Brady Eidson  <beidson@apple.com>
515
516         Modern IDB: Add support for server side closing of open database connections.
517         https://bugs.webkit.org/show_bug.cgi?id=157843
518
519         Reviewed by Alex Christensen.
520
521         - Implement the required IDB delegate code.
522         - Make DatabaseProcess::deleteWebsiteData call the right method in IDB server.
523
524         * DatabaseProcess/DatabaseProcess.cpp:
525         (WebKit::DatabaseProcess::deleteWebsiteData):
526
527         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
528         (WebKit::WebIDBConnectionToClient::didGetRecord):
529         (WebKit::WebIDBConnectionToClient::didCloseFromServer):
530         (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
531         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
532         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
533
534         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
535         (WebKit::WebIDBConnectionToServer::confirmDidCloseFromServer):
536         (WebKit::WebIDBConnectionToServer::didStartTransaction):
537         (WebKit::WebIDBConnectionToServer::didCloseFromServer):
538         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
539         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
540
541 2016-05-18  Brady Eidson  <beidson@apple.com>
542
543         Modern IDB: Make TestRunner.clearAllDatabases also delete IndexedDB databases (once doing so is supported).
544         https://bugs.webkit.org/show_bug.cgi?id=157823
545
546         Reviewed by Alex Christensen.
547
548         * CMakeLists.txt:
549         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
550         (WKWebsiteDataStoreRemoveAllIndexedDatabases):
551         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
552
553 2016-05-18  Brian Burg  <bburg@apple.com>
554
555         REGRESSION(r200959): "Start Timeline Recording" menu item doesn't start recording
556         https://bugs.webkit.org/show_bug.cgi?id=157821
557         <rdar://problem/26335429>
558
559         Reviewed by Timothy Hatcher.
560
561         In r200959, WebInspectorProxy started sending start/stop profiling
562         messages directly to the frontend process to avoid the inspected page
563         process from implicitly showing the frontend. To compensate, the WebKit
564         API layer was changed to call show() in togglePageProfiling().
565
566         Unfortunately, this fix was not quite right, because the ordering of
567         the Show and StartPageProfiling messages is undefined. The latter has to bounce
568         from UI to inspected to inspector processes, so the frontend may try
569         to start profiling before the frontend is shown, causing it to be ignored.
570
571         This patch takes a different approach: just remove all implicit show()
572         calls in the inspected page processes, and bounce both the Show and
573         StartPageProfiling messages through the inspected page process to ensure
574         they are handled in order by the frontend process.
575
576         * UIProcess/WebInspectorProxy.cpp:
577         (WebKit::WebInspectorProxy::togglePageProfiling):
578         Revert to sending to the inspected page process.
579
580         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
581         (WKBundleInspectorSetPageProfilingEnabled):
582         Add a call to show() now that the implementation doesn't do it implicitly.
583
584         * WebProcess/WebPage/WebInspector.cpp:
585         (WebKit::WebInspector::startPageProfiling):
586         (WebKit::WebInspector::stopPageProfiling):
587         Don't implicitly show the inspector. These methods are only called
588         through the WKBundleInspector API and via IPC from WebInspectorProxy.
589
590 2016-05-17  Beth Dakin  <bdakin@apple.com>
591
592         Make handleAcceptedCandidate a public function
593         https://bugs.webkit.org/show_bug.cgi?id=157763
594         -and corresponding-
595         rdar://problem/26206397
596
597         Reviewed by Tim Horton.
598
599         This patch makes handleAcceptedCandidate a public member of WebViewImpl 
600         instead of a private member. 
601         * UIProcess/Cocoa/WebViewImpl.h:
602         (WebKit::WebViewImpl::createWeakPtr):
603
604 2016-05-17  Dean Jackson  <dino@apple.com>
605
606         Remove ES6_GENERATORS flag
607         https://bugs.webkit.org/show_bug.cgi?id=157815
608         <rdar://problem/26332894>
609
610         Reviewed by Geoffrey Garen.
611
612         This flag isn't needed. Generators are enabled everywhere and
613         part of a stable specification.
614
615         * Configurations/FeatureDefines.xcconfig:
616
617 2016-05-17  Dean Jackson  <dino@apple.com>
618
619         Temporarily enable Experimental Features
620         https://bugs.webkit.org/show_bug.cgi?id=157810
621         <rdar://problem/26330804>
622
623         Reviewed by Anders Carlsson.
624
625         We currently don't have good UI for enabling these features,
626         which would mean Safari Technology Preview users would
627         never be able to turn them on… unless we enable them by
628         default temporarily.
629
630         * Shared/WebPreferencesDefinitions.h:
631
632 2016-05-17  Filip Pizlo  <fpizlo@apple.com>
633
634         WTF should know about Language
635         https://bugs.webkit.org/show_bug.cgi?id=157756
636
637         Reviewed by Geoffrey Garen and Alexey Proskuryakov.
638
639         Rewires a bunch of includes/imports.
640
641         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
642         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
643         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
644         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
645
646 2016-05-17  Jer Noble  <jer.noble@apple.com>
647
648         Unreviewed GTK+ and EFL bulid fix; make the audio playback user gesture requirement
649         Cocoa-only.
650
651         * Shared/WebPreferencesDefinitions.h:
652
653 2016-05-16  Anders Carlsson  <andersca@apple.com>
654
655         Add a WKA extension point for WKPreferences SPI
656         https://bugs.webkit.org/show_bug.cgi?id=157762
657         rdar://problem/24529203
658
659         Reviewed by Sam Weinig.
660
661         * UIProcess/API/Cocoa/WKPreferences.mm:
662
663 2016-05-16  David Kilzer  <ddkilzer@apple.com>
664
665         Action sheets don’t work in presented view controllers
666         <https://webkit.org/b/157754>
667         <rdar://problem/26304845>
668
669         Reviewed by Anders Carlsson.
670
671         * UIProcess/ios/WKActionSheet.mm:
672         (-[WKActionSheet presentSheetFromRect:]):
673         (-[WKActionSheet willRotate]):
674         - Call SPI to get the presenting view controller, since it may
675           not always be the root view controller.
676
677 2016-05-13  Enrica Casucci  <enrica@apple.com>
678
679         Text selection is basically impossible on plain text pages.
680         https://bugs.webkit.org/show_bug.cgi?id=157681
681         rdar://problem/26065660
682
683         Reviewed by Darin Adler.
684
685         When dealing with a plain text file, the rules for deciding whether
686         a position is selectable should be different and we should never
687         switch to block selection.
688
689         * WebProcess/WebPage/ios/WebPageIOS.mm:
690         (WebKit::WebPage::shouldSwitchToBlockModeForHandle):
691         (WebKit::rectIsTooBigForSelection): Added helper function.
692         (WebKit::WebPage::selectTextWithGranularityAtPoint):
693         (WebKit::WebPage::getPositionInformation):
694
695 2016-05-16  Chelsea Pugh  <cpugh@apple.com>
696
697         [iOS] Remove dispatch_after in -[WKFormInputSession setSuggestions:]
698         https://bugs.webkit.org/show_bug.cgi?id=157745
699
700         Reviewed by Dan Bernstein.
701
702         * UIProcess/ios/WKContentViewInteraction.mm:
703         (-[WKFormInputSession setSuggestions:]): Remove the dispatch_after since
704         there is no longer a chance of keyboard suggestions replacing the
705         suggestions set here.
706
707 2016-05-16  Brian Burg  <bburg@apple.com>
708
709         Crash simulating keystrokes at WebKit::WebAutomationSession::platformSimulateKeyStroke
710         https://bugs.webkit.org/show_bug.cgi?id=157737
711         <rdar://problem/26292946>
712
713         Reviewed by Timothy Hatcher.
714
715         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
716         (WebKit::WebAutomationSession::platformSimulateKeyStroke):
717         AppKit expects characters passed to [NSEvent keyEventWithType:...]
718         to be non-nil even if there are no characters. Initialize characters
719         to the empty string @"". It will be overwritten if the keystroke should
720         produce any unicode characters.
721
722 2016-05-16  Brian Burg  <bburg@apple.com>
723
724         Web Automation: Automation.inspectBrowsingContext should automatically start page profiling
725         https://bugs.webkit.org/show_bug.cgi?id=157739
726
727         Reviewed by Timothy Hatcher.
728
729         * UIProcess/API/C/WKInspector.cpp:
730         (WKInspectorTogglePageProfiling):
731         Implicitly show the Web Inspector in the C API command to preserve existing behavior.
732
733         * UIProcess/Automation/WebAutomationSession.cpp:
734         (WebKit::WebAutomationSession::inspectorFrontendLoaded):
735         If the frontend loaded, it was either because the user opened Web Inspector (and
736         turning on page profiling is harmless), or it was loaded but not shown by the
737         inspectBrowsingContext command. For the latter, we want to start page profiling
738         before processing any additional commands so subsequent execution is captured.
739
740         * UIProcess/WebInspectorProxy.cpp:
741         (WebKit::WebInspectorProxy::togglePageProfiling):
742         Send the start/stop profiling messages directly to the WebInspectorUI process instead of
743         bouncing through the inspected page's process, which does an implicit show() we don't want.
744
745         * UIProcess/WebPageProxy.cpp:
746         (WebKit::WebPageProxy::inspector): Make it const.
747         * UIProcess/WebPageProxy.h:
748
749 2016-05-16  Conrad Shultz  <conrad_shultz@apple.com>
750
751         Fix some deprecation warnings.
752
753         * UIProcess/mac/WKPrintingView.mm:
754         (-[WKPrintingView _drawPDFDocument:page:atPoint:]):
755         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
756         (WebKit::PDFPlugin::setActiveAnnotation):
757         (WebKit::PDFPlugin::lookupTextAtLocation):
758         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h:
759         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
760         (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement):
761         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h:
762         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
763         (WebKit::PDFPluginTextAnnotation::createAnnotationElement):
764         * WebProcess/WebPage/mac/WebPageMac.mm:
765         (WebKit::drawPDFPage):
766
767 2016-04-06  Jer Noble  <jer.noble@apple.com>
768
769         [WK2] Add API to WKWebViewConfiguration to control autoplay policy.
770         https://bugs.webkit.org/show_bug.cgi?id=156312
771
772         Reviewed by Dan Bernstein.
773
774         Add a new API to WKWebViewConfiguration to allow fine-grained control over when media is allowed
775         to play without a user gesture, and simultaneously deprecate the existing, all-or-nothing API,
776         and deprecated the equivalent SPIs.
777
778         * UIProcess/API/Cocoa/WKWebView.mm:
779         (-[WKWebView _initializeWithConfiguration:]):
780         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
781         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
782         (-[WKWebViewConfiguration init]):
783         (-[WKWebViewConfiguration encodeWithCoder:]):
784         (-[WKWebViewConfiguration initWithCoder:]):
785         (-[WKWebViewConfiguration copyWithZone:]):
786         (-[WKWebViewConfiguration _requiresUserActionForVideoPlayback]):
787         (-[WKWebViewConfiguration _setRequiresUserActionForVideoPlayback:]):
788         (-[WKWebViewConfiguration _requiresUserActionForAudioPlayback]):
789         (-[WKWebViewConfiguration _setRequiresUserActionForAudioPlayback:]):
790         (-[WKWebViewConfiguration requiresUserActionForMediaPlayback]):
791         (-[WKWebViewConfiguration setRequiresUserActionForMediaPlayback:]):
792         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
793
794 2016-05-16  Brian Burg  <bburg@apple.com>
795
796         Web Automation: WebAutomationSessionProxy.js gets injected more than once sometimes
797         https://bugs.webkit.org/show_bug.cgi?id=157716
798         <rdar://problem/26287306>
799
800         Reviewed by Timothy Hatcher.
801
802         Whenever a script was injected into a non-normal world by a WebKit client,
803         the WebProcess's WebAutomationSessionProxy singleton would get a
804         notification that the window was cleared from the relevant frame.
805         This notification happens when creating the world's window shell for
806         the first time.
807
808         This code should ignore such notifications that originate from non-main world
809         contexts. Web Inspector's instrumentation already ignored this, but
810         the automation session notification comes in via a different WebKit2 layer.
811
812         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
813         (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
814
815 2016-05-13  Dean Jackson  <dino@apple.com>
816
817         Fix iOS Build.
818
819         * Shared/AssistedNodeInformation.h:
820         (WebKit::OptionItem::OptionItem):
821
822 2016-05-13  Sam Weinig  <sam@webkit.org>
823
824         REGRESSION (r200463): Autofill Credit Card expected but got Autofill Contact
825         <rdar://problem/26251538>
826         https://bugs.webkit.org/show_bug.cgi?id=157701
827
828         Reviewed by Dan Bernstein.
829
830         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
831         (-[WKWebProcessPlugInFrame _certificateChain]):
832         We need to do a retain-autorelease here now because the CertificateInfo's that contain the
833         cached certificate chain, are being destroyed, and therefore destroying the chain, before this
834         function returns. This used to work when the chain wasn't just a cache, because there was still
835         a strong reference to it being held by the ResourceResponse's CertificateInfo copy, but now
836         there is none.
837
838 2016-05-13  Dean Jackson  <dino@apple.com>
839
840         [iOS] <select> elements popover should render right-aligned when in RTL mode
841         https://bugs.webkit.org/show_bug.cgi?id=157699
842         <rdar://problem/26282319>
843
844         Reviewed by Simon Fraser.
845
846         Some follow-up changes as suggested by Darin in review.
847
848         * Shared/AssistedNodeInformation.h: Use initializers so we can
849         remove the constructors.
850         (WebKit::OptionItem::OptionItem): Deleted.
851         (WebKit::AssistedNodeInformation::AssistedNodeInformation): Deleted.
852         * UIProcess/ios/forms/WKFormSelectPopover.mm: Add a comment to explain
853         why we are explicitly setting the language.
854         (-[WKSelectTableViewController initWithView:hasGroups:]):
855
856 2016-05-13  Chris Dumez  <cdumez@apple.com>
857
858         [NetworkCache] Avoid having to re-parse URLs after deserializing them
859         https://bugs.webkit.org/show_bug.cgi?id=157660
860
861         Reviewed by Darin Adler.
862
863         * NetworkProcess/cache/NetworkCacheCoders.cpp:
864         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::encode): Deleted.
865         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode): Deleted.
866         * NetworkProcess/cache/NetworkCacheCoders.h:
867         Drop template specializations used by our network cache for encoding
868         / decoding URLs as Strings. This causes us to now rely on
869         URL::encode() / URL::decode() instead.
870
871         * Shared/WebCoreArgumentCoders.cpp:
872         (IPC::ArgumentCoder<BlobPart>::decode):
873         Fix bug in BlobPart encoding / decoding. It was encoding the url member
874         as a URL but decoding it as a String.
875
876 2016-05-13  Dan Bernstein  <mitz@apple.com>
877
878         Try to fix some non-iOS builds.
879
880         * mac/postprocess-framework-headers.sh:
881
882 2016-05-13  Ryan Haddad  <ryanhaddad@apple.com>
883
884         Attempt to fix the iOS build after r200874
885
886         Unreviewed build fix.
887
888         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
889
890 2016-05-13  Sam Weinig  <sam@webkit.org>
891
892         Rename WKDataDetectorTypeSpotlightSuggestion to WKDataDetectorTypeLookupSuggestion
893         <rdar://problem/26269611>
894
895         Reviewed by Dan Bernstein and Enrica Casucci. 
896
897         * Shared/API/Cocoa/WKFoundation.h:
898         * Shared/API/c/WKDeclarationSpecifiers.h:
899         * UIProcess/API/Cocoa/WKWebView.mm:
900         (fromWKDataDetectorTypes):
901         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
902         * mac/postprocess-framework-headers.sh:
903
904 2016-05-13  Beth Dakin  <bdakin@apple.com>
905
906         Add dyldSPI.h for linked on or after checks, and add one for link preview
907         https://bugs.webkit.org/show_bug.cgi?id=157401
908
909         Reviewed by Darin Adler.
910
911         Set _allowsLinkPreview to YES for programs linked on or after 
912         firstSDKVersionWithLinkPreviewEnabledByDefault.
913         * UIProcess/API/Cocoa/WKWebView.h:
914         * UIProcess/API/Cocoa/WKWebView.mm:
915         (-[WKWebView _initializeWithConfiguration:]):
916
917 2016-05-13  Jer Noble  <jer.noble@apple.com>
918
919         Fullscreen view attempts to resize when in 2-up mode
920         https://bugs.webkit.org/show_bug.cgi?id=157558
921
922         Reviewed by Darin Adler.
923
924         No need to react to NSApplicationDidChangeScreenParametersNotification to resize the
925         fullscreen window when the screen parameters change; the NSWindow fullscreen machinery
926         will do that on our behalf.
927
928         * UIProcess/mac/WKFullScreenWindowController.mm:
929         (-[WKFullScreenWindowController windowDidLoad]): Deleted.
930         (-[WKFullScreenWindowController applicationDidChangeScreenParameters:]): Deleted.
931
932 2016-05-13  Antoine Quint  <graouts@apple.com>
933
934         [iOS] <select> elements popover should render right-aligned when in RTL mode
935         https://bugs.webkit.org/show_bug.cgi?id=157672
936         <rdar://problem/26193442>
937
938         Reviewed by Darin Adler.
939
940         Add a new isRTL field to the AssistedNodeInformation as specified by the assisted
941         node's render style and account for it when displaying the table view shown in the
942         popover attached to the assisted node using the UIView semanticContentAttribute
943         property.
944
945         * Shared/AssistedNodeInformation.cpp:
946         (WebKit::AssistedNodeInformation::encode):
947         (WebKit::AssistedNodeInformation::decode):
948         * Shared/AssistedNodeInformation.h:
949         (WebKit::AssistedNodeInformation::AssistedNodeInformation):
950         * UIProcess/ios/forms/WKFormSelectPopover.mm:
951         (-[WKSelectTableViewController initWithView:hasGroups:]):
952         (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
953         * WebProcess/WebPage/ios/WebPageIOS.mm:
954         (WebKit::WebPage::getAssistedNodeInformation):
955
956 2016-05-13  Tina Liu  <iting_liu@apple.com>
957
958         Revert r199691.
959         https://bugs.webkit.org/show_bug.cgi?id=157645
960         <rdar://problem/26235373>
961
962         Reviewed by Darin Adler.
963
964         * Shared/WebProcessCreationParameters.cpp:
965         (WebKit::WebProcessCreationParameters::encode): Deleted.
966         (WebKit::WebProcessCreationParameters::decode): Deleted.
967         * Shared/WebProcessCreationParameters.h:
968         * UIProcess/API/C/mac/WKContextPrivateMac.h:
969         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
970         (WKContextSetPrivateBrowsingPluginLoadClientPolicy): Deleted.
971         * UIProcess/WebProcessPool.cpp:
972         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
973         (WebKit::WebProcessPool::createNewWebProcess): Deleted.
974         (WebKit::WebProcessPool::setPluginLoadClientPolicyForPrivateBrowsing): Deleted.
975         (WebKit::WebProcessPool::setPrivateBrowsingPluginLoadClientPolicy): Deleted.
976         (WebKit::WebProcessPool::clearPluginClientPolicies): Deleted.
977         * UIProcess/WebProcessPool.h:
978         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
979         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
980         (WebKit::WebPlatformStrategies::longestMatchedWildcardHostForHost):
981         (WebKit::WebPlatformStrategies::replaceHostWithMatchedWildcardHost):
982         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost):
983         (WebKit::WebPlatformStrategies::populatePluginCache):
984         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicyForPrivateBrowsing): Deleted.
985         (WebKit::WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy): Deleted.
986         (WebKit::WebPlatformStrategies::clearPluginClientPolicies): Deleted.
987         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHostForPrivateBrowsing): Deleted.
988         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
989         * WebProcess/WebProcess.cpp:
990         (WebKit::WebProcess::initializeWebProcess):
991         (WebKit::WebProcess::setPluginLoadClientPolicies): Deleted.
992         (WebKit::WebProcess::setPrivateBrowsingPluginLoadClientPolicy): Deleted.
993         * WebProcess/WebProcess.h:
994         * WebProcess/WebProcess.messages.in:
995
996 2016-05-12  Daniel Bates  <dabates@apple.com>
997
998         Use SecTask SPI to retrieve code signing identifier for user directory suffix
999         https://bugs.webkit.org/show_bug.cgi?id=157570
1000         <rdar://problem/25706517>
1001
1002         Reviewed by Darin Adler.
1003
1004         It is sufficient to make use of the SecTask SPI to retrieve the code signing
1005         identifier of the embedding client for use in the user directory suffix. This
1006         avoids the need to allow Code Signing Services to have access to the bundle
1007         of the embedding client.
1008
1009         * Shared/mac/ChildProcessMac.mm:
1010         (WebKit::ChildProcess::initializeSandbox): Use the code signing identifier of the
1011         embedding client as part of the user directory suffix if available.
1012         * Shared/mac/CodeSigning.h: Update comment and include header wtf/spi/darwin/XPCSPI.h
1013         for the definition of xpc_connection_t. Renamed codeSigningIdentifier() to codeSigningIdentifierForCurrentProcess()
1014         to convey that it returns the code signing identifier for the current process. Repurposed
1015         the name codeSigningIdentifier for the variant of this function that takes a xpc_connection_t.
1016         * Shared/mac/CodeSigning.mm:
1017         (WebKit::codeSigningIdentifier): Added. Uses the audit token associated with the specified
1018         XPC connection to get the code signing identifier for the embedding client.
1019         (WebKit::codeSigningIdentifierForCurrentProcess): Renamed; formerly named codeSigningIdentifier.
1020         Implemented in terms of the SecTask API.
1021         (WebKit::secCodeForCurrentProcess): Deleted.
1022         (WebKit::secCodeForProcess): Deleted.
1023         (WebKit::secCodeSigningInformation): Deleted.
1024         (WebKit::appleSignedOrMacAppStoreSignedOrAppleDeveloperSignedRequirement): Deleted.
1025         (WebKit::secCodeSigningIdentifier): Deleted.
1026         (WebKit::codeSigningIdentifierForProcess): Deleted.
1027         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1028         (WebKit::connectToService): Update code due to renaming.
1029
1030 2016-05-12  Konstantin Tokarev  <annulen@yandex.ru>
1031
1032         Use reference instead of pointer in FrameLoaderClient::saveViewStateToItem.
1033         https://bugs.webkit.org/show_bug.cgi?id=157624
1034
1035         Reviewed by Darin Adler.
1036
1037         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1038         (WebKit::WebFrameLoaderClient::saveViewStateToItem):
1039         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1040
1041 2016-05-12  Csaba Osztrogonác  <ossy@webkit.org>
1042
1043         Remove ENABLE(ES6_ARROWFUNCTION_SYNTAX) guards
1044         https://bugs.webkit.org/show_bug.cgi?id=157564
1045
1046         Reviewed by Darin Adler.
1047
1048         * Configurations/FeatureDefines.xcconfig:
1049
1050 2016-05-11  Anders Carlsson  <andersca@apple.com>
1051
1052         We have two different types of contextual menus in iBooks
1053         https://bugs.webkit.org/show_bug.cgi?id=157587
1054         rdar://problem/25904169
1055
1056         Reviewed by Darin Adler.
1057
1058         Give clients the option to bypass the WebKit context menu machinery.
1059
1060         * UIProcess/mac/WebContextMenuProxyMac.mm:
1061         (WebKit::WebContextMenuProxyMac::showContextMenu):
1062
1063 2016-05-10  Brian Burg  <bburg@apple.com>
1064
1065         Web Automation: add command to asynchronously load the Web Inspector frontend in the background
1066         https://bugs.webkit.org/show_bug.cgi?id=157509
1067
1068         Reviewed by Timothy Hatcher and Joseph Pecoraro.
1069
1070         In order to make it easier to debug code that executes as a result of an automation
1071         command, this patch adds a new Automation command to asynchronously load the debugger
1072         and Inspector frontend. It is designed for use by automation clients to implement an
1073         auto-inspection feature to aid in debugging automation scripts.
1074
1075         * UIProcess/Automation/Automation.json: Add new command.
1076         * UIProcess/Automation/WebAutomationSession.cpp:
1077         (WebKit::WebAutomationSession::inspectBrowsingContext): Added.
1078         (WebKit::WebAutomationSession::inspectorFrontendLoaded): Added.
1079         This message is forwarded by WebInspectorProxy to the inspected page's session.
1080
1081         * UIProcess/Automation/WebAutomationSession.h:
1082         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
1083         (WebKit::WebAutomationSession::sendSynthesizedEventsToPage):
1084         Force the active automation window to become key and bring to front prior to
1085         sending each NSEvent. This way, if the Inspector pauses while a command executes,
1086         the automation window will get back focus when the Inspector unpauses just before
1087         the next synthesized mouse or keyboard NSEvent is sent to its NSWindow.
1088
1089         * UIProcess/WebInspectorProxy.cpp:
1090         (WebKit::WebInspectorProxy::frontendLoaded):
1091         Forward to the inspected page's session.
1092
1093         * UIProcess/WebInspectorProxy.h:
1094         * UIProcess/WebInspectorProxy.messages.in: Add notification of the frontend's load.
1095
1096         * WebProcess/WebPage/WebInspectorUI.cpp:
1097         (WebKit::WebInspectorUI::frontendLoaded):
1098         Kick off notifying the automation session in UIProcess that the inspector loaded.
1099
1100         (WebKit::WebInspectorUI::closeWindow):
1101         In some circumstances, the Web Inspector can be loaded without showing
1102         the window. If this hidden page closes, make sure the frontend host gets
1103         a chance to disconnect its InspectorFrontendClient. Normally this happens
1104         when the window closes, but unshown Inspectors do not get window instances.
1105
1106 2016-05-11  Chris Dumez  <cdumez@apple.com>
1107
1108         Update Node::appendChild() / replaceChild() / removeChild() / insertBefore() to take references instead of pointers
1109         https://bugs.webkit.org/show_bug.cgi?id=157556
1110
1111         Reviewed by Darin Adler.
1112
1113         * WebProcess/InjectedBundle/API/mac/WKDOMNode.mm:
1114         (-[WKDOMNode insertNode:before:]):
1115         (-[WKDOMNode appendChild:]):
1116         (-[WKDOMNode removeChild:]):
1117         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1118         (WebKit::PDFPlugin::PDFPlugin):
1119         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
1120         (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement):
1121
1122 2016-05-11  Brady Eidson  <beidson@apple.com>
1123
1124         Modern IDB: IDBOpenDBRequests that are stop()'ed don't notify the IDBServer of that fact.
1125         https://bugs.webkit.org/show_bug.cgi?id=157448
1126
1127         Reviewed by Alex Christensen.
1128
1129         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1130         (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
1131         (WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
1132         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
1133         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
1134
1135         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1136         (WebKit::WebIDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
1137         (WebKit::WebIDBConnectionToServer::openDBRequestCancelled):
1138         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1139
1140 2016-05-11  Myles C. Maxfield  <mmaxfield@apple.com>
1141
1142         Fix a typo in r200330
1143
1144         Unreviewed.
1145
1146         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1147
1148 2016-05-10  Sam Weinig  <sam@webkit.org>
1149
1150         Only expose WKDataDetectorTypes and -[WKWebViewConfiguration dataDetectorTypes] on iOS
1151         for now, since we don't have it fully implemented on Mac.
1152
1153         Reviewed by Tim Horton.
1154
1155         * UIProcess/API/Cocoa/WKWebView.mm:
1156         (fromWKDataDetectorTypes):
1157         (-[WKWebView _initializeWithConfiguration:]):
1158         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1159         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1160         (-[WKWebViewConfiguration encodeWithCoder:]):
1161         (-[WKWebViewConfiguration initWithCoder:]):
1162         (-[WKWebViewConfiguration copyWithZone:]):
1163
1164 2016-05-10  Sam Weinig  <sam@webkit.org>
1165
1166         Add SPI for Data Detectors to get ranges of text around an existing range.
1167         <rdar://problem/26009749>
1168
1169         Reviewed by Enrica Casucci.
1170
1171         * WebProcess/InjectedBundle/API/mac/WKDOMRange.h:
1172         * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
1173         (-[WKDOMRange rangeByExpandingToWordBoundaryByCharacters:inDirection:]):
1174
1175 2016-05-10  Enrica Casucci  <enrica@apple.com>
1176
1177         Numerous block selection issues on iOS.
1178         https://bugs.webkit.org/show_bug.cgi?id=157490
1179         rdar://problem/25717977
1180         rdar://problem/23042215
1181
1182         Reviewed by Tim Horton.
1183
1184         This patch fixes a number of issues with block selection on iOS.
1185         We no longer eagerly choose block selection vs text selection and we
1186         make sure we are capable of switching back to text selection from block
1187         under every circumstance. The patch also fixes the logic used to decide
1188         when to switch to block selection. It now computes the rectangle for the
1189         paragraph containing the initial text selection to decide when we are
1190         actually dragging outside the boundaries of the paragraph block.
1191
1192         * UIProcess/WebPageProxy.h:
1193         * UIProcess/WebPageProxy.messages.in:
1194         * UIProcess/ios/WKContentViewInteraction.mm:
1195         (selectionChangedWithGesture):
1196         (selectionChangedWithTouch):
1197         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
1198         * UIProcess/ios/WebPageProxyIOS.mm:
1199         (WebKit::WebPageProxy::gestureCallback):
1200         (WebKit::WebPageProxy::touchesCallback):
1201         (WebKit::WebPageProxy::autocorrectionDataCallback):
1202         (WebKit::WebPageProxy::selectWithGesture):
1203         (WebKit::WebPageProxy::updateSelectionWithTouches):
1204         * WebProcess/WebPage/WebPage.h:
1205         * WebProcess/WebPage/ios/WebPageIOS.mm:
1206         (WebKit::selectionBoxForRange):
1207         (WebKit::canShrinkToTextSelection):
1208         (WebKit::hasCustomLineHeight):
1209         (WebKit::WebPage::rangeForWebSelectionAtPosition):
1210         (WebKit::WebPage::contractedRangeFromHandle):
1211         (WebKit::WebPage::updateBlockSelectionWithTouch):
1212         (WebKit::WebPage::clearSelection):
1213         (WebKit::WebPage::switchToBlockSelectionAtPoint):
1214         (WebKit::WebPage::shouldSwitchToBlockModeForHandle):
1215         (WebKit::WebPage::updateSelectionWithTouches):
1216         (WebKit::WebPage::selectWithTwoTouches):
1217
1218 2016-05-10  Alex Christensen  <achristensen@webkit.org>
1219
1220         Handle _schemeUpgraded delegate callbacks in NSURLSessionDataDelegate
1221         https://bugs.webkit.org/show_bug.cgi?id=157354
1222         rdar://problem/25842107
1223
1224         Reviewed by Darin Adler.
1225
1226         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1227         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
1228         When we make a request to a http url and CFNetwork determines that that url would have redirected to an HSTS site
1229         and it is going to change the request to an https request, this delegate callback is called.  We need to call the
1230         redirection code to have the same behavior as the NSURLConnection-based loader.
1231
1232 2016-05-10  Csaba Osztrogonác  <ossy@webkit.org>
1233
1234         Fix the !ENABLE(VIDEO) build
1235         https://bugs.webkit.org/show_bug.cgi?id=157518
1236
1237         Reviewed by Alex Christensen.
1238
1239         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1240         (WebKit::WebsiteDataStore::fetchData):
1241         (WebKit::WebsiteDataStore::removeData):
1242         * WebProcess/WebProcess.cpp:
1243         (WebKit::WebProcess::initializeWebProcess):
1244
1245 2016-05-10  Anders Carlsson  <andersca@apple.com>
1246
1247         Fix more deprecation warnings.
1248
1249         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
1250         (NetworkServiceInitializer):
1251         * PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm:
1252         (PluginServiceInitializer):
1253         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
1254         (WebContentServiceInitializer):
1255
1256 2016-05-10  Chris Dumez  <cdumez@apple.com>
1257
1258         [SpeculativeValidation] Do not start a preload if there is already one pending
1259         https://bugs.webkit.org/show_bug.cgi?id=157522
1260         <rdar://problem/26156083>
1261
1262         Reviewed by Alex Christensen.
1263
1264         Do not start a preload if there is already one pending. We failed to check in
1265         SpeculativeLoadManager::preloadEntry() if there was already a pending preload.
1266         As a result, we would sometimes cancel an already pending preload and start
1267         one from scratch which is inefficient. It would also sometimes lead to hitting
1268         an assertion in the SpeculativeLoad destructor because we could destroy the
1269         SpeculativeLoad without finishing or cancelling the load.
1270
1271         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1272         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
1273
1274 2016-05-10  Anders Carlsson  <andersca@apple.com>
1275
1276         Fix a deprecation warning.
1277
1278         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm:
1279         (DatabaseServiceInitializer):
1280
1281 2016-05-10  Tim Horton  <timothy_horton@apple.com>
1282
1283         Clicks do not work in Safari after pressing the Track package button in Gmail
1284         https://bugs.webkit.org/show_bug.cgi?id=157508
1285         <rdar://problem/22646404>
1286
1287         Reviewed by Anders Carlsson.
1288
1289         * UIProcess/Cocoa/WebViewImpl.mm:
1290         (WebKit::WebViewImpl::viewDidMoveToWindow):
1291         Explicitly cancel the force-click animation when we're removing the gesture
1292         recognizer due to the WK*View being unparented. This works around a bug
1293         where we don't get the cancellation callback in this situation, causing
1294         Safari to be left in an inconsistent and unexpected state.
1295
1296 2016-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1297
1298         [Linux] Remove seccomp filters support
1299         https://bugs.webkit.org/show_bug.cgi?id=157380
1300
1301         Reviewed by Darin Adler.
1302
1303         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1304         (WebKit::NetworkProcessCreationParameters::encode): Deleted.
1305         (WebKit::NetworkProcessCreationParameters::decode): Deleted.
1306         * NetworkProcess/NetworkProcessCreationParameters.h:
1307         * PlatformEfl.cmake:
1308         * PlatformGTK.cmake:
1309         * Shared/WebProcessCreationParameters.cpp:
1310         (WebKit::WebProcessCreationParameters::encode): Deleted.
1311         (WebKit::WebProcessCreationParameters::decode): Deleted.
1312         * Shared/WebProcessCreationParameters.h:
1313         * Shared/linux/SeccompFilters/OpenSyscall.cpp: Removed.
1314         * Shared/linux/SeccompFilters/OpenSyscall.h: Removed.
1315         * Shared/linux/SeccompFilters/SeccompBroker.cpp: Removed.
1316         * Shared/linux/SeccompFilters/SeccompBroker.h: Removed.
1317         * Shared/linux/SeccompFilters/SeccompFilters.cpp: Removed.
1318         * Shared/linux/SeccompFilters/SeccompFilters.h: Removed.
1319         * Shared/linux/SeccompFilters/SigactionSyscall.cpp: Removed.
1320         * Shared/linux/SeccompFilters/SigactionSyscall.h: Removed.
1321         * Shared/linux/SeccompFilters/SigprocmaskSyscall.cpp: Removed.
1322         * Shared/linux/SeccompFilters/SigprocmaskSyscall.h: Removed.
1323         * Shared/linux/SeccompFilters/Syscall.cpp: Removed.
1324         * Shared/linux/SeccompFilters/Syscall.h: Removed.
1325         * Shared/linux/SeccompFilters/SyscallPolicy.cpp: Removed.
1326         * Shared/linux/SeccompFilters/SyscallPolicy.h: Removed.
1327         * Shared/linux/SeccompFilters/XDGBaseDirectory.h: Removed.
1328         * Shared/linux/SeccompFilters/XDGBaseDirectoryGLib.cpp: Removed.
1329         * UIProcess/WebProcessPool.cpp:
1330         (WebKit::WebProcessPool::ensureNetworkProcess): Deleted.
1331         (WebKit::WebProcessPool::createNewWebProcess): Deleted.
1332         (WebKit::WebProcessPool::cookieStorageDirectory): Deleted.
1333         * UIProcess/WebProcessPool.h:
1334         * WebProcess/efl/SeccompFiltersWebProcessEfl.cpp: Removed.
1335         * WebProcess/efl/SeccompFiltersWebProcessEfl.h: Removed.
1336         * WebProcess/gtk/SeccompFiltersWebProcessGtk.cpp: Removed.
1337         * WebProcess/gtk/SeccompFiltersWebProcessGtk.h: Removed.
1338         * WebProcess/soup/WebProcessSoup.cpp:
1339         (WebKit::WebProcess::platformInitializeWebProcess): Deleted.
1340
1341 2016-05-09  Tim Horton  <timothy_horton@apple.com>
1342
1343         REGRESSION (r191922): Zoom in/Zoom Out is not working for PDFs
1344         https://bugs.webkit.org/show_bug.cgi?id=157503
1345         <rdar://problem/23736297>
1346
1347         Reviewed by Anders Carlsson.
1348
1349         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
1350         Restore a requiresUnifiedScaleFactor that was lost in r191922.
1351
1352         * UIProcess/WebPageProxy.cpp:
1353         (WebKit::WebPageProxy::didCommitLoadForFrame):
1354         (WebKit::WebPageProxy::mainFramePluginHandlesPageScaleGestureDidChange):
1355         * UIProcess/WebPageProxy.h:
1356         * UIProcess/WebPageProxy.messages.in:        
1357         * WebProcess/Plugins/PluginView.cpp:
1358         (WebKit::PluginView::didInitializePlugin):
1359         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1360         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
1361         Separate mainFramePluginHandlesPageScaleGesture changes out from didCommitLoadForFrame,
1362         because the PluginView doesn't exist at this point, so it can't answer
1363         the handlesPageScaleGesture question correctly (or at all).
1364         Instead, we'll send the message when the main-frame PluginView is initialized.
1365
1366 2016-05-09  Simon Fraser  <simon.fraser@apple.com>
1367
1368         [iOS] visibility:hidden -webkit-overflow-scrolling: touch divs can interfere with page scrolling
1369         https://bugs.webkit.org/show_bug.cgi?id=157496
1370         rdar://problem/22963278
1371
1372         Reviewed by Tim Horton.
1373
1374         UIScrollViews are constructed in the UI process for visibility:hidden scrollable elements
1375         with -webkit-overflow-scrolling: touch, and these intercept user events when they should not.
1376
1377         Fix by propagating a "contentsHidden" flag from the web process which is used to turn off
1378         user interaction on these views.
1379
1380         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
1381         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
1382         * Shared/mac/RemoteLayerTreeTransaction.h:
1383         * Shared/mac/RemoteLayerTreeTransaction.mm:
1384         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
1385         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
1386         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
1387         (WebKit::dumpChangedLayers):
1388         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
1389         (-[UIView _recursiveFindDescendantScrollViewAtPoint:withEvent:]): Our custom hit
1390         test needs to take view.isUserInteractionEnabled into account.
1391         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1392         (WebKit::PlatformCALayerRemote::setHidden):
1393         (WebKit::PlatformCALayerRemote::contentsHidden):
1394         (WebKit::PlatformCALayerRemote::setContentsHidden):
1395         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1396
1397 2016-05-09  Ada Chan  <adachan@apple.com>
1398
1399         Introduce WebVideoFullscreenInterfaceMac::isPlayingVideoInEnhancedFullscreen() and use it in WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen()
1400         https://bugs.webkit.org/show_bug.cgi?id=157493
1401
1402         Reviewed by Dan Bernstein.
1403
1404         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1405         (WebKit::WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen):
1406
1407 2016-05-06  Ada Chan  <adachan@apple.com>
1408
1409         Add WKPageRef SPI to tell whether there's a video playing in enhanced fullscreen
1410         https://bugs.webkit.org/show_bug.cgi?id=157434
1411
1412         Reviewed by Darin Adler.
1413
1414         * UIProcess/API/C/mac/WKPagePrivateMac.h:
1415         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
1416         (WKPageIsPlayingVideoInEnhancedFullscreen):
1417         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
1418         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1419         (WebKit::WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen):
1420         * UIProcess/WebPageProxy.cpp:
1421         (WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen):
1422         * UIProcess/WebPageProxy.h:
1423
1424 2016-05-09  Anders Carlsson  <andersca@apple.com>
1425
1426         Add injected bundle SPI for getting favicon and touch icon URLs
1427         https://bugs.webkit.org/show_bug.cgi?id=157435
1428
1429         Reviewed by Darin Adler.
1430
1431         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
1432         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
1433         (collectIcons):
1434         New helper function that calls into the WebCore LinkCollector.
1435
1436         (-[WKWebProcessPlugInFrame appleTouchIconURLs]):
1437         Call collectIcons.
1438
1439         (-[WKWebProcessPlugInFrame faviconURLs]):
1440         Ditto.
1441
1442 2016-05-06  Simon Fraser  <simon.fraser@apple.com>
1443
1444         [iOS WK2] Font size increases on some pages after navigating then going back
1445         https://bugs.webkit.org/show_bug.cgi?id=157441
1446         rdar://problem/22873240
1447
1448         Reviewed by Darin Adler.
1449
1450         There's an ordering dependency between setting the viewport configuration and doing
1451         layouts when going back to a page from the page cache that is incorrectly handled.
1452
1453         In FrameLoader::commitProvisionalLoad(), CachedPage::restore() triggers a layout under
1454         updateContentsSize(), but this happens before dispatchDidCommitLoad() which updates
1455         the viewport arguments via ViewportConfiguration::setViewportArguments().
1456
1457         This issue is not addressed by the current commit. But a second problem is:
1458         if the inputs to text autosizing change, we need to invalidate the autosizing state.
1459         The relevant input here is the fixed layout width (which is determined from the viewport
1460         configuration).
1461
1462         The current code invalidated text autosizing when m_viewportConfiguration.minimumLayoutSize()
1463         changed, but the correct behavior is to invalidate based on fixed layout size changing.
1464
1465         * WebProcess/WebPage/WebPage.cpp:
1466         (WebKit::WebPage::sendViewportAttributesChanged):
1467         (WebKit::WebPage::setFixedLayoutSize):
1468         * WebProcess/WebPage/WebPage.h:
1469         * WebProcess/WebPage/ios/WebPageIOS.mm:
1470         (WebKit::WebPage::resetTextAutosizing):
1471         (WebKit::WebPage::dynamicViewportSizeUpdate):
1472         (WebKit::WebPage::viewportConfigurationChanged):
1473         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize): Deleted.
1474         (WebKit::WebPage::resetTextAutosizingBeforeLayoutIfNeeded): Deleted.
1475
1476 2016-05-09  Alex Christensen  <achristensen@webkit.org>
1477
1478         Don't use DiskCache for media resource loads
1479         https://bugs.webkit.org/show_bug.cgi?id=157405
1480
1481         Reviewed by Darin Adler.
1482
1483         * NetworkProcess/cache/NetworkCache.cpp:
1484         (WebKit::NetworkCache::makeRetrieveDecision):
1485         (WebKit::NetworkCache::makeStoreDecision):
1486         * NetworkProcess/cache/NetworkCache.h:
1487         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1488         (WebKit::NetworkCache::retrieveDecisionToDiagnosticKey):
1489
1490 2016-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
1491
1492         [OS X] Migrate our Font classes entirely off of NSFont
1493         https://bugs.webkit.org/show_bug.cgi?id=157464
1494
1495         Reviewed by Darin Adler.
1496
1497         * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
1498         (WebKit::WebPopupMenu::setUpPlatformData):
1499         * WebProcess/WebPage/mac/WebPageMac.mm:
1500         (WebKit::WebPage::fontAtSelection):
1501
1502 2016-05-06  Joseph Pecoraro  <pecoraro@apple.com>
1503
1504         Rename HitTestRequest DisallowShadowContent to DisallowUserAgentShadowContent
1505         https://bugs.webkit.org/show_bug.cgi?id=157447
1506
1507         Reviewed by Ryosuke Niwa.
1508
1509         * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp:
1510         (WebKit::WebPage::findZoomableAreaForPoint):
1511         * WebProcess/WebPage/WebFrame.cpp:
1512         (WebKit::WebFrame::hitTest):
1513         * WebProcess/WebPage/WebPage.cpp:
1514         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
1515         * WebProcess/WebPage/ios/WebPageIOS.mm:
1516         (WebKit::WebPage::rangeForWebSelectionAtPosition):
1517         (WebKit::WebPage::rangeForBlockAtPoint):
1518         (WebKit::WebPage::getPositionInformation):
1519
1520 2016-05-06  Simon Fraser  <simon.fraser@apple.com>
1521
1522         Enable IOS_TEXT_AUTOSIZING on Mac and make it testable
1523         https://bugs.webkit.org/show_bug.cgi?id=157432
1524         rdar://problem/16406720
1525
1526         Reviewed by Dean Jackson.
1527
1528         Enable IOS_TEXT_AUTOSIZING on Mac so it can be tested.
1529         
1530         Make the setTextAutosizingEnabled() Setting work, and plumb it through WK1 and WK2
1531         preferences for WTR and DRT. Make textAutosizingWindowSizeOverride() work, for layout tests.
1532         These two settings are shared with TEXT_AUTOSIZING.
1533
1534         Add a TextAutosizing log channel, which is useful for generated -expected.html results.
1535
1536         Move adjustComputedFontSizesOnBlocks() and related code from RenderObject to RenderElement
1537         without changes.
1538
1539         An implication of this set of changes is that the way clients enable text autosizing
1540         has changed. Previously, they set the "MinimumZoomFontSize" preference to 0.
1541         Settings::defaultMinimumZoomFontSize() used to do this in order to enable text autosizing
1542         on iPhone only, not iPad.
1543
1544         Now the preferred technique is to leave minimumZoomFontSize alone, and to use textAutosizingEnabled()
1545         instead. Settings::defaultTextAutosizingEnabled() now does the check for iPhone.
1546
1547         UIWebView calls WebKitGetMinimumZoomFontSize() to setup the default minimum font zoom size,
1548         which will now always return 15, but had no other code that toggled this. So it's safe to just rely
1549         on Settings::defaultTextAutosizingEnabled() doing the right thing for iPhone/iPad.
1550
1551         * Configurations/FeatureDefines.xcconfig:
1552         * Shared/WebPreferencesDefinitions.h:
1553         * UIProcess/API/Cocoa/WKPreferences.mm:
1554         (-[WKPreferences _textAutosizingEnabled]):
1555         (-[WKPreferences _setTextAutosizingEnabled:]):
1556         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1557         * WebProcess/WebPage/WebPage.cpp:
1558         (WebKit::WebPage::updatePreferences):
1559
1560 2016-05-06  Dean Jackson  <dino@apple.com>
1561
1562         Regions, Shapes and Tracks don't need runtime features
1563         https://bugs.webkit.org/show_bug.cgi?id=157426
1564         <rdar://problem/26146262>
1565
1566         Reviewed by Simon Fraser.
1567
1568         The following RuntimeEnabledFeatures can be removed since
1569         we have no need to disable them (they are stable and have
1570         shipped for a while):
1571         - CSS Regions
1572         - CSS Shapes
1573         - Media tracks
1574
1575         * Shared/WebPreferencesDefinitions.h:
1576         * UIProcess/API/C/WKPreferences.cpp:
1577         (WKPreferencesSetCSSRegionsEnabled): Deleted.
1578         (WKPreferencesGetCSSRegionsEnabled): Deleted.
1579         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1580         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1581         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Deleted.
1582         (WebKit::InjectedBundle::setCSSRegionsEnabled): Deleted.
1583         (WebKit::InjectedBundle::setCSSCompositingEnabled): Deleted.
1584         * WebProcess/InjectedBundle/InjectedBundle.h:
1585         * WebProcess/WebPage/WebPage.cpp:
1586         (WebKit::WebPage::updatePreferences): Deleted.
1587
1588 2016-05-05  Ada Chan  <adachan@apple.com>
1589
1590         Create a fence in WebVideoFullscreenManagerProxy::setVideoLayerFrame() to pass to the web process
1591         https://bugs.webkit.org/show_bug.cgi?id=157409
1592
1593         Reviewed by Tim Horton.
1594
1595         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1596         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
1597         Create a fence by calling DrawingAreaProxy::createFence() and pass it when sending the
1598         WebVideoFullscreenManager::SetVideoLayerFrameFenced message.
1599
1600         * UIProcess/DrawingAreaProxy.cpp:
1601         (WebKit::DrawingAreaProxy::createFence):
1602         Stub implementation. Assert not to be reached here since it's only implemented on Mac so far.
1603         * UIProcess/DrawingAreaProxy.h:
1604
1605         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
1606         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
1607         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
1608         Renamed from createFenceForGeometryUpdate() since we are using it for more than just updating geometry.
1609         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
1610         Update due to method rename.
1611
1612 2016-05-05  Brady Eidson  <beidson@apple.com>
1613
1614         Modern IDB (Workers): Get everything to the right threads.
1615         https://bugs.webkit.org/show_bug.cgi?id=157398
1616
1617         Reviewed by Alex Christensen.
1618
1619         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1620         (WebKit::WebIDBConnectionToServer::putOrAdd):
1621         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1622
1623 2016-05-05  Manuel Rego Casasnovas  <rego@igalia.com>
1624
1625         [GTK] Remove "region based columns" runtime feature remainings
1626         https://bugs.webkit.org/show_bug.cgi?id=157393
1627
1628         The runtime feature was removed in r168978,
1629         and the usage in WebKitSettings.cpp in r168988.
1630         However it was still around in ExperimentalFeatures class.
1631
1632         Reviewed by Michael Catanzaro.
1633
1634         * UIProcess/gtk/ExperimentalFeatures.cpp: Remove runtime feature.
1635         * UIProcess/gtk/ExperimentalFeatures.h: Ditto.
1636
1637 2016-05-05  Manuel Rego Casasnovas  <rego@igalia.com>
1638
1639         [GTK] Add CSS Grid Layout as experimental feature
1640         https://bugs.webkit.org/show_bug.cgi?id=157391
1641
1642         Reviewed by Michael Catanzaro.
1643
1644         Now that we've a runtime feature again for CSS Grid Layout (r200215),
1645         we can recover the old patch (r162215) that allows to enable/disable
1646         CSS Grid Layout through the environment variable
1647         WEBKITGTK_EXPERIMENTAL_FEATURES.
1648
1649         Example: WEBKITGTK_EXPERIMENTAL_FEATURES="CSS_GRID_LAYOUT=1"
1650
1651         * UIProcess/API/gtk/WebKitSettings.cpp:
1652         (webKitSettingsConstructed): Use new experimental feature to enable
1653         or disable CSS Grid Layout.
1654         * UIProcess/gtk/ExperimentalFeatures.cpp: Add new experimental feature.
1655         * UIProcess/gtk/ExperimentalFeatures.h: Ditto.
1656
1657 2016-05-05  Jer Noble  <jer.noble@apple.com>
1658
1659         [WK2] Media controls don't update if controller is created after the interface is created
1660         https://bugs.webkit.org/show_bug.cgi?id=157376
1661
1662         Reviewed by Beth Dakin.
1663
1664         Implement the new getter methods on WebPlaybackSessionModelContext by caching the values
1665         passed through WebPlaybackSessionManagerProxy.
1666
1667         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
1668         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
1669         (WebKit::WebPlaybackSessionManagerProxy::setCurrentTime):
1670         (WebKit::WebPlaybackSessionManagerProxy::setBufferedTime):
1671         (WebKit::WebPlaybackSessionManagerProxy::setSeekableRangesVector):
1672         (WebKit::WebPlaybackSessionManagerProxy::setCanPlayFastReverse):
1673         (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions):
1674         (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions):
1675         (WebKit::WebPlaybackSessionManagerProxy::setExternalPlaybackProperties):
1676         (WebKit::WebPlaybackSessionManagerProxy::setWirelessVideoPlaybackDisabled):
1677         (WebKit::WebPlaybackSessionManagerProxy::setDuration):
1678         (WebKit::WebPlaybackSessionManagerProxy::setRate):
1679         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
1680         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1681         (WebKit::WebVideoFullscreenModelContext::requestFullscreenMode): Deleted.
1682         (WebKit::WebVideoFullscreenModelContext::setVideoLayerFrame): Deleted.
1683         (WebKit::WebVideoFullscreenModelContext::setVideoLayerGravity): Deleted.
1684         (WebKit::WebVideoFullscreenModelContext::fullscreenModeChanged): Deleted.
1685         (WebKit::WebVideoFullscreenModelContext::isVisible): Deleted.
1686         (WebKit::WebVideoFullscreenModelContext::didSetupFullscreen): Deleted.
1687         (WebKit::WebVideoFullscreenModelContext::didEnterFullscreen): Deleted.
1688         (WebKit::WebVideoFullscreenModelContext::didExitFullscreen): Deleted.
1689         (WebKit::WebVideoFullscreenModelContext::didCleanupFullscreen): Deleted.
1690         (WebKit::WebVideoFullscreenManagerProxy::WebVideoFullscreenManagerProxy): Deleted.
1691         (WebKit::WebVideoFullscreenManagerProxy::~WebVideoFullscreenManagerProxy): Deleted.
1692
1693 2016-05-05  Dean Jackson  <dino@apple.com>
1694
1695         Shadow DOM should not be experimental
1696         https://bugs.webkit.org/show_bug.cgi?id=157384
1697         <rdar://problem/26123254>
1698
1699         Reviewed by Anders Carlsson.
1700
1701         Shadow DOM is not an experimental feature. We want
1702         it enabled by default.
1703
1704         This fixes the timeout in:
1705         WebKit2.InjectedBundleMakeAllShadowRootOpenTest
1706
1707         * Shared/WebPreferencesDefinitions.h: Move the Shadow
1708         DOM preference out of Experimental.
1709         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1710         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1711         * WebProcess/WebPage/WebPage.cpp:
1712         (WebKit::WebPage::updatePreferences):
1713
1714 2016-05-05  Simon Fraser  <simon.fraser@apple.com>
1715
1716         Revert r200390, thus putting r199259 and r200161 and back.
1717
1718         * Shared/VisibleContentRectUpdateInfo.cpp:
1719         (WebKit::VisibleContentRectUpdateInfo::encode):
1720         (WebKit::VisibleContentRectUpdateInfo::decode):
1721         * Shared/VisibleContentRectUpdateInfo.h:
1722         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
1723         (WebKit::VisibleContentRectUpdateInfo::enclosedInScrollableAncestorView):
1724         (WebKit::operator==):
1725         * UIProcess/API/Cocoa/WKWebView.mm:
1726         (-[WKWebView _didInvokeUIScrollViewDelegateCallback]):
1727         (-[WKWebView _didFinishScrolling]):
1728         (-[WKWebView scrollViewDidScroll:]):
1729         (-[WKWebView scrollViewDidZoom:]):
1730         (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
1731         (-[WKWebView _scrollViewDidInterruptDecelerating:]):
1732         (-[WKWebView _visibleRectInEnclosingScrollView:]):
1733         (-[WKWebView _visibleContentRect]):
1734         (-[WKWebView _didScroll]):
1735         (-[WKWebView _enclosingScrollerScrollingEnded:]):
1736         (-[WKWebView _frameOrBoundsChanged]):
1737         (-[WKWebView _updateVisibleContentRects]):
1738         (-[WKWebView _updateVisibleContentRectAfterScrollInView:]):
1739         (scrollViewCanScroll):
1740         (-[WKWebView _updateContentRectsWithState:]):
1741         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1742         * UIProcess/WebPageProxy.h:
1743         * UIProcess/ios/WKContentView.h:
1744         * UIProcess/ios/WKContentView.mm:
1745         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1746         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): Deleted.
1747         * UIProcess/ios/WebPageProxyIOS.mm:
1748         (WebKit::WebPageProxy::updateVisibleContentRects):
1749         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1750         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
1751         * WebProcess/WebPage/ios/WebPageIOS.mm:
1752         (WebKit::WebPage::updateVisibleContentRects):
1753
1754 2016-05-02  Sam Weinig  <sam@webkit.org>
1755
1756         On platforms that support it, use a SecTrustRef as the basis of CertificateInfo instead of a chain of SecCertificateRefs.
1757         https://bugs.webkit.org/show_bug.cgi?id=157220
1758
1759         Reviewed by Darin Adler.
1760
1761         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
1762         (WebKit::leafCertificate):
1763         (WebKit::chain):
1764         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
1765         When supported, get the SecCertificateRef from the SecTrustRef rather than the
1766         stored certificate chain.
1767
1768         * Shared/cf/ArgumentCodersCF.cpp:
1769         (IPC::typeFromCFTypeRef):
1770         (IPC::encode):
1771         (IPC::decode):
1772         * Shared/cf/ArgumentCodersCF.h:
1773         Add support for encoding/decoding SecTrustRef objects.
1774
1775         * Shared/mac/WebCoreArgumentCodersMac.mm:
1776         (IPC::ArgumentCoder<CertificateInfo>::encode):
1777         (IPC::ArgumentCoder<CertificateInfo>::decode):
1778         Add support for encoding/decoding CertificateInfo's that contain SecTrustRef objects.
1779
1780         (IPC::encodeNSError):
1781         (IPC::decodeNSError):
1782         Simplify error encoding/decoding by not using an addition CertificateInfo object for encoding
1783         the peerCertificateChain. Also, add the peerTrust to the userInfo that get's encoded/decoded.
1784
1785         * UIProcess/API/Cocoa/WKWebView.h:
1786         * UIProcess/API/Cocoa/WKWebView.mm:
1787         (-[WKWebView serverTrust]):
1788         (-[WKWebView certificateChain]):
1789         Add new serverTrust API and deprecate certificateChain.
1790
1791         * UIProcess/Cocoa/NavigationState.mm:
1792         (WebKit::NavigationState::willChangeCertificateInfo):
1793         (WebKit::NavigationState::didChangeCertificateInfo):
1794         Add support for KVO of -[WKWebView serverTrust].
1795
1796 2016-05-05  Daniel Bates  <dabates@apple.com>
1797
1798         Remove workaround added in r200391 (rdar://problem/25992976)
1799         https://bugs.webkit.org/show_bug.cgi?id=157378
1800         <rdar://problem/26118503>
1801
1802         Reviewed by Anders Carlsson.
1803
1804         Following the fix for <rdar://problem/26075714> we can remove the workaround added in r200391 (rdar://problem/25992976).
1805
1806         * Shared/mac/CodeSigning.mm:
1807         (WebKit::secCodeSigningIdentifier):
1808
1809 2016-05-04  Dean Jackson  <dino@apple.com>
1810
1811         Experimental Features don't need an "Experimental" prefix
1812         https://bugs.webkit.org/show_bug.cgi?id=157363
1813         <rdar://problem/26100630>
1814
1815         Reviewed by Anders Carlsson.
1816
1817         Since we're not persisting the value of the experimental
1818         features, it's unlikely there will ever be the case
1819         where we move a Preference from experimental to normal
1820         and use a stored value.
1821
1822         * Shared/WebPreferencesDefinitions.h:
1823         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1824         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1825         * WebProcess/WebPage/WebPage.cpp:
1826         (WebKit::WebPage::updatePreferences):
1827
1828 2016-05-04  Dean Jackson  <dino@apple.com>
1829
1830         Experimental features should toggle runtime flags
1831         https://bugs.webkit.org/show_bug.cgi?id=157353
1832         <rdar://problem/23621603>
1833
1834         Reviewed by Anders Carlsson.
1835
1836         Hook up the experimental WebPreferences to RuntimeEnabledFeatures.
1837         In the process I removed the general preference for WebGL 2 (we
1838         already had an experimental feature for it) and moved Custom
1839         Elements and Shadow DOM to experimental.
1840
1841         I also removed the C versions of the preferences, since experimental
1842         features only need the ObjC API (which is generated automatically).
1843
1844         * Shared/WebPreferencesDefinitions.h: Move/remove some features and
1845         make the experimental section more clear.
1846         * UIProcess/API/C/WKPreferences.cpp:
1847         (WKPreferencesSetWebGL2Enabled): Deleted.
1848         (WKPreferencesGetWebGL2Enabled): Deleted.
1849         (WKPreferencesSetShadowDOMEnabled): Deleted.
1850         (WKPreferencesGetShadowDOMEnabled): Deleted.
1851         (WKPreferencesSetCustomElementsEnabled): Deleted.
1852         (WKPreferencesGetCustomElementsEnabled): Deleted.
1853         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1854         * UIProcess/WebPreferences.cpp:
1855         (WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey): A
1856         version of updateBoolValueForKey that doesn't call the platform
1857         function (e.g. doesn't save to NSUserDefaults).
1858         * UIProcess/WebPreferences.h:
1859         * UIProcess/mac/WebPreferencesMac.mm:
1860         (WebKit::WebPreferences::platformInitializeStore): Deleted.
1861         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1862         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1863         * WebProcess/WebPage/WebPage.cpp:
1864         (WebKit::WebPage::updatePreferences):
1865
1866 2016-05-04  Dean Jackson  <dino@apple.com>
1867
1868         TestRunner should always enable all the experimental features
1869         https://bugs.webkit.org/show_bug.cgi?id=157360
1870         <rdar://problem/26099748>
1871
1872         Reviewed by Anders Carlsson.
1873
1874         Experimental features are disabled by default, but it is
1875         a pain to enable them in every test. Instead, have the
1876         test runner turn them all on.
1877
1878         * UIProcess/API/C/WKPreferences.cpp:
1879         (WKPreferencesEnableAllExperimentalFeatures):
1880         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1881         * UIProcess/WebPreferences.cpp:
1882         (WebKit::WebPreferences::enableAllExperimentalFeatures):
1883         * UIProcess/WebPreferences.h:
1884
1885 2016-05-04  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1886
1887         Add WKPreference for SelectionPaintingWithoutSelectionGaps
1888         https://bugs.webkit.org/show_bug.cgi?id=156900
1889
1890         Reviewed by Michael Catanzaro.
1891
1892         Unlike other browsers WebKit has been drawing selection gaps
1893         between render blocks during the text selection. This often
1894         cause text selection screen looks messy.
1895
1896         This patch adds a setting method to disable the functionality,
1897         and EFL port disables it by default.
1898
1899         * Shared/WebPreferencesDefinitions.h:
1900         * UIProcess/API/C/WKPreferences.cpp:
1901         (WKPreferencesSetSelectionPaintingWithoutSelectionGapsEnabled):
1902         (WKPreferencesGetSelectionPaintingWithoutSelectionGapsEnabled):
1903         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1904         * WebProcess/WebPage/WebPage.cpp:
1905         (WebKit::WebPage::updatePreferences):
1906
1907 2016-05-04  Zan Dobersek  <zdobersek@igalia.com>
1908
1909         [CoordGraphics] CompositingCoordinator should hande root compositing and view overlay layers separately
1910         https://bugs.webkit.org/show_bug.cgi?id=157305
1911
1912         Reviewed by Carlos Garcia Campos.
1913
1914         Update CoordinatedLayerTreeHost and ThreadCoordinatedLayerTreeHost to
1915         correctly use setRootCompositingLayer() and setViewOverlayRootLayer()
1916         methods on the CompositingCoordinator object.
1917
1918         CoordinatedLayerTreeHost doesn't have to keep a pointer to the root
1919         compositing layer anymore. updateRootLayers() can be removed.
1920
1921         ThreadCoordinatedLayerTreeHost doen't have to keep a pointer to both
1922         the root compositing and the view overlay layers anymore. Similarly,
1923         updateRootLayers() can be removed.
1924
1925         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1926         (WebKit::CoordinatedLayerTreeHost::setViewOverlayRootLayer):
1927         (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
1928         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): Deleted.
1929         (WebKit::CoordinatedLayerTreeHost::updateRootLayers): Deleted.
1930         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1931         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1932         (WebKit::ThreadedCoordinatedLayerTreeHost::setRootCompositingLayer):
1933         (WebKit::ThreadedCoordinatedLayerTreeHost::setViewOverlayRootLayer):
1934         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Deleted.
1935         (WebKit::ThreadedCoordinatedLayerTreeHost::updateRootLayers): Deleted.
1936         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1937
1938 2016-05-03  Beth Dakin  <bdakin@apple.com>
1939
1940         Add VideoControlsManager tests
1941         https://bugs.webkit.org/show_bug.cgi?id=157332
1942         -and corresponding-
1943         rdar://problem/24358431
1944
1945         Reviewed by Sam Weinig.
1946
1947         Expose _hasActiveVideoForControlsManager on WKWebViewPrivate for the sake of 
1948         testing. 
1949         * UIProcess/API/Cocoa/WKWebView.mm:
1950         (-[WKWebView _hasActiveVideoForControlsManager]):
1951         (-[WKWebView _doAfterNextPresentationUpdate:]):
1952         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1953
1954 2016-05-03  Jer Noble  <jer.noble@apple.com>
1955
1956         [iOS][WK2] Allow WKWebView to play local filesystem media when created with -loadFileURL:allowingReadAccessToURL:
1957         https://bugs.webkit.org/show_bug.cgi?id=156875
1958         <rdar://problem/24281444>
1959
1960         Reviewed by Alexey Proskuryakov.
1961
1962         Grant AVFoundation the right to issue file read sandbox extensions from the WebContent process to the mediaserverd
1963         process, so that it can play back local media files.
1964
1965         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1966
1967 2016-05-03  Jiewen Tan  <jiewen_tan@apple.com>
1968
1969         File Upload: Photo upload name is always generic (image.jpg)
1970         https://bugs.webkit.org/show_bug.cgi?id=157291
1971         <rdar://problem/12353008>
1972
1973         Reviewed by Darin Adler.
1974
1975         Use the original filename as the name of an uploaded image instead of
1976         a generic name, i.e. image.jpg.
1977
1978         * Platform/spi/ios/PhotosSPI.h: Added.
1979         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1980         (-[WKFileUploadPanel _uploadItemForImage:withAssetURL:successBlock:failureBlock:]):
1981         * WebKit2.xcodeproj/project.pbxproj:
1982
1983 2016-05-03  Chris Dumez  <cdumez@apple.com>
1984
1985         [WK2][DiskCache] Store common HTTP header names as strings
1986         https://bugs.webkit.org/show_bug.cgi?id=157326
1987         <rdar://problem/26073498>
1988
1989         Reviewed by Antti Koivisto.
1990
1991         Store common HTTP header names as strings in the disk cache instead of
1992         using their value in the HTTPHeaderName enumeration. Having the disk
1993         cache rely in the HTTPHeaderName enumeration is risky becomes it means
1994         the cached data would become invalid every time someone updates
1995         HTTPHeaderNames.in in WebCore. If someone were to update
1996         HTTPHeaderNames.in without bumping the disk cache version, we would end
1997         up with wrongly recognized HTTP header names after loading responses
1998         from the cache.
1999
2000         * NetworkProcess/cache/NetworkCacheCoders.cpp:
2001         (WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::encode):
2002         (WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::decode):
2003         * NetworkProcess/cache/NetworkCacheCoders.h:
2004         * NetworkProcess/cache/NetworkCacheStorage.h:
2005
2006 2016-05-03  Daniel Bates  <dabates@apple.com>
2007
2008         Temporary workaround for Apple Internal builds
2009         <rdar://problem/25992976>
2010
2011         For Apple Internal builds treat error code errSecCSGuestInvalid as if it were error code errSecCSUnsigned.
2012         We will look to remove this workaround in the fix for <rdar://problem/26075714>.
2013
2014         * Shared/mac/CodeSigning.mm:
2015         (WebKit::secCodeSigningIdentifier):
2016
2017 2016-05-03  Chris Dumez  <cdumez@apple.com>
2018
2019         Unreviewed, rolling out r199259 and r200161.
2020
2021         Seems to have caused a ~1.2% PLT regression on iOS
2022
2023         Reverted changesets:
2024
2025         "[iOS WK2] WKWebViews should consult ancestor UIScrollViews to
2026         determine tiling area"
2027         https://bugs.webkit.org/show_bug.cgi?id=156429
2028         http://trac.webkit.org/changeset/199259
2029
2030         "[iOS WK2] When determining tile size, check whether ancestor
2031         UIScrollViews are actually scrollable"
2032         https://bugs.webkit.org/show_bug.cgi?id=157107
2033         http://trac.webkit.org/changeset/200161
2034
2035 2016-05-03  Dean Jackson  <dino@apple.com>
2036
2037         CSS Grid should be an experimental feature flag
2038         https://bugs.webkit.org/show_bug.cgi?id=157327
2039         <rdar://problem/26075147>
2040
2041         Reviewed by Anders Carlsson.
2042
2043         The CSS Grid Layout runtime flag was exposed by
2044         a WebKit preference. It was in the experimental
2045         section but was missing the "Experimental" prefix.
2046
2047         It was also missing the human readable description.
2048
2049         Lastly, there is no need for the C API for experimental
2050         features.
2051
2052         * Shared/WebPreferencesDefinitions.h:
2053         * UIProcess/API/C/WKPreferences.cpp:
2054         (WKPreferencesSetCSSGridLayoutEnabled): Deleted.
2055         (WKPreferencesGetCSSGridLayoutEnabled): Deleted.
2056         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2057         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2058         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2059         * WebProcess/WebPage/WebPage.cpp:
2060         (WebKit::WebPage::updatePreferences):
2061
2062 2016-05-03  Alex Christensen  <achristensen@webkit.org>
2063
2064         Remove firing assertion when redirecting
2065         https://bugs.webkit.org/show_bug.cgi?id=155800
2066         rdar://25299194
2067
2068         Reviewed by Sam Weinig.
2069
2070         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2071         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
2072         (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]):
2073         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2074         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
2075         With NSURLConnection, we stopped getting delegate callbacks once the delegate is destroyed, and everything was cancelled.
2076         With NSURLSession we continue getting delegate callbacks because the session's delegate is not destroyed after each load.
2077         As documented in NSURLSession.h: "In some cases, the task may signal other work before it acknowledges the cancelation."
2078         In the cases where we cancel a load, delete the NetworkLoad and corresponding NetworkDataTask, we want to call all
2079         completion handlers indicating that we really want to cancel instead of asserting.
2080
2081 2016-05-02  Darin Adler  <darin@apple.com>
2082
2083         Change IDL enumerations to be nested in their C++ class instead of at WebCore namespace level
2084         https://bugs.webkit.org/show_bug.cgi?id=157257
2085
2086         Reviewed by Chris Dumez.
2087
2088         * WebProcess/Network/WebLoaderStrategy.cpp:
2089         (WebKit::WebLoaderStrategy::loadResource): Updated since we changed
2090         ReferrerHeaderPolicy back to ReferrerPolicy.
2091         (WebKit::WebLoaderStrategy::schedulePluginStreamLoad): Ditto.
2092
2093 2016-05-02  Brady Eidson  <beidson@apple.com>
2094
2095         Const-ify some IDB code.
2096         https://bugs.webkit.org/show_bug.cgi?id=157287
2097
2098         Reviewed by Alex Christensen.
2099
2100         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2101         (WebKit::WebIDBConnectionToServer::deleteDatabase):
2102         (WebKit::WebIDBConnectionToServer::openDatabase):
2103         (WebKit::WebIDBConnectionToServer::abortTransaction):
2104         (WebKit::WebIDBConnectionToServer::commitTransaction):
2105         (WebKit::WebIDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
2106         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2107
2108 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
2109
2110         Sort the project file.
2111
2112         * WebKit2.xcodeproj/project.pbxproj:
2113
2114 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
2115
2116         Fix shouldUpdateScrollLayerPositionSynchronously() for non-main frames. Remove updatesScrollLayerPositionOnMainThread()
2117         https://bugs.webkit.org/show_bug.cgi?id=157277
2118
2119         Reviewed by Dean Jackson, Tim Horton.
2120
2121         Remove updatesScrollLayerPositionOnMainThread() which is unused by all ports.
2122
2123         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
2124
2125 2016-05-02  Alex Christensen  <achristensen@webkit.org>
2126
2127         Crash if a certificate chain has null certificates
2128         https://bugs.webkit.org/show_bug.cgi?id=157206
2129
2130         Reviewed by Alexey Proskuryakov.
2131
2132         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2133         (WebKit::certificatesMatch):
2134         SecTrustGetCertificateAtIndex can return null.
2135         If this ever happens, something has gone horribly wrong in the security code and we should crash.
2136         See rdar://problem/21723172
2137
2138 2016-05-02  Myles C. Maxfield  <mmaxfield@apple.com>
2139
2140         Addressing post-review comments after r200116
2141         https://bugs.webkit.org/show_bug.cgi?id=157228
2142
2143         Reviewed by Anders Carlsson.
2144
2145         * Shared/WebPreferencesDefinitions.h:
2146         * UIProcess/API/Cocoa/WKWebView.mm:
2147         (-[WKWebView _initializeWithConfiguration:]):
2148         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2149         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2150         (-[WKWebViewConfiguration encodeWithCoder:]):
2151         (-[WKWebViewConfiguration initWithCoder:]):
2152         (-[WKWebViewConfiguration copyWithZone:]):
2153         * UIProcess/WebPageProxy.cpp:
2154         * WebProcess/WebPage/WebPage.cpp:
2155         (WebKit::WebPage::updatePreferences):
2156
2157 2016-05-02  Daniel Bates  <dabates@apple.com>
2158
2159         DatabaseTracker::closeAllDatabases calls Database::close from the wrong thread
2160         https://bugs.webkit.org/show_bug.cgi?id=147672
2161         <rdar://problem/22357464>
2162
2163         Reviewed by Brady Eidson.
2164
2165         Call DatabaseTracker::closeAllDatabases() with CurrentQueryBehavior::Interrupt so that we abort
2166         a long running query and close the database immediately to avoid holding a locked file when the
2167         process is suspended.
2168
2169         * WebProcess/WebProcess.cpp:
2170         (WebKit::WebProcess::processWillSuspendImminently):
2171
2172 2016-05-01  Darin Adler  <darin@apple.com>
2173
2174         Update Fetch to use enum class instead of string for enumerations
2175         https://bugs.webkit.org/show_bug.cgi?id=157241
2176
2177         Reviewed by Chris Dumez.
2178
2179         * WebProcess/Network/WebLoaderStrategy.cpp:
2180         (WebKit::WebLoaderStrategy::loadResource): Updated for the change where I
2181         renamed ReferrerPolicy to ReferrerHeaderPolicy, at least for now.
2182         (WebKit::WebLoaderStrategy::schedulePluginStreamLoad): Ditto.
2183
2184 2016-05-01  Konstantin Tokarev  <annulen@yandex.ru>
2185
2186         Fixed build with !ENABLED(DATABASE_PROCESS).
2187
2188         Unreviewed build fix.
2189
2190         * UIProcess/Network/NetworkProcessProxy.cpp:
2191         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs):
2192
2193 2016-04-29  Chris Dumez  <cdumez@apple.com>
2194
2195         Drop useless check in SpeculativeLoadManager::registerLoad()
2196         https://bugs.webkit.org/show_bug.cgi?id=157204
2197
2198         Reviewed by Antti Koivisto.
2199
2200         Drop useless check in SpeculativeLoadManager::registerLoad(). There is
2201         no way to end up this code path with a non-HTTP family request.
2202
2203         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2204         (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
2205
2206 2016-04-29  Brian Burg  <bburg@apple.com>
2207
2208         Web Automation: add SPI to mark an existing NSEvent as synthesized for automation
2209         https://bugs.webkit.org/show_bug.cgi?id=157221
2210         <rdar://problem/26019356>
2211
2212         Reviewed by Timothy Hatcher.
2213
2214         In cases where an NSEvent is duplicated, clients need to re-mark an NSEvent
2215         as synthesized for automation if the original NSEvent was marked as such.
2216
2217         * UIProcess/API/Cocoa/_WKAutomationSession.h:
2218         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
2219         (-[_WKAutomationSession markEventAsSynthesizedForAutomation:]):
2220         * UIProcess/Automation/WebAutomationSession.h:
2221         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
2222         (WebKit::WebAutomationSession::sendSynthesizedEventsToPage):
2223         (WebKit::WebAutomationSession::markEventAsSynthesizedForAutomation):
2224
2225 2016-04-29  Brian Burg  <bburg@apple.com>
2226
2227         Web Automation: use a magic eventNumber as a fallback for detecting NSEvents synthesized for automation
2228         https://bugs.webkit.org/show_bug.cgi?id=157222
2229
2230         Reviewed by Timothy Hatcher.
2231
2232         Sometimes events are copied and redelivered in a way that can't be reliably intercepted,
2233         so use eventNumber as an alternate means of detecting synthesized mouse NSEvents.
2234
2235         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
2236         (WebKit::WebAutomationSession::wasEventSynthesizedForAutomation):
2237         If it's a mouse-related event, check the eventNumber if the associated object was missing.
2238
2239         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
2240         Most real events from input devices fill in eventNumber with a non-zero value.
2241         In my testing, using zero did not seem to adversely affect event delivery.
2242
2243 2016-04-29  Joseph Pecoraro  <pecoraro@apple.com>
2244
2245         Web Inspector: Issues inspecting the inspector, pausing on breakpoints causes content to not load
2246         https://bugs.webkit.org/show_bug.cgi?id=157198
2247         <rdar://problem/26011049>
2248
2249         Reviewed by Timothy Hatcher.
2250
2251         * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.h:
2252         * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp:
2253         (WebKit::WebInspectorFrontendAPIDispatcher::reset):
2254         (WebKit::WebInspectorFrontendAPIDispatcher::frontendLoaded):
2255         (WebKit::WebInspectorFrontendAPIDispatcher::suspend):
2256         (WebKit::WebInspectorFrontendAPIDispatcher::unsuspend):
2257         (WebKit::WebInspectorFrontendAPIDispatcher::dispatchCommand):
2258         (WebKit::WebInspectorFrontendAPIDispatcher::dispatchMessageAsync):
2259         (WebKit::WebInspectorFrontendAPIDispatcher::evaluateOrQueueExpression):
2260         (WebKit::WebInspectorFrontendAPIDispatcher::evaluateQueuedExpressions):
2261         Avoid evaluating expressions when the page is paused. Generalize the
2262         message queueing and dispatching for pause/suspend that we already
2263         had for waiting for the frontend page to be loaded.
2264
2265         * WebProcess/WebPage/WebInspectorUI.h:
2266         * WebProcess/WebPage/WebInspectorUI.cpp:
2267         (WebKit::WebInspectorUI::pagePaused):
2268         (WebKit::WebInspectorUI::pageUnpaused):
2269         When the frontend page pauses/unpauses, suspend/resume the dispatcher.
2270
2271 2016-04-29  Chris Dumez  <cdumez@apple.com>
2272
2273         Remove unnecessary isolated String copying from one of NetworkCache::Key's constructor
2274         https://bugs.webkit.org/show_bug.cgi?id=157207
2275
2276         Reviewed by Antti Koivisto.
2277
2278         Remove unnecessary isolated String copying from one of NetworkCache::Key's
2279         constructor. We are anyway going to create isolated copies if the Key ends
2280         up getting copied.
2281
2282         * NetworkProcess/cache/NetworkCacheKey.cpp:
2283         (WebKit::NetworkCache::Key::Key):
2284
2285 2016-04-29  Brian Burg  <bburg@apple.com>
2286
2287         Web Automation: performMouseInteraction command computes mouse event coordinates incorrectly
2288         https://bugs.webkit.org/show_bug.cgi?id=157218
2289         <rdar://problem/26018230>
2290
2291         Reviewed by Timothy Hatcher.
2292
2293         This patch fixes two issues: the min/max clamp was in the wrong order,
2294         and the y-value did not account for the window's top content inset.
2295
2296         * UIProcess/Automation/WebAutomationSession.cpp:
2297         (WebKit::WebAutomationSession::performMouseInteraction):
2298
2299 2016-04-29  Dean Jackson  <dino@apple.com>
2300
2301         RTL <select> popup menu is in the wrong location
2302         https://bugs.webkit.org/show_bug.cgi?id=157159
2303         <rdar://problem/25894451>
2304
2305         Reapply http://trac.webkit.org/changeset/200217
2306         but with changes that will allow it to build on Yosemite.
2307
2308         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2309         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
2310
2311 2016-04-28  Ada Chan  <adachan@apple.com>
2312
2313         Indicate we are processing user gesture when handling messages from WebPlaybackSessionManagerProxy to WebPlaybackSessionManager
2314         https://bugs.webkit.org/show_bug.cgi?id=157151
2315
2316         Reviewed by Jer Noble.
2317
2318         Messages from WebPlaybackSessionManagerProxy to WebPlaybackSessionManager are triggered by
2319         user actions, so add a UserGestureIndicator in the methods that handle those messages.
2320
2321         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
2322         (WebKit::WebPlaybackSessionManager::play):
2323         (WebKit::WebPlaybackSessionManager::pause):
2324         (WebKit::WebPlaybackSessionManager::togglePlayState):
2325         (WebKit::WebPlaybackSessionManager::beginScrubbing):
2326         (WebKit::WebPlaybackSessionManager::endScrubbing):
2327         (WebKit::WebPlaybackSessionManager::seekToTime):
2328         (WebKit::WebPlaybackSessionManager::fastSeek):
2329         (WebKit::WebPlaybackSessionManager::beginScanningForward):
2330         (WebKit::WebPlaybackSessionManager::beginScanningBackward):
2331         (WebKit::WebPlaybackSessionManager::endScanning):
2332         (WebKit::WebPlaybackSessionManager::selectAudioMediaOption):
2333         (WebKit::WebPlaybackSessionManager::selectLegibleMediaOption):
2334
2335 2016-04-29  Brady Eidson  <beidson@apple.com>
2336
2337         Add a default ".isolatedCopy()" specialization to CrossThreadCopier, and other small cleanup.
2338         https://bugs.webkit.org/show_bug.cgi?id=157185
2339
2340         Reviewed by Anders Carlsson.
2341
2342         * Shared/WebCrossThreadCopier.cpp:
2343         (WebCore::Vector<char>>::copy): reserveInitialCapacity() before creating the copy.
2344         (WebCore::Vector<int64_t>>::copy): Ditto.
2345         (WebCore::Vector<uint8_t>>::copy): Ditto.
2346         (WebCore::Vector<Vector<IDBKeyData>>>::copy): Deleted dead code.
2347         * Shared/WebCrossThreadCopier.h:
2348
2349 2016-04-29  Commit Queue  <commit-queue@webkit.org>
2350
2351         Unreviewed, rolling out r200217.
2352         https://bugs.webkit.org/show_bug.cgi?id=157183
2353
2354         This change broke the Yosemite build. (Requested by ryanhaddad
2355         on #webkit).
2356
2357         Reverted changeset:
2358
2359         "RTL <select> popup menu is in the wrong location"
2360         https://bugs.webkit.org/show_bug.cgi?id=157159
2361         http://trac.webkit.org/changeset/200217
2362
2363 2016-04-29  Claudio Saavedra  <csaavedra@igalia.com>
2364
2365         [GTK] Move WK2 shareable code out from gtk directories
2366         https://bugs.webkit.org/show_bug.cgi?id=157135
2367
2368         Reviewed by Darin Adler.
2369
2370         Both NetworkProcessMain and InjectedBundle can go out from their respective gtk directories.
2371
2372         * NetworkProcess/gtk/NetworkProcessMainGtk.cpp:
2373         (WebKit::NetworkProcessMainUnix): Deleted.
2374         * NetworkProcess/soup/NetworkProcessMainSoup.cpp: Renamed from Source/WebKit2/NetworkProcess/gtk/NetworkProcessMainGtk.cpp.
2375         (WebKit::NetworkProcessMainUnix):
2376         * PlatformGTK.cmake: Update.
2377         * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp.
2378         (WebKit::InjectedBundle::initialize):
2379         (WebKit::InjectedBundle::setBundleParameter):
2380         (WebKit::InjectedBundle::setBundleParameters):
2381         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
2382         (WebKit::InjectedBundle::initialize): Deleted.
2383         (WebKit::InjectedBundle::setBundleParameter): Deleted.
2384         (WebKit::InjectedBundle::setBundleParameters): Deleted.
2385
2386 2016-04-28  Dean Jackson  <dino@apple.com>
2387
2388         RTL <select> popup menu is in the wrong location
2389         https://bugs.webkit.org/show_bug.cgi?id=157159
2390         <rdar://problem/25894451>
2391
2392         Reviewed by Simon Fraser.
2393
2394         Make sure the NSPopupMenu takes the text direction
2395         into account, and offset the position
2396         of the menu slightly if we're in RTL mode.
2397
2398         Unfortunately our test infrastructure is unable to exercise
2399         this because it runs without a window, and the popup menu
2400         is not captured in the screenshot.
2401
2402         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2403         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
2404
2405 2016-04-28  Manuel Rego Casasnovas  <rego@igalia.com>
2406
2407         [css-grid] Add CSS Grid Layout runtime flag
2408         https://bugs.webkit.org/show_bug.cgi?id=157134
2409
2410         Reviewed by Simon Fraser.
2411
2412         Add CSS Grid Layout runtime flag based on preferences,
2413         enabled by default.
2414
2415         * Shared/WebPreferencesDefinitions.h:
2416         * UIProcess/API/C/WKPreferences.cpp:
2417         (WKPreferencesSetCSSGridLayoutEnabled):
2418         (WKPreferencesGetCSSGridLayoutEnabled):
2419         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2420         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2421         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2422         * WebProcess/WebPage/WebPage.cpp:
2423         (WebKit::WebPage::updatePreferences):
2424
2425 2016-04-28  Daniel Bates  <dabates@apple.com>
2426
2427         Fix the Apple Internal OS X build
2428
2429         * UIProcess/mac/WKPrintingView.mm:
2430         (-[WKPrintingView _drawPDFDocument:page:atPoint:]): Ignore deprecation warning for -[PDFPage drawWithBox:].
2431         * WebProcess/WebPage/mac/WebPageMac.mm:
2432         (WebKit::drawPDFPage): Ditto.
2433
2434 2016-04-28  Manuel Rego Casasnovas  <rego@igalia.com>
2435
2436         Fix mistake in custom elements runtime flag
2437         https://bugs.webkit.org/show_bug.cgi?id=157130
2438
2439         Reviewed by Chris Dumez.
2440
2441         The methods for the custom elements runtime flag were using
2442         the Shadow DOM flag instead.
2443         These methods were introduced in r197921,
2444         it seems it was just a copy&paste mistake.
2445
2446         * UIProcess/API/C/WKPreferences.cpp:
2447         (WKPreferencesSetCustomElementsEnabled):
2448         (WKPreferencesGetCustomElementsEnabled):
2449
2450 2016-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2451
2452         Unreviewed. Add missing files to the compilation of GTK+ inspector.
2453
2454         * PlatformGTK.cmake:
2455
2456 2016-04-27  Dan Bernstein  <mitz@apple.com>
2457
2458         <rdar://problem/25915253> REGRESSION (r199628): Netflix playback fails in Safari Technology Preview with error code S7363-1260-FFFF58D8
2459
2460         Rubber-stamped by Tim Horton.
2461
2462         Reverted r199628.
2463
2464         * Configurations/WebContentService.xcconfig:
2465
2466 2016-04-27  Brady Eidson  <beidson@apple.com>
2467
2468         Modern IDB: Implement native IDBFactory.getAllDatabaseNames for WebInspector.
2469         https://bugs.webkit.org/show_bug.cgi?id=157072
2470
2471         Reviewed by Alex Christensen.
2472
2473         Handle the process hop for the new getAllDatabaseNames call.
2474         
2475         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2476         (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames):
2477         (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
2478         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
2479         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
2480
2481         * Shared/WebCrossThreadCopier.cpp:
2482         (WebCore::SecurityOriginData>::copy): Deleted, as its in WebCore now.
2483         * Shared/WebCrossThreadCopier.h:
2484
2485         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2486         (WebKit::WebIDBConnectionToServer::getAllDatabaseNames):
2487         (WebKit::WebIDBConnectionToServer::didGetAllDatabaseNames):
2488         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2489         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
2490
2491 2016-04-27  Simon Fraser  <simon.fraser@apple.com>
2492
2493         [iOS WK2] When determining tile size, check whether ancestor UIScrollViews are actually scrollable
2494         https://bugs.webkit.org/show_bug.cgi?id=157107
2495         rdar://problem/25943577
2496
2497         Reviewed by Tim Horton.
2498         
2499         We should only fall back to 512x512 tiles if the WKWebView has a UIScrollView ancestor,
2500         and that UIScrollView actually scrolls. This avoids falling back to small tiles in
2501         MobileSafari.
2502
2503         Rename "enclosedInScrollView" to "enclosedInScrollableAncestorView" everywhere.
2504
2505         * Shared/VisibleContentRectUpdateInfo.cpp:
2506         (WebKit::VisibleContentRectUpdateInfo::encode):
2507         (WebKit::VisibleContentRectUpdateInfo::decode):
2508         * Shared/VisibleContentRectUpdateInfo.h:
2509         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
2510         (WebKit::VisibleContentRectUpdateInfo::enclosedInScrollableAncestorView):
2511         (WebKit::operator==):
2512         (WebKit::VisibleContentRectUpdateInfo::enclosedInScrollView): Deleted.
2513         * UIProcess/API/Cocoa/WKWebView.mm:
2514         (scrollViewCanScroll):
2515         (-[WKWebView _updateContentRectsWithState:]):
2516         * UIProcess/ios/WKContentView.h:
2517         * UIProcess/ios/WKContentView.mm:
2518         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2519         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollView:]): Deleted.
2520         * WebProcess/WebPage/ios/WebPageIOS.mm:
2521         (WebKit::WebPage::updateVisibleContentRects):
2522
2523 2016-04-26  Ada Chan  <adachan@apple.com>
2524
2525         Set WebVideoFullscreenInterfaceMac up as a client of WebPlaybackSessionInterfaceMac to listen for playback state changes
2526         https://bugs.webkit.org/show_bug.cgi?id=157008
2527
2528         Reviewed by Jer Noble.
2529
2530         Since WebVideoFullscreenInterfaceMac holds onto WebPlaybackSessionInterfaceMac, we can't let
2531         WebPlaybackSessionManagerProxy unregister the context for that media element while
2532         WebVideoFullscreenInterfaceMac is still using it. WebVideoFullscreenInterfaceMac should add
2533         to the client count for that WebPlaybackSession context.
2534
2535         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
2536         (WebKit::WebVideoFullscreenManagerProxy::createModelAndInterface):
2537         When the context for the media element is created with the WebVideoFullscreenManagerProxy, it should
2538         add one to the client count for the media element context in WebPlaybackSessionManagerProxy.
2539         (WebKit::WebVideoFullscreenManagerProxy::removeClientForContext):
2540         When WebVideoFullscreenManagerProxy unregisters the context for this media element, it should
2541         subtract one from the client count for the media element context in WebPlaybackSessionManagerProxy.
2542
2543         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
2544         (WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):
2545         Bail early if m_controlsManagerContextId is zero. Otherwise, we'd end up sending a
2546         ClearPlaybackControlsManager message to the UI process inadvertently.
2547         (WebKit::WebPlaybackSessionManager::contextIdForMediaElement):
2548         Make sure the model element for the context ID is set to the media element.
2549
2550         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
2551         (WebKit::WebVideoFullscreenManager::createModelAndInterface):
2552         When the context for the media element is created with the WebVideoFullscreenManager, it should
2553         add one to the client count for the media element context in WebPlaybackSessionManager.
2554         (WebKit::WebVideoFullscreenManager::removeContext):
2555         When WebVideoFullscreenManager unregisters the context for this media element, it should
2556         subtract one from the client count for the media element context in WebPlaybackSessionManager.
2557
2558 2016-04-27  Alex Christensen  <achristensen@webkit.org>
2559
2560         Remove download message receiver when NetworkProcess crashes
2561         https://bugs.webkit.org/show_bug.cgi?id=157102
2562         <rdar://problem/25550106>
2563
2564         Reviewed by Anders Carlsson.
2565
2566         * UIProcess/Downloads/DownloadProxyMap.cpp:
2567         (WebKit::DownloadProxyMap::processDidClose):
2568         When the NetworkProcess crashes during a download, we want to remove the message receiver from the map
2569         so we don't get an assertion in ~MessageReceiver in the UIProcess so we do not have a freed
2570         message receiver in the map.
2571
2572 2016-04-27  Alex Christensen  <achristensen@webkit.org>
2573
2574         Fix client certificate authentication with NSURLSession on iOS
2575         https://bugs.webkit.org/show_bug.cgi?id=157094
2576         <rdar://problem/25946859>
2577
2578         Reviewed by Darin Adler.
2579
2580         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2581         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2582         We only want to create a non-persistent credential with the given user and password 
2583         and store the user and password in the CredentialStorage if there is a user and password.
2584         We previously only skipped this if we were doing server trust evaluation, in which case 
2585         we will have a credential from serverTrustCredential which has no user or password.
2586         When doing client certificate authentication on iOS, this completion handler is called with
2587         a credential with session persistence and also no user or password, so we need to do the same thing.
2588         The reason this was never hit on Mac was because the credential came from tryUseCertificateInfoForChallenge,
2589         which always had persistence none.
2590
2591 2016-04-27  Claudio Saavedra  <csaavedra@igalia.com>
2592
2593         [GTK][EFL] Move WK2 platform code to a common place
2594         https://bugs.webkit.org/show_bug.cgi?id=157069
2595
2596         Reviewed by Carlos Garcia Campos.
2597
2598         Logging implementation can be shared between EFL and GTK, so move it to unix.
2599         The GTK Module implementation doesn't depend on GTK anyhow so move it to glib.
2600
2601         * Platform/efl/LoggingEfl.cpp: Removed.
2602         (WebKit::logLevelString): Deleted.
2603         * Platform/glib/ModuleGlib.cpp: Renamed from Source/WebKit2/Platform/gtk/ModuleGtk.cpp.
2604         (WebKit::Module::load):
2605         (WebKit::Module::unload):
2606         (WebKit::Module::platformFunctionPointer):
2607         * Platform/gtk/LoggingGtk.cpp:
2608         (WebKit::logLevelString): Deleted.
2609         * Platform/gtk/ModuleGtk.cpp:
2610         (WebKit::Module::load): Deleted.
2611         (WebKit::Module::unload): Deleted.
2612         (WebKit::Module::platformFunctionPointer): Deleted.
2613         * Platform/unix/LoggingUnix.cpp: Renamed from Source/WebKit2/Platform/gtk/LoggingGtk.cpp.
2614         (WebKit::logLevelString):
2615         * PlatformEfl.cmake: Update.
2616         * PlatformGTK.cmake: Update
2617
2618 2016-04-27  Alex Christensen  <achristensen@webkit.org>
2619
2620         Fix assertion when downloading with NSURLSession after r198955
2621         https://bugs.webkit.org/show_bug.cgi?id=157051
2622
2623         Reviewed by Brady Eidson.
2624
2625         * NetworkProcess/NetworkProcess.cpp:
2626         (WebKit::NetworkProcess::continueDecidePendingDownloadDestination):
2627
2628 2016-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2629
2630         REGRESSION(r200094): [FreeType] Vertical text is broken after r200094
2631         https://bugs.webkit.org/show_bug.cgi?id=157066
2632
2633         Reviewed by Martin Robinson.
2634
2635         Add Source/WebCore/platform/graphics/freetype to the list of include dirs, because now FontPlatformData.h
2636         includes FcUniquePtr.h.
2637
2638         * PlatformEfl.cmake:
2639         * PlatformGTK.cmake:
2640
2641 2016-04-26  Joseph Pecoraro  <pecoraro@apple.com>
2642
2643         Uncaught Exception: SecurityError: DOM Exception 18: An attempt was made to break through the security policy of the user agent.
2644         https://bugs.webkit.org/show_bug.cgi?id=156991
2645         <rdar://problem/25913475>
2646
2647         Reviewed by Timothy Hatcher.
2648
2649         * UIProcess/mac/WebInspectorProxyMac.mm:
2650         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2651         Explicitly always allow access to storage for Web Inspector content just
2652         in case, as we already allow universal file access.
2653
2654 2016-04-26  Myles C. Maxfield  <mmaxfield@apple.com>
2655
2656         [WK2] [OS X] Create API for switching RTL scrollbar policy
2657         https://bugs.webkit.org/show_bug.cgi?id=156948
2658         <rdar://problem/25707757>
2659
2660         Reviewed by Darin Adler.
2661
2662         Add the new API.
2663
2664         * Shared/WebPreferencesDefinitions.h:
2665         * UIProcess/API/Cocoa/WKWebView.mm:
2666         (-[WKWebView _initializeWithConfiguration:]):
2667         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2668         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2669         (-[WKWebViewConfiguration init]):
2670         (-[WKWebViewConfiguration encodeWithCoder:]):
2671         (-[WKWebViewConfiguration initWithCoder:]):
2672         (-[WKWebViewConfiguration copyWithZone:]):
2673         * UIProcess/WebPageProxy.cpp:
2674         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
2675         * WebProcess/WebPage/WebPage.cpp:
2676         (WebKit::WebPage::updatePreferences):
2677
2678 2016-04-26  Beth Dakin  <bdakin@apple.com>
2679
2680         Check to make sure shouldRequestCandidates() before requesting candidates
2681         https://bugs.webkit.org/show_bug.cgi?id=157038
2682         -and corresponding-
2683         rdar://problem/25910418
2684
2685         Reviewed by Tim Horton.
2686
2687         This patch limits requesting and showing candidates to cases where 
2688         shouldRequestCandidates() is true. This patch also caches the sequence number 
2689         returned by [NSSpellChecker requestCandidatesForSelectedRange:] to make sure 
2690         it is equal to the sequence number sent to the callback handler so that we do 
2691         not show candidates for old requests.
2692
2693         * UIProcess/Cocoa/WebViewImpl.h:
2694         * UIProcess/Cocoa/WebViewImpl.mm:
2695         (WebKit::WebViewImpl::updateWebViewImplAdditions):
2696         (WebKit::WebViewImpl::shouldRequestCandidates):
2697         (WebKit::WebViewImpl::showCandidates):
2698         (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
2699         (WebKit::WebViewImpl::handleRequestedCandidates):
2700
2701 2016-04-26  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2702
2703         [EFL] Update expectation result in ewk_context_preferred_languages API test
2704         https://bugs.webkit.org/show_bug.cgi?id=157027
2705
2706         Reviewed by Carlos Garcia Campos.
2707
2708         platformLanguage() has been returning lower case value since r199815. Thus existing expected result
2709         needs to be updated together.
2710
2711         * UIProcess/API/efl/tests/test_ewk2_context.cpp: Change en-US with en-us.
2712         (TEST_F):
2713
2714 2016-04-26  Zan Dobersek  <zdobersek@igalia.com>
2715
2716         Mark two methods in the CoordinatedGraphicsScene and the
2717         ThreadedCoordinatedLayerTreeHost classes as overrides, fixing
2718         the compiler warnings.
2719
2720         Rubber-stamped by Carlos Garcia Campos.
2721
2722         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
2723         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
2724
2725 2016-04-25  Ryosuke Niwa  <rniwa@webkit.org>
2726
2727         Remove the build flag for template elements
2728         https://bugs.webkit.org/show_bug.cgi?id=157022
2729
2730         Reviewed by Daniel Bates.
2731
2732         * Configurations/FeatureDefines.xcconfig:
2733
2734 2016-04-25  Chris Dumez  <cdumez@apple.com>
2735
2736         Crash under -[WKWebView _mayAutomaticallyShowVideoPictureInPicture] + 32 (WKWebView.mm:309)
2737         https://bugs.webkit.org/show_bug.cgi?id=156990
2738         <rdar://problem/25904376>
2739
2740         Reviewed by Jer Noble.
2741
2742         In case of WebProcess crash, WebPageProxy::processDidCrash() will call resetState() which
2743         will nullify WebPageProxy::m_videoFullscreenManager. In WebPageProxy::reattachToWebProcess(),
2744         we then call updateViewState() before re-initializing m_videoFullscreenManager, and
2745         updateViewState() ends up calling [WKWebView _mayAutomaticallyShowVideoPictureInPicture]
2746         which dereferences WebPageProxy::m_videoFullscreenManager without null check. This patch
2747         adds a null check for m_videoFullscreenManager in _mayAutomaticallyShowVideoPictureInPicture.
2748
2749         * UIProcess/API/Cocoa/WKWebView.mm:
2750         (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]):
2751
2752 2016-04-25  Dan Bernstein  <mitz@apple.com>
2753
2754         Fix a couple of mistakes from r199700.
2755
2756         Rubber-stamped by Anders Carlsson.
2757
2758         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Added availability attributes to new properties.
2759         * WebKit2.xcodeproj/project.pbxproj: Demoted _WKExperimentalFeatureInternal.h from Private to Project.
2760
2761 2016-04-24  Hunseop Jeong  <hs85.jeong@samsung.com>
2762
2763         [EFL] Update the ewk_settings_offline_web_application_cache_enabled_get() expected value after r199854.
2764         https://bugs.webkit.org/show_bug.cgi?id=156968
2765
2766         Reviewed by Gyuyoung Kim.
2767
2768         * UIProcess/API/C/WKPreferencesRef.h: Update the comment.
2769         * UIProcess/API/efl/tests/test_ewk2_settings.cpp: 
2770         (TEST_F):
2771
2772 2016-04-23  Andy Estes  <aestes@apple.com>
2773
2774         Fix issues found by the clang static analyzer
2775         https://bugs.webkit.org/show_bug.cgi?id=156956
2776
2777         Reviewed by Alexey Proskuryakov.
2778
2779         * UIProcess/API/Cocoa/WKPreviewActionItem.mm:
2780         (-[WKPreviewAction dealloc]): Added to release _identifier.
2781         * UIProcess/_WKWebViewPrintFormatter.mm:
2782         (-[_WKWebViewPrintFormatter dealloc]): Released _frameToPrint.
2783         * UIProcess/ios/WKContentViewInteraction.mm:
2784         (-[WKContentView inputView]): -createPeripheralWithView: returned a retained object, but the method name did not
2785         match Cocoa conventions. Called -initWithView: instead.
2786         (-[WKContentView _showAttachmentSheet]): Stored the _WKActivatedElementInfo in a RetainPtr.
2787         (-[WKContentView _dataForPreviewItemController:atPosition:type:]): Ditto.
2788         (+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]):
2789         The properties contextBeforeSelection, selectedText, markedText, and contextAfterSelection have the 'copy'
2790         annotation in UIWKAutocorrectionContext, so the additional copy made here would be leaked. Removed the extra copy.
2791         (-[WKAutocorrectionContext dealloc]): Deleted.
2792         * UIProcess/ios/forms/WKFormInputControl.h: Removed -createPeripheralWithView: and declared -initWithView:.
2793         * UIProcess/ios/forms/WKFormInputControl.mm:
2794         (-[WKFormInputControl initWithView:]): Changed to return instancetype.
2795         (+[WKFormInputControl createPeripheralWithView:]): Deleted.
2796         * UIProcess/ios/forms/WKFormSelectControl.h: Removed -createPeripheralWithView: and declared -initWithView:.
2797         * UIProcess/ios/forms/WKFormSelectControl.mm:
2798         (+[WKFormSelectControl createPeripheralWithView:]): Deleted.
2799         * UIProcess/mac/LegacySessionStateCoding.cpp:
2800         (WebKit::decodeLegacySessionState): If dynamic_cf_cast returned nullptr, the result of
2801         CFPropertyListCreateWithData would leak. Stored the CFPropertyListRef in a RetainPtr before calling dynamic_cf_cast.
2802         * UIProcess/mac/ServicesController.mm:
2803         (WebKit::ServicesController::refreshExistingServices): Used a RetainPtr for attachment and cell.
2804         * UIProcess/mac/WebContextMenuProxyMac.mm:
2805         (WebKit::WebContextMenuProxyMac::setupServicesMenu): Used a RetainPtr for groupEntry.
2806
2807 2016-04-23  Chris Dumez  <cdumez@apple.com>
2808
2809         Tie the DiagnosticLoggingClient's lifetime to the Page
2810         https://bugs.webkit.org/show_bug.cgi?id=156938
2811         <rdar://problem/25851499>
2812
2813         Reviewed by Antti Koivisto.
2814
2815         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
2816         (WebKit::WebDiagnosticLoggingClient::pageDestroyed):
2817         (WebKit::WebDiagnosticLoggingClient::mainFrameDestroyed): Deleted.
2818         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
2819         * WebProcess/WebPage/ios/WebPageIOS.mm:
2820         (WebKit::WebPage::willStartUserTriggeredZooming):
2821
2822 2016-04-23  Dan Bernstein  <mitz@apple.com>
2823
2824         <rdar://problem/25893246> WebKit2 has failed to build: error: use of undeclared identifier 'm_playbackSessionManager'
2825
2826         Fixed the non-AVKit build.
2827
2828         * UIProcess/API/Cocoa/WKWebView.mm:
2829         (-[WKWebView _isShowingVideoPictureInPicture]):
2830         (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]):
2831         * UIProcess/WebPageProxy.cpp:
2832         (WebKit::WebPageProxy::fullScreenManager):
2833         (WebKit::WebPageProxy::playbackSessionManager):
2834         * UIProcess/WebPageProxy.h:
2835         * UIProcess/ios/WebPageProxyIOS.mm:
2836         (WebKit::WebPageProxy::applicationDidBecomeActive):
2837         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2838         (WebKit::WebChromeClient::createScrollingCoordinator):
2839         (WebKit::WebChromeClient::supportsVideoFullscreen):
2840         * WebProcess/WebCoreSupport/WebChromeClient.h:
2841         * WebProcess/WebPage/WebPage.cpp:
2842         (WebKit::WebPage::inspectorUI):
2843         (WebKit::WebPage::playbackSessionManager):
2844         * WebProcess/WebPage/WebPage.h:
2845         * WebProcess/cocoa/WebVideoFullscreenManager.h:
2846         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
2847
2848 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
2849
2850         Fixing a typo in my last commit.
2851
2852         Unreviewed build fix.
2853
2854         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
2855         * WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
2856
2857 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
2858
2859         Missed some macros to fix builds that do not support AVKit.
2860
2861         Unreviewed build fix.
2862
2863         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
2864         * WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
2865
2866 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
2867
2868         Fix builds that do not support AVKit
2869
2870         Unreviewed build fix.
2871
2872         * UIProcess/WebPageProxy.h:
2873
2874 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
2875
2876         Take 2 for fixing builds that do not support AVKit
2877
2878         Unreviewed build fix.
2879
2880         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
2881         * UIProcess/WebPageProxy.cpp:
2882         (WebKit::WebPageProxy::resetState):
2883
2884 2016-04-22  Anders Carlsson  <andersca@apple.com>
2885
2886         WKWebView WebSQL is not enabled
2887         https://bugs.webkit.org/show_bug.cgi?id=156928
2888         rdar://problem/19029603
2889
2890         Reviewed by Beth Dakin.
2891
2892         Give databases a default quota of 50 MB, matching what we have in UIWebView.
2893
2894         * UIProcess/Cocoa/UIDelegate.mm:
2895         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
2896
2897 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
2898
2899         Fix builds that do not support AVKit
2900
2901         Unreviewed build fix.
2902
2903         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
2904         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
2905         * UIProcess/WebPageProxy.cpp:
2906         (WebKit::WebPageProxy::WebPageProxy):
2907         (WebKit::WebPageProxy::reattachToWebProcess):
2908         (WebKit::WebPageProxy::viewDidLeaveWindow):
2909         * UIProcess/ios/WebPageProxyIOS.mm:
2910
2911 2016-04-22  Brady Eidson  <beidson@apple.com>
2912
2913         Modern IDB: Rework the ownership/RefCounting model of IDBConnectionToServer and IDBConnectionProxy.
2914         https://bugs.webkit.org/show_bug.cgi?id=156916
2915
2916         Reviewed by Tim Horton.
2917
2918         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2919         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
2920
2921 2016-04-22  Zan Dobersek  <zdobersek@igalia.com>
2922
2923         NetworkCacheIOChannelSoup: detach the newly-created IOChannel::readSync thread
2924         https://bugs.webkit.org/show_bug.cgi?id=156907
2925
2926         Reviewed by Carlos Garcia Campos.
2927
2928         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2929         (WebKit::NetworkCache::IOChannel::readSyncInThread): Detach the new thread,
2930         ensuring the resources are released after the thread exits. Next step is
2931         to set up a thread pool and use that, avoiding thread re-creation.
2932
2933 2016-04-21  Dean Jackson  <dino@apple.com>
2934
2935         Backdrop Filter should not be visible if element has visibility:hidden
2936         https://bugs.webkit.org/show_bug.cgi?id=149318
2937         <rdar://problem/22749780>
2938
2939         Reviewed by Simon Fraser.
2940
2941         Add the isHidden method to PlatformCALayerRemote.
2942
2943         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2944         (WebKit::PlatformCALayerRemote::isHidden):
2945         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2946
2947 2016-04-21  Anders Carlsson  <andersca@apple.com>
2948
2949         WKWebView HTML5 AppCache not working
2950         https://bugs.webkit.org/show_bug.cgi?id=156887
2951         rdar://problem/17944162
2952
2953         Reviewed by Tim Horton.
2954
2955         * Shared/WebPreferencesDefinitions.h:
2956         Set the offlineWebApplicationCacheEnabled property to true by default.
2957
2958         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2959         (API::WebsiteDataStore::defaultDataStoreConfiguration):
2960         Set the default applicationCacheFlatFileSubdirectoryName to "Files".
2961
2962 2016-04-21  Anders Carlsson  <andersca@apple.com>
2963
2964         Get rid of the last uses of ApplicationCacheStorage::singleton() from WebKit2
2965         https://bugs.webkit.org/show_bug.cgi?id=156876
2966
2967         Reviewed by Tim Horton.
2968
2969         * Shared/WebProcessCreationParameters.cpp:
2970         (WebKit::WebProcessCreationParameters::encode):
2971         (WebKit::WebProcessCreationParameters::decode):
2972         * Shared/WebProcessCreationParameters.h:
2973         Add and encode and decode a applicationCacheFlatFileSubdirectoryName.
2974
2975         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2976         (API::ProcessPoolConfiguration::createWithLegacyOptions):
2977         Set m_applicationCacheFlatFileSubdirectoryName to "ApplicationCache".
2978
2979         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
2980         Set m_applicationCacheFlatFileSubdirectoryName to "Files".
2981
2982         (API::ProcessPoolConfiguration::copy):
2983         Copy m_applicationCacheFlatFileSubdirectoryName.
2984
2985         * UIProcess/API/APIProcessPoolConfiguration.h:
2986         Add getter for applicationCacheFlatFileSubdirectoryName.
2987
2988         * UIProcess/WebProcessPool.cpp:
2989         (WebKit::legacyWebsiteDataStoreConfiguration):
2990         Initialize applicationCacheFlatFileSubdirectoryName from the process pool configuration.
2991
2992         (WebKit::WebProcessPool::createNewWebProcess):
2993         Initialize parameters.applicationCacheFlatFileSubdirectoryName. Remove a call to 
2994         ApplicationCacheStorage::singleton().setDefaultOriginQuota since it had no effect (it was called in the UI process).
2995
2996         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2997         (WebKit::WebsiteDataStore::WebsiteDataStore):
2998         Initialize m_applicationCacheFlatFileSubdirectoryName.
2999
3000         (WebKit::WebsiteDataStore::fetchData):
3001         (WebKit::WebsiteDataStore::removeData):
3002         Pass m_applicationCacheFlatFileSubdirectoryName when creating the application cache storage.
3003
3004         * UIProcess/WebsiteData/WebsiteDataStore.h:
3005         Add new members.
3006
3007         * WebProcess/WebPage/WebPage.cpp:
3008         (WebKit::WebPage::WebPage):
3009         Set the application cache storage.
3010
3011         * WebProcess/WebProcess.cpp:
3012         (WebKit::WebProcess::initializeWebProcess):
3013         Initialize the application cache storage.
3014
3015         * WebProcess/WebProcess.h:
3016         (WebKit::WebProcess::applicationCacheStorage):
3017         Add new getter.
3018
3019 2016-04-21  Anders Carlsson  <andersca@apple.com>
3020
3021         Remove two uses of ApplicationCacheStorage::singleton() from WebKit2
3022         https://bugs.webkit.org/show_bug.cgi?id=156873
3023
3024         Reviewed by Beth Dakin.
3025
3026         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3027         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
3028         * WebProcess/WebProcess.cpp:
3029         (WebKit::WebProcess::clearApplicationCache): Deleted.
3030         * WebProcess/WebProcess.h:
3031
3032 2016-04-21  Beth Dakin  <bdakin@apple.com>
3033
3034         showCandidates() should take a range and the string should be the whole 
3035         paragraph
3036         https://bugs.webkit.org/show_bug.cgi?id=156813
3037         -and corresponding-
3038         rdar://problem/25760533
3039
3040         Reviewed by Tim Horton.
3041
3042         * UIProcess/Cocoa/WebViewImpl.h:
3043         * UIProcess/Cocoa/WebViewImpl.mm:
3044         (WebKit::WebViewImpl::updateWebViewImplAdditions):
3045         (WebKit::WebViewImpl::showCandidates):
3046         (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
3047         (WebKit::WebViewImpl::handleRequestedCandidates):
3048
3049 2016-04-21  Chelsea Pugh  <cpugh@apple.com>
3050
3051         [iOS] Allow clients to hide the accessory view on a form input session
3052         https://bugs.webkit.org/show_bug.cgi?id=155574
3053
3054         Reviewed by Dan Bernstein.
3055
3056         * UIProcess/API/Cocoa/_WKFormInputSession.h:
3057         * UIProcess/ios/WKContentViewInteraction.mm:
3058         (-[WKFormInputSession accessoryViewShouldNotShow]): Getter for accessoryViewShouldNotShow.
3059         (-[WKFormInputSession setAccessoryViewShouldNotShow:]): Set accessoryViewShouldNotShow and reload input views.
3060         (-[WKContentView requiresAccessoryView]): If the accessory view should be not be shown, do not require
3061         the accessory view.
3062
3063 2016-04-21  Chris Dumez  <cdumez@apple.com>
3064
3065         Drop [UsePointersEvenForNonNullableObjectArguments] from Range
3066         https://bugs.webkit.org/show_bug.cgi?id=156805
3067
3068         Reviewed by Youenn Fablet.
3069
3070         * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
3071         (-[WKDOMRange setStart:offset:]):
3072         (-[WKDOMRange setEnd:offset:]):
3073         (-[WKDOMRange selectNode:]):
3074         (-[WKDOMRange selectNodeContents:]):
3075         * WebProcess/WebPage/WebFrame.cpp:
3076         (WebKit::WebFrame::contentsAsString):
3077
3078 2016-04-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3079
3080         [GTK] WebKitWebView should claim the contents size as its natural size
3081         https://bugs.webkit.org/show_bug.cgi?id=156835
3082
3083         Reviewed by Žan Doberšek.
3084
3085         And keep claiming 0 as its minimum size since it's scrollable.
3086
3087         * UIProcess/API/gtk/PageClientImpl.cpp:
3088         (WebKit::PageClientImpl::didChangeContentSize): Call webkitWebViewBaseSetContentsSize().
3089         * UIProcess/API/gtk/PageClientImpl.h:
3090         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3091         (webkitWebViewBaseGetPreferredWidth): Return the contents width as natural width.
3092         (webkitWebViewBaseGetPreferredHeight): Return the contents height as natural height.
3093         (webkit_web_view_base_class_init): Add implementations of get_preferred_width/height.
3094         (webkitWebViewBaseSetContentsSize): Save the contents size.
3095         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
3096
3097 2016-04-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3098
3099         [GTK] WebKitWebView should propagate wheel events not handled by the web process
3100         https://bugs.webkit.org/show_bug.cgi?id=156834
3101
3102         Reviewed by Žan Doberšek.
3103
3104         We are currently swallowing all wheel events unconditionally, not allowing applications to handle wheel events
3105         when not handled by us. Since the GTK+ event propagation system is synchronous, and our events are handled
3106         asynchronously, we need to do something similar to what we do for key events, not propagate the event the first
3107         time and if not handled by the web process, re-inject it in the event loop and then just propagate it.
3108
3109         * Shared/NativeWebWheelEvent.h:
3110         (WebKit::NativeWebWheelEvent::nativeEvent): Remove useless const.
3111         * UIProcess/API/gtk/PageClientImpl.cpp:
3112         (WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore): Tell the web view to propagate the next wheel event,
3113         and re-inject the event not handled by the web process in the event loop.
3114         * UIProcess/API/gtk/PageClientImpl.h:
3115         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3116         (webkitWebViewBaseScrollEvent): Propagate the event if shouldForwardNextWheelEvent is true.
3117         (webkitWebViewBaseForwardNextWheelEvent): Set shouldForwardNextWheelEvent to true.
3118         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
3119         * UIProcess/PageClient.h:
3120         * UIProcess/WebPageProxy.cpp:
3121         (WebKit::WebPageProxy::didReceiveEvent): Remove ifdef.
3122         * UIProcess/efl/WebView.h:
3123
3124 2016-04-20  Dustin Falgout  <dustin@falgout.us>
3125
3126         [GTK] Expose AllowUniversalAccessFromFileURLs preference now that calling localStorage.getItem() results in SecurityError: DOM Exception 18
3127         
3128         Reviewed by Michael Catanzaro.
3129                 
3130         As of r197858 JavaScript loaded in the context of a file scheme url cannot access local storage. That is a major 
3131         breaking change as many applications that serve files locally rely on having access to local storage. The point  
3132         of that security fix is to avoid cases of downloaded HTML content (such as e-mail attachments or JS injected
3133         into local contexts) from having access to your local file system and arbitrary local storage. If you are serving 
3134         local files in your applications, you can use the WebKitAllowUniversalAccessFromFileURLs preference key to tell 
3135         Webkit that you are approve of these kinds of interactions.
3136                                               
3137         https://bugs.webkit.org/show_bug.cgi?id=156651
3138
3139         * UIProcess/API/gtk/WebKitSettings.cpp:
3140         (webKitSettingsSetProperty):
3141         (webKitSettingsGetProperty):
3142         (webkit_settings_class_init):
3143         (webkit_settings_get_allow_universal_access_from_file_urls):
3144         (webkit_settings_set_allow_universal_access_from_file_urls):
3145         * UIProcess/API/gtk/WebKitSettings.h:
3146         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3147
3148 2016-04-20  Brady Eidson  <beidson@apple.com>
3149
3150         Modern IDB (Workers): Enable INDEXED_DATABASE_IN_WORKERS compile time flag, but disabled in RuntimeEnabledFeatures.
3151         https://bugs.webkit.org/show_bug.cgi?id=156782
3152
3153         Reviewed by Alex Christensen.
3154
3155         * Configurations/FeatureDefines.xcconfig:
3156
3157 2016-04-20  Brent Fulgham  <bfulgham@apple.com>
3158
3159         [WK2][Mac][iOS] WebContent crash when using special file:// URI scheme @ WebKit::resolveSymlinksInPath(WTF::CString const&) + 159
3160         https://bugs.webkit.org/show_bug.cgi?id=156747
3161         <rdar://problem/24648176>
3162
3163         Reviewed by Alexey Proskuryakov.
3164
3165         FileSystemCF::fileSystemRepresentation return a null string when presented with a file URL that contains embedded nulls. When
3166         this happens, SandboxExtension::createHandle attempts to pass a null string to 'resolveSymlinksInPath', which attemps to call
3167         'strrchr' on the null pointer, causing a crash.
3168
3169         Test: fast/url/file-uri-with-embedded-null-no-crash.html
3170
3171         * Shared/mac/SandboxExtensionMac.mm:
3172         (WebKit::SandboxExtension::createHandle): If 'fileSystemRepresentation' is null, return early with an error.
3173
3174 2016-04-19  Alex Christensen  <achristensen@webkit.org>
3175
3176         Fix CMake build.
3177
3178         * CMakeLists.txt:
3179         Don't compile a file that doesn't exist.
3180         * PlatformMac.cmake:
3181         Put the XPCServices in the right place.
3182
3183 2016-04-19  Chris Dumez  <cdumez@apple.com>
3184
3185         Crash under WebKit::PluginView::pluginSnapshotTimerFired
3186         https://bugs.webkit.org/show_bug.cgi?id=156754
3187         <rdar://problem/22566764>
3188
3189         Reviewed by Beth Dakin.
3190
3191         Add null check for frame() before trying to access the frame settings,
3192         similarly to what is done earlier in this function. This fixes a top
3193         crasher.
3194
3195         * WebProcess/Plugins/PluginView.cpp:
3196         (WebKit::PluginView::pluginSnapshotTimerFired):
3197
3198 2016-04-19  Dean Jackson  <dino@apple.com>
3199
3200         New SPI to export a dictionary of runtime features
3201         https://bugs.webkit.org/show_bug.cgi?id=156645
3202         <rdar://problem/23621666>
3203
3204         Reviewed by Anders Carlsson.
3205
3206         Mark the new SPI as WK_MAC_TBA, WK_IOS_TBA.
3207
3208         * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
3209
3210 2016-04-19  Dean Jackson  <dino@apple.com>
3211
3212         New SPI to export a dictionary of runtime features
3213         https://bugs.webkit.org/show_bug.cgi?id=156645
3214         <rdar://problem/23621666>
3215
3216         Post commit follow-up. Darin gave review comments that
3217         I didn't address in my original commit - I was waiting
3218         on some advice.
3219
3220         * UIProcess/WebPreferences.cpp:
3221         (WebKit::WebPreferences::isEnabledForFeature): Change the macro
3222         to generate a static list of function pointers, rather than
3223         a lot of conditional statements.
3224         (WebKit::WebPreferences::setEnabledForFeature): Ditto.
3225
3226 2016-04-19  Chris Dumez  <cdumez@apple.com>
3227
3228         Mark more classes as WTF_MAKE_FAST_ALLOCATED
3229         https://bugs.webkit.org/show_bug.cgi?id=156732
3230
3231         Reviewed by Darin Adler.
3232
3233         * NetworkProcess/Downloads/Download.h:
3234         * NetworkProcess/Downloads/PendingDownload.h:
3235         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
3236         * Shared/API/Cocoa/RemoteObjectInvocation.h:
3237
3238 2016-04-19  Alex Christensen  <achristensen@webkit.org>
3239
3240         Build fix.
3241
3242         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3243         (WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob):
3244         result is unused.
3245
3246 2016-04-19  Brady Eidson  <beidson@apple.com>
3247
3248         Modern IDB: ObjectStore Blob Support.
3249         https://bugs.webkit.org/show_bug.cgi?id=143193
3250
3251         Reviewed by Alex Christensen.
3252
3253         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3254         (WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob): Don't ASSERT that
3255           this is the first we've heard of this path - The Connection now remembers all extensions.
3256         (WebKit::NetworkConnectionToWebProcess::getBlobDataFileReferenceForPath): Don't take - Just get.
3257
3258 2016-04-19  Antti Koivisto  <antti@apple.com>
3259
3260         Try to fix iOS build.
3261
3262         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
3263
3264 2016-04-19  Commit Queue  <commit-queue@webkit.org>
3265
3266         Unreviewed, rolling out r199658.
3267         https://bugs.webkit.org/show_bug.cgi?id=156736
3268
3269         It broke all EFL layout tests (Requested by KaL on #webkit).
3270
3271         Reverted changeset:
3272
3273         "[UNIX] Initialize WebKit before the platform initializations"
3274         https://bugs.webkit.org/show_bug.cgi?id=156622
3275         http://trac.webkit.org/changeset/199658
3276
3277 2016-04-18  Alex Christensen  <achristensen@webkit.org>
3278
3279         Build fix after r199700
3280
3281         * PlatformMac.cmake:
3282
3283 2016-04-18  Brady Eidson  <beidson@apple.com>
3284
3285         Modern IDB (Blob support): When reading Blobs from the database, grant the Networking process sandbox access to the files.
3286         https://bugs.webkit.org/show_bug.cgi?id=156640
3287
3288         Reviewed by Alex Christensen.
3289
3290         * DatabaseProcess/DatabaseProcess.cpp:
3291         (WebKit::DatabaseProcess::getSandboxExtensionsForBlobFiles): Utility function to ask the UI process for
3292           SandboxExtensions for a list of files.
3293         (WebKit::DatabaseProcess::didGetSandboxExtensionsForBlobFiles): Take the SandboxExtensions from the UI process
3294           and pass them along to the completion handler.
3295         * DatabaseProcess/DatabaseProcess.h:
3296         * DatabaseProcess/DatabaseProcess.messages.in:
3297
3298         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
3299         (WebKit::WebIDBConnectionToClient::didGetRecord): If the value returned from the database doesn't have Blob files,
3300           pass the result directly on to WebCore. If it does, ask the UI process for SandboxExtensions first.
3301
3302         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
3303         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked): Grab the BlobDataFileReference from the 
3304           NetworkConnectionToWebProcess to pass along to the BlobRegistry.
3305
3306         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3307         (WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob): Add this message
3308           so the WebProcess can preflight the creation of some blob URLs by passing along the SandboxExtensions for their files.
3309         (WebKit::NetworkConnectionToWebProcess::takeBlobDataFileReferenceForPath):
3310         * NetworkProcess/NetworkConnectionToWebProcess.h:
3311         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3312
3313         * UIProcess/Databases/DatabaseProcessProxy.cpp:
3314         (WebKit::DatabaseProcessProxy::getSandboxExtensionsForBlobFiles): Create SandboxExtensions for the passed in files and
3315           return them to the DatabaseProcess.
3316         * UIProcess/Databases/DatabaseProcessProxy.h:
3317         * UIProcess/Databases/DatabaseProcessProxy.messages.in:
3318
3319         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3320         (WebKit::WebIDBConnectionToServer::didGetRecordWithSandboxExtensions): New form of "didGetRecord" that handles passing
3321           the SandboxExtensions to the Networking process before they are needed.
3322         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
3323         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
3324
3325         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
3326         (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
3327         * WebProcess/FileAPI/BlobRegistryProxy.h:
3328
3329 2016-04-18  Dean Jackson  <dino@apple.com>
3330
3331         New SPI to export a dictionary of runtime features
3332         https://bugs.webkit.org/show_bug.cgi?id=156645
3333         <rdar://problem/23621666>
3334
3335         Trying to fix GTK and EFL builds. I forgot to add files
3336         to CMake.
3337
3338         * CMakeLists.txt:
3339         * PlatformMac.cmake:
3340
3341 2016-04-18  Dean Jackson  <dino@apple.com>
3342
3343         New SPI to export a dictionary of runtime features
3344         https://bugs.webkit.org/show_bug.cgi?id=156645
3345         <rdar://problem/23621666>
3346
3347         Reviewed by Darin Adler.
3348
3349         Add a new type of Preference for experimental features so that we
3350         can dynamically toggle them from a WebKit2 host. These are special
3351         keys that are tied to runtime flags. The host process can ask WebKit
3352         for the list of keys, each with a small description, in order to
3353         display UI.
3354
3355         - Add HumanReadableName and HumanReadableDescription parameters to our
3356           macros, which are used when building a ExperimentalFeature.
3357           These are both empty strings for the existing preferences. At some
3358           point we should probably move all this to code generation rather
3359           than macros, so that we don't have to carry around unused parameters.
3360
3361         - I've included two sample experimental features: WebGL2 and ShadowDOM.
3362           They are not actually hooked up to the runtime settings yet, but its
3363           pretty clear how that will happen. Note that these are new preferences
3364           that have an "Experimental" prefix. This is so toggling an experimental
3365           feature to off won't cause the feature to not work once it becomes
3366           stable enough to enable by default. In other words, when it moves
3367           out of the experimental stage, the experimental feature flag will be
3368           removed, and you'll no longer check for values with that key.
3369
3370         - The ExperimentalFeature object is what the host process
3371           will read in order to show some UI. It contains the human readable info,
3372           as well as the actual key that can be used to query and toggle the
3373           experimental feature.
3374
3375         * Shared/API/APIObject.h: Add the ExperimentalFeature.
3376
3377         * Shared/Cocoa/APIObject.mm:
3378         (API::Object::newObject): Exposes a wrapper around a _WKExperimentalFeature ObjC type.
3379
3380         * Shared/WebPreferencesDefinitions.h: Change all the existing macros to take the new
3381         parameters, and add the initial experimental keys.
3382
3383         * Shared/WebPreferencesKeys.cpp: Add new parameters to existing macros.
3384         * Shared/WebPreferencesKeys.h: Ditto.
3385         * Shared/WebPreferencesStore.cpp: Ditto.
3386         (WebKit::defaults):
3387
3388         * UIProcess/API/APIExperimentalFeature.cpp: The API side of the ExperimentalFeature.
3389         (API::ExperimentalFeature::create):
3390         (API::ExperimentalFeature::ExperimentalFeature):
3391         (API::ExperimentalFeature::~ExperimentalFeature):
3392         * UIProcess/API/APIExperimentalFeature.h:
3393
3394         * UIProcess/API/Cocoa/WKPreferences.mm: The actual implementation of the SPI.
3395         (+[WKPreferences _experimentalFeatures]): Create and return a list of feature descriptors.
3396         (-[WKPreferences _isEnabledForFeature:]): Get the value.
3397         (-[WKPreferences _setEnabled:forFeature:]): Set the value.
3398         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3399
3400         * UIProcess/API/Cocoa/_WKExperimentalFeature.h: The ObjC version.
3401         * UIProcess/API/Cocoa/_WKExperimentalFeature.mm:
3402         (-[_WKExperimentalFeature dealloc]):
3403         (-[_WKExperimentalFeature description]):
3404         (-[_WKExperimentalFeature name]):
3405         (-[_WKExperimentalFeature key]):
3406         (-[_WKExperimentalFeature details]):
3407         (-[_WKExperimentalFeature _apiObject]):
3408         * UIProcess/API/Cocoa/_WKExperimentalFeatureInternal.h: Implementation of the wrapper.
3409         (WebKit::wrapper):
3410
3411         * UIProcess/WebPreferences.cpp: The C++ implementation that provides the data for the ObjC API.
3412         (WebKit::globalExperimentalFeatures):
3413         (WebKit::WebPreferences::ExperimentalFeatures):
3414         (WebKit::WebPreferences::isEnabledForFeature):
3415         (WebKit::WebPreferences::setEnabledForFeature):
3416         * UIProcess/WebPreferences.h:
3417
3418         * UIProcess/mac/WebPreferencesMac.mm: Update some macros.
3419         (WebKit::WebPreferences::platformInitializeStore):
3420         * WebProcess/WebPage/WebPage.cpp: Ditto
3421         (WebKit::WebPage::updatePreferences):
3422
3423         * WebKit2.xcodeproj/project.pbxproj: Add the new files.
3424
3425 2016-04-18  Tim Horton  <timothy_horton@apple.com>
3426
3427         Swipe view gesture should be reversed in right-to-left contexts
3428         https://bugs.webkit.org/show_bug.cgi?id=156714
3429
3430         Reviewed by Anders Carlsson.
3431
3432         * UIProcess/API/gtk/PageClientImpl.h:
3433         * UIProcess/PageClient.h:
3434         * UIProcess/UserInterfaceLayoutDirection.h: Added.
3435         * UIProcess/WebPageProxy.cpp:
3436         (WebKit::WebPageProxy::userInterfaceLayoutDirection):
3437         * UIProcess/WebPageProxy.h:
3438         * UIProcess/ios/PageClientImplIOS.h:
3439         * UIProcess/ios/PageClientImplIOS.mm:
3440         (WebKit::PageClientImpl::userInterfaceLayoutDirection):
3441         * UIProcess/mac/PageClientImpl.h:
3442         * UIProcess/mac/PageClientImpl.mm:
3443         (WebKit::PageClientImpl::userInterfaceLayoutDirection):
3444         Plumb RTL-ness through to WebPageProxy.
3445         We look at the WK(Web)View's UI layout direction.
3446         For other platforms, we just assume LTR.
3447
3448         * UIProcess/mac/ViewGestureController.h:
3449         * UIProcess/mac/ViewGestureControllerMac.mm:
3450         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
3451         Decide which way to swipe (and which way to look for back-forward items)
3452         based on the WebPageProxy's reported RTLness.
3453
3454         (WebKit::ViewGestureController::isPhysicallySwipingLeft):
3455         "Back" means "swiping left" in LTR and "swiping right" in RTL.
3456
3457         (WebKit::ViewGestureController::trackSwipeGesture):
3458         (WebKit::ViewGestureController::determineLayerAdjacentToSnapshotForParent):
3459         (WebKit::ViewGestureController::beginSwipeGesture):
3460         (WebKit::ViewGestureController::handleSwipeGesture):
3461         Make things that were equating "back" with "left" instead check isPhysicallySwipingLeft.
3462
3463 2016-04-18  Anders Carlsson  <andersca@apple.com>
3464
3465         Fix build with newer versions of clang.
3466         rdar://problem/25749769
3467
3468         * UIProcess/Cocoa/WebViewImpl.mm:
3469         * UIProcess/mac/WebPageProxyMac.mm:
3470         Forward declare some AppKit IPI.
3471
3472 2016-04-18  Tina Liu  <iting_liu@apple.com>
3473
3474         Implement functions to set plug-in load policies for private browsing mode
3475         https://bugs.webkit.org/show_bug.cgi?id=156540
3476
3477         Reviewed by Anders Carlsson.
3478
3479         This patch implements API and wrappers for clients to set policies to use when using
3480         private browsing. WebPlatformStrategies would return which policies to use depending
3481         on whether the page is in private browsing mode.
3482
3483         * Shared/WebProcessCreationParameters.h:
3484         Add a hash map for plug-in load policies for private browsing.
3485         * Shared/WebProcessCreationParameters.cpp:
3486         (WebKit::WebProcessCreationParameters::encode):
3487         (WebKit::WebProcessCreationParameters::decode):
3488
3489         * UIProcess/API/C/mac/WKContextPrivateMac.h:
3490         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
3491         (WKContextSetPrivateBrowsingPluginLoadClientPolicy):
3492         Add a wrapper.
3493
3494         * UIProcess/WebProcessPool.h:
3495         * UIProcess/WebProcessPool.cpp:
3496         (WebKit::WebProcessPool::createNewWebProcess):
3497         Set the WebProcessCreationParameters's pluginLoadClientPoliciesForPrivateBrowsing.
3498         (WebKit::WebProcessPool::setPluginLoadClientPolicyForBrowsingMode):
3499         A helper function that sets plug-in policies to the corresponding instance variable:
3500         m_pluginLoadClientPolicies for general browsing and m_pluginLoadClientPoliciesForPrivateBrowsing
3501         for private browsing. The logic is extracted from the original setPluginLoadClientPolicy.
3502         While we are here, get rid of the .contains() lookup as .get() will just return a
3503         constructed object if the key is not found.
3504         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
3505         Switch to use the helper function to set policies.
3506         (WebKit::WebProcessPool::setPrivateBrowsingPluginLoadClientPolicy):
3507         Ditto. Also send a message to the WebProcess for setting policies for private browsing.
3508         (WebKit::WebProcessPool::clearPluginClientPolicies):
3509         Clear plug-ins' private browsing policies.
3510
3511         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3512         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3513         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicyForBrowsingMode):
3514         Ditto as WebProcessPool::setPluginLoadClientPolicyForBrowsingMode.
3515         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
3516         Switch to use setPluginLoadClientPolicyForBrowsingMode to set policies.
3517         (WebKit::WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy):
3518         Use setPluginLoadClientPolicyForBrowsingMode to set policies for private browsing.
3519         (WebKit::WebPlatformStrategies::clearPluginClientPolicies):
3520         Clear plug-ins' private browsing policies.
3521         (WebKit::WebPlatformStrategies::longestMatchedWildcardHostForHost):
3522         Add an argument for private browsing. Read from the corresponding ivar.
3523         (WebKit::WebPlatformStrategies::replaceHostWithMatchedWildcardHost):
3524         Ditto.
3525         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost): Deleted.
3526         Renamed this function as pluginLoadClientPolicyForHostForBrowsingMode.
3527         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHostForBrowsingMode):
3528         Ditto.
3529         (WebKit::WebPlatformStrategies::populatePluginCache):
3530         Get the plug-in load policies for a specific host based on the page's session status. If the page
3531         is using ephemeral session, use the private browsing policies.
3532
3533         * WebProcess/WebProcess.h:
3534         * WebProcess/WebProcess.cpp:
3535         (WebKit::WebProcess::initializeWebProcess):
3536         Switch to call the helper function setPluginLoadClientPolicyFromCreationParameters.
3537         (WebKit::WebProcess::setPluginLoadClientPolicies):
3538         Logic moved from initializeWebProcess. Call PluginStrategy::setPluginLoadClientPolicy or
3539         PluginStrategy::setPrivateBrowsingPluginLoadClientPolicy depending on the input argument.
3540         (WebKit::WebProcess::setPrivateBrowsingPluginLoadClientPolicy):
3541         Add a wrapper to call PluginStrategy::setPrivateBrowsingPluginLoadClientPolicy.
3542
3543         * WebProcess/WebProcess.messages.in:
3544         Declare an entry for setPrivateBrowsingPluginLoadClientPolicy.
3545
3546 2016-04-18  Chris Dumez  <cdumez@apple.com>
3547
3548         [WK2][iOS] Only adjust network responses' MIME type for QuickLook in the context of a main resource load
3549         https://bugs.webkit.org/show_bug.cgi?id=156639
3550         <rdar://problem/25765848>
3551
3552         Reviewed by Alex Christensen.
3553
3554         * NetworkProcess/NetworkDataTask.h:
3555         (WebKit::NetworkDataTask::firstRequest):
3556         Add getter to return the first request.
3557
3558         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3559         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
3560         Pass flag to adjustMIMETypeIfNecessary() indicated if this is a main resource load.
3561
3562 2016-04-18  Brian Burg  <bburg@apple.com>
3563
3564         Web Automation: provide detailed error messages when an automation command fails
3565         https://bugs.webkit.org/show_bug.cgi?id=156635
3566         <rdar://problem/25754051>
3567
3568         Reviewed by Darin Adler and Timothy Hatcher.
3569
3570         Fill in lots of missing error message details now that the remote end knows
3571         how to parse error strings with predefined error names and details.
3572
3573         * UIProcess/Automation/WebAutomationSession.cpp:
3574         Rearrange the error message macros. Make it possible to pass a ErrorMessage
3575         variable or just the enum value name and get out an encoded error message
3576         that optionally includes a free-form details string. The predefined error
3577         name and the details string are joined together with a semicolon.
3578
3579         (WebKit::WebAutomationSession::getBrowsingContext):
3580         (WebKit::WebAutomationSession::createBrowsingContext):
3581         (WebKit::WebAutomationSession::closeBrowsingContext):
3582         (WebKit::WebAutomationSession::switchToBrowsingContext):
3583         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
3584         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
3585         (WebKit::WebAutomationSession::navigateBrowsingContext):
3586         (WebKit::WebAutomationSession::goBackInBrowsingContext):
3587         (WebKit::WebAutomationSession::goForwardInBrowsingContext):
3588         (WebKit::WebAutomationSession::reloadBrowsingContext):
3589         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
3590         (WebKit::WebAutomationSession::didEvaluateJavaScriptFunction):
3591         (WebKit::WebAutomationSession::resolveChildFrameHandle):
3592         (WebKit::WebAutomationSession::didResolveChildFrame):
3593         (WebKit::WebAutomationSession::resolveParentFrameHandle):
3594         (WebKit::WebAutomationSession::didResolveParentFrame):
3595         (WebKit::WebAutomationSession::computeElementLayout):
3596         (WebKit::WebAutomationSession::didComputeElementLayout):
3597         (WebKit::WebAutomationSession::isShowingJavaScriptDialog):
3598         (WebKit::WebAutomationSession::dismissCurrentJavaScriptDialog):
3599         (WebKit::WebAutomationSession::acceptCurrentJavaScriptDialog):
3600         (WebKit::WebAutomationSession::messageOfCurrentJavaScriptDialog):
3601         (WebKit::WebAutomationSession::setUserInputForCurrentJavaScriptPrompt):
3602         (WebKit::WebAutomationSession::getAllCookies):
3603         (WebKit::WebAutomationSession::didGetCookiesForFrame):
3604         (WebKit::WebAutomationSession::deleteSingleCookie):
3605         (WebKit::WebAutomationSession::didDeleteCookie):
3606         (WebKit::WebAutomationSession::addSingleCookie):
3607         (WebKit::WebAutomationSession::deleteAllCookies):
3608         (WebKit::WebAutomationSession::performMouseInteraction):
3609         (WebKit::WebAutomationSession::performKeyboardInteractions):
3610         (WebKit::WebAutomationSession::takeScreenshot):
3611         (WebKit::WebAutomationSession::didTakeScreenshot):
3612         Audit almost all early exits and provide a relevant error details message
3613         if the error itself is ambiguous. Make sure to format asynchronous errors.
3614
3615 2016-04-18  Brent Fulgham  <bfulgham@apple.com>
3616
3617         CSP: Remove stubs for dynamically-added favicons (via link rel="icon")
3618         https://bugs.webkit.org/show_bug.cgi?id=153151
3619         <rdar://problem/24383176>
3620
3621         Reviewed by Darin Adler.
3622
3623         Remove the unused dynamic favicon code and tests.
3624
3625         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3626         (WebKit::WebFrameLoaderClient::dispatchDidChangeIcons): Deleted.
3627         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3628
3629 2016-04-18  Jer Noble  <jer.noble@apple.com>
3630
3631         REGRESSION( r199603): Pandora crashes WebKit in WebPlaybackSessionManager::removeClientForContext
3632         https://bugs.webkit.org/show_bug.cgi?id=156648
3633
3634         Reviewed by Darin Adler.
3635
3636         Follow up patch to r199615; avoid a double hash lookup by using a .find() pattern instead of
3637         .contains() & .get().
3638
3639         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
3640         (WebKit::WebPlaybackSessionManager::setUpPlaybackControlsManager):
3641         (WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):
3642
3643 2016-04-18  Chris Dumez  <cdumez@apple.com>
3644
3645         Unreviewed, rolling out r199644.
3646
3647         Seems to have caused a 1-2% regression on warm PLT
3648
3649         Reverted changeset:
3650
3651         "[WK2][iOS] Do not dlopen() QuickLook in the NetworkProcess"
3652         https://bugs.webkit.org/show_bug.cgi?id=156639
3653         http://trac.webkit.org/changeset/199644
3654
3655 2016-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
3656
3657         Pending API Request URL is wrong after reloading
3658         https://bugs.webkit.org/show_bug.cgi?id=139342
3659
3660         Reviewed by Darin Adler.
3661
3662         It happens when reloading a web view loaded with anything but a
3663         URL, because the bf list is not updated for those cases and
3664         WebPageProxy::reload() is setting the current bf list item URL as
3665         pending API request URL. This also causes that progress is
3666         reported wrongly, because
3667         WebPageProxy::decidePolicyForNavigationAction() resets the pending
3668         API request URL when it's different than the requested URL. The
3669         page load transaction causes the progress to be changed, reporting
3670         1.0 (the previous one), but later something < 1.0 is reported
3671         again by the progress tracker.
3672
3673         * UIProcess/WebPageProxy.cpp:
3674         (WebKit::WebPageProxy::reload): Use the current active URL as
3675         pending API request URL, falling back to the current bf list item
3676         URL when empty.
3677
3678 2016-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
3679
3680         Pending API request URL no set when loading Data, Alternate HTML or plain text
3681         https://bugs.webkit.org/show_bug.cgi?id=136916
3682
3683         Reviewed by Darin Adler.
3684
3685         Set pending API request URL for all load methods in
3686         WebPageProxy. This ensures that right after calling those methods,
3687         the active URL is the requested one and that
3688         PageLoadState::isLoading() returns true.
3689
3690         * UIProcess/WebPageProxy.cpp:
3691         (WebKit::WebPageProxy::loadAlternateHTMLString):
3692         (WebKit::WebPageProxy::loadPlainTextString):
3693         (WebKit::WebPageProxy::loadWebArchiveData):
3694
3695 2016-04-18  Commit Queue  <commit-queue@webkit.org>
3696
3697         Unreviewed, rolling out r199660.
3698         https://bugs.webkit.org/show_bug.cgi?id=156691
3699
3700         It broke the iOS build (Requested by KaL on #webkit).
3701
3702         Reverted changeset:
3703
3704         "Pending API request URL no set when loading Data, Alternate
3705         HTML or plain text"
3706         https://bugs.webkit.org/show_bug.cgi?id=136916
3707         http://trac.webkit.org/changeset/199660
3708
3709 2016-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
3710
3711         Pending API request URL no set when loading Data, Alternate HTML or plain text
3712         https://bugs.webkit.org/show_bug.cgi?id=136916
3713
3714         Reviewed by Darin Adler.
3715
3716         Set pending API request URL for all load methods in
3717         WebPageProxy. This ensures that right after calling those methods,
3718         the active URL is the requested one and that
3719         PageLoadState::isLoading() returns true.
3720
3721         * UIProcess/WebPageProxy.cpp:
3722         (WebKit::WebPageProxy::loadAlternateHTMLString):
3723         (WebKit::WebPageProxy::loadPlainTextString):
3724         (WebKit::WebPageProxy::loadWebArchiveData):
3725
3726 2016-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
3727
3728         [UNIX] Initialize WebKit before the platform initializations
3729         https://bugs.webkit.org/show_bug.cgi?id=156622
3730
3731         Reviewed by Michael Catanzaro.
3732
3733         The platform specific initialization might use something that would require WebKit2 to be initialized. For
3734         example, in debug mode, the GTK+ port uses WTF::sleep that requires the threading to be initialized.
3735
3736         * Shared/unix/ChildProcessMain.h:
3737         (WebKit::ChildProcessMain): Move InitializeWebKit2() before platformInitialize().
3738
3739 2016-04-18  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
3740
3741         Fix incorrect assumption that APPLE implies Mac.
3742         https://bugs.webkit.org/show_bug.cgi?id=156679
3743
3744         Addresses build failure introduced in r198947
3745
3746         Reviewed by Alex Christensen.
3747
3748         * CMakeLists.txt:
3749
3750 2016-04-17  Yoav Weiss  <yoav@yoav.ws>
3751
3752         Initial Link preload support
3753         https://bugs.webkit.org/show_bug.cgi?id=156334
3754
3755         Reviewed by Darin Adler.
3756
3757         * WebProcess/Network/WebLoaderStrategy.cpp:
3758         (WebKit::maximumBufferingTime): Added LinkPreload as a possible CachedResource::type.
3759
3760 2016-04-17  Chris Dumez  <cdumez@apple.com>
3761
3762         [WK2][iOS] Do not dlopen() QuickLook in the NetworkProcess
3763         https://bugs.webkit.org/show_bug.cgi?id=156639
3764
3765         Reviewed by Darin Adler.
3766
3767         * WebProcess/Network/WebResourceLoader.cpp:
3768         (WebKit::WebResourceLoader::didReceiveResponse):
3769         Move checks for main resource load and for MIME type inside of
3770         QuickLookHandle::createIfNecessary(), for consistency with the
3771         other QuickLookHandle factory functions.
3772
3773 2016-04-16  Dan Bernstein  <mitz@apple.com>
3774
3775         [Mac] Web Content service with a restricted entitlement may load arbitrary dylibs
3776         https://bugs.webkit.org/show_bug.cgi?id=156668
3777         <rdar://problem/25429784>
3778
3779         Reviewed by Anders Carlsson.
3780
3781         * Configurations/WebContentService.xcconfig: Enable library validation when the Web Content
3782           service is given the XPC domain extension entitlement.
3783
3784 2016-04-15  Dan Bernstein  <mitz@apple.com>
3785
3786         [Mac] WebContent, Networking and Databases services have i386 slices that are never used
3787         https://bugs.webkit.org/show_bug.cgi?id=156654
3788
3789         Reviewed by Alexey Proskuryakov.
3790
3791         * Configurations/BaseXPCService.xcconfig: Set VALID_ARCHS to ARCHS_STANDARD when not building only
3792           for the active architecture.
3793         * Configurations/PluginService.32.xcconfig: Removed now-redundant definitions.
3794         * Configurations/PluginService.64.xcconfig: Ditto.
3795
3796 2016-04-15  Sam Weinig  <sam@webkit.org>
3797
3798         Need a way to specify a script name to show in the inspector for scripts injected via WKUserScript
3799         <rdar://problem/25626662>
3800         https://bugs.webkit.org/show_bug.cgi?id=156653
3801
3802         Reviewed by Tim Horton.
3803
3804         * UIProcess/API/Cocoa/WKUserScript.mm:
3805         (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:userContentWorld:]):
3806         * UIProcess/API/Cocoa/WKUserScriptPrivate.h:
3807         Add a new initializer that takes an associate URL that is used to represent the user script.
3808
3809 2016-04-15  Darin Adler  <darin@apple.com>
3810
3811         Reduce use of Deprecated::ScriptXXX classes
3812         https://bugs.webkit.org/show_bug.cgi?id=156632
3813
3814         Reviewed by Alex Christensen.
3815
3816         * WebProcess/Plugins/PluginView.cpp:
3817         (WebKit::PluginView::performJavaScriptURLRequest): Use JSValue.
3818         * WebProcess/WebPage/WebInspectorUI.cpp:
3819         (WebKit::WebInspectorUI::windowObjectCleared): Use references.
3820         * WebProcess/WebPage/WebPage.cpp:
3821         (WebKit::WebPage::runJavaScriptInMainFrame): Use JSValue.
3822
3823 2016-04-15  Jer Noble  <jer.noble@apple.com>
3824
3825         REGRESSION( r199603): Pandora crashes WebKit in WebPlaybackSessionManager::removeClientForContext
3826         https://bugs.webkit.org/show_bug.cgi?id=156648
3827         <rdar://problem/25758117>
3828
3829         Reviewed by Beth Dakin.
3830
3831         Mistakenly checked in a reversed condition check, which causes a subsequent assert and crash.
3832
3833         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
3834         (WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):
3835
3836 2016-04-15  Chris Dumez  <cdumez@apple.com>
3837
3838         Mark NetworkLoad as FastAllocated
3839         https://bugs.webkit.org/show_bug.cgi?id=156628
3840
3841         Reviewed by Alex Christensen.
3842
3843         Mark NetworkLoad as FastAllocated for performance.
3844
3845         * NetworkProcess/NetworkLoad.h:
3846
3847 2016-04-14  Jer Noble  <jer.noble@apple.com>
3848
3849         Allow WebVideoFullscreenManager and Proxy to be used by audio elements.
3850         https://bugs.webkit.org/show_bug.cgi?id=156564
3851
3852         Reviewed by Beth Dakin.
3853
3854         Tease apart WebVideoFullscreenManager and …Proxy into WebPlaybackSessionManager and …Proxy
3855         classes dealing exclusively with playback state and commands, leaving fullscreen state and
3856         commands in the WebVideoFullscreenManager… classes.
3857
3858         WebVideoFullscreenManager and …Proxy will now require an associated
3859         WebPlaybackSessionManager and …Proxy class. The WebPlaybackSessionManager classes can be
3860         used separately and without the WebVideoFullscreenManager classes.
3861
3862         * DerivedSources.make:
3863         * UIProcess/API/Cocoa/WKWebView.mm:
3864         (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]):
3865         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: Copied from Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h.
3866         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: Copied from Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in.
3867         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: Added.
3868         (WebKit::WebPlaybackSessionModelContext::play):
3869         (WebKit::WebPlaybackSessionModelContext::pause):
3870         (WebKit::WebPlaybackSessionModelContext::togglePlayState):
3871         (WebKit::WebPlaybackSessionModelContext::beginScrubbing):
3872         (WebKit::WebPlaybackSessionModelContext::endScrubbing):
3873         (WebKit::WebPlaybackSessionModelContext::seekToTime):
3874         (WebKit::WebPlaybackSessionModelContext::fastSeek):
3875         (WebKit::WebPlaybackSessionModelContext::beginScanningForward):
3876         (WebKit::WebPlaybackSessionModelContext::beginScanningBackward):
3877         (WebKit::WebPlaybackSessionModelContext::endScanning):
3878         (WebKit::WebPlaybackSessionModelContext::selectAudioMediaOption):
3879         (WebKit::WebPlaybackSessionModelContext::selectLegibleMediaOption):
3880         (WebKit::WebPlaybackSessionManagerProxy::create):
3881         (WebKit::WebPlaybackSessionManagerProxy::WebPlaybackSessionManagerProxy):
3882         (WebKit::WebPlaybackSessionManagerProxy::~WebPlaybackSessionManagerProxy):
3883         (WebKit::WebPlaybackSessionManagerProxy::invalidate):
3884         (WebKit::WebPlaybackSessionManagerProxy::createModelAndInterface):
3885         (WebKit::WebPlaybackSessionManagerProxy::ensureModelAndInterface):
3886         (WebKit::WebPlaybackSessionManagerProxy::ensureModel):
3887         (WebKit::WebPlaybackSessionManagerProxy::ensureInterface):
3888         (WebKit::WebPlaybackSessionManagerProxy::addClientForContext):
3889         (WebKit::WebPlaybackSessionManagerProxy::removeClientForContext):
3890         (WebKit::WebPlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
3891         (WebKit::WebPlaybackSessionManagerProxy::clearPlaybackControlsManager):
3892         (WebKit::WebPlaybackSessionManagerProxy::resetMediaState):
3893         (WebKit::WebPlaybackSessionManagerProxy::setCurrentTime):
3894         (WebKit::WebPlaybackSessionManagerProxy::setBufferedTime):
3895         (WebKit::WebPlaybackSessionManagerProxy::setSeekableRangesVector):
3896         (WebKit::WebPlaybackSessionManagerProxy::setCanPlayFastReverse):
3897         (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions):
3898         (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions):
3899         (WebKit::WebPlaybackSessionManagerProxy::setExternalPlaybackProperties):
3900         (WebKit::WebPlaybackSessionManagerProxy::setWirelessVideoPlaybackDisabled):
3901         (WebKit::WebPlaybackSessionManagerProxy::setDuration):
3902         (WebKit::WebPlaybackSessionManagerProxy::setRate):
3903         (WebKit::WebPlaybackSessionManagerProxy::play):
3904         (WebKit::WebPlaybackSessionManagerProxy::pause):
3905         (WebKit::WebPlaybackSessionManagerProxy::togglePlayState):
3906         (WebKit::WebPlaybackSessionManagerProxy::beginScrubbing):
3907         (WebKit::WebPlaybackSessionManagerProxy::endScrubbing):
3908         (WebKit::WebPlaybackSessionManagerProxy::seekToTime):
3909         (WebKit::WebPlaybackSessionManagerProxy::fastSeek):
3910         (WebKit::WebPlaybackSessionManagerProxy::beginScanningForward):
3911         (WebKit::WebPlaybackSessionManagerProxy::beginScanningBackward):
3912         (WebKit::WebPlaybackSessionManagerProxy::endScanning):
3913         (WebKit::WebPlaybackSessionManagerProxy::selectAudioMediaOption):
3914         (WebKit::WebPlaybackSessionManagerProxy::selectLegibleMediaOption):
3915         (WebKit::WebPlaybackSessionManagerProxy::controlsManagerInterface):
3916         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
3917         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
3918         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
3919         (WebKit::WebVideoFullscreenModelContext::WebVideoFullscreenModelContext):
3920         (WebKit::WebVideoFullscreenModelContext::~WebVideoFullscreenModelContext):
3921         (WebKit::WebVideoFullscreenModelContext::play):
3922         (WebKit::WebVideoFullscreenModelContext::pause):
3923         (WebKit::WebVideoFullscreenModelContext::togglePlayState):
3924         (WebKit::WebVideoFullscreenModelContext::beginScrubbing):
3925         (WebKit::WebVideoFullscreenModelContext::endScrubbing):
3926         (WebKit::WebVideoFullscreenModelContext::seekToTime):
3927         (WebKit::WebVideoFullscreenModelContext::fastSeek):
3928         (WebKit::WebVideoFullscreenModelContext::beginScanningForward):
3929         (WebKit::WebVideoFullscreenModelContext::beginScanningBackward):
3930         (WebKit::WebVideoFullscreenModelContext::endScanning):
3931         (WebKit::WebVideoFullscreenModelContext::selectAudioMediaOption):
3932         (WebKit::WebVideoFullscreenModelContext::selectLegibleMediaOption):
3933         (WebKit::WebVideoFullscreenManagerProxy::create):
3934         (WebKit::WebVideoFullscreenManagerProxy::WebVideoFullscreenManagerProxy):
3935         (WebKit::WebVideoFullscreenManagerProxy::createModelAndInterface):
3936         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Deleted.
3937         (WebKit::WebVideoFullscreenManagerProxy::setVideoDimensions): Deleted.
3938         (WebKit::WebVideoFullscreenManagerProxy::enterFullscreen): Deleted.
3939         (WebKit::WebVideoFullscreenManagerProxy::exitFullscreen): Deleted.
3940         (WebKit::WebVideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode): Deleted.
3941         (WebKit::WebVideoFullscreenManagerProxy::cleanupFullscreen): Deleted.
3942         (WebKit::WebVideoFullscreenManagerProxy::preparedToReturnToInline): Deleted.
3943         (WebKit::WebVideoFullscreenManagerProxy::requestFullscreenMode): Deleted.
3944         (WebKit::WebVideoFullscreenManagerProxy::didSetupFullscreen): Deleted.
3945         (WebKit::WebVideoFullscreenManagerProxy::didExitFullscreen): Deleted.
3946         (WebKit::WebVideoFullscreenManagerProxy::didEnterFullscreen): Deleted.
3947         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): Deleted.
3948         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame): Deleted.
3949         * UIProcess/WebPageProxy.cpp:
3950         (WebKit::WebPageProxy::WebPageProxy):
3951         (WebKit::WebPageProxy::reattachToWebProcess):
3952         (WebKit::WebPageProxy::playbackSessionManager):
3953         (WebKit::WebPageProxy::videoFullscreenManager):
3954         (WebKit::WebPageProxy::resetState):
3955         (WebKit::WebPageProxy::hasActiveVideoForControlsManager):
3956         (WebKit::WebPageProxy::isPlayingMediaDidChange): Deleted.
3957         * UIProcess/WebPageProxy.h:
3958         * WebKit2.xcodeproj/project.pbxproj:
3959         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3960         (WebKit::WebChromeClient::supportsVideoFullscreen):
3961         (WebKit::WebChromeClient::setUpPlaybackControlsManager):
3962         (WebKit::WebChromeClient::clearPlaybackControlsManager):
3963         (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement):
3964         (WebKit::WebChromeClient::exitVideoFullscreenForVideoElement):
3965         (WebKit::WebChromeClient::exitVideoFullscreenToModeWithoutAnimation):
3966         * WebProcess/WebCoreSupport/WebChromeClient.h:
3967         * WebProcess/WebPage/WebPage.cpp:
3968         (WebKit::WebPage::playbackSessionManager):
3969         (WebKit::WebPage::videoFullscreenManager):
3970         * WebProcess/WebPage/WebPage.h:
3971         * WebProcess/cocoa/WebPlaybackSessionManager.h: Copied from Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.h.
3972         (WebKit::WebPlaybackSessionInterfaceContext::create):
3973         (WebKit::WebPlaybackSessionInterfaceContext::invalidate):
3974         * WebProcess/cocoa/WebPlaybackSessionManager.messages.in: Added.
3975         * WebProcess/cocoa/WebPlaybackSessionManager.mm: Added.
3976         (WebKit::nextContextId):
3977         (WebKit::WebPlaybackSessionInterfaceContext::WebPlaybackSessionInterfaceContext):
3978         (WebKit::WebPlaybackSessionInterfaceContext::~WebPlaybackSessionInterfaceContext):
3979         (WebKit::WebPlaybackSessionInterfaceContext::resetMediaState):
3980         (WebKit::WebPlaybackSessionInterfaceContext::setDuration):
3981         (WebKit::WebPlaybackSessionInterfaceContext::setCurrentTime):
3982         (WebKit::WebPlaybackSessionInterfaceContext::setBufferedTime):
3983         (WebKit::WebPlaybackSessionInterfaceContext::setRate):
3984         (WebKit::WebPlaybackSessionInterfaceContext::setSeekableRanges):
3985         (WebKit::WebPlaybackSessionInterfaceContext::setCanPlayFastReverse):
3986         (WebKit::WebPlaybackSessionInterfaceContext::setAudioMediaSelectionOptions):
3987         (WebKit::WebPlaybackSessionInterfaceContext::setLegibleMediaSelectionOptions):
3988         (WebKit::WebPlaybackSessionInterfaceContext::setExternalPlayback):
3989         (WebKit::WebPlaybackSessionInterfaceContext::setWirelessVideoPlaybackDisabled):
3990         (WebKit::WebPlaybackSessionManager::create):
3991         (WebKit::WebPlaybackSessionManager::WebPlaybackSessionManager):
3992         (WebKit::WebPlaybackSessionManager::~WebPlaybackSessionManager):
3993         (WebKit::WebPlaybackSessionManager::createModelAndInterface):
3994         (WebKit::WebPlaybackSessionManager::ensureModelAndInterface):
3995         (WebKit::WebPlaybackSessionManager::ensureModel):
3996         (WebKit::WebPlaybackSessionManager::ensureInterface):
3997         (WebKit::WebPlaybackSessionManager::removeContext):
3998         (WebKit::WebPlaybackSessionManager::addClientForContext):
3999         (WebKit::WebPlaybackSessionManager::removeClientForContext):
4000         (WebKit::WebPlaybackSessionManager::setUpPlaybackControlsManager):
4001         (WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):
4002         (WebKit::WebPlaybackSessionManager::contextIdForMediaElement):
4003         (WebKit::WebPlaybackSessionManager::resetMediaState):
4004         (WebKit::WebPlaybackSessionManager::setDuration):
4005         (WebKit::WebPlaybackSessionManager::setCurrentTime):
4006         (WebKit::WebPlaybackSessionManager::setBufferedTime):
4007         (WebKit::WebPlaybackSessionManager::setRate):
4008         (WebKit::WebPlaybackSessionManager::setSeekableRanges):
4009         (WebKit::WebPlaybackSessionManager::setCanPlayFastReverse):
4010         (WebKit::WebPlaybackSessionManager::setAudioMediaSelectionOptions):
4011         (WebKit::WebPlaybackSessionManager::setLegibleMediaSelectionOptions):
4012         (WebKit::WebPlaybackSessionManager::setExternalPlayback):
4013         (WebKit::WebPlaybackSessionManager::setWirelessVideoPlaybackDisabled):
4014         (WebKit::WebPlaybackSessionManager::play):
4015         (WebKit::WebPlaybackSessionManager::pause):
4016         (WebKit::WebPlaybackSessionManager::togglePlayState):
4017         (WebKit::WebPlaybackSessionManager::beginScrubbing):
4018         (WebKit::WebPlaybackSessionManager::endScrubbing):
4019         (WebKit::WebPlaybackSessionManager::seekToTime):
4020         (WebKit::WebPlaybackSessionManager::fastSeek):
4021         (WebKit::WebPlaybackSessionManager::beginScanningForward):
4022         (WebKit::WebPlaybackSessionManager::beginScanningBackward):
4023         (WebKit::WebPlaybackSessionManager::endScanning):
4024         (WebKit::WebPlaybackSessionManager::selectAudioMediaOption):
4025         (WebKit::WebPlaybackSessionManager::selectLegibleMediaOption):
4026         * WebProcess/cocoa/WebVideoFullscreenManager.h:
4027         (WebKit::WebVideoFullscreenInterfaceContext::create):
4028         * WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
4029         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
4030         (WebKit::WebVideoFullscreenInterfaceContext::WebVideoFullscreenInterfaceContext):
4031         (WebKit::WebVideoFullscreenInterfaceContext::resetMediaState):
4032         (WebKit::WebVideoFullscreenInterfaceContext::setDuration):
4033         (WebKit::WebVideoFullscreenInterfaceContext::setCurrentTime):
4034         (WebKit::WebVideoFullscreenInterfaceContext::setBufferedTime):
4035         (WebKit::WebVideoFullscreenInterfaceContext::setRate):
4036         (WebKit::WebVideoFullscreenInterfaceContext::setSeekableRanges):
4037         (WebKit::WebVideoFullscreenInterfaceContext::setCanPlayFastReverse):
4038         (WebKit::WebVideoFullscreenInterfaceContext::setAudioMediaSelectionOptions):
4039         (WebKit::WebVideoFullscreenInterfaceContext::setLegibleMediaSelectionOptions):
4040         (WebKit::WebVideoFullscreenInterfaceContext::setExternalPlayback):
4041         (WebKit::WebVideoFullscreenInterfaceContext::setWirelessVideoPlaybackDisabled):
4042         (WebKit::WebVideoFullscreenManager::create):
4043         (WebKit::WebVideoFullscreenManager::WebVideoFullscreenManager):
4044         (WebKit::WebVideoFullscreenManager::createModelAndInterface):
4045         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
4046         (WebKit::WebVideoFullscreenInterfaceContext::setVideoDimensions): Deleted.
4047         (WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager): Deleted.
4048         (WebKit::WebVideoFullscreenManager::ensureModelAndInterface): Deleted.
4049         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation): Deleted.
4050         (WebKit::WebVideoFullscreenManager::setVideoDimensions): Deleted.
4051         (WebKit::Web