Fix broken WinCairo build
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-06-23  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2
3         Fix broken WinCairo build
4
5         [Curl] Extract CurlDownloadManager as shared background task handler
6         https://bugs.webkit.org/show_bug.cgi?id=173557
7
8         Reviewed by Joseph Pecoraro.
9
10         * platform/network/curl/CurlManager.h:
11
12 2017-06-23  Chris Dumez  <cdumez@apple.com>
13
14         [iOS] Potential crash under WebCore::notifyLowPowerModeChanged(WebCore::LowPowerModeNotifier*, bool)
15         https://bugs.webkit.org/show_bug.cgi?id=173755
16         <rdar://problem/32940942>
17
18         Reviewed by Mark Lam.
19
20         The crash was happening because the WebLowPowerModeObserver would dispatch
21         a lambda to the main thread but the LowPowerModeNotifier object could be
22         dead by the time we get to the main thread.
23
24         To address the issue, keep a strong ref to the WebLowPowerModeObserver in
25         the lambda we dispatch to the main thread to make sure it stays alive until
26         we execute the lambda. In the LowPowerModeNotifier destructor, we now reset
27         the WebLowPowerModeObserver's notifier pointer to nil and I added a null
28         check for this notifier in the lambda.
29
30         * platform/LowPowerModeNotifier.cpp:
31         (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier):
32         * platform/LowPowerModeNotifier.h:
33         * platform/ios/LowPowerModeNotifierIOS.mm:
34         (-[WebLowPowerModeObserver initWithNotifier:]):
35         (-[WebLowPowerModeObserver _didReceiveLowPowerModeChange]):
36         (WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
37         (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier):
38         (WebCore::notifyLowPowerModeChanged):
39
40 2017-06-23  Alex Christensen  <achristensen@webkit.org>
41
42         Add SPI to WKURLSchemeTask for redirection
43         https://bugs.webkit.org/show_bug.cgi?id=173730
44
45         Reviewed by Brady Eidson.
46
47         * platform/network/CacheValidation.cpp:
48         (WebCore::computeFreshnessLifetimeForHTTPFamily):
49         Asserting that redirects are always http/https URLs is no longer valid.
50         If there's a custom scheme redirect, give it no freshness lifetime in the cache.
51
52 2017-06-23  Konstantin Tokarev  <annulen@yandex.ru>
53
54         Remove excessive headers from WebCore/{editing,fileapi,history,html,loader,page}
55         https://bugs.webkit.org/show_bug.cgi?id=173769
56
57         Reviewed by Simon Fraser.
58
59         No new tests needed.
60
61         * css/CSSFontFaceSource.cpp:
62         * editing/DictationCommand.cpp:
63         * editing/Editor.h:
64         * editing/VisiblePosition.h:
65         * editing/VisibleUnits.h:
66         * fileapi/BlobBuilder.h:
67         * history/PageCache.h:
68         * html/DOMURL.h:
69         * html/HTMLCollection.h:
70         * html/HTMLMediaElement.cpp:
71         * html/HTMLMediaElement.h:
72         * html/HTMLPlugInImageElement.cpp:
73         * html/StepRange.h:
74         * html/canvas/CanvasRenderingContext.h:
75         * html/canvas/CanvasRenderingContext2D.h:
76         * html/parser/HTMLDocumentParser.cpp:
77         * html/parser/HTMLElementStack.h:
78         * html/parser/HTMLInputStream.h:
79         * html/shadow/MediaControlElements.cpp:
80         * html/shadow/MediaControls.cpp:
81         * html/shadow/MediaControls.h:
82         * html/track/TrackListBase.h:
83         * html/track/VTTCue.h:
84         * html/track/WebVTTParser.cpp:
85         * html/track/WebVTTParser.h:
86         * loader/CrossOriginPreflightChecker.cpp:
87         * loader/DocumentThreadableLoader.cpp:
88         * loader/FrameLoaderClient.h:
89         * loader/LinkPreloadResourceClients.h:
90         * loader/LoadTiming.h:
91         * loader/ThreadableLoaderClientWrapper.h:
92         * loader/WorkerThreadableLoader.h:
93         * loader/cache/CachedResourceLoader.h:
94         * loader/cache/CachedResourceRequest.h:
95         * loader/cache/CachedSVGDocument.h:
96         * loader/cache/CachedTextTrack.h:
97         * loader/icon/IconLoader.cpp:
98         * page/AlternativeTextClient.h:
99         * page/CaptionUserPreferences.cpp:
100         * page/CaptionUserPreferences.h:
101         * page/ContextMenuClient.h:
102         * page/MainFrame.h:
103         * page/Page.h:
104         * page/PageGroup.h:
105         * page/PerformanceEntry.h:
106         * page/PerformanceResourceTiming.h:
107         * page/ResourceUsageOverlay.cpp:
108         * page/ResourceUsageOverlay.h:
109         * page/UserContentController.h:
110         * page/UserContentProvider.h:
111         * page/animation/AnimationBase.h:
112         * page/animation/CSSPropertyAnimation.h:
113         * page/animation/CompositeAnimation.h:
114         * page/scrolling/ScrollingCoordinator.h:
115         * xml/XSLTProcessorLibxslt.cpp:
116         * xml/parser/XMLDocumentParserLibxml2.cpp:
117
118 2017-06-23  Chris Dumez  <cdumez@apple.com>
119
120         [mac-wk1] requestAnimationFrame callbacks may not get serviced
121         https://bugs.webkit.org/show_bug.cgi?id=173628
122
123         Reviewed by Simon Fraser.
124
125         Page::setIsVisibleInternal() was firing the 'visibilitychange' event
126         synchronously while in the middle of updating its visibility/activity
127         state. This allowed the JavaScript to re-enter the method by calling
128         testRunner.setPageVisibility() / resetPageVisiblity() and we would
129         end up in an inconsistent state.
130
131         No new tests, extended existing test.
132
133         * dom/Document.cpp:
134         (WebCore::Document::visibilityStateChanged):
135         Do no fire the visibilitychange event synchronously as we are in the
136         middle of updating the page's activity state. Instead fire the
137         event asynchronously.
138
139         * page/Page.cpp:
140         (WebCore::Page::setIsVisibleInternal):
141         Move the calling of Document::visibilityStateChanged() until after we're
142         done updating the page's visibility state.
143
144         * testing/Internals.cpp:
145         (WebCore::Internals::scriptedAnimationsAreSuspended):
146         * testing/Internals.h:
147         * testing/Internals.idl:
148         Add test infrastructure to check if scripted animations are suspended.
149
150 2017-06-23  Eric Carlson  <eric.carlson@apple.com>
151
152         [iOS] Respond to AudioSession interruption and resume
153         https://bugs.webkit.org/show_bug.cgi?id=173718
154         <rdar://problem/32925263>
155
156         Reviewed by Youenn Fablet.
157
158         Tested manually.
159
160         * WebCore.xcodeproj/project.pbxproj: Add CoreAudioCaptureSourceIOS.mm/.h
161
162         * platform/mediastream/RealtimeMediaSource.h: Make createWeakPtr protected so derived classes
163         can use it.
164
165         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.h: Added.
166         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: Added.
167         (-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]):
168         (-[WebCoreAudioCaptureSourceIOSListener invalidate]):
169         (-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]):
170         (-[WebCoreAudioCaptureSourceIOSListener sessionMediaServicesWereReset:]):
171         (WebCore::CoreAudioCaptureSourceIOS::CoreAudioCaptureSourceIOS):
172         (WebCore::CoreAudioCaptureSourceIOS::~CoreAudioCaptureSourceIOS):
173
174         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
175         (WebCore::CoreAudioSharedUnit::suspended): 
176         (WebCore::CoreAudioSharedUnit::setupAudioUnit): Clear m_suspended.
177         (WebCore::CoreAudioSharedUnit::suspend): Don't clear sources or uninitialize the audio unit,
178         suspend is temporary. Set m_suspended.
179         (WebCore::CoreAudioSharedUnit::resume): New, restart the audio unit.
180         (WebCore::CoreAudioCaptureSource::create): Create the correct object.
181         (WebCore::CoreAudioCaptureSource::scheduleReconfiguration): Dispatch to main thread if necessary.
182         (WebCore::CoreAudioCaptureSource::beginInterruption): New, suspend from main thread.
183         (WebCore::CoreAudioCaptureSource::endInterruption): New, resume/reconfigure from main thread.
184         (WebCore::CoreAudioCaptureSource::interrupted):
185         * platform/mediastream/mac/CoreAudioCaptureSource.h:
186
187 2017-06-23  Zan Dobersek  <zdobersek@igalia.com>
188
189         [GCrypt] Drop the AES-CFB support
190         https://bugs.webkit.org/show_bug.cgi?id=173547
191
192         Reviewed by Jiewen Tan.
193
194         No new tests -- relevant test baselines are updated.
195
196         Stop registering the AES-CFB algorithm as something that's supported by
197         the libgcrypt implementation. This algorithm was previously included in
198         the Web Crypto API specification, but has since been dropped from it.
199
200         Conveniently, libgcrypt only recently gained support for the CFB8 AES
201         cipher mode that's required by the specification, meaning we could only
202         support this algorithm with future releases of the libgcrypt library.
203
204         * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
205         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
206
207 2017-06-23  Carlos Garcia Campos  <cgarcia@igalia.com>
208
209         [WPE] Enable PUBLIC_SUFFIX_LIST
210         https://bugs.webkit.org/show_bug.cgi?id=173758
211
212         Reviewed by Žan Doberšek.
213
214         * PlatformWPE.cmake: Add PublicSuffixSoup.cpp to the build.
215
216 2017-06-22  Antti Koivisto  <antti@apple.com>
217
218         REGRESSION(r217695): Offscreen/overflowed items not being rendered while translating in-frame
219         https://bugs.webkit.org/show_bug.cgi?id=173732
220
221         Reviewed by Simon Fraser.
222
223         If an accelerated animation starts completely outside the view we fail to create backing for it
224         when it moves into view.
225
226         Fix by computing the full extent rect of the animation when it starts and doing the viewport overlap
227         testing with that.
228
229         Test: compositing/backing/transform-transition-from-outside-view.html
230
231         * platform/graphics/GraphicsLayer.h:
232         (WebCore::GraphicsLayer::animationExtent):
233         (WebCore::GraphicsLayer::setAnimationExtent):
234         * platform/graphics/ca/GraphicsLayerCA.cpp:
235         (WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect):
236
237             Return the current animation transformation matrix so we can use it elsewhere without recomputing.
238
239         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
240
241             If we have animation extent use it instead of bounds for visibility testing.
242
243         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
244
245             Track if theres is a visible ancestor layer with a transition animation.
246
247         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
248         (WebCore::GraphicsLayerCA::updateCoverage):
249
250             For simplicity create backing for all sublayers of a visible transform animated layer.
251
252         * platform/graphics/ca/GraphicsLayerCA.h:
253         (WebCore::GraphicsLayerCA::VisibleAndCoverageRects::VisibleAndCoverageRects): Deleted.
254         * rendering/RenderLayerBacking.cpp:
255         (WebCore::RenderLayerBacking::updateGeometry):
256
257             Pass the animation extent (including descendants) to GraphicsLayer.
258
259 2017-06-22  Chris Dumez  <cdumez@apple.com>
260
261         ResourceLoadStatisticsStore should be ThreadSafeRefCounted
262         https://bugs.webkit.org/show_bug.cgi?id=173753
263         <rdar://problem/32939326>
264
265         Reviewed by Andreas Kling.
266
267         ResourceLoadStatisticsStore should be ThreadSafeRefCounted as it is ref'd/deref'd
268         from different threads.
269
270         * loader/ResourceLoadStatisticsStore.h:
271
272 2017-06-22  Myles C. Maxfield  <mmaxfield@apple.com>
273
274         @font-face rules with invalid primary fonts never download their secondary fonts
275         https://bugs.webkit.org/show_bug.cgi?id=173138
276         <rdar://problem/32554450>
277
278         Reviewed by Simon Fraser.
279
280         We have logic in CSSFontAccessor::font() which disallows downloading a CSSFontFace if that CSSFontFace
281         is already in the Succeeded state. However, it was possible for a succeeded CSSFontFace to still fail
282         to create a font. In this situation, we wouldn't be able to use the downloaded font, and we wouldn't
283         try to download the next item in the src: list because the CSSFontFace is succeeded.
284
285         This patch strengthens the meaning of the Succeeded state. Previously, it just meant that the bytes
286         in the file were downloaded successfully. This patch extends this to also mean that the bytes in the
287         file can be successfully interpreted as a font. This way, the CSSFontFace in the example above won't be
288         set to the Succeeded state, so we will continue follow the src: list and download the secondary fonts.
289
290         This has an added benefit that the CSS Font Loading API's promises will be called more appropriately.
291         The transition to the Succeeded state will trigger a resolve of the promise. Now, these promises will
292         only be resolved if the fonts are actually parsed and understood by our text system.
293
294         Test: fast/text/font-fallback-invalid-load.html
295
296         * css/CSSFontFaceSource.cpp:
297         (WebCore::CSSFontFaceSource::fontLoaded): Move to the failed state if we can't understand the font
298         data. This is the crux of this patch.
299         (WebCore::CSSFontFaceSource::font): This function should only be called if we are in the Succeeded
300         state, which means now we know we should always be able to understand the bytes of the file. Therefore,
301         we can change some if statements into ASSERT()s.
302         * loader/cache/CachedSVGFont.cpp:
303         (WebCore::CachedSVGFont::createFont): Ditto.
304         (WebCore::CachedSVGFont::ensureCustomFontData): Similarly to CSSFontFaceSource::fontLoaded(), this
305         adds another check to our criteria for transitioning into the Succeeded state, which will guarantee that
306         later we will always be able to create the font object.
307
308 2017-06-22  Andreas Kling  <akling@apple.com>
309
310         Rename MemoryPressureHandler::setTabCount to setPageCount
311         https://bugs.webkit.org/show_bug.cgi?id=173750
312
313         Reviewed by Daniel Bates.
314
315         * page/Page.cpp:
316         (WebCore::Page::~Page):
317
318 2017-06-22  Antoine Quint  <graouts@apple.com>
319
320         Modern media controls localised strings are out of sync with used strings in code
321         https://bugs.webkit.org/show_bug.cgi?id=173752
322
323         Reviewed by Dean Jackson.
324
325         Remove strings we no longer use and add strings we use but failed to add previously.
326
327         * English.lproj/modern-media-controls-localized-strings.js:
328
329 2017-06-22  Antoine Quint  <graouts@apple.com>
330
331         Log when scripted animations get suspended and resumed
332         https://bugs.webkit.org/show_bug.cgi?id=173751
333
334         Reviewed by Dean Jackson.
335
336         More work toward understanding why rAF callbacks are not serviced on bots (webkit.org/b/173628).
337
338         * dom/Document.cpp:
339         (WebCore::Document::requestAnimationFrame):
340         * dom/ScriptedAnimationController.cpp:
341         (WebCore::ScriptedAnimationController::suspend):
342         (WebCore::ScriptedAnimationController::resume):
343         (WebCore::ScriptedAnimationController::logSuspendCount): Deleted.
344         * dom/ScriptedAnimationController.h:
345         * page/Page.cpp:
346         (WebCore::Page::suspendScriptedAnimations):
347         (WebCore::Page::resumeScriptedAnimations):
348         (WebCore::Page::setIsVisibleInternal):
349
350 2017-06-22  Zalan Bujtas  <zalan@apple.com>
351
352         REGRESSION(r214712): Infinite recursion in RenderTable::layout in paginated mode
353         https://bugs.webkit.org/show_bug.cgi?id=173731
354         <rdar://problem/32237775>
355
356         Reviewed by Antti Koivisto.
357
358         We should just skip bottom captions to check if section is moved, since they don't affect
359         the section position (bottom <caption> is preceded by <tfoot>).
360
361         Test: fast/table/caption-bottom-with-pagination.html
362
363         * rendering/RenderTable.cpp:
364         (WebCore::RenderTable::layout):
365
366 2017-06-22  Dean Jackson  <dino@apple.com>
367
368         REGRESSION (r215809): 50% regression 14E305 -> 15A293a in MotionMark Suits test
369         https://bugs.webkit.org/show_bug.cgi?id=173728
370         <rdar://problem/32526744>
371
372         Reviewed by Tim Horton.
373
374         It turns out that CGGradientCreateWithColors is much slower than
375         CGGradientCreateWithColorComponents, even without colorspace variations.
376         Update the gradient creation code to only use this slower path
377         when it has extended colors.
378
379         * platform/graphics/Color.h: Add a FIXME about renaming some methods.
380         * platform/graphics/cg/GradientCG.cpp: Use CGGradientCreateWithColorComponents
381         if we have stops that are not extended colors.
382         (WebCore::Gradient::platformGradient):
383
384 2017-06-22  Youenn Fablet  <youenn@apple.com>
385
386         Fix memory leak in LibWebRTCMediaEndpoint
387         https://bugs.webkit.org/show_bug.cgi?id=173717
388
389         Reviewed by Eric Carlson.
390
391         No chnage of behavior.
392         Making sure SessionDescription pointer get properly released.
393
394         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
395         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded):
396         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
397         * testing/MockLibWebRTCPeerConnection.cpp: Allocating description.
398
399 2017-06-22  Daniel Bates  <dabates@apple.com>
400
401         Make FrameLoadRequest a move-only type
402         https://bugs.webkit.org/show_bug.cgi?id=173682
403
404         Reviewed by Alex Christensen and Darin Adler.
405
406         A FrameLoadRequest groups together the information to perform a load into a single object
407         that is more manageable to pass around than its constituent parts. Code that receives a
408         FrameLoadRequest is expected to extract out the information it needs to complete its task.
409         And it does not make sense to re-use the same FrameLoadRequest object for more than one
410         load. Therefore, it is sufficient to make FrameLoadRequest a move-only type.
411
412         * inspector/InspectorFrontendClientLocal.cpp:
413         (WebCore::InspectorFrontendClientLocal::openInNewTab):
414         * inspector/InspectorPageAgent.cpp:
415         (WebCore::InspectorPageAgent::navigate):
416         * loader/FrameLoadRequest.h:
417         * loader/FrameLoader.cpp:
418         (WebCore::FrameLoader::changeLocation):
419         (WebCore::FrameLoader::urlSelected):
420         (WebCore::FrameLoader::loadURLIntoChildFrame):
421         (WebCore::FrameLoader::loadFrameRequest):
422         (WebCore::FrameLoader::loadURL):
423         (WebCore::FrameLoader::load):
424         (WebCore::FrameLoader::loadPostRequest):
425         (WebCore::createWindow):
426         * loader/FrameLoader.h:
427         * loader/NavigationScheduler.cpp:
428         (WebCore::NavigationScheduler::scheduleLocationChange):
429         * page/ContextMenuController.cpp:
430         (WebCore::openNewWindow):
431         (WebCore::ContextMenuController::contextMenuItemSelected):
432         * page/DOMWindow.cpp:
433         (WebCore::DOMWindow::createWindow):
434         * replay/UserInputBridge.cpp:
435         (WebCore::UserInputBridge::loadRequest):
436         * replay/UserInputBridge.h:
437
438 2017-06-22  Jer Noble  <jer.noble@apple.com>
439
440         REGRESSION (r217223): [iOS] Video keeps playing after application is backgrounded
441         https://bugs.webkit.org/show_bug.cgi?id=173727
442
443         Reviewed by Eric Carlson.
444
445         Only override media element visibility if it is in picture-in-picture mode (not fullscreen generally).
446
447         * html/HTMLMediaElement.cpp:
448         (WebCore::HTMLMediaElement::visibilityStateChanged):
449
450 2017-06-22  Joseph Pecoraro  <pecoraro@apple.com>
451
452         Follow-up to r218662. Only log backtraces for DumpRenderTree.
453
454         Rubber-stamped by Antoine Quint.
455
456         * dom/ScriptedAnimationController.cpp:
457         (WebCore::ScriptedAnimationController::logSuspendCount):
458
459 2017-06-22  Charlie Turner  <cturner@igalia.com>
460
461         [GTK] Spreaker live shows won't play
462         https://bugs.webkit.org/show_bug.cgi?id=173306
463
464         Reviewed by Xabier Rodriguez-Calvar.
465
466         This was due to removing the code that negotiated caps for Icecast
467         streams based on the response headers in r191947. The problem is that
468         the typefind element can sometimes squint hard enough and see an MP3
469         stream and attempt to play it, resulting in garbled audio playback. More
470         commonly typefind fails to recognize the Icecast stream and bails,
471         resulting in no playback at all.
472
473         r191947 also removed the emission of metadata into the pipeline. This
474         patch also leaves that out since we have no use for it within WebKit.
475
476         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
477         (StreamingClient::handleResponseReceived):
478
479 2017-06-22  Matt Lewis  <jlewis3@apple.com>
480
481         Unreviewed, rolling out r218633.
482
483         The test is failing frequently on Sierra Debug and Windows
484
485         Reverted changeset:
486
487         "AX: Cannot call setValue() on contenteditable or ARIA text
488         controls"
489         https://bugs.webkit.org/show_bug.cgi?id=173520
490         http://trac.webkit.org/changeset/218633
491
492 2017-06-22  Romain Bellessort  <romain.bellessort@crf.canon.fr>
493
494         [Readable Streams API] Implement ReadableStreamBYOBReader read()
495         https://bugs.webkit.org/show_bug.cgi?id=172714
496
497         Reviewed by Youenn Fablet.
498
499         Implemented read() method of ReadableStreamBYOBReader [1]. Also added code related 
500         to BYOB features that were previously described as FIXMEs and that now become reachable.
501
502         In addition, WPT tests that involve read() have allowed to identify 2 bugs not directly 
503         related to read() (172716 and 172717). They will be fixed distinctly. Once done, all WPT
504         tests should pass.
505
506         [1] https://streams.spec.whatwg.org/#byob-reader-read
507
508         WPT tests (web-platform-tests/streams/readable-byte-streams/general.js) already cover
509         most cases for read() usage. Corresponding expectations have been updated. In addition,
510         1 test has been added to WebKit tests (in streams/readable-stream-byob-reader.js) to 
511         check that read() can only be applied to a ReadableStreamBYOBReader.
512
513         * Modules/streams/ReadableByteStreamInternals.js:
514         (readableByteStreamControllerClearPendingPullIntos): Implemented.
515         (readableByteStreamControllerEnqueue): Updated with support for BYOBReader.
516         (readableByteStreamControllerPullInto): Added.
517         (readableStreamAddReadIntoRequest): Added.
518         * Modules/streams/ReadableStreamBYOBReader.js:
519         (read): Added.
520
521 2017-06-22  Youenn Fablet  <youenn@apple.com>
522
523         [WebRTC] Prevent capturing at unconventional resolutions when using the SW encoder on Mac
524         https://bugs.webkit.org/show_bug.cgi?id=172602
525         <rdar://problem/32407693>
526
527         Reviewed by Eric Carlson.
528
529         Test: platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html
530
531         Add internal API to switch on/off hardware H264 encoder.
532         Add checks for standard size. If using a software encoder and frame size is not standard,
533         the session is destroyed and no frame is sent at all.
534
535         Added tests based on captureStream.
536         Fixed the case of capturing a canvas which size is changing.
537
538         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
539         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
540         * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.h:
541         * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.mm:
542         (WebCore::H264VideoToolboxEncoder::setHardwareEncoderForWebRTCAllowed):
543         (WebCore::H264VideoToolboxEncoder::hardwareEncoderForWebRTCAllowed):
544         (WebCore::isUsingSoftwareEncoder):
545         (WebCore::H264VideoToolboxEncoder::CreateCompressionSession):
546         (isStandardFrameSize): Added.
547         (isUsingSoftwareEncoder): Added.
548         * testing/Internals.cpp:
549         (WebCore::Internals::setH264HardwareEncoderAllowed):
550         * testing/Internals.h:
551         * testing/Internals.idl:
552
553 2017-06-21  Youenn Fablet  <youenn@apple.com>
554
555         [Fetch API] TypeError when called with body === {}
556         https://bugs.webkit.org/show_bug.cgi?id=173295
557         <rdar://problem/32746733>
558
559         Reviewed by Sam Weinig.
560
561         Test: fetch/body-init.html
562
563         Handling body of Request and Response using binding generator to correctly handle unions.
564         The biggest change is that any value that is not a specific type in the union will match a String.
565         This is matching WebIDL spec and Firefox behavior.
566
567         Handling of ReadableStream bodies remains in JS builtin for Response.
568         This allows easier handling cloning and consumption of body.
569         Adding setBodyAsReadableStream since this is no longer handled by extractBody.
570
571         * Modules/fetch/FetchBody.cpp:
572         (WebCore::FetchBody::extract): Using Variant instead of JSC::JSValue.
573         (WebCore::FetchBody::readableStreamBody): Introduced to handle the
574         case of readable stream bodies.
575         * Modules/fetch/FetchBody.h:
576         * Modules/fetch/FetchBodyOwner.cpp:
577         (WebCore::FetchBodyOwner::extractBody):
578         * Modules/fetch/FetchBodyOwner.h:
579         (WebCore::FetchBodyOwner::setBody):
580         * Modules/fetch/FetchRequest.cpp:
581         (WebCore::FetchRequest::setBody): Splitting setBody for ease of readability.
582         (WebCore::FetchRequest::setBodyFromInputRequest):
583         * Modules/fetch/FetchRequest.h:
584         * Modules/fetch/FetchRequest.idl:
585         * Modules/fetch/FetchRequest.js:
586         (initializeFetchRequest):
587         * Modules/fetch/FetchResponse.cpp:
588         (WebCore::FetchResponse::initializeWith):
589         (WebCore::FetchResponse::setBodyAsReadableStream):
590         * Modules/fetch/FetchResponse.h:
591         * Modules/fetch/FetchResponse.idl:
592         * Modules/fetch/FetchResponse.js:
593         (initializeFetchResponse):
594         * WebCore.xcodeproj/project.pbxproj:
595         * bindings/js/WebCoreBuiltinNames.h:
596
597 2017-06-21  Simon Fraser  <simon.fraser@apple.com>
598
599         Add z-index to compositing logging output
600         https://bugs.webkit.org/show_bug.cgi?id=173684
601
602         Reviewed by Zalan Bujtas.
603
604         Show z-index, which is often useful to find negative z-index items.
605
606         Log "+foreground" rather than "foreground" to indicate that this layer has an
607         additional foreground/background layer, and fix spacing.
608
609         * rendering/RenderLayerCompositor.cpp:
610         (WebCore::RenderLayerCompositor::logLayerInfo):
611
612 2017-06-21  Chris Dumez  <cdumez@apple.com>
613
614         Unreviewed, fix Window Debug build after r218660.
615
616         * rendering/SimpleLineLayout.cpp:
617         (WebCore::SimpleLineLayout::canUseForWithReason):
618
619 2017-06-21  Andreas Kling  <akling@apple.com>
620
621         Increase memory kill limits for WebContent processes that manage multiple tabs.
622         https://bugs.webkit.org/show_bug.cgi?id=173674
623
624         Reviewed by Geoffrey Garen.
625
626         Plumb the non-utility Page count down to WTF::MemoryPressureHandler.
627
628         * page/Page.cpp:
629         (WebCore::Page::Page):
630         (WebCore::Page::~Page):
631
632 2017-06-21  Jiewen Tan  <jiewen_tan@apple.com>
633
634         [WebCrypto] Restore ordering of CryptoAlgorithmIdentifier in SerializedScriptValue
635         https://bugs.webkit.org/show_bug.cgi?id=173678
636         <rdar://problem/32879314>
637
638         Reviewed by Sam Weinig.
639
640         r218030 reorders the ordering of CryptoAlgorithmIdentifier in SerializedScriptValue,
641         which introduces backward compatibility issues with CryptoKey objects stored in the
642         IndexedDB. Hence, we should restore it back.
643
644         No tests.
645
646         * bindings/js/SerializedScriptValue.cpp:
647
648 2017-06-21  Daniel Bates  <dabates@apple.com>
649
650         Change FrameLoadRequest from a struct to a class
651
652         FrameLoadRequest is underutilizing the purpose of a struct - default visibility of
653         members is public, as FrameLoadRequest explicitly groups its members under public:
654         or private: sections. Maybe in the future we can make FrameLoadRequest a struct
655         with only public members. For now, we should consider FrameLoadRequest a class.
656
657         * loader/FormSubmission.h:
658         * loader/FrameLoadRequest.h:
659         * loader/FrameLoader.h:
660         * page/Chrome.h:
661         * page/ChromeClient.h:
662         * replay/UserInputBridge.h:
663
664 2017-06-21  Daewoong Jang  <daewoong.jang@navercorp.com>
665
666         Compiler error while building with !HAVE(ACCESSIBILITY)
667         https://bugs.webkit.org/show_bug.cgi?id=173670
668
669         Reviewed by Chris Fleizach.
670
671         * accessibility/AXObjectCache.h:
672         (WebCore::AXObjectCache::getOrCreate):
673         (WebCore::AXObjectCache::childrenChanged):
674
675 2017-06-21  Antoine Quint  <graouts@apple.com>
676
677         Build fix.
678
679         Reviewed by Tim "Mr. T" Horton.
680
681         * dom/ScriptedAnimationController.cpp:
682         (WebCore::ScriptedAnimationController::logSuspendCount):
683         * page/Page.cpp:
684         (WebCore::Page::suspendScriptedAnimations):
685         (WebCore::Page::resumeScriptedAnimations):
686
687 2017-06-21  Antoine Quint  <graouts@apple.com>
688
689         Ensure DRT always logs rAF suspension debugging code
690         https://bugs.webkit.org/show_bug.cgi?id=173681
691
692         Reviewed by Tim "Mr. T" Horton.
693
694         Instead of using a setting to check whether we should log information related to rAF
695         callbacks being suspended with WK1, we now check whether we're using in DRT to avoid
696         any potential issue with settings being in the incorrect state when a test is run.
697
698         * dom/ScriptedAnimationController.cpp:
699         (WebCore::ScriptedAnimationController::logSuspendCount):
700         * page/Page.cpp:
701         (WebCore::Page::suspendScriptedAnimations):
702         (WebCore::Page::resumeScriptedAnimations):
703         * page/Settings.in:
704         * platform/RuntimeApplicationChecks.h:
705         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
706         (WebCore::MacApplication::isDumpRenderTree):
707
708 2017-06-21  Chris Dumez  <cdumez@apple.com>
709
710         Allow constructing a WTF:Function from a function pointer
711         https://bugs.webkit.org/show_bug.cgi?id=173660
712
713         Reviewed by Alex Christensen.
714
715         Construct WTF:Function directly from a function pointer when possible
716         instead of constructing a lambda to do so.
717
718         * Modules/encryptedmedia/InitDataRegistry.cpp:
719         (WebCore::InitDataRegistry::InitDataRegistry):
720         * page/Page.cpp:
721         * page/mac/PageMac.mm:
722         (WebCore::Page::platformInitialize):
723         * platform/cf/MainThreadSharedTimerCF.cpp:
724         (WebCore::setupPowerObserver):
725         * platform/mac/WebCoreNSURLExtras.mm:
726         * rendering/SimpleLineLayout.cpp:
727         (WebCore::SimpleLineLayout::canUseForWithReason):
728         * workers/Worker.cpp:
729         (WebCore::Worker::Worker):
730
731 2017-06-21  Antoine Quint  <graouts@apple.com>
732
733         CSS text properties affect <video> shadow root
734         https://bugs.webkit.org/show_bug.cgi?id=173664
735         <rdar://problem/32904328>
736
737         Reviewed by Dean Jackson.
738
739         Ensure that we reset all inheritable styles back to their initial value for media shadow roots.
740
741         Test: media/modern-media-controls/time-label/time-label-inherited-text-indent.html
742
743         * Modules/modern-media-controls/controls/media-controls.css:
744         (.media-controls-container):
745
746 2017-06-20  Simon Fraser  <simon.fraser@apple.com>
747
748         Remove WILL_REVEAL_EDGE_EVENTS code
749         https://bugs.webkit.org/show_bug.cgi?id=173632
750
751         Reviewed by Sam Weinig, Beth Dakin.
752
753         Remove will-reveal-edge events, which never took off.
754
755         * dom/Document.cpp:
756         (WebCore::Document::clearScriptedAnimationController):
757         (WebCore::Document::sendWillRevealEdgeEventsIfNeeded): Deleted.
758         * dom/Document.h:
759         * dom/GlobalEventHandlers.idl:
760         * html/HTMLBodyElement.idl:
761         * html/HTMLFrameSetElement.idl:
762         * page/FrameView.cpp:
763         (WebCore::FrameView::scrollPositionChanged):
764         * rendering/RenderLayer.cpp:
765         (WebCore::RenderLayer::scrollTo):
766
767 2017-06-21  Daniel Bates  <dabates@apple.com>
768
769         Cleanup FrameLoadRequest
770         https://bugs.webkit.org/show_bug.cgi?id=173564
771         <rdar://problem/32903570>
772
773         Reviewed by Brent Fulgham.
774
775         FrameLoadRequest has too many constructors. Use default values to reduce the number of
776         constructors. Have FrameLoadRequest hold a Ref<SecurityOrigin> instead of a RefPtr<SecurityOrigin>
777         as FrameLoadRequest must always hold a valid SecurityOrigin, the security origin of the
778         document that initiated the request.
779
780         * inspector/InspectorFrontendClientLocal.cpp:
781         (WebCore::InspectorFrontendClientLocal::openInNewTab): Explicitly pass the null-string for
782         the target frame name as we do not have one. Use C++11 brace initialization syntax and ASCIILiteral().
783         Rename local variable from request to frameLoadRequest to better describe its purpose. Fix up
784         FIXME comment added in r105600 to better describe the issue we should fix as the code as
785         changed since the FIXME was added.
786         * inspector/InspectorPageAgent.cpp:
787         (WebCore::InspectorPageAgent::navigate): No need to pass ShouldReplaceDocumentIfJavaScriptURL::ReplaceDocumentIfJavaScriptURL
788         now that the FrameLoadRequests constructor uses this policy by default. Use C++11 brace
789         initialization syntax and ASCIILiteral(). Rename local variable from frameRequest to frameLoadRequest
790         to better describe its purpose.
791         * loader/FrameLoadRequest.cpp:
792         (WebCore::FrameLoadRequest::FrameLoadRequest): Use C++11 brace initialization syntax.
793         * loader/FrameLoadRequest.h: Remove many constructor overloads. Changed m_requester from
794         RefPtr<SecurityOrigin> to Ref<SecurityOrigin> as we can never be instantiated with a null
795         SecurityOrigin. Moved m_shouldCheckNewWindowPolicy to be under ShouldOpenExternalURLsPolicy
796         to reduce the size of the class by 8 bytes.
797         * loader/FrameLoadRequest.h:
798         (WebCore::FrameLoadRequest::FrameLoadRequest): Added copy constructor as we must use Ref::copyRef()
799         to copy the Ref<SecurityOrigin>.
800         (WebCore::FrameLoadRequest::requester): Return a const SecurityOrigin& instead of a const SecurityOrigin*.
801         * loader/FrameLoader.cpp:
802         (WebCore::FrameLoader::urlSelected): Update now that the order of the ShouldReplaceDocumentIfJavaScriptURL
803         and ShouldOpenExternalURLsPolicy arguments in the FrameLoadRequest constructor has changed.
804         (WebCore::FrameLoader::loadURLIntoChildFrame): Ditto. Also use C++11 brace initialization syntax
805         and ASCIILiteral().
806         (WebCore::FrameLoader::loadFrameRequest): Update code now that FrameLoadRequest::requester() returns a
807         SecurityOrigin& instead of a SecurityOrigin*. Use C++11 brace initialization syntax.
808         * loader/NavigationScheduler.cpp:
809         (WebCore::NavigationScheduler::scheduleLocationChange): Use C++11 brace initialization syntax.
810         Rename local variable from frameRequest to frameLoadRequest to better describe its purpose.
811         * page/ContextMenuController.cpp:
812         (WebCore::openNewWindow):
813         (WebCore::ContextMenuController::contextMenuItemSelected): ove FrameLoadRequest instantiation
814         into a local variable and use C++11 brace initialization syntax to make it easier to identify
815         the arguments passed to FrameLoader::loadFrameRequest().
816         * page/DOMWindow.cpp:
817         (WebCore::DOMWindow::createWindow): Update now that the order of the ShouldReplaceDocumentIfJavaScriptURL
818         and ShouldOpenExternalURLsPolicy arguments in the FrameLoadRequest constructor has changed.
819         Use C++11 brace initialization syntax and ASCIILiteral(). Rename some local variables to better
820         describe their purpose.
821
822 2017-06-20  Simon Fraser  <simon.fraser@apple.com>
823
824         svgPath.getTotalLength() freezes webkit
825         https://bugs.webkit.org/show_bug.cgi?id=173566
826         <rdar://problem/32866731>
827
828         Reviewed by Dean Jackson.
829
830         Ensure that curveLength() progresses by making split() return a bool indicating
831         whether either of the resulting curves are the same as the original. This can happen
832         when midPoint() on two close points returns a point that is the same as one of the
833         arguments because of floating-point precision limitations.
834
835         Test: svg/custom/path-getTotalLength-hang.html
836
837         * platform/graphics/PathTraversalState.cpp:
838         (WebCore::QuadraticBezier::operator ==):
839         (WebCore::QuadraticBezier::split):
840         (WebCore::CubicBezier::operator ==):
841         (WebCore::CubicBezier::split):
842         (WebCore::curveLength):
843
844 2017-06-21  Youenn Fablet  <youenn@apple.com>
845
846         Fix AVVideoCaptureSource frameRate setter and getter
847         https://bugs.webkit.org/show_bug.cgi?id=173637
848
849         Reviewed by Eric Carlson.
850
851         Covered by manual testing.
852
853         Using activeVideoMaxFrameDuration to get the frame rate.
854         Setting the frame rate according the given vale if in the allowed range.
855
856         * platform/mediastream/mac/AVVideoCaptureSource.h:
857         * platform/mediastream/mac/AVVideoCaptureSource.mm:
858         (WebCore::AVVideoCaptureSource::updateSettings):
859         (WebCore::AVVideoCaptureSource::applyFrameRate):
860         (WebCore::AVVideoCaptureSource::applySizeAndFrameRate):
861         (WebCore::AVVideoCaptureSource::shutdownCaptureSession):
862         (WebCore::AVVideoCaptureSource::processNewFrame):
863         (WebCore::AVVideoCaptureSource::updateFramerate): Deleted.
864
865 2017-06-21  Youenn Fablet  <youenn@apple.com>
866
867         Refresh libwebrtc code up to a87675d4a160e2c49c3e754cd9ca291d6c8f36ae
868         https://bugs.webkit.org/show_bug.cgi?id=173602
869
870         Reviewed by Eric Carlson.
871
872         No feature change.
873
874         Updated according small libwebrtc API changes.
875
876         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
877         (WebCore::configurationFromMediaEndpointConfiguration):
878         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
879         (WebCore::RealtimeIncomingVideoSource::pixelBufferFromVideoFrame):
880         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
881         (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
882         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
883
884 2017-06-21  Sam Weinig  <sam@webkit.org>
885
886         Add support for structured serialization of CSS Geometry types
887         https://bugs.webkit.org/show_bug.cgi?id=173631
888
889         Reviewed by Simon Fraser.
890
891         Tests: imported/w3c/web-platform-tests/css/geometry-1/structured-serialization.html
892
893         Adds support for serializing the new geometry types as specified by:
894         https://drafts.fxtf.org/geometry-1/#structured-serialization
895
896         * WebCore.xcodeproj/project.pbxproj:
897         Move a few custom bindings into the "GC / Wrapping Only" since they have no more custom operations or attributes.
898
899         * bindings/js/SerializedScriptValue.cpp:
900         (WebCore::CloneSerializer::dumpDOMPoint):
901         (WebCore::CloneSerializer::dumpDOMRect):
902         (WebCore::CloneSerializer::dumpDOMMatrix):
903         (WebCore::CloneSerializer::dumpDOMQuad):
904         (WebCore::CloneSerializer::dumpIfTerminal):
905         (WebCore::CloneDeserializer::getJSValue):
906         (WebCore::CloneDeserializer::readDOMPoint):
907         (WebCore::CloneDeserializer::readDOMMatrix):
908         (WebCore::CloneDeserializer::readDOMRect):
909         (WebCore::CloneDeserializer::readDOMPointInit):
910         (WebCore::CloneDeserializer::readDOMQuad):
911         (WebCore::CloneDeserializer::readTerminal):
912         Add serialization/deserialization of the geometry types.
913
914         * css/DOMMatrix.cpp:
915         (WebCore::DOMMatrix::DOMMatrix):
916         * css/DOMMatrix.h:
917         (WebCore::DOMMatrix::create):
918         * css/DOMMatrixReadOnly.cpp:
919         (WebCore::DOMMatrixReadOnly::DOMMatrixReadOnly):
920         * css/DOMMatrixReadOnly.h:
921         (WebCore::DOMMatrixReadOnly::create):
922         Add create functions and constructors that take a TransformationMatrix by r-value reference
923         so they can be moved into the DOM type.
924
925 2017-06-21  Andreas Kling  <akling@apple.com>
926
927         [iOS] Ensure that GraphicsServices is initialized before calling GSFontPurgeFontCache().
928         https://bugs.webkit.org/show_bug.cgi?id=173616
929         <rdar://problem/30780050>
930
931         Reviewed by Chris Dumez.
932
933         Fix for crash in GSFontPurgeFontCache() seen in apps embedding WebKit.
934         Ensure GSFontInitialize() has been called first, since the former depends on state
935         set up by this function.
936
937         * page/cocoa/MemoryReleaseCocoa.mm:
938         (WebCore::platformReleaseMemory):
939         * platform/spi/ios/GraphicsServicesSPI.h:
940
941 2017-06-21  Antoine Quint  <graouts@apple.com>
942
943         Add logging to identify when the Page suspends scripted animations
944         https://bugs.webkit.org/show_bug.cgi?id=173626
945
946         Reviewed by Tim Horton.
947
948         We have a longstanding issue that some media/modern-media-controls tests time out due to
949         requestAnimationFrame callbacks not being serviced, which is tracked by webkit.org/b/173628.
950         We added some logging to identify when ScriptedAnimationController would get suspended in
951         webkit.org/b/173326. This logging points to the fact that the reason rAF callbacks aren't
952         serviced is because Document::requestAnimationFrame() suspends rAF when the page reports
953         that scripted animations ought to be suspended, which is true when m_scriptedAnimationsSuspended
954         is true. This patch adds logging that tracks when this flag is set, provided a new setting
955         shouldLogScriptedAnimationControllerSuspensionChange is true.
956
957         * dom/ScriptedAnimationController.cpp:
958         (WebCore::ScriptedAnimationController::logSuspendCount):
959         * page/Page.cpp:
960         (WebCore::Page::suspendScriptedAnimations):
961         (WebCore::Page::resumeScriptedAnimations):
962         * page/Settings.in:
963
964 2017-06-21  Basuke Suzuki  <Basuke.Suzuki@sony.com>
965
966         [Curl] Extract CurlDownloadManager as shared background task handler
967         https://bugs.webkit.org/show_bug.cgi?id=173557
968
969         Curl resource handling should be shared by other part of Curl
970         network stack. CurlDownloadManager is extracted as stand alone
971         CurlManager singleton class to be ready for others
972         (i.e. ResourceHandle).
973
974         Reviewed by Alex Christensen.
975
976         * PlatformWinCairo.cmake:
977         * platform/network/curl/CookieJarCurl.cpp:
978         (WebCore::setCookiesFromDOM):
979         (WebCore::cookiesForSession):
980         * platform/network/curl/CurlDownload.cpp:
981         (WebCore::CurlDownload::init):
982         (WebCore::CurlDownload::start):
983         (WebCore::CurlDownload::cancel):
984         (WebCore::CurlDownload::didReceiveHeader):
985         (WebCore::CurlDownload::handleCurlMsg):
986         (WebCore::CurlDownloadManager::CurlDownloadManager): Deleted.
987         (WebCore::CurlDownloadManager::~CurlDownloadManager): Deleted.
988         (WebCore::CurlDownloadManager::add): Deleted.
989         (WebCore::CurlDownloadManager::remove): Deleted.
990         (WebCore::CurlDownloadManager::getActiveDownloadCount): Deleted.
991         (WebCore::CurlDownloadManager::getPendingDownloadCount): Deleted.
992         (WebCore::CurlDownloadManager::startThreadIfNeeded): Deleted.
993         (WebCore::CurlDownloadManager::stopThread): Deleted.
994         (WebCore::CurlDownloadManager::stopThreadIfIdle): Deleted.
995         (WebCore::CurlDownloadManager::updateHandleList): Deleted.
996         (WebCore::CurlDownloadManager::addToCurl): Deleted.
997         (WebCore::CurlDownloadManager::removeFromCurl): Deleted.
998         (WebCore::CurlDownloadManager::downloadThread): Deleted.
999         * platform/network/curl/CurlDownload.h:
1000         (WebCore::CurlDownloadManager::getMultiHandle): Deleted.
1001         (WebCore::CurlDownloadManager::runThread): Deleted.
1002         (WebCore::CurlDownloadManager::setRunThread): Deleted.
1003         * platform/network/curl/CurlManager.cpp: Added.
1004         (WebCore::CurlManager::CurlManager):
1005         (WebCore::CurlManager::~CurlManager):
1006         (WebCore::CurlManager::add):
1007         (WebCore::CurlManager::remove):
1008         (WebCore::CurlManager::getActiveCount):
1009         (WebCore::CurlManager::getPendingCount):
1010         (WebCore::CurlManager::startThreadIfNeeded):
1011         (WebCore::CurlManager::stopThread):
1012         (WebCore::CurlManager::stopThreadIfIdle):
1013         (WebCore::CurlManager::updateHandleList):
1014         (WebCore::CurlManager::addToCurl):
1015         (WebCore::CurlManager::removeFromCurl):
1016         (WebCore::CurlManager::workerThread):
1017         (WebCore::CurlUtils::getEffectiveURL):
1018         (WebCore::CurlSharedResources::mutexFor):
1019         (WebCore::CurlSharedResources::lock):
1020         (WebCore::CurlSharedResources::unlock):
1021         * platform/network/curl/CurlManager.h: Added.
1022         (WebCore::CurlManager::singleton):
1023         (WebCore::CurlManager::getCurlShareHandle):
1024         (WebCore::CurlManager::getMultiHandle):
1025         (WebCore::CurlManager::runThread):
1026         (WebCore::CurlManager::setRunThread):
1027         * platform/network/curl/ResourceHandleManager.cpp:
1028         (WebCore::ResourceHandleManager::ResourceHandleManager):
1029         (WebCore::ResourceHandleManager::~ResourceHandleManager):
1030         (WebCore::handleLocalReceiveResponse):
1031         (WebCore::getProtectionSpace):
1032         (WebCore::headerCallback):
1033         (WebCore::ResourceHandleManager::downloadTimerCallback):
1034         (WebCore::getCurlEffectiveURL): Deleted.
1035         (WebCore::sharedResourceMutex): Deleted.
1036         (WebCore::curl_lock_callback): Deleted.
1037         (WebCore::curl_unlock_callback): Deleted.
1038         (WebCore::ResourceHandleManager::getCurlShareHandle): Deleted.
1039         * platform/network/curl/ResourceHandleManager.h:
1040
1041 2017-06-21  Jeremy Jones  <jeremyj@apple.com>
1042
1043         Include audio/vnd.wave as a valid mime-type for wav files.
1044         https://bugs.webkit.org/show_bug.cgi?id=173635
1045         rdar://problem/32656568
1046
1047         Reviewed by Eric Carlson.
1048
1049         audio/vnd.wave is a valid mime-type for wav files per https://tools.ietf.org/html/rfc2361
1050
1051         Updated test and test results:
1052         LayoutTests/media/media-can-play-wav-audio.html
1053
1054         * platform/MIMETypeRegistry.cpp:
1055         (WebCore::initializeSupportedImageMIMETypes):
1056         (WebCore::mimeTypeAssociationMap):
1057         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1058         (WebCore::MediaPlayerPrivateAVFoundation::staticMIMETypeList):
1059         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1060         (WebCore::mimeTypeSet):
1061
1062 2017-06-21  Chris Fleizach  <cfleizach@apple.com>
1063
1064         AX: Cannot call setValue() on contenteditable or ARIA text controls
1065         https://bugs.webkit.org/show_bug.cgi?id=173520
1066
1067         Reviewed by Ryosuke Niwa.
1068
1069         Add support for changing the value of a contenteditable and any other aria text control in setValue().
1070  
1071         Test: accessibility/set-value-editable-types.html
1072
1073         * accessibility/AccessibilityRenderObject.cpp:
1074         (WebCore::AccessibilityRenderObject::setValue):
1075
1076 2017-06-20  Zan Dobersek  <zdobersek@igalia.com>
1077
1078         [GCrypt] Implement CryptoKeyEC SPKI imports
1079         https://bugs.webkit.org/show_bug.cgi?id=172927
1080
1081         Reviewed by Jiewen Tan, Michael Catanzaro and Carlos Garcia Campos.
1082
1083         No new tests -- affected tests are now passing and are unskipped.
1084
1085         Implement libgcrypt-based support for SPKI imports of EC keys.
1086
1087         Using libtasn1 through the utility functions and wrappers, the given key data
1088         is decoded against the SubjectPublicKeyInfo ASN.1 definition. The algorithm
1089         member is then properly validated, making sure that the key algorithm idenfitier
1090         is supported and that the algorithm parameters specify the correct EC curve.
1091
1092         The public key bit string is then retrieved and validated, ensuring it represents
1093         an uncompressed EC point that is of valid size for the specified EC curve. The
1094         point is then tested through an EC context to make sure it's positioned on the
1095         specified EC curve.
1096
1097         Finally, the curve name and uncompressed point data are embedded into a
1098         `public-key` s-expression that will be used through the libgcrypt API. This is
1099         then used, along with other information, to create a valid CryptoKeyEC object.
1100
1101         * PlatformGTK.cmake: Use LIBTASN1_INCLUDE_DIRECTORIES and LIBTASN1_LIBRARIES.
1102         * PlatformWPE.cmake: Ditto.
1103         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
1104         (WebCore::supportedAlgorithmIdentifier):
1105         (WebCore::curveForIdentifier):
1106         (WebCore::CryptoKeyEC::platformImportSpki):
1107
1108 2017-06-20  Devin Rousso  <drousso@apple.com>
1109
1110         WebGPU contexts should have a back reference to the canvas element
1111         https://bugs.webkit.org/show_bug.cgi?id=173633
1112
1113         Reviewed by Jon Lee.
1114
1115         No tests added, as this is already implemented within other canvas types.
1116
1117         * html/canvas/WebGPURenderingContext.idl:
1118
1119 2017-06-20  Youenn Fablet  <youenn@apple.com>
1120
1121         WebAudioSourceProvider should be thread safe ref counted
1122         https://bugs.webkit.org/show_bug.cgi?id=173623
1123
1124         Reviewed by Eric Carlson.
1125
1126         No observable change of behavior.
1127
1128         * platform/mediastream/WebAudioSourceProvider.h:
1129
1130 2017-06-20  Yoav Weiss  <yoav@yoav.ws>
1131
1132         [preload] Turn on preload's feature flag by default.
1133         https://bugs.webkit.org/show_bug.cgi?id=173139
1134
1135         Reviewed by Youenn Fablet.
1136
1137         Turn on the runtime enabled feature flag for link preload by default.
1138
1139         No new tests as this just turns on a feature that was already on-by-default for tests.
1140
1141         * page/RuntimeEnabledFeatures.h:
1142
1143 2017-06-20  Myles C. Maxfield  <mmaxfield@apple.com>
1144
1145         Disable font variations on macOS Sierra and iOS 10
1146         https://bugs.webkit.org/show_bug.cgi?id=173618
1147         <rdar://problem/32879164>
1148
1149         Reviewed by Jon Lee.
1150
1151         On macOS Sierra and iOS 10, there are some platform problems involved with font variations. They
1152         were previously enabled on those OSes just as a preview development tool. These platform bugs have
1153         been fixed in macOS High Sierra and iOS 11, so we should align our feature flags with the eventual
1154         configurations.
1155
1156         * Configurations/FeatureDefines.xcconfig:
1157         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1158         (WebCore::defaultVariationValues):
1159         (WebCore::preparePlatformFont):
1160
1161 2017-06-20  Devin Rousso  <drousso@apple.com>
1162
1163         Web Inspector: Send context attributes for tracked canvases
1164         https://bugs.webkit.org/show_bug.cgi?id=173327
1165
1166         Reviewed by Joseph Pecoraro.
1167
1168         Test: inspector/canvas/context-attributes.html
1169
1170         * inspector/InspectorCanvasAgent.cpp:
1171         (WebCore::InspectorCanvasAgent::buildObjectForCanvas):
1172
1173 2017-06-20  Myles C. Maxfield  <mmaxfield@apple.com>
1174
1175         [Cocoa] The system Japanese font cannot be italicized
1176         https://bugs.webkit.org/show_bug.cgi?id=173300
1177         <rdar://problem/31805407>
1178
1179         Reviewed by Ryosuke Niwa.
1180
1181         Items in the system font cascade list may lie about whether or not they support italics.
1182         In order to get the truth, we need to use the physical font underlying the font in question,
1183         because this one won't lie. Then, we can interrogate this physical font about its traits
1184         in order to synthesize italics correctly.
1185
1186         Test: fast/text/system-font-japanese-synthetic-italic.html
1187
1188         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1189         (WebCore::lookupFallbackFont):
1190         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
1191         (WebCore::FontFamilySpecificationCoreText::fontRanges):
1192
1193 2017-06-20  Chris Dumez  <cdumez@apple.com>
1194
1195         Use WTF::Function instead of std::function in more places in WebCore/
1196         https://bugs.webkit.org/show_bug.cgi?id=173583
1197
1198         Reviewed by Darin Adler.
1199
1200         Use WTF::Function instead of std::function in more places in WebCore/ to
1201         reduce copying.
1202
1203         * page/Page.cpp:
1204         * platform/HysteresisActivity.h:
1205         (WebCore::HysteresisActivity::HysteresisActivity):
1206         * platform/Logging.cpp:
1207         (WebCore::registerNotifyCallback):
1208         * platform/Logging.h:
1209         * platform/MainThreadSharedTimer.cpp:
1210         (WebCore::MainThreadSharedTimer::setFiredFunction):
1211         * platform/MainThreadSharedTimer.h:
1212         * platform/PlatformPasteboard.h:
1213         * platform/ScopeGuard.h:
1214         (WebCore::ScopeGuard::ScopeGuard):
1215         (WebCore::ScopeGuard::enable):
1216         * platform/ScrollAnimationSmooth.cpp:
1217         (WebCore::ScrollAnimationSmooth::ScrollAnimationSmooth):
1218         * platform/ScrollAnimationSmooth.h:
1219         * platform/SharedTimer.h:
1220         * platform/audio/PlatformMediaSessionManager.cpp:
1221         (WebCore::PlatformMediaSessionManager::currentSessionsMatching):
1222         * platform/audio/PlatformMediaSessionManager.h:
1223         * platform/cf/MainThreadSharedTimerCF.cpp:
1224         (WebCore::setupPowerObserver):
1225         * platform/cf/RunLoopObserver.h:
1226         (WebCore::RunLoopObserver::RunLoopObserver):
1227         * platform/graphics/GraphicsContext.h:
1228         * platform/graphics/GraphicsLayer.cpp:
1229         (WebCore::GraphicsLayer::traverse):
1230         * platform/graphics/GraphicsLayer.h:
1231         * platform/graphics/MediaPlayer.cpp:
1232         (WebCore::addMediaEngine):
1233         * platform/graphics/MediaPlayer.h:
1234         * platform/graphics/Path.h:
1235         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1236         (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted):
1237         (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
1238         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
1239         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1240         (WebCore::MediaPlayerPrivateAVFoundation::Notification::Notification):
1241         (WebCore::MediaPlayerPrivateAVFoundation::Notification::function):
1242         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1243         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1244         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1245         (WebCore::runWithoutAnimations):
1246         * platform/graphics/cocoa/IOSurface.h:
1247         * platform/graphics/cocoa/IOSurface.mm:
1248         (WebCore::IOSurface::convertToFormat):
1249         * platform/graphics/gstreamer/MainThreadNotifier.h:
1250         * platform/graphics/gstreamer/MediaPlayerRequestInstallMissingPluginsCallback.h:
1251         (WebCore::MediaPlayerRequestInstallMissingPluginsCallback::create):
1252         (WebCore::MediaPlayerRequestInstallMissingPluginsCallback::MediaPlayerRequestInstallMissingPluginsCallback):
1253         * platform/graphics/win/GraphicsContextDirect2D.cpp:
1254         (WebCore::GraphicsContext::drawWithoutShadow):
1255         (WebCore::GraphicsContext::drawWithShadow):
1256         * platform/gtk/PasteboardHelper.cpp:
1257         (WebCore::ClipboardSetData::ClipboardSetData):
1258         (WebCore::PasteboardHelper::writeClipboardContents):
1259         * platform/gtk/PasteboardHelper.h:
1260         * platform/gtk/PlatformPasteboardGtk.cpp:
1261         (WebCore::PlatformPasteboard::writeToClipboard):
1262         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
1263         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1264         (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
1265         (WebVideoFullscreenInterfaceAVKit::fullscreenMayReturnToInline):
1266         * platform/mac/PowerObserverMac.cpp:
1267         (WebCore::PowerObserver::PowerObserver):
1268         * platform/mac/PowerObserverMac.h:
1269         * platform/mac/WebCoreNSURLExtras.mm:
1270         (WebCore::isSecondLevelDomainNameAllowedByTLDRules):
1271         * platform/mediastream/CaptureDeviceManager.cpp:
1272         (CaptureDeviceManager::addCaptureDeviceChangedObserver):
1273         * platform/mediastream/CaptureDeviceManager.h:
1274         * platform/mediastream/RealtimeMediaSource.cpp:
1275         (WebCore::RealtimeMediaSource::scheduleDeferredTask):
1276         * platform/mediastream/RealtimeMediaSource.h:
1277         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
1278         (-[WebAVAudioSessionAvailableInputsListener initWithCallback:]):
1279         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1280         * platform/mock/ScrollAnimatorMock.cpp:
1281         (WebCore::ScrollAnimatorMock::ScrollAnimatorMock):
1282         * platform/mock/ScrollAnimatorMock.h:
1283         * platform/network/CookieStorage.h:
1284         * platform/network/NetworkStateNotifier.cpp:
1285         (WebCore::NetworkStateNotifier::addNetworkStateChangeListener):
1286         * platform/network/NetworkStateNotifier.h:
1287         * platform/network/NetworkStorageSession.cpp:
1288         (WebCore::NetworkStorageSession::forEach):
1289         * platform/network/NetworkStorageSession.h:
1290         * platform/network/cf/CookieStorageCFNet.cpp:
1291         (WebCore::cookieChangeCallbackMap):
1292         (WebCore::startObservingCookieChanges):
1293         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1294         (WebCore::callOnMainThreadAndWait):
1295         * platform/network/mac/CookieStorageMac.mm:
1296         (-[WebCookieStorageObjCAdapter startListeningForCookieChangeNotificationsWithCallback:]):
1297         (WebCore::startObservingCookieChanges):
1298         * platform/network/soup/CookieStorageSoup.cpp:
1299         (WebCore::startObservingCookieChanges):
1300         * platform/network/soup/SoupNetworkSession.cpp:
1301         (WebCore::SoupNetworkSession::checkTLSErrors):
1302         * platform/network/soup/SoupNetworkSession.h:
1303         * platform/sql/SQLiteDatabase.cpp:
1304         (WebCore::destroyCollationFunction):
1305         (WebCore::callCollationFunction):
1306         (WebCore::SQLiteDatabase::setCollationFunction):
1307         * platform/sql/SQLiteDatabase.h:
1308         * rendering/RenderLayerBacking.cpp:
1309         (WebCore::traverseVisibleNonCompositedDescendantLayers):
1310         * rendering/RenderListBox.cpp:
1311         (WebCore::RenderListBox::paintItem):
1312         * rendering/RenderListBox.h:
1313         * rendering/line/BreakingContext.h:
1314         (WebCore::BreakingContext::InlineIteratorHistory::push):
1315         (WebCore::BreakingContext::InlineIteratorHistory::update):
1316         * workers/Worker.cpp:
1317         (WebCore::Worker::Worker):
1318         * workers/WorkerRunLoop.cpp:
1319
1320 2017-06-20  Ryan Haddad  <ryanhaddad@apple.com>
1321
1322         Unreviewed, rolling out r218524.
1323
1324         This change broke internal builds.
1325
1326         Reverted changeset:
1327
1328         "[Cocoa] The system Japanese font cannot be italicized"
1329         https://bugs.webkit.org/show_bug.cgi?id=173300
1330         http://trac.webkit.org/changeset/218524
1331
1332 2017-06-20  Daniel Bates  <dabates@apple.com>
1333
1334         Have FrameLoadRequest takes a Frame& instead of a Frame*
1335         https://bugs.webkit.org/show_bug.cgi?id=173614
1336         <rdar://problem/32884890>
1337
1338         Reviewed by Brent Fulgham.
1339
1340         * loader/ContentFilter.cpp:
1341         (WebCore::ContentFilter::handleProvisionalLoadFailure):
1342         * loader/FrameLoadRequest.cpp:
1343         (WebCore::FrameLoadRequest::FrameLoadRequest):
1344         * loader/FrameLoadRequest.h:
1345         * page/DragController.cpp:
1346         (WebCore::DragController::performDragOperation):
1347
1348 2017-06-20  Daniel Bates  <dabates@apple.com>
1349
1350         Skip Content Security Policy check for a media request using standard schemes initiated from
1351         an element in user agent shadow tree
1352         https://bugs.webkit.org/show_bug.cgi?id=155505
1353         <rdar://problem/25169452>
1354
1355         Reviewed by Brent Fulgham.
1356
1357         This change makes the following tests pass on iOS 11:
1358             http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-video.html
1359             http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-audio.html
1360
1361         * loader/MediaResourceLoader.cpp:
1362         (WebCore::MediaResourceLoader::requestResource):
1363         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1364         (WebCore::WebCoreAVFResourceLoader::startLoading):
1365
1366 2017-06-20  Andreas Kling  <akling@apple.com>
1367
1368         Remove no-op calls to purge SQLite caches on memory pressure.
1369         <https://webkit.org/b/173604>
1370
1371         Reviewed by Chris Dumez.
1372
1373         The implementation of _sqlite3_purgeEligiblePagerCacheMemory() is empty
1374         since a few releases ago, so there's no point in calling it.
1375
1376         * page/MemoryRelease.cpp:
1377         (WebCore::registerMemoryReleaseNotifyCallbacks):
1378         (WebCore::registerSQLiteMemoryPressureHandler): Deleted.
1379         * page/MemoryRelease.h:
1380         * page/cocoa/MemoryReleaseCocoa.mm:
1381         (WebCore::platformReleaseMemory):
1382         (WebCore::registerSQLiteMemoryPressureHandler): Deleted.
1383         * platform/sql/SQLiteDatabase.cpp:
1384         (WebCore::initializeSQLiteIfNecessary):
1385
1386 2017-06-20  Devin Rousso  <drousso@apple.com>
1387
1388         Web Inspector: add console messages for WebGL shader compile and program link errors/warnings
1389         https://bugs.webkit.org/show_bug.cgi?id=143236
1390         <rdar://problem/20352149>
1391
1392         Reviewed by Dean Jackson.
1393
1394         Test: fast/canvas/webgl/shader-compile-logging.html
1395
1396         * html/canvas/WebGLRenderingContextBase.h:
1397         * html/canvas/WebGLRenderingContextBase.cpp:
1398         (WebCore::WebGLRenderingContextBase::checkFramebufferStatus):
1399         (WebCore::WebGLRenderingContextBase::compileShader):
1400         (WebCore::WebGLRenderingContextBase::recycleContext):
1401         (WebCore::WebGLRenderingContextBase::checkTextureCompleteness):
1402         (WebCore::WebGLRenderingContextBase::printToConsole):
1403         (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
1404         (WebCore::WebGLRenderingContextBase::synthesizeGLError):
1405         (WebCore::WebGLRenderingContextBase::printGLErrorToConsole): Deleted.
1406         (WebCore::WebGLRenderingContextBase::printWarningToConsole): Deleted.
1407         (WebCore::WebGLRenderingContextBase::printGLWarningToConsole): Deleted.
1408         Unify console logging helper functions to all follow the same path. Additionally, errors
1409         now generate stack traces. Shader compilation errors are now logged as well.
1410
1411         * dom/Document.h:
1412         * dom/Document.cpp:
1413         (WebCore::Document::addConsoleMessage):
1414         * dom/ScriptExecutionContext.h:
1415         (WebCore::ScriptExecutionContext::AddConsoleMessageTask::AddConsoleMessageTask):
1416         * page/PageConsoleClient.h:
1417         * page/PageConsoleClient.cpp:
1418         (WebCore::PageConsoleClient::addMessage):
1419         * workers/WorkerGlobalScope.h:
1420         Add new path for logging to the console that accepts a ConsoleMessage.
1421
1422 2017-06-20  Saam Barati  <sbarati@apple.com>
1423
1424         Unreviewed. Try to fix the build after r218594.
1425
1426         * dom/Document.h:
1427
1428 2017-06-20  Matt Lewis  <jlewis3@apple.com>
1429
1430         Unreviewed, rolling out r218530.
1431
1432         This revision caused multiple media stream test crashes on
1433         Debug builds.
1434
1435         Reverted changeset:
1436
1437         "Merge MediaDevicesRequest and MediaDevicesEnumerationRequest
1438         to tighten up code and object lifetime"
1439         https://bugs.webkit.org/show_bug.cgi?id=173527
1440         http://trac.webkit.org/changeset/218530
1441
1442 2017-06-19  Antoine Quint  <graouts@apple.com>
1443
1444         Media document experience with long-loading files is poor
1445         https://bugs.webkit.org/show_bug.cgi?id=173575
1446         <rdar://problem/32178119>
1447
1448         Reviewed by Dean Jackson.
1449
1450         In order to avoid showing media controls at a different size than that of the video when we've
1451         received enough information to determine whether it's audio or video and what the video frame size
1452         is, we do not show any UI until we have enough information to show the controls in their correct
1453         initial state. This works well with local files and fast-loading files, but does not work well with
1454         invalid files, which never load and fail to ever show any UI, and files that load slowly where there
1455         is no visible feedback that content will be visible.
1456
1457         Instead, we now default to showing audio controls in their loading state, which provides a seamless
1458         transition if we will be loading an audio file since the controls are initially in the correct state,
1459         and at least provide feedback that data is loading even if we eventually transition to a video layout.
1460
1461         Additionally, we remove the invalid placard background in case the media is invalid, showing only the
1462         crossed-out play icon in the center of the page in that state.
1463
1464         Tests: media/modern-media-controls/media-documents/media-document-invalid.html
1465                media/modern-media-controls/media-documents/media-document-video-with-initial-audio-layout.html
1466
1467         * Modules/modern-media-controls/controls/media-document.css:
1468         (:host(.media-document)): Remove "visibility: hidden" since we want the media controls to be visible
1469         at all times.
1470         (:host(.media-document.audio)): Add a little padding on the x-axis to ensure audio controls never snap
1471         directly to the edges of the window.
1472         (:host(.media-document.audio.iphone)): Remove the iPhone-specific styling since we moved it to the
1473         general case.
1474         (:host(.media-document.video.invalid) .placard): Remove the background from the invalid placard when
1475         showing invalid media.
1476         (:host(.media-document.ready)): Deleted.
1477         * Modules/modern-media-controls/media/audio-support.js:
1478         (AudioSupport.prototype.syncControl): Make sure we invalidate the media document layout when a media
1479         document's media type changes.
1480         * Modules/modern-media-controls/media/media-controller.js:
1481         (MediaController): Instantiate the controls prior to creating the MediaDocumentController since the
1482         MediaDocumentController will need to access the controls.
1483         * Modules/modern-media-controls/media/media-document-controller.js:
1484         (MediaDocumentController): Set the default layout for media controls for a media document to be audio
1485         and in the waiting state.
1486         (MediaDocumentController.prototype.layout): Toggle the "invalid", "audio" and "video" CSS classes for
1487         the next possible commit to the DOM, provided we have established the media document's media type.
1488         (MediaDocumentController.prototype.handleEvent): Deal with the "play" and "error" events to trigger
1489         a layout.
1490         (MediaDocumentController.prototype._mediaDocumentHasMetadata): Deleted.
1491         (MediaDocumentController.prototype._mediaDocumentHasSize): Deleted.
1492
1493 2017-06-20  Daniel Bates  <dabates@apple.com>
1494
1495         NavigationAction has too many constructors
1496         https://bugs.webkit.org/show_bug.cgi?id=173484
1497
1498         Reviewed by Brady Eidson.
1499
1500         A NavigationAction object is an immutable object that represents the details of a
1501         navigation, including the type of a navigation (e.g. link click), what triggered
1502         the navigation, and the external URL policy to use for the navigation. Over time
1503         the number of NavigationAction constructor overloads (not including copy/move
1504         constructors) has grown to 12 to support different combinations of details.
1505         We can use default values to reduce the number of constructors to 2 (not including
1506         copy/move constructors).
1507
1508         No behavior changed. So, no new tests.
1509
1510         * loader/FrameLoader.cpp:
1511         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): Pass NavigationType::Other when
1512         instantiating NavigationAction.
1513         (WebCore::FrameLoader::loadDifferentDocumentItem): Fix order of arguments now that
1514         the constructor overload that takes a NavigationType takes the Event* as the fourth argument,
1515         not the third. Also, use C++11 brace initialization syntax when instantiating a NavigationAction.
1516         (WebCore::createWindow):
1517         * loader/NavigationAction.cpp: Remove unnecessary #include of header ScriptController.h.
1518         Include header Event.h.
1519         (WebCore::NavigationAction::NavigationAction):
1520         * loader/NavigationAction.h: Forward declare class Event and remove #include of header Event.h.
1521         Make copy constructor, copy assignment operator, move constructor, and move assignment operator
1522         out-of-line to avoid the need to include header Event.h. Export the copy constructor so that it
1523         can be used from WebKit on the Apple Windows port. Move ShouldOpenExternalURLsPolicy to be after
1524         NavigationType to reduce the size of the class by 8 bytes.
1525         (WebCore::NavigationAction::NavigationAction):
1526         * loader/PolicyChecker.cpp: Include header Event.h.
1527         * page/Performance.cpp: Ditto.
1528         * replay/ReplayController.cpp: Ditto.
1529
1530 2017-06-20  Konstantin Tokarev  <annulen@yandex.ru>
1531
1532         Rename OrientationNotifer.h to OrientationNotifier.h
1533         https://bugs.webkit.org/show_bug.cgi?id=173600
1534
1535         Reviewed by Youenn Fablet.
1536
1537         No new tests needed.
1538
1539         * WebCore.xcodeproj/project.pbxproj:
1540         * dom/Document.h:
1541         * platform/OrientationNotifier.h: Renamed from Source/WebCore/platform/OrientationNotifer.h.
1542         * platform/mediastream/mac/AVVideoCaptureSource.h:
1543         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
1544         * testing/Internals.h:
1545
1546 2017-06-20  Konstantin Tokarev  <annulen@yandex.ru>
1547
1548         Remove excessive include directives from WTF
1549         https://bugs.webkit.org/show_bug.cgi?id=173553
1550
1551         Reviewed by Saam Barati.
1552
1553         No new tests needed.
1554
1555         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h:
1556         Added missing include directive.
1557
1558 2017-06-20  Konstantin Tokarev  <annulen@yandex.ru>
1559
1560         Remove excessive include directives from WebCore/dom
1561         https://bugs.webkit.org/show_bug.cgi?id=173591
1562
1563         Reviewed by Darin Adler.
1564
1565         No new tests needed.
1566
1567         * bindings/js/JSCustomElementRegistryCustom.cpp:
1568         * dom/Attr.h:
1569         * dom/ChildListMutationScope.h:
1570         * dom/ContainerNodeAlgorithms.cpp:
1571         * dom/ContainerNodeAlgorithms.h:
1572         * dom/CustomElementRegistry.h:
1573         * dom/DOMRect.h:
1574         * dom/DocumentMarkerController.h:
1575         * dom/ElementIteratorAssertions.h:
1576         * dom/ElementRareData.h:
1577         * dom/EventContext.h:
1578         * dom/EventDispatcher.h:
1579         * dom/ExtensionStyleSheets.h:
1580         * dom/GenericEventQueue.h:
1581         * dom/LiveNodeList.h:
1582         * dom/LoadableClassicScript.h:
1583         * dom/LoadableScript.h:
1584         * dom/MutationCallback.h:
1585         * dom/NativeNodeFilter.h:
1586         * dom/NodeRareData.h:
1587         * dom/PromiseRejectionEvent.h:
1588         * dom/PseudoElement.h:
1589         * dom/Range.h:
1590         * dom/RegisteredEventListener.h:
1591         * dom/RejectedPromiseTracker.cpp:
1592         * dom/ScopedEventQueue.h:
1593         * dom/ScriptElement.h:
1594         * dom/ScriptExecutionContext.h:
1595         * dom/ScriptedAnimationController.cpp:
1596         * dom/ScriptedAnimationController.h:
1597         * dom/SelectorQuery.h:
1598         * dom/StaticNodeList.h:
1599         * dom/StaticRange.h:
1600         * dom/default/PlatformMessagePortChannel.h:
1601         * testing/Internals.cpp:
1602         * workers/WorkerGlobalScope.h:
1603
1604 2017-06-20  Konstantin Tokarev  <annulen@yandex.ru>
1605
1606         Remove excessive include directives from WebCore/css
1607         https://bugs.webkit.org/show_bug.cgi?id=173554
1608
1609         Reviewed by Alex Christensen.
1610
1611         No new tests needed.
1612
1613         * css/CSSComputedStyleDeclaration.h:
1614         * css/CSSContentDistributionValue.h:
1615         * css/CSSCursorImageValue.h:
1616         * css/CSSFilterImageValue.h:
1617         * css/CSSFontFace.h:
1618         * css/CSSFontFeatureValue.h:
1619         * css/CSSFontStyleRangeValue.h:
1620         * css/CSSFontVariationValue.h:
1621         * css/CSSImageGeneratorValue.h:
1622         * css/CSSImageSetValue.h:
1623         * css/CSSInheritedValue.h:
1624         * css/CSSInitialValue.h:
1625         * css/CSSKeyframeRule.cpp:
1626         * css/CSSKeyframeRule.h:
1627         * css/CSSLineBoxContainValue.h:
1628         * css/CSSPrimitiveValue.h:
1629         * css/CSSPrimitiveValueMappings.h:
1630         * css/CSSPropertySourceData.h:
1631         * css/CSSReflectValue.h:
1632         * css/CSSRevertValue.h:
1633         * css/CSSSelector.h:
1634         * css/CSSStyleSheet.h:
1635         * css/CSSToLengthConversionData.h:
1636         * css/CSSUnsetValue.h:
1637         * css/CSSValue.h:
1638         * css/CSSValuePool.h:
1639         * css/CSSVariableData.h:
1640         * css/DeprecatedCSSOMCounter.h:
1641         * css/DeprecatedCSSOMRGBColor.h:
1642         * css/DeprecatedCSSOMRect.h:
1643         * css/DeprecatedCSSOMValue.h:
1644         * css/RuleSet.h:
1645         * css/SelectorChecker.h:
1646         * css/StyleBuilderConverter.h:
1647         * css/StyleBuilderCustom.h:
1648         * css/StyleProperties.h:
1649         * css/StyleResolver.cpp:
1650         * css/StyleResolver.h:
1651         * css/StyleSheet.h:
1652         * css/StyleSheetContents.h:
1653         * css/ViewportStyleResolver.h:
1654         * css/parser/CSSDeferredParser.h:
1655         * css/parser/CSSParserIdioms.h:
1656         * css/parser/CSSParserImpl.cpp:
1657         * css/parser/CSSParserImpl.h:
1658         * css/parser/CSSParserObserver.h:
1659         * css/parser/CSSParserSelector.h:
1660         * css/parser/CSSPropertyParserHelpers.h:
1661         * css/parser/MediaQueryParser.cpp:
1662         * css/parser/MediaQueryParser.h:
1663         * css/parser/SizesAttributeParser.cpp:
1664         * css/parser/SizesAttributeParser.h:
1665         * html/BaseCheckableInputType.cpp:
1666         * html/MediaController.cpp:
1667         * html/track/TextTrack.cpp:
1668         * html/track/TextTrackCue.cpp:
1669         * html/track/VideoTrack.cpp:
1670         * loader/TextTrackLoader.cpp:
1671
1672 2017-06-20  Miguel Gomez  <magomez@igalia.com>
1673
1674         [GTK] Layout Test fast/canvas/webgl/tex-image-and-sub-image-2d-with-video.html makes the subsequent test case flaky crash.
1675         https://bugs.webkit.org/show_bug.cgi?id=173459
1676
1677         Reviewed by Carlos Garcia Campos.
1678
1679         When destructing the VideoTextureCopierGStreamer, ensure that there's a previous gl context before trying
1680         to make it current again. There are situations where no previous context may exist, which can trigger a crash.
1681         Also, add DefaultImageOrientation to the switch that handles the video frame possible orientations, as it's the
1682         value used when no rotation needs to be performed, and it's currently triggering an assertion.
1683
1684         Covered by existent tests.
1685
1686         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
1687         (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
1688         (WebCore::VideoTextureCopierGStreamer::updateTextureSpaceMatrix):
1689
1690 2017-06-19  Devin Rousso  <drousso@apple.com>
1691
1692         Web Inspector: create canvas content view and details sidebar panel
1693         https://bugs.webkit.org/show_bug.cgi?id=138941
1694         <rdar://problem/19051672>
1695
1696         Reviewed by Joseph Pecoraro.
1697
1698         Tests: inspector/canvas/requestContent.html
1699                inspector/canvas/requestNode.html
1700
1701         * inspector/InspectorCanvasAgent.h:
1702         * inspector/InspectorCanvasAgent.cpp:
1703         (WebCore::InspectorCanvasAgent::requestNode):
1704         Gets the node id of the backing canvas element.
1705
1706         (WebCore::InspectorCanvasAgent::requestContent):
1707         Gets the current image content of the canvas.
1708
1709         (WebCore::InspectorCanvasAgent::frameNavigated):
1710         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
1711         Minor fixes from r218376 <https://webkit.org/b/172623>.
1712
1713         (WebCore::InspectorCanvasAgent::buildObjectForCanvas):
1714         Optionally send the `nodeId` of the backing canvas element if it is available.
1715
1716         * inspector/InspectorInstrumentation.cpp:
1717         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
1718
1719 2017-06-19  Frederic Wang  <fwang@igalia.com>
1720
1721         [iOS] Always include frames in the scrolling tree when async frame scrolling is enabled
1722         https://bugs.webkit.org/show_bug.cgi?id=173405
1723
1724         Reviewed by Simon Fraser.
1725
1726         Currently "async frame scrolling" is ignored on iOS. This commit changes that behavior to
1727         align on macOS and is a preliminary step to implement iframe scrolling on iOS (bug 149264).
1728
1729         Test: compositing/iframes/compositing-for-scrollable-iframe.html
1730               fast/scrolling/scrolling-tree-includes-frame.html
1731
1732         * rendering/RenderLayerCompositor.cpp:
1733         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame): Do not require
1734         compositing when "async frame scrolling" is enabled on iOS.
1735
1736 2017-06-19  Frederic Wang  <fwang@igalia.com>
1737
1738         [Mac] Add an experimental feature setting for async frame scrolling
1739         https://bugs.webkit.org/show_bug.cgi?id=173359
1740
1741         Reviewed by Simon Fraser.
1742
1743         The necessary work to use compositing for frames and include them in the scrolling tree on
1744         macOS was performed in r217726 and r217730. ScrollingTreeIncludesFrames was used to
1745         determine when this behavior should be enabled. However, this does not work well on iOS where
1746         ScrollingTreeIncludesFrames defaults to true and really means "include the frames in the
1747         scrolling tree when necessary". Hence we instead introduce a new "async frame scrolling"
1748         switch to enable the behavior on macOS, which will also be used in a follow-up commit on iOS.
1749         This new setting is also made an "experimental feature", so that it will be more convenient
1750         for developer to try it.
1751
1752         Test: compositing/iframes/compositing-for-scrollable-iframe.html
1753               fast/scrolling/scrolling-tree-includes-frame.html
1754
1755         * page/Settings.in: Declare new setting for async frame scrolling.
1756         * page/scrolling/ScrollingCoordinator.cpp:
1757         (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView): Also include frames in
1758         scrolling tree when async frame scrolling is enabled.
1759         * rendering/RenderLayerCompositor.cpp:
1760         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame): Rely on async frame
1761         scrolling to decide when compositing is needed.
1762
1763 2017-06-19  Zalan Bujtas  <zalan@apple.com>
1764
1765         AX: Remove redundant AXObjectCache::textChanged(RenderObject*).
1766         https://bugs.webkit.org/show_bug.cgi?id=173579
1767         <rdar://problem/32865367>
1768
1769         Reviewed by Antti Koivisto.
1770
1771         All calls go through textChanged(Node*) method.
1772
1773         * accessibility/AXObjectCache.cpp:
1774         * accessibility/AXObjectCache.h:
1775         (WebCore::AXObjectCache::getOrCreate):
1776
1777 2017-06-19  Darin Adler  <darin@apple.com>
1778
1779         Merge MediaDevicesRequest and MediaDevicesEnumerationRequest to tighten up code and object lifetime
1780         https://bugs.webkit.org/show_bug.cgi?id=173527
1781
1782         Reviewed by Sam Weinig.
1783
1784         * CMakeLists.txt: Removed MediaDevicesRequest.cpp.
1785
1786         * Modules/mediastream/MediaDeviceInfo.cpp:
1787         (WebCore::MediaDeviceInfo::MediaDeviceInfo): Removed unneeded ScriptExecutionContext.
1788         (WebCore::MediaDeviceInfo::create): Ditto.
1789         * Modules/mediastream/MediaDeviceInfo.h: Removed unnecessary derivation from
1790         ContextDestructionObserver and ScriptExecutionContext arguments. Also removed
1791         unused MediaDeviceInfoVector typedef.
1792         * Modules/mediastream/MediaDeviceInfo.idl: Added ImplementationLacksVTable.
1793
1794         * Modules/mediastream/MediaDevices.cpp:
1795         (WebCore::MediaDevices::enumerateDevices): Call MediaDevicesEnumerationRequest
1796         directly here instead of going through MediaDevicesRequest.
1797
1798         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp: Moved code from
1799         MediaDevicesRequest in here. Put the typical counts at the top of the file.
1800         (WebCore::MediaDevicesEnumerationRequest::MediaDevicesEnumerationRequest):
1801         Marked inline and changed to take a DOM promise directly rather than having
1802         a separate class do the mapping to DOM promises.
1803         (WebCore::MediaDevicesEnumerationRequest::start): Replaced the create function
1804         with this. The caller doesn't actually keep a reference to the object.
1805         Added a FIXME about the behavior, not new, where we neither resolve nor reject
1806         the promise if there is no page object present. Updated to use the new version
1807         of UserMediaController::from.
1808         (WebCore::MediaDevicesEnumerationRequest::~MediaDevicesEnumerationRequest):
1809         Added a FIXME about the issue that we don't resolve or reject the promise if
1810         the client drops the last reference to the request without calling setDeviceInfo.
1811         (WebCore::MediaDevicesEnumerationRequest::document): Added. Private helper.
1812         Returns nullptr if the request is no longer active.
1813         (WebCore::MediaDevicesEnumerationRequest::frame): Added. For use by a caller
1814         that was getting to the frame. Uses the document function so it will return
1815         nullptr if the request is no longer active.
1816         (WebCore::MediaDevicesEnumerationRequest::userMediaDocumentOrigin): Changed
1817         to do the work using the document function.
1818         (WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin): Ditto.
1819         (WebCore::MediaDevicesEnumerationRequest::contextDestroyed): Simplified. We
1820         now can simply set a boolean when the context is destroyed, so there are no
1821         side effects and the code is simpler.
1822         (WebCore::removeAtypicalDevices): Renamed and tightened up the code a bit.
1823         (WebCore::MediaDevicesEnumerationRequest::setDeviceInfo): Moved the code
1824         here from MediaDevicesEnumerationRequest to pass the devices along.
1825
1826         * Modules/mediastream/MediaDevicesEnumerationRequest.h: Made the
1827         ContextDestructionObserver use private inheritance. Cut down the includes
1828         and removed various unneeded functions.
1829
1830         * Modules/mediastream/MediaDevicesRequest.cpp: Removed.
1831         * Modules/mediastream/MediaDevicesRequest.h: Removed.
1832
1833         * Modules/mediastream/UserMediaController.cpp:
1834         (WebCore::UserMediaController::UserMediaController): Use reference rather
1835         than pointer for the client.
1836         (WebCore::UserMediaController::~UserMediaController): Ditto.
1837         (WebCore::provideUserMediaTo): Ditto.
1838
1839         * Modules/mediastream/UserMediaController.h:
1840         Changed constructor to take a refeference, removed client function, and
1841         changed data member to be a reference rather than a pointer.
1842         (WebCore::UserMediaController::from): Take and return a reference rather
1843         than taking a pointer that is checked for null.
1844         (WebCore::UserMediaController::requestUserMediaAccess): Use reference.
1845         (WebCore::UserMediaController::cancelUserMediaAccessRequest): Ditto.
1846         (WebCore::UserMediaController::enumerateMediaDevices): Ditto.
1847         (WebCore::UserMediaController::cancelMediaDevicesEnumerationRequest): Ditto.
1848
1849         * Modules/mediastream/UserMediaRequest.cpp:
1850         (WebCore::UserMediaRequest::start): Updated to use the new version
1851         of UserMediaController::from.
1852
1853         * WebCore.xcodeproj/project.pbxproj: Updated for file removals.
1854
1855         * testing/Internals.cpp: Removed unneeded include of UserMediaController.h.
1856
1857 2017-06-19  Sam Weinig  <sam@webkit.org>
1858
1859         [WebIDL] Move Touch related bindings in Document to their own IDL file
1860         https://bugs.webkit.org/show_bug.cgi?id=173521
1861
1862         Reviewed by Alex Christensen.
1863
1864         Rather than #including in the middle of an IDL file, this moves the touch related
1865         bindings in Document.idl to a new partial interface for Document in DocumentTouch.idl.
1866         While here, remove the custom binding for createTouchList.
1867
1868         * CMakeLists.txt:
1869         * DerivedSources.make:
1870         * WebCore.xcodeproj/project.pbxproj:
1871         Add new files.
1872
1873         * bindings/js/JSDocumentCustom.cpp:
1874         (WebCore::JSDocument::createTouchList): Deleted.
1875         Remove createTouchList. It can be generated now.
1876
1877         * dom/Document.cpp:
1878         (WebCore::Document::createTouch): Deleted.
1879         * dom/Document.h:
1880         Move touch related bindings code to DocumentTouch.h/cpp.
1881         Remove DocumentIOSForward as it is no longer needed.
1882
1883         * dom/Document.idl:
1884         Move touch related bindings to DocumentTouch.idl
1885         
1886         * dom/DocumentTouch.h: Added.
1887         * dom/DocumentTouch.cpp: Added.
1888         (WebCore::DocumentTouch::createTouch):
1889         Moved from Document.
1890
1891         (WebCore::DocumentTouch::createTouchList):
1892         Added to aid generated binding.
1893
1894         * dom/DocumentTouch.idl: Added.
1895         Moved operations from Document.h
1896
1897         * dom/TouchList.h:
1898         (WebCore::TouchList::create):
1899         (WebCore::TouchList::TouchList):
1900         Added create that works with the bindings.
1901
1902         * dom/ios/TouchEvents.cpp:
1903         Add DocumentTouchIOS.h and sort.
1904
1905 2017-06-19  Myles C. Maxfield  <mmaxfield@apple.com>
1906
1907         [Cocoa] The system Japanese font cannot be italicized
1908         https://bugs.webkit.org/show_bug.cgi?id=173300
1909         <rdar://problem/31805407>
1910
1911         Reviewed by Ryosuke Niwa.
1912
1913         Items in the system font cascade list may lie about whether or not they support italics.
1914         In order to get the truth, we need to use the physical font underlying the font in question,
1915         because this one won't lie. Then, we can interrogate this physical font about its traits
1916         in order to synthesize italics correctly.
1917
1918         Test: fast/text/system-font-japanese-synthetic-italic.html
1919
1920         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1921         (WebCore::lookupFallbackFont):
1922         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
1923         (WebCore::FontFamilySpecificationCoreText::fontRanges):
1924
1925 2017-06-19  Daewoong Jang  <daewoong.jang@navercorp.com>
1926
1927         [cURL] Move file scope static variables into function scopes
1928         https://bugs.webkit.org/show_bug.cgi?id=173567
1929
1930         Reviewed by Alex Christensen.
1931
1932         * platform/network/curl/SSLHandle.cpp:
1933         (WebCore::allowedHosts):
1934         (WebCore::allowedClientHosts):
1935         (WebCore::allowsAnyHTTPSCertificateHosts):
1936         (WebCore::addAllowedClientCertificate):
1937         (WebCore::setSSLClientCertificate):
1938         (WebCore::sslIgnoreHTTPSCertificate):
1939         (WebCore::certVerifyCallback):
1940
1941 2017-06-19  Darin Adler  <darin@apple.com>
1942
1943         [Cocoa] implement URLSession:task:needNewBodyStream: delegate method
1944         https://bugs.webkit.org/show_bug.cgi?id=173551
1945         rdar://problem/32250512
1946
1947         Reviewed by Alex Christensen.
1948
1949         Covered by http/tests/misc/form-blob-challenge.html
1950
1951         * WebCore.xcodeproj/project.pbxproj: Removed NSURLRequestSPI.h.
1952
1953         * platform/network/cf/FormDataStreamCFNet.cpp:
1954         (WebCore::createHTTPBodyCFReadStream): Factored this out from setHTTPBody.
1955         (WebCore::setHTTPBody): Factored out the function above.
1956         * platform/network/cf/FormDataStreamCFNet.h: Added createHTTPBodyCFReadStream.
1957
1958         * platform/network/cocoa/ResourceRequestCocoa.mm: Use CFNetworkSPI.h.
1959         * platform/network/ios/ResourceRequestIOS.mm: Ditto.
1960
1961         * platform/network/mac/FormDataStreamMac.h: Added createHTTPBodyNSInputStream.
1962         * platform/network/mac/FormDataStreamMac.mm:
1963         (WebCore::createHTTPBodyNSInputStream): Added/
1964
1965         * platform/network/mac/ResourceHandleMac.mm: Use CFNetworkSPI.h.
1966         * platform/network/mac/ResourceRequestMac.mm: Ditto.
1967         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: Ditto.
1968         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: Ditto.
1969
1970         * platform/network/mac/WebCoreURLResponse.h: Moved SPI declarations from
1971         here into CFNetworkSPI.h.
1972
1973         * platform/spi/cf/CFNetworkSPI.h: Use #pragma once, consolidated SPI that was
1974         defined in scattered locations.
1975
1976         * platform/spi/cocoa/NSURLRequestSPI.h: Removed. Superceded by CFNetworkSPI.h.
1977
1978 2017-06-19  Brady Eidson  <beidson@apple.com>
1979
1980         Various IndexedDB crashes as an after effect of previous test.
1981         <rdar://problem/31418761> and https://bugs.webkit.org/show_bug.cgi?id=170436
1982
1983         Reviewed by Chris Dumez.
1984
1985         No new test (No consistent test possible, in practice covered by all existing IDB tests)
1986
1987         This is timing related, where a UniqueIDBDatabase can be destroyed on the main thread while
1988         it still has one task left to try to execute on the IDBServer thread.
1989         
1990         The background thread tasks don't Ref<> the UniqueIDBDatabase, so even though task execution
1991         took a Ref<> protector, there was still a small window for a race.
1992         
1993         Should be closed up by making the background thread tasks themselves protect this.
1994         
1995         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1996         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
1997         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
1998         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask):
1999         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTaskReply):
2000         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2001
2002 2017-06-19  Sam Weinig  <sam@webkit.org>
2003
2004         [WebIDL] Add support for serializers that have members that are themselves serializers (or inherit being a serializer from a parent)
2005         https://bugs.webkit.org/show_bug.cgi?id=173395
2006
2007         Reviewed by Simon Fraser.
2008
2009         Test: fast/css/DOMQuad-serialization.html
2010
2011         * bindings/scripts/CodeGenerator.pm:
2012         (InheritsSerializable):
2013         Helper to determine if an interface inherits from any interfaces
2014         that are serializable. This is necessary because an attribute is
2015         serializable even if its interface is not marked as serializable. 
2016
2017         (IsSerializableAttribute):
2018         Check ancestor interfaces as well to determine serializability.
2019
2020         * bindings/scripts/CodeGeneratorJS.pm:
2021         (GenerateSerializerDefinition):
2022         Specialize attributes that are serializable interfaces to call its interfaces
2023         serialize function, thus allowing nested objects to be serialized.
2024
2025         * dom/DOMQuad.idl:
2026         Add serializer.
2027
2028         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2029         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp: Added.
2030         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h: Added.
2031         * bindings/scripts/test/TestSerialization.idl:
2032         * bindings/scripts/test/TestSerializationIndirectInheritance.idl: Added.
2033         Add and update tests.
2034
2035 2017-06-19  Commit Queue  <commit-queue@webkit.org>
2036
2037         Unreviewed, rolling out r218505.
2038         https://bugs.webkit.org/show_bug.cgi?id=173563
2039
2040         "It would break internal builds" (Requested by youenn on
2041         #webkit).
2042
2043         Reverted changeset:
2044
2045         "[WebRTC] Prevent capturing at unconventional resolutions when
2046         using the SW encoder on Mac"
2047         https://bugs.webkit.org/show_bug.cgi?id=172602
2048         http://trac.webkit.org/changeset/218505
2049
2050 2017-06-19  Zalan Bujtas  <zalan@apple.com>
2051
2052         Opening certain mails brings up a mail that grows indefinitely.
2053         https://bugs.webkit.org/show_bug.cgi?id=173562
2054         <rdar://problem/32766579>
2055
2056         Reviewed by Tim Horton.
2057
2058         This reverts the logic where m_autoSizeContentSize always reflects the final layout's.
2059         When the ICB's height is 100%, it causes infinite recursion.
2060         See also webkit.org/b/173561.
2061
2062         * page/FrameView.cpp:
2063         (WebCore::FrameView::autoSizeIfEnabled):
2064
2065 2017-06-19  Wenson Hsieh  <wenson_hsieh@apple.com>
2066
2067         [iOS DnD] Support .zip archives for file uploads via drag and drop
2068         https://bugs.webkit.org/show_bug.cgi?id=173511
2069         <rdar://problem/32521025>
2070
2071         Reviewed by Tim Horton.
2072
2073         Allows dropped .zip archives to be uploaded as files by accepting types conforming to either
2074         "public.zip-archive" or "public.content" as potential file types. Initially, I opted to accept the more general
2075         "public.data" type; however, this includes UTIs such as "public.url" that should not be represented as files, so
2076         this is a more targeted fix that allows us to very easily add additional content types in the future by adding
2077         more types to supportedFileUploadPasteboardTypes.
2078
2079         Tests:
2080         DataInteractionTests.ExternalSourceZIPArchiveToUploadArea
2081         DataInteractionTests.ExternalSourceZIPArchiveAndURLToSingleFileInput
2082
2083         * page/mac/DragControllerMac.mm:
2084         (WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod):
2085         * platform/Pasteboard.h:
2086         * platform/ios/PasteboardIOS.mm:
2087         (WebCore::Pasteboard::read):
2088         (WebCore::Pasteboard::supportedWebContentPasteboardTypes):
2089         (WebCore::Pasteboard::supportedFileUploadPasteboardTypes):
2090
2091         Rename supportedPasteboardTypes to supportedWebContentPasteboardTypes, and also introduce
2092         supportedFileUploadPasteboardTypes which returns an list of types, such that if a type conforms to any type in
2093         this array, that type may be represented as a file. So far, this list contains "public.content" and
2094         "public.zip-archive".
2095
2096         (WebCore::Pasteboard::types):
2097         (WebCore::Pasteboard::supportedPasteboardTypes): Deleted.
2098         * platform/ios/WebItemProviderPasteboard.mm:
2099         (typeConformsToTypes):
2100
2101         Remove -typeIsAppropriateForSupportedTypes: and replace it with typeConformsToTypes. Use this both when
2102         determining the number of files on the pasteboard, and when determining preferred UTIs to load when dropping.
2103
2104         (-[WebItemProviderPasteboard numberOfFiles]):
2105         (-[WebItemProviderPasteboard typeIdentifierToLoadForRegisteredTypeIdentfiers:]):
2106         (-[WebItemProviderPasteboard typeIsAppropriateForSupportedTypes:]): Deleted.
2107         * platform/mac/DragDataMac.mm:
2108         (WebCore::DragData::containsFiles):
2109         * platform/mac/PasteboardMac.mm:
2110         (WebCore::Pasteboard::supportedFileUploadPasteboardTypes):
2111
2112 2017-06-19  Sam Weinig  <sam@webkit.org>
2113
2114         [WebIDL] Remove custom binding for Document.getCSSCanvasContext()
2115         https://bugs.webkit.org/show_bug.cgi?id=173516
2116
2117         Reviewed by Chris Dumez.
2118
2119         * bindings/js/JSDocumentCustom.cpp:
2120         (WebCore::JSDocument::visitAdditionalChildren):
2121         (WebCore::JSDocument::getCSSCanvasContext): Deleted.
2122         * dom/Document.cpp:
2123         (WebCore::Document::getCSSCanvasContext):
2124         * dom/Document.h:
2125         * dom/Document.idl:
2126         Use a Variant to pass the context and type to the bindings.
2127
2128 2017-06-19  Youenn Fablet  <youenn@apple.com>
2129
2130         [WebRTC] Prevent capturing at unconventional resolutions when using the SW encoder on Mac
2131         https://bugs.webkit.org/show_bug.cgi?id=172602
2132         <rdar://problem/32407693>
2133
2134         Reviewed by Eric Carlson.
2135
2136         Test: platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html
2137
2138         Add internal API to switch on/off hardware H264 encoder.
2139         Add checks for standard size. If using a software encoder and frame size is not standard,
2140         the session is destroyed and no frame is sent at all.
2141
2142         Added tests based on captureStream.
2143         Fixed the case of capturing a canvas which size is changing.
2144
2145         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
2146         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
2147         * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.h:
2148         * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.mm:
2149         (WebCore::H264VideoToolboxEncoder::setHardwareEncoderForWebRTCAllowed):
2150         (WebCore::H264VideoToolboxEncoder::hardwareEncoderForWebRTCAllowed):
2151         (WebCore::isUsingSoftwareEncoder):
2152         (WebCore::H264VideoToolboxEncoder::CreateCompressionSession):
2153         (isStandardFrameSize): Added.
2154         (isUsingSoftwareEncoder): Added.
2155         * testing/Internals.cpp:
2156         (WebCore::Internals::setH264HardwareEncoderAllowed):
2157         * testing/Internals.h:
2158         * testing/Internals.idl:
2159
2160 2017-06-19  Brady Eidson  <beidson@apple.com>
2161
2162         Cleanup IconLoader stuff when a DocumentLoader detaches from its frame.
2163         <rdar://problem/31418761> and https://bugs.webkit.org/show_bug.cgi?id=173473
2164
2165         Reviewed by Alex Christensen.
2166
2167         No new tests (No known change in behavior)
2168
2169         I discovered the need to make these changes here due to a transient bug
2170         introduced in r218015 but already explicitly fixed in r218409.
2171         
2172         This change adds an assert to guard against a detached DocumentLoader having active IconLoaders.
2173
2174         It also clears out all pending IconLoader and icon load decisions when stopLoading() is called, 
2175         as even attempting to start an icon load after detachment is a waste of cycles.
2176         
2177         * loader/DocumentLoader.cpp:
2178         (WebCore::DocumentLoader::stopLoading): Also explicitly clear all IconLoaders and icons pending
2179           load decision.
2180         (WebCore::DocumentLoader::finishedLoadingIcon): Assert that this DocumentLoader is not detached.
2181
2182 2017-06-19  Chris Dumez  <cdumez@apple.com>
2183
2184         Use WTF::Function instead of std::function in more places in WebCore/
2185         https://bugs.webkit.org/show_bug.cgi?id=173535
2186
2187         Reviewed by Antti Koivisto.
2188
2189         Use WTF::Function instead of std::function in more places in WebCore/ to avoid copying.
2190
2191         * accessibility/AccessibilityObject.cpp:
2192         (WebCore::AccessibilityObject::matchedParent):
2193         * accessibility/AccessibilityObject.h:
2194         * animation/DocumentAnimation.cpp:
2195         (WebCore::DocumentAnimation::getAnimations):
2196         * animation/DocumentAnimation.h:
2197         (WebCore::DocumentAnimation::getAnimations):
2198         * contentextensions/CombinedURLFilters.cpp:
2199         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
2200         * contentextensions/CombinedURLFilters.h:
2201         * contentextensions/DFACombiner.cpp:
2202         (WebCore::ContentExtensions::DFACombiner::combineDFAs):
2203         * contentextensions/DFACombiner.h:
2204         * css/CSSCrossfadeValue.cpp:
2205         (WebCore::CSSCrossfadeValue::traverseSubresources):
2206         * css/CSSCrossfadeValue.h:
2207         * css/CSSFilterImageValue.cpp:
2208         (WebCore::CSSFilterImageValue::traverseSubresources):
2209         * css/CSSFilterImageValue.h:
2210         * css/CSSFontFaceSrcValue.cpp:
2211         (WebCore::CSSFontFaceSrcValue::traverseSubresources):
2212         * css/CSSFontFaceSrcValue.h:
2213         * css/CSSImageSetValue.cpp:
2214         (WebCore::CSSImageSetValue::traverseSubresources):
2215         * css/CSSImageSetValue.h:
2216         * css/CSSImageValue.cpp:
2217         (WebCore::CSSImageValue::traverseSubresources):
2218         * css/CSSImageValue.h:
2219         * css/CSSValue.cpp:
2220         (WebCore::CSSValue::traverseSubresources):
2221         * css/CSSValue.h:
2222         * css/CSSValueList.cpp:
2223         (WebCore::CSSValueList::traverseSubresources):
2224         * css/CSSValueList.h:
2225         * css/StyleProperties.cpp:
2226         (WebCore::StyleProperties::traverseSubresources):
2227         * css/StyleProperties.h:
2228         * css/StyleSheetContents.cpp:
2229         (WebCore::traverseSubresourcesInRules):
2230         (WebCore::StyleSheetContents::traverseSubresources):
2231         * css/StyleSheetContents.h:
2232         * dom/Element.cpp:
2233         (WebCore::Element::getAnimations):
2234         * editing/TextIterator.cpp:
2235         (WebCore::findPlainTextMatches):
2236         (WebCore::findClosestPlainText):
2237         (WebCore::findPlainText):
2238         * editing/mac/DictionaryLookup.h:
2239         * editing/mac/DictionaryLookup.mm:
2240         (WebCore::showPopupOrCreateAnimationController):
2241         (WebCore::DictionaryLookup::showPopup):
2242         (WebCore::DictionaryLookup::animationControllerForPopup):
2243         * fileapi/AsyncFileStream.cpp:
2244         (WebCore::AsyncFileStream::perform):
2245         (WebCore::AsyncFileStream::getSize):
2246         (WebCore::AsyncFileStream::openForRead):
2247         (WebCore::AsyncFileStream::read):
2248         * fileapi/AsyncFileStream.h:
2249         * html/HTMLMediaElement.cpp:
2250         (WebCore::HTMLMediaElement::waitForPreparedForInlineThen):
2251         (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
2252         * html/HTMLMediaElement.h:
2253         (WebCore::HTMLMediaElement::waitForPreparedForInlineThen):
2254         (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
2255         * loader/EmptyClients.cpp:
2256         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
2257         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2258         (WebCore::EmptyFrameLoaderClient::dispatchWillSubmitForm):
2259         * loader/FrameLoaderClient.h:
2260         * loader/archive/cf/LegacyWebArchive.cpp:
2261         (WebCore::LegacyWebArchive::create):
2262         * loader/archive/cf/LegacyWebArchive.h:
2263         * loader/cache/MemoryCache.cpp:
2264         (WebCore::MemoryCache::forEachResource):
2265         (WebCore::MemoryCache::forEachSessionResource):
2266         * loader/cache/MemoryCache.h:
2267         * page/DOMWindow.cpp:
2268         (WebCore::DOMWindow::createWindow):
2269         (WebCore::DOMWindow::showModalDialog):
2270         * page/DOMWindow.h:
2271         * page/FrameView.cpp:
2272         (WebCore::FrameView::applyRecursivelyWithVisibleRect):
2273         * page/FrameView.h:
2274         * page/Page.cpp:
2275         (WebCore::Page::forEachPage):
2276         (WebCore::Page::decrementNestedRunLoopCount):
2277         (WebCore::Page::whenUnnested):
2278         * page/Page.h:
2279         * page/WheelEventTestTrigger.cpp:
2280         (WebCore::WheelEventTestTrigger::clearAllTestDeferrals):
2281         (WebCore::WheelEventTestTrigger::setTestCallbackAndStartNotificationTimer):
2282         (WebCore::WheelEventTestTrigger::triggerTestTimerFired):
2283         * page/WheelEventTestTrigger.h:
2284         * page/WindowFeatures.cpp:
2285         (WebCore::processFeaturesString):
2286         * page/WindowFeatures.h:
2287         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2288         (WebCore::RingBuffer::forEach):
2289         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
2290         (WebCore::WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer):
2291         (WebCore::WebVideoFullscreenModelVideoElement::waitForPreparedForInlineThen):
2292         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
2293         (WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer):
2294         (WebVideoFullscreenModelVideoElement::waitForPreparedForInlineThen):
2295         * platform/graphics/MediaPlayer.cpp:
2296         (WebCore::MediaPlayer::setVideoFullscreenLayer):
2297         * platform/graphics/MediaPlayer.h:
2298         (WebCore::MediaPlayer::setVideoFullscreenLayer):
2299         * platform/graphics/MediaPlayerPrivate.h:
2300         (WebCore::MediaPlayerPrivateInterface::setVideoFullscreenLayer):
2301         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2302         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2303         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
2304         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2305         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2306         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer):
2307         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
2308         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2309         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer):
2310         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h:
2311         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
2312         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer):
2313
2314 2017-06-19  Chris Dumez  <cdumez@apple.com>
2315
2316         Use WTF::Function instead of std::function in WebCore/Modules
2317         https://bugs.webkit.org/show_bug.cgi?id=173534
2318
2319         Reviewed by Alex Christensen.
2320
2321         Use WTF::Function instead of std::function in WebCore/Modules to avoid
2322         copying.
2323
2324         * Modules/applepay/PaymentCoordinatorClient.h:
2325         * Modules/encryptedmedia/CDM.h:
2326         * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
2327         (WebCore::CDMFactory::CDMFactory):
2328         (WebCore::CDM::registerCDMFactory):
2329         * Modules/encryptedmedia/legacy/LegacyCDM.h:
2330         * Modules/mediasession/MediaSession.cpp:
2331         (WebCore::MediaSession::changeActiveMediaElements):
2332         (WebCore::MediaSession::safelyIterateActiveMediaElements):
2333         * Modules/mediasession/MediaSession.h:
2334         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2335         (WebCore::matchTransceiver):
2336         * Modules/mediastream/MediaStreamRegistry.cpp:
2337         (WebCore::MediaStreamRegistry::forEach):
2338         * Modules/mediastream/MediaStreamRegistry.h:
2339
2340 2017-06-19  Youenn Fablet  <youenn@apple.com>
2341
2342         A cloned MediaStreamTrack should mute independently other tracks using the same source
2343         https://bugs.webkit.org/show_bug.cgi?id=172831
2344         <rdar://problem/32518527>
2345
2346         Reviewed by Eric Carlson.
2347
2348         Test: webrtc/clone-audio-track.html
2349
2350         Move enabled handling in MediaStreamTrackPrivate instead of RealtimeMediaSource.
2351         Move WebRTC and WebAudio customers of RealtimeMediaSource to MediaStreamTrackPrivate.
2352         Move creation of WebAudio provider to MediaStreamTrackPrivate.
2353
2354         This allows changing some parameters of tracks having the same source independently.
2355         Using this for enabled track attribute.
2356
2357         We no longer stop generating frames in case track is disabled.
2358         This should be added back as an optimization in a follow-up.
2359
2360         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2361         (WebCore::LibWebRTCMediaEndpoint::addTrack):
2362         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2363         (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack):
2364         * Modules/webaudio/MediaStreamAudioSource.cpp:
2365         * Modules/webaudio/MediaStreamAudioSource.h:
2366         * WebCore.xcodeproj/project.pbxproj:
2367         * platform/mediastream/MediaStreamTrackPrivate.cpp:
2368         (WebCore::MediaStreamTrackPrivate::create):
2369         (WebCore::MediaStreamTrackPrivate::~MediaStreamTrackPrivate):
2370         (WebCore::MediaStreamTrackPrivate::setEnabled):
2371         (WebCore::MediaStreamTrackPrivate::audioSourceProvider):
2372         (WebCore::MediaStreamTrackPrivate::videoSampleAvailable):
2373         (WebCore::MediaStreamTrackPrivate::audioSamplesAvailable):
2374         * platform/mediastream/MediaStreamTrackPrivate.h:
2375         (WebCore::MediaStreamTrackPrivate::Observer::audioSamplesAvailable):
2376         * platform/mediastream/RealtimeMediaSource.cpp:
2377         (WebCore::RealtimeMediaSource::removeObserver):
2378         * platform/mediastream/RealtimeMediaSource.h:
2379         * platform/mediastream/mac/AVMediaCaptureSource.h:
2380         * platform/mediastream/mac/AVMediaCaptureSource.mm:
2381         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2382         (WebCore::CoreAudioCaptureSource::startProducingData):
2383         (WebCore::CoreAudioCaptureSource::stopProducingData):
2384         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2385         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
2386         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
2387         (WebCore::MockRealtimeAudioSourceMac::render):
2388         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
2389         (WebCore::RealtimeIncomingAudioSource::~RealtimeIncomingAudioSource):
2390         (WebCore::RealtimeIncomingAudioSource::OnData):
2391         * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
2392         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
2393         (WebCore::RealtimeIncomingVideoSource::pixelBufferFromVideoFrame):
2394         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
2395         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
2396         (WebCore::RealtimeOutgoingAudioSource::setSource):
2397         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
2398         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
2399         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
2400         (WebCore::RealtimeOutgoingVideoSource::setSource):
2401         (WebCore::RealtimeOutgoingVideoSource::initializeFromSource):
2402         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
2403         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
2404         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
2405         (WebCore::WebAudioSourceProviderAVFObjC::create):
2406         (WebCore::WebAudioSourceProviderAVFObjC::WebAudioSourceProviderAVFObjC):
2407         (WebCore::WebAudioSourceProviderAVFObjC::setClient):
2408         (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
2409         * platform/mock/MockRealtimeVideoSource.cpp:
2410         (WebCore::MockRealtimeVideoSource::generateFrame):
2411         * platform/spi/cocoa/PassKitSPI.h:
2412
2413 2017-06-19  Sam Weinig  <sam@webkit.org>
2414
2415         [WebIDL] Properly model buffer source / typed arrays as their own IDL types
2416         https://bugs.webkit.org/show_bug.cgi?id=173513
2417
2418         Reviewed by Alex Christensen.
2419
2420         - Adds IDL type hierarchy for buffer source types.
2421         - Includes a special type, IDLArrayBufferView, which WebIDL defines as the union
2422           of DataView and all the typed array types, but we model as shared base class.
2423           This should not be observable, and allows us to avoid using a Variant for ArrayBufferView
2424           and instead use the existing base class.
2425         - Add builtin typedefs for BufferSource and DOMTimeStamp as defined in WebIDL. As noted
2426           above, rather than define a typedef of ArrayBufferView that maps to a union, we treat
2427           it as a special type.
2428
2429         * bindings/IDLTypes.h:
2430         Add type hierarchy for buffer source types.
2431         - IDLBufferSource is the root
2432         - IDLArrayBuffer, IDLArrayBufferView, IDLDataView, IDLTypedArray derive from it.
2433         - And then the specific typed array types derive from IDLTypedArray, and are defined
2434           in JSDOMConvertBufferSource so we don't have to include a ton of typed array includes
2435           in this file, as they cannot be forward declared.
2436
2437         * bindings/js/JSDOMConvertBufferSource.h:
2438         (WebCore::Detail::BufferSourceConverter::convert):
2439         (WebCore::Converter<IDLArrayBuffer>::convert):
2440         (WebCore::JSConverter<IDLArrayBuffer>::convert):
2441         (WebCore::Converter<IDLDataView>::convert):
2442         (WebCore::JSConverter<IDLDataView>::convert):
2443         (WebCore::Converter<IDLInt8Array>::convert):
2444         (WebCore::JSConverter<IDLInt8Array>::convert):
2445         (WebCore::Converter<IDLInt16Array>::convert):
2446         (WebCore::JSConverter<IDLInt16Array>::convert):
2447         (WebCore::Converter<IDLInt32Array>::convert):
2448         (WebCore::JSConverter<IDLInt32Array>::convert):
2449         (WebCore::Converter<IDLUint8Array>::convert):
2450         (WebCore::JSConverter<IDLUint8Array>::convert):
2451         (WebCore::Converter<IDLUint16Array>::convert):
2452         (WebCore::JSConverter<IDLUint16Array>::convert):
2453         (WebCore::Converter<IDLUint32Array>::convert):
2454         (WebCore::JSConverter<IDLUint32Array>::convert):
2455         (WebCore::Converter<IDLUint8ClampedArray>::convert):
2456         (WebCore::JSConverter<IDLUint8ClampedArray>::convert):
2457         (WebCore::Converter<IDLFloat32Array>::convert):
2458         (WebCore::JSConverter<IDLFloat32Array>::convert):
2459         (WebCore::Converter<IDLFloat64Array>::convert):
2460         (WebCore::JSConverter<IDLFloat64Array>::convert):
2461         (WebCore::Converter<IDLArrayBufferView>::convert):
2462         (WebCore::JSConverter<IDLArrayBufferView>::convert):
2463         Add native and javascript conversion for all the new types.
2464
2465         * bindings/js/JSDOMConvertUnion.h:
2466         Add support for steps 7, 8, and 9 of the union conversion algorithm now that
2467         buffer source types are properly modeled.
2468
2469         * bindings/js/JSSubtleCryptoCustom.cpp:
2470         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
2471         Replace use of now repurposed IDLBufferSource, with its definition, IDLUnion<IDLArrayBufferView, IDLArrayBuffer>.
2472
2473         * bindings/scripts/CodeGenerator.pm:
2474         (IsBufferSourceType):
2475         Renamed from IsTypedArrayType.
2476
2477         (IsNonPointerType): Deleted.
2478         Was only used by DumpRenderTree and WebKitTestRunner generators. They have 
2479         been switched to the equivalent IsPrimitiveType.
2480
2481         (IsTypedArrayType): Deleted.
2482         Renamed to IsBufferSourceType.
2483
2484         (IsRefPtrType): Deleted. Unused.
2485
2486         * bindings/scripts/CodeGeneratorJS.pm:
2487         (AddToIncludesForIDLType):
2488         (AddClassForwardIfNeeded):
2489         (GetArgumentExceptionFunction):
2490         (GetAttributeExceptionFunction):
2491         (PassArgumentExpression):
2492         (GenerateDefaultValue):
2493         (GenerateOverloadDispatcher):
2494         (ShouldPassArgumentByReference):
2495         (NativeToJSValueDOMConvertNeedsState):
2496         (NativeToJSValueDOMConvertNeedsGlobalObject):
2497         Update for rename of IsTypedArrayType -> IsBufferSourceType and remove specialized BufferSource
2498         condition.
2499
2500         (GetBaseIDLType):
2501         Add mappings for new buffer source types.
2502
2503         * bindings/scripts/IDLParser.pm:
2504         (Parse):
2505         Insert builtin typedefs to the typedef map before parsing.
2506
2507         (addBuiltinTypedefs):
2508         Generate typedefs for BufferSource and DOMTimeStamp as specified by WebIDL.
2509
2510         (applyTypedefs):
2511         Add support for applying typedefs to iterable and maplike, necessary now because BufferSource
2512         is used as the key to iterable in MediaKeyStatusMap.idl
2513
2514         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
2515         * bindings/scripts/test/JS/JSTestCallbackInterface.h:
2516         * bindings/scripts/test/JS/JSTestObj.cpp:
2517         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2518         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2519         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
2520         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.h:
2521         Update test results.
2522
2523         * bindings/scripts/test/TestTypedefs.idl:
2524         Add tests for builtin typedefs.
2525
2526         * Modules/geolocation/Geoposition.idl:
2527         * dom/Event.idl:
2528         * fileapi/Blob.idl:
2529         * fileapi/File.idl:
2530         * page/FrameView.h:
2531         * xml/XMLHttpRequest.idl:
2532         Remove typedef for DOMTimeStamp and BufferSource which are now automatically included.
2533
2534 2017-06-19  Adrian Perez de Castro  <aperez@igalia.com>
2535
2536         Missing <functional> includes make builds fail with GCC 7.x
2537         https://bugs.webkit.org/show_bug.cgi?id=173544
2538
2539         Unreviewed gardening.
2540
2541         Fix compilation with GCC 7.
2542
2543         * Modules/mediastream/MediaStreamRegistry.h:
2544         * animation/DocumentAnimation.h:
2545         * page/WheelEventTestTrigger.h:
2546         * page/csp/ContentSecurityPolicy.h:
2547         * platform/Timer.h:
2548         * platform/graphics/gstreamer/MainThreadNotifier.h:
2549         * platform/network/NetworkStorageSession.h:
2550
2551 2017-06-19  Zan Dobersek  <zdobersek@igalia.com>
2552
2553         Unreviewed build fix after r218484.
2554
2555         Properly access the GCryptCipherOperation type (now CipherOperation)
2556         in the PAL::GCrypt namespace. This somehow worked in local builds.
2557
2558         * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
2559         (WebCore::callOperation):
2560         (WebCore::gcryptAES_CTR):
2561
2562 2017-06-19  Zan Dobersek  <zdobersek@igalia.com>
2563
2564         [GCrypt] AES_CTR support
2565         https://bugs.webkit.org/show_bug.cgi?id=171420
2566
2567         Reviewed by Michael Catanzaro.
2568
2569         Implement AES_CTR support for build configurations that use libgcrypt.
2570
2571         Both encryption and decryption operations are handled in a single gcryptAES_CTR() function,
2572         with the specific operation being passed as the first argument. The appropriate AES
2573         algorithm is picked, and a gcry_cipher_hd_t object is created and has the given key set.
2574         This key will remain the same throughout the gcry_cipher_hd_t lifetime, even after
2575         gcry_cipher_reset() calls.
2576
2577         The encrypt/decrypt operation is wrapped into a helper lambda functor that accepts the
2578         given counter and input data. It resets the cipher object, sets the counter data, and
2579         performs the specified operation, returning the output data.
2580
2581         libgcrypt doesn't support setting counter data on a gcry_cipher_hd_t object with only
2582         part of that data being used as the actual counter, with the rest acting as a nonce, like
2583         the Web Crypto specification allows. We have to implement the support for that on our own.
2584
2585         We compute the number of blocks we'll be processing and the upper exclusive limit for the
2586         given counter length. We immediately bail if the counter limit is less than the computed
2587         block count, since that would mean that the counter values would be repeated.
2588
2589         We short-cut to a direct operation call if the counter length matches size of the counter
2590         data -- we don't have to adjust the counter data in any way if that's the case.
2591
2592         Otherwise we move counter data into the MPI format. The nonce and the actual counter MPIs
2593         can split out of the counter data MPI with the modulus operation and the counter limit MPI.
2594
2595         We take another shortcut straight to the operation call if we're able to determine that the
2596         'counter leeway' value, i.e. the difference between the initial counter MPI and the counter
2597         limit MPI, is larger or equal to the predicted block size -- if that's the case, the counter
2598         won't wrap around and change the nonce data.
2599
2600         In worst-case scenario the counter data will wrap around and we have to address that. The
2601         current implementation takes the slowest possible path for the moment, encrypting/decrypting
2602         each block separately. For each step the counter is combined with the nonce, the resulting
2603         MPI data retrieved and passed to the operation function, and the returned block output
2604         appended to the final output vector. The counter MPI is then incremented and ran through the
2605         modulus operation, limiting the MPI value to the previously-computed counter limit.
2606
2607         No new tests -- relevant tests are passing and are unskipped.
2608
2609         * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
2610         (WebCore::callOperation):
2611         (WebCore::gcryptAES_CTR):
2612         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
2613         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
2614
2615 2017-05-14 Frederic Wang  <fwang@igalia.com>
2616
2617         Add heuristic to avoid flattening "fullscreen" iframes
2618         https://bugs.webkit.org/show_bug.cgi?id=171914
2619
2620         Reviewed by Simon Fraser.
2621
2622         Some authors implement fullscreen popups as out-of-flow iframes with size set to full viewport (using vw/vh CSS units).
2623         When iframe flattening is enabled, such iframes may unexpectedly become larger than the viewport.
2624         This commit adds a simple heuristic to avoid frame flattening in that case.
2625         It is experimented by introducing a "enable for non-fullscreen iframes" state for the frame
2626         flattening setting.
2627         The default frame flattening is still either disabled or (fully) enabled on all platforms.
2628         InternalSettings is also adjusted so that the tests can still set the frame flattening setting.
2629
2630         Test: fast/frames/flattening/iframe-flattening-fullscreen.html
2631
2632         * page/FrameView.cpp:
2633         (WebCore::FrameView::frameFlatteningEnabled): Use the frame flattening enum setting.
2634         * page/Settings.h: Define a frame flattening enum that includes a "enable for non-fullscreen
2635         iframes" state.
2636         * page/Settings.in: Redefine frame flattening using that enum.
2637         * rendering/RenderFrameSet.cpp:
2638         (WebCore::RenderFrameSet::flattenFrameSet): Use the frame flattening enum setting.
2639         * rendering/RenderIFrame.cpp:
2640         (WebCore::RenderIFrame::isFullScreenIFrame): Add a heuristic when partial frame flattening
2641         is enabled setting is enabled.
2642         There is not a strict comparison against the viewport size since authors may not exactly use
2643         100vw/100vh.
2644         Anyway, it is hard to do such comparison using the resolved width & height on RenderStyle.
2645         (WebCore::RenderIFrame::flattenFrame): Add a comment for the existing "zero size" heuristic.
2646         Use isFullScreenIFrame heuristic.
2647         * rendering/RenderView.cpp:
2648         (WebCore::FrameFlatteningLayoutDisallower::FrameFlatteningLayoutDisallower): Use the frame flattening enum setting.
2649         * testing/InternalSettings.cpp:
2650         (WebCore::InternalSettings::Backup::Backup): Add backup for frame flattening.
2651         (WebCore::InternalSettings::Backup::restoreTo): Ditto.
2652         (WebCore::internalSettingsToWebCoreValue): Helper function to cast the frame flattening values.
2653         (WebCore::InternalSettings::setFrameFlattening): Redefine setFrameFlattening to accept an enum.
2654         * testing/InternalSettings.h: Define new enum & setter for frame flattening as well as a backup value.
2655         * testing/InternalSettings.idl: Define new enum & setter for frame flattening.
2656
2657 2017-06-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2658
2659         REGRESSION(r218253): Infinite animated gifs no longer loop
2660         https://bugs.webkit.org/show_bug.cgi?id=173464
2661
2662         Reviewed by Carlos Alberto Lopez Perez.
2663
2664         After the first loop iteration we keep rendering the same frame all the time, so it looks like if the animation
2665         stopped. This is because in r218253 we changed to use SharedBuffer instead of a Vector in ImageBackingStore, but
2666         we are not correctly copying the data in the copy constructor. We are using SharedBuffer::copy() that doesn't
2667         actually copy the data of the segments.
2668
2669         * platform/graphics/ImageBackingStore.h:
2670         (WebCore::ImageBackingStore::ImageBackingStore): Copy the data of the other SharedBuffer.
2671
2672 2017-06-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2673
2674         [GStreamer] MainThreadNotifier ASSERTION FAILED: m_boundThread == currentThread() in _WebKitWebSrcPrivate::~_WebKitWebSrcPrivate
2675         https://bugs.webkit.org/show_bug.cgi?id=152043
2676
2677         Reviewed by Xabier Rodriguez-Calvar.
2678
2679         Stop using a WeakPtr in MainThreadNotifier, because it's not thread safe, which causes a crash in debug builds when
2680         the notifier is destroyed in a different thread. Make MainThreadNotifier thread safe refcounted instead, and add
2681         an invalidate() method to mark it as invalid.
2682
2683         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
2684         (WebCore::InbandTextTrackPrivateGStreamer::handleSample):
2685         (WebCore::InbandTextTrackPrivateGStreamer::streamChanged):
2686         * platform/graphics/gstreamer/MainThreadNotifier.h:
2687         (WebCore::MainThreadNotifier::MainThreadNotifier): Deleted.
2688         (WebCore::MainThreadNotifier::notify): Deleted.
2689         (WebCore::MainThreadNotifier::cancelPendingNotifications): Deleted.
2690         (WebCore::MainThreadNotifier::addPendingNotification): Deleted.
2691         (WebCore::MainThreadNotifier::removePendingNotification): Deleted.
2692         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2693         (WebCore::MediaPlayerPrivateGStreamer::videoChangedCallback):
2694         (WebCore::MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback):
2695         (WebCore::MediaPlayerPrivateGStreamer::audioChangedCallback):
2696         (WebCore::MediaPlayerPrivateGStreamer::textChangedCallback):
2697         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2698         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
2699         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2700         (WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
2701         (WebCore::MediaPlayerPrivateGStreamerBase::muteChangedCallback):
2702         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2703         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2704         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
2705         (WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer):
2706         (WebCore::TrackPrivateBaseGStreamer::~TrackPrivateBaseGStreamer):
2707         (WebCore::TrackPrivateBaseGStreamer::disconnect):
2708         (WebCore::TrackPrivateBaseGStreamer::activeChangedCallback):
2709         (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
2710         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
2711         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2712         (webkit_web_src_init):
2713         (webKitWebSrcDispose):
2714         (webKitWebSrcStop):
2715         (webKitWebSrcStart):
2716         (webKitWebSrcNeedData):
2717         (webKitWebSrcEnoughData):
2718         (webKitWebSrcSeek):
2719
2720 2017-06-18  Ryosuke Niwa  <rniwa@webkit.org>
2721
2722         Meter element doesn't respect the writing direction
2723         https://bugs.webkit.org/show_bug.cgi?id=173507
2724
2725         Reviewed by Sam Weinig.
2726
2727         The bug was caused by NSLevelIndicatorCell no longer using the value of baseWritingDirection
2728         to determine the direction of rendering in macOS Sierra and later. It instead relies on
2729         the value of userInterfaceLayoutDirection.
2730
2731         Fixed the bug by setting both values. Once we dropped the support for macOS El Capitan
2732         and earlier, we can remove the code to set baseWritingDirection.
2733
2734         Test: fast/dom/HTMLMeterElement/meter-rtl.html
2735
2736         * rendering/RenderThemeMac.mm:
2737         (WebCore::RenderThemeMac::levelIndicatorFor):
2738
2739 2017-06-18  Dewei Zhu  <dewei_zhu@apple.com>
2740
2741         Remove 'EditCommand::isEditCommandComposition'.
2742         https://bugs.webkit.org/show_bug.cgi?id=173525
2743
2744         Reviewed by Wenson Hsieh.
2745
2746         Should remove 'isEditCommandComposition' from 'EditCommand' for:
2747             1. 'EditCommandComposition' is no longer a subclass of EditCommand.
2748             2. 'isEditCommandComposition' is not used at all.
2749
2750         * editing/EditCommand.h:
2751         (WebCore::EditCommand::isCompositeEditCommand):
2752         (WebCore::EditCommand::isEditCommandComposition): Deleted.
2753
2754 2017-06-18  Chris Dumez  <cdumez@apple.com>
2755
2756         Crash when re-entering MediaDevicesEnumerationRequest::cancel()
2757         https://bugs.webkit.org/show_bug.cgi?id=173522
2758         <rdar://problem/31185739>
2759
2760         Reviewed by Darin Adler.
2761
2762         When a MediaDevicesRequest is started, it creates a MediaDevicesEnumerationRequest
2763         object and passes a completion handler to that MediaDevicesEnumerationRequest
2764         object. The completion handler holds a reference to the MediaDevicesRequest object
2765         so that its stays alive until the MediaDevicesEnumerationRequest either completes
2766         or is canceled. MediaDevicesRequest also holds a reference to the
2767         MediaDevicesEnumerationRequest object via its m_enumerationRequest data member.
2768
2769         When the document is destroyed, both MediaDevicesRequest::contextDestroyed() and
2770         MediaDevicesEnumerationRequest::contextDestroyed() gets called and the other is not
2771         pre-determined. If MediaDevicesEnumerationRequest::contextDestroyed() gets called
2772         first then it calls MediaDevicesEnumerationRequest::cancel(). Calling cancel() ends
2773         up destroying the completion handler. Destroying the completion handler ends up
2774         dereferencing and destroying the MediaDevicesRequest object. The MediaDevicesRequest
2775         destructor would call MediaDevicesEnumerationRequest::cancel() again, causing us to
2776         re-enter it and assign nullptr to the completion callback again. Re-entering
2777         std::function's operator=(nullptr_t) is not safe because of the way it is implemented
2778         as we end up trying to destroy the lambda twice and crashing. Using a WTF::Function
2779         instead fixes this particular issue because re-entering WTF::Function's operator=(nullptr_t)
2780         is safe.
2781
2782         However, this fix is not sufficient. Calling the MediaDevicesRequest destructor also
2783         dereferencing and destroys the MediaDevicesEnumerationRequest object. As a result,
2784         when MediaDevicesEnumerationRequest::contextDestroyed() returns from its call to cancel
2785         |this| is already dead when we call ContextDestructionObserver::contextDestroyed().
2786         To address this issue, we now protect |this| in MediaDevicesEnumerationRequest::contextDestroyed().
2787
2788         Test: fast/mediastream/destroy-document-while-enumerating-devices.html
2789
2790         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
2791         (WebCore::MediaDevicesEnumerationRequest::contextDestroyed):
2792         Protect |this| as the call to cancel() may destroy |this| before calling
2793         ContextDestructionObserver::contextDestroyed() otherwise.
2794
2795         * Modules/mediastream/MediaDevicesEnumerationRequest.h:
2796         Use WTF::Function instead of std::function for the completion handler as
2797         it is safer (in terms of re-entrency) and avoids unnecessary copying.
2798
2799         * Modules/mediastream/MediaDevicesRequest.cpp:
2800         (WebCore::MediaDevicesRequest::~MediaDevicesRequest):
2801         Stop calling MediaDevicesEnumerationRequest::cancel(). When the destructor
2802         is called, the MediaDevicesEnumerationRequest has either completed or been
2803         canceled so there is no need to cancel again. I added an assertion to
2804         make sure it is the case. This avoids re-entering
2805         MediaDevicesEnumerationRequest::cancel() is some cases, which was risky.
2806
2807         (WebCore::MediaDevicesRequest::start):
2808         Add comment for clarity and capture a Ref<> instead of a RefPtr<> now that
2809         we can since we use WTF::Function.
2810
2811 2017-06-18  Chris Dumez  <cdumez@apple.com>
2812
2813         Use WTF::Function instead of std::function in WTF/
2814         https://bugs.webkit.org/show_bug.cgi?id=173519
2815
2816         Reviewed by Sam Weinig.
2817
2818         Replace a few uses of std::function with WTF::Function in WebCore/
2819         as well. It was either this or including <functional> and I decided
2820         it made more sense to port the code.
2821
2822         * platform/graphics/FontSelectionAlgorithm.h:
2823         (WebCore::FontSelectionAlgorithm::iterateActiveCapabilitiesWithReturn):
2824         * platform/mediastream/MediaConstraints.cpp:
2825         (WebCore::StringConstraint::find):
2826         (WebCore::MediaTrackConstraintSetMap::forEach):
2827         (WebCore::MediaTrackConstraintSetMap::filter):
2828         (WebCore::MediaConstraints::isConstraintSet):
2829         * platform/mediastream/MediaConstraints.h:
2830         (WebCore::NumericConstraint::find):
2831         * platform/mediastream/RealtimeMediaSource.cpp:
2832         (WebCore::RealtimeMediaSource::applyConstraint):
2833
2834 2017-06-18  Jer Noble  <jer.noble@apple.com>
2835
2836         [MSE] Seeking or entering fullscreen can cause extreme CPU usage
2837         https://bugs.webkit.org/show_bug.cgi?id=173505
2838
2839         Reviewed by Tim Horton.
2840
2841         When support for painting MSE to WebGL was added in r217185, the implementation of
2842         SourceBufferPrivateAVFObjC::isReadyForMoreSamples() was modified to support asking
2843         the decompression session if it was ready. That change, however, caused an extreme
2844         performance regression in the normal playback path, where WebKit will effectively
2845         append samples endlessly to the AVSampleBufferDisplayLayer, which admirably enqueued
2846         each of them for decoding. Eventually, the cost of iterating over the CMBufferQueue
2847         overwhelmed the cost of decoding, and caused the extreme lag seen when seeking.
2848
2849         Make sure to property query the AVSampleBufferDisplayLayer for isReadyForMoreMediaData
2850         before enqueuing.
2851
2852         A previous version of this patch exposed some errors which caused failing tests:
2853
2854         In sourceBufferPrivateDidReceiveSample(), we were using local versions of
2855         presentationTimestamp and decodeTimestamp as keys to the decodeQueue; those local versions
2856         were floating point values (because MediaTime + float = float), but the sample itself uses
2857         non-floating point MediaTimes. This causes samples to be left in the queue when they should
2858         be removed.
2859
2860         In didBecomeReadyForMoreSamples(), we were getting spurious assertions when a
2861         AVSampleBufferDisplayLayer or a AVSampleBufferAudioRenderer would fire a callback from
2862         -requestMediaDataWhenReadyOnQueue:usingBlock: even after it had been told to
2863         -stopRequestingMediaData. Apparently it's expected behavior and so an ASSERT_NOT_REACHED is
2864         inappropriate here.
2865
2866         * Modules/mediasource/SourceBuffer.cpp:
2867         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2868         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2869         (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples):
2870         (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):
2871
2872
2873 2017-06-17  Zalan Bujtas  <zalan@apple.com>
2874
2875         Addressing post-review comment after r218456.
2876         https://bugs.webkit.org/show_bug.cgi?id=173509
2877
2878         Reviewed by Darin Adler.
2879
2880         * dom/Document.cpp:
2881         (WebCore::Document::destroyRenderTree):
2882
2883 2017-06-17  Chris Dumez  <cdumez@apple.com>
2884
2885         DOMQuad::getBounds() should return a Ref<>
2886         https://bugs.webkit.org/show_bug.cgi?id=173517
2887
2888         Reviewed by Simon Fraser.
2889
2890         DOMQuad::getBounds() should return a Ref<> as it cannot return
2891         null.
2892
2893         * dom/DOMQuad.cpp:
2894         (WebCore::DOMQuad::getBounds):
2895         * dom/DOMQuad.h:
2896
2897 2017-06-17  Simon Fraser  <simon.fraser@apple.com>
2898
2899         Implement DOMQuad
2900         https://bugs.webkit.org/show_bug.cgi?id=163534
2901
2902         Reviewed by Sam Weinig.
2903
2904         Implement DOMQuad per https://drafts.fxtf.org/geometry/#DOMQuad, other than serialization
2905         which requires some bindings changes.
2906
2907         web-platform-tests/css/geometry-1/DOMRect-001.html tests against an older version of the spec,
2908         so has some failures. DOMQuad-002.html passes, other than a NaN propagation issue that requires
2909         spec clarification.
2910
2911         * CMakeLists.txt:
2912         * DerivedSources.make:
2913         * WebCore.xcodeproj/project.pbxproj:
2914         * bindings/js/JSDOMQuadCustom.cpp: Added.
2915         (WebCore::JSDOMQuad::getBounds):
2916         * bindings/scripts/CodeGenerator.pm:
2917         (IsSerializableDOMType):
2918         (IsSerializableAttribute):
2919         * dom/DOMPoint.h:
2920         * dom/DOMQuad.cpp: Added.
2921         (WebCore::DOMQuad::DOMQuad):
2922         (WebCore::DOMQuad::getBounds):
2923         * dom/DOMQuad.h: Added.
2924         (WebCore::DOMQuad::create):
2925         (WebCore::DOMQuad::fromRect):
2926         (WebCore::DOMQuad::fromQuad):
2927         (WebCore::DOMQuad::p1):
2928         (WebCore::DOMQuad::p2):
2929         (WebCore::DOMQuad::p3):
2930         (WebCore::DOMQuad::p4):
2931         * dom/DOMQuad.idl: Added.
2932         * dom/DOMQuadInit.h: Added.
2933         * dom/DOMQuadInit.idl: Added.
2934
2935 2017-06-17  Chris Dumez  <cdumez@apple.com>
2936
2937         Use WTF::Function instead of std::function in WebKit2/
2938         https://bugs.webkit.org/show_bug.cgi?id=173504
2939
2940         Reviewed by Darin Adler.
2941
2942         Use WTF::Function instead of std::function in WebKit2/ to avoid
2943         unnecessary copying.
2944
2945         * Modules/applepay/PaymentCoordinator.cpp:
2946         (WebCore::PaymentCoordinator::canMakePaymentsWithActiveCard):
2947         (WebCore::PaymentCoordinator::openPaymentSetup):
2948         * Modules/applepay/PaymentCoordinator.h:
2949         * Modules/applepay/PaymentCoordinatorClient.h:
2950         * loader/EmptyClients.cpp:
2951         * loader/NetscapePlugInStreamLoader.cpp:
2952         (WebCore::NetscapePlugInStreamLoader::willSendRequest):
2953         * loader/NetscapePlugInStreamLoader.h:
2954         * loader/ResourceLoader.cpp:
2955         (WebCore::ResourceLoader::willSendRequest):
2956         * loader/ResourceLoader.h:
2957
2958 2017-06-17  Zalan Bujtas  <zalan@apple.com>
2959
2960         Demote the "we have navigated away" check to an assertion.
2961         https://bugs.webkit.org/show_bug.cgi?id=173509
2962
2963         Reviewed by Simon Fraser.
2964
2965         Now that the expected behavior is that the render tree can't get to the page cache, it's ok to assert.
2966         TODO: We should also have view() check removed at some point.
2967
2968         * dom/Document.cpp:
2969         (WebCore::Document::destroyRenderTree):
2970
2971 2017-06-17  Alex Christensen  <achristensen@webkit.org>
2972
2973         Fix CMake build
2974
2975         * PlatformMac.cmake:
2976         * bindings/js/ScriptGlobalObject.cpp:
2977
2978 2017-06-17  Commit Queue  <commit-queue@webkit.org>
2979
2980         Unreviewed, rolling out r218438.
2981         https://bugs.webkit.org/show_bug.cgi?id=173515
2982
2983         Caused imported/w3c/web-platform-tests/media-
2984         source/mediasource* tests to fail (Requested by smfr on
2985         #webkit).
2986
2987         Reverted changeset:
2988
2989         "[MSE] Seeking or entering fullscreen can cause extreme CPU
2990         usage"
2991         https://bugs.webkit.org/show_bug.cgi?id=173505
2992         http://trac.webkit.org/changeset/218438
2993
2994 2017-06-17  Antti Koivisto  <antti@apple.com>
2995
2996         Crash due to infinite recursion via FrameSelection::updateAppearanceAfterLayout
2997         https://bugs.webkit.org/show_bug.cgi?id=173468
2998
2999         Reviewed by Ryosuke Niwa.
3000
3001         Test: editing/selection/updateAppearanceAfterLayout-recursion.html
3002
3003         Calling FrameSelection::updateAppearanceAfterLayout() from Document::resolveStyle is unsafe
3004         because it may cause another call to resolveStyle. We have some cases where the style
3005         is still unclean when updateAppearanceAfterLayout() is called. This can lead to infinite
3006         recursion.
3007
3008         The test case is not the common stack seen in CrashTracer (couldn't quit replicate it) but
3009         the updateAppearanceAfterLayout/resolveStyle recursion is the same.
3010
3011         * dom/Document.cpp:
3012         (WebCore::Document::resolveStyle):
3013
3014             Normally selection appearance update is done in post-layout but not all style resolutions schedule a layout.
3015             Invoke it asynchronously in that case instead of the previous synchronous call.
3016
3017         * editing/FrameSelection.cpp:
3018         (WebCore::FrameSelection::FrameSelection):
3019         (WebCore::FrameSelection::updateAppearanceAfterLayout):
3020         (WebCore::FrameSelection::scheduleAppearanceUpdateAfterStyleChange):
3021         (WebCore::FrameSelection::appearanceUpdateTimerFired):
3022         (WebCore::FrameSelection::updateAppearanceAfterLayoutOrStyleChange):
3023         * editing/FrameSelection.h:
3024
3025 2017-06-17  Alex Christensen  <achristensen@webkit.org>
3026
3027         Fix Mac CMake build.
3028
3029         * PlatformMac.cmake:
3030
3031 2017-06-17  Ryosuke Niwa  <rniwa@webkit.org>
3032
3033         REGRESSION(r209495): materiauxlaverdure.com fails to load
3034         https://bugs.webkit.org/show_bug.cgi?id=173301
3035         <rdar://problem/32624850>
3036
3037         Reviewed by Antti Koivisto.
3038
3039         The bug was caused by WebKit wrapping CSS string values with single quotation marks instead of
3040         double quotation marks as spec'ed in https://drafts.csswg.org/cssom/#serialize-a-string and
3041         implemented in Firefox and Chrome.
3042
3043         The website eval's the computed value of the `content` CSS property with the value `'{name: "flat"}'`
3044         after stripping single quotation marks from both ends. Prior to r209495, WebKit serialized this CSS value
3045         in single quotations without escaping double quotations. After r209495, double quotations are escaped
3046         with backslashes as `'{name: \"flat\"}'`. As a result, `eval` is invoked with `{name: \"flat\"}`
3047         after stripping single quotations from both ends, which resulted in an exception.
3048
3049         Chrome and Firefox don't encounter this exception despite of the fact they escape double quotations
3050         as well because serialize with double quotations as `"{name: \"flat\"}"`. Because there is no code
3051         to strip double quotations, eval is invoked with the same string, resulting in the entire value as
3052         being parsed as string, instead of an object with a single key "name" with the value of "flat" as
3053         was the case in WebKit prior to r209495. While this behavior was most certainly not the intent of
3054         the website author, Chrome and Firefox don't encounter an exception and the website continues to work.
3055
3056         This patch aligns WebKit's behavior to that of the CSS OM specification, Firefox, and Chrome by
3057         serializing CSS string values using double quotation marks instead of single quotation marks.
3058
3059         Note: inline change log comments are added below for every call site of serializeString for clarity.
3060
3061         Test: fast/css/getPropertyValue-serialization-with-double-quotes.html
3062
3063         * css/CSSBasicShapes.cpp:
3064         (WebCore::buildPathString): Use double quotation marks in path(~) of shapes.
3065         * css/CSSMarkup.cpp:
3066         (WebCore::serializeString):
3067         (WebCore::serializeURL): Use double quotation marks to serialize URLs.
3068         (WebCore::serializeAsStringOrCustomIdent): Use double quotation marks to serialize strings. We still avoid
3069         using wrapping the value with double quotations when the value can be an identifier. See r209495.
3070         (WebCore::serializeFontFamily): Ditto for font-family names such as "San Francisco".
3071         * css/CSSMarkup.h:
3072         * css/CSSNamespaceRule.cpp:
3073         (WebCore::CSSNamespaceRule::cssText): Use double quotation marks to serialize namespace URIs.
3074         * css/CSSPrimitiveValue.cpp:
3075         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Use double quotation marks to serialize
3076         the separators; e.g. counter(sectionNumber, ".") to produce "1.".
3077         * css/CSSSelector.cpp:
3078         (WebCore::CSSSelector::selectorText): Use double quotation marks to serialize attribute values.
3079         * css/parser/CSSParserToken.cpp:
3080         (WebCore::CSSParserToken::serialize): Use double quotation marks to serialize strings in @support.
3081         * editing/EditingStyle.cpp:
3082         (WebCore::StyleChange::extractTextStyles): Updated to strip double quotation marks in font family names to
3083         maintain the compatibility with old versions of Microsoft Outlook.
3084         * html/HTMLElement.cpp:
3085         (WebCore::HTMLElement::mapLanguageAttributeToLocale): Use double quotations marks to serialize the value
3086         of the lang content attribute. It doesn't matter which one is used here because it's only a temporary value
3087         only fed into the CSS parser to set the equivalent CSS value from the content attribute.
3088
3089 2017-06-16  Matt Baker  <mattbaker@apple.com>
3090
3091         Web Inspector: Instrument 2D/WebGL canvas contexts in the backend
3092         https://bugs.webkit.org/show_bug.cgi?id=172623
3093         <rdar://problem/32415986>
3094
3095         Reviewed by Devin Rousso and Joseph Pecoraro.
3096
3097         Test: inspector/canvas/create-canvas-contexts.html
3098
3099         * CMakeLists.txt:
3100         * WebCore.xcodeproj/project.pbxproj:
3101
3102         * dom/Document.cpp:
3103         (WebCore::Document::getCSSCanvasElement):
3104         Instrument creation of CSS canvases. This merely registers the canvas
3105         element with InspectorCanvasAgent and stores the name (identifier passed
3106         to getCSSCanvasContext) for later use. It isn't until the context is
3107         actually created that the frontend receives a notification.
3108
3109         * html/HTMLCanvasElement.cpp:
3110         (WebCore::HTMLCanvasElement::getContext2d):
3111         (WebCore::HTMLCanvasElement::getContextWebGL):
3112         Instrument creation of 2D and WebGL canvas contexts.
3113
3114         * inspector/InspectorAllInOne.cpp:
3115
3116         * inspector/InspectorCanvasAgent.cpp: Added.
3117         New backend agent for canvas inspection. Canvas creation and destruction
3118         are continuously monitored by the agent, regardless of the presence of
3119         a frontend. This is necessary since there is no way to retrieve the
3120         rendering contexts for with a given frame once they've been created.
3121
3122         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
3123         (WebCore::InspectorCanvasAgent::didCreateFrontendAndBackend):
3124         (WebCore::InspectorCanvasAgent::willDestroyFrontendAndBackend):
3125         (WebCore::InspectorCanvasAgent::discardAgent):
3126         Unregister canvas observers to prevent dangling agent pointer.
3127         (WebCore::InspectorCanvasAgent::enable):
3128         Dispatch events for existing canvases, now that the frontend exists.
3129         (WebCore::InspectorCanvasAgent::disable):
3130         (WebCore::InspectorCanvasAgent::frameNavigated):
3131         (WebCore::InspectorCanvasAgent::didCreateCSSCanvas):
3132         Register the name/identifier associated with the CSS canvas, so that it
3133         can be retrieved and associated with the rendering context later.
3134
3135         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
3136         (WebCore::InspectorCanvasAgent::canvasDestroyed):
3137         Removes the canvas from the agent, and queues it for notifying the
3138         frontend during the next event loop.
3139
3140         (WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):
3141         (WebCore::InspectorCanvasAgent::clearCanvasData):
3142         (WebCore::InspectorCanvasAgent::getCanvasEntry):
3143         (WebCore::InspectorCanvasAgent::buildObjectForCanvas):
3144         * inspector/InspectorCanvasAgent.h: Added.
3145
3146         * inspector/InspectorController.cpp:
3147         (WebCore::InspectorController::InspectorController):
3148
3149         * inspector/InspectorInstrumentation.cpp:
3150         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
3151         (WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl):
3152         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl):
3153
3154         * inspector/InspectorInstrumentation.h:
3155         (WebCore::InspectorInstrumentation::didCreateCSSCanvas):
3156         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
3157         These instrumentation points should not fast return when no frontend
3158         is attached.
3159
3160         * inspector/InstrumentingAgents.cpp:
3161         (WebCore::InstrumentingAgents::reset):
3162
3163         * inspector/InstrumentingAgents.h:
3164         (WebCore::InstrumentingAgents::inspectorCanvasAgent):
3165         (WebCore::InstrumentingAgents::setInspectorCanvasAgent):
3166         Plumbing for the new agent.
3167
3168 2017-06-16  Antoine Quint  <graouts@apple.com>
3169
3170         Add a WebKit2 setting to control whether media documents should automatically enter fullscreen
3171         https://bugs.webkit.org/show_bug.cgi?id=173503
3172
3173         Reviewed by Tim Horton.
3174
3175         New WebCore setting to specify whether a media document should automatically enter fullscreen.
3176
3177         * page/Settings.in:
3178
3179 2017-06-16  Jer Noble  <jer.noble@apple.com>
3180
3181         [MSE] Seeking or entering fullscreen can cause extreme CPU usage
3182         https://bugs.webkit.org/show_bug.cgi?id=173505
3183
3184         Reviewed by Tim Horton.
3185
3186         When support for painting MSE to WebGL was added in r217185, the implementation of
3187         SourceBufferPrivateAVFObjC::isReadyForMoreSamples() was modified to support asking
3188         the decompression session if it was ready. That change, however, caused an extreme
3189         performance regression in the normal playback path, where WebKit will effectively
3190         append samples endlessly to the AVSampleBufferDisplayLayer, which admirably enqueued
3191         each of them for decoding. Eventually, the cost of iterating over the CMBufferQueue
3192         overwhelmed the cost of decoding, and caused the extreme lag seen when seeking.
3193
3194         Make sure to property query the AVSampleBufferDisplayLayer for isReadyForMoreMediaData
3195         before enqueuing.
3196
3197         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3198         (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples):
3199
3200 2017-06-16  Sam Weinig  <sam@webkit.org>
3201
3202         [WebIDL] Remove custom bindings for HTMLDocument
3203         https://bugs.webkit.org/show_bug.cgi?id=173444
3204
3205         Reviewed by Darin Adler.
3206
3207         * bindings/js/JSDOMBindingSecurity.cpp:
3208         (WebCore::canAccessDocument):
3209         (WebCore::BindingSecurity::shouldAllowAccessToFrame):
3210         (WebCore::BindingSecurity::shouldAllowAccessToDOMWindow):
3211         * bindings/js/JSDOMWindowCustom.cpp:
3212         (WebCore::JSDOMWindow::showModalDialog):
3213         Pass ExecState by reference to window accessors.
3214
3215         * bindings/js/JSDOMWindowBase.cpp:
3216         (WebCore::incumbentDOMWindow):
3217         (WebCore::activeDOMWindow):
3218         (WebCore::firstDOMWindow):
3219         (WebCore::callerDocument):
3220         * bindings/js/JSDOMWindowBase.h:
3221         Pass ExecState by reference to window accessors and add callerDocument.
3222     
3223         * bindings/js/JSHTMLDocumentCustom.cpp:
3224         (WebCore::JSHTMLDocument::getOwnPropertySlot): Deleted.
3225         (WebCore::JSHTMLDocument::all): Deleted.
3226         (WebCore::JSHTMLDocument::setAll): Deleted.
3227         (WebCore::findCallingDocument): Deleted.
3228         (WebCore::JSHTMLDocument::open): Deleted.
3229         (WebCore::documentWrite): Deleted.
3230         (WebCore::JSHTMLDocument::write): Deleted.
3231         Remove custom bindings.
3232
3233         * bindings/scripts/CodeGeneratorJS.pm:
3234         (GenerateCallWith):
3235         Add support CallWith=CallerDocument
3236
3237         * bindings/scripts/IDLAttributes.json:
3238         Remove CallerWindow, which has not been supported for a while. CallerDocument, despite 
3239         having it's support removed in the past, was still listed, so keep it.
3240
3241         * bindings/scripts/test/JS/JSTestObj.cpp:
3242         Update test results.
3243
3244         * dom/DOMImplementation.cpp:
3245         (WebCore::DOMImplementation::createHTMLDocument):
3246         Update for new signature of Document.write().
3247
3248         * dom/Document.h:
3249         * dom/Document.idl:
3250         * dom/Document.cpp:
3251         (WebCore::Document::open):
3252         Add DOMWindow returning overload that calls through to the DOMWindow.
3253         Add return value and currently not utilized parameters to the Document returning overload.
3254         Update to return exceptions as specified.
3255
3256         (WebCore::Document::close):
3257         Update to return exceptions as specified.
3258
3259         (WebCore::Document::write):
3260         (WebCore::Document::writeln):
3261         Update to take a Vector<String> argument and the caller Document first
3262         as per convention and return exceptions as specified.
3263
3264         (WebCore::Document::bgColor):
3265         (WebCore::Document::setBgColor):
3266         (WebCore::Document::fgColor):
3267         (WebCore::Document::setFgColor):
3268         (WebCore::Document::alinkColor):
3269         (WebCore::Document::setAlinkColor):
3270         (WebCore::Document::linkColorForBindings):
3271         (WebCore::Document::setLinkColorForBindings):
3272         (WebCore::Document::vlinkColor):
3273         (WebCore::Document::setVlinkColor):
3274         (WebCore::Document::clear):
3275         (WebCore::Document::captureEvents):
3276         (WebCore::Document::releaseEvents):
3277         Move from HTMLDocument.
3278
3279         * html/HTMLDocument.cpp:
3280         (WebCore::HTMLDocument::bgColor): Deleted.
3281         (WebCore::HTMLDocument::setBgColor): Deleted.
3282         (WebCore::HTMLDocument::fgColor): Deleted.
3283         (WebCore::HTMLDocument::setFgColor): Deleted.
3284         (WebCore::HTMLDocument::alinkColor): Deleted.
3285         (WebCore::HTMLDocument::setAlinkColor): Deleted.
3286         (WebCore::HTMLDocument::linkColor): Deleted.
3287         (WebCore::HTMLDocument::setLinkColor): Deleted.
3288         (WebCore::HTMLDocument::vlinkColor): Deleted.
3289         (WebCore::HTMLDocument::setVlinkColor): Deleted.
3290         (WebCore::HTMLDocument::clear): Deleted.
3291         (WebCore::HTMLDocument::captureEvents): Deleted.
3292         (WebCore::HTMLDocument::releaseEvents): Deleted.
3293         * html/HTMLDocument.h:
3294         * html/HTMLDocument.idl:
3295         Moved operations and attributes to Document.
3296
3297         * inspector/DOMPatchSupport.cpp:
3298         (WebCore::DOMPatchSupport::patchDocument):
3299         Update for new signature of Document.write().
3300
3301         * page/DOMWindow.cpp:
3302         (WebCore::DOMWindow::postMessage):
3303         (WebCore::DOMWindow::focus):
3304         * page/DOMWindow.h:
3305         Use the term incumbentWindow, matching IDL, and so not to be confused
3306         with the callerWindow, which is slightly different.
3307
3308 2017-06-16  Daniel Bates  <dabates@apple.com>
3309
3310         Remove header OptionSet.h from FrameLoaderTypes.h
3311         https://bugs.webkit.org/show_bug.cgi?id=173489
3312
3313         Reviewed by Joseph Pecoraro.
3314
3315         Although the header FrameLoaderTypes.h defines exactly one enum class, ReloadOption, whose
3316         enumerators conform the power of two prerequisite for parameterizing an OptionSet for it
3317         FrameLoaderTypes.h does not actually make use of the functionality provided by header
3318         OptionSet.h. And not all source files that include FrameLoaderTypes.h need to use an OptionSet.
3319
3320         * loader/DocumentLoader.h: Include <wtf/OptionSet.h>.
3321         * loader/FrameLoader.h: Ditto.
3322         * loader/FrameLoaderTypes.h: Remove header <wtf/OptionSet.h>.
3323         * replay/UserInputBridge.h: Include <wtf/Forward.h>.
3324
3325 2017-06-16  Wenson Hsieh  <wenson_hsieh@apple.com>
3326
3327         [iOS DnD] Upstream iOS drag and drop implementation into OpenSource WebKit
3328         https://bugs.webkit.org/show_bug.cgi?id=173366
3329         <rdar://problem/32767014>
3330
3331         Reviewed by Tim Horton.
3332
3333         Moves all drag and drop logic previously hidden behind WebKitAdditions into the open source repository, along
3334         with unit test pages in TestWebKitAPI. Also removes all #includes and #imports of dragging-related files in
3335         WebKitAdditions from the open source repository.
3336
3337         This initial upstreaming phase is only concerned with moving code out of WebKitAdditions, and attempts to
3338         preserve the code as-is, with the exception of trivial style changes so that the open source linter passes.
3339         Future patches will remove the DATA_INTERACTION feature flag altogether and unobscure all variable and function
3340         names referencing "data interaction".
3341
3342         No change in behavior from the internal build.
3343
3344         * Configurations/FeatureDefines.xcconfig:
3345         * page/ios/EventHandlerIOS.mm:
3346         (WebCore::EventHandler::createDraggingDataTransfer):
3347         (WebCore::EventHandler::eventLoopHandleMouseDragged):
3348         (WebCore::EventHandler::tryToBeginDataInteractionAtPoint):
3349         * platform/ios/DragImageIOS.mm:
3350         (WebCore::dragImageSize):
3351         (WebCore::scaleDragImage):
3352         (WebCore::createDragImageFromImage):
3353         (WebCore::deleteDragImage):
3354         (WebCore::createDragImageForLink):
3355         (WebCore::createDragImageIconForCachedImageFilename):
3356         (WebCore::platformAdjustDragImageForDeviceScaleFactor):
3357         (WebCore::createDragImageForSelection):
3358         (WebCore::dissolveDragImageToFraction):
3359         * platform/ios/PasteboardIOS.mm:
3360         (WebCore::Pasteboard::Pasteboard):
3361         (WebCore::Pasteboard::setDragImage):
3362         (WebCore::Pasteboard::createForDragAndDrop):
3363         * platform/mac/DragDataMac.mm:
3364         (WebCore::rtfPasteboardType):
3365         (WebCore::rtfdPasteboardType):
3366         (WebCore::stringPasteboardType):
3367         (WebCore::urlPasteboardType):
3368         (WebCore::htmlPasteboardType):
3369         (WebCore::colorPasteboardType):
3370         (WebCore::pdfPasteboardType):
3371         (WebCore::tiffPasteboardType):
3372         (WebCore::DragData::asFilenames):
3373         (WebCore::DragData::containsURL):
3374         (rtfPasteboardType): Deleted.
3375         (rtfdPasteboardType): Deleted.
3376         (stringPasteboardType): Deleted.
3377         (urlPasteboardType): Deleted.
3378         (htmlPasteboardType): Deleted.
3379         (colorPasteboardType): Deleted.
3380         (pdfPasteboardType): Deleted.
3381         (tiffPasteboardType): Deleted.
3382
3383 2017-06-16  Youenn Fablet  <youenn@apple.com>
3384
3385         addTransceiver should trigger mid generation in the SDP
3386         https://bugs.webkit.org/show_bug.cgi?id=173452
3387
3388         Reviewed by Alex Christensen.
3389
3390         Test: webrtc/video-addTransceiver.html
3391
3392         Adding support for recvonly SDP based on call to addTransceiver.
3393         Using offer_to_receive options of libwebrtc for that purpose.
3394
3395         Making sure that addTransceiver and using a real track afterwards is working too.
3396
3397         * Modules/mediastream/RTCPeerConnection.cpp:
3398         (WebCore::RTCPeerConnection::enqueueReplaceTrackTask): notify the backend that a track is added in case the sender has no track.
3399         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3400         (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveAudio): Detect whether some audio mid should be recvonly.
3401         (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveVideo): Detect whether some video mid should be recvonly.
3402         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
3403         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3404         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
3405
3406 2017-06-16  Youenn Fablet  <youenn@apple.com>
3407
3408         WebCore::LibWebRTCMediaEndpoint::gatherStatsForLogging is crashing
3409         https://bugs.webkit.org/show_bug.cgi?id=173493
3410
3411         Reviewed by Eric Carlson.
3412
3413         Speculative preventive fix.
3414
3415         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3416         (WebCore::LibWebRTCMediaEndpoint::gatherStatsForLogging):
3417
3418 2017-06-16  Alex Christensen  <achristensen@webkit.org>
3419