c0ea1cfed04d1f6e308cf1c99cf845fd0257ef2f
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-10-31  Tim Horton  <timothy_horton@apple.com>
2
3         Remove "Add to iPhoto" from the action menu's sharing menu
4         https://bugs.webkit.org/show_bug.cgi?id=138251
5         <rdar://problem/18837197>
6
7         Reviewed by Anders Carlsson.
8
9         * UIProcess/mac/WKActionMenuController.mm:
10         (-[WKActionMenuController sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
11         Filter out "Add to iPhoto".
12
13 2014-10-31  Adrian Perez de Castro  <aperez@igalia.com>
14
15         [GTK] Support script message handlers WebKitUserContentManager
16         https://bugs.webkit.org/show_bug.cgi?id=133730
17
18         Reviewed by Carlos Garcia Campos.
19
20         Support user script message handlers in WebKitUserContentManager.
21         This needs building with ENABLE_USER_MESSAGE_HANDLERS, for which
22         an option is added to the CMake build files. The option is disabled
23         globally by default, and the WebKitGTK port enables it. On the API
24         level, two new methods to register and unregister names are provided
25         in the "window.webkit" namespace, and on message reception the
26         "WebKitUserContentManager::script-message-received" signal is
27         emitted, using the registered names as signal detail.
28
29         * UIProcess/API/gtk/WebKitJavascriptResult.cpp: Add a new private
30         function to construct a WebKitJavascriptResult directly from a
31         WebCore::SerializedScriptValue.
32         (_WebKitJavascriptResult::_WebKitJavascriptResult): Ditto.
33         (webkitJavascriptResultCreate): Ditto.
34         * UIProcess/API/gtk/WebKitJavascriptResultPrivate.h: Ditto.
35         * UIProcess/API/gtk/WebKitUserContentManager.cpp:
36         (webkit_user_content_manager_class_init): Install the
37         "script-message-received" signal.
38         (webkit_user_content_manager_register_script_message_handler):
39         Added.
40         (webkit_user_content_manager_unregister_script_message_handler):
41         Added.
42         * UIProcess/API/gtk/WebKitUserContentManager.h: Added the new
43         public API methods.
44         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Ditto.
45         * UIProcess/API/gtk/docs/webkit2gtk.types: Add
46         webkit_user_content_manager_get_type() to the list in order to make
47         gtk-doc to generate documentation for signals.
48
49 2014-10-31  Martin Hock  <mhock@apple.com>
50
51         Unreviewed, iOS build fix since 175406.
52
53         * WebProcess/WebPage/ios/WebPageIOS.mm:
54         (WebKit::WebPage::performActionOnElement):
55
56 2014-10-30  Darin Adler  <darin@apple.com>
57
58         Eliminate ResourceBuffer and use SharedBuffer directly instead
59         https://bugs.webkit.org/show_bug.cgi?id=138174
60
61         Reviewed by Antti Koivisto.
62
63         * CMakeLists.txt: Removed WebResourceBuffer.cpp.
64
65         * NetworkProcess/NetworkResourceLoader.cpp:
66         (WebKit::NetworkResourceLoader::sendBuffer): Use a reference instead of pointer.
67         * NetworkProcess/NetworkResourceLoader.h: Ditto.
68         * NetworkProcess/mac/NetworkDiskCacheMonitor.h: Ditto.
69         * NetworkProcess/mac/NetworkDiskCacheMonitor.mm:
70         (WebKit::NetworkDiskCacheMonitor::resourceBecameFileBacked): Ditto.
71         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
72         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer): Ditto.
73
74         * Shared/WebResourceBuffer.cpp: Removed.
75         * Shared/WebResourceBuffer.h: Removed.
76
77         * WebKit2.xcodeproj/project.pbxproj: Removed WebResourceBuffer.cpp/h.
78
79         * WebProcess/Network/NetworkProcessConnection.cpp: Removed unneeded includes.
80         (WebKit::NetworkProcessConnection::didCacheResource): Use a reference instead
81         of a pointer.
82
83         * WebProcess/Network/WebResourceLoadScheduler.cpp: Removed unneeded include.
84         * WebProcess/Network/WebResourceLoader.cpp: Ditto.
85         * WebProcess/Network/WebResourceLoader.h: Ditto.
86         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Ditto.
87         (WebKit::WebFrameLoaderClient::finishedLoading): Use SharedBuffer directly.
88         * WebProcess/WebPage/WebFrame.cpp:
89         (WebKit::WebFrame::source): Ditto.
90
91         * WebProcess/WebPage/WebPage.cpp:
92         (WebKit::WebPage::runJavaScriptInMainFrame): Refactored to make the relationship
93         between the buffer and the DataReference clearer and to avoid having a long-lived
94         DataReference pointing to an underlying buffer with unclear lifetime.
95         (WebKit::WebPage::getContentsAsString): Ditto.
96         (WebKit::WebPage::getSelectionAsWebArchiveData): Ditto.
97         (WebKit::WebPage::getMainResourceDataOfFrame): Ditto. Also use SharedBuffer directly.
98         (WebKit::WebPage::getResourceDataFromFrame): Ditto.
99         (WebKit::WebPage::getWebArchiveOfFrame): Ditto.
100
101         * WebProcess/WebPage/ios/WebPageIOS.mm:
102         (WebKit::containingLinkElement): Use elementLineage.
103         (WebKit::WebPage::performActionOnElement): Use references and SharedBuffer.
104         ALso did a bit of other cleanup in here.
105         (WebKit::isAssistableElement): Take Element& instead of Node*, since that's what
106         the caller has.
107         (WebKit::nextAssistableElement): Changed name to match what the function does.
108         Added an obviously-missing check on the startNode argument. Updated for change
109         to isAssistableElement above. Take a Page& instead of a Page*.
110         (WebKit::hasAssistableElement): Changed name to match what the function does.
111         Updated for change to nextAssistableElement above. Took out incorrect comparison
112         of a C++ pointer to the Objective-C object pointer nil. Take a Page& instead of a Page*.
113         (WebKit::WebPage::focusNextAssistedNode): Updated for above changes.
114         (WebKit::WebPage::getAssistedNodeInformation): Updated for above changes.
115
116 2014-10-30  Jer Noble  <jer.noble@apple.com>
117
118         [EME] Add Setting for accessing storage location for MediaKeys data
119         https://bugs.webkit.org/show_bug.cgi?id=138147
120
121         Reviewed by Brady Eidson.
122
123         * WebProcess/WebPage/WebPage.cpp:
124         (WebKit::WebPage::WebPage): Pass from WebMediaKeyStorageManager into Settings.
125
126 2014-10-30  Dana Burkart  <dburkart@apple.com>
127
128         Workaround for <rdar://problem/18830639>
129
130         Unreviewed.
131
132         * Shared/API/Cocoa/WKFoundation.h:
133
134 2014-10-30  Dana Burkart  <dburkart@apple.com>
135
136         <rdar://problem/18821260> Prepare for the mysterious future
137
138         Reviewed by Lucas Forschler.
139
140         * Configurations/Base.xcconfig:
141         * Configurations/DebugRelease.xcconfig:
142         * Configurations/FeatureDefines.xcconfig:
143         * Configurations/Version.xcconfig:
144         * Configurations/WebContentService.Development.xcconfig:
145         * Configurations/WebContentService.xcconfig:
146         * Configurations/WebKit.xcconfig:
147
148 2014-10-30  Anders Carlsson  <andersca@apple.com>
149
150         Try to fix the iOS build.
151
152         * WebProcess/WebPage/WebPage.messages.in:
153
154 2014-10-30  Tim Horton  <timothy_horton@apple.com>
155
156         Long spins under rangeExpandedAroundPosition on Yahoo Mail
157         https://bugs.webkit.org/show_bug.cgi?id=138223
158         <rdar://problem/18819547>
159
160         Reviewed by Enrica Casucci.
161
162         * WebProcess/WebPage/mac/WebPageMac.mm:
163         (WebKit::rangeExpandedAroundPositionByCharacters):
164         Reimplement rangeExpandedAroundPosition to operate on characters instead of lines,
165         and to use Position. Moving VisiblePositions by line can be very expensive in some cases,
166         and for generating lookup/Data Detectors context, we don't care about that kind of precision.
167         This makes this function ~1000x faster when it hits on a row in the Yahoo Mail message list.
168
169         (WebKit::WebPage::performDictionaryLookupAtLocation):
170         (WebKit::scanForDataDetectedItems):
171         Adopt the new rangeExpandedAroundPositionByCharacters, expanding 250 characters
172         before and after, which roughly matches what we were usually getting going by line,
173         and is a reasonable amount of context for these operations.
174
175 2014-10-30  Brady Eidson  <beidson@apple.com>
176
177         IndexedDB is deleting data when a PK is shared amongst two objectStores
178         rdar://problem/18479306 and https://bugs.webkit.org/show_bug.cgi?id=137154
179
180         Reviewed by Jer Noble.
181
182         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
183         (WebKit::v1RecordsTableSchema): Store away the v1 schema for introspection into the database.
184         (WebKit::v2RecordsTableSchema): Add utility methods to get the v2 schema with different Table names.
185         (WebKit::createOrMigrateRecordsTableIfNecessary): Check to see if the Records table exists with
186           the correct schema. If it is the v1 schema, then migrate the data to a new v2 table, drop the v1
187           table, then slide the new table into place.
188         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::ensureValidRecordsTable): Make sure the Records table
189           exists and is v2, and then make sure the uniqueness index exists.
190         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): Don’t bother creating
191           the Records table here as it will have already been established earlier.
192         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata):
193         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
194
195 2014-10-30  Beth Dakin  <bdakin@apple.com>
196
197         Implement action menus for text
198         https://bugs.webkit.org/show_bug.cgi?id=138220
199         -and corresponding-
200         rdar://problem/18742297
201
202         Reviewed by Tim Horton.
203
204         Two new types of actions for the two text actions.
205         * Shared/API/c/WKActionMenuItemTypes.h:
206
207         One new type of menu.
208         * Shared/API/c/WKActionMenuTypes.h:
209
210         Pass willOpenMenu on to the WKActionMenuController.
211         * UIProcess/API/mac/WKView.mm:
212         (-[WKView willOpenMenu:withEvent:]):
213
214         Two new WebPageProxy functions that will pass messages along to the web process.
215         * UIProcess/WebPageProxy.cpp:
216         (WebKit::WebPageProxy::selectLookupTextAtLocation):
217         * UIProcess/WebPageProxy.h:
218
219         At willOpenMenu time, text menus should select text so that it is clear what the 
220         menu actions will apply to.
221         * UIProcess/mac/WKActionMenuController.h:
222         * UIProcess/mac/WKActionMenuController.mm:
223
224         Menu items for text menus.
225         (-[WKActionMenuController willOpenMenu:withEvent:]):
226         (-[WKActionMenuController _defaultMenuItemsForText]):
227         (-[WKActionMenuController _copyText:]):
228         (-[WKActionMenuController _lookupText:]):
229         (-[WKActionMenuController _createActionMenuItemForTag:]):
230         (imageForResource:name::if):
231
232         New messages to the web process.
233         * UIProcess/mac/WebPageProxyMac.mm:
234         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
235         * WebProcess/WebPage/WebPage.h:
236         * WebProcess/WebPage/WebPage.messages.in:
237
238         Re-factor performDictionaryLookupAtLocation() to re-use the code that finds the 
239         Range for the dictionary lookup. That code now lives in 
240         rangeForDictionaryLookupAtHitTestResult() and can be used by 
241         performDictionaryLookupAtLocation() and our new function 
242         selectLookupTextAtLocation().
243         * WebProcess/WebPage/mac/WebPageMac.mm:
244         (WebKit::WebPage::rangeForDictionaryLookupAtHitTestResult):
245         (WebKit::WebPage::performDictionaryLookupAtLocation):
246
247         Since the action menu text is always selected, when the lookup action is chosen, 
248         we can just lookup the current selection.
249         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
250
251         Uses the new function rangeForDictionaryLookupAtHitTestResult() to get a lookup 
252         range and then select it.
253         (WebKit::WebPage::selectLookupTextAtLocation):
254
255 2014-10-30  Dan Bernstein  <mitz@apple.com>
256
257         When a client certificate is rejected, Safari says the website didn’t accept the certificate “unknown” instead of naming the certificate
258         https://bugs.webkit.org/show_bug.cgi?id=138216
259
260         Reviewed by Alexey Proskuryakov.
261
262         * Shared/cf/ArgumentCodersCF.cpp:
263         (IPC::typeFromCFTypeRef): Remove no-longer-necessary platform guards around SecIdentityRef.
264         (IPC::encode): Ditto.
265         (IPC::decode): Ditto.
266         * Shared/mac/WebCoreArgumentCodersMac.mm:
267         (IPC::ArgumentCoder<ResourceError>::encodePlatformData): If NSErrorClientCertificateChainKey
268         is present in the error’s userInfo dictionary, assert that it’s an array of identities and
269         certificates, and include it in the filtered dictionary.
270
271 2014-10-29  Hunseop Jeong  <hs85.jeong@samsung.com>
272
273         [CoordinatedGraphics] Use modern for-loops
274         https://bugs.webkit.org/show_bug.cgi?id=138168
275
276         Reviewed by Andreas Kling.
277
278         No new tests as there is no change in functionality.
279
280         * UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp: Use a modern for loop.
281         (WebCore::CoordinatedBackingStore::texture):
282         (WebCore::CoordinatedBackingStore::paintTilesToTextureMapper):
283         * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp: Use a modern for loop.
284         (WebKit::CoordinatedDrawingAreaProxy::incorporateUpdate):
285         * UIProcess/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: Use a modern for loop.
286         (WebCore::CoordinatedGraphicsScene::setLayerChildrenIfNeeded):
287         (WebCore::CoordinatedGraphicsScene::createLayers): changed the name of argument to be equal with deleteLayer(). 
288         (WebCore::CoordinatedGraphicsScene::deleteLayers):
289         (WebCore::CoordinatedGraphicsScene::createTilesIfNeeded):
290         (WebCore::CoordinatedGraphicsScene::removeTilesIfNeeded):
291         (WebCore::CoordinatedGraphicsScene::updateTilesIfNeeded):
292         (WebCore::CoordinatedGraphicsScene::syncUpdateAtlases):
293         (WebCore::CoordinatedGraphicsScene::syncImageBackings):
294         (WebCore::CoordinatedGraphicsScene::commitSceneState):
295         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp: Use a modern for loop.
296         (WebKit::shouldPaintBoundsRect):
297         (WebKit::CoordinatedDrawingArea::display):
298
299 2014-10-29  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
300
301         Unreviewed, EFL build fix since r175349.
302
303         * UIProcess/WebBackForwardList.cpp:
304         (WebKit::WebBackForwardList::didRemoveItem): Use PLATFORM(COCOA) for setSnapshot().
305
306 2014-10-29  Tim Horton  <timothy_horton@apple.com>
307
308         Null deref under performActionMenuHitTestAtLocation
309         https://bugs.webkit.org/show_bug.cgi?id=138197
310         <rdar://problem/18817803>
311
312         Reviewed by Beth Dakin.
313
314         * WebProcess/WebPage/mac/WebPageMac.mm:
315         (WebKit::scanForDataDetectedItems):
316         Null-check the expanded range.
317
318 2014-10-28  Ada Chan  <adachan@apple.com>
319
320         Implement WKPageSetMuted(bool).
321         https://bugs.webkit.org/show_bug.cgi?id=138158
322
323         Reviewed by Anders Carlsson.
324
325         * UIProcess/API/C/WKPage.cpp:
326         (WKPageSetMuted):
327         * UIProcess/API/C/WKPagePrivate.h:
328         * UIProcess/WebPageProxy.cpp:
329         (WebKit::WebPageProxy::setMuted):
330         * UIProcess/WebPageProxy.h:
331         * WebProcess/WebPage/WebPage.cpp:
332         (WebKit::WebPage::setMuted):
333         * WebProcess/WebPage/WebPage.h:
334         * WebProcess/WebPage/WebPage.messages.in:
335
336 2014-10-29  Anders Carlsson  <andersca@apple.com>
337
338         Clear ViewSnapshots when back/forward list items are removed from their list
339         https://bugs.webkit.org/show_bug.cgi?id=138188
340         <rdar://problem/18817001>
341
342         Reviewed by Tim Horton.
343
344         Ideally we should remove the WebBackForwardListItem objects as well, but this is a somewhat safer fix.
345
346         Change all the "remove item" codepaths to call WebBackForwardList::didRemoveItem and have it clear out the snapshot.
347
348         * UIProcess/WebBackForwardList.cpp:
349         (WebKit::WebBackForwardList::pageClosed):
350         (WebKit::WebBackForwardList::addItem):
351         (WebKit::WebBackForwardList::removeAllItems):
352         (WebKit::WebBackForwardList::clear):
353         (WebKit::WebBackForwardList::didRemoveItem):
354         * UIProcess/WebBackForwardList.h:
355
356 2014-10-29  Tim Horton  <timothy_horton@apple.com>
357
358         Hide the 'Add to Photos' item if it isn't available
359         https://bugs.webkit.org/show_bug.cgi?id=138182
360         <rdar://problem/18814999>
361
362         Reviewed by Beth Dakin.
363
364         * UIProcess/mac/WKActionMenuController.mm:
365         (-[WKActionMenuController _defaultMenuItemsForImage]):
366         (-[WKActionMenuController _canAddImageToPhotos]):
367         (-[WKActionMenuController _addImageToPhotos:]):
368         Factor _canAddImageToPhotos out of _addImageToPhotos:, and use it in
369         _defaultMenuItemsForImage to avoid including the menu item in the first place.
370
371 2014-10-29  Tim Horton  <timothy_horton@apple.com>
372
373         Rename WebPageProxy::activeActionMenuHitTestResult to lastMouseMoveHitTestResult
374         https://bugs.webkit.org/show_bug.cgi?id=138137
375         <rdar://problem/18798257>
376
377         Reviewed by Anders Carlsson.
378
379         * UIProcess/WebPageProxy.cpp:
380         (WebKit::WebPageProxy::mouseDidMoveOverElement):
381         * UIProcess/WebPageProxy.h:
382         (WebKit::WebPageProxy::lastMouseMoveHitTestResult):
383         (WebKit::WebPageProxy::activeActionMenuHitTestResult): Deleted.
384         * UIProcess/mac/WKActionMenuController.mm:
385         (-[WKActionMenuController _defaultMenuItemsForLink]):
386         (-[WKActionMenuController _openURLFromActionMenu:]):
387         (-[WKActionMenuController _addToReadingListFromActionMenu:]):
388         (-[WKActionMenuController _quickLookURLFromActionMenu:]):
389         (-[WKActionMenuController _saveImageToDownloads:]):
390         (imageForResource:name::if):
391         (-[WKActionMenuController _updateActionMenuItems]):
392         Rename to the more accurate and general name.
393
394 2014-10-29  Tim Horton  <timothy_horton@apple.com>
395
396         Implement action menus for data detected items
397         https://bugs.webkit.org/show_bug.cgi?id=138178
398         <rdar://problem/18709436>
399
400         Reviewed by Anders Carlsson.
401
402         * Shared/API/c/WKActionMenuTypes.h:
403         Add a new type.
404
405         * Shared/WebHitTestResult.cpp:
406         (WebKit::WebHitTestResult::Data::Data):
407         (WebKit::WebHitTestResult::Data::encode):
408         (WebKit::WebHitTestResult::Data::decode):
409         * Shared/WebHitTestResult.h:
410         (WebKit::WebHitTestResult::isTextNode):
411         Determine, store, encode, and decode whether or not the hit node is a text node.
412
413         * Shared/mac/ActionMenuHitTestResult.h:
414         * Shared/mac/ActionMenuHitTestResult.mm: Renamed from Source/WebKit2/Shared/mac/ActionMenuHitTestResult.cpp.
415         (WebKit::ActionMenuHitTestResult::encode):
416         (WebKit::ActionMenuHitTestResult::decode):
417         Make ActionMenuHitTestResult an Obj-C++ file.
418         Store, encode, and decode (securely!) a DDActionContext and FloatRect
419         representing the bounding box of the data detected item, if any.
420
421         * UIProcess/API/mac/WKView.mm:
422         (-[WKView initWithFrame:context:configuration:webView:]):
423         (-[WKView willOpenMenu:withEvent:]): Deleted.
424         Stop using willOpenMenu; we'll use NSMenuDelegate's menuNeedsUpdate: instead.
425         Hook up WKActionMenuController as our action menu's delegate.
426
427         * UIProcess/mac/WKActionMenuController.mm:
428         (-[WKActionMenuController prepareForMenu:withEvent:]):
429         Call _updateActionMenuItems *after* we've adjusted _state, so that it
430         can depend on the value being correct.
431
432         (-[WKActionMenuController willOpenMenu:withEvent:]):
433         (-[WKActionMenuController didPerformActionMenuHitTest:]):
434         Move menu updating to menuNeedsUpdate for more accurate timing.
435
436         (_updateActionMenuItems):
437         When building the menu, if we have a text node that is not a link,
438         and hit a data detected item, retrieve the menu from the DDActionContext.
439         If we have nothing, make sure to reset _type, and if the final hit-test
440         is still pending, build a menu with a dummy item.
441
442         * WebKit2.xcodeproj/project.pbxproj:
443         * WebProcess/WebPage/WebPage.cpp:
444         (WebKit::WebPage::performActionMenuHitTestAtLocation): Moved to WebPageMac.
445         * WebProcess/WebPage/mac/WebPageMac.mm:
446         (WebKit::rangeExpandedAroundPosition):
447         Factor this out of performDictionaryLookupAtLocation.
448
449         (WebKit::WebPage::performDictionaryLookupAtLocation):
450         Make use of rangeExpandedAroundPosition.
451
452         (WebKit::scanForDataDetectedItems):
453         Expand to four lines of context around the hit point.
454         Convert that range to plain text, and feed it to DataDetectors.
455         Find the result that intersects the hit point, and make a DDActionContext
456         for it. Also, store the bounding box of the first quad of the detected
457         text, to provide to Data Detectors as a hint for UI placement.
458
459         (WebKit::WebPage::performActionMenuHitTestAtLocation):
460         If the hit node is a text node, call scanForDataDetectedItems and
461         store the resultant DDActionContext and bounding rect on our
462         ActionMenuHitTestResult for transfer to the UI process.
463
464 2014-10-29  Joseph Pecoraro  <pecoraro@apple.com>
465
466         [iOS] iPad: Occasional <select> crashes attempting to scroll to non-existing row 0 in viewWillAppear
467         https://bugs.webkit.org/show_bug.cgi?id=138165
468
469         Reviewed by David Kilzer.
470
471         This is a speculative fix for a crash attempting to scroll to a row in a
472         select picker on iPad. In these cases we are trying to scroll to the first
473         row of the first section, but no such row appears to exist. I was unable
474         to reproduce the issue, but if it is happening we should be able to protect
475         safely protect against crashing.
476
477         * UIProcess/ios/forms/WKFormSelectPopover.mm:
478         (-[WKSelectTableViewController viewWillAppear:]):
479         Protect against trying to scroll to a section/row that does not exist
480         by pre-checking that the section/row is valid.
481
482 2014-10-28  Ting-Wei Lan  <lantw44@gmail.com>
483
484         Cast std::chrono::duration.count() to int64_t in ArgumentCoder
485         https://bugs.webkit.org/show_bug.cgi?id=136981
486
487         Reviewed by Alexey Proskuryakov.
488
489         Explicitly cast the return value of std::chrono::duration.count() to
490         a fixed-size interger type, which prevents compilation error when
491         the return value type matches neither int32_t nor int64_t.
492
493         * Platform/IPC/ArgumentCoders.h:
494
495 2014-10-28  Jer Noble  <jer.noble@apple.com>
496
497         [EME] Pass location for media key storage through from WebKit/WebKit2.
498         https://bugs.webkit.org/show_bug.cgi?id=137120
499
500         Reviewed by Anders Carlsson.
501
502         Allow the location for media key storage to be passed into the WebProcess from the UIProcess
503         through the WebContextConfiguraiton struct.
504
505         * Shared/WebProcessCreationParameters.cpp:
506         (WebKit::WebProcessCreationParameters::encode): Add mediaKeysStorageDirectory.
507         (WebKit::WebProcessCreationParameters::decode): Ditto.
508         * Shared/WebProcessCreationParameters.h:
509         * UIProcess/API/C/WKContextConfigurationRef.cpp:
510         (WKContextConfigurationCopyMediaKeysStorageDirectory): Added getter.
511         (WKContextConfigurationSetMediaKeysStorageDirectory): Added setter.
512         * UIProcess/API/C/WKContextConfigurationRef.h:
513         * UIProcess/API/C/WKOriginDataManager.h:
514         * UIProcess/API/Cocoa/WKProcessPool.mm:
515         (-[WKProcessPool _initWithConfiguration:]): Provide a default location.
516         * UIProcess/APIContextConfiguration.cpp:
517         (API::ContextConfiguration::webContextConfiguration): Set mediaKeysStorageDirectory.
518         * UIProcess/APIContextConfiguration.h:
519         (API::ContextConfiguration::mediaKeysStorageDirectory): Added getter.
520         (API::ContextConfiguration::setMediaKeysStorageDirectory): Added setter.
521         * UIProcess/WebContext.cpp:
522         (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults): Apply mediaKeysStorageDirectory.
523         (WebKit::WebContext::WebContext): Initialize m_mediaKeysStorageDirectory.
524         (WebKit::WebContext::createNewWebProcess): Create a sandbox extension handle for mediaKeysStorageDirectory.
525         * UIProcess/WebContext.h:
526         * UIProcess/efl/WebContextEfl.cpp:
527         (WebKit::WebContext::platformDefaultMediaKeysStorageDirectory): Return a default location.
528         * UIProcess/gtk/WebContextGtk.cpp:
529         (WebKit::WebContext::platformDefaultMediaKeysStorageDirectory): Ditto.
530         * UIProcess/mac/WebContextMac.mm:
531         (WebKit::WebContext::platformDefaultMediaKeysStorageDirectory): Return an overridable default location.
532         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp: Added.
533         (WebKit::WebMediaKeyStorageManager::initialize): Pull the mediaKeysStorageDirectory out of configuration.
534         (WebKit::WebMediaKeyStorageManager::supplementName): Return a configuration name.
535         (WebKit::WebMediaKeyStorageManager::mediaKeyStorageDirectoryForOrigin): Return the
536             correct storage directory based on the SecureOrigin.
537         (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins): Return the origins within the
538             storage directory.
539         (WebKit::removeAllMediaKeyStorageForOriginPath): Static, remove contents and directory at path.
540         (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesForOrigin): Use
541             removeAllMediaKeyStorageForOriginPath to remove origin data.
542         (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesModifiedBetweenDates): Ditto.
543         (WebKit::WebMediaKeyStorageManager::deleteAllMediaKeyEntries): Ditto.
544         * WebProcess/MediaCache/WebMediaKeyStorageManager.h: Added.
545         (WebKit::WebMediaKeyStorageManager::WebMediaKeyStorageManager): Default constructor.
546         (WebKit::WebMediaKeyStorageManager::~WebMediaKeyStorageManager): Default virtual destructor.
547         (WebKit::WebMediaKeyStorageManager::mediaKeyStorageDirectory): Simple accessor.
548         * WebProcess/WebProcess.cpp:
549         (WebKit::WebProcess::WebProcess): Add WebMediaKeyStorageManager as a supplement.
550         * WebProcess/cocoa/WebProcessCocoa.mm:
551         (WebKit::WebProcess::platformInitializeWebProcess): Create a sandbox extension from the sandbox extension handle.
552
553         Add new source files to project(s).
554
555         * PlatformEfl.cmake:
556         * PlatformGTK.cmake:
557         * WebKit2.xcodeproj/project.pbxproj:
558         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
559         (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins):
560         (WebKit::removeAllMediaKeyStorageForOriginPath):
561
562         Drive-by fix: references to VoidCallback are ambiguous, since the same name is re-used in multiple namespaces.
563         Make references to WebCore::VoidCallback explicit where the entire WebCore (and other) namespaces are pulled in.
564
565         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
566         (WebKit::NotificationPermissionRequestManager::startRequest):
567         (WebKit::NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision):
568         * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
569         (WebKit::WebNotificationClient::requestPermission):
570
571 2014-10-28  Jeremy Jones  <jeremyj@apple.com>
572
573         Add optimized fullscreen mode.
574         https://bugs.webkit.org/show_bug.cgi?id=138044
575
576         Reviewed by Anders Carlsson.
577
578         Enable different types of fullscreen video behavior.
579         Add an enum parameter to enterVideoFullscreenForVideoElement for alternate types of fullscreen.
580
581         * UIProcess/ios/WebVideoFullscreenManagerProxy.h: Add fullscreenType parameter
582         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: ditto
583         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
584         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): ditto
585         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
586         (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement): ditto
587         * WebProcess/WebCoreSupport/WebChromeClient.h: ditto
588         * WebProcess/ios/WebVideoFullscreenManager.h: ditto
589         * WebProcess/ios/WebVideoFullscreenManager.mm:
590         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): ditto
591         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): ditto
592
593 2014-10-28  Dan Bernstein  <mitz@apple.com>
594
595         Added a Radar reference to a comment.
596
597         * Shared/mac/WebCoreArgumentCodersMac.mm:
598         (IPC::ArgumentCoder<Credential>::encodePlatformData):
599
600 2014-10-28  Dan Bernstein  <mitz@apple.com>
601
602         [Cocoa] REGERESSION (r171801): Client certificate authentication is failing
603         https://bugs.webkit.org/show_bug.cgi?id=138144
604
605         Reviewed by Alexey Proskuryakov.
606
607         NSURLCredential’s implementation of NSSecureCoding fails to encode identity-based
608         credentials properly. Work around that by encoding the identity, certificate, and
609         persistence individually.
610
611         * Shared/mac/WebCoreArgumentCodersMac.mm:
612         (IPC::ArgumentCoder<Credential>::encodePlatformData):
613         (IPC::ArgumentCoder<Credential>::decodePlatformData):
614
615 2014-10-28  Joseph Pecoraro  <pecoraro@apple.com>
616
617         [iOS] iPhone should not allow selecting <optgroup> in <select multiple>
618         https://bugs.webkit.org/show_bug.cgi?id=137991
619
620         Reviewed by Darin Adler.
621
622         We seem to be getting the delegate when we are not supposed to.
623         Workaround the issue as best we can by reseting the styles
624         for the group's content view and not changing selections.
625
626         * UIProcess/ios/forms/WKFormSelectPicker.mm:
627         (-[WKMultipleSelectPicker pickerView:row:column:checked:]):
628
629 2014-10-28  Tim Horton  <timothy_horton@apple.com>
630
631         Remove an inaccurate comment in WKActionMenuController
632         https://bugs.webkit.org/show_bug.cgi?id=138135
633
634         Reviewed by Anders Carlsson.
635
636         * UIProcess/mac/WKActionMenuController.mm:
637         (-[WKActionMenuController _defaultMenuItemsForLink]):
638         The comment is wrong; the separator is there for spacing, not just as a workaround.
639
640 2014-10-28  Carlos Garcia Campos  <cgarcia@igalia.com>
641
642         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.7.1 release.
643
644         * gtk/NEWS: Add release notes for 2.7.1.
645
646 2014-10-28  Dan Bernstein  <mitz@apple.com>
647
648         [Mac] OS X Mavericks build broken with public SDK
649         https://bugs.webkit.org/show_bug.cgi?id=138108
650
651         Reviewed by Mark Rowe.
652
653         * Shared/API/Cocoa/WKFoundation.h: Only define the NSEventModifierFlags type when using a
654         version of the OS X SDK that doesn’t define it.
655
656 2014-10-27  Conrad Shultz  <conrad_shultz@apple.com>
657
658         NSSharingService protocol conformance should be internal to WKActionMenuController
659         https://bugs.webkit.org/show_bug.cgi?id=138112
660
661         Reviewed by Tim Horton.
662
663         * UIProcess/mac/WKActionMenuController.h:
664         * UIProcess/mac/WKActionMenuController.mm:
665         Move protocol conformance from the interface to a class extension.
666
667 2014-10-27  Enrica Casucci  <enrica@apple.com>
668
669         WebContent crash in WebKit::WebPage::expandedRangeFromHandle.
670         https://bugs.webkit.org/show_bug.cgi?id=138023
671         rdar://problem/18787412
672
673         Reviewed by Ryosuke Niwa.
674
675         We must change that we have a valid currentRange before trying
676         to expand or contract.
677
678         * WebProcess/WebPage/ios/WebPageIOS.mm:
679         (WebKit::WebPage::changeBlockSelection):
680
681 2014-10-27  Alexey Proskuryakov  <ap@apple.com>
682
683         http/tests/cookies/third-party-cookie-relaxing.html is flaky on bots
684         https://bugs.webkit.org/show_bug.cgi?id=138098
685
686         Reviewed by Anders Carlsson.
687
688         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
689         * WebProcess/com.apple.WebProcess.sb.in:
690         Update for the new name of testing session. Memory regions are now of the form
691         "WebKit Test-<pid>-0".
692
693 2014-10-27  Chris Dumez  <cdumez@apple.com>
694
695         Use separate HashMaps for common and uncommon headers in HTTPHeaderMap
696         https://bugs.webkit.org/show_bug.cgi?id=138079
697
698         Reviewed by Anders Carlsson.
699
700         Update the WK2 IPC HTTPHeaderMap serialization / deserialization code
701         to leverage the fact that HTTPHeaderMap now stores common HTTP headers
702         and uncommon one in separate HashMaps. This speeds up deserialization
703         as we no longer need to call findHTTPHeaderName() for every decoded
704         header. We already know if the header is a common one or not, and if
705         it is then we already have a HTTPHeaderName type instead of a String.
706
707         I see that we spend ~40% less time in HTTPHeaderMap decoding when
708         loading http://flickr.com/explore, while the encoding takes about
709         the same amount of time as before.
710
711         * Shared/WebCoreArgumentCoders.cpp:
712         (IPC::ArgumentCoder<HTTPHeaderMap>::encode):
713         (IPC::ArgumentCoder<HTTPHeaderMap>::decode):
714
715 2014-10-24  Benjamin Poulain  <bpoulain@apple.com>
716
717         Fix the iOS build
718
719         * Configurations/WebKit.xcconfig:
720
721 2014-10-24  Beth Dakin  <bdakin@apple.com>
722
723         _actionMenuItemsForHitTestResult should also take a type indicating what the menu 
724         was built for
725         https://bugs.webkit.org/show_bug.cgi?id=138063
726
727         Reviewed by Dan Bernstein.
728
729         New type enum that can be used by clients.
730         * Shared/API/c/WKActionMenuTypes.h: Added.
731
732         Remove the old SPI and add the new.
733         * UIProcess/API/Cocoa/WKViewPrivate.h:
734         * UIProcess/API/mac/WKView.mm:
735         (-[WKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:]):
736         (-[WKView _actionMenuItemsForHitTestResult:defaultActionMenuItems:]): Deleted.
737
738         Now keep an ivar for the type.
739         * UIProcess/mac/WKActionMenuController.h:
740
741         Create a category for the old SPI so that we can still call it if clients have 
742         implemented it.
743         * UIProcess/mac/WKActionMenuController.mm:
744         (-[WKActionMenuController initWithPage:view:]):
745         (-[WKActionMenuController didCloseMenu:withEvent:]):
746         (imageForResource:name::if):
747         (-[WKActionMenuController _updateActionMenuItems]):
748         * WebKit2.xcodeproj/project.pbxproj:
749
750 2014-10-24  Tim Horton  <timothy_horton@apple.com>
751
752         Share sheet doesn't attach to the window
753         https://bugs.webkit.org/show_bug.cgi?id=138062
754         <rdar://problem/18767397>
755
756         Reviewed by Beth Dakin.
757
758         * UIProcess/mac/WKActionMenuController.h:
759         WKActionMenuController is now a NSSharingService{Picker}Delegate.
760
761         * UIProcess/mac/WKActionMenuController.mm:
762         (-[WKActionMenuController _defaultMenuItemsForImage]):
763         Set us up as the NSSharingServicePicker delegate.
764
765         (-[WKActionMenuController sharingServicePicker:delegateForSharingService:]):
766         Set us up as the NSSharingService delegate.
767
768         (-[WKActionMenuController sharingService:sourceWindowForShareItems:sharingContentScope:]):
769         Return the appropriate window to attach to.
770
771 2014-10-24  Jer Noble  <jer.noble@apple.com>
772
773         Abstractify WebOriginDataManager to support arbitrary ChildProcess supplements.
774         https://bugs.webkit.org/show_bug.cgi?id=137993
775
776         Reviewed by Brady Eidson.
777
778         To allow different ChildProcess subclasses to handle listing and deletion of origin
779         data, make WebOriginDataManager more generic by having a supplement implement the
780         details, leaving WebOriginDataManager to deal with cross-process messaging.
781
782         De-virtualize AsyncTask, allowing a task to be created by passing in a
783         function<void()>, rather than an object, method, and arguments.
784
785         * Shared/AsyncTask.h:
786         (WebKit::AsyncTask::AsyncTask):
787         (WebKit::AsyncTask::performTask):
788         (WebKit::AsyncTask::~AsyncTask): Deleted.
789
790         Add a new virtual base class, to be implemented by various ChildProcesses, which
791         WebOriginDataManager will use to implement listing and deletion requests.
792
793         * WebProcess/OriginData/WebOriginDataManager.h:
794         * WebProcess/OriginData/WebOriginDataManagerSupplement.h: Added.
795         (WebKit::WebOriginDataManagerSupplement::WebOriginDataManagerSupplement):
796         (WebKit::WebOriginDataManagerSupplement::~WebOriginDataManagerSupplement):
797         (WebKit::WebOriginDataManagerSupplement::getOrigins):
798         (WebKit::WebOriginDataManagerSupplement::deleteEntriesForOrigin):
799         (WebKit::WebOriginDataManagerSupplement::deleteEntriesModifiedBetweenDates):
800         (WebKit::WebOriginDataManagerSupplement::deleteAllEntries):
801         * WebKit2.xcodeproj/project.pbxproj:
802
803         WebOriginDataManager doesn't need to be a ChildSupplement. Remove the DatabaseProcess-
804         specific implementations for its message handlers and replace with clean, generic calls
805         to its supplement. Because these supplements may want to respond to the request
806         asynchronously, pass a completion function in to be called by the supplement once its
807         work is complete.
808
809         * WebProcess/OriginData/WebOriginDataManager.cpp:
810         (WebKit::WebOriginDataManager::WebOriginDataManager):
811         (WebKit::WebOriginDataManager::getOrigins):
812         (WebKit::WebOriginDataManager::deleteEntriesForOrigin):
813         (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates):
814         (WebKit::WebOriginDataManager::deleteAllEntries):
815         (WebKit::WebOriginDataManager::supplementName): Deleted.
816
817         DatabaseProcess already uses WebOriginDataManager, so it will be the first process
818         to fall under the heel of the new regime. DatabaseProcess will subclass
819         WebOriginDataManagerSupplement, and pass itself in twice to the WebOriginDataManager
820         constructor. Create a lambda-based AsyncTask for each request, and call the completion
821         function when each request is complete.
822
823         * DatabaseProcess/DatabaseProcess.cpp:
824         (WebKit::DatabaseProcess::DatabaseProcess):
825         (WebKit::DatabaseProcess::getIndexedDatabaseOrigins):
826         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin):
827         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedBetweenDates):
828         (WebKit::DatabaseProcess::deleteAllIndexedDatabaseEntries):
829         (WebKit::DatabaseProcess::getOrigins):
830         (WebKit::DatabaseProcess::deleteEntriesForOrigin):
831         (WebKit::DatabaseProcess::deleteEntriesModifiedBetweenDates):
832         (WebKit::DatabaseProcess::deleteAllEntries):
833         (WebKit::DatabaseProcess::doGetIndexedDatabaseOrigins): Deleted.
834         (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesForOrigin): Deleted.
835         (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesModifiedBetweenDates): Deleted.
836         (WebKit::DatabaseProcess::doDeleteAllIndexedDatabaseEntries): Deleted.
837         * DatabaseProcess/DatabaseProcess.h:
838
839 2014-10-24  Beth Dakin  <bdakin@apple.com>
840
841         Very large images crash in action menu code
842         https://bugs.webkit.org/show_bug.cgi?id=138059
843         -and corresponding-
844         rdar://problem/18767859
845
846         Reviewed by Tim Horton.
847
848         If the HitTestResult failed to create and image, then don’t go for the image 
849         action menu.
850         * UIProcess/mac/WKActionMenuController.mm:
851         (-[WKActionMenuController _defaultMenuItems]):
852
853         ShareableBitmap::createShareable() can fail. The result needs to be null-checked.
854         * WebProcess/WebPage/WebPage.cpp:
855         (WebKit::WebPage::performActionMenuHitTestAtLocation):
856
857 2014-10-24  Beth Dakin  <bdakin@apple.com>
858
859         Build fix.
860
861         * UIProcess/mac/WKActionMenuController.h:
862         * UIProcess/mac/WKActionMenuController.mm:
863
864 2014-10-24  Tim Horton  <timothy_horton@apple.com>
865
866         Blindly try to fix all the builds.
867
868         * UIProcess/mac/WKActionMenuController.h:
869         * UIProcess/mac/WKActionMenuController.mm:
870
871 2014-10-24  Timothy Horton  <timothy_horton@apple.com>
872
873         Blindly try to fix all the builds.
874
875         * UIProcess/mac/WKActionMenuController.h:
876
877 2014-10-24  Timothy Horton  <timothy_horton@apple.com>
878
879         Blindly try to fix the 32-bit build.
880
881         * UIProcess/mac/WKActionMenuController.h:
882         * UIProcess/mac/WKActionMenuController.mm:
883
884 2014-10-24  Tim Horton  <timothy_horton@apple.com>
885
886         [Mac][WebKit2] Move action menu code into its own file
887         https://bugs.webkit.org/show_bug.cgi?id=138034
888         <rdar://problem/18758758>
889
890         * UIProcess/mac/WKActionMenuController.mm:
891         (-[WKActionMenuController prepareForMenu:withEvent:]):
892         (-[WKActionMenuController _addImageToPhotos:]):
893         Review comments that were not previously addressed.
894
895 2014-10-24  Tim Horton  <timothy_horton@apple.com>
896
897         [Mac][WebKit2] Move action menu code into its own file
898         https://bugs.webkit.org/show_bug.cgi?id=138034
899         <rdar://problem/18758758>
900
901         Reviewed by Dan Bernstein.
902
903         * UIProcess/API/mac/WKView.mm:
904         (-[WKView initWithFrame:context:configuration:webView:]):
905         Make a WKActionMenuController if needed.
906
907         (-[WKView prepareForMenu:withEvent:]):
908         (-[WKView willOpenMenu:withEvent:]):
909         (-[WKView didCloseMenu:withEvent:]):
910         (-[WKView _didPerformActionMenuHitTest:]):
911         Forward these to WKActionMenuController.
912
913         (-[WKView _openURLFromActionMenu:]): Deleted.
914         (-[WKView _addToReadingListFromActionMenu:]): Deleted.
915         (-[WKView _quickLookURLFromActionMenu:]): Deleted.
916         (-[WKView _createActionMenuItemForTag:]): Deleted.
917         (webKitBundleImageNamed): Deleted.
918         (-[WKView _copyImage:]): Deleted.
919         (-[WKView _saveImageToDownloads:]): Deleted.
920         (temporaryPhotosDirectoryPath): Deleted.
921         (pathToPhotoOnDisk): Deleted.
922         (-[WKView _addImageToPhotos:]): Deleted.
923         (-[WKView _defaultMenuItemsForImage]): Deleted.
924         (-[WKView _defaultMenuItems]): Deleted.
925         (-[WKView _updateActionMenu]): Deleted.
926         Moved to WKActionMenuController.
927
928         * UIProcess/mac/WKActionMenuController.h: Added.
929         * UIProcess/mac/WKActionMenuController.mm: Added.
930         (-[WKActionMenuController initWithPage:view:]):
931         (-[WKActionMenuController prepareForMenu:withEvent:]):
932         (-[WKActionMenuController willOpenMenu:withEvent:]):
933         (-[WKActionMenuController didCloseMenu:withEvent:]):
934         (-[WKActionMenuController didPerformActionMenuHitTest:]):
935         (-[WKActionMenuController _defaultMenuItemsForLink]):
936         (-[WKActionMenuController _openURLFromActionMenu:]):
937         (-[WKActionMenuController _addToReadingListFromActionMenu:]):
938         (-[WKActionMenuController _quickLookURLFromActionMenu:]):
939         (-[WKActionMenuController _defaultMenuItemsForImage]):
940         (-[WKActionMenuController _copyImage:]):
941         (-[WKActionMenuController _saveImageToDownloads:]):
942         (temporaryPhotosDirectoryPath):
943         (pathToPhotoOnDisk):
944         (-[WKActionMenuController _addImageToPhotos:]):
945         (-[WKActionMenuController _createActionMenuItemForTag:]):
946         (webKitBundleImageNamed):
947         (imageForResource:name::if):
948         (-[WKActionMenuController _updateActionMenuItems]):
949         Moved from WKView.
950
951         * WebKit2.xcodeproj/project.pbxproj:
952
953 2014-10-24  Marcos Chavarría Teijeiro  <chavarria1991@gmail.com>
954
955         [GTK] Implement is_selected method on WebKitHitTestResult
956         https://bugs.webkit.org/show_bug.cgi?id=137110
957
958         Reviewed by Tim Horton.
959
960         Expose CONTEXT_SELECTION for WebKitHitTestResult.
961
962         * Shared/WebHitTestResult.cpp: Add is_selected field and getter for this field.
963         (WebKit::WebHitTestResult::Data::Data):
964         (WebKit::WebHitTestResult::Data::encode):
965         (WebKit::WebHitTestResult::Data::decode):
966         * Shared/WebHitTestResult.h:
967         (WebKit::WebHitTestResult::isSelected):
968         * UIProcess/API/gtk/WebKitHitTestResult.cpp: Add WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION context and method to check it.
969         (webkitHitTestResultCreate):
970         (webkitHitTestResultCompare):
971         (webkit_hit_test_result_context_is_selection):
972         * UIProcess/API/gtk/WebKitHitTestResult.h:
973         * UIProcess/API/gtk/WebKitWebView.cpp: Modify context-menu callback to set the new context option.
974         (webkitWebViewPopulateContextMenu):
975         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add documentation about new function.
976
977 2014-10-23  Carlos Garcia Campos  <cgarcia@igalia.com>
978
979         [GTK][Cairo] Remove GTK dependency of WidgetBackingStoreGtkX11
980         https://bugs.webkit.org/show_bug.cgi?id=138004
981
982         Reviewed by Gustavo Noronha Silva.
983
984         * UIProcess/BackingStore.h: Rename m_backingStore as m_backend,
985         since it's a bit confusing that a BackingStore class has a
986         m_backingStore member and WidgetBackingStore has been renamed as
987         BackingStoreBackendCairo.
988         * UIProcess/cairo/BackingStoreCairo.cpp:
989         (WebKit::BackingStore::createBackend): Helper function to create
990         the BackingStore backend depending on the platform.
991         (WebKit::BackingStore::paint): Use m_backend instead of m_backingStore.
992         (WebKit::BackingStore::incorporateUpdate): Ditto.
993         (WebKit::BackingStore::scroll): Ditto.
994         (WebKit::createBackingStoreForGTK): Deleted.
995
996 2014-10-23  Benjamin Poulain  <bpoulain@apple.com>
997
998         Fix a bad find-and-replace in r175153
999
1000         Looks like I messed up the commit on landing.
1001
1002         * UIProcess/WebPageProxy.cpp:
1003         (WebKit::WebPageProxy::WebPageProxy):
1004         (WebKit::WebPageProxy::didCommitLoadForFrame):
1005
1006 2014-10-23  Benjamin Poulain  <bpoulain@apple.com>
1007
1008         [iOS WK2] If a page has the exact same VisibleContentRect as the page before, its VisibleContentRectUpdate can be ignored
1009         https://bugs.webkit.org/show_bug.cgi?id=138031
1010         rdar://problem/18739335
1011
1012         Reviewed by Simon Fraser.
1013
1014         Since any VisibleContentRectUpdate is costly for the WebProcess, we avoid sending updates
1015         if none of the important parameters have changed (scale and geometry).
1016
1017         One unintended side effect is that the update of a page can be blocked if the parameters
1018         of the previous page were identical.
1019
1020         What happen is this:
1021         1) Page [A] sends its content rect update as needed. WebPageProxy saves the last update
1022            in m_lastVisibleContentRectUpdate and use that value to avoid useless updates.
1023         2) Page [B] load after page [A] and have the exact VisibleContentRect. When receiving the first
1024            layer tree commit after didCommitLoadForFrame, WKWebView sends its VisibleContentRect
1025            to WebPageProxy to synchronize the state of the WebProcess with what is on screen.
1026         3) Since the two VisibleContentRect update has the same value as the ones of page [A], WebPageProxy
1027            discards the update. The WebProcess has its initialization viewport and is not udpated until
1028            a major parameter changes (scale or position).
1029
1030         In rdar://problem/18739335, the problem is the similar but with a different failure point:
1031         1) Everything above happened already.
1032         2) The layer tree transaction has a scrolling request. This is processed by WKWebView.
1033         3) Since the scrolling position is invalid, the request is ignored and we send the last
1034            VisibleContentRect to the WebProcess with WebPageProxy::resendLastVisibleContentRects().
1035         4) Since the VisibleContentRect was never updated after didCommitLoadForFrame, the one we send
1036            is for the previous page, which the web process correctly ignores.
1037
1038         This patch solves the problem by nuking the cached m_lastVisibleContentRectUpdate before
1039         any valid VisibleContentRectUpdate for a new page.
1040
1041         * UIProcess/WebPageProxy.cpp:
1042         (WebKit::WebPageProxy::WebPageProxy):
1043         (WebKit::WebPageProxy::didCommitLoadForFrame):
1044         * UIProcess/WebPageProxy.h:
1045         * UIProcess/ios/WebPageProxyIOS.mm:
1046         (WebKit::WebPageProxy::didCommitLayerTree):
1047
1048 2014-10-23  Joseph Pecoraro  <pecoraro@apple.com>
1049
1050         Web Inspector: Provide a way to have alternate inspector agents
1051         https://bugs.webkit.org/show_bug.cgi?id=137901
1052
1053         Reviewed by Brian Burg.
1054
1055         * Configurations/FeatureDefines.xcconfig:
1056
1057 2014-10-23  Tim Horton  <timothy_horton@apple.com>
1058
1059         Add some SPI headers for NSExtension and NSSharingService{Picker}
1060         https://bugs.webkit.org/show_bug.cgi?id=138027
1061
1062         Reviewed by Anders Carlsson.
1063
1064         * UIProcess/API/mac/WKView.mm:
1065         * UIProcess/mac/ServicesController.mm:
1066         * UIProcess/mac/WebContextMenuProxyMac.mm:
1067         Replace redefinitions with SPI header #imports.
1068
1069 2014-10-23  Benjamin Poulain  <bpoulain@apple.com>
1070
1071         [iOS WK2] Make sure any dynamic viewport update schedules a layer tree commit
1072         https://bugs.webkit.org/show_bug.cgi?id=138021
1073
1074         Reviewed by Simon Fraser.
1075
1076         * WebProcess/WebPage/ios/WebPageIOS.mm:
1077         (WebKit::WebPage::dynamicViewportSizeUpdate):
1078         Sometimes, the clients can do a dynamic viewport update but only change the minimum
1079         layout size (see rdar://problem/18755250).
1080
1081         When that happens, it is possible to do the full state update without ever scheduling
1082         a layer tree commit. For example, if the new minimum layout height is only a few pixels
1083         smaller than the old value and the layout of the page is equal or larger than the old value,
1084         the layout is done without any side effect to the content (assuming a viewport configuration
1085         based on width).
1086
1087         The contract with the client is that the next layer tree commit after a dynamic viewport update
1088         carries all the valid parameters for the new viewport size. Since the new layout never scheduled
1089         a layer tree commit, the UIProcess is just waiting for one, discarding all input.
1090
1091         This patch solves the issue by explicitely scheduling a layer flush after updating all the layout
1092         and view parameters to their final values. In most cases, this makes no difference since a layer
1093         tree commit was already scheduled. In the rare cases where nothing was scheduled, scheduling
1094         the layer tree commit ensure we unlock the UIProcess.
1095
1096 2014-10-23  Ryosuke Niwa  <rniwa@webkit.org>
1097
1098         WebContent crash in WebKit::WebPage::expandedRangeFromHandle
1099         https://bugs.webkit.org/show_bug.cgi?id=138023
1100
1101         Reviewed by Enrica Casucci.
1102
1103         The crashes are caused by rangeForBlockAtPoint returning a null Range.
1104         Exit early or continue if a range is null in various places.
1105
1106         * WebProcess/WebPage/ios/WebPageIOS.mm:
1107         (WebKit::WebPage::expandedRangeFromHandle): Continue looking for another point if the range returned by
1108         rangeForBlockAtPoint is null.
1109         (WebKit::WebPage::contractedRangeFromHandle): Ditto.
1110         (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): Removed the FIXME now that Enrica has
1111         verified that this early exit added in r173788 is correct.
1112
1113 2014-10-23  Joseph Pecoraro  <pecoraro@apple.com>
1114
1115         [iOS] iPhone unselecting items in <select multiple> shows incorrect values selected
1116         https://bugs.webkit.org/show_bug.cgi?id=137989
1117
1118         Reviewed by Alexey Proskuryakov.
1119
1120         * UIProcess/ios/forms/WKFormSelectPicker.mm:
1121         (-[WKMultipleSelectPicker pickerView:row:column:checked:]):
1122         The second argument is "allowsMultipleSelection" and should only be set
1123         when we are making a selection in a <select multiple>.
1124
1125 2014-10-23  Tim Horton  <timothy_horton@apple.com>
1126
1127         Assertion failures in ImageKit soft linking
1128         https://bugs.webkit.org/show_bug.cgi?id=138009
1129
1130         Reviewed by Anders Carlsson.
1131
1132         * UIProcess/API/mac/WKView.mm:
1133         Soft-link ImageKit correctly.
1134         ImageKit is inside the Quartz umbrella framework.
1135
1136 2014-10-23  Daniel Bates  <dabates@apple.com>
1137
1138         [iOS] Fix the build after <http://trac.webkit.org/changeset/175079>
1139         (https://bugs.webkit.org/show_bug.cgi?id=137995)
1140
1141         Rubber-stamped by Anders Carlsson.
1142
1143         Remove PageClientImpl::didPerformActionMenuHitTest() for iOS.
1144
1145         * UIProcess/ios/PageClientImplIOS.h:
1146         * UIProcess/ios/PageClientImplIOS.mm:
1147         (WebKit::PageClientImpl::didPerformActionMenuHitTest): Deleted.
1148
1149 2014-10-23  Krzysztof Czech  <k.czech@samsung.com>
1150
1151         [EFL] Fix build problem after r175098
1152         https://bugs.webkit.org/show_bug.cgi?id=138002
1153
1154         Reviewed by Gyuyoung Kim.
1155
1156         Add ECORE_X dependency to avoid linking problems while building unit tests.
1157
1158         * PlatformEfl.cmake:
1159
1160 2014-10-23  Krzysztof Czech  <k.czech@samsung.com>
1161
1162         [EFL] Set proper default value for WebPageAccessibilityObject
1163         https://bugs.webkit.org/show_bug.cgi?id=137951
1164
1165         Reviewed by Csaba Osztrogonác.
1166
1167         Initial value for WebPageAccessibilityObject should be nullptr.
1168
1169         * WebProcess/WebPage/WebPage.cpp:
1170         (WebKit::WebPage::WebPage):
1171
1172 2014-10-23  Krzysztof Czech  <k.czech@samsung.com>
1173
1174         [EFL] Introduce EFL Accessibility in WebKit
1175         https://bugs.webkit.org/show_bug.cgi?id=137819
1176
1177         Reviewed by Gyuyoung Kim.
1178
1179         EFL Accessibility provides an API that is used to notify clients that certain
1180         Accessibility events occur. Utilizing it makes WebKit-EFL coherent with EFL native
1181         accessibility approach.
1182
1183         * PlatformEfl.cmake:
1184         * UIProcess/API/efl/EwkView.cpp:
1185         (EwkView::EwkView):
1186         * UIProcess/API/efl/EwkView.h:
1187         (EwkView::webAccessibility):
1188         * UIProcess/API/efl/WebAccessibility.cpp: Added.
1189         (WebKit::WebAccessibility::WebAccessibility):
1190         (WebKit::WebAccessibility::~WebAccessibility):
1191         (WebKit::WebAccessibility::eventHandler):
1192         (WebKit::WebAccessibility::executeGestureAction):
1193         (WebKit::WebAccessibility::activate):
1194         (WebKit::WebAccessibility::read):
1195         (WebKit::WebAccessibility::readNext):
1196         (WebKit::WebAccessibility::readPrev):
1197         (WebKit::WebAccessibility::up):
1198         (WebKit::WebAccessibility::down):
1199         (WebKit::WebAccessibility::scroll):
1200         (WebKit::WebAccessibility::mouse):
1201         (WebKit::WebAccessibility::enable):
1202         (WebKit::WebAccessibility::disable):
1203         * UIProcess/API/efl/WebAccessibility.h: Added.
1204         (WebKit::WebAccessibility::activateAction):
1205         (WebKit::WebAccessibility::nextAction):
1206         (WebKit::WebAccessibility::prevAction):
1207         (WebKit::WebAccessibility::readAction):
1208         * UIProcess/API/efl/ewk_view.cpp:
1209         (ewk_view_accessibility_action_activate_get):
1210         (ewk_view_accessibility_action_next_get):
1211         (ewk_view_accessibility_action_prev_get):
1212         (ewk_view_accessibility_action_read_by_point_get):
1213         * UIProcess/API/efl/ewk_view.h:
1214         * UIProcess/API/efl/tests/test_ewk2_accessibility.cpp: Added.
1215         (EWK2Accessibility::xwindow):
1216         (TEST_F):
1217         * UIProcess/WebPageProxy.h:
1218         * UIProcess/efl/WebPageProxyEfl.cpp:
1219         (WebKit::WebPageProxy::accessibilityObjectReadByPoint):
1220         (WebKit::WebPageProxy::accessibilityObjectReadPrevious):
1221         (WebKit::WebPageProxy::accessibilityObjectReadNext):
1222
1223 2014-10-22  Benjamin Poulain  <bpoulain@apple.com>
1224
1225         [iOS WK2] Protect WKWebView dynamic viewport change against empty sizes
1226         https://bugs.webkit.org/show_bug.cgi?id=137988
1227         rdar://problem/17785162
1228
1229         Reviewed by Simon Fraser.
1230
1231         * UIProcess/API/Cocoa/WKWebView.mm:
1232         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1233         The algorithm behind dynamic size update finds the best content area to put in the viewport
1234         after a viewport change. If an initial size or a target size is empty, it is impossible to
1235         compute a reasonable area to keep in the view. We end up handling NaN scales
1236         and/or sizes and CoreAnimation raises an exception when applying that value.
1237
1238         This patch add early exits when that occurs and fallback to the common code.
1239
1240         On Input, things are easy. If any of the initial values is empty, we just execute the updateBlock
1241         without attempting any of the dynamic behaviors.
1242
1243         For the target values, things are trickier. We do not know what the values are going to be before we execute
1244         the block. But once we executed the block, we have already skipped all the setters that call the web process.
1245
1246         To handle that, every value is set manually on WebPageProxy. This is a bit unfortunate because the setters
1247         get yet another entry point.
1248
1249 2014-10-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1250
1251         EFL and GTK ports have broken since r175075
1252         https://bugs.webkit.org/show_bug.cgi?id=137995
1253
1254         Unreviewed, EFL and GTK ports build fix.
1255
1256         Need to use PLATFORM(MAC) guard for ActionMenuHitTest functions.
1257
1258         * UIProcess/PageClient.h:
1259         * UIProcess/WebPageProxy.cpp:
1260         (WebKit::WebPageProxy::removeNavigationGestureSnapshot):
1261         * UIProcess/WebPageProxy.h:
1262         * UIProcess/WebPageProxy.messages.in:
1263         * WebProcess/WebPage/WebPage.cpp:
1264         * WebProcess/WebPage/WebPage.h:
1265         * WebProcess/WebPage/WebPage.messages.in:
1266
1267 2014-10-22  Tim Horton  <timothy_horton@apple.com>
1268
1269         Add action menu support for images
1270         https://bugs.webkit.org/show_bug.cgi?id=137987
1271         <rdar://problem/18717767>
1272
1273         Reviewed by Anders Carlsson, Sam Weinig, and Beth Dakin.
1274
1275         * Resources/AddImageToPhotos.pdf: Added.
1276         * Resources/CopyImage.pdf: Added.
1277         * Resources/SaveImageToDownloads.pdf: Added.
1278         * Resources/ShareImage.pdf: Added.
1279         Add some temporary artwork.
1280
1281         * Scripts/webkit/messages.py:
1282         (struct_or_class):
1283         ActionMenuHitTestResult is a struct.
1284
1285         * Shared/API/c/WKActionMenuItemTypes.h:
1286         Add new items for image menus.
1287
1288         * Shared/mac/ActionMenuHitTestResult.cpp:
1289         (WebKit::ActionMenuHitTestResult::encode):
1290         (WebKit::ActionMenuHitTestResult::decode):
1291         For now, pass the hit image data across to the UI process as a ShareableBitmap.
1292
1293         * Shared/mac/ActionMenuHitTestResult.h:
1294
1295         * UIProcess/API/mac/WKView.mm:
1296         (-[WKView _createActionMenuItemForTag:]):
1297         Refactor action menu item creation into a single function, so that
1298         callers can share code and be much simpler.
1299
1300         (webKitBundleImageNamed):
1301         Add a helper to acquire an image from the WebKit2 bundle.
1302
1303         (-[WKView _copyImage:]):
1304         (-[WKView _saveImageToDownloads:]):
1305         (temporaryPhotosDirectoryPath):
1306         (pathToPhotoOnDisk):
1307         (-[WKView _addImageToPhotos:]):
1308         Add rudimentary implementations of image actions.
1309
1310         (-[WKView _defaultMenuItemsForImage]):
1311         Support the image menu, plus a submenu acquired from NSSharingServicePicker
1312         for the Share menu.
1313
1314         (-[WKView _defaultMenuItems]):
1315         Call _defaultMenuItemsForImage if needed.
1316
1317         (-[WKView _updateActionMenu]):
1318         Refactor _updateActionMenu out of prepareForMenu:withEvent:.
1319
1320         (-[WKView prepareForMenu:withEvent:]):
1321         Ask the Web process to re-hit-test under the location that the menu
1322         will appear. Mark the menu as pending.
1323
1324         (-[WKView _didPerformActionMenuHitTest:]):
1325         When we get the hit test reply, record the result for future use.
1326
1327         (-[WKView willOpenMenu:withEvent:]):
1328         If we got a hit test reply, rebuild the menu immediately. If not, wait
1329         up to 500ms for the reply to come in. This eventually needs to be
1330         cancellable if the menu is rejected in the interim.
1331
1332         (-[WKView didCloseMenu:withEvent:]):
1333         Clear all state when the menu closes.
1334
1335         * UIProcess/API/mac/WKViewInternal.h:
1336         * UIProcess/PageClient.h:
1337         * UIProcess/WebPageProxy.cpp:
1338         (WebKit::WebPageProxy::performActionMenuHitTestAtLocation):
1339         (WebKit::WebPageProxy::didPerformActionMenuHitTest):
1340         * UIProcess/WebPageProxy.h:
1341         * UIProcess/WebPageProxy.messages.in:
1342         * UIProcess/mac/PageClientImpl.h:
1343         * UIProcess/mac/PageClientImpl.mm:
1344         (WebKit::PageClientImpl::didPerformActionMenuHitTest):
1345         * UIProcess/ios/PageClientImplIOS.h:
1346         * UIProcess/ios/PageClientImplIOS.mm:
1347         * WebProcess/WebPage/WebPage.h:
1348         * WebProcess/WebPage/WebPage.messages.in:
1349         Plumb didPerformActionMenuHitTest back from WebPageProxy to WKView.
1350
1351         * WebProcess/WebPage/WebPage.cpp:
1352         (WebKit::WebPage::performActionMenuHitTestAtLocation):
1353         Hit test at the given location, recording the image data if there is any,
1354         and return the result to the UI process.
1355
1356         * WebKit2.xcodeproj/project.pbxproj:
1357         Add the PDFs.
1358
1359 2014-10-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1360
1361         Remove WidgetBackingStoreCairo::create() factory function
1362         https://bugs.webkit.org/show_bug.cgi?id=137943
1363
1364         Reviewed by Darin Adler.
1365
1366         WidgetBackingStoreCairo::create() can be replaced by std::make_unique<>.
1367         Thus this patch removes it, then use std::make_unique<>|std::unique_ptr<>.
1368
1369         * UIProcess/BackingStore.h:
1370         * UIProcess/cairo/BackingStoreCairo.cpp:
1371         (WebKit::createBackingStoreForGTK):
1372         (WebKit::BackingStore::incorporateUpdate):
1373
1374 2014-10-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1375
1376         Remove TextCheckerEnchant::create() factory function
1377         https://bugs.webkit.org/show_bug.cgi?id=137944
1378
1379         Reviewed by Darin Adler.
1380
1381         TextCheckerEnchant::create() can be replaced by std::make_unique<> and std::unique_ptr<>.
1382
1383         * UIProcess/API/gtk/WebKitTextChecker.cpp:
1384         (WebKitTextChecker::WebKitTextChecker):
1385         * UIProcess/API/gtk/WebKitTextChecker.h:
1386         * UIProcess/efl/TextCheckerClientEfl.cpp:
1387         (TextCheckerClientEfl::TextCheckerClientEfl):
1388         * UIProcess/efl/TextCheckerClientEfl.h:
1389
1390 2014-10-22  Antti Koivisto  <antti@apple.com>
1391
1392         Revert fix for REGRESSION (r173356): Safari can't install a profile, gets 'Download Failed error
1393         (https://bugs.webkit.org/show_bug.cgi?id=137493)
1394
1395         Turns out the root cause was a bug in MIME type sniffing, https://bugs.webkit.org/show_bug.cgi?id=137855
1396
1397         Remove the workaround.
1398
1399         * Shared/Downloads/ios/DownloadIOS.mm:
1400         (WebKit::Download::startWithHandle):
1401         * Shared/Downloads/mac/DownloadMac.mm:
1402         (WebKit::Download::startWithHandle):
1403
1404 2014-10-22  Beth Dakin  <bdakin@apple.com>
1405
1406         Remove action menu web preference
1407         https://bugs.webkit.org/show_bug.cgi?id=137975
1408
1409         Reviewed by Tim Horton.
1410
1411         * Shared/WebPreferencesDefinitions.h:
1412         * UIProcess/API/C/WKPreferences.cpp:
1413         (WKPreferencesSetActionMenuSupportEnabled): Deleted.
1414         (WKPreferencesGetActionMenuSupportEnabled): Deleted.
1415         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1416         * UIProcess/API/mac/WKView.mm:
1417         (-[WKView initWithFrame:context:configuration:webView:]):
1418
1419 2014-10-22  Chris Dumez  <cdumez@apple.com>
1420
1421         [Mac][WK2] Fix applicationIsSafari() detection
1422         https://bugs.webkit.org/show_bug.cgi?id=137893
1423
1424         Reviewed by Alexey Proskuryakov.
1425
1426         Provide an implementation for FrameLoaderClient's new
1427         needsQuickLookResourceCachingQuirks(), which accesses the flag stored
1428         on the WebProcess, which is initialized upon WebProcess creation.
1429
1430         QuickLookMac::computeNeedsQuickLookResourceCachingQuirks() is called
1431         on UIProcess side so that it works reliably and the flag is passed as
1432         parameter when constructing the WebProcess.
1433
1434         * Shared/WebProcessCreationParameters.cpp:
1435         (WebKit::WebProcessCreationParameters::encode):
1436         (WebKit::WebProcessCreationParameters::decode):
1437         * Shared/WebProcessCreationParameters.h:
1438         * UIProcess/mac/WebContextMac.mm:
1439         (WebKit::WebContext::platformInitializeWebProcess):
1440         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1441         (WebKit::WebFrameLoaderClient::needsQuickLookResourceCachingQuirks):
1442         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1443         * WebProcess/WebProcess.cpp:
1444         (WebKit::WebProcess::WebProcess):
1445         * WebProcess/WebProcess.h:
1446         (WebKit::WebProcess::needsQuickLookResourceCachingQuirks):
1447         * WebProcess/cocoa/WebProcessCocoa.mm:
1448         (WebKit::WebProcess::platformInitializeWebProcess):
1449
1450 2014-10-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1451
1452         Unreviewed. Fix GTK+ debug build after r175046.
1453
1454         Remove invalid ASSERT.
1455
1456         * UIProcess/gtk/InputMethodFilter.cpp:
1457         (WebKit::InputMethodFilter::setCursorRect):
1458
1459 2014-10-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1460
1461         [GTK] Move GtkInputMethodFilter from Platform to WebKit2
1462         https://bugs.webkit.org/show_bug.cgi?id=137884
1463
1464         Reviewed by Gustavo Noronha Silva.
1465
1466         Merge WebViewBaseInputMethodFilter and GtkInputMethodFilter into a
1467         single class InputMethodFilter. The code is mostly the same, but
1468         instead of having a setWebView method only to get the WebPageProxy,
1469         it has a setPage method that passes the WebPageProxy. The GtkIMContext
1470         client window is set by the WebView when it's realized/unrealized.
1471
1472         * PlatformGTK.cmake:
1473         * Shared/NativeWebKeyboardEvent.h:
1474         * Shared/gtk/NativeWebKeyboardEventGtk.cpp:
1475         (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent):
1476         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1477         (webkitWebViewBaseRealize):
1478         (webkitWebViewBaseUnrealize):
1479         (webkit_web_view_base_class_init):
1480         (webkitWebViewBaseCreateWebPage):
1481         (webkitWebViewBaseEnterFullScreen): Deleted.
1482         * UIProcess/API/gtk/WebViewBaseInputMethodFilter.cpp: Removed.
1483         * UIProcess/API/gtk/WebViewBaseInputMethodFilter.h: Removed.
1484         * UIProcess/gtk/InputMethodFilter.cpp: Added.
1485         (WebKit::InputMethodFilter::handleCommitCallback):
1486         (WebKit::InputMethodFilter::handlePreeditStartCallback):
1487         (WebKit::InputMethodFilter::handlePreeditChangedCallback):
1488         (WebKit::InputMethodFilter::handlePreeditEndCallback):
1489         (WebKit::InputMethodFilter::InputMethodFilter):
1490         (WebKit::InputMethodFilter::~InputMethodFilter):
1491         (WebKit::InputMethodFilter::setEnabled):
1492         (WebKit::InputMethodFilter::setCursorRect):
1493         (WebKit::InputMethodFilter::handleKeyboardEvent):
1494         (WebKit::InputMethodFilter::handleKeyboardEventWithCompositionResults):
1495         (WebKit::InputMethodFilter::filterKeyEvent):
1496         (WebKit::InputMethodFilter::confirmComposition):
1497         (WebKit::InputMethodFilter::updatePreedit):
1498         (WebKit::InputMethodFilter::notifyFocusedIn):
1499         (WebKit::InputMethodFilter::notifyFocusedOut):
1500         (WebKit::InputMethodFilter::notifyMouseButtonPress):
1501         (WebKit::InputMethodFilter::confirmCurrentComposition):
1502         (WebKit::InputMethodFilter::cancelContextComposition):
1503         (WebKit::InputMethodFilter::sendCompositionAndPreeditWithFakeKeyEvents):
1504         (WebKit::InputMethodFilter::handleCommit):
1505         (WebKit::InputMethodFilter::handlePreeditStart):
1506         (WebKit::InputMethodFilter::handlePreeditChanged):
1507         (WebKit::InputMethodFilter::handlePreeditEnd):
1508         (WebKit::InputMethodFilter::logHandleKeyboardEventForTesting):
1509         (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting):
1510         (WebKit::InputMethodFilter::logConfirmCompositionForTesting):
1511         (WebKit::InputMethodFilter::logSetPreeditForTesting):
1512         * UIProcess/gtk/InputMethodFilter.h: Added.
1513         (WebKit::InputMethodFilter::context):
1514         (WebKit::InputMethodFilter::setPage):
1515         (WebKit::InputMethodFilter::setTestingMode):
1516         (WebKit::InputMethodFilter::events):
1517
1518 2014-10-21  Tim Horton  <timothy_horton@apple.com>
1519
1520         Quick Look preview bubble has unnecessary controls
1521         https://bugs.webkit.org/show_bug.cgi?id=137940
1522         <rdar://problem/18731860>
1523
1524         Reviewed by Simon Fraser.
1525
1526         * UIProcess/API/mac/WKView.mm:
1527         (-[WKView _quickLookURLFromActionMenu:]):
1528         Temporarily use more SPI to allow us to hide the preview bubble's controls.
1529
1530 2014-10-21  Jeff Miller  <jeffm@apple.com>
1531
1532         Remove const from WKURLRequestRef parameter to WKContextDownloadURLRequest()
1533         https://bugs.webkit.org/show_bug.cgi?id=137928
1534
1535         Reviewed by Darin Adler.
1536
1537         * UIProcess/API/C/WKContext.cpp:
1538         (WKContextDownloadURLRequest):
1539         * UIProcess/API/C/WKContext.h:
1540
1541 2014-10-21  Anders Carlsson  <andersca@apple.com>
1542
1543         WKRemoteObjectCoder should handle floats
1544         https://bugs.webkit.org/show_bug.cgi?id=137926
1545         <rdar://problem/18695126>
1546
1547         Reviewed by Beth Dakin.
1548
1549         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
1550         (encodeInvocation):
1551         (-[WKRemoteObjectEncoder encodeFloat:forKey:]):
1552         (decodeInvocationArguments):
1553         (-[WKRemoteObjectDecoder decodeFloatForKey:]):
1554
1555 2014-10-21  Jeff Miller  <jeffm@apple.com>
1556
1557         WKContext needs to provide an API to resume a download
1558         https://bugs.webkit.org/show_bug.cgi?id=137507
1559
1560         Reviewed by Darin Adler.
1561
1562         This patch adds WKContextResumeDownload(), which is only supported on the Mac, and requires the
1563         resume data from WKDownloadGetResumeData().
1564
1565         We have to create a sandbox extension for the partially downloaded file in the UI process so the
1566         network or web process can resume writing to it.
1567
1568         * NetworkProcess/NetworkProcess.cpp:
1569         (WebKit::NetworkProcess::resumeDownload):
1570         Added, calls through to DownloadManager::resumeDownload().
1571
1572         * NetworkProcess/NetworkProcess.h:
1573         Added resumeDownload().
1574
1575         * NetworkProcess/NetworkProcess.messages.in:
1576         Added ResumeDownload message.
1577
1578         * Shared/Downloads/Download.h:
1579         Added resume().
1580
1581         * Shared/Downloads/DownloadManager.cpp:
1582         (WebKit::DownloadManager::resumeDownload):
1583         Added. The URL being downloaded is part of the opaque resumeData, so we can't specify it when the
1584         Download is constructed.
1585
1586         * Shared/Downloads/DownloadManager.h:
1587         Added resumeDownload().
1588
1589         * Shared/Downloads/ios/DownloadIOS.mm:
1590         (WebKit::Download::resume):
1591         Added, not implemented on this platform.
1592
1593         * Shared/Downloads/mac/DownloadMac.mm:
1594         (WebKit::Download::resume):
1595         Added. Consumes the sandbox extension, resumes the download, and sets m_request after the
1596         NSURLDownload has been created. Note that we already have code to revoke the sandbox extension when
1597         the download is finished, canceled, or fails.
1598
1599         * Shared/Downloads/soup/DownloadSoup.cpp:
1600         (WebKit::Download::resume):
1601         Added, not implemented on this platform.
1602
1603         * UIProcess/API/C/WKContext.cpp:
1604         (WKContextResumeDownload):
1605         Added.
1606
1607         * UIProcess/API/C/WKContext.h:
1608         Added WKContextResumeDownload().
1609
1610         * UIProcess/WebContext.cpp:
1611         (WebKit::WebContext::resumeDownload):
1612         Added. Creates a sandbox extension for the existing file and includes it in the message to the
1613         network or web process.
1614
1615         * UIProcess/WebContext.h:
1616         Added resumeDownload().
1617
1618         * WebProcess/WebProcess.cpp:
1619         (WebKit::WebProcess::resumeDownload):
1620         Added, calls through to DownloadManager::resumeDownload().
1621
1622         * WebProcess/WebProcess.h:
1623         Added resumeDownload().
1624
1625         * WebProcess/WebProcess.messages.in:
1626         Added ResumeDownload message.
1627
1628 2014-10-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1629
1630         Change the default TLS errors policy to WEBKIT_TLS_ERRORS_POLICY_FAIL
1631         https://bugs.webkit.org/show_bug.cgi?id=137832
1632
1633         Reviewed by Carlos Garcia Campos.
1634
1635         Too many general-purpose browsers that really need this policy
1636         are not selecting it, so let's do so for them.
1637
1638         * UIProcess/API/gtk/WebKitWebContext.cpp:
1639         (createDefaultWebContext):
1640
1641 2014-10-21  Michael Catanzaro  <mcatanzaro@igalia.com>
1642
1643         [SOUP] Disable SSLv3
1644         https://bugs.webkit.org/show_bug.cgi?id=137859
1645
1646         Reviewed by Carlos Garcia Campos.
1647
1648         Set G_TLS_GNUTLS_PRIORITY if unset.
1649
1650         * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
1651         (main):
1652         * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
1653         (main):
1654
1655 2014-10-20  Chris Dumez  <cdumez@apple.com>
1656
1657         ResourceRequest deserialization unnecessarily calls partitionName() on encoded cache partition
1658         https://bugs.webkit.org/show_bug.cgi?id=137797
1659
1660         Reviewed by Darin Adler.
1661
1662         This patch adds a |needsValidation| argument to
1663         ResourceRequest::setCachePartition() setter so that the caller can
1664         indicate that the partition name is valid (because it was already
1665         processed by partitionName() before). Use this new argument in
1666         ArgumentCoder<ResourceRequest>::decode() to spent a bit less time
1667         deserializing resource requests.
1668
1669         * Shared/WebCoreArgumentCoders.cpp:
1670         (IPC::ArgumentCoder<ResourceRequest>::decode):
1671
1672 2014-10-20  Beth Dakin  <bdakin@apple.com>
1673
1674         Action menu items should have tags
1675         https://bugs.webkit.org/show_bug.cgi?id=137898
1676
1677         Reviewed by Anders Carlsson.
1678
1679         * Shared/API/c/WKActionMenuItemTypes.h: Added.
1680         * UIProcess/API/mac/WKView.mm:
1681         (-[WKView _defaultMenuItemsForLink]):
1682         * WebKit2.xcodeproj/project.pbxproj:
1683
1684 2014-10-20  Beth Dakin  <bdakin@apple.com>
1685
1686         Add support for action menus
1687         https://bugs.webkit.org/show_bug.cgi?id=137891
1688         rdar://problem/18451638
1689         rdar://problem/18694470
1690
1691         Reviewed by Anders Carlsson.
1692
1693         Temporary artwork needed for menu item.
1694         * Resources/OpenInNewWindowTemplate.pdf: Added.
1695         * WebKit2.xcodeproj/project.pbxproj:
1696
1697         Add a preference that defaults to false for action menu support.
1698         * Shared/WebPreferencesDefinitions.h:
1699         * UIProcess/API/C/WKPreferences.cpp:
1700         (WKPreferencesSetActionMenuSupportEnabled):
1701         (WKPreferencesGetActionMenuSupportEnabled):
1702         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1703
1704         New SPI. WebKit clients can implement this method to customize the action menu.
1705         * UIProcess/API/Cocoa/WKViewPrivate.h:
1706
1707         Create the action menu if it is supported.
1708         * UIProcess/API/mac/WKView.mm:
1709         (-[WKView initWithFrame:context:configuration:webView:]):
1710
1711         Methods to implement the default menu actions.
1712         (-[WKView _openURLFromActionMenu:]):
1713         (-[WKView _addToReadingListFromActionMenu:]):
1714         (-[WKView _quickLookURLFromActionMenu:]):
1715
1716         Add action menus support for links. Populate the menu at the right time.
1717         (-[WKView _defaultMenuItemsForLink]):
1718         (-[WKView _defaultMenuItems]):
1719         (-[WKView prepareForMenu:withEvent:]):
1720         (-[WKView _actionMenuItemsForHitTestResult:defaultActionMenuItems:]):
1721
1722         New member variable caches the HitTestResult on mouse move.
1723         * UIProcess/WebPageProxy.cpp:
1724         (WebKit::WebPageProxy::mouseDidMoveOverElement):
1725         * UIProcess/WebPageProxy.h:
1726         (WebKit::WebPageProxy::activeActionMenuHitTestResult):
1727
1728 2014-10-20  Timothy Hatcher  <timothy@apple.com>
1729
1730         Web Inspector: Delay and white area when Web Inspector crashes
1731         https://bugs.webkit.org/show_bug.cgi?id=137230
1732
1733         Reviewed by Anders Carlsson.
1734
1735         * UIProcess/WebInspectorProxy.cpp:
1736         (WebKit::processDidCrash): Added.
1737         (WebKit::WebInspectorProxy::eagerlyCreateInspectorPage): Hook up loader client.
1738
1739 2014-10-20  Joseph Pecoraro  <pecoraro@apple.com>
1740
1741         Web Inspector: Generate all Inspector domains together in JavaScriptCore
1742         https://bugs.webkit.org/show_bug.cgi?id=137748
1743
1744         Reviewed by Brian Burg.
1745
1746         * PlatformGTK.cmake:
1747
1748 2014-10-19  Antti Koivisto  <antti@apple.com>
1749
1750         Avoid unnecessary NSURLResponse construction for QuickLook on iOS
1751         https://bugs.webkit.org/show_bug.cgi?id=137876
1752
1753         Reviewed by Andy Estes.
1754
1755         * WebProcess/Network/WebResourceLoader.cpp:
1756         (WebKit::WebResourceLoader::didReceiveResponse):
1757
1758             Switch to the modified QuickLookHandle interface that does not need NSURLResponse.
1759
1760 2014-10-16  Andy Estes  <aestes@apple.com>
1761
1762         [iOS] Capture WKActionSheetAssistant's interaction with WKContentView in a @protocol
1763         https://bugs.webkit.org/show_bug.cgi?id=137792
1764
1765         Reviewed by Tim Horton.
1766
1767         WKPDFView would like to use WKActionSheetAssistant to show an action sheet when long-pressing a link, but it
1768         can't so long as WKActionSheetAssistant is tightly coupled to WKContentView. Resolve this by factoring
1769         WKActionSheetAssistant's interaction with WKContentView into a new protocol called
1770         WKActionSheetAssistantDelegate and having WKContentView conform to this protocol.
1771
1772         * UIProcess/API/Cocoa/_WKElementAction.mm:
1773         (+[_WKElementAction elementActionWithTitle:actionHandler:]): Changed instances of WKContentView * to id <WKActionSheetAssistantDelegate>.
1774         (+[_WKElementAction elementActionWithType:customTitle:]): Ditto.
1775         (-[_WKElementAction _runActionWithElementInfo:delegate:]): Ditto.
1776         (copyElement): Deleted.
1777         (saveImage): Deleted.
1778         (-[_WKElementAction _runActionWithElementInfo:view:]): Deleted.
1779         * UIProcess/API/Cocoa/_WKElementActionInternal.h:
1780         * UIProcess/ios/WKActionSheet.h:
1781         * UIProcess/ios/WKActionSheet.mm:
1782         (-[WKActionSheet init]): Renamed from initWithView: since WKActionSheet no longer needs to know about a view.
1783         (-[WKActionSheet _didRotateAndLayout]): Called -[WKActionSheetDelegate updatePositionInformation].
1784         (-[WKActionSheet initWithView:]): Deleted.
1785         * UIProcess/ios/WKActionSheetAssistant.h:
1786         * UIProcess/ios/WKActionSheetAssistant.mm:
1787         (-[WKActionSheetAssistant delegate]): Added a getter for the delegate property.
1788         (-[WKActionSheetAssistant setDelegate:]): Added a setter for the delegate property.
1789         (-[WKActionSheetAssistant initWithView:]): Changed argument type from WKContentView * to UIView *.
1790         (-[WKActionSheetAssistant initialPresentationRectInHostViewForSheet]): Returned CGRectZero if there is no delegate.
1791         Otherwise, retrieved positionInformation from the delegate.
1792         (-[WKActionSheetAssistant presentationRectInHostViewForSheet]): Ditto.
1793         (-[WKActionSheetAssistant updatePositionInformation]): Called -[WKActionSheetAssistantDelegate updatePositionInformation].
1794         (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]): Returned early if there is no delegate.
1795         Otherwise, retrieved positionInformation from the delegate.
1796         (-[WKActionSheetAssistant showImageSheet]): Ditto.
1797         (-[WKActionSheetAssistant showLinkSheet]): Ditto.
1798         (-[WKActionSheetAssistant showDataDetectorsSheet]): Ditto.
1799         (-[WKActionSheetAssistant cleanupSheet]):
1800         * UIProcess/ios/WKContentViewInteraction.h:
1801         * UIProcess/ios/WKContentViewInteraction.mm:
1802         (-[WKContentView setupInteraction]): Installed self as WKActionSheetAssistant's delegate.
1803         (-[WKContentView updatePositionInformation]): Renamed from _updatePositionInformation.
1804         (-[WKContentView performAction:]): Renamed from _performAction:.
1805         (-[WKContentView openElementAtLocation:]): Called _attemptClickAtLocation:.
1806         (-[WKContentView actionsForElement:defaultActions:]): Called API::UIClient::actionsForElement().
1807         (-[WKContentView startInteractionWithElement:]): Called WebPageProxy::startInteractionWithElementAtPosition().
1808         (-[WKContentView stopInteraction]): Called WebPageProxy::stopInteraction().
1809         (-[WKContentView _updatePositionInformation]): Deleted.
1810         (-[WKContentView _performAction:]): Deleted.
1811
1812 2014-10-20  Carlos Garnacho  <carlosg@gnome.org>
1813
1814         [GTK] Improve zooming gesture positioning
1815         https://bugs.webkit.org/show_bug.cgi?id=137822
1816
1817         Reviewed by Carlos Garcia Campos.
1818
1819         * UIProcess/WebPageProxy.h:
1820         * UIProcess/gtk/GestureController.cpp:
1821         (WebKit::GestureController::ZoomGesture::center):
1822         (WebKit::GestureController::ZoomGesture::begin):
1823         (WebKit::GestureController::ZoomGesture::handleZoom):
1824         (WebKit::GestureController::ZoomGesture::scaleChanged): Calculate
1825         the proper view coordinates for the current offset/scale, based
1826         on the initial gesture center point in document coordinates, and
1827         the current center/scale.
1828         * UIProcess/gtk/GestureController.h:
1829         * UIProcess/gtk/WebPageProxyGtk.cpp:
1830         (WebKit::WebPageProxy::getCenterForZoomGesture): Added. Synchronous
1831         call to retrieve the zoom gesture anchor point, in document coordinates.
1832         * WebProcess/WebPage/WebPage.h:
1833         * WebProcess/WebPage/WebPage.messages.in: Added stub.
1834         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1835         (WebKit::WebPage::getCenterForZoomGesture): Added. Getter for the
1836         translated coordinates used as the anchor point of the zoom gesture.
1837
1838 2014-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1839
1840         [GTK] Remove the factory method from DragAndDropHandler
1841         https://bugs.webkit.org/show_bug.cgi?id=137872
1842
1843         Reviewed by Sergio Villar Senin.
1844
1845         Make the constructor public and use std::make_unique instead.
1846
1847         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1848         (webkitWebViewBaseDragAndDropHandler):
1849         * UIProcess/gtk/DragAndDropHandler.cpp:
1850         (WebKit::DragAndDropHandler::create): Deleted.
1851         * UIProcess/gtk/DragAndDropHandler.h:
1852
1853 2014-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1854
1855         [GTK] Add initial gestures support
1856         https://bugs.webkit.org/show_bug.cgi?id=137812
1857
1858         Reviewed by Sergio Villar Senin.
1859
1860         Now that GTK+ has support for gestures, we can use it to handle
1861         touch events and allow to scroll, zoom and tap with the fingers.
1862
1863         * PlatformGTK.cmake: Add new files to compilation.
1864         * UIProcess/API/gtk/PageClientImpl.cpp:
1865         (WebKit::PageClientImpl::doneWithTouchEvent): When the touch event
1866         hasn't been handled by the web process pass it to the
1867         GestureController and only fallback to pointer emulation when the
1868         GestureController doesn't handle the event.
1869         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1870         (webkitWebViewBaseTouchEvent): If the GestureController is
1871         currently processing gestures is because the START touch event was
1872         not handled by the web process, so pass any successive touch
1873         events to the GestureController directly.
1874         (webkitWebViewBaseGestureController): Create the GestureController
1875         on demand and return a reference.
1876         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
1877         * UIProcess/gtk/GestureController.cpp: Added.
1878         (WebKit::GestureController::create): Create a GestureController.
1879         (WebKit::GestureController::GestureController): Initialize the
1880         Gesture memebers.
1881         (WebKit::GestureController::handleEvent): Pass the event to the gestures.
1882         (WebKit::GestureController::isProcessingGestures): Whether
1883         Gestures are active.
1884         (WebKit::GestureController::Gesture::Gesture): Base class for gestures.
1885         (WebKit::GestureController::Gesture::isActive): Whether the
1886         gesture is active.
1887         (WebKit::GestureController::Gesture::handleEvent): Pass the event
1888         to the GtkGesture to process it.
1889         (WebKit::GestureController::DragGesture::handleDrag): Send a wheel
1890         event corresponding to the drag gesture to the web process.
1891         (WebKit::GestureController::DragGesture::handleTap): Send move,
1892         press and release events corresponding to a tap gesture to the web process.
1893         (WebKit::GestureController::DragGesture::begin): Start a drag
1894         gesture and schedule a timer to discard tap gesture in case of
1895         long press.
1896         (WebKit::GestureController::DragGesture::update): If the actual
1897         drag hasn't started yet, check the drag threshold to decide
1898         whether to start the drag or not. Otherwise call handleDrag() to
1899         send the appropriate events to the web process.
1900         (WebKit::GestureController::DragGesture::end): If the drag gesture
1901         finishes and the drag didn't happen (it wasn't a long press and
1902         drag threshold was not reached), call handleTap() to emulate a
1903         click event.
1904         (WebKit::GestureController::DragGesture::DragGesture): Initialize
1905         the GtkGestureDrag.
1906         (WebKit::GestureController::ZoomGesture::begin): Save the current
1907         page scale factor and the center point of the gesture.
1908         (WebKit::GestureController::ZoomGesture::scaleChanged): Schedule a
1909         page scale change in an idle for the given scale value.
1910         (WebKit::GestureController::ZoomGesture::ZoomGesture): Initialize
1911         the GtkGestureZoom.
1912         * UIProcess/gtk/GestureController.h: Added.
1913
1914 2014-10-19  Chris Dumez  <cdumez@apple.com>
1915
1916         Use is<>() / downcast<>() for all remaining RenderObject subclasses
1917         https://bugs.webkit.org/show_bug.cgi?id=137845
1918
1919         Reviewed by Darin Adler.
1920
1921         Use is<>() / downcast<>() for all remaining RenderObject subclasses and 
1922         clean up the surrounding code.
1923
1924         * WebProcess/Plugins/PluginView.cpp:
1925         (WebKit::PluginView::pluginProcessCrashed):
1926         * WebProcess/WebPage/WebPage.cpp:
1927         (WebKit::WebPage::createPlugin):
1928
1929 2014-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
1930
1931         [GTK] Move GtkDragAndDropHelper from Platform to WebKit2
1932         https://bugs.webkit.org/show_bug.cgi?id=137422
1933
1934         Reviewed by Martin Robinson.
1935
1936         WebKitWebViewBase is currently the only user of
1937         GtkDragAndDropHelper, that was added to share the code with
1938         WebKit1. Move all the drag and drop logic to a new class
1939         DragAndDropHandler.
1940
1941         * PlatformGTK.cmake: Add new files to compilation.
1942         * UIProcess/API/gtk/PageClientImpl.cpp:
1943         (WebKit::PageClientImpl::startDrag):
1944         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1945         (webkitWebViewBaseConstructed):
1946         (webkitWebViewBaseDragDataGet):
1947         (webkitWebViewBaseDragEnd):
1948         (webkitWebViewBaseDragDataReceived):
1949         (webkitWebViewBaseDragMotion):
1950         (webkitWebViewBaseDragLeave):
1951         (webkitWebViewBaseDragDrop):
1952         (webkitWebViewBaseDragAndDropHandler):
1953         (dragExitedCallback): Deleted.
1954         (webkitWebViewBaseStartDrag): Deleted.
1955         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
1956         * UIProcess/gtk/DragAndDropHandler.cpp: Added.
1957         (WebKit::DragAndDropHandler::create):
1958         (WebKit::DragAndDropHandler::DragAndDropHandler):
1959         (WebKit::DragAndDropHandler::DroppingContext::DroppingContext):
1960         (WebKit::dragOperationToGdkDragActions):
1961         (WebKit::dragOperationToSingleGdkDragAction):
1962         (WebKit::gdkDragActionToDragOperation):
1963         (WebKit::DragAndDropHandler::startDrag):
1964         (WebKit::DragAndDropHandler::fillDragData):
1965         (WebKit::DragAndDropHandler::finishDrag):
1966         (WebKit::DragAndDropHandler::dataObjectForDropData):
1967         (WebKit::DragAndDropHandler::dragEntered):
1968         (WebKit::DragAndDropHandler::requestDragData):
1969         (WebKit::DragAndDropHandler::dragMotion):
1970         (WebKit::DragAndDropHandler::dragLeave):
1971         (WebKit::DragAndDropHandler::drop):
1972         * UIProcess/gtk/DragAndDropHandler.h: Added.
1973
1974 2014-10-18  Dan Bernstein  <mitz@apple.com>
1975
1976         WorkQueue dispatches functions but isn’t a FunctionDispatcher
1977         https://bugs.webkit.org/show_bug.cgi?id=137853
1978
1979         Reviewed by Anders Carlsson.
1980
1981         * Platform/WorkQueue.h: Changed to inherit from FunctionDispatcher.
1982
1983 2014-10-18  Michael Catanzaro  <mcatanzaro@igalia.com>
1984
1985         [GTK] Improve documentation of webkit_web_view_get_tls_info()
1986         https://bugs.webkit.org/show_bug.cgi?id=137852
1987
1988         Reviewed by Martin Robinson.
1989
1990         * UIProcess/API/gtk/WebKitWebView.cpp:
1991
1992 2014-10-17  Chris Dumez  <cdumez@apple.com>
1993
1994         Use is<>() / downcast<>() for RenderBox
1995         https://bugs.webkit.org/show_bug.cgi?id=137804
1996
1997         Reviewed by Andreas Kling.
1998
1999         Use is<>() / downcast<>() for RenderBox and clean up the surrounding
2000         code.
2001
2002         * WebProcess/WebPage/WebPage.cpp:
2003         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
2004         (WebKit::WebPage::plugInIsPrimarySize):
2005         * WebProcess/WebPage/ios/WebPageIOS.mm:
2006         (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
2007
2008 2014-10-16  Simon Fraser  <simon.fraser@apple.com>
2009
2010         [iOS] Turn off font autosizing for iOS WebKitTestRunner
2011         https://bugs.webkit.org/show_bug.cgi?id=137806
2012
2013         Reviewed by Sam Weinig.
2014         
2015         Confusingly, WKPreferencesSetTextAutosizingEnabled() does nothing on iOS.
2016         Instead, we have to add WKPreferencesSetMinimumZoomFontSize() and set it to 0
2017         to disable font autosizing.
2018
2019         * UIProcess/API/C/WKPreferences.cpp:
2020         (WKPreferencesSetMinimumZoomFontSize):
2021         (WKPreferencesGetMinimumZoomFontSize):
2022         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2023
2024 2014-10-17  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2025
2026         [EFL] REGRESSION(r173929): It broke the Web Inspector
2027         https://bugs.webkit.org/show_bug.cgi?id=137522
2028
2029         Reviewed by Csaba Osztrogonác.
2030
2031         r173929 let web inspector use a separate web process. Besides it changed that the inspector is shown
2032         as docking mode by default. However EFL port doesn't support to show web inspector as docking window yet.
2033         This patch is to show web inspector on EFL new window as before. Docking mode should be implemented by
2034         upcoming patch.
2035
2036         * UIProcess/efl/WebInspectorProxyEfl.cpp:
2037         (WebKit::WebInspectorProxy::platformAttach):
2038
2039 2014-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2040
2041         [GLIB] Add API to GMainLoopSource to schedule sources after a delay in microseconds
2042         https://bugs.webkit.org/show_bug.cgi?id=137782
2043
2044         Reviewed by Sergio Villar Senin.
2045
2046         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
2047         (WebKit::LayerTreeHostGtk::layerFlushTimerFired): Use microseconds
2048         instead of milliseconds.
2049
2050 2014-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2051
2052         [GTK] Move touch events handling from Platform to WebKit2
2053         https://bugs.webkit.org/show_bug.cgi?id=137735
2054
2055         Reviewed by Sergio Villar Senin.
2056
2057         GtkTouchContextHelper was only used by WebKitWebViewBase, since
2058         it's the only one that can create touch events. The code has been
2059         simplified by processing the events in the view, and the native
2060         touch events are now created with the native event and touch points.
2061
2062         * Shared/NativeWebTouchEvent.h:
2063         (WebKit::NativeWebTouchEvent::touchContext): Deleted.
2064         * Shared/gtk/NativeWebTouchEventGtk.cpp:
2065         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent): Pass touch
2066         points instead of touch context to WebEventFactory::createWebTouchEvent().
2067         * Shared/gtk/WebEventFactory.cpp:
2068         (WebKit::WebEventFactory::createWebTouchEvent): Create the
2069         WebTouchEvent for the given native event and points.
2070         (WebKit::touchPhaseFromEvents): Deleted.
2071         (WebKit::appendTouchEvent): Deleted.
2072         * Shared/gtk/WebEventFactory.h:
2073         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2074         (appendTouchEvent): Helper function to create a
2075         WebPlatformTouchPoint for the given native event and add it to the
2076         list of touch points.
2077         (webkitWebViewBaseGetTouchPointForEvent): Build the touch point
2078         list for the event.
2079         (webkitWebViewBaseTouchEvent): Process the touch event.
2080         (webkitWebViewBaseDragDataReceived): Deleted.
2081
2082 2014-10-16  Pascal Jacquemart  <p.jacquemart@samsung.com>
2083
2084         Removing CUSTOM_PROTOCOLS guard
2085         https://bugs.webkit.org/show_bug.cgi?id=137741
2086
2087         Reviewed by Benjamin Poulain.
2088
2089         * NetworkProcess/NetworkProcess.cpp:
2090         (WebKit::NetworkProcess::NetworkProcess):
2091         * Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
2092         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
2093         * Shared/Network/CustomProtocols/CustomProtocolManager.messages.in:
2094         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp:
2095         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.h:
2096         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
2097         * Shared/Network/NetworkProcessCreationParameters.cpp:
2098         (WebKit::NetworkProcessCreationParameters::encode):
2099         (WebKit::NetworkProcessCreationParameters::decode):
2100         * Shared/Network/NetworkProcessCreationParameters.h:
2101         * Shared/WebProcessCreationParameters.cpp:
2102         (WebKit::WebProcessCreationParameters::encode):
2103         (WebKit::WebProcessCreationParameters::decode):
2104         * Shared/WebProcessCreationParameters.h:
2105         * UIProcess/API/C/soup/WKAPICastSoup.h:
2106         * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp:
2107         (WKSoupCustomProtocolRequestManagerGetTypeID):
2108         (WKSoupCustomProtocolRequestManagerSetClient):
2109         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
2110         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.messages.in:
2111         * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
2112         * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
2113         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp:
2114         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.h:
2115         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp:
2116         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.h:
2117         * UIProcess/Network/NetworkProcessProxy.cpp:
2118         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
2119         * UIProcess/Network/NetworkProcessProxy.h:
2120         * UIProcess/WebContext.cpp:
2121         (WebKit::WebContext::WebContext):
2122         (WebKit::WebContext::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers):
2123         (WebKit::WebContext::unregisterSchemeForCustomProtocol):
2124         * UIProcess/WebContext.h:
2125         * UIProcess/WebProcessProxy.cpp:
2126         (WebKit::WebProcessProxy::WebProcessProxy):
2127         * UIProcess/WebProcessProxy.h:
2128         * UIProcess/mac/WebContextMac.mm:
2129         (WebKit::WebContext::platformInitializeWebProcess):
2130         (WebKit::WebContext::platformInitializeNetworkProcess):
2131         * WebKit2Prefix.h:
2132         * WebProcess/WebProcess.cpp:
2133         (WebKit::WebProcess::WebProcess):
2134         * WebProcess/soup/WebKitSoupRequestGeneric.cpp:
2135         (webkitSoupRequestGenericSendAsync):
2136         (webkitSoupRequestGenericSendFinish):
2137         * WebProcess/soup/WebKitSoupRequestGeneric.h:
2138
2139 2014-10-16  Simon Fraser  <simon.fraser@apple.com>
2140
2141         Crash under RemoteLayerTreeHost::getLayer() when closing a tab
2142         https://bugs.webkit.org/show_bug.cgi?id=137796
2143         rdar://problem/18547565
2144
2145         Reviewed by Tim Horton.
2146         
2147         CA can call our animation delegate after the RemoteLayerTreeHost has been
2148         destroyed. CAAnimation retains its delegate, so it's safe for us to null out
2149         the WKAnimationDelegate's pointer to the RemoteLayerTreeHost when tearing down
2150         the RemoteLayerTreeHost.
2151
2152         * UIProcess/mac/RemoteLayerTreeHost.mm:
2153         (WebKit::RemoteLayerTreeHost::~RemoteLayerTreeHost):
2154         (WebKit::RemoteLayerTreeHost::animationDidEnd):
2155         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
2156         (-[WKAnimationDelegate invalidate]):
2157         (-[WKAnimationDelegate animationDidStart:]):
2158         (-[WKAnimationDelegate animationDidStop:finished:]):
2159
2160 2014-10-16  Tim Horton  <timothy_horton@apple.com>
2161
2162         Implement selection services menu for Legacy WebKit
2163         https://bugs.webkit.org/show_bug.cgi?id=137582
2164         <rdar://problem/18604241>
2165
2166         Reviewed by Brady Eidson.
2167
2168         * UIProcess/mac/WebContextMenuProxyMac.mm:
2169         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
2170         Add a note that we should transition to using replaceSelectionWithAttributedString.
2171
2172         * WebProcess/WebPage/mac/WebPageMac.mm:
2173         (WebKit::WebPage::handleSelectionServiceClick):
2174         Allow editor services in editable-but-not-rich-text areas, just like in WebKit1.
2175
2176 2014-10-16  Tim Horton  <timothy_horton@apple.com>
2177
2178         Various crashes in ViewGestureControllerIOS when closing a tab while a swipe gesture is in progress
2179         https://bugs.webkit.org/show_bug.cgi?id=137770
2180         <rdar://problem/17916459>
2181
2182         Reviewed by Dan Bernstein.
2183
2184         When tearing down a WKWebView in the middle of a swipe gesture, a variety of
2185         UI process crashes were observed. First, two uses of potentially deleted objects
2186         (the WebBackForwardListItem and ViewGestureController), which were fixed by
2187         extending the object's lifetime and checking for its liveness, respectively.
2188         Second, a potential null-deref of DrawingArea if the timing of endSwipeGesture
2189         vs. page teardown was such that DrawingArea was null but everything else was in line.
2190         Lastly, another case of messaging a potentially deleted object (specifically,
2191         the _UIViewControllerTransitionContext's animator) in a callback from CA, which
2192         was fixed by nulling out the animator (and a few other properties) when tearing
2193         down the ViewGestureController.
2194
2195         * UIProcess/ios/ViewGestureControllerIOS.mm:
2196         (-[WKSwipeTransitionController invalidate]):
2197         Clear the soon-to-be-invalid ViewGestureController pointer.
2198
2199         (WebKit::ViewGestureController::~ViewGestureController):
2200         Call [WKSwipeTransitionController invalidate] upon destruction.
2201         Clear our transition context's interactor and animator, and inform it that
2202         the transition is not in flight. This avoids a crash when calling back
2203         to the already-destroyed animator later.
2204
2205         (WebKit::ViewGestureController::beginSwipeGesture):
2206         Keep a reference to the target WebBackForwardListItem; this avoids
2207         it being deleted between here and the transition completion block firing.
2208
2209         Look up the ViewGestureController by pageID, just like we do in endSwipeGesture,
2210         to avoid situations where the callback fires after the WKWebView/ViewGestureController
2211         have gone away.
2212
2213         Hold on to our _UIViewControllerOneToOneTransitionContext, so that we can do the
2214         aforementioned clearing upon deallocation.
2215
2216         (WebKit::ViewGestureController::endSwipeGesture):
2217         Null check the DrawingArea. If it is null, instead of doing our normal delayed logic
2218         for swipe snapshot teardown, just put things back together immediately.
2219
2220         (WebKit::ViewGestureController::removeSwipeSnapshot):
2221         Clear m_swipeTransitionContext.
2222
2223 2014-10-16  Antti Koivisto  <antti@apple.com>
2224
2225         REGRESSION (r173356): Downloading a disk image appends ".txt" to it
2226         https://bugs.webkit.org/show_bug.cgi?id=137493
2227         <rdar://problem/18321947>
2228
2229         Reviewed by Alexey Proskuryakov.
2230
2231         * Shared/Downloads/ios/DownloadIOS.mm:
2232         (WebKit::Download::startWithHandle):
2233         * Shared/Downloads/mac/DownloadMac.mm:
2234         (WebKit::Download::startWithHandle):
2235
2236             It appears that the synthesized NS/CFURLResponse fails to serialize the suggested filename correctly
2237             unless it has been accessed first.
2238
2239 2014-10-15  Dan Bernstein  <mitz@apple.com>
2240
2241         [Cocoa] "Plug-in will handle load" error isn't declared in the modern API
2242         https://bugs.webkit.org/show_bug.cgi?id=137747
2243
2244         Reviewed by Anders Carlsson.
2245
2246         * UIProcess/API/Cocoa/WKError.mm: Define _WKLegacyErrorDomain.
2247         * UIProcess/API/Cocoa/WKErrorInternal.h: Changed to import WKErrorPrivate.h.
2248         * UIProcess/API/Cocoa/WKErrorPrivate.h: Added. Declares _WKLegacyErrorDomain
2249         and _WKLegacyErrorPlugInWillHandleLoad.
2250         * WebKit2.xcodeproj/project.pbxproj: Added new private header.
2251
2252 2014-10-15  Chris Dumez  <cdumez@apple.com>
2253
2254         Use is<>() / downcast<>() for TransformOperation subclasses
2255         https://bugs.webkit.org/show_bug.cgi?id=137731
2256
2257         Reviewed by Darin Adler.
2258
2259         Use is<>() / downcast<>() for TransformOperation subclasses and clean
2260         up the surrounding code.
2261
2262         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
2263         (IPC::ArgumentCoder<TransformOperations>::encode):
2264
2265 2014-10-15  Alexey Proskuryakov  <ap@apple.com>
2266
2267         [Mac] Allow some Kerberos related paths in sandbox
2268         https://bugs.webkit.org/show_bug.cgi?id=137666
2269         rdar://problem/17965010
2270
2271         Reviewed by Darin Adler.
2272
2273         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2274         * WebProcess/com.apple.WebProcess.sb.in:
2275
2276 2014-10-15  Alexey Proskuryakov  <ap@apple.com>
2277
2278         [Mac] Allow plug-ins to read managed preferences
2279         https://bugs.webkit.org/show_bug.cgi?id=137665
2280         <rdar://problem/18255601>
2281
2282         Reviewed by Darin Adler.
2283
2284         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:
2285
2286 2014-10-14  Joonghun Park  <jh718.park@samsung.com>
2287
2288         [WK2][EFL] Fix the problem that threads created by a DispatchQueueEfl are not destroyed
2289         even after the DispatchQueueEfl has been destructed
2290         https://bugs.webkit.org/show_bug.cgi?id=137195
2291
2292         Reviewed by Gyuyoung Kim.
2293
2294         Linux and Unix System's pthreads are created in joinable state by default.
2295         If threads aren't destructed explicitly, it will be still live
2296         until process which created the thread is dead.
2297         Besides it may cause out of capacity range of thread creation in a process.
2298         It is one of hidden defects.
2299         This patch calls detachThread() to detach thread immediately after it is created.
2300         So the thread can be destroyed as soon as the thread's ThreadContext::function()
2301         returns.
2302
2303         * Platform/efl/DispatchQueueEfl.cpp:
2304         (DispatchQueue::ThreadContext::start):
2305
2306 2014-10-14  Chris Dumez  <cdumez@apple.com>
2307
2308         Use is<>() / downcast<>() for PlatformCAAnimation subclasses
2309         https://bugs.webkit.org/show_bug.cgi?id=137722
2310
2311         Reviewed by Simon Fraser.
2312
2313         Use is<>() / downcast<>() for PlatformCAAnimation subclasses and clean
2314         up the surrounding code.
2315
2316         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
2317         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
2318         (WebKit::PlatformCAAnimationRemote::copy):
2319         (WebKit::PlatformCAAnimationRemote::copyTimingFunctionFrom):
2320         (WebKit::PlatformCAAnimationRemote::copyFromValueFrom):
2321         (WebKit::PlatformCAAnimationRemote::copyToValueFrom):
2322         (WebKit::PlatformCAAnimationRemote::copyValuesFrom):
2323         (WebKit::PlatformCAAnimationRemote::copyKeyTimesFrom):
2324         (WebKit::PlatformCAAnimationRemote::copyTimingFunctionsFrom):
2325         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2326         (WebKit::PlatformCALayerRemote::addAnimationForKey):
2327         (WebKit::PlatformCALayerRemote::animationStarted):
2328         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2329         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2330         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
2331
2332 2014-10-14  Alexey Proskuryakov  <ap@apple.com>
2333
2334         REGRESSION (r165356): Issues with Japanese text input
2335         https://bugs.webkit.org/show_bug.cgi?id=137719
2336         rdar://problem/18431952
2337         rdar://problem/18483741
2338
2339         Reviewed by Darin Adler.
2340
2341         * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didChangeSelection):
2342         In sync code path, ensure consistent message delivery order by adding
2343         a DispatchMessageEvenWhenWaitingForSyncReply flag. This way, delayed
2344         EditorStateChanged messages won't confuse UI process.
2345
2346 2014-10-14  Anders Carlsson  <andersca@apple.com>
2347
2348         Hide the find indicator when starting a swipe
2349         https://bugs.webkit.org/show_bug.cgi?id=137711
2350
2351         Reviewed by Tim Horton.
2352
2353         * UIProcess/mac/PageClientImpl.mm:
2354         (WebKit::PageClientImpl::navigationGestureDidBegin):
2355
2356 2014-10-14  Chris Dumez  <cdumez@apple.com>
2357
2358         Use is<>() / downcast<>() for RenderImage
2359         https://bugs.webkit.org/show_bug.cgi?id=137683
2360
2361         Reviewed by Mihnea Ovidenie.
2362
2363         Use is<>() / downcast<>() for RenderImage.
2364
2365         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2366         (WebKit::cachedImage):
2367         * WebProcess/WebPage/ios/WebPageIOS.mm:
2368         (WebKit::WebPage::performActionOnElement):
2369
2370 2014-10-13  Carlos Garcia Campos  <cgarcia@igalia.com>
2371
2372         [GTK][CMake] Non-ninja build is broken since r174422
2373         https://bugs.webkit.org/show_bug.cgi?id=137656
2374
2375         Reviewed by Philippe Normand.
2376
2377         Make WebKit2-forwarding-headers depend only on static,
2378         non-generated sources.
2379
2380         * CMakeLists.txt:
2381         * PlatformGTK.cmake:
2382
2383 2014-10-13  Chris Dumez  <cdumez@apple.com>
2384
2385         Use is<>() / downcast<>() for PlatformCALayer subclasses
2386         https://bugs.webkit.org/show_bug.cgi?id=137661
2387
2388         Reviewed by Simon Fraser.
2389
2390         Use is<>() / downcast<>() for PlatformCALayer subclasses and clean up 
2391         the surrounding code.
2392
2393         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2394         (WebKit::PlatformCALayerRemote::~PlatformCALayerRemote):
2395         (WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
2396         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
2397         (WebKit::PlatformCALayerRemote::setSublayers):
2398         (WebKit::PlatformCALayerRemote::appendSublayer):
2399         (WebKit::PlatformCALayerRemote::insertSublayer):
2400         (WebKit::PlatformCALayerRemote::replaceSublayer):
2401         (WebKit::PlatformCALayerRemote::adoptSublayers):
2402         (WebKit::PlatformCALayerRemote::setMask):
2403         (WebKit::PlatformCALayerRemote::copyFiltersFrom):
2404         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2405         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
2406         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
2407         (WebKit::RemoteLayerTreeContext::buildTransaction):
2408
2409 2014-10-13  Chris Dumez  <cdumez@apple.com>
2410
2411         Use is<>() / downcast<>() for Filter / FilterOperation subclasses
2412         https://bugs.webkit.org/show_bug.cgi?id=137644
2413
2414         Reviewed by Darin Adler.
2415
2416         Use is<>() / downcast<>() for Filter / FilterOperation subclasses.
2417
2418         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
2419         (IPC::ArgumentCoder<WebCore::FilterOperations>::encode):
2420         * Shared/WebCoreArgumentCoders.cpp:
2421         (IPC::ArgumentCoder<FilterOperation>::encode):
2422         * Shared/mac/RemoteLayerTreeTransaction.mm:
2423         (WebKit::RemoteLayerTreeTextStream::operator<<):
2424
2425 2014-10-12  Sergio Villar Senin  <svillar@igalia.com>
2426
2427         [SOUP] [WK2] WebProcess and NetworkProcess initialization clears cache contents
2428         https://bugs.webkit.org/show_bug.cgi?id=137489
2429
2430         Reviewed by Carlos Garcia Campos.
2431
2432         Temporarily set the SoupCache's maximum size to a huge value
2433         before calling soup_cache_load() so that the cache is not shrinked
2434         to the default value.
2435
2436         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2437         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
2438         * WebProcess/soup/WebProcessSoup.cpp:
2439         (WebKit::WebProcess::platformInitializeWebProcess):
2440
2441 2014-10-12  Ryuan Choi  <ryuan.choi@gmail.com>
2442
2443         [EFL] Introduce EWebKit_Extension
2444         https://bugs.webkit.org/show_bug.cgi?id=134921
2445
2446         Reviewed by Gyuyoung Kim.
2447
2448         EWebKit2 does not provide the functionality to extend WebProcess.
2449         Although there is ewk_context_new_with_injected_bundle_path() in ewebkit2 APIs,
2450         application developers can not make bundle object without touching WK APIs
2451         which ewebkit2 does not expose.
2452
2453         This patch introduces EWebKit_Extension, basic structure for the extension of WebProcess.
2454
2455         * PlatformEfl.cmake:
2456         Added files for the EWebKit_Extension and install them properly.
2457         * UIProcess/API/efl/ewk_context.cpp:
2458         (EwkContext::EwkContext):
2459         (bundlePathForExtension):
2460         (EwkContext::create):
2461         (EwkContext::getInjectedBundleInitializationUserData):
2462         (EwkContext::setMessageFromInjectedBundleCallback):
2463         (ewk_context_new_with_extensions_path):
2464         Deleted because ewebkit2 does not have a way to make injected bundle.
2465         Instead, Ewk_Extension will cover the same functionalities.
2466         (ewk_context_new_with_injected_bundle_path): Deleted.
2467         * UIProcess/API/efl/ewk_context.h:
2468         * UIProcess/API/efl/ewk_context_private.h:
2469         (EwkContext::extensionsPath):
2470         * UIProcess/API/efl/tests/InjectedBundle/injected_bundle_sample.cpp: Removed.
2471         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp:
2472         (EWK2UnitTest::EWK2UnitTestEnvironment::extensionSample):
2473         (EWK2UnitTest::EWK2UnitTestEnvironment::injectedBundleSample): Renamed injectedBundleSample to extensionSample.
2474         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.h:
2475         * UIProcess/API/efl/tests/extensions/extension_sample.cpp: Copied from Source/WebKit2/UIProcess/API/efl/tests/InjectedBundle/injected_bundle_sample.cpp.
2476         * UIProcess/API/efl/tests/test_ewk2_context.cpp: Renamed ewk_context_new_with_injected_bundle_path to ewk_context_new_with_extensions_path.
2477         (TEST_F):
2478         * WebProcess/InjectedBundle/API/efl/EWebKit_Extension.h: Added.
2479         * WebProcess/InjectedBundle/API/efl/ewk_extension.cpp: Added.
2480         (EwkExtension::append):
2481         (EwkExtension::remove):
2482         (ewk_extension_client_add):
2483         (ewk_extension_client_del):
2484         * WebProcess/InjectedBundle/API/efl/ewk_extension.h: Added.
2485         * WebProcess/InjectedBundle/API/efl/ewk_extension_private.h: Added.
2486         (EwkExtension::EwkExtension):
2487         (EwkExtension::~EwkExtension):
2488         * WebProcess/efl/ExtensionManagerEfl.cpp: Added.
2489         (WebKit::ExtensionManagerEfl::shared):
2490         (WebKit::ExtensionManagerEfl::ExtensionManagerEfl):
2491         (WebKit::ExtensionManagerEfl::initialize):
2492         * WebProcess/efl/ExtensionManagerEfl.h: Added.
2493         * WebProcess/efl/WebInjectedBundleMainEfl.cpp: Added.
2494         (WKBundleInitialize):
2495         * efl/ewebkit2-extension.pc.in: Added.
2496
2497 2014-10-10  Chris Dumez  <cdumez@apple.com>
2498
2499         Use is<>() / downcast<>() for Image subclasses
2500         https://bugs.webkit.org/show_bug.cgi?id=137625
2501
2502         Reviewed by Andreas Kling.
2503
2504         Use is<>() / downcast<>() for Image subclasses.
2505
2506         * WebProcess/Plugins/PluginView.cpp:
2507         (WebKit::PluginView::pluginSnapshotTimerFired):
2508
2509 2014-10-10  Chris Dumez  <cdumez@apple.com>
2510
2511         Use is<>() / downcast<>() for GraphicsLayer subclasses
2512         https://bugs.webkit.org/show_bug.cgi?id=137595
2513
2514         Reviewed by Darin Adler.
2515
2516         Use is<>() / downcast<>() for GraphicsLayer subclasses and clean up the
2517         surrounding code.
2518
2519         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
2520         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2521         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2522         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2523         (WebKit::TiledCoreAnimationDrawingArea::layerForTransientZoom):
2524         (WebKit::TiledCoreAnimationDrawingArea::shadowLayerForTransientZoom):
2525
2526 2014-10-10  Pascal Jacquemart  <p.jacquemart@samsung.com>
2527
2528         Fix debug build on EFL after r174584
2529         https://bugs.webkit.org/show_bug.cgi?id=137613
2530
2531         Reviewed by Christophe Dumez.
2532
2533         * UIProcess/efl/RequestManagerClientEfl.cpp:
2534         (WebKit::RequestManagerClientEfl::RequestManagerClientEfl):
2535
2536 2014-10-10  Chris Dumez  <cdumez@apple.com>
2537
2538         Use is<>() / downcast<>() for RenderBoxModelObject
2539         https://bugs.webkit.org/show_bug.cgi?id=137587
2540
2541         Reviewed by Mihnea Ovidenie.
2542
2543         Use is<>() / downcast<>() for RenderBoxModelObject and clean up the
2544         surrounding code.
2545
2546         * WebProcess/Plugins/PluginView.cpp:
2547         (WebKit::PluginView::renderer):
2548         (WebKit::PluginView::invalidateRect):
2549
2550 2014-10-10  Pascal Jacquemart  <p.jacquemart@samsung.com>
2551
2552         [SOUP] Remove custom URI schemes implementation
2553         https://bugs.webkit.org/show_bug.cgi?id=128169
2554
2555         Reviewed by Carlos Garcia Campos.
2556
2557         * Shared/WebProcessCreationParameters.cpp:
2558         (WebKit::WebProcessCreationParameters::encode):
2559         (WebKit::WebProcessCreationParameters::decode):
2560         * Shared/WebProcessCreationParameters.h:
2561         * UIProcess/API/C/soup/WKAPICastSoup.h:
2562         * UIProcess/API/C/soup/WKContextSoup.cpp: Removed.
2563         * UIProcess/API/C/soup/WKSoupRequestManager.cpp: Removed.
2564         * UIProcess/WebContext.cpp:
2565         (WebKit::WebContext::WebContext):
2566         * UIProcess/WebPageProxy.cpp:
2567         (WebKit::WebPageProxy::didReceiveURIRequest): Deleted.
2568         * UIProcess/WebPageProxy.h:
2569         * UIProcess/WebPageProxy.messages.in:
2570         * UIProcess/soup/WebSoupRequestManagerClient.cpp: Removed.
2571         * UIProcess/soup/WebSoupRequestManagerProxy.cpp: Removed.
2572         * UIProcess/soup/WebSoupRequestManagerProxy.messages.in: Removed.
2573         * WebProcess/WebProcess.cpp:
2574         (WebKit::WebProcess::WebProcess):
2575         * WebProcess/soup/WebKitSoupRequestGeneric.cpp:
2576         (webkitSoupRequestGenericSendAsync):
2577         (webkitSoupRequestGenericSendFinish):
2578         * WebProcess/soup/WebProcessSoup.cpp:
2579         (WebKit::WebProcess::platformInitializeWebProcess):
2580         * WebProcess/soup/WebSoupRequestManager.cpp: Removed.
2581         * WebProcess/soup/WebSoupRequestManager.messages.in: Removed.
2582
2583 2014-10-09  Dean Jackson  <dino@apple.com>
2584
2585         Remove ENABLE_CSS3_CONDITIONAL_RULES
2586         https://bugs.webkit.org/show_bug.cgi?id=137571
2587
2588         Reviewed by Simon Fraser.
2589
2590         * Configurations/FeatureDefines.xcconfig:
2591
2592 2014-10-09  Tim Horton  <timothy_horton@apple.com>
2593
2594         Move ServicesOverlayController to WebCore
2595         https://bugs.webkit.org/show_bug.cgi?id=137416
2596         <rdar://problem/18546283>
2597
2598         Reviewed by Anders Carlsson.
2599
2600         * Platform/Logging.h:
2601         Move Services logging channel to WebCore.
2602
2603         * WebKit2.xcodeproj/project.pbxproj:
2604         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2605         (WebKit::WebChromeClient::handleTelephoneNumberClick):
2606         (WebKit::WebChromeClient::handleSelectionServiceClick):
2607         (WebKit::WebChromeClient::hasRelevantSelectionServices):
2608         Implement services-related ChromeClient callbacks.
2609         Clicks are forwarded to WebPageMac where they do what they used to;
2610         hasRelevantSelectionServices is implemented as it was when it lived
2611         inside ServicesOverlayController.
2612
2613         * WebProcess/WebCoreSupport/WebChromeClient.h:
2614         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2615         (WebKit::WebEditorClient::selectedTelephoneNumberRangesChanged): Deleted.
2616         (WebKit::WebEditorClient::selectionRectsDidChange): Deleted.
2617         * WebProcess/WebCoreSupport/WebEditorClient.h:
2618         Remove WebEditorClient overrides for now-removed functions.
2619
2620         * WebProcess/WebPage/WebPage.cpp:
2621         (WebKit::WebPage::WebPage):
2622         (WebKit::WebPage::updatePreferences):
2623         Forward serviceControlsEnabled setting to WebCore.
2624
2625         (WebKit::WebPage::servicesOverlayController): Deleted.
2626         * WebProcess/WebPage/WebPage.h:
2627         (WebKit::WebPage::serviceControlsEnabled): Deleted.
2628
2629 2014-10-09  Andy Estes  <aestes@apple.com>
2630
2631         [iOS] Crash in CFURLDownloadClient.didFail if the download has a null resumeData
2632         https://bugs.webkit.org/show_bug.cgi?id=137551
2633
2634         Reviewed by David Kilzer.
2635
2636         CFDataGetBytePtr() and CFDataGetLength() crash if passed a null value.
2637
2638         * Shared/Downloads/ios/DownloadIOS.mm:
2639         (WebKit::setUpDownloadClient):
2640
2641 2014-10-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2642
2643         [X11] Plugin process crashes in NetscapePlugin::platformPostInitialize()
2644         https://bugs.webkit.org/show_bug.cgi?id=137426
2645
2646         Reviewed by Darin Adler.
2647
2648         For some reason flash crashes when NPP_GetValue is called with
2649         NPPVpluginCancelSrcStream, but only in windowed mode. Not calling
2650         NPP_GetValue and unconditionally loading the source URL in the
2651         browser fixes the crash and plugins work normally. We can handle
2652         this particular case with a new quirk.
2653
2654         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
2655         (WebKit::NetscapePluginModule::determineQuirks): Add
2656         DoNotCancelSrcStreamInWindowedMode quirk if it's flash plugin.
2657         * Shared/Plugins/PluginQuirks.h: Add
2658         DoNotCancelSrcStreamInWindowedMode quirk.
2659         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2660         (WebKit::NetscapePlugin::shouldLoadSrcURL): Return early if plugin
2661         is windowed and DoNotCancelSrcStreamInWindowedMode quirk is present.
2662
2663 2014-10-09  Chris Dumez  <cdumez@apple.com>
2664
2665         Use is<>() / downcast<>() for Widget subclasses
2666         https://bugs.webkit.org/show_bug.cgi?id=137549
2667
2668         Reviewed by Darin Adler.
2669
2670         Use is<>() / downcast<>() for Widget subclasses and clean up the
2671         surrounding code.
2672
2673         * Shared/WebRenderObject.cpp:
2674         (WebKit::WebRenderObject::WebRenderObject):
2675
2676 2014-10-08  Carlos Garcia Campos  <cgarcia@igalia.com>
2677
2678         [GTK] Use the PageLoadState observer also to monitor title and estimated load progress
2679         https://bugs.webkit.org/show_bug.cgi?id=136997
2680
2681         Reviewed by Gustavo Noronha Silva.
2682
2683         * UIProcess/API/gtk/WebKitLoaderClient.cpp:
2684         (attachLoaderClientToView): Remove implementation of
2685         didReceiveTitleForFrame, didStartProgress, didChangeProgress and
2686         didFinishProgress.
2687         (didReceiveTitleForFrame): Deleted.
2688         (didChangeProgress): Deleted.
2689         * UIProcess/API/gtk/WebKitWebView.cpp:
2690         (webkit_web_view_get_estimated_load_progress): Return the value
2691         directly from the PageLoadState object, since we don't need to
2692         cache the value anymore.
2693         (webkitWebViewSetTitle): Deleted.
2694         (webkitWebViewSetEstimatedLoadProgress): Deleted.
2695         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
2696
2697 2014-10-08  Carlos Garcia Campos  <cgarcia@igalia.com>
2698
2699         Race condition with WebKitWebView:is-loading after starting page load
2700         https://bugs.webkit.org/show_bug.cgi?id=136692
2701
2702         Reviewed by Gustavo Noronha Silva.
2703
2704         Use PageLoadState::Observer to update both is-loading and uri
2705         properties, instead of manually update them. This ensures that our
2706         web view is always in sync with the WebPageProxy so that
2707         webkit_web_view_is_loading() returns true right after requesting
2708         any load. We still need to manually set the is-loading property
2709         only in the case where we delay the emission of the load-changed
2710         signals when waiting for the main resource. The bahaviour is a bit
2711         different but still consistent with what our API documentation says.
2712
2713         * UIProcess/API/gtk/WebKitLoaderClient.cpp:
2714         (attachLoaderClientToView): Remove
2715         didSameDocumentNavigationForFrame implementation, since we are
2716         already notified about the URL change by the PageLoadState::Observer.
2717         (didSameDocumentNavigationForFrame): Deleted.
2718         * UIProcess/API/gtk/WebKitWebView.cpp:
2719         (webkitWebViewSetIsLoading): No longer update the URI when
2720         changing the is-loading property.
2721         (webkitWebViewConstructed): Crate a PageLoadStateObserver and add
2722         it to the PageLoadState.
2723         (webkitWebViewDispose): Remove the PageLoadStateObserver from the PageLoadState.
2724         (webkitWebViewEmitLoadChanged): Add isDelayedEvent parameter to
2725         update the is-loading property accordingly when emitting the
2726         delayed events.
2727         (webkitWebViewEmitDelayedLoadEvents): Pass true as isDelayedEvent
2728         parameter of webkitWebViewEmitLoadChanged().
2729         (webkitWebViewLoadChanged): Pass false as isDelayedEvent parameter
2730         of webkitWebViewEmitLoadChanged().
2731         (webkitWebViewLoadFailed):
2732         (webkitWebViewLoadFailedWithTLSErrors):
2733         (webkitWebViewUpdateURI): Deleted.
2734         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
2735
2736 2014-10-08  Christophe Dumez  <cdumez@apple.com>
2737
2738         Use is<>() / downcast<>() for RenderBlock objects
2739         https://bugs.webkit.org/show_bug.cgi?id=137512
2740
2741         Reviewed by Darin Adler.
2742
2743         Use is<>() / downcast<>() for RenderBlock objects and clean up the 
2744         surrounding code.
2745
2746         * WebProcess/WebPage/ios/WebPageIOS.mm:
2747         (WebKit::WebPage::rangeForWebSelectionAtPosition):
2748         (WebKit::WebPage::contractedRangeFromHandle):
2749
2750 2014-10-08  Ada Chan  <adachan@apple.com>
2751
2752         Implement WKPageIsPlayingAudio().
2753         https://bugs.webkit.org/show_bug.cgi?id=137048
2754
2755         Reviewed by Darin Adler.
2756
2757         * UIProcess/API/C/WKPage.cpp:
2758         (WKPageIsPlayingAudio):
2759
2760 2014-10-08  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2761
2762         [EFL][CoordinatedGraphics] All EFL layout tests are broken since r174231
2763         https://bugs.webkit.org/show_bug.cgi?id=137443
2764
2765         Reviewed by Zoltan Herczeg.
2766
2767         EFL layout test and MiniBrowser have broken since r174231. r174231 was to move PageOverlay implementation
2768         from WebKit2 to WebCore with lazy initializing of PageOverlayController. It caused all EFL layout tests
2769         crash and build break. To restore EFL layout test, this patch sets viewOverlayRootLayer through
2770         attachViewOverlayGraphicsLayer() as mac port's one in r174231.
2771
2772         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
2773         (WebKit::CoordinatedDrawingArea::attachViewOverlayGraphicsLayer):
2774         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
2775         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2776         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
2777         (WebKit::CoordinatedLayerTreeHost::updateRootLayers):
2778         (WebKit::CoordinatedLayerTreeHost::setViewOverlayRootLayer):
2779         (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
2780         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
2781         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2782
2783 2014-10-08  Commit Queue  <commit-queue@webkit.org>
2784
2785         Unreviewed, rolling out r174335.
2786         https://bugs.webkit.org/show_bug.cgi?id=137515
2787
2788         It broke EFL layout test totally (Requested by gyuyoung on
2789         #webkit).
2790
2791         Reverted changeset:
2792
2793         "[EFL] Introduce EWebKit_Extension"
2794         https://bugs.webkit.org/show_bug.cgi?id=134921
2795         http://trac.webkit.org/changeset/174335
2796
2797 2014-10-08  Carlos Garcia Campos  <cgarcia@igalia.com>
2798
2799         [GTK] Make forwarding headers generation depend on source code
2800         https://bugs.webkit.org/show_bug.cgi?id=137394
2801
2802         Reviewed by Philippe Normand.
2803
2804         Only run generate-forwarding-headers.pl when source code changes
2805         and use a different target for the symlinks.
2806
2807         * PlatformGTK.cmake:
2808
2809 2014-10-07  Pascal Jacquemart  <p.jacquemart@samsung.com>
2810
2811         [EFL] Enable custom URI schemes with CustomProtocols
2812         https://bugs.webkit.org/show_bug.cgi?id=128177
2813
2814         Reviewed by Gyuyoung Kim.
2815
2816         Fixing ewk_context_url_scheme_register() ewebkit2 API
2817         rely on r162449 - CustomProtocols implementation from Carlos Garcia Campos
2818
2819         * PlatformEfl.cmake:
2820         * UIProcess/API/efl/ewk_context.h:
2821         * UIProcess/API/efl/ewk_url_scheme_request.cpp:
2822         (EwkUrlSchemeRequest::EwkUrlSchemeRequest):
2823         (EwkUrlSchemeRequest::finish):
2824         * UIProcess/API/efl/ewk_url_scheme_request_private.h:
2825         (EwkUrlSchemeRequest::create):
2826         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
2827         (TEST_F):
2828         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp:
2829         * UIProcess/efl/RequestManagerClientEfl.cpp:
2830         (WebKit::RequestManagerClientEfl::RequestManagerClientEfl):
2831         (WebKit::RequestManagerClientEfl::startLoading):
2832         (WebKit::RequestManagerClientEfl::stopLoading):
2833         (WebKit::RequestManagerClientEfl::registerURLSchemeHandler):
2834         (WebKit::EwkUrlSchemeHandler::EwkUrlSchemeHandler): Deleted.
2835         (WebKit::RequestManagerClientEfl::didReceiveURIRequest): Deleted.
2836         * UIProcess/efl/RequestManagerClientEfl.h:
2837         * UIProcess/efl/WebContextEfl.cpp:
2838         (WebKit::WebContext::platformInitializeWebProcess):
2839         * UIProcess/soup/WebContextSoup.cpp:
2840         (WebKit::WebContext::platformInitializeNetworkProcess):
2841
2842 2014-10-07  Sungmann Cho  <sungmann.cho@navercorp.com>
2843
2844         Remove WKPageCreateSnapshotOfVisibleContent API.
2845         https://bugs.webkit.org/show_bug.cgi?id=66979
2846
2847         Reviewed by Darin Adler.
2848
2849         After the landing of the first patch of webkit.org/b/66979,
2850         WKPageCreateSnapshotOfVisibleContent API has been neglected for years.
2851         Currently, this is not used anywhere and does not break the nightlies.
2852         So we can remove this.
2853
2854         * UIProcess/API/C/WKPage.cpp:
2855         (WKPageCreateSnapshotOfVisibleContent): Deleted.
2856         * UIProcess/API/C/WKPagePrivate.h:
2857
2858 2014-10-07  Sungmann Cho  <sungmann.cho@navercorp.com>
2859
2860         Remove WKPageSetInvalidMessageFunction.
2861         https://bugs.webkit.org/show_bug.cgi?id=137509
2862
2863         Reviewed by Benjamin Poulain.
2864
2865         According to the FIXME comment in WKPageSetInvalidMessageFunction,
2866         we can remove this function when doing so won't break the nightlies.
2867         Currently, this is not used anywhere and does not break the nightlies.
2868         So we can remove this.
2869
2870         * UIProcess/API/C/WKPage.cpp:
2871         (WKPageSetInvalidMessageFunction): Deleted.
2872         * UIProcess/API/C/WKPagePrivate.h:
2873
2874 2014-10-07  Christophe Dumez  <cdumez@apple.com>
2875
2876         [WK2] Use is<>() / downcast<>() for DrawingArea subclasses
2877         https://bugs.webkit.org/show_bug.cgi?id=137497
2878
2879         Reviewed by Benjamin Poulain.
2880
2881         Use is<>() / downcast<>() for DrawingArea subclasses.
2882
2883         * WebProcess/WebPage/DrawingArea.h:
2884         * WebProcess/WebPage/WebPage.cpp:
2885         (WebKit::WebPage::didCommitLoad):
2886         * WebProcess/WebPage/ios/WebPageIOS.mm:
2887         (WebKit::WebPage::synchronizeDynamicViewportUpdate):
2888         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2889         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2890
2891 2014-10-07  Simon Fraser  <simon.fraser@apple.com>
2892
2893         Roll-over Changelogs.
2894
2895         * ChangeLog-2014-10-07: Copied from Source/WebKit2/ChangeLog.
2896
2897 == Rolled over to ChangeLog-2014-10-07 ==