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