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