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