f83ff35428ef85fc7fabfc0b0d457434266d40e1
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-05-06  Dan Bernstein  <mitz@apple.com>
2
3         No way to get a WKWebProcessPlugInFrame’s parent frame
4         https://bugs.webkit.org/show_bug.cgi?id=144705
5
6         Reviewed by Sam Weinig.
7
8         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
9         (-[WKWebProcessPlugInFrame _parentFrame]): Added this getter.
10         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h: Declared new
11         _parentFrame property.
12
13 2015-05-06  Timothy Horton  <timothy_horton@apple.com>
14
15         Fix the build.
16
17         * UIProcess/mac/WKViewLayoutStrategy.mm:
18         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
19
20 2015-04-02  Myles C. Maxfield  <mmaxfield@apple.com>
21
22         Introducing the Platform Abstraction Layer (PAL)
23         https://bugs.webkit.org/show_bug.cgi?id=143358
24
25         Reviewed by Simon Fraser.
26
27         * Configurations/FeatureDefines.xcconfig: Updated
28
29 2015-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
30
31         [GTK][WK2] The WebKit network disk cache is not enabled
32         https://bugs.webkit.org/show_bug.cgi?id=142821
33
34         Reviewed by Martin Robinson.
35
36         Enable NetworkCache for the GTK+ port.
37
38         * config.h:
39
40 2015-05-06  Ryuan Choi  <ryuan.choi@navercorp.com>
41
42         [EFL] Remove redudant condition in ViewClientEfl::didChangeViewportAttributes
43         https://bugs.webkit.org/show_bug.cgi?id=144672
44
45         Reviewed by Gyuyoung Kim.
46
47         ViewClientEfl::didChangeViewportAttributes is always called when fixed layout is disabled.
48
49         * UIProcess/efl/ViewClientEfl.cpp:
50         (WebKit::ViewClientEfl::didChangeViewportAttributes):
51         Removes condition that checks whether fixed layout is enabled.
52
53 2015-05-05  Alexey Proskuryakov  <ap@apple.com>
54
55         NetworkResourceLoader::cleanup() should clear ResourceHandle client pointer.
56         https://bugs.webkit.org/show_bug.cgi?id=144641
57         rdar://problem/20250960
58
59         Reviewed by David Kilzer.
60
61         * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::cleanup):
62         Clear the client pointer.
63
64         * Shared/Authentication/AuthenticationManager.cpp:
65         (WebKit::AuthenticationManager::useCredentialForChallenge):
66         (WebKit::AuthenticationManager::continueWithoutCredentialForChallenge):
67         (WebKit::AuthenticationManager::cancelChallenge):
68         (WebKit::AuthenticationManager::performDefaultHandling):
69         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue):
70         Updated comments, which were not accurate, at least on Mac.
71
72 2015-05-05  Tim Horton  <timothy_horton@apple.com>
73
74         Views get stuck with viewScale < 1 after switching from DynamicSizeWithMinimumViewSize to ViewSize
75         https://bugs.webkit.org/show_bug.cgi?id=144656
76
77         Reviewed by Dan Bernstein.
78
79         * UIProcess/mac/WKViewLayoutStrategy.mm:
80         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy willChangeLayoutStrategy]):
81         Reset the viewScale when we leave the DynamicSizeWithMinimumViewSize strategy.
82
83 2015-05-05  Tim Horton  <timothy_horton@apple.com>
84
85         Fix the build.
86
87         * Platform/mac/LayerHostingContext.mm:
88         (WebKit::LayerHostingContext::setFencePort):
89
90 2015-05-05  Tim Horton  <timothy_horton@apple.com>
91
92         Fix the build.
93
94         * UIProcess/mac/WKViewLayoutStrategy.mm:
95         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
96
97 2015-05-05  Timothy Horton  <timothy_horton@apple.com>
98
99         Add a layout mode for computing fixed layout size from a minimum size
100         https://bugs.webkit.org/show_bug.cgi?id=144610
101         <rdar://problem/19790341>
102
103         Reviewed by Simon Fraser.
104
105         Add a layout mode where WebKit determines the layout size with a set of
106         (still in flux) heuristics, trying hard to keep the page usable below a
107         particular client-defined threshold view size.
108
109         This can mean that WebKit will start scaling down the page inside the view
110         to make the whole page fit, using the viewScale mechanism.
111
112         * UIProcess/API/C/WKLayoutMode.h:
113         * UIProcess/API/Cocoa/_WKLayoutMode.h:
114         Add the new layout mode, and documentation for the two complicated ones.
115         
116         * UIProcess/API/Cocoa/WKWebView.mm:
117         (-[WKWebView _layoutMode]):
118         (-[WKWebView _setLayoutMode:]):
119         (-[WKWebView _setViewScale:]):
120         (-[WKWebView _setMinimumViewSize:]):
121         (-[WKWebView _minimumViewSize]):
122         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
123         Forward the layoutMode and viewScale parameters to WKView if we have one.
124
125         * UIProcess/API/Cocoa/WKViewPrivate.h:
126         * UIProcess/API/mac/WKView.mm:
127         (-[WKView dealloc]):
128         (-[WKView viewWillStartLiveResize]):
129         (-[WKView viewDidEndLiveResize]):
130         (-[WKView setFrameSize:]):
131         (-[WKView initWithFrame:processPool:configuration:webView:]):
132         (-[WKView disableFrameSizeUpdates]):
133         (-[WKView enableFrameSizeUpdates]):
134         (-[WKView frameSizeUpdatesDisabled]):
135         (-[WKView _layoutMode]):
136         (-[WKView _setLayoutMode:]):
137         (-[WKView _setViewScale:]):
138         (-[WKView _setMinimumViewSize:]):
139         (-[WKView _minimumViewSize]):
140         Store the minimum view size, and update the fixed layout size if needed.
141
142         (-[WKView _updateAutomaticallyComputedFixedLayoutSize]): Deleted.
143         (-[WKView _setAutomaticallyComputesFixedLayoutSizeFromViewScale:]): Deleted.
144         (-[WKView _automaticallyComputesFixedLayoutSizeFromViewScale]): Deleted.
145         Store the WKLayoutMode on the WKViewLayoutStrategy instead of having a
146         bunch of things like _automaticallyComputesFixedLayoutSizeFromViewScale.
147
148         * UIProcess/API/mac/WKViewInternal.h:
149
150         * UIProcess/mac/WKViewLayoutStrategy.h: Added.
151         * UIProcess/mac/WKViewLayoutStrategy.mm: Added.
152         (+[WKViewLayoutStrategy layoutStrategyWithPage:view:mode:]):
153         (-[WKViewLayoutStrategy initWithPage:view:mode:]):
154         (-[WKViewLayoutStrategy willDestroyView:]):
155         (-[WKViewLayoutStrategy layoutMode]):
156         (-[WKViewLayoutStrategy updateLayout]):
157         (-[WKViewLayoutStrategy disableFrameSizeUpdates]):
158         (-[WKViewLayoutStrategy enableFrameSizeUpdates]):
159         (-[WKViewLayoutStrategy frameSizeUpdatesDisabled]):
160         (-[WKViewLayoutStrategy didChangeViewScale]):
161         (-[WKViewLayoutStrategy didChangeMinimumViewSize]):
162         (-[WKViewLayoutStrategy willStartLiveResize]):
163         (-[WKViewLayoutStrategy didEndLiveResize]):
164         (-[WKViewLayoutStrategy didChangeFrameSize]):
165         (-[WKViewLayoutStrategy willChangeLayoutStrategy]):
166         (-[WKViewViewSizeLayoutStrategy initWithPage:view:mode:]):
167         (-[WKViewViewSizeLayoutStrategy updateLayout]):
168         (-[WKViewFixedSizeLayoutStrategy initWithPage:view:mode:]):
169         (-[WKViewFixedSizeLayoutStrategy updateLayout]):
170         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy initWithPage:view:mode:]):
171         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy updateLayout]):
172         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy didChangeViewScale]):
173         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy didChangeFrameSize]):
174         Move the existing layout strategies from WKView into WKViewLayoutStrategy subclasses.
175
176         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy initWithPage:view:mode:]):
177         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
178         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy didChangeMinimumViewSize]):
179         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy willStartLiveResize]):
180         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy didEndLiveResize]):
181         While in live resize with the new layout mode, disable frame size updates.
182         The new layout mode will do a live scale during part of the resize, and
183         we don't always want to send the new view size to the Web process.
184
185         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy didChangeFrameSize]):
186         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy willChangeLayoutStrategy]):
187         While in the new layout mode, maintain the viewScale as the minimum of the
188         scale required to fit the current view frame size inside the minimumViewSize.
189         If no scaling is required, carry on as usual, pushing the new view frame size
190         to the DrawingArea and on to the Web process.
191         If scaling is required, apply a transform to the view in the UI process,
192         until the live resize completes, in which case we send a fenced viewScale
193         adjustment to the Web process (so that the tiles paint at the new viewScale
194         synchronized with the removal of the transform in the UI process).
195
196         * UIProcess/WebPageProxy.cpp:
197         (WebKit::WebPageProxy::scaleViewFenced):
198         * UIProcess/WebPageProxy.h:
199         * WebProcess/WebPage/DrawingArea.h:
200         (WebKit::DrawingArea::addFence):
201         (WebKit::DrawingArea::acceleratedAnimationDidEnd): Deleted.
202         * WebProcess/WebPage/WebPage.cpp:
203         (WebKit::WebPage::scaleViewAndUpdateGeometryFenced):
204         * WebProcess/WebPage/WebPage.h:
205         * WebProcess/WebPage/WebPage.messages.in:
206         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
207         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
208         (WebKit::TiledCoreAnimationDrawingArea::addFence):
209         Add scaleViewAndUpdateGeometryFenced and the ability to install CoreAnimation fences on
210         TiledCoreAnimationDrawingArea's CAContext.
211
212         Add the ability to send updateGeometry out-of-band, so that
213         we can send it synchronously inside the message along with the CA fence.
214         We have to both change the viewScale and updateGeometry simultaneously
215         in the same CA commit that we install the fence into, in order to ensure
216         that there is no flash.
217
218 2015-05-05  Alex Christensen  <achristensen@webkit.org>
219
220         [Content Extensions] Release input NSString when finished copying it.
221         https://bugs.webkit.org/show_bug.cgi?id=144642
222
223         Reviewed by Brian Weinstein.
224
225         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
226         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
227         (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
228
229 2015-05-05  Alex Christensen  <achristensen@webkit.org>
230
231         [Content Extensions] Use less memory to store the json input.
232         https://bugs.webkit.org/show_bug.cgi?id=144604
233
234         Reviewed by Benjamin Poulain.
235
236         * UIProcess/API/APIUserContentExtensionStore.cpp:
237         (API::compiledToFile):
238         (API::UserContentExtensionStore::compileContentExtension):
239         * UIProcess/API/APIUserContentExtensionStore.h:
240         Don't copy strings as much or keep them alive after done using them.
241
242 2015-05-04  Alex Christensen  <achristensen@webkit.org>
243
244         [Content Extensions] Use less memory when writing byte code to file
245         https://bugs.webkit.org/show_bug.cgi?id=144602
246
247         Reviewed by Darin Adler.
248
249         * UIProcess/API/APIUserContentExtensionStore.cpp:
250         (API::decodeContentExtensionMetaData):
251         (API::writeDataToFile):
252         (API::compiledToFile):
253         (API::createExtension):
254         Compile and write each DFA to file, then come back and write the header when finalizing.
255         Also don't copy the DFA bytecode. This way, we don't need to keep more than one DFA's
256         bytecode in memory at a time.
257
258 2015-05-05  Sungmann Cho  <sungmann.cho@navercorp.com>
259
260         Make all FrameLoadState data members private.
261         https://bugs.webkit.org/show_bug.cgi?id=144562
262
263         Reviewed by Darin Adler.
264
265         Previously, all of the data members in FrameLoadState were public and accessed directly
266         from outside the class. But these should all be private as noted in FrameLoadState.h
267         for better encapsulation.
268
269         No new tests, no behavior change.
270
271         * UIProcess/API/C/WKFrame.cpp:
272         (WKFrameGetFrameLoadState):
273         * UIProcess/FrameLoadState.h:
274         (WebKit::FrameLoadState::state):
275         (WebKit::FrameLoadState::url):
276         (WebKit::FrameLoadState::provisionalURL):
277         (WebKit::FrameLoadState::unreachableURL):
278         * UIProcess/WebFrameProxy.h:
279         (WebKit::WebFrameProxy::url):
280         (WebKit::WebFrameProxy::provisionalURL):
281         (WebKit::WebFrameProxy::unreachableURL):
282
283 2015-05-05  Alexey Proskuryakov  <ap@apple.com>
284
285         Crashes in SandboxExtension::consumePermanently when uploading
286         https://bugs.webkit.org/show_bug.cgi?id=144611
287         rdar://problem/10156710
288
289         Reviewed by Darin Adler.
290
291         This only fixes the crashes, uploading still won't work.
292         Added null checks and some logging that may help us get to the root cause eventually.
293
294         * Shared/SandboxExtension.h:
295         (WebKit::SandboxExtension::createHandle):
296         (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
297         * Shared/mac/SandboxExtensionMac.mm:
298         (WebKit::SandboxExtension::createHandle):
299         (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
300         * UIProcess/WebPageProxy.cpp:
301         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
302         * WebProcess/WebPage/WebPage.cpp:
303         (WebKit::WebPage::extendSandboxForFileFromOpenPanel):
304
305 2015-05-05  Csaba Osztrogonác  <ossy@webkit.org>
306
307         Remove TextureMapperImageBuffer
308         https://bugs.webkit.org/show_bug.cgi?id=143561
309
310         Reviewed by Žan Doberšek.
311
312         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
313         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
314         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
315         (WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing):
316
317 2015-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
318
319         [SOUP] Network Cache: IOChannel operations are not sent to the right thread
320         https://bugs.webkit.org/show_bug.cgi?id=144542
321
322         Reviewed by Darin Adler.
323
324         We are ignoring the given WorkQueue and running the async
325         operations in the current thread. Check the given WorkQueue
326         instead and schedule the operation to the given queue. If the
327         given queue is nullptr, which means the operation should be run in
328         the main context, the operation is run directly if the current
329         context is the main one or sent to the main context using a
330         GMainLoopSource.
331
332         Fixes crashes due to asserts when running disk-cache layout tests
333         in a Debug build.
334
335         * NetworkProcess/cache/NetworkCacheIOChannel.h:
336         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
337         (WebKit::NetworkCache::runTaskInQueue):
338         (WebKit::NetworkCache::IOChannel::read):
339         (WebKit::NetworkCache::IOChannel::readSync):
340         (WebKit::NetworkCache::IOChannel::write):
341
342 2015-05-04  Dan Bernstein  <mitz@apple.com>
343
344         WebKit always goes through LaunchServices for main frame navigation actions
345         https://bugs.webkit.org/show_bug.cgi?id=144608
346
347         Reviewed by Tim Horton.
348
349         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Defined
350         _WKNavigationActionPolicyAllowWithoutTryingAppLink.
351         * UIProcess/Cocoa/NavigationState.mm:
352         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): If the policy
353         is _WKNavigationActionPolicyAllowWithoutTryingAppLink, don’t go through tryAppLink.
354
355 2015-05-04  Enrica Casucci  <enrica@apple.com>
356
357         [iOS WK2] editorState should include information about selection clipping rectangle.
358         https://bugs.webkit.org/show_bug.cgi?id=144603
359         rdar://problem/20521252
360
361         Reviewed by Chris Dumez.
362
363         Adding selectionClipRect to the post-layout portion of EditorState.
364         This way we can compute the selection clipping rectangle based on
365         up-to-date information instead of using the rectangle provided when
366         then element was first focused.
367
368         * Shared/EditorState.cpp:
369         (WebKit::EditorState::PostLayoutData::encode):
370         (WebKit::EditorState::PostLayoutData::decode):
371         * Shared/EditorState.h:
372         * UIProcess/ios/WKContentViewInteraction.mm:
373         (-[WKContentView _selectionClipRect]):
374         * WebProcess/WebPage/ios/WebPageIOS.mm:
375         (WebKit::WebPage::platformEditorState):
376
377 2015-05-04  Antti Koivisto  <antti@apple.com>
378
379         Network Cache: Support time based cache clearing
380         https://bugs.webkit.org/show_bug.cgi?id=144568
381         <rdar://problem/19769820>
382
383         Reviewed by Andreas Kling.
384
385         Support clearing cache entries newer than given time only.
386
387         * NetworkProcess/cache/NetworkCache.cpp:
388         (WebKit::NetworkCache::Cache::deleteDumpFile):
389         (WebKit::NetworkCache::Storage::traverse):
390
391             Also fix thread safety of traverse handler function.
392
393         (WebKit::NetworkCache::Cache::clear):
394
395             Also add completion handler to support the API properly.
396
397         * NetworkProcess/cache/NetworkCache.h:
398         * NetworkProcess/cache/NetworkCacheStorage.cpp:
399         (WebKit::NetworkCache::Storage::clear):
400         * NetworkProcess/cache/NetworkCacheStorage.h:
401         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
402         (WebKit::clearNSURLCache):
403
404             Factor to a function.
405
406         (WebKit::NetworkProcess::clearDiskCache):
407
408 2015-05-04  Zan Dobersek  <zdobersek@igalia.com>
409
410         [WTF] Remove Functional.h inclusions
411         https://bugs.webkit.org/show_bug.cgi?id=144400
412
413         Reviewed by Darin Adler.
414
415         Remove unnecessary inclusions of the <wtf/Functional.h> header in WebKit2.
416
417         * Platform/IPC/unix/ConnectionUnix.cpp:
418         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: Import the <objc/runtime.h>
419         header that was previously indirectly included through the Functional.h header.
420         * WebProcess/WebPage/DrawingArea.cpp:
421
422 2015-05-04  Csaba Osztrogonác  <ossy@webkit.org>
423
424         [ARM] Don't compare unsigned chars to EOF (-1)
425         https://bugs.webkit.org/show_bug.cgi?id=144439
426
427         Reviewed by Geoffrey Garen.
428
429         * Shared/linux/WebMemorySamplerLinux.cpp:
430         (WebKit::nextToken): Don't cast return value of fgetc() to char.
431
432 2015-05-04  Antti Koivisto  <antti@apple.com>
433
434         Remove NetworkResourceLoadScheduler
435         https://bugs.webkit.org/show_bug.cgi?id=144550
436
437         Reviewed by Sam Weinig.
438
439         It doesn't really do anything.
440
441         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
442         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
443         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
444         * NetworkProcess/NetworkProcess.cpp:
445         (WebKit::NetworkProcess::getNetworkProcessStatistics):
446         * NetworkProcess/NetworkProcess.h:
447         (WebKit::NetworkProcess::networkResourceLoadScheduler): Deleted.
448         * NetworkProcess/NetworkResourceLoadScheduler.cpp: Removed.
449         * NetworkProcess/NetworkResourceLoadScheduler.h: Removed.
450         * NetworkProcess/NetworkResourceLoader.cpp:
451         (WebKit::NetworkResourceLoader::cleanup):
452         * NetworkProcess/NetworkResourceLoader.h:
453         (WebKit::NetworkResourceLoader::create):
454         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
455         (WebKit::initializeNetworkSettings):
456
457             Moved from NetworkResourceLoadSchedulerMac.mm.
458
459         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
460         * NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm: Removed.
461         * NetworkProcess/soup/NetworkResourceLoadSchedulerSoup.cpp: Removed.
462         * WebKit2.xcodeproj/project.pbxproj:
463
464 2015-05-03  Alexey Proskuryakov  <ap@apple.com>
465
466         Crash in SandboxExtension::consume when uploading iWork -tef documents to iCloud
467         https://bugs.webkit.org/show_bug.cgi?id=144509
468         rdar://problem/18731910
469
470         Reviewed by Daniel Bates.
471
472         No test, because testRunner.beginDragWithFiles doesn't work in WKTR, and making
473         it work is hard.
474
475         * Shared/BlobDataFileReferenceWithSandboxExtension.cpp:
476         (WebKit::BlobDataFileReferenceWithSandboxExtension::prepareForFileAccess):
477         (WebKit::BlobDataFileReferenceWithSandboxExtension::revokeFileAccess):
478
479 2015-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
480
481         [GTK][EFL] Unify platform display handling
482         https://bugs.webkit.org/show_bug.cgi?id=144517
483
484         Reviewed by Martin Robinson.
485
486         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
487         (webkitWebViewBaseRealize): Use PlatformDisplay::sharedDisplay()
488         to checkt the display type.
489         (webkitWebViewBaseCreateWebPage): Ditto.
490         * UIProcess/cairo/BackingStoreCairo.cpp:
491         (WebKit::BackingStore::createBackend): Pass the native X11 shared
492         display to BackingStoreBackendCairoX11.
493         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
494         (WebKit::NetscapePlugin::x11HostDisplay): Return the native X11
495         shared display.
496
497 2015-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
498
499         Unreviewed. Fix Debug build with NETWORK_CACHE enabled and CACHE_PARTITIONING disabled.
500
501         * NetworkProcess/cache/NetworkCache.cpp:
502         (WebKit::NetworkCache::Cache::store):
503
504 2015-05-01  Dan Bernstein  <mitz@apple.com>
505
506         WebKit2 part of <rdar://problem/8636045> Back/forward navigation to an error page in Safari breaks the back-forward list
507         https://bugs.webkit.org/show_bug.cgi?id=144501
508
509         Reviewed by Darin Adler.
510
511         * UIProcess/WebPageProxy.cpp:
512         (WebKit::WebPageProxy::loadAlternateHTMLString): If this is called during
513         didFailProvisionalLoadForFrame, send back the provisional URL captured at the time of
514         failure.
515         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame): Get the provisioinal URL and keep
516         it in new member variable m_failingProvisionalLoadURL for the duration of the client’s
517         handling of this message.
518         * UIProcess/WebPageProxy.h:
519
520         * UIProcess/WebPageProxy.messages.in: Added provisionalURL parameter to
521         DidFailProvisionalLoadForFrame.
522
523         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
524         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad): Send the URL for this error
525         to the UI process.
526
527         * WebProcess/WebPage/WebPage.cpp:
528         (WebKit::WebPage::loadAlternateHTMLString): Temporarily restore the loader’s state to
529         reflect the provisional load error being handled.
530
531         * WebProcess/WebPage/WebPage.h:
532         * WebProcess/WebPage/WebPage.messages.in: Added provisionalLoadErrorURL parameter to
533         LoadAlternateHTMLString.
534
535 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
536
537         USE(...) macro should expect unprefixed variables
538         https://bugs.webkit.org/show_bug.cgi?id=144454
539
540         Reviewed by Daniel Bates.
541
542         * Shared/API/c/WKBase.h: Replace all occurrences WTF_USE with USE.
543         * WebKit2.xcodeproj/project.pbxproj: Ditto.
544
545 2015-05-01  Brady Eidson  <beidson@apple.com>
546
547         Add API to disable meta refreshes.
548         <rdar://problem/20333198> and https://bugs.webkit.org/show_bug.cgi?id=144269
549
550         Reviewed by Alexey Proskuryakov.
551
552         Add a preference to enable/disable meta refreshes, enabled by default.
553
554         * Shared/WebPreferencesDefinitions.h:
555         * UIProcess/API/C/WKPreferences.cpp:
556         (WKPreferencesSetMetaRefreshEnabled):
557         (WKPreferencesGetMetaRefreshEnabled):
558         (WKPreferencesGetIgnoreViewportScalingConstraints): Deleted.
559         * UIProcess/API/C/WKPreferencesRefPrivate.h:
560         * WebProcess/InjectedBundle/InjectedBundle.cpp:
561         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
562         * WebProcess/WebPage/WebPage.cpp:
563         (WebKit::WebPage::updatePreferences):
564
565 2015-05-01  Antti Koivisto  <antti@apple.com>
566
567         Remove network process load serialization code
568         https://bugs.webkit.org/show_bug.cgi?id=144448
569
570         Reviewed by Alexey Proskuryakov.
571
572         TestRunner.setSerializeHTTPLoads is used by a few tests but it is unnecessary
573         with network process. We don't reorder loads anyway so test results are consistent.
574         There or no other clients for this code.
575
576         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
577         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
578         (WebKit::NetworkConnectionToWebProcess::setSerialLoadingEnabled): Deleted.
579         * NetworkProcess/NetworkConnectionToWebProcess.h:
580         (WebKit::NetworkConnectionToWebProcess::isSerialLoadingEnabled): Deleted.
581         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
582         * NetworkProcess/NetworkProcess.cpp:
583         (WebKit::NetworkProcess::getNetworkProcessStatistics):
584         * NetworkProcess/NetworkResourceLoadScheduler.cpp:
585         (WebKit::NetworkResourceLoadScheduler::scheduleLoader):
586         (WebKit::NetworkResourceLoadScheduler::removeLoader):
587         (WebKit::NetworkResourceLoadScheduler::loadsPendingCount): Deleted.
588         * NetworkProcess/NetworkResourceLoadScheduler.h:
589         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
590         (WKBundleSetTabKeyCyclesThroughElements):
591         (WKBundleSetSerialLoadingEnabled): Deleted.
592         (WKBundleDispatchPendingLoadRequests): Deleted.
593         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
594         * WebProcess/InjectedBundle/InjectedBundle.cpp:
595         (WebKit::InjectedBundle::setSerialLoadingEnabled): Deleted.
596         (WebKit::InjectedBundle::dispatchPendingLoadRequests): Deleted.
597
598             Remove also this as it does nothing.
599
600         * WebProcess/Network/WebResourceLoadScheduler.cpp:
601         (WebKit::WebResourceLoadScheduler::WebResourceLoadScheduler):
602         (WebKit::WebResourceLoadScheduler::suspendPendingRequests):
603         (WebKit::WebResourceLoadScheduler::resumePendingRequests):
604
605             Remove implementation, it does nothing.
606
607         (WebKit::WebResourceLoadScheduler::setSerialLoadingEnabled):
608         * WebProcess/Network/WebResourceLoadScheduler.h:
609
610 2015-04-30  Timothy Horton  <timothy_horton@apple.com>
611
612         Remove long-deprecated unused WKView minimumLayoutWidth properties
613         https://bugs.webkit.org/show_bug.cgi?id=144480
614
615         Reviewed by Alexey Proskuryakov.
616
617         * UIProcess/API/Cocoa/WKViewPrivate.h:
618         * UIProcess/API/mac/WKView.mm:
619         (-[WKView minimumLayoutWidth]): Deleted.
620         (-[WKView setMinimumLayoutWidth:]): Deleted.
621         (-[WKView minimumWidthForAutoLayout]): Deleted.
622         (-[WKView setMinimumWidthForAutoLayout:]): Deleted.
623         These were replaced with minimumSizeForAutoLayout long ago.
624
625 2015-04-30  Simon Fraser  <simon.fraser@apple.com>
626
627         Fixed elements end up in the middle of the view with pageScale < 1
628         https://bugs.webkit.org/show_bug.cgi?id=144428
629         rdar://problem/20404982
630
631         Reviewed by Tim Horton.
632
633         Encode/decode fixedElementsLayoutRelativeToFrame.
634
635         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
636         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
637         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
638
639 2015-04-30  Tim Horton  <timothy_horton@apple.com>
640
641         Asynchronous (or timed-out synchronous) resize flashes white instead of page background color
642         https://bugs.webkit.org/show_bug.cgi?id=144468
643
644         Reviewed by Simon Fraser and Dan Bernstein.
645
646         * UIProcess/API/mac/WKView.mm:
647         (-[WKView _viewBackgroundColor]):
648         (-[WKView updateLayer]):
649         Use the pageExtendedBackgroundColor for the background color of the WKView,
650         if we have one (and aren't using a transparent background). This means
651         during asynchronous resize or other cases where the Web process isn't keeping
652         up with the UI process during a resize, we'll see background color instead of white.
653
654 2015-04-30  Beth Dakin  <bdakin@apple.com>
655
656         Should choose UIScrollView indicatorStyle based on the document background color
657         https://bugs.webkit.org/show_bug.cgi?id=144473
658         -and corresponding-
659         rdar://problem/19897699
660
661         Reviewed by Simon Fraser.
662
663         Update the indicator style whenever the background color changes.  
664         * UIProcess/API/Cocoa/WKWebView.mm:
665         (-[WKWebView _updateScrollViewBackground]):
666
667 2015-04-30  Enrica Casucci  <enrica@apple.com>
668
669         [iOS] tapping in the middle of a word in editable content should not select the word.
670         https://bugs.webkit.org/show_bug.cgi?id=144421
671         rdar://problem/20710948
672
673         Reviewed by Tim Horton.
674
675         Reverting to the original behavior.
676
677         * WebProcess/WebPage/ios/WebPageIOS.mm:
678         (WebKit::WebPage::selectWithGesture):
679
680 2015-04-29  Hunseop Jeong  <hs85.jeong@samsung.com>
681
682         Fix the EFL build after r183595
683         https://bugs.webkit.org/show_bug.cgi?id=144427
684
685         Reviewed by Gyuyoung Kim.
686
687         updateWheelEventTestTriggersIfNeeded() is guarded by #if ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING).
688
689         * WebProcess/WebPage/EventDispatcher.cpp:
690         (WebKit::updateWheelEventTestTriggersIfNeeded):
691
692 2015-04-29  Brent Fulgham  <bfulgham@apple.com>
693
694         Expand test infrastructure to support scrolling tests
695         https://bugs.webkit.org/show_bug.cgi?id=143684
696         <rdar://problem/20375516>
697
698         Reviewed by Simon Fraser.
699
700         Update test programs to activate (and deactivate) the new WheelEventTestTrigger logic.
701
702         * UIProcess/API/C/WKPage.cpp:
703         (WKPageClearWheelEventTestTriggers): Added.
704         * UIProcess/API/C/WKPage.h:
705         * UIProcess/WebPageProxy.cpp:
706         (WebKit::WebPageProxy::clearWheelEventTestTrigger): Added.
707         * UIProcess/WebPageProxy.h:
708         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
709         (WKBundlePageStartMonitoringScrollOperations): Interact with WheelEventTestTrigger through
710         the Page, rather than MainFrame.
711         (WKBundlePageRegisterScrollOperationCompletionCallback): Ditto.
712         * WebProcess/Plugins/PDF/PDFPlugin.mm:
713         (WebKit::PDFPlugin::createScrollbar): Make sure scroll animator knows about any
714         active test triggers.
715         * WebPage/EventDispatcher.mm:
716         (WebKit::EventDispatcher::wheelEvent): If the wheel event was passed to the scrolling thread,
717         defer tests until a Scrolling Thread Sync has occurred.
718         * WebPage/WebPage.cpp:
719         (WebKit::WebPage::clearWheelEventTestTrigger): Added.
720         * WebPage/WebPage.h:
721         * WebPage/WebPage.message.in: Added ClearWheelEventTestTrigger message.
722
723 2015-04-29  Enrica Casucci  <enrica@apple.com>
724
725         Adding the ability to move selection by granularity on iOS.
726         https://bugs.webkit.org/show_bug.cgi?id=144410
727         rdar://problem/19213337
728
729         Reviewed by Benjamin Poulain.
730
731         This patch also correctly sets _usingGestureForSelection for all
732         the functions that change the selection with a gesture.
733         This way we make sure that the selection drawing is not delayed
734         until the next time we paint.
735
736         * UIProcess/WebPageProxy.h:
737         * UIProcess/ios/WKContentViewInteraction.mm:
738         (-[WKContentView moveSelectionAtBoundary:inDirection:completionHandler:]):
739         * UIProcess/ios/WebPageProxyIOS.mm:
740         (WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
741         * WebProcess/WebPage/WebPage.h:
742         * WebProcess/WebPage/WebPage.messages.in:
743         * WebProcess/WebPage/ios/WebPageIOS.mm:
744         (WebKit::WebPage::moveSelectionAtBoundaryWithDirection):
745
746 2015-04-29  Tim Horton  <timothy_horton@apple.com>
747
748         UI process sometimes crashes under _takeViewSnapshot when the window is off-screen
749         https://bugs.webkit.org/show_bug.cgi?id=144418
750         <rdar://problem/20740278>
751
752         Reviewed by Alexey Proskuryakov.
753
754         * UIProcess/API/mac/WKView.mm:
755         (-[WKView _takeViewSnapshot]):
756         Null-check the array before checking if it has any items.
757         If the window is off-screen, we can't snapshot it.
758
759 2015-04-29  Simon Fraser  <simon.fraser@apple.com>
760
761         Allow testing of plug-ins that handle wheel events.
762         https://bugs.webkit.org/show_bug.cgi?id=144413
763
764         Reviewed by Tim Horton.
765         
766         Allow the Test Netscape Plug-in to pretend to handle wheel events,
767         so layout tests can use it.
768
769         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
770         (WebKit::NetscapePluginModule::determineQuirks):
771
772 2015-04-29  Filip Pizlo  <fpizlo@apple.com>
773
774         JSTypeInfo should have an inline type flag to indicate if getCallData() has been overridden
775         https://bugs.webkit.org/show_bug.cgi?id=144397
776
777         Reviewed by Andreas Kling.
778
779         If you override getCallData() and you want to be called a "function", then you need to use the
780         new TypeOfShouldCallGetCallData flag.
781
782         * WebProcess/Plugins/Netscape/JSNPObject.h:
783
784 2015-04-29  Antti Koivisto  <antti@apple.com>
785
786         ResourceLoadPriority should be enum class
787         https://bugs.webkit.org/show_bug.cgi?id=144326
788
789         Reviewed by Darin Adler.
790
791         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
792         (WebKit::NetworkConnectionToWebProcess::servePendingRequests): Deleted.
793
794             Remove this unused message.
795
796         * NetworkProcess/NetworkConnectionToWebProcess.h:
797         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
798         * NetworkProcess/cache/NetworkCache.cpp:
799         (WebKit::NetworkCache::makeStoreDecision):
800         (WebKit::NetworkCache::Cache::retrieve):
801         * NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm:
802         (WebKit::NetworkResourceLoadScheduler::platformInitializeNetworkSettings):
803         * WebProcess/Network/WebResourceLoadScheduler.cpp:
804         (WebKit::WebResourceLoadScheduler::servePendingRequests):
805         * WebProcess/Network/WebResourceLoadScheduler.h:
806
807 2015-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
808
809         [OS X] Use CTFontCreateForCSS instead of doing font search ourselves
810         https://bugs.webkit.org/show_bug.cgi?id=132159
811
812         Reviewed by Darin Adler.
813
814         Add SPI to set the font whitelist.
815
816         * Shared/WebProcessCreationParameters.cpp:
817         (WebKit::WebProcessCreationParameters::encode):
818         (WebKit::WebProcessCreationParameters::decode):
819         * Shared/WebProcessCreationParameters.h:
820         * UIProcess/API/C/WKContext.cpp:
821         (WKContextSetFontWhitelist):
822         * UIProcess/API/C/WKContextPrivate.h:
823         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
824         (WebKit::WebProcessPool::platformInitializeWebProcess):
825         * UIProcess/WebProcessPool.cpp:
826         (WebKit::WebProcessPool::setFontWhitelist):
827         * UIProcess/WebProcessPool.h:
828         * WebProcess/cocoa/WebProcessCocoa.mm:
829         (WebKit::WebProcess::platformInitializeWebProcess):
830
831 2015-04-29  Martin Robinson  <mrobinson@igalia.com>
832
833         [CMake] [GTK] Organize and clean up unused CMake variables
834         https://bugs.webkit.org/show_bug.cgi?id=144364
835
836         Reviewed by Gyuyoung Kim.
837
838         * PlatformGTK.cmake: Add variables specific to this project.
839         * webkit2gtk-web-extension.pc.in: Hardcode the GTK+ API version. It rarely changes.
840         * webkit2gtk.pc.in: Ditto.
841
842 2015-04-29  Carlos Garcia Campos  <cgarcia@igalia.com>
843
844         REGRESSION(r182573): [GTK] The default context menu contains an empty item since r182573
845         https://bugs.webkit.org/show_bug.cgi?id=144388
846
847         Reviewed by Brady Eidson.
848
849         Move the WebContextMenuClient::shareMenuItem() implementation to
850         platform files, since platforms not supporting share menu item
851         should return a null ContextMenuIem instead.
852
853         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
854         (WebKit::WebContextMenuClient::shareMenuItem): Deleted.
855         * WebProcess/WebCoreSupport/efl/WebContextMenuClientEfl.cpp:
856         (WebKit::WebContextMenuClient::shareMenuItem):
857         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
858         (WebKit::WebContextMenuClient::shareMenuItem):
859         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
860         (WebKit::WebContextMenuClient::shareMenuItem):
861
862 2015-04-29  Carlos Garcia Campos  <cgarcia@igalia.com>
863
864         REGRESSION(r183467): [SOUP] isMainResource is no longer passed as resource load parameters to the network process
865         https://bugs.webkit.org/show_bug.cgi?id=144381
866
867         Reviewed by Darin Adler.
868
869         A requester enum value is passed now as part of the
870         ResourceRequest, but it's not encoded/decoded for soup.
871
872         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
873         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData): Encode requester.
874         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData): Decode requester.
875
876 2015-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
877
878         [SOUP] Use xattrs to get/set the creation time of disk cache files
879         https://bugs.webkit.org/show_bug.cgi?id=144251
880
881         Reviewed by Martin Robinson.
882
883         The network process disk cache uses the creation time to compute a
884         worth value used to determine the order in which cached resources
885         are deleted when the cache is shrunk. In some operating systems
886         like Linux there's no st_birthtime in struct stat, but since cache
887         files are always created and deleted by us, we could use a custom
888         xattr to store and retrieve the creation time of cached resources.
889
890         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
891         (WebKit::NetworkCache::fileTimes):
892         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
893         (WebKit::NetworkCache::IOChannel::IOChannel):
894
895 2015-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
896
897         Network Cache: Do not create a SharedBuffer for mapped resources unless explicitly requested
898         https://bugs.webkit.org/show_bug.cgi?id=144337
899
900         Reviewed by Antti Koivisto.
901
902         We send a buffer or a memory mapped handler to the web process
903         depending on whether the resource body is mapped or not, but we
904         are always creating a shared buffer even for mapped resources.
905         Split initializeBufferFromStorageRecord() moving the mapped memory
906         handler initialization to its own method.
907
908         * NetworkProcess/cache/NetworkCacheEntry.cpp:
909         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord):
910         Initialize the mapped memory handler if the body data is mapped.
911         (WebKit::NetworkCache::Entry::initializeBufferFromStorageRecord):
912         Initialize the buffer by wrapping the mapped memory if the body
913         data is mapped, or using the body data directly otherwise.
914         (WebKit::NetworkCache::Entry::shareableResourceHandle): Call
915         initializeShareableResourceHandleFromStorageRecord() if the
916         handler is null.
917         * NetworkProcess/cache/NetworkCacheEntry.h:
918
919 2015-04-28  Simon Fraser  <simon.fraser@apple.com>
920
921         Make a non-static version of FrameView::yPositionForRootContentLayer()
922         https://bugs.webkit.org/show_bug.cgi?id=144375
923
924         Reviewed by Andy Estes.
925
926         There were two calls to the static FrameView::yPositionForRootContentLayer()
927         which passed in all the arguments for the same FrameView. Make a member
928         function for convenience.
929
930         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
931         (WebKit::shadowLayerPositionForFrame):
932
933 2015-04-28  Ryuan Choi  <ryuan.choi@navercorp.com>
934
935         [CoordinatedGraphics] Merge TILED_BACKING_STORE guard with COORDINATED_GRAPHICS
936         https://bugs.webkit.org/show_bug.cgi?id=143001
937
938         Reviewed by Gyuyoung Kim.
939
940         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
941         (WebKit::CoordinatedLayerTreeHostProxy::commitCoordinatedGraphicsState):
942         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
943         (WebKit::WebChromeClient::dispatchViewportPropertiesDidChange):
944         * WebProcess/WebCoreSupport/WebChromeClient.h:
945         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
946         (WebKit::WebFrameLoaderClient::dispatchDidLayout):
947         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
948         * WebProcess/WebPage/WebPage.cpp:
949         (WebKit::WebPage::setSize):
950         (WebKit::WebPage::setUseFixedLayout):
951         (WebKit::WebPage::canHandleUserEvents):
952         * WebProcess/WebPage/WebPage.h:
953
954 2015-04-28  Timothy Horton  <timothy_horton@apple.com>
955
956         [TextIndicator] Yellow highlight takes too long to fade out on scroll
957         https://bugs.webkit.org/show_bug.cgi?id=144358
958         <rdar://problem/19451011>
959
960         Reviewed by Beth Dakin.
961
962         * UIProcess/API/Cocoa/WKViewPrivate.h:
963         * UIProcess/API/mac/WKView.mm:
964         (-[WKView renewGState]):
965         (-[WKView viewDidMoveToWindow]):
966         (-[WKView _dictionaryLookupPopoverWillClose:]):
967         (-[WKView _setTextIndicator:]):
968         (-[WKView _setTextIndicator:withLifetime:]):
969         (-[WKView _clearTextIndicatorWithAnimation:]):
970         (-[WKView magnifyWithEvent:]):
971         (-[WKView smartMagnifyWithEvent:]):
972         (-[WKView setMagnification:centeredAtPoint:]):
973         (-[WKView setMagnification:]):
974         (-[WKView _dismissContentRelativeChildWindows]):
975         (-[WKView _dismissContentRelativeChildWindowsWithAnimation:]):
976         (-[WKView _setTextIndicator:fadeOut:]): Deleted.
977         * UIProcess/API/mac/WKViewInternal.h:
978         * UIProcess/PageClient.h:
979         * UIProcess/WebPageProxy.cpp:
980         (WebKit::WebPageProxy::pageDidScroll):
981         (WebKit::WebPageProxy::setTextIndicator):
982         (WebKit::WebPageProxy::clearTextIndicator):
983         * UIProcess/WebPageProxy.h:
984         * UIProcess/WebPageProxy.messages.in:
985         * UIProcess/ios/PageClientImplIOS.h:
986         * UIProcess/ios/PageClientImplIOS.mm:
987         (WebKit::PageClientImpl::setTextIndicator):
988         (WebKit::PageClientImpl::clearTextIndicator):
989         * UIProcess/mac/PageClientImpl.h:
990         * UIProcess/mac/PageClientImpl.mm:
991         (WebKit::PageClientImpl::setTextIndicator):
992         (WebKit::PageClientImpl::clearTextIndicator):
993         (WebKit::PageClientImpl::didPerformDictionaryLookup):
994         (WebKit::PageClientImpl::dismissContentRelativeChildWindows):
995         * UIProcess/mac/WKActionMenuController.mm:
996         (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
997         * UIProcess/mac/WKImmediateActionController.mm:
998         (-[WKImmediateActionController _defaultAnimationController]):
999         (-[WKImmediateActionController _animationControllerForDataDetectedText]):
1000         (-[WKImmediateActionController _animationControllerForDataDetectedLink]):
1001         (-[WKImmediateActionController _animationControllerForText]):
1002         * WebProcess/WebPage/FindController.cpp:
1003         (WebKit::FindController::updateFindIndicator):
1004         Make _setTextIndicator take a reference.
1005         Add a variant of _setTextIndicator that takes a Lifetime.
1006         Make _clearTextIndicatorWithAnimation take a DismissalAnimation.
1007         Make dismissContentRelativeChildWindows take a parameter indicating
1008         whether the dismissal should include animation or not (currently
1009         only applies to TextIndicator).
1010         Don't animate when dismissal occurs because of scrolling, zooming,
1011         or other things in which the content will have changed significantly
1012         underneath the indicator and shouldn't have a slowly-fading-out yellow highlight.
1013
1014 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
1015
1016         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
1017         https://bugs.webkit.org/show_bug.cgi?id=144304
1018
1019         Reviewed by Geoffrey Garen.
1020
1021         Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default.
1022
1023         * Configurations/FeatureDefines.xcconfig:
1024
1025 2015-04-28  Commit Queue  <commit-queue@webkit.org>
1026
1027         Unreviewed, rolling out r183514.
1028         https://bugs.webkit.org/show_bug.cgi?id=144359
1029
1030         It broke cloop test bots (Requested by mcatanzaro on #webkit).
1031
1032         Reverted changeset:
1033
1034         "Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT"
1035         https://bugs.webkit.org/show_bug.cgi?id=144304
1036         http://trac.webkit.org/changeset/183514
1037
1038 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
1039
1040         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
1041         https://bugs.webkit.org/show_bug.cgi?id=144304
1042
1043         Reviewed by Geoffrey Garen.
1044
1045         Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default.
1046
1047         * Configurations/FeatureDefines.xcconfig:
1048
1049 2015-04-28  Enrica Casucci  <enrica@apple.com>
1050
1051         Add support for lookup on iOS.
1052         https://bugs.webkit.org/show_bug.cgi?id=144342
1053         rdar://problem/19994090
1054
1055         Reviewed by Tim Horton.
1056
1057         * UIProcess/WebPageProxy.h:
1058         * UIProcess/ios/WKContentViewInteraction.mm:
1059         (-[WKContentView _lookup:]):
1060         (-[WKContentView canPerformAction:withSender:]):
1061         * UIProcess/ios/WebPageProxyIOS.mm:
1062         (WebKit::WebPageProxy::getLookupContextAtPoint):
1063         * WebProcess/WebPage/WebPage.h:
1064         * WebProcess/WebPage/WebPage.messages.in:
1065         * WebProcess/WebPage/ios/WebPageIOS.mm:
1066         (WebKit::WebPage::getLookupContextAtPoint):
1067
1068 2015-04-28  Brady Eidson  <beidson@apple.com>
1069
1070         Consolidate most "frame load" arguments into FrameLoadRequest.
1071         https://bugs.webkit.org/show_bug.cgi?id=144276
1072
1073         Reviewed by Alexey Proskuryakov.
1074
1075         * WebProcess/Plugins/PluginView.cpp:
1076         (WebKit::PluginView::loadURL):
1077         
1078         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1079         (WebKit::WebFrameLoaderClient::dispatchCreatePage):
1080         
1081         * WebProcess/WebPage/WebInspector.cpp:
1082         (WebKit::WebInspector::openInNewTab):
1083
1084 2015-04-28  Chris Dumez  <cdumez@apple.com>
1085
1086         [WK2][Mac] Update WebContent process' sandbox profile for AWD
1087         https://bugs.webkit.org/show_bug.cgi?id=144315
1088         <rdar://problem/20719293>
1089
1090         Reviewed by Alexey Proskuryakov.
1091
1092         Update sandbox profile for AWD similarly to what was done for iOS in
1093         r182278.
1094
1095         * WebProcess/com.apple.WebProcess.sb.in:
1096
1097 2015-04-28  Antti Koivisto  <antti@apple.com>
1098
1099         Network Cache: Disk cache getting filled by YouTube video data
1100         https://bugs.webkit.org/show_bug.cgi?id=144259
1101
1102         Reviewed by Darin Adler.
1103
1104         MSE media is loaded via XHR and tends to eventually fill the cache.
1105
1106         YouTube serves the media chunks cacheable, however they are rarely (if ever) reused.
1107         We can reduce disk writes and keep more useful resources around by not caching them
1108
1109         * NetworkProcess/NetworkResourceLoader.cpp:
1110         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
1111         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
1112         * NetworkProcess/cache/NetworkCache.cpp:
1113         (WebKit::NetworkCache::makeStoreDecision):
1114
1115             Don't store if the requester is XHR and response has video or audio content type.
1116
1117         * NetworkProcess/cache/NetworkCache.h:
1118         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1119         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
1120         * Shared/Network/NetworkResourceLoadParameters.cpp:
1121         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
1122         (WebKit::NetworkResourceLoadParameters::encode):
1123         (WebKit::NetworkResourceLoadParameters::decode):
1124         * Shared/Network/NetworkResourceLoadParameters.h:
1125
1126             The requester type is now part of the ResourceRequest, no need for separate parameter.
1127
1128         * Shared/mac/WebCoreArgumentCodersMac.mm:
1129         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
1130         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
1131         * WebProcess/Network/WebResourceLoadScheduler.cpp:
1132         (WebKit::WebResourceLoadScheduler::scheduleLoad):
1133
1134 2015-04-28  Zan Dobersek  <zdobersek@igalia.com>
1135
1136         [WK2] API::UserContentURLPattern creation functions should return Ref<>
1137         https://bugs.webkit.org/show_bug.cgi?id=144225
1138
1139         Reviewed by Darin Adler.
1140
1141         Have API::UserContentURLPattern creation functions return Ref<>.
1142         Call-sites are also updated, using and operating on the returned Ref<>
1143         object where possible.
1144
1145         * Shared/API/APIUserContentURLPattern.h:
1146         (API::UserContentURLPattern::create):
1147         * Shared/API/c/WKUserContentURLPattern.cpp:
1148         (WKUserContentURLPatternCreate):
1149
1150 2015-04-28  Zan Dobersek  <zdobersek@igalia.com>
1151
1152         [WK2] API::URLRequest, API::URLResponse creation functions should return Ref<>
1153         https://bugs.webkit.org/show_bug.cgi?id=144224
1154
1155         Reviewed by Darin Adler.
1156
1157         Have API::URLRequest and API::URLResponse creation functions return Ref<>.
1158         The call-sites are also updated, using and operating on the returned Ref<> object
1159         where possible.
1160
1161         * Shared/API/APIURLRequest.h:
1162         (API::URLRequest::create):
1163         * Shared/API/APIURLResponse.h:
1164         (API::URLResponse::create):
1165         * Shared/API/c/WKURLRequest.cpp:
1166         (WKURLRequestCreateWithWKURL):
1167         * Shared/API/c/mac/WKURLRequestNS.mm:
1168         (WKURLRequestCreateWithNSURLRequest):
1169         * Shared/API/c/mac/WKURLResponseNS.mm:
1170         (WKURLResponseCreateWithNSURLResponse):
1171         * UIProcess/API/C/WKContext.cpp:
1172         (WKContextSetDownloadClient):
1173         * UIProcess/API/C/WKDownload.cpp:
1174         (WKDownloadCopyRequest):
1175         * UIProcess/API/C/WKNavigationDataRef.cpp:
1176         (WKNavigationDataCopyOriginalRequest):
1177         * UIProcess/API/C/WKPage.cpp:
1178         (WKPageSetPagePolicyClient):
1179         (WKPageSetPageUIClient):
1180         * UIProcess/Cocoa/NavigationState.mm:
1181         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1182         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp:
1183         (WebKit::WebSoupCustomProtocolRequestManagerClient::startLoading):
1184         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
1185         (willSendRequestForFrame):
1186         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp:
1187         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNavigationAction):
1188         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNewWindowAction):
1189         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForResponse):
1190
1191 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
1192
1193         [WK2] API::Point, API::Size, API::Rect creation functions should return Ref<>
1194         https://bugs.webkit.org/show_bug.cgi?id=144223
1195
1196         Reviewed by Darin Adler.
1197
1198         Have API::Point, API::Size and API::Rect creation functions return Ref<>.
1199         Call-sites are also updated, using and operating on the returned Ref<> object
1200         where possible.
1201
1202         * Shared/API/APIGeometry.h:
1203         (API::Size::create):
1204         (API::Point::create):
1205         (API::Rect::create):
1206         * Shared/API/c/WKGeometry.cpp:
1207         (WKPointCreate):
1208         (WKSizeCreate):
1209         (WKRectCreate):
1210
1211 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
1212
1213         [WK2] API::Error creation functions should return Ref<>
1214         https://bugs.webkit.org/show_bug.cgi?id=144222
1215
1216         Reviewed by Darin Adler.
1217
1218         Have API::Error creation functions return Ref<>.
1219         The call-sites are also updated, using and operating
1220         on the returned Ref<> object where possible.
1221
1222         * Shared/API/APIError.h:
1223         (API::Error::create):
1224         * Shared/API/c/cf/WKErrorCF.cpp:
1225         (WKErrorCreateWithCFError):
1226         * UIProcess/API/C/WKOriginDataManager.cpp:
1227         (WKOriginDataManagerDeleteEntriesForOrigin):
1228         (WKOriginDataManagerDeleteEntriesModifiedBetweenDates):
1229         (WKOriginDataManagerDeleteAllEntries):
1230         * UIProcess/API/C/WKPage.cpp:
1231         (toGenericCallbackFunction):
1232         (WKPageForceRepaint):
1233         (WKPageValidateCommand):
1234         (WKPageComputePagesForPrinting):
1235         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
1236         (WKPluginSiteDataManagerClearSiteData):
1237         (WKPluginSiteDataManagerClearAllSiteData):
1238         * UIProcess/GenericCallback.h:
1239         (WebKit::toGenericCallbackFunction):
1240         * UIProcess/WebPageProxy.cpp:
1241         (WebKit::WebPageProxy::printFinishedCallback):
1242
1243 2015-04-27  Sungmann Cho  <sungmann.cho@navercorp.com>
1244
1245         [GTK] Remove unnecessary semicolon from WebKitNotificationProvider.h.
1246         https://bugs.webkit.org/show_bug.cgi?id=144312
1247
1248         Reviewed by Martin Robinson.
1249
1250         No new tests, no behavior change.
1251
1252         * UIProcess/API/gtk/WebKitNotificationProvider.h:
1253
1254 2015-04-27  Brent Fulgham  <bfulgham@apple.com>
1255
1256         PDF action menu fixes
1257         https://bugs.webkit.org/show_bug.cgi?id=144299
1258         <rdar://problem/20702215>
1259
1260         Reviewed by Tim Horton.
1261
1262         Make two corrections to how PDFs are handled:
1263         1. When calculating the view rect for the user's selection, make sure
1264         that we get coordinates for the correct PDF page. The existing code assumed
1265         that the current PDFLayerControler's current page was correct, but this will
1266         not be true if you zoom the PDF out so that several pages are displayed at
1267         once. Each selection keeps track of the page it is referenced against.
1268         
1269         2. Revise the offsets calculated for the TextIndicator to take into account
1270         the font descender (as well as the ascender), and to adjust by the scaled
1271         amount of margin around the selected text.
1272
1273         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1274         (WebKit::PDFPlugin::viewRectForSelection): Use correct page for calculating
1275         the coordinates.
1276         * WebProcess/WebPage/mac/WebPageMac.mm:
1277         (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin): Include font 'descendant'
1278         and (scaled) margin when adjusting the hit target for the TextIndicator to draw.
1279
1280 2015-04-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1281
1282         Rename WTF_USE_3D_GRAPHICS to ENABLE_GRAPHICS_CONTEXT_3D
1283         https://bugs.webkit.org/show_bug.cgi?id=144193
1284
1285         Reviewed by Darin Adler.
1286
1287         * CMakeLists.txt:
1288
1289 2015-04-24  Jon Honeycutt  <jhoneycutt@apple.com>
1290
1291         Context menus are not reshown after an orientation change
1292
1293         <https://bugs.webkit.org/show_bug.cgi?id=144143>
1294         <rdar://problem/20679931>
1295
1296         Reviewed by Darin Adler.
1297
1298         * UIProcess/ios/WKActionSheet.mm:
1299         (-[WKActionSheet updateSheetPosition]):
1300         Return early if we're still in a rotation, not if the rotation is
1301         complete.
1302
1303 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
1304
1305         [WK2] API::Dictionary creation functions should return Ref<>
1306         https://bugs.webkit.org/show_bug.cgi?id=144221
1307
1308         Reviewed by Darin Adler.
1309
1310         Have API::Dictionary creation functions return Ref<>.
1311         The call-sites are also updated, using and operating
1312         on the returned Ref<> object where possible.
1313
1314         * Shared/API/APIDictionary.cpp:
1315         (API::Dictionary::create):
1316         * Shared/API/APIDictionary.h:
1317         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
1318         (createEncodedObject):
1319         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
1320         (-[_WKRemoteObjectRegistry _sendInvocation:interface:]):
1321         * Shared/API/c/WKDictionary.cpp:
1322         (WKDictionaryCreate):
1323         * Shared/API/c/WKMutableDictionary.cpp:
1324         (WKMutableDictionaryCreate):
1325         * Shared/Plugins/Netscape/PluginInformation.cpp:
1326         (WebKit::createPluginInformationDictionary):
1327         * Shared/Plugins/Netscape/PluginInformation.h:
1328         * UIProcess/API/C/WKPage.cpp:
1329         (WKPageSetPageUIClient):
1330         * UIProcess/API/gtk/WebKitWebContext.cpp:
1331         (webkit_web_context_prefetch_dns):
1332         * UIProcess/API/gtk/WebKitWebView.cpp:
1333         (webkit_web_view_get_snapshot):
1334         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
1335         (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy):
1336         * UIProcess/Plugins/PlugInAutoStartProvider.h:
1337         * UIProcess/StatisticsRequest.cpp:
1338         (WebKit::createDictionaryFromHashMap):
1339         (WebKit::StatisticsRequest::completedRequest):
1340         * UIProcess/WebFormClient.cpp:
1341         (WebKit::WebFormClient::willSubmitForm):
1342         * UIProcess/WebPageProxy.cpp:
1343         (WebKit::WebPageProxy::didFailToInitializePlugin):
1344         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
1345         (didInitiateLoadForResource):
1346         (willSendRequestForFrame):
1347         (didReceiveResponseForResource):
1348         (didReceiveContentLengthForResource):
1349         (didFinishLoadForResource):
1350         (didFailLoadForResource):
1351         (webkitWebPageDidReceiveMessage):
1352         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
1353         (WebKit::InjectedBundlePageFormClient::willSendSubmitEvent):
1354         (WebKit::InjectedBundlePageFormClient::willSubmitForm):
1355
1356 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
1357
1358         [WK2] API::Data creation functions should return Ref<>
1359         https://bugs.webkit.org/show_bug.cgi?id=144220
1360
1361         Reviewed by Darin Adler.
1362
1363         Have API::Data creation functions return Ref<>.
1364         The call-sites are also updated, using and operating
1365         on the returned Ref<> object where possible.
1366
1367         * Shared/API/APIData.h:
1368         (API::Data::createWithoutCopying):
1369         (API::Data::create):
1370         * Shared/API/c/WKData.cpp:
1371         (WKDataCreate):
1372         * Shared/API/c/mac/WKWebArchive.cpp:
1373         (WKWebArchiveCopyData):
1374         * Shared/API/c/mac/WKWebArchiveResource.cpp:
1375         (WKWebArchiveResourceCopyData):
1376         * Shared/APIWebArchive.h:
1377         * Shared/APIWebArchive.mm:
1378         (API::WebArchive::data):
1379         * Shared/APIWebArchiveResource.h:
1380         * Shared/APIWebArchiveResource.mm:
1381         (API::WebArchiveResource::data):
1382         * Shared/Cocoa/APIDataCocoa.mm:
1383         (API::Data::createWithoutCopying):
1384         * UIProcess/API/Cocoa/WKWebView.mm:
1385         (-[WKWebView loadData:MIMEType:characterEncodingName:baseURL:]):
1386         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
1387         (webkitURISchemeRequestReadCallback):
1388         * UIProcess/API/gtk/WebKitWebView.cpp:
1389         (webkit_web_view_load_bytes):
1390         * UIProcess/Downloads/DownloadProxy.cpp:
1391         (WebKit::createData):
1392         * UIProcess/WebPageProxy.cpp:
1393         (WebKit::WebPageProxy::dataCallback):
1394         (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder):
1395
1396 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
1397
1398         [WK2] API::URL creation functions should return Ref<>
1399         https://bugs.webkit.org/show_bug.cgi?id=144219
1400
1401         Reviewed by Darin Adler.
1402
1403         Have API::URL creation functions return Ref<>.
1404         The call-sites are also updated, using and operating in the
1405         returned Ref<> object, where possible.
1406
1407         * Shared/API/APIURL.h:
1408         (API::URL::create):
1409         * Shared/API/c/WKSharedAPICast.h:
1410         (WebKit::toCopiedURLAPI):
1411         * Shared/API/c/WKURL.cpp:
1412         (WKURLCreateWithUTF8CString):
1413         (WKURLCreateWithBaseURL):
1414         * UIProcess/API/gtk/WebKitWebResource.cpp:
1415         (webkit_web_resource_get_data):
1416         * UIProcess/WebIconDatabase.cpp:
1417         (WebKit::WebIconDatabase::didChangeIconForPageURL):
1418         (WebKit::WebIconDatabase::notifyIconDataReadyForPageURL):
1419         * WebProcess/WebPage/WebPage.cpp:
1420         (WebKit::WebPage::userAgent):
1421
1422 2015-04-27  Zan Dobersek  <zdobersek@igalia.com>
1423
1424         [WK2] API::String creation functions should return Ref<>
1425         https://bugs.webkit.org/show_bug.cgi?id=144218
1426
1427         Reviewed by Darin Adler.
1428
1429         Have API::String creation functions return Ref<>.
1430         The call-sites are also updated, using and operating on the returned
1431         Ref<> object, where possible.
1432
1433         * Shared/API/APIString.h:
1434         * Shared/API/c/WKPluginInformation.cpp:
1435         (WKPluginInformationBundleIdentifierKey):
1436         (WKPluginInformationBundleVersionKey):
1437         (WKPluginInformationBundleShortVersionKey):
1438         (WKPluginInformationPathKey):
1439         (WKPluginInformationDisplayNameKey):
1440         (WKPluginInformationDefaultLoadPolicyKey):
1441         (WKPluginInformationUpdatePastLastBlockedVersionIsKnownAvailableKey):
1442         (WKPluginInformationHasSandboxProfileKey):
1443         (WKPluginInformationFrameURLKey):
1444         (WKPluginInformationMIMETypeKey):
1445         (WKPluginInformationPageURLKey):
1446         (WKPluginInformationPluginspageAttributeURLKey):
1447         (WKPluginInformationPluginURLKey):
1448         (WKPlugInInformationReplacementObscuredKey):
1449         * Shared/API/c/WKSharedAPICast.h:
1450         (WebKit::ProxyingRefPtr::ProxyingRefPtr):
1451         (WebKit::toCopiedAPI):
1452         * Shared/API/c/WKString.cpp:
1453         (WKStringCreateWithUTF8CString):
1454         (WKStringCreateWithJSString):
1455         * UIProcess/API/C/WKDatabaseManager.cpp:
1456         (WKDatabaseManagerGetOriginKey):
1457         (WKDatabaseManagerGetOriginQuotaKey):
1458         (WKDatabaseManagerGetOriginUsageKey):
1459         (WKDatabaseManagerGetDatabaseDetailsKey):
1460         (WKDatabaseManagerGetDatabaseDetailsNameKey):
1461         (WKDatabaseManagerGetDatabaseDetailsDisplayNameKey):
1462         (WKDatabaseManagerGetDatabaseDetailsExpectedUsageKey):
1463         (WKDatabaseManagerGetDatabaseDetailsCurrentUsageKey):
1464         (WKDatabaseManagerGetDatabaseDetailsCreationTimeKey):
1465         (WKDatabaseManagerGetDatabaseDetailsModificationTimeKey):
1466         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1467         (WKKeyValueStorageManagerGetOriginKey):
1468         (WKKeyValueStorageManagerGetCreationTimeKey):
1469         (WKKeyValueStorageManagerGetModificationTimeKey):
1470         * UIProcess/API/C/WKPage.cpp:
1471         (WKPageGetSessionHistoryURLValueType):
1472         (WKPageGetSessionBackForwardListItemValueType):
1473         (toGenericCallbackFunction):
1474         (WKPageValidateCommand):
1475         * UIProcess/WebProcessPool.cpp:
1476         (WebKit::WebProcessPool::didReceiveInvalidMessage):
1477
1478 2015-04-27  Brady Eidson  <beidson@apple.com>
1479
1480         Make 'enum NavigationType' be an enum class
1481         https://bugs.webkit.org/show_bug.cgi?id=144270
1482
1483         Reviewed by Alex Christensen.
1484
1485         * Shared/API/c/WKSharedAPICast.h:
1486         (WebKit::toAPI):
1487         
1488         * Shared/NavigationActionData.cpp:
1489         (WebKit::NavigationActionData::NavigationActionData):
1490         
1491         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1492         (toWKNavigationType):
1493         
1494         * UIProcess/API/gtk/WebKitPrivate.cpp:
1495         (toWebKitNavigationType):
1496         
1497         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1498         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1499         
1500         * WebProcess/WebPage/WebInspector.cpp:
1501         (WebKit::WebInspector::openInNewTab):
1502
1503 2015-04-27  Brent Fulgham  <bfulgham@apple.com>
1504
1505         REGRESSION(r182879): Images and video can no longer be downloaded
1506         https://bugs.webkit.org/show_bug.cgi?id=144267
1507         <rdar://problem/20702844>
1508
1509         Reviewed by Simon Fraser.
1510
1511         * UIProcess/mac/WKActionMenuController.mm:
1512         (-[WKActionMenuController _createActionMenuItemForTag:]): Check for
1513         "!WebCore::protocolIs(..., "file")" for image and media downloads.
1514
1515 2015-04-27  Csaba Osztrogonác  <ossy@webkit.org>
1516
1517         [EFL] TestWebKitAPI's forwarding header generator should depend on WebKit2's generator
1518         https://bugs.webkit.org/show_bug.cgi?id=143874
1519
1520         Reviewed by Gyuyoung Kim.
1521
1522         * PlatformEfl.cmake: Rename the generator to have consistent name with other generators.
1523         * Scripts/generate-forwarding-headers.pl: Removed the unnecessary multiple include-path support.
1524
1525 2015-04-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1526
1527         [SOUP] Add initial implementation of NetworkProcess disk cache
1528         https://bugs.webkit.org/show_bug.cgi?id=143872
1529
1530         Reviewed by Martin Robinson.
1531
1532         Implement the platform specific parts of the disk cache
1533         implementation for Soup. It's mainly NetworkCache::Data and
1534         NetworkCache::IOChannel.
1535
1536         * CMakeLists.txt:
1537         * NetworkProcess/cache/NetworkCache.cpp:
1538         (WebKit::NetworkCache::dumpFileChanged):
1539         (WebKit::NetworkCache::Cache::initialize):
1540         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
1541         * NetworkProcess/cache/NetworkCacheData.h:
1542         (WebKit::NetworkCache::Data::soupBuffer):
1543         * NetworkProcess/cache/NetworkCacheDataSoup.cpp: Added.
1544         (WebKit::NetworkCache::Data::Data):
1545         (WebKit::NetworkCache::Data::empty):
1546         (WebKit::NetworkCache::Data::data):
1547         (WebKit::NetworkCache::Data::isNull):
1548         (WebKit::NetworkCache::Data::apply):
1549         (WebKit::NetworkCache::Data::subrange):
1550         (WebKit::NetworkCache::concatenate):
1551         (WebKit::NetworkCache::MapWrapper::~MapWrapper):
1552         (WebKit::NetworkCache::deleteMapWrapper):
1553         (WebKit::NetworkCache::mapFile):
1554         (WebKit::NetworkCache::Data::adoptMap):
1555         (WebKit::NetworkCache::computeSHA1):
1556         (WebKit::NetworkCache::bytesEqual):
1557         * NetworkProcess/cache/NetworkCacheIOChannel.h:
1558         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: Added.
1559         (WebKit::NetworkCache::IOChannel::IOChannel):
1560         (WebKit::NetworkCache::IOChannel::open):
1561         (WebKit::NetworkCache::fillDataFromReadBuffer):
1562         (WebKit::NetworkCache::inputStreamReadReadyCallback):
1563         (WebKit::NetworkCache::IOChannel::read):
1564         (WebKit::NetworkCache::IOChannel::readSync):
1565         (WebKit::NetworkCache::outputStreamWriteReadyCallback):
1566         (WebKit::NetworkCache::IOChannel::write):
1567         * NetworkProcess/cache/NetworkCacheStorageSoup.cpp: Removed.
1568         * NetworkProcess/gtk/NetworkProcessMainGtk.cpp:
1569         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1570         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
1571         (WebKit::NetworkProcess::platformSetCacheModel):
1572         (WebKit::NetworkProcess::clearDiskCache):
1573         * PlatformGTK.cmake:
1574
1575 2015-04-26  Yusuke Suzuki  <utatane.tea@gmail.com>
1576
1577         [ES6] Implement ES6 template literals
1578         https://bugs.webkit.org/show_bug.cgi?id=142691
1579
1580         Reviewed by Darin Adler.
1581
1582         Add ENABLE_ES6_TEMPLATE_LITERAL_SYNTAX compile time flag.
1583
1584         * Configurations/FeatureDefines.xcconfig:
1585
1586 2015-04-26  Sungmann Cho  <sungmann.cho@navercorp.com>
1587
1588         Remove PluginView::renderer().
1589         https://bugs.webkit.org/show_bug.cgi?id=144216
1590
1591         Reviewed by Darin Adler.
1592
1593         Nobody should have to know about the plug-in view's renderer except the plug-in view itself.
1594
1595         No new tests, no behavior change.
1596
1597         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1598         (WebKit::PDFPlugin::convertFromScrollbarToContainingView):
1599         (WebKit::PDFPlugin::convertFromContainingViewToScrollbar):
1600         * WebProcess/Plugins/PluginView.cpp:
1601         (WebKit::PluginView::renderer): Deleted.
1602         * WebProcess/Plugins/PluginView.h:
1603
1604 2015-04-26  Doug Russell  <d_russell@apple.com>
1605
1606         AX: richer text change notifications (142719)
1607         https://bugs.webkit.org/show_bug.cgi?id=142719
1608
1609         Reviewed by Darin Adler.
1610
1611         Richer accessibility value change notifications. Introduce AXTextEditType,
1612         postTextStateChangeNotification and postTextReplacementNotification to give assistive
1613         tech apps more reliable context for responding to changes in web content. Also implement
1614         a mechanism to post value changes in password form fields in coalesced ticks to thwart
1615         analyzing the cadence of changes.
1616
1617         Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent,
1618         and an overload of postTextReplacementNotification to give assistive tech apps more
1619         reliable context for responding to changes in web content selection. Also block posting
1620         selection changes on password fields.
1621
1622         * UIProcess/WebEditCommandProxy.cpp:
1623         (WebKit::WebEditCommandProxy::nameForEditAction):
1624
1625 2015-04-26  Dan Bernstein  <mitz@apple.com>
1626
1627         <rdar://problem/20702337> REGRESSION (r182952): Plug-in service fails to load because it links against WebKit2.framework
1628         https://bugs.webkit.org/show_bug.cgi?id=144233
1629
1630         Reviewed by Simon Fraser.
1631
1632         Have the plug-in service link against WebKit.framework rather than WebKit2.framework.
1633
1634         * Configurations/PluginService.32.xcconfig: Removed linker flags for linking against WebKit2
1635         and Foundation from the definition of OTHER_LDFLAGS. Since linking is no longer conditional,
1636         we can just do it in the target’s Link Binary With Libraries build phase.
1637
1638         * Configurations/PluginService.64.xcconfig: Ditto.
1639
1640         * WebKit2.xcodeproj/project.pbxproj: Have Foundation and WebKit listed in the services’ Link
1641         Binariy With Libraries build phases (one service already had WebKit).
1642
1643 2015-04-26  Dan Bernstein  <mitz@apple.com>
1644
1645         Fixed the build.
1646
1647         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1648         (-[WKFileUploadPanel _showDocumentPickerMenu]): Suppressed deprecation warnings around use
1649         of -[UIDocumentMenuViewController _setIgnoreApplicationEntitlementForImport:].
1650
1651 2015-04-25  Tim Horton  <timothy_horton@apple.com>
1652
1653         Further update gesture swipe shadow style
1654         https://bugs.webkit.org/show_bug.cgi?id=144215
1655         <rdar://problem/19295843>
1656
1657         Reviewed by Dan Bernstein.
1658
1659         * Resources/mac/SwipeShadow.png: Removed.
1660         * Resources/mac/SwipeShadow@2x.png: Removed.
1661         * UIProcess/mac/ViewGestureController.h:
1662         * UIProcess/mac/ViewGestureControllerMac.mm:
1663         (WebKit::ViewGestureController::beginSwipeGesture):
1664         * WebKit2.xcodeproj/project.pbxproj:
1665         Use a CAGradientLayer instead of PNGs for the swipe shadow.
1666
1667 2015-04-25  Dan Bernstein  <mitz@apple.com>
1668
1669         WebKit2 part of <rdar://problem/20697966> Avoid using TBD as an argument to NS_AVAILABLE
1670         https://bugs.webkit.org/show_bug.cgi?id=144201
1671
1672         Reviewed by Darin Adler.
1673
1674         Instead of TBD, we use the high version number to which it corresponds in CFAvailability.h,
1675         9876.5.
1676
1677         * mac/MigrateHeadersFromWebKitLegacy.make: To detect not-yet-available declarations in
1678         headers, look for "9876_5" rather than "TBA".
1679
1680 2015-04-24  Timothy Hatcher  <timothy@apple.com>
1681
1682         Web Inspector: Remove native window dock controls
1683         https://bugs.webkit.org/show_bug.cgi?id=144184
1684
1685         Reviewed by Joseph Pecoraro.
1686
1687         * Resources/DockBottom.pdf: Removed.
1688         * Resources/DockBottomLegacy.pdf: Removed.
1689         * Resources/DockRight.pdf: Removed.
1690         * Resources/DockRightLegacy.pdf: Removed.
1691         * UIProcess/WebInspectorProxy.h:
1692         * UIProcess/mac/WebInspectorProxyMac.mm:
1693         (WebKit::WebInspectorProxy::createInspectorWindow):
1694         (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
1695         * WebKit2.xcodeproj/project.pbxproj:
1696
1697 2015-04-25  Martin Robinson  <mrobinson@igalia.com>
1698
1699         Rename ENABLE_3D_RENDERING to ENABLE_3D_TRANSFORMS
1700         https://bugs.webkit.org/show_bug.cgi?id=144182
1701
1702         Reviewed by Simon Fraser.
1703
1704         * Configurations/FeatureDefines.xcconfig: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
1705
1706 2015-04-24  Simon Fraser  <simon.fraser@apple.com>
1707
1708         Have the web inspector report accurate memory use for layers with detached backing store
1709         https://bugs.webkit.org/show_bug.cgi?id=144179
1710
1711         Reviewed by Dean Jackson.
1712         
1713         Remote layers can make their backing store volatile, so the backing only contributes
1714         to reported memory use when attached.
1715
1716         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1717
1718 2015-04-24  Andreas Kling  <akling@apple.com>
1719
1720         theverge.com burning 100% CPU on iPad (due to window.screenX/Y)
1721         <https://webkit.org/b/144175>
1722         <rdar://problem/20694585>
1723
1724         Reviewed by Anders Carlsson.
1725
1726         Return an empty window rect on iOS WK2 builds. This avoids sending a synchronous
1727         IPC request to the UI process that would give the same result, but spend way
1728         more time and CPU cycles to do so.
1729
1730         With this change, theverge.com CPU usage goes from 100% to ~20% when idle.
1731
1732         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1733         (WebKit::WebChromeClient::windowRect):
1734
1735 2015-04-24  Brent Fulgham  <bfulgham@apple.com>
1736
1737         TextIndicator for embedded PDFs is slightly offset
1738         https://bugs.webkit.org/show_bug.cgi?id=144172
1739         <rdar://problem/20691304>
1740
1741         Reviewed by Tim Horton.
1742
1743         When I converted the existing DOM Range logic to work with PDFSelections, I omitted the
1744         step where the font ascent was used to adjust the origin used for the TextIndicator. This
1745         patch determines the correct ascent for the range of characters in the selection, and
1746         adjusts the offset by the difference between the ascent and the height of the selection rect.
1747         
1748         Also, since the PDFSelection only supplies the bounding rect for the selection, I calculate
1749         an equivalent text bounding box by insetting the rect by half the size of the ascent.
1750
1751         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1752         (WebKit::PDFPlugin::scaleFactor): Add accessor for PDF scale factor.
1753         * WebProcess/Plugins/PDF/PDFPlugin.h:
1754         * WebProcess/WebPage/mac/WebPageMac.mm:
1755         (WebKit::WebPage::dictionaryPopupInfoForPDFSelectionInPluginView): Adjusted to take the
1756         font ascent and scale factor into account.
1757
1758 2015-04-24  David Kilzer  <ddkilzer@apple.com>
1759
1760         REGRESSION (r183293): Fix iOS EWS build by adding SPI declaration for +[UIPeripheralHost visiblePeripheralFrame]
1761
1762         Fixes the following build failures:
1763
1764             WebKit2/UIProcess/ios/WKPDFView.mm:740:45: error: class method '+visiblePeripheralFrame' not found (return type defaults to 'id') [-Werror,-Wobjc-method-access]
1765                 CGRect keyboardRect = [UIPeripheralHost visiblePeripheralFrame];
1766                                                         ^~~~~~~~~~~~~~~~~~~~~~
1767             WebKit2/UIProcess/ios/WKPDFView.mm:740:12: error: no viable conversion from 'id' to 'CGRect'
1768                 CGRect keyboardRect = [UIPeripheralHost visiblePeripheralFrame];
1769                        ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1770
1771         * Platform/spi/ios/UIKitSPI.h:
1772         (+[UIPeripheralHost visiblePeripheralFrame]): Add declaration.
1773
1774 2015-04-24  Anders Carlsson  <andersca@apple.com>
1775
1776         Change _WKWebsiteDataStore to hold on to an internal WKWebsiteDataStore
1777         https://bugs.webkit.org/show_bug.cgi?id=144171
1778
1779         Reviewed by Tim Horton.
1780
1781         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1782         (-[WKWebViewConfiguration _websiteDataStore]):
1783         (-[WKWebViewConfiguration _setWebsiteDataStore:]):
1784         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
1785         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
1786         (-[_WKWebsiteDataStore initWithDataStore:]):
1787         (+[_WKWebsiteDataStore defaultDataStore]):
1788         (+[_WKWebsiteDataStore nonPersistentDataStore]):
1789         (-[_WKWebsiteDataStore isNonPersistent]):
1790         (-[_WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
1791         (-[_WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
1792         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
1793         * UIProcess/API/Cocoa/_WKWebsiteDataStoreInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.h.
1794         * WebKit2.xcodeproj/project.pbxproj:
1795
1796 2015-04-24  Tim Horton  <timothy_horton@apple.com>
1797
1798         WKPDFView does not support password-protected PDFs
1799         https://bugs.webkit.org/show_bug.cgi?id=144162
1800         <rdar://problem/18411512>
1801
1802         Reviewed by Andy Estes.
1803
1804         * Platform/spi/ios/UIKitSPI.h:
1805         Add some SPI.
1806
1807         * UIProcess/ios/WKPDFView.h:
1808         * UIProcess/ios/WKPDFView.mm:
1809         (-[WKPDFView _didLoadPDFDocument]):
1810         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
1811         Move creation of the UIPDFDocument (only possible if the CGPDFDocument is unlocked)
1812         and initial setup of the page views out into _didLoadPDFDocument.
1813
1814         If the CGPDFDocument is locked, we'll show some UI to unlock it; otherwise
1815         we'll continue on to _didLoadPDFDocument as previously.
1816
1817         (-[WKPDFView web_setMinimumSize:]):
1818         Resize the password UI instead of the PDF pages if we have it.
1819
1820         (-[WKPDFView _computePageAndDocumentFrames]):
1821         Don't bother doing any work revalidating PDF pages if the document is locked.
1822
1823         (-[WKPDFView _updatePasswordEntryField]):
1824         Make sure that the UIDocumentPassword view is always the size of the scrollview.
1825         This takes care of rotation.
1826
1827         (-[WKPDFView _keyboardDidShow:]):
1828         Make sure that we scroll the password field around, if necessary, to keep it
1829         on screen when editing begins.
1830
1831         (-[WKPDFView _showPasswordEntryField]):
1832         (-[WKPDFView _hidePasswordEntryField]):
1833         Adjust the background color (to match the UIDocumentPasswordView) and disable zooming
1834         while it's up. The UIDocumentPassword view is installed into the scroll view
1835         to match UIWebView behavior.
1836
1837         (-[WKPDFView userDidEnterPassword:forPasswordView:]):
1838         (-[WKPDFView didBeginEditingPassword:inView:]):
1839         (-[WKPDFView didEndEditingPassword:inView:]):
1840         (-[WKPDFView _didFailToUnlock]):
1841         Pop up a dialog informing the user that they entered the wrong password.
1842
1843         (-[WKPDFView _tryToUnlockWithPassword:]):
1844         Try to unlock the document. If it succeeds, hide the unlock UI and go back to
1845         _didLoadPDFDocument.
1846
1847 2015-04-24  Commit Queue  <commit-queue@webkit.org>
1848
1849         Unreviewed, rolling out r183266.
1850         https://bugs.webkit.org/show_bug.cgi?id=144164
1851
1852         Broke 32-bit build and a test. (Requested by ap on #webkit).
1853
1854         Reverted changeset:
1855
1856         "AX: richer text change notifications (142719)"
1857         https://bugs.webkit.org/show_bug.cgi?id=142719
1858         http://trac.webkit.org/changeset/183266
1859
1860 2015-04-24  Brent Fulgham  <bfulgham@apple.com>
1861
1862         REGRESSION: WebKit2.ActionMenusTest API test fails
1863         https://bugs.webkit.org/show_bug.cgi?id=144149
1864         <rdar://problem/20677770>
1865
1866         Reviewed by Tim Horton.
1867
1868         Tested by TestWebKitAPI 
1869
1870         The 'lookupTextAtLocation' method was not converting the NSEvent coordinates it
1871         was receiving from root view to the plugin view. Consequently, full page PDFs
1872         did hit testing correctly, but an <embed> PDF would not.
1873
1874         Since 'existingSelectionContainsPoint' is exposed as API, I also modified it to
1875         expect 'root view' coordinates and perform the requisite conversions, rather
1876         than expecting 'plugin view' coordinates.
1877
1878         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1879         (WebKit::PDFPlugin::existingSelectionContainsPoint): Expect 'root view' coordinates
1880         for the input.
1881         (WebKit::PDFPlugin::lookupTextAtLocation): Properly convert the passed 'root view'
1882         coordinates to the PDF's view coordinate space.
1883         * WebProcess/WebPage/mac/WebPageMac.mm:
1884         (WebKit::WebPage::performActionMenuHitTestAtLocation): Pass hit point using view coordinates,
1885         not content coordinates.
1886
1887 2015-04-24  Anders Carlsson  <andersca@apple.com>
1888
1889         Address a review comment from Joe Pecoraro.
1890
1891         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
1892
1893 2015-04-24  Anders Carlsson  <andersca@apple.com>
1894
1895         Rename -[WKWebsiteDataStore isNonPersistent] to -[WKWebsiteDataStore isPersistent]
1896         https://bugs.webkit.org/show_bug.cgi?id=144158
1897
1898         Reviewed by Beth Dakin.
1899
1900         * UIProcess/API/APIWebsiteDataStore.cpp:
1901         (API::WebsiteDataStore::isPersistent):
1902         (API::WebsiteDataStore::isNonPersistent): Deleted.
1903         * UIProcess/API/APIWebsiteDataStore.h:
1904         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
1905         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1906         (-[WKWebsiteDataStore isPersistent]):
1907         (-[WKWebsiteDataStore isNonPersistent]): Deleted.
1908         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
1909         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
1910         (-[_WKWebsiteDataStore isNonPersistent]):
1911         * UIProcess/WebsiteData/WebsiteDataStore.h:
1912
1913 2015-04-24  Brent Fulgham  <bfulgham@apple.com>
1914
1915         Immediate action not functional for embedded PDFs
1916         https://bugs.webkit.org/show_bug.cgi?id=143952
1917         <rdar://problem/19842365>        
1918
1919         Reviewed by Tim Horton.
1920
1921         Add a new method to retrieve appropriate dictionary lookup content and update the
1922         hit test result with relevant dictionary content and the bounding rect of the
1923         selection.
1924
1925         * WebProcess/Plugins/Netscape/NetscapePlugin.h: Add stub.
1926         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: Initialize plugin type.
1927         * WebProcess/Plugins/PDF/PDFPlugin.h:
1928         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1929         (WebKit::rectInWindowSpaceForRectInLayoutSpace): New helper function to
1930         convert PDF 'in page' units to the equivalent view units.
1931         (WebKit::PDFPlugin::PDFPlugin): Initialize plugin type.
1932         (WebKit::PDFPlugin::viewRectForSelection): Query a provided PDFSelection for
1933         its bounding rect and return the result in view units.
1934         * WebProcess/Plugins/Plugin.h:
1935         * WebProcess/Plugins/PluginProxy.cpp: Initialize plugin type.
1936         * WebProcess/Plugins/PluginProxy.h: Add stub.
1937         * WebProcess/Plugins/PluginView.cpp: 
1938         (WebKit::PluginView::viewRectForSelection): Added.
1939         * WebProcess/Plugins/PluginView.h:
1940         * WebProcess/WebPage/WebPage.h:
1941         * WebProcess/WebPage/mac/WebPageMac.mm:
1942         (WebKit::WebPage::dictionaryPopupInfoForPDFSelectionInPluginView): Added.
1943         (WebKit::textIndicatorTransitionForActionMenu): Added helper function.
1944         (WebKit::WebPage::performActionMenuHitTestAtLocation): Update the hit test information
1945         with relevant dictionary lookup content, and mark the result as a text node (if
1946         appropriate).
1947
1948 2015-04-24  Jer Noble  <jer.noble@apple.com>
1949
1950         [WK2] Only issue a isPlayingAudioDidChange() notification if the audio playing state actually changed.
1951         https://bugs.webkit.org/show_bug.cgi?id=144153
1952
1953         Reviewed by Alexey Proskuryakov.
1954
1955         Check the old state vs. the new state and only issue the change notification if the IsPlayingAudio state changed.
1956
1957         * UIProcess/WebPageProxy.cpp:
1958         (WebKit::WebPageProxy::isPlayingMediaDidChange):
1959
1960 2015-04-24  Antti Koivisto  <antti@apple.com>
1961
1962         CrashTracer: [USER] com.apple.WebKit.Networking at com.apple.WebKit: WebKit::NetworkResourceLoader::~NetworkResourceLoader + 14
1963         https://bugs.webkit.org/show_bug.cgi?id=144147
1964
1965         Reviewed by Chris Dumez.
1966
1967         Storage::storeBodyAsBlob copies the std::function callback for handling mapped bodies in a thread.
1968         This is thread safe only if the function copy is thread safe. It is currently not as we are capturing
1969         RefPtr<NetworkResourceLoader> and NetworkResourceLoader doesn't use thread safe refcounting.
1970
1971         Fix by avoiding copying of the callback. Use same apporach for WriteOperation as we already use for
1972         ReadOperation: count the active operations in progress and delete WriteOperation when everything is
1973         finished. This way we don't need to copy the function out from WriteOperation.
1974
1975         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1976         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation):
1977         (WebKit::NetworkCache::Storage::WriteOperation::WriteOperation):
1978
1979             Move definition here from the header.
1980
1981         (WebKit::NetworkCache::Storage::~Storage):
1982         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
1983
1984             Increment the operation count when storing a blob, call finishWriteOperation when done.
1985
1986         (WebKit::NetworkCache::Storage::dispatchReadOperation):
1987         (WebKit::NetworkCache::Storage::finishReadOperation):
1988
1989             Count active operations instead of finished operations. This makes the code clearer.
1990
1991         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
1992         (WebKit::NetworkCache::Storage::finishWriteOperation):
1993
1994             Mirror the way ReadOperations work.
1995
1996         * NetworkProcess/cache/NetworkCacheStorage.h:
1997         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation): Deleted.
1998
1999 2015-04-24  Timothy Hatcher  <timothy@apple.com>
2000
2001         REGRESSION: Web Inspector: Start Timeline Recording in Develop menu broken
2002         https://bugs.webkit.org/show_bug.cgi?id=144150
2003
2004         Reviewed by Brian Burg.
2005
2006         * WebProcess/WebPage/WebInspectorUI.cpp:
2007         (WebKit::WebInspectorUI::evaluateCommandOnLoad): Properly treat bools as literals
2008         instead of strings by not using the string version of evaluateCommandOnLoad.
2009
2010 2015-04-23  Anders Carlsson  <andersca@apple.com>
2011
2012         Add headerdocs for WKWebsiteDataRecord and WKWebsiteDataStore
2013         https://bugs.webkit.org/show_bug.cgi?id=144138
2014
2015         Reviewed by Darin Adler.
2016
2017         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
2018         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
2019         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2020         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
2021         (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
2022         (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
2023
2024 2015-04-24  Doug Russell  <d_russell@apple.com>
2025
2026         AX: richer text change notifications (142719)
2027         https://bugs.webkit.org/show_bug.cgi?id=142719
2028
2029         Reviewed by Darin Adler.
2030
2031         Richer accessibility value change notifications. Introduce AXTextEditType, postTextStateChangeNotification and postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content. Also implement a mechanism to post value changes in password form fields in coalesced ticks to thwart analyzing the cadence of changes.
2032
2033         Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent, and an overload of postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content selection. Also block posting selection changes on password fields.
2034
2035         * UIProcess/WebEditCommandProxy.cpp:
2036         (WebKit::WebEditCommandProxy::nameForEditAction):
2037
2038 2015-04-24  Darin Adler  <darin@apple.com>
2039
2040         Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
2041         https://bugs.webkit.org/show_bug.cgi?id=128007
2042
2043         Reviewed by Anders Carlsson.
2044
2045         * NetworkProcess/cache/NetworkCacheEncoder.h: Added an include now
2046         needed that was inherited from OwnPtr.h before.
2047
2048 2015-04-24  Antti Koivisto  <antti@apple.com>
2049
2050         Network Cache: Make path functions members
2051         https://bugs.webkit.org/show_bug.cgi?id=144146
2052
2053         Reviewed by Carlos Garcia Campos.
2054
2055         This simplifies the code.
2056
2057         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2058         (WebKit::NetworkCache::Storage::partitionPathForKey):
2059         (WebKit::NetworkCache::Storage::recordPathForKey):
2060         (WebKit::NetworkCache::Storage::bodyPathForKey):
2061         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
2062         (WebKit::NetworkCache::Storage::remove):
2063         (WebKit::NetworkCache::Storage::dispatchReadOperation):
2064         (WebKit::NetworkCache::Storage::finishReadOperation):
2065         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
2066         (WebKit::NetworkCache::partitionPathForKey): Deleted.
2067         (WebKit::NetworkCache::recordPathForKey): Deleted.
2068         (WebKit::NetworkCache::bodyPathForKey): Deleted.
2069         * NetworkProcess/cache/NetworkCacheStorage.h:
2070
2071 2015-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2072
2073         Unreviewed. Remove incorrect assert after r183189.
2074
2075         In this case the assert was already there, but it's incorrect
2076         because we are handling uninitialized attachments below in the
2077         same function, and also when sending messages. So, if it's ok to
2078         send uninitialized attachments, it's ok to receive them. This
2079         didn't fail before r183189, because we were only invaliding the
2080         attachments by setting the file descriptor to -1, and they were
2081         handled as null attachments. After r183189, the move operator
2082         resets the moved attachment leaving it uninitialized again.
2083
2084         * Platform/IPC/unix/ConnectionUnix.cpp:
2085         (IPC::Connection::processMessage):
2086
2087 2015-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2088
2089         [SOUP] Use a webkit subdirectory for the disk cache
2090         https://bugs.webkit.org/show_bug.cgi?id=144048
2091
2092         Reviewed by Martin Robinson.
2093
2094         Recent versions of libsoup remove any file in cache dir not
2095         referenced by the index when the cache is loaded to workaround
2096         leaked resources when load/dump is unbalanced for whatever reason,
2097         like a crash. We currently use $XDG_CACHE_HOME/app-name as default
2098         disk cache directory, but that directory could be used by apps to
2099         cache other things, and the soup cache might end up deleting other
2100         stuff. The soup cache assumes the given directory is only for the
2101         disk cache, so we should ensure that.
2102
2103         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2104         (WebKit::NetworkProcess::platformInitializeNetworkProcess): Append
2105         webkit to the given disk cache and clear the previous soup cache if it exists.
2106         * WebProcess/soup/WebProcessSoup.cpp:
2107         (WebKit::WebProcess::platformInitializeWebProcess): Ditto.
2108
2109 2015-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2110
2111         Unreviewed. Remove incorrect ASSERT added in r183176.
2112
2113         We allow to encode null attachments.
2114
2115         * Platform/unix/SharedMemoryUnix.cpp:
2116         (WebKit::SharedMemory::Handle::releaseAttachment):
2117
2118 2015-04-23  Dan Bernstein  <mitz@apple.com>
2119
2120         <rdar://problem/20680694> Framework header postprocessing isn’t removing WK_DEPRECATED macros when it should.
2121
2122         Reviewed by Andy Estes.
2123
2124         * mac/postprocess-framework-headers.sh:
2125
2126 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
2127
2128         Make it possible to detach GraphicsLayerCA backing store
2129         https://bugs.webkit.org/show_bug.cgi?id=144140
2130
2131         Reviewed by Tim Horton.
2132         
2133         This changes makes it possible to denote a GraphicsLayerCA's backing store
2134         as "attached" or not. When not attached, the backing store is made volatile
2135         and can be purged. This will be used in a future patch.
2136
2137         * Shared/mac/RemoteLayerBackingStore.mm:
2138         (WebKit::RemoteLayerBackingStore::~RemoteLayerBackingStore): Whitespace.
2139         (WebKit::RemoteLayerBackingStore::display): If backingStoreWillBeDisplayed()
2140         returns true, this indicates that the backing store was brought out of the
2141         "unreachable" list, so return true even if the backing store doesn't require
2142         painting.
2143         * Shared/mac/RemoteLayerBackingStoreCollection.h: C++11 initializer, and comments.
2144         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
2145         (WebKit::RemoteLayerBackingStoreCollection::RemoteLayerBackingStoreCollection):
2146         (WebKit::RemoteLayerBackingStoreCollection::backingStoreWillBeDisplayed): Return true
2147         if the caller will need to submit the backing store in the current transaction.
2148         (WebKit::RemoteLayerBackingStoreCollection::backingStoreBecameUnreachable): This
2149         explicit dirtying is no longer necessary given the backingStoreWillBeDisplayed() change.
2150         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
2151         (WebKit::applyPropertiesToLayer): Only set the layer's backing if we both have backing
2152         store, and it's attached.
2153         * Shared/mac/RemoteLayerTreeTransaction.h: New bit, and data member.
2154         * Shared/mac/RemoteLayerTreeTransaction.mm:
2155         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
2156         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
2157         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
2158         (WebKit::dumpChangedLayers):
2159         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2160         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction): Only call display()
2161         on the backing store if it's attached.
2162         (WebKit::PlatformCALayerRemote::setBackingStoreAttached):
2163         (WebKit::PlatformCALayerRemote::backingStoreAttached):
2164         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2165         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
2166         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
2167         (WebKit::RemoteLayerTreeContext::backingStoreWillBeDisplayed):
2168
2169 2015-04-23  Tim Horton  <timothy_horton@apple.com>
2170
2171         Quick Look preview popover is not dismissed on scroll in Mail
2172         https://bugs.webkit.org/show_bug.cgi?id=144119
2173         <rdar://problem/19752045>
2174
2175         Reviewed by Anders Carlsson.
2176
2177         * UIProcess/API/mac/WKView.mm:
2178         (-[WKView renewGState]):
2179         If we have a TextIndicator, dismiss all content relative child windows
2180         on renewGState, not just the TextIndicator itself.
2181
2182         This will fix cases like Mail, where WebKit isn't driving the scrolling,
2183         and we have no way (except renewGState) to know that scrolling is happening.
2184
2185 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
2186
2187         Changing TiledBacking velocity should schedule a tile revalidation
2188         https://bugs.webkit.org/show_bug.cgi?id=144123
2189
2190         Reviewed by Tim Horton.
2191         
2192         Drive-by fix: use the FrameView& that we have already.
2193
2194         * WebProcess/WebPage/ios/WebPageIOS.mm:
2195         (WebKit::WebPage::updateVisibleContentRects):
2196
2197 2015-04-23  Jer Noble  <jer.noble@apple.com>
2198
2199         [Mac] Disable QTKit by default on future OS X.
2200         https://bugs.webkit.org/show_bug.cgi?id=144082
2201
2202         Reviewed by Darin Adler.
2203
2204         QTKitEnabled defaults to false.
2205
2206         * Shared/WebPreferencesDefinitions.h:
2207
2208 2015-04-23  Jer Noble  <jer.noble@apple.com>
2209
2210         [WK2][Mac] Tweak the timing curve of the WebKit Fullscreen animation
2211         https://bugs.webkit.org/show_bug.cgi?id=144120
2212
2213         Reviewed by Eric Carlson.
2214
2215         Tweak the curve to ease-in faster when the fullscreen animation duration is short.
2216
2217         * UIProcess/mac/WKFullScreenWindowController.mm:
2218         (timingFunctionForDuration):
2219         (zoomAnimation):
2220         (maskAnimation):
2221         (fadeAnimation):
2222
2223 2015-04-23  Enrica Casucci  <enrica@apple.com>
2224
2225         iOS build fix after r183208.
2226
2227         Unreviewed.
2228
2229         * UIProcess/ios/WKContentViewInteraction.mm:
2230
2231 2015-04-22  Alexey Proskuryakov  <ap@apple.com>
2232
2233         [iOS] WebKit services should inherit environment variables for home
2234         https://bugs.webkit.org/show_bug.cgi?id=144078
2235         rdar://problem/20571678
2236
2237         Reviewed by Dan Bernstein.
2238
2239         Pass current environment variables as XPC bootstrap. Also while at it, made
2240         _CFBundleSetupXPCBootstrap not soft linked.
2241
2242         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
2243         (main):
2244         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2245         (WebKit::connectToService):
2246
2247 2015-04-23  Enrica Casucci  <enrica@apple.com>
2248
2249         Support share button.
2250         https://bugs.webkit.org/show_bug.cgi?id=144077
2251         rdar://problem/19772892
2252
2253         Reviewed by Darin Adler.
2254
2255         * UIProcess/ios/WKContentViewInteraction.mm:
2256         (-[WKContentView _share:]):
2257         (-[WKContentView canPerformAction:withSender:]):
2258         (-[WKContentView _define:]):
2259         (-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
2260         (-[WKContentView moveByOffset:]):
2261         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
2262         (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
2263         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
2264         (-[WKContentView accessoryTab:]):
2265         (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
2266         (-[WKContentView executeEditCommandWithCallback:]):
2267
2268 2015-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2269
2270         [UNIX] Do not allow copies of IPC::Attachment
2271         https://bugs.webkit.org/show_bug.cgi?id=144096
2272
2273         Reviewed by Darin Adler.
2274
2275         It ensures that the file descriptor ownership is always correctly
2276         transferred. This way we can remove the dispose() method to
2277         explicitly close the file descriptor and always close it in the
2278         Attachment destructor (unless explicitly transferred to
2279         IPC::Connection or SharedMemory). It simplifies the code and
2280         ensure we don't leak file descriptors.
2281
2282         * Platform/IPC/ArgumentDecoder.cpp:
2283         (IPC::ArgumentDecoder::~ArgumentDecoder): Remove the code to
2284         explicitly dispose attachments.
2285         (IPC::ArgumentDecoder::removeAttachment): Use WTF::move().
2286         * Platform/IPC/ArgumentEncoder.cpp:
2287         (IPC::ArgumentEncoder::~ArgumentEncoder): Remove the code to
2288         explicitly dispose attachments.
2289         (IPC::ArgumentEncoder::addAttachment): Use WTF::move().
2290         (IPC::ArgumentEncoder::releaseAttachments): Simplify by using WTF::move().
2291         * Platform/IPC/ArgumentEncoder.h:
2292         * Platform/IPC/Attachment.cpp:
2293         (IPC::Attachment::encode): Move a copy of the attachment, and
2294         reset the file descriptor, since the ownership is passed to the encoder.
2295         * Platform/IPC/Attachment.h: Make copy constructor and assignment
2296         private to not allow public copies. The only copy allowed is done
2297         by Attachment::encode(). Make m_fileDescriptor mutable so that we
2298         can reset it in Attachment::encode() after passing the ownership
2299         to the encoder.
2300         * Platform/IPC/unix/AttachmentUnix.cpp:
2301         (IPC::Attachment::~Attachment): Close the file descriptor if it
2302         hasn't been released explicitly.
2303         (IPC::Attachment::dispose): Deleted.
2304         * Platform/IPC/unix/ConnectionUnix.cpp:
2305         (IPC::Connection::processMessage): Do not use AttachmentResourceGuard.
2306         (IPC::Connection::sendOutgoingMessage): Ditto.
2307         (IPC::AttachmentResourceGuard::AttachmentResourceGuard): Deleted.
2308         (IPC::AttachmentResourceGuard::~AttachmentResourceGuard): Deleted.
2309         * Platform/unix/SharedMemoryUnix.cpp:
2310         (WebKit::SharedMemory::Handle::~Handle): Do not call clear().
2311         (WebKit::SharedMemory::Handle::clear): Reset the attachment.
2312         * UIProcess/WebInspectorProxy.cpp:
2313         (WebKit::WebInspectorProxy::createInspectorPage): Use WTF::move().
2314         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
2315         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
2316         Call releaseFileDescriptor() instead of fileDescritpro() since the
2317         ownership is passed to the connection.
2318
2319 2015-04-23  Alexey Proskuryakov  <ap@apple.com>
2320
2321         Build fix.
2322
2323         * WebProcess/cocoa/WebProcessCocoa.mm: Correct the case of an include file name.
2324
2325 2015-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2326
2327         Unreviewed. Fix debug build after r183176.
2328
2329         * Platform/unix/SharedMemoryUnix.cpp:
2330         (WebKit::SharedMemory::Handle::decode):
2331         (WebKit::SharedMemory::createHandle):
2332
2333 2015-04-23  Andreas Kling  <akling@apple.com>
2334
2335         There should only be one way to get the system memory size.
2336         <https://webkit.org/b/144081>
2337
2338         Reviewed by Antti Koivisto.
2339
2340         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2341         (WebKit::NetworkProcess::platformSetCacheModel):
2342         (WebKit::memorySize): Deleted.
2343         * WebProcess/cocoa/WebProcessCocoa.mm:
2344         (WebKit::WebProcess::platformSetCacheModel):
2345         (WebKit::memorySize): Deleted.
2346
2347 2015-04-23  Chris Dumez  <cdumez@apple.com>
2348
2349         [WK2] WebDiagnosticLoggingClient is leaking
2350         https://bugs.webkit.org/show_bug.cgi?id=144089
2351         <rdar://problem/19706214>
2352
2353         Reviewed by Darin Adler.
2354
2355         WebDiagnosticLoggingClient is leaking. It is constructed inside WebPage
2356         constructor but there is no code destroying it.
2357
2358         This patch adds a new xxxDestroyed() virtual function to
2359         DiagnosticLoggingClient and that is overriden in
2360         WebDiagnosticLoggingClient to call "delete this". This is the same
2361         pattern as for other WK2 clients (e.g. WebFrameLoaderClient,
2362         WebProgressTrackerClient).
2363
2364         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
2365         (WebKit::WebDiagnosticLoggingClient::mainFrameDestroyed):
2366         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
2367
2368 2015-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2369
2370         [UNIX] Simplify the file descriptor handling in SharedMemory
2371         https://bugs.webkit.org/show_bug.cgi?id=144046
2372
2373         Reviewed by Darin Adler.
2374
2375         Simplify the file descriptor handling and clarify its ownership by
2376         using IPC::Attachment in SharedMemory::Handle instead of fd and
2377         size members. SharedMemory::Handle::adoptFromAttachment() has been
2378         renamed as SharedMemory::Handle::adoptAttachment() and receives an
2379         IPC::Attachment. And SharedMemory::Handle::releaseToAttachment()
2380         has been renamed as SharedMemory::Handle::releaseAttachment().
2381
2382         * Platform/IPC/Attachment.h: Add move constructor and move assigned operator.
2383         * Platform/IPC/Connection.h:
2384         (IPC::Connection::identifierIsNull): A file descriptor is null
2385         when it's -1 no 0.
2386         * Platform/IPC/unix/AttachmentUnix.cpp:
2387         (IPC::Attachment::Attachment):
2388         (IPC::Attachment::operator=):
2389         (IPC::Attachment::dispose): Reset the file descriptor after
2390         closing it.
2391         * Platform/IPC/unix/ConnectionUnix.cpp:
2392         (IPC::Connection::processMessage): Use
2393         SharedMemory::Handle::adoptAttachment() that receives an
2394         IPC::Attachment now.
2395         (IPC::Connection::sendOutgoingMessage): Use
2396         SharedMemory::Handle::releaseAttachment().
2397         * Platform/SharedMemory.h:
2398         * Platform/unix/SharedMemoryUnix.cpp:
2399         (WebKit::SharedMemory::Handle::Handle): Remove initializers for
2400         file descriptor and size members.
2401         (WebKit::SharedMemory::Handle::clear): Dispose the attachment.
2402         (WebKit::SharedMemory::Handle::isNull): Handle is null if the
2403         attachment file descriptor is -1.
2404         (WebKit::SharedMemory::Handle::encode): Use releaseAttachment().
2405         (WebKit::SharedMemory::Handle::decode): Use adoptAttachment().
2406         (WebKit::SharedMemory::Handle::releaseAttachment): Implement it
2407         using move.
2408         (WebKit::SharedMemory::Handle::adoptAttachment): Ditto.
2409         (WebKit::SharedMemory::map): Use
2410         IPC::Attachment::releaseFileDescriptor() instead of manually
2411         changing the member.
2412         (WebKit::SharedMemory::createHandle): Initialize the handle
2413         attachment with the duplicated file descriptor and size.
2414
2415 2015-04-22  Darin Adler  <darin@apple.com>
2416
2417         Remove OwnPtr and PassOwnPtr use from WebKit/cf, WebKit/mac, and WebKit2
2418         https://bugs.webkit.org/show_bug.cgi?id=143943
2419
2420         Reviewed by Anders Carlsson.
2421
2422         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
2423         Removed unneeded include.
2424
2425 2015-04-22  Brent Fulgham  <bfulgham@apple.com>
2426
2427         VisibleSelection should only accept Range by reference
2428         https://bugs.webkit.org/show_bug.cgi?id=144047
2429
2430         Reviewed by Tim Horton.
2431
2432         Update all uses of VisibleSelection to pass a Range reference instead
2433         of a Range pointer.
2434
2435         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
2436         (WebKit::InjectedBundleRangeHandle::renderedImage):
2437         * WebProcess/WebPage/FindController.cpp:
2438         (WebKit::FindController::getImageForFindMatch):
2439         (WebKit::FindController::selectFindMatch):
2440         * WebProcess/WebPage/WebPage.cpp:
2441         (WebKit::WebPage::insertTextAsync):
2442         (WebKit::WebPage::setCompositionAsync):
2443         * WebProcess/WebPage/mac/WebPageMac.mm:
2444         (WebKit::WebPage::insertDictatedTextAsync):
2445
2446 2015-04-22  Anders Carlsson  <andersca@apple.com>
2447
2448         Add WK_ARRAY and WK_SET annotations
2449         https://bugs.webkit.org/show_bug.cgi?id=144075
2450         rdar://problem/19417770
2451
2452         Reviewed by Dan Bernstein.
2453
2454         * Shared/API/Cocoa/WKFoundation.h:
2455         * UIProcess/API/Cocoa/WKBackForwardList.h:
2456         * UIProcess/API/Cocoa/WKUserContentController.h:
2457         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
2458         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
2459         * mac/postprocess-framework-headers.sh:
2460
2461 2015-04-22  Brent Fulgham  <bfulgham@apple.com>
2462
2463         Unreviewed build fix after r183136.
2464
2465         * WebProcess/WebPage/mac/WebPageMac.mm: Correct capitalization of
2466         'HTMLPluginImageElement.h' -> 'HTMLPlugInImageElement.h'
2467
2468 2015-04-21  Brent Fulgham  <bfulgham@apple.com>
2469
2470         Extend action menus to support PDF
2471         https://bugs.webkit.org/show_bug.cgi?id=143895
2472         <rdar://problem/19003333>
2473
2474         Reviewed by Tim Horton.
2475
2476         If the mouse pointer is over a PDF, try to provide a relevant action menu for whatever
2477         content is under the mouse. For now, we only support copying text and handling URLs.
2478
2479         If no text is selected, use the dictionary lookup service to find a semantically appropriate
2480         selection underneath the mouse. This is consistent with how normal text is treated in pure HTML
2481         views. If some text is already selected, and the mouse is over the existing selection, continue
2482         using the selected text. Otherwise, discard the old selection and select the most appropriate
2483         region under the mouse pointer.
2484
2485         * Shared/API/c/WKActionMenuTypes.h: Add PDF menu option.
2486         * Shared/WebMouseEvent.cpp: Recognize mouse force events as valid mouse events.
2487         * UIProcess/mac/WKActionMenuController.mm:
2488         (-[WKActionMenuController _defaultMenuItemsForPDF]): Add simply copy text option.
2489         (-[WKActionMenuController _defaultMenuItems]): Recognize PDFs and add relevant action
2490         menu entries.
2491         * WebProcess/Plugins/Netscape/NetscapePlugin.h: Provide stub for new method.
2492         * WebProcess/Plugins/PDF/PDFLayerControllerDetails.h: Expose 'rectsForSelectionInLayerSpace',
2493         'rectsForAnnotationInLayoutSpace', 'layout', and 'currentPage'.
2494         * WebProcess/Plugins/PDF/PDFPlugin.h:
2495         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2496         (WebKit::PDFPlugin::getSelectionForWordAtPoint): Added.
2497         (WebKit::PDFPlugin::existingSelectionContainsPoint): Added.
2498         (WebKit::PDFPlugin::lookupTextAtLocation): Added.
2499         * WebProcess/Plugins/Plugin.h: Add declaration for new 'getSelectionForWordAtPoint' method.
2500         * WebProcess/Plugins/PluginProxy.h: Provide stub for new method.
2501         * WebProcess/Plugins/PluginView.cpp:
2502         (WebKit::PluginView::getSelectionForWordAtPoint): Added.
2503         (WebKit::PluginView::existingSelectionContainsPoint): Added.
2504         (WebKit::PluginView::lookupTextAtLocation): Added.
2505         * WebProcess/Plugins/PluginView.h:
2506         * WebProcess/WebPage/mac/WebPageMac.mm:
2507         (WebKit::WebPage::performActionMenuHitTestAtLocation): Update to support PDF documents and retrieve
2508         relevant content to support later action menu handling.
2509
2510 2015-04-22  Eric Carlson  <eric.carlson@apple.com>
2511
2512         Update AirPlay sandbox rules
2513         https://bugs.webkit.org/show_bug.cgi?id=144062
2514         <rdar://problem/19869448>
2515
2516         Reviewed by Alexey Proskuryakov.
2517
2518         * WebProcess/com.apple.WebProcess.sb.in: Remove obsolete rules.
2519
2520 2015-04-22  Alexey Proskuryakov  <ap@apple.com>
2521
2522         [Mac] In nightlies and local builds, WebKit services can get terminated under memory pressure
2523         https://bugs.webkit.org/show_bug.cgi?id=144052
2524         rdar://problem/19754404
2525
2526         Reviewed by Darin Adler.
2527
2528         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
2529         (main): Make XPC transaction tracking work again after a re-exec.
2530
2531 2015-04-22  Zan Dobersek  <zdobersek@igalia.com>
2532
2533         [WK2] Have API::Array creation methods return Ref<>
2534         https://bugs.webkit.org/show_bug.cgi?id=143933
2535
2536         Reviewed by Darin Adler.
2537
2538         API::Array::create() and API::Array::createStringArray() should return Ref<> objects
2539         as the return values are never null. It's up to the caller to implicitly convert the
2540         returned objects to RefPtr<> if so required. All the call-sites have been updated to
2541         reflect that.
2542
2543         * Shared/API/APIArray.cpp:
2544         (API::Array::create):
2545         (API::Array::createStringArray):
2546         (API::Array::copy):
2547         * Shared/API/APIArray.h:
2548         * Shared/API/APIDictionary.cpp:
2549         (API::Dictionary::keys):
2550         * Shared/API/APIDictionary.h:
2551         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
2552         (ensureObjectStream):
2553         * Shared/API/c/WKArray.cpp:
2554         (WKArrayCreate):
2555         (WKArrayCreateAdoptingValues):
2556         * Shared/API/c/WKContextMenuItem.cpp:
2557         (WKContextMenuCopySubmenuItems):
2558         * Shared/API/c/WKDictionary.cpp:
2559         (WKDictionaryCopyKeys):
2560         * Shared/API/c/WKMutableArray.cpp:
2561         (WKMutableArrayCreate):
2562         * Shared/Cocoa/WKNSDictionary.mm:
2563         (-[WKNSDictionary keyEnumerator]):
2564         * Shared/SecurityOriginData.cpp:
2565         (WebKit::performAPICallbackWithSecurityOriginDataVector):
2566         * Shared/WebContextMenuItem.cpp:
2567         (WebKit::WebContextMenuItem::submenuItemsAsAPIArray):
2568         * Shared/WebContextMenuItem.h:
2569         * Shared/WebOpenPanelParameters.cpp:
2570         (WebKit::WebOpenPanelParameters::acceptMIMETypes):
2571         (WebKit::WebOpenPanelParameters::selectedFileNames):
2572         * Shared/WebOpenPanelParameters.h:
2573         * UIProcess/API/C/WKBackForwardListRef.cpp:
2574         (WKBackForwardListCopyBackListWithLimit):
2575         (WKBackForwardListCopyForwardListWithLimit):
2576         * UIProcess/API/C/WKGrammarDetail.cpp:
2577         (WKGrammarDetailCopyGuesses):
2578         * UIProcess/API/C/WKOpenPanelParameters.cpp:
2579         (WKOpenPanelParametersCopyAcceptedMIMETypes):
2580         (WKOpenPanelParametersCopySelectedFileNames):
2581         * UIProcess/API/C/WKPage.cpp:
2582         (WKPageSetPageContextMenuClient):
2583         (WKPageCopyRelatedPages):
2584         * UIProcess/API/Cocoa/WKBackForwardList.mm:
2585         (-[WKBackForwardList backList]):
2586         (-[WKBackForwardList forwardList]):
2587         * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
2588         (createWKArray):
2589         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2590         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
2591         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
2592         (webkit_back_forward_list_get_back_list_with_limit):
2593         (webkit_back_forward_list_get_forward_list_with_limit):
2594         * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
2595         (webkit_file_chooser_request_get_mime_types):
2596         (webkit_file_chooser_request_get_mime_types_filter):
2597         (webkit_file_chooser_request_select_files):
2598         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
2599         (WebKitNotificationProvider::notificationCloseCallback):
2600         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
2601         (WebKit::WebNotificationManagerProxy::populateCopyOfNotificationPermissions):
2602         * UIProcess/Notifications/WebNotificationProvider.cpp:
2603         (WebKit::WebNotificationProvider::clearNotifications):
2604         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
2605         (WebKit::WebPluginSiteDataManager::didGetSitesWithData):
2606         * UIProcess/StatisticsRequest.cpp:
2607         (WebKit::StatisticsRequest::completedRequest):
2608         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2609         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
2610         * UIProcess/WebBackForwardList.cpp:
2611         (WebKit::WebBackForwardList::backList):
2612         (WebKit::WebBackForwardList::forwardList):
2613         (WebKit::WebBackForwardList::backListAsAPIArrayWithLimit):
2614         (WebKit::WebBackForwardList::forwardListAsAPIArrayWithLimit):
2615         * UIProcess/WebBackForwardList.h:
2616         * UIProcess/WebCookieManagerProxy.cpp:
2617         (WebKit::WebCookieManagerProxy::didGetHostnamesWithCookies):
2618         * UIProcess/WebDatabaseManagerProxy.cpp:
2619         (WebKit::WebDatabaseManagerProxy::didGetDatabasesByOrigin):
2620         (WebKit::WebDatabaseManagerProxy::didGetDatabaseOrigins):
2621         * UIProcess/WebGrammarDetail.cpp:
2622         (WebKit::WebGrammarDetail::guesses):
2623         * UIProcess/WebGrammarDetail.h:
2624         * UIProcess/WebKeyValueStorageManager.cpp:
2625         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
2626         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
2627         * UIProcess/WebMediaCacheManagerProxy.cpp:
2628         (WebKit::WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache):
2629         * UIProcess/WebOriginDataManagerProxy.cpp:
2630         (WebKit::WebOriginDataManagerProxy::didGetOrigins):
2631         * UIProcess/WebPageProxy.cpp:
2632         (WebKit::WebPageProxy::didFindStringMatches):
2633         * UIProcess/WebProcessPool.cpp:
2634         (WebKit::WebProcessPool::pluginInfoStoreDidLoadPlugins):
2635         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2636         (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]):
2637         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
2638         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
2639         (-[WKWebProcessPlugInFrame childFrames]):
2640         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
2641         (WKBundleBackForwardListItemCopyChildren):
2642         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
2643         (WKBundleFrameCopyChildFrames):
2644         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2645         (WKBundlePageCopyTrackedRepaintRects):
2646         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
2647         (WebKit::InjectedBundleBackForwardListItem::children):
2648         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h:
2649         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
2650         (WebKit::InjectedBundlePageContextMenuClient::getCustomMenuFromDefaultItems):
2651         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
2652         (WebKit::InjectedBundlePageFormClient::didAssociateFormControls):
2653         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2654         (WebKit::InjectedBundlePageLoaderClient::featuresUsedInPage):
2655         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2656         (WebKit::findLargestFrameInFrameSet):
2657         * WebProcess/WebPage/WebFrame.cpp:
2658         (WebKit::WebFrame::childFrames):
2659         * WebProcess/WebPage/WebFrame.h:
2660         * WebProcess/WebPage/WebPage.cpp:
2661         (WebKit::WebPage::trackedRepaintRects):
2662         * WebProcess/WebPage/WebPage.h:
2663
2664 2015-04-21  Eric Carlson  <eric.carlson@apple.com>
2665
2666         [Mac] Use one playback target for all web processes
2667         https://bugs.webkit.org/show_bug.cgi?id=144009
2668
2669         Reviewed by Tim Horton.
2670
2671         Every WebPageProxy uses the WebMediaSessionManager singleton to talk to the playback target
2672         picker.
2673
2674         * UIProcess/PageClient.h:
2675         * UIProcess/WebPageProxy.cpp:
2676         (WebKit::WebPageProxy::WebPageProxy):
2677         (WebKit::WebPageProxy::resetState):
2678         (WebKit::WebPageProxy::isPlayingMediaDidChange):
2679         (WebKit::WebPageProxy::addPlaybackTargetPickerClient):
2680         (WebKit::WebPageProxy::removePlaybackTargetPickerClient):
2681         (WebKit::WebPageProxy::showPlaybackTargetPicker):
2682         (WebKit::WebPageProxy::playbackTargetPickerClientStateDidChange):
2683         (WebKit::WebPageProxy::setPlaybackTarget):
2684         (WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange):
2685         (WebKit::WebPageProxy::setShouldPlayToPlaybackTarget):
2686         (WebKit::WebPageProxy::devicePickerProxy): Deleted.
2687         (WebKit::WebPageProxy::startingMonitoringPlaybackTargets): Deleted.
2688         (WebKit::WebPageProxy::stopMonitoringPlaybackTargets): Deleted.
2689         (WebKit::WebPageProxy::didChoosePlaybackTarget): Deleted.
2690         * UIProcess/WebPageProxy.h:
2691         (WebKit::WebPageProxy::isPlayingAudio):
2692         * UIProcess/WebPageProxy.messages.in:
2693         * UIProcess/mac/PageClientImpl.h:
2694         * UIProcess/mac/PageClientImpl.mm:
2695         (WebKit::PageClientImpl::mediaSessionManager):
2696         (WebKit::PageClientImpl::createPlaybackTargetPicker): Deleted.
2697         * UIProcess/mac/WebMediaSessionManagerMac.cpp: Added.
2698         (WebKit::WebMediaSessionManagerMac::singleton):
2699         (WebKit::WebMediaSessionManagerMac::WebMediaSessionManagerMac):
2700         (WebKit::WebMediaSessionManagerMac::~WebMediaSessionManagerMac):
2701         (WebKit::WebMediaSessionManagerMac::targetPicker):
2702         * UIProcess/mac/WebMediaSessionManagerMac.h: Added.
2703         * WebProcess/Plugins/PluginView.h:
2704         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2705         (WebKit::WebChromeClient::isPlayingMediaDidChange):
2706         (WebKit::WebChromeClient::addPlaybackTargetPickerClient):
2707         (WebKit::WebChromeClient::removePlaybackTargetPickerClient):
2708         (WebKit::WebChromeClient::showPlaybackTargetPicker):
2709         (WebKit::WebChromeClient::playbackTargetPickerClientStateDidChange):
2710         (WebKit::WebChromeClient::startingMonitoringPlaybackTargets): Deleted.
2711         (WebKit::WebChromeClient::stopMonitoringPlaybackTargets): Deleted.
2712         * WebProcess/WebCoreSupport/WebChromeClient.h:
2713         * WebProcess/WebPage/WebPage.h:
2714         * WebProcess/WebPage/WebPage.messages.in:
2715         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2716         (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
2717         * WebProcess/WebPage/mac/WebPageMac.mm:
2718         (WebKit::WebPage::playbackTargetSelected):
2719         (WebKit::WebPage::playbackTargetAvailabilityDidChange):
2720         (WebKit::WebPage::setShouldPlayToPlaybackTarget):
2721
2722 2015-04-21  Anders Carlsson  <andersca@apple.com>
2723
2724         WKWebsiteDataStore doesn't track and remove IndexedDB databases
2725         https://bugs.webkit.org/show_bug.cgi?id=144032
2726         rdar://problem/20242856
2727
2728         Reviewed by Tim Horton.
2729
2730         * DatabaseProcess/DatabaseProcess.cpp:
2731         (WebKit::DatabaseProcess::fetchWebsiteData):
2732         (WebKit::DatabaseProcess::deleteWebsiteData):
2733         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
2734         * DatabaseProcess/DatabaseProcess.h:
2735         * DatabaseProcess/DatabaseProcess.messages.in:
2736         * Shared/WebsiteData/WebsiteDataTypes.h:
2737         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
2738         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
2739         (dataTypesToString):
2740         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
2741         (WebKit::toWebsiteDataTypes):
2742         (WebKit::toWKWebsiteDataTypes):
2743         * UIProcess/Databases/DatabaseProcessProxy.cpp:
2744         (WebKit::generateCallbackID):
2745         (WebKit::DatabaseProcessProxy::~DatabaseProcessProxy):
2746         (WebKit::DatabaseProcessProxy::fetchWebsiteData):
2747         (WebKit::DatabaseProcessProxy::deleteWebsiteData):
2748         (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins):
2749         (WebKit::DatabaseProcessProxy::didClose):
2750         (WebKit::DatabaseProcessProxy::didFetchWebsiteData):
2751         (WebKit::DatabaseProcessProxy::didDeleteWebsiteData):
2752         (WebKit::DatabaseProcessProxy::didDeleteWebsiteDataForOrigins):
2753         * UIProcess/Databases/DatabaseProcessProxy.h:
2754         * UIProcess/Databases/DatabaseProcessProxy.messages.in:
2755         * UIProcess/WebProcessPool.h:
2756         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2757         (WebKit::WebsiteDataStore::fetchData):
2758         (WebKit::WebsiteDataStore::removeData):
2759
2760 2015-04-21  Anders Carlsson  <andersca@apple.com>
2761
2762         Add module maps for WebKit
2763         https://bugs.webkit.org/show_bug.cgi?id=144026
2764         rdar://problem/19665428
2765
2766         Reviewed by Dan Bernstein.
2767
2768         * Configurations/WebKit.xcconfig:
2769         * Modules/OSX.modulemap: Added.
2770         * Modules/iOS.modulemap: Added.
2771
2772 2015-04-21  Tim Horton  <timothy_horton@apple.com>
2773
2774         Long pause under _takeViewSnapshot when screen updates are disabled
2775         https://bugs.webkit.org/show_bug.cgi?id=144017
2776         <rdar://problem/20548397>
2777
2778         Reviewed by Simon Fraser.
2779
2780         * UIProcess/API/mac/WKView.mm:
2781         (-[WKView _takeViewSnapshot]):
2782         Use CGSHWCaptureWindowList, for snapshotting that doesn't block on
2783         the next commit, and can succeed while screen updates are disabled
2784         without blocking.
2785
2786 2015-04-21  Chris Dumez  <cdumez@apple.com>
2787
2788         [WK2][NetworkCache] Better account of resource revalidations in efficacy logging
2789         https://bugs.webkit.org/show_bug.cgi?id=144014
2790
2791         Reviewed by Antti Koivisto.
2792
2793         Better account of resource revalidations in efficacy logging.
2794         Prevously, resources that were in the cache but needed revalidation
2795         were counted as retrieval successes, which is not entirely accurate.
2796
2797         We now distinguish "is in the cache and is directly usable" from
2798         "is in the cache but needs revalidation". We also log how many of these
2799         revalidations are successful.
2800
2801         * NetworkProcess/NetworkResourceLoader.cpp:
2802         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
2803         * NetworkProcess/cache/NetworkCache.cpp:
2804         (WebKit::NetworkCache::Cache::update):
2805         * NetworkProcess/cache/NetworkCache.h:
2806         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2807         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
2808         (WebKit::NetworkCache::Statistics::recordRevalidationSuccess):
2809         * NetworkProcess/cache/NetworkCacheStatistics.h:
2810
2811 2015-04-21  Dan Bernstein  <mitz@apple.com>
2812
2813         [Cocoa] Framework header postprocessing should respect additional definitions
2814         https://bugs.webkit.org/show_bug.cgi?id=144018
2815
2816         Reviewed by Anders Carlsson.
2817
2818         * mac/postprocess-framework-headers.sh: Read definitons from
2819         /usr/local/include/WebKitAdditions/Scripts/postprocess-framework-headers-definitions, and
2820         have them take precedence over OSX_VERSION and IOS_VERSION and supply additional options to
2821         sed.
2822
2823 2015-04-21  Anders Carlsson  <andersca@apple.com>
2824
2825         Fix block signatures
2826         https://bugs.webkit.org/show_bug.cgi?id=144002
2827
2828         Reviewed by Andreas Kling.
2829
2830         * UIProcess/API/Cocoa/WKUIDelegate.h:
2831         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
2832         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2833         (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
2834         (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
2835         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
2836         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
2837         (-[_WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
2838         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
2839         * UIProcess/ios/WKPDFView.mm:
2840         (-[WKPDFView _highlightLinkAnnotation:forDuration:completionHandler:]):
2841         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2842         (-[WKFileUploadPanel _processMediaInfoDictionaries:successBlock:failureBlock:]):
2843         (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]):
2844         (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
2845
2846 2015-04-21  Timothy Horton  <timothy_horton@apple.com>
2847
2848         PDFs still don't snapshot properly in iOS Safari
2849         https://bugs.webkit.org/show_bug.cgi?id=143976
2850         <rdar://problem/18283459>
2851
2852         Reviewed by Anders Carlsson.
2853
2854         * UIProcess/WebPageProxy.cpp:
2855         (WebKit::WebPageProxy::didLayoutForCustomContentProvider):
2856         * UIProcess/WebPageProxy.h:
2857         * UIProcess/API/Cocoa/WKWebView.mm:
2858         (-[WKWebView _didFinishLoadingDataForCustomContentProviderWithSuggestedFilename:data:]):
2859         Inform the client that we've passed all reasonable layout milestones
2860         as soon as the custom content provider has been handed its data.
2861         WKPDFView, the only custom content provider, synchronously lays out
2862         its subviews upon initial receipt of data, so this works fine for it.
2863         This ensures that clients that normally depend on layout milestones firing
2864         won't break when a custom content view is installed.
2865
2866         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2867         Fall back to renderInContext: if the custom content view is not parented
2868         when a snapshot is requested.
2869
2870 2015-04-21  Dan Bernstein  <mitz@apple.com>
2871
2872         Merged WKBackForwardListItem’s Internal category into the class extension in WKBackForwardListItemInternal.h.
2873
2874         Reviewed by Anders Carlsson.
2875
2876         * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
2877         (-[WKBackForwardListItem _item]):
2878         (-[WKBackForwardListItem _apiObject]):
2879         * UIProcess/API/Cocoa/WKBackForwardListItemInternal.h:
2880
2881 2015-04-21  Chris Dumez  <cdumez@apple.com>
2882
2883         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&) constructor explicit
2884         https://bugs.webkit.org/show_bug.cgi?id=143970
2885
2886         Reviewed by Darin Adler.
2887
2888         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&)
2889         constructor explicit as it copies the vector and it is easy to call it
2890         by mistake.
2891
2892         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
2893         (WebKit::WebIDBServerConnection::setIndexKeys):
2894         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
2895
2896 2015-04-20  Dan Bernstein  <mitz@apple.com>
2897
2898         Expose more bundle form client functions as WKWebProcessPlugInFormDelegatePrivate methods
2899         https://bugs.webkit.org/show_bug.cgi?id=143973
2900
2901         Reviewed by Anders Carlsson.
2902
2903         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Declared new
2904         delegate methods.
2905
2906         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: Declared new frame
2907         property.
2908         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
2909         (-[WKWebProcessPlugInNodeHandle frame]): Added. Returns the node’s document’s frame. This is
2910         useful to delegates getting an array of nodes via the new method.
2911
2912         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2913         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Added overrides of
2914         shouldNotifyOnFormChanges and didAssociateFormControls, which call the new delegate methods.
2915
2916 2015-04-20  Joseph Pecoraro  <pecoraro@apple.com>
2917
2918         Cleanup some StringBuilder use
2919         https://bugs.webkit.org/show_bug.cgi?id=143550
2920
2921         Reviewed by Darin Adler.
2922
2923         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
2924         (WebKit::buildObjectStoreStatement):
2925         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
2926         (WebKit::v2RecordsTableSchema):
2927         * Shared/Databases/IndexedDB/IDBUtilities.cpp:
2928         (WebKit::uniqueDatabaseIdentifier):
2929         * UIProcess/API/APIUserScript.cpp:
2930         (API::UserScript::generateUniqueURL):
2931         * UIProcess/WebProcessPool.cpp:
2932         (WebKit::WebProcessPool::didReceiveInvalidMessage):
2933         * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp:
2934         (WebKit::combinedSecurityOriginIdentifier):
2935
2936 2015-04-20  Anders Carlsson  <andersca@apple.com>
2937
2938         Modify the WKWebsiteDataStore API to take a NSSet of types instead of a bitmask
2939         https://bugs.webkit.org/show_bug.cgi?id=143966
2940
2941         Reviewed by Dan Bernstein.
2942
2943         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
2944         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
2945         (dataTypesToString):
2946         (-[WKWebsiteDataRecord dataTypes]):
2947         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
2948         (WebKit::toWebsiteDataTypes):
2949         (WebKit::toWKWebsiteDataTypes):
2950         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
2951         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2952         (+[WKWebsiteDataStore allWebsiteDataTypes]):
2953         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
2954         (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
2955         (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
2956         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
2957         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
2958         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
2959         (toWKWebsiteDataTypes):
2960         (-[_WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
2961         (-[_WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
2962         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
2963
2964 2015-04-20  Beth Dakin  <bdakin@apple.com>
2965
2966         Should remove mouseForceClick and mouseForceCancelled from DOM force events
2967         https://bugs.webkit.org/show_bug.cgi?id=143904
2968         -and corresponding-
2969         rdar://problem/20578842
2970
2971         Reviewed by Dan Bernstein.
2972
2973         * WebProcess/WebPage/mac/WebPageMac.mm:
2974         (WebKit::WebPage::immediateActionDidCancel):
2975
2976 2015-04-20  Tim Horton  <timothy_horton@apple.com>
2977
2978         Implement immediate action support for tel: and mailto: URLs
2979         https://bugs.webkit.org/show_bug.cgi?id=143916
2980         <rdar://problem/19721711>
2981
2982         Reviewed by Darin Adler.
2983
2984         * Shared/API/c/WKImmediateActionTypes.h:
2985         * UIProcess/mac/WKImmediateActionController.mm:
2986         (-[WKImmediateActionController _defaultAnimationController]):
2987         (-[WKImmediateActionController _animationControllerForDataDetectedText]):
2988         (-[WKImmediateActionController _animationControllerForDataDetectedLink]):
2989         (-[WKImmediateActionController _menuItemForDataDetectedText]): Deleted.
2990         Add _animationControllerForDataDetectedLink and use it when
2991         building immediate actions for tel: and mailto: links.
2992
2993 2015-04-20  Alex Christensen  <achristensen@webkit.org>
2994
2995         Properly report errors from _WKUserContentExtensionStore.
2996         https://bugs.webkit.org/show_bug.cgi?id=143808
2997
2998         Reviewed by Darin Adler.
2999
3000         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
3001         (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
3002         (-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
3003         (-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
3004
3005 2015-04-18  Simon Fraser  <simon.fraser@apple.com>
3006
3007         REGRESSION (r181656): Animated tiled layers are missing content
3008         https://bugs.webkit.org/show_bug.cgi?id=143911
3009         rdar://problem/20596328
3010
3011         Reviewed by Darin Adler.
3012         
3013         After r181656, all requestAnimationFrame was falling back to timers, and not
3014         using the platform's DisplayRefreshMonitor, because of a Nullopt vs nullptr
3015         fumble.
3016         
3017         Replace this confusing Optional<> code with simpler code that just forces the
3018         clients to make a DisplayRefreshMonitor if they can, first asking
3019         ChromeClient, and then falling back to createDefaultDisplayRefreshMonitor().
3020         
3021         Make lots of things into references, and use C++11 initialization in some places.
3022
3023         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3024         (WebKit::WebChromeClient::createDisplayRefreshMonitor):
3025         * WebProcess/WebCoreSupport/WebChromeClient.h:
3026
3027 2015-04-18  Dan Bernstein  <mitz@apple.com>
3028
3029         SwipeShadow images are installed on iOS
3030         https://bugs.webkit.org/show_bug.cgi?id=143915
3031
3032         Reviewed by Tim Horton.
3033
3034         * Configurations/WebKit.xcconfig: Added Resources/Mac/* to
3035         EXCLUDED_SOURCE_FILE_NAMES[sdk=iphone*]. We could move more resources there and remove
3036         individual patterns.
3037         * Resources/SwipeShadow.png: Moved to mac.
3038         * Resources/SwipeShadow@2x.png: Moved to mac.
3039         * Resources/mac: Added.
3040         * Resources/mac/SwipeShadow.png: Moved from Source/WebKit2/Resources/SwipeShadow.png.
3041         * Resources/mac/SwipeShadow@2x.png: Moved from Source/WebKit2/Resources/SwipeShadow@2x.png.
3042         * WebKit2.xcodeproj/project.pbxproj: Created mac group in the Resources group and moved
3043         SwipeShadow*.png into it. Updated for file moves.
3044
3045 2015-04-18  Chris Dumez  <cdumez@apple.com>
3046
3047         Fix NetworkCache Statistics database bootstrapping after r182803
3048         https://bugs.webkit.org/show_bug.cgi?id=143890
3049
3050         Reviewed by Darin Adler.
3051
3052         Update the NetworkCache Statistics database bootstrapping code to use
3053         the records path instead of the version path. Also check that the
3054         filenames in the folder are valid hashes to discard the *-body files.
3055
3056         * NetworkProcess/cache/NetworkCache.cpp:
3057         (WebKit::NetworkCache::Cache::recordsPath):
3058         (WebKit::NetworkCache::Cache::storagePath): Deleted.
3059         * NetworkProcess/cache/NetworkCache.h:
3060         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
3061         (WebKit::NetworkCache::Statistics::initialize):
3062         (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
3063         (WebKit::NetworkCache::Statistics::shrinkIfNeeded):
3064
3065 2015-04-17  Tim Horton  <timothy_horton@apple.com>
3066
3067         Clients sometimes block for 500ms in waitForPossibleGeometryUpdates
3068         https://bugs.webkit.org/show_bug.cgi?id=143901
3069         <rdar://problem/20488655>
3070
3071         Reviewed by Anders Carlsson.
3072
3073         * Platform/IPC/Connection.cpp:
3074         (IPC::Connection::waitForMessage):
3075         InterruptWaitingIfSyncMessageArrives already cancels waitForMessage if
3076         a sync message arrives while waiting, but it should also avoid waiting
3077         if there's a sync message already in the queue when the waiting starts,
3078         as that will have the same nasty effect.
3079
3080         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
3081         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForPossibleGeometryUpdate):
3082         If a synchronous message comes in from the Web process while we're waiting,
3083         cancel our synchronous wait for DidUpdateGeometry. This will cause the size
3084         change to not synchronize with the Web process' painting, but that is better
3085         than pointlessly blocking for 500ms.
3086
3087 2015-04-17  Chris Dumez  <cdumez@apple.com>
3088
3089         Possible null pointer dereference in WebDiagnosticLoggingClient::logDiagnosticMessageWithValue()
3090         https://bugs.webkit.org/show_bug.cgi?id=143899
3091         <rdar://problem/20584215>
3092
3093         Reviewed by Anders Carlsson.
3094
3095         WebDiagnosticLoggingClient::logDiagnosticMessage*() methods failed to
3096         check that m_page.corePage() was non-null before dereferencing, thus
3097         causing crashes when it is null.
3098
3099         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
3100         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage):
3101         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult):
3102         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue):
3103
3104 2015-04-17  Yongjun Zhang  <yongjun_zhang@apple.com>
3105
3106         WebKit client should be able to add view controller for link preview.
3107         https://bugs.webkit.org/show_bug.cgi?id=143686
3108
3109         Add delegate methods to WKUIDelegatePrivate so that a WebKit client can prepare a view controller
3110         for link preview and react to the dismissal of this view controller. Also connect WKContentView to
3111         preview gesture recognizer and forwards the delegate callbacks to corresponding delegate methods
3112         in WKUIDelegatePrivate.
3113
3114         Reviewed by Beth Dakin.
3115
3116         * Platform/spi/ios/UIKitSPI.h:
3117         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3118         * UIProcess/ios/WKContentView.mm:
3119         (-[WKContentView willMoveToWindow:]):
3120         * UIProcess/ios/WKContentViewInteraction.h:
3121         * UIProcess/ios/WKContentViewInteraction.mm:
3122         (-[WKContentView cleanupInteraction]):
3123         (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):
3124         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
3125         (-[WKContentView gestureRecognizerShouldBegin:]):
3126         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
3127         (-[WKContentView commitPreviewViewController:]):
3128         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
3129         (-[WKContentView didDismissPreviewViewController:committing:]):
3130
3131 2015-04-17  Beth Dakin  <bdakin@apple.com>
3132
3133         Force mouse events should go through normal mouse event handling code paths
3134         https://bugs.webkit.org/show_bug.cgi?id=143749
3135         -and corresponding-
3136         rdar://problem/20472895
3137
3138         Reviewed by Dean Jackson.
3139
3140         This patch makes pressureChangeWithEvent create NativeWebMouseEvents with the 
3141         NSEventTypePressures that is gets and sends those down to the web process.
3142
3143         Re-name pressureEvent to lastPressureEvent. Now that event can sometimes be an 
3144         NSEventTypePressure, the new name makes it clear how the second parameter differs 
3145         from the first.
3146         * Shared/NativeWebMouseEvent.h:
3147
3148         New event types for the new types of events.
3149         * Shared/WebEvent.h:
3150         * Shared/WebEventConversion.cpp:
3151         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
3152         * Shared/mac/NativeWebMouseEventMac.mm:
3153         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
3154         * Shared/mac/WebEventFactory.h:
3155
3156         All of the square-peg, round-hole problems of massaging the NSEventTypePressures 
3157         events into WebMouseEvents is taken care of here.
3158         * Shared/mac/WebEventFactory.mm:
3159         (WebKit::mouseButtonForEvent):
3160         (WebKit::globalPointForEvent):
3161         (WebKit::pointForEvent):
3162         (WebKit::WebEventFactory::createWebMouseEvent):
3163
3164         Instead of calling the old inputDeviceForceDidChange, create a NativeWebMouseEvent 
3165         and handle it.
3166         * UIProcess/API/mac/WKView.mm:
3167         (-[WKView pressureChangeWithEvent:]):
3168
3169         Handle the new types.
3170         * UIProcess/WebPageProxy.cpp:
3171         (WebKit::WebPageProxy::didReceiveEvent):
3172
3173         Can delete inputDeviceForceDidChange since it’s no longer used.
3174         (WebKit::WebPageProxy::inputDeviceForceDidChange): Deleted.
3175         * UIProcess/WebPageProxy.h:
3176
3177         Handle the new types of mouse events properly.
3178         * WebProcess/WebPage/WebPage.cpp:
3179         (WebKit::handleMouseEvent):
3180
3181         Delete inputDeviceForceDidChange() and m_lastForceStage.
3182         * WebProcess/WebPage/WebPage.h:
3183         * WebProcess/WebPage/WebPage.messages.in:
3184         * WebProcess/WebPage/mac/WebPageMac.mm:
3185         (WebKit::WebPage::inputDeviceForceDidChange): Deleted.
3186
3187         Handle new WebEvent types.
3188         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
3189
3190 2015-04-17  Commit Queue  <commit-queue@webkit.org>
3191
3192         Unreviewed, rolling out r182912 and r182920.
3193         https://bugs.webkit.org/show_bug.cgi?id=143881
3194
3195         Build breakage in some configurations (Requested by ap on
3196         #webkit).
3197
3198         Reverted changesets:
3199
3200         "Force mouse events should go through normal mouse event
3201         handling code paths"
3202         https://bugs.webkit.org/show_bug.cgi?id=143749
3203         http://trac.webkit.org/changeset/182912
3204
3205         http://trac.webkit.org/changeset/182920
3206
3207 2015-04-17  Antti Koivisto  <antti@apple.com>
3208
3209         Network Cache: Read resource record and body in parallel
3210         https://bugs.webkit.org/show_bug.cgi?id=143879
3211
3212         Reviewed by Chris Dumez.
3213
3214         We currently first fetch the record file and then fetch the body blob if needed.
3215         We can do both operations in parallel to reduce latency.
3216
3217         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
3218         (WebKit::NetworkCache::traverseCacheFiles):
3219
3220             Do all validation in the client.
3221
3222         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3223         (WebKit::NetworkCache::Storage::synchronize):
3224
3225             Maintain a bloom filter that contains the body blobs to avoid unnecessary IO attempts.
3226             Delete any unknown file in cache directory.
3227
3228         (WebKit::NetworkCache::Storage::addToRecordFilter):
3229
3230             More informative name for record filter.
3231
3232         (WebKit::NetworkCache::Storage::mayContain):
3233         (WebKit::NetworkCache::Storage::readRecord):
3234         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
3235         (WebKit::NetworkCache::Storage::dispatchReadOperation):
3236
3237             Start record read IO and body blob read IO in parallel.
3238
3239         (WebKit::NetworkCache::Storage::finishReadOperation):
3240
3241             The read is finished when we have both the record and the blob.
3242
3243         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
3244         (WebKit::NetworkCache::Storage::retrieve):
3245         (WebKit::NetworkCache::Storage::store):
3246         (WebKit::NetworkCache::Storage::traverse):
3247         (WebKit::NetworkCache::Storage::clear):
3248         (WebKit::NetworkCache::Storage::shrink):
3249         (WebKit::NetworkCache::Storage::addToContentsFilter): Deleted.
3250         (WebKit::NetworkCache::Storage::decodeRecord): Deleted.
3251         * NetworkProcess/cache/NetworkCacheStorage.h:
3252         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation):
3253
3254             ReadOperation is now mutable and gathers the read result.
3255
3256 2015-04-16  Anders Carlsson  <andersca@apple.com>
3257
3258         Stop installing WebKit2.framework
3259         https://bugs.webkit.org/show_bug.cgi?id=143860
3260         rdar://problem/18298491
3261
3262         Reviewed by Dan Bernstein.
3263
3264         * Configurations/WebKit2.xcconfig:
3265         Set SKIP_INSTALL=YES for all SDKs except 10.9 where we still need it.
3266
3267 2015-04-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3268
3269         Unreviewed. Fix the build with ENABLE(NETWORK_CACHE) and !ENABLE(SHAREABLE_RESOURCE).
3270
3271         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3272         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
3273         (WebKit::NetworkCache::fileTimes): There's no st_birthtime in Linux.
3274
3275 2015-04-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3276
3277         [SOUP] ResourceRequest cache policy is not encoded/decoded in IPC messages
3278         https://bugs.webkit.org/show_bug.cgi?id=143867
3279
3280         Reviewed by Sergio Villar Senin.
3281
3282         Encode/Decode the ResourceRequest cache policy.
3283
3284         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
3285         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
3286         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
3287
3288 2015-04-16  Sungmann Cho  <sungmann.cho@navercorp.com>
3289
3290         Use UNUSED_PARAM instead of the void casting to suppress unused parameter warnings.
3291         https://bugs.webkit.org/show_bug.cgi?id=143750
3292
3293         Reviewed by Darin Adler.
3294
3295         No new tests, no behavior change.
3296
3297         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
3298         (WebKit::NotificationPermissionRequestManager::NotificationPermissionRequestManager):
3299
3300 2015-04-16  Brady Eidson  <beidson@apple.com>
3301
3302         Compiling a content extension fails when user's home directory is on a different volume from /var/tmp.
3303         https://bugs.webkit.org/show_bug.cgi?id=143834
3304
3305         Reviewed by Anders Carlsson.
3306
3307         * UIProcess/API/APIUserContentExtensionStore.cpp:
3308         (API::compiledToFile): Use moveFile() instead of renameFile()
3309
3310 2015-04-16  Anders Carlsson  <andersca@apple.com>
3311
3312         Deprecate _WKWebsiteDataStore in favor of WKWebsiteDataStore
3313         https://bugs.webkit.org/show_bug.cgi?id=143844
3314
3315         Reviewed by Dan Bernstein.
3316
3317         * Shared/API/Cocoa/WKFoundation.h:
3318         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3319         (-[WKWebViewConfiguration _validate]):
3320         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3321         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
3322         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
3323         * mac/postprocess-framework-headers.sh:
3324
3325 2015-04-16  Alex Christensen  <achristensen@webkit.org>
3326
3327         Removed unused WKUserContentFilterRef.
3328         https://bugs.webkit.org/show_bug.cgi?id=143852
3329
3330         Reviewed by Sam Weinig.
3331
3332         * Shared/WebCompiledContentExtension.cpp:
3333         (WebKit::LegacyContentExtensionCompilationClient::LegacyContentExtensionCompilationClient): Deleted.
3334         (WebKit::LegacyContentExtensionCompilationClient::writeBytecode): Deleted.
3335         (WebKit::LegacyContentExtensionCompilationClient::writeActions): Deleted.
3336         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData): Deleted.
3337         * Shared/WebCompiledContentExtension.h:
3338         * UIProcess/API/C/WKUserContentFilterRef.cpp: Removed.
3339         * UIProcess/API/C/WKUserContentFilterRef.h: Removed.
3340         * UIProcess/API/C/WebKit2_C.h:
3341         * UIProcess/API/Cocoa/_WKUserContentFilter.h:
3342         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
3343         (-[_WKUserContentFilter initWithName:serializedRules:]): Deleted.
3344         * WebKit2.xcodeproj/project.pbxproj:
3345
3346 2015-04-16  Beth Dakin  <bdakin@apple.com>
3347
3348         Rubber-stamped by Tim Horton.
3349
3350         Fixing a small mistake in http://trac.webkit.org/changeset/182912 which should 
3351         make sure to use the most up-to-date pressure information when setting the force 
3352         on a WebMouseEvent.
3353
3354         * Shared/mac/WebEventFactory.mm:
3355         (WebKit::WebEventFactory::createWebMouseEvent):
3356
3357 2015-04-13  Jer Noble  <jer.noble@apple.com>
3358
3359         [iOS] When simultaneously exiting-and-entering fullscreen, WebVideoFullscreenManager/Proxy becomes confused about what video element it represents.
3360         https://bugs.webkit.org/show_bug.cgi?id=143680
3361
3362         Reviewed by Simon Fraser.
3363
3364         The original assumption of WebVideoFullscreenManager and -Proxy was that the two classes would represent a
3365         single video element and its full screen state. With multiple animations in and out of fullscreen combined with
3366         multiple fullscreen modes, this assumption no longer holds true.
3367
3368         Rather than having a WebVideoFullscreenManager which /isa/ WebVideoFullscreenModelVideoElement, the manager now
3369         /hasa/ WebVideoFullscreenModelVideoElement (or has many such models). Ditto for WebVideoFullscreenManager and
3370         WebVideoFullscreenInterfaceAVKit. The WebVideoFullscreenInterfaceAVKit still needs a WebVideoFullscreenModel to
3371         communicate with, so a new wrapper class is used for that purpose, WebVideoFullscreenModelContext. Ditto for
3372         WebVideoFullscreenModelVideoElement and the new class WebVideoFullscreenInterfaceContext. These context classes
3373         are paired and share a contextId, allowing the manager and its proxy to route messages between the UIProcess's
3374         WebVideoFullscreenInterfaceAVKit to-and-from the WebProcess's WebVideoFullscreenModelVideoElement.
3375
3376         Both the WebVideoFullscreenModelContext and the WebVideoFullscreenInterfaceContext take a back-pointer to their
3377         manager or manager proxy, and each method on the context simply calls the matching method on the manager and
3378         passes its contextId as a parameter.
3379
3380         Both the WebVideoFullscreenManager and the WebVideoFullscreenManagerProxy pass that contextId in each of their
3381         cross-process messages.
3382
3383         On the other side, the manager and proxy also have a map between contextIds and their matching
3384         WebVideoFullscreenModelVideoElement (in the case of WebVideoFullscreenManager) or
3385         WebVideoFullscreenInterfaceAVKit (in the case of WebVideoFullscreenManagerProxy).
3386
3387         While this change is large by LoC, it is almost entirely boilerplate.  The new and interesting pieces are these:
3388
3389         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
3390         (WebKit::WebVideoFullscreenManagerProxy::WebVideoFullscreenManagerProxy): No longer a WebVideoFullscreenInterfaceAVKit.
3391         (WebKit::WebVideoFullscreenManagerProxy::invalidate): Walk through the models and interfaces, invalidating each.
3392         (WebKit::WebVideoFullscreenManagerProxy::createModelAndInterface): Added. Return a new model and interface tuple.
3393         (WebKit::WebVideoFullscreenManagerProxy::ensureModelAndInterface): Added. Lazily create, and add to the m_contextMap
3394             a new model and interface object.
3395         (WebKit::WebVideoFullscreenManagerProxy::ensureModel): Return the model half of ensureModelAndInterface().
3396         (WebKit::WebVideoFullscreenManagerProxy::ensureInterface): Return the interface half of ensureModelAndInterface().
3397         (WebKit::WebVideoFullscreenManagerProxy::enterFullscreen): Walk through the outstanding interface objects, and if 
3398             any have a fullscreen mode which matches the about-to-be-fullscreen interface, request that that other interface
3399             exit fullscreen.
3400         * WebProcess/ios/WebVideoFullscreenManager.mm:
3401         (WebKit::nextContextId): Static, incrementing counter used as a contextId source.
3402         (WebKit::WebVideoFullscreenManager::WebVideoFullscreenManager): No longer a WebVideoFullscreenModelVideoElement.
3403         (WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager): Walk through the models and interfaces, invalidating each.
3404         (WebKit::WebVideoFullscreenManager::ensureModelAndInterface): Added. Return a new model and interface tuple.
3405         (WebKit::WebVideoFullscreenManager::ensureModelAndInterface):  Added. Lazily create, and add to the m_contextMap
3406             a new model and interface object.
3407         (WebKit::WebVideoFullscreenManager::ensureModel): Return the model half of ensureModelAndInterface().
3408         (WebKit::WebVideoFullscreenManager::ensureInterface): Return the interface half of ensureModelAndInterface().
3409
3410         New classes and methods which just forward on to their owning objects:
3411
3412         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
3413         (WebKit::WebVideoFullscreenModelContext::create):
3414         (WebKit::WebVideoFullscreenModelContext::~WebVideoFullscreenModelContext):
3415         (WebKit::WebVideoFullscreenModelContext::invalidate):
3416         (WebKit::WebVideoFullscreenModelContext::layerHost):
3417         (WebKit::WebVideoFullscreenModelContext::setLayerHost):
3418         (WebKit::WebVideoFullscreenModelContext::setInitialVideoLayerFrame):
3419         (WebKit::WebVideoFullscreenModelContext::WebVideoFullscreenModelContext):
3420         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
3421         (WebKit::WebVideoFullscreenModelContext::play):
3422         (WebKit::WebVideoFullscreenModelContext::pause):
3423         (WebKit::WebVideoFullscreenModelContext::togglePlayState):
3424         (WebKit::WebVideoFullscreenModelContext::beginScrubbing):
3425         (WebKit::WebVideoFullscreenModelContext::endScrubbing):
3426         (WebKit::WebVideoFullscreenModelContext::seekToTime):
3427         (WebKit::WebVideoFullscreenModelContext::fastSeek):
3428         (WebKit::WebVideoFullscreenModelContext::beginScanningForward):
3429         (WebKit::WebVideoFullscreenModelContext::beginScanningBackward):
3430         (WebKit::WebVideoFullscreenModelContext::endScanning):
3431         (WebKit::WebVideoFullscreenModelContext::requestExitFullscreen):
3432         (WebKit::WebVideoFullscreenModelContext::setVideoLayerFrame):
3433         (WebKit::WebVideoFullscreenModelContext::videoLayerFrame):
3434         (WebKit::WebVideoFullscreenModelContext::setVideoLayerGravity):
3435         (WebKit::WebVideoFullscreenModelContext::videoLayerGravity):
3436         (WebKit::WebVideoFullscreenModelContext::selectAudioMediaOption):
3437         (WebKit::WebVideoFullscreenModelContext::selectLegibleMediaOption):
3438         (WebKit::WebVideoFullscreenModelContext::fullscreenModeChanged):
3439         (WebKit::WebVideoFullscreenModelContext::didSetupFullscreen):
3440         (WebKit::WebVideoFullscreenModelContext::didEnterFullscreen):
3441         (WebKit::WebVideoFullscreenModelContext::didExitFullscreen):
3442         (WebKit::WebVideoFullscreenModelContext::didCleanupFullscreen):
3443         (WebKit::WebVideoFullscreenModelContext::fullscreenMayReturnToInline):
3444         * WebProcess/ios/WebVideoFullscreenManager.h:
3445         (WebKit::WebVideoFullscreenInterfaceContext::create):
3446         (WebKit::WebVideoFullscreenInterfaceContext::invalidate):
3447         (WebKit::WebVideoFullscreenInterfaceContext::layerHostingContext):
3448         (WebKit::WebVideoFullscreenInterfaceContext::isAnimating):
3449         (WebKit::WebVideoFullscreenInterfaceContext::setIsAnimating):
3450         (WebKit::WebVideoFullscreenInterfaceContext::targetIsFullscreen):
3451         (WebKit::WebVideoFullscreenInterfaceContext::setTargetIsFullscreen):
3452         (WebKit::WebVideoFullscreenInterfaceContext::fullscreenMode):
3453         (WebKit::WebVideoFullscreenInterfaceContext::setFullscreenMode):
3454         (WebKit::WebVideoFullscreenInterfaceContext::isFullscreen):
3455         (WebKit::WebVideoFullscreenInterfaceContext::setIsFullscreen):
3456         * WebProcess/ios/WebVideoFullscreenManager.mm:
3457         (WebKit::WebVideoFullscreenInterfaceContext::WebVideoFullscreenInterfaceContext):
3458         (WebKit::WebVideoFullscreenInterfaceContext::~WebVideoFullscreenInterfaceContext):
3459         (WebKit::WebVideoFullscreenInterfaceContext::setLayerHostingContext):
3460         (WebKit::WebVideoFullscreenInterfaceContext::resetMediaState):
3461         (WebKit::WebVideoFullscreenInterfaceContext::setDuration):
3462         (WebKit::WebVideoFullscreenInterfaceContext::setCurrentTime):
3463         (WebKit::WebVideoFullscreenInterfaceContext::setBufferedTime):
3464         (WebKit::WebVideoFullscreenInterfaceContext::setRate):
3465         (WebKit::WebVideoFullscreenInterfaceContext::setVideoDimensions):
3466         (WebKit::WebVideoFullscreenInterfaceContext::setSeekableRanges):
3467         (WebKit::WebVideoFullscreenInterfaceContext::setCanPlayFastReverse):
3468         (WebKit::WebVideoFullscreenInterfaceContext::setAudioMediaSelectionOptions):
3469         (WebKit::WebVideoFullscreenInterfaceContext::setLegibleMediaSelectionOptions):
3470         (WebKit::WebVideoFullscreenInterfaceContext::setExternalPlayback):
3471
3472         Cross-process methods which now take a contextId parameter:
3473
3474         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
3475         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
3476         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
3477         (WebKit::WebVideoFullscreenManagerProxy::resetMediaState):
3478         (WebKit::WebVideoFullscreenManagerProxy::setCurrentTime):
3479         (WebKit::WebVideoFullscreenManagerProxy::setBufferedTime):
3480         (WebKit::WebVideoFullscreenManagerProxy::setVideoDimensions):
3481         (WebKit::WebVideoFullscreenManagerProxy::setSeekableRangesVector):
3482         (WebKit::WebVideoFullscreenManagerProxy::setCanPlayFastReverse):
3483         (WebKit::WebVideoFullscreenManagerProxy::setAudioMediaSelectionOptions):
3484         (WebKit::WebVideoFullscreenManagerProxy::setLegibleMediaSelectionOptions):
3485         (WebKit::WebVideoFullscreenManagerProxy::setExternalPlaybackProperties):
3486         (WebKit::WebVideoFullscreenManagerProxy::setDuration):
3487         (WebKit::WebVideoFullscreenManagerProxy::setRate):
3488         (WebKit::WebVideoFullscreenManagerProxy::exitFullscreen):
3489         (WebKit::WebVideoFullscreenManagerProxy::cleanupFullscreen):
3490         (WebKit::WebVideoFullscreenManagerProxy::preparedToReturnToInline):
3491         (WebKit::WebVideoFullscreenManagerProxy::play):
3492         (WebKit::WebVideoFullscreenManagerProxy::pause):
3493         (WebKit::WebVideoFullscreenManagerProxy::togglePlayState):
3494         (WebKit::WebVideoFullscreenManagerProxy::beginScrubbing):
3495         (WebKit::WebVideoFullscreenManagerProxy::endScrubbing):
3496         (WebKit::WebVideoFullscreenManagerProxy::seekToTime):
3497         (WebKit::WebVideoFullscreenManagerProxy::fastSeek):
3498         (WebKit::WebVideoFullscreenManagerProxy::beginScanningForward):
3499         (WebKit::WebVideoFullscreenManagerProxy::beginScanningBackward):
3500         (WebKit::WebVideoFullscreenManagerProxy::endScanning):
3501         (WebKit::WebVideoFullscreenManagerProxy::requestExitFullscreen):
3502         (WebKit::WebVideoFullscreenManagerProxy::didSetupFullscreen):
3503         (WebKit::WebVideoFullscreenManagerProxy::didExitFullscreen):
3504         (WebKit::WebVideoFullscreenManagerProxy::didEnterFullscreen):
3505         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen):
3506         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
3507         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerGravity):
3508         (WebKit::WebVideoFullscreenManagerProxy::selectAudioMediaOption):
3509         (WebKit::WebVideoFullscreenManagerProxy::selectLegibleMediaOption):
3510         (WebKit::WebVideoFullscreenManagerProxy::fullscreenModeChanged):
3511         (WebKit::WebVideoFullscreenManagerProxy::fullscreenMayReturnToInline):
3512         (WebKit::WebVideoFullscreenManagerProxy::videoLayerFrame): Deleted.
3513         (WebKit::WebVideoFullscreenManagerProxy::videoLayerGravity): Deleted.
3514         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
3515         * WebProcess/ios/WebVideoFullscreenManager.mm:
3516         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
3517         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement):
3518         (WebKit::WebVideoFullscreenManager::resetMediaState):
3519         (WebKit::WebVideoFullscreenManager::setDuration):
3520         (WebKit::WebVideoFullscreenManager::setCurrentTime):
3521         (WebKit::WebVideoFullscreenManager::setBufferedTime):
3522         (WebKit::WebVideoFullscreenManager::setRate):
3523         (WebKit::WebVideoFullscreenManager::setVideoDimensions):
3524         (WebKit::WebVideoFullscreenManager::setSeekableRanges):
3525         (WebKit::WebVideoFullscreenManager::setCanPlayFastReverse):
3526         (WebKit::WebVideoFullscreenManager::setAudioMediaSelectionOptions):
3527         (WebKit::WebVideoFullscreenManager::setLegibleMediaSelectionOptions):
3528         (WebKit::WebVideoFullscreenManager::setExternalPlayback):
3529         (WebKit::WebVideoFullscreenManager::play):
3530         (WebKit::WebVideoFullscreenManager::pause):
3531         (WebKit::WebVideoFullscreenManager::togglePlayState):
3532         (WebKit::WebVideoFullscreenManager::beginScrubbing):
3533         (WebKit::WebVideoFullscreenManager::endScrubbing):
3534         (WebKit::WebVideoFullscreenManager::seekToTime):
3535         (WebKit::WebVideoFullscreenManager::fastSeek):
3536         (WebKit::WebVideoFullscreenManager::beginScanningForward):
3537         (WebKit::WebVideoFullscreenManager::beginScanningBackward):
3538         (WebKit::WebVideoFullscreenManager::endScanning):
3539         (WebKit::WebVideoFullscreenManager::requestExitFullscreen):
3540         (WebKit::WebVideoFullscreenManager::selectAudioMediaOption):
3541         (WebKit::WebVideoFullscreenManager::selectLegibleMediaOption):
3542         (WebKit::WebVideoFullscreenManager::fullscreenModeChanged):
3543         (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
3544         (WebKit::WebVideoFullscreenManager::didEnterFullscreen):
3545         (WebKit::WebVideoFullscreenManager::didExitFullscreen):
3546         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
3547         (WebKit::WebVideoFullscreenManager::setVideoLayerGravityEnum):
3548         (WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline):
3549         (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced):
3550         (WebKit::WebVideoFullscreenManager::exitVideoFullscreen): Deleted.
3551
3552 2015-04-16  Beth Dakin  <bdakin@apple.com>
3553
3554         Force mouse events should go through normal mouse event handling code paths
3555         https://bugs.webkit.org/show_bug.cgi?id=143749
3556         -and corresponding-
3557         rdar://problem/20472895
3558
3559         Reviewed by Dean Jackson.
3560
3561         This patch makes pressureChangeWithEvent create NativeWebMouseEvents with the 
3562         NSEventTypePressures that is gets and sends those down to the web process.
3563
3564         Re-name pressureEvent to lastPressureEvent. Now that event can sometimes be an 
3565         NSEventTypePressure, the new name makes it clear how the second parameter differs 
3566         from the first.
3567         * Shared/NativeWebMouseEvent.h:
3568
3569         New event types for the new types of events.
3570         * Shared/WebEvent.h:
3571         * Shared/WebEventConversion.cpp:
3572         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
3573         * Shared/mac/NativeWebMouseEventMac.mm:
3574         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
3575         * Shared/mac/WebEventFactory.h:
3576
3577         All of the square-peg, round-hole problems of massaging the NSEventTypePressures 
3578         events into WebMouseEvents is taken care of here.
3579         * Shared/mac/WebEventFactory.mm:
3580         (WebKit::mouseButtonForEvent):
3581         (WebKit::globalPointForEvent):
3582         (WebKit::pointForEvent):
3583         (WebKit::WebEventFactory::createWebMouseEvent):
3584
3585         Instead of calling the old inputDeviceForceDidChange, create a NativeWebMouseEvent 
3586         and handle it.
3587         * UIProcess/API/mac/WKView.mm:
3588         (-[WKView pressureChangeWithEvent:]):
3589
3590         Handle the new types.
3591         * UIProcess/WebPageProxy.cpp:
3592         (WebKit::WebPageProxy::didReceiveEvent):
3593
3594         Can delete inputDeviceForceDidChange since it’s no longer used.
3595         (WebKit::WebPageProxy::inputDeviceForceDidChange): Deleted.
3596         * UIProcess/WebPageProxy.h:
3597
3598         Handle the new types of mouse events properly.
3599         * WebProcess/WebPage/WebPage.cpp:
3600         (WebKit::handleMouseEvent):
3601
3602         Delete inputDeviceForceDidChange() and m_lastForceStage.
3603         * WebProcess/WebPage/WebPage.h:
3604         * WebProcess/WebPage/WebPage.messages.in:
3605         * WebProcess/WebPage/mac/WebPageMac.mm:
3606         (WebKit::WebPage::inputDeviceForceDidChange): Deleted.
3607
3608         Handle new WebEvent types.
3609         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
3610
3611 2015-04-16  Dan Bernstein  <mitz@apple.com>
3612
3613         <rdar://problem/20575744> Also include a definition of __NSd_{current deployment target} in WKFoundation.h.
3614
3615         Reviewed by Tim Horton.
3616
3617         * WebKit2.xcodeproj/project.pbxproj:
3618
3619 2015-04-16  Timothy Horton  <timothy_horton@apple.com>
3620
3621         Provide a mechanism through the legacy SPI to know when swipe gestures begin and end
3622         https://bugs.webkit.org/show_bug.cgi?id=143740
3623         <rdar://problem/20468540>
3624
3625         Reviewed by Dan Bernstein.
3626
3627         In the C SPI, add three WKPageLoaderClient callbacks for the three
3628         navigation gesture events (did begin, will end, did end).
3629
3630         * UIProcess/API/C/WKPageLoaderClient.h:
3631         Add the callbacks.
3632
3633         * UIProcess/API/APILoaderClient.h:
3634         (API::LoaderClient::navigationGestureDidBegin):
3635         (API::LoaderClient::navigationGestureWillEnd):
3636         (API::LoaderClient::navigationGestureDidEnd):
3637         * UIProcess/WebPageProxy.cpp:
3638         (WebKit::WebPageProxy::navigationGestureDidBegin):
3639         (WebKit::WebPageProxy::navigationGestureWillEnd):
3640         (WebKit::WebPageProxy::navigationGestureDidEnd):
3641         Dispatch navigation gesture events to the loader client as well as
3642         (after a bounce through the PageClient) the navigation delegate.
3643
3644         * UIProcess/API/C/WKPage.cpp:
3645         (WKPageSetPageLoaderClient):
3646         Call the callbacks.
3647
3648         * UIProcess/mac/ViewGestureController.h:
3649         * UIProcess/mac/ViewGestureControllerMac.mm:
3650         (WebKit::ViewGestureController::trackSwipeGesture):
3651         (WebKit::ViewGestureController::willEndSwipeGesture):
3652         While we were already informing WebPageProxy of 'did begin' and 'did end'
3653         navigation gesture events, we were missing 'will end'. Add it.
3654
3655 2015-04-16  Tim Horton  <timothy_horton@apple.com>
3656
3657         Dispatching multiple asynchronous animated resizes in parallel causes page scale to detach from reality
3658         https://bugs.webkit.org/show_bug.cgi?id=143812
3659         <rdar://problem/19866038>
3660
3661         Reviewed by Simon Fraser.
3662
3663         * Shared/VisibleContentRectUpdateInfo.h:
3664         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
3665         No cats in transaction (more of these below, too).
3666
3667         * UIProcess/WebPageProxy.h:
3668         * UIProcess/WebPageProxy.messages.in:
3669         * UIProcess/ios/WebPageProxyIOS.mm:
3670         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
3671         (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget):
3672         * WebProcess/WebPage/WebPage.h:
3673         * WebProcess/WebPage/WebPage.messages.in:
3674         * WebProcess/WebPage/ios/WebPageIOS.mm:
3675         (WebKit::WebPage::handleTap):
3676         (WebKit::WebPage::commitPotentialTap):
3677         (WebKit::WebPage::dynamicViewportSizeUpdate):
3678         Add an incrementing ID to dynamicViewportSizeUpdates. The UI process keeps
3679         the current ID, and it is bounced through the Web process (dynamicViewportSizeUpdates)
3680         back to the UI process (dynamicViewportUpdateChangedTarget). If we have
3681         dispatched another dynamicViewportSizeUpdate in the interim, ignore
3682         the intermediate target.
3683
3684 2015-04-16  Sungmann Cho  <sungmann.cho@navercorp.com>
3685
3686         Remove PluginController::isPluginVisible().
3687         https://bugs.webkit.org/show_bug.cgi?id=143830
3688
3689         Reviewed by Darin Adler.
3690
3691         PluginController::isPluginVisible() was introduced by http://webkit.org/b/60285.
3692         This method had been used only for WebKit2 on Windows, and no one uses it now.
3693         So we can remove it.
3694
3695         No new tests, no behavior change.
3696
3697         * PluginProcess/PluginControllerProxy.cpp:
3698         (WebKit::PluginControllerProxy::isPluginVisible): Deleted.
3699         * PluginProcess/PluginControllerProxy.h:
3700         * WebProcess/Plugins/PluginController.h:
3701         * WebProcess/Plugins/PluginView.cpp:
3702         (WebKit::PluginView::isPluginVisible): Deleted.
3703         * WebProcess/Plugins/PluginView.h:
3704
3705 2015-04-16  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3706
3707         [EFL] Disable a flaky ewk_context_network_process_model() API test
3708         https://bugs.webkit.org/show_bug.cgi?id=143824
3709
3710         Reviewed by Csaba Osztrogonác.
3711
3712         ewk_context_network_process_model has been often failed. Though Bug 142967
3713         was filed to fix this issue, it is not solved yet. To maintain EFL bot, this patch
3714         disables it until fixing it.
3715
3716         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
3717         (TEST_F):
3718
3719 2015-04-16  Csaba Osztrogonác  <ossy@webkit.org>
3720
3721         [WK2] Forwarding headers generator shouldn't generate unnecessary headers
3722         https://bugs.webkit.org/show_bug.cgi?id=143820
3723
3724         Reviewed by Carlos Garcia Campos.
3725
3726         * Scripts/generate-forwarding-headers.pl:
3727         (collectNeededHeaders):
3728
3729 2015-04-16  Csaba Osztrogonác  <ossy@webkit.org>
3730
3731         [GTK] Run forwarding headers generator unconditionally
3732         https://bugs.webkit.org/show_bug.cgi?id=143819
3733
3734         Reviewed by Carlos Garcia Campos.
3735
3736         * PlatformGTK.cmake:
3737
3738 2015-04-15  Brent Fulgham  <bfulgham@apple.com>
3739
3740         [Mac] Disable "Save to Downloads" option for local files
3741         https://bugs.webkit.org/show_bug.cgi?id=143794
3742
3743         Reviewed by Tim Horton.
3744
3745         Disable the Image and Media download options if the download
3746         target is a local file. We can only download web resources;
3747         anything else is actually a no-op.
3748
3749         * UIProcess/mac/WKActionMenuController.mm:
3750         (-[WKActionMenuController _defaultMenuItemsForVideo]):
3751         (-[WKActionMenuController _defaultMenuItemsForImage]):
3752
3753 2015-04-15  Anders Carlsson  <andersca@apple.com>
3754
3755         Make websiteDataStore on WKWebViewConfiguration public
3756         https://bugs.webkit.org/show_bug.cgi?id=143810
3757
3758         Reviewed by Dan Bernstein.
3759
3760         * UIProcess/API/Cocoa/WKWebView.mm:
3761         (-[WKWebView initWithFrame:configuration:]):
3762         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
3763         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3764         (-[WKWebViewConfiguration copyWithZone:]):
3765         (-[WKWebViewConfiguration websiteDataStore]):
3766         (-[WKWebViewConfiguration setWebsiteDataStore:]):
3767         (-[WKWebViewConfiguration _websiteDataStore]):
3768         (-[WKWebViewConfiguration _setWebsiteDataStore:]):
3769
3770 2015-04-15  Anders Carlsson  <andersca@apple.com>
3771
3772         Make WKWebsiteDataStore public
3773         https://bugs.webkit.org/show_bug.cgi?id=143805
3774
3775         Reviewed by Dan Bernstein.
3776
3777         Rename the current _WKWebsiteDataStore to WKWebsiteDataStore. Make init unavailable and tighten up the
3778         types of the defaultDataStore and nonPersistentDataStore class methods.
3779         
3780         Add a new _WKWebsiteDataStore @interface and @implementation that derives from WKWebsiteDataStore
3781         and forwards the defaultDataStore and nonPersistentDataStore method calls.
3782
3783         * Shared/API/Cocoa/WebKit.h:
3784         * Shared/Cocoa/APIObject.mm:
3785         (API::Object::newObject):
3786         * UIProcess/API/Cocoa/WKWebView.mm:
3787         (-[WKWebView initWithFrame:configuration:]):
3788         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3789         (-[WKWebViewConfiguration _websiteDataStore]):
3790         * UIProcess/API/Cocoa/WKWebsiteDataStore.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.h.
3791         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.mm.
3792         (+[WKWebsiteDataStore defaultDataStore]):
3793         (+[WKWebsiteDataStore nonPersistentDataStore]):
3794         (-[WKWebsiteDataStore dealloc]):
3795         (-[WKWebsiteDataStore isNonPersistent]):
3796         (toSystemClockTime):
3797         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
3798         (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
3799         (toWebsiteDataRecords):
3800         (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
3801         (-[WKWebsiteDataStore _apiObject]):
3802         * UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStoreInternal.h.
3803         (WebKit::wrapper):
3804         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
3805         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
3806         (+[_WKWebsiteDataStore defaultDataStore]):
3807         (+[_WKWebsiteDataStore nonPersistentDataStore]):
3808         (-[_WKWebsiteDataStore dealloc]): Deleted.
3809         (-[_WKWebsiteDataStore isNonPersistent]): Deleted.
3810         (toWebsiteDataTypes): Deleted.
3811         (toSystemClockTime): Deleted.
3812         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]): Deleted.
3813         (-[_WKWebsiteDataStore _apiObject]): Deleted.
3814         * WebKit2.xcodeproj/project.pbxproj:
3815
3816 2015-04-15  Timothy Horton  <timothy_horton@apple.com>
3817
3818         Custom CSS cursors do not use -webkit-image-set on retina displays
3819         https://bugs.webkit.org/show_bug.cgi?id=120783
3820
3821         Reviewed by Beth Dakin.
3822         Patch by Evan Wallace <evan.exe@gmail.com>.
3823
3824         Serialize the cursor image scale for SetCursor messages so custom
3825         CSS cursors work with -webkit-image-set on retina displays.
3826
3827         * Shared/WebCoreArgumentCoders.cpp:
3828         (CoreIPC::ArgumentCoder<Cursor>::encode):
3829         (CoreIPC::ArgumentCoder<Cursor>::decode):
3830
3831 2015-04-15  Alex Christensen  <achristensen@webkit.org>
3832
3833         Progress towards CMake on Mac.
3834         https://bugs.webkit.org/show_bug.cgi?id=143785
3835
3836         Reviewed by Csaba Osztrogonác.
3837
3838         * CMakeLists.txt:
3839         * PlatformEfl.cmake:
3840         * PlatformGTK.cmake:
3841
3842 2015-04-15  Anders Carlsson  <andersca@apple.com>
3843
3844         Make WKWebsiteDataRecord public
3845         https://bugs.webkit.org/show_bug.cgi?id=143796
3846
3847         Reviewed by Dan Bernstein.
3848
3849         Rename _WKWebsiteDataRecord and associated files to WKWebsiteDataRecord and
3850         add a new _WKWebsiteDataRecord.h with a class @interface declaration that just
3851         inherits from WKWebsiteDataRecord. We don't need an @implementation since nobody is expected
3852         to allocate _WKWebsiteDataRecord objects.
3853
3854         * Shared/API/Cocoa/WebKit.h:
3855         * Shared/Cocoa/APIObject.mm:
3856         (API::Object::newObject):
3857         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataRecord.h.
3858         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm.
3859         (-[WKWebsiteDataRecord dealloc]):
3860         (dataTypesToString):
3861         (-[WKWebsiteDataRecord description]):
3862         (-[WKWebsiteDataRecord displayName]):
3863         (-[WKWebsiteDataRecord dataTypes]):
3864         (-[WKWebsiteDataRecord _apiObject]):
3865         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h.
3866         (WebKit::wrapper):
3867         (WebKit::toWebsiteDataTypes):
3868         (WebKit::toWKWebsiteDataTypes):
3869         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
3870         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
3871         (toWebsiteDataRecords):
3872         * WebKit2.xcodeproj/project.pbxproj:
3873
3874 2015-04-13  Jer Noble  <jer.noble@apple.com>
3875
3876         [Fullscreen] ChromeClient::exitVideoFullscreen() should take a pointer to a HTMLVideoElement.
3877         https://bugs.webkit.org/show_bug.cgi?id=143674
3878
3879         Reviewed by Darin Adler.
3880
3881         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3882         (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement): Takes a reference.
3883         (WebKit::WebChromeClient::exitVideoFullscreenForVideoElement): Renamed from exitVideoFullscreen().
3884         (WebKit::WebChromeClient::exitVideoFullscreen): Deleted.
3885         * WebProcess/WebCoreSupport/WebChromeClient.h:
3886         * WebProcess/ios/WebVideoFullscreenManager.h:
3887         * WebProcess/ios/WebVideoFullscreenManager.mm:
3888         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): Ditto.
3889         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement): Renamed from exitVideoFullscreen().
3890         (WebKit::WebVideoFullscreenManager::didEnterFullscreen): Pass a reference.
3891         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): Ditto.
3892         (WebKit::WebVideoFullscreenManager::exitVideoFullscreen): Deleted.
3893
3894 2015-04-15  Antti Koivisto  <antti@apple.com>
3895
3896         Network Cache: Inline small body data to record file
3897         https://bugs.webkit.org/show_bug.cgi?id=143783
3898
3899         Reviewed by Chris Dumez.
3900
3901         We currently save all body data as separate files. We can improve space efficiency and do less reads and writes
3902         by inlining smaller resource bodies with the header.
3903
3904         * NetworkProcess/cache/NetworkCacheIOChannel.h:
3905         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
3906         (WebKit::NetworkCache::IOChannel::read):
3907         (WebKit::NetworkCache::IOChannel::readSync):
3908         (WebKit::NetworkCache::IOChannel::write):
3909
3910             Add WorkQueue argument to allow specifying which queue the result is submitted to.
3911
3912         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3913         (WebKit::NetworkCache::decodeRecordMetaData):
3914
3915             Add a boolean indicating whether the body is inlined.
3916
3917         (WebKit::NetworkCache::decodeRecordHeader):
3918         (WebKit::NetworkCache::Storage::decodeRecord):
3919         (WebKit::NetworkCache::encodeRecordMetaData):
3920         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
3921         (WebKit::NetworkCache::Storage::encodeRecord):
3922         (WebKit::NetworkCache::Storage::dispatchReadOperation):
3923
3924             Read the record first, then read the blob if needed.
3925             Submit the read operation directly from the main queue. Only thing we do is opening an IO channel
3926             and that uses O_NONBLOCK.
3927             Process the read results in the IO work queue where we now do the blob retrieval.
3928
3929         (WebKit::NetworkCache::shouldStoreBodyAsBlob):
3930
3931             The current threshold for saving a separate blob is 16KB.
3932
3933         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
3934         (WebKit::NetworkCache::Storage::traverse):
3935         (WebKit::NetworkCache::createRecord): Deleted.
3936         (WebKit::NetworkCache::encodeRecordHeader): Deleted.
3937         * NetworkProcess/cache/NetworkCacheStorage.h:
3938
3939 2015-04-15  Tim Horton  <timothy_horton@apple.com>
3940
3941         Non-local keyboards don't update scroll view parameters
3942         https://bugs.webkit.org/show_bug.cgi?id=143791
3943         <rdar://problem/18974020>
3944
3945         * Platform/spi/ios/UIKitSPI.h:
3946         Fix the build.
3947
3948 2015-04-15  Tim Horton  <timothy_horton@apple.com>
3949
3950         Non-local keyboards don't update scroll view parameters
3951         https://bugs.webkit.org/show_bug.cgi?id=143791
3952         <rdar://problem/18974020>
3953
3954         Reviewed by Enrica Casucci.
3955
3956         * UIProcess/API/Cocoa/WKWebView.mm:
3957         (-[WKWebView _shouldUpdateKeyboardWithInfo:]):
3958         (-[WKWebView _keyboardWillChangeFrame:]):
3959         (-[WKWebView _keyboardWillShow:]):
3960         Make sure that we update scroll view parameters (obscured insets, etc.)
3961         if we have a non-local keyboard, in addition to the cases where we have an assisted node.
3962
3963 2015-04-15  Dan Bernstein  <mitz@apple.com>
3964
3965         <rdar://problem/20549298> No matching __NSi_ definition for postprocessed value of WK_{MAC,IOS}_TBA
3966         https://bugs.webkit.org/show_bug.cgi?id=143786
3967
3968         Reviewed by Anders Carlsson.
3969
3970         * Shared/API/Cocoa/WKFoundation.h: Added a placeholder for the postprocessing script to
3971         insert a definition of __NSi_* for the current deployment target. Import CoreFoundation.h so
3972         that we can check if the macro is already defined.
3973         * WebKit2.xcodeproj/project.pbxproj: In the Postprocess WKFoundation.h script build phase,
3974         replace the placeholder with a definition of __NSi_{current deployment target} if not
3975         already defined.
3976
3977 2015-04-14  Anders Carlsson  <andersca@apple.com>
3978
3979         Make creating send rights from shared memory more robust
3980         https://bugs.webkit.org/show_bug.cgi?id=143730
3981         rdar://problem/16595870
3982
3983         Reviewed by Darin Adler.
3984
3985         This cleans up creation of handles and send rights and also fixes a bug where it would be impossible
3986         to send more than 128 MB of shared memory in a single object.
3987
3988         * Platform/SharedMemory.h:
3989         * Platform/mac/SharedMemoryMac.cpp:
3990         (WebKit::makeMemoryEntry):
3991         New helper function that creates a memory entry send right. This uses MAP_MEM_VM_SHARE which ensures
3992         that memory objects larger than 128 MB will be handled correctly.
3993
3994         (WebKit::SharedMemory::create):
3995         Call makeMemoryEntry.
3996
3997         (WebKit::SharedMemory::createHandle):
3998         Call createSendRight.
3999
4000         (WebKit::SharedMemory::createSendRight):
4001         Call makeMemoryEntry and add the necessary assertions.
4002
4003 2015-04-15  Eric Carlson  <eric.carlson@apple.com>
4004
4005         Generalize "isPlayingAudio" to include other media characteristics
4006         https://bugs.webkit.org/show_bug.cgi?id=143713
4007
4008         Reviewed by Jer Noble.
4009
4010         * UIProcess/API/C/WKPage.cpp:
4011         (toGenericCallbackFunction): Scope CallbackBase.
4012         (WKPageForceRepaint): Ditto.
4013         (WKPageValidateCommand): Ditto.
4014         (WKPageComputePagesForPrinting): Ditto.
4015
4016         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
4017         (-[_WKThumbnailView _requestSnapshotIfNeeded]): Ditto.
4018
4019         * UIProcess/API/mac/WKView.mm:
4020         (-[WKView becomeFirstResponder]): Ditto.
4021         (-[WKView updateFontPanelIfNeeded]): Ditto.
4022         (-[WKView validateUserInterfaceItem:]): Ditto.
4023         (-[WKView startSpeaking:]): Ditto.
4024         (-[WKView selectedRangeWithCompletionHandler:]): Ditto.
4025         (-[WKView markedRangeWithCompletionHandler:]): Ditto.
4026         (-[WKView hasMarkedTextWithCompletionHandler:]): Ditto.
4027         (-[WKView attributedSubstringForProposedRange:completionHandler:]): Ditto.
4028         (-[WKView firstRectForCharacterRange:completionHandler:]): Ditto.
4029         (-[WKView characterIndexForPoint:completionHandler:]): Ditto.
4030
4031         * UIProcess/WebPageProxy.cpp:
4032         (WebKit::WebPageProxy::isPlayingMediaDidChange): Rename from isPlayingAudioDidChange.
4033         (WebKit::WebPageProxy::isPlayingAudioDidChange): Deleted.
4034         * UIProcess/WebPageProxy.h:
4035
4036         * UIProcess/WebPageProxy.messages.in:
4037
4038         * UIProcess/mac/WKFullScreenWindowController.mm:
4039         (-[WKFullScreenWindowController dealloc]): Scope CallbackBase.
4040         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Ditto.
4041
4042         * UIProcess/mac/WKPrintingView.mm:
4043         (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): Ditto.
4044         (-[WKPrintingView _askPageToComputePageRects]): Ditto.
4045         (-[WKPrintingView _drawPreview:]): Ditto.
4046
4047         * WebProcess/Plugins/PluginView.cpp:
4048         (WebKit::PluginView::setPluginIsPlayingAudio):
4049         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
4050         (WebKit::WebChromeClient::isPlayingMediaDidChange):
4051         (WebKit::WebChromeClient::isPlayingAudioDidChange): Deleted.
4052         * WebProcess/WebCoreSupport/WebChromeClient.h:
4053
4054 2015-04-15  Antti Koivisto  <antti@apple.com>
4055
4056         Network Cache: Add thread-safe accessors for storage paths
4057         https://bugs.webkit.org/show_bug.cgi?id=143668
4058
4059         Reviewed by Darin Adler.
4060
4061         Less need to use StringCapture.
4062
4063         * NetworkProcess/cache/NetworkCache.cpp:
4064         (WebKit::NetworkCache::Cache::dumpFilePath):
4065         (WebKit::NetworkCache::Cache::storagePath):
4066         * NetworkProcess/cache/NetworkCacheStorage.cpp:
4067         (WebKit::NetworkCache::makeRecordsDirectoryPath):