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