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