Unreviewed, tiny partial rollout of r228260 as it caused some worker failures
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-02-08  Chris Dumez  <cdumez@apple.com>
2
3         Unreviewed, tiny partial rollout of r228260 as it caused some worker failures
4
5         * bindings/js/JSDOMGlobalObject.cpp:
6         (WebCore::toJSDOMGlobalObject):
7         * bindings/js/JSDOMGlobalObject.h:
8         * bindings/js/JSErrorHandler.cpp:
9         (WebCore::JSErrorHandler::handleEvent):
10         * bindings/js/JSEventListener.cpp:
11         (WebCore::toJSDOMGlobalObject): Deleted.
12
13 2018-02-08  Zalan Bujtas  <zalan@apple.com>
14
15         [RenderTreeBuilder] Move RenderElement::removeAnonymousWrappersForInlinesIfNecessary to RenderTreeBuilder
16         https://bugs.webkit.org/show_bug.cgi?id=182582
17         <rdar://problem/37327890>
18
19         Reviewed by Antti Koivisto.
20
21         Tree mutation -> RenderTreeBuilder.
22
23         No change in functionality
24
25         * rendering/RenderElement.cpp:
26         (WebCore::RenderElement::styleDidChange):
27         (WebCore::RenderElement::removeAnonymousWrappersForInlinesIfNecessary): Deleted.
28         * rendering/RenderElement.h:
29         * rendering/updating/RenderTreeBuilder.cpp:
30         (WebCore::removeAnonymousWrappersForInlinesIfNecessary):
31         (WebCore::RenderTreeBuilder::childFlowStateChangesAndNoLongerAffectsParentBlock):
32         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
33         * rendering/updating/RenderTreeBuilder.h:
34
35 2018-02-08  Philippe Normand  <pnormand@igalia.com>
36
37         [GStreamer] LayoutTest webaudio/silent-audio-interrupted-in-background.html makes its subsequent test flaky crash
38         https://bugs.webkit.org/show_bug.cgi?id=173916
39
40         Reviewed by Xabier Rodriguez Calvar.
41
42         This patch fixes two crashes and a runtime warning:
43
44         - The provider client configuration should be done from the main
45         thread but the no-more-pads signal of deinterleave was fired from
46         a non-main thread.
47
48         - The deinterleave pad-removed signal can be fired for a not fully
49         configured pipeline if the audio context is interrupted. So the
50         peer quark of the removed pad needs to be checked, it might be a
51         null pointer.
52
53         - The provider connects to the deinterleave signals only when a
54         client is provided, so the signal disconnection needs to check
55         that to avoid runtime warnings.
56
57         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
58         (WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
59         Create a main thread notifier.
60         (WebCore::AudioSourceProviderGStreamer::~AudioSourceProviderGStreamer):
61         Invalidate notifier and check a client was set before
62         disconnecting from deinterleave signals.
63         (WebCore::AudioSourceProviderGStreamer::handleRemovedDeinterleavePad):
64         Check validity of the pad peer.
65         (WebCore::AudioSourceProviderGStreamer::deinterleavePadsConfigured):
66         Set client from main thread.
67         * platform/audio/gstreamer/AudioSourceProviderGStreamer.h:
68
69 2018-02-08  Philippe Normand  <pnormand@igalia.com>
70
71         [GStreamer][WebAudio] No need for version check in each loop iteration
72         https://bugs.webkit.org/show_bug.cgi?id=182577
73
74         Reviewed by Xabier Rodriguez Calvar.
75
76         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
77         (webkit_web_audio_src_init): Detect version once only, when creating the element.
78         (webKitWebAudioSrcLoop): Use boolean variable instead of checking the version every time.
79
80 2018-02-08  Frederic Wang  <fwang@igalia.com>
81
82         Add scrolling node types to distinguish main frames and subframes.
83         https://bugs.webkit.org/show_bug.cgi?id=182533
84
85         Reviewed by Simon Fraser.
86
87         This patch splits FrameScrollingNode type into two types: MainFrameScrollingNode and
88         SubframeScrollingNode. This is needed because new places in the code are likely to
89         distinguish them e.g. in ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll
90         or when iOS frame scrolling is introduced (see bug 173833).
91
92         No new tests, behavior unchanged.
93
94         * page/scrolling/AsyncScrollingCoordinator.cpp:
95         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView): This is only called
96         for main frames, so pass MainFrameScrollingNode.
97         * page/scrolling/ScrollingCoordinator.cpp:
98         (WebCore::operator<<): Distinguish subframe and main frame when dumping.
99         * page/scrolling/ScrollingCoordinator.h: Split FrameScrollingNode into two cases.
100         * page/scrolling/ScrollingStateFrameScrollingNode.cpp: Add node type to constructor and
101         ASSERT it remains of type FrameScrollingNode.
102         (WebCore::ScrollingStateFrameScrollingNode::create):
103         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
104         * page/scrolling/ScrollingStateFrameScrollingNode.h: Add node type to constructor.
105         * page/scrolling/ScrollingStateNode.h:
106         (WebCore::ScrollingStateNode::isFrameScrollingNode const): Includes the two cases.
107         * page/scrolling/ScrollingStateTree.cpp:
108         (WebCore::ScrollingStateTree::createNode): Split FrameScrollingNode into two cases and pass
109         the node type.
110         (WebCore::ScrollingStateTree::attachNode): The first case only happens for main frames while
111         the second case only happens with subframes. Use the appriate node type.
112         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: Add node type to constructor and
113         ASSERT it remains of type FrameScrollingNode.
114         (WebCore::ScrollingTreeFrameScrollingNode::ScrollingTreeFrameScrollingNode):
115         * page/scrolling/ScrollingTreeFrameScrollingNode.h: Add node type to constructor.
116         * page/scrolling/ScrollingTreeNode.h: Includes the two cases.
117         (WebCore::ScrollingTreeNode::isFrameScrollingNode const):
118         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: Add node type to constructor.
119         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Ditto.
120         (WebCore::ScrollingTreeFrameScrollingNodeIOS::create):
121         (WebCore::ScrollingTreeFrameScrollingNodeIOS::ScrollingTreeFrameScrollingNodeIOS):
122         * page/scrolling/ios/ScrollingTreeIOS.cpp: Split FrameScrollingNode into two cases.
123         (WebCore::ScrollingTreeIOS::createScrollingTreeNode):
124         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Add node type to constructor.
125         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: Ditto.
126         (WebCore::ScrollingTreeFrameScrollingNodeMac::create):
127         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
128         * page/scrolling/mac/ScrollingTreeMac.cpp: Split FrameScrollingNode into two cases.
129         (ScrollingTreeMac::createScrollingTreeNode):
130         * rendering/RenderLayerCompositor.cpp:
131         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): Distinguish the cases of
132         main frames and subframes.
133         (WebCore::scrollCoordinationRoleForNodeType): Split FrameScrollingNode into two cases.
134         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): Distinguish the cases
135         of main frames and subframes.
136         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Split FrameScrollingNode into
137         two cases.
138
139 2018-02-07  Darin Adler  <darin@apple.com>
140
141         Try to fix ErrorEvent tests seen failing on buildbot after fix for bug 179591.
142
143         * bindings/js/JSErrorHandler.cpp:
144         (WebCore::JSErrorHandler::handleEvent): Add back line of code accidentally removed.
145
146 2018-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
147
148         Add a way to check if a host is an IP address
149         https://bugs.webkit.org/show_bug.cgi?id=182427
150
151         Reviewed by Alex Christensen.
152
153         There are several places where this is needed. We currently just assume that any host ending in a digit is an IP
154         address, except in PublicSuffix where platform specific code is used. This patch adds URL::hostIsIPAddress()
155         platform specific implementations, falling back to current assumption if there isn't an implementation for the
156         platform.
157
158         * page/OriginAccessEntry.cpp:
159         (WebCore::OriginAccessEntry::OriginAccessEntry): Use URL::hostIsIPAddress().
160         * platform/URL.cpp:
161         (WebCore::URL::hostIsIPAddress): Fallback implementation.
162         * platform/URL.h:
163         * platform/mac/PublicSuffixMac.mm:
164         (WebCore::topPrivatelyControlledDomain): Use URL::hostIsIPAddress().
165         * platform/mac/URLMac.mm:
166         (WebCore::URL::hostIsIPAddress): Move implementation from PublicSuffixMac.mm.
167         * platform/network/curl/CookieUtil.cpp:
168         (WebCore::CookieUtil::isIPAddress): Use URL::hostIsIPAddress().
169         * platform/soup/URLSoup.cpp:
170         (WebCore::URL::hostIsIPAddress): Use g_hostname_is_ip_address().
171
172 2018-01-13  Darin Adler  <darin@apple.com>
173
174         Event improvements
175         https://bugs.webkit.org/show_bug.cgi?id=179591
176
177         Reviewed by Chris Dumez.
178
179         - removed all use of Deprecated::ScriptValue
180
181         - fixed uses of JSC::Strong that can lead to reference cycles in CustomEvent,
182           MessageEvent, and PopStateEvent, refactoring to share more code
183
184         - removed incorrect use of CachedAttribute on attributes that can change values
185           (should have fixed a bug; can we find a way to test this?)
186
187         - did a more thorough job of clearing state from events, including clearing
188           certain things before dispatching, and clearing more in initKeyboardEvent
189           (may have fixed some obscure low-severity bugs; can we find a way to test this?)
190
191         - removed "dummy" keyboard events
192
193         - reworked code that omits details from error events for security reasons;
194           old approach was "sanitizing" the error by removing the details if not
195           allowed, new approach is adding the details only if allowed
196
197         * Modules/encryptedmedia/NavigatorEME.h: Added forward declaration needed
198         to compile.
199
200         * Modules/indexeddb/IDBCursor.h: Added comment about incorrect use of JSC::Strong.
201         * Modules/indexeddb/IDBRequest.h: Ditto.
202         * Modules/paymentrequest/PaymentResponse.h: Ditto.
203
204         * WebCore.xcodeproj/project.pbxproj: Added JSValueInWrappedObject.h.
205
206         * bindings/js/CommonVM.cpp:
207         (WebCore::commonVMSlow): Use VM::create instead of VM::createLeaked. Also use
208         local variable instead of the global.
209
210         * bindings/js/DOMWrapperWorld.h: Put the inline bodies of the currentWorld and
211         worldForDOMObject functions separate from the declarations; long term goal is
212         that the declarations serve as documentation, and are not interspersed with the
213         implementations. Changed currentWorld to take a reference instead of a pointer
214         to ExecState. Added isWorldCompatible function.
215
216         * bindings/js/JSCustomElementInterface.cpp:
217         (WebCore::JSCustomElementInterface::upgradeElement): Use toJSDOMWindow instead
218         of toJSDOMGlobalObject and added check for null.
219         (WebCore::JSCustomElementInterface::invokeCallback): Ditto.
220
221         * bindings/js/JSCustomEventCustom.cpp:
222         (WebCore::JSCustomEvent::detail const): Use cachedPropertyValue.
223         (WebCore::JSCustomEvent::visitAdditionalChildren): Added. Needed now that we are
224         using JSValueInWrappedObject instead of JSC::Strong.
225
226         * bindings/js/JSDOMConvertEventListener.h:
227         (WebCore::Converter<IDLEventListener<T>>::convert): Pass a reference.
228         * bindings/js/JSDOMGlobalObject.cpp:
229         (WebCore::toJSDOMGlobalObject): Ditto.
230
231         * bindings/js/JSDOMGlobalObject.cpp:
232         (WebCore::JSDOMGlobalObject::JSDOMGlobalObject): Moved initialization to nullptr
233         to the header.
234         (WebCore::toJSDOMGlobalObject): Deleted.
235         * bindings/js/JSDOMGlobalObject.h: Updated for the above.
236
237         * bindings/js/JSDOMWindowBase.h: Updated includes. Added "DOMWindow.h" but also
238         expanded the deprecated "JSDOMBinding.h" into all the things it includes.
239
240         * bindings/js/JSDOMWindowProxy.cpp:
241         (WebCore::JSDOMWindowProxy::finishCreation): Tweak argument type to match usage.
242         (WebCore::JSDOMWindowProxy::create): Moved here from header, rolled in the code
243         that creates the structure.
244         (WebCore::JSDOMWindowProxy::setWindow): Take a reference instead of a pointer
245         or a RefPtr&&.
246         (WebCore::JSDOMWindowProxy::toWrapped): Use ? : instead of if.
247         (WebCore::toJS): Pass a reference.
248         * bindings/js/JSDOMWindowProxy.h: Updated for abvoe changes.
249
250         * bindings/js/JSDOMWrapper.cpp:
251         (WebCore::cloneAcrossWorlds): Added.
252         * bindings/js/JSDOMWrapper.h: Ditto.
253
254         * bindings/js/JSErrorHandler.cpp:
255         (WebCore::JSErrorHandler::JSErrorHandler): Changed to take a reference.
256         Marked inline.
257         (WebCore::JSErrorHandler::create): Moved here from header. No longer inline, but
258         the constructor is now inline, so same number of levels of function calls, and
259         less code compiled at the call site and less to compile in the header.
260         (WebCore::JSErrorHandler::handleEvent): Use toJSDOMWindow instead
261         of toJSDOMGlobalObject.
262         * bindings/js/JSErrorHandler.h: Ditto. Also made createJSErrorHandler take
263         references instead of pointers.
264
265         * bindings/js/JSEventListener.cpp:
266         (WebCore::JSEventListener::create): Moved here from the header.
267         (WebCore::createEventListenerForEventHandlerAttribute): Updated for change to
268         currentWorld.
269         (WebCore::toJSDOMGlobalObject): Moved here from JSDOMGlobalObject.cpp because
270         this is the only place this function is used now. Also, this was one of four
271         different overrides and so it was good to delete the other three. Also updated
272         to take a reference rather than a "must not be null" pointer.
273         (WebCore::JSEventListener::handleEvent): Coding style tweaks.
274         (WebCore::JSEventListener::virtualisAttribute const): Deleted. Now isAttribute
275         is virtual and uses final as needed to remain inline-able and efficient.
276         (WebCore::JSEventListener::operator== const): Use is<> and downcast<> instead
277         of JSEventListener::cast.
278         (WebCore::eventHandlerAttribute):  Updated for change to currentWorld.
279         (WebCore::setEventHandlerAttribute): Ditto.
280         (WebCore::setWindowEventHandlerAttribute): Ditto.
281         (WebCore::setDocumentEventHandlerAttribute): Ditto.
282
283         * bindings/js/JSEventListener.h: Moved create functions into the cpp file.
284         Removed the cast function, since callers can use is<> and downcast<> instead.
285         Use final rather than override and made isAttribute override the virtual
286         function in the base class, eliminating virtualIsAttribute.
287
288         * bindings/js/JSExtendableMessageEventCustom.cpp:
289         (WebCore::JSExtendableMessageEvent::data const): Use isWorldCompatible.
290         Still need to return here and fix the reference cycle for this class.
291
292         * bindings/js/JSLazyEventListener.cpp:
293         (WebCore::eventParameterName): Moved up so it can be used by the constructor.
294         (WebCore::convertZeroToOne): Added, so that the constructor can fix up text
295         positions passed in to it as part of initializing a data member.
296         (WebCore::JSLazyEventListener::JSLazyEventListener): Changed to take
297         a CreationArguments object instead of lots of separate arguments.
298         (WebCore::JSLazyEventListener::initializeJSFunction const): Removed unneeded
299         checks of m_code and m_eventParameterName, both guaranteed not to be null
300         by the constructor. Tweaked coding style a bit.
301         (WebCore::JSLazyEventListener::create): Pass CreationArguments object.
302         * bindings/js/JSLazyEventListener.h: Updated for above changes. Changed the
303         m_eventParameterName to be a reference since it's always a global string
304         that is never destroyed.
305
306         * bindings/js/JSMessageEventCustom.cpp:
307         (WebCore::JSMessageEvent::data const): Use cachedPropertyValue and also
308         updated for the new version of MessageEvent that uses a Variant instead
309         of a type plus separate functions for each type.
310         (WebCore::JSMessageEvent::visitAdditionalChildren): Added. Needed now that we are
311         using JSValueInWrappedObject instead of JSC::Strong.
312
313         * bindings/js/JSPopStateEventCustom.cpp:
314         (WebCore::JSPopStateEvent::state const): Use isWorldCompatible and also updated
315         to use JSValueInWrappedObject instead of JSC::Strong. Would be nice to share more
316         code with CustomEvent and MessageEvent, but at the moment they are subtly different.
317         Changed cacheState from a function to a lambda.
318         (WebCore::JSPopStateEvent::visitAdditionalChildren): Added. Needed now that we are
319         using JSValueInWrappedObject instead of JSC::Strong.
320
321         * bindings/js/JSValueInWrappedObject.h: Added.
322
323         * bindings/js/ScriptCachedFrameData.cpp:
324         (WebCore::ScriptCachedFrameData::restore): Updated for changes to JSDOMWindowProxy.
325         * bindings/js/ScriptController.cpp:
326         (WebCore::ScriptController::createWindowProxy): Ditto.
327         (WebCore::ScriptController::setDOMWindowForWindowProxy): Ditto.
328
329         * bindings/js/WorkerScriptController.cpp: Removed include of ScriptValue.h.
330         (WebCore::WorkerScriptController::evaluate): Reworked to use the new
331         canIncludeErrorDetails instead of sanitizeScriptError. Added a FIXME about the
332         strange handling of the error message out argument.
333
334         * bindings/scripts/CodeGeneratorJS.pm:
335         (GenerateRuntimeEnableConditionalString): Pass a reference to worldForDOMObject.
336         (GenerateImplementation): Removed an incorrect comment about a removed error
337         check that is truly unneeded.
338         (GenerateAttributeGetterBodyDefinition): Pass a reference to worldForDOMObject.
339         (GenerateAttributeSetterBodyDefinition): Pass references to createJSErrorHandler
340         and worldForDOMObject.
341         (GenerateCallWith): Pass a reference to worldForDOMObject.
342
343         * bindings/scripts/test/JS/JSTestGlobalObject.cpp: Updated for above changes.
344         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: Ditto.
345         * bindings/scripts/test/JS/JSTestObj.cpp: Ditto.
346
347         * dom/CustomEvent.cpp:
348         (WebCore::CustomEvent::CustomEvent): Marked inline. Removed now unneeded
349         ExecState argument.
350         (WebCore::CustomEvent::create): Moved here from header. No longer inline, but
351         the constructor is now inline, so same number of levels of function calls, and
352         less code compiled at the call site and less to compile in the header.
353         (WebCore::CustomEvent::initCustomEvent): Updated to use JSValueInWrappedObject.
354         (WebCore::CustomEvent::trySerializeDetail): Deleted. Now handled by bindings.
355         * dom/CustomEvent.h: Updated for the above.
356         * dom/CustomEvent.idl: Added JSCustomMarkFunction and removed
357         CallWith=ScriptState.
358
359         * dom/Document.cpp:
360         (WebCore::Document::shouldBypassMainWorldContentSecurityPolicy const):
361         Updated to pass reference to currentWorld but also rewrote to be more direct.
362
363         * dom/Element.cpp:
364         (WebCore::Element::isKeyboardFocusable const): Take a pointer instead of a
365         reference to the keyboard event. This function can be called with no event;
366         before this patch we were using a "dummy event".
367         * dom/Element.h: Ditto.
368
369         * dom/ErrorEvent.cpp:
370         (WebCore::ErrorEvent::error): Use isWorldCompatible.
371
372         * dom/Event.cpp:
373         (WebCore::Event::create): Moved here from header.
374         (WebCore::Event::createForBindings): Ditto.
375         (WebCore::Event::initEvent): Updated to use the name m_canceled instead of
376         the name m_defaultPrevented.
377         (WebCore::Event::resetBeforeDispatch): Added. Clears m_defaultHandled so
378         a value left over from a previous dispatch doesn't affect the next dispatch.
379
380         * dom/Event.h: Renamed m_defaultPrevented to m_canceled to match specification
381         terminology and be slightly clearer. Added resetBeforeDispatch. Removed the
382         setDefaultPrevented function.
383
384         * dom/EventDispatcher.cpp:
385         (WebCore::EventDispatcher::dispatchEvent): Added call to resetBeforeDispatch.
386
387         * dom/EventListener.h: Made isAttribute virtual and got rid of virtualIsAttribute,
388         which was an alternative to using "final" before we had that in the language.
389
390         * dom/EventTarget.cpp:
391         (WebCore::EventTarget::dispatchEvent): Added call to resetBeforeDispatch.
392
393         * dom/KeyboardEvent.cpp:
394         (WebCore::KeyboardEvent::KeyboardEvent): Removed unneeded code that initializes
395         m_handledByInputMethod to false; we do that in the class definition now.
396         (WebCore::KeyboardEvent::create): Moved here from header.
397         (WebCore::KeyboardEvent::createForBindings): Ditto.
398         (WebCore::KeyboardEvent::initKeyboardEvent): Added code to reset m_charCode,
399         m_isComposing, m_keyCode, m_repeat, m_underlyingPlatformEvent, m_which, m_code,
400         and m_key. These are needed now that we can reuse an existing event; we don't
401         want them getting out of sync with the other data members.
402         (WebCore::KeyboardEvent::keyCode const): Updated for name change from m_keyEvent
403         to m_underlyingPlatformEvent.
404         (WebCore::KeyboardEvent::charCode const): Ditto.
405         (WebCore::findKeyboardEvent): Deleted. Was unused.
406         * dom/KeyboardEvent.h: Updated for the above. Removed KeyboardEvent::createForDummy.
407
408         * dom/MessageEvent.cpp:
409         (WebCore::MessageEvent::MessageEvent): Removed unnneded ExecState argument.
410         Simplified since m_data is now a Variant.
411         (WebCore::MessageEvent::create): More of the same.
412         (WebCore::MessageEvent::initMessageEvent): Ditto.
413         (WebCore::MessageEvent::trySerializeData): Deleted.
414         (WebCore::MessageEvent::data const): Deleted.
415         * dom/MessageEvent.h: Use a Variant.
416         * dom/MessageEvent.idl: Added JSCustomMarkFunction and removed
417         CallWith=ScriptState and CachedAttribute.
418
419         * dom/MouseEvent.h: Removed obsolete comment.
420         * dom/MouseEvent.idl: Wrap line differently.
421
422         * dom/PopStateEvent.cpp:
423         (WebCore::PopStateEvent::PopStateEvent): Removed unneeded ExecState argument.
424         Updated to use JSValueInWrappedObject.
425         (WebCore::PopStateEvent::create): Ditto.
426         (WebCore::PopStateEvent::trySerializeState): Ditto.
427         * dom/PopStateEvent.h: Ditto.
428         * dom/PopStateEvent.idl: Use JSCustomMarkFunction, and don't use
429         ConstructorCallWith=ScriptState.
430
431         * dom/ScriptExecutionContext.cpp:
432         (WebCore::ScriptExecutionContext::sanitizeScriptError): Deleted.
433         (WebCore::ScriptExecutionContext::canIncludeErrorDetails): Added.
434         (WebCore::ScriptExecutionContext::dispatchErrorEvent): Clarify by
435         using canIncludeErrorDetails instead of sanitizeScriptError.
436         * dom/ScriptExecutionContext.h: Ditto.
437
438         * dom/WheelEvent.cpp:
439         (WebCore::WheelEvent::WheelEvent): Updated for name change and also to
440         eliminate m_initializedWithPlatformWheelEvent.
441         (WebCore::WheelEvent::create): Moved here from header.
442         (WebCore::WheelEvent::createForBindings): Ditto.
443         (WebCore::WheelEvent::initWebKitWheelEvent): Renamed from initWheelEvent.
444         * dom/WheelEvent.h: Renamed initWheelEvent to initWebKitWheelEvent since
445         there is no standard init function for wheel events and we have this only
446         for backward compatibility. Got rid of the separate boolean
447         m_initializedWithPlatformWheelEvent and instead made the renamed
448         m_wheelEvent, m_underlyingPlatformEvent, optional for when there is no
449         underlying platform event.
450
451         * html/BaseDateAndTimeInputType.cpp:
452         (WebCore::BaseDateAndTimeInputType::isKeyboardFocusable const): Take a
453         pointer to the event so we can handle the case where there is no event.
454         * html/BaseDateAndTimeInputType.h: Ditto.
455         * html/HTMLAnchorElement.cpp:
456         (WebCore::HTMLAnchorElement::isKeyboardFocusable const): Ditto.
457         * html/HTMLAnchorElement.h: Ditto.
458         * html/HTMLAreaElement.cpp:
459         (WebCore::HTMLAreaElement::isKeyboardFocusable const): Ditto.
460         * html/HTMLAreaElement.h: Ditto.
461         * html/HTMLDocument.cpp: Added include of "DOMWindow.h".
462         * html/HTMLFormControlElement.cpp:
463         (WebCore::HTMLFormControlElement::isKeyboardFocusable const): Take
464         pointer to the event.
465         * html/HTMLFormControlElement.h: Ditto.
466         * html/HTMLFrameOwnerElement.cpp:
467         (WebCore::HTMLFrameOwnerElement::isKeyboardFocusable const): Ditto.
468         * html/HTMLFrameOwnerElement.h: Ditto.
469         * html/HTMLIFrameElement.h: Ditto.
470         * html/HTMLInputElement.cpp:
471         (WebCore::HTMLInputElement::isKeyboardFocusable const): Ditto.
472         (WebCore::HTMLInputElement::isTextFormControlKeyboardFocusable const): Ditto.
473         * html/HTMLInputElement.h: Ditto.
474         * html/HTMLPlugInElement.cpp:
475         (WebCore::HTMLPlugInElement::isKeyboardFocusable const): Ditto.
476         * html/HTMLPlugInElement.h: Ditto.
477         * html/HTMLSelectElement.cpp:
478         (WebCore::HTMLSelectElement::isKeyboardFocusable const): Ditto.
479         * html/HTMLSelectElement.h: Ditto.
480         * html/HTMLTextAreaElement.cpp:
481         (WebCore::HTMLTextAreaElement::isKeyboardFocusable const): Ditto.
482         * html/HTMLTextAreaElement.h: Ditto.
483         * html/InputType.cpp:
484         (WebCore::InputType::isKeyboardFocusable const): Ditto.
485         * html/InputType.h: Ditto.
486         * html/RadioInputType.cpp:
487         (WebCore::RadioInputType::isKeyboardFocusable const): Ditto.
488         * html/RadioInputType.h: Ditto.
489         * html/TextFieldInputType.cpp:
490         (WebCore::TextFieldInputType::isKeyboardFocusable const): Ditto.
491         * html/TextFieldInputType.h: Ditto.
492
493         * inspector/CommandLineAPIHost.cpp:
494         (WebCore::listenerEntriesFromListenerInfo): Pass reference to currentWorld.
495         Use is<> and downcast<> instead of JSEventListener::cast.
496         * inspector/PageScriptDebugServer.cpp:
497         (WebCore::PageScriptDebugServer::isContentScript const): Pass reference to
498         currentWorld.
499         * inspector/agents/InspectorDOMAgent.cpp:
500         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
501         Use is<> and downcast<> instead of JSEventListener::cast.
502
503         * mathml/MathMLElement.cpp:
504         (WebCore::MathMLElement::isKeyboardFocusable const): Take a
505         pointer to the event so we can handle the case where there is no event.
506         * mathml/MathMLElement.h: Ditto.
507
508         * page/DOMWindow.cpp:
509         (WebCore::DOMWindow::dispatchEvent): Added call to resetBeforeDispatch.
510         All event dispatching paths now need to do this; there are 3.
511
512         * page/EventHandler.cpp:
513         (WebCore::handleWheelEventInAppropriateEnclosingBox): Use the new
514         underlyingPlatformEvent function, less confusing than calling a function
515         named wheelEvent() on an object of type WheelEvent. Also, it returns
516         a const& to std::optional instead of a pointer, so updated for that.
517         (WebCore::EventHandler::defaultWheelEventHandler): Ditto.
518         (WebCore::EventHandler::internalKeyEvent): Use preventDefault instead
519         of setDefaultPrevented(true).
520         (WebCore::EventHandler::tabsToLinks const): Take a pointer.
521         (WebCore::EventHandler::defaultArrowEventHandler): Pass a pointer.
522         (WebCore::EventHandler::defaultTabEventHandler): Ditto.
523         * page/EventHandler.h: Updated for the above.
524
525         * page/EventSource.cpp:
526         (WebCore::EventSource::dispatchMessageEvent): Pass a reference rather
527         than a pointer when creating a message event.
528
529         * page/FocusController.cpp:
530         (WebCore::isFocusableElementOrScopeOwner): Use a pointer instead of reference
531         for keyboard event.
532         (WebCore::isNonFocusableScopeOwner): Ditto.
533         (WebCore::isFocusableScopeOwner): Ditto.
534         (WebCore::shadowAdjustedTabIndex): Ditto.
535         (WebCore::FocusController::findFocusableElementDescendingIntoSubframes):
536         Renamed to use simpler terminology than "descending down into frame document".
537         Changed to take a pointer instead of reference.
538         (WebCore::FocusController::setInitialFocus): Pass nullptr instead of
539         using KeyboardEvent::createForDummy.
540         (WebCore::FocusController::advanceFocus): Pointer instead of reference.
541         (WebCore::FocusController::advanceFocusInDocumentOrder): Ditto.
542         (WebCore::FocusController::findFocusableElementAcrossFocusScope): Ditto.
543         (WebCore::FocusController::findFocusableElementWithinScope): Ditto.
544         (WebCore::FocusController::nextFocusableElementWithinScope): Ditto.
545         (WebCore::FocusController::previousFocusableElementWithinScope): Ditto.
546         (WebCore::FocusController::findFocusableElementOrScopeOwner): Ditto.
547         (WebCore::FocusController::findElementWithExactTabIndex): Ditto.
548         (WebCore::nextElementWithGreaterTabIndex): Ditto.
549         (WebCore::previousElementWithLowerTabIndex): Ditto.
550         (WebCore::FocusController::nextFocusableElement): Ditto.
551         (WebCore::FocusController::previousFocusableElement): Ditto.
552         (WebCore::FocusController::nextFocusableElementOrScopeOwner): Ditto.
553         (WebCore::FocusController::previousFocusableElementOrScopeOwner): Ditto.
554         (WebCore::FocusController::findFocusCandidateInContainer): Ditto.
555         (WebCore::FocusController::advanceFocusDirectionallyInContainer): Ditto.
556         (WebCore::FocusController::advanceFocusDirectionally): Ditto.
557         * page/FocusController.h: Updated for the above.
558
559         * page/PageConsoleClient.cpp:
560         (WebCore::objectArgumentAt): Added. Helper to make functions below simpler.
561         (WebCore::canvasRenderingContext): Factored out logic to get the context
562         from either a canvas or a canvas rendering context from the functions below.
563         Also updated to not use ScriptValue and to use auto quite a bit more.
564         (WebCore::PageConsoleClient::record): Updated to use the functions above.
565         (WebCore::PageConsoleClient::recordEnd): Ditto.
566
567         * page/ios/EventHandlerIOS.mm:
568         (WebCore::EventHandler::tabsToAllFormControls const): Take a pointer
569         instead of a reference.
570         * page/mac/EventHandlerMac.mm:
571         (WebCore::EventHandler::tabsToAllFormControls const): Ditto.
572         * page/win/EventHandlerWin.cpp:
573         (WebCore::EventHandler::tabsToAllFormControls const): Ditto.
574         * platform/glib/EventHandlerGLib.cpp:
575         (WebCore::EventHandler::tabsToAllFormControls const): Ditto.
576         * svg/SVGAElement.cpp:
577         (WebCore::SVGAElement::isKeyboardFocusable const): Ditto.
578         * svg/SVGAElement.h: Ditto.
579
580         * testing/Internals.cpp:
581         (WebCore::Internals::isFromCurrentWorld const): Use isWorldCompatible.
582
583 2018-02-07  Andy Estes  <aestes@apple.com>
584
585         ASSERTION FAILED: vm->currentThreadIsHoldingAPILock() seen with http/tests/paymentrequest/payment-request-show-method.https.html
586         https://bugs.webkit.org/show_bug.cgi?id=182591
587
588         Reviewed by Youenn Fablet.
589
590         Fixes assertion failures in http/tests/paymentrequest/payment-request-show-method.https.html.
591
592         DOMPromise::whenSettled() calls the JSC API without first aquiring the API lock, and
593         r228195 added a call to whenSettled() where the lock is not guaranteed to be already
594         acquired.
595
596         Fix this by creating a JSLockHolder in DOMPromise::whenSettled().
597
598         * bindings/js/JSDOMPromise.cpp:
599         (WebCore::DOMPromise::whenSettled):
600
601 2018-02-07  Ryan Haddad  <ryanhaddad@apple.com>
602
603         Unreviewed, rolling out r228243.
604
605         Introduced an assertion failure with API test
606         FullscreenZoomInitialFrame.WebKit
607
608         Reverted changeset:
609
610         "Assert that NSApp is not running in the WebProcess."
611         https://bugs.webkit.org/show_bug.cgi?id=182553
612         https://trac.webkit.org/changeset/228243
613
614 2018-02-07  Christopher Reid  <chris.reid@sony.com>
615
616         [Curl] Cookie Database has some warnings when compiled in clang
617         https://bugs.webkit.org/show_bug.cgi?id=182583
618
619         Reviewed by Alex Christensen.
620
621         No new tests, no change in behavior.
622
623         Fixing unused-parameter, missing-field-initializers, reorder, and pragma-once-outside-header warnings.
624
625         * platform/network/NetworkStorageSession.h:
626         * platform/network/curl/CookieJarCurlDatabase.cpp:
627         * platform/network/curl/CookieJarDB.cpp:
628         * platform/network/curl/NetworkStorageSessionCurl.cpp:
629
630 2018-02-07  Ryosuke Niwa  <rniwa@webkit.org>
631
632         Remove unused CSSParserContext in CSSParser::parseInlineStyleDeclaration
633         https://bugs.webkit.org/show_bug.cgi?id=182587
634
635         Reviewed by Simon Fraser.
636
637         Removed the code. There is no need to create an unused CSSParserContext in CSSParser.
638
639         * css/parser/CSSParser.cpp:
640         (WebCore::CSSParser::parseInlineStyleDeclaration):
641         * css/parser/CSSParser.h:
642         * css/parser/CSSParserImpl.cpp:
643         (WebCore::CSSParserImpl::parseInlineStyleDeclaration):
644         * css/parser/CSSParserImpl.h:
645
646 2018-02-07  Ross Kirsling  <ross.kirsling@sony.com>
647
648         Add missing #if ENABLE(VIDEO_TRACK) after r228201.
649         https://bugs.webkit.org/show_bug.cgi?id=182585
650
651         Reviewed by Chris Dumez.
652
653         * loader/LinkPreloadResourceClients.h:
654
655 2018-02-07  Per Arne Vollan  <pvollan@apple.com>
656
657         Assert that NSApp is not running in the WebProcess.
658         https://bugs.webkit.org/show_bug.cgi?id=182553
659         <rdar://problem/37316144>
660         
661         Reviewed by Simon Fraser.
662
663         In WebCore, there are a few places where NSApp is referenced. Since the WebContent process
664         is no longer using the NSApplication run loop, and NSApp is no longer guaranteed to be
665         valid, we should make sure that the NSApp is not referenced by the WebContent process or
666         the Network process, by asserting that the NSApplication event loop is running when NSApp
667         is referenced. It is still ok for the UIProcess to reference NSApp. Adding these assert
668         will help catch references to NSApp when the NSApplication run loop is not used.
669         Also, do not post a fake mouse event in PasteBoard::setDragImage when the NSApplication
670         run loop is not running, since this is only relevant in WK1.
671
672         No new tests, covered by existing tests. 
673
674         * page/mac/EventHandlerMac.mm:
675         (WebCore::lastEventIsMouseUp):
676         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
677         * platform/mac/PasteboardMac.mm:
678         (WebCore::Pasteboard::setDragImage):
679         * platform/mac/WebVideoFullscreenController.mm:
680         (-[WebVideoFullscreenController windowDidLoad]):
681         (-[WebVideoFullscreenController updateMenuAndDockForFullscreen]):
682         * platform/mac/WebWindowAnimation.mm:
683         (WebCore::WebWindowAnimationDurationFromDuration):
684
685 2018-02-07  Youenn Fablet  <youenn@apple.com>
686
687         ASSERTION FAILED: m_timeOrigin in Performance::Performance()
688         https://bugs.webkit.org/show_bug.cgi?id=182558
689         <rdar://problem/37297551>
690
691         Reviewed by Chris Dumez.
692
693         Test: http/wpt/fetch/cors-preflight-star.any.serviceworker.html
694
695         * loader/CrossOriginPreflightChecker.cpp:
696         (WebCore::CrossOriginPreflightChecker::startPreflight):
697
698 2018-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
699
700         REGRESSION(r226396): File paths are inserted when dropping image files
701         https://bugs.webkit.org/show_bug.cgi?id=182557
702         <rdar://problem/37294120>
703
704         Reviewed by Ryosuke Niwa.
705
706         Reverts unintended changes in <http://trac.webkit.org/r226396>. Before r226396, WebContentReader::readFilenames
707         (a helper function in macOS-specific code) contained logic to create and insert attachment elements if
708         ENABLE(ATTACHMENT_ELEMENT); otherwise, it would fall back to inserting the visible URL as a text node. Since we
709         enable the attachment element on all Cocoa platforms via xcconfig files, this was effectively dead code.
710
711         However, when r226396 (which moved this out from macOS to Cocoa platform code) refactored this helper function,
712         it also moved this chunk of code out of the !ENABLE(ATTACHMENT) conditional and into a PLATFORM(MAC) guard,
713         which means that we now fall back to inserting file paths as text when attachment elements are disabled. To fix
714         this, we simply remove the (previously) dead code.
715
716         A more subtle difference is that we no longer always return true from WebContentReader::readFilePaths. This
717         means that when we drop files, we no longer skip over the early return in documentFragmentFromDragData when
718         we've made a fragment, so we read the file path as a URL. To address this, we just restore the pre-macOS 10.13.4
719         behavior of initializing the document fragment.
720
721         Test: modified editing/pasteboard/drag-files-to-editable-element-as-URLs.html.
722
723         * editing/WebContentReader.cpp:
724         (WebCore::WebContentReader::ensureFragment): Deleted.
725
726         Remove this helper, as it was only used in WebContentReader::readFilePaths.
727
728         * editing/WebContentReader.h:
729         * editing/cocoa/WebContentReaderCocoa.mm:
730         (WebCore::WebContentReader::readFilePaths):
731
732 2018-02-07  John Wilander  <wilander@apple.com>
733
734         Restrict Referer to just the origin for third parties in private mode and third parties ITP blocks cookies for in regular mode
735         https://bugs.webkit.org/show_bug.cgi?id=182559
736         <rdar://problem/36990337>
737
738         Reviewed by Andy Estes.
739
740         Tests: http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects.html
741                http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests.html
742                http/tests/security/strip-referrer-to-origin-for-third-party-redirects-in-private-mode.html
743                http/tests/security/strip-referrer-to-origin-for-third-party-requests-in-private-mode.html
744
745         * page/SecurityPolicy.cpp:
746         (WebCore::SecurityPolicy::referrerToOriginString):
747             Now exposed within WebCore. This is to make sure we create a proper referrer
748             string in WebCore::ResourceRequestBase::setExistingHTTPReferrerToOriginString().
749         (WebCore::referrerToOriginString): Deleted.
750             Used to be internal.
751         * page/SecurityPolicy.h:
752         * platform/network/ResourceRequestBase.cpp:
753         (WebCore::ResourceRequestBase::setExistingHTTPReferrerToOriginString):
754             New, exported function used in WebKit. Note that this function does not
755             set the referrer if the request has none since before.
756         * platform/network/ResourceRequestBase.h:
757
758
759 2018-02-07  Zalan Bujtas  <zalan@apple.com>
760
761         [RenderTreeBuilder] Remove RenderElement::destroyLeftoverChildren.
762         https://bugs.webkit.org/show_bug.cgi?id=182518
763         <rdar://problem/37256035>
764
765         Reviewed by Antti Koivisto.
766
767         Remove leftover children before we call takeChild() on the parent (as opposed to when
768         we finally call destroy() on the parent).
769         This patch also explicitly destroys the top level pagination renderers.
770
771         Covered by existing tests.
772
773         * rendering/RenderElement.cpp:
774         (WebCore::RenderElement::removeAndDestroyChild):
775         (WebCore::RenderElement::destroyLeftoverChildren): Deleted.
776         * rendering/RenderElement.h:
777         * rendering/RenderObject.cpp:
778         (WebCore::RenderObject::destroy):
779         * rendering/updating/RenderTreeUpdater.cpp:
780         (WebCore::RenderTreeUpdater::tearDownRenderers):
781         (WebCore::RenderTreeUpdater::tearDownLeftoverPaginationRenderersIfNeeded):
782         * rendering/updating/RenderTreeUpdater.h:
783
784 2018-02-07  Daniel Bates  <dabates@apple.com>
785
786         Log error when authentication challenge is blocked due to an insecure request
787         https://bugs.webkit.org/show_bug.cgi?id=182358
788
789         Reviewed by Andy Estes.
790
791         Emit an error message to Web Inspector console that explains why an authentication
792         challenge was blocked so that a developer can fix up their site.
793
794         Tests: http/tests/security/mixedContent/insecure-basic-auth-image.https.html
795                http/tests/security/mixedContent/secure-page-navigates-to-basic-auth-insecure-page.https.html
796                http/tests/security/mixedContent/secure-page-navigates-to-basic-auth-secure-page-via-insecure-redirect.https.html
797
798         * loader/FrameLoader.cpp:
799         (WebCore::FrameLoader::receivedFirstData): Log to the console an error message
800         if the document we are loading was forbidden from prompting for credentials.
801         Also removed duplicate assertion to ensure document is non-null and update
802         call to LinkLoader::loadLinksFromHeader() to use local variable to access
803         the document we are loading instead of asking the frame for it, again.
804         (WebCore::FrameLoader::reportAuthenticationChallengeBlocked): Added.
805         * loader/FrameLoader.h:
806
807         * loader/ResourceLoader.cpp:
808         (WebCore::ResourceLoader::init):
809         (WebCore::ResourceLoader::willSendRequestInternal):
810         Track the decision to forbid asking for credentials due to Fetch spec. requirements (m_canAskClientForCredentials)
811         independently from the decision to forbid them due to making an insecure request (m_wasInsecureRequestSeen)
812         so that we know the reason why we blocked asking for credentials when we receive an authentication challenge.
813
814         (WebCore::ResourceLoader::didBlockAuthenticationChallenge): Added.
815         (WebCore::ResourceLoader::isAllowedToAskUserForCredentials const): Modified code now that we track
816         whether we have seen an insecure request so far independently from decision to forbid prompting for
817         credentials due to a Fetch spec. requirement.
818
819         (WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
820         Store a bit whether we have seen an insecure request when loading the resource so far. Disallow
821         asking for credentials if we have seen an insecure request so far. Once we receive a response
822
823         * loader/ResourceLoader.h:
824         (WebCore::ResourceLoader::wasAuthenticationChallengeBlocked const): Added.
825         (WebCore::ResourceLoader::wasInsecureRequestSeen const): Added.
826
827 2018-02-06  Matt Lewis  <jlewis3@apple.com>
828
829         Removed the assertions from VideoFullscreenInterfaceAVKit.mm temporarily to stop the resulting crashes during debugging.
830         https://bugs.webkit.org/show_bug.cgi?id=182527
831
832         Unreviewed build fix.
833
834         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
835         (VideoFullscreenInterfaceAVKit::exitFullscreen):
836         (VideoFullscreenInterfaceAVKit::cleanupFullscreen):
837
838 2018-02-07  Zalan Bujtas  <zalan@apple.com>
839
840         [RenderTreeBuilder] Move RenderBlock::removeLeftoverAnonymousBlock to RenderTreeBuilder
841         https://bugs.webkit.org/show_bug.cgi?id=182510
842         <rdar://problem/37250037>
843
844         Reviewed by Antti Koivisto.
845
846         Do not reinvent subtree reparenting.
847
848         Covered by existing tests.
849
850         * rendering/RenderBlock.cpp:
851         (WebCore::RenderBlock::removeLeftoverAnonymousBlock): Deleted.
852         * rendering/RenderBlock.h:
853         * rendering/RenderBoxModelObject.cpp:
854         (WebCore::RenderBoxModelObject::moveAllChildrenToInternal):
855         * rendering/RenderBoxModelObject.h:
856         * rendering/RenderButton.h:
857         * rendering/RenderElement.cpp:
858         (WebCore::RenderElement::detachRendererInternal):
859         (WebCore::RenderElement::attachRendererInternal):
860         (WebCore::RenderElement::insertChildInternal):
861         (WebCore::RenderElement::takeChildInternal):
862         * rendering/RenderElement.h:
863         * rendering/RenderRuby.h:
864         * rendering/RenderRubyRun.h:
865         * rendering/RenderTextControl.h:
866         * rendering/updating/RenderTreeBuilderBlock.cpp:
867         (WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation):
868         (WebCore::RenderTreeBuilder::Block::childBecameNonInline):
869         (WebCore::RenderTreeBuilder::Block::removeLeftoverAnonymousBlock):
870         * rendering/updating/RenderTreeBuilderBlock.h:
871
872 2018-02-06  Don Olmstead  <don.olmstead@sony.com>
873
874         Remove WebCore/ForwardingHeaders directory
875         https://bugs.webkit.org/show_bug.cgi?id=182347
876
877         Reviewed by Keith Miller.
878
879         No new tests. No change in behavior.
880
881         * CMakeLists.txt:
882         * ForwardingHeaders/bindings/ScriptFunctionCall.h: Removed.
883         * ForwardingHeaders/bindings/ScriptObject.h: Removed.
884         * ForwardingHeaders/bindings/ScriptValue.h: Removed.
885         * ForwardingHeaders/builtins/BuiltinNames.h: Removed.
886         * ForwardingHeaders/builtins/BuiltinUtils.h: Removed.
887         * ForwardingHeaders/builtins/JSCBuiltins.h: Removed.
888         * ForwardingHeaders/bytecode/CodeBlock.h: Removed.
889         * ForwardingHeaders/bytecode/SpeculatedType.h: Removed.
890         * ForwardingHeaders/bytecode/UnlinkedFunctionExecutable.h: Removed.
891         * ForwardingHeaders/debugger/Debugger.h: Removed.
892         * ForwardingHeaders/domjit/DOMJITAbstractHeap.h: Removed.
893         * ForwardingHeaders/domjit/DOMJITEffect.h: Removed.
894         * ForwardingHeaders/domjit/DOMJITGetterSetter.h: Removed.
895         * ForwardingHeaders/domjit/DOMJITHeapRange.h: Removed.
896         * ForwardingHeaders/domjit/DOMJITSignature.h: Removed.
897         * ForwardingHeaders/heap/BlockDirectoryInlines.h: Removed.
898         * ForwardingHeaders/heap/DeleteAllCodeEffort.h: Removed.
899         * ForwardingHeaders/heap/FastMallocAlignedMemoryAllocator.h: Removed.
900         * ForwardingHeaders/heap/GCActivityCallback.h: Removed.
901         * ForwardingHeaders/heap/GCFinalizationCallback.h: Removed.
902         * ForwardingHeaders/heap/HandleTypes.h: Removed.
903         * ForwardingHeaders/heap/Heap.h: Removed.
904         * ForwardingHeaders/heap/HeapInlines.h: Removed.
905         * ForwardingHeaders/heap/HeapObserver.h: Removed.
906         * ForwardingHeaders/heap/IncrementalSweeper.h: Removed.
907         * ForwardingHeaders/heap/LockDuringMarking.h: Removed.
908         * ForwardingHeaders/heap/MachineStackMarker.h: Removed.
909         * ForwardingHeaders/heap/MarkedBlockInlines.h: Removed.
910         * ForwardingHeaders/heap/MarkingConstraint.h: Removed.
911         * ForwardingHeaders/heap/RunningScope.h: Removed.
912         * ForwardingHeaders/heap/SimpleMarkingConstraint.h: Removed.
913         * ForwardingHeaders/heap/SlotVisitor.h: Removed.
914         * ForwardingHeaders/heap/SlotVisitorInlines.h: Removed.
915         * ForwardingHeaders/heap/Strong.h: Removed.
916         * ForwardingHeaders/heap/StrongInlines.h: Removed.
917         * ForwardingHeaders/heap/SubspaceInlines.h: Removed.
918         * ForwardingHeaders/heap/ThreadLocalCache.h: Removed.
919         * ForwardingHeaders/heap/Weak.h: Removed.
920         * ForwardingHeaders/heap/WeakInlines.h: Removed.
921         * ForwardingHeaders/inspector/ConsoleMessage.h: Removed.
922         * ForwardingHeaders/inspector/ContentSearchUtilities.h: Removed.
923         * ForwardingHeaders/inspector/IdentifiersFactory.h: Removed.
924         * ForwardingHeaders/inspector/InjectedScript.h: Removed.
925         * ForwardingHeaders/inspector/InjectedScriptBase.h: Removed.
926         * ForwardingHeaders/inspector/InjectedScriptHost.h: Removed.
927         * ForwardingHeaders/inspector/InjectedScriptManager.h: Removed.
928         * ForwardingHeaders/inspector/InjectedScriptModule.h: Removed.
929         * ForwardingHeaders/inspector/InspectorAgentBase.h: Removed.
930         * ForwardingHeaders/inspector/InspectorAgentRegistry.h: Removed.
931         * ForwardingHeaders/inspector/InspectorBackendDispatcher.h: Removed.
932         * ForwardingHeaders/inspector/InspectorBackendDispatchers.h: Removed.
933         * ForwardingHeaders/inspector/InspectorEnvironment.h: Removed.
934         * ForwardingHeaders/inspector/InspectorFrontendChannel.h: Removed.
935         * ForwardingHeaders/inspector/InspectorFrontendDispatchers.h: Removed.
936         * ForwardingHeaders/inspector/InspectorFrontendRouter.h: Removed.
937         * ForwardingHeaders/inspector/InspectorProtocolObjects.h: Removed.
938         * ForwardingHeaders/inspector/InspectorProtocolTypes.h: Removed.
939         * ForwardingHeaders/inspector/PerGlobalObjectWrapperWorld.h: Removed.
940         * ForwardingHeaders/inspector/ScriptArguments.h: Removed.
941         * ForwardingHeaders/inspector/ScriptBreakpoint.h: Removed.
942         * ForwardingHeaders/inspector/ScriptCallFrame.h: Removed.
943         * ForwardingHeaders/inspector/ScriptCallStack.h: Removed.
944         * ForwardingHeaders/inspector/ScriptCallStackFactory.h: Removed.
945         * ForwardingHeaders/inspector/ScriptDebugListener.h: Removed.
946         * ForwardingHeaders/inspector/ScriptDebugServer.h: Removed.
947         * ForwardingHeaders/inspector/agents/InspectorAgent.h: Removed.
948         * ForwardingHeaders/inspector/agents/InspectorConsoleAgent.h: Removed.
949         * ForwardingHeaders/inspector/agents/InspectorDebuggerAgent.h: Removed.
950         * ForwardingHeaders/inspector/agents/InspectorHeapAgent.h: Removed.
951         * ForwardingHeaders/inspector/agents/InspectorRuntimeAgent.h: Removed.
952         * ForwardingHeaders/inspector/agents/InspectorScriptProfilerAgent.h: Removed.
953         * ForwardingHeaders/interpreter/CallFrame.h: Removed.
954         * ForwardingHeaders/interpreter/FrameTracers.h: Removed.
955         * ForwardingHeaders/interpreter/ShadowChicken.h: Removed.
956         * ForwardingHeaders/interpreter/StackVisitor.h: Removed.
957         * ForwardingHeaders/jit/JITCode.h: Removed.
958         * ForwardingHeaders/jit/JITMathICForwards.h: Removed.
959         * ForwardingHeaders/jit/Snippet.h: Removed.
960         * ForwardingHeaders/jit/SnippetParams.h: Removed.
961         * ForwardingHeaders/jit/SpillRegistersMode.h: Removed.
962         * ForwardingHeaders/masm/X86Assembler.h: Removed.
963         * ForwardingHeaders/parser/ParserError.h: Removed.
964         * ForwardingHeaders/parser/SourceCode.h: Removed.
965         * ForwardingHeaders/parser/SourceProvider.h: Removed.
966         * ForwardingHeaders/parser/SourceProviderCache.h: Removed.
967         * ForwardingHeaders/profiler/ProfilerDatabase.h: Removed.
968         * ForwardingHeaders/runtime/ArgList.h: Removed.
969         * ForwardingHeaders/runtime/ArrayBuffer.h: Removed.
970         * ForwardingHeaders/runtime/ArrayBufferView.h: Removed.
971         * ForwardingHeaders/runtime/ArrayPrototype.h: Removed.
972         * ForwardingHeaders/runtime/AuxiliaryBarrierInlines.h: Removed.
973         * ForwardingHeaders/runtime/BooleanObject.h: Removed.
974         * ForwardingHeaders/runtime/CallData.h: Removed.
975         * ForwardingHeaders/runtime/CatchScope.h: Removed.
976         * ForwardingHeaders/runtime/CommonIdentifiers.h: Removed.
977         * ForwardingHeaders/runtime/Completion.h: Removed.
978         * ForwardingHeaders/runtime/ConfigFile.h: Removed.
979         * ForwardingHeaders/runtime/ConsoleClient.h: Removed.
980         * ForwardingHeaders/runtime/ConsoleTypes.h: Removed.
981         * ForwardingHeaders/runtime/ConstructAbility.h: Removed.
982         * ForwardingHeaders/runtime/ConstructData.h: Removed.
983         * ForwardingHeaders/runtime/DataView.h: Removed.
984         * ForwardingHeaders/runtime/DateInstance.h: Removed.
985         * ForwardingHeaders/runtime/Error.h: Removed.
986         * ForwardingHeaders/runtime/ErrorHandlingScope.h: Removed.
987         * ForwardingHeaders/runtime/ErrorInstance.h: Removed.
988         * ForwardingHeaders/runtime/ErrorPrototype.h: Removed.
989         * ForwardingHeaders/runtime/Exception.h: Removed.
990         * ForwardingHeaders/runtime/ExceptionHelpers.h: Removed.
991         * ForwardingHeaders/runtime/Float32Array.h: Removed.
992         * ForwardingHeaders/runtime/Float64Array.h: Removed.
993         * ForwardingHeaders/runtime/FunctionConstructor.h: Removed.
994         * ForwardingHeaders/runtime/FunctionExecutable.h: Removed.
995         * ForwardingHeaders/runtime/FunctionPrototype.h: Removed.
996         * ForwardingHeaders/runtime/HashMapImpl.h: Removed.
997         * ForwardingHeaders/runtime/Identifier.h: Removed.
998         * ForwardingHeaders/runtime/IdentifierInlines.h: Removed.
999         * ForwardingHeaders/runtime/InitializeThreading.h: Removed.
1000         * ForwardingHeaders/runtime/Int16Array.h: Removed.
1001         * ForwardingHeaders/runtime/Int32Array.h: Removed.
1002         * ForwardingHeaders/runtime/Int8Array.h: Removed.
1003         * ForwardingHeaders/runtime/InternalFunction.h: Removed.
1004         * ForwardingHeaders/runtime/Intrinsic.h: Removed.
1005         * ForwardingHeaders/runtime/IterationKind.h: Removed.
1006         * ForwardingHeaders/runtime/IteratorOperations.h: Removed.
1007         * ForwardingHeaders/runtime/IteratorPrototype.h: Removed.
1008         * ForwardingHeaders/runtime/JSAPIValueWrapper.h: Removed.
1009         * ForwardingHeaders/runtime/JSArray.h: Removed.
1010         * ForwardingHeaders/runtime/JSArrayBuffer.h: Removed.
1011         * ForwardingHeaders/runtime/JSArrayBufferView.h: Removed.
1012         * ForwardingHeaders/runtime/JSCInlines.h: Removed.
1013         * ForwardingHeaders/runtime/JSCJSValue.h: Removed.
1014         * ForwardingHeaders/runtime/JSCJSValueInlines.h: Removed.
1015         * ForwardingHeaders/runtime/JSCallee.h: Removed.
1016         * ForwardingHeaders/runtime/JSCell.h: Removed.
1017         * ForwardingHeaders/runtime/JSCellInlines.h: Removed.
1018         * ForwardingHeaders/runtime/JSDataView.h: Removed.
1019         * ForwardingHeaders/runtime/JSDestructibleObject.h: Removed.
1020         * ForwardingHeaders/runtime/JSDestructibleObjectHeapCellType.h: Removed.
1021         * ForwardingHeaders/runtime/JSExportMacros.h: Removed.
1022         * ForwardingHeaders/runtime/JSFunction.h: Removed.
1023         * ForwardingHeaders/runtime/JSGlobalObject.h: Removed.
1024         * ForwardingHeaders/runtime/JSGlobalObjectInlines.h: Removed.
1025         * ForwardingHeaders/runtime/JSInternalPromise.h: Removed.
1026         * ForwardingHeaders/runtime/JSInternalPromiseDeferred.h: Removed.
1027         * ForwardingHeaders/runtime/JSLock.h: Removed.
1028         * ForwardingHeaders/runtime/JSMap.h: Removed.
1029         * ForwardingHeaders/runtime/JSMapIterator.h: Removed.
1030         * ForwardingHeaders/runtime/JSModuleLoader.h: Removed.
1031         * ForwardingHeaders/runtime/JSModuleRecord.h: Removed.
1032         * ForwardingHeaders/runtime/JSNativeStdFunction.h: Removed.
1033         * ForwardingHeaders/runtime/JSONObject.h: Removed.
1034         * ForwardingHeaders/runtime/JSObject.h: Removed.
1035         * ForwardingHeaders/runtime/JSObjectInlines.h: Removed.
1036         * ForwardingHeaders/runtime/JSPromise.h: Removed.
1037         * ForwardingHeaders/runtime/JSPromiseConstructor.h: Removed.
1038         * ForwardingHeaders/runtime/JSPromiseDeferred.h: Removed.
1039         * ForwardingHeaders/runtime/JSProxy.h: Removed.
1040         * ForwardingHeaders/runtime/JSRunLoopTimer.h: Removed.
1041         * ForwardingHeaders/runtime/JSScriptFetchParameters.h: Removed.
1042         * ForwardingHeaders/runtime/JSScriptFetcher.h: Removed.
1043         * ForwardingHeaders/runtime/JSSegmentedVariableObjectHeapCellType.h: Removed.
1044         * ForwardingHeaders/runtime/JSSet.h: Removed.
1045         * ForwardingHeaders/runtime/JSSetIterator.h: Removed.
1046         * ForwardingHeaders/runtime/JSSourceCode.h: Removed.
1047         * ForwardingHeaders/runtime/JSString.h: Removed.
1048         * ForwardingHeaders/runtime/JSTypedArrays.h: Removed.
1049         * ForwardingHeaders/runtime/JSWithScope.h: Removed.
1050         * ForwardingHeaders/runtime/Lookup.h: Removed.
1051         * ForwardingHeaders/runtime/MapBase.h: Removed.
1052         * ForwardingHeaders/runtime/MapData.h: Removed.
1053         * ForwardingHeaders/runtime/MapDataInlines.h: Removed.
1054         * ForwardingHeaders/runtime/MatchResult.h: Removed.
1055         * ForwardingHeaders/runtime/Microtask.h: Removed.
1056         * ForwardingHeaders/runtime/ObjectConstructor.h: Removed.
1057         * ForwardingHeaders/runtime/ObjectPrototype.h: Removed.
1058         * ForwardingHeaders/runtime/Operations.h: Removed.
1059         * ForwardingHeaders/runtime/PrivateName.h: Removed.
1060         * ForwardingHeaders/runtime/PromiseDeferredTimer.h: Removed.
1061         * ForwardingHeaders/runtime/PropertyNameArray.h: Removed.
1062         * ForwardingHeaders/runtime/Protect.h: Removed.
1063         * ForwardingHeaders/runtime/RegExp.h: Removed.
1064         * ForwardingHeaders/runtime/RegExpObject.h: Removed.
1065         * ForwardingHeaders/runtime/RuntimeFlags.h: Removed.
1066         * ForwardingHeaders/runtime/SamplingProfiler.h: Removed.
1067         * ForwardingHeaders/runtime/ScriptFetchParameters.h: Removed.
1068         * ForwardingHeaders/runtime/ScriptFetcher.h: Removed.
1069         * ForwardingHeaders/runtime/StringObject.h: Removed.
1070         * ForwardingHeaders/runtime/StringPrototype.h: Removed.
1071         * ForwardingHeaders/runtime/Structure.h: Removed.
1072         * ForwardingHeaders/runtime/StructureChain.h: Removed.
1073         * ForwardingHeaders/runtime/StructureInlines.h: Removed.
1074         * ForwardingHeaders/runtime/Symbol.h: Removed.
1075         * ForwardingHeaders/runtime/SymbolTable.h: Removed.
1076         * ForwardingHeaders/runtime/ThrowScope.h: Removed.
1077         * ForwardingHeaders/runtime/TypedArrayController.h: Removed.
1078         * ForwardingHeaders/runtime/TypedArrayInlines.h: Removed.
1079         * ForwardingHeaders/runtime/TypedArrays.h: Removed.
1080         * ForwardingHeaders/runtime/Uint16Array.h: Removed.
1081         * ForwardingHeaders/runtime/Uint32Array.h: Removed.
1082         * ForwardingHeaders/runtime/Uint8Array.h: Removed.
1083         * ForwardingHeaders/runtime/Uint8ClampedArray.h: Removed.
1084         * ForwardingHeaders/runtime/VM.h: Removed.
1085         * ForwardingHeaders/runtime/VMEntryScope.h: Removed.
1086         * ForwardingHeaders/runtime/Watchdog.h: Removed.
1087         * ForwardingHeaders/runtime/WeakGCMap.h: Removed.
1088         * ForwardingHeaders/runtime/WeakGCMapInlines.h: Removed.
1089         * ForwardingHeaders/runtime/WriteBarrier.h: Removed.
1090         * ForwardingHeaders/wasm/WasmModule.h: Removed.
1091         * ForwardingHeaders/wasm/js/JSWebAssemblyModule.h: Removed.
1092         * ForwardingHeaders/yarr/RegularExpression.h: Removed.
1093         * ForwardingHeaders/yarr/Yarr.h: Removed.
1094         * ForwardingHeaders/yarr/YarrInterpreter.h: Removed.
1095         * ForwardingHeaders/yarr/YarrJIT.h: Removed.
1096         * ForwardingHeaders/yarr/YarrPattern.h: Removed.
1097         * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
1098         * Modules/encryptedmedia/MediaKeyMessageEvent.h:
1099         * Modules/encryptedmedia/MediaKeyMessageEventInit.h:
1100         * Modules/encryptedmedia/MediaKeyStatusMap.h:
1101         * Modules/encryptedmedia/legacy/LegacyCDM.h:
1102         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
1103         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
1104         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
1105         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
1106         * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
1107         * Modules/fetch/FetchBody.cpp:
1108         * Modules/fetch/FetchRequestInit.h:
1109         * Modules/fetch/FetchResponse.h:
1110         * Modules/indexeddb/IDBCursor.cpp:
1111         * Modules/indexeddb/IDBCursor.h:
1112         * Modules/indexeddb/IDBCursorWithValue.cpp:
1113         * Modules/indexeddb/IDBDatabase.cpp:
1114         * Modules/indexeddb/IDBIndex.cpp:
1115         * Modules/indexeddb/IDBKey.cpp:
1116         * Modules/indexeddb/IDBKeyRange.cpp:
1117         * Modules/indexeddb/IDBObjectStore.cpp:
1118         * Modules/indexeddb/IDBRequest.cpp:
1119         * Modules/indexeddb/IDBRequest.h:
1120         * Modules/indexeddb/client/TransactionOperation.cpp:
1121         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1122         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1123         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1124         * Modules/mediacontrols/MediaControlsHost.cpp:
1125         * Modules/mediasource/SourceBuffer.cpp:
1126         * Modules/mediastream/RTCDataChannel.cpp:
1127         * Modules/plugins/QuickTimePluginReplacement.mm:
1128         * Modules/webaudio/AsyncAudioDecoder.cpp:
1129         * Modules/webaudio/AudioBuffer.cpp:
1130         * Modules/webaudio/AudioBuffer.h:
1131         * Modules/webaudio/AudioContext.cpp:
1132         * Modules/webaudio/AudioContext.h:
1133         * Modules/webaudio/AudioParam.h:
1134         * Modules/webaudio/AudioParamTimeline.h:
1135         * Modules/webaudio/PeriodicWave.h:
1136         * Modules/webaudio/RealtimeAnalyser.cpp:
1137         * Modules/webaudio/RealtimeAnalyser.h:
1138         * Modules/webaudio/ScriptProcessorNode.cpp:
1139         * Modules/webaudio/WaveShaperProcessor.h:
1140         * Modules/webauthn/AuthenticatorResponse.h:
1141         * Modules/webauthn/PublicKeyCredential.h:
1142         * Modules/websockets/WebSocket.cpp:
1143         * Modules/websockets/WebSocketChannel.cpp:
1144         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
1145         * Modules/webvr/VREyeParameters.h:
1146         * Modules/webvr/VRFrameData.h:
1147         * Modules/webvr/VRPose.h:
1148         * Modules/webvr/VRStageParameters.h:
1149         * PlatformWin.cmake:
1150         * bindings/IDLTypes.h:
1151         * bindings/js/BufferSource.h:
1152         * bindings/js/CachedScriptFetcher.h:
1153         * bindings/js/CachedScriptSourceProvider.h:
1154         * bindings/js/CallTracerTypes.h:
1155         * bindings/js/CommonVM.cpp:
1156         * bindings/js/DOMGCOutputConstraint.cpp:
1157         * bindings/js/DOMGCOutputConstraint.h:
1158         * bindings/js/GCController.cpp:
1159         * bindings/js/GCController.h:
1160         * bindings/js/IDBBindingUtilities.cpp:
1161         * bindings/js/JSCallbackData.cpp:
1162         * bindings/js/JSCallbackData.h:
1163         * bindings/js/JSCustomElementInterface.cpp:
1164         * bindings/js/JSCustomElementInterface.h:
1165         * bindings/js/JSCustomEventCustom.cpp:
1166         * bindings/js/JSCustomXPathNSResolver.cpp:
1167         * bindings/js/JSCustomXPathNSResolver.h:
1168         * bindings/js/JSDOMBinding.h:
1169         * bindings/js/JSDOMBuiltinConstructorBase.cpp:
1170         * bindings/js/JSDOMConstructorBase.cpp:
1171         * bindings/js/JSDOMConvertBase.h:
1172         * bindings/js/JSDOMConvertBufferSource.h:
1173         * bindings/js/JSDOMConvertDate.cpp:
1174         * bindings/js/JSDOMConvertInterface.h:
1175         * bindings/js/JSDOMConvertJSON.h:
1176         * bindings/js/JSDOMConvertNumbers.cpp:
1177         * bindings/js/JSDOMConvertNumbers.h:
1178         * bindings/js/JSDOMConvertObject.h:
1179         * bindings/js/JSDOMConvertRecord.h:
1180         * bindings/js/JSDOMConvertSequences.h:
1181         * bindings/js/JSDOMConvertStrings.cpp:
1182         * bindings/js/JSDOMConvertUnion.h:
1183         * bindings/js/JSDOMExceptionHandling.cpp:
1184         * bindings/js/JSDOMExceptionHandling.h:
1185         * bindings/js/JSDOMGlobalObject.cpp:
1186         * bindings/js/JSDOMGlobalObject.h:
1187         * bindings/js/JSDOMGlobalObjectTask.cpp:
1188         * bindings/js/JSDOMGuardedObject.h:
1189         * bindings/js/JSDOMIterator.cpp:
1190         * bindings/js/JSDOMIterator.h:
1191         * bindings/js/JSDOMMapLike.cpp:
1192         * bindings/js/JSDOMMapLike.h:
1193         * bindings/js/JSDOMPromise.cpp:
1194         * bindings/js/JSDOMPromise.h:
1195         * bindings/js/JSDOMPromiseDeferred.cpp:
1196         * bindings/js/JSDOMPromiseDeferred.h:
1197         * bindings/js/JSDOMWindowBase.cpp:
1198         * bindings/js/JSDOMWindowCustom.cpp:
1199         * bindings/js/JSDOMWindowProxy.cpp:
1200         * bindings/js/JSDOMWindowProxy.h:
1201         * bindings/js/JSDOMWrapper.cpp:
1202         * bindings/js/JSDOMWrapper.h:
1203         * bindings/js/JSDOMWrapperCache.cpp:
1204         * bindings/js/JSDOMWrapperCache.h:
1205         * bindings/js/JSDynamicDowncast.h:
1206         * bindings/js/JSErrorHandler.cpp:
1207         * bindings/js/JSEventCustom.cpp:
1208         * bindings/js/JSEventListener.cpp:
1209         * bindings/js/JSEventListener.h:
1210         * bindings/js/JSHTMLElementCustom.cpp:
1211         * bindings/js/JSHistoryCustom.cpp:
1212         * bindings/js/JSIDBCursorWithValueCustom.cpp:
1213         * bindings/js/JSIDBIndexCustom.cpp:
1214         * bindings/js/JSImageDataCustom.cpp:
1215         * bindings/js/JSLazyEventListener.cpp:
1216         * bindings/js/JSLocationCustom.cpp:
1217         * bindings/js/JSMainThreadExecState.h:
1218         * bindings/js/JSMainThreadExecStateInstrumentation.h:
1219         * bindings/js/JSMessageChannelCustom.cpp:
1220         * bindings/js/JSMessageEventCustom.cpp:
1221         * bindings/js/JSNodeIteratorCustom.cpp:
1222         * bindings/js/JSPopStateEventCustom.cpp:
1223         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
1224         * bindings/js/JSTreeWalkerCustom.cpp:
1225         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
1226         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1227         * bindings/js/ReadableStreamDefaultController.cpp:
1228         * bindings/js/ReadableStreamDefaultController.h:
1229         * bindings/js/ScheduledAction.cpp:
1230         * bindings/js/ScheduledAction.h:
1231         * bindings/js/ScriptCachedFrameData.cpp:
1232         * bindings/js/ScriptCachedFrameData.h:
1233         * bindings/js/ScriptController.cpp:
1234         * bindings/js/ScriptController.h:
1235         * bindings/js/ScriptControllerMac.mm:
1236         * bindings/js/ScriptModuleLoader.cpp:
1237         * bindings/js/ScriptModuleLoader.h:
1238         * bindings/js/ScriptSourceCode.h:
1239         * bindings/js/ScriptState.cpp:
1240         * bindings/js/ScriptWrappable.h:
1241         * bindings/js/ScriptWrappableInlines.h:
1242         * bindings/js/SerializedScriptValue.cpp:
1243         * bindings/js/SerializedScriptValue.h:
1244         * bindings/js/StructuredClone.cpp:
1245         * bindings/js/WebCoreBuiltinNames.h:
1246         * bindings/js/WebCoreJSClientData.cpp:
1247         * bindings/js/WebCoreTypedArrayController.cpp:
1248         * bindings/js/WebCoreTypedArrayController.h:
1249         * bindings/js/WorkerScriptController.cpp:
1250         * bindings/js/WorkerScriptController.h:
1251         * bridge/NP_jsobject.cpp:
1252         * bridge/c/CRuntimeObject.cpp:
1253         * bridge/c/c_class.cpp:
1254         * bridge/c/c_instance.cpp:
1255         * bridge/c/c_runtime.cpp:
1256         * bridge/c/c_utility.cpp:
1257         * bridge/c/c_utility.h:
1258         * bridge/jsc/BridgeJSC.cpp:
1259         * bridge/jsc/BridgeJSC.h:
1260         * bridge/npruntime.cpp:
1261         * bridge/objc/ObjCRuntimeObject.mm:
1262         * bridge/objc/WebScriptObject.mm:
1263         * bridge/objc/WebScriptObjectPrivate.h:
1264         * bridge/objc/objc_instance.mm:
1265         * bridge/objc/objc_runtime.h:
1266         * bridge/objc/objc_runtime.mm:
1267         * bridge/objc/objc_utility.h:
1268         * bridge/objc/objc_utility.mm:
1269         * bridge/runtime_array.cpp:
1270         * bridge/runtime_array.h:
1271         * bridge/runtime_method.cpp:
1272         * bridge/runtime_method.h:
1273         * bridge/runtime_object.cpp:
1274         * bridge/runtime_object.h:
1275         * bridge/runtime_root.cpp:
1276         * bridge/runtime_root.h:
1277         * crypto/SubtleCrypto.cpp:
1278         * crypto/SubtleCrypto.h:
1279         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
1280         * crypto/keys/CryptoRsaKeyAlgorithm.h:
1281         * crypto/mac/CryptoKeyRSAMac.cpp:
1282         * crypto/parameters/CryptoAlgorithmEcdsaParams.h:
1283         * crypto/parameters/CryptoAlgorithmHkdfParams.h:
1284         * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
1285         * crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
1286         * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
1287         * crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h:
1288         * crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h:
1289         * css/CSSFontFaceSource.h:
1290         * css/DOMMatrixReadOnly.cpp:
1291         * css/DOMMatrixReadOnly.h:
1292         * css/FontFace.cpp:
1293         * dom/CustomElementReactionQueue.cpp:
1294         * dom/CustomElementRegistry.cpp:
1295         * dom/CustomEvent.cpp:
1296         * dom/CustomEvent.h:
1297         * dom/Document.cpp:
1298         * dom/Document.h:
1299         * dom/ErrorEvent.cpp:
1300         * dom/ErrorEvent.h:
1301         * dom/LoadableScript.h:
1302         * dom/MessageEvent.cpp:
1303         * dom/MessageEvent.h:
1304         * dom/ModuleFetchParameters.h:
1305         * dom/PopStateEvent.cpp:
1306         * dom/PopStateEvent.h:
1307         * dom/PromiseRejectionEvent.cpp:
1308         * dom/PromiseRejectionEvent.h:
1309         * dom/RejectedPromiseTracker.cpp:
1310         * dom/RejectedPromiseTracker.h:
1311         * dom/ScriptExecutionContext.cpp:
1312         * dom/ScriptExecutionContext.h:
1313         * dom/TextEncoder.cpp:
1314         * dom/TextEncoder.h:
1315         * domjit/DOMJITHelpers.h:
1316         * domjit/DOMJITIDLTypeFilter.h:
1317         * domjit/JSDocumentDOMJIT.cpp:
1318         * domjit/JSNodeDOMJIT.cpp:
1319         * fileapi/BlobBuilder.cpp:
1320         * fileapi/FileReader.cpp:
1321         * fileapi/FileReaderLoader.cpp:
1322         * fileapi/FileReaderSync.cpp:
1323         * html/BaseTextInputType.cpp:
1324         * html/EmailInputType.cpp:
1325         * html/HTMLAllCollection.cpp:
1326         * html/HTMLCanvasElement.cpp:
1327         * html/HTMLImageLoader.cpp:
1328         * html/HTMLMediaElement.cpp:
1329         * html/HTMLPlugInImageElement.cpp:
1330         * html/ImageData.cpp:
1331         * html/ImageData.h:
1332         * html/MediaEncryptedEventInit.h:
1333         * html/WebKitMediaKeyError.h:
1334         * html/canvas/WebGLAny.h:
1335         * html/canvas/WebGLRenderingContext.cpp:
1336         * html/canvas/WebGLRenderingContextBase.cpp:
1337         * html/canvas/WebGLRenderingContextBase.h:
1338         * html/canvas/WebGPUBuffer.cpp:
1339         * html/canvas/WebGPURenderingContext.cpp:
1340         * html/canvas/WebGPURenderingContext.h:
1341         * html/track/DataCue.cpp:
1342         * html/track/DataCue.h:
1343         * inspector/CommandLineAPIHost.cpp:
1344         * inspector/CommandLineAPIHost.h:
1345         * inspector/CommandLineAPIModule.cpp:
1346         * inspector/CommandLineAPIModule.h:
1347         * inspector/InspectorCanvas.cpp:
1348         * inspector/InspectorCanvas.h:
1349         * inspector/InspectorClient.cpp:
1350         * inspector/InspectorController.cpp:
1351         * inspector/InspectorController.h:
1352         * inspector/InspectorDatabaseResource.h:
1353         * inspector/InspectorFrontendClientLocal.cpp:
1354         * inspector/InspectorFrontendHost.cpp:
1355         * inspector/InspectorInstrumentation.cpp:
1356         * inspector/InspectorInstrumentation.h:
1357         * inspector/InspectorOverlay.cpp:
1358         * inspector/InspectorOverlay.h:
1359         * inspector/InspectorShaderProgram.cpp:
1360         * inspector/InspectorShaderProgram.h:
1361         * inspector/InspectorStyleSheet.cpp:
1362         * inspector/InspectorStyleSheet.h:
1363         * inspector/InspectorWebAgentBase.h:
1364         * inspector/InstrumentingAgents.h:
1365         * inspector/PageScriptDebugServer.cpp:
1366         * inspector/PageScriptDebugServer.h:
1367         * inspector/TimelineRecordFactory.cpp:
1368         * inspector/WebInjectedScriptHost.h:
1369         * inspector/WebInjectedScriptManager.h:
1370         * inspector/WorkerInspectorController.cpp:
1371         * inspector/WorkerInspectorController.h:
1372         * inspector/WorkerScriptDebugServer.cpp:
1373         * inspector/WorkerScriptDebugServer.h:
1374         * inspector/WorkerToPageFrontendChannel.h:
1375         * inspector/agents/InspectorApplicationCacheAgent.h:
1376         * inspector/agents/InspectorCSSAgent.cpp:
1377         * inspector/agents/InspectorCSSAgent.h:
1378         * inspector/agents/InspectorCanvasAgent.cpp:
1379         * inspector/agents/InspectorCanvasAgent.h:
1380         * inspector/agents/InspectorDOMAgent.cpp:
1381         * inspector/agents/InspectorDOMAgent.h:
1382         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
1383         * inspector/agents/InspectorDOMDebuggerAgent.h:
1384         * inspector/agents/InspectorDOMStorageAgent.cpp:
1385         * inspector/agents/InspectorDOMStorageAgent.h:
1386         * inspector/agents/InspectorDatabaseAgent.cpp:
1387         * inspector/agents/InspectorDatabaseAgent.h:
1388         * inspector/agents/InspectorIndexedDBAgent.cpp:
1389         * inspector/agents/InspectorIndexedDBAgent.h:
1390         * inspector/agents/InspectorLayerTreeAgent.cpp:
1391         * inspector/agents/InspectorLayerTreeAgent.h:
1392         * inspector/agents/InspectorMemoryAgent.cpp:
1393         * inspector/agents/InspectorMemoryAgent.h:
1394         * inspector/agents/InspectorNetworkAgent.cpp:
1395         * inspector/agents/InspectorNetworkAgent.h:
1396         * inspector/agents/InspectorPageAgent.cpp:
1397         * inspector/agents/InspectorPageAgent.h:
1398         * inspector/agents/InspectorTimelineAgent.cpp:
1399         * inspector/agents/InspectorTimelineAgent.h:
1400         * inspector/agents/InspectorWorkerAgent.h:
1401         * inspector/agents/WebConsoleAgent.cpp:
1402         * inspector/agents/WebConsoleAgent.h:
1403         * inspector/agents/WebDebuggerAgent.h:
1404         * inspector/agents/WebHeapAgent.h:
1405         * inspector/agents/page/PageDebuggerAgent.cpp:
1406         * inspector/agents/page/PageRuntimeAgent.cpp:
1407         * inspector/agents/page/PageRuntimeAgent.h:
1408         * inspector/agents/worker/ServiceWorkerAgent.h:
1409         * inspector/agents/worker/WorkerDebuggerAgent.cpp:
1410         * inspector/agents/worker/WorkerRuntimeAgent.cpp:
1411         * inspector/agents/worker/WorkerRuntimeAgent.h:
1412         * loader/EmptyClients.cpp:
1413         * page/CaptionUserPreferences.cpp:
1414         * page/Chrome.cpp:
1415         * page/ChromeClient.h:
1416         * page/Crypto.cpp:
1417         * page/DOMWindow.cpp:
1418         * page/DOMWindow.h:
1419         * page/Frame.cpp:
1420         * page/OriginThreadLocalCache.h:
1421         * page/PageConsoleClient.cpp:
1422         * page/PageConsoleClient.h:
1423         * page/PageDebuggable.cpp:
1424         * page/PageGroup.cpp:
1425         * page/SettingsBase.h:
1426         * page/UserContentController.cpp:
1427         * page/cocoa/ResourceUsageThreadCocoa.mm:
1428         * page/csp/ContentSecurityPolicy.cpp:
1429         * page/ios/FrameIOS.mm:
1430         * page/linux/ResourceUsageOverlayLinux.cpp:
1431         * page/linux/ResourceUsageThreadLinux.cpp:
1432         * platform/MediaSample.h:
1433         * platform/SerializedPlatformRepresentation.h:
1434         * platform/SharedBuffer.h:
1435         * platform/audio/mac/CARingBuffer.h:
1436         * platform/cocoa/SharedBufferCocoa.mm:
1437         * platform/graphics/ImageBuffer.h:
1438         * platform/graphics/LegacyCDMSession.h:
1439         * platform/graphics/MediaPlayer.h:
1440         * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
1441         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
1442         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
1443         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1444         * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
1445         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1446         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
1447         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
1448         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1449         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1450         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
1451         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1452         * platform/graphics/cairo/ImageBufferCairo.cpp:
1453         * platform/graphics/cg/ImageBufferDataCG.cpp:
1454         * platform/graphics/cg/ImageBufferDataCG.h:
1455         * platform/graphics/cocoa/GPUDeviceMetal.mm:
1456         * platform/graphics/filters/FEBlend.cpp:
1457         * platform/graphics/filters/FEColorMatrix.cpp:
1458         * platform/graphics/filters/FEComponentTransfer.cpp:
1459         * platform/graphics/filters/FEComposite.cpp:
1460         * platform/graphics/filters/FEConvolveMatrix.cpp:
1461         * platform/graphics/filters/FEDisplacementMap.cpp:
1462         * platform/graphics/filters/FEDropShadow.cpp:
1463         * platform/graphics/filters/FEGaussianBlur.cpp:
1464         * platform/graphics/filters/FELighting.h:
1465         * platform/graphics/filters/FEMorphology.cpp:
1466         * platform/graphics/filters/FETurbulence.cpp:
1467         * platform/graphics/filters/FilterEffect.cpp:
1468         * platform/graphics/filters/FilterEffect.h:
1469         * platform/graphics/gpu/GPUBuffer.h:
1470         * platform/graphics/gpu/GPUDevice.h:
1471         * platform/graphics/iso/ISOBox.cpp:
1472         * platform/graphics/iso/ISOOriginalFormatBox.cpp:
1473         * platform/graphics/iso/ISOProtectionSchemeInfoBox.cpp:
1474         * platform/graphics/iso/ISOSchemeInformationBox.cpp:
1475         * platform/graphics/iso/ISOSchemeTypeBox.cpp:
1476         * platform/graphics/iso/ISOTrackEncryptionBox.cpp:
1477         * platform/graphics/iso/ISOVTTCue.cpp:
1478         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1479         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
1480         * platform/graphics/win/ImageBufferDataDirect2D.h:
1481         * platform/ios/wak/WebCoreThread.mm:
1482         * platform/mac/SerializedPlatformRepresentationMac.mm:
1483         * platform/mac/StringUtilities.mm:
1484         * platform/mock/mediasource/MockBox.cpp:
1485         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
1486         * svg/graphics/SVGImage.cpp:
1487         * testing/GCObservation.cpp:
1488         * testing/GCObservation.h:
1489         * testing/Internals.cpp:
1490         * testing/Internals.h:
1491         * testing/LegacyMockCDM.cpp:
1492         * testing/MockCDMFactory.cpp:
1493         * testing/js/WebCoreTestSupport.cpp:
1494         * workers/Worker.cpp:
1495         * workers/Worker.h:
1496         * workers/WorkerConsoleClient.cpp:
1497         * workers/WorkerConsoleClient.h:
1498         * workers/WorkerGlobalScope.cpp:
1499         * workers/WorkerGlobalScope.h:
1500         * workers/WorkerGlobalScopeProxy.h:
1501         * workers/WorkerInspectorProxy.cpp:
1502         * workers/WorkerMessagingProxy.cpp:
1503         * workers/WorkerThread.h:
1504         * workers/service/ExtendableEvent.cpp:
1505         * workers/service/ServiceWorker.cpp:
1506         * workers/service/ServiceWorker.h:
1507         * workers/service/ServiceWorkerClient.h:
1508         * workers/service/context/ServiceWorkerInspectorProxy.cpp:
1509         * workers/service/context/ServiceWorkerThread.cpp:
1510         * xml/XMLHttpRequest.cpp:
1511
1512 2018-02-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
1513
1514         Rendering SVG images with same size as WebGL texture doesn't work correctly
1515         https://bugs.webkit.org/show_bug.cgi?id=182367
1516
1517         Reviewed by Dean Jackson.
1518
1519         If am image buffer is created for a webgl texture and then it is reused 
1520         for another texture, it has to be cleared before drawing.
1521
1522         Test: webgl/webgl-texture-image-buffer-reuse.html
1523
1524         * html/canvas/WebGLRenderingContextBase.cpp:
1525         (WebCore::WebGLRenderingContextBase::LRUImageBufferCache::imageBuffer):
1526
1527 2018-02-06  Youenn Fablet  <youenn@apple.com>
1528
1529         Use downcast in createLinkPreloadResourceClient
1530         https://bugs.webkit.org/show_bug.cgi?id=182488
1531
1532         Reviewed by Antti Koivisto.
1533
1534         No observable change of behavior.
1535         Add a new link preloader client for text track.
1536
1537         * loader/LinkLoader.cpp:
1538         (WebCore::createLinkPreloadResourceClient):
1539         * loader/LinkPreloadResourceClients.h:
1540
1541 2018-02-06  Youenn Fablet  <youenn@apple.com>
1542
1543         imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-respond-with-response-body-with-invalid-chunk.https.html is flaky
1544         https://bugs.webkit.org/show_bug.cgi?id=182541
1545
1546         Reviewed by Chris Dumez.
1547
1548         Covered by test being no longer flaky.
1549         In case of loading error when getting the response body, we were only reporting
1550         the error if there was a callback set or a ReadableStream already created.
1551         Otherwise, we were just stopping loading and if creating a ReadableStream, we were just returning an empty body.
1552
1553         FetchBodyOwner now stores a loading error.
1554         In case a readable stream is created, it will error it if there is a loading error.
1555         If there is not and the loading failed later on, the stream will be errored using the current code path.
1556
1557         * Modules/cache/DOMCache.cpp:
1558         (WebCore::DOMCache::put):
1559         * Modules/fetch/FetchResponse.cpp:
1560         (WebCore::FetchResponse::clone):
1561         (WebCore::FetchResponse::BodyLoader::didFail):
1562         * Modules/fetch/FetchResponse.h:
1563         * workers/service/context/ServiceWorkerFetch.cpp:
1564         (WebCore::ServiceWorkerFetch::processResponse):
1565
1566 2018-02-06  Andy Estes  <aestes@apple.com>
1567
1568         [Payment Request] show() should take an optional PaymentDetailsUpdate promise
1569         https://bugs.webkit.org/show_bug.cgi?id=182538
1570         <rdar://problem/36754552>
1571
1572         Reviewed by Tim Horton.
1573
1574         Taught show() to take an optional promise for a PaymentDetailsUpdate.
1575
1576         Added test cases to http/tests/paymentrequest/payment-request-show-method.https.html.
1577
1578         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1579         (WebCore::ApplePayPaymentHandler::detailsUpdated):
1580
1581         Changed to take a PaymentRequest::UpdateReason instead of a eventType string.
1582
1583         (WebCore::ApplePayPaymentHandler::shippingAddressUpdated):
1584         (WebCore::ApplePayPaymentHandler::shippingOptionUpdated):
1585         (WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
1586         (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
1587         (WebCore::ApplePayPaymentHandler::didSelectShippingMethod):
1588         (WebCore::ApplePayPaymentHandler::didSelectShippingContact):
1589         (WebCore::ApplePayPaymentHandler::didSelectPaymentMethod):
1590
1591         Asserted that only one of the PaymentSession delegates is executing at a time.
1592
1593         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
1594         * Modules/paymentrequest/PaymentHandler.h:
1595
1596         Changed detailsUpdated to take a PaymentRequest::UpdateReason instead of a eventType string.
1597
1598         * Modules/paymentrequest/PaymentRequest.cpp:
1599         (WebCore::PaymentRequest::show):
1600
1601         If there is a details promise, call updateWith() with UpdateReason::ShowDetailsResolved.
1602
1603         (WebCore::PaymentRequest::shippingAddressChanged):
1604         (WebCore::PaymentRequest::shippingOptionChanged):
1605         (WebCore::PaymentRequest::paymentMethodChanged):
1606
1607         Used whenDetailsSettled() to ensure that update events do not start before the show()
1608         details promise settles.
1609
1610         (WebCore::PaymentRequest::updateWith):
1611         (WebCore::PaymentRequest::settleDetailsPromise):
1612
1613         Changed to use a PaymentRequest::UpdateReason instead of a eventType string.
1614
1615         (WebCore::PaymentRequest::whenDetailsSettled):
1616
1617         If there is a details promise, wait for it to settle before executing the callback.
1618
1619         * Modules/paymentrequest/PaymentRequest.h:
1620
1621         Defined enum class UpdateReason.
1622
1623         * Modules/paymentrequest/PaymentRequest.idl:
1624
1625         Updated show() to take an optional Promise<PaymentDetailsUpdate>.
1626
1627         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
1628         (WebCore::PaymentRequestUpdateEvent::updateWith):
1629
1630         Map the event type to a PaymentRequest::UpdateReason.
1631
1632 2018-02-06  Dean Jackson  <dino@apple.com>
1633
1634         REGRESSION: WebGL no longer producing a transparent canvas on iOS
1635         https://bugs.webkit.org/show_bug.cgi?id=182550
1636         <rdar://problem/37234491>
1637
1638         Reviewed by Eric Carlson.
1639
1640         Due to some weirdness GL_RGBA8 is sometimes different between iOS and
1641         other platforms. Only tell the WebGLLayer that it is opaque when it really
1642         is not transparent.
1643
1644         Covered by existing test: fast/canvas/webgl/context-attributes-alpha
1645
1646         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
1647         (WebCore::GraphicsContext3D::setRenderbufferStorageFromDrawable): Look at the context
1648         attributes to decide if we should use an opaque layer.
1649         * platform/graphics/cocoa/WebGLLayer.mm: Ditto.
1650         (-[WebGLLayer initWithGraphicsContext3D:]):
1651
1652 2018-02-06  Andy Estes  <aestes@apple.com>
1653
1654         [WebIDL] Support optional Promise arguments
1655         https://bugs.webkit.org/show_bug.cgi?id=182399
1656         <rdar://problem/36754552>
1657
1658         Reviewed by Sam Weinig and Chris Dumez.
1659
1660         Previously, declaring a Promise argument as optional would result in a native type of
1661         std::optional<RefPtr<DOMPromise>>. This is wasteful, since RefPtr can represent an optional
1662         argument by storing nullptr. Further, PassArgumentExpression() assumed Promises were never
1663         optional and tried to pass the argument as a Ref by calling RefPtr::releaseNonNull().
1664
1665         This patch removes the std::optional wrapper around optional Promises and simply passes the
1666         promise as a RefPtr to native code.
1667
1668         * bindings/scripts/CodeGeneratorJS.pm:
1669         (PassArgumentExpression):
1670         (GenerateParametersCheck):
1671         * bindings/scripts/test/JS/JSTestObj.cpp:
1672         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalPromiseBody):
1673         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalPromise):
1674         * bindings/scripts/test/TestObj.idl:
1675
1676 2018-02-06  Youenn Fablet  <youenn@apple.com>
1677
1678         HasServiceWorkerRegistration bit should be sent when creating a new page
1679         https://bugs.webkit.org/show_bug.cgi?id=182410
1680
1681         Reviewed by Chris Dumez.
1682
1683         Covered by new API test.
1684
1685         Changed the default value of service workers being registered to false.
1686         Every page created in the process will be responsible to change the value to true,
1687         at which time the value will be kept to true for the lifetime of the process.
1688
1689         * workers/service/ServiceWorkerProvider.h:
1690
1691 2018-02-06  Ross Kirsling  <ross.kirsling@sony.com>
1692
1693         Add missing #if ENABLE(VIDEO) after r228092.
1694         https://bugs.webkit.org/show_bug.cgi?id=182539
1695
1696         Reviewed by Michael Catanzaro.
1697
1698         * html/ImageBitmap.cpp:
1699
1700 2018-02-06  Antoine Quint  <graouts@apple.com>
1701
1702         [Modern Media Controls] Test at media/modern-media-controls/tracks-panel/tracks-panel-controls-bar-remains-visible-after-clicking-over-it.html fails
1703         https://bugs.webkit.org/show_bug.cgi?id=182425
1704
1705         Reviewed by Dean Jackson.
1706
1707         This test failed because the controls bar would not hit test at the moment we synthesized a mousemove over the controls bar as the first step towards
1708         synthesizing a click on the controls bar to dismiss the tracks panel. Indeed, it would have "pointer-events" set to "none" until the tracks panel was
1709         dismissed, which would only happen after the click event had been propagated. All we need to do is to ensure that none of the controls within the controls
1710         bar get activated as a result of clicking over them when the tracks panel is visible, so we instead set "pointer-events" to "none" on all children of a
1711         controls bar rather than the controls bar itself, which can thus still hit test.
1712
1713         * Modules/modern-media-controls/controls/media-controls.css:
1714         (.media-controls.shows-tracks-panel > .controls-bar > *,):
1715         (.media-controls.shows-tracks-panel > .controls-bar,): Deleted.
1716
1717 2018-02-06  Chris Dumez  <cdumez@apple.com>
1718
1719         Service workers registrations are saved to disk before the install / activation succeeds
1720         https://bugs.webkit.org/show_bug.cgi?id=182535
1721         <rdar://problem/36591485>
1722
1723         Reviewed by Youenn Fablet.
1724
1725         Service workers registrations are saved to disk before the install / activation succeeds.
1726         This means if the browser exits before the install / activation succeeds, we may restore
1727         from disk a registration with an “active” worker which may have never been installed /
1728         activated.
1729
1730         To address the issue, we now delay saving the registration to disk until after the service
1731         worker has been activated.
1732
1733         No new tests, restoration from disk is covered by API tests that still pass.
1734
1735         * workers/service/server/SWServer.cpp:
1736         (WebCore::SWServer::didFinishActivation):
1737         (WebCore::SWServer::installContextData):
1738
1739 2018-02-06  Ms2ger  <Ms2ger@igalia.com>
1740
1741         Initialize ImageBitmap::m_bitmapData in the constructor.
1742         https://bugs.webkit.org/show_bug.cgi?id=182487
1743
1744         Reviewed by Sam Weinig.
1745
1746         This removes the span of time where an ImageBitmap object would exist
1747         with a null m_bitmapData during its construction.
1748
1749         No new tests: no behavior changes.
1750
1751         * html/ImageBitmap.cpp:
1752         (WebCore::ImageBitmap::create): update signature
1753         (WebCore::ImageBitmap::createPromise): update callers
1754         (WebCore::ImageBitmap::ImageBitmap): update signature
1755         * html/ImageBitmap.h: update signatures
1756
1757 2018-02-05  Ryosuke Niwa  <rniwa@webkit.org>
1758
1759         Release assertion in inlineVideoFrame
1760         https://bugs.webkit.org/show_bug.cgi?id=182513
1761         <rdar://problem/37159363>
1762
1763         Reviewed by Zalan Bujtas.
1764
1765         The bug was caused by the fact it's not always safe to invoke updateLayout even when isSafeToUpdateStyleOrLayout
1766         on a document of a flattened frame on iOS. isSafeToUpdateStyleOrLayout returns true when the frame view is in
1767         the frame-flattening mode to avoid hitting a release asssertion in updateLayout of the frame. However, it's still
1768         not safe to invoke updateLayout on a parent frame in this case.
1769
1770         As a result, inlineVideoFrame (in Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm) invokes updateLayout
1771         even when the top-level document is not safe to update when the video element is in a frame-flattened document.
1772
1773         Fixed this bug by explicitly checking that we still have a live render tree and document hasn't been stopped.
1774         Also replaced other uses of isSafeToUpdateStyleOrLayout by more explicit checks.
1775
1776         * accessibility/AccessibilityObject.cpp:
1777         (WebCore::AccessibilityObject::updateBackingStore): Made the early exit condition added in r227006 more explicit.
1778         Namely, InspectorDOMAgent::pseudoElementCreated is invoked during style recalc.
1779         * dom/Document.cpp:
1780         (WebCore::isSafeToUpdateStyleOrLayout): Made this local to the file.
1781         (WebCore::Document::updateStyleIfNeeded):
1782         (WebCore::Document::updateLayout):
1783         * dom/Document.h:
1784         * html/MediaElementSession.cpp:
1785         (WebCore::isMainContentForPurposesOfAutoplay): Made the early exit condition added in r227529 more explicit. Don't
1786         update the layout when the render tree had been destroyed or the active DOM objects had been stopped.
1787
1788 2018-02-05  Youenn Fablet  <youenn@apple.com>
1789
1790         Crash in imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origin.sub.html
1791         https://bugs.webkit.org/show_bug.cgi?id=182422
1792         <rdar://problem/37182665>
1793
1794         Reviewed by Alex Christensen.
1795
1796         Covered by test no longer crashing in Debug mode.
1797         Make sure completionHandler is called on the main thread.
1798
1799         * platform/network/cocoa/WebCoreNSURLSession.mm:
1800         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:completionHandler:]):
1801
1802 2018-02-05  Filip Pizlo  <fpizlo@apple.com>
1803
1804         Global objects should be able to use TLCs to allocate from different blocks from each other
1805         https://bugs.webkit.org/show_bug.cgi?id=182227
1806
1807         Reviewed by Daniel Bates and Chris Dumez.
1808
1809         No new tests because no change in behavior.
1810         
1811         Adopt JSC TLC API to put distance between objects from different security origins. WebCore has
1812         a subclass of ThreadLocalCache that supports hash-consing based on the relevant origin data
1813         using the existing SecurityOriginHash. It's Document's job to initiate this, but all of the
1814         logic is in WebCore::OriginThreadLocalCache.
1815         
1816         Workers don't opt into this. They just get the VM's default TLC all the time.
1817
1818         * ForwardingHeaders/heap/ThreadLocalCache.h: Added.
1819         * Sources.txt:
1820         * WebCore.xcodeproj/project.pbxproj:
1821         * bindings/js/JSDOMGlobalObject.cpp:
1822         (WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
1823         * bindings/js/JSDOMGlobalObject.h:
1824         * bindings/js/JSDOMWindowBase.cpp:
1825         (WebCore::JSDOMWindowBase::JSDOMWindowBase):
1826         * dom/Document.cpp:
1827         (WebCore::Document::initSecurityContext):
1828         (WebCore::Document::threadLocalCache):
1829         * dom/Document.h:
1830         * page/OriginThreadLocalCache.cpp: Added.
1831         (WebCore::threadLocalCacheMap):
1832         (WebCore::OriginThreadLocalCache::create):
1833         (WebCore::OriginThreadLocalCache::~OriginThreadLocalCache):
1834         (WebCore::OriginThreadLocalCache::OriginThreadLocalCache):
1835         * page/OriginThreadLocalCache.h: Added.
1836         * page/SecurityOrigin.cpp:
1837         (WebCore::SecurityOrigin::passesFileCheck const):
1838         (WebCore::SecurityOrigin::setEnforcesFilePathSeparation):
1839         (WebCore::SecurityOrigin::toString const):
1840         (WebCore::SecurityOrigin::enforceFilePathSeparation): Deleted.
1841         * page/SecurityOrigin.h:
1842         (WebCore::SecurityOrigin::enforcesFilePathSeparation const):
1843
1844 2018-02-05  Per Arne Vollan  <pvollan@apple.com>
1845
1846         [Win] Release assert failed under NetworkStateNotifier::singleton.
1847         https://bugs.webkit.org/show_bug.cgi?id=182516
1848
1849         Reviewed by Brent Fulgham.
1850
1851         The callback NetworkStateNotifier::addressChangeCallback will always be called on a
1852         worker thread on Windows. Since the method NetworkStateNotifier::singleton() is
1853         called by NetworkStateNotifier::addressChangeCallback, but has to be called on the
1854         on the main thread, the call has to be moved there.
1855
1856         No new tests. I have not been able to reproduce the crash.
1857
1858         * platform/network/win/NetworkStateNotifierWin.cpp:
1859         (WebCore::NetworkStateNotifier::addressChangeCallback):
1860
1861 2018-02-05  Don Olmstead  <don.olmstead@sony.com>
1862
1863         Abstract heap generator should include JavaScriptCore headers directly
1864         https://bugs.webkit.org/show_bug.cgi?id=182501
1865
1866         Reviewed by Alex Christensen.
1867
1868         No new tests. No change in behavior.
1869
1870         * domjit/generate-abstract-heap.rb:
1871
1872 2018-02-05  Wenson Hsieh  <wenson_hsieh@apple.com>
1873
1874         [Extra zoom mode] Implement number pad UI when editing `tel` and `number` inputs
1875         https://bugs.webkit.org/show_bug.cgi?id=182472
1876         <rdar://problem/35143057>
1877
1878         Reviewed by Tim Horton.
1879
1880         Adds a localized string for the "Done" button text in extra zoomed form controls.
1881
1882         * English.lproj/Localizable.strings:
1883         * platform/LocalizedStrings.cpp:
1884         (WebCore::formControlDoneButtonTitle):
1885         * platform/LocalizedStrings.h:
1886
1887 2018-02-05  John Wilander  <wilander@apple.com>
1888
1889         Build fix for r228115, simple naming issue succeeded —> success.
1890         https://bugs.webkit.org/show_bug.cgi?id=182507
1891         <rdar://problem/37248566>
1892
1893         Reviewed by Eric Carlson.
1894
1895         No new tests. Build fix.
1896
1897         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1898         (VideoFullscreenInterfaceAVKit::enterFullscreenHandler):
1899             succeeded —> success
1900
1901 2018-02-05  Matt Lewis  <jlewis3@apple.com>
1902
1903         Unreviewed, rolling out r228086.
1904
1905         This introduced a failure with API test
1906         URLTest.HostIsIPAddress.
1907
1908         Reverted changeset:
1909
1910         "Add a way to check if a host is an IP address"
1911         https://bugs.webkit.org/show_bug.cgi?id=182427
1912         https://trac.webkit.org/changeset/228086
1913
1914 2018-02-05  Matt Lewis  <jlewis3@apple.com>
1915
1916         Unreviewed, rolling out r228103.
1917
1918         This caused multiple tests to crash.
1919
1920         Reverted changeset:
1921
1922         "Use downcast in createLinkPreloadResourceClient"
1923         https://bugs.webkit.org/show_bug.cgi?id=182488
1924         https://trac.webkit.org/changeset/228103
1925
1926 2018-02-05  Eric Carlson  <eric.carlson@apple.com>
1927
1928         [iOS] VideoFullscreenInterfaceAVKit should not ignore errors
1929         https://bugs.webkit.org/show_bug.cgi?id=182497
1930         <rdar://problem/36986898>
1931
1932         Reviewed by Jer Noble.
1933         
1934         Always call layoutIfNeeded before calling -[AVPlayerViewController enterFullScreenAnimated:completionHandler]
1935         or -[AVPlayerViewController exitFullScreenAnimated:completionHandler] because they both fail
1936         if the view needs layout. Also don't ignore errors returned by those calls.
1937
1938         No new tests, the failure is non deterministic and I was not able to reproduce in a test.
1939
1940         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1941         (VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
1942         (VideoFullscreenInterfaceAVKit::enterFullscreenStandard):
1943         (VideoFullscreenInterfaceAVKit::exitFullscreen):
1944         (VideoFullscreenInterfaceAVKit::cleanupFullscreen):
1945         (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
1946         (VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler):
1947         (VideoFullscreenInterfaceAVKit::doEnterFullscreen):
1948         (VideoFullscreenInterfaceAVKit::exitFullscreenHandler):
1949         (VideoFullscreenInterfaceAVKit::enterFullscreenHandler):
1950
1951 2018-02-05  Daniel Bates  <dabates@apple.com>
1952
1953         REGRESSION (r222795): Nike app "Refused to set unsafe header" when adding and viewing cart
1954         https://bugs.webkit.org/show_bug.cgi?id=182491
1955         <rdar://problem/36533447>
1956
1957         Reviewed by Brent Fulgham.
1958
1959         Exempt Nike from the XHR header restrictions in r222795.
1960
1961         Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
1962         However Nike also depends on such functionality.
1963
1964         * platform/RuntimeApplicationChecks.h:
1965         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
1966         (WebCore::IOSApplication::isNike):
1967
1968 2018-02-02  Brent Fulgham  <bfulgham@apple.com>
1969
1970         Improve NetworkResourceLoader logging so it can be used for 'setCookiesFromDOM'
1971         https://bugs.webkit.org/show_bug.cgi?id=182455
1972         <rdar://problem/36626601>
1973
1974         Reviewed by Chris Dumez.
1975
1976         After this refactoring, a convenience method I added in r227860 is no longer needed.
1977         This patch removes this dead code.
1978
1979         * platform/network/NetworkStorageSession.h: Export 'cookieStoragePartition' so it can
1980         be used in WebKit.
1981         * platform/network/cf/NetworkStorageSessionCFNet.cpp: 
1982         (WebCore::NetworkStorageSession::hasStorageAccessForFrame): Deleted unused method.
1983
1984 2018-02-05  Antti Koivisto  <antti@apple.com>
1985
1986         Make ASSERT_WITH_SECURITY_IMPLICATION in CachedResourceClientWalker::next a release assert
1987         https://bugs.webkit.org/show_bug.cgi?id=182492
1988
1989         Reviewed by Youenn Fablet.
1990
1991         * loader/cache/CachedResourceClientWalker.h:
1992         (WebCore::CachedResourceClientWalker::next):
1993
1994 2018-02-05  John Wilander  <wilander@apple.com>
1995
1996         Storage Access API: Add testRunner.getAllStorageAccessEntries() to make testing easier and more explicit
1997         https://bugs.webkit.org/show_bug.cgi?id=181601
1998         <rdar://problem/36475837>
1999
2000         Reviewed by Alex Christensen.
2001
2002         No new tests. Existing test updated.
2003
2004         http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html
2005         was found to be flaky. With the testRunner.hasStorageAccessEntry() getter
2006         it's possible to check access even if a frame doesn't respond timely to
2007         postMessage after detach and attach.
2008
2009         * platform/network/NetworkStorageSession.h:
2010         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2011         (WebCore::NetworkStorageSession::getAllStorageAccessEntries const):
2012
2013 2018-02-05  Youenn Fablet  <youenn@apple.com>
2014
2015         Use downcast in createLinkPreloadResourceClient
2016         https://bugs.webkit.org/show_bug.cgi?id=182488
2017
2018         Reviewed by Antti Koivisto.
2019
2020         No observable change of behavior.
2021
2022         * loader/LinkLoader.cpp:
2023         (WebCore::createLinkPreloadResourceClient):
2024
2025 2018-02-05  Chris Dumez  <cdumez@apple.com>
2026
2027         Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/register-same-scope-different-script-url.https.html is flaky
2028         https://bugs.webkit.org/show_bug.cgi?id=181166
2029         <rdar://problem/37169508>
2030
2031         Reviewed by Youenn Fablet.
2032
2033         I found out that this test was flakily timing out because our jobQueues would sometimes get stuck
2034         when their current job's connection or service worker (when scheduled by a service worker) would
2035         go away before the job is complete.
2036
2037         This patch makes our job queues operation more robust by:
2038         1. Cancelling all jobs from a given connection when a SWServerConnection goes away
2039         2. Cancelling all jobs from a given service worker when a service worker gets terminated
2040
2041         We also make sure service workers created by a job get properly terminated when a job
2042         is canceled to avoid leaving service workers in limbo.
2043
2044         No new tests, unskipped existing flaky test.
2045
2046         * workers/service/ServiceWorkerContainer.cpp:
2047         (WebCore::ServiceWorkerContainer::addRegistration):
2048         (WebCore::ServiceWorkerContainer::removeRegistration):
2049         (WebCore::ServiceWorkerContainer::updateRegistration):
2050         * workers/service/ServiceWorkerJobData.cpp:
2051         (WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
2052         (WebCore::ServiceWorkerJobData::isolatedCopy const):
2053         * workers/service/ServiceWorkerJobData.h:
2054         (WebCore::ServiceWorkerJobData::encode const):
2055         (WebCore::ServiceWorkerJobData::decode):
2056         * workers/service/server/SWServer.cpp:
2057         (WebCore::SWServer::startScriptFetch):
2058         (WebCore::SWServer::scriptContextFailedToStart):
2059         (WebCore::SWServer::scriptContextStarted):
2060         (WebCore::SWServer::terminatePreinstallationWorker):
2061         (WebCore::SWServer::installContextData):
2062         (WebCore::SWServer::workerContextTerminated):
2063         (WebCore::SWServer::unregisterConnection):
2064         * workers/service/server/SWServer.h:
2065         * workers/service/server/SWServerJobQueue.cpp:
2066         (WebCore::SWServerJobQueue::removeAllJobsMatching):
2067         (WebCore::SWServerJobQueue::cancelJobsFromConnection):
2068         (WebCore::SWServerJobQueue::cancelJobsFromServiceWorker):
2069         * workers/service/server/SWServerJobQueue.h:
2070         * workers/service/server/SWServerRegistration.cpp:
2071         (WebCore::SWServerRegistration::setPreInstallationWorker):
2072
2073 2018-02-05  Antti Koivisto  <antti@apple.com>
2074
2075         Crash on sfgate.com because mismatching link preload types
2076         https://bugs.webkit.org/show_bug.cgi?id=182483
2077         <rdar://problem/37065331>
2078
2079         Reviewed by Daniel Bates.
2080
2081         Preloading the same URL with different 'as' types causes some confusion.
2082
2083         Test: http/tests/preload/link-preload-type-mismatch.html
2084
2085         * loader/LinkLoader.cpp:
2086         (WebCore::createLinkPreloadResourceClient):
2087
2088             Ensure we use the actual resource type when creating the client.
2089
2090         (WebCore::LinkLoader::preloadIfNeeded):
2091
2092             Don't construct client if the types don't match. This can happen if there is an existing
2093             preload for the same resource with different type.
2094
2095 2018-02-05  Manuel Rego Casasnovas  <rego@igalia.com>
2096
2097         [css-grid] Rename gutter properties to remove "grid-" prefix
2098         https://bugs.webkit.org/show_bug.cgi?id=180290
2099
2100         Reviewed by Javier Fernandez.
2101
2102         This patch applies the resoultion of the CSS WG to unprefix
2103         the CSS Grid Layout gutter properties:
2104         https://github.com/w3c/csswg-drafts/issues/1696
2105
2106         column-gap already existed before, as it's part of Multicol.
2107         The patch adds the new properties row-gap and gap, and keep the legacy ones
2108         as aliases:
2109         - grid-column-gap => column-gap
2110         - grid-row-gap => row-gap
2111         - grid-gap => gap
2112
2113         As column-gap was already animatable, this change takes advantage
2114         to make animatable row-gap too.
2115
2116         Tests: imported/w3c/web-platform-tests/css/css-align/gaps/
2117
2118         * css/CSSComputedStyleDeclaration.cpp:
2119         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2120         * css/CSSProperties.json:
2121         * css/StyleProperties.cpp:
2122         * css/parser/CSSParserFastPaths.cpp:
2123         (WebCore::isSimpleLengthPropertyID):
2124         * css/parser/CSSPropertyParser.cpp:
2125         (WebCore::CSSPropertyParser::parseSingleValue):
2126         (WebCore::CSSPropertyParser::parseShorthand):
2127         * page/animation/CSSPropertyAnimation.cpp:
2128         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2129         * rendering/RenderGrid.cpp:
2130         (WebCore::RenderGrid::availableSpaceForGutters const):
2131         (WebCore::RenderGrid::gridGap const):
2132         * rendering/style/RenderStyle.h:
2133         (WebCore::RenderStyle::gridAutoRows const):
2134         (WebCore::RenderStyle::columnGap const):
2135         (WebCore::RenderStyle::rowGap const):
2136         (WebCore::RenderStyle::setGridItemRowEnd):
2137         (WebCore::RenderStyle::setColumnGap):
2138         (WebCore::RenderStyle::setRowGap):
2139         (WebCore::RenderStyle::initialRowGap):
2140         * rendering/style/StyleGridData.cpp:
2141         (WebCore::StyleGridData::StyleGridData):
2142         * rendering/style/StyleGridData.h:
2143         (WebCore::StyleGridData::operator== const):
2144         * rendering/style/StyleMultiColData.cpp:
2145         (WebCore::StyleMultiColData::StyleMultiColData):
2146         (WebCore::StyleMultiColData::operator== const):
2147         * rendering/style/StyleMultiColData.h:
2148         * rendering/style/StyleRareNonInheritedData.cpp:
2149         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2150         (WebCore::StyleRareNonInheritedData::operator== const):
2151         * rendering/style/StyleRareNonInheritedData.h:
2152
2153 2018-02-05  Ms2ger  <Ms2ger@igalia.com>
2154
2155         Implement createImageBitmap(HTMLVideoElement)
2156         https://bugs.webkit.org/show_bug.cgi?id=182388
2157
2158         Reviewed by Žan Doberšek.
2159
2160         The implementation is inspired by CanvasRenderingContext2DBase::drawImage().
2161
2162         Tests:
2163
2164         - web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html
2165         - web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html
2166
2167
2168         * html/ImageBitmap.cpp:
2169         (WebCore::taintsOrigin): Add function to help with the implementation.
2170         (WebCore::ImageBitmap::createPromise): Fill in implementation.
2171
2172 2018-02-05  Zan Dobersek  <zdobersek@igalia.com>
2173
2174         Unreviewed, rolling out r228085.
2175
2176         Pixel data stride is imposed by OpenGL and shouldn't be
2177         adjusted for Cairo
2178
2179         Reverted changeset:
2180
2181         "[Cairo] Correctly calculate stride in
2182         GraphicsContext3D::paintToCanvas()"
2183         https://bugs.webkit.org/show_bug.cgi?id=182466
2184         https://trac.webkit.org/changeset/228085
2185
2186 2018-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2187
2188         [SOUP] WebSockets must use system proxy settings
2189         https://bugs.webkit.org/show_bug.cgi?id=126384
2190
2191         Reviewed by Michael Catanzaro.
2192
2193         Use soup_session_connect_async() when available to create the WebSockets connection instead of GSocketClient
2194         directly.
2195
2196         * platform/network/soup/SocketStreamHandleImpl.h:
2197         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
2198         (WebCore::wssSocketClientEventCallback):
2199         (WebCore::SocketStreamHandleImpl::create):
2200         (WebCore::SocketStreamHandleImpl::connected):
2201         (WebCore::SocketStreamHandleImpl::connectedCallback):
2202         (WebCore::SocketStreamHandleImpl::platformClose):
2203
2204 2018-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2205
2206         Add a way to check if a host is an IP address
2207         https://bugs.webkit.org/show_bug.cgi?id=182427
2208
2209         Reviewed by Alex Christensen.
2210
2211         There are several places where this is needed. We currently just assume that any host ending in a digit is an IP
2212         address, except in PublicSuffix where platform specific code is used. This patch adds URL::hostIsIPAddress()
2213         platform specific implementations, falling back to current assumption if there isn't an implementation for the
2214         platform.
2215
2216         * page/OriginAccessEntry.cpp:
2217         (WebCore::OriginAccessEntry::OriginAccessEntry): Use URL::hostIsIPAddress().
2218         * platform/URL.cpp:
2219         (WebCore::URL::hostIsIPAddress): Fallback implementation.
2220         * platform/URL.h:
2221         * platform/mac/PublicSuffixMac.mm:
2222         (WebCore::topPrivatelyControlledDomain): Use URL::hostIsIPAddress().
2223         * platform/mac/URLMac.mm:
2224         (WebCore::URL::hostIsIPAddress): Move implementation from PublicSuffixMac.mm.
2225         * platform/network/curl/CookieUtil.cpp:
2226         (WebCore::CookieUtil::isIPAddress): Use URL::hostIsIPAddress().
2227         * platform/soup/URLSoup.cpp:
2228         (WebCore::URL::hostIsIPAddress): Use g_hostname_is_ip_address().
2229
2230 2018-02-04  Zan Dobersek  <zdobersek@igalia.com>
2231
2232         [Cairo] Correctly calculate stride in GraphicsContext3D::paintToCanvas()
2233         https://bugs.webkit.org/show_bug.cgi?id=182466
2234
2235         Reviewed by Michael Catanzaro.
2236
2237         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
2238         (WebCore::GraphicsContext3D::paintToCanvas):
2239         Use cairo_format_stride_for_width() to obtain stride that Cairo thinks
2240         is appropriate for the given width, taking into account internal
2241         alignment requirements.
2242
2243 2018-02-04  Zan Dobersek  <zdobersek@igalia.com>
2244
2245         [Cairo] Split TexMap functionality out of GraphicsContext3DCairo
2246         https://bugs.webkit.org/show_bug.cgi?id=182465
2247
2248         Reviewed by Michael Catanzaro.
2249
2250         Take the Non-Cairo GraphicsContext3D functionality that's stashed in
2251         GraphicsContext3DCairo and move it into the GraphicsContext3DTextureMapper
2252         file.
2253
2254         In GraphicsContext3DCairo.cpp, only the Cairo-specific GraphicsContext3D
2255         functionality remains, specifically ImageExtractor and paintToCanvas().
2256
2257         Everything else is moved into GraphicsContext3DTextureMapper.cpp. This
2258         filename and its location under platform/graphics/texmap/ was chosen
2259         since all the ports using this file (GTK, WPE, WinCairo) are also using
2260         the TextureMapper module. Various #if-guards are simplified in the
2261         moved-over code to reflect this.
2262
2263         GraphicsContext3DCairo.cpp now better reflects GraphicsContext3DCG.cpp,
2264         with both implementing functionality specific to a 2D painting library,
2265         whereas GraphicsContext3DTextureMapper.cpp reflects
2266         GraphicsContext3DCocoa.cpp in covering functionality needed to integrate
2267         the GraphicsContext3D output into the platform-specific composition
2268         system.
2269
2270         No new tests -- no change in behavior.
2271
2272         * platform/TextureMapper.cmake:
2273         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
2274         (WebCore::activeContexts): Deleted.
2275         (WebCore::GraphicsContext3D::create): Deleted.
2276         (WebCore::GraphicsContext3D::GraphicsContext3D): Deleted.
2277         (WebCore::GraphicsContext3D::~GraphicsContext3D): Deleted.
2278         (WebCore::GraphicsContext3D::setContextLostCallback): Deleted.
2279         (WebCore::GraphicsContext3D::setErrorMessageCallback): Deleted.
2280         (WebCore::GraphicsContext3D::makeContextCurrent): Deleted.
2281         (WebCore::GraphicsContext3D::checkGPUStatus): Deleted.
2282         (WebCore::GraphicsContext3D::platformGraphicsContext3D): Deleted.
2283         (WebCore::GraphicsContext3D::platformTexture const): Deleted.
2284         (WebCore::GraphicsContext3D::isGLES2Compliant const): Deleted.
2285         (WebCore::GraphicsContext3D::platformLayer const): Deleted.
2286         (WebCore::GraphicsContext3D::getExtensions): Deleted.
2287         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp: Copied from Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp.
2288         (WebCore::activeContexts):
2289         (WebCore::GraphicsContext3D::create):
2290         (WebCore::GraphicsContext3D::GraphicsContext3D):
2291         (WebCore::GraphicsContext3D::~GraphicsContext3D):
2292         (WebCore::GraphicsContext3D::setContextLostCallback):
2293         (WebCore::GraphicsContext3D::setErrorMessageCallback):
2294         (WebCore::GraphicsContext3D::makeContextCurrent):
2295         (WebCore::GraphicsContext3D::checkGPUStatus):
2296         (WebCore::GraphicsContext3D::platformGraphicsContext3D):
2297         (WebCore::GraphicsContext3D::platformTexture const):
2298         (WebCore::GraphicsContext3D::isGLES2Compliant const):
2299         (WebCore::GraphicsContext3D::platformLayer const):
2300         (WebCore::GraphicsContext3D::getExtensions):
2301
2302 2018-02-04  Zan Dobersek  <zdobersek@igalia.com>
2303
2304         Simplify GraphicsContext3D::paintToCanvas()
2305         https://bugs.webkit.org/show_bug.cgi?id=182459
2306
2307         Reviewed by Michael Catanzaro.
2308
2309         Cairo-specific paintToCanvas() method is dropped in favor of the more
2310         common one that operates on a GraphicsContext object. The platform
2311         context object is then retrieved inside the Cairo-speficic
2312         paintToCanvas() implementation, and not at the call site in
2313         GraphicsContext3D::paintRenderingResultsToCanvas().
2314
2315         GraphicsContext3D::paintToCanvas() is also modified so that the image
2316         and canvas sizes are passed through IntSize objects, and not through
2317         a width-and-height pair of integer values.
2318
2319         No new tests -- no change in behavior.
2320
2321         * platform/graphics/GraphicsContext3D.h:
2322         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
2323         (WebCore::GraphicsContext3D::paintToCanvas):
2324         * platform/graphics/cg/GraphicsContext3DCG.cpp:
2325         (WebCore::GraphicsContext3D::paintToCanvas):
2326         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2327         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
2328
2329 2018-02-03  Alexey Proskuryakov  <ap@apple.com>
2330
2331         Tweak availability macros for CAN_DISALLOW_USER_INSTALLED_FONTS
2332
2333         Rubber-stamped by Maciej Stachowiak.
2334
2335         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2336
2337 2018-02-02  Daniel Bates  <dabates@apple.com>
2338
2339         Clean up FrameLoader::receivedFirstData()
2340         https://bugs.webkit.org/show_bug.cgi?id=182361
2341
2342         Reviewed by Andy Estes.
2343
2344         * loader/FrameLoader.cpp:
2345         (WebCore::FrameLoader::receivedFirstData):
2346
2347 2018-02-02  Myles C. Maxfield  <mmaxfield@apple.com>
2348
2349         Test fix after r227995
2350         https://bugs.webkit.org/show_bug.cgi?id=180951
2351
2352         Unreviewed.
2353
2354         Webfonts shouldn't be run through CTFontDescriptorCreateMatchingFontDescriptor().
2355         Also, unify macOS's and iOS's implementation of FontCache::lastResortFallbackFont().
2356
2357         Covered by existing tests.
2358
2359         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2360         (WebCore::FontDatabase::collectionForFamily):
2361         (WebCore::FontDatabase::fontForPostScriptName):
2362         (WebCore::addAttributesForInstalledFonts):
2363         (WebCore::addAttributesForWebFonts):
2364         (WebCore::installedFontMandatoryAttributes):
2365         (WebCore::FontCache::lastResortFallbackFont):
2366         (WebCore::addAttributesForUserInstalledFonts): Deleted.
2367         (WebCore::mandatoryAttributesForUserInstalledFonts): Deleted.
2368         * platform/graphics/cocoa/FontCacheCoreText.h:
2369         * platform/graphics/ios/FontCacheIOS.mm:
2370         (WebCore::FontCache::lastResortFallbackFont): Deleted.
2371         * platform/graphics/mac/FontCacheMac.mm:
2372         (WebCore::FontCache::lastResortFallbackFont): Deleted.
2373         * platform/graphics/mac/FontCustomPlatformData.cpp:
2374         (WebCore::FontCustomPlatformData::fontPlatformData):
2375
2376 2018-02-02  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2377
2378         Fix build error after r 227457 with VIDEO and WEB_AUDIO disabled
2379         https://bugs.webkit.org/show_bug.cgi?id=182395
2380
2381         Reviewed by Eric Carlson
2382
2383         * platform/audio/PlatformMediaSessionManager.cpp:
2384         (WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary):
2385
2386 2018-02-02  Don Olmstead  <don.olmstead@sony.com>
2387
2388         Remove WebCore/ForwardingHeaders directory
2389         https://bugs.webkit.org/show_bug.cgi?id=182347
2390
2391         Reviewed by Alex Christensen.
2392
2393         Baseline tests updated.
2394
2395         * bindings/scripts/CodeGeneratorJS.pm:
2396         (AddToIncludesForIDLType):
2397         (GenerateEnumerationImplementationContent):
2398         (GenerateDictionaryImplementationContent):
2399         (GenerateHeader):
2400         (GenerateOverloadDispatcher):
2401         (addUnscopableProperties):
2402         (GenerateImplementation):
2403         (GenerateOperationDefinition):
2404         (GenerateSerializerDefinition):
2405         (GenerateConstructorHelperMethods):
2406         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2407         * bindings/scripts/test/JS/JSMapLike.cpp:
2408         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2409         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2410         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2411         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2412         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
2413         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
2414         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp:
2415         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
2416         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
2417         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2418         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2419         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2420         * bindings/scripts/test/JS/JSTestDOMJIT.h:
2421         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
2422         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2423         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2424         * bindings/scripts/test/JS/JSTestException.cpp:
2425         * bindings/scripts/test/JS/JSTestException.h:
2426         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2427         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2428         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
2429         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
2430         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
2431         * bindings/scripts/test/JS/JSTestInterface.cpp:
2432         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2433         * bindings/scripts/test/JS/JSTestIterable.cpp:
2434         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2435         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2436         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2437         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2438         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2439         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2440         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2441         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2442         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2443         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2444         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
2445         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
2446         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
2447         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2448         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2449         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2450         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
2451         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
2452         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
2453         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2454         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
2455         * bindings/scripts/test/JS/JSTestNode.cpp:
2456         * bindings/scripts/test/JS/JSTestObj.cpp:
2457         * bindings/scripts/test/JS/JSTestObj.h:
2458         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2459         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2460         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2461         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
2462         * bindings/scripts/test/JS/JSTestPluginInterface.h:
2463         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2464         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2465         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
2466         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2467         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2468         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2469         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
2470         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
2471         * bindings/scripts/test/JS/JSTestStringifier.cpp:
2472         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
2473         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
2474         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
2475         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
2476         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
2477         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
2478         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2479         * dom/make_event_factory.pl:
2480         (generateImplementation):
2481
2482 2018-02-02  David Quesada  <david_quesada@apple.com>
2483
2484         WebAppManifest scope should default to the containing directory of start_url if 'scope' is not specified
2485         https://bugs.webkit.org/show_bug.cgi?id=182363
2486         rdar://problem/37093498
2487
2488         Reviewed by Ryosuke Niwa.
2489
2490         If an app manifest doesn't specify a scope, we should default to the "parent directory" of
2491         the start URL, rather than leaving the app unbounded. This is more reasonable than using the
2492         entire internet as the app scope.
2493
2494         No new tests, updates to the existing tests verify the new behavior.
2495
2496         * Modules/applicationmanifest/ApplicationManifestParser.cpp:
2497         (WebCore::ApplicationManifestParser::parseScope):
2498
2499 2018-02-02  Youenn Fablet  <youenn@apple.com>
2500
2501         Clearing all service worker registrations should wait for importing service worker registration to finish
2502         https://bugs.webkit.org/show_bug.cgi?id=182407
2503         <rdar://problem/37167523>
2504
2505         Reviewed by Chris Dumez.
2506
2507         * workers/service/server/SWServer.cpp:
2508         (WebCore::SWServer::clear): ensure completion handler is called on early exit case.
2509
2510 2018-02-02  Youenn Fablet  <youenn@apple.com>
2511
2512         Clearing all service worker registrations should wait for importing service worker registration to finish
2513         https://bugs.webkit.org/show_bug.cgi?id=182407
2514
2515         Reviewed by Chris Dumez.
2516
2517         Covered by existing tests and the service worker API test being no longer flaky.
2518
2519         * workers/service/server/SWServer.cpp:
2520         (WebCore::SWServer::registrationStoreImportComplete):
2521         (WebCore::SWServer::clearAll):
2522         (WebCore::SWServer::clear):
2523         (WebCore::SWServer::getOriginsWithRegistrations):
2524         * workers/service/server/SWServer.h:
2525
2526 2018-02-02  Chris Dumez  <cdumez@apple.com>
2527
2528         Clearing a registration should null out its workers before setting their state to "redundant"
2529         https://bugs.webkit.org/show_bug.cgi?id=182418
2530         <rdar://problem/37142874>
2531
2532         Reviewed by Youenn Fablet.
2533
2534         Clearing a registration should null out its workers before setting their state to "redundant".
2535         This seems to match Firefox and Chrome.
2536
2537         No new tests, rebaselined existing test.
2538
2539         * workers/service/server/SWServerRegistration.cpp:
2540         (WebCore::SWServerRegistration::clear):
2541         (WebCore::clearRegistrationWorker): Deleted.
2542
2543 2018-02-02  Antoine Quint  <graouts@apple.com>
2544
2545         [Modern Media Controls] Turn media/modern-media-controls/tracks-panel and media/modern-media-controls/tracks-support back on
2546         https://bugs.webkit.org/show_bug.cgi?id=182426
2547
2548         Reviewed by Dean Jackson.
2549
2550         Ensure that the tracks panel isn't dismissed by updating the layout.
2551
2552         * Modules/modern-media-controls/controls/inline-media-controls.js:
2553         (InlineMediaControls.prototype.layout):
2554
2555 2018-02-02  Commit Queue  <commit-queue@webkit.org>
2556
2557         Unreviewed, rolling out r227964.
2558         https://bugs.webkit.org/show_bug.cgi?id=182423
2559
2560         It broke several unit tests (Requested by KaL on #webkit).
2561
2562         Reverted changeset:
2563
2564         "[SOUP] Ensure domain is valid when converting a WebCore
2565         Cookie to Soup"
2566         https://bugs.webkit.org/show_bug.cgi?id=182328
2567         https://trac.webkit.org/changeset/227964
2568
2569 2018-02-01  Chris Dumez  <cdumez@apple.com>
2570
2571         When SW install fails, null out registration.installing before setting worker state to "redundant"
2572         https://bugs.webkit.org/show_bug.cgi?id=182416
2573         <rdar://problem/37141997>
2574
2575         Reviewed by Youenn Fablet.
2576
2577         When SW install fails, null out registration.installing before setting worker state to "redundant".
2578         This does not match the spec but this is what Firefox and Chrome do. This is also what the
2579         web-platform-tests expect.
2580
2581         Test: http/tests/workers/service/install-fails.html
2582
2583         * workers/service/server/SWServerJobQueue.cpp:
2584         (WebCore::SWServerJobQueue::didFinishInstall):
2585
2586 2018-02-01  Myles C. Maxfield  <mmaxfield@apple.com>
2587
2588         Test fix after r227848.
2589         https://bugs.webkit.org/show_bug.cgi?id=180951
2590
2591         Unreviewed.
2592
2593         Using kCTFontNameAttribute on an in-memory font causes CTFontDescriptorCreateMatchingFontDescriptor()
2594         to return nullptr. Luckily, we weren't using that attribute anyway.
2595
2596         Covered by existing tests.
2597
2598         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2599         (WebCore::mandatoryAttributesForUserInstalledFonts):
2600
2601 2018-02-01  Youenn Fablet  <youenn@apple.com>
2602
2603         Delay service worker process creation until actually needed by SWServer
2604         https://bugs.webkit.org/show_bug.cgi?id=182301
2605
2606         Reviewed by Chris Dumez.
2607
2608         Rename SWServer::Connection::scheduleJobInServer to scheduleJob.
2609         Add sessionID getter from an SWServer.
2610
2611         * workers/service/server/SWServer.h:
2612         (WebCore::SWServer::sessionID const):
2613
2614 2018-02-01  Fujii Hironori  <Hironori.Fujii@sony.com>
2615
2616         REGRESSION(r227594) [WinCairo] NULL pointer crash in GraphicsContext::getWindowsContext
2617         https://bugs.webkit.org/show_bug.cgi?id=182282
2618
2619         Reviewed by Žan Doberšek.
2620
2621         ImageBufferCairo has been changed to use GraphicsContextImplCairo
2622         in r227594. But, GraphicsContext::getWindowsContext doesn't care
2623         the case of using GraphicsContextImpl and crashes due to null
2624         dereference of GraphicsContext::m_data.
2625
2626         GraphicsContext::getWindowsContext should create a HDC in that case.
2627
2628         Remove the argument mayCreateBitmap because it is always
2629         true at the moment.
2630
2631         No new tests (Covered by the existing tests)
2632
2633         * platform/graphics/GraphicsContext.h:
2634         Removed a argument mayCreateBitmap of getWindowsContext and releaseWindowsContext.
2635         * platform/graphics/win/GraphicsContextCGWin.cpp:
2636         (WebCore::GraphicsContext::releaseWindowsContext): Ditto.
2637         * platform/graphics/win/GraphicsContextCairoWin.cpp:
2638         (WebCore::GraphicsContext::releaseWindowsContext): Ditto.
2639         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2640         (WebCore::GraphicsContext::releaseWindowsContext): Ditto.
2641         * platform/graphics/win/GraphicsContextWin.cpp:
2642         (WebCore::GraphicsContext::getWindowsContext):
2643         Create a HDC if m_impl is null. Removed a argument mayCreateBitmap.
2644         * platform/graphics/win/LocalWindowsContext.h:
2645         (WebCore::LocalWindowsContext::LocalWindowsContext):
2646         Removed m_mayCreateBitmap.
2647         (WebCore::LocalWindowsContext::~LocalWindowsContext): Ditto.
2648
2649 2018-02-01  Christopher Reid  <chris.reid@sony.com>
2650
2651         [Curl] Use SQLite database in cookie jar implementation for Curl port
2652         https://bugs.webkit.org/show_bug.cgi?id=174942
2653
2654         Reviewed by Alex Christensen.
2655
2656         No new tests, Set-Cookie is already tested in Layout tests.
2657
2658         Adding an initial SQLite CookieJar implementation to the curl network layer.
2659         WebCore will now parse and handle both HTTP and DOM cookies instead of using libcurl.
2660         This currently supports cookie storage and retrieval.
2661         Cookie deletion is not yet implemented.
2662
2663         * platform/Curl.cmake:
2664         * platform/network/NetworkStorageSession.h: Added cookieDB storage in curl.
2665         * platform/network/curl/CookieJarCurl.cpp: Removed the old curl cookie handling.
2666         * platform/network/curl/CookieJarCurl.h:
2667         * platform/network/curl/CookieJarCurlDatabase.cpp: Added.
2668         * platform/network/curl/CookieJarCurlDatabase.h: Added.
2669         * platform/network/curl/CookieJarDB.cpp: Added.
2670         * platform/network/curl/CookieJarDB.h: Added.
2671         * platform/network/curl/CookieUtil.cpp: Added.
2672         * platform/network/curl/CookieUtil.h: Added.
2673         * platform/network/curl/CurlContext.cpp: Removed the old curl cookie handling.
2674         * platform/network/curl/CurlContext.h:
2675         * platform/network/curl/CurlRequest.cpp: Added handlers for HTTP response cookies.
2676         * platform/network/curl/NetworkStorageSessionCurl.cpp:
2677         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
2678
2679 2018-02-01  Chris Dumez  <cdumez@apple.com>
2680
2681         Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>()
2682         https://bugs.webkit.org/show_bug.cgi?id=182392
2683         <rdar://problem/37119215>
2684
2685         Reviewed by Geoffrey Garen.
2686
2687         Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>(),
2688         given that getting the property from the object can throw an exception.
2689
2690         No new tests, rebaselined existing test.
2691
2692         * bindings/scripts/CodeGeneratorJS.pm:
2693         (GenerateDictionaryImplementationContent):
2694         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
2695         (WebCore::convertDictionary<TestCallbackInterface::Dictionary>):
2696         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2697         (WebCore::convertDictionary<TestEventConstructor::Init>):
2698         * bindings/scripts/test/JS/JSTestObj.cpp:
2699         (WebCore::convertDictionary<TestObj::Dictionary>):
2700         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
2701         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
2702         (WebCore::convertDictionary<AlternateDictionaryName>):
2703         (WebCore::convertDictionary<TestObj::ParentDictionary>):
2704         (WebCore::convertDictionary<TestObj::ChildDictionary>):
2705         (WebCore::convertDictionary<TestObj::ConditionalDictionaryA>):
2706         (WebCore::convertDictionary<TestObj::ConditionalDictionaryB>):
2707         (WebCore::convertDictionary<TestObj::ConditionalDictionaryC>):
2708         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2709         (WebCore::convertDictionary<TestPromiseRejectionEvent::Init>):
2710         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
2711         (WebCore::convertDictionary<DictionaryImplName>):
2712
2713 2018-02-01  Ryosuke Niwa  <rniwa@webkit.org>
2714
2715         Some test cases in accessibility/mac/selection-notification-focus-change.html fail
2716         https://bugs.webkit.org/show_bug.cgi?id=182212
2717         <rdar://problem/36937147>
2718
2719         Reviewed by Antti Koivisto and Wenson Hsieh.
2720
2721         The failure was caused by the async update of the selection appearance not preserving selection reveal intent.
2722         Fixed the bug by storing the intent in a member variable and using it later.
2723
2724         * dom/Element.cpp:
2725         (WebCore::Element::focus): Removed an unnecessary synchronous layout update.
2726         * editing/FrameSelection.cpp:
2727         (WebCore::FrameSelection::setNeedsSelectionUpdate): Use the default intent to preserve the old behavior.
2728         (WebCore::FrameSelection::respondToNodeModification): Ditto.
2729         (WebCore::FrameSelection::setSelection): Save the selection reveal intent.
2730         (WebCore::FrameSelection::updateAppearanceAfterLayoutOrStyleChange): Use the saved intent.
2731         * editing/FrameSelection.h:
2732         * page/FocusController.cpp:
2733         (WebCore::FocusController::advanceFocusDirectionally): Always update the layout before invoking
2734         nodeRectInAbsoluteCoordinates.
2735
2736 2018-02-01  Zalan Bujtas  <zalan@apple.com>
2737
2738         [RenderTreeBuilder] Move RenderRubyRun::rubyBaseSafe to RenderTreeBuilder::Ruby
2739         https://bugs.webkit.org/show_bug.cgi?id=182306
2740         <rdar://problem/37041440>
2741
2742         Reviewed by Darin Adler.
2743
2744         Addressing post-review comment.
2745
2746         * rendering/updating/RenderTreeBuilderRuby.cpp:
2747         (WebCore::RenderTreeBuilder::Ruby::insertChild):
2748         (WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
2749         * rendering/updating/RenderTreeBuilderRuby.h:
2750
2751 2018-02-01  Zalan Bujtas  <zalan@apple.com>
2752
2753         [RenderTreeBuilder] Introduce RenderTreeBuilder to takeChild()
2754         https://bugs.webkit.org/show_bug.cgi?id=182373
2755         <rdar://problem/37101484>
2756
2757         Reviewed by Antti Koivisto.
2758         
2759         This is in preparation for moving mutation code out of takeChild. 
2760
2761         No change in functionality.
2762
2763         * rendering/RenderBlock.cpp:
2764         (WebCore::RenderBlock::takeChild):
2765         * rendering/RenderBlock.h:
2766         * rendering/RenderBlockFlow.cpp:
2767         (WebCore::RenderBlockFlow::takeChild):
2768         * rendering/RenderBlockFlow.h:
2769         * rendering/RenderButton.cpp:
2770         (WebCore::RenderButton::takeChild):
2771         * rendering/RenderButton.h:
2772         * rendering/RenderElement.cpp:
2773         (WebCore::RenderElement::takeChild):
2774         (WebCore::RenderElement::removeAndDestroyChild):
2775         (WebCore::RenderElement::destroyLeftoverChildren):
2776         * rendering/RenderElement.h:
2777         * rendering/RenderFullScreen.cpp:
2778         (WebCore::RenderFullScreen::wrapExistingRenderer):
2779         (WebCore::RenderFullScreen::unwrapRenderer):
2780         * rendering/RenderGrid.cpp:
2781         (WebCore::RenderGrid::takeChild):
2782         * rendering/RenderGrid.h:
2783         * rendering/RenderMenuList.cpp:
2784         (RenderMenuList::takeChild):
2785         * rendering/RenderMenuList.h:
2786         * rendering/RenderMultiColumnFlow.cpp:
2787         (WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
2788         * rendering/RenderObject.cpp:
2789         (WebCore::RenderObject::removeFromParentAndDestroy):
2790         * rendering/RenderRuby.cpp:
2791         (WebCore::RenderRubyAsInline::takeChild):
2792         (WebCore::RenderRubyAsBlock::takeChild):
2793         * rendering/RenderRuby.h:
2794         * rendering/RenderRubyRun.cpp:
2795         (WebCore::RenderRubyRun::takeChild):
2796         * rendering/RenderRubyRun.h:
2797         * rendering/RenderTableRow.cpp:
2798         (WebCore::RenderTableRow::collapseAndDestroyAnonymousSiblingRows): Deleted.
2799         * rendering/RenderTableRow.h:
2800         * rendering/svg/RenderSVGContainer.cpp:
2801         (WebCore::RenderSVGContainer::takeChild):
2802         * rendering/svg/RenderSVGContainer.h:
2803         * rendering/svg/RenderSVGInline.cpp:
2804         (WebCore::RenderSVGInline::takeChild):
2805         * rendering/svg/RenderSVGInline.h:
2806         * rendering/svg/RenderSVGRoot.cpp:
2807         (WebCore::RenderSVGRoot::takeChild):
2808         * rendering/svg/RenderSVGRoot.h:
2809         * rendering/svg/RenderSVGText.cpp:
2810         (WebCore::RenderSVGText::takeChild):
2811         * rendering/svg/RenderSVGText.h:
2812         * rendering/updating/RenderTreeBuilder.cpp:
2813         (WebCore::RenderTreeBuilder::collapseAndDestroyAnonymousSiblingRows):
2814         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
2815         * rendering/updating/RenderTreeBuilder.h:
2816         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
2817         (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
2818         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
2819         * rendering/updating/RenderTreeBuilderList.cpp:
2820         (WebCore::RenderTreeBuilder::List::updateItemMarker):
2821         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
2822         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
2823         (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
2824         * rendering/updating/RenderTreeBuilderRuby.cpp:
2825         (WebCore::RenderTreeBuilder::Ruby::insertChild):
2826
2827 2018-02-01  Dean Jackson  <dino@apple.com>
2828
2829         REGRESSION (r219342): Scaled HTML widget is not responding to a clicks outside the body
2830         https://bugs.webkit.org/show_bug.cgi?id=182394
2831         <rdar://problem/34840816>
2832
2833         Reviewed by Simon Fraser.
2834
2835         If a scale < 1 is applied to the page, then the visual viewport will be bigger
2836         than the layout viewport. Our hit testing code would then ignore any hits
2837         that were outside the layout viewport.
2838
2839         The fix is to only apply a hit testing clip if the page is scaling up, not down.
2840
2841         Update the existing fast/dom/elementFromPoint-scaled-scrolled.html test.
2842
2843         * page/FrameView.cpp:
2844         (WebCore::FrameView::layoutViewportToAbsoluteRect const): Deleted. This helper is
2845         no longer used, and it would have probably been more confusing to have it accept
2846         a flag to ignore the scale if it is less than 1.
2847         * page/FrameView.h:
2848         * rendering/RenderLayer.cpp:
2849         (WebCore::RenderLayer::hitTest): No need to take the layout rect, remove the origin,
2850         and pass it to a helper that added the origin back. The only thing the helper was
2851         doing for us was applying a scale factor, which we only want to do if it was
2852         scaling up.
2853
2854 2018-02-01  Yusuke Suzuki  <utatane.tea@gmail.com>
2855
2856         Structured cloning a Symbol should throw
2857         https://bugs.webkit.org/show_bug.cgi?id=182380
2858
2859         Reviewed by Darin Adler.
2860
2861         Test: js/dom/post-message-symbol.html
2862
2863         * bindings/js/SerializedScriptValue.cpp:
2864         (WebCore::CloneSerializer::dumpIfTerminal):
2865         Structured cloning should throw "DataCloneError" DOMException if it finds Symbol.
2866         Remove unused `isNumber()` case. It is done in dumpImmediate.
2867         (WebCore::CloneSerializer::serializeUndefined): Deleted.
2868         (WebCore::CloneSerializer::serializeBoolean): Deleted.
2869         (WebCore::CloneSerializer::serializeNumber): Deleted.
2870         Remove unused functions.
2871
2872 2018-02-01  Chris Dumez  <cdumez@apple.com>
2873
2874         We no longer need to queue service worker jobs until the connection to the service worker process has been established
2875         https://bugs.webkit.org/show_bug.cgi?id=182375
2876
2877         Reviewed by Youenn Fablet.
2878
2879         We no longer need to queue service worker jobs until the connection to the service worker process
2880         has been established. We initially did this to work around the fact that registrations restored
2881         from disk would not have an active worker until the service worker process had been established. 
2882         However, this issue has been fixed in r227696.
2883
2884         This is basically a revert of r227220, which is no longer needed after r227696.
2885
2886         No new tests, initial fix was covered by an API test that still passes.
2887
2888         * workers/service/server/SWServer.cpp:
2889         (WebCore::SWServer::clearAll):
2890         (WebCore::SWServer::clear):
2891         (WebCore::SWServer::scheduleJob):
2892         (WebCore::SWServer::serverToContextConnectionCreated):
2893         * workers/service/server/SWServer.h:
2894
2895 2018-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2896
2897         [GTK] Shift + mouse scroll should scroll horizontally
2898         https://bugs.webkit.org/show_bug.cgi?id=181629
2899
2900         Reviewed by Michael Catanzaro.
2901
2902         We currently turn vertical scroll into horizontal when scrolling over the horizontal scrollbar. When Shift key is
2903         pressed, we still want to scroll in the scrollbar direction when scrolling over a scrollbar, so we need to swap
2904         directions in both scrollbars depending on whther the Shift key is pressed or not.
2905
2906         * page/EventHandler.cpp:
2907         (WebCore::EventHandler::shouldSwapScrollDirection const): Renamed.
2908         (WebCore::EventHandler::handleWheelEvent): Use the new name.
2909         (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal const): Deleted.
2910         * page/EventHandler.h:
2911         * platform/PlatformWheelEvent.h:
2912         (WebCore::PlatformWheelEvent::copySwappingDirection const): Swap the direction of the event.
2913         (WebCore::PlatformWheelEvent::copyTurningVerticalTicksIntoHorizontalTicks const): Deleted.
2914         * platform/glib/EventHandlerGLib.cpp:
2915         (WebCore::EventHandler::shouldSwapScrollDirection const): Take into account whether the Shift key is present.
2916         (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal const): Deleted.
2917
2918 2018-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2919
2920         [GTK] Problem with Washington Post images
2921         https://bugs.webkit.org/show_bug.cgi?id=181421
2922
2923         Reviewed by Carlos Alberto Lopez Perez.
2924
2925         This is because Washington Post is using the user agent to decide the image formats it serves. In the case of
2926         chromium the images are served as webp, for firefox jpeg is used and in our case it's assuming we are safari and
2927         it's providing jp2 images that we don't support. Add a user agent quirk to pretend to be chromium for
2928         washingtonpost.com.
2929
2930         * platform/UserAgentQuirks.cpp:
2931         (WebCore::urlRequiresChromeBrowser):
2932
2933 2018-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2934
2935         [SOUP] Ensure domain is valid when converting a WebCore Cookie to Soup
2936         https://bugs.webkit.org/show_bug.cgi?id=182328
2937
2938         Reviewed by Michael Catanzaro.
2939
2940         soup_cookie_parse() adds the initial '.' to the domain if missing before creating the SoupCookie, but
2941         soup_cookie_new() allows for domain to be a hostname that needs to match exactly. When converting a WebCore
2942         Cookie into a SoupCookie we always want the domain to be considered as such and not as a hostname, so we need to
2943         prepend the '.' if missing.
2944
2945         Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie
2946
2947         * platform/network/soup/CookieSoup.cpp:
2948         (WebCore::Cookie::toSoupCookie const):
2949
2950 2018-02-01  Zalan Bujtas  <zalan@apple.com>
2951
2952         [RenderTreeBuilder] Move RenderTableRow::collapseAndDestroyAnonymousSiblingRows to RenderTreeBuilder
2953         https://bugs.webkit.org/show_bug.cgi?id=182374
2954         <rdar://problem/37102005>
2955
2956         Reviewed by Antti Koivisto.
2957
2958         It's only called from RenderTreeBuilder.
2959
2960         No change in functionality.
2961
2962         * rendering/RenderTableRow.cpp:
2963         (WebCore::RenderTableRow::collapseAndDestroyAnonymousSiblingRows): Deleted.
2964         * rendering/RenderTableRow.h:
2965         * rendering/updating/RenderTreeBuilder.cpp:
2966         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
2967         * rendering/updating/RenderTreeBuilderTable.cpp:
2968         (WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
2969         * rendering/updating/RenderTreeBuilderTable.h:
2970
2971 2018-02-01  Chris Dumez  <cdumez@apple.com>
2972
2973         Queue a microtask when a waitUntil() promise is settled
2974         https://bugs.webkit.org/show_bug.cgi?id=182372
2975         <rdar://problem/37101019>
2976
2977         Reviewed by Mark Lam.
2978
2979         Queue a microtask when a waitUntil() promise is settled, as per:
2980         - https://w3c.github.io/ServiceWorker/#dom-extendableevent-waituntil (step 5)
2981
2982         Otherwise, we decrement m_pendingPromiseCount too quickly and it may cause
2983         following calls to waitUntil() to throw when they shouldn't.
2984
2985         No new tests, rebaselined existing test.
2986
2987         * workers/service/ExtendableEvent.cpp:
2988         (WebCore::ExtendableEvent::addExtendLifetimePromise):
2989
2990 2018-02-01  Antti Koivisto  <antti@apple.com>
2991
2992         Invalidate style for sibling combinators accurately on class change
2993         https://bugs.webkit.org/show_bug.cgi?id=182336
2994
2995         Reviewed by Zalan Bujtas.
2996
2997         Use Style::Invalidator to invalidate only those elements that may be affected by a class
2998         change for sibling combinators and nth pseudo classes.
2999
3000         * css/RuleFeature.cpp:
3001
3002         Add new AllSiblings MatchElement to use for nth pseudo classes with subselectors.
3003
3004         (WebCore::isSiblingOrSubject):
3005
3006         Add a helper.
3007
3008         (WebCore::RuleFeatureSet::computeNextMatchElement):
3009         (WebCore::RuleFeatureSet::computeSubSelectorMatchElement):
3010
3011         Compute and propage MatchElement::AllSiblings.
3012
3013         * css/RuleFeature.h:
3014         * dom/Node.cpp:
3015         (WebCore::Node::updateAncestorsForStyleRecalc):
3016
3017         Don't need to test for childrenAffectedByPropertyBasedBackwardPositionalRules anymore (an oddly named bit for nth pseudo classes).
3018
3019         * style/StyleInvalidator.cpp:
3020         (WebCore::Style::Invalidator::invalidateStyleWithMatchElement):
3021
3022         Invalidate only the potentially affected elements.
3023         The old code would just unconditionally invalidate the current element. This would propagate to descedants of siblings via
3024         affectedByPreviousSibling bits. That mechanism can be removed when everything has been switched to accurate invalidation.
3025
3026 2018-01-31  Simon Fraser  <simon.fraser@apple.com>
3027
3028         Use different debug red colors for different contexts
3029         https://bugs.webkit.org/show_bug.cgi?id=182362
3030
3031         Reviewed by Tim Horton.
3032
3033         Pure red is used elsehwere in the system as a debug color indicator, so use different
3034         shades of red for WebKit in the two places where we paint a reddish wash in debug builds,
3035         so they are identifiable.
3036
3037         * page/FrameView.cpp:
3038         (WebCore::FrameView::paintContents):
3039
3040 2018-01-31  Don Olmstead  <don.olmstead@sony.com>
3041
3042         [CMake] Make JavaScriptCore headers copies
3043         https://bugs.webkit.org/show_bug.cgi?id=182303
3044
3045         Reviewed by Alex Christensen.
3046
3047         No new tests. No change in behavior.
3048
3049         * CMakeLists.txt:
3050         * PlatformMac.cmake:
3051         * PlatformWPE.cmake:
3052         * PlatformWin.cmake:
3053         * PlatformWinCairo.cmake:
3054
3055 2018-01-31  Per Arne Vollan  <pvollan@apple.com>
3056
3057         Layout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing
3058         https://bugs.webkit.org/show_bug.cgi?id=181204
3059         <rdar://problem/36256274>
3060
3061         Reviewed by Ryosuke Niwa.
3062
3063         When a frame element is moved in the DOM tree during the execution of a beforeunload handler,
3064         the frame will be detached when removed from its previous position in the DOM tree. When being
3065         detached, an attempt will also be made to stop the load by calling FrameLoader::stopAllLoaders().
3066         However, this method will return early when executed in a beforeunload handler, since navigation
3067         is not allowed then. The end result is a detached frame which will continue to load, and hitting
3068         asserts in DocumentLoader::dataReceived(), and DocumentLoader::notifyFinished(). It should be
3069         possible to stop a frame load, even when executing a beforeunload handler.
3070
3071         No new tests. Covered by the existing test fast/events/beforeunload-dom-manipulation-crash.html.
3072
3073         * history/PageCache.cpp:
3074         (WebCore::PageCache::addIfCacheable): Fix a failing API test by allowing scripts to be executed
3075         under the PageCache::prune method.
3076         * loader/FrameLoader.cpp:
3077         (WebCore::FrameLoader::isStopLoadingAllowed const):
3078         (WebCore::FrameLoader::stopAllLoaders):
3079         * loader/FrameLoader.h:
3080         * svg/graphics/SVGImage.cpp:
3081         (WebCore::SVGImage::~SVGImage): Disable scripts disallowed assertions in this scope, since it is
3082         safe in this context.
3083
3084 2018-01-31  Javier Fernandez  <jfernandez@igalia.com>
3085
3086         inline-block baseline not computed correctly for vertical-lr
3087         https://bugs.webkit.org/show_bug.cgi?id=170176
3088
3089         Reviewed by Manuel Rego Casasnovas.
3090
3091         When computing the baseline position of inline-block elements we use the
3092         InlineFlow logicalTop and the FontMetrics ascent. The issue comes from
3093         the fact that these units are incompatible. The logicalTop of a
3094         vertical-lr element is offset to the left edge, while the ascent is the
3095         distance from the right edge.
3096
3097         We need to either use logical value for the FontMetrics ascent so we can
3098         compute the correctly the baselines of vertical-lr elements, or just using
3099         the logicalBottom for these cases.
3100
3101         The approach based on a logicalAscent API for FontMetrics would require
3102         a lot of work because inline-block logic assumes everything is vertical-rl
3103         and at some point, flips the elements along the block-axis in case of
3104         vertical-lr mode.
3105
3106         While it'd be desirable to get rid of this flipping logic, this patch tries
3107         first the simpler approach of using logicalBottom, which aligns with the
3108         currently implemented logic.
3109
3110         Tests: fast/inline-block/baseline-vertical-01.html
3111                fast/inline-block/baseline-vertical-02.html
3112                fast/inline-block/baseline-vertical-03.html
3113                fast/inline-block/baseline-vertical-04.html
3114                fast/inline-block/baseline-vertical-05.html
3115                fast/inline-block/baseline-vertical-06.html
3116                fast/inline-block/baseline-vertical-07.html
3117                fast/inline-block/baseline-vertical-08.html
3118
3119         * rendering/InlineFlowBox.cpp:
3120         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
3121         * rendering/RenderBlockFlow.cpp:
3122         (WebCore::RenderBlockFlow::inlineBlockBaseline const):
3123
3124 2018-01-31  Said Abou-Hallawa  <sabouhallawa@apple.com>
3125
3126         BitmapImage::drawPattern() may not draw a complete frame even after all the data is received
3127         https://bugs.webkit.org/show_bug.cgi?id=182277
3128
3129         Reviewed by Simon Fraser.
3130
3131         BitmapImage::drawPattern() needs to destroy the incomplete decoded frame
3132         before trying to draw it as a pattern.
3133
3134         Test: http/tests/images/draw-pattern-slow-load-large-image.html
3135
3136         * loader/cache/CachedImage.cpp:
3137         (WebCore::CachedImage::updateBufferInternal): We need to disable CachedImage
3138         data buffering for testing. This simulates slow network where intervals
3139         between data chunks can last for seconds.
3140         * loader/cache/CachedImage.h:
3141         * platform/graphics/BitmapImage.cpp:
3142         (WebCore::BitmapImage::drawPattern): Destroy the incomplete decoded frame
3143         before drawing this frame as a pattern. We do not destroy incomplete decoded
3144         frame once new data is received because it may be drawn by async image
3145         drawing while waiting for the newer frame to finish decoding.
3146         * testing/Internals.cpp:
3147         (WebCore::Internals::setForceUpdateImageDataEnabledForTesting):
3148         * testing/Internals.h:
3149         * testing/Internals.idl:
3150
3151 2018-01-31  Ryosuke Niwa  <rniwa@webkit.org>
3152
3153         Add a release assertion to ensure timers are deleted in the right thread
3154         https://bugs.webkit.org/show_bug.cgi?id=182351
3155
3156         Reviewed by David Kilzer.
3157
3158         Added a relese assertion in ~TimerBase that the current thread is the one in which the timer was created.
3159
3160         We use canAccessThreadLocalDataForThread for this purpose since the condition is more complicated
3161         when WebThread is being used.
3162
3163         * platform/Timer.cpp:
3164         (WebCore::TimerBase::~TimerBase): Added the assertion.
3165         * platform/Timer.h:
3166         (WebCore::TimerBase::m_thread): Always store the current thread in a timer.
3167
3168 2018-01-31  Youenn Fablet  <youenn@apple.com>
3169
3170         Change SWServer::claim to set the iterator value as soon as possible
3171         https://bugs.webkit.org/show_bug.cgi?id=182337
3172
3173         Reviewed by Chris Dumez.
3174
3175         No change of behavior, this is a "let's go safe way" fix.
3176
3177         * workers/service/server/SWServer.cpp:
3178         (WebCore::SWServer::claim):
3179
3180 2018-01-31  Zalan Bujtas  <zalan@apple.com>
3181
3182         [RenderTreeBuilder] Move RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers to RenderTreeBuilder.
3183         https://bugs.webkit.org/show_bug.cgi?id=182348
3184         <rdar://problem/37082837>
3185
3186         Reviewed by Antti Koivisto.
3187
3188         All the callsites are in the RenderTreeUpdater by now.
3189
3190         No change in functionality.
3191
3192         * rendering/RenderObject.cpp:
3193         (WebCore::isAnonymousAndSafeToDelete): Deleted.
3194         (WebCore::findDestroyRootIncludingAnonymous): Deleted.
3195         (WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers): Deleted.
3196         * rendering/RenderObject.h:
3197         * rendering/updating/RenderTreeBuilder.cpp:
3198         (WebCore::isAnonymousAndSafeToDelete):
3199         (WebCore::findDestroyRootIncludingAnonymous):
3200         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
3201         * rendering/updating/RenderTreeBuilder.h:
3202         * rendering/updating/RenderTreeUpdater.cpp:
3203         (WebCore::RenderTreeUpdater::tearDownRenderers):
3204         (WebCore::RenderTreeUpdater::tearDownTextRenderer):
3205
3206 2018-01-31  Ryosuke Niwa  <rniwa@webkit.org>
3207
3208         Release assertion in Performance::resourceTimingBufferFullTimerFired when the resource timing buffer is shrunk
3209         https://bugs.webkit.org/show_bug.cgi?id=182319
3210         <rdar://problem/36904312>
3211
3212         Reviewed by Chris Dumez.
3213
3214         The crash was caused by a wrong release assertion. Handle author scripts shrinking the resource timing buffer
3215         while resourcetimingbufferfull event is being dispatched.
3216
3217         Also fixed a bug that a superflous resourcetimingbufferfull event will be fired when new resource timing entries
3218         are queued while resourcetimingbufferfull event is being dispatched.
3219
3220         Test: http/tests/performance/performance-resource-timing-resourcetimingbufferfull-queue-resource-entry.html
3221               http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash.html
3222
3223         * page/Performance.cpp:
3224         (WebCore::Performance::resourceTimingBufferFullTimerFired): 
3225
3226 2018-01-31  Youenn Fablet  <youenn@apple.com>
3227
3228         com.apple.WebKit.Storage crashing at com.apple.WebCore: WebCore::SWServerRegistration::removeClientUsingRegistration
3229         https://bugs.webkit.org/show_bug.cgi?id=182316
3230         <rdar://problem/37025976>
3231
3232         Reviewed by Chris Dumez.
3233
3234         SWServer.m_clientToControllingWorker and SWServerRegistration.m_clientsUsingRegistration might currently get out of sync.
3235         This is a defensive fix to ensure storage process will not crash in Release.
3236         We keep the ASSERT as this probably means there is an abnormal situation that other patches might fix.
3237
3238         * workers/service/server/SWServerRegistration.cpp:
3239         (WebCore::SWServerRegistration::removeClientUsingRegistration):
3240
3241 2018-01-31  Antoine Quint  <graouts@apple.com>
3242
3243         [Modern Media Controls] Turn media/modern-media-controls/start-support tests back on
3244         https://bugs.webkit.org/show_bug.cgi?id=182297
3245
3246         Reviewed by Jon Lee and Eric Carlson.
3247
3248         We identified one cause of flakiness when turning those tests back on and fix it in this patch. There would be
3249         cases where the play/pause button would never actually become visible because we would first set it as one of
3250         the buttons in the left container in the bottom controls bar before we would identify that we should show the
3251         prominent play/pause button, and then once we did, we would add it as a child to the InlineMediaControls. But,
3252         because the actual layout of the ButtonsContainer would happen in a rAF due to being a layout() method, we would
3253         remove the play/pause button from the InlineMediaControls and set it as a child of the left container even
3254         though it wasn't visible.
3255
3256         Performing the layout of a ButtonsContainer should really happen immediately when we set the buttons, so in this
3257         patch we remove the "buttons" property and clients of ButtonsContainer can simply add or remove children which
3258         will be laid out in a row. To support this, we've added two notification methods to LayoutNode, one that indicates
3259         when children have changed, didChangeChildren(), which we override in ButtonsContainer to perform a synchronous
3260         layout. The other method is willRemoveChild() which we also override in ButtonsContainer, this time to reset
3261         the "x" and "visible" properties which we set while performing layout.
3262         
3263         This fixes flakiness for media/modern-media-controls/start-support/start-support-click-to-start.html, and maybe
3264         other modern-media-controls tests that could have been affected by this unexpected behavior.
3265
3266         * Modules/modern-media-controls/controls/buttons-container.js:
3267         (ButtonsContainer.prototype.willRemoveChild):
3268         (ButtonsContainer.prototype.didChangeChildren):
3269         (ButtonsContainer.prototype.layout):
3270         (ButtonsContainer.prototype.get buttons): Deleted.
3271         (ButtonsContainer.prototype.set buttons): Deleted.
3272         * Modules/modern-media-controls/controls/inline-media-controls.js:
3273         (InlineMediaControls.prototype.layout):
3274         (InlineMediaControls.prototype._updateBottomControlsBarLabel):
3275         (InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
3276         (InlineMediaControls):
3277         * Modules/modern-media-controls/controls/layout-node.js:
3278         (LayoutNode.prototype.set children):
3279         (LayoutNode.prototype.addChild):
3280         (LayoutNode.prototype.removeChild):
3281         (LayoutNode.prototype.willRemoveChild):
3282         (LayoutNode.prototype.didChangeChildren):
3283         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
3284         (MacOSFullscreenMediaControls.prototype.layout):
3285         * Modules/modern-media-controls/media/media-controller.js: Drive-by fix to correctly set the value passed as
3286         data-auto-hide-delay on a <video> element.
3287
3288 2018-01-31  Zalan Bujtas  <zalan@apple.com>
3289
3290         [RenderTreeBuilder] Move RenderMultiColumnFlow::resolveMovedChild to RenderTreeBuilder.
3291         https://bugs.webkit.org/show_bug.cgi?id=182315
3292         <rdar://problem/37048160>
3293
3294         Reviewed by Antti Koivisto.
3295
3296         resolveMovedChild() is only called from RenderTreeBuilder.
3297
3298         No change in functionality.
3299
3300         * rendering/RenderFragmentedFlow.h:
3301         * rendering/RenderMultiColumnFlow.cpp:
3302         (WebCore::RenderMultiColumnFlow::resolveMovedChild const): Deleted.
3303         * rendering/RenderMultiColumnFlow.h:
3304         * rendering/updating/RenderTreeBuilder.cpp:
3305         (WebCore::RenderTreeBuilder::resolveMovedChildForMultiColumnFlow):
3306         * rendering/updating/RenderTreeBuilder.h:
3307         * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
3308         (WebCore::RenderTreeBuilder::BlockFlow::insertChild):
3309         * rendering/updating/RenderTreeBuilderInline.cpp:
3310         (WebCore::RenderTreeBuilder::Inline::insertChild):
3311         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
3312         (WebCore::RenderTreeBuilder::MultiColumn::resolveMovedChild):
3313         * rendering/updating/RenderTreeBuilderMultiColumn.h:
3314
3315 2018-01-31  Philippe Normand  <pnormand@igalia.com>
3316
3317         [GStreamer] Silent WebAudio buffers support
3318         https://bugs.webkit.org/show_bug.cgi?id=143869
3319
3320         Reviewed by Carlos Garcia Campos.
3321
3322         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
3323         (webKitWebAudioSrcLoop): Flag silent buffers as GAP buffers. This
3324         enables downstream elements to optimize the buffer processing.
3325
3326 2018-01-31  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3327
3328         [EME] Fix NavigatorEME::tryNextSupportedConfiguration typo
3329         https://bugs.webkit.org/show_bug.cgi?id=182324
3330
3331         Reviewed by Žan Doberšek.
3332
3333         * Modules/encryptedmedia/NavigatorEME.cpp:
3334         (WebCore::tryNextSupportedConfiguration): Fix
3335         candidateCofiguration typo.
3336
3337 2018-01-30  Fujii Hironori  <Hironori.Fujii@sony.com>
3338
3339         [WinCairo] syntheticBoldOffset makes a font with embedded bitmap fonts shown as double strike in HiDPI
3340         https://bugs.webkit.org/show_bug.cgi?id=182093
3341
3342         Reviewed by Alex Christensen.
3343
3344         WebKit draws texts doubly by shifting 1px for fonts without bold
3345         fonts but bold font is desired. This synthetic bold method draws
3346         fonts with embedded bitmap fonts look like double strike in HiDPI.
3347
3348         No new tests (Covered by the existing tests).
3349
3350         * platform/graphics/win/FontCacheWin.cpp:
3351         (WebCore::createGDIFont): Overwrite lfWeight if the desired weight
3352         is bold and matched font weight is't bold and in WinCairo port.
3353         Fix wrong indentation.
3354
3355 2018-01-30  Youenn Fablet  <youenn@apple.com> and Oleksandr Skachkov  <gskachkov@gmail.com>
3356
3357         FetchResponse should support ConsumeData callback on chunk data is received
3358         https://bugs.webkit.org/show_bug.cgi?id=181600
3359         <rdar://problem/36932547>
3360
3361         Reviewed by Alex Christensen.
3362
3363         Test: imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-respond-with-body-loaded-in-chunk.https.html
3364
3365         Apply same read-by-chunk strategy for body coming from network as for body coming from ReadableStream.
3366         Refactor to have one consumeBodyReceivedByChunk method for both cases.
3367         This allows streaming data from a service worker to WebProcess as would be done by NetworkProcess.
3368
3369         * Modules/cache/DOMCache.cpp:
3370         (WebCore::DOMCache::addAll):
3371         (WebCore::DOMCache::put):
3372         * Modules/fetch/FetchResponse.cpp:
3373         (WebCore::FetchResponse::BodyLoader::didSucceed):
3374         (WebCore::FetchResponse::BodyLoader::didReceiveData):
3375         (WebCore::FetchResponse::BodyLoader::consumeDataByChunk):
3376         (WebCore::FetchResponse::consumeBody):
3377         (WebCore::FetchResponse::consumeBodyReceivedByChunk):
3378         * Modules/fetch/FetchResponse.h:
3379         * workers/service/context/ServiceWorkerFetch.cpp:
3380         (WebCore::ServiceWorkerFetch::processResponse):
3381
3382 2018-01-30  Don Olmstead  <don.olmstead@sony.com>
3383
3384         JSExports.h should be included as <JavaScriptCore/JSExportMacros.h>
3385         https://bugs.webkit.org/show_bug.cgi?id=182312
3386
3387         Reviewed by Michael Catanzaro.
3388
3389         No new tests. No change in behavior.
3390
3391         * config.h:
3392
3393 2018-01-30  Chris Nardi  <cnardi@chromium.org>