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