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