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