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