d10643d95399f18243b4cec930ea6dea35e84e8e
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-08-24  Youenn Fablet  <youenn@apple.com>
2
3         libwebrtc PeerConnection::AddTrack sometimes fail
4         https://bugs.webkit.org/show_bug.cgi?id=188914
5
6         Reviewed by Eric Carlson.
7
8         AddTrack may fail so test the result and if not successful, make JS addTrack to throw an exception.
9         This makes some tests to fail now.
10         These tests should pass again when unified plan will be enabled.
11         Covered by rebased tests.
12
13         * Modules/mediastream/PeerConnectionBackend.h:
14         (WebCore::PeerConnectionBackend::notifyAddedTrack):
15         * Modules/mediastream/RTCPeerConnection.cpp:
16         (WebCore::RTCPeerConnection::addTrack):
17         (WebCore::RTCPeerConnection::addTransceiver):
18         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
19         (WebCore::LibWebRTCMediaEndpoint::addTrack):
20         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
21         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
22         (WebCore::LibWebRTCPeerConnectionBackend::notifyAddedTrack):
23         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
24
25 2018-08-24  Adrian Perez de Castro  <aperez@igalia.com>
26
27         [FreeType] Do not cast through GLib types in FontCustomPlatformDataFreeType.cpp
28         https://bugs.webkit.org/show_bug.cgi?id=188919
29
30         Reviewed by Michael Catanzaro.
31
32         No new tests needed.
33
34         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
35         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Cast
36         through "void (*)(void)" instead of GCallback to avoid the warning
37         produced by -Wcast-function-type.
38
39 2018-08-24  Andy Estes  <aestes@apple.com>
40
41         [Apple Pay] Allow $0 totals
42         https://bugs.webkit.org/show_bug.cgi?id=185150
43         <rdar://problem/39212331>
44
45         Reviewed by Dan Bernstein.
46
47         Relaxed payment request validation to allow $0 totals. This matches PassKit behavior.
48
49         Updated test cases in http/tests/ssl/applepay/.
50
51         * Modules/applepay/PaymentRequestValidator.mm:
52         (WebCore::PaymentRequestValidator::validateTotal):
53
54 2018-08-24  Frederic Wang  <fwang@igalia.com>
55
56         Remove ScrollByPrecisePixel granularity
57         https://bugs.webkit.org/show_bug.cgi?id=188915
58
59         Reviewed by Carlos Garcia Campos.
60
61         ScrollByPrecisePixel was introduced in bug 87535 and bug 91020 for Chromium Linux/Windows but
62         it is no longer used.
63
64         No new tests, behavior unchanged.
65
66         * platform/ScrollAnimatorSmooth.cpp:
67         (WebCore::ScrollAnimatorSmooth::scroll): Remove special handling for ScrollByPrecisePixel.
68         * platform/ScrollTypes.h: Remove ScrollByPrecisePixel, it is never used.
69         * platform/ScrollableArea.cpp:
70         (WebCore::ScrollableArea::scroll): Remove special handling for ScrollByPrecisePixel.
71         * platform/gtk/ScrollAnimatorGtk.cpp:
72         (WebCore::ScrollAnimatorGtk::scroll): Remove special handling for ScrollByPrecisePixel.
73
74 2018-08-24  Antti Koivisto  <antti@apple.com>
75
76         Allow creating WeakPtrs to const objects
77         https://bugs.webkit.org/show_bug.cgi?id=188785
78
79         Reviewed by Geoff Garen.
80
81         Remove some unneeded const_casts.
82
83         * css/MediaQueryEvaluator.cpp:
84         (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
85         (WebCore::MediaQueryEvaluator::evaluate const):
86         * css/MediaQueryEvaluator.h:
87         * rendering/FloatingObjects.cpp:
88         (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
89         (WebCore::ComputeFloatOffsetForFloatLayoutAdapter::ComputeFloatOffsetForFloatLayoutAdapter):
90         (WebCore::ComputeFloatOffsetForLineLayoutAdapter::ComputeFloatOffsetForLineLayoutAdapter):
91         (WebCore::FindNextFloatLogicalBottomAdapter::FindNextFloatLogicalBottomAdapter):
92         (WebCore::FloatingObjects::FloatingObjects):
93         * rendering/FloatingObjects.h:
94         (WebCore::FloatingObjects::renderer const):
95
96 2018-08-24  Zan Dobersek  <zdobersek@igalia.com>
97
98         [CoordGraphics] Move inline methods on CoordinatedGraphicsLayer out-of-line
99         https://bugs.webkit.org/show_bug.cgi?id=188916
100
101         Reviewed by Carlos Garcia Campos.
102
103         Style checker produced complaints that CoordinatedGraphicsLayer class is
104         using inline-defined methods despite the WEBCORE_EXPORT macro being used
105         for the whole class. Keep the macro where it is but instead move the
106         method definitions out-of-line.
107
108         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
109         (WebCore::CoordinatedGraphicsLayer::isCoordinatedGraphicsLayer const):
110         (WebCore::CoordinatedGraphicsLayer::id const):
111         (WebCore::CoordinatedGraphicsLayer::primaryLayerID const):
112         (WebCore::CoordinatedGraphicsLayer::usesContentsLayer const):
113         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
114
115 2018-08-24  Antti Koivisto  <antti@apple.com>
116
117         Use OptionSet::containsAny and containsAll in some more places
118         https://bugs.webkit.org/show_bug.cgi?id=188885
119
120         Reviewed by Sam Weinig.
121
122         * page/PerformanceMonitor.cpp:
123         (WebCore::PerformanceMonitor::activityStateChanged):
124         * rendering/RenderLayer.cpp:
125         (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
126         (WebCore::RenderLayer::paintLayerContents):
127         (WebCore::RenderLayer::calculateClipRects const):
128         * rendering/RenderLayerBacking.cpp:
129         (WebCore::RenderLayerBacking::~RenderLayerBacking):
130
131 2018-08-23  Simon Fraser  <simon.fraser@apple.com>
132
133         Add support for dumping GC heap snapshots, and a viewer
134         https://bugs.webkit.org/show_bug.cgi?id=186416
135
136         Reviewed by Joseph Pecoraro.
137
138         Make a way to dump information about the GC heap that is useful for looking for leaked
139         or abandoned objects. This dump is obtained (on Apple platforms) via:
140             notifyutil -p com.apple.WebKit.dumpGCHeap
141         which writes a JSON file to /tmp which can then be loaded into the viewer in Tools/GCHeapInspector.
142
143         This leverages the heap snapshot used by Web Inspector, adding an alternate format for
144         the snapshot JSON that adds additional data about objects and why they are GC roots.
145         
146         The generated bindings code is changed to include the output root reason from isReachableFromOpaqueRoots(),
147         and to implement heapSnapshot() which provides the address of the wrapped object. A new IDL attribute,
148         CustomHeapSnapshot, is used to allow custom heapSnapshot() implementations for classes like JSDocument
149         that need to decorate the heap snapshot cell data with things like the document URL.
150
151         GCController registers a notifyutil callback which gathers the debug heap snapshot, and dumps it
152         to a file in /tmp. The file path is printed out to the system log.
153
154         * bindings/js/DOMGCOutputConstraint.cpp:
155         (WebCore::DOMGCOutputConstraint::executeImpl):
156         * bindings/js/GCController.cpp:
157         (WebCore::GCController::GCController):
158         (WebCore::GCController::dumpHeap):
159         * bindings/js/GCController.h:
160         * bindings/js/JSCSSRuleListCustom.cpp:
161         (WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
162         * bindings/js/JSCallbackData.cpp:
163         (WebCore::JSCallbackDataWeak::WeakOwner::isReachableFromOpaqueRoots):
164         * bindings/js/JSCallbackData.h:
165         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
166         (WebCore::JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
167         * bindings/js/JSDOMWindowCustom.cpp:
168         (WebCore::JSDOMWindow::getOwnPropertySlot):
169         (WebCore::JSDOMWindow::heapSnapshot):
170         * bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
171         (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
172         * bindings/js/JSDocumentCustom.cpp:
173         (WebCore::JSDocument::heapSnapshot):
174         * bindings/js/JSMicrotaskCallback.h:
175         (WebCore::JSMicrotaskCallback::call):
176         * bindings/js/JSMutationObserverCustom.cpp:
177         (WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots):
178         * bindings/js/JSNavigatorCustom.cpp:
179         (WebCore::JSNavigator::visitAdditionalChildren):
180         * bindings/js/JSNodeCustom.cpp:
181         (WebCore::isReachableFromDOM):
182         (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
183         * bindings/js/JSNodeListCustom.cpp:
184         (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
185         * bindings/js/JSOffscreenCanvasRenderingContext2DCustom.cpp:
186         (WebCore::JSOffscreenCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
187         * bindings/js/JSPerformanceObserverCustom.cpp:
188         (WebCore::JSPerformanceObserverOwner::isReachableFromOpaqueRoots):
189         * bindings/js/JSPopStateEventCustom.cpp:
190         * bindings/js/JSTextTrackCueCustom.cpp:
191         (WebCore::JSTextTrackCueOwner::isReachableFromOpaqueRoots):
192         * bindings/js/WebCoreTypedArrayController.cpp:
193         (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots):
194         * bindings/js/WebCoreTypedArrayController.h:
195         * bindings/scripts/CodeGeneratorJS.pm:
196         (GenerateHeader):
197         (GenerateImplementation):
198         * bindings/scripts/IDLAttributes.json:
199         * bindings/scripts/test/JS/JSInterfaceName.cpp:
200         (WebCore::JSInterfaceName::heapSnapshot):
201         (WebCore::JSInterfaceNameOwner::isReachableFromOpaqueRoots):
202         * bindings/scripts/test/JS/JSInterfaceName.h:
203         * bindings/scripts/test/JS/JSMapLike.cpp:
204         (WebCore::JSMapLike::heapSnapshot):
205         (WebCore::JSMapLikeOwner::isReachableFromOpaqueRoots):
206         * bindings/scripts/test/JS/JSMapLike.h:
207         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
208         (WebCore::JSReadOnlyMapLike::heapSnapshot):
209         (WebCore::JSReadOnlyMapLikeOwner::isReachableFromOpaqueRoots):
210         * bindings/scripts/test/JS/JSReadOnlyMapLike.h:
211         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
212         (WebCore::JSTestActiveDOMObject::heapSnapshot):
213         (WebCore::JSTestActiveDOMObjectOwner::isReachableFromOpaqueRoots):
214         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
215         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
216         (WebCore::JSTestCEReactions::heapSnapshot):
217         (WebCore::JSTestCEReactionsOwner::isReachableFromOpaqueRoots):
218         * bindings/scripts/test/JS/JSTestCEReactions.h:
219         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
220         (WebCore::JSTestCEReactionsStringifier::heapSnapshot):
221         (WebCore::JSTestCEReactionsStringifierOwner::isReachableFromOpaqueRoots):
222         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h:
223         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
224         (WebCore::JSTestCallTracer::heapSnapshot):
225         (WebCore::JSTestCallTracerOwner::isReachableFromOpaqueRoots):
226         * bindings/scripts/test/JS/JSTestCallTracer.h:
227         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
228         (WebCore::JSTestClassWithJSBuiltinConstructor::heapSnapshot):
229         (WebCore::JSTestClassWithJSBuiltinConstructorOwner::isReachableFromOpaqueRoots):
230         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
231         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
232         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::heapSnapshot):
233         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots):
234         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
235         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
236         (WebCore::JSTestDOMJIT::heapSnapshot):
237         * bindings/scripts/test/JS/JSTestDOMJIT.h:
238         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
239         (WebCore::JSTestEnabledBySetting::heapSnapshot):
240         (WebCore::JSTestEnabledBySettingOwner::isReachableFromOpaqueRoots):
241         * bindings/scripts/test/JS/JSTestEnabledBySetting.h:
242         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
243         (WebCore::JSTestEventConstructor::heapSnapshot):
244         * bindings/scripts/test/JS/JSTestEventConstructor.h:
245         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
246         (WebCore::JSTestEventTarget::heapSnapshot):
247         * bindings/scripts/test/JS/JSTestEventTarget.h:
248         * bindings/scripts/test/JS/JSTestException.cpp:
249         (WebCore::JSTestException::heapSnapshot):
250         (WebCore::JSTestExceptionOwner::isReachableFromOpaqueRoots):
251         * bindings/scripts/test/JS/JSTestException.h:
252         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
253         (WebCore::JSTestGenerateIsReachable::heapSnapshot):
254         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
255         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
256         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
257         (WebCore::JSTestGlobalObject::heapSnapshot):
258         (WebCore::JSTestGlobalObjectOwner::isReachableFromOpaqueRoots):
259         * bindings/scripts/test/JS/JSTestGlobalObject.h:
260         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
261         (WebCore::JSTestIndexedSetterNoIdentifier::heapSnapshot):
262         (WebCore::JSTestIndexedSetterNoIdentifierOwner::isReachableFromOpaqueRoots):
263         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h:
264         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
265         (WebCore::JSTestIndexedSetterThrowingException::heapSnapshot):
266         (WebCore::JSTestIndexedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots):
267         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h:
268         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
269         (WebCore::JSTestIndexedSetterWithIdentifier::heapSnapshot):
270         (WebCore::JSTestIndexedSetterWithIdentifierOwner::isReachableFromOpaqueRoots):
271         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h:
272         * bindings/scripts/test/JS/JSTestInterface.cpp:
273         (WebCore::JSTestInterface::heapSnapshot):
274         (WebCore::JSTestInterfaceOwner::isReachableFromOpaqueRoots):
275         * bindings/scripts/test/JS/JSTestInterface.h:
276         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
277         (WebCore::JSTestInterfaceLeadingUnderscore::heapSnapshot):
278         (WebCore::JSTestInterfaceLeadingUnderscoreOwner::isReachableFromOpaqueRoots):
279         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h:
280         * bindings/scripts/test/JS/JSTestIterable.cpp:
281         (WebCore::JSTestIterable::heapSnapshot):
282         (WebCore::JSTestIterableOwner::isReachableFromOpaqueRoots):
283         * bindings/scripts/test/JS/JSTestIterable.h:
284         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
285         (WebCore::JSTestMediaQueryListListener::heapSnapshot):
286         (WebCore::JSTestMediaQueryListListenerOwner::isReachableFromOpaqueRoots):
287         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
288         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
289         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::heapSnapshot):
290         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierOwner::isReachableFromOpaqueRoots):
291         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h:
292         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
293         (WebCore::JSTestNamedAndIndexedSetterThrowingException::heapSnapshot):
294         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots):
295         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h:
296         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
297         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::heapSnapshot):
298         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierOwner::isReachableFromOpaqueRoots):
299         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h:
300         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
301         (WebCore::JSTestNamedConstructor::heapSnapshot):
302         (WebCore::JSTestNamedConstructorOwner::isReachableFromOpaqueRoots):
303         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
304         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
305         (WebCore::JSTestNamedDeleterNoIdentifier::heapSnapshot):
306         (WebCore::JSTestNamedDeleterNoIdentifierOwner::isReachableFromOpaqueRoots):
307         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
308         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
309         (WebCore::JSTestNamedDeleterThrowingException::heapSnapshot):
310         (WebCore::JSTestNamedDeleterThrowingExceptionOwner::isReachableFromOpaqueRoots):
311         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
312         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
313         (WebCore::JSTestNamedDeleterWithIdentifier::heapSnapshot):
314         (WebCore::JSTestNamedDeleterWithIdentifierOwner::isReachableFromOpaqueRoots):
315         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
316         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
317         (WebCore::JSTestNamedDeleterWithIndexedGetter::heapSnapshot):
318         (WebCore::JSTestNamedDeleterWithIndexedGetterOwner::isReachableFromOpaqueRoots):
319         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
320         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
321         (WebCore::JSTestNamedGetterCallWith::heapSnapshot):
322         (WebCore::JSTestNamedGetterCallWithOwner::isReachableFromOpaqueRoots):
323         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h:
324         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
325         (WebCore::JSTestNamedGetterNoIdentifier::heapSnapshot):
326         (WebCore::JSTestNamedGetterNoIdentifierOwner::isReachableFromOpaqueRoots):
327         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h:
328         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
329         (WebCore::JSTestNamedGetterWithIdentifier::heapSnapshot):
330         (WebCore::JSTestNamedGetterWithIdentifierOwner::isReachableFromOpaqueRoots):
331         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h:
332         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
333         (WebCore::JSTestNamedSetterNoIdentifier::heapSnapshot):
334         (WebCore::JSTestNamedSetterNoIdentifierOwner::isReachableFromOpaqueRoots):
335         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h:
336         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
337         (WebCore::JSTestNamedSetterThrowingException::heapSnapshot):
338         (WebCore::JSTestNamedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots):
339         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h:
340         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
341         (WebCore::JSTestNamedSetterWithIdentifier::heapSnapshot):
342         (WebCore::JSTestNamedSetterWithIdentifierOwner::isReachableFromOpaqueRoots):
343         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h:
344         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
345         (WebCore::JSTestNamedSetterWithIndexedGetter::heapSnapshot):
346         (WebCore::JSTestNamedSetterWithIndexedGetterOwner::isReachableFromOpaqueRoots):
347         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h:
348         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
349         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::heapSnapshot):
350         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterOwner::isReachableFromOpaqueRoots):
351         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h:
352         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
353         (WebCore::JSTestNamedSetterWithOverrideBuiltins::heapSnapshot):
354         (WebCore::JSTestNamedSetterWithOverrideBuiltinsOwner::isReachableFromOpaqueRoots):
355         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h:
356         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
357         (WebCore::JSTestNamedSetterWithUnforgableProperties::heapSnapshot):
358         (WebCore::JSTestNamedSetterWithUnforgablePropertiesOwner::isReachableFromOpaqueRoots):
359         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h:
360         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
361         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::heapSnapshot):
362         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsOwner::isReachableFromOpaqueRoots):
363         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
364         * bindings/scripts/test/JS/JSTestNode.cpp:
365         (WebCore::JSTestNode::heapSnapshot):
366         * bindings/scripts/test/JS/JSTestNode.h:
367         * bindings/scripts/test/JS/JSTestObj.cpp:
368         (WebCore::JSTestObj::heapSnapshot):
369         (WebCore::JSTestObjOwner::isReachableFromOpaqueRoots):
370         * bindings/scripts/test/JS/JSTestObj.h:
371         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
372         (WebCore::JSTestOverloadedConstructors::heapSnapshot):
373         (WebCore::JSTestOverloadedConstructorsOwner::isReachableFromOpaqueRoots):
374         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
375         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
376         (WebCore::JSTestOverloadedConstructorsWithSequence::heapSnapshot):
377         (WebCore::JSTestOverloadedConstructorsWithSequenceOwner::isReachableFromOpaqueRoots):
378         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
379         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
380         (WebCore::JSTestOverrideBuiltins::heapSnapshot):
381         (WebCore::JSTestOverrideBuiltinsOwner::isReachableFromOpaqueRoots):
382         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
383         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
384         (WebCore::JSTestPluginInterface::heapSnapshot):
385         (WebCore::JSTestPluginInterfaceOwner::isReachableFromOpaqueRoots):
386         * bindings/scripts/test/JS/JSTestPluginInterface.h:
387         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
388         (WebCore::JSTestPromiseRejectionEvent::heapSnapshot):
389         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h:
390         * bindings/scripts/test/JS/JSTestSerialization.cpp:
391         (WebCore::JSTestSerialization::heapSnapshot):
392         (WebCore::JSTestSerializationOwner::isReachableFromOpaqueRoots):
393         * bindings/scripts/test/JS/JSTestSerialization.h:
394         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
395         (WebCore::JSTestSerializationIndirectInheritance::heapSnapshot):
396         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h:
397         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
398         (WebCore::JSTestSerializationInherit::heapSnapshot):
399         * bindings/scripts/test/JS/JSTestSerializationInherit.h:
400         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
401         (WebCore::JSTestSerializationInheritFinal::heapSnapshot):
402         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h:
403         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
404         (WebCore::JSTestSerializedScriptValueInterface::heapSnapshot):
405         (WebCore::JSTestSerializedScriptValueInterfaceOwner::isReachableFromOpaqueRoots):
406         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
407         * bindings/scripts/test/JS/JSTestStringifier.cpp:
408         (WebCore::JSTestStringifier::heapSnapshot):
409         (WebCore::JSTestStringifierOwner::isReachableFromOpaqueRoots):
410         * bindings/scripts/test/JS/JSTestStringifier.h:
411         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
412         (WebCore::JSTestStringifierAnonymousOperation::heapSnapshot):
413         (WebCore::JSTestStringifierAnonymousOperationOwner::isReachableFromOpaqueRoots):
414         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.h:
415         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
416         (WebCore::JSTestStringifierNamedOperation::heapSnapshot):
417         (WebCore::JSTestStringifierNamedOperationOwner::isReachableFromOpaqueRoots):
418         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.h:
419         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
420         (WebCore::JSTestStringifierOperationImplementedAs::heapSnapshot):
421         (WebCore::JSTestStringifierOperationImplementedAsOwner::isReachableFromOpaqueRoots):
422         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.h:
423         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
424         (WebCore::JSTestStringifierOperationNamedToString::heapSnapshot):
425         (WebCore::JSTestStringifierOperationNamedToStringOwner::isReachableFromOpaqueRoots):
426         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.h:
427         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
428         (WebCore::JSTestStringifierReadOnlyAttribute::heapSnapshot):
429         (WebCore::JSTestStringifierReadOnlyAttributeOwner::isReachableFromOpaqueRoots):
430         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.h:
431         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
432         (WebCore::JSTestStringifierReadWriteAttribute::heapSnapshot):
433         (WebCore::JSTestStringifierReadWriteAttributeOwner::isReachableFromOpaqueRoots):
434         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.h:
435         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
436         (WebCore::JSTestTypedefs::heapSnapshot):
437         (WebCore::JSTestTypedefsOwner::isReachableFromOpaqueRoots):
438         * bindings/scripts/test/JS/JSTestTypedefs.h:
439         * dom/Document.idl:
440         * page/DOMWindow.idl:
441
442 2018-08-23  Ryosuke Niwa  <rniwa@webkit.org>
443
444         initKeyboardEvent doesn't clear CapsLock state
445         https://bugs.webkit.org/show_bug.cgi?id=188909
446
447         Reviewed by Wenson Hsieh.
448
449         Fixed the bug by not preserving CapsLock state in setModifierKeys variant which takes boolean
450         for altGraphKey, which is only called by KeyboardEvent::initKeyboardEvent.
451
452         Test: fast/events/init-event-clears-capslock.html
453
454         * dom/UIEventWithKeyState.h:
455         (WebCore::UIEventWithKeyState::setModifierKeys):
456
457 2018-08-23  Aditya Keerthi  <akeerthi@apple.com>
458
459         Unreviewed, fix the Windows build after r235245.
460
461         * html/InputMode.cpp:
462         (WebCore::stringForInputMode):
463
464 2018-08-23  Saam barati  <sbarati@apple.com>
465
466         JSRunLoopTimer may run part of a member function after it's destroyed
467         https://bugs.webkit.org/show_bug.cgi?id=188426
468
469         Reviewed by Mark Lam.
470
471         * page/cocoa/ResourceUsageThreadCocoa.mm:
472         (WebCore::ResourceUsageThread::platformThreadBody):
473         * page/linux/ResourceUsageThreadLinux.cpp:
474         (WebCore::ResourceUsageThread::platformThreadBody):
475
476 2018-08-23  David Fenton  <david_fenton@apple.com>
477
478         Unreviewed, rolling out r235129.
479
480         broke internal builds
481
482         Reverted changeset:
483
484         "Allow creating WeakPtrs to const objects"
485         https://bugs.webkit.org/show_bug.cgi?id=188785
486         https://trac.webkit.org/changeset/235129
487
488 2018-08-23  Daniel Bates  <dabates@apple.com>
489
490         [iOS] Test editing/undo/replace-text-in-node-preserving-markers-crash.html crashes
491         https://bugs.webkit.org/show_bug.cgi?id=188898
492
493         Reviewed by Simon Fraser.
494
495         Not all document markers may have a dictation metadata on iOS.
496
497         Currently we assume that every marker has dictation alternatives (i.e. DocumentMarker::alternatives()
498         can be called) when deleting a selection preserving document markers on iOS. However, only markers
499         for dictation may have dictation alternatives. For example, document markers for misspelled words do
500         not have dictation metadata by definition. Instead of assuming every marker has dictation alternatives
501         on iOS we need to check the marker type to determine whether it has associated dictation metadata and
502         invoke the appropriate DocumentMarkerController::addMarker() overload.
503
504         * dom/DocumentMarker.h:
505         (WebCore::DocumentMarker::isDictation const): Added.
506         * editing/CompositeEditCommand.cpp:
507         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): Only access DocumentMarker::alternatives()
508         and add a dictation marker on iOS if the marker is a dictation marker.
509
510 2018-08-23  Mark Lam  <mark.lam@apple.com>
511
512         Move vmEntryGlobalObject() to VM from CallFrame.
513         https://bugs.webkit.org/show_bug.cgi?id=188900
514         <rdar://problem/43655753>
515
516         Reviewed by Michael Saboff.
517
518         No new tests needed because this patch does not introduce new functionality.
519
520         * bindings/js/JSCustomXPathNSResolver.cpp:
521         (WebCore::JSCustomXPathNSResolver::create):
522         * bindings/js/JSDOMGlobalObject.cpp:
523         (WebCore::callerGlobalObject):
524         (WebCore::toJSDOMGlobalObject): Deleted.
525         * bindings/js/JSDOMWindowBase.cpp:
526         (WebCore::firstDOMWindow):
527         * bridge/c/c_utility.cpp:
528         (JSC::Bindings::convertValueToNPVariant):
529         * bridge/objc/WebScriptObject.mm:
530         (WebCore::addExceptionToConsole):
531         * bridge/objc/objc_instance.mm:
532         (ObjcInstance::moveGlobalExceptionToExecState):
533         * bridge/objc/objc_runtime.mm:
534         (JSC::Bindings::convertValueToObjcObject):
535         * bridge/objc/objc_utility.mm:
536         (JSC::Bindings::convertValueToObjcValue):
537         * testing/Internals.cpp:
538         (WebCore::Internals::cloneArrayBuffer):
539
540 2018-08-23  Andy Estes  <aestes@apple.com>
541
542         [Apple Pay] Introduce Apple Pay JS v4 on iOS 12 and macOS Mojave
543         https://bugs.webkit.org/show_bug.cgi?id=188829
544
545         Reviewed by Tim Horton.
546
547         Test: http/tests/ssl/applepay/ApplePaySessionV4.html
548
549         * Configurations/FeatureDefines.xcconfig:
550         * testing/MockPaymentCoordinator.cpp:
551         (WebCore::MockPaymentCoordinator::supportsVersion):
552
553 2018-08-23  Devin Rousso  <drousso@apple.com>
554
555         Web Inspector: support breakpoints for timers and animation-frame events
556         https://bugs.webkit.org/show_bug.cgi?id=188778
557
558         Reviewed by Brian Burg.
559
560         The original implementation of "instrumentation" breakpoints relied upon the frontend
561         sending somewhat arbitrary strings when enabling breakpoints for specific events. As an
562         example, setting a breakpoint for `requestAnimationFrame` expects `"animationFrameFired"`
563         as the string, which doesn't make much sense. This patch removes the usage of these strings
564         and instead expects the agent to implement a method that matches what is happening.
565
566         Tests: inspector/dom-debugger/event-animation-frame-breakpoints.html
567                inspector/dom-debugger/event-listener-breakpoints.html
568                inspector/dom-debugger/event-timer-breakpoints.html
569
570         * inspector/InspectorInstrumentation.h:
571         (WebCore::InspectorInstrumentation::willFireTimer):
572         * inspector/InspectorInstrumentation.cpp:
573         (WebCore::InspectorInstrumentation::didInstallTimerImpl):
574         (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
575         (WebCore::InspectorInstrumentation::willFireTimerImpl):
576         (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
577         (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
578         (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
579         (WebCore::InspectorInstrumentation::pauseOnNativeEventIfNeeded): Deleted.
580
581         * inspector/agents/InspectorDOMDebuggerAgent.h:
582         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
583         (WebCore::InspectorDOMDebuggerAgent::setEventBreakpoint): Added.
584         (WebCore::InspectorDOMDebuggerAgent::removeEventBreakpoint): Added.
585         (WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
586         (WebCore::InspectorDOMDebuggerAgent::willFireTimer): Added.
587         (WebCore::InspectorDOMDebuggerAgent::willFireAnimationFrame): Added.
588         (WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint): Deleted.
589         (WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint): Deleted.
590         (WebCore::InspectorDOMDebuggerAgent::setBreakpoint): Deleted.
591         (WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint): Deleted.
592         (WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint): Deleted.
593         (WebCore::InspectorDOMDebuggerAgent::removeBreakpoint): Deleted.
594         (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded): Deleted.
595         Unify the event listener and instrumentation breakpoint commands into a single method,
596         `setEventBreakpoint`, that takes in both an `EventBreakpointType` and `eventName`.
597
598         * page/DOMTimer.cpp:
599         (WebCore::DOMTimer::fired):
600
601 2018-08-23  Aditya Keerthi  <akeerthi@apple.com>
602
603         [iOS] Support the inputmode attribute on contenteditable elements
604         https://bugs.webkit.org/show_bug.cgi?id=188878
605
606         Reviewed by Ryosuke Niwa.
607
608         The inputmode attribute should apply to contenteditable elements, in addition to
609         textfield inputs and textareas.
610
611         Moved the inputmode attribute from HTMLInputElement.idl and
612         HTMLTextAreaElement.idl to HTMLElement.idl to reflect the specification.
613
614         Also moved all logic to convert between the InputMode enum and string values
615         into InputMode.cpp to avoid exposing unnecessary details to WebKit. Furthermore,
616         InputMode::Auto was renamed to InputMode::Unspecified to avoid confusion with the
617         specification.
618
619         Spec: https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute
620
621         Tests: fast/forms/inputmode-attribute-contenteditable.html
622                fast/forms/inputmode-attribute-input.html
623                fast/forms/inputmode-attribute-textarea.html
624
625         * Sources.txt:
626         * WebCore.xcodeproj/project.pbxproj:
627         * html/HTMLElement.cpp:
628         (WebCore::HTMLElement::canonicalInputMode const):
629         (WebCore::HTMLElement::inputMode const):
630         (WebCore::HTMLElement::setInputMode):
631         * html/HTMLElement.h:
632         * html/HTMLElement.idl:
633         * html/HTMLInputElement.idl:
634         * html/HTMLTextAreaElement.idl:
635         * html/HTMLTextFormControlElement.cpp:
636         * html/HTMLTextFormControlElement.h:
637         * html/InputMode.cpp: Renamed from Source/WebCore/html/InputModeNames.cpp.
638         (WebCore::inputModeForAttributeValue):
639         (WebCore::stringForInputMode):
640         * html/InputMode.h: Renamed from Source/WebCore/html/InputModeNames.h.
641
642 2018-08-23  Eric Carlson  <eric.carlson@apple.com>
643
644         [MediaStream] Store video preset sizes in a map
645         https://bugs.webkit.org/show_bug.cgi?id=188866
646         <rdar://problem/43622643>
647
648         Reviewed by Youenn Fablet.
649
650         No new tests, tested manually.
651
652         * platform/mediastream/mac/AVVideoCaptureSource.h:
653         * platform/mediastream/mac/AVVideoCaptureSource.mm:
654         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
655         (WebCore::AVVideoCaptureSource::initializeCapabilities):
656         (WebCore::AVVideoCaptureSource::sizeForPreset):
657         (WebCore::AVVideoCaptureSource::setPreset):
658         (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions):
659         (WebCore::sizeForPreset): Deleted.
660         (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions const): Deleted.
661
662 2018-08-23  Ryan Haddad  <ryanhaddad@apple.com>
663
664         Unreviewed, attempt to fix the build after r235230.
665
666         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
667
668 2018-08-23  Youenn Fablet  <youenn@apple.com>
669
670         Update libwebrtc up to 984f1a80c0
671         https://bugs.webkit.org/show_bug.cgi?id=188745
672         <rdar://problem/43539177>
673
674         Reviewed by Eric Carlson.
675
676         Updated implementation according new webrtc backend.
677         Instead of modifying libwebrtc header files, we disable unused parameter warning for such headers included in WebCore.
678         WebCore implementation is updated according new webrtc API, mostly AddRef/Release.
679         RealtimeOutgoingVideoSource now uses a pixel convolver to convert RGB pixel buffers as I420.
680
681         Covered by existing tests.
682
683         * CMakeLists.txt:
684         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
685         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
686         (WebCore::LibWebRTCMediaEndpoint::addTrack):
687         (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
688         (WebCore::fillEncodingParameters):
689         (WebCore::fillRtpParameters):
690         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
691         (WebCore::LibWebRTCMediaEndpoint::Release const):
692         * WebCore.xcodeproj/project.pbxproj:
693         * platform/mediastream/RealtimeIncomingAudioSource.h:
694         * platform/mediastream/RealtimeIncomingVideoSource.h:
695         * platform/mediastream/RealtimeMediaSource.cpp:
696         (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate):
697         (WebCore::RealtimeMediaSource::supportsConstraint const):
698         (WebCore::RealtimeMediaSource::supportsConstraints):
699         * platform/mediastream/RealtimeOutgoingAudioSource.h:
700         * platform/mediastream/RealtimeOutgoingVideoSource.h:
701         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
702         (WebCore::GStreamerVideoDecoder::newSampleCallback):
703         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
704         (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
705         (WebCore::GStreamerVideoEncoder::newSampleCallback):
706         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
707         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
708         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
709         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
710         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
711         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
712         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
713         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
714         (WebCore::ConvertToI420):
715         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
716         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
717         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm: Added.
718         (WebCore::RealtimeOutgoingVideoSourceCocoa::convertToYUV):
719         * testing/MockLibWebRTCPeerConnection.cpp:
720         (WebCore::MockLibWebRTCPeerConnection::AddTrack):
721         * testing/MockLibWebRTCPeerConnection.h:
722         (WebCore::MockRtpSender::GetParameters):
723         (WebCore::MockRtpSender::SetParameters):
724
725 2018-08-23  Wenson Hsieh  <wenson_hsieh@apple.com>
726
727         [Attachment Support] Attachment elements don't appear in drag images on macOS
728         https://bugs.webkit.org/show_bug.cgi?id=188823
729         <rdar://problem/43616378>
730
731         Reviewed by Tim Horton.
732
733         Currently, attachment elements don't show up in the drag image snapshot on macOS. This is because only the
734         "Selection" phase is painted when generating a drag image on macOS, and many replaced renderers (with some
735         exceptions, such as RenderImage) only paint visible content during the "Foreground" phase. To fix this, we
736         override RenderAttachment::paintReplaced to paint the attachment in the case where the Selection phase is being
737         painted.
738
739         Tests:  WKAttachmentTestsMac.DragAttachmentAsFilePromise
740                 WKAttachmentTests.MoveAttachmentElementAsIconByDragging
741
742         * rendering/RenderAttachment.cpp:
743         (WebCore::RenderAttachment::paintReplaced):
744         * rendering/RenderAttachment.h:
745         * rendering/RenderThemeMac.mm:
746         (WebCore::titleTextColorForAttachment):
747         (WebCore::AttachmentLayout::layOutTitle):
748
749         Plumb an AttachmentLayoutStyle (i.e. NonSelected or Selected) to AttachmentLayout, and use this bit when
750         determining the title text color, as well whether to paint backgrounds for the icon and title.
751
752         (WebCore::AttachmentLayout::AttachmentLayout):
753         (WebCore::RenderThemeMac::attachmentIntrinsicSize const):
754         (WebCore::RenderThemeMac::attachmentBaseline const):
755         (WebCore::paintAttachmentIconBackground):
756         (WebCore::paintAttachmentTitleBackground):
757
758         Bail from painting backgrounds if a selected style is used for the attachment.
759
760         (WebCore::RenderThemeMac::paintAttachment):
761
762         Rather than check the RenderAttachment's selection state when determining whether to paint with a non-selected
763         or selected style, only use selected style if the RenderAttachment has a selection _and_ the painting phase is
764         not "Selection". While this sounds extremely counter-intuitive, the "Selection" painting phase refers to
765         painting the selected foreground content _without_ including any part of the selection highlight.
766
767 2018-08-23  Zalan Bujtas  <zalan@apple.com>
768
769         [LFC][Floating] Decouple the incoming floats and floats already placed in the list
770         https://bugs.webkit.org/show_bug.cgi?id=188886
771
772         Reviewed by Antti Koivisto.
773
774         This is in preparation for the float avoidance feature where formatting context root boxes avoid existing floats.
775
776         1. Introduce FloatBox class for the incoming floats (This will need to be renamed when adding support for avoidance -incoming box is actually not a float).
777         2. Use the existing FloatState::FloatItem class for placed floats.
778
779         * Sources.txt:
780         * WebCore.xcodeproj/project.pbxproj:
781         * layout/LayoutUnits.h:
782         * layout/Verification.cpp:
783         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
784         * layout/displaytree/DisplayBox.h:
785         * layout/floats/FloatBox.cpp: Added.
786         (WebCore::Layout::FloatBox::FloatBox):
787         (WebCore::Layout::FloatBox::initializePosition):
788         (WebCore::Layout::FloatBox::isLeftAligned const):
789         (WebCore::Layout::FloatBox::setLeft):
790         (WebCore::Layout::FloatBox::setTopLeft):
791         (WebCore::Layout::FloatBox::resetVertically):
792         (WebCore::Layout::FloatBox::resetHorizontally):
793         (WebCore::Layout::FloatBox::topLeftInContainingBlock const):
794         * layout/floats/FloatBox.h: Copied from Source/WebCore/layout/floats/FloatingContext.h.
795         (WebCore::Layout::FloatBox::top const):
796         (WebCore::Layout::FloatBox::left const):
797         (WebCore::Layout::FloatBox::marginTop const):
798         (WebCore::Layout::FloatBox::marginLeft const):
799         (WebCore::Layout::FloatBox::marginBottom const):
800         (WebCore::Layout::FloatBox::marginRight const):
801         (WebCore::Layout::FloatBox::rectWithMargin const):
802         (WebCore::Layout::FloatBox::setTop):
803         * layout/floats/FloatingContext.cpp:
804         (WebCore::Layout::FloatingPair::verticalPosition const):
805         (WebCore::Layout::begin):
806         (WebCore::Layout::FloatingContext::positionForFloat const):
807         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
808         (WebCore::Layout::FloatingContext::floatingPosition const):
809         (WebCore::Layout::FloatingPair::horiztonalPosition const):
810         (WebCore::Layout::FloatingPair::bottom const):
811         (WebCore::Layout::Iterator::Iterator):
812         (WebCore::Layout::Iterator::operator++):
813         (WebCore::Layout::Iterator::set):
814         (WebCore::Layout::FloatingContext::initialVerticalPosition const): Deleted.
815         (WebCore::Layout::FloatingContext::alignWithContainingBlock const): Deleted.
816         (WebCore::Layout::FloatingContext::alignWithFloatings const): Deleted.
817         (WebCore::Layout::FloatingContext::toContainingBlock const): Deleted.
818         * layout/floats/FloatingContext.h:
819         * layout/floats/FloatingState.h:
820         (WebCore::Layout::FloatingState::root const):
821         (WebCore::Layout::FloatingState::layoutContext const):
822
823 2018-08-23  Zan Dobersek  <zdobersek@igalia.com>
824
825         [CoordGraphics] Remove the remaining CoordinatedGraphicsLayerState cruft
826         https://bugs.webkit.org/show_bug.cgi?id=188881
827
828         Reviewed by Carlos Garcia Campos.
829
830         Remove what's left of CoordinatedGraphicsLayerState usage in the
831         CoordinatedGraphics subsystem. In CoordinatedGraphicsLayer, this means
832         dropping the m_layerState member variable since at this point it is not
833         used anymore in any capacity. Affected helper methods and member
834         variables are also removed where possible.
835
836         The syncLayerState() method on the CoordinatedGraphicsLayerClient
837         interface is adjusted to not accept any parameters. Client should just
838         mark frame synchronization as required while the layer state is now
839         managed differently.
840
841         Instead of the CoordinatedLayerID (which is removed) the
842         Nicosia::PlatformLayer::LayerID alias is introduced as a layer ID type,
843         aliased to the uint64_t type.
844
845         CoordinatedGraphicsState.h file is rid of all structs except the
846         basic CoordinatedGraphicsState struct that at this point contains only
847         a reference to the Nicosia::Scene object. This will be further
848         simplified in the patches that follow.
849
850         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
851         (Nicosia::PlatformLayer::id const):
852         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
853         (WebCore::CoordinatedGraphicsLayer::didChangeAnimations):
854         (WebCore::CoordinatedGraphicsLayer::didChangeChildren):
855         (WebCore::CoordinatedGraphicsLayer::didChangeFilters):
856         (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers):
857         (WebCore::CoordinatedGraphicsLayer::didChangeGeometry):
858         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
859         (WebCore::CoordinatedGraphicsLayer::setPosition):
860         (WebCore::CoordinatedGraphicsLayer::setAnchorPoint):
861         (WebCore::CoordinatedGraphicsLayer::setSize):
862         (WebCore::CoordinatedGraphicsLayer::setTransform):
863         (WebCore::CoordinatedGraphicsLayer::setChildrenTransform):
864         (WebCore::CoordinatedGraphicsLayer::setPreserves3D):
865         (WebCore::CoordinatedGraphicsLayer::setMasksToBounds):
866         (WebCore::CoordinatedGraphicsLayer::setDrawsContent):
867         (WebCore::CoordinatedGraphicsLayer::setContentsVisible):
868         (WebCore::CoordinatedGraphicsLayer::setContentsOpaque):
869         (WebCore::CoordinatedGraphicsLayer::setBackfaceVisibility):
870         (WebCore::CoordinatedGraphicsLayer::setOpacity):
871         (WebCore::CoordinatedGraphicsLayer::setContentsRect):
872         (WebCore::CoordinatedGraphicsLayer::setContentsTileSize):
873         (WebCore::CoordinatedGraphicsLayer::setContentsTilePhase):
874         (WebCore::CoordinatedGraphicsLayer::setContentsToSolidColor):
875         (WebCore::CoordinatedGraphicsLayer::setShowDebugBorder):
876         (WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
877         (WebCore::CoordinatedGraphicsLayer::setMaskLayer):
878         (WebCore::CoordinatedGraphicsLayer::setReplicatedByLayer):
879         (WebCore::CoordinatedGraphicsLayer::setNeedsDisplay):
880         (WebCore::CoordinatedGraphicsLayer::setNeedsDisplayInRect):
881         (WebCore::CoordinatedGraphicsLayer::setDebugBorder):
882         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
883         (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
884         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
885         (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
886         (WebCore::toCoordinatedLayerID): Deleted.
887         (WebCore::CoordinatedGraphicsLayer::didChangeLayerState): Deleted.
888         (WebCore::CoordinatedGraphicsLayer::syncChildren): Deleted.
889         (WebCore::CoordinatedGraphicsLayer::syncFilters): Deleted.
890         (WebCore::CoordinatedGraphicsLayer::syncLayerState): Deleted.
891         (WebCore::CoordinatedGraphicsLayer::syncAnimations): Deleted.
892         (WebCore::CoordinatedGraphicsLayer::resetLayerState): Deleted.
893         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
894         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
895         (): Deleted.
896         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState): Deleted.
897         (WebCore::CoordinatedGraphicsLayerState::hasPendingChanges const): Deleted.
898
899 2018-08-22  Zan Dobersek  <zdobersek@igalia.com>
900
901         [CoordGraphics] Drop old-school PlatformLayer management in CoordinatedGraphicsLayer
902         https://bugs.webkit.org/show_bug.cgi?id=188850
903
904         Reviewed by Michael Catanzaro.
905
906         Remove the m_platformLayer member from the CoordinatedGraphicsLayer
907         class as it's been unused since the rework in r235165.
908
909         The CoordinatedGraphicsLayer::syncPlatformLayer() helper method and the
910         related member variable can both be removed as well. On the
911         CoordinatedGraphicsLayerState class, we can remove the obsolete
912         flags and the TextureMapperPlatformLayerProxy member variable that's
913         unused now that such objects are handled through the Nicosia impl class.
914
915         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
916         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
917         (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
918         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
919         (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
920         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
921         (WebCore::CoordinatedGraphicsLayer::syncPlatformLayer): Deleted.
922         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
923         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
924         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
925
926 2018-08-22  Zan Dobersek  <zdobersek@igalia.com>
927
928         [CoordGraphics] Remove TiledBackingStoreClient inheritance from CoordinatedGraphicsLayer
929         https://bugs.webkit.org/show_bug.cgi?id=188849
930
931         Reviewed by Michael Catanzaro.
932
933         Remove the TiledBackingStoreClient inheritance from the
934         CoordinatedGraphicsLayer class since it's not used anymore after changes
935         made in r235165.
936
937         Related TiledBackingStore objects on this class, along with tile state
938         tracking member variables on the CoordinatedGraphicsLayerState class,
939         are also removed.
940
941         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
942         (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
943         (WebCore::CoordinatedGraphicsLayer::resetLayerState):
944         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
945         (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreHasPendingTileCreation): Deleted.
946         (WebCore::CoordinatedGraphicsLayer::createTile): Deleted.
947         (WebCore::CoordinatedGraphicsLayer::updateTile): Deleted.
948         (WebCore::CoordinatedGraphicsLayer::removeTile): Deleted.
949         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
950         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
951         (WebCore::CoordinatedGraphicsLayerState::hasPendingChanges const):
952
953 2018-08-22  Zan Dobersek  <zdobersek@igalia.com>
954
955         [CoordGraphics] Remove CoordinatedImageBacking and related functionality
956         https://bugs.webkit.org/show_bug.cgi?id=188847
957
958         Reviewed by Michael Catanzaro.
959
960         Remove the CoordinatedImageBacking class and its intertwining use in the
961         CoordinatedGraphics system.
962
963         Remove the now-unused m_coordinatedImageBacking member variable from the
964         CoordinatedGraphicsLayer class, along with CoordinatedImageBacking::Host
965         inheritance. Various related helper methods are also removed.
966
967         In CoordinatedGraphicsState and CoordinatedGraphicsLayerState classes,
968         we are able to drop different CoordinatedImageBacking-related state
969         values that are not used anymore.
970
971         * platform/TextureMapper.cmake:
972         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
973         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
974         (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
975         (WebCore::CoordinatedGraphicsLayer::setContentsToImage):
976         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
977         (WebCore::CoordinatedGraphicsLayer::didChangeImageBacking): Deleted.
978         (WebCore::CoordinatedGraphicsLayer::syncImageBacking): Deleted.
979         (WebCore::CoordinatedGraphicsLayer::imageBackingVisible): Deleted.
980         (WebCore::CoordinatedGraphicsLayer::releaseImageBackingIfNeeded): Deleted.
981         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
982         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
983         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
984         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp: Removed.
985         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h: Removed.
986
987 2018-08-22  Ryosuke Niwa  <rniwa@webkit.org>
988
989         Store RefPtr in FocusNavigationScope
990         https://bugs.webkit.org/show_bug.cgi?id=188864
991
992         Reviewed by Simon Fraser.
993
994         Use RefPtr to store the root node of a tree scope and a slot element instead of a reference and a raw pointer.
995
996         * page/FocusController.cpp:
997         (WebCore::FocusNavigationScope::parentInScope const):
998         (WebCore::FocusNavigationScope::firstNodeInScope const):
999         (WebCore::FocusNavigationScope::lastNodeInScope const):
1000         (WebCore::FocusNavigationScope::FocusNavigationScope):
1001         (WebCore::FocusNavigationScope::owner const):
1002
1003 2018-08-22  Jiewen Tan  <jiewen_tan@apple.com>
1004
1005         Unreviewed, update "Web Authentication" from "Under Consideration" to "In Development"
1006         in features.json.
1007
1008         * features.json:
1009
1010 2018-08-22  Wenson Hsieh  <wenson_hsieh@apple.com>
1011
1012         [Attachment Support] Support dragging attachment elements out as files on macOS
1013         https://bugs.webkit.org/show_bug.cgi?id=181294
1014         <rdar://problem/36298801>
1015
1016         Reviewed by Tim Horton.
1017
1018         Serialize a dragged attachment element as a web archive on macOS. This allows us to move attachment elements
1019         around a document by dragging, without performing a file upload upon every drop. Ideally, we should do this on
1020         iOS as well, but this currently causes attachment data to go missing; further investigation to fix this for iOS
1021         is tracked in <https://bugs.webkit.org/show_bug.cgi?id=181514>.
1022
1023         Tests:  WKAttachmentTestsMac.DragAttachmentAsFilePromise
1024                 WKAttachmentTests.MoveAttachmentElementAsIconByDragging
1025
1026         * editing/cocoa/EditorCocoa.mm:
1027         (WebCore::Editor::getPasteboardTypesAndDataForAttachment):
1028
1029 2018-08-22  Aditya Keerthi  <akeerthi@apple.com>
1030
1031         [iOS] Add support for the inputmode attribute
1032         https://bugs.webkit.org/show_bug.cgi?id=183621
1033
1034         Reviewed by Tim Horton.
1035
1036         Added the inputmode attribute to the HTMLInputElement and HTMLTextAreaElement IDL
1037         files. The possible values for the attribute are specified in InputModeNames.
1038
1039         Test: fast/forms/inputmode-attribute.html
1040
1041         * Sources.txt:
1042         * WebCore.xcodeproj/project.pbxproj:
1043         * html/HTMLAttributeNames.in:
1044         * html/HTMLInputElement.idl:
1045         * html/HTMLTextAreaElement.idl:
1046         * html/HTMLTextFormControlElement.cpp:
1047         (WebCore::HTMLTextFormControlElement::inputMode const):
1048         (WebCore::HTMLTextFormControlElement::setInputMode):
1049         * html/HTMLTextFormControlElement.h:
1050         * html/InputModeNames.cpp: Added.
1051         (WebCore::InputModeNames::text):
1052         (WebCore::InputModeNames::tel):
1053         (WebCore::InputModeNames::url):
1054         (WebCore::InputModeNames::email):
1055         (WebCore::InputModeNames::numeric):
1056         (WebCore::InputModeNames::decimal):
1057         (WebCore::InputModeNames::search):
1058         * html/InputModeNames.h: Added.
1059
1060 2018-08-22  Eric Carlson  <eric.carlson@apple.com>
1061
1062         Log more often during AirPlay state changes
1063         https://bugs.webkit.org/show_bug.cgi?id=188854
1064
1065         Always log some infrequent but important AirPlay state changes to make debugging easier.
1066
1067         Reviewed by Jer Noble.
1068
1069         * html/HTMLMediaElement.cpp:
1070         (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker): Low always.
1071         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Ditto.
1072         (WebCore::HTMLMediaElement::setWirelessPlaybackTarget): Ditto.
1073         (WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget): Ditto.
1074
1075 2018-08-21  Ryosuke Niwa  <rniwa@webkit.org>
1076
1077         Focus navigation order in slot fallback contents is wrong
1078         https://bugs.webkit.org/show_bug.cgi?id=178001
1079         <rdar://problem/42842997>
1080
1081         Reviewed by Antti Koivisto.
1082
1083         The bug here is that when a slot uses its fallback content, the fallback content's focus order doesn't get
1084         grouped by that of the slot. Consider the following DOM tree:
1085
1086         - ShadowRoot
1087             - div tabindex = 2
1088             - slot tabindex = 1
1089                 - span tabindex = 3
1090
1091         In this example, the sequential focus navigation should be slot, span, then div. Even though span has tabindex
1092         order of 3, which is lower than that of div, the fallback content of the slot should be grouped together
1093         before the focus moves out of the slot content.
1094
1095         In WebKit, this concept of grouping elements for the sequential focus navigation ordering is implemeneted
1096         as FocusNavigationScope. Both ShadowRoot and HTMLSlotElement are treated as a focus scope owner but we had
1097         a bug that a slot element which uses its fallback content was not treated as a focus scope owner.
1098
1099         This patch addresses the bug by treating a slot wich uses its fallback content as a focus scope owner.
1100
1101         Test: fast/shadow-dom/focus-navigation-across-slots.html
1102
1103         * page/FocusController.cpp:
1104         (WebCore::isFocusScopeOwner): Treat a slot elment hs a focus scope owner regardless of whether it has assigned
1105         nodes or not.
1106         (WebCore::FocusNavigationScope::SlotKind): Added.
1107         (WebCore::FocusNavigationScope::m_slotKind): Added.
1108         (WebCore::FocusNavigationScope::parentInScope const): Return null if `node` is a child of the slot element for
1109         which this FocusNavigationScope is created (i.e. `node` is slot's fallback content).
1110         (WebCore::FocusNavigationScope::firstNodeInScope const): Return the first child node when this
1111         FocusNavigationScope is for a slot element using its fallback content.
1112         (WebCore::FocusNavigationScope::lastNodeInScope const): Ditto for the last child.
1113         (WebCore::FocusNavigationScope::FocusNavigationScope):
1114         (WebCore::FocusNavigationScope::scopeOf): The scope of a child of a slot element which uses its fallback content
1115         is its slot element (i.e. the current node is a fallback content). We can't simply check the current node is
1116         a slot element which uses a fallback content since the scope of a slot element is the parent scope. e.g. its
1117         tree scope like ShadowRoot or Document inside which this slot element appears.
1118         (WebCore::FocusNavigationScope::scopeOwnedByScopeOwner): Create the appropriate FocusNavigationScope based on
1119         whether the slot element has assigned or it uses its fallback content.
1120
1121 2018-08-22  David Kilzer  <ddkilzer@apple.com>
1122
1123         Move files in WebCore project to match Xcode folder structure
1124         <https://webkit.org/b/188851>
1125
1126         Reviewed by Tim Horton.
1127
1128         * Scripts/LocalizableStrings.pm: Renamed from Source/WebCore/LocalizableStrings.pm.
1129         * Scripts/extract-localizable-strings.pl: Renamed from Source/WebCore/extract-localizable-strings.pl.
1130         * WebCore.xcodeproj/project.pbxproj: Update to match new location of files.
1131         * platform/audio/cocoa/WebAudioBufferList.cpp: Renamed from Source/WebCore/platform/audio/WebAudioBufferList.cpp.
1132         * platform/audio/cocoa/WebAudioBufferList.h: Renamed from Source/WebCore/platform/audio/WebAudioBufferList.h.
1133         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: Renamed from Source/WebCore/platform/graphics/avfoundation/MediaSampleAVFObjC.h.
1134         * platform/ios/wak/WAKViewInternal.h: Renamed from Source/WebCore/platform/WAKViewInternal.h.
1135           Also fix 3 webkit-style warnings.
1136
1137 2018-08-22  Zalan Bujtas  <zalan@apple.com>
1138
1139         [LFC][Floating] Move files to a dedicated directory.
1140         https://bugs.webkit.org/show_bug.cgi?id=188846
1141
1142         Reviewed by Simon Fraser.
1143
1144         layout/Float* -> layout/floats
1145
1146         * WebCore.xcodeproj/project.pbxproj:
1147         * layout/floatformatting/FloatingContext.cpp: Renamed from Source/WebCore/layout/FloatingContext.cpp.
1148         (WebCore::Layout::FloatingPair::isEmpty const):
1149         (WebCore::Layout::FloatingPair::verticalPosition const):
1150         (WebCore::Layout::Iterator::operator* const):
1151         (WebCore::Layout::begin):
1152         (WebCore::Layout::end):
1153         (WebCore::Layout::FloatingContext::FloatingContext):
1154         (WebCore::Layout::FloatingContext::positionForFloat const):
1155         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
1156         (WebCore::Layout::FloatingContext::floatingPosition const):
1157         (WebCore::Layout::FloatingContext::initialVerticalPosition const):
1158         (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
1159         (WebCore::Layout::FloatingContext::alignWithFloatings const):
1160         (WebCore::Layout::FloatingContext::toContainingBlock const):
1161         (WebCore::Layout::FloatingPair::FloatingPair):
1162         (WebCore::Layout::FloatingPair::left const):
1163         (WebCore::Layout::FloatingPair::right const):
1164         (WebCore::Layout::FloatingPair::intersects const):
1165         (WebCore::Layout::FloatingPair::operator == const):
1166         (WebCore::Layout::FloatingPair::bottom const):
1167         (WebCore::Layout::Iterator::Iterator):
1168         (WebCore::Layout::previousFloatingIndex):
1169         (WebCore::Layout::Iterator::operator++):
1170         (WebCore::Layout::Iterator::set):
1171         (WebCore::Layout::Iterator::operator== const):
1172         (WebCore::Layout::Iterator::operator!= const):
1173         * layout/floatformatting/FloatingContext.h: Renamed from Source/WebCore/layout/FloatingContext.h.
1174         (WebCore::Layout::FloatingContext::floatingState const):
1175         (WebCore::Layout::FloatingContext::layoutContext const):
1176         * layout/floatformatting/FloatingState.cpp: Renamed from Source/WebCore/layout/FloatingState.cpp.
1177         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
1178         (WebCore::Layout::FloatingState::FloatingState):
1179         (WebCore::Layout::belongsToThisFloatingContext):
1180         (WebCore::Layout::FloatingState::remove):
1181         (WebCore::Layout::FloatingState::append):
1182         (WebCore::Layout::FloatingState::bottom const):
1183         * layout/floatformatting/FloatingState.h: Renamed from Source/WebCore/layout/FloatingState.h.
1184         (WebCore::Layout::FloatingState::create):
1185         (WebCore::Layout::FloatingState::isEmpty const):
1186         (WebCore::Layout::FloatingState::FloatItem::layoutBox const):
1187         (WebCore::Layout::FloatingState::FloatItem::containingBlock const):
1188         (WebCore::Layout::FloatingState::FloatItem::displayBox const):
1189         (WebCore::Layout::FloatingState::FloatItem::containingBlockDisplayBox const):
1190         (WebCore::Layout::FloatingState::floats const):
1191         (WebCore::Layout::FloatingState::last const):
1192         (WebCore::Layout::FloatingState::layoutContext const):
1193         (WebCore::Layout::FloatingState::root const):
1194         (WebCore::Layout::FloatingState::leftBottom const):
1195         (WebCore::Layout::FloatingState::rightBottom const):
1196         (WebCore::Layout::FloatingState::bottom const):
1197
1198 2018-08-22  Rob Buis  <rbuis@igalia.com>
1199
1200         Fetch: Stop checking Request.integrity's value in no-cors mode
1201         https://bugs.webkit.org/show_bug.cgi?id=188802
1202
1203         Reviewed by Frédéric Wang.
1204
1205         Remove this check since it was removed from the spec.
1206
1207         Behavior matches Chrome and Firefox.
1208
1209         Test: http/tests/subresource-integrity/sri-fetch.js:
1210
1211         * Modules/fetch/FetchRequest.cpp:
1212         (WebCore::FetchRequest::initializeOptions):
1213
1214 2018-08-22  Youenn Fablet  <youenn@apple.com>
1215
1216         Mark MediaStream Recording API as under consideration
1217         https://bugs.webkit.org/show_bug.cgi?id=188822
1218
1219         Reviewed by Jon Lee.
1220
1221         * features.json:
1222
1223 2018-08-22  Ms2ger  <Ms2ger@igalia.com>
1224
1225         [GTK] Never return an uninitialized ImageGStreamer object.
1226         https://bugs.webkit.org/show_bug.cgi?id=188305
1227
1228         Reviewed by Philippe Normand.
1229
1230         The single caller was already checking for a null return value, so
1231         make that check actually do something. Also remove the null-check on
1232         the return value of image(), which asserted that it would never return
1233         null.
1234
1235         Test: fast/canvas/canvas-createPattern-video-loading.html
1236
1237         * platform/graphics/gstreamer/ImageGStreamer.h:
1238         (WebCore::ImageGStreamer::createImage): Return null if m_image wasn't created.
1239         (WebCore::ImageGStreamer::image): Return a reference.
1240         (WebCore::ImageGStreamer::rect): Always assert that m_image is present.
1241         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1242         (WebCore::MediaPlayerPrivateGStreamerBase::paint): Update for new signature.
1243
1244 2018-08-22  Zalan Bujtas  <zalan@apple.com>
1245
1246         Add changes missing from r234925.
1247
1248         * layout/blockformatting/BlockMarginCollapse.cpp:
1249         (WebCore::Layout::isMarginTopCollapsedWithParent):
1250         (WebCore::Layout::isMarginBottomCollapsedThrough):
1251         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
1252
1253 2018-08-22  Zan Dobersek  <zdobersek@igalia.com>
1254
1255         [CoordGraphics] Switch to Nicosia::CompositionLayer state tracking
1256         https://bugs.webkit.org/show_bug.cgi?id=188693
1257
1258         Reviewed by Carlos Garcia Campos.
1259
1260         Populate Nicosia::CompositionLayer with additional LayerState member
1261         objects. For now we're using pending, staging and committed states,
1262         though it might be possible to narrow down these to just two.
1263
1264         Pending state contains state that will be moved to staging during the
1265         final steps of the next layer flush. flushState() method accumulates all
1266         state changes in the staging state, and also allows the caller to
1267         additionally perform flushing operations that are specific to backing
1268         store, image backing or content layer containers.
1269
1270         commitState() method moves staging state over into the committed state,
1271         again allowing user to pass a functor that receives the just-committed
1272         state and apply it to their composition engine.
1273
1274         Changes in state objects are done under a thread-safe lock. This might
1275         not be completely necessary at this point, but will be useful when
1276         additonal layer state updates will be coming from e.g. the scrolling
1277         thread. It might also make sense to tie in this lock use with the
1278         Nicosia::Scene lock in the future.
1279
1280         Nicosia::ContentLayerTextureMapperImpl is modified slightly to allow
1281         determining during flushes whether an update is pending. This is
1282         necessary for a special case in ThreadedCompositor where content (i.e.
1283         platform) layers like WebGL or video require an additional level of
1284         scene update coordination. This complete special case has to go through
1285         another review to see whether it's still necessary. Ideally we would be
1286         able to remove it.
1287
1288         CoordinatedGraphicsLayer is finally switched over to using
1289         Nicosia layer objects for state updates of any kind. This patch only
1290         adds all the necessary bits, but doesn't yet remove any of the existing
1291         code (but rather disables it temporarily, before it's removed).
1292
1293         Updating of simple state values is already in place. For backing stores,
1294         the flushCompositingStateForThisLayerOnly() method now takes care of
1295         preparing the backing store object if necessary as per layer state,
1296         while the updateContentBuffers() method is switched to operate with
1297         TiledBackingStore objects now kept on the BackingStoreTextureMapperImpl
1298         instance associated with that backing store. Helper methods like
1299         adjustContentsScale() and createBackingStore(), only called from the
1300         updateContentBuffers() method, are removed and the code there inlined.
1301
1302         For image-backed layers, the update is now done directly in
1303         the flushCompositingStateForThisLayerOnly() method, if necessary. The
1304         helper syncImageBacking() method is commented out in order to prevent
1305         double-painting of image buffers for now, but all this (along with the
1306         CoordinatedImageBacking logic in CompositingCoordinator) will be removed
1307         later.
1308
1309         For layers backed by platform layer objects, integration is relatively
1310         simple. setContentsToPlatformLayer() is changed to properly handle any
1311         passed-in platform layer object, and updatePlatformLayer() invokes the
1312         swapBuffersIfNeeded() method on the ContentLayerTextureMapperImpl object
1313         during each flush, if necessary.
1314
1315         In order to ensure any Nicosia-specific state update properly triggers
1316         a composition update, m_nicosia.performLayerUpdate is added and flipped
1317         to true during the flush in case of any state change. This then triggers
1318         a layer sync in the CompositingCoordinator object when the
1319         syncPendingStateChangesIncludingSubLayers() method is called. While no
1320         old-style layer state update is provided, it causes the necessary
1321         synchronization step that properly picks up the Nicosia-provided state
1322         changes. Once the old-style layer state tracking is removed, this method
1323         of update triggering will have to be updated as well.
1324
1325         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
1326         (Nicosia::CompositionLayer::flushState):
1327         (Nicosia::CompositionLayer::commitState):
1328         (Nicosia::CompositionLayer::accessCommitted):
1329         * platform/graphics/nicosia/NicosiaScene.h:
1330         * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp:
1331         (Nicosia::ContentLayerTextureMapperImpl::flushUpdate):
1332         * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.h:
1333         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1334         (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
1335         (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
1336         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
1337         (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
1338         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
1339         (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
1340         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
1341         (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
1342         (WebCore::CoordinatedGraphicsLayer::adjustContentsScale): Deleted.
1343         (WebCore::CoordinatedGraphicsLayer::createBackingStore): Deleted.
1344         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1345
1346 2018-08-22  David Kilzer  <ddkilzer@apple.com>
1347
1348         Remove stale file references in WebCore Xcode project
1349
1350         I manually removed these using Xcode and verified that there was
1351         a commit that removed the original files.
1352
1353         Found by tool created for Bug 188754: Tool to fix folders that
1354         should map to directories in Xcode project files.
1355
1356         * WebCore.xcodeproj/project.pbxproj:
1357         (dom/DOMExceptions.in): Removed in r219741.
1358         (Modules/modern-media-controls/start-button.js):
1359         (Modules/modern-media-controls/volume-slider.css):
1360         (Modules/modern-media-controls/icon-button.css):
1361         (Modules/modern-media-controls/volume-slider.js):
1362         (Modules/modern-media-controls/macos-media-controls.js):
1363         (Modules/modern-media-controls/ios-inline-media-controls.css):
1364         (Modules/modern-media-controls/scrubber.css):
1365         (Modules/modern-media-controls/start-button.css):
1366         (Modules/modern-media-controls/scrubber.js):
1367         (Modules/modern-media-controls/icon-button.js):
1368         (Modules/modern-media-controls/macos-compact-inline-media-controls.css):
1369         (Modules/modern-media-controls/images/iOS/enter-fullscreen@2x.png):
1370         (Modules/modern-media-controls/images/iOS/start@1x.png):
1371         (Modules/modern-media-controls/images/iOS/enter-fullscreen@1x.png):
1372         (Modules/modern-media-controls/images/iOS/pause@2x.png):
1373         (Modules/modern-media-controls/images/iOS/play@3x.png):
1374         (Modules/modern-media-controls/images/iOS/interval-skip-back@2x.png):
1375         (Modules/modern-media-controls/images/iOS/interval-skip-back@3x.png):
1376         (Modules/modern-media-controls/images/iOS/pip-in@2x.png):
1377         (Modules/modern-media-controls/images/iOS/start@3x.png):
1378         (Modules/modern-media-controls/images/iOS/airplay@1x.png):
1379         (Modules/modern-media-controls/images/iOS/enter-fullscreen@3x.png):
1380         (Modules/modern-media-controls/images/iOS/slider-thumb@2x.png):
1381         (Modules/modern-media-controls/images/iOS/airplay@2x.png):
1382         (Modules/modern-media-controls/images/iOS/pause@3x.png):
1383         (Modules/modern-media-controls/images/iOS/pip-in@3x.png):
1384         (Modules/modern-media-controls/images/iOS/interval-skip-back@1x.png):
1385         (Modules/modern-media-controls/images/iOS/pause@1x.png):
1386         (Modules/modern-media-controls/images/iOS/start@2x.png):
1387         (Modules/modern-media-controls/images/iOS/play@2x.png):
1388         (Modules/modern-media-controls/images/iOS/pip-in@1x.png):
1389         (Modules/modern-media-controls/images/iOS/play@1x.png):
1390         (Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@1x.png):
1391         (Modules/modern-media-controls/images/macOS/rewind@1x.png):
1392         (Modules/modern-media-controls/images/macOS/play@2x.png):
1393         (Modules/modern-media-controls/images/macOS/volume-mute@2x.png):
1394         (Modules/modern-media-controls/images/macOS/airplay-fullscreen@1x.png):
1395         (Modules/modern-media-controls/images/macOS/volume@2x.png):
1396         (Modules/modern-media-controls/images/macOS/interval-skip-back@2x.png):
1397         (Modules/modern-media-controls/images/macOS/volume-compact@2x.png):
1398         (Modules/modern-media-controls/images/macOS/start@2x.png):
1399         (Modules/modern-media-controls/images/macOS/exit-fullscreen@2x.png):
1400         (Modules/modern-media-controls/images/macOS/airplay@2x.png):
1401         (Modules/modern-media-controls/images/macOS/media-selection-fullscreen@1x.png):
1402         (Modules/modern-media-controls/images/macOS/interval-skip-back@1x.png):
1403         (Modules/modern-media-controls/images/macOS/airplay@1x.png):
1404         (Modules/modern-media-controls/images/macOS/pip-in@1x.png):
1405         (Modules/modern-media-controls/images/macOS/scale-to-fill@2x.png):
1406         (Modules/modern-media-controls/images/macOS/rewind@2x.png):
1407         (Modules/modern-media-controls/images/macOS/play-compact@1x.png):
1408         (Modules/modern-media-controls/images/macOS/media-selection-fullscreen@2x.png):
1409         (Modules/modern-media-controls/images/macOS/pip-in-fullscreen@1x.png):
1410         (Modules/modern-media-controls/images/macOS/volume@1x.png):
1411         (Modules/modern-media-controls/images/macOS/pip-in@2x.png):
1412         (Modules/modern-media-controls/images/macOS/play-fullscreen@2x.png):
1413         (Modules/modern-media-controls/images/macOS/volume-down-fullscreen@1x.png):
1414         (Modules/modern-media-controls/images/macOS/pause-fullscreen@2x.png):
1415         (Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@2x.png):
1416         (Modules/modern-media-controls/images/macOS/enter-fullscreen@1x.png):
1417         (Modules/modern-media-controls/images/macOS/pause-compact@1x.png):
1418         (Modules/modern-media-controls/images/macOS/start@1x.png):
1419         (Modules/modern-media-controls/images/macOS/pip-in-fullscreen@2x.png):
1420         (Modules/modern-media-controls/images/macOS/pause-fullscreen@1x.png):
1421         (Modules/modern-media-controls/images/macOS/play@1x.png):
1422         (Modules/modern-media-controls/images/macOS/exit-fullscreen@1x.png):
1423         (Modules/modern-media-controls/images/macOS/forward@1x.png):
1424         (Modules/modern-media-controls/images/macOS/enter-fullscreen@2x.png):
1425         (Modules/modern-media-controls/images/macOS/pause@1x.png):
1426         (Modules/modern-media-controls/images/macOS/scale-to-fit@2x.png):
1427         (Modules/modern-media-controls/images/macOS/interval-skip-back-compact@2x.png):
1428         (Modules/modern-media-controls/images/macOS/pause@2x.png):
1429         (Modules/modern-media-controls/images/macOS/volume-up-fullscreen@1x.png):
1430         (Modules/modern-media-controls/images/macOS/volume-compact@1x.png):
1431         (Modules/modern-media-controls/images/macOS/play-compact@2x.png):
1432         (Modules/modern-media-controls/images/macOS/media-selection@2x.png):
1433         (Modules/modern-media-controls/images/macOS/forward@2x.png):
1434         (Modules/modern-media-controls/images/macOS/interval-skip-back-compact@1x.png):
1435         (Modules/modern-media-controls/images/macOS/scale-to-fill@1x.png):
1436         (Modules/modern-media-controls/images/macOS/airplay-fullscreen@2x.png):
1437         (Modules/modern-media-controls/images/macOS/media-selection@1x.png):
1438         (Modules/modern-media-controls/images/macOS/volume-mute@1x.png):
1439         (Modules/modern-media-controls/images/macOS/pause-compact@2x.png):
1440         (Modules/modern-media-controls/images/macOS/volume-up-fullscreen@2x.png):
1441         (Modules/modern-media-controls/images/macOS/scale-to-fit@1x.png):
1442         (Modules/modern-media-controls/images/macOS/play-fullscreen@1x.png):
1443         (Modules/modern-media-controls/images/macOS/volume-down-fullscreen@2x.png):
1444         (Modules/modern-media-controls/media/time-labels-support.js):
1445         - Removed in r217823.
1446         (Modules/webvr/VRDisplayCapabilities.cpp): Removed in r229089.
1447         (Modules/webvr/VRFieldOfView.cpp): Removed in r228819.
1448         (rendering/svg/RenderSVGAllInOne.cpp): Removed in r234655.
1449
1450 2018-08-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1451
1452         Do not try to update the compositing policy when not in accelerated compositing mode
1453         https://bugs.webkit.org/show_bug.cgi?id=188787
1454
1455         Reviewed by Simon Fraser.
1456
1457         RenderLayerCompositor::updateCompositingPolicy() is called very often (called from
1458         RenderLayerCompositor::cacheAcceleratedCompositingFlags()) and it uses WTF::memoryFootprint() to decide the
1459         current compositing policy. Getting the memory footprint is an expensive operation in Linux (and I suspect other
1460         non-cocoa ports too), causing an excessive CPU usage. This caused the WPE and GTK+ unit test
1461         /webkit/WebKitWebContext/uri-scheme to start timing out in the bots, because the test expects things to happen
1462         fast and that's no longer the case. We could reduce the CPU usage a lot by not trying to update the policy when
1463         not in accelerated compositing mode. We will need a solution for the accelerated compositing mode, though.
1464
1465         Fixes WPE/GTK+ unit test /webkit/WebKitWebContext/uri-scheme.
1466
1467         * rendering/RenderLayerCompositor.cpp:
1468         (WebCore::RenderLayerCompositor::updateCompositingPolicy): Return early when not in accelerated compositing mode.
1469
1470 2018-08-21  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1471
1472         Support "name" option for dedicated workers
1473         https://bugs.webkit.org/show_bug.cgi?id=188779
1474
1475         Reviewed by Joseph Pecoraro.
1476
1477         This patch adds `new Worker(url, { name: "Worker Name" })` option support[1].
1478         This name can be accessible from `self.name` of DedicatedWorkerGlobalScope.
1479         It is useful for debugging dedicated workers if the inspector can show the
1480         names of the workers. This enhancement is tracked by [2].
1481
1482         [1]: https://github.com/whatwg/html/issues/2477
1483         [2]: https://bugs.webkit.org/show_bug.cgi?id=164678
1484
1485         Tests: http/wpt/workers/name-property-enhanced.html
1486                http/wpt/workers/name-property-no-name.html
1487
1488         * workers/DedicatedWorkerGlobalScope.cpp:
1489         (WebCore::DedicatedWorkerGlobalScope::create):
1490         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
1491         Hold `name` member.
1492
1493         * workers/DedicatedWorkerGlobalScope.h:
1494         * workers/DedicatedWorkerGlobalScope.idl:
1495         Add `name` attribute.
1496
1497         * workers/DedicatedWorkerThread.cpp:
1498         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
1499         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
1500         * workers/DedicatedWorkerThread.h:
1501         * workers/Worker.cpp:
1502         (WebCore::Worker::Worker):
1503         (WebCore::Worker::create):
1504         (WebCore::Worker::notifyFinished):
1505         * workers/Worker.h:
1506         * workers/Worker.idl:
1507         Add WorkerOptions for dedicated worker creation.
1508
1509         * workers/WorkerGlobalScopeProxy.h:
1510         * workers/WorkerMessagingProxy.cpp:
1511         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
1512         * workers/WorkerMessagingProxy.h:
1513         * workers/WorkerThread.cpp:
1514         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
1515         Isolate copy the given `name` to pass the worker thread.
1516
1517         (WebCore::WorkerThread::WorkerThread):
1518         (WebCore::WorkerThread::workerThread):
1519         * workers/WorkerThread.h:
1520         * workers/service/context/ServiceWorkerThread.cpp:
1521         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
1522         (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
1523         * workers/service/context/ServiceWorkerThread.h:
1524
1525 2018-08-21  Ryosuke Niwa  <rniwa@webkit.org>
1526
1527         Replace booleans for modifier keys in UIEventWithKeyState with OptionSet<Modifier>
1528         https://bugs.webkit.org/show_bug.cgi?id=188777
1529
1530         Reviewed by Simon Fraser.
1531
1532         Replaced boolean arguments and instance variables for modifier keys (ctrl, alt, shift, and meta keys) in
1533         UIEventWithKeyState with OptionSet<Modifier> and isSimulated boolean in MouseRelatedEvent with IsSimulated
1534         enum class.
1535
1536         Also made movementDelta always compiled instead of only when ENABLE(POINTER_LOCK) to simplify the code.
1537
1538         No new tests since there should be no observable behavioral change.
1539
1540         * dom/Element.cpp:
1541         (WebCore::Element::dispatchMouseEvent):
1542         * dom/KeyboardEvent.cpp:
1543         (WebCore::KeyboardEvent::KeyboardEvent):
1544         (WebCore::KeyboardEvent::initKeyboardEvent): Call setModifierKeys.
1545         * dom/MouseEvent.cpp:
1546         (WebCore::MouseEvent::create):
1547         (WebCore::MouseEvent::MouseEvent):
1548         (WebCore::MouseEvent::initMouseEvent): Ditto.
1549         * dom/MouseEvent.h:
1550         * dom/MouseRelatedEvent.cpp:
1551         (WebCore::MouseRelatedEvent::MouseRelatedEvent): Added a new variant which takes the minimum arguments
1552         for gesture & touch events. In those events, detail is always set to 0, movementDelta is always set to 0,0,
1553         and they are never simulated.
1554         * dom/MouseRelatedEvent.h:
1555         (WebCore::MouseRelatedEvent::IsSimulated): Added.
1556         * dom/SimulatedClick.cpp:
1557         (WebCore::SimulatedMouseEvent::SimulatedMouseEvent): Get OptionSet<Modifier> out of the underlying event
1558         instead of manually setting each key state. This code now preserves the state of caps lock and alt-graph
1559         keys but this is not observable because we have yet to implement getModifierState on MouseEvent.
1560         (WebCore::SimulatedMouseEvent::modifiersFromUnderlyingEvent): Added.
1561         * dom/TouchEvent.cpp:
1562         (WebCore::TouchEvent::TouchEvent):
1563         * dom/TouchEvent.h:
1564         * dom/UIEventWithKeyState.h:
1565         (WebCore::UIEventWithKeyState::Modifier): Alias to PlatformEvent::Modifier.
1566         (WebCore::UIEventWithKeyState::ctrlKey const): Updated to use m_modifiers.
1567         (WebCore::UIEventWithKeyState::shiftKey const): Ditto.
1568         (WebCore::UIEventWithKeyState::altKey const): Ditto.
1569         (WebCore::UIEventWithKeyState::metaKey const): Ditto.
1570         (WebCore::UIEventWithKeyState::altGraphKey const): Ditto.
1571         (WebCore::UIEventWithKeyState::capsLockKey const): Ditto.
1572         (WebCore::UIEventWithKeyState::modifierKeys): Added.
1573         (WebCore::UIEventWithKeyState::UIEventWithKeyState): Now takes OptionSet<Modifier>.
1574         (WebCore::UIEventWithKeyState::setModifierKeys): Added. Used by init*Event functions in subclasses. Note that
1575         these functions preseve the states of alt-graph and caps lock keys to match the existing behaviors in this
1576         cleanup patch but they don't match behaviors of Chrome or Firefox.
1577         (WebCore::UIEventWithKeyState::modifiersFromInitializer): Added.
1578         * dom/WheelEvent.cpp:
1579         (WebCore::WheelEvent::WheelEvent): Simulated::No corresponds to the last boolean being false.
1580         * page/EventHandler.cpp:
1581         (WebCore::EventHandler::dispatchDragEvent):
1582         (WebCore::EventHandler::handleTouchEvent):
1583         * platform/PlatformEvent.h:
1584         (WebCore::PlatformEvent::Modifier): Added AltGraphKey.
1585         * platform/mac/PlatformEventFactoryMac.h:
1586         (WebCore::modifiersForEvent): Exported to be used in [WebPDFView PDFViewWillClickOnLink:withURL:].
1587         * platform/mac/PlatformEventFactoryMac.mm:
1588         (WebCore::modifiersForEvent):
1589         * testing/Internals.cpp:
1590         (WebCore::Internals::accessKeyModifiers const):
1591
1592 2018-08-21  Wenson Hsieh  <wenson_hsieh@apple.com>
1593
1594         [Attachment Support] Remove _WKAttachments and notify the UI client upon mainframe navigation
1595         https://bugs.webkit.org/show_bug.cgi?id=188715
1596         <rdar://problem/43541790>
1597
1598         Reviewed by Tim Horton.
1599
1600         Rename didInsertAttachment to didInsertAttachmentWithIdentifier. See WebKit ChangeLog for more detail.
1601
1602         Tests:  WKAttachmentTests.InvalidateAttachmentsAfterMainFrameNavigation
1603                 WKAttachmentTests.InvalidateAttachmentsAfterWebProcessTermination
1604
1605         * editing/Editor.cpp:
1606         (WebCore::Editor::notifyClientOfAttachmentUpdates):
1607         * page/EditorClient.h:
1608         (WebCore::EditorClient::didInsertAttachmentWithIdentifier):
1609         (WebCore::EditorClient::didRemoveAttachmentWithIdentifier):
1610         (WebCore::EditorClient::didInsertAttachment): Deleted.
1611         (WebCore::EditorClient::didRemoveAttachment): Deleted.
1612
1613 2018-08-21  Ryan Haddad  <ryanhaddad@apple.com>
1614
1615         Unreviewed, rolling out r235128.
1616
1617         The test added with this change is frequently failing.
1618
1619         Reverted changeset:
1620
1621         "Support "name" option for dedicated workers"
1622         https://bugs.webkit.org/show_bug.cgi?id=188779
1623         https://trac.webkit.org/changeset/235128
1624
1625 2018-08-21  Commit Queue  <commit-queue@webkit.org>
1626
1627         Unreviewed, rolling out r235107.
1628         https://bugs.webkit.org/show_bug.cgi?id=188832
1629
1630         "It revealed bugs in Blob code as well as regressed JS
1631         performance tests" (Requested by saamyjoon on #webkit).
1632
1633         Reverted changeset:
1634
1635         "JSRunLoopTimer may run part of a member function after it's
1636         destroyed"
1637         https://bugs.webkit.org/show_bug.cgi?id=188426
1638         https://trac.webkit.org/changeset/235107
1639
1640 2018-08-21  Megan Gardner  <megan_gardner@apple.com>
1641
1642         Use VisiblePosition to calculate selection ranges
1643         https://bugs.webkit.org/show_bug.cgi?id=188767
1644         <rdar://problem/43577166>
1645
1646         Reviewed by Ryosuke Niwa.
1647
1648         Exposing comparePositions.
1649
1650         * editing/Editing.h:
1651
1652 2018-08-21  Wenson Hsieh  <wenson_hsieh@apple.com>
1653
1654         [Attachment Support] Augment _WKAttachment SPI to handle NSFileWrappers in addition to NSData
1655         https://bugs.webkit.org/show_bug.cgi?id=188496
1656         <rdar://problem/43216836>
1657
1658         Reviewed by Tim Horton.
1659
1660         Refactors logic around HTMLAttachmentElement and pasteboard reading helpers, in support of moving the data
1661         backing for attachment elements to the client layer, instead of keeping it in the attachment element's File.
1662         Augmented existing API tests in WKAttachmentTests, and also added a new API test (see Tools for more detail).
1663
1664         * WebCore.xcodeproj/project.pbxproj:
1665         * dom/Document.cpp:
1666         (WebCore::Document::didInsertAttachmentElement):
1667
1668         Notify the client layer when a newly inserted attachment element's identifier has been updated to avoid
1669         colliding with the identifier of an existing attachment element. This can happen if, for instance, one or more
1670         attachments are copied and pasted within the same document.
1671
1672         * editing/Editor.cpp:
1673         (WebCore::Editor::registerAttachmentIdentifier):
1674         (WebCore::Editor::cloneAttachmentData):
1675
1676         Add new helper functions to notify the client when the attachment identifier to data mapping needs to be
1677         updated. This can happen in three ways: (1) an attachment is created with raw data, or (2) an attachment is
1678         created with a file path, or (3) the unique identifier for an attachment element has been reassigned. These
1679         correspond to the two versions of `registerAttachmentIdentifier`, and `cloneAttachmentData`, respectively.
1680
1681         (WebCore::EditorClient::supportsClientSideAttachmentData const):
1682
1683         Add a new EditorClient hook to determine whether client-side attachment data management is supported. Currently,
1684         this only returns true for WebKit2. If this flag is set to true, we register attachment identifiers and don't
1685         create a new File object for the attachment element; otherwise, fall back to creating and setting a File for the
1686         new attachment element.
1687
1688         (WebCore::Editor::insertAttachment):
1689         (WebCore::Editor::insertAttachmentFromFile): Deleted.
1690
1691         Adjust logic when inserting an attachment; we now only need to update the attributes of the attachment element
1692         with metadata from the client layer.
1693
1694         * editing/Editor.h:
1695         * editing/cocoa/WebContentReaderCocoa.mm:
1696         (WebCore::supportsClientSideAttachmentData):
1697         (WebCore::createFragmentForImageAttachment):
1698
1699         Notify the client when creating an attachment element from image data on the pasteboard.
1700
1701         (WebCore::replaceRichContentWithAttachments):
1702
1703         Refactor this helper function to no longer connect attachment elements to File objects created from
1704         subresources. Instead, just update each attachment element's attributes using information about the subresource,
1705         and then notify the client about the new attachment data and attachment identifier.
1706
1707         (WebCore::createFragmentAndAddResources):
1708         (WebCore::sanitizeMarkupWithArchive):
1709
1710         Plumb the current WebContentReader's Frame& to each of these helpers, so that it can call out to the client.
1711
1712         (WebCore::WebContentReader::readWebArchive):
1713         (WebCore::WebContentMarkupReader::readWebArchive):
1714         (WebCore::WebContentReader::readImage):
1715         (WebCore::WebContentReader::readFilePaths):
1716
1717         Notify the client when creating an attachment from the path of a dropped file.
1718
1719         * html/AttachmentTypes.h:
1720
1721         Remove AttachmentInfo. This is no longer necessary because we don't need to request attachment data from the web
1722         process anymore.
1723
1724         * html/HTMLAttachmentElement.cpp:
1725         (WebCore::HTMLAttachmentElement::ensureUniqueIdentifier):
1726
1727         Add a helper function on the attachment element to create and return a unique identifier if needed.
1728
1729         (WebCore::HTMLAttachmentElement::updateAttributes):
1730
1731         Add a helper method to update the displayed element attributes (type, title and subtitle) or an attachment.
1732
1733         (WebCore::AttachmentDataReader::create): Deleted.
1734         (WebCore::AttachmentDataReader::AttachmentDataReader): Deleted.
1735
1736         Remove AttachmentDataReader. This helper class was only used to load attachment data when requesting attachment
1737         information in the client, but this is now obviated by moving attachment data to the client layer.
1738
1739         (WebCore::HTMLAttachmentElement::updateFileWithData): Deleted.
1740         (WebCore::HTMLAttachmentElement::requestInfo): Deleted.
1741         (WebCore::HTMLAttachmentElement::destroyReader): Deleted.
1742         (WebCore::AttachmentDataReader::~AttachmentDataReader): Deleted.
1743         (WebCore::AttachmentDataReader::didFinishLoading): Deleted.
1744         (WebCore::AttachmentDataReader::didFail): Deleted.
1745         (WebCore::AttachmentDataReader::invokeCallbackAndFinishReading): Deleted.
1746         * html/HTMLAttachmentElement.h:
1747         * page/DragClient.h:
1748         * page/DragController.cpp:
1749         (WebCore::DragController::startDrag):
1750         (WebCore::DragController::doSystemDrag):
1751         (WebCore::DragController::promisedAttachmentInfo):
1752
1753         Allow dragging an attachment (even if it does not have a file) as long as it has a unique identifier and a
1754         content type.
1755
1756         (WebCore::DragController::promisedBlobInfo): Deleted.
1757         * page/DragController.h:
1758         * page/EditorClient.h:
1759         (WebCore::EditorClient::registerAttachmentIdentifier):
1760         (WebCore::EditorClient::cloneAttachmentData):
1761         * platform/DragItem.h:
1762         (WebCore::DragItem::encode const):
1763         (WebCore::DragItem::decode):
1764         * platform/PromisedAttachmentInfo.h: Renamed from Source/WebCore/platform/PromisedBlobInfo.h.
1765
1766         Add an attachment identifier to PromisedBlobInfo. Additionally, rename PromisedBlobInfo to
1767         PromisedAttachmentInfo, since it is currently exclusively used to attachment element data to the pasteboard.
1768         In the future, this could be renamed to something more general (e.g. PromisedPasteboardData), should we use this
1769         mechanism to write data from other sources to the pasteboard.
1770
1771         (WebCore::PromisedAttachmentInfo::operator bool const):
1772
1773 2018-08-21  Brent Fulgham  <bfulgham@apple.com>
1774
1775         Remove experimental affiliated domain code now that StorageAccess API is available
1776         https://bugs.webkit.org/show_bug.cgi?id=188756
1777         <rdar://problem/43527848>
1778
1779         Reviewed by Alex Christensen.
1780
1781         In Bug 174661 we added a compatibility quirk to support wsj.com authentication. This quirk is no longer needed,
1782         since the StorageAccess API provides the necessary tools to do this type of interaction without needing global
1783         cross-site access.
1784
1785         * loader/ResourceLoadObserver.cpp:
1786         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1787         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1788         (WebCore::areDomainsAssociated): Deleted.
1789         (WebCore::shouldEnableSiteSpecificQuirks): Deleted.
1790         * loader/ResourceLoadStatistics.cpp:
1791         (WebCore::ResourceLoadStatistics::areDomainsAssociated): Deleted.
1792         * loader/ResourceLoadStatistics.h:
1793
1794 2018-08-21  Antti Koivisto  <antti@apple.com>
1795
1796         Allow creating WeakPtrs to const objects
1797         https://bugs.webkit.org/show_bug.cgi?id=188785
1798
1799         Reviewed by Geoffrey Garen.
1800
1801         Remove some unneeded const_casts.
1802
1803         * css/MediaQueryEvaluator.cpp:
1804         (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
1805         (WebCore::MediaQueryEvaluator::evaluate const):
1806         * css/MediaQueryEvaluator.h:
1807         * rendering/FloatingObjects.cpp:
1808         (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
1809         (WebCore::ComputeFloatOffsetForFloatLayoutAdapter::ComputeFloatOffsetForFloatLayoutAdapter):
1810         (WebCore::ComputeFloatOffsetForLineLayoutAdapter::ComputeFloatOffsetForLineLayoutAdapter):
1811         (WebCore::FindNextFloatLogicalBottomAdapter::FindNextFloatLogicalBottomAdapter):
1812         (WebCore::FloatingObjects::FloatingObjects):
1813         * rendering/FloatingObjects.h:
1814         (WebCore::FloatingObjects::renderer const):
1815
1816 2018-08-21  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1817
1818         Support "name" option for dedicated workers
1819         https://bugs.webkit.org/show_bug.cgi?id=188779
1820
1821         Reviewed by Joseph Pecoraro.
1822
1823         This patch adds `new Worker(url, { name: "Worker Name" })` option support[1].
1824         This name can be accessible from `self.name` of DedicatedWorkerGlobalScope.
1825         It is useful for debugging dedicated workers if the inspector can show the
1826         names of the workers. This enhancement is tracked by [2].
1827
1828         [1]: https://github.com/whatwg/html/issues/2477
1829         [2]: https://bugs.webkit.org/show_bug.cgi?id=164678
1830
1831         * workers/DedicatedWorkerGlobalScope.cpp:
1832         (WebCore::DedicatedWorkerGlobalScope::create):
1833         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
1834         Hold `name` member.
1835
1836         * workers/DedicatedWorkerGlobalScope.h:
1837         * workers/DedicatedWorkerGlobalScope.idl:
1838         Add `name` attribute.
1839
1840         * workers/DedicatedWorkerThread.cpp:
1841         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
1842         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
1843         * workers/DedicatedWorkerThread.h:
1844         * workers/Worker.cpp:
1845         (WebCore::Worker::Worker):
1846         (WebCore::Worker::create):
1847         (WebCore::Worker::notifyFinished):
1848         * workers/Worker.h:
1849         * workers/Worker.idl:
1850         Add WorkerOptions for dedicated worker creation.
1851
1852         * workers/WorkerGlobalScopeProxy.h:
1853         * workers/WorkerMessagingProxy.cpp:
1854         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
1855         * workers/WorkerMessagingProxy.h:
1856         * workers/WorkerThread.cpp:
1857         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
1858         Isolate copy the given `name` to pass the worker thread.
1859
1860         (WebCore::WorkerThread::WorkerThread):
1861         (WebCore::WorkerThread::workerThread):
1862         * workers/WorkerThread.h:
1863         * workers/service/context/ServiceWorkerThread.cpp:
1864         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
1865         (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
1866         * workers/service/context/ServiceWorkerThread.h:
1867
1868 2018-08-21  Per Arne Vollan  <pvollan@apple.com>
1869
1870         [WebGL] Contexts are not updated when display configuration changed.
1871         https://bugs.webkit.org/show_bug.cgi?id=188750
1872
1873         Reviewed by Brent Fulgham.
1874
1875         Calling CGDisplayRegisterReconfigurationCallback in GraphicsContext3DManager::addContext
1876         returns kCGErrorSuccess when WindowServer access is blocked in the WebContent process,
1877         but the callback function is never called. We should register the callback function in
1878         the UI process, and send a message to the WebContent process when the display
1879         configuration changed.
1880
1881         Test: fast/canvas/webgl/context-update-on-display-configuration.html
1882
1883         * WebCore.xcodeproj/project.pbxproj:
1884         * platform/graphics/GraphicsContext3DManager.cpp:
1885         (WebCore::GraphicsContext3DManager::displayWasReconfigured):
1886         (WebCore::GraphicsContext3DManager::addContext):
1887         (WebCore::GraphicsContext3DManager::removeContext):
1888         (WebCore::displayWasReconfigured): Deleted.
1889         * platform/graphics/GraphicsContext3DManager.h:
1890
1891 2018-08-21  John Wilander  <wilander@apple.com>
1892
1893         Make ResourceLoadObserver::logWebSocketLoading() handle websockets in detached frames
1894         https://bugs.webkit.org/show_bug.cgi?id=188757
1895         <rdar://problem/38713390>
1896
1897         Reviewed by Alex Christensen.
1898
1899         Test: http/tests/websocket/construct-in-detached-frame-resource-load-statistics.html
1900
1901         * Modules/websockets/WebSocket.cpp:
1902         (WebCore::WebSocket::connect):
1903             Now logs even when a frame doesn't exist.
1904         * loader/ResourceLoadObserver.cpp:
1905         (WebCore::ResourceLoadObserver::shouldLog const):
1906             Now takes boolean 'usesEphemeralSession' instead of a page to support logging when there is no page.
1907         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1908             Changed to send a boolean to ResourceLoadObserver::shouldLog().
1909         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1910             Changed to:
1911             - receive the main frame's URL and a boolean for ephemeral sessions instead of the Frame.
1912             - send a boolean to ResourceLoadObserver::shouldLog().
1913             - No longer call areDomainsAssociated(). It is being removed in https://bugs.webkit.org/show_bug.cgi?id=188756.
1914         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1915             Changed to send a boolean to ResourceLoadObserver::shouldLog().
1916         * loader/ResourceLoadObserver.h:
1917
1918 2018-08-21  Daniel Bates  <dabates@apple.com>
1919
1920         Disallow navigations when page cache updates the current document of the frame
1921         https://bugs.webkit.org/show_bug.cgi?id=188422
1922
1923         Reviewed by Ryosuke Niwa.
1924
1925         Make use of NavigationDisabler to disallow navigations when associating the cached
1926         document back with its frame (i.e. calling Frame::setDocument()).
1927
1928         When we associate a cached document with its frame we will construct its render tree
1929         and run post style resolution callbacks that can do anything, including performing
1930         a frame load. Until page restoration is comnplete the frame tree is in a transient
1931         state that makes reasoning about it difficult and error prone. We should not allow
1932         navigations in this state.
1933
1934         Test: fast/history/go-back-to-object-subframe.html
1935
1936         * loader/FrameLoader.cpp:
1937         (WebCore::FrameLoader::open):
1938
1939 2018-08-21  Daniel Bates  <dabates@apple.com>
1940
1941         Replace TextCheckingTypeMask with OptionSet
1942         https://bugs.webkit.org/show_bug.cgi?id=188678
1943
1944         Reviewed by Antti Koivisto.
1945
1946         Replaces TextCheckingTypeMask with an OptionSet to improve type safety and code clarity. Additionally
1947         change the values of TextCheckingType such that all the enumerators fit within an uint8_t.
1948
1949         * PlatformMac.cmake:
1950         * SourcesCocoa.txt:
1951         * WebCore.xcodeproj/project.pbxproj:
1952         * accessibility/AccessibilityObject.cpp:
1953         (WebCore::AccessibilityObject::hasMisspelling const):
1954         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1955         (AXAttributeStringSetSpelling):
1956         * editing/AlternativeTextController.cpp:
1957         (WebCore::AlternativeTextController::timerFired):
1958         (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
1959         * editing/Editor.cpp:
1960         (WebCore::Editor::replaceSelectionWithFragment):
1961         (WebCore::Editor::markMisspellingsAfterTypingToWord):
1962         (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
1963         (WebCore::isAutomaticTextReplacementType):
1964         (WebCore::Editor::markAndReplaceFor): For now, change a local variable from const to non-const to work
1965         around the following MSVC compiler bug: <https://developercommunity.visualstudio.com/content/problem/316713/msvc-cant-compile-webkits-optionsetcontainsany.html>.
1966         (WebCore::Editor::markMisspellingsAndBadGrammar):
1967         (WebCore::Editor::updateMarkersForWordsAffectedByEditing):
1968         (WebCore::Editor::editorUIUpdateTimerFired):
1969         (WebCore::Editor::resolveTextCheckingTypeMask):
1970         * editing/Editor.h:
1971         * editing/SpellChecker.cpp:
1972         (WebCore::SpellCheckRequest::SpellCheckRequest):
1973         (WebCore::SpellCheckRequest::create):
1974         (WebCore::SpellChecker::didCheckSucceed):
1975         * editing/SpellChecker.h:
1976         * editing/TextCheckingHelper.cpp:
1977         (WebCore::findGrammaticalErrors):
1978         (WebCore::findMisspellings):
1979         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
1980         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const):
1981         (WebCore::checkTextOfParagraph):
1982         * editing/TextCheckingHelper.h:
1983         * loader/EmptyClients.cpp:
1984         * platform/text/TextCheckerClient.h:
1985         * platform/text/TextChecking.h: Remove TextCheckingTypeMask. Reorganized the fields of TextCheckingRequestData
1986         to coallesce padding and move it to the end of class. Also used default initializer syntax and defaulted (= default)
1987         the default constructor of TextCheckingRequestData, removing the need for a user-defined default constructor.
1988         (WebCore::TextCheckingRequestData::TextCheckingRequestData):
1989         (WebCore::TextCheckingRequestData::text const): Changed return type from String to const String&
1990         to avoid unnecessary ref-count churn for callers that do not need to take a shared ownership in
1991         this string.
1992         (WebCore::TextCheckingRequestData::checkingTypes const): Renamed; formerly named mask.
1993         (WebCore::TextCheckingRequestData::mask const): Deleted.
1994         * platform/text/mac/TextCheckingMac.mm: Added.
1995         (WebCore::nsTextCheckingTypes):
1996         * testing/Internals.cpp:
1997         (WebCore::Internals::handleAcceptedCandidate):
1998
1999 2018-08-21  Fujii Hironori  <Hironori.Fujii@sony.com>
2000
2001         Don't place "using namespace XXX;" in global space for unified source builds
2002         https://bugs.webkit.org/show_bug.cgi?id=188739
2003
2004         Reviewed by Yusuke Suzuki.
2005
2006         No new tests (No behavior change).
2007
2008         * html/track/AudioTrackList.cpp:
2009         * html/track/TextTrackList.cpp:
2010         * html/track/VideoTrackList.cpp:
2011         * page/SecurityOriginData.cpp:
2012         * page/TextIndicator.cpp:
2013         * platform/geoclue/GeolocationProviderGeoclue.cpp:
2014         * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
2015         * platform/graphics/win/FullScreenController.cpp:
2016         * platform/mediastream/CaptureDeviceManager.cpp:
2017         * platform/mock/MediaPlaybackTargetPickerMock.cpp:
2018         * svg/animation/SMILTime.cpp:
2019         * testing/js/WebCoreTestSupport.cpp:
2020         * xml/XPathParser.cpp:
2021
2022 2018-08-21  Philippe Normand  <philn@igalia.com>
2023
2024         [GStreamer] Warn early about incomplete MSE track switching support
2025         https://bugs.webkit.org/show_bug.cgi?id=188653
2026
2027         Reviewed by Xabier Rodriguez-Calvar.
2028
2029         The proper track switching support shall be fixed at some point by:
2030         https://bugs.webkit.org/show_bug.cgi?id=182531.
2031
2032         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2033         (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Remove redundant test.
2034         (WebCore::MediaPlayerPrivateGStreamer::enableTrack): Exit early if
2035         this method is called by the MSE player.
2036
2037 2018-08-21  Philippe Normand  <philn@igalia.com>
2038
2039         [GStreamer][MSE] Generic main thread notification support
2040         https://bugs.webkit.org/show_bug.cgi?id=188647
2041
2042         Reviewed by Xabier Rodriguez-Calvar.
2043
2044         Using GstBus for main thread notifications has the side effect of "leaking" the
2045         application messages to the media player, leading to CPU cycles wasting.
2046
2047         No new tests, existing MSE tests cover this change.
2048
2049         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
2050         (webkit_media_src_init):
2051         (webKitMediaSrcFinalize):
2052         (webKitMediaSrcSetMediaPlayerPrivate):
2053         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h:
2054
2055 2018-08-21  Philippe Normand  <philn@igalia.com>
2056
2057         [GStreamer][MSE] Remove parsers from playback pipeline
2058         https://bugs.webkit.org/show_bug.cgi?id=188646
2059
2060         Reviewed by Xabier Rodriguez-Calvar.
2061
2062         Decodebin already includes parsers in front of the decoders.
2063
2064         No new tests, existing MSE tests cover this change.
2065
2066         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
2067         (WebCore::PlaybackPipeline::addSourceBuffer):
2068         (WebCore::PlaybackPipeline::attachTrack):
2069         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
2070         (webKitMediaSrcLinkSourcePad):
2071         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h:
2072
2073 2018-08-21  Commit Queue  <commit-queue@webkit.org>
2074
2075         Unreviewed, rolling out r234979.
2076         https://bugs.webkit.org/show_bug.cgi?id=188780
2077
2078         broke ubuntu LTS build (Requested by philn on #webkit).
2079
2080         Reverted changeset:
2081
2082         "[GTK] Never return an uninitialized ImageGStreamer object."
2083         https://bugs.webkit.org/show_bug.cgi?id=188305
2084         https://trac.webkit.org/changeset/234979
2085
2086 2018-08-21  Saam barati  <sbarati@apple.com>
2087
2088         JSRunLoopTimer may run part of a member function after it's destroyed
2089         https://bugs.webkit.org/show_bug.cgi?id=188426
2090
2091         Reviewed by Mark Lam.
2092
2093         * page/cocoa/ResourceUsageThreadCocoa.mm:
2094         (WebCore::ResourceUsageThread::platformThreadBody):
2095         * page/linux/ResourceUsageThreadLinux.cpp:
2096         (WebCore::ResourceUsageThread::platformThreadBody):
2097
2098 2018-08-20  Devin Rousso  <drousso@apple.com>
2099
2100         Web Inspector: allow breakpoints to be set for specific event listeners
2101         https://bugs.webkit.org/show_bug.cgi?id=183138
2102
2103         Reviewed by Joseph Pecoraro.
2104
2105         Test: inspector/dom/breakpoint-for-event-listener.html
2106
2107         * inspector/agents/InspectorDOMAgent.h:
2108         * inspector/agents/InspectorDOMAgent.cpp:
2109         (WebCore::InspectorDOMAgent::getEventListenersForNode):
2110         (WebCore::InspectorDOMAgent::setEventListenerDisabled):
2111         (WebCore::InspectorDOMAgent::setBreakpointForEventListener): Added.
2112         (WebCore::InspectorDOMAgent::removeBreakpointForEventListener): Added.
2113         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
2114         (WebCore::InspectorDOMAgent::willRemoveEventListener):
2115         (WebCore::InspectorDOMAgent::isEventListenerDisabled):
2116         (WebCore::InspectorDOMAgent::hasBreakpointForEventListener): Added.
2117         (WebCore::InspectorDOMAgent::idForEventListener): Added.
2118         Rework the event listener data structure to be based on ID instead of `EventListener`, since
2119         it is possible to have the same `EventListener` be used for multiple events.
2120
2121         * inspector/agents/InspectorDOMDebuggerAgent.h:
2122         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
2123         (WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint):
2124         (WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint):
2125         (WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint):
2126         (WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint):
2127         (WebCore::InspectorDOMDebuggerAgent::willHandleEvent): Added.
2128         (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
2129         For DOM events, also check to see if there is a matching event listener specific breakpoint
2130         set via the DOMAgent, and break on it if one is found.
2131
2132         * inspector/InspectorInstrumentation.h:
2133         * inspector/InspectorInstrumentation.cpp:
2134         (WebCore::InspectorInstrumentation::didInstallTimerImpl):
2135         (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
2136         (WebCore::InspectorInstrumentation::willHandleEventImpl):
2137         (WebCore::InspectorInstrumentation::willFireTimerImpl):
2138         (WebCore::InspectorInstrumentation::pauseOnNativeEventIfNeeded):
2139         (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
2140         (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
2141         (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
2142         Split off `pauseOnNativeEventIfNeeded` to only handle non-DOM events, since all DOM events
2143         would already only go through `willHandleEvent`.
2144
2145 2018-08-20  Michael Catanzaro  <mcatanzaro@igalia.com>
2146
2147         [CMake] Sync unified build with Cocoa ports
2148         https://bugs.webkit.org/show_bug.cgi?id=188732
2149
2150         Reviewed by Tim Horton.
2151
2152         For iOS, disambiguate between ::WebEvent declared in PlatformKeyboardEvent.h and
2153         WebCore::WebEvent declared in WebEvent.h. It's expected that we'll have to deal with random
2154         issues like this when modifying unrelated source files in higher-level projects, since any
2155         change to the sources list changes which files get bundled together, and headers from
2156         lower-level projects that were not included before may now be included together.
2157
2158         * platform/PlatformKeyboardEvent.h:
2159         (WebCore::PlatformKeyboardEvent::event const):
2160
2161 2018-08-20  David Kilzer  <ddkilzer@apple.com>
2162
2163         REGRESSION (r223192): Remove invalid `path` for Modules/geolocation/ios folder
2164
2165         * WebCore.xcodeproj/project.pbxproj: Remove invalid `path`
2166         setting for WebCore/Modules/geolocation/ios folder. This was
2167         found while working on a script for Bug 188754: Tool to fix
2168         folders that should map to directories in Xcode project files.
2169
2170 2018-08-20  David Kilzer  <ddkilzer@apple.com>
2171
2172         REGRESSION (r235015): Xcode changes `mainGroup` name when updating WebCore project file
2173
2174         * WebCore.xcodeproj/project.pbxproj:
2175         - Change `name` to "WebCore" within the group used by
2176           `mainGroup` so Xcode won't keep changing its value back to
2177           "WebKit".
2178
2179 2018-08-20  Jeremy Jones  <jeremyj@apple.com>
2180
2181         UIWebView crashes while attempting to play youtube video on phone
2182         https://bugs.webkit.org/show_bug.cgi?id=188351
2183         rdar://problem/42489664
2184
2185         Reviewed by David Kilzer.
2186
2187         Test will be incorporated with fix for 188749, which will test both fixes.
2188
2189         VideoFullscreenControllerContext must remove unretained reference to it from m_playbackModel during cleanup.
2190
2191         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2192         (VideoFullscreenControllerContext::didCleanupFullscreen):
2193
2194 2018-08-20  Eric Carlson  <eric.carlson@apple.com>
2195
2196         [MediaStream] Move capture device monitoring to WebKit
2197         https://bugs.webkit.org/show_bug.cgi?id=188521
2198         <rdar://problem/43251787>
2199
2200         Reviewed by Youenn Fablet.
2201
2202         No new tests, updated fast/mediastream/device-change-event-2.html for the changes.
2203
2204         * Modules/mediastream/MediaDevices.cpp:
2205         (WebCore::MediaDevices::MediaDevices): Device change listener is added in addEventListener.
2206         (WebCore::MediaDevices::stop): Device change listener is on the user media controller.
2207         (WebCore::MediaDevices::addEventListener): Add the device change listener only once the first
2208         event handler is added.
2209         * Modules/mediastream/MediaDevices.h:
2210
2211         * Modules/mediastream/UserMediaClient.h:
2212         * Modules/mediastream/UserMediaController.h:
2213         (WebCore::UserMediaController::addDeviceChangeObserver): Pass through to the client.
2214         (WebCore::UserMediaController::removeDeviceChangeObserver): Ditto.
2215
2216         * platform/mediastream/CaptureDeviceManager.cpp:
2217         (CaptureDeviceManager::deviceChanged): Notify RealtimeMediaSourceCenter.
2218         (nextObserverToken): Deleted.
2219         (CaptureDeviceManager::addCaptureDeviceChangedObserver): Deleted.
2220         (CaptureDeviceManager::removeCaptureDeviceChangedObserver): Deleted.
2221         * platform/mediastream/CaptureDeviceManager.h:
2222
2223         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
2224         (WebCore::RealtimeMediaSourceCenter::setDevicesChangedObserver):
2225         (WebCore::RealtimeMediaSourceCenter::captureDevicesChanged):
2226         (WebCore::observerMap): Deleted.
2227         (WebCore::RealtimeMediaSourceCenter::addDevicesChangedObserver): Deleted.
2228         (WebCore::RealtimeMediaSourceCenter::removeDevicesChangedObserver): Deleted.
2229         * platform/mediastream/RealtimeMediaSourceCenter.h:
2230
2231         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
2232         (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices): Call base class.
2233
2234         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2235         (WebCore::AVCaptureDeviceManager::deviceConnected): Ditto.
2236         (WebCore::AVCaptureDeviceManager::deviceDisconnected): Ditto.
2237
2238         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
2239         (WebCore::deviceHasInputStreams): Drive-by fix, check the number of buffers to see if the
2240         device has input streams.
2241         (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices): Use new bool parameter
2242         added to refreshAudioCaptureDevices so we won't trigger a device change event on the first scan.
2243         (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices): Add param.
2244         (WebCore::CoreAudioCaptureDeviceManager::devicesChanged): Use new param.
2245         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:
2246
2247         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2248         (WebCore::MockRealtimeMediaSourceCenter::setDevices): Don't need to call captureDevicesChanged,
2249         it is done in the UI process.
2250         (WebCore::MockRealtimeMediaSourceCenter::addDevice): Ditto.
2251         (WebCore::MockRealtimeMediaSourceCenter::removeDevice): Ditto.
2252
2253         * testing/InternalSettings.cpp:
2254         (WebCore::InternalSettings::setPageIsFocusedAndActive): New, used by updated test.
2255         * testing/Internals.h:
2256         * testing/Internals.idl:
2257
2258 2018-08-20  Rob Buis  <rbuis@igalia.com>
2259
2260         Throw an exception if window.open() gets passed a URL that cannot be parsed
2261         https://bugs.webkit.org/show_bug.cgi?id=171656
2262
2263         Reviewed by Darin Adler.
2264
2265         Throw a SyntaxError exception when an invalid url gets passed into window.open().
2266
2267         Tests: imported/w3c/web-platform-tests/url/failure.html
2268                fast/dom/Window/open-invalid-url.html
2269
2270         * page/DOMWindow.cpp:
2271         (WebCore::DOMWindow::createWindow):
2272         (WebCore::DOMWindow::open):
2273         (WebCore::DOMWindow::showModalDialog):
2274         * page/DOMWindow.h:
2275         * page/DOMWindow.idl:
2276         * testing/Internals.cpp:
2277         (WebCore::Internals::openDummyInspectorFrontend):
2278
2279 2018-08-20  Ms2ger  <Ms2ger@igalia.com>
2280
2281         [SOUP] Check length before calling soup_message_body_append_buffer.
2282         https://bugs.webkit.org/show_bug.cgi?id=176803
2283
2284         Reviewed by Carlos Garcia Campos.
2285
2286         The function has a precondition that the buffer is non-empty.
2287
2288         Test: http/tests/local/blob/send-hybrid-blob-using-open-panel.html
2289
2290         * platform/network/soup/ResourceRequestSoup.cpp:
2291         (WebCore::appendEncodedBlobItemToSoupMessageBody):
2292         (WebCore::ResourceRequest::updateSoupMessageBody const):
2293
2294 2018-08-20  Rob Buis  <rbuis@igalia.com>
2295
2296         Relax Request constructor around referrers
2297         https://bugs.webkit.org/show_bug.cgi?id=168649
2298
2299         Reviewed by Darin Adler.
2300
2301         Implement remaining part of fetch change
2302         https://github.com/whatwg/fetch/pull/377, i.e.
2303         if "parsedReferrer’s origin is not same origin with origin",
2304         then set request’s referrer to "client", instead of
2305         throwing an exception [1].
2306
2307         WebKit's new behavior matches that of Chrome and Firefox.
2308
2309         Testing is covered by existing wpt tests.
2310
2311         [1] Step 15.3.3 of https://fetch.spec.whatwg.org/#main-fetch
2312
2313         * Modules/fetch/FetchRequest.cpp:
2314         (WebCore::computeReferrer):
2315
2316 2018-08-19  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2317
2318         Shrink size of WebCore::Event further by reordering members
2319         https://bugs.webkit.org/show_bug.cgi?id=188734
2320
2321         Reviewed by Daniel Bates.
2322
2323         Since WebCore::Event is ref-counted class, it has 4bytes m_refCount at the head of the class.
2324         So placing 4bytes just after that before placing 8bytes aligned member (like pointers in 64bit
2325         platforms) can save the size of WebCore::Event further.
2326         This patch reorders members of WebCore::Event to shrink the size from 80bytes to 72bytes.
2327
2328         No behavior change.
2329
2330         * dom/Event.cpp:
2331         (WebCore::Event::Event):
2332         * dom/Event.h:
2333
2334 2018-08-18  David Kilzer  <ddkilzer@apple.com>
2335
2336         Let Xcode have its way with the WebCore project
2337
2338         * WebCore.xcodeproj/project.pbxproj:
2339         - Let Xcode sort recently added resources by unique ID.
2340         - Manually change the `mainGroup` name from "WebKit" to
2341           "WebCore".  There's no need to do this other than to make the
2342           inside of the proverbial cabinet match the outside.  It's been
2343           this way since the project file was committed in r9857.
2344
2345 2018-08-18  Ali Juma  <ajuma@chromium.org>
2346
2347         [IntersectionObserver] Fire an initial dummy notification
2348         https://bugs.webkit.org/show_bug.cgi?id=188670
2349
2350         Reviewed by Simon Fraser.
2351
2352         Add logic to track ongoing intersection observations. Create an IntersectionObserverRegistration
2353         and fire a single dummy notification for each one.
2354
2355         Test: intersection-observer/root-element-moved.html
2356         Also tested by existing tests in imported/w3c/web-platform-tests/intersection-observer.
2357
2358         * dom/Document.cpp:
2359         (WebCore::Document::~Document):
2360         (WebCore::Document::addIntersectionObserver):
2361         (WebCore::Document::removeIntersectionObserver):
2362         (WebCore::Document::updateIntersectionObservations):
2363         (WebCore::Document::notifyIntersectionObserversTimerFired):
2364         * dom/Document.h:
2365         (WebCore::Document::numberOfIntersectionObservers const):
2366         * dom/Element.cpp:
2367         (WebCore::Element::didMoveToNewDocument):
2368         (WebCore::Element::disconnectFromIntersectionObservers):
2369         * page/IntersectionObserver.cpp:
2370         (WebCore::IntersectionObserver::create):
2371         (WebCore::IntersectionObserver::IntersectionObserver):
2372         (WebCore::IntersectionObserver::~IntersectionObserver):
2373         (WebCore::IntersectionObserver::observe):
2374         (WebCore::IntersectionObserver::unobserve):
2375         (WebCore::IntersectionObserver::disconnect):
2376         (WebCore::IntersectionObserver::takeRecords):
2377         (WebCore::IntersectionObserver::targetDestroyed):
2378         (WebCore::IntersectionObserver::removeTargetRegistration):
2379         (WebCore::IntersectionObserver::removeAllTargets):
2380         (WebCore::IntersectionObserver::rootDestroyed):
2381         (WebCore::IntersectionObserver::appendQueuedEntry):
2382         (WebCore::IntersectionObserver::notify):
2383         * page/IntersectionObserver.h:
2384         (WebCore::IntersectionObserver::trackingDocument):
2385         (WebCore::IntersectionObserver:: const):
2386         (WebCore::IntersectionObserver::hasObservationTargets const):
2387         * page/IntersectionObserver.idl:
2388         * testing/Internals.cpp:
2389         (WebCore::Internals::numberOfIntersectionObservers const):
2390         * testing/Internals.h:
2391         * testing/Internals.idl:
2392
2393 2018-08-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2394
2395         [iOS] Paste is missing from callout bar when pasteboard only contains custom data
2396         https://bugs.webkit.org/show_bug.cgi?id=184271
2397         <rdar://problem/39256708>
2398
2399         Reviewed by Ryosuke Niwa.
2400
2401         Export a couple of WebCore functions for use in WebKit.
2402
2403         * dom/Document.h:
2404         * platform/Pasteboard.h:
2405
2406 2018-08-17  Ryosuke Niwa  <rniwa@webkit.org>
2407
2408         Pack booleans in Event into a bitfield
2409         https://bugs.webkit.org/show_bug.cgi?id=188713
2410
2411         Reviewed by Daniel Bates.
2412
2413         Use bitfields for booleans in Event class.
2414
2415         * dom/Event.cpp:
2416         (WebCore::Event::Event):
2417         * dom/Event.h:
2418         (WebCore::Event::IsComposed): Added.
2419         (WebCore::Event): Packed booleans into a bitfield.
2420
2421 2018-08-17  Aditya Keerthi  <akeerthi@apple.com>
2422
2423         [Datalist][iOS] Display suggestions for input[type=color]
2424         https://bugs.webkit.org/show_bug.cgi?id=188669
2425
2426         Reviewed by Tim Horton.
2427
2428         Expose suggestedColors() in HTMLInputElement in order to allow the UIProcess to
2429         access the list of suggested colors from a <datalist> element.
2430
2431         * html/ColorInputType.cpp:
2432         (WebCore::ColorInputType::suggestedColors const):
2433         * html/ColorInputType.h:
2434         * html/HTMLInputElement.cpp:
2435         (WebCore::HTMLInputElement::suggestedColors const):
2436         * html/HTMLInputElement.h:
2437         * html/InputType.cpp:
2438         (WebCore::InputType::suggestedColors const):
2439         * html/InputType.h:
2440         * platform/ColorChooserClient.h:
2441
2442 2018-08-17  Alex Christensen  <achristensen@webkit.org>
2443
2444         Clean up CSSSelectorList after r234825
2445         https://bugs.webkit.org/show_bug.cgi?id=188566
2446
2447         Reviewed by Megan Gardner.
2448
2449         This is responding to Darin's feedback in https://bugs.webkit.org/show_bug.cgi?id=188539
2450
2451         * css/CSSSelectorList.cpp:
2452         (WebCore::CSSSelectorList::operator=): Deleted.
2453         * css/CSSSelectorList.h:
2454         (WebCore::CSSSelectorList::CSSSelectorList):
2455         * css/parser/CSSParserImpl.cpp:
2456         (WebCore::CSSParserImpl::parsePageSelector):
2457         * css/parser/CSSSelectorParser.cpp:
2458         (WebCore::CSSSelectorParser::consumeComplexSelectorList):
2459         (WebCore::CSSSelectorParser::consumeCompoundSelectorList):
2460
2461 2018-08-17  Brent Fulgham  <bfulgham@apple.com>
2462
2463         Remove Adobe SSO exception now that StorageAccess API is available
2464         https://bugs.webkit.org/show_bug.cgi?id=188710
2465         <rdar://problem/35056707>
2466
2467         Reviewed by Alex Christensen.
2468
2469         Remove custom quirk now that proper API exists to allow the same functions.
2470
2471         * loader/ResourceLoadObserver.cpp:
2472         (WebCore::ResourceLoadObserver::logSubresourceLoading): Remove unneeded quirk.
2473         (WebCore::resourceNeedsSSOQuirk): Deleted.
2474
2475 2018-08-17  Ryosuke Niwa  <rniwa@webkit.org>
2476
2477         Replace canBubble and cancelable booleans in Event by enum classes
2478         https://bugs.webkit.org/show_bug.cgi?id=188692
2479         <rdar://problem/43411944>
2480
2481         Rubber-stamped by Alex Christensen.
2482
2483         Make these enum classes uint8_t.
2484
2485         * dom/Event.h:
2486
2487 2018-08-17  Alex Christensen  <achristensen@webkit.org>
2488
2489         Add some plumbing for safe browsing
2490         https://bugs.webkit.org/show_bug.cgi?id=188709
2491
2492         Reviewed by Tim Horton.
2493
2494         No change in behavior.  Just passing around unused booleans.
2495         We will need this for a way to load a page even though safe browsing says it's unsafe.
2496
2497         * WebCore.xcodeproj/project.pbxproj:
2498         * loader/EmptyClients.cpp:
2499         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2500         * loader/EmptyFrameLoaderClient.h:
2501         * loader/FrameLoadRequest.h:
2502         (WebCore::FrameLoadRequest::setShouldSkipSafeBrowsingCheck):
2503         (WebCore::FrameLoadRequest::shouldSkipSafeBrowsingCheck):
2504         * loader/FrameLoader.cpp:
2505         (WebCore::FrameLoader::loadArchive):
2506         (WebCore::FrameLoader::loadURL):
2507         (WebCore::FrameLoader::load):
2508         (WebCore::FrameLoader::loadWithNavigationAction):
2509         (WebCore::FrameLoader::loadWithDocumentLoader):
2510         (WebCore::FrameLoader::shouldReloadToHandleUnreachableURL):
2511         (WebCore::FrameLoader::reloadWithOverrideEncoding):
2512         (WebCore::FrameLoader::reload):
2513         (WebCore::FrameLoader::loadPostRequest):
2514         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
2515         (WebCore::FrameLoader::loadDifferentDocumentItem):
2516         * loader/FrameLoader.h:
2517         (WebCore::FrameLoader::loadWithDocumentLoader):
2518         (WebCore::FrameLoader::loadWithNavigationAction):
2519         * loader/FrameLoaderClient.h:
2520         * loader/PolicyChecker.cpp:
2521         (WebCore::PolicyChecker::checkNavigationPolicy):
2522         * loader/PolicyChecker.h:
2523         * loader/ShouldSkipSafeBrowsingCheck.h: Added.
2524
2525 2018-08-16  Ryosuke Niwa  <rniwa@webkit.org>
2526
2527         Replace canBubble and cancelable booleans in Event by enum classes
2528         https://bugs.webkit.org/show_bug.cgi?id=188692
2529
2530         Reviewed by Alex Christensen.
2531
2532         Replaced booleans indicating whether an event can bubble and an event is cancelable
2533         by two enum classes: CanBubble and IsCancelable.
2534
2535         No new tests since there should be no behavioral changes.
2536
2537         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp:
2538         (WebCore::WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent):
2539         * Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp:
2540         (WebCore::ApplePayPaymentAuthorizedEvent::ApplePayPaymentAuthorizedEvent):
2541         * Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp:
2542         (WebCore::ApplePayPaymentMethodSelectedEvent::ApplePayPaymentMethodSelectedEvent):
2543         * Modules/applepay/ApplePaySession.cpp:
2544         (WebCore::ApplePaySession::didCancelPaymentSession):
2545         * Modules/applepay/ApplePayShippingContactSelectedEvent.cpp:
2546         (WebCore::ApplePayShippingContactSelectedEvent::ApplePayShippingContactSelectedEvent):
2547         * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
2548         (WebCore::ApplePayShippingMethodSelectedEvent::ApplePayShippingMethodSelectedEvent):
2549         * Modules/applepay/ApplePayValidateMerchantEvent.cpp:
2550         (WebCore::ApplePayValidateMerchantEvent::ApplePayValidateMerchantEvent):
2551         * Modules/encryptedmedia/MediaKeySession.cpp:
2552         (WebCore::MediaKeySession::updateKeyStatuses):
2553         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
2554         (WebCore::WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent):
2555         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
2556         (WebCore::WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent):
2557         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
2558         (WebCore::WebKitMediaKeySession::addKeyTimerFired):
2559         (WebCore::WebKitMediaKeySession::sendError):
2560         * Modules/gamepad/GamepadEvent.cpp:
2561         (WebCore::GamepadEvent::GamepadEvent):
2562         * Modules/indexeddb/IDBDatabase.cpp:
2563         (WebCore::IDBDatabase::connectionToServerLost):
2564         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2565         (WebCore::IDBOpenDBRequest::onError):
2566         (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
2567         (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
2568         (WebCore::IDBOpenDBRequest::onSuccess):
2569         * Modules/indexeddb/IDBRequest.cpp:
2570         (WebCore::IDBRequest::onError):
2571         (WebCore::IDBRequest::onSuccess):
2572         * Modules/indexeddb/IDBRequestCompletionEvent.cpp:
2573         (WebCore::IDBRequestCompletionEvent::IDBRequestCompletionEvent):
2574         * Modules/indexeddb/IDBRequestCompletionEvent.h:
2575         (WebCore::IDBRequestCompletionEvent::create):
2576         * Modules/indexeddb/IDBTransaction.cpp:
2577         (WebCore::IDBTransaction::fireOnComplete):
2578         (WebCore::IDBTransaction::fireOnAbort):
2579         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
2580         (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
2581         * Modules/mediasession/MediaSession.cpp:
2582         (WebCore::MediaSession::skipToNextTrack):
2583         (WebCore::MediaSession::skipToPreviousTrack):
2584         * Modules/mediasource/MediaSource.cpp:
2585         (WebCore::MediaSource::scheduleEvent):
2586         * Modules/mediasource/SourceBuffer.cpp:
2587         (WebCore::SourceBuffer::scheduleEvent):
2588         * Modules/mediasource/SourceBufferList.cpp:
2589         (WebCore::SourceBufferList::scheduleEvent):
2590         * Modules/mediastream/MediaDevices.cpp:
2591         (WebCore::MediaDevices::scheduledEventTimerFired):
2592         * Modules/mediastream/MediaStream.cpp:
2593         (WebCore::MediaStream::internalAddTrack):
2594         (WebCore::MediaStream::internalRemoveTrack):
2595         * Modules/mediastream/MediaStreamEvent.cpp:
2596         (WebCore::MediaStreamEvent::create):
2597         (WebCore::MediaStreamEvent::MediaStreamEvent):
2598         * Modules/mediastream/MediaStreamEvent.h:
2599         * Modules/mediastream/MediaStreamTrack.cpp:
2600         (WebCore::MediaStreamTrack::trackEnded):
2601         (WebCore::MediaStreamTrack::trackMutedChanged):
2602         * Modules/mediastream/MediaStreamTrackEvent.cpp:
2603         (WebCore::MediaStreamTrackEvent::create):
2604         (WebCore::MediaStreamTrackEvent::MediaStreamTrackEvent):
2605         * Modules/mediastream/MediaStreamTrackEvent.h:
2606         * Modules/mediastream/OverconstrainedErrorEvent.h:
2607         (WebCore::OverconstrainedErrorEvent::create):
2608         (WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent):
2609         * Modules/mediastream/PeerConnectionBackend.cpp:
2610         (WebCore::PeerConnectionBackend::fireICECandidateEvent):
2611         (WebCore::PeerConnectionBackend::doneGatheringCandidates):
2612         (WebCore::PeerConnectionBackend::updateSignalingState):
2613         * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
2614         (WebCore::RTCDTMFToneChangeEvent::RTCDTMFToneChangeEvent):
2615         * Modules/mediastream/RTCDataChannel.cpp:
2616         (WebCore::RTCDataChannel::didChangeReadyState):
2617         (WebCore::RTCDataChannel::didDetectError):
2618         (WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
2619         * Modules/mediastream/RTCDataChannelEvent.cpp:
2620         (WebCore::RTCDataChannelEvent::create):
2621         (WebCore::RTCDataChannelEvent::RTCDataChannelEvent):
2622         * Modules/mediastream/RTCDataChannelEvent.h:
2623         * Modules/mediastream/RTCPeerConnection.cpp:
2624         (WebCore::RTCPeerConnection::updateIceGatheringState):
2625         (WebCore::RTCPeerConnection::updateIceConnectionState):
2626         (WebCore::RTCPeerConnection::updateConnectionState):
2627         (WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent):
2628         * Modules/mediastream/RTCPeerConnectionIceEvent.cpp:
2629         (WebCore::RTCPeerConnectionIceEvent::create):
2630         (WebCore::RTCPeerConnectionIceEvent::RTCPeerConnectionIceEvent):
2631         * Modules/mediastream/RTCPeerConnectionIceEvent.h:
2632         * Modules/mediastream/RTCTrackEvent.cpp:
2633         (WebCore::RTCTrackEvent::create):
2634         (WebCore::RTCTrackEvent::RTCTrackEvent):
2635         * Modules/mediastream/RTCTrackEvent.h:
2636         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2637         (WebCore::LibWebRTCMediaEndpoint::addRemoteStream):
2638         (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
2639         (WebCore::LibWebRTCMediaEndpoint::addDataChannel):
2640         * Modules/notifications/Notification.cpp:
2641         (WebCore::Notification::dispatchShowEvent):
2642         (WebCore::Notification::dispatchClickEvent):
2643         (WebCore::Notification::dispatchCloseEvent):
2644         (WebCore::Notification::dispatchErrorEvent):
2645         * Modules/paymentrequest/MerchantValidationEvent.cpp:
2646         (WebCore::MerchantValidationEvent::MerchantValidationEvent):
2647         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
2648         (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
2649         * Modules/plugins/QuickTimePluginReplacement.mm:
2650         (WebCore::QuickTimePluginReplacement::postEvent):
2651         * Modules/speech/SpeechSynthesisEvent.cpp:
2652         (WebCore::SpeechSynthesisEvent::SpeechSynthesisEvent):
2653         * Modules/webaudio/AudioContext.cpp:
2654         (WebCore::AudioContext::setState):
2655         * Modules/webaudio/AudioProcessingEvent.cpp:
2656         (WebCore::AudioProcessingEvent::AudioProcessingEvent):
2657         * Modules/webaudio/AudioScheduledSourceNode.cpp:
2658         (WebCore::AudioScheduledSourceNode::finish):
2659         * Modules/webaudio/OfflineAudioCompletionEvent.cpp:
2660         (WebCore::OfflineAudioCompletionEvent::OfflineAudioCompletionEvent):
2661         * Modules/websockets/CloseEvent.h:
2662         (WebCore::CloseEvent::CloseEvent):
2663         * Modules/websockets/WebSocket.cpp:
2664         (WebCore::WebSocket::didConnect):
2665         (WebCore::WebSocket::dispatchOrQueueErrorEvent):
2666         * Modules/webvr/VRDisplayEvent.cpp:
2667         (WebCore::VRDisplayEvent::VRDisplayEvent):
2668         * accessibility/AccessibilityObject.cpp:
2669         (WebCore::AccessibilityObject::dispatchAccessibilityEventWithType const):
2670         * accessibility/AccessibleSetValueEvent.cpp:
2671         (WebCore::AccessibleSetValueEvent::AccessibleSetValueEvent):
2672         * animation/AnimationPlaybackEvent.cpp:
2673         (WebCore::AnimationPlaybackEvent::AnimationPlaybackEvent):
2674         * dom/AbortSignal.cpp:
2675         (WebCore::AbortSignal::abort):
2676         * dom/AnimationEvent.cpp:
2677         (WebCore::AnimationEvent::AnimationEvent):
2678         * dom/BeforeLoadEvent.h:
2679         * dom/BeforeTextInsertedEvent.cpp:
2680         (WebCore::BeforeTextInsertedEvent::BeforeTextInsertedEvent):
2681         * dom/BeforeUnloadEvent.cpp:
2682         (WebCore::BeforeUnloadEvent::BeforeUnloadEvent):
2683         * dom/CharacterData.cpp:
2684         (WebCore::CharacterData::dispatchModifiedEvent):
2685         * dom/CompositionEvent.cpp:
2686         (WebCore::CompositionEvent::CompositionEvent):
2687         * dom/ContainerNode.cpp:
2688         (WebCore::dispatchChildInsertionEvents):
2689         (WebCore::dispatchChildRemovalEvents):
2690         * dom/DeviceMotionEvent.cpp:
2691         (WebCore::DeviceMotionEvent::DeviceMotionEvent):
2692         * dom/DeviceOrientationEvent.cpp:
2693         (WebCore::DeviceOrientationEvent::DeviceOrientationEvent):
2694         * dom/Document.cpp:
2695         (WebCore::Document::setReadyState):
2696         (WebCore::Document::visibilityStateChanged):
2697         (WebCore::Document::finishedParsing):
2698         (WebCore::Document::dispatchFullScreenChangeOrErrorEvent):
2699         (WebCore::Document::orientationChanged):
2700         * dom/DocumentEventQueue.cpp:
2701         (WebCore::DocumentEventQueue::enqueueOrDispatchScrollEvent):
2702         (WebCore::DocumentEventQueue::enqueueScrollEvent):
2703         (WebCore::DocumentEventQueue::enqueueResizeEvent):
2704         * dom/DocumentEventQueue.h:
2705         * dom/Element.cpp:
2706         (WebCore::Element::dispatchMouseEvent):
2707         (WebCore::Element::dispatchFocusInEvent):
2708         (WebCore::Element::dispatchFocusOutEvent):
2709         (WebCore::Element::dispatchFocusEvent):
2710         (WebCore::Element::dispatchBlurEvent):
2711         (WebCore::Element::dispatchWebKitImageReadyEventForTesting):
2712         * dom/ErrorEvent.cpp:
2713         (WebCore::ErrorEvent::ErrorEvent):
2714         * dom/Event.cpp:
2715         (WebCore::Event::Event):
2716         (WebCore::Event::create):
2717         * dom/Event.h:
2718         * dom/FocusEvent.cpp:
2719         (WebCore::FocusEvent::FocusEvent):
2720         * dom/FocusEvent.h:
2721         * dom/HashChangeEvent.h:
2722         * dom/InputEvent.cpp:
2723         (WebCore::InputEvent::create):
2724         (WebCore::InputEvent::InputEvent):
2725         * dom/InputEvent.h:
2726         * dom/KeyboardEvent.cpp:
2727         (WebCore::KeyboardEvent::KeyboardEvent):
2728         * dom/MessageEvent.cpp:
2729         (WebCore::MessageEvent::MessageEvent):
2730         * dom/MouseEvent.cpp:
2731         (WebCore::MouseEvent::create):
2732         (WebCore::MouseEvent::MouseEvent):
2733         * dom/MouseEvent.h:
2734         * dom/MouseRelatedEvent.cpp:
2735         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
2736         * dom/MouseRelatedEvent.h:
2737         * dom/MutationEvent.cpp:
2738         (WebCore::MutationEvent::MutationEvent):
2739         * dom/MutationEvent.h:
2740         * dom/Node.cpp:
2741         (WebCore::Node::dispatchSubtreeModifiedEvent):
2742         (WebCore::Node::dispatchDOMActivateEvent):
2743         (WebCore::Node::dispatchInputEvent):
2744         * dom/OverflowEvent.cpp:
2745         (WebCore::OverflowEvent::OverflowEvent):
2746         * dom/PageTransitionEvent.cpp:
2747         (WebCore::PageTransitionEvent::PageTransitionEvent):
2748         * dom/PopStateEvent.cpp:
2749         (WebCore::PopStateEvent::PopStateEvent):
2750         * dom/ProgressEvent.cpp:
2751         (WebCore::ProgressEvent::ProgressEvent):
2752         * dom/ScriptElement.cpp:
2753         (WebCore::ScriptElement::dispatchErrorEvent):
2754         * dom/SecurityPolicyViolationEvent.h:
2755         * dom/SimulatedClick.cpp:
2756         * dom/TextEvent.cpp:
2757         (WebCore::TextEvent::TextEvent):
2758         * dom/TransitionEvent.cpp:
2759         (WebCore::TransitionEvent::TransitionEvent):
2760         * dom/UIEvent.cpp:
2761         (WebCore::UIEvent::UIEvent):
2762         * dom/UIEvent.h:
2763         (WebCore::UIEvent::create):
2764         * dom/UIEventWithKeyState.h:
2765         (WebCore::UIEventWithKeyState::UIEventWithKeyState):
2766         * dom/WebKitAnimationEvent.cpp:
2767         (WebCore::WebKitAnimationEvent::WebKitAnimationEvent):
2768         * dom/WebKitTransitionEvent.cpp:
2769         (WebCore::WebKitTransitionEvent::WebKitTransitionEvent):
2770         * dom/WheelEvent.cpp:
2771         (WebCore::WheelEvent::WheelEvent):
2772         * editing/Editor.cpp:
2773         (WebCore::dispatchBeforeInputEvent):
2774         (WebCore::dispatchBeforeInputEvents):
2775         (WebCore::Editor::willApplyEditing const):
2776         * editing/FrameSelection.cpp:
2777         (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
2778         (WebCore::FrameSelection::selectAll):
2779         (WebCore::FrameSelection::dispatchSelectStart):
2780         * html/HTMLDetailsElement.cpp:
2781         (WebCore::HTMLDetailsElement::dispatchPendingEvent):
2782         * html/HTMLFormControlElement.cpp:
2783         (WebCore::HTMLFormControlElement::dispatchChangeEvent):
2784         (WebCore::HTMLFormControlElement::checkValidity):
2785         * html/HTMLFormElement.cpp:
2786         (WebCore::HTMLFormElement::prepareForSubmission):
2787         (WebCore::HTMLFormElement::reset):
2788         * html/HTMLImageLoader.cpp:
2789         (WebCore::HTMLImageLoader::dispatchLoadEvent):
2790         * html/HTMLInputElement.cpp:
2791         (WebCore::HTMLInputElement::onSearch):
2792         * html/HTMLLinkElement.cpp:
2793         (WebCore::HTMLLinkElement::dispatchPendingEvent):
2794         * html/HTMLMediaElement.cpp:
2795         (WebCore::HTMLMediaElement::scheduleEvent):
2796         (WebCore::HTMLMediaElement::notifyAboutPlaying):
2797         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
2798         (WebCore::HTMLMediaElement::layoutSizeChanged):
2799         * html/HTMLPlugInImageElement.cpp:
2800         (WebCore::HTMLPlugInImageElement::checkSnapshotStatus):
2801         * html/HTMLScriptElement.cpp:
2802         (WebCore::HTMLScriptElement::dispatchLoadEvent):
2803         * html/HTMLSlotElement.cpp:
2804         (WebCore::HTMLSlotElement::dispatchSlotChangeEvent):
2805         * html/HTMLSourceElement.cpp:
2806         (WebCore::HTMLSourceElement::errorEventTimerFired):
2807         * html/HTMLStyleElement.cpp:
2808         (WebCore::HTMLStyleElement::dispatchPendingEvent):
2809         * html/HTMLTextFormControlElement.cpp:
2810         (WebCore::HTMLTextFormControlElement::selectionChanged):
2811         * html/HTMLTrackElement.cpp:
2812         (WebCore::HTMLTrackElement::didCompleteLoad):
2813         * html/MediaController.cpp:
2814         (WebCore::MediaController::scheduleEvent):
2815         * html/canvas/WebGLContextEvent.cpp:
2816         (WebCore::WebGLContextEvent::WebGLContextEvent):
2817         * html/canvas/WebGLContextEvent.h:
2818         * html/canvas/WebGLRenderingContextBase.cpp:
2819         (WebCore::WebGLRenderingContextBase::create):
2820         (WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
2821         (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
2822         (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent):
2823         * html/parser/HTMLScriptRunner.cpp:
2824         (WebCore::createScriptLoadEvent):
2825         * html/track/TrackEvent.cpp:
2826         (WebCore::TrackEvent::TrackEvent):
2827         * html/track/TrackEvent.h:
2828         * html/track/TrackListBase.cpp:
2829         (WebCore::TrackListBase::scheduleTrackEvent):
2830         (WebCore::TrackListBase::scheduleChangeEvent):
2831         * loader/DocumentLoader.cpp:
2832         (WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
2833         * loader/FrameLoader.cpp:
2834         (WebCore::FrameLoader::dispatchUnloadEvents):
2835         * loader/ImageLoader.cpp:
2836         (WebCore::ImageLoader::dispatchPendingErrorEvent):
2837         * loader/PolicyChecker.cpp:
2838         (WebCore::PolicyChecker::checkNavigationPolicy):
2839         * loader/appcache/ApplicationCacheHost.cpp:
2840         (WebCore::createApplicationCacheEvent):
2841         * page/DOMWindow.cpp:
2842         (WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
2843         (WebCore::DOMWindow::languagesChanged):
2844         (WebCore::DOMWindow::dispatchLoadEvent):
2845         * page/EventHandler.cpp:
2846         (WebCore::dispatchSelectStart):
2847         (WebCore::EventHandler::dispatchDragEvent):
2848         * page/EventSource.cpp:
2849         (WebCore::EventSource::scheduleReconnect):
2850         (WebCore::EventSource::didReceiveResponse):
2851         (WebCore::EventSource::abortConnectionAttempt):
2852         * page/FocusController.cpp:
2853         (WebCore::dispatchEventsOnWindowAndFocusedElement):
2854         (WebCore::FocusController::setFocusedFrame):
2855         * page/FrameView.cpp:
2856         (WebCore::FrameView::sendResizeEventIfNeeded):
2857         * page/Page.cpp:
2858         (WebCore::networkStateChanged):
2859         * page/Performance.cpp:
2860         (WebCore::Performance::resourceTimingBufferFullTimerFired):
2861         * page/PointerLockController.cpp:
2862         (WebCore::PointerLockController::enqueueEvent):
2863         * page/VisualViewport.cpp:
2864         (WebCore::VisualViewport::enqueueResizeEvent):
2865         (WebCore::VisualViewport::enqueueScrollEvent):
2866         * storage/StorageEvent.cpp:
2867         (WebCore::StorageEvent::StorageEvent):
2868         * svg/SVGElement.cpp:
2869         (WebCore::SVGElement::sendSVGLoadEventIfPossible):
2870         * svg/SVGImageLoader.cpp:
2871         (WebCore::SVGImageLoader::dispatchLoadEvent):
2872         * svg/SVGUseElement.cpp:
2873         (WebCore::SVGUseElement::notifyFinished):
2874         * svg/animation/SVGSMILElement.cpp:
2875         (WebCore::SVGSMILElement::dispatchPendingEvent):
2876         * workers/Worker.cpp:
2877         (WebCore::Worker::notifyFinished):
2878         * workers/WorkerMessagingProxy.cpp:
2879         (WebCore::WorkerMessagingProxy::notifyNetworkStateChange):
2880         * workers/service/ExtendableEvent.cpp:
2881         (WebCore::ExtendableEvent::ExtendableEvent):
2882         * workers/service/ExtendableEvent.h:
2883         * workers/service/ExtendableMessageEvent.cpp:
2884         (WebCore::ExtendableMessageEvent::ExtendableMessageEvent):
2885         * workers/service/ServiceWorker.cpp:
2886         (WebCore::ServiceWorker::scheduleTaskToUpdateState):
2887         * workers/service/ServiceWorkerContainer.cpp:
2888         (WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent):
2889         * workers/service/ServiceWorkerRegistration.cpp:
2890         (WebCore::ServiceWorkerRegistration::scheduleTaskToFireUpdateFoundEvent):
2891         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2892         (WebCore::ServiceWorkerThreadProxy::notifyNetworkStateChange):
2893         * xml/XMLHttpRequest.cpp:
2894         (WebCore::XMLHttpRequest::callReadyStateChangeListener):
2895
2896 2018-08-17  Yusuke Suzuki  <yusukesuzuki@slowstart.org> and Fujii Hironori  <Hironori.Fujii@sony.com>
2897
2898         [JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg
2899         https://bugs.webkit.org/show_bug.cgi?id=188589
2900
2901         Reviewed by Mark Lam.
2902         And reviewed by Yusuke Suzuki for Hironori's change.
2903
2904         * cssjit/FunctionCall.h:
2905         (WebCore::FunctionCall::FunctionCall):
2906         * cssjit/SelectorCompiler.cpp:
2907         (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
2908         * html/HTMLKeygenElement.cpp:
2909         Remove `using namespace WebCore` not to introduce `operator+/-` which makes the resolution of `operator+/-` for RegisterID ambiguous.
2910
2911 2018-08-17  Philippe Normand  <philn@igalia.com>
2912
2913         [GStreamer] reduce position queries frequency
2914         https://bugs.webkit.org/show_bug.cgi?id=188645
2915
2916         Reviewed by Xabier Rodriguez-Calvar.
2917
2918         There is no need to perform dozens of position queries per second.
2919         One every 300ms is enough.
2920
2921         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2922         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
2923         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
2924         (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
2925         (WebCore::MediaPlayerPrivateGStreamer::updateStates):
2926         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2927
2928 2018-08-17  Michael Catanzaro  <mcatanzaro@igalia.com>
2929
2930         [SOUP] Handle OAuth authentication after r234912
2931         https://bugs.webkit.org/show_bug.cgi?id=188651
2932
2933         Reviewed by Carlos Garcia Campos.
2934
2935         Update this switch to consider the new OAuth enum value added in r234912. I suppose OAuth is
2936         used for HTTP Auth now. It will be a one-time compatibility break as passwords previously
2937         stored with type "Unknown" will no longer be accessible.
2938
2939         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2940         (WebCore::authTypeFromProtectionSpaceAuthenticationScheme):
2941
2942 2018-08-17  Ms2ger  <Ms2ger@igalia.com>
2943
2944         [GTK] Never return an uninitialized ImageGStreamer object.
2945         https://bugs.webkit.org/show_bug.cgi?id=188305
2946
2947         Reviewed by Philippe Normand.
2948
2949         The single caller was already checking for a null return value, so
2950         make that check actually do something. Also remove the null-check on
2951         the return value of image(), which asserted that it would never return
2952         null.
2953
2954         Test: fast/canvas/canvas-createPattern-video-loading.html
2955
2956         * platform/graphics/gstreamer/ImageGStreamer.h:
2957         (WebCore::ImageGStreamer::createImage): Return null if m_image wasn't created.
2958         (WebCore::ImageGStreamer::image): Return a reference.
2959         (WebCore::ImageGStreamer::rect): Always assert that m_image is present.
2960         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2961         (WebCore::MediaPlayerPrivateGStreamerBase::paint): Update for new signature.
2962
2963 2018-08-17  Philippe Normand  <philn@igalia.com>
2964
2965         [GStreamer] Enable fpsdisplaysink only when MEDIA_STATISTICS is enabled
2966         https://bugs.webkit.org/show_bug.cgi?id=188648
2967
2968         Reviewed by Xabier Rodriguez-Calvar.
2969
2970         The fpsdisplaysink is useful only when MEDIA_STATISTICS is turned on.
2971         The text overlay is now enabled when GST_DEBUG tracing is enabled for the player.
2972
2973         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2974         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
2975
2976 2018-08-17  Philippe Normand  <philn@igalia.com>
2977
2978         [GStreamer][MSE] Disable last-sample support in AppendPipeline
2979         https://bugs.webkit.org/show_bug.cgi?id=188649
2980
2981         Reviewed by Xabier Rodriguez-Calvar.
2982
2983         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2984         (WebCore::AppendPipeline::AppendPipeline): This property isn't
2985         used by the append pipeline. So as a micro-optimization, it is now
2986         disabled.
2987
2988 2018-08-16  Devin Rousso  <drousso@apple.com>
2989
2990         Web Inspector: support breakpoints for arbitrary event names
2991         https://bugs.webkit.org/show_bug.cgi?id=183118
2992
2993         Reviewed by Joseph Pecoraro.
2994
2995         Tests: inspector/dom-debugger/event-breakpoints.html
2996                inspector/dom-debugger/event-breakpoints-with-navigation.html
2997
2998         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
2999         (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
3000
3001 2018-08-16  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3002
3003         [Curl] Bug fix on deleting cookies when Max-Age is set to zero.
3004         https://bugs.webkit.org/show_bug.cgi?id=188617
3005
3006         Reviewed by Alex Christensen.
3007
3008         Delete cookie if Max-Age is set to zero in Set-Cookie. Original implementation was
3009         compared using "less than", but it must be "less than or equal" to zero.
3010
3011         Tests: http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior.html
3012
3013         * platform/network/curl/CookieJarDB.cpp:
3014         (WebCore::CookieJarDB::setCookie):
3015
3016 2018-08-16  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3017
3018         [Curl] Implement deleteAllCookies()
3019         https://bugs.webkit.org/show_bug.cgi?id=188612
3020
3021         Reviewed by Alex Christensen.
3022
3023         deleteAllCookies() was not implemented. Connect the interface to the implementation.
3024
3025         Tests: http/tests/cookies/simple-cookies-expired.html
3026                http/tests/cookies/simple-cookies-max-age.html
3027
3028         * platform/network/curl/CookieJarCurlDatabase.cpp:
3029         (WebCore::CookieJarCurlDatabase::deleteAllCookies const):
3030
3031 2018-08-16  Ross Kirsling  <ross.kirsling@sony.com>
3032
3033         REGRESSION(r234930): Don't embed a #if in an ASSERT
3034         https://bugs.webkit.org/show_bug.cgi?id=188680
3035
3036         Reviewed by Tim Horton.
3037
3038         * page/EventHandler.cpp:
3039         (WebCore::EventHandler::handleDrag):
3040         Simplify the ASSERT -- it seems we just want to know that DragSourceActionSelection and exactly one other DragSourceAction is set. 
3041
3042 2018-08-16  Alex Christensen  <achristensen@webkit.org>
3043
3044         Remove unused allowScriptsToCloseWindows setting
3045         https://bugs.webkit.org/show_bug.cgi?id=188602
3046
3047         Reviewed by Simon Fraser.
3048
3049         No change in behaviour. It was always false.
3050
3051         * page/DOMWindow.cpp:
3052         (WebCore::DOMWindow::close):
3053         * page/Settings.yaml:
3054
3055 2018-08-16  Ryosuke Niwa  <rniwa@webkit.org>
3056
3057         Custom element constructor doesn't use HTMLElement in new.target's realm
3058         https://bugs.webkit.org/show_bug.cgi?id=188634
3059
3060         Reviewed by Keith Miller.
3061
3062         Fixed the bug that HTMLElement's constructor was constructing an element of its own realm
3063         instead of the realm of new.target. This results in the JS wrapper created for the element
3064         belonging to the global object of the HTMLElement constructor which was invoked instead of
3065         the global object of new.target as specified in:
3066         https://html.spec.whatwg.org/multipage/dom.html#html-element-constructors
3067
3068         In particular, step 9.2. specifies that we "perform element.[[SetPrototypeOf]](prototype)."
3069         where prototype is the result of Get(NewTarget, "prototype") in step 7.
3070
3071         WebKit's new behavior matches that of Chrome and Firefox.
3072
3073         Test: imported/w3c/web-platform-tests/custom-elements/htmlconstructor/newtarget.html
3074
3075         * bindings/js/JSHTMLElementCustom.cpp:
3076         (WebCore::constructJSHTMLElement): 
3077
3078 2018-08-16  Aditya Keerthi  <akeerthi@apple.com>
3079
3080         Unreviewed, fix the watchOS build after r188464.
3081
3082         * platform/ios/PlatformPasteboardIOS.mm:
3083         (WebCore::PlatformPasteboard::setColor):
3084
3085 2018-08-16  Ryosuke Niwa  <rniwa@webkit.org>
3086
3087         Custom element doesn't invalidate its style when :defined rule starts to apply
3088         https://bugs.webkit.org/show_bug.cgi?id=188637
3089
3090         Reviewed by Antti Koivisto.
3091
3092         Fixed the bug by invalidating the subtree when a custom element gets defined.
3093
3094         Test: fast/custom-elements/defined-update-style.html
3095
3096         * dom/Element.cpp:
3097         (WebCore::Element::setIsDefinedCustomElement):
3098
3099 2018-08-16  Youenn Fablet  <youenn@apple.com>
3100
3101         Change the input camera in the sources & outputs example on Safari (11) with M.Way camera
3102         https://bugs.webkit.org/show_bug.cgi?id=187756
3103         <rdar://problem/42332178>
3104
3105         Reviewed by Eric Carlson.
3106
3107         Covered by manual testing.
3108
3109         640x480x30fps is added as ideal constraints to getUserMedia if none other is added to provide consistent behavior.
3110         Some cameras do not support 30fps as they have discrete frame rate ranges.
3111         Before the patch, we were rejecting getUserMedia promise if the 'ideal' frameRate was not supported.
3112         After the patch, we do not check whether frame rate is supported if it is not mandatory.
3113         At capture time, we will still try to apply frame rate change and if not supported, the frame rate will not be set to 30 fps.
3114
3115         While we could surface discrete width/height/frame rate ranges, it seems best to fix the issue this way.
3116         In the future, we might implement video interpolation for width/height/framerate at WebCore level.
3117
3118         * platform/mediastream/RealtimeMediaSource.cpp:
3119         (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate):
3120         (WebCore::RealtimeMediaSource::supportsConstraint const):
3121         (WebCore::RealtimeMediaSource::supportsConstraints):
3122
3123 2018-08-16  Ryosuke Niwa  <rniwa@webkit.org>
3124
3125         Perform a microtask checkpoint before creating a custom element
3126         https://bugs.webkit.org/show_bug.cgi?id=188189
3127         <rdar://problem/42843022>
3128
3129         Reviewed by Geoffrey Garen.
3130
3131         Fixed the bug that the HTML parser was not performing a microtask checkpoint prior to synchronously constructing
3132         a custom element in the concept to create an element for a token:
3133         https://html.spec.whatwg.org/multipage/parsing.html#creating-and-inserting-nodes:perform-a-microtask-checkpoint
3134
3135         Also added a microtask checkpoint before dispatching DOMContentLoaded to work around webkit.org/b/82931 since
3136         scheduling a task to fire a DOMContentLoaded event in Document::finishedParsing as the HTML5 spec mandates
3137         is a long standing bug with a lot of implications, which is completely outside the scope of this bug fix:
3138         https://html.spec.whatwg.org/multipage/parsing.html#stop-parsing
3139
3140         Test: fast/custom-elements/perform-microtask-checkpoint-before-construction.html
3141
3142         * dom/Document.cpp:
3143         (WebCore::Document::finishedParsing): Perform a microtask checkpoint before dispatching DOMContentLoaded here as
3144         a workaround for webkit.org/b/82931.
3145         * html/parser/HTMLDocumentParser.cpp:
3146         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Perform a microtask checkpoint here to fix the bug.
3147
3148 2018-08-16  Alex Christensen  <achristensen@webkit.org>
3149
3150         Re-introduce assertion removed in r234890
3151         https://bugs.webkit.org/show_bug.cgi?id=188611
3152
3153         Reviewed by Geoffrey Garen.
3154
3155         The assertion was failing because Vector<String>::operator== was using memcmp,
3156         which failed to consider different instances of equal Strings equal.  Added an
3157         API test and this assertion, which now succeeds.
3158
3159         * contentextensions/ContentExtensionCompiler.cpp:
3160         (WebCore::ContentExtensions::compileRuleList):
3161
3162 2018-08-15  Jer Noble  <jer.noble@apple.com>
3163
3164         Add Experimental Feature support for SourceBuffer.changeType()
3165         https://bugs.webkit.org/show_bug.cgi?id=188626
3166
3167         Reviewed by Eric Carlson.
3168
3169         Tests: imported/w3c/web-platform-tests/media-source/mediasource-changetype-play.html
3170                imported/w3c/web-platform-tests/media-source/mediasource-changetype.html
3171
3172         The WICG is incubating a new proposal to allow clients to switch between streams
3173         with different codecs within the same SourceBuffer. The proposal is being tracked
3174         by <https://github.com/w3c/media-source/issues/155> and the proposed spec change
3175         is available at <https://rawgit.com/wicg/media-source/codec-switching/index.html>.
3176
3177         Drive-by fix: One of the wpt tests uses a .mp3 file to test SourceBuffer switching.
3178         The AVStreamDataParser does not necessarily emit every frame appended, and after a
3179         new init segment is appended, it's possible that frames from the previous media
3180         segment will be emitted. This causes an error condition to occur, due to an added
3181         check in the spec for a new flag. When the SourceBuffer asks its private implementation
3182         to reset the parser state, since there's no API on AVStreamDataParser to actually
3183         reset the parser state, just set a flag to drop all emitted buffers until the next
3184         initialization segment is parsed.
3185
3186         * Modules/mediasource/MediaSource.cpp:
3187         (WebCore::MediaSource::contentTypeShouldGenerateTimestamps):
3188         (WebCore::MediaSource::setDurationInternal):
3189         (WebCore::MediaSource::addSourceBuffer):
3190         * Modules/mediasource/MediaSource.h:
3191         * Modules/mediasource/SourceBuffer.cpp:
3192         (WebCore::SourceBuffer::changeType):
3193         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
3194         (WebCore::SourceBuffer::validateInitializationSegment):
3195         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
3196         * Modules/mediasource/SourceBuffer.h:
3197         * Modules/mediasource/SourceBuffer.idl:
3198         * page/Settings.yaml:
3199         * platform/graphics/SourceBufferPrivate.h:
3200         (WebCore::SourceBufferPrivate::canSwitchToType):
3201         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
3202         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3203         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
3204         (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
3205         (WebCore::SourceBufferPrivateAVFObjC::resetParserState):
3206         (WebCore::SourceBufferPrivateAVFObjC::canSwitchToType):
3207
3208 2018-08-16  Christopher Reid  <chris.reid@sony.com>
3209
3210         [Curl] Not all Cookie database files are deleted on corruption
3211         https://bugs.webkit.org/show_bug.cgi?id=185873
3212
3213         Reviewed by Fujii Hironori.
3214
3215         No new tests.
3216
3217         Delete the cookie database file and the corruption flag file when corruption is detected.
3218         Adding a quick integrity check in case it can catch anything when opening the database.
3219         Removing PRAGMA temp_store = MEMORY and PRAGMA journal_mode = WAL as they are set in SQLiteDatabase::open.
3220
3221         * platform/network/curl/CookieJarDB.cpp:
3222
3223 2018-08-16  Zan Dobersek  <zdobersek@igalia.com>
3224
3225         [Nicosia] Add Nicosia::ImageBackingTextureMapperImpl
3226         https://bugs.webkit.org/show_bug.cgi?id=188550
3227
3228         Reviewed by Carlos Garcia Campos.
3229
3230         Add the Nicosia::ImageBackingTextureMapperImpl class, the
3231         TextureMapper-specific implementation that will extend the ImageBacking
3232         class.
3233
3234         This class will be used to contain and manage updates for layers that
3235         are backed by image objects. The CoordinatedGraphicsLayer instance will
3236         use the LayerState object to track the currently-presented image objects
3237         and to store the latest update of these objects. The Update struct
3238         contains information about the current visibility of the image in the
3239         layer tree as well as the Nicosia::Buffer object containing the painted
3240         image data that's to be presented on the screen.
3241
3242         During the layer flush the flushUpdate() method will move the current
3243         update data into the pending position, from which this data will be
3244         gathered by the composition component through the takeUpdate() method
3245         and used to update the CoordinatedBackingStore object that's kept in
3246         the CompositionState object on this impl class.
3247
3248         This will be deployed for use in the CoordinatedGraphicsLayer at a later
3249         stage as it requires a larger rework in both CoordinatedGraphicsLayer as
3250         well as the CoordinatedGraphicsScene classes.
3251
3252         The implementation itself differs from the current image backing support
3253         in CoordinatedGraphicsLayer and CompositingCoordinator by abandoning the
3254         idea of sharing single image backings between layers that might be
3255         backed by identical Image objects. We thus end up trading any memory
3256         consumption benefit in these scenarios for a much simplified
3257         implementation. Overall this area needs more research both in figuring
3258         out whether there's worthy improvements in grouping image backings, as
3259         well as investigating whether it's possible to avoid additional image
3260         rasterization by just leveraging direct pixel data via the
3261         NativeImagePtr object.
3262
3263         * platform/TextureMapper.cmake:
3264         * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.cpp: Added.
3265         (Nicosia::ImageBackingTextureMapperImpl::createFactory):
3266         (Nicosia::ImageBackingTextureMapperImpl::flushUpdate):
3267         (Nicosia::ImageBackingTextureMapperImpl::takeUpdate):
3268         * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.h: Added.
3269
3270 2018-08-16  Aditya Keerthi  <akeerthi@apple.com>
3271
3272         Support drag-and-drop for input[type=color]
3273         https://bugs.webkit.org/show_bug.cgi?id=188464
3274
3275         Reviewed by Wenson Hsieh.
3276
3277         input[type=color] should support native drag and drop on both macOS and iOS.
3278
3279         Added methods to Pasteboard and PlatformPasteboard to enable colors to be read
3280         from and written to the pasteboard. On macOS, colors are managed through the
3281         NSColorPboardType, whereas on iOS, colors are managed through the
3282         'com.apple.uikit.color' identifier.
3283
3284         DragSourceActionColor was added to the list of DragSourceActions to identify
3285         when a color input is being dragged.
3286
3287         Tests: editing/pasteboard/drag-and-drop-color-input-events.html
3288                editing/pasteboard/drag-and-drop-color-input.html
3289
3290         * page/DragActions.h:
3291         * page/DragController.cpp:
3292         (WebCore::DragController::dragEnteredOrUpdated):
3293         (WebCore::isEnabledColorInput):
3294         (WebCore::DragController::concludeEditDrag):
3295         (WebCore::DragController::canProcessDrag):
3296         (WebCore::DragController::draggableElement const):
3297         (WebCore::DragController::startDrag):
3298         * page/EventHandler.cpp:
3299         (WebCore::EventHandler::dragHysteresisExceeded const):
3300         (WebCore::EventHandler::handleDrag):
3301         * page/EventHandler.h:
3302         * page/mac/DragControllerMac.mm:
3303         (WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod const):
3304         * platform/DragData.h:
3305         * platform/DragImage.cpp:
3306         (WebCore::DragImage::operator=):
3307         * platform/DragImage.h: Added the visiblePath property to DragImage, in order for
3308         us to be able to clip images in the UITargetedDragPreview on iOS.
3309         * platform/DragItem.h:
3310         (WebCore::DragItem::encode const):
3311         (WebCore::DragItem::decode):
3312         * platform/Pasteboard.h:
3313         * platform/PasteboardStrategy.h:
3314         * platform/PlatformPasteboard.h:
3315         * platform/gtk/DragImageGtk.cpp:
3316         (WebCore::createDragImageForColor):
3317         * platform/gtk/PasteboardGtk.cpp:
3318         (WebCore::Pasteboard::write):
3319         * platform/ios/DragImageIOS.mm:
3320         (WebCore::createDragImageForColor):
3321         * platform/ios/PasteboardIOS.mm:
3322         (WebCore::Pasteboard::write):
3323         * platform/ios/PlatformPasteboardIOS.mm:
3324         (WebCore::PlatformPasteboard::color):
3325         (WebCore::PlatformPasteboard::setColor):
3326         * platform/mac/DragDataMac.mm:
3327         (WebCore::colorPasteboardType):
3328         (WebCore::DragData::containsCompatibleContent const):
3329         * platform/mac/DragImageMac.mm:
3330         (WebCore::createDragImageForColor): Draw a rounded rectangle with a fill color
3331         matching the value of the dragged color input. The rendered image is designed to
3332         mimic the preview shown when dragging an NSColorWell.
3333         * platform/mac/PasteboardMac.mm:
3334         (WebCore::Pasteboard::write):
3335         * platform/mac/PlatformPasteboardMac.mm:
3336         (WebCore::PlatformPasteboard::setColor):
3337         * platform/win/PasteboardWin.cpp:
3338         (WebCore::Pasteboard::write):
3339         * platform/wpe/PasteboardWPE.cpp:
3340         (WebCore::Pasteboard::write):
3341
3342 2018-08-16  Zalan Bujtas  <zalan@apple.com>
3343
3344         [lFC][Floating] Add estimated margin top computation.
3345         https://bugs.webkit.org/show_bug.cgi?id=188619
3346
3347         Reviewed by Antti Koivisto.
3348
3349         In order to figure out whether a box should avoid a float, we need to know the final positions of both (ignore relative positioning for now).
3350         In block formatting context the final position for a normal flow box includes
3351         1. the static position and
3352         2. the corresponding (non)collapsed margins.
3353         Now the vertical margins are computed when all the descendants are finalized, because the margin values might be depending on the height of the box
3354         (and the height might be based on the content).
3355         So when we get to the point where we intersect the box with the float to decide if the box needs to move, we don't yet have the final vertical position.
3356
3357         The idea here is that as long as we don't cross the block formatting context boundary, we should be able to pre-compute the final top margin.
3358         (if this holds true for all the cases, the estimated prefix could be removed and just use marginTop() instead.)
3359
3360         Covered by existing block-only tests.
3361
3362         * layout/blockformatting/BlockFormattingContext.cpp:
3363         (WebCore::Layout::BlockFormattingContext::layout const):
3364         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
3365         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
3366         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
3367         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
3368         (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
3369         * layout/blockformatting/BlockFormattingContext.h:
3370         * layout/blockformatting/BlockMarginCollapse.cpp:
3371         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginTop):
3372         * layout/displaytree/DisplayBox.cpp:
3373         (WebCore::Display::Box::Box):
3374         * layout/displaytree/DisplayBox.h:
3375         (WebCore::Display::Box::setHasValidTop):
3376         (WebCore::Display::Box::setHasValidLeft):
3377         (WebCore::Display::Box::top const):
3378         (WebCore::Display::Box::left const):
3379         (WebCore::Display::Box::topLeft const):
3380         (WebCore::Display::Box::setTopLeft):
3381         (WebCore::Display::Box::setTop):
3382         (WebCore::Display::Box::setLeft):
3383         (WebCore::Display::Box::setVerticalMargin):
3384         (WebCore::Display::Box::setEstimatedMarginTop):
3385         (WebCore::Display::Box::estimatedMarginTop const):
3386
3387 2018-08-16  Zalan Bujtas  <zalan@apple.com>
3388
3389         [LFC][BFC] Display::Box interface should reflect that padding is optional.
3390         https://bugs.webkit.org/show_bug.cgi?id=188630
3391
3392         Reviewed by Antti Koivisto.
3393
3394         Certain type of boxes can't have paddings (see Layout::Box::isPaddingApplicable).
3395
3396         * layout/FormattingContext.cpp:
3397         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
3398         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
3399         * layout/FormattingContextGeometry.cpp:
3400         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
3401         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
3402         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
3403         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
3404         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3405         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3406         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
3407         * layout/displaytree/DisplayBox.h:
3408         (WebCore::Display::Box::width const):
3409         (WebCore::Display::Box::height const):
3410         (WebCore::Display::Box::contentBoxTop const):
3411         (WebCore::Display::Box::contentBoxLeft const):
3412         (WebCore::Display::Box::setPadding):
3413         (WebCore::Display::Box::paddingTop const):
3414         (WebCore::Display::Box::paddingLeft const):
3415         (WebCore::Display::Box::paddingBottom const):
3416         (WebCore::Display::Box::paddingRight const):
3417
3418 2018-08-16  Zalan Bujtas  <zalan@apple.com>
3419
3420         [LFC] Add showLayoutTree() that does not require LayoutContext.
3421         https://bugs.webkit.org/show_bug.cgi?id=188631
3422
3423         Reviewed by Antti Koivisto.
3424
3425         * layout/layouttree/LayoutBox.cpp:
3426         (WebCore::Layout::Box::formattingContextRoot const):
3427         (WebCore::Layout::Box::initialContainingBlock const):
3428         * layout/layouttree/LayoutBox.h:
3429         * layout/layouttree/LayoutTreeBuilder.cpp:
3430         (WebCore::Layout::outputLayoutTree):
3431         (WebCore::Layout::showLayoutTree):
3432         (WebCore::Layout::TreeBuilder::showLayoutTree): Deleted.
3433         * layout/layouttree/LayoutTreeBuilder.h:
3434
3435 2018-08-16  Zalan Bujtas  <zalan@apple.com>
3436
3437         [LFC] Tree builder should construct block and inline containers based on the display type.
3438         https://bugs.webkit.org/show_bug.cgi?id=188632
3439
3440         Reviewed by Antti Koivisto.
3441
3442         Inline elements can also construct RenderBlock renderers (inline-bloc etc), so use the display type instead when deciding what type of container to construct.   
3443
3444         * layout/layouttree/LayoutTreeBuilder.cpp:
3445         (WebCore::Layout::TreeBuilder::createSubTree):
3446
3447 2018-08-16  Zalan Bujtas  <zalan@apple.com>
3448
3449         [LFC] Bail out of subtree verification when trees are out of sync.
3450         https://bugs.webkit.org/show_bug.cgi?id=188633
3451
3452         Reviewed by Antti Koivisto.
3453
3454         There's no point of trying to match geometry when subtrees are out of sync.
3455         They get out of sync when the render tree has unsupported boxes (see LayoutTreeBuilder).
3456
3457         * layout/Verification.cpp:
3458         (WebCore::Layout::verifyAndOutputSubtree):
3459
3460 2018-08-16  Antti Koivisto  <antti@apple.com>
3461
3462         Use OptionSet for ActivityState::Flags
3463         https://bugs.webkit.org/show_bug.cgi?id=188554
3464
3465         Reviewed by Brent Fulgham.
3466
3467         More typesafe flags.
3468
3469         * Modules/geolocation/GeolocationController.cpp:
3470         (WebCore::GeolocationController::activityStateDidChange):
3471         * Modules/geolocation/GeolocationController.h:
3472         * html/canvas/WebGLRenderingContextBase.cpp:
3473         (WebCore::WebGLRenderingContextBase::activityStateDidChange):
3474         * html/canvas/WebGLRenderingContextBase.h:
3475         * page/ActivityState.cpp:
3476         (WebCore::operator<<):
3477         (WebCore::activityStateFlagsToString): Deleted.
3478         * page/ActivityState.h:
3479         (WebCore::ActivityState::allFlags):
3480         * page/ActivityStateChangeObserver.h:
3481         * page/FocusController.cpp:
3482         (WebCore::FocusController::FocusController):
3483         (WebCore::FocusController::setFocused):
3484         (WebCore::FocusController::setActivityState):
3485         (WebCore::FocusController::setActive):
3486         * page/FocusController.h:
3487         (WebCore::FocusController::isActive const):
3488         (WebCore::FocusController::isFocused const):
3489         (WebCore::FocusController::contentIsVisible const):
3490         * page/Page.cpp:
3491         (WebCore::pageInitialActivityState):
3492         (WebCore::Page::Page):
3493         (WebCore::Page::setIsInWindow):
3494         (WebCore::Page::updateTimerThrottlingState):
3495         (WebCore::Page::setActivityState):
3496         (WebCore::Page::isVisibleAndActive const):
3497         (WebCore::Page::isWindowActive const):
3498         (WebCore::Page::setIsVisible):
3499         * page/Page.h:
3500         (WebCore::Page::activityState const):
3501         (WebCore::Page::isVisible const):
3502         (WebCore::Page::isInWindow const):
3503         * page/PerformanceMonitor.cpp:
3504         (WebCore::activityStateForCPUSampling):
3505         (WebCore::PerformanceMonitor::activityStateChanged):
3506         * page/PerformanceMonitor.h:
3507         * platform/text/cocoa: Added.
3508
3509 2018-08-15  Ansh Shukla  <ansh_shukla@apple.com>
3510
3511         NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
3512         https://bugs.webkit.org/show_bug.cgi?id=186870
3513         <rdar://problem/41314410>
3514
3515         Reviewed by Alex Christensen.
3516
3517         Add the ProtectionSpaceAuthenticationSchemeOAuth type.
3518
3519         * platform/network/ProtectionSpaceBase.cpp:
3520         (WebCore::ProtectionSpaceBase::isPasswordBased const): Return yes because the oauth challenge
3521         expects a token in return.
3522         * platform/network/ProtectionSpaceBase.h:
3523         * platform/network/cocoa/ProtectionSpaceCocoa.mm:
3524         (WebCore::scheme):
3525         (WebCore::ProtectionSpace::nsSpace const):
3526
3527 2018-08-15  Ben Richards  <benton_richards@apple.com>
3528
3529         We should cache the compiled sandbox profile in a data vault
3530         https://bugs.webkit.org/show_bug.cgi?id=184991
3531
3532         Reviewed by Ryosuke Niwa.
3533
3534         Added functionality to FileHandle so that it can lock a file while open.
3535         Added a function to FileSystem to delete non empty directories.
3536
3537         * platform/FileHandle.cpp:
3538         (WebCore::FileHandle::FileHandle):
3539         (WebCore::FileHandle::open):
3540         (WebCore::FileHandle::close):
3541         * platform/FileHandle.h:
3542         * platform/FileSystem.h:
3543         * platform/cocoa/FileSystemCocoa.mm:
3544         (WebCore::FileSystem::deleteNonEmptyDirectory):
3545
3546 2018-08-15  Ryosuke Niwa  <rniwa@webkit.org>
3547
3548         Can't share an app on AppStore to WeChat due to a release assert
3549         https://bugs.webkit.org/show_bug.cgi?id=188621
3550         <rdar://problem/43343976>
3551
3552         Reviewed by Geoffrey Garen.
3553
3554         Disable the thread safety check when the app is not linked on or after iOS 12 since this release assert
3555         is getting hit by third party applications on iOS in UI process.
3556
3557         * platform/Timer.cpp:
3558         (WebCore::shouldSuppressThreadSafetyCheck): Added a SDK check.
3559
3560 2018-08-15  Christopher Reid  <chris.reid@sony.com>
3561
3562         [Curl] Implement default cookie path handling correctly as outlined in RFC6265.
3563         https://bugs.webkit.org/show_bug.cgi?id=188609
3564
3565         Reviewed by Alex Christensen.
3566
3567         Curl implementation of default cookie path was wrong so that some cookies cannot be accessible.
3568         It should be generated as outlined in: https://tools.ietf.org/html/rfc6265#section-5.1.4
3569
3570         Tests: http/tests/cookies/http-get-cookie-set-in-js.html
3571
3572         * platform/network/curl/CookieJarDB.cpp:
3573         (WebCore::CookieJarDB::setCookie):
3574         * platform/network/curl/CookieUtil.cpp:
3575         (WebCore::CookieUtil::defaultPathForURL):
3576         * platform/network/curl/CookieUtil.h:
3577
3578 2018-08-15  Aditya Keerthi  <akeerthi@apple.com>
3579
3580         [Datalist] Add button to TextFieldInputs with a datalist
3581         https://bugs.webkit.org/show_bug.cgi?id=187741
3582
3583         Reviewed by Tim Horton.
3584
3585         TextFieldInputs that have an associated datalist element should be drawn as
3586         combo boxes. However, we cannot use NSComboBox for this control, as NSComboBox
3587         is not height-resizable. Furthermore, the input should also be able to contain
3588         additional elements, such as the stepper for type=number and the cancel button
3589         for type=search. For these reasons, we draw a button at the end of the input,
3590         mimicking appearance of a combo box.
3591
3592         The list-button -webkit-appearance value was added to display the new button.
3593
3594         Tests: fast/forms/datalist/datalist-searchinput-appearance.html
3595                fast/forms/datalist/datalist-textinput-appearance.html
3596
3597         * Resources/ListButtonArrow.png: Added.
3598         * Resources/ListButtonArrow@2x.png: Added.
3599         * WebCore.xcodeproj/project.pbxproj:
3600         * css/CSSPrimitiveValueMappings.h:
3601         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3602         * css/CSSProperties.json:
3603         * css/CSSValueKeywords.in:
3604         * css/html.css:
3605         (input::-webkit-list-button):
3606         * html/HTMLInputElement.cpp:
3607         (WebCore::HTMLInputElement::dataListButtonElement const):
3608         * html/HTMLInputElement.h:
3609         * html/InputType.h:
3610         (WebCore::InputType::dataListButtonElement const):
3611         * html/TextFieldInputType.cpp:
3612         (WebCore::TextFieldInputType::needsContainer const):
3613         (WebCore::TextFieldInputType::createShadowSubtree):
3614         (WebCore::TextFieldInputType::destroyShadowSubtree):
3615         (WebCore::TextFieldInputType::listAttributeTargetChanged):
3616         (WebCore::TextFieldInputType::dataListButtonElement const):
3617         (WebCore::TextFieldInputType::dataListButtonElementWasClicked):
3618         (WebCore::TextFieldInputType::didCloseSuggestions):
3619         * html/TextFieldInputType.h:
3620         * html/shadow/DataListButtonElement.cpp: Added.
3621         (WebCore::DataListButtonElement::create):
3622         (WebCore::DataListButtonElement::DataListButtonElement):
3623         (WebCore::DataListButtonElement::~DataListButtonElement):
3624         (WebCore::DataListButtonElement::defaultEventHandler):
3625         * html/shadow/DataListButtonElement.h: Added.
3626         * platform/ThemeTypes.h:
3627         * rendering/RenderTheme.cpp:
3628         (WebCore::RenderTheme::adjustStyle):
3629         (WebCore::RenderTheme::adjustListButtonStyle const):
3630         * rendering/RenderTheme.h:
3631         * rendering/RenderThemeMac.h:
3632         * rendering/RenderThemeMac.mm:
3633         (-[WebListButtonCell drawWithFrame:inView:]):
3634         (WebCore::RenderThemeMac::paintListButtonForInput):
3635         (WebCore::RenderThemeMac::adjustListButtonStyle const):
3636         (WebCore::RenderThemeMac::paintTextField):
3637         (WebCore::RenderThemeMac::paintSearchField):
3638         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
3639         (WebCore::RenderThemeMac::listButton const):
3640
3641 2018-08-15  Ryan Haddad  <ryanhaddad@apple.com>
3642
3643         Unreviewed, rolling out r234870.
3644
3645         The test introduced with this change is a flaky failure.
3646
3647         Reverted changeset:
3648
3649         "NSURLAuthenticationMethodOAuth challenges are surfaced to
3650         clients in -didReceiveAuthenticationChallenge as
3651         NSURLAuthenticationMethodDefault"
3652         https://bugs.webkit.org/show_bug.cgi?id=186870
3653         https://trac.webkit.org/changeset/234870
3654
3655 2018-08-14  Ryosuke Niwa  <rniwa@webkit.org>
3656
3657         connectedCallback is invoked by the HTML parser after child nodes had been inserted
3658         https://bugs.webkit.org/show_bug.cgi?id=183931
3659         <rdar://problem/38843548>
3660
3661         Reviewed by Alex Christensen.
3662
3663         Invoke the custom element reactions after constructing and inserting a custom element as specifed in step 3.3 of:
3664         https://html.spec.whatwg.org/multipage/parsing.html#insert-a-foreign-element
3665
3666         The bug here was that HTMLConstructionSite::insertCustomElement uses attachLater so that even though the task
3667         to insert the custom element was created, it didn't get executed until after CustomElementReactionStack in
3668         HTMLDocumentParser::runScriptsForPausedTreeBuilder had been popped off of the stack.
3669
3670         Test: imported/w3c/web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children.html
3671
3672         * html/parser/HTMLConstructionSite.cpp:
3673         (WebCore::HTMLConstructionSite::insertCustomElement): Fixed the bug by manually executing the scheduled tasks.
3674         This will enqueue any custom element reactions while CustomElementReactionStack in runScriptsForPausedTreeBuilder
3675         is still in the stack.
3676
3677 2018-08-15  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3678
3679         [Curl] Don't send Content-Type header for POST request when body is null.
3680         https://bugs.webkit.org/show_bug.cgi?id=188588
3681
3682         Reviewed by Youenn Fablet.
3683
3684         The Content-Type header was sent by libcurl automatically. Suppress that behavior
3685         when body is null.
3686
3687         Tests: http/tests/xmlhttprequest/methods.html
3688
3689         * platform/network/curl/CurlRequest.cpp:
3690         (WebCore::CurlRequest::setupPOST):
3691
3692 2018-08-15  Alex Christensen  <achristensen@webkit.org>
3693
3694         Remove failing assertion introduced in r234873
3695         https://bugs.webkit.org/show_bug.cgi?id=188581
3696
3697         * contentextensions/ContentExtensionCompiler.cpp:
3698         (WebCore::ContentExtensions::compileRuleList):
3699         The assertion is correct but failing because VectorTraits<String> is incorrect.
3700         I'll re-add it and fix VectorTraits<String> in a separate patch.
3701
3702 2018-08-15  Wenson Hsieh  <wenson_hsieh@apple.com>
3703
3704         [Attachment SPI] Remove attachment display mode options
3705         https://bugs.webkit.org/show_bug.cgi?id=188596
3706
3707         Reviewed by Dan Bernstein.
3708
3709         Remove the ability to specify an "in-place" or "icon" representation for attachment elements, as well as logic
3710         needed to allow an attachment element to render image or video elements in a shadow root. The requirements that
3711         initially drove this effort are obviated by r227068, which allows Mail to intercept and provide a custom scheme
3712         for images inserted into the document via rich editing operations.
3713
3714         Removed some existing API tests in _WKAttachmentTests that exercised this functionality.
3715
3716         * editing/Editor.cpp:
3717         (WebCore::Editor::insertAttachmentFromFile):
3718         * editing/cocoa/WebContentReaderCocoa.mm:
3719         (WebCore::createFragmentForImageAttachment):
3720         (WebCore::replaceRichContentWithAttachments):
3721         * html/AttachmentTypes.h:
3722         (WebCore::AttachmentDisplayOptions::encode const):
3723         (WebCore::AttachmentDisplayOptions::decode):
3724
3725         Remove logic for encoding the attachment display mode. While this leaves AttachmentDisplayOptions completely
3726         empty, I haven't removed AttachmentDisplayOptions as well in this patch, since it's not clear that we won't be
3727         needing any mechanism for influencing the display of attachment elements inserted via native SPI.
3728
3729         (): Deleted.
3730         * html/HTMLAttachmentElement.cpp:
3731         (WebCore::HTMLAttachmentElement::createElementRenderer):
3732         (WebCore::HTMLAttachmentElement::setFile):
3733         (WebCore::HTMLAttachmentElement::parseAttribute):
3734         (WebCore::HTMLAttachmentElement::invalidateShadowRootChildrenIfNecessary): Deleted.
3735         (WebCore::HTMLAttachmentElement::attachmentRenderer const): Deleted.
3736         (WebCore::HTMLAttachmentElement::updateDisplayMode): Deleted.
3737         (WebCore::HTMLAttachmentElement::ensureInnerImage): Deleted.
3738         (WebCore::HTMLAttachmentElement::ensureInnerVideo): Deleted.
3739         (WebCore::HTMLAttachmentElement::innerImage const): Deleted.
3740         (WebCore::HTMLAttachmentElement::innerVideo const): Deleted.
3741         (WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary): Deleted.
3742
3743         Remove logic for building the shadow root to house inline media elements.
3744
3745         * html/HTMLAttachmentElement.h:
3746
3747         The renderer of the attachment element is once again always a `RenderAttachment`, so we can remove
3748         `attachmentRenderer()` altogether and revert to overriding `renderer()` to return a `RenderAttachment*`.
3749
3750         * page/DragController.cpp:
3751         (WebCore::DragController::startDrag):
3752         * rendering/RenderAttachment.h:
3753         (WebCore::HTMLAttachmentElement::renderer const):
3754
3755 2018-08-15  Ali Juma  <ajuma@chromium.org>
3756
3757         [IntersectionObserver] Do not hold a strong reference to the root element
3758         https://bugs.webkit.org/show_bug.cgi?id=188575
3759
3760         Reviewed by Simon Fraser.
3761
3762         Make IntersectionObserver have only a raw pointer to its root element rather than
3763         a reference, so that an otherwise-unreachable root isn't kept alive. Add logic to
3764         to clear this pointer when the root element gets deleted.
3765
3766         Test: intersection-observer/root-element-deleted.html
3767
3768         * dom/Element.cpp:
3769         (WebCore::Element::~Element):
3770         (WebCore::Element::disconnectFromIntersectionObservers):
3771         (WebCore::Element::ensureIntersectionObserverData):
3772         (WebCore::Element::intersectionObserverData):
3773         * dom/Element.h:
3774         * dom/ElementRareData.cpp:
3775         * dom/ElementRareData.h:
3776         (WebCore::ElementRareData::intersectionObserverData):
3777         (WebCore::ElementRareData::setIntersectionObserverData):
3778         * page/IntersectionObserver.cpp:
3779         (WebCore::IntersectionObserver::create):
3780         (WebCore::IntersectionObserver::IntersectionObserver):
3781         (WebCore::IntersectionObserver::~IntersectionObserver):
3782         (WebCore::IntersectionObserver::rootDestroyed):
3783         * page/IntersectionObserver.h:
3784         (WebCore::IntersectionObserver::root const):
3785
3786 2018-08-14  Zan Dobersek  <zdobersek@igalia.com>
3787
3788         [Nicosia] Add Nicosia::BackingStoreTextureMapperImpl
3789         https://bugs.webkit.org/show_bug.cgi?id=188548
3790
3791         Reviewed by Carlos Garcia Campos.
3792
3793         Add the Nicosia::BackingStoreTextureMapperImpl class, the
3794         TextureMapper-specific implementation that will extend the BackingStore
3795         class.
3796
3797         Purpose of this class is to manage content of painted layers. In the
3798         LayerState object that will be exposed to the CoordinatedGraphicsLayer
3799         owner we keep the current and previous TiledBackingStore objects that
3800         will be used for painting. A TileUpdate object is used to store all tile
3801         creation, removal and update changes that happen during the painting
3802         that's performed during the CoordinatedGraphicsLayer flush.
3803
3804         At the point of synchronization under the Nicosia::Scene object, these
3805         updates will be moved over to the pending TileUpdate object that will
3806         then be accessed during the composition step. For that purpose we keep
3807         in the CompositionState member object a reference to the
3808         CoordinatedBackingStore object that will get updated with the tile
3809         creation, removal and update changes (if there are any). The composition
3810         step will use the takeUpdate() method to retrieve all these changes and
3811         apply them outside of the point of synchronization (avoiding this sync
3812         step to take too long).
3813
3814         This will be integrated into the CoordinatedGraphicsLayer class at a
3815         later point, when the switch to the new infrastructure can be made in
3816         one go.
3817
3818         * platform/TextureMapper.cmake:
3819         * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp: Added.
3820         (Nicosia::BackingStoreTextureMapperImpl::createFactory):
3821         (Nicosia::BackingStoreTextureMapperImpl::tiledBackingStoreHasPendingTileCreation):
3822         (Nicosia::BackingStoreTextureMapperImpl::createTile):
3823         (Nicosia::BackingStoreTextureMapperImpl::updateTile):
3824         (Nicosia::BackingStoreTextureMapperImpl::removeTile):
3825         (Nicosia::BackingStoreTextureMapperImpl::flushUpdate):
3826         (Nicosia::BackingStoreTextureMapperImpl::takeUpdate):
3827         * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.h: Added.
3828
3829 2018-08-14  Fujii Hironori  <Hironori.Fujii@sony.com>
3830
3831         Unreviewed, rolling out r234874 and r234876.
3832
3833         WinCairo port can't compile
3834
3835         Reverted changesets:
3836
3837         "[JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg"
3838         https://bugs.webkit.org/show_bug.cgi?id=188589
3839         https://trac.webkit.org/changeset/234874
3840
3841         "Unreviewed, attempt to fix CLoop build"
3842         https://bugs.webkit.org/show_bug.cgi?id=188589
3843         https://trac.webkit.org/changeset/234876
3844
3845 2018-08-14  Zalan Bujtas  <zalan@apple.com>
3846
3847         [LFC][Floating] Add support for negative clearance.
3848         https://bugs.webkit.org/show_bug.cgi?id=188555
3849
3850         Reviewed by Simon Fraser.
3851
3852         1. Compute clearance to avoid float(s) (border box needs to avoid floats)
3853         2. Reset vertical margins to non-collapsed values.
3854         4. Adjust clearance with the new margins.
3855         5. Take the adjusted clearance and move the box vertically if needed.
3856
3857         Test: fast/block/block-only/margin-collapse-with-clearance.html
3858
3859         * layout/FloatingContext.cpp:
3860         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
3861         * layout/FloatingState.cpp:
3862         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
3863         * layout/FormattingContext.cpp:
3864         (WebCore::Layout::FormattingContext::mapBoxToAncestor):
3865         (WebCore::Layout::FormattingContext::mapTopLeftToAncestor):
3866         (WebCore::Layout::FormattingContext::mapCoordinateToAncestor):
3867         (WebCore::Layout::FormattingContext::mapToAncestor): Deleted.
3868         * layout/FormattingContext.h:
3869         * layout/LayoutUnits.h:
3870         (WebCore::Layout::Position::Position):
3871         (WebCore::Layout::Position::moveBy):
3872         * layout/displaytree/DisplayBox.h:
3873
3874 2018-08-14  Fujii Hironori  <Hironori.Fujii@sony.com>
3875
3876         Unreviewed, rolling out r234859.
3877
3878         Windows ports can't compile
3879
3880         Reverted changeset:
3881
3882         "Use a Variant instead of a union in CSSSelector"
3883         https://bugs.webkit.org/show_bug.cgi?id=188559
3884         https://trac.webkit.org/changeset/234859
3885
3886 2018-08-14  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3887
3888         [JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg
3889         https://bugs.webkit.org/show_bug.cgi?id=188589
3890
3891         Reviewed by Mark Lam.
3892
3893         No behavior change.
3894
3895         * cssjit/FunctionCall.h:
3896         (WebCore::FunctionCall::FunctionCall):
3897         * cssjit/SelectorCompiler.cpp:
3898         (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
3899
3900 2018-08-14  Alex Christensen  <achristensen@webkit.org>
3901
3902         isValidCSSSelector is unsafe to be called from a non-main thread
3903         https://bugs.webkit.org/show_bug.cgi?id=188581
3904         <rdar://problem/40517358>
3905
3906         Reviewed by Sam Weinig.
3907
3908         Parsing and determining whether the css selectors are valid is fast enough to do before
3909         hopping to the background thread for the slow NFA/DFA operations and writing to disk.
3910         Doing it on the main thread avoids the thread safety issues in the CSSParser's use of strings.
3911
3912         * contentextensions/ContentExtensionCompiler.cpp:
3913         (WebCore::ContentExtensions::compileRuleList):
3914         * contentextensions/ContentExtensionCompiler.h:
3915         * contentextensions/ContentExtensionParser.cpp:
3916         (WebCore::ContentExtensions::isValidCSSSelector):
3917         (WebCore::ContentExtensions::loadEncodedRules):
3918         (WebCore::ContentExtensions::parseRuleList):
3919         * contentextensions/ContentExtensionParser.h:
3920         * contentextensions/ContentExtensionRule.cpp:
3921         (WebCore::ContentExtensions::Trigger::isolatedCopy const):
3922         (WebCore::ContentExtensions::Action::isolatedCopy const):
3923         * contentextensions/ContentExtensionRule.h:
3924         (WebCore::ContentExtensions::Trigger::isEmpty const):
3925         (WebCore::ContentExtensions::Trigger::operator== const):
3926         (WebCore::ContentExtensions::Action::Action):
3927         (WebCore::ContentExtensions::ContentExtensionRule::isolatedCopy const):
3928         (WebCore::ContentExtensions::ContentExtensionRule::operator== const):
3929         (WebCore::ContentExtensions::vectorIsolatedCopy):
3930
3931 2018-08-14  Ansh Shukla  <ansh_shukla@apple.com>
3932
3933         NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
3934         https://bugs.webkit.org/show_bug.cgi?id=186870
3935         <rdar://problem/41314410>
3936
3937         Reviewed by Alex Christensen.
3938
3939         Add the ProtectionSpaceAuthenticationSchemeOAuth type.
3940
3941         * platform/network/ProtectionSpaceBase.cpp:
3942         (WebCore::ProtectionSpaceBase::isPasswordBased const): Return yes because the oauth challenge
3943         expects a token in return.
3944         * platform/network/ProtectionSpaceBase.h:
3945         * platform/network/cocoa/ProtectionSpaceCocoa.mm:
3946         (WebCore::scheme):
3947         (WebCore::ProtectionSpace::nsSpace const):
3948
3949 2018-08-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3950
3951         [Curl] Implement platform default timeout interval.
3952         https://bugs.webkit.org/show_bug.cgi?id=188565
3953
3954         Reviewed by Alex Christensen.
3955
3956         Curl port didn't implement platform default timeout interval. It treated
3957         zero value for timeout interval as no timeout.
3958
3959         Add platform dependent timeout interval into CurlContext and use that if
3960         timeout and default timeout aren't supplied.
3961