Avoid doing an extra layout in some cases while doing scale-to-fit
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-05-22  Tim Horton  <timothy_horton@apple.com>
2
3         Avoid doing an extra layout in some cases while doing scale-to-fit
4         https://bugs.webkit.org/show_bug.cgi?id=145321
5         <rdar://problem/21051165>
6
7         Reviewed by Beth Dakin.
8
9         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
10         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
11         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
12         If we make it to scaleViewToFitDocumentIfNeeded with valid layout,
13         the view width is still less than the last-known minimum document size,
14         and the document size hasn't changed, update the view scale without
15         doing an extra layout, keeping the fixed layout size at the previously
16         computed minimum document size.
17
18 2015-05-22  Beth Dakin  <bdakin@apple.com>
19
20         Yellow highlight and DD popover don't go away when scrolling an iframe
21         https://bugs.webkit.org/show_bug.cgi?id=145312
22         -and corresponding-
23         rdar://problem/19692334
24
25         Reviewed by Tim Horton.
26
27         Match what Lookup already does for their popover and dismiss our popovers on 
28         scroll.
29         * UIProcess/API/mac/WKView.mm:
30         (-[WKView scrollWheel:]):
31
32         This should not be needed anymore.
33         * UIProcess/WebPageProxy.cpp:
34         (WebKit::WebPageProxy::pageDidScroll):
35
36 2015-05-22  Tim Horton  <timothy_horton@apple.com>
37
38         Remove action menu support
39         https://bugs.webkit.org/show_bug.cgi?id=145305
40         <rdar://problem/21070771>
41
42         Reviewed by Anders Carlsson.
43
44         * Configurations/WebKit.xcconfig:
45         * Shared/API/c/WKActionMenuItemTypes.h:
46         * Shared/API/c/WKActionMenuTypes.h:
47         * UIProcess/API/Cocoa/WKViewPrivate.h:
48         * UIProcess/API/mac/WKView.mm:
49         (-[WKView _didPerformImmediateActionHitTest:contentPreventsDefault:userData:]):
50         (-[WKView dealloc]): Deleted.
51         (-[WKView mouseDown:]): Deleted.
52         (-[WKView initWithFrame:processPool:configuration:webView:]): Deleted.
53         (-[WKView prepareForMenu:withEvent:]): Deleted.
54         (-[WKView willOpenMenu:withEvent:]): Deleted.
55         (-[WKView didCloseMenu:withEvent:]): Deleted.
56         (-[WKView _didPerformActionMenuHitTest:forImmediateAction:contentPreventsDefault:userData:]): Deleted.
57         (-[WKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:]): Deleted.
58         (-[WKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:userData:]): Deleted.
59         * UIProcess/API/mac/WKViewInternal.h:
60         * UIProcess/PageClient.h:
61         * UIProcess/WebPageProxy.cpp:
62         (WebKit::WebPageProxy::performImmediateActionHitTestAtLocation):
63         (WebKit::WebPageProxy::didPerformImmediateActionHitTest):
64         (WebKit::WebPageProxy::performActionMenuHitTestAtLocation): Deleted.
65         (WebKit::WebPageProxy::selectLastActionMenuRange): Deleted.
66         (WebKit::WebPageProxy::focusAndSelectLastActionMenuHitTestResult): Deleted.
67         (WebKit::WebPageProxy::didPerformActionMenuHitTest): Deleted.
68         * UIProcess/WebPageProxy.h:
69         * UIProcess/WebPageProxy.messages.in:
70         * UIProcess/mac/PageClientImpl.h:
71         * UIProcess/mac/PageClientImpl.mm:
72         (WebKit::PageClientImpl::didPerformImmediateActionHitTest):
73         (WebKit::PageClientImpl::didPerformActionMenuHitTest): Deleted.
74         * UIProcess/mac/WKActionMenuController.h: Removed.
75         * UIProcess/mac/WKActionMenuController.mm: Removed.
76         * UIProcess/mac/WKImmediateActionController.h:
77         * UIProcess/mac/WKImmediateActionController.mm:
78         (-[WKImmediateActionController didPerformImmediateActionHitTest:contentPreventsDefault:userData:]):
79         (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
80         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
81         (-[WKImmediateActionController didPerformActionMenuHitTest:contentPreventsDefault:userData:]): Deleted.
82         * WebKit2.xcodeproj/project.pbxproj:
83         * WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h:
84         (API::InjectedBundle::PageContextMenuClient::prepareForImmediateAction):
85         (API::InjectedBundle::PageContextMenuClient::prepareForActionMenu): Deleted.
86         * WebProcess/InjectedBundle/API/c/WKBundlePageContextMenuClient.h:
87         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
88         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
89         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
90         (WebKit::InjectedBundlePageContextMenuClient::prepareForImmediateAction):
91         (WebKit::InjectedBundlePageContextMenuClient::prepareForActionMenu): Deleted.
92         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h:
93         * WebProcess/WebPage/WebPage.h:
94         * WebProcess/WebPage/WebPage.messages.in:
95         * WebProcess/WebPage/WebPageOverlay.cpp:
96         (WebKit::WebPageOverlay::actionContextForResultAtPoint):
97         * WebProcess/WebPage/WebPageOverlay.h:
98         (WebKit::WebPageOverlay::Client::actionContextForResultAtPoint):
99         * WebProcess/WebPage/mac/WebPageMac.mm:
100         (WebKit::textIndicatorTransitionForImmediateAction):
101         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
102         (WebKit::textIndicatorTransitionForActionMenu): Deleted.
103         (WebKit::WebPage::performActionMenuHitTestAtLocation): Deleted.
104         (WebKit::WebPage::selectLastActionMenuRange): Deleted.
105         (WebKit::WebPage::focusAndSelectLastActionMenuHitTestResult): Deleted.
106         Remove everything, except some enums that clients still refer to.
107         Also, leave SPI that used to be shared between immediate actions and
108         action menus intact, even if it had "action menu" in the name. We can
109         deprecate and rename in another patch... except for the very recently-added
110         support from r184106, which we'll revert entirely, removing WKBundlePageOverlayV2, 
111         which was not adopted by any clients.
112
113 2015-05-22  Brady Eidson  <beidson@apple.com>
114
115         Rework how the ResourceRequest user initiated property key is used.
116         Followup to https://bugs.webkit.org/show_bug.cgi?id=145281
117
118         Reviewed by Dan Bernstein.
119
120         * Shared/API/Cocoa/_WKNSURLRequestExtras.mm:
121         (-[NSURLRequest _web_isUserInitiated]):
122         (-[NSMutableURLRequest _web_setIsUserInitiated:]):
123
124         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
125         (WKResourceRequestIsUserInitiatedKey): Deleted.
126         (InitWebCoreSystemInterface): Deleted.
127
128 2015-05-21  Gavin Barraclough  <barraclough@apple.com>
129
130         Networking process sometimes suspended while WebContent runnable
131         https://bugs.webkit.org/show_bug.cgi?id=145291
132         <rdar://problem/21033029>
133
134         Reviewed by Andreas Kling.
135
136         There is an asymmetry in how the Networking process suspension is managed.
137         We drop the assertion (& suspend the process) whenever the WebProcess says
138         it is ready to suspend, but we only take the assertion (& resume execution)
139         when the WebContent process is actually resumed. This leaves a race – where
140         the WebContent process was willing to be suspended, but the UI app changed
141         its mind suspending it. Since the WebContent process never actually suspended
142         (we only prepared it to), we never send a resume, and since we never resume,
143         we never wake the Networking process.
144
145         The fix is pretty clean. A web process should take a token on the networking
146         process precisely whenever it holds an assertion on the web content process.
147         This also enables a nice refinement, that when holding a BG assertion on the
148         WebContent process we only need to hold a BG assertion on the networking
149         process.
150
151         * UIProcess/Network/NetworkProcessProxy.cpp:
152         (WebKit::NetworkProcessProxy::didSetAssertionState):
153             - no-op
154         * UIProcess/Network/NetworkProcessProxy.h:
155             - added didSetAssertionState.
156         * UIProcess/ProcessThrottler.cpp:
157         (WebKit::ProcessThrottler::updateAssertionNow):
158         (WebKit::ProcessThrottler::updateAssertion):
159         (WebKit::ProcessThrottler::didConnectToProcess):
160             - whenever taking/updating the assertion, inform the client via didSetAssertionState.
161         * UIProcess/ProcessThrottlerClient.h:
162             - added didSetAssertionState.
163         * UIProcess/WebProcessProxy.cpp:
164         (WebKit::WebProcessProxy::didFinishLaunching):
165             removed initializeNetworkProcessActivityToken - this is taken via ProcessThrottler::didConnectToProcess.
166         (WebKit::WebProcessProxy::sendProcessDidResume):
167             - removed call to initializeNetworkProcessActivityToken - updated via didSetAssertionState.
168         (WebKit::WebProcessProxy::processReadyToSuspend):
169             - removed update of m_tokenForNetworkProcess - updated via didSetAssertionState.
170         (WebKit::WebProcessProxy::didSetAssertionState):
171             - update m_backgroundTokenForNetworkProcess/m_foregroundTokenForNetworkProcess.
172         (WebKit::WebProcessProxy::initializeNetworkProcessActivityToken): Deleted.
173             - updated via didSetAssertionState.
174         * UIProcess/WebProcessProxy.h:
175             - added didSetAssertionState, added separate FG/BG activity tokens for Networking process.
176
177 2015-05-22  Dan Bernstein  <mitz@apple.com>
178
179         Fixed the fix for <rdar://problem/20830673> Symlink the WebKit dylib instead of just the framework directory
180         https://bugs.webkit.org/show_bug.cgi?id=145287
181
182         Reviewed by Anders Carlsson.
183
184         * WebKit2.xcodeproj/project.pbxproj: Give the symlink the correct destination.
185
186 2015-05-21  Brady Eidson  <beidson@apple.com>
187
188         Add an "initiated by user gesture" flag to ResourceRequest.
189         https://bugs.webkit.org/show_bug.cgi?id=145281
190
191         Reviewed by Alex Christensen.
192
193         Expose a new category on NSURLRequest to allow SPI clients to easily set/get the flag:
194         * Shared/API/Cocoa/_WKNSURLRequestExtras.h: Added.
195         * Shared/API/Cocoa/_WKNSURLRequestExtras.mm: Added.
196         (-[NSURLRequest _web_isUserInitiated]):
197         (-[NSMutableURLRequest _web_setIsUserInitiated:]):
198
199         * WebKit2.xcodeproj/project.pbxproj:
200
201         Expose the new property key to WebCore:
202         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
203         (WKResourceRequestIsUserInitiatedKey):
204         (InitWebCoreSystemInterface):
205
206 2015-05-21  Daniel Bates  <dabates@apple.com>
207
208         Rollout <http://trac.webkit.org/changeset/183909>
209         (https://bugs.webkit.org/show_bug.cgi?id=144657)
210
211         Revert <http://trac.webkit.org/changeset/183909> since pausing the database
212         thread prevents in-progress transactions from completing. We need to think
213         about this change some more.
214
215         * UIProcess/WebPageProxy.h:
216         * UIProcess/ios/WKContentView.mm:
217         (-[WKContentView _applicationDidEnterBackground:]): Deleted.
218         * UIProcess/ios/WebPageProxyIOS.mm:
219         (WebKit::WebPageProxy::applicationDidEnterBackground): Deleted.
220         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
221         (WebKit::WebDatabaseManager::setPauseAllDatabases): Deleted.
222         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
223         * WebProcess/WebPage/WebPage.h:
224         * WebProcess/WebPage/WebPage.messages.in:
225         * WebProcess/WebPage/ios/WebPageIOS.mm:
226         (WebKit::WebPage::applicationWillEnterForeground): Deleted.
227         (WebKit::WebPage::applicationDidEnterBackground): Deleted.
228
229 2015-05-21  Enrica Casucci  <enrica@apple.com>
230
231         [iOS] Crash when taking a snapshot of a large PDF.
232         https://bugs.webkit.org/show_bug.cgi?id=145286
233         rdar://problem/20892362
234
235         Reviewed by Tim Horton.
236
237         The code for the PDF case was incorrectly computing the snapshot rect.
238         On top of that drawViewHierarchyInRect was ignoring the rect and
239         always creating an image using the view bounds causing the crash.
240         We are now always using the IOSurface if we are parented or
241         an image context when we are not.
242
243         * UIProcess/API/Cocoa/WKWebView.mm:
244         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
245
246 2015-05-21  Anders Carlsson  <andersca@apple.com>
247
248         Symlink the WebKit dylib instead of just the framework directory
249         https://bugs.webkit.org/show_bug.cgi?id=145287
250         rdar://problem/20830673
251
252         Reviewed by Dan Bernstein.
253
254         * WebKit2.xcodeproj/project.pbxproj:
255
256 2015-05-21  Anders Carlsson  <andersca@apple.com>
257
258         WKWebsiteDataStore doesn't track and remove iOS Safari's offline application cache entries
259         https://bugs.webkit.org/show_bug.cgi?id=145279
260         rdar://problem/20657912
261
262         Reviewed by Dan Bernstein.
263
264         Special-case iOS Safari and WebApp when computing the default application cache directory.
265
266         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
267         (API::applicationCacheDirectory):
268         (API::WebsiteDataStore::defaultDataStoreConfiguration):
269
270 2015-05-21  Brian Weinstein  <bweinstein@apple.com>
271
272         Add a _WKWebKitContentExtensionStore initializer that takes a path.
273         https://bugs.webkit.org/show_bug.cgi?id=145269 and work towards <rdar://problem/21031414>
274
275         Reviewed by Anders Carlsson.
276
277         * UIProcess/API/APIUserContentExtensionStore.cpp:
278         (API::UserContentExtensionStore::storeWithPath):
279         * UIProcess/API/APIUserContentExtensionStore.h:
280         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
281         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
282         (+[_WKUserContentExtensionStore storeWithURL:]):
283
284 2015-05-21  Alexey Proskuryakov  <ap@apple.com>
285
286         Build fix. Silence some deprecation warnings.
287
288         * UIProcess/ios/forms/WKFileUploadPanel.mm:
289         (-[WKFileUploadPanel _presentPopoverWithContentViewController:animated:]):
290         * UIProcess/ios/forms/WKFormInputControl.mm:
291         (-[WKDateTimePopover initWithView:datePickerMode:]):
292         * UIProcess/ios/forms/WKFormPopover.h:
293         * UIProcess/ios/forms/WKFormPopover.mm:
294         * UIProcess/ios/forms/WKFormSelectPopover.mm:
295         (-[WKSelectPopover initWithView:hasGroups:]):
296
297 2015-05-21  Csaba Osztrogonác  <ossy@webkit.org>
298
299         [EFL] Remove an unused private field from EwkPopupMenuItem class
300         https://bugs.webkit.org/show_bug.cgi?id=145249
301
302         Reviewed by Gyuyoung Kim.
303
304         * UIProcess/API/efl/ewk_popup_menu.cpp:
305         (EwkPopupMenu::EwkPopupMenu):
306         * UIProcess/API/efl/ewk_popup_menu_private.h:
307
308 2015-05-21  Csaba Osztrogonác  <ossy@webkit.org>
309
310         [EFL] Fix mismatched-tags warnings in UIProcess/API/efl
311         https://bugs.webkit.org/show_bug.cgi?id=145129
312
313         Reviewed by Gyuyoung Kim.
314
315         * UIProcess/API/efl/EwkViewCallbacks.h:
316         * UIProcess/API/efl/ewk_application_cache_manager.h:
317         * UIProcess/API/efl/ewk_auth_request.h:
318         * UIProcess/API/efl/ewk_back_forward_list.h:
319         * UIProcess/API/efl/ewk_back_forward_list_item.h:
320         * UIProcess/API/efl/ewk_color_picker.h:
321         * UIProcess/API/efl/ewk_context.h:
322         * UIProcess/API/efl/ewk_context_menu_item.h:
323         * UIProcess/API/efl/ewk_cookie_manager.h:
324         * UIProcess/API/efl/ewk_database_manager.h:
325         * UIProcess/API/efl/ewk_download_job.h:
326         * UIProcess/API/efl/ewk_error.h:
327         * UIProcess/API/efl/ewk_favicon_database.h:
328         * UIProcess/API/efl/ewk_file_chooser_request.h:
329         * UIProcess/API/efl/ewk_form_submission_request.h:
330         * UIProcess/API/efl/ewk_navigation_data.h:
331         * UIProcess/API/efl/ewk_navigation_policy_decision.h:
332         * UIProcess/API/efl/ewk_object.h:
333         * UIProcess/API/efl/ewk_page_group.h:
334         * UIProcess/API/efl/ewk_popup_menu.h:
335         * UIProcess/API/efl/ewk_popup_menu_item.h:
336         * UIProcess/API/efl/ewk_security_origin.h:
337         * UIProcess/API/efl/ewk_settings.h:
338         * UIProcess/API/efl/ewk_storage_manager.h:
339         * UIProcess/API/efl/ewk_url_request.h:
340         * UIProcess/API/efl/ewk_url_response.h:
341         * UIProcess/API/efl/ewk_url_scheme_request.h:
342         * UIProcess/API/efl/ewk_view.h:
343         * UIProcess/API/efl/ewk_window_features.h:
344         * WebProcess/InjectedBundle/API/efl/ewk_extension.h:
345         * WebProcess/InjectedBundle/API/efl/ewk_page.h:
346
347 2015-05-21  Csaba Osztrogonác  <ossy@webkit.org>
348
349         Fix mismatched-tags warnings related to CoordinatedGraphics
350         https://bugs.webkit.org/show_bug.cgi?id=145130
351
352         Reviewed by Darin Adler.
353
354         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
355         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in:
356         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
357
358 2015-05-20  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
359
360         Unreviewed GTK build fix since r184686.
361
362         * UIProcess/gtk/WebProcessPoolGtk.cpp:
363         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Add *legacy* prefix.
364         (WebKit::WebProcessPool::platformDefaultApplicationCacheDirectory): Deleted.
365
366 2015-05-20  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
367
368         Unreviewed EFL build fix since r184686.
369
370         * UIProcess/efl/WebProcessPoolEfl.cpp:
371         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Add *legacy* prefix.
372         (WebKit::WebProcessPool::platformDefaultApplicationCacheDirectory): Deleted.
373
374 2015-05-20  Chris Dumez  <cdumez@apple.com>
375
376         [WK2][iOS] Update WebContent process sandbox profile for AWD logging
377         https://bugs.webkit.org/show_bug.cgi?id=145229
378         <rdar://problem/20543269>
379
380         Reviewed by Alexey Proskuryakov.
381
382         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
383
384 2015-05-20  Gavin Barraclough  <barraclough@apple.com>
385
386         dispatchViewStateChange should not wait for sync reply if the page isn't visible
387         https://bugs.webkit.org/show_bug.cgi?id=145242
388         <rdar://problem/20967937>
389
390         Reviewed by Ben Poulain.
391
392         This is particularly problematic on iOS, since if the page isn't visible the process is likely suspended.
393
394
395         * UIProcess/WebPageProxy.cpp:
396         (WebKit::WebPageProxy::dispatchViewStateChange):
397         (WebKit::WebPageProxy::waitForDidUpdateViewState):
398
399 2015-05-20  Marcos Chavarría Teijeiro  <mchavarria@igalia.com>
400
401         Enable disk cache for range requests
402         https://bugs.webkit.org/show_bug.cgi?id=144682
403
404         Reviewed by Antti Koivisto.
405
406         Add Range header value to the network cache key constructor so we take
407         into account this value. The 206 response code is also marked to be cached.
408
409         * NetworkProcess/cache/NetworkCache.cpp:
410         (WebKit::NetworkCache::makeCacheKey):
411         (WebKit::NetworkCache::isStatusCodeCacheableByDefault):
412         * NetworkProcess/cache/NetworkCacheKey.cpp:
413         (WebKit::NetworkCache::Key::Key):
414         (WebKit::NetworkCache::Key::operator=):
415         (WebKit::NetworkCache::Key::computeHash):
416         (WebKit::NetworkCache::Key::operator==):
417         (WebKit::NetworkCache::Key::encode):
418         (WebKit::NetworkCache::Key::decode):
419         (WebKit::NetworkCache::Key::stringToHash): Deleted.
420         * NetworkProcess/cache/NetworkCacheKey.h:
421
422 2015-05-20  Anders Carlsson  <andersca@apple.com>
423
424         WKWebsiteDataStore API doesn't report webkit.org as using Databases or App Cache after visiting http://www.webkit.org/demos/sticky-notes/
425         https://bugs.webkit.org/show_bug.cgi?id=145238
426         rdar://problem/20581175
427
428         Reviewed by Tim Horton.
429
430         Make sure to set the application cache and WebSQL directories when using the legacy data store.
431
432         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
433         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
434         (WebKit::WebProcessPool::platformDefaultApplicationCacheDirectory):
435         Rename this and move it to the right place.
436
437         * UIProcess/WebProcessPool.cpp:
438         (WebKit::legacyWebsiteDataStoreConfiguration):
439         Rename this and add the application cache and WebSQL directories.
440
441         (WebKit::WebProcessPool::WebProcessPool):
442         Call legacyWebsiteDataStoreConfiguration.
443
444         (WebKit::WebProcessPool::applicationCacheDirectory):
445         Call legacyPlatformDefaultApplicationCacheDirectory.
446
447         * UIProcess/WebProcessPool.h:
448
449 2015-05-20  Enrica Casucci  <enrica@apple.com>
450
451         [iOS] Using CSS viewport units causes incorrect layout.
452         https://bugs.webkit.org/show_bug.cgi?id=145225
453         rdar://problem/20924495
454
455         Reviewed by Benjamin Poulain.
456
457         * WebProcess/WebPage/ios/WebPageIOS.mm:
458         (WebKit::WebPage::updateViewportSizeForCSSViewportUnits):
459
460 2015-05-20  Tim Horton  <timothy_horton@apple.com>
461
462         Allow overriding the waitForDidUpdateViewState timeout
463         https://bugs.webkit.org/show_bug.cgi?id=145230
464         <rdar://problem/20990162>
465
466         Reviewed by Darin Adler.
467
468         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
469         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState):
470         Use the value from NSUserDefaults, if it exists.
471         We'll only check once, so changing the default requires a restart of the UI process.
472
473 2015-05-20  Anders Carlsson  <andersca@apple.com>
474
475         Make sure we always have a process pool to perform data store operations with
476         https://bugs.webkit.org/show_bug.cgi?id=145231
477         rdar://problem/20618248
478
479         Reviewed by Tim Horton.
480
481         Make sure that we always return a process pool. If we're a legacy C SPI per-context data store,
482         find the process pool we're a part of and use that. Otherwise, create a new one.
483     
484         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
485         (WebKit::WebsiteDataStore::processPools):
486
487 2015-05-19  Jer Noble  <jer.noble@apple.com>
488
489         Touching HTMLMediaElement.h or MediaPlayer.h causes a world rebuild.
490         https://bugs.webkit.org/show_bug.cgi?id=145193
491
492         Reviewed by Eric Carlson.
493
494         Use HTMLMediaElementEnums instead of HTMLMediaElement.
495
496         * UIProcess/API/Cocoa/WKWebView.mm:
497         (-[WKWebView _isShowingVideoOptimized]): HTMLMediaElement -> HTMLMediaElementEnums.
498         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
499         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
500         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
501         (WebKit::WebVideoFullscreenManagerProxy::hasMode): Ditto.
502         (WebKit::WebVideoFullscreenModelContext::fullscreenModeChanged): Ditto.
503         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Ditto.
504         (WebKit::WebVideoFullscreenManagerProxy::fullscreenModeChanged): Ditto.
505         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
506         (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement): Ditto.
507         * WebProcess/WebCoreSupport/WebChromeClient.h:
508         * WebProcess/ios/WebVideoFullscreenManager.h:
509         (WebKit::WebVideoFullscreenInterfaceContext::fullscreenMode): Ditto.
510         (WebKit::WebVideoFullscreenInterfaceContext::setFullscreenMode): Ditto.
511         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
512         * WebProcess/ios/WebVideoFullscreenManager.mm:
513         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): Ditto.
514         (WebKit::WebVideoFullscreenManager::fullscreenModeChanged): Ditto.
515         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): Ditto.
516
517 2015-05-20  Anders Carlsson  <andersca@apple.com>
518
519         Refactor process pool enumeration code in WebsiteDataStore
520         https://bugs.webkit.org/show_bug.cgi?id=145218
521
522         Reviewed by Tim Horton.
523
524         Also make sure to keep the WebProcessPool objects alive for the duration of the various data store
525         operations. This is the first step towards having the data store create a single process pool lazily if
526         there are no web views associated with the data store.
527
528         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
529         (WebKit::WebsiteDataStore::fetchData):
530         (WebKit::WebsiteDataStore::removeData):
531         (WebKit::WebsiteDataStore::processPools):
532         * UIProcess/WebsiteData/WebsiteDataStore.h:
533
534 2015-05-20  Alex Christensen  <achristensen@webkit.org>
535
536         [Content Extensions] Relax restrictions on triggers that match everything.
537         https://bugs.webkit.org/show_bug.cgi?id=145069
538
539         Reviewed by Benjamin Poulain.
540
541         * UIProcess/API/APIUserContentExtensionStore.h:
542         Increment version number to reflect changes in DFABytecode.
543
544 2015-05-20  Sungmann Cho  <sungmann.cho@navercorp.com>
545
546         Minor cleanups to PluginProcessProxy.
547         https://bugs.webkit.org/show_bug.cgi?id=145199
548
549         Reviewed by Anders Carlsson.
550
551         1. Remove unnecessary forward declaration.
552         2. Remove unnecessary #include.
553
554         * UIProcess/Plugins/PluginProcessProxy.cpp:
555         * UIProcess/Plugins/PluginProcessProxy.h:
556
557 2015-05-20  Marcos Chavarría Teijeiro  <mchavarria@igalia.com>
558
559         [GTK] Add some documentation to WebKitWebExtension
560         https://bugs.webkit.org/show_bug.cgi?id=142786
561
562         Reviewed by Carlos Garcia Campos.
563
564         WebKitWebExtension API documentation lacks of some details and the information
565         available is in some contributors blog posts. I add the section
566         documentation with a small guide about how to use WebExtensions.
567
568         The code examples were taken from Carlos García and Adrián Pérez blog
569         posts.
570
571         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
572
573 2015-05-20  Sungmann Cho  <sungmann.cho@navercorp.com>
574
575         Rename WebsiteDataStore::isNonPersistent() to WebsiteDataStore::isPersistent().
576         https://bugs.webkit.org/show_bug.cgi?id=145111
577
578         Reviewed by Darin Adler.
579
580         This is a follow up to https://bugs.webkit.org/show_bug.cgi?id=144158.
581
582         * UIProcess/API/APIWebsiteDataStore.cpp:
583         (API::WebsiteDataStore::isPersistent):
584         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
585         (WebKit::WebsiteDataStore::fetchData):
586         (WebKit::WebsiteDataStore::removeData):
587         * UIProcess/WebsiteData/WebsiteDataStore.h:
588         (WebKit::WebsiteDataStore::isPersistent):
589         (WebKit::WebsiteDataStore::isNonPersistent): Deleted.
590
591 2015-05-20  Hyungwook Lee  <hyungwook.lee@navercorp.com>
592
593         [EFL] Fix build failure, linker does not find libXext.
594         https://bugs.webkit.org/show_bug.cgi?id=144100
595
596         Reviewed by Gyuyoung Kim.
597
598         Move Xext library from WebProcess_LIBRARIES to WebKit2_LIBRARIES.
599
600         * PlatformEfl.cmake:
601
602 2015-05-19  Carlos Garcia Campos  <cgarcia@igalia.com>
603
604         [SOUP] Network Cache: Implement ShareableResource for Soup and enable it for GTK platform
605         https://bugs.webkit.org/show_bug.cgi?id=144380
606
607         Reviewed by Antti Koivisto.
608
609         It improves the network cache performance, by mmaping big
610         resources and sending only the file descriptor to the web process
611         instead of the actual file data. It needs some changes in
612         cross-platform code, because we can't use the same approach as
613         mac (it uses a platform specific implementation not available in
614         other platforms).
615
616         * NetworkProcess/cache/NetworkCache.cpp:
617         (WebKit::NetworkCache::Cache::store): Use
618         Data::tryCreateSharedMemory() to create the shared memory used by
619         the ShareableResource. Also add an ASSERT instead of checking the
620         shareable resource created is not nullptr, because the
621         ShareableResource::create() that receives a shared memory should
622         never return nullptr.
623         * NetworkProcess/cache/NetworkCacheData.h:
624         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
625         (WebKit::NetworkCache::Data::tryCreateSharedMemory):
626         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
627         (WebKit::NetworkCache::Data::tryCreateSharedMemory): Create a
628         SharedMemory object to wrap the mapped file, but keeping the ownership.
629         * NetworkProcess/cache/NetworkCacheEntry.cpp:
630         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord):
631         Use Data::tryCreateSharedMemory() to create the shared memory used
632         bythe ShareableResource. Also add an ASSERT instead of checking
633         the shareable resource created is not nullptr, because the
634         ShareableResource::create() that receives a shared memory should
635         never return nullptr.
636         * Platform/SharedMemory.h:
637         * Platform/unix/SharedMemoryUnix.cpp:
638         (WebKit::SharedMemory::map): Use wrapMap() and initialize
639         m_isWrappingMap to false.
640         (WebKit::SharedMemory::wrapMap): Create a SharedMemory object for
641         the given map, without taking its ownership.
642         (WebKit::SharedMemory::~SharedMemory): Do not unmap and close the
643         file descriptor if m_isWrappingMap is true.
644         * Shared/ShareableResource.cpp:
645         (WebKit::createShareableResourceDeallocator):
646         (WebKit::ShareableResource::wrapInSharedBuffer): Create a SharedBuffer
647         wrapping the ShareableResource data.
648         (WebKit::ShareableResource::Handle::tryWrapInSharedBuffer): Create
649         a ShareableResource for the handle and create a SharedBuffer
650         wrapping it.
651         * Shared/ShareableResource.h:
652         * WebKit2Prefix.h: Enable ENABLE_SHAREABLE_RESOURCE for GTK.
653         * WebProcess/Network/WebResourceLoader.cpp:
654         (WebKit::WebResourceLoader::didReceiveResource): Get the CFData
655         from the SharedBuffer for QuickLook instead of wrapping the handle again.
656
657 2015-05-19  Carlos Garcia Campos  <cgarcia@igalia.com>
658
659         [SOUP] Network Cache: Disable network cache efficacy logging
660         https://bugs.webkit.org/show_bug.cgi?id=145172
661
662         Reviewed by Martin Robinson.
663
664         Disable network cache efficacy logging by default, since we are
665         not currently using the collected data.
666
667         * UIProcess/soup/WebProcessPoolSoup.cpp:
668         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
669
670 2015-05-19  Michael Saboff  <msaboff@apple.com>
671
672         REGRESSION(183787): JIT is enabled for all builds
673         https://bugs.webkit.org/show_bug.cgi?id=145179
674
675         Reviewed by Geoffrey Garen.
676
677         Eliminated the setting of ENABLE_JIT, as wtf/Platform.h has appropriate logic to
678         set it depending on OS and CPU type.
679
680         * Configurations/FeatureDefines.xcconfig:
681
682 2015-05-19  Brady Eidson  <beidson@apple.com>
683
684         X-Frame-Options headers not respected when loading from application cache.
685         <rdar://problem/14877623> and https://bugs.webkit.org/show_bug.cgi?id=131800
686
687         Reviewed by Alexey Proskuryakov.
688
689         * WebProcess/WebPage/WebPage.cpp:
690         (WebKit::WebPage::loadDataImpl):
691
692 2015-05-19  Sungmann Cho  <sungmann.cho@navercorp.com>
693
694         Add PLUGIN_ARCHITECTURE(MAC) around WKNVCALayerRenderServerPort in NetscapeBrowserFunc.h.
695         https://bugs.webkit.org/show_bug.cgi?id=145173
696
697         Reviewed by Anders Carlsson.
698
699         WKNVCALayerRenderServerPort in NetscapeBrowserFunc.h is meaningful only for Mac.
700         So we need to add PLUGIN_ARCHITECTURE(MAC) around it.
701
702         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.h:
703
704 2015-05-19  Brent Fulgham  <bfulgham@apple.com>
705
706         REGRESSION(142590): Part 2: Scroll-snap points are improperly snapping to earlier index values (Scrolling Thread) 
707         https://bugs.webkit.org/show_bug.cgi?id=145175
708         <rdar://problem/21023785>
709
710         Reviewed by Beth Dakin.
711
712         Add a stub implementation of isScrollSnapInProgress to match ScrollingCoordinator signature.
713
714         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
715         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
716         (WebKit::RemoteScrollingCoordinator::isScrollSnapInProgress): Added stub.
717
718 2015-05-19  Jeremy Jones  <jeremyj@apple.com>
719
720         WebVideoFullscreenManagerProxy has incorrect OS_VERSION_MIN_REQUIRED conditionals.
721         https://bugs.webkit.org/show_bug.cgi?id=145158
722
723         Reviewed by Eric Carlson.
724
725         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
726         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
727
728 2015-05-19  Ting-Wei Lan  <lantw44@gmail.com>
729
730         [SOUP] Use st_birthtime to get creation time of files on systems support it
731         https://bugs.webkit.org/show_bug.cgi?id=144989
732
733         Reviewed by Carlos Garcia Campos.
734
735         FreeBSD and NetBSD have either st_birthtime field or compatiblity macro
736         with the same name in stat. It is better to use it instead of manually
737         setting xattr, which is unreliable because both operating systems and
738         file systems support are required.
739
740         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
741         (WebKit::NetworkCache::fileTimes):
742         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
743         (WebKit::NetworkCache::IOChannel::IOChannel):
744
745 2015-05-19  Chris Dumez  <cdumez@apple.com>
746
747         Mark static variables as const when possible
748         https://bugs.webkit.org/show_bug.cgi?id=145161
749
750         Reviewed by Andreas Kling.
751
752         * Platform/IPC/MessageEncoder.cpp:
753         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
754         (WebKit::networkProcessLatencyQOS):
755         (WebKit::networkProcessThroughputQOS):
756         (WebKit::webProcessLatencyQOS):
757         (WebKit::webProcessThroughputQOS):
758         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
759         (WebKit::PluginProcessProxy::pluginNeedsExecutableHeap):
760         (WebKit::pluginProcessLatencyQOS):
761         (WebKit::pluginProcessThroughputQOS):
762         * WebProcess/WebPage/WebPage.cpp:
763
764 2015-05-18  Michael Catanzaro  <mcatanzaro@igalia.com>
765
766         [CMake] Ignore warnings in system headers
767         https://bugs.webkit.org/show_bug.cgi?id=144747
768
769         Reviewed by Darin Adler.
770
771         Separate include directories into WebKit project includes and system includes. Suppress all
772         warnings from headers in system include directories using the SYSTEM argument to
773         the include_directories command.
774
775         * CMakeLists.txt:
776         * PlatformEfl.cmake:
777         * PlatformGTK.cmake:
778
779 2015-05-18  Csaba Osztrogonác  <ossy@webkit.org>
780
781         Fix return-type warnings in test_ewk2_color_picker.cpp
782         https://bugs.webkit.org/show_bug.cgi?id=145122
783
784         Reviewed by Gyuyoung Kim.
785
786         * UIProcess/API/efl/tests/test_ewk2_color_picker.cpp:
787         (EWK2ColorPickerTest::hideColorPicker):
788         (EWK2ColorPickerTest::hideColorPickerByRemovingElement):
789
790 2015-05-18  Skachkov Alexandr  <gskachkov@gmail.com>
791
792         [ES6] Arrow function syntax. Feature flag for arrow function
793         https://bugs.webkit.org/show_bug.cgi?id=145108
794
795         Reviewed by Ryosuke Niwa.
796
797         Added feature flag ENABLE_ES6_ARROWFUNCTION_SYNTAX for arrow function
798
799         * Configurations/FeatureDefines.xcconfig:
800
801 2015-05-18  Anders Carlsson  <andersca@apple.com>
802
803         WKWebsiteDataStore should fully support session storage
804         https://bugs.webkit.org/show_bug.cgi?id=145145
805         rdar://problem/10690447
806
807         Reviewed by Sam Weinig.
808
809         Add a session store data type and handle it when clearing and fetching data.
810
811         * Shared/WebsiteData/WebsiteDataTypes.h:
812         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
813         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
814         (dataTypesToString):
815         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
816         (WebKit::toWebsiteDataTypes):
817         (WebKit::toWKWebsiteDataTypes):
818         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
819         (+[WKWebsiteDataStore allWebsiteDataTypes]):
820         * UIProcess/Storage/StorageManager.cpp:
821         (WebKit::StorageManager::SessionStorageNamespace::origins):
822         (WebKit::StorageManager::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
823         (WebKit::StorageManager::SessionStorageNamespace::clearAllStorageAreas):
824         (WebKit::StorageManager::getSessionStorageOrigins):
825         (WebKit::StorageManager::deleteSessionStorageOrigins):
826         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
827         * UIProcess/Storage/StorageManager.h:
828         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
829         (WebKit::WebsiteDataStore::fetchData):
830         (WebKit::WebsiteDataStore::removeData):
831
832 2015-05-18  Brady Eidson  <beidson@apple.com>
833
834         Followup to: Networking process on iOS can be suspended and never exit
835         https://bugs.webkit.org/show_bug.cgi?id=144971.
836
837         Unreviewed. Fixing API tests that revealed the unintentional change in behavior.
838
839         * Shared/ChildProcessProxy.cpp:
840         (WebKit::ChildProcessProxy::shutDownProcess): The on WebProcessProxy code path that this
841           was adopted from had an m_connection null check, and that null check needs to remain.
842
843 2015-05-18  Csaba Osztrogonác  <ossy@webkit.org>
844
845         [GTK] URTBF after r184503.
846
847         * PlatformGTK.cmake:
848
849 2015-05-18  Brady Eidson  <beidson@apple.com>
850
851         Networking process on iOS can be suspended and never exit.
852         <rdar://problem/20368630> and https://bugs.webkit.org/show_bug.cgi?id=144971
853
854         Reviewed by Darin Adler.
855
856         There's a few issues here.
857         
858         1 - When the NetworkProcessProxy goes away, it takes its process assertion with it. This causes
859             the Network process to suspend indefinitely, unable to ever respond to IPC::Connection callbacks.
860             We already solved this with WebProcess with a watchdog timer keeping both the process assertion
861             and xpc_connection alive while the process shuts down. This patch expands that to the network
862             process, and it will be easy to expand that to database and plugin processes doing forward.
863         
864         2 - All of our child processes either decide to self-terminate or listen for their connection to
865             close at which point they terminate. This leads to various races. We should
866             move to a model where the UI process explicitly tells them to shutdown, and this patch starts us 
867             down that path.
868         
869         * CMakeLists.txt:
870         * DerivedSources.make:
871         * WebKit2.xcodeproj/project.pbxproj:
872         
873         * NetworkProcess/NetworkProcess.cpp:
874         (WebKit::NetworkProcess::didReceiveMessage): Send ChildProcess messages to ChildProcess.
875         
876         * Shared/ChildProcess.cpp:
877         (WebKit::ChildProcess::shutDown): For now, just terminate the process. In the future have the
878           process do cleanup work before it is terminated.
879         * Shared/ChildProcess.h:
880         * Shared/ChildProcess.messages.in: Added.
881         
882         * Shared/ChildProcessProxy.cpp:
883         (WebKit::ChildProcessProxy::shutDownProcess): Set a watchdog and - if possible - explicitly message 
884           the process to ShutDown.
885         (WebKit::ChildProcessProxy::abortProcessLaunchIfNeeded): Deleted.
886         * Shared/ChildProcessProxy.h:
887         
888         * UIProcess/WebProcessPool.cpp:
889         (WebKit::WebProcessPool::~WebProcessPool): Explicitly tell the network process to shut down.
890         
891         * UIProcess/WebProcessProxy.cpp:
892         (WebKit::WebProcessProxy::removeWebPage): Move abortProcessLaunchIfNeeded() and the watchdog timer
893           code to ChildProcessProxy::shutDownProcess.
894         
895         * WebProcess/WebProcess.cpp:
896         (WebKit::WebProcess::didReceiveMessage): Send ChildProcess messages to ChildProcess::didReceiveMessage.
897
898 2015-05-17  Carlos Garcia Campos  <cgarcia@igalia.com>
899
900         Network Cache: Make Data::adoptMap take the ownership of the file descriptor
901         https://bugs.webkit.org/show_bug.cgi?id=144950
902
903         Reviewed by Antti Koivisto.
904
905         It will be required to implement ShareableResource for soup
906         network backend. Also move the common code of Data to a common
907         file and add mapToFile(). The mapFile version that receives a file
908         descriptor has been renamed to adoptAndMapFile().
909
910         * CMakeLists.txt: Add new file to compilation.
911         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
912         (WebKit::NetworkCache::BlobStorage::add): Use mapToFile().
913         * NetworkProcess/cache/NetworkCacheData.cpp: Added.
914         (WebKit::NetworkCache::Data::mapToFile): Write the data to the
915         given file and map it.
916         (WebKit::NetworkCache::mapFile):
917         (WebKit::NetworkCache::adoptAndMapFile):
918         (WebKit::NetworkCache::computeSHA1):
919         (WebKit::NetworkCache::bytesEqual):
920         * NetworkProcess/cache/NetworkCacheData.h:
921         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
922         (WebKit::NetworkCache::Data::adoptMap): Close the file descriptor.
923         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
924         (WebKit::NetworkCache::Data::Data): Use a constructor that
925         receives a file descriptor instead of the one receiving
926         Backing. If the file descriptor is not -1 then the Data is a map.
927         (WebKit::NetworkCache::MapWrapper::~MapWrapper): Also close the
928         file descriptor.
929         (WebKit::NetworkCache::Data::adoptMap): Pass the file descriptor
930         to the MapWrapper and create the Data passing the file descriptor.
931         * UIProcess/API/APIUserContentExtensionStore.cpp:
932         (API::openAndMapContentExtension): Use mapFile that receives a
933         file path.
934         (API::compiledToFile): Use adoptAndMapFile() and don't close the
935         descriptor.
936
937 2015-05-16  Andy Estes  <aestes@apple.com>
938
939         [iOS] WKPDFView should not follow javascript: links
940         https://bugs.webkit.org/show_bug.cgi?id=145101
941
942         Reviewed by Dan Bernstein.
943
944         * UIProcess/WebPageProxy.cpp:
945         (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick): Returned early if url's protocol is javascript:.
946         (WebKit::WebPageProxy::navigateToURLWithSimulatedClick): Renamed to navigateToPDFLinkWithSimulatedClick to
947         reflect that this function is exclusively for following PDF links.
948         * UIProcess/WebPageProxy.h:
949         * UIProcess/ios/WKPDFView.mm:
950         (-[WKPDFView annotation:wasTouchedAtPoint:controller:]):
951         (-[WKPDFView actionSheetAssistant:openElementAtLocation:]):
952         * WebProcess/WebPage/WebPage.cpp:
953         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick): Renamed from navigateToURLWithSimulatedClick.
954         (WebKit::WebPage::navigateToURLWithSimulatedClick): Renamed to navigateToPDFLinkWithSimulatedClick.
955         * WebProcess/WebPage/WebPage.h:
956         * WebProcess/WebPage/WebPage.messages.in:
957
958 2015-05-16  Brent Fulgham  <bfulgham@apple.com>
959
960         [iOS] Remote scrolling tree needs to coordinate scroll snap state during resize/rotations
961         https://bugs.webkit.org/show_bug.cgi?id=145059
962         <rdar://problem/20975978>
963
964         Reviewed by Simon Fraser.
965
966         The web view needs to update its scroll snap point offsets to take into account any
967         adjustments to the view size caused by content insets. We also need to update the
968         offstes after device rotation.
969
970         * UIProcess/API/Cocoa/WKWebView.mm:
971         (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Retrieve the proper
972         computed content inset for the view and incorporate into any scroll snap point adjustments.
973         (-[WKWebView _updateVisibleContentRects]): If we have active scroll snap points, 
974         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
975         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
976         (WebKit::RemoteScrollingCoordinatorProxy::adjustTargetContentOffsetForSnapping): Update to account
977         for content inset.
978         (WebKit::RemoteScrollingCoordinatorProxy::shouldSnapForMainFrameScrolling): Also validate that the
979         active index is valid.
980         (WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling): Update to track
981         current active snap offset index.
982         (WebKit::RemoteScrollingCoordinatorProxy::hasActiveSnapPoint): Added.
983         (WebKit::RemoteScrollingCoordinatorProxy::nearestActiveSnapPoint): Added. It calculates the proper
984         scroll position incorporating any snap point and content insets.
985
986 2015-05-15  Yongjun Zhang  <yongjun_zhang@apple.com>
987
988         Don't reset the preview recognizer in [WKContentViewInteraction cleanupInteraction]
989         https://bugs.webkit.org/show_bug.cgi?id=145081
990
991         We shouldn't reset the recognizer in [WKContentViewInteraction cleanupInteraction] since we don't re-add it
992         back to WKContentView when the process relaunched. Since we already add/remove it when the view is move into/
993         removed from the window, we don't need reset it in cleanupInteraction.
994
995         Reviewed by Dan Bernstein.
996
997         * UIProcess/ios/WKContentViewInteraction.mm:
998         (-[WKContentView cleanupInteraction]):
999
1000 2015-05-15  James Savage  <james.savage@apple.com>
1001
1002         REGRESSION (r181910): WKWebView incorrectly scales snapshot
1003         https://bugs.webkit.org/show_bug.cgi?id=145076
1004
1005         Reviewed by Tim Horton.
1006
1007         We added a fast path to snapshotting using IOSurfaces with
1008         http://trac.webkit.org/changeset/181910 which incorrectly determined
1009         scale and transform and resulted in bad snapshots in some situations.
1010
1011         * UIProcess/API/Cocoa/WKWebView.mm:
1012         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
1013         When snapshotting an IOSurface we need to compute our scale based off of
1014         the rect in the WKWebView coordinates, we also failed to account for
1015         non-zero origins in the snapshot rect. Remove an unused varible while
1016         we're here.
1017
1018 2015-05-15  Alex Christensen  <achristensen@webkit.org>
1019
1020         [Content Extensions] Fail to load old content extension files
1021         https://bugs.webkit.org/show_bug.cgi?id=145027
1022
1023         Reviewed by Eric Carlson.
1024
1025         * UIProcess/API/APIUserContentExtensionStore.cpp:
1026         (API::openAndMapContentExtension):
1027         * UIProcess/API/APIUserContentExtensionStore.h:
1028
1029 2015-05-15  Jeremy Jones  <jeremyj@apple.com>
1030
1031         Limit alternate fullscreen with linked on or after.
1032         https://bugs.webkit.org/show_bug.cgi?id=144894
1033
1034         Reviewed by Dean Jackson.
1035
1036         * UIProcess/API/Cocoa/WKWebView.mm:
1037         (shouldAllowAlternateFullscreen): Added.
1038         (-[WKWebView initWithFrame:configuration:]):
1039
1040 2015-05-15  Chris Dumez  <cdumez@apple.com>
1041
1042         [WK2][Cocoa] Back swipe tab snapshot takes a long time to be removed on bing.com
1043         https://bugs.webkit.org/show_bug.cgi?id=145061
1044         <rdar://problem/20939743>
1045
1046         Reviewed by Tim Horton.
1047
1048         When swiping back from a video search result to the list of video
1049         search results on bing.com, the back swipe gesture tab snapshot takes
1050         ~3 seconds to be removed, even though the page gets loaded almost
1051         instantly from PageCache. The tab snapshot should be removed as soon as
1052         the load is done.
1053
1054         The issue is that we only cleared the back swipe gesture tab snapshot
1055         after PageClient::didFinishLoadForMainFrame() has been called. However,
1056         PageClient::didFinishLoadForMainFrame() was only being called by
1057         WebPageProxy if the main frame loaded *without* error. In case the main
1058         frame loaded with an error, only WebPageProxy::didFailLoadForFrame() is
1059         called, not WebPageProxy::didFinishLoadForFrame() and we would fail to
1060         remove the gesture snapshot until the 3 seconds timeout.
1061
1062         This patch calls PageClient::didFinishLoadForMainFrame() from
1063         WebPageProxy::didFailLoadForFrame() so we remove the snapshot in the
1064         error case as well.
1065
1066         The reason didFailLoadForFrame() is being called on bing.com video
1067         search results is because a "ping" load is aborted when the page is
1068         entering PageCache. Aborting any kind of resource load sets a
1069         "cancellation" error on the main document.
1070
1071         * UIProcess/WebPageProxy.cpp:
1072         (WebKit::WebPageProxy::didFailLoadForFrame):
1073
1074 2015-05-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1075
1076         REGRESSION(r183861): [SOUP] Downloads are broken when using the Network Process
1077         https://bugs.webkit.org/show_bug.cgi?id=144738
1078
1079         Reviewed by Alexey Proskuryakov.
1080
1081         When converting the main resource handle to a download, the
1082         NetworkResourceLoader is aborted, and the ResourceHandle is
1083         cleaned up aborting the download operation. We need to use a
1084         different ResourceHandle for the download operation.
1085
1086         * Shared/Downloads/soup/DownloadSoup.cpp:
1087         (WebKit::Download::startWithHandle): Use ResourceHandle::releaseForDownload()
1088         instead of reusing the given handle.
1089
1090 2015-05-14  Brady Eidson  <beidson@apple.com>
1091
1092         Rename connectionDidClose and related methods to be more clear.
1093         https://bugs.webkit.org/show_bug.cgi?id=145030
1094
1095         Reviewed by Darin Adler.
1096
1097         These methods were easy to confuse with "Connection::Client::didClose()", yet they
1098         were about something much more explicit: A child process being shut down by the UI Process.
1099
1100         Let's call them as such.
1101
1102         * Shared/ChildProcessProxy.cpp:
1103         (WebKit::ChildProcessProxy::shutDownProcess):
1104         (WebKit::ChildProcessProxy::clearConnection): Deleted.
1105         (WebKit::ChildProcessProxy::connectionDidClose): Deleted.
1106         * Shared/ChildProcessProxy.h:
1107
1108         * UIProcess/Databases/DatabaseProcessProxy.cpp:
1109         (WebKit::DatabaseProcessProxy::processWillShutDown):
1110         * UIProcess/Databases/DatabaseProcessProxy.h:
1111
1112         * UIProcess/Network/NetworkProcessProxy.cpp:
1113         (WebKit::NetworkProcessProxy::processWillShutDown):
1114         * UIProcess/Network/NetworkProcessProxy.h:
1115
1116         * UIProcess/Plugins/PluginProcessProxy.cpp:
1117         (WebKit::PluginProcessProxy::processWillShutDown):
1118         * UIProcess/Plugins/PluginProcessProxy.h:
1119
1120         * UIProcess/WebFrameProxy.cpp:
1121         (WebKit::WebFrameProxy::webProcessWillShutDown):
1122         (WebKit::WebFrameProxy::disconnect): Deleted.
1123         * UIProcess/WebFrameProxy.h:
1124
1125         * UIProcess/WebPageProxy.cpp:
1126         (WebKit::WebPageProxy::webProcessWillShutDown):
1127         (WebKit::WebPageProxy::connectionDidClose): Deleted.
1128         * UIProcess/WebPageProxy.h:
1129
1130         * UIProcess/WebProcessLifetimeTracker.cpp:
1131         (WebKit::WebProcessLifetimeTracker::webProcessWillShutDown):
1132         (WebKit::WebProcessLifetimeTracker::connectionDidClose): Deleted.
1133         * UIProcess/WebProcessLifetimeTracker.h:
1134
1135         * UIProcess/WebProcessProxy.cpp:
1136         (WebKit::WebProcessProxy::processWillShutDown):
1137         (WebKit::WebProcessProxy::shutDown):
1138         (WebKit::WebProcessProxy::removeWebPage):
1139         (WebKit::WebProcessProxy::didClose):
1140         (WebKit::WebProcessProxy::disconnectFramesFromPage):
1141         (WebKit::WebProcessProxy::shouldTerminate):
1142         (WebKit::WebProcessProxy::requestTermination):
1143         (WebKit::WebProcessProxy::connectionDidClose): Deleted.
1144         (WebKit::WebProcessProxy::disconnect): Deleted.
1145         * UIProcess/WebProcessProxy.h:
1146
1147 2015-05-14  Zhuo Li  <zachli@apple.com>
1148
1149         Some CFNetwork SPI to reset HSTS hosts added since a date should not be used on Yosemite.
1150         https://bugs.webkit.org/show_bug.cgi?id=145025.
1151         and
1152         rdar://problem/20646308.
1153
1154         Reviewed by Alexey Proskuryakov.
1155
1156         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1157         (WebKit::WebProcessPool::resetHSTSHostsAddedAfterDate):
1158
1159 2015-05-14  Timothy Horton  <timothy_horton@apple.com>
1160
1161         Add a layout mode that scales down the view to try to fit the document
1162         https://bugs.webkit.org/show_bug.cgi?id=145022
1163         <rdar://problem/19790341>
1164
1165         Reviewed by Dean Jackson.
1166
1167         * Shared/WebPageCreationParameters.cpp:
1168         (WebKit::WebPageCreationParameters::encode):
1169         (WebKit::WebPageCreationParameters::decode):
1170         * Shared/WebPageCreationParameters.h:
1171         * UIProcess/WebPageProxy.cpp:
1172         (WebKit::WebPageProxy::creationParameters):
1173         (WebKit::WebPageProxy::setShouldScaleViewToFitDocument):
1174         * UIProcess/WebPageProxy.h:
1175         * WebProcess/WebPage/DrawingArea.h:
1176         (WebKit::DrawingArea::setShouldScaleViewToFitDocument):
1177         * WebProcess/WebPage/WebPage.cpp:
1178         (WebKit::WebPage::WebPage):
1179         (WebKit::WebPage::setShouldScaleViewToFitDocument):
1180         * WebProcess/WebPage/WebPage.h:
1181         * WebProcess/WebPage/WebPage.messages.in:
1182         Plumb shouldScaleViewToFitDocument through to the DrawingArea.
1183
1184         * UIProcess/mac/WKViewLayoutStrategy.mm:
1185         (+[WKViewLayoutStrategy layoutStrategyWithPage:view:mode:]):
1186         (-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy initWithPage:view:mode:]):
1187         (-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy updateLayout]):
1188         (-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy willChangeLayoutStrategy]):
1189         * UIProcess/API/C/WKLayoutMode.h:
1190         * UIProcess/API/Cocoa/_WKLayoutMode.h:
1191         Add a new layout mode, which just turns on shouldScaleViewToFitDocument,
1192         and otherwise behaves as normal.
1193
1194         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1195         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1196         (WebKit::TiledCoreAnimationDrawingArea::setShouldScaleViewToFitDocument):
1197         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
1198         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1199         On every flush where either the document size or view size has changed,
1200         or layout is outstanding, do a layout with fixed layout off to determine
1201         whether the document fits inside the view. If it doesn't, scale it down
1202         to fit. This will require an extra layout for every resize while in the
1203         scaled-down state, but there is potential for future optimization.
1204
1205 2015-05-14  Anders Carlsson  <andersca@apple.com>
1206
1207         Local storage origins should include origins with transient local storage
1208         https://bugs.webkit.org/show_bug.cgi?id=145017
1209         rdar://problem/10690447
1210
1211         Reviewed by Sam Weinig.
1212
1213         The transient local storage namespaces are used for third party data blocking and will stay
1214         around until the UI process exits so we need to be able to include website data from transient storage
1215         in the website data store APIs.
1216
1217         * UIProcess/Storage/StorageManager.cpp:
1218         (WebKit::StorageManager::TransientLocalStorageNamespace::origins):
1219         (WebKit::StorageManager::getLocalStorageOrigins):
1220         * UIProcess/Storage/StorageManager.h:
1221         * UIProcess/WebKeyValueStorageManager.cpp:
1222         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
1223         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1224         (WebKit::WebsiteDataStore::fetchData):
1225
1226 2015-05-14  Beth Dakin  <bdakin@apple.com>
1227
1228         Change range of possible forces for mouseforcechanged DOM event
1229         https://bugs.webkit.org/show_bug.cgi?id=144987
1230         -and corresponding-
1231         rdar://problem/20472802
1232
1233         Reviewed by Tim Horton.
1234
1235         Change to a 0-3 range.
1236         * Shared/mac/WebEventFactory.mm:
1237         (WebKit::WebEventFactory::createWebMouseEvent):
1238
1239 2015-05-14  Zan Dobersek  <zdobersek@igalia.com>
1240
1241         [GTK] Add missing ENABLE(NETSCAPE_PLUGIN_API) build guards
1242         https://bugs.webkit.org/show_bug.cgi?id=144994
1243
1244         Reviewed by Carlos Garcia Campos.
1245
1246         This fixes the build when configured with Netscape plugin API
1247         support disabled.
1248
1249         * UIProcess/API/gtk/WebKitWebContext.cpp:
1250         (webkit_web_context_set_additional_plugins_directory):
1251         (webkitWebContextGetPluginThread):
1252         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
1253         (WebKit::ProcessLauncher::launchProcess):
1254
1255 2015-05-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1256
1257         [SOUP] Network Cache: NetworkProcess segfault when file system doesn't support xattrs
1258         https://bugs.webkit.org/show_bug.cgi?id=144953
1259
1260         Reviewed by Martin Robinson.
1261
1262         Return early if we fail to get the birthtime xattr.
1263
1264         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
1265         (WebKit::NetworkCache::fileTimes):
1266
1267 2015-05-13  Daniel Bates  <dabates@apple.com>
1268
1269         Rename ProcessThrottlerClient::{send, cancel}ProcessWillSuspend() to {send, cancel}PrepareToSuspend()
1270         https://bugs.webkit.org/show_bug.cgi?id=144619
1271         <rdar://problem/20812779>
1272
1273         Reviewed by Andy Estes.
1274
1275         The names of the functions ProcessThrottlerClient::{send, cancel}ProcessWillSuspend() are misnomers. These
1276         functions are called when the ProcessThrottler wants to prepare the process that it manages for suspension
1277         and changes its mind, respectively. That is, these functions do not actually correspond to the OS decision
1278         to suspend a process or cancel the suspension of a process, respectively. So, rename these functions and
1279         associated {Network, Web}ProcessProxy message names to better describe their purpose.
1280
1281         * NetworkProcess/NetworkProcess.cpp:
1282         (WebKit::NetworkProcess::prepareToSuspend):
1283         (WebKit::NetworkProcess::cancelPrepareToSuspend):
1284         (WebKit::NetworkProcess::processWillSuspend): Deleted.
1285         (WebKit::NetworkProcess::cancelProcessWillSuspend): Deleted.
1286         * NetworkProcess/NetworkProcess.h:
1287         * NetworkProcess/NetworkProcess.messages.in:
1288         * UIProcess/Network/NetworkProcessProxy.cpp:
1289         (WebKit::NetworkProcessProxy::sendPrepareToSuspend):
1290         (WebKit::NetworkProcessProxy::sendCancelPrepareToSuspend):
1291         (WebKit::NetworkProcessProxy::sendProcessWillSuspend): Deleted.
1292         (WebKit::NetworkProcessProxy::sendCancelProcessWillSuspend): Deleted.
1293         * UIProcess/Network/NetworkProcessProxy.h:
1294         * UIProcess/ProcessThrottler.cpp:
1295         (WebKit::ProcessThrottler::updateAssertion):
1296         * UIProcess/ProcessThrottlerClient.h:
1297         * UIProcess/WebProcessProxy.cpp:
1298         (WebKit::WebProcess::actualPrepareToSuspend): Formerly named prepareToSuspend.
1299         (WebKit::WebProcessProxy::sendPrepareToSuspend):
1300         (WebKit::WebProcessProxy::sendCancelPrepareToSuspend):
1301         (WebKit::WebProcessProxy::sendProcessWillSuspend): Deleted.
1302         (WebKit::WebProcessProxy::sendCancelProcessWillSuspend): Deleted.
1303         * UIProcess/WebProcessProxy.h:
1304         * WebProcess/WebProcess.cpp:
1305         (WebKit::WebProcess::prepareToSuspend):
1306         (WebKit::WebProcess::cancelPrepareToSuspend):
1307         (WebKit::WebProcess::processWillSuspend): Deleted.
1308         (WebKit::WebProcess::cancelProcessWillSuspend): Deleted.
1309         * WebProcess/WebProcess.h:
1310         * WebProcess/WebProcess.messages.in:
1311
1312 2015-05-13  Anders Carlsson  <andersca@apple.com>
1313
1314         Don't create a per-pool data store when using the modern API
1315         https://bugs.webkit.org/show_bug.cgi?id=144963
1316         rdar://problem/20331756
1317
1318         Reviewed by Tim Horton.
1319
1320         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1321         (API::ProcessPoolConfiguration::createWithLegacyOptions):
1322         (API::ProcessPoolConfiguration::copy):
1323         * UIProcess/API/APIProcessPoolConfiguration.h:
1324         Keep track of whether the process pool should have a data store.
1325
1326         * UIProcess/API/C/WKContext.cpp:
1327         (WKContextGetWebsiteDataStore):
1328         * UIProcess/WebKeyValueStorageManager.cpp:
1329         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
1330         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
1331         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
1332         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
1333         Update now that WebProcessPool::dataStore() no longer returns a reference.
1334
1335         * UIProcess/WebProcessPool.cpp:
1336         (WebKit::WebProcessPool::WebProcessPool):
1337         Only create a data store if the configuration states that we should.
1338
1339         * UIProcess/WebProcessPool.h:
1340         Change dataStore() to return a pointer instead of a reference.
1341
1342 2015-05-13  Alexey Proskuryakov  <ap@apple.com>
1343
1344         [Mac] Sandbox violation reading SubmitDiagInfo.domains
1345         https://bugs.webkit.org/show_bug.cgi?id=144962
1346         rdar://problem/20719330
1347
1348         Reviewed by Darin Adler.
1349
1350         * WebProcess/com.apple.WebProcess.sb.in:
1351
1352 2015-05-13  Beth Dakin  <bdakin@apple.com>
1353
1354         Speculative build fix.
1355
1356         * UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h:
1357
1358 2015-05-13  Michael Catanzaro  <mcatanzaro@igalia.com>
1359
1360         [GTK][CMake] Extra include directory when libnotify is present but disabled
1361         https://bugs.webkit.org/show_bug.cgi?id=144941
1362
1363         Reviewed by Martin Robinson.
1364
1365         Add LIBNOTIFY_INCLUDE_DIRS to WebKit2_INCLUDE_DIRECTORIES only if USE_LIBNOTIFY is true,
1366         rather than checking LIBNOTIFY_FOUND.
1367
1368         * PlatformGTK.cmake:
1369
1370 2015-05-13  Beth Dakin  <bdakin@apple.com>
1371
1372         Need SPI to set the overlay scroll bar style
1373         https://bugs.webkit.org/show_bug.cgi?id=144928
1374         -and corresponding-
1375         rdar://problem/20143614
1376
1377         Reviewed by Anders Carlsson.
1378
1379         Make scrollbarOverlayStyle a part of the creation parameters. 
1380         * Shared/WebPageCreationParameters.cpp:
1381         (WebKit::WebPageCreationParameters::encode):
1382         (WebKit::WebPageCreationParameters::decode):
1383         * Shared/WebPageCreationParameters.h:
1384
1385         New SPI.
1386         * UIProcess/API/Cocoa/WKViewPrivate.h:
1387         * UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h: Added.
1388         * UIProcess/API/mac/WKView.mm:
1389         (-[WKView _setOverlayScrollbarStyle:]):
1390         (-[WKView _overlayScrollbarStyle]):
1391
1392         Store m_scrollbarOverlayStyle on WebPageProxy, and set it to the WebProcess.
1393         * UIProcess/WebPageProxy.cpp:
1394         (WebKit::WebPageProxy::WebPageProxy):
1395         (WebKit::WebPageProxy::creationParameters):
1396         (WebKit::WebPageProxy::setOverlayScrollbarStyle):
1397         * UIProcess/WebPageProxy.h:
1398         (WebKit::WebPageProxy::overlayScrollbarStyle):
1399         * WebKit2.xcodeproj/project.pbxproj:
1400
1401         Return WebPage’s scrollbarOverlayStyle().
1402         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1403         (WebKit::WebChromeClient::preferredScrollbarOverlayStyle):
1404         * WebProcess/WebCoreSupport/WebChromeClient.h:
1405
1406         Cache the scrollbarOverlayStyle() here for the WebProcess. 
1407         * WebProcess/WebPage/WebPage.cpp:
1408         (WebKit::WebPage::WebPage):
1409         (WebKit::WebPage::setScrollbarOverlayStyle):
1410         * WebProcess/WebPage/WebPage.h:
1411         (WebKit::WebPage::scrollbarOverlayStyle):
1412         * WebProcess/WebPage/WebPage.messages.in:
1413
1414 2015-05-13  Anders Carlsson  <andersca@apple.com>
1415
1416         Rename some StorageManager functions to indicate that they work on local storage entries
1417         https://bugs.webkit.org/show_bug.cgi?id=144958
1418         First part of rdar://problem/10690447.
1419
1420         Reviewed by Beth Dakin.
1421
1422         * UIProcess/Storage/StorageManager.cpp:
1423         (WebKit::StorageManager::getLocalStorageOrigins):
1424         (WebKit::StorageManager::getLocalStorageDetailsByOrigin):
1425         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
1426         (WebKit::StorageManager::deleteAllLocalStorageEntries):
1427         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
1428         (WebKit::StorageManager::getOrigins): Deleted.
1429         (WebKit::StorageManager::getStorageDetailsByOrigin): Deleted.
1430         (WebKit::StorageManager::deleteEntriesForOrigin): Deleted.
1431         (WebKit::StorageManager::deleteAllEntries): Deleted.
1432         (WebKit::StorageManager::deleteEntriesForOrigins): Deleted.
1433         * UIProcess/Storage/StorageManager.h:
1434         * UIProcess/WebKeyValueStorageManager.cpp:
1435         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
1436         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
1437         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
1438         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
1439         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1440         (WebKit::WebsiteDataStore::fetchData):
1441         (WebKit::WebsiteDataStore::removeData):
1442
1443 2015-05-13  Joseph Pecoraro  <pecoraro@apple.com>
1444
1445         Crash under WebKit::WebInspectorProxy::attachAvailabilityChanged sometimes opening new page
1446         https://bugs.webkit.org/show_bug.cgi?id=144957
1447
1448         Reviewed by Simon Fraser.
1449
1450         * UIProcess/WebInspectorProxy.cpp:
1451         (WebKit::WebInspectorProxy::attachAvailabilityChanged):
1452
1453 2015-05-13  Joseph Pecoraro  <pecoraro@apple.com>
1454
1455         Pass String as reference in more places
1456         https://bugs.webkit.org/show_bug.cgi?id=144769
1457
1458         Reviewed by Daniel Bates.
1459
1460         * WebProcess/WebPage/WebInspectorUI.cpp:
1461         (WebKit::WebInspectorUI::showMainResourceForFrame):
1462         * WebProcess/WebPage/WebInspectorUI.h:
1463
1464 2015-05-13  Timothy Horton  <timothy_horton@apple.com>
1465
1466         View scale changes are temporarily lost after restoring a page from the page cache
1467         https://bugs.webkit.org/show_bug.cgi?id=144934
1468
1469         Reviewed by Brady Eidson.
1470
1471         * WebProcess/WebPage/WebPage.cpp:
1472         (WebKit::WebPage::WebPage):
1473         (WebKit::WebPage::scalePage):
1474         (WebKit::WebPage::scalePageInViewCoordinates):
1475         (WebKit::WebPage::pageScaleFactor):
1476         (WebKit::WebPage::viewScaleFactor):
1477         (WebKit::WebPage::scaleView):
1478         * WebProcess/WebPage/WebPage.h:
1479         (WebKit::WebPage::viewScaleFactor): Deleted.
1480         Get rid of m_viewScaleFactor, instead using Page::viewScaleFactor.
1481
1482 2015-05-13  Sungmann Cho  <sungmann.cho@navercorp.com>
1483
1484         Minor cleanups to PluginProxy.cpp.
1485         https://bugs.webkit.org/show_bug.cgi?id=144948
1486
1487         Reviewed by Gyuyoung Kim.
1488
1489         1. Remove unnecessary #include.
1490         2. Remove unnecessary return statement from PluginProxy::paint().
1491
1492         No new tests, no behavior change.
1493
1494         * WebProcess/Plugins/PluginProxy.cpp:
1495         (WebKit::PluginProxy::paint):
1496
1497 2015-05-13  Daegyu Lee  <daegyu.lee@navercorp.com>
1498
1499         REGRESSION(r176631): [EFL] Fullscreen feature doesn't work correctly on MiniBrowser
1500         https://bugs.webkit.org/show_bug.cgi?id=144906
1501
1502         Reviewed by Gyuyoung Kim.
1503
1504         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
1505         (WebKit::PageViewportController::updateMinimumScaleToFit): Recover the r176631 condition to
1506         call applyScaleAfterRenderingContents function to apply correct scale.
1507
1508 2015-05-12  Dan Bernstein  <mitz@apple.com>
1509
1510         In Safari, Debug > Get Bytecode Profile crashes the Web Content process
1511         https://bugs.webkit.org/show_bug.cgi?id=144944
1512
1513         Reviewed by Darin Adler.
1514
1515         * WebProcess/WebPage/WebPage.cpp:
1516         (WebKit::WebPage::getBytecodeProfile): Don’t assert that m_perBytecodeProfiler isn’t null,
1517         because it is when the profiler is disabled, which is the default. In that case, return
1518         after sending back the empty string, rather than continuing to dereference a null pointer.
1519
1520 2015-05-12  Jon Honeycutt  <jhoneycutt@apple.com>
1521
1522         Crash when using <input type=file>
1523
1524         <https://bugs.webkit.org/show_bug.cgi?id=144939>
1525         <rdar://problem/20172315>
1526
1527         Reviewed by Andy Estes.
1528
1529         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1530         Use a RefPtr to hold the WebOpenPanelResultListenerProxy, because the
1531         WKFileUploadPanel can outlive it.
1532
1533 2015-05-12  Simon Fraser  <simon.fraser@apple.com>
1534
1535         Turn antialiased font dilation off by default
1536         https://bugs.webkit.org/show_bug.cgi?id=144940
1537         rdar://problem/20923031
1538
1539         Reviewed by Sam Weinig.
1540
1541         Turn antialised font dilation off by default.
1542
1543         * Shared/WebPreferencesDefinitions.h:
1544         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1545
1546 2015-05-12  Daniel Bates  <dabates@apple.com>
1547
1548         Make {Network, Web}ProcessProxy inherit from ProcessThrottleClient privately
1549         https://bugs.webkit.org/show_bug.cgi?id=144886
1550
1551         Reviewed by Darin Adler.
1552
1553         {Network, Web}ProcessProxy are implemented in terms of ProcessThrottleClient, an
1554         interface that defines the callbacks that ProcessThrottler makes to a client. We
1555         do not want to allow arbitrary callers to make use of the interface ProcessThrottleClient.
1556         So, we should use private inheritance to represent the relationship between
1557         {Network, Web}ProcessProxy and ProcessThrottleClient instead of public inheritance.
1558
1559         Additionally make ProcessThrottler a instance variable of {Network, Web}ProcessProxy instead
1560         of holding a smart pointer to a ProcessThrottler instance because we always want to
1561         have a ProcessThrottler for each instance of {Network, Web}ProcessProxy.
1562
1563         * UIProcess/Network/NetworkProcessProxy.cpp:
1564         (WebKit::NetworkProcessProxy::NetworkProcessProxy): Update code to work now that m_throttler
1565         is an instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance.
1566         (WebKit::NetworkProcessProxy::didFinishLaunching): Update code to access functions of
1567         m_throttler by reference instead of by pointer.
1568         (WebKit::NetworkProcessProxy::didCancelProcessSuspension): Ditto.
1569         (WebKit::NetworkProcessProxy::processReadyToSuspend): Ditto.
1570         (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles): Ditto.
1571         * UIProcess/Network/NetworkProcessProxy.h: Inherit from ProcessThrottleClient privately.
1572         (WebKit::NetworkProcessProxy::throttler): Update code to work now that m_throttler is an
1573         instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance.
1574         * UIProcess/ProcessThrottler.cpp:
1575         (WebKit::ProcessThrottler::ProcessThrottler): Update code to work now that m_process is
1576         a lvalue reference instead of a pointer.
1577         (WebKit::ProcessThrottler::updateAssertion): Ditto.
1578         (WebKit::ProcessThrottler::assertionWillExpireImminently): Ditto.
1579         * UIProcess/ProcessThrottler.h: Ditto.
1580         * UIProcess/WebProcessProxy.cpp:
1581         (WebKit::WebProcessProxy::WebProcessProxy): Update code to work now that m_throttler is an
1582         instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance. 
1583         (WebKit::WebProcessProxy::didFinishLaunching): Update code to access functions of
1584         m_throttler by reference instead of by pointer.
1585         (WebKit::WebProcessProxy::processReadyToSuspend): Ditto.
1586         (WebKit::WebProcessProxy::didCancelProcessSuspension): Ditto.
1587         (WebKit::WebProcessProxy::setIsHoldingLockedFiles): Ditto.
1588         * UIProcess/WebProcessProxy.h: Inherit from ProcessThrottleClient privately.
1589         (WebKit::WebProcessProxy::throttler): Update code to work now that m_throttler is an
1590         instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance.
1591
1592 2015-05-12  Anders Carlsson  <andersca@apple.com>
1593
1594         Production builds should link against the shims directly
1595         https://bugs.webkit.org/show_bug.cgi?id=144922
1596         rdar://problem/19708579
1597
1598         Reviewed by Dan Bernstein.
1599
1600         * Configurations/NetworkService.xcconfig:
1601         Point to an Info.plist that has DYLD_INSERT_LIBRARIES set on 10.10 and earlier.
1602         Link directly against SecItemShim.dylib where possible.
1603
1604         * Configurations/PluginProcessShim.xcconfig:
1605         Set the install name and install path.
1606
1607         * Configurations/PluginService.32.xcconfig:
1608         Point to an Info.plist that has DYLD_INSERT_LIBRARIES set on 10.10 and earlier.
1609         Link directly against PluginProcessShim.dylib where possible.
1610
1611         * Configurations/PluginService.64.xcconfig:
1612         Point to an Info.plist that has DYLD_INSERT_LIBRARIES set on 10.10 and earlier.
1613         Link directly against PluginProcessShim.dylib where possible.
1614
1615         * Configurations/SecItemShim.xcconfig:
1616         Set the install name and install path.
1617
1618         * Configurations/WebContentService.xcconfig:
1619         Point to an Info.plist that has DYLD_INSERT_LIBRARIES set on 10.10 and earlier.
1620         Link directly against WebProcessShim.dylib where possible.
1621
1622         * Configurations/WebProcessShim.xcconfig:
1623         Set the install name and install path.
1624
1625         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: Copied from Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist.
1626         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist:
1627         Add an Info.plist for 10.9 and 10.10 and remove DYLD_INSERT_LIBRARIES from the non-legacy plist.
1628
1629         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist: Copied from Source/WebKit2/PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist.
1630         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
1631         Add an Info.plist for 10.9 and 10.10 and remove DYLD_INSERT_LIBRARIES from the non-legacy plist.
1632
1633         * WebKit2.xcodeproj/project.pbxproj:
1634         Add new files.
1635
1636         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist: Copied from Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist.
1637         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
1638         Add an Info.plist for 10.9 and 10.10 and remove DYLD_INSERT_LIBRARIES from the non-legacy plist.
1639
1640 2015-05-12  Alexey Proskuryakov  <ap@apple.com>
1641
1642         Undo a mistaken part of r184211.
1643
1644         * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::cookieStorageDirectory):
1645         * UIProcess/WebProcessPool.h:
1646         cookieStorageDirectory() is used on iOS, so bring it back.
1647
1648 2015-05-08  Alexey Proskuryakov  <ap@apple.com>
1649
1650         [Mac] Share cookie storage between UI process and secondary processes
1651         https://bugs.webkit.org/show_bug.cgi?id=144820
1652         rdar://problem/20572830
1653
1654         Reviewed by Darin Adler.
1655
1656         Pass a cookie storage descriptor that includes file path as well as other data that
1657         CFNetwork needs to use the same cookies storage as in another process (session cookies
1658         are still separate).
1659
1660         While at it, started to clean up code that passes cookie storage path. It was mostly
1661         dead and unimplemented, only used in child processes when USE(SECCOMP_FILTERS) was enabled.
1662
1663         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1664         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1665         * Shared/Network/NetworkProcessCreationParameters.cpp:
1666         (WebKit::NetworkProcessCreationParameters::encode):
1667         (WebKit::NetworkProcessCreationParameters::decode):
1668         * Shared/Network/NetworkProcessCreationParameters.h:
1669         * Shared/WebProcessCreationParameters.cpp:
1670         (WebKit::WebProcessCreationParameters::encode):
1671         (WebKit::WebProcessCreationParameters::decode):
1672         * Shared/WebProcessCreationParameters.h:
1673         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1674         (WebKit::WebProcessPool::platformInitializeWebProcess):
1675         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1676         (WebKit::WebProcessPool::platformDefaultCookieStorageDirectory): Deleted.
1677         * UIProcess/WebProcessPool.cpp:
1678         (WebKit::WebProcessPool::ensureNetworkProcess):
1679         (WebKit::WebProcessPool::createNewWebProcess):
1680         (WebKit::WebProcessPool::cookieStorageDirectory):
1681         * UIProcess/WebProcessPool.h:
1682         * UIProcess/efl/WebProcessPoolEfl.cpp:
1683         (WebKit::WebProcessPool::platformDefaultCookieStorageDirectory): Deleted.
1684         * UIProcess/gtk/WebProcessPoolGtk.cpp:
1685         (WebKit::WebProcessPool::platformDefaultCookieStorageDirectory): Deleted.
1686         * WebProcess/cocoa/WebProcessCocoa.mm:
1687         (WebKit::WebProcess::platformInitializeWebProcess):
1688
1689 2015-05-12  Chris Dumez  <cdumez@apple.com>
1690
1691         [WK2] Log using diagnostic logging how far back in history we navigate
1692         https://bugs.webkit.org/show_bug.cgi?id=144919
1693         <rdar://problem/20920043>
1694
1695         Reviewed by Gavin Barraclough.
1696
1697         Log using diagnostic logging how far back in history we navigate.
1698         When a back navigation or a backward indexed navigation occurs, we
1699         log the delta: (HistoryListSize - 1) - NewHistoryItemIndex.
1700
1701         * UIProcess/WebBackForwardList.cpp:
1702         (WebKit::WebBackForwardList::goToItem):
1703
1704 2015-05-11  Sam Weinig  <sam@webkit.org>
1705
1706         ChildProcess should take an os_activity
1707         https://bugs.webkit.org/show_bug.cgi?id=141781
1708
1709         Reviewed by Ryosuke Niwa.
1710
1711         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm:
1712         (DatabaseServiceInitializer):
1713         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
1714         (NetworkServiceInitializer):
1715         * PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm:
1716         (PluginServiceInitializer):
1717         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
1718         (WebContentServiceInitializer):
1719         Start an os_activity in the initializer for each XPC service.
1720
1721         * config.h:
1722         Add HAVE_OS_ACTIVITY where available.
1723
1724 2015-05-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1725
1726         Unreviewed. Fix GTK+ debug build after r184197.
1727
1728         * UIProcess/gtk/RedirectedXCompositeWindow.cpp: Add missing include.
1729
1730 2015-05-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1731
1732         [X11] Add XUniquePtr and XUniqueResource to automatically free X resources
1733         https://bugs.webkit.org/show_bug.cgi?id=144521
1734
1735         Reviewed by Darin Adler.
1736
1737         Use XUniquePtr and XUniqueResource to free X resources.
1738
1739         * PlatformEfl.cmake: Add Source/WebCore/platform/graphics/x11 dir
1740         to the include dir list.
1741         * PlatformGTK.cmake: Ditto.
1742         * UIProcess/cairo/BackingStoreCairo.cpp:
1743         (WebKit::BackingStore::createBackend): Do not pass the display to
1744         the BackingStoreBackendCairoX11 constructor.
1745         * UIProcess/gtk/RedirectedXCompositeWindow.cpp:
1746         (WebKit::RedirectedXCompositeWindow::RedirectedXCompositeWindow):
1747         (WebKit::RedirectedXCompositeWindow::~RedirectedXCompositeWindow):
1748         (WebKit::RedirectedXCompositeWindow::resize):
1749         (WebKit::RedirectedXCompositeWindow::cleanupPixmapAndPixmapSurface):
1750         (WebKit::RedirectedXCompositeWindow::surface):
1751         * UIProcess/gtk/RedirectedXCompositeWindow.h:
1752         (WebKit::RedirectedXCompositeWindow::windowID):
1753         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1754         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
1755         (WebKit::NetscapePlugin::platformPostInitializeWindowless):
1756         (WebKit::NetscapePlugin::platformDestroy):
1757         (WebKit::NetscapePlugin::platformGeometryDidChange):
1758         (WebKit::NetscapePlugin::platformPaint):
1759
1760 2015-05-11  Dan Bernstein  <mitz@apple.com>
1761
1762         WebKit2 part of <rdar://problem/20878075> Trying to navigate to an invalid URL loads about:blank, but -[WKWebView URL] returns the invalid URL
1763
1764         Reviewed by Alexey Proskuryakov.
1765
1766         * UIProcess/WebPageProxy.cpp:
1767         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame): Added. Update internal state the
1768         same way we update it for server redirects, but don’t make client callbacks. Clients
1769         observing the URL property will see it change.
1770         * UIProcess/WebPageProxy.h:
1771
1772         * UIProcess/WebPageProxy.messages.in: Added DidChangeProvisionalURLForFrame.
1773
1774         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1775         (WebKit::WebFrameLoaderClient::dispatchDidChangeProvisionalURL): Override this new
1776         FrameLoaderClient function to send a DidChangeProvisionalURLForFrame message to the UI
1777         process.
1778         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1779
1780 2015-05-11  Dan Bernstein  <mitz@apple.com>
1781
1782         <rdar://problem/19773721> [iOS] Find on page feels like it zooms in too much
1783         https://bugs.webkit.org/show_bug.cgi?id=144891
1784
1785         Reviewed by Darin Adler.
1786
1787         Sometimes, Find on Page’s constant 1.6 scale factor is too much. Smart magnification is
1788         designed to choose a scale factor that is just right.
1789
1790         * UIProcess/ios/SmartMagnificationController.h:
1791         * UIProcess/ios/SmartMagnificationController.messages.in: Added Magnify message.
1792         * UIProcess/ios/SmartMagnificationController.mm:
1793         (WebKit::SmartMagnificationController::magnify): Added. Handle the new message using
1794         -[WKContentView _soomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:].
1795         * WebProcess/WebPage/ios/FindControllerIOS.mm:
1796         (WebKit::FindController::updateFindIndicator): Instead of zooming to the selection rect,
1797         get the surrounding render rect (the area we would target for a double-tap at the beginning
1798         of the selection), and tell the magnification controller to target it. Use the center of the
1799         start of the selection as the origin.
1800
1801 2015-05-11  Brent Fulgham  <bfulgham@apple.com>
1802
1803         Scroll snap logic should be triggered when resizing the WebView
1804         https://bugs.webkit.org/show_bug.cgi?id=142590
1805         <rdar://problem/20125088>
1806
1807         Reviewed by Simon Fraser.
1808
1809         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1810         (RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling): Modify use of 'closestSnapOffset' to satisfy the additional
1811         argument I added. This is currently not used for anything on iOS.
1812         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Ditto.
1813
1814 2015-05-11  Andreas Kling  <akling@apple.com>
1815
1816         Force a rebuild of JSNPObject.cpp on bots.
1817
1818         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1819         (WebKit::JSNPObject::callMethod):
1820
1821 2015-05-11  Anders Carlsson  <andersca@apple.com>
1822
1823         Simplify shim path computation
1824         https://bugs.webkit.org/show_bug.cgi?id=144884
1825         Part of rdar://problem/19708579.
1826
1827         Reviewed by Sam Weinig.
1828
1829         Factor the code that computes the shim path out into a separate function. Also make this mac only
1830         since we don't have any shims on iOS.
1831
1832         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1833         (WebKit::computeProcessShimPath):
1834         (WebKit::addDYLDEnvironmentAdditions):
1835
1836 2015-05-11  Myles C. Maxfield  <mmaxfield@apple.com>
1837
1838         Unreviewed build fix
1839
1840         Unreviewed.
1841
1842         * UIProcess/API/APIUserContentExtensionStore.cpp:
1843         (API::compiledToFile):
1844
1845 2015-05-11  Alex Christensen  <achristensen@webkit.org>
1846
1847         [Content Extensions] Support domain-specific rules and exceptions.
1848         https://bugs.webkit.org/show_bug.cgi?id=144833
1849
1850         Reviewed by Darin Adler.
1851
1852         * Shared/WebCompiledContentExtension.cpp:
1853         (WebKit::WebCompiledContentExtension::filtersWithoutDomainsBytecode):
1854         (WebKit::WebCompiledContentExtension::filtersWithoutDomainsBytecodeLength):
1855         (WebKit::WebCompiledContentExtension::filtersWithDomainsBytecode):
1856         (WebKit::WebCompiledContentExtension::filtersWithDomainsBytecodeLength):
1857         (WebKit::WebCompiledContentExtension::domainFiltersBytecode):
1858         (WebKit::WebCompiledContentExtension::domainFiltersBytecodeLength):
1859         (WebKit::WebCompiledContentExtension::bytecode): Deleted.
1860         (WebKit::WebCompiledContentExtension::bytecodeLength): Deleted.
1861         * Shared/WebCompiledContentExtension.h:
1862         * Shared/WebCompiledContentExtensionData.cpp:
1863         (WebKit::WebCompiledContentExtensionData::encode):
1864         (WebKit::WebCompiledContentExtensionData::decode):
1865         * Shared/WebCompiledContentExtensionData.h:
1866         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
1867         * UIProcess/API/APIUserContentExtensionStore.cpp:
1868         (API::ContentExtensionMetaData::fileSize):
1869         (API::encodeContentExtensionMetaData):
1870         (API::decodeContentExtensionMetaData):
1871         (API::compiledToFile):
1872         (API::createExtension):
1873         Keep track of 3 different types of bytecode to be able to handle domain-specific rules.
1874
1875 2015-05-11  Tim Horton  <timothy_horton@apple.com>
1876
1877         Page overlay action context override should indicate the source of the request
1878         https://bugs.webkit.org/show_bug.cgi?id=144832
1879         <rdar://problem/20562594>
1880
1881         Reviewed by Darin Adler.
1882
1883         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
1884         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
1885         * WebProcess/WebPage/WebPageOverlay.cpp:
1886         (WebKit::WebPageOverlay::actionContextForResultAtPoint):
1887         * WebProcess/WebPage/WebPageOverlay.h:
1888         (WebKit::WebPageOverlay::Client::actionContextForResultAtPoint):
1889         * WebProcess/WebPage/mac/WebPageMac.mm:
1890         (WebKit::WebPage::performActionMenuHitTestAtLocation):
1891         Add a parameter to WKBundlePageOverlayActionContextForResultAtPoint so that
1892         clients can tell whether the requested action context should be targetted
1893         at an action menu or immediate action.
1894
1895 2015-05-11  Daniel Bates  <dabates@apple.com>
1896
1897         [iOS] Close all open databases in expiration handler of process assertion
1898         https://bugs.webkit.org/show_bug.cgi?id=144661
1899         <rdar://problem/20845052>
1900
1901         Reviewed by Darin Adler.
1902
1903         For WebKit2, close all open databases when the process assertion expiration
1904         handler is called.
1905
1906         When the process assertion expiration handler is called we dispatch a synchronous
1907         message called ProcessWillSuspendImminently to the {Web, Network} processes to inform
1908         them that they will be suspended imminently. The {Web, Network} process will always
1909         service this message regardless if they were waiting for another message. In the
1910         WebProcess, we will close all open databases among other tasks upon receiving this
1911         message. In the NetworkProcess, we will purge some data from memory.
1912
1913         * NetworkProcess/NetworkProcess.cpp:
1914         (WebKit::NetworkProcess::didReceiveSyncMessage): Modified to call NetworkProcess::didReceiveSyncNetworkProcessMessage()
1915         to process the synchronous ProcessWillSuspendImminently message.
1916         (WebKit::NetworkProcess::processWillSuspendImminently): Added; free some memory.
1917         * NetworkProcess/NetworkProcess.h:
1918         * NetworkProcess/NetworkProcess.messages.in: Added synchronous message ProcessWillSuspendImminently.
1919         * Shared/ChildProcessProxy.h:
1920         (WebKit::ChildProcessProxy::sendSync): Added parameter sendSyncFlags so that we can send
1921         a sync message with flag IPC::InterruptWaitingIfSyncMessageArrives to cause the {Web, Network}Process
1922         to process the message regardless of whether it is waiting for another message.
1923         * UIProcess/Network/NetworkProcessProxy.cpp:
1924         (WebKit::NetworkProcessProxy::sendProcessWillSuspendImminently): Added. Sends the message
1925         ProcessWillSuspendImminently to the NetworkProcess.
1926         * UIProcess/Network/NetworkProcessProxy.h:
1927         * UIProcess/ProcessAssertion.cpp:
1928         (WebKit::ProcessAndUIAssertion::setClient): Added.
1929         * UIProcess/ProcessAssertion.h: Added abstract class ProcessAssertionClient.
1930         (WebKit::ProcessAssertionClient::~ProcessAssertionClient): Added.
1931         (WebKit::ProcessAssertion::setClient): Added.
1932         (WebKit::ProcessAssertion::client): Added.
1933         * UIProcess/ProcessThrottler.cpp:
1934         (WebKit::ProcessThrottler::didConnectToProcess):
1935         (WebKit::ProcessThrottler::assertionWillExpireImminently): Added; implements the ProcessAssertionClient
1936         interface. Notify the process throttler clients that the assertion is near expiration.
1937         * UIProcess/ProcessThrottler.h:
1938         * UIProcess/ProcessThrottlerClient.h: Added 
1939         * UIProcess/WebProcessProxy.cpp:
1940         (WebKit::WebProcessProxy::sendProcessWillSuspendImminently): Added. Sends the message
1941         ProcessWillSuspendImminently to the WebProcess.
1942         * UIProcess/WebProcessProxy.h:
1943         * UIProcess/ios/ProcessAssertionIOS.mm:
1944         (-[WKProcessAssertionBackgroundTaskManager addClient:]): Added.
1945         (-[WKProcessAssertionBackgroundTaskManager removeClient:]): Added.
1946         (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]): Modified expiration handler
1947         to notify ProcessAssertionClient clients that the assertion is near expiration.
1948         (WebKit::ProcessAssertion::~ProcessAssertion): Remove the client on destruction.
1949         (WebKit::ProcessAndUIAssertion::setClient): Added.
1950         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
1951         (WebKit::WebDatabaseManager::closeAllDatabases): Added; turns around and calls DatabaseManager::closeAllDatabases().
1952         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
1953         * WebProcess/WebProcess.cpp:
1954         (WebKit::WebProcess::didReceiveSyncMessage): Call WebProcess::didReceiveSyncWebProcessMessage() to process
1955         the synchronous ProcessWillSuspendImminently message. Removed logging for an unhandled synchronous message
1956         since WebProcess::didReceiveSyncWebProcessMessage() will ASSERT_NOT_REACHED() for such a message.
1957         (WebKit::WebProcess::prepareToSuspend): Extracted code from WebProcess::processWillSuspend() so that it can
1958         be used from both WebProcess::processWillSuspend() and WebProcess::processWillSuspendImminently(). And modified
1959         it to conditionally dispatch a ProcessReadyToSuspend message to the WebProcessProxy. We only want to dispatch
1960         such a message as part of a coordinated suspension by the ProcessThrottler. That is, we do not want to dispatch
1961         the ProcessReadyToSuspend message when the background assertion is near expiration (i.e. WebProcess::processWillSuspendImminently()
1962         is called).
1963         (WebKit::WebProcess::processWillSuspendImminently): Added. Suspend all open databases among other tasks.
1964         (WebKit::WebProcess::processWillSuspend): Implemented in terms of WebProcess::prepareToSuspend().
1965         (WebKit::WebProcess::processSuspensionCleanupTimerFired): Modified to conditionally dispatch a ProcessReadyToSuspend
1966         message to the WebProcessProxy.
1967         (WebKit::WebProcess::processDidResume): Stop the suspension cleanup timer, which may be active if the WebProcess
1968         did not mark all its graphics layers as volatile before process suspension.
1969         * WebProcess/WebProcess.h:
1970         * WebProcess/WebProcess.messages.in: Added synchronous message ProcessWillSuspendImminently.
1971
1972 2015-05-10  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1973
1974         Use Ref instead of PassRefPtr in WebCore/page
1975         https://bugs.webkit.org/show_bug.cgi?id=144841
1976
1977         Reviewed by Darin Adler.
1978
1979         To kill PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr
1980         in WebCore/page.
1981
1982         (WebKit::WebUserContentController::WebUserContentController):
1983         * UIProcess/WebPageProxy.cpp:
1984         (WebKit::WebPageProxy::setTextIndicator):
1985         * UIProcess/mac/PageClientImpl.mm:
1986         (WebKit::PageClientImpl::didPerformDictionaryLookup):
1987         * WebProcess/UserContent/WebUserContentController.cpp:
1988         (WebKit::WebUserContentController::WebUserContentController):
1989
1990 2015-05-10  Philip Chimento  <philip.chimento@gmail.com>
1991
1992         [GTK][SOUP] Web and Network processes don't know how to get memory size on OSX
1993         https://bugs.webkit.org/show_bug.cgi?id=144554
1994
1995         Reviewed by Darin Adler.
1996
1997         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1998         (WebKit::NetworkProcess::platformSetCacheModel): Use WTF::ramSize()
1999         instead of local function. Also use WTF::MB instead of dividing by
2000         1024 * 1024.
2001         (WebKit::getMemorySize): Deleted.
2002         * WebProcess/soup/WebProcessSoup.cpp:
2003         (WebKit::WebProcess::platformSetCacheModel): Ditto.
2004         (WebKit::getMemorySize): Deleted.
2005
2006 2015-05-10  Yongjun Zhang  <yongjun_zhang@apple.com>
2007
2008         Use preview view controller from WebKitSystemInterface.
2009         https://bugs.webkit.org/show_bug.cgi?id=144836
2010
2011         Add a property _allowsLinkPreview to WKWebView so that we can turn on/off preview at runtime. Also,
2012         for client that doesn't provide preview view controller, use the default view controller prepared
2013         by WebKitSystemInterface.
2014
2015         Reviewed by Dan Bernstein.
2016
2017         * UIProcess/API/Cocoa/WKWebView.mm:
2018         (-[WKWebView initWithFrame:configuration:]):
2019         (-[WKWebView _allowsLinkPreview]):
2020         (-[WKWebView _setAllowsLinkPreview:]):
2021         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add _allowsLinkPreview property
2022         * UIProcess/ios/WKContentView.mm:
2023         (-[WKContentView willMoveToWindow:]):
2024         * UIProcess/ios/WKContentViewInteraction.h:
2025         * UIProcess/ios/WKContentViewInteraction.mm:
2026         (-[WKContentView _registerPreviewInWindow:]):
2027         (-[WKContentView _unregisterPreviewInWindow:]):
2028         (-[WKContentView previewViewControllerForPosition:inSourceView:]): : For client that doesn't provide
2029             preview delegate, use preview view controller in WebKitSystemInterface.
2030         (-[WKContentView commitPreviewViewController:]):
2031
2032 2015-05-10  Darin Adler  <darin@apple.com>
2033
2034         Fix internal Apple builds on Mavericks.
2035
2036         * UIProcess/API/mac/WKView.mm:
2037         (-[WKView _dismissContentRelativeChildWindows]): Added missing conditionals around
2038         some code that is for OS X 10.10 or newer only. There were similar conditionals around
2039         other nearby code in this file, and around other uses of the same method in other files,
2040         so matched the style.
2041
2042 2015-05-10  Dan Bernstein  <mitz@apple.com>
2043
2044         iOS internal build fix.
2045
2046         * Platform/mac/MenuUtilities.mm:
2047
2048 2015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
2049
2050         Remove unnecessary semicolons.
2051         https://bugs.webkit.org/show_bug.cgi?id=144844
2052
2053         Reviewed by Darin Adler.
2054
2055         No new tests, no behavior change.
2056
2057         * Shared/Downloads/mac/DownloadMac.mm:
2058         (-[WKDownloadAsDelegate download:shouldDecodeSourceDataOfMIMEType:]):
2059         * UIProcess/WebProcessProxy.cpp:
2060         (WebKit::WebProcessProxy::transformHandlesToObjects):
2061         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2062         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
2063         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2064         (WebKit::idToHistoryItemMap):
2065
2066 2015-05-10  Darin Adler  <darin@apple.com>
2067
2068         Fix build.
2069
2070         * Platform/mac/MenuUtilities.mm: Added includes that were somehow omitted in what
2071         I committed before.
2072
2073 2015-05-10  Darin Adler  <darin@apple.com>
2074
2075         [Cocoa] Don't soft link DataDetectorsCore
2076         https://bugs.webkit.org/show_bug.cgi?id=144837
2077
2078         Reviewed by Dan Bernstein.
2079
2080         * Platform/mac/MenuUtilities.mm: Use DataDetectorsSPI.h instead of doing it here.
2081
2082         * WebProcess/WebPage/mac/WebPageMac.mm: Removed unneeded include of unused header,
2083         DataDetectorsSPI.h.
2084
2085 2015-05-09  Dan Bernstein  <mitz@apple.com>
2086
2087         Deployment-target __NSi_ and __NSd_ definitions in WKFoundation.h are redundant
2088         https://bugs.webkit.org/show_bug.cgi?id=144831
2089
2090         Reviewed by Sam Weinig.
2091
2092         Reverted r182846 and r182904.
2093
2094         * Shared/API/Cocoa/WKFoundation.h:
2095         * WebKit2.xcodeproj/project.pbxproj:
2096
2097 2015-05-09  Yoav Weiss  <yoav@yoav.ws>
2098
2099         Remove the PICTURE_SIZES build flag
2100         https://bugs.webkit.org/show_bug.cgi?id=144679
2101
2102         Reviewed by Benjamin Poulain.
2103
2104         Removed the PICTURE_SIZES build time flag.
2105
2106         * Configurations/FeatureDefines.xcconfig:
2107
2108 2015-05-08  Beth Dakin  <bdakin@apple.com>
2109
2110         Shuffle touch-related code to keep the internal builds working
2111         https://bugs.webkit.org/show_bug.cgi?id=144812
2112
2113         Reviewed by Benjamin Poulain.
2114
2115         * Shared/NativeWebTouchEvent.h:
2116         * Shared/WebEvent.h:
2117         * Shared/WebEventConversion.cpp:
2118         * Shared/ios/NativeWebTouchEventIOS.mm:
2119         (WebKit::NativeWebTouchEvent::extractWebTouchPoint):
2120         (WebKit::extractWebTouchPoint): Deleted.
2121         * Shared/ios/WebPlatformTouchPointIOS.cpp:
2122
2123 2015-05-08  Dan Bernstein  <mitz@apple.com>
2124
2125         <rdar://problem/20757196> NSInternalInconsistencyException raised in -[NSString encodeWithCoder:] beneath createEncodedObject when using WKRemoteObjectEncoder for Safari AutoFill
2126         https://bugs.webkit.org/show_bug.cgi?id=144818
2127
2128         Reviewed by Anders Carlsson.
2129
2130         Allow NSString instances that contain unpaired surrogates to be encoded by
2131         WKRemoteObjectCoder by encoding them directly rather than using
2132         -[NSString encodeWithCoder:].
2133
2134         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
2135         (encodeString): Added. Sets an API::String as the object to encode.
2136         (encodeObject): Changed to use encodeString for NSString instances.
2137         (decodeString): Added. Gets an API::String from the dictionary and returns it as an
2138         NSString.
2139         (decodeObject): Changed to use decodeString for NSString instances.
2140
2141 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
2142
2143         Fix the build.
2144
2145         * Platform/mac/LayerHostingContext.mm:
2146         (WebKit::LayerHostingContext::createFencePort):
2147
2148 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
2149
2150         Periodically repaint during resize while using the DynamicSizeWithMinimumViewSize layout strategy
2151         https://bugs.webkit.org/show_bug.cgi?id=144816
2152
2153         Reviewed by Simon Fraser.
2154
2155         * UIProcess/mac/WKViewLayoutStrategy.mm:
2156         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy initWithPage:view:mode:]):
2157         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy _updateTransientScale:]):
2158         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
2159         Factor out _updateTransientScale from updateLayout.
2160         Keep track of the last viewScaleFactor that we know is being displayed
2161         (_lastCommittedViewScale) and use that for computing the transient scale,
2162         so that we can recompute the transient scale while the UI process's notion
2163         of the actual view scale might have moved ahead of what the Web process has
2164         painted.
2165
2166 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
2167
2168         Fix the build.
2169
2170         * UIProcess/WebPageProxy.cpp:
2171
2172 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
2173
2174         Fix the build.
2175
2176         * Platform/mac/LayerHostingContext.mm:
2177         (WebKit::LayerHostingContext::createFencePort):
2178
2179 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
2180
2181         Fix the build.
2182
2183         * Platform/mac/LayerHostingContext.mm:
2184         (WebKit::LayerHostingContext::createFencePort):
2185
2186 2015-05-08  Timothy Horton  <timothy_horton@apple.com>
2187
2188         Flip the direction of the fence in scaleViewAndUpdateGeometryFenced
2189         https://bugs.webkit.org/show_bug.cgi?id=144810
2190
2191         Reviewed by Simon Fraser.
2192
2193         Send the fence from the Web process to the UI process, instead of vice versa.
2194         This means that we won't keep the UI process CAContext blocked for the whole
2195         time that the Web process is doing layout/painting/etc. Instead, we'll start
2196         blocking the Web process CAContext immediately after flushing and before committing,
2197         and send the fence to the UI process to be applied immediately. This minimizes
2198         the amount of time in both processes spent blocked on the fence.
2199
2200         * Platform/mac/LayerHostingContext.h:
2201         * Platform/mac/LayerHostingContext.mm:
2202         (WebKit::LayerHostingContext::createFencePort):
2203         Add createFencePort, which creates a MachSendRight wrapping a CA fence port.
2204         Note that you must setFencePort() with this port if you want the LayerHostingContext's
2205         CAContext to block on it!
2206
2207         * UIProcess/WebPageProxy.cpp:
2208         (WebKit::WebPageProxy::scaleViewAndUpdateGeometryFenced):
2209         (WebKit::WebPageProxy::machSendRightCallback):
2210         * UIProcess/WebPageProxy.h:
2211         * UIProcess/WebPageProxy.messages.in:
2212         Create a callback and send it to the Web process along with scaleViewAndUpdateGeometryFenced.
2213
2214         * UIProcess/mac/WKViewLayoutStrategy.mm:
2215         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
2216         When called back, install the fence port in our CAContext; when the commit goes through,
2217         remove the transient scale as we did previously.
2218
2219         * WebProcess/WebPage/DrawingArea.h:
2220         (WebKit::DrawingArea::replyWithFenceAfterNextFlush):
2221         (WebKit::DrawingArea::updateGeometry): Deleted.
2222         * WebProcess/WebPage/WebPage.cpp:
2223         (WebKit::WebPage::scaleViewAndUpdateGeometryFenced):
2224         * WebProcess/WebPage/WebPage.h:
2225         * WebProcess/WebPage/WebPage.messages.in:
2226         Instead of installing a fence created in the UI process, tell the DrawingArea
2227         to create one and reply to the UI process with it after the next flush.
2228
2229         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2230         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2231         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2232         (WebKit::TiledCoreAnimationDrawingArea::replyWithFenceAfterNextFlush):
2233         After flushing, before committing, create a fence and reply to any
2234         callbacks that requested fences, and install it in our context.
2235
2236 2015-05-08  Michael Catanzaro  <mcatanzaro@igalia.com>, Martin Robinson <mrobinson@igalia.com>
2237
2238         [GTK] Checks for DEVELOPMENT_BUILD are all wrong
2239         https://bugs.webkit.org/show_bug.cgi?id=144746
2240
2241         Reviewed by Carlos Garcia Campos.
2242
2243         Use ENABLE(DEVELOPER_MODE) rather than DEVELOPMENT_BUILD.
2244
2245         * Shared/gtk/ProcessExecutablePathGtk.cpp:
2246         (WebKit::findWebKitProcess):
2247         * UIProcess/API/gtk/WebKitWebContext.cpp:
2248         (injectedBundleDirectory):
2249         * UIProcess/gtk/TextCheckerGtk.cpp:
2250         (WebKit::enchantTextChecker):
2251
2252 2015-05-08  Anders Carlsson  <andersca@apple.com>
2253
2254         Fix ProcessLauncher port leak
2255         https://bugs.webkit.org/show_bug.cgi?id=144807
2256         rdar://problem/20593291
2257
2258         Reviewed by Sam Weinig.
2259
2260         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2261         (WebKit::connectToService):
2262         xpc_dictionary_set_mach_send increments the send right count so make sure to
2263         balance it with a call to mach_port_deallocate.
2264
2265 2015-05-08  Beth Dakin  <bdakin@apple.com>
2266
2267         Fix performance tests after r183954
2268         https://bugs.webkit.org/show_bug.cgi?id=144805
2269
2270         Reviewed by Alexey Proskuryakov.
2271
2272         Web* is traditionally a WK1 prefix, so use the WK2 prefix instead in WK2 so that 
2273         we don’t have two classes with the same name in the two projects.
2274         * UIProcess/mac/WKImmediateActionController.mm:
2275         (-[WKImmediateActionController _defaultAnimationController]):
2276
2277 2015-05-08  Carlos Garcia Campos  <cgarcia@igalia.com>
2278
2279         [GTK] Expose allowFileAccessFromFileURLs setting to WebKit2 GTK+ API
2280         https://bugs.webkit.org/show_bug.cgi?id=144748
2281
2282         Reviewed by Sergio Villar Senin.
2283
2284         This is needed by local applications loaded as a file URI that do XMLHttpRequests.
2285
2286         * UIProcess/API/gtk/WebKitSettings.cpp:
2287         (webKitSettingsSetProperty):
2288         (webKitSettingsGetProperty):
2289         (webkit_settings_class_init):
2290         (webkit_settings_get_allow_file_access_from_file_urls):
2291         (webkit_settings_set_allow_file_access_from_file_urls):
2292         * UIProcess/API/gtk/WebKitSettings.h:
2293         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2294         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
2295
2296 2015-05-08  Andreas Kling  <akling@apple.com>
2297
2298         Optimize serialization of quoted JSON strings.
2299         <https://webkit.org/b/144754>
2300
2301         Reviewed by Darin Adler.
2302
2303         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2304         (WebKit::NetworkCache::Entry::asJSON): Use the new StringBuilder API.
2305
2306 2015-05-08  Commit Queue  <commit-queue@webkit.org>
2307
2308         Unreviewed, rolling out r183945.
2309         https://bugs.webkit.org/show_bug.cgi?id=144789
2310
2311         "It broke all the GTK+ tests" (Requested by KaL on #webkit).
2312
2313         Reverted changeset:
2314
2315         "[GTK] Checks for DEVELOPMENT_BUILD are all wrong"
2316         https://bugs.webkit.org/show_bug.cgi?id=144746
2317         http://trac.webkit.org/changeset/183945
2318
2319 2015-05-07  Conrad Shultz  <conrad_shultz@apple.com>
2320
2321         Don't register for Lookup notifications until needed
2322         https://bugs.webkit.org/show_bug.cgi?id=144783
2323
2324         Reviewed by Tim Horton.
2325
2326         * UIProcess/API/mac/WKView.mm:
2327         Add a WKViewData ivar to track whether we've already registered for popover notifications.
2328         (-[WKView _prepareForDictionaryLookup]):
2329         Added; moved notification registration from -[WKView initWithFrame:processPool:configuration:webView:.
2330         (-[WKView initWithFrame:processPool:configuration:webView:]):
2331         Move notification registration to -_prepareForDictionaryLookup.
2332
2333         * UIProcess/API/mac/WKViewInternal.h:
2334         Expose -_prepareForDictionaryLookup.
2335
2336         * UIProcess/mac/PageClientImpl.mm:
2337         (WebKit::PageClientImpl::didPerformDictionaryLookup):
2338         Send -[WKView _prepareForDictionaryLookup].
2339
2340         * UIProcess/mac/WKImmediateActionController.mm:
2341         (-[WKImmediateActionController _animationControllerForText]):
2342         Ditto.
2343
2344 2015-05-07  Commit Queue  <commit-queue@webkit.org>
2345
2346         Unreviewed, rolling out r183961.
2347         https://bugs.webkit.org/show_bug.cgi?id=144784
2348
2349         Broke js/dom/JSON-stringify.html (Requested by kling on
2350         #webkit).
2351
2352         Reverted changeset:
2353
2354         "Optimize serialization of quoted JSON strings."
2355         https://bugs.webkit.org/show_bug.cgi?id=144754
2356         http://trac.webkit.org/changeset/183961
2357
2358 2015-05-07  Anders Carlsson  <andersca@apple.com>
2359
2360         Build fixes.
2361
2362         * UIProcess/API/mac/WKView.mm:
2363         (-[WKView initWithFrame:processPool:configuration:webView:]):
2364         Use the regular init method.
2365
2366         * UIProcess/mac/WKSharingServicePickerDelegate.mm:
2367         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
2368         * WebProcess/WebPage/mac/WebPageMac.mm:
2369         (WebKit::WebPage::handleSelectionServiceClick):
2370         Pass empty dictionaries instead of nil.
2371
2372 2015-05-07  Chris Dumez  <cdumez@apple.com>
2373
2374         ASSERTION when pasting text into the WebInspector console
2375         https://bugs.webkit.org/show_bug.cgi?id=144774
2376
2377         Reviewed by Ryosuke Niwa.
2378
2379         Fix assertion in didChangeSelection() meant to check that calling
2380         editorState() does not cause a synchronous layout. The assertion
2381         was not correct as it was relying on FrameView::needsLayout() and
2382         we would hit it if calling editorState() would schedule a layout.
2383         Instead, the new assertion relies on FrameView::layoutCount(),
2384         which is more accurate.
2385
2386         * WebProcess/WebPage/WebPage.cpp:
2387         (WebKit::WebPage::didChangeSelection):
2388
2389 2015-05-07  Andreas Kling  <akling@apple.com>
2390
2391         Optimize serialization of quoted JSON strings.
2392         <https://webkit.org/b/144754>
2393
2394         Reviewed by Darin Adler.
2395
2396         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2397         (WebKit::NetworkCache::Entry::asJSON): Use the new StringBuilder API.
2398
2399 2015-05-07  Martin Robinson  <mrobinson@igalia.com>
2400
2401         Followup fixes to r183936
2402
2403         I neglected to include a few review comments when I landed the patch.
2404
2405         * UIProcess/gtk/TextCheckerGtk.cpp:
2406         (WebKit::checkerState): Remove double semicolons.
2407         (WebKit::updateStateForAllProcessPools): Use range-based-for loop here and
2408         give the function a better name.
2409         (WebKit::TextChecker::setContinuousSpellCheckingEnabled): Use new function name
2410         (WebKit::TextChecker::setGrammarCheckingEnabled):Use new function name
2411         (WebKit::TextChecker::ignoreWord): Fix unused parameter warning.
2412         (WebKit::updateStateForAllContexts): Deleted.
2413
2414 2015-05-07  Michael Catanzaro  <mcatanzaro@igalia.com>
2415
2416         [GTK] Checks for DEVELOPMENT_BUILD are all wrong
2417         https://bugs.webkit.org/show_bug.cgi?id=144746
2418
2419         Reviewed by Martin Robinson.
2420
2421         Use DEVELOPER_MODE rather than DEVELOPMENT_BUILD.
2422
2423         * Shared/gtk/ProcessExecutablePathGtk.cpp:
2424         (WebKit::findWebKitProcess):
2425         * UIProcess/API/gtk/WebKitWebContext.cpp:
2426         (injectedBundleDirectory):
2427         * UIProcess/gtk/TextCheckerGtk.cpp:
2428         (WebKit::enchantTextChecker):
2429
2430 2015-05-06  Dean Jackson  <dino@apple.com>
2431
2432         Handle backdrop views that have to tile
2433         https://bugs.webkit.org/show_bug.cgi?id=142317
2434         <rdar://problem/20049088>
2435
2436         Reviewed by Simon Fraser.
2437
2438         Take 2 - this was rolled out because Mavericks was crashing.
2439
2440         Add some better logging for custom appearance.
2441
2442         * Shared/mac/RemoteLayerTreeTransaction.mm:
2443         (WebKit::RemoteLayerTreeTextStream::operator<<):
2444
2445 2015-05-07  Sungmann Cho  <sungmann.cho@navercorp.com>
2446
2447         Add PLUGIN_ARCHITECTURE(X11) around m_frameRectInWindowCoordinates in NetscapePlugin.
2448         https://bugs.webkit.org/show_bug.cgi?id=144490
2449
2450         Reviewed by Darin Adler.
2451
2452         m_frameRectInWindowCoordinates in NetscapePlugin is currently being used only for
2453         the windowed plugins, and the windowed plugins are only supported on X11. So we can
2454         guard it with PLUGIN_ARCHITECTURE(X11).
2455
2456         No new tests, no behavior change.
2457
2458         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2459         (WebKit::NetscapePlugin::geometryDidChange):
2460         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2461
2462 2015-05-05  Myles C. Maxfield  <mmaxfield@apple.com>
2463
2464         Revert "Introducing the Platform Abstraction Layer (PAL)"
2465         https://bugs.webkit.org/show_bug.cgi?id=144751
2466
2467         Unreviewed.
2468
2469         PAL should be a new target inside WebCore, rather than a top-level folder.
2470
2471         * Configurations/FeatureDefines.xcconfig: Updated
2472
2473 2015-05-07  Jer Noble  <jer.noble@apple.com>
2474
2475         [WK2][Fullscreen] Fullscreen video does not enter low-power mode.
2476         https://bugs.webkit.org/show_bug.cgi?id=144744
2477
2478         Reviewed by Darin Adler.
2479
2480         One of the requirements of entering low-power compositing mode is that no masking layers
2481         are present in any of the ancestors of the fullscreen video layer. So once our fullscreen
2482         transition animation completes, remove the mask layer entirely from our clipping layer.
2483         This means it needs to be re-created and added when entering fullscreen, rather than just
2484         at initialization time.
2485
2486         * UIProcess/mac/WKFullScreenWindowController.mm:
2487         (-[WKFullScreenWindowController initWithWindow:webView:]):
2488         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
2489         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
2490
2491 2015-05-07  Martin Robinson  <mrobinson@igalia.com>
2492
2493         [GTK] All spell checking layout tests fail
2494         https://bugs.webkit.org/show_bug.cgi?id=144648
2495
2496         Reviewed by Carlos Garcia Campos.
2497
2498         Simplify and complete the GTK+ spell-checking implementation. Instead of using
2499         the EFL/GTK+ only WKTextChecker interface, directly implement Enchant spell-checking
2500         in TextCheckerGtk. The per-context spell checking API is an illusion, since all
2501         WKTextChecker implementations will adjust the same singleton. This can be a first step
2502         toward removing it entirely.
2503
2504         Also complete the implementation of the TextChecker interface by duplicating the EFL code,
2505         which reuses other methods in the same class. Eventually this duplication will collapse,
2506         once GTK+ and EFL can share an Enchant implementation.
2507
2508         * PlatformGTK.cmake:
2509         * UIProcess/API/gtk/WebKitPrivate.h:
2510         * UIProcess/API/gtk/WebKitTextChecker.cpp: Removed.
2511         * UIProcess/API/gtk/WebKitTextChecker.h: Removed.
2512         * UIProcess/API/gtk/WebKitWebContext.cpp: Remove WebTextChecker usage and
2513         replace it with calls directly to the TextChecker singleton via static methods.
2514         * UIProcess/TextChecker.h:
2515         * UIProcess/gtk/TextCheckerGtk.cpp: Move the WebTextChecker enchant implementation
2516         here and reuse the EFL version of WebKit::TextChecker::requestCheckingOfString.
2517         Also initialize languages properly when building for developer builds. This
2518         allows WebKitTestRunner to work even when it doesn't explicitly set the languages.
2519
2520 2015-05-07  Ada Chan  <adachan@apple.com>
2521
2522         Fix a couple of cases where the backForwardListState's currentIndex is not set correctly in WebBackForwardList::backForwardListState().
2523         https://bugs.webkit.org/show_bug.cgi?id=144666
2524
2525         Reviewed by Darin Adler.
2526
2527         * UIProcess/WebBackForwardList.cpp:
2528         (WebKit::WebBackForwardList::backForwardListState):
2529         If the first item is filtered out and the currentIndex is 0, don't decrement currentIndex.
2530         If all the items are filtered out, set currentIndex to the uninitialized value.
2531
2532 2015-05-07  Csaba Osztrogonác  <ossy@webkit.org>
2533
2534         [WK2] Remove Windows cruft
2535         https://bugs.webkit.org/show_bug.cgi?id=144745
2536
2537         Reviewed by Darin Adler.
2538
2539         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2540         (WebKit::getMemorySize):
2541         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
2542         (IPC::ArgumentCoder<WebCore::GraphicsSurfaceToken>::encode):
2543         (IPC::ArgumentCoder<WebCore::GraphicsSurfaceToken>::decode):
2544         * WebProcess/soup/WebProcessSoup.cpp:
2545         (WebKit::getMemorySize):
2546
2547 2015-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2548
2549         REGRESSION(r182032): [GTK] Production build is broken after r182032
2550         https://bugs.webkit.org/show_bug.cgi?id=144736
2551
2552         Reviewed by Martin Robinson.
2553
2554         The problem is that r182032 moved the NetworkProcess sources from
2555         WebKit2 sources to NetworkProcess sources. That's not a problem
2556         for developer builds where all internal symbols are exported, but
2557         doesn't work for production builds because all those internal
2558         symbols are private.
2559
2560         * CMakeLists.txt: Use a different name for common network process
2561         sources variable.
2562         * PlatformMac.cmake: Append common network process sources to the
2563         network process source list for Mac.
2564
2565 2015-05-07  Dan Bernstein  <mitz@apple.com>
2566
2567         <rdar://problem/19317140> [Xcode] Remove usage of AspenFamily.xcconfig in Source/
2568         https://bugs.webkit.org/show_bug.cgi?id=144727
2569
2570         Reviewed by Darin Adler.
2571
2572         * Configurations/Base.xcconfig: Don’t include AspenFamily.xcconfig, and define
2573         INSTALL_PATH_PREFIX and LD_DYLIB_INSTALL_NAME for the iOS 8.x Simulator.
2574         * Configurations/WebKit2.xcconfig: Define INSTALL_PATH_ACTUAL and let INSTALL_PATH be
2575         derived from it and INSTALL_PATH_PREFIX. Don’t override DYLIB_INSTALL_NAME_BASE for iOS,
2576         because we define LD_DYLIB_INSTALL_NAME directly where needed.
2577
2578 2015-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2579
2580         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.9.1 release.
2581
2582         * gtk/NEWS: Add release notes for 2.9.1.
2583
2584 2015-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2585
2586         [GTK] Remove dock button from Web Inspector window
2587         https://bugs.webkit.org/show_bug.cgi?id=144728
2588
2589         Reviewed by Sergio Villar Senin.
2590
2591         We added the dock buttons to the headerbar, because they were
2592         removed from the inspector toolbar, but with the new tabbed
2593         design, the dock buttons are back in the toolbar and look redundant.
2594
2595         * UIProcess/WebInspectorProxy.h:
2596         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2597         (WebKit::WebInspectorProxy::createInspectorWindow):
2598         (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
2599         (WebKit::WebInspectorProxy::dockButtonClicked): Deleted.
2600
2601 2015-05-06  Jer Noble  <jer.noble@apple.com>
2602
2603         [WK2][Fullscreen] Elements whose children extend beyond their bounds are clipped in fullscreen mode.
2604         https://bugs.webkit.org/show_bug.cgi?id=144716
2605
2606         Reviewed by Darin Adler.
2607
2608         We create a mask animation for the transition between windowed and fullscreen modes, on the
2609         assumption that the element being taken into fullscreen mode does not have visible children
2610         who extend beyond that elements bounds. This assumption breaks down in the case where div
2611         with absolutely positioned children is taken fullscreen. While we can't necessarily make the
2612         transition look correct in this case, we can remove the mask after the transition completes.
2613
2614         * UIProcess/mac/WKFullScreenWindowController.mm:
2615         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
2616         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
2617         (WebKit::removeAllMediaKeyStorageForOriginPath):
2618
2619 2015-05-06  Jinwoo Jeong  <jw00.jeong@samsung.com>
2620
2621         Fix a build break on EFL debug build
2622         https://bugs.webkit.org/show_bug.cgi?id=144654
2623
2624         Reviewed by Gyuyoung Kim.
2625
2626         No new tests, just build fix.
2627
2628         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2629         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
2630         (WebKit::CoordinatedGraphicsScene::paintToGraphicsContext):
2631
2632 2015-05-06  Daniel Bates  <dabates@apple.com>
2633
2634         [iOS][WK2] Pause/resume database thread when UIProcess enters/leaves the background
2635         https://bugs.webkit.org/show_bug.cgi?id=144657
2636         <rdar://problem/18894598>
2637
2638         Reviewed by Andy Estes.
2639
2640         Pause and resume the database thread when the UIProcess enters and leaves the background,
2641         respectively, so that we avoid WebProcess termination due to holding a locked SQLite
2642         database file when the WebProcess is suspended. This behavior matches the analagous
2643         behavior in Legacy WebKit.
2644
2645         * UIProcess/WebPageProxy.h:
2646         * UIProcess/ios/WKContentView.mm:
2647         (-[WKContentView _applicationDidEnterBackground:]): Call WebPageProxy::applicationDidEnterBackground()
2648         when the UIProcess enters the background.
2649         * UIProcess/ios/WebPageProxyIOS.mm:
2650         (WebKit::WebPageProxy::applicationDidEnterBackground): Added; notify the WebProcess to pause the database thread.
2651         We temporarily take out background assertion on the WebProcess before sending this notification to ensure that the
2652         WebProcess is running to receive it. We'll release this assertion when the WebProcess replies that it received the
2653         notification.
2654         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
2655         (WebKit::WebDatabaseManager::setPauseAllDatabases): Added; turns around and calls DatabaseManager::setPauseAllDatabases().
2656         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
2657         * WebProcess/WebPage/WebPage.h:
2658         * WebProcess/WebPage/WebPage.messages.in: Add message ApplicationDidEnterBackground(). Also,
2659         add empty lines to help demarcate this message and the other UIKit application lifecycle-related
2660         messages from the rest of the list of messages.
2661         * WebProcess/WebPage/ios/WebPageIOS.mm:
2662         (WebKit::WebPage::applicationWillEnterForeground): Resume the database thread.
2663         (WebKit::WebPage::applicationDidEnterBackground): Pause the database thread.
2664
2665 2015-05-06  Ryuan Choi  <ryuan.choi@navercorp.com>
2666
2667         [EFL] ewk_view_page_contents_get() API test is flaky
2668         https://bugs.webkit.org/show_bug.cgi?id=144683
2669
2670         Reviewed by Gyuyoung Kim.
2671
2672         Callback of WKPageGetContentsAsMHTMLData contains WKData which does not contain null terminated character.
2673
2674         * UIProcess/API/efl/ewk_view.cpp: Pass the data of string instead of WKData directly.
2675         (ewkViewPageContentsAsMHTMLCallback):
2676
2677 2015-05-06  Joseph Pecoraro  <pecoraro@apple.com>
2678
2679         Web Inspector: Docking Toolbar Buttons do not respect Docking Availability
2680         https://bugs.webkit.org/show_bug.cgi?id=144714
2681
2682         Reviewed by Timothy Hatcher.
2683
2684         * UIProcess/WebInspectorProxy.cpp:
2685         (WebKit::WebInspectorProxy::createInspectorPage):
2686         (WebKit::WebInspectorProxy::attachAvailabilityChanged):
2687         * WebProcess/WebPage/WebInspectorUI.cpp:
2688         (WebKit::WebInspectorUI::setDockingUnavailable):
2689         * WebProcess/WebPage/WebInspectorUI.h:
2690         * WebProcess/WebPage/WebInspectorUI.messages.in:
2691         When docking availability changes, inform the inspector page
2692         so it can respond by updating its UI.
2693
2694 2015-05-06  Joonghun Park  <jh718.park@samsung.com>
2695
2696         [WK2] Simplify AsyncRequestImpl::ArgumentType parameters
2697         https://bugs.webkit.org/show_bug.cgi?id=144689
2698
2699         Reviewed by Darin Adler.
2700
2701         Remove duplicated typename and ::type from AsyncRequestImpl related
2702         function parameters.
2703
2704         * Shared/AsyncRequest.h:
2705
2706 2015-05-06  Commit Queue  <commit-queue@webkit.org>
2707
2708         Unreviewed, rolling out r183894.
2709         https://bugs.webkit.org/show_bug.cgi?id=144719
2710
2711         crashes on mavericks (Requested by dino on #webkit).
2712
2713         Reverted changeset:
2714
2715         "Handle backdrop views that have to tile"
2716         https://bugs.webkit.org/show_bug.cgi?id=142317
2717         http://trac.webkit.org/changeset/183894
2718
2719 2015-05-06  Brady Eidson  <beidson@apple.com>
2720
2721         Addition review followup for:
2722         Crash executing null AsyncRequest in IDB code.
2723         <rdar://problem/18854856> and https://bugs.webkit.org/show_bug.cgi?id=144715
2724
2725         Reviewed by Darin Adler.
2726
2727         This patch adds a layer on top of the UniqueIDBDatabase request map to catch this coding mistake in the future. 
2728  
2729          * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
2730         (WebKit::UniqueIDBDatabase::didCompleteBoolRequest): Get rid of the ASSERT and the temporary variable,
2731           make it a single line which reads better.
2732         (WebKit::UniqueIDBDatabase::didPutRecordInBackingStore): Ditto.
2733         (WebKit::UniqueIDBDatabase::didGetRecordFromBackingStore): Ditto.
2734         (WebKit::UniqueIDBDatabase::didOpenCursorInBackingStore): Ditto.
2735         (WebKit::UniqueIDBDatabase::didAdvanceCursorInBackingStore): Ditto.
2736         (WebKit::UniqueIDBDatabase::didIterateCursorInBackingStore): Ditto.
2737         (WebKit::UniqueIDBDatabase::didCountInBackingStore): Ditto.
2738         (WebKit::UniqueIDBDatabase::didDeleteRangeInBackingStore): Ditto.
2739         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Ditto.
2740
2741         Add the class AsyncRequestMap which shadows a HashMap but does aggressive runtime checks
2742         in ::take() to make sure the same request was not dispatched twice in a row, and makes sure we
2743         never try to execute a null AsyncRequest by way of a RELEASE_ASSERT.
2744         * Shared/AsyncRequest.h:
2745         (WebKit::AsyncRequestMap::AsyncRequestMap):
2746         (WebKit::AsyncRequestMap::take):
2747         (WebKit::AsyncRequestMap::add):
2748         (WebKit::AsyncRequestMap::clear):
2749         (WebKit::AsyncRequestMap::values):
2750
2751 2015-05-06  Brady Eidson  <beidson@apple.com>
2752
2753         Crash executing null AsyncRequest in IDB code.
2754         <rdar://problem/18854856> and https://bugs.webkit.org/show_bug.cgi?id=144715
2755
2756         Reviewed by Darin Adler.
2757
2758         When UniqueIDBDatabase fails to execute an operation on the database work queue it usually
2759         dispatches an AsyncRequest ID back to the main thread with an error callback.
2760
2761         For two of its operations it would then also dispatch the success callback.
2762
2763         In those cases the main thread would first take the AsyncRequest for the error callback out
2764         of a map and then execute it.
2765
2766         It would then try to take the same AsyncRequest out of the map again, fail to do so, then
2767         execute a null AsyncRequest.
2768
2769         This patch fixes the two functions to not dispatch both an error and success callback.
2770
2771         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
2772         (WebKit::UniqueIDBDatabase::countInBackingStore): Return after dispatching the error callback.
2773         (WebKit::UniqueIDBDatabase::deleteRangeInBackingStore): Ditto.
2774
2775 2015-05-06  Dean Jackson  <dino@apple.com>
2776
2777         Handle backdrop views that have to tile
2778         https://bugs.webkit.org/show_bug.cgi?id=142317
2779         <rdar://problem/20049088>
2780
2781         Reviewed by Simon Fraser.
2782
2783         Add some better logging for custom appearance.
2784
2785         * Shared/mac/RemoteLayerTreeTransaction.mm:
2786         (WebKit::RemoteLayerTreeTextStream::operator<<):
2787
2788 2015-05-06  Chris Dumez  <cdumez@apple.com>
2789
2790         Disable network cache efficacy logging
2791         https://bugs.webkit.org/show_bug.cgi?id=144703
2792         <rdar://problem/20439143>
2793
2794         Reviewed by Andreas Kling.
2795
2796         Disable network cache efficacy logging by default as we have sufficient
2797         data for now.
2798
2799         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2800         (WebKit::registerUserDefaultsIfNeeded):
2801
2802 2015-05-06  Timothy Horton  <timothy_horton@apple.com>
2803
2804         Fix the build.
2805
2806         * UIProcess/mac/WKViewLayoutStrategy.mm:
2807         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
2808
2809 2015-05-06  Dan Bernstein  <mitz@apple.com>
2810
2811         No way to get a WKWebProcessPlugInFrame’s parent frame
2812         https://bugs.webkit.org/show_bug.cgi?id=144705
2813
2814         Reviewed by Sam Weinig.
2815
2816         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
2817         (-[WKWebProcessPlugInFrame _parentFrame]): Added this getter.
2818         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h: Declared new
2819         _parentFrame property.
2820
2821 2015-05-06  Timothy Horton  <timothy_horton@apple.com>
2822
2823         Fix the build.
2824
2825         * UIProcess/mac/WKViewLayoutStrategy.mm:
2826         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
2827
2828 2015-04-02  Myles C. Maxfield  <mmaxfield@apple.com>
2829
2830         Introducing the Platform Abstraction Layer (PAL)
2831         https://bugs.webkit.org/show_bug.cgi?id=143358
2832
2833         Reviewed by Simon Fraser.
2834
2835         * Configurations/FeatureDefines.xcconfig: Updated
2836
2837 2015-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2838
2839         [GTK][WK2] The WebKit network disk cache is not enabled
2840         https://bugs.webkit.org/show_bug.cgi?id=142821
2841
2842         Reviewed by Martin Robinson.
2843
2844         Enable NetworkCache for the GTK+ port.
2845
2846         * config.h:
2847
2848 2015-05-06  Ryuan Choi  <ryuan.choi@navercorp.com>
2849
2850         [EFL] Remove redudant condition in ViewClientEfl::didChangeViewportAttributes
2851         https://bugs.webkit.org/show_bug.cgi?id=144672
2852
2853         Reviewed by Gyuyoung Kim.
2854
2855         ViewClientEfl::didChangeViewportAttributes is always called when fixed layout is disabled.
2856
2857         * UIProcess/efl/ViewClientEfl.cpp:
2858         (WebKit::ViewClientEfl::didChangeViewportAttributes):
2859         Removes condition that checks whether fixed layout is enabled.
2860
2861 2015-05-05  Alexey Proskuryakov  <ap@apple.com>
2862
2863         NetworkResourceLoader::cleanup() should clear ResourceHandle client pointer.
2864         https://bugs.webkit.org/show_bug.cgi?id=144641
2865         rdar://problem/20250960
2866
2867         Reviewed by David Kilzer.
2868
2869         * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::cleanup):
2870         Clear the client pointer.
2871
2872         * Shared/Authentication/AuthenticationManager.cpp:
2873         (WebKit::AuthenticationManager::useCredentialForChallenge):
2874         (WebKit::AuthenticationManager::continueWithoutCredentialForChallenge):
2875         (WebKit::AuthenticationManager::cancelChallenge):
2876         (WebKit::AuthenticationManager::performDefaultHandling):
2877         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue):
2878         Updated comments, which were not accurate, at least on Mac.
2879
2880 2015-05-05  Tim Horton  <timothy_horton@apple.com>
2881
2882         Views get stuck with viewScale < 1 after switching from DynamicSizeWithMinimumViewSize to ViewSize
2883         https://bugs.webkit.org/show_bug.cgi?id=144656
2884
2885         Reviewed by Dan Bernstein.
2886
2887         * UIProcess/mac/WKViewLayoutStrategy.mm:
2888         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy willChangeLayoutStrategy]):
2889         Reset the viewScale when we leave the DynamicSizeWithMinimumViewSize strategy.
2890
2891 2015-05-05  Tim Horton  <timothy_horton@apple.com>
2892
2893         Fix the build.
2894
2895         * Platform/mac/LayerHostingContext.mm:
2896         (WebKit::LayerHostingContext::setFencePort):
2897
2898 2015-05-05  Tim Horton  <timothy_horton@apple.com>
2899
2900         Fix the build.
2901
2902         * UIProcess/mac/WKViewLayoutStrategy.mm:
2903         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
2904
2905 2015-05-05  Timothy Horton  <timothy_horton@apple.com>
2906
2907         Add a layout mode for computing fixed layout size from a minimum size
2908         https://bugs.webkit.org/show_bug.cgi?id=144610
2909         <rdar://problem/19790341>
2910
2911         Reviewed by Simon Fraser.
2912
2913         Add a layout mode where WebKit determines the layout size with a set of
2914         (still in flux) heuristics, trying hard to keep the page usable below a
2915         particular client-defined threshold view size.
2916
2917         This can mean that WebKit will start scaling down the page inside the view
2918         to make the whole page fit, using the viewScale mechanism.
2919
2920         * UIProcess/API/C/WKLayoutMode.h:
2921         * UIProcess/API/Cocoa/_WKLayoutMode.h:
2922         Add the new layout mode, and documentation for the two complicated ones.
2923         
2924         * UIProcess/API/Cocoa/WKWebView.mm:
2925         (-[WKWebView _layoutMode]):
2926         (-[WKWebView _setLayoutMode:]):
2927         (-[WKWebView _setViewScale:]):
2928         (-[WKWebView _setMinimumViewSize:]):
2929         (-[WKWebView _minimumViewSize]):
2930         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2931         Forward the layoutMode and viewScale parameters to WKView if we have one.
2932
2933         * UIProcess/API/Cocoa/WKViewPrivate.h:
2934         * UIProcess/API/mac/WKView.mm:
2935         (-[WKView dealloc]):
2936         (-[WKView viewWillStartLiveResize]):
2937         (-[WKView viewDidEndLiveResize]):
2938         (-[WKView setFrameSize:]):
2939         (-[WKView initWithFrame:processPool:configuration:webView:]):
2940         (-[WKView disableFrameSizeUpdates]):
2941         (-[WKView enableFrameSizeUpdates]):
2942         (-[WKView frameSizeUpdatesDisabled]):
2943         (-[WKView _layoutMode]):
2944         (-[WKView _setLayoutMode:]):
2945         (-[WKView _setViewScale:]):
2946         (-[WKView _setMinimumViewSize:]):
2947         (-[WKView _minimumViewSize]):
2948         Store the minimum view size, and update the fixed layout size if needed.
2949
2950         (-[WKView _updateAutomaticallyComputedFixedLayoutSize]): Deleted.
2951         (-[WKView _setAutomaticallyComputesFixedLayoutSizeFromViewScale:]): Deleted.
2952         (-[WKView _automaticallyComputesFixedLayoutSizeFromViewScale]): Deleted.
2953         Store the WKLayoutMode on the WKViewLayoutStrategy instead of having a
2954         bunch of things like _automaticallyComputesFixedLayoutSizeFromViewScale.
2955
2956         * UIProcess/API/mac/WKViewInternal.h:
2957
2958         * UIProcess/mac/WKViewLayoutStrategy.h: Added.
2959         * UIProcess/mac/WKViewLayoutStrategy.mm: Added.
2960         (+[WKViewLayoutStrategy layoutStrategyWithPage:view:mode:]):
2961         (-[WKViewLayoutStrategy initWithPage:view:mode:]):
2962         (-[WKViewLayoutStrategy willDestroyView:]):
2963         (-[WKViewLayoutStrategy layoutMode]):
2964         (-[WKViewLayoutStrategy updateLayout]):
2965         (-[WKViewLayoutStrategy disableFrameSizeUpdates]):
2966         (-[WKViewLayoutStrategy enableFrameSizeUpdates]):
2967         (-[WKViewLayoutStrategy frameSizeUpdatesDisabled]):
2968         (-[WKViewLayoutStrategy didChangeViewScale]):
2969         (-[WKViewLayoutStrategy didChangeMinimumViewSize]):
2970         (-[WKViewLayoutStrategy willStartLiveResize]):
2971         (-[WKViewLayoutStrategy didEndLiveResize]):
2972         (-[WKViewLayoutStrategy didChangeFrameSize]):
2973         (-[WKViewLayoutStrategy willChangeLayoutStrategy]):
2974         (-[WKViewViewSizeLayoutStrategy initWithPage:view:mode:]):
2975         (-[WKViewViewSizeLayoutStrategy updateLayout]):
2976         (-[WKViewFixedSizeLayoutStrategy initWithPage:view:mode:]):
2977         (-[WKViewFixedSizeLayoutStrategy updateLayout]):
2978         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy initWithPage:view:mode:]):
2979         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy updateLayout]):
2980         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy didChangeViewScale]):
2981         (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy didChangeFrameSize]):
2982         Move the existing layout strategies from WKView into WKViewLayoutStrategy subclasses.
2983
2984         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy initWithPage:view:mode:]):
2985         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy updateLayout]):
2986         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy didChangeMinimumViewSize]):
2987         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy willStartLiveResize]):
2988         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy didEndLiveResize]):
2989         While in live resize with the new layout mode, disable frame size updates.
2990         The new layout mode will do a live scale during part of the resize, and
2991         we don't always want to send the new view size to the Web process.
2992
2993         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy didChangeFrameSize]):
2994         (-[WKViewDynamicSizeWithMinimumViewSizeLayoutStrategy willChangeLayoutStrategy]):
2995         While in the new layout mode, maintain the viewScale as the minimum of the
2996         scale required to fit the current view frame size inside the minimumViewSize.
2997         If no scaling is required, carry on as usual, pushing the new view frame size
2998         to the DrawingArea and on to the Web process.
2999         If scaling is required, apply a transform to the view in the UI process,
3000         until the live resize completes, in which case we send a fenced viewScale
3001         adjustment to the Web process (so that the tiles paint at the new viewScale
3002         synchronized with the removal of the transform in the UI process).
3003
3004         * UIProcess/WebPageProxy.cpp:
3005         (WebKit::WebPageProxy::scaleViewFenced):
3006         * UIProcess/WebPageProxy.h:
3007         * WebProcess/WebPage/DrawingArea.h:
3008         (WebKit::DrawingArea::addFence):
3009         (WebKit::DrawingArea::acceleratedAnimationDidEnd): Deleted.
3010         * WebProcess/WebPage/WebPage.cpp:
3011         (WebKit::WebPage::scaleViewAndUpdateGeometryFenced):
3012         * WebProcess/WebPage/WebPage.h:
3013         * WebProcess/WebPage/WebPage.messages.in:
3014         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3015         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3016         (WebKit::TiledCoreAnimationDrawingArea::addFence):
3017         Add scaleViewAndUpdateGeometryFenced and the ability to install CoreAnimation fences on
3018         TiledCoreAnimationDrawingArea's CAContext.
3019
3020         Add the ability to send updateGeometry out-of-band, so that
3021         we can send it synchronously inside the message along with the CA fence.
3022         We have to both change the viewScale and updateGeometry simultaneously
3023         in the same CA commit that we install the fence into, in order to ensure
3024         that there is no flash.
3025
3026 2015-05-05  Alex Christensen  <achristensen@webkit.org>
3027
3028         [Content Extensions] Release input NSString when finished copying it.
3029         https://bugs.webkit.org/show_bug.cgi?id=144642
3030
3031         Reviewed by Brian Weinstein.
3032
3033         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
3034         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
3035         (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
3036
3037 2015-05-05  Alex Christensen  <achristensen@webkit.org>
3038
3039         [Content Extensions] Use less memory to store the json input.
3040         https://bugs.webkit.org/show_bug.cgi?id=144604
3041
3042         Reviewed by Benjamin Poulain.
3043
3044         * UIProcess/API/APIUserContentExtensionStore.cpp:
3045         (API::compiledToFile):
3046         (API::UserContentExtensionStore::compileContentExtension):
3047         * UIProcess/API/APIUserContentExtensionStore.h:
3048         Don't copy strings as much or keep them alive after done using them.
3049
3050 2015-05-04  Alex Christensen  <achristensen@webkit.org>
3051
3052         [Content Extensions] Use less memory when writing byte code to file
3053         https://bugs.webkit.org/show_bug.cgi?id=144602
3054
3055         Reviewed by Darin Adler.
3056
3057         * UIProcess/API/APIUserContentExtensionStore.cpp:
3058         (API::decodeContentExtensionMetaData):
3059         (API::writeDataToFile):
3060         (API::compiledToFile):
3061         (API::createExtension):
3062         Compile and write each DFA to file, then come back and write the header when finalizing.
3063         Also don't copy the DFA bytecode. This way, we don't need to keep more than one DFA's
3064         bytecode in memory at a time.
3065
3066 2015-05-05  Sungmann Cho  <sungmann.cho@navercorp.com>
3067
3068         Make all FrameLoadState data members private.
3069         https://bugs.webkit.org/show_bug.cgi?id=144562
3070
3071         Reviewed by Darin Adler.
3072
3073         Previously, all of the data members in FrameLoadState were public and accessed directly
3074         from outside the class. But these should all be private as noted in FrameLoadState.h
3075         for better encapsulation.
3076
3077         No new tests, no behavior change.
3078
3079         * UIProcess/API/C/WKFrame.cpp:
3080         (WKFrameGetFrameLoadState):
3081         * UIProcess/FrameLoadState.h:
3082         (WebKit::FrameLoadState::state):
3083         (WebKit::FrameLoadState::url):
3084         (WebKit::FrameLoadState::provisionalURL):
3085         (WebKit::FrameLoadState::unreachableURL):
3086         * UIProcess/WebFrameProxy.h:
3087         (WebKit::WebFrameProxy::url):
3088         (WebKit::WebFrameProxy::provisionalURL):
3089         (WebKit::WebFrameProxy::unreachableURL):
3090
3091 2015-05-05  Alexey Proskuryakov  <ap@apple.com>
3092
3093         Crashes in SandboxExtension::consumePermanently when uploading
3094         https://bugs.webkit.org/show_bug.cgi?id=144611
3095         rdar://problem/10156710
3096
3097         Reviewed by Darin Adler.
3098
3099         This only fixes the crashes, uploading still won't work.
3100         Added null checks and some logging that may help us get to the root cause eventually.
3101
3102         * Shared/SandboxExtension.h:
3103         (WebKit::SandboxExtension::createHandle):
3104         (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
3105         * Shared/mac/SandboxExtensionMac.mm:
3106         (WebKit::SandboxExtension::createHandle):
3107         (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
3108         * UIProcess/WebPageProxy.cpp:
3109         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
3110         * WebProcess/WebPage/WebPage.cpp:
3111         (WebKit::WebPage::extendSandboxForFileFromOpenPanel):
3112
3113 2015-05-05  Csaba Osztrogonác  <ossy@webkit.org>
3114
3115         Remove TextureMapperImageBuffer
3116         https://bugs.webkit.org/show_bug.cgi?id=143561
3117
3118         Reviewed by Žan Doberšek.
3119
3120         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3121         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
3122         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
3123         (WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing):
3124
3125 2015-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
3126
3127         [SOUP] Network Cache: IOChannel operations are not sent to the right thread
3128         https://bugs.webkit.org/show_bug.cgi?id=144542
3129
3130         Reviewed by Darin Adler.
3131
3132         We are ignoring the given WorkQueue and running the async
3133         operations in the current thread. Check the given WorkQueue
3134         instead and schedule the operation to the given queue. If the
3135         given queue is nullptr, which means the operation should be run in
3136         the main context, the operation is run directly if the current
3137         context is the main one or sent to the main context using a
3138         GMainLoopSource.
3139
3140         Fixes crashes due to asserts when running disk-cache layout tests
3141         in a Debug build.
3142
3143         * NetworkProcess/cache/NetworkCacheIOChannel.h:
3144         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
3145         (WebKit::NetworkCache::runTaskInQueue):
3146         (WebKit::NetworkCache::IOChannel::read):
3147         (WebKit::NetworkCache::IOChannel::readSync):
3148         (WebKit::NetworkCache::IOChannel::write):
3149
3150 2015-05-04  Dan Bernstein  <mitz@apple.com>
3151
3152         WebKit always goes through LaunchServices for main frame navigation actions
3153         https://bugs.webkit.org/show_bug.cgi?id=144608
3154
3155         Reviewed by Tim Horton.
3156
3157         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Defined
3158         _WKNavigationActionPolicyAllowWithoutTryingAppLink.
3159         * UIProcess/Cocoa/NavigationState.mm:
3160         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): If the policy
3161         is _WKNavigationActionPolicyAllowWithoutTryingAppLink, don’t go through tryAppLink.
3162
3163 2015-05-04  Enrica Casucci  <enrica@apple.com>
3164
3165         [iOS WK2] editorState should include information about selection clipping rectangle.
3166         https://bugs.webkit.org/show_bug.cgi?id=144603
3167         rdar://problem/20521252
3168
3169         Reviewed by Chris Dumez.
3170
3171         Adding selectionClipRect to the post-layout portion of EditorState.
3172         This way we can compute the selection clipping rectangle based on
3173         up-to-date information instead of using the rectangle provided when
3174         then element was first focused.
3175
3176         * Shared/EditorState.cpp:
3177         (WebKit::EditorState::PostLayoutData::encode):
3178         (WebKit::EditorState::PostLayoutData::decode):
3179         * Shared/EditorState.h:
3180         * UIProcess/ios/WKContentViewInteraction.mm:
3181         (-[WKContentView _selectionClipRect]):
3182         * WebProcess/WebPage/ios/WebPageIOS.mm:
3183         (WebKit::WebPage::platformEditorState):
3184
3185 2015-05-04  Antti Koivisto  <antti@apple.com>
3186
3187         Network Cache: Support time based cache clearing
3188         https://bugs.webkit.org/show_bug.cgi?id=144568
3189         <rdar://problem/19769820>
3190
3191         Reviewed by Andreas Kling.
3192
3193         Support clearing cache entries newer than given time only.
3194
3195         * NetworkProcess/cache/NetworkCache.cpp:
3196         (WebKit::NetworkCache::Cache::deleteDumpFile):
3197         (WebKit::NetworkCache::Storage::traverse):
3198
3199             Also fix thread safety of traverse handler function.
3200
3201         (WebKit::NetworkCache::Cache::clear):
3202
3203             Also add completion handler to support the API properly.
3204
3205         * NetworkProcess/cache/NetworkCache.h:
3206         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3207         (WebKit::NetworkCache::Storage::clear):
3208         * NetworkProcess/cache/NetworkCacheStorage.h:
3209         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3210         (WebKit::clearNSURLCache):
3211
3212             Factor to a function.
3213
3214         (WebKit::NetworkProcess::clearDiskCache):
3215
3216 2015-05-04  Zan Dobersek  <zdobersek@igalia.com>
3217
3218         [WTF] Remove Functional.h inclusions
3219         https://bugs.webkit.org/show_bug.cgi?id=144400
3220
3221         Reviewed by Darin Adler.
3222
3223         Remove unnecessary inclusions of the <wtf/Functional.h> header in WebKit2.
3224
3225         * Platform/IPC/unix/ConnectionUnix.cpp:
3226         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: Import the <objc/runtime.h>
3227         header that was previously indirectly included through the Functional.h header.
3228         * WebProcess/WebPage/DrawingArea.cpp:
3229
3230 2015-05-04  Csaba Osztrogonác  <ossy@webkit.org>
3231
3232         [ARM] Don't compare unsigned chars to EOF (-1)
3233         https://bugs.webkit.org/show_bug.cgi?id=144439
3234
3235         Reviewed by Geoffrey Garen.
3236
3237         * Shared/linux/WebMemorySamplerLinux.cpp:
3238         (WebKit::nextToken): Don't cast return value of fgetc() to char.
3239
3240 2015-05-04  Antti Koivisto  <antti@apple.com>
3241
3242         Remove NetworkResourceLoadScheduler
3243         https://bugs.webkit.org/show_bug.cgi?id=144550
3244
3245         Reviewed by Sam Weinig.
3246
3247         It doesn't really do anything.
3248
3249         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3250         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
3251         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
3252         * NetworkProcess/NetworkProcess.cpp:
3253         (WebKit::NetworkProcess::getNetworkProcessStatistics):
3254         * NetworkProcess/NetworkProcess.h:
3255         (WebKit::NetworkProcess::networkResourceLoadScheduler): Deleted.
3256         * NetworkProcess/NetworkResourceLoadScheduler.cpp: Removed.
3257         * NetworkProcess/NetworkResourceLoadScheduler.h: Removed.
3258         * NetworkProcess/NetworkResourceLoader.cpp:
3259         (WebKit::NetworkResourceLoader::cleanup):
3260         * NetworkProcess/NetworkResourceLoader.h:
3261         (WebKit::NetworkResourceLoader::create):
3262         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3263         (WebKit::initializeNetworkSettings):
3264
3265             Moved from NetworkResourceLoadSchedulerMac.mm.
3266
3267         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3268         * NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm: Removed.
3269         * NetworkProcess/soup/NetworkResourceLoadSchedulerSoup.cpp: Removed.
3270         * WebKit2.xcodeproj/project.pbxproj:
3271
3272 2015-05-03  Alexey Proskuryakov  <ap@apple.com>
3273
3274         Crash in SandboxExtension::consume when uploading iWork -tef documents to iCloud
3275         https://bugs.webkit.org/show_bug.cgi?id=144509
3276         rdar://problem/18731910
3277
3278         Reviewed by Daniel Bates.
3279
3280         No test, because testRunner.beginDragWithFiles doesn't work in WKTR, and making
3281         it work is hard.
3282
3283         * Shared/BlobDataFileReferenceWithSandboxExtension.cpp:
3284         (WebKit::BlobDataFileReferenceWithSandboxExtension::prepareForFileAccess):
3285         (WebKit::BlobDataFileReferenceWithSandboxExtension::revokeFileAccess):
3286
3287 2015-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3288
3289         [GTK][EFL] Unify platform display handling
3290         https://bugs.webkit.org/show_bug.cgi?id=144517
3291
3292         Reviewed by Martin Robinson.
3293
3294         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3295         (webkitWebViewBaseRealize): Use PlatformDisplay::sharedDisplay()
3296         to checkt the display type.
3297         (webkitWebViewBaseCreateWebPage): Ditto.
3298         * UIProcess/cairo/BackingStoreCairo.cpp:
3299         (WebKit::BackingStore::createBackend): Pass the native X11 shared
3300         display to BackingStoreBackendCairoX11.
3301         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
3302         (WebKit::NetscapePlugin::x11HostDisplay): Return the native X11
3303         shared display.
3304
3305 2015-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3306
3307         Unreviewed. Fix Debug build with NETWORK_CACHE enabled and CACHE_PARTITIONING disabled.
3308
3309         * NetworkProcess/cache/NetworkCache.cpp:
3310         (WebKit::NetworkCache::Cache::store):
3311
3312 2015-05-01  Dan Bernstein  <mitz@apple.com>
3313
3314         WebKit2 part of <rdar://problem/8636045> Back/forward navigation to an error page in Safari breaks the back-forward list
3315         https://bugs.webkit.org/show_bug.cgi?id=144501
3316
3317         Reviewed by Darin Adler.
3318
3319         * UIProcess/WebPageProxy.cpp:
3320         (WebKit::WebPageProxy::loadAlternateHTMLString): If this is called during
3321         didFailProvisionalLoadForFrame, send back the provisional URL captured at the time of
3322         failure.
3323         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame): Get the provisioinal URL and keep
3324         it in new member variable m_failingProvisionalLoadURL for the duration of the client’s
3325         handling of this message.
3326         * UIProcess/WebPageProxy.h:
3327
3328         * UIProcess/WebPageProxy.messages.in: Added provisionalURL parameter to
3329         DidFailProvisionalLoadForFrame.
3330
3331         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3332         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad): Send the URL for this error
3333         to the UI process.
3334
3335         * WebProcess/WebPage/WebPage.cpp:
3336         (WebKit::WebPage::loadAlternateHTMLString): Temporarily restore the loader’s state to
3337         reflect the provisional load error being handled.
3338
3339         * WebProcess/WebPage/WebPage.h:
3340         * WebProcess/WebPage/WebPage.messages.in: Added provisionalLoadErrorURL parameter to
3341         LoadAlternateHTMLString.
3342
3343 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
3344
3345         USE(...) macro should expect unprefixed variables
3346         https://bugs.webkit.org/show_bug.cgi?id=144454
3347
3348         Reviewed by Daniel Bates.
3349
3350         * Shared/API/c/WKBase.h: Replace all occurrences WTF_USE with USE.
3351         * WebKit2.xcodeproj/project.pbxproj: Ditto.
3352
3353 2015-05-01  Brady Eidson  <beidson@apple.com>
3354
3355         Add API to disable meta refreshes.
3356         <rdar://problem/20333198> and https://bugs.webkit.org/show_bug.cgi?id=144269
3357
3358         Reviewed by Alexey Proskuryakov.
3359
3360         Add a preference to enable/disable meta refreshes, enabled by default.
3361
3362         * Shared/WebPreferencesDefinitions.h:
3363         * UIProcess/API/C/WKPreferences.cpp:
3364         (WKPreferencesSetMetaRefreshEnabled):
3365         (WKPreferencesGetMetaRefreshEnabled):
3366         (WKPreferencesGetIgnoreViewportScalingConstraints): Deleted.
3367         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3368         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3369         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3370         * WebProcess/WebPage/WebPage.cpp:
3371         (WebKit::WebPage::updatePreferences):
3372
3373 2015-05-01  Antti Koivisto  <antti@apple.com>
3374
3375         Remove network process load serialization code
3376         https://bugs.webkit.org/show_bug.cgi?id=144448
3377
3378         Reviewed by Alexey Proskuryakov.
3379
3380         TestRunner.setSerializeHTTPLoads is used by a few tests but it is unnecessary
3381         with network process. We don't reorder loads anyway so test results are consistent.
3382         There or no other clients for this code.
3383
3384         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3385         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
3386         (WebKit::NetworkConnectionToWebProcess::setSerialLoadingEnabled): Deleted.
3387         * NetworkProcess/NetworkConnectionToWebProcess.h:
3388         (WebKit::NetworkConnectionToWebProcess::isSerialLoadingEnabled): Deleted.
3389         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3390         * NetworkProcess/NetworkProcess.cpp:
3391         (WebKit::NetworkProcess::getNetworkProcessStatistics):
3392         * NetworkProcess/NetworkResourceLoadScheduler.cpp:
3393         (WebKit::NetworkResourceLoadScheduler::scheduleLoader):
3394         (WebKit::NetworkResourceLoadScheduler::removeLoader):
3395         (WebKit::NetworkResourceLoadScheduler::loadsPendingCount): Deleted.
3396         * NetworkProcess/NetworkResourceLoadScheduler.h:
3397         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3398         (WKBundleSetTabKeyCyclesThroughElements):
3399         (WKBundleSetSerialLoadingEnabled): Deleted.
3400         (WKBundleDispatchPendingLoadRequests): Deleted.
3401         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
3402         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3403         (WebKit::InjectedBundle::setSerialLoadingEnabled): Deleted.
3404         (WebKit::InjectedBundle::dispatchPendingLoadRequests): Deleted.
3405
3406             Remove also this as it does nothing.
3407
3408         * WebProcess/Network/WebResourceLoadScheduler.cpp:
3409         (WebKit::WebResourceLoadScheduler::WebResourceLoadScheduler):
3410         (WebKit::WebResourceLoadScheduler::suspendPendingRequests):
3411         (WebKit::WebResourceLoadScheduler::resumePendingRequests):
3412
3413             Remove implementation, it does nothing.
3414
3415         (WebKit::WebResourceLoadScheduler::setSerialLoadingEnabled):
3416         * WebProcess/Network/WebResourceLoadScheduler.h:
3417
3418 2015-04-30  Timothy Horton  <timothy_horton@apple.com>
3419
3420         Remove long-deprecated unused WKView minimumLayoutWidth properties
3421         https://bugs.webkit.org/show_bug.cgi?id=144480
3422
3423         Reviewed by Alexey Proskuryakov.
3424
3425         * UIProcess/API/Cocoa/WKViewPrivate.h:
3426         * UIProcess/API/mac/WKView.mm:
3427         (-[WKView minimumLayoutWidth]): Deleted.
3428         (-[WKView setMinimumLayoutWidth:]): Deleted.
3429         (-[WKView minimumWidthForAutoLayout]): Deleted.
3430         (-[WKView setMinimumWidthForAutoLayout:]): Deleted.
3431         These were replaced with minimumSizeForAutoLayout long ago.
3432
3433 2015-04-30  Simon Fraser  <simon.fraser@apple.com>
3434
3435         Fixed elements end up in the middle of the view with pageScale < 1
3436         https://bugs.webkit.org/show_bug.cgi?id=144428
3437         rdar://problem/20404982
3438
3439         Reviewed by Tim Horton.
3440
3441         Encode/decode fixedElementsLayoutRelativeToFrame.
3442
3443         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
3444         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
3445         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
3446
3447 2015-04-30  Tim Horton  <timothy_horton@apple.com>
3448
3449         Asynchronous (or timed-out synchronous) resize flashes white instead of page background color
3450         https://bugs.webkit.org/show_bug.cgi?id=144468
3451
3452         Reviewed by Simon Fraser and Dan Bernstein.
3453
3454         * UIProcess/API/mac/WKView.mm:
3455         (-[WKView _viewBackgroundColor]):
3456         (-[WKView updateLayer]):
3457         Use the pageExtendedBackgroundColor for the background color of the WKView,
3458         if we have one (and aren't using a transparent background). This means
3459         during asynchronous resize or other cases where the Web process isn't keeping
3460         up with the UI process during a resize, we'll see background color instead of white.
3461
3462 2015-04-30  Beth Dakin  <bdakin@apple.com>
3463
3464         Should choose UIScrollView indicatorStyle based on the document background color
3465         https://bugs.webkit.org/show_bug.cgi?id=144473
3466         -and corresponding-
3467         rdar://problem/19897699
3468
3469         Reviewed by Simon Fraser.
3470
3471         Update the indicator style whenever the background color changes.