[iOS] ERROR: post-layout: dirty renderer(s) in WebCore::RenderTreeNeedsLayoutChecker...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-01-04  Zalan Bujtas  <zalan@apple.com>
2
3         [iOS] ERROR: post-layout: dirty renderer(s) in WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker()
4         https://bugs.webkit.org/show_bug.cgi?id=189608
5         <rdar://problem/44473299>
6
7         Reviewed by Simon Fraser.
8
9         When a frameset/iframe is hidden and we skip layout, clear the dirty flag on its subtree as well.
10
11         Covered by fast/frames/invalid-frameset.html.
12
13         * rendering/RenderFrameSet.cpp:
14         (WebCore::clearSiblingSubtrees):
15         (WebCore::RenderFrameSet::positionFrames):
16         (WebCore::RenderFrameSet::positionFramesWithFlattening):
17
18 2019-01-04  Youenn Fablet  <youenn@apple.com>
19
20         [Fetch API] Implement abortable fetch
21         https://bugs.webkit.org/show_bug.cgi?id=174980
22         <rdar://problem/46861402>
23
24         Reviewed by Chris Dumez.
25
26         Add an AbortSignal to FetchRequest.
27
28         Add support for AbortSignal algorithm.
29         The fetch request signal is added an algorithm to abort the fetch.
30         Update clone algorithm to let signal of the cloned request be following the origin request.
31
32         Update ReadableStream error handling to return an exception instead of a string.
33         This allows passing an AbortError instead of a TypeError as previously done.
34
35         Update FetchBodyOwner to store a loading error either as an exception or as a resource error.
36         The latter is used for passing the error from service worker back to the page.
37         The former is used to pass it to ReadableStream or body accessors.
38
39         Covered by enabled tests.
40
41         * Modules/cache/DOMCache.cpp:
42         (WebCore::DOMCache::put):
43         * Modules/fetch/FetchBody.cpp:
44         (WebCore::FetchBody::consumeAsStream):
45         (WebCore::FetchBody::loadingFailed):
46         * Modules/fetch/FetchBody.h:
47         * Modules/fetch/FetchBodyConsumer.cpp:
48         (WebCore::FetchBodyConsumer::loadingFailed):
49         * Modules/fetch/FetchBodyConsumer.h:
50         * Modules/fetch/FetchBodyOwner.cpp:
51         (WebCore::FetchBodyOwner::arrayBuffer):
52         (WebCore::FetchBodyOwner::blob):
53         (WebCore::FetchBodyOwner::cloneBody):
54         (WebCore::FetchBodyOwner::formData):
55         (WebCore::FetchBodyOwner::json):
56         (WebCore::FetchBodyOwner::text):
57         (WebCore::FetchBodyOwner::loadBlob):
58         (WebCore::FetchBodyOwner::blobLoadingFailed):
59         (WebCore::FetchBodyOwner::consumeBodyAsStream):
60         (WebCore::FetchBodyOwner::setLoadingError):
61         * Modules/fetch/FetchBodyOwner.h:
62         (WebCore::FetchBodyOwner::loadingError const):
63         (WebCore::FetchBodyOwner::loadingException const):
64         * Modules/fetch/FetchBodySource.cpp:
65         (WebCore::FetchBodySource::error):
66         * Modules/fetch/FetchBodySource.h:
67         * Modules/fetch/FetchRequest.cpp:
68         (WebCore::FetchRequest::initializeWith):
69         (WebCore::FetchRequest::clone):
70         * Modules/fetch/FetchRequest.h:
71         (WebCore::FetchRequest::FetchRequest):
72         * Modules/fetch/FetchRequest.idl:
73         * Modules/fetch/FetchRequestInit.h:
74         (WebCore::FetchRequestInit::hasMembers const):
75         * Modules/fetch/FetchRequestInit.idl:
76         * Modules/fetch/FetchResponse.cpp:
77         (WebCore::FetchResponse::clone):
78         (WebCore::FetchResponse::fetch):
79         (WebCore::FetchResponse::BodyLoader::didFail):
80         * Modules/fetch/FetchResponse.h:
81         * bindings/js/ReadableStreamDefaultController.h:
82         (WebCore::ReadableStreamDefaultController::error):
83         * dom/AbortSignal.cpp:
84         (WebCore::AbortSignal::abort):
85         (WebCore::AbortSignal::follow):
86         * dom/AbortSignal.h:
87
88 2019-01-04  Brent Fulgham  <bfulgham@apple.com>
89
90         Parsed protocol of javascript URLs with embedded newlines and carriage returns do not match parsed protocol in Chrome and Firefox
91         https://bugs.webkit.org/show_bug.cgi?id=193155
92         <rdar://problem/40230982>
93
94         Reviewed by Chris Dumez.
95
96         Test: fast/loader/comment-only-javascript-url.html
97
98         Make a special case for URLs beginning with 'javascript:'. We should always
99         treat these as JS URLs, even if the content contained within the URL
100         string might match other parts of the URL parsing spec.
101
102         * html/URLUtils.h:
103         (WebCore::URLUtils<T>::protocol const):
104
105 2019-01-04  Jer Noble  <jer.noble@apple.com>
106
107         [WebKitLegacy] Media playback pauses on scroll
108         https://bugs.webkit.org/show_bug.cgi?id=192829
109
110         Reviewed by Eric Carlson.
111
112         New API tests:
113             WebKitLegacy.ScrollingDoesNotPauseMedia
114             WKWebView.StopAllMediaPlayback
115             WKWebView.SuspendResumeAllMediaPlayback
116
117         Do not use suspendActiveDOMObjects(ReasonForSuspension::PageWillBeSuspended) to pause
118         video. Roll back the changes to HTMLMediaElement, and introduce a new set of Page calls
119         suspendAllMediaPlayback() & resumeAllMediaPlayback() which replaces the removed bahavior.
120
121         * dom/Document.cpp:
122         (WebCore::Document::~Document):
123         (WebCore::Document::stopAllMediaPlayback):
124         (WebCore::Document::suspendAllMediaPlayback):
125         (WebCore::Document::resumeAllMediaPlayback):
126         * dom/Document.h:
127         * html/HTMLMediaElement.cpp:
128         (WebCore::HTMLMediaElement::HTMLMediaElement):
129         (WebCore::HTMLMediaElement::parseAttribute):
130         (WebCore::HTMLMediaElement::didFinishInsertingNode):
131         (WebCore::HTMLMediaElement::setSrcObject):
132         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
133         (WebCore::HTMLMediaElement::suspend):
134         (WebCore::HTMLMediaElement::resume):
135         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const):
136         * html/HTMLMediaElement.h:
137         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const): Deleted.
138         * html/MediaElementSession.cpp:
139         (WebCore::MediaElementSession::playbackPermitted const):
140         * page/Page.cpp:
141         (WebCore::Page::stopAllMediaPlayback):
142         (WebCore::Page::suspendAllMediaPlayback):
143         (WebCore::Page::resumeAllMediaPlayback):
144         * page/Page.h:
145         (WebCore::Page::mediaPlaybackIsSuspended):
146         * platform/audio/PlatformMediaSession.h:
147         * platform/audio/PlatformMediaSessionManager.cpp:
148         (WebCore::PlatformMediaSessionManager::suspendAllMediaPlaybackForDocument):
149         (WebCore::PlatformMediaSessionManager::resumeAllMediaPlaybackForDocument):
150         * platform/audio/PlatformMediaSessionManager.h:
151
152 2019-01-04  Chris Dumez  <cdumez@apple.com>
153
154         Add support for toggling device orientation API support per site
155         https://bugs.webkit.org/show_bug.cgi?id=193143
156         <rdar://problem/46605724>
157
158         Reviewed by Alex Christensen.
159
160         Add support for toggling device orientation API support per site via _WKWebsitePolicies.
161
162         * dom/Document.cpp:
163         (WebCore::Document::simulateDeviceOrientationChange):
164         * dom/Document.h:
165         * loader/DocumentLoader.h:
166         (WebCore::DocumentLoader::deviceOrientationEventEnabled const):
167         (WebCore::DocumentLoader::setDeviceOrientationEventEnabled):
168         * page/DOMWindow.cpp:
169         (WebCore::DOMWindow::addEventListener):
170
171 2019-01-04  Jer Noble  <jer.noble@apple.com>
172
173         Web Content process main thread blocked beneath ImageDecoderAVFObjC::readSamples for many seconds on imgur.com
174         https://bugs.webkit.org/show_bug.cgi?id=191806
175         <rdar://problem/46151477>
176
177         Reviewed by Dean Jackson.
178
179         Test: http/tests/images/mp4-partial-load.html
180
181         Rather than use an AVAssetReaderTrackOutput, which will load both sample metadata and sample data
182         synchronously when a sample is requested, use AVAssetReaderSampleReferenceOutput, which only loads
183         sample metadata, including the byte offset and byte length of the sample data. By waiting until the
184         AVAsset signals that it's own metadata is loaded, we can safely parse all the sample metadata without
185         blocking on network loads. Once enough data is loaded, we can replace the byte reference and offset
186         attachements in the sample with actual data, and mark the sample as "complete".
187
188         Because the existing ImageSource assumes that image data parsing will occur synchronously, and that
189         synchronous parsing could cause a hang if the metadata is not loaded, add a new callback method which
190         allows the ImageSource to be notified when the encodedDataStatus changes. The ImageSource notifies the
191         CacheImage, which notifies the RenderImage, and thus the asynchronous parsing will kick off the
192         renderer's animation loop.
193
194         * loader/cache/CachedImage.cpp:
195         (WebCore::CachedImage::CachedImageObserver::encodedDataStatusChanged):
196         (WebCore::CachedImage::encodedDataStatusChanged):
197         * loader/cache/CachedImage.h:
198         * platform/graphics/ImageDecoder.h:
199         (WebCore::ImageDecoder::setEncodedDataStatusChangeCallback):
200         * platform/graphics/ImageObserver.h:
201         (WebCore::ImageObserver::encodedDataStatusChanged):
202         * platform/graphics/ImageSource.cpp:
203         (WebCore::ImageSource::ensureDecoderAvailable):
204         (WebCore::ImageSource::encodedDataStatusChanged):
205         (WebCore::ImageSource::frameDecodingStatusAtIndex):
206         * platform/graphics/ImageSource.h:
207         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
208         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
209         (-[WebCoreSharedBufferResourceLoaderDelegate data]):
210         (WebCore::ImageDecoderAVFObjCSample::byteRange const):
211         (WebCore::ImageDecoderAVFObjC::readSamples):
212         (WebCore::ImageDecoderAVFObjC::setEncodedDataStatusChangeCallback):
213         (WebCore::ImageDecoderAVFObjC::encodedDataStatus const):
214         (WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const):
215         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
216         (WebCore::ImageDecoderAVFObjC::sampleIsComplete const):
217
218 2019-01-04  Youenn Fablet  <youenn@apple.com>
219
220         CSP violation reports should bypass CSP checks
221         https://bugs.webkit.org/show_bug.cgi?id=192857
222         <rdar://problem/46887236>
223
224         Reviewed by Chris Dumez.
225
226         For ping loads, pass the option to do CSP checks from PingLoader to LoaderStrategy.
227         This new option is unused by WebKit Legacy.
228         It is used by WebKit loader strategy to only send any CSP response header to network process
229         in case CSP checks should be done.
230
231         This option is used to disable CSP checks for Ping Loads that report CSP violations.
232
233         Test: http/wpt/fetch/csp-reports-bypass-csp-checks.html
234
235         * loader/LoaderStrategy.h:
236         * loader/PingLoader.cpp:
237         (WebCore::PingLoader::loadImage):
238         (WebCore::PingLoader::sendPing):
239         (WebCore::PingLoader::sendViolationReport):
240         (WebCore::PingLoader::startPingLoad):
241         * loader/PingLoader.h:
242         * loader/cache/CachedResource.cpp:
243         (WebCore::CachedResource::load):
244
245 2019-01-04  Wenson Hsieh  <wenson_hsieh@apple.com>
246
247         [Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function
248         https://bugs.webkit.org/show_bug.cgi?id=193129
249
250         Reviewed by Tim Horton.
251
252         Adds a new helper function that returns the undo/redo name for a given EditAction. No change in behavior.
253
254         * Sources.txt:
255         * WebCore.xcodeproj/project.pbxproj:
256         * editing/EditAction.cpp: Copied from Source/WebKit/UIProcess/WebEditCommandProxy.cpp.
257         (WebCore::nameForUndoRedo):
258         * editing/EditAction.h:
259         * editing/Editor.cpp:
260
261 2019-01-03  Matt Rajca  <mrajca@apple.com>
262
263         Make DidPlayMediaPreventedFromPlaying autoplay event more generic.
264         https://bugs.webkit.org/show_bug.cgi?id=193128
265         rdar://34554231
266
267         Reviewed by Jer Noble.
268
269         Today, the "DidPlayMediaPreventedFromPlaying" autoplay event is only sent for
270         media prevented from autoplaying. It could be generalized to a "DidPlayMediaWithUserGesture"
271         event along with a flag that indicates whether or not autoplay was actually prevented.
272         Moreover, we can include a flag that indicates whether the media element in question
273         is main content. Clients will then know in more cases when media was played with a user
274         gesture, whether or not it has audio, as well as its main content status. While the main
275         content heuristics may not be perfect, they covered the top 20 video-centric websites that
276         this was tested with and are meant to be used by clients for data evaluation purposes.
277
278         As part of this, the PlaybackWithoutUserGesture enum was renamed to AutoplayEventPlaybackState
279         since it now also applies to cases where there is a user gesture. The
280         `m_playbackWithoutUserGestureStartedTime` member variable was also removed in favor of
281         `playbackStartedTime` which also covers all the cases we care about.
282
283         Tests: existing API tests were updated to reflect the new names. New API tests
284         were added for the new case in which the "DidPlayMediaWithUserGesture" event is sent.
285
286         * html/HTMLMediaElement.cpp:
287         (WebCore::convertEnumerationToString): Update to new enum cases.
288         (WebCore::HTMLMediaElement::setReadyState): Ditto.
289         (WebCore::HTMLMediaElement::play): Ditto.
290         (WebCore::HTMLMediaElement::playInternal): Also cover the case where
291          playback was not prevented but there was a user gesture.
292         (WebCore::HTMLMediaElement::pauseInternal): Use new name.
293         (WebCore::HTMLMediaElement::setVolume): Use new name.
294         (WebCore::HTMLMediaElement::playbackProgressTimerFired): Dispatch the
295          DidPlayMediaWithUserGesture event when playback was started with a user
296          gesture as well.
297         (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Use new name.
298         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Ditto.
299         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto.
300         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto.
301         (WebCore::HTMLMediaElement::handleAutoplayEvent): Pass along new media state.
302         (WebCore::HTMLMediaElement::userDidInterfereWithAutoplay): Use new name.
303         (WebCore::HTMLMediaElement::setAutoplayEventPlaybackState): Stop setting
304          m_playbackWithoutUserGestureStartedTime in favor of using playbackStartedTime.
305         (WebCore::HTMLMediaElement::updateShouldPlay): Use new name.
306         (WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture): Renamed.
307         * html/HTMLMediaElement.h:
308         (WTF::LogArgument<WebCore::HTMLMediaElement::AutoplayEventPlaybackState>::toString): Renamed from...
309         (WTF::LogArgument<WebCore::HTMLMediaElement::PlaybackWithoutUserGesture>::toString):
310         * html/MediaElementSession.cpp:
311         (WebCore::MediaElementSession::isMainContentForPurposesOfAutoplayEvents const): Don't
312          do the hit testing check for the purposes of autoplay events. It seems to fail on the
313          basic Vimeo player due to overlapping divs.
314         (WebCore::isElementMainContentForPurposesOfAutoplay):
315         (WebCore::MediaElementSession::updateIsMainContent const): Keep the existing behavior
316          here of hit testing.
317         (WebCore::isMainContentForPurposesOfAutoplay): Renamed.
318         * html/MediaElementSession.h:
319         * page/AutoplayEvent.h:
320
321 2019-01-04  Youenn Fablet  <youenn@apple.com>
322
323         Crash in WebCore::ServiceWorkerGlobalScope
324         https://bugs.webkit.org/show_bug.cgi?id=192513
325         <rdar://problem/46563880>
326
327         Reviewed by Alex Christensen.
328
329         Store the identifier in its own variable to make sure we do not use workerThread after being moved.
330
331         * workers/service/ServiceWorkerGlobalScope.cpp:
332         (WebCore::ServiceWorkerGlobalScope::skipWaiting):
333
334 2019-01-04  Chris Fleizach  <cfleizach@apple.com>
335
336         AX: String check: "Rule" does not reflect the meaning of the <hr> html tag
337         https://bugs.webkit.org/show_bug.cgi?id=193041
338         <rdar://problem/46954090>
339
340         Reviewed by Zalan Bujtas.
341
342         * en.lproj/Localizable.strings:
343         * platform/cocoa/LocalizedStringsCocoa.mm:
344         (WebCore::AXHorizontalRuleDescriptionText):
345
346 2019-01-04  Zalan Bujtas  <zalan@apple.com>
347
348         [LFC] ComputedHorizontalMargin should have optional members
349         https://bugs.webkit.org/show_bug.cgi?id=193131
350
351         Reviewed by Antti Koivisto.
352
353         Split HorizontalMargin into UsedHorizontalMargin and ComputedHorizontalMargin. ComputedHorizontalMargin's members are optional.
354         (see computed vs used values)
355
356         * layout/FormattingContext.h:
357         * layout/FormattingContextGeometry.cpp:
358         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
359         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
360         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
361         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
362         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
363         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
364         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue): Deleted.
365         * layout/LayoutUnits.h:
366         * layout/MarginTypes.h:
367         * layout/Verification.cpp:
368         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
369         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
370         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
371         * layout/displaytree/DisplayBox.h:
372         (WebCore::Display::Box::setHorizontalMargin):
373         (WebCore::Display::Box::setHorizontalComputedMargin):
374         (WebCore::Display::Box::computedMarginStart const):
375         (WebCore::Display::Box::computedMarginEnd const):
376         * layout/floats/FloatAvoider.h:
377         (WebCore::Layout::FloatAvoider::marginStart const):
378         (WebCore::Layout::FloatAvoider::marginEnd const):
379         * layout/inlineformatting/InlineFormattingContext.cpp:
380         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
381         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
382         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
383
384 2019-01-04  Zalan Bujtas  <zalan@apple.com>
385
386         [LFC][BFC] Use computedValue and usedValue consistently
387         https://bugs.webkit.org/show_bug.cgi?id=193059
388
389         Reviewed by Antti Koivisto.
390
391         https://www.w3.org/TR/CSS22/cascade.html#value-stages
392
393         6.1.2 Computed values
394         Specified values are resolved to computed values during the cascade; for example URIs are made absolute and 'em' and 'ex' units
395         are computed to pixel or absolute lengths. Computing a value never requires the user agent to render the document...
396
397         6.1.3 Used values
398         Computed values are processed as far as possible without formatting the document. Some values, however, can only be determined when the document
399         is being laid out. For example, if the width of an element is set to be a certain percentage of its containing block, the width cannot be determined
400         until the width of the containing block has been determined. The used value is the result of taking the computed value and resolving any remaining
401         dependencies into an absolute value.
402
403         * layout/FormattingContext.cpp:
404         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
405         * layout/FormattingContextGeometry.cpp:
406         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
407         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
408         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
409         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
410         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
411         * layout/LayoutState.cpp:
412         (WebCore::Layout::LayoutState::LayoutState):
413         * layout/LayoutUnits.h:
414         * layout/Verification.cpp:
415         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
416         * layout/blockformatting/BlockFormattingContext.cpp:
417         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
418         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
419         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
420         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
421         * layout/displaytree/DisplayBox.cpp:
422         (WebCore::Display::Box::Box):
423         * layout/displaytree/DisplayBox.h:
424         (WebCore::Display::Box::setHasValidHorizontalComputedMargin):
425         (WebCore::Display::Box::setHorizontalComputedMargin):
426         (WebCore::Display::Box::computedMarginStart const):
427         (WebCore::Display::Box::computedMarginEnd const):
428         (WebCore::Display::Box::setHasValidHorizontalNonComputedMargin): Deleted.
429         (WebCore::Display::Box::setHorizontalNonComputedMargin): Deleted.
430         (WebCore::Display::Box::nonComputedMarginStart const): Deleted.
431         (WebCore::Display::Box::nonComputedMarginEnd const): Deleted.
432         * layout/floats/FloatAvoider.h:
433         (WebCore::Layout::FloatAvoider::marginStart const):
434         (WebCore::Layout::FloatAvoider::marginEnd const):
435         * layout/inlineformatting/InlineFormattingContext.cpp:
436         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
437
438 2019-01-03  Zalan Bujtas  <zalan@apple.com>
439
440         REGRESSION: -webkit-appearance test case crashes
441         https://bugs.webkit.org/show_bug.cgi?id=189302
442         <rdar://problem/44143049>
443
444         Reviewed by Wenson Hsieh.
445
446         The painting and the layout positions of the cancel button need to match in order to be able to interact with it.
447         This patch removes the previous position inlining attempts.
448
449         Test: fast/forms/webkit-appearance-searchfield-cancel-button-crash.html
450
451         * rendering/RenderThemeMac.mm:
452         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
453
454 2019-01-03  David Kilzer  <ddkilzer@apple.com>
455
456         Leak of WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback (48 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
457         <https://webkit.org/b/193122>
458         <rdar://problem/47022987>
459
460         Reviewed by Youenn Fablet.
461
462         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
463         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::AddRef const):
464         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::Release const):
465         - Remove `final` keyword so that
466           `new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()`
467           can be called.
468         (WebCore::LibWebRTCCertificateGenerator::generateCertificate):
469         - To fix the leak call
470           `new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()`
471           to create the object.
472
473 2019-01-03  Simon Fraser  <simon.fraser@apple.com>
474
475         REGRESSION (r238090): After showing the Find banner or tab bar, hit tests are vertically offset (or painting is not offset)
476         https://bugs.webkit.org/show_bug.cgi?id=193124
477         rdar://problem/46755409
478
479         Reviewed by Tim Horton.
480
481         Top content inset feeds into scrolling tree geometry, so when it changes we need to trigger
482         an update of the root scrolling node, which happens via RenderLayerBacking::updateGeometry().
483         So set a dirty bit on the root layer in frameViewDidChangeSize(), which is called from the code
484         path that runs when top content inset changes.
485
486         Find banner behavior is not easily testable. platform/mac/fast/events/content-inset-hit-testing.html did not detect the regression.
487
488         * rendering/RenderLayerCompositor.cpp:
489         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
490
491 2019-01-03  Chris Dumez  <cdumez@apple.com>
492
493         Potential infinite recursion in isFrameFamiliarWith(Frame&, Frame&)
494         https://bugs.webkit.org/show_bug.cgi?id=192997
495         <rdar://problem/46217271>
496
497         Reviewed by Antti Koivisto.
498
499         isFrameFamiliarWith(Frame&, Frame&) was called recursively using the passed frames' openers.
500         The issue is that a Frame can be its opener. There could also be a cycle in the opener chain.
501
502         To address the issue, simplify isFrameFamiliarWith() so that it is no longer recursive. We now
503         only check if the frames belong to the same pages or if their openers do. We no longer check
504         openers' opener and up.
505
506         Note that this function is used to check if a frame is allowed to target another. In practice,
507         it is unlikely to be useful to navigate an opener's opener and an openee's openee.
508
509         Tests: fast/dom/Window/window-open-opener-cycle.html
510                fast/dom/Window/window-open-self-as-opener.html
511
512         * page/FrameTree.cpp:
513         (WebCore::isFrameFamiliarWith):
514
515 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
516
517         REGRESSION (r239306): Don't disable font smoothing in transparent layers on macOS Mojave and later
518         https://bugs.webkit.org/show_bug.cgi?id=193095
519         <rdar://problem/47014944>
520
521         Reviewed by Zalan Bujtas.
522         
523         In r239306 we stopped making CALayers for font-smoothed text when not necessary on macOS Mojave
524         and later. However, we still turned off smoothing for non-opaque layers (setShouldSmoothFonts(false)),
525         which continues to affect the appearance of text.
526         
527         Fix by only calling setShouldSmoothFonts(false) when the OS supports font smoothing.
528
529         Test: compositing/contents-format/subpixel-antialiased-text.html
530
531         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
532         (WebCore::PlatformCALayer::drawLayerContents):
533
534 2019-01-02  David Kilzer  <ddkilzer@apple.com>
535
536         Leak of CMSampleBuffer (752 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
537         <https://webkit.org/b/193016>
538         <rdar://problem/46925703>
539
540         Reviewed by Simon Fraser.
541
542         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
543         (WebCore::copySampleBufferWithCurrentTimeStamp):
544         - Change to return RetainPtr<CMSampleBufferRef>.
545         - Check return value of CMSampleBufferCreateCopyWithNewTiming().
546         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
547         - Check return value of copySampleBufferWithCurrentTimeStamp().
548         - Fix leak by using RetainPtr<CMSampleBufferRef> returned from
549           copySampleBufferWithCurrentTimeStamp() instead of leaking
550           `bufferWithCurrentTime` by using retainPtr().
551         (WebCore::createAudioFormatDescription):
552         - Extract method from appendAudioSampleBuffer() to return
553           RetainPtr<CMFormatDescriptionRef> after calling
554           CMAudioFormatDescriptionCreate().
555         - Check return value of CMAudioFormatDescriptionCreate().
556         (WebCore::createAudioSampleBufferWithPacketDescriptions):
557         - Extract method from appendAudioSampleBuffer() to return
558           RetainPtr<CMSampleBufferRef> after calling
559           CMAudioSampleBufferCreateWithPacketDescriptions().
560         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
561         - Check return values of createAudioFormatDescription() and
562           createAudioSampleBufferWithPacketDescriptions().
563         - Fix leaks by extracting code into helper methods that return
564           RetainPtr<> objects instead of leaking CMFormatDescriptionRef
565           directly or leaking `sampleBuffer` by using retainPtr().
566
567 2019-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
568
569         Add support for using the current text selection as the find string on iOS
570         https://bugs.webkit.org/show_bug.cgi?id=193034
571         <rdar://problem/45138739>
572
573         Reviewed by Tim Horton.
574
575         Add support for "TakeFindStringFromSelection" on iOS. Unlike macOS, iOS does not have a notion of a "find
576         pasteboard" like macOS; instead, we handle this editing command by sending the selection string to the UI
577         process, where it is exposed via WebKit SPI so that clients that present find-in-page UI (i.e. MobileSafari) are
578         able to trigger find-in-page with this string.
579
580         Test: WebKit.UseSelectionAsFindString
581
582         * editing/Editor.cpp:
583         (WebCore::Editor::canCopyExcludingStandaloneImages const):
584
585         Make this helper function cross-platform.
586
587         * editing/Editor.h:
588         * editing/EditorCommand.cpp:
589         (WebCore::createCommandMap):
590         * editing/cocoa/EditorCocoa.mm:
591         (WebCore::Editor::takeFindStringFromSelection):
592
593         Move this from EditorMac to EditorCocoa, and implement it on iOS by calling into the editor client to update the
594         find string (see WebKit/ChangeLog for more details).
595
596         * editing/mac/EditorMac.mm:
597         (WebCore::Editor::canCopyExcludingStandaloneImages): Deleted.
598         (WebCore::Editor::takeFindStringFromSelection): Deleted.
599         * loader/EmptyClients.cpp:
600         * page/EditorClient.h:
601
602         Add a new editor client method to send the string for find-in-page to the UI process.
603
604 2019-01-02  Devin Rousso  <webkit@devinrousso.com>
605
606         Web Inspector: Implement `queryObjects` Command Line API
607         https://bugs.webkit.org/show_bug.cgi?id=176766
608         <rdar://problem/34890689>
609
610         Reviewed by Joseph Pecoraro.
611
612         Test: inspector/console/queryObjects.html
613
614         * inspector/CommandLineAPIModuleSource.js:
615         (CommandLineAPI):
616         (CommandLineAPIImpl.prototype.queryObjects): Added.
617
618 2019-01-02  Charles Vazac  <cvazac@gmail.com>
619
620         Fix resourcetimingbufferfull bubbles attribute
621         https://bugs.webkit.org/show_bug.cgi?id=193087
622
623         Reviewed by Chris Dumez.
624
625         This change is covered by web-platform-tests [1].
626
627         [1] https://github.com/web-platform-tests/wpt/blob/master/resource-timing/buffer-full-when-populate-entries.html#L20
628
629         * page/Performance.cpp:
630         (WebCore::Performance::resourceTimingBufferFullTimerFired):
631
632 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
633
634         Rename LayerScrollCoordinationRole to ScrollCoordinationRole and make an enum class
635         https://bugs.webkit.org/show_bug.cgi?id=193010
636
637         Reviewed by Zalan Bujtas.
638
639         Move the enum LayerScrollCoordinationRole from RenderLayer.h to RenderLayerCompositor.h,
640         and make it an enum class.
641
642         * page/FrameView.cpp:
643         (WebCore::FrameView::scrollLayerID const):
644         * rendering/RenderLayer.h:
645         * rendering/RenderLayerBacking.cpp:
646         (WebCore::RenderLayerBacking::~RenderLayerBacking):
647         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
648         (WebCore::operator<<):
649         * rendering/RenderLayerBacking.h:
650         * rendering/RenderLayerCompositor.cpp:
651         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
652         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
653         (WebCore::scrollCoordinationRoleForNodeType):
654         (WebCore::RenderLayerCompositor::attachScrollingNode):
655         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
656         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
657         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
658         * rendering/RenderLayerCompositor.h:
659
660 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
661
662         Don't spin up a CalcParser if the current token is not a function token
663         https://bugs.webkit.org/show_bug.cgi?id=193067
664
665         Reviewed by Zalan Bujtas.
666
667         Various functions in CSSPropertyParserHelpers fall back to trying to parse
668         a calc expression if the normal parsing fails. Don't do this unless the
669         current token is a function token, which should be slightly more efficient.
670
671         * css/parser/CSSPropertyParserHelpers.cpp:
672         (WebCore::CSSPropertyParserHelpers::consumeInteger):
673         (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
674         (WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
675         (WebCore::CSSPropertyParserHelpers::consumeNumber):
676         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
677         (WebCore::CSSPropertyParserHelpers::consumeLength):
678         (WebCore::CSSPropertyParserHelpers::consumePercent):
679         (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
680         (WebCore::CSSPropertyParserHelpers::consumeAngle):
681         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
682         (WebCore::CSSPropertyParserHelpers::consumeTime):
683
684 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
685
686         Support css-color-4 rgb functions
687         https://bugs.webkit.org/show_bug.cgi?id=192321
688
689         Reviewed by Zalan Bujtas.
690         
691         Support the new rgb()/rgba() syntax described in https://drafts.csswg.org/css-color/#rgb-functions.
692         The differences are:
693         1. There is a new comma-free syntax, where the optional alpha is separated by a slash:
694             rgb(128 34 56)
695             rgb(128 34 56 / 50%)
696         2. Floating point values are allowed, and rounded:
697             rgb(128.5 34.2 56.5) becomes rgb(129 34 57)
698         3. rgba() is a pure alias for rgb(), so these are equivalent:
699             rgb(128 34 56 / 50%)
700             rgba(128 34 56 / 50%)
701             
702         hsl()/hsla() parsing was already updated to this new syntax in r230861.
703
704         Tested by tests in imported/w3c/web-platform-tests/css/css-color/
705
706         * css/parser/CSSPropertyParserHelpers.cpp:
707         (WebCore::CSSPropertyParserHelpers::clampRGBComponent):
708         (WebCore::CSSPropertyParserHelpers::parseRGBParameters):
709         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
710
711 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
712
713         Handle calc() expressions in gradient color stops
714         https://bugs.webkit.org/show_bug.cgi?id=193066
715         rdar://problem/46961985
716
717         Reviewed by Sam Weinig.
718         
719         Fix two issues that prevented calc() expressions from working in conic-gradient color stops,
720         for the angle or percent value. First, consumeAngleOrPercent() needs to look for CalculationCategory::Percent
721         calc values as well as angle ones.
722
723         Second, CSSPrimitiveValue::isAngle() needs to use primitiveType() (which takes calc into account),
724         just as isPx() etc do.
725
726         Test: fast/gradients/conic-calc-stop-position.html
727
728         * css/CSSPrimitiveValue.h:
729         (WebCore::CSSPrimitiveValue::isAngle const):
730         * css/parser/CSSPropertyParserHelpers.cpp:
731         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
732         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
733
734 2018-12-31  Keith Miller  <keith_miller@apple.com>
735
736         SourceProviders should use an actual URL instead of a string
737         https://bugs.webkit.org/show_bug.cgi?id=192734
738
739         Reviewed by Yusuke Suzuki.
740
741         Remove ScriptSourceCode's URL member and make the url() method
742         reference the URL on the SourceProvider. Also, avoid some
743         ref count churn.
744
745         Additionally, this patch fixes an existing bug in
746         WorkletGlobalScope() that would use a ScriptSourceCode after
747         WTFMoving it.
748
749         * bindings/js/CachedScriptSourceProvider.h:
750         (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
751         * bindings/js/ScheduledAction.cpp:
752         (WebCore::ScheduledAction::execute):
753         * bindings/js/ScriptController.cpp:
754         (WebCore::ScriptController::executeScriptInWorld):
755         (WebCore::ScriptController::executeScript):
756         * bindings/js/ScriptSourceCode.h:
757         (WebCore::ScriptSourceCode::ScriptSourceCode):
758         (WebCore::ScriptSourceCode::m_code):
759         (WebCore::ScriptSourceCode::url const):
760         (WebCore::ScriptSourceCode::m_url): Deleted.
761         * dom/ScriptElement.cpp:
762         (WebCore::ScriptElement::prepareScript):
763         (WebCore::ScriptElement::requestModuleScript):
764         (WebCore::ScriptElement::executePendingScript):
765         * html/HTMLMediaElement.cpp:
766         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
767         * page/Frame.cpp:
768         (WebCore::Frame::injectUserScriptImmediately):
769         * workers/WorkerGlobalScope.cpp:
770         (WebCore::WorkerGlobalScope::importScripts):
771         * workers/WorkerThread.cpp:
772         (WebCore::WorkerThread::workerThread):
773         * worklets/WorkletGlobalScope.cpp:
774         (WebCore::WorkletGlobalScope::WorkletGlobalScope):
775         * xml/parser/XMLDocumentParserLibxml2.cpp:
776         (WebCore::XMLDocumentParser::endElementNs):
777
778 2019-01-01  Jeff Miller  <jeffm@apple.com>
779
780         Update user-visible copyright strings to include 2019
781         https://bugs.webkit.org/show_bug.cgi?id=192811
782
783         Reviewed by Mark Lam.
784
785         * Info.plist:
786
787 2018-12-30  David Kilzer  <ddkilzer@apple.com>
788
789         clang-tidy: Save 8 padding bytes on WebCore::BorderEdge
790         <https://webkit.org/b/193058>
791         <rdar://problem/46979275>
792
793         Reviewed by Yusuke Suzuki.
794
795         * rendering/BorderEdge.cpp:
796         (WebCore::BorderEdge::BorderEdge): Reorder initialization to
797         match new instance variable order.
798         * rendering/BorderEdge.h: Reorder instance variables to save
799         8 padding bytes.
800
801 2018-12-28  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
802
803         [JSC] Remove one indirection in JSObject::toStringName
804         https://bugs.webkit.org/show_bug.cgi?id=193037
805
806         Reviewed by Keith Miller.
807
808         Use old JSObject::toStringName function here.
809
810         * bindings/js/JSDOMConstructorBase.cpp:
811         (WebCore::JSDOMConstructorBase::className):
812         (WebCore::JSDOMConstructorBase::toStringName):
813         * bindings/js/JSDOMConstructorBase.h:
814         (WebCore::JSDOMConstructorBase::className): Deleted.
815
816 2018-12-27  Alex Christensen  <achristensen@webkit.org>
817
818         Resurrect Mac CMake build
819         https://bugs.webkit.org/show_bug.cgi?id=192658
820
821         Reviewed by Yusuke Suzuki.
822
823         This makes it so JSC and most of WebCore builds.
824         WebCore's use of ARC seems inconsistent, so I'll fix that later.
825
826         * PlatformMac.cmake:
827         * config.h:
828
829 2018-12-26  Jim Mason  <jmason@ibinx.com>
830
831         [FreeType] Restore conditional compilation logic for recent HarfBuzz refactoring
832         https://bugs.webkit.org/show_bug.cgi?id=193036
833
834         Reviewed by Michael Catanzaro.
835
836         * platform/graphics/FontPlatformData.h:
837         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
838
839 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
840
841         Remove "using namespace std;"
842         https://bugs.webkit.org/show_bug.cgi?id=192973
843         <rdar://problem/46937309>
844
845         Unreviewed Windows port Debug builds fix.
846
847         No new tests since no behavior changes.
848
849         * accessibility/win/AXObjectCacheWin.cpp:
850         (WebCore::AXObjectCache::postPlatformNotification): Add "std::" prefix to numeric_limits in ASSERT macro.
851
852 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
853
854         Remove "using namespace std;"
855         https://bugs.webkit.org/show_bug.cgi?id=192973
856
857         Reviewed by Alex Christensen.
858
859         Removed "using namespace std" statement, and use std:: prefix.
860
861         No new tests since no behavior changes.
862
863         * accessibility/win/AXObjectCacheWin.cpp:
864         * platform/graphics/GraphicsContext3DPrivate.cpp:
865         * platform/graphics/cairo/ImageBufferCairo.cpp:
866         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
867         * platform/graphics/win/FontWin.cpp:
868         (WebCore::FontCascade::floatWidthForComplexText const):
869         * platform/graphics/win/GraphicsContextCGWin.cpp:
870         * platform/graphics/win/GraphicsContextCairoWin.cpp:
871         * platform/graphics/win/GraphicsContextDirect2D.cpp:
872         * platform/graphics/win/GraphicsContextWin.cpp:
873         * platform/graphics/win/SimpleFontDataCGWin.cpp:
874         * platform/graphics/win/UniscribeController.cpp:
875         (WebCore::UniscribeController::UniscribeController):
876         (WebCore::UniscribeController::shapeAndPlaceItem):
877         * platform/image-decoders/ScalableImageDecoder.cpp:
878         * platform/text/LocaleICU.cpp:
879         * platform/text/win/LocaleWin.cpp:
880         * platform/win/ScrollbarThemeWin.cpp:
881         * rendering/RenderRubyRun.cpp:
882         (WebCore::RenderRubyRun::layoutBlock):
883         * rendering/RenderThemeWin.cpp:
884         (WebCore::RenderThemeWin::adjustMenuListButtonStyle const):
885         (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
886         (WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle const):
887         (WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle const):
888         (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
889         (WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle const):
890         (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
891
892 2018-12-24  Simon Fraser  <simon.fraser@apple.com>
893
894         Change ScrollingNodeType to an enum class
895         https://bugs.webkit.org/show_bug.cgi?id=193009
896
897         Reviewed by Zalan Bujtas.
898
899         Change the ScrollingNodeType enum to an enum class.
900         
901         No behavior change.
902
903         * page/scrolling/AsyncScrollingCoordinator.cpp:
904         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
905         * page/scrolling/ScrollingCoordinator.cpp:
906         (WebCore::operator<<):
907         * page/scrolling/ScrollingCoordinator.h:
908         * page/scrolling/ScrollingStateFixedNode.cpp:
909         (WebCore::ScrollingStateFixedNode::ScrollingStateFixedNode):
910         * page/scrolling/ScrollingStateNode.h:
911         (WebCore::ScrollingStateNode::isFixedNode const):
912         (WebCore::ScrollingStateNode::isStickyNode const):
913         (WebCore::ScrollingStateNode::isFrameScrollingNode const):
914         (WebCore::ScrollingStateNode::isOverflowScrollingNode const):
915         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
916         (WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
917         * page/scrolling/ScrollingStateStickyNode.cpp:
918         (WebCore::ScrollingStateStickyNode::ScrollingStateStickyNode):
919         * page/scrolling/ScrollingStateTree.cpp:
920         (WebCore::ScrollingStateTree::createNode):
921         (WebCore::ScrollingStateTree::attachNode):
922         * page/scrolling/ScrollingTreeNode.h:
923         (WebCore::ScrollingTreeNode::isFixedNode const):
924         (WebCore::ScrollingTreeNode::isStickyNode const):
925         (WebCore::ScrollingTreeNode::isFrameScrollingNode const):
926         (WebCore::ScrollingTreeNode::isOverflowScrollingNode const):
927         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
928         (WebCore::ScrollingTreeOverflowScrollingNode::ScrollingTreeOverflowScrollingNode):
929         * page/scrolling/ios/ScrollingTreeIOS.cpp:
930         (WebCore::ScrollingTreeIOS::createScrollingTreeNode):
931         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
932         (WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
933         * page/scrolling/mac/ScrollingTreeMac.cpp:
934         (ScrollingTreeMac::createScrollingTreeNode):
935         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
936         (WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
937         * platform/graphics/GraphicsLayerClient.h:
938         * rendering/RenderLayerCompositor.cpp:
939         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
940         (WebCore::scrollCoordinationRoleForNodeType):
941         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
942         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
943
944 2018-12-22  Carlos Garcia Campos  <cgarcia@igalia.com>
945
946         [HarfBuzz] Width not correctly reported as 0 for zero font size
947         https://bugs.webkit.org/show_bug.cgi?id=192986
948
949         Reviewed by Michael Catanzaro.
950
951         Fixes test fast/text/font-size-zero.html
952
953         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
954         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Use empty advances for glyphs when the font
955         size is zero.
956
957 2018-12-20  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
958
959         Use Ref<> as much as possible
960         https://bugs.webkit.org/show_bug.cgi?id=192808
961
962         Reviewed by Alex Christensen.
963
964         * Modules/encryptedmedia/NavigatorEME.cpp:
965         (WebCore::NavigatorEME::requestMediaKeySystemAccess):
966         * Modules/fetch/FetchBody.cpp:
967         (WebCore::FetchBody::bodyAsFormData const):
968         * Modules/geolocation/Geolocation.cpp:
969         (WebCore::Geolocation::getCurrentPosition):
970         (WebCore::Geolocation::watchPosition):
971         * Modules/indexeddb/IDBDatabase.cpp:
972         (WebCore::IDBDatabase::objectStoreNames const):
973         * Modules/indexeddb/IDBDatabase.h:
974         * Modules/indexeddb/IDBObjectStore.cpp:
975         (WebCore::IDBObjectStore::indexNames const):
976         * Modules/indexeddb/IDBObjectStore.h:
977         * Modules/indexeddb/IDBTransaction.cpp:
978         (WebCore::IDBTransaction::scheduleOperation):
979         * Modules/indexeddb/IDBTransaction.h:
980         * Modules/indexeddb/client/TransactionOperation.h:
981         (WebCore::IDBClient::createTransactionOperation):
982         * Modules/mediastream/MediaDevices.cpp:
983         (WebCore::MediaDevices::getUserMedia const):
984         (WebCore::MediaDevices::getDisplayMedia const):
985         * Modules/mediastream/UserMediaRequest.cpp:
986         (WebCore::UserMediaRequest::create):
987         * Modules/mediastream/UserMediaRequest.h:
988         * Modules/webaudio/AudioParam.cpp:
989         (WebCore::AudioParam::calculateFinalValues):
990         * Modules/webaudio/ScriptProcessorNode.cpp:
991         (WebCore::ScriptProcessorNode::initialize):
992         * Modules/webdatabase/SQLStatement.cpp:
993         (WebCore::SQLStatement::execute):
994         * Modules/webgpu/WebGPU.cpp:
995         (WebCore::WebGPU::requestAdapter const):
996         * Modules/webgpu/WebGPUAdapter.cpp:
997         (WebCore::WebGPUAdapter::create):
998         * Modules/webgpu/WebGPUAdapter.h:
999         * Modules/webgpu/WebGPUBuffer.cpp:
1000         (WebCore::WebGPUBuffer::create):
1001         * Modules/webgpu/WebGPUBuffer.h:
1002         * Modules/webgpu/WebGPUCommandBuffer.cpp:
1003         (WebCore::WebGPUCommandBuffer::create):
1004         (WebCore::WebGPUCommandBuffer::beginRenderPass):
1005         * Modules/webgpu/WebGPUCommandBuffer.h:
1006         * Modules/webgpu/WebGPUDevice.cpp:
1007         (WebCore::WebGPUDevice::create):
1008         (WebCore::WebGPUDevice::createBuffer const):
1009         (WebCore::WebGPUDevice::createShaderModule const):
1010         (WebCore::WebGPUDevice::createRenderPipeline const):
1011         (WebCore::WebGPUDevice::createCommandBuffer const):
1012         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1013         (WebCore::WebGPURenderPassEncoder::create):
1014         * Modules/webgpu/WebGPURenderPassEncoder.h:
1015         * Modules/webgpu/WebGPURenderPipeline.cpp:
1016         (WebCore::WebGPURenderPipeline::create):
1017         * Modules/webgpu/WebGPURenderPipeline.h:
1018         * Modules/webgpu/WebGPUShaderModule.cpp:
1019         (WebCore::WebGPUShaderModule::create):
1020         * Modules/webgpu/WebGPUShaderModule.h:
1021         * Modules/webgpu/WebGPUTexture.cpp:
1022         (WebCore::WebGPUTexture::createDefaultTextureView):
1023         * Modules/webgpu/WebGPUTextureView.cpp:
1024         (WebCore::WebGPUTextureView::create):
1025         * Modules/webgpu/WebGPUTextureView.h:
1026         * accessibility/AXObjectCache.cpp:
1027         (WebCore::AXObjectCache::rangeMatchesTextNearRange):
1028         * accessibility/atk/AXObjectCacheAtk.cpp:
1029         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
1030         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
1031         (webkitAccessibleHyperlinkGetStartIndex):
1032         (webkitAccessibleHyperlinkGetEndIndex):
1033         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
1034         (getSelectionOffsetsForObject):
1035         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1036         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
1037         * bindings/js/JSDOMGlobalObjectTask.cpp:
1038         * bindings/js/JSDOMWindowBase.cpp:
1039         (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
1040         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1041         (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
1042         * bindings/js/ScriptControllerMac.mm:
1043         (WebCore::ScriptController::createScriptInstanceForWidget):
1044         * bindings/js/SerializedScriptValue.cpp:
1045         (WebCore::CloneDeserializer::readTerminal):
1046         (WebCore::SerializedScriptValue::create):
1047         * bridge/objc/objc_instance.h:
1048         * bridge/objc/objc_instance.mm:
1049         (ObjcInstance::create):
1050         * css/CSSComputedStyleDeclaration.cpp:
1051         (WebCore::ComputedStyleExtractor::currentColorOrValidColor const):
1052         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
1053         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
1054         (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
1055         * css/CSSComputedStyleDeclaration.h:
1056         * css/CSSFontFaceSource.cpp:
1057         (WebCore::CSSFontFaceSource::load):
1058         * css/CSSStyleSheet.cpp:
1059         (WebCore::CSSStyleSheet::rules):
1060         * css/FontFace.cpp:
1061         (WebCore::FontFace::unicodeRange const):
1062         (WebCore::FontFace::featureSettings const):
1063         * css/InspectorCSSOMWrappers.cpp:
1064         (WebCore::InspectorCSSOMWrappers::collectFromStyleSheetContents):
1065         * css/SVGCSSComputedStyleDeclaration.cpp:
1066         (WebCore::strokeDashArrayToCSSValueList):
1067         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
1068         * css/StyleResolver.cpp:
1069         (WebCore::StyleResolver::createFilterOperations):
1070         * css/StyleRule.cpp:
1071         (WebCore::StyleRuleBase::createCSSOMWrapper const):
1072         * css/StyleRule.h:
1073         * dom/ChildListMutationScope.cpp:
1074         (WebCore::ChildListMutationAccumulator::getOrCreate):
1075         * dom/ChildListMutationScope.h:
1076         * dom/DocumentMarkerController.cpp:
1077         (WebCore::updateRenderedRectsForMarker):
1078         * dom/InlineStyleSheetOwner.cpp:
1079         (WebCore::InlineStyleSheetOwner::createSheet):
1080         * dom/PointerEvent.h:
1081         * dom/UserGestureIndicator.h:
1082         (WebCore::UserGestureToken::create):
1083         * editing/AlternativeTextController.cpp:
1084         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
1085         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
1086         (WebCore::AlternativeTextController::respondToUnappliedEditing):
1087         (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
1088         (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord):
1089         * editing/ApplyStyleCommand.cpp:
1090         (WebCore::ApplyStyleCommand::applyBlockStyle):
1091         (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
1092         * editing/CompositeEditCommand.cpp:
1093         (WebCore::CompositeEditCommand::targetRanges const):
1094         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
1095         (WebCore::CompositeEditCommand::moveParagraphs):
1096         * editing/DeleteSelectionCommand.cpp:
1097         (WebCore::DeleteSelectionCommand::mergeParagraphs):
1098         * editing/Editing.cpp:
1099         (WebCore::visiblePositionForIndexUsingCharacterIterator):
1100         * editing/EditingStyle.cpp:
1101         (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
1102         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
1103         (WebCore::EditingStyle::prepareToApplyAt):
1104         (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
1105         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
1106         (WebCore::EditingStyle::removeStyleFromRulesAndContext):
1107         (WebCore::extractPropertiesNotIn):
1108         * editing/Editor.cpp:
1109         (WebCore::Editor::setBaseWritingDirection):
1110         (WebCore::Editor::setComposition):
1111         * editing/EditorCommand.cpp:
1112         (WebCore::executeApplyParagraphStyle):
1113         (WebCore::executeMakeTextWritingDirectionLeftToRight):
1114         (WebCore::executeMakeTextWritingDirectionNatural):
1115         (WebCore::executeMakeTextWritingDirectionRightToLeft):
1116         * editing/FormatBlockCommand.cpp:
1117         (WebCore::FormatBlockCommand::formatRange):
1118         * editing/RemoveFormatCommand.cpp:
1119         (WebCore::RemoveFormatCommand::doApply):
1120         * editing/ReplaceRangeWithTextCommand.cpp:
1121         (WebCore::ReplaceRangeWithTextCommand::targetRanges const):
1122         * editing/ReplaceSelectionCommand.cpp:
1123         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
1124         (WebCore::handleStyleSpansBeforeInsertion):
1125         (WebCore::ReplaceSelectionCommand::handleStyleSpans):
1126         * editing/SpellingCorrectionCommand.cpp:
1127         (WebCore::SpellingCorrectionCommand::targetRanges const):
1128         * editing/TextCheckingHelper.cpp:
1129         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
1130         * editing/TypingCommand.cpp:
1131         (WebCore::TypingCommand::insertText):
1132         (WebCore::TypingCommand::willAddTypingToOpenCommand):
1133         * editing/VisibleUnits.cpp:
1134         (WebCore::distanceBetweenPositions):
1135         * editing/cocoa/EditorCocoa.mm:
1136         (WebCore::Editor::selectionInWebArchiveFormat):
1137         * editing/ios/DictationCommandIOS.cpp:
1138         (WebCore::DictationCommandIOS::doApply):
1139         * editing/ios/EditorIOS.mm:
1140         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
1141         (WebCore::Editor::removeUnchangeableStyles):
1142         (WebCore::Editor::writeImageToPasteboard):
1143         * editing/mac/EditorMac.mm:
1144         (WebCore::Editor::replaceNodeFromPasteboard):
1145         (WebCore::Editor::imageInWebArchiveFormat):
1146         * editing/markup.cpp:
1147         (WebCore::styleFromMatchedRulesAndInlineDecl):
1148         (WebCore::createFragmentForTransformToFragment):
1149         * fileapi/FileReaderLoader.cpp:
1150         (WebCore::FileReaderLoader::didFinishLoading):
1151         * html/FTPDirectoryDocument.cpp:
1152         (WebCore::createTemplateDocumentData):
1153         * html/HTMLMediaElement.cpp:
1154         (WebCore::HTMLMediaElement::scheduleEvent):
1155         (WebCore::HTMLMediaElement::createMediaControls):
1156         * html/HTMLTableElement.cpp:
1157         (WebCore::HTMLTableElement::createSharedCellStyle):
1158         * html/HTMLTableElement.h:
1159         * html/URLUtils.h:
1160         (WebCore::URLUtils<T>::origin const):
1161         * html/parser/HTMLConstructionSite.cpp:
1162         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
1163         * html/shadow/TextControlInnerElements.cpp:
1164         (WebCore::TextControlInnerElement::resolveCustomStyle):
1165         * html/track/WebVTTParser.cpp:
1166         (WebCore::WebVTTParser::createNewCue):
1167         * inspector/DOMPatchSupport.cpp:
1168         * inspector/InspectorCanvas.cpp:
1169         (WebCore::InspectorCanvas::buildInitialState):
1170         (WebCore::InspectorCanvas::buildAction):
1171         * inspector/InspectorFrontendClientLocal.cpp:
1172         (WebCore::InspectorFrontendClientLocal::openInNewTab):
1173         * inspector/InspectorStyleSheet.cpp:
1174         (WebCore::asCSSRuleList):
1175         (WebCore::InspectorStyle::styleWithProperties const):
1176         (WebCore::InspectorStyleSheet::ensureSourceData):
1177         * inspector/agents/InspectorCanvasAgent.cpp:
1178         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
1179         * inspector/agents/InspectorIndexedDBAgent.cpp:
1180         (WebCore::Inspector::keyPathFromIDBKeyPath):
1181         * inspector/agents/InspectorPageAgent.cpp:
1182         (WebCore::InspectorPageAgent::archive):
1183         * loader/EmptyClients.cpp:
1184         (WebCore::EmptyStorageNamespaceProvider::createSessionStorageNamespace):
1185         (WebCore::EmptyStorageNamespaceProvider::createLocalStorageNamespace):
1186         (WebCore::EmptyStorageNamespaceProvider::createEphemeralLocalStorageNamespace):
1187         (WebCore::EmptyStorageNamespaceProvider::createTransientLocalStorageNamespace):
1188         * loader/FrameLoader.cpp:
1189         (WebCore::FrameLoader::loadURL):
1190         (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
1191         (WebCore::FrameLoader::loadDifferentDocumentItem):
1192         * loader/WorkerThreadableLoader.cpp:
1193         (WebCore::WorkerThreadableLoader::loadResourceSynchronously):
1194         * loader/archive/mhtml/MHTMLParser.cpp:
1195         (WebCore::MHTMLParser::addResourceToArchive):
1196         (WebCore::MHTMLParser::parseNextPart):
1197         * loader/cache/MemoryCache.cpp:
1198         (WebCore::MemoryCache::addImageToCache):
1199         (WebCore::MemoryCache::removeResourcesWithOrigin):
1200         * page/DOMWindow.cpp:
1201         (WebCore::DOMWindow::getMatchedCSSRules const):
1202         (WebCore::DOMWindow::createWindow):
1203         * page/EventHandler.cpp:
1204         (WebCore::textDistance):
1205         * page/Page.cpp:
1206         (WebCore::Page::userStyleSheet const):
1207         * page/animation/CSSPropertyAnimation.cpp:
1208         (WebCore::blendFilterOperations):
1209         * page/ios/FrameIOS.mm:
1210         (WebCore::Frame::initWithSimpleHTMLDocument):
1211         (WebCore::Frame::interpretationsForCurrentRoot const):
1212         * page/mac/ServicesOverlayController.mm:
1213         (WebCore::ServicesOverlayController::Highlight::fadeIn):
1214         (WebCore::ServicesOverlayController::Highlight::fadeOut):
1215         * platform/SharedBuffer.cpp:
1216         (WebCore::SharedBuffer::tryCreateArrayBuffer const):
1217         * platform/audio/HRTFElevation.cpp:
1218         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
1219         * platform/audio/SincResampler.cpp:
1220         (WebCore::SincResampler::consumeSource):
1221         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
1222         (WebCore::AudioFileReader::createBus):
1223         * platform/audio/mac/AudioFileReaderMac.cpp:
1224         (WebCore::AudioFileReader::createBus):
1225         * platform/graphics/Icon.h:
1226         (WebCore::Icon::create):
1227         * platform/graphics/InbandTextTrackPrivate.h:
1228         (WebCore::InbandTextTrackPrivate::create):
1229         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1230         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
1231         * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h:
1232         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1233         (WebCore::fulfillRequestWithKeyData):
1234         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
1235         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
1236         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
1237         (WebCore::MediaSourcePrivateAVFObjC::create):
1238         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
1239         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1240         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1241         (WebCore::SourceBufferPrivateAVFObjC::create):
1242         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
1243         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h:
1244         * platform/graphics/ca/TileController.cpp:
1245         (WebCore::TileController::createTileLayer):
1246         * platform/graphics/ca/TileController.h:
1247         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
1248         (WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable):
1249         (WebCore::CACFLayerTreeHost::create):
1250         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
1251         (WebCore::GPUBuffer::create):
1252         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1253         (WebCore::MediaPlayerPrivateGStreamer::updateTracks):
1254         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
1255         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
1256         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
1257         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1258         (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection):
1259         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
1260         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1261         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
1262         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1263         (WebCore::AppendPipeline::appsinkNewSample):
1264         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp:
1265         (WebCore::ISOProtectionSystemSpecificHeaderBox::parse):
1266         * platform/graphics/iso/ISOTrackEncryptionBox.cpp:
1267         (WebCore::ISOTrackEncryptionBox::parse):
1268         * platform/graphics/texmap/TextureMapperAnimation.cpp:
1269         (WebCore::applyFilterAnimation):
1270         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
1271         (WebCore::TextureMapperPlatformLayerBuffer::clone):
1272         * platform/graphics/transforms/TransformOperations.cpp:
1273         (WebCore::TransformOperations::blendByMatchingOperations const):
1274         * platform/image-decoders/ico/ICOImageDecoder.cpp:
1275         (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex):
1276         * platform/mock/mediasource/MockBox.cpp:
1277         (WebCore::MockInitializationBox::MockInitializationBox):
1278         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
1279         (WebCore::MockSourceBufferPrivate::create):
1280         (WebCore::MockSourceBufferPrivate::append):
1281         * platform/mock/mediasource/MockSourceBufferPrivate.h:
1282         * platform/mock/mediasource/MockTracks.h:
1283         (WebCore::MockTextTrackPrivate::create):
1284         (WebCore::MockVideoTrackPrivate::create):
1285         * platform/network/FormData.h:
1286         (WebCore::FormData::decode):
1287         * platform/network/cocoa/CookieStorageObserver.h:
1288         * platform/network/cocoa/CookieStorageObserver.mm:
1289         (WebCore::CookieStorageObserver::create):
1290         * platform/network/soup/ResourceRequestSoup.cpp:
1291         (WebCore::appendEncodedBlobItemToSoupMessageBody):
1292         (WebCore::ResourceRequest::updateSoupMessageBody const):
1293         * platform/text/hyphen/HyphenationLibHyphen.cpp:
1294         (WebCore::HyphenationDictionary::createNull):
1295         (WebCore::HyphenationDictionary::create):
1296         * platform/win/SearchPopupMenuWin.cpp:
1297         (WebCore::SearchPopupMenuWin::SearchPopupMenuWin):
1298         (WebCore::SearchPopupMenuWin::popupMenu):
1299         * platform/win/SearchPopupMenuWin.h:
1300         * rendering/RenderThemeIOS.mm:
1301         (WebCore::applyCommonButtonPaddingToStyle):
1302         (WebCore::RenderThemeIOS::paintProgressBar):
1303         (WebCore::RenderThemeIOS::adjustButtonStyle const):
1304         (WebCore::paintAttachmentIcon):
1305         * rendering/svg/SVGRenderTreeAsText.cpp:
1306         (WebCore::writeSVGResourceContainer):
1307         * storage/Storage.cpp:
1308         (WebCore::Storage::create):
1309         (WebCore::Storage::Storage):
1310         * storage/Storage.h:
1311         (WebCore::Storage::area const):
1312         * storage/StorageNamespace.h:
1313         * storage/StorageNamespaceProvider.cpp:
1314         (WebCore::StorageNamespaceProvider::localStorageArea):
1315         * storage/StorageNamespaceProvider.h:
1316         * svg/SVGElement.cpp:
1317         (WebCore::SVGElement::getPresentationAttribute):
1318         * svg/SVGFEBlendElement.cpp:
1319         (WebCore::SVGFEBlendElement::build):
1320         * svg/SVGFEColorMatrixElement.cpp:
1321         (WebCore::SVGFEColorMatrixElement::build):
1322         * svg/SVGFEComponentTransferElement.cpp:
1323         (WebCore::SVGFEComponentTransferElement::build):
1324         * svg/SVGFECompositeElement.cpp:
1325         (WebCore::SVGFECompositeElement::build):
1326         * svg/SVGFEDiffuseLightingElement.cpp:
1327         (WebCore::SVGFEDiffuseLightingElement::build):
1328         * svg/SVGFEDisplacementMapElement.cpp:
1329         (WebCore::SVGFEDisplacementMapElement::build):
1330         * svg/SVGFEDropShadowElement.cpp:
1331         (WebCore::SVGFEDropShadowElement::build):
1332         * svg/SVGFEGaussianBlurElement.cpp:
1333         (WebCore::SVGFEGaussianBlurElement::build):
1334         * svg/SVGFEMergeElement.cpp:
1335         (WebCore::SVGFEMergeElement::build):
1336         * svg/SVGFEMorphologyElement.cpp:
1337         (WebCore::SVGFEMorphologyElement::build):
1338         * svg/SVGFEOffsetElement.cpp:
1339         (WebCore::SVGFEOffsetElement::build):
1340         * svg/SVGFESpecularLightingElement.cpp:
1341         (WebCore::SVGFESpecularLightingElement::build):
1342         * svg/SVGFETileElement.cpp:
1343         (WebCore::SVGFETileElement::build):
1344         * testing/GCObservation.h:
1345         * xml/XSLTProcessor.cpp:
1346         (WebCore::XSLTProcessor::createDocumentFromSource):
1347         * xml/parser/XMLDocumentParser.cpp:
1348         (WebCore::XMLDocumentParser::parseDocumentFragment):
1349
1350 2018-12-21  Chris Dumez  <cdumez@apple.com>
1351
1352         navigator.userAgent in service workers does not reflect customUserAgent set by client
1353         https://bugs.webkit.org/show_bug.cgi?id=192951
1354
1355         Reviewed by Youenn Fablet.
1356
1357         Whenever a service worker client registers itself, also pass its effective user agent.
1358         In the network process, for each origin, we store the latest client's user agent and
1359         use it when starting the service worker.
1360
1361         * dom/Document.cpp:
1362         (WebCore::Document::setServiceWorkerConnection):
1363         * loader/DocumentLoader.cpp:
1364         (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
1365         * workers/service/SWClientConnection.h:
1366         * workers/service/server/SWServer.cpp:
1367         (WebCore::SWServer::serviceWorkerClientUserAgent const):
1368         (WebCore::SWServer::installContextData):
1369         (WebCore::SWServer::runServiceWorker):
1370         (WebCore::SWServer::registerServiceWorkerClient):
1371         * workers/service/server/SWServer.h:
1372         * workers/service/server/SWServerToContextConnection.h:
1373         * workers/service/server/SWServerWorker.cpp:
1374         (WebCore::SWServerWorker::userAgent const):
1375         * workers/service/server/SWServerWorker.h:
1376
1377 2018-12-21  Youenn Fablet  <youenn@apple.com>
1378
1379         RTCRtpSender.setParameters() does set active parameter
1380         https://bugs.webkit.org/show_bug.cgi?id=192848
1381
1382         Reviewed by Eric Carlson.
1383
1384         Covered by updated test.
1385
1386         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1387         (WebCore::updateRTCRtpSendParameters):
1388         The routine was updating the local value, not the out parameter.
1389
1390 2018-12-21  Eric Carlson  <eric.carlson@apple.com>
1391
1392         'ended' Event doesn't fire on MediaStreamTrack when a USB camera is unplugged
1393         https://bugs.webkit.org/show_bug.cgi?id=187896
1394         <rdar://problem/42681445>
1395
1396         Reviewed by Jer Noble.
1397
1398         No new tests, tested manually.
1399
1400         * platform/mediastream/mac/AVVideoCaptureSource.h:
1401         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1402         (WebCore::AVVideoCaptureSource::deviceDisconnected):
1403         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
1404         (-[WebCoreAVVideoCaptureSourceObserver removeNotificationObservers]):
1405         (-[WebCoreAVVideoCaptureSourceObserver deviceConnectedDidChange:]):
1406         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
1407         (WebCore::deviceHasInputStreams):
1408         (WebCore::isValidCaptureDevice):
1409         (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices):
1410         (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
1411         (WebCore::CoreAudioCaptureDeviceManager::devicesChanged): Deleted.
1412         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:
1413         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1414         (WebCore::CoreAudioSharedUnit::setCaptureDevice):
1415         (WebCore::CoreAudioSharedUnit::devicesChanged):
1416         (WebCore::CoreAudioSharedUnit::startProducingData):
1417         (WebCore::CoreAudioSharedUnit::startInternal):
1418         (WebCore::CoreAudioSharedUnit::verifyIsCapturing):
1419         (WebCore::CoreAudioSharedUnit::captureFailed):
1420         (WebCore::CoreAudioCaptureSourceFactory::devicesChanged):
1421         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
1422         (WebCore::CoreAudioSharedUnit::setCaptureDeviceID): Deleted.
1423         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1424
1425 2018-12-20  Ryosuke Niwa  <rniwa@webkit.org>
1426
1427         REGRESSION(r239353): iOS WK1 Assertion failure in notifyChildNodeRemoved while running
1428         TestWebKitAPI.QuickLook.LegacyQuickLookContent
1429         https://bugs.webkit.org/show_bug.cgi?id=192859
1430         <rdar://problem/46887237>
1431
1432         Reviewed by Antti Koivisto.
1433
1434         After r239353, ScriptDisallowedScope::InMainThread::isScriptAllowed() may return false when the web thread
1435         is inside a delegate callback even when there is a ScriptDisallowedScope defined.
1436
1437         Replace the existign debug assertions which assert !ScriptDisallowedScope::InMainThread::isScriptAllowed()
1438         by a newly added ScriptDisallowedScope::InMainThread::hasDisallowedScope to avoid hitting this assertion.
1439
1440         Tests: TestWebKitAPI.QuickLook.LegacyQuickLookContent
1441
1442         * dom/ContainerNodeAlgorithms.cpp:
1443         (WebCore::notifyChildNodeInserted):
1444         (WebCore::notifyChildNodeRemoved):
1445         * dom/Document.cpp:
1446         (WebCore::Document::nodeChildrenWillBeRemoved):
1447         (WebCore::Document::nodeWillBeRemoved):
1448         * dom/ScriptDisallowedScope.h:
1449         (WebCore::ScriptDisallowedScope::InMainThread::hasDisallowedScope):
1450         * html/HTMLFormElement.cpp:
1451         (WebCore:: const):
1452
1453 2018-12-21  Joseph Pecoraro  <pecoraro@apple.com>
1454
1455         Update status of some WebCore features in features.json
1456         https://bugs.webkit.org/show_bug.cgi?id=192998
1457
1458         Reviewed by Tim Horton.
1459
1460         * features.json:
1461         - Variation Fonts: Supported
1462         - Conic Gradients: Supported in Preview
1463         - Web Share: Supported in Preview
1464         - <datalist>: Supported in Preview
1465         - Intersection Observers: Supported in Preview
1466
1467 2018-12-21  Zalan Bujtas  <zalan@apple.com>
1468
1469         [iOS] Using file upload can trigger a crash under RenderThemeIOS::paintFileUploadIconDecorations()
1470         https://bugs.webkit.org/show_bug.cgi?id=192357
1471         <rdar://problem/42852260>
1472
1473         Reviewed by Simon Fraser.
1474
1475         Do not try to paint the file picker when painting is disabled.
1476
1477         * rendering/RenderFileUploadControl.cpp:
1478         (WebCore::RenderFileUploadControl::paintObject):
1479
1480 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
1481
1482         [WebAuthN] userPresence should always be true
1483         https://bugs.webkit.org/show_bug.cgi?id=192835
1484         <rdar://problem/46538788>
1485
1486         Reviewed by Brent Fulgham.
1487
1488         In the current spec as of 7 August 2018, userPresence is suggested to set to the inverse of userVerification.
1489         This doesn't comply with the CTAP spec. Details in: https://github.com/w3c/webauthn/issues/1123.
1490         After discussing with other members of the working group, we decided to make userPresence always default to true.
1491
1492         Covered by exisiting tests.
1493
1494         * Modules/webauthn/fido/DeviceRequestConverter.cpp:
1495         (fido::encodeGetAssertionRequestAsCBOR):
1496
1497 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
1498
1499         [WebAuthN] Import an APDU coder from Chromium
1500         https://bugs.webkit.org/show_bug.cgi?id=192949
1501         <rdar://problem/46879933>
1502
1503         Reviewed by Brent Fulgham.
1504
1505         This patch imports an APDU coder from Chromium. Here is the documentation:
1506         https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html#u2f-message-framing
1507         APDU is a binary format to frame any U2F requests/responses into binaries. It is equivalent to CBOR in CTAP2.
1508
1509         Here is a list of files that are imported from Chromium:
1510         https://cs.chromium.org/chromium/src/components/apdu/apdu_command.cc?rcl=a2f290c10d132f53518e7f99d5635ee814ff8090
1511         https://cs.chromium.org/chromium/src/components/apdu/apdu_command.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
1512         https://cs.chromium.org/chromium/src/components/apdu/apdu_response.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
1513         https://cs.chromium.org/chromium/src/components/apdu/apdu_response.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
1514         https://cs.chromium.org/chromium/src/components/apdu/apdu_unittest.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
1515
1516         Covered by API tests.
1517
1518         * Modules/webauthn/apdu/ApduCommand.cpp: Added.
1519         (apdu::ApduCommand::createFromMessage):
1520         (apdu::ApduCommand::ApduCommand):
1521         (apdu::ApduCommand::getEncodedCommand const):
1522         * Modules/webauthn/apdu/ApduCommand.h: Added.
1523         * Modules/webauthn/apdu/ApduResponse.cpp: Added.
1524         (apdu::ApduResponse::createFromMessage):
1525         (apdu::ApduResponse::ApduResponse):
1526         (apdu::ApduResponse::getEncodedResponse const):
1527         * Modules/webauthn/apdu/ApduResponse.h: Added.
1528         * Sources.txt:
1529         * WebCore.xcodeproj/project.pbxproj:
1530
1531 2018-12-21  Jer Noble  <jer.noble@apple.com>
1532
1533         Convert raw CDMSessionMediaSourceAVFObjC pointer in MediaPlayerPrivateMediaSourceAVFObjC
1534         https://bugs.webkit.org/show_bug.cgi?id=192985
1535         <rdar://problem/46750743>
1536
1537         Reviewed by Eric Carlson.
1538
1539         Make m_session a RefPtr; drive-by fix: make m_mediaElement in WebKitMediaKeys a WeakPtr.
1540
1541         * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
1542         (WebCore::WebKitMediaKeys::setMediaElement):
1543         * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
1544         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
1545         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1546         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1547         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
1548         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
1549
1550 2018-12-21  Justin Michaud  <justin_michaud@apple.com>
1551
1552         CSS variables don't work for colors in "border" property
1553         https://bugs.webkit.org/show_bug.cgi?id=192922
1554
1555         Reviewed by Simon Fraser.
1556
1557         ParseColorFunction no longer consumes anything if the color was not valid.
1558
1559         Test: css-custom-properties-api/border-variable-parsing.html
1560
1561         * css/parser/CSSPropertyParserHelpers.cpp:
1562         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
1563
1564 2018-12-21  Justin Fan  <justin_fan@apple.com>
1565
1566         [WebGPU] GPUBindGroupLayout refactoring: no HashMap, and failure logging
1567         https://bugs.webkit.org/show_bug.cgi?id=192990
1568
1569         Reviewed by Myles C. Maxfield.
1570
1571         Refactor away the unnecessary HashMaps when creating MTLArgumentEncoders in GPUBindGroupLayout creation.
1572         Also update GPUBindGroupLayout::create -> tryCreate, in order to better handle Objective-C exceptions.
1573
1574         No new tests; no change in behavior.
1575
1576         * Modules/webgpu/WebGPUBindGroupLayout.cpp:
1577         (WebCore::WebGPUBindGroupLayout::create):
1578         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
1579         * Modules/webgpu/WebGPUBindGroupLayout.h:
1580         (WebCore::WebGPUBindGroupLayout::bindGroupLayout const):
1581         * Modules/webgpu/WebGPUDevice.cpp:
1582         (WebCore::WebGPUDevice::createBindGroupLayout const):
1583         * platform/graphics/gpu/GPUBindGroupLayout.h:
1584         * platform/graphics/gpu/GPUDevice.cpp:
1585         (WebCore::GPUDevice::tryCreateBindGroupLayout const): Renamed from ::create*. Now returning a RefPtr. 
1586         (WebCore::GPUDevice::createBindGroupLayout const): Deleted.
1587         * platform/graphics/gpu/GPUDevice.h:
1588         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
1589         (WebCore::appendArgumentToArray):
1590         (WebCore::newEncoder):
1591         (WebCore::GPUBindGroupLayout::tryCreate): Renamed from ::create. Now returning a RefPtr.
1592         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
1593         (WebCore::appendArgumentToArrayInMap): Deleted.
1594         (WebCore::GPUBindGroupLayout::create): Deleted.
1595
1596         Deleted unneeded GPUBindGroupLayout.cpp:
1597         * Sources.txt:
1598         * WebCore.xcodeproj/project.pbxproj:
1599         * platform/graphics/gpu/GPUBindGroupLayout.cpp: Removed.
1600
1601 2018-12-21  Alejandro G. Castro  <alex@igalia.com>
1602
1603         [GTK][WPE] Add DeviceIdHashSaltStorage disk persistence
1604         https://bugs.webkit.org/show_bug.cgi?id=190466
1605
1606         Reviewed by Youenn Fablet.
1607
1608         Added persistency to the DeviceIdHashSaltStorage.
1609
1610         * platform/glib/FileSystemGlib.cpp:
1611         (WebCore::FileSystem::getFileSize): Implemented this function to
1612         allow sharing code with the statistics storage class.
1613         * platform/glib/KeyedDecoderGlib.cpp:
1614         (WebCore::KeyedDecoderGlib::dictionaryFromGVariant): Added a
1615         condition to control situations where the key is empty, it can
1616         happen if the user modifies the file in the disk.
1617         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp: Add include
1618         to make work compilation with debug, unified builds.
1619
1620 2018-12-21  Zalan Bujtas  <zalan@apple.com>
1621
1622         Synchronous media query evaluation could destroy current Frame/FrameView.
1623         https://bugs.webkit.org/show_bug.cgi?id=192781
1624         <rdar://problem/34416793>
1625
1626         Reviewed by Chris Dumez.
1627
1628         Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.
1629
1630         Test: printing/print-with-media-query-destory.html
1631
1632         * loader/DocumentLoader.cpp:
1633         (WebCore::DocumentLoader::finishedLoading):
1634         * page/Frame.cpp:
1635         (WebCore::Frame::setPrinting):
1636         * page/FrameView.cpp:
1637         (WebCore::FrameView::forceLayoutForPagination):
1638         * page/PrintContext.cpp:
1639         (WebCore::PrintContext::PrintContext):
1640         (WebCore::PrintContext::computePageRects):
1641         (WebCore::PrintContext::computePageRectsWithPageSizeInternal):
1642         (WebCore::PrintContext::begin):
1643         (WebCore::PrintContext::computeAutomaticScaleFactor):
1644         (WebCore::PrintContext::spoolPage):
1645         (WebCore::PrintContext::spoolRect):
1646         (WebCore::PrintContext::end):
1647         * page/PrintContext.h:
1648         (WebCore::PrintContext::frame const): Deleted.
1649
1650 2018-12-21  Wenson Hsieh  <wenson_hsieh@apple.com>
1651
1652         Setting the file wrapper and content type of an attachment to a PDF should update its image
1653         https://bugs.webkit.org/show_bug.cgi?id=192984
1654         <rdar://problem/46798028>
1655
1656         Reviewed by Tim Horton.
1657
1658         Allow PDF data to be used to update enclosing image elements when setting the file wrapper for an attachment.
1659         Covered by a new API test: WKAttachmentTests.SetFileWrapperForPDFImageAttachment.
1660
1661         * html/HTMLAttachmentElement.cpp:
1662         (WebCore::mimeTypeIsSuitableForInlineImageAttachment):
1663         (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
1664
1665 2018-12-21  Justin Michaud  <justin_michaud@apple.com>
1666
1667         Repeated background images with zero size should display the background color
1668         https://bugs.webkit.org/show_bug.cgi?id=192962
1669
1670         Reviewed by Antti Koivisto.
1671
1672         Test: fast/backgrounds/background-repeat-with-zero-size.html
1673
1674         * platform/LengthSize.h:
1675         (WebCore::LengthSize::isEmpty const):
1676         * rendering/RenderBoxModelObject.cpp:
1677         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1678         * rendering/style/FillLayer.h:
1679         (WebCore::FillLayer::isEmpty const):
1680
1681 2018-12-21  Manuel Rego Casasnovas  <rego@igalia.com>
1682
1683         [css-grid] Fix percentages in relative offsets for grid items
1684         https://bugs.webkit.org/show_bug.cgi?id=190492
1685
1686         Reviewed by Sergio Villar Senin.
1687
1688         The method RenderBoxModelObject::relativePositionOffset() was not considering the case of grid items,
1689         where the containing block is the grid area.
1690         The patch modifies the method so the new code uses overrideContainingBlockContentWidth|Height when required.
1691
1692         Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-relative-offsets-002.html
1693
1694         * rendering/RenderBox.cpp: Implement the physical versions of the already existent methods.
1695         (WebCore::RenderBox::overrideContainingBlockContentWidth const):
1696         (WebCore::RenderBox::overrideContainingBlockContentHeight const):
1697         (WebCore::RenderBox::hasOverrideContainingBlockContentWidth const):
1698         (WebCore::RenderBox::hasOverrideContainingBlockContentHeight const):
1699         * rendering/RenderBox.h:
1700         * rendering/RenderBoxModelObject.cpp:
1701         (WebCore::RenderBoxModelObject::relativePositionOffset const): Modified method
1702         to take into account overrideContainingBlockContentWidth|Height for grid items.
1703         * rendering/RenderBoxModelObject.h: Added new headers for physical virtual methods
1704         that will be overridden in RenderBox.
1705         (WebCore::RenderBoxModelObject::overrideContainingBlockContentWidth const):
1706         (WebCore::RenderBoxModelObject::overrideContainingBlockContentHeight const):
1707         (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentWidth const):
1708         (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentHeight const):
1709
1710 2018-12-20  Justin Fan  <justin_fan@apple.com>
1711
1712         [WebGPU] Convert WebGPUBindGroups into MTLArgumentEncoders
1713         https://bugs.webkit.org/show_bug.cgi?id=192956
1714
1715         Reviewed by Myles Maxfield.
1716
1717         No testable behavior change. Existing tests cover possible crashing.
1718
1719         Add GPUBindGroupLayoutMetal.mm:
1720         * SourcesCocoa.txt:
1721         * WebCore.xcodeproj/project.pbxproj:
1722
1723         Flesh out GPUBindGroupLayout::create:
1724         * platform/graphics/gpu/GPUBindGroupLayout.cpp:
1725         * platform/graphics/gpu/GPUBindGroupLayout.h:
1726         * platform/graphics/gpu/GPUDevice.cpp:
1727         (WebCore::GPUDevice::createBindGroupLayout const):
1728         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Added.
1729         (WebCore::appendArgumentToArrayInMap): Added.
1730         (WebCore::GPUBindGroupLayout::create):
1731         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
1732         (WebCore::MTLDataTypeForBindingType): Added.
1733
1734 2018-12-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1735
1736         Unreviewed, remove stray #pragma once added to .cpp file
1737
1738         * svg/properties/SVGAttributeOwnerProxy.cpp:
1739
1740 2018-12-20  Justin Michaud  <justin_michaud@apple.com>
1741
1742         Adding runtime-enabled attribute to Element prevents inlining property access
1743         https://bugs.webkit.org/show_bug.cgi?id=192901
1744
1745         Add a call to flattenDictionaryObject after disabling runtime-enabled attributes.
1746
1747         Reviewed by Ryosuke Niwa.
1748
1749         * bindings/scripts/CodeGeneratorJS.pm:
1750         (GenerateImplementation):
1751         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1752         (WebCore::JSTestEnabledBySettingPrototype::finishCreation):
1753         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1754         (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
1755         * bindings/scripts/test/JS/JSTestNode.cpp:
1756         (WebCore::JSTestNodePrototype::finishCreation):
1757         * bindings/scripts/test/JS/JSTestObj.cpp:
1758         (WebCore::JSTestObjPrototype::finishCreation):
1759
1760 2018-12-20  Chris Dumez  <cdumez@apple.com>
1761
1762         Use Optional::hasValue() instead of Optional::has_value()
1763         https://bugs.webkit.org/show_bug.cgi?id=192948
1764
1765         Reviewed by Tim Horton.
1766
1767         * bindings/js/DOMPromiseProxy.h:
1768         (WebCore::DOMPromiseProxy<IDLType>::isFulfilled const):
1769         (WebCore::DOMPromiseProxy<IDLVoid>::isFulfilled const):
1770         (WebCore::DOMPromiseProxyWithResolveCallback<IDLType>::isFulfilled const):
1771         * dom/DataTransferItemList.h:
1772         (WebCore::DataTransferItemList::hasItems const):
1773         * dom/EventTarget.cpp:
1774         (WebCore::EventTarget::addEventListener):
1775         * html/HTMLMediaElement.cpp:
1776         (WebCore::HTMLMediaElement::captionDisplayMode):
1777         * platform/graphics/MediaPlayer.cpp:
1778         (WebCore::MediaPlayer::wouldTaintOrigin const):
1779         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1780         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
1781         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1782         (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
1783         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
1784         (webKitMediaSrcUpdatePresentationSize):
1785         * platform/mac/NSScrollerImpDetails.mm:
1786         (WebCore::ScrollerStyle::recommendedScrollerStyle):
1787         * rendering/RenderListItem.cpp:
1788         (WebCore::RenderListItem::setExplicitValue):
1789
1790 2018-12-20  Chris Dumez  <cdumez@apple.com>
1791
1792         Move HTTPS_UPGRADE code behind a runtime flag, off by default
1793         https://bugs.webkit.org/show_bug.cgi?id=192937
1794
1795         Reviewed by Youenn Fablet.
1796
1797         Move HTTPS_UPGRADE code behind a runtime flag, off by default and drop the build time flag.
1798
1799         * page/Settings.yaml:
1800
1801 2018-12-20  Youenn Fablet  <youenn@apple.com>
1802
1803         Remove custom constructors of ReadableStreamDefaultReader and ReadableStreamBYOBReader
1804         https://bugs.webkit.org/show_bug.cgi?id=192838
1805
1806         Reviewed by Chris Dumez.
1807
1808         Generate constructor code in case of a Private but not Public constructor.
1809         Make sure this is correctly exposed in global objects.
1810         Add JS built-in constructor implementations for those two objects.
1811
1812         Also add JS built-in constructors for controller and byob request.
1813         To keep existing behavior, JS built-ins calling these constructors need to pass
1814         an additional parameter that allows making the difference between a JS builtin caller or a JS caller.
1815         In the latter case, the constructor will throw.
1816
1817         Covered by existing tests, no observable change of behavior.
1818
1819         * Modules/streams/ReadableByteStreamController.idl:
1820         * Modules/streams/ReadableByteStreamController.js:
1821         (initializeReadableByteStreamController):
1822         (getter.byobRequest):
1823         * Modules/streams/ReadableByteStreamInternals.js:
1824         (privateInitializeReadableByteStreamController): Deleted.
1825         (privateInitializeReadableStreamBYOBRequest): Deleted.
1826         * Modules/streams/ReadableStream.js:
1827         (initializeReadableStream):
1828         * Modules/streams/ReadableStreamBYOBReader.js:
1829         (initializeReadableStreamBYOBReader):
1830         * Modules/streams/ReadableStreamBYOBRequest.idl:
1831         * Modules/streams/ReadableStreamBYOBRequest.js:
1832         (initializeReadableStreamBYOBRequest):
1833         * Modules/streams/ReadableStreamDefaultController.idl:
1834         * Modules/streams/ReadableStreamDefaultController.js:
1835         (initializeReadableStreamDefaultController):
1836         (enqueue):
1837         * Modules/streams/ReadableStreamDefaultReader.js:
1838         (initializeReadableStreamDefaultReader):
1839         * Modules/streams/ReadableStreamInternals.js:
1840         (readableStreamDefaultControllerError): Deleted.
1841         * Sources.txt:
1842         * UnifiedSources-input.xcfilelist:
1843         * WebCore.xcodeproj/project.pbxproj:
1844         * bindings/js/JSDOMBuiltinConstructor.h:
1845         * bindings/js/JSDOMGlobalObject.cpp:
1846         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
1847         * bindings/js/JSReadableStreamPrivateConstructors.cpp: Removed.
1848         * bindings/js/JSReadableStreamPrivateConstructors.h: Removed.
1849         * bindings/scripts/CodeGeneratorJS.pm:
1850         (GeneratePropertiesHashTable):
1851         * bindings/scripts/preprocess-idls.pl:
1852         (shouldExposeInterface):
1853
1854 2018-12-20  Jiewen Tan  <jiewen_tan@apple.com>
1855
1856         [WebAuthN] Remove hash from Client Data
1857         https://bugs.webkit.org/show_bug.cgi?id=192727
1858         <rdar://problem/46746673>
1859
1860         Reviewed by Brent Fulgham.
1861
1862         The hash algorithm for hashing the client data is enforced to SHA_256 in the latest spec:
1863         https://www.w3.org/TR/webauthn/#sec-client-data. Therefore, we should remove it.
1864
1865         Covered by existing tests.
1866
1867         * Modules/webauthn/AuthenticatorCoordinator.cpp:
1868         (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJson):
1869
1870 2018-12-20  Jiewen Tan  <jiewen_tan@apple.com>
1871
1872         [WebAuthN] Add a runtime flag for local authenticator
1873         https://bugs.webkit.org/show_bug.cgi?id=192792
1874         <rdar://problem/46798738>
1875
1876         Reviewed by Brent Fulgham.
1877
1878         No tests.
1879
1880         This patch adds a runtime flag for local authenticator and removes ways to
1881         set the runtime flag for web authentication in LegacyWebKit.
1882
1883         * page/RuntimeEnabledFeatures.h:
1884         (WebCore::RuntimeEnabledFeatures::setWebAuthenticationLocalAuthenticatorEnabled):
1885         (WebCore::RuntimeEnabledFeatures::webAuthenticationLocalAuthenticatorEnabled const):
1886
1887 2018-12-20  Jeremy Jones  <jeremyj@apple.com>
1888
1889         Pointer lock causes abandoned documents
1890         https://bugs.webkit.org/show_bug.cgi?id=188727
1891         rdar://problem/44248197
1892         
1893         Reviewed by Simon Fraser.
1894
1895         Fixes --world-leaks in these tests:
1896
1897         pointer-lock/locked-element-removed-from-dom.html
1898         pointer-lock/mouse-event-delivery.html
1899         fast/shadow-dom/pointerlockelement-in-slot.html
1900
1901         PointerLockController now uses WeakPtr instead of RefPtr because it has no need to extend the lifetime of a document.
1902
1903         * page/PointerLockController.cpp:
1904         (WebCore::PointerLockController::elementRemoved):
1905         (WebCore::PointerLockController::documentDetached):
1906         (WebCore::PointerLockController::didAcquirePointerLock):
1907         * page/PointerLockController.h:
1908
1909 2018-12-20  Chris Dumez  <cdumez@apple.com>
1910
1911         Use Optional::valueOr() instead of Optional::value_or()
1912         https://bugs.webkit.org/show_bug.cgi?id=192933
1913
1914         Reviewed by Geoffrey Garen.
1915
1916         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1917         (WebCore::convert):
1918         (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
1919         * Modules/encryptedmedia/MediaKeySession.cpp:
1920         (WebCore::MediaKeySession::load):
1921         * Modules/indexeddb/IDBDatabaseIdentifier.h:
1922         (WebCore::IDBDatabaseIdentifier::hash const):
1923         * Modules/indexeddb/IDBFactory.cpp:
1924         (WebCore::IDBFactory::open):
1925         * Modules/mediastream/MediaStreamTrack.cpp:
1926         (WebCore::MediaStreamTrack::applyConstraints):
1927         * Modules/mediastream/RTCDTMFSender.cpp:
1928         (WebCore::RTCDTMFSender::insertDTMF):
1929         * Modules/webdatabase/SQLTransaction.cpp:
1930         (WebCore::SQLTransaction::executeSql):
1931         * Modules/webvr/VRFrameData.cpp:
1932         (WebCore::VRFrameData::update):
1933         * animation/AnimationTimeline.cpp:
1934         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
1935         * animation/DeclarativeAnimation.cpp:
1936         (WebCore::DeclarativeAnimation::cancel):
1937         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
1938         * animation/KeyframeEffect.cpp:
1939         (WebCore::computeMissingKeyframeOffsets):
1940         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
1941         * animation/WebAnimation.cpp:
1942         (WebCore::WebAnimation::runPendingPlayTask):
1943         (WebCore::WebAnimation::runPendingPauseTask):
1944         * bindings/js/SerializedScriptValue.cpp:
1945         (WebCore::CloneSerializer::write):
1946         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
1947         (WebCore::CryptoAlgorithmHMAC::generateKey):
1948         (WebCore::CryptoAlgorithmHMAC::importKey):
1949         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
1950         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
1951         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
1952         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
1953         (WebCore::CryptoKeyRSA::importSpki):
1954         (WebCore::CryptoKeyRSA::importPkcs8):
1955         * crypto/keys/CryptoKeyRSA.cpp:
1956         (WebCore::CryptoKeyRSA::importJwk):
1957         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
1958         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
1959         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
1960         * crypto/mac/CryptoKeyRSAMac.cpp:
1961         (WebCore::CryptoKeyRSA::importSpki):
1962         (WebCore::CryptoKeyRSA::importPkcs8):
1963         * css/CSSComputedStyleDeclaration.cpp:
1964         (WebCore::counterToCSSValue):
1965         * css/CSSFontFace.cpp:
1966         (WebCore::calculateItalicRange):
1967         * css/CSSPrimitiveValue.cpp:
1968         (WebCore::CSSPrimitiveValue::doubleValue const):
1969         * css/CSSStyleSheet.cpp:
1970         (WebCore::CSSStyleSheet::addRule):
1971         * css/DOMMatrix.cpp:
1972         (WebCore::DOMMatrix::rotateSelf):
1973         * css/DOMMatrixReadOnly.cpp:
1974         (WebCore::DOMMatrixReadOnly::validateAndFixup):
1975         * css/StyleBuilderCustom.h:
1976         (WebCore::StyleBuilderCustom::applyValueCounter):
1977         * css/parser/MediaQueryParser.cpp:
1978         (WebCore::MediaQueryParser::commitMediaQuery):
1979         * dom/Document.h:
1980         (WebCore::Document::referrerPolicy const):
1981         * dom/Element.cpp:
1982         (WebCore::toScrollAlignment):
1983         * dom/EventTarget.cpp:
1984         (WebCore::EventTarget::addEventListener):
1985         * dom/MutationObserver.cpp:
1986         (WebCore::MutationObserver::observe):
1987         * editing/cocoa/FontAttributeChangesCocoa.mm:
1988         (WebCore::FontChanges::platformFontFamilyNameForCSS const):
1989         * fileapi/File.cpp:
1990         (WebCore::File::File):
1991         * html/DOMTokenList.cpp:
1992         (WebCore::DOMTokenList::toggle):
1993         * html/HTMLOListElement.h:
1994         * html/ImageBitmap.cpp:
1995         (WebCore::croppedSourceRectangleWithFormatting):
1996         * html/canvas/CanvasPattern.cpp:
1997         (WebCore::CanvasPattern::setTransform):
1998         * html/canvas/CanvasRenderingContext2DBase.cpp:
1999         (WebCore::CanvasRenderingContext2DBase::setTransform):
2000         (WebCore::CanvasRenderingContext2DBase::isPointInPathInternal):
2001         (WebCore::CanvasRenderingContext2DBase::isPointInStrokeInternal):
2002         * html/canvas/Path2D.cpp:
2003         (WebCore::Path2D::addPath):
2004         * inspector/InspectorCanvas.cpp:
2005         (WebCore::InspectorCanvas::buildAction):
2006         * inspector/InspectorFrontendHost.cpp:
2007         (WebCore::populateContextMenu):
2008         * layout/FormattingContext.cpp:
2009         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
2010         * layout/FormattingContextGeometry.cpp:
2011         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2012         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2013         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2014         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2015         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
2016         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2017         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset):
2018         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
2019         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
2020         * layout/FormattingContextQuirks.cpp:
2021         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
2022         * layout/MarginTypes.h:
2023         (WebCore::Layout::VerticalMargin::usedValues const):
2024         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2025         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2026         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2027         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
2028         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
2029         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
2030         * layout/displaytree/DisplayBox.h:
2031         (WebCore::Display::Box::width const):
2032         (WebCore::Display::Box::height const):
2033         (WebCore::Display::Box::contentBoxTop const):
2034         (WebCore::Display::Box::contentBoxLeft const):
2035         * layout/floats/FloatingContext.cpp:
2036         (WebCore::Layout::Iterator::set):
2037         * layout/inlineformatting/InlineFormattingContext.cpp:
2038         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
2039         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
2040         * loader/FrameLoader.cpp:
2041         (WebCore::FrameLoader::urlSelected):
2042         * loader/NavigationAction.cpp:
2043         * page/FrameView.cpp:
2044         (WebCore::FrameView::setLayoutViewportOverrideRect):
2045         (WebCore::FrameView::documentToAbsoluteScaleFactor const):
2046         (WebCore::FrameView::viewportSizeForCSSViewportUnits const):
2047         * page/Page.cpp:
2048         (WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
2049         * page/SecurityOriginData.cpp:
2050         (WebCore::SecurityOriginData::databaseIdentifier const):
2051         * page/SecurityOriginData.h:
2052         (WebCore::SecurityOriginDataHash::hash):
2053         * page/SecurityOriginHash.h:
2054         (WebCore::SecurityOriginHash::hash):
2055         * page/ViewportConfiguration.cpp:
2056         (WebCore::ViewportConfiguration::setViewLayoutSize):
2057         * page/WindowFeatures.cpp:
2058         (WebCore::parseDialogFeatures):
2059         * page/animation/AnimationBase.cpp:
2060         (WebCore::AnimationBase::updateStateMachine):
2061         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
2062         (WebCore::AnimationBase::getTimeToNextEvent const):
2063         (WebCore::AnimationBase::freezeAtTime):
2064         (WebCore::AnimationBase::getElapsedTime const):
2065         * page/animation/CSSAnimationController.cpp:
2066         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
2067         * page/cocoa/ResourceUsageThreadCocoa.mm:
2068         (WebCore::ResourceUsageThread::platformThreadBody):
2069         * page/linux/ResourceUsageThreadLinux.cpp:
2070         (WebCore::ResourceUsageThread::platformThreadBody):
2071         * platform/graphics/ComplexTextController.cpp:
2072         (WebCore::ComplexTextController::offsetForPosition):
2073         * platform/graphics/FontCache.h:
2074         (WebCore::FontDescriptionKey::computeHash const):
2075         * platform/graphics/FontCascade.cpp:
2076         (WebCore::FontCascade::drawText const):
2077         (WebCore::FontCascade::drawEmphasisMarks const):
2078         (WebCore::FontCascade::displayListForTextRun const):
2079         (WebCore::FontCascade::adjustSelectionRectForText const):
2080         (WebCore::FontCascade::codePath const):
2081         * platform/graphics/FontSelectionAlgorithm.cpp:
2082         (WebCore::FontSelectionAlgorithm::styleDistance const):
2083         * platform/graphics/FontSelectionAlgorithm.h:
2084         (WebCore::operator<<):
2085         (WebCore::FontSelectionSpecifiedCapabilities::computeWeight const):
2086         (WebCore::FontSelectionSpecifiedCapabilities::computeWidth const):
2087         (WebCore::FontSelectionSpecifiedCapabilities::computeSlope const):
2088         * platform/graphics/ShadowBlur.cpp:
2089         (WebCore::ShadowBlur::calculateLayerBoundingRect):
2090         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
2091         (WebCore::WebCoreAVCFResourceLoader::startLoading):
2092         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2093         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
2094         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2095         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
2096         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2097         (WebCore::SourceBufferPrivateAVFObjC::naturalSize):
2098         * platform/graphics/ca/GraphicsLayerCA.cpp:
2099         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
2100         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2101         (WebCore::preparePlatformFont):
2102         * platform/graphics/filters/FETurbulence.cpp:
2103         (WebCore::FETurbulence::fillRegion const):
2104         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2105         (WebCore::initializeGStreamer):
2106         * platform/graphics/texmap/TextureMapperLayer.cpp:
2107         (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
2108         (WebCore::TextureMapperLayer::replicaTransform):
2109         (WebCore::TextureMapperLayer::syncAnimations):
2110         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2111         (WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
2112         (WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
2113         * platform/graphics/transforms/TransformState.cpp:
2114         (WebCore::TransformState::mappedPoint const):
2115         (WebCore::TransformState::mapQuad const):
2116         (WebCore::TransformState::flattenWithTransform):
2117         * platform/network/CacheValidation.cpp:
2118         (WebCore::computeCurrentAge):
2119         (WebCore::computeFreshnessLifetimeForHTTPFamily):
2120         * platform/network/NetworkStateNotifier.cpp:
2121         (WebCore::NetworkStateNotifier::onLine):
2122         * rendering/FloatingObjects.cpp:
2123         (WebCore::FindNextFloatLogicalBottomAdapter::nextLogicalBottom const):
2124         (WebCore::FindNextFloatLogicalBottomAdapter::nextShapeLogicalBottom const):
2125         * rendering/GridBaselineAlignment.cpp:
2126         (WebCore::GridBaselineAlignment::ascentForChild const):
2127         * rendering/GridTrackSizingAlgorithm.cpp:
2128         (WebCore::GridTrack::setGrowthLimit):
2129         (WebCore::GridTrackSizingAlgorithm::initialBaseSize const):
2130         (WebCore::GridTrackSizingAlgorithm::initialGrowthLimit const):
2131         (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
2132         (WebCore::sortByGridTrackGrowthPotential):
2133         (WebCore::GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild const):
2134         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
2135         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
2136         * rendering/PaintInfo.h:
2137         (WebCore::PaintInfo::applyTransform):
2138         * rendering/RenderBox.cpp:
2139         (WebCore::RenderBox::computeLogicalHeight const):
2140         * rendering/RenderCounter.cpp:
2141         (WebCore::planCounter):
2142         * rendering/RenderDeprecatedFlexibleBox.cpp:
2143         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
2144         * rendering/RenderFlexibleBox.cpp:
2145         (WebCore::RenderFlexibleBox::baselinePosition const):
2146         (WebCore::RenderFlexibleBox::marginBoxAscentForChild):
2147         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
2148         * rendering/RenderGrid.cpp:
2149         (WebCore::RenderGrid::gridGap const):
2150         (WebCore::RenderGrid::baselinePosition const):
2151         * rendering/RenderLayer.cpp:
2152         (WebCore::RenderLayer::paintLayerByApplyingTransform):
2153         * rendering/RenderListBox.cpp:
2154         (WebCore::RenderListBox::paintItem):
2155         (WebCore::RenderListBox::listIndexIsVisible):
2156         * rendering/RenderMultiColumnSet.cpp:
2157         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight const):
2158         * rendering/RenderTable.cpp:
2159         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
2160         * rendering/RenderTableCell.cpp:
2161         (WebCore::RenderTableCell::cellBaselinePosition const):
2162         * rendering/RenderTableSection.cpp:
2163         (WebCore::RenderTableSection::firstLineBaseline const):
2164         * rendering/RenderText.cpp:
2165         (WebCore::RenderText::computePreferredLogicalWidths):
2166         (WebCore::RenderText::previousOffset const):
2167         (WebCore::RenderText::previousOffsetForBackwardDeletion const):
2168         (WebCore::RenderText::nextOffset const):
2169         (WebCore::RenderText::stringView const):
2170         * rendering/RenderView.cpp:
2171         (WebCore::RenderView::layout):
2172         * rendering/mathml/RenderMathMLBlock.cpp:
2173         (WebCore::RenderMathMLBlock::baselinePosition const):
2174         * rendering/mathml/RenderMathMLBlock.h:
2175         (WebCore::RenderMathMLBlock::ascentForChild):
2176         * rendering/style/GridPosition.cpp:
2177         (WebCore::GridPosition::max):
2178         * rendering/style/TextUnderlineOffset.h:
2179         (WebCore::TextUnderlineOffset::lengthOr const):
2180         * rendering/svg/RenderSVGContainer.cpp:
2181         (WebCore::RenderSVGContainer::nodeAtFloatPoint):
2182         * rendering/svg/RenderSVGForeignObject.cpp:
2183         (WebCore::RenderSVGForeignObject::nodeAtFloatPoint):
2184         * rendering/svg/RenderSVGImage.cpp:
2185         (WebCore::RenderSVGImage::nodeAtFloatPoint):
2186         * rendering/svg/RenderSVGResourceClipper.cpp:
2187         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
2188         * rendering/svg/RenderSVGResourceFilter.cpp:
2189         (WebCore::RenderSVGResourceFilter::postApplyResource):
2190         * rendering/svg/RenderSVGRoot.cpp:
2191         (WebCore::RenderSVGRoot::nodeAtPoint):
2192         * rendering/svg/RenderSVGShape.cpp:
2193         (WebCore::RenderSVGShape::nodeAtFloatPoint):
2194         * rendering/svg/RenderSVGText.cpp:
2195         (WebCore::RenderSVGText::nodeAtFloatPoint):
2196         * rendering/svg/SVGRenderingContext.cpp:
2197         (WebCore::SVGRenderingContext::clipToImageBuffer):
2198         * svg/SVGToOTFFontConversion.cpp:
2199         (WebCore::SVGToOTFFontConverter::processGlyphElement):
2200         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
2201
2202 2018-12-20  Jer Noble  <jer.noble@apple.com>
2203
2204         REGRESSION (r239419): heap-use-after-free in AudioSourceProviderAVFObjC::finalizeCallback()
2205         https://bugs.webkit.org/show_bug.cgi?id=192941
2206         <rdar://problem/46874096>
2207
2208         Reviewed by Brent Fulgham.
2209
2210         Don't delete the locked lock before unlocking the lock. 
2211
2212         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
2213         (WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
2214
2215 2018-12-20  Keith Rollin  <krollin@apple.com>
2216
2217         Improve release-level page-load logging
2218         https://bugs.webkit.org/show_bug.cgi?id=192872
2219         <rdar://problem/46850309>
2220
2221         Reviewed by Chris Dumez.
2222
2223         There are a number of reported bugs that are difficult or impossible
2224         to track down with our current level of logging. Additionally, some
2225         software groups lower in the page-loading stack have requested logging
2226         sufficient for tracking a user-visible error message down to the
2227         requested resource that caused the message. Add more-comprehensive
2228         logging to address these issues/requests.
2229
2230         No new tests -- no changed functionality.
2231
2232         * loader/DocumentLoader.cpp:
2233         (WebCore::DocumentLoader::setMainDocumentError):
2234         (WebCore::DocumentLoader::mainReceivedError):
2235         (WebCore::DocumentLoader::stopLoading):
2236         (WebCore::DocumentLoader::notifyFinished):
2237         (WebCore::DocumentLoader::willSendRequest):
2238         (WebCore::DocumentLoader::continueAfterContentPolicy):
2239         (WebCore::DocumentLoader::startLoadingMainResource):
2240         (WebCore::DocumentLoader::loadMainResource):
2241         (WebCore::DocumentLoader::cancelMainResourceLoad):
2242         * loader/FrameLoader.cpp:
2243         (WebCore::FrameLoader::urlSelected):
2244         (WebCore::FrameLoader::loadURLIntoChildFrame):
2245         (WebCore::FrameLoader::loadArchive):
2246         (WebCore::FrameLoader::loadInSameDocument):
2247         (WebCore::FrameLoader::loadFrameRequest):
2248         (WebCore::FrameLoader::loadURL):
2249         (WebCore::FrameLoader::load):
2250         (WebCore::FrameLoader::loadWithNavigationAction):
2251         (WebCore::FrameLoader::loadWithDocumentLoader):
2252         (WebCore::FrameLoader::reloadWithOverrideEncoding):
2253         (WebCore::FrameLoader::reload):
2254         (WebCore::FrameLoader::setState):
2255         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
2256         (WebCore::FrameLoader::loadPostRequest):
2257         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2258         (WebCore::FrameLoader::loadDifferentDocumentItem):
2259         * loader/ProgressTracker.cpp:
2260         (WebCore::ProgressItem::ProgressItem):
2261         (WebCore::ProgressTracker::reset):
2262         (WebCore::ProgressTracker::progressStarted):
2263         (WebCore::ProgressTracker::progressCompleted):
2264         (WebCore::ProgressTracker::finalProgressComplete):
2265         (WebCore::ProgressTracker::incrementProgress):
2266         (WebCore::ProgressTracker::completeProgress):
2267         (WebCore::ProgressTracker::isAlwaysOnLoggingAllowed const):
2268         * loader/ProgressTracker.h:
2269         * loader/ResourceLoader.cpp:
2270         (WebCore::ResourceLoader::loadDataURL):
2271         (WebCore::ResourceLoader::willSendRequestInternal):
2272         (WebCore::ResourceLoader::didFinishLoading):
2273         (WebCore::ResourceLoader::didFail):
2274         (WebCore::ResourceLoader::willSendRequestAsync):
2275         (WebCore::ResourceLoader::wasBlocked):
2276         (WebCore::ResourceLoader::cannotShowURL):
2277         * loader/SubresourceLoader.cpp:
2278         (WebCore::SubresourceLoader::willSendRequestInternal):
2279         (WebCore::=):
2280         (WebCore::SubresourceLoader::didReceiveResponse):
2281         (WebCore::SubresourceLoader::didFinishLoading):
2282         (WebCore::SubresourceLoader::didFail):
2283         (WebCore::SubresourceLoader::willCancel):
2284         * loader/cache/CachedResource.cpp:
2285         (WebCore::CachedResource::load):
2286
2287 2018-12-20  Jeremy Jones  <jeremyj@apple.com>
2288
2289         Switch tabs before retuning PiP video to inline.
2290         https://bugs.webkit.org/show_bug.cgi?id=192767
2291         rdar://problem/46006046
2292
2293         Reviewed by Jer Noble.
2294
2295         No new tests because this code path only happens with a user action on system UI.
2296
2297         When exiting PiP, notify the fullscreen change observer so it can restore client UI state before exiting.
2298
2299         * platform/mac/VideoFullscreenInterfaceMac.mm:
2300         (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]):
2301
2302 2018-12-19  Michael Catanzaro  <mcatanzaro@igalia.com>
2303
2304         Unreviewed, fix GTK build after r239410
2305
2306         It added a new file to the build, breaking the unified sources magic that obscured a bug in
2307         URLSoup.h. It forward-declares URL, but this never worked unless the URL.h header was
2308         included via another source file in the unified source bundle.
2309
2310         * platform/network/soup/URLSoup.h:
2311
2312 2018-12-19  Chris Dumez  <cdumez@apple.com>
2313
2314         wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from
2315         https://bugs.webkit.org/show_bug.cgi?id=192728
2316         <rdar://problem/46746779>
2317
2318         Reviewed by Geoff Garen.
2319
2320         * Modules/*:
2321         * animation/*:
2322         * bindings/*:
2323         * crypto/*:
2324         * css/*:
2325         * dom/*:
2326         * editing/*:
2327         * fileapi/*:
2328         * html/*:
2329         * inspector/*:
2330         * layout/*:
2331         * loader/*:
2332         * mathml/*:
2333         * page/*:
2334         * platform/*:
2335         * plugins/*:
2336         * rendering/*:
2337         * testing/*:
2338         * workers/*:
2339         * xml/*:
2340
2341 2018-12-19  Jer Noble  <jer.noble@apple.com>
2342
2343         Leak of MTAudioProcessingTap (304 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
2344         https://bugs.webkit.org/show_bug.cgi?id=192896
2345         <rdar://46732186>
2346
2347         Reviewed by Eric Carlson.
2348
2349         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
2350         (WebCore::AudioSourceProviderAVFObjC::initCallback):
2351
2352 2018-12-19  Timothy Hatcher  <timothy@apple.com>
2353
2354         REGRESSION (r232991): Switching to dark mode in Mail does not update the message view to be transparent
2355         https://bugs.webkit.org/show_bug.cgi?id=188891
2356         rdar://problem/42344352
2357
2358         Reviewed by Simon Fraser.
2359
2360         * rendering/RenderLayerCompositor.cpp:
2361         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
2362         Don't return early when m_layerForOverhangAreas is null to avoid skipping
2363         setRootLayerConfigurationNeedsUpdate() and scheduleCompositingLayerUpdate().
2364
2365 2018-12-19  Justin Fan  <justin_fan@apple.com>
2366
2367         [WebGPU] Add stubs for WebGPUPipelineLayout/Descriptor and device::createPipelineLayout
2368         https://bugs.webkit.org/show_bug.cgi?id=192843
2369         <rdar://problem/46820395>
2370
2371         Reviewed by Myles Maxfield.
2372
2373         Test: webgpu/pipeline-layouts.html
2374
2375         Implement the emtpy WebGPUPipelineLayout interface, and enable creation via WebGPUDevice::createPipelineLayout:
2376         * Modules/webgpu/WebGPUBindGroupLayout.cpp:
2377         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
2378         * Modules/webgpu/WebGPUBindGroupLayout.h:
2379         (WebCore::WebGPUBindGroupLayout::bindGroupLayout const): Added getter.
2380         * Modules/webgpu/WebGPUDevice.cpp:
2381         (WebCore::WebGPUDevice::createPipelineLayout const): Added.
2382         * Modules/webgpu/WebGPUDevice.h:
2383         * Modules/webgpu/WebGPUDevice.idl: Enable createPipelineLayout.
2384         * Modules/webgpu/WebGPUPipelineLayout.cpp: Added.
2385         (WebCore::WebGPUPipelineLayout::create):
2386         (WebCore::WebGPUPipelineLayout::WebGPUPipelineLayout):
2387         * Modules/webgpu/WebGPUPipelineLayout.h: Added.
2388         * Modules/webgpu/WebGPUPipelineLayout.idl: Added.
2389         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.h: Added.
2390         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl: Added.
2391         * platform/graphics/gpu/GPUDevice.cpp:
2392         (WebCore::GPUDevice::createPipelineLayout const): Added.
2393         * platform/graphics/gpu/GPUDevice.h:
2394         * platform/graphics/gpu/GPUPipelineLayout.cpp: Added.
2395         (WebCore::GPUPipelineLayout::create):
2396         (WebCore::GPUPipelineLayout::GPUPipelineLayout):
2397         * platform/graphics/gpu/GPUPipelineLayout.h: Added.
2398         * platform/graphics/gpu/GPUPipelineLayoutDescriptor.h: Added.
2399
2400         Add files and symbols to project:
2401         * CMakeLists.txt:
2402         * DerivedSources.make:
2403         * Sources.txt:
2404         * WebCore.xcodeproj/project.pbxproj:
2405         * bindings/js/WebCoreBuiltinNames.h:
2406
2407         Add missing include:
2408         * Modules/webgpu/WebGPUQueue.h:
2409
2410 2018-12-18  Ryosuke Niwa  <rniwa@webkit.org>
2411
2412         SVGUseElement::findTarget should return nullptr when there is a cycle
2413         https://bugs.webkit.org/show_bug.cgi?id=192840
2414
2415         Reviewed by Tim Horton.
2416
2417         r233366 added an early return to updateShadowTree() when there is a cycle between an use element and its target.
2418         Consolidate this cycle detection code with the one in SVGUseElement::findTarget which detected cycles when
2419         the SVG use element itself had a corresponding element.
2420
2421         No new tests since there should be no behavioral change.
2422
2423         * svg/SVGUseElement.cpp:
2424         (WebCore::SVGUseElement::updateShadowTree):
2425         (WebCore::SVGUseElement::findTarget const):
2426
2427 2018-12-19  Myles C. Maxfield  <mmaxfield@apple.com>
2428
2429         [WHLSL] Add a handwritten lexer
2430         https://bugs.webkit.org/show_bug.cgi?id=192294
2431
2432         Reviewed by Jon Lee.
2433
2434         This is infrastructure necessary for https://bugs.webkit.org/show_bug.cgi?id=192355. The
2435         implementation matches the lexing rules in the spec (specifically, the rules that start
2436         with an uppercase letter). The spec is at
2437         https://github.com/gpuweb/WHLSL/blob/master/Spec/WHLSL.g4.
2438
2439         This patch also modifies the lexer according to https://github.com/gpuweb/WHLSL/pull/283.
2440
2441         No new tests because the lexer isn't hooked up yet; there are tests in the parser,
2442         once that gets committed.
2443
2444         * Modules/webgpu/WHLSL/WHLSLLexer.cpp: Added.
2445         (WebCore::WHLSL::Lexer::Token::typeName):
2446         (WebCore::WHLSL::Lexer::recognizeKeyword):
2447         (WebCore::WHLSL::Lexer::consumeTokenFromStream):
2448         (WebCore::WHLSL::Lexer::skipWhitespaceAndComments):
2449         (WebCore::WHLSL::isWhitespace):
2450         (WebCore::WHLSL::isNewline):
2451         (WebCore::WHLSL::Lexer::skipWhitespace):
2452         (WebCore::WHLSL::Lexer::skipLineComment):
2453         (WebCore::WHLSL::Lexer::skipLongComment):
2454         (WebCore::WHLSL::Lexer::coreDecimalIntLiteral const):
2455         (WebCore::WHLSL::Lexer::decimalIntLiteral const):
2456         (WebCore::WHLSL::Lexer::decimalUintLiteral const):
2457         (WebCore::WHLSL::isHexadecimalCharacter):
2458         (WebCore::WHLSL::Lexer::coreHexadecimalIntLiteral const):
2459         (WebCore::WHLSL::Lexer::hexadecimalIntLiteral const):
2460         (WebCore::WHLSL::Lexer::hexadecimalUintLiteral const):
2461         (WebCore::WHLSL::Lexer::intLiteral const):
2462         (WebCore::WHLSL::Lexer::uintLiteral const):
2463         (WebCore::WHLSL::Lexer::digit const):
2464         (WebCore::WHLSL::Lexer::digitStar const):
2465         (WebCore::WHLSL::Lexer::character const):
2466         (WebCore::WHLSL::Lexer::coreFloatLiteralType1 const):
2467         (WebCore::WHLSL::Lexer::coreFloatLiteral const):
2468         (WebCore::WHLSL::Lexer::floatLiteral const):
2469         (WebCore::WHLSL::Lexer::validIdentifier const):
2470         (WebCore::WHLSL::Lexer::identifier const):
2471         (WebCore::WHLSL::Lexer::operatorName const):
2472         * Modules/webgpu/WHLSL/WHLSLLexer.h: Added.
2473         (WebCore::WHLSL::Lexer::Lexer):
2474         (WebCore::WHLSL::Lexer::consumeToken):
2475         (WebCore::WHLSL::Lexer::unconsumeToken):
2476         (WebCore::WHLSL::Lexer::state const):
2477         (WebCore::WHLSL::Lexer::setState):
2478         (WebCore::WHLSL::Lexer::isFullyConsumed const):
2479         (WebCore::WHLSL::Lexer::errorString):
2480         (WebCore::WHLSL::Lexer::string const):
2481         (WebCore::WHLSL::Lexer::anyCharacter const):
2482         * Sources.txt:
2483         * WebCore.xcodeproj/project.pbxproj:
2484
2485 2018-12-18  Simon Fraser  <simon.fraser@apple.com>
2486
2487         Web Inspector: Timelines: correctly label Intersection Observer callbacks
2488         https://bugs.webkit.org/show_bug.cgi?id=192669
2489         <rdar://problem/46702490>
2490
2491         Reviewed by Joseph Pecoraro.
2492
2493         Add InspectorInstrumentation::willFireObserverCallback() and use it to wrap calls
2494         to Intersection Observer, Performance Observer and Mutation Observer callbacks so 
2495         that they get correctly labeled in the Inspector timeline.
2496
2497         * dom/MutationObserver.cpp:
2498         (WebCore::MutationObserver::deliver):
2499         * en.lproj/Localizable.strings:
2500         * inspector/InspectorInstrumentation.cpp:
2501         (WebCore::InspectorInstrumentation::willFireObserverCallbackImpl):
2502         (WebCore::InspectorInstrumentation::didFireObserverCallbackImpl):
2503         * inspector/InspectorInstrumentation.h:
2504         (WebCore::InspectorInstrumentation::willFireObserverCallback):
2505         (WebCore::InspectorInstrumentation::didFireObserverCallback):
2506         * inspector/TimelineRecordFactory.cpp:
2507         (WebCore::TimelineRecordFactory::createObserverCallbackData):
2508         * inspector/TimelineRecordFactory.h:
2509         * inspector/agents/InspectorTimelineAgent.cpp:
2510         (WebCore::InspectorTimelineAgent::willFireObserverCallback):
2511         (WebCore::InspectorTimelineAgent::didFireObserverCallback):
2512         (WebCore::toProtocol):
2513         * inspector/agents/InspectorTimelineAgent.h:
2514         * page/IntersectionObserver.cpp:
2515         (WebCore::IntersectionObserver::notify):
2516         * page/PerformanceObserver.cpp:
2517         (WebCore::PerformanceObserver::deliver):
2518
2519 2018-12-19  Claudio Saavedra  <csaavedra@igalia.com>
2520
2521         ContentExtensions: DFANode.cpp:66:44: error: narrowing conversion of '-1' from 'int' to 'char' inside { }
2522         https://bugs.webkit.org/show_bug.cgi?id=192854
2523
2524         Reviewed by Alex Christensen.
2525
2526         * contentextensions/DFANode.h: Define CharRange's chars as signed
2527
2528 2018-12-19  Youenn Fablet  <youenn@apple.com>
2529
2530         Remove RTCRtpTransceiver.setDirection
2531         https://bugs.webkit.org/show_bug.cgi?id=192869
2532
2533         Reviewed by Alex Christensen.
2534
2535         Covered by rebased test.
2536
2537         * Modules/mediastream/RTCRtpTransceiver.idl:
2538
2539 2018-12-19  Jer Noble  <jer.noble@apple.com>
2540
2541         Force synchronous decode in WebCoreDecompressionSession::decodeSampleSync()
2542         https://bugs.webkit.org/show_bug.cgi?id=192856
2543         <rdar://problem/46843245>
2544
2545         Reviewed by Alex Christensen.
2546
2547         Some decoders exposed through VideoToolbox will decode asynchronously even when 
2548         kVTDecodeInfo_Asynchronous is not set. Force synchronous behavior with a Semaphore.
2549
2550         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2551         (WebCore::WebCoreDecompressionSession::decodeSampleSync):
2552
2553 2018-12-19  Megan Gardner  <megan_gardner@apple.com>
2554
2555         Allow clients to set the navigator platform
2556         https://bugs.webkit.org/show_bug.cgi?id=192735
2557
2558         Reviewed by Tim Horton.
2559
2560         Expanded TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm.
2561
2562         Lots of piping to allow the setting of a custom navigator platform.
2563
2564         * loader/DocumentLoader.h:
2565         (WebCore::DocumentLoader::setCustomNavigatorPlatform):
2566         (WebCore::DocumentLoader::customNavigatorPlatform const):
2567         * loader/FrameLoader.cpp:
2568         (WebCore::FrameLoader::navigatorPlatform const):
2569         * loader/FrameLoader.h:
2570         * page/Navigator.cpp:
2571         (WebCore::Navigator::platform const):
2572         * page/Navigator.h:
2573         * page/NavigatorBase.cpp:
2574         (WebCore::NavigatorBase::platform const):
2575         (WebCore::NavigatorBase::platform): Deleted.
2576         * page/NavigatorBase.h:
2577
2578 2018-12-19  Ryan Haddad  <ryanhaddad@apple.com>
2579
2580         Unreviewed, rolling out r239347.
2581
2582         Caused the leaks bot to hit an exception and the new test
2583         crashes on certain configurations.
2584
2585         Reverted changeset:
2586
2587         "Synchronous media query evaluation could destroy current
2588         Frame/FrameView."
2589         https://bugs.webkit.org/show_bug.cgi?id=192781
2590         https://trac.webkit.org/changeset/239347
2591
2592 2018-12-19  Truitt Savell  <tsavell@apple.com>
2593
2594         Unreviewed, rolling out r239358.
2595
2596         Revision caused imported/w3c/web-platform-tests/IndexedDB/ to
2597         crash on Debug bots
2598
2599         Reverted changeset:
2600
2601         "Clean up IndexedDB files between tests"
2602         https://bugs.webkit.org/show_bug.cgi?id=192796
2603         https://trac.webkit.org/changeset/239358
2604
2605 2018-12-19  Don Olmstead  <don.olmstead@sony.com>
2606
2607         Sync some include directories in WebCore
2608         https://bugs.webkit.org/show_bug.cgi?id=192819
2609
2610         Reviewed by Michael Catanzaro.
2611
2612         Added missing include directories around features that have only been enabled on
2613         Apple ports. Removes obsolete directories from list and moves harfbuzz directories
2614         into the freetype cmake file.
2615
2616         * CMakeLists.txt:
2617         * platform/FreeType.cmake:
2618
2619 2018-12-19  Alicia Boya García  <aboya@igalia.com>
2620
2621         [MSE] Remove unused method: stopAskingForMoreSamples()
2622         https://bugs.webkit.org/show_bug.cgi?id=192754
2623
2624         Reviewed by Xabier Rodriguez-Calvar.
2625
2626         The stopAskingForMoreSamples() method from SourceBufferPrivate is not
2627         being used by anyone. SourceBuffer is not calling it and no
2628         SourceBufferPrivate is implementing it. Let's remove that noise.
2629
2630         * platform/graphics/SourceBufferPrivate.h:
2631         (WebCore::SourceBufferPrivate::setActive):
2632         (WebCore::SourceBufferPrivate::stopAskingForMoreSamples): Deleted.
2633         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
2634         (WebCore::SourceBufferPrivateGStreamer::stopAskingForMoreSamples): Deleted.
2635         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
2636
2637 2018-12-19  Alicia Boya García  <aboya@igalia.com>
2638
2639         [MSE] Remove dead code: sourceBufferPrivateSeekToTime()
2640         https://bugs.webkit.org/show_bug.cgi?id=192827
2641
2642         Reviewed by Xabier Rodriguez-Calvar.
2643
2644         This patch makes two dead code removal changes in
2645         SourceBufferPrivateClient:
2646
2647         First, sourceBufferPrivateFastSeekTimeForMediaTime() is made pure
2648         virtual in SourceBufferPrivateClient. Since SourceBufferPrivateClient
2649         is only inherited by SourceBuffer, it makes no sense to have default
2650         implementations there (they will never be used), moreso it being a
2651         client interface.
2652
2653         Second, sourceBufferPrivateSeekToTime() is removed entirely. It used
2654         to had an empty implementation, which SourceBuffer did not overwrite,
2655         therefore making any calls to it useless.
2656
2657         All calls to sourceBufferPrivateSeekToTime() have been removed:
2658
2659         SourceBufferPrivateAVFObjC::seekToTime(), which was also dead code
2660         itself, used to call this method. This patch deletes it completely.
2661
2662         MockSourceBufferPrivate::seekToTime(), which only called this empty
2663         method, has also been removed along with its only usage in
2664         MockMediaSourcePrivate::seekToTime().
2665
2666         * platform/graphics/SourceBufferPrivateClient.h:
2667         (WebCore::SourceBufferPrivateClient::sourceBufferPrivateFastSeekTimeForMediaTime): Deleted.
2668         (WebCore::SourceBufferPrivateClient::sourceBufferPrivateSeekToTime): Deleted.
2669         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2670         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2671         (WebCore::SourceBufferPrivateAVFObjC::seekToTime): Deleted.
2672         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
2673         (WebCore::MockMediaSourcePrivate::seekToTime):
2674         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2675         (WebCore::MockSourceBufferPrivate::seekToTime): Deleted.
2676         * platform/mock/mediasource/MockSourceBufferPrivate.h:
2677
2678 2018-12-19  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2679
2680         [EME] MediaKeySystemConfiguration distinctiveIdentifier and persistentState should default to optional
2681         https://bugs.webkit.org/show_bug.cgi?id=192815
2682
2683         Reviewed by Jer Noble.
2684
2685         https://www.w3.org/TR/encrypted-media/#dom-mediakeysystemconfiguration
2686         says that distinctiveIdentifier and persistentState default to
2687         optional. Our implementation does not define a default leaving it
2688         to the first option of the enum, which currently is Required.
2689
2690         * platform/encryptedmedia/CDMKeySystemConfiguration.h:
2691
2692 2018-12-19  Rob Buis  <rbuis@igalia.com>
2693
2694         Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList
2695         https://bugs.webkit.org/show_bug.cgi?id=192288
2696
2697         Reviewed by Frédéric Wang.
2698
2699         Prefer return value to out parameter for parseAccessControlAllowList.
2700
2701         * loader/CrossOriginPreflightResultCache.cpp:
2702         (WebCore::CrossOriginPreflightResultCacheItem::parse):
2703         * platform/network/HTTPParsers.h:
2704         (WebCore::parseAccessControlAllowList):
2705         * platform/network/ResourceResponseBase.cpp:
2706         (WebCore::ResourceResponseBase::filter):
2707         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
2708
2709 2018-12-18  Zan Dobersek  <zdobersek@igalia.com>
2710
2711         REGRESSION(r235165): [GTK][WPE] Garbled rendering on GitLab
2712         https://bugs.webkit.org/show_bug.cgi?id=192230
2713
2714         Reviewed by Carlos Garcia Campos.
2715
2716         Single tile can after r235165 be assigned multiple content updates
2717         without a commit occurring between each update, whereas before these
2718         commits were done for each update.
2719
2720         To avoid repeating updates for a single tile purging information about
2721         the previous update, these updates are now accumulated inside a Vector
2722         and then iterated over during the commit phase.
2723
2724         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp:
2725         (WebCore::CoordinatedBackingStoreTile::addUpdate):
2726         (WebCore::CoordinatedBackingStoreTile::swapBuffers):
2727         (WebCore::CoordinatedBackingStore::updateTile):
2728         (WebCore::CoordinatedBackingStoreTile::setBackBuffer): Deleted.
2729         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.h:
2730         (WebCore::CoordinatedBackingStoreTile::scale const):
2731
2732 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2733
2734         [iOS] A copied text selection is pasted as a web archive attachment in the entry view in Messages
2735         https://bugs.webkit.org/show_bug.cgi?id=192842
2736         <rdar://problem/46823586>
2737
2738         Reviewed by Tim Horton.
2739
2740         Temporarily revert a behavior change introduced by r238661, where we now add "com.apple.webarchive" as a
2741         registered UTI when dragging or copying a text selection. This broke the Messages app on iOS, which currently
2742         inserts a copied or dragged text selection from WebKit-based views as a web archive file attachment. A fix for
2743         this is internally tracked in <rdar://problem/46830277>.
2744
2745         * platform/ios/PlatformPasteboardIOS.mm:
2746         (WebCore::PlatformPasteboard::write):
2747
2748 2018-12-18  Michael Catanzaro  <mcatanzaro@igalia.com>
2749
2750         Unreviewed, add a missing UNUSED_PARAM()
2751
2752         * Modules/mediarecorder/MediaRecorder.cpp:
2753         (WebCore::MediaRecorder::getPrivateImpl):
2754
2755 2018-12-18  Justin Michaud  <justin_michaud@apple.com>
2756
2757         Update CSS Properties and Values API to use new cycle fallback behaviour
2758         https://bugs.webkit.org/show_bug.cgi?id=192800
2759
2760         Reviewed by Antti Koivisto.
2761
2762         Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the
2763         wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. 
2764
2765         * css/CSSCustomPropertyValue.h:
2766         * css/CSSVariableReferenceValue.cpp:
2767         (WebCore::resolveVariableReference):
2768         * css/DOMCSSRegisterCustomProperty.cpp:
2769         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
2770         * css/StyleResolver.cpp:
2771         (WebCore::StyleResolver::applyCascadedCustomProperty):
2772         * css/parser/CSSPropertyParser.cpp:
2773         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
2774
2775 2018-12-18  Daniel Bates  <dabates@apple.com>
2776
2777         Wrong value for key property in keydown and keyup events generated holding Control key
2778         https://bugs.webkit.org/show_bug.cgi?id=192788
2779         <rdar://problem/46795214>
2780
2781         Reviewed by Wenson Hsieh.
2782
2783         Similar to what we do on Mac, compute the DOM key property from the characters ignoring
2784         modifier keys input string when the Control key is held down.
2785
2786         * platform/ios/PlatformEventFactoryIOS.mm:
2787         (WebCore::keyForKeyEvent):
2788         * platform/mac/PlatformEventFactoryMac.mm:
2789         (WebCore::keyForKeyEvent):
2790
2791 2018-12-18  Sihui Liu  <sihui_liu@apple.com>
2792
2793         Clean up IndexedDB files between tests
2794         https://bugs.webkit.org/show_bug.cgi?id=192796
2795
2796         Reviewed by Geoffrey Garen.
2797
2798         We should clean up the IndexedDB files between tests to make sure each test is independent of others.
2799
2800         This patch also fixes some issues in IDB.
2801
2802         Covered by existing tests.
2803
2804         * Modules/indexeddb/server/IDBServer.cpp:
2805         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
2806         We should shut down all open databases instead of databases from open database connections before deleting 
2807         files, because database starts accessing files before connection to database is established.
2808
2809         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2810         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
2811         We should shutdown database after tasks in queue are completed, because tasks have pointer of UniqueIDBDatabase 
2812         and UniqueIDBDatabase can be destructed after shutdown.
2813
2814         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
2815         didDeleteBackingStore can be posted to main thread after immediateCloseForUserDelete, and timer should not be 
2816         invoked during the hard close.
2817
2818         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
2819         Tasks like didOpenBackingStore could be posted from database thread to main thread after 
2820         immediateCloseForUserDelete, but we know the backing store will be deleted soon, so no need to handle any 
2821         database operation. 
2822
2823         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
2824         performPrefetchCursor needs to be aware of whether UniqueIDBDatabase is being closed, so that it will not access 
2825         m_backingStore when m_backingStore may already be deleted. 
2826
2827         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
2828         immediateCloseForUserDelete does not handle transactions that are in the process of commit or abort. 
2829         m_objectStoreTransactionCounts and m_objectStoreWriteTransactions may be used by those transactions in 
2830         transactionCompleted, so they do not need to be cleared here.
2831
2832 2018-12-18  Myles C. Maxfield  <mmaxfield@apple.com>
2833
2834         Thick overlines and line-throughs grow in the wrong direction
2835         https://bugs.webkit.org/show_bug.cgi?id=192264
2836
2837         Reviewed by Dean Jackson.
2838
2839         Overlines should grow upward, and line-throughs should stay centered.
2840
2841         Test: fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html
2842
2843         * rendering/TextDecorationPainter.cpp:
2844         (WebCore::TextDecorationPainter::paintTextDecoration):
2845         * style/InlineTextBoxStyle.cpp:
2846         (WebCore::visualOverflowForDecorations):
2847
2848 2018-12-18  Ryosuke Niwa  <rniwa@webkit.org>
2849
2850         Some iOS app crash in FrameLoader::checkCompleted
2851         https://bugs.webkit.org/show_bug.cgi?id=192804
2852         <rdar://problem/44240573>
2853
2854         Reviewed by Tim Horton.
2855
2856         It's possible for the main thread to call into WebCore / UIWebView selectors while Web thread
2857         is trying to send a delegate message. Disable the release assertion while this is happening
2858         so that iOS app would not crash.
2859
2860         Unfortunately no new test as there is no way to easily test UIWebView in iOS,
2861         and this requires a race between the web thread & the main thread.
2862
2863         * dom/ScriptDisallowedScope.h:
2864         (WebCore::ScriptDisallowedScope::InMainThread::isScriptAllowed):
2865         * platform/ios/wak/WebCoreThread.h:
2866         * platform/ios/wak/WebCoreThread.mm:
2867         (WebThreadDelegateMessageScope::WebThreadDelegateMessageScope):
2868         (WebThreadDelegateMessageScope::~WebThreadDelegateMessageScope):
2869         (SendDelegateMessage):
2870
2871 2018-12-18  David Kilzer  <ddkilzer@apple.com>
2872
2873         clang-tidy: Use const reference for MediaTime parameter to prevent object copy
2874         <https://webkit.org/b/192814>
2875
2876         Reviewed by Mark Lam.
2877
2878         * bindings/js/JSDOMConvertNumbers.h:
2879         (WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
2880
2881 2018-12-18  Justin Fan  <justin_fan@apple.com>
2882
2883         [WebGPU] BindGroupLayout and Device::createBindGroupLayout
2884         https://bugs.webkit.org/show_bug.cgi?id=192817
2885
2886         Reviewed by Dean Jackson.
2887
2888         Update bind-group-layouts to test new functionality.
2889
2890         Implement the emtpy WebGPUBindGroupLayout interface, and enable creation via WebGPUDevice::createBindGroupLayout:
2891         * Modules/webgpu/WebGPUBindGroupLayout.cpp: Added.
2892         (WebCore::WebGPUBindGroupLayout::create):
2893         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
2894         * Modules/webgpu/WebGPUBindGroupLayout.h: Added.
2895         * Modules/webgpu/WebGPUBindGroupLayout.idl: Added. Empty interface for now.
2896         * Modules/webgpu/WebGPUDevice.cpp:
2897         (WebCore::WebGPUDevice::createBindGroupLayout const): Added.
2898         * Modules/webgpu/WebGPUDevice.h:
2899         * Modules/webgpu/WebGPUDevice.idl:
2900         * platform/graphics/gpu/GPUBindGroupLayout.cpp: Added.
2901         (WebCore::GPUBindGroupLayout::tryCreate):
2902         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
2903         * platform/graphics/gpu/GPUBindGroupLayout.h: Added.
2904         * platform/graphics/gpu/GPUDevice.cpp:
2905         (WebCore::GPUDevice::tryCreateBindGroupLayout const): Added.
2906         * platform/graphics/gpu/GPUDevice.h:
2907
2908         Add files and symbols to project:
2909         * CMakeLists.txt:
2910         * DerivedSources.make:
2911         * Sources.txt:
2912         * WebCore.xcodeproj/project.pbxproj:
2913         * bindings/js/WebCoreBuiltinNames.h:
2914
2915         Missing includes that were previously provided via UnifiedSources:
2916         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
2917         * platform/sql/SQLiteFileSystem.h:
2918
2919 2018-12-18  Youenn Fablet  <youenn@apple.com>
2920
2921         Make ReadableStreamXX constructs use PrivateIdentifier
2922         https://bugs.webkit.org/show_bug.cgi?id=192771
2923
2924         Reviewed by Chris Dumez.
2925
2926         PrivateIdentifier is a better name for making sure a given construct does not show up in the global scope.
2927         Covered by existing binding tests.
2928
2929         * Modules/streams/ReadableByteStreamController.idl:
2930         * Modules/streams/ReadableStreamBYOBReader.idl:
2931         * Modules/streams/ReadableStreamBYOBRequest.idl:
2932         * Modules/streams/ReadableStreamDefaultController.idl:
2933         * Modules/streams/ReadableStreamDefaultReader.idl:
2934         * bindings/scripts/CodeGeneratorJS.pm:
2935         (NeedsConstructorProperty):
2936         * bindings/scripts/preprocess-idls.pl:
2937         (shouldExposeInterface):
2938         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Removed.
2939         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Removed.
2940         * bindings/scripts/test/TestCustomConstructor.idl: Removed.
2941
2942 2018-12-18  Zalan Bujtas  <zalan@apple.com>
2943
2944         Synchronous media query evaluation could destroy current Frame/FrameView.
2945         https://bugs.webkit.org/show_bug.cgi?id=192781
2946         <rdar://problem/34416793>
2947
2948         Reviewed by Chris Dumez.
2949
2950         Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.
2951
2952         Test: printing/print-with-media-query-destory.html
2953
2954         * loader/DocumentLoader.cpp:
2955         (WebCore::DocumentLoader::finishedLoading):
2956         * page/Frame.cpp:
2957         (WebCore::Frame::setPrinting):
2958         * page/FrameView.cpp:
2959         (WebCore::FrameView::forceLayoutForPagination):
2960
2961 2018-12-18  Joseph Pecoraro  <pecoraro@apple.com>
2962
2963         Web Inspector: m3u8 content not shown, it should be text
2964         https://bugs.webkit.org/show_bug.cgi?id=192731
2965         <rdar://problem/46747728>
2966
2967         Reviewed by Devin Rousso.
2968
2969         * inspector/NetworkResourcesData.cpp:
2970         (WebCore::NetworkResourcesData::setResourceContent):
2971         Don't clobber data if setting empty content on a resource that has content.
2972
2973         * inspector/agents/InspectorNetworkAgent.cpp:
2974         (WebCore::InspectorNetworkAgent::shouldTreatAsText):
2975         Additional non-"text/" mime types that can be treated as text.
2976
2977         * platform/MIMETypeRegistry.cpp:
2978         (WebCore::MIMETypeRegistry::isTextMediaPlaylistMIMEType):
2979         * platform/MIMETypeRegistry.h:
2980         Detect media playlist mime types that are text (m3u8/m3u).
2981
2982 2018-12-18  Daniel Bates  <dabates@apple.com>
2983
2984         Remove <meta http-equiv=set-cookie> support
2985         https://bugs.webkit.org/show_bug.cgi?id=185077
2986         <rdar://problem/41791397>
2987
2988         Reviewed by Brent Fulgham.
2989
2990         Remove support for the HTTP-equiv. pragma Set-Cookie to set a cookie. In <https://github.com/whatwg/html/pull/3649>
2991         the HTML living standard was ammended to define this pragma as no-op. Chrome and Edge have also
2992         removed support for this pragma and Firefox has an open bug to remove it.
2993
2994         * dom/Document.cpp:
2995         (WebCore::Document::processHttpEquiv): Emit a message that the Set-Cookie pragma is obsolete and
2996         was ignored instead of setting the cookie.
2997         * html/parser/XSSAuditor.cpp:
2998         (WebCore::isDangerousHTTPEquiv): We no longer need to consider the Set-Cookie pragma
2999         as dangerous and erase attribute http-equiv when we find it because we no longer honor
3000         this pragma.
3001
3002 2018-12-18  Justin Michaud  <justin_michaud@apple.com>
3003
3004         CSS Typed OM should expose attributeStyleMap
3005         https://bugs.webkit.org/show_bug.cgi?id=192671
3006
3007         Reviewed by Ryosuke Niwa.
3008
3009         Exposes element.attributeStyleMap, adds a stub for the StylePropertyMap class, and updates the existing
3010         TypedOMCSSImageValue to not require a RenderObject so that it can still work inside attributeStyleMap.
3011
3012         Test: css-typedom/attributeStyleMap.html
3013
3014         * CMakeLists.txt:
3015         * DerivedSources.make:
3016         * Sources.txt:
3017         * WebCore.xcodeproj/project.pbxproj:
3018         * bindings/js/WebCoreBuiltinNames.h:
3019         * css/ElementCSSInlineStyle.idl:
3020         * css/typedom/StylePropertyMap.h: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.h.
3021         * css/typedom/StylePropertyMap.idl: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl.
3022         * css/typedom/StylePropertyMapReadOnly.cpp: Added.
3023         (WebCore::StylePropertyMapReadOnly::reifyValue):
3024         (WebCore::StylePropertyMapReadOnly::customPropertyValueOrDefault):
3025         * css/typedom/StylePropertyMapReadOnly.h:
3026         (WebCore::StylePropertyMapReadOnly::create): Deleted.
3027         (WebCore::StylePropertyMapReadOnly::get const): Deleted.
3028         (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): Deleted.
3029         * css/typedom/StylePropertyMapReadOnly.idl:
3030         * css/typedom/TypedOMCSSImageValue.h:
3031         * dom/Element.cpp:
3032         (WebCore::Element::attributeStyleMap):
3033         (WebCore::Element::setAttributeStyleMap):
3034         * dom/Element.h:
3035         * dom/ElementRareData.cpp:
3036         * dom/ElementRareData.h:
3037         (WebCore::ElementRareData::attributeStyleMap):
3038         (WebCore::ElementRareData::setAttributeStyleMap):
3039         * dom/StyledElement.cpp:
3040         (WebCore::StyledElement::ensureAttributeStyleMap):
3041         * dom/StyledElement.h:
3042         * html/canvas/CanvasRenderingContext2DBase.cpp:
3043         (WebCore::size):
3044         (WebCore::CanvasRenderingContext2DBase::drawImage):
3045         * platform/graphics/CustomPaintImage.cpp:
3046         (WebCore::extractComputedProperty):
3047         (WebCore::CustomPaintImage::doCustomPaint):
3048
3049 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
3050
3051         Calling setValue() while typing should invoke -textDidChangeInTextField in the injected bundle
3052         https://bugs.webkit.org/show_bug.cgi?id=192785
3053         <rdar://problem/45321184>
3054
3055         Reviewed by Tim Horton.
3056
3057         Makes a minor adjustment in `TextFieldInputType::setValue` to consider value changes as "user editing", if we're
3058         currently processing a keystroke from the user. This is useful for certain private clients, such as Safari, that
3059         need to know when the user is typing in a text form control, but the page is preventing default text insertion
3060         behavior and instead updating values programmatically.
3061
3062         Test: fast/forms/call-text-did-change-in-text-field-when-typing.html
3063
3064         * html/TextFieldInputType.cpp:
3065         (WebCore::TextFieldInputType::setValue):
3066
3067 2018-12-18  Zalan Bujtas  <zalan@apple.com>
3068
3069         [LFC][BFC][MarginCollapsing] Implement marginBeforeCollapsesWithParentMarginAfter
3070         https://bugs.webkit.org/show_bug.cgi?id=192801
3071
3072         Reviewed by Antti Koivisto.
3073
3074         * layout/blockformatting/BlockFormattingContext.h:
3075         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3076         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3077         * layout/blockformatting/BlockMarginCollapse.cpp:
3078         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
3079
3080 2018-12-18  Zalan Bujtas  <zalan@apple.com>
3081
3082         [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithSiblingMarginBeforeWithClearance
3083         https://bugs.webkit.org/show_bug.cgi?id=192799
3084
3085         Reviewed by Antti Koivisto.
3086
3087         * layout/blockformatting/BlockFormattingContext.h:
3088         * layout/blockformatting/BlockMarginCollapse.cpp:
3089         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
3090         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
3091
3092 2018-12-18  Zalan Bujtas  <zalan@apple.com>
3093
3094         [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithParentMarginBefore
3095         https://bugs.webkit.org/show_bug.cgi?id=192798
3096
3097         Reviewed by Antti Koivisto.
3098
3099         * layout/blockformatting/BlockFormattingContext.h:
3100         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3101         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3102         * layout/blockformatting/BlockMarginCollapse.cpp:
3103         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
3104         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
3105         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
3106         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
3107
3108 2018-12-18  Zalan Bujtas  <zalan@apple.com>
3109
3110         [LFC][BFC][MarginCollapsing] Expand marginsCollapseThrough collapsing logic
3111         https://bugs.webkit.org/show_bug.cgi?id=192794
3112
3113         Reviewed by Antti Koivisto.
3114
3115         * layout/blockformatting/BlockFormattingContext.h:
3116         * layout/blockformatting/BlockMarginCollapse.cpp:
3117         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
3118         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
3119         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
3120
3121 2018-12-18  Zalan Bujtas  <zalan@apple.com>
3122
3123         [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithNextSibling and marginBeforeCollapsesWithPreviousSibling collapsing logic
3124         https://bugs.webkit.org/show_bug.cgi?id=192791
3125
3126         Reviewed by Antti Koivisto.
3127
3128         * layout/blockformatting/BlockMarginCollapse.cpp:
3129         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
3130         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
3131
3132 2018-12-18  Zalan Bujtas  <zalan@apple.com>
3133
3134         [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithParentMarginAfter and marginBeforeCollapsesWithParentMarginBefore collapsing logic
3135         https://bugs.webkit.org/show_bug.cgi?id=192787
3136
3137         Reviewed by Antti Koivisto.
3138
3139         * layout/blockformatting/BlockFormattingContext.h:
3140         * layout/blockformatting/BlockMarginCollapse.cpp:
3141         (WebCore::Layout::hasClearance):
3142         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
3143         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
3144         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
3145         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
3146
3147 2018-12-17  Fujii Hironori  <Hironori.Fujii@sony.com>
3148
3149         [Win][Clang] Fix compilation warnings WebCore/platform/graphics directory
3150         https://bugs.webkit.org/show_bug.cgi?id=192752
3151
3152         Reviewed by Don Olmstead.
3153
3154         No new tests, no behavior changes.
3155
3156         * platform/graphics/win/DIBPixelData.cpp:
3157         Enclosed bitmapType and bitmapPixelsPerMeter with #ifndef NDEBUG.
3158         * platform/graphics/win/FontPlatformDataWin.cpp:
3159         (WebCore::FontPlatformData::openTypeTable const): Use ASSERT_UNUSED instead of ASSERT.
3160         * platform/graphics/win/GraphicsContextWin.cpp: Removed unused variable 'deg2rad'.
3161         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3162         Removed unused soft links MFCreateSampleGrabberSinkActivate, MFCreateMemoryBuffer and MFCreateSample.
3163         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
3164         Reorder the initializer list.
3165         (WebCore::MediaPlayerPrivateMediaFoundation::seek): Use ASSERT_UNUSED instead of ASSERT.
3166         (WebCore::MediaPlayerPrivateMediaFoundation::setAllChannelVolumes): Ditto.
3167         (WebCore::MediaPlayerPrivateMediaFoundation::createSession): Ditto.
3168         (WebCore::MediaPlayerPrivateMediaFoundation::endSession): Ditto.
3169         (WebCore::MediaPlayerPrivateMediaFoundation::onCreatedMediaSource): Ditto.
3170         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): Added default case.
3171         * platform/graphics/win/SimpleFontDataCairoWin.cpp:
3172         (WebCore::Font::platformBoundsForGlyph const): Use inner braces to initialize subobjects of MAT2.
3173         * platform/graphics/win/SimpleFontDataWin.cpp: Removed unused 'cSmallCapsFontSizeMultiplier'.
3174         (WebCore::Font::initGDIFont): Use inner braces to initialize subobjects of MAT2.
3175         (WebCore::Font::boundsForGDIGlyph const): Ditto.
3176         (WebCore::Font::widthForGDIGlyph const): Ditto.
3177         * platform/graphics/win/UniscribeController.cpp:
3178         (WebCore::UniscribeController::UniscribeController):
3179         Reorder the initializer list.
3180         (WebCore::UniscribeController::offsetForPosition): Use parentheses to combine && and ||.
3181         (WebCore::UniscribeController::shapeAndPlaceItem): Removed unused 'glyphCount'.
3182
3183 2018-12-17  Eric Carlson  <eric.carlson@apple.com>
3184
3185         [MediaStream] A stream's first video frame should be rendered
3186         https://bugs.webkit.org/show_bug.cgi?id=192629
3187         <rdar://problem/46664353>
3188
3189         Reviewed by Youenn Fablet.
3190
3191         Test: fast/mediastream/media-stream-renders-first-frame.html
3192
3193         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
3194         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3195         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
3196         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
3197         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode const):
3198         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode):
3199         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
3200         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState):
3201         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::characteristicsChanged):
3202         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
3203         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
3204         * platform/mediastream/RealtimeMediaSource.cpp:
3205         (WebCore::RealtimeMediaSource::size const):
3206         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3207         (WebCore::AVVideoCaptureSource::processNewFrame):
3208         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
3209         (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
3210
3211 2018-12-17  Justin Michaud  <justin_michaud@apple.com>
3212
3213         Bindings generator should support Conditional= along with CachedAttribute
3214         https://bugs.webkit.org/show_bug.cgi?id=192721
3215
3216         Reviewed by Ryosuke Niwa.
3217
3218         Fix a bug where specifying both attributes causes compilation errors because the compile-time
3219         condition is not included in the derived code.
3220
3221         * bindings/scripts/CodeGeneratorJS.pm:
3222         (GenerateImplementation):
3223         * bindings/scripts/test/JS/JSTestObj.cpp:
3224         (WebCore::jsTestObjCachedAttribute3Getter):
3225         (WebCore::jsTestObjCachedAttribute3):
3226         (WebCore::JSTestObj::visitChildren):
3227         * bindings/scripts/test/JS/JSTestObj.h:
3228         * bindings/scripts/test/TestObj.idl:
3229
3230 2018-12-17  David Kilzer  <ddkilzer@apple.com>
3231
3232         clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
3233         <https://webkit.org/b/192707>
3234         <rdar://problem/46734926>
3235
3236         Reviewed by Daniel Bates.
3237
3238         * platform/CPUMonitor.cpp:
3239         (WebCore::CPUMonitor::setCPULimit):
3240         * platform/CPUMonitor.h:
3241         (WebCore::CPUMonitor::setCPULimit):
3242         - Change parameter to const reference to fix unnecessary copies.
3243
3244 2018-12-17  Ryosuke Niwa  <rniwa@webkit.org>
3245
3246         offsetLeft and offsetParent should adjust across shadow boundaries
3247         https://bugs.webkit.org/show_bug.cgi?id=157437
3248         <rdar://problem/26154021>
3249
3250         Reviewed by Simon Fraser.
3251
3252         Update the WebKit's treatment of shadow boundaries in offsetLeft, offsetTop, and offsetParent to match
3253         the latest discussion in CSS WG. See https://github.com/w3c/webcomponents/issues/497
3254         and https://github.com/w3c/webcomponents/issues/763
3255
3256         The latest consensus is to use the retargeting algorithm (https://dom.spec.whatwg.org/#retarget).
3257         In practice, this would mean that we need to keep walking up the offset parent ancestors until we find
3258         the one which is in the same tree as a shadow-inclusive ancestor of the context object.
3259
3260         For example, if a node (the context object of offsetTop, offsetLeft, offsetParent) was assigned to a slot
3261         inside a shadow tree and its offset parent was in the shadow tree, we need to walk up to its offset parent,
3262         then its offset parent, etc... until we find the offset parent in the same tree as the context object.
3263
3264         Note it's possible that the context object is inside a shadow tree which does not have its own offset parent.
3265         (e.g. all elements have position: static) For this reason, we need to consider not just offset parent in
3266         the same tree as the context object but as well as any offset parent which is in its ancestor trees.
3267
3268         Test: fast/shadow-dom/offsetParent-across-shadow-boundaries.html
3269
3270         * dom/Element.cpp:
3271         (WebCore::adjustOffsetForZoomAndSubpixelLayout): Extracted to share code between offsetLeft and offsetTop.
3272         (WebCore::collectAncestorTreeScopeAsHashSet): Added.
3273         (WebCore::Element::offsetLeftForBindings): Added. Sums up offsetLeft's until it finds the first offset parent
3274         which is a shadow-including ancestor (https://dom.spec.whatwg.org/#concept-shadow-including-ancestor).
3275         (WebCore::Element::offsetLeft): Now uses adjustOffsetForZoomAndSubpixelLayout.
3276         (WebCore::Element::offsetTopForBindings): Added. Like offsetLeftForBindings, this function sums up offsetTop's
3277         until it finds the first offset parent which is a shadow-including ancestor.
3278         (WebCore::Element::offsetTop): Now uses adjustOffsetForZoomAndSubpixelLayout.
3279         (WebCore::Element::offsetParentForBindings): Renamed from bindingsOffsetParent to be consistent with other
3280         functions meant to be used for bindings code.
3281         * dom/Element.h:
3282         * html/HTMLElement.idl:
3283
3284 2018-12-17  Simon Fraser  <simon.fraser@apple.com>
3285
3286         Don't use more expensive layer backing store formats when subpixel text antialiasing is not enabled
3287         https://bugs.webkit.org/show_bug.cgi?id=192780
3288         rdar://problem/43394387
3289
3290         Reviewed by Tim Horton.
3291         
3292         macOS Mojave disabled text subpixel antialiasing by default, so we no longer need to use the
3293         memory-hungry "linear glyph mask" CALayer backing store formats for non-opaque with text in them.
3294         
3295         Add FontCascade::isSubpixelAntialiasingAvailable() which reports whether subpixel antialiasing is available,
3296         and consult it when making decisions that affect layer backing store format.
3297
3298         Tested by new results for existing tests.
3299
3300         * platform/graphics/FontCascade.cpp:
3301         (WebCore::FontCascade::isSubpixelAntialiasingAvailable):
3302         * platform/graphics/FontCascade.h:
3303         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3304         (WebCore::FontCascade::isSubpixelAntialiasingAvailable): CGFontRenderingGetFontSmoothingDisabled() isn't super cheap, so fetch
3305         it once.
3306         * rendering/RenderLayerBacking.cpp:
3307         (WebCore::RenderLayerBacking::updateAfterDescendants):
3308         * testing/Internals.cpp:
3309         (WebCore::Internals::setFontSmoothingEnabled): Remove a WebCore::
3310
3311 2018-12-17  Daniel Bates  <dabates@apple.com>
3312
3313         Make DocumentMarker::allMarkers() constexpr
3314         https://bugs.webkit.org/show_bug.cgi?id=192634
3315
3316         Reviewed by Simon Fraser.
3317
3318         The result of DocumentMarker::allMarkers() can be computed at compile time. We should annotate
3319         it constexpr to do just that.
3320
3321         * dom/DocumentMarker.h:
3322         (WebCore::DocumentMarker::allMarkers):
3323
3324 2018-12-17  Justin Fan  <justin_fan@apple.com>
3325
3326         [WebGPU] Implement WebGPUBindGroupLayoutDescriptor and its supporting dictionaries
3327         https://bugs.webkit.org/show_bug.cgi?id=192726
3328
3329         Reviewed by Myles C. Maxfield.
3330
3331         Test: webgpu/bind-group-layouts.html
3332         Implement the WebGPUBindGroupLayoutDescriptor struct and its sub-structs:
3333         * Modules/streams/WebGPUBindGroupLayoutDescriptor.h: Added.
3334         * Modules/streams/WebGPUBindGroupLayoutDescriptor.idl: Added.
3335         * Modules/webgpu/WebGPUBindGroupLayoutBinding.h: Added.
3336         * Modules/webgpu/WebGPUBindGroupLayoutBinding.idl: Added.
3337         * Modules/webgpu/WebGPUShaderStageBit.h: Added.
3338         * Modules/webgpu/WebGPUShaderStageBit.idl: Added.
3339         * platform/graphics/gpu/GPUBindGroupLayoutBinding.h: Added.
3340         * platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h: Added.
3341
3342         Add the new symbols and files to the project:
3343         * CMakeLists.txt:
3344         * DerivedSources.make:
3345         * Sources.txt:
3346         * WebCore.xcodeproj/project.pbxproj:
3347         * bindings/js/WebCoreBuiltinNames.h:
3348
3349         Small FIXME update for later:
3350         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
3351         (WebCore::GPURenderPassEncoder::setVertexBuffers):
3352
3353 2018-12-17  Zalan Bujtas  <zalan@apple.com>
3354
3355         Unreviewed build fix.
3356
3357         * page/ios/FrameIOS.mm:
3358         (WebCore::Frame::interpretationsForCurrentRoot const):
3359
3360 2018-12-17  Zalan Bujtas  <zalan@apple.com>
3361
3362         Reproducible ASSERTion failure when toggling layer borders with find-in-page up
3363         https://bugs.webkit.org/show_bug.cgi?id=192762
3364         <rdar://problem/46676873>
3365
3366         Reviewed by Simon Fraser.
3367
3368         DocumentMarkerController::markersFor() should take a reference instead of a Node*.
3369
3370         Test: editing/document-marker-null-check.html
3371
3372         * dom/DocumentMarkerController.cpp:
3373         (DocumentMarkerController::hasMarkers):
3374         * dom/DocumentMarkerController.h:
3375         * editing/AlternativeTextController.cpp:
3376         (WebCore::AlternativeTextController::respondToChangedSelection):
3377         * editing/Editor.cpp:
3378         (WebCore::Editor::selectionStartHasMarkerFor const):
3379         * rendering/InlineTextBox.cpp:
3380         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
3381         * rendering/RenderReplaced.cpp:
3382         (WebCore::RenderReplaced::paint):
3383         * rendering/RenderText.cpp:
3384         (WebCore::RenderText::draggedContentRangesBetweenOffsets const):
3385         * rendering/SimpleLineLayout.cpp:
3386         (WebCore::SimpleLineLayout::canUseForWithReason):
3387         * testing/Internals.cpp:
3388         (WebCore::Internals::markerCountForNode):
3389
3390 2018-12-17  Commit Queue  <commit-queue@webkit.org>
3391
3392         Unreviewed, rolling out r239265 and r239274.
3393         https://bugs.webkit.org/show_bug.cgi?id=192765
3394
3395         unorm_normalize is deprecated, and broke an internal build
3396         (Requested by Truitt on #webkit).
3397
3398         Reverted changesets:
3399
3400         "[GTK][WPE] Need a function to convert internal URI to display
3401         ("pretty") URI"
3402         https://bugs.webkit.org/show_bug.cgi?id=174816
3403         https://trac.webkit.org/changeset/239265
3404
3405         "Fix the Apple Internal Mac build with a newer SDK"
3406         https://trac.webkit.org/changeset/239274
3407
3408 2018-12-17  Daniel Bates  <dabates@apple.com>
3409
3410         [iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
3411         https://bugs.webkit.org/show_bug.cgi?id=192633
3412
3413         Reviewed by Wenson Hsieh.
3414
3415         UIKit has long adopted the newer -[WebEvent initWithKeyEventType:] initializer that takes an
3416         input manager hint. We no longer need to keep the variant -[WebEvent initWithKeyEventType:...:characterSet:]
3417         for binary compatibility.
3418
3419         * platform/ios/WebEvent.h:
3420         * platform/ios/WebEvent.mm:
3421         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): Deleted.
3422
3423 2018-12-17  Matt Lewis  <jlewis3@apple.com>
3424
3425         Unreviewed, rolling out r239254.
3426
3427         This broke the Windows 10 Debug build
3428
3429         Reverted changeset:
3430
3431         "Replace many uses of String::format with more type-safe
3432         alternatives"
3433         https://bugs.webkit.org/show_bug.cgi?id=192742
3434         https://trac.webkit.org/changeset/239254
3435
3436 2018-12-17  Antoine Quint  <graouts@apple.com>
3437
3438         [Web Animations] Remove the redundant m_scheduledMicrotask from WebAnimation
3439         https://bugs.webkit.org/show_bug.cgi?id=192758
3440
3441         Reviewed by Dean Jackson.
3442
3443         We tracked whether we had a pending microtask twice so we remove the m_scheduledMicrotask flag as m_finishNotificationStepsMicrotaskPending
3444         gives us enough information as it is. Additionally, we remove the scheduleMicrotaskIfNeeded() and performMicrotask() functions since there is
3445         less bookkeeping to perform.
3446
3447         No new test since there is no user-observable change.
3448
3449         * animation/WebAnimation.cpp:
3450         (WebCore::WebAnimation::updateFinishedState):
3451         (WebCore::WebAnimation::scheduleMicrotaskIfNeeded): Deleted.
3452         (WebCore::WebAnimation::performMicrotask): Deleted.
3453         * animation/WebAnimation.h:
3454
3455 2018-12-17  Antoine Quint  <graouts@apple.com>
3456
3457         [Web Animations] Ensure we don't update an animation's finished state twice when updating animations
3458         https://bugs.webkit.org/show_bug.cgi?id=192757
3459
3460         Reviewed by Dean Jackson.
3461
3462         When animations are udpated and DocumentTimeline::updateAnimationsAndSendEvents() is called, we used to update an animation's finished state
3463         twice since we'd do it once when calling tick() and once again when calling resolve() in the ensuing style invalidation. We now keep track of
3464         whether we've already updated an animation's finished state during animation update in the call to tick() and avoid updating in the immediate
3465         next call to resolve(), unless any of the timing properties have changed in the meantime.
3466
3467         No new test since there is no user-observable change.
3468
3469         * animation/WebAnimation.cpp:
3470         (WebCore::WebAnimation::timingDidChange):
3471         (WebCore::WebAnimation::tick):
3472         (WebCore::WebAnimation::resolve):
3473         * animation/WebAnimation.h:
3474
3475 2018-12-17  Simon Fraser  <simon.fraser@apple.com>
3476
3477         REGRESSION (r233268): Elements animated in from offscreen sometimes don't display
3478         https://bugs.webkit.org/show_bug.cgi?id=192725
3479         rdar://problem/46011418
3480
3481         Reviewed by Antoine Quint.
3482
3483         There were two problems with backing store attachment and animation.
3484         
3485         First, animations are an input into the "backing store attached" logic, so when they change
3486         we should set the CoverageRectChanged bit on GraphicsLayerCA.
3487         
3488         Secondly, when an ancestor has unknown animation extent, all its descendants need to
3489         get backing store, so we need to set childCommitState.ancestorWithTransformAnimationIntersectsCoverageRect when
3490         the current layer has no animation extent.
3491
3492         Tests: compositing/backing/animate-into-view-with-descendant.html
3493                compositing/backing/animate-into-view.html
3494
3495         * platform/graphics/ca/GraphicsLayerCA.cpp:
3496         (WebCore::GraphicsLayerCA::addAnimation):
3497         (WebCore::GraphicsLayerCA::removeAnimation):
3498         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
3499
3500 2018-12-17  Zalan Bujtas  <zalan@apple.com>
3501
3502         [LFC][BFC][MarginCollapsing] Unify margin collapse function naming
3503         https://bugs.webkit.org/show_bug.cgi?id=192747
3504
3505         Reviewed by Antti Koivisto.
3506
3507         Rename some margin collapse getters.
3508
3509         * layout/blockformatting/BlockFormattingContext.h:
3510         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3511         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3512         * layout/blockformatting/BlockMarginCollapse.cpp:
3513         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
3514         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
3515         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
3516         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
3517         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
3518         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
3519         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
3520         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
3521         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
3522         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
3523         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
3524         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
3525         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
3526         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
3527         (WebCore::Layout::isMarginBeforeCollapsedWithSibling): Deleted.
3528         (WebCore::Layout::isMarginAfterCollapsedWithSibling): Deleted.
3529         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent): Deleted.
3530         (WebCore::Layout::isMarginAfterCollapsedThrough): Deleted.
3531         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent): Deleted.
3532         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter): Deleted.
3533
3534 2018-12-17  David Kilzer  <ddkilzer@apple.com>
3535
3536         clang-tidy: loop variable is copied but only used as const reference in WebCore, WebKit, Tools
3537         <https://webkit.org/b/192751>
3538         <rdar://problem/46771623>
3539
3540         Reviewed by Daniel Bates.
3541
3542         Change loop variables to const references to avoid unnecessary
3543         copies.
3544
3545         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
3546         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
3547         * Modules/indexeddb/server/MemoryObjectStore.cpp:
3548         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
3549         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3550         (WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange):
3551         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
3552         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers):
3553         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
3554         (WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
3555         (WebCore::IDBDatabaseInfo::loggingString const):
3556         * Modules/mediasource/SourceBuffer.cpp:
3557         (WebCore::removeSamplesFromTrackBuffer):
3558         * accessibility/AccessibilityRenderObject.cpp:
3559         (WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const):
3560         * accessibility/AccessibilityTableRow.cpp:
3561         (WebCore::AccessibilityTableRow::headerObject):
3562         * animation/KeyframeEffect.cpp:
3563         (WebCore::KeyframeEffect::computedNeedsForcedLayout):
3564         * crypto/keys/CryptoKeyRSA.cpp:
3565         (WebCore::CryptoKeyRSA::importJwk):
3566         (WebCore::CryptoKeyRSA::exportJwk const):
3567         * css/CSSComputedStyleDeclaration.cpp:
3568         (WebCore::OrderedNamedLinesCollector::appendLines const):
3569         * dom/DataTransfer.cpp:
3570         (WebCore::readURLsFromPasteboardAsString):
3571         * dom/TreeScope.cpp:
3572         (WebCore::TreeScope::elementsFromPoint):
3573         * html/track/WebVTTParser.cpp:
3574         (WebCore::WebVTTParser::checkAndStoreRegion):
3575         * inspector/agents/InspectorTimelineAgent.cpp:
3576         (WebCore::InspectorTimelineAgent::setInstruments):
3577         * page/Page.cpp:
3578         (WebCore::Page::updateIntersectionObservations):
3579         * page/TextIndicator.cpp:
3580         (WebCore::estimatedBackgroundColorForRange):
3581         * page/animation/KeyframeAnimation.cpp:
3582         (WebCore::KeyframeAnimation::computeLayoutDependency):
3583         * platform/graphics/DisplayRefreshMonitorManager.cpp:
3584         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
3585         * platform/graphics/ca/GraphicsLayerCA.cpp:
3586         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
3587         (WebCore::GraphicsLayerCA::updateAnimations):
3588         (WebCore::GraphicsLayerCA::isRunningTransformAnimation const):
3589         * platform/graphics/mac/ImageMac.mm:
3590         (WebCore::BitmapImage::tiffRepresentation):
3591         * rendering/HitTestResult.cpp:
3592         (WebCore::HitTestResult::append):
3593         * testing/Internals.cpp:
3594         (WebCore::Internals::acceleratedAnimationsForElement):
3595
3596 2018-12-17  Ms2ger  <Ms2ger@igalia.com>
3597
3598         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
3599         https://bugs.webkit.org/show_bug.cgi?id=174816
3600
3601         Reviewed by Michael Catanzaro.
3602
3603         Tests: enabled fast/url/user-visible/.
3604
3605         * testing/Internals.cpp:
3606         (WebCore::Internals::userVisibleString): Enable method on all platforms.
3607
3608 2018-12-15  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3609
3610         Null pointer dereference in JSC::WriteBarrierBase()
3611         https://bugs.webkit.org/show_bug.cgi?id=191252
3612
3613         Reviewed by Keith Miller.
3614
3615         * bindings/js/JSCustomElementRegistryCustom.cpp:
3616         (WebCore::JSCustomElementRegistry::whenDefined):
3617         * bindings/js/JSDOMPromiseDeferred.cpp:
3618         (WebCore::createDeferredPromise):
3619         * bindings/js/JSDOMPromiseDeferred.h:
3620         (WebCore::DeferredPromise::create):
3621         (WebCore::callPromiseFunction):
3622         * bindings/js/JSDOMWindowBase.cpp:
3623         (WebCore::JSDOMWindowBase::moduleLoaderFetch):
3624         (WebCore::JSDOMWindowBase::moduleLoaderImportModule):
3625         * bindings/js/ScriptModuleLoader.cpp:
3626         (WebCore::ScriptModuleLoader::fetch):
3627         (WebCore::rejectPromise):
3628
3629 2018-12-15  Darin Adler  <darin@apple.com>
3630
3631         Use warning-ignoring macros more consistently and simply
3632         https://bugs.webkit.org/show_bug.cgi?id=192743
3633
3634         Reviewed by Mark Lam.
3635
3636         * bridge/objc/WebScriptObject.mm: Use IGNORE_WARNINGS_BEGIN rather than
3637         IGNORE_CLANG_WARNINGS_BEGIN here. There is no need to compile Objective-C++
3638         files like this one with non-clang compilers, and no need to worry about
3639         them when choosing the macro.
3640
3641         * crypto/mac/CryptoKeyRSAMac.cpp:
3642         (WebCore::getPublicKeyComponents): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
3643
3644         * css/makeprop.pl: Use IGNORE_WARNINGS_BEGIN/END, obviating the need for
3645         the "unknown-pragmas" trick, which the macro should take care of.
3646         * css/makevalues.pl: Ditto.
3647         * platform/ColorData.gperf: Ditto.
3648
3649         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
3650         (WebCore::CDMSessionAVStreamSession::update): Use IGNORE_WARNINGS_BEGIN/END
3651         (see rationale above for Objective-C++).
3652
3653         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3654         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics): Use
3655         ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
3656         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3657         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics): Ditto.
3658
3659         * platform/ios/DragImageIOS.mm: Use IGNORE_WARNINGS_BEGIN/END
3660         (see rationale above for Objective-C++).
3661
3662         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3663         (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
3664         Use ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
3665
3666         * platform/mac/WebPlaybackControlsManager.mm: Use IGNORE_WARNINGS_BEGIN/END
3667         (see rationale above for Objective-C++).
3668
3669         * platform/network/cocoa/ResourceResponseCocoa.mm:
3670         (WebCore::ResourceResponse::platformCertificateInfo const): Use
3671         ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
3672
3673 2018-12-15  Darin Adler  <darin@apple.com>
3674
3675         Replace many uses of String::format with more type-safe alternatives
3676         https://bugs.webkit.org/show_bug.cgi?id=192742
3677
3678         Reviewed by Mark Lam.
3679
3680         A while back, String::format was more efficient than string concatenation,
3681         but that is no longer true, and we should prefer String::number, makeString,
3682         or concatenation with the "+" operator to String::format for new code.
3683
3684         This is not as good for programmers who are fond of printf formatting
3685         style, and in some cases it's a little harder to read the strings
3686         interspersed with variables rather than a format string, but it's better
3687         in a few ways:
3688
3689         - more efficient (I didn't measure the difference, but it's definitely
3690           slower to use String::Format which calls vsnprintf twice than to use
3691           the WTF code)
3692         - works in a type-safe way without a need to use a format specifier such
3693           as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
3694           subtle differences between platforms
3695         - allows us to use StringView in some cases to sidestep the need to
3696           allocate temporary WTF::String objects
3697         - does not require converting each WTF::String to a C string, allowing
3698           us to remove many cases of ".utf8().data()" and similar expressions,
3699           eliminating the allocation of temporary WTF::CString objects
3700
3701         This patch covers a batch of easiest-to-convert call sites.
3702         Later patches will allow us to deprecate or remove String::format.
3703
3704         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3705         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
3706         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
3707         (WebCore::IDBCursorInfo::loggingString const): Ditto.
3708         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
3709         (WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
3710         * Modules/indexeddb/shared/IDBGetRecordData.cpp:
3711         (WebCore::IDBGetRecordData::loggingString const): Ditto.
3712         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
3713         (WebCore::IDBIndexInfo::loggingString const): Ditto.
3714         (WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
3715         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
3716         (WebCore::IDBIterateCursorData::loggingString const): Ditto.
3717         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
3718         (WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
3719         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
3720         (WebCore::IDBResourceIdentifier::loggingString const): Ditto.
3721         * Modules/webdatabase/Database.cpp:
3722         (WebCore::formatErrorMessage): Ditto.
3723         * Modules/webdatabase/SQLError.h:
3724         (WebCore::SQLError::create): Ditto.
3725
3726         * bindings/scripts/CodeGeneratorJS.pm:
3727         (GenerateImplementation): Use makeString.
3728
3729         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3730         * bindings/scripts/test/JS/JSMapLike.cpp:
3731         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3732         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3733         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3734         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
3735         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3736         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3737         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3738         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
3739         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
3740         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3741         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3742         * bindings/scripts/test/JS/JSTestException.cpp:
3743         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3744         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3745         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
3746         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
3747         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
3748         * bindings/scripts/test/JS/JSTestInterface.cpp:
3749         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
3750         * bindings/scripts/test/JS/JSTestIterable.cpp:
3751         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3752         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
3753         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
3754         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
3755         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3756         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
3757         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
3758         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
3759         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
3760         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
3761         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
3762         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
3763         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
3764         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
3765         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
3766         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
3767         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
3768         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
3769         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
3770         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
3771         * bindings/scripts/test/JS/JSTestNode.cpp:
3772         * bindings/scripts/test/JS/JSTestObj.cpp:
3773         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3774         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3775         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3776         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
3777         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
3778         * bindings/scripts/test/JS/JSTestSerialization.cpp:
3779         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
3780         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
3781         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
3782         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3783         * bindings/scripts/test/JS/JSTestStringifier.cpp:
3784         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
3785         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
3786         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
3787         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
3788         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
3789         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
3790         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3791         Updated expected results.
3792 :
3793         * css/parser/CSSPropertyParserHelpers.cpp:
3794         (WebCore::CSSPropertyParserHelpers::parseHexColor): Use String::number
3795         and makeString.
3796
3797         * html/HTMLSelectElement.cpp:
3798         (WebCore::HTMLSelectElement::setLength): Use makeString.
3799         * html/ImageDocument.cpp:
3800         (WebCore::ImageDocument::imageUpdated): Ditto.
3801         * html/parser/XSSAuditor.cpp:
3802         (WebCore::XSSAuditor::init): Ditto.
3803         * inspector/InspectorFrontendClientLocal.cpp:
3804         (WebCore::InspectorFrontendClientLocal::setDockingUnavailable): Ditto.
3805         (WebCore::InspectorFrontendClientLocal::setAttachedWindow): Ditto.
3806         (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): Ditto.
3807         (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): Ditto.
3808         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Ditto.
3809         * inspector/agents/InspectorCSSAgent.cpp: Ditto.
3810         * inspector/agents/InspectorIndexedDBAgent.cpp: Ditto.
3811         * page/MemoryRelease.cpp:
3812         (WebCore::logMemoryStatisticsAtTimeOfDeath): Ditto.
3813
3814         * page/cocoa/ResourceUsageOverlayCocoa.mm:
3815         (WebCore::formatByteNumber): Use String::number.
3816         (WebCore::ResourceUsageOverlay::platformDraw): Use string concatenation.
3817
3818         * page/cocoa/ResourceUsageThreadCocoa.mm:
3819         (WebCore::logFootprintComparison): Use makeString.
3820         * platform/animation/TimingFunction.cpp:
3821         (WebCore::TimingFunction::cssText const): Ditto.
3822
3823         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
3824         (WebCore::AVTrackPrivateAVFObjCImpl::id const): Use AtomicString::number.
3825         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
3826         (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Ditto.
3827
3828         * platform/graphics/ca/GraphicsLayerCA.cpp:
3829         (WebCore::GraphicsLayerCA::setContentsToSolidColor): Use makeString.
3830         (WebCore::GraphicsLayerCA::updateContentsImage): Ditto.
3831         (WebCore::GraphicsLayerCA::updateContentsRects): Ditto.
3832         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): Ditto.
3833         * platform/mock/MockRealtimeVideoSource.cpp:
3834         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
3835
3836         * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Use String::number.
3837
3838         * platform/network/ParsedContentRange.cpp:
3839         (WebCore::ParsedContentRange::headerValue const): Use makeString.
3840
3841         * platform/network/cf/NetworkStorageSessionCFNet.cpp: Removed some unnecessary
3842         compiler conditionals and reorganized the start/stop of namespaces.
3843         (WebCore::NetworkStorageSession::switchToNewTestingSession): Use makeString.
3844
3845         * platform/sql/SQLiteDatabase.cpp:
3846         (WebCore::unauthorizedSQLFunction): Use makeString.
3847         * rendering/RenderLayerCompositor.cpp:
3848         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
3849         * workers/service/server/RegistrationDatabase.cpp:
3850         (WebCore::RegistrationDatabase::ensureValidRecordsTable): Ditto.
3851         (WebCore::RegistrationDatabase::importRecords): Ditto.
3852
3853 2018-12-15  Youenn Fablet  <youenn@apple.com>
3854
3855         Make RTCRtpSender.setParameters to activate specific encodings
3856         https://bugs.webkit.org/show_bug.cgi?id=192732
3857
3858         Reviewed by Eric Carlson.
3859
3860         The conversion between libwebrtc and WebCore is lossy for send parameters.
3861         Libwebrtc checking the differences of values, call to setParameters will often fail.
3862
3863         Given some parameters cannot be exposed, the sender backend keeps the
3864         current set of parameters when gathered and reuses them when parameters are set.
3865
3866         For encodings, we only change activate/maxBitRate/maxFrameRate as
3867         these are the most important parameters to be able to modify.
3868
3869         Covered by added tests in webrtc/video.html.
3870
3871         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
3872         (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
3873         (WebCore::LibWebRTCRtpSenderBackend::setParameters):
3874         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
3875         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
3876         (WebCore::fromRTCRtpSendParameters):
3877         (WebCore::fromRTCEncodingParameters): Deleted.
3878         * Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
3879
3880 2018-12-14  Joseph Pecoraro  <pecoraro@apple.com>
3881
3882         Web Inspector: Avoid creating and evaluating in the InspectorOverlay page on iOS as it is unused
3883         https://bugs.webkit.org/show_bug.cgi?id=192724
3884         <rdar://problem/46745911>
3885
3886         Reviewed by Devin Rousso.
3887
3888         iOS never installs the InspectorOverlay page as a page overlay.
3889         It also uses its own node highlighting painting. Avoid any work
3890         and resources associated with the overlay page for iOS.
3891
3892         * inspector/InspectorOverlay.cpp:
3893         (WebCore::InspectorOverlay::paint):
3894         (WebCore::InspectorOverlay::update):
3895         (WebCore::InspectorOverlay::overlayPage):
3896         (WebCore::evaluateCommandInOverlay):
3897
3898 2018-12-14  Youenn Fablet  <youenn@apple.com>
3899
3900         MediaRecorderPrivateAVFImpl should have a Ref<MediaRecorderPrivateWriter> as member
3901         https://bugs.webkit.org/show_bug.cgi?id=192720
3902
3903         Reviewed by Eric Carlson.
3904
3905         Make sure that MediaRecorderPrivateAVFImpl takes a Ref<MediaRecorderPrivateWriter> as member,
3906         as the latter is a ref counted object.
3907         Made some refactoring to return early in case of error.
3908
3909         Also made sure that in the case of a MediaRecorder stopped by a track removal in the recorded stream
3910         the MediaRecorder will stop listening for its tracks.
3911         Otherwise, the tracks will continue calling the MediaRecorder even after it is dead.
3912
3913         Test: http/wpt/mediarecorder/MediaRecorder-onremovetrack.html
3914
3915         * Modules/mediarecorder/MediaRecorder.cpp:
3916         (WebCore::MediaRecorder::didAddOrRemoveTrack):
3917         (WebCore::MediaRecorder::setNewRecordingState): Deleted.
3918         * Modules/mediarecorder/MediaRecorder.h:
3919         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
3920         (WebCore::MediaRecorderPrivateAVFImpl::create):
3921         (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl):
3922         (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
3923         (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
3924         (WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
3925         (WebCore::MediaRecorderPrivateAVFImpl::fetchData):
3926         * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
3927         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
3928         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
3929         (WebCore::MediaRecorderPrivateWriter::create):
3930         (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
3931         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
3932         (WebCore::MediaRecorderPrivateWriter::setupWriter): Deleted.
3933
3934 2018-12-14  Youenn Fablet  <youenn@apple.com>
3935
3936         getSenders/getReceivers() should not return closed transceiver senders/receivers
3937         https://bugs.webkit.org/show_bug.cgi?id=192706
3938
3939         Reviewed by Eric Carlson.
3940
3941         Updated as per https://github.com/w3c/webrtc-pc/commit/85284b76baebf9e149d194e692be16a21768a91a
3942         This forces us to compute the sender/receiver list at getter call time.
3943         Updated the internal call sites of senders to use the list of transceivers instead.
3944
3945         Covered by updated WPT tests.
3946
3947         * Modules/mediastream/RTCPeerConnection.cpp:
3948         (WebCore::RTCPeerConnection::addTrack):
3949         (WebCore::RTCPeerConnection::getSenders const):
3950         (WebCore::RTCPeerConnection::getReceivers const):
3951         * Modules/mediastream/RTCPeerConnection.h:
3952         * Modules/mediastream/RTCRtpTransceiver.cpp:
3953         (WebCore::RTCRtpTransceiver::stopped const):
3954         (WebCore::RtpTransceiverSet::append):
3955         (WebCore::RtpTransceiverSet::senders const):
3956         (WebCore::RtpTransceiverSet::receivers const):
3957         * Modules/mediastream/RTCRtpTransceiver.h:
3958         (WebCore::RtpTransceiverSet::senders const): Deleted.
3959         (WebCore::RtpTransceiverSet::receivers const): Deleted.
3960         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3961         (WebCore::findExistingSender):
3962         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
3963
3964 2018-12-14  David Kilzer  <ddkilzer@apple.com>
3965
3966         clang-tidy: Fix unnecessary copy of objects for operator==() methods
3967         <https://webkit.org/b/192712>
3968         <rdar://problem/46739332>
3969
3970         Reviewed by Andy Estes.
3971
3972         * contentextensions/HashableActionList.h:
3973         (WebCore::ContentExtensions::HashableActionList::operator== const):
3974         (WebCore::ContentExtensions::HashableActionList::operator!= const):
3975         * platform/network/FormData.h:
3976         (WebCore::FormDataElement::EncodedFileData::operator== const):
3977         (WebCore::FormDataElement::EncodedBlobData::operator== const):
3978         - Change arguments from const to const reference to avoid
3979           copies.
3980
3981 2018-12-14  Jer Noble  <jer.noble@apple.com>
3982
3983         CRASH in CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession(WTF::String const&, WTF::Function<void ()>&&)
3984         https://bugs.webkit.org/show_bug.cgi?id=192713
3985         <rdar://problem/46739706>
3986
3987         Reviewed by Eric Carlson.
3988
3989         A callback is being called twice, and the second time has a null Promise. Instead of these
3990         callbacks being WTF::Function, make them WTF::CompletionHandlers, which self-nullify and
3991         have ASSERTS() that they are called once-and-only-once.