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