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