Add support for HEVC codec types in Media Capabilities
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-09-17  Jer Noble  <jer.noble@apple.com>
2
3         Add support for HEVC codec types in Media Capabilities
4         https://bugs.webkit.org/show_bug.cgi?id=189565
5
6         Reviewed by Eric Carlson.
7
8         Test: media/hevc-codec-parameters.html
9
10         Add some utility methods for parsing HEVC codec strings, and using those parsed
11         values to query the platform for detailed support for HEVC decoding.
12
13         Drive-by fix: Modify MediaEngineConfigurationFactory to allow for null function
14         pointers in the encode/decode factory pair.
15
16         * Sources.txt:
17         * SourcesCocoa.txt:
18         * WebCore.xcodeproj/project.pbxproj:
19         * platform/cocoa/VideoToolboxSoftLink.cpp:
20         * platform/cocoa/VideoToolboxSoftLink.h:
21         * platform/graphics/HEVCUtilities.cpp: Added.
22         (WebCore::parseHEVCCodecParameters):
23         * platform/graphics/HEVCUtilities.h: Added.
24         * platform/graphics/cocoa/HEVCUtilitiesCocoa.cpp: Added.
25         (WebCore::validateHEVCParameters):
26         * platform/graphics/cocoa/HEVCUtilitiesCocoa.h: Added.
27         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp: Added.
28         (WebCore::videoCodecTypeFromRFC4281Type):
29         (WebCore::createMediaPlayerDecodingConfigurationCocoa):
30         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h: Added.
31         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
32         (WebCore::factories):
33         (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
34         (WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
35         * testing/Internals.cpp:
36         (WebCore::Internals::parseHEVCCodecParameters):
37         * testing/Internals.h:
38         * testing/Internals.idl:
39
40 2018-09-17  Devin Rousso  <drousso@apple.com>
41
42         Web Inspector: generate CSSKeywordCompletions from backend values
43         https://bugs.webkit.org/show_bug.cgi?id=189041
44
45         Reviewed by Joseph Pecoraro.
46
47         Modified existing test inspector/css/getSupportedCSSProperties.html.
48
49         * inspector/agents/InspectorCSSAgent.cpp:
50         (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
51         Send alias and longhand information for all properties, and any known keyword values for
52         those applicable. This makes use of `CSSParserFastPaths::isValidKeywordPropertyAndValue` to
53         determine if a given keyword is a valid value for each property. This only generates a list
54         for properties who have no non-keyword values.
55
56         * css/makeprop.pl:
57         * css/makevalues.pl:
58         Create additional helper functions/constants for retrieving strings of each CSS keyword.
59
60         * css/CSSProperty.h:
61         (WebCore::CSSProperty::aliasesForProperty):
62
63         * css/CSSPrimitiveValue.cpp:
64         (WebCore::valueName):
65
66         * css/CSSValuePool.cpp:
67         (WebCore::CSSValuePool::CSSValuePool):
68         (WebCore::CSSValuePool::createIdentifierValue):
69
70 2018-09-17  Youenn Fablet  <youenn@apple.com>
71
72         track.onmute isn't called for a remote MediaStreamTrack when its counter part track is removed from the peer connection
73         https://bugs.webkit.org/show_bug.cgi?id=176281
74         <rdar://problem/44525674>
75
76         Reviewed by Eric Carlson.
77
78         Listen to libwebrtc remove track callbacks.
79         Implement handling as per https://w3c.github.io/webrtc-pc/#process-remote-track-removal.
80         This triggers a mute event on the track.
81
82         Test: webrtc/remove-track.html
83
84         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
85         (WebCore::LibWebRTCMediaEndpoint::removeRemoteTrack):
86         (WebCore::LibWebRTCMediaEndpoint::OnRemoveTrack):
87         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
88         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
89         (WebCore::LibWebRTCPeerConnectionBackend::shouldOfferAllowToReceive const):
90         Drive by fix: Plan B code path does not mandate having an rtc backend for each sender.
91
92 2018-09-17  Simon Fraser  <simon.fraser@apple.com>
93
94         Add more Fullscreen logging
95         https://bugs.webkit.org/show_bug.cgi?id=189656
96
97         Reviewed by Jer Noble.
98
99         Add some fullscreen logging so I can tell whether WebFullScreenManager ever releases
100         the fullscreen element.
101
102         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
103         (VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement):
104         (VideoFullscreenModelVideoElement::~VideoFullscreenModelVideoElement):
105         (VideoFullscreenModelVideoElement::setVideoElement):
106
107 2018-09-14  Simon Fraser  <simon.fraser@apple.com>
108
109         Add support for dumping the GraphicsLayer tree via notifyutil
110         https://bugs.webkit.org/show_bug.cgi?id=189639
111
112         Reviewed by Zalan Bujtas.
113
114         Make "notifyutil -p com.apple.WebKit.showGraphicsLayerTree" work. It dumps the GraphicsLayer tree
115         for each top-level document (GraphicsLayers are connected across frame boundaries, so this prints
116         the entire tree for each main frame).
117         
118         It uses WTFLogAlways rather than fprintf() so output shows on all platforms (other tree dumps should
119         be converted in the same way).
120
121         * page/mac/PageMac.mm:
122         (WebCore::Page::platformInitialize):
123         * platform/graphics/GraphicsLayer.cpp:
124         (showGraphicsLayerTree):
125         * rendering/RenderLayerCompositor.cpp:
126         (showGraphicsLayerTreeForCompositor):
127         * rendering/RenderLayerCompositor.h:
128         * rendering/RenderObject.cpp:
129         (WebCore::printGraphicsLayerTreeForLiveDocuments):
130         * rendering/RenderObject.h:
131
132 2018-09-17  Christopher Reid  <chris.reid@sony.com>
133
134         [Curl] Add schema version and enable auto vacuum for cookie database.
135         https://bugs.webkit.org/show_bug.cgi?id=189669
136
137         Reviewed by Alex Christensen.
138
139         Turning on auto incremental vacuuming and adding versioning to the database. Right now we
140         reset tables if there's an unknown schema or if the none is set. There is placeholder logic
141         in place to upgrade databases as the schema changes in the future.
142
143         Tested by checking the database manually after launching MiniBrowser.
144
145         * platform/network/curl/CookieJarDB.cpp:
146         (WebCore::CookieJarDB::openDatabase):
147         (WebCore::CookieJarDB::verifySchemaVersion):
148         (WebCore::CookieJarDB::deleteAllTables):
149         (WebCore::CookieJarDB::createPrepareStatement):
150         (WebCore::CookieJarDB::getPrepareStatement):
151         (WebCore::CookieJarDB::executeSimpleSql):
152         * platform/network/curl/CookieJarDB.h:
153         * platform/network/curl/NetworkStorageSessionCurl.cpp:
154         (WebCore::defaultSession):
155         * platform/sql/SQLiteDatabase.cpp:
156         (WebCore::SQLiteDatabase::turnOnIncrementalAutoVacuum): fixed a bug.
157
158 2018-09-14  Ryosuke Niwa  <rniwa@webkit.org>
159
160         Re-order Node flags based on semantics
161         https://bugs.webkit.org/show_bug.cgi?id=189643
162
163         Reviewed by Simon Fraser.
164
165         Re-ordered Node flags based on their category and subclasses of Node which use them.
166
167         * dom/Node.h:
168
169 2018-09-17  Simon Fraser  <simon.fraser@apple.com>
170
171         Add more ResourceLoading logging, particularly in MemoryCache code
172         https://bugs.webkit.org/show_bug.cgi?id=189651
173
174         Reviewed by Tim Horton.
175
176         Adding more logging to the ResourceLoading log channel, which I found useful
177         when trying to understand cached SVGImage lifetimes (bug 189437).
178
179         * loader/cache/CachedResource.cpp:
180         (WebCore::CachedResource::deleteIfPossible):
181         * loader/cache/CachedResourceLoader.cpp:
182         (WebCore::CachedResourceLoader::requestResource):
183         (WebCore::CachedResourceLoader::garbageCollectDocumentResources):
184         * loader/cache/MemoryCache.cpp:
185         (WebCore::MemoryCache::add):
186         (WebCore::MemoryCache::pruneLiveResourcesToSize):
187         (WebCore::MemoryCache::pruneDeadResources):
188         (WebCore::MemoryCache::pruneDeadResourcesToSize):
189         (WebCore::MemoryCache::remove):
190         (WebCore::MemoryCache::dumpLRULists const):
191
192 2018-09-17  Jer Noble  <jer.noble@apple.com>
193
194         Enable USE_MEDIAREMOTE on iOS
195         https://bugs.webkit.org/show_bug.cgi?id=189096
196
197         Reviewed by Eric Carlson.
198
199         Migrate to using MediaRemote.framework on iOS from MediaPlayer.framework. This unifies the
200         Now Playing implementation on iOS and Mac.
201
202         * SourcesCocoa.txt:
203         * WebCore.xcodeproj/project.pbxproj:
204         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: Removed.
205         * platform/audio/cocoa/MediaSessionManagerCocoa.h:
206         * platform/audio/cocoa/MediaSessionManagerCocoa.mm: Renamed from Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm.
207         (PlatformMediaSessionManager::sharedManager):
208         (PlatformMediaSessionManager::sharedManagerIfExists):
209         (MediaSessionManagerCocoa::updateSessionState):
210         (MediaSessionManagerCocoa::beginInterruption):
211         (MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo):
212         (MediaSessionManagerCocoa::sessionWillBeginPlayback):
213         (MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing):
214         (MediaSessionManagerCocoa::removeSession):
215         (MediaSessionManagerCocoa::sessionWillEndPlayback):
216         (MediaSessionManagerCocoa::clientCharacteristicsChanged):
217         (MediaSessionManagerCocoa::sessionCanProduceAudioChanged):
218         (MediaSessionManagerCocoa::nowPlayingEligibleSession):
219         (MediaSessionManagerCocoa::updateNowPlayingInfo):
220         * platform/audio/ios/MediaSessionManagerIOS.h:
221         (): Deleted.
222         * platform/audio/ios/MediaSessionManagerIOS.mm:
223         (WebCore::MediaSessionManageriOS::nowPlayingEligibleSession): Deleted.
224         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Deleted.
225         (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Deleted.
226         (WebCore::MediaSessionManageriOS::removeSession): Deleted.
227         (WebCore::MediaSessionManageriOS::sessionWillEndPlayback): Deleted.
228         (WebCore::MediaSessionManageriOS::clientCharacteristicsChanged): Deleted.
229         * platform/audio/mac/MediaSessionManagerMac.h: Removed.
230
231 2018-09-17  Frederic Wang  <fwang@igalia.com>
232
233         Build error in ImageBufferCG when compiled with IOSurfacePool
234         https://bugs.webkit.org/show_bug.cgi?id=189579
235
236         Reviewed by Tim Horton.
237
238         IOSurface.h might be included with different value of IOSURFACE_CANVAS_BACKING_STORE, causing
239         compilation errors when files in the same unified source do not agree on the definition.
240         This patch moves the definition of IOSURFACE_CANVAS_BACKING_STORE from ImageBufferDataCG.h
241         to Platform.h so that IOSURFACE_CANVAS_BACKING_STORE is set to the same value in all files.
242         Finally some minors changes to explicitly declare/define ImageBuffer are performed in order
243         to prevent future issues with Unified build rotating.
244
245         No new tests, behavior unchanged.
246
247         * html/HTMLCanvasElement.cpp: Explicitly include ImageBuffer.h since it's used in this file.
248         * platform/graphics/cg/ImageBufferDataCG.h: Move definition into Platform.h.
249         * platform/graphics/cocoa/IOSurface.h: Forward-declare ImageBuffer since it's used in this
250         header.
251
252 2018-09-17  Basuke Suzuki  <Basuke.Suzuki@sony.com>
253
254         [Curl] Respond with requested authentication scheme for authentication challenge.
255         https://bugs.webkit.org/show_bug.cgi?id=189318
256
257         Reviewed by Alex Christensen.
258
259         Curl port depends on libcurl's authentication handling by enabling CURLAUTH_ANY. With this
260         mode, the round-trip communication between the client and the server is handled by libcurl
261         internally. That's okay for many cases. But when initial request has a credentials
262         (i.e. XMLHttpRequest), there's no valid chance to store credential to the storage because
263         the returned response is not 401.
264
265         Passes following tests:
266         - http/tests/websocket/tests/hybi/httponly-cookie.pl
267         - http/tests/websocket/tests/hybi/secure-cookie-insecure-connection.pl
268         - http/tests/websocket/tests/hybi/secure-cookie-secure-connection.pl
269         - http/tests/xmlhttprequest/basic-auth-default.html
270         - http/tests/xmlhttprequest/cross-origin-authorization.html
271         - http/tests/xmlhttprequest/logout.html
272         - http/tests/xmlhttprequest/null-auth.php
273         - http/tests/xmlhttprequest/re-login-async.html
274         - http/tests/xmlhttprequest/re-login.html
275         - http/tests/xmlhttprequest/redirect-credentials-responseURL.html
276         - http/tests/xmlhttprequest/remember-bad-password.html
277
278         * platform/network/ResourceHandle.h:
279         * platform/network/curl/CurlContext.cpp:
280         (WebCore::CurlHandle::setHttpAuthUserPass):
281         (WebCore::CurlHandle::enableHttpAuthentication): Deleted.
282         * platform/network/curl/CurlContext.h:
283         * platform/network/curl/CurlRequest.cpp:
284         (WebCore::CurlRequest::setAuthenticationScheme):
285         (WebCore::CurlRequest::setupTransfer):
286         * platform/network/curl/CurlRequest.h:
287         * platform/network/curl/ResourceHandleCurl.cpp:
288         (WebCore::ResourceHandle::start):
289         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
290         (WebCore::ResourceHandle::receivedCredential):
291         (WebCore::ResourceHandle::getCredential):
292         (WebCore::ResourceHandle::restartRequestWithCredential):
293         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
294         (WebCore::ResourceHandle::continueAfterWillSendRequest):
295
296 2018-09-17  Youenn Fablet  <youenn@apple.com>
297
298         Enable VCP for iOS and reenable it for MacOS
299         https://bugs.webkit.org/show_bug.cgi?id=189635
300         <rdar://problem/43621029>
301
302         Reviewed by Eric Carlson.
303
304         Covered by exsiting and modified tests.
305         Instead of using libwebrtc YUV frames for black frames, use CVPixelBuffer to make it efficient.
306         Add internal API to know whether VCP is enabled so as to make capture-webrtc test pass on all platforms.
307
308         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
309         (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
310         * platform/mediastream/RealtimeOutgoingVideoSource.h:
311         * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h:
312         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h:
313         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
314         (WebCore::createBlackPixelBuffer):
315         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
316         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
317         (WebCore::RealtimeOutgoingVideoSourceCocoa::createBlackFrame):
318         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
319         * testing/Internals.cpp:
320         (WebCore::Internals::supportsVCPEncoder):
321         * testing/Internals.h:
322         * testing/Internals.idl:
323
324 2018-09-17  Chris Dumez  <cdumez@apple.com>
325
326         PSON: window.open() with 'noopener' should only process-swap cross-site, not cross-origin
327         https://bugs.webkit.org/show_bug.cgi?id=189602
328         <rdar://problem/44430549>
329
330         Reviewed by Geoff Garen.
331
332         * loader/DocumentLoader.cpp:
333         (WebCore::DocumentLoader::setTriggeringAction):
334         * loader/DocumentLoader.h:
335         * loader/FrameLoadRequest.h:
336         * loader/FrameLoader.cpp:
337         (WebCore::FrameLoader::loadURL):
338         (WebCore::FrameLoader::loadWithNavigationAction):
339         (WebCore::FrameLoader::loadWithDocumentLoader):
340         (WebCore::FrameLoader::loadPostRequest):
341         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
342         (WebCore::FrameLoader::loadDifferentDocumentItem):
343         Move NavigationAction's opener setting to loadWithNavigationAction() as this is a better bottleneck.
344         Otherwise, we'd have to set it at several call sites. Also move the NavigationAction around instead
345         of copying it.
346
347         * loader/FrameLoader.h:
348         (WebCore::FrameLoader::loadWithNavigationAction):
349         * loader/NavigationAction.h:
350         (WebCore::NavigationAction::setShouldOpenExternalURLsPolicy):
351         * loader/PolicyChecker.cpp:
352         (WebCore::PolicyChecker::checkNavigationPolicy):
353         * page/DOMWindow.cpp:
354         (WebCore::DOMWindow::createWindow):
355
356 2018-09-17  Darin Adler  <darin@apple.com>
357
358         Use OpaqueJSString rather than JSRetainPtr inside WebKit
359         https://bugs.webkit.org/show_bug.cgi?id=189652
360
361         Reviewed by Saam Barati.
362
363         * Modules/plugins/QuickTimePluginReplacement.mm:
364         (WebCore::jsValueWithDictionaryInContext): Use OpaqueJSString::create.
365         (WebCore::jsValueWithAVMetadataItemInContext): Use adoptCF.
366
367         * platform/mac/SerializedPlatformRepresentationMac.mm:
368         (WebCore::jsValueWithDictionaryInContext): Use OpaqueJSString::create.
369
370 2018-09-08  Darin Adler  <darin@apple.com>
371
372         Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
373         https://bugs.webkit.org/show_bug.cgi?id=189455
374
375         Reviewed by Keith Miller.
376
377         * Modules/plugins/QuickTimePluginReplacement.mm:
378         (WebCore::jsValueWithDictionaryInContext): Adding a missing
379         JSStringRelease to fix a leak.
380
381 2018-09-15  Rob Buis  <rbuis@igalia.com>
382
383         XMLHttpRequest::createResponseBlob() should create a Blob with type for empty response
384         https://bugs.webkit.org/show_bug.cgi?id=189627
385
386         Reviewed by Alexey Proskuryakov.
387
388         Right now we return an empty Blob without type when the response is empty, but
389         it should always include the type [1].
390
391         Test: web-platform-tests/xhr/overridemimetype-blob.html
392
393         [1] https://xhr.spec.whatwg.org/#blob-response
394
395         * xml/XMLHttpRequest.cpp:
396         (WebCore::XMLHttpRequest::createResponseBlob):
397
398 2018-09-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>
399
400         [Curl] Bug fix on some inaccurate values in NetworkLoadMetrics.
401         https://bugs.webkit.org/show_bug.cgi?id=189530
402
403         Reviewed by Alex Christensen.
404
405         Curl port uses the start time libcurl provided. But there's a lug between main thread and Curl thread.
406         Record the start time of request instead of libcurl's start timing and use it to measure the metrics.
407         Also respondEnd was not correctly recorded and fixed.
408
409         No new tests because it cannot be measured from DRT.
410
411         * platform/network/ResourceHandleInternal.h:
412         * platform/network/curl/CurlContext.cpp:
413         (WebCore::CurlHandle::getNetworkLoadMetrics):
414         * platform/network/curl/CurlContext.h:
415         * platform/network/curl/CurlRequest.cpp:
416         (WebCore::CurlRequest::start):
417         (WebCore::CurlRequest::setupTransfer):
418         (WebCore::CurlRequest::didCompleteTransfer):
419         (WebCore::CurlRequest::updateNetworkLoadMetrics):
420         * platform/network/curl/CurlRequest.h:
421         (WebCore::CurlRequest::setStartTime):
422         * platform/network/curl/ResourceHandleCurl.cpp:
423         (WebCore::ResourceHandle::start):
424         (WebCore::ResourceHandle::restartRequestWithCredential):
425         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
426         (WebCore::ResourceHandle::willSendRequest):
427         (WebCore::ResourceHandle::continueAfterWillSendRequest):
428
429 2018-09-14  Justin Fan  <justin_fan@apple.com>
430
431         WebGL 2 conformance: rgb-format-support.html
432         https://bugs.webkit.org/show_bug.cgi?id=189610
433         <rdar://problem/44403343>
434
435         Reviewed by Dean Jackson.
436
437         Implementing getInternalformatParameter (emulating on macOS) and updating 
438         renderbufferStorage{Multisample} for WebGL 2 conformance. 
439
440         Test: webgl/2.0.0/conformance2/rendering/rgb-format-support.html enabled.
441
442         * html/canvas/WebGL2RenderingContext.cpp:
443         (WebCore::isRenderableInternalformat):
444         (WebCore::WebGL2RenderingContext::getInternalformatParameter):
445         (WebCore::WebGL2RenderingContext::renderbufferStorageMultisample):
446         (WebCore::WebGL2RenderingContext::renderbufferStorage):
447         (WebCore::WebGL2RenderingContext::baseInternalFormatFromInternalFormat):
448         (WebCore::WebGL2RenderingContext::isIntegerFormat):
449         * platform/graphics/GraphicsContext3D.h:
450         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
451         (WebCore::GraphicsContext3D::getInternalformativ):
452         (WebCore::GraphicsContext3D::renderbufferStorageMultisample):
453
454 2018-09-14  Justin Michaud  <justin_michaud@apple.com>
455
456         Add support for spreadMethod=reflect and repeat on SVG gradients (for CoreGraphics platforms)
457         https://bugs.webkit.org/show_bug.cgi?id=5968
458
459         Add support for spreadMethod=repeat and reflect. Also, the opacity of a gradient is now
460         the result of multiplying stop-opacity with the opacity of the color.
461
462         Reviewed by Simon Fraser.
463
464         Tests: svg/gradients/spreadMethod-expected.svg
465                svg/gradients/spreadMethod.svg
466                svg/gradients/spreadMethodAlpha-expected.svg
467                svg/gradients/spreadMethodAlpha.svg
468                svg/gradients/spreadMethodClose0-expected-mismatch.svg
469                svg/gradients/spreadMethodClose0.svg
470                svg/gradients/spreadMethodClose1-expected-mismatch.svg
471                svg/gradients/spreadMethodClose1.svg
472                svg/gradients/spreadMethodClose2-expected.svg
473                svg/gradients/spreadMethodClose2.svg
474                svg/gradients/spreadMethodDiagonal-expected.svg
475                svg/gradients/spreadMethodDiagonal.svg
476                svg/gradients/spreadMethodDiagonal2-expected.svg
477                svg/gradients/spreadMethodDiagonal2.svg
478                svg/gradients/spreadMethodDuplicateStop-expected.svg
479                svg/gradients/spreadMethodDuplicateStop.svg
480                svg/gradients/spreadMethodReversed-expected.svg
481                svg/gradients/spreadMethodReversed.svg
482                svg/gradients/stopAlpha-expected.svg
483                svg/gradients/stopAlpha.svg
484
485         * platform/graphics/cg/GradientCG.cpp:
486         (WebCore::Gradient::paint):
487         * svg/SVGStopElement.cpp:
488         (WebCore::SVGStopElement::stopColorIncludingOpacity const):
489
490 2018-09-14  Ryan Haddad  <ryanhaddad@apple.com>
491
492         Unreviewed, attempt to fix the iOSMac build after r236015.
493
494         * platform/graphics/cv/PixelBufferResizer.mm:
495         (WebCore::PixelBufferResizer::PixelBufferResizer):
496
497 2018-09-11  Simon Fraser  <simon.fraser@apple.com>
498
499         Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
500         https://bugs.webkit.org/show_bug.cgi?id=189521
501
502         Reviewed by Tim Horton.
503         
504         Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
505         
506         RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
507         
508         All the other changes are just to adapt to the new ownership patterns.
509         
510         I verified that no GraphicsLayers were leaked or abandoned after this change.
511
512         No behavior change.
513
514         * page/PageOverlayController.cpp:
515         (WebCore::PageOverlayController::layerWithDocumentOverlays):
516         (WebCore::PageOverlayController::layerWithViewOverlays):
517         (WebCore::PageOverlayController::installPageOverlay):
518         (WebCore::PageOverlayController::uninstallPageOverlay):
519         (WebCore::PageOverlayController::setPageOverlayNeedsDisplay):
520         (WebCore::PageOverlayController::didChangeViewSize):
521         (WebCore::PageOverlayController::didChangeDocumentSize):
522         (WebCore::PageOverlayController::didChangeSettings):
523         (WebCore::PageOverlayController::paintContents):
524         (WebCore::PageOverlayController::didChangeOverlayFrame):
525         (WebCore::PageOverlayController::didChangeOverlayBackgroundColor):
526         * page/PageOverlayController.h:
527         * page/mac/ServicesOverlayController.h:
528         (WebCore::ServicesOverlayController::Highlight::layer const):
529         * page/mac/ServicesOverlayController.mm:
530         (WebCore::ServicesOverlayController::Highlight::Highlight):
531         (WebCore::ServicesOverlayController::Highlight::invalidate):
532         (WebCore::ServicesOverlayController::Highlight::fadeIn):
533         (WebCore::ServicesOverlayController::Highlight::fadeOut):
534         (WebCore::ServicesOverlayController::Highlight::didFinishFadeOutAnimation):
535         (WebCore::ServicesOverlayController::determineActiveHighlight):
536         * platform/graphics/GraphicsLayer.cpp:
537         (WebCore::GraphicsLayer::GraphicsLayer):
538         (WebCore::GraphicsLayer::willBeDestroyed):
539         (WebCore::GraphicsLayer::setChildren):
540         (WebCore::GraphicsLayer::addChild):
541         (WebCore::GraphicsLayer::addChildAtIndex):
542         (WebCore::GraphicsLayer::addChildBelow):
543         (WebCore::GraphicsLayer::addChildAbove):
544         (WebCore::GraphicsLayer::replaceChild):
545         (WebCore::GraphicsLayer::removeAllChildren):
546         (WebCore::GraphicsLayer::removeFromParent):
547         (WebCore::GraphicsLayer::setMaskLayer):
548         (WebCore::GraphicsLayer::noteDeviceOrPageScaleFactorChangedIncludingDescendants):
549         (WebCore::GraphicsLayer::distributeOpacity):
550         (WebCore::GraphicsLayer::traverse):
551         (WebCore::dumpChildren):
552         * platform/graphics/GraphicsLayer.h:
553         (WebCore::GraphicsLayer::children const):
554         (WebCore::GraphicsLayer::children):
555         (WebCore::GraphicsLayer::maskLayer const):
556         (WebCore::GraphicsLayer::replicaLayer const):
557         (WebCore::GraphicsLayer::beingDestroyed const):
558         (WebCore::GraphicsLayer:: const): Deleted.
559         * platform/graphics/GraphicsLayerFactory.h:
560         * platform/graphics/ca/GraphicsLayerCA.cpp:
561         (WebCore::GraphicsLayer::create):
562         (WebCore::GraphicsLayerCA::setChildren):
563         (WebCore::GraphicsLayerCA::addChild):
564         (WebCore::GraphicsLayerCA::addChildAtIndex):
565         (WebCore::GraphicsLayerCA::addChildBelow):
566         (WebCore::GraphicsLayerCA::addChildAbove):
567         (WebCore::GraphicsLayerCA::replaceChild):
568         (WebCore::GraphicsLayerCA::setMaskLayer):
569         (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
570         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
571         (WebCore::GraphicsLayerCA::updateSublayerList):
572         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
573         * platform/graphics/ca/GraphicsLayerCA.h:
574         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
575         (WebCore::GraphicsLayer::create):
576         (WebCore::GraphicsLayerTextureMapper::setChildren):
577         (WebCore::GraphicsLayerTextureMapper::addChild):
578         (WebCore::GraphicsLayerTextureMapper::addChildAtIndex):
579         (WebCore::GraphicsLayerTextureMapper::addChildAbove):
580         (WebCore::GraphicsLayerTextureMapper::addChildBelow):
581         (WebCore::GraphicsLayerTextureMapper::replaceChild):
582         (WebCore::GraphicsLayerTextureMapper::setMaskLayer):
583         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers):
584         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
585         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
586         (WebCore::GraphicsLayer::create):
587         (WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect):
588         (WebCore::CoordinatedGraphicsLayer::addChild):
589         (WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
590         (WebCore::CoordinatedGraphicsLayer::addChildAbove):
591         (WebCore::CoordinatedGraphicsLayer::addChildBelow):
592         (WebCore::CoordinatedGraphicsLayer::replaceChild):
593         (WebCore::CoordinatedGraphicsLayer::setMaskLayer):
594         (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
595         (WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers):
596         (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
597         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
598         * platform/graphics/win/GraphicsLayerDirect2D.cpp:
599         (WebCore::GraphicsLayer::create):
600         (WebCore::GraphicsLayerDirect2D::GraphicsLayerDirect2D): Deleted.
601         (WebCore::GraphicsLayerDirect2D::initialize): Deleted.
602         (WebCore::GraphicsLayerDirect2D::~GraphicsLayerDirect2D): Deleted.
603         (WebCore::GraphicsLayerDirect2D::setNeedsDisplay): Deleted.
604         (WebCore::GraphicsLayerDirect2D::setNeedsDisplayInRect): Deleted.
605         * rendering/RenderLayerBacking.cpp:
606         (WebCore::RenderLayerBacking::createGraphicsLayer):
607         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
608         (WebCore::RenderLayerBacking::updateConfiguration):
609         (WebCore::RenderLayerBacking::updateInternalHierarchy):
610         (WebCore::RenderLayerBacking::updateMaskingLayer):
611         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
612         (WebCore::RenderLayerBacking::updateScrollingLayers):
613         * rendering/RenderLayerBacking.h:
614         * rendering/RenderLayerCompositor.cpp:
615         (WebCore::RenderLayerCompositor::updateCompositingLayers):
616         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
617         (WebCore::RenderLayerCompositor::setCompositingParent):
618         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
619         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
620         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
621         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
622         (WebCore::RenderLayerCompositor::updateLayerForHeader):
623         (WebCore::RenderLayerCompositor::updateLayerForFooter):
624         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
625         (WebCore::RenderLayerCompositor::ensureRootLayer):
626         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
627         * rendering/RenderLayerCompositor.h:
628
629 2018-09-14  Eric Carlson  <eric.carlson@apple.com>
630
631         Support arbitrary video resolution in getUserMedia API
632         https://bugs.webkit.org/show_bug.cgi?id=178109
633         <rdar://problem/35083128>
634
635         Reviewed by Youenn Fablet.
636
637         Support arbitrary video resolutions by configuring the camera to capture at the closest
638         larger size it supports and scaling/cropping frames as necessary.
639
640         No new tests, existing tests updated.
641
642         * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
643         * Modules/webaudio/MediaStreamAudioSource.cpp:
644         (WebCore::MediaStreamAudioSource::capabilities): Make non-const, it wasn't helpful.
645         (WebCore::MediaStreamAudioSource::settings): Ditto.
646         (WebCore::MediaStreamAudioSource::capabilities const): Deleted.
647         (WebCore::MediaStreamAudioSource::settings const): Deleted.
648         * Modules/webaudio/MediaStreamAudioSource.h:
649
650         * SourcesCocoa.txt: Add PixelBufferResizer.
651
652         * WebCore.xcodeproj/project.pbxproj: Ditto.
653
654         * platform/cocoa/CoreVideoSoftLink.h:
655         * platform/cocoa/VideoToolboxSoftLink.cpp:
656         * platform/cocoa/VideoToolboxSoftLink.h:
657
658         * platform/graphics/cv/PixelBufferResizer.h: Added.
659         (WebCore::PixelBufferResizer::canResizeTo):
660         * platform/graphics/cv/PixelBufferResizer.mm: Added.
661         (WebCore::PixelBufferResizer::PixelBufferResizer):
662         (WebCore::PixelBufferResizer::resize):
663
664         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
665         (WebCore::RealtimeIncomingAudioSource::capabilities): Make non-const, it wasn't helpful.
666         (WebCore::RealtimeIncomingAudioSource::settings): Ditto.
667         (WebCore::RealtimeIncomingAudioSource::capabilities const): Deleted.
668         (WebCore::RealtimeIncomingAudioSource::settings const): Deleted.
669         * platform/mediastream/RealtimeIncomingAudioSource.h:
670
671         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
672         (WebCore::RealtimeIncomingVideoSource::capabilities): Make non-const, it wasn't helpful.
673         (WebCore::RealtimeIncomingVideoSource::settings): Ditto.
674         (WebCore::RealtimeIncomingVideoSource::capabilities const): Deleted.
675         (WebCore::RealtimeIncomingVideoSource::settings const): Deleted.
676         * platform/mediastream/RealtimeIncomingVideoSource.h:
677
678         * platform/mediastream/RealtimeMediaSource.cpp:
679         (WebCore::RealtimeMediaSource::supportsConstraint):
680         (WebCore::RealtimeMediaSource::supportsConstraint const): Deleted.
681         * platform/mediastream/RealtimeMediaSource.h:
682
683         * platform/mediastream/RealtimeVideoSource.cpp:
684         (WebCore::RealtimeVideoSource::presets):
685         (WebCore::RealtimeVideoSource::setSupportedPresets):
686         (WebCore::standardVideoSizes):
687         (WebCore::RealtimeVideoSource::updateCapabilities): Make non-const, it wasn't helpful.
688         (WebCore::presetSupportsFrameRate):
689         (WebCore::RealtimeVideoSource::supportsCaptureSize):
690         (WebCore::RealtimeVideoSource::shouldUsePreset):
691         (WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate):
692         (WebCore::RealtimeVideoSource::setSizeAndFrameRate):
693         (WebCore::RealtimeVideoSource::addSupportedCapabilities const): Deleted.
694         * platform/mediastream/RealtimeVideoSource.h:
695         (WebCore::VideoPresetData::encode const):
696         (WebCore::VideoPresetData::decode):
697         (WebCore::VideoPreset::create):
698         (WebCore::VideoPreset::VideoPreset):
699         (WebCore::RealtimeVideoSource::prefersPreset):
700         (WebCore::RealtimeVideoSource::canResizeVideoFrames const):
701         (WebCore::RealtimeVideoSource::setDefaultSize):
702         (WebCore::RealtimeVideoSource::observedFrameRate const):
703         (WebCore::VideoPreset::encode const): Deleted.
704         (WebCore::VideoPreset::decode): Deleted.
705
706         * platform/mediastream/mac/AVVideoCaptureSource.h:
707         (WebCore::AVVideoCaptureSource::videoPresets): Deleted.
708         * platform/mediastream/mac/AVVideoCaptureSource.mm:
709         (WebCore::AVVideoPreset::create):
710         (WebCore::AVVideoPreset::AVVideoPreset):
711         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
712         (WebCore::AVVideoCaptureSource::settings):
713         (WebCore::AVVideoCaptureSource::capabilities): Make non-const, it wasn't helpful.
714         (WebCore::AVVideoCaptureSource::setFrameRate):
715         (WebCore::AVVideoCaptureSource::prefersPreset):
716         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
717         (WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
718         (WebCore::AVVideoCaptureSource::setupCaptureSession):
719         (WebCore::AVVideoCaptureSource::processNewFrame):
720         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
721         (WebCore::AVVideoCaptureSource::isFrameRateSupported):
722         (WebCore::AVVideoCaptureSource::generatePresets):
723         (WebCore::updateSizeMinMax): Deleted.
724         (WebCore::updateAspectRatioMinMax): Deleted.
725         (WebCore::AVVideoCaptureSource::settings const): Deleted.
726         (WebCore::AVVideoCaptureSource::capabilities const): Deleted.
727         (WebCore::AVVideoCaptureSource::sizeForPreset): Deleted.
728         (WebCore::AVVideoCaptureSource::setPreset): Deleted.
729         (WebCore::AVVideoCaptureSource::setSizeAndFrameRate): Deleted.
730         (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions): Deleted.
731         (WebCore::AVVideoCaptureSource::supportsSizeAndFrameRate): Deleted.
732
733         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
734         (WebCore::CoreAudioCaptureSource::capabilities): Make non-const, it wasn't helpful.
735         (WebCore::CoreAudioCaptureSource::settings): Ditto.
736         (WebCore::CoreAudioCaptureSource::capabilities const): Deleted.
737         (WebCore::CoreAudioCaptureSource::settings const): Deleted.
738         * platform/mediastream/mac/CoreAudioCaptureSource.h:
739
740         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
741         (WebCore::DisplayCaptureSourceCocoa::capabilities): Make non-const, it wasn't helpful.
742         (WebCore::DisplayCaptureSourceCocoa::settings): Ditto.
743         (WebCore::DisplayCaptureSourceCocoa::capabilities const): Deleted.
744         (WebCore::DisplayCaptureSourceCocoa::settings const): Deleted.
745         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
746
747         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
748         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
749         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
750         (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
751         (WebCore::MockRealtimeVideoSourceMac::setSizeAndFrameRateWithPreset):
752         * platform/mock/MockMediaDevice.h:
753         (WebCore::MockCameraProperties::decode):
754
755         * platform/mock/MockRealtimeAudioSource.cpp:
756         (WebCore::MockRealtimeAudioSource::settings): Make non-const, it wasn't helpful.
757         (WebCore::MockRealtimeAudioSource::capabilities): Ditto.
758         (WebCore::MockRealtimeAudioSource::settings const): Deleted.
759         (WebCore::MockRealtimeAudioSource::capabilities const): Deleted.
760         * platform/mock/MockRealtimeAudioSource.h:
761
762         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
763         (WebCore::defaultDevices): Change video device presets to trigger resize code more often.
764
765         * platform/mock/MockRealtimeVideoSource.cpp:
766         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
767         (WebCore::MockRealtimeVideoSource::generatePresets):
768         (WebCore::MockRealtimeVideoSource::capabilities): Make non-const, it wasn't helpful.
769         (WebCore::MockRealtimeVideoSource::settings): Ditto.
770         (WebCore::MockRealtimeVideoSource::capabilities const): Deleted.
771         (WebCore::MockRealtimeVideoSource::settings const): Deleted.
772         * platform/mock/MockRealtimeVideoSource.h:
773
774 2018-09-14  Frederic Wang  <fwang@igalia.com>
775
776         Bug 189541 - Build error in FontDescriptionKey::computeHash when compiling FontTaggedSettings and FontCascadeFonts together
777         https://bugs.webkit.org/show_bug.cgi?id=189541
778
779         Reviewed by Alex Christensen.
780
781         FontDescriptionKey::computeHash() from In FontCache.h requires implicit instantiation of the
782         FontTaggedSettings::hash() template function. This instantiation may happen before
783         FontTaggedSettings::hash() is actually fully specialized in FontTaggedSettings.cpp. To avoid
784         compiler errors when FontCache.h and FontTaggedSettings.cpp are in the same translation unit,
785         we declare full specialization of the hash() functions in FontTaggedSettings.h.
786
787         No new tests, behavior unchanged.
788
789         * platform/graphics/FontCache.h: Explicitly include FontTaggedSettings to avoid possible future breakage.
790         * platform/graphics/FontTaggedSettings.h: Declare full specialization of FontTaggedSettings::hash().
791
792 2018-09-14  Ryan Haddad  <ryanhaddad@apple.com>
793
794         Unreviewed, rolling out r235990.
795
796         Introduced TestWebKitAPI.NowPlayingTest timeouts on iOS
797
798         Reverted changeset:
799
800         "Enable USE_MEDIAREMOTE on iOS"
801         https://bugs.webkit.org/show_bug.cgi?id=189096
802         https://trac.webkit.org/changeset/235990
803
804 2018-09-14  Jer Noble  <jer.noble@apple.com>
805
806         Turn SourceBufferChangeTypeEnabled on by default
807         https://bugs.webkit.org/show_bug.cgi?id=189527
808
809         Reviewed by Eric Carlson.
810
811         * page/Settings.yaml:
812
813 2018-09-14  Devin Rousso  <webkit@devinrousso.com>
814
815         Web Inspector: Record actions performed on ImageBitmapRenderingContext
816         https://bugs.webkit.org/show_bug.cgi?id=181341
817
818         Reviewed by Joseph Pecoraro.
819
820         Test: inspector/canvas/recording-bitmaprenderer.html
821
822         * html/canvas/ImageBitmapRenderingContext.idl:
823
824         * inspector/InspectorCanvas.cpp:
825         (WebCore::shouldSnapshotBitmapRendererAction):
826         (WebCore::InspectorCanvas::recordAction):
827
828         * inspector/agents/InspectorCanvasAgent.cpp:
829         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
830
831         * page/PageConsoleClient.cpp:
832         (canvasRenderingContext):
833
834 2018-09-14  David Kilzer  <ddkilzer@apple.com>
835
836         REGRESSION (r235954): Fix build failure on watchOS
837         <https://webkit.org/b/189605>
838
839         Reviewed by Geoffrey Garen.
840
841         Remove `using WebCore::IndexedDB::KeyType;` from
842         Source/WebCore/Modules/indexeddb/IDBKey.h and fix all the
843         resulting build failures.
844
845         * Modules/indexeddb/IDBKey.cpp:
846         (WebCore::IDBKey::IDBKey):
847         (WebCore::IDBKey::isValid const):
848         (WebCore::IDBKey::compare const):
849         * Modules/indexeddb/IDBKey.h:
850         (WebCore::IDBKey::createNumber):
851         (WebCore::IDBKey::createDate):
852         (WebCore::IDBKey::type const):
853         (WebCore::IDBKey::array const):
854         (WebCore::IDBKey::string const):
855         (WebCore::IDBKey::date const):
856         (WebCore::IDBKey::number const):
857         (WebCore::IDBKey::binary const):
858         (WebCore::IDBKey::compareTypes):
859         (WebCore::IDBKey::IDBKey):
860         * Modules/indexeddb/IDBKeyData.cpp:
861         (WebCore::IDBKeyData::IDBKeyData):
862         (WebCore::IDBKeyData::maybeCreateIDBKey const):
863         (WebCore::IDBKeyData::isolatedCopy):
864         (WebCore::IDBKeyData::encode const):
865         (WebCore::IDBKeyData::decode):
866         (WebCore::IDBKeyData::compare const):
867         (WebCore::IDBKeyData::loggingString const):
868         (WebCore::IDBKeyData::setArrayValue):
869         (WebCore::IDBKeyData::setBinaryValue):
870         (WebCore::IDBKeyData::setStringValue):
871         (WebCore::IDBKeyData::setDateValue):
872         (WebCore::IDBKeyData::setNumberValue):
873         (WebCore::IDBKeyData::isValid const):
874         (WebCore::IDBKeyData::operator== const):
875         * Modules/indexeddb/IDBKeyData.h:
876         (WebCore::IDBKeyData::IDBKeyData):
877         (WebCore::IDBKeyData::minimum):
878         (WebCore::IDBKeyData::maximum):
879         (WebCore::IDBKeyData::type const):
880         (WebCore::IDBKeyData::hash const):
881         (WebCore::IDBKeyData::string const):
882         (WebCore::IDBKeyData::date const):
883         (WebCore::IDBKeyData::number const):
884         (WebCore::IDBKeyData::binary const):
885         (WebCore::IDBKeyData::array const):
886         (WebCore::IDBKeyData::encode const):
887         (WebCore::IDBKeyData::decode):
888         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
889         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
890         * bindings/js/IDBBindingUtilities.cpp:
891         (WebCore::toJS):
892
893 2018-09-14  Xabier Rodriguez Calvar  <calvaris@igalia.com>
894
895         [EME] Add support the waitingforkey event
896         https://bugs.webkit.org/show_bug.cgi?id=189616
897
898         Reviewed by Philippe Normand.
899
900         Crossplatform support to fire the waitingforkey event from the
901         player to the element. The element implements the W3C specified
902         algorithm.
903
904         * html/HTMLMediaElement.cpp:
905         (WebCore::HTMLMediaElement::mediaPlayerWaitingForKey):
906         (WebCore::HTMLMediaElement::attemptToResumePlaybackIfNecessary):
907         * html/HTMLMediaElement.h:
908         * platform/graphics/MediaPlayer.cpp:
909         (WebCore::MediaPlayer::waitingForKey):
910         * platform/graphics/MediaPlayer.h:
911         (WebCore::MediaPlayerClient::mediaPlayerWaitingForKey):
912
913 2018-09-14  Mike Gorse  <mgorse@suse.com>
914
915         builtins directory causes name conflict on Python 3
916         https://bugs.webkit.org/show_bug.cgi?id=189552
917
918         Reviewed by Michael Catanzaro.
919
920         No new tests (No behavior change).
921
922         * CMakeLists.txt: builtins -> wkbuiltins.
923         * DerivedSources.make: builtins -> wkbuiltins.
924
925 2018-09-13  Ryosuke Niwa  <rniwa@webkit.org>
926
927         Capturing event listeners are called during bubbling phase for shadow hosts
928         https://bugs.webkit.org/show_bug.cgi?id=174288
929         <rdar://problem/33530455>
930
931         Reviewed by Darin Adler.
932
933         Implemented the new behavior proposed in https://github.com/whatwg/dom/pull/686 [1] to fix the problem
934         that capturing event listeners on a shadow host is invoked during bubbling phase when an event is
935         dispatched within its shadow tree.
936
937         To see why this is a problem, suppose we fire a composed event at span#target in the following DOM tree:
938           section#hostParent
939             + div#host -- ShadowRoot
940                             - p#parent
941                                 - span#target
942         Then capturing and bubbling event listeners on #target, #parent, #host, and #hostParent are invoked in
943         the following order in WebKit & Chrome right now:
944
945         1. #hostParent, capturing, eventPhase: CAPTURING_PHASE
946         2. #parent, capturing, eventPhase: CAPTURING_PHASE
947         3. #target, capturing, eventPhase: AT_TARGET
948         4. #target, non-capturing, eventPhase: AT_TARGET
949         5. #parent, non-capturing, eventPhase: BUBBLING_PHASE
950         6. #host, capturing, eventPhase: AT_TARGET
951         7. #host, non-capturing, eventPhase: AT_TARGET
952         8. #hostParent, non-capturing, eventPhase: BUBBLING_PHASE
953
954         This is counter-intuitive because capturing event listeners on #host isn't invoked until bubblign phase
955         started. A more natural ordering would be:
956
957         1. #hostParent, capturing, eventPhase: CAPTURING_PHASE
958         2. #host, capturing, eventPhase: AT_TARGET
959         3. #parent, capturing, eventPhase: CAPTURING_PHASE
960         4. #target, capturing, eventPhase: AT_TARGET
961         5. #target, non-capturing, eventPhase: AT_TARGET
962         6. #parent, non-capturing, eventPhase: BUBBLING_PHASE
963         7. #host, non-capturing, eventPhase: AT_TARGET
964         8. #hostParent, non-capturing, eventPhase: BUBBLING_PHASE
965
966         This also happens to be the order by which Gecko's current shadow DOM implementation invoke event listners.
967         This patch implements this new behavior using the spec-change proposed in [1]. Note that this patch also
968         impacts the invocation order of event listeners when there is no shadow tree. Namely, before this patch,
969         event listeners on the event's target is invoked in the registration order. After this patch, all capturing
970         event listeners are invoked before bubbling event listeners are invoked.
971
972         To implement this behavior, this patch introduces EventTarget::EventInvokePhase indicating whether we're
973         in the capturing phase or bubbling phase to EventTarget::fireEventListeners. We can't use Event's eventPhase
974         enum because that's set to Event::Phase::AT_TARGET when we're at a shadow host.
975
976         Test: fast/shadow-dom/capturing-and-bubbling-event-listeners-across-shadow-trees.html
977
978         * Modules/modern-media-controls/media/media-controller-support.js:
979         (MediaControllerSupport.prototype.enable): Use capturing event listeners so that we can update the states of
980         media controls before author scripts recieve the event.
981         (MediaControllerSupport.prototype.disable): Ditto.
982         * dom/EventContext.cpp:
983         (WebCore::EventContext::handleLocalEvents const):
984         (WebCore::MouseOrFocusEventContext::handleLocalEvents const):
985         (WebCore::TouchEventContext::handleLocalEvents const):
986         * dom/EventContext.h:
987         * dom/EventDispatcher.cpp:
988         (WebCore::dispatchEventInDOM): Invoke capturing event listners even when target and current target are same.
989         This happens when the current target is a shadow host and event's target is in its shadow tree. Also merged
990         the special code path for the event's target with the code in the bubbling phase.
991         * dom/EventPath.cpp:
992         (WebCore::WindowEventContext::handleLocalEvents const):
993         * dom/EventTarget.cpp:
994         (WebCore::EventTarget::dispatchEvent): Invoke capturing and bubbling event listeners in the order.
995         (WebCore::EventTarget::fireEventListeners):
996         (WebCore::EventTarget::innerInvokeEventListeners): Renamed from fireEventListeners to match the spec. Use
997         EventInvokePhase to filter out event listeners so that we can invoke capturing event listners before bubbling
998         event listeners even when eventPhase is Event::Phase::AT_TARGET.
999         * dom/EventTarget.h:
1000         * dom/Node.cpp:
1001         (WebCore::Node::handleLocalEvents):
1002         * dom/Node.h:
1003         * html/HTMLFormElement.cpp:
1004         (WebCore::HTMLFormElement::handleLocalEvents):
1005         * html/HTMLFormElement.h:
1006         * page/DOMWindow.cpp:
1007         (WebCore::DOMWindow::dispatchEvent):
1008
1009 2018-09-13  Megan Gardner  <megan_gardner@apple.com>
1010
1011         Fix color stop blending in conic gradients for stops past 1
1012         https://bugs.webkit.org/show_bug.cgi?id=189532
1013         <rdar://problem/44158221>
1014
1015         Reviewed by Simon Fraser.
1016
1017         Calculation was wrong, fixed it, and wrote a test that failed
1018         without the change, and passes with it.
1019
1020         Test: fast/gradients/conic-repeating-last-stop.html
1021
1022         * css/CSSGradientValue.cpp:
1023         (WebCore::ConicGradientAdapter::normalizeStopsAndEndpointsOutsideRange):
1024
1025 2018-09-13  Chris Dumez  <cdumez@apple.com>
1026
1027         Regression(PSON): setting window.opener to null allows process swapping in cases that are not web-compatible
1028         https://bugs.webkit.org/show_bug.cgi?id=189590
1029         <rdar://problem/44422725>
1030
1031         Reviewed by Geoffrey Garen.
1032
1033         Set a flag on the navigation action to indicate if the page was opened via window.open() without 'noopener'.
1034
1035         Test: http/tests/navigation/window-open-cross-origin-then-navigated-back-same-origin.html
1036
1037         * loader/FrameLoader.cpp:
1038         (WebCore::FrameLoader::loadURL):
1039         * loader/NavigationAction.h:
1040         (WebCore::NavigationAction::openedViaWindowOpenWithOpener const):
1041         (WebCore::NavigationAction::setOpenedViaWindowOpenWithOpener):
1042         * page/DOMWindow.cpp:
1043         (WebCore::DOMWindow::createWindow):
1044         * page/Page.h:
1045         (WebCore::Page::openedViaWindowOpenWithOpener const):
1046         (WebCore::Page::setOpenedViaWindowOpenWithOpener):
1047
1048 2018-09-13  Jer Noble  <jer.noble@apple.com>
1049
1050         Enable USE_MEDIAREMOTE on iOS
1051         https://bugs.webkit.org/show_bug.cgi?id=189096
1052
1053         Reviewed by Eric Carlson.
1054
1055         Migrate to using MediaRemote.framework on iOS from MediaPlayer.framework. This unifies the
1056         Now Playing implementation on iOS and Mac.
1057
1058         * SourcesCocoa.txt:
1059         * WebCore.xcodeproj/project.pbxproj:
1060         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: Removed.
1061         * platform/audio/cocoa/MediaSessionManagerCocoa.h:
1062         * platform/audio/cocoa/MediaSessionManagerCocoa.mm: Renamed from Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm.
1063         (PlatformMediaSessionManager::sharedManager):
1064         (PlatformMediaSessionManager::sharedManagerIfExists):
1065         (MediaSessionManagerCocoa::updateSessionState):
1066         (MediaSessionManagerCocoa::beginInterruption):
1067         (MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo):
1068         (MediaSessionManagerCocoa::sessionWillBeginPlayback):
1069         (MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing):
1070         (MediaSessionManagerCocoa::removeSession):
1071         (MediaSessionManagerCocoa::sessionWillEndPlayback):
1072         (MediaSessionManagerCocoa::clientCharacteristicsChanged):
1073         (MediaSessionManagerCocoa::sessionCanProduceAudioChanged):
1074         (MediaSessionManagerCocoa::nowPlayingEligibleSession):
1075         (MediaSessionManagerCocoa::updateNowPlayingInfo):
1076         * platform/audio/ios/MediaSessionManagerIOS.h:
1077         (): Deleted.
1078         * platform/audio/ios/MediaSessionManagerIOS.mm:
1079         (WebCore::MediaSessionManageriOS::nowPlayingEligibleSession): Deleted.
1080         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Deleted.
1081         (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Deleted.
1082         (WebCore::MediaSessionManageriOS::removeSession): Deleted.
1083         (WebCore::MediaSessionManageriOS::sessionWillEndPlayback): Deleted.
1084         (WebCore::MediaSessionManageriOS::clientCharacteristicsChanged): Deleted.
1085         * platform/audio/mac/MediaSessionManagerMac.h: Removed.
1086
1087 2018-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
1088
1089         Remove the workaround for friend class LazyNeverDestroyed<X> statements for MSVC
1090         https://bugs.webkit.org/show_bug.cgi?id=189576
1091
1092         Reviewed by Alex Christensen.
1093
1094         Old MSVC can't compile "friend class LazyNeverDestroyed<X>"
1095         statements, but "friend LazyNeverDestroyed<X>".
1096
1097         No new tests (No behavior change).
1098
1099         * css/CSSInheritedValue.h: Removed the code for COMPILER(MSVC).
1100         Removed 'class' keyword in "friend class LazyNeverDestroyed<X>"
1101         statement.
1102         * css/CSSInitialValue.h: Ditto.
1103         * css/CSSPrimitiveValue.h: Ditto.
1104         * css/CSSRevertValue.h: Ditto.
1105         * css/CSSUnsetValue.h: Ditto.
1106
1107 2018-09-13  Ms2ger  <Ms2ger@igalia.com>
1108
1109         [GLib] Fix format string in KeyedEncoderGlib::beginObject().
1110         https://bugs.webkit.org/show_bug.cgi?id=189585
1111
1112         Reviewed by Michael Catanzaro.
1113
1114         This appears to fix the following assertion locally:
1115
1116         GLib-CRITICAL **: g_variant_builder_add_value: assertion '!GVSB(builder)->expected_type || g_variant_is_of_type (value, GVSB(builder)->expected_type)' failed
1117
1118         Covered by existing tests.
1119
1120         * platform/glib/KeyedEncoderGlib.cpp:
1121         (WebCore::KeyedEncoderGlib::beginObject):
1122
1123 2018-09-13  Ryan Haddad  <ryanhaddad@apple.com>
1124
1125         Unreviewed, rolling out r235953.
1126
1127         Caused layout test crashes under GuardMalloc.
1128
1129         Reverted changeset:
1130
1131         "Make GraphicsLayers ref-counted, so their tree can persist
1132         when disconnected from RenderLayerBackings"
1133         https://bugs.webkit.org/show_bug.cgi?id=189521
1134         https://trac.webkit.org/changeset/235953
1135
1136 2018-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
1137
1138         Remove a MSVC workaround in XPath::Step::NodeTest
1139         https://bugs.webkit.org/show_bug.cgi?id=189578
1140
1141         Reviewed by Alex Christensen.
1142
1143         XPath::Step::NodeTest has a special code for MSVC bug workaround.
1144         It has been introduced in 5 years ago in Bug 121082 Comment 19.
1145
1146         I think it is safe just to remove the workaround.
1147
1148         No new tests (No behavior change).
1149
1150         * xml/XPathStep.h: Removed the MSVC workaround.
1151
1152 2018-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
1153
1154         Remove a MSVC workaround in InspectorStyle::styleWithProperties
1155         https://bugs.webkit.org/show_bug.cgi?id=189577
1156
1157         Reviewed by Alex Christensen.
1158
1159         No new tests (No behavior change).
1160
1161         * inspector/InspectorStyleSheet.cpp:
1162         (WebCore::InspectorStyle::styleWithProperties const): Use 'auto' for the type of 'status'.
1163
1164 2018-09-13  Alex Christensen  <achristensen@webkit.org>
1165
1166         Use a Variant instead of a union in CSSSelector
1167         https://bugs.webkit.org/show_bug.cgi?id=188559
1168
1169         Reviewed by Antti Koivisto.
1170
1171         No change in behavior. This just makes some of the existing problems more obvious and easy to fix.
1172
1173         I moved m_caseInsensitiveAttributeValueMatching to RareData because it's only used with RareData.
1174         I only have m_isForPage when assertions are enabled because it's only used for an assertion.
1175         The rest is pretty straightforward translating union syntax to Variant syntax.
1176         I use RefPtr for now where I could use Ref because it's never null to make copying easier, but that's temporary.
1177
1178         * css/CSSSelector.cpp:
1179         (WebCore::CSSSelector::CSSSelector):
1180         (WebCore::CSSSelector::createRareData):
1181         (WebCore::CSSSelector::setAttribute):
1182         (WebCore::CSSSelector::setArgument):
1183         (WebCore::CSSSelector::setLangArgumentList):
1184         (WebCore::CSSSelector::setSelectorList):
1185         (WebCore::CSSSelector::setNth):
1186         (WebCore::CSSSelector::matchNth const):
1187         (WebCore::CSSSelector::nthA const):
1188         (WebCore::CSSSelector::nthB const):
1189         (WebCore::CSSSelector::RareData::RareData):
1190         * css/CSSSelector.h:
1191         (WebCore::CSSSelector::argument const):
1192         (WebCore::CSSSelector::langArgumentList const):
1193         (WebCore::CSSSelector::selectorList const):
1194         (WebCore::CSSSelector::attribute const):
1195         (WebCore::CSSSelector::attributeCanonicalLocalName const):
1196         (WebCore::CSSSelector::setValue):
1197         (WebCore::CSSSelector::CSSSelector):
1198         (WebCore::CSSSelector::~CSSSelector):
1199         (WebCore::CSSSelector::tagQName const):
1200         (WebCore::CSSSelector::tagLowercaseLocalName const):
1201         (WebCore::CSSSelector::value const):
1202         (WebCore::CSSSelector::serializingValue const):
1203         (WebCore::CSSSelector::attributeValueMatchingIsCaseInsensitive const):
1204         (WebCore::CSSSelector::RareData::create): Deleted.
1205         * css/parser/CSSParserImpl.cpp:
1206         (WebCore::CSSParserImpl::parsePageSelector):
1207         * css/parser/CSSParserSelector.h:
1208
1209 2018-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
1210
1211         [Win][Clang] error: type 'float' cannot be narrowed to 'LONG' (aka 'long') in initializer list in WheelEventWin.cpp
1212         https://bugs.webkit.org/show_bug.cgi?id=189575
1213
1214         Reviewed by Alex Christensen.
1215
1216         No new tests (No behavior change).
1217
1218         * platform/win/WheelEventWin.cpp:
1219         (WebCore::PlatformWheelEvent::PlatformWheelEvent): Use flooredIntPoint to convert FloatPoint to POINT.
1220
1221 2018-09-13  Youenn Fablet  <youenn@apple.com>
1222
1223         Introduce RTCRtpSendParameters
1224         https://bugs.webkit.org/show_bug.cgi?id=189563
1225
1226         Reviewed by Eric Carlson.
1227
1228         Introduce RTCRtpSendParameters to match the WebRTC specification.
1229         Split RTCRtpPrameters fields accordingly and update call sites.
1230
1231         Covered by updated test.
1232
1233         * CMakeLists.txt:
1234         * DerivedSources.make:
1235         * Modules/mediastream/PeerConnectionBackend.h:
1236         * Modules/mediastream/RTCRtpCodingParameters.h: Added
1237         * Modules/mediastream/RTCRtpCodingParameters.idl: Added
1238         * Modules/mediastream/RTCRtpDecodingParameters.h: Added
1239         * Modules/mediastream/RTCRtpDecodingParameters.idl: Added
1240         * Modules/mediastream/RTCRtpEncodingParameters.h:
1241         * Modules/mediastream/RTCRtpEncodingParameters.idl:
1242         * Modules/mediastream/RTCRtpParameters.h:
1243         * Modules/mediastream/RTCRtpParameters.idl:
1244         * Modules/mediastream/RTCRtpReceiver.cpp:
1245         * Modules/mediastream/RTCRtpSendParameters.h: Added.
1246         (WebCore::RTCRtpSendParameters::RTCRtpSendParameters):
1247         * Modules/mediastream/RTCRtpSendParameters.idl: Added.
1248         * Modules/mediastream/RTCRtpSender.cpp:
1249         (WebCore::RTCRtpSender::getParameters):
1250         (WebCore::RTCRtpSender::setParameters):
1251         * Modules/mediastream/RTCRtpSender.h:
1252         * Modules/mediastream/RTCRtpSender.idl:
1253         * Modules/mediastream/RTCRtpSenderBackend.h:
1254         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
1255         (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
1256         (WebCore::LibWebRTCRtpSenderBackend::setParameters):
1257         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
1258         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1259         (WebCore::toRTCRtpParameters):
1260         (WebCore::toRTCRtpSendParameters):
1261         (WebCore::fromRTCRtpSendParameters):
1262         * Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
1263         * Sources.txt:
1264         * WebCore.xcodeproj/project.pbxproj:
1265
1266 2018-09-13  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1267
1268         [GStreamer][EME] decrypt-key-needed message renamed to drm-cdm-instance-needed
1269         https://bugs.webkit.org/show_bug.cgi?id=189547
1270
1271         Reviewed by Philippe Normand.
1272
1273         decrypt-key-needed message renamed to drm-cdm-instance-needed.
1274
1275         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1276         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Apart from
1277         renaming the message, removed the class prefix for
1278         dispatchCDMInstance.
1279         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1280         (webkitMediaCommonEncryptionDecryptTransformInPlace):
1281
1282 2018-09-11  Ryosuke Niwa  <rniwa@webkit.org>
1283
1284         imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html hits assertion
1285         https://bugs.webkit.org/show_bug.cgi?id=189493
1286
1287         Reviewed by Alex Christensen.
1288
1289         The debug assertion was caused by RefPtr in FormAssociatedElement::formOwnerRemovedFromTree introduced
1290         by r224390 and r223644 ref'ing ShadowRoot while calling removeDetachedChildren inside ~ShadowRoot.
1291         When a form (or any other) element has more than one ref inside removeDetachedChildren,
1292         addChildNodesToDeletionQueue calls notifyChildNodeRemoved in the tree oreder.
1293
1294         However, when a form associated element of this form element appears later in the tree order,
1295         FormAssociatedElement::formOwnerRemovedFromTree can traverse up ancestors including the ShadowRoot.
1296
1297         Fixed the bug by using raw pointers instead. Luckily, there is no DOM mutations or other non-trivial
1298         operations happening in this function so this should be safe.
1299
1300         Test: imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html
1301
1302         * html/FormAssociatedElement.cpp:
1303         (WebCore::FormAssociatedElement::formOwnerRemovedFromTree): Fixed the bug.
1304
1305 2018-09-12  Dan Bernstein  <mitz@apple.com>
1306
1307         [Cocoa] Complete support for Paste as Quotation
1308         https://bugs.webkit.org/show_bug.cgi?id=189504
1309
1310         Reviewed by Wenson Hsieh.
1311
1312         Tests: editing/pasteboard/4930986-1-paste-as-quotation.html
1313                editing/pasteboard/4930986-2-paste-as-quotation.html
1314                editing/pasteboard/4930986-3-paste-as-quotation.html
1315
1316         * editing/Editor.cpp:
1317           Added ClipboardEventKind::PasteAsQuotation.
1318         (WebCore::eventNameForClipboardEvent): Map PasteAsQuotation to the "paste" DOM event name.
1319         (WebCore::createDataTransferForClipboardEvent): Place the unquoted content in the event.
1320           This means that currently event handlers can’t emulate pasting as quotation, because they
1321           neither have the quoted content nor knowledge that quoting has been requested. We could
1322           change this in the future if needed.
1323         (WebCore::Editor::paste): Updated for change in pasteWithPasteboard’s argument type.
1324         (WebCore::Editor::pasteAsQuotation): Added. Similar to paste, but passes
1325           PasteOption::AsQuotation to pasteWithPasteboard.
1326         (WebCore::Editor::quoteFragmentForPasting): Added. Quoting for pasting consists of enclosing
1327           the fragment in a blockquote element with the "type" attribute set to "cite" and the
1328           "class" attribute set to a well-known value, which is used to trigger special behavior in
1329           ReplaceSelectionCommand. The behavior includes removing the "class" attribute in the end,
1330           so eventually, we could stop using this form of in-band signaling.
1331         * editing/Editor.h: Declared PasteOption enum class to encompass the existing allowPlainText
1332           and MailBlockquoteHandling arguments to pasteWithPasteboard as well as the new AsQuotation
1333           behavior.
1334
1335         * editing/EditorCommand.cpp:
1336         (WebCore::executePasteAsQuotation): Added. Similar to executing Paste.
1337         (WebCore::createCommandMap): Added an entry for PasteAsQuotation, based on the Paste entry.
1338
1339         * editing/cocoa/EditorCocoa.mm:
1340         (WebCore::Editor::webContentFromPasteboard): Moved from EditorIOS.mm and EditorMac.mm to
1341           here.
1342
1343         * editing/gtk/EditorGtk.cpp:
1344         (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
1345           quote the fragment if needed.
1346
1347         * editing/ios/EditorIOS.mm:
1348         (WebCore::Editor::pasteWithPasteboard): Ditto.
1349         (WebCore::Editor::webContentFromPasteboard): Moved to EditorCocoa.mm.
1350
1351         * editing/mac/EditorMac.mm:
1352         (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
1353           quote the fragment if needed.
1354         (WebCore::Editor::readSelectionFromPasteboard): Updated for new OptionSet argument to
1355           pasteWithPasteboard.
1356         (WebCore::Editor::webContentFromPasteboard): Moved to EditorCocoa.mm.
1357
1358         * editing/win/EditorWin.cpp:
1359         (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
1360           quote the fragment if needed.
1361
1362         * editing/wpe/EditorWPE.cpp:
1363         (WebCore::Editor::pasteWithPasteboard): Ditto.
1364
1365 2018-09-11  Simon Fraser  <simon.fraser@apple.com>
1366
1367         Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
1368         https://bugs.webkit.org/show_bug.cgi?id=189521
1369
1370         Reviewed by Tim Horton.
1371         
1372         Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
1373         
1374         RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
1375         
1376         All the other changes are just to adapt to the new ownership patterns.
1377         
1378         I verified that no GraphicsLayers were leaked or abandoned after this change.
1379
1380         No behavior change.
1381
1382         * page/PageOverlayController.cpp:
1383         (WebCore::PageOverlayController::layerWithDocumentOverlays):
1384         (WebCore::PageOverlayController::layerWithViewOverlays):
1385         (WebCore::PageOverlayController::installPageOverlay):
1386         (WebCore::PageOverlayController::uninstallPageOverlay):
1387         (WebCore::PageOverlayController::setPageOverlayNeedsDisplay):
1388         (WebCore::PageOverlayController::didChangeViewSize):
1389         (WebCore::PageOverlayController::didChangeDocumentSize):
1390         (WebCore::PageOverlayController::didChangeSettings):
1391         (WebCore::PageOverlayController::paintContents):
1392         (WebCore::PageOverlayController::didChangeOverlayFrame):
1393         (WebCore::PageOverlayController::didChangeOverlayBackgroundColor):
1394         * page/PageOverlayController.h:
1395         * page/mac/ServicesOverlayController.h:
1396         (WebCore::ServicesOverlayController::Highlight::layer const):
1397         * page/mac/ServicesOverlayController.mm:
1398         (WebCore::ServicesOverlayController::Highlight::Highlight):
1399         (WebCore::ServicesOverlayController::Highlight::invalidate):
1400         (WebCore::ServicesOverlayController::Highlight::fadeIn):
1401         (WebCore::ServicesOverlayController::Highlight::fadeOut):
1402         (WebCore::ServicesOverlayController::Highlight::didFinishFadeOutAnimation):
1403         (WebCore::ServicesOverlayController::determineActiveHighlight):
1404         * platform/graphics/GraphicsLayer.cpp:
1405         (WebCore::GraphicsLayer::GraphicsLayer):
1406         (WebCore::GraphicsLayer::willBeDestroyed):
1407         (WebCore::GraphicsLayer::setChildren):
1408         (WebCore::GraphicsLayer::addChild):
1409         (WebCore::GraphicsLayer::addChildAtIndex):
1410         (WebCore::GraphicsLayer::addChildBelow):
1411         (WebCore::GraphicsLayer::addChildAbove):
1412         (WebCore::GraphicsLayer::replaceChild):
1413         (WebCore::GraphicsLayer::removeAllChildren):
1414         (WebCore::GraphicsLayer::removeFromParent):
1415         (WebCore::GraphicsLayer::setMaskLayer):
1416         (WebCore::GraphicsLayer::noteDeviceOrPageScaleFactorChangedIncludingDescendants):
1417         (WebCore::GraphicsLayer::distributeOpacity):
1418         (WebCore::GraphicsLayer::traverse):
1419         (WebCore::dumpChildren):
1420         * platform/graphics/GraphicsLayer.h:
1421         (WebCore::GraphicsLayer::children const):
1422         (WebCore::GraphicsLayer::children):
1423         (WebCore::GraphicsLayer::maskLayer const):
1424         (WebCore::GraphicsLayer::replicaLayer const):
1425         (WebCore::GraphicsLayer::beingDestroyed const):
1426         (WebCore::GraphicsLayer:: const): Deleted.
1427         * platform/graphics/GraphicsLayerFactory.h:
1428         * platform/graphics/ca/GraphicsLayerCA.cpp:
1429         (WebCore::GraphicsLayer::create):
1430         (WebCore::GraphicsLayerCA::setChildren):
1431         (WebCore::GraphicsLayerCA::addChild):
1432         (WebCore::GraphicsLayerCA::addChildAtIndex):
1433         (WebCore::GraphicsLayerCA::addChildBelow):
1434         (WebCore::GraphicsLayerCA::addChildAbove):
1435         (WebCore::GraphicsLayerCA::replaceChild):
1436         (WebCore::GraphicsLayerCA::setMaskLayer):
1437         (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
1438         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
1439         (WebCore::GraphicsLayerCA::updateSublayerList):
1440         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
1441         * platform/graphics/ca/GraphicsLayerCA.h:
1442         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
1443         (WebCore::GraphicsLayer::create):
1444         (WebCore::GraphicsLayerTextureMapper::setChildren):
1445         (WebCore::GraphicsLayerTextureMapper::addChild):
1446         (WebCore::GraphicsLayerTextureMapper::addChildAtIndex):
1447         (WebCore::GraphicsLayerTextureMapper::addChildAbove):
1448         (WebCore::GraphicsLayerTextureMapper::addChildBelow):
1449         (WebCore::GraphicsLayerTextureMapper::replaceChild):
1450         (WebCore::GraphicsLayerTextureMapper::setMaskLayer):
1451         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers):
1452         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
1453         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1454         (WebCore::GraphicsLayer::create):
1455         (WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect):
1456         (WebCore::CoordinatedGraphicsLayer::addChild):
1457         (WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
1458         (WebCore::CoordinatedGraphicsLayer::addChildAbove):
1459         (WebCore::CoordinatedGraphicsLayer::addChildBelow):
1460         (WebCore::CoordinatedGraphicsLayer::replaceChild):
1461         (WebCore::CoordinatedGraphicsLayer::setMaskLayer):
1462         (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
1463         (WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers):
1464         (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
1465         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1466         * platform/graphics/win/GraphicsLayerDirect2D.cpp:
1467         (WebCore::GraphicsLayer::create):
1468         (WebCore::GraphicsLayerDirect2D::GraphicsLayerDirect2D): Deleted.
1469         (WebCore::GraphicsLayerDirect2D::initialize): Deleted.
1470         (WebCore::GraphicsLayerDirect2D::~GraphicsLayerDirect2D): Deleted.
1471         (WebCore::GraphicsLayerDirect2D::setNeedsDisplay): Deleted.
1472         (WebCore::GraphicsLayerDirect2D::setNeedsDisplayInRect): Deleted.
1473         * rendering/RenderLayerBacking.cpp:
1474         (WebCore::RenderLayerBacking::createGraphicsLayer):
1475         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
1476         (WebCore::RenderLayerBacking::updateConfiguration):
1477         (WebCore::RenderLayerBacking::updateInternalHierarchy):
1478         (WebCore::RenderLayerBacking::updateMaskingLayer):
1479         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
1480         (WebCore::RenderLayerBacking::updateScrollingLayers):
1481         * rendering/RenderLayerBacking.h:
1482         * rendering/RenderLayerCompositor.cpp:
1483         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1484         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
1485         (WebCore::RenderLayerCompositor::setCompositingParent):
1486         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
1487         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
1488         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
1489         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
1490         (WebCore::RenderLayerCompositor::updateLayerForHeader):
1491         (WebCore::RenderLayerCompositor::updateLayerForFooter):
1492         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
1493         (WebCore::RenderLayerCompositor::ensureRootLayer):
1494         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
1495         * rendering/RenderLayerCompositor.h:
1496
1497 2018-09-12  Alex Christensen  <achristensen@webkit.org>
1498
1499         Expose fewer of URL's internal members
1500         https://bugs.webkit.org/show_bug.cgi?id=189528
1501
1502         Reviewed by Chris Dumez.
1503
1504         * loader/appcache/ApplicationCacheStorage.cpp:
1505         (WebCore::urlHostHash):
1506         * platform/URL.cpp:
1507         (WebCore::URL::hostStart const):
1508         (WebCore::protocolHostAndPortAreEqual):
1509         (WebCore::hostsAreEqual):
1510         * platform/URL.h:
1511         (WebCore::URL::hostStart const): Deleted.
1512         (WebCore::URL::hostEnd const): Deleted.
1513
1514 2018-09-12  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1515
1516         [Curl] Implement correct total received bytes.
1517         https://bugs.webkit.org/show_bug.cgi?id=189555
1518
1519         Reviewed by Alex Christensen.
1520
1521         Curl port only reported total network received bytes before decoding.
1522
1523         No new test. InspectorTest is only available for WebKitTestRunner.
1524
1525         * platform/network/curl/CurlRequest.cpp:
1526         (WebCore::CurlRequest::didReceiveData):
1527         (WebCore::CurlRequest::updateNetworkLoadMetrics):
1528         * platform/network/curl/CurlRequest.h:
1529
1530 2018-09-12  Youenn Fablet  <youenn@apple.com>
1531
1532         Split RTCRtpParameters idl and header file
1533         https://bugs.webkit.org/show_bug.cgi?id=189524
1534
1535         Reviewed by Eric Carlson.
1536
1537         This will be easier to manage and will allow to more easily introduce sender/receiver parameters.
1538         No change of behavior.
1539
1540         * CMakeLists.txt:
1541         * DerivedSources.make:
1542         * Modules/mediastream/RTCDegradationPreference.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
1543         * Modules/mediastream/RTCDegradationPreference.idl: Added.
1544         * Modules/mediastream/RTCDtxStatus.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
1545         * Modules/mediastream/RTCDtxStatus.idl: Added.
1546         * Modules/mediastream/RTCPriorityType.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
1547         * Modules/mediastream/RTCPriorityType.idl: Added.
1548         * Modules/mediastream/RTCRtpCodecParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
1549         * Modules/mediastream/RTCRtpCodecParameters.idl: Added.
1550         * Modules/mediastream/RTCRtpEncodingParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
1551         * Modules/mediastream/RTCRtpEncodingParameters.idl: Added.
1552         * Modules/mediastream/RTCRtpFecParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
1553         * Modules/mediastream/RTCRtpFecParameters.idl: Added.
1554         * Modules/mediastream/RTCRtpHeaderExtensionParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
1555         * Modules/mediastream/RTCRtpHeaderExtensionParameters.idl: Added.
1556         * Modules/mediastream/RTCRtpParameters.h:
1557         * Modules/mediastream/RTCRtpParameters.idl:
1558         * Modules/mediastream/RTCRtpRtxParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
1559         * Modules/mediastream/RTCRtpRtxParameters.idl: Added.
1560         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1561         (WebCore::toRTCEncodingParameters):
1562         (WebCore::fromRTCEncodingParameters):
1563         (WebCore::toRTCHeaderExtensionParameters):
1564         (WebCore::fromRTCHeaderExtensionParameters):
1565         (WebCore::toRTCCodecParameters):
1566         (WebCore::toRTCRtpParameters):
1567         (WebCore::fromRTCRtpParameters):
1568         * Sources.txt:
1569         * WebCore.xcodeproj/project.pbxproj:
1570
1571 2018-09-12  Ali Juma  <ajuma@chromium.org>
1572
1573         [IntersectionObserver] Implement rootMargin expansion
1574         https://bugs.webkit.org/show_bug.cgi?id=189525
1575
1576         Reviewed by Simon Fraser.
1577
1578         Expand the root intersection rectangle by the observer's rootMargin when computing
1579         intersections.
1580
1581         Test: imported/w3c/web-platform-tests/intersection-observer/root-margin.html
1582
1583         * dom/Document.cpp:
1584         (WebCore::expandRootBoundsWithRootMargin):
1585         (WebCore::computeIntersectionRects):
1586         * page/IntersectionObserver.h:
1587         (WebCore::IntersectionObserver::rootMarginBox const):
1588         * platform/graphics/FloatRect.h:
1589         (WebCore::FloatRect::expand):
1590
1591 2018-09-12  Fujii Hironori  <Hironori.Fujii@sony.com>
1592
1593         [Win][Clang] error: non-constant-expression cannot be narrowed from type 'int' to 'SHORT'
1594         https://bugs.webkit.org/show_bug.cgi?id=189542
1595
1596         Reviewed by Alex Christensen.
1597
1598         No new tests (No behavior change).
1599
1600         * platform/graphics/win/IntPointWin.cpp:
1601         (WebCore::IntPoint::operator POINTS const): Narrowed m_x and m_y by using static_cast.
1602
1603 2018-09-12  Guillaume Emont  <guijemont@igalia.com>
1604
1605         Add IGNORE_WARNING_.* macros
1606         https://bugs.webkit.org/show_bug.cgi?id=188996
1607
1608         Reviewed by Michael Catanzaro.
1609
1610         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
1611         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1612         * accessibility/mac/AXObjectCacheMac.mm:
1613         (WebCore::AXObjectCache::postPlatformNotification):
1614         * accessibility/mac/AccessibilityObjectMac.mm:
1615         (WebCore::AccessibilityObject::overrideAttachmentParent):
1616         (WebCore::AccessibilityObject::accessibilityIgnoreAttachment const):
1617         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1618         (-[WebAccessibilityObjectWrapper renderWidgetChildren]):
1619         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
1620         (-[WebAccessibilityObjectWrapper role]):
1621         (-[WebAccessibilityObjectWrapper roleDescription]):
1622         * bridge/objc/WebScriptObject.mm:
1623         * bridge/objc/objc_class.mm:
1624         (JSC::Bindings::ObjcClass::fieldNamed const):
1625         * crypto/CommonCryptoUtilities.cpp:
1626         (WebCore::getCommonCryptoDigestAlgorithm):
1627         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
1628         (WebCore::encryptAES_GCM):
1629         (WebCore::decyptAES_GCM):
1630         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
1631         (WebCore::wrapSerializedCryptoKey):
1632         (WebCore::unwrapSerializedCryptoKey):
1633         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
1634         * css/makeSelectorPseudoElementsMap.py:
1635         * editing/TextIterator.cpp:
1636         * editing/mac/EditorMac.mm:
1637         (WebCore::Editor::pasteWithPasteboard):
1638         (WebCore::Editor::takeFindStringFromSelection):
1639         (WebCore::Editor::replaceNodeFromPasteboard):
1640         * page/mac/EventHandlerMac.mm:
1641         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
1642         * page/mac/ServicesOverlayController.mm:
1643         (WebCore::ServicesOverlayController::Highlight::paintContents):
1644         * platform/LocalizedStrings.cpp:
1645         (WebCore::formatLocalizedString):
1646         * platform/ScreenProperties.h:
1647         (WebCore::ScreenData::decode):
1648         * platform/gamepad/mac/HIDGamepadProvider.cpp:
1649         (WebCore::HIDGamepadProvider::stopMonitoringInput):
1650         * platform/graphics/PlatformDisplay.cpp:
1651         (WebCore::PlatformDisplay::sharedDisplay):
1652         * platform/graphics/SurrogatePairAwareTextIterator.cpp:
1653         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
1654         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
1655         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1656         (WebCore::CDMSessionAVStreamSession::update):
1657         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
1658         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1659         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
1660         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
1661         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
1662         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1663         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1664         (WebCore::IGNORE_CLANG_WARNING_END):
1665         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1666         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1667         (-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
1668         (-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
1669         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
1670         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
1671         (WebCore::IGNORE_CLANG_WARNING_END):
1672         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1673         (PlatformCALayer::drawLayerContents):
1674         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
1675         (WebCore::FontCascade::fontForCombiningCharacterSequence const):
1676         * platform/graphics/cg/ImageDecoderCG.cpp:
1677         (WebCore::ImageDecoderCG::createFrameImageAtIndex):
1678         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
1679         (WebCore::GraphicsContext::drawLineForDocumentMarker):
1680         * platform/graphics/cocoa/WebGLLayer.h:
1681         (IGNORE_CLANG_WARNING):
1682         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1683         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
1684         * platform/graphics/mac/IconMac.mm:
1685         (WebCore::Icon::Icon):
1686         * platform/graphics/mac/PDFDocumentImageMac.mm:
1687         (WebCore::PDFDocumentImage::drawPDFPage):
1688         * platform/graphics/mac/WebKitNSImageExtras.mm:
1689         (-[NSImage _web_lockFocusWithDeviceScaleFactor:]):
1690         * platform/ios/DragImageIOS.mm:
1691         * platform/mac/DragImageMac.mm:
1692         (WebCore::scaleDragImage):
1693         (WebCore::createDragImageForLink):
1694         * platform/mac/LegacyNSPasteboardTypes.h:
1695         * platform/mac/LocalCurrentGraphicsContext.mm:
1696         (WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext):
1697         * platform/mac/PasteboardMac.mm:
1698         (WebCore::Pasteboard::createForCopyAndPaste):
1699         (WebCore::Pasteboard::createForDragAndDrop):
1700         (WebCore::setDragImageImpl):
1701         * platform/mac/PlatformEventFactoryMac.mm:
1702         (WebCore::globalPoint):
1703         * platform/mac/SSLKeyGeneratorMac.mm:
1704         * platform/mac/ScrollViewMac.mm:
1705         (WebCore::ScrollView::platformContentsToScreen const):
1706         (WebCore::ScrollView::platformScreenToContents const):
1707         * platform/mac/ThemeMac.mm:
1708         (WebCore::drawCellFocusRingWithFrameAtTime):
1709         * platform/mac/WebPlaybackControlsManager.mm:
1710         * platform/mac/WidgetMac.mm:
1711         (WebCore::Widget::paint):
1712         * platform/mediastream/RealtimeIncomingAudioSource.h:
1713         * platform/mediastream/RealtimeIncomingVideoSource.h:
1714         * platform/mediastream/RealtimeOutgoingAudioSource.h:
1715         * platform/mediastream/RealtimeOutgoingVideoSource.h:
1716         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
1717         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1718         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1719         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
1720         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
1721         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1722         * platform/network/cf/ResourceHandleCFNet.cpp:
1723         (WebCore::ResourceHandle::createCFURLConnection):
1724         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1725         (WebCore::SocketStreamHandleImpl::reportErrorToClient):
1726         * platform/network/create-http-header-name-table:
1727         * platform/text/TextEncoding.cpp:
1728         * testing/MockLibWebRTCPeerConnection.h:
1729         * xml/XPathGrammar.cpp:
1730
1731 2018-09-12  Pablo Saavedra  <psaavedra@igalia.com>
1732
1733         Linking against libWPEWebKit-0.1.so is not posible when WPE is build with ENABLE_VIDEO=OFF and ENABLE_WEB_AUDIO=OFF
1734         https://bugs.webkit.org/show_bug.cgi?id=189540
1735
1736         Reviewed by Philippe Normand.
1737
1738         Related issues:
1739
1740         This issue is related with changes in https://bugs.webkit.org/show_bug.cgi?id=183080
1741         This issue is introduced in https://bugs.webkit.org/show_bug.cgi?id=186547
1742
1743         No new tests, no changes in the functionality.
1744
1745         * platform/GStreamer.cmake:
1746         * platform/SourcesGLib.txt:
1747         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
1748         (WebCore::LibWebRTCProvider::webRTCAvailable):
1749
1750 2018-09-11  Zan Dobersek  <zdobersek@igalia.com>
1751
1752         Unreviewed WPE build fix.
1753
1754         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
1755         Add extra header inclusions to get this code building after the unified
1756         sources system shifted it into a different translation unit.
1757
1758 2018-09-11  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1759
1760         [Curl] WebInspector doesn't display request headers added during processing.
1761         https://bugs.webkit.org/show_bug.cgi?id=189531
1762
1763         Reviewed by Alex Christensen.
1764
1765         While processing the request, Curl port network layer adds some headers to the request
1766         such as cookies. Those headers should be displayed in the WebInspector.
1767
1768         Tested on MiniBrowser.
1769
1770         * platform/network/curl/CurlRequest.cpp:
1771         (WebCore::CurlRequest::didReceiveHeader):
1772         (WebCore::CurlRequest::didCompleteTransfer):
1773         (WebCore::CurlRequest::updateNetworkLoadMetrics):
1774         * platform/network/curl/CurlRequest.h:
1775
1776 2018-09-11  James Savage  <james.savage@apple.com>
1777
1778         Follow up to:
1779         Expose -apple-system-container-border color to internal web views.
1780         https://bugs.webkit.org/show_bug.cgi?id=189178.
1781
1782         Reviewed by Timothy Hatcher.
1783
1784         * rendering/RenderThemeMac.mm:
1785         (WebCore::RenderThemeMac::systemColor const): Add a separate #if block for
1786         Mojave. When I used CSSValueAppleSystemFindHighlightBackground as a template
1787         for this change, I had to write out the condition in the first change, but
1788         mistakenly thought I could reuse the block here. Turns out the versions were
1789         different, and I could not.
1790
1791 2018-09-11  Youenn Fablet  <youenn@apple.com>
1792
1793         Remove MediaDevices NoInterfaceObject
1794         https://bugs.webkit.org/show_bug.cgi?id=189512
1795
1796         Reviewed by Alex Christensen.
1797
1798         Covered by rebased WPT tests.
1799
1800         * Modules/mediastream/MediaDevices.idl:
1801
1802 2018-09-11  Jer Noble  <jer.noble@apple.com>
1803
1804         [MediaCapabilities] Implement MediaEngineConfigurationFactory registration
1805         https://bugs.webkit.org/show_bug.cgi?id=189438
1806
1807         Reviewed by Eric Carlson.
1808
1809         Implement a mechanism to register platform-specific MediaEngineConfigurationFactory methods, and a mechanism to iterate
1810         over those registered factories when createDecodingConfiguration() and createEncodingConfiguration() are called.
1811
1812         The Factory has been radically simplified; the concept of MediaEngineDecodingConfiguration
1813         and MediaEngineEncodingConfiguration and its subclasess have been removed. Since the primary
1814         objects representing video and audio configurations are IDLDictionaries, the native objects
1815         are just structs full of POD types (and Strings). Since these have no dependencies on
1816         higher-level HTML concepts, they can be moved into platform/ and accessed from there. This
1817         patch also converts MediaCapabilitiesInfo to an Interface, so its implementation also can
1818         become a struct and live in platform/. The MediaEngineDecodingConfigurationMock and
1819         MediaEngineEncodingConfigurationMock have been consolidated in a single class which simply
1820         parses MediaDecodingConfiguration and MediaEncodingConifguration objects (now that they live
1821         in Platform) and return a MediaCapabilitiesInfo object (now that it does too).
1822
1823         * Modules/mediacapabilities/MediaCapabilities.cpp:
1824         (WebCore::isValidVideoConfiguration):
1825         (WebCore::MediaCapabilities::decodingInfo):
1826         (WebCore::MediaCapabilities::encodingInfo):
1827         * Modules/mediacapabilities/MediaCapabilitiesInfo.h: Removed.
1828         * Modules/mediacapabilities/MediaCapabilitiesInfo.idl:
1829         * Modules/mediacapabilities/VideoConfiguration.idl:
1830         * Sources.txt:
1831         * WebCore.xcodeproj/project.pbxproj:
1832         * platform/MediaCapabilitiesInfo.h: Copied from Source/WebCore/Modules/mediacapabilities/MediaDecodingType.h.
1833         * platform/mediacapabilities/AudioConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/AudioConfiguration.h.
1834         * platform/mediacapabilities/MediaConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaConfiguration.h.
1835         * platform/mediacapabilities/MediaDecodingConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaDecodingConfiguration.h.
1836         * platform/mediacapabilities/MediaDecodingType.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaDecodingType.h.
1837         * platform/mediacapabilities/MediaEncodingConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaEncodingConfiguration.h.
1838         * platform/mediacapabilities/MediaEncodingType.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaEncodingType.h.
1839         * platform/mediacapabilities/MediaEngineConfiguration.cpp: Removed.
1840         * platform/mediacapabilities/MediaEngineConfiguration.h: Removed.
1841         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
1842         (WebCore::factories):
1843         (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
1844         (WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
1845         * platform/mediacapabilities/MediaEngineConfigurationFactory.h:
1846         * platform/mediacapabilities/MediaEngineEncodingConfiguration.h: Removed.
1847         * platform/mediacapabilities/VideoConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/VideoConfiguration.h.
1848         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
1849         * platform/mock/MediaEngineConfigurationFactoryMock.cpp: Added.
1850         (WebCore::canDecodeMedia):
1851         (WebCore::canSmoothlyDecodeMedia):
1852         (WebCore::canPowerEfficientlyDecodeMedia):
1853         (WebCore::canEncodeMedia):
1854         (WebCore::canSmoothlyEncodeMedia):
1855         (WebCore::canPowerEfficientlyEncodeMedia):
1856         (WebCore::MediaEngineConfigurationFactoryMock::createDecodingConfiguration):
1857         (WebCore::MediaEngineConfigurationFactoryMock::createEncodingConfiguration):
1858         * platform/mock/MediaEngineConfigurationFactoryMock.h: Renamed from Source/WebCore/platform/mediacapabilities/MediaEngineDecodingConfiguration.h.
1859         * platform/mock/MediaEngineDecodingConfigurationMock.cpp: Removed.
1860         * platform/mock/MediaEngineDecodingConfigurationMock.h: Removed.
1861         * platform/mock/MediaEngineEncodingConfigurationMock.cpp: Removed.
1862         * platform/mock/MediaEngineEncodingConfigurationMock.h: Removed.
1863
1864 2018-09-08  Ryosuke Niwa  <rniwa@webkit.org>
1865
1866         :first-child, :last-child, :nth-child, and :nth-of-type don't work on shadow root's children
1867         https://bugs.webkit.org/show_bug.cgi?id=166748
1868         <rdar://problem/29649177>
1869
1870         Reviewed by Yusuke Suzuki.
1871
1872         Added the support for matching positional pseudo classes. For now, we invalidate whenever a child node
1873         of a non-UA ShadowRoot is mutated instead of a fine-grained style invalidation as done for regular elements.
1874
1875         Tests: fast/shadow-dom/nth-node-on-shadow-child-invalidation.html
1876                fast/shadow-dom/nth-node-on-shadow-child-no-jit.html
1877                fast/shadow-dom/nth-node-on-shadow-child.html
1878
1879         * css/SelectorChecker.cpp:
1880         (WebCore::SelectorChecker::checkOne const):
1881         * cssjit/SelectorCompiler.cpp:
1882         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElementOrShadowRoot):
1883         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFirstChild):
1884         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsLastChild):
1885         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsOnlyChild):
1886         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthChildParentCheckAndRelationUpdate):
1887         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
1888         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
1889         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthLastChildParentCheckAndRelationUpdate):
1890         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild):
1891         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChildOf):
1892         * dom/ShadowRoot.cpp:
1893         (WebCore::ShadowRoot::childrenChanged): Invalidate the subtree whenever a child node is mutated.
1894         * dom/ShadowRoot.h:
1895         * domjit/DOMJITHelpers.h:
1896         (WebCore::DOMJIT::branchTestIsShadowRootFlagOnNode): Added.
1897         (WebCore::DOMJIT::branchTestIsElementOrShadowRootFlagOnNode): Added.
1898
1899 2018-09-11  Per Arne Vollan  <pvollan@apple.com>
1900
1901         Addressing post-review feedback on r235619.
1902         https://bugs.webkit.org/show_bug.cgi?id=187925
1903
1904         Unreviewed.
1905
1906         * testing/Internals.cpp:
1907         (WebCore::Internals::primaryScreenDisplayID):
1908         * testing/Internals.h:
1909
1910 2018-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1911
1912         [macOS] [WK2] Support changing foreground colors via color panel
1913         https://bugs.webkit.org/show_bug.cgi?id=189382
1914         <rdar://problem/44227311>
1915
1916         Reviewed by Ryosuke Niwa.
1917
1918         Small adjustments to support changing foreground text color using NSColorPanel in WebKit2. See comments below.
1919         Tested by FontManagerTests.ChangeFontColorWithColorPanel.
1920
1921         * editing/EditingStyle.cpp:
1922         (WebCore::StyleChange::extractTextStyles):
1923
1924         Support setting foreground text color with alpha by using a styled span element rather than a font element with
1925         attributes. To do this, only populate `StyleChange::m_applyFontColor` if the color is opaque. This is because
1926         the font element does not support `rgba()` syntax, so any font colors here with alpha that are serialized to
1927         `rgba()` result in a garbage value for the computed color style.
1928
1929         * editing/FontAttributeChanges.cpp:
1930         (WebCore::FontAttributeChanges::editAction const):
1931
1932         Add a helper to return the relevant EditAction describing this set of FontAttributeChanges.
1933
1934         * editing/FontAttributeChanges.h:
1935         (WebCore::FontChanges::isEmpty const):
1936
1937 2018-09-11  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1938
1939         Shrink size of ResourseResponseBase
1940         https://bugs.webkit.org/show_bug.cgi?id=189501
1941
1942         Reviewed by Simon Fraser.
1943
1944         We reduce the size of ResourceResponseBase by the following two optimizations.
1945
1946         1. Use bitfields for bool flags and reorder them.
1947
1948         2. Use Markable<> in CacheControlDirectives, which is held by ResourceResponseBase.
1949
1950         This patch reduces the size of ResourceResponseBase from 416 to 392 bytes.
1951
1952         No behavior change.
1953
1954         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1955         (WebCore::WebCoreAVFResourceLoader::responseReceived):
1956         (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
1957         * platform/network/CacheValidation.h:
1958         (WebCore::CacheControlDirectives::CacheControlDirectives):
1959         * platform/network/ResourceResponseBase.cpp:
1960         (WebCore::ResourceResponseBase::ResourceResponseBase):
1961         (WebCore::ResourceResponseBase::contentRange const):
1962         * platform/network/ResourceResponseBase.h:
1963         (WebCore::ResourceResponseBase::decode):
1964
1965 2018-09-11  Michael Catanzaro  <mcatanzaro@igalia.com>
1966
1967         Unreviewed, fix some -Wreturn-type warnings
1968
1969         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1970         (WebCore::sourceFromNewReceiver):
1971         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1972         (WebCore::toRTCRtpTransceiverDirection):
1973         (WebCore::fromRTCRtpTransceiverDirection):
1974
1975 2018-09-11  Jiewen Tan  <jiewen_tan@apple.com>
1976
1977         Unreviewed, a speculative build fix for r235888.
1978
1979         * Modules/mediastream/MediaDevices.h:
1980         Add class Document forward declaration.
1981
1982 2018-09-11  Woodrow Wang  <woodrow_wang@apple.com>
1983
1984         Add Web API Statistics Collection
1985         https://bugs.webkit.org/show_bug.cgi?id=187773
1986         <rdar://problem/44155162>
1987
1988         Reviewed by Brent Fulgham.
1989
1990         Added data collection for web API statistics, specifically regarding the canvas, font loads, 
1991         screen functions, and navigator functions. The data collection code is placed under a runtime 
1992         enabled feature flag. The statistics are stored in a ResourceLoadStatistics object and written 
1993         to a plist on disk. Added a new file CanvasActivityRecord.h and CanvasActivityRecord.cpp which
1994         includes a struct to keep track of HTML5 canvas element read and writes. 
1995
1996         Tests: http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html
1997                http/tests/webAPIStatistics/font-load-data-collection.html
1998                http/tests/webAPIStatistics/navigator-functions-accessed-data-collection.html
1999                http/tests/webAPIStatistics/screen-functions-accessed-data-collection.html
2000
2001         * Sources.txt:
2002         * WebCore.xcodeproj/project.pbxproj:
2003         * css/CSSFontFaceSource.cpp:
2004         (WebCore::CSSFontFaceSource::load):
2005         * css/CSSFontSelector.cpp:
2006         (WebCore::CSSFontSelector::fontRangesForFamily):
2007         (WebCore::CSSFontSelector::fallbackFontAt):
2008
2009         The following are the functions where we'd like to record a canvas read.
2010
2011         * html/HTMLCanvasElement.cpp:
2012         (WebCore::HTMLCanvasElement::toDataURL):
2013         (WebCore::HTMLCanvasElement::toBlob):
2014         (WebCore::HTMLCanvasElement::getImageData):
2015         (WebCore::HTMLCanvasElement::toMediaSample):
2016         (WebCore::HTMLCanvasElement::captureStream):
2017
2018         The following are the functions where we'd like to record a canvas write.
2019
2020         * html/canvas/CanvasRenderingContext2D.cpp:
2021         (WebCore::CanvasRenderingContext2D::measureText):
2022         (WebCore::CanvasRenderingContext2D::drawTextInternal):
2023
2024         The following files and functions handle the CanvasActivityRecord struct and
2025         its respective functions.
2026
2027         * loader/CanvasActivityRecord.cpp: Added.
2028         (WebCore::CanvasActivityRecord::recordWrittenOrMeasuredText):
2029         (WebCore::CanvasActivityRecord::mergeWith):
2030         * loader/CanvasActivityRecord.h: Added.
2031         (WebCore::CanvasActivityRecord::encode const):
2032         (WebCore::CanvasActivityRecord::decode):
2033
2034         * loader/DocumentThreadableLoader.cpp:
2035         * loader/FrameLoader.cpp:
2036         * loader/ResourceLoadObserver.cpp:
2037         (WebCore::ResourceLoadObserver::logFontLoad):
2038         (WebCore::ResourceLoadObserver::logCanvasRead):
2039         (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
2040         (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
2041         (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
2042
2043         Before, entries in the ResourceLoadStatistics involving HashSets used "origin" as the key. 
2044         Now the encodeHashSet function has been generalized to take any key to encode the entries 
2045         in the HashSet. Also added functionality to encode an OptionSet by converting it to its 
2046         raw bitmask state. 
2047
2048         * loader/ResourceLoadObserver.h:
2049         * loader/ResourceLoadStatistics.cpp:
2050         (WebCore::encodeHashSet):
2051         (WebCore::encodeOriginHashSet):
2052         (WebCore::encodeOptionSet):
2053         (WebCore::encodeFontHashSet):
2054         (WebCore::encodeCanvasActivityRecord):
2055         (WebCore::ResourceLoadStatistics::encode const):
2056         (WebCore::decodeHashSet):
2057         (WebCore::decodeOriginHashSet):
2058         (WebCore::decodeOptionSet):
2059         (WebCore::decodeFontHashSet):
2060         (WebCore::decodeCanvasActivityRecord):
2061         (WebCore::ResourceLoadStatistics::decode):
2062         (WebCore::navigatorAPIEnumToString):
2063         (WebCore::screenAPIEnumToString):
2064         (WebCore::appendNavigatorAPIOptionSet):
2065         (WebCore::appendScreenAPIOptionSet):
2066         (WebCore::ResourceLoadStatistics::toString const):
2067         (WebCore::ResourceLoadStatistics::merge):
2068         * loader/ResourceLoadStatistics.h:
2069         * loader/ResourceTiming.cpp:
2070
2071         The following are the navigator functions recorded for the web API statistics.
2072
2073         * page/Navigator.cpp:
2074         (WebCore::Navigator::appVersion const):
2075         (WebCore::Navigator::userAgent const):
2076         (WebCore::Navigator::plugins):
2077         (WebCore::Navigator::mimeTypes):
2078         (WebCore::Navigator::cookieEnabled const):
2079         (WebCore::Navigator::javaEnabled const):
2080
2081         The following are the screen functions recorded for the web API statistics.
2082
2083         * page/Screen.cpp:
2084         (WebCore::Screen::height const):
2085         (WebCore::Screen::width const):
2086         (WebCore::Screen::colorDepth const):
2087         (WebCore::Screen::pixelDepth const):
2088         (WebCore::Screen::availLeft const):
2089         (WebCore::Screen::availTop const):
2090         (WebCore::Screen::availHeight const):
2091         (WebCore::Screen::availWidth const):
2092
2093 2018-09-11  Pablo Saavedra  <psaavedra@igalia.com>
2094
2095         playbackControlsManagerUpdateTimerFired and
2096         m_playbackControlsManagerUpdateTimer must be
2097         guarded with ENABLE(VIDEO), otherwise the following
2098         error occurs with the VIDEO feature turned off:
2099
2100           error: 'MediaElementSession' has not been declared
2101
2102         Add missing #if ENABLE(VIDEO) Page.cpp and Page.h
2103         https://bugs.webkit.org/show_bug.cgi?id=189500
2104
2105         Reviewed by Anders Carlsson.
2106
2107         * page/Page.cpp:
2108         (WebCore::Page::Page):
2109         (WebCore::Page::schedulePlaybackControlsManagerUpdate):
2110         * page/Page.h:
2111
2112 2018-09-11  Frederic Wang  <fwang@igalia.com>
2113
2114         Refactor filter list checking code
2115         https://bugs.webkit.org/show_bug.cgi?id=185087
2116
2117         Reviewed by Antonio Gomes.
2118
2119         No new tests, behavior unchanged.
2120
2121         * page/animation/KeyframeAnimation.h: Add missing forward-declaration FilterOperations.
2122
2123 == Rolled over to ChangeLog-2018-09-11 ==