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