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