Resource Load Statistics: Classify resources as prevalent based on redirects to other...
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-02-12  John Wilander  <wilander@apple.com>
2
3         Resource Load Statistics: Classify resources as prevalent based on redirects to other prevalent resources
4         https://bugs.webkit.org/show_bug.cgi?id=182664
5         <rdar://problem/37372572>
6
7         Reviewed by Brent Fulgham.
8
9         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
10         (WebKit::ResourceLoadStatisticsClassifier::hasPrevalentResourceCharacteristics):
11             Unique top frame redirects now counts toward classification as prevalent.
12         * Shared/WebCoreArgumentCoders.cpp:
13         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
14         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
15         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
16         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
17         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
18         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
19             Test infrastructure.
20         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
21         * UIProcess/WebResourceLoadStatisticsStore.cpp:
22             Bumped the statistics model to 11 because of the added fields.
23         (WebKit::WebResourceLoadStatisticsStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain):
24             This function back traces redirect chains to classify domains
25             that have redirected to a newly classified prevalent resource.
26         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
27             Now uses the new convenience function WebResourceLoadStatisticsStore::setPrevalentResource().
28         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
29             New convenience function to make sure we always call
30             WebResourceLoadStatisticsStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain()
31             and capture redirect chains backward.
32         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
33         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
34         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
35         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
36         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
37         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
38             Test infrastructure.
39         * UIProcess/WebResourceLoadStatisticsStore.h:
40
41 2018-02-12  Antti Koivisto  <antti@apple.com>
42
43         Update NetworkCache::Storage::lastStableVersion after r226349
44         https://bugs.webkit.org/show_bug.cgi?id=182723
45         <rdar://problem/37469554>
46         
47         Reviewed by Ryosuke Niwa.
48
49         * NetworkProcess/cache/NetworkCacheStorage.h:
50
51         Allow deleting version 11 caches.
52
53 2018-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
54
55         [Extra zoom mode] Add support for <input type='time'> using time picker UI
56         https://bugs.webkit.org/show_bug.cgi?id=182683
57         <rdar://problem/35143162>
58
59         Reviewed by Tim Horton.
60
61         Adds support for showing a time picker when an input of type time is focused in extra zoomed mode.
62
63         * UIProcess/ios/WKContentViewInteraction.h:
64         * UIProcess/ios/WKContentViewInteraction.mm:
65         (-[WKContentView _stopAssistingNode]):
66         (-[WKContentView presentTimePickerViewController:]):
67         (-[WKContentView dismissTimePickerViewController:]):
68
69         Add helpers to dismiss and present the time picker view controller.
70
71         (-[WKContentView presentViewControllerForAssistedNode:]):
72
73         When focusing InputType::Time, present a time picker. Additionally, tweak the logic here to use the generic text
74         input view controller as a fallback when the other input view controllers (number pads, select menus and time
75         pickers thus far) are not relevant. This prevents us from completely being unable to edit form controls that are
76         currently unsupported.
77
78         (-[WKContentView textInputController:didCommitText:]):
79         (-[WKContentView textInputControllerDidRequestDismissal:]):
80
81         Tweak WKContentView for changes to WKTextFormControlViewControllerDelegate.
82
83         (-[WKContentView actionNameForFocusedFormControlController:]):
84
85         Adjust this implementation to hide the focused form control "Go" button for selects and time inputs. This
86         currently doesn't work for these form controls because it relies on implicit form submission; this should be
87         fixed by future changes, after which we should revert this adjustment.
88
89         (-[WKContentView _wheelChangedWithEvent:]):
90
91         Delegate wheel events to the time picker if needed.
92
93         (-[WKContentView textInputController:didRequestDismissalWithAction:]): Deleted.
94
95         Renamed to -textInputControllerDidRequestDismissal:.
96
97         * UIProcess/ios/forms/WKTimePickerViewController.h: Added.
98         * UIProcess/ios/forms/WKTimePickerViewController.mm: Added.
99         * WebKit.xcodeproj/project.pbxproj:
100
101 2018-02-11  Michael Catanzaro  <mcatanzaro@igalia.com>
102
103         [GTK] Unify builds for platform-specific files in WebKit layer
104         https://bugs.webkit.org/show_bug.cgi?id=182450
105
106         Reviewed by Carlos Garcia Campos.
107
108         Add most GTK-specific sources to unified build. API files are exempted, except for the DOM
109         API. Files shared with PluginProcessGTK2 are also exempted. Finally, files with name
110         conflicts in headers, which appears difficult to fix, are also exempted.
111
112         * CMakeLists.txt:
113         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
114         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
115         * NetworkProcess/soup/NetworkProcessSoup.cpp:
116         * NetworkProcess/soup/NetworkSessionSoup.cpp:
117         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
118         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
119         * PlatformGTK.cmake:
120         * PluginProcess/unix/PluginControllerProxyUnix.cpp:
121         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
122         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
123         * Shared/CoordinatedGraphics/SimpleViewportController.cpp:
124         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
125         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
126         * Shared/Plugins/unix/PluginSearchPath.cpp:
127         * Shared/cairo/ShareableBitmapCairo.cpp:
128         * Shared/glib/WebContextMenuItemGlib.cpp:
129         * Shared/glib/WebErrorsGlib.cpp:
130         * Shared/gtk/ArgumentCodersGtk.cpp:
131         * Shared/gtk/NativeWebKeyboardEventGtk.cpp:
132         * Shared/gtk/ProcessExecutablePathGtk.cpp:
133         * Shared/gtk/WebErrorsGtk.cpp:
134         * Shared/gtk/WebEventFactory.cpp:
135         * Shared/linux/WebMemorySamplerLinux.cpp:
136         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
137         * Shared/soup/WebErrorsSoup.cpp:
138         * SourcesGTK.txt: Added.
139         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
140         * UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp:
141         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
142         * UIProcess/BackingStore.cpp:
143         * UIProcess/DrawingAreaProxyImpl.cpp:
144         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
145         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
146         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
147         * UIProcess/WebResourceLoadStatisticsStore.cpp:
148         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
149         * UIProcess/WebStorage/StorageManager.cpp:
150         * UIProcess/cairo/BackingStoreCairo.cpp:
151         * UIProcess/gtk/AcceleratedBackingStore.cpp:
152         * UIProcess/gtk/DragAndDropHandler.cpp:
153         * UIProcess/gtk/GestureController.cpp:
154         * UIProcess/gtk/HardwareAccelerationManager.cpp:
155         * UIProcess/gtk/InputMethodFilter.cpp:
156         * UIProcess/gtk/TextCheckerGtk.cpp:
157         * UIProcess/gtk/WaylandCompositor.cpp:
158         * UIProcess/gtk/WebColorPickerGtk.cpp:
159         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
160         * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
161         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
162         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
163         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
164         (webkit_dom_attr_dom_event_target_init):
165         (webkit_dom_attr_set_property):
166         (webkit_dom_attr_get_property):
167         (webkit_dom_attr_class_init):
168         (webkit_dom_event_target_init): Deleted.
169         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
170         (webkit_dom_cdata_section_dom_event_target_init):
171         (webkit_dom_event_target_init): Deleted.
172         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
173         (webkit_dom_css_rule_set_property):
174         (webkit_dom_css_rule_get_property):
175         (webkit_dom_css_rule_class_init):
176         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
177         (webkit_dom_css_rule_list_get_property):
178         (webkit_dom_css_rule_list_class_init):
179         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
180         (webkit_dom_css_style_declaration_set_property):
181         (webkit_dom_css_style_declaration_get_property):
182         (webkit_dom_css_style_declaration_class_init):
183         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
184         (webkit_dom_css_style_sheet_get_property):
185         (webkit_dom_css_style_sheet_class_init):
186         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
187         (webkit_dom_css_value_set_property):
188         (webkit_dom_css_value_get_property):
189         (webkit_dom_css_value_class_init):
190         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
191         (webkit_dom_character_data_dom_event_target_init):
192         (webkit_dom_character_data_set_property):
193         (webkit_dom_character_data_get_property):
194         (webkit_dom_character_data_class_init):
195         (webkit_dom_event_target_init): Deleted.
196         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
197         (webkit_dom_client_rect_get_property):
198         (webkit_dom_client_rect_class_init):
199         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
200         (webkit_dom_client_rect_list_get_property):
201         (webkit_dom_client_rect_list_class_init):
202         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
203         (webkit_dom_comment_dom_event_target_init):
204         (webkit_dom_event_target_init): Deleted.
205         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
206         (webkit_dom_dom_selection_get_property):
207         (webkit_dom_dom_selection_class_init):
208         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
209         (webkit_dom_dom_token_list_set_property):
210         (webkit_dom_dom_token_list_get_property):
211         (webkit_dom_dom_token_list_class_init):
212         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
213         (webkit_dom_dom_window_dom_event_target_init):
214         (webkit_dom_dom_window_set_property):
215         (webkit_dom_dom_window_get_property):
216         (webkit_dom_dom_window_class_init):
217         (webkit_dom_event_target_init): Deleted.
218         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
219         (webkit_dom_document_dom_event_target_init):
220         (webkit_dom_document_set_property):
221         (webkit_dom_document_get_property):
222         (webkit_dom_document_class_init):
223         (webkit_dom_event_target_init): Deleted.
224         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
225         (webkit_dom_document_fragment_dom_event_target_init):
226         (webkit_dom_document_fragment_get_property):
227         (webkit_dom_document_fragment_class_init):
228         (webkit_dom_event_target_init): Deleted.
229         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
230         (webkit_dom_document_type_dom_event_target_init):
231         (webkit_dom_document_type_get_property):
232         (webkit_dom_document_type_class_init):
233         (webkit_dom_event_target_init): Deleted.
234         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
235         (webkit_dom_element_dom_event_target_init):
236         (webkit_dom_element_set_property):
237         (webkit_dom_element_get_property):
238         (webkit_dom_element_class_init):
239         (webkit_dom_event_target_init): Deleted.
240         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
241         (webkit_dom_event_set_property):
242         (webkit_dom_event_get_property):
243         (webkit_dom_event_class_init):
244         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
245         (webkit_dom_file_get_property):
246         (webkit_dom_file_class_init):
247         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
248         (webkit_dom_file_list_get_property):
249         (webkit_dom_file_list_class_init):
250         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
251         (webkit_dom_html_anchor_element_dom_event_target_init):
252         (webkit_dom_html_anchor_element_set_property):
253         (webkit_dom_html_anchor_element_get_property):
254         (webkit_dom_html_anchor_element_class_init):
255         (webkit_dom_event_target_init): Deleted.
256         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
257         (webkit_dom_html_applet_element_dom_event_target_init):
258         (webkit_dom_html_applet_element_set_property):
259         (webkit_dom_html_applet_element_get_property):
260         (webkit_dom_html_applet_element_class_init):
261         (webkit_dom_event_target_init): Deleted.
262         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
263         (webkit_dom_html_area_element_dom_event_target_init):
264         (webkit_dom_html_area_element_set_property):
265         (webkit_dom_html_area_element_get_property):
266         (webkit_dom_html_area_element_class_init):
267         (webkit_dom_event_target_init): Deleted.
268         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
269         (webkit_dom_html_br_element_dom_event_target_init):
270         (webkit_dom_html_br_element_set_property):
271         (webkit_dom_html_br_element_get_property):
272         (webkit_dom_html_br_element_class_init):
273         (webkit_dom_event_target_init): Deleted.
274         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
275         (webkit_dom_html_base_element_dom_event_target_init):
276         (webkit_dom_html_base_element_set_property):
277         (webkit_dom_html_base_element_get_property):
278         (webkit_dom_html_base_element_class_init):
279         (webkit_dom_event_target_init): Deleted.
280         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
281         (webkit_dom_html_body_element_dom_event_target_init):
282         (webkit_dom_html_body_element_set_property):
283         (webkit_dom_html_body_element_get_property):
284         (webkit_dom_html_body_element_class_init):
285         (webkit_dom_event_target_init): Deleted.
286         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
287         (webkit_dom_html_button_element_dom_event_target_init):
288         (webkit_dom_html_button_element_set_property):
289         (webkit_dom_html_button_element_get_property):
290         (webkit_dom_html_button_element_class_init):
291         (webkit_dom_event_target_init): Deleted.
292         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
293         (webkit_dom_html_canvas_element_dom_event_target_init):
294         (webkit_dom_html_canvas_element_set_property):
295         (webkit_dom_html_canvas_element_get_property):
296         (webkit_dom_html_canvas_element_class_init):
297         (webkit_dom_event_target_init): Deleted.
298         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
299         (webkit_dom_html_collection_get_property):
300         (webkit_dom_html_collection_class_init):
301         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
302         (webkit_dom_html_d_list_element_dom_event_target_init):
303         (webkit_dom_html_d_list_element_set_property):
304         (webkit_dom_html_d_list_element_get_property):
305         (webkit_dom_html_d_list_element_class_init):
306         (webkit_dom_event_target_init): Deleted.
307         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
308         (webkit_dom_html_directory_element_dom_event_target_init):
309         (webkit_dom_html_directory_element_set_property):
310         (webkit_dom_html_directory_element_get_property):
311         (webkit_dom_html_directory_element_class_init):
312         (webkit_dom_event_target_init): Deleted.
313         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
314         (webkit_dom_html_div_element_dom_event_target_init):
315         (webkit_dom_html_div_element_set_property):
316         (webkit_dom_html_div_element_get_property):
317         (webkit_dom_html_div_element_class_init):
318         (webkit_dom_event_target_init): Deleted.
319         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
320         (webkit_dom_html_document_dom_event_target_init):
321         (webkit_dom_html_document_set_property):
322         (webkit_dom_html_document_get_property):
323         (webkit_dom_html_document_class_init):
324         (webkit_dom_event_target_init): Deleted.
325         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
326         (webkit_dom_html_element_dom_event_target_init):
327         (webkit_dom_html_element_set_property):
328         (webkit_dom_html_element_get_property):
329         (webkit_dom_html_element_class_init):
330         (webkit_dom_event_target_init): Deleted.
331         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
332         (webkit_dom_html_embed_element_dom_event_target_init):
333         (webkit_dom_html_embed_element_set_property):
334         (webkit_dom_html_embed_element_get_property):
335         (webkit_dom_html_embed_element_class_init):
336         (webkit_dom_event_target_init): Deleted.
337         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
338         (webkit_dom_html_field_set_element_dom_event_target_init):
339         (webkit_dom_html_field_set_element_get_property):
340         (webkit_dom_html_field_set_element_class_init):
341         (webkit_dom_event_target_init): Deleted.
342         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
343         (webkit_dom_html_font_element_dom_event_target_init):
344         (webkit_dom_html_font_element_set_property):
345         (webkit_dom_html_font_element_get_property):
346         (webkit_dom_html_font_element_class_init):
347         (webkit_dom_event_target_init): Deleted.
348         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
349         (webkit_dom_html_form_element_dom_event_target_init):
350         (webkit_dom_html_form_element_set_property):
351         (webkit_dom_html_form_element_get_property):
352         (webkit_dom_html_form_element_class_init):
353         (webkit_dom_event_target_init): Deleted.
354         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
355         (webkit_dom_html_frame_element_dom_event_target_init):
356         (webkit_dom_html_frame_element_set_property):
357         (webkit_dom_html_frame_element_get_property):
358         (webkit_dom_html_frame_element_class_init):
359         (webkit_dom_event_target_init): Deleted.
360         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
361         (webkit_dom_html_frame_set_element_dom_event_target_init):
362         (webkit_dom_html_frame_set_element_set_property):
363         (webkit_dom_html_frame_set_element_get_property):
364         (webkit_dom_html_frame_set_element_class_init):
365         (webkit_dom_event_target_init): Deleted.
366         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
367         (webkit_dom_html_hr_element_dom_event_target_init):
368         (webkit_dom_html_hr_element_set_property):
369         (webkit_dom_html_hr_element_get_property):
370         (webkit_dom_html_hr_element_class_init):
371         (webkit_dom_event_target_init): Deleted.
372         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
373         (webkit_dom_html_head_element_dom_event_target_init):
374         (webkit_dom_html_head_element_set_property):
375         (webkit_dom_html_head_element_get_property):
376         (webkit_dom_html_head_element_class_init):
377         (webkit_dom_event_target_init): Deleted.
378         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
379         (webkit_dom_html_heading_element_dom_event_target_init):
380         (webkit_dom_html_heading_element_set_property):
381         (webkit_dom_html_heading_element_get_property):
382         (webkit_dom_html_heading_element_class_init):
383         (webkit_dom_event_target_init): Deleted.
384         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
385         (webkit_dom_html_html_element_dom_event_target_init):
386         (webkit_dom_html_html_element_set_property):
387         (webkit_dom_html_html_element_get_property):
388         (webkit_dom_html_html_element_class_init):
389         (webkit_dom_event_target_init): Deleted.
390         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
391         (webkit_dom_html_iframe_element_dom_event_target_init):
392         (webkit_dom_html_iframe_element_set_property):
393         (webkit_dom_html_iframe_element_get_property):
394         (webkit_dom_html_iframe_element_class_init):
395         (webkit_dom_event_target_init): Deleted.
396         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
397         (webkit_dom_html_image_element_dom_event_target_init):
398         (webkit_dom_html_image_element_set_property):
399         (webkit_dom_html_image_element_get_property):
400         (webkit_dom_html_image_element_class_init):
401         (webkit_dom_event_target_init): Deleted.
402         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
403         (webkit_dom_html_input_element_dom_event_target_init):
404         (webkit_dom_html_input_element_set_property):
405         (webkit_dom_html_input_element_get_property):
406         (webkit_dom_html_input_element_class_init):
407         (webkit_dom_event_target_init): Deleted.
408         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
409         (webkit_dom_html_li_element_dom_event_target_init):
410         (webkit_dom_html_li_element_set_property):
411         (webkit_dom_html_li_element_get_property):
412         (webkit_dom_html_li_element_class_init):
413         (webkit_dom_event_target_init): Deleted.
414         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
415         (webkit_dom_html_label_element_dom_event_target_init):
416         (webkit_dom_html_label_element_set_property):
417         (webkit_dom_html_label_element_get_property):
418         (webkit_dom_html_label_element_class_init):
419         (webkit_dom_event_target_init): Deleted.
420         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
421         (webkit_dom_html_legend_element_dom_event_target_init):
422         (webkit_dom_html_legend_element_set_property):
423         (webkit_dom_html_legend_element_get_property):
424         (webkit_dom_html_legend_element_class_init):
425         (webkit_dom_event_target_init): Deleted.
426         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
427         (webkit_dom_html_link_element_dom_event_target_init):
428         (webkit_dom_html_link_element_set_property):
429         (webkit_dom_html_link_element_get_property):
430         (webkit_dom_html_link_element_class_init):
431         (webkit_dom_event_target_init): Deleted.
432         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
433         (webkit_dom_html_map_element_dom_event_target_init):
434         (webkit_dom_html_map_element_set_property):
435         (webkit_dom_html_map_element_get_property):
436         (webkit_dom_html_map_element_class_init):
437         (webkit_dom_event_target_init): Deleted.
438         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
439         (webkit_dom_html_marquee_element_dom_event_target_init):
440         (webkit_dom_event_target_init): Deleted.
441         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
442         (webkit_dom_html_menu_element_dom_event_target_init):
443         (webkit_dom_html_menu_element_set_property):
444         (webkit_dom_html_menu_element_get_property):
445         (webkit_dom_html_menu_element_class_init):
446         (webkit_dom_event_target_init): Deleted.
447         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
448         (webkit_dom_html_meta_element_dom_event_target_init):
449         (webkit_dom_html_meta_element_set_property):
450         (webkit_dom_html_meta_element_get_property):
451         (webkit_dom_html_meta_element_class_init):
452         (webkit_dom_event_target_init): Deleted.
453         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
454         (webkit_dom_html_mod_element_dom_event_target_init):
455         (webkit_dom_html_mod_element_set_property):
456         (webkit_dom_html_mod_element_get_property):
457         (webkit_dom_html_mod_element_class_init):
458         (webkit_dom_event_target_init): Deleted.
459         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
460         (webkit_dom_html_o_list_element_dom_event_target_init):
461         (webkit_dom_html_o_list_element_set_property):
462         (webkit_dom_html_o_list_element_get_property):
463         (webkit_dom_html_o_list_element_class_init):
464         (webkit_dom_event_target_init): Deleted.
465         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
466         (webkit_dom_html_object_element_dom_event_target_init):
467         (webkit_dom_html_object_element_set_property):
468         (webkit_dom_html_object_element_get_property):
469         (webkit_dom_html_object_element_class_init):
470         (webkit_dom_event_target_init): Deleted.
471         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
472         (webkit_dom_html_opt_group_element_dom_event_target_init):
473         (webkit_dom_html_opt_group_element_set_property):
474         (webkit_dom_html_opt_group_element_get_property):
475         (webkit_dom_html_opt_group_element_class_init):
476         (webkit_dom_event_target_init): Deleted.
477         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
478         (webkit_dom_html_option_element_dom_event_target_init):
479         (webkit_dom_html_option_element_set_property):
480         (webkit_dom_html_option_element_get_property):
481         (webkit_dom_html_option_element_class_init):
482         (webkit_dom_event_target_init): Deleted.
483         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
484         (webkit_dom_html_options_collection_set_property):
485         (webkit_dom_html_options_collection_get_property):
486         (webkit_dom_html_options_collection_class_init):
487         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
488         (webkit_dom_html_paragraph_element_dom_event_target_init):
489         (webkit_dom_html_paragraph_element_set_property):
490         (webkit_dom_html_paragraph_element_get_property):
491         (webkit_dom_html_paragraph_element_class_init):
492         (webkit_dom_event_target_init): Deleted.
493         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
494         (webkit_dom_html_param_element_dom_event_target_init):
495         (webkit_dom_html_param_element_set_property):
496         (webkit_dom_html_param_element_get_property):
497         (webkit_dom_html_param_element_class_init):
498         (webkit_dom_event_target_init): Deleted.
499         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
500         (webkit_dom_html_pre_element_dom_event_target_init):
501         (webkit_dom_html_pre_element_set_property):
502         (webkit_dom_html_pre_element_get_property):
503         (webkit_dom_html_pre_element_class_init):
504         (webkit_dom_event_target_init): Deleted.
505         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
506         (webkit_dom_html_quote_element_dom_event_target_init):
507         (webkit_dom_html_quote_element_set_property):
508         (webkit_dom_html_quote_element_get_property):
509         (webkit_dom_html_quote_element_class_init):
510         (webkit_dom_event_target_init): Deleted.
511         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
512         (webkit_dom_html_script_element_dom_event_target_init):
513         (webkit_dom_html_script_element_set_property):
514         (webkit_dom_html_script_element_get_property):
515         (webkit_dom_html_script_element_class_init):
516         (webkit_dom_event_target_init): Deleted.
517         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
518         (webkit_dom_html_select_element_dom_event_target_init):
519         (webkit_dom_html_select_element_set_property):
520         (webkit_dom_html_select_element_get_property):
521         (webkit_dom_html_select_element_class_init):
522         (webkit_dom_event_target_init): Deleted.
523         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
524         (webkit_dom_html_style_element_dom_event_target_init):
525         (webkit_dom_html_style_element_set_property):
526         (webkit_dom_html_style_element_get_property):
527         (webkit_dom_html_style_element_class_init):
528         (webkit_dom_event_target_init): Deleted.
529         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
530         (webkit_dom_html_table_caption_element_dom_event_target_init):
531         (webkit_dom_html_table_caption_element_set_property):
532         (webkit_dom_html_table_caption_element_get_property):
533         (webkit_dom_html_table_caption_element_class_init):
534         (webkit_dom_event_target_init): Deleted.
535         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
536         (webkit_dom_html_table_cell_element_dom_event_target_init):
537         (webkit_dom_html_table_cell_element_set_property):
538         (webkit_dom_html_table_cell_element_get_property):
539         (webkit_dom_html_table_cell_element_class_init):
540         (webkit_dom_event_target_init): Deleted.
541         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
542         (webkit_dom_html_table_col_element_dom_event_target_init):
543         (webkit_dom_html_table_col_element_set_property):
544         (webkit_dom_html_table_col_element_get_property):
545         (webkit_dom_html_table_col_element_class_init):
546         (webkit_dom_event_target_init): Deleted.
547         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
548         (webkit_dom_html_table_element_dom_event_target_init):
549         (webkit_dom_html_table_element_set_property):
550         (webkit_dom_html_table_element_get_property):
551         (webkit_dom_html_table_element_class_init):
552         (webkit_dom_event_target_init): Deleted.
553         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
554         (webkit_dom_html_table_row_element_dom_event_target_init):
555         (webkit_dom_html_table_row_element_set_property):
556         (webkit_dom_html_table_row_element_get_property):
557         (webkit_dom_html_table_row_element_class_init):
558         (webkit_dom_html_table_row_element_insert_cell):
559         (webkit_dom_event_target_init): Deleted.
560         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
561         (webkit_dom_html_table_section_element_dom_event_target_init):
562         (webkit_dom_html_table_section_element_set_property):
563         (webkit_dom_html_table_section_element_get_property):
564         (webkit_dom_html_table_section_element_class_init):
565         (webkit_dom_event_target_init): Deleted.
566         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
567         (webkit_dom_html_text_area_element_dom_event_target_init):
568         (webkit_dom_html_text_area_element_set_property):
569         (webkit_dom_html_text_area_element_get_property):
570         (webkit_dom_html_text_area_element_class_init):
571         (webkit_dom_event_target_init): Deleted.
572         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
573         (webkit_dom_html_title_element_dom_event_target_init):
574         (webkit_dom_html_title_element_set_property):
575         (webkit_dom_html_title_element_get_property):
576         (webkit_dom_html_title_element_class_init):
577         (webkit_dom_event_target_init): Deleted.
578         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
579         (webkit_dom_html_u_list_element_dom_event_target_init):
580         (webkit_dom_html_u_list_element_set_property):
581         (webkit_dom_html_u_list_element_get_property):
582         (webkit_dom_html_u_list_element_class_init):
583         (webkit_dom_event_target_init): Deleted.
584         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
585         (webkit_dom_keyboard_event_get_property):
586         (webkit_dom_keyboard_event_class_init):
587         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
588         (webkit_dom_media_list_set_property):
589         (webkit_dom_media_list_get_property):
590         (webkit_dom_media_list_class_init):
591         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
592         (webkit_dom_mouse_event_get_property):
593         (webkit_dom_mouse_event_class_init):
594         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
595         (webkit_dom_named_node_map_get_property):
596         (webkit_dom_named_node_map_class_init):
597         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:
598         (webkit_dom_node_dom_event_target_init):
599         (webkit_dom_node_set_property):
600         (webkit_dom_node_get_property):
601         (webkit_dom_node_class_init):
602         (webkit_dom_event_target_init): Deleted.
603         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
604         (webkit_dom_node_iterator_get_property):
605         (webkit_dom_node_iterator_class_init):
606         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
607         (webkit_dom_node_list_get_property):
608         (webkit_dom_node_list_class_init):
609         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.cpp:
610         (webkitDOMObjectSetProperty):
611         (webkit_dom_object_class_init):
612         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
613         (webkit_dom_processing_instruction_dom_event_target_init):
614         (webkit_dom_processing_instruction_get_property):
615         (webkit_dom_processing_instruction_class_init):
616         (webkit_dom_event_target_init): Deleted.
617         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
618         (webkit_dom_range_get_property):
619         (webkit_dom_range_class_init):
620         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
621         (webkit_dom_style_sheet_set_property):
622         (webkit_dom_style_sheet_get_property):
623         (webkit_dom_style_sheet_class_init):
624         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
625         (webkit_dom_style_sheet_list_get_property):
626         (webkit_dom_style_sheet_list_class_init):
627         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
628         (webkit_dom_text_dom_event_target_init):
629         (webkit_dom_text_get_property):
630         (webkit_dom_text_class_init):
631         (webkit_dom_event_target_init): Deleted.
632         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
633         (webkit_dom_tree_walker_get_property):
634         (webkit_dom_tree_walker_class_init):
635         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
636         (webkit_dom_ui_event_get_property):
637         (webkit_dom_ui_event_class_init):
638         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
639         (webkit_dom_wheel_event_get_property):
640         (webkit_dom_wheel_event_class_init):
641         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
642         (webkit_dom_xpath_result_get_property):
643         (webkit_dom_xpath_result_class_init):
644         * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp:
645         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
646         * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp:
647         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
648         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp:
649         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
650         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
651         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
652         * WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp:
653         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
654         * WebProcess/WebPage/AcceleratedSurface.cpp:
655         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
656         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
657         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
658         * WebProcess/WebPage/DrawingAreaImpl.cpp:
659         * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp:
660         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
661         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
662         * WebProcess/gtk/WaylandCompositorDisplay.cpp:
663         * WebProcess/gtk/WebProcessMainGtk.cpp:
664
665 2018-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
666
667         WebDriver: addCookie command should prepend a dot to domain if missing
668         https://bugs.webkit.org/show_bug.cgi?id=182328
669         <rdar://problem/37116398>
670
671         Reviewed by Michael Catanzaro.
672
673         RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.
674
675         Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie
676
677         * UIProcess/Automation/WebAutomationSession.cpp:
678         (WebKit::WebAutomationSession::addSingleCookie):
679
680 2018-02-11  Yousuke Kimoto  <yousuke.kimoto@sony.com>
681
682         [WinCairo] Add WKBaseWin.h
683         https://bugs.webkit.org/show_bug.cgi?id=182681
684
685         Reviewed by Yusuke Suzuki.
686
687         * PlatformWin.cmake:
688         * Shared/API/c/win/WKBaseWin.h: Added.
689
690 2018-02-09  Ross Kirsling  <ross.kirsling@sony.com>
691
692         Remove invalidated WebPage::handleEditingKeyboardEvent default implementation after r228260.
693         https://bugs.webkit.org/show_bug.cgi?id=182663
694
695         Reviewed by Chris Dumez.
696
697         This would need to be updated to turn `keyEvent` into `underlyingPlatformEvent`;
698         instead, we can remove it, as it's only for Windows, which doesn't yet support WK2.
699
700         * WebProcess/WebPage/WebPage.cpp:
701         (WebKit::WebPage::handleEditingKeyboardEvent): Deleted.
702
703 2018-02-09  Nan Wang  <n_wang@apple.com>
704
705         AX: Accessibility is not notified when a web process cancels the suspension
706         https://bugs.webkit.org/show_bug.cgi?id=182659
707
708         Reviewed by Ryosuke Niwa.
709
710         We were notifying Accessibility with the web process suspended information in actualPrepareToSuspend
711         and processDidResume. However, the suspension can be canceled during the prepare call. So that we
712         should also post a notification in cancelPrepareToSuspend.
713
714         * WebProcess/WebProcess.cpp:
715         (WebKit::WebProcess::cancelPrepareToSuspend):
716
717 2018-02-09  Brent Fulgham  <bfulgham@apple.com>
718
719         Sandbox violating attempting to read log formatting preference file
720         https://bugs.webkit.org/show_bug.cgi?id=182648
721         <rdar://problem/36629495>
722
723         Reviewed by Eric Carlson.
724
725         Various frameworks attempt to read logging format information from /usr/local/lib/log. The sandbox is blocking
726         this, generating log spam and preventing some logging features from working properly. We should allow read
727         access to this path.
728
729         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
730         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
731         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
732         * WebProcess/com.apple.WebProcess.sb.in:
733
734 2018-02-08  Chris Dumez  <cdumez@apple.com>
735
736         There should be a way to disable [OverrideBuiltins] behavior in a given DOMWrapperWorld
737         https://bugs.webkit.org/show_bug.cgi?id=182524
738         <rdar://problem/9057327>
739
740         Reviewed by Ryosuke Niwa.
741
742         Add C API on WKBundleScriptWorld and Cocoa API on WKWebProcessPlugInScriptWorld to
743         disable the [OverrideBuiltins] behavior on a given script world.
744
745         The [OverrideBuiltins] behavior [1] is legacy behavior that is needed for Web compatibility
746         but allowing the client to disable this behavior in a given world makes development easier
747         and running injected script on uncontrolled content a lot more reliable.
748
749         [1] https://heycam.github.io/webidl/#OverrideBuiltins
750
751         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
752         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
753         (-[WKWebProcessPlugInScriptWorld disableOverrideBuiltinsBehavior]):
754         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
755         (WKBundleScriptWorldDisableOverrideBuiltinsBehavior):
756         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h:
757         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
758         (WebKit::InjectedBundleScriptWorld::disableOverrideBuiltinsBehavior):
759         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
760
761 2018-02-08  Ross Kirsling  <ross.kirsling@sony.com>
762
763         Remove WebProcessPool::platformInitialize stub.
764         https://bugs.webkit.org/show_bug.cgi?id=182621
765
766         Reviewed by Alex Christensen.
767
768         The #if here could be simplified to PLATFORM(WIN), but Windows too will need a proper implementation
769         as part of WK2 support, so this stub shouldn't need to exist at all.
770
771         * UIProcess/WebProcessPool.cpp:
772         (WebKit::WebProcessPool::platformInitialize): Deleted.
773
774 2018-02-08  Michael Catanzaro  <mcatanzaro@igalia.com>
775
776         TestController should not exercise cocoa-specific resource load statistics APIs
777         https://bugs.webkit.org/show_bug.cgi?id=182355
778
779         Reviewed by Alex Christensen.
780
781         Remove the Cocoa testing SPI, since it's redundant with the C API. Also, add a couple
782         missing cookie partitioning callbacks to the C API.
783
784         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
785         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
786         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
787         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
788         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
789         (-[WKWebsiteDataStore _resourceLoadStatisticsSetLastSeen:forHost:]): Deleted.
790         (-[WKWebsiteDataStore _resourceLoadStatisticsSetIsPrevalentResource:forHost:]): Deleted.
791         (-[WKWebsiteDataStore _resourceLoadStatisticsIsPrevalentResource:completionHandler:]): Deleted.
792         (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsSubFrameUnder:topFrameHost:completionHandler:]): Deleted.
793         (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsRedirectingTo:hostRedirectedTo:completionHandler:]): Deleted.
794         (-[WKWebsiteDataStore _resourceLoadStatisticsSetHadUserInteraction:forHost:]): Deleted.
795         (-[WKWebsiteDataStore _resourceLoadStatisticsSetHasHadNonRecentUserInteractionForHost:]): Deleted.
796         (-[WKWebsiteDataStore _resourceLoadStatisticsHadUserInteraction:completionHandler:]): Deleted.
797         (-[WKWebsiteDataStore _resourceLoadStatisticsSetIsGrandfathered:forHost:]): Deleted.
798         (-[WKWebsiteDataStore _resourceLoadStatisticsIsGrandfathered:completionHandler:]): Deleted.
799         (-[WKWebsiteDataStore _resourceLoadStatisticsSetSubframeUnderTopFrameOrigin:forHost:]): Deleted.
800         (-[WKWebsiteDataStore _resourceLoadStatisticsSetSubresourceUnderTopFrameOrigin:forHost:]): Deleted.
801         (-[WKWebsiteDataStore _resourceLoadStatisticsSetSubresourceUniqueRedirectTo:forHost:]): Deleted.
802         (-[WKWebsiteDataStore _resourceLoadStatisticsSetTimeToLiveUserInteraction:]): Deleted.
803         (-[WKWebsiteDataStore _resourceLoadStatisticsSetTimeToLiveCookiePartitionFree:]): Deleted.
804         (-[WKWebsiteDataStore _resourceLoadStatisticsSetMinimumTimeBetweenDataRecordsRemoval:]): Deleted.
805         (-[WKWebsiteDataStore _resourceLoadStatisticsSetGrandfatheringTime:]): Deleted.
806         (-[WKWebsiteDataStore _resourceLoadStatisticsSetMaxStatisticsEntries:]): Deleted.
807         (-[WKWebsiteDataStore _resourceLoadStatisticsSetPruneEntriesDownTo:]): Deleted.
808         (-[WKWebsiteDataStore _resourceLoadStatisticsProcessStatisticsAndDataRecords]): Deleted.
809         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]): Deleted.
810         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]): Deleted.
811         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]): Deleted.
812         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]): Deleted.
813         (-[WKWebsiteDataStore _resourceLoadStatisticsSubmitTelemetry]): Deleted.
814         (-[WKWebsiteDataStore _resourceLoadStatisticsSetNotifyPagesWhenDataRecordsWereScanned:]): Deleted.
815         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldClassifyResourcesBeforeDataRecordsRemoval:]): Deleted.
816         (-[WKWebsiteDataStore _resourceLoadStatisticsSetNotifyPagesWhenTelemetryWasCaptured:]): Deleted.
817         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]): Deleted.
818         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore:]): Deleted.
819         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]): Deleted.
820         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:completionHandler:]): Deleted.
821         (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]): Deleted.
822         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
823
824 2018-02-08  Don Olmstead  <don.olmstead@sony.com>
825
826         Remove JavaScriptCore/ForwardingHeaders directory
827         https://bugs.webkit.org/show_bug.cgi?id=182594
828
829         Reviewed by Mark Lam.
830
831         * PlatformGTK.cmake:
832
833 2018-02-08  Tim Horton  <timothy_horton@apple.com>
834
835         Make WebKit public headers modules-safe
836         https://bugs.webkit.org/show_bug.cgi?id=182611
837         <rdar://problem/37160164>
838
839         Reviewed by Dan Bernstein.
840
841         * UIProcess/API/Cocoa/WKPreviewElementInfo.h:
842         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
843         Import headers without which these WebKit headers can not be used alone.
844
845         * WebKit.xcodeproj/project.pbxproj:
846         Make WKWindowFeaturesPrivate a private header like it was supposed to be.
847
848 2018-02-08  Matt Lewis  <jlewis3@apple.com>
849
850         Unreviewed, rolling out r228262.
851
852         This broke an internal build alongside r228261.
853
854         Reverted changeset:
855
856         "WebDriver: addCookie command should prepend a dot to domain
857         if missing"
858         https://bugs.webkit.org/show_bug.cgi?id=182328
859         https://trac.webkit.org/changeset/228262
860
861 2018-02-08  Miguel Gomez  <magomez@igalia.com>
862
863         [GTK] WaylandCompositor misusing eglGetProcAddress
864         https://bugs.webkit.org/show_bug.cgi?id=182490
865
866         Reviewed by Michael Catanzaro.
867
868         Check that the appropriate extensions are available before calling eglGetProcAddress, as even
869         getting a non null value from it, the functionality can be disabled at runtime.
870
871         * UIProcess/gtk/WaylandCompositor.cpp:
872         (WebKit::WaylandCompositor::initializeEGL):
873
874 2018-02-08  Frederic Wang  <fwang@igalia.com>
875
876         Add scrolling node types to distinguish main frames and subframes.
877         https://bugs.webkit.org/show_bug.cgi?id=182533
878
879         Reviewed by Simon Fraser.
880
881         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: Replace the case of
882         FrameScrollingNode with MainFrameScrollingNode and SubframeScrollingNode.
883         (WebKit::encodeNodeAndDescendants):
884         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
885         (WebKit::dump):
886         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: Ditto.
887         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
888         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: Ditto and pass the node type to the
889         constructor of the frame scrolling node.
890         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
891         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: Replace the case of
892         FrameScrollingNode with MainFrameScrollingNode and SubframeScrollingNode.
893         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
894         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: In order to
895         determine whether the node is a main frame or subframe, use the node type instead of checking
896         whether the node as a parent.
897         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll):
898
899 2018-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
900
901         WebDriver: addCookie command should prepend a dot to domain if missing
902         https://bugs.webkit.org/show_bug.cgi?id=182328
903         <rdar://problem/37116398>
904
905         Reviewed by Michael Catanzaro.
906
907         RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.
908
909         Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie
910
911         * UIProcess/Automation/WebAutomationSession.cpp:
912         (WebKit::WebAutomationSession::addSingleCookie):
913
914 2018-01-13  Darin Adler  <darin@apple.com>
915
916         Event improvements
917         https://bugs.webkit.org/show_bug.cgi?id=179591
918
919         Reviewed by Chris Dumez.
920
921         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
922         (webkit_dom_wheel_event_init_wheel_event): Updated to call initWebKitWheelEvent.
923
924         * WebProcess/Plugins/PluginView.cpp: Removed include of ScriptValue.h.
925
926         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
927         (WebKit::WebEditorClient::executePendingEditorCommands):
928         Updated for name change from keyEvent to underlyingPlatformEvent.
929         (WebKit::WebEditorClient::handleInputMethodKeydown): Ditto.
930         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
931         (WebKit::WebEditorClient::handleKeyboardEvent): Ditto.
932         (WebKit::WebEditorClient::handleInputMethodKeydown): Ditto.
933
934         * WebProcess/WebPage/WebPage.cpp: Removed include of ScriptValue.h.
935
936         * WebProcess/WebPage/ios/WebPageIOS.mm:
937         (WebKit::WebPage::handleEditingKeyboardEvent): Updated for name change from
938         keyEvent to underlyingPlatformEvent.
939         * WebProcess/WebPage/mac/WebPageMac.mm:
940         (WebKit::WebPage::executeKeypressCommandsInternal): Ditto.
941         (WebKit::WebPage::handleEditingKeyboardEvent): Ditto.
942
943 2018-02-07  Antti Koivisto  <antti@apple.com> and Youenn Fablet  <youenn@apple.com>
944
945         REGRESSION(r227758): Webpage fails to load due to crash in com.apple.WebKit: WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse + 267
946         https://bugs.webkit.org/show_bug.cgi?id=182532
947         <rdar://problem/36414017>
948
949         Reviewed by Chris Dumez.
950
951         No test case, don't know how to make one. The repro involves multipart HTTP streaming and details are hazy.
952         We were calling a function that was WTFMoved away just a few lines above.
953
954         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
955         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
956
957 2018-02-07  Tim Horton  <timothy_horton@apple.com>
958
959         Evernote device management web view sometimes displays at the wrong scale
960         https://bugs.webkit.org/show_bug.cgi?id=182590
961         <rdar://problem/36633687>
962
963         Reviewed by Simon Fraser.
964
965         Evernote implements the WKWebView's scroll view's delegate method
966         viewForZoomingInScrollView: and returns nil. This results in
967         WKScrollView's zoomScale always returning 1, no matter what the
968         WKContentView's actual scale is. This will result in us never updating
969         the WKContentView's scale to 1. When loading a page that has a few
970         scale changes during load but ends up at scale 1, we get stuck at whatever
971         intermediate scale immediately preceded settling on 1.
972
973         Fix this by not forwarding viewForZoomingInScrollView: to the external
974         WKScrollView delegate; we are in charge of the contents of the scroll
975         view (including which view scrollView's zoomScale should track), and
976         overriding viewForZoomingInScrollView: is only ever going to lead to
977         a broken WebKit.
978
979         * UIProcess/ios/WKScrollView.mm:
980         (shouldForwardScrollViewDelegateMethodToExternalDelegate):
981         (-[WKScrollViewDelegateForwarder forwardInvocation:]):
982         (-[WKScrollViewDelegateForwarder forwardingTargetForSelector:]):
983
984 2018-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
985
986         [Extra zoom mode] Delegate scrolling from the content view to input view controllers
987         https://bugs.webkit.org/show_bug.cgi?id=182534
988         <rdar://problem/37276625>
989
990         Reviewed by Tim Horton.
991
992         Override -_wheelChangedWithEvent: on the content view, and give extra zoomed input view controllers a chance to
993         handle the event.
994
995         * Platform/spi/ios/UIKitSPI.h:
996         * UIProcess/ios/WKContentViewInteraction.mm:
997         (-[WKContentView _wheelChangedWithEvent:]):
998
999 2018-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
1000
1001         [Extra zoom mode] Implement multiple and single select menus
1002         https://bugs.webkit.org/show_bug.cgi?id=182525
1003         <rdar://problem/35143016>
1004
1005         Reviewed by Tim Horton.
1006
1007         Add support for presenting picker views when focusing single or multiple select elements. See changes below for
1008         additional detail.
1009
1010         * UIProcess/ios/WKContentViewInteraction.h:
1011         * UIProcess/ios/WKContentViewInteraction.mm:
1012         (-[WKContentView _startAssistingKeyboard]):
1013
1014         Move logic for presenting view controllers when focusing elements out of _startAssistingKeyboard, and into
1015         _startAssistingNode:(...). This is because _startAssistingKeyboard is only invoked for certain types of focused
1016         element types; importantly, this set excludes select elements. Putting the call to present the focused view
1017         controller there also didn't make much since, considering that these new view controllers are not tied to
1018         keyboards in any way.
1019
1020         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1021         (-[WKContentView _stopAssistingNode]):
1022
1023         Dismiss any select menu that is being presented.
1024
1025         (-[WKContentView presentSelectMenuViewController:]):
1026         (-[WKContentView dismissSelectMenuViewController:]):
1027
1028         Introduce idempotent helpers for presenting and dismissing the select menu view controller.
1029
1030         (-[WKContentView presentViewControllerForAssistedNode:]):
1031         (-[WKContentView selectMenu:didSelectItemAtIndex:]):
1032
1033         For single select menus. Called when the user selects a row.
1034
1035         (-[WKContentView didCancelSelectionInSelectMenu:]):
1036         (-[WKContentView numberOfItemsInSelectMenu:]):
1037         (-[WKContentView selectMenu:displayTextForItemAtIndex:]):
1038
1039         Indicates the text value to show at a given index.
1040
1041         (-[WKContentView selectMenu:didCheckItemAtIndex:checked:]):
1042
1043         For multiple select menus, invoked when an item is checked. The `checked` parameter indicates whether or not the
1044         item is now checked.
1045
1046         (-[WKContentView selectMenuSupportsMultipleSelection:]):
1047
1048         Indicates whether this select menu is single-item-only, or allows multiple items to be selected (checked).
1049
1050         (-[WKContentView selectMenu:hasCheckedOptionAtIndex:]):
1051
1052         For multiple select menus. Determines whether an option at the given index is checked.
1053
1054         (-[WKContentView startingIndexForSelectMenu:]):
1055
1056         Determines the index to instantly scroll to when presenting the select menu.
1057
1058         * UIProcess/ios/forms/WKSelectMenuViewController.h: Added.
1059         * UIProcess/ios/forms/WKSelectMenuViewController.mm: Added.
1060
1061         Add new harness files for WKSelectMenuViewController's header and implementation (see WebKitAdditions).
1062
1063         * WebKit.xcodeproj/project.pbxproj:
1064
1065 2018-02-07  Brent Fulgham  <bfulgham@apple.com>
1066
1067         Improve NetworkResourceLoader logging to capture redirect cases
1068         https://bugs.webkit.org/show_bug.cgi?id=182573
1069         <rdar://problem/37316714>
1070
1071         Reviewed by Chris Dumez.
1072
1073         Add logging for cookie partitioning or blocking during redirects.
1074
1075         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1076         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1077
1078 2018-02-07  John Wilander  <wilander@apple.com>
1079
1080         Restrict Referer to just the origin for third parties in private mode and third parties ITP blocks cookies for in regular mode
1081         https://bugs.webkit.org/show_bug.cgi?id=182559
1082         <rdar://problem/36990337>
1083
1084         Reviewed by Andy Estes.
1085
1086         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1087         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1088         (WebKit::NetworkDataTaskCocoa::isThirdPartyRequest):
1089             New convenience function. Checks whether the resource shares
1090             partition with the first party.
1091         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1092             Now strips the referrer to just the origin for:
1093             1. All third party requests in private mode.
1094             2. Third party requests to domains that ITP blocks cookies for.
1095         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1096             Now strips the referrer in redirects to just the origin for:
1097             1. All third party requests in private mode.
1098             2. Third party requests to domains that ITP blocks cookies for.
1099
1100 2018-02-07  Daniel Bates  <dabates@apple.com>
1101
1102         Log error when authentication challenge is blocked due to an insecure request
1103         https://bugs.webkit.org/show_bug.cgi?id=182358
1104
1105         Reviewed by Andy Estes.
1106
1107         Have network process notify the web process when it blocks an authentication challenge.
1108
1109         * NetworkProcess/NetworkLoad.cpp:
1110         (WebKit::NetworkLoad::completeAuthenticationChallenge):
1111         * NetworkProcess/NetworkLoadClient.h:
1112         (WebKit::NetworkLoadClient::didBlockAuthenticationChallenge):
1113         * NetworkProcess/NetworkResourceLoader.cpp:
1114         (WebKit::NetworkResourceLoader::didBlockAuthenticationChallenge):
1115         * NetworkProcess/NetworkResourceLoader.h:
1116         * WebProcess/Network/WebResourceLoader.cpp:
1117         (WebKit::WebResourceLoader::didBlockAuthenticationChallenge):
1118         * WebProcess/Network/WebResourceLoader.h:
1119         * WebProcess/Network/WebResourceLoader.messages.in:
1120
1121 2018-02-07  Chris Dumez  <cdumez@apple.com>
1122
1123         IndexedDB in service workers is using a memory backed store
1124         https://bugs.webkit.org/show_bug.cgi?id=182574
1125         <rdar://problem/37316205>
1126
1127         Reviewed by Youenn Fablet.
1128
1129         Make sure we pass a proper WebDatabaseProvider to the ServiceWorkerProcess via
1130         PageConfiguration. Otherwise, we end up using the default EmptyDatabaseProvider
1131         which uses an InProcessIDBServer and a memory-backed store for IndexedDB.
1132
1133         * UIProcess/ServiceWorkerProcessProxy.cpp:
1134         (WebKit::ServiceWorkerProcessProxy::start):
1135         * UIProcess/WebProcessPool.h:
1136         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1137         (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
1138         (WebKit::WebSWContextManagerConnection::installServiceWorker):
1139         * WebProcess/Storage/WebSWContextManagerConnection.h:
1140         * WebProcess/WebProcess.cpp:
1141         (WebKit::WebProcess::establishWorkerContextConnectionToStorageProcess):
1142         * WebProcess/WebProcess.h:
1143         * WebProcess/WebProcess.messages.in:
1144
1145 2018-02-07  Michael Catanzaro  <mcatanzaro@igalia.com>
1146
1147         [GTK] Typo in a translatable string
1148         https://bugs.webkit.org/show_bug.cgi?id=182570
1149
1150         Unreviewed. Fix a typo.
1151
1152         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
1153         (webkit_website_data_manager_class_init):
1154
1155 2018-02-06  Don Olmstead  <don.olmstead@sony.com>
1156
1157         Remove WebCore/ForwardingHeaders directory
1158         https://bugs.webkit.org/show_bug.cgi?id=182347
1159
1160         Reviewed by Keith Miller.
1161
1162         * Platform/mac/StringUtilities.mm:
1163         * Shared/Cocoa/WebKit2InitializeCocoa.mm:
1164         * Shared/WebKit2Initialize.cpp:
1165         * Shared/linux/WebMemorySamplerLinux.cpp:
1166         * Shared/mac/WebMemorySampler.mac.mm:
1167         * UIProcess/WebProcessPool.cpp:
1168         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
1169         * WebProcess/InjectedBundle/API/glib/WebKitConsoleMessagePrivate.h:
1170         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
1171         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1172         * WebProcess/Plugins/PluginProcessConnection.cpp:
1173         * WebProcess/Plugins/PluginView.cpp:
1174         * WebProcess/WebPage/WebInspector.h:
1175         * WebProcess/WebPage/WebPage.cpp:
1176         * WebProcess/cocoa/WebProcessCocoa.mm:
1177
1178 2018-02-06  Chris Dumez  <cdumez@apple.com>
1179
1180         Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/fetch-waits-for-activate.https.html is a flaky failure on macOS and iOS
1181         https://bugs.webkit.org/show_bug.cgi?id=181392
1182         <rdar://problem/36384136>
1183
1184         Reviewed by Youenn Fablet.
1185
1186         All tasks from the StorageProcess to the WebContent process to update registrations
1187         and service workers state are posted to the runloop. However, the fetch callbacks
1188         do not do so. This means that fetch results might come in out of order with regards
1189         to the registration / service worker state updates. The test was flaky because an
1190         intercepted load would sometimes finish before the task to update the service worker
1191         state to "activated" was processed by the runloop. We address the issue by having
1192         the ServiceWorkerClientFetch callbacks schedule tasks to the runloop too.
1193
1194         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1195         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
1196         (WebKit::ServiceWorkerClientFetch::didReceiveData):
1197         (WebKit::ServiceWorkerClientFetch::didFinish):
1198         (WebKit::ServiceWorkerClientFetch::didFail):
1199         (WebKit::ServiceWorkerClientFetch::didNotHandle):
1200
1201 2018-02-06  Brent Fulgham  <bfulgham@apple.com>
1202
1203         [macOS] Correct sandbox violation triggered by Chase.com
1204         https://bugs.webkit.org/show_bug.cgi?id=182519
1205         <rdar://problem/37121757>
1206
1207         Reviewed by Eric Carlson.
1208
1209         Hitting a sandbox violation when attempting to check status of IOAV*En/Decode support.
1210
1211         * WebProcess/com.apple.WebProcess.sb.in:
1212
1213 2018-02-06  Jeff Miller  <jeffm@apple.com>
1214
1215         Add WKNavigationDelegate SPI to tell the client when an insecure plug-in is blocked
1216         https://bugs.webkit.org/show_bug.cgi?id=182540
1217
1218         Reviewed by Alex Christensen.
1219
1220         * UIProcess/API/APILoaderClient.h:
1221         (API::LoaderClient::didBlockInsecurePluginVersion):
1222         Changed to take a dictionary reference.
1223
1224         * UIProcess/API/APINavigationClient.h:
1225         (API::NavigationClient::didBlockInsecurePluginVersion):
1226         Added.
1227
1228         * UIProcess/API/C/WKPage.cpp:
1229         (WKPageSetPageLoaderClient):
1230         Changed didBlockInsecurePluginVersion() to take a dictionary reference.
1231
1232         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1233         Added -_webView:didBlockInsecurePluginVersionWithInfo:.
1234
1235         * UIProcess/Cocoa/NavigationState.h:
1236         * UIProcess/Cocoa/NavigationState.mm:
1237         (WebKit::NavigationState::setNavigationDelegate):
1238         Initialize webViewDidBlockInsecurePluginVersionWithInfo.
1239
1240         (WebKit::NavigationState::NavigationClient::didBlockInsecurePluginVersion):
1241         Added.
1242
1243         * UIProcess/WebPageProxy.cpp:
1244         (WebKit::WebPageProxy::didBlockInsecurePluginVersion):
1245         Remove check for PLATFORM(COCOA) (we don't check for this in didFailToInitializePlugin() where we
1246         also use createPluginInformationDictionary()) and ENABLE(NETSCAPE_PLUGIN_API) (we're already inside
1247         an #if ENABLE(NETSCAPE_PLUGIN_API block) and use auto for pluginInformation. Attempt to use the
1248         navigation client before the loader client.
1249
1250 2018-02-06  Youenn Fablet  <youenn@apple.com>
1251
1252         HasServiceWorkerRegistration bit should be sent when creating a new page
1253         https://bugs.webkit.org/show_bug.cgi?id=182410
1254
1255         Reviewed by Chris Dumez.
1256
1257         Move the bit computation at page creation time.
1258         This allows computing the bit based on the web site data store and not only on the pool configuration.
1259         WebPage uses that bit to activate service worker registration matching for the whole process.
1260
1261         In case there is a service worker process proxy created, the bit is set to true by default.
1262
1263         Bit is computed by checking for database file presence.
1264         This information is cached in a map for efficiency reasons and cleared when a service worker process proxy is created.
1265
1266         * Shared/WebPageCreationParameters.cpp:
1267         (WebKit::WebPageCreationParameters::encode const):
1268         (WebKit::WebPageCreationParameters::decode):
1269         * Shared/WebPageCreationParameters.h:
1270         * Shared/WebProcessCreationParameters.cpp:
1271         (WebKit::WebProcessCreationParameters::encode const):
1272         (WebKit::WebProcessCreationParameters::decode):
1273         * Shared/WebProcessCreationParameters.h:
1274         * UIProcess/WebPageProxy.cpp:
1275         (WebKit::WebPageProxy::initializeWebPage):
1276         * UIProcess/WebProcessPool.cpp:
1277         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
1278         (WebKit::WebProcessPool::initializeNewWebProcess):
1279         (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
1280         * WebProcess/WebPage/WebPage.cpp:
1281         (WebKit::m_cpuLimit):
1282         * WebProcess/WebProcess.cpp:
1283         (WebKit::WebProcess::initializeWebProcess):
1284
1285 2018-02-06  Michael Catanzaro  <mcatanzaro@igalia.com>
1286
1287         Unreviewed, fix format specifiers added in r228116
1288         https://bugs.webkit.org/show_bug.cgi?id=182456
1289         <rdar://problem/37181006>
1290
1291         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
1292         (WebKit::CacheStorageEngineConnection::open):
1293         (WebKit::CacheStorageEngineConnection::remove):
1294         (WebKit::CacheStorageEngineConnection::caches):
1295         (WebKit::CacheStorageEngineConnection::retrieveRecords):
1296         (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
1297         (WebKit::CacheStorageEngineConnection::putRecords):
1298         (WebKit::CacheStorageEngineConnection::reference):
1299         (WebKit::CacheStorageEngineConnection::dereference):
1300
1301 2018-02-05  Chris Dumez  <cdumez@apple.com>
1302
1303         Avoid unnecessarily constructing RunLoops for GC AutomaticThreads in Connection::sendMessage() after r228001
1304         https://bugs.webkit.org/show_bug.cgi?id=182494
1305         <rdar://problem/37147632>
1306
1307         Reviewed by Ryosuke Niwa.
1308
1309         Somebody fixed a GC crash in r228001 by allowing RunLoop::current() to be called from a
1310         GC thread. However, this is still unnecessarily inefficient. Calling RunLoop::current()
1311         will construct RunLoops for background GC threads (WTF::AutomaticThreads). This patches
1312         updates the IPC code to call isMainThread() instead of RunLoop::isMain() in
1313         Connection::sendMessage(). This should mean the same thing since this code runs in
1314         WebKit2 and should be more efficient as it ends up simply calling pthread_main_np(),
1315         without constructing a RunLoop.
1316
1317         * Platform/IPC/Connection.cpp:
1318         (IPC::Connection::sendMessage):
1319
1320 2018-02-05  Ryosuke Niwa  <rniwa@webkit.org>
1321
1322         Release assertion in inlineVideoFrame
1323         https://bugs.webkit.org/show_bug.cgi?id=182513
1324         <rdar://problem/37159363>
1325
1326         Reviewed by Zalan Bujtas.
1327
1328         Fixed the bug. Don't try to update the layout when there is no live render tree or active DOM objects
1329         had been stopped: i.e. during a document destruction.
1330
1331         * WebProcess/cocoa/VideoFullscreenManager.mm:
1332         (WebKit::inlineVideoFrame):
1333
1334 2018-02-05  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1335
1336         [WinCairo] Refine WebKitLegacy and WebKit build for wincairo
1337         https://bugs.webkit.org/show_bug.cgi?id=182478
1338
1339         Reviewed by Alex Christensen.
1340
1341         Fixed a typo of forwarding header path for InjectedBundle and copying header
1342         method, which should use FLATTENED.
1343
1344         * PlatformWin.cmake: Fix a typo of a forwarding header path for InjectedBundle and use FLATTENED.
1345
1346 2018-02-05  Youenn Fablet  <youenn@apple.com>
1347
1348         WebsiteDataStore::resolveDirectoriesIfNecessary() should not overwrite its resolved serviceWorkerRegistrationDirectory  if already set
1349         https://bugs.webkit.org/show_bug.cgi?id=182514
1350
1351         Reviewed by Chris Dumez.
1352
1353         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1354         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
1355
1356 2018-02-05  Brent Fulgham  <bfulgham@apple.com>
1357
1358         [iOS] Storage process is using the wrong sandbox profile filename
1359         https://bugs.webkit.org/show_bug.cgi?id=182500
1360         <rdar://problem/37232614>
1361
1362         Reviewed by David Kilzer.
1363
1364         The iOS entitlements file was still referencing the old Databases sandbox profile, even though the
1365         process has been renamed 'Storage'.
1366
1367         * Configurations/Databases-iOS.entitlements:
1368
1369 2018-02-05  Ryosuke Niwa  <rniwa@webkit.org>
1370
1371         Add DoNotProcessIncomingMessagesWhenWaitingForSyncReply to GetPlugins and RootViewToScreen
1372         https://bugs.webkit.org/show_bug.cgi?id=182458
1373
1374         Reviewed by Chris Dumez.
1375
1376         Added DoNotProcessIncomingMessagesWhenWaitingForSyncReply to GetPlugins and RootViewToScreen
1377         which are found to get sent from WebContent process while ScriptDisallowedScope is present
1378         by a work-in-progress patch on webkit.org/b/182449.
1379
1380         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
1381         (WebKit::WebPluginInfoProvider::populatePluginCache):
1382         * WebProcess/WebPage/WebPage.cpp:
1383         (WebKit::WebPage::rootViewToScreen):
1384
1385 2018-02-05  Commit Queue  <commit-queue@webkit.org>
1386
1387         Unreviewed, rolling out r227964 and r228087.
1388         https://bugs.webkit.org/show_bug.cgi?id=182508
1389
1390         These introduced an API test  failure with
1391         URLTest.HostIsIPAddress alongside commit r228086 (Requested by
1392         mlewis13 on #webkit).
1393
1394         Reverted changesets:
1395
1396         "[SOUP] Ensure domain is valid when converting a WebCore
1397         Cookie to Soup"
1398         https://bugs.webkit.org/show_bug.cgi?id=182328
1399         https://trac.webkit.org/changeset/227964
1400
1401         "WebDriver: addCookie command should prepend a dot to domain
1402         if missing"
1403         https://bugs.webkit.org/show_bug.cgi?id=182328
1404         https://trac.webkit.org/changeset/228087
1405
1406 2018-02-05  Wenson Hsieh  <wenson_hsieh@apple.com>
1407
1408         [Extra zoom mode] Implement number pad UI when editing `tel` and `number` inputs
1409         https://bugs.webkit.org/show_bug.cgi?id=182472
1410         <rdar://problem/35143057>
1411
1412         Reviewed by Tim Horton.
1413
1414         Allows the user to edit numeric input types using a number pad. See below comments for more detail.
1415
1416         * UIProcess/ios/WKContentViewInteraction.h:
1417         * UIProcess/ios/WKContentViewInteraction.mm:
1418         (-[WKContentView _startAssistingKeyboard]):
1419         (-[WKContentView _stopAssistingNode]):
1420
1421         Dismiss the number pad, if it is present.
1422
1423         (-[WKContentView dismissNumberPadViewController:]):
1424         (-[WKContentView presentNumberPadViewController:]):
1425
1426         Add new helpers for showing and hiding the number pad view controller.
1427
1428         (-[WKContentView presentViewControllerForAssistedNode:]):
1429         (-[WKContentView textInputController:didRequestDismissalWithAction:]):
1430
1431         Dismiss the number pad, if it is present.
1432
1433         (-[WKContentView focusedFormControlControllerDidBeginEditing:]):
1434         (-[WKContentView shouldPresentTextInputViewController:]): Deleted.
1435
1436         Remove -shouldPresentTextInputViewController and replace it with -presentViewControllerForAssistedNode:, which
1437         presents the appropriate view controller given "assisted" node information.
1438
1439         * UIProcess/ios/forms/WKNumberPadView.h: Added.
1440         * UIProcess/ios/forms/WKNumberPadView.mm: Added.
1441         * UIProcess/ios/forms/WKNumberPadViewController.h: Added.
1442         * UIProcess/ios/forms/WKNumberPadViewController.mm: Added.
1443
1444         Add "WebKitAdditions harness" files for the new number pad view and view controller classes.
1445
1446         * WebKit.xcodeproj/project.pbxproj:
1447
1448 2018-02-05  Youenn Fablet  <youenn@apple.com>
1449
1450         Add logging to CacheStorageEngineConnection
1451         https://bugs.webkit.org/show_bug.cgi?id=182456
1452
1453         Reviewed by Chris Dumez.
1454
1455         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
1456         (WebKit::CacheStorageEngineConnection::open):
1457         (WebKit::CacheStorageEngineConnection::remove):
1458         (WebKit::CacheStorageEngineConnection::caches):
1459         (WebKit::CacheStorageEngineConnection::retrieveRecords):
1460         (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
1461         (WebKit::CacheStorageEngineConnection::putRecords):
1462         (WebKit::CacheStorageEngineConnection::reference):
1463         (WebKit::CacheStorageEngineConnection::dereference):
1464         * Platform/Logging.h:
1465
1466 2018-02-05  Daniel Bates  <dabates@apple.com>
1467
1468         REGRESSION (r222795): Nike app "Refused to set unsafe header" when adding and viewing cart
1469         https://bugs.webkit.org/show_bug.cgi?id=182491
1470         <rdar://problem/36533447>
1471
1472         Reviewed by Brent Fulgham.
1473
1474         Exempt Nike from the XHR header restrictions in r222795.
1475
1476         Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
1477         However Nike also depends on such functionality.
1478
1479         * UIProcess/API/Cocoa/WKWebView.mm:
1480         (shouldAllowSettingAnyXHRHeaderFromFileURLs):
1481
1482 2018-02-02  Brent Fulgham  <bfulgham@apple.com>
1483
1484         Improve NetworkResourceLoader logging so it can be used for 'setCookiesFromDOM'
1485         https://bugs.webkit.org/show_bug.cgi?id=182455
1486         <rdar://problem/36626601>
1487
1488         Reviewed by Chris Dumez.
1489
1490         Refactor "logCookieInformation" so that it can be used for resource loads and DOM cookie
1491         manipulation. Place the generally useful logic in a static method that can be invoked
1492         from other places in the NetworkProcess.
1493
1494         Call the new refactored method from NetworkConnectionToWebProcess::setCookiesFromDOM so
1495         we can perform logging there as well.
1496
1497         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1498         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): Call the new logging method
1499         (when enabled).
1500         * NetworkProcess/NetworkResourceLoader.cpp:
1501         (WebKit::NetworkResourceLoader::shouldLogCookieInformation): Changed to static method.
1502         (WebKit::escapeForJSON): Made a static function so it could be shared between multiple
1503         methods.
1504         (WebKit::NetworkResourceLoader::logCookieInformation const): Refactor into two methods.
1505         (WebKit::NetworkResourceLoader::logCookieInformation): Ditto.
1506         (WebKit::NetworkResourceLoader::shouldLogCookieInformation const): Deleted.
1507         * NetworkProcess/NetworkResourceLoader.h:
1508         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1509         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Switch to user-enabled release logging
1510         to track partitioning and blocking behavior.
1511
1512 2018-02-05  John Wilander  <wilander@apple.com>
1513
1514         Storage Access API: Add testRunner.getAllStorageAccessEntries() to make testing easier and more explicit
1515         https://bugs.webkit.org/show_bug.cgi?id=181601
1516         <rdar://problem/36475837>
1517
1518         Reviewed by Alex Christensen.
1519
1520         http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html
1521         was found to be flaky. With the testRunner.hasStorageAccessEntry() getter
1522         it's possible to check access even if a frame doesn't respond timely to
1523         postMessage after detach and attach.
1524
1525         * NetworkProcess/NetworkProcess.cpp:
1526         (WebKit::NetworkProcess::getAllStorageAccessEntries):
1527         * NetworkProcess/NetworkProcess.h:
1528         * NetworkProcess/NetworkProcess.messages.in:
1529         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1530         (-[WKWebsiteDataStore _getAllStorageAccessEntries:]):
1531         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1532         * UIProcess/Network/NetworkProcessProxy.cpp:
1533         (WebKit::NetworkProcessProxy::getAllStorageAccessEntries):
1534         (WebKit::NetworkProcessProxy::allStorageAccessEntriesResult):
1535         * UIProcess/Network/NetworkProcessProxy.h:
1536         * UIProcess/Network/NetworkProcessProxy.messages.in:
1537         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1538         (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
1539         * UIProcess/WebsiteData/WebsiteDataStore.h:
1540
1541 2018-02-05  Daniel Bates  <dabates@apple.com>
1542
1543         Disallow evaluating JavaScript from NPP_Destroy() in WebKit
1544         https://bugs.webkit.org/show_bug.cgi?id=181889
1545         <rdar://problem/36674701>
1546
1547         Reviewed by Brent Fulgham.
1548
1549         Make the behavior of WebKit match the behavior of WebKitLegacy on Mac.
1550
1551         * Shared/Plugins/NPObjectMessageReceiver.cpp:
1552         (WebKit::NPObjectMessageReceiver::hasMethod):
1553         (WebKit::NPObjectMessageReceiver::invoke):
1554         (WebKit::NPObjectMessageReceiver::invokeDefault):
1555         (WebKit::NPObjectMessageReceiver::hasProperty):
1556         (WebKit::NPObjectMessageReceiver::getProperty):
1557         (WebKit::NPObjectMessageReceiver::setProperty):
1558         (WebKit::NPObjectMessageReceiver::removeProperty):
1559         (WebKit::NPObjectMessageReceiver::enumerate):
1560         (WebKit::NPObjectMessageReceiver::construct):
1561         Bail out if the plugin is executing NPP_Destroy().
1562
1563         * WebProcess/Plugins/Plugin.cpp:
1564         (WebKit::Plugin::destroyPlugin):
1565         * WebProcess/Plugins/Plugin.h:
1566         (WebKit::Plugin::isBeingDestroyed const):
1567         Move bookkeeping of whether the plugin is being destroyed from PluginView
1568         to here. This makes it straightforward for NPObjectMessageReceiver to query
1569         this information.
1570
1571         * WebProcess/Plugins/PluginView.cpp:
1572         (WebKit::PluginView::~PluginView):
1573         (WebKit::PluginView::destroyPluginAndReset):
1574         (WebKit::PluginView::recreateAndInitialize):
1575         (WebKit::PluginView::protectPluginFromDestruction):
1576         (WebKit::PluginView::unprotectPluginFromDestruction):
1577         Move bookkeeping of whether the plugin is being destroyed from here
1578         to Plugin.
1579
1580         * WebProcess/Plugins/PluginView.h:
1581         (WebKit::PluginView::isBeingDestroyed const): Turn around and ask the plugin if it
1582         is being destroyed, if we have one.
1583
1584 2018-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1585
1586         WebDriver: addCookie command should prepend a dot to domain if missing
1587         https://bugs.webkit.org/show_bug.cgi?id=182328
1588         <rdar://problem/37116398>
1589
1590         Reviewed by Michael Catanzaro.
1591
1592         RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.
1593
1594         Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie
1595
1596         * UIProcess/Automation/WebAutomationSession.cpp:
1597         (WebKit::WebAutomationSession::addSingleCookie):
1598
1599 2018-02-03  Tim Horton  <timothy_horton@apple.com>
1600
1601         UI process sometimes crashes under -[WKContentView _lookupForWebView:]
1602         https://bugs.webkit.org/show_bug.cgi?id=182460
1603         <rdar://problem/33260602>
1604
1605         Reviewed by Wenson Hsieh.
1606
1607         * UIProcess/ios/WKContentViewInteraction.mm:
1608         (-[WKContentView _lookupForWebView:]):
1609         If you have a range selection, but no rects for the selection, retrieving
1610         the 0th element of selectionRects will crash the UI process. To fix, in
1611         this case, use the rect for the starting caret instead.
1612
1613         It doesn't seem like the presentationRect is actually currently used for
1614         the Lookup service, so the only impact is that we shouldn't crash anymore.
1615
1616 2018-02-02  Michael Catanzaro  <mcatanzaro@igalia.com>
1617
1618         Remove remaining dead !USE(NETWORK_SESSION) code
1619         https://bugs.webkit.org/show_bug.cgi?id=182451
1620
1621         Reviewed by Alex Christensen.
1622
1623         DownloadCurl.cpp and AuthenticationManagerSoup.cpp have been dead code since NETWORK_SESSION
1624         became mandatory.
1625
1626         * NetworkProcess/Downloads/curl/DownloadCurl.cpp: Removed.
1627         * PlatformGTK.cmake:
1628         * PlatformWPE.cmake:
1629         * PlatformWin.cmake:
1630         * Shared/Authentication/soup/AuthenticationManagerSoup.cpp: Removed.
1631
1632 2018-02-02  Youenn Fablet  <youenn@apple.com>
1633
1634         CacheStorage should check for origin file presence when computing the origin of a folder
1635         https://bugs.webkit.org/show_bug.cgi?id=182454
1636
1637         Reviewed by Chris Dumez.
1638
1639         In case caches is opened for an origin but no cache is added, we do not have a caches name file but we do have an origin filename.
1640         We should be checking the origin filename anyway since we will be reading it afterwards.
1641
1642         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1643         (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
1644
1645 2018-02-02  Youenn Fablet  <youenn@apple.com>
1646
1647         Configure serviceWorkerRegistrationDirectory on the web site data store and move it to a Caches subfolder as a default
1648         https://bugs.webkit.org/show_bug.cgi?id=182403
1649         <rdar://problem/36673358>
1650
1651         Reviewed by Alex Christensen.
1652
1653         * UIProcess/WebProcessPool.cpp:
1654         (WebKit::legacyWebsiteDataStoreConfiguration): Setting serviceWorkerRegistrationDirectory for legacy stores.
1655
1656 2018-02-02  Youenn Fablet  <youenn@apple.com>
1657
1658         Clearing all service worker registrations should wait for importing service worker registration to finish
1659         https://bugs.webkit.org/show_bug.cgi?id=182407
1660
1661         Reviewed by Chris Dumez.
1662
1663         Updating API to take a completion handler.
1664
1665         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1666         (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
1667         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1668
1669 2018-02-02  Fujii Hironori  <Hironori.Fujii@sony.com>
1670
1671         [Win] MSVC doesn't seem to like "friend class NeverDestroyed<Foo>"
1672         https://bugs.webkit.org/show_bug.cgi?id=182081
1673
1674         Reviewed by Yusuke Suzuki.
1675
1676         The template friend class, which belongs to a different namespace,
1677         can't access private member if its friend declaration is specified
1678         without the namespace and with class keyword.
1679
1680         Replaced "friend class NeverDestroyed<Foo>" with "friend NeverDestroyed<Foo>".
1681
1682         * NetworkProcess/NetworkProcess.h:
1683         * NetworkProcess/capture/NetworkCaptureManager.h:
1684         * PluginProcess/PluginProcess.h:
1685         * Shared/CallbackID.h:
1686         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
1687         * StorageProcess/StorageProcess.h:
1688         * UIProcess/Plugins/PluginProcessManager.h:
1689         * UIProcess/Plugins/gtk/PluginInfoCache.h:
1690         * UIProcess/WebPageProxy.cpp:
1691         * UIProcess/WebPasteboardProxy.h:
1692         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
1693         * UIProcess/gtk/HardwareAccelerationManager.h:
1694         * UIProcess/gtk/WaylandCompositor.h:
1695         * UIProcess/linux/MemoryPressureMonitor.h:
1696         * UIProcess/mac/ServicesController.h:
1697         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.h:
1698         * WebProcess/Plugins/WebPluginInfoProvider.h:
1699         * WebProcess/WebCoreSupport/WebPasteboardOverrides.h:
1700         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1701
1702 2018-02-02  Youenn Fablet  <youenn@apple.com>
1703
1704         Configure serviceWorkerRegistrationDirectory on the web site data store and move it to a Caches subfolder as a default
1705         https://bugs.webkit.org/show_bug.cgi?id=182403
1706
1707         Reviewed by Alex Christensen.
1708
1709         WebsiteDataStore is the place to set configuration information such as service worker registration path.
1710         This patch updates WebKit code accordingly.
1711         By default, the service worker registration path is in a Caches subfolder, similarly to cache API path.
1712
1713         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1714         (API::ProcessPoolConfiguration::createWithLegacyOptions):
1715         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
1716         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
1717         (API::ProcessPoolConfiguration::copy):
1718         * UIProcess/API/APIProcessPoolConfiguration.h:
1719         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1720         (WKContextConfigurationCopyServiceWorkerDatabaseDirectory): Deleted.
1721         (WKContextConfigurationSetServiceWorkerDatabaseDirectory): Deleted.
1722         * UIProcess/API/C/WKContextConfigurationRef.h:
1723         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
1724         (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
1725         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1726         (-[WKWebsiteDataStore _serviceWorkerRegistrationDirectory]):
1727         (-[WKWebsiteDataStore _setServiceWorkerRegistrationDirectory:]):
1728         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1729         * UIProcess/WebProcessPool.cpp:
1730         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
1731         (WebKit::WebProcessPool::initializeNewWebProcess):
1732         * UIProcess/WebsiteData/WebsiteDataStore.h:
1733         (WebKit::WebsiteDataStore::serviceWorkerRegistrationDirectory const):
1734         (WebKit::WebsiteDataStore::setServiceWorkerRegistrationDirectory):
1735         * UIProcess/gtk/WebProcessPoolGtk.cpp:
1736         * UIProcess/gtk/WebProcessPoolWPE.cpp:
1737
1738 2018-02-02  Wenson Hsieh  <wenson_hsieh@apple.com>
1739
1740         [Extra Zoom Mode] Implement support for indirect mainframe scrolling
1741         https://bugs.webkit.org/show_bug.cgi?id=182421
1742         <rdar://problem/35142694>
1743
1744         Reviewed by Tim Horton.
1745
1746         Makes a few small adjustments to WKScrollView to improve mainframe scrolling, and disable the pinch gesture for
1747         zooming. See below for more details.
1748
1749         * UIProcess/API/Cocoa/WKWebView.mm:
1750
1751         Remove a now-unneeded WebKitAdditions import.
1752
1753         * UIProcess/ios/WKScrollView.mm:
1754         (-[WKScrollView initWithFrame:]):
1755
1756         Add imports for -Before and -After versions of WKScrollViewAdditions.
1757
1758         (-[WKScrollView addGestureRecognizer:]):
1759
1760         Override -addGestureRecognizer here to prevent touches on the pinch gesture recognizer from being recognized.
1761         I chose this approach instead of just disabling the gesture in -initWithFrame: because (1) the pinch gesture
1762         recognizer is lazily created when setting minimum or maximum zoom scales, rather than immediately in
1763         -initWithFrame:, and (2) even if we set the -enabled to NO, UIKit later resets it to YES in other codepaths.
1764
1765 2018-02-01  Tim Horton  <timothy_horton@apple.com>
1766
1767         WebKit fails to build (_startAssistingNode has conflicting parameters)
1768         https://bugs.webkit.org/show_bug.cgi?id=182417
1769         <rdar://problem/36965318>
1770
1771         Reviewed by Dan Bernstein.
1772
1773         * UIProcess/ios/WKContentViewInteraction.h:
1774         Use Big BOOL like in the implementation.
1775
1776 2018-02-01  Brent Fulgham  <bfulgham@apple.com>
1777
1778         Improve NetworkResourceLogger to report blocked (versus non-partitioned) cookies
1779         https://bugs.webkit.org/show_bug.cgi?id=182408
1780         <rdar://problem/36918028>
1781
1782         Reviewed by Chris Dumez.
1783
1784         Update the logging method to report blocked origins, rather than logging them as non-partitioned
1785         loads that have no cookies or other content.
1786
1787         * NetworkProcess/NetworkResourceLoader.cpp:
1788         (WebKit::NetworkResourceLoader::logCookieInformation const):
1789
1790 2018-02-01  David Kilzer  <ddkilzer@apple.com>
1791
1792         REGRESSION (r222824): UI process crashes in WebKit::WebBackForwardList::backItem const
1793         <https://webkit.org/b/182409>
1794         <rdar://problem/35495094>
1795
1796         Reviewed by Alex Christensen.
1797
1798         * UIProcess/WebBackForwardList.cpp:
1799         (WebKit::WebBackForwardList::goToItem): Fix typo so the for loop
1800         actually checks each value in m_entries.
1801
1802 2018-02-01  Youenn Fablet  <youenn@apple.com>
1803
1804         Delay service worker process creation until actually needed by SWServer
1805         https://bugs.webkit.org/show_bug.cgi?id=182301
1806
1807         Reviewed by Chris Dumez.
1808
1809         Do not create a service worker process at creation of the first SWServerConnection.
1810         Wait for a WebProcess message that needs it:
1811         - postMessage message
1812         - fetchEvent message
1813         - job scheduling.
1814
1815         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1816         (WebKit::WebSWServerConnection::startFetch):
1817         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
1818         (WebKit::WebSWServerConnection::scheduleJobInServer):
1819         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1820         * StorageProcess/StorageToWebProcessConnection.cpp:
1821         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
1822
1823 2018-02-01  Wenson Hsieh  <wenson_hsieh@apple.com>
1824
1825         [Extra zoom mode] Implement basic support for interacting with text form controls
1826         https://bugs.webkit.org/show_bug.cgi?id=182401
1827         <rdar://problem/35143035>
1828
1829         Reviewed by Tim Horton.
1830
1831         Add UI support for interacting with and editing text form controls when extra zoom mode is enabled. See below
1832         for more details.
1833
1834         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1835         (-[WKWebViewConfiguration init]):
1836         (-[WKWebViewConfiguration encodeWithCoder:]):
1837         (-[WKWebViewConfiguration initWithCoder:]):
1838         (-[WKWebViewConfiguration copyWithZone:]):
1839         (-[WKWebViewConfiguration _textInteractionGesturesEnabled]):
1840         (-[WKWebViewConfiguration _setTextInteractionGesturesEnabled:]):
1841         (-[WKWebViewConfiguration _longPressActionsEnabled]):
1842         (-[WKWebViewConfiguration _setLongPressActionsEnabled:]):
1843
1844         Introduce two new web view configuration flags: `textInteractionGesturesEnabled` and `longPressActionsEnabled`.
1845         The former determines whether text interaction gestures (i.e. text selection, moving the caret, showing UI for
1846         IME, etc.) are enabled. The latter determines whether or not long press actions (i.e. touch callout, share
1847         sheet, etc.) are enabled. These are disabled by default only in extra zoom mode.
1848
1849         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1850         * UIProcess/WebPageProxy.cpp:
1851         (WebKit::WebPageProxy::setTextAsync):
1852
1853         Add a way to set the text value of a currently edited text form control. This will either set the text value of
1854         an input, a. la. autofill, or overwrite the contents of a contenteditable area by selecting everything and
1855         inserting the given text.
1856
1857         * UIProcess/WebPageProxy.h:
1858         (WebKit::WebPageProxy::focusNextAssistedNode):
1859
1860         Add a default argument for the completion callback.
1861
1862         * UIProcess/ios/WKContentViewInteraction.h:
1863         * UIProcess/ios/WKContentViewInteraction.mm:
1864         (-[WKContentView setupInteraction]):
1865         (-[WKContentView _displayFormNodeInputView]):
1866         (-[WKContentView _actionForLongPressFromPositionInformation:]):
1867         (-[WKContentView hasSelectablePositionAtPoint:]):
1868         (-[WKContentView pointIsNearMarkedText:]):
1869         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
1870         (-[WKContentView insertionPointColor]):
1871
1872         Respect the web view configuration flags above by bailing early from text interaction and long press action
1873         sheet methods.
1874
1875         (-[WKContentView _startAssistingKeyboard]):
1876         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1877
1878         Add a flag indicating whether we are in the process of changing focus from one node to another. We use this to
1879         decide whether or not we want to present the text input view controller right away, or just reload the focused
1880         form control overlay. When we stop "assisting" a node, we also keep the focused form control overlay up if we're
1881         only changing focus to another form control.
1882
1883         (-[WKContentView _stopAssistingNode]):
1884         (-[WKContentView presentFocusedFormControlViewController:]):
1885         (-[WKContentView dismissFocusedFormControlViewController:]):
1886         (-[WKContentView shouldPresentTextInputViewController:]):
1887         (-[WKContentView presentTextInputViewController:]):
1888         (-[WKContentView dismissTextInputViewController:]):
1889
1890         Introduce helpers for managing presentation of the focused form control overlay and text input view controller.
1891         All -present and -dismiss helpers here are idempotent. These view controllers are presented from the content
1892         view's view controller for fullscreen presentation.
1893
1894         (-[WKContentView textInputController:didCommitText:]):
1895         (-[WKContentView textInputController:didRequestDismissalWithAction:]):
1896         (-[WKContentView focusedFormControlControllerDidSubmit:]):
1897         (-[WKContentView focusedFormControlControllerDidCancel:]):
1898         (-[WKContentView focusedFormControlControllerDidBeginEditing:]):
1899         (-[WKContentView highlightedRectForFocusedFormControlController:inCoordinateSpace:]):
1900         (-[WKContentView actionNameForFocusedFormControlController:]):
1901         (-[WKContentView focusedFormControlControllerDidRequestNextNode:]):
1902         (-[WKContentView focusedFormControlControllerDidRequestPreviousNode:]):
1903         (-[WKContentView hasNextNodeForFocusedFormControlController:]):
1904         (-[WKContentView hasPreviousNodeForFocusedFormControlController:]):
1905
1906         Implement delegate methods for the focused form control and text input view controllers. This mainly involves
1907         straightforward plumbing of pieces of AssistedNodeInformation on the content view.
1908
1909         (-[WKContentView pointIsInAssistedNode:]): Deleted.
1910
1911         Remove a method that was still implemented only for binary compatibility with iOS 10.
1912
1913         * WebProcess/WebPage/WebPage.cpp:
1914         (WebKit::WebPage::setTextAsync):
1915         * WebProcess/WebPage/WebPage.h:
1916         * WebProcess/WebPage/WebPage.messages.in:
1917
1918 2018-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1919
1920         [GTK] Shift + mouse scroll should scroll horizontally
1921         https://bugs.webkit.org/show_bug.cgi?id=181629
1922
1923         Reviewed by Michael Catanzaro.
1924
1925         Swap scroll direction when Shift is pressed for consistency with GtkScrolledWindow.
1926
1927         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1928         (webkitWebViewBaseScrollEvent):
1929
1930 2018-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1931
1932         REGRESSION(r227893): fast/events/touch/touch-stale-node-crash.html and other tests crash
1933         https://bugs.webkit.org/show_bug.cgi?id=182350
1934
1935         Reviewed by Carlos Alberto Lopez Perez.
1936
1937         Ensure events synthesized from touch gestures have a valid window, screen and device.
1938
1939         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1940         * UIProcess/gtk/GestureController.h: Add virtual destructor to GestureControllerclient.
1941
1942 2018-01-31  Simon Fraser  <simon.fraser@apple.com>
1943
1944         Use different debug red colors for different contexts
1945         https://bugs.webkit.org/show_bug.cgi?id=182362
1946
1947         Reviewed by Tim Horton.
1948         
1949         Pure red is used elsehwere in the system as a debug color indicator, so use different
1950         shades of red for WebKit in the two places where we paint a reddish wash in debug builds,
1951         so they are identifiable.
1952
1953         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
1954         (WebKit::RemoteLayerBackingStore::drawInContext):
1955
1956 2018-01-31  Don Olmstead  <don.olmstead@sony.com>
1957
1958         [CMake] Make JavaScriptCore headers copies
1959         https://bugs.webkit.org/show_bug.cgi?id=182303
1960
1961         Reviewed by Alex Christensen.
1962
1963         * CMakeLists.txt:
1964         * Scripts/generate-forwarding-headers.pl:
1965
1966 2018-01-31  Alex Christensen  <achristensen@webkit.org>
1967
1968         Unreviewed, rolling out r227942.
1969
1970         r227875 should not have been rolled out.
1971
1972         Reverted changeset:
1973
1974         "Unreviewed, rolling out r227875."
1975         https://bugs.webkit.org/show_bug.cgi?id=182357
1976         https://trac.webkit.org/changeset/227942
1977
1978 2018-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
1979
1980         Unreviewed, rolling out r227875.
1981         https://bugs.webkit.org/show_bug.cgi?id=182357
1982
1983         Missing cross-platform TestController implementation
1984
1985         Reverted changeset:
1986
1987         "Add callbacks to testRunner.statisticsSetShouldPartitionCookiesForHost() and testRunner.statisticsUpdateCookiePartitioning()"
1988         https://bugs.webkit.org/show_bug.cgi?id=181958
1989         https://trac.webkit.org/changeset/227875
1990
1991         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1992         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
1993         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
1994         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1995         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]):
1996         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
1997         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]): Deleted.
1998         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]): Deleted.
1999         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2000         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2001         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
2002         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
2003         (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
2004         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
2005         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
2006         (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
2007         (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
2008         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
2009         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
2010         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
2011         (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains):
2012         * UIProcess/WebResourceLoadStatisticsStore.h:
2013
2014 2018-01-31  Brent Fulgham  <bfulgham@apple.com>
2015
2016         Follow-up to r227939.
2017         https://bugs.webkit.org/show_bug.cgi?id=182354
2018         <rdar://problem/37046844>
2019
2020         Make sure the correct sandbox is used on iOS as well.
2021
2022         * StorageProcess/ios/StorageProcessIOS.mm:
2023         (WebKit::StorageProcess::initializeSandbox):
2024
2025 2018-01-31  Brent Fulgham  <bfulgham@apple.com>
2026
2027         REGRESSION(r220094): com.apple.WebKit.Storage lost its sandbox
2028         https://bugs.webkit.org/show_bug.cgi?id=182354
2029         <rdar://problem/37046844>
2030
2031         Reviewed by Ryosuke Niwa.
2032
2033         The Database process was renamed to Storage, but it's sandbox was not updated.
2034
2035         * Configurations/WebKit.xcconfig: Update for sandbox rename.
2036         * DerivedSources.make: Ditto.
2037         * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: Removed.
2038         * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Copied from Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb.
2039         * StorageProcess/mac/com.apple.WebKit.Databases.sb.in: Removed.
2040         * StorageProcess/mac/com.apple.WebKit.Storage.sb.in: Copied from StorageProcess/mac/com.apple.WebKit.Databases.sb.in.
2041         * WebKit.xcodeproj/project.pbxproj: Update for sandbox rename.
2042
2043 2018-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
2044
2045         REGRESSION(r227223): http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html, http/tests/resourceLoadStatistics/grandfathering.html timing out on GTK, WPE
2046         https://bugs.webkit.org/show_bug.cgi?id=182222
2047
2048         Reviewed by Alex Christensen.
2049
2050         Add callbacks to notify when resource load statistics deletion is complete.
2051
2052         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2053         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
2054         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
2055         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2056
2057 2018-01-31  Tim Horton  <timothy_horton@apple.com>
2058
2059         Occasional null deref under WebPageProxy::updateBackingStoreDiscardableState()
2060         https://bugs.webkit.org/show_bug.cgi?id=182349
2061         <rdar://problem/27822258>
2062
2063         Reviewed by Simon Fraser.
2064
2065         * UIProcess/WebPageProxy.cpp:
2066         (WebKit::WebPageProxy::updateBackingStoreDiscardableState):
2067         m_drawingArea can be null during process launch and relaunch.
2068
2069         Cocoa ports don't use the result of setBackingStoreIsDiscardable(),
2070         but they do run this code to keep it up to date.
2071
2072 2018-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
2073
2074         [GTK] Move gir and typelib generation into ENABLE_INTROSPECTION conditional
2075         https://bugs.webkit.org/show_bug.cgi?id=182308
2076
2077         Reviewed by Carlos Garcia Campos.
2078
2079         * PlatformGTK.cmake:
2080
2081 2018-01-31  Youenn Fablet  <youenn@apple.com>
2082
2083         Remove StorageToWebProcessConnection::removeSWServerConnection
2084         https://bugs.webkit.org/show_bug.cgi?id=182305
2085
2086         Reviewed by Chris Dumez.
2087
2088         * StorageProcess/StorageToWebProcessConnection.cpp:
2089         (WebKit::StorageToWebProcessConnection::removeSWServerConnection): Deleted.
2090         * StorageProcess/StorageToWebProcessConnection.h:
2091         * StorageProcess/StorageToWebProcessConnection.messages.in:
2092
2093 2018-01-31  Carlos Garcia Campos  <cgarcia@igalia.com>
2094
2095         REGRESSION(r227544): [GTK] contextMenuEvent is NULL on CONTEXT_MENU call
2096         https://bugs.webkit.org/show_bug.cgi?id=182224
2097
2098         Reviewed by Michael Catanzaro.
2099
2100         Move the gestures handling to WebKitWebViewBase. This patch adds GestureControllerClient class, created and
2101         implemented by WebKitWebViewBase and used by GestureController instead of the WebPageProxy. This way we ensure
2102         events are handled consistently.
2103
2104         * UIProcess/API/gtk/PageClientImpl.cpp:
2105         (WebKit::PageClientImpl::doneWithTouchEvent): Cast the GdkEvent since GestureController no longer works wirth
2106         const GdkEvents.
2107         (WebKit::PageClientImpl::zoom): Use webkit_web_view_set_zoom_level() in case of WebKitWebView or
2108         WebPageProxy::setPageZoomFactor() otherwise.
2109         * UIProcess/API/gtk/PageClientImpl.h:
2110         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2111         (ClickCounter::currentClickCountForGdkButtonEvent): Receive a GdkEvent to avoid casts.
2112         (webkitWebViewBaseHandleMouseEvent): Helper function to handle mouse events.
2113         (webkitWebViewBaseButtonPressEvent): Use webkitWebViewBaseHandleMouseEvent.
2114         (webkitWebViewBaseButtonReleaseEvent): Ditto.
2115         (webkitWebViewBaseHandleWheelEvent): Helper function to handle wheel events.
2116         (webkitWebViewBaseScrollEvent): Use webkitWebViewBaseHandleWheelEvent.
2117         (webkitWebViewBaseMotionNotifyEvent): Use webkitWebViewBaseHandleMouseEvent.
2118         (webkitWebViewBaseCrossingNotifyEvent): Ditto.
2119         (webkitWebViewBaseGestureController): Pass the widget and client to GestureController.
2120         * UIProcess/gtk/GestureController.cpp:
2121         (WebKit::GestureController::GestureController): Receives a widget and client now.
2122         (WebKit::GestureController::handleEvent): Remove the const.
2123         (WebKit::GestureController::Gesture::Gesture): Initialize client.
2124         (WebKit::GestureController::Gesture::handleEvent): Remove the const.
2125         (WebKit::GestureController::DragGesture::startDrag): Use the client instead of WebPageProxy.
2126         (WebKit::GestureController::DragGesture::handleDrag): Ditto.
2127         (WebKit::GestureController::DragGesture::handleTap): Ditto.
2128         (WebKit::GestureController::DragGesture::begin): Ignore the const returned by gtk_gesture_get_last_event().
2129         (WebKit::GestureController::DragGesture::update): Ditto.
2130         (WebKit::GestureController::DragGesture::end): Ditto.
2131         (WebKit::GestureController::DragGesture::DragGesture): Receives a widget and client now.
2132         (WebKit::GestureController::SwipeGesture::startMomentumScroll): Use the client instead of WebPageProxy.
2133         (WebKit::GestureController::SwipeGesture::swipe): Ignore the const returned by gtk_gesture_get_last_event().
2134         (WebKit::GestureController::SwipeGesture::SwipeGesture): Receives a widget and client now.
2135         (WebKit::GestureController::ZoomGesture::begin): Start the zoom.
2136         (WebKit::GestureController::ZoomGesture::startZoom): Use the client instead of WebPageProxy.
2137         (WebKit::GestureController::ZoomGesture::handleZoom): Ditto.
2138         (WebKit::GestureController::ZoomGesture::ZoomGesture): Receives a widget and client now.
2139         (WebKit::GestureController::LongPressGesture::longPressed): Use the client instead of WebKitWebView.
2140         (WebKit::GestureController::LongPressGesture::pressed): Ignore the const returned by gtk_gesture_get_last_event().
2141         (WebKit::GestureController::LongPressGesture::LongPressGesture): Receives a widget and client now.
2142         (WebKit::GestureController::Gesture::simulateMouseClick): Deleted.
2143         (WebKit::createScrollEvent): Deleted.
2144         * UIProcess/gtk/GestureController.h:
2145
2146 2018-01-31  Carlos Garcia Campos  <cgarcia@igalia.com>
2147
2148         Web Automation: cookies returned by automation should have expiry time in seconds
2149         https://bugs.webkit.org/show_bug.cgi?id=182293
2150
2151         Reviewed by Brian Burg.
2152
2153         When creating a WebCore::Cookie from a WebDriver object we convert the given expiry time to milliseconds, but
2154         when creating a WebDriver object from a WebCore::Cookie we are keeping the milliseconds. We should convert to
2155         seconds for consistency, so that the WebDriver always handles seconds.
2156
2157         Fixes: imported/w3c/webdriver/tests/cookies/get_named_cookie.py::test_get_named_cookie
2158
2159         * UIProcess/Automation/WebAutomationSession.cpp:
2160         (WebKit::buildObjectForCookie): Convert expiry to seconds.
2161
2162 2018-01-31  Ryosuke Niwa  <rniwa@webkit.org>
2163
2164         Unreviewed iOS build fix.
2165
2166         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2167
2168 2018-01-30  John Wilander  <wilander@apple.com>
2169
2170         Add callbacks to testRunner.statisticsSetShouldPartitionCookiesForHost() and testRunner.statisticsUpdateCookiePartitioning()
2171         https://bugs.webkit.org/show_bug.cgi?id=181958
2172         https://bugs.webkit.org/show_bug.cgi?id=182072
2173         <rdar://problem/36801804>
2174         <rdar://problem/36845795>
2175
2176         Reviewed by Brent Fulgham.
2177
2178         Because of the asynchronous nature of XPC and cookies,
2179         we need callbacks in these TestRunner functions so that
2180         the layout tests can wait for state changes to finish
2181         before checking test conditions.
2182
2183         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2184         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
2185         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
2186         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2187         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]):
2188         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]):
2189         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
2190         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]):
2191         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2192         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2193         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
2194         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
2195         (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
2196         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
2197         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
2198         (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
2199         (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
2200         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
2201         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
2202         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
2203         (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains):
2204         * UIProcess/WebResourceLoadStatisticsStore.h:
2205
2206 2018-01-30  Ryosuke Niwa  <rniwa@webkit.org>
2207
2208         REGRESSION(r227550): Resource timing API is disabled on macOS
2209         https://bugs.webkit.org/show_bug.cgi?id=182318
2210
2211         Reviewed by Chris Dumez.
2212
2213         Resource timing API should be enabled by default all versions of macOS we support now.
2214
2215         * Shared/WebPreferences.yaml:
2216         * Shared/WebPreferencesDefaultValues.h:
2217
2218 2018-01-30  Tim Horton  <timothy_horton@apple.com>
2219
2220         WKWebView layout is sometimes wrong after rotation on iPhone X
2221         https://bugs.webkit.org/show_bug.cgi?id=182304
2222         <rdar://problem/34158671>
2223
2224         Reviewed by Simon Fraser.
2225
2226         * Platform/spi/ios/UIKitSPI.h:
2227         * UIProcess/API/Cocoa/WKWebView.mm:
2228         (-[WKWebView _computedContentInset]):
2229         (-[WKWebView _scrollViewSystemContentInset]):
2230         (activeMinimumLayoutSize):
2231         It turns out that it is not always safe to look at the safe area insets of
2232         children from inside layoutSubviews, even after the call to super.
2233
2234         Instead, make use of the fact that WKScrollView and WKWebView have identical
2235         coordinate spaces, and map WKWebView's safe area insets into the WKScrollView.
2236         It's safe to use the scroll view's affected-edges and contentScrollInset,
2237         because those aren't updated at the same outside-of-layout time that
2238         safe area insets are.
2239
2240         We could alternatively move all calls to activeMinimumLayoutSize outside
2241         of layoutSubviews, but that seems like a larger and riskier change.
2242
2243         All attempts to write a test have failed; this depends heavily on use of
2244         autolayout and the mechanism by which the system updates system-owned
2245         safe area insets during device rotation.
2246
2247 2018-01-30  Don Olmstead  <don.olmstead@sony.com>
2248
2249         JSExports.h should be included as <JavaScriptCore/JSExportMacros.h>
2250         https://bugs.webkit.org/show_bug.cgi?id=182312
2251
2252         Reviewed by Michael Catanzaro.
2253
2254         * config.h:
2255
2256 2018-01-30  Brent Fulgham  <bfulgham@apple.com>
2257
2258         Add telemetry to track storage access API adoption
2259         https://bugs.webkit.org/show_bug.cgi?id=182197
2260         <rdar://problem/35803309>
2261
2262         Reviewed by Chris Dumez.
2263
2264         Part 2: Add telemetry for the Storage Access API case
2265
2266         This change increments a counter when an origin is loaded in a first part context because
2267         it was granted Storage Access API permissions.
2268
2269         * NetworkProcess/NetworkResourceLoader.cpp:
2270         (WebKit::NetworkResourceLoader::logCookieInformation const): Add logging to indicate
2271         loads that happened with the Storage Access API enabled.
2272         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2273         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): Increment counter for
2274         loads using the new API.
2275
2276 2018-01-30  Megan Gardner  <megan_gardner@apple.com>
2277
2278         Make preserve and restore focus more likely to be symmetrical
2279         https://bugs.webkit.org/show_bug.cgi?id=182264
2280         <rdar://problem/36948473>
2281         
2282         Reviewed by Tim Horton.
2283
2284         Keep a stack of if we actually increment the focusState, so that
2285         changes to the web content do not result in asymmetric decrements to the focus state. 
2286         To work around problems associated with <rdar://problem/37000122>.
2287
2288         * UIProcess/ios/WKContentViewInteraction.h:
2289         * UIProcess/ios/WKContentViewInteraction.mm:
2290         (-[WKContentView _restoreFocusWithToken:]):
2291         (-[WKContentView _preserveFocusWithToken:destructively:]):
2292
2293 2018-01-30  Brent Fulgham  <bfulgham@apple.com>
2294
2295         Add telemetry to track storage access API adoption
2296         https://bugs.webkit.org/show_bug.cgi?id=182197
2297         <rdar://problem/35803309>
2298
2299         Reviewed by Chris Dumez.
2300         
2301         This patch also handled aggregating the counts in the UIProcess, which has access to
2302         the right data.
2303
2304         The original patch assumed the WebContent process kept track of user interaction. This is
2305         only tracked in the UIProcess, so we can get rid of some of the logging code adding in
2306         r227755.
2307
2308         * Shared/WebProcessCreationParameters.cpp:
2309         (WebKit::WebProcessCreationParameters::encode const): Rollout of r227755 changes not
2310         needed to track the statistics.
2311         (WebKit::WebProcessCreationParameters::decode): Ditto.
2312         * Shared/WebProcessCreationParameters.h:
2313         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2314         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
2315         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2316         (WebKit::WebResourceLoadStatisticsStore::wasAccessedAsFirstPartyDueToUserInteraction): Moved from
2317         the WebContent process, which does not keep track of user interaction.
2318         (WebKit::WebResourceLoadStatisticsStore::mergeStatistics): Aggregate counts while processing
2319         the statistics.
2320         * UIProcess/WebResourceLoadStatisticsStore.h:
2321         * WebProcess/WebProcess.cpp:
2322         (WebKit::WebProcess::initializeWebProcess):
2323
2324 2018-01-30  Chris Dumez  <cdumez@apple.com>
2325
2326         Make sure we never create a WebSWClientConnection with an invalid sessionID
2327         https://bugs.webkit.org/show_bug.cgi?id=182276
2328         <rdar://problem/36582633>
2329
2330         Reviewed by Alex Christensen.
2331
2332         Make sure we never create a WebSWClientConnection with an invalid sessionID as this
2333         could corrupt our hash tables.
2334
2335         * StorageProcess/StorageProcess.cpp:
2336         (WebKit::StorageProcess::swServerForSession):
2337         * UIProcess/WebProcessPool.cpp:
2338         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
2339         * WebProcess/Storage/WebSWClientConnection.cpp:
2340         (WebKit::WebSWClientConnection::WebSWClientConnection):
2341         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
2342         (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
2343         (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
2344         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
2345         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
2346
2347 2018-01-30  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2348
2349         [WinCairo] Fix forwarding header conflict of WebKit on WinCairo
2350         https://bugs.webkit.org/show_bug.cgi?id=177202
2351
2352         Reviewed by Alex Christensen.
2353
2354         * PlatformWin.cmake:
2355
2356 2018-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2357
2358         WebDriver: evaluateJavaScriptFunction should return null when return value is undefined
2359         https://bugs.webkit.org/show_bug.cgi?id=180350
2360
2361         Reviewed by Carlos Alberto Lopez Perez.
2362
2363         undefined can't be converted to JSON string, in which case JSON.stringify() returns undefined and we handle that
2364         case to return an empty string. We currently handle this case for execute script commands, but not in all other
2365         cases where we use evaluateJavaScriptFunction. It would be simpler if evaluateJavaScriptFunction returned null,
2366         because in that case we wouldn't need to handle it as a special case.
2367
2368         15.2 Executing Script
2369         https://w3c.github.io/webdriver/webdriver-spec.html#dfn-json-clone
2370
2371         Fixes: imported/w3c/webdriver/tests/state/get_element_property.py::test_element_non_existent
2372
2373         * WebProcess/Automation/WebAutomationSessionProxy.js:
2374         (let.AutomationSessionProxy.prototype._jsonStringify): Return "null" instead of "" when undefined is given.
2375
2376 2018-01-29  Ryosuke Niwa  <rniwa@webkit.org>
2377
2378         Release assert in updateLayout while waiting for sync reply to WebPageProxy::HasInsecureContent
2379         https://bugs.webkit.org/show_bug.cgi?id=182273
2380
2381         Reviewed by Chris Dumez.
2382
2383         The assertion was caused by unrelated sync IPCs being processed while WebContent process is waiting for
2384         the reply to WebPageProxy::HasInsecureContent. Since this IPC can be used while creating CachedFrame,
2385         it's not safe to execute arbitrary code.
2386
2387         Fixed the bug by using DoNotProcessIncomingMessagesWhenWaitingForSyncReply added in r227566.
2388
2389         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2390         (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame):
2391
2392 2018-01-29  Wenson Hsieh  <wenson_hsieh@apple.com>
2393
2394         Add a build step to copy resources from WebKitAdditions as bundle resources in WebKit
2395         https://bugs.webkit.org/show_bug.cgi?id=182268
2396         <rdar://problem/37003784>
2397
2398         Reviewed by Tim Horton and Dan Bernstein.
2399
2400         Adds a "Copy Additional Resources" phase when building WebKit. This phase copies resources from
2401         usr/local/include/WebKitAdditions/WebKit/AdditionalResources in the build directory into the
2402         unlocalized resources directory. If the AdditionalResources directory does not exist in the build
2403         directory, we fall back to searching the SDK.
2404
2405         * WebKit.xcodeproj/project.pbxproj:
2406
2407 2018-01-29  Youenn Fablet  <youenn@apple.com>
2408
2409         ServiceWorkerClientFetch should not consider responses without Location headers as redirection responses
2410         https://bugs.webkit.org/show_bug.cgi?id=182134
2411
2412         Reviewed by Chris Dumez.
2413
2414         As per fetch spec, a response with a redirection status code but no Location header should not be considered as a redirection.
2415         This is also consistent with SubresourceLoader::didReceiveResponse.
2416
2417         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2418         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
2419
2420 2018-01-29  Youenn Fablet  <youenn@apple.com>
2421
2422         Cache API should make sure to resolve caches.open promises in the same order as called
2423         https://bugs.webkit.org/show_bug.cgi?id=182193
2424         <rdar://problem/36930363>
2425
2426         Reviewed by Chris Dumez.
2427
2428         Covered by added test.
2429         Whenever opening/removing a cache requires writing to disk, wait to finish the task
2430         until any disk writing task is done.
2431         Applying this strategy when clearing data so that we also clear data that is pending to be written.
2432         For removing cache, we now return whether a cache was actually deleted by returning zero as removed cache identifier.
2433         WebCore uses that information to return true/false as promise resolution value.
2434
2435         * NetworkProcess/cache/CacheStorageEngine.cpp:
2436         (WebKit::CacheStorage::Engine::retrieveCaches):
2437         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2438         (WebKit::CacheStorage::Caches::clear):
2439         (WebKit::CacheStorage::Caches::open):
2440         (WebKit::CacheStorage::Caches::remove):
2441         (WebKit::CacheStorage::Caches::writeCachesToDisk):
2442         (WebKit::CacheStorage::Caches::cacheInfos):
2443         (WebKit::CacheStorage::Caches::cacheInfos const): Deleted.
2444         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2445         (WebKit::CacheStorage::Caches::createWeakPtr):
2446
2447 2018-01-29  Alex Christensen  <achristensen@webkit.org>
2448
2449         Clean up API after bugs 178240 and 176474
2450         https://bugs.webkit.org/show_bug.cgi?id=182259
2451
2452         Reviewed by Dan Bernstein.
2453
2454         NS_OPTIONS should be NSUInteger, not NSInteger.  This is how all other NS_OPTIONS in WebKit are,
2455         and it's necessary if we get really big numbers as options.  Changing them won't cause binary
2456         incompatibility unless someone does signed integer comparison with currently invalid values.
2457
2458         Added availability macros I forgot to add earlier.
2459
2460         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2461         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2462
2463 2018-01-29  Jiewen Tan  <jiewen_tan@apple.com>
2464
2465         [WebAuthN] Add a compile-time feature flag
2466         https://bugs.webkit.org/show_bug.cgi?id=182211
2467         <rdar://problem/36936365>
2468
2469         Reviewed by Brent Fulgham.
2470
2471         * Configurations/FeatureDefines.xcconfig:
2472
2473 2018-01-29  John Wilander  <wilander@apple.com>
2474
2475         Resource Load Statistics: Introduce debug mode as experimental feature
2476         https://bugs.webkit.org/show_bug.cgi?id=182199
2477         <rdar://problem/36930364>
2478
2479         Reviewed by Alex Christensen.
2480
2481         The only changes to default behavior are:
2482         - Increased resolution on timestamps which is needed to be able to set shorter
2483           timeouts in debug mode.
2484         - Only update partitioning and blocking table when needed. This is an optimization
2485           which pays off in less XPC with shorter timeouts.
2486
2487         * Shared/WebPreferences.yaml:
2488         * UIProcess/API/APIWebsiteDataStore.cpp:
2489         (API::WebsiteDataStore::resourceLoadStatisticsDebugMode const):
2490         (API::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
2491         * UIProcess/API/APIWebsiteDataStore.h:
2492         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2493         (WKWebsiteDataStoreSetResourceLoadStatisticsDebugMode):
2494         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2495         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2496         (-[WKWebsiteDataStore _resourceLoadStatisticsDebugMode]):
2497         (-[WKWebsiteDataStore _setResourceLoadStatisticsDebugMode:]):
2498         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2499         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2500         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
2501         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
2502         * UIProcess/WebResourceLoadStatisticsStore.h:
2503         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2504         (WebKit::WebsiteDataStore::resourceLoadStatisticsDebugMode const):
2505         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
2506         * UIProcess/WebsiteData/WebsiteDataStore.h:
2507
2508 2018-01-29  Andy Estes  <aestes@apple.com>
2509
2510         [iOS] Restrict synthetic clicks to the origin that handled the underlying touch event
2511         https://bugs.webkit.org/show_bug.cgi?id=182252
2512         <rdar://problem/21555881>
2513
2514         Reviewed by Tim Horton.
2515
2516         * WebProcess/WebPage/WebPage.cpp:
2517         (WebKit::WebPage::dispatchTouchEvent):
2518         (WebKit::WebPage::updatePotentialTapSecurityOrigin):
2519
2520         Record the target frame origin of touch events that are potential taps, are
2521         TouchStart events, are targeted in frames that have touch event listeners, and are not
2522         handled by those listeners.
2523
2524         * WebProcess/WebPage/WebPage.h:
2525         * WebProcess/WebPage/ios/WebPageIOS.mm:
2526         (WebKit::WebPage::potentialTapAtPosition):
2527         (WebKit::WebPage::commitPotentialTap):
2528         (WebKit::WebPage::cancelPotentialTapInFrame):
2529
2530         Passed the target frame origin to Frame::nodeRespondingToClickEvents() then cleared it.
2531
2532 2018-01-29  Alex Christensen  <achristensen@webkit.org>
2533
2534         Make policy checks more robust against null pointer dereferencing
2535         https://bugs.webkit.org/show_bug.cgi?id=182263
2536         <rdar://problem/34895714>
2537
2538         Reviewed by Tim Horton.
2539
2540         We're still dereferencing null.  Check everything.
2541
2542         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2543         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2544
2545 2018-01-29  Brent Fulgham  <bfulgham@apple.com>
2546
2547         Add telemetry to track storage access API adoption
2548         https://bugs.webkit.org/show_bug.cgi?id=182197
2549         <rdar://problem/35803309>
2550
2551         Reviewed by Chris Dumez.
2552
2553         Part 1: Add telemetry for the user interaction case
2554         
2555         This patch adds telemetry to track how frequently third-party cookies are
2556         used in a first party context due to user interaction. This will help
2557         understand cases where the new Storage Access API can help, and to help
2558         us understand if we have considered relevant use cases in its design.
2559
2560         * Shared/WebProcessCreationParameters.cpp:
2561         (WebKit::WebProcessCreationParameters::encode const):
2562         (WebKit::WebProcessCreationParameters::decode):
2563         * Shared/WebProcessCreationParameters.h:
2564         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2565         (WebKit::WebProcessPool::platformInitializeWebProcess):
2566         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
2567         (WebKit::sortedPrevalentResourceTelemetry): Update for new telemetry.
2568         (WebKit::submitTopList): Update for new data types.
2569         * WebProcess/WebProcess.cpp:
2570         (WebKit::WebProcess::initializeWebProcess): Handle the partitioning time
2571         passed from the UIProcess.
2572
2573 2018-01-29  Alex Christensen  <achristensen@webkit.org>
2574
2575         Fix crash when during canAuthenticateAgainstProtectionSpace
2576         https://bugs.webkit.org/show_bug.cgi?id=182260
2577         <rdar://problem/34911343>
2578
2579         Reviewed by Chris Dumez.
2580
2581         If we have a valid network load with no challenge completion handler and we are
2582         telling it to continue with the challenge handling, something has gone wrong.
2583         Maybe we've just recovered from a crashed network process.  If this happens, do nothing.
2584
2585         * NetworkProcess/NetworkLoad.cpp:
2586         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
2587
2588 2018-01-29  Zach Li  <zacharyli323@gmail.com>
2589
2590         Warning in 32-bit WebKit build when trying to link to SafariSafeBrowsing
2591         https://bugs.webkit.org/show_bug.cgi?id=182251
2592         rdar://problem/36964995
2593
2594         Reviewed by Alex Christensen.
2595
2596         * Configurations/WebKit.xcconfig:
2597         Only link against SafariSafeBrowsing framework in 64-bit architecture.
2598
2599         * Platform/spi/Cocoa/SafeBrowsingSPI.h:
2600         Guard the Safe Browsing code with WK_API_ENABLED.
2601
2602 2018-01-29  Chris Dumez  <cdumez@apple.com>
2603
2604         Make sure we do not re-enter Webcore during StorageToWebProcessConnection::EstablishSWServerConnection Sync IPC
2605         https://bugs.webkit.org/show_bug.cgi?id=182256
2606         <rdar://problem/36689233>
2607
2608         Reviewed by Simon Fraser.
2609
2610         Make sure we do not re-enter Webcore during StorageToWebProcessConnection::EstablishSWServerConnection Sync IPC as
2611         this can lead to crashes such as the one in <rdar://problem/36689233>.
2612
2613         * WebProcess/Storage/WebSWClientConnection.cpp:
2614         (WebKit::WebSWClientConnection::WebSWClientConnection):
2615
2616 2018-01-29  Jan-Michael Brummer  <jan.brummer@tabos.org>
2617
2618         [GTK] Zooming gesture incorrectly uses scale instead of zoom 
2619         https://bugs.webkit.org/show_bug.cgi?id=182174
2620
2621         Reviewed by Michael Catanzaro.
2622
2623         Switch zooming gesture to use zoom instead of scale function.
2624
2625         * UIProcess/gtk/GestureController.cpp:
2626         (WebKit::GestureController::ZoomGesture::begin):
2627         (WebKit::GestureController::ZoomGesture::handleZoom):
2628
2629 2018-01-29  Brady Eidson  <beidson@apple.com>
2630
2631         Make it possible for apps that use both WK1 and WK2 to use MessagePorts.
2632         https://bugs.webkit.org/show_bug.cgi?id=182229
2633
2634         Reviewed by Chris Dumez.
2635
2636         * UIProcess/UIMessagePortChannelProvider.cpp:
2637         (WebKit::UIMessagePortChannelProvider::UIMessagePortChannelProvider):
2638
2639         * UIProcess/WebPageProxy.cpp:
2640         (WebKit::m_configurationPreferenceValues): The UI process does not need to override the 
2641           global singleton provider. It can remain the default ProviderImpl to allow WK1 views 
2642           to work fine, too.
2643
2644 2018-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2645
2646         WebDriver: ASSERTION FAILED: !m_loadTimer.isActive()
2647         https://bugs.webkit.org/show_bug.cgi?id=182237
2648
2649         Reviewed by Carlos Alberto Lopez Perez.
2650
2651         We should stop the load timer when we dispatch the pending navigation callbacks due to an alert open.
2652
2653         * UIProcess/Automation/WebAutomationSession.cpp:
2654         (WebKit::WebAutomationSession::willShowJavaScriptDialog):
2655
2656 2018-01-29  Zan Dobersek  <zdobersek@igalia.com>
2657
2658         [Cairo] Add GraphicsContextImplCairo::createFactory() helpers
2659         https://bugs.webkit.org/show_bug.cgi?id=182238
2660
2661         Reviewed by Carlos Garcia Campos.
2662
2663         Use GraphicsContextImplCairo::createFactory() helpers throughout the
2664         Cairo-specific GraphicsContext constructors in the WebKit layer.
2665
2666         * Shared/cairo/ShareableBitmapCairo.cpp:
2667         (WebKit::ShareableBitmap::createGraphicsContext):
2668         * UIProcess/cairo/BackingStoreCairo.cpp:
2669         (WebKit::BackingStore::incorporateUpdate):
2670         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
2671         (WebKit::WebPrintOperationGtk::renderPage):
2672
2673 2018-01-29  Zan Dobersek  <zdobersek@igalia.com>
2674
2675         [Cairo] Remove the GraphicsContext(cairo_t*) constructor
2676         https://bugs.webkit.org/show_bug.cgi?id=182234
2677
2678         Reviewed by Carlos Garcia Campos.
2679
2680         Call sites of the GraphicsContext(cairo_t*) constructor are adjusted to
2681         instead provide a factory function that returns a fresh
2682         GraphicsContextImplCairo object, passing that cairo_t object to its
2683         constructor.
2684
2685         * Shared/cairo/ShareableBitmapCairo.cpp:
2686         (WebKit::ShareableBitmap::createGraphicsContext):
2687         * UIProcess/cairo/BackingStoreCairo.cpp:
2688         (WebKit::BackingStore::incorporateUpdate):
2689         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
2690         (WebKit::WebPrintOperationGtk::renderPage):
2691
2692 2018-01-26  Megan Gardner  <megan_gardner@apple.com>
2693
2694         Don't retain focus for input peripheral views
2695         https://bugs.webkit.org/show_bug.cgi?id=182204
2696
2697         Reviewed by Tim Horton.
2698
2699         Retaining focus on input peripheral views makes it so they cannot dismiss themselves with
2700         the current architecture. This should probably be fixed in UIKit, as there is no reason for
2701         focus to be retained on these views anyways, as they don't have keyboard input, but this
2702         guards against over-aggressive retain requests.
2703
2704         * UIProcess/ios/WKContentViewInteraction.mm:
2705         (-[WKContentView _restoreFocusWithToken:]):
2706         (-[WKContentView _preserveFocusWithToken:destructively:]):
2707
2708 2018-01-26  Chris Dumez  <cdumez@apple.com>
2709
2710         Make sure service worker code does not launch a StorageProcess unnecessarily
2711         https://bugs.webkit.org/show_bug.cgi?id=182192
2712         <rdar://problem/36927427>
2713
2714         Reviewed by Geoffrey Garen.
2715
2716         When calling WebProcess::existingWebToStorageProcessConnection(), make sure we do not
2717         force the creation of a WebProcess connection to the StorageProcess. If there is
2718         no WebProcess, just return false right away.
2719
2720         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
2721         (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
2722         * WebProcess/WebProcess.h:
2723
2724 2018-01-26  Alex Christensen  <achristensen@webkit.org>
2725
2726         Allow cellular access for default-created ephemeral sessions
2727         https://bugs.webkit.org/show_bug.cgi?id=182179
2728         <rdar://problem/36572023>
2729
2730         Reviewed by Andy Estes.
2731
2732         This makes it so when we recover from a NetworkProcess crash (see r227590) on iOS, we will
2733         be able to continue browsing using cell data.
2734
2735         * Shared/WebsiteDataStoreParameters.cpp:
2736         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
2737         * UIProcess/WebProcessPool.cpp:
2738         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
2739         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2740         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
2741
2742 2018-01-26  Alex Christensen  <achristensen@webkit.org>
2743
2744         Clean up more networking code
2745         https://bugs.webkit.org/show_bug.cgi?id=182161
2746
2747         Reviewed by Anders Carlsson.
2748
2749         Two cleanups:
2750         1. The WebProcess doesn't need to initialize NetworkSessions.
2751         2. WebFrameNetworkingContext doesn't need to have the NetworkingContext functions to support ResourceHandles in WebKit any more.
2752
2753         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2754         * NetworkProcess/NetworkLoad.h:
2755         * NetworkProcess/RemoteNetworkingContext.h:
2756         (): Deleted.
2757         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2758         * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
2759         (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext): Deleted.
2760         (WebKit::RemoteNetworkingContext::isValid const): Deleted.
2761         (WebKit::RemoteNetworkingContext::storageSession const): Deleted.
2762         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2763         (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext): Deleted.
2764         (WebKit::RemoteNetworkingContext::isValid const): Deleted.
2765         (WebKit::RemoteNetworkingContext::localFileContentSniffingEnabled const): Deleted.
2766         (WebKit::RemoteNetworkingContext::storageSession const): Deleted.
2767         (WebKit::RemoteNetworkingContext::sourceApplicationAuditData const): Deleted.
2768         (WebKit::RemoteNetworkingContext::sourceApplicationIdentifier const): Deleted.
2769         (WebKit::RemoteNetworkingContext::blockedError const): Deleted.
2770         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
2771         (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext): Deleted.
2772         (WebKit::RemoteNetworkingContext::isValid const): Deleted.
2773         (WebKit::RemoteNetworkingContext::storageSession const): Deleted.
2774         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2775         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
2776         * WebProcess/WebProcess.cpp:
2777         (WebKit::WebProcess::initializeWebProcess):
2778         (WebKit::WebProcess::clearCachedCredentials):
2779
2780 2018-01-26  Jan-Michael Brummer  <jan.brummer@tabos.org>
2781
2782         [GTK] Support using long-tap gesture to open context menu
2783         https://bugs.webkit.org/show_bug.cgi?id=140747
2784
2785         Reviewed by Carlos Garcia Campos.
2786
2787         Add long press gesture which simulates a secondary mouse press to open context menu.
2788
2789         * UIProcess/gtk/GestureController.cpp:
2790         (WebKit::GestureController::GestureController):
2791         (WebKit::GestureController::handleEvent):
2792         (WebKit::GestureController::isProcessingGestures const):
2793         (WebKit::GestureController::Gesture::simulateMousePress):
2794         (WebKit::GestureController::DragGesture::handleTap):
2795         (WebKit::GestureController::LongPressGesture::longPressed):
2796         (WebKit::GestureController::LongPressGesture::pressed):
2797         (WebKit::GestureController::LongPressGesture::LongPressGesture):
2798         * UIProcess/gtk/GestureController.h:
2799         (WebKit::GestureController::reset):
2800
2801 2018-01-26  Carlos Garcia Campos  <cgarcia@igalia.com>
2802
2803         Unreviewed. REGRESSION(r227647): window.open() is broken in GTK and WPE after r227647.
2804
2805         In r227647, API::UIClient::createNewPage() was changed to use CompletionHandler instead of Function. All
2806         implementations were updated expect the GLib one, and we didn't notice it because the method doesn't have the
2807         final/override mark.
2808
2809         * UIProcess/API/glib/WebKitUIClient.cpp:
2810         (UIClient::createNewPage):
2811
2812 2018-01-25  Sergio Villar Senin  <svillar@igalia.com>
2813
2814         [WebVR] Make WebVR available by default for developer builds
2815         https://bugs.webkit.org/show_bug.cgi?id=182101
2816
2817         Reviewed by Michael Catanzaro.
2818
2819         Moved WebVR setting to the experimental features section and make it
2820         available by default for developer builds for GTK and WPE.
2821
2822         * Shared/WebPreferences.yaml:
2823
2824 2018-01-25  Alex Christensen  <achristensen@webkit.org>
2825
2826         REGRESSION (r221899): Web Content process hangs when webpage tries to make a new window if the WKWebView doesn’t have a UI delegate
2827         https://bugs.webkit.org/show_bug.cgi?id=182152
2828
2829         Reviewed by Joseph Pecoraro.
2830
2831         Call the completion handler of the default API::UIClient::createNewPage.
2832
2833         * UIProcess/API/APIUIClient.h:
2834         (API::UIClient::createNewPage):
2835         * UIProcess/API/C/WKPage.cpp:
2836         (WKPageSetPageUIClient):
2837         * UIProcess/Cocoa/UIDelegate.h:
2838         * UIProcess/Cocoa/UIDelegate.mm:
2839         (WebKit::UIDelegate::UIClient::createNewPage):
2840
2841 2018-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2842
2843         [iOS] [WK2] Introduce new views and view controllers to support extra-zoomed text form controls
2844         https://bugs.webkit.org/show_bug.cgi?id=182000
2845         <rdar://problem/35143035>
2846
2847         Reviewed by Tim Horton.
2848
2849         Add new files to support text form control editing while extra-zoomed.
2850
2851         * UIProcess/ios/forms/WKFocusedFormControlView.h: Added.
2852         * UIProcess/ios/forms/WKFocusedFormControlView.mm: Added.
2853         * UIProcess/ios/forms/WKFocusedFormControlViewController.h: Added.
2854         * UIProcess/ios/forms/WKFocusedFormControlViewController.mm: Added.
2855         * UIProcess/ios/forms/WKTextFormControlViewController.h: Added.
2856         * UIProcess/ios/forms/WKTextFormControlViewController.mm: Added.
2857         * UIProcess/ios/forms/WKTextInputViewController.h: Added.
2858         * UIProcess/ios/forms/WKTextInputViewController.mm: Added.
2859         * UIProcess/ios/forms/WKTextSuggestionButton.h: Added.
2860         * UIProcess/ios/forms/WKTextSuggestionButton.mm: Added.
2861         * WebKit.xcodeproj/project.pbxproj:
2862
2863 2018-01-25  Chris Dumez  <cdumez@apple.com>
2864
2865         Clients.get(id) should only returns clients in the service worker's origin
2866         https://bugs.webkit.org/show_bug.cgi?id=182149
2867         <rdar://problem/36882310>
2868
2869         Reviewed by Youenn Fablet.
2870
2871         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2872         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
2873
2874 2018-01-25  Youenn Fablet  <youenn@apple.com>
2875
2876         WebPluginInfoProvider should handle null host queries
2877         https://bugs.webkit.org/show_bug.cgi?id=182112
2878
2879         Reviewed by Chris Dumez.
2880
2881         Return early if host is null.
2882
2883         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
2884         (WebKit::WebPluginInfoProvider::populatePluginCache):
2885
2886 2018-01-25  Simon Fraser  <simon.fraser@apple.com>
2887
2888         ASSERT(CGSizeEqualToSize(m_resizeScrollOffset, CGSizeZero)) in WebViewImpl::setFrameAndScrollBy()
2889         https://bugs.webkit.org/show_bug.cgi?id=182082
2890         rdar://problem/13971838
2891
2892         Reviewed by Tim Horton.
2893
2894         Safari could call WebViewImpl::setFrameAndScrollBy() multiple times with different scroll offsets,
2895         triggering this assertion.
2896
2897         Rename to m_resizeScrollOffset to m_scrollOffsetAdjustment to reduce confusion with actual scroll offsets.
2898         This parameter has no effect on macOS, but is used by the -[WKWebView setFrame:andScrollBy:] so at some point
2899         needs to be hooked up to allow synchronous view resize and scroll adjustment (e.g. for the Find bar animation).
2900         
2901         Remove DrawingAreaProxy's m_layerPosition which was unused, and remove the parameters from the UpdateGeometry message.
2902
2903         * UIProcess/API/Cocoa/WKWebView.mm:
2904         (-[WKWebView _frameOrBoundsChanged]):
2905         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2906         * UIProcess/Cocoa/WebViewImpl.h:
2907         * UIProcess/Cocoa/WebViewImpl.mm:
2908         (WebKit::WebViewImpl::setFrameAndScrollBy):
2909         (WebKit::WebViewImpl::setDrawingAreaSize):
2910         * UIProcess/DrawingAreaProxy.cpp:
2911         (WebKit::DrawingAreaProxy::setSize):
2912         * UIProcess/DrawingAreaProxy.h:
2913         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2914         (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
2915         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2916         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
2917         * WebProcess/WebPage/DrawingArea.h:
2918         (WebKit::DrawingArea::updateGeometry):
2919         * WebProcess/WebPage/DrawingArea.messages.in:
2920         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
2921         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2922         (WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
2923         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2924         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2925         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
2926
2927 2018-01-25  Keith Rollin  <krollin@apple.com>
2928
2929         Add logging to facilitate binding of WebContent and Network processes to UI process
2930         https://bugs.webkit.org/show_bug.cgi?id=182066
2931
2932         Reviewed by Brent Fulgham.
2933
2934         When examining sysdiagnose logs and tracing events from one process to
2935         another, it would be helpful to know which WebKit processes were
2936         related to each other. When Safari, Mail, Messages, etc. are all
2937         running at the same time, it may otherwise be difficult to know if a
2938         particular Network process, for example was associated with Safari or
2939         some other application. Add some logging to the creation of WebContent
2940         and Network processes to identify their "presenting process" (parent
2941         application).
2942
2943         * NetworkProcess/NetworkProcess.cpp:
2944         (WebKit::NetworkProcess::initializeNetworkProcess):
2945         * Platform/Logging.h:
2946         * WebProcess/WebProcess.cpp:
2947         (WebKit::WebProcess::initializeWebProcess):
2948
2949 2018-01-25  Youenn Fablet  <youenn@apple.com>
2950
2951         DocumentLoader should interrupt ongoing load when getting a redirection from network that matches a service worker
2952         https://bugs.webkit.org/show_bug.cgi?id=182115
2953
2954         Reviewed by Alex Christensen.
2955
2956         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2957         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
2958
2959 2018-01-25  Alex Christensen  <achristensen@webkit.org>
2960
2961         Fix crash when preconnecting while closing private browsing
2962         https://bugs.webkit.org/show_bug.cgi?id=182114
2963         <rdar://problem/35637284>
2964
2965         Reviewed by Joseph Pecoraro.
2966
2967         * NetworkProcess/PreconnectTask.cpp:
2968         There is a race condition when destroying a session while a page is initiating a preconnect.
2969         If this happens, fail gracefully instead of trying to preconnect with a null session.
2970
2971 2018-01-25  Dan Bernstein  <mitz@apple.com>
2972
2973         [Mac] Enable library validation for Networking & Storage XPC services
2974         https://bugs.webkit.org/show_bug.cgi?id=173424
2975         <rdar://problem/32386565>
2976
2977         Reviewed by Joseph Pecoraro.
2978
2979         * Configurations/BaseXPCService.xcconfig: Moved the definitions of
2980           WK_LIBRARY_VALIDATION_ENABLED and WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS from
2981           WebContentService.xcconfig to here and made them Mac-only at this level.
2982         * Configurations/NetworkService.xcconfig: Also set OTHER_CODE_SIGN_FLAGS to
2983           WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS.
2984         * Configurations/StorageService.xcconfig: Ditto.
2985         * Configurations/WebContentService.xcconfig: Moved definitions from here to
2986           BaseXPCService.xcconfig.
2987
2988 2018-01-25  David Hyatt  <hyatt@apple.com>
2989
2990         Enable lines clamp support for Apple Mail by default
2991         https://bugs.webkit.org/show_bug.cgi?id=182113
2992
2993         Reviewed by Dean Jackson.
2994
2995         * Shared/WebPageCreationParameters.cpp:
2996         (WebKit::WebPageCreationParameters::encode const):
2997         (WebKit::WebPageCreationParameters::decode):
2998         * Shared/WebPageCreationParameters.h:
2999         * UIProcess/WebPageProxy.cpp:
3000         (WebKit::WebPageProxy::creationParameters):
3001         * UIProcess/WebPageProxy.h:
3002         * UIProcess/mac/WebPageProxyMac.mm:
3003         (WebKit::WebPageProxy::appleMailLinesClampEnabled):
3004         * WebProcess/WebPage/WebPage.cpp:
3005         (WebKit::m_cpuLimit):
3006
3007 2018-01-25  Sergio Villar Senin  <svillar@igalia.com>
3008
3009         [WebVR][GTK][WPE] Remove the WebVR public API added in r227518
3010         https://bugs.webkit.org/show_bug.cgi?id=182102
3011
3012         Reviewed by Carlos Garcia Campos.
3013
3014         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3015
3016 2018-01-25  Sergio Villar Senin  <svillar@igalia.com>
3017
3018         [WebVR][GTK][WPE] Remove the WebVR public API added in r227518
3019         https://bugs.webkit.org/show_bug.cgi?id=182102
3020
3021         Reviewed by Carlos Garcia Campos.
3022
3023         This new public API was not supposed to be included in the patch
3024         that added OpenVR to the tree and to the build.
3025
3026         * UIProcess/API/glib/WebKitSettings.cpp:
3027         (webKitSettingsSetProperty):
3028         (webKitSettingsGetProperty):
3029         (webkit_settings_class_init):
3030         (webkit_settings_get_enable_webvr): Deleted.
3031         (webkit_settings_set_enable_webvr): Deleted.
3032         * UIProcess/API/gtk/WebKitSettings.h:
3033         * UIProcess/API/wpe/WebKitSettings.h:
3034
3035 2018-01-25  Claudio Saavedra  <csaavedra@igalia.com>
3036
3037         [GTK] Fix build with touch events disabled
3038
3039         Unreviewed build fix.
3040
3041         Explicitly include gtk.h in files that were indirectly getting it
3042         only when touch events were enabled.
3043         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
3044         * UIProcess/gtk/WaylandCompositor.h:
3045
3046 2018-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3047
3048         WebDriver: test imported/selenium/py/test/selenium/webdriver/common/alerts_tests.py crashes in debug
3049         https://bugs.webkit.org/show_bug.cgi?id=182096
3050
3051         Reviewed by Carlos Alberto Lopez Perez.
3052
3053         It's an assert in HashTable iterators checkValidity(). The problem is that we get the keys to iterate the values
3054         and the map is modified inside the loop. We need to use copyToVector to copy the keys.
3055
3056         * UIProcess/Automation/WebAutomationSession.cpp:
3057         (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
3058         (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
3059         (WebKit::WebAutomationSession::willShowJavaScriptDialog):
3060
3061 2018-01-24  Alex Christensen  <achristensen@webkit.org>
3062
3063         Gracefully recover from NetworkProcess crashes in private browsing
3064         https://bugs.webkit.org/show_bug.cgi?id=182073
3065         <rdar://problem/36572023>
3066
3067         Reviewed by Geoff Garen.
3068
3069         If we're using a non-persistent WKWebsiteDataStore and the NetworkProcess crashes and we try to do a load,
3070         then the WebProcess restarts the NetworkProcess but doesn't recreate the ephemeral session in the NetworkProcess.
3071         When this happens, we've already lost the browsing state in memory in the NetworkProcess, but we don't want to hang.
3072         If this is the problem, then just recreate the ephemeral session and continue loading.
3073
3074         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3075         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
3076         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
3077         * NetworkProcess/NetworkResourceLoader.cpp:
3078         (WebKit::NetworkResourceLoader::startNetworkLoad):
3079         * Shared/WebsiteDataStoreParameters.cpp:
3080         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
3081         (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters): Deleted.
3082         * Shared/WebsiteDataStoreParameters.h:
3083         (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters):
3084
3085 2018-01-24  Dan Bernstein  <mitz@apple.com>
3086
3087         Enable library validation on the Web Content service
3088         Part 1 of https://bugs.webkit.org/show_bug.cgi?id=172365
3089         <rdar://problem/26470661>
3090
3091         Reviewed by David Kilzer.
3092
3093         This makes the Web Content process signed with the Library Validation flag in production
3094         builds. Because doing so would prevent engineering builds of Apple apps that use an
3095         injected bundle from working, this also adds a Development version of the service, which
3096         does not enforce Library Validation. The UI process chooses to use the Development service
3097         iff it would need to load an injected bundle that is not part of the OS.
3098
3099         * Configurations/DebugRelease.xcconfig: Disable Library Validation in engineering builds.
3100
3101         * Configurations/WebContentService.Development.xcconfig: Added. Like the normal service, but
3102           only installed when WebKit is installed in the OS, and uses a Development variant.
3103
3104         * Configurations/WebContentService.xcconfig: For the Development variant, append
3105           ".Development" to the product name, which is also the service identifier. Enable Library
3106           Validation for the Normal variant of the service when WK_LIBRARY_VALIDATION_ENABLED allows
3107           it.
3108
3109         * UIProcess/Launcher/ProcessLauncher.h: Add nonValidInjectedCodeAllowed member to
3110           LaunchOptions, false by default.
3111
3112         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3113         (WebKit::serviceName): Use the Development variant if nonValidInjectedCodeAllowed is true.
3114
3115         * UIProcess/WebProcessProxy.cpp:
3116         (WebKit::WebProcessProxy::getLaunchOptions): Initialize nonValidInjectedCodeAllowed using
3117            the new shouldAllowNonValidInjectedCode().
3118         (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Generic implementation
3119           that returns false.
3120         * UIProcess/WebProcessProxy.h: Declared shouldAllowNonValidInjectedCode.
3121         * UIProcess/mac/WebProcessProxyMac.mm:
3122         (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Return true if this is
3123           system WebKit with a non-system injected bundle.
3124
3125         * WebKit.xcodeproj/project.pbxproj: Added new service target.
3126
3127 2018-01-24  Chris Dumez  <cdumez@apple.com>
3128
3129         Add a IPC::SendSyncOption indicating we should not process incoming IPC while waiting for the sync reply
3130         https://bugs.webkit.org/show_bug.cgi?id=182021
3131         <rdar://problem/21629943>
3132
3133         Reviewed by Ryosuke Niwa.
3134
3135         Add a new DoNotProcessIncomingMessagesWhenWaitingForSyncReply SendSyncOption that the caller can
3136         set when calling sendSync(). This indicates that the sendSync() should return only when we receive
3137         the response to our sync IPC message, and that we should not process ANY incoming IPC in the meantime.
3138
3139         This patch also starts using this flag in 3 places where we know processing incoming IPC is an issue
3140         and is causing crashes.
3141
3142         * Platform/IPC/Connection.cpp:
3143         (IPC::Connection::sendSyncMessage):
3144         When DoNotProcessIncomingMessagesWhenWaitingForSyncReply SendSyncOption is set, make sure
3145         we set the ShouldDispatchMessageWhenWaitingForSyncReply flag on the encoder. If we did not set this
3146         flag then it could cause deadlocks when the destination process is also waiting on a synchronous
3147         IPC from us. Normally, this flag already gets set for sync messages because sendSyncMessage() calls
3148         sendMessage() with DispatchMessageEvenWhenWaitingForSyncReply SyncOption. However, sendMessage()
3149         ignores the DispatchMessageEvenWhenWaitingForSyncReply flag if the
3150         m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage flag is set on the
3151         connection. Note that this flag is set on the connection from the WebProcess to the UIProcess at
3152         the moment, which is why we saw deadlocks on the previous iteration of this patch.
3153
3154         (IPC::Connection::waitForSyncReply):
3155         If DoNotProcessIncomingMessagesWhenWaitingForSyncReply SendSyncOption is set, do not
3156         process incoming IPC messages while waiting for our sync IPC reply.
3157
3158         * Platform/IPC/Connection.h:
3159         Add new SendSyncOption.
3160
3161         * UIProcess/WebProcessProxy.cpp:
3162         (WebKit::WebProcessProxy::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
3163         * UIProcess/WebProcessProxy.h:
3164         * UIProcess/WebProcessProxy.messages.in:
3165         Testing infrastructure.
3166
3167         * WebProcess/Network/WebLoaderStrategy.cpp:
3168         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
3169         Use new flag.
3170
3171         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3172         (WebKit::WebChromeClient::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
3173         * WebProcess/WebCoreSupport/WebChromeClient.h:
3174         Testing infrastructure.
3175
3176         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3177         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
3178         Use new flag.
3179
3180         * WebProcess/WebProcess.cpp:
3181         (WebKit::WebProcess::syncIPCMessageWhileWaitingForSyncReplyForTesting):
3182         Testing infrastructure.
3183
3184         (WebKit::WebProcess::ensureNetworkProcessConnection):
3185         Use new flag.
3186
3187         * WebProcess/WebProcess.h:
3188         * WebProcess/WebProcess.messages.in:
3189         Testing infrastructure.
3190
3191 2018-01-24  Joseph Pecoraro  <pecoraro@apple.com>
3192
3193         Web Inspector: Remove duplicate preference update for WebAuthentication value
3194         https://bugs.webkit.org/show_bug.cgi?id=182058
3195
3196         Reviewed by Brian Burg.
3197
3198         * WebProcess/WebPage/WebPage.cpp:
3199         (WebKit::WebPage::updatePreferences):
3200         An identical update already happens in generated code.
3201
3202 2018-01-24  Alex Christensen  <achristensen@webkit.org>
3203
3204         Remove WebProcess access to QTKit
3205         https://bugs.webkit.org/show_bug.cgi?id=182035
3206
3207         Reviewed by Alexey Proskuryakov.
3208
3209         * WebProcess/com.apple.WebProcess.sb.in:
3210         This isn't needed any more.  We only have a little bit of code that uses QTKit which we should remove,
3211         and it's only used for fullscreen controls in WebKitLegacy.  Let's tighten up the sandbox!
3212
3213 2018-01-24  Alex Christensen  <achristensen@webkit.org>
3214
3215         Remove pre-Sierra-OS-specific code in WebKit
3216         https://bugs.webkit.org/show_bug.cgi?id=182024
3217
3218         Reviewed by Tim Horton.
3219
3220         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
3221         * Shared/Cocoa/DataDetectionResult.mm:
3222         (WebKit::DataDetectionResult::encode const):
3223         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
3224         (IPC::ArgumentCoder<WebCore::Payment>::encode):
3225         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode):
3226         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode):
3227         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode):
3228         * Shared/WebPreferencesDefaultValues.h:
3229         * Shared/cg/ShareableBitmapCG.cpp:
3230         (WebKit::wantsExtendedRange):
3231         * Shared/ios/InteractionInformationAtPosition.mm:
3232         (WebKit::InteractionInformationAtPosition::encode const):
3233         * Shared/mac/CodeSigning.mm:
3234         (WebKit::codeSigningIdentifier):
3235         (WebKit::codeSigningIdentifierForCurrentProcess):
3236         * Shared/mac/ColorSpaceData.mm:
3237         (WebKit::ColorSpaceData::encode const):
3238         * Shared/mac/PasteboardTypes.mm:
3239         (WebKit::PasteboardTypes::forURL):
3240         * Shared/mac/WebCoreArgumentCodersMac.mm:
3241         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
3242         (IPC::ArgumentCoder<Credential>::encodePlatformData):
3243         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode):
3244         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData):
3245         * Shared/mac/WebHitTestResultData.mm:
3246         (WebKit::WebHitTestResultData::platformEncode const):
3247         * UIProcess/API/Cocoa/WKProcessPool.mm:
3248         (-[WKProcessPool _setObject:forBundleParameter:]):
3249         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]):
3250         * UIProcess/API/Cocoa/WKWebView.mm:
3251         (-[WKWebView _handleAcceptedCandidate:]):
3252         * UIProcess/Cocoa/WebViewImpl.h:
3253         * UIProcess/Cocoa/WebViewImpl.mm:
3254         (WebKit::WebViewImpl::handleAcceptedCandidate):
3255         (WebKit::WebViewImpl::performDragOperation):
3256         * UIProcess/mac/WebPopupMenuProxyMac.mm:
3257         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
3258         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3259         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
3260         * WebProcess/com.apple.WebProcess.sb.in:
3261
3262 2018-01-24  Alex Christensen  <achristensen@webkit.org>
3263
3264         Stop using AuthenticationClient in WebKit
3265         https://bugs.webkit.org/show_bug.cgi?id=182016
3266
3267         Reviewed by Brady Eidson.
3268
3269         It was necessary to support ResourceHandle use in WebKit, but now we're using NetworkSession everywhere in WebKit.
3270
3271         * Shared/Authentication/AuthenticationManager.cpp:
3272         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
3273         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
3274         (WebKit::AuthenticationManager::cancelSingleChallenge):
3275         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
3276         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
3277
3278 2018-01-24  Alex Christensen  <achristensen@webkit.org>
3279
3280         Remove WebProcess authentication code
3281         https://bugs.webkit.org/show_bug.cgi?id=182020
3282
3283         Reviewed by Brady Eidson.
3284
3285         * Shared/Authentication/AuthenticationManager.cpp:
3286         * Shared/Authentication/AuthenticationManager.h:
3287         * UIProcess/WebPageProxy.cpp:
3288         (WebKit::WebPageProxy::didReceiveAuthenticationChallenge): Deleted.
3289         * UIProcess/WebPageProxy.h:
3290         * UIProcess/WebPageProxy.messages.in:
3291         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3292         (WebKit::WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
3293         * WebProcess/WebProcess.cpp:
3294         (WebKit::m_webSQLiteDatabaseTracker):
3295
3296 2018-01-24  Jan-Michael Brummer  <jan.brummer@tabos.org>
3297
3298         [GTK] Page crash after swipe gesture running GNOME3 under wayland
3299         https://bugs.webkit.org/show_bug.cgi?id=181996
3300
3301         Reviewed by Michael Catanzaro.
3302
3303         Add missing GDK_TOUCH_CANCEL support which fixes page crashes due to cancelled gestures.
3304         * Shared/gtk/WebEventFactory.cpp:
3305         (WebKit::WebEventFactory::createWebTouchEvent):
3306         * UIProcess/API/gtk/PageClientImpl.cpp:
3307         (WebKit::PageClientImpl::doneWithTouchEvent):
3308         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3309         (touchPointStateForEvents):
3310         (webkitWebViewBaseGetTouchPointsForEvent):
3311         (webkitWebViewBaseTouchEvent):
3312         * UIProcess/gtk/GestureController.cpp:
3313         (WebKit::GestureController::handleEvent):
3314
3315 2018-01-24  Alex Christensen  <achristensen@webkit.org>
3316
3317         Remove unused QTKit preference
3318         https://bugs.webkit.org/show_bug.cgi?id=181968
3319
3320         Reviewed by Alexey Proskuryakov.
3321
3322         * Shared/API/c/WKDeprecatedFunctions.cpp:
3323         (WKPreferencesSetQTKitEnabled):
3324         (WKPreferencesGetQTKitEnabled):
3325         * Shared/WebPreferences.yaml:
3326         * UIProcess/API/C/WKPreferences.cpp:
3327         (WKPreferencesSetQTKitEnabled): Deleted.
3328         (WKPreferencesGetQTKitEnabled): Deleted.
3329         * UIProcess/API/Cocoa/WKPreferences.mm:
3330         (-[WKPreferences _setQTKitEnabled:]): Deleted.
3331         (-[WKPreferences _qtKitEnabled]): Deleted.
3332         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3333
3334 2018-01-24  Youenn Fablet  <youenn@apple.com>
3335
3336         Fetch response should copy its url from the request if null
3337         https://bugs.webkit.org/show_bug.cgi?id=182048
3338
3339         Reviewed by Chris Dumez.
3340
3341         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3342         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
3343
3344 2018-01-24  Sergio Villar Senin  <svillar@igalia.com>
3345
3346         Unreviewed build fix after r227518. I forgot to add the function declarations to the WPE
3347         header.
3348
3349         * UIProcess/API/wpe/WebKitSettings.h: Added webkit_settings_get/set_enable_webvr.
3350
3351 2018-01-24  Youenn Fablet  <youenn@apple.com>
3352
3353         Add Cache Storage engine assertion following on bug 181887
3354         https://bugs.webkit.org/show_bug.cgi?id=181925
3355
3356         Reviewed by Alex Christensen.
3357
3358         In a normal environment, the folderPath should be the same as the path computed from the ClientOrigin.
3359         Add assertion to verify this.
3360
3361         * NetworkProcess/cache/CacheStorageEngine.cpp:
3362         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
3363
3364 2018-01-24  Michael Catanzaro  <mcatanzaro@igalia.com>
3365
3366         [GTK] Use GDK_EVENT_PROPAGATE and GDK_EVENT_STOP in WebKitWebViewBase.cpp
3367         https://bugs.webkit.org/show_bug.cgi?id=182031
3368
3369         Reviewed by Carlos Garcia Campos.
3370
3371         No functional changes, this just replaces TRUE with GDK_EVENT_STOP and FALSE with
3372         GDK_EVENT_PROPAGATE, to improve readability.
3373
3374         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3375         (webkitWebViewBaseKeyPressEvent):
3376         (webkitWebViewBaseKeyReleaseEvent):
3377         (webkitWebViewBaseButtonPressEvent):
3378         (webkitWebViewBaseButtonReleaseEvent):
3379         (webkitWebViewBaseScrollEvent):
3380         (webkitWebViewBaseMotionNotifyEvent):
3381         (webkitWebViewBaseCrossingNotifyEvent):
3382         (webkitWebViewBaseTouchEvent):
3383
3384 2018-01-23  Eric Carlson  <eric.carlson@apple.com>
3385
3386         Resign NowPlaying status when no media element is eligible
3387         https://bugs.webkit.org/show_bug.cgi?id=181914
3388         <rdar://problem/35294116>
3389
3390         Reviewed by Jer Noble.
3391
3392         * UIProcess/API/Cocoa/WKWebView.mm:
3393         (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Return registeredAsNowPlayingApplication
3394         status.
3395         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3396
3397         * UIProcess/WebPageProxy.cpp:
3398         (WebKit::WebPageProxy::nowPlayingInfoCallback): Ditto.
3399         * UIProcess/WebPageProxy.h:
3400         * UIProcess/WebPageProxy.messages.in:
3401         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
3402         (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Ditto.
3403
3404 2018-01-23  Alex Christensen  <achristensen@webkit.org>
3405
3406         Use CompletionHandlers for ResourceHandleClient::didReceiveResponseAsync
3407         https://bugs.webkit.org/show_bug.cgi?id=181961
3408
3409         Reviewed by Michael Catanzaro.
3410
3411         * NetworkProcess/Downloads/Download.h:
3412         * NetworkProcess/NetworkLoad.cpp:
3413         * NetworkProcess/NetworkLoad.h:
3414         * NetworkProcess/NetworkResourceLoadParameters.h:
3415         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3416         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
3417         * WebProcess/WebPage/mac/WebPageMac.mm:
3418         * WebProcess/WebProcess.cpp:
3419
3420 2018-01-23  Chris Dumez  <cdumez@apple.com>
3421
3422         Unreviewed, rollout r227216 as it seems to be causing deadlocks
3423         https://bugs.webkit.org/show_bug.cgi?id=182013
3424
3425         * Platform/IPC/Connection.cpp:
3426         (IPC::Connection::waitForSyncReply):
3427         * Platform/IPC/Connection.h:
3428         (IPC::Connection::setShouldProcessIncomingMessagesWhileWaitingForSyncReply): Deleted.
3429         * UIProcess/WebProcessProxy.cpp:
3430         (WebKit::WebProcessProxy::testIncomingSyncIPCMessageWhileWaitingForSyncReply): Deleted.
3431         * UIProcess/WebProcessProxy.h:
3432         * UIProcess/WebProcessProxy.messages.in:
3433         * WebProcess/Network/NetworkProcessConnection.cpp:
3434         (WebKit::NetworkProcessConnection::NetworkProcessConnection):
3435         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
3436         (WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection):
3437         * WebProcess/WebConnectionToUIProcess.cpp:
3438         (WebKit::WebConnectionToUIProcess::WebConnectionToUIProcess):
3439         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3440         (WebKit::WebChromeClient::testIncomingSyncIPCMessageWhileWaitingForSyncReply): Deleted.