All prototypes should call didBecomePrototype()
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-06-22  Robin Morisset  <rmorisset@apple.com> and Yusuke Suzuki  <ysuzuki@apple.com>
2
3         All prototypes should call didBecomePrototype()
4         https://bugs.webkit.org/show_bug.cgi?id=196315
5
6         Reviewed by Saam Barati.
7
8         * bindings/js/JSDOMIterator.h:
9         (WebCore::IteratorTraits>::finishCreation):
10         * bindings/js/JSDOMWindowProperties.h:
11         (WebCore::JSDOMWindowProperties::create): Deleted.
12         (WebCore::JSDOMWindowProperties::createStructure): Deleted.
13         (WebCore::JSDOMWindowProperties::JSDOMWindowProperties): Deleted.
14         * bindings/js/JSWindowProxy.cpp:
15         (WebCore::JSWindowProxy::setWindow):
16         * bindings/scripts/CodeGeneratorJS.pm:
17         (GeneratePrototypeDeclaration):
18         (GenerateConstructorHelperMethods):
19         * bindings/scripts/test/JS/JSInterfaceName.cpp:
20         (WebCore::JSInterfaceNamePrototype::JSInterfaceNamePrototype):
21         * bindings/scripts/test/JS/JSMapLike.cpp:
22         (WebCore::JSMapLikePrototype::JSMapLikePrototype):
23         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
24         (WebCore::JSReadOnlyMapLikePrototype::JSReadOnlyMapLikePrototype):
25         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
26         (WebCore::JSTestActiveDOMObjectPrototype::JSTestActiveDOMObjectPrototype):
27         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
28         (WebCore::JSTestCEReactionsPrototype::JSTestCEReactionsPrototype):
29         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
30         (WebCore::JSTestCEReactionsStringifierPrototype::JSTestCEReactionsStringifierPrototype):
31         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
32         (WebCore::JSTestCallTracerPrototype::JSTestCallTracerPrototype):
33         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
34         (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::JSTestClassWithJSBuiltinConstructorPrototype):
35         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
36         (WebCore::JSTestDOMJITPrototype::JSTestDOMJITPrototype):
37         (WebCore::JSTestDOMJITConstructor::prototypeForStructure):
38         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
39         (WebCore::JSTestEnabledBySettingPrototype::JSTestEnabledBySettingPrototype):
40         * bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
41         (WebCore::JSTestEnabledForContextPrototype::JSTestEnabledForContextPrototype):
42         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
43         (WebCore::JSTestEventConstructorPrototype::JSTestEventConstructorPrototype):
44         (WebCore::JSTestEventConstructorConstructor::prototypeForStructure):
45         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
46         (WebCore::JSTestEventTargetPrototype::JSTestEventTargetPrototype):
47         (WebCore::JSTestEventTargetConstructor::prototypeForStructure):
48         * bindings/scripts/test/JS/JSTestException.cpp:
49         (WebCore::JSTestExceptionPrototype::JSTestExceptionPrototype):
50         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
51         (WebCore::JSTestGenerateIsReachablePrototype::JSTestGenerateIsReachablePrototype):
52         * bindings/scripts/test/JS/JSTestGlobalObject.h:
53         (WebCore::JSTestGlobalObjectPrototype::JSTestGlobalObjectPrototype):
54         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
55         (WebCore::JSTestIndexedSetterNoIdentifierPrototype::JSTestIndexedSetterNoIdentifierPrototype):
56         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
57         (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::JSTestIndexedSetterThrowingExceptionPrototype):
58         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
59         (WebCore::JSTestIndexedSetterWithIdentifierPrototype::JSTestIndexedSetterWithIdentifierPrototype):
60         * bindings/scripts/test/JS/JSTestInterface.cpp:
61         (WebCore::JSTestInterfacePrototype::JSTestInterfacePrototype):
62         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
63         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::JSTestInterfaceLeadingUnderscorePrototype):
64         * bindings/scripts/test/JS/JSTestIterable.cpp:
65         (WebCore::JSTestIterablePrototype::JSTestIterablePrototype):
66         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
67         (WebCore::JSTestJSBuiltinConstructorPrototype::JSTestJSBuiltinConstructorPrototype):
68         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
69         (WebCore::JSTestMediaQueryListListenerPrototype::JSTestMediaQueryListListenerPrototype):
70         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
71         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::JSTestNamedAndIndexedSetterNoIdentifierPrototype):
72         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
73         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::JSTestNamedAndIndexedSetterThrowingExceptionPrototype):
74         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
75         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::JSTestNamedAndIndexedSetterWithIdentifierPrototype):
76         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
77         (WebCore::JSTestNamedConstructorPrototype::JSTestNamedConstructorPrototype):
78         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
79         (WebCore::JSTestNamedDeleterNoIdentifierPrototype::JSTestNamedDeleterNoIdentifierPrototype):
80         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
81         (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::JSTestNamedDeleterThrowingExceptionPrototype):
82         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
83         (WebCore::JSTestNamedDeleterWithIdentifierPrototype::JSTestNamedDeleterWithIdentifierPrototype):
84         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
85         (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::JSTestNamedDeleterWithIndexedGetterPrototype):
86         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
87         (WebCore::JSTestNamedGetterCallWithPrototype::JSTestNamedGetterCallWithPrototype):
88         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
89         (WebCore::JSTestNamedGetterNoIdentifierPrototype::JSTestNamedGetterNoIdentifierPrototype):
90         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
91         (WebCore::JSTestNamedGetterWithIdentifierPrototype::JSTestNamedGetterWithIdentifierPrototype):
92         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
93         (WebCore::JSTestNamedSetterNoIdentifierPrototype::JSTestNamedSetterNoIdentifierPrototype):
94         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
95         (WebCore::JSTestNamedSetterThrowingExceptionPrototype::JSTestNamedSetterThrowingExceptionPrototype):
96         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
97         (WebCore::JSTestNamedSetterWithIdentifierPrototype::JSTestNamedSetterWithIdentifierPrototype):
98         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
99         (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::JSTestNamedSetterWithIndexedGetterPrototype):
100         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
101         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::JSTestNamedSetterWithIndexedGetterAndSetterPrototype):
102         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
103         (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::JSTestNamedSetterWithOverrideBuiltinsPrototype):
104         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
105         (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::JSTestNamedSetterWithUnforgablePropertiesPrototype):
106         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
107         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype):
108         * bindings/scripts/test/JS/JSTestNode.cpp:
109         (WebCore::JSTestNodePrototype::JSTestNodePrototype):
110         (WebCore::JSTestNodeConstructor::prototypeForStructure):
111         * bindings/scripts/test/JS/JSTestObj.cpp:
112         (WebCore::JSTestObjPrototype::JSTestObjPrototype):
113         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
114         (WebCore::JSTestOverloadedConstructorsPrototype::JSTestOverloadedConstructorsPrototype):
115         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
116         (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::JSTestOverloadedConstructorsWithSequencePrototype):
117         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
118         (WebCore::JSTestOverrideBuiltinsPrototype::JSTestOverrideBuiltinsPrototype):
119         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
120         (WebCore::JSTestPluginInterfacePrototype::JSTestPluginInterfacePrototype):
121         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
122         (WebCore::JSTestPromiseRejectionEventPrototype::JSTestPromiseRejectionEventPrototype):
123         (WebCore::JSTestPromiseRejectionEventConstructor::prototypeForStructure):
124         * bindings/scripts/test/JS/JSTestSerialization.cpp:
125         (WebCore::JSTestSerializationPrototype::JSTestSerializationPrototype):
126         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
127         (WebCore::JSTestSerializationIndirectInheritancePrototype::JSTestSerializationIndirectInheritancePrototype):
128         (WebCore::JSTestSerializationIndirectInheritanceConstructor::prototypeForStructure):
129         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
130         (WebCore::JSTestSerializationInheritPrototype::JSTestSerializationInheritPrototype):
131         (WebCore::JSTestSerializationInheritConstructor::prototypeForStructure):
132         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
133         (WebCore::JSTestSerializationInheritFinalPrototype::JSTestSerializationInheritFinalPrototype):
134         (WebCore::JSTestSerializationInheritFinalConstructor::prototypeForStructure):
135         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
136         (WebCore::JSTestSerializedScriptValueInterfacePrototype::JSTestSerializedScriptValueInterfacePrototype):
137         * bindings/scripts/test/JS/JSTestStringifier.cpp:
138         (WebCore::JSTestStringifierPrototype::JSTestStringifierPrototype):
139         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
140         (WebCore::JSTestStringifierAnonymousOperationPrototype::JSTestStringifierAnonymousOperationPrototype):
141         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
142         (WebCore::JSTestStringifierNamedOperationPrototype::JSTestStringifierNamedOperationPrototype):
143         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
144         (WebCore::JSTestStringifierOperationImplementedAsPrototype::JSTestStringifierOperationImplementedAsPrototype):
145         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
146         (WebCore::JSTestStringifierOperationNamedToStringPrototype::JSTestStringifierOperationNamedToStringPrototype):
147         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
148         (WebCore::JSTestStringifierReadOnlyAttributePrototype::JSTestStringifierReadOnlyAttributePrototype):
149         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
150         (WebCore::JSTestStringifierReadWriteAttributePrototype::JSTestStringifierReadWriteAttributePrototype):
151         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
152         (WebCore::JSTestTypedefsPrototype::JSTestTypedefsPrototype):
153
154 2019-06-22  Mike Gorse  <mgorse@suse.com>
155
156         webkitgtk 2.24.2 fails to build w/gstreamer 1.12.5
157         https://bugs.webkit.org/show_bug.cgi?id=198080
158
159         Reviewed by Philippe Normand.
160
161         No new tests (build fix only).
162
163         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
164         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
165         Move includes of gst/gl/gl.h and epoxy/gl.h into
166         MediaPlayerPrivateGStreamerBase.h.
167
168 2019-06-21  Sihui Liu  <sihui_liu@apple.com>
169
170         openDatabase should return an empty object when WebSQL is disabled
171         https://bugs.webkit.org/show_bug.cgi?id=198805
172
173         Reviewed by Geoffrey Garen.
174
175         Some websites rely on calling openDatabase with null parameters to check for private browsing. To not break 
176         those sites, we now expose openDatabase interface even if Web SQL is disabled. When Web SQL is disabled, 
177         window.openDatabase returns false, but it is callable and returns empty object.
178
179         Test: WebSQL.OpenDatabaseAlwaysExists
180
181         * Modules/webdatabase/DOMWindowWebDatabase.idl:
182         * bindings/js/JSDOMWindowCustom.cpp:
183         (WebCore::jsDOMWindowInstanceFunctionOpenDatabaseBody):
184         (WebCore::IDLOperation<JSDOMWindow>::cast):
185         (WebCore::jsDOMWindowInstanceFunctionOpenDatabase):
186         (WebCore::JSDOMWindow::openDatabase const):
187
188 2019-06-21  Ryosuke Niwa  <rniwa@webkit.org>
189
190         Nullptr crash in DeleteSelectionCommand::handleGeneralDelete
191         https://bugs.webkit.org/show_bug.cgi?id=199126
192
193         Reviewed by Wenson Hsieh.
194
195         Added null checks to handleGeneralDelete as well as mergeParagraphs which runs after handleGeneralDelete to be defensive.
196
197         Unfortunately no new tests since there is no reproducible test case.
198
199         * editing/DeleteSelectionCommand.cpp:
200         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
201         (WebCore::DeleteSelectionCommand::mergeParagraphs):
202
203 2019-06-21  Youenn Fablet  <youenn@apple.com>
204
205         ResourceLoadNotifier should check whether its frame document loader is null
206         https://bugs.webkit.org/show_bug.cgi?id=199118
207
208         Reviewed by Geoffrey Garen.
209
210         * loader/ResourceLoadNotifier.cpp:
211         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
212
213 2019-06-21  Jiewen Tan  <jiewen_tan@apple.com>
214
215         WebPageProxy::loadData should accept ShouldOpenExternalURLsPolicy
216         https://bugs.webkit.org/show_bug.cgi?id=199114
217         <rdar://problem/51671674>
218
219         Reviewed by Youenn Fablet.
220
221         Covered by new test content within existing tests.
222
223         * loader/FrameLoaderTypes.h:
224         Adds an EnumTraits for ShouldOpenExternalURLsPolicy.
225
226 2019-06-21  Saam Barati  <sbarati@apple.com>
227
228         [WHLSL] Code that accesses an undefined variable crashes
229         https://bugs.webkit.org/show_bug.cgi?id=198775
230
231         Reviewed by Myles C. Maxfield.
232
233         Myles mostly fixed this in r246631 when he made NameResolver propagate
234         its error to its parent NameResolver. However, there was still one bug
235         where we ended up calling setError twice for an if statement. This patch
236         fixes that and adds tests.
237
238         Tests: webgpu/whlsl-use-undefined-variable-2.html
239                webgpu/whlsl-use-undefined-variable.html
240
241         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
242         (WebCore::WHLSL::NameResolver::visit):
243
244 2019-06-21  Truitt Savell  <tsavell@apple.com>
245
246         Unreviewed, rolling out r246611.
247
248         Introduced a flakey test.
249
250         Reverted changeset:
251
252         "iOS 12.2 Drawing portrait video to canvas is sideways"
253         https://bugs.webkit.org/show_bug.cgi?id=196772
254         https://trac.webkit.org/changeset/246611
255
256 2019-06-21  Tim Horton  <timothy_horton@apple.com>
257
258         Preview of <picture> element doesn't match element bounds
259         https://bugs.webkit.org/show_bug.cgi?id=199049
260         <rdar://problem/51474402>
261
262         Reviewed by Simon Fraser.
263
264         Test: fast/text-indicator/text-indicator-uses-img-size-inside-picture.html
265
266         * dom/DOMRectReadOnly.idl:
267         * dom/Range.cpp:
268         (WebCore::Range::absoluteRectsForRangeInText const):
269         (WebCore::Range::absoluteTextRects const):
270         (WebCore::Range::borderAndTextRects const):
271         (WebCore::Range::boundingRect const):
272         (WebCore::Range::absoluteBoundingRect const):
273         * dom/Range.h:
274         (WebCore::Range::absoluteTextRects):
275         (WebCore::Range::absoluteBoundingRect):
276         (WebCore::Range::borderAndTextRects):
277         (WebCore::Range::boundingRect):
278         * page/TextIndicator.cpp:
279         (WebCore::absoluteBoundingRectForRange):
280         (WebCore::estimatedBackgroundColorForRange):
281         (WebCore::initializeIndicator):
282         * rendering/RenderBlock.h:
283         * testing/Internals.cpp:
284         (WebCore::Internals::TextIndicatorData::TextIndicatorData):
285         (WebCore::Internals::TextIndicatorData::~TextIndicatorData):
286         (WebCore::Internals::textIndicatorForRange):
287         * testing/Internals.h:
288         * testing/Internals.idl:
289
290 2019-06-21  Youenn Fablet  <youenn@apple.com>
291
292         Safari crashes after ~2028 OfflineAudioContext objects are created (they never get garbage collected, consuming a thread each)
293         https://bugs.webkit.org/show_bug.cgi?id=198964
294         <rdar://problem/51891520>
295
296         Reviewed by Jer Noble.
297
298         Move from setPendingActivity/unsetPendingActivity to an
299         m_pendingActivity member which is easier to manage.
300
301         Keep setting a pending activity for AudioContext at construction time
302         but do not do that for Offline contexts.
303         Instead, set the pending activity when startRendering is called.
304         Unset the pending activity when the rendering activity is finished.
305
306         Make m_audioDecoder a unique pointer so that it can lazily be initialized.
307         This removes the burden of creating an audio decoder thread for each context.
308
309         Test: webaudio/offlineaudiocontext-gc.html
310
311         * Modules/webaudio/AudioContext.cpp:
312         (WebCore::AudioContext::AudioContext):
313         (WebCore::AudioContext::constructCommon):
314         (WebCore::AudioContext::clear):
315         (WebCore::AudioContext::decodeAudioData):
316         (WebCore::AudioContext::startRendering):
317         (WebCore::AudioContext::finishedRendering):
318         (WebCore::AudioContext::dispatchEvent):
319         (WebCore::AudioContext::clearPendingActivity):
320         (WebCore::AudioContext::makePendingActivity):
321         To keep it consistent with setPendingActivity/unsetPendingActivity, we
322         explicitly ref/unref the AudioContext. We should try to remove this ref/unref.
323         * Modules/webaudio/AudioContext.h:
324         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
325         (WebCore::OfflineAudioDestinationNode::startRendering):
326
327 2019-06-21  Truitt Savell  <tsavell@apple.com>
328
329         Unreviewed, rolling out r246655.
330
331         Introduced a failing test
332
333         Reverted changeset:
334
335         "Web Inspector: AXI: Audit: image label test is throwing
336         spurious errors on elements with existing alt attr, but no
337         value: <img alt>"
338         https://bugs.webkit.org/show_bug.cgi?id=194754
339         https://trac.webkit.org/changeset/246655
340
341 2019-06-21  Myles C. Maxfield  <mmaxfield@apple.com>
342
343         [WHLSL] read modify write expressions do no work as expected
344         https://bugs.webkit.org/show_bug.cgi?id=195864
345
346         Reviewed by Saam Barati.
347
348         Turns out https://bugs.webkit.org/show_bug.cgi?id=199037 already fixed everything.
349         This patch just adds a test.
350
351         Test: webgpu/whlsl-read-modify-write.html
352
353         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
354
355 2019-06-21  Zalan Bujtas  <zalan@apple.com>
356
357         [LFC][IFC] Adjust baseline top when the baseline moves.
358         https://bugs.webkit.org/show_bug.cgi?id=199091
359         <rdar://problem/51966257>
360
361         Reviewed by Antti Koivisto.
362
363         Currently only "text-align: bottom" adjusts the baseline top. This patch fixes the "text-align: baseline" case when
364         the growing ascent pushes the baseline top closer to the line top.
365
366         * layout/inlineformatting/InlineLine.cpp:
367         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
368
369 2019-06-21  Zalan Bujtas  <zalan@apple.com>
370
371         [LFC][IFC] Rename Line::m_contentLogicalHeight to m_lineLogicalHeight
372         https://bugs.webkit.org/show_bug.cgi?id=199100
373         <rdar://problem/51973614>
374
375         Reviewed by Antti Koivisto.
376
377         m_logicalLineHeight name seems more appropriate at this point (though the line heigh is driven by the content height).
378
379         * layout/inlineformatting/InlineLine.cpp:
380         (WebCore::Layout::Line::close):
381         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
382         * layout/inlineformatting/InlineLine.h:
383         (WebCore::Layout::Line::logicalHeight const):
384
385 2019-06-21  Zalan Bujtas  <zalan@apple.com>
386
387         [LFC][IFC] LineBox::Baseline should have a height getter.
388         https://bugs.webkit.org/show_bug.cgi?id=199092
389         <rdar://problem/51966958>
390
391         Reviewed by Antti Koivisto.
392
393         The baseline height does not need to be a getter on the Line (no one calls it).
394
395         * layout/inlineformatting/InlineLine.cpp:
396         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
397         * layout/inlineformatting/InlineLine.h:
398         (WebCore::Layout::Line::contentLogicalWidth const):
399         (WebCore::Layout::Line::baselineAlignedContentHeight const): Deleted.
400         * layout/inlineformatting/InlineLineBox.h:
401         (WebCore::Layout::LineBox::Baseline::height const):
402
403 2019-06-21  Michael Catanzaro  <mcatanzaro@igalia.com>
404
405         [WPE][GTK] Bump minimum versions of GLib, GTK, libsoup, ATK, GStreamer, and Cairo
406         https://bugs.webkit.org/show_bug.cgi?id=199094
407
408         Reviewed by Carlos Garcia Campos.
409
410         * accessibility/atk/AXObjectCacheAtk.cpp:
411         (WebCore::AXObjectCache::postPlatformNotification):
412         * accessibility/atk/WebKitAccessible.cpp:
413         (atkRole):
414         (setAtkStateSetFromCoreObject):
415         (interfaceMaskFromObject):
416         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
417         * accessibility/atk/WebKitAccessibleInterfaceTableCell.h:
418         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
419         (webkitAccessibleTextGetStringAtOffset):
420         (webkitAccessibleTextInterfaceInit):
421         * accessibility/atk/WebKitAccessibleInterfaceValue.cpp:
422         (webkitAccessibleValueInterfaceInit):
423         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
424         (WebCore::AudioTrackPrivateGStreamer::kind const):
425         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
426         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
427         (WTF::derefGPtr<GstStreamCollection>):
428         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
429         * platform/graphics/gstreamer/GStreamerCommon.cpp:
430         (WebCore::initializeGStreamerAndRegisterWebKitElements):
431         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
432         (WebCore::InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer):
433         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
434         (WebCore::InbandTextTrackPrivateGStreamer::create):
435         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
436         (WebCore::MediaPlayerPrivateGStreamer::load):
437         (WebCore::MediaPlayerPrivateGStreamer::updateTracks):
438         (WebCore::MediaPlayerPrivateGStreamer::enableTrack):
439         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
440         (WebCore::MediaPlayerPrivateGStreamer::sourceSetup):
441         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage):
442         (WebCore::MediaPlayerPrivateGStreamer::supportsType):
443         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
444         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
445         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
446         (WebCore::MediaPlayerPrivateGStreamerBase::requestGLContext):
447         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink):
448         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):
449         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
450         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
451         (WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer):
452         (WebCore::TrackPrivateBaseGStreamer::disconnect):
453         (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
454         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
455         (WebCore::TrackPrivateBaseGStreamer::stream):
456         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
457         (WebCore::VideoTrackPrivateGStreamer::kind const):
458         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
459         * platform/gtk/PlatformKeyboardEventGtk.cpp:
460         (WebCore::eventTypeForGdkKeyEvent):
461         * platform/gtk/PlatformMouseEventGtk.cpp:
462         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
463         * platform/gtk/PlatformScreenGtk.cpp:
464         (WebCore::screenRect):
465         (WebCore::screenAvailableRect):
466         (WebCore::screenHasTouchDevice):
467         (WebCore::screenIsTouchPrimaryInputDevice):
468         (): Deleted.
469         (WebCore::isTouchDevice): Deleted.
470         (WebCore::deviceAddedCallback): Deleted.
471         (WebCore::deviceRemovedCallback): Deleted.
472         * platform/gtk/PlatformWheelEventGtk.cpp:
473         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
474         * platform/gtk/RenderThemeGadget.cpp:
475         * platform/gtk/RenderThemeGadget.h:
476         * platform/gtk/RenderThemeWidget.cpp:
477         * platform/gtk/RenderThemeWidget.h:
478         * platform/gtk/ScrollbarThemeGtk.cpp:
479         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
480         (WebCore::ScrollbarThemeGtk::themeChanged):
481         (WebCore::ScrollbarThemeGtk::updateThemeProperties):
482         (WebCore::ScrollbarThemeGtk::trackRect):
483         (WebCore::ScrollbarThemeGtk::forwardButtonRect):
484         (WebCore::ScrollbarThemeGtk::paint):
485         (WebCore::ScrollbarThemeGtk::scrollbarThickness):
486         (WebCore::createStyleContext): Deleted.
487         (WebCore::createChildStyleContext): Deleted.
488         (WebCore::paintStepper): Deleted.
489         (WebCore::adjustRectAccordingToMargin): Deleted.
490         * platform/mediastream/gstreamer/GStreamerCapturer.cpp:
491         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
492         * platform/network/soup/ResourceRequest.h:
493         (WebCore::toSoupMessagePriority):
494         * platform/network/soup/SoupNetworkSession.cpp:
495         (WebCore::SoupNetworkSession::SoupNetworkSession):
496         * rendering/RenderThemeGtk.cpp:
497         (WebCore::themePartStateFlags):
498         (WebCore::paintToggle):
499         (WebCore::RenderThemeGtk::paintButton):
500         (WebCore::menuListColor):
501         (WebCore::RenderThemeGtk::paintMenuList):
502         (WebCore::RenderThemeGtk::paintTextField):
503         (WebCore::adjustSearchFieldIconStyle):
504         (WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
505         (WebCore::RenderThemeGtk::paintSliderThumb):
506         (WebCore::RenderThemeGtk::paintProgressBar):
507         (WebCore::RenderThemeGtk::paintInnerSpinButton):
508         (WebCore::styleColor):
509         (WebCore::RenderThemeGtk::systemColor const):
510         (WebCore::RenderThemeGtk::paintMediaButton):
511         (WebCore::createStyleContext): Deleted.
512         (WebCore::loadThemedIcon): Deleted.
513         (WebCore::gtkTextDirection): Deleted.
514         (WebCore::gtkIconStateFlags): Deleted.
515         (WebCore::adjustRectForFocus): Deleted.
516         (WebCore::renderButton): Deleted.
517         (WebCore::getIconSizeForPixelSize): Deleted.
518         (WebCore::paintIcon): Deleted.
519         (WebCore::paintEntryIcon): Deleted.
520         (WebCore::centerRectVerticallyInParentInputElement): Deleted.
521         (WebCore::spinButtonArrowSize): Deleted.
522         (WebCore::paintSpinArrowButton): Deleted.
523
524 2019-06-20  Antoine Quint  <graouts@apple.com>
525
526         [Pointer Events] Respect pointer capture when dispatching mouse boundary events and updating :hover
527         https://bugs.webkit.org/show_bug.cgi?id=198999
528
529         Reviewed by Dean Jackson.
530
531         Up until now, we would not account for pointer capture (see https://w3c.github.io/pointerevents/#pointer-capture) when dispatching
532         mouse boundary events (mouseover, mouseout, mouseenter, mouseleave) and their counterpart pointer events. We would also not account
533         for it when updating :hover styles.
534
535         Now, when pointer capture changes for an element, we call setCapturingMouseEventsElement() on the EventHandler such that the element
536         that would naturally hit-test is overridden by the pointer capture element when identifying which target to use for the dispatch of
537         boundary mouse events. Additionally, when calling EventHandler::prepareMouseEvent(), we also use the pointer capture element to
538         eventually pass down to Document::updateHoverActiveState() such that :hover styles are applied to the correct element.
539
540         This also means that we need to re-run EventHandler::prepareMouseEvent() during mouse state changes to ensure that the :hover styles
541         are applied correctly should the pointer capture element change during dispatch of boundary mouse events.
542
543         * dom/Document.cpp:
544         (WebCore::Document::prepareMouseEvent): If there is one, use the pointer capture element instead of the hit-test target.
545         (WebCore::Document::updateHoverActiveState): Relax the mustBeInActiveChain condition in case the pointer capture element changed when
546         updating the :hover/:active chains.
547         * page/EventHandler.cpp:
548         (WebCore::EventHandler::handleMousePressEvent): Re-process the mouse event if the pointer capture element changed during event dispatch.
549         (WebCore::EventHandler::handleMouseMoveEvent): Re-process the mouse event if the pointer capture element changed during event dispatch.
550         (WebCore::EventHandler::handleMouseReleaseEvent): As we know the pointer capture element will be reset as part of the mouse being
551         released, we reset the pointer capture element and EventHandler's capture element prior to invalidating hover styles and boundary events.
552         (WebCore::EventHandler::setCapturingMouseEventsElement): Dispatch boundary events when a new element is set.
553         (WebCore::EventHandler::dispatchMouseEvent): New dispatchMouseEvent() variant that re-processes the provided MouseEventWithHitTestResults
554         in case the pointer capture element changes during event dispatch, as called by handleMousePressEvent() and handleMouseMoveEvent().
555         * page/EventHandler.h:
556         * page/PointerCaptureController.cpp:
557         (WebCore::PointerCaptureController::pointerCaptureElement): We now need to query whay the pointer capture element might be from EventHandler,
558         so expose a new method to access it.
559         (WebCore::PointerCaptureController::releasePointerCapture): Since we may not call processPendingPointerCapture() until the dispatch of the
560         next event, we must reset EventHandler's capturing mouse element right now so that the next event processed does not use it as an overriding target.
561         (WebCore::PointerCaptureController::hasPointerCapture): We would mistakenly return true if the provided element was null, which could be the
562         case of EventHandler's capturing element. Rather than changing call sites to check that the provided value exists, we change the method to
563         return false when the provided element is null. Note that this does not affect the API since it's exposed on Element itself.
564         (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex): Call dispatchEvent() instead of calling pointerEventWillBeDispatched() and
565         pointerEventWasDispatched().
566         (WebCore::PointerCaptureController::dispatchEvent): Remove all code specific to pointer capture since now the events will be dispatched on the
567         pointer capture element by EventHandler.
568         (WebCore::PointerCaptureController::processPendingPointerCapture): Make sure this method is not re-entrant since it dispatches events.
569         * page/PointerCaptureController.h:
570         * rendering/HitTestRequest.h:
571         (WebCore::HitTestRequest::pointerCaptureElementChanged const): Add a new HitTestRequestType bit such that we can indicate to Document::updateHoverActiveState()
572         that it must be update the :hover/:active chains when the pointer capture element has just changed.
573
574 2019-06-20  Carlos Garcia Campos  <cgarcia@igalia.com>
575
576         [GTK] Stop pretending WebCore::Widget can have a platform widget
577         https://bugs.webkit.org/show_bug.cgi?id=199066
578
579         Reviewed by Michael Catanzaro.
580
581         That was only possible in legacy WebKit that we no longer support. The code can be simplified a bit.
582
583         * platform/Widget.cpp:
584         (WebCore::Widget::init):
585         * platform/Widget.h:
586         (WebCore::Widget::setPlatformWidget):
587         (WebCore::Widget::releasePlatformWidget): Deleted.
588         (WebCore::Widget::retainPlatformWidget): Deleted.
589         * platform/gtk/PlatformScreenGtk.cpp:
590         (WebCore::systemVisual):
591         (WebCore::screenDepth):
592         (WebCore::screenDepthPerComponent):
593         (WebCore::screenRect):
594         (WebCore::screenAvailableRect):
595         (WebCore::getToplevel): Deleted.
596         (WebCore::getVisual): Deleted.
597         (WebCore::getScreen): Deleted.
598         * platform/gtk/WidgetGtk.cpp:
599         (WebCore::Widget::~Widget):
600         (WebCore::Widget::show):
601         (WebCore::Widget::hide):
602         (WebCore::Widget::setIsSelected):
603         (WebCore::Widget::setFrameRect):
604         (WebCore::Widget::releasePlatformWidget): Deleted.
605         (WebCore::Widget::retainPlatformWidget): Deleted.
606         * platform/ios/WidgetIOS.mm:
607         (WebCore::Widget::~Widget):
608
609 2019-06-20  Simon Fraser  <simon.fraser@apple.com>
610
611         Make it possible to include clipping in GraphicsLayer tree dumps
612         https://bugs.webkit.org/show_bug.cgi?id=199096
613
614         Reviewed by Zalan Bujtas.
615
616         Add LAYER_TREE_INCLUDES_CLIPPING and plumb it down to GraphicsLayers, turning
617         it on for a couple of tests.
618
619         * page/Frame.h:
620         * platform/graphics/GraphicsLayer.cpp:
621         (WebCore::GraphicsLayer::dumpProperties const):
622         * platform/graphics/GraphicsLayerClient.h:
623         * rendering/RenderLayerCompositor.cpp:
624         (WebCore::RenderLayerCompositor::layerTreeAsText):
625         * testing/Internals.cpp:
626         (WebCore::toLayerTreeFlags):
627         * testing/Internals.h:
628         * testing/Internals.idl:
629
630 2019-06-20  Daniel Bates  <dabates@apple.com>
631
632         [iOS] Evernote crashes when creating a note
633         https://bugs.webkit.org/show_bug.cgi?id=199083
634         <rdar://problem/51759247>
635
636         Reviewed by Brent Fulgham.
637
638         Add runtime check whether WebKit is being used in Evernote. Evernote's bundle ID
639         references iPhone, but they use the same ID for their iPad app as well.
640
641         * platform/RuntimeApplicationChecks.h:
642         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
643         (WebCore::IOSApplication::isEvernote): Added.
644
645 2019-06-20  Greg Doolittle  <gr3g@apple.com>
646
647         Web Inspector: AXI: Audit: image label test is throwing spurious errors on elements with existing alt attr, but no value: <img alt>
648         https://bugs.webkit.org/show_bug.cgi?id=194754
649
650         Reviewed by Chris Fleizach.
651
652         Test: accessibility/img-alt-attribute-unassigned-value.html
653
654         * accessibility/AccessibilityObject.cpp:
655         (WebCore::AccessibilityObject::computedRoleString const):
656
657 2019-06-20  Ryosuke Niwa  <rniwa@webkit.org>
658
659         REGRESSION(r245912): Crash in TextIterator::range via visiblePositionForIndexUsingCharacterIterator
660         https://bugs.webkit.org/show_bug.cgi?id=199061
661
662         Reviewed by Wenson Hsieh.
663
664         Avoid calling CharacterIterator::range when it's at the end. Otherwise, we'd crash with null pointer dereferencing.
665
666         Unfortunately no new tests since we don't have any reproducible test case.
667
668         * editing/Editing.cpp:
669         (WebCore::visiblePositionForIndexUsingCharacterIterator):
670
671 2019-06-20  Brent Fulgham  <bfulgham@apple.com>
672
673         Resolve frequent crashes in topPrivatelyControlledDomain
674         https://bugs.webkit.org/show_bug.cgi?id=199072
675         <rdar://problem/51428162>
676
677         Reviewed by Youenn Fablet.
678
679         Crash data indicates that we are frequently crashing when multiple threads call
680         WebCore::topPrivatelyControlledDomain. 
681
682         Code review showed the potential for a thread contention issue, since WebKit builds
683         with '--fno-threadsafe-statics'.
684
685         This patch corrects the thread safety issue in WebCore::topPrivatelyControlledDomain.
686
687         * platform/mac/PublicSuffixMac.mm:
688         (WebCore::topPrivatelyControlledDomain): Only instantiate the static cache after the
689         current thread has achieved its lock.
690
691 2019-06-20  Saam Barati  <sbarati@apple.com>
692
693         [WHLSL] Property resolver needs to recurse on newValueExpression for RMW operations
694         https://bugs.webkit.org/show_bug.cgi?id=199037
695
696         Reviewed by Myles C. Maxfield.
697
698         When we had an expression like `<e1> += <e2>`, we weren't running the property
699         resolver on <e2>. If <e2> was something like `mat[1][2]`, we wouldn't end up
700         simplifying that into the needed getter calls. This patch fixes this by having
701         the property resolver recurse on <e2>.
702         
703         This patch also fixes a bug in the property resolver where we weren't marking some
704         dereference expressions as LValues. This was causing bugs in the metal code generator.
705         
706         This patch also adds a way to dump the AST between passes that are
707         guaranteed to not fail.
708
709         Test: webgpu/whlsl-read-modify-write-high-zombies.html
710
711         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
712         (WebCore::WHLSL::prepareShared):
713         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
714         (WebCore::WHLSL::PropertyResolver::visit):
715         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
716
717 2019-06-20  John Wilander  <wilander@apple.com>
718
719         Storage Access API: Cap the number of times an iframe document can request access
720         https://bugs.webkit.org/show_bug.cgi?id=199074
721         <rdar://problem/51857195>
722
723         Reviewed by Brent Fulgham.
724
725         Tested manually.
726
727         This change just adds a counter to the number of times the user explicitly
728         denies storage access and returns early if the counter has reached the limit
729         of 2.
730
731         We hoped that iframes that request storage access would count the number
732         of times the user has been asked and not repeat the request over and over.
733         However, we're seeing pretty aggressive use of the API and users are
734         complaining. Therefore, we need a cap on how many times an iframed
735         document can ask if it is explicitly denied access by the user.
736
737         This is a first measure. If we see continued aggressive use of the API,
738         we'll have to consider more drastic measures.
739
740         * dom/DocumentStorageAccess.cpp:
741         (WebCore::DocumentStorageAccess::requestStorageAccess):
742         * dom/DocumentStorageAccess.h:
743
744 2019-06-20  Youenn Fablet  <youenn@apple.com>
745
746         Changing settings of a MediaStreamTrack clone should not alter the settings of the original track
747         https://bugs.webkit.org/show_bug.cgi?id=198840
748
749         Reviewed by Eric Carlson.
750
751         Rename RealtimeVideoSource in RealtimeVideoCaptureSource.
752         Introduce RealtimeVideoSource as a class wrapping RealtimeVideoCaptureSource.
753         Its goal is to be able to have independent settings from its underlying RealtimeVideoCaptureSource.
754         It can also adapt size based on its settings if different than its RealtimeVideoCaptureSource.
755         Apply this wrapping for AV video sources as well as mock video sources.
756         Test: fast/mediastream/mediastreamtrack-video-clone.html
757
758         * Sources.txt:
759         * WebCore.xcodeproj/project.pbxproj:
760         * platform/mediastream/MediaStreamTrackPrivate.cpp:
761         (WebCore::MediaStreamTrackPrivate::clone):
762         * platform/mediastream/RealtimeMediaSource.h:
763         * platform/mediastream/RealtimeVideoCaptureSource.cpp: Added.
764         (WebCore::RealtimeVideoCaptureSource::RealtimeVideoCaptureSource):
765         (WebCore::RealtimeVideoCaptureSource::~RealtimeVideoCaptureSource):
766         (WebCore::RealtimeVideoCaptureSource::prepareToProduceData):
767         (WebCore::RealtimeVideoCaptureSource::presets):
768         (WebCore::RealtimeVideoCaptureSource::setSupportedPresets):
769         (WebCore::RealtimeVideoCaptureSource::standardVideoSizes):
770         (WebCore::updateMinMax):
771         (WebCore::RealtimeVideoCaptureSource::updateCapabilities):
772         (WebCore::RealtimeVideoCaptureSource::supportsSizeAndFrameRate):
773         (WebCore::RealtimeVideoCaptureSource::frameRateRangeIncludesRate):
774         (WebCore::RealtimeVideoCaptureSource::presetSupportsFrameRate):
775         (WebCore::RealtimeVideoCaptureSource::supportsCaptureSize):
776         (WebCore::RealtimeVideoCaptureSource::shouldUsePreset):
777         (WebCore::RealtimeVideoCaptureSource::bestSupportedSizeAndFrameRate):
778         (WebCore::RealtimeVideoCaptureSource::setSizeAndFrameRate):
779         (WebCore::RealtimeVideoCaptureSource::adaptVideoSample):
780         (WebCore::RealtimeVideoCaptureSource::dispatchMediaSampleToObservers):
781         (WebCore::RealtimeVideoCaptureSource::clientUpdatedSizeAndFrameRate):
782         (WebCore::SizeAndFrameRate::toJSONObject const):
783         (WebCore::SizeAndFrameRate::toJSONString const):
784         * platform/mediastream/RealtimeVideoCaptureSource.h: Added.
785         (WebCore::RealtimeVideoCaptureSource::sampleRotation const):
786         (WebCore::RealtimeVideoCaptureSource::prefersPreset):
787         (WebCore::RealtimeVideoCaptureSource::setFrameRateWithPreset):
788         (WebCore::RealtimeVideoCaptureSource::canResizeVideoFrames const):
789         (WebCore::RealtimeVideoCaptureSource::setDefaultSize):
790         (WebCore::RealtimeVideoCaptureSource::observedFrameRate const):
791         (WTF::LogArgument<WebCore::SizeAndFrameRate>::toString):
792         * platform/mediastream/RealtimeVideoSource.cpp:
793         (WebCore::RealtimeVideoSource::RealtimeVideoSource):
794         (WebCore::m_source):
795         (WebCore::RealtimeVideoSource::~RealtimeVideoSource):
796         (WebCore::RealtimeVideoSource::startProducingData):
797         (WebCore::RealtimeVideoSource::stopProducingData):
798         (WebCore::RealtimeVideoSource::supportsSizeAndFrameRate):
799         (WebCore::RealtimeVideoSource::setSizeAndFrameRate):
800         (WebCore::RealtimeVideoSource::sourceMutedChanged):
801         (WebCore::RealtimeVideoSource::sourceSettingsChanged):
802         (WebCore::RealtimeVideoSource::preventSourceFromStopping):
803         (WebCore::RealtimeVideoSource::sourceStopped):
804         (WebCore::RealtimeVideoSource::videoSampleAvailable):
805         (WebCore::RealtimeVideoSource::clone):
806         * platform/mediastream/RealtimeVideoSource.h:
807         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
808         (WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource):
809         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
810         * platform/mediastream/mac/AVVideoCaptureSource.h:
811         * platform/mediastream/mac/AVVideoCaptureSource.mm:
812         (WebCore::AVVideoCaptureSource::create):
813         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
814         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
815         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
816         (WebCore::MockRealtimeVideoSource::create):
817         * platform/mock/MockRealtimeVideoSource.cpp:
818         (WebCore::MockRealtimeVideoSource::create):
819         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
820         (WebCore::MockRealtimeVideoSource::supportsSizeAndFrameRate):
821         (WebCore::MockRealtimeVideoSource::setSizeAndFrameRate):
822         * platform/mock/MockRealtimeVideoSource.h:
823
824 2019-06-20  Saam Barati  <sbarati@apple.com>
825
826         Unreviewed. More speculative build fixing for watchOS after r246631.
827
828         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
829
830 2019-06-20  Saam Barati  <sbarati@apple.com>
831
832         Unreviewed. Speculative build fix for watchOS after r246631.
833
834         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
835
836 2019-06-18  Darin Adler  <darin@apple.com>
837
838         Tidy up the remaining bits of the AtomicString to AtomString rename
839         https://bugs.webkit.org/show_bug.cgi?id=198990
840
841         Reviewed by Michael Catanzaro.
842
843         * bindings/scripts/test/JS/JSTestObj.cpp: Updated names.
844         * bindings/scripts/test/TestObj.idl: Ditto.
845
846         * css/makeprop.pl: Updated comment.
847         * css/makevalues.pl: Ditto.
848         * html/FormController.cpp:
849         (WebCore::FormKeyGenerator::formKey): Ditto.
850
851 2019-06-20  Zalan Bujtas  <zalan@apple.com>
852
853         [LFC][IFC] Make the initial strut explicit
854         https://bugs.webkit.org/show_bug.cgi?id=199057
855         <rdar://problem/51927864>
856
857         Reviewed by Antti Koivisto.
858
859         The strut always sets the initial vertical constraints on the new line in strict mode. However in quirks mode
860         we can ignore it as long as there's no baseline type content on the line.  
861
862         * layout/inlineformatting/InlineFormattingContext.h:
863         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
864         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
865         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
866         (WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints):
867         * layout/inlineformatting/InlineLine.cpp:
868         (WebCore::Layout::Line::appendTextContent):
869         (WebCore::Layout::Line::appendHardLineBreak):
870         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
871         * layout/inlineformatting/InlineLine.h:
872
873 2019-06-20  Zalan Bujtas  <zalan@apple.com>
874
875         [LFC][IFC] Introduce Line::InitialConstraints
876         https://bugs.webkit.org/show_bug.cgi?id=199056
877         <rdar://problem/51927597>
878
879         Reviewed by Antti Koivisto.
880
881         Line::InitialConstraints, as the name suggests, holds the initial constraint values for the new line. 
882
883         * layout/inlineformatting/InlineFormattingContext.h:
884         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
885         (WebCore::Layout::InlineFormattingContext::LineLayout::LineInput::LineInput):
886         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
887         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
888         (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const):
889         * layout/inlineformatting/InlineLine.cpp:
890         (WebCore::Layout::Line::Line):
891         (WebCore::Layout::m_skipVerticalAligment):
892         (WebCore::Layout::m_lineLogicalWidth): Deleted.
893         * layout/inlineformatting/InlineLine.h:
894
895 2019-06-20  Carlos Garcia Campos  <cgarcia@igalia.com>
896
897         [GTK] Remove support for GTK2 plugins
898         https://bugs.webkit.org/show_bug.cgi?id=199065
899
900         Reviewed by Sergio Villar Senin.
901
902         * PlatformGTK.cmake:
903         * SourcesGTK.txt:
904         * SourcesWPE.txt:
905         * platform/FreeType.cmake:
906         * platform/SourcesGLib.txt:
907         * platform/graphics/Color.h:
908         * platform/graphics/PlatformDisplay.cpp:
909         (WebCore::PlatformDisplay::createPlatformDisplay):
910         * platform/graphics/gtk/ColorGtk.cpp:
911         (WebCore::Color::operator GdkRGBA const):
912         * platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp:
913         (WebCore::onFrameClockUpdate):
914         (WebCore::DisplayRefreshMonitorGtk::requestRefreshCallback):
915         * platform/graphics/gtk/DisplayRefreshMonitorGtk.h:
916         (WebCore::DisplayRefreshMonitorGtk::create):
917         * platform/graphics/gtk/GdkCairoUtilities.cpp:
918         * platform/gtk/GRefPtrGtk.cpp:
919         * platform/gtk/GRefPtrGtk.h:
920         * platform/gtk/GtkVersioning.c: Removed.
921         * platform/gtk/GtkVersioning.h: Removed.
922         * platform/gtk/PasteboardHelper.cpp:
923         (WebCore::PasteboardHelper::getClipboardContents):
924         * platform/gtk/PlatformKeyboardEventGtk.cpp:
925         (WebCore::modifiersForGdkKeyEvent):
926         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
927         * platform/gtk/PlatformMouseEventGtk.cpp:
928         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
929         * platform/gtk/PlatformScreenGtk.cpp:
930         (WebCore::screenIsTouchPrimaryInputDevice):
931         * platform/gtk/PlatformWheelEventGtk.cpp:
932         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
933         * platform/gtk/ScrollbarThemeGtk.cpp:
934         * platform/gtk/ScrollbarThemeGtk.h:
935         * platform/gtk/WidgetGtk.cpp:
936         * rendering/RenderThemeGtk.cpp:
937         * rendering/RenderThemeGtk.h:
938
939 2019-06-19  Myles C. Maxfield  <mmaxfield@apple.com>
940
941         [WHLSL] Hook up common texture functions
942         https://bugs.webkit.org/show_bug.cgi?id=198704
943         <rdar://problem/51668841>
944
945         Reviewed by Saam Barati.
946
947         This patch adds the Metal implementation of the Sample(), Load(), and GetDimensions()
948         texture functions. The implementation simply performs string concatenation to produce the 
949         correct results, and adds many new native functions to the standard library.
950
951         We can't zero-fill texture types or sampler types, so this patch forbids default
952         constructors for those types. It also forbids those types to exist within arrays, array
953         references, or pointers, becuase an out-of-bounds access may cause us to try to zero-fill
954         them.
955
956         Tests: webgpu/whlsl-textures-getdimensions.html
957                webgpu/whlsl-textures-load.html
958                webgpu/whlsl-textures-sample.html
959
960         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h: Add some more introspection functions
961         so we can generate the necessary Metal functions for the appropriate texture types.
962         (WebCore::WHLSL::AST::NativeTypeDeclaration::isAtomic const):
963         (WebCore::WHLSL::AST::NativeTypeDeclaration::isTextureArray const):
964         (WebCore::WHLSL::AST::NativeTypeDeclaration::isDepthTexture const):
965         (WebCore::WHLSL::AST::NativeTypeDeclaration::isWritableTexture const):
966         (WebCore::WHLSL::AST::NativeTypeDeclaration::textureDimension const):
967         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsTextureArray):
968         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsDepthTexture):
969         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsWritableTexture):
970         (WebCore::WHLSL::AST::NativeTypeDeclaration::setTextureDimension):
971         (WebCore::WHLSL::AST::NativeTypeDeclaration::isAtom const): Deleted.
972         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: Native types can be passed into 
973         entry points, too.
974         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
975         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp: Entry points that return void don't need a
976         semantic.
977         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
978         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp: Implement the functions.
979         (WebCore::WHLSL::Metal::vectorLength):
980         (WebCore::WHLSL::Metal::vectorInnerType):
981         (WebCore::WHLSL::Metal::vectorSuffix):
982         (WebCore::WHLSL::Metal::writeNativeFunction):
983         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp: Textures come in two flavors: sample-able
984         and read/write-able. Make sure we produce the correct Metal types for them.
985         (WebCore::WHLSL::Metal::writeNativeType):
986         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp: We can't auto-initialize textures and 
987         samplers. Therefore, this function needs to be able to fail.
988         (WebCore::WHLSL::AutoInitialize::visit):
989         (WebCore::WHLSL::autoInitializeVariables):
990         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.h:
991         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp: We can't auto-initialize textures, so users
992         shouldn't be able to either.
993         (WebCore::WHLSL::checkDuplicateFunctions):
994         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp: Added. Make sure textures and samplers can't
995         exist inside arrays, array references, or pointers. This is because out-of-bounds accesses may cause
996         us to attempt to zero-fill the inner type, but we can't zero-fill textures and samplers.
997         (WebCore::WHLSL::TextureReferencesChecker::TextureReferencesChecker):
998         (WebCore::WHLSL::Searcher::Searcher):
999         (WebCore::WHLSL::Searcher::found const):
1000         (WebCore::WHLSL::Searcher::visit):
1001         (WebCore::WHLSL::TextureReferencesChecker::containsTextureOrSampler):
1002         (WebCore::WHLSL::TextureReferencesChecker::visit):
1003         (WebCore::WHLSL::checkTextureReferences):
1004         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.h.
1005         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1006         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp: Record more detailed information about texture types,
1007         so we can emit correct Metal code.
1008         (WebCore::WHLSL::Intrinsics::addFullTexture):
1009         (WebCore::WHLSL::Intrinsics::addDepthTexture):
1010         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
1011         (WebCore::WHLSL::Intrinsics::WTF_ARRAY_LENGTH):
1012         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp: Nested NameResolvers need to propagate their error. Also,
1013         native functions with named arguments shouldn't be adding their arguments to the global scope.
1014         (WebCore::WHLSL::NameResolver::visit):
1015         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
1016         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
1017         (WebCore::WHLSL::prepareShared):
1018         * Modules/webgpu/WHLSL/WHLSLProgram.h:
1019         (WebCore::WHLSL::Program::intrinsics const):
1020         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
1021         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: Metal doesn't have writable depth textures.
1022         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
1023         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: Don't generate default constructors for textures
1024         or samplers.
1025         (WebCore::WHLSL::synthesizeConstructors):
1026         * Sources.txt:
1027         * WebCore.xcodeproj/project.pbxproj:
1028         * platform/graphics/gpu/GPUTexture.h: Make texture usages more clear.
1029         (WebCore::GPUTexture::isSampled const):
1030         (WebCore::GPUTexture::isStorage const):
1031         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm: Ditto.
1032         (WebCore::GPUBindGroup::tryCreate):
1033         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Ditto.
1034         (WebCore::GPUProgrammablePassEncoder::setBindGroup):
1035         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm: Ditto.
1036         (WebCore::mtlTextureUsageForGPUTextureUsageFlags):
1037
1038 2019-06-19  Justin Fan  <justin_fan@apple.com>
1039
1040         [WHLSL] Create a shading language test harness
1041         https://bugs.webkit.org/show_bug.cgi?id=198978
1042
1043         Reviewed by Myles C. Maxfield.
1044
1045         When creating MTLArgumentEncoders for argument buffers, the user's arguments
1046         must match the order that they are declared in the shader. Move back-end information
1047         such as buffer lengths to the end of the argument arrays.
1048
1049         Test: webgpu/whlsl-harness-test.html
1050
1051         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
1052         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
1053         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
1054         (WebCore::GPUBindGroupLayout::tryCreate):
1055
1056 2019-06-19  Saam Barati  <sbarati@apple.com>
1057
1058         [WHLSL] The checker needs to resolve types for the anonymous variables in ReadModifyWrite expressions
1059         https://bugs.webkit.org/show_bug.cgi?id=198988
1060
1061         Reviewed by Dean Jackson and Myles C. Maxfield.
1062
1063         This patch makes it so that the Checker assigns types to the internal variables
1064         in a read modify write expression. These were the only variables that didn't have
1065         types ascribed to them.
1066
1067         This patch also does a fly by fix where we kept pointers to value types
1068         in a HashMap in the checker. This is wrong precisely when the HashMap gets
1069         resized. Instead, we now just store the value itself since we're just
1070         dealing with a simple Variant that wraps either an empty struct or an
1071         enum.
1072
1073         Test: webgpu/whlsl-checker-should-set-type-of-read-modify-write-variables.html
1074
1075         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
1076         (WebCore::WHLSL::AST::VariableDeclaration::setType):
1077         (WebCore::WHLSL::AST::VariableDeclaration::type const):
1078         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: Make it obvious that read
1079         modify write expressions are such by prefixing them with "RMW".
1080         (WebCore::WHLSL::ASTDumper::visit):
1081         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1082         (WebCore::WHLSL::Checker::visit):
1083
1084 2019-06-19  Devin Rousso  <drousso@apple.com>
1085
1086         Web Inspector: Network: replace CFNetwork SPI with new API where able
1087         https://bugs.webkit.org/show_bug.cgi?id=198762
1088
1089         Reviewed by Timothy Hatcher.
1090
1091         * platform/network/NetworkLoadMetrics.h:
1092
1093 2019-06-19  Jer Noble  <jer.noble@apple.com>
1094
1095         iOS 12.2 Drawing portrait video to canvas is sideways
1096         https://bugs.webkit.org/show_bug.cgi?id=196772
1097         <rdar://problem/49781802>
1098
1099         Reviewed by Eric Carlson.
1100
1101         Test: media/video-orientation-canvas.html
1102
1103         Move rotation code into its own ImageRotationSessionVT class for re-use across
1104         all existing classes with rotation operations. Should slightly increase performance
1105         for painting rotated media files, as the rotation only occurs once per frame, rather
1106         than once per drawing operation.
1107
1108         * WebCore.xcodeproj/project.pbxproj:
1109         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
1110         (WebCore::ImageDecoderAVFObjC::RotationProperties::isIdentity const): Deleted.
1111         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1112         (WebCore::ImageDecoderAVFObjC::readTrackMetadata):
1113         (WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
1114         (WebCore::ImageDecoderAVFObjC::setTrack):
1115         (WebCore::transformToRotationProperties): Deleted.
1116         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1117         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1118         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
1119         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastPixelBuffer):
1120         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
1121         * platform/graphics/cv/ImageRotationSessionVT.h: Added.
1122         (WebCore::ImageRotationSessionVT::RotationProperties::isIdentity const):
1123         (WebCore::ImageRotationSessionVT::rotationProperties const):
1124         (WebCore::ImageRotationSessionVT::rotatedSize):
1125         * platform/graphics/cv/ImageRotationSessionVT.mm: Added.
1126         (WebCore::transformToRotationProperties):
1127         (WebCore::ImageRotationSessionVT::ImageRotationSessionVT):
1128         (WebCore::ImageRotationSessionVT::rotate):
1129         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
1130         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
1131         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
1132         (WebCore::rotationToAngle):
1133         (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
1134         (WebCore::computeRotatedWidthAndHeight): Deleted.
1135
1136 2019-06-19  Simon Fraser  <simon.fraser@apple.com>
1137
1138         REGRESSION (246538): Newyorker.com header scrolls on page
1139         
1140         Revert parts of r246538 so that frame scrolling is reverted to using layer positions.
1141         Overflow scroll will still scroll by changing boundsOrigin.
1142         
1143         The bug was caused by confusion about insetClipLayer and scrollContainerLayer; macOS
1144         positions the clip layer using FrameView::yPositionForInsetClipLayer(), so it's not just
1145         a simple scroll container, and this change broke positioning for fixed position layers.
1146
1147         * page/scrolling/AsyncScrollingCoordinator.cpp:
1148         (WebCore::AsyncScrollingCoordinator::reconcileScrollPosition):
1149         * page/scrolling/ScrollingCoordinator.cpp:
1150         (WebCore::ScrollingCoordinator::insetClipLayerForFrameView):
1151         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1152         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
1153         * rendering/RenderLayerCompositor.cpp:
1154         (WebCore::RenderLayerCompositor::~RenderLayerCompositor):
1155         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
1156         (WebCore::RenderLayerCompositor::updateScrollLayerPosition):
1157         (WebCore::RenderLayerCompositor::updateScrollLayerClipping):
1158         (WebCore::RenderLayerCompositor::frameViewDidScroll):
1159         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
1160         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
1161         (WebCore::RenderLayerCompositor::ensureRootLayer):
1162         (WebCore::RenderLayerCompositor::destroyRootLayer):
1163         (WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
1164         (WebCore::RenderLayerCompositor::updateLayersForScrollPosition): Deleted.
1165         (WebCore::RenderLayerCompositor::updateScrollContainerGeometry): Deleted.
1166         * rendering/RenderLayerCompositor.h:
1167
1168 2019-06-19  Adrian Perez de Castro  <aperez@igalia.com>
1169
1170         [WPE][GTK] Fix build with unified sources disabled
1171         https://bugs.webkit.org/show_bug.cgi?id=198752
1172
1173         Reviewed by Michael Catanzaro.
1174
1175         No new tests needed.
1176
1177         * Modules/indexeddb/server/UniqueIDBDatabase.h: Add missing forward declaration for IDBGetRecordData,
1178         replace inclusion of UniqueIDBDatabaseConnection.h with a forward declaration.
1179         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h: Remove unneeded inclusion of
1180         UniqueIDBDatabaseTransaction.h, add missing inclusion of UniqueIDBDatabase.h
1181         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h: Remove unneeded inclusion of
1182         UniqueIDBDatabaseConnection.h inclusion.
1183         * bridge/c/c_class.cpp: Add inclusion of JSCJSValueInlines.h to avoid linker errors due
1184         to missing JSValue inline functions.
1185         * dom/DocumentParser.h: Replace forward declaration of Document with inclusion of Document.h,
1186         to avoid error due to usage of incomplete type in template expansion.
1187         * dom/Microtasks.h: Add missing forward declaration of JSC::VM
1188         * editing/markup.cpp: Add missing inclusion of PasteboardItemInfo.h
1189         * page/Quirks.h: Add missing forward declaration of WebCore::EventTarget
1190         * page/RuntimeEnabledFeatures.h: Add missing inclusion of wtf/Optional.h to avoid error due to
1191         expansion of undefined template.
1192         * page/SocketProvider.h: Add missing forward declaration for Document.
1193         * platform/graphics/GraphicsLayerClient.h: Add missing inclusion of wtf/OptionSet.h to avoid
1194         error due to expansion of undefined template.
1195         * rendering/RenderMultiColumnSpannerPlaceholder.h: Replace forward declaration of RenderMultiColumnFlow
1196         with inclusion of RenderMultiColumnFlow.h to avoid error due to usage of undefined class.
1197
1198 2019-06-19  Antti Koivisto  <antti@apple.com>
1199
1200         RequestedScrollPosition shouldn't be applied after node reattach
1201         https://bugs.webkit.org/show_bug.cgi?id=198994
1202         <rdar://problem/51439685>
1203
1204         Reviewed by Simon Fraser.
1205
1206         Test: scrollingcoordinator/ios/scroll-position-after-reattach.html
1207
1208         If a scrolling node gets reattached, its scroll position resets to (0,0) or whatever the previous
1209         requestedScrollPosition was, and the current position is lost.
1210
1211         * page/scrolling/ScrollingStateFixedNode.cpp:
1212         (WebCore::ScrollingStateFixedNode::setPropertyChangedBitsAfterReattach):
1213         (WebCore::ScrollingStateFixedNode::setAllPropertiesChanged): Deleted.
1214
1215         Rename to better reflect what this is for.
1216
1217         * page/scrolling/ScrollingStateFixedNode.h:
1218         * page/scrolling/ScrollingStateFrameHostingNode.cpp:
1219         (WebCore::ScrollingStateFrameHostingNode::setPropertyChangedBitsAfterReattach):
1220         (WebCore::ScrollingStateFrameHostingNode::setAllPropertiesChanged): Deleted.
1221         * page/scrolling/ScrollingStateFrameHostingNode.h:
1222         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1223         (WebCore::ScrollingStateFrameScrollingNode::setPropertyChangedBitsAfterReattach):
1224         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged): Deleted.
1225         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1226         * page/scrolling/ScrollingStateNode.cpp:
1227         (WebCore::ScrollingStateNode::setPropertyChangedBitsAfterReattach):
1228         (WebCore::ScrollingStateNode::setAllPropertiesChanged): Deleted.
1229         * page/scrolling/ScrollingStateNode.h:
1230         * page/scrolling/ScrollingStatePositionedNode.cpp:
1231         (WebCore::ScrollingStatePositionedNode::setPropertyChangedBitsAfterReattach):
1232         (WebCore::ScrollingStatePositionedNode::setAllPropertiesChanged): Deleted.
1233         * page/scrolling/ScrollingStatePositionedNode.h:
1234         * page/scrolling/ScrollingStateScrollingNode.cpp:
1235         (WebCore::ScrollingStateScrollingNode::setPropertyChangedBitsAfterReattach):
1236
1237         Don't set RequestedScrollPosition. It is a special property that is applied only once on request
1238         and shouldn't get reapplied. Nodes should keep their existing scroll position on reattach.
1239
1240         (WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged): Deleted.
1241         * page/scrolling/ScrollingStateScrollingNode.h:
1242         * page/scrolling/ScrollingStateStickyNode.cpp:
1243         (WebCore::ScrollingStateStickyNode::setPropertyChangedBitsAfterReattach):
1244         (WebCore::ScrollingStateStickyNode::setAllPropertiesChanged): Deleted.
1245         * page/scrolling/ScrollingStateStickyNode.h:
1246         * page/scrolling/ScrollingStateTree.cpp:
1247         (WebCore::ScrollingStateTree::nodeWasReattachedRecursive):
1248
1249 2019-06-18  Saam Barati  <sbarati@apple.com>
1250
1251         [WHLSL] Support matrices
1252         https://bugs.webkit.org/show_bug.cgi?id=198876
1253         <rdar://problem/51768882>
1254
1255         Reviewed by Dean Jackson and Myles Maxfield.
1256
1257         This patch adds in support for matrices to WHLSL. Most matrix related code
1258         is defined by the standard library. This patch just needed to add support
1259         for the native functions operator[] and operator[]= on matrix types. The only
1260         native functions that are named operator[] and operator[]= are for matrix
1261         operations, so we strongly assume when generating code for native operator[] and
1262         operator[]= that we're dealing with matrix types.
1263         
1264         operator[]= ignores the write if the index is out of bounds. operator[]
1265         returns a zeroed vector if the index is out of bounds.  
1266         
1267         This patch also incorporates two bug fixes:
1268         1. This patch takes Robin's patch in https://bugs.webkit.org/show_bug.cgi?id=198313 to ensure
1269         we don't have pointers to values in a hash map. This was needed in this patch
1270         otherwise we'd crash parsing the standard library.
1271         
1272         2. This patch fixes how we handle "break" in metal codegen. When I first
1273         implemented break, I strongly assumed we were in a loop. However, break
1274         can be either from a loop or from switch. This patch teaches the metal code
1275         generator to track which context we're in and to emit code accordingly.
1276
1277         Tests: webgpu/whlsl-matrix-2.html
1278                webgpu/whlsl-matrix.html
1279
1280         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
1281         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
1282         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::emitLoop):
1283         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp:
1284         (WebCore::WHLSL::Metal::generateMetalCodeShared):
1285         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
1286         (WebCore::WHLSL::Metal::writeNativeFunction):
1287         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1288         (WebCore::WHLSL::Checker::assignTypes):
1289         (WebCore::WHLSL::Checker::getInfo):
1290         (WebCore::WHLSL::Checker::assignType):
1291         (WebCore::WHLSL::Checker::forwardType):
1292         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
1293
1294 2019-06-18  Yusuke Suzuki  <ysuzuki@apple.com>
1295
1296         [JSC] JSLock should be WebThread aware
1297         https://bugs.webkit.org/show_bug.cgi?id=198911
1298
1299         Reviewed by Geoffrey Garen.
1300
1301         * bindings/js/CommonVM.cpp:
1302         (WebCore::commonVMSlow):
1303
1304 2019-06-18  Joseph Pecoraro  <pecoraro@apple.com>
1305
1306         WebSocketDeflater uses an unnecessarily constrained compression memory level
1307         https://bugs.webkit.org/show_bug.cgi?id=198973
1308
1309         Reviewed by Alex Christensen.
1310
1311         * Modules/websockets/WebSocketDeflater.cpp:
1312         Set the memLevel to the deflateInit2 default value, not a minimum value.
1313
1314 2019-06-18  Keith Miller  <keith_miller@apple.com>
1315
1316         Add support for WeakRef
1317         https://bugs.webkit.org/show_bug.cgi?id=198710
1318
1319         Reviewed by Yusuke Suzuki.
1320
1321         We need to make sure the Web MicrotaskQueue notifies the JSC VM
1322         that it has finished performing a microtask checkpoint. This lets
1323         the JSC VM know it is safe to collect referenced WeakRefs. Since
1324         there was no way to get the VM from the MicrotaskQueue I have
1325         added a RefPtr to the queue's VM. For the main thread the VM lives
1326         forever so is fine. For workers the queue and the VM share an
1327         owner so this shouldn't matter either.
1328
1329         Tests: js/weakref-async-is-collected.html
1330                js/weakref-eventually-collects-values.html
1331                js/weakref-microtasks-dont-collect.html
1332                js/weakref-weakset-consistency.html
1333
1334         * dom/Microtasks.cpp:
1335         (WebCore::MicrotaskQueue::MicrotaskQueue):
1336         (WebCore::MicrotaskQueue::mainThreadQueue):
1337         (WebCore::MicrotaskQueue::performMicrotaskCheckpoint):
1338         * dom/Microtasks.h:
1339         (WebCore::MicrotaskQueue::vm const):
1340         * workers/WorkerGlobalScope.cpp:
1341         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
1342
1343 2019-06-18  Kenneth Russell  <kbr@chromium.org>
1344
1345         Add preliminary ANGLE backend to WebCore
1346         https://bugs.webkit.org/show_bug.cgi?id=197755
1347
1348         Reviewed by Dean Jackson.
1349
1350         Add new files supplying an ANGLE version of GraphicsContext3D and
1351         Extensions3D, conditionalized under USE_ANGLE. Update Xcode project to
1352         build these files. This option compiles and links successfully.
1353
1354         FIXMEs remain in several common files which will be addressed in
1355         subsequent patches.
1356
1357         This work will be tested with the preexisting WebGL conformance
1358         suite.
1359
1360         * SourcesCocoa.txt:
1361         * WebCore.xcodeproj/project.pbxproj:
1362         * platform/graphics/ANGLEWebKitBridge.h:
1363         * platform/graphics/GraphicsContext3D.h:
1364         * platform/graphics/GraphicsContext3DManager.cpp:
1365         (WebCore::GraphicsContext3DManager::updateAllContexts):
1366         (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
1367         (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired):
1368         * platform/graphics/angle/Extensions3DANGLE.cpp: Copied from Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp.
1369         (WebCore::Extensions3DANGLE::Extensions3DANGLE):
1370         (WebCore::Extensions3DANGLE::supports):
1371         (WebCore::Extensions3DANGLE::ensureEnabled):
1372         (WebCore::Extensions3DANGLE::isEnabled):
1373         (WebCore::Extensions3DANGLE::getGraphicsResetStatusARB):
1374         (WebCore::Extensions3DANGLE::getTranslatedShaderSourceANGLE):
1375         (WebCore::Extensions3DANGLE::initializeAvailableExtensions):
1376         (WebCore::Extensions3DANGLE::readnPixelsEXT):
1377         (WebCore::Extensions3DANGLE::getnUniformfvEXT):
1378         (WebCore::Extensions3DANGLE::getnUniformivEXT):
1379         (WebCore::Extensions3DANGLE::blitFramebuffer):
1380         (WebCore::Extensions3DANGLE::renderbufferStorageMultisample):
1381         (WebCore::Extensions3DANGLE::createVertexArrayOES):
1382         (WebCore::Extensions3DANGLE::deleteVertexArrayOES):
1383         (WebCore::Extensions3DANGLE::isVertexArrayOES):
1384         (WebCore::Extensions3DANGLE::bindVertexArrayOES):
1385         (WebCore::Extensions3DANGLE::insertEventMarkerEXT):
1386         (WebCore::Extensions3DANGLE::pushGroupMarkerEXT):
1387         (WebCore::Extensions3DANGLE::popGroupMarkerEXT):
1388         (WebCore::Extensions3DANGLE::supportsExtension):
1389         (WebCore::Extensions3DANGLE::drawBuffersEXT):
1390         (WebCore::Extensions3DANGLE::drawArraysInstanced):
1391         (WebCore::Extensions3DANGLE::drawElementsInstanced):
1392         (WebCore::Extensions3DANGLE::vertexAttribDivisor):
1393         (WebCore::Extensions3DANGLE::getExtensions):
1394         * platform/graphics/angle/Extensions3DANGLE.h: Added.
1395         * platform/graphics/angle/GraphicsContext3DANGLE.cpp: Copied from Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp.
1396         (WebCore::GraphicsContext3D::releaseShaderCompiler):
1397         (WebCore::wipeAlphaChannelFromPixels):
1398         (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary):
1399         (WebCore::GraphicsContext3D::validateAttributes):
1400         (WebCore::GraphicsContext3D::reshapeFBOs):
1401         (WebCore::GraphicsContext3D::attachDepthAndStencilBufferIfNeeded):
1402         (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
1403         (WebCore::GraphicsContext3D::renderbufferStorage):
1404         (WebCore::GraphicsContext3D::getIntegerv):
1405         (WebCore::GraphicsContext3D::getShaderPrecisionFormat):
1406         (WebCore::GraphicsContext3D::texImage2D):
1407         (WebCore::GraphicsContext3D::depthRange):
1408         (WebCore::GraphicsContext3D::clearDepth):
1409         (WebCore::GraphicsContext3D::getExtensions):
1410         (WebCore::GraphicsContext3D::readPixels):
1411         (WebCore::setCurrentNameHashMapForShader):
1412         (WebCore::nameHashForShader):
1413         (WebCore::GraphicsContext3D::validateDepthStencil):
1414         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
1415         (WebCore::GraphicsContext3D::paintCompositedResultsToCanvas):
1416         (WebCore::GraphicsContext3D::paintRenderingResultsToImageData):
1417         (WebCore::GraphicsContext3D::prepareTexture):
1418         (WebCore::GraphicsContext3D::readRenderingResults):
1419         (WebCore::GraphicsContext3D::reshape):
1420         (WebCore::GraphicsContext3D::checkVaryingsPacking const):
1421         (WebCore::GraphicsContext3D::precisionsMatch const):
1422         (WebCore::GraphicsContext3D::getInternalFramebufferSize const):
1423         (WebCore::GraphicsContext3D::activeTexture):
1424         (WebCore::GraphicsContext3D::attachShader):
1425         (WebCore::GraphicsContext3D::bindAttribLocation):
1426         (WebCore::GraphicsContext3D::bindBuffer):
1427         (WebCore::GraphicsContext3D::bindFramebuffer):
1428         (WebCore::GraphicsContext3D::bindRenderbuffer):
1429         (WebCore::GraphicsContext3D::bindTexture):
1430         (WebCore::GraphicsContext3D::blendColor):
1431         (WebCore::GraphicsContext3D::blendEquation):
1432         (WebCore::GraphicsContext3D::blendEquationSeparate):
1433         (WebCore::GraphicsContext3D::blendFunc):
1434         (WebCore::GraphicsContext3D::blendFuncSeparate):
1435         (WebCore::GraphicsContext3D::bufferData):
1436         (WebCore::GraphicsContext3D::bufferSubData):
1437         (WebCore::GraphicsContext3D::mapBufferRange):
1438         (WebCore::GraphicsContext3D::unmapBuffer):
1439         (WebCore::GraphicsContext3D::copyBufferSubData):
1440         (WebCore::GraphicsContext3D::getInternalformativ):
1441         (WebCore::GraphicsContext3D::renderbufferStorageMultisample):
1442         (WebCore::GraphicsContext3D::texStorage2D):
1443         (WebCore::GraphicsContext3D::texStorage3D):
1444         (WebCore::GraphicsContext3D::getActiveUniforms):
1445         (WebCore::GraphicsContext3D::checkFramebufferStatus):
1446         (WebCore::GraphicsContext3D::clearColor):
1447         (WebCore::GraphicsContext3D::clear):
1448         (WebCore::GraphicsContext3D::clearStencil):
1449         (WebCore::GraphicsContext3D::colorMask):
1450         (WebCore::GraphicsContext3D::compileShader):
1451         (WebCore::GraphicsContext3D::compileShaderDirect):
1452         (WebCore::GraphicsContext3D::copyTexImage2D):
1453         (WebCore::GraphicsContext3D::copyTexSubImage2D):
1454         (WebCore::GraphicsContext3D::cullFace):
1455         (WebCore::GraphicsContext3D::depthFunc):
1456         (WebCore::GraphicsContext3D::depthMask):
1457         (WebCore::GraphicsContext3D::detachShader):
1458         (WebCore::GraphicsContext3D::disable):
1459         (WebCore::GraphicsContext3D::disableVertexAttribArray):
1460         (WebCore::GraphicsContext3D::drawArrays):
1461         (WebCore::GraphicsContext3D::drawElements):
1462         (WebCore::GraphicsContext3D::enable):
1463         (WebCore::GraphicsContext3D::enableVertexAttribArray):
1464         (WebCore::GraphicsContext3D::finish):
1465         (WebCore::GraphicsContext3D::flush):
1466         (WebCore::GraphicsContext3D::framebufferRenderbuffer):
1467         (WebCore::GraphicsContext3D::framebufferTexture2D):
1468         (WebCore::GraphicsContext3D::frontFace):
1469         (WebCore::GraphicsContext3D::generateMipmap):
1470         (WebCore::GraphicsContext3D::getActiveAttribImpl):
1471         (WebCore::GraphicsContext3D::getActiveAttrib):
1472         (WebCore::GraphicsContext3D::getActiveUniformImpl):
1473         (WebCore::GraphicsContext3D::getActiveUniform):
1474         (WebCore::GraphicsContext3D::getAttachedShaders):
1475         (WebCore::generateHashedName):
1476         (WebCore::GraphicsContext3D::mappedSymbolInShaderSourceMap):
1477         (WebCore::GraphicsContext3D::mappedSymbolName):
1478         (WebCore::GraphicsContext3D::originalSymbolInShaderSourceMap):
1479         (WebCore::GraphicsContext3D::originalSymbolName):
1480         (WebCore::GraphicsContext3D::getAttribLocation):
1481         (WebCore::GraphicsContext3D::getAttribLocationDirect):
1482         (WebCore::GraphicsContext3D::getContextAttributes):
1483         (WebCore::GraphicsContext3D::moveErrorsToSyntheticErrorList):
1484         (WebCore::GraphicsContext3D::getError):
1485         (WebCore::GraphicsContext3D::getString):
1486         (WebCore::GraphicsContext3D::hint):
1487         (WebCore::GraphicsContext3D::isBuffer):
1488         (WebCore::GraphicsContext3D::isEnabled):
1489         (WebCore::GraphicsContext3D::isFramebuffer):
1490         (WebCore::GraphicsContext3D::isProgram):
1491         (WebCore::GraphicsContext3D::isRenderbuffer):
1492         (WebCore::GraphicsContext3D::isShader):
1493         (WebCore::GraphicsContext3D::isTexture):
1494         (WebCore::GraphicsContext3D::lineWidth):
1495         (WebCore::GraphicsContext3D::linkProgram):
1496         (WebCore::GraphicsContext3D::pixelStorei):
1497         (WebCore::GraphicsContext3D::polygonOffset):
1498         (WebCore::GraphicsContext3D::sampleCoverage):
1499         (WebCore::GraphicsContext3D::scissor):
1500         (WebCore::GraphicsContext3D::shaderSource):
1501         (WebCore::GraphicsContext3D::stencilFunc):
1502         (WebCore::GraphicsContext3D::stencilFuncSeparate):
1503         (WebCore::GraphicsContext3D::stencilMask):
1504         (WebCore::GraphicsContext3D::stencilMaskSeparate):
1505         (WebCore::GraphicsContext3D::stencilOp):
1506         (WebCore::GraphicsContext3D::stencilOpSeparate):
1507         (WebCore::GraphicsContext3D::texParameterf):
1508         (WebCore::GraphicsContext3D::texParameteri):
1509         (WebCore::GraphicsContext3D::uniform1f):
1510         (WebCore::GraphicsContext3D::uniform1fv):
1511         (WebCore::GraphicsContext3D::uniform2f):
1512         (WebCore::GraphicsContext3D::uniform2fv):
1513         (WebCore::GraphicsContext3D::uniform3f):
1514         (WebCore::GraphicsContext3D::uniform3fv):
1515         (WebCore::GraphicsContext3D::uniform4f):
1516         (WebCore::GraphicsContext3D::uniform4fv):
1517         (WebCore::GraphicsContext3D::uniform1i):
1518         (WebCore::GraphicsContext3D::uniform1iv):
1519         (WebCore::GraphicsContext3D::uniform2i):
1520         (WebCore::GraphicsContext3D::uniform2iv):
1521         (WebCore::GraphicsContext3D::uniform3i):
1522         (WebCore::GraphicsContext3D::uniform3iv):
1523         (WebCore::GraphicsContext3D::uniform4i):
1524         (WebCore::GraphicsContext3D::uniform4iv):
1525         (WebCore::GraphicsContext3D::uniformMatrix2fv):
1526         (WebCore::GraphicsContext3D::uniformMatrix3fv):
1527         (WebCore::GraphicsContext3D::uniformMatrix4fv):
1528         (WebCore::GraphicsContext3D::useProgram):
1529         (WebCore::GraphicsContext3D::validateProgram):
1530         (WebCore::GraphicsContext3D::vertexAttrib1f):
1531         (WebCore::GraphicsContext3D::vertexAttrib1fv):
1532         (WebCore::GraphicsContext3D::vertexAttrib2f):
1533         (WebCore::GraphicsContext3D::vertexAttrib2fv):
1534         (WebCore::GraphicsContext3D::vertexAttrib3f):
1535         (WebCore::GraphicsContext3D::vertexAttrib3fv):
1536         (WebCore::GraphicsContext3D::vertexAttrib4f):
1537         (WebCore::GraphicsContext3D::vertexAttrib4fv):
1538         (WebCore::GraphicsContext3D::vertexAttribPointer):
1539         (WebCore::GraphicsContext3D::viewport):
1540         (WebCore::GraphicsContext3D::createVertexArray):
1541         (WebCore::GraphicsContext3D::deleteVertexArray):
1542         (WebCore::GraphicsContext3D::isVertexArray):
1543         (WebCore::GraphicsContext3D::bindVertexArray):
1544         (WebCore::GraphicsContext3D::getBooleanv):
1545         (WebCore::GraphicsContext3D::getBufferParameteriv):
1546         (WebCore::GraphicsContext3D::getFloatv):
1547         (WebCore::GraphicsContext3D::getInteger64v):
1548         (WebCore::GraphicsContext3D::getFramebufferAttachmentParameteriv):
1549         (WebCore::GraphicsContext3D::getProgramiv):
1550         (WebCore::GraphicsContext3D::getNonBuiltInActiveSymbolCount):
1551         (WebCore::GraphicsContext3D::getUnmangledInfoLog):
1552         (WebCore::GraphicsContext3D::getProgramInfoLog):
1553         (WebCore::GraphicsContext3D::getRenderbufferParameteriv):
1554         (WebCore::GraphicsContext3D::getShaderiv):
1555         (WebCore::GraphicsContext3D::getShaderInfoLog):
1556         (WebCore::GraphicsContext3D::getShaderSource):
1557         (WebCore::GraphicsContext3D::getTexParameterfv):
1558         (WebCore::GraphicsContext3D::getTexParameteriv):
1559         (WebCore::GraphicsContext3D::getUniformfv):
1560         (WebCore::GraphicsContext3D::getUniformiv):
1561         (WebCore::GraphicsContext3D::getUniformLocation):
1562         (WebCore::GraphicsContext3D::getVertexAttribfv):
1563         (WebCore::GraphicsContext3D::getVertexAttribiv):
1564         (WebCore::GraphicsContext3D::getVertexAttribOffset):
1565         (WebCore::GraphicsContext3D::texSubImage2D):
1566         (WebCore::GraphicsContext3D::compressedTexImage2D):
1567         (WebCore::GraphicsContext3D::compressedTexSubImage2D):
1568         (WebCore::GraphicsContext3D::createBuffer):
1569         (WebCore::GraphicsContext3D::createFramebuffer):
1570         (WebCore::GraphicsContext3D::createProgram):
1571         (WebCore::GraphicsContext3D::createRenderbuffer):
1572         (WebCore::GraphicsContext3D::createShader):
1573         (WebCore::GraphicsContext3D::createTexture):
1574         (WebCore::GraphicsContext3D::deleteBuffer):
1575         (WebCore::GraphicsContext3D::deleteFramebuffer):
1576         (WebCore::GraphicsContext3D::deleteProgram):
1577         (WebCore::GraphicsContext3D::deleteRenderbuffer):
1578         (WebCore::GraphicsContext3D::deleteShader):
1579         (WebCore::GraphicsContext3D::deleteTexture):
1580         (WebCore::GraphicsContext3D::synthesizeGLError):
1581         (WebCore::GraphicsContext3D::markContextChanged):
1582         (WebCore::GraphicsContext3D::markLayerComposited):
1583         (WebCore::GraphicsContext3D::layerComposited const):
1584         (WebCore::GraphicsContext3D::forceContextLost):
1585         (WebCore::GraphicsContext3D::recycleContext):
1586         (WebCore::GraphicsContext3D::dispatchContextChangedNotification):
1587         (WebCore::GraphicsContext3D::texImage2DDirect):
1588         (WebCore::GraphicsContext3D::drawArraysInstanced):
1589         (WebCore::GraphicsContext3D::drawElementsInstanced):
1590         (WebCore::GraphicsContext3D::vertexAttribDivisor):
1591         * platform/graphics/angle/TemporaryANGLESetting.cpp: Added.
1592         (WebCore::TemporaryANGLESetting::TemporaryANGLESetting):
1593         (WebCore::TemporaryANGLESetting::~TemporaryANGLESetting):
1594         * platform/graphics/angle/TemporaryANGLESetting.h: Added.
1595         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
1596         (WebCore::GraphicsContext3D::GraphicsContext3D):
1597         (WebCore::GraphicsContext3D::~GraphicsContext3D):
1598         (WebCore::GraphicsContext3D::makeContextCurrent):
1599         (WebCore::GraphicsContext3D::checkGPUStatus):
1600         (WebCore::GraphicsContext3D::screenDidChange):
1601         * platform/graphics/cocoa/WebGLLayer.h:
1602         * platform/graphics/cocoa/WebGLLayer.mm:
1603         (-[WebGLLayer display]):
1604         * platform/graphics/cv/TextureCacheCV.mm:
1605         (WebCore::TextureCacheCV::create):
1606         (WebCore::TextureCacheCV::textureFromImage):
1607         * platform/graphics/cv/VideoTextureCopierCV.cpp:
1608         (WebCore::enumToStringMap):
1609         (WebCore::VideoTextureCopierCV::initializeContextObjects):
1610         (WebCore::VideoTextureCopierCV::initializeUVContextObjects):
1611         (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
1612         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
1613         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
1614         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1615         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1616         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1617         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
1618
1619 2019-06-18  Saam Barati  <sbarati@apple.com>
1620
1621         [WHLSL] Do not generate duplicate constructors/copy constructors in synthesizeConstructors
1622         https://bugs.webkit.org/show_bug.cgi?id=198580
1623
1624         Reviewed by Robin Morisset.
1625
1626         Prior to this patch, we were generating duplicate constructors 
1627         for unnamed types. This is bad for two reasons:
1628         1. It's inefficient, since we'd generate a constructor for every place in
1629         the AST where we'd visit this unnamed type.
1630         2. It made it impossible to resolve function overloads to call
1631         the default constructor. This made it so that the autoInitializeVariables
1632         pass would crash if we ever generated more than one of these functions
1633         for the same type.
1634         
1635         To make this work, this patch splits up what used to be the resolveNamesInFunctions
1636         pass. Previously, this pass would both resolve calls and resolve type names.
1637         Synthesize constructors would run before this, since resolving calls meant we
1638         may resolve a call to one of these synthesized constructors. However, synthesize
1639         constructors now needs to test for the equality unnamed types, so it now requires
1640         running the type resolution part of resolveNamesInFunctions before it runs.
1641         
1642         This patch splits resolveNamesInFunctions into two parts:
1643         resolveTypeNamesInFunctions and resolveCallsInFunctions.
1644         
1645         So we used to run:
1646         synthesizeConstructors
1647         resolveNamesInFunctions
1648         
1649         And now we run:
1650         resolveTypeNamesInFunctions 
1651         synthesizeConstructors
1652         resolveCallsInFunctions
1653
1654         Test: webgpu/whlsl-duplicate-types-should-not-produce-duplicate-ctors.html
1655
1656         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
1657         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
1658         * Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h:
1659         (WebCore::WHLSL::AST::BooleanLiteral::clone const):
1660         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
1661         (WebCore::WHLSL::AST::EnumerationMemberLiteral::clone const):
1662         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
1663         (WebCore::WHLSL::AST::Expression::copyTypeTo const):
1664         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
1665         (WebCore::WHLSL::AST::FloatLiteral::clone const):
1666         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp:
1667         (WebCore::WHLSL::AST::FloatLiteralType::clone const):
1668         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
1669         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
1670         (WebCore::WHLSL::AST::IntegerLiteral::clone const):
1671         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
1672         (WebCore::WHLSL::AST::IntegerLiteralType::clone const):
1673         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
1674         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
1675         (WebCore::WHLSL::AST::NullLiteral::clone const):
1676         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
1677         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
1678         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
1679         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
1680         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::clone const):
1681         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
1682         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::clone const):
1683         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
1684         * Modules/webgpu/WHLSL/WHLSLASTDumper.h:
1685         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
1686         (WebCore::WHLSL::matches):
1687         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
1688         (WebCore::WHLSL::NameResolver::NameResolver):
1689         (WebCore::WHLSL::NameResolver::visit):
1690         (WebCore::WHLSL::resolveTypeNamesInFunctions):
1691         (WebCore::WHLSL::resolveCallsInFunctions):
1692         (WebCore::WHLSL::resolveNamesInFunctions): Deleted.
1693         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
1694         (WebCore::WHLSL::NameResolver::setIsResolvingCalls):
1695         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
1696         (WebCore::WHLSL::prepareShared):
1697         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
1698         (WebCore::WHLSL::UnnamedTypeKey::UnnamedTypeKey):
1699         (WebCore::WHLSL::UnnamedTypeKey::isEmptyValue const):
1700         (WebCore::WHLSL::UnnamedTypeKey::isHashTableDeletedValue const):
1701         (WebCore::WHLSL::UnnamedTypeKey::hash const):
1702         (WebCore::WHLSL::UnnamedTypeKey::operator== const):
1703         (WebCore::WHLSL::UnnamedTypeKey::unnamedType const):
1704         (WebCore::WHLSL::UnnamedTypeKey::Hash::hash):
1705         (WebCore::WHLSL::UnnamedTypeKey::Hash::equal):
1706         (WebCore::WHLSL::UnnamedTypeKey::Traits::isEmptyValue):
1707         (WebCore::WHLSL::FindAllTypes::takeUnnamedTypes):
1708         (WebCore::WHLSL::FindAllTypes::appendNamedType):
1709         (WebCore::WHLSL::synthesizeConstructors):
1710
1711 2019-06-18  Truitt Savell  <tsavell@apple.com>
1712
1713         Unreviewed, rolling out r246524.
1714
1715         Caused 45 webgpu/ crashes.
1716
1717         Reverted changeset:
1718
1719         "[WHLSL] The name resolver does not deal with
1720         nativeFunctionDeclaration"
1721         https://bugs.webkit.org/show_bug.cgi?id=198306
1722         https://trac.webkit.org/changeset/246524
1723
1724 2019-06-18  Zalan Bujtas  <zalan@apple.com>
1725
1726         [LFC][IFC] Inline quirks should have their dedicated class.
1727         https://bugs.webkit.org/show_bug.cgi?id=198962
1728         <rdar://problem/51848170>
1729
1730         Reviewed by Antti Koivisto.
1731
1732         * Sources.txt:
1733         * WebCore.xcodeproj/project.pbxproj:
1734         * layout/LayoutState.h:
1735         * layout/inlineformatting/InlineFormattingContext.h:
1736         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1737         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
1738         * layout/inlineformatting/InlineFormattingContextQuirks.cpp: Added.
1739         (WebCore::Layout::InlineFormattingContext::Quirks::collapseLineDescent):
1740         * layout/inlineformatting/InlineLine.cpp:
1741         (WebCore::Layout::Line::close):
1742         * layout/inlineformatting/InlineLineBreaker.cpp:
1743         * layout/inlineformatting/InlineLineBreaker.h:
1744
1745 2019-06-18  Zalan Bujtas  <zalan@apple.com>
1746
1747         [LFC][IFC] Line::append() should take care of all the inline types.
1748         https://bugs.webkit.org/show_bug.cgi?id=198961
1749         <rdar://problem/51847712>
1750
1751         Reviewed by Antti Koivisto.
1752
1753         Make all the existing Line::append* functions private.
1754
1755         * layout/FormattingContextGeometry.cpp:
1756         (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned): fix a typo.
1757         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1758         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
1759         * layout/inlineformatting/InlineLine.cpp:
1760         (WebCore::Layout::Line::append):
1761         * layout/inlineformatting/InlineLine.h:
1762
1763 2019-06-18  Simon Fraser  <simon.fraser@apple.com>
1764
1765         Convert macOS to scroll by changing layer boundsOrigin
1766         https://bugs.webkit.org/show_bug.cgi?id=198917
1767
1768         Reviewed by Antti Koivisto.
1769
1770         macOS did frame and overflow scrolling by changing the position of the scrolled
1771         contents layer. iOS scrolls by changing the boundsOrigin of the scrollContainer layer
1772         (which it has to, to match how UIScrollView works).
1773
1774         The iOS approach removes the need for an extra layer whose only role is for
1775         scroll positioning, so migrate macOS to the same approach. A later patch can remove
1776         m_scrolledContentsLayer.
1777         
1778         We can remove RenderLayerCompositor::m_clipLayer since m_scrollContainerLayer has exactly
1779         the same role now.
1780
1781         * page/scrolling/AsyncScrollingCoordinator.cpp:
1782         (WebCore::AsyncScrollingCoordinator::reconcileScrollPosition):
1783         * page/scrolling/ScrollingCoordinator.cpp:
1784         (WebCore::ScrollingCoordinator::insetClipLayerForFrameView):
1785         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1786         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
1787         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1788         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
1789         * platform/graphics/cocoa/WebCoreCALayerExtras.h:
1790         * platform/graphics/cocoa/WebCoreCALayerExtras.mm:
1791         (-[CALayer _web_setLayerBoundsOrigin:]):
1792         * rendering/RenderLayerBacking.cpp:
1793         (WebCore::RenderLayerBacking::updateGeometry):
1794         (WebCore::RenderLayerBacking::setLocationOfScrolledContents):
1795         (WebCore::RenderLayerBacking::updateScrollOffset):
1796         * rendering/RenderLayerCompositor.cpp:
1797         (WebCore::RenderLayerCompositor::~RenderLayerCompositor):
1798         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
1799         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
1800         (WebCore::RenderLayerCompositor::updateLayersForScrollPosition):
1801         (WebCore::RenderLayerCompositor::updateScrollContainerGeometry):
1802         (WebCore::RenderLayerCompositor::frameViewDidScroll):
1803         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
1804         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
1805         (WebCore::RenderLayerCompositor::ensureRootLayer):
1806         (WebCore::RenderLayerCompositor::destroyRootLayer):
1807         (WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
1808         (WebCore::RenderLayerCompositor::updateScrollLayerPosition): Deleted.
1809         (WebCore::RenderLayerCompositor::updateScrollLayerClipping): Deleted.
1810         * rendering/RenderLayerCompositor.h:
1811
1812 2019-06-18  Philippe Normand  <pnormand@igalia.com>
1813
1814         [GStreamer] Identify elements with monotonically increasing counters
1815         https://bugs.webkit.org/show_bug.cgi?id=198916
1816
1817         Reviewed by Xabier Rodriguez-Calvar.
1818
1819         Those ids tend to be shorter, easier to read for humans and for
1820         diff tools :) Underscores were also replaced by dashes, for
1821         consistency with the usual GStreamer element naming untold
1822         conventions.
1823
1824         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1825         (WebCore::MediaPlayerPrivateGStreamer::load):
1826         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1827         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
1828         (WebCore::GStreamerVideoEncoder::makeElement):
1829         (WebCore::GStreamerVideoEncoder::InitEncode):
1830
1831 2019-06-18  Zan Dobersek  <zdobersek@igalia.com>
1832
1833         [WebGL] Extensions3DOpenGLES::bindVertexArrayOES() should allow zero array object
1834         https://bugs.webkit.org/show_bug.cgi?id=198929
1835
1836         Reviewed by Carlos Garcia Campos.
1837
1838         A 0 object parameter for the glBindVertexArrayOES() call is a valid
1839         value since it binds the default vertex array object for any updates and
1840         draws. As such the Extensions3DOpenGLES implementation shouldn't return
1841         early if the object value is 0.
1842
1843         No new tests -- covered by existing tests.
1844
1845         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
1846         (WebCore::Extensions3DOpenGLES::bindVertexArrayOES):
1847
1848 2019-06-17  Sihui Liu  <sihui_liu@apple.com>
1849
1850         -[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:] doesn't delete _WKWebsiteDataTypeCredentials
1851         https://bugs.webkit.org/show_bug.cgi?id=198854
1852         <rdar://problem/51386058>
1853
1854         Reviewed by Geoffrey Garen.
1855
1856         Add option NSURLCredentialStorageRemoveSynchronizableCredentials when removing persistent credential so 
1857         credentials from same account will be removed from all devices.
1858
1859         Test: WKWebsiteDataStore.RemoveAllPersistentCredentials
1860
1861         * platform/network/CredentialStorage.cpp:
1862         (WebCore::CredentialStorage::originsWithPersistentCredentials):
1863         (WebCore::CredentialStorage::removePersistentCredentialsWithOrigins):
1864         (WebCore::CredentialStorage::clearPersistentCredentials):
1865         * platform/network/CredentialStorage.h:
1866         * platform/network/mac/CredentialStorageMac.mm:
1867         (WebCore::CredentialStorage::originsWithPersistentCredentials):
1868         (WebCore::CredentialStorage::removePersistentCredentialsWithOrigins):
1869         (WebCore::CredentialStorage::clearPersistentCredentials):
1870
1871 2019-06-17  Ryosuke Niwa  <rniwa@webkit.org>
1872
1873         m_disconnectedFrame can be null in DOMWindowExtension::willDestroyGlobalObjectInCachedFrame()
1874         https://bugs.webkit.org/show_bug.cgi?id=198943
1875
1876         Reviewed by Brady Eidson.
1877
1878         Apparently it's possible for m_disconnectedFrame to be null in this function even though this should never happen.
1879
1880         We've been trying to diagnose a class of issues in this area (e.g. r246187, r244971, r242797, r242677, r242676, r241848)
1881         but at some point, we need to stop crashing for the sake of user.
1882
1883         Worked around the bug by adding a null pointer check here.
1884
1885         * page/DOMWindowExtension.cpp:
1886         (WebCore::DOMWindowExtension::willDestroyGlobalObjectInCachedFrame):
1887
1888 2019-06-17  Alex Christensen  <achristensen@webkit.org>
1889
1890         Fix iOS crash when starting loads with no active DocumentLoader
1891         https://bugs.webkit.org/show_bug.cgi?id=187360
1892         <rdar://problem/29389084>
1893
1894         Reviewed by Geoff Garen.
1895
1896         When FrameLoader::activeDocumentLoader returns null in the ResourceLoader constructor,
1897         on iOS we will dereference it to ask if it has a frame in an early return in init.
1898         Let's not.  If we don't have a DocumentLoader, we don't have a frame and should fail.
1899
1900         Crash reports indicate this crash is related to Beacon and other uses of LoaderStrategy::startPingLoad,
1901         but attempts to make a unit test to reproduce the crash were unsuccessful.
1902
1903         * loader/ResourceLoader.cpp:
1904         (WebCore::ResourceLoader::init):
1905
1906 2019-06-17  Robin Morisset  <rmorisset@apple.com>
1907
1908         [WHLSL] The name resolver does not deal with nativeFunctionDeclaration
1909         https://bugs.webkit.org/show_bug.cgi?id=198306
1910
1911         Reviewed by Saam Barati.
1912
1913         We currently have a crash in the nameResolver when trying to use the full standard library.
1914         What is happening is that because we don't specify anything to do to nativeFunctionDeclarations, names in their parameters
1915         are added to the global environment. And so as soon as we have two such parameters with the same name, the name resolver fails.
1916
1917         Tested by adding two native functions that share a parameter name to the standard library.
1918
1919         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
1920         (WebCore::WHLSL::NameResolver::visit):
1921         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
1922
1923 2019-06-17  Robin Morisset  <rmorisset@apple.com>
1924
1925         [WHLSL] Remove backtracking from parseAttributeBlock
1926         https://bugs.webkit.org/show_bug.cgi?id=198934
1927
1928         Reviewed by Myles C. Maxfield.
1929
1930         No functional change intended.
1931
1932         Tested by running LayoutTests/webgpu/whlsl-compute.html
1933
1934         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
1935         (WebCore::WHLSL::Parser::parseAttributeBlock):
1936
1937 2019-06-17  Saam Barati  <sbarati@apple.com>
1938
1939         [WHLSL] Make .length work
1940         https://bugs.webkit.org/show_bug.cgi?id=198890
1941
1942         Reviewed by Myles Maxfield.
1943
1944         This patch makes accessing .length on buffers work. To make this work as
1945         expected, I've fixed a handful of small bugs:
1946         
1947         - The checker was not calling resolveByInstantiation for getters. This patch
1948           modifies the checker to do that, so we can now resolve a getter to
1949           "operator.length". I also refactored the checker to have a helper method
1950           that both does overload resolution and resolveByInstantiation to make it
1951           difficult to forget to call resolveByInstantiation.
1952         - The property resolver had a bug where it would return a non-null value
1953           in anderCallArgument for array references even when there was no ander and
1954           no thread ander function. This patch makes it now return null if there is
1955           neither an ander nor a thread ander.
1956         - The metal codegen incorrectly unpacked the length of buffers. It swapped the
1957           bottom four bytes and the top four bytes of the size_t value. This patch
1958           corrects that. This was also a cause of flakiness in various tests since
1959           we ended up with a length much larger than expected, leading to bounds
1960           checks always passing in our tests.
1961         - This patch also fixes our tests to specify the output buffer length
1962           properly for various programs.
1963
1964         Test: webgpu/whlsl-buffer-length.html
1965
1966         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
1967         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns):
1968         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1969         (WebCore::WHLSL::resolveFunction):
1970         (WebCore::WHLSL::Checker::finishVisiting):
1971         (WebCore::WHLSL::Checker::visit):
1972         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
1973         (WebCore::WHLSL::anderCallArgument):
1974
1975 2019-06-17  Ryan Haddad  <ryanhaddad@apple.com>
1976
1977         Unreviewed, rolling out r246501.
1978
1979         Breaks Apple internal builds.
1980
1981         Reverted changeset:
1982
1983         "Support using ANGLE as the backend for the WebGL
1984         implementation"
1985         https://bugs.webkit.org/show_bug.cgi?id=197755
1986         https://trac.webkit.org/changeset/246501
1987
1988 2019-06-17  Kenneth Russell  <kbr@chromium.org>
1989
1990         Support using ANGLE as the backend for the WebGL implementation
1991         https://bugs.webkit.org/show_bug.cgi?id=197755
1992
1993         Reviewed by Dean Jackson.
1994
1995         Add new files supplying an ANGLE version of GraphicsContext3D and
1996         Extensions3D, conditionalized under USE_ANGLE. Update Xcode project to
1997         build these files. This option compiles and links successfully.
1998
1999         FIXMEs remain in several common files which will be addressed in
2000         subsequent patches.
2001
2002         This work will be tested with the preexisting WebGL conformance
2003         suite.
2004
2005         * SourcesCocoa.txt:
2006         * WebCore.xcodeproj/project.pbxproj:
2007         * platform/graphics/ANGLEWebKitBridge.h:
2008         * platform/graphics/GraphicsContext3D.h:
2009         * platform/graphics/GraphicsContext3DManager.cpp:
2010         (WebCore::GraphicsContext3DManager::updateAllContexts):
2011         (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
2012         (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired):
2013         * platform/graphics/angle/Extensions3DANGLE.cpp: Copied from Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp.
2014         (WebCore::Extensions3DANGLE::Extensions3DANGLE):
2015         (WebCore::Extensions3DANGLE::supports):
2016         (WebCore::Extensions3DANGLE::ensureEnabled):
2017         (WebCore::Extensions3DANGLE::isEnabled):
2018         (WebCore::Extensions3DANGLE::getGraphicsResetStatusARB):
2019         (WebCore::Extensions3DANGLE::getTranslatedShaderSourceANGLE):
2020         (WebCore::Extensions3DANGLE::initializeAvailableExtensions):
2021         (WebCore::Extensions3DANGLE::readnPixelsEXT):
2022         (WebCore::Extensions3DANGLE::getnUniformfvEXT):
2023         (WebCore::Extensions3DANGLE::getnUniformivEXT):
2024         (WebCore::Extensions3DANGLE::blitFramebuffer):
2025         (WebCore::Extensions3DANGLE::renderbufferStorageMultisample):
2026         (WebCore::Extensions3DANGLE::createVertexArrayOES):
2027         (WebCore::Extensions3DANGLE::deleteVertexArrayOES):
2028         (WebCore::Extensions3DANGLE::isVertexArrayOES):
2029         (WebCore::Extensions3DANGLE::bindVertexArrayOES):
2030         (WebCore::Extensions3DANGLE::insertEventMarkerEXT):
2031         (WebCore::Extensions3DANGLE::pushGroupMarkerEXT):
2032         (WebCore::Extensions3DANGLE::popGroupMarkerEXT):
2033         (WebCore::Extensions3DANGLE::supportsExtension):
2034         (WebCore::Extensions3DANGLE::drawBuffersEXT):
2035         (WebCore::Extensions3DANGLE::drawArraysInstanced):
2036         (WebCore::Extensions3DANGLE::drawElementsInstanced):
2037         (WebCore::Extensions3DANGLE::vertexAttribDivisor):
2038         (WebCore::Extensions3DANGLE::getExtensions):
2039         * platform/graphics/angle/Extensions3DANGLE.h: Added.
2040         * platform/graphics/angle/GraphicsContext3DANGLE.cpp: Copied from Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp.
2041         (WebCore::GraphicsContext3D::releaseShaderCompiler):
2042         (WebCore::wipeAlphaChannelFromPixels):
2043         (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary):
2044         (WebCore::GraphicsContext3D::validateAttributes):
2045         (WebCore::GraphicsContext3D::reshapeFBOs):
2046         (WebCore::GraphicsContext3D::attachDepthAndStencilBufferIfNeeded):
2047         (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
2048         (WebCore::GraphicsContext3D::renderbufferStorage):
2049         (WebCore::GraphicsContext3D::getIntegerv):
2050         (WebCore::GraphicsContext3D::getShaderPrecisionFormat):
2051         (WebCore::GraphicsContext3D::texImage2D):
2052         (WebCore::GraphicsContext3D::depthRange):
2053         (WebCore::GraphicsContext3D::clearDepth):
2054         (WebCore::GraphicsContext3D::getExtensions):
2055         (WebCore::GraphicsContext3D::readPixels):
2056         (WebCore::setCurrentNameHashMapForShader):
2057         (WebCore::nameHashForShader):
2058         (WebCore::GraphicsContext3D::validateDepthStencil):
2059         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
2060         (WebCore::GraphicsContext3D::paintCompositedResultsToCanvas):
2061         (WebCore::GraphicsContext3D::paintRenderingResultsToImageData):
2062         (WebCore::GraphicsContext3D::prepareTexture):
2063         (WebCore::GraphicsContext3D::readRenderingResults):
2064         (WebCore::GraphicsContext3D::reshape):
2065         (WebCore::GraphicsContext3D::checkVaryingsPacking const):
2066         (WebCore::GraphicsContext3D::precisionsMatch const):
2067         (WebCore::GraphicsContext3D::getInternalFramebufferSize const):
2068         (WebCore::GraphicsContext3D::activeTexture):
2069         (WebCore::GraphicsContext3D::attachShader):
2070         (WebCore::GraphicsContext3D::bindAttribLocation):
2071         (WebCore::GraphicsContext3D::bindBuffer):
2072         (WebCore::GraphicsContext3D::bindFramebuffer):
2073         (WebCore::GraphicsContext3D::bindRenderbuffer):
2074         (WebCore::GraphicsContext3D::bindTexture):
2075         (WebCore::GraphicsContext3D::blendColor):
2076         (WebCore::GraphicsContext3D::blendEquation):
2077         (WebCore::GraphicsContext3D::blendEquationSeparate):
2078         (WebCore::GraphicsContext3D::blendFunc):
2079         (WebCore::GraphicsContext3D::blendFuncSeparate):
2080         (WebCore::GraphicsContext3D::bufferData):
2081         (WebCore::GraphicsContext3D::bufferSubData):
2082         (WebCore::GraphicsContext3D::mapBufferRange):
2083         (WebCore::GraphicsContext3D::unmapBuffer):
2084         (WebCore::GraphicsContext3D::copyBufferSubData):
2085         (WebCore::GraphicsContext3D::getInternalformativ):
2086         (WebCore::GraphicsContext3D::renderbufferStorageMultisample):
2087         (WebCore::GraphicsContext3D::texStorage2D):
2088         (WebCore::GraphicsContext3D::texStorage3D):
2089         (WebCore::GraphicsContext3D::getActiveUniforms):
2090         (WebCore::GraphicsContext3D::checkFramebufferStatus):
2091         (WebCore::GraphicsContext3D::clearColor):
2092         (WebCore::GraphicsContext3D::clear):
2093         (WebCore::GraphicsContext3D::clearStencil):
2094         (WebCore::GraphicsContext3D::colorMask):
2095         (WebCore::GraphicsContext3D::compileShader):
2096         (WebCore::GraphicsContext3D::compileShaderDirect):
2097         (WebCore::GraphicsContext3D::copyTexImage2D):
2098         (WebCore::GraphicsContext3D::copyTexSubImage2D):
2099         (WebCore::GraphicsContext3D::cullFace):
2100         (WebCore::GraphicsContext3D::depthFunc):
2101         (WebCore::GraphicsContext3D::depthMask):
2102         (WebCore::GraphicsContext3D::detachShader):
2103         (WebCore::GraphicsContext3D::disable):
2104         (WebCore::GraphicsContext3D::disableVertexAttribArray):
2105         (WebCore::GraphicsContext3D::drawArrays):
2106         (WebCore::GraphicsContext3D::drawElements):
2107         (WebCore::GraphicsContext3D::enable):
2108         (WebCore::GraphicsContext3D::enableVertexAttribArray):
2109         (WebCore::GraphicsContext3D::finish):
2110         (WebCore::GraphicsContext3D::flush):
2111         (WebCore::GraphicsContext3D::framebufferRenderbuffer):
2112         (WebCore::GraphicsContext3D::framebufferTexture2D):
2113         (WebCore::GraphicsContext3D::frontFace):
2114         (WebCore::GraphicsContext3D::generateMipmap):
2115         (WebCore::GraphicsContext3D::getActiveAttribImpl):
2116         (WebCore::GraphicsContext3D::getActiveAttrib):
2117         (WebCore::GraphicsContext3D::getActiveUniformImpl):
2118         (WebCore::GraphicsContext3D::getActiveUniform):
2119         (WebCore::GraphicsContext3D::getAttachedShaders):
2120         (WebCore::generateHashedName):
2121         (WebCore::GraphicsContext3D::mappedSymbolInShaderSourceMap):
2122         (WebCore::GraphicsContext3D::mappedSymbolName):
2123         (WebCore::GraphicsContext3D::originalSymbolInShaderSourceMap):
2124         (WebCore::GraphicsContext3D::originalSymbolName):
2125         (WebCore::GraphicsContext3D::getAttribLocation):
2126         (WebCore::GraphicsContext3D::getAttribLocationDirect):
2127         (WebCore::GraphicsContext3D::getContextAttributes):
2128         (WebCore::GraphicsContext3D::moveErrorsToSyntheticErrorList):
2129         (WebCore::GraphicsContext3D::getError):
2130         (WebCore::GraphicsContext3D::getString):
2131         (WebCore::GraphicsContext3D::hint):
2132         (WebCore::GraphicsContext3D::isBuffer):
2133         (WebCore::GraphicsContext3D::isEnabled):
2134         (WebCore::GraphicsContext3D::isFramebuffer):
2135         (WebCore::GraphicsContext3D::isProgram):
2136         (WebCore::GraphicsContext3D::isRenderbuffer):
2137         (WebCore::GraphicsContext3D::isShader):
2138         (WebCore::GraphicsContext3D::isTexture):
2139         (WebCore::GraphicsContext3D::lineWidth):
2140         (WebCore::GraphicsContext3D::linkProgram):
2141         (WebCore::GraphicsContext3D::pixelStorei):
2142         (WebCore::GraphicsContext3D::polygonOffset):
2143         (WebCore::GraphicsContext3D::sampleCoverage):
2144         (WebCore::GraphicsContext3D::scissor):
2145         (WebCore::GraphicsContext3D::shaderSource):
2146         (WebCore::GraphicsContext3D::stencilFunc):
2147         (WebCore::GraphicsContext3D::stencilFuncSeparate):
2148         (WebCore::GraphicsContext3D::stencilMask):
2149         (WebCore::GraphicsContext3D::stencilMaskSeparate):
2150         (WebCore::GraphicsContext3D::stencilOp):
2151         (WebCore::GraphicsContext3D::stencilOpSeparate):
2152         (WebCore::GraphicsContext3D::texParameterf):
2153         (WebCore::GraphicsContext3D::texParameteri):
2154         (WebCore::GraphicsContext3D::uniform1f):
2155         (WebCore::GraphicsContext3D::uniform1fv):
2156         (WebCore::GraphicsContext3D::uniform2f):
2157         (WebCore::GraphicsContext3D::uniform2fv):
2158         (WebCore::GraphicsContext3D::uniform3f):
2159         (WebCore::GraphicsContext3D::uniform3fv):
2160         (WebCore::GraphicsContext3D::uniform4f):
2161         (WebCore::GraphicsContext3D::uniform4fv):
2162         (WebCore::GraphicsContext3D::uniform1i):
2163         (WebCore::GraphicsContext3D::uniform1iv):
2164         (WebCore::GraphicsContext3D::uniform2i):
2165         (WebCore::GraphicsContext3D::uniform2iv):
2166         (WebCore::GraphicsContext3D::uniform3i):
2167         (WebCore::GraphicsContext3D::uniform3iv):
2168         (WebCore::GraphicsContext3D::uniform4i):
2169         (WebCore::GraphicsContext3D::uniform4iv):
2170         (WebCore::GraphicsContext3D::uniformMatrix2fv):
2171         (WebCore::GraphicsContext3D::uniformMatrix3fv):
2172         (WebCore::GraphicsContext3D::uniformMatrix4fv):
2173         (WebCore::GraphicsContext3D::useProgram):
2174         (WebCore::GraphicsContext3D::validateProgram):
2175         (WebCore::GraphicsContext3D::vertexAttrib1f):
2176         (WebCore::GraphicsContext3D::vertexAttrib1fv):
2177         (WebCore::GraphicsContext3D::vertexAttrib2f):
2178         (WebCore::GraphicsContext3D::vertexAttrib2fv):
2179         (WebCore::GraphicsContext3D::vertexAttrib3f):
2180         (WebCore::GraphicsContext3D::vertexAttrib3fv):
2181         (WebCore::GraphicsContext3D::vertexAttrib4f):
2182         (WebCore::GraphicsContext3D::vertexAttrib4fv):
2183         (WebCore::GraphicsContext3D::vertexAttribPointer):
2184         (WebCore::GraphicsContext3D::viewport):
2185         (WebCore::GraphicsContext3D::createVertexArray):
2186         (WebCore::GraphicsContext3D::deleteVertexArray):
2187         (WebCore::GraphicsContext3D::isVertexArray):
2188         (WebCore::GraphicsContext3D::bindVertexArray):
2189         (WebCore::GraphicsContext3D::getBooleanv):
2190         (WebCore::GraphicsContext3D::getBufferParameteriv):
2191         (WebCore::GraphicsContext3D::getFloatv):
2192         (WebCore::GraphicsContext3D::getInteger64v):
2193         (WebCore::GraphicsContext3D::getFramebufferAttachmentParameteriv):
2194         (WebCore::GraphicsContext3D::getProgramiv):
2195         (WebCore::GraphicsContext3D::getNonBuiltInActiveSymbolCount):
2196         (WebCore::GraphicsContext3D::getUnmangledInfoLog):
2197         (WebCore::GraphicsContext3D::getProgramInfoLog):
2198         (WebCore::GraphicsContext3D::getRenderbufferParameteriv):
2199         (WebCore::GraphicsContext3D::getShaderiv):
2200         (WebCore::GraphicsContext3D::getShaderInfoLog):
2201         (WebCore::GraphicsContext3D::getShaderSource):
2202         (WebCore::GraphicsContext3D::getTexParameterfv):
2203         (WebCore::GraphicsContext3D::getTexParameteriv):
2204         (WebCore::GraphicsContext3D::getUniformfv):
2205         (WebCore::GraphicsContext3D::getUniformiv):
2206         (WebCore::GraphicsContext3D::getUniformLocation):
2207         (WebCore::GraphicsContext3D::getVertexAttribfv):
2208         (WebCore::GraphicsContext3D::getVertexAttribiv):
2209         (WebCore::GraphicsContext3D::getVertexAttribOffset):
2210         (WebCore::GraphicsContext3D::texSubImage2D):
2211         (WebCore::GraphicsContext3D::compressedTexImage2D):
2212         (WebCore::GraphicsContext3D::compressedTexSubImage2D):
2213         (WebCore::GraphicsContext3D::createBuffer):
2214         (WebCore::GraphicsContext3D::createFramebuffer):
2215         (WebCore::GraphicsContext3D::createProgram):
2216         (WebCore::GraphicsContext3D::createRenderbuffer):
2217         (WebCore::GraphicsContext3D::createShader):
2218         (WebCore::GraphicsContext3D::createTexture):
2219         (WebCore::GraphicsContext3D::deleteBuffer):
2220         (WebCore::GraphicsContext3D::deleteFramebuffer):
2221         (WebCore::GraphicsContext3D::deleteProgram):
2222         (WebCore::GraphicsContext3D::deleteRenderbuffer):
2223         (WebCore::GraphicsContext3D::deleteShader):
2224         (WebCore::GraphicsContext3D::deleteTexture):
2225         (WebCore::GraphicsContext3D::synthesizeGLError):
2226         (WebCore::GraphicsContext3D::markContextChanged):
2227         (WebCore::GraphicsContext3D::markLayerComposited):
2228         (WebCore::GraphicsContext3D::layerComposited const):
2229         (WebCore::GraphicsContext3D::forceContextLost):
2230         (WebCore::GraphicsContext3D::recycleContext):
2231         (WebCore::GraphicsContext3D::dispatchContextChangedNotification):
2232         (WebCore::GraphicsContext3D::texImage2DDirect):
2233         (WebCore::GraphicsContext3D::drawArraysInstanced):
2234         (WebCore::GraphicsContext3D::drawElementsInstanced):
2235         (WebCore::GraphicsContext3D::vertexAttribDivisor):
2236         * platform/graphics/angle/TemporaryANGLESetting.cpp: Added.
2237         (WebCore::TemporaryANGLESetting::TemporaryANGLESetting):
2238         (WebCore::TemporaryANGLESetting::~TemporaryANGLESetting):
2239         * platform/graphics/angle/TemporaryANGLESetting.h: Added.
2240         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2241         (WebCore::GraphicsContext3D::GraphicsContext3D):
2242         (WebCore::GraphicsContext3D::~GraphicsContext3D):
2243         (WebCore::GraphicsContext3D::makeContextCurrent):
2244         (WebCore::GraphicsContext3D::checkGPUStatus):
2245         (WebCore::GraphicsContext3D::screenDidChange):
2246         * platform/graphics/cocoa/WebGLLayer.h:
2247         * platform/graphics/cocoa/WebGLLayer.mm:
2248         (-[WebGLLayer display]):
2249         * platform/graphics/cv/TextureCacheCV.mm:
2250         (WebCore::TextureCacheCV::create):
2251         (WebCore::TextureCacheCV::textureFromImage):
2252         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2253         (WebCore::enumToStringMap):
2254         (WebCore::VideoTextureCopierCV::initializeContextObjects):
2255         (WebCore::VideoTextureCopierCV::initializeUVContextObjects):
2256         (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
2257         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
2258         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
2259         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
2260         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
2261         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2262         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
2263
2264 2019-06-17  Ludovico de Nittis  <ludovico.denittis@collabora.com>
2265
2266         [GTK] Stop accessing GdkEvent fields when possible
2267         https://bugs.webkit.org/show_bug.cgi?id=198829
2268
2269         Reviewed by Michael Catanzaro.
2270
2271         Direct access to GdkEvent structs is no longer possible in GTK 4.
2272
2273         No behaviour changes.
2274
2275         * platform/gtk/PlatformKeyboardEventGtk.cpp:
2276         (WebCore::eventTypeForGdkKeyEvent):
2277         (WebCore::modifiersForGdkKeyEvent):
2278         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2279         * platform/gtk/PlatformMouseEventGtk.cpp:
2280         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
2281         * platform/gtk/PlatformWheelEventGtk.cpp:
2282         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
2283
2284 2019-06-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2285
2286         Unreviewed, rolling out r246467.
2287
2288         It broke scrolling with mouse wheel
2289
2290         Reverted changeset:
2291
2292         "[GTK] Stop accessing GdkEvent fields when possible"
2293         https://bugs.webkit.org/show_bug.cgi?id=198829
2294         https://trac.webkit.org/changeset/246467
2295
2296 2019-06-16  Darin Adler  <darin@apple.com>
2297
2298         Convert some uses of fixed width and fixed precision floating point formatting to use shortest instead
2299         https://bugs.webkit.org/show_bug.cgi?id=198896
2300
2301         Reviewed by Sam Weinig.
2302
2303         * Modules/indexeddb/IDBKeyData.cpp:
2304         (WebCore::IDBKeyData::loggingString const): Removed unneeded use of
2305         FormattedNumber::fixedWidth to override the default shortest-form formatting.
2306         * page/History.cpp:
2307         (WebCore::History::stateObjectAdded): Ditto.
2308
2309         * page/PrintContext.cpp:
2310         (WebCore::PrintContext::pageProperty): Use String::number instead of
2311         String::numberToStringFixedPrecision. Also removed some uses of
2312         FormattedNumber::fixedPrecision.
2313         * platform/graphics/FloatPolygon.cpp:
2314         (WebCore::FloatPolygonEdge::debugString const): Ditto.
2315
2316 2019-06-16  Darin Adler  <darin@apple.com>
2317
2318         Rename AtomicString to AtomString
2319         https://bugs.webkit.org/show_bug.cgi?id=195276
2320
2321         Reviewed by Michael Catanzaro.
2322
2323         * many files: Let do-webcore-rename do the renaming.
2324
2325 2019-06-16  Eric Carlson  <eric.carlson@apple.com>
2326
2327         [MediaStream] Avoid roundoff error when setting AVCapture min/max frame rate
2328         https://bugs.webkit.org/show_bug.cgi?id=198875
2329         <rdar://problem/51768374>
2330
2331         Reviewed by Youenn Fablet.
2332
2333         * platform/graphics/MediaPlayer.h:
2334         (WTF::LogArgument<MediaTime>::toString): Deleted, moved to MediaTime.h.
2335         (WTF::LogArgument<MediaTimeRange>::toString): Deleted, moved to MediaTime.h.
2336
2337         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2338         (WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate): Avoid roundoff error.
2339
2340 2019-06-16  Simon Fraser  <simon.fraser@apple.com>
2341
2342         Implement ScrollableArea::scrollOffset()
2343         https://bugs.webkit.org/show_bug.cgi?id=198895
2344
2345         Reviewed by Antti Koivisto.
2346
2347         Remove from ScrollableArea the following:
2348             virtual int scrollSize(ScrollbarOrientation) const = 0;
2349             virtual int scrollOffset(ScrollbarOrientation) const = 0;
2350         and instead implement ScrollOffset scrollOffset() const.
2351
2352         Also make scrollPosition() pure virtual, avoiding the reverse dependency where
2353         this base class implementation got values from scrollbars.
2354         
2355         scrollSize(ScrollbarOrientation) was only used by ScrollAnimatorIOS and we can
2356         do the same computation via min/max scroll positions.
2357         
2358         RenderListBox and PopupMenuWin need implementations of scrollPosition().
2359         
2360         Remove some PLATFORM(IOS_FAMILY) #ifdefs from ScrollableArea for code that compiles
2361         on all platforms.
2362
2363         * page/FrameView.h:
2364         * platform/ScrollView.cpp:
2365         (WebCore::ScrollView::overhangAmount const):
2366         (WebCore::ScrollView::scrollSize const): Deleted.
2367         (WebCore::ScrollView::scrollOffset const): Deleted.
2368         * platform/ScrollView.h:
2369         * platform/ScrollableArea.cpp:
2370         (WebCore::ScrollableArea::isPinnedVerticallyInDirection const):
2371         (WebCore::ScrollableArea::scrollOffset const):
2372         (WebCore::ScrollableArea::scrollPosition const): Deleted.
2373         * platform/ScrollableArea.h:
2374         (WebCore::offsetForOrientation):
2375         (WebCore::ScrollableArea::isHorizontalScrollerPinnedToMinimumPosition const):
2376         (WebCore::ScrollableArea::isHorizontalScrollerPinnedToMaximumPosition const):
2377         (WebCore::ScrollableArea::isVerticalScrollerPinnedToMinimumPosition const):
2378         (WebCore::ScrollableArea::isVerticalScrollerPinnedToMaximumPosition const):
2379         (WebCore::ScrollableArea::tiledBacking const): Deleted.
2380         * platform/Scrollbar.cpp:
2381         (WebCore::Scrollbar::Scrollbar):
2382         (WebCore::Scrollbar::offsetDidChange):
2383         * platform/ios/ScrollAnimatorIOS.mm:
2384         (WebCore::ScrollAnimatorIOS::handleTouchEvent):
2385         * platform/win/PopupMenuWin.cpp:
2386         (WebCore::PopupMenuWin::scrollPosition const):
2387         (WebCore::PopupMenuWin::wndProc):
2388         (WebCore::PopupMenuWin::scrollSize const): Deleted.
2389         (WebCore::PopupMenuWin::scrollOffset const): Deleted.
2390         * platform/win/PopupMenuWin.h:
2391         (WebCore::PopupMenuWin::scrollOffset const): Deleted.
2392         * rendering/RenderLayer.cpp:
2393         (WebCore::RenderLayer::scrollSize const): Deleted.
2394         (WebCore::RenderLayer::scrollOffset const): Deleted.
2395         * rendering/RenderLayer.h:
2396         * rendering/RenderListBox.cpp:
2397         (WebCore::RenderListBox::scrollPosition const):
2398         (WebCore::RenderListBox::scrollSize const): Deleted.
2399         (WebCore::RenderListBox::scrollOffset const): Deleted.
2400         * rendering/RenderListBox.h:
2401
2402 2019-06-16  Zalan Bujtas  <zalan@apple.com>
2403
2404         Address Sam's post-landing review of r246234.
2405
2406         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2407         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
2408
2409 2019-06-16  Zalan Bujtas  <zalan@apple.com>
2410
2411         [LFC][IFC] Decouple baseline ascent/descent and baseline offset.
2412         https://bugs.webkit.org/show_bug.cgi?id=198901
2413         <rdar://problem/51782393>
2414
2415         Reviewed by Antti Koivisto.
2416
2417         Baseline offset is the baseline's distance from the line's logical top -and it is not necessarily the same as the baseline's ascent.
2418         It's easier to track the baseline and its top separately since certain properties only change one or the other.
2419
2420         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2421         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
2422         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
2423         * layout/inlineformatting/InlineLine.cpp:
2424         (WebCore::Layout::Line::Line):
2425         (WebCore::Layout::Line::close):
2426         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
2427         (WebCore::Layout::Line::halfLeadingMetrics):
2428         * layout/inlineformatting/InlineLine.h:
2429         (WebCore::Layout::Line::Content::baselineOffset const):
2430         (WebCore::Layout::Line::Content::setBaselineOffset):
2431         (WebCore::Layout::Line::baselineOffset const):
2432         * layout/inlineformatting/InlineLineBox.h:
2433         (WebCore::Layout::LineBox::baselineOffset const):
2434         (WebCore::Layout::LineBox::LineBox):
2435
2436 2019-06-16  Zalan Bujtas  <zalan@apple.com>
2437
2438         [LFC][IFC] Intruding float may prevent adding any inline box
2439         https://bugs.webkit.org/show_bug.cgi?id=198891
2440         <rdar://problem/51779956>
2441
2442         Reviewed by Antti Koivisto.
2443
2444         Take the intruding left/right float pair and find the vertical position where the next line might go
2445         if these floats prevent us from adding even one inline box to the current line.
2446
2447         * layout/FormattingContext.cpp:
2448         (WebCore::Layout::FormattingContext::mapPointToAncestor):
2449         (WebCore::Layout::FormattingContext::mapPointToDescendent):
2450         * layout/FormattingContext.h:
2451         * layout/LayoutUnits.h:
2452         (WebCore::Layout::Point::max):
2453         * layout/inlineformatting/InlineFormattingContext.h:
2454         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2455         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const):
2456         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const):
2457
2458 2019-06-16  Zalan Bujtas  <zalan@apple.com>
2459
2460         [LFC][Floats] Add bottom value to FloatingState::Constraints
2461         https://bugs.webkit.org/show_bug.cgi?id=198889
2462         <rdar://problem/51776730>
2463
2464         Reviewed by Antti Koivisto.
2465
2466         Constraints::left/right->y indicates where this particular constrain ends. This is going to be used by inline layout to figure where
2467         the next line should go (vertical position).
2468
2469         * layout/floats/FloatingState.cpp:
2470         (WebCore::Layout::FloatingState::constraints const):
2471         * layout/floats/FloatingState.h:
2472
2473 2019-06-16  Zalan Bujtas  <zalan@apple.com>
2474
2475         [LFC][IFC] Ignore descent when in limited/full quirks mode
2476         https://bugs.webkit.org/show_bug.cgi?id=198893
2477         <rdar://problem/51780634>
2478
2479         Reviewed by Antti Koivisto.
2480
2481         In limited/full quirks mode, line's descent should be ignored when computing the final line height when
2482         1. the line has baseline aligned content only and
2483         2. these baseline aligned boxes don't have descent.
2484
2485         * layout/inlineformatting/InlineLine.cpp:
2486         (WebCore::Layout::Line::isVisuallyEmpty const):
2487         (WebCore::Layout::Line::close):
2488
2489 2019-06-16  Zalan Bujtas  <zalan@apple.com>
2490
2491         [LFC][IFC] Line::isVisuallyEmpty should check inline-block boxes.
2492         https://bugs.webkit.org/show_bug.cgi?id=198894
2493         <rdar://problem/51780886>
2494
2495         Reviewed by Antti Koivisto.
2496
2497         Non-zero width/height inline-block boxes make the line visually non-empty.
2498
2499         * layout/inlineformatting/InlineLine.cpp:
2500         (WebCore::Layout::Line::isVisuallyEmpty const):
2501
2502 2019-06-16  Zalan Bujtas  <zalan@apple.com>
2503
2504         [LFC] Add Layout::Box::isContainingBlockDescendantOf
2505         https://bugs.webkit.org/show_bug.cgi?id=198888
2506         <rdar://problem/51776466>
2507
2508         Reviewed by Antti Koivisto.
2509
2510         Box::isDescendantOf indicates simple ancestor - descendant relationship, while
2511         isContainingBlockDescendantOf checks the containing block chain.
2512
2513         * layout/FormattingContext.cpp:
2514         (WebCore::Layout::mapHorizontalPositionToAncestor):
2515         (WebCore::Layout::FormattingContext::mapBoxToAncestor):
2516         (WebCore::Layout::FormattingContext::mapTopToAncestor):
2517         (WebCore::Layout::FormattingContext::mapPointToAncestor):
2518         * layout/floats/FloatingState.h:
2519         (WebCore::Layout::FloatingState::FloatItem::isDescendantOfFormattingRoot const):
2520         * layout/layouttree/LayoutBox.cpp:
2521         (WebCore::Layout::Box::isDescendantOf const):
2522         (WebCore::Layout::Box::isContainingBlockDescendantOf const):
2523         * layout/layouttree/LayoutBox.h:
2524
2525 2019-06-16  Zalan Bujtas  <zalan@apple.com>
2526
2527         [LFC][IFC] Remove Line::Content::isVisuallyEmpty
2528         https://bugs.webkit.org/show_bug.cgi?id=198892
2529         <rdar://problem/51780345>
2530
2531         Reviewed by Antti Koivisto.
2532
2533         Instead of setting the isVisuallyEmpty flag, reset the line height to 0. 
2534
2535         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2536         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
2537         * layout/inlineformatting/InlineLine.cpp:
2538         (WebCore::Layout::Line::close):
2539         * layout/inlineformatting/InlineLine.h:
2540         (WebCore::Layout::Line::Content::isEmpty const):
2541         (WebCore::Layout::Line::Content::setBaseline):
2542         (WebCore::Layout::Line::Content::isVisuallyEmpty const): Deleted.
2543         (WebCore::Layout::Line::Content::setIsVisuallyEmpty): Deleted.
2544
2545 2019-06-16  Zalan Bujtas  <zalan@apple.com>
2546
2547         [LFC] Add limited quirks mode to LayoutState.
2548         https://bugs.webkit.org/show_bug.cgi?id=198881
2549         <rdar://problem/51773229>
2550
2551         Reviewed by Antti Koivisto.
2552
2553         This is in preparation for introducing limited quirks mode to inline layout.
2554
2555         * layout/LayoutState.h:
2556         (WebCore::Layout::LayoutState::setQuirksMode):
2557         (WebCore::Layout::LayoutState::inQuirksMode const):
2558         (WebCore::Layout::LayoutState::inLimitedQuirksMode const):
2559         (WebCore::Layout::LayoutState::inNoQuirksMode const):
2560         (WebCore::Layout::LayoutState::setInQuirksMode): Deleted.
2561         * page/FrameViewLayoutContext.cpp:
2562         (WebCore::layoutUsingFormattingContext):
2563
2564 2019-06-16  Zalan Bujtas  <zalan@apple.com>
2565
2566         [LFC][IFC] Completely collapsed runs should not go to the trimmable run list.
2567         https://bugs.webkit.org/show_bug.cgi?id=198900
2568         <rdar://problem/51782156>
2569
2570         Reviewed by Antti Koivisto.
2571
2572         * layout/inlineformatting/InlineLine.cpp:
2573         (WebCore::Layout::Line::trailingTrimmableWidth const):
2574         (WebCore::Layout::Line::appendTextContent):
2575
2576 2019-06-16  Zalan Bujtas  <zalan@apple.com>
2577
2578         [LFC][IFC] Use the borderBox rect consistently to size the inline box.
2579         https://bugs.webkit.org/show_bug.cgi?id=198899
2580
2581         Reviewed by Antti Koivisto.
2582         <rdar://problem/51781969>
2583
2584         Use the margin box height (when applicable) to adjust the line height and use the borderBox rect (or font size) height to size the inline box.
2585
2586         * layout/displaytree/DisplayBox.h:
2587         (WebCore::Display::Box::borderBoxHeight const):
2588         (WebCore::Display::Box::marginBoxHeight const):
2589         * layout/inlineformatting/InlineLine.cpp:
2590         (WebCore::Layout::Line::appendInlineContainerStart):
2591         (WebCore::Layout::Line::appendTextContent):
2592         (WebCore::Layout::Line::appendNonReplacedInlineBox):
2593         (WebCore::Layout::Line::inlineItemContentHeight const):
2594         (WebCore::Layout::Line::inlineItemHeight const): Deleted.
2595         * layout/inlineformatting/InlineLine.h:
2596
2597 2019-06-15  Simon Fraser  <simon.fraser@apple.com>
2598
2599         Make layerTreeAsText() output a bit less verbose
2600         https://bugs.webkit.org/show_bug.cgi?id=198870
2601
2602         Reviewed by Tim Horton.
2603
2604         "accelerates drawing" was getting dumped twice for debug dumps.
2605         Only dump the non-default state for "uses display-list drawing".
2606         Use the new OptionSet<> dumping for GraphicsLayerPaintingPhases.
2607
2608         * platform/graphics/GraphicsLayer.cpp:
2609         (WebCore::GraphicsLayer::dumpProperties const):
2610         (WebCore::operator<<):
2611         * platform/graphics/GraphicsLayer.h:
2612         * platform/graphics/ca/GraphicsLayerCA.cpp:
2613         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2614
2615 2019-06-15  Youenn Fablet  <youenn@apple.com>
2616
2617         Make MediaStream constructor take a Document instead of a ScriptExecutionContext
2618         https://bugs.webkit.org/show_bug.cgi?id=198873
2619
2620         Reviewed by Darin Adler.
2621
2622         Update MediaStream constructors and call site to take a Document&.
2623         Make the same for creation of CanvasCaptureMediaStreamTrack.
2624         No observable change of behavior.
2625
2626         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
2627         (WebCore::CanvasCaptureMediaStreamTrack::create):
2628         (WebCore::CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack):
2629         (WebCore::loggerFromContext): Deleted.
2630         * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
2631         * Modules/mediastream/MediaStream.cpp:
2632         (WebCore::MediaStream::create):
2633         (WebCore::MediaStream::MediaStream):
2634         (WebCore::MediaStream::clone):
2635         (WebCore::loggerFromContext): Deleted.
2636         * Modules/mediastream/MediaStream.h:
2637         * Modules/mediastream/MediaStream.idl:
2638         * Modules/mediastream/UserMediaRequest.cpp:
2639         (WebCore::UserMediaRequest::allow):
2640         * html/HTMLCanvasElement.cpp:
2641         (WebCore::HTMLCanvasElement::captureStream):
2642         * html/HTMLCanvasElement.h:
2643         * html/HTMLCanvasElement.idl:
2644
2645 2019-06-15  Zalan Bujtas  <zalan@apple.com>
2646
2647         [LFC][BFC] Fix available width for non-floating positioned float avoiders.
2648         https://bugs.webkit.org/show_bug.cgi?id=198886
2649         <rdar://problem/51773643>
2650
2651         Reviewed by Antti Koivisto.
2652
2653         Normally the available width for an in-flow block level box is the width of the containing block's content box.
2654         However a non-floating positioned float avoider box might be constrained by existing floats.
2655         The idea here is that we pre-compute(estimate) the vertical position and check the current floating context for
2656         left and right floats. These floats contrain the available width and this computed value should be used instead of the containing block's
2657         content box's width whe calculating the used width for width: auto.
2658
2659         * layout/FormattingContext.cpp:
2660         (WebCore::Layout::mapHorizontalPositionToAncestor):
2661         (WebCore::Layout::FormattingContext::mapLeftToAncestor):
2662         (WebCore::Layout::FormattingContext::mapRightToAncestor):
2663         (WebCore::Layout::FormattingContext::mapPointToAncestor):
2664         (WebCore::Layout::FormattingContext::mapCoordinateToAncestor): Deleted.
2665         * layout/FormattingContext.h:
2666         * layout/blockformatting/BlockFormattingContext.cpp:
2667         (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
2668         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2669         (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition const):
2670         (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition const):
2671         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
2672         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot const):
2673         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
2674         * layout/blockformatting/BlockFormattingContext.h:
2675         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
2676         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2677         (WebCore::Layout::BlockFormattingContext::Geometry::staticVerticalPosition):
2678         (WebCore::Layout::BlockFormattingContext::Geometry::staticHorizontalPosition):
2679         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
2680         * layout/floats/FloatingState.cpp:
2681         (WebCore::Layout::FloatingState::constraints const):
2682         * layout/layouttree/LayoutBlockContainer.cpp:
2683         (WebCore::Layout::BlockContainer::establishesInlineFormattingContextOnly const):
2684         * layout/layouttree/LayoutBlockContainer.h:
2685         * layout/layouttree/LayoutBox.cpp:
2686         (WebCore::Layout::Box::isFloatAvoider const):
2687         * layout/layouttree/LayoutBox.h:
2688         (WebCore::Layout::Box::establishesInlineFormattingContextOnly const):
2689
2690 2019-06-15  Ludovico de Nittis  <ludovico.denittis@collabora.com>
2691
2692         [GTK] Stop accessing GdkEvent fields when possible
2693         https://bugs.webkit.org/show_bug.cgi?id=198829
2694
2695         Reviewed by Michael Catanzaro.
2696
2697         Direct access to GdkEvent structs is no longer possible in GTK 4.
2698
2699         No behaviour changes.
2700
2701         * platform/gtk/PlatformKeyboardEventGtk.cpp:
2702         (WebCore::eventTypeForGdkKeyEvent):
2703         (WebCore::modifiersForGdkKeyEvent):
2704         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2705         * platform/gtk/PlatformMouseEventGtk.cpp:
2706         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
2707         * platform/gtk/PlatformWheelEventGtk.cpp:
2708         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
2709
2710 2019-06-15  Rob Buis  <rbuis@igalia.com>
2711
2712         Add tests for prefetch redirects
2713         https://bugs.webkit.org/show_bug.cgi?id=197371
2714
2715         Reviewed by Youenn Fablet.
2716
2717         Test: http/wpt/prefetch/link-prefetch-main-resource-redirect.html
2718
2719         Allow clearing of the Purpose request header field.
2720
2721         * platform/network/ResourceRequestBase.cpp:
2722         (WebCore::ResourceRequestBase::clearPurpose):
2723         * platform/network/ResourceRequestBase.h:
2724
2725 2019-06-15  Zalan Bujtas  <zalan@apple.com>
2726
2727         [LFC][MarginCollapsing] Remove redundant checks in MarginCollapse::marginBefore/AfterCollapsesWith*
2728         https://bugs.webkit.org/show_bug.cgi?id=198882
2729         <rdar://problem/51773334>
2730
2731         Reviewed by Antti Koivisto.
2732
2733         In-flow child can neither be floating nor out-of-flow positioned.
2734
2735         * layout/blockformatting/BlockMarginCollapse.cpp:
2736         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
2737         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
2738
2739 2019-06-15  Zalan Bujtas  <zalan@apple.com>
2740
2741         [LFC][MarginCollapsing] Collapsed through margin values preserve quirk state.
2742         https://bugs.webkit.org/show_bug.cgi?id=198885
2743         <rdar://problem/51773568>
2744
2745         Reviewed by Antti Koivisto.
2746
2747         The collapsed through margin becomes a quirk margin if either of the vertical(before/after) margins have quirk value.
2748
2749         * layout/blockformatting/BlockMarginCollapse.cpp:
2750         (WebCore::Layout::computedPositiveAndNegativeMargin):
2751
2752 2019-06-15  Zalan Bujtas  <zalan@apple.com>
2753
2754         [LFC[MarginCollapsing] Anonymous boxes never collapse their margins with siblings.
2755         https://bugs.webkit.org/show_bug.cgi?id=198884
2756         <rdar://problem/51773509>
2757
2758         Reviewed by Antti Koivisto.
2759
2760         * layout/blockformatting/BlockMarginCollapse.cpp:
2761         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
2762
2763 2019-06-15  Zalan Bujtas  <zalan@apple.com>
2764
2765         [LFC][MarginCollapsing] Add check for computed height value in MarginCollapse::marginsCollapseThrough
2766         https://bugs.webkit.org/show_bug.cgi?id=198883
2767         <rdar://problem/51773395>
2768
2769         Reviewed by Antti Koivisto.
2770
2771         "A box's own margins collapse if... ...and it has a 'height' of either 0 or 'auto"
2772         https://www.w3.org/TR/CSS22/box.html#collapsing-margins
2773
2774         * layout/blockformatting/BlockMarginCollapse.cpp:
2775         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
2776
2777 2019-06-15  Zalan Bujtas  <zalan@apple.com>
2778
2779         [LFC] Fix available width for shrink-to-fit (for out-of-flow non-replaced box)
2780         https://bugs.webkit.org/show_bug.cgi?id=198880
2781         <rdar://problem/51773118>
2782
2783         Reviewed by Antti Koivisto.
2784
2785         This patch fixes the cases when the available width for the out-of-flow positioned box is not the same as the containing block's (padding)width.  
2786
2787         * layout/FormattingContextGeometry.cpp:
2788         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2789
2790 2019-06-15  Zalan Bujtas  <zalan@apple.com>
2791
2792         [LFC] Fix over-constrained logic for out-of-flow non-replaced horizontal geometry.
2793         https://bugs.webkit.org/show_bug.cgi?id=198879
2794         <rdar://problem/51772995>
2795
2796         Reviewed by Antti Koivisto.
2797
2798         The over-constrained logic applies to the case when all the horizontal properties are set.
2799
2800         * layout/FormattingContextGeometry.cpp:
2801         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2802
2803 2019-06-15  Zalan Bujtas  <zalan@apple.com>
2804
2805         [LFC] Convert both the absolutely and statically positioned out-of-flow block level boxes positions relative to the containing block's padding box
2806         https://bugs.webkit.org/show_bug.cgi?id=198878
2807         <rdar://problem/51772882>
2808
2809         Reviewed by Antti Koivisto.
2810
2811         This patch ensures that while we compute the vertical/horizontal geometry for an out-of-flow block level box,
2812         the static and the absolute positioned values are in the same coordinate system (relative to the containing block's padding box).
2813
2814         * layout/FormattingContextGeometry.cpp:
2815         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
2816         (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
2817         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2818         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2819         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2820         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2821
2822 2019-06-15  Zalan Bujtas  <zalan@apple.com>
2823
2824         [LFC][IFC] Add support for vertical-align: top and bottom
2825         https://bugs.webkit.org/show_bug.cgi?id=198697
2826         <rdar://problem/51556188>
2827
2828         Reviewed by Antti Koivisto.
2829
2830         Use the layout box's vertical alignment to adjust line baseline and height and set the run's logical top when the line is being closed.
2831
2832         * layout/inlineformatting/InlineLine.cpp:
2833         (WebCore::Layout::Line::isVisuallyEmpty const):
2834         (WebCore::Layout::Line::close):
2835         (WebCore::Layout::Line::appendInlineContainerStart):
2836         (WebCore::Layout::Line::appendTextContent):
2837         (WebCore::Layout::Line::appendNonReplacedInlineBox):
2838         (WebCore::Layout::Line::appendHardLineBreak):
2839         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
2840         (WebCore::Layout::Line::inlineItemHeight const):
2841         (WebCore::Layout::Line::Content::isVisuallyEmpty const): Deleted.
2842         * layout/inlineformatting/InlineLine.h:
2843         (WebCore::Layout::Line::Content::isVisuallyEmpty const):
2844         (WebCore::Layout::Line::Content::setIsVisuallyEmpty):
2845         (WebCore::Layout::Line::hasContent const):
2846
2847 2019-06-14  Antoine Quint  <graouts@apple.com>
2848
2849         [Pointer Events] button property is -1 for pointerdown and pointerup
2850         https://bugs.webkit.org/show_bug.cgi?id=198868
2851         <rdar://problem/51758109>
2852
2853         Reviewed by Dean Jackson.
2854
2855         A value of -1 for "button", which means there was no change of pressed button since the last event, should only ever be used for "pointermove" events.
2856
2857         Test: pointerevents/mouse/pointer-button-and-buttons.html
2858
2859         * page/PointerCaptureController.cpp:
2860         (WebCore::PointerCaptureController::pointerEventForMouseEvent):
2861
2862 2019-06-14  Megan Gardner  <megan_gardner@apple.com>
2863
2864         Move Synthetic Editing Commands to behind an experimental feature flag
2865         https://bugs.webkit.org/show_bug.cgi?id=198842
2866         <rdar://problem/50594700>
2867
2868         Reviewed by Simon Fraser.
2869
2870         Moving from a quirk to a feature flag.
2871
2872         * page/Quirks.cpp:
2873         (WebCore::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreasForHost): Deleted.
2874         (WebCore::Quirks::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreas const): Deleted.
2875         * page/Quirks.h:
2876         * page/RuntimeEnabledFeatures.h:
2877         (WebCore::RuntimeEnabledFeatures::setSyntheticEditingCommandsEnabled):
2878         (WebCore::RuntimeEnabledFeatures::syntheticEditingCommandsEnabled const):
2879
2880 2019-06-14  Jer Noble  <jer.noble@apple.com>
2881
2882         REGRESSION(244439): platform/mac/media/encrypted-media/fps-* tests are crashing
2883         https://bugs.webkit.org/show_bug.cgi?id=198612
2884         <rdar://problem/51078978>
2885
2886         Reviewed by Eric Carlson.
2887
2888         There are two implementations of a 'cenc' initialiation data factory; an ASSERT fires when
2889         the second one is added to the registry. Unify them.
2890
2891         * Modules/encryptedmedia/InitDataRegistry.cpp:
2892         (WebCore::extractKeyIDsCenc):
2893         * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
2894         (WebCore::CDMPrivateFairPlayStreaming::validFairPlayStreamingSchemes):
2895         (WebCore::CDMPrivateFairPlayStreaming::fairPlaySystemID):
2896         (WebCore::validInitDataTypes):
2897         (WebCore::CDMFactory::platformRegisterFactories):
2898         (WebCore::validFairPlayStreamingSchemes): Deleted.
2899         (WebCore::CDMPrivateFairPlayStreaming::cencName): Deleted.
2900         (WebCore::fairPlaySystemID): Deleted.
2901         (WebCore::extractSchemeAndKeyIdFromCenc): Deleted.
2902         (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsCenc): Deleted.
2903         (WebCore::CDMPrivateFairPlayStreaming::sanitizeCenc): Deleted.
2904         * platform/graphics/avfoundation/CDMFairPlayStreaming.h:
2905
2906 2019-06-14  Saam Barati  <sbarati@apple.com>
2907
2908         Unreviewed. Follow up to r246438. This removes a debug assert until
2909         we do further compiler work in: https://bugs.webkit.org/show_bug.cgi?id=198861
2910
2911         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
2912         (WebCore::WHLSL::checkDuplicateFunctions):
2913         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
2914
2915 2019-06-14  Saam Barati  <sbarati@apple.com>
2916
2917         [WHLSL] Implement out-of-bounds and nullptr behavior
2918         https://bugs.webkit.org/show_bug.cgi?id=198600
2919         <rdar://problem/51668853>
2920
2921         Reviewed by Robin Morisset.
2922
2923         The behavior we're implementing is:
2924         - OOB writes are ignored.
2925         - OOB reads return zero.
2926         - Writes to null are ignored.
2927         - Reads from null return zero.
2928         - &*x == x, including &*null == null.
2929         
2930         We implement this like so:
2931         - The value stack in FunctionWriter turns into a stack of pairs: rvalues and lvalues.
2932           rvalues are represented the same as before. Lvalues are always pointers.
2933         - Anything that produces an lvalue must push a pointer to the stack. Not
2934           all things produce lvalues, so that entry in the stack may be empty.
2935           However, all things that produce lvalues also produce rvalues. So, "*x = 42" works,
2936           and so does "foo(*x)". Nodes that produce lvalues are responsible for also producing
2937           an rvalue, which should be the value as if the lvalue was dereferenced at that point
2938           in program execution. So the "*x" in "thread int* x = null; *x" produces the int zero
2939           for its rvalue, and null for its lvalue.
2940         - Dereference just works, as dereference produces both an lvalue and rvalue. Dereference
2941           node's child must also be an lvalue. So we just forward that value along on
2942           the stack. For the rvalue, if we try to dereference nullptr, we just fill in
2943           zero bytes instead. Otherwise, the rvalue is the result of dereferencing the
2944           non-null pointer.
2945         - Assignment expressions check if the incoming lvalue is null. If it is, it
2946           skips the assignment.
2947         - operator&[] returns nullptr on an OOB access. Then, based on the above
2948           behavior, we get the desired OOB reads return zero, and OOB writes are
2949           ignored.
2950         - MakePointerExpression just takes the last lvalue off the stack (which must
2951           be a pointer) and returns it as an rvalue.
2952         - VariableReference will push both the variable value and a pointer to the variable
2953           onto the stack.
2954
2955         This patch also fixes a few bugs where we weren't giving certain AST nodes the
2956         proper address space values.
2957
2958         This patch also removes code to generate native functions for operators
2959         "operator[]" and "operator[]=" as we should never be generating these
2960         ourselves. We should only be generating the "operator&[]" ander.
2961
2962         Tests: webgpu/whlsl-null-dereference.html
2963                webgpu/whlsl-oob-access.html
2964
2965         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
2966         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
2967         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendRightValue):
2968         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendLeftValue):
2969         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastValue):
2970         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastLeftValue):
2971         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
2972         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::emitLoop):
2973         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
2974         (WebCore::WHLSL::Metal::writeNativeFunction):
2975         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
2976         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
2977         (WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
2978         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
2979         (WebCore::WHLSL::PreserveLifetimes::assignVariableIntoStruct):
2980         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
2981         (WebCore::WHLSL::PropertyResolver::visit):
2982         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
2983         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
2984         (WebCore::trySetFunctions):
2985         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2986         (WebCore::trySetFunctions):
2987
2988 2019-06-14  Jer Noble  <jer.noble@apple.com>
2989
2990         CRASH(nullptr) in WebCore::jsAudioContextCurrentTime()
2991         https://bugs.webkit.org/show_bug.cgi?id=198859
2992         <rdar://problem/27986991>
2993
2994         Reviewed by Eric Carlson.
2995
2996         AudioContext's m_destinationNode can become null during iframe teardown,
2997         but can AudioContext methods can still be called by JavaScript. Add null-checks
2998         to all (remaing) unprotected dereferences of m_destinationNode.
2999
3000         * Modules/webaudio/AudioContext.cpp:
3001         (WebCore::AudioContext::uninitialize):
3002         (WebCore::AudioContext::createBufferSource):
3003         (WebCore::AudioContext::createScriptProcessor):
3004         (WebCore::AudioContext::createBiquadFilter):
3005         (WebCore::AudioContext::createPanner):
3006         (WebCore::AudioContext::createConvolver):
3007         (WebCore::AudioContext::createDynamicsCompressor):
3008         (WebCore::AudioContext::createAnalyser):
3009         (WebCore::AudioContext::createGain):
3010         (WebCore::AudioContext::createDelay):
3011         (WebCore::AudioContext::createChannelSplitter):
3012         (WebCore::AudioContext::createChannelMerger):
3013         (WebCore::AudioContext::createOscillator):
3014         * Modules/webaudio/AudioContext.h:
3015         (WebCore::AudioContext::currentSampleFrame const):
3016         (WebCore::AudioContext::currentTime const):
3017         (WebCore::AudioContext::sampleRate const):
3018
3019 2019-06-14  Youenn Fablet  <youenn@apple.com>
3020
3021         Cloning a MediaStreamTrack does not clone the logger
3022         https://bugs.webkit.org/show_bug.cgi?id=198844
3023
3024         Reviewed by Eric Carlson.
3025
3026         Make MediaStream and MediaStreamTrack rely on their private versions for logging.
3027         Move from a RefPtr version to a Ref so as to forbid nullptr crashes.
3028         Make sure that RealtimeIncomingAudioSource and RealtimeIncomingVideoSource check for their logger before logging.
3029         Covered by existing tests and updated test.
3030
3031         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
3032         (WebCore::loggerFromContext):
3033         (WebCore::CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack):
3034         * Modules/mediastream/MediaStream.cpp:
3035         (WebCore::loggerFromContext):
3036         (WebCore::MediaStream::create):
3037         (WebCore::MediaStream::MediaStream):
3038         * Modules/mediastream/MediaStream.h:
3039         * Modules/mediastream/MediaStreamTrack.cpp:
3040         (WebCore::MediaStreamTrack::MediaStreamTrack):
3041         * Modules/mediastream/MediaStreamTrack.h:
3042         * Modules/mediastream/UserMediaRequest.cpp:
3043         (WebCore::UserMediaRequest::allow):
3044         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3045         (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
3046         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3047         (WebCore::LibWebRTCPeerConnectionBackend::createReceiverForSource):
3048         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
3049         (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
3050         * platform/mediastream/MediaStreamPrivate.cpp:
3051         (WebCore::MediaStreamPrivate::create):
3052         (WebCore::MediaStreamPrivate::MediaStreamPrivate):
3053         (WebCore::MediaStreamPrivate::setLogger): Deleted.
3054         * platform/mediastream/MediaStreamPrivate.h:
3055         * platform/mediastream/MediaStreamTrackPrivate.cpp:
3056         (WebCore::MediaStreamTrackPrivate::create):
3057         (WebCore::MediaStreamTrackPrivate::MediaStreamTrackPrivate):
3058         (WebCore::MediaStreamTrackPrivate::clone):
3059         (WebCore::MediaStreamTrackPrivate::setLogger): Deleted.
3060         * platform/mediastream/MediaStreamTrackPrivate.h:
3061         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
3062         (WebCore::RealtimeMediaSourceCenter::createMediaStream):
3063         * platform/mediastream/RealtimeMediaSourceCenter.h:
3064         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
3065         (WebCore::RealtimeIncomingAudioSourceCocoa::OnData):
3066         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
3067         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferPool):
3068         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
3069         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
3070
3071 2019-06-14  Ali Juma  <ajuma@chromium.org>
3072
3073         IntersectionObserver rootMargin detection fails when `root` is an element
3074         https://bugs.webkit.org/show_bug.cgi?id=198784
3075
3076         Reviewed by Simon Fraser.
3077
3078         When computing a target's bounds in root space, we were applying the root's
3079         clip rect (if any), and then intersecting with the root rect expanded by the
3080         root margin. This meant that if a target did not intersect the non-expanded root
3081         rect, we would get an empty intersection even if the target did intersect the
3082         expanded root rect. Fix this by not applying the root's clip rect when computing
3083         a target's bounds in root space. Add a new VisibleRectContextOption::ApplyContainerClip
3084         that determines whether RenderObject::computeVisibleRectInContainer should apply
3085         the container's clip.
3086
3087         Test: imported/w3c/web-platform-tests/intersection-observer/root-margin-root-element.html
3088
3089         * rendering/RenderBox.cpp:
3090         (WebCore::RenderBox::applyCachedClipAndScrollPosition const):
3091         * rendering/RenderObject.cpp:
3092         (WebCore::RenderObject::visibleRectContextForRepaint):
3093         * rendering/RenderObject.h:
3094
3095 2019-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3096
3097         [cairo] Entering text into forms on github.com creates a trapezoid artifact
3098         https://bugs.webkit.org/show_bug.cgi?id=126124
3099
3100         Reviewed by Michael Catanzaro.
3101
3102         Mixing antialiasing modes in the same clip is not actually supported by cairo. In the case of rectangle clips we
3103         are already ignoring the current antialiasing to not do any antialiasing. We could do the opposite for clips
3104         receiving a path, we want to enforce antialiasing in that case since the paths might contain curves. Doing that
3105         we ensure all calls to clip with a path use the same antialiasing, which is the case of the github bug.
3106
3107         * platform/graphics/cairo/CairoOperations.cpp:
3108         (WebCore::Cairo::doClipWithAntialias): Helper to call cairo_clip() with the given antialising mode.
3109         (WebCore::Cairo::clip): Use doClipWithAntialias().
3110         (WebCore::Cairo::clipOut): Ditto.
3111         (WebCore::Cairo::clipPath): Ditto.
3112
3113 2019-06-13  Myles C. Maxfield  <mmaxfield@apple.com>
3114
3115         [WHLSL] Remove unnecessary ASSERT()s and clean up visitor lambdas
3116         https://bugs.webkit.org/show_bug.cgi?id=198706
3117
3118         Reviewed by Dean Jackson, Saam Barati, and Robin Morisset.
3119
3120         Some minor refactoring.
3121
3122         If the code is going to unconditionally downcast<Foo>(bar), there's no need
3123         to guard that with an ASSERT(is<Foo>(bar)) because the downcast() call will
3124         do that automatically.
3125
3126         No new tests because there is no behavior change.
3127
3128         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
3129         (WebCore::WHLSL::AST::ConstantExpression::visit):
3130         (WebCore::WHLSL::AST::ConstantExpression::visit const):
3131         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
3132         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
3133         (WebCore::WHLSL::Metal::EntryPointScaffolding::mangledOutputPath):
3134         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns):
3135         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
3136         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
3137         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
3138         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
3139         (WebCore::WHLSL::Metal::writeNativeFunction):
3140         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
3141         (WebCore::WHLSL::Metal::writeNativeType):
3142         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
3143         (WebCore::WHLSL::Metal::find):
3144         (WebCore::WHLSL::Metal::TypeNamer::createNameNode):
3145         (WebCore::WHLSL::Metal::TypeNamer::insert):
3146         (WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
3147         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
3148         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
3149         (WebCore::WHLSL::Checker::visit):
3150         (WebCore::WHLSL::argumentTypeForAndOverload):
3151         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
3152         (WebCore::WHLSL::inferTypesForTypeArguments):
3153         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
3154         (WebCore::WHLSL::Intrinsics::addFullTexture):
3155         (WebCore::WHLSL::Intrinsics::addDepthTexture):
3156         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
3157         (WebCore::WHLSL::modify):
3158         (WebCore::WHLSL::PropertyResolver::visit):
3159         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
3160         (WebCore::WHLSL::Visitor::visit):
3161
3162 2019-06-12  Myles C. Maxfield  <mmaxfield@apple.com>
3163
3164         [WHLSL] Hook up compute
3165         https://bugs.webkit.org/show_bug.cgi?id=198644
3166
3167         Reviewed by Saam Barati.
3168
3169         This patch hooks up compute shaders in exactly the same way that vertex and fragment shaders
3170         are hooked up. I've modified the two patchs (compute and rendering) to be almost exactly the
3171         same code.
3172
3173         This patch also adds support for the WHLSL compiler to determine what the numthreads()
3174         attribute in the shader says so that it can be hooked up to Metal's threads-per-threadgroup
3175         argument in the dispatch call. There is some logic to make sure that there aren't two
3176         numthreads() attributes on the same compute shader.
3177
3178         It also adds a little bit of type renaming. For built-in variables, sometimes Metal's type
3179         doesn't always match WHLSL's (and HLSL's type). For example, in WHLSL and HLSL,        SV_DispatchThreadID variables have to be a float3, but in Metal, they are a uint3.
3180         Therefore, I've added a little bit of code during each entry point's pack and unpack stages
3181         to handle this type conversion.
3182
3183         Test: webgpu/whlsl-compute.html
3184
3185         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
3186         (WebCore::WHLSL::Metal::internalTypeForSemantic): Determine which Metal type corresponds to
3187         each built-in variable.
3188         (WebCore::WHLSL::Metal::EntryPointScaffolding::builtInsSignature): Perform the type
3189         conversion.
3190         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns): Ditto.
3191         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::VertexEntryPointScaffolding): Ditto.
3192         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::helperTypes): Ditto.
3193         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::pack): Ditto.
3194         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::FragmentEntryPointScaffolding): Ditto.
3195         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes): Ditto.
3196         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::pack): Ditto.
3197         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::signature): Ditto.
3198         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
3199         * Modules/webgpu/WHLSL/WHLSLComputeDimensions.cpp: Added. Add a pass to determine whether
3200         or not any entry point has duplicate numthreads() attribute, and to determine what the
3201         appropriate numthreads() values should be for the current entry point.
3202         (WebCore::WHLSL::ComputeDimensionsVisitor::ComputeDimensionsVisitor):
3203         (WebCore::WHLSL::ComputeDimensionsVisitor::computeDimensions const):
3204         (WebCore::WHLSL::computeDimensions):
3205         * Modules/webgpu/WHLSL/WHLSLComputeDimensions.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLPrepare.h.
3206         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
3207         (WebCore::WHLSL::gatherEntryPointItems): Compute shaders don't need to have a semantic for their return type.
3208         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
3209         (WebCore::WHLSL::prepare): Run the computeDimensions() pass.
3210         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
3211         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp: In a left-value propertyAccessExpression,
3212         the index expression can be a right-value. Treat it as such.
3213         (WebCore::WHLSL::LeftValueSimplifier::finishVisiting):
3214         (WebCore::WHLSL::LeftValueSimplifier::visit):
3215         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: We need support for multiplication (for a
3216         test) and float3 for SV_DispatchThreadID.
3217         * Sources.txt:
3218         * SourcesCocoa.txt:
3219         * WebCore.xcodeproj/project.pbxproj:
3220         * platform/graphics/gpu/GPUComputePipeline.h: Associate a compute dimensions with a particular
3221         compute pipeline. This is how Metal knows what values to use for a dispatch.
3222         (WebCore::GPUComputePipeline::computeDimensions const):
3223         * platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm: Use the saved compute dimensions.
3224         (WebCore::GPUComputePassEncoder::dispatch):
3225         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm: Make the code match GPURenderPipelineMetal.
3226         (WebCore::trySetMetalFunctions):
3227         (WebCore::trySetFunctions):
3228         (WebCore::convertComputePipelineDescriptor):
3229         (WebCore::tryCreateMTLComputePipelineState):
3230         (WebCore::GPUComputePipeline::tryCreate):
3231         (WebCore::GPUComputePipeline::GPUComputePipeline):
3232         (WebCore::tryCreateMtlComputeFunction): Deleted.
3233         * platform/graphics/gpu/cocoa/GPUPipelineMetalConvertLayout.cpp: Added. Moved shared helper
3234         functions to a file where they can be accessed by multiple places.
3235         (WebCore::convertShaderStageFlags):
3236         (WebCore::convertBindingType):
3237         (WebCore::convertLayout):
3238         * platform/graphics/gpu/cocoa/GPUPipelineMetalConvertLayout.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLPrepare.h.
3239         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Delete the functions that were moved to GPUPipelineMetalConvertLayout.
3240         (WebCore::trySetFunctions):
3241         (WebCore::tryCreateMtlRenderPipelineState):
3242         (WebCore::convertShaderStageFlags): Deleted.
3243         (WebCore::convertBindingType): Deleted.
3244         (WebCore::convertLayout): Deleted.
3245
3246 2019-06-13  Jer Noble  <jer.noble@apple.com>
3247
3248         AVKit play button bypasses MediaElementSession playbackPermitted() checks.
3249         https://bugs.webkit.org/show_bug.cgi?id=198813
3250
3251         Reviewed by Eric Carlson.
3252
3253         HTMLMediaElement::togglePlayState() is an internal-only method that doesn't
3254         run playbackPermitted() checks. For our imitation AVPlayerController, translate
3255         requests to -togglePlayback: into calls to play() and pause() depending on
3256         playback state.
3257
3258         * platform/ios/WebAVPlayerController.mm:
3259         (-[WebAVPlayerController togglePlayback:]):
3260
3261 2019-06-13  Commit Queue  <commit-queue@webkit.org>
3262
3263         Unreviewed, rolling out r246396 and r246397.
3264         https://bugs.webkit.org/show_bug.cgi?id=198837
3265
3266         Breaks internal builds (Requested by ShawnRoberts on #webkit).
3267
3268         Reverted changesets:
3269
3270         "[WHLSL] Hook up compute"
3271         https://bugs.webkit.org/show_bug.cgi?id=198644
3272         https://trac.webkit.org/changeset/246396
3273
3274         "[WHLSL] Hook up compute"
3275         https://bugs.webkit.org/show_bug.cgi?id=198644
3276         https://trac.webkit.org/changeset/246397
3277
3278 2019-06-13  Antti Koivisto  <antti@apple.com>
3279
3280         twitch.tv: embedded video hovers down the screen when scrolling on iPad
3281         https://bugs.webkit.org/show_bug.cgi?id=198832
3282         <rdar://problem/51541439>
3283
3284         Reviewed by Simon Fraser.
3285
3286         Test: compositing/scrolling/async-overflow-scrolling/overflow-scroll-paint-order-sibling.html
3287
3288         * rendering/RenderLayer.cpp:
3289         (WebCore::RenderLayer::scrollTo):
3290
3291         Overflow scroll layer may have composited descendants that are its paint order siblings. We need to invalidate
3292         the tree of the paint order parent for compositing update (instead of just the tree of the overflow scroll layer).
3293
3294         This matches what RenderLayer::updateLayerPosition() does.
3295
3296 2019-06-13  Youenn Fablet  <youenn@apple.com>
3297
3298         SocketStreamHandle should not be destroyed in a background thread
3299         https://bugs.webkit.org/show_bug.cgi?id=198781
3300
3301         Reviewed by Geoffrey Garen.
3302
3303         Make sure to destroy SocketStreamHandle on the main thread since it owns an URL created on the main thread.
3304         Covered by WPT websocket tests from https://bugs.webkit.org/show_bug.cgi?id=198774.
3305
3306         * platform/network/SocketStreamHandle.cpp:
3307         (WebCore::SocketStreamHandle::SocketStreamHandle):
3308         * platform/network/SocketStreamHandle.h:
3309
3310 2019-06-13  Antoine Quint  <graouts@apple.com>
3311
3312         "display: contents" Content click does not trigger
3313         https://bugs.webkit.org/show_bug.cgi?id=198559
3314         <rdar://problem/51488524>
3315
3316         Reviewed by Antti Koivisto.
3317
3318         Test: fast/events/ios/click-event-and-display-contents.html
3319
3320         * dom/Element.h:
3321
3322 2019-06-13  Takashi Komori  <Takashi.Komori@sony.com>
3323
3324         [curl] Remove member objects of CurlRequest not to share by different threads.
3325         https://bugs.webkit.org/show_bug.cgi?id=198747
3326
3327         Reviewed by Fujii Hironori.
3328
3329         Removed m_certificateInfo and m_networkLoadMetrics.
3330         Before patch those objects were updated by different threads.
3331
3332         No tests needed, no functionality changes.
3333
3334         * platform/network/curl/CurlDownload.cpp:
3335         (WebCore::CurlDownload::curlDidReceiveResponse):
3336         (WebCore::CurlDownload::curlDidReceiveBuffer):
3337         (WebCore::CurlDownload::curlDidComplete):
3338         (WebCore::CurlDownload::curlDidFailWithError):
3339         * platform/network/curl/CurlDownload.h:
3340         * platform/network/curl/CurlRequest.cpp:
3341         (WebCore::CurlRequest::start):
3342         (WebCore::CurlRequest::didReceiveHeader):
3343         (WebCore::CurlRequest::didCompleteTransfer):
3344         (WebCore::CurlRequest::invokeDidReceiveResponse):
3345         (WebCore::CurlRequest::networkLoadMetrics):
3346         (WebCore::CurlRequest::updateNetworkLoadMetrics): Deleted.
3347         * platform/network/curl/CurlRequest.h:
3348         (WebCore::CurlRequest::setStartTime):
3349         (WebCore::CurlRequest::certificateInfo const): Deleted.
3350         (WebCore::CurlRequest::networkLoadMetrics const): Deleted.
3351         * platform/network/curl/CurlRequestClient.h:
3352         * platform/network/curl/CurlResourceHandleDelegate.cpp:
3353         (WebCore::CurlResourceHandleDelegate::curlDidSendData):
3354         (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
3355         (WebCore::CurlResourceHandleDelegate::curlDidReceiveBuffer):
3356         (WebCore::CurlResourceHandleDelegate::curlDidComplete):
3357         (WebCore::CurlResourceHandleDelegate::curlDidFailWithError):
3358         * platform/network/curl/CurlResourceHandleDelegate.h:
3359         * platform/network/curl/CurlResponse.h:
3360         (WebCore::CurlResponse::isolatedCopy const):
3361         * platform/network/curl/ResourceResponseCurl.cpp:
3362         (WebCore::ResourceResponse::ResourceResponse):
3363
3364 2019-06-13  Zan Dobersek  <zdobersek@igalia.com>
3365
3366         [Nicosia] Add SceneIntegration
3367         https://bugs.webkit.org/show_bug.cgi?id=198791
3368
3369         Reviewed by Carlos Garcia Campos.
3370
3371         Add the SceneIntegration class to the Nicosia namespace, primarily for
3372         the purpose of being able to conveniently trigger scene updates whenever
3373         changes are done to the state of layers that are included in that scene.
3374         Initially this would be used for layer changes done on a
3375         scrolling-dedicated thread.
3376
3377         Each Nicosia::PlatformLayer can have a SceneIntegration object reference
3378         associated. Helper createUpdateScope() method returns a
3379         SceneIntegration::UpdateScope instance that triggers an update for the
3380         scene when that instance is destroyed (normally&n