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