926edf43fe4673670408e2be4f030f0776fd54ec
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-05-25  David Kilzer  <ddkilzer@apple.com>
2
3         Add type-checked casts for TransformOperations
4         <http://webkit.org/b/133217>
5
6         Reviewed by Simon Fraser.
7
8         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
9         (IPC::ArgumentCoder<TransformOperations>::encode):
10         - Switch to type-checked casts.
11
12 2014-05-25  David Kilzer  <ddkilzer@apple.com>
13
14         Use type-checking FilterOperation casts in CoordinatedGraphicsArgumentCoders.cpp
15         <http://webkit.org/b/133203>
16
17         Reviewed by Simon Fraser.
18
19         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
20         (IPC::ArgumentCoder<WebCore::FilterOperations>::encode):
21         - Replace static_cast<>() operators with type-checking
22           FilterOperation casts.
23         - Replace 'default' statement with 'case' statements so new
24           filters added later require an explicit decision to be made.
25         (IPC::ArgumentCoder<WebCore::FilterOperations>::decode):
26         - Replace 'default' statement with 'case' statements so new
27           filters added later require an explicit decision to be made.
28
29 2014-05-24  Jon Honeycutt  <jhoneycutt@apple.com>
30
31         Potential null dereference in
32         WebFrameLoaderClient::dispatchDidFailProvisionalLoad()
33         <https://bugs.webkit.org/show_bug.cgi?id=133193>
34
35         WebFrameLoaderClient::dispatchDidFailProvisionalLoad() calls the
36         InjectedBundleLoaderClient's didFailProvisionalLoadWithErrorForFrame()
37         before sending a message to the UI process that a provisional load has
38         failed. It's possible for the provisional document loader to become
39         null while calling into the InjectedBundleLoaderClient (as is the case
40         with the WebKitTestRunner's injected bundle), leading to a null
41         dereference when trying to send the DidFailProvisionalLoadForFrame
42         message.
43
44         Reviewed by Darin Adler.
45
46         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
47         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
48         Get the navigation ID before calling into the injected bundle.
49
50 2014-05-23  Simon Fraser  <simon.fraser@apple.com>
51
52         Rename ScrollingTreeScrollingNode's m_scrollPosition to make it clear that it's the value committed from the state tree
53         https://bugs.webkit.org/show_bug.cgi?id=133254
54
55         Reviewed by Tim Horton.
56         
57         Override scrollPosition() on ScrollingTreeOverflowScrollingNodeIOS.
58
59         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
60         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
61         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition):
62
63 2014-05-24  Chris Fleizach  <cfleizach@apple.com>
64
65         AX: fix coordinate mapping for iOS accessibility
66         https://bugs.webkit.org/show_bug.cgi?id=133188
67
68         Reviewed by Sam Weinig.
69
70         Add in accessibility conversion methods that will check if the methods are present 
71         (if accessibility is not on, they won't be)
72         and use those to convert points into the right coordinate space that VoiceOver is expecting.
73
74         * UIProcess/PageClient.h:
75         * UIProcess/WebPageProxy.cpp:
76         (WebKit::WebPageProxy::accessibilityScreenToRootView):
77         (WebKit::WebPageProxy::rootViewToAccessibilityScreen):
78         * UIProcess/WebPageProxy.h:
79         * UIProcess/WebPageProxy.messages.in:
80         * UIProcess/ios/PageClientImplIOS.h:
81         * UIProcess/ios/PageClientImplIOS.mm:
82         (WebKit::PageClientImpl::accessibilityScreenToRootView):
83         (WebKit::PageClientImpl::rootViewToAccessibilityScreen):
84         * UIProcess/mac/PageClientImpl.h:
85         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
86         (WebKit::WebChromeClient::accessibilityScreenToRootView):
87         (WebKit::WebChromeClient::rootViewToAccessibilityScreen):
88         * WebProcess/WebCoreSupport/WebChromeClient.h:
89         * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
90         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
91         * WebProcess/WebPage/WebPage.cpp:
92         (WebKit::WebPage::accessibilityScreenToRootView):
93         (WebKit::WebPage::rootViewToAccessibilityScreen):
94         * WebProcess/WebPage/WebPage.h:
95
96 2014-05-24  Carlos Garcia Campos  <cgarcia@igalia.com>
97
98         REGRESSION(r165841): Messages sent before the child process is launched are never sent after r165841
99         https://bugs.webkit.org/show_bug.cgi?id=131675
100
101         Reviewed by Anders Carlsson.
102
103         Since r165841 the connection is opened after the pending messages
104         are sent, because connectionWillOpen might send messages that we
105         want to happen after the ones already pending. The problem is that
106         Connection::canSendOutgoingMessages() returns false when
107         connection hasn't been opened. We should ensure no messages are
108         sent by connectionWillOpen.
109
110         * Shared/ChildProcessProxy.cpp:
111         (WebKit::ChildProcessProxy::didFinishLaunching): Open the
112         connection before sending pending messages.
113         * UIProcess/WebPageProxy.cpp:
114         (WebKit::WebPageProxy::connectionWillOpen): Do not call
115         VisitedLinkProvider::addProcess() here because it tries to send a
116         message to the web process, but the connection hasn't be opened yet.
117         (WebKit::WebPageProxy::processDidFinishLaunching): Call
118         VisitedLinkProvider::addProcess() here instead.
119         * UIProcess/WebPageProxy.h:
120         * UIProcess/WebProcessProxy.cpp:
121         (WebKit::WebProcessProxy::didFinishLaunching): Call
122         WebPageProxy::processDidFinishLaunching() for every web page.
123
124 2014-05-23  Ian Henderson  <ianh@apple.com>
125
126         REGRESSION: Rubberbanding out jumps to top left corner on google.com
127         https://bugs.webkit.org/show_bug.cgi?id=133253
128         <rdar://problem/17025664>
129
130         Reviewed by Benjamin Poulain.
131
132         * UIProcess/API/Cocoa/WKWebView.mm:
133         (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
134         Avoid deceleration during zooming to work around a UIKit bug.
135
136 2014-05-23  Benjamin Poulain  <bpoulain@apple.com>
137
138         [iOS][WK2] Avoid updating the view from the viewport configuration unnecessarily
139         https://bugs.webkit.org/show_bug.cgi?id=133255
140         <rdar://problem/16890926>
141
142         Reviewed by Simon Fraser.
143
144         All the updates were mostly harmless since they are pretty cheap, but they can be
145         very annoying for debugging.
146
147         This patch skips viewportUpdates in the trivial cases.
148
149         * UIProcess/API/Cocoa/WKWebView.mm:
150         (-[WKWebView _setMinimumLayoutSizeOverride:]):
151         (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
152         * WebProcess/WebPage/WebPage.cpp:
153         (WebKit::WebPage::mainFrameDidLayout):
154         * WebProcess/WebPage/ios/WebPageIOS.mm:
155         (WebKit::WebPage::viewportPropertiesDidChange):
156
157 2014-05-23  Benjamin Poulain  <bpoulain@apple.com>
158
159         [iOS][WK2] The page scale factor randomly resets to initial scale when editing
160         https://bugs.webkit.org/show_bug.cgi?id=133244
161
162         Reviewed by Enrica Casucci.
163
164         We were never telling the WebProcess that zoom is used triggered. As a result, the ViewportConfiguration was free
165         to reset the scale whenever it felt like it. The fix is to call willStartUserTriggeredZoom before changing the scale.
166
167         This patch also split _willStartUserTriggeredScrollingOrZooming from willStartUserTriggeredZoom
168         and rename it to willStartPanOrPinchGesture. This is just a tiny cleanup since the only thing left in _willStartUserTriggeredScrollingOrZooming
169         was gesture related.
170
171         * UIProcess/API/Cocoa/WKWebView.mm:
172         (-[WKWebView _zoomToFocusRect:WebCore::selectionRect:WebCore::fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
173         (-[WKWebView scrollViewWillBeginZooming:withView:]):
174         (-[WKWebView scrollViewWillBeginDragging:]):
175         * UIProcess/API/Cocoa/WKWebViewInternal.h:
176         * UIProcess/API/ios/WKViewIOS.mm:
177         (-[WKView scrollViewWillBeginDragging:]):
178         * UIProcess/ios/WKContentView.h:
179         * UIProcess/ios/WKContentView.mm:
180         (-[WKContentView willStartUserTriggeredZoom]):
181         (-[WKContentView willStartUserTriggeredScroll]): Deleted.
182         * UIProcess/ios/WKContentViewInteraction.h:
183         * UIProcess/ios/WKContentViewInteraction.mm:
184         (-[WKContentView willStartPanOrPinchGesture]):
185         (-[WKContentView _willStartUserTriggeredScrollingOrZooming]): Deleted.
186
187 2014-05-23  Tim Horton  <timothy_horton@apple.com>
188
189         REGRESSION (iOS WebKit2): requestAnimationFrame fires more than once between layer tree commits
190         https://bugs.webkit.org/show_bug.cgi?id=132794
191         <rdar://problem/16877909>
192
193         Reviewed by Simon Fraser.
194
195         * WebKit2.xcodeproj/project.pbxproj:
196         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
197         (WebKit::WebChromeClient::createDisplayRefreshMonitor):
198         * WebProcess/WebCoreSupport/WebChromeClient.h:
199         * WebProcess/WebPage/DrawingArea.h:
200         (WebKit::DrawingArea::graphicsLayerFactory):
201         (WebKit::DrawingArea::createDisplayRefreshMonitor):
202         Plumb the DisplayRefreshMonitor request through to the DrawingArea.
203         RemoteLayerTreeDrawingArea will implement and return a RemoteLayerTreeDisplayRefreshMonitor.
204
205         * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.h: Added.
206         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::create):
207         * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.mm: Added.
208         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::RemoteLayerTreeDisplayRefreshMonitor):
209         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::~RemoteLayerTreeDisplayRefreshMonitor):
210         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::requestRefreshCallback):
211         When requesting a display refresh callback, schedule a layer commit.
212         It may end up being empty, but will still call us back with a didUpdate,
213         upon which we'll fire the callback.
214
215         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::didUpdateLayers):
216
217         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
218         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
219         (WebKit::RemoteLayerTreeDrawingArea::createDisplayRefreshMonitor):
220         (WebKit::RemoteLayerTreeDrawingArea::willDestroyDisplayRefreshMonitor):
221         Keep track of the set of DisplayRefreshMonitors.
222
223         (WebKit::RemoteLayerTreeDrawingArea::didUpdate):
224         Fire requestAnimationFrame callbacks once the UI process commits the new layer tree.
225
226 2014-05-23  Jeremy Jones  <jeremyj@apple.com>
227
228         Hide fullscreen immediately when switching tabs.
229         https://bugs.webkit.org/show_bug.cgi?id=133239
230
231         Reviewed by Eric Carlson.
232
233         Renamed a function to better describe it's new functionality.
234
235         * UIProcess/WebPageProxy.cpp:
236         (WebKit::WebPageProxy::viewStateDidChange):
237         now calls: requestHideAndExitFullscreen
238
239 2014-05-23  Enrica Casucci  <enrica@apple.com>
240
241         REGRESSION (WebKit2): Keyboard disappears/appears automatically between text boxes.
242         https://bugs.webkit.org/show_bug.cgi?id=133243
243         <rdar://problem/16761913>
244
245         Reviewed by Benjamin Poulain.
246
247         We need to ensure that when an element loses focus and another one gets it,
248         this is handled in one single message in the UI process to avoid seeing
249         the keyboard animating in and out.
250         This is accomplished by always postponing the blur notification until all events
251         have been processed.
252         If a new node is focused before the delayed blur notification is sent to the UI
253         process, the message we send includes both blur and focus notification. In this case,
254         the postponed blur notification is not sent.
255
256         * UIProcess/PageClient.h:
257         * UIProcess/WebPageProxy.h:
258         * UIProcess/WebPageProxy.messages.in:
259         * UIProcess/ios/PageClientImplIOS.h:
260         * UIProcess/ios/PageClientImplIOS.mm:
261         (WebKit::PageClientImpl::startAssistingNode):
262         * UIProcess/ios/WKContentViewInteraction.h:
263         * UIProcess/ios/WKContentViewInteraction.mm:
264         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
265         (-[WKContentView _startAssistingNode:userIsInteracting:userObject:]): Deleted.
266         * UIProcess/ios/WebPageProxyIOS.mm:
267         (WebKit::WebPageProxy::startAssistingNode):
268         * WebProcess/WebPage/WebPage.cpp:
269         (WebKit::WebPage::WebPage):
270         * WebProcess/WebPage/WebPage.h:
271         * WebProcess/WebPage/ios/WebPageIOS.mm:
272         (WebKit::WebPage::elementDidFocus):
273         (WebKit::WebPage::elementDidBlur):
274
275 2014-05-23  Anders Carlsson  <andersca@apple.com>
276
277         Remove an assertion.
278
279         * WebProcess/WebPage/WebPage.cpp:
280         (WebKit::WebPage::loadRequest):
281
282 2014-05-23  Tim Horton  <timothy_horton@apple.com>
283
284         [iOS] WKPDFView should have a page indicator
285         https://bugs.webkit.org/show_bug.cgi?id=133109
286         <rdar://problem/16383003>
287
288         Reviewed by Anders Carlsson.
289
290         * UIProcess/API/Cocoa/WKWebView.mm:
291         (-[WKWebView _setHasCustomContentView:loadedMIMEType:WTF::]):
292         (-[WKWebView _setObscuredInsets:]):
293         Forward obscured insets changes to the custom content view.
294
295         (-[WKWebView _updateScrollViewBackground]):
296         If we have a custom content view, use its background instead of the
297         (likely nonexistent) page's when updaing the scroll view's background color.
298
299         * UIProcess/API/Cocoa/WKWebViewInternal.h:
300         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
301         * UIProcess/Cocoa/WKWebViewContentProvider.h:
302         * UIProcess/Cocoa/WKWebViewContentProviderDelegate.h: Added.
303         * UIProcess/API/Cocoa/WKWebView.mm:
304         (-[WKWebView _setInsetForOverlaidAccessoryViews:]):
305         Add SPI for clients to inform us about potential overlaid accessory views
306         which should be taken into account e.g. for positioning the page indicator.
307
308         Add a view that sits fixed on top of the WKWebView, ignores interaction,
309         but provides the WKWebViewContentProvider a place to install views
310         that don't scroll along with the content.
311
312         * UIProcess/ios/WKPDFPageNumberIndicator.h: Added.
313         * UIProcess/ios/WKPDFPageNumberIndicator.mm: Added.
314         (-[WKPDFPageNumberIndicator initWithFrame:]):
315         (-[WKPDFPageNumberIndicator dealloc]):
316         (-[WKPDFPageNumberIndicator setCurrentPageNumber:]):
317         (-[WKPDFPageNumberIndicator setPageCount:]):
318         (-[WKPDFPageNumberIndicator show]):
319         (-[WKPDFPageNumberIndicator hide:]):
320         (-[WKPDFPageNumberIndicator moveToPoint:animated:]):
321         (-[WKPDFPageNumberIndicator sizeThatFits:]):
322         (-[WKPDFPageNumberIndicator _updateLabel]):
323         (-[WKPDFPageNumberIndicator _makeRoundedCorners]):
324         Add a page number indicator.
325
326         * UIProcess/ios/WKPDFView.mm:
327         (-[WKPDFView dealloc]):
328         (-[WKPDFView web_setScrollView:]):
329         (-[WKPDFView _revalidateViews]):
330         (-[WKPDFView _offsetForPageNumberIndicator]):
331         (-[WKPDFView _updatePageNumberIndicator]):
332         (-[WKPDFView web_setObscuredInsets:]):
333         (-[WKPDFView web_setInsetForOverlaidAccessoryViews:]):
334         (-[WKPDFView web_setFixedOverlayView:]):
335         (-[WKPDFView _computePageAndDocumentFrames]):
336         Update the page number indicator when the topmost visible page changes.
337         Move the page number indicator around when the obscured insets change.
338
339         * WebKit2.xcodeproj/project.pbxproj:
340
341 2014-05-23  Anders Carlsson  <andersca@apple.com>
342
343         Fix test failures on the bot.
344
345         * UIProcess/API/Cocoa/WKProcessPool.mm:
346         (websiteDataDirectoryURL):
347         If we have no bundle identifier, use the process name.
348
349 2014-05-23  Enrica Casucci  <enrica@apple.com>
350
351         REGRESSION (iOS WebKit2): Autocorrection is not accurate when changing selection.
352         https://bugs.webkit.org/show_bug.cgi?id=133237
353         <rdar://problem/16655776>
354
355         Reviewed by Ryosuke Niwa.
356
357         * UIProcess/ios/WKContentViewInteraction.mm:
358         (-[WKContentView beginSelectionChange]):
359         (-[WKContentView endSelectionChange]):
360
361         When the selection is changed with a gesture in an editable element,
362         we must notify the keyboard to make sure the autocorrection engine 
363         updates its typing context. WKContentView must implement
364         beginSelectionChange and endSelectionChange to call into
365         the keyboard layer.
366
367 2014-05-22  Brent Fulgham  <bfulgham@apple.com>
368
369         [iOS] WK2: Provide implementation for windowFrame
370         https://bugs.webkit.org/show_bug.cgi?id=133205
371         <rdar://problem/16894890>
372
373         Reviewed by Benjamin Poulain.
374
375         * UIProcess/Cocoa/UIDelegate.h:
376         * UIProcess/Cocoa/UIDelegate.mm:
377         (WebKit::UIDelegate::UIClient::windowFrame): Added.
378         * UIProcess/ios/PageClientImplIOS.mm:
379         (WebKit::PageClientImpl::convertToUserSpace): Added.
380
381 2014-05-20  Anders Carlsson  <andersca@apple.com>
382
383         Use a per app directory structure for website data
384         https://bugs.webkit.org/show_bug.cgi?id=133125
385         <rdar://problem/16830143>
386
387         Reviewed by Dan Bernstein, Sam Weinig and Tim Horton.
388
389         Put website data in subdirectories of ~/Library/WebKit/<bundle ID>/WebsiteData.
390         We use "LocalStorage", "WebSQL", and "IndexedDB" subdirectories.
391
392         * UIProcess/API/Cocoa/WKProcessPool.mm:
393         (websiteDataDirectoryURL):
394         (-[WKProcessPool _initWithConfiguration:]):
395
396 2014-05-23  Dan Bernstein  <mitz@apple.com>
397
398         [Cocoa] WKNavigationResponsePrivate.h is internal
399         https://bugs.webkit.org/show_bug.cgi?id=133218
400
401         Reviewed by Dean Jackson.
402
403         * WebKit2.xcodeproj/project.pbxproj: Promote WKNavigationResponsePrivate.h to private.
404
405 2014-05-23  Carlos Garcia Campos  <cgarcia@igalia.com>
406
407         [UNIX] Reorganize and cleanup main functions of GTK and EFL ports
408         https://bugs.webkit.org/show_bug.cgi?id=131024
409
410         Reviewed by Gustavo Noronha Silva.
411
412         Move main function implementation files to <process-dir>/EntryPoint/unix/<ProcessName>Main.cpp
413         files that are now shared by GTK and EFL ports. These files call a
414         main method that wraps a new method ChildProcessMain that contains
415         the common code and uses a helper class for the platform specific
416         code. GTK+ and EFL ports implement that helper class for every process type.
417
418         * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp: Renamed from Source/WebKit2/efl/MainEfl.cpp.
419         (main):
420         * NetworkProcess/efl/NetworkProcessMainEfl.cpp: Renamed from Source/WebKit2/unix/NetworkMainUnix.cpp.
421         (WebKit::NetworkProcessMainUnix):
422         * NetworkProcess/gtk/NetworkProcessMainGtk.cpp: Renamed from Source/WebKit2/NetworkProcess/unix/NetworkProcessMainUnix.cpp.
423         (WebKit::NetworkProcessMainUnix):
424         * NetworkProcess/unix/NetworkProcessMainUnix.h:
425         * PlatformEfl.cmake:
426         * PlatformGTK.cmake:
427         * PluginProcess/EntryPoint/unix/PluginProcessMain.cpp: Renamed from Source/WebKit2/unix/PluginMainUnix.cpp.
428         (main):
429         * PluginProcess/unix/PluginProcessMainUnix.cpp:
430         (WebKit::webkitXError):
431         (WebKit::PluginProcessMainUnix):
432         * PluginProcess/unix/PluginProcessMainUnix.h:
433         * Shared/unix/ChildProcessMain.cpp: Copied from Source/WebKit2/WebProcess/efl/WebProcessMainEfl.h.
434         (WebKit::ChildProcessMainBase::parseCommandLine):
435         * Shared/unix/ChildProcessMain.h: Renamed from Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.h.
436         (WebKit::ChildProcessMainBase::platformInitialize):
437         (WebKit::ChildProcessMainBase::platformFinalize):
438         (WebKit::ChildProcessMainBase::initializationParameters):
439         (WebKit::ChildProcessMain):
440         * WebProcess/EntryPoint/unix/WebProcessMain.cpp: Renamed from Source/WebKit2/gtk/MainGtk.cpp.
441         (main):
442         * WebProcess/efl/WebProcessMainEfl.cpp:
443         (WebKit::WebProcessMainUnix):
444         (dummyExtensionErrorHandler): Deleted.
445         * WebProcess/gtk/WebProcessMainGtk.cpp:
446         (WebKit::WebProcessMainUnix):
447         * WebProcess/unix/WebProcessMainUnix.h: Renamed from Source/WebKit2/WebProcess/efl/WebProcessMainEfl.h.
448
449 2014-05-22  Zan Dobersek  <zdobersek@igalia.com>
450
451         Have the decoded element in VectorArgumentCoder::decode() moved into Vector::append()
452         https://bugs.webkit.org/show_bug.cgi?id=133082
453
454         Reviewed by Andreas Kling.
455
456         * Platform/IPC/ArgumentCoders.h: Move the decoded element into the Vector::append() call.
457         This enforces a move instead of a copy if the decoded element's type is move-constructible.
458
459 2014-05-22  Zan Dobersek  <zdobersek@igalia.com>
460
461         Move the passed-in Vector<Attachment> in MessageDecoder constructor down into ArgumentDecoder
462         https://bugs.webkit.org/show_bug.cgi?id=133080
463
464         Reviewed by Andreas Kling.
465
466         * Platform/IPC/MessageDecoder.cpp:
467         (IPC::MessageDecoder::MessageDecoder): The Vector<Attachment> object was passed in by value.
468         Move it into the ArgumentDecoder constructor as it is not used elsewhere in this constructor
469         and produces a copy otherwise.
470
471 2014-05-22  Benjamin Poulain  <bpoulain@apple.com>
472
473         [iOS][WK2] Add support for minimal-ui viewports
474         https://bugs.webkit.org/show_bug.cgi?id=133162
475
476         Reviewed by Simon Fraser.
477
478         In the WebKit2 layers, we have two parts to minimal-ui.
479         -In WebPage, we need to get the values from the UIProcess and setup the ViewportConfiguration.
480          Another part is freezing the state on page load.
481         -In the UIProcess, we need to get the right information for layout and styling, and we need to tell
482          the UI clients about minimal-ui changes.
483
484         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
485         * UIProcess/API/Cocoa/WKWebView.mm:
486         (-[WKWebView _setUsesMinimalUI:]):
487         (-[WKWebView _usesMinimalUI]):
488         (-[WKWebView _didCommitLayerTree:WebKit::]):
489         (-[WKWebView _frameOrBoundsChanged]):
490         (-[WKWebView _minimumLayoutSizeOverride]):
491         (-[WKWebView _setMinimumLayoutSizeOverride:]):
492         (-[WKWebView _minimumLayoutSizeOverrideForMinimalUI]):
493         (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
494         (-[WKWebView _largestUnobscuredSizeOverride]):
495         (-[WKWebView _setMaximumUnobscuredSizeOverride:]):
496         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
497         (setViewportConfigurationMinimumLayoutSize): Deleted.
498         * UIProcess/API/Cocoa/WKWebViewInternal.h:
499         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
500         * UIProcess/PageClient.h:
501         * UIProcess/WebPageProxy.h:
502         * UIProcess/WebPageProxy.messages.in:
503         * UIProcess/ios/PageClientImplIOS.h:
504         * UIProcess/ios/PageClientImplIOS.mm:
505         (WebKit::PageClientImpl::setUsesMinimalUI):
506         * UIProcess/ios/WebPageProxyIOS.mm:
507         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
508         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSizeForMinimalUI):
509         (WebKit::WebPageProxy::setMaximumUnobscuredSize):
510         (WebKit::WebPageProxy::setUsesMinimalUI):
511         (WebKit::WebPageProxy::setMinimumLayoutSizeForMinimalUI): Deleted.
512         * WebProcess/WebPage/WebPage.cpp:
513         (WebKit::WebPage::WebPage):
514         (WebKit::WebPage::didCommitLoad):
515         * WebProcess/WebPage/WebPage.h:
516         * WebProcess/WebPage/WebPage.messages.in:
517         * WebProcess/WebPage/ios/WebPageIOS.mm:
518         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSizeForMinimalUI):
519         (WebKit::WebPage::setMaximumUnobscuredSize):
520         (WebKit::WebPage::willFlushLayers):
521         (WebKit::WebPage::dynamicViewportSizeUpdate):
522         (WebKit::WebPage::viewportConfigurationChanged):
523         (WebKit::WebPage::updateViewportSizeForCSSViewportUnits):
524         (WebKit::WebPage::setMinimumLayoutSizeForMinimalUI): Deleted.
525         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
526         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
527
528 2014-05-22  Benjamin Poulain  <bpoulain@apple.com>
529
530         [iOS][WK2] Reset the special action-target of WKSyntheticClickTapGestureRecognizer on destruction
531         https://bugs.webkit.org/show_bug.cgi?id=133165
532         <rdar://problem/16283914>
533
534         Reviewed by Andy Estes.
535
536         It is unclear why, but the WKSyntheticClickTapGestureRecognizer sometimes survives its own view
537         and is reset after WKContentView was destructed.
538         This patch cleans up the target-action on destruction to avoid accessing a destructed object.
539
540         * UIProcess/ios/WKContentViewInteraction.mm:
541         (-[WKContentView cleanupInteraction]):
542
543 2014-05-22  Benjamin Poulain  <bpoulain@apple.com>
544
545         Do not force a layout when changing the FixedLayoutSize in WebPage
546         https://bugs.webkit.org/show_bug.cgi?id=133167
547
548         Reviewed by Andreas Kling.
549
550         WebPage::setFixedLayoutSize was forcing a layout immediately after changing the layout size on FrameView.
551         This is forcing plenty of extra layouts since the fixed layout size is one of many properties updated on the FrameView.
552
553         FrameView marks that layout is needed. It is not clear why a layout was performed immediately.
554
555         * WebProcess/WebPage/WebPage.cpp:
556         (WebKit::WebPage::setFixedLayoutSize):
557
558 2014-05-22  Andreas Kling  <akling@apple.com>
559
560         [iOS WebKit2] Web process should try to shrink its memory footprint when going into background.
561         <https://webkit.org/b/133197>
562         <rdar://problem/17011561>
563
564         Try to free up as much memory as possible before going into background.
565
566         Reviewed by Gavin Barraclough.
567
568         * WebProcess/WebProcess.cpp:
569         (WebKit::WebProcess::processWillSuspend):
570
571 2014-05-22  Andreas Kling  <akling@apple.com>
572
573         Hook up a setting for showing detailed logging during memory pressure relief.
574         <https://webkit.org/b/133194>
575
576         Plumb through the same setting that we used for detailed logging in WK1.
577
578         Reviewed by Gavin Barraclough.
579
580         * Shared/WebProcessCreationParameters.cpp:
581         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
582         (WebKit::WebProcessCreationParameters::encode):
583         (WebKit::WebProcessCreationParameters::decode):
584         * Shared/WebProcessCreationParameters.h:
585         * UIProcess/mac/WebContextMac.mm:
586         (WebKit::WebContext::platformInitializeWebProcess):
587         * WebProcess/cocoa/WebProcessCocoa.mm:
588         (WebKit::WebProcess::platformInitializeWebProcess):
589
590 2014-05-22  Andy Estes  <aestes@apple.com>
591
592         [iOS] Send shareable resources to QuickLook if enabled
593         https://bugs.webkit.org/show_bug.cgi?id=133189
594         <rdar://problem/17003995>
595
596         Reviewed by Brady Eidson.
597
598         Like we do for didReceiveData(), we need to pass an incoming ShareableResource to QuickLook if a QuickLook
599         handle exists.
600
601         * Shared/ShareableResource.cpp:
602         (WebKit::ShareableResource::Handle::tryWrapInCFData): Return the shared resource in a CFDataRef.
603         (WebKit::ShareableResource::Handle::tryWrapInSharedBuffer): Implemented in terms of tryWrapInCFData().
604         * Shared/ShareableResource.h:
605         * WebProcess/Network/WebResourceLoader.cpp:
606         (WebKit::WebResourceLoader::didReceiveResource): If a QuickLook handle exists, send the shareable resource to
607         it via a CFDataRef.
608
609 2014-05-22  Martin Hock  <mhock@apple.com>
610
611         [iOS] Enable -apple-system- styled elements to respond to system font size changes.
612         https://bugs.webkit.org/show_bug.cgi?id=133186
613         <rdar://problem/16583782>
614
615         Reviewed by Enrica Casucci.
616
617         * UIProcess/API/Cocoa/WKWebView.mm:
618         (-[WKWebView initWithFrame:configuration:]):
619         (-[WKWebView _contentSizeCategoryDidChange:]):
620         (-[WKWebView _contentSizeCategory]):
621         * UIProcess/WebPageProxy.h:
622         * UIProcess/ios/WebPageProxyIOS.mm:
623         (WebKit::WebPageProxy::contentSizeCategoryDidChange):
624         * WebProcess/WebPage/WebPage.h:
625         * WebProcess/WebPage/WebPage.messages.in:
626         * WebProcess/WebPage/ios/WebPageIOS.mm:
627         (WebKit::WebPage::contentSizeCategoryDidChange):
628
629 2014-05-22  Alexey Proskuryakov  <ap@apple.com>
630
631         [iOS] Add CFBundleAllowMixedLocalizations to WebContentService
632         https://bugs.webkit.org/show_bug.cgi?id=133187
633         <rdar://problem/16561084>
634
635         Reviewed by Tim Horton.
636
637         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:
638         We already had it in WebContentService.Development, just not here.
639
640 2014-05-22  Alexey Proskuryakov  <ap@apple.com>
641
642         [iOS][WK2] Application cache is broken
643         https://bugs.webkit.org/show_bug.cgi?id=133172
644         <rdar://problem/16994593>
645
646         Reviewed by Andy Estes.
647
648         * UIProcess/mac/WebContextMac.mm:
649         (WebKit::WebContext::platformDefaultApplicationCacheDirectory): Use a proper
650         path for application cache database (same as WebKit1).
651
652 2014-05-22  Enrica Casucci  <enrica@apple.com>
653
654         REGRESSION (WebKit2): Keyboard should have Search button in duckduckgo.com.
655         https://bugs.webkit.org/show_bug.cgi?id=133183
656         <rdar://problem/17004207>
657
658         Reviewed by Geoff Garen.
659
660         The keyboard type should be search if the input type is search
661         or if it is text and it is inside a form with an action and either
662         name, id or title contain the word search. This matches the
663         heuristics we have in WK1 for iOS.
664
665         * WebProcess/WebPage/ios/WebPageIOS.mm:
666         (WebKit::WebPage::getAssistedNodeInformation):
667
668 2014-05-21  Oliver Hunt  <oliver@apple.com>
669
670         Only enable sandbox extensions on mac.
671
672         RS = Alexey.
673
674         * WebKit2Prefix.h:
675
676 2014-05-21  Oliver Hunt  <oliver@apple.com>
677
678         [iOS] Enable sandboxing for the database process
679         https://bugs.webkit.org/show_bug.cgi?id=132963
680
681         Reviewed by Alexey Proskuryakov.
682
683         Simply ensure that the database process is running in a tight
684         sandbox. As part of this i've separated out ChildProcessIOS
685         and ensures that the database process loads a custom sandbox.
686
687         * Configurations/WebKit.xcconfig:
688         * DatabaseProcess/ios/DatabaseProcessIOS.mm:
689         (WebKit::DatabaseProcess::initializeSandbox):
690         * DatabaseProcess/ios/com.apple.WebKit.DatabasesIOS.sb: Added.
691         * Shared/ios/ChildProcessIOS.mm: Added.
692         Essentially cloned from the Mac version, only all the OSX
693         specific logic has been stripped.
694         (WebKit::ChildProcess::setApplicationIsDaemon):
695         (WebKit::ChildProcess::platformInitialize):
696         (WebKit::ChildProcess::initializeSandbox):
697         (WebKit::ChildProcess::setQOS):
698         * Shared/mac/ChildProcessMac.mm:
699         Remove all the IOS ifdefs.
700         (WebKit::ChildProcess::setApplicationIsDaemon):
701         (WebKit::ChildProcess::platformInitialize):
702         (WebKit::ChildProcess::initializeSandbox):
703         (WebKit::ChildProcess::setQOS):
704         * WebKit2.xcodeproj/project.pbxproj:
705
706 2014-05-21  Andy Estes  <aestes@apple.com>
707
708         [iOS] Create a UIPrintFormatter for WKWebView
709         https://bugs.webkit.org/show_bug.cgi?id=133005
710
711         Reviewed by Tim Horton.
712
713         Implemented a UIPrintFormatter subclass to support printing WKWebViews using UIPrintInteractionController.
714         Overrode -_recalcPageCount: to synchronously ask the web process to lay out for printing and return the number
715         of page rects. The web process returns the page rects immediately and then starts rendering the page to a PDF,
716         returning the PDF data to the UI process asynchronously. When UIPrintInteractionController later calls our
717         overridden -drawInRect:forPageAtIndex:, we block and wait for the PDF data to be returned. Since
718         UIPrintInteractionController draws each page after a delay, it's possible that the web process has already
719         returned the PDF data to us by the time we print the first page.
720
721         * Shared/WebPreferencesStore.h: Correctly initialized shouldPrintBackgrounds for iOS.
722         * UIProcess/API/Cocoa/WKWebView.mm:
723         (-[WKWebView _dataForDisplayedPDF]): Now that WKPDFView vends its CGPDFDocument directly, extract its data here.
724         (-[WKWebView _printFormatterClass]): Tell UIView which UIPrintFormatter to alloc.
725         (-[WKWebView _computePageCountAndStartDrawingToPDFWithPrintInfo:WebKit::firstPage:computedTotalScaleFactor:]):
726         If we're displaying a PDF, return its page count directly. Otherwise, synchronously ask the web process to
727         compute page rects for printing and then return the number of rects.
728         (-[WKWebView _endPrinting]): Cleared state and sent the WebPage::EndPrinting message to the web process.
729         (-[WKWebView _printedDocument]): If we're displaying a PDF, return its data directly. Otherwise, if we haven't
730         received PDF data from the web process yet, wait for it indefinitely (there's no sensible timeout to use here
731         since failing to receive the data results in printing some number of blank pages).
732         (-[WKWebView _setPrintedDocument:]): Set the CGPDFDocument received from the web process.
733         * UIProcess/API/Cocoa/WKWebViewInternal.h: Declared methods called by WKWebViewPrintFormatter.
734         * UIProcess/PageClient.h: Declared didFinishDrawingPagesToPDF.
735         * UIProcess/WKWebViewPrintFormatter.h: Added.
736         * UIProcess/WKWebViewPrintFormatter.mm: Added.
737         (-[WKWebViewPrintFormatter dealloc]): Cleared state and called -[WKWebView _endPrinting].
738         (-[WKWebViewPrintFormatter webView]): Returned the WKWebView for this print formatter.
739         (-[WKWebViewPrintFormatter _recalcPageCount]): Set up a PrintInfo object given the formatter's content rect
740         and called -_computePageCountAndStartDrawingToPDFWithPrintInfo:...
741         (-[WKWebViewPrintFormatter rectForPageAtIndex:]): Called -_recalcIfNecessary and then returned the rect from
742         -_pageContentRect.
743         (-[WKWebViewPrintFormatter drawInRect:forPageAtIndex:]): Taught to draw the given page of the printed PDF
744         document into the given rect and context provided to us.
745         * UIProcess/WebPageProxy.h: Declared didFinishDrawingPagesToPDF.
746         * UIProcess/WebPageProxy.messages.in: Added DidFinishDrawingPagesToPDF. Made this a delayed syncrhonous message
747         so that additoinal work could be performed after sending the response.
748         * UIProcess/ios/PageClientImplIOS.h:
749         * UIProcess/ios/PageClientImplIOS.mm:
750         (WebKit::PageClientImpl::didFinishDrawingPagesToPDF): Created a CGPDFDocument from the data sent to us by the
751         web process and called -[WKWebView _setPrintedDocument:].
752         * UIProcess/ios/WKPDFView.h:
753         * UIProcess/ios/WKPDFView.mm:
754         (-[WKPDFView pdfDocument]): Returned the underlying CGPDFDocument.
755         (-[WKPDFView documentData]): Deleted.
756         * UIProcess/ios/WebPageProxyIOS.mm:
757         (WebKit::WebPageProxy::didFinishDrawingPagesToPDF):
758         * WebKit2.xcodeproj/project.pbxproj:
759         * WebProcess/WebPage/WebPage.cpp:
760         (WebKit::WebPage::computePagesForPrinting): Changed to call computePagesForPrintingImpl.
761         (WebKit::WebPage::computePagesForPrintingImpl): Moved the common logic of computePagesForPrinting to here so it
762         could be called by computePagesForPrintingAndStartDrawingToPDF.
763         (WebKit::WebPage::drawPagesToPDF): Changed to call drawPagesToPDFImpl
764         (WebKit::WebPage::drawPagesToPDFImpl): Moved the common logic of drawPagesToPDF to here so it could be called
765         by computePagesForPrintingAndStartDrawingToPDF.
766         * WebProcess/WebPage/WebPage.h:
767         * WebProcess/WebPage/WebPage.messages.in:
768         * WebProcess/WebPage/ios/WebPageIOS.mm:
769         (WebKit::WebPage::computePagesForPrintingAndStartDrawingToPDF): Computed page rects and returned them as a
770         synchronous response. Afterwards called drawPagesToPDFImpl() and returned the PDF data by sending
771         WebPageProxy::DidFinishDrawingPagesToPDF.
772
773 2014-05-21  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
774
775         [EFL] Turn on ENABLE_CSS_FILTERS
776         https://bugs.webkit.org/show_bug.cgi?id=133153
777
778         Reviewed by Gyuyoung Kim.
779
780         Make WebKit2 compile after r166741 when CSS_FILTERS are enabled.
781
782         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
783         (IPC::ArgumentCoder<WebCore::FilterOperations>::decode):
784
785 2014-05-21  Brady Eidson  <beidson@apple.com>
786
787         Special handling of telephone number detection menu.
788         <rdar://problem/16967971> and https://bugs.webkit.org/show_bug.cgi?id=133143
789
790         Reviewed by Geoff Garen.
791
792         Add a bool to ContextMenuContextData to represent telephone number menus:
793         * Shared/ContextMenuContextData.cpp:
794         (WebKit::ContextMenuContextData::ContextMenuContextData):
795         (WebKit::ContextMenuContextData::operator=):
796         (WebKit::ContextMenuContextData::encode):
797         (WebKit::ContextMenuContextData::decode):
798         * Shared/ContextMenuContextData.h:
799         (WebKit::ContextMenuContextData::ContextMenuContextData):
800         (WebKit::ContextMenuContextData::isTelephoneNumberContext):
801
802         * UIProcess/mac/WebContextMenuProxyMac.mm:
803         (WebKit::WebContextMenuProxyMac::showContextMenu): If the menu is a telephone
804           number menu then display it using a specific AppKit API.
805
806         * UIProcess/mac/WebPageProxyMac.mm:
807         (WebKit::WebPageProxy::showTelephoneNumberMenu): Filter the array of menu items
808           through a new WKSI call, and then show it using a telephone number context.
809
810 2014-05-21  Alexey Proskuryakov  <ap@apple.com>
811
812         [Mac] REGRESSION (Async text input): Asian text input doesn't work in Flash
813         https://bugs.webkit.org/show_bug.cgi?id=133128
814         <rdar://problem/16890920>
815
816         Reviewed by Anders Carlsson.
817
818         * UIProcess/API/mac/WKView.mm:
819         (-[WKView _interpretKeyEvent:completionHandler:]): Added a separate code path for
820         plug-in input. Before async text input, we used to provide a nil input context due
821         to having _data->_interpretKeyEventsParameters while this function was executing,
822         and thus took a shortcut. The new behavior is different from pre-async in that
823         we don't collect commands at all, but I couldn't find any case where that mattered.
824         (-[WKView inputContext]): The _collectedKeypressCommands check was not a correct
825         replacement for _interpretKeyEventsParameters one, because this variable is not
826         always set within -_interpretKeyEvent:completionHandler:.
827
828         * UIProcess/mac/WKTextInputWindowController.mm:
829         (-[WKTextInputPanel _interpretKeyEvent:usingLegacyCocoaTextInput:string:]):
830         While at it, fixed a separate issue with Cangjie predictive input. We shouldn't
831         keep prediction pop-up on screen after hiding the bottom input window.
832
833 2014-05-16  Martin Robinson  <mrobinson@igalia.com>
834
835         [CMake] Improve handling of LIB_INSTALL_DIR, EXEC_INSTALL_DIR, and LIBEXEC_INSTALL_DIR
836         https://bugs.webkit.org/show_bug.cgi?id=132819
837
838         Reviewed by Carlos Garcia Campos.
839
840         * PlatformEfl.cmake: No need to prefix EXEC_INSTALL_DIR with the prefix any longer.
841         * PlatformGtk.cmake: No longer use CMAKE_INSTALL_FULL_FOO variables, instead using the WebKit-specific ones.
842         * efl/EWebKit2Config.cmake.in: Ditto.
843         * efl/ewebkit2.pc.in: Instead of hard-coding the path to the library installation directory use LIB_INSTALL_DIR.
844         * webkit2gtk-web-extension.pc.in: No longer use the pkg-config only variables. Instead use
845         the common CMake ones.
846         * webkit2gtk.pc.in: Ditto.
847
848 2014-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>
849
850         REGRESSION(r168625): [GTK] Assertion failure in LocalStorageDatabaseTracker
851         https://bugs.webkit.org/show_bug.cgi?id=133118
852
853         Reviewed by Philippe Normand.
854
855         Call WebContext::applyPlatformSpecificConfigurationDefaults() to
856         initialize the WebContextConfiguration before creating the default WebContext.
857
858         * UIProcess/API/gtk/WebKitWebContext.cpp:
859         (createDefaultWebContext):
860
861 2014-05-21  Shivakumar JM  <shiva.jm@samsung.com>
862
863         [WebKit2] Cleanup the build from unused variable in WebProcess module
864         https://bugs.webkit.org/show_bug.cgi?id=133062
865
866         Reviewed by Csaba Osztrogonác.
867
868         Fix unused parameter by using UNUSED_PARAM macro
869
870         * WebProcess/UserContent/WebUserContentController.cpp:
871         (WebKit::WebUserContentController::addUserScriptMessageHandlers):
872         (WebKit::WebUserContentController::removeUserScriptMessageHandler):
873
874 2014-05-20  Enrica Casucci  <enrica@apple.com>
875
876         REGRESSION (WK2): Tapping on the input field in duckduckgo.com shows the keyboard but not the caret.
877         https://bugs.webkit.org/show_bug.cgi?id=133140
878         <rdar://problem/16980898>
879
880         Reviewed by Benjamin Poulain.
881
882         When a page focuses a field on load, we receive the call to startAssistingNode
883         but we don't create a text interaction assistant if the focus is not originated
884         by a user action. Upon receiving the selection change notification we don't
885         call the text interaction assistant, since we don't have one, but we do call
886         the web selection assistant. We don't have any valid rects for web selection
887         and we clear the selection on the page, causing the caret not to appear and
888         the typing to have no effect.
889
890         * UIProcess/ios/WKContentViewInteraction.mm:
891         (-[WKContentView _updateChangedSelection]):
892
893 2014-05-20  Dean Jackson  <dino@apple.com>
894
895         [Mac] Allow popup menus to override default appearance
896         https://bugs.webkit.org/show_bug.cgi?id=133129
897
898         Reviewed by Tim Horton.
899
900         Add an extra "hideArrows" flag to PlatformPopupMenuData
901         and replace the call to WKPopupMenuWithSize with WKPopupMenu.
902
903         * Shared/PlatformPopupMenuData.cpp: Encode and decode the new data value.
904         (WebKit::PlatformPopupMenuData::encode):
905         (WebKit::PlatformPopupMenuData::decode):
906         * Shared/PlatformPopupMenuData.h: Add hideArrows boolean.
907         * UIProcess/mac/WebPopupMenuProxyMac.mm:
908         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
909         * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
910         (WebKit::WebPopupMenu::setUpPlatformData): The hideArrows flag is
911         true if we don't have the default appearance.
912
913 2014-05-20  Eric Carlson  <eric.carlson@apple.com>
914
915         [Mac] do not deactivate an audio session that has running I/O
916         https://bugs.webkit.org/show_bug.cgi?id=133127
917
918         Reviewed by Jer Noble.
919
920         * WebProcess/WebPage/WebPage.cpp:
921         (WebKit::WebPage::WebPage): Settings::setShouldManageAudioSession renamed to 
922             setShouldManageAudioSessionCategory, deal with it.
923
924 2014-05-19  Simon Fraser  <simon.fraser@apple.com>
925
926         REGRESSION (r169063) Fixed and sticky nodes misplaced on scrolling sometimes
927         https://bugs.webkit.org/show_bug.cgi?id=133106
928         <rdar://problem/16967648>
929
930         Reviewed by Sam Weinig.
931
932         Fix regression from r169063. That commit removed scrolledContentsLayers from 
933         frame scrolling nodes, but they do actually use them.
934         
935         So put them back; not in the base class, because they have a somewhat different
936         meaning for overflow scrolling and frame scrolling.
937
938         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
939         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
940         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
941         (WebKit::RemoteScrollingTreeTextStream::dump):
942         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
943         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
944
945 2014-05-20  Alexey Proskuryakov  <ap@apple.com>
946
947         [Mac] WebProcess doesn't follow localization of UI process when run as a service
948         https://bugs.webkit.org/show_bug.cgi?id=133126
949         <rdar://problem/13396515>
950         <rdar://problem/16561084>
951
952         Reviewed by Sam Weinig and Tim Horton.
953
954         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
955         (WebKit::handleXPCBootstrap):
956         (main):
957         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
958         (WebKit::handleXPCBootstrap):
959         (main):
960         Set localization very early in process lifetime (in development builds, that's
961         even before WebKit framework is loaded).
962
963         * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::connectToService):
964         Pass UI process localization to the service, computing it in the same way we do
965         for child processes.
966
967 2014-05-20  Anders Carlsson  <andersca@apple.com>
968
969         Fix a header comment
970         https://bugs.webkit.org/show_bug.cgi?id=133123
971         <rdar://problem/16973783>
972
973         Reviewed by Geoffrey Garen.
974
975         * UIProcess/API/Cocoa/WKUserContentController.h:
976
977 2014-05-20  Carlos Garcia Campos  <cgarcia@igalia.com>
978
979         [GTK] WebKitWebPage::send-request always pass a valid pointer for redirected response
980         https://bugs.webkit.org/show_bug.cgi?id=133119
981
982         Reviewed by Sergio Villar Senin.
983
984         The problem is that we were checking whether the passed in
985         WKURLResponseRef is NULL or not, but it's always a valid object
986         that can contain a NULL WebCore::ResourceResponse.
987
988         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
989         (willSendRequestForFrame): Pass NULL as redirect-response
990         parameter of WebKitWebPage::send-request signal when the
991         WebCore::ResourceResponse of the passed in WKURLResponseRef is NULL.
992
993 2014-05-20  Antti Koivisto  <antti@apple.com>
994
995         Double-tap zoom does not take obscuring insets into account
996         https://bugs.webkit.org/show_bug.cgi?id=133116
997         <rdar://problem/16765604>
998
999         Reviewed by Anders Carlsson.
1000
1001         * UIProcess/API/Cocoa/WKWebView.mm:
1002         (-[WKWebView _zoomToRect:WebCore::atScale:origin:WebCore::]):
1003         
1004             Compute the zoom target taking insets into account.
1005
1006 2014-05-19  Gavin Barraclough  <baraclough@apple.com>
1007
1008         WebKit2/iOS: parented view should be considered hidden if app is backgrounded
1009         https://bugs.webkit.org/show_bug.cgi?id=133099
1010         radar://16942183
1011
1012         Reviewed by Simon Fraser.
1013
1014         * UIProcess/ios/PageClientImplIOS.mm:
1015         (WebKit::PageClientImpl::isViewWindowActive):
1016             - implemented in terms of isViewVisible.
1017             - FIXME: https://bugs.webkit.org/show_bug.cgi?id=133098
1018         (WebKit::PageClientImpl::isViewFocused):
1019             - implemented in terms of isViewWindowActive.
1020             - FIXME: https://bugs.webkit.org/show_bug.cgi?id=133098
1021         (WebKit::PageClientImpl::isViewVisible):
1022             - take UIApplication applicationState into account in determining visibility.
1023         (WebKit::PageClientImpl::isViewVisibleOrOccluded):
1024             - implemented in terms of isViewVisible.
1025         (WebKit::PageClientImpl::isVisuallyIdle):
1026             - implemented in terms of isViewVisible.
1027         * UIProcess/ios/WKContentView.mm:
1028         (-[WKContentView initWithFrame:context:WebKit::configuration:WebKit::webView:]):
1029             - register for UIApplicationDidEnterBackgroundNotification.
1030         (-[WKContentView _applicationDidEnterBackground:]):
1031         (-[WKContentView _applicationWillEnterForeground:]):
1032             - when the application state changes all flags except IsInWindow may be affected.
1033
1034 2014-05-19  Enrica Casucci  <enrica@apple.com>
1035
1036         WK2 iOS: Pressing the form navigation button causes the keyboard to be dismissed.
1037         https://bugs.webkit.org/show_bug.cgi?id=133100
1038         <rdar://problem/16808673>
1039
1040         Reviewed by Benjamin Poulain.
1041
1042         The call to focusNextAssistedNode is the result of a user action, since
1043         it is called when the user pressed the form navigation buttons.
1044         Therefore we must set m_userIsInteracting to true before changing the focus
1045         to make sure the focus change is honored.
1046
1047         * WebProcess/WebPage/ios/WebPageIOS.mm:
1048         (WebKit::WebPage::focusNextAssistedNode):
1049
1050 2014-05-19  Beth Dakin  <bdakin@apple.com>
1051
1052         TelephoneNumberOverlayController should use a modern loop for text quad bounding 
1053         boxes
1054         https://bugs.webkit.org/show_bug.cgi?id=133096
1055
1056         Reviewed by Anders Carlsson.
1057
1058         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
1059         (WebKit::textQuadsToBoundingRectForRange):
1060
1061 2014-05-19  Jeremy Jones  <jeremyj@apple.com>
1062
1063         PlatformCALayerRemoteCustom properties aren't initialized to match the PlatformLayer
1064         https://bugs.webkit.org/show_bug.cgi?id=133025
1065
1066         Reviewed by Simon Fraser.
1067
1068         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
1069         (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
1070         Initialize PlatformCALayerRemote properties from the PlatformLayer.
1071
1072 2014-05-19  Benjamin Poulain  <bpoulain@apple.com>
1073
1074         [iOS][WK2] When a page relayout on dynamic resize, keep the same relative width in view
1075         https://bugs.webkit.org/show_bug.cgi?id=133026
1076         <rdar://problem/16833971>
1077
1078         Reviewed by Simon Fraser.
1079
1080         When a page does not relayout, we keep the same width in view.
1081         When a page relayout, we should keep the same relative width in view.
1082
1083         * WebProcess/WebPage/ios/WebPageIOS.mm:
1084         (WebKit::isResponsiveDesignWithContentLargerThanLayout):
1085         (WebKit::WebPage::dynamicViewportSizeUpdate):
1086
1087 2014-05-19  Benjamin Poulain  <benjamin@webkit.org>
1088
1089         [WK2] Add some missing state reset on crash
1090         https://bugs.webkit.org/show_bug.cgi?id=133036
1091
1092         Reviewed by Sam Weinig.
1093
1094         * UIProcess/WebPageProxy.cpp:
1095         (WebKit::WebPageProxy::resetState):
1096         The missing reset for m_isTrackingTouchEvents would cause the WebPageProxy to send
1097         touch events when it shouldn't. That would only be for an active touch sequence.
1098
1099         The missing reset m_lastVisibleContentRectUpdate would prevent pushing the new UI state
1100         to the new page on reload, that is very bad.
1101
1102         Also moved m_videoFullscreenManager to be in the same order as initialization, and invalidate
1103         the callbacks for dictation.
1104
1105 2014-05-19  Benjamin Poulain  <bpoulain@apple.com>
1106
1107         [iOS][WK2] Move scale noise filtering to the WebProcess
1108         https://bugs.webkit.org/show_bug.cgi?id=133021
1109
1110         Reviewed by Darin Adler.
1111
1112         Filtering in the UIProcess was stupid. It forces to handle a third kind of scale just for updates.
1113
1114         The WebProcess already adjusts the input scale based on the viewport. Changing the input scale at that level
1115         is already supported. It is a better place to have the filtering.
1116
1117         * UIProcess/ios/WKContentView.mm:
1118         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
1119         * WebProcess/WebPage/ios/WebPageIOS.mm:
1120         (WebKit::WebPage::updateVisibleContentRects):
1121
1122 2014-05-19  Simon Fraser  <simon.fraser@apple.com>
1123
1124         Split scrolling tree ScrollingNodes into FrameScrollingNodes and OverflowScrollingNodes
1125         https://bugs.webkit.org/show_bug.cgi?id=133022
1126
1127         Reviewed by Sam Weinig.
1128         
1129         In both the scrolling state tree and the scrolling tree, split the "scrolling nodes"
1130         into FrameScrolling and OverflowScrolling nodes.
1131         
1132         Move what was the "viewportSize" property onto the base class for the scrolling
1133         nodes, calling it "scrollableAreaSize".
1134         
1135         Make minimum/maximumScrollPosition() virtual so we can share more code (and there
1136         is more code sharing to be done in future).
1137
1138         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1139         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
1140         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
1141         (ArgumentCoder<ScrollingStateOverflowScrollingNode>::encode):
1142         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
1143         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
1144         (ArgumentCoder<ScrollingStateOverflowScrollingNode>::decode):
1145         (WebKit::encodeNodeAndDescendants):
1146         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
1147         (WebKit::RemoteScrollingTreeTextStream::dump):
1148         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
1149         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
1150         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
1151         (WebKit::RemoteScrollingTree::createNode):
1152         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1153         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollLayer):
1154         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterViewportChange):
1155         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1156         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS):
1157         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateBeforeChildren):
1158         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
1159         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition):
1160         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll):
1161         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1162         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
1163
1164 2014-05-19  Alexey Proskuryakov  <ap@apple.com>
1165
1166         [Mac] Fix a typo in plug-in sandbox
1167         https://bugs.webkit.org/show_bug.cgi?id=133074
1168
1169         Reviewed by Anders Carlsson.
1170
1171         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:
1172
1173 2014-05-16  Andy Estes  <aestes@apple.com>
1174
1175         [WebKit2] Wake up threads blocked in waitForAndDispatchImmediately() if we lose our connection
1176         https://bugs.webkit.org/show_bug.cgi?id=133010
1177
1178         Reviewed by Geoffrey Garen.
1179
1180         If a thread is blocked on m_waitForMessageCondition and we lose our connection, treat that like we do a timeout.
1181
1182         * Platform/IPC/Connection.cpp:
1183         (IPC::Connection::Connection):
1184         (IPC::Connection::waitForMessage):
1185         (IPC::Connection::connectionDidClose):
1186         * Platform/IPC/Connection.h:
1187
1188 2014-05-19  Mark Rowe  <mrowe@apple.com>
1189
1190         Build fix after r169023.
1191
1192         * Shared/API/Cocoa/WebKitPrivate.h: Stop including headers that no longer exist.
1193         I hope for weinig's sake that no-one was relying on them.
1194
1195 2014-05-18  Anders Carlsson  <andersca@apple.com>
1196
1197         Relax an assertion when creating document loaders
1198         https://bugs.webkit.org/show_bug.cgi?id=133058
1199
1200         Reviewed by Sam Weinig.
1201
1202         When navigating back/forward items recursively, createDocumentLoader will be called
1203         for subframes before main frames so only associate the navigation with main frames.
1204
1205         * WebProcess/WebPage/WebPage.cpp:
1206         (WebKit::WebPage::createDocumentLoader):
1207
1208 2014-05-18  Zsolt Borbely  <zsborbely.u-szeged@partner.samsung.com>
1209
1210         CMake Buildfix after r169023.
1211
1212         Reviewed by Csaba Osztrogonác.
1213
1214         * CMakeLists.txt: Add new files after r168994.
1215
1216 2014-05-18  Sam Weinig  <sam@webkit.org>
1217
1218         [WebKit2] Implement ScriptMessageHandlers
1219         https://bugs.webkit.org/show_bug.cgi?id=133053
1220
1221         Reviewed by Anders Carlsson.
1222
1223         * DerivedSources.make:
1224         * Scripts/webkit2/messages.py:
1225         (struct_or_class):
1226         (argument_coder_headers_for_type):
1227         (headers_for_type):
1228         * UIProcess/API/Cocoa/WKScriptMessage.mm:
1229         (-[WKScriptMessage _initWithBody:webView:name:]):
1230         (-[WKScriptMessage body]):
1231         (-[WKScriptMessage webView]):
1232         (-[WKScriptMessage name]):
1233         (-[WKScriptMessage _scriptWorld]): Deleted.
1234         * UIProcess/API/Cocoa/WKScriptMessageInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKScriptMessagePrivate.h.
1235         * UIProcess/API/Cocoa/WKScriptMessagePrivate.h: Removed.
1236         * UIProcess/API/Cocoa/WKUserContentController.mm:
1237         (-[WKUserContentController addScriptMessageHandler:name:]):
1238         (-[WKUserContentController removeScriptMessageHandlerForName:]):
1239         (-[WKUserContentController _addScriptMessageHandler:name:world:]): Deleted.
1240         (-[WKUserContentController _removeScriptMessageHandlerForName:world:]): Deleted.
1241         * UIProcess/API/Cocoa/WKUserContentControllerInternal.h:
1242         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h: Removed.
1243         * UIProcess/API/Cocoa/WKWebView.mm:
1244         (pageToViewMap):
1245         (fromWebPageProxy):
1246         (-[WKWebView initWithFrame:configuration:]):
1247         (-[WKWebView dealloc]):
1248         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1249         * UIProcess/UserContent/WebScriptMessageHandler.cpp: Added.
1250         (WebKit::WebScriptMessageHandlerHandle::encode):
1251         (WebKit::WebScriptMessageHandlerHandle::decode):
1252         (WebKit::generateIdentifier):
1253         (WebKit::WebScriptMessageHandler::create):
1254         (WebKit::WebScriptMessageHandler::WebScriptMessageHandler):
1255         (WebKit::WebScriptMessageHandler::~WebScriptMessageHandler):
1256         * UIProcess/UserContent/WebScriptMessageHandler.h: Added.
1257         (WebKit::WebScriptMessageHandler::Client::~Client):
1258         (WebKit::WebScriptMessageHandler::handle):
1259         (WebKit::WebScriptMessageHandler::identifier):
1260         (WebKit::WebScriptMessageHandler::name):
1261         (WebKit::WebScriptMessageHandler::client):
1262         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
1263         (WebKit::WebUserContentControllerProxy::addProcess):
1264         (WebKit::WebUserContentControllerProxy::removeProcess):
1265         (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
1266         (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
1267         (WebKit::WebUserContentControllerProxy::didPostMessage):
1268         * UIProcess/UserContent/WebUserContentControllerProxy.h:
1269         * UIProcess/UserContent/WebUserContentControllerProxy.messages.in: Added.
1270         * WebKit2.xcodeproj/project.pbxproj:
1271         * WebProcess/UserContent/WebUserContentController.cpp:
1272         (WebKit::WebUserMessageHandlerDescriptorProxy::create):
1273         (WebKit::WebUserMessageHandlerDescriptorProxy::~WebUserMessageHandlerDescriptorProxy):
1274         (WebKit::WebUserMessageHandlerDescriptorProxy::didPostMessage):
1275         (WebKit::WebUserMessageHandlerDescriptorProxy::descriptor):
1276         (WebKit::WebUserMessageHandlerDescriptorProxy::identifier):
1277         (WebKit::WebUserMessageHandlerDescriptorProxy::WebUserMessageHandlerDescriptorProxy):
1278         (WebKit::WebUserContentController::addUserScriptMessageHandlers):
1279         (WebKit::WebUserContentController::removeUserScriptMessageHandler):
1280         * WebProcess/UserContent/WebUserContentController.h:
1281         * WebProcess/UserContent/WebUserContentController.messages.in:
1282
1283 2014-05-18  Rik Cabanier  <cabanier@adobe.com>
1284
1285         support for navigator.hardwareConcurrency
1286         https://bugs.webkit.org/show_bug.cgi?id=132588
1287
1288         Reviewed by Filip Pizlo.
1289
1290         * Configurations/FeatureDefines.xcconfig:
1291
1292 2014-05-18  Anders Carlsson  <andersca@apple.com>
1293
1294         Implement Navigations for all methods declared returning one
1295         https://bugs.webkit.org/show_bug.cgi?id=133048
1296         <rdar://problem/16830064>
1297
1298         Reviewed by Sam Weinig.
1299
1300         * UIProcess/API/Cocoa/WKWebView.mm:
1301         (-[WKWebView goToBackForwardListItem:]):
1302         (-[WKWebView goBack]):
1303         (-[WKWebView goForward]):
1304         (-[WKWebView reload]):
1305         (-[WKWebView reloadFromOrigin]):
1306         Create and return navigations.
1307
1308         (-[WKWebView _reload]):
1309         Call -[WKWebView reload].
1310
1311         * UIProcess/Cocoa/NavigationState.h:
1312         * UIProcess/Cocoa/NavigationState.mm:
1313         (WebKit::NavigationState::createBackForwardNavigation):
1314         Create a back/forward navigation.
1315
1316         (WebKit::NavigationState::createReloadNavigation):
1317         Create a reload navigation.
1318
1319         * UIProcess/WebPageProxy.cpp:
1320         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
1321         Generate a navigation ID and send it with the GoToBackForwardItem message.
1322
1323         (WebKit::WebPageProxy::reload):
1324         Return a navigation ID.
1325
1326         (WebKit::WebPageProxy::goForward):
1327         Generate a navigation ID and send it with the GoForward message.
1328         
1329         (WebKit::WebPageProxy::goBack):
1330         Generate a navigation ID and send it with the GoBack message.
1331
1332         (WebKit::WebPageProxy::goToBackForwardItem):
1333         Generate a navigation ID and send it with the GoToBackForwardItem message.
1334
1335         * UIProcess/WebPageProxy.h:
1336         Return navigation IDs where appropriate.
1337
1338         * UIProcess/cf/WebPageProxyCF.cpp:
1339         (WebKit::WebPageProxy::restoreFromSessionStateData):
1340         Generate a navigation ID and send it with the RestoreSessionAndNavigateToCurrentItem message.
1341         
1342         * WebProcess/WebPage/WebPage.cpp:
1343         (WebKit::WebPage::goForward):
1344         (WebKit::WebPage::goBack):
1345         (WebKit::WebPage::goToBackForwardItem):
1346         Set up the pending navigation ID.
1347
1348         (WebKit::WebPage::restoreSessionAndNavigateToCurrentItem):
1349         Call goToBackForwardItem with a navigation ID.
1350
1351         * WebProcess/WebPage/WebPage.h:
1352         Add navigation IDs.
1353
1354         * WebProcess/WebPage/WebPage.messages.in:
1355         Add navigation IDs.
1356
1357 2014-05-18  Commit Queue  <commit-queue@webkit.org>
1358
1359         Unreviewed, rolling out r169001.
1360         https://bugs.webkit.org/show_bug.cgi?id=133050
1361
1362         We can't expose the C SPI from WKWebView (Requested by
1363         andersca on #webkit).
1364
1365         Reverted changeset:
1366
1367         "Need a way to get a WKPageRef from a WKWebView"
1368         https://bugs.webkit.org/show_bug.cgi?id=133015
1369         http://trac.webkit.org/changeset/169001
1370
1371 2014-05-18  Martin Hodovan  <mhodovan.u-szeged@partner.samsung.com>
1372
1373         [WK2][GTK] Buildfix after r168999.
1374
1375         Reviewed by Csaba Osztrogonác.
1376
1377         * UIProcess/gtk/WebContextGtk.cpp:
1378         (WebKit::WebContext::platformDefaultWebSQLDatabaseDirectory): Renamed from WebKit::WebContext::platformDefaultDatabaseDirectory().
1379         (WebKit::WebContext::platformDefaultIndexedDBDatabaseDirectory): Added.
1380
1381 2014-05-18  Martin Hodovan  <mhodovan.u-szeged@partner.samsung.com>
1382
1383         [WK2][EFL] Buildfix after r168999.
1384
1385         Reviewed by Csaba Osztrogonác.
1386
1387         * UIProcess/efl/WebContextEfl.cpp:
1388         (WebKit::WebContext::platformDefaultWebSQLDatabaseDirectory): Renamed from WebKit::WebContext::platformDefaultDatabaseDirectory().
1389         (WebKit::WebContext::platformDefaultIndexedDBDatabaseDirectory): Added.
1390
1391 2014-05-18  Martin Hodovan  <mhodovan.u-szeged@partner.samsung.com>
1392
1393         [WK2][cmake] Buildfix after r168994.
1394
1395         Reviewed by Csaba Osztrogonác.
1396
1397         * CMakeLists.txt: Added new files to the build system introduced in r168994.
1398
1399 2014-05-17  Alexey Proskuryakov  <ap@apple.com>
1400
1401         REGRESSION (NetworkProcess): Trying to use appcache fallback crashes in ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache
1402         https://bugs.webkit.org/show_bug.cgi?id=133007
1403         <rdar://problem/13702706>
1404
1405         appcache tests often fail on the Mac WebKit2 bot
1406         https://bugs.webkit.org/show_bug.cgi?id=82061
1407
1408         Reviewed by Maciej Stachowiak.
1409
1410         * WebProcess/Network/WebResourceLoader.cpp:
1411         (WebKit::WebResourceLoader::willSendRequest):
1412         (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo):
1413         (WebKit::WebResourceLoader::didFailResourceLoad):
1414         Perform the same appcache checks that ResourceHandleClient implementation in ResourceLoader
1415         does. We should eventually come up with a way to share the code. Perhaps add a class that
1416         isolates ResourceLoader from networking details? But ResourceLoader was itself supposed
1417         to be the class that isolates DocumentLoader from networking details. So, unsure.
1418
1419 2014-05-17  Jae Hyun Park  <jaepark@webkit.org>
1420
1421         [EFL] Remove m_contentPosition from PageViewportControllerClientEfl
1422         https://bugs.webkit.org/show_bug.cgi?id=132774
1423
1424         Reviewed by Anders Carlsson.
1425
1426         m_contentPosition is not used anywhere. So, this patch removes
1427         m_contentPosition and reduces one unnecessary assignment in
1428         setViewportPosition. Also, it renames contentsPoint to contentsPosition.
1429
1430         * UIProcess/PageViewportControllerClient.h:
1431         * UIProcess/efl/PageViewportControllerClientEfl.cpp:
1432         (WebKit::PageViewportControllerClientEfl::setViewportPosition):
1433         * UIProcess/efl/PageViewportControllerClientEfl.h:
1434
1435 2014-05-17  David Kilzer  <ddkilzer@apple.com>
1436
1437         Need a way to get a WKPageRef from a WKWebView
1438         <http://webkit.org/b/133015>
1439
1440         Reviewed by Benjamin Poulain.
1441
1442         * UIProcess/API/Cocoa/WKWebView.mm:
1443         (-[WKWebView _pageRef]): Added.
1444         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1445         (-[WKWebView _pageRef]): Added declaration.
1446
1447 2014-05-17  Anders Carlsson  <andersca@apple.com>
1448
1449         Give user scripts custom URLs
1450         https://bugs.webkit.org/show_bug.cgi?id=133035
1451
1452         Reviewed by Beth Dakin.
1453
1454         * UIProcess/API/Cocoa/WKUserContentController.mm:
1455         (-[WKUserContentController addUserScript:]):
1456         Create a user-script:<number> URL for user scripts.
1457
1458         * UIProcess/API/Cocoa/WKUserScript.h:
1459         Move the init method after the properties.
1460
1461 2014-05-17  Anders Carlsson  <andersca@apple.com>
1462
1463         Replace WKContextSetDatabaseDirectory with two WKContextConfiguration parameters
1464         https://bugs.webkit.org/show_bug.cgi?id=133033
1465         <rdar://problem/16830143>
1466
1467         Reviewed by Sam Weinig.
1468
1469         * Shared/WebProcessCreationParameters.cpp:
1470         (WebKit::WebProcessCreationParameters::encode):
1471         (WebKit::WebProcessCreationParameters::decode):
1472         * Shared/WebProcessCreationParameters.h:
1473         Rename databaseDirectory to webSQLDatabaseDirectory to better indicate the directory type.
1474
1475         * UIProcess/API/C/WKContext.cpp:
1476         (WKContextSetDatabaseDirectory): Deleted.
1477         This is no longer needed.
1478
1479         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1480         (WKContextConfigurationCopyIndexedDBDatabaseDirectory):
1481         (WKContextConfigurationSetIndexedDBDatabaseDirectory):
1482         (WKContextConfigurationCopyWebSQLDatabaseDirectory):
1483         (WKContextConfigurationSetWebSQLDatabaseDirectory):
1484         * UIProcess/API/C/WKContextConfigurationRef.h:
1485         Add setters and getters.
1486
1487         * UIProcess/API/C/WKContextPrivate.h:
1488         Remove WKContextSetDatabaseDirectory.
1489
1490         * UIProcess/APIContextConfiguration.cpp:
1491         (API::ContextConfiguration::webContextConfiguration):
1492         Set m_indexedDBDatabaseDirectory and m_webSQLDatabaseDirectory on the configuration.
1493
1494         * UIProcess/APIContextConfiguration.h:
1495         (API::ContextConfiguration::indexedDBDatabaseDirectory):
1496         (API::ContextConfiguration::setIndexedDBDatabaseDirectory):
1497         (API::ContextConfiguration::webSQLDatabaseDirectory):
1498         (API::ContextConfiguration::setWebSQLDatabaseDirectory):
1499         Add getters and setters to the C++ part of WKContextConfigurationRef.
1500
1501         * UIProcess/WebContext.cpp:
1502         (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults):
1503         Set webSQLDatabaseDirectory and indexedDBDatabaseDirectory.
1504
1505         (WebKit::WebContext::WebContext):
1506         Initialize m_webSQLDatabaseDirectory and m_indexedDBDatabaseDirectory.
1507
1508         (WebKit::WebContext::ensureDatabaseProcess):
1509         Set parameters.indexedDatabaseDirectory from m_indexedDBDatabaseDirectory.
1510
1511         (WebKit::WebContext::createNewWebProcess):
1512         Set parameters.webSQLDatabaseDirectory from m_webSQLDatabaseDirectory.
1513
1514         * UIProcess/mac/WebContextMac.mm:
1515         (WebKit::WebContext::platformDefaultWebSQLDatabaseDirectory):
1516         Rename this to indicate that it's about WebSQL databases.
1517
1518         (WebKit::WebContext::platformDefaultIndexedDBDatabaseDirectory):
1519         Add this.
1520
1521         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
1522         (WebKit::WebDatabaseManager::initialize):
1523         Update for WebProcessCreationParameters rename.
1524
1525         * WebProcess/cocoa/WebProcessCocoa.mm:
1526         (WebKit::WebProcess::platformInitializeWebProcess):
1527         Update for WebProcessCreationParameters rename.
1528
1529 2014-05-17  Brent Fulgham  <bfulgham@apple.com>
1530
1531         [Phone Number Detection] drop-down menu in the phone number detection box doesn't appear.
1532         https://bugs.webkit.org/show_bug.cgi?id=133024
1533
1534         Reviewed by Sam Weinig.
1535
1536         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
1537         (WebKit::TelephoneNumberOverlayController::drawRect): Don't clear the set of found phone numbers each
1538         time we call drawRect. This gets called ~9 times per screen refresh, so end up with no active
1539         phone numbers to interact with.
1540
1541 2014-05-17  Alexey Proskuryakov  <ap@apple.com>
1542
1543         NetworkProcess can repeatedly crash handling Blob messages after any unrelated crash
1544         https://bugs.webkit.org/show_bug.cgi?id=133032
1545         <rdar://problem/16951630>
1546
1547         Reviewed by Geoffrey Garen.
1548
1549         Replaced assertions with runtime checks. This can happen if NetworkProcess previously
1550         crashed for any unrelated reason.
1551
1552         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1553         (WebKit::NetworkBlobRegistry::registerBlobURL):
1554         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
1555         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
1556
1557 2014-05-17  Anders Carlsson  <andersca@apple.com>
1558
1559         -[WKWebView dealloc] should close the page
1560         https://bugs.webkit.org/show_bug.cgi?id=133031
1561         <rdar://problem/16929815>
1562
1563         Reviewed by Simon Fraser.
1564
1565         * UIProcess/API/Cocoa/WKWebView.mm:
1566         (-[WKWebView dealloc]):
1567
1568 2014-05-16  Anders Carlsson  <andersca@apple.com>
1569
1570         Expose WKUserScript as API
1571         https://bugs.webkit.org/show_bug.cgi?id=133017
1572         <rdar://problem/16948059>
1573
1574         Reviewed by Sam Weinig.
1575
1576         * DerivedSources.make:
1577         Add WebUserContentController.
1578
1579         * Shared/API/Cocoa/WebKit.h:
1580         Add WKUserScript.h
1581
1582         * Shared/API/c/WKSharedAPICast.h:
1583         (WebKit::toUserScriptInjectionTime):
1584         Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename.
1585
1586         * Shared/API/c/WKUserScriptInjectionTime.h:
1587         Rename WKUserScriptInjectionTime to _WKUserScriptInjectionTime to free up the name for the Objective-C API
1588
1589         * Shared/WebPageCreationParameters.cpp:
1590         (WebKit::WebPageCreationParameters::encode):
1591         Encode the user content controller ID.
1592
1593         (WebKit::WebPageCreationParameters::decode):
1594         Decode the user content controller ID.
1595
1596         * Shared/WebPageCreationParameters.h:
1597         Add userContentControllerID.
1598
1599         * UIProcess/API/C/WKPageGroup.cpp:
1600         (WKPageGroupAddUserScript):
1601         Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename.
1602
1603         * UIProcess/API/C/WKPageGroup.h:
1604         Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename.
1605
1606         * UIProcess/API/Cocoa/WKBrowsingContextGroup.h:
1607         Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename.
1608
1609         * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
1610         (-[WKBrowsingContextGroup addUserScript:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:injectionTime:mainFrameOnly:]):
1611         Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename.
1612
1613         * UIProcess/API/Cocoa/WKUserContentController.h:
1614         Add new methods.
1615
1616         * UIProcess/API/Cocoa/WKUserContentController.mm:
1617         (-[WKUserContentController init]):
1618         Create the WebUserContentControllerProxy object and user scripts array.
1619
1620         (-[WKUserContentController userScripts]):
1621         Return the user scripts array.
1622
1623         (toWebCoreUserScriptInjectionTime):
1624         Helper for converting from a WKUserScriptInjectionTime enum to WebCore::UserScriptInjectionTime.
1625
1626         (-[WKUserContentController addUserScript:]):
1627         Call through to the _userContentControllerProxy object.
1628
1629         (-[WKUserContentController removeAllUserScripts]):
1630         Call through to the _userContentControllerProxy object.
1631         
1632         * UIProcess/API/Cocoa/WKUserContentControllerInternal.h: Added.
1633         Add WebUserContentControllerProxy ivar.
1634
1635         * UIProcess/API/Cocoa/WKUserScript.h: Added.
1636         Add new header.
1637
1638         * UIProcess/API/Cocoa/WKUserScript.mm:
1639         (-[WKUserScript initWithSource:injectionTime:forMainFrameOnly:]):
1640         Initialize the WKUserScript object.
1641
1642         (-[WKUserScript source]):
1643         (-[WKUserScript injectionTime]):
1644         (-[WKUserScript isForMainFrameOnly]):
1645         Add getters.
1646
1647         (-[WKUserScript copyWithZone:]):
1648         Since WKUserScript is immutable, just return a retained object.
1649
1650         * UIProcess/API/Cocoa/WKUserScriptInternal.h:
1651         Add ivars.
1652
1653         * UIProcess/API/Cocoa/WKWebView.mm:
1654         (-[WKWebView initWithFrame:configuration:]):
1655         Set the user content controller from the configuration.
1656
1657         * UIProcess/UserContent/WebUserContentControllerProxy.cpp: Added.
1658         (WebKit::generateIdentifier):
1659         Return a unique identifier.
1660
1661         (WebKit::WebUserContentControllerProxy::create):
1662         Return a new WebUserContentControllerProxy object.
1663
1664         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
1665         Initialize m_identifier.
1666
1667         (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy):
1668         Add destructor.
1669
1670         (WebKit::WebUserContentControllerProxy::addProcess):
1671         Add the process to the m_processes set. If it's the first time doing so, add the user scripts we know about.
1672
1673         (WebKit::WebUserContentControllerProxy::removeProcess):
1674         Remove the process from m_processes.
1675
1676         (WebKit::WebUserContentControllerProxy::addUserScript):
1677         Add the user script and let all the web processes know that it was added.
1678
1679         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
1680         Remove all user scripts and tell all the web processes about it.
1681         
1682         * UIProcess/UserContent/WebUserContentControllerProxy.h:
1683         Add new class.
1684
1685         * UIProcess/WebPageProxy.cpp:
1686         (WebKit::WebPageProxy::WebPageProxy):
1687         If the process is already running, add it to the user content controller.
1688
1689         (WebKit::WebPageProxy::close):
1690         If the process is running, remove it from the user content controller.
1691
1692         (WebKit::WebPageProxy::connectionWillOpen):
1693         Add the process to the user content controller.
1694
1695         (WebKit::WebPageProxy::resetStateAfterProcessExited):
1696         Remove the process from the user content controller.
1697
1698         (WebKit::WebPageProxy::creationParameters):
1699         Pass along the user content controller ID when creating the web page.
1700
1701         * UIProcess/WebPageProxy.h:
1702         Add a WebUserContentControllerProxy object to the web page configuration.
1703
1704         * WebKit2.xcodeproj/project.pbxproj:
1705         Add new files.
1706
1707         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1708         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1709         Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename.
1710         
1711         * WebProcess/UserContent/WebUserContentController.cpp: Added.
1712         New class that manages a WebCore::UserContentController object.
1713
1714         (WebKit::WebUserContentController::getOrCreate):
1715         Look up (or create) a WebUserContentController object given its identifier.
1716
1717         (WebKit::WebUserContentController::WebUserContentController):
1718         Add ourselves as a message receiver.
1719
1720         (WebKit::WebUserContentController::~WebUserContentController):
1721         Remove ourselves as a message receiver.
1722
1723         (WebKit::WebUserContentController::addUserScripts):
1724         Add all passed in user scripts to the WebCore user content controller object.
1725
1726         (WebKit::WebUserContentController::removeAllUserScripts):
1727         Remove all user scripts from the WebCore user content controller object.
1728
1729         * WebProcess/UserContent/WebUserContentController.messages.in: Added.
1730         Add new messages file.
1731
1732         * WebProcess/WebPage/WebPage.cpp:
1733         (WebKit::WebPage::WebPage):
1734         Get a WebUserContentController object and pass it along to WebCore.
1735
1736         * WebProcess/WebPage/WebPage.h:
1737         Add WebUserContentController member.
1738
1739 2014-05-16  Piotr Grad  <p.grad@samsung.com>
1740
1741         [GTK] Build break after 168978.
1742         https://bugs.webkit.org/show_bug.cgi?id=133012.
1743
1744         Reviewed by Simon Fraser.
1745
1746         * UIProcess/API/gtk/WebKitSettings.cpp:
1747         (webKitSettingsConstructed):
1748
1749 2014-05-16  Simon Fraser  <simon.fraser@apple.com>
1750
1751         Put back a symbol removed in r168978 that Safari needs, but deprecate it.
1752
1753         Reviewed by Anders Carlsson.
1754
1755         * Shared/API/c/WKDeprecatedFunctions.cpp:
1756         (WKPreferencesSetRegionBasedColumnsEnabled):
1757         (WKPreferencesGetRegionBasedColumnsEnabled):
1758
1759 2014-05-16  Oliver Hunt  <oliver@apple.com>
1760
1761         Separate enabling sandbox extensions from the WEB_PROCESS_SANDBOX flag
1762         https://bugs.webkit.org/show_bug.cgi?id=133016
1763
1764         Reviewed by Alexey Proskuryakov.
1765
1766         Add a distinct SANDBOX_EXTENSIONS flag to guard sandbox extensions
1767         and switch over to it in the places that extensions are used.
1768
1769         * Shared/SandboxExtension.h:
1770         * Shared/mac/SandboxExtensionMac.mm:
1771         * UIProcess/WebPageProxy.cpp:
1772         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
1773         * WebKit2Prefix.h:
1774         * WebProcess/WebPage/WebPage.cpp:
1775         * WebProcess/WebPage/WebPage.h:
1776         * WebProcess/WebPage/WebPage.messages.in:
1777         * WebProcess/cocoa/WebProcessCocoa.mm:
1778         (WebKit::WebProcess::platformInitializeWebProcess):
1779
1780 2014-05-16  Benjamin Poulain  <bpoulain@apple.com>
1781
1782         [iOS][WK2] Add a heuristic to set the right horizontal offset on rotation for responsive websites
1783         https://bugs.webkit.org/show_bug.cgi?id=132937
1784         <rdar://problem/16710097>
1785
1786         Reviewed by Simon Fraser.
1787
1788         When responsive websites have the content size lay out larger than the minimal layout size,
1789         we should not keep the relative horizontal position into view,
1790         many of those websites have all the content on the left.
1791
1792         * WebProcess/WebPage/ios/WebPageIOS.mm:
1793         (WebKit::WebPage::dynamicViewportSizeUpdate):
1794
1795 2014-05-16  Benjamin Poulain  <bpoulain@apple.com>
1796
1797         [iOS][WK2] On dynamic resize, the content offset is contrained to the old content size
1798         https://bugs.webkit.org/show_bug.cgi?id=132972
1799
1800         Reviewed by Simon Fraser.
1801
1802         When we set the content offset, UIScrollView limits the value to the current valid range for
1803         content size. Since the content size was only updated after the animation, when the first frame
1804         comes in, the content offset would sometimes be limited to a smaller rect that the actual content.
1805
1806         To fix this, set the expected future content size before changing the offset.
1807
1808         During the animation, the content size could have changed arbitrarily. At the end of the animation,
1809         we take the actual frame and set the definite content size.
1810         Any update after that will be regular updates through didCommitLayer. 
1811
1812         * UIProcess/API/Cocoa/WKWebView.mm:
1813         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1814         (-[WKWebView _endAnimatedResize]):
1815
1816 2014-05-16  Simon Fraser  <simon.fraser@apple.com>
1817
1818         Remove "region-based columns" prefs
1819         https://bugs.webkit.org/show_bug.cgi?id=133006
1820         <rdar://problem/16945824>
1821
1822         Reviewed by Dave Hyatt.
1823
1824         Remove "region-based columns" prefs and related code, since this is only
1825         way to render columns now.
1826
1827         * Shared/WebPreferencesStore.h:
1828         * UIProcess/API/C/WKPreferences.cpp:
1829         (WKPreferencesSetRegionBasedColumnsEnabled): Deleted.
1830         (WKPreferencesGetRegionBasedColumnsEnabled): Deleted.
1831         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1832         * WebProcess/WebPage/WebPage.cpp:
1833         (WebKit::WebPage::updatePreferences):
1834
1835 2014-05-16  Brent Fulgham  <bfulgham@apple.com>
1836
1837         Work around bug in Silverlight
1838         https://bugs.webkit.org/show_bug.cgi?id=133004
1839
1840         Reviewed by Anders Carlsson.
1841
1842         * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm:
1843         (WebKit::PluginProcessMainDelegate::doPreInitializationWork): Add low-resolution flag
1844         to user defaults prior to NSApplication invocation. This code was moved from
1845         PluginProcess::platformInitializeProcess.
1846         * PluginProcess/mac/PluginProcessMac.mm:
1847         (WebKit::PluginProcess::platformInitializeProcess): Move low-resolution flag
1848         setting to PluginProcessMainDelegate.
1849
1850 2014-05-16  Martin Hodovan  <mhodovan.u-szeged@partner.samsung.com>
1851
1852         [WK2] Change the remaining framework includes from WebKit2 to WebKit
1853         https://bugs.webkit.org/show_bug.cgi?id=132956
1854
1855         Reviewed by Sam Weinig.
1856
1857         * NetworkProcess/unix/NetworkProcessMainUnix.cpp:
1858         * NetworkProcess/unix/NetworkProcessMainUnix.h:
1859         * PluginProcess/unix/PluginProcessMainUnix.h:
1860         * Shared/API/c/cairo/WKImageCairo.h:
1861         * Shared/API/c/cf/WKURLRequestCF.h:
1862         * Shared/API/c/cf/WKURLResponseCF.h:
1863         * Shared/API/c/efl/WKArrayEfl.cpp:
1864         * Shared/API/c/efl/WKArrayEfl.h:
1865         * UIProcess/API/C/CoordinatedGraphics/WKView.h:
1866         * UIProcess/API/C/WKBatteryManager.h:
1867         * UIProcess/API/C/WKBatteryStatus.h:
1868         * UIProcess/API/C/WKGrammarDetail.h:
1869         * UIProcess/API/C/WKTextChecker.h:
1870         * UIProcess/API/C/WKVibration.h:
1871         * UIProcess/API/C/WKViewportAttributes.h:
1872         * UIProcess/API/C/cairo/WKIconDatabaseCairo.h:
1873         * UIProcess/API/C/efl/WKAPICastEfl.h:
1874         * UIProcess/API/C/efl/WKColorPickerResultListener.h:
1875         * UIProcess/API/C/efl/WKEventEfl.h:
1876         * UIProcess/API/C/efl/WKPageEfl.h:
1877         * UIProcess/API/C/efl/WKPopupItem.h:
1878         * UIProcess/API/C/efl/WKPopupMenuListener.h:
1879         * UIProcess/API/C/efl/WKViewEfl.cpp:
1880         * UIProcess/API/C/efl/WKViewEfl.h:
1881         * UIProcess/API/C/gtk/WKFullScreenClientGtk.h:
1882         * UIProcess/API/C/gtk/WKInspectorClientGtk.h:
1883         * UIProcess/API/C/gtk/WKView.h:
1884         * UIProcess/API/C/gtk/WKViewPrivate.h:
1885         * UIProcess/API/C/soup/WKContextSoup.h:
1886         * UIProcess/API/C/soup/WKCookieManagerSoup.h:
1887         * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h:
1888         * UIProcess/API/C/soup/WKSoupRequestManager.h:
1889         * UIProcess/API/Cocoa/WKErrorRecoveryAttempting.h:
1890         * UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.h:
1891         * UIProcess/API/cpp/efl/WKEinaSharedString.cpp:
1892         * UIProcess/API/cpp/efl/WKEinaSharedString.h:
1893         * UIProcess/API/efl/EwkView.cpp:
1894         * UIProcess/API/efl/EwkView.h:
1895         * UIProcess/API/efl/EwkViewCallbacks.h:
1896         * UIProcess/API/efl/GestureRecognizer.h:
1897         * UIProcess/API/efl/ewk_application_cache_manager_private.h:
1898         * UIProcess/API/efl/ewk_auth_request_private.h:
1899         * UIProcess/API/efl/ewk_back_forward_list_item_private.h:
1900         * UIProcess/API/efl/ewk_back_forward_list_private.h:
1901         * UIProcess/API/efl/ewk_context_menu_item.cpp:
1902         * UIProcess/API/efl/ewk_context_private.h:
1903         * UIProcess/API/efl/ewk_cookie_manager_private.h:
1904         * UIProcess/API/efl/ewk_database_manager_private.h:
1905         * UIProcess/API/efl/ewk_error_private.h:
1906         * UIProcess/API/efl/ewk_favicon_database_private.h:
1907         * UIProcess/API/efl/ewk_file_chooser_request_private.h:
1908         * UIProcess/API/efl/ewk_page_group_private.h:
1909         * UIProcess/API/efl/ewk_popup_menu_item_private.h:
1910         * UIProcess/API/efl/ewk_popup_menu_private.h:
1911         * UIProcess/API/efl/ewk_security_origin_private.h:
1912         * UIProcess/API/efl/ewk_settings_private.h:
1913         * UIProcess/API/efl/ewk_storage_manager_private.h:
1914         * UIProcess/API/efl/ewk_view.cpp:
1915         * UIProcess/API/efl/ewk_view_private.h:
1916         * UIProcess/API/efl/ewk_window_features_private.h:
1917         * UIProcess/API/efl/tests/InjectedBundle/injected_bundle_sample.cpp:
1918         * UIProcess/API/efl/tests/test_ewk2_eina_shared_string.cpp:
1919         * UIProcess/API/gtk/WebKitDownloadClient.cpp:
1920         * UIProcess/API/gtk/WebKitPrivate.h:
1921         * UIProcess/CoordinatedGraphics/WKCoordinatedSceneAPICast.h:
1922         * UIProcess/efl/BatteryProvider.h:
1923         * UIProcess/efl/ContextHistoryClientEfl.h:
1924         * UIProcess/efl/DownloadManagerEfl.h:
1925         * UIProcess/efl/FindClientEfl.h:
1926         * UIProcess/efl/FormClientEfl.h:
1927         * UIProcess/efl/PageLoadClientEfl.h:
1928         * UIProcess/efl/PagePolicyClientEfl.h:
1929         * UIProcess/efl/PageUIClientEfl.h:
1930         * UIProcess/efl/RequestManagerClientEfl.h:
1931         * UIProcess/efl/TextCheckerClientEfl.h:
1932         * UIProcess/efl/VibrationClientEfl.h:
1933         * UIProcess/efl/ViewClientEfl.cpp:
1934         * UIProcess/efl/ViewClientEfl.h:
1935         * UIProcess/efl/WebInspectorProxyEfl.cpp:
1936         * WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp:
1937         * WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp:
1938         * WebProcess/efl/SeccompFiltersWebProcessEfl.cpp:
1939         * WebProcess/efl/SeccompFiltersWebProcessEfl.h:
1940         * WebProcess/efl/WebProcessMainEfl.cpp:
1941         * WebProcess/efl/WebProcessMainEfl.h:
1942         * WebProcess/gtk/WebGtkInjectedBundleMain.cpp:
1943         * WebProcess/gtk/WebProcessMainGtk.cpp:
1944         * WebProcess/gtk/WebProcessMainGtk.h:
1945         * mac/WKPreferences.h:
1946
1947 2014-05-15  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1948
1949         [EFL][WK2] Skip failing unit tests
1950         https://bugs.webkit.org/show_bug.cgi?id=132979
1951
1952         Reviewed by Daniel Bates.
1953
1954         * PlatformEfl.cmake: Skip failing unit tests for now.
1955
1956 2014-05-15  Simon Fraser  <simon.fraser@apple.com>
1957
1958         [iOS WK2] When zoomed, fixed elements jump at the start of a scroll, and jump back at the end.
1959         https://bugs.webkit.org/show_bug.cgi?id=132978
1960         <rdar://problem/16894428>
1961
1962         Reviewed by Benjamin Poulain.
1963         
1964         Move the static function fixedPositionRectFromExposedRect() to a member function on
1965         WebPageProxy so we can call it from more places. Also never give WebCore a customFixedPosition
1966         rect that extends past the document bounds, but allow rubber-banding/pinching in the UI process to
1967         move fixed elements outside the document.
1968         
1969         * UIProcess/PageClient.h: Need to expose minimumZoomScale() and contentsSize() to WebPageProxy.
1970         * UIProcess/WebPageProxy.h:
1971         * UIProcess/ios/PageClientImplIOS.h:
1972         * UIProcess/ios/PageClientImplIOS.mm:
1973         (WebKit::PageClientImpl::minimumZoomScale):
1974         (WebKit::PageClientImpl::contentsSize):
1975         * UIProcess/ios/WKContentView.mm:
1976         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
1977         Pass the computeCustomFixedPositionRect(ConstrainedToDocumentRect) to WebCore, but use computeCustomFixedPositionRect()
1978         for the ScrollingCoordinator update.
1979         (adjustedUnexposedEdge): Deleted.
1980         (adjustedUnexposedMaxEdge): Deleted.
1981         (fixedPositionRectFromExposedRect): Deleted.
1982         * UIProcess/ios/WebPageProxyIOS.mm:
1983         (WebKit::adjustedUnexposedEdge):
1984         (WebKit::adjustedUnexposedMaxEdge):
1985         (WebKit::WebPageProxy::computeCustomFixedPositionRect):
1986         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1987         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): This fixes some flashing when the scrolling tree
1988         was being updated while scrolling; we now pass the correct rect.
1989
1990 2014-05-15  Mark Rowe  <mrowe@apple.com>
1991
1992         <https://webkit.org/b/132976> Move discovery of sharing services off the main thread
1993
1994         Discovery of sharing services can require disk access and IPC. Since the interface to
1995         ServicesController is already asynchronous, we can easily perform the discovery on a
1996         background queue. This can eliminate tens to hundreds of milliseconds worth of work
1997         from the main thread when creating the first web process.
1998
1999         Reviewed by Brady Eidson.
2000
2001         * UIProcess/mac/ServicesController.h:
2002         * UIProcess/mac/ServicesController.mm:
2003         (WebKit::ServicesController::ServicesController):
2004         (WebKit::ServicesController::refreshExistingServices): Bail out early if we're already
2005         in the process of refreshing the services. Kick the discovery over to a background queue,
2006         with it hopping back to the main queue to update the actual state and notify any contexts
2007         that were interested.
2008
2009 2014-05-15  Dan Bernstein  <mitz@apple.com>
2010
2011         Fixed a typo in a comment and updated previous change log entry.
2012
2013         * WebProcess/WebPage/ios/WebPageIOS.mm:
2014         (WebKit::WebPage::elementDidFocus):
2015
2016 2014-05-15  Dan Bernstein  <mitz@apple.com>
2017
2018         <rdar://problem/16844952> [iOS] www.wikipedia.org is loading much slower due to FormClient::willBeginInputSession
2019         https://bugs.webkit.org/show_bug.cgi?id=132974
2020
2021         Reviewed by Enrica Casucci.
2022
2023         * WebProcess/WebPage/ios/WebPageIOS.mm:
2024         (WebKit::WebPage::elementDidFocus): Don’t call FormClient::willBeginInputSession if the
2025         focus isn’t user-initiated, because in that case the UI process will bail out of
2026         -_startAssistingNode:userIsInteracting:userObject: before creating an input session and
2027         calling the -_webView:didStartInputSession:.
2028
2029 2014-05-15  Benjamin Poulain  <bpoulain@apple.com>
2030
2031         [iOS][WK2] WKWebView sends invalid content offsets at the end of animated resize
2032         https://bugs.webkit.org/show_bug.cgi?id=132941
2033         <rdar://problem/16921557>
2034
2035         Reviewed by Tim Horton.
2036
2037         Since we cannot change the scale and content inset simultaneously while accounting for the obscured insets,
2038         we end up with invalid contentOffsets.
2039
2040         To work around the problem, change the content scale outside of UIScrollView to ensure none of the side effect
2041         happens.
2042
2043         * UIProcess/API/Cocoa/WKWebView.mm:
2044         (-[WKWebView _endAnimatedResize]):
2045
2046 2014-05-15  Tim Horton  <timothy_horton@apple.com>
2047
2048         WebKit2 View Gestures (Zoom): Document size changes during zoom gesture cause erratic scrolling
2049         https://bugs.webkit.org/show_bug.cgi?id=132944
2050         <rdar://problem/15769454>
2051
2052         Reviewed by Simon Fraser.
2053
2054         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2055         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2056         If a layer flush occurs and we have an active transient zoom,
2057         re-apply the transient zoom to the relevant platform layers, because
2058         WebCore might have overwritten the relevant layer properties.
2059
2060         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
2061         Reset m_transientZoomScale before flushLayers() so that we don't
2062         re-apply the transient zoom when we're actually trying to commit it.
2063
2064 2014-05-15  Alex Christensen  <achristensen@webkit.org>
2065
2066         Add pointer lock to features without enabling it.
2067         https://bugs.webkit.org/show_bug.cgi?id=132961
2068
2069         Reviewed by Sam Weinig.
2070
2071         * Configurations/FeatureDefines.xcconfig:
2072         Added ENABLE_POINTER_LOCK to list of features.
2073
2074 2014-05-15  Simon Fraser  <simon.fraser@apple.com>
2075
2076         [UI-side compositing] Fix copying animations between layers, and pausing them
2077         https://bugs.webkit.org/show_bug.cgi?id=132943
2078         <rdar://problem/16906369&16906541>
2079
2080         Reviewed by Tim Horton.
2081         
2082         Fix PlatformCAAnimationRemote to support animation copying, and to record
2083         the beginTime for implicitly started animations. This fixes animation pausing,
2084         and copying of animations between layers when they go between tiled and non-tiled.
2085         
2086         This requires sending the animation key back through animationDidStart() so that
2087         we can record this beginTime on the PlatformCAAnimationRemote in the web process.
2088         This path doesn't set the "hasExplicitBeginTime" flag.
2089         
2090         PlatformCAAnimationRemote also now stores a hash of active animations, so that
2091         it can implement animationForKey(), and record the beginTime.
2092
2093         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2094         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2095         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
2096         * UIProcess/mac/RemoteLayerTreeHost.h:
2097         * UIProcess/mac/RemoteLayerTreeHost.mm:
2098         (WebKit::RemoteLayerTreeHost::animationDidStart): Grovel for the key for this
2099         animation; sadly CA doesn't give us an easier way.
2100         * WebProcess/WebPage/DrawingArea.h:
2101         (WebKit::DrawingArea::acceleratedAnimationDidStart):
2102         * WebProcess/WebPage/DrawingArea.messages.in:
2103         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
2104         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
2105         (-[WKAnimationDelegate animationDidStart:]):
2106         (WebKit::PlatformCAAnimationRemote::copy):
2107         (WebKit::PlatformCAAnimationRemote::copyTimingFunctionFrom):
2108         (WebKit::PlatformCAAnimationRemote::copyFromValueFrom):
2109         (WebKit::PlatformCAAnimationRemote::copyToValueFrom):
2110         (WebKit::PlatformCAAnimationRemote::copyValuesFrom):
2111         (WebKit::PlatformCAAnimationRemote::copyKeyTimesFrom):
2112         (WebKit::PlatformCAAnimationRemote::copyTimingFunctionsFrom):
2113         (WebKit::addAnimationToLayer):
2114         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2115         (WebKit::PlatformCALayerRemote::addAnimationForKey):
2116         (WebKit::PlatformCALayerRemote::removeAnimationForKey):
2117         (WebKit::PlatformCALayerRemote::animationForKey):
2118         (WebKit::PlatformCALayerRemote::animationStarted):
2119         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2120         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
2121         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
2122         (WebKit::RemoteLayerTreeContext::animationDidStart):
2123         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2124         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2125         (WebKit::RemoteLayerTreeDrawingArea::acceleratedAnimationDidStart):
2126
2127 2014-05-14  Simon Fraser  <simon.fraser@apple.com>
2128
2129         Clean up "has non-zero begin time" terminology in animations
2130         https://bugs.webkit.org/show_bug.cgi?id=132942
2131
2132         Reviewed by Tim Horton.
2133
2134         Change the "non-zero beginTime" terminology in the platform CA animations
2135         code to "explicit beginTime": this flag really means that we explicitly set
2136         the beginTime of the animation, rather than let CA set the beginTime when
2137         committing the animation. This flag is used for animations with negative
2138         delay, and when pausing.
2139
2140         * Shared/mac/RemoteLayerTreeTransaction.mm:
2141         (WebKit::RemoteLayerTreeTextStream::operator<<):
2142         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
2143         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
2144         (-[WKAnimationDelegate animationDidStart:]):
2145         (WebKit::PlatformCAAnimationRemote::Properties::encode):
2146         (WebKit::PlatformCAAnimationRemote::Properties::decode):
2147         (WebKit::PlatformCAAnimationRemote::setBeginTime):
2148         (WebKit::addAnimationToLayer):
2149
2150 2014-05-15  Tim Horton  <timothy_horton@apple.com>
2151
2152         [iOS] Incremental updates during scroll-to-top shouldn’t count as “stable” updates
2153         https://bugs.webkit.org/show_bug.cgi?id=132934
2154
2155         Reviewed by Simon Fraser.
2156
2157         * UIProcess/API/Cocoa/WKWebView.mm:
2158         (-[WKWebView _updateVisibleContentRects]):
2159         If we're in a scroll-to-top programmatic scroll, the update is not stable.
2160         The last event comes in with _isScrollingToTop false, so we do our stable update.
2161
2162 2014-05-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2163
2164         [GTK] Compile all installed resources as GResources
2165         https://bugs.webkit.org/show_bug.cgi?id=131099
2166
2167         Reviewed by Philippe Normand.
2168
2169         It avoids conflicts with old WebKit versions, and resources are
2170         always found even without installing or using environment variables.
2171
2172         * PlatformGTK.cmake: Add rules to write the xml file with the
2173         resources depending on the configure options and to generate and
2174         build the GResources file.
2175
2176 2014-05-14  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2177
2178         [EFL][WK2] Fix an unit test of ewk_context_url_scheme_register()
2179         https://bugs.webkit.org/show_bug.cgi?id=132902
2180
2181         Reviewed by Anders Carlsson.
2182
2183         This test can be run when CUSTOM_PROTOCOL is enabled. Besides the test needs 
2184         to check if registered callback function works well.
2185
2186         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
2187         (EWK2ContextTest::schemeRequestCallback):
2188         (TEST_F):
2189
2190 2014-05-14  Ryuan Choi  <ryuan.choi@samsung.com>
2191
2192         [EFL][WK2] Use default context for ewk_view_add
2193         https://bugs.webkit.org/show_bug.cgi?id=132936
2194
2195         Reviewed by Gyuyoung Kim.
2196
2197         Since r146265, ewk_view_add created new context and it's regression.
2198         This patch restores the behavior of ewk_view_add to original one.
2199
2200         * UIProcess/API/efl/ewk_view.cpp:
2201         (ewk_view_add):
2202         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
2203         (TEST_F):
2204
2205 2014-05-14  Maciej Stachowiak  <mjs@apple.com>
2206
2207         Database Process crashes after loading html5test.com
2208         https://bugs.webkit.org/show_bug.cgi?id=132938
2209         <rdar://problem/16241419>
2210
2211         Reviewed by Ryosuke Niwa.
2212
2213         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
2214         (WebKit::DatabaseProcessIDBConnection::disconnectedFromWebProcess): Expand comment
2215         about the null check.
2216         (WebKit::DatabaseProcessIDBConnection::deleteDatabase): Call disconnectedFromWebProcess
2217         to pick up its null check and to avoid duplicating code.
2218
2219 2014-05-14  Benjamin Poulain  <bpoulain@apple.com>
2220
2221         [iOS][WK2] The top/bottom edges should not be sticky when restoring the scroll position from the dynamic size update history
2222         https://bugs.webkit.org/show_bug.cgi?id=132931
2223
2224         Reviewed by Sam Weinig.
2225
2226         The goal of dynamicSizeUpdateHistory is to make dynamic resize completely reversible.
2227         Because of the stick-to-edges heuristics, this was not true near the top and bottom edges.
2228
2229         For example, start in landscape, scroll the page a bit, then rotate to portrait. Now you have
2230         a lot more vertical space, and the top edge of the document is at the edge of the scrollview.
2231         Rotate back to landscape: the position is restored  correct, but it is then overriden by
2232         the stick-to-edges branch.
2233
2234         When we restore the position from history, we should only put it back in the valid bounds, skipping
2235         stick-to-edges entirely.
2236
2237         * WebProcess/WebPage/ios/WebPageIOS.mm:
2238         (WebKit::WebPage::dynamicViewportSizeUpdate):
2239
2240 2014-05-14  Tim Horton  <timothy_horton@apple.com>
2241
2242         Enable IOSurface view snapshots for 10.9+
2243         https://bugs.webkit.org/show_bug.cgi?id=132932
2244         <rdar://problem/16900619>
2245
2246         Reviewed by Dean Jackson.
2247
2248         * UIProcess/mac/ViewSnapshotStore.h:
2249         r166005 unintentionally worked around <rdar://problem/16734031>.
2250         r168689 fixed another bug that caused sometimes randomly white snapshots.
2251         It's safe to turn on IOSurface view snapshots where purgeability is supported.
2252
2253 2014-05-14  Alexey Proskuryakov  <ap@apple.com>
2254
2255         Use the correct client in WebPageProxy::unwrapCryptoKey
2256         https://bugs.webkit.org/show_bug.cgi?id=132924
2257
2258         Reviewed by Darin Adler.
2259
2260         * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::unwrapCryptoKey): Match what
2261         we now do in wrapCryptoKey().
2262
2263 2014-05-14  Zalan Bujtas  <zalan@apple.com>
2264
2265         Subpixel layout: Change Element.offset* client* scroll* return type to double.
2266         https://bugs.webkit.org/show_bug.cgi?id=132895
2267
2268         Reviewed by Simon Fraser.
2269
2270         This patch changes Element.offset*, Element.client* and Element.scroll* APIs return
2271         type from long to double to match the latest CSSOM View Module spec[1].
2272         Element.offset* and Element.client* do return subpixel values from now on.
2273         Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet.
2274
2275         subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off
2276         from WK2 preferences. It toggles the return value from subpixel to floored integral.
2277         It does not change layout/rendering behavior.
2278
2279         Reference list of what other browsers do:
2280         IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx
2281         Blink: http://www.chromestatus.com/features/5497402177880064
2282         Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607
2283
2284         [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/
2285
2286         * Shared/WebPreferencesStore.h:
2287         * UIProcess/API/C/WKPreferences.cpp:
2288         (WKPreferencesSetSubpixelCSSOMElementMetricsEnabled):
2289         (WKPreferencesGetSubpixelCSSOMElementMetricsEnabled):
2290         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2291         * WebProcess/WebPage/WebPage.cpp:
2292         (WebKit::WebPage::updatePreferences):
2293
2294 2014-05-14  Benjamin Poulain  <bpoulain@apple.com>
2295
2296         [iOS][WK2] Expose the viewport meta tag width on the UIProcess
2297         https://bugs.webkit.org/show_bug.cgi?id=132926
2298         <rdar://problem/16892115>
2299
2300         Reviewed by Sam Weinig.
2301
2302         Safari requires the viewport meta tag width for legacy stuff on WebApps. Just send it
2303         over to the UIProcess when it changes.
2304
2305         * UIProcess/API/Cocoa/WKWebView.mm:
2306         (-[WKWebView initWithFrame:configuration:]):
2307         (-[WKWebView _setViewportMetaTagWidth:]):
2308         (-[WKWebView _viewportMetaTagWidth]):
2309         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2310         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2311         * UIProcess/PageClient.h:
2312         * UIProcess/WebPageProxy.h:
2313         * UIProcess/WebPageProxy.messages.in:
2314         * UIProcess/ios/PageClientImplIOS.h:
2315         * UIProcess/ios/PageClientImplIOS.mm:
2316         (WebKit::PageClientImpl::didChangeViewportMetaTagWidth):
2317         * UIProcess/ios/WebPageProxyIOS.mm:
2318         (WebKit::WebPageProxy::viewportMetaTagWidthDidChange):
2319         * WebProcess/WebPage/ios/WebPageIOS.mm:
2320         (WebKit::WebPage::viewportPropertiesDidChange):
2321
2322 2014-05-13  Simon Fraser  <simon.fraser@apple.com>
2323
2324         [iOS WK2] Make view debugging easier
2325         https://bugs.webkit.org/show_bug.cgi?id=132892
2326
2327         Reviewed by Tim Horton.
2328         
2329         Enhance -[WKCompositingView description] to show WebKit-related information
2330         which is useful when dumping a window's UIView hierarchy.
2331         
2332         Also have WKTransformView and WKRemoteView inherit from WKCompositingView,
2333         and thereby get the hitTest:withEvent: override for free, as well as better dumping.
2334
2335         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
2336         (-[WKCompositingView description]):
2337         (-[WKTransformView hitTest:withEvent:]): Deleted.
2338         (-[WKRemoteView hitTest:withEvent:]): Deleted.
2339
2340 2014-05-14  Benjamin Poulain  <bpoulain@apple.com>
2341
2342         [iOS][WK2] Fixed positioned element must relayout correctly before sending resize events to the page
2343         https://bugs.webkit.org/show_bug.cgi?id=132920
2344         <rdar://problem/16836866>
2345
2346         Reviewed by Simon Fraser.
2347
2348         During the dynamic resize operation, we do not update the fixed position elements because
2349         it is a very hard problem on the UI Process side.
2350
2351         When the animation finishes, the fixed positioned rect is recomputed on the UIProcess and pushed
2352         to the WebProcess.
2353
2354         The problem is sending the rect after the animation is too late, the content can observe the fixed
2355         elements layout through JavaScript and would get the old size.
2356
2357         This patch fixes the issue updating the CustomFixedPositionLayoutRect on the WebProcess before
2358         notifying the content of the resize.
2359         First, we layout the content to the new fixed layout size to get the new content size.
2360         Then, we compute the new FixedPositionedLayoutRect with FrameView's viewportConstrainedObjectsRect(),
2361         this use the real content size and our estimated unobscured content rect.
2362
2363         * WebProcess/WebPage/ios/WebPageIOS.mm:
2364         (WebKit::WebPage::dynamicViewportSizeUpdate):
2365
2366 2014-05-14  Enrica Casucci  <enrica@apple.com>
2367
2368         REGRESSION(WK2): Many pages have very wrong text size after rotating.
2369         https://bugs.webkit.org/show_bug.cgi?id=132893
2370         <rdar://problem/16806958>
2371
2372         Reviewed by Benjamin Poulain.
2373
2374         Whenever our viewport width changes we must reset text autosizing
2375         on the renderer.
2376
2377         * WebProcess/WebPage/WebPage.h:
2378         * WebProcess/WebPage/ios/WebPageIOS.mm:
2379         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
2380         (WebKit::WebPage::setMinimumLayoutSizeForMinimalUI):
2381         (WebKit::WebPage::resetTextAutosizingBeforeLayoutIfNeeded):
2382         (WebKit::WebPage::dynamicViewportSizeUpdate):
2383
2384 2014-05-14  Alex Christensen  <achristensen@webkit.org>
2385
2386         Use references instead of pointers with ResourceLoadTiming.
2387         https://bugs.webkit.org/show_bug.cgi?id=132846
2388
2389         Reviewed by Alexey Proskuryakov.
2390
2391         * Shared/WebCoreArgumentCoders.cpp:
2392         (IPC::ArgumentCoder<ResourceResponse>::encode):
2393         (IPC::ArgumentCoder<ResourceResponse>::decode):
2394         Use references instead of pointers and null checks.
2395
2396 2014-05-14  Tibor Meszaros  <tmeszaros.u-szeged@partner.samsung.com>
2397
2398         Remove CSS_STICKY_POSITION guards
2399         https://bugs.webkit.org/show_bug.cgi?id=132676
2400
2401         Reviewed by Simon Fraser.
2402
2403         * Configurations/FeatureDefines.xcconfig:
2404
2405 2014-05-13  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2406
2407         [EFL][WK2] Add ewk_view_fixed_layout_size_set|get()
2408         https://bugs.webkit.org/show_bug.cgi?id=132811
2409
2410         Reviewed by Christophe Dumez.
2411
2412         Some EFL applications need to set size of fixed layout when enabling fixed layout.
2413         This APIs can pass ownership regarding the size of fixed layout to application side.
2414
2415         * UIProcess/API/efl/ewk_view.cpp:
2416         (ewk_view_layout_fixed_size_set):
2417         (ewk_view_layout_fixed_size_get):
2418         * UIProcess/API/efl/ewk_view.h:
2419         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
2420         (TEST_F):
2421
2422 2014-05-13  Simon Fraser  <simon.fraser@apple.com>
2423
2424         Fix "ASSERTION FAILED: m_representation == PlatformLayerRepresentation" with UI-side compositing
2425         https://bugs.webkit.org/show_bug.cgi?id=132899
2426
2427         Reviewed by Beth Dakin.
2428         
2429         The new InsetClipLayer and ContentShadowLayer members on scrolling nodes
2430         need to be correctly encoded/decoded for UI-side compositing, and dumped
2431         correctly.
2432
2433         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
2434         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
2435         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
2436         (WebKit::RemoteScrollingTreeTextStream::dump):
2437         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
2438         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2439
2440 2014-05-13  Anders Carlsson  <andersca@apple.com>
2441
2442         Another build fix.
2443
2444         Reviewed by Dan Bernstein.
2445
2446         * Shared/API/Cocoa/WKFoundation.h:
2447         Make sure to include Availability.h
2448
2449 2014-05-13  Beth Dakin  <bdakin@apple.com>
2450
2451         REGRESSION (topContentInset): Searching through Facebook Messenger's chat causes 
2452         scrolling in News Feed
2453         https://bugs.webkit.org/show_bug.cgi?id=132889
2454         -and corresponding-
2455         <rdar://problem/16715716>
2456
2457         Reviewed by Simon Fraser.
2458
2459         Re-name scrollOffsetRelativeToDocument() to 
2460         documentScrollPositionRelativeToViewOrigin().
2461         * WebProcess/WebPage/FindController.cpp:
2462         (WebKit::FindController::rectsForTextMatches):
2463         * WebProcess/WebPage/WebPage.cpp:
2464         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
2465
2466 2014-05-13  Dean Jackson  <dino@apple.com>
2467
2468         [iOS] Page scale update messages for media controls should only fire at the end of zooming
2469         https://bugs.webkit.org/show_bug.cgi?id=132857
2470         <rdar://problem/16631009>
2471
2472         Reviewed by Simon Fraser.
2473
2474         As the user was zooming, the media controls that responded
2475         to the page scale (and resized themselves) would do so
2476         slightly out of sync with the screen refreshes, and it looked
2477         terrible.
2478
2479         We already know if a pageScale change is happening inside
2480         a gesture using the inStableState property of the visibleContentRectUpdateInfo.
2481         Simply pass this along to WebCore::Page.
2482
2483         * WebProcess/WebPage/ios/WebPageIOS.mm:
2484         (WebKit::WebPage::updateVisibleContentRects): Pass inStableState onto the
2485         WebCore::Page. Note that we have to send this message even if the
2486         scale has not changed, since the last changing update might not have
2487         been stable.
2488
2489 2014-05-13  Benjamin Poulain  <bpoulain@apple.com>
2490
2491         [iOS][WK2] When the secondary UIScrollView delegates respond to callbacks, delay the state change until both delegates have finished
2492         https://bugs.webkit.org/show_bug.cgi?id=132849
2493         <rdar://problem/16863716>
2494
2495         Reviewed by Anders Carlsson.
2496
2497         When there are two delegates responding to UIScrollView changes, there was often an intermediate invalid
2498         state forwarded to the UIProcess.
2499
2500         For example, on scroll, WKWebView would update the state based on the current obscured insets in response to
2501         delegate callbacks.
2502         After that update, Safari would modify the insets, thus updating the state again.
2503         The first state changed by WKWebView is incomplete, and should never have been set.
2504
2505         This patch works around the issue by delaying visible update rect in those cases.
2506
2507         When the two delegates of WKScrollView respond to the same selector, WKScrollView invokes 
2508         [UIWebView _willInvokeUIScrollViewDelegateCallback] on entry, and
2509         [UIWebView _didInvokeUIScrollViewDelegateCallback] on exit.
2510
2511         Between those two calls, WKWebView does not forward the new UI state to the WebProcess.
2512
2513         * UIProcess/API/Cocoa/WKWebView.mm:
2514         (-[WKWebView _willInvokeUIScrollViewDelegateCallback]):
2515         (-[WKWebView _didInvokeUIScrollViewDelegateCallback]):
2516         (-[WKWebView _updateVisibleContentRects]):
2517         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2518         * UIProcess/API/ios/WKViewIOS.mm:
2519         (-[WKView _commonInitializationWithContextRef:pageGroupRef:relatedToPage:]):
2520         * UIProcess/ios/WKScrollView.h:
2521         * UIProcess/ios/WKScrollView.mm:
2522         (-[WKScrollViewDelegateForwarder initWithInternalDelegate:externalDelegate:]):
2523         (-[WKScrollViewDelegateForwarder forwardInvocation:]):
2524         (-[WKScrollView setInternalDelegate:]):
2525
2526 2014-05-13  Benjamin Poulain  <bpoulain@apple.com>
2527
2528         [iOS][WK2] Remove the _extendedBackgroundExclusionInsets SPI
2529         https://bugs.webkit.org/show_bug.cgi?id=132848
2530         <rdar://problem/16875093>
2531
2532         Reviewed by Darin Adler.
2533
2534         The SPI is no longer needed by Safari.
2535
2536         * UIProcess/API/Cocoa/WKWebView.mm:
2537         (-[WKWebView initWithFrame:configuration:]):
2538         (-[WKWebView _updateScrollViewBackground]):
2539         (-[WKWebView _frameOrBoundsChanged]):
2540         (-[WKWebView _setObscuredInsets:]):
2541         (-[WKWebView _endAnimatedResize]):
2542         (updateTopAndBottomExtendedBackgroundExclusionIfNecessary): Deleted.
2543         (-[WKWebView _setExtendedBackgroundExclusionInsets:]): Deleted.
2544         (-[WKWebView _extendedBackgroundExclusionInsets]): Deleted.
2545         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2546
2547 2014-05-13  Samuel White  <samuel_white@apple.com>
2548
2549         AX: Hit testing not accounting for top content inset.
2550         https://bugs.webkit.org/show_bug.cgi?id=132876
2551
2552         Reviewed by Chris Fleizach.
2553
2554         Updated accessibilityHitTest: to account for top content inset when converting from screen coords to WebKit coords.
2555
2556         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
2557         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
2558
2559 2014-05-13  Enrica Casucci  <enrica@apple.com>
2560
2561         REGRESSION (WebKit2): Zooming to text field leaves it partially hidden by the form assistant.
2562         https://bugs.webkit.org/show_bug.cgi?id=132879
2563         <rdar://problem/16318049>
2564
2565         Reviewed by Benjamin Poulain.
2566
2567         Adds the heuristics to zoom and scroll to ensure the element being focused
2568         is fully visible and its text readable.
2569
2570         * Shared/AssistedNodeInformation.cpp:
2571         (WebKit::AssistedNodeInformation::encode):
2572         (WebKit::AssistedNodeInformation::decode):
2573         * Shared/AssistedNodeInformation.h:
2574         (WebKit::AssistedNodeInformation::AssistedNodeInformation):
2575         * UIProcess/API/Cocoa/WKWebView.mm:
2576         (-[WKWebView _zoomToFocusRect:WebCore::selectionRect:WebCore::fontSize:minimumScale:maximumScale:allowUserScaling:forceScroll:]):
2577         (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
2578         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2579         * UIProcess/ios/WKContentView.h:
2580         * UIProcess/ios/WKContentView.mm:
2581         (-[WKContentView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowUserScaling:forceScroll:]):
2582         * UIProcess/ios/WKContentViewInteraction.mm:
2583         (-[WKContentView _displayFormNodeInputView]):
2584         (-[WKContentView _startAssistingNode:userIsInteracting:userObject:]):
2585         * WebProcess/WebPage/ios/WebPageIOS.mm:
2586         (WebKit::WebPage::getAssistedNodeInformation):
2587
2588 2014-05-13  Simon Fraser  <simon.fraser@apple.com>
2589
2590         Fix the iOS Simulator build.
2591
2592         * UIProcess/mac/ViewSnapshotStore.h:
2593
2594 2014-05-13  Tim Horton  <timothy_horton@apple.com>
2595
2596         Speculative build fix for iOS.
2597
2598         * UIProcess/ios/WebMemoryPressureHandlerIOS.cpp: Removed.
2599         * UIProcess/ios/WebMemoryPressureHandlerIOS.mm: Added.
2600         (WebKit::WebMemoryPressureHandler::shared):
2601         (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
2602         * WebKit2.xcodeproj/project.pbxproj:
2603         Make WebMemoryPressureHandlerIOS Obj-C.
2604
2605 2014-05-13  Anders Carlsson  <andersca@apple.com>
2606
2607         Another follow-up build fix.
2608
2609         * Shared/API/Cocoa/WKFoundation.h:
2610
2611 2014-05-13  Anders Carlsson  <andersca@apple.com>
2612
2613         Another follow-up build fix.
2614
2615         * Shared/API/Cocoa/WKFoundation.h:
2616
2617 2014-05-13  Anders Carlsson  <andersca@apple.com>
2618
2619         Follow-up fix.
2620
2621         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2622         (-[WKNavigationAction _initWithNavigationActionData:WebKit::]):
2623         (-[WKNavigationAction _isUserInitiated]):
2624
2625 2014-05-13  Anders Carlsson  <andersca@apple.com>
2626
2627         Add -[WKNavigationAction modifierFlags] and -[WKNavigationAction buttonNumber]
2628         https://bugs.webkit.org/show_bug.cgi?id=132880
2629         <rdar://problem/16901354>
2630
2631         Reviewed by Dan Bernstein.
2632
2633         * Shared/API/Cocoa/WKFoundation.h:
2634         Add typedef for older systems.
2635
2636         * UIProcess/API/Cocoa/WKNavigationAction.h:
2637         Add -[WKNavigationAction modifierFlags] and -[WKNavigationAction buttonNumber]
2638
2639         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2640         (toWKNavigationType):
2641         This can be static now.
2642
2643         (toNSEventModifierFlags):
2644         Helper to convert WebEvent::Modifiers to NSEventModifierFlags.
2645
2646         (toNSButtonNumber):
2647         Helper to convert WebMouseEvent::Button to an AppKit button number.
2648
2649         (-[WKNavigationAction initWithNavigationActionData:WebKit::]):
2650         New initializer that takes a NavigationActionData and fills in the relevant ivars from it.
2651
2652         (-[WKNavigationAction _isUserInitiated]):
2653         Return the new ivar.
2654
2655         * UIProcess/API/Cocoa/WKNavigationActionInternal.h:
2656         Remove readwrite overrides.
2657
2658         * UIProcess/Cocoa/NavigationState.mm:
2659         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
2660         Use initWithNavigationActionData:
2661
2662         * UIProcess/Cocoa/UIDelegate.mm:
2663         (WebKit::UIDelegate::UIClient::createNewPage):
2664         Use initWithNavigationActionData:
2665
2666 2014-05-13  Tim Horton  <timothy_horton@apple.com>
2667
2668         WebKit2 View Gestures (Swipe): Encode snapshots as JPEG on some platforms
2669         https://bugs.webkit.org/show_bug.cgi?id=127788
2670         <rdar://problem/15928241>
2671
2672         Reviewed by Anders Carlsson.
2673
2674         Allow JPEG snapshots. Compression is done asynchronously.
2675         Enable JPEG snapshots (for now) on all PLATFORM(MAC).
2676         We'll switch back to IOSurface snapshots on 10.9+ after <rdar://problem/16734031> is resolved.
2677
2678         * UIProcess/API/Cocoa/WKWebView.mm:
2679         * UIProcess/API/mac/WKView.mm:
2680         (-[WKView _takeViewSnapshot]):
2681         Store the image size on the ViewSnapshot.
2682         Move IOSurface-related code to ViewSnapshotStore.
2683
2684         * UIProcess/ios/ViewGestureControllerIOS.mm:
2685         (WebKit::ViewGestureController::beginSwipeGesture):
2686         Adopt asLayerContents().
2687
2688         * UIProcess/mac/ViewGestureController.h:
2689         * UIProcess/mac/ViewGestureControllerMac.mm:
2690         (WebKit::ViewGestureController::retrieveSnapshotForItem):
2691         (WebKit::ViewGestureController::beginSwipeGesture):
2692         (WebKit::ViewGestureController::removeSwipeSnapshot):
2693         Adopt asLayerContents().
2694         Put the snapshot on the right layer (the parent of the snapshot image layer);
2695         if it's on the snapshot image layer itself, if there is no image, the shadow
2696         is displayed on top of the white placeholder.
2697         Only reset snapshot purgeability if we're using IOSurface snapshots.
2698
2699         * UIProcess/mac/ViewSnapshotStore.h:
2700         Add a bunch of macros to allow us to switch the snapshot backing store implementation.
2701
2702         * UIProcess/mac/ViewSnapshotStore.mm:
2703         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
2704         (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
2705         (WebKit::ViewSnapshotStore::recordSnapshot):
2706         If takeViewSnapshot() fails, don't remove the existing snapshot.
2707
2708         (WebKit::createIOSurfaceFromImage):
2709         (WebKit::compressImageAsJPEG):
2710         (WebKit::ViewSnapshotStore::reduceSnapshotMemoryCost):
2711         (WebKit::ViewSnapshotStore::didCompressSnapshot):
2712         (WebKit::ViewSnapshot::clearImage):
2713         (WebKit::ViewSnapshot::asLayerContents):
2714         Asynchronously compress snapshots - if we're using JPEG snapshots - for a
2715         very large memory win (~20-30x).
2716
2717 2014-05-12  Darin Adler  <darin@apple.com>
2718
2719         Make a few icon database improvements
2720         https://bugs.webkit.org/show_bug.cgi?id=132812
2721
2722         Reviewed by Brady Eidson.
2723
2724         * UIProcess/API/C/WKIconDatabase.cpp:
2725         (WKIconDatabaseCopyIconDataForPageURL): Moved the actual implementation of this
2726         out of the bindings into the WebIconDatabase class.
2727
2728         * UIProcess/API/C/WKIconDatabase.h: Fixed argument names that were inconsistent.
2729
2730         * UIProcess/WebIconDatabase.cpp: Removed unneeded includes.
2731         (WebKit::WebIconDatabase::create): Pass a reference instead of a pointer.
2732         (WebKit::WebIconDatabase::WebIconDatabase): Take a reference instead of a pointer.
2733         (WebKit::WebIconDatabase::invalidate): Use nullptr.
2734         (WebKit::WebIconDatabase::setDatabasePath): Use make_unique.
2735         (WebKit::WebIconDatabase::setIconDataForIconURL): Removed unneeded local variable.
2736         (WebKit::WebIconDatabase::imageForPageURL): Use nullptr.
2737         (WebKit::WebIconDatabase::nativeImageForPageURL): Ditto.
2738         (WebKit::WebIconDatabase::didFinishURLImport): Use a modern for loop.
2739         (WebKit::WebIconDatabase::iconDataForPageURL): Added. Moved this here from
2740         WKIconDatabase.cpp, but also changed to use createWithoutCopying to avoid making
2741         another copy of the data for each icon.
2742
2743         * UIProcess/WebIconDatabase.h: Removed unneeded includes. Derive from
2744         IconDatabaseClient privately. Use nullptr. Added iconDataForPageURL member
2745         function. Use a reference for the constructor argument. Use override for
2746         virtual functions. Use unique_ptr instead of OwnPtr.
2747
2748 2014-05-12  Mark Lam  <mark.lam@apple.com>
2749
2750         WebKit2 on iOS needs to capture the main thread's floating point environment.
2751         <https://webkit.org/b/132755>
2752
2753         Reviewed by Geoffrey Garen.
2754
2755         * Shared/mac/ChildProcessMac.mm:
2756         (WebKit::ChildProcess::platformInitialize):
2757         - Call FloatingPointEnv::enableNeededFloatingPointModes() to initialize
2758           the ARMv7 FP env to support denormalized numbers.
2759         - Call FloatingPointEnv::saveMainThreadEnvironment() to capture the main thread
2760           fp env.
2761
2762 2014-05-12  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2763
2764         [EFL][WK2] Fix ewk_view_navigation test in EWK2ViewTest 
2765         https://bugs.webkit.org/show_bug.cgi?id=132817
2766
2767         Reviewed by Dirk Schulze.
2768
2769         To load test html pages, call ewk_view_uri_set() instead of EWK2UnitTestServer.
2770         Besides this patch adds test html page for ewk_view_navigation unit test.
2771
2772         * UIProcess/API/efl/tests/resources/Page1.html: Added.
2773         * UIProcess/API/efl/tests/resources/Page2.html: Added.
2774         * UIProcess/API/efl/tests/resources/Page3.html: Added.
2775         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
2776         (TEST_F):
2777
2778 2014-05-12  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2779
2780         Unreviewed, EFL build fix since r168625.
2781
2782         * UIProcess/efl/WebContextEfl.cpp:
2783         (WebKit::WebContext::platformDefaultLocalStorageDirectory): Remove const keyword.
2784
2785 2014-05-12  Simon Fraser  <simon.fraser@apple.com>
2786
2787         [iOS WK2] Fuzzy tiles on some sites on loading
2788         https://bugs.webkit.org/show_bug.cgi?id=132847
2789         <rdar://problem/16816178>
2790
2791         Reviewed by Benjamin Poulain.
2792         
2793         PlatformCALayerRemoteTiledBacking overrode setContentsScale() but not contentsScale(),
2794         causing us to early-return from GraphicsLayerCA::updateContentsScale() and leave the
2795         scale wrong. Fix by overriding contentsScale() also.
2796
2797         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
2798         (WebKit::PlatformCALayerRemoteTiledBacking::contentsScale):
2799         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
2800
2801 2014-05-12  Tim Horton  <timothy_horton@apple.com>
2802
2803         Triple-buffer RemoteLayerBackingStore
2804         https://bugs.webkit.org/show_bug.cgi?id=132786
2805         <rdar://problem/16877498>
2806
2807         Reviewed by Simon Fraser.
2808
2809         We need three buffers because we're currently unable to synchronize
2810         with the render server to swap when they're not in use, so we were
2811         throwing surfaces away far too frequently.
2812
2813         This hugely reduces time spent in IOSurface::create on various repaint benchmarks.
2814
2815         * Shared/mac/RemoteLayerBackingStore.h:
2816         (WebKit::RemoteLayerBackingStore::hasFrontBuffer):
2817         (WebKit::RemoteLayerBackingStore::volatility): Deleted.
2818         * Shared/mac/RemoteLayerBackingStore.mm:
2819         (WebKit::RemoteLayerBackingStore::RemoteLayerBackingStore):
2820         (WebKit::RemoteLayerBackingStore::clearBackingStore):
2821         (WebKit::RemoteLayerBackingStore::encode):
2822         (WebKit::RemoteLayerBackingStore::decode):
2823         (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
2824         (WebKit::RemoteLayerBackingStore::display):
2825         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
2826         (WebKit::RemoteLayerBackingStore::setBufferVolatility):
2827         (WebKit::RemoteLayerBackingStore::Buffer::discard):
2828         (WebKit::RemoteLayerBackingStore::setVolatility): Deleted.
2829         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
2830         (WebKit::RemoteLayerBackingStoreCollection::purgeabilityTimerFired):
2831         Put the ShareableBitmap/IOSurface and a volatility bit in a Buffer struct.
2832         Also factor out "throw away this buffer and put it in the pool" into Buffer::discard().
2833         We keep a volatility bit because querying IOSurface purgeability is expensive,
2834         and we have a guarantee that any changes will happen in the Web process
2835         and go through this class (the lack of this guarantee in most cases is why I'm not
2836         putting this bit in WebCore::IOSurface itself).
2837
2838         Make it so that each buffer's volatility can be adjusted individually
2839         by setBufferVolatility(), and adopt in RemoteLayerBackingStoreCollection.
2840
2841         Add a third buffer, m_secondaryBackBuffer, which will swap with the back buffer
2842         before swapping front and back if the back buffer (soon to be the front buffer)
2843         is still in use by the render server. This means that we will almost never
2844         have to throw away a surface because it's in use (and conversely never need
2845         to make a new surface).
2846
2847         Adjust RemoteLayerBackingStoreCollection to make secondary back surfaces purgeable
2848         more aggressively than others.
2849
2850 2014-05-12  Alexey Proskuryakov  <ap@apple.com>
2851
2852         REGRESSION (r165972): Can't type into text fields in Flash
2853         https://bugs.webkit.org/show_bug.cgi?id=132840
2854         <rdar://problem/16671969>
2855
2856         Reviewed by Anders Carlsson.
2857
2858         * UIProcess/API/mac/WKView.mm: (-[WKView inputContext]): Restore a function that
2859         got accidentally lost when adding async text input code.
2860
2861 2014-05-12  Chris Fleizach  <cfleizach@apple.com>
2862
2863         AX: .js dialogs shown in unload while AX is running crash WebKit.
2864         https://bugs.webkit.org/show_bug.cgi?id=123828
2865
2866         Reviewed by Anders Carlsson.
2867
2868         Utilize platform API to inform AX clients when the WebProcess will suspend and resume.
2869         This allows us to avoid having special behavior for accessibility when the WebProcess needs
2870         to wait on a reply.
2871
2872         * Platform/IPC/Connection.cpp:
2873         (IPC::Connection::waitForSyncReply):
2874         * Platform/IPC/Connection.h:
2875         * Platform/IPC/mac/ConnectionMac.cpp:
2876         (IPC::Connection::willSendSyncMessage):
2877         (IPC::Connection::didReceiveSyncReply):
2878         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2879         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
2880         (WebKit::WebChromeClient::runJavaScriptAlert):
2881         (WebKit::WebChromeClient::runJavaScriptConfirm):
2882         (WebKit::WebChromeClient::runJavaScriptPrompt):
2883         (WebKit::WebChromeClient::print):
2884         (WebKit::WebChromeClient::exceededDatabaseQuota):
2885         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2886         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2887
2888 2014-05-12  Alex Christensen  <achristensen@webkit.org>
2889
2890         Progress on web timing.
2891         https://bugs.webkit.org/show_bug.cgi?id=132574
2892
2893         Reviewed by Alexey Proskuryakov.
2894
2895         * Shared/WebCoreArgumentCoders.cpp:
2896         (IPC::ArgumentCoder<ResourceResponse>::encode):
2897         (IPC::ArgumentCoder<ResourceResponse>::decode):
2898         Transfer ResourceLoadTiming values if they exist.
2899
2900 2014-05-12  Dan Bernstein  <mitz@apple.com>
2901
2902         [Cocoa] Expose WebPage::usesEphemeralSession to the bundle
2903         https://bugs.webkit.org/show_bug.cgi?id=132836
2904
2905         Reviewed by Anders Carlsson.
2906
2907         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2908         (-[WKWebProcessPlugInBrowserContextController _usesNonPersistentWebsiteDataStore]):
2909         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
2910
2911 2014-05-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2912
2913         REGRESSION(168625): [GTK] build broken due to WKContextSetLocalStorageDirectory
2914         https://bugs.webkit.org/show_bug.cgi?id=132831
2915
2916         Unreviewed GTK build fix.
2917
2918         * UIProcess/gtk/WebContextGtk.cpp:
2919         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
2920         This is now a static member function.
2921
2922 2014-05-12  Anders Carlsson  <andersca@apple.com>
2923
2924         WKWebViewConfiguration should fill in the blanks
2925         https://bugs.webkit.org/show_bug.cgi?id=132832
2926         <rdar://problem/16886408>
2927
2928         Reviewed by Dan Bernstein.
2929
2930         * UIProcess/API/Cocoa/WKWebView.mm:
2931         (-[WKWebView initWithFrame:configuration:]):
2932         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2933         (-[WKWebViewConfiguration init]):
2934         (-[WKWebViewConfiguration _validate]):
2935         * UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h:
2936
2937 2014-05-12  Anders Carlsson  <andersca@apple.com>
2938
2939         WKWebView should default to _backgroundExtendsBeyondPage = YES
2940         https://bugs.webkit.org/show_bug.cgi?id=132829
2941         <rdar://problem/16886364>
2942
2943         Reviewed by Beth Dakin.
2944
2945         * UIProcess/API/Cocoa/WKWebView.mm:
2946         (-[WKWebView initWithFrame:configuration:]):
2947
2948 2014-05-12  Anders Carlsson  <andersca@apple.com>
2949
2950         Pass local storage directory to StorageManager::create
2951         https://bugs.webkit.org/show_bug.cgi?id=132827
2952
2953         Reviewed by Tim Horton.
2954
2955         Since we know the local storage directory at creation time and we know it never changes,
2956         we can get rid of setLocalStorageDirectory and just pass the local storage directory at creation time.
2957
2958         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
2959         (WebKit::LocalStorageDatabaseTracker::create):
2960         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
2961         (WebKit::LocalStorageDatabaseTracker::~LocalStorageDatabaseTracker):
2962         (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectory): Deleted.
2963         (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal): Deleted.
2964         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
2965         * UIProcess/Storage/StorageManager.cpp:
2966         (WebKit::StorageManager::create):
2967         (WebKit::StorageManager::StorageManager):
2968         (WebKit::StorageManager::setLocalStorageDirectory): Deleted.
2969         * UIProcess/Storage/StorageManager.h:
2970         * UIProcess/WebContext.cpp:
2971         (WebKit::WebContext::WebContext):
2972
2973 2014-05-11  Anders Carlsson  <andersca@apple.com>
2974
2975         Replace WKContextSetLocalStorageDirectory with a context configuration getter/setter
2976         https://bugs.webkit.org/show_bug.cgi?id=132809
2977
2978         Reviewed by Dan Bernstein.
2979
2980         * UIProcess/API/C/WKContext.cpp:
2981         (WKContextSetLocalStorageDirectory): Deleted.
2982
2983         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2984         (WKContextConfigurationCopyLocalStorageDirectory):
2985         (WKContextConfigurationSetLocalStorageDirectory):
2986         * UIProcess/API/C/WKContextConfigurationRef.h:
2987         Add getters and setters for the local storage directory.
2988
2989         * UIProcess/API/C/WKContextPrivate.h:
2990         Remove WKContextSetLocalStorageDirectory.
2991
2992         * UIProcess/API/Cocoa/WKProcessGroup.mm:
2993         (-[WKProcessGroup initWithInjectedBundleURL:]):
2994         Call WebContext::applyPlatformSpecificConfigurationDefaults.
2995
2996         * UIProcess/API/Cocoa/WKProcessPool.mm:
2997         (-[WKProcessPool _initWithConfiguration:]):
2998         Call WebContext::applyPlatformSpecificConfigurationDefaults (for now).
2999
3000         * UIProcess/APIContextConfiguration.cpp:
3001         (API::ContextConfiguration::webContextConfiguration):
3002         Set the local storage. Also, call WebContext::applyPlatformSpecificConfigurationDefaults.
3003
3004         * UIProcess/APIContextConfiguration.h:
3005         (API::ContextConfiguration::injectedBundlePath):
3006         This should be const.
3007
3008         (API::ContextConfiguration::localStorageDirectory):
3009         (API::ContextConfiguration::setLocalStorageDirectory):
3010         Add getter and setter.
3011
3012         * UIProcess/Storage/StorageManager.cpp:
3013         (WebKit::StorageManager::setLocalStorageDirectory):
3014         ASSERT that the path isn't null.
3015
3016         * UIProcess/WebContext.cpp:
3017         (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults):
3018         New helper function that will fill in platform specific defaults for empty parameters.
3019
3020         (WebKit::WebContext::WebContext):
3021         Get the local storage directory from the configuration.
3022
3023         (WebKit::WebContext::setLocalStorageDirectory): Deleted.
3024         (WebKit::WebContext::localStorageDirectory): Deleted.
3025         These are no longer needed.
3026
3027         * UIProcess/mac/WebContextMac.mm:
3028         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
3029         This should be a static member function.
3030
3031 2014-05-12  Martin Hodovan  <mhodovan.u-szeged@partner.samsung.com>
3032
3033         Typo fix in generate-forwarding-headers
3034         https://bugs.webkit.org/show_bug.cgi?id=132820
3035
3036         Reviewed by Anders Carlsson.
3037
3038         * Scripts/generate-forwarding-headers.pl:
3039         (collectFrameworkHeaderPaths):
3040         
3041 2014-05-12  Peter Molnar  <pmolnar.u-szeged@partner.samsung.com>
3042
3043         [EFL] TLSErrors do not cause page load to fail when not ignored
3044         https://bugs.webkit.org/show_bug.cgi?id=131104
3045
3046         Reviewed by Gyuyoung Kim.
3047
3048         Added EFL unit test for the bug https://bugs.webkit.org/show_bug.cgi?id=121548
3049
3050         * UIProcess/API/efl/tests/test_ewk2_ssl.cpp: Added new test: ewk_ssl_bad_cert_redirect_https_to_http
3051
3052 2014-05-11  Gordon Sheridan  <gordon_sheridan@apple.com>
3053
3054         Expose a function to copy favicon data without image conversion.
3055         https://bugs.webkit.org/show_bug.cgi?id=132805
3056
3057         Reviewed by Darin Adler.
3058
3059         * UIProcess/API/C/WKIconDatabase.cpp:
3060         (WKIconDatabaseCopyIconDataForPageURL):
3061         Add a function to copy the data from the image of a favicon for an associated page url.
3062
3063         * UIProcess/API/C/WKIconDatabase.h:
3064         Declare WKIconDatabaseCopyIconDataForPageURL.
3065
3066 2014-05-11  Seongjun Kim  <isAir@company100.com>
3067
3068         REGRESSION(r168603): [GTK] Build broken.
3069         https://bugs.webkit.org/show_bug.cgi?id=132810
3070
3071         Reviewed by Carlos Garcia Campos.
3072
3073         * UIProcess/API/gtk/WebKitWebContext.cpp:
3074         (createDefaultWebContext):
3075         Construct a WebContextConfiguration object and pass it to WebContext::create.
3076
3077 2014-05-11  Anders Carlsson  <andersca@apple.com>
3078
3079         Remove local storage directory and sandbox extension from WebProcessCreationParameters
3080         https://bugs.webkit.org/show_bug.cgi?id=132808
3081
3082         Reviewed by Beth Dakin.
3083
3084         * Shared/WebProcessCreationParameters.cpp:
3085         (WebKit::WebProcessCreationParameters::encode):
3086         (WebKit::WebProcessCreationParameters::decode):
3087         * Shared/WebProcessCreationParameters.h:
3088         * UIProcess/WebContext.cpp:
3089         (WebKit::WebContext::createNewWebProcess):
3090         * WebProcess/cocoa/WebProcessCocoa.mm:
3091         (WebKit::WebProcess::platformInitializeWebProcess):
3092
3093 2014-05-11  Jaehun Lim  <ljaehun.lim@samsung.com>
3094
3095         Unreviewed, CMake build fix after r168603
3096
3097         Add APIContextConfiguration.cpp and WKContextConfigurationRef.cpp to the source list.
3098
3099         * CMakeLists.txt:
3100
3101 2014-05-11  Anders Carlsson  <andersca@apple.com>
3102
3103         Add a WKContextConfigurationRef object and make the injected bundle path part of the configuration
3104         https://bugs.webkit.org/show_bug.cgi?id=132806
3105         <rdar://problem/16830143>
3106
3107         Reviewed by Beth Dakin.
3108
3109         Many setters on WKContextRef really only make sense to set early on, so move to a pattern where we create a
3110         configuration object, a WKContextConfiguration which WKContexts can be created from. Add the injected bundle path
3111         as a configuration property. More setters will follow.
3112
3113         * Shared/API/c/WKBase.h:
3114         Add WKContextConfigurationRef.
3115
3116         * Shared/APIObject.h:
3117         Add ContextConfiguration enum declaration.
3118
3119         * UIProcess/API/C/WKAPICast.h:
3120         Handle WKContextConfigurationRef.
3121
3122         * UIProcess/API/C/WKContext.cpp:
3123         (WKContextCreate):
3124         Create an empty WKContextConfigurationRef object and pass it to WKContextCreateWithConfiguration.
3125
3126         (WKContextCreateWithInjectedBundlePath):
3127         Create a WKContextConfigurationRef object, set its bundle path and pass the configuration to WKContextCreateWithConfiguration.
3128
3129         (WKContextCreateWithConfiguration):
3130         Convert the WKContextConfigurationRef object to a WebContextConfiguration and pass it to WebContext::create.
3131
3132         * UIProcess/API/C/WKContext.h:
3133         Add WKContextCreateWithConfiguration.
3134
3135         * UIProcess/API/C/WKContextConfigurationRef.cpp: Added.
3136         (WKContextConfigurationCreate):
3137         Create an API::ContextConfiguration object.
3138
3139         (WKContextConfigurationCopyInjectedBundlePath):
3140         Return the injected bundle path.
3141
3142         (WKContextConfigurationSetInjectedBundlePath):
3143         Set the injected bundle path.
3144
3145         * UIProcess/API/C/WKContextConfigurationRef.h: Added.
3146         New C SPI header.
3147         
3148         * UIProcess/API/Cocoa/WKProcessGroup.mm:
3149         (-[WKProcessGroup initWithInjectedBundleURL:]):
3150         Construct a WebContextConfiguration object and pass it to WebContext::Create.
3151     
3152         * UIProcess/API/Cocoa/WKProcessPool.mm:
3153         (-[WKProcessPool _initWithConfiguration:]):
3154         Construct a WebContextConfiguration object and pass it to WebContext::Create.
3155
3156         * UIProcess/APIContextConfiguration.cpp: Added.
3157         New API::ContextConfiguration object.
3158
3159         (API::ContextConfiguration::webContextConfiguration):
3160         Construct a WebContextConfiguration struct from our current configuration.
3161
3162         * UIProcess/APIContextConfiguration.h: Added.
3163         
3164         * UIProcess/WebContext.cpp:
3165         (WebKit::WebContext::create):
3166         Pass the WebContextConfiguration to the constructor.
3167
3168         (WebKit::WebContext::WebContext):
3169         Set the injected bundle path from the WebContextConfiguration object.
3170
3171         * UIProcess/WebContext.h:
3172         Change the WebContext constructor and create function to take a WebContextConfiguration object.
3173
3174         * WebKit2.xcodeproj/project.pbxproj:
3175         Add new files.
3176
3177 2014-05-10  Csaba Osztrogonác  <ossy@webkit.org>
3178
3179         [WK2] URTBF after r168585.
3180
3181         * Platform/IPC/Connection.h:
3182         * Shared/ChildProcessProxy.cpp:
3183         (WebKit::ChildProcessProxy::terminate):
3184
3185 2014-05-10  Tim Horton  <timothy_horton@apple.com>
3186
3187         [WKWebView _updateScrollViewBackground] churns UI-and-CGColors while repainting
3188         https://bugs.webkit.org/show_bug.cgi?id=132793
3189         <rdar://problem/16877870>
3190
3191         Reviewed by Dan Bernstein.
3192
3193         * UIProcess/API/Cocoa/WKWebView.mm:
3194         (-[WKWebView _updateScrollViewBackground]):
3195         Don't bypass the cache and make a copy of the CGColor just to set its alpha.
3196         Cache the last color and don't bother creating a UIColor nor updating the
3197         color on our views if it hasn't changed.
3198
3199 2014-05-10  Tim Horton  <timothy_horton@apple.com>
3200
3201         Implement -forwardingTargetForSelector on WKScrollViewDelegateForwarder
3202         https://bugs.webkit.org/show_bug.cgi?id=132790
3203         <rdar://problem/16877802>
3204
3205         Reviewed by Dan Bernstein.
3206
3207         * UIProcess/ios/WKScrollView.mm:
3208         (-[WKScrollViewDelegateForwarder forwardingTargetForSelector:]):
3209         If only one of the delegates will respond to a selector,
3210         we can return it from forwardingTargetForSelector: to avoid
3211         NSInvocation overhead.
3212
3213 2014-05-10  Dan Bernstein  <mitz@apple.com>
3214
3215         [Mac] Some targets that link or soft-link WebKit.framework don't depend on it
3216         https://bugs.webkit.org/show_bug.cgi?id=132776
3217
3218         Reviewed by Darin Adler.
3219
3220         * WebKit2.xcodeproj/project.pbxproj:
3221
3222 2014-05-10  Ryuan Choi  <ryuan.choi@samsung.com>
3223
3224         [EFL][WK2] Move the ownership of EwkSettings from EwkView to EwkPageGroup
3225         https://bugs.webkit.org/show_bug.cgi?id=132771
3226
3227         Reviewed by Gyuyoung Kim.
3228
3229         Moved ownership of EwkSettings from EwkView to EwkPageGroup.
3230
3231         * UIProcess/API/efl/EwkView.cpp:
3232         (EwkView::EwkView):
3233         * UIProcess/API/efl/EwkView.h:
3234         (EwkView::settings): Deleted.
3235         * UIProcess/API/efl/ewk_page_group.cpp:
3236         (EwkPageGroup::EwkPageGroup):
3237         * UIProcess/API/efl/ewk_page_group_private.h:
3238         (EwkPageGroup::settings):
3239         * UIProcess/API/efl/ewk_settings_private.h:
3240         * UIProcess/API/efl/ewk_view.cpp:
3241         (ewk_view_settings_get):
3242
3243 2014-05-10  Tim Horton  <timothy_horton@apple.com>
3244
3245         [iOS WebKit2] REGRESSION (r168493): Canvasmark 2013 benchmark always hits the RELEASE_ASSERT in RemoteLayerTreeDrawingArea::flushLayers()
3246         https://bugs.webkit.org/show_bug.cgi?id=132783
3247         <rdar://problem/16877326>
3248
3249         Reviewed by Anders Carlsson.
3250
3251         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3252         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush):
3253         There's a race window between the BackingStoreFlusher sending the new
3254         layer tree to the UI process and updating m_hasFlushed where we can
3255         get a reply back in (on the Web process main thread) from the UI process
3256         that we committed the new layer tree (didUpdate).
3257         This will cause the RELEASE_ASSERT in flushLayers() to fire incorrectly.
3258         Since the RELEASE_ASSERT is there only to avoid painting garbage, move
3259         our code to set m_hasFlushed=true to after we finish calling CGContextFlush
3260         on all of the contexts, instead of after we send the layer tree commit message,
3261         which will remove the race entirely.
3262
3263 2014-05-10  Anders Carlsson  <andersca@apple.com>
3264
3265         ASSERTION FAILED: !m_connection under RunJavaScriptAlert
3266         https://bugs.webkit.org/show_bug.cgi?id=132792
3267         <rdar://problem/16691138>
3268
3269         Reviewed by Dan Bernstein.
3270
3271         Detect if someone implementing a UI delegate method with a completion handler never calls the completion
3272         handler and raise an exception instead of asserting.
3273
3274         * UIProcess/Cocoa/UIDelegate.mm:
3275         (WebKit::CompletionHandlerCallChecker::create):
3276         (WebKit::CompletionHandlerCallChecker::~CompletionHandlerCallChecker):
3277         (WebKit::CompletionHandlerCallChecker::didCallCompletionHandler):
3278         (WebKit::CompletionHandlerCallChecker::CompletionHandlerCallChecker):
3279         (WebKit::CompletionHandlerCallChecker::classImplementingDelegateMethod):
3280         (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
3281         (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
3282         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
3283
3284 2014-05-10  Anders Carlsson  <andersca@apple.com>
3285
3286         Use xpc_connection_kill for killing child processes where appropriate
3287         https://bugs.webkit.org/show_bug.cgi?id=132788
3288         <rdar://problem/16664185>
3289
3290         Reviewed by Sam Weinig.
3291
3292         * Platform/IPC/Connection.h:
3293         * Platform/IPC/mac/ConnectionMac.mm:
3294         (IPC::Connection::kill):
3295         * Platform/IPC/mac/XPCPtr.h:
3296         (IPC::XPCPtr::operator bool):
3297         * Shared/ChildProcessProxy.cpp:
3298         (WebKit::ChildProcessProxy::terminate):
3299
3300 2014-05-10  Anders Carlsson  <andersca@apple.com>
3301
3302         WebKit2 is leaking an xpc_connection per web process it creates
3303         https://bugs.webkit.org/show_bug.cgi?id=132785
3304         <rdar://problem/14912160>
3305
3306         Reviewed by Sam Weinig.
3307
3308         Introduce an IPC::XPCPtr smart pointer class and use it for XPC connections inside Connection::Identifier and Connection itself.
3309
3310         Make sure we always adopt any connections that are created.
3311
3312         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm:
3313         (DatabaseServiceInitializer):
3314         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
3315         (WebKit::NetworkServiceInitializerDelegate::NetworkServiceInitializerDelegate):
3316         (NetworkServiceInitializer):
3317         * Platform/IPC/Connection.h:
3318         (IPC::Connection::Identifier::Identifier):
3319         (IPC::Connection::xpcConnection):
3320         * Platform/IPC/mac/ConnectionMac.mm:
3321         (IPC::Connection::platformInvalidate):
3322         (IPC::Connection::platformInitialize):
3323         (IPC::Connection::getAuditToken):
3324         * Platform/IPC/mac/XPCPtr.h: Added.
3325         (IPC::XPCPtr::XPCPtr):
3326         (IPC::XPCPtr::~XPCPtr):
3327         (IPC::XPCPtr::get):
3328         (IPC::XPCPtr::operator!):
3329         (IPC::XPCPtr::operator=):
3330         (IPC::adoptXPC):
3331         * PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm:
3332         (WebKit::PluginServiceInitializerDelegate::PluginServiceInitializerDelegate):
3333         (PluginServiceInitializer):
3334         * Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessMain.mm:
3335         (WebKit::BootstrapMain):
3336         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
3337         (WebKit::XPCServiceInitializerDelegate::XPCServiceInitializerDelegate):
3338         (WebKit::XPCServiceInitializer):
3339         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
3340         (WebKit::XPCServiceInitializerDelegate::hasEntitlement):
3341         (WebKit::XPCServiceInitializerDelegate::isClientSandboxed):
3342         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
3343         (WebKit::XPCServiceEventHandler):
3344         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
3345         (WebKit::XPCServiceEventHandler):
3346         * UIProcess/Launcher/ProcessLauncher.cpp:
3347         (WebKit::ProcessLauncher::didFinishLaunchingProcess):
3348         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3349         (WebKit::connectToService):
3350         * WebKit2.xcodeproj/project.pbxproj:
3351         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
3352         (WebContentServiceInitializer):
3353
3354 2014-05-10  Anders Carlsson  <andersca@apple.com>
3355
3356         Simplify createDataAvailableSource
3357         https://bugs.webkit.org/show_bug.cgi?id=132782
3358         <rdar://problem/16815202>
3359
3360         Reviewed by Sam Weinig.
3361
3362         * Platform/IPC/mac/ConnectionMac.mm: Renamed from Source/WebKit2/Platform/IPC/mac/ConnectionMac.cpp.
3363         Rename to make this Objective-C++ so we get the lambda-to-block conversion.
3364
3365         (IPC::createDataAvailableSource):
3366         Make this a function template and just pass the function directly to dispatch_source_set_event_handler.
3367
3368         (IPC::Connection::open):
3369         Use lambdas instead of WTF::bind, so we'll make sure the connection is kept alive.
3370
3371         * WebKit2.xcodeproj/project.pbxproj:
3372         Update for ConnectionMac.cpp to ConnectionMac.mm rename.
3373
3374 2014-05-10  Anders Carlsson  <andersca@apple.com>
3375
3376         Follow-up fix.
3377
3378         Reviewed by Darin Adler.
3379
3380         * UIProcess/API/Cocoa/WKNavigationResponse.h:
3381         * UIProcess/API/Cocoa/WKNavigationResponse.mm:
3382         (-[WKNavigationResponse isForMainFrame]):
3383         Use a slightly better name.
3384
3385 2014-05-10  Anders Carlsson  <andersca@apple.com>
3386
3387         Make -[WKNavigationResponse frame] SPI and only expose -[WKNavigationResponse isMainFrame]
3388         https://bugs.webkit.org/show_bug.cgi?id=132781
3389         <rdar://problem/16868319>
3390
3391         Reviewed by Darin Adler.
3392
3393         * UIProcess/API/Cocoa/WKNavigationResponse.h:
3394         * UIProcess/API/Cocoa/WKNavigationResponse.mm:
3395         (-[WKNavigationResponse description]):
3396         (-[WKNavigationResponse isMainFrameNavigation]):
3397         (-[WKNavigationResponse _frame]):
3398         (-[WKNavigationResponse frame]): Deleted.
3399         (-[WKNavigationResponse setFrame:]): Deleted.
3400         * UIProcess/API/Cocoa/WKNavigationResponseInternal.h:
3401         * UIProcess/API/Cocoa/WKNavigationResponsePrivate.h: Added.
3402         * UIProcess/Cocoa/NavigationState.mm:
3403         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
3404         * WebKit2.xcodeproj/project.pbxproj:
3405
3406 2014-05-09  Dan Bernstein  <mitz@apple.com>
3407
3408         [Cocoa] Remove a deprecated bundle form delegate method now that no one implements it
3409         https://bugs.webkit.org/show_bug.cgi?id=132769
3410
3411         Reviewed by Sam Weinig.
3412
3413         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3414         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
3415
3416 2014-05-09  Benjamin Poulain  <bpoulain@apple.com>
3417
3418         [iOS][WK2] Fix bugs exposed by r168556
3419         https://bugs.webkit.org/show_bug.cgi?id=132768
3420
3421         Reviewed by Ryosuke Niwa.
3422
3423         Fix two bugs exposed by r168556.
3424         1) We were only changing the page scale factor when the scale was not adjusted by live
3425            resize. The idea was that the scale would either be the same (responsive content)
3426            or that it would be defined by the next viewContentRectUpdate.
3427
3428            Now that we also send resize and scroll events, we must always update the scale since
3429            it affects some APIs observable from JavaScript (like scrolling bounds).
3430
3431         2) Internally, Page's scaleFactor is stored as a float and not double. The rounding error
3432            were causing us to send DynamicViewportUpdateChangedTarget() in cases were there is no change
3433            of target.
3434
3435         * WebProcess/WebPage/ios/WebPageIOS.mm:
3436         (WebKit::withinEpsilon):
3437         (WebKit::WebPage::dynamicViewportSizeUpdate):
3438
3439 2014-05-09  Ryuan Choi  <ryuan.choi@samsung.com>
3440
3441         [EFL][WK2] Close icondatabase when EwkFaviconDatabase is destroyed
3442         https://bugs.webkit.org/show_bug.cgi?id=132767
3443
3444         Reviewed by Gyuyoung Kim.
3445
3446         IconDatabase should be closed explicitly.
3447
3448         * UIProcess/API/efl/ewk_favicon_database.cpp:
3449         (EwkFaviconDatabase::~EwkFaviconDatabase):
3450
3451 2014-05-09  Anders Carlsson  <andersca@apple.com>
3452
3453         Another build fix.
3454
3455         * mac/MigrateHeadersToWebKit2.make:
3456         Don't migrate the WKPreferences.h header, WebKit2 provides its own header.
3457
3458 2014-05-09  Benjamin Poulain  <benjamin@webkit.org>
3459
3460         [iOS][WK2] Reset the scroll position on the first frame after didCommitLoad
3461         https://bugs.webkit.org/show_bug.cgi?id=132765
3462
3463         Reviewed by Tim Horton.
3464
3465         Since WebCore does not update our scroll view on load, we need to do that ourself.
3466
3467         In case where we need to restore the state from the history, RemoteLayerTreeDrawingAreaProxy
3468         will always invoke the scrolling after didCommitLayerTree() (since r167916).
3469         Consequently, it is now safe again to reset the scroll position ourself on the first frame.
3470
3471         * UIProcess/API/Cocoa/WKWebView.mm:
3472         (-[WKWebView _didCommitLoadForMainFrame]):
3473         (-[WKWebView _didCommitLayerTree:WebKit::]):
3474         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3475         * UIProcess/ios/WKContentView.mm:
3476         (-[WKContentView _didCommitLoadForMainFrame]):
3477
3478 2014-05-09  Anders Carlsson  <andersca@apple.com>
3479
3480         Update availability macros
3481         https://bugs.webkit.org/show_bug.cgi?id=132763
3482         <rdar://problem/15311800>
3483
3484         Reviewed by Dan Bernstein.
3485
3486         * Configurations/WebKit.xcconfig:
3487         * Shared/API/Cocoa/WKBrowsingContextHandle.h:
3488         * Shared/API/Cocoa/WKFoundation.h:
3489         * Shared/API/Cocoa/_WKFrameHandle.h:
3490         * Shared/API/Cocoa/_WKRemoteObjectInterface.h:
3491         * Shared/API/Cocoa/_WKRemoteObjectRegistry.h:
3492         * UIProcess/API/Cocoa/WKBackForwardList.h:
3493         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
3494         * UIProcess/API/Cocoa/WKBackForwardListPrivate.h:
3495         * UIProcess/API/Cocoa/WKBrowsingContextController.h:
3496         * UIProcess/API/Cocoa/WKBrowsingContextGroup.h:
3497         * UIProcess/API/Cocoa/WKConnection.h:
3498         * UIProcess/API/Cocoa/WKFrameInfo.h:
3499         * UIProcess/API/Cocoa/WKNavigation.h:
3500         * UIProcess/API/Cocoa/WKNavigationAction.h:
3501         (NS_ENUM):
3502         * UIProcess/API/Cocoa/WKNavigationData.h:
3503         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
3504         (NS_ENUM):
3505         * UIProcess/API/Cocoa/WKNavigationResponse.h:
3506         * UIProcess/API/Cocoa/WKPreferences.h:
3507         * UIProcess/API/Cocoa/WKProcessGroup.h:
3508         * UIProcess/API/Cocoa/WKProcessPool.h:
3509         * UIProcess/API/Cocoa/WKScriptMessage.h:
3510         * UIProcess/API/Cocoa/WKScriptMessageHandler.h:
3511         * UIProcess/API/Cocoa/WKTypeRefWrapper.h:
3512         * UIProcess/API/Cocoa/WKUIDelegate.h:
3513         * UIProcess/API/Cocoa/WKUserContentController.h:
3514         * UIProcess/API/Cocoa/WKWebView.h:
3515         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
3516         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3517         (NS_OPTIONS):
3518         (NS_ENUM):
3519         * UIProcess/API/Cocoa/WKWindowFeatures.h:
3520         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
3521         (NS_ENUM):
3522         * UIProcess/API/Cocoa/_WKDownload.h:
3523         * UIProcess/API/Cocoa/_WKElementAction.h:
3524         (NS_ENUM):
3525         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3526         * UIProcess/API/Cocoa/_WKScriptWorld.h:
3527         * UIProcess/API/Cocoa/_WKThumbnailView.h:
3528         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.h:
3529         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
3530         * WebKit2.xcodeproj/project.pbxproj:
3531         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
3532         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.h:
3533         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
3534         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h:
3535         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
3536         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
3537         * WebProcess/InjectedBundle/API/mac/WKDOMElement.h:
3538         * WebProcess/InjectedBundle/API/mac/WKDOMNode.h:
3539         * WebProcess/InjectedBundle/API/mac/WKDOMRange.h:
3540         * WebProcess/InjectedBundle/API/mac/WKDOMText.h:
3541         * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h:
3542         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
3543         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:
3544         * mac/rewrite-availability-macros.sh: Added.
3545
3546 2014-05-09  Joseph Pecoraro  <pecoraro@apple.com>
3547
3548         Web Inspector: Allow Remote Inspector to entitlement check UIProcess through WebProcess
3549         https://bugs.webkit.org/show_bug.cgi?id=132409
3550
3551         Reviewed by Timothy Hatcher.
3552
3553         * WebProcess/WebCoreSupport/WebInspectorClient.h:
3554         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3555         (WebKit::WebInspectorClient::parentProcessIdentifier): Deleted.
3556         pid per debuggable is no longer needed.
3557
3558         * WebProcess/WebProcess.cpp:
3559         (WebKit::WebProcess::initializeWebProcess):
3560         Immediately pass the parent process pid and audit_token on
3561         to the RemoteInspector singleton when the process is created
3562         so that it can be sent to webinspectord.
3563
3564 2014-05-09  Enrica Casucci  <enrica@apple.com>
3565
3566         REGRESSION (WebKit2): Tapping in search field at wikipedia.org doesn’t bring up the keyboard.
3567         https://bugs.webkit.org/show_bug.cgi?id=132761
3568         <rdar://problem/16857491>
3569
3570         Reviewed by Benjamin Poulain.
3571
3572         The interactionAssistant accessor should never create an instance of
3573         UIWKTextInteractionAssistant, but simply return the value of _textInteractionAssistant.
3574         The text interaction assistant should only be created when needed so that the rest of
3575         the code could reliably check if we are interacting with text or not.
3576
3577         * UIProcess/ios/WKContentViewInteraction.mm:
3578         (-[WKContentView interactionAssistant]):
3579
3580 2014-05-09  Simon Fraser  <simon.fraser@apple.com>
3581
3582         Fix some issues with scrolling tree logging
3583         https://bugs.webkit.org/show_bug.cgi?id=132762
3584
3585         Reviewed by Tim Horton.
3586         
3587         Only dump viewport constraints when they change, and dump the primary layer on
3588         scrolling nodes.
3589         
3590         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
3591         (WebKit::RemoteScrollingTreeTextStream::dump): Dump the primary layer.
3592
3593 2014-05-09  Simon Fraser  <simon.fraser@apple.com>
3594
3595         [iOS WK2] Fixed elements can go outside the document on pinching
3596         https://bugs.webkit.org/show_bug.cgi?id=132759
3597         <rdar://problem/16870835>
3598
3599         Reviewed by Benjamin Poulain.
3600         
3601         Constrain the rect used to position fixed position objects when pinching (when
3602         the scale goes below the minimumScale). Do so in such a way that there's a smooth
3603         transition between rubber-banding and pinching.
3604
3605         * UIProcess/API/Cocoa/WKWebView.mm:
3606         (-[WKWebView _updateScrollViewBackground]): Use a nicer form for std::max<>.
3607         (-[WKWebView _updateVisibleContentRects]): Pass the minimum scale.
3608         * UIProcess/API/ios/WKViewIOS.mm:
3609         (-[WKView _updateVisibleContentRects]): Ditto.
3610         * UIProcess/ios/WKContentView.h:
3611         * UIProcess/ios/WKContentView.mm:
3612         (adjustedUnexposedEdge): Helper to adjust the left/top.
3613         (adjustedUnexposedMaxEdge): Helper to adjust the right/bottom.
3614         (fixedPositionRectFromExposedRect):
3615         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:minimumScale:inStableState:]):
3616         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]): Deleted.
3617
3618 2014-05-09  Zalan Bujtas  <zalan@apple.com>
3619
3620         Subpixel rendering[iOS]: Top bar on apple.com/support jiggles when the swoosh animates.
3621         https://bugs.webkit.org/show_bug.cgi?id=132750
3622         <rdar://problem/16803281>
3623
3624         Reviewed by Simon Fraser.
3625
3626         This patch ensures that GraphicsLayer and RemoteLayerBackingStore have the same dimensions.
3627         
3628         Remove integral enclosing when we set the size on RemoteLayerBackingStore. It makes the layer's size
3629         different from the backingstore when the passed value is fractional.
3630         We scale and integral round this value to size the shareable bitmap later. Rounding ensures that
3631         the final size value matches what we calculated at GraphicsLayerCA::updateGeometry()
3632
3633         Currently not testable.
3634
3635         * Shared/mac/RemoteLayerBackingStore.h:
3636         (WebKit::RemoteLayerBackingStore::size):
3637         * Shared/mac/RemoteLayerBackingStore.mm:
3638         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
3639         (WebKit::RemoteLayerBackingStore::setNeedsDisplay): use enclosing here to ensure we cover the entire backing store.
3640         (WebKit::RemoteLayerBackingStore::display):
3641         (WebKit::RemoteLayerBackingStore::drawInContext):
3642         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3643         (WebKit::PlatformCALayerRemote::updateBackingStore):
3644
3645 2014-05-09  Benjamin Poulain  <bpoulain@apple.com>
3646
3647         [iOS][WK2] Set up the resize events
3648         https://bugs.webkit.org/show_bug.cgi?id=132726
3649
3650         Reviewed by Darin Adler and Simon Fraser.
3651
3652         Wire the UI Process updates to FrameView to send the resize events appropriately.
3653
3654         * Shared/VisibleContentRectUpdateInfo.cpp:
3655         (WebKit::VisibleContentRectUpdateInfo::encode):
3656         (WebKit::VisibleContentRectUpdateInfo::decode):
3657         * Shared/VisibleContentRectUpdateInfo.h:
3658         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
3659         (WebKit::VisibleContentRectUpdateInfo::isChangingObscuredInsetsInteractively):
3660         * UIProcess/API/Cocoa/WKWebView.mm:
3661         (-[WKWebView _updateVisibleContentRects]):
3662         * UIProcess/ios/WKContentView.h:
3663         * UIProcess/ios/WKContentView.mm:
3664         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:isChangingObscuredInsetsInteractively:]):
3665         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]): Deleted.
3666         Pass down the status of the content insets with the view update to main frame's FrameView
3667         when needed.
3668
3669         * WebProcess/WebPage/ios/WebPageIOS.mm:
3670         (WebKit::WebPage::dynamicViewportSizeUpdate):
3671         On live resize, send the resize event, then the scroll events (if needed).
3672
3673         Since JavaScript now gets two chances to change the content (resize event + scroll event),
3674         we query the actual scroll offset and scale for the DynamicViewportUpdateChangedTarget.
3675
3676         (WebKit::WebPage::viewportConfigurationChanged):
3677         Define the custom size on load before the app gets a chance to send different rects.
3678         If for some reason the app changes its mind about the insets, the content will be notified with a resize event.
3679
3680         (WebKit::WebPage::updateVisibleContentRects):
3681         Send the resize event when the insets are stable.
3682         Also move the scroll event after the resize event for consistency with live resize.
3683
3684 2014-05-09  Benjamin Poulain  <benjamin@webkit.org>
3685
3686         [iOS] Switch geolocation to an explicit authorization query model
3687         https://bugs.webkit.org/show_bug.cgi?id=132717
3688
3689         Reviewed by Sam Weinig.
3690
3691         Switch WKGeolocationProviderIOS to use the new API of WebGeolocationCoreLocationProvider.
3692
3693         On WebKit2, the whole logic to track requesters is in WebGeolocationManagerProxy.
3694
3695         Without the warmup sequence, WKGeolocationProviderIOS becomes really dumb: it just provides
3696         the two step authorization and forward the start/stop messages to the WebGeolocationCoreLocationProvider.
3697
3698         * UIProcess/ios/WKGeolocationProviderIOS.mm:
3699         (-[WKGeolocationProviderIOS _stopUpdating]):
3700         (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:request:window:]):
3701         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
3702         (-[WKGeolocationProviderIOS geolocationAuthorizationDenied]):
3703         (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]):
3704         (-[WKWebAllowDenyPolicyListener deny]):
3705         (-[WKGeolocationProviderIOS _stopUpdatingIfPossible]): Deleted.
3706         (-[WKGeolocationProviderIOS geolocationDelegateStarted]): Deleted.
3707         (-[WKGeolocationProviderIOS geolocationDelegateUnableToStart]): Deleted.
3708         (-[WKGeolocationProviderIOS permissionDenied:]): Deleted.
3709         (-[WKWebAllowDenyPolicyListener initWithProvider:permissionRequestProxy:]): Deleted.
3710
3711 2014-05-09  Gordon Sheridan  <gordon_sheridan@apple.com>
3712
3713         Expose functions necessary for copying favicon between IconDatabases.
3714         https://bugs.webkit.org/show_bug.cgi?id=132709
3715
3716         Reviewed by Brady Eidson.
3717
3718         * UIProcess/API/C/WKIconDatabase.cpp:
3719         (WKIconDatabaseSetIconURLForPageURL):
3720         Add C API wrapper for WebIconDatabase::setIconURLForPageURL().
3721
3722         (WKIconDatabaseCopyIconURLForPageURL):
3723         Add C API wrapper for WebIconDatabase::synchronousIconURLForPageURL().
3724
3725         * UIProcess/API/C/WKIconDatabase.h:
3726         Added declarations for wrapper functions above.
3727
3728 2014-05-09  Tim Horton  <timothy_horton@apple.com>
3729
3730         Fix the iOS DRT build by including CG headers in WKPreferences.h, which uses CGFloat.
3731
3732         * UIProcess/API/Cocoa/WKPreferences.h:
3733
3734 2014-05-09  Brent Fulgham  <bfulgham@apple.com>
3735
3736         {TelephoneNumber, Selection}ControllerMac implementations dosn't handle tiled drawing properly.
3737         https://bugs.webkit.org/show_bug.cgi?id=132746
3738         <rdar://problem/16789588>
3739
3740         Reviewed by Tim Horton.
3741
3742         Don't try to draw the detector UI if no part of the selection bounds are inside
3743         the current tile. Don't limit the detector UI to the bounds of this tile, or else
3744         it will attempt to squeeze itself into the possibly small space available. Let it
3745         draw as if it had the whole screen, and rely on the context clip region to
3746         avoid overdrawing.
3747
3748         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
3749         (WebKit::TelephoneNumberOverlayController::drawRect): Correct tiled drawing behavior.
3750         * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm:
3751         (WebKit::SelectionOverlayController::drawRect): Ditto.
3752
3753 2014-05-09  Anders Carlsson  <andersca@apple.com>
3754
3755         Production build fix.
3756
3757         Reviewed by Dan Bernstein.
3758
3759         * Configurations/BaseTarget.xcconfig:
3760         Add SDKROOT in front of UMBRELLA_FRAMEWORKS_DIR for OS X Production builds.
3761
3762 2014-05-09  Tim Horton  <timothy_horton@apple.com>
3763
3764         [iOS WebKit2] Flush RemoteLayerBackingStore contexts on a secondary queue
3765         https://bugs.webkit.org/show_bug.cgi?id=132667
3766         <rdar://problem/15349483>
3767
3768         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3769         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::create):
3770         Address a missed review comment about a missing std::move.
3771
3772 2014-05-09  Anders Carlsson  <andersca@apple.com>
3773
3774         Rename WebKit2.framework to WebKit.framework
3775         https://bugs.webkit.org/show_bug.cgi?id=132743
3776         <rdar://problem/15920046>
3777
3778         Reviewed by Dan Bernstein.
3779
3780         * Configurations/BaseLegacyProcess.xcconfig:
3781         Change INSTALL_PATH to WebKit.framework.
3782
3783         * Configurations/BaseTarget.xcconfig:
3784         Change WEBKIT2_FRAMEWORKS_DIR to WEBKIT_FRAMEWORKS_DIR and add WEBKIT_LEGACY_PRIVATE_HEADERS_DIR.
3785
3786         * Configurations/BaseXPCService.xcconfig:
3787         Change WebKit2.framework to WebKit.framework.
3788
3789         * Configurations/WebKit.xcconfig: Copied from Source/WebKit2/Configurations/WebKit2.xcconfig.
3790         New configuration file for WebKit.framework. Re-export WebKitLegacy.framework.
3791
3792         * Configurations/WebKit2.xcconfig:
3793         New configuration file for the WebKit2 shim framework. Re-export WebKit.framework.
3794
3795         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist:
3796         Update DYLD_INSERT_LIBRARIES to refer to WebKit.framework.
3797
3798         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
3799         Update DYLD_INSERT_LIBRARIES to refer to WebKit.framework.
3800         
3801         * Shared/API/Cocoa/WKBrowsingContextHandle.h:
3802         * Shared/API/Cocoa/WKRenderingProgressEvents.h:
3803         Update header imports.
3804
3805         * Shared/API/Cocoa/WebKit.h: Renamed from Source/WebKit/mac/WebKitLegacy/WebKit.h.
3806         New umbrella header. Imports the modern WebKit API as well as the legacy API.
3807
3808         * Shared/API/Cocoa/WebKit.m: Renamed from Source/WebKit/mac/WebKitLegacy/WebKit.m.
3809         Export install name symbols on iOS.
3810
3811         * Shared/API/Cocoa/WebKitPrivate.h: Renamed from Source/WebKit/mac/WebKitLegacy/WebKitPrivate.h.
3812         New umbrella SPI header. Imports the modern WebKit SPI.
3813
3814         * Many headers:
3815         Change WebKit2 includes to WebKit includes.
3816
3817         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
3818         (WebKit::XPCServiceEventHandler):
3819         Change bundle identifiers from com.apple.WebKit2 to com.apple.WebKit.
3820
3821         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
3822         (WebKit::XPCServiceEventHandler):
3823         Change bundle identifier from com.apple.WebKit2 to com.apple.WebKit.
3824         
3825         * UIProcess/API/Cocoa/WKPreferences.h:
3826         Stop including WKPreferencesRef.h, we have a WebKit2 header that handles this workaround for us now.
3827
3828         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3829         (WebKit::addDYLDEnvironmentAdditions):
3830         (WebKit::connectToService):
3831         (WebKit::createProcess):
3832         (WebKit::ProcessLauncher::launchProcess):
3833         Change bundle identifiers from com.apple.WebKit2 to com.apple.WebKit.
3834
3835         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3836         (WebKit::PluginProcessProxy::createPropertyListFile):
3837         Change bundle identifiers from com.apple.WebKit2 to com.apple.WebKit.
3838
3839         * UIProcess/mac/WebContextMac.mm:
3840         (WebKit::WebContext::platformDefaultDiskCacheDirectory):
3841         Change bundle identifier from com.apple.WebKit2 to com.apple.WebKit.
3842         
3843         * WebKit2.xcodeproj/project.pbxproj:
3844         Copy the python message scripts to the WebKit2 framework.
3845         Rename WebKit2.framework to WebKit.framework everywhere.
3846         Add a new WebKit2 target that builds the shim WebKit2 framework.
3847         Move the build script phase that migrates WebKitLegacy headers to WebKit.
3848         Add a new build script phase that adds forwarding headers from WebKit2 to WebKit.
3849
3850         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
3851         Update DYLD_INSERT_LIBRARIES to refer to WebKit.framework.
3852
3853         * mac/MigrateHeadersFromWebKitLegacy.make: Renamed from Source/WebKit/mac/WebKitLegacy/MigrateHeadersFromWebKitLegacy.make.
3854         Move the makefile that migrates WebKitLegacy headers here. On OS X, it copies the header contents and on iOS it creates forarding headers.
3855
3856         * mac/MigrateHeadersToWebKit2.make:
3857         New makefile that creates forwarding headers for the WebKit2 shim framework.
3858
3859         * mac/WKPreferences.h: Added.
3860         Add WebKit2/WKPreferences.h header that imports WebKit2/WKPreferencesref.h.
3861
3862         * mac/WebKit2.m:
3863         Skeleton for the WebKit2 shim framework.
3864
3865         * mac/Info-WebKit2.plist: Added.
3866         New Info.plist file for the WebKit2 shim framework.
3867
3868 2014-05-09  Martin Hodovan  <mhodovan.u-szeged@partner.samsung.com>
3869
3870         [WK2] Make generate-forwarding-headers.pl work after WebKit2.framework -> WebKit.framework rename
3871         https://bugs.webkit.org/show_bug.cgi?id=132733
3872
3873         Reviewed by Csaba Osztrogonác.
3874
3875         Rewrite framework's directory name to WebKit2 if the framework is WebKit (former WebKit2)
3876         and then collect headers inside the fixed framework directory and generate forwarding
3877         headers point to the fixed directory.
3878
3879         Leave WebKit2 in @frameworks list during the transition. It can be removed
3880         once <WebKit2/foo.h> style includes were renamed to <WebKit/foo.h> everywhere.
3881
3882         * Scripts/generate-forwarding-headers.pl:
3883         (collectFameworkHeaderPaths):
3884         (createForwardingHeadersForFramework):
3885
3886 2014-05-08  Alexey Proskuryakov  <ap@apple.com>
3887
3888         Automatically zip document bundles used via File API
3889         https://bugs.webkit.org/show_bug.cgi?id=132713
3890         <rdar://problem/13397892>
3891
3892         Reviewed by Anders Carlsson.
3893
3894         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: NetworkProcess
3895         now uses FileCoordination (WebProcess already had this allowed).
3896
3897         * Shared/BlobDataFileReferenceWithSandboxExtension.h: Added final to the class.
3898
3899 2014-05-08  Simon Fraser  <simon.fraser@apple.com>
3900
3901         [iOS WK2] Bottom-relative position:fixed elements are misplaced on page load
3902         https://bugs.webkit.org/show_bug.cgi?id=132719
3903         <rdar://problem/16860837>
3904
3905         Reviewed by Benjamin Poulain.
3906         
3907         If we haven't received visible rects from the web process, compute the
3908         fixed position rect, but only after scale has been set.
3909
3910         * WebProcess/WebPage/ios/WebPageIOS.mm:
3911         (WebKit::WebPage::viewportConfigurationChanged):
3912
3913 2014-05-08  Jer Noble  <jer.noble@apple.com>
3914
3915         [Mac, iOS] Add source application accounting to AVURLAsset.
3916         https://bugs.webkit.org/show_bug.cgi?id=132637
3917
3918         Reviewed by Eric Carlson.
3919
3920         Add accessor for sourceApplicationIdentifier.
3921
3922         * NetworkProcess/RemoteNetworkingContext.h:
3923         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3924         (WebKit::RemoteNetworkingContext::sourceApplicationIdentifier):
3925         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
3926         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3927         (WebKit::WebFrameNetworkingContext::sourceApplicationIdentifier):
3928
3929 2014-05-08  Tim Horton  <timothy_horton@apple.com>
3930
3931         [iOS WebKit2] Flush RemoteLayerBackingStore contexts on a secondary queue
3932         ​https://bugs.webkit.org/show_bug.cgi?id=132667
3933         <rdar://problem/16861454>
3934
3935         Rubber-stamped by Simon Fraser.
3936
3937         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3938         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3939         Add a null check to fix a crash on layers which lose backing store.
3940
3941 2014-05-08  Beth Dakin  <bdakin@apple.com>
3942
3943         REGRESSION (r168053): Phone number detection boxes are wrong when scrolled
3944         https://bugs.webkit.org/show_bug.cgi?id=132706
3945         -and corresponding-
3946         <rdar://problem/16787957>
3947
3948         Reviewed by Tim Horton.
3949
3950         We need to paint the boxes in Document coordinates. Range::boundingRect() was 
3951         giving us a point that took scroll position into account, and that’s not what we 
3952         want. Here we use Range::textQuads() instead so that we can get something in 
3953         Document coordinates, and then we need to convert that up to the main Document’s 
3954         coordinates.
3955         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
3956         (WebKit::textQuadsToBoundingRectForRange):
3957         (WebKit::TelephoneNumberOverlayController::drawRect):
3958
3959         The telephone click function wants a point in Window coordinates.
3960         (WebKit::TelephoneNumberOverlayController::mouseEvent):
3961
3962 2014-05-08  Tim Horton  <timothy_horton@apple.com>
3963
3964         [iOS WebKit2] Flush RemoteLayerBackingStore contexts on a secondary queue
3965         https://bugs.webkit.org/show_bug.cgi?id=132667
3966         <rdar://problem/15349483>
3967
3968         Reviewed by Darin Adler.
3969
3970         * Shared/mac/RemoteLayerBackingStore.h:
3971         * Shared/mac/RemoteLayerBackingStore.mm:
3972         (WebKit::RemoteLayerBackingStore::takeFrontContextPendingFlush):
3973         (WebKit::RemoteLayerBackingStore::flush): Deleted.
3974         Add takeFrontContextPendingFlush, which returns the painted-but-not-yet-flushed front context,
3975         and drops our reference to it. This needs to be called on all backing store between paints.
3976
3977         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
3978         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::hasFlushed):
3979         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3980         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
3981         (WebKit::RemoteLayerTreeDrawingArea::~RemoteLayerTreeDrawingArea):
3982         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3983         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::create):
3984         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::BackingStoreFlusher):
3985         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush):
3986         (WebKit::flushBackingStoreChangesInTransaction): Deleted.
3987         Flush backing store and send the layer tree commit to the UI process from a dispatch queue.
3988         We will only ever have a single commit in flight at a time, and there's a new
3989         RELEASE_ASSERT to ensure that is the case.
3990         We package up the commit on the main thread; the queue calls CGContextFlush
3991         on all of the newly painted contexts and then tosses the commit over to the UI process.
3992         This is a win in many cases because the Web process main thread can go ahead
3993         and do other non-painting tasks while the queue is blocked on painting.
3994
3995 2014-05-08  Tim Horton  <timothy_horton@apple.com>
3996
3997         [wk2] Don't use the XPC-based plugin process for Adobe Reader
3998         https://bugs.webkit.org/show_bug.cgi?id=132701
3999         <rdar://problem/16792692>
4000
4001         Reviewed by Anders Carlsson.
4002
4003         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
4004         (WebKit::shouldUseXPC):
4005         Rename the debugging default to a more modern and accurate name.
4006         Don't use XPC for Adobe Reader.
4007
4008         (WebKit::PluginProcessProxy::platformGetLaunchOptions):
4009         Move the check for plugins that need an executable heap into shouldUseXPC.
4010
4011 2014-05-08  Benjamin Poulain  <benjamin@webkit.org>
4012
4013         [iOS][WK2] Remove an incorrect assertion on asynchronous touch dispatch
4014         https://bugs.webkit.org/show_bug.cgi?id=132660
4015
4016         Reviewed by Enrica Casucci.
4017
4018         This assertion no longer make sense after r168393. Now the asynchronous behavior is maintained
4019         until the last finger leaves the screen.
4020
4021         * UIProcess/WebPageProxy.cpp:
4022         (WebKit::WebPageProxy::handleTouchEventAsynchronously):
4023
4024 2014-05-08  Alexey Proskuryakov  <ap@apple.com>
4025
4026         Make BlobDataFileReference manage its sandbox extension
4027         https://bugs.webkit.org/show_bug.cgi?id=132689
4028
4029         Reviewed by Anders Carlsson.
4030
4031         * CMakeLists.txt:
4032         * PlatformGTK.cmake:
4033         * WebKit2.xcodeproj/project.pbxproj:
4034         Added BlobDataFileReferenceWithSandboxExtension.
4035
4036         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
4037         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
4038         (WebKit::NetworkBlobRegistry::registerBlobURL):
4039         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
4040         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
4041         (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
4042         (WebKit::NetworkBlobRegistry::filesInBlob):
4043         (WebKit::NetworkBlobRegistry::sandboxExtensions): Deleted.
4044         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
4045         We no longer track sandbox extensions here. Instead, provide a way to get files
4046         for a blob, which contain extensions and can allow access to themselves.
4047
4048         * NetworkProcess/NetworkResourceLoader.cpp:
4049         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
4050         (WebKit::NetworkResourceLoader::consumeSandboxExtensions):
4051         (WebKit::NetworkResourceLoader::invalidateSandboxExtensions):
4052         * NetworkProcess/NetworkResourceLoader.h:
4053         Allow/revoke access to files in blob, just like we do for explicitly passed extensions.
4054
4055         * Shared/BlobDataFileReferenceWithSandboxExtension.cpp: Added.
4056         (WebKit::BlobDataFileReferenceWithSandboxExtension::BlobDataFileReferenceWithSandboxExtension):
4057         (WebKit::BlobDataFileReferenceWithSandboxExtension::~BlobDataFileReferenceWithSandboxExtension):
4058         (WebKit::BlobDataFileReferenceWithSandboxExtension::prepareForFileAccess):
4059         (WebKit::BlobDataFileReferenceWithSandboxExtension::revokeFileAccess):
4060         * Shared/BlobDataFileReferenceWithSandboxExtension.h: Added.
4061         (WebKit::BlobDataFileReferenceWithSandboxExtension::create):
4062         A subclass of BlobDataFileReference that also contains a sandbox extension. NetworkProcess
4063         always uses it in BlobRegistryImpl.
4064
4065         * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerFileBlobURL):
4066         * WebProcess/FileAPI/BlobRegistryProxy.h:
4067         Updated for BlobRegistry interface changes. BlobRegistryProxy doesn't really need