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