javascript: links in inline PDFs shouldn't execute JavaScript in the context of the...
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-04-13  Timothy Horton  <timothy_horton@apple.com>
2
3         javascript: links in inline PDFs shouldn't execute JavaScript in the context of the host website
4         https://bugs.webkit.org/show_bug.cgi?id=143642
5         <rdar://problem/18259355>
6
7         Reviewed by Darin Adler.
8
9         * WebProcess/Plugins/PDF/PDFPlugin.mm:
10         (WebKit::PDFPlugin::clickedLink):
11         Don't follow javascript: URLs.
12
13 2015-04-10  Alex Christensen  <achristensen@webkit.org>
14
15         [Content Extensions] Don't unmap shared memory while using it.
16         https://bugs.webkit.org/show_bug.cgi?id=143625
17
18         Reviewed by Darin Adler.
19
20         * Shared/WebCompiledContentExtension.cpp:
21         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
22         * Shared/WebCompiledContentExtensionData.h:
23         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
24         * UIProcess/API/APIUserContentExtensionStore.cpp:
25         (API::createExtension):
26         Keep the Data object alive as long as the SharedMemory that uses it.
27
28 2015-04-12  Darin Adler  <darin@apple.com>
29
30         [Cocoa] Localizable strings are inconsistent and need to be regenerated
31         https://bugs.webkit.org/show_bug.cgi?id=143661
32
33         Reviewed by Dan Bernstein.
34
35         * UIProcess/WebEditCommandProxy.cpp:
36         (WebKit::WebEditCommandProxy::nameForEditAction): Also added a comment
37         about the fact that we have two copies of all the localizable strings.
38
39 2015-04-12  Sungmann Cho  <sungmann.cho@navercorp.com>
40
41         Fix trival typos related to the word "coordinate".
42         https://bugs.webkit.org/show_bug.cgi?id=143644
43
44         Reviewed by Alexey Proskuryakov.
45
46         No new tests, no behavior change.
47
48         * Shared/WebHitTestResult.cpp:
49         (WebKit::WebHitTestResult::Data::encode):
50         (WebKit::WebHitTestResult::Data::decode):
51         * Shared/WebHitTestResult.h:
52         * WebProcess/WebPage/mac/WebPageMac.mm:
53         (WebKit::WebPage::performActionMenuHitTestAtLocation):
54         (WebKit::WebPage::lookupTextAtLocation):
55
56 2015-04-12  Sungmann Cho  <sungmann.cho@navercorp.com>
57
58         Remove PluginModuleInfo.cpp from WebKit2
59         https://bugs.webkit.org/show_bug.cgi?id=143643
60
61         Reviewed by Darin Adler.
62
63         Remove PluginModuleInfo.cpp from WebKit2 because it is totally empty.
64
65         No new tests, no behavior change.
66
67         * CMakeLists.txt:
68         * Shared/Plugins/PluginModuleInfo.cpp: Removed.
69         * WebKit2.xcodeproj/project.pbxproj:
70
71 2015-04-11  Yusuke Suzuki  <utatane.tea@gmail.com>
72
73         [ES6] Enable Symbol in web pages
74         https://bugs.webkit.org/show_bug.cgi?id=143375
75
76         Reviewed by Ryosuke Niwa.
77
78         * UIProcess/API/C/WKPreferencesRefPrivate.h:
79         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
80         * UIProcess/efl/WebInspectorProxyEfl.cpp:
81         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
82         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
83         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
84         * UIProcess/mac/WebInspectorProxyMac.mm:
85         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
86
87 2015-04-08  Sam Weinig  <sam@webkit.org>
88
89         Allow LaunchServices to handle URLs on link navigations
90         <rdar://problem/19446826>
91         https://bugs.webkit.org/show_bug.cgi?id=143544
92
93         Reviewed by Anders Carlsson.
94
95         * UIProcess/Cocoa/NavigationState.mm:
96         (WebKit::tryAppLink):
97         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
98         Only let LaunchServices have a crack at the URL if the navigation is:
99             1) a main frame navigation
100             2) a result of a user gesture
101
102 2015-04-10  Tim Horton  <timothy_horton@apple.com>
103
104         Replace setFixedLayoutSizeEnabled: with an enum of layout modes
105         https://bugs.webkit.org/show_bug.cgi?id=143576
106
107         Reviewed by Simon Fraser.
108
109         * UIProcess/API/C/WKLayoutMode.h: Added.
110         * UIProcess/API/Cocoa/WKViewPrivate.h:
111         * UIProcess/API/Cocoa/WKWebView.mm:
112         (-[WKWebView _layoutMode]):
113         (-[WKWebView _setLayoutMode:]):
114         (-[WKWebView _isFixedLayoutEnabled]): Deleted.
115         (-[WKWebView _setFixedLayoutEnabled:]): Deleted.
116         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
117         * UIProcess/API/Cocoa/_WKLayoutMode.h: Added.
118         * UIProcess/API/mac/WKView.mm:
119         (-[WKView _layoutMode]):
120         (-[WKView _setLayoutMode:]):
121         (-[WKView _isFixedLayoutEnabled]): Deleted.
122         (-[WKView _setFixedLayoutEnabled:]): Deleted.
123         * WebKit2.xcodeproj/project.pbxproj:
124         Add enums for "layout mode". Currently we have two values: "ViewSize",
125         which is the normal behavior, and "FixedSize", which is fixed layout mode.
126         More values will come in the future.
127
128 2015-04-10  Anders Carlsson  <andersca@apple.com>
129
130         _WKWebsiteDataStore doesn't track and remove offline application cache entries
131         https://bugs.webkit.org/show_bug.cgi?id=143614
132         rdar://problem/20243235
133
134         Reviewed by Andreas Kling.
135
136         * Shared/WebsiteData/WebsiteDataTypes.h:
137         Add WebsiteDataTypeOfflineWebApplicationCache.
138
139         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
140         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm:
141         (dataTypesToString):
142         * UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h:
143         (WebKit::toWebsiteDataTypes):
144         (WebKit::toWKWebsiteDataTypes):
145         Add WKWebsiteDataTypeOfflineWebApplicationCache.
146
147         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
148         (WebKit::WebsiteDataStore::fetchData):
149         Create a custom application cache storage and fetch the origins from it.
150
151         (WebKit::WebsiteDataStore::removeData):
152         Delete either all the cache entries (since we don't track time in the application cache),
153         or the ones specified by the given entries.
154
155 2015-04-10  Eric Carlson  <eric.carlson@apple.com>
156
157         [Mac] Refactor MediaPlaybackTarget
158         https://bugs.webkit.org/show_bug.cgi?id=143571
159
160         Reviewed by Jer Noble.
161
162         Pass a MediaPlaybackTargetContext across process boundary instead of a MediaPlaybackTarget.
163         * Shared/WebCoreArgumentCoders.h:
164         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encode): New.
165         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decode): New.
166         * Shared/mac/WebCoreArgumentCoders.cpp:
167         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): New.
168         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): New.
169         (IPC::ArgumentCoder<MediaPlaybackTarget>::encode): Deleted.
170         (IPC::ArgumentCoder<MediaPlaybackTarget>::decode): Deleted.
171         * UIProcess/WebPageProxy.cpp:
172         (WebKit::WebPageProxy::didChoosePlaybackTarget): Take a Ref<MediaPlaybackTarget>&&.
173         * UIProcess/WebPageProxy.h:
174         * WebProcess/WebPage/WebPage.h:
175         * WebProcess/WebPage/WebPage.messages.in:
176         * WebProcess/WebPage/mac/WebPageMac.mm:
177         (WebKit::WebPage::playbackTargetSelected): Take a Ref<MediaPlaybackTarget>&&.
178
179 2015-04-10  Hunseop Jeong  <hs85.jeong@samsung.com>
180
181         Fix some minor typos related to the WebProcessCreationParameter. 
182         https://bugs.webkit.org/show_bug.cgi?id=143598
183
184         Reviewed by Csaba Osztrogonác.
185
186         No new tests, no behavior change.
187
188         * Shared/WebProcessCreationParameters.cpp:
189         (WebKit::WebProcessCreationParameters::encode):
190         (WebKit::WebProcessCreationParameters::decode):
191         * Shared/WebProcessCreationParameters.h:
192         * UIProcess/WebProcessPool.cpp:
193         (WebKit::WebProcessPool::createNewWebProcess):
194         * WebProcess/WebProcess.cpp:
195         (WebKit::WebProcess::initializeWebProcess):
196
197 2015-04-09  Andy Estes  <aestes@apple.com>
198
199         [Cocoa] Add a HAVE(AVKIT) and use it
200         https://bugs.webkit.org/show_bug.cgi?id=143593
201
202         Reviewed by David Kilzer.
203
204         * UIProcess/API/Cocoa/WKWebView.mm:
205         (-[WKWebView _mayAutomaticallyShowVideoOptimized]): Returned false if !HAVE(AVKIT).
206         * UIProcess/WebPageProxy.cpp:
207         (WebKit::WebPageProxy::WebPageProxy): Removed the check for < iOS 8.2.
208         (WebKit::WebPageProxy::reattachToWebProcess): Ditto.
209         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
210         (WebKit::WebVideoFullscreenManagerProxy::create): Created a version of this function that returns nullptr if
211         the minimum required version of iOS is less than 8.2 or if !HAVE(AVKIT).
212         * WebProcess/WebPage/WebPage.cpp:
213         (WebKit::WebPage::updatePreferences): Only called Settings::setAVKitEnabled(true) if HAVE(AVKIT).
214
215 2015-04-09  Hunseop Jeong  <hs85.jeong@samsung.com>
216
217         Use modern loops in WebProcess 
218         https://bugs.webkit.org/show_bug.cgi?id=143302
219
220         Reviewed by Darin Adler.
221
222         Use modern range for-loops in WebProcess.
223
224         No new tests, no behavior change.
225
226         * WebProcess/WebProcess.cpp:
227         (WebKit::WebProcess::initializeConnection):
228         (WebKit::WebProcess::initializeWebProcess):
229         (WebKit::WebProcess::focusedWebPage):
230         (WebKit::WebProcess::webPageGroup):
231         (WebKit::WebProcess::setTextCheckerState):
232         (WebKit::WebProcess::resetAllGeolocationPermissions):
233
234 2015-04-09  Gordon Sheridan  <gordon_sheridan@apple.com>
235
236         Track IconDatabase retain counts for WebContent processes. Balance retain/releases for processes that terminate before successfully doing it themselves.
237         https://bugs.webkit.org/show_bug.cgi?id=143517.
238
239         Reviewed by Brady Eidson.
240
241         * UIProcess/WebIconDatabase.messages.in:
242         Move RetainIconForPageURL and ReleaseIconForPageURL messages to WebProcessProxy so they can be associated with the appropriate web process.
243
244         * UIProcess/WebProcessProxy.cpp:
245         (WebKit::WebProcessProxy::connectionDidClose):
246         Call releaseRemainingIconsForPageURLs() to balance retains/releases for this process.
247
248         (WebKit::WebProcessProxy::retainIconForPageURL):
249         Track retain counts for page URLs and call through to WebIconDatabase.
250
251         (WebKit::WebProcessProxy::releaseIconForPageURL):
252         Ditto.
253
254         (WebKit::WebProcessProxy::releaseRemainingIconsForPageURLs):
255         Call releaseIconForPageURL() once for each outstanding retain count, for each page URL.
256
257         * UIProcess/WebProcessProxy.h:
258         Declare methods for retainIconForPageURL(), releaseIconForPageURL(), and releaseRemainingIconsForPageURLs().
259         Declare hash map to track number of retains per page URL.
260
261         * UIProcess/WebProcessProxy.messages.in:
262         Moved RetainIconForPageURL and ReleaseIconForPageURL messages here from WebIconDatabase.
263
264         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
265         (WebKit::WebIconDatabaseProxy::retainIconForPageURL):
266         Modify the receiver of the message to be WebProcessProxy.
267
268         (WebKit::WebIconDatabaseProxy::releaseIconForPageURL):
269         Ditto.
270
271 2015-04-09  Chris Dumez  <cdumez@apple.com>
272
273         [WK2] Regression(r182194): The NetworkProcess is calling the wrong memory pressure handler before suspending
274         https://bugs.webkit.org/show_bug.cgi?id=143575
275         <rdar://problem/20484338>
276
277         Reviewed by Andreas Kling.
278
279         After r182194, the NetworkProcess is calling the memory pressure
280         handler before getting suspended to free-up as much memory as possible
281         at this point.
282
283         However, we were calling the default memory pressure handling code
284         instead of the custom handler registered by the NetworkProcess. This
285         patch fixes the problem.
286
287         * NetworkProcess/NetworkProcess.cpp:
288         (WebKit::NetworkProcess::lowMemoryHandler):
289         (WebKit::NetworkProcess::initializeNetworkProcess):
290         (WebKit::NetworkProcess::processWillSuspend):
291         * NetworkProcess/NetworkProcess.h:
292
293 2015-04-09  Brady Eidson  <beidson@apple.com>
294
295         REGRESSION (r182573): Action Menus no longer appear for WebKit2 views displaying an image
296         rdar://problem/20486551 and https://bugs.webkit.org/show_bug.cgi?id=143574
297
298         Reviewed by Brent Fulgham.
299
300         * Shared/WebHitTestResult.cpp:
301         (WebKit::WebHitTestResult::Data::Data): Clear up a name scoping issue.
302
303 2015-04-09  Chris Dumez  <cdumez@apple.com>
304
305         [WK2][iOS] editorState() should not cause a synchronous layout
306         https://bugs.webkit.org/show_bug.cgi?id=142536
307         <rdar://problem/20041506>
308
309         Reviewed by Enrica Casucci.
310
311         platformEditorState() on iOS does a synchronous layout to compute some
312         of the EditorState members (e.g. caretRectAtStart / caretRectAtEnd).
313         This is bad for performance as this is called every time the selection
314         is changed (which happens for e.g. when you set the value of a focused
315         HTMLInputElement).
316
317         This patch updates the behavior on iOS to only send a partial EditorState
318         on selection change so that the UIProcess gets most of the information
319         (the ones that do not require style recalc or layout) ASAP. A full Editor
320         state is then sent after the asynchronous layout is done.
321
322         With this change, I see a 38% improvement on Speedometer (26.4 +/- 0.37
323         -> 36.5 +/- 0.54) on iPhone 6 Plus.
324
325         * Shared/EditorState.cpp:
326         (WebKit::EditorState::encode):
327         (WebKit::EditorState::decode):
328         (WebKit::EditorState::PostLayoutData::encode):
329         (WebKit::EditorState::PostLayoutData::decode):
330         * Shared/EditorState.h:
331         (WebKit::EditorState::EditorState): Deleted.
332         * UIProcess/ios/WKContentView.mm:
333         (-[WKContentView _didCommitLayerTree:]):
334         * UIProcess/ios/WKContentViewInteraction.mm:
335         (WebKit::WKSelectionDrawingInfo::WKSelectionDrawingInfo):
336         (-[WKContentView webSelectionRects]):
337         (-[WKContentView _addShortcut:]):
338         (-[WKContentView selectedText]):
339         (-[WKContentView isReplaceAllowed]):
340         (-[WKContentView _promptForReplace:]):
341         (-[WKContentView _transliterateChinese:]):
342         (-[WKContentView textStylingAtPosition:inDirection:]):
343         (-[WKContentView canPerformAction:withSender:]):
344         (-[WKContentView _showDictionary:]):
345         (-[WKContentView _characterBeforeCaretSelection]):
346         (-[WKContentView _characterInRelationToCaretSelection:]):
347         (-[WKContentView _selectionAtDocumentStart]):
348         (-[WKContentView selectedTextRange]):
349         (-[WKContentView hasContent]):
350         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
351         (WebKit::WebEditorClient::didChangeSelectionAndUpdateLayout):
352         * WebProcess/WebCoreSupport/WebEditorClient.h:
353         * WebProcess/WebPage/WebPage.cpp:
354         (WebKit::WebPage::editorState):
355         (WebKit::WebPage::didChangeSelection):
356         (WebKit::WebPage::sendPostLayoutEditorStateIfNeeded):
357         * WebProcess/WebPage/WebPage.h:
358         * WebProcess/WebPage/efl/WebPageEfl.cpp:
359         (WebKit::WebPage::platformEditorState):
360         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
361         (WebKit::WebPage::platformEditorState):
362         * WebProcess/WebPage/ios/WebPageIOS.mm:
363         (WebKit::WebPage::platformEditorState):
364         * WebProcess/WebPage/mac/WebPageMac.mm:
365         (WebKit::WebPage::platformEditorState):
366
367 2015-04-09  Antti Koivisto  <antti@apple.com>
368
369         Network Cache: Crash in WebCore::CachedResource::tryReplaceEncodedData
370         https://bugs.webkit.org/show_bug.cgi?id=143562
371
372         Reviewed by Anders Carlsson.
373
374         If another thread comes and truncates the file before we map it we end up with a map that crashes when accessed.
375
376         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
377         (WebKit::NetworkCache::IOChannel::IOChannel):
378
379             When creating a new file unlink any existing file instead of using O_TRUNC.
380
381 2015-04-09  Csaba Osztrogonác  <ossy@webkit.org>
382
383         [EFL][GTK] WebKit2's generate-forwarding-headers.pl runs too many times
384         https://bugs.webkit.org/show_bug.cgi?id=142907
385
386         Unreviewed typo fix after r182595.
387
388         * PlatformGTK.cmake:
389
390 2015-04-09  Csaba Osztrogonác  <ossy@webkit.org>
391
392         [EFL][GTK] WebKit2's generate-forwarding-headers.pl runs too many times
393         https://bugs.webkit.org/show_bug.cgi?id=142907
394
395         Reviewed by Carlos Garcia Campos.
396
397         * PlatformEfl.cmake:
398         * PlatformGTK.cmake:
399         * Scripts/generate-forwarding-headers.pl: Make it work with more path and platform arguments.
400
401 2015-04-08  Joseph Pecoraro  <pecoraro@apple.com>
402
403         Exception in console and broken right click after attempting to show context menu in Inspector
404         https://bugs.webkit.org/show_bug.cgi?id=143556
405
406         Reviewed by Brady Eidson.
407
408         * Shared/mac/NativeContextMenuItem.mm:
409         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
410         Add an ASSERT to immediately catch a menu item created with a nil native menu item.
411
412         * UIProcess/WebPageProxy.cpp:
413         (WebKit::WebPageProxy::internalShowContextMenu):
414         Gracefully handle a null share context menu item.
415
416 2015-04-08  Brent Fulgham  <bfulgham@apple.com>
417
418         [Mac] Unreviewed test fix after r182584
419         https://bugs.webkit.org/show_bug.cgi?id=143452
420
421         Correct bit comparison to use the correct value for the Control-key
422
423         * Shared/mac/WebEventFactory.mm:
424         (WebKit::typeForEvent):
425
426 2015-04-08  Jaehun Lim  <ljaehun.lim@samsung.com>
427
428         [EFL] Create PageUIClientEfl after sending CreateWebPage message
429         https://bugs.webkit.org/show_bug.cgi?id=143514
430
431         Reviewed by Gyuyoung Kim.
432
433         UIProcess sends some messages to WebPage before WebPage is created. It makes some error logs on debug build.
434         So this patch moves the initialization of m_pageUIClient after calling WKViewInitialize().
435
436         * UIProcess/API/efl/EwkView.cpp:
437         (EwkView::EwkView):
438
439 2015-04-08  Brent Fulgham  <bfulgham@apple.com>
440
441         [Mac] WebKit is not honoring OS preferences for secondary click behaviors
442         https://bugs.webkit.org/show_bug.cgi?id=143452
443         <rdar://problem/20437483>
444
445         Reviewed by Tim Horton.
446
447         We cannot rely on the event's button number to decide behavior. The OS settings might have
448         mapped middle button to context menu, etc. Instead, we should ask the OS (via NSMenu) what
449         the proper button press behavior is.
450
451         * Shared/mac/WebEventFactory.mm:
452         (WebKit::mouseButtonForEvent): Ask NSMenu what kind of button press we have received.
453
454 2015-04-08  Brady Eidson  <beidson@apple.com>
455
456         Expose the "Share" menu for links, images, and media.
457         <rdar://problem/20435340> and https://bugs.webkit.org/show_bug.cgi?id=143502
458
459         Reviewed by Tim Horton.
460
461         * Shared/ContextMenuContextData.cpp:
462         (WebKit::ContextMenuContextData::ContextMenuContextData):
463
464         * Shared/WebHitTestResult.cpp:
465         (WebKit::WebHitTestResult::Data::Data):
466         * Shared/WebHitTestResult.h:
467
468         * UIProcess/WebPageProxy.cpp:
469         (WebKit::WebPageProxy::internalShowContextMenu):
470
471         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
472         (WebKit::WebContextMenuClient::shareMenuItem):
473         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
474
475         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
476         (WebKit::WebContextMenuClient::shareSelectedTextMenuItem): Deleted.
477
478         * WebProcess/WebPage/mac/WebPageMac.mm:
479         (WebKit::WebPage::performActionMenuHitTestAtLocation):
480
481 2015-04-08  Anders Carlsson  <andersca@apple.com>
482
483         Add encoding and decoding of ints to WKRemoteObjectCoder
484         https://bugs.webkit.org/show_bug.cgi?id=143538
485
486         Reviewed by Tim Horton.
487
488         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
489         (-[WKRemoteObjectEncoder encodeInt:forKey:]):
490         (-[WKRemoteObjectDecoder decodeIntForKey:]):
491
492 2015-04-08  Anders Carlsson  <andersca@apple.com>
493
494         Delete ApplicationCache static member functions
495         https://bugs.webkit.org/show_bug.cgi?id=143534
496
497         Reviewed by Tim Horton.
498
499         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
500         (WebKit::WebApplicationCacheManager::deleteEntriesForOrigin):
501         (WebKit::WebApplicationCacheManager::deleteAllEntries):
502         * WebProcess/InjectedBundle/InjectedBundle.cpp:
503         (WebKit::InjectedBundle::clearApplicationCacheForOrigin):
504         (WebKit::InjectedBundle::appCacheUsageForOrigin):
505
506 2015-04-08  Enrica Casucci  <enrica@apple.com>
507
508         32-bit build fix after r182554.
509
510         * UIProcess/API/mac/WKView.mm:
511         (-[WKView resignFirstResponder]):
512
513 2015-04-08  Beth Dakin  <bdakin@apple.com>
514
515         Force events should not require preventDefault in order to fire
516         https://bugs.webkit.org/show_bug.cgi?id=143503
517         -and corresponding-
518         rdar://problem/20458916
519
520         Reviewed by Tim Horton.
521
522         We no longer need m_lastActionMenuHitTestPreventsDefault since we’ll always 
523         dispatch the events to Element.
524         * WebProcess/WebPage/WebPage.cpp:
525         (WebKit::WebPage::WebPage):
526         * WebProcess/WebPage/WebPage.h:
527         * WebProcess/WebPage/mac/WebPageMac.mm:
528         (WebKit::WebPage::performActionMenuHitTestAtLocation):
529         (WebKit::WebPage::inputDeviceForceDidChange):
530         (WebKit::WebPage::immediateActionDidCancel):
531
532 2015-04-08  Enrica Casucci  <enrica@apple.com>
533
534         Calling makeFirstResponder on WKWebView doesn't work.
535         https://bugs.webkit.org/show_bug.cgi?id=143482
536         rdar://problem/20298166
537
538         Reviewed by Dan Bernstein.
539
540         Adding forwarding of the responder status to the WKView.
541         We also need to avoid doing any cleanup in resignFirstResponder
542         if we know we are about to regain responder status again.
543         Same goes for becomeFirstResponder.
544
545         * UIProcess/API/Cocoa/WKWebView.mm:
546         (-[WKWebView becomeFirstResponder]):
547         (-[WKWebView acceptsFirstResponder]):
548         * UIProcess/API/mac/WKView.mm:
549         (-[WKView becomeFristResponder]):
550         (-[WKView resignFirstResponder]):
551
552 2015-04-07  Tim Horton  <timothy_horton@apple.com>
553
554         Fix the build.
555
556         * UIProcess/API/mac/WKView.mm:
557         (-[WKView _setFixedLayoutSize:]):
558
559 2015-04-07  Tim Horton  <timothy_horton@apple.com>
560
561         Expose and test fixedLayoutSize via modern WebKit SPI
562         https://bugs.webkit.org/show_bug.cgi?id=143500
563
564         Reviewed by Simon Fraser.
565
566         * UIProcess/API/Cocoa/WKViewPrivate.h:
567         * UIProcess/API/Cocoa/WKWebView.mm:
568         (-[WKWebView _isFixedLayoutEnabled]):
569         (-[WKWebView _setFixedLayoutEnabled:]):
570         (-[WKWebView _fixedLayoutSize]):
571         (-[WKWebView _setFixedLayoutSize:]):
572         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
573         * UIProcess/API/mac/WKView.mm:
574         (-[WKView _isFixedLayoutEnabled]):
575         (-[WKView _setFixedLayoutEnabled:]):
576         (-[WKView _fixedLayoutSize]):
577         (-[WKView _setFixedLayoutSize:]):
578         Add API for adjusting the fixed layout size, and whether or not we use it.
579
580         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
581         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
582         Repair a mistake I made in r139822, where I brought odd TILED_BACKING_STORE-only
583         logic (which disables scrollbars if fixedLayoutSize is enabled) to the rest of the ports.
584         Put it back as TILED_BACKING_STORE-only.
585
586         Persist the fixedLayoutSize through view creation; we already persist the enabled state,
587         but not the size, which doesn't make any sense.
588
589         * WebProcess/WebPage/WebPage.cpp:
590         (WebKit::WebPage::fixedLayoutSize):
591         * WebProcess/WebPage/WebPage.h:
592         Add a fixedLayoutSize() getter.
593
594 2015-04-07  Brady Eidson  <beidson@apple.com>
595
596         ContextMenuItem refactoring
597         https://bugs.webkit.org/show_bug.cgi?id=143485
598
599         Reviewed by Beth Dakin.
600
601         * Shared/mac/NativeContextMenuItem.mm:
602         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
603
604 2015-04-07  Simon Fraser  <simon.fraser@apple.com>
605
606         Add a new setting, AntialiasedFontDilationEnabled, exposed via WK2.
607         https://bugs.webkit.org/show_bug.cgi?id=143495
608
609         Reviewed by Tim Horton.
610         
611         Exposed the antialiasedFontDilationEnabled setting via WK C SPI and Objective-C SPI.
612
613         * Shared/WebPreferencesDefinitions.h:
614         * UIProcess/API/C/WKPreferences.cpp:
615         (WKPreferencesSetAntialiasedFontDilationEnabled):
616         (WKPreferencesGetAntialiasedFontDilationEnabled):
617         * UIProcess/API/C/WKPreferencesRefPrivate.h:
618         * UIProcess/API/Cocoa/WKPreferences.mm:
619         (-[WKPreferences _antialiasedFontDilationEnabled]):
620         (-[WKPreferences _setAntialiasedFontDilationEnabled:]):
621         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
622         * WebProcess/WebPage/WebPage.cpp:
623         (WebKit::WebPage::updatePreferences):
624
625 2015-04-07  Beth Dakin  <bdakin@apple.com>
626
627         Should only propagate pressure events with relevant phases
628         https://bugs.webkit.org/show_bug.cgi?id=143494
629         -and corresponding-
630         rdar://problem/20453738
631
632         Reviewed by Tim Horton.
633
634         We only care about the changed, began, and ended phases. 
635         * UIProcess/API/mac/WKView.mm:
636         (-[WKView pressureChangeWithEvent:]):
637
638 2015-04-07  Jer Noble  <jer.noble@apple.com>
639
640         Unreviewed build fix; make calls to new SPI conditional on iOS version.
641
642         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
643         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
644
645 2015-04-06  Anders Carlsson  <andersca@apple.com>
646
647         Create the web inspector process pool lazily
648         https://bugs.webkit.org/show_bug.cgi?id=143456
649         rdar://problem/20146520
650
651         Reviewed by Mark Lam.
652
653         Add and implement WebInspectorProxy::isInspectorProcessPool instead of always creating the inspector process pool
654         when trying to determine if a given process pool is the inspector process pool.
655
656         This should speed up initialization somewhat and avoid creating a storage manager for example.
657
658         * UIProcess/WebInspectorProxy.cpp:
659         (WebKit::WebInspectorProxy::inspectorProcessPool):
660         (WebKit::WebInspectorProxy::isInspectorProcessPool):
661         * UIProcess/WebInspectorProxy.h:
662         * UIProcess/WebProcessProxy.cpp:
663         (WebKit::WebProcessProxy::getLaunchOptions):
664
665 2015-04-06  Brady Eidson  <beidson@apple.com>
666
667         Combine ActionMenuHitTestResult with WebHitTestResult
668         https://bugs.webkit.org/show_bug.cgi?id=143444
669
670         Reviewed by Beth Dakin.
671
672         * Shared/mac/ActionMenuHitTestResult.h: Removed.
673         * Shared/mac/ActionMenuHitTestResult.mm: Removed.
674
675         * Shared/WebHitTestResult.cpp:
676         (WebKit::WebHitTestResult::Data::Data):
677         (WebKit::WebHitTestResult::Data::encode):
678         (WebKit::WebHitTestResult::Data::decode):
679         (WebKit::WebHitTestResult::Data::platformEncode):
680         (WebKit::WebHitTestResult::Data::platformDecode):
681         * Shared/WebHitTestResult.h:
682         * Shared/mac/WebHitTestResult.mm: Added.
683         (WebKit::WebHitTestResult::Data::platformEncode):
684         (WebKit::WebHitTestResult::Data::platformDecode):
685
686         * UIProcess/API/mac/WKView.mm:
687         (-[WKView _didPerformActionMenuHitTest:forImmediateAction:contentPreventsDefault:userData:]):
688         (-[WKView _didPerformActionMenuHitTest:forImmediateAction:userData:]): Deleted.
689         * UIProcess/API/mac/WKViewInternal.h:
690         * UIProcess/PageClient.h:
691         * UIProcess/WebPageProxy.cpp:
692         (WebKit::WebPageProxy::didPerformActionMenuHitTest):
693         * UIProcess/WebPageProxy.h:
694         * UIProcess/WebPageProxy.messages.in:
695         * UIProcess/mac/PageClientImpl.h:
696         * UIProcess/mac/PageClientImpl.mm:
697         (WebKit::PageClientImpl::didPerformActionMenuHitTest):
698         * UIProcess/mac/WKActionMenuController.h:
699         * UIProcess/mac/WKActionMenuController.mm:
700         (-[WKActionMenuController willDestroyView:]):
701         (-[WKActionMenuController _clearActionMenuState]):
702         (-[WKActionMenuController didPerformActionMenuHitTest:userData:]):
703         (-[WKActionMenuController _hitTestResultDataImage]):
704         (-[WKActionMenuController _defaultMenuItemsForImage]):
705         (-[WKActionMenuController _copyImage:]):
706         (-[WKActionMenuController _addImageToPhotos:]):
707         (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
708         (-[WKActionMenuController _defaultMenuItemsForEditableTextWithSuggestions]):
709         (-[WKActionMenuController _defaultMenuItemsForDataDetectableLink]):
710         (-[WKActionMenuController _webHitTestResult]):
711         (-[WKActionMenuController _defaultMenuItems]):
712         (-[WKActionMenuController _hitTestResultImage]): Deleted.
713         * UIProcess/mac/WKImmediateActionController.h:
714         * UIProcess/mac/WKImmediateActionController.mm:
715         (-[WKImmediateActionController willDestroyView:]):
716         (-[WKImmediateActionController _clearImmediateActionState]):
717         (-[WKImmediateActionController didPerformActionMenuHitTest:contentPreventsDefault:userData:]):
718         (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
719         (-[WKImmediateActionController _webHitTestResult]):
720         (-[WKImmediateActionController _defaultAnimationController]):
721         (-[WKImmediateActionController _updateImmediateActionItem]):
722         (-[WKImmediateActionController _menuItemForDataDetectedText]):
723         (-[WKImmediateActionController _animationControllerForText]):
724         (-[WKImmediateActionController didPerformActionMenuHitTest:userData:]): Deleted.
725         * WebKit2.xcodeproj/project.pbxproj:
726         * WebProcess/WebPage/mac/WebPageMac.mm:
727         (WebKit::WebPage::performActionMenuHitTestAtLocation):
728
729 2015-04-06  Jer Noble  <jer.noble@apple.com>
730
731         Synchronize fullscreen animation between processes.
732         https://bugs.webkit.org/show_bug.cgi?id=143131
733
734         Reviewed by Simon Fraser.
735
736         Support synchronize resizing by animating within the UIProcess. Since setVideoLayerFrameFenced() is now only
737         ever called from within a 0-duration transaction, make that the official contract of the function and wrap
738         the WebProcess side of that method in its own 0-duration transaction.
739
740         * Platform/spi/ios/BackBoardServicesSPI.h: Added.
741         * Platform/spi/ios/UIKitSPI.h:
742         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
743         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
744         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Remember the initial rect.
745         (WebKit::WebVideoFullscreenManagerProxy::videoLayerFrame): Added; simple getter.
746         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame): Use a different synchronization fence primative.
747             Save the cached frame value.
748         (WebKit::WebVideoFullscreenManagerProxy::videoLayerGravity): Added; simple getter.
749         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerGravity): Save the cached gravity value.
750         * WebKit2.xcodeproj/project.pbxproj:
751         * WebProcess/ios/WebVideoFullscreenManager.mm:
752         (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced): Wrap in a 0-length transaction.
753
754 2015-04-06  Chris Dumez  <cdumez@apple.com>
755
756         [WK2][iOS] Regression(r182323): ASSERTION FAILED: WebCore::SQLiteDatabaseTracker::hasTransactionInProgress() in NetworkCache::Statistics::initialize()
757         https://bugs.webkit.org/show_bug.cgi?id=143451
758         <rdar://problem/20437994>
759
760         Reviewed by Anders Carlsson.
761
762         Initialize WebProcess::m_webSQLiteDatabaseTracker and
763         NetworkProcess::m_webSQLiteDatabaseTracker in their respective class
764         constructors instead of doing it later in the initializeWebProcess() /
765         initializeNetworkProcess() methods.
766
767         If we do it later, it can happen that the tracker gets set after
768         a SQLiteTransactionInProgressAutoCounter initialization and before
769         the actual transaction. When this happens, the
770         SQLiteTransactionInProgressAutoCounter variable fails to increment the
771         transaction count. Then when the transaction is executed,
772         SQLiteDatabaseTracker::hasTransactionInProgress() can return false.
773         This would lead to possible assertions on start up on iOS.
774
775         * NetworkProcess/NetworkProcess.cpp:
776         (WebKit::NetworkProcess::NetworkProcess):
777         (WebKit::NetworkProcess::initializeNetworkProcess):
778         * NetworkProcess/NetworkProcess.h:
779         * WebProcess/WebProcess.cpp:
780         (WebKit::WebProcess::WebProcess):
781         (WebKit::WebProcess::initializeConnection):
782         * WebProcess/WebProcess.h:
783
784 2015-04-06  Beth Dakin  <bdakin@apple.com>
785
786         https://trac.webkit.org/changeset/182338 introduced a build failure that I 
787         attempted to fix with https://trac.webkit.org/changeset/182341 , but that disabled 
788         the feature accidentally.  This should do the right thing.
789
790         * UIProcess/API/mac/WKView.mm:
791         (-[WKView pressureChangeWithEvent:]):
792
793 2015-04-06  Commit Queue  <commit-queue@webkit.org>
794
795         Unreviewed, rolling out r182296.
796         https://bugs.webkit.org/show_bug.cgi?id=143448
797
798         This will disturb network cache efficacy logging, we should
799         reland this later. (Requested by cdumez__ on #webkit).
800
801         Reverted changeset:
802
803         "[WK2][NetworkCache] Drop HTTP method from NetworkCache::Key"
804         https://bugs.webkit.org/show_bug.cgi?id=143348
805         http://trac.webkit.org/changeset/182296
806
807 2015-04-06  Žan Doberšek  <zdobersek@igalia.com>
808
809         [WK2] API::Array::copy() should move the resulting Vector<> of copies into the Array::create() call
810         https://bugs.webkit.org/show_bug.cgi?id=143413
811
812         Reviewed by Darin Adler.
813
814         Move the Vector<> object containing the copied elements into the Array::create()
815         call, avoiding copying all the elements again.
816
817         While here, change the Vector<> parameters for Array::create() and the Array
818         constructor to rvalue references. This will ensure that the passed-in object
819         is moved into the Array::create() call if possible, or explicitly copied
820         otherwise. The constructor is moved into the header for inlining opportunities
821         and the unnecessary parameter in the create(Vector<>&&) method declaration
822         removed.
823
824         * Shared/API/APIArray.cpp:
825         (API::Array::create):
826         (API::Array::copy):
827         (API::Array::Array): Deleted.
828         * Shared/API/APIArray.h:
829
830 2015-04-06  Žan Doberšek  <zdobersek@igalia.com>
831
832         UserScript, UserStyleSheet constructors should take in Vector<String> rvalues
833         https://bugs.webkit.org/show_bug.cgi?id=143411
834
835         Reviewed by Darin Adler.
836
837         Move the whitelist and blacklist Vector<String> objects into the
838         UserScript and UserStyleSheet constructors in ArgumentCoder<T>::decode
839         functions.
840
841         * Shared/WebCoreArgumentCoders.cpp:
842         (IPC::ArgumentCoder<UserStyleSheet>::decode):
843         (IPC::ArgumentCoder<UserScript>::decode):
844
845 2015-04-05  Darin Adler  <darin@apple.com>
846
847         [Mac] Spins seen in WKSetApplicationInformationItem, so it should not be called on the main thread
848         https://bugs.webkit.org/show_bug.cgi?id=143423
849         rdar://problem/18773785
850
851         Reviewed by Alexey Proskuryakov.
852
853         * WebProcess/cocoa/WebProcessCocoa.mm:
854         (WebKit::origin): Factored out this helper function from updateActivePages below, so
855         the function below is easier to read.
856         (WebKit::WebProcess::updateActivePages): Refactored to use the new origin function.
857         Use dispatch_async to call WKSetApplicationInformationItem without blocking.
858
859 2015-04-05  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
860
861         Use constants of sqlite3 directly for status of SQL result in webdatabase
862         https://bugs.webkit.org/show_bug.cgi?id=143329
863
864         Reviewed by Darin Adler.
865
866         In webdatabase, it has used own constant variables as well as using sqlite3 constants directly.
867         If sqlite3 constants are changed in the library, we should modify many files as well. Besides
868         it can cause to use if~else statement which consumes more cpu cycles compared to switch~case.
869
870         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
871         (WebKit::SQLiteIDBCursor::createSQLiteStatement):
872         (WebKit::SQLiteIDBCursor::resetAndRebindStatement):
873         (WebKit::SQLiteIDBCursor::bindArguments):
874         (WebKit::SQLiteIDBCursor::internalAdvanceOnce):
875         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
876         (WebKit::createOrMigrateRecordsTableIfNecessary):
877         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata):
878         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata):
879         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::changeDatabaseVersion):
880         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createObjectStore):
881         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteObjectStore):
882         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::clearObjectStore):
883         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createIndex):
884         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteIndex):
885         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::generateKeyNumber):
886         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::updateKeyGeneratorNumber):
887         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::keyExistsInObjectStore):
888         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::putRecord):
889         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::uncheckedPutIndexRecord):
890         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteRecord):
891         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRecordFromObjectStore):
892         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRangeRecordFromObjectStore):
893         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
894         (WebKit::NetworkCache::executeSQLStatement):
895         (WebKit::NetworkCache::Statistics::initialize):
896         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
897         (WebKit::NetworkCache::Statistics::addHashesToDatabase):
898         (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase):
899         * UIProcess/Storage/LocalStorageDatabase.cpp:
900         (WebKit::LocalStorageDatabase::importItems):
901         (WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems):
902         (WebKit::LocalStorageDatabase::databaseIsEmpty):
903         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
904         (WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
905         (WebKit::LocalStorageDatabaseTracker::importOriginIdentifiers):
906         (WebKit::LocalStorageDatabaseTracker::addDatabaseWithOriginIdentifier):
907         (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier):
908         (WebKit::LocalStorageDatabaseTracker::pathForDatabaseWithOriginIdentifier):
909         * WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp:
910         (webkitSoupCookieJarSqliteLoad):
911         (webkitSoupCookieJarSqliteInsertCookie):
912         (webkitSoupCookieJarSqliteDeleteCookie):
913
914 2015-04-05  Simon Fraser  <simon.fraser@apple.com>
915
916         Remove "go ahead and" from comments
917         https://bugs.webkit.org/show_bug.cgi?id=143421
918
919         Reviewed by Darin Adler, Benjamin Poulain.
920
921         Remove the phrase "go ahead and" from comments where it doesn't add
922         anything (which is almost all of them).
923
924         * Platform/unix/EnvironmentUtilities.cpp:
925         (WebKit::EnvironmentUtilities::stripValuesEndingWithString):
926         * PluginProcess/PluginProcess.cpp:
927         (WebKit::PluginProcess::didClose):
928         * UIProcess/API/mac/WKView.mm:
929         (-[WKView insertText:replacementRange:]):
930         (-[WKView _pluginFocusOrWindowFocusChanged:pluginComplexTextInputIdentifier:]):
931         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
932         (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier):
933
934 2015-04-05  Antti Koivisto  <antti@apple.com>
935
936         Bloom filter should support longer hashes
937         https://bugs.webkit.org/show_bug.cgi?id=143419
938
939         Reviewed by Dan Bernstein.
940
941         Use the hash digest directly in the contents filter instead of going via shortHash.
942
943         * NetworkProcess/cache/NetworkCacheKey.h:
944         (WebKit::NetworkCache::Key::hash):
945         (WebKit::NetworkCache::Key::shortHash): Deleted.
946         (WebKit::NetworkCache::Key::toShortHash): Deleted.
947
948             No longer needed.
949
950         * NetworkProcess/cache/NetworkCacheStorage.cpp:
951         (WebKit::NetworkCache::Storage::synchronize):
952         (WebKit::NetworkCache::Storage::addToContentsFilter):
953         (WebKit::NetworkCache::Storage::mayContain):
954         * NetworkProcess/cache/NetworkCacheStorage.h:
955
956 2015-04-05  Antti Koivisto  <antti@apple.com>
957
958         Network cache Bloom filter is too big
959         https://bugs.webkit.org/show_bug.cgi?id=143400
960
961         Follow-up: Fix an ineffective assert.
962
963         * NetworkProcess/cache/NetworkCacheStorage.cpp:
964         (WebKit::NetworkCache::Storage::setMaximumSize): Average resource size is closer to 50KB than 50MB.
965
966 2015-04-05  Antti Koivisto  <antti@apple.com>
967
968         Rename Cache::setMaximumSize to setCapacity
969         https://bugs.webkit.org/show_bug.cgi?id=143418
970
971         Reviewed by Dan Bernstein.
972
973         * NetworkProcess/cache/NetworkCache.cpp:
974         (WebKit::NetworkCache::Cache::setCapacity):
975         (WebKit::NetworkCache::Cache::setMaximumSize): Deleted.
976         * NetworkProcess/cache/NetworkCache.h:
977         * NetworkProcess/cache/NetworkCacheStorage.cpp:
978         (WebKit::NetworkCache::Storage::retrieve):
979         (WebKit::NetworkCache::Storage::store):
980         (WebKit::NetworkCache::Storage::update):
981         (WebKit::NetworkCache::Storage::setCapacity):
982         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
983         (WebKit::NetworkCache::Storage::shrink):
984         (WebKit::NetworkCache::Storage::setMaximumSize): Deleted.
985         * NetworkProcess/cache/NetworkCacheStorage.h:
986         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
987         (WebKit::NetworkProcess::platformSetCacheModel):
988
989 2015-04-04  Antti Koivisto  <antti@apple.com>
990
991         Network cache Bloom filter is too big
992         https://bugs.webkit.org/show_bug.cgi?id=143400
993
994         Reviewed by Chris Dumez.
995
996         It is currently 1MB.
997
998         This patch switches the cache from a counting filter (CountingBloomFilter) to a bit filter (BloomFilter).
999
1000         It also reduces the filter size from 2^20 to 2^18 elements which is good for ~26000 cache entries while
1001         still keeping false positive rate below 1%. The current cache capacity allows around 4000 entries
1002         with typical web contents.
1003
1004         The new filter size is 32KB.
1005
1006         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1007         (WebKit::NetworkCache::Storage::Storage):
1008         (WebKit::NetworkCache::Storage::synchronize):
1009
1010             Turn initialization function into general purpose synchronization function.
1011
1012         (WebKit::NetworkCache::Storage::addToContentsFilter):
1013
1014             Collect newly added hashes so we don't miss entries that were added during synchronization.
1015
1016         (WebKit::NetworkCache::Storage::mayContain):
1017         (WebKit::NetworkCache::Storage::remove):
1018         (WebKit::NetworkCache::Storage::retrieve):
1019         (WebKit::NetworkCache::Storage::store):
1020         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
1021         (WebKit::NetworkCache::Storage::dispatchFullWriteOperation):
1022         (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
1023         (WebKit::NetworkCache::Storage::setMaximumSize):
1024         (WebKit::NetworkCache::Storage::clear):
1025         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
1026         (WebKit::NetworkCache::Storage::shrink):
1027
1028             Non-counting Bloom filter does not support removals so this requires a new strategy.
1029
1030             Shrink code now simply deletes entries. The filter is updated by calling synchronize() at the end.
1031             While we could synchronize the filter during traversal it is better to just have one function for that.
1032
1033         (WebKit::NetworkCache::Storage::initialize): Deleted.
1034         * NetworkProcess/cache/NetworkCacheStorage.h:
1035         (WebKit::NetworkCache::Storage::mayContain):
1036         (WebKit::NetworkCache::Storage::cacheMayContain): Deleted.
1037
1038 2015-04-04  Andy Estes  <aestes@apple.com>
1039
1040         [Content Filtering] Blocked page is not always displayed when it should be
1041         https://bugs.webkit.org/show_bug.cgi?id=143410
1042
1043         Reviewed by Andreas Kling.
1044
1045         * UIProcess/WebFrameProxy.cpp:
1046         (WebKit::WebFrameProxy::didStartProvisionalLoad): Stopped clearing m_contentFilterUnblockHandler here.
1047         (WebKit::WebFrameProxy::didHandleContentFilterUnblockNavigation): Started doing it here instead.
1048
1049 2015-04-04  Chris Dumez  <cdumez@apple.com>
1050
1051         [WK2][Cocoa] Add a way to temporarily disable the WebKit Network Cache for testing
1052         https://bugs.webkit.org/show_bug.cgi?id=143392
1053         <rdar://problem/20315669>
1054
1055         Reviewed by Antti Koivisto.
1056
1057         Add a way to temporarily disable the WebKit Network Cache for testing.
1058         It will be used temporarily for comparing page load times with and
1059         without the WebKit network disk cache enabled.
1060
1061         This is in addition to the existing "WebKitNetworkCacheEnabled"
1062         NSUserDefaults:
1063         webkitNetworkCacheIsEnabled = [defaults boolForKey:WebKitNetworkCacheEnabledDefaultsKey]
1064             && ![defaults boolForKey:WebKitNetworkCacheTemporarilyDisabledForTestingKey];
1065
1066         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1067         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1068
1069 2015-04-04  Simon Fraser  <simon.fraser@apple.com>
1070
1071         REGRESSION (r182215): Feedly crashes when closing article
1072         https://bugs.webkit.org/show_bug.cgi?id=143405
1073         rdar://problem/20382734, rdar://problem/20395497
1074
1075         Reviewed by Tim Horton.
1076         
1077         Calling computeNonFastScrollableRegion() eagerly when scrollable areas come and go
1078         is bad, because it can cause FrameView::layout() to get called in the middle of
1079         RenderObject destruction, which leaves the render tree in a bad state.
1080         
1081         Fix by calling computeNonFastScrollableRegion() lazily, just before scrolling tree commit.
1082         
1083         AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged() now just sets
1084         a flag to say that the non-fast region needs to be recomputed, and that schedules
1085         a scrolling tree commit. When the commit happens, we recompute the region. If the
1086         region didn't change, and no other changes are pending, there's no need to commit.
1087
1088         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
1089         (WebKit::RemoteScrollingCoordinator::buildTransaction):
1090         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1091         (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Outdent #ifdefs.
1092
1093 2015-04-03  Beth Dakin  <bdakin@apple.com>
1094
1095         Attempted build fix.
1096
1097         * UIProcess/API/mac/WKView.mm:
1098
1099 2015-04-03  Simon Fraser  <simon.fraser@apple.com>
1100
1101         Fix the firing of the ReachedSessionRestorationRenderTreeSizeThreshold milestone on iOS
1102         https://bugs.webkit.org/show_bug.cgi?id=143394
1103
1104         Reviewed by Tim Horton.
1105         
1106         A client reshuffle at some point broke the dispatch of the ReachedSessionRestorationRenderTreeSizeThreshold
1107         milestone. Fix by using WebPageProxy::didLayout() to fire the milestone.
1108
1109         * UIProcess/ios/WebPageProxyIOS.mm:
1110         (WebKit::WebPageProxy::didCommitLayerTree):
1111
1112 2015-04-03  Beth Dakin  <bdakin@apple.com>
1113
1114         https://bugs.webkit.org/show_bug.cgi?id=143387
1115         Improvements to webkitmouseforce web API
1116         -and corresponding-
1117         rdar://problem/20281808
1118         rdar://problem/20281853
1119
1120         Reviewed by Darin Adler.
1121
1122         This patch:
1123         1. Dispatches webkitmouseforceup and webkitmouseforceclick at the right time.
1124         2. Dispatches webkitmouseforcechanged from mousedown all the way through through 
1125         mouseup.
1126         3. Uses force values from pressureChangeWithEvent instead of the immediate action 
1127         gesture recognizer.
1128
1129         Listen for this NSResponder method, and pass the relevant info to WebPageProxy to 
1130         dispatch to the web process.
1131         * UIProcess/API/mac/WKView.mm:
1132         (-[WKView pressureChangeWithEvent:]):
1133         * UIProcess/WebPageProxy.cpp:
1134         (WebKit::WebPageProxy::inputDeviceForceDidChange):
1135         (WebKit::WebPageProxy::immediateActionDidUpdate):
1136         * UIProcess/WebPageProxy.h:
1137
1138         The web process still needs to know when the immediate action gesture recognizer 
1139         is updating, but it doesn’t need the force information. That will come from 
1140         pressureChangeWithEvent.
1141         * UIProcess/mac/WKImmediateActionController.mm:
1142         (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
1143
1144         Cache m_lastForceStage so that we can determine if we are 
1145         transitioning to a new stage.
1146         * WebProcess/WebPage/WebPage.cpp:
1147         (WebKit::WebPage::WebPage):
1148         * WebProcess/WebPage/WebPage.h:
1149
1150         New message for InputDeviceForceDidChange and modified message for 
1151         ImmediateActionDidUpdate
1152         * WebProcess/WebPage/WebPage.messages.in:
1153
1154         inputDeviceForceDidChange now takes care of dispatching mouseforcechanged, 
1155         mouseforcedown, mouseforceup, and mouseforceclick.
1156         * WebProcess/WebPage/mac/WebPageMac.mm:
1157         (WebKit::WebPage::inputDeviceForceDidChange):
1158
1159         We still need to keep track of the ImmediateActionStages in WebCore::EventHandler 
1160         so that we can have the right default behavior on mouseup based on whether or not 
1161         that action began and was completed. (In other words, to ensure we don’t navigate 
1162         to a link after force clicking it.)
1163         (WebKit::WebPage::immediateActionDidUpdate):
1164         (WebKit::WebPage::immediateActionDidComplete):
1165
1166 2015-04-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
1167
1168         InjectedBundleNodeHandle::renderedImage() needs to be exposed from the Cocoa WebAPI layer.
1169         https://bugs.webkit.org/show_bug.cgi?id=143341.
1170
1171         Reviewed by Anders Carlsson.
1172
1173         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
1174         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
1175         (-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]): Expose rendered
1176         image injected bundle API from the Cocoa layer. A node in the page can be
1177         rendered to an NSImage on MacOS and to a UIImage on iOS.
1178
1179 2015-04-03  Chris Dumez  <cdumez@apple.com>
1180
1181         [WK2][iOS] We should prevent NetworkProcess suspension while it has pending SQL transactions
1182         https://bugs.webkit.org/show_bug.cgi?id=143278
1183         <rdar://problem/20180799>
1184
1185         Reviewed by Anders Carlsson.
1186
1187         Prevent NetworkProcess suspension while it has pending SQL transactions,
1188         similarly to what we already did for WebProcesses. This patch moves the
1189         WebSQLiteDatabaseTracker from WebProcess/ to Shared/ and make it usable
1190         by the NetworkProcess class as well.
1191
1192         Whenever there are locked files to due SQL transactions, the
1193         NetworkProcess will send an IPC message to the NetworkProcessProxy
1194         which will hold a background process assertion until the NetworkProcess'
1195         SQL transactions are complete. This way, it is no longer possible for
1196         the NetworkProcess to get suspended while SQL transactions are running
1197         and a database file is locked.
1198
1199         * NetworkProcess/NetworkProcess.cpp:
1200         (WebKit::NetworkProcess::initializeNetworkProcess):
1201         * NetworkProcess/NetworkProcess.h:
1202         * Shared/WebSQLiteDatabaseTracker.cpp: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.cpp.
1203         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
1204         (WebKit::m_childProcessType):
1205         (WebKit::WebSQLiteDatabaseTracker::willBeginFirstTransaction):
1206         (WebKit::WebSQLiteDatabaseTracker::didFinishLastTransaction):
1207         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
1208         * Shared/WebSQLiteDatabaseTracker.h: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.h.
1209         * UIProcess/Network/NetworkProcessProxy.cpp:
1210         (WebKit::NetworkProcessProxy::didClose):
1211         (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles):
1212         * UIProcess/Network/NetworkProcessProxy.h:
1213         * UIProcess/Network/NetworkProcessProxy.messages.in:
1214         * WebKit2.xcodeproj/project.pbxproj:
1215         * WebProcess/WebProcess.cpp:
1216         (WebKit::WebProcess::WebProcess):
1217         (WebKit::WebProcess::initializeConnection):
1218         * WebProcess/WebProcess.h:
1219
1220 2015-04-03  Antti Koivisto  <antti@apple.com>
1221
1222         Add non-counting Bloom filter implementation
1223         https://bugs.webkit.org/show_bug.cgi?id=143366
1224
1225         Reviewed by Sam Weinig.
1226
1227         * NetworkProcess/cache/NetworkCacheStorage.h:
1228
1229 2015-04-03  Zan Dobersek  <zdobersek@igalia.com>
1230
1231         Fix the EFL and GTK build after r182243
1232         https://bugs.webkit.org/show_bug.cgi?id=143361
1233
1234         Reviewed by Csaba Osztrogonác.
1235
1236         * PlatformGTK.cmake: Add a custom command that copies the
1237         InspectorBackendCommands.js file into the proper directory
1238         under DerivedSources/WebInspectorUI/.
1239
1240 2015-04-03  Philippe Normand  <pnormand@igalia.com>
1241
1242         Unreviewed, GTK build fix.
1243
1244         * UIProcess/API/gtk/WebKitContextMenuClient.cpp:
1245         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
1246         * UIProcess/gtk/WebContextMenuProxyGtk.h:
1247
1248 2015-04-02  Csaba Osztrogonác  <ossy@webkit.org>
1249
1250         Typo fix.
1251
1252         * PlatformGTK.cmake:
1253
1254 2015-04-02  Csaba Osztrogonác  <ossy@webkit.org>
1255
1256         URTBF after r182303, stub NativeContextMenuItem implemetations added for EFL and GTK.
1257
1258         * PlatformEfl.cmake:
1259         * PlatformGTK.cmake:
1260         * Shared/efl/NativeContextMenuItemEfl.cpp: Added.
1261         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
1262         * Shared/gtk/NativeContextMenuItemGtk.cpp: Added.
1263         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
1264
1265 2015-04-02  Timothy Horton  <timothy_horton@apple.com>
1266
1267         De-PLATFORM(IOS)-ify LayerHostingContext::setFencePort
1268         https://bugs.webkit.org/show_bug.cgi?id=143342
1269
1270         * Platform/mac/LayerHostingContext.h:
1271         * Platform/mac/LayerHostingContext.mm:
1272         Actually, not available on Mavericks. Fix the build.
1273
1274 2015-04-02  Brady Eidson  <beidson@apple.com>
1275
1276         Unreviewed: Re-applied change after rollout.
1277
1278         Expose the "Share" menu for text selections on platforms where it's available.
1279         rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318
1280
1281         * Shared/API/c/WKContextMenuItemTypes.h: Add a constant for the Share menu.
1282         * Shared/API/c/WKSharedAPICast.h:
1283         (WebKit::toAPI):
1284         (WebKit::toImpl):
1285
1286         * Shared/ContextMenuContextData.cpp:
1287         (WebKit::ContextMenuContextData::ContextMenuContextData):
1288         (WebKit::ContextMenuContextData::encode):
1289         (WebKit::ContextMenuContextData::decode):
1290         * Shared/ContextMenuContextData.h:
1291         (WebKit::ContextMenuContextData::selectedText):
1292
1293         Add a "cross platform" menu item wrapper, right now only for NSMenuItem.
1294         * Shared/NativeContextMenuItem.h:
1295         (WebKit::NativeContextMenuItem::~NativeContextMenuItem):
1296         (WebKit::NativeContextMenuItem::nsMenuItem):
1297         * Shared/mac/NativeContextMenuItem.mm:
1298         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
1299
1300         Let WebContextMenuItem hold on to a NativeContextMenuItem to maintain full fidelity of the platform.
1301         * Shared/WebContextMenuItem.cpp:
1302         (WebKit::WebContextMenuItem::WebContextMenuItem):
1303         * Shared/WebContextMenuItem.h:
1304         (WebKit::WebContextMenuItem::create):
1305         (WebKit::WebContextMenuItem::nativeContextMenuItem):
1306
1307         * UIProcess/API/APIContextMenuClient.h:
1308         (API::ContextMenuClient::getContextMenuFromProposedMenu):
1309         (API::ContextMenuClient::showContextMenu):
1310
1311         * UIProcess/API/C/WKPage.cpp:
1312         (WKPageSetPageContextMenuClient):
1313
1314         * UIProcess/WebContextMenuProxy.h:
1315
1316         * UIProcess/WebPageProxy.cpp:
1317         (WebKit::WebPageProxy::internalShowContextMenu): Translate the placeholder item from the web process into the
1318           native Share menu before consulting the context menu client. Also create the API items here so the native NSMenuItem
1319           can be attached to them.
1320
1321         * UIProcess/mac/WebContextMenuProxyMac.h:
1322         * UIProcess/mac/WebContextMenuProxyMac.mm:
1323         (-[WKMenuTarget forwardContextMenuAction:]):
1324         (WebKit::nsMenuItem):
1325         (WebKit::nsMenuItemVector):
1326         (WebKit::WebContextMenuProxyMac::populate):
1327         (WebKit::WebContextMenuProxyMac::showContextMenu):
1328
1329         * WebKit2.xcodeproj/project.pbxproj:
1330
1331         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
1332         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
1333         (WebKit::WebContextMenuClient::shareSelectedTextMenuItem): In the web process, mark the Share menu's place in the
1334           context menu with a placeholder item. It will be translated into the real Share menu in the UI process.
1335
1336 2015-04-02  Commit Queue  <commit-queue@webkit.org>
1337
1338         Unreviewed, rolling out r182293.
1339         https://bugs.webkit.org/show_bug.cgi?id=143355
1340
1341         Broke GTK and EFL builds. (Requested by bfulgham on #webkit).
1342
1343         Reverted changeset:
1344
1345         "Expose the "Share" menu for text selections on platforms
1346         where it's available."
1347         https://bugs.webkit.org/show_bug.cgi?id=143318
1348         http://trac.webkit.org/changeset/182293
1349
1350 2015-04-02  Chris Dumez  <cdumez@apple.com>
1351
1352         [WK2][NetworkCache] Drop HTTP method from NetworkCache::Key
1353         https://bugs.webkit.org/show_bug.cgi?id=143348
1354
1355         Reviewed by Antti Koivisto.
1356
1357         Drop HTTP method from NetworkCache::Key as we only cache GET responses
1358         for now. Even when we start caching HEAD responses, we likely will not
1359         want the method to be part of the key because:
1360         - A HEAD response can be used to update the headers of a previously cached response to GET
1361         - A cached GET response may be used to satisfy subsequent HEAD requests
1362
1363         * NetworkProcess/cache/NetworkCache.cpp:
1364         (WebKit::NetworkCache::makeCacheKey):
1365         * NetworkProcess/cache/NetworkCacheKey.cpp:
1366         (WebKit::NetworkCache::Key::Key):
1367         (WebKit::NetworkCache::Key::operator=):
1368         (WebKit::NetworkCache::Key::computeHash):
1369         (WebKit::NetworkCache::Key::operator==):
1370         (WebKit::NetworkCache::Key::encode):
1371         (WebKit::NetworkCache::Key::decode):
1372         * NetworkProcess/cache/NetworkCacheKey.h:
1373         (WebKit::NetworkCache::Key::method): Deleted.
1374
1375 2015-04-02  Jer Noble  <jer.noble@apple.com>
1376
1377         [Mac][WK2] Fullscreen animation incorrect when initiated on non-primary monitor
1378         https://bugs.webkit.org/show_bug.cgi?id=143237
1379
1380         Reviewed by Brent Fulgham.
1381
1382         The animation calculations have an implicit assumptions of a screen whose origin is 0,0. Account
1383         for the screen origin by passing the window's screen's frame into the zoomAnimation() and maskAnimation()
1384         methods.
1385
1386         * UIProcess/mac/WKFullScreenWindowController.mm:
1387         (-[WKFullScreenWindowController initWithWindow:webView:]):
1388         (zoomAnimation):
1389         (maskAnimation):
1390         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
1391         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
1392
1393 2015-04-02  Brady Eidson  <beidson@apple.com>
1394
1395         Expose the "Share" menu for text selections on platforms where it's available.
1396         rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318
1397
1398         Reviewed by Sam Weinig.
1399
1400         * Shared/API/c/WKContextMenuItemTypes.h: Add a constant for the Share menu.
1401         * Shared/API/c/WKSharedAPICast.h:
1402         (WebKit::toAPI):
1403         (WebKit::toImpl):
1404
1405         * Shared/ContextMenuContextData.cpp:
1406         (WebKit::ContextMenuContextData::ContextMenuContextData):
1407         (WebKit::ContextMenuContextData::encode):
1408         (WebKit::ContextMenuContextData::decode):
1409         * Shared/ContextMenuContextData.h:
1410         (WebKit::ContextMenuContextData::selectedText):
1411
1412         Add a "cross platform" menu item wrapper, right now only for NSMenuItem.
1413         * Shared/NativeContextMenuItem.h:
1414         (WebKit::NativeContextMenuItem::~NativeContextMenuItem):
1415         (WebKit::NativeContextMenuItem::nsMenuItem):
1416         * Shared/mac/NativeContextMenuItem.mm:
1417         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
1418
1419         Let WebContextMenuItem hold on to a NativeContextMenuItem to maintain full fidelity of the platform.
1420         * Shared/WebContextMenuItem.cpp:
1421         (WebKit::WebContextMenuItem::WebContextMenuItem):
1422         * Shared/WebContextMenuItem.h:
1423         (WebKit::WebContextMenuItem::create):
1424         (WebKit::WebContextMenuItem::nativeContextMenuItem):
1425
1426         * UIProcess/API/APIContextMenuClient.h:
1427         (API::ContextMenuClient::getContextMenuFromProposedMenu):
1428         (API::ContextMenuClient::showContextMenu):
1429
1430         * UIProcess/API/C/WKPage.cpp:
1431         (WKPageSetPageContextMenuClient):
1432
1433         * UIProcess/WebContextMenuProxy.h:
1434
1435         * UIProcess/WebPageProxy.cpp:
1436         (WebKit::WebPageProxy::internalShowContextMenu): Translate the placeholder item from the web process into the
1437           native Share menu before consulting the context menu client. Also create the API items here so the native NSMenuItem
1438           can be attached to them.
1439
1440         * UIProcess/mac/WebContextMenuProxyMac.h:
1441         * UIProcess/mac/WebContextMenuProxyMac.mm:
1442         (-[WKMenuTarget forwardContextMenuAction:]):
1443         (WebKit::nsMenuItem):
1444         (WebKit::nsMenuItemVector):
1445         (WebKit::WebContextMenuProxyMac::populate):
1446         (WebKit::WebContextMenuProxyMac::showContextMenu):
1447
1448         * WebKit2.xcodeproj/project.pbxproj:
1449
1450         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
1451         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
1452         (WebKit::WebContextMenuClient::shareSelectedTextMenuItem): In the web process, mark the Share menu's place in the
1453           context menu with a placeholder item. It will be translated into the real Share menu in the UI process.
1454
1455 2015-04-02  Timothy Horton  <timothy_horton@apple.com>
1456
1457         De-PLATFORM(IOS)-ify LayerHostingContext::setFencePort
1458         https://bugs.webkit.org/show_bug.cgi?id=143342
1459
1460         Reviewed by Myles C. Maxfield.
1461
1462         * Platform/mac/LayerHostingContext.h:
1463         * Platform/mac/LayerHostingContext.mm:
1464         (WebKit::LayerHostingContext::setFencePort):
1465         There's nothing iOS specific about this.
1466
1467 2015-04-02  Oliver Hunt  <oliver@apple.com>
1468
1469         Ensure that we always set network ATS context in the network process
1470         https://bugs.webkit.org/show_bug.cgi?id=143343
1471
1472         Reviewed by Dan Bernstein.
1473
1474         If a custom cache location or size we were early returning before setting
1475         the CFNetwork ATS context. This is clearly an error.
1476
1477         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1478         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1479
1480 2015-04-02  Alexey Proskuryakov  <ap@apple.com>
1481
1482         Make checkURLReceivedFromWebProcess not rely on details of platform URL implementation.
1483         https://bugs.webkit.org/show_bug.cgi?id=143222
1484         rdar://problem/19978997
1485
1486         Reviewed by Sam Weinig.
1487
1488         * UIProcess/WebProcessProxy.cpp:
1489         (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess):
1490
1491 2015-04-02  Yusuke Suzuki  <utatane.tea@gmail.com>
1492
1493         Clean up EnumerationMode to easily extend
1494         https://bugs.webkit.org/show_bug.cgi?id=143276
1495
1496         Reviewed by Geoffrey Garen.
1497
1498         Use default EnumerationMode().
1499
1500         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
1501         (WebKit::NPJSObject::enumerate):
1502
1503 2015-04-02  Chris Dumez  <cdumez@apple.com>
1504
1505         [WK2][iOS] Update the WebContent process' sandbox profile for AWD
1506         https://bugs.webkit.org/show_bug.cgi?id=143340
1507         <rdar://problem/20375170>
1508
1509         Reviewed by Alexey Proskuryakov.
1510
1511         Update the WebContent process' sandbox profile for AWD.
1512
1513         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1514
1515 2015-04-01  Antti Koivisto  <antti@apple.com>
1516
1517         Use std::chrono types to represent time in response and cache classes
1518         https://bugs.webkit.org/show_bug.cgi?id=143316
1519
1520         Reviewed by Andreas Kling.
1521
1522         * NetworkProcess/NetworkResourceLoader.cpp:
1523         (WebKit::NetworkResourceLoader::didFinishLoading):
1524         * NetworkProcess/cache/NetworkCache.cpp:
1525         (WebKit::NetworkCache::responseHasExpired):
1526         (WebKit::NetworkCache::responseNeedsRevalidation):
1527         (WebKit::NetworkCache::makeStoreDecision):
1528         (WebKit::NetworkCache::Cache::store):
1529         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1530         (WebKit::NetworkCache::Entry::Entry):
1531         (WebKit::NetworkCache::Entry::asJSON):
1532         * NetworkProcess/cache/NetworkCacheEntry.h:
1533         (WebKit::NetworkCache::Entry::timeStamp):
1534         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1535         (WebKit::NetworkCache::decodeRecordMetaData):
1536         (WebKit::NetworkCache::decodeRecord):
1537
1538             Sanity check the timestamp on decode.
1539
1540         (WebKit::NetworkCache::encodeRecordMetaData):
1541         (WebKit::NetworkCache::encodeRecordHeader):
1542         (WebKit::NetworkCache::Storage::traverse):
1543         * NetworkProcess/cache/NetworkCacheStorage.h:
1544         * WebProcess/Plugins/PluginView.cpp:
1545         (WebKit::lastModifiedDateMS):
1546         (WebKit::PluginView::Stream::didReceiveResponse):
1547         (WebKit::PluginView::manualLoadDidReceiveResponse):
1548         (WebKit::lastModifiedDate): Deleted.
1549
1550 2015-04-01  Chris Dumez  <cdumez@apple.com>
1551
1552         [WK2][Cocoa] Add didFailProvisionalLoadWithErrorForFrame callback to WKWebProcessPlugInLoadDelegate
1553         https://bugs.webkit.org/show_bug.cgi?id=143319
1554         <rdar://problem/19463834>
1555
1556         Reviewed by Dan Bernstein.
1557
1558         Add didFailProvisionalLoadWithErrorForFrame callback to
1559         WKWebProcessPlugInLoadDelegate so that the client side can track all
1560         types page load completions:
1561         - didFailProvisionalLoadWithErrorForFrame
1562         - didFailLoadWithErrorForFrame
1563         - didFinishLoadForFrame
1564
1565         Note that this event is already exposed on UIProcess side via the
1566         WKPageLoaderClient.didFailLoadWithErrorForFrame callback.
1567
1568         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
1569         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1570         (didFailProvisionalLoadWithErrorForFrame):
1571         (setUpPageLoaderClient):
1572
1573 2015-04-01  Enrica Casucci  <enrica@apple.com>
1574
1575         Injected bundle messages should be at the page level.
1576         https://bugs.webkit.org/show_bug.cgi?id=143283
1577
1578         Reviewed by Alexey Proskuryakov.
1579
1580         All the messages between the injected bundle and the UI
1581         process should be page level messages instead of context.
1582         The author of this patch is Tim Horton, I just finished it.
1583
1584         * UIProcess/API/C/WKPage.cpp:
1585         (WKPageSetPageInjectedBundleClient):
1586         * UIProcess/API/C/WKPage.h:
1587         * UIProcess/API/C/WKPageInjectedBundleClient.h: Added.
1588         * UIProcess/API/Cocoa/WKWebView.mm:
1589         (-[WKWebView _pageForTesting]):
1590         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1591         * UIProcess/WebPageInjectedBundleClient.cpp: Added.
1592         (WebKit::WebPageInjectedBundleClient::didReceiveMessageFromInjectedBundle):
1593         (WebKit::WebPageInjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle):
1594         * UIProcess/WebPageInjectedBundleClient.h: Added.
1595         * UIProcess/WebPageProxy.cpp:
1596         (WebKit::WebPageProxy::setInjectedBundleClient):
1597         (WebKit::WebPageProxy::handleMessage):
1598         (WebKit::WebPageProxy::handleSynchronousMessage):
1599         * UIProcess/WebPageProxy.h:
1600         (WebKit::WebPageProxy::injectedBundleClient):
1601         * UIProcess/WebPageProxy.messages.in:
1602         * UIProcess/WebProcessPool.cpp:
1603         (WebKit::WebProcessPool::handleMessage):
1604         * WebKit2.xcodeproj/project.pbxproj:
1605         * CMakeLists.txt:
1606         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1607         (WKBundlePagePostMessage):
1608         (WKBundlePagePostSynchronousMessage):
1609         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1610         * WebProcess/WebPage/WebPage.cpp:
1611         (WebKit::WebPage::postMessage):
1612         (WebKit::WebPage::postSynchronousMessage):
1613         * WebProcess/WebPage/WebPage.h:
1614
1615 2015-04-01  Alexey Proskuryakov  <ap@apple.com>
1616
1617         [iOS] WebContent should have access to the entirety of its caches directory
1618         https://bugs.webkit.org/show_bug.cgi?id=143312
1619         rdar://problem/20314916
1620
1621         Reviewed by Oliver Hunt.
1622
1623         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1624         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1625         * Shared/Network/NetworkProcessCreationParameters.cpp:
1626         (WebKit::NetworkProcessCreationParameters::encode):
1627         (WebKit::NetworkProcessCreationParameters::decode):
1628         * Shared/Network/NetworkProcessCreationParameters.h:
1629         * Shared/WebProcessCreationParameters.cpp:
1630         (WebKit::WebProcessCreationParameters::encode):
1631         (WebKit::WebProcessCreationParameters::decode):
1632         * Shared/WebProcessCreationParameters.h:
1633         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1634         (WebKit::WebProcessPool::networkingCachesDirectory):
1635         (WebKit::WebProcessPool::webContentCachesDirectory):
1636         (WebKit::WebProcessPool::openGLCacheDirectory): Deleted.
1637         (WebKit::WebProcessPool::networkingHSTSDatabasePath): Deleted.
1638         (WebKit::WebProcessPool::webContentHSTSDatabasePath): Deleted.
1639         * UIProcess/WebProcessPool.cpp:
1640         (WebKit::WebProcessPool::ensureNetworkProcess):
1641         (WebKit::WebProcessPool::createNewWebProcess):
1642         * UIProcess/WebProcessPool.h:
1643         * WebProcess/cocoa/WebProcessCocoa.mm:
1644         (WebKit::WebProcess::platformInitializeWebProcess):
1645
1646 2015-04-01  Timothy Horton  <timothy_horton@apple.com>
1647
1648         Smart magnification gesture sometimes shoots to the middle of the page
1649         https://bugs.webkit.org/show_bug.cgi?id=143296
1650         <rdar://problem/18209280>
1651
1652         Reviewed by Dean Jackson.
1653
1654         * UIProcess/mac/ViewGestureControllerMac.mm:
1655         (WebKit::ViewGestureController::didCollectGeometryForSmartMagnificationGesture):
1656         Constrain the target rect to the viewport, and if it had overflowed the viewport,
1657         scroll halfway towards the gesture origin.
1658
1659 2015-03-31  Simon Fraser  <simon.fraser@apple.com>
1660
1661         Remove scrolling tree dependency on wheel event handler counts, and use fast scrolling even when there are wheel handlers
1662         https://bugs.webkit.org/show_bug.cgi?id=143288
1663         rdar://problem/16049624
1664
1665         Reviewed by Beth Dakin.
1666
1667         Remove the wheel event counting that Document does, and passes into the scrolling tree.
1668         The ScrollingTree now just uses the non-fast scrollable region to determine when to
1669         fast scroll on pages with wheel event handlers.
1670         
1671         If a handler includes position:fixed renderers, we just cover the whole document
1672         with the slow-scrolling region currently. This could be improved.
1673
1674         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1675         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
1676         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
1677         (WebKit::RemoteScrollingTreeTextStream::dump):
1678         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1679         (WebKit::WebChromeClient::wheelEventHandlersChanged):
1680         (WebKit::WebChromeClient::numWheelEventHandlersChanged): Deleted.
1681         * WebProcess/WebCoreSupport/WebChromeClient.h:
1682         * WebProcess/WebPage/WebPage.cpp:
1683         (WebKit::WebPage::WebPage):
1684         (WebKit::WebPage::wheelEventHandlersChanged):
1685         (WebKit::WebPage::recomputeShortCircuitHorizontalWheelEventsState):
1686         (WebKit::WebPage::numWheelEventHandlersChanged): Deleted.
1687         * WebProcess/WebPage/WebPage.h:
1688
1689 2015-03-31  Dan Bernstein  <mitz@apple.com>
1690
1691         <rdar://problem/20365675> [iOS] Include Add to Reading List link action only where supported
1692         https://bugs.webkit.org/show_bug.cgi?id=143289
1693
1694         Reviewed by Tim Horton.
1695
1696         * UIProcess/API/Cocoa/_WKElementAction.h: Excluded _WKElementActionTypeAddToReadingList from
1697         the _WKElementActionType enum when Reading List is not supported.
1698
1699         * UIProcess/API/Cocoa/_WKElementAction.mm:
1700         (+[_WKElementAction elementActionWithType:customTitle:]): Made Add to Reading List code
1701         conditional on HAVE(SAFARI_SERVICES_FRAMEWORK).
1702
1703         * UIProcess/ios/WKActionSheetAssistant.mm:
1704         (-[WKActionSheetAssistant showImageSheet]): Ditto.
1705         (-[WKActionSheetAssistant showLinkSheet]): Ditto.
1706
1707         * config.h: Defined HAVE_SAFARI_SERVICES_FRAMEWORK.
1708
1709 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
1710
1711         TextIndicator for <span> inside an <a> only highlights the <span>, should highlight the whole <a>
1712         https://bugs.webkit.org/show_bug.cgi?id=143287
1713         <rdar://problem/20318342>
1714
1715         Reviewed by Beth Dakin.
1716
1717         * WebProcess/WebPage/mac/WebPageMac.mm:
1718         (WebKit::WebPage::performActionMenuHitTestAtLocation):
1719         Instead of just highlighting the hit element, highlight the whole
1720         element that the link URL comes from.
1721
1722 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
1723
1724         WKView should stop using endGestureWithEvent
1725         https://bugs.webkit.org/show_bug.cgi?id=143285
1726         <rdar://problem/20357007>
1727
1728         Reviewed by Simon Fraser.
1729
1730         * UIProcess/API/mac/WKView.mm:
1731         (-[WKView magnifyWithEvent:]):
1732         (-[WKView endGestureWithEvent:]): Deleted.
1733         * UIProcess/mac/ViewGestureController.h:
1734         * UIProcess/mac/ViewGestureControllerMac.mm:
1735         (WebKit::ViewGestureController::endMagnificationGesture):
1736         (WebKit::ViewGestureController::endActiveGesture): Deleted.
1737         While there is no visible symptom, it is recommended that we check
1738         the phase of normal magnification events instead of using the
1739         special gesture end events.
1740
1741 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
1742
1743         Swipes occur in the wrong direction in RTL
1744         https://bugs.webkit.org/show_bug.cgi?id=143257
1745         <rdar://problem/20300862>
1746
1747         Reviewed by Simon Fraser.
1748
1749         * UIProcess/ios/ViewGestureControllerIOS.mm:
1750         (-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]):
1751         When choosing which edge to attach our gesture recognizers to,
1752         flip them in RTL.
1753
1754         (-[WKSwipeTransitionController directionForTransition:]):
1755         (WebKit::ViewGestureController::beginSwipeGesture):
1756         (WebKit::ViewGestureController::canSwipeInDirection):
1757         * UIProcess/mac/ViewGestureController.h:
1758         * UIProcess/mac/ViewGestureControllerMac.mm:
1759         (WebKit::ViewGestureController::scrollEventCanBecomeSwipe):
1760         (WebKit::ViewGestureController::trackSwipeGesture):
1761         (WebKit::ViewGestureController::determineLayerAdjacentToSnapshotForParent):
1762         (WebKit::ViewGestureController::beginSwipeGesture):
1763         (WebKit::ViewGestureController::handleSwipeGesture):
1764         Adjust SwipeDirection to be in logical back-forward list direction
1765         instead of physical edge direction.
1766
1767 2015-03-31  Myles C. Maxfield  <mmaxfield@apple.com>
1768
1769         Move ExpansionBehaviorFlags and TextDirection to their own file
1770         https://bugs.webkit.org/show_bug.cgi?id=143273
1771
1772         Reviewed by Simon Fraser.
1773
1774         This is a mechanical change. It just moves code around.
1775
1776         This is getting ready for https://bugs.webkit.org/show_bug.cgi?id=142608
1777
1778         * Shared/WebPopupItem.h:
1779         * UIProcess/API/C/efl/WKAPICastEfl.h:
1780         * UIProcess/API/efl/EwkView.h:
1781         * UIProcess/WebPopupMenuProxy.h:
1782         * UIProcess/efl/WebUIPopupMenuClient.h:
1783
1784 2015-03-31  Yusuke Suzuki  <utatane.tea@gmail.com>
1785
1786         Clean up Identifier factories to clarify the meaning of StringImpl*
1787         https://bugs.webkit.org/show_bug.cgi?id=143146
1788
1789         Reviewed by Filip Pizlo.
1790
1791         Just change to Identifier::fromString.
1792
1793         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1794         (WebKit::JSNPObject::getOwnPropertyNames):
1795         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
1796         (WebKit::identifierFromIdentifierRep):
1797
1798 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
1799
1800         WebKit briefly shows wrong webpage after swiping back (gigaom.com, or any site on a slow network)
1801         https://bugs.webkit.org/show_bug.cgi?id=143256
1802         <rdar://problem/19458648>
1803
1804         Reviewed by Dan Bernstein.
1805
1806         Instead of allowing a flash of the previous page when the swipe snapshot
1807         timeouts fire (removing the snapshot before the new page is loaded), show
1808         the snapshotted background color.
1809
1810         This fixes the problem on iOS, where UI-side compositing makes it easy to fix,
1811         but not yet on OS X.
1812
1813         * UIProcess/API/Cocoa/WKWebView.mm:
1814         (baseScrollViewBackgroundColor):
1815         (scrollViewBackgroundColor):
1816         If the ViewGestureController returns a valid background color, use that
1817         instead of the page's background color.
1818
1819         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1820         Expose _updateScrollViewBackground.
1821
1822         * UIProcess/PageClient.h:
1823         * UIProcess/ios/PageClientImplIOS.h:
1824         * UIProcess/ios/PageClientImplIOS.mm:
1825         (WebKit::PageClientImpl::didChangeBackgroundColor):
1826         * UIProcess/mac/PageClientImpl.h:
1827         * UIProcess/mac/PageClientImpl.mm:
1828         (WebKit::PageClientImpl::didChangeBackgroundColor):
1829         * UIProcess/WebPageProxy.cpp:
1830         (WebKit::WebPageProxy::didChangeBackgroundColor):
1831         * UIProcess/WebPageProxy.h:
1832         Add and plumb didChangeBackgroundColor, which calls
1833         _updateScrollViewBackground on iOS.
1834         
1835         * UIProcess/ios/ViewGestureControllerIOS.mm:
1836         (WebKit::ViewGestureController::endSwipeGesture):
1837         Hide the content of the drawing area until the next commit. This way,
1838         even if the snapshot is removed (say, because a timeout fired), we won't
1839         ever show the old page content (but we will show background color).
1840
1841         Store the background color associated with the current snapshot.
1842
1843         Let WKWebView know that it needs to recompute the background color.
1844
1845         (WebKit::ViewGestureController::removeSwipeSnapshot):
1846         Clear the background color so that the next time we commit, WKWebView
1847         will get an invalid color from ViewGestureController and fall back
1848         to the page's extended background color instead.
1849
1850         * UIProcess/mac/ViewGestureController.h:
1851         (WebKit::ViewGestureController::backgroundColorForCurrentSnapshot):
1852         * UIProcess/mac/ViewGestureControllerMac.mm:
1853         (WebKit::ViewGestureController::beginSwipeGesture):
1854         (WebKit::ViewGestureController::removeSwipeSnapshot):
1855         Keep backgroundColorForCurrentSnapshot up to date on Mac too, even
1856         though we don't use it yet.
1857
1858 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
1859
1860         [iOS] Rotating PDF in Safari scrolls to the wrong position
1861         https://bugs.webkit.org/show_bug.cgi?id=143259
1862         <rdar://problem/19872693>
1863
1864         Reviewed by Dan Bernstein.
1865
1866         * UIProcess/ios/WKPDFView.mm:
1867         (-[WKPDFView web_setMinimumSize:]):
1868         Maintan the relative top/left within the rescaled document.
1869
1870 2015-03-31  Chris Dumez  <cdumez@apple.com>
1871
1872         [WK2][iOS] Extend ProcessThrottler use to the NetworkProcess
1873         https://bugs.webkit.org/show_bug.cgi?id=143249
1874         <rdar://problem/20231539>
1875
1876         Reviewed by Gavin Barraclough.
1877
1878         Extend ProcessThrottler use to the NetworkProcess instead of only the
1879         WebProcesses. This is needed so that the NetworkProcess gets notified
1880         before suspension. We now use this notification to free-up memory
1881         before suspending by calling the critical memory pressure handler, as
1882         we already do for WebProcesses (rdar://problem/20231539). In the
1883         future, this infrastructure will be used to delay suspension until the
1884         pending SQL transactions are done as well (rdar://problem/20180799).
1885
1886         Previously, the NetworkProcessProxy would hold a foreground assertion
1887         on behalf of the NetworkProcess but would never release that assertion.
1888         In this patch, we change this so that WebProcessProxies hold assertions
1889         on behalf of the NetworkProcess, and release those assertions before
1890         suspending. As a result, the NetworkProcess gets suspended when all
1891         WebProcesses are suspended.
1892
1893         * NetworkProcess/NetworkProcess.cpp:
1894         (WebKit::NetworkProcess::processWillSuspend):
1895         (WebKit::NetworkProcess::cancelProcessWillSuspend):
1896         (WebKit::NetworkProcess::processDidResume):
1897         * NetworkProcess/NetworkProcess.h:
1898         * NetworkProcess/NetworkProcess.messages.in:
1899         * UIProcess/Network/NetworkProcessProxy.cpp:
1900         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
1901         (WebKit::NetworkProcessProxy::didFinishLaunching):
1902         (WebKit::NetworkProcessProxy::sendProcessWillSuspend):
1903         (WebKit::NetworkProcessProxy::sendCancelProcessWillSuspend):
1904         (WebKit::NetworkProcessProxy::didCancelProcessSuspension):
1905         (WebKit::NetworkProcessProxy::sendProcessDidResume):
1906         (WebKit::NetworkProcessProxy::processReadyToSuspend):
1907         * UIProcess/Network/NetworkProcessProxy.h:
1908         (WebKit::NetworkProcessProxy::throttler):
1909         * UIProcess/Network/NetworkProcessProxy.messages.in:
1910         * UIProcess/ProcessThrottler.cpp:
1911         (WebKit::ProcessThrottler::ProcessThrottler):
1912         (WebKit::ProcessThrottler::didConnectToProcess):
1913         (WebKit::ProcessThrottler::didConnnectToProcess): Deleted.
1914         * UIProcess/ProcessThrottler.h:
1915         * UIProcess/ProcessThrottlerClient.h: Added.
1916         (WebKit::ProcessThrottlerClient::~ProcessThrottlerClient):
1917         * UIProcess/WebProcessPool.cpp:
1918         (WebKit::WebProcessPool::ensureNetworkProcess):
1919         * UIProcess/WebProcessPool.h:
1920         * UIProcess/WebProcessProxy.cpp:
1921         (WebKit::WebProcessProxy::didFinishLaunching):
1922         (WebKit::WebProcessProxy::initializeNetworkProcessActivityToken):
1923         (WebKit::WebProcessProxy::sendProcessDidResume):
1924         (WebKit::WebProcessProxy::processReadyToSuspend):
1925         * UIProcess/WebProcessProxy.h:
1926         * WebKit2.xcodeproj/project.pbxproj:
1927
1928 2015-03-31  Csaba Osztrogonác  <ossy@webkit.org>
1929
1930         Unreviewed, revert accidental change by r182138.
1931
1932         * Scripts/generate-forwarding-headers.pl:
1933         (createForwardingHeadersForFramework):
1934
1935 2015-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1936
1937         Unreviewed. Fix GTK+ build with REDIRECTED_XCOMPOSITE_WINDOW disabled in X11 platform.
1938
1939         Also fix some unused parameter warnings when
1940         REDIRECTED_XCOMPOSITE_WINDOW is disabled.
1941
1942         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1943         (webkitWebViewRenderAcceleratedCompositingResults):
1944         (resizeWebKitWebViewBaseFromAllocation):
1945
1946 2015-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1947
1948         [GTK] DnD icon/widget has odd background
1949         https://bugs.webkit.org/show_bug.cgi?id=143217
1950
1951         Reviewed by Martin Robinson.
1952
1953         Use gtk_drag_set_icon_surface() to set the drag icon image,
1954         instead of DragIcon class.
1955
1956         * UIProcess/API/gtk/WebKitWebView.cpp:
1957         * UIProcess/gtk/DragAndDropHandler.cpp:
1958         (WebKit::DragAndDropHandler::startDrag):
1959         * UIProcess/gtk/DragAndDropHandler.h:
1960
1961 2015-03-30  Commit Queue  <commit-queue@webkit.org>
1962
1963         Unreviewed, rolling out r182172.
1964         https://bugs.webkit.org/show_bug.cgi?id=143250
1965
1966         Since this class is an API object, we don't know for sure when
1967         it will be destroyed. (Requested by kling on #webkit).
1968
1969         Reverted changeset:
1970
1971         "WebBackForwardList doesn't need to manually clear the
1972         snapshot of an entry when removing it."
1973         https://bugs.webkit.org/show_bug.cgi?id=143231
1974         http://trac.webkit.org/changeset/182172
1975
1976 2015-03-30  Andreas Kling  <akling@apple.com>
1977
1978         WebBackForwardList doesn't need to manually clear the snapshot of an entry when removing it.
1979         <https://webkit.org/b/143231>
1980
1981         Reviewed by Tim Horton.
1982
1983         Now that we don't keep WebBackForwardListItem objects alive forever, it's not necessary
1984         to clear the snapshot when removing them from the WebBackForwardList, since the entire
1985         object will be deleted shortly after that anyway.
1986
1987         * UIProcess/WebBackForwardList.cpp:
1988         (WebKit::WebBackForwardList::didRemoveItem):
1989
1990 2015-03-30  Enrica Casucci  <enrica@apple.com>
1991
1992         [iOS] WebContent crashing at WebCore: WebCore::Range::collectSelectionRects.
1993         https://bugs.webkit.org/show_bug.cgi?id=143234
1994         <rdar://problem/18571345>
1995
1996         Reviewed by Tim Horton.
1997
1998         This is a speculative fix that adds a null check before referencing the range.
1999         In both places where the check has been added the range returned by the call
2000         that should create it could be null.
2001
2002         * WebProcess/WebPage/ios/WebPageIOS.mm:
2003         (WebKit::WebPage::platformEditorState):
2004
2005 2015-03-30  Sam Weinig  <sam@webkit.org>
2006
2007         [Content Extensions] Flesh out the UserContentExtensionStore
2008         https://bugs.webkit.org/show_bug.cgi?id=143123
2009
2010         Reviewed by Benjamin Poulain.
2011
2012         * Shared/WebCompiledContentExtension.cpp:
2013         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
2014         * Shared/WebCompiledContentExtensionData.cpp:
2015         (WebKit::WebCompiledContentExtensionData::encode):
2016         (WebKit::WebCompiledContentExtensionData::decode):
2017         * Shared/WebCompiledContentExtensionData.h:
2018         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
2019         Switch the order in memory of actions and bytecode (and switch the order of the
2020         variables as well, to keep it clear). This will become necessary when streaming
2021         the data to disk, as actions are created before the bytecode and we would have to keep them
2022         in memory until the bytecode was finished compiling if they didn't come before in the file.
2023
2024         * UIProcess/API/APIUserContentExtensionStore.h:
2025         * UIProcess/API/APIUserContentExtensionStore.cpp:
2026         (API::UserContentExtensionStore::defaultStore):
2027         Add accessor for the processes default shared store.
2028
2029         (API::constructedPath):
2030         Helper for constructing the path to a file in the store based on identifier.
2031
2032         (API::encodeContentExtensionMetaData):
2033         (API::decodeContentExtensionMetaData):
2034         Helpers for encoding/decoding the file metadata (version, bytecode size, actions size).
2035
2036         (API::openAndMapContentExtension):
2037         Helper to open and map a filed back content extension.
2038
2039         (API::writeDataToFile):
2040         Helper to write a Data object to a file.
2041
2042         (API::compiledToFile):
2043         Helper to run the content extension compiler and write it to disk. It first
2044         writes it to a temporary file and then does an atomic rename operation to put
2045         the file in the final location. Doing this means that if the process crashes while
2046         the compile is taking place, the partially written file won't end up in the cache, 
2047         but rather, will be cleaned up by the OS.
2048  
2049         (API::UserContentExtensionStore::lookupContentExtension):
2050         API entry point to lookup an extension that has been compiled to disk. On a background queue,
2051         it attempts to open and map the extension (based on the identifier passed in) and return it
2052         to the caller via the callback function passed in.
2053         
2054         (API::UserContentExtensionStore::compileContentExtension):
2055         API entry point to compile an extension and write it to store. On a background queue, it 
2056         compiles the file to disk and if successful, returns the memory mapped data via the callback
2057         function passed in.
2058
2059         (API::UserContentExtensionStore::removeContentExtension):
2060         API entry point to remove an extension from the store. On a background queue, it 
2061         unlinks the extension (based on the identifier passed in) and tells the caller it completed
2062         the action vial the callback function passed in.
2063
2064         (API::UserContentExtensionStore::synchronousRemoveAllContentExtensions):
2065         Helper for testing which synchronously unlinks all the files in the store.
2066
2067         (API::userContentExtensionStoreErrorCategory):
2068         std::error_code adaptor for some generic errors that can happen in the store. We will want
2069         to flesh these out further.
2070
2071         * UIProcess/API/Cocoa/APIUserContentExtensionStoreCocoa.mm: Added.
2072         (API::UserContentExtensionStore::defaultStorePath):
2073         Helper to get the platform specific path for the store.
2074
2075         * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
2076         (WKUserContentExtensionStoreGetTypeID):
2077         Add ENABLE(CONTENT_EXTENSIONS) guards.
2078
2079         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
2080         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
2081         (-[_WKUserContentExtensionStore dealloc]):
2082         (+[_WKUserContentExtensionStore defaultStore]):
2083         (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
2084         (-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
2085         (-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
2086         (-[_WKUserContentExtensionStore _removeAllContentExtensions]):
2087         (-[_WKUserContentExtensionStore init]): Deleted.
2088         * UIProcess/API/Cocoa/_WKUserContentExtensionStoreInternal.h:
2089         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h: Added.
2090         SPI wrappers for the store.
2091
2092         * WebKit2.xcodeproj/project.pbxproj:
2093         Add new files.
2094
2095 2015-03-30  Antti Koivisto  <antti@apple.com>
2096
2097         Don't cache resources that are very unlikely to be reused
2098         https://bugs.webkit.org/show_bug.cgi?id=143226
2099
2100         Reviewed by Chris Dumez.
2101
2102         Follow-up to cover Cache-control: no-cache case which also has zero cache lifetime.
2103
2104         * NetworkProcess/cache/NetworkCache.cpp:
2105         (WebKit::NetworkCache::makeStoreDecision):
2106
2107 2015-03-30  Antti Koivisto  <antti@apple.com>
2108
2109         Include cache entry worth to json dump
2110         https://bugs.webkit.org/show_bug.cgi?id=143202
2111
2112         Follow-up fix.
2113
2114         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2115         (WebKit::NetworkCache::computeRecordWorth):
2116
2117             This accidentally gave the error case worth 1 rather than 0 as it should be.
2118
2119 2015-03-30  Antti Koivisto  <antti@apple.com>
2120
2121         Don't cache resources that are very unlikely to be reused
2122         https://bugs.webkit.org/show_bug.cgi?id=143226
2123         <rdar://problem/20347160>
2124
2125         Reviewed by Geoff Garen.
2126
2127         We are writing lots of resources to the cache that are never used again.
2128
2129         In browse-around-randomly test this reduced number of cache entries created by ~20% and bytes written by ~5%.
2130
2131         * NetworkProcess/cache/NetworkCache.cpp:
2132         (WebKit::NetworkCache::makeUseDecision):
2133         (WebKit::NetworkCache::makeRetrieveDecision):
2134
2135             Rename for clarity.
2136
2137         (WebKit::NetworkCache::makeStoreDecision):
2138
2139             Store only if the resource has non-zero expiration or has validation headers.
2140
2141             Very High priority resources (main resources) keep the existing policy to minimize impact
2142             on back navigation and tab restore.
2143
2144         (WebKit::NetworkCache::Cache::retrieve):
2145         (WebKit::NetworkCache::Cache::store):
2146         (WebKit::NetworkCache::canUse): Deleted.
2147         (WebKit::NetworkCache::canRetrieve): Deleted.
2148         (WebKit::NetworkCache::canStore): Deleted.
2149         * NetworkProcess/cache/NetworkCache.h:
2150         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2151         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
2152
2153 2015-03-30  Tim Horton  <timothy_horton@apple.com>
2154
2155         Swipe snapshot removed too early (jumps around) on arstechnica and NYT
2156         https://bugs.webkit.org/show_bug.cgi?id=143199
2157         <rdar://problem/18420467>
2158
2159         Reviewed by Dan Bernstein.
2160
2161         Make ViewGestureControllerIOS's snapshot removal timing behave more like the Mac version.
2162
2163         * UIProcess/API/Cocoa/WKWebView.mm:
2164         (-[WKWebView _didCommitLayerTree:]):
2165         Let ViewGestureController know when the page has finished state restoration.
2166
2167         (-[WKWebView _didFinishLoadForMainFrame]):
2168         (-[WKWebView _didSameDocumentNavigationForMainFrame:]):
2169         Forward these to ViewGestureController.
2170
2171         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2172         * UIProcess/ios/PageClientImplIOS.mm:
2173         (WebKit::PageClientImpl::didFinishLoadForMainFrame):
2174         Forward didFinishLoadForMainFrame to WKWebView.
2175
2176         * UIProcess/ios/ViewGestureControllerIOS.mm:
2177         (WebKit::ViewGestureController::ViewGestureController):
2178         (WebKit::ViewGestureController::endSwipeGesture):
2179         Split the swipe snapshot removal state into a bunch of bools.
2180
2181         (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
2182         (WebKit::ViewGestureController::setRenderTreeSize):
2183         (WebKit::ViewGestureController::removeSwipeSnapshotIfReady):
2184         (WebKit::ViewGestureController::removeSwipeSnapshot):
2185         Unify the snapshot removal logic into one function; removeSwipeSnapshotIfReady
2186         completely owns the decision. For now, we're waiting for everything, but
2187         we can do better in the future (using firstVisuallyNonEmptyLayout like Mac used to).
2188
2189         (WebKit::ViewGestureController::didRestoreScrollPosition):
2190         (WebKit::ViewGestureController::didFinishLoadForMainFrame):
2191         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
2192         (WebKit::ViewGestureController::activeLoadMonitoringTimerFired):
2193         Add more conditions for swipe snapshot removal. We'll now wait for
2194         didFinishLoadForMainFrame (or didSameDocumentNavigationForMainFrame),
2195         for active loads to finish, and for the scroll position to be restored.
2196         This brings the iOS implementation in line with the slightly better Mac
2197         implementation, and also sets the stage for deduplication of all of this code.
2198         
2199         * UIProcess/mac/ViewGestureController.h:
2200         * UIProcess/mac/ViewGestureControllerMac.mm:
2201         (WebKit::ViewGestureController::ViewGestureController):
2202
2203 2015-03-30  Chris Dumez  <cdumez@apple.com>
2204
2205         [WK2][NetworkCache] Add support for "Cache-Control: max-stale" request header
2206         https://bugs.webkit.org/show_bug.cgi?id=143159
2207         <rdar://problem/20333296>
2208
2209         Reviewed by Antti Koivisto.
2210
2211         Add support for "Cache-Control: max-stale" request header:
2212         https://tools.ietf.org/html/rfc7234#section-5.2.1.2
2213
2214         * NetworkProcess/cache/NetworkCache.cpp:
2215         (WebKit::NetworkCache::responseHasExpired):
2216         (WebKit::NetworkCache::requestRequiresRevalidation):
2217         (WebKit::NetworkCache::canUse):
2218
2219 2015-03-30  Csaba Osztrogonác  <ossy@webkit.org>
2220
2221         [EFL][GTK] WebKit2's generate-forwarding-headers.pl should fail if clashing headers found
2222         https://bugs.webkit.org/show_bug.cgi?id=142909
2223
2224         Reviewed by Philippe Normand.
2225
2226         * Scripts/generate-forwarding-headers.pl:
2227         (createForwardingHeadersForFramework):
2228
2229 2015-03-29  Antti Koivisto  <antti@apple.com>
2230
2231         Include cache entry worth to json dump
2232         https://bugs.webkit.org/show_bug.cgi?id=143202
2233
2234         Reviewed by Darin Adler.
2235
2236         This is useful for analyzing cache performance.
2237         Also include the body size, total item count and average worth.
2238
2239         * NetworkProcess/cache/NetworkCache.cpp:
2240         (WebKit::NetworkCache::Cache::traverse):
2241         (WebKit::NetworkCache::Cache::dumpContentsToFile):
2242         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2243         (WebKit::NetworkCache::Entry::asJSON):
2244         * NetworkProcess/cache/NetworkCacheEntry.h:
2245         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2246         (WebKit::NetworkCache::Storage::traverse):
2247
2248             Add flags for specificying what sort of information is needed.
2249
2250         (WebKit::NetworkCache::computeRecordWorth):
2251
2252             Factor to a function.
2253
2254         (WebKit::NetworkCache::deletionProbability):
2255         * NetworkProcess/cache/NetworkCacheStorage.h:
2256
2257 2015-03-29  Simon Fraser  <simon.fraser@apple.com>
2258
2259         Fix iOS scrollperf crash after a web process crash
2260         https://bugs.webkit.org/show_bug.cgi?id=143110
2261
2262         Reviewed by Dean Jackson.
2263         
2264         When we destroy the drawing area after a web process crash, we also need to destroy
2265         the scrollingPerformanceData which has a reference to the drawing area.
2266
2267         * UIProcess/WebPageProxy.cpp:
2268         (WebKit::WebPageProxy::resetState):
2269
2270 2015-03-29  Simon Fraser  <simon.fraser@apple.com>
2271
2272         Convert arguments to ScrollingCoordinator functions to references
2273         https://bugs.webkit.org/show_bug.cgi?id=143198
2274
2275         Reviewed by Darin Adler.
2276
2277         Convert all the FrameView* and ScrollableArea* arguments to ScrollingCoordinator functions to
2278         references, and use references in a few other places.
2279
2280         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
2281         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
2282         (WebKit::RemoteScrollingCoordinator::coordinatesScrollingForFrameView):
2283
2284 2015-03-29  Enrica Casucci  <enrica@apple.com>
2285
2286         [iOS WK2] WKContentView should implement _selectionClipRect
2287         https://bugs.webkit.org/show_bug.cgi?id=143143
2288         rdar://problem/20330075
2289
2290         Reviewed by Benjamin Poulain.
2291
2292         UIKit checks if the text delegate responds to this selector
2293         to retrieve the clipping rectangle for the editable element
2294         where the selection is being create.
2295
2296         * UIProcess/ios/WKContentViewInteraction.mm:
2297         (-[WKContentView _selectionClipRect]):
2298
2299 2015-03-29  Antti Koivisto  <antti@apple.com>
2300
2301         Use st_mtime instead of st_atime to track file access time
2302         https://bugs.webkit.org/show_bug.cgi?id=143200
2303
2304         Reviewed by Darin Adler.
2305
2306         On OS X atime updates automatically on read so calling Storage::traverse() would always ends up updating access times
2307         for all cache entries to the current time. This would make entry worth computation produce unexpected results.
2308         We update mtime manually on successful cache retrieve only so switching to it fixes the problem.
2309
2310         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
2311         (WebKit::NetworkCache::fileTimes):
2312         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
2313         (WebKit::NetworkCache::updateFileAccessTimeIfNeeded): Deleted.
2314         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2315         (WebKit::NetworkCache::Storage::updateFileModificationTime):
2316         (WebKit::NetworkCache::Storage::dispatchReadOperation):
2317         (WebKit::NetworkCache::deletionProbability):
2318         (WebKit::NetworkCache::Storage::updateFileAccessTime): Deleted.
2319         * NetworkProcess/cache/NetworkCacheStorage.h:
2320
2321 2015-03-27  Gwang Yoon Hwang  <yoon@igalia.com>
2322
2323         [TexMap] Seperate BitmapTexture related classes implementations from TextureMapper
2324         https://bugs.webkit.org/show_bug.cgi?id=142386
2325
2326         Reviewed by Žan Doberšek.
2327
2328         TextureMapper and TextureMapperGL are bloated and tightly coupled with
2329         BitmapTexture. We should move these classes to seperated file of their own.
2330         Also, this patch removes friend relationship from TextureMapperGL and  its
2331         subsidiary classes.
2332
2333         The main purpose of this refactoring is to expose BitmapTexturePool to
2334         renderers of platformlayers like Video and Canvas. By doing this, each
2335         renderer can acquire textures from the global texture pool to paint
2336         their contents directly.
2337
2338         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: Include BitmapTextureGL.h explicitly
2339
2340 2015-03-27  Anders Carlsson  <andersca@apple.com>
2341
2342         Use a typedef for the WKPluginLoadClientPolicy enum
2343         https://bugs.webkit.org/show_bug.cgi?id=143161
2344
2345         Reviewed by Tim Horton.
2346
2347         * UIProcess/API/C/WKPluginLoadPolicy.h:
2348
2349 2015-03-27  Chris Dumez  <cdumez@apple.com>
2350
2351         [WK2][NetworkCache] Use WTF::WorkQueue abstraction inside NetworkCacheStatistics
2352         https://bugs.webkit.org/show_bug.cgi?id=143154
2353
2354         Reviewed by Antti Koivisto.
2355
2356         Use WTF::WorkQueue abstraction inside NetworkCacheStatistics, like we
2357         already do in NetworkCacheStorage.
2358
2359         * NetworkProcess/cache/NetworkCacheStatistics.cpp: Renamed from Source/WebKit2/NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm.
2360         (WebKit::NetworkCache::executeSQLCommand):
2361         (WebKit::NetworkCache::executeSQLStatement):
2362         (WebKit::NetworkCache::Statistics::open):
2363         (WebKit::NetworkCache::Statistics::Statistics):
2364         (WebKit::NetworkCache::Statistics::initialize):
2365         (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
2366         (WebKit::NetworkCache::Statistics::shrinkIfNeeded):
2367         (WebKit::NetworkCache::Statistics::recordRetrievalRequest):
2368         (WebKit::NetworkCache::Statistics::recordNotCachingResponse):
2369         (WebKit::NetworkCache::retrieveDecisionToDiagnosticKey):
2370         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
2371         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
2372         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
2373         (WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
2374         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
2375         (WebKit::NetworkCache::Statistics::markAsRequested):
2376         (WebKit::NetworkCache::Statistics::writeTimerFired):
2377         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
2378         (WebKit::NetworkCache::Statistics::clear):
2379         (WebKit::NetworkCache::Statistics::addHashesToDatabase):
2380         (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase):
2381         * NetworkProcess/cache/NetworkCacheStatistics.h:
2382         (WebKit::NetworkCache::Statistics::serialBackgroundIOQueue):
2383         * WebKit2.xcodeproj/project.pbxproj:
2384
2385 2015-03-27  Ryosuke Niwa  <rniwa@webkit.org>
2386
2387         Safari clears selection when its window gets activated via mouse down
2388         https://bugs.webkit.org/show_bug.cgi?id=143157
2389
2390         Reviewed by Anders Carlsson.
2391
2392         The bug was caused by PlatformMouseEvent created in WebKit2 not having its event number
2393         even though we were correctly calling setActivationEventNumber in WebPage::acceptsFirstMouse.
2394
2395         Fixed the bug by storing [NSEvent eventNumber] in WebMouseEvent on Mac in WebKit2 as done in WebKit1.
2396
2397         * Shared/WebEvent.h:
2398         (WebKit::WebMouseEvent::eventNumber):
2399         * Shared/WebEventConversion.cpp:
2400         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
2401         * Shared/WebMouseEvent.cpp:
2402         (WebKit::WebMouseEvent::WebMouseEvent):
2403         (WebKit::WebMouseEvent::encode):
2404         (WebKit::WebMouseEvent::decode):
2405         * Shared/mac/WebEventFactory.mm:
2406         (WebKit::WebEventFactory::createWebMouseEvent):
2407
2408 2015-03-27  Anders Carlsson  <andersca@apple.com>
2409
2410         Only do the Connection::setShouldCloseConnectionOnMachExceptions() hack where necessary
2411         https://bugs.webkit.org/show_bug.cgi?id=143141
2412         rdar://problem/19471284
2413
2414         Reviewed by Andreas Kling.
2415
2416         * Platform/IPC/Connection.h:
2417         * Platform/IPC/mac/ConnectionMac.mm:
2418         (IPC::Connection::platformInvalidate):
2419         (IPC::Connection::platformInitialize):
2420         (IPC::Connection::open):
2421         * Shared/ChildProcessProxy.cpp:
2422         (WebKit::ChildProcessProxy::didFinishLaunching):
2423         * UIProcess/Plugins/PluginProcessProxy.cpp:
2424         (WebKit::PluginProcessProxy::didFinishLaunching):
2425
2426 2015-03-27  Tim Horton  <timothy_horton@apple.com>
2427
2428         Implement iOS WebKit2 PDF Find-in-Page
2429         https://bugs.webkit.org/show_bug.cgi?id=143065
2430         <rdar://problem/16793370>
2431
2432         Reviewed by Dan Bernstein.
2433
2434         * Platform/spi/ios/CorePDFSPI.h:
2435         Add some SPI.
2436
2437         * UIProcess/API/Cocoa/WKWebView.mm:
2438         (-[WKWebView _countStringMatches:options:maxCount:]):
2439         (-[WKWebView _findString:options:maxCount:]):
2440         (-[WKWebView _hideFindUI]):
2441         If we have a custom content view, forward find-in-page methods to it.
2442         
2443         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2444         * UIProcess/API/Cocoa/_WKFindOptions.h:
2445         Move _WKFindOptions into its own file.
2446
2447         * UIProcess/Cocoa/WKWebViewContentProvider.h:
2448         Add find-related methods to the WKWebViewContentProvider protocol.
2449
2450         * UIProcess/ios/WKPDFView.mm:
2451         (-[WKPDFView web_initWithFrame:webView:]):
2452         (-[WKPDFView dealloc]):
2453         Maintain a dispatch queue for searching the PDF.
2454
2455         (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
2456         Fix a type.
2457
2458         (-[WKPDFView _ensureViewForPage:]):
2459         Split the code to create/parent a page view out from _revalidateViews,
2460         so that the find code can create/parent the targetted UIPDFPageView
2461         in order to install the find highlight in it, but before it is scrolled into view.
2462
2463         (-[WKPDFView _revalidateViews]):
2464         Use the stored page index instead of counting again.
2465         Don't unparent page views that have find-in-page highlights in them, because
2466         we won't know enough to recreate them later.
2467
2468         (-[WKPDFView _computePageAndDocumentFrames]):
2469         Put the page index in PDFPageInfo, for reference elsewhere.
2470
2471         (-[WKPDFView _stringCompareOptionsFromWKFindOptions:]):
2472         (-[WKPDFView _computeMatchesForString:options:maxCount:completionHandler:]):
2473         Asynchronously (and on our serial queue) search the PDF for the given string.
2474         We'll cache the most recent results to avoid searching more than once,
2475         cancel existing searches when another begins (since it's a serial queue,
2476         this ensures we'll only have one search active at a time).
2477
2478         (-[WKPDFView web_countStringMatches:options:maxCount:]):
2479         Count the number of matches for the given string, and inform the FindClient
2480         of the result.
2481
2482         (-[WKPDFView _didFindMatch:]):
2483         When we find a match, create a view for it, highlight the match, and
2484         zoom so that it's in-view.
2485
2486         (-[WKPDFView web_findString:options:maxCount:]):
2487         Incrementally search the document for the given string. We do an incremental
2488         search even if we have all of the results so that we can anchor the search
2489         in the right place if the new string is a prefix of the old string, etc.
2490         Wrap around appropriately when searching past the beginning or end of the
2491         document. If we have all of the results (there were less than maxCount results),
2492         look through the cached matches for the incrementally-found result and
2493         report its index to the client.
2494
2495         (-[WKPDFView web_hideFindUI]):
2496         Dismiss the selection and clear some state so we start the next search afresh.
2497
2498         * WebKit2.xcodeproj/project.pbxproj:
2499
2500 2015-03-27  Andreas Kling  <akling@apple.com>
2501
2502         WebProcessProxy should not retain WebBackForwardListItems forever.
2503         <https://webkit.org/b/143152>
2504         <rdar://problem/19925709>
2505
2506         Reviewed by Anders Carlsson.
2507
2508         Have WebProcessProxy actually forget about a WebBackForwardListItem after it's removed from
2509         the WebBackForwardList.
2510
2511         This ensures that we don't accumulate too many of these objects, which can get quite large
2512         due to the session state encoded in them.
2513
2514         We already have graceful handling of the case where an incoming IPC message references
2515         a removed back/forward list item.
2516
2517         * UIProcess/WebBackForwardList.cpp:
2518         (WebKit::WebBackForwardList::didRemoveItem):
2519         * UIProcess/WebPageProxy.cpp:
2520         (WebKit::WebPageProxy::backForwardRemovedItem):
2521         * UIProcess/WebProcessProxy.cpp:
2522         (WebKit::WebProcessProxy::removeBackForwardItem):
2523         * UIProcess/WebProcessProxy.h:
2524
2525 2015-03-27  Simon Fraser  <simon.fraser@apple.com>
2526
2527         Use the correct timebase to log scrollperf blank pixel counts on iOS
2528         https://bugs.webkit.org/show_bug.cgi?id=143149
2529
2530         Reviewed by Tim Horton.
2531         
2532         MobileSafari and WebKit need to collect scrollperf data using the same timebase;
2533         MobileSafari can't call WTF::monotonicallyIncreasingTime(), so use CFAbsoluteTimeGetCurrent()
2534         everywhere.
2535
2536         * UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.mm:
2537         (WebKit::RemoteLayerTreeScrollingPerformanceData::appendBlankPixelCount):
2538
2539 2015-03-27  Chris Dumez  <cdumez@apple.com>
2540
2541         [WK2][NetworkCache] Rename requestNeedsRevalidation() to requestRequiresRevalidation()
2542         https://bugs.webkit.org/show_bug.cgi?id=143137
2543
2544         Reviewed by Antti Koivisto.
2545
2546         Rename requestNeedsRevalidation() to requestRequiresRevalidation() as I
2547         think it is more accurate. It is not the request that needs revalidating.
2548         The requests just requires us to revalidate the response.
2549
2550         * NetworkProcess/cache/NetworkCache.cpp:
2551         (WebKit::NetworkCache::requestRequiresRevalidation):
2552         (WebKit::NetworkCache::canUse):
2553         (WebKit::NetworkCache::requestNeedsRevalidation): Deleted.
2554
2555 2015-03-27  Oliver Hunt  <oliver@apple.com>
2556
2557         Forward additional CFNetwork ATS information to child processes
2558         https://bugs.webkit.org/show_bug.cgi?id=143136
2559
2560         Reviewed by Anders Carlsson.
2561
2562         Add additional process creation parameter information, and pass it
2563         to the child processes that actually use CFNetwork.
2564
2565         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2566         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2567         * Shared/Network/NetworkProcessCreationParameters.cpp:
2568         (WebKit::NetworkProcessCreationParameters::encode):
2569         (WebKit::NetworkProcessCreationParameters::decode):
2570         * Shared/Network/NetworkProcessCreationParameters.h:
2571         * Shared/Plugins/PluginProcessCreationParameters.cpp:
2572         (WebKit::PluginProcessCreationParameters::encode):
2573         (WebKit::PluginProcessCreationParameters::decode):
2574         * Shared/Plugins/PluginProcessCreationParameters.h:
2575         * Shared/WebProcessCreationParameters.cpp:
2576         (WebKit::WebProcessCreationParameters::encode):
2577         (WebKit::WebProcessCreationParameters::decode):
2578         * Shared/WebProcessCreationParameters.h:
2579         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2580         (WebKit::WebProcessPool::platformInitializeWebProcess):
2581         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2582         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2583         (WebKit::PluginProcessProxy::platformInitializePluginProcess):
2584         * WebProcess/cocoa/WebProcessCocoa.mm:
2585         (WebKit::WebProcess::platformInitializeWebProcess):
2586
2587 2015-03-27  Chris Dumez  <cdumez@apple.com>
2588
2589         [WK2][NetworkCache] We only cache responses with status codes that are cacheable by default
2590         https://bugs.webkit.org/show_bug.cgi?id=143125
2591         <rdar://problem/20321172>
2592
2593         Reviewed by Antti Koivisto.
2594
2595         We Previously only cached responses with status codes that are cacheable
2596         by default [1]. However, RFC 7234 [2] allows us to cache responses with
2597         other status codes, as long as they have explicit headers allowing
2598         caching:
2599         - 'Expires' header field
2600         - 'max-age' response directive
2601
2602         This patch updates our caching policy accordingly to improve efficiency.
2603
2604         [1] http://tools.ietf.org/html/rfc7231#page-48
2605         [2] http://tools.ietf.org/html/rfc7234#section-4.3.2
2606
2607         Test: http/tests/cache/disk-cache/disk-cache-307-status-code.html
2608
2609         * NetworkProcess/cache/NetworkCache.cpp:
2610         (WebKit::NetworkCache::canStore):
2611
2612 2015-03-26  Antti Koivisto  <antti@apple.com>
2613
2614         Respect cache-control directives in request
2615         https://bugs.webkit.org/show_bug.cgi?id=143121
2616         rdar://problem/19714040
2617
2618         Reviewed by Chris Dumez.
2619
2620         Better support for https://tools.ietf.org/html/rfc7234#section-5.2.1
2621
2622         * NetworkProcess/cache/NetworkCache.cpp:
2623         (WebKit::NetworkCache::canUse):
2624
2625             Consider requests with Cache-control: no-cache and max-age=0 expired.
2626
2627         (WebKit::NetworkCache::canStore):
2628
2629             Don't store requests with Cache-control: no-store.
2630
2631         (WebKit::NetworkCache::Cache::store):
2632         * NetworkProcess/cache/NetworkCache.h:
2633         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
2634         (WebKit::NetworkCache::storeDecisionToDiagnosticKey):
2635
2636 2015-03-25  Jon Honeycutt  <jhoneycutt@apple.com>
2637
2638         iOS file upload panel menu items need icons
2639         <https://bugs.webkit.org/show_bug.cgi?id=143042>
2640         <rdar://problem/20178678>
2641
2642         Reviewed by Andy Estes.
2643
2644         * Platform/spi/ios/UIKitSPI.h:
2645         Declare new SPI methods _UIImageGetWebKitTakePhotoOrVideoIcon and
2646         _UIImageGetWebKitPhotoLibraryIcon().
2647
2648         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2649         (photoLibraryIcon):
2650         (cameraIcon):
2651         If UIKit SPI exists, use it. Otherwise, return nil.
2652
2653         (-[WKFileUploadPanel _showDocumentPickerMenu]):
2654         Use icons.
2655
2656 2015-03-26  Enrica Casucci  <enrica@apple.com>
2657
2658         OS X build fix after r182037.
2659
2660         Unreviewed.
2661
2662         * UIProcess/API/mac/WKView.mm:
2663         (-[WKView _addFontPanelObserver]):
2664         (-[WKView removeWindowObservers]):
2665         (-[WKView observeValueForKeyPath:ofObject:change:context:]):
2666
2667 2015-03-26  Enrica Casucci  <enrica@apple.com>
2668
2669         iOS build fix after r182037.
2670
2671         Unreviewed.
2672
2673         * UIProcess/API/Cocoa/WKWebView.mm:
2674         (-[WKWebView _setEditable:]):
2675
2676 2015-03-26  Enrica Casucci  <enrica@apple.com>
2677
2678         REGRESSION(r1807689): Slower startup time for WKWebView.
2679         https://bugs.webkit.org/show_bug.cgi?id=143115
2680         rdar://problem/20233711
2681
2682         Reviewed by Anders Carlsson.
2683
2684         In http://trac.webkit.org/changeset/180768 we added an observer to
2685         track visibility of the NSFontPanel to ensure we could fetch the font
2686         information for the current selection when the panel first becomes visible.
2687         It turns out that adding the observer requires the shared font panel
2688         object to be created.
2689         That is apparently a very expensive operation that is regressing
2690         the initialization time for the WKWebView.
2691         We should initialize the NSFontPanel lazily, only when we make the entire
2692         view editable.
2693
2694         * UIProcess/API/Cocoa/WKWebView.mm:
2695         (-[WKWebView _setEditable:]):
2696         * UIProcess/API/mac/WKView.mm:
2697         (-[WKView addWindowObserversForWindow:]):
2698         (-[WKView _addFontPanelObserver]):
2699         (-[WKView removeWindowObservers]):
2700         (-[WKView observeValueForKeyPath:ofObject:change:context:]):
2701         * UIProcess/API/mac/WKViewInternal.h:
2702
2703 2015-03-26  Alex Christensen  <achristensen@webkit.org>
2704
2705         Progress towards CMake on Mac.
2706         https://bugs.webkit.org/show_bug.cgi?id=143112
2707
2708         Reviewed by Chris Dumez.
2709
2710         * CMakeLists.txt:
2711         * PlatformMac.cmake:
2712         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2713
2714 2015-03-26  Chris Dumez  <cdumez@apple.com>
2715
2716         [WK2][Cocoa] Add private API to override the network disk cache size
2717         https://bugs.webkit.org/show_bug.cgi?id=143113
2718         <rdar://problem/20315669>
2719
2720         Reviewed by Antti Koivisto.
2721
2722         Add private API to let the client override the network disk cache size.
2723         By default, the network disk cache is automatically determined based on
2724         the CacheModel and the available disk space. However, for testing
2725         purposes, it can be used for the client-side to be able to override
2726         the disk cache size.
2727
2728         * NetworkProcess/NetworkProcess.cpp:
2729         (WebKit::NetworkProcess::initializeNetworkProcess):
2730         * NetworkProcess/NetworkProcess.h:
2731         * NetworkProcess/cache/NetworkCache.cpp:
2732         (WebKit::NetworkCache::Cache::setMaximumSize):
2733         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2734         (WebKit::NetworkProcess::platformSetCacheModel):
2735         * Shared/Network/NetworkProcessCreationParameters.cpp:
2736         (WebKit::NetworkProcessCreationParameters::encode):
2737         (WebKit::NetworkProcessCreationParameters::decode):
2738         * Shared/Network/NetworkProcessCreationParameters.h:
2739         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2740         (API::ProcessPoolConfiguration::copy):
2741         * UIProcess/API/APIProcessPoolConfiguration.h:
2742         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2743         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2744         (-[_WKProcessPoolConfiguration diskCacheSizeOverride]):
2745         (-[_WKProcessPoolConfiguration setDiskCacheSizeOverride:]):
2746         * UIProcess/WebProcessPool.cpp:
2747         (WebKit::WebProcessPool::WebProcessPool):
2748         (WebKit::WebProcessPool::ensureNetworkProcess):
2749         * UIProcess/WebProcessPool.h:
2750
2751 2015-03-26  Andreas Kling  <akling@apple.com>
2752
2753         [Darwin] Boost the web process QoS level while handling a synchronous IPC message.
2754         <https://webkit.org/b/142988>
2755         <rdar://problem/20264346>
2756
2757         Reviewed by Antti Koivisto and Anders Carlsson.
2758
2759         Add a mechanism for IPC::Connection to boost the main thread for the duration
2760         of processing a synchronous message.
2761
2762         This fixes an issue where the UI process would block on a synchronous request
2763         to the web process that was being carried out at a lower QoS level.
2764
2765         * Platform/IPC/Connection.cpp:
2766         (IPC::Connection::Connection): Save the main thread's pthread_t while we have
2767         a chance to retreive it.
2768
2769         (IPC::Connection::processIncomingMessage): Optionally boost the main thread when
2770         processing an incoming message with the IsSyncMessage flag set.
2771
2772         * Platform/IPC/Connection.h:
2773         (IPC::Connection::setShouldBoostMainThreadOnSyncMessage): Added. When this mode is
2774         enabled, Connection will give a temporary QoS override to the main thread when
2775         receiving a synchronous message. Ownership of the override is handed to the
2776         MessageDecoder, which resets the main thread QoS in its destructor.
2777
2778         * Platform/IPC/MessageDecoder.cpp:
2779         (IPC::MessageDecoder::~MessageDecoder): Remove any QoS override owned by this message.
2780
2781         * Platform/IPC/MessageDecoder.h:
2782         (IPC::MessageDecoder::setQOSClassOverride): Added. Takes ownership of a QoS override
2783         to make sure it stays in effect until this message has been dispatched.
2784
2785         * WebProcess/WebProcess.cpp:
2786         (WebKit::WebProcess::initializeConnection): Set up main thread QoS boosting for the
2787         web process's connection to the UI process.
2788
2789 2015-03-26  Ryosuke Niwa  <rniwa@webkit.org>
2790
2791         Cursor doesn't change back to pointer when leaving Mail
2792         https://bugs.webkit.org/show_bug.cgi?id=132038
2793
2794         Reviewed by Anders Carlsson.
2795
2796         Fixed the bug by adding a cursor rect and making the primary tracking area update the cursor so that
2797         AppKit will reset the cursor as it leaves the WebView.
2798
2799         We use nil cursor here since we manually update the cursor by calling [NSCursor set].
2800
2801         * UIProcess/API/mac/WKView.mm:
2802         (-[WKView initWithFrame:processPool:configuration:webView:]):
2803         * UIProcess/mac/PageClientImpl.mm:
2804         (WebKit::PageClientImpl::recommendedScrollbarStyleDidChange):
2805
2806 2015-03-26  Michael Catanzaro  <mcatanzaro@igalia.com>
2807
2808         [Linux] SeccompFilters: improve the port-agnostic whitelist
2809         https://bugs.webkit.org/show_bug.cgi?id=140064
2810
2811         Reviewed by Žan Doberšek.
2812
2813         Allow the web process to access several files and directories that it
2814         was previously prohibited from accessing. This makes the web process
2815         much less likely to break.
2816
2817         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
2818         (WebKit::SyscallPolicy::addDefaultWebProcessPolicy):
2819
2820 2015-03-26  Antti Koivisto  <antti@apple.com>
2821
2822         Remove unneeded isConditionalRequest check from NetworkResourceLoader
2823         https://bugs.webkit.org/show_bug.cgi?id=143096
2824
2825         Reviewed by Anders Carlsson.
2826
2827         This check is leftover from implementation that allowed disk cache to validate conditional
2828         request itself. The case can't happen as NetworkCache canRetrieve test does not allow
2829         conditional requests in the first place.
2830
2831         * NetworkProcess/NetworkResourceLoader.cpp:
2832         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
2833         (WebKit::isConditionalRequest): Deleted.
2834
2835 2015-03-26  Antti Koivisto  <antti@apple.com>
2836
2837         Rename Storage::Entry to Storage::Record
2838         https://bugs.webkit.org/show_bug.cgi?id=143101
2839
2840         Reviewed by Chris Dumez.
2841
2842         Lets have just one type called Entry in the cache code.
2843
2844         * NetworkProcess/cache/NetworkCache.cpp:
2845         (WebKit::NetworkCache::Cache::retrieve):
2846         (WebKit::NetworkCache::Cache::store):
2847         (WebKit::NetworkCache::Cache::update):
2848         (WebKit::NetworkCache::Cache::traverse):
2849         (WebKit::NetworkCache::Cache::dumpContentsToFile):
2850         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2851         (WebKit::NetworkCache::Entry::Entry):
2852         (WebKit::NetworkCache::Entry::encodeAsStorageRecord):
2853         (WebKit::NetworkCache::Entry::decodeStorageRecord):
2854         (WebKit::NetworkCache::Entry::initializeBufferFromStorageRecord):
2855         (WebKit::NetworkCache::Entry::buffer):
2856         (WebKit::NetworkCache::Entry::shareableResourceHandle):
2857         (WebKit::NetworkCache::Entry::encode): Deleted.
2858         (WebKit::NetworkCache::Entry::decode): Deleted.
2859         (WebKit::NetworkCache::Entry::initializeBufferFromStorageEntry): Deleted.
2860         * NetworkProcess/cache/NetworkCacheEntry.h:
2861         (WebKit::NetworkCache::Entry::sourceStorageRecord):
2862         (WebKit::NetworkCache::Entry::sourceStorageEntry): Deleted.
2863         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2864         (WebKit::NetworkCache::RecordMetaData::RecordMetaData):
2865         (WebKit::NetworkCache::decodeRecordMetaData):
2866         (WebKit::NetworkCache::decodeRecordHeader):
2867         (WebKit::NetworkCache::decodeRecord):
2868         (WebKit::NetworkCache::encodeRecordMetaData):
2869         (WebKit::NetworkCache::encodeRecordHeader):
2870         (WebKit::NetworkCache::Storage::dispatchReadOperation):
2871         (WebKit::NetworkCache::retrieveFromMemory):
2872         (WebKit::NetworkCache::Storage::store):
2873         (WebKit::NetworkCache::Storage::update):
2874         (WebKit::NetworkCache::Storage::traverse):
2875         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
2876         (WebKit::NetworkCache::Storage::dispatchFullWriteOperation):
2877         (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
2878         (WebKit::NetworkCache::EntryMetaData::EntryMetaData): Deleted.
2879         (WebKit::NetworkCache::decodeEntryMetaData): Deleted.
2880         (WebKit::NetworkCache::decodeEntryHeader): Deleted.
2881         (WebKit::NetworkCache::decodeEntry): Deleted.
2882         (WebKit::NetworkCache::encodeEntryMetaData): Deleted.
2883         (WebKit::NetworkCache::encodeEntryHeader): Deleted.
2884         * NetworkProcess/cache/NetworkCacheStorage.h:
2885
2886 2015-03-26  Chris Dumez  <cdumez@apple.com>
2887
2888         [WK2] Let the compiler generate the NetworkCache::Key move constructor
2889         https://bugs.webkit.org/show_bug.cgi?id=143079
2890
2891         Reviewed by Antti Koivisto.
2892
2893         Let the compiler generate the NetworkCache::Key move constructor. The
2894         generated one will do exactly the same thing as the one we had except
2895         that it will move the m_hash member as well. I don't see any reason why
2896         we weren't moving this member before (it is an std::array<uint8_t, 16>).
2897
2898         Also have the compiler generate a move assignment operator for
2899         consistency. Although it is not currently useful, it could be at some
2900         point.
2901
2902         * NetworkProcess/cache/NetworkCacheKey.cpp:
2903         (WebKit::NetworkCache::Key::Key): Deleted.
2904         * NetworkProcess/cache/NetworkCacheKey.h:
2905
2906 2015-03-26  Chris Dumez  <cdumez@apple.com>
2907
2908         [WK2][NetworkCache] Compute if a cached response has expired only when actually needed
2909         https://bugs.webkit.org/show_bug.cgi?id=143070
2910
2911         Reviewed by Antti Koivisto.
2912
2913         Compute if a cached response has expired only when actually needed:
2914         - This is not a history navigation
2915         and
2916         - It does not have "Cache-Control: no-cache" header
2917
2918         Previously, we would always determine if the response has expired and
2919         we often end up not using this information.
2920
2921         * NetworkProcess/cache/NetworkCache.cpp:
2922         (WebKit::NetworkCache::responseHasExpired):
2923         (WebKit::NetworkCache::canUse):
2924
2925 2015-03-26  Zan Dobersek  <zdobersek@igalia.com>
2926
2927         Avoid the Vector<> copy in WebTouchEvent constructor
2928         https://bugs.webkit.org/show_bug.cgi?id=143043
2929
2930         Reviewed by Carlos Garcia Campos.
2931
2932         Have the WebTouchEvent accept a Vector<> rvalue.
2933         The relevant code is updated so the Vector<> object is moved
2934         through the call chain and finally into the WebTouchEvent constructor.
2935
2936         * Shared/NativeWebTouchEvent.h:
2937         * Shared/WebEvent.h:
2938         * Shared/WebTouchEvent.cpp:
2939         (WebKit::WebTouchEvent::WebTouchEvent):
2940         * Shared/efl/WebEventFactory.cpp:
2941         (WebKit::WebEventFactory::createWebTouchEvent):
2942         * Shared/gtk/NativeWebTouchEventGtk.cpp:
2943         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
2944         * Shared/gtk/WebEventFactory.cpp:
2945         (WebKit::WebEventFactory::createWebTouchEvent):
2946         * Shared/gtk/WebEventFactory.h:
2947         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2948         (webkitWebViewBaseTouchEvent):
2949
2950 2015-03-25  Chris Dumez  <cdumez@apple.com>
2951
2952         [WK2] WebFrameLoaderClient::dispatchDecidePolicyForResponse() should always call the FramePolicyFunction
2953         https://bugs.webkit.org/show_bug.cgi?id=143036
2954         <rdar://problem/20252438>
2955         <rdar://problem/13811738>
2956
2957         Reviewed by Alexey Proskuryakov.
2958
2959         WebFrameLoaderClient::dispatchDecidePolicyForResponse() should always
2960         call the FramePolicyFunction. Previously, it would fail to do in 2
2961         cases:
2962         - m_frame->page() returns null
2963         or
2964         - webPage->sendSync() returns false
2965
2966         If the FramePolicyFunction is not called, we will fail to clear the
2967         callback in the PolicyChecker and
2968         DocumentLoader::continueAfterContentPolicy() will not be called.
2969
2970         DocumentLoader::continueAfterContentPolicy() is in charge of resetting
2971         m_waitingForContentPolicy flag to false. This could therefore explain
2972         the following assertion being hit in DocumentLoader::detachFromFrame()
2973         (see <rdar://problem/20252438>):
2974         RELEASE_ASSERT(!m_waitingForContentPolicy)
2975
2976         Also, as the PolicyChecker callback is not cleared, it could make it
2977         possible for DocumentLoader::continueAfterContentPolicy() to be called
2978         *after* the load is finished, when later canceling the PolicyCallback:
2979         FrameLoader::stopAllLoaders()
2980          -> PolicyChecker::stopCheck()
2981           -> PolicyCallback::cancel()
2982            -> DocumentLoader::continueAfterContentPolicy(PolicyIgnore)
2983
2984         Calling continueAfterContentPolicy(PolicyIgnore) after the load is
2985         finished would be bad and could explain some of the crashes we've seen
2986         in DocumentLoader::continueAfterContentPolicy() ->
2987         DocumentLoader:: stopLoadingForPolicyChange() (see
2988         <rdar://problem/13811738>).
2989
2990         This patch also applies the same fix to
2991         dispatchDecidePolicyForNewWindowAction() and
2992         dispatchDecidePolicyForNavigationAction() as they use the same pattern.
2993
2994         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2995         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2996         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
2997         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2998
2999 2015-03-25  Tim Horton  <timothy_horton@apple.com>
3000
3001         Add a preference to prevent "user-scalable=no" from having any effect
3002         https://bugs.webkit.org/show_bug.cgi?id=143032
3003
3004         Reviewed by Sam Weinig.
3005
3006         * Shared/WebPreferencesDefinitions.h:
3007         * WebProcess/WebPage/WebPage.cpp:
3008         (WebKit::WebPage::updatePreferences):
3009         Add a preference and push it to the ViewportConfiguration.
3010
3011 2015-03-25  Beth Dakin  <bdakin@apple.com>
3012
3013         REGRESSION (r181660): Force click url preview doesn't have a TextIndicator in Mail
3014         https://bugs.webkit.org/show_bug.cgi?id=143064
3015         -and corresponding-
3016         rdar://problem/20251440
3017
3018         Reviewed by Tim Horton.
3019
3020         The TextIndicator was getting set to nil by the call to 
3021         _dismissContentRelativeChildWindows in mouseDown. That line of code was added by 
3022         http://trac.webkit.org/changeset/177242 to work around a bug in another component 
3023         that has now been resolved, so it no longer appears to be necessary. 
3024
3025         * UIProcess/API/mac/WKView.mm:
3026         (-[WKView mouseDown:]):
3027
3028 2015-03-25  Anders Carlsson  <andersca@apple.com>
3029
3030         Add network and application cache directories to WebsiteDataStore
3031         https://bugs.webkit.org/show_bug.cgi?id=143063
3032
3033         Reviewed by Sam Weinig.
3034
3035         Create a WebKit directory under ~/Library/Caches/<Bundle ID> for non-sandboxed applications,
3036         and ~/Library/Caches for sandboxed applications. Create NetworkCache and OfflineWebApplicationCache
3037         subdirectories. These directories will be used with the modern WebKit API.
3038
3039         * UIProcess/API/APIWebsiteDataStore.h:
3040         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
3041         (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
3042         (API::WebsiteDataStore::defaultDataStoreConfiguration):
3043         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3044         (WebKit::WebsiteDataStore::WebsiteDataStore):
3045         * UIProcess/WebsiteData/WebsiteDataStore.h:
3046
3047 2015-03-25  Sam Weinig  <sam@webkit.org>
3048
3049         Address additional review feedback from https://bugs.webkit.org/show_bug.cgi?id=143059.
3050
3051         * Shared/WebCompiledContentExtension.cpp:
3052         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
3053         * UIProcess/API/C/WKUserContentFilterRef.cpp:
3054         (WKUserContentFilterCreate):
3055         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
3056         (-[_WKUserContentFilter initWithName:serializedRules:]):
3057
3058 2015-03-25  Sam Weinig  <sam@webkit.org>
3059
3060         [Content Extensions] Convert content extension compiling to return error codes and write its output using a client
3061         https://bugs.webkit.org/show_bug.cgi?id=143059
3062
3063         Reviewed by Alex Christensen.
3064
3065         * Shared/WebCompiledContentExtension.cpp:
3066         * Shared/WebCompiledContentExtension.h:
3067         (WebKit::LegacyContentExtensionCompilationClient::LegacyContentExtensionCompilationClient):
3068         (WebKit::LegacyContentExtensionCompilationClient::writeBytecode):
3069         (WebKit::LegacyContentExtensionCompilationClient::writeActions):
3070         Add subclass of ContentExtensionCompilationClient for use with the non-file backed content
3071         extensions.
3072
3073         * UIProcess/API/C/WKUserContentFilterRef.cpp:
3074         (WKUserContentFilterCreate):
3075         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
3076         (-[_WKUserContentFilter initWithName:serializedRules:]):
3077         Update to use the new interface of compileRuleList().
3078
3079 2015-03-25  Ryosuke Niwa  <rniwa@webkit.org>
3080
3081         Web Inspector: Switching tabs to window with inspector open prohibits typing into console
3082         https://bugs.webkit.org/show_bug.cgi?id=126800
3083
3084         Reviewed by Anders Carlsson.
3085
3086         This is a regression from r85356 and r83814. These two patches made WKWebView clear its selection
3087         when WKView resigns the first responder without ever restoring it even if WKView later becomes
3088         the first responder again. This is problematic when a text field or a editing host element had been
3089         focused and selected prior to the resignation since the editing code uses the selection to determine
3090         the editability of the element.
3091
3092         Fixed the bug by restoring selection in [WKView becomeFirstResponder] if the selection is empty.
3093
3094         * UIProcess/API/mac/WKView.mm:
3095         (-[WKView becomeFirstResponder]):
3096         * UIProcess/WebPageProxy.cpp:
3097         (WebKit::WebPageProxy::restoreSelectionInFocusedEditableElement):
3098         * UIProcess/WebPageProxy.h:
3099         * WebProcess/WebPage/WebPage.cpp:
3100         (WebKit::WebPage::restoreSelectionInFocusedEditableElement):
3101         * WebProcess/WebPage/WebPage.h:
3102         * WebProcess/WebPage/WebPage.messages.in:
3103
3104 2015-03-25  Beth Dakin  <bdakin@apple.com>
3105
3106         REGRESSION (r181660): Safari navigates to link after a starting and canceling a 
3107         force preview
3108         https://bugs.webkit.org/show_bug.cgi?id=143057
3109         -and corresponding-
3110         rdar://problem/20251436
3111
3112         Reviewed by Tim Horton.
3113
3114         Always call _page->immediateActionDidUpdate() so that the EventHandler’s 
3115         ImmediateActionStage is appropriately updated.
3116         * UIProcess/mac/WKImmediateActionController.mm:
3117         (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
3118
3119         Update the EventHandler’s ImmediateActionStage.
3120         * WebProcess/WebPage/mac/WebPageMac.mm:
3121         (WebKit::WebPage::immediateActionDidUpdate):
3122
3123 2015-03-25  Antti Koivisto  <antti@apple.com>
3124
3125         Separate entry decoding from validation
3126         https://bugs.webkit.org/show_bug.cgi?id=143052
3127
3128         Reviewed by Chris Dumez.
3129
3130         Make NetworkCache::Cache a class and move it to a file of its own.
3131         Move the encoding/decoding code there.
3132
3133         * NetworkProcess/NetworkProcess.cpp:
3134         (WebKit::fetchDiskCacheEntries):
3135         (WebKit::clearDiskCacheEntries):
3136         * NetworkProcess/NetworkResourceLoader.cpp:
3137         (WebKit::sendReplyToSynchronousRequest):
3138         (WebKit::NetworkResourceLoader::start):
3139         (WebKit::NetworkResourceLoader::sendBufferMaybeAborting):
3140         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
3141         (WebKit::NetworkResourceLoader::validateCacheEntry):
3142         * NetworkProcess/NetworkResourceLoader.h:
3143         * NetworkProcess/cache/NetworkCache.cpp:
3144         (WebKit::NetworkCache::collectVaryingRequestHeaders):
3145         (WebKit::NetworkCache::canUse):
3146
3147             Focused function for deciding if we can use a cache entry and if it needs validation.
3148
3149         (WebKit::NetworkCache::Cache::retrieve):
3150         (WebKit::NetworkCache::Cache::store):
3151         (WebKit::NetworkCache::Cache::update):
3152         (WebKit::NetworkCache::Cache::traverse):
3153         (WebKit::NetworkCache::encodeStorageEntry): Deleted.
3154         (WebKit::NetworkCache::decodeStorageEntry): Deleted.
3155         * NetworkProcess/cache/NetworkCache.h:
3156         * NetworkProcess/cache/NetworkCacheEntry.cpp: Added.
3157         (WebKit::NetworkCache::Entry::Entry):
3158         (WebKit::NetworkCache::Entry::encode):
3159         (WebKit::NetworkCache::Entry::decode):
3160         (WebKit::NetworkCache::Entry::initializeBufferFromStorageEntry):
3161         (WebKit::NetworkCache::Entry::buffer):
3162         (WebKit::NetworkCache::Entry::shareableResourceHandle):
3163         (WebKit::NetworkCache::Entry::needsValidation):
3164         (WebKit::NetworkCache::Entry::setNeedsValidation):
3165         * NetworkProcess/cache/NetworkCacheEntry.h: Added.
3166         (WebKit::NetworkCache::Entry::key):
3167         (WebKit::NetworkCache::Entry::timeStamp):
3168         (WebKit::NetworkCache::Entry::response):
3169         (WebKit::NetworkCache::Entry::varyingRequestHeaders):
3170         (WebKit::NetworkCache::Entry::sourceStorageEntry):
3171         * NetworkProcess/cache/NetworkCacheStatistics.h:
3172         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
3173         (WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
3174         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
3175         * WebKit2.xcodeproj/project.pbxproj:
3176
3177 2015-03-25  David Hyatt  <hyatt@apple.com>
3178
3179         Add a pref to enable the new block-inside-inline model
3180         https://bugs.webkit.org/show_bug.cgi?id=143050
3181
3182         Reviewed by Sam Weinig.
3183
3184         * Shared/WebPreferencesDefinitions.h:
3185         * UIProcess/API/C/WKPreferences.cpp:
3186         (WKPreferencesSetNewBlockInsideInlineModelEnabled):
3187         (WKPreferencesGetNewBlockInsideInlineModelEnabled):
3188         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3189         * WebProcess/WebPage/WebPage.cpp:
3190         (WebKit::WebPage::updatePreferences):
3191
3192 2015-03-25  Zan Dobersek  <zdobersek@igalia.com>
3193
3194         [WK2] WebUserMediaClient::pageDestroyed() virtual method should be marked as override
3195         https://bugs.webkit.org/show_bug.cgi?id=143046
3196
3197         Reviewed by Carlos Garcia Campos.
3198
3199         * WebProcess/WebCoreSupport/WebUserMediaClient.h: Mark the WebUserMediaClient::pageDestroyed()
3200         method, inherited from the WebCore::UserMediaClient, as an override.
3201
3202 2015-03-25  Zan Dobersek  <zdobersek@igalia.com>
3203
3204         [GTK][WK2] WebPageProxy::failedToShowPopupMenu() virtual method should be marked as override
3205         https://bugs.webkit.org/show_bug.cgi?id=143045
3206
3207         Reviewed by Carlos Garcia Campos.
3208
3209         * UIProcess/WebPageProxy.h: Mark the failedToShowPopupMenu(), inherited from
3210         the WebPopupMenuProxy::Client class, as overridden.
3211
3212 2015-03-25  Zan Dobersek  <zdobersek@igalia.com>
3213
3214         [WK2] Clean up DrawingAreaImpl vtable overrides
3215         https://bugs.webkit.org/show_bug.cgi?id=143044
3216
3217         Reviewed by Carlos Garcia Campos.
3218
3219         Declare virtual methods of the DrawingAreaImpl class as overridden where necessary.
3220
3221         * WebProcess/WebPage/DrawingAreaImpl.h:
3222         (WebKit::DrawingAreaImpl::layerTreeStateIsFrozen): Deleted.
3223         (WebKit::DrawingAreaImpl::layerTreeHost): Deleted.
3224
3225 2015-03-24  Ryosuke Niwa  <rniwa@webkit.org>
3226
3227         Inspector doesn't get focused when opened in dock mode
3228         https://bugs.webkit.org/show_bug.cgi?id=143030
3229
3230         Reviewed by Anders Carlsson.
3231
3232         The bug was caused by platformBringToFront and platformAttach calling makeFirstResponder on WKWebView,
3233         which aren't intended to become the first responder. Fixed the bug by calling makeFirstResponder on the WKView
3234         subview of the WKWebView, which is intended to be used as the first responder on behalf of the web view.
3235
3236         * UIProcess/mac/WebInspectorProxyMac.mm:
3237         (WebKit::WebInspectorProxy::platformBringToFront):
3238         (WebKit::WebInspectorProxy::platformAttach):
3239
3240 2015-03-24  Chris Dumez  <cdumez@apple.com>
3241
3242         [WK2] Responses with 302 HTTP Status Code should not be cached
3243         https://bugs.webkit.org/show_bug.cgi?id=143028
3244         <rdar://problem/19714040>
3245
3246         Reviewed by Antti Koivisto.
3247
3248         Responses with 302 HTTP Status Code should not be cached as per
3249         RFC 7231:
3250         http://tools.ietf.org/html/rfc7231#section-6.1
3251
3252         This patch updates our disk cache policy accordingly.
3253
3254         Test: http/tests/cache/disk-cache/disk-cache-302-status-code.html
3255
3256         * NetworkProcess/cache/NetworkCache.cpp:
3257         (WebKit::NetworkCache::canStore):
3258
3259 2015-03-24  Anders Carlsson  <andersca@apple.com>
3260
3261         Fix crash in WebKit::RemoteObjectRegistry::sendInvocation
3262         https://bugs.webkit.org/show_bug.cgi?id=143027
3263         rdar://problem/20208674
3264
3265         Reviewed by Sam Weinig.
3266
3267         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3268         (-[WKWebProcessPlugInBrowserContextController dealloc]):
3269         Make sure to invalidate the _WKRemoteObjectRegistry like we do in the UI process.
3270
3271 2015-03-24  Chris Dumez  <cdumez@apple.com>
3272
3273         [WK2] Responses with 204 HTTP Status Code should be cacheable by default
3274         https://bugs.webkit.org/show_bug.cgi?id=143020
3275         <rdar://problem/20281529>
3276
3277         Reviewed by Antti Koivisto.
3278
3279         Make responses with 204 HTTP Status Code cacheable by default, as
3280         per RFC 7231:
3281         http://tools.ietf.org/html/rfc7231#section-6.3.5
3282
3283         Test: http/tests/cache/disk-cache/disk-cache-204-status-code.html
3284
3285         * NetworkProcess/cache/NetworkCache.cpp:
3286         (WebKit::NetworkCache::canStore):
3287
3288 2015-03-24  Enrica Casucci  <enrica@apple.com>
3289
3290         [iOS] Remove unused keyboard code in WKSelectPopover class.
3291         https://bugs.webkit.org/show_bug.cgi?id=143021
3292
3293         Reviewed by Joseph Pecoraro.
3294
3295         WKSelectPopover created an instance of UIKeyboard that was
3296         initialized in initWithView but never used. Removing the
3297         obsolete code.
3298
3299         * UIProcess/ios/forms/WKFormSelectPopover.mm:
3300         (-[WKSelectPopover initWithView:hasGroups:]):
3301
3302 2015-03-24  Dan Bernstein  <mitz@apple.com>
3303
3304         WebKit2 part of <rdar://problem/20282863> Transforms are flattened in snapshots of on-screen WKWebViews
3305         https://bugs.webkit.org/show_bug.cgi?id=143023
3306
3307         Reviewed by Tim Horton.
3308
3309         * UIProcess/API/Cocoa/WKWebView.mm:
3310         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): If the view is in a
3311         window, use CARenderServerRenderLayerWithTransform to synchronously capture a snapshot of
3312         its layer tree into an IOSurfcae, then call the completion handler with an image created
3313         from the IOSurface.
3314
3315 2015-03-24  Beth Dakin  <bdakin@apple.com>
3316
3317         Add events related to force click gesture
3318         https://bugs.webkit.org/show_bug.cgi?id=142836
3319         -and corresponding-
3320         rdar://problem/20210239
3321
3322         Reviewed by Dean Jackson.
3323
3324         ActionMenuHitTestResult has a new bool indicating whether to not the HitTestResult 
3325         will prevent default. 
3326         * Shared/mac/ActionMenuHitTestResult.h:
3327         * Shared/mac/ActionMenuHitTestResult.mm:
3328         (WebKit::ActionMenuHitTestResult::encode):
3329         (WebKit::ActionMenuHitTestResult::decode):
3330
3331         Send immediateActionDidUpdate and the normalized force over the the WebProcess.
3332         * UIProcess/WebPageProxy.cpp:
3333         (WebKit::WebPageProxy::immediateActionDidUpdate):
3334         * UIProcess/WebPageProxy.h:
3335
3336         We need a dummy animation controller when web content is overriding the default 
3337         behavior.
3338         * UIProcess/mac/WKImmediateActionController.mm:
3339
3340         Send along the update information.
3341         (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
3342
3343         Use the dummy animation controller if default has been prevented.
3344         (-[WKImmediateActionController _defaultAnimationController]):
3345         (-[WKImmediateActionController _updateImmediateActionItem]):
3346
3347         Keep track of whether m_lastActionMenuHitTes prevented the default immediate 
3348         action behavior.
3349         * WebProcess/WebPage/WebPage.cpp:
3350         (WebKit::WebPage::WebPage):
3351         * WebProcess/WebPage/WebPage.h:
3352         * WebProcess/WebPage/WebPage.messages.in:
3353
3354         Call dispatchMouseForceMayBegin() at hit test time.
3355         * WebProcess/WebPage/mac/WebPageMac.mm:
3356         (WebKit::WebPage::performActionMenuHitTestAtLocation):
3357
3358         Call dispatchMouseForceChanged() if appropriate.
3359         (WebKit::WebPage::immediateActionDidUpdate):
3360
3361         Call dispatchMouseForceCancelled() if appropriate.
3362         (WebKit::WebPage::immediateActionDidCancel):
3363
3364         Call dispatchMouseForceDown() if appropriate.
3365         (WebKit::WebPage::immediateActionDidComplete):
3366
3367 2015-03-24  Anders Carlsson  <andersca@apple.com>
3368
3369         Fix designated initializer violations
3370         https://bugs.webkit.org/show_bug.cgi?id=143016
3371         rdar://problem/20268858
3372
3373         Reviewed by Dan Bernstein.
3374
3375         Move -[WKProcessPool _initWithConfiguration:] to a class extension so we can make it the designated initializer.
3376
3377         * UIProcess/API/Cocoa/WKProcessPool.mm:
3378         (-[WKProcessPool _initWithConfiguration:]):
3379         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3380
3381 2015-03-24  Chris Dumez  <cdumez@apple.com>
3382
3383         [WK2] Responses with 404 HTTP Status Code should be cacheable by default
3384         https://bugs.webkit.org/show_bug.cgi?id=143014
3385         <rdar://problem/20280310>
3386
3387         Reviewed by Antti Koivisto.
3388
3389         Make responses with 404 HTTP Status Code cacheable by default, as
3390         per RFC 7231:
3391         http://tools.ietf.org/html/rfc7231#section-6.5.4
3392
3393         Test: http/tests/cache/disk-cache/disk-cache-404-status-code.html
3394
3395         * NetworkProcess/cache/NetworkCache.cpp:
3396         (WebKit::NetworkCache::canStore):
3397
3398 2015-03-24  Chris Dumez  <cdumez@apple.com>
3399
3400         [WK2] Remove NetworkCache FIXME comment about caching responses to OPTIONS requests
3401         https://bugs.webkit.org/show_bug.cgi?id=143009
3402
3403         Reviewed by Andreas Kling.
3404
3405         Remove NetworkCache FIXME comment about caching responses to OPTIONS
3406         method as RFC 7234 says "Responses to the OPTIONS method are not
3407         cacheable" [1].
3408
3409         [1] http://tools.ietf.org/html/rfc7231#page-31
3410
3411         * NetworkProcess/cache/NetworkCache.cpp:
3412         (WebKit::NetworkCache::canRetrieve):
3413
3414 2015-03-24  Chris Dumez  <cdumez@apple.com>
3415
3416         [WK2] NetworkCache retrievals fail for entries with no body
3417         https://bugs.webkit.org/show_bug.cgi?id=142979
3418         <rdar://problem/20264100>
3419
3420         Reviewed by Antti Koivisto.
3421
3422         NetworkCache retrievals were failing for entries with no body because
3423         decodeEntry() doesn't correctly handle this case. In particular, the
3424         following check fails:
3425         "metaData.bodyOffset + metaData.bodySize == fileData.size()".
3426         This is because bodyOffset is pageSize-aligned.
3427
3428         As a result, the following resource on apple.com is stored in the cache
3429         but we fail to reuse it and reload it from the network every time:
3430         http://images.apple.com/home/styles/promos.css
3431
3432         This patch updates decodeEntry() to create a null Data object for the
3433         body if bodySize is 0.
3434
3435         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
3436         (WebKit::NetworkCache::Data::data):
3437         Do not attempt to initialize m_data if m_dispatchData is null as the
3438         call to dispatch_data_create_map() would then crash. We now return
3439         null in this case. This is needed as decodeStorageEntry() in
3440         NetworkCache.cpp constructs a SharedBuffer from
3441         storageEntry.body.data() and the body may be null.
3442
3443         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3444         (WebKit::NetworkCache::decodeEntry):
3445
3446 2015-03-24  Chris Dumez  <cdumez@apple.com>
3447
3448         [WK2] The WebKit network cache does not cache responses with "Content-Disposition: attachment" header
3449         https://bugs.webkit.org/show_bug.cgi?id=142989
3450         <rdar://problem/20265992>
3451
3452         Reviewed by Antti Koivisto.
3453
3454         Update our WebKit network cache policy to cache responses with
3455         "Content-Disposition: attachment" header. There is no reason we cannot
3456         cache these and our memory cache already does.
3457
3458         This was causing a decent amount of cache misses in the wild. I have
3459         noticed for example that when loading disney.com, we fail to cache the
3460         following resources because of this policy:
3461         http://pagead2.googlesyndication.com/pagead/osd.js
3462         http://pagead2.googlesyndication.com/pagead/show_companion_ad.js
3463
3464         Those resources have Cache-Control headers that indicate they are meant
3465         to be cacheable.
3466
3467         Test: http/tests/cache/disk-cache-validation-attachment.html
3468
3469         * NetworkProcess/cache/NetworkCache.cpp:
3470         (WebKit::NetworkCache::canStore):
3471
3472 2015-03-23  Joseph Pecoraro  <pecoraro@apple.com>
3473
3474         Unreviewed, another attempt to fix 32-bit build after r181881.
3475
3476         * UIProcess/WebInspectorProxy.h:
3477
3478 2015-03-23  Joseph Pecoraro  <pecoraro@apple.com>
3479
3480         Unreviewed, attempt to fix 32-bit build after r181881.
3481
3482         * UIProcess/API/Cocoa/WKViewPrivate.h:
3483         * UIProcess/API/mac/WKView.mm:
3484
3485 2015-03-19  Timothy Hatcher  <timothy@apple.com>
3486
3487         Web Inspector: Support attaching to another view other than the WKView
3488         https://bugs.webkit.org/show_bug.cgi?id=142892
3489
3490         Reviewed by Tim Horton.
3491
3492         * UIProcess/API/C/WKInspector.cpp:
3493         (WKInspectorAttach): Drive by fix so it used the last attachment side.
3494
3495         * UIProcess/API/Cocoa/WKViewPrivate.h: