55b2ae43a675e0443992f8b852bf60e971024650
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-05-13  Anders Carlsson  <andersca@apple.com>
2
3         Another build fix.
4
5         Reviewed by Dan Bernstein.
6
7         * Shared/API/Cocoa/WKFoundation.h:
8         Make sure to include Availability.h
9
10 2014-05-13  Beth Dakin  <bdakin@apple.com>
11
12         REGRESSION (topContentInset): Searching through Facebook Messenger's chat causes 
13         scrolling in News Feed
14         https://bugs.webkit.org/show_bug.cgi?id=132889
15         -and corresponding-
16         <rdar://problem/16715716>
17
18         Reviewed by Simon Fraser.
19
20         Re-name scrollOffsetRelativeToDocument() to 
21         documentScrollPositionRelativeToViewOrigin().
22         * WebProcess/WebPage/FindController.cpp:
23         (WebKit::FindController::rectsForTextMatches):
24         * WebProcess/WebPage/WebPage.cpp:
25         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
26
27 2014-05-13  Dean Jackson  <dino@apple.com>
28
29         [iOS] Page scale update messages for media controls should only fire at the end of zooming
30         https://bugs.webkit.org/show_bug.cgi?id=132857
31         <rdar://problem/16631009>
32
33         Reviewed by Simon Fraser.
34
35         As the user was zooming, the media controls that responded
36         to the page scale (and resized themselves) would do so
37         slightly out of sync with the screen refreshes, and it looked
38         terrible.
39
40         We already know if a pageScale change is happening inside
41         a gesture using the inStableState property of the visibleContentRectUpdateInfo.
42         Simply pass this along to WebCore::Page.
43
44         * WebProcess/WebPage/ios/WebPageIOS.mm:
45         (WebKit::WebPage::updateVisibleContentRects): Pass inStableState onto the
46         WebCore::Page. Note that we have to send this message even if the
47         scale has not changed, since the last changing update might not have
48         been stable.
49
50 2014-05-13  Benjamin Poulain  <bpoulain@apple.com>
51
52         [iOS][WK2] When the secondary UIScrollView delegates respond to callbacks, delay the state change until both delegates have finished
53         https://bugs.webkit.org/show_bug.cgi?id=132849
54         <rdar://problem/16863716>
55
56         Reviewed by Anders Carlsson.
57
58         When there are two delegates responding to UIScrollView changes, there was often an intermediate invalid
59         state forwarded to the UIProcess.
60
61         For example, on scroll, WKWebView would update the state based on the current obscured insets in response to
62         delegate callbacks.
63         After that update, Safari would modify the insets, thus updating the state again.
64         The first state changed by WKWebView is incomplete, and should never have been set.
65
66         This patch works around the issue by delaying visible update rect in those cases.
67
68         When the two delegates of WKScrollView respond to the same selector, WKScrollView invokes 
69         [UIWebView _willInvokeUIScrollViewDelegateCallback] on entry, and
70         [UIWebView _didInvokeUIScrollViewDelegateCallback] on exit.
71
72         Between those two calls, WKWebView does not forward the new UI state to the WebProcess.
73
74         * UIProcess/API/Cocoa/WKWebView.mm:
75         (-[WKWebView _willInvokeUIScrollViewDelegateCallback]):
76         (-[WKWebView _didInvokeUIScrollViewDelegateCallback]):
77         (-[WKWebView _updateVisibleContentRects]):
78         * UIProcess/API/Cocoa/WKWebViewInternal.h:
79         * UIProcess/API/ios/WKViewIOS.mm:
80         (-[WKView _commonInitializationWithContextRef:pageGroupRef:relatedToPage:]):
81         * UIProcess/ios/WKScrollView.h:
82         * UIProcess/ios/WKScrollView.mm:
83         (-[WKScrollViewDelegateForwarder initWithInternalDelegate:externalDelegate:]):
84         (-[WKScrollViewDelegateForwarder forwardInvocation:]):
85         (-[WKScrollView setInternalDelegate:]):
86
87 2014-05-13  Benjamin Poulain  <bpoulain@apple.com>
88
89         [iOS][WK2] Remove the _extendedBackgroundExclusionInsets SPI
90         https://bugs.webkit.org/show_bug.cgi?id=132848
91         <rdar://problem/16875093>
92
93         Reviewed by Darin Adler.
94
95         The SPI is no longer needed by Safari.
96
97         * UIProcess/API/Cocoa/WKWebView.mm:
98         (-[WKWebView initWithFrame:configuration:]):
99         (-[WKWebView _updateScrollViewBackground]):
100         (-[WKWebView _frameOrBoundsChanged]):
101         (-[WKWebView _setObscuredInsets:]):
102         (-[WKWebView _endAnimatedResize]):
103         (updateTopAndBottomExtendedBackgroundExclusionIfNecessary): Deleted.
104         (-[WKWebView _setExtendedBackgroundExclusionInsets:]): Deleted.
105         (-[WKWebView _extendedBackgroundExclusionInsets]): Deleted.
106         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
107
108 2014-05-13  Samuel White  <samuel_white@apple.com>
109
110         AX: Hit testing not accounting for top content inset.
111         https://bugs.webkit.org/show_bug.cgi?id=132876
112
113         Reviewed by Chris Fleizach.
114
115         Updated accessibilityHitTest: to account for top content inset when converting from screen coords to WebKit coords.
116
117         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
118         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
119
120 2014-05-13  Enrica Casucci  <enrica@apple.com>
121
122         REGRESSION (WebKit2): Zooming to text field leaves it partially hidden by the form assistant.
123         https://bugs.webkit.org/show_bug.cgi?id=132879
124         <rdar://problem/16318049>
125
126         Reviewed by Benjamin Poulain.
127
128         Adds the heuristics to zoom and scroll to ensure the element being focused
129         is fully visible and its text readable.
130
131         * Shared/AssistedNodeInformation.cpp:
132         (WebKit::AssistedNodeInformation::encode):
133         (WebKit::AssistedNodeInformation::decode):
134         * Shared/AssistedNodeInformation.h:
135         (WebKit::AssistedNodeInformation::AssistedNodeInformation):
136         * UIProcess/API/Cocoa/WKWebView.mm:
137         (-[WKWebView _zoomToFocusRect:WebCore::selectionRect:WebCore::fontSize:minimumScale:maximumScale:allowUserScaling:forceScroll:]):
138         (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
139         * UIProcess/API/Cocoa/WKWebViewInternal.h:
140         * UIProcess/ios/WKContentView.h:
141         * UIProcess/ios/WKContentView.mm:
142         (-[WKContentView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowUserScaling:forceScroll:]):
143         * UIProcess/ios/WKContentViewInteraction.mm:
144         (-[WKContentView _displayFormNodeInputView]):
145         (-[WKContentView _startAssistingNode:userIsInteracting:userObject:]):
146         * WebProcess/WebPage/ios/WebPageIOS.mm:
147         (WebKit::WebPage::getAssistedNodeInformation):
148
149 2014-05-13  Simon Fraser  <simon.fraser@apple.com>
150
151         Fix the iOS Simulator build.
152
153         * UIProcess/mac/ViewSnapshotStore.h:
154
155 2014-05-13  Tim Horton  <timothy_horton@apple.com>
156
157         Speculative build fix for iOS.
158
159         * UIProcess/ios/WebMemoryPressureHandlerIOS.cpp: Removed.
160         * UIProcess/ios/WebMemoryPressureHandlerIOS.mm: Added.
161         (WebKit::WebMemoryPressureHandler::shared):
162         (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
163         * WebKit2.xcodeproj/project.pbxproj:
164         Make WebMemoryPressureHandlerIOS Obj-C.
165
166 2014-05-13  Anders Carlsson  <andersca@apple.com>
167
168         Another follow-up build fix.
169
170         * Shared/API/Cocoa/WKFoundation.h:
171
172 2014-05-13  Anders Carlsson  <andersca@apple.com>
173
174         Another follow-up build fix.
175
176         * Shared/API/Cocoa/WKFoundation.h:
177
178 2014-05-13  Anders Carlsson  <andersca@apple.com>
179
180         Follow-up fix.
181
182         * UIProcess/API/Cocoa/WKNavigationAction.mm:
183         (-[WKNavigationAction _initWithNavigationActionData:WebKit::]):
184         (-[WKNavigationAction _isUserInitiated]):
185
186 2014-05-13  Anders Carlsson  <andersca@apple.com>
187
188         Add -[WKNavigationAction modifierFlags] and -[WKNavigationAction buttonNumber]
189         https://bugs.webkit.org/show_bug.cgi?id=132880
190         <rdar://problem/16901354>
191
192         Reviewed by Dan Bernstein.
193
194         * Shared/API/Cocoa/WKFoundation.h:
195         Add typedef for older systems.
196
197         * UIProcess/API/Cocoa/WKNavigationAction.h:
198         Add -[WKNavigationAction modifierFlags] and -[WKNavigationAction buttonNumber]
199
200         * UIProcess/API/Cocoa/WKNavigationAction.mm:
201         (toWKNavigationType):
202         This can be static now.
203
204         (toNSEventModifierFlags):
205         Helper to convert WebEvent::Modifiers to NSEventModifierFlags.
206
207         (toNSButtonNumber):
208         Helper to convert WebMouseEvent::Button to an AppKit button number.
209
210         (-[WKNavigationAction initWithNavigationActionData:WebKit::]):
211         New initializer that takes a NavigationActionData and fills in the relevant ivars from it.
212
213         (-[WKNavigationAction _isUserInitiated]):
214         Return the new ivar.
215
216         * UIProcess/API/Cocoa/WKNavigationActionInternal.h:
217         Remove readwrite overrides.
218
219         * UIProcess/Cocoa/NavigationState.mm:
220         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
221         Use initWithNavigationActionData:
222
223         * UIProcess/Cocoa/UIDelegate.mm:
224         (WebKit::UIDelegate::UIClient::createNewPage):
225         Use initWithNavigationActionData:
226
227 2014-05-13  Tim Horton  <timothy_horton@apple.com>
228
229         WebKit2 View Gestures (Swipe): Encode snapshots as JPEG on some platforms
230         https://bugs.webkit.org/show_bug.cgi?id=127788
231         <rdar://problem/15928241>
232
233         Reviewed by Anders Carlsson.
234
235         Allow JPEG snapshots. Compression is done asynchronously.
236         Enable JPEG snapshots (for now) on all PLATFORM(MAC).
237         We'll switch back to IOSurface snapshots on 10.9+ after <rdar://problem/16734031> is resolved.
238
239         * UIProcess/API/Cocoa/WKWebView.mm:
240         * UIProcess/API/mac/WKView.mm:
241         (-[WKView _takeViewSnapshot]):
242         Store the image size on the ViewSnapshot.
243         Move IOSurface-related code to ViewSnapshotStore.
244
245         * UIProcess/ios/ViewGestureControllerIOS.mm:
246         (WebKit::ViewGestureController::beginSwipeGesture):
247         Adopt asLayerContents().
248
249         * UIProcess/mac/ViewGestureController.h:
250         * UIProcess/mac/ViewGestureControllerMac.mm:
251         (WebKit::ViewGestureController::retrieveSnapshotForItem):
252         (WebKit::ViewGestureController::beginSwipeGesture):
253         (WebKit::ViewGestureController::removeSwipeSnapshot):
254         Adopt asLayerContents().
255         Put the snapshot on the right layer (the parent of the snapshot image layer);
256         if it's on the snapshot image layer itself, if there is no image, the shadow
257         is displayed on top of the white placeholder.
258         Only reset snapshot purgeability if we're using IOSurface snapshots.
259
260         * UIProcess/mac/ViewSnapshotStore.h:
261         Add a bunch of macros to allow us to switch the snapshot backing store implementation.
262
263         * UIProcess/mac/ViewSnapshotStore.mm:
264         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
265         (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
266         (WebKit::ViewSnapshotStore::recordSnapshot):
267         If takeViewSnapshot() fails, don't remove the existing snapshot.
268
269         (WebKit::createIOSurfaceFromImage):
270         (WebKit::compressImageAsJPEG):
271         (WebKit::ViewSnapshotStore::reduceSnapshotMemoryCost):
272         (WebKit::ViewSnapshotStore::didCompressSnapshot):
273         (WebKit::ViewSnapshot::clearImage):
274         (WebKit::ViewSnapshot::asLayerContents):
275         Asynchronously compress snapshots - if we're using JPEG snapshots - for a
276         very large memory win (~20-30x).
277
278 2014-05-12  Darin Adler  <darin@apple.com>
279
280         Make a few icon database improvements
281         https://bugs.webkit.org/show_bug.cgi?id=132812
282
283         Reviewed by Brady Eidson.
284
285         * UIProcess/API/C/WKIconDatabase.cpp:
286         (WKIconDatabaseCopyIconDataForPageURL): Moved the actual implementation of this
287         out of the bindings into the WebIconDatabase class.
288
289         * UIProcess/API/C/WKIconDatabase.h: Fixed argument names that were inconsistent.
290
291         * UIProcess/WebIconDatabase.cpp: Removed unneeded includes.
292         (WebKit::WebIconDatabase::create): Pass a reference instead of a pointer.
293         (WebKit::WebIconDatabase::WebIconDatabase): Take a reference instead of a pointer.
294         (WebKit::WebIconDatabase::invalidate): Use nullptr.
295         (WebKit::WebIconDatabase::setDatabasePath): Use make_unique.
296         (WebKit::WebIconDatabase::setIconDataForIconURL): Removed unneeded local variable.
297         (WebKit::WebIconDatabase::imageForPageURL): Use nullptr.
298         (WebKit::WebIconDatabase::nativeImageForPageURL): Ditto.
299         (WebKit::WebIconDatabase::didFinishURLImport): Use a modern for loop.
300         (WebKit::WebIconDatabase::iconDataForPageURL): Added. Moved this here from
301         WKIconDatabase.cpp, but also changed to use createWithoutCopying to avoid making
302         another copy of the data for each icon.
303
304         * UIProcess/WebIconDatabase.h: Removed unneeded includes. Derive from
305         IconDatabaseClient privately. Use nullptr. Added iconDataForPageURL member
306         function. Use a reference for the constructor argument. Use override for
307         virtual functions. Use unique_ptr instead of OwnPtr.
308
309 2014-05-12  Mark Lam  <mark.lam@apple.com>
310
311         WebKit2 on iOS needs to capture the main thread's floating point environment.
312         <https://webkit.org/b/132755>
313
314         Reviewed by Geoffrey Garen.
315
316         * Shared/mac/ChildProcessMac.mm:
317         (WebKit::ChildProcess::platformInitialize):
318         - Call FloatingPointEnv::enableNeededFloatingPointModes() to initialize
319           the ARMv7 FP env to support denormalized numbers.
320         - Call FloatingPointEnv::saveMainThreadEnvironment() to capture the main thread
321           fp env.
322
323 2014-05-12  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
324
325         [EFL][WK2] Fix ewk_view_navigation test in EWK2ViewTest 
326         https://bugs.webkit.org/show_bug.cgi?id=132817
327
328         Reviewed by Dirk Schulze.
329
330         To load test html pages, call ewk_view_uri_set() instead of EWK2UnitTestServer.
331         Besides this patch adds test html page for ewk_view_navigation unit test.
332
333         * UIProcess/API/efl/tests/resources/Page1.html: Added.
334         * UIProcess/API/efl/tests/resources/Page2.html: Added.
335         * UIProcess/API/efl/tests/resources/Page3.html: Added.
336         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
337         (TEST_F):
338
339 2014-05-12  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
340
341         Unreviewed, EFL build fix since r168625.
342
343         * UIProcess/efl/WebContextEfl.cpp:
344         (WebKit::WebContext::platformDefaultLocalStorageDirectory): Remove const keyword.
345
346 2014-05-12  Simon Fraser  <simon.fraser@apple.com>
347
348         [iOS WK2] Fuzzy tiles on some sites on loading
349         https://bugs.webkit.org/show_bug.cgi?id=132847
350         <rdar://problem/16816178>
351
352         Reviewed by Benjamin Poulain.
353         
354         PlatformCALayerRemoteTiledBacking overrode setContentsScale() but not contentsScale(),
355         causing us to early-return from GraphicsLayerCA::updateContentsScale() and leave the
356         scale wrong. Fix by overriding contentsScale() also.
357
358         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
359         (WebKit::PlatformCALayerRemoteTiledBacking::contentsScale):
360         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
361
362 2014-05-12  Tim Horton  <timothy_horton@apple.com>
363
364         Triple-buffer RemoteLayerBackingStore
365         https://bugs.webkit.org/show_bug.cgi?id=132786
366         <rdar://problem/16877498>
367
368         Reviewed by Simon Fraser.
369
370         We need three buffers because we're currently unable to synchronize
371         with the render server to swap when they're not in use, so we were
372         throwing surfaces away far too frequently.
373
374         This hugely reduces time spent in IOSurface::create on various repaint benchmarks.
375
376         * Shared/mac/RemoteLayerBackingStore.h:
377         (WebKit::RemoteLayerBackingStore::hasFrontBuffer):
378         (WebKit::RemoteLayerBackingStore::volatility): Deleted.
379         * Shared/mac/RemoteLayerBackingStore.mm:
380         (WebKit::RemoteLayerBackingStore::RemoteLayerBackingStore):
381         (WebKit::RemoteLayerBackingStore::clearBackingStore):
382         (WebKit::RemoteLayerBackingStore::encode):
383         (WebKit::RemoteLayerBackingStore::decode):
384         (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
385         (WebKit::RemoteLayerBackingStore::display):
386         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
387         (WebKit::RemoteLayerBackingStore::setBufferVolatility):
388         (WebKit::RemoteLayerBackingStore::Buffer::discard):
389         (WebKit::RemoteLayerBackingStore::setVolatility): Deleted.
390         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
391         (WebKit::RemoteLayerBackingStoreCollection::purgeabilityTimerFired):
392         Put the ShareableBitmap/IOSurface and a volatility bit in a Buffer struct.
393         Also factor out "throw away this buffer and put it in the pool" into Buffer::discard().
394         We keep a volatility bit because querying IOSurface purgeability is expensive,
395         and we have a guarantee that any changes will happen in the Web process
396         and go through this class (the lack of this guarantee in most cases is why I'm not
397         putting this bit in WebCore::IOSurface itself).
398
399         Make it so that each buffer's volatility can be adjusted individually
400         by setBufferVolatility(), and adopt in RemoteLayerBackingStoreCollection.
401
402         Add a third buffer, m_secondaryBackBuffer, which will swap with the back buffer
403         before swapping front and back if the back buffer (soon to be the front buffer)
404         is still in use by the render server. This means that we will almost never
405         have to throw away a surface because it's in use (and conversely never need
406         to make a new surface).
407
408         Adjust RemoteLayerBackingStoreCollection to make secondary back surfaces purgeable
409         more aggressively than others.
410
411 2014-05-12  Alexey Proskuryakov  <ap@apple.com>
412
413         REGRESSION (r165972): Can't type into text fields in Flash
414         https://bugs.webkit.org/show_bug.cgi?id=132840
415         <rdar://problem/16671969>
416
417         Reviewed by Anders Carlsson.
418
419         * UIProcess/API/mac/WKView.mm: (-[WKView inputContext]): Restore a function that
420         got accidentally lost when adding async text input code.
421
422 2014-05-12  Chris Fleizach  <cfleizach@apple.com>
423
424         AX: .js dialogs shown in unload while AX is running crash WebKit.
425         https://bugs.webkit.org/show_bug.cgi?id=123828
426
427         Reviewed by Anders Carlsson.
428
429         Utilize platform API to inform AX clients when the WebProcess will suspend and resume.
430         This allows us to avoid having special behavior for accessibility when the WebProcess needs
431         to wait on a reply.
432
433         * Platform/IPC/Connection.cpp:
434         (IPC::Connection::waitForSyncReply):
435         * Platform/IPC/Connection.h:
436         * Platform/IPC/mac/ConnectionMac.cpp:
437         (IPC::Connection::willSendSyncMessage):
438         (IPC::Connection::didReceiveSyncReply):
439         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
440         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
441         (WebKit::WebChromeClient::runJavaScriptAlert):
442         (WebKit::WebChromeClient::runJavaScriptConfirm):
443         (WebKit::WebChromeClient::runJavaScriptPrompt):
444         (WebKit::WebChromeClient::print):
445         (WebKit::WebChromeClient::exceededDatabaseQuota):
446         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
447         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
448
449 2014-05-12  Alex Christensen  <achristensen@webkit.org>
450
451         Progress on web timing.
452         https://bugs.webkit.org/show_bug.cgi?id=132574
453
454         Reviewed by Alexey Proskuryakov.
455
456         * Shared/WebCoreArgumentCoders.cpp:
457         (IPC::ArgumentCoder<ResourceResponse>::encode):
458         (IPC::ArgumentCoder<ResourceResponse>::decode):
459         Transfer ResourceLoadTiming values if they exist.
460
461 2014-05-12  Dan Bernstein  <mitz@apple.com>
462
463         [Cocoa] Expose WebPage::usesEphemeralSession to the bundle
464         https://bugs.webkit.org/show_bug.cgi?id=132836
465
466         Reviewed by Anders Carlsson.
467
468         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
469         (-[WKWebProcessPlugInBrowserContextController _usesNonPersistentWebsiteDataStore]):
470         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
471
472 2014-05-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>
473
474         REGRESSION(168625): [GTK] build broken due to WKContextSetLocalStorageDirectory
475         https://bugs.webkit.org/show_bug.cgi?id=132831
476
477         Unreviewed GTK build fix.
478
479         * UIProcess/gtk/WebContextGtk.cpp:
480         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
481         This is now a static member function.
482
483 2014-05-12  Anders Carlsson  <andersca@apple.com>
484
485         WKWebViewConfiguration should fill in the blanks
486         https://bugs.webkit.org/show_bug.cgi?id=132832
487         <rdar://problem/16886408>
488
489         Reviewed by Dan Bernstein.
490
491         * UIProcess/API/Cocoa/WKWebView.mm:
492         (-[WKWebView initWithFrame:configuration:]):
493         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
494         (-[WKWebViewConfiguration init]):
495         (-[WKWebViewConfiguration _validate]):
496         * UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h:
497
498 2014-05-12  Anders Carlsson  <andersca@apple.com>
499
500         WKWebView should default to _backgroundExtendsBeyondPage = YES
501         https://bugs.webkit.org/show_bug.cgi?id=132829
502         <rdar://problem/16886364>
503
504         Reviewed by Beth Dakin.
505
506         * UIProcess/API/Cocoa/WKWebView.mm:
507         (-[WKWebView initWithFrame:configuration:]):
508
509 2014-05-12  Anders Carlsson  <andersca@apple.com>
510
511         Pass local storage directory to StorageManager::create
512         https://bugs.webkit.org/show_bug.cgi?id=132827
513
514         Reviewed by Tim Horton.
515
516         Since we know the local storage directory at creation time and we know it never changes,
517         we can get rid of setLocalStorageDirectory and just pass the local storage directory at creation time.
518
519         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
520         (WebKit::LocalStorageDatabaseTracker::create):
521         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
522         (WebKit::LocalStorageDatabaseTracker::~LocalStorageDatabaseTracker):
523         (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectory): Deleted.
524         (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal): Deleted.
525         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
526         * UIProcess/Storage/StorageManager.cpp:
527         (WebKit::StorageManager::create):
528         (WebKit::StorageManager::StorageManager):
529         (WebKit::StorageManager::setLocalStorageDirectory): Deleted.
530         * UIProcess/Storage/StorageManager.h:
531         * UIProcess/WebContext.cpp:
532         (WebKit::WebContext::WebContext):
533
534 2014-05-11  Anders Carlsson  <andersca@apple.com>
535
536         Replace WKContextSetLocalStorageDirectory with a context configuration getter/setter
537         https://bugs.webkit.org/show_bug.cgi?id=132809
538
539         Reviewed by Dan Bernstein.
540
541         * UIProcess/API/C/WKContext.cpp:
542         (WKContextSetLocalStorageDirectory): Deleted.
543
544         * UIProcess/API/C/WKContextConfigurationRef.cpp:
545         (WKContextConfigurationCopyLocalStorageDirectory):
546         (WKContextConfigurationSetLocalStorageDirectory):
547         * UIProcess/API/C/WKContextConfigurationRef.h:
548         Add getters and setters for the local storage directory.
549
550         * UIProcess/API/C/WKContextPrivate.h:
551         Remove WKContextSetLocalStorageDirectory.
552
553         * UIProcess/API/Cocoa/WKProcessGroup.mm:
554         (-[WKProcessGroup initWithInjectedBundleURL:]):
555         Call WebContext::applyPlatformSpecificConfigurationDefaults.
556
557         * UIProcess/API/Cocoa/WKProcessPool.mm:
558         (-[WKProcessPool _initWithConfiguration:]):
559         Call WebContext::applyPlatformSpecificConfigurationDefaults (for now).
560
561         * UIProcess/APIContextConfiguration.cpp:
562         (API::ContextConfiguration::webContextConfiguration):
563         Set the local storage. Also, call WebContext::applyPlatformSpecificConfigurationDefaults.
564
565         * UIProcess/APIContextConfiguration.h:
566         (API::ContextConfiguration::injectedBundlePath):
567         This should be const.
568
569         (API::ContextConfiguration::localStorageDirectory):
570         (API::ContextConfiguration::setLocalStorageDirectory):
571         Add getter and setter.
572
573         * UIProcess/Storage/StorageManager.cpp:
574         (WebKit::StorageManager::setLocalStorageDirectory):
575         ASSERT that the path isn't null.
576
577         * UIProcess/WebContext.cpp:
578         (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults):
579         New helper function that will fill in platform specific defaults for empty parameters.
580
581         (WebKit::WebContext::WebContext):
582         Get the local storage directory from the configuration.
583
584         (WebKit::WebContext::setLocalStorageDirectory): Deleted.
585         (WebKit::WebContext::localStorageDirectory): Deleted.
586         These are no longer needed.
587
588         * UIProcess/mac/WebContextMac.mm:
589         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
590         This should be a static member function.
591
592 2014-05-12  Martin Hodovan  <mhodovan.u-szeged@partner.samsung.com>
593
594         Typo fix in generate-forwarding-headers
595         https://bugs.webkit.org/show_bug.cgi?id=132820
596
597         Reviewed by Anders Carlsson.
598
599         * Scripts/generate-forwarding-headers.pl:
600         (collectFrameworkHeaderPaths):
601         
602 2014-05-12  Peter Molnar  <pmolnar.u-szeged@partner.samsung.com>
603
604         [EFL] TLSErrors do not cause page load to fail when not ignored
605         https://bugs.webkit.org/show_bug.cgi?id=131104
606
607         Reviewed by Gyuyoung Kim.
608
609         Added EFL unit test for the bug https://bugs.webkit.org/show_bug.cgi?id=121548
610
611         * UIProcess/API/efl/tests/test_ewk2_ssl.cpp: Added new test: ewk_ssl_bad_cert_redirect_https_to_http
612
613 2014-05-11  Gordon Sheridan  <gordon_sheridan@apple.com>
614
615         Expose a function to copy favicon data without image conversion.
616         https://bugs.webkit.org/show_bug.cgi?id=132805
617
618         Reviewed by Darin Adler.
619
620         * UIProcess/API/C/WKIconDatabase.cpp:
621         (WKIconDatabaseCopyIconDataForPageURL):
622         Add a function to copy the data from the image of a favicon for an associated page url.
623
624         * UIProcess/API/C/WKIconDatabase.h:
625         Declare WKIconDatabaseCopyIconDataForPageURL.
626
627 2014-05-11  Seongjun Kim  <isAir@company100.com>
628
629         REGRESSION(r168603): [GTK] Build broken.
630         https://bugs.webkit.org/show_bug.cgi?id=132810
631
632         Reviewed by Carlos Garcia Campos.
633
634         * UIProcess/API/gtk/WebKitWebContext.cpp:
635         (createDefaultWebContext):
636         Construct a WebContextConfiguration object and pass it to WebContext::create.
637
638 2014-05-11  Anders Carlsson  <andersca@apple.com>
639
640         Remove local storage directory and sandbox extension from WebProcessCreationParameters
641         https://bugs.webkit.org/show_bug.cgi?id=132808
642
643         Reviewed by Beth Dakin.
644
645         * Shared/WebProcessCreationParameters.cpp:
646         (WebKit::WebProcessCreationParameters::encode):
647         (WebKit::WebProcessCreationParameters::decode):
648         * Shared/WebProcessCreationParameters.h:
649         * UIProcess/WebContext.cpp:
650         (WebKit::WebContext::createNewWebProcess):
651         * WebProcess/cocoa/WebProcessCocoa.mm:
652         (WebKit::WebProcess::platformInitializeWebProcess):
653
654 2014-05-11  Jaehun Lim  <ljaehun.lim@samsung.com>
655
656         Unreviewed, CMake build fix after r168603
657
658         Add APIContextConfiguration.cpp and WKContextConfigurationRef.cpp to the source list.
659
660         * CMakeLists.txt:
661
662 2014-05-11  Anders Carlsson  <andersca@apple.com>
663
664         Add a WKContextConfigurationRef object and make the injected bundle path part of the configuration
665         https://bugs.webkit.org/show_bug.cgi?id=132806
666         <rdar://problem/16830143>
667
668         Reviewed by Beth Dakin.
669
670         Many setters on WKContextRef really only make sense to set early on, so move to a pattern where we create a
671         configuration object, a WKContextConfiguration which WKContexts can be created from. Add the injected bundle path
672         as a configuration property. More setters will follow.
673
674         * Shared/API/c/WKBase.h:
675         Add WKContextConfigurationRef.
676
677         * Shared/APIObject.h:
678         Add ContextConfiguration enum declaration.
679
680         * UIProcess/API/C/WKAPICast.h:
681         Handle WKContextConfigurationRef.
682
683         * UIProcess/API/C/WKContext.cpp:
684         (WKContextCreate):
685         Create an empty WKContextConfigurationRef object and pass it to WKContextCreateWithConfiguration.
686
687         (WKContextCreateWithInjectedBundlePath):
688         Create a WKContextConfigurationRef object, set its bundle path and pass the configuration to WKContextCreateWithConfiguration.
689
690         (WKContextCreateWithConfiguration):
691         Convert the WKContextConfigurationRef object to a WebContextConfiguration and pass it to WebContext::create.
692
693         * UIProcess/API/C/WKContext.h:
694         Add WKContextCreateWithConfiguration.
695
696         * UIProcess/API/C/WKContextConfigurationRef.cpp: Added.
697         (WKContextConfigurationCreate):
698         Create an API::ContextConfiguration object.
699
700         (WKContextConfigurationCopyInjectedBundlePath):
701         Return the injected bundle path.
702
703         (WKContextConfigurationSetInjectedBundlePath):
704         Set the injected bundle path.
705
706         * UIProcess/API/C/WKContextConfigurationRef.h: Added.
707         New C SPI header.
708         
709         * UIProcess/API/Cocoa/WKProcessGroup.mm:
710         (-[WKProcessGroup initWithInjectedBundleURL:]):
711         Construct a WebContextConfiguration object and pass it to WebContext::Create.
712     
713         * UIProcess/API/Cocoa/WKProcessPool.mm:
714         (-[WKProcessPool _initWithConfiguration:]):
715         Construct a WebContextConfiguration object and pass it to WebContext::Create.
716
717         * UIProcess/APIContextConfiguration.cpp: Added.
718         New API::ContextConfiguration object.
719
720         (API::ContextConfiguration::webContextConfiguration):
721         Construct a WebContextConfiguration struct from our current configuration.
722
723         * UIProcess/APIContextConfiguration.h: Added.
724         
725         * UIProcess/WebContext.cpp:
726         (WebKit::WebContext::create):
727         Pass the WebContextConfiguration to the constructor.
728
729         (WebKit::WebContext::WebContext):
730         Set the injected bundle path from the WebContextConfiguration object.
731
732         * UIProcess/WebContext.h:
733         Change the WebContext constructor and create function to take a WebContextConfiguration object.
734
735         * WebKit2.xcodeproj/project.pbxproj:
736         Add new files.
737
738 2014-05-10  Csaba Osztrogonác  <ossy@webkit.org>
739
740         [WK2] URTBF after r168585.
741
742         * Platform/IPC/Connection.h:
743         * Shared/ChildProcessProxy.cpp:
744         (WebKit::ChildProcessProxy::terminate):
745
746 2014-05-10  Tim Horton  <timothy_horton@apple.com>
747
748         [WKWebView _updateScrollViewBackground] churns UI-and-CGColors while repainting
749         https://bugs.webkit.org/show_bug.cgi?id=132793
750         <rdar://problem/16877870>
751
752         Reviewed by Dan Bernstein.
753
754         * UIProcess/API/Cocoa/WKWebView.mm:
755         (-[WKWebView _updateScrollViewBackground]):
756         Don't bypass the cache and make a copy of the CGColor just to set its alpha.
757         Cache the last color and don't bother creating a UIColor nor updating the
758         color on our views if it hasn't changed.
759
760 2014-05-10  Tim Horton  <timothy_horton@apple.com>
761
762         Implement -forwardingTargetForSelector on WKScrollViewDelegateForwarder
763         https://bugs.webkit.org/show_bug.cgi?id=132790
764         <rdar://problem/16877802>
765
766         Reviewed by Dan Bernstein.
767
768         * UIProcess/ios/WKScrollView.mm:
769         (-[WKScrollViewDelegateForwarder forwardingTargetForSelector:]):
770         If only one of the delegates will respond to a selector,
771         we can return it from forwardingTargetForSelector: to avoid
772         NSInvocation overhead.
773
774 2014-05-10  Dan Bernstein  <mitz@apple.com>
775
776         [Mac] Some targets that link or soft-link WebKit.framework don't depend on it
777         https://bugs.webkit.org/show_bug.cgi?id=132776
778
779         Reviewed by Darin Adler.
780
781         * WebKit2.xcodeproj/project.pbxproj:
782
783 2014-05-10  Ryuan Choi  <ryuan.choi@samsung.com>
784
785         [EFL][WK2] Move the ownership of EwkSettings from EwkView to EwkPageGroup
786         https://bugs.webkit.org/show_bug.cgi?id=132771
787
788         Reviewed by Gyuyoung Kim.
789
790         Moved ownership of EwkSettings from EwkView to EwkPageGroup.
791
792         * UIProcess/API/efl/EwkView.cpp:
793         (EwkView::EwkView):
794         * UIProcess/API/efl/EwkView.h:
795         (EwkView::settings): Deleted.
796         * UIProcess/API/efl/ewk_page_group.cpp:
797         (EwkPageGroup::EwkPageGroup):
798         * UIProcess/API/efl/ewk_page_group_private.h:
799         (EwkPageGroup::settings):
800         * UIProcess/API/efl/ewk_settings_private.h:
801         * UIProcess/API/efl/ewk_view.cpp:
802         (ewk_view_settings_get):
803
804 2014-05-10  Tim Horton  <timothy_horton@apple.com>
805
806         [iOS WebKit2] REGRESSION (r168493): Canvasmark 2013 benchmark always hits the RELEASE_ASSERT in RemoteLayerTreeDrawingArea::flushLayers()
807         https://bugs.webkit.org/show_bug.cgi?id=132783
808         <rdar://problem/16877326>
809
810         Reviewed by Anders Carlsson.
811
812         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
813         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush):
814         There's a race window between the BackingStoreFlusher sending the new
815         layer tree to the UI process and updating m_hasFlushed where we can
816         get a reply back in (on the Web process main thread) from the UI process
817         that we committed the new layer tree (didUpdate).
818         This will cause the RELEASE_ASSERT in flushLayers() to fire incorrectly.
819         Since the RELEASE_ASSERT is there only to avoid painting garbage, move
820         our code to set m_hasFlushed=true to after we finish calling CGContextFlush
821         on all of the contexts, instead of after we send the layer tree commit message,
822         which will remove the race entirely.
823
824 2014-05-10  Anders Carlsson  <andersca@apple.com>
825
826         ASSERTION FAILED: !m_connection under RunJavaScriptAlert
827         https://bugs.webkit.org/show_bug.cgi?id=132792
828         <rdar://problem/16691138>
829
830         Reviewed by Dan Bernstein.
831
832         Detect if someone implementing a UI delegate method with a completion handler never calls the completion
833         handler and raise an exception instead of asserting.
834
835         * UIProcess/Cocoa/UIDelegate.mm:
836         (WebKit::CompletionHandlerCallChecker::create):
837         (WebKit::CompletionHandlerCallChecker::~CompletionHandlerCallChecker):
838         (WebKit::CompletionHandlerCallChecker::didCallCompletionHandler):
839         (WebKit::CompletionHandlerCallChecker::CompletionHandlerCallChecker):
840         (WebKit::CompletionHandlerCallChecker::classImplementingDelegateMethod):
841         (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
842         (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
843         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
844
845 2014-05-10  Anders Carlsson  <andersca@apple.com>
846
847         Use xpc_connection_kill for killing child processes where appropriate
848         https://bugs.webkit.org/show_bug.cgi?id=132788
849         <rdar://problem/16664185>
850
851         Reviewed by Sam Weinig.
852
853         * Platform/IPC/Connection.h:
854         * Platform/IPC/mac/ConnectionMac.mm:
855         (IPC::Connection::kill):
856         * Platform/IPC/mac/XPCPtr.h:
857         (IPC::XPCPtr::operator bool):
858         * Shared/ChildProcessProxy.cpp:
859         (WebKit::ChildProcessProxy::terminate):
860
861 2014-05-10  Anders Carlsson  <andersca@apple.com>
862
863         WebKit2 is leaking an xpc_connection per web process it creates
864         https://bugs.webkit.org/show_bug.cgi?id=132785
865         <rdar://problem/14912160>
866
867         Reviewed by Sam Weinig.
868
869         Introduce an IPC::XPCPtr smart pointer class and use it for XPC connections inside Connection::Identifier and Connection itself.
870
871         Make sure we always adopt any connections that are created.
872
873         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm:
874         (DatabaseServiceInitializer):
875         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
876         (WebKit::NetworkServiceInitializerDelegate::NetworkServiceInitializerDelegate):
877         (NetworkServiceInitializer):
878         * Platform/IPC/Connection.h:
879         (IPC::Connection::Identifier::Identifier):
880         (IPC::Connection::xpcConnection):
881         * Platform/IPC/mac/ConnectionMac.mm:
882         (IPC::Connection::platformInvalidate):
883         (IPC::Connection::platformInitialize):
884         (IPC::Connection::getAuditToken):
885         * Platform/IPC/mac/XPCPtr.h: Added.
886         (IPC::XPCPtr::XPCPtr):
887         (IPC::XPCPtr::~XPCPtr):
888         (IPC::XPCPtr::get):
889         (IPC::XPCPtr::operator!):
890         (IPC::XPCPtr::operator=):
891         (IPC::adoptXPC):
892         * PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm:
893         (WebKit::PluginServiceInitializerDelegate::PluginServiceInitializerDelegate):
894         (PluginServiceInitializer):
895         * Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessMain.mm:
896         (WebKit::BootstrapMain):
897         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
898         (WebKit::XPCServiceInitializerDelegate::XPCServiceInitializerDelegate):
899         (WebKit::XPCServiceInitializer):
900         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
901         (WebKit::XPCServiceInitializerDelegate::hasEntitlement):
902         (WebKit::XPCServiceInitializerDelegate::isClientSandboxed):
903         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
904         (WebKit::XPCServiceEventHandler):
905         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
906         (WebKit::XPCServiceEventHandler):
907         * UIProcess/Launcher/ProcessLauncher.cpp:
908         (WebKit::ProcessLauncher::didFinishLaunchingProcess):
909         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
910         (WebKit::connectToService):
911         * WebKit2.xcodeproj/project.pbxproj:
912         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
913         (WebContentServiceInitializer):
914
915 2014-05-10  Anders Carlsson  <andersca@apple.com>
916
917         Simplify createDataAvailableSource
918         https://bugs.webkit.org/show_bug.cgi?id=132782
919         <rdar://problem/16815202>
920
921         Reviewed by Sam Weinig.
922
923         * Platform/IPC/mac/ConnectionMac.mm: Renamed from Source/WebKit2/Platform/IPC/mac/ConnectionMac.cpp.
924         Rename to make this Objective-C++ so we get the lambda-to-block conversion.
925
926         (IPC::createDataAvailableSource):
927         Make this a function template and just pass the function directly to dispatch_source_set_event_handler.
928
929         (IPC::Connection::open):
930         Use lambdas instead of WTF::bind, so we'll make sure the connection is kept alive.
931
932         * WebKit2.xcodeproj/project.pbxproj:
933         Update for ConnectionMac.cpp to ConnectionMac.mm rename.
934
935 2014-05-10  Anders Carlsson  <andersca@apple.com>
936
937         Follow-up fix.
938
939         Reviewed by Darin Adler.
940
941         * UIProcess/API/Cocoa/WKNavigationResponse.h:
942         * UIProcess/API/Cocoa/WKNavigationResponse.mm:
943         (-[WKNavigationResponse isForMainFrame]):
944         Use a slightly better name.
945
946 2014-05-10  Anders Carlsson  <andersca@apple.com>
947
948         Make -[WKNavigationResponse frame] SPI and only expose -[WKNavigationResponse isMainFrame]
949         https://bugs.webkit.org/show_bug.cgi?id=132781
950         <rdar://problem/16868319>
951
952         Reviewed by Darin Adler.
953
954         * UIProcess/API/Cocoa/WKNavigationResponse.h:
955         * UIProcess/API/Cocoa/WKNavigationResponse.mm:
956         (-[WKNavigationResponse description]):
957         (-[WKNavigationResponse isMainFrameNavigation]):
958         (-[WKNavigationResponse _frame]):
959         (-[WKNavigationResponse frame]): Deleted.
960         (-[WKNavigationResponse setFrame:]): Deleted.
961         * UIProcess/API/Cocoa/WKNavigationResponseInternal.h:
962         * UIProcess/API/Cocoa/WKNavigationResponsePrivate.h: Added.
963         * UIProcess/Cocoa/NavigationState.mm:
964         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
965         * WebKit2.xcodeproj/project.pbxproj:
966
967 2014-05-09  Dan Bernstein  <mitz@apple.com>
968
969         [Cocoa] Remove a deprecated bundle form delegate method now that no one implements it
970         https://bugs.webkit.org/show_bug.cgi?id=132769
971
972         Reviewed by Sam Weinig.
973
974         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
975         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
976
977 2014-05-09  Benjamin Poulain  <bpoulain@apple.com>
978
979         [iOS][WK2] Fix bugs exposed by r168556
980         https://bugs.webkit.org/show_bug.cgi?id=132768
981
982         Reviewed by Ryosuke Niwa.
983
984         Fix two bugs exposed by r168556.
985         1) We were only changing the page scale factor when the scale was not adjusted by live
986            resize. The idea was that the scale would either be the same (responsive content)
987            or that it would be defined by the next viewContentRectUpdate.
988
989            Now that we also send resize and scroll events, we must always update the scale since
990            it affects some APIs observable from JavaScript (like scrolling bounds).
991
992         2) Internally, Page's scaleFactor is stored as a float and not double. The rounding error
993            were causing us to send DynamicViewportUpdateChangedTarget() in cases were there is no change
994            of target.
995
996         * WebProcess/WebPage/ios/WebPageIOS.mm:
997         (WebKit::withinEpsilon):
998         (WebKit::WebPage::dynamicViewportSizeUpdate):
999
1000 2014-05-09  Ryuan Choi  <ryuan.choi@samsung.com>
1001
1002         [EFL][WK2] Close icondatabase when EwkFaviconDatabase is destroyed
1003         https://bugs.webkit.org/show_bug.cgi?id=132767
1004
1005         Reviewed by Gyuyoung Kim.
1006
1007         IconDatabase should be closed explicitly.
1008
1009         * UIProcess/API/efl/ewk_favicon_database.cpp:
1010         (EwkFaviconDatabase::~EwkFaviconDatabase):
1011
1012 2014-05-09  Anders Carlsson  <andersca@apple.com>
1013
1014         Another build fix.
1015
1016         * mac/MigrateHeadersToWebKit2.make:
1017         Don't migrate the WKPreferences.h header, WebKit2 provides its own header.
1018
1019 2014-05-09  Benjamin Poulain  <benjamin@webkit.org>
1020
1021         [iOS][WK2] Reset the scroll position on the first frame after didCommitLoad
1022         https://bugs.webkit.org/show_bug.cgi?id=132765
1023
1024         Reviewed by Tim Horton.
1025
1026         Since WebCore does not update our scroll view on load, we need to do that ourself.
1027
1028         In case where we need to restore the state from the history, RemoteLayerTreeDrawingAreaProxy
1029         will always invoke the scrolling after didCommitLayerTree() (since r167916).
1030         Consequently, it is now safe again to reset the scroll position ourself on the first frame.
1031
1032         * UIProcess/API/Cocoa/WKWebView.mm:
1033         (-[WKWebView _didCommitLoadForMainFrame]):
1034         (-[WKWebView _didCommitLayerTree:WebKit::]):
1035         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1036         * UIProcess/ios/WKContentView.mm:
1037         (-[WKContentView _didCommitLoadForMainFrame]):
1038
1039 2014-05-09  Anders Carlsson  <andersca@apple.com>
1040
1041         Update availability macros
1042         https://bugs.webkit.org/show_bug.cgi?id=132763
1043         <rdar://problem/15311800>
1044
1045         Reviewed by Dan Bernstein.
1046
1047         * Configurations/WebKit.xcconfig:
1048         * Shared/API/Cocoa/WKBrowsingContextHandle.h:
1049         * Shared/API/Cocoa/WKFoundation.h:
1050         * Shared/API/Cocoa/_WKFrameHandle.h:
1051         * Shared/API/Cocoa/_WKRemoteObjectInterface.h:
1052         * Shared/API/Cocoa/_WKRemoteObjectRegistry.h:
1053         * UIProcess/API/Cocoa/WKBackForwardList.h:
1054         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
1055         * UIProcess/API/Cocoa/WKBackForwardListPrivate.h:
1056         * UIProcess/API/Cocoa/WKBrowsingContextController.h:
1057         * UIProcess/API/Cocoa/WKBrowsingContextGroup.h:
1058         * UIProcess/API/Cocoa/WKConnection.h:
1059         * UIProcess/API/Cocoa/WKFrameInfo.h:
1060         * UIProcess/API/Cocoa/WKNavigation.h:
1061         * UIProcess/API/Cocoa/WKNavigationAction.h:
1062         (NS_ENUM):
1063         * UIProcess/API/Cocoa/WKNavigationData.h:
1064         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
1065         (NS_ENUM):
1066         * UIProcess/API/Cocoa/WKNavigationResponse.h:
1067         * UIProcess/API/Cocoa/WKPreferences.h:
1068         * UIProcess/API/Cocoa/WKProcessGroup.h:
1069         * UIProcess/API/Cocoa/WKProcessPool.h:
1070         * UIProcess/API/Cocoa/WKScriptMessage.h:
1071         * UIProcess/API/Cocoa/WKScriptMessageHandler.h:
1072         * UIProcess/API/Cocoa/WKTypeRefWrapper.h:
1073         * UIProcess/API/Cocoa/WKUIDelegate.h:
1074         * UIProcess/API/Cocoa/WKUserContentController.h:
1075         * UIProcess/API/Cocoa/WKWebView.h:
1076         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1077         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1078         (NS_OPTIONS):
1079         (NS_ENUM):
1080         * UIProcess/API/Cocoa/WKWindowFeatures.h:
1081         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
1082         (NS_ENUM):
1083         * UIProcess/API/Cocoa/_WKDownload.h:
1084         * UIProcess/API/Cocoa/_WKElementAction.h:
1085         (NS_ENUM):
1086         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1087         * UIProcess/API/Cocoa/_WKScriptWorld.h:
1088         * UIProcess/API/Cocoa/_WKThumbnailView.h:
1089         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.h:
1090         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
1091         * WebKit2.xcodeproj/project.pbxproj:
1092         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
1093         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.h:
1094         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
1095         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h:
1096         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
1097         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
1098         * WebProcess/InjectedBundle/API/mac/WKDOMElement.h:
1099         * WebProcess/InjectedBundle/API/mac/WKDOMNode.h:
1100         * WebProcess/InjectedBundle/API/mac/WKDOMRange.h:
1101         * WebProcess/InjectedBundle/API/mac/WKDOMText.h:
1102         * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h:
1103         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
1104         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:
1105         * mac/rewrite-availability-macros.sh: Added.
1106
1107 2014-05-09  Joseph Pecoraro  <pecoraro@apple.com>
1108
1109         Web Inspector: Allow Remote Inspector to entitlement check UIProcess through WebProcess
1110         https://bugs.webkit.org/show_bug.cgi?id=132409
1111
1112         Reviewed by Timothy Hatcher.
1113
1114         * WebProcess/WebCoreSupport/WebInspectorClient.h:
1115         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
1116         (WebKit::WebInspectorClient::parentProcessIdentifier): Deleted.
1117         pid per debuggable is no longer needed.
1118
1119         * WebProcess/WebProcess.cpp:
1120         (WebKit::WebProcess::initializeWebProcess):
1121         Immediately pass the parent process pid and audit_token on
1122         to the RemoteInspector singleton when the process is created
1123         so that it can be sent to webinspectord.
1124
1125 2014-05-09  Enrica Casucci  <enrica@apple.com>
1126
1127         REGRESSION (WebKit2): Tapping in search field at wikipedia.org doesn’t bring up the keyboard.
1128         https://bugs.webkit.org/show_bug.cgi?id=132761
1129         <rdar://problem/16857491>
1130
1131         Reviewed by Benjamin Poulain.
1132
1133         The interactionAssistant accessor should never create an instance of
1134         UIWKTextInteractionAssistant, but simply return the value of _textInteractionAssistant.
1135         The text interaction assistant should only be created when needed so that the rest of
1136         the code could reliably check if we are interacting with text or not.
1137
1138         * UIProcess/ios/WKContentViewInteraction.mm:
1139         (-[WKContentView interactionAssistant]):
1140
1141 2014-05-09  Simon Fraser  <simon.fraser@apple.com>
1142
1143         Fix some issues with scrolling tree logging
1144         https://bugs.webkit.org/show_bug.cgi?id=132762
1145
1146         Reviewed by Tim Horton.
1147         
1148         Only dump viewport constraints when they change, and dump the primary layer on
1149         scrolling nodes.
1150         
1151         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1152         (WebKit::RemoteScrollingTreeTextStream::dump): Dump the primary layer.
1153
1154 2014-05-09  Simon Fraser  <simon.fraser@apple.com>
1155
1156         [iOS WK2] Fixed elements can go outside the document on pinching
1157         https://bugs.webkit.org/show_bug.cgi?id=132759
1158         <rdar://problem/16870835>
1159
1160         Reviewed by Benjamin Poulain.
1161         
1162         Constrain the rect used to position fixed position objects when pinching (when
1163         the scale goes below the minimumScale). Do so in such a way that there's a smooth
1164         transition between rubber-banding and pinching.
1165
1166         * UIProcess/API/Cocoa/WKWebView.mm:
1167         (-[WKWebView _updateScrollViewBackground]): Use a nicer form for std::max<>.
1168         (-[WKWebView _updateVisibleContentRects]): Pass the minimum scale.
1169         * UIProcess/API/ios/WKViewIOS.mm:
1170         (-[WKView _updateVisibleContentRects]): Ditto.
1171         * UIProcess/ios/WKContentView.h:
1172         * UIProcess/ios/WKContentView.mm:
1173         (adjustedUnexposedEdge): Helper to adjust the left/top.
1174         (adjustedUnexposedMaxEdge): Helper to adjust the right/bottom.
1175         (fixedPositionRectFromExposedRect):
1176         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:minimumScale:inStableState:]):
1177         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]): Deleted.
1178
1179 2014-05-09  Zalan Bujtas  <zalan@apple.com>
1180
1181         Subpixel rendering[iOS]: Top bar on apple.com/support jiggles when the swoosh animates.
1182         https://bugs.webkit.org/show_bug.cgi?id=132750
1183         <rdar://problem/16803281>
1184
1185         Reviewed by Simon Fraser.
1186
1187         This patch ensures that GraphicsLayer and RemoteLayerBackingStore have the same dimensions.
1188         
1189         Remove integral enclosing when we set the size on RemoteLayerBackingStore. It makes the layer's size
1190         different from the backingstore when the passed value is fractional.
1191         We scale and integral round this value to size the shareable bitmap later. Rounding ensures that
1192         the final size value matches what we calculated at GraphicsLayerCA::updateGeometry()
1193
1194         Currently not testable.
1195
1196         * Shared/mac/RemoteLayerBackingStore.h:
1197         (WebKit::RemoteLayerBackingStore::size):
1198         * Shared/mac/RemoteLayerBackingStore.mm:
1199         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
1200         (WebKit::RemoteLayerBackingStore::setNeedsDisplay): use enclosing here to ensure we cover the entire backing store.
1201         (WebKit::RemoteLayerBackingStore::display):
1202         (WebKit::RemoteLayerBackingStore::drawInContext):
1203         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1204         (WebKit::PlatformCALayerRemote::updateBackingStore):
1205
1206 2014-05-09  Benjamin Poulain  <bpoulain@apple.com>
1207
1208         [iOS][WK2] Set up the resize events
1209         https://bugs.webkit.org/show_bug.cgi?id=132726
1210
1211         Reviewed by Darin Adler and Simon Fraser.
1212
1213         Wire the UI Process updates to FrameView to send the resize events appropriately.
1214
1215         * Shared/VisibleContentRectUpdateInfo.cpp:
1216         (WebKit::VisibleContentRectUpdateInfo::encode):
1217         (WebKit::VisibleContentRectUpdateInfo::decode):
1218         * Shared/VisibleContentRectUpdateInfo.h:
1219         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
1220         (WebKit::VisibleContentRectUpdateInfo::isChangingObscuredInsetsInteractively):
1221         * UIProcess/API/Cocoa/WKWebView.mm:
1222         (-[WKWebView _updateVisibleContentRects]):
1223         * UIProcess/ios/WKContentView.h:
1224         * UIProcess/ios/WKContentView.mm:
1225         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:isChangingObscuredInsetsInteractively:]):
1226         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]): Deleted.
1227         Pass down the status of the content insets with the view update to main frame's FrameView
1228         when needed.
1229
1230         * WebProcess/WebPage/ios/WebPageIOS.mm:
1231         (WebKit::WebPage::dynamicViewportSizeUpdate):
1232         On live resize, send the resize event, then the scroll events (if needed).
1233
1234         Since JavaScript now gets two chances to change the content (resize event + scroll event),
1235         we query the actual scroll offset and scale for the DynamicViewportUpdateChangedTarget.
1236
1237         (WebKit::WebPage::viewportConfigurationChanged):
1238         Define the custom size on load before the app gets a chance to send different rects.
1239         If for some reason the app changes its mind about the insets, the content will be notified with a resize event.
1240
1241         (WebKit::WebPage::updateVisibleContentRects):
1242         Send the resize event when the insets are stable.
1243         Also move the scroll event after the resize event for consistency with live resize.
1244
1245 2014-05-09  Benjamin Poulain  <benjamin@webkit.org>
1246
1247         [iOS] Switch geolocation to an explicit authorization query model
1248         https://bugs.webkit.org/show_bug.cgi?id=132717
1249
1250         Reviewed by Sam Weinig.
1251
1252         Switch WKGeolocationProviderIOS to use the new API of WebGeolocationCoreLocationProvider.
1253
1254         On WebKit2, the whole logic to track requesters is in WebGeolocationManagerProxy.
1255
1256         Without the warmup sequence, WKGeolocationProviderIOS becomes really dumb: it just provides
1257         the two step authorization and forward the start/stop messages to the WebGeolocationCoreLocationProvider.
1258
1259         * UIProcess/ios/WKGeolocationProviderIOS.mm:
1260         (-[WKGeolocationProviderIOS _stopUpdating]):
1261         (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:request:window:]):
1262         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
1263         (-[WKGeolocationProviderIOS geolocationAuthorizationDenied]):
1264         (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]):
1265         (-[WKWebAllowDenyPolicyListener deny]):
1266         (-[WKGeolocationProviderIOS _stopUpdatingIfPossible]): Deleted.
1267         (-[WKGeolocationProviderIOS geolocationDelegateStarted]): Deleted.
1268         (-[WKGeolocationProviderIOS geolocationDelegateUnableToStart]): Deleted.
1269         (-[WKGeolocationProviderIOS permissionDenied:]): Deleted.
1270         (-[WKWebAllowDenyPolicyListener initWithProvider:permissionRequestProxy:]): Deleted.
1271
1272 2014-05-09  Gordon Sheridan  <gordon_sheridan@apple.com>
1273
1274         Expose functions necessary for copying favicon between IconDatabases.
1275         https://bugs.webkit.org/show_bug.cgi?id=132709
1276
1277         Reviewed by Brady Eidson.
1278
1279         * UIProcess/API/C/WKIconDatabase.cpp:
1280         (WKIconDatabaseSetIconURLForPageURL):
1281         Add C API wrapper for WebIconDatabase::setIconURLForPageURL().
1282
1283         (WKIconDatabaseCopyIconURLForPageURL):
1284         Add C API wrapper for WebIconDatabase::synchronousIconURLForPageURL().
1285
1286         * UIProcess/API/C/WKIconDatabase.h:
1287         Added declarations for wrapper functions above.
1288
1289 2014-05-09  Tim Horton  <timothy_horton@apple.com>
1290
1291         Fix the iOS DRT build by including CG headers in WKPreferences.h, which uses CGFloat.
1292
1293         * UIProcess/API/Cocoa/WKPreferences.h:
1294
1295 2014-05-09  Brent Fulgham  <bfulgham@apple.com>
1296
1297         {TelephoneNumber, Selection}ControllerMac implementations dosn't handle tiled drawing properly.
1298         https://bugs.webkit.org/show_bug.cgi?id=132746
1299         <rdar://problem/16789588>
1300
1301         Reviewed by Tim Horton.
1302
1303         Don't try to draw the detector UI if no part of the selection bounds are inside
1304         the current tile. Don't limit the detector UI to the bounds of this tile, or else
1305         it will attempt to squeeze itself into the possibly small space available. Let it
1306         draw as if it had the whole screen, and rely on the context clip region to
1307         avoid overdrawing.
1308
1309         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
1310         (WebKit::TelephoneNumberOverlayController::drawRect): Correct tiled drawing behavior.
1311         * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm:
1312         (WebKit::SelectionOverlayController::drawRect): Ditto.
1313
1314 2014-05-09  Anders Carlsson  <andersca@apple.com>
1315
1316         Production build fix.
1317
1318         Reviewed by Dan Bernstein.
1319
1320         * Configurations/BaseTarget.xcconfig:
1321         Add SDKROOT in front of UMBRELLA_FRAMEWORKS_DIR for OS X Production builds.
1322
1323 2014-05-09  Tim Horton  <timothy_horton@apple.com>
1324
1325         [iOS WebKit2] Flush RemoteLayerBackingStore contexts on a secondary queue
1326         https://bugs.webkit.org/show_bug.cgi?id=132667
1327         <rdar://problem/15349483>
1328
1329         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1330         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::create):
1331         Address a missed review comment about a missing std::move.
1332
1333 2014-05-09  Anders Carlsson  <andersca@apple.com>
1334
1335         Rename WebKit2.framework to WebKit.framework
1336         https://bugs.webkit.org/show_bug.cgi?id=132743
1337         <rdar://problem/15920046>
1338
1339         Reviewed by Dan Bernstein.
1340
1341         * Configurations/BaseLegacyProcess.xcconfig:
1342         Change INSTALL_PATH to WebKit.framework.
1343
1344         * Configurations/BaseTarget.xcconfig:
1345         Change WEBKIT2_FRAMEWORKS_DIR to WEBKIT_FRAMEWORKS_DIR and add WEBKIT_LEGACY_PRIVATE_HEADERS_DIR.
1346
1347         * Configurations/BaseXPCService.xcconfig:
1348         Change WebKit2.framework to WebKit.framework.
1349
1350         * Configurations/WebKit.xcconfig: Copied from Source/WebKit2/Configurations/WebKit2.xcconfig.
1351         New configuration file for WebKit.framework. Re-export WebKitLegacy.framework.
1352
1353         * Configurations/WebKit2.xcconfig:
1354         New configuration file for the WebKit2 shim framework. Re-export WebKit.framework.
1355
1356         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist:
1357         Update DYLD_INSERT_LIBRARIES to refer to WebKit.framework.
1358
1359         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
1360         Update DYLD_INSERT_LIBRARIES to refer to WebKit.framework.
1361         
1362         * Shared/API/Cocoa/WKBrowsingContextHandle.h:
1363         * Shared/API/Cocoa/WKRenderingProgressEvents.h:
1364         Update header imports.
1365
1366         * Shared/API/Cocoa/WebKit.h: Renamed from Source/WebKit/mac/WebKitLegacy/WebKit.h.
1367         New umbrella header. Imports the modern WebKit API as well as the legacy API.
1368
1369         * Shared/API/Cocoa/WebKit.m: Renamed from Source/WebKit/mac/WebKitLegacy/WebKit.m.
1370         Export install name symbols on iOS.
1371
1372         * Shared/API/Cocoa/WebKitPrivate.h: Renamed from Source/WebKit/mac/WebKitLegacy/WebKitPrivate.h.
1373         New umbrella SPI header. Imports the modern WebKit SPI.
1374
1375         * Many headers:
1376         Change WebKit2 includes to WebKit includes.
1377
1378         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
1379         (WebKit::XPCServiceEventHandler):
1380         Change bundle identifiers from com.apple.WebKit2 to com.apple.WebKit.
1381
1382         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
1383         (WebKit::XPCServiceEventHandler):
1384         Change bundle identifier from com.apple.WebKit2 to com.apple.WebKit.
1385         
1386         * UIProcess/API/Cocoa/WKPreferences.h:
1387         Stop including WKPreferencesRef.h, we have a WebKit2 header that handles this workaround for us now.
1388
1389         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1390         (WebKit::addDYLDEnvironmentAdditions):
1391         (WebKit::connectToService):
1392         (WebKit::createProcess):
1393         (WebKit::ProcessLauncher::launchProcess):
1394         Change bundle identifiers from com.apple.WebKit2 to com.apple.WebKit.
1395
1396         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1397         (WebKit::PluginProcessProxy::createPropertyListFile):
1398         Change bundle identifiers from com.apple.WebKit2 to com.apple.WebKit.
1399
1400         * UIProcess/mac/WebContextMac.mm:
1401         (WebKit::WebContext::platformDefaultDiskCacheDirectory):
1402         Change bundle identifier from com.apple.WebKit2 to com.apple.WebKit.
1403         
1404         * WebKit2.xcodeproj/project.pbxproj:
1405         Copy the python message scripts to the WebKit2 framework.
1406         Rename WebKit2.framework to WebKit.framework everywhere.
1407         Add a new WebKit2 target that builds the shim WebKit2 framework.
1408         Move the build script phase that migrates WebKitLegacy headers to WebKit.
1409         Add a new build script phase that adds forwarding headers from WebKit2 to WebKit.
1410
1411         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
1412         Update DYLD_INSERT_LIBRARIES to refer to WebKit.framework.
1413
1414         * mac/MigrateHeadersFromWebKitLegacy.make: Renamed from Source/WebKit/mac/WebKitLegacy/MigrateHeadersFromWebKitLegacy.make.
1415         Move the makefile that migrates WebKitLegacy headers here. On OS X, it copies the header contents and on iOS it creates forarding headers.
1416
1417         * mac/MigrateHeadersToWebKit2.make:
1418         New makefile that creates forwarding headers for the WebKit2 shim framework.
1419
1420         * mac/WKPreferences.h: Added.
1421         Add WebKit2/WKPreferences.h header that imports WebKit2/WKPreferencesref.h.
1422
1423         * mac/WebKit2.m:
1424         Skeleton for the WebKit2 shim framework.
1425
1426         * mac/Info-WebKit2.plist: Added.
1427         New Info.plist file for the WebKit2 shim framework.
1428
1429 2014-05-09  Martin Hodovan  <mhodovan.u-szeged@partner.samsung.com>
1430
1431         [WK2] Make generate-forwarding-headers.pl work after WebKit2.framework -> WebKit.framework rename
1432         https://bugs.webkit.org/show_bug.cgi?id=132733
1433
1434         Reviewed by Csaba Osztrogonác.
1435
1436         Rewrite framework's directory name to WebKit2 if the framework is WebKit (former WebKit2)
1437         and then collect headers inside the fixed framework directory and generate forwarding
1438         headers point to the fixed directory.
1439
1440         Leave WebKit2 in @frameworks list during the transition. It can be removed
1441         once <WebKit2/foo.h> style includes were renamed to <WebKit/foo.h> everywhere.
1442
1443         * Scripts/generate-forwarding-headers.pl:
1444         (collectFameworkHeaderPaths):
1445         (createForwardingHeadersForFramework):
1446
1447 2014-05-08  Alexey Proskuryakov  <ap@apple.com>
1448
1449         Automatically zip document bundles used via File API
1450         https://bugs.webkit.org/show_bug.cgi?id=132713
1451         <rdar://problem/13397892>
1452
1453         Reviewed by Anders Carlsson.
1454
1455         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: NetworkProcess
1456         now uses FileCoordination (WebProcess already had this allowed).
1457
1458         * Shared/BlobDataFileReferenceWithSandboxExtension.h: Added final to the class.
1459
1460 2014-05-08  Simon Fraser  <simon.fraser@apple.com>
1461
1462         [iOS WK2] Bottom-relative position:fixed elements are misplaced on page load
1463         https://bugs.webkit.org/show_bug.cgi?id=132719
1464         <rdar://problem/16860837>
1465
1466         Reviewed by Benjamin Poulain.
1467         
1468         If we haven't received visible rects from the web process, compute the
1469         fixed position rect, but only after scale has been set.
1470
1471         * WebProcess/WebPage/ios/WebPageIOS.mm:
1472         (WebKit::WebPage::viewportConfigurationChanged):
1473
1474 2014-05-08  Jer Noble  <jer.noble@apple.com>
1475
1476         [Mac, iOS] Add source application accounting to AVURLAsset.
1477         https://bugs.webkit.org/show_bug.cgi?id=132637
1478
1479         Reviewed by Eric Carlson.
1480
1481         Add accessor for sourceApplicationIdentifier.
1482
1483         * NetworkProcess/RemoteNetworkingContext.h:
1484         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1485         (WebKit::RemoteNetworkingContext::sourceApplicationIdentifier):
1486         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
1487         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1488         (WebKit::WebFrameNetworkingContext::sourceApplicationIdentifier):
1489
1490 2014-05-08  Tim Horton  <timothy_horton@apple.com>
1491
1492         [iOS WebKit2] Flush RemoteLayerBackingStore contexts on a secondary queue
1493         ​https://bugs.webkit.org/show_bug.cgi?id=132667
1494         <rdar://problem/16861454>
1495
1496         Rubber-stamped by Simon Fraser.
1497
1498         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1499         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1500         Add a null check to fix a crash on layers which lose backing store.
1501
1502 2014-05-08  Beth Dakin  <bdakin@apple.com>
1503
1504         REGRESSION (r168053): Phone number detection boxes are wrong when scrolled
1505         https://bugs.webkit.org/show_bug.cgi?id=132706
1506         -and corresponding-
1507         <rdar://problem/16787957>
1508
1509         Reviewed by Tim Horton.
1510
1511         We need to paint the boxes in Document coordinates. Range::boundingRect() was 
1512         giving us a point that took scroll position into account, and that’s not what we 
1513         want. Here we use Range::textQuads() instead so that we can get something in 
1514         Document coordinates, and then we need to convert that up to the main Document’s 
1515         coordinates.
1516         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
1517         (WebKit::textQuadsToBoundingRectForRange):
1518         (WebKit::TelephoneNumberOverlayController::drawRect):
1519
1520         The telephone click function wants a point in Window coordinates.
1521         (WebKit::TelephoneNumberOverlayController::mouseEvent):
1522
1523 2014-05-08  Tim Horton  <timothy_horton@apple.com>
1524
1525         [iOS WebKit2] Flush RemoteLayerBackingStore contexts on a secondary queue
1526         https://bugs.webkit.org/show_bug.cgi?id=132667
1527         <rdar://problem/15349483>
1528
1529         Reviewed by Darin Adler.
1530
1531         * Shared/mac/RemoteLayerBackingStore.h:
1532         * Shared/mac/RemoteLayerBackingStore.mm:
1533         (WebKit::RemoteLayerBackingStore::takeFrontContextPendingFlush):
1534         (WebKit::RemoteLayerBackingStore::flush): Deleted.
1535         Add takeFrontContextPendingFlush, which returns the painted-but-not-yet-flushed front context,
1536         and drops our reference to it. This needs to be called on all backing store between paints.
1537
1538         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1539         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::hasFlushed):
1540         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1541         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
1542         (WebKit::RemoteLayerTreeDrawingArea::~RemoteLayerTreeDrawingArea):
1543         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1544         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::create):
1545         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::BackingStoreFlusher):
1546         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush):
1547         (WebKit::flushBackingStoreChangesInTransaction): Deleted.
1548         Flush backing store and send the layer tree commit to the UI process from a dispatch queue.
1549         We will only ever have a single commit in flight at a time, and there's a new
1550         RELEASE_ASSERT to ensure that is the case.
1551         We package up the commit on the main thread; the queue calls CGContextFlush
1552         on all of the newly painted contexts and then tosses the commit over to the UI process.
1553         This is a win in many cases because the Web process main thread can go ahead
1554         and do other non-painting tasks while the queue is blocked on painting.
1555
1556 2014-05-08  Tim Horton  <timothy_horton@apple.com>
1557
1558         [wk2] Don't use the XPC-based plugin process for Adobe Reader
1559         https://bugs.webkit.org/show_bug.cgi?id=132701
1560         <rdar://problem/16792692>
1561
1562         Reviewed by Anders Carlsson.
1563
1564         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1565         (WebKit::shouldUseXPC):
1566         Rename the debugging default to a more modern and accurate name.
1567         Don't use XPC for Adobe Reader.
1568
1569         (WebKit::PluginProcessProxy::platformGetLaunchOptions):
1570         Move the check for plugins that need an executable heap into shouldUseXPC.
1571
1572 2014-05-08  Benjamin Poulain  <benjamin@webkit.org>
1573
1574         [iOS][WK2] Remove an incorrect assertion on asynchronous touch dispatch
1575         https://bugs.webkit.org/show_bug.cgi?id=132660
1576
1577         Reviewed by Enrica Casucci.
1578
1579         This assertion no longer make sense after r168393. Now the asynchronous behavior is maintained
1580         until the last finger leaves the screen.
1581
1582         * UIProcess/WebPageProxy.cpp:
1583         (WebKit::WebPageProxy::handleTouchEventAsynchronously):
1584
1585 2014-05-08  Alexey Proskuryakov  <ap@apple.com>
1586
1587         Make BlobDataFileReference manage its sandbox extension
1588         https://bugs.webkit.org/show_bug.cgi?id=132689
1589
1590         Reviewed by Anders Carlsson.
1591
1592         * CMakeLists.txt:
1593         * PlatformGTK.cmake:
1594         * WebKit2.xcodeproj/project.pbxproj:
1595         Added BlobDataFileReferenceWithSandboxExtension.
1596
1597         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1598         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
1599         (WebKit::NetworkBlobRegistry::registerBlobURL):
1600         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
1601         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
1602         (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
1603         (WebKit::NetworkBlobRegistry::filesInBlob):
1604         (WebKit::NetworkBlobRegistry::sandboxExtensions): Deleted.
1605         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
1606         We no longer track sandbox extensions here. Instead, provide a way to get files
1607         for a blob, which contain extensions and can allow access to themselves.
1608
1609         * NetworkProcess/NetworkResourceLoader.cpp:
1610         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
1611         (WebKit::NetworkResourceLoader::consumeSandboxExtensions):
1612         (WebKit::NetworkResourceLoader::invalidateSandboxExtensions):
1613         * NetworkProcess/NetworkResourceLoader.h:
1614         Allow/revoke access to files in blob, just like we do for explicitly passed extensions.
1615
1616         * Shared/BlobDataFileReferenceWithSandboxExtension.cpp: Added.
1617         (WebKit::BlobDataFileReferenceWithSandboxExtension::BlobDataFileReferenceWithSandboxExtension):
1618         (WebKit::BlobDataFileReferenceWithSandboxExtension::~BlobDataFileReferenceWithSandboxExtension):
1619         (WebKit::BlobDataFileReferenceWithSandboxExtension::prepareForFileAccess):
1620         (WebKit::BlobDataFileReferenceWithSandboxExtension::revokeFileAccess):
1621         * Shared/BlobDataFileReferenceWithSandboxExtension.h: Added.
1622         (WebKit::BlobDataFileReferenceWithSandboxExtension::create):
1623         A subclass of BlobDataFileReference that also contains a sandbox extension. NetworkProcess
1624         always uses it in BlobRegistryImpl.
1625
1626         * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerFileBlobURL):
1627         * WebProcess/FileAPI/BlobRegistryProxy.h:
1628         Updated for BlobRegistry interface changes. BlobRegistryProxy doesn't really need
1629         a BlobDataFileReference here, as it only uses a path, but it needs to implement the same interface
1630         as BlobRegistryImpl.
1631
1632 2014-05-08  Brady Eidson  <beidson@apple.com>
1633
1634         "shouldKeepCurrentBackForwardListItemInList" API should pass clientInfo to the callback
1635         <rdar://problem/16855357> and https://bugs.webkit.org/show_bug.cgi?id=132692
1636
1637         Reviewed by Tim Horton.
1638
1639         * UIProcess/API/C/WKPage.cpp:
1640         (WKPageSetPageLoaderClient):
1641         * UIProcess/API/C/WKPageLoaderClient.h:
1642
1643 2014-05-08  Antti Koivisto  <antti@apple.com>
1644
1645         [iOS WebKit2] Can't activate text fields on Facebook
1646         https://bugs.webkit.org/show_bug.cgi?id=132682
1647
1648         Reviewed by Enrica Casucci.
1649
1650         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
1651         (WebKit::WebChromeClient::observedContentChange):
1652         
1653             Implement content change observer callback.
1654
1655         * WebProcess/WebPage/WebPage.h:
1656         * WebProcess/WebPage/ios/WebPageIOS.mm:
1657         (WebKit::WebPage::handleSyntheticClick):
1658         
1659             If the event gets canceled by a potential change (a started short-duration timer)
1660             save the position and node so we can continue later.
1661
1662         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
1663         
1664             If it turns out the observed timer changed nothing continue the click event.
1665
1666         (WebKit::WebPage::completeSyntheticClick):
1667         
1668             Factored click event dispatch part of handleSyntheticClick here.
1669
1670 2014-05-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1671
1672         [CoordinatedGraphics][WK2] Scale factor and scroll position is not being restored properly in a back/forward load
1673         https://bugs.webkit.org/show_bug.cgi?id=126022
1674
1675         Reviewed by Benjamin Poulain.
1676
1677         Original author : Thiago de Barros Lacerda, and finished by Gyuyoung Kim.
1678
1679         When user is navigating back/forward to a page that has been scrolled and/or scaled, that page must be shown
1680         with its last scroll position and scale factor. However, when fixed layout was enabled with CoordinatedGraphics
1681         and TILED_BACKING_STORE, Page::setPageScaleFactor() doesn't send previous scroll position since r165652 and r165913.
1682
1683         This patch allows the Page::setPageScaleFactor() send stored position to WK2 implementation.
1684
1685         * UIProcess/CoordinatedGraphics/WebView.cpp:
1686         (WebKit::WebView::didCommitLoadForMainFrame):
1687
1688 2014-05-07  Simon Fraser  <simon.fraser@apple.com>
1689
1690         Put a better version of the assertion back, and add one when we ensureBackingStore.
1691
1692         Reviewed by Tim Horton.
1693
1694         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1695         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
1696         (WebKit::PlatformCALayerRemote::ensureBackingStore):
1697
1698 2014-05-07  Simon Fraser  <simon.fraser@apple.com>
1699
1700         This assertion was wrong and fired every time. Remove it.
1701
1702         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1703         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
1704
1705 2014-05-07  Enrica Casucci  <enrica@apple.com>
1706
1707         WK2: Programatic scroll requests during scroll or zoom animation to reveal focused element are ignored.
1708         https://bugs.webkit.org/show_bug.cgi?id=132657
1709         <rdar://problem/16468462>
1710
1711         Reviewed by Benjamin Poulain.
1712
1713         With the scrolling model we use on iOS, a programatic scroll
1714         request can be received while we are still animating to reveal
1715         the focused input element. Changing the scroll offset while animating
1716         leads to unpredictable results. We now cancel the animation if
1717         a programatic scroll request is received.
1718
1719         * UIProcess/API/Cocoa/WKWebView.mm:
1720         (-[WKWebView _scrollToContentOffset:WebCore::]):
1721         * WebProcess/WebPage/ios/WebPageIOS.mm:
1722         (WebKit::WebPage::getAssistedNodeInformation):
1723
1724 2014-05-07  Simon Fraser  <simon.fraser@apple.com>
1725
1726         [iOS WK2] Speculative fix for crash in PlatformCALayerRemote::recursiveBuildTransaction
1727         https://bugs.webkit.org/show_bug.cgi?id=132666
1728
1729         Reviewed by Tim Horton.
1730         
1731         Crash reports suggest that owner() can be null. Assert and protect
1732         against this.
1733
1734         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1735         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
1736
1737 2014-05-07  Dan Bernstein  <mitz@apple.com>
1738
1739         <rdar://problem/16831276> [iOS] Unparenting a WKWebView that’s loading pauses it
1740         https://bugs.webkit.org/show_bug.cgi?id=132659
1741
1742         Reviewed by Tim Horton.
1743
1744         * UIProcess/Cocoa/NavigationState.h: Added a member variable.
1745         * UIProcess/Cocoa/NavigationState.mm:
1746         (WebKit::NavigationState::didChangeIsLoading): When transitioning into loading state,
1747         acquire a background activity token. When transitioning out of loading state, dispose of
1748         the token.
1749
1750 2014-05-07  Jeremy Jones  <jeremyj@apple.com>
1751
1752         HTMLMediaElement should exitFullscreen when view is removed from the window.
1753         https://bugs.webkit.org/show_bug.cgi?id=132506
1754
1755         Reviewed by Tim Horton.
1756
1757         * UIProcess/WebPageProxy.cpp:
1758         (WebKit::WebPageProxy::viewStateDidChange):
1759         Request WebVideoFUllscreenManagerProxy to exitFullscreen when removed from the window.
1760         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
1761         Make requestExitFullscreen() public instead of private.
1762
1763 2014-05-07  Alexey Proskuryakov  <ap@apple.com>
1764
1765         Make blob size computation lazy
1766         https://bugs.webkit.org/show_bug.cgi?id=132653
1767
1768         Reviewed by Anders Carlsson.
1769
1770         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1771         (WebKit::NetworkBlobRegistry::registerBlobURL):
1772         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
1773         (WebKit::NetworkBlobRegistry::blobSize):
1774         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
1775         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1776         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
1777         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
1778         (WebKit::NetworkConnectionToWebProcess::blobSize):
1779         * NetworkProcess/NetworkConnectionToWebProcess.h:
1780         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1781         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
1782         (WebKit::BlobRegistryProxy::registerBlobURL):
1783         (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
1784         (WebKit::BlobRegistryProxy::blobSize):
1785         * WebProcess/FileAPI/BlobRegistryProxy.h:
1786
1787 2014-05-06  Simon Fraser  <simon.fraser@apple.com>
1788
1789         Add scrolling tree logging to RemoteLayerTree output
1790         https://bugs.webkit.org/show_bug.cgi?id=132640
1791
1792         Reviewed by Beth Dakin.
1793         
1794         Support scrolling tree logging in the RemoteLayerTree log channel
1795         output.
1796         
1797         Encode/decode ScrollingStateTree::hasChangedProperties() so we can use
1798         it to avoid logging. Log all the things.
1799
1800         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1801         (WebKit::RemoteScrollingCoordinatorTransaction::encode):
1802         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
1803         (WebKit::RemoteScrollingTreeTextStream::RemoteScrollingTreeTextStream):
1804         (WebKit::RemoteScrollingTreeTextStream::increaseIndent):
1805         (WebKit::RemoteScrollingTreeTextStream::decreaseIndent):
1806         (WebKit::RemoteScrollingTreeTextStream::writeIndent):
1807         (WebKit::dumpProperty):
1808         (WebKit::RemoteScrollingTreeTextStream::operator<<):
1809         (WebKit::RemoteScrollingTreeTextStream::dump):
1810         (WebKit::RemoteScrollingTreeTextStream::recursiveDumpNodes):
1811         (WebKit::RemoteScrollingCoordinatorTransaction::description):
1812         (WebKit::RemoteScrollingCoordinatorTransaction::dump):
1813         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.h:
1814         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1815         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1816
1817 2014-05-07  Hyowon Kim  <hw1008.kim@samsung.com>
1818
1819         GraphicsLayer::client() should return a reference.
1820         https://bugs.webkit.org/show_bug.cgi?id=126372
1821
1822         Reviewed by Simon Fraser.
1823
1824         GraphicsLayers always have a GraphicsLayerClient attached,
1825         so make client() a reference and remove some unnecessary branches.
1826         The author of the changes in the mac port is Andreas Kling <akling@apple.com>.
1827
1828         * WebProcess/WebPage/PageOverlayController.cpp:
1829         (WebKit::PageOverlayController::initialize):
1830         (WebKit::PageOverlayController::installPageOverlay):
1831         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
1832         (WebKit::LayerTreeHostGtk::initialize):
1833         (WebKit::LayerTreeHostGtk::createPageOverlayLayer):
1834         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
1835         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
1836         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
1837         (WebKit::RemoteLayerTreeContext::createGraphicsLayer):
1838         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1839         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1840         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
1841
1842 2014-05-07  Shivakumar JM  <shiva.jm@samsung.com>
1843
1844         Cleanup the build from unused parameter in UIProcess Module
1845         https://bugs.webkit.org/show_bug.cgi?id=131969
1846
1847         Reviewed by Csaba Osztrogonác.
1848
1849         Fixed unused parameter by omitting the parameter name
1850
1851         * UIProcess/API/C/WKPage.cpp:
1852         (WKPageSetPageFindClient):
1853         * UIProcess/WebFindClient.cpp:
1854         (WebKit::WebFindClient::didFindString):
1855
1856 2014-05-07  Manuel Rego Casasnovas  <rego@igalia.com>
1857
1858         [CSS Grid Layout] Remove runtime feature
1859         https://bugs.webkit.org/show_bug.cgi?id=132382
1860
1861         Reviewed by Benjamin Poulain.
1862
1863         Remove cssGridLayoutEnabled setting usage.
1864
1865         * Shared/WebPreferencesStore.h:
1866         * UIProcess/API/C/WKPreferences.cpp:
1867         (WKPreferencesSetCSSGridLayoutEnabled): Deleted.
1868         (WKPreferencesGetCSSGridLayoutEnabled): Deleted.
1869         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1870         * UIProcess/API/gtk/WebKitSettings.cpp:
1871         (webKitSettingsConstructed):
1872         * UIProcess/gtk/ExperimentalFeatures.cpp:
1873         * UIProcess/gtk/ExperimentalFeatures.h:
1874         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1875         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1876         * WebProcess/WebPage/WebPage.cpp:
1877         (WebKit::WebPage::updatePreferences):
1878         * mac/WebKit2.order:
1879
1880 2014-05-07  Csaba Osztrogonác  <ossy@webkit.org>
1881
1882         URTBF after r168393 to fix !IOS builds.
1883
1884         * Shared/WebEvent.h:
1885
1886 2014-05-06  Brady Eidson  <beidson@apple.com>
1887
1888         Followup to "Add WK2 SPI to prevent the previous back/forward item from remaining in the list"
1889         <rdar://problem/16248710> and https://bugs.webkit.org/show_bug.cgi?id=132636
1890
1891         Reviewed by NOBODY (My mistake while addressing previous review feedback)
1892
1893         * UIProcess/API/C/WKPage.cpp:
1894         (WKPageSetPageLoaderClient): During review feedback, this client switched from default negative to default
1895           positve, so when the client isn't implemented...  return true instead of false.
1896
1897         * UIProcess/WebBackForwardList.cpp:
1898         (WebKit::WebBackForwardList::addItem): Fix nonsensical comments while I'm at it.
1899
1900 2014-05-06  Brady Eidson  <beidson@apple.com>
1901
1902         Add WK2 SPI to prevent the previous back/forward item from remaining in the list
1903         <rdar://problem/16248710> and https://bugs.webkit.org/show_bug.cgi?id=132636
1904
1905         Reviewed by Sam Weinig.
1906
1907         Add new PageLoaderClient SPI to keep the current back/forward item from remaining in the list:
1908         * UIProcess/API/APILoaderClient.h:
1909         (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList):
1910         * UIProcess/API/C/WKPage.cpp:
1911         (WKPageSetPageLoaderClient):
1912         * UIProcess/API/C/WKPageLoaderClient.h:
1913         * UIProcess/WebPageProxy.cpp:
1914         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
1915         * UIProcess/WebPageProxy.h:
1916
1917         * UIProcess/WebBackForwardList.cpp:
1918         (WebKit::WebBackForwardList::addItem): Use that SPI to determine whether we should insert the new item after
1919         the previous item, or simply replace the previous item.
1920         (WebKit::WebBackForwardList::goToItem): Use that SPI to determine whether the previous item stays or goes.
1921
1922 2014-05-06  Dan Bernstein  <mitz@apple.com>
1923
1924         -[WKWebView isLoading] is NO immediately after -loadRequest: until the provisional load starts
1925         https://bugs.webkit.org/show_bug.cgi?id=132639
1926
1927         Reviewed by Darin Adler.
1928
1929         * UIProcess/PageLoadState.cpp:
1930         (WebKit::PageLoadState::commitChanges): Updated for change from isLoadingState to isLoading.
1931         (WebKit::PageLoadState::isLoading): Renamed from isLoadingState, changed to take Data and
1932         check whether there is a non-null pending API request URL. If so, return true.
1933         * UIProcess/PageLoadState.h:
1934
1935 2014-05-06  Dean Jackson  <dino@apple.com>
1936
1937         [Mac] Allow focus rings to redraw themselves if necessary
1938         https://bugs.webkit.org/show_bug.cgi?id=132593
1939
1940         Reviewed by Simon Fraser.
1941
1942         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1943         (InitWebCoreSystemInterface): Add DrawFocusRingAtTime and DrawCellFocusRingWithFrameAtTime.
1944
1945 2014-05-06  Benjamin Poulain  <benjamin@webkit.org>
1946
1947         <rdar://problem/16833442> [iOS WebKit2]: Keep the order of contentView in _scrollView after rotation
1948         https://bugs.webkit.org/show_bug.cgi?id=132634
1949
1950         Reviewed by Enrica Casucci.
1951
1952         Nice idea of Yongjun.
1953
1954         * UIProcess/API/Cocoa/WKWebView.mm:
1955         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1956         (-[WKWebView _endAnimatedResize]):
1957
1958 2014-05-06  Timothy Hatcher  <timothy@apple.com>
1959
1960         Take WKView's topContentInset into account when docking Web Inspector to the right.
1961
1962         https://bugs.webkit.org/show_bug.cgi?id=132631
1963
1964         Reviewed by Joseph Pecoraro.
1965
1966         * UIProcess/mac/WebInspectorProxyMac.mm:
1967         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange): Subtract topContentInset
1968         from the height of the frame for the Inspector.
1969
1970 2014-05-06  Benjamin Poulain  <bpoulain@apple.com>
1971
1972         [iOS][WK2] WebKit2 does not set CanPreventNativeGestures on the platform events
1973         https://bugs.webkit.org/show_bug.cgi?id=132594
1974
1975         Reviewed by Simon Fraser.
1976
1977         Set CanPreventNativeGestures on the plaform event.
1978         Change the tracking of WKContentView to be similar to WebPageProxy.
1979
1980         * Shared/WebEvent.h:
1981         (WebKit::WebTouchEvent::WebTouchEvent):
1982         (WebKit::WebTouchEvent::canPreventNativeGestures):
1983         (WebKit::WebTouchEvent::setCanPreventNativeGestures):
1984         * Shared/WebEventConversion.cpp:
1985         (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
1986         * Shared/ios/WebTouchEventIOS.cpp:
1987         (WebKit::WebTouchEvent::encode):
1988         (WebKit::WebTouchEvent::decode):
1989         * UIProcess/ios/WKContentViewInteraction.mm:
1990         (-[WKContentView _webTouchEventsRecognized:]):
1991
1992 2014-05-06  Benjamin Poulain  <bpoulain@apple.com>
1993
1994         [iOS][WK2] Add tap highlight on the simple UITapGestureRecognizer
1995         https://bugs.webkit.org/show_bug.cgi?id=132623
1996         <rdar://problem/16709507>
1997
1998         Reviewed by Enrica Casucci.
1999
2000         Add a low latency highlight for tap/click.
2001
2002         * UIProcess/PageClient.h:
2003         * UIProcess/WebPageProxy.h:
2004         * UIProcess/WebPageProxy.messages.in:
2005         * UIProcess/ios/PageClientImplIOS.h:
2006         * UIProcess/ios/PageClientImplIOS.mm:
2007         (WebKit::PageClientImpl::commitPotentialTapFailed):
2008         * UIProcess/ios/WKContentViewInteraction.h:
2009         * UIProcess/ios/WKContentViewInteraction.mm:
2010         (-[WKContentView setupInteraction]):
2011         (-[WKContentView _showTapHighlightWithColor:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]):
2012         (-[WKContentView _didGetTapHighlightForRequest:color:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]):
2013         (-[WKContentView _finishInteraction]):
2014         (-[WKContentView _highlightLongPressRecognized:]):
2015         (-[WKContentView _singleTapRecognized:]):
2016         (-[WKContentView _singleTapDidReset:]):
2017         (-[WKContentView _commitPotentialTapFailed]):
2018         (-[WKContentView _singleTapCommited:]):
2019         (-[WKContentView _attemptClickAtLocation:]):
2020         * UIProcess/ios/WKSyntheticClickTapGestureRecognizer.h: Added.
2021         * UIProcess/ios/WKSyntheticClickTapGestureRecognizer.m: Added.
2022         (-[WKSyntheticClickTapGestureRecognizer setGestureRecognizedTarget:action:]):
2023         (-[WKSyntheticClickTapGestureRecognizer setResetTarget:action:]):
2024         (-[WKSyntheticClickTapGestureRecognizer setState:]):
2025         (-[WKSyntheticClickTapGestureRecognizer reset]):
2026         * UIProcess/ios/WebPageProxyIOS.mm:
2027         (WebKit::WebPageProxy::potentialTapAtPosition):
2028         (WebKit::WebPageProxy::commitPotentialTap):
2029         (WebKit::WebPageProxy::cancelPotentialTap):
2030         (WebKit::WebPageProxy::tapHighlightAtPosition):
2031         (WebKit::WebPageProxy::commitPotentialTapFailed):
2032         * WebKit2.xcodeproj/project.pbxproj:
2033         * WebProcess/WebPage/WebPage.h:
2034         * WebProcess/WebPage/WebPage.messages.in:
2035         * WebProcess/WebPage/ios/WebPageIOS.mm:
2036         (WebKit::WebPage::handleSyntheticClick):
2037         (WebKit::WebPage::handleTap):
2038         (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
2039         (WebKit::WebPage::potentialTapAtPosition):
2040         (WebKit::WebPage::commitPotentialTap):
2041         (WebKit::WebPage::cancelPotentialTap):
2042         (WebKit::WebPage::tapHighlightAtPosition):
2043
2044 2014-05-06  Anders Carlsson  <andersca@apple.com>
2045
2046         Put WebArchive and WebArchiveResource in the API namespace.
2047
2048         Rubber-stamped by Dan Bernstein.
2049
2050         * Shared/API/c/WKSharedAPICast.h:
2051         * Shared/API/c/mac/WKWebArchive.cpp:
2052         (WKWebArchiveGetTypeID):
2053         (WKWebArchiveCreate):
2054         (WKWebArchiveCreateWithData):
2055         (WKWebArchiveCreateFromRange):
2056         (WKWebArchiveCopyMainResource):
2057         * Shared/API/c/mac/WKWebArchiveResource.cpp:
2058         (WKWebArchiveResourceGetTypeID):
2059         (WKWebArchiveResourceCreate):
2060         * Shared/APIWebArchive.cpp: Renamed from Source/WebKit2/Shared/WebArchive.cpp.
2061         (API::WebArchive::create):
2062         (API::WebArchive::WebArchive):
2063         (API::WebArchive::~WebArchive):
2064         (API::WebArchive::mainResource):
2065         (API::WebArchive::subresources):
2066         (API::WebArchive::subframeArchives):
2067         (API::releaseCFData):
2068         (API::WebArchive::data):
2069         (API::WebArchive::coreLegacyWebArchive):
2070         * Shared/APIWebArchive.h: Renamed from Source/WebKit2/Shared/WebArchive.h.
2071         * Shared/APIWebArchiveResource.cpp: Renamed from Source/WebKit2/Shared/WebArchiveResource.cpp.
2072         (API::WebArchiveResource::create):
2073         (API::WebArchiveResource::WebArchiveResource):
2074         (API::WebArchiveResource::~WebArchiveResource):
2075         (API::releaseCFData):
2076         (API::WebArchiveResource::data):
2077         (API::WebArchiveResource::URL):
2078         (API::WebArchiveResource::MIMEType):
2079         (API::WebArchiveResource::textEncoding):
2080         (API::WebArchiveResource::coreArchiveResource):
2081         * Shared/APIWebArchiveResource.h: Renamed from Source/WebKit2/Shared/WebArchiveResource.h.
2082         * WebKit2.xcodeproj/project.pbxproj:
2083
2084 2014-05-06  Alex Christensen  <achristensen@webkit.org>
2085
2086         Removed unnecessary notImplemented.h includes.
2087         https://bugs.webkit.org/show_bug.cgi?id=132587
2088
2089         Reviewed by Anders Carlsson.
2090
2091         * UIProcess/ios/WKContentViewInteraction.mm:
2092         * UIProcess/mac/WebContextMenuProxyMac.mm:
2093         * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp:
2094         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
2095         Removed notImplemented from list of includes.
2096
2097 2014-05-05  Jeremy Jones  <jeremyj@apple.com>
2098
2099         Implement scan backward and forward in video fullscreen.
2100         https://bugs.webkit.org/show_bug.cgi?id=132517
2101
2102         Reviewed by Simon Fraser.
2103
2104         Plumb through scanning/seeking functions.
2105
2106         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
2107         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2108         (WebKit::WebVideoFullscreenManagerProxy::fastSeek):
2109         (WebKit::WebVideoFullscreenManagerProxy::beginScanningForward):
2110         (WebKit::WebVideoFullscreenManagerProxy::beginScanningBackward):
2111         (WebKit::WebVideoFullscreenManagerProxy::endScanning):
2112         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
2113
2114 2014-05-05  Benjamin Poulain  <bpoulain@apple.com>
2115
2116         [iOS][WK2] Prefetch DNS hostnames on tap highlight
2117         https://bugs.webkit.org/show_bug.cgi?id=132509
2118
2119         Reviewed by Alexey Proskuryakov.
2120
2121         * WebProcess/WebPage/ios/WebPageIOS.mm:
2122         (WebKit::WebPage::tapHighlightAtPosition):
2123
2124 2014-05-05  Simon Fraser  <simon.fraser@apple.com>
2125
2126         [iOS WK2] Flickery scrolling inside overflow-scrolling: touch
2127         https://bugs.webkit.org/show_bug.cgi?id=132591
2128         <rdar://problem/16760466>
2129
2130         Reviewed by Tim Horton.
2131         
2132         Avoid triggering layer tree commits that touch the layer's boundsOrigin
2133         while the user is scrolling in the UI process.
2134         
2135         Fix the WKOverflowScrollViewDelegate to pass along an "inUserInteration"
2136         flag to the ScrollingTree to say that we're in the middle of a user interaction
2137         (and also to send a final non-interactive update). That gets passed along
2138         to the web process, and turned into "SyncScrollingLayerPosition" update.
2139         AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll() consults
2140         this, and uses it to set a flag on the ScrollableArea to say that the scroll
2141         is a user scroll.
2142         
2143         RenderLayerBacking then makes use of this (in existing code, shared with WK1)
2144         to avoid triggering layer bounds setting. Instead, it now just calls syncBoundsOrigin(),
2145         which updates the GraphicsLayer without touching platform layers. This is necessary
2146         so that GraphicsLayer geometry is up-to-date (used for tiled layer visibility
2147         computations).
2148         
2149         Finally, a hack in GraphicsLayerCA::computeVisibleRect() is conditionalized
2150         for WebKit1 by checking the type of platform layer.
2151
2152         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
2153         (WebKit::RemoteScrollingCoordinatorProxy::rootScrollingNodeID):
2154         (WebKit::RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion):
2155         (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
2156         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
2157         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
2158         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
2159         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
2160         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2161         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2162         (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]):
2163         (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
2164         (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]):
2165         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll):
2166         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
2167         * WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in:
2168         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
2169         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
2170
2171 2014-05-05  Alexey Proskuryakov  <ap@apple.com>
2172
2173         Stop using BlobData on client side
2174         https://bugs.webkit.org/show_bug.cgi?id=132582
2175
2176         Reviewed by Sam Weinig.
2177
2178         Update for WebCore changes.
2179
2180         * CMakeLists.txt:
2181         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2182         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
2183         (WebKit::NetworkBlobRegistry::registerBlobURL):
2184         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
2185         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2186         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
2187         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
2188         * NetworkProcess/NetworkConnectionToWebProcess.h:
2189         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2190         * Shared/FileAPI/BlobRegistrationData.cpp: Removed.
2191         * Shared/FileAPI/BlobRegistrationData.h: Removed.
2192         * Shared/WebCoreArgumentCoders.cpp:
2193         (IPC::ArgumentCoder<BlobPart>::encode):
2194         (IPC::ArgumentCoder<BlobPart>::decode):
2195         * Shared/WebCoreArgumentCoders.h:
2196         * WebKit2.xcodeproj/project.pbxproj:
2197         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
2198         (WebKit::BlobRegistryProxy::registerFileBlobURL):
2199         (WebKit::BlobRegistryProxy::registerBlobURL):
2200         * WebProcess/FileAPI/BlobRegistryProxy.h:
2201
2202 2014-05-05  Beth Dakin  <bdakin@apple.com>
2203
2204         Need a delegate that informs the UI process when the page's pin state changes
2205         https://bugs.webkit.org/show_bug.cgi?id=132583
2206         -and corresponding-
2207         <rdar://problem/16806231>
2208
2209         Reviewed by Anders Carlsson.
2210
2211         New UIClient function pinnedStateDidChange. 
2212
2213         * UIProcess/API/APIUIClient.h:
2214         (API::UIClient::pinnedStateDidChange):
2215
2216         Create WKPageUIClientV3 to add this function.
2217         * UIProcess/API/C/WKPage.cpp:
2218         (WKPageSetPageUIClient):
2219         * UIProcess/API/C/WKPageUIClient.h:
2220
2221         Change default initialization to true instead of false, which makes more sense for 
2222         this API.
2223         * UIProcess/WebPageProxy.cpp:
2224         (WebKit::WebPageProxy::WebPageProxy):
2225         (WebKit::WebPageProxy::didCommitLoadForFrame):
2226         (WebKit::WebPageProxy::resetState):
2227         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
2228         * WebProcess/WebPage/WebPage.cpp:
2229         (WebKit::WebPage::WebPage):
2230
2231 2014-05-05  Anders Carlsson  <andersca@apple.com>
2232
2233         Add SPI to provide the WebCrypto master key
2234         https://bugs.webkit.org/show_bug.cgi?id=132586
2235         <rdar://problem/16091460>
2236
2237         Reviewed by Dan Bernstein.
2238
2239         * UIProcess/API/APILoaderClient.h:
2240         (API::LoaderClient::webCryptoMasterKey):
2241         * UIProcess/API/C/WKPage.cpp:
2242         (WKPageSetPageLoaderClient):
2243         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2244         * UIProcess/Cocoa/NavigationState.h:
2245         * UIProcess/Cocoa/NavigationState.mm:
2246         (WebKit::NavigationState::setNavigationDelegate):
2247         (WebKit::NavigationState::LoaderClient::webCryptoMasterKey):
2248         * UIProcess/WebPageProxy.cpp:
2249         (WebKit::WebPageProxy::wrapCryptoKey):
2250
2251 2014-05-05  Gavin Barraclough  <baraclough@apple.com>
2252
2253         https://bugs.webkit.org/show_bug.cgi?id=132522
2254         Clean up ProcessThrottler
2255
2256         Unreviewed: bad build fix. Will work out what the right include is asap.
2257
2258         * UIProcess/ios/WebProcessProxyIOS.mm:
2259
2260 2014-05-05  Sam Weinig  <sam@webkit.org>
2261
2262         [Cocoa WebKit2] Add SPI to clear all visited links in a VisitedLinkProvider
2263         https://bugs.webkit.org/show_bug.cgi?id=132573
2264
2265         Reviewed by Dan Bernstein.
2266
2267         * Shared/VisitedLinkTable.cpp:
2268         (WebKit::VisitedLinkTable::VisitedLinkTable):
2269         (WebKit::VisitedLinkTable::clear):
2270         * Shared/VisitedLinkTable.h:
2271         Add functions to clear the visited link table.
2272
2273         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.h:
2274         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm:
2275         (-[_WKVisitedLinkProvider removeAll]):
2276         Add SPI.
2277
2278         * UIProcess/VisitedLinkProvider.cpp:
2279         (WebKit::VisitedLinkProvider::removeAll):
2280         * UIProcess/VisitedLinkProvider.h:
2281         A remove all resets the provider and notifies all the attached processes.
2282
2283         * WebProcess/WebPage/VisitedLinkTableController.cpp:
2284         (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
2285         * WebProcess/WebPage/VisitedLinkTableController.h:
2286         * WebProcess/WebPage/VisitedLinkTableController.messages.in:
2287         Add message to clear the visited links for a process.
2288
2289 2014-05-05  Benjamin Poulain  <benjamin@webkit.org>
2290
2291         [iOS][WK2] Special case ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture() for image documents
2292         https://bugs.webkit.org/show_bug.cgi?id=132553
2293
2294         Reviewed by Tim Horton.
2295
2296         When collecting the geometry for the smart magnification gesture, always return the image of an image document
2297         on iOS. On iOS, it does not make much sense to return the whole document rect when the gesture is not over the image.
2298
2299         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
2300         (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
2301
2302 2014-05-02  Gavin Barraclough  <baraclough@apple.com>
2303
2304         https://bugs.webkit.org/show_bug.cgi?id=132522
2305         Clean up ProcessThrottler
2306
2307         Reviewed by Geoffrey Garen.
2308
2309         The initial implementation of ProcessThrottler relied on the reply from the
2310         SetViewState message to ensure the page visibility notifications have a chance
2311         to be delivered. This resulted in:
2312             - unnecessarily complicated interface to ProcessThrottler (in VisibilityState class)
2313             - complexity bleeding out into WebPageProxy (handling 'hiding' state).
2314             - for cases other than view hiding, no suspension notification in the WebContent.
2315
2316         To fix these issues add an explicit handshake from the ProcessThrottler to the WebPage.
2317         This gives us two things:
2318             - All previously posted messages (e.g. SetViewState) will be processed before suspension.
2319             - WebContent is always (bar timeout) notified before suspension.
2320
2321         Since this interlock ensures the SetViewState message will be processed, the WKContentView no
2322         longer needs to request a reply from SetViewState, and WebPageProxy can lose all the 'hiding'
2323         state tracking. In turn, we can simplify VisibilityToken to a couple of simpler types, without
2324         the interface to change state - just acquire/release to keep the process runnable or permit
2325         suspension.
2326
2327         * UIProcess/API/Cocoa/WKWebView.mm:
2328         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2329             - VisibilityToken -> BackgroundActivityToken
2330         * UIProcess/WebPageProxy.cpp:
2331         (WebKit::WebPageProxy::WebPageProxy):
2332             - m_visibilityToken -> m_activityToken, remove m_pendingViewStateUpdates
2333               updateVisibilityToken -> updateActivityToken
2334         (WebKit::WebPageProxy::reattachToWebProcess):
2335             - updateVisibilityToken -> updateActivityToken
2336         (WebKit::WebPageProxy::viewStateDidChange):
2337             - remove m_pendingViewStateUpdates, updateActivityToken after sending SetViewState
2338         (WebKit::WebPageProxy::updateActivityToken):
2339             - m_visibilityToken -> m_activityToken, no need to handle 'hiding' state.
2340         (WebKit::WebPageProxy::updateVisibilityToken): Deleted.
2341             - renamed to updateActivityToken
2342         (WebKit::WebPageProxy::didUpdateViewState): Deleted.
2343             - implementation moved back into header.
2344         * UIProcess/WebPageProxy.h:
2345         (WebKit::WebPageProxy::didUpdateViewState):
2346             - implementation moved back into header.
2347         * UIProcess/WebProcessProxy.cpp:
2348         (WebKit::WebProcessProxy::WebProcessProxy):
2349             - ProcessThrottler constructor now passed WebProcessProxy.
2350         * UIProcess/WebProcessProxy.h:
2351             - added ProcessWillSuspend/ProcessReadyToSuspend
2352         * UIProcess/WebProcessProxy.messages.in:
2353             - added ProcessWillSuspend/ProcessReadyToSuspend
2354         * UIProcess/ios/ProcessAssertion.h:
2355         (WebKit::ProcessAssertion::state):
2356             - accessor
2357         * UIProcess/ios/ProcessThrottler.h:
2358         (WebKit::ProcessThrottler::VisibilityToken::visibility): Deleted.
2359         (WebKit::ProcessThrottler::VisibilityToken::setVisibility): Deleted.
2360             - removed VisibilityToken class, replaced with ForegroundActivityToken/BackgroundActivityToken.
2361         (WebKit::ProcessThrottler::ProcessThrottler): Deleted.
2362         (WebKit::ProcessThrottler::visibilityToken): Deleted.
2363         (WebKit::ProcessThrottler::didConnnectToProcess): Deleted.
2364         (WebKit::ProcessThrottler::assertionState): Deleted.
2365         (WebKit::ProcessThrottler::updateAssertion): Deleted.
2366             - moved implementations to .mm.
2367         * UIProcess/ios/ProcessThrottler.mm:
2368         (WebKit::ProcessThrottler::ForegroundActivityToken::ForegroundActivityToken):
2369         (WebKit::ProcessThrottler::ForegroundActivityToken::~ForegroundActivityToken):
2370         (WebKit::ProcessThrottler::BackgroundActivityToken::BackgroundActivityToken):
2371         (WebKit::ProcessThrottler::BackgroundActivityToken::~BackgroundActivityToken):
2372             - new, simpler replacement for VisibilityToken. Instantiate to keep a processes running, release to suspend.
2373         (WebKit::ProcessThrottler::ProcessThrottler):
2374             - constructor, now initializes WebProcessProxy pointer & timer mechanism
2375         (WebKit::ProcessThrottler::assertionState):
2376             - select the appropriate AssertionState give current ActivityTokens.
2377         (WebKit::ProcessThrottler::updateAssertionNow):
2378             - update the current ProcessAssertion.
2379         (WebKit::ProcessThrottler::updateAssertion):
2380             - update the current ProcessAssertion, delay running->suspended transitions to give the process a chance to clean up.
2381         (WebKit::ProcessThrottler::didConnnectToProcess):
2382             - moved from header.
2383         (WebKit::ProcessThrottler::suspendTimerFired):
2384             - timeout to prevent processes from running in the background for too long.
2385         (WebKit::ProcessThrottler::processReadyToSuspend):
2386             - handshake from the WebContent process to acknowledge it is ready to suspend.
2387         (WebKit::ProcessThrottler::VisibilityToken::VisibilityToken): Deleted.
2388         (WebKit::ProcessThrottler::VisibilityToken::~VisibilityToken): Deleted.
2389         (WebKit::ProcessThrottler::VisibilityToken::hideTimerFired): Deleted.
2390         (WebKit::ProcessThrottler::VisibilityToken::setVisibilityInternal): Deleted.
2391             - removed VisibilityToken class, replaced with ForegroundActivityToken/BackgroundActivityToken.
2392         * UIProcess/ios/WKContentView.mm:
2393         (-[WKContentView didMoveToWindow]):
2394             - no longer necessary to request a response from SetViewState; this interlock is now managed by the ProcessThrottler.
2395         * UIProcess/ios/WebProcessProxyIOS.mm:
2396         (WebKit::WebProcessProxy::sendProcessWillSuspend):
2397         (WebKit::WebProcessProxy::processReadyToSuspend):
2398             - added ProcessWillSuspend/ProcessReadyToSuspend
2399         * WebProcess/WebProcess.cpp:
2400         (WebKit::WebProcess::processWillSuspend):
2401             - notification from the WebContent process that we will be suspended; for now just send back an ack.
2402         * WebProcess/WebProcess.h:
2403             - added ProcessWillSuspend/ProcessReadyToSuspend
2404         * WebProcess/WebProcess.messages.in:
2405             - added ProcessWillSuspend/ProcessReadyToSuspend
2406
2407 2014-05-05  Jeremy Jones  <jeremyj@apple.com>
2408
2409         Implement beginScrubbing and endScrubbing for video fullscreen.
2410         https://bugs.webkit.org/show_bug.cgi?id=132520
2411
2412         Reviewed by Eric Carlson.
2413
2414         Plumb through beginScrubbing and endScrubbing.
2415
2416         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
2417         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2418         (WebKit::WebVideoFullscreenManagerProxy::beginScrubbing):
2419         (WebKit::WebVideoFullscreenManagerProxy::endScrubbing):
2420         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
2421
2422 2014-05-05  Tim Horton  <timothy_horton@apple.com>
2423
2424         Use a layer delegate instead of web_disableAllActions wherever possible
2425         https://bugs.webkit.org/show_bug.cgi?id=132560
2426         <rdar://problem/16459284>
2427
2428         Reviewed by Simon Fraser.
2429
2430         * UIProcess/API/mac/WKView.mm:
2431         (-[WKView _setAcceleratedCompositingModeRootLayer:]):
2432         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
2433         (WebKit::RemoteLayerTreeHost::createLayer):
2434         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2435         (WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator):
2436         * UIProcess/mac/RemoteLayerTreeHost.mm:
2437         (WebKit::RemoteLayerTreeHost::createLayer):
2438         * UIProcess/mac/ViewGestureControllerMac.mm:
2439         (WebKit::ViewGestureController::beginSwipeGesture):
2440         Make use of WebActionDisablingCALayerDelegate where possible.
2441         Also, UIKit disables actions for us, so don't bother doing anything on iOS.
2442
2443 2014-05-05  Martin Hock  <mhock@apple.com>
2444
2445         Session-aware plugin autostart data
2446         https://bugs.webkit.org/show_bug.cgi?id=131758
2447         <rdar://problem/15906540>
2448
2449         Reviewed by Alexey Proskuryakov.
2450
2451         * Shared/WebProcessCreationParameters.cpp:
2452         * Shared/WebProcessCreationParameters.h:
2453         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
2454         (WebKit::PlugInAutoStartProvider::PlugInAutoStartProvider):
2455         (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash):
2456         (WebKit::PlugInAutoStartProvider::autoStartOriginHashesCopy):
2457         (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy):
2458         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest):
2459         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsArray):
2460         (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction):
2461         * UIProcess/Plugins/PlugInAutoStartProvider.h:
2462         * UIProcess/WebContext.cpp:
2463         (WebKit::WebContext::addPlugInAutoStartOriginHash):
2464         (WebKit::WebContext::plugInDidReceiveUserInteraction):
2465         * UIProcess/WebContext.h:
2466         * UIProcess/WebContext.messages.in:
2467         * WebProcess/Plugins/PluginView.cpp:
2468         (WebKit::PluginView::pluginDidReceiveUserInteraction):
2469         * WebProcess/WebCoreSupport/WebPlugInClient.cpp:
2470         (WebKit::WebPlugInClient::didStartFromOrigin):
2471         * WebProcess/WebCoreSupport/WebPlugInClient.h:
2472         * WebProcess/WebProcess.cpp:
2473         (WebKit::WebProcess::WebProcess):
2474         (WebKit::WebProcess::isPlugInAutoStartOriginHash):
2475         (WebKit::WebProcess::shouldPlugInAutoStartFromOrigin):
2476         (WebKit::WebProcess::plugInDidStartFromOrigin):
2477         (WebKit::WebProcess::didAddPlugInAutoStartOriginHash):
2478         (WebKit::WebProcess::resetPlugInAutoStartOriginDefaultHashes):
2479         (WebKit::WebProcess::resetPlugInAutoStartOriginHashes):
2480         (WebKit::WebProcess::plugInDidReceiveUserInteraction):
2481         * WebProcess/WebProcess.h:
2482         * WebProcess/WebProcess.messages.in:
2483
2484 2014-05-05  Andy Estes  <aestes@apple.com>
2485
2486         Another iOS build fix after r168260.
2487
2488         Removed an unnecessary 'using namespace WebCore'.
2489
2490         * UIProcess/ios/WebMemoryPressureHandlerIOS.cpp:
2491
2492 2014-05-05  Tim Horton  <timothy_horton@apple.com>
2493
2494         Fix the iOS build.
2495
2496         * UIProcess/API/Cocoa/WKWebView.mm:
2497
2498 2014-05-05  Ryuan Choi  <ryuan.choi@samsung.com>
2499
2500         [EFL][WK2] Refactor favicon database APIs
2501         https://bugs.webkit.org/show_bug.cgi?id=132519
2502
2503         Reviewed by Gyuyoung Kim.
2504
2505         ewebkit2 has two options to get favicon.
2506
2507         The first option is ewk_view_favicon_get with "favicon,changed" signal.
2508         It's simple to use but it always adds the callback to EwkView although applications does not use favicon.
2509
2510         The other option is ewk_favicon_database_icon_get with ewk_favicon_database_icon_change_callback_add API.
2511         But the callback doesn't have information about Ewk_Favicon_Database to call ewk_favicon_database_icon_get.
2512
2513         This patch removed ewk_view_favicon_get and "favicon,changed" signal.
2514         In addition, improved ewk_favicon_database_icon_change_callback.
2515
2516         * UIProcess/API/efl/EwkView.cpp: Remove ewk_favicon_database related code.
2517         (EwkView::EwkView):
2518         (EwkView::~EwkView):
2519         (EwkView::informURLChange):
2520         (EwkView::handleFaviconChanged):
2521         (EwkView::createFavicon): Deleted.
2522         * UIProcess/API/efl/EwkViewCallbacks.h:
2523         * UIProcess/API/efl/ewk_favicon_database.cpp:
2524         (EwkFaviconDatabase::iconDataReadyForPageURL):
2525         (EwkFaviconDatabase::didChangeIconForPageURL): Deleted. dead code.
2526         * UIProcess/API/efl/ewk_favicon_database.h:
2527         Refactor Ewk_Favicon_Database_Icon_Change_Cb and improve doxygen.
2528         * UIProcess/API/efl/ewk_favicon_database_private.h:
2529         * UIProcess/API/efl/ewk_view.cpp:
2530         (ewk_view_favicon_get): Deleted.
2531         * UIProcess/API/efl/ewk_view.h:
2532         * UIProcess/API/efl/tests/test_ewk2_favicon_database.cpp:
2533         (EWK2FaviconDatabaseTest::requestFaviconData):
2534         (TEST_F):
2535
2536 2014-05-05  Tim Horton  <timothy_horton@apple.com>
2537
2538         [iOS WebKit2] Swipe snapshots should be taken asynchronously
2539         https://bugs.webkit.org/show_bug.cgi?id=132417
2540         <rdar://problem/16535921>
2541
2542         Reviewed by Anders Carlsson.
2543
2544         Reorganize takeViewSnapshot to return a ViewSnaphot with the image
2545         filled in (the other properties are filled in by ViewSnapshotStore).
2546
2547         Make ViewSnapshotStore use a fixed size instead of count for the snapshot cache.
2548         iOS doesn't use purgeable snapshots, so make the cache much smaller there.
2549
2550         Use CARenderServerCaptureLayerWithTransform to achieve async snapshotting.
2551
2552         Rename WebKit::ViewSnapshotStore::Snapshot to WebKit::ViewSnapshot so that
2553         it can be forward-declared in a bunch of places.
2554
2555         * UIProcess/API/Cocoa/WKWebView.mm:
2556         (-[WKWebView _takeViewSnapshot:]):
2557         Use CARenderServerCaptureLayerWithTransform.
2558
2559         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2560         * UIProcess/API/mac/WKView.mm:
2561         (createIOSurfaceFromImage):
2562         (-[WKView _takeViewSnapshot:]):
2563         Adjust to the new push model.
2564
2565         * UIProcess/API/mac/WKViewInternal.h:
2566         * UIProcess/PageClient.h:
2567         * UIProcess/WebPageProxy.cpp:
2568         (WebKit::WebPageProxy::takeViewSnapshot):
2569         * UIProcess/WebPageProxy.h:
2570         * UIProcess/ios/PageClientImplIOS.h:
2571         * UIProcess/ios/PageClientImplIOS.mm:
2572         (WebKit::PageClientImpl::takeViewSnapshot):
2573         * UIProcess/mac/PageClientImpl.h:
2574         * UIProcess/mac/PageClientImpl.mm:
2575         (WebKit::PageClientImpl::takeViewSnapshot):
2576         Plumbing.
2577
2578         * UIProcess/ios/ViewGestureControllerIOS.mm:
2579         (WebKit::ViewGestureController::beginSwipeGesture):
2580         (WebKit::ViewGestureController::endSwipeGesture):
2581         Realize an object that can be used as the layer contents from the slot ID.
2582
2583         * UIProcess/ios/WebMemoryPressureHandlerIOS.cpp:
2584         (WebKit::WebMemoryPressureHandler::sharedHandler):
2585         (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
2586         * UIProcess/WebMemoryPressureHandlerIOS.h:
2587         Add a memory pressure handler for the UI process. This does not use
2588         WebCore's platform independent memory pressure handler because that
2589         mechanism only allows for one handler per process, and we don't want to
2590         stomp on any handlers installed by WebKit1 in a process where the WebKits coexist.
2591
2592         * UIProcess/ios/WKContentView.h:
2593         * UIProcess/ios/WKContentView.mm:
2594         (-[WKContentView _takeViewSnapshot]): Deleted.
2595         Get rid of an unnecessary bounce through WKContentView.
2596
2597         * UIProcess/mac/ViewGestureControllerMac.mm:
2598         (WebKit::ViewGestureController::retrieveSnapshotForItem):
2599         (WebKit::ViewGestureController::endSwipeGesture):
2600         Use the new name, ViewSnapshot.
2601
2602         * UIProcess/mac/ViewSnapshotStore.h:
2603         (WebKit::ViewSnapshot::ViewSnapshot):
2604         * UIProcess/mac/ViewSnapshotStore.mm:
2605         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
2606         (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
2607         (WebKit::ViewSnapshotStore::snapshottingContext):
2608         Use a custom CAContext for snapshotting so that snapshots don't
2609         disappear when the main context is destroyed on hibernation.
2610
2611         (WebKit::ViewSnapshotStore::removeSnapshotImage):
2612         (WebKit::ViewSnapshotStore::pruneSnapshots):
2613         (WebKit::ViewSnapshotStore::recordSnapshot):
2614         (WebKit::ViewSnapshotStore::getSnapshot):
2615         (WebKit::ViewSnapshotStore::discardSnapshots):
2616         (WebKit::ViewSnapshot::clearImage):
2617         (WebKit::ViewSnapshot::hasImage):
2618         (WebKit::createIOSurfaceFromImage): Deleted.
2619         (WebKit::ViewSnapshotStore::Snapshot::clearImage): Deleted.
2620         (WebKit::ViewSnapshotStore::Snapshot::hasImage): Deleted.
2621         Cache by image size instead of counts.
2622
2623         * WebKit2.xcodeproj/project.pbxproj:
2624
2625 2014-05-04  Pratik Solanki  <psolanki@apple.com>
2626
2627         Reduce calls to CFURLCacheCopySharedURLCache
2628         https://bugs.webkit.org/show_bug.cgi?id=132464
2629         <rdar://problem/16806694>
2630
2631         Address review comments by collapsing multi-line code into a single ASSERT.
2632
2633         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
2634         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer):
2635
2636 2014-05-04  Pratik Solanki  <psolanki@apple.com>
2637
2638         Shortcircuit shouldUseCredentialStorage callback
2639         https://bugs.webkit.org/show_bug.cgi?id=132308
2640         <rdar://problem/16806708>
2641
2642         Reviewed by Alexey Proskuryakov.
2643
2644         If we are going to return true from the shouldUseCredentialStorage callback then we don't
2645         really need to have CFNetwork/Foundation call us. We can just disable the callback and
2646         CFNetwork will assume true. Add a separate subclass that implements this callback when we
2647         need to return false. We can also eliminate the corresponding async callbacks. This avoids
2648         pingponging between dispatch queue and main thread in the common case.
2649
2650         No new tests because no change in functionality.
2651
2652         * NetworkProcess/NetworkResourceLoader.cpp: Remove shouldUseCredentialStorageAsync() callbacks.
2653         * NetworkProcess/NetworkResourceLoader.h:
2654
2655 2014-05-04  Beth Dakin  <bdakin@apple.com>
2656
2657         Top content inset: Margin tiles should not display in the inset area when pinned 
2658         to the top of the page
2659         https://bugs.webkit.org/show_bug.cgi?id=132535
2660         -and corresponding-
2661         <rdar://problem/16613039>
2662
2663         Reviewed by Simon Fraser.
2664
2665         Encode and decode the ScrollingStateScrollingNode’s m_topContentInset even though 
2666         we don’t use it for anything yet. Since the headerLayer and footerLayer are not 
2667         encoded or decoded yet, I did not encode/decode the insetClipLayer yet, which, 
2668         like the header and footer layers, would not yet be used. 
2669         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
2670         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
2671         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
2672
2673 2014-05-03  Commit Queue  <commit-queue@webkit.org>
2674
2675         Unreviewed, rolling out r168232.
2676         https://bugs.webkit.org/show_bug.cgi?id=132543
2677
2678         broke ~15 tests on WK2 debug (Requested by kling on #webkit).
2679
2680         Reverted changeset:
2681
2682         "Shortcircuit shouldUseCredentialStorage callback"
2683         https://bugs.webkit.org/show_bug.cgi?id=132308
2684         http://trac.webkit.org/changeset/168232
2685
2686 2014-05-03  Tim Horton  <timothy_horton@apple.com>
2687
2688         [iOS] REGRESSION (WebKit2): Page isn't clipped properly during back/forward swipe
2689         https://bugs.webkit.org/show_bug.cgi?id=132538
2690         <rdar://problem/16266027>
2691
2692         Reviewed by Simon Fraser.
2693
2694         * UIProcess/ios/ViewGestureControllerIOS.mm:
2695         (WebKit::ViewGestureController::beginSwipeGesture):
2696         (WebKit::ViewGestureController::endSwipeGesture):
2697         * UIProcess/mac/ViewGestureController.h:
2698         Add a clipping layer above the live swipe layer, which explicitly clips to bounds.
2699
2700 2014-05-02  Pratik Solanki  <psolanki@apple.com>
2701
2702         Shortcircuit shouldUseCredentialStorage callback
2703         https://bugs.webkit.org/show_bug.cgi?id=132308
2704         <rdar://problem/16806708>
2705
2706         Reviewed by Alexey Proskuryakov.
2707
2708         If we are going to return true from the shouldUseCredentialStorage callback then we don't
2709         really need to have CFNetwork/Foundation call us. We can just disable the callback and
2710         CFNetwork will assume true. Add a separate subclass that implements this callback when we
2711         need to return false. We can also eliminate the corresponding async callbacks. This avoids
2712         pingponging between dispatch queue and main thread in the common case.
2713
2714         No new tests because no change in functionality.
2715
2716         * NetworkProcess/NetworkResourceLoader.cpp: Remove shouldUseCredentialStorageAsync() callbacks.
2717         * NetworkProcess/NetworkResourceLoader.h:
2718
2719 2014-05-02  Pratik Solanki  <psolanki@apple.com>
2720
2721         Reduce calls to CFURLCacheCopySharedURLCache
2722         https://bugs.webkit.org/show_bug.cgi?id=132464
2723         <rdar://problem/16806694>
2724
2725         Reviewed by Alexey Proskuryakov.
2726
2727         CFURLCacheCopySharedURLCache grabs a mutex and can sometimes block. Avoid that by stashing
2728         the cache reference in a static.
2729
2730         * NetworkProcess/NetworkResourceLoader.h: Coalesce ifdef'd code.
2731         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
2732         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer):
2733         (WebKit::NetworkResourceLoader::willCacheResponseAsync): Use more correct ifdef for
2734         Foundation based callback.
2735
2736 2014-05-03  Sam Weinig  <sam@webkit.org>
2737
2738         [Cocoa WebKit2] Add basic _WKWebsiteDataStore implementation
2739         https://bugs.webkit.org/show_bug.cgi?id=132526
2740
2741         Reviewed by Anders Carlsson.
2742
2743         - Renames WKSession to _WKWebsiteDataStore to better reflect its intended use (renaming
2744           the implementation object will come later).
2745         - Makes _WKWebsiteDataStore work as a wrapped Objective-C object.
2746         - Adds the ability to set a _WKWebsiteDataStore on the WKWebViewConfiguration.
2747
2748         * Shared/Cocoa/APIObject.mm:
2749         (API::Object::newObject):
2750         * UIProcess/API/Cocoa/WKSession.h:
2751         * UIProcess/API/Cocoa/WKSession.mm:
2752         (-[WKSession dealloc]): Deleted.
2753         (-[WKSession ephemeral]): Deleted.
2754         (-[WKSession API::]): Deleted.
2755         * UIProcess/API/Cocoa/WKSessionInternal.h:
2756         (WebKit::wrapper): Deleted.
2757         * UIProcess/API/Cocoa/WKWebView.mm:
2758         (-[WKWebView initWithFrame:configuration:]):
2759         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2760         (-[WKWebViewConfiguration copyWithZone:]):
2761         (-[WKWebViewConfiguration _websiteDataStore]):
2762         (-[WKWebViewConfiguration _setWebsiteDataStore:]):
2763         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2764         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKSession.h.
2765         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKSession.mm.
2766         (+[_WKWebsiteDataStore nonPersistentDataStore]):
2767         (-[_WKWebsiteDataStore isNonPersistentDataStore]):
2768         (-[WKSession ephemeral]): Deleted.
2769         * UIProcess/API/Cocoa/_WKWebsiteDataStoreInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKSessionInternal.h.
2770         * WebKit2.xcodeproj/project.pbxproj:
2771
2772 2014-05-03  Simon Fraser  <simon.fraser@apple.com>
2773
2774         [UI-side compositing] Assertion in PlatformCAFilters::setFiltersOnLayer with animated reference filter
2775         https://bugs.webkit.org/show_bug.cgi?id=132528
2776         <rdar://problem/16671660>
2777
2778         Reviewed by Tim Horton.
2779         
2780         Allow PASSTHROUGH filters to be encoded and sent to the UI process; they can be set
2781         on layers as the result of a filter animation using a reference filter, and just get
2782         ignored anyway, but encoding them maintains consistency of the filters list.
2783
2784         * Shared/WebCoreArgumentCoders.cpp:
2785         (IPC::ArgumentCoder<FilterOperation>::encode): Assert during encoding if
2786         we try to encode a NONE or REFERENCE filter (to match the decoding assertions).
2787         (IPC::decodeFilterOperation): Allow decoding of PASSTHROUGH filters. Have
2788         trying to decode a NONE or REFERENCE filter mark the message as invalid.
2789         (IPC::ArgumentCoder<IDBKeyData>::decode): Mark the message invalid when receiving
2790         unexpected key types.
2791         * Shared/mac/RemoteLayerTreeTransaction.mm:
2792         (WebKit::RemoteLayerTreeTextStream::operator<<): Have the logging not crash if
2793         a filter is null (should never happen).
2794
2795 2014-05-02  Dan Bernstein  <mitz@apple.com>
2796
2797         [Cocoa] Remove unused WKErrorRecoveryAttempting
2798         https://bugs.webkit.org/show_bug.cgi?id=132503
2799
2800         Reviewed by Anders Carlsson.
2801
2802         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2803         (didFailProvisionalLoadWithErrorForFrame):
2804         (didFailLoadWithErrorForFrame):
2805         (createErrorWithRecoveryAttempter): Deleted.
2806         (-[WKBrowsingContextController attemptRecoveryFromError:]): Deleted.
2807         * UIProcess/API/Cocoa/WKErrorRecoveryAttempting.m: Removed.
2808         * UIProcess/API/Cocoa/_WKFormDelegate.h:
2809         * WebKit2.xcodeproj/project.pbxproj:
2810
2811 2014-05-02  Enrica Casucci  <enrica@apple.com>
2812
2813         REGRESSION (WebKit2) Need to support reanalyze button for Chinese Traditional.
2814         https://bugs.webkit.org/show_bug.cgi?id=132504
2815         <rdar://problem/16778862>
2816
2817         Reviewed by Benjamin Poulain.
2818
2819         For traditional Chinese we support reanalyzing of the text to perform
2820         transformations on the text based on the selected language and keyboard.
2821         This is done by pressing the Reanalyze button on the system
2822         menu. This patch adds the necessary code to canPerformAction to enable
2823         the button when appropriate as well as the implementation of the action
2824         itself.
2825
2826         * UIProcess/ios/WKContentViewInteraction.mm:
2827         (-[WKContentView _reanalyze:]):
2828         (-[WKContentView canPerformAction:withSender:]):
2829
2830 2014-05-02  Enrica Casucci  <enrica@apple.com>
2831
2832         REGRESSION (WebKit2) Need to support transliterate chinese button (简⇄繁) for Traditional Chinese.
2833         https://bugs.webkit.org/show_bug.cgi?id=132500
2834         <rdar://problem/16778870>
2835
2836         Reviewed by Benjamin Poulain.
2837
2838         For traditional Chinese we support the transliterate to simplified Chinese.
2839         This is done by pressing the 简⇄繁 button on the system
2840         menu. This patch adds the necessary code to canPerformAction to enable
2841         the button when appropriate as well as the implementation of the action
2842         itself.
2843
2844         * UIProcess/ios/WKContentViewInteraction.mm:
2845         (-[WKContentView _transliterateChinese:]):
2846         (-[WKContentView canPerformAction:withSender:]):
2847
2848 2014-05-02  Jeremy Jones  <jeremyj@apple.com>
2849
2850         Fullscreen UI does not appear after WebProcess has crashed
2851         https://bugs.webkit.org/show_bug.cgi?id=132442
2852
2853         Reviewed by Darin Adler.
2854
2855         Cleanup WebVideoFullscreenManagerProxy after a WebProcess crash.
2856
2857         * UIProcess/WebPageProxy.cpp:
2858         (WebKit::WebPageProxy::reattachToWebProcess):
2859         recreate WebVideoFullscreenManagerProxy after a WebProcess crash.
2860
2861         (WebKit::WebPageProxy::resetState):
2862         invalidate and release WebVideoFullscreenManagerProxy on crash.
2863
2864         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
2865         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2866         (WebKit::WebVideoFullscreenManagerProxy::~WebVideoFullscreenManagerProxy):
2867         don't assume m_page is valid.
2868
2869         (WebKit::WebVideoFullscreenManagerProxy::invalidate):
2870         do cleanup invalidation in reponse to a WebProcess crash.
2871
2872 2014-05-02  Benjamin Poulain  <bpoulain@apple.com>
2873
2874         [iOS][WK2] More animation madness for when the extendedBackground is modified in an animation block
2875         https://bugs.webkit.org/show_bug.cgi?id=132497
2876
2877         Reviewed by Beth Dakin.
2878
2879         * UIProcess/API/Cocoa/WKWebView.mm:
2880         (updateTopAndBottomExtendedBackgroundExclusionIfNecessary):
2881         Do not early return when _extendedBackgroundExclusionInsets.left is empty. That way, if executed in an animation block,
2882         the top of bottom view will animate from their current size to an empty width.
2883
2884         When creating the layer, set up their height without animation. Otherwise it is possible to see the height animating
2885         while the left inset is animating.
2886
2887         (-[WKWebView _setExtendedBackgroundExclusionInsets:]):
2888         When replacing the scrollview, make sure the frame and color are not animated. Otherwise the transition between
2889         scrollView and _mainExtendedBackgroundView can be visible if _setExtendedBackgroundExclusionInsets: is invoked
2890         in an animation block.
2891
2892         (-[WKWebView _endAnimatedResize]):
2893         Nuke the top and bottom insets when possible. [WKWebView _endAnimatedResize] is unfrequent, so it is a good opportunity
2894         to free the memory.
2895
2896 2014-05-02  Alexey Proskuryakov  <ap@apple.com>
2897
2898         Remove Blob contentDisposition handling
2899         https://bugs.webkit.org/show_bug.cgi?id=132490
2900
2901         Reviewed by Sam Weinig.
2902
2903         * Shared/FileAPI/BlobRegistrationData.cpp:
2904         (WebKit::BlobRegistrationData::encode):
2905         (WebKit::BlobRegistrationData::decode):
2906
2907 2014-05-02  Benjamin Poulain  <benjamin@webkit.org>
2908
2909         [iOS][WK2] Adapt the rubberband constraints when the page get smaller than the scrollview - insets
2910         https://bugs.webkit.org/show_bug.cgi?id=132457
2911
2912         Reviewed by Enrica Casucci.
2913
2914         It is quite common for us to have a WKContentView that is scalled smaller than the WKWebView, content
2915         insets included.
2916
2917         In those cases, update the constraints to fit the content properly in the view.
2918
2919         * UIProcess/ios/WKScrollView.mm:
2920         (valuesAreWithinOnePixel):
2921         (-[WKScrollView _rubberBandOffsetForOffset:maxOffset:minOffset:range:outside:]):
2922
2923 2014-05-02  Mark Rowe  <mrowe@apple.com>
2924
2925         -[_WKThumbnailView _requestSnapshotIfNeeded] assumes that taking a snapshot will always succeed
2926         <https://webkit.org/b/132489> / <rdar://problem/16704660>
2927
2928         Reviewed by Tim Horton.
2929
2930         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
2931         (-[_WKThumbnailView _requestSnapshotIfNeeded]): Don't attempt to create a CGImageRef if we failed
2932         to create a ShareableBitmap. This handles both the callback receiving a null Handle and a failure
2933         within ShareableBitmap::create.
2934
2935 2014-05-02  Anders Carlsson  <andersca@apple.com>
2936
2937         Clean up FormDataElement
2938         https://bugs.webkit.org/show_bug.cgi?id=132483
2939
2940         Reviewed by Sam Weinig.
2941
2942         * NetworkProcess/NetworkResourceLoader.cpp:
2943         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
2944         * Shared/Network/NetworkResourceLoadParameters.cpp:
2945         (WebKit::NetworkResourceLoadParameters::encode):
2946
2947 2014-05-02  Anders Carlsson  <andersca@apple.com>
2948
2949         Add and implement KeyedDecoder::decodeBytes
2950         https://bugs.webkit.org/show_bug.cgi?id=132479
2951
2952         Reviewed by Tim Horton.
2953
2954         * Shared/cf/KeyedDecoder.cpp:
2955         (WebKit::KeyedDecoder::decodeBytes):
2956         * Shared/cf/KeyedDecoder.h:
2957
2958 2014-05-02  Joseph Pecoraro  <pecoraro@apple.com>
2959
2960         [iOS] WebKit2 File Upload Support
2961         https://bugs.webkit.org/show_bug.cgi?id=132024
2962
2963         Reviewed by Enrica Casucci.
2964
2965         * Configurations/WebKit2.xcconfig:
2966         Include MobileCoreServices on iOS for kUTTypeImage/kUTTypeMovie.
2967
2968         * WebKit2.xcodeproj/project.pbxproj:
2969         Add new files.
2970
2971         * UIProcess/WebOpenPanelResultListenerProxy.h:
2972         * UIProcess/WebOpenPanelResultListenerProxy.cpp:
2973         (WebKit::filePathsFromFileURLs):
2974         (WebKit::WebOpenPanelResultListenerProxy::chooseFiles):
2975         * UIProcess/WebPageProxy.h:
2976         * UIProcess/WebPageProxy.cpp:
2977         (WebKit::WebPageProxy::runOpenPanel):
2978         (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
2979         * WebProcess/WebPage/WebOpenPanelResultListener.h:
2980         * WebProcess/WebPage/WebOpenPanelResultListener.cpp:
2981         (WebKit::WebOpenPanelResultListener::didChooseFilesWithDisplayStringAndIcon):
2982         * WebProcess/WebPage/WebPage.h:
2983         * WebProcess/WebPage/WebPage.messages.in:
2984         * WebProcess/WebPage/WebPage.cpp:
2985         (WebKit::WebPage::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
2986         Message forwarding for choosing files and providing a display string and icon,
2987         leading down to the existing WebCore FileChooser method.
2988
2989         * UIProcess/PageClient.h:
2990         * UIProcess/ios/PageClientImplIOS.h:
2991         * UIProcess/ios/PageClientImplIOS.mm:
2992         (WebKit::PageClientImpl::handleRunOpenPanel):
2993         Add a default handler for file open panel on iOS.
2994         Forwards to the content view.
2995
2996         * UIProcess/ios/WKContentViewInteraction.h:
2997         * UIProcess/ios/WKContentViewInteraction.mm:
2998         (-[WKContentView lastInteractionLocation]):
2999         (-[WKContentView _webTouchEventsRecognized:]):
3000         (-[WKContentView _highlightLongPressRecognized:]):
3001         (-[WKContentView _longPressRecognized:]):
3002         (-[WKContentView _singleTapRecognized:]):
3003         (-[WKContentView _doubleTapRecognized:]):
3004         (-[WKContentView _twoFingerDoubleTapRecognized:]):
3005         Keep track of the last interaction location. This matches previous behavior
3006         of showing the file upload popover where the user tapped, to handle
3007         cases where the <input> is hidden.
3008
3009         (-[WKContentView _showRunOpenPanel:resultListener:]):
3010         (-[WKContentView fileUploadPanelDidDismiss:]):
3011         Handle showing the cleaning up after the file upload panel.
3012
3013         * UIProcess/ios/forms/WKFileUploadPanel.h:
3014         * UIProcess/ios/forms/WKFileUploadPanel.mm: Added.
3015         (squareCropRectForSize):
3016         (squareImage):
3017         (thumbnailSizedImageForImage):
3018         (-[_WKFileUploadItem isVideo]):
3019         (-[_WKFileUploadItem fileURL]):
3020         (-[_WKFileUploadItem displayImage]):
3021         (-[_WKImageFileUploadItem initWithFilePath:originalImage:]):
3022         (-[_WKImageFileUploadItem isVideo]):
3023         (-[_WKImageFileUploadItem fileURL]):
3024         (-[_WKImageFileUploadItem displayImage]):
3025         (-[_WKVideoFileUploadItem initWithFilePath:mediaURL:]):
3026         (-[_WKVideoFileUploadItem isVideo]):
3027         (-[_WKVideoFileUploadItem fileURL]):
3028         (-[_WKVideoFileUploadItem displayImage]):
3029         Helper class for each image picker selection. Knows how to get
3030         a file URL and thumbnail display image for the item.
3031
3032         (-[WKFileUploadPanel initWithView:]):
3033         (-[WKFileUploadPanel dealloc]):
3034         (-[WKFileUploadPanel _dispatchDidDismiss]):
3035         (-[WKFileUploadPanel _cancel]):
3036         (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]):
3037         Lifetime of the upload panel requires that either cancel or choose
3038         must happen as we go through the file picking process.
3039
3040         (-[WKFileUploadPanel presentWithParameters:WebKit::resultListener:WebKit::]):
3041         (-[WKFileUploadPanel dismiss]):
3042         API to show or dismiss the panel.
3043
3044         (-[WKFileUploadPanel _dismissDisplayAnimated:]):
3045         Helper to clean up the UI as it progresses or completes no matter the device idiom.
3046
3047         (-[WKFileUploadPanel _presentPopoverWithContentViewController:animated:]):
3048         (-[WKFileUploadPanel _presentFullscreenViewController:animated:]):
3049         UI presentation for the appropriate idiom.
3050
3051         (-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
3052         (-[WKFileUploadPanel _showMediaSourceSelectionSheet]):
3053         (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
3054         Showing the action sheet or image picker.
3055
3056         (-[WKFileUploadPanel popoverControllerDidDismissPopover:]):
3057         (-[WKFileUploadPanel _willMultipleSelectionDelegateBeCalled]):
3058         (-[WKFileUploadPanel imagePickerController:didFinishPickingMediaWithInfo:]):
3059         (-[WKFileUploadPanel imagePickerController:didFinishPickingMultipleMediaWithInfo:]):
3060         (-[WKFileUploadPanel imagePickerControllerDidCancel:]):
3061         Action sheet or image picker handlers.
3062
3063         (-[WKFileUploadPanel _processMediaInfoDictionaries:successBlock:failureBlock:]):
3064         (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]):
3065         (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
3066         (-[WKFileUploadPanel _displayStringForPhotos:videos:]):
3067         Processing selections from the image picker to FileUploadItems.
3068
3069 2014-05-01  Simon Fraser  <simon.fraser@apple.com>
3070
3071         [iOS WK2] Animations on vox.com look wrong
3072         https://bugs.webkit.org/show_bug.cgi?id=132462
3073         <rdar://problem/16731884>
3074
3075         Reviewed by Sam Weinig.
3076         
3077         PlatformCALayerRemote was managing animations incorrectly; aninations
3078         would stick around in m_properties.addedAnimations and get added a second
3079         time by mistake.
3080         
3081         Animations have to be managed a little differently to other properties,
3082         since they are not steady-state things. A given commit has to send over
3083         the added and removed animations, and then clear the layer properties.
3084         
3085         Do this by adding PlatformCALayerRemote::didCommit(), which is called
3086         after the layer properties have been encoded, and have it clear the lists
3087         of added and removed animations.
3088         
3089         removeAnimationForKey() also has to remove the animation from addedAnimations
3090         so that an add/remove in the same commit doesn't send the animation to the
3091         UI process.
3092
3093         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3094         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
3095         (WebKit::PlatformCALayerRemote::didCommit):
3096         (WebKit::PlatformCALayerRemote::removeAnimationForKey):
3097         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
3098         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3099         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3100
3101 2014-05-01  Simon Fraser  <simon.fraser@apple.com>
3102
3103         [iOS WK2] Can't scroll on gatesnotes.com 
3104         https://bugs.webkit.org/show_bug.cgi?id=132459
3105         <rdar://problem/16770909>
3106
3107         Reviewed by Benjamin Poulain.
3108         
3109         The custom UIView hit-testing code was finding views that were created by
3110         the compositing code for clipping, above the UIScrollViews. We only ever
3111         need to find UIScrollViews here for touch overflow-scrolling, so constrain
3112         the hit-testing code to only return UIScrollViews.
3113
3114         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
3115         (-[UIView _recursiveFindDescendantScrollViewAtPoint:withEvent:]):
3116         (-[UIView _findDescendantViewAtPoint:withEvent:]):
3117         (-[UIView _recursiveFindDescendantViewAtPoint:withEvent:]): Deleted.
3118
3119 2014-05-02  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3120
3121         REGRESSION(r168118): [GTK] build broken due to shouldTrackVisitedLinks
3122         https://bugs.webkit.org/show_bug.cgi?id=132447
3123
3124         Unreviewed GTK build fix.
3125
3126         shouldTrackVisitedLinks was removed on r168118.
3127         Visited link coloring works as expected after this change.
3128
3129         * UIProcess/gtk/WebContextGtk.cpp:
3130         (WebKit::WebContext::platformInitializeWebProcess): Remove
3131         shouldTrackVisitedLinks parameter.
3132
3133 2014-05-01  Enrica Casucci  <enrica@apple.com>
3134
3135         REGRESSION (WebKit2) Need to support Learn button.
3136         https://bugs.webkit.org/show_bug.cgi?id=132454
3137         <rdar://problem/16778889>
3138
3139         Reviewed by Benjamin Poulain.
3140
3141         For traditional Chinese we support the ability to add shortcuts
3142         for typing. This is done by pressing the Learn button on the system
3143         menu. This patch adds the necessary code to canPerformAction to enable
3144         the button when appropriate as well as the implementation of the action
3145         itself.
3146         It also adds a check for the Replace button not to be shown when the
3147         selection only contains CJ characters.
3148
3149         * UIProcess/ios/WKContentViewInteraction.mm:
3150         (-[WKContentView _addShortcut:]):
3151         (-[WKContentView canPerformAction:withSender:]):
3152
3153 2014-05-01  Benjamin Poulain  <bpoulain@apple.com>
3154
3155         [iOS][WK2] Tweak the extended background exclusion for MobileSafari
3156         https://bugs.webkit.org/show_bug.cgi?id=132449
3157
3158         Reviewed by Beth Dakin.
3159
3160         Some tweaks for Mobile:
3161         -Use UIViews instead of CALayers to have the same animation timing as the top views.
3162         -The left extended background insets should not exclude the top and bottom insets.
3163
3164         Since this code is in the middle of 2 hot paths, also added some performance tweaks.
3165
3166         * UIProcess/API/Cocoa/WKWebView.mm:
3167         (-[WKWebView initWithFrame:configuration:]):
3168         In the normal case, we do not have extended background exclusion. To avoid creating a background view, we use
3169         the scrollview to render the background.
3170         The separate background view is created lazily if needed.
3171
3172         (-[WKWebView _updateScrollViewBackground]):
3173         (-[WKWebView _frameOrBoundsChanged]):
3174         (updateTopAndBottomExtendedBackgroundExclusionIfNecessary):
3175         This create the top and bottom extended background view as needed and update their frames for the current insets.
3176
3177         (-[WKWebView _setObscuredInsets:]):
3178         (-[WKWebView _setExtendedBackgroundExclusionInsets:]):
3179         When an exclusion inset is needed, create a view for it, transfer the color from the ScrollView, and reset the color
3180         of the scrollview.
3181
3182 2014-05-01  Alexey Proskuryakov  <ap@apple.com>
3183
3184         Move size computation for Blob constructor into BlobRegistryImpl
3185         https://bugs.webkit.org/show_bug.cgi?id=132439
3186
3187         Reviewed by Sam Weinig.
3188
3189         Plumbing to make this version of registerBlobURL synchronous for now.
3190         I expect to make it async again when data structures on client side are simplified.
3191
3192         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
3193         (WebKit::NetworkBlobRegistry::registerBlobURL):
3194         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
3195         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3196         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
3197         * NetworkProcess/NetworkConnectionToWebProcess.h:
3198         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3199         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
3200         (WebKit::BlobRegistryProxy::registerBlobURL):
3201         * WebProcess/FileAPI/BlobRegistryProxy.h:
3202
3203 2014-05-01  Beth Dakin  <bdakin@apple.com>
3204
3205         REGRESSION(168053): Repro crash navigating to another page after selecting phone 
3206         numbers on a page
3207         https://bugs.webkit.org/show_bug.cgi?id=132444
3208         -and corresponding-
3209         <rdar://problem/16787285>
3210
3211         Reviewed by Darin Adler.
3212
3213         Missing null-check.
3214         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
3215         (WebKit::TelephoneNumberOverlayController::drawRect):
3216
3217 2014-05-01  Anders Carlsson  <andersca@apple.com>
3218
3219         Remove WKBundleSetShouldTrackVisitedLinks and associate code
3220         https://bugs.webkit.org/show_bug.cgi?id=132441
3221
3222         Reviewed by Sam Weinig.
3223
3224         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3225         (WKBundleSetShouldTrackVisitedLinks): Deleted.
3226         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
3227         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3228         (WebKit::InjectedBundle::setShouldTrackVisitedLinks): Deleted.
3229         * WebProcess/InjectedBundle/InjectedBundle.h:
3230         * WebProcess/WebPage/VisitedLinkTableController.cpp:
3231         (WebKit::VisitedLinkTableController::addVisitedLink):
3232         * WebProcess/WebProcess.cpp:
3233         (WebKit::WebProcess::WebProcess):
3234         (WebKit::WebProcess::setShouldTrackVisitedLinks): Deleted.
3235         * WebProcess/WebProcess.h:
3236         (WebKit::WebProcess::shouldTrackVisitedLinks): Deleted.
3237
3238 2014-05-01  Anders Carlsson  <andersca@apple.com>
3239
3240         window.testRunner.keepWebHistory() should update the UI process state
3241         https://bugs.webkit.org/show_bug.cgi?id=132440
3242
3243         Reviewed by Dan Bernstein.
3244
3245         * UIProcess/API/C/WKPage.cpp:
3246         (WKPageGetAddsVisitedLinks):
3247         (WKPageSetAddsVisitedLinks):
3248         * UIProcess/API/C/WKPagePrivate.h:
3249
3250 2014-05-01  Filip Pizlo  <fpizlo@apple.com>
3251
3252         Roll out r60161.
3253
3254         Rubber stamped by Mark Hahnenberg.
3255         
3256         This breaks our debugging workflow.
3257
3258         * Shared/WebProcessCreationParameters.cpp:
3259         (WebKit::WebProcessCreationParameters::decode):
3260         * UIProcess/mac/WebContextMac.mm:
3261         (WebKit::registerUserDefaultsIfNeeded):
3262         (WebKit::WebContext::platformInitializeWebProcess):
3263
3264 2014-05-01  Anders Carlsson  <andersca@apple.com>
3265
3266         WKWebView doesn't track visited links (for visited link coloring)
3267         https://bugs.webkit.org/show_bug.cgi?id=132438
3268         <rdar://problem/16704519>
3269
3270         Reviewed by Dan Bernstein.
3271
3272         * Shared/WebProcessCreationParameters.cpp:
3273         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
3274         (WebKit::WebProcessCreationParameters::encode):
3275         (WebKit::WebProcessCreationParameters::decode):
3276         * Shared/WebProcessCreationParameters.h:
3277         * UIProcess/API/APIHistoryClient.h:
3278         (API::HistoryClient::addsVisitedLinks):
3279         (API::HistoryClient::shouldTrackVisitedLinks): Deleted.
3280         * UIProcess/API/C/WKContext.cpp:
3281         (WKContextSetHistoryClient):
3282         * UIProcess/API/Cocoa/WKWebView.mm:
3283         (-[WKWebView _addsVisitedLinks]):
3284         (-[WKWebView _setAddsVisitedLinks:]):
3285         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3286         * UIProcess/API/mac/WKView.mm:
3287         (-[WKView initWithFrame:context:configuration:webView:]):
3288         * UIProcess/Cocoa/HistoryClient.h:
3289         * UIProcess/Cocoa/HistoryClient.mm:
3290         (WebKit::HistoryClient::shouldTrackVisitedLinks): Deleted.
3291         * UIProcess/VisitedLinkProvider.cpp:
3292         (WebKit::VisitedLinkProvider::addVisitedLinkHashFromPage):
3293         * UIProcess/VisitedLinkProvider.h:
3294         * UIProcess/VisitedLinkProvider.messages.in:
3295         * UIProcess/WebContext.cpp:
3296         (WebKit::WebContext::setHistoryClient):
3297         (WebKit::WebContext::createNewWebProcess):
3298         * UIProcess/WebContext.h:
3299         (WebKit::WebContext::processes):
3300         * UIProcess/WebPageProxy.cpp:
3301         (WebKit::WebPageProxy::WebPageProxy):
3302         * UIProcess/WebPageProxy.h:
3303         (WebKit::WebPageProxy::addsVisitedLinks):
3304         (WebKit::WebPageProxy::setAddsVisitedLinks):
3305         * WebProcess/WebPage/VisitedLinkTableController.cpp:
3306         (WebKit::VisitedLinkTableController::addVisitedLink):
3307         * WebProcess/WebProcess.cpp:
3308         (WebKit::WebProcess::initializeWebProcess):
3309         * WebProcess/WebProcess.h:
3310         * WebProcess/WebProcess.messages.in:
3311
3312 2014-05-01  Benjamin Poulain  <bpoulain@apple.com>
3313
3314         [iOS][WK2] The highlight view needs to be in WKWebView coordinates
3315         https://bugs.webkit.org/show_bug.cgi?id=132435
3316         <rdar://problem/16708861>
3317
3318         Reviewed by Tim Horton.
3319
3320         _UIHighlightView needs to be in WKWebView coordinates so that it render unscaled for any page scale factor.
3321         The view needs to be a child of WKContentView so that it moves/scales with the page.
3322
3323         To fix the issue, add an inverse transform root layer for the hightlight, and scale the coordinates to their
3324         inverse scaled counterpart.
3325
3326         The scale is not updated live with the scaling of WKContentView but that should be fine since the view disappear
3327         on any scaling operation (and I would prefer not add live painting during scaling animation).
3328
3329         * UIProcess/ios/WKContentViewInteraction.h:
3330         * UIProcess/ios/WKContentViewInteraction.mm:
3331         (-[WKContentView cleanupInteraction]):
3332         (-[WKContentView _didGetTapHighlightForRequest:color:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]):
3333         (-[WKContentView _cancelInteraction]):
3334
3335 2014-05-01  Ryuan Choi  <ryuan.choi@samsung.com>
3336
3337         [EFL] There are many warnings with software backend
3338         https://bugs.webkit.org/show_bug.cgi?id=132422
3339
3340         Reviewed by Gyuyoung Kim.
3341
3342         * UIProcess/API/efl/EwkView.cpp:
3343         (EwkView::updateCursor):
3344         (EwkView::transformToScreen):
3345
3346 2014-04-30  Alexey Proskuryakov  <ap@apple.com>
3347
3348         Roll out fix for https://bugs.webkit.org/show_bug.cgi?id=131637:
3349         Clean up unnecessary methods in the BackForwardClient interface
3350
3351         It broke a regression test and an API test.
3352
3353         * WebKit2.xcodeproj/project.pbxproj:
3354         * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp:
3355         (WebKit::InjectedBundleBackForwardList::clear):
3356         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3357         (WebKit::WebBackForwardListProxy::WebBackForwardListProxy):
3358         (WebKit::WebBackForwardListProxy::addItem):
3359         (WebKit::WebBackForwardListProxy::goToItem):
3360         (WebKit::WebBackForwardListProxy::itemAtIndex):
3361         (WebKit::WebBackForwardListProxy::backListCount):
3362         (WebKit::WebBackForwardListProxy::forwardListCount):
3363         (WebKit::WebBackForwardListProxy::close):
3364         (WebKit::WebBackForwardListProxy::clear):
3365         * WebProcess/WebPage/WebBackForwardListProxy.h:
3366         (WebKit::WebBackForwardListProxy::create):
3367         * WebProcess/WebPage/WebPage.cpp:
3368         (WebKit::WebPage::WebPage):
3369         * WebProcess/WebPage/ios/WebBackForwardListProxyIOS.mm: Copied from Source/WebKit2/WebProcess/WebPage/ios/WebBackForwardListProxyIOS.mm.
3370
3371 2014-04-30  Brady Eidson  <beidson@apple.com>
3372
3373         Only reveal selection service UI after a short delay.
3374         <rdar://problem/16777346> and https://bugs.webkit.org/show_bug.cgi?id=132418
3375
3376         Reviewed by Sam Weinig.
3377
3378         * WebProcess/WebPage/SelectionOverlayController.cpp:
3379         (WebKit::SelectionOverlayController::SelectionOverlayController):
3380         (WebKit::SelectionOverlayController::destroyOverlay): Also stop the hover timer.
3381         (WebKit::SelectionOverlayController::selectionRectsDidChange): Mark the highlight as dirty.
3382         (WebKit::SelectionOverlayController::hoverTimerFired): If the mouse is still over the highlight,
3383           set the visible flag and setNeedsDisplay().
3384         * WebProcess/WebPage/SelectionOverlayController.h:
3385
3386         * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm:
3387         (WebKit::SelectionOverlayController::drawRect): Recreate the highlight if it exists but
3388           is marked as dirty. After doing that, possibly reset the hover timer.
3389           Also, only performing the actual drawing if the visible flag is set.
3390         (WebKit::SelectionOverlayController::mouseEvent): If the mouse moves on or off the highlight,
3391           start or stop the hover timer accordingly.
3392         (WebKit::SelectionOverlayController::mouseHoverStateChanged): Handle starting/stopping the
3393           hover timer.
3394         (WebKit::SelectionOverlayController::clearHighlight): Deleted.
3395
3396 2014-04-30  Benjamin Poulain  <benjamin@webkit.org>
3397
3398         [iOS][WK2] Animated resize incorrectly assumes the layout width is the same as the view width
3399         https://bugs.webkit.org/show_bug.cgi?id=132373
3400         <rdar://problem/16762178>
3401
3402         Reviewed by Tim Horton.
3403
3404         * UIProcess/API/Cocoa/WKWebView.mm:
3405         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
3406         Fix a couple of bugs when the left/right obscured insets change, and/or when the minimum layout size
3407         is narrower than the view itself.
3408
3409         In order:
3410         -We need to perfom and update if the insets change since the unobscuredRect will also change.
3411         -The min/max zoom scale should be based on the minimum layout size, that's the definition of minimum layout size
3412          in scrollview coordinate :)
3413         -The old web view width in content coordinate could be narrower than the old view bounds if there are left or right
3414          insets.
3415
3416 2014-04-30  Simon Fraser  <simon.fraser@apple.com>
3417
3418         Remove ENABLE_PLUGIN_PROXY_FOR_VIDEO
3419         https://bugs.webkit.org/show_bug.cgi?id=132396
3420
3421         Reviewed by Eric Carlson.
3422         
3423         Remove ENABLE_PLUGIN_PROXY_FOR_VIDEO and related code.
3424
3425         * Configurations/FeatureDefines.xcconfig:
3426         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3427         (WebKit::WebFrameLoaderClient::createMediaPlayerProxyPlugin): Deleted.
3428         (WebKit::WebFrameLoaderClient::hideMediaPlayerProxyPlugin): Deleted.
3429         (WebKit::WebFrameLoaderClient::showMediaPlayerProxyPlugin): Deleted.
3430         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3431         * WebProcess/WebPage/WebPage.cpp:
3432         (WebKit::WebPage::updatePreferences):
3433
3434 2014-04-30  Brady Eidson  <beidson@apple.com>
3435
3436         If there are no services available, do not show the service controls UI
3437         <rdar://problem/16735665> and https://bugs.webkit.org/show_bug.cgi?id=132410
3438
3439         Reviewed by Tim Horton.
3440
3441         Add a lightweight class that lazily polls the appropriate APIs for whether or not appropriate services
3442         are installed and usable on the system:
3443         * UIProcess/mac/ServicesController.h: Added.
3444         (WebKit::ServicesController::imageServicesExist):
3445         (WebKit::ServicesController::selectionServicesExist):
3446         * UIProcess/mac/ServicesController.mm: Added.
3447         (WebKit::ServicesController::shared):
3448         (WebKit::ServicesController::ServicesController):
3449         (WebKit::ServicesController::refreshExistingServices):
3450         (WebKit::ServicesController::refreshExistingServicesTimerFired):
3451
3452         Add "image services exist" and "selection services exist" parameters:
3453         * Shared/WebProcessCreationParameters.cpp:
3454         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
3455         (WebKit::WebProcessCreationParameters::encode):
3456         (WebKit::WebProcessCreationParameters::decode):
3457         * Shared/WebProcessCreationParameters.h:
3458
3459         * UIProcess/WebContext.cpp:
3460         (WebKit::WebContext::createNewWebProcess):
3461         (WebKit::WebContext::refreshExistingServices): Called when the context menu proxy realizes that
3462           services no longer exist.
3463         * UIProcess/WebContext.h:
3464
3465         Each WebProcess hangs on to its own copy of the flags for whether or not the services exist:
3466         * WebProcess/WebProcess.cpp:
3467         (WebKit::WebProcess::WebProcess):
3468         (WebKit::WebProcess::initializeWebProcess):
3469         (WebKit::WebProcess::setEnabledServices):
3470         * WebProcess/WebProcess.h:
3471         (WebKit::WebProcess::imageServicesExist):
3472         (WebKit::WebProcess::selectionServicesExist):
3473
3474         * UIProcess/mac/WebContextMenuProxyMac.mm:
3475         (WebKit::WebContextMenuProxyMac::setupServicesMenu): If the menu creation failed, the set of services
3476           on the system must have changed. So ask the WebContext to refresh them.
3477
3478         * WebProcess/WebPage/SelectionOverlayController.cpp:
3479         (WebKit::SelectionOverlayController::selectionRectsDidChange): If services don't exist, don't create an
3480           overlay (and destroy any existing overlay!)
3481
3482         * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm:
3483         (WebKit::SelectionOverlayController::drawRect): If services don't exist, don't draw, and destroy the overlay.
3484
3485         * WebProcess/WebProcess.messages.in:
3486         * WebKit2.xcodeproj/project.pbxproj:
3487
3488 2014-04-30  Gavin Barraclough  <baraclough@apple.com>
3489
3490         https://bugs.webkit.org/show_bug.cgi?id=132415
3491         Fix snapshotting on WebKit2
3492
3493         Reviewed by Geoff Garen
3494
3495         * UIProcess/API/Cocoa/WKWebView.mm:
3496         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
3497             - Use a VisibilityToken to keep the process runnable.
3498
3499 2014-04-30  Gavin Barraclough  <baraclough@apple.com>
3500
3501         Fix PageVisibility on iOS
3502         https://bugs.webkit.org/show_bug.cgi?id=132393
3503
3504         Rubber stamped by Tim Horton
3505
3506         * UIProcess/ios/PageClientImplIOS.mm:
3507         (WebKit::PageClientImpl::isViewWindowActive):
3508         (WebKit::PageClientImpl::isViewFocused):
3509         (WebKit::PageClientImpl::isViewVisible):
3510         (WebKit::PageClientImpl::isViewVisibleOrOccluded):
3511         (WebKit::PageClientImpl::isVisuallyIdle):
3512             - m_contentView -> m_webView
3513
3514 2014-04-30  Benjamin Poulain  <benjamin@webkit.org>
3515
3516         [iOS][WK2] Add a SPI to exclude the extended background from some areas of WKWebView
3517         https://bugs.webkit.org/show_bug.cgi?id=132406
3518         <rdar://problem/16762197>
3519
3520         Reviewed by Beth Dakin.
3521
3522         Move the extended background to a separate layer bellow the UIScrollView.
3523
3524         The geometry of that layer is then changed based on ExtendedBackgroundExclusionInsets
3525         as needed.
3526
3527         * UIProcess/API/Cocoa/WKWebView.mm:
3528         (-[WKWebView initWithFrame:configuration:]):
3529         (-[WKWebView _updateScrollViewBackground]):
3530         (-[WKWebView _frameOrBoundsChanged]):
3531         (-[WKWebView _setExtendedBackgroundExclusionInsets:]):
3532         (-[WKWebView _extendedBackgroundExclusionInsets]):
3533         (-[WKWebView pageExtendedBackgroundColor]): Deleted.
3534         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3535
3536 2014-04-30  Simon Fraser  <simon.fraser@apple.com>
3537
3538         Fix build error when building for iOS simulator.
3539
3540         * UIProcess/ios/ProcessAssertion.mm:
3541
3542 2014-04-30  Alexey Proskuryakov  <ap@apple.com>
3543
3544         Move Blob.slice() implementation into BlobRegistryImpl
3545         https://bugs.webkit.org/show_bug.cgi?id=132402
3546
3547         Reviewed by Anders Carlsson.
3548
3549         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
3550         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
3551         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
3552         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3553         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
3554         * NetworkProcess/NetworkConnectionToWebProcess.h:
3555         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3556         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
3557         (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
3558         * WebProcess/FileAPI/BlobRegistryProxy.h:
3559
3560 2014-04-30  Beth Dakin  <bdakin@apple.com>
3561
3562         Phone number data detection UI is offset for iframes, pages with topContentInset
3563         https://bugs.webkit.org/show_bug.cgi?id=132372
3564         -and corresponding-
3565         <rdar://problem/16651235>
3566
3567         Reviewed by Tim Horton.
3568
3569         Make the overlay an OverlayType::Document, which will keep everything relative to 
3570         the main Document’s coordinates. 
3571         * WebProcess/WebPage/TelephoneNumberOverlayController.cpp:
3572         (WebKit::TelephoneNumberOverlayController::createOverlayIfNeeded):
3573
3574         Make frames work by converting to the main  document’s coordinate space.
3575         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
3576         (WebKit::TelephoneNumberOverlayController::drawRect):
3577
3578 2014-04-30  Roger Fong  <roger_fong@apple.com>
3579
3580         Unreviewed. Unnecessary explicit initialization of LayoutUnit from r167985.
3581
3582         * WebProcess/WebPage/WebPage.cpp:
3583         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
3584         Darin points out that I can just use “/2” instead of “/LayoutUnit(2.0)”.
3585
3586 2014-04-30 David Hyatt  <hyatt@apple.com>
3587
3588         [New Multicolumn] Enable new multi-column mode
3589         https://bugs.webkit.org/show_bug.cgi?id=131825
3590
3591         Reviewed by Simon Fraser.
3592
3593         * Shared/WebPreferencesStore.h:
3594
3595 2014-04-30  Brian J. Burg  <burg@cs.washington.edu>
3596
3597         Clean up unnecessary methods in the BackForwardClient interface
3598         https://bugs.webkit.org/show_bug.cgi?id=131637
3599
3600         Reviewed by Andreas Kling.
3601
3602         Remove stubs for iOS-specific methods in the BackForwardClient interface.
3603
3604         Construct a WebBackForwardListProxy directly, and make the WebCore page
3605         own the BackForwardClient instance. Convert uses of backForward().client()
3606         to accept references instead of raw pointers.
3607
3608         * WebKit2.xcodeproj/project.pbxproj:
3609         * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp:
3610         (WebKit::InjectedBundleBackForwardList::clear):
3611         * WebProcess/WebPage/WebBackForwardListProxy.cpp: Store a reference to
3612         WebCore::Page instead of a pointer.
3613         (WebKit::WebBackForwardListProxy::WebBackForwardListProxy):
3614         (WebKit::WebBackForwardListProxy::create): Deleted.
3615         (WebKit::WebBackForwardListProxy::addItem):
3616         (WebKit::WebBackForwardListProxy::goToItem):
3617         (WebKit::WebBackForwardListProxy::itemAtIndex):
3618         (WebKit::WebBackForwardListProxy::backListCount):
3619         (WebKit::WebBackForwardListProxy::forwardListCount):
3620         (WebKit::WebBackForwardListProxy::close):
3621         (WebKit::WebBackForwardListProxy::clear):
3622         (WebKit::WebBackForwardListProxy::isActive):
3623         * WebProcess/WebPage/WebBackForwardListProxy.h:
3624         * WebProcess/WebPage/WebPage.cpp:
3625         (WebKit::WebPage::WebPage):
3626         * WebProcess/WebPage/ios/WebBackForwardListProxyIOS.mm: Removed.
3627
3628 2014-04-30  Gavin Barraclough  <baraclough@apple.com>
3629
3630         Fix PageVisibility on iOS
3631         https://bugs.webkit.org/show_bug.cgi?id=132393
3632
3633         Reviewed by Andreas Kling.
3634
3635         Currently page visibility API doesn't work correctly on WK2 iOS for a few reasons,
3636         the most significant of which being that the moment a WKWebView leaves the window
3637         we'll suspend the content process, which removes the possibility for any notification
3638         to be delivered. This patch addresses this issue, by allowing the process to run for
3639         long enough for the notification to be delivered.
3640
3641         1) Introduce a new class, ProcessThrottler, to encapsulate the process suspension logic.
3642         2) WebPageProxy uses ProcessThrottler::VisibilityToken to communicate visibility to the throttler.
3643         3) WebPageProxy tracks pending didUpdateViewState messages to detect when the view state update in
3644            the web content process has completed.
3645         4) Distiguish between 'Background' and 'Suspended' states in the ProcessAssertion.
3646
3647         * Shared/ChildProcessProxy.h:
3648             - moved m_assertion to NetworkProcessProxy / WebProcessProxy.
3649         * UIProcess/Network/NetworkProcessProxy.h:
3650             - added m_assertion.
3651         * UIProcess/WebPageProxy.cpp:
3652         (WebKit::WebPageProxy::WebPageProxy):
3653             - initialize VisibilityToken state.
3654         (WebKit::WebPageProxy::reattachToWebProcess):
3655             - reinitialize VisibilityToken state.
3656         (WebKit::WebPageProxy::viewStateDidChange):
3657             - update VisibilityToken, increment m_pendingViewStateUpdates as necessary.
3658         (WebKit::WebPageProxy::updateVisibilityToken):
3659             - update the VisibiliyToken based on page visibility, and whether an update is still pending.
3660         (WebKit::WebPageProxy::didUpdateViewState):
3661             - detect when a view state change has completed in the web process, and update throttle state as necessary.
3662         * UIProcess/WebPageProxy.h:
3663         (WebKit::WebPageProxy::didUpdateViewState): Deleted.
3664             - moved to .cpp.
3665         * UIProcess/WebProcessProxy.cpp:
3666         (WebKit::WebProcessProxy::WebProcessProxy):
3667             - initialize m_throttler.
3668         (WebKit::WebProcessProxy::didFinishLaunching):
3669             - notify the PageThrottler of the new connection.
3670         * UIProcess/WebProcessProxy.h:
3671         (WebKit::WebProcessProxy::throttler):
3672             - added accessor.
3673         (WebKit::WebProcessProxy::updateProcessState): Deleted.
3674             - moved trottling login to ProcessThrottler.
3675         * UIProcess/ios/PageClientImplIOS.h:
3676         * UIProcess/ios/PageClientImplIOS.mm:
3677         (WebKit::PageClientImpl::isViewWindowActive):
3678         (WebKit::PageClientImpl::isViewFocused):
3679         (WebKit::PageClientImpl::isViewVisible):
3680         (WebKit::PageClientImpl::isViewVisibleOrOccluded):
3681             - these should only be true when the view is in a window.
3682         (WebKit::PageClientImpl::isVisuallyIdle):
3683             - this should only be true when the view is not in a window.
3684         * UIProcess/ios/ProcessAssertion.h:
3685         * UIProcess/ios/ProcessAssertion.mm:
3686         (WebKit::flagsForState):
3687             - map from enum -> BKSAssertion flags values.
3688         (WebKit::ProcessAssertion::ProcessAssertion):
3689             - use flagsForState (add support for Suspended state).
3690         (WebKit::ProcessAssertion::setState):
3691             - use flagsForState (add support for Suspended state).
3692         * UIProcess/ios/ProcessThrottler.h: Added.
3693         (WebKit::ProcessThrottler::VisibilityToken::visibility):
3694             - accessor.
3695         (WebKit::ProcessThrottler::VisibilityToken::setVisibility):
3696             - update Visibility value; update the token as necessary.
3697         (WebKit::ProcessThrottler::ProcessThrottler):
3698             - constructor; does not take an assention until didConnnectToProcess is called.
3699         (WebKit::ProcessThrottler::visibilityToken):
3700             - create a VisibilityToken.
3701         (WebKit::ProcessThrottler::didConnnectToProcess):
3702             - take an assertion.
3703         (WebKit::ProcessThrottler::weakPtr):
3704             - create a weak pointer, used for references from VisibilityToken to the throttler.
3705         (WebKit::ProcessThrottler::assertionState):
3706             - determine the correct AssertionState for the process, based on current visibility.
3707         (WebKit::ProcessThrottler::updateAssertion):
3708             - update assertion, called in response to visibility change.
3709         * UIProcess/ios/ProcessThrottler.mm: Added.
3710         (WebKit::ProcessThrottler::VisibilityToken::VisibilityToken):
3711             - constructor.
3712         (WebKit::ProcessThrottler::VisibilityToken::~VisibilityToken):
3713             - set visibility to hidden to reset.
3714         (WebKit::ProcessThrottler::VisibilityToken::hideTimerFired):
3715             - automatically decay from Hiding -> Hidden on a timeout.
3716         (WebKit::ProcessThrottler::VisibilityToken::setVisibilityInternal):
3717             - update counters tracking visibility in ProcessThrottler.
3718         * UIProcess/ios/WKContentView.mm:
3719         (-[WKContentView didMoveToWindow]):
3720             - This affects all view state flags, not just the 'InWindow' state.
3721               If the view moves out of a window request a reply from the WebContent - we use this
3722               to detect when the page visibility event has completed.
3723         * UIProcess/ios/WebProcessProxyIOS.mm:
3724         (WebKit::WebProcessProxy::updateProcessState): Deleted.
3725             - removed.
3726         * WebKit2.xcodeproj/project.pbxproj:
3727             - added new files.
3728
3729 2014-04-30  Anders Carlsson  <andersca@apple.com>
3730
3731         Preemptive header fixes for when WebKit.framework is going to provide the modern API
3732         https://bugs.webkit.org/show_bug.cgi?id=132394
3733
3734         Reviewed by Dan Bernstein.
3735
3736         * UIProcess/API/Cocoa/WKBrowsingContextPolicyDelegate.h:
3737         (NS_ENUM):
3738         Delete WKNavigationType for now. Ultimately the entire delegate should be removed.
3739
3740         * UIProcess/API/Cocoa/WKPreferences.h:
3741         Add a header guard so we can avoid importing WKPreferences.h more than once.
3742
3743         * WebKit2.xcodeproj/project.pbxproj:
3744         _WKScriptWorld.h should be private, not public.
3745         WKScriptMessagePrivate.h and WKUserContentControllerPrivate.h should be private, not project.
3746
3747 2014-04-30  Joseph Pecoraro  <pecoraro@apple.com>
3748
3749         Web Inspector: Ensure UIProcess checks in to webinspectord after spawning a WebProcess
3750         https://bugs.webkit.org/show_bug.cgi?id=132389
3751
3752         Reviewed by Timothy Hatcher.
3753
3754         We aggregate WebProcess WebView's under the UIProcess. If the UIProcess
3755         didn't connect to webinspectord these WebViews would have remained
3756         hidden. Always have the UIProcess connect to webinspectord when it
3757         spawns a WebProcess and may have a child process holding views that
3758         it ultimately owns and should display under the UIProcess name.
3759
3760         * UIProcess/WebContext.cpp:
3761         (WebKit::WebContext::createNewWebProcess):
3762
3763 2014-04-30  Zalan Bujtas  <zalan@apple.com>
3764
3765         [iOS]Subpixel rendering: Extra line of pixels next to the YouTube loading indicator.
3766         https://bugs.webkit.org/show_bug.cgi?id=132391
3767
3768         Reviewed by Simon Fraser.
3769
3770         CG and GraphicsContext clipping should use the same coordinates. Snapping either one
3771         while leaving the other unsnapped results in clipping mismatch and that may produce
3772         unpainted areas.
3773
3774         Not testable.
3775
3776         * Shared/mac/RemoteLayerBackingStore.mm:
3777         (WebKit::RemoteLayerBackingStore::drawInContext):
3778
3779 2014-04-30  Alexey Proskuryakov  <ap@apple.com>
3780
3781         https://bugs.webkit.org/show_bug.cgi?id=132363
3782         Make Blob RawData immutable
3783
3784         Reviewed by Anders Carlsson.
3785
3786         * Shared/FileAPI/BlobRegistrationData.cpp: (WebKit::BlobRegistrationData::decode):
3787         Create RawData in one step.
3788
3789 2014-04-30  Brady Eidson  <beidson@apple.com>
3790
3791         Followup to: Handle selection services menu.
3792         <rdar://problem/16727798> and https://bugs.webkit.org/show_bug.cgi?id=132362
3793
3794         * UIProcess/mac/WebContextMenuProxyMac.mm:
3795         (WebKit::WebContextMenuProxyMac::setupServicesMenu): Remove an ASSERT from previous version of the patch
3796           that landed. I’d forgotten to add this stray change to my staging area.
3797
3798 2014-04-30  Manuel Rego Casasnovas  <rego@igalia.com>
3799
3800         [CSS Grid Layout] Enable runtime feature by default
3801         https://bugs.webkit.org/show_bug.cgi?id=132189
3802
3803         Reviewed by Benjamin Poulain.
3804
3805         * Shared/WebPreferencesStore.h: Remove unneeded changes that
3806         enable/disable the runtime feature depending on the compilation flag.
3807         And set it to true by default.
3808         * UIProcess/gtk/ExperimentalFeatures.cpp: Set it to true by default.
3809
3810 2014-04-30  Roger Fong  <roger_fong@apple.com>
3811
3812         Unreviewed. Wrong units used in offset calculation from r167961.
3813
3814         * WebProcess/WebPage/WebPage.cpp:
3815         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
3816         I accidentally mixed and matches LayoutUnits with Ints in offset calculation here.
3817         It should all just be in LayoutUnits.
3818
3819 2014-04-29  Benjamin Poulain  <bpoulain@apple.com>
3820
3821         [iOS][WK2] When pageScaleFactor * deviceScaleFactor = 1, the tile grid is completely messed up
3822         https://bugs.webkit.org/show_bug.cgi?id=132368
3823
3824         Reviewed by Simon Fraser.
3825
3826         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3827         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
3828         PlatformCALayerRemote always initialized the content scale to 1. Since contentsScale is supposed to reflect
3829         zoomScale * deviceScaleFactor, the value should be 2.
3830
3831         This was causing bugs whenever the page scale factor was 1/2 on retina device (device scale factor = 2).
3832
3833         When the page is initialized, GraphicsLayerCA::updateContentsScale(0.5) computes a contentsScale of 1. There is an early
3834         return on if (contentsScale == m_layer->contentsScale()). Since PlatformCALayerRemote->contentsScale() was incorreclty
3835         returning one, we were leaving the tile backing unmodified.
3836
3837         Later, when the transaction is commited, the tile backing would still be default initialized and would render everything
3838         at the wrong scale.
3839
3840 2014-04-29  Eric Carlson  <eric.carlson@apple.com>
3841
3842         [Mac] tag the video layers with descriptive name to aid debugging
3843         https://bugs.webkit.org/show_bug.cgi?id=132371
3844
3845         Reviewed by Darin Adler.
3846
3847         * WebProcess/ios/WebVideoFullscreenManager.mm:
3848         (WebKit::WebVideoFullscreenManager::enterFullscreenForNode): Set the 
3849             fullscreen host layer name in a debug build.
3850
3851 2014-04-29  Brady Eidson  <beidson@apple.com>
3852
3853         Handle selection services menu.
3854         <rdar://problem/16727798> and https://bugs.webkit.org/show_bug.cgi?id=132362
3855
3856         Reviewed by Tim Horton.
3857
3858         Add members for the relevant info for showing a service menu for a selection:
3859         * Shared/ContextMenuContextData.cpp:
3860         (WebKit::ContextMenuContextData::ContextMenuContextData):
3861         (WebKit::ContextMenuContextData::controlledDataIsEditable):
3862         * Shared/ContextMenuContextData.h:
3863         (WebKit::ContextMenuContextData::ContextMenuContextData):
3864         (WebKit::ContextMenuContextData::controlledSelectionData):
3865         (WebKit::ContextMenuContextData::needsServicesMenu):
3866
3867         * UIProcess/WebPageProxy.h:
3868         * UIProcess/WebPageProxy.messages.in:
3869         * UIProcess/mac/WebPageProxyMac.mm:
3870         (WebKit::WebPageProxy::replaceSelectionWithPasteboardData): Changed to allow for multiple types on the overridden pasteboard.
3871         (WebKit::WebPageProxy::showSelectionServiceMenu):
3872
3873         Update the services menu code to know the difference between an image service and a selection service:
3874         * UIProcess/mac/WebContextMenuProxyMac.h:
3875         * UIProcess/mac/WebContextMenuProxyMac.mm:
3876         (-[WKSharingServicePickerDelegate sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
3877         (-[WKSharingServicePickerDelegate sharingService:willShareItems:]):
3878         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
3879         (WebKit::WebContextMenuProxyMac::contextMenuItemSelected):
3880         (WebKit::WebContextMenuProxyMac::setupServicesMenu):
3881         (WebKit::WebContextMenuProxyMac::clearServicesMenu):
3882         (WebKit::WebContextMenuProxyMac::populate):
3883         (WebKit::WebContextMenuProxyMac::showContextMenu):
3884         (WebKit::WebContextMenuProxyMac::setupImageServicesMenu): Deleted.
3885         (WebKit::WebContextMenuProxyMac::clearImageServicesMenu): Deleted.
3886
3887         * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp:
3888         (WebKit::WebPasteboardOverrides::getDataForOverride):
3889
3890         * WebProcess/WebPage/WebPage.h:
3891         * WebProcess/WebPage/WebPage.messages.in:
3892         * WebProcess/WebPage/mac/WebPageMac.mm:
3893         (WebKit::WebPage::replaceSelectionWithPasteboardData): Changed to allow for multiple types on the overridden pasteboard.
3894         (WebKit::WebPage::handleSelectionServiceClick): Pass the relevant selection data through to the UIProcess as RTFD data.
3895
3896         * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm:
3897         (WebKit::SelectionOverlayController::handleClick): Notify the WebPage of the click.
3898
3899 2014-04-29  Dan Bernstein  <mitz@apple.com>
3900
3901         <rdar://problem/16745596> [Cocoa] Crash when invoking a method with an unsigned parameter on a remote object
3902         https://bugs.webkit.org/show_bug.cgi?id=132366
3903
3904         Reviewed by Anders Carlsson.
3905
3906         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
3907         (encodeInvocation): Handle the 'I' type code. Interpret the 'q' and 'Q' type codes in an
3908         architecture-independent manner.
3909         (decodeInvocationArguments): Ditto.
3910
3911 2014-04-29  Roger Fong  <roger_fong@apple.com>
3912
3913         Don't immediately snapshot plugin to allow for proper dominant plugin detection.
3914         https://bugs.webkit.org/show_bug.cgi?id=132294.
3915         <rdar://problem/16745679>
3916
3917         Reviewed by Dean Jackson.
3918
3919         * WebProcess/Plugins/PluginView.cpp:
3920         (WebKit::PluginView::didInitializePlugin):
3921         Instead of immediately setting the display state to DisplaySnapshot,
3922         put it on a timer to let the page fully layout and get hit test properly.
3923
3924 2014-04-28  Roger Fong  <roger_fong@apple.com>
3925
3926         Plugins hidden by images should autoplay.
3927         https://bugs.webkit.org/show_bug.cgi?id=132222.
3928         <rdar://problem/16653536>
3929
3930         Reviewed by Jon Lee and Darin Adler.
3931
3932         * WebProcess/WebPage/WebPage.cpp:
3933         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
3934         If the image on top of the plugin is similarly sized and similarly positioned as the plugin rect,
3935         set the plugin to autoplay. This is assuming that the previous snapshot checks have passed as well.
3936
3937 2014-04-29  Filip Pizlo  <fpizlo@apple.com>
3938
3939         Use LLVM as a backend for the fourth-tier DFG JIT (a.k.a. the FTL JIT)
3940         https://bugs.webkit.org/show_bug.cgi?id=112840
3941
3942         Rubber stamped by Geoffrey Garen.
3943
3944         * Configurations/FeatureDefines.xcconfig:
3945
3946 2014-04-29  Brady Eidson  <beidson@apple.com>
3947
3948         Change Image Controls replacement to use selection and paste
3949         <rdar://problem/16302722> and https://bugs.webkit.org/show_bug.cgi?id=131992
3950
3951         Reviewed by Tim Horton.
3952
3953         Add a "pasteboard override" mechanism which allows WebKit to keep pasteboard content local
3954         to the WebProcess and access it there without having to message up to the UI process:
3955         * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp: Added.
3956         (WebKit::WebPasteboardOverrides::sharedPasteboardOverrides):
3957         (WebKit::WebPasteboardOverrides::WebPasteboardOverrides):
3958         (WebKit::WebPasteboardOverrides::addOverride):
3959         (WebKit::WebPasteboardOverrides::removeOverride):
3960         (WebKit::WebPasteboardOverrides::overriddenTypes):
3961         (WebKit::WebPasteboardOverrides::getDataForOverride):
3962         * WebProcess/WebCoreSupport/WebPasteboardOverrides.h: Added.
3963
3964         Change the pasteboard strategy to consult the pasteboard overrides before consulting the native pasteboard:
3965         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3966         (WebKit::WebPlatformStrategies::getTypes):
3967         (WebKit::WebPlatformStrategies::bufferForType):
3968
3969         Add "replaceSelectionWithPasteboardData" which uses the new pasteboard overrides mechanism
3970         and then has WebCore perform the replacement:
3971         * WebProcess/WebPage/WebPage.h:
3972         * WebProcess/WebPage/WebPage.messages.in:
3973         * WebProcess/WebPage/mac/WebPageMac.mm:
3974         (WebKit::replaceSelectionPasteboardName):
3975         (WebKit::WebPage::replaceSelectionWithPasteboardData):
3976
3977         * UIProcess/mac/WebPageProxyMac.mm:
3978         (WebKit::WebPageProxy::replaceSelectionWithPasteboardData):
3979
3980         * UIProcess/mac/WebContextMenuProxyMac.h:
3981         (WebKit::WebContextMenuProxyMac::page):
3982         * UIProcess/mac/WebContextMenuProxyMac.mm:
3983         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]): Use "replaceSelectionWithPasteboardData".
3984         (WebKit::WebContextMenuProxyMac::WebContextMenuProxyMac):
3985         (WebKit::WebContextMenuProxyMac::replaceControlledImage): Deleted.
3986
3987         Remain other remnants of "replaceControlledImage":
3988         * UIProcess/WebPageProxy.cpp:
3989         (WebKit::WebPageProxy::replaceControlledImage): Deleted.
3990         * UIProcess/WebPageProxy.h:
3991         * WebProcess/WebPage/WebContextMenu.cpp:
3992         (WebKit::WebContextMenu::replaceControlledImage): Deleted.
3993         * WebProcess/WebPage/WebContextMenu.h:
3994         * WebProcess/WebPage/WebPage.cpp:
3995         (WebKit::WebPage::replaceControlledImage): Deleted.
3996
3997         * WebKit2.xcodeproj/project.pbxproj:
3998
3999 2014-04-29  Tim Horton  <timothy_horton@apple.com>
4000
4001         Build fix.
4002
4003         * DatabaseProcess/ios/DatabaseProcessIOS.mm:
4004
4005 2014-04-29  Alexey Proskuryakov  <ap@apple.com>
4006
4007         [WK2] DatabaseProcess should be sandboxed
4008         https://bugs.webkit.org/show_bug.cgi?id=132324
4009         <rdar://problem/15961708>
4010
4011         Reviewed by Darin Adler.
4012
4013         * Configurations/WebKit2.xcconfig: Added the profile to the list of files skipped
4014         on iOS.
4015
4016         * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess):
4017         Consume a sandbox extension for IndexedDB directory (which we get with initialization
4018         message after entering sandbox).
4019
4020         * DatabaseProcess/ios: Added.
4021         * DatabaseProcess/ios/DatabaseProcessIOS.mm: Copied from Source/WebKit2/DatabaseProcess/mac/DatabaseProcessMac.mm.
4022         Separated from Mac version to match how other processes are implemented.
4023
4024         * DatabaseProcess/mac/DatabaseProcessMac.mm: (WebKit::DatabaseProcess::initializeProcessName):
4025         Removed ifdefs.
4026
4027         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in: Added.
4028
4029         * DerivedSources.make: Generate the profile from .sb.in.
4030
4031         * Shared/Databases/DatabaseProcessCreationParameters.cpp:
4032         (WebKit::DatabaseProcessCreationParameters::encode):
4033         (WebKit::DatabaseProcessCreationParameters::decode):
4034         * Shared/Databases/DatabaseProcessCreationParameters.h:
4035         Added a sandbox extension for indexedDatabaseDirectory.
4036
4037         * Shared/SecurityOriginData.h: Added an unrelated FIXME.
4038
4039         * UIProcess/WebContext.cpp: (WebKit::WebContext::ensureDatabaseProcess): Create
4040         a sandbox extension for indexedDatabaseDirectory.
4041
4042         * WebKit2.xcodeproj/project.pbxproj: Added new files.
4043
4044 2014-04-28  Andy Estes  <aestes@apple.com>
4045
4046         [iOS] Introduce -didNotHandleTapAsClickAtPoint: to WKUIDelegatePrivate
4047         https://bugs.webkit.org/show_bug.cgi?id=132316
4048
4049         Reviewed by Darin Adler.
4050
4051         One WebKit2 client is interested to know if a tap was not handled by an element that responds to clicks.