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