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