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