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