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