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