SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-01-18  Jer Noble  <jer.noble@apple.com>
2
3         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
4         https://bugs.webkit.org/show_bug.cgi?id=189553
5
6         Reviewed by Tim Horton.
7
8         * Configurations/Base.xcconfig:
9         * Configurations/SDKVariant.xcconfig: Added.
10         * Configurations/WebCore.xcconfig:
11
12 2019-01-18  Daniel Bates  <dabates@apple.com>
13
14         CSS auto focus-ring outlines don't render on iOS
15         https://bugs.webkit.org/show_bug.cgi?id=193583
16         <rdar://problem/6508697>
17
18         Reviewed by Simon Fraser.
19
20         Implement support for drawing focus rings on iOS when built with ENABLE(FULL_KEYBOARD_ACCESS)
21         enabled.
22
23         For now the focus ring drawing for iOS is tangled up into the Mac-specific code to draw
24         animated focus rings. I will fix this in <https://bugs.webkit.org/show_bug.cgi?id=193591>.
25
26         * SourcesCocoa.txt: Add file ColorIOS.mm.
27         * WebCore.xcodeproj/project.pbxproj: Add files ColorIOS.{h, mm}.
28
29         * platform/graphics/GraphicsContext.h:
30         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
31         (WebCore::drawFocusRingAtTime):
32         (WebCore::GraphicsContext::drawFocusRing):
33         Compile focus ring drawing code when building with ENABLE(FULL_KEYBOARD_ACCESS) enabled.
34         This is always enabled on Mac.
35         
36         * platform/ios/ColorIOS.h: Added.
37         * platform/ios/ColorIOS.mm: Added.
38         (WebCore::colorFromUIColor): Convert a UIColor to a WebCore::Color.
39
40         * rendering/RenderElement.cpp:
41         (WebCore::RenderElement::paintFocusRing):
42         * rendering/RenderImage.cpp:
43         (WebCore::RenderImage::paintAreaElementFocusRing):
44         Compile focus ring drawing code when building with ENABLE(FULL_KEYBOARD_ACCESS) enabled.
45         This is always enabled on Mac.
46
47         * rendering/RenderThemeIOS.h:
48         * rendering/RenderThemeIOS.mm:
49         (WebCore::RenderThemeIOS::platformFocusRingColor const): Implement this override for iOS.
50         (WebCore::RenderThemeIOS::supportsFocusRing const): Implement this override for iOS to always
51         return false - the iOS theme code does not support painting focus rings. By returning false we
52         will use the platform-independent, non-theme code path to draw focus rings.
53
54 2019-01-18  David Kilzer  <ddkilzer@apple.com>
55
56         Follow-up: Switch remaining UIKit soft-linking in WebCore, WebKitLegacy over to UIKitSoftLink.{cpp,h}
57         <https://webkit.org/b/193568>
58         <rdar://problem/47381130>
59
60         * editing/cocoa/DictionaryLookup.mm:
61         (-[WebRevealHighlight drawHighlightContentForItem:context:]):
62         Fix the build by changing getUIApplicationClass() to
63         PAL::getUIApplicationClass().
64
65 2019-01-18  David Kilzer  <ddkilzer@apple.com>
66
67         Switch remaining UIKit soft-linking in WebCore, WebKitLegacy over to UIKitSoftLink.{cpp,h}
68         <https://webkit.org/b/193568>
69         <rdar://problem/47381130>
70
71         Reviewed by Alex Christensen.
72
73         This does the following:
74         - Removes local soft-linking of UIKit.
75         - Switches to using PAL functions for soft-linking.
76
77         * SourcesCocoa.txt: Add 4 source files to UnifiedSources.
78         * WebCore.xcodeproj/project.pbxproj: Remove 4 sources files
79         from WebCore target now that they are in UnifiedSources.
80         * editing/cocoa/DictionaryLookup.mm:
81         * editing/cocoa/HTMLConverter.mm: Move SPI to UIKitSPI.h. Remove
82         declarations in public headers.
83         (_fontForNameAndSize): Change use of getUIFontClass() to
84         PlatformFontClass.
85         (HTMLConverter::_processElement): Add cast here since compiler
86         finds the wrong selector for +clearColor and thinks it returns a
87         `CIColor *` object.  The same cast already exists in
88         VideoFullscreenInterfaceAVKit.mm.
89         * page/cocoa/SettingsBaseCocoa.mm:
90         (WebCore::SettingsBase::defaultTextAutosizingEnabled):
91         * platform/audio/ios/MediaSessionManagerIOS.mm:
92         (-[WebMediaSessionHelper initWithCallback:]):
93         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
94         (WebCore::exernalDeviceDisplayNameForPlayer):
95         * platform/graphics/cocoa/FontCascadeCocoa.mm:
96         (WebCore::showLetterpressedGlyphsWithAdvances):
97         * platform/ios/DragImageIOS.mm:
98         (WebCore::scaleDragImage):
99         (WebCore::createDragImageFromImage):
100         (WebCore::cascadeForSystemFont):
101         (WebCore::createDragImageForLink):
102         (WebCore::createDragImageForSelection):
103         (WebCore::createDragImageForRange):
104         (WebCore::createDragImageForColor):
105         * platform/ios/PlatformPasteboardIOS.mm:
106         (WebCore::PlatformPasteboard::PlatformPasteboard):
107         (WebCore::PlatformPasteboard::color):
108         (WebCore::registerItemToPasteboard):
109         (WebCore::PlatformPasteboard::setColor):
110         * platform/ios/ThemeIOS.mm:
111         (WebCore::ThemeIOS::userPrefersReducedMotion const):
112         * platform/ios/UserAgentIOS.mm:
113         (WebCore::isClassic):
114         (WebCore::isClassicPad):
115         (WebCore::isClassicPhone):
116         * platform/ios/ValidationBubbleIOS.mm:
117         (-[WebValidationBubbleTapRecognizer initWithPopoverController:]):
118         (WebCore::ValidationBubble::ValidationBubble):
119         (WebCore::ValidationBubble::show):
120         (WebCore::fallbackViewController):
121         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
122         (clearUIColor):
123         (allocWebAVPictureInPicturePlayerLayerViewInstance):
124         (WebAVPlayerLayerView_videoView):
125         (fallbackViewController):
126         (VideoFullscreenInterfaceAVKit::doSetup):
127         * platform/ios/WebEvent.mm:
128         (+[WebEvent modifierFlags]):
129         * platform/ios/WebItemProviderPasteboard.mm:
130         (allLoadableClasses):
131         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
132         (VideoFullscreenControllerContext::setUpFullscreen):
133         * platform/network/mac/WebCoreURLResponse.mm: Add missing header
134         after unified sources were updated.
135         * rendering/RenderThemeIOS.mm:
136         (WebCore::contentSizeCategoryDidChange):
137         (WebCore::RenderThemeIOS::RenderThemeIOS):
138         (WebCore::RenderThemeIOS::contentSizeCategory):
139         (WebCore::RenderThemeIOS::systemColor const):
140         (WebCore::attachmentActionColor):
141         (WebCore::attachmentTitleColor):
142         (WebCore::attachmentSubtitleColor):
143         (WebCore::iconForAttachment):
144         * testing/Internals.mm:
145         (WebCore::Internals::userPrefersReducedMotion const):
146
147 2019-01-18  Antti Koivisto  <antti@apple.com>
148
149         Implement asynchronous frame scrolling for iOS
150         https://bugs.webkit.org/show_bug.cgi?id=193539
151         <rdar://problem/47379873>
152
153         Reviewed by Simon Fraser.
154
155         This patch implements UIScrollView based frame scrolling on iOS, enabled by the "Async Frame Scrolling"
156         internal setting (still off by default).
157
158         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
159         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollLayer const): Deleted.
160         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
161         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):
162
163         Export ScrollingTreeFrameScrollingNodeIOS.
164
165         * rendering/RenderLayerCompositor.cpp:
166         (WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
167         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
168         (WebCore::RenderLayerCompositor::updateScrollLayerClipping):
169
170         If we don't have a separate clip layer, just resize and position the scroll layer.
171
172         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
173         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
174         (WebCore::RenderLayerCompositor::ensureRootLayer):
175
176         Use GraphicsLayer::Type::Scrolling as the scroll layer type when async frame scrolling is enabled.
177         Don't create a separate clip layer since the scroll layer will handle clipping.
178
179         * rendering/RenderLayerCompositor.h:
180
181 2019-01-18  Ali Juma  <ajuma@chromium.org>
182
183         FetchResponse::url should return the empty string for tainted responses
184         https://bugs.webkit.org/show_bug.cgi?id=193553
185
186         Reviewed by Youenn Fablet.
187
188         Check whether the response is tainted in FetchResponse::url, to match
189         the behavior described in https://fetch.spec.whatwg.org/#concept-filtered-response-opaque.
190
191         * Modules/fetch/FetchResponse.cpp:
192         (WebCore::FetchResponse::url const):
193
194 2019-01-18  Youenn Fablet  <youenn@apple.com>
195
196         A track source should be unmuted whenever reenabled after setDirection changes
197         https://bugs.webkit.org/show_bug.cgi?id=193554
198         <rdar://problem/47366196>
199
200         Reviewed by Eric Carlson.
201
202         Ensure that track gets unmuted after being fired as part of track event.
203         Test is triggering some existing issues with MediaPlayerPrivateMediaStreamAVFObjC.
204         Given the enqueuing of samples happens in a different frame than the thread used to update media stream and the active video track,
205         some enqueued samples might not be from the right active video track or there might be no active video track.
206
207         Test: webrtc/video-setDirection.html
208
209         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
210         (WebCore::LibWebRTCMediaEndpoint::fireTrackEvent):
211         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
212         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
213         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
214         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData):
215
216 2019-01-18  Charlie Turner  <cturner@igalia.com>
217
218         [GStreamer][EME][ClearKey] Request keys from CDMInstance rather than passing via bus messages
219         https://bugs.webkit.org/show_bug.cgi?id=192229
220
221         Reviewed by Xabier Rodriguez-Calvar.
222
223         Covered by existing tests.
224
225         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
226         (WebCore::parseLicenseFormat): There is a defect in some C++11
227         compiles where they will copy this return value since the type
228         doesn't exactly match. Force a move with WTFMove.
229         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
230         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
231         Deleted. No longer used by anything.
232         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: Ditto.
233         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
234         Rename these methods to avoid "namespacing names".
235         (webkit_media_clear_key_decrypt_class_init):
236         (finalize):
237         (handleKeyResponse): This is a temporary fix, we need some more
238         reorganisation to be full driven by CDMInstance APIs for decryption.
239         (findAndSetKey):
240         (decrypt):
241         (webKitMediaClearKeyDecryptorFinalize): Deleted.
242         (webKitMediaClearKeyDecryptorHandleKeyResponse): Deleted.
243         (webKitMediaClearKeyDecryptorFindAndSetKey): Deleted.
244         (webKitMediaClearKeyDecryptorDecrypt): Deleted.
245         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: Ditto.
246         (webkit_media_common_encryption_decrypt_class_init):
247         (finalize):
248         (transformCaps):
249         (transformInPlace):
250         (isCDMInstanceAvailable):
251         (sinkEventHandler):
252         (queryHandler):
253         (changeState):
254         (setContext):
255         (webKitMediaCommonEncryptionDecryptorFinalize): Deleted.
256         (webkitMediaCommonEncryptionDecryptTransformCaps): Deleted.
257         (webkitMediaCommonEncryptionDecryptTransformInPlace): Deleted.
258         (webkitMediaCommonEncryptionDecryptIsCDMInstanceAvailable): Deleted.
259         (webkitMediaCommonEncryptionDecryptSinkEventHandler): Deleted.
260         (webkitMediaCommonEncryptionDecryptorQueryHandler): Deleted.
261         (webKitMediaCommonEncryptionDecryptorChangeState): Deleted.
262         (webKitMediaCommonEncryptionDecryptorSetContext): Deleted.
263         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
264         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
265         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithLocalInstance):
266         Deleted. No longer passing key information over bus messages.
267         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
268
269 2019-01-18  Zalan Bujtas  <zalan@apple.com>
270
271         [LFC][BFC][MarginCollapsing] Collapsing through should not ignore floats.
272         https://bugs.webkit.org/show_bug.cgi?id=193564
273
274         Reviewed by Antti Koivisto.
275
276         Float boxes prevent collapsing through.
277
278         Test: fast/block/float/float-in-descendant-formatting-context.html
279
280         * layout/blockformatting/BlockMarginCollapse.cpp:
281         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
282
283 2019-01-18  Zalan Bujtas  <zalan@apple.com>
284
285         [LFC] Do not skip float boxes that are not part of the current formatting context when computing bottom.
286         https://bugs.webkit.org/show_bug.cgi?id=193562
287
288         Reviewed by Antti Koivisto.
289
290         The current floating context's (float) boxes could belong to descendant formatting contexts.
291         We need to include them as well when computing height (bottom) (we essentially need to skip ancestor floats only).
292
293         <div id=container style="overflow: hidden"><div>foo<div style="float: left">bar</div></div></div>
294         While computing the height for "container", the float box needs to be taken into account even though
295         it is part of another (descendant) formatting context (the inline formatting context established by its parent div).
296
297         * layout/floats/FloatingState.cpp:
298         (WebCore::Layout::FloatingState::bottom const):
299         * layout/floats/FloatingState.h:
300         (WebCore::Layout::FloatingState::FloatItem::isDescendantOfFormattingRoot const):
301         (WebCore::Layout::FloatingState::FloatItem::inFormattingContext const): Deleted.
302
303 2019-01-18  Zalan Bujtas  <zalan@apple.com>
304
305         [LFC][BFC] Check for inflow children while computing height for block formatting context roots.
306         https://bugs.webkit.org/show_bug.cgi?id=193555
307
308         Reviewed by Antti Koivisto.
309
310         This patch also extends areEssentiallyEqual to 0.125px to be able to match (essentially equal) inline runs. 
311
312         * layout/FormattingContextGeometry.cpp:
313         (WebCore::Layout::contentHeightForFormattingContextRoot):
314         * layout/Verification.cpp:
315         (WebCore::Layout::areEssentiallyEqual):
316         * page/FrameViewLayoutContext.cpp:
317         (WebCore::layoutUsingFormattingContext):
318
319 2019-01-18  Yacine Bandou  <yacine.bandou@softathome.com>
320
321         [WebAudio] Release the AudioDestination when uninitializing DefaultAudioDestinationNode
322         https://bugs.webkit.org/show_bug.cgi?id=192590
323
324         Reviewed by Philippe Normand.
325
326         When we uninitialize DefaultAudioDestinationNode, the AudioDestination is stopped but not destroyed.
327
328         On some platforms the resources are allocated and released with the AudioDestination, thus when we uninitialize
329         DefaultAudioDestinationNode we don't release resources because the AudioDestination is not destroyed.
330
331         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
332         (WebCore::DefaultAudioDestinationNode::uninitialize):
333
334 2019-01-18  Yacine Bandou  <yacine.bandou@softathome.com>
335
336         [WebAudio] Call AudioContext::uninitialize() immediately when the AudioContext is stopped
337         https://bugs.webkit.org/show_bug.cgi?id=192586
338
339         Reviewed by Philippe Normand.
340
341         When WebProcess is killed, AudioContext::uninitialize() is not called immediately in the stop so
342         the AudioDestinationNode is not destroyed.
343
344         In my case, I have a resource device manager, the output audio device is reserved when AudioDestinationNode
345         is instantiated and it is released when AudioDestinationNode is destroyed, thus when the webprocess is killed,
346         the resources leak.
347
348         AudioContext::uninitialize() is not called immediately since r94608.
349         This modification can now be reverted without regression in WebAudio tests.
350
351         Test: webaudio/mediaelementaudiosourcenode-gc.html
352
353         * Modules/webaudio/AudioContext.cpp:
354         (WebCore::AudioContext::stop):
355
356 2019-01-18  Simon Fraser  <simon.fraser@apple.com>
357
358         ScrollingCoordinator::scrollableAreaScrollLayerDidChange() can be removed
359         https://bugs.webkit.org/show_bug.cgi?id=193559
360
361         Reviewed by Antti Koivisto.
362
363         ScrollingCoordinator::scrollableAreaScrollLayerDidChange() existed for CoordinatedGraphics,
364         but the code that used it was removed in webkit.org/r229318 so we can remove it and
365         code that calls it.
366
367         * page/scrolling/ScrollingCoordinator.h:
368         (WebCore::ScrollingCoordinator::willDestroyScrollableArea):
369         (WebCore::ScrollingCoordinator::scrollableAreaScrollLayerDidChange): Deleted.
370         * rendering/RenderLayerBacking.cpp:
371         (WebCore::RenderLayerBacking::updateGeometry):
372         * rendering/RenderLayerCompositor.cpp:
373         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
374         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
375         (WebCore::RenderLayerCompositor::scrollingLayerDidChange): Deleted.
376         * rendering/RenderLayerCompositor.h:
377
378 2019-01-17  Wenson Hsieh  <wenson_hsieh@apple.com>
379
380         [iOS] Content offset jumps erratically when autoscrolling near scroll view content inset areas
381         https://bugs.webkit.org/show_bug.cgi?id=193494
382         <rdar://problem/46859627>
383
384         Reviewed by Simon Fraser and Tim Horton.
385
386         When computing the content offset to scroll to when revealing a given rect in content coordinates, we currently
387         just use the unobscured content rect. As a result, when scrolling to reveal a rect, we'll clamp the final scroll
388         position such that only content is visible. For example, when asked to reveal the rect `(0, 0, 1, 1)`, we adjust
389         the scroll position to be the origin.
390
391         However, consider the case where a client (e.g. Mail on iOS) has added a content inset to the web view's scroll
392         view. If we're asked to reveal a rect that is outside the content area but within a content inset, we will still
393         end up clamping the scroll position to the unobscured rect. This manifests in a bug where selecting text and
394         autoscrolling in iOS Mail compose while the scroll view is scrolled all the way to the top to reveal the To/Cc/
395         Subject fields causes the content offset to jump to the origin, rather than staying at (0, -topContentInset).
396
397         To fix this, we teach `RenderLayer::scrollRectToVisible` about content insets that are visible. Rather than use
398         the content rects as-is, expand to encompass visible content insets as well. This ensures that revealing a
399         position which is already visible won't cause us to scroll away the content inset area and only show the
400         unobscured rect.
401
402         Tests:  editing/selection/ios/autoscroll-with-top-content-inset.html
403                 fast/scrolling/ios/scroll-into-view-with-top-content-inset.html
404
405         * page/FrameView.cpp:
406         (WebCore::FrameView::unobscuredContentRectExpandedByContentInsets const):
407
408         Introduce a helper method that expands the unobscured content rect to include surrounding content insets.
409
410         * page/FrameView.h:
411         * page/Page.h:
412         (WebCore::Page::contentInsets const):
413         (WebCore::Page::setContentInsets):
414         * rendering/RenderLayer.cpp:
415         (WebCore::RenderLayer::scrollRectToVisible):
416         (WebCore::RenderLayer::getRectToExpose const):
417
418 2019-01-17  Truitt Savell  <tsavell@apple.com>
419
420         Unreviewed, rolling out r240124.
421
422         This commit broke an internal build.
423
424         Reverted changeset:
425
426         "SDK_VARIANT build destinations should be separate from non-
427         SDK_VARIANT builds"
428         https://bugs.webkit.org/show_bug.cgi?id=189553
429         https://trac.webkit.org/changeset/240124
430
431 2019-01-17  Devin Rousso  <drousso@apple.com>
432
433         Web Inspector: fix Xcode project file list after r239976
434         https://bugs.webkit.org/show_bug.cgi?id=193474
435
436         Reviewed by Timothy Hatcher.
437
438         * WebCore.xcodeproj/project.pbxproj:
439
440 2019-01-17  Ross Kirsling  <ross.kirsling@sony.com>
441
442         Unreviewed WinCairo fix -- hundreds of tests crash after r240031.
443
444         * platform/network/curl/ResourceHandleCurl.cpp:
445         (WebCore::ResourceHandle::createCurlRequest):
446         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
447         (WebCore::ResourceHandle::receivedCredential):
448         (WebCore::ResourceHandle::getCredential):
449
450 2019-01-17  John Wilander  <wilander@apple.com>
451
452         Add infrastructure to enable/disable ITP Debug Mode through Preferences
453         https://bugs.webkit.org/show_bug.cgi?id=193510
454         <rdar://problem/47330969>
455
456         Reviewed by Dean Jackson.
457
458         No new tests. These changes are purely for settings/preferences.
459
460         * page/RuntimeEnabledFeatures.h:
461         (WebCore::RuntimeEnabledFeatures::setItpDebugModeEnabled):
462         (WebCore::RuntimeEnabledFeatures::itpDebugModeEnabled const):
463         (WebCore::RuntimeEnabledFeatures::setResourceLoadStatisticsDebugMode): Deleted.
464         (WebCore::RuntimeEnabledFeatures::resourceLoadStatisticsDebugMode const): Deleted.
465             Renamed.
466         * page/Settings.yaml:
467             Removed since this particular setting should not be persisted for privacy
468             reasons.
469
470 2019-01-17  Jer Noble  <jer.noble@apple.com>
471
472         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
473         https://bugs.webkit.org/show_bug.cgi?id=189553
474
475         Reviewed by Tim Horton.
476
477         * Configurations/Base.xcconfig:
478         * Configurations/SDKVariant.xcconfig: Added.
479         * Configurations/WebCore.xcconfig:
480
481 2019-01-17  Jer Noble  <jer.noble@apple.com>
482
483         MediaPlayerPrivateAVFoundationObjC can return incorrect paused information
484         https://bugs.webkit.org/show_bug.cgi?id=193499
485
486         Reviewed by Eric Carlson.
487
488         MediaPlayerPrivateAVFoundation uses rate() as an indicator of whether the player
489         is paused or not. This is incorrect when playback is stalled waiting for more data.
490         For MPPAVFObjC, use the timeControlStatus as a more accurate indicator of whether
491         the player is playing.
492
493         Now that we have correct play state information, we can remove the handlePlaybackCommand()
494         path when playing remotely for a more direct approach of notifying the HTMLMediaElement
495         that the play state has changed.
496
497         Drive-by fix: Before throwing away the AVPlayer, clear its output context. This keeps
498         remote devices from keeping the AVPlayer alive.
499
500         Drive-by fix #2: The NullMediaPlayer should always return "true" for paused(), not "false",
501         since it can't possibly play anything.
502
503         * platform/graphics/MediaPlayer.cpp:
504         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
505         (WebCore::MediaPlayerPrivateAVFoundation::paused const):
506         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
507         (WebCore::MediaPlayerPrivateAVFoundation::platformPaused const):
508         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
509         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
510         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
511         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPaused const):
512         (WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange):
513
514 2019-01-17  Jiewen Tan  <jiewen_tan@apple.com>
515
516         [Mac] Add a new quirk to HTMLFormControlElement::isMouseFocusable
517         https://bugs.webkit.org/show_bug.cgi?id=193478
518         <rdar://problem/34368591>
519
520         Reviewed by Brent Fulgham.
521
522         By default in macOS, submit buttons (controls) are not focusable. WebKit follows this system convention
523         as suggested by the spec: https://html.spec.whatwg.org/multipage/interaction.html#focusable-area. This
524         is also the convention Firefox respects. However, Chrome doesn't. ceac.state.gov is by far the only
525         website that assumes submit buttons are focusable, and will prohibit users from completing immigration
526         forms, such as DS160 if buttons are not. To help immigrations, we decide to add a new quirk to
527         HTMLFormControlElement::isMouseFocusable such that submit buttons are mouse focusable.
528
529         This quirk is for ceac.state.gov specifically, and therefore no tests.
530
531         * html/HTMLFormControlElement.cpp:
532         (WebCore::HTMLFormControlElement::isMouseFocusable const):
533         (WebCore::HTMLFormControlElement::needsSiteSpecificQuirks const):
534         * html/HTMLFormControlElement.h:
535
536 2019-01-17  Alex Christensen  <achristensen@webkit.org>
537
538         Fix WinCairo build after r240117
539         https://bugs.webkit.org/show_bug.cgi?id=193529
540
541         * PlatformWin.cmake:
542         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
543
544 2019-01-17  Youenn Fablet  <youenn@apple.com>
545
546         Add release logging for incoming and outgoing webrtc audio tracks
547         https://bugs.webkit.org/show_bug.cgi?id=185545
548
549         Reviewed by Eric Carlson.
550
551         Add logging of audio tracks. When doing a WebRTC call,
552         one log line is added each second for each audio track.
553         Validated that logging is done through manual testing.
554
555         Refactored code to use LogHelper and apply it to video sources as well.
556
557         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
558         (WebCore::LibWebRTCMediaEndpoint::addTrack):
559         (WebCore::LibWebRTCMediaEndpoint::sourceFromNewReceiver):
560         (WebCore::sourceFromNewReceiver): Deleted.
561         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
562         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
563         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
564         (WebCore::RealtimeIncomingAudioSource::logChannel const):
565         (WebCore::RealtimeIncomingAudioSource::logger const):
566         * platform/mediastream/RealtimeIncomingAudioSource.h:
567         (WebCore::RealtimeIncomingAudioSource::setLogger):
568         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
569         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
570         (WebCore::RealtimeIncomingVideoSource::logChannel const):
571         (WebCore::RealtimeIncomingVideoSource::logger const):
572         * platform/mediastream/RealtimeIncomingVideoSource.h:
573         (WebCore::RealtimeIncomingVideoSource::setLogger):
574         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
575         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
576         (WebCore::RealtimeOutgoingAudioSource::sendAudioFrames):
577         (WebCore::RealtimeOutgoingAudioSource::logChannel const):
578         (WebCore::RealtimeOutgoingAudioSource::logger const):
579         * platform/mediastream/RealtimeOutgoingAudioSource.h:
580         (WebCore::RealtimeOutgoingAudioSource::setLogger):
581         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
582         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
583         (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
584         (WebCore::RealtimeOutgoingVideoSource::sendOneBlackFrame):
585         (WebCore::RealtimeOutgoingVideoSource::logChannel const):
586         (WebCore::RealtimeOutgoingVideoSource::logger const):
587         * platform/mediastream/RealtimeOutgoingVideoSource.h:
588         (WebCore::RealtimeOutgoingVideoSource::setLogger):
589         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
590         (WebCore::RealtimeIncomingAudioSourceCocoa::OnData):
591         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.h:
592         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
593         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferPool):
594         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
595         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
596         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
597         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
598         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
599         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
600         (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
601
602 2019-01-17  Alex Christensen  <achristensen@webkit.org>
603
604         Stop using NetworkStorageSession::storageSession in WebCore
605         https://bugs.webkit.org/show_bug.cgi?id=193529
606
607         Reviewed by Tim Horton.
608
609         Ownership of the map that NetworkStorageSession::storageSession searches needs to move to the WebKit/WebKitLegacy layer,
610         so when WebCore used to look in this map it needs to call a client function to ask the layer above it for the storage object.
611         I've called this client StorageSessionProvider::storageSession.  Right now it just looks in NetworkStorageSession::storageSession,
612         but this added abstraction makes it possible to move the currently process-global map to be a member of the NetworkProcess object.
613
614         * Modules/websockets/WebSocketChannel.cpp:
615         (WebCore::WebSocketChannel::connect):
616         * WebCore.xcodeproj/project.pbxproj:
617         * loader/CookieJar.cpp:
618         (WebCore::CookieJar::create):
619         (WebCore::CookieJar::CookieJar):
620         (WebCore::CookieJar::cookies const):
621         (WebCore::CookieJar::setCookies):
622         (WebCore::CookieJar::cookiesEnabled const):
623         (WebCore::CookieJar::cookieRequestHeaderFieldValue const):
624         (WebCore::CookieJar::getRawCookies const):
625         (WebCore::CookieJar::deleteCookie):
626         * loader/CookieJar.h:
627         * loader/EmptyClients.cpp:
628         (WebCore::pageConfigurationWithEmptyClients):
629         * page/Page.h:
630         * page/SocketProvider.cpp:
631         (WebCore::SocketProvider::createSocketStreamHandle):
632         * page/SocketProvider.h:
633         * platform/network/NetworkingContext.h:
634         * platform/network/SocketStreamHandleImpl.cpp:
635         (WebCore::cookieDataForHandshake):
636         (WebCore::SocketStreamHandleImpl::platformSendHandshake):
637         * platform/network/StorageSessionProvider.h: Added.
638         (WebCore::StorageSessionProvider::~StorageSessionProvider):
639         * platform/network/cf/SocketStreamHandleImpl.h:
640         (WebCore::SocketStreamHandleImpl::create):
641         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
642         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
643         (WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials):
644         * platform/network/curl/SocketStreamHandleImpl.h:
645         (WebCore::SocketStreamHandleImpl::create):
646         * platform/network/soup/SocketStreamHandleImpl.h:
647         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
648         (WebCore::SocketStreamHandleImpl::create):
649
650 2019-01-17  Jon Lee  <jonlee@apple.com>
651
652         [EME] Remove Amazon Prime Video from quirks list
653         https://bugs.webkit.org/show_bug.cgi?id=193514
654         rdar://problem/47295330
655
656         Reviewed by Jer Noble.
657
658         * page/Quirks.cpp:
659         (WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const):
660
661 2019-01-17  Zalan Bujtas  <zalan@apple.com>
662
663         [LFC][BFC] An element with transform is a containing block for positioned descendants.
664         https://bugs.webkit.org/show_bug.cgi?id=193534
665
666         Reviewed by Antti Koivisto.
667
668         "For elements whose layout is governed by the CSS box model, any value other than none for the transform
669         property also causes the element to establish a containing block for all descendants."
670         https://www.w3.org/TR/css-transforms-1/
671
672         * layout/layouttree/LayoutBox.cpp:
673         (WebCore::Layout::Box::containingBlock const):
674
675 2019-01-17  Simon Fraser  <simon.fraser@apple.com>
676
677         ScrollingCoordinator: separate updating node geometry from node layers
678         https://bugs.webkit.org/show_bug.cgi?id=193527
679
680         Reviewed by Antti Koivisto.
681
682         Updating scrolling tree node layers happens in a different code path from updating geometry;
683         the former has to be post-flush, when GraphicsLayer has made tiled or structural layers.
684         Geometry only needs to be updated after layout, and soon we'll do this via compositing updates.
685         
686         We can also clean up the ScrollingCoordinator API and have a single function that updates
687         node layers (handling different node types), and separate functions for pushing viewport-constrained
688         and scrolling node geometry.
689
690         No observable behavior change.
691
692         * page/scrolling/AsyncScrollingCoordinator.cpp:
693         (WebCore::AsyncScrollingCoordinator::setNodeLayers):
694         (WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry):
695         (WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeGeometry):
696         (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode): Deleted.
697         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): Deleted.
698         (WebCore::AsyncScrollingCoordinator::updateNodeLayer): Deleted.
699         (WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints): Deleted.
700         * page/scrolling/AsyncScrollingCoordinator.h:
701         * page/scrolling/ScrollingCoordinator.h:
702         (WebCore::ScrollingCoordinator::setNodeLayers):
703         (WebCore::ScrollingCoordinator::setScrollingNodeGeometry):
704         (WebCore::ScrollingCoordinator::setViewportConstraintedNodeGeometry):
705         (WebCore::ScrollingCoordinator::updateNodeLayer): Deleted.
706         (WebCore::ScrollingCoordinator::updateNodeViewportConstraints): Deleted.
707         (WebCore::ScrollingCoordinator::updateFrameScrollingNode): Deleted.
708         (WebCore::ScrollingCoordinator::updateOverflowScrollingNode): Deleted.
709         * rendering/RenderLayerCompositor.cpp:
710         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
711         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
712         * rendering/RenderLayerCompositor.h:
713
714 2019-01-17  Zalan Bujtas  <zalan@apple.com>
715
716         [LFC][BFC][Quirk] Take body padding and border into account when stretching height.
717         https://bugs.webkit.org/show_bug.cgi?id=193528
718
719         Reviewed by Antti Koivisto.
720
721         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
722         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
723         * layout/displaytree/DisplayBox.h:
724         (WebCore::Display::Box::verticalBorder const):
725         (WebCore::Display::Box::horizontalBorder const):
726         (WebCore::Display::Box::verticalPadding const):
727         (WebCore::Display::Box::horizontalPadding const):
728         * page/FrameViewLayoutContext.cpp:
729         (WebCore::layoutUsingFormattingContext):
730
731 2019-01-17  Zalan Bujtas  <zalan@apple.com>
732
733         [LFC][BFC] For height computation, the bottom edge of the last line box value should not include top border/padding
734         https://bugs.webkit.org/show_bug.cgi?id=193520
735
736         Reviewed by Antti Koivisto.
737
738         This is similar to the other "10.6.3" cases. The bottom edge of the last inline box is in the coordinate systyem
739         of the containing block's border box (and for content height computation it needs to be mapped to the containing block's content box instead).
740
741         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
742         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
743
744 2019-01-16  Simon Fraser  <simon.fraser@apple.com>
745
746         Stub out scrolling tree classes for overflow scrolling nodes on macOS
747         https://bugs.webkit.org/show_bug.cgi?id=193524
748
749         Reviewed by Antti Koivisto.
750
751         Add an empty implementation of ScrollingTreeOverflowScrollingNodeMac for macOS. Change
752         ScrollingTreeMac::createScrollingTreeNode() to create these nodes.
753         
754         Minor refactor of RenderLayerCompositor::useCoordinatedScrollingForLayer() code to ask
755         the scrolling coordinator if it can coordinate scrolling for this layer; no behavior
756         change for existing code paths.
757
758         * SourcesCocoa.txt:
759         * WebCore.xcodeproj/project.pbxproj:
760         * page/scrolling/ScrollingCoordinator.cpp:
761         (WebCore::ScrollingCoordinator::coordinatesScrollingForOverflowLayer const):
762         * page/scrolling/ScrollingCoordinator.h:
763         * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
764         * page/scrolling/mac/ScrollingTreeMac.cpp:
765         (ScrollingTreeMac::createScrollingTreeNode):
766         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm.
767         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: Added.
768         (WebCore::ScrollingTreeOverflowScrollingNodeMac::create):
769         (WebCore::ScrollingTreeOverflowScrollingNodeMac::ScrollingTreeOverflowScrollingNodeMac):
770         (WebCore::ScrollingTreeOverflowScrollingNodeMac::~ScrollingTreeOverflowScrollingNodeMac):
771         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
772         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
773         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange):
774         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const):
775         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
776         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterDelegatedScroll):
777         * rendering/RenderLayer.cpp:
778         (WebCore::RenderLayer::usesAsyncScrolling const):
779         * rendering/RenderLayerCompositor.cpp:
780         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
781         * rendering/RenderLayerCompositor.h:
782
783 2019-01-16  Justin Fan  <justin_fan@apple.com>
784
785         [WebGPU] Update vertex-buffer-triangle-strip.html to actually use vertex buffer
786         https://bugs.webkit.org/show_bug.cgi?id=193473
787
788         Reviewed by Dean Jackson and Myles Maxfield.
789
790         Also, switch to using the inputSlot instead of the shaderLocation field, as this seems more correct. 
791         As of now I cannot determine an analog for WebGPU's shaderLocation in Metal. 
792
793         Test: Covered by vertex-buffer-triangle-strip.html. No change in behavior.
794
795         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
796         (WebCore::setInputStateForPipelineDescriptor): Use the inputSlot instead of shaderLocation as bufferIndex. 
797
798 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
799
800         [WHLSL] Add the function stage checker
801         https://bugs.webkit.org/show_bug.cgi?id=193479
802
803         Reviewed by Dean Jackson and Robin Morisset.
804
805         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/CheckNativeFuncStages.mjs into C++.
806
807         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
808         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
809
810         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
811         (WebCore::WHLSL::AST::CallExpression::function):
812         * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.cpp: Added.
813         (WebCore::WHLSL::FunctionStageChecker::FunctionStageChecker):
814         (WebCore::WHLSL::checkFunctionStages):
815         * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.h: Added.
816         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
817         (WebCore::WHLSL::Intrinsics::add):
818         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
819         (WebCore::WHLSL::Intrinsics::ddx const):
820         (WebCore::WHLSL::Intrinsics::ddy const):
821         (WebCore::WHLSL::Intrinsics::allMemoryBarrier const):
822         (WebCore::WHLSL::Intrinsics::deviceMemoryBarrier const):
823         (WebCore::WHLSL::Intrinsics::groupMemoryBarrier const):
824         (WebCore::WHLSL::Intrinsics::WTF_ARRAY_LENGTH):
825         * Sources.txt:
826         * WebCore.xcodeproj/project.pbxproj:
827
828 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
829
830         [WHLSL] Delete the 'restricted' keyword
831         https://bugs.webkit.org/show_bug.cgi?id=193469
832
833         Reviewed by Dean Jackson and Robin Morisset.
834
835         This change mirrors https://github.com/gpuweb/WHLSL/pull/304 in the reference implementation.
836
837         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
838         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
839
840         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h:
841         (WebCore::WHLSL::AST::FunctionDefinition::FunctionDefinition):
842         (WebCore::WHLSL::AST::FunctionDefinition::block):
843         (WebCore::WHLSL::AST::FunctionDefinition::restricted const): Deleted.
844         * Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h:
845         (WebCore::WHLSL::AST::NativeFunctionDeclaration::NativeFunctionDeclaration):
846         (WebCore::WHLSL::AST::NativeFunctionDeclaration::restricted const): Deleted.
847         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
848         (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
849         (WebCore::WHLSL::resolveWithOperatorLength):
850         (WebCore::WHLSL::resolveWithReferenceComparator):
851         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
852         (WebCore::WHLSL::resolveFunctionOverloadImpl):
853         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
854         (WebCore::WHLSL::synthesizeArrayOperatorLength):
855         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
856         (WebCore::WHLSL::synthesizeConstructors):
857         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
858         (WebCore::WHLSL::synthesizeEnumerationFunctions):
859         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
860         (WebCore::WHLSL::synthesizeStructureAccessors):
861
862 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
863
864         [WHLSL] Implement the recursion checker
865         https://bugs.webkit.org/show_bug.cgi?id=193436
866
867         Reviewed by Saam Barati.
868
869         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/RecursionChecker.mjs into C++.
870
871         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
872         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
873
874         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
875         (WebCore::WHLSL::AST::CallExpression::function):
876         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp.
877         (WebCore::WHLSL::checkRecursion):
878         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.h: Added.
879         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
880         * Sources.txt:
881         * WebCore.xcodeproj/project.pbxproj:
882
883 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
884
885         [WHLSL] Add the literal type checker
886         https://bugs.webkit.org/show_bug.cgi?id=193430
887
888         Reviewed by Dean Jackson.
889
890         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/LiteralTypeChecker.mjs into C++.
891
892         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
893         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
894
895         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
896         (WebCore::WHLSL::AST::FloatLiteralType::value const):
897         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
898         (WebCore::WHLSL::AST::IntegerLiteralType::value const):
899         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
900         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::value const):
901         * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp: Added.
902         (WebCore::WHLSL::getNativeTypeDeclaration):
903         (WebCore::WHLSL::LiteralTypeChecker::visit):
904         (WebCore::WHLSL::checkLiteralTypes):
905         * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h.
906         * Sources.txt:
907         * WebCore.xcodeproj/project.pbxproj:
908
909 2019-01-16  Zalan Bujtas  <zalan@apple.com>
910
911         [LFC][BFC] Inflow non-replaced used width should not be negative.
912         https://bugs.webkit.org/show_bug.cgi?id=193495
913
914         Reviewed by Antti Koivisto.
915
916         min-width (initial value 0) enforces non-negative used width. 
917
918         * layout/blockformatting/BlockFormattingContext.cpp:
919         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
920
921 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
922
923         [WHLSL] Add a handwritten parser
924         https://bugs.webkit.org/show_bug.cgi?id=192355
925
926         Reviewed by Dean Jackson.
927
928         The parser is a mechanical representation of WHLSL's ANTLR grammar at
929         https://github.com/gpuweb/WHLSL/blob/master/Spec/WHLSL.g4. The parser
930         uses Expected<> to return an appropriate Error string when parsing fails.
931
932         This patch doesn't include the AST nodes themselves - those are in
933         https://bugs.webkit.org/show_bug.cgi?id=192991. I split up the patch to
934         aid easier reviewing.
935
936         No new tests because the parser isn't hooked up yet.
937
938         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
939         (WebCore::WHLSL::Parser::Parser):
940         (WebCore::WHLSL::Parser::parse):
941         (WebCore::WHLSL::Parser::fail):
942         (WebCore::WHLSL::Parser::peek):
943         (WebCore::WHLSL::Parser::tryType):
944         (WebCore::WHLSL::Parser::tryTypes):
945         (WebCore::WHLSL::Parser::consumeType):
946         (WebCore::WHLSL::Parser::consumeTypes):
947         (WebCore::WHLSL::digitValue):
948         (WebCore::WHLSL::intLiteralToInt):
949         (WebCore::WHLSL::uintLiteralToUint):
950         (WebCore::WHLSL::floatLiteralToFloat):
951         (WebCore::WHLSL::Parser::consumeIntegralLiteral):
952         (WebCore::WHLSL::Parser::consumeNonNegativeIntegralLiteral):
953         (WebCore::WHLSL::recognizeSimpleUnsignedInteger):
954         (WebCore::WHLSL::Parser::parseConstantExpression):
955         (WebCore::WHLSL::Parser::parseTypeArgument):
956         (WebCore::WHLSL::Parser::parseTypeArguments):
957         (WebCore::WHLSL::Parser::parseTypeSuffixAbbreviated):
958         (WebCore::WHLSL::Parser::parseTypeSuffixNonAbbreviated):
959         (WebCore::WHLSL::Parser::parseAddressSpaceType):
960         (WebCore::WHLSL::Parser::parseNonAddressSpaceType):
961         (WebCore::WHLSL::Parser::parseType):
962         (WebCore::WHLSL::Parser::parseTypeDefinition):
963         (WebCore::WHLSL::Parser::parseBuiltInSemantic):
964         (WebCore::WHLSL::Parser::parseResourceSemantic):
965         (WebCore::WHLSL::Parser::parseSpecializationConstantSemantic):
966         (WebCore::WHLSL::Parser::parseStageInOutSemantic):
967         (WebCore::WHLSL::Parser::parseSemantic):
968         (WebCore::WHLSL::Parser::parseQualifiers):
969         (WebCore::WHLSL::Parser::parseStructureElement):
970         (WebCore::WHLSL::Parser::parseStructureDefinition):
971         (WebCore::WHLSL::Parser::parseEnumerationDefinition):
972         (WebCore::WHLSL::Parser::parseEnumerationMember):
973         (WebCore::WHLSL::Parser::parseNativeTypeDeclaration):
974         (WebCore::WHLSL::Parser::parseNumThreadsFunctionAttribute):
975         (WebCore::WHLSL::Parser::parseAttributeBlock):
976         (WebCore::WHLSL::Parser::parseParameter):
977         (WebCore::WHLSL::Parser::parseParameters):
978         (WebCore::WHLSL::Parser::parseFunctionDefinition):
979         (WebCore::WHLSL::Parser::parseEntryPointFunctionDeclaration):
980         (WebCore::WHLSL::Parser::parseRegularFunctionDeclaration):
981         (WebCore::WHLSL::Parser::parseOperatorFunctionDeclaration):
982         (WebCore::WHLSL::Parser::parseFunctionDeclaration):
983         (WebCore::WHLSL::Parser::parseNativeFunctionDeclaration):
984         (WebCore::WHLSL::Parser::parseBlock):
985         (WebCore::WHLSL::Parser::parseBlockBody):
986         (WebCore::WHLSL::Parser::parseIfStatement):
987         (WebCore::WHLSL::Parser::parseSwitchStatement):
988         (WebCore::WHLSL::Parser::parseSwitchCase):
989         (WebCore::WHLSL::Parser::parseForLoop):
990         (WebCore::WHLSL::Parser::parseWhileLoop):
991         (WebCore::WHLSL::Parser::parseDoWhileLoop):
992         (WebCore::WHLSL::Parser::parseVariableDeclaration):
993         (WebCore::WHLSL::Parser::parseVariableDeclarations):
994         (WebCore::WHLSL::Parser::parseStatement):
995         (WebCore::WHLSL::Parser::parseEffectfulExpression):
996         (WebCore::WHLSL::Parser::parseEffectfulAssignment):
997         (WebCore::WHLSL::Parser::parseEffectfulPrefix):
998         (WebCore::WHLSL::Parser::parseEffectfulSuffix):
999         (WebCore::WHLSL::Parser::parseLimitedSuffixOperator):
1000         (WebCore::WHLSL::Parser::parseSuffixOperator):
1001         (WebCore::WHLSL::Parser::parseExpression):
1002         (WebCore::WHLSL::Parser::parseTernaryConditional):
1003         (WebCore::WHLSL::Parser::parseAssignment):
1004         (WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
1005         (WebCore::WHLSL::Parser::parsePossibleLogicalBinaryOperation):
1006         (WebCore::WHLSL::Parser::parsePossibleRelationalBinaryOperation):
1007         (WebCore::WHLSL::Parser::parsePossibleShift):
1008         (WebCore::WHLSL::Parser::parsePossibleAdd):
1009         (WebCore::WHLSL::Parser::parsePossibleMultiply):
1010         (WebCore::WHLSL::Parser::parsePossiblePrefix):
1011         (WebCore::WHLSL::Parser::parsePossibleSuffix):
1012         (WebCore::WHLSL::Parser::parseCallExpression):
1013         (WebCore::WHLSL::Parser::parseTerm):
1014         * Modules/webgpu/WHLSL/WHLSLParser.h:
1015         (WebCore::WHLSL::Parser::Error::Error):
1016         (WebCore::WHLSL::Parser::backtrackingScope):
1017         (WebCore::WHLSL::Parser::SuffixExpression::SuffixExpression):
1018         (WebCore::WHLSL::Parser::SuffixExpression::operator bool const):
1019
1020 2019-01-16  Sihui Liu  <sihui_liu@apple.com>
1021
1022         IndexedDB: UniqueIDBDatabase should not be freed if the database task queue is not empty.
1023         https://bugs.webkit.org/show_bug.cgi?id=193093
1024
1025         Reviewed by Brady Eidson.
1026
1027         performUnconditionalDeleteBackingStore killed the database task queue immediately, but performPrefetchCursor
1028         task may be scheduled behind performUnconditionalDeleteBackingStore on database thread.
1029
1030         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1031         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
1032         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
1033         (WebCore::IDBServer::UniqueIDBDatabase::isDoneWithHardClose):
1034
1035 2019-01-16  Alex Christensen  <achristensen@webkit.org>
1036
1037         Internal build fix.
1038
1039         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1040         (WebCore::layerContentsFormat):
1041
1042 2019-01-16  Youenn Fablet  <youenn@apple.com>
1043
1044         ServiceWorkerContainer is leaking due to a ref cycle
1045         https://bugs.webkit.org/show_bug.cgi?id=193462
1046         <rdar://problem/47026303>
1047
1048         Reviewed by Brady Eidson.
1049
1050         ServiceWorkerContainer keeps a reference to its ready promise.
1051         The ready promise keeps a ref to its value which is a ServiceWorkerRegistration.
1052         ServiceWorkerRegistration keeps a ref to ServiceWorkerContainer.
1053
1054         To break the reference cycle, set the ready promise to zero when ServiceWorkerContainer is stopped.
1055
1056         Covered by imported/w3c/web-platform-tests/service-workers/service-worker/ready.https.html no longer leaking.
1057
1058         * workers/service/ServiceWorkerContainer.cpp:
1059         (WebCore::ServiceWorkerContainer::stop):
1060
1061 2019-01-15  Simon Fraser  <simon.fraser@apple.com>
1062
1063         Make didCommitChangesForLayer() explicitly about the platform layer changing because of tile/non-tile swapping
1064         https://bugs.webkit.org/show_bug.cgi?id=193290
1065
1066         Reviewed by Tim Horton.
1067
1068         RenderLayerCompositor::didFlushChangesForLayer() triggers updates scrolling tree nodes for
1069         the flushed layer, but it's not clear what has changed at this point.
1070
1071         didCommitChangesForLayer()/didFlushChangesForLayer() were added to explicitly handle the
1072         case where the underlying platform layer for a GraphicsLayer changes because the layer swaps
1073         between tiled and non-tiled, and structural layer changes; we need to push the new layer to
1074         the scrolling tree because it operates on platform layers. So the only work that
1075         didFlushChangesForLayer() should do is to update layers on scrolling tree nodes; it doesn't
1076         need to do any geometry updating. Move towards that goal by renaming this callback to
1077         didChangePlatformLayerForLayer() to make its function more explicit.
1078
1079         * platform/graphics/GraphicsLayerClient.h:
1080         (WebCore::GraphicsLayerClient::didChangePlatformLayerForLayer):
1081         (WebCore::GraphicsLayerClient::didCommitChangesForLayer const): Deleted.
1082         * platform/graphics/ca/GraphicsLayerCA.cpp:
1083         (WebCore::GraphicsLayerCA::flushCompositingStateForThisLayerOnly):
1084         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
1085         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
1086         * platform/graphics/ca/GraphicsLayerCA.h:
1087         * rendering/RenderLayerBacking.cpp:
1088         (WebCore::RenderLayerBacking::didChangePlatformLayerForLayer):
1089         (WebCore::RenderLayerBacking::didCommitChangesForLayer const): Deleted.
1090         * rendering/RenderLayerBacking.h:
1091         * rendering/RenderLayerCompositor.cpp:
1092         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
1093         (WebCore::LegacyWebKitScrollingLayerCoordinator::didChangePlatformLayerForLayer):
1094         (WebCore::RenderLayerCompositor::didFlushChangesForLayer): Deleted.
1095         (WebCore::RenderLayerCompositor::didCommitChangesForLayer const): Deleted.
1096         (WebCore::LegacyWebKitScrollingLayerCoordinator::didFlushChangesForLayer): Deleted.
1097         * rendering/RenderLayerCompositor.h:
1098
1099 2019-01-16  Chris Dumez  <cdumez@apple.com>
1100
1101         Regression(PSON) View becomes blank after click a cross-site download link
1102         https://bugs.webkit.org/show_bug.cgi?id=193361
1103         <rdar://problem/47099573>
1104
1105         Reviewed by Geoffrey Garen.
1106
1107         * loader/FrameLoader.cpp:
1108         (WebCore::FrameLoader::commitProvisionalLoad):
1109         When restoring from PageCache, make sure we notify the client that the load was committed
1110         *before* we tell it that the navigation is complete. This would confuse the ProvisionalPageProxy
1111         logic in the UIProcess.
1112
1113 2019-01-16  Devin Rousso  <drousso@apple.com>
1114
1115         Web Inspector: extend overlay element bounds lines to the right/below as well
1116         https://bugs.webkit.org/show_bug.cgi?id=193336
1117
1118         Reviewed by Matt Baker.
1119
1120         This patch is purely a visual change for WebInspector, and doesn't affect anything else.
1121
1122         * inspector/InspectorOverlayPage.js:
1123         (_drawBounds):
1124
1125 2019-01-16  Youenn Fablet  <youenn@apple.com>
1126
1127         Prevent WorkerRunLoop::runInMode from spinning in nested cases
1128         https://bugs.webkit.org/show_bug.cgi?id=193359
1129         <rdar://problem/46345353>
1130
1131         Reviewed by Joseph Pecoraro.
1132
1133         Speculative fix for some cases where service worker is spinning and consuming a lot of CPU.
1134         The hypothesis is that:
1135         - Service Worker is checking for its script freshness through WorkerScriptLoader.
1136         This triggers the worker run loop to be nested.
1137         - The run loop timer is active and needs to fire immediately.
1138         The hypothesis is that this happens in some cases like restarting a device after sleep mode.
1139
1140         WorkerRunLoop::runInMode will then compute a 0 timeout value for getting a message.
1141         This will trigger a timeout while waiting for the message queue.
1142         Since the run loop is nested,  the run loop timer will not be able to fire,
1143         and it will keep ask to fire immediately.
1144         runInMode will return timeout as a result and WorkerRunLoop::run will call it immediately.
1145
1146         The fix is to prevent the shared timer to fire only when the run loop is being debugged through the web inspector.
1147         We compute this by checking the run loop mode as debuggerMode().
1148         Did some refactoring by introducing helper routines for running the loop and posting task in debugger mode.
1149
1150         * inspector/WorkerScriptDebugServer.cpp:
1151         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
1152         * workers/WorkerInspectorProxy.cpp:
1153         (WebCore::WorkerInspectorProxy::resumeWorkerIfPaused):
1154         (WebCore::WorkerInspectorProxy::connectToWorkerInspectorController):
1155         (WebCore::WorkerInspectorProxy::disconnectFromWorkerInspectorController):
1156         (WebCore::WorkerInspectorProxy::sendMessageToWorkerInspectorController):
1157         * workers/WorkerRunLoop.cpp:
1158         (WebCore::ModePredicate::ModePredicate):
1159         (WebCore::WorkerRunLoop::WorkerRunLoop):
1160         (WebCore::debuggerMode):
1161         (WebCore::RunLoopSetup::RunLoopSetup):
1162         (WebCore::RunLoopSetup::~RunLoopSetup):
1163         (WebCore::WorkerRunLoop::run):
1164         (WebCore::WorkerRunLoop::runInDebuggerMode):
1165         (WebCore::WorkerRunLoop::runInMode):
1166         (WebCore::WorkerRunLoop::Task::performTask):
1167         * workers/WorkerRunLoop.h:
1168         (WebCore::WorkerRunLoop::isBeingDebugged const):
1169         * workers/WorkerThread.cpp:
1170         (WebCore::WorkerThread::startRunningDebuggerTasks):
1171         * workers/service/context/ServiceWorkerInspectorProxy.cpp:
1172         (WebCore::ServiceWorkerInspectorProxy::connectToWorker):
1173         (WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker):
1174         (WebCore::ServiceWorkerInspectorProxy::sendMessageToWorker):
1175
1176 2019-01-16  Sihui Liu  <sihui_liu@apple.com>
1177
1178         IndexedDB: leak WebIDBConnectionToClient for retain cycle
1179         https://bugs.webkit.org/show_bug.cgi?id=193097
1180         <rdar://problem/46899601>
1181
1182         Reviewed by David Kilzer.
1183
1184         Fix API test failure after r239887. After removing the retain cycle, IDBConnectionToClient will no longer live 
1185         forever so make sure it is not destructed before UniqueIDBDatabaseConnection unregisters itself.
1186
1187         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
1188         (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
1189         (WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):
1190         (WebCore::IDBServer::UniqueIDBDatabaseConnection::fireVersionChangeEvent):
1191         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
1192         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCommitTransaction):
1193         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCreateObjectStore):
1194         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteObjectStore):
1195         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameObjectStore):
1196         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didClearObjectStore):
1197         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCreateIndex):
1198         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteIndex):
1199         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameIndex):
1200         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
1201
1202 2019-01-16  Antti Koivisto  <antti@apple.com>
1203
1204         Add more assertions to find root cause for release assert hit in StyleResolver
1205         https://bugs.webkit.org/show_bug.cgi?id=193488
1206         <rdar://problem/30983040>
1207
1208         Reviewed by Zalan Bujtas.
1209
1210         * css/StyleResolver.cpp:
1211         (WebCore::StyleResolver::~StyleResolver):
1212
1213         Release assert we are not resolving tree style.
1214
1215         * dom/Document.cpp:
1216         (WebCore::Document::setIsResolvingTreeStyle):
1217         * dom/Document.h:
1218         (WebCore::Document::isResolvingTreeStyle const):
1219         * style/StyleTreeResolver.cpp:
1220         (WebCore::Style::TreeResolver::Scope::Scope):
1221         (WebCore::Style::TreeResolver::Scope::~Scope):
1222
1223         Set isResolvingTreeStyle bit when we have a tree resolver scope.
1224
1225 2019-01-16  Zalan Bujtas  <zalan@apple.com>
1226
1227         [LFC][Out-of-flow] Set used vertical margin values when top/height/bottom are non-auto.
1228         https://bugs.webkit.org/show_bug.cgi?id=193470
1229
1230         Reviewed by Antti Koivisto.
1231
1232         Non-auto vertical margin values (which is mostly the case) should be set as used values.
1233
1234         Test: fast/block/block-only/non-auto-top-bottom-height-with-margins.html
1235
1236         * layout/FormattingContextGeometry.cpp:
1237         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1238
1239 2019-01-16  Alan Kinsley  <zalan@apple.com>
1240
1241         [LFC] Adjust margin box verification.
1242         https://bugs.webkit.org/show_bug.cgi?id=193482
1243
1244         Reviewed by Antti Koivisto.
1245
1246         In certain cases, like out-of-flow boxes with margin auto, marginBoxRect() returns 0. It's clearly incorrect,
1247         so let's check the individual margin values instead (and at this point we know that all other boxes match).
1248
1249         Test: fast/block/block-only/non-auto-top-bottom-height-with-auto-margins.html
1250
1251         * layout/Verification.cpp:
1252         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
1253
1254 2019-01-16  Zan Dobersek  <zdobersek@igalia.com>
1255
1256         [FreeType] Cache the zero-width space glyph in GlyphPage::fill()
1257         https://bugs.webkit.org/show_bug.cgi?id=193485
1258
1259         Reviewed by Carlos Garcia Campos.
1260
1261         In FreeType's implementation of GlyphPage::fill(), we can cache the
1262         zero-width space glyph upon first retrieval through the
1263         FcFreeTypeCharIndex() entrypoint, avoiding any subsequent calls
1264         for other ignorable characters.
1265
1266         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
1267         (WebCore::GlyphPage::fill):
1268
1269 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
1270
1271         [WHLSL] Add the high zombie finder
1272         https://bugs.webkit.org/show_bug.cgi?id=193432
1273
1274         Reviewed by Robin Morisset and Saam Barati.
1275
1276         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/HighZombieFinder.mjs into C++.
1277
1278         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
1279         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
1280
1281         * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp: Added.
1282         (WebCore::WHLSL::findHighZombies):
1283         * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.h: Added.
1284         * Sources.txt:
1285         * WebCore.xcodeproj/project.pbxproj:
1286
1287 2019-01-15  Fujii Hironori  <Hironori.Fujii@sony.com>
1288
1289         Unreviewed WinCairo build fix.
1290
1291         * platform/network/curl/ResourceHandleCurl.cpp:
1292         (WebCore::ResourceHandle::createCurlRequest):
1293         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
1294         (WebCore::ResourceHandle::receivedCredential):
1295         (WebCore::ResourceHandle::getCredential):
1296
1297 2019-01-15  Alex Christensen  <achristensen@webkit.org>
1298
1299         Reduce use of NetworkStorageSession::defaultStorageSession in WebCore
1300         https://bugs.webkit.org/show_bug.cgi?id=193368
1301
1302         Reviewed by Geoff Garen.
1303
1304         The NetworkStorageSession ownership needs to move to the WebKit/WebKitLegacy layer instead of being a process-global static map.
1305
1306         * loader/EmptyClients.cpp:
1307         * platform/network/CredentialStorage.cpp:
1308         (WebCore::CredentialStorage::defaultCredentialStorage): Deleted.
1309         * platform/network/CredentialStorage.h:
1310         * platform/network/NetworkStorageSession.h:
1311         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1312         (WebCore::NetworkStorageSession::switchToNewTestingSession):
1313         (WebCore::NetworkStorageSession::ensureSession):
1314         * platform/network/cf/NetworkStorageSessionCFNetWin.cpp:
1315         (WebCore::createPrivateStorageSession):
1316         * platform/network/curl/ResourceHandleCurl.cpp:
1317         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
1318         (WebCore::ResourceHandle::receivedCredential):
1319         (WebCore::ResourceHandle::getCredential):
1320
1321 2019-01-15  Ryosuke Niwa  <rniwa@webkit.org>
1322
1323         VisualViewport API should be updated upon opening of keyboard
1324         https://bugs.webkit.org/show_bug.cgi?id=193475
1325
1326         Reviewed by Simon Fraser.
1327
1328         Added a function to update the visual viewport API and schedule a resize event to FrameView.
1329
1330         Test: fast/visual-viewport/ios/resize-event-for-keyboard.html
1331
1332         * page/FrameView.cpp:
1333         (WebCore::FrameView::didUpdateViewportOverrideRects):
1334         * page/FrameView.h:
1335
1336 2019-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
1337
1338         Fix build after r240018
1339         https://bugs.webkit.org/show_bug.cgi?id=193434
1340
1341         Unreviewed.
1342
1343         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:
1344         (WebCore::WHLSL::checkLoops):
1345         (WebCore::WHLSL::findHighZombies): Deleted.
1346         * Modules/webgpu/WHLSL/WHLSLLoopChecker.h:
1347
1348 2019-01-15  Megan Gardner  <megan_gardner@apple.com>
1349
1350         Add Reveal support in iOSMac
1351         https://bugs.webkit.org/show_bug.cgi?id=193408
1352         <rdar://problem/47300699>
1353
1354         Reviewed by Tim Horton.
1355
1356         iOSMac and Reveal are currently not testable.
1357
1358         Add support for the reveal SPI specifically for iOSMac.
1359         Show the controller when called, and implement the delegate to 
1360         correctly re-paint the content with the auto-generated highlight from
1361         the reveal framework.
1362
1363         * Configurations/WebCore.xcconfig:
1364         * editing/cocoa/DictionaryLookup.mm:
1365         (-[WebRevealHighlight initWithHighlightRect:view:]):
1366         (-[WebRevealHighlight setImage:]):
1367         (-[WebRevealHighlight highlightRectsForItem:]):
1368         (-[WebRevealHighlight startHighlightingItem:]):
1369         (-[WebRevealHighlight highlightItem:withProgress:]):
1370         (-[WebRevealHighlight completeHighlightingItem:]):
1371         (-[WebRevealHighlight stopHighlightingItem:]):
1372         (-[WebRevealHighlight highlightRangeChangedForItem:]):
1373         (-[WebRevealHighlight highlighting]):
1374         (-[WebRevealHighlight drawHighlightContentForItem:context:]):
1375         (WebCore::showPopupOrCreateAnimationController):
1376         (WebCore::DictionaryLookup::showPopup):
1377         * editing/mac/DictionaryLookup.h:
1378
1379 2019-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
1380
1381         [WHLSL] Add ending namespace comments to make namespace boundaries more clear
1382         https://bugs.webkit.org/show_bug.cgi?id=193471
1383
1384         Reviewed by Saam Barati.
1385
1386         This patch only adds the comments to the files that are too long to fit on a single screen in my editor.
1387
1388         No new tests because there is no behavior change.
1389
1390         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
1391         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1392         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
1393         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
1394         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
1395         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
1396         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
1397         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
1398         * Modules/webgpu/WHLSL/WHLSLLexer.h:
1399         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:
1400         * Modules/webgpu/WHLSL/WHLSLNameContext.cpp:
1401         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
1402         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
1403         * Modules/webgpu/WHLSL/WHLSLParser.h:
1404         * Modules/webgpu/WHLSL/WHLSLProgram.h:
1405         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
1406         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
1407         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
1408         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
1409         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
1410         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
1411         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
1412         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
1413
1414 2019-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
1415
1416         [WHLSL] Implement the loop checker
1417         https://bugs.webkit.org/show_bug.cgi?id=193434
1418
1419         Reviewed by Saam Barati.
1420
1421         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/LoopChecker.mjs into C++.
1422
1423         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
1424         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
1425
1426         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp: Added.
1427         (WebCore::WHLSL::findHighZombies):
1428         * Modules/webgpu/WHLSL/WHLSLLoopChecker.h: Added.
1429         * Sources.txt:
1430         * WebCore.xcodeproj/project.pbxproj:
1431
1432 2019-01-15  Chris Dumez  <cdumez@apple.com>
1433
1434         Unreviewed, rolling out r239993, r239995, r239997, and
1435         r239999.
1436
1437         Caused assertions under
1438         ViewGestureController::disconnectFromProcess()
1439
1440         Reverted changesets:
1441
1442         "Regression(PSON) View becomes blank after click a cross-site
1443         download link"
1444         https://bugs.webkit.org/show_bug.cgi?id=193361
1445         https://trac.webkit.org/changeset/239993
1446
1447         "Unreviewed iOS build fix after r239993."
1448         https://trac.webkit.org/changeset/239995
1449
1450         "Fix iOS build after r239993"
1451         https://bugs.webkit.org/show_bug.cgi?id=193361
1452         https://trac.webkit.org/changeset/239997
1453
1454         "Unreviewed, revert part of r239997 as it is not needed to fix
1455         the build."
1456         https://trac.webkit.org/changeset/239999
1457
1458 2019-01-15  Alex Christensen  <achristensen@webkit.org>
1459
1460         Stop using CookiesStrategy
1461         https://bugs.webkit.org/show_bug.cgi?id=161106
1462
1463         Reviewed by Don Olmstead and Antti Koivisto.
1464
1465         CookiesStrategy is process-global and makes it difficult to switch NetworkStorageSession from having a process-global map.
1466         Instead, use a CookieJar object in the WebProcess.  This has the additional benefit of making it more clear which code
1467         is used in the WebProcess and which code is used in the NetworkProcess.
1468
1469         * Modules/beacon/NavigatorBeacon.cpp:
1470         * Modules/websockets/WebSocketChannel.cpp:
1471         (WebCore::WebSocketChannel::processBuffer):
1472         * Modules/websockets/WebSocketHandshake.cpp:
1473         (WebCore::WebSocketHandshake::clientHandshakeRequest const):
1474         (WebCore::WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy const):
1475         * WebCore.xcodeproj/project.pbxproj:
1476         * css/StyleRuleImport.cpp:
1477         (WebCore::StyleRuleImport::requestStyleSheet):
1478         * dom/Document.cpp:
1479         (WebCore::Document::cookie):
1480         (WebCore::Document::setCookie):
1481         * html/HTMLMediaElement.cpp:
1482         (WebCore::HTMLMediaElement::mediaPlayerGetRawCookies const):
1483         * inspector/agents/InspectorPageAgent.cpp:
1484         (WebCore::InspectorPageAgent::getCookies):
1485         (WebCore::InspectorPageAgent::deleteCookie):
1486         * loader/CookieJar.cpp:
1487         (WebCore::CookieJar::shouldIncludeSecureCookies):
1488         (WebCore::CookieJar::sameSiteInfo):
1489         (WebCore::CookieJar::create):
1490         (WebCore::CookieJar::cookies const):
1491         (WebCore::CookieJar::cookieRequestHeaderFieldProxy):
1492         (WebCore::CookieJar::setCookies):
1493         (WebCore::CookieJar::cookiesEnabled const):
1494         (WebCore::CookieJar::cookieRequestHeaderFieldValue const):
1495         (WebCore::CookieJar::getRawCookies const):
1496         (WebCore::CookieJar::deleteCookie):
1497         (WebCore::shouldIncludeSecureCookies): Deleted.
1498         (WebCore::sameSiteInfo): Deleted.
1499         (WebCore::cookies): Deleted.
1500         (WebCore::cookieRequestHeaderFieldProxy): Deleted.
1501         (WebCore::setCookies): Deleted.
1502         (WebCore::cookiesEnabled): Deleted.
1503         (WebCore::cookieRequestHeaderFieldValue): Deleted.
1504         (WebCore::getRawCookies): Deleted.
1505         (WebCore::deleteCookie): Deleted.
1506         * loader/CookieJar.h:
1507         * loader/EmptyClients.cpp:
1508         (WebCore::pageConfigurationWithEmptyClients):
1509         * loader/ImageLoader.cpp:
1510         (WebCore::ImageLoader::updateFromElement):
1511         * loader/cache/CachedApplicationManifest.cpp:
1512         (WebCore::CachedApplicationManifest::CachedApplicationManifest):
1513         * loader/cache/CachedApplicationManifest.h:
1514         * loader/cache/CachedCSSStyleSheet.cpp:
1515         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
1516         * loader/cache/CachedCSSStyleSheet.h:
1517         * loader/cache/CachedFont.cpp:
1518         (WebCore::CachedFont::CachedFont):
1519         * loader/cache/CachedFont.h:
1520         * loader/cache/CachedImage.cpp:
1521         (WebCore::CachedImage::CachedImage):
1522         * loader/cache/CachedImage.h:
1523         * loader/cache/CachedRawResource.cpp:
1524         (WebCore::CachedRawResource::CachedRawResource):
1525         * loader/cache/CachedRawResource.h:
1526         * loader/cache/CachedResource.cpp:
1527         (WebCore::CachedResource::CachedResource):
1528         (WebCore::CachedResource::setResponse):
1529         (WebCore::CachedResource::varyHeaderValuesMatch):
1530         * loader/cache/CachedResource.h:
1531         (WebCore::CachedResource::cookieJar const):
1532         * loader/cache/CachedResourceLoader.cpp:
1533         (WebCore::createResource):
1534         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
1535         (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest):
1536         (WebCore::CachedResourceLoader::requestResource):
1537         (WebCore::CachedResourceLoader::revalidateResource):
1538         (WebCore::CachedResourceLoader::loadResource):
1539         * loader/cache/CachedResourceLoader.h:
1540         * loader/cache/CachedSVGDocument.cpp:
1541         (WebCore::CachedSVGDocument::CachedSVGDocument):
1542         * loader/cache/CachedSVGDocument.h:
1543         * loader/cache/CachedSVGFont.cpp:
1544         (WebCore::CachedSVGFont::CachedSVGFont):
1545         * loader/cache/CachedSVGFont.h:
1546         * loader/cache/CachedScript.cpp:
1547         (WebCore::CachedScript::CachedScript):
1548         * loader/cache/CachedScript.h:
1549         * loader/cache/CachedTextTrack.cpp:
1550         (WebCore::CachedTextTrack::CachedTextTrack):
1551         * loader/cache/CachedTextTrack.h:
1552         * loader/cache/CachedXSLStyleSheet.cpp:
1553         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
1554         * loader/cache/CachedXSLStyleSheet.h:
1555         * loader/cache/MemoryCache.cpp:
1556         (WebCore::MemoryCache::addImageToCache):
1557         * loader/cache/MemoryCache.h:
1558         * page/Navigator.cpp:
1559         (WebCore::Navigator::cookieEnabled const):
1560         * page/Page.cpp:
1561         (WebCore::Page::Page):
1562         * page/Page.h:
1563         (WebCore::Page::cookieJar):
1564         * page/PageConfiguration.cpp:
1565         (WebCore::PageConfiguration::PageConfiguration):
1566         * page/PageConfiguration.h:
1567         * platform/CookiesStrategy.h: Removed.
1568         * platform/PlatformStrategies.h:
1569         (WebCore::PlatformStrategies::cookiesStrategy): Deleted.
1570         * platform/network/CacheValidation.cpp:
1571         (WebCore::cookieRequestHeaderFieldValue):
1572         (WebCore::collectVaryingRequestHeaders):
1573         (WebCore::verifyVaryingRequestHeaders):
1574         * platform/network/CacheValidation.h:
1575         * platform/network/CookieRequestHeaderFieldProxy.h:
1576         * platform/network/cf/NetworkStorageSessionCFNetWin.cpp:
1577         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
1578         * platform/network/curl/ResourceHandleCurl.cpp:
1579         * rendering/RenderSnapshottedPlugIn.cpp:
1580         (WebCore::RenderSnapshottedPlugIn::updateSnapshot):
1581         * testing/Internals.cpp:
1582         (WebCore::Internals::getCookies const):
1583
1584 2019-01-15  Simon Fraser  <simon.fraser@apple.com>
1585
1586         Animations should only trigger layer recomposite when necessary
1587         https://bugs.webkit.org/show_bug.cgi?id=193450
1588
1589         Reviewed by Antoine Quint.
1590
1591         Animations only need to trigger compositing updates when their states change in a way
1592         that affects compositing. RenderLayerCompositor::requiresCompositingForAnimation() checks for
1593         running animations of properties that can be accelerated, so this patch fixes the legacy
1594         animation logic to only set 'shouldRecompositeLayer' in TreeResolver::createAnimatedElementUpdate()
1595         when the running state of such an animation changes.
1596
1597         ImplicitAnimation::animate() and KeyframeAnimation::animate() now return OptionSet<AnimateChange>.
1598         This contains information about whether the running state changed, so CompositeAnimation::animate()
1599         asks about whether the running state of an accelerated property changed, and returns this in
1600         the AnimationUpdate result.
1601
1602         * page/animation/AnimationBase.h:
1603         (WebCore::AnimationBase::isPausedState):
1604         (WebCore::AnimationBase::isRunningState):
1605         (WebCore::AnimationBase::inPausedState const):
1606         (WebCore::AnimationBase::inRunningState const):
1607         (WebCore::AnimationBase::isAnimatingProperty const):
1608         * page/animation/CSSAnimationController.h:
1609         * page/animation/CompositeAnimation.cpp:
1610         (WebCore::CompositeAnimation::animate):
1611         * page/animation/ImplicitAnimation.cpp:
1612         (WebCore::ImplicitAnimation::animate):
1613         (WebCore::ImplicitAnimation::affectsAcceleratedProperty const):
1614         * page/animation/ImplicitAnimation.h:
1615         * page/animation/KeyframeAnimation.cpp:
1616         (WebCore::KeyframeAnimation::KeyframeAnimation):
1617         (WebCore::KeyframeAnimation::animate):
1618         (WebCore::KeyframeAnimation::computeStackingContextImpact): Deleted.
1619         * page/animation/KeyframeAnimation.h:
1620         * style/StyleTreeResolver.cpp:
1621         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1622
1623 2019-01-15  Simon Fraser  <simon.fraser@apple.com>
1624
1625         Clean up code related to the updating of Dashboard and touch event regions
1626         https://bugs.webkit.org/show_bug.cgi?id=193460
1627
1628         Reviewed by Zalan Bujtas.
1629
1630         In preparation for layout testing that can count the number of event region
1631         updates, move the code related to updating "annotated" (Dashboard) regions, and
1632         touch event regions into bottleneck functions in Document.
1633         
1634         Updating these two kinds of regions is generally similar, but there are some code paths
1635         that eagerly update annotated regions.
1636
1637         No behavior change.
1638
1639         * dom/Document.cpp:
1640         (WebCore::Document::updateAnnotatedRegions): Moved from FrameView.
1641         (WebCore::Document::invalidateRenderingDependentRegions):
1642         (WebCore::Document::invalidateScrollbarDependentRegions):
1643         (WebCore::Document::updateZOrderDependentRegions):
1644         * dom/Document.h:
1645         (WebCore::Document::setAnnotatedRegionsDirty):
1646         (WebCore::Document::annotatedRegionsDirty const):
1647         (WebCore::Document::hasAnnotatedRegions const):
1648         * page/FrameView.cpp:
1649         (WebCore::FrameView::didLayout):
1650         (WebCore::FrameView::didPaintContents):
1651         (WebCore::FrameView::updateAnnotatedRegions): Deleted.
1652         * page/FrameView.h:
1653         * rendering/RenderElement.cpp: Drive-by header cleanup.
1654         (WebCore::RenderElement::styleWillChange):
1655         * rendering/RenderLayer.cpp:
1656         (WebCore::RenderLayer::scrollTo):
1657         (WebCore::RenderLayer::setHasHorizontalScrollbar):
1658         (WebCore::RenderLayer::setHasVerticalScrollbar):
1659         (WebCore::RenderLayer::updateScrollbarsAfterLayout):
1660         (WebCore::RenderLayer::calculateClipRects const):
1661         * rendering/RenderListBox.cpp:
1662         (WebCore::RenderListBox::setHasVerticalScrollbar):
1663
1664 2019-01-15  David Kilzer  <ddkilzer@apple.com>
1665
1666         Let Xcode have its way with the WebCore project
1667
1668         * WebCore.xcodeproj/project.pbxproj:
1669         - Change the lastKnownFileType for *.gperf and *.idl files from
1670           "file" to "text".
1671         - Resort source files into UUID order.
1672
1673 2019-01-15  Youenn Fablet  <youenn@apple.com>
1674
1675         Correctly handle rotation for local video playback
1676         https://bugs.webkit.org/show_bug.cgi?id=193412
1677
1678         Reviewed by Eric Carlson.
1679
1680         Update AVVideoCaptureSource to compute the size given to settings after rotating the sample.
1681         This ensures computing the size of video elements appropriately.
1682         Also makes sure to notify observers of size change whenever rotation happens as settings() call will provide a different size.
1683         Covered by manual testing as we do not have yet emulation of local capture with rotation.
1684
1685         * platform/mediastream/RealtimeMediaSource.cpp:
1686         (WebCore::RealtimeMediaSource::setIntrinsicSize):
1687         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1688         (WebCore::AVVideoCaptureSource::settings):
1689         (WebCore::AVVideoCaptureSource::computeSampleRotation):
1690
1691 2019-01-15  Chris Dumez  <cdumez@apple.com>
1692
1693         Regression(PSON) View becomes blank after click a cross-site download link
1694         https://bugs.webkit.org/show_bug.cgi?id=193361
1695         <rdar://problem/47099573>
1696
1697         Reviewed by Geoff Garen.
1698
1699         * loader/FrameLoader.cpp:
1700         (WebCore::FrameLoader::commitProvisionalLoad):
1701         When restoring from PageCache, make sure we notify the client that the load was committed
1702         *before* we tell it that the navigation is complete. This would confuse the ProvisionalPageProxy
1703         logic in the UIProcess.
1704
1705 2019-01-15  Zalan Bujtas  <zalan@apple.com>
1706
1707         [LFC][Out-of-flow] Ignore bottom when the vertical values are over-constrained
1708         https://bugs.webkit.org/show_bug.cgi?id=193448
1709
1710         Reviewed by Antti Koivisto.
1711
1712         Add missing check. We should only resolve auto values. 
1713
1714         Test: fast/block/block-only/non-auto-top-bottom-left-right-widht-height-out-of-flow.html
1715
1716         * layout/FormattingContextGeometry.cpp:
1717         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1718
1719 2019-01-15  Devin Rousso  <drousso@apple.com>
1720
1721         Web Inspector: Audit: provide a way to determine whether a give node has event listeners
1722         https://bugs.webkit.org/show_bug.cgi?id=193226
1723         <rdar://problem/46800005>
1724
1725         Reviewed by Joseph Pecoraro.
1726
1727         Test: inspector/audit/run-dom.html
1728
1729         * inspector/InspectorAuditDOMObject.idl:
1730         * inspector/InspectorAuditDOMObject.h:
1731         * inspector/InspectorAuditDOMObject.cpp:
1732         (WebCore::InspectorAuditDOMObject::hasEventListeners): Added.
1733
1734 2019-01-15  Devin Rousso  <drousso@apple.com>
1735
1736         Web Inspector: Audit: provide a way to query for all nodes with a given computed Accessibility role
1737         https://bugs.webkit.org/show_bug.cgi?id=193228
1738         <rdar://problem/46787787>
1739
1740         Reviewed by Joseph Pecoraro.
1741
1742         Test: inspector/audit/run-accessibility.html
1743
1744         * inspector/InspectorAuditAccessibilityObject.idl:
1745         * inspector/InspectorAuditAccessibilityObject.h:
1746         * inspector/InspectorAuditAccessibilityObject.cpp:
1747         (WebCore::accessiblityObjectForNode): Added.
1748         (WebCore::InspectorAuditAccessibilityObject::getElementsByComputedRole): Added.
1749
1750 2019-01-15  Simon Fraser  <simon.fraser@apple.com>
1751
1752         Simplify isRunningAnimationOnRenderer()
1753         https://bugs.webkit.org/show_bug.cgi?id=193435
1754
1755         Reviewed by Darin Adler.
1756
1757         All callers of CSSAnimationController::isRunningAnimationOnRenderer() pass AnimationBase::Running | AnimationBase::Paused,
1758         so we can remove the parameter and just hardcode this behavior.
1759         
1760         This will simplify a later patch that needs to consider state changes between running and not running.
1761         
1762         No behavior change.
1763
1764         * page/animation/AnimationBase.h:
1765         (WebCore::AnimationBase::isAnimatingProperty const):
1766         * page/animation/CSSAnimationController.cpp:
1767         (WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer const):
1768         (WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer const):
1769         (WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation const):
1770         (WebCore::CSSAnimationController::isRunningAnimationOnRenderer const):
1771         (WebCore::CSSAnimationController::isRunningAcceleratedAnimationOnRenderer const):
1772         * page/animation/CSSAnimationController.h:
1773         * page/animation/CSSAnimationControllerPrivate.h:
1774         * page/animation/CompositeAnimation.cpp:
1775         (WebCore::CompositeAnimation::isAnimatingProperty const):
1776         * page/animation/CompositeAnimation.h:
1777         * rendering/RenderLayer.cpp:
1778         (WebCore::RenderLayer::currentTransform const):
1779         * rendering/RenderLayerBacking.cpp:
1780         (WebCore::RenderLayerBacking::updateGeometry):
1781         * rendering/RenderLayerCompositor.cpp:
1782         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
1783         (WebCore::RenderLayerCompositor::isRunningTransformAnimation const):
1784
1785 2019-01-15  Antti Koivisto  <antti@apple.com>
1786
1787         Remove unused fields from Scrollbar
1788         https://bugs.webkit.org/show_bug.cgi?id=193442
1789
1790         Reviewed by Zalan Bujtas.
1791
1792         * platform/Scrollbar.cpp:
1793         (WebCore::Scrollbar::Scrollbar):
1794         * platform/Scrollbar.h:
1795         (WebCore::Scrollbar::isCustomScrollbar const):
1796
1797         Make virtual so it doesn't need a bit.
1798
1799         (WebCore::Scrollbar::isAlphaLocked const): Deleted.
1800         (WebCore::Scrollbar::setIsAlphaLocked): Deleted.
1801         * platform/mac/ScrollAnimatorMac.mm:
1802         (WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
1803         * rendering/RenderScrollbar.cpp:
1804         (WebCore::RenderScrollbar::RenderScrollbar):
1805         * rendering/RenderScrollbar.h:
1806
1807 2019-01-15  Zalan Bujtas  <zalan@apple.com>
1808
1809         [LFC] Use the containing block's padding box to position out-of-flow elements.
1810         https://bugs.webkit.org/show_bug.cgi?id=193431
1811
1812         Reviewed by Antti Koivisto.
1813
1814         If the element has 'position: absolute', the containing block is established by the nearest ancestor
1815         with a 'position' of 'absolute', 'relative' or 'fixed', in the following way:
1816
1817         1. In the case that the ancestor is an inline element, the containing block is the bounding box around the padding
1818         boxes of the first and the last inline boxes generated for that element. In CSS 2.2, if the inline element is split
1819         across multiple lines, the containing block is undefined.
1820
1821         2. Otherwise, the containing block is formed by the padding edge of the ancestor.
1822
1823         This patch covers #2. 
1824
1825         Test: fast/block/block-only/out-of-flow-with-containing-block-border-padding.html
1826
1827         * layout/displaytree/DisplayBox.h:
1828         (WebCore::Display::Box::width const):
1829         (WebCore::Display::Box::height const):
1830         (WebCore::Display::Box::contentBoxTop const):
1831         (WebCore::Display::Box::contentBoxLeft const):
1832         (WebCore::Display::Box::paddingBoxTop const):
1833         (WebCore::Display::Box::paddingBoxLeft const):
1834         (WebCore::Display::Box::paddingBoxBottom const):
1835         (WebCore::Display::Box::paddingBoxRight const):
1836         (WebCore::Display::Box::paddingBoxHeight const):
1837         (WebCore::Display::Box::paddingBoxWidth const):
1838         * page/FrameViewLayoutContext.cpp:
1839         (WebCore::layoutUsingFormattingContext):
1840
1841 2019-01-11  Antoine Quint  <graouts@apple.com>
1842
1843         Support parsing of additional values for the touch-action property
1844         https://bugs.webkit.org/show_bug.cgi?id=193314
1845         <rdar://problem/47176519>
1846
1847         Reviewed by Dean Jackson.
1848
1849         We add parsing support for the "none", "pan-x", "pan-y" and "pinch-zoom" values of the CSS "touch-action" property.
1850
1851         * WebCore.xcodeproj/project.pbxproj:
1852         * css/CSSComputedStyleDeclaration.cpp:
1853         (WebCore::touchActionFlagsToCSSValue):
1854         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1855         * css/CSSPrimitiveValueMappings.h:
1856         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1857         (WebCore::CSSPrimitiveValue::operator OptionSet<TouchAction> const):
1858         (WebCore::CSSPrimitiveValue::operator TouchAction const): Deleted.
1859         * css/CSSProperties.json:
1860         * css/CSSValueKeywords.in:
1861         * css/StyleBuilderConverter.h:
1862         (WebCore::StyleBuilderConverter::convertTouchAction):
1863         * css/parser/CSSParserFastPaths.cpp:
1864         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1865         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
1866         * css/parser/CSSPropertyParser.cpp:
1867         (WebCore::consumeTouchAction):
1868         * dom/Element.cpp:
1869         (WebCore::Element::allowsDoubleTapGesture const):
1870         * platform/TouchAction.h: Added.
1871         * rendering/style/RenderStyle.h:
1872         (WebCore::RenderStyle::touchActions const):
1873         (WebCore::RenderStyle::setTouchActions):
1874         (WebCore::RenderStyle::initialTouchActions):
1875         (WebCore::RenderStyle::touchAction const): Deleted.
1876         (WebCore::RenderStyle::setTouchAction): Deleted.
1877         (WebCore::RenderStyle::initialTouchAction): Deleted.
1878         * rendering/style/RenderStyleConstants.h:
1879         * rendering/style/StyleRareNonInheritedData.cpp:
1880         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1881         (WebCore::StyleRareNonInheritedData::operator== const):
1882         * rendering/style/StyleRareNonInheritedData.h:
1883
1884 2019-01-15  Devin Rousso  <drousso@apple.com>
1885
1886         Web Inspector: Audit: create new IDL type for exposing special functionality in test context
1887         https://bugs.webkit.org/show_bug.cgi?id=193149
1888         <rdar://problem/46801218>
1889
1890         Reviewed by Joseph Pecoraro.
1891
1892         Tests: inspector/audit/run.html
1893                inspector/audit/setup.html
1894                inspector/audit/teardown.html
1895
1896         Create a new `AuditAgent` (and various subclasses for different inspection targets), as well
1897         as `InspectorAuditAccessibilityObject` and `InspectorAuditDOMObject` objects that will
1898         be injected into the test function to allow for more advanced testing.
1899
1900         * inspector/InspectorAuditAccessibilityObject.idl: Added.
1901         * inspector/InspectorAuditAccessibilityObject.h: Added.
1902         (WebCore::InspectorAuditAccessibilityObject::create):
1903         * inspector/InspectorAuditAccessibilityObject.cpp: Added.
1904         (WebCore::InspectorAuditAccessibilityObject::InspectorAuditAccessibilityObject):
1905
1906         * inspector/InspectorAuditDOMObject.idl: Added.
1907         * inspector/InspectorAuditDOMObject.h: Added.
1908         (WebCore::InspectorAuditDOMObject::create):
1909         * inspector/InspectorAuditDOMObject.cpp: Added.
1910         (WebCore::InspectorAuditDOMObject::InspectorAuditDOMObject):
1911
1912         * inspector/agents/page/PageAuditAgent.h: Added.
1913         * inspector/agents/page/PageAuditAgent.cpp: Added.
1914         (WebCore::PageAuditAgent::PageAuditAgent):
1915         (WebCore::PageAuditAgent::injectedScriptForEval):
1916         (WebCore::PageAuditAgent::populateAuditObject):
1917         (WebCore::PageAuditAgent::muteConsole):
1918         (WebCore::PageAuditAgent::unmuteConsole):
1919
1920         * inspector/agents/worker/WorkerAuditAgent.h: Added.
1921         * inspector/agents/worker/WorkerAuditAgent.cpp: Added.
1922         (WebCore::WorkerAuditAgent::WorkerAuditAgent):
1923         (WebCore::WorkerAuditAgent::injectedScriptForEval):
1924
1925         * inspector/InspectorController.cpp:
1926         (WebCore::InspectorController::createLazyAgents):
1927
1928         * inspector/WorkerInspectorController.cpp:
1929         (WebCore::WorkerInspectorController::createLazyAgents):
1930
1931         * CMakeLists.txt:
1932         * DerivedSources-input.xcfilelist:
1933         * DerivedSources-output.xcfilelist:
1934         * DerivedSources.make:
1935         * Sources.txt:
1936         * UnifiedSources-input.xcfilelist:
1937         * WebCore.xcodeproj/project.pbxproj:
1938
1939 2019-01-14  Myles C. Maxfield  <mmaxfield@apple.com>
1940
1941         [WHLSL] Implement the Type Checker
1942         https://bugs.webkit.org/show_bug.cgi?id=193080
1943
1944         Reviewed by Dean Jackson.
1945
1946         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/Checker.mjs into C++.
1947
1948         The Checker passes types between nested expressions. An inner expression figures out what type it is, and
1949         passes that information up to an outer expression. This is done via reading/writing into a HashMap,
1950         because all the type information needs to be saved so that the Metal codegen can emit the correct types.
1951
1952         These types can have two forms: A regular type (like "int[]") or a ResolvableType. ResolvableTypes
1953         represent literals, since a literal needs to know its context before it knows what type it should be. So,
1954         if you have a function like "void foo(int x)" and you have a call like "foo(3)", the 3's ResolvableType
1955         gets passed to the CallExpression, which then unifies it with the function's parameter type, thereby
1956         resolving the 3 to be an int.
1957
1958         There are a few examples where multiple expressions will have the same type: "return (foo, 3)." If those
1959         types are regular types, then it's no problem; we can just clone() the type and stick both in the HashMap.
1960         However, if the type is a ResolvableType, an outer expression will only resolve that type once, so the two
1961         ResolvableTypes can't be distinct. The Checker solves this problem by making a reference-counted wrapper
1962         around ResolvableTypes and using that in the HashMap instead.
1963
1964         Once all the ResolvableTypes have been resolved, a second pass runs through the entire HashMap and assigns
1965         the known types to all the expressions. LValues and their associated address spaces are held in a parallel
1966         HashMap, and are assigned to the expression at the same time. The type is an Optional<AddressSpace> because
1967         address spaces are only relevant if the value is an lvalue; if it's nullopt then that means the expression
1968         is an rvalue.
1969
1970         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
1971         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
1972
1973         * Modules/webgpu/WHLSL/WHLSLChecker.cpp: Added.
1974         (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
1975         (WebCore::WHLSL::resolveWithOperatorLength):
1976         (WebCore::WHLSL::resolveWithReferenceComparator):
1977         (WebCore::WHLSL::resolveByInstantiation):
1978         (WebCore::WHLSL::checkSemantics):
1979         (WebCore::WHLSL::checkOperatorOverload):
1980         (WebCore::WHLSL::Checker::Checker):
1981         (WebCore::WHLSL::Checker::visit):
1982         (WebCore::WHLSL::Checker::assignTypes):
1983         (WebCore::WHLSL::Checker::checkShaderType):
1984         (WebCore::WHLSL::matchAndCommit):
1985         (WebCore::WHLSL::Checker::recurseAndGetInfo):
1986         (WebCore::WHLSL::Checker::getInfo):
1987         (WebCore::WHLSL::Checker::assignType):
1988         (WebCore::WHLSL::Checker::forwardType):
1989         (WebCore::WHLSL::getUnnamedType):
1990         (WebCore::WHLSL::Checker::finishVisitingPropertyAccess):
1991         (WebCore::WHLSL::Checker::recurseAndWrapBaseType):
1992         (WebCore::WHLSL::Checker::isBoolType):
1993         (WebCore::WHLSL::Checker::recurseAndRequireBoolType):
1994         (WebCore::WHLSL::check):
1995         * Modules/webgpu/WHLSL/WHLSLChecker.h: Added.
1996         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp: Added.
1997         (WebCore::WHLSL::Gatherer::Gatherer):
1998         (WebCore::WHLSL::Gatherer::reset):
1999         (WebCore::WHLSL::Gatherer::takeEntryPointItems):
2000         (WebCore::WHLSL::Gatherer::visit):
2001         (WebCore::WHLSL::gatherEntryPointItems):
2002         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h: Added.
2003         (WebCore::WHLSL::EntryPointItem::EntryPointItem):
2004         * Sources.txt:
2005         * WebCore.xcodeproj/project.pbxproj:
2006
2007 2019-01-14  Alex Christensen  <achristensen@webkit.org>
2008
2009         Split headerValueForVary into specialized functions for NetworkProcess and WebProcess/WebKitLegacy
2010         https://bugs.webkit.org/show_bug.cgi?id=193429
2011
2012         Reviewed by Joseph Pecoraro.
2013
2014         headerValueForVary is a strange function that is causing trouble with my NetworkProcess global state removal project.
2015         It currently accesses the cookie storage to see if there's a match in two different ways currently written as fallbacks.
2016         In the WebProcess or in WebKitLegacy, it uses cookiesStrategy to access cookies via IPC or directly, respectively,
2017         depending on the PlatformStrategies implementation of cookiesStrategy for that process.
2018         In the NetworkProcess, it uses WebCore::NetworkStorageSession to access cookies directly.
2019         Both of these cookie accessing methods use global state in the process, and I must split them to refactor them separately.
2020         This patch does the split by passing in the method of cookie access: a CookiesStrategy& or a NetworkStorageSession&.
2021         Further refactoring will be done in bug 193368 and bug 161106 to build on this and replace the global state with
2022         member variables of the correct containing objects.
2023
2024         * loader/cache/CachedResource.cpp:
2025         (WebCore::CachedResource::setResponse):
2026         (WebCore::CachedResource::varyHeaderValuesMatch):
2027         * platform/network/CacheValidation.cpp:
2028         (WebCore::cookieRequestHeaderFieldValue):
2029         (WebCore::headerValueForVary):
2030         (WebCore::collectVaryingRequestHeaders):
2031         (WebCore::verifyVaryingRequestHeaders):
2032         * platform/network/CacheValidation.h:
2033
2034 2019-01-14  Simon Fraser  <simon.fraser@apple.com>
2035
2036         Only run the node comparison code in FrameSelection::respondToNodeModification() for range selections
2037         https://bugs.webkit.org/show_bug.cgi?id=193416
2038
2039         Reviewed by Wenson Hsieh.
2040
2041         The code inside the m_selection.firstRange() clause needs to only run for non-collapsed selections, and
2042         it shows up on Speedometer profiles so optimize to only run this code if we have a selection range.
2043
2044         * editing/FrameSelection.cpp:
2045         (WebCore::FrameSelection::respondToNodeModification):
2046
2047 2019-01-14  Simon Fraser  <simon.fraser@apple.com>
2048
2049         Animation and other code is too aggressive about invalidating layer composition
2050         https://bugs.webkit.org/show_bug.cgi?id=193343
2051
2052         Reviewed by Antoine Quint.
2053         
2054         We used to have the concept of a "SyntheticStyleChange", which was used to trigger
2055         style updates for animation, and also to get compositing updated.
2056         
2057         That morphed into a call to Element::invalidateStyleAndLayerComposition(), which causes
2058         a style update to result in a "RecompositeLayer" diff, which in turn triggers compositing work,
2059         and dirties DOM touch event regions (which can be expensive to update).
2060         
2061         However, not all the callers of Element::invalidateStyleAndLayerComposition() need to trigger
2062         compositing, and doing so from animations caused excessive touch event regions on yahoo.com,
2063         which has several visibility:hidden elements with background-position animation.
2064         
2065         So fix callers of invalidateStyleAndLayerComposition() which don't care about compositing to instead
2066         call just invalidateStyle().
2067         
2068         Also fix KeyframeAnimation::animate to correctly return true when animation state changes—it failed to
2069         do so, because fireAnimationEventsIfNeeded() can run the state machine and change state.
2070
2071         * animation/KeyframeEffect.cpp:
2072         (WebCore::invalidateElement):
2073         * page/animation/AnimationBase.cpp:
2074         (WebCore::AnimationBase::setNeedsStyleRecalc):
2075         * page/animation/CSSAnimationController.cpp:
2076         (WebCore::CSSAnimationControllerPrivate::updateAnimations):
2077         (WebCore::CSSAnimationControllerPrivate::fireEventsAndUpdateStyle):
2078         (WebCore::CSSAnimationControllerPrivate::pauseAnimationAtTime):
2079         (WebCore::CSSAnimationControllerPrivate::pauseTransitionAtTime):
2080         (WebCore::CSSAnimationController::cancelAnimations):
2081         * page/animation/KeyframeAnimation.cpp:
2082         (WebCore::KeyframeAnimation::animate):
2083         * rendering/RenderImage.cpp:
2084         (WebCore::RenderImage::imageChanged):
2085         * rendering/RenderLayer.cpp:
2086         (WebCore::RenderLayer::calculateClipRects const):
2087         * rendering/svg/SVGResourcesCache.cpp:
2088         (WebCore::SVGResourcesCache::clientStyleChanged):
2089         * style/StyleTreeResolver.cpp:
2090         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
2091         * svg/SVGAnimateElementBase.cpp:
2092         (WebCore::applyCSSPropertyToTarget):
2093         (WebCore::removeCSSPropertyFromTarget):
2094
2095 2019-01-14  Sihui Liu  <sihui_liu@apple.com>
2096
2097         IndexedDB: When deleting databases, some open databases might be missed
2098         https://bugs.webkit.org/show_bug.cgi?id=193090
2099
2100         Reviewed by Brady Eidson.
2101
2102         We should close all databases with an open backing store instead of looking at which ones have an open database
2103         connection. This is because a database might be in the process of getting a backing store before its connection
2104         has been created.
2105
2106         * Modules/indexeddb/server/IDBServer.cpp:
2107         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
2108         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
2109
2110 2019-01-14  Ryosuke Niwa  <rniwa@webkit.org>
2111
2112         Remove redundant check for alignAttr and hiddenAttr in various isPresentationAttribute overrides
2113         https://bugs.webkit.org/show_bug.cgi?id=193410
2114
2115         Reviewed by Simon Fraser.
2116
2117         Removed redundant checks for check for alignAttr and hiddenAttr in isPresentationAttribute overrides
2118         in HTMLElement subclasses since HTMLElement::isPresentationAttribute already checks for those attributes.
2119
2120         * html/HTMLDivElement.cpp:
2121         (WebCore::HTMLDivElement::isPresentationAttribute const): Deleted.
2122         * html/HTMLDivElement.h:
2123         * html/HTMLEmbedElement.cpp:
2124         (WebCore::HTMLEmbedElement::isPresentationAttribute const): Deleted.
2125         * html/HTMLEmbedElement.h:
2126         * html/HTMLHRElement.cpp:
2127         (WebCore::HTMLHRElement::isPresentationAttribute const):
2128         * html/HTMLIFrameElement.cpp:
2129         (WebCore::HTMLIFrameElement::isPresentationAttribute const):
2130         * html/HTMLImageElement.cpp:
2131         (WebCore::HTMLImageElement::isPresentationAttribute const):
2132         * html/HTMLInputElement.cpp:
2133         (WebCore::HTMLInputElement::isPresentationAttribute const):
2134         * html/HTMLParagraphElement.cpp:
2135         (WebCore::HTMLParagraphElement::isPresentationAttribute const): Deleted.
2136         * html/HTMLParagraphElement.h:
2137         * html/HTMLTableCaptionElement.cpp:
2138         (WebCore::HTMLTableCaptionElement::isPresentationAttribute const): Deleted.
2139         * html/HTMLTableCaptionElement.h:
2140         * html/HTMLTableElement.cpp:
2141         (WebCore::HTMLTableElement::isPresentationAttribute const):
2142         * html/HTMLTablePartElement.cpp:
2143         (WebCore::HTMLTablePartElement::isPresentationAttribute const):
2144
2145 2019-01-14  Commit Queue  <commit-queue@webkit.org>
2146
2147         Unreviewed, rolling out r239901, r239909, r239910, r239912,
2148         r239913, and r239914.
2149         https://bugs.webkit.org/show_bug.cgi?id=193407
2150
2151         These revisions caused an internal failure (Requested by
2152         Truitt on #webkit).
2153
2154         Reverted changesets:
2155
2156         "[Cocoa] Avoid importing directly from subumbrella frameworks"
2157         https://bugs.webkit.org/show_bug.cgi?id=186016
2158         https://trac.webkit.org/changeset/239901
2159
2160         "Tried to fix USE(APPLE_INTERNAL_SDK) builds after r239901."
2161         https://trac.webkit.org/changeset/239909
2162
2163         "Tried to fix the build."
2164         https://trac.webkit.org/changeset/239910
2165
2166         "Fixed iOS builds after r239910."
2167         https://trac.webkit.org/changeset/239912
2168
2169         "More build fixing."
2170         https://trac.webkit.org/changeset/239913
2171
2172         "Tried to fix USE(APPLE_INTERNAL_SDK) 32-bit builds."
2173         https://trac.webkit.org/changeset/239914
2174
2175 2019-01-14  Mark Lam  <mark.lam@apple.com>
2176
2177         Re-enable ability to build --cloop builds.
2178         https://bugs.webkit.org/show_bug.cgi?id=192955
2179
2180         Reviewed by Saam barati and Keith Miller.
2181
2182         * Configurations/FeatureDefines.xcconfig:
2183
2184 2019-01-14  Jer Noble  <jer.noble@apple.com>
2185
2186         https://bugs.webkit.org/show_bug.cgi?id=193403
2187         <rdar://problem/46750743>
2188
2189         Continue fix in r239711 by using WeakPtr in SourceBufferPrivateAVFObjC.
2190
2191         Reviewed by Eric Carlson.
2192
2193         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2194         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2195         (WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
2196
2197 2019-01-14  Justin Fan  <justin_fan@apple.com>
2198
2199         [WebGPU] Map WebGPUBindGroupLayoutBindings from the BindGroupLayoutDescriptor for error checking and later referencing
2200         https://bugs.webkit.org/show_bug.cgi?id=193405
2201
2202         Reviewed by Dean Jackson.
2203
2204         When creating a WebGPUBindGroupLayout, cache the WebGPUBindGroupLayoutDescriptor's list of BindGroupLayoutBindings
2205         in a HashMap, keyed by binding number, for quick reference during the WebGPUProgrammablePassEncoder::setBindGroups 
2206         implementation to follow. Also add error-checking e.g. detecting duplicate binding numbers in the same WebGPUBindGroupLayout
2207         and non-existent binding numbers when creating the WebGPUBindGroup.
2208
2209         No new tests. BindGroups and BindGroupLayouts reflect the (canonical?) strategy of returning empty 
2210         objects upon creation failure and reporting errors elswhere. Since error reporting is not yet implemented, 
2211         the error checks aren't testable from LayoutTests right now. Expected behavior unchanged and covered by existing tests.
2212
2213         * Modules/webgpu/WebGPUDevice.cpp:
2214         (WebCore::WebGPUDevice::createBindGroup const): 
2215                 Number of bindings must be consistent between bindings and layout bindings.
2216                 BindGroupBindings should only refer to existing BindGroupLayoutBindings.
2217         * platform/graphics/gpu/GPUBindGroup.h: 
2218         * platform/graphics/gpu/GPUBindGroupLayout.h:
2219         (WebCore::GPUBindGroupLayout::bindingsMap const): Added. Cache map of BindGroupLayoutBindings.
2220         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Disallow duplicate binding numbers in BindGroupLayoutBindings.
2221         (WebCore::GPUBindGroupLayout::tryCreate):
2222         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
2223
2224 2019-01-14  Myles C. Maxfield  <mmaxfield@apple.com>
2225
2226         [WHLSL] Assorted cleanup
2227         https://bugs.webkit.org/show_bug.cgi?id=193389
2228
2229         Reviewed by Dean Jackson.
2230
2231         This is a bunch of non-behavior-changing cleanup.
2232
2233         - The compiler uses UniqueRef all over the place, and UniqueRef has an implicit operator T&. Therefore,
2234           we don't need to static_cast<T&> everywhere.
2235         - ConstantExpressionEnumerationMemberReference is the exact same thing as EnumerationMemberLiteral, so
2236           this patch deletes the longer-named class in favor of the shorter-named class.
2237         - Because of the header dependency tree, this patch moves EntryPointType into its own file so it can be
2238           used by files that FunctionDeclaration depends on. Same thing for AddressSpace.
2239         - EnumTypes have to have non-null base types. The parser will make sure this is always true.
2240
2241         No new tests because there is no behavior change.
2242
2243         * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h.
2244         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
2245         (WebCore::WHLSL::AST::ArrayType::type const):
2246         (WebCore::WHLSL::AST::ArrayType::type):
2247         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
2248         (WebCore::WHLSL::AST::AssignmentExpression::left):
2249         (WebCore::WHLSL::AST::AssignmentExpression::right):
2250         * Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h:
2251         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
2252         (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableForShaderItemDirection const):
2253         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
2254         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
2255         (WebCore::WHLSL::AST::ConstantExpression::ConstantExpression):
2256         (WebCore::WHLSL::AST::ConstantExpression::clone const):
2257         (WebCore::WHLSL::AST::ConstantExpression::matches const):
2258         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpressionEnumerationMemberReference.h: Removed.
2259         * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
2260         (WebCore::WHLSL::AST::DereferenceExpression::pointer):
2261         * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
2262         (WebCore::WHLSL::AST::DoWhileLoop::body):
2263         (WebCore::WHLSL::AST::DoWhileLoop::conditional):
2264         * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
2265         (WebCore::WHLSL::AST::EffectfulExpressionStatement::effectfulExpression):
2266         * Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h.
2267         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
2268         (WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition):
2269         (WebCore::WHLSL::AST::EnumerationDefinition::type):
2270         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
2271         (WebCore::WHLSL::AST::EnumerationMemberLiteral::EnumerationMemberLiteral):
2272         (WebCore::WHLSL::AST::EnumerationMemberLiteral::wrap):
2273         (WebCore::WHLSL::AST::EnumerationMemberLiteral::left const):
2274         (WebCore::WHLSL::AST::EnumerationMemberLiteral::right const):
2275         (WebCore::WHLSL::AST::EnumerationMemberLiteral::clone const):
2276         (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationDefinition):
2277         (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationDefinition const):
2278         (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember):
2279         (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember const):
2280         (WebCore::WHLSL::AST::EnumerationMemberLiteral::setEnumerationMember):
2281         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
2282         (WebCore::WHLSL::AST::Expression::type):
2283         (WebCore::WHLSL::AST::Expression::setType):
2284         (WebCore::WHLSL::AST::Expression::addressSpace const):
2285         (WebCore::WHLSL::AST::Expression::setAddressSpace):
2286         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp:
2287         (WebCore::WHLSL::AST::FloatLiteralType::conversionCost const):
2288         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
2289         (WebCore::WHLSL::AST::FloatLiteralType::preferredType):
2290         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
2291         (WebCore::WHLSL::AST::ForLoop::condition):
2292         (WebCore::WHLSL::AST::ForLoop::increment):
2293         (WebCore::WHLSL::AST::ForLoop::body):
2294         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
2295         (WebCore::WHLSL::AST::FunctionDeclaration::type const):
2296         (WebCore::WHLSL::AST::FunctionDeclaration::type):
2297         * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
2298         (WebCore::WHLSL::AST::IfStatement::conditional):
2299         (WebCore::WHLSL::AST::IfStatement::body):
2300         (WebCore::WHLSL::AST::IfStatement::elseBody):
2301         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
2302         (WebCore::WHLSL::AST::IndexExpression::indexExpression):
2303         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
2304         (WebCore::WHLSL::AST::IntegerLiteralType::conversionCost const):
2305         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
2306         (WebCore::WHLSL::AST::IntegerLiteralType::preferredType):
2307         * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
2308         (WebCore::WHLSL::AST::LogicalExpression::left):
2309         (WebCore::WHLSL::AST::LogicalExpression::right):
2310         * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
2311         (WebCore::WHLSL::AST::LogicalNotExpression::operand):
2312         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
2313         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::lValue):
2314         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
2315         (WebCore::WHLSL::AST::MakePointerExpression::lValue):
2316         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
2317         (WebCore::WHLSL::AST::PropertyAccessExpression::base):
2318         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
2319         (WebCore::WHLSL::AST::ReadModifyWriteExpression::lValue):
2320         (WebCore::WHLSL::AST::ReadModifyWriteExpression::newValueExpression):
2321         (WebCore::WHLSL::AST::ReadModifyWriteExpression::resultExpression):
2322         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
2323         (WebCore::WHLSL::AST::ReferenceType::elementType const):
2324         (WebCore::WHLSL::AST::ReferenceType::elementType):
2325         * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h:
2326         (WebCore::WHLSL::AST::ResolvableType::resolvedType const):
2327         (WebCore::WHLSL::AST::ResolvableType::resolvedType):
2328         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
2329         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
2330         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableForShaderItemDirection const):
2331         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
2332         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
2333         (WebCore::WHLSL::AST::Return::value):
2334         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
2335         (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableForShaderItemDirection const):
2336         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h:
2337         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
2338         (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableForShaderItemDirection const):
2339         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h:
2340         * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
2341         (WebCore::WHLSL::AST::StructureElement::type):
2342         * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
2343         (WebCore::WHLSL::AST::SwitchStatement::value):
2344         * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
2345         (WebCore::WHLSL::AST::TernaryExpression::predicate):
2346         (WebCore::WHLSL::AST::TernaryExpression::bodyExpression):
2347         (WebCore::WHLSL::AST::TernaryExpression::elseExpression):
2348         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
2349         (WebCore::WHLSL::AST::TypeDefinition::type):
2350         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
2351         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::conversionCost const):
2352         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
2353         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::preferredType):
2354         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
2355         (WebCore::WHLSL::AST::VariableDeclaration::type):
2356         (WebCore::WHLSL::AST::VariableDeclaration::initializer):
2357         (WebCore::WHLSL::AST::VariableDeclaration::isAnonymous const):
2358         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
2359         (WebCore::WHLSL::AST::WhileLoop::conditional):
2360         (WebCore::WHLSL::AST::WhileLoop::body):
2361         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
2362         (WebCore::WHLSL::checkDuplicateFunctions):
2363         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
2364         (WebCore::WHLSL::commit):
2365         (WebCore::WHLSL::inferTypesForTypeArguments):
2366         (WebCore::WHLSL::inferTypesForCall):
2367         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
2368         (WebCore::WHLSL::NameResolver::visit):
2369         (WebCore::WHLSL::resolveNamesInTypes):
2370         (WebCore::WHLSL::resolveNamesInFunctions):
2371         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
2372         * Modules/webgpu/WHLSL/WHLSLParser.h:
2373         * Modules/webgpu/WHLSL/WHLSLProgram.h:
2374         (WebCore::WHLSL::Program::append):
2375         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
2376         (WebCore::WHLSL::synthesizeEnumerationFunctions):
2377         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
2378         (WebCore::WHLSL::synthesizeStructureAccessors):
2379         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
2380         (WebCore::WHLSL::Visitor::visit):
2381         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
2382         * WebCore.xcodeproj/project.pbxproj:
2383
2384 2019-01-14  Zan Dobersek  <zdobersek@igalia.com>
2385
2386         DOMCacheStorage: use-after-move in doSequentialMatch()
2387         https://bugs.webkit.org/show_bug.cgi?id=193396
2388
2389         Reviewed by Youenn Fablet.
2390
2391         Depending on the platform- and compiler-specific calling conventions,
2392         the doSequentialMatch() code can move out the Vector<Ref<DOMCache>>
2393         object into the callback lambda before the DOMCache object at the
2394         specified index is retrieved for the DOMCache::doMatch() invocation.
2395
2396         This problem is now avoided by retrieving reference to the target
2397         DOMCache object in an earlier expression.
2398
2399         * Modules/cache/DOMCacheStorage.cpp:
2400         (WebCore::doSequentialMatch):
2401
2402 2019-01-14  Zalan Bujtas  <zalan@apple.com>
2403
2404         [LFC][BFC] Add basic box-sizing support.
2405         https://bugs.webkit.org/show_bug.cgi?id=193392
2406
2407         Reviewed by Antti Koivisto.
2408
2409         No min/max support yet.
2410
2411         Test: fast/block/block-only/box-sizing-inflow-out-of-flow-simple.html
2412
2413         * layout/FormattingContextGeometry.cpp:
2414         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2415         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2416         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2417         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2418         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2419         * page/FrameViewLayoutContext.cpp:
2420         (WebCore::layoutUsingFormattingContext):
2421
2422 2019-01-14  Thibault Saunier  <tsaunier@igalia.com>
2423
2424         [GStreamer][WebRTC] Override DeviceType() in RealtimeMediaSource implementations
2425         https://bugs.webkit.org/show_bug.cgi?id=193397
2426
2427         This was necessary but wasn't done.
2428
2429         Reviewed by Philippe Normand.
2430
2431         No test required as this fixes a regression in all WebRTC tests when built in debug mode.
2432
2433         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
2434         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
2435
2436 2019-01-14  Zan Dobersek  <zdobersek@igalia.com>
2437
2438         Unreviewed WPE debug build fix after r239921.
2439
2440         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2441         (webKitMediaClearKeyDecryptorDecrypt): Fix the assert that checks the
2442         size of the mapped buffer containing IV data.
2443
2444 2019-01-14  Charlie Turner  <cturner@igalia.com>
2445
2446         [GStreamer] Add sharedBuffer utility to GstMappedBuffer, and a testsuite
2447         https://bugs.webkit.org/show_bug.cgi?id=192977
2448
2449         Reviewed by Carlos Garcia Campos.
2450
2451         Add a utility method on GstMappedBuffer to return a SharedBuffer
2452         view over the mapped data with no copies.
2453
2454         This patch also introduces a new gstreamer port API test
2455         directory, and includes some tests for GstMappedBuffer.
2456
2457         New tests in the API section.
2458
2459         * platform/SharedBuffer.cpp: Add a new overload for
2460         GstMappedBuffer that allows sharing the mapped GStreamer buffers
2461         with zero copies.
2462         (WebCore::SharedBuffer::create):
2463         (WebCore::SharedBuffer::SharedBuffer):
2464         (WebCore::SharedBuffer::DataSegment::data const):
2465         (WebCore::SharedBuffer::DataSegment::size const):
2466         * platform/SharedBuffer.h:
2467         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
2468         (webKitWebAudioSrcAllocateBuffersAndRenderAudio): Update to new
2469         API.
2470         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2471         (WebCore::GstMappedBuffer::createSharedBuffer): Return a shared
2472         buffer sharing this mapped buffer. The buffer must be shareable to
2473         use this method.
2474         * platform/graphics/gstreamer/GStreamerCommon.h:
2475         (WebCore::GstMappedBuffer::create): Make GstMappedBuffer RefCounted
2476         (WebCore::GstMappedBuffer::~GstMappedBuffer):
2477         (WebCore::GstMappedBuffer::data):
2478         (WebCore::GstMappedBuffer::data const):
2479         (WebCore::GstMappedBuffer::size const):
2480         (WebCore::GstMappedBuffer::isSharable const): New predicate to
2481         check whether this buffer can be shared (i.e., is not writable)
2482         (WebCore::GstMappedBuffer::GstMappedBuffer):
2483         (WebCore::GstMappedBuffer::operator bool const): Deleted.
2484         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
2485         (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample):
2486         Update to use new API.
2487         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
2488         (WebCore::InitData::InitData): Ditto.
2489         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2490         (webKitMediaClearKeyDecryptorFindAndSetKey): Ditto.
2491         (webKitMediaClearKeyDecryptorDecrypt): Ditto.
2492         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
2493         (WebCore::WrappedMockRealtimeAudioSource::render): Ditto.
2494         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
2495         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): Ditto.
2496         * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:
2497         (WebCore::RealtimeOutgoingVideoSourceLibWebRTC::createBlackFrame): Ditto.
2498         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
2499         (WebCore::GStreamerVideoEncoder::Fragmentize): Ditto.
2500
2501 2019-01-14  Karl Leplat  <karl.leplat_ext@softathome.com>
2502
2503         [GTK][WPE] Graphic issue with invalidations on composited layers with subpixel positions
2504         https://bugs.webkit.org/show_bug.cgi?id=193239
2505
2506         Reviewed by Žan Doberšek.
2507
2508         Test: compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions.html
2509
2510         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2511         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers): Use enclosed dirty rect values
2512         when invalidating the CoordinatedBackingStore areas.
2513
2514 2019-01-13  Carlos Garcia Campos  <cgarcia@igalia.com>
2515
2516         [FreeType] Support emoji modifiers
2517         https://bugs.webkit.org/show_bug.cgi?id=177040
2518
2519         Reviewed by Myles C. Maxfield.
2520
2521         The problem only happens with emojis having the zero with joiner (U+200D) in the sequence. The sequence is
2522         broken because createAndFillGlyphPage() in Font.cpp overwrites zero with joiner with zero width space (U+200B),
2523         but the emoji font actually supports zero with joiner. This patch moves the control characters override from
2524         createAndFillGlyphPage() to GlyphPage::fill() only for FreeType based ports. This way we can do the override
2525         only for the cases where the code point is not supported by the font.
2526
2527         * platform/graphics/Font.cpp:
2528         (WebCore::overrideControlCharacters): Helper function to override the control characters.
2529         (WebCore::createAndFillGlyphPage): Call overrideControlCharacters() only when not using FreeType.
2530         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
2531         (WebCore::GlyphPage::fill): Use zero width space as fallback when the font doesn't support characters with
2532         Default_Ignorable Unicode property.
2533
2534 2019-01-13  Dan Bernstein  <mitz@apple.com>
2535
2536         More build fixing.
2537
2538         * editing/cocoa/DictionaryLookup.mm:
2539
2540 2019-01-13  Simon Fraser  <simon.fraser@apple.com>
2541
2542         Minor optimization to RenderText::setRenderedText()
2543         https://bugs.webkit.org/show_bug.cgi?id=193388
2544
2545         Reviewed by Ryosuke Niwa.
2546
2547         Avoid the call to applyTextTransform() if TextTransform is None, so that we don't
2548         have to call previousCharacter() and reassign m_text.
2549         
2550         Similar optimization in RenderText::textWithoutConvertingBackslashToYenSymbol().
2551
2552         Speedometer profiles show a few samples here, but this isn't going to win any prizes.
2553
2554         * rendering/RenderText.cpp:
2555         (WebCore::RenderText::setRenderedText):
2556         (WebCore::RenderText::textWithoutConvertingBackslashToYenSymbol const):
2557
2558 2019-01-13  Dan Bernstein  <mitz@apple.com>
2559
2560         Tried to fix the build.
2561
2562         * editing/cocoa/DictionaryLookup.mm:
2563
2564 2019-01-13  Dan Bernstein  <mitz@apple.com>
2565
2566         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r239901.
2567
2568         Patch by Keith Rollin.
2569
2570         * accessibility/mac/AXObjectCacheMac.mm:
2571
2572 2019-01-13  Zalan Bujtas  <zalan@apple.com>
2573
2574         [LFC] Adjust assert for statically positioned fixed elements
2575         https://bugs.webkit.org/show_bug.cgi?id=193385
2576
2577         Reviewed by Antti Koivisto.
2578
2579         While computing the static position and traversing the ancestor chain, we can surely hit a positioned container
2580         (since we need to go all the way up to the initial containing block).
2581
2582         * layout/FormattingContextGeometry.cpp:
2583         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
2584         (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
2585
2586 2019-01-13  Antti Koivisto  <antti@apple.com>
2587
2588         Release assert with <img usemap> in shadow tree
2589         https://bugs.webkit.org/show_bug.cgi?id=193378
2590
2591         Reviewed by Ryosuke Niwa.
2592
2593         When a shadow host that has <img usemap> in the shadow tree is removed from the document, we try
2594         to remove the map from the scope of the host.
2595
2596         * html/HTMLImageElement.cpp:
2597         (WebCore::HTMLImageElement::parseAttribute):
2598         (WebCore::HTMLImageElement::insertedIntoAncestor):
2599         (WebCore::HTMLImageElement::removedFromAncestor):
2600
2601         Tree scope changes are relevant, not the connection to the document.
2602
2603 2019-01-12  Timothy Hatcher  <timothy@apple.com>
2604
2605         Have prefers-color-scheme: light always match on macOS versions before Mojave.
2606         https://bugs.webkit.org/show_bug.cgi?id=191655
2607         rdar://problem/46074680
2608
2609         Reviewed by Megan Gardner.
2610
2611         Tests: css-dark-mode/older-systems/prefers-color-scheme.html
2612                css-dark-mode/older-systems/supported-color-schemes-css.html
2613                css-dark-mode/older-systems/supported-color-schemes.html
2614
2615         Use new HAVE(OS_DARK_MODE_SUPPORT) to make it easier to find code.
2616         Added HAVE(OS_DARK_MODE_SUPPORT) around more bits to make it work on older systems.
2617
2618         * Configurations/FeatureDefines.xcconfig:
2619         * dom/Document.cpp:
2620         (WebCore::Document::useDarkAppearance const):
2621         * inspector/agents/InspectorPageAgent.cpp:
2622         (WebCore::InspectorPageAgent::enable):
2623         * page/Page.cpp:
2624         (WebCore::Page::setUseDarkAppearance):
2625         (WebCore::Page::useDarkAppearance const):
2626         (WebCore::Page::setUseDarkAppearanceOverride):
2627         * platform/mac/LocalDefaultSystemAppearance.h:
2628         (WebCore::LocalDefaultSystemAppearance::usingDarkAppearance const):
2629         * platform/mac/LocalDefaultSystemAppearance.mm:
2630         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
2631         (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
2632         * platform/mac/ScrollAnimatorMac.mm:
2633         * rendering/RenderThemeMac.mm:
2634         (-[WebCoreTextFieldCell _adjustedCoreUIDrawOptionsForDrawingBordersOnly:]):
2635         (-[WebListButtonCell drawWithFrame:inView:]):
2636         (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const):
2637         (WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const):
2638         (WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const):
2639         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
2640         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const):
2641         (WebCore::RenderThemeMac::systemColor const):
2642
2643 2019-01-12  Zalan Bujtas  <zalan@apple.com>
2644
2645         [LFC] Block/InlinFormattingContext should take Block/InlineFormattingState
2646         https://bugs.webkit.org/show_bug.cgi?id=193383
2647
2648         Reviewed by Antti Koivisto.
2649
2650         This is just a downcast really.
2651
2652         * layout/FormattingContext.cpp:
2653         (WebCore::Layout::FormattingContext::FormattingContext):
2654         (WebCore::Layout::FormattingContext::formattingState const): Deleted.
2655         * layout/FormattingContext.h:
2656         * layout/LayoutState.cpp:
2657         (WebCore::Layout::LayoutState::createFormattingContext):
2658         * layout/blockformatting/BlockFormattingContext.cpp:
2659         (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
2660         * layout/blockformatting/BlockFormattingContext.h:
2661         (WebCore::Layout::BlockFormattingContext::formattingState const):
2662         (WebCore::Layout::BlockFormattingContext::blockFormattingState const): Deleted.
2663         * layout/inlineformatting/InlineFormattingContext.cpp:
2664         (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
2665         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2666         (WebCore::Layout::InlineFormattingContext::createFinalRuns const):
2667         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
2668         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
2669         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
2670         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2671         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
2672         * layout/inlineformatting/InlineFormattingContext.h:
2673         (WebCore::Layout::InlineFormattingContext::formattingState const):
2674         (WebCore::Layout::InlineFormattingContext::inlineFormattingState const): Deleted.
2675         * page/FrameViewLayoutContext.cpp:
2676         (WebCore::layoutUsingFormattingContext):
2677
2678 2019-01-12  Myles C. Maxfield  <mmaxfield@apple.com>
2679
2680         [WHLSL] Add native function synthesis passes
2681         https://bugs.webkit.org/show_bug.cgi?id=193360
2682
2683         Reviewed by Dean Jackson.
2684
2685         This patch includes all the passes in prepare() that are between the name resolver and the
2686         type checker. It involves a few small pieces:
2687
2688         - CheckDuplicateFunctions which makes sure the same function isn't defined twice
2689         - Intrinsics, which remembers all of the native types so they can be referred to by the
2690           rest of the compiler
2691         - RecursiveTypeChecker which makes sure types don't refer to themselves
2692         - SynthesizeArrayOperatorLength which creates operator.length() functions for arrays
2693         - SynthesizeConstructors which creates copy constructors and default constructors for all
2694           types
2695         - SynthesizeEnumerationFunctions which provides cast operators between enum types and their
2696           base types
2697         - SynthesizeStructureAccessors which provides getters, setters, and anders for each member
2698           of a struct
2699
2700         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
2701         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
2702
2703         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
2704         (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableType const):
2705         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
2706         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
2707         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp: Added.
2708         (WebCore::WHLSL::checkDuplicateFunctions):
2709         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
2710         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp: Added.
2711         (WebCore::WHLSL::Intrinsics::Intrinsics):
2712         (WebCore::WHLSL::Intrinsics::add):
2713         (WebCore::WHLSL::Intrinsics::addPrimitive):
2714         (WebCore::WHLSL::Intrinsics::addVector):
2715         (WebCore::WHLSL::Intrinsics::addMatrix):
2716         (WebCore::WHLSL::Intrinsics::addFullTexture):
2717         (WebCore::WHLSL::Intrinsics::addDepthTexture):
2718         (WebCore::WHLSL::Intrinsics::addTexture):
2719         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h: Added.
2720         (WebCore::WHLSL::Intrinsics::voidType const):
2721         (WebCore::WHLSL::Intrinsics::boolType const):
2722         (WebCore::WHLSL::Intrinsics::intType const):
2723         (WebCore::WHLSL::Intrinsics::uintType const):
2724         (WebCore::WHLSL::Intrinsics::samplerType const):
2725         (WebCore::WHLSL::Intrinsics::floatType const):
2726         (WebCore::WHLSL::Intrinsics::float3Type const):
2727         (WebCore::WHLSL::Intrinsics::float4Type const):
2728         * Modules/webgpu/WHLSL/WHLSLProgram.h:
2729         (WebCore::WHLSL::Program::append):
2730         (WebCore::WHLSL::Program::intrinsics):
2731         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp: Added.
2732         (WebCore::WHLSL::checkRecursiveTypes):
2733         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
2734         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp: Added.
2735         (WebCore::WHLSL::FindArrayTypes::takeArrayTypes):
2736         (WebCore::WHLSL::synthesizeArrayOperatorLength):
2737         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
2738         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: Added.
2739         (WebCore::WHLSL::FindAllTypes::takeUnnamedTypes):
2740         (WebCore::WHLSL::FindAllTypes::takeNamedTypes):
2741         (WebCore::WHLSL::synthesizeConstructors):
2742         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
2743         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp: Added.
2744         (WebCore::WHLSL::synthesizeEnumerationFunctions):
2745         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
2746         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp: Added.
2747         (WebCore::WHLSL::synthesizeStructureAccessors):
2748         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
2749         * Sources.txt:
2750         * WebCore.xcodeproj/project.pbxproj:
2751
2752 2019-01-12  Dan Bernstein  <mitz@apple.com>
2753
2754         [Cocoa] Avoid importing directly from subumbrella frameworks
2755         https://bugs.webkit.org/show_bug.cgi?id=186016
2756         <rdar://problem/40591038>
2757
2758         Reviewed by Sam Weinig.
2759
2760         * Configurations/WebCore.xcconfig: Removed -iframework options from OTHER_CFLAGS and
2761           OTHER_CPLUSPLUSFLAGS.
2762         * editing/mac/DictionaryLookupLegacy.mm: Import Quartz.h instead of a PDFKit header.
2763         * platform/mac/PlatformEventFactoryMac.mm: Import Carbon.h instead of HIToolbox headers.
2764         * platform/text/mac/TextEncodingRegistryMac.mm: Import Carbon.h instead of CarbonCore.h.
2765
2766 2019-01-12  Zalan Bujtas  <zalan@apple.com>
2767
2768         [LFC] Move formatting context creation from FormattingState to LayoutState
2769         https://bugs.webkit.org/show_bug.cgi?id=193381
2770
2771         Reviewed by Antti Koivisto.
2772
2773         layoutState().createFormattingStateForFormattingRootIfNeeded(root).createFormattingContext(root) is not only mouthful
2774         but also feels unintuitive. Use layoutState().createFormattingContext(root) instead.
2775
2776         * layout/FormattingContext.cpp:
2777         (WebCore::Layout::FormattingContext::FormattingContext):
2778         (WebCore::Layout::FormattingContext::~FormattingContext):
2779         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
2780         * layout/FormattingContextGeometry.cpp:
2781         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
2782         * layout/FormattingState.h:
2783         * layout/LayoutState.cpp:
2784         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
2785         (WebCore::Layout::LayoutState::createFormattingContext):
2786         * layout/LayoutState.h:
2787         (WebCore::Layout::LayoutState::deregisterFormattingContext):
2788         (WebCore::Layout::LayoutState::registerFormattingContext):
2789         * layout/blockformatting/BlockFormattingContext.cpp:
2790         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2791         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
2792         * layout/blockformatting/BlockFormattingState.cpp:
2793         (WebCore::Layout::BlockFormattingState::createFormattingContext): Deleted.
2794         * layout/blockformatting/BlockFormattingState.h:
2795         * layout/inlineformatting/InlineFormattingContext.cpp:
2796         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
2797         * layout/inlineformatting/InlineFormattingState.cpp:
2798         (WebCore::Layout::InlineFormattingState::createFormattingContext): Deleted.
2799         * layout/inlineformatting/InlineFormattingState.h:
2800
2801 2019-01-12  Zalan Bujtas  <zalan@apple.com>
2802
2803         [LFC][BFC][MarginCollapsing] Move estimatedMarginBefore flag from state/display box to BlockFormattingContext
2804         https://bugs.webkit.org/show_bug.cgi?id=193375
2805
2806         Reviewed by Antti Koivisto.
2807
2808         The estimated marginBefore is a pre-computed, temporary value. We need to keep it around until the final vertical margin value is computed.
2809         Neither BlockFormattingState nor Display should hold temporary values.
2810
2811         * layout/blockformatting/BlockFormattingContext.cpp:
2812         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
2813         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
2814         (WebCore::Layout::BlockFormattingContext::hasPrecomputedMarginBefore const):
2815         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
2816         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
2817         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
2818         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2819         (WebCore::Layout::BlockFormattingContext::setEstimatedMarginBefore const):
2820         (WebCore::Layout::BlockFormattingContext::hasEstimatedMarginBefore const):
2821         (WebCore::Layout::hasPrecomputedMarginBefore): Deleted.
2822         * layout/blockformatting/BlockFormattingContext.h:
2823         (WebCore::Layout::BlockFormattingContext::removeEstimatedMarginBefore const):
2824         (WebCore::Layout::BlockFormattingContext::estimatedMarginBefore const):
2825         * layout/blockformatting/BlockFormattingState.h:
2826         (WebCore::Layout::BlockFormattingState::setHasEstimatedMarginBefore): Deleted.
2827         (WebCore::Layout::BlockFormattingState::clearHasEstimatedMarginBefore): Deleted.
2828         (WebCore::Layout::BlockFormattingState::hasEstimatedMarginBefore const): Deleted.
2829         * layout/displaytree/DisplayBox.cpp:
2830         (WebCore::Display::Box::Box):
2831         * layout/displaytree/DisplayBox.h:
2832         (WebCore::Display::Box::setHasEstimatedMarginBefore):
2833         (WebCore::Display::Box::invalidateEstimatedMarginBefore):
2834         (WebCore::Display::Box::top const):
2835         (WebCore::Display::Box::topLeft const):
2836         (WebCore::Display::Box::setEstimatedMarginBefore): Deleted.
2837         (WebCore::Display::Box::estimatedMarginBefore const): Deleted.
2838         * page/FrameViewLayoutContext.cpp:
2839         (WebCore::layoutUsingFormattingContext):
2840
2841 2019-01-11  Myles C. Maxfield  <mmaxfield@apple.com>
2842
2843         [WHLSL] Implement the NameResolver
2844         https://bugs.webkit.org/show_bug.cgi?id=193007
2845
2846         Reviewed by Dean Jackson.
2847
2848         This is the base implementation for WHLSL's name resolver. The name resolver matches three kinds of things:
2849         1. It matches VariableRefs to VariableDecls
2850         2. It matches TypeRefs to NamedTypes
2851         3. It matches CallExpressions to FunctionDeclarations
2852
2853         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
2854         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
2855
2856         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp: Now that InferTypes.h exists, we can implement these
2857         functions.
2858         (WebCore::WHLSL::AST::FloatLiteralType::canResolve const):
2859         (WebCore::WHLSL::AST::FloatLiteralType::conversionCost const):
2860         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h: Remove unnecessary function.
2861         (WebCore::WHLSL::AST::FloatLiteralType::value const): Deleted.
2862         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp: Now that InferTypes.h exists, we can implement these
2863         functions.
2864         (WebCore::WHLSL::AST::IntegerLiteralType::canResolve const):
2865         (WebCore::WHLSL::AST::IntegerLiteralType::conversionCost const):
2866         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h: Remove unnecessary function.
2867         (WebCore::WHLSL::AST::IntegerLiteralType::value const): Deleted.
2868         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp: Modifying Sources.txt caused the sources
2869         to get shuffled around, so the #includes need to be fixed.
2870         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp: Now that InferTypes.h exists, we can implement
2871         these functions.
2872         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::canResolve const):
2873         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::conversionCost const):
2874         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h: Remove unnecessary function.
2875         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::value const): Deleted.
2876         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp: Added. This is the replacement for UnificationContext in the
2877         reference compiler. It's much simpler (and we should remove UnificationContext in the reference compiler in
2878         favor of this design). It has three sets of functions: Tell if two types are the same, tell if two types are
2879         the same and commit the resolvable type, and run the above functions on type references or function arguments.
2880         (WebCore::WHLSL::matches):
2881         (WebCore::WHLSL::matchAndCommit):
2882         (WebCore::WHLSL::commit):
2883         (WebCore::WHLSL::inferTypesForTypeArguments):
2884         (WebCore::WHLSL::inferTypesForCall):
2885         * Modules/webgpu/WHLSL/WHLSLInferTypes.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp.
2886         * Modules/webgpu/WHLSL/WHLSLNameContext.cpp: Added. This is the data structure that remembers NamedTypes,
2887         FunctionDeclarations, and VariableDeclarations so NameResolver can work.
2888         (WebCore::WHLSL::NameContext::NameContext):
2889         (WebCore::WHLSL::NameContext::add):
2890         (WebCore::WHLSL::NameContext::getTypes):
2891         (WebCore::WHLSL::NameContext::getFunctions):
2892         (WebCore::WHLSL::NameContext::getVariable):
2893         (WebCore::WHLSL::NameContext::exists):
2894         * Modules/webgpu/WHLSL/WHLSLNameContext.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h.
2895         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp: Added. Use the NameContext to match up the three types of names.
2896         (WebCore::WHLSL::NameResolver::NameResolver):
2897         (WebCore::WHLSL::NameResolver::visit):
2898         (WebCore::WHLSL::resolveNamesInTypes):
2899         (WebCore::WHLSL::resolveNamesInFunctions):
2900         * Modules/webgpu/WHLSL/WHLSLNameResolver.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h.
2901         (WebCore::WHLSL::NameResolver::setCurrentFunctionDefinition):
2902         * Modules/webgpu/WHLSL/WHLSLProgram.h:
2903         (WebCore::WHLSL::Program::append): The parser needs to add all global declarations to the name context so the
2904         name resolver is ready to go as soon as parsing is finished.
2905         (WebCore::WHLSL::Program::nameContext):
2906         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp: Added. Pick the appropriate FunctionDeclaration or
2907         NamedType for a particular CallExpression or TypeReference.
2908         (WebCore::WHLSL::conversionCost):
2909         (WebCore::WHLSL::resolveFunctionOverloadImpl):
2910         (WebCore::WHLSL::resolveTypeOverloadImpl):
2911         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp.
2912         * Modules/webgpu/WHLSL/WHLSLResolvingType.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp. This describes the two states that a type in the type resolver can be in: either an owned
2913         UnnamedType, or a reference to a ResolvableType. This is because every expression needs to have a type
2914         associated with it, but those types might be the type of a literal (aka a ResolvableType). Multiple
2915         expressions might need to reference the same ResolvableType so when it gets resolved, all the expressions
2916         get the result.
2917         (WebCore::WHLSL::ResolvableTypeReference::ResolvableTypeReference):
2918         (WebCore::WHLSL::ResolvableTypeReference::resolvableType):
2919         * Sources.txt:
2920         * WebCore.xcodeproj/project.pbxproj:
2921
2922 2019-01-11  Myles C. Maxfield  <mmaxfield@apple.com>
2923
2924         [WHLSL] Add a Visitor class
2925         https://bugs.webkit.org/show_bug.cgi?id=192826
2926
2927         Reviewed by Dean Jackson.
2928
2929         This patch exposes a bunch of the private members of WHLSL's AST nodes so that Visitor can recurse on constituent nodes.
2930         It also writes the recursion in Visitor.h. This is a virtual base class that gets subclassed for compiler passes.
2931
2932         I've split this part into its own patch to aid reviewing of the compiler.
2933
2934         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
2935         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp: Added.
2936         (WebCore::WHLSL::Visitor::visit):
2937         (WebCore::WHLSL::Visitor::checkErrorAndVisit):
2938         * Modules/webgpu/WHLSL/WHLSLVisitor.h: Added.
2939         (WebCore::WHLSL::Visitor::setError):
2940         (WebCore::WHLSL::Visitor::error const):
2941         * Sources.txt:
2942         * WebCore.xcodeproj/project.pbxproj:
2943
2944 2019-01-11  Jer Noble  <jer.noble@apple.com>
2945
2946         REGRESSION(r239419): Crash in AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC()
2947         https://bugs.webkit.org/show_bug.cgi?id=193342
2948         <rdar://problem/47119836>
2949
2950         Reviewed by Eric Carlson.
2951
2952         Make the TapStorage used by AudioSourceProviderAVFObjC thread-safe RefCounted.
2953
2954         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
2955         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
2956         (WebCore::AudioSourceProviderAVFObjC::initCallback):
2957         (WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
2958
2959 2019-01-11  John Wilander  <wilander@apple.com>
2960
2961         Compile out Web API Statistics Collection
2962         https://bugs.webkit.org/show_bug.cgi?id=193370
2963         <rdar://problem/45388584>
2964
2965         Reviewed by Brent Fulgham.
2966
2967         No new tests. This patch disables functionality. The associated tests
2968         are skipped.
2969
2970         These functions are now no-ops unless web API statistics is enabled.
2971
2972         * Configurations/FeatureDefines.xcconfig:
2973         * loader/ResourceLoadObserver.cpp:
2974         (WebCore::ResourceLoadObserver::logFontLoad):
2975         (WebCore::ResourceLoadObserver::logCanvasRead):
2976         (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
2977         (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
2978         (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
2979         * loader/ResourceLoadStatistics.cpp:
2980         (WebCore::ResourceLoadStatistics::encode const):
2981         (WebCore::ResourceLoadStatistics::decode):
2982         (WebCore::ResourceLoadStatistics::toString const):
2983         (WebCore::ResourceLoadStatistics::merge):
2984         * loader/ResourceLoadStatistics.h:
2985             The associated struct members are skipped unless web API
2986             statistics is enabled.
2987
2988 2019-01-11  Sihui Liu  <sihui_liu@apple.com>
2989
2990         IndexedDB: leak WebIDBConnectionToClient for retain cycle
2991         https://bugs.webkit.org/show_bug.cgi?id=193097
2992         <rdar://problem/46899601>
2993
2994         Reviewed by Brady Eidson.
2995
2996         Let IDBConnectionToClient hold a WeakPtr of IDBConnectionToClientDelegate.
2997
2998         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
2999         (WebCore::IDBServer::IDBConnectionToClient::IDBConnectionToClient):
3000         (WebCore::IDBServer::IDBConnectionToClient::identifier const):
3001         (WebCore::IDBServer::IDBConnectionToClient::didDeleteDatabase):
3002         (WebCore::IDBServer::IDBConnectionToClient::didOpenDatabase):
3003         (WebCore::IDBServer::IDBConnectionToClient::didAbortTransaction):
3004         (WebCore::IDBServer::IDBConnectionToClient::didCreateObjectStore):
3005         (WebCore::IDBServer::IDBConnectionToClient::didDeleteObjectStore):
3006         (WebCore::IDBServer::IDBConnectionToClient::didRenameObjectStore):
3007         (WebCore::IDBServer::IDBConnectionToClient::didClearObjectStore):
3008         (WebCore::IDBServer::IDBConnectionToClient::didCreateIndex):
3009         (WebCore::IDBServer::IDBConnectionToClient::didDeleteIndex):
3010         (WebCore::IDBServer::IDBConnectionToClient::didRenameIndex):
3011         (WebCore::IDBServer::IDBConnectionToClient::didPutOrAdd):
3012         (WebCore::IDBServer::IDBConnectionToClient::didGetRecord):
3013         (WebCore::IDBServer::IDBConnectionToClient::didGetAllRecords):
3014         (WebCore::IDBServer::IDBConnectionToClient::didGetCount):
3015         (WebCore::IDBServer::IDBConnectionToClient::didDeleteRecord):
3016         (WebCore::IDBServer::IDBConnectionToClient::didOpenCursor):
3017         (WebCore::IDBServer::IDBConnectionToClient::didIterateCursor):
3018         (WebCore::IDBServer::IDBConnectionToClient::didCommitTransaction):
3019         (WebCore::IDBServer::IDBConnectionToClient::fireVersionChangeEvent):
3020         (WebCore::IDBServer::IDBConnectionToClient::didStartTransaction):
3021         (WebCore::IDBServer::IDBConnectionToClient::didCloseFromServer):
3022         (WebCore::IDBServer::IDBConnectionToClient::notifyOpenDBRequestBlocked):
3023         (WebCore::IDBServer::IDBConnectionToClient::didGetAllDatabaseNames):
3024         * Modules/indexeddb/server/IDBConnectionToClient.h:
3025         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
3026
3027 2019-01-11  Myles C. Maxfield  <mmaxfield@apple.com>
3028
3029         Fix the build after r239844
3030         https://bugs.webkit.org/show_bug.cgi?id=192991
3031
3032         Unreviewed.
3033
3034         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
3035         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
3036         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
3037         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
3038
3039 2019-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3040
3041         [iOS] Precision drop state thrashes when dragging near the top edge of an editable element
3042         https://bugs.webkit.org/show_bug.cgi?id=193364
3043         <rdar://problem/47214117>
3044
3045         Reviewed by Tim Horton.
3046
3047         Add a new helper method on DragCaretController to compute the bounds of the editable element around the drop
3048         caret position. This is either the enclosing form control (in the case of text fields and text areas), or the
3049         highest editable root. See WebKit ChangeLog for more details.
3050
3051         Test: DragAndDropTests.AvoidPreciseDropNearTopOfTextArea
3052
3053         * editing/FrameSelection.cpp:
3054         (WebCore::DragCaretController::editableElementRectInRootViewCoordinates const):
3055         * editing/FrameSelection.h:
3056
3057 2019-01-11  Tim Horton  <timothy_horton@apple.com>
3058
3059         REGRESSION (PSON): Firefox app lacks Open in New Tab in menu
3060         https://bugs.webkit.org/show_bug.cgi?id=193366
3061         <rdar://problem/46097212>
3062
3063         Reviewed by Simon Fraser.
3064
3065         * platform/RuntimeApplicationChecks.h:
3066         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
3067         (WebCore::IOSApplication::isFirefox):
3068         Add a Firefox Mobile bundle check.
3069
3070 2019-01-11  Antti Koivisto  <antti@apple.com>
3071
3072         Release assert when removing element with a map element in the shadow tree
3073         https://bugs.webkit.org/show_bug.cgi?id=193351
3074         <rdar://problem/47208807>
3075
3076         Reviewed by Ryosuke Niwa.
3077
3078         When a shadow host that has a map element in the shadow tree is removed from the document, we try
3079         to remove the map from the scope of the host.
3080
3081         Test: fast/shadow-dom/image-map-tree-scope.html
3082
3083         * html/HTMLMapElement.cpp:
3084         (WebCore::HTMLMapElement::insertedIntoAncestor):
3085         (WebCore::HTMLMapElement::removedFromAncestor):
3086
3087         Add and remove image maps when the scope changes, not when the document changes.
3088         This matches how id/name/etc updates work in the HTMLElement.
3089
3090 2019-01-11  Sihui Liu  <sihui_liu@apple.com>
3091
3092         Fix an assertion in UniqueIDBDatabase
3093         https://bugs.webkit.org/show_bug.cgi?id=193096
3094
3095         Reviewed by Brady Eidson.
3096
3097         m_objectStoreTransactionCounts.count(objectStore) == 1 in UniqueIDBDatabase::operationAndTransactionTimerFired()
3098         is not necessarily true because m_objectStoreTransactionCounts may be cleared in immediateCloseForUserDelete.
3099
3100         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3101         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
3102
3103 2019-01-11  Miguel Gomez  <magomez@igalia.com>
3104
3105         [GTK] Garbled rendering on Youtube while scrolling under X11.
3106         https://bugs.webkit.org/show_bug.cgi?id=192982
3107
3108         Reviewed by Carlos Garcia Campos.
3109
3110         When creating a GLX window context, try to get a GLXFBConfig that has depth and stencil buffers for
3111         the default framebuffer.
3112
3113         * platform/graphics/glx/GLContextGLX.cpp:
3114         (WebCore::compatibleVisuals):
3115         (WebCore::GLContextGLX::createWindowContext):
3116
3117 2019-01-11  Sihui Liu  <sihui_liu@apple.com>
3118
3119         IndexedDB: leak IDBTransaction, TransactionOperation and IDBRequest in layout tests
3120         https://bugs.webkit.org/show_bug.cgi?id=193167
3121         <rdar://problem/46891688>
3122
3123         Reviewed by Geoffrey Garen.
3124
3125         Do some cleanup to break retain cycle when context is stopped. 
3126
3127         * Modules/indexeddb/IDBOpenDBRequest.cpp:
3128         (WebCore::IDBOpenDBRequest::cancelForStop):
3129         * Modules/indexeddb/IDBTransaction.cpp:
3130         (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
3131         (WebCore::IDBTransaction::stop):
3132         (WebCore::IDBTransaction::removeRequest):
3133         * Modules/indexeddb/client/TransactionOperation.h:
3134         (WebCore::IDBClient::TransactionOperation::doComplete):
3135
3136 2019-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3137
3138         Introduce IDL files for runtime-enabled UndoManager and UndoItem JavaScript API
3139         https://bugs.webkit.org/show_bug.cgi?id=193109
3140         <rdar://problem/44807048>
3141
3142         Reviewed by Ryosuke Niwa.
3143
3144         Adds new IDL files and stubs for UndoManager and UndoItem. This is an experimental DOM API that (in the near
3145         future) is intended only for use in internal WebKit text editing clients. This API allows the page to
3146         participate in the processes of undoing and redoing by defining custom undo and redo handlers, to be executed
3147         when undo or redo is triggered.
3148
3149         Tests: editing/undo-manager/undo-manager-interfaces.html
3150                editing/undo-manager/undo-manager-keeps-wrapper-alive.html
3151
3152         * CMakeLists.txt:
3153         * DerivedSources-input.xcfilelist:
3154         * DerivedSources-output.xcfilelist:
3155         * DerivedSources.make:
3156         * Sources.txt:
3157         * UnifiedSources-input.xcfilelist:
3158         * WebCore.xcodeproj/project.pbxproj:
3159
3160         Add new source files.
3161
3162         * bindings/js/WebCoreBuiltinNames.h:
3163
3164         Add "UndoManager" and "UndoItem" names.
3165
3166         * dom/Document.cpp:
3167         (WebCore::m_undoManager):
3168
3169         Have the document own a UndoManager.
3170
3171         * dom/Document.h:
3172         (WebCore::Document::undoManager const):
3173         * dom/Document.idl:
3174         * page/RuntimeEnabledFeatures.h:
3175         (WebCore::RuntimeEnabledFeatures::setUndoManagerAPIEnabled):
3176         (WebCore::RuntimeEnabledFeatures::undoManagerAPIEnabled const):
3177
3178         Guard the new bindings behind a runtime-enabled feature flag.
3179
3180         * page/UndoItem.h: Added.
3181         (WebCore::UndoItem::create):
3182         (WebCore::UndoItem::label const):
3183         (WebCore::UndoItem::undoHandler const):
3184         (WebCore::UndoItem::redoHandler const):
3185         (WebCore::UndoItem::UndoItem):
3186         * page/UndoItem.idl: Added.
3187         * page/UndoManager.cpp: Added.
3188         (WebCore::UndoManager::addItem):
3189         * page/UndoManager.h: Added.
3190         (WebCore::UndoManager::create):
3191         (WebCore::UndoManager::document):
3192         (WebCore::UndoManager::UndoManager):
3193         * page/UndoManager.idl: Added.
3194         * page/mac/WheelEventDeltaFilterMac.h:
3195
3196         Necessary (albeit unrelated) build fix to appease unified sources.
3197
3198 2019-01-11  Zalan Bujtas  <zalan@apple.com>
3199
3200         [LFC][BFC][MarginCollapsing] Adjust vertical position when box margin collapses through.
3201         https://bugs.webkit.org/show_bug.cgi?id=193346
3202
3203         Reviewed by Antti Koivisto.
3204
3205         If the top and bottom margins of a box are adjoining, then it is possible for margins to collapse through it.
3206         In this case, the position of the element depends on its relationship with the other elements whose margins are being collapsed.
3207
3208         1. If the element's margins are collapsed with its parent's top margin, the top border edge of the box is defined to be the same as the parent's.
3209         2. Otherwise, either the element's parent is not taking part in the margin collapsing, or only the parent's bottom margin is involved.
3210            The position of the element's top border edge is the same as it would have been if the element had a non-zero bottom border.
3211
3212         Test: fast/block/block-only/collapsed-through-with-parent.html
3213
3214         * layout/MarginTypes.h:
3215         (WebCore::Layout::EstimatedMarginBefore::usedValue const):
3216         * layout/blockformatting/BlockFormattingContext.cpp:
3217         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
3218         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
3219         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
3220         * layout/blockformatting/BlockFormattingContext.h:
3221         * layout/blockformatting/BlockMarginCollapse.cpp:
3222         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
3223         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeIgnoringCollapsingThrough):
3224
3225 2019-01-10  Myles C. Maxfield  <mmaxfield@apple.com>
3226
3227         [WHLSL] Include the standard library
3228         https://bugs.webkit.org/show_bug.cgi?id=192994
3229
3230         Reviewed by Jon Lee.
3231
3232         A small section of the standard library is present in WHLSLStandardLibrary.txt. This gets turned into a header file containing
3233         its raw data at build time by invoking our xxd.pl script (which WebCore already uses for other purposes). The standard
3234         library is generated by running a JavaScript script, but currently there is no way to invoke JavaScript from our build
3235         process, so this patch includes in the standard library's raw text instead. Once the parser is faster, we can include the
3236         entire standard library.
3237
3238         No new tests because it isn't hooked up yet.
3239
3240         * DerivedSources.make:
3241         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: Added.
3242         * WebCore.xcodeproj/project.pbxproj:
3243
3244 2019-01-10  Jer Noble  <jer.noble@apple.com>
3245
3246         <video> elements do not enter 'paused' state when playing to end over AirPlay
3247         https://bugs.webkit.org/show_bug.cgi?id=193295
3248         <rdar://problem/46708670>
3249
3250         Reviewed by Eric Carlson.
3251
3252         Adopt the -[AVPlayer timeControlStatus] API, which reports whether the AVPlayer is paused, playing, or blocked waiting
3253         for more data before playing. AirPlay devices report this state back from the remote device, and this allows the
3254         MediaPlayerPrivateAVFoundationObjC to differentiate between user-generated pauses and simple stalling.
3255
3256         Adopting this API allows us to remove the heuristic from rateChanged() which inteprets a rate change when the
3257         readyState > HAVE_ENOUGH as an intentional pause.
3258
3259         Drive-by fix: MediaPlayerPrivateAVFoundation had some code to delay calling platformPlay()
3260         until the first frame became available. But this code was entirely undermined by the previous
3261         behavior of setRate(). Fixing setRate()/setRateDouble() to only start playback if playback was
3262         actually requested started making this code work for the first time, and broke some API tests.
3263         Thus, we're removing this previously dead code.
3264
3265         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3266         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
3267         (WebCore::MediaPlayerPrivateAVFoundation::play):
3268         (WebCore::MediaPlayerPrivateAVFoundation::pause):
3269         (WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
3270         (WebCore::MediaPlayerPrivateAVFoundation::updateStates):
3271         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3272         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3273         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3274         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
3275         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
3276         (WebCore::MediaPlayerPrivateAVFoundationObjC::didEnd):
3277         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPlay):
3278         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPause):
3279         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
3280         (WebCore::MediaPlayerPrivateAVFoundationObjC::setRateDouble):
3281         (WebCore::MediaPlayerPrivateAVFoundationObjC::setPlayerRate):
3282         (WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange):
3283         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus):
3284         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
3285
3286 2019-01-10  Myles C. Maxfield  <mmaxfield@apple.com>
3287
3288         Fix the build after r239844
3289         https://bugs.webkit.org/show_bug.cgi?id=192991
3290
3291         Unreviewed.
3292
3293         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
3294         (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableType const):
3295         (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableForShaderItemDirection const):
3296         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
3297         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
3298         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableForShaderItemDirection const):
3299         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
3300         (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableType const):
3301         (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableForShaderItemDirection const):
3302         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
3303         (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableType const):
3304         (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableForShaderItemDirection const):
3305
3306 2019-01-10  Justin Fan  <justin_fan@apple.com>
3307
3308         [WebGPU] WebGPUBindGroup and device::createBindGroup prototype
3309         https://bugs.webkit.org/show_bug.cgi?id=193341
3310
3311         Reviewed by Myles C. Maxfield.
3312
3313         Add *GPUBindGroup class stubs and the ability to create WebGPUBindGroups via the API.
3314
3315         Test: bind-groups.html
3316
3317         * CMakeLists.txt:
3318         * DerivedSources.make:
3319         * Sources.txt:
3320         * WebCore.xcodeproj/project.pbxproj:
3321         * bindings/js/WebCoreBuiltinNames.h:
3322
3323         * Modules/webgpu/WebGPUBindGroup.cpp:
3324         (WebCore::WebGPUBindGroup::create):
3325         (WebCore::WebGPUBindGroup::WebGPUBindGroup):
3326         * Modules/webgpu/WebGPUBindGroup.h:
3327         * Modules/webgpu/WebGPUBindGroup.idl: Enable createBindGroup().
3328         * Modules/webgpu/WebGPUDevice.cpp:
3329         (WebCore::BindingResourceVisitor::operator() const): Added. Validate and convert WebGPUBindGroupDescriptor to GPU* version.
3330         (WebCore::WebGPUDevice::createBindGroup const): Added.
3331         * Modules/webgpu/WebGPUDevice.h:
3332         * platform/graphics/gpu/GPUBindGroup.cpp:
3333         (WebCore::GPUBindGroup::create):
3334         (WebCore::GPUBindGroup::GPUBindGroup):
3335         * platform/graphics/gpu/GPUBindGroup.h:
3336         * platform/graphics/gpu/GPUBufferBinding.h:
3337         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
3338         (WebCore::appendArgumentToArray): Pass RetainPtr by reference to actually update descriptor.
3339
3340 2019-01-10  Simon Fraser  <simon.fraser@apple.com>
3341
3342         Fix rare crash under ScrollbarThemeMac::paintScrollCorner()
3343         https://bugs.webkit.org/show_bug.cgi?id=193337
3344         rdar://problem/47179993
3345
3346         Reviewed by Zalan Bujtas.
3347         
3348         Async image decoding can trigger a FrameView::traverseForPaintInvalidation() fake paint,
3349         which creates a GraphicsContext with no platform context. However, we could hit ScrollView::paintScrollbars()
3350         which tried to get at the platform context, and then crashed.
3351         
3352         So protect two functions in ScrollbarThemeMac with if (context.paintingDisabled()) checks. I verified
3353         that other scrollbar-related painting code paths were already protected.
3354
3355         Hard to test because it depends on async image decoding timing.
3356
3357         * platform/mac/ScrollbarThemeMac.mm:
3358         (WebCore::ScrollbarThemeMac::paint):
3359         (WebCore::ScrollbarThemeMac::paintScrollCorner):
3360
3361 2019-01-10  Myles C. Maxfield  <mmaxfield@apple.com>
3362
3363         [WHLSL] Implement parser AST nodes
3364         https://bugs.webkit.org/show_bug.cgi?id=192991
3365
3366         Reviewed by Alex Christensen.
3367
3368         This patch creates all the AST nodes which will be the result of running the parser.
3369         This patch used to be a part of the "create a WHLSL parser" patch but I split them
3370         out in order to aid reviewing.
3371
3372         The classes were mechanically created to match the result of the parser. There are
3373         nodes for things like ForLoops, LogicalNotExpressions, DereferenceExpressions,
3374         StructureDefinitions, and things like that. The classes don't actually have any logic
3375         in them - they are currently just containers to hold the structure of the parsed
3376         program. Some of these nodes (like constexprs) are just Variants of the various things
3377         they can in the form of.
3378
3379         No new tests because the parser doesn't exist to create the new AST nodes yet.
3380
3381         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h: Added.
3382         (WebCore::WHLSL::AST::ArrayReferenceType::ArrayReferenceType):
3383         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h: Added.
3384         (WebCore::WHLSL::AST::ArrayType::ArrayType):
3385         (WebCore::WHLSL::AST::ArrayType::type const):
3386         (WebCore::WHLSL::AST::ArrayType::type):
3387         (WebCore::WHLSL::AST::ArrayType::numElements const):
3388         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h: Added.