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