MediaStreamTrack id should be preserved by PeerConnection
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-04-08  Youenn Fablet  <youenn@apple.com>
2
3         MediaStreamTrack id should be preserved by PeerConnection
4         https://bugs.webkit.org/show_bug.cgi?id=170624
5
6         Reviewed by Eric Carlson.
7
8         Covered by updated test.
9
10         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
11         (WebCore::createReceiverForSource): Setting track id according source id.
12
13 2017-04-08  Chris Dumez  <cdumez@apple.com>
14
15         Timer's nextFireInterval() / repeatInterval() should return Seconds
16         https://bugs.webkit.org/show_bug.cgi?id=170639
17
18         Reviewed by Simon Fraser.
19
20         Timer's nextFireInterval() / repeatInterval() should return Seconds, not double.
21
22         * loader/NavigationScheduler.cpp:
23         * page/DOMTimer.cpp:
24         (WebCore::DOMTimer::updateTimerIntervalIfNecessary):
25         * page/SuspendableTimer.cpp:
26         (WebCore::SuspendableTimer::suspend):
27         (WebCore::SuspendableTimer::repeatInterval):
28         * page/SuspendableTimer.h:
29         * page/animation/AnimationBase.cpp:
30         (WebCore::AnimationBase::timeToNextService):
31         (WebCore::AnimationBase::getTimeToNextEvent):
32         (WebCore::AnimationBase::goIntoEndingOrLoopingState):
33         * page/animation/AnimationBase.h:
34         * page/animation/CSSAnimationController.cpp:
35         (WebCore::CSSAnimationControllerPrivate::updateAnimations):
36         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimerForRenderer):
37         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
38         (WebCore::CSSAnimationControllerPrivate::animationFrameCallbackFired):
39         * page/animation/CSSAnimationControllerPrivate.h:
40         * page/animation/CompositeAnimation.cpp:
41         (WebCore::CompositeAnimation::timeToNextService):
42         * page/animation/CompositeAnimation.h:
43         * page/animation/ImplicitAnimation.cpp:
44         (WebCore::ImplicitAnimation::timeToNextService):
45         * page/animation/ImplicitAnimation.h:
46         * page/animation/KeyframeAnimation.cpp:
47         (WebCore::KeyframeAnimation::timeToNextService):
48         * page/animation/KeyframeAnimation.h:
49         * platform/ThreadTimers.cpp:
50         (WebCore::ThreadTimers::sharedTimerFiredInternal):
51         * platform/Timer.cpp:
52         (WebCore::TimerBase::nextFireInterval):
53         * platform/Timer.h:
54         (WebCore::TimerBase::repeatInterval):
55         * platform/graphics/ca/TileController.cpp:
56         (WebCore::TileController::setIsInWindow):
57         (WebCore::TileController::scheduleTileRevalidation):
58         * platform/graphics/ca/TileController.h:
59         * platform/graphics/ca/TileGrid.cpp:
60         (WebCore::TileGrid::revalidateTiles):
61
62 2017-04-08  Csaba Osztrogonác  <ossy@webkit.org>
63
64         Unreviewed Mac cmake buildfix after r215051, just for fun.
65         https://bugs.webkit.org/show_bug.cgi?id=169761
66
67         * PlatformMac.cmake:
68
69 2017-04-07  Simon Fraser  <simon.fraser@apple.com>
70
71         Build fix: TimerBase::start(double, double) can't be inline and exported,
72         so make it non-inline.
73
74         * platform/Timer.cpp:
75         (WebCore::TimerBase::start):
76         * platform/Timer.h:
77         (WebCore::TimerBase::start): Deleted.
78
79 2017-04-07  Chris Dumez  <cdumez@apple.com>
80
81         REGRESSION (r203941): iAd Producer widgets fail to play in iBooks
82         https://bugs.webkit.org/show_bug.cgi?id=170635
83         <rdar://problem/30797958>
84
85         Reviewed by Daniel Bates.
86
87         Extend the MouseEvent::initMouseEvent() workaround we added for iAd Producer
88         to iBooks since the iBooks widgets generated by iAd Producer contain the same
89         bug.
90
91         * dom/MouseEvent.cpp:
92         (WebCore::MouseEvent::initMouseEventQuirk):
93
94 2017-04-07  Chris Dumez  <cdumez@apple.com>
95
96         Start using MonotonicTime / Seconds in Timer class
97         https://bugs.webkit.org/show_bug.cgi?id=170625
98
99         Reviewed by Simon Fraser.
100
101         Start using MonotonicTime / Seconds in Timer class. More work will be needed
102         for the transition to be complete. I plan to do this in a follow-up.
103
104         * page/DOMTimer.cpp:
105         (WebCore::DOMTimer::alignedFireTime):
106         * page/DOMTimer.h:
107         * page/SuspendableTimer.cpp:
108         (WebCore::SuspendableTimer::suspend):
109         (WebCore::SuspendableTimer::startRepeating):
110         (WebCore::SuspendableTimer::startOneShot):
111         (WebCore::SuspendableTimer::repeatInterval):
112         (WebCore::SuspendableTimer::augmentFireInterval):
113         (WebCore::SuspendableTimer::augmentRepeatInterval):
114         * page/SuspendableTimer.h:
115         (WebCore::SuspendableTimer::startRepeating):
116         (WebCore::SuspendableTimer::startOneShot):
117         (WebCore::SuspendableTimer::augmentFireInterval):
118         (WebCore::SuspendableTimer::augmentRepeatInterval):
119         * platform/ThreadTimers.cpp:
120         (WebCore::ThreadTimers::ThreadTimers):
121         (WebCore::ThreadTimers::setSharedTimer):
122         (WebCore::ThreadTimers::updateSharedTimer):
123         (WebCore::ThreadTimers::sharedTimerFiredInternal):
124         (WebCore::ThreadTimers::fireTimersInNestedEventLoop):
125         * platform/ThreadTimers.h:
126         * platform/Timer.cpp:
127         (WebCore::TimerHeapLessThanFunction::operator()):
128         (WebCore::TimerBase::TimerBase):
129         (WebCore::TimerBase::start):
130         (WebCore::TimerBase::stop):
131         (WebCore::TimerBase::nextFireInterval):
132         (WebCore::TimerBase::heapPop):
133         (WebCore::TimerBase::updateHeapIfNeeded):
134         (WebCore::TimerBase::setNextFireTime):
135         (WebCore::TimerBase::nextUnalignedFireInterval):
136         * platform/Timer.h:
137         (WebCore::TimerBase::start):
138         (WebCore::TimerBase::startOneShot):
139         (WebCore::TimerBase::repeatInterval):
140         (WebCore::TimerBase::repeatIntervalSeconds):
141         (WebCore::TimerBase::augmentFireInterval):
142         (WebCore::TimerBase::augmentRepeatInterval):
143         (WebCore::TimerBase::alignedFireTime):
144         (WebCore::TimerBase::isActive):
145         * testing/Internals.cpp:
146         (WebCore::Internals::isTimerThrottled):
147
148 2017-04-07  Yuichiro Kikura  <y.kikura@gmail.com>
149
150         WebGPU: implement ComputeCommandEncoder and related components
151         https://bugs.webkit.org/show_bug.cgi?id=170444
152
153         Reviewed by Alex Christensen.
154
155         I implemented WebGPUComputeCommandEncoder and related components based on the WebGPU proposal.
156         https://webkit.org/wp-content/uploads/webgpu-api-proposal.html
157
158         Test: fast/canvas/webgpu/webgpu-dispatch.html
159
160         * CMakeLists.txt:
161         * DerivedSources.make:
162         * PlatformMac.cmake:
163         * WebCore.xcodeproj/project.pbxproj:
164         * bindings/js/JSWebGPUCommandBufferCustom.cpp: Added.
165         (WebCore::JSWebGPUCommandBuffer::completed):
166         * html/canvas/WebGPUCommandBuffer.cpp:
167         (WebCore::WebGPUCommandBuffer::createComputeCommandEncoder):
168         * html/canvas/WebGPUCommandBuffer.h:
169         * html/canvas/WebGPUCommandBuffer.idl:
170         * html/canvas/WebGPUComputeCommandEncoder.cpp: Added.
171         (WebCore::GPUSizeMake):
172         (WebCore::WebGPUComputeCommandEncoder::create):
173         (WebCore::WebGPUComputeCommandEncoder::WebGPUComputeCommandEncoder):
174         (WebCore::WebGPUComputeCommandEncoder::~WebGPUComputeCommandEncoder):
175         (WebCore::WebGPUComputeCommandEncoder::setComputePipelineState):
176         (WebCore::WebGPUComputeCommandEncoder::setBuffer):
177         (WebCore::WebGPUComputeCommandEncoder::dispatch):
178         (WebCore::WebGPUComputeCommandEncoder::endEncoding):
179         * html/canvas/WebGPUComputeCommandEncoder.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.h.
180         (WebCore::WebGPUComputeCommandEncoder::computeCommandEncoder):
181         * html/canvas/WebGPUComputeCommandEncoder.idl: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
182         * html/canvas/WebGPUComputePipelineState.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.cpp.
183         (WebCore::WebGPUComputePipelineState::create):
184         (WebCore::WebGPUComputePipelineState::WebGPUComputePipelineState):
185         (WebCore::WebGPUComputePipelineState::~WebGPUComputePipelineState):
186         * html/canvas/WebGPUComputePipelineState.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.h.
187         (WebCore::WebGPUComputePipelineState::computePipelineState):
188         * html/canvas/WebGPUComputePipelineState.idl: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
189         * html/canvas/WebGPURenderingContext.cpp:
190         (WebCore::WebGPURenderingContext::createComputePipelineState):
191         * html/canvas/WebGPURenderingContext.h:
192         * html/canvas/WebGPURenderingContext.idl:
193         * html/canvas/WebGPUSize.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
194         * html/canvas/WebGPUSize.idl: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
195         * platform/graphics/cocoa/GPUCommandBufferMetal.mm:
196         (WebCore::GPUCommandBuffer::completed):
197         * platform/graphics/cocoa/GPUComputeCommandEncoderMetal.mm: Added.
198         (WebCore::MTLSizeMake):
199         (WebCore::GPUComputeCommandEncoder::GPUComputeCommandEncoder):
200         (WebCore::GPUComputeCommandEncoder::setComputePipelineState):
201         (WebCore::GPUComputeCommandEncoder::setBuffer):
202         (WebCore::GPUComputeCommandEncoder::dispatch):
203         (WebCore::GPUComputeCommandEncoder::endEncoding):
204         (WebCore::GPUComputeCommandEncoder::platformComputeCommandEncoder):
205         * platform/graphics/cocoa/GPUComputePipelineStateMetal.mm: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.cpp.
206         (WebCore::GPUComputePipelineState::GPUComputePipelineState):
207         (WebCore::GPUComputePipelineState::platformComputePipelineState):
208         * platform/graphics/gpu/GPUCommandBuffer.cpp:
209         (WebCore::GPUCommandBuffer::createComputeCommandEncoder):
210         * platform/graphics/gpu/GPUCommandBuffer.h:
211         * platform/graphics/gpu/GPUComputeCommandEncoder.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.cpp.
212         (WebCore::GPUComputeCommandEncoder::create):
213         (WebCore::GPUComputeCommandEncoder::~GPUComputeCommandEncoder):
214         (WebCore::GPUComputeCommandEncoder::setComputePipelineState):
215         (WebCore::GPUComputeCommandEncoder::setBuffer):
216         (WebCore::GPUComputeCommandEncoder::endEncoding):
217         * platform/graphics/gpu/GPUComputeCommandEncoder.h: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h.
218         * platform/graphics/gpu/GPUComputePipelineState.cpp: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
219         (WebCore::GPUComputePipelineState::create):
220         (WebCore::GPUComputePipelineState::~GPUComputePipelineState):
221         * platform/graphics/gpu/GPUComputePipelineState.h: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h.
222         * platform/graphics/gpu/GPUSize.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
223
224 2017-04-07  Alex Christensen  <achristensen@webkit.org>
225
226         Private browsing sessions should not look in keychain for client certificates
227         https://bugs.webkit.org/show_bug.cgi?id=170618
228         <rdar://problem/18457427>
229
230         Reviewed by Dan Bernstein.
231
232         Our client certificate testing in WebKit leaves much to be desired.
233         See rdar://problem/17694210 for reproduction steps.
234
235         * platform/spi/cf/CFNetworkSPI.h:
236         Add some new SPI.
237
238 2017-04-07  Zalan Bujtas  <zalan@apple.com>
239
240         Simple line layout: FlowContents::segmentIndexForRunSlow skips empty runs.
241         https://bugs.webkit.org/show_bug.cgi?id=170552
242
243         Reviewed by Antti Koivisto.
244
245         The compare function passed to std::lower_bound completely misses empty runs. 
246
247         Test: fast/text/simple-line-layout-hover-over-subsequent-linebreaks.html
248
249         * rendering/SimpleLineLayoutFlowContents.cpp:
250         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForRunSlow):
251
252 2017-04-07  Chris Dumez  <cdumez@apple.com>
253
254         We should log how much CPU a background process was using when killing it due to CPU limiting
255         https://bugs.webkit.org/show_bug.cgi?id=170619
256
257         Reviewed by Andreas Kling.
258
259         CPUMonitor now passes the CPU usage to the callback when it exceeds the threashold.
260
261         * platform/CPUMonitor.cpp:
262         (WebCore::CPUMonitor::timerFired):
263         * platform/CPUMonitor.h:
264
265 2017-04-07  Chris Dumez  <cdumez@apple.com>
266
267         Audible autoplay videos should not get paused when outside the viewport
268         https://bugs.webkit.org/show_bug.cgi?id=170610
269         <rdar://problem/31505984>
270
271         Reviewed by Eric Carlson.
272
273         Audible autoplay videos should not get paused when outside the viewport as this
274         would be observable by the user.
275
276         Test: media/video-restricted-invisible-autoplay-allowed-if-audible.html
277
278         * html/MediaElementSession.cpp:
279         (WebCore::MediaElementSession::autoplayPermitted):
280
281 2017-04-07  Myles C. Maxfield  <mmaxfield@apple.com>
282
283         REGRESSION(r211382): Complex text with justification erroneously overflows containers
284         https://bugs.webkit.org/show_bug.cgi?id=170399
285         <rdar://problem/31442008>
286
287         Reviewed by Simon Fraser.
288
289         When we perform justification, we adjust glyphs' advances to add extra space between words.
290         ComplexTextController maintains an invariant where m_totalWidth is equal to the sum of these
291         advances. However, in RTL text, inserting extra justification space to the left of a glyph
292         would break that invariant, and would increase the advances of two glyphs instead of just
293         one. Then, when we go to draw the text, the sum of the advances is wider than m_totalWidth,
294         which means the glyphs would be drawn outside of their container.
295
296         This regressed in r211382 simply because of an oversight and because there were no tests for
297         this codepath.
298
299         Test: ComplexTextControllerTest.TotalWidthWithJustification
300
301         * platform/graphics/ComplexTextController.cpp:
302         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
303         * rendering/InlineBox.h:
304         (WebCore::InlineBox::InlineBox):
305
306 2017-04-07  Chris Dumez  <cdumez@apple.com>
307
308         Throttle / Align DOM Timers in cross-origin iframes to 30fps
309         https://bugs.webkit.org/show_bug.cgi?id=170613
310         <rdar://problem/31506444>
311
312         Reviewed by Simon Fraser.
313
314         Throttle / Align DOM Timers in cross-origin iframes to 30fps unless the user
315         has interacted with them, in order to reduce power use.
316
317         Test: http/tests/frame-throttling/timer-throttle-in-cross-origin-subframe.html
318
319         * dom/Document.cpp:
320         (WebCore::Document::domTimerAlignmentInterval):
321         (WebCore::Document::updateLastHandledUserGestureTimestamp):
322         * page/DOMTimer.h:
323
324 2017-04-07  John Wilander  <wilander@apple.com>
325
326         Follow-up fix for Soup platform.
327         https://bugs.webkit.org/show_bug.cgi?id=170322
328
329         Unreviewed build fix. Error introduced by me in
330         https://trac.webkit.org/changeset/215104/webkit.
331
332         No new tests.
333
334         * platform/network/soup/SocketStreamHandleImpl.h:
335             Move parameter change to the right
336             SocketStreamHandleImpl::create() function.
337
338 2017-04-07  John Wilander  <wilander@apple.com>
339
340         WebSocket streams should have network usage attributed to correct process
341         https://bugs.webkit.org/show_bug.cgi?id=170322
342         <rdar://problem/26413551>
343
344         Reviewed by Alex Christensen.
345
346         Tested manually since it requires a per-app VPN.
347
348         * page/SocketProvider.cpp:
349         (WebCore::SocketProvider::createSocketStreamHandle):
350             Sends in an empty struct since it doesn't have access to
351             platform dependent sourceApplicationAuditData.
352         * platform/network/SocketStreamHandle.h:
353             Declaration of a per-platform struct to hold CF data for
354             Cocoa platforms.
355         * platform/network/cf/SocketStreamHandleImpl.h:
356         (WebCore::SocketStreamHandleImpl::create):
357             Now takes WebCore::SourceApplicationAuditToken which is
358             passed on to the constructor.
359         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
360         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
361             Now takes WebCore::SourceApplicationAuditToken which is
362             passed on to the streams once created.
363         (WebCore::SocketStreamHandleImpl::createStreams):
364             Now sets kCFStreamPropertySourceApplication for the two
365             streams.
366         * platform/network/curl/SocketStreamHandleImpl.h:
367         (WebCore::SocketStreamHandleImpl::create):
368             Added unused WebCore::SourceApplicationAuditToken parameter.
369         * platform/network/soup/SocketStreamHandleImpl.h:
370         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
371         (WebCore::SocketStreamHandleImpl::create):
372             Added unused WebCore::SourceApplicationAuditToken parameter.
373
374 2017-04-07  Alex Christensen  <achristensen@webkit.org>
375
376         REGRESSION(r204512): WebSocket errors with "Failed to send WebSocket frame."  if too much data is sent
377         https://bugs.webkit.org/show_bug.cgi?id=170463
378
379         Reviewed by Michael Catanzaro.
380
381         This only reproduces when using WebSockets to communicate with an external server.
382         When communicating with a local server, CFWriteStreamWrite succeeds too reliably, so
383         CFWriteStreamCanAcceptBytes returns true, when sometimes it doesn't when communicating
384         across the real internet.
385
386         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
387         (WebCore::SocketStreamHandleImpl::platformSendInternal):
388         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
389         (WebCore::SocketStreamHandleImpl::platformSendInternal):
390         Returning std::nullopt means there was an error, which is not true when the socket stream
391         is in a state where it cannot be written to because it is actively communicating.
392         Returning 0 means 0 new bytes were sent, so we will try again later.
393
394 2017-04-07  Eric Carlson  <eric.carlson@apple.com>
395
396         MediaSample should store video sample rotation instead of orientation
397         https://bugs.webkit.org/show_bug.cgi?id=170598
398
399         Reviewed by Youenn Fablet.
400
401         No new tests, no functional change.
402
403         * platform/MediaSample.h:
404         (WebCore::MediaSample::videoRotation):
405         (WebCore::MediaSample::videoOrientation): Deleted.
406         * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
407         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
408         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
409         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix):
410         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
411         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayLayer):
412
413         * platform/mediastream/mac/AVVideoCaptureSource.mm:
414         (WebCore::AVVideoCaptureSource::processNewFrame):
415
416         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
417         (WebCore::RealtimeIncomingVideoSource::OnFrame):
418         (WebCore::RealtimeIncomingVideoSource::processNewSample):
419         * platform/mediastream/mac/RealtimeIncomingVideoSource.h:
420
421         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
422         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
423
424 2017-04-07  Brent Fulgham  <bfulgham@apple.com>
425
426         WebKit should percent encode single quotes in query strings
427         https://bugs.webkit.org/show_bug.cgi?id=170561
428         <rdar://problem/7415154>
429
430         Reviewed by Alex Christensen.
431
432         Modify the characterClassTable to instruct the URLParser to convert
433         the single-quote character ' to %27 in URL query strings.
434
435         Tests: URLParserTest in TestWebKitAPI.
436             fast/events/popup-blocked-from-unique-frame-via-window-open-named-sibling-frame.html
437             fast/frames/xss-auditor-handles-file-urls.html
438             http/tests/security/xssAuditor
439
440         * platform/URLParser.cpp:
441
442 2017-04-07  Zalan Bujtas  <zalan@apple.com>
443
444         Text insertion cursor disappears after pressing enter
445         https://bugs.webkit.org/show_bug.cgi?id=169291
446         <rdar://problem/30899611>
447
448         Reviewed by Tim Horton.
449
450         Positon upstream/downstream (as the result of VisiblePosition -> canonicalPosition) require
451         linebox tree. In addition to regular text, we need to bail out of simple line layout on line breaks too.
452
453         Test: editing/simple-line-layout-caret-is-gone.html
454
455         * dom/Position.cpp:
456         (WebCore::ensureLineBoxesIfNeeded):
457         (WebCore::Position::upstream):
458         (WebCore::Position::downstream):
459         (WebCore::Position::getInlineBoxAndOffset):
460         * rendering/RenderLineBreak.cpp:
461         (WebCore::RenderLineBreak::ensureLineBoxes):
462         (WebCore::RenderLineBreak::positionForPoint):
463         (WebCore::RenderLineBreak::setSelectionState):
464         (WebCore::RenderLineBreak::collectSelectionRects):
465         (WebCore::ensureLineBoxes): Deleted.
466         * rendering/RenderLineBreak.h:
467
468 2017-04-07  Xan Lopez  <xlopez@igalia.com>
469
470         [GTK] Fix codec name in OWR ASSERT
471         https://bugs.webkit.org/show_bug.cgi?id=170600
472
473         Reviewed by Carlos Garcia Campos.
474
475         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
476         (WebCore::MediaEndpointOwr::prepareMediaSession): uppercase the
477         codec name we are looking for, that's how they appear in the
478         vector.
479
480 2017-04-07  Per Arne Vollan  <pvollan@apple.com>
481
482         Add hasVideo property to WebAVPlayerController.
483         https://bugs.webkit.org/show_bug.cgi?id=170545
484         rdar://problem/31325182
485
486         Reviewed by Eric Carlson.
487
488         Add a new "hasVideo" property which can be used to discover if any video content is present in the playback item,
489         whether video content is currently enabled or not.
490
491         * platform/ios/WebAVPlayerController.h:
492         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
493         (WebVideoFullscreenInterfaceAVKit::hasVideoChanged):
494
495 2017-04-07  Miguel Gomez  <magomez@igalia.com>
496
497         [GTK+] Animations not played properly when using synchronous decoding
498         https://bugs.webkit.org/show_bug.cgi?id=170591
499
500         Reviewed by Carlos Garcia Campos.
501
502         Fix an index error when destroying decoded frames that was sometimes deleting the frame we wanted
503         to keep.
504
505         Covered by exitent tests.
506
507         * platform/graphics/ImageFrameCache.cpp:
508         (WebCore::ImageFrameCache::destroyDecodedData):
509
510 2017-04-07  Xan Lopez  <xan@igalia.com>
511
512         [GTK] Add message about missing codecs to ASSERT in OWR
513         https://bugs.webkit.org/show_bug.cgi?id=170596
514
515         Reviewed by Carlos Garcia Campos.
516
517         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
518         (WebCore::MediaEndpointOwr::prepareMediaSession): add a message
519         about the missing coded to the ASSERT.
520
521 2017-04-07  Tomas Popela  <tpopela@redhat.com>
522
523         AX: Don't crash if no renderer is available for AccessibilityRenderObject
524         https://bugs.webkit.org/show_bug.cgi?id=170448
525
526         Reviewed by Chris Fleizach.
527
528         Don't crash or assert if no renderer is available, but early return
529         gracefully (as in other places in the AccessibilityRenderObject.cpp).
530         Spotted by running some tests through dogtail.
531
532         * accessibility/AccessibilityRenderObject.cpp:
533         (WebCore::AccessibilityRenderObject::isOffScreen):
534         (WebCore::AccessibilityRenderObject::isUnvisited):
535         (WebCore::AccessibilityRenderObject::isVisited):
536
537 2017-04-07  Carlos Garcia Campos  <cgarcia@igalia.com>
538
539         [GTK] Update the priorities used in glib main loop sources
540         https://bugs.webkit.org/show_bug.cgi?id=170457
541
542         Reviewed by Žan Doberšek.
543
544         * platform/glib/MainThreadSharedTimerGLib.cpp:
545         (WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
546         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
547         (WebCore::TextureMapperPlatformLayerProxy::TextureMapperPlatformLayerProxy):
548         (WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread):
549
550 2017-04-07  Zan Dobersek  <zdobersek@igalia.com>
551
552         [GCrypt] Implement AES_CBC support
553         https://bugs.webkit.org/show_bug.cgi?id=170550
554
555         Reviewed by Michael Catanzaro.
556
557         Implement the CryptoAlgorithmAES_CBC::platform{Encrypt,Decrypt}
558         functionality for configurations that use libgcrypt. This is done
559         by leveraging the gcry_cipher_* APIs for the AES algorithm that's
560         deduced appropriately from the key size and the CBC cipher mode.
561         Additionally, the PKCS#7 padding is implemented for each operation,
562         as demanded by the Web Crypto specification.
563
564         No new tests -- current ones cover this sufficiently, but are not yet
565         enabled due to missing platform-specific SUBTLE_CRYPTO implementations.
566
567         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
568         (WebCore::gcryptEncrypt):
569         (WebCore::gcryptDecrypt):
570         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
571         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
572
573 2017-04-07  Zan Dobersek  <zdobersek@igalia.com>
574
575         [GCrypt] Implement raw and JWK imports and exports for EC keys
576         https://bugs.webkit.org/show_bug.cgi?id=170546
577
578         Reviewed by Michael Catanzaro.
579
580         Implement import and export operations for EC keys, covering the raw
581         and JWK import/export types.
582
583         CryptoKeyEC::platformImportRaw() builds a public-key s-expression,
584         providing the curve name and the key data, and yields the gcry_sexp_t
585         object to the new CryptoKeyEC.
586
587         CryptoKeyEC::platformImportJWKPublic() first constructs a Vector<uint8_t>
588         object that contains the EC point in the uncompressed format. It then
589         puts that data into a newly-constructed public-key s-expression that is
590         then used to construct the new CryptoKeyEC object.
591
592         CryptoKeyEC::platformImportJWKPrivate() constructs the EC point data just
593         the same, but it also lays out the private key field element data into
594         the private-key s-expression that's then handed off to the CryptoKeyEC
595         object.
596
597         CryptoKeyEC::platformExportRaw() constructs a new EC operations context
598         and then uses it to retrieve the q parameter as an MPI. A Vector<uint8_t>
599         is retrieved from the MPI data through the extractMPIData() helper
600         function.
601
602         CryptoKeyEC::platformAddFieldElements() similarly uses the EC operations
603         context to retrieve the q parameter data, which it then splits into the
604         x and y field elements and Base64 URL-encodes them into a form that can
605         be placed in a JsonWebKey. If the key is private, the d parameter is
606         retrieved in the same fashion and again Base64 URL-encoded and stored
607         in the JsonWebKey object.
608
609         No new tests -- current ones cover this sufficiently, but are not yet
610         enabled due to other missing platform-specific SUBTLE_CRYPTO
611         implementations.
612
613         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
614         (WebCore::uncompressedPointSizeForCurve):
615         (WebCore::uncompressedFieldElementSizeForCurve):
616         (WebCore::extractMPIData):
617         (WebCore::CryptoKeyEC::platformImportRaw):
618         (WebCore::CryptoKeyEC::platformImportJWKPublic):
619         (WebCore::CryptoKeyEC::platformImportJWKPrivate):
620         (WebCore::CryptoKeyEC::platformExportRaw):
621         (WebCore::CryptoKeyEC::platformAddFieldElements):
622
623 2017-04-07  Zan Dobersek  <zdobersek@igalia.com>
624
625         [GCrypt] Implement CryptoKeyRSA::generatePair()
626         https://bugs.webkit.org/show_bug.cgi?id=170350
627
628         Reviewed by Michael Catanzaro.
629
630         Start implementing the libgcrypt-based platform bits of CryptoKeyRSA.
631
632         Implement generatePair() by constructing a genkey s-expression
633         that requests a generation of an RSA key that should use a modulus
634         of the specified bit-length and the specified exponent. The exponent
635         is extracted from an uint8_t array through a helper function. The
636         modulus length value is checked to be at least 16, since libgcrypt
637         does not support generating primes of less than that length in bits.
638
639         The returned s-expression upon request will contain the data for
640         both the public and the private key. gcry_sexp_t handles representing
641         those s-expressions are then passed to CryptoKeyRSA::create() before
642         invoking the success callback with a new CryptoKeyPair object in a
643         separate ScriptExecutionContext task.
644
645         The CryptoKeyRSA constructor simply has the notImplemented() call
646         removed. The destructor now invokes the HandleDeleter<gcry_sexp_t>
647         object instance to destroy the object represented by the
648         m_platformKey handle.
649
650         The methods in CryptoKeyRSA.cpp are also reordered to follow the
651         declaration order used in the header.
652
653         No new tests -- current ones cover this sufficiently, but are not yet
654         enabled due to other missing platform-specific SUBTLE_CRYPTO
655         implementations.
656
657         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
658         (WebCore::CryptoKeyRSA::CryptoKeyRSA):
659         (WebCore::CryptoKeyRSA::~CryptoKeyRSA):
660         (WebCore::exponentVectorToUInt32):
661         (WebCore::CryptoKeyRSA::generatePair):
662         (WebCore::CryptoKeyRSA::importSpki):
663         (WebCore::CryptoKeyRSA::importPkcs8):
664         (WebCore::CryptoKeyRSA::exportPkcs8):
665         (WebCore::CryptoKeyRSA::buildAlgorithm):
666         (WebCore::CryptoKeyRSA::exportData):
667         * crypto/keys/CryptoKeyRSA.h:
668
669 2017-04-06  Youenn Fablet  <youenn@apple.com>
670
671         [Debug] ASSERT(!throwScope.exception()) on imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html
672         https://bugs.webkit.org/show_bug.cgi?id=170395
673         <rdar://problem/31394017>
674
675         Reviewed by Mark Lam.
676
677         * bindings/js/JSDOMPromise.cpp:
678         (WebCore::DeferredPromise::reject): Exiting early in case of scope having an exception.
679         Adding an assertion to ensure this is a worker termination exception.
680
681 2017-04-06  Andreas Kling  <akling@apple.com>
682
683         Inaudible background tabs should become eligible for memory kill after 8 minutes
684         https://bugs.webkit.org/show_bug.cgi?id=170574
685         <rdar://problem/31488686>
686
687         Reviewed by Gavin Barraclough.
688
689         Lower the delay for potentially marking background tabs as inactive from 60 minutes to 8 minutes.
690         Letting a tab misbehave in the background for an entire hour was overly charitable.
691
692         * page/PerformanceMonitor.cpp:
693
694 2017-04-06  Wenson Hsieh  <wenson_hsieh@apple.com>
695
696         Scroll offset jumps after a programmatic scroll in an overflow container with scroll snapping
697         https://bugs.webkit.org/show_bug.cgi?id=170560
698         <rdar://problem/31484693>
699
700         Reviewed by Tim Horton.
701
702         Test: css3/scroll-snap/scroll-snap-programmatic-overflow-scroll.html
703
704         Logic for maintaining the scroll snap state in ScrollController was previously removed from iOS when refactoring
705         ScrollController. This was done because scroll snapping on iOS is driven not by the ScrollController (as it is
706         on Mac) but rather by sending scroll snap offsets to the UI process and hooking into UIScrollView delegates to
707         handle retargeted scrolling.
708
709         However, on iOS, this ScrollController state is still important for the purposes of keeping the last active
710         snap point index in sync with the UI process when the scroll offset changes outside of a user gesture (i.e.
711         programmatic scrolling). Since the UI process does not get a chance to update the active snap offset during a
712         programmatic scroll, our last active snap offset state was only being updated to the last snap position that the
713         user manually scrolled to, making programmatic scrolling jump to this offset.
714
715         To fix this, we need to update scroll snap state on iOS within ScrollController. Also adds a new Layout test
716         that exercises programmatic scrolling in an overflow scrolling container on all platforms.
717
718         * platform/cocoa/ScrollController.mm:
719         (WebCore::otherScrollEventAxis):
720         (WebCore::ScrollController::updateScrollSnapState):
721         (WebCore::ScrollController::updateScrollSnapPoints):
722
723 2017-04-05  Simon Fraser  <simon.fraser@apple.com>
724
725         Throttle requestAnimationFrame in cross-origin iframes to 30fps
726         https://bugs.webkit.org/show_bug.cgi?id=170534
727
728         Reviewed by Dan Bates.
729
730         Add a throttling reason to ScriptedAnimationController which is NonInteractedCrossOriginFrame,
731         set on cross-origin iframes whose documents have never seen a user interaction. It's cleared
732         as soon as an interaction on this frame or a child frame is detected.
733
734         Move the initialization of the LowPowerMode throttling reason to Document::requestAnimationFrame(),
735         since it's more appropriate to compute NonInteractedCrossOriginFrame here than down in ScriptedAnimationController,
736         and best to do both in the same place.
737
738         Tests: http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe.html
739
740         * dom/Document.cpp:
741         (WebCore::Document::requestAnimationFrame):
742         (WebCore::Document::updateLastHandledUserGestureTimestamp):
743         * dom/Document.h:
744         (WebCore::Document::hasHadUserInteraction):
745         * dom/ScriptedAnimationController.cpp:
746         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
747         (WebCore::throttlingReasonToString):
748         (WebCore::ScriptedAnimationController::interval):
749         * dom/ScriptedAnimationController.h:
750         * loader/FrameLoader.cpp:
751         (WebCore::shouldAskForNavigationConfirmation):
752
753 2017-04-05  Simon Fraser  <simon.fraser@apple.com>
754
755         Use the Accelerate framework to optimize FEColorMatrix operations
756         https://bugs.webkit.org/show_bug.cgi?id=170518
757
758         Reviewed by Tim Horton.
759
760         On macOS and iOS, we can use the Accelerate framework (vImage) to do color matrix
761         math to optimize color matrix, hue rotate, saturation and luminosity to alpha filters.
762         
763         Change ImageBuffer::getUnmultipliedImageData() and getPremultipliedImageData() to
764         return the size of the returned Uint8ClampedArray in physical pixels, because we
765         need to pass that to vImage.
766
767         * html/canvas/CanvasRenderingContext2D.cpp:
768         (WebCore::CanvasRenderingContext2D::getImageData):
769         * platform/graphics/ImageBuffer.h:
770         * platform/graphics/cairo/ImageBufferCairo.cpp:
771         (WebCore::ImageBuffer::getUnmultipliedImageData):
772         (WebCore::ImageBuffer::getPremultipliedImageData):
773         * platform/graphics/cg/ImageBufferCG.cpp:
774         (WebCore::ImageBuffer::getUnmultipliedImageData):
775         (WebCore::ImageBuffer::getPremultipliedImageData):
776         * platform/graphics/filters/FEColorMatrix.cpp:
777         (WebCore::effectApplyAccelerated):
778         (WebCore::effectType):
779         (WebCore::FEColorMatrix::platformApplySoftware):
780         * platform/graphics/filters/FEDropShadow.cpp:
781         (WebCore::FEDropShadow::platformApplySoftware):
782         * platform/graphics/win/ImageBufferDirect2D.cpp:
783         (WebCore::ImageBuffer::getUnmultipliedImageData):
784         (WebCore::ImageBuffer::getPremultipliedImageData):
785
786 2017-04-04  Simon Fraser  <simon.fraser@apple.com>
787
788         Do some minor FEColorMatrix code cleanup and optimization
789         https://bugs.webkit.org/show_bug.cgi?id=170474
790
791         Reviewed by Dean Jackson.
792
793         Don't switch inside of a pixel processing loop; repeat the loop inside switch (filterType).
794         
795         Change matrix() and saturateAndHueRotate() to dereference the source pixels once, instead
796         of multiple times, which is faster.
797         
798         This kind of code benefits from aligning things with spaces for readability, so do so,
799         violating webkit style.
800         
801         Add some off-by-default performance logging code.
802
803         Increases pixel processing performance from about 86ms per megapixel to 65ms per megapixel.
804
805         * platform/graphics/filters/FEColorMatrix.cpp:
806         (WebCore::matrix):
807         (WebCore::saturateAndHueRotate):
808         (WebCore::effectType):
809         (WebCore::FEColorMatrix::platformApplySoftware):
810
811 2017-04-06  Ryan Haddad  <ryanhaddad@apple.com>
812
813         Unreviewed, rolling out r215041.
814
815         The LayoutTest for this change is failing on ios-simulator.
816
817         Reverted changeset:
818
819         "Rendering flexbox children across columns"
820         https://bugs.webkit.org/show_bug.cgi?id=164166
821         http://trac.webkit.org/changeset/215041
822
823 2017-04-06  Ryan Haddad  <ryanhaddad@apple.com>
824
825         Unreviewed, rolling out r215046.
826
827         This change broke internal builds.
828
829         Reverted changeset:
830
831         "WebRTC tests gardening"
832         https://bugs.webkit.org/show_bug.cgi?id=170508
833         http://trac.webkit.org/changeset/215046
834
835 2017-04-06  Joseph Pecoraro  <pecoraro@apple.com>
836
837         Web Inspector: Only Capture Extra Network Load Metrics when there is a Web Inspector Frontend
838         https://bugs.webkit.org/show_bug.cgi?id=170525
839
840         Reviewed by Youenn Fablet.
841
842         Covered by existing tests that when Web Inspector is open we enable collecting the extra data.
843
844         * inspector/InspectorInstrumentation.cpp:
845         (WebCore::InspectorInstrumentation::firstFrontendCreated):
846         (WebCore::InspectorInstrumentation::lastFrontendDeleted):
847         * inspector/InspectorInstrumentation.h:
848         (WebCore::InspectorInstrumentation::frontendCreated):
849         (WebCore::InspectorInstrumentation::frontendDeleted):
850         When the first frontend is created enable a new loader strategy to
851         collect extra network load metrics. When the last frontend is closed
852         disable the extra metrics.
853
854         * loader/LoaderStrategy.h:
855         * platform/PlatformStrategies.h:
856         New load strategy to enable/disable new metrics.
857
858 2017-04-06  Joseph Pecoraro  <pecoraro@apple.com>
859
860         Web Inspector: Show all headers in the Request Headers section of the Resource details sidebar
861         https://bugs.webkit.org/show_bug.cgi?id=16531
862         <rdar://problem/5712895>
863
864         Reviewed by Timothy Hatcher.
865
866         Test: http/tests/inspector/network/resource-request-headers.html
867
868         * loader/ResourceTiming.cpp:
869         (WebCore::ResourceTiming::ResourceTiming):
870         Eliminate unnecessary data from the NetworkLoadTiming object
871         when it is used for ResourceTiming. This clears up some memory
872         that will otherwise never be used.
873
874         * platform/network/NetworkLoadMetrics.h:
875         (WebCore::NetworkLoadMetrics::isolatedCopy):
876         (WebCore::NetworkLoadMetrics::reset):
877         (WebCore::NetworkLoadMetrics::clearNonTimingData):
878         (WebCore::NetworkLoadMetrics::operator==):
879         (WebCore::NetworkLoadMetrics::encode):
880         (WebCore::NetworkLoadMetrics::decode):
881         Include an optional HTTPHeaderMap for a refined list of
882         request headers for this network load.
883
884         * inspector/InspectorNetworkAgent.cpp:
885         (WebCore::InspectorNetworkAgent::buildObjectForMetrics):
886         Include request headers with other optional metrics data
887         when the load is completed.
888
889 2017-04-06  Tim Horton  <timothy_horton@apple.com>
890
891         Follow up to r209304, remove line numbers from one more StyleRule construction
892         https://bugs.webkit.org/show_bug.cgi?id=170564
893
894         Reviewed by Simon Fraser.
895
896         * css/StyleRule.cpp:
897         (WebCore::StyleRuleViewport::StyleRuleViewport):
898         This one was missed in r209304.
899
900 2017-04-06  Timothy Horton  <timothy_horton@apple.com>
901
902         Remove an unused member and constructor parameter from CSSPropertyParser
903         https://bugs.webkit.org/show_bug.cgi?id=170562
904
905         Reviewed by Simon Fraser.
906
907         * css/parser/CSSParser.cpp:
908         (WebCore::CSSParser::parseSingleValue):
909         (WebCore::CSSParser::parseValueWithVariableReferences):
910         * css/parser/CSSParserImpl.cpp:
911         (WebCore::CSSParserImpl::consumeDeclarationValue):
912         * css/parser/CSSPropertyParser.cpp:
913         (WebCore::CSSPropertyParser::CSSPropertyParser):
914         (WebCore::CSSPropertyParser::parseValue):
915         (WebCore::CSSPropertyParser::parseSingleValue):
916         * css/parser/CSSPropertyParser.h:
917         It is possible to get Clang to complain about the unused member, though
918         I'm not sure why it doesn't in the build today.
919
920 2017-04-06  Zalan Bujtas  <zalan@apple.com>
921
922         Simple line layout: Hittest always returns the first renderer in the block.
923         https://bugs.webkit.org/show_bug.cgi?id=170520
924         <rdar://problem/30979175>
925
926         Reviewed by Antti Koivisto.
927
928         This is incorrect now with <br> support (multiple renderers within the same block flow).
929
930         Test: fast/dom/Document/CaretRangeFromPoint/simple-line-layout-hittest-with-caret-range-from-point.html
931
932         * rendering/RenderText.cpp:
933         (WebCore::RenderText::positionForPoint): Related fix. We don't yet support positionForPoint with multiple renderes. 
934         * rendering/SimpleLineLayoutFlowContents.h:
935         (WebCore::SimpleLineLayout::FlowContents::segmentForRun): Empty runs are all valid.
936         * rendering/SimpleLineLayoutFunctions.cpp:
937         (WebCore::SimpleLineLayout::hitTestFlow):
938         (WebCore::SimpleLineLayout::collectFlowOverflow):
939         * rendering/SimpleLineLayoutResolver.cpp:
940         (WebCore::SimpleLineLayout::LineResolver::Iterator::operator*): This should eventually return a list of renderes.
941         * rendering/SimpleLineLayoutResolver.h:
942         (WebCore::SimpleLineLayout::RunResolver::flowContents):
943
944 2017-04-06  Jon Davis  <jond@apple.com>
945
946         Updates feature status for recently shipped features
947         https://bugs.webkit.org/show_bug.cgi?id=170359
948
949         Reviewed by Brian Burg.
950
951         Added missing Gamepad entry.
952         Changed "Done" status to "Supported".
953         Also changed status from "In Development" to "Supported" for:
954         
955         - CSS Grid Layout Level 1
956         - CSS Inline Layout Module Level 3
957         - CSS Scroll Snap Points Module Level 1
958         - CSS Color Level 4
959         - Fetch API
960         - Indexed Database 2.0
961         - Media Capture and Streams
962         - Pointer Lock
963         - Preload
964         - Input Events
965
966         * features.json:
967
968 2017-03-31  Jiewen Tan  <jiewen_tan@apple.com>
969
970         [WebCrypto] Add support for AES-CTR
971         https://bugs.webkit.org/show_bug.cgi?id=169761
972         <rdar://problem/31331321>
973
974         Reviewed by Brent Fulgham.
975
976         This patch adds support for AES-CTR. Operations of AES-CTR include: encrypt, decrypt, generateKey,
977         importKey, exportKey, wrapKey, and unwrapKey. This implementation follows the latest WebCryptoAPI
978         spec: https://www.w3.org/TR/WebCryptoAPI/#aes-ctr.
979
980         Tests: crypto/subtle/aes-ctr-encrypt-malformed-parameters.html
981                crypto/subtle/aes-ctr-encrypt-overflow.html
982                crypto/subtle/aes-ctr-generate-export-key-jwk-length-128.html
983                crypto/subtle/aes-ctr-generate-export-key-jwk-length-192.html
984                crypto/subtle/aes-ctr-generate-export-key-jwk-length-256.html
985                crypto/subtle/aes-ctr-generate-export-raw-key.html
986                crypto/subtle/aes-ctr-generate-key-encrypt-decrypt.html
987                crypto/subtle/aes-ctr-generate-key.html
988                crypto/subtle/aes-ctr-import-jwk-key-length-128.html
989                crypto/subtle/aes-ctr-import-jwk-key-length-192.html
990                crypto/subtle/aes-ctr-import-jwk-key-length-256.html
991                crypto/subtle/aes-ctr-import-key-decrypt.html
992                crypto/subtle/aes-ctr-import-key-encrypt.html
993                crypto/subtle/aes-ctr-import-key-unwrap-jwk-key.html
994                crypto/subtle/aes-ctr-import-key-unwrap-raw-key.html
995                crypto/subtle/aes-ctr-import-key-wrap-jwk-key.html
996                crypto/subtle/aes-ctr-import-key-wrap-raw-key.html
997                crypto/subtle/aes-ctr-import-raw-key.html
998                crypto/workers/subtle/aes-ctr-import-key-decrypt.html
999                crypto/workers/subtle/aes-ctr-import-key-encrypt.html
1000                crypto/workers/subtle/aes-ctr-import-key-unwrap-key.html
1001                crypto/workers/subtle/aes-ctr-import-key-wrap-key.html
1002
1003         * CMakeLists.txt:
1004         * DerivedSources.make:
1005         * PlatformGTK.cmake:
1006         * PlatformMac.cmake:
1007         * WebCore.xcodeproj/project.pbxproj:
1008         * bindings/js/JSSubtleCryptoCustom.cpp:
1009         (WebCore::normalizeCryptoAlgorithmParameters):
1010         * crypto/CryptoAlgorithmParameters.h:
1011         * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp: Added.
1012         (WebCore::usagesAreInvalidForCryptoAlgorithmAES_CTR):
1013         (WebCore::parametersAreValid):
1014         (WebCore::CryptoAlgorithmAES_CTR::create):
1015         (WebCore::CryptoAlgorithmAES_CTR::identifier):
1016         (WebCore::CryptoAlgorithmAES_CTR::encrypt):
1017         (WebCore::CryptoAlgorithmAES_CTR::decrypt):
1018         (WebCore::CryptoAlgorithmAES_CTR::generateKey):
1019         (WebCore::CryptoAlgorithmAES_CTR::importKey):
1020         (WebCore::CryptoAlgorithmAES_CTR::exportKey):
1021         (WebCore::CryptoAlgorithmAES_CTR::getKeyLength):
1022         * crypto/algorithms/CryptoAlgorithmAES_CTR.h: Added.
1023         * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp: Added.
1024         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
1025         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
1026         * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp: Added.
1027         (WebCore::bigIntegerToSize):
1028         (WebCore::transformAES_CTR):
1029         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
1030         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
1031         * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
1032         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
1033         * crypto/parameters/AesCtrParams.idl: Added.
1034         * crypto/parameters/CryptoAlgorithmAesCtrParams.h: Added.
1035
1036 2017-04-06  Youenn Fablet  <youenn@apple.com>
1037
1038         WebRTC tests gardening
1039         https://bugs.webkit.org/show_bug.cgi?id=170508
1040
1041         Reviewed by Eric Carlson.
1042
1043         * Configurations/FeatureDefines.xcconfig: Changing webrtc enabling for ios.
1044
1045 2017-04-06  Andreas Kling  <akling@apple.com>
1046
1047         Stop forcing CA commit when memory pressure changes.
1048         https://bugs.webkit.org/show_bug.cgi?id=170522
1049         <rdar://problem/31460236>
1050
1051         Reviewed by Antti Koivisto.
1052
1053         Don't force a CA commit when reaching critical memory pressure. We're already doing a ton
1054         of work in response to the pressure, and this was really a hack to try to react quickly on
1055         512 MB devices which we don't support anymore.
1056
1057         * page/MemoryRelease.cpp:
1058         (WebCore::releaseCriticalMemory):
1059
1060 2017-04-06  Romain Bellessort  <romain.bellessort@crf.canon.fr>
1061
1062         [Readable Streams API] Implement ReadableStreamBYOBRequest respondWithNewView()
1063         https://bugs.webkit.org/show_bug.cgi?id=170339
1064
1065         Reviewed by Youenn Fablet.
1066
1067         Implemented ReadableStreamBYOBRequest respondWithNewView().
1068
1069         Added new tests to check respondWithNewView() behaviour.
1070
1071         * Modules/streams/ReadableByteStreamInternals.js:
1072         (readableByteStreamControllerRespondWithNewView): Added.
1073         * Modules/streams/ReadableStreamBYOBRequest.js:
1074         (respondWithNewView): Updated.
1075
1076 2017-04-06  Eric Carlson  <eric.carlson@apple.com>
1077
1078         [MediaStream] Host application should be able to mute and unmute media streams
1079         https://bugs.webkit.org/show_bug.cgi?id=170519
1080         <rdar://problem/31174326>
1081
1082         Unreviewed, fix crash introduced in r214980.
1083
1084         * Modules/mediastream/MediaStream.cpp:
1085         (WebCore::MediaStream::MediaStream): NULL-check page.
1086
1087 2017-04-06  Dave Hyatt  <hyatt@apple.com>
1088
1089         Rendering flexbox children across columns
1090         https://bugs.webkit.org/show_bug.cgi?id=164166
1091         <rdar://problem/29055587>
1092
1093         Reviewed by Zalan Bujtas.
1094
1095         Added fast/multicol/flexbox-rows.html.
1096
1097         * rendering/RenderBlockFlow.cpp:
1098         (WebCore::RenderBlockFlow::adjustForUnsplittableChild):
1099         Treat block-level flexboxes that occur inside block flows the same as replaced
1100         and unsplittable elements and push them to the next page if they don't fit. We don't
1101         update the minimum page height though, since the flexbox is not really unsplittable.
1102
1103 2017-04-05  Simon Fraser  <simon.fraser@apple.com>
1104
1105         Set lastHandledUserGestureTimestamp on all ancestor documents, not just the top document
1106         https://bugs.webkit.org/show_bug.cgi?id=170479
1107
1108         Reviewed by Sam Weinig.
1109
1110         When interacting with a subframe document, set lastHandledUserGestureTimestamp on all ancestor
1111         documents up to the root.
1112
1113         This will be used in future for requestAnimationFrame throttling.
1114
1115         Test: fast/frames/user-gesture-timestamp-propagation.html
1116
1117         * dom/Document.cpp:
1118         (WebCore::Document::updateLastHandledUserGestureTimestamp):
1119         * dom/Document.h:
1120         * dom/UserGestureIndicator.cpp:
1121         (WebCore::UserGestureIndicator::UserGestureIndicator):
1122         * testing/Internals.cpp:
1123         (WebCore::Internals::lastHandledUserGestureTimestamp):
1124         * testing/Internals.h:
1125         * testing/Internals.idl:
1126
1127 2017-04-05  Eric Carlson  <eric.carlson@apple.com>
1128
1129         [MediaStream] Host application should be able to mute and unmute media streams
1130         https://bugs.webkit.org/show_bug.cgi?id=170519
1131         <rdar://problem/31174326>
1132
1133         Unreviewed, address review comments missed in the initial checkin.
1134
1135         * Modules/mediastream/MediaStream.cpp:
1136         (WebCore::MediaStream::MediaStream): Mute the private stream if the page doesn't allow
1137         capture.
1138         (WebCore::MediaStream::pageMutedStateDidChange): setMuted -> setCaptureTracksMuted.
1139
1140         * platform/mediastream/MediaStreamPrivate.cpp:
1141         (WebCore::MediaStreamPrivate::addTrack): Don't track muted state, the capture source already does.
1142         (WebCore::MediaStreamPrivate::startProducingData):  Ditto.
1143         (WebCore::MediaStreamPrivate::setCaptureTracksMuted): Renamed from setMuted.
1144         (WebCore::MediaStreamPrivate::setMuted): Deleted.
1145         * platform/mediastream/MediaStreamPrivate.h:
1146
1147 2017-04-05  Eric Carlson  <eric.carlson@apple.com>
1148
1149         [MediaStream] Host application should be able to mute and unmute media streams
1150         https://bugs.webkit.org/show_bug.cgi?id=170519
1151         <rdar://problem/31174326>
1152
1153         Reviewed by Youenn Fablet.
1154
1155         No new tests, fast/mediastream/MediaStream-page-muted.html was updated.
1156
1157         * Modules/mediastream/MediaStream.cpp:
1158         (WebCore::MediaStream::~MediaStream): Fix a typo.
1159         (WebCore::MediaStream::pageMutedStateDidChange): Don't store muted state, let the private
1160         stream store it.
1161         (WebCore::MediaStream::mediaState): Deal with new muted state flags.
1162         * Modules/mediastream/MediaStream.h:
1163
1164         * dom/Document.cpp:
1165         (WebCore::Document::prepareForDestruction): Clear media state before the frame is cleared.
1166
1167         * page/MediaProducer.h: Add muted flags.
1168
1169         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1170         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack): The display layer
1171         should not be visible when the video track is muted.
1172
1173         * platform/mediastream/MediaStreamPrivate.cpp:
1174         (WebCore::MediaStreamPrivate::addTrack): Mute the new track if necessary.
1175         (WebCore::MediaStreamPrivate::startProducingData): Do nothing when muted.
1176         (WebCore::MediaStreamPrivate::setExternallyMuted): New, mute/unmute tracks.
1177         * platform/mediastream/MediaStreamPrivate.h:
1178
1179         * platform/mediastream/RealtimeMediaSource.cpp:
1180         (WebCore::RealtimeMediaSource::setMuted): Start/stop producing data.
1181
1182         * testing/Internals.cpp:
1183         (WebCore::Internals::pageMediaState): Support new media stream muted flags.
1184
1185 2017-04-05  Andreas Kling  <akling@apple.com>
1186
1187         Make inactive web processes behave as though under memory pressure.
1188         https://bugs.webkit.org/show_bug.cgi?id=170042
1189         <rdar://problem/31038445>
1190
1191         Reviewed by Antti Koivisto.
1192
1193         Prevent PerformanceMonitor from marking the process as inactive at startup.
1194         This fixes the API test failure that caused this patch to get rolled out.
1195
1196         * page/PerformanceMonitor.h:
1197
1198 2017-04-05  Youenn Fablet  <youenn@apple.com>
1199
1200         Switch to kCVPixelFormatType_420YpCbCr8BiPlanarFullRange for Mac video capture format
1201         https://bugs.webkit.org/show_bug.cgi?id=170509
1202
1203         Reviewed by Eric Carlson.
1204
1205         Covered by existing tests.
1206
1207         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1208
1209 2017-04-05  Javier Fernandez  <jfernandez@igalia.com>
1210
1211         [css-align] Implement the place-items shorthand
1212         https://bugs.webkit.org/show_bug.cgi?id=168847
1213
1214         Reviewed by David Hyatt.
1215
1216         The CSS Box Alignment specification defines a new shorthand to set the
1217         Content Alignment properties (align-items and justify-items) at the
1218         same time.
1219
1220         This patch provides the implementation of the CSS parsing logic and the
1221         required regression tests. For the time being, as it happens with the
1222         rest of the new alignment properties, the new parsing logic is
1223         implemented behind the CSS Grid Layout runtime flag.
1224
1225         Test: css3/parse-place-items.html
1226
1227         * css/CSSComputedStyleDeclaration.cpp:
1228         (WebCore::ComputedStyleExtractor::propertyValue):
1229         * css/CSSProperties.json:
1230         * css/StyleProperties.cpp:
1231         (WebCore::StyleProperties::getPropertyValue):
1232         (WebCore::StyleProperties::getAlignmentShorthandValue):
1233         * css/StyleProperties.h:
1234         * css/parser/CSSPropertyParser.cpp:
1235         (WebCore::isAutoOrNormalOrStretch):
1236         (WebCore::consumeSelfPositionOverflowPosition):
1237         (WebCore::consumeSimplifiedItemPosition):
1238         (WebCore::CSSPropertyParser::consumePlaceItemsShorthand):
1239         * css/parser/CSSPropertyParser.h:
1240
1241 2017-04-05  Ryan Haddad  <ryanhaddad@apple.com>
1242
1243         Unreviewed, rolling out r214932.
1244
1245         This change broke an internal build.
1246
1247         Reverted changeset:
1248
1249         "[ios-simulator] API test WebKit2.DataDetectionReferenceDate
1250         timing out"
1251         https://bugs.webkit.org/show_bug.cgi?id=161967
1252         http://trac.webkit.org/changeset/214932
1253
1254 2017-04-05  Ryan Haddad  <ryanhaddad@apple.com>
1255
1256         Unreviewed, rolling out r214962.
1257
1258         Roll r214937 back in because it wasn't at fault for the build
1259         breakage.
1260
1261         Reverted changeset:
1262
1263         "Unreviewed, rolling out r214937."
1264         https://bugs.webkit.org/show_bug.cgi?id=170365
1265         http://trac.webkit.org/changeset/214962
1266
1267 2017-04-05  Ryan Haddad  <ryanhaddad@apple.com>
1268
1269         Unreviewed, rolling out r214937.
1270
1271         This change broke an internal build.
1272
1273         Reverted changeset:
1274
1275         "REGRESSION (r202472): Data Detection overwrites existing
1276         links in detected ranges"
1277         https://bugs.webkit.org/show_bug.cgi?id=170365
1278         http://trac.webkit.org/changeset/214937
1279
1280 2017-04-05  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1281
1282         [WebRTC][OpenWebRTC] Add support for SDP BUNDLE ("a:group:BUNDLE" and "a=bundle-only" lines)
1283         https://bugs.webkit.org/show_bug.cgi?id=170157
1284
1285         Reviewed by Alejandro G. Castro.
1286
1287         This implements support on the SDPProcessor for generating an "a=group:BUNDLE"
1288         attribute with the MID identifiers specified in the bundle group in the most
1289         recent answer.
1290         It also implements support for generating "a=bundle-only" attributes on the
1291         "m=" sections of the SDP according to the bundlePolicy defined.
1292
1293         Test: fast/mediastream/RTCPeerConnection-inspect-offer-bundlePolicy-bundle-only.html
1294
1295         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1296         (WebCore::MediaEndpointPeerConnection::createOfferTask):
1297         (WebCore::MediaEndpointPeerConnection::createAnswerTask):
1298         * Modules/mediastream/SDPProcessor.cpp:
1299         (WebCore::getBundlePolicyName):
1300         (WebCore::configurationToJSON):
1301         * Modules/mediastream/sdp.js:
1302         (SDP.generate):
1303         * platform/mediastream/MediaEndpointSessionConfiguration.h:
1304         (WebCore::MediaEndpointSessionConfiguration::bundlePolicy):
1305         (WebCore::MediaEndpointSessionConfiguration::setBundlePolicy):
1306         (WebCore::MediaEndpointSessionConfiguration::clone):
1307
1308 2017-04-05  Jer Noble  <jer.noble@apple.com>
1309
1310         [MSE] Seeks to currentTime=0 will fail if currentTime is already 0.
1311         https://bugs.webkit.org/show_bug.cgi?id=170510
1312         <rdar://problem/30988403>
1313
1314         Reviewed by Eric Carlson.
1315
1316         Test: media/media-source/media-source-unnecessary-seek-seeked.html
1317
1318         The AVSampleBufferRenderSynchronizer won't fire a time jumped notification if no seek is actully
1319         necessary. So short circuit the seek logic if the seek time is identical to the current synchronizer
1320         time.
1321
1322         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1323         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
1324
1325 2017-04-05  Chris Dumez  <cdumez@apple.com>
1326
1327         <input type="range"> changing to disabled while active breaks all pointer events
1328         https://bugs.webkit.org/show_bug.cgi?id=170447
1329         <rdar://problem/31442875>
1330
1331         Reviewed by Geoffrey Garen.
1332
1333         When a range's slider is being moved, we set SliderThumbElement's m_inDragMode flag
1334         to true and mark the range elements as the CapturingMouseEventsElement. When we get
1335         the mouseUp event, we are supposed to exit drag mode. However, when the range element
1336         gets disabled while dragging, we do not get the mouseUp event and we need to make
1337         sure we exit dragging mode anyway. r112547 tried to fix this by calling stopDragging()
1338         in SliderThumbElement::defaultEventHandler() when the input element is disabled.
1339         While this often works, this is fragile and we sometimes fail to exit dragging mode
1340         when we should.
1341
1342         This patch addressed the issue by calling stopDragging() in
1343         SliderThumbElement::disabledAttributeChanged() instead. This is much safer as we
1344         guarantee will exit dragging mode whenever the range element gets disabled, even
1345         if SliderThumbElement::defaultEventHandler() does not get called after that.
1346
1347         Test: fast/forms/range/disabled-while-dragging.html
1348
1349         * html/RangeInputType.cpp:
1350         (WebCore::RangeInputType::disabledAttributeChanged):
1351         * html/RangeInputType.h:
1352         * html/shadow/SliderThumbElement.cpp:
1353         (WebCore::SliderThumbElement::defaultEventHandler):
1354         (WebCore::SliderThumbElement::disabledAttributeChanged):
1355         * html/shadow/SliderThumbElement.h:
1356
1357 2017-04-05  Eric Carlson  <eric.carlson@apple.com>
1358
1359         [MediaStream] Video doesn't render in fullscreen on iOS
1360         https://bugs.webkit.org/show_bug.cgi?id=170404
1361
1362         Reviewed by Youenn Fablet.
1363         
1364         No new tests, filed https://bugs.webkit.org/show_bug.cgi?id=170512.
1365
1366         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1367         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1368         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Include
1369         video fullscreen manager on iOS too.
1370         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix): Add paramater
1371         to force transform recalculation.
1372         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): Restructure code since
1373         the display layer resize happens elsewhere.
1374         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): Include video fullscreen
1375         manager on iOS too.
1376         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers): Ditto.
1377         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Ditto.
1378         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer): Ditto.
1379         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::backgroundLayerBoundsChanged): Change the
1380         display layer size and position immediately instead of waiting for the next sample buffer
1381         so the display is correct when fullscreen mode changes when paused.
1382
1383 2017-04-05  Youenn Fablet  <youenn@apple.com>
1384
1385         Deprecate and remove URL.createObjectURL(mediastream)
1386         https://bugs.webkit.org/show_bug.cgi?id=167518
1387         <rdar://problem/31149607>
1388
1389         Reviewed by Eric Carlson.
1390
1391         Covered by updated tests.
1392
1393         * CMakeLists.txt:
1394         * DerivedSources.cpp:
1395         * DerivedSources.make:
1396         * Modules/mediastream/DOMURLMediaStream.cpp: Removed.
1397         * Modules/mediastream/DOMURLMediaStream.h: Removed.
1398         * Modules/mediastream/DOMURLMediaStream.idl: Removed.
1399         * WebCore.xcodeproj/project.pbxproj:
1400         * html/DOMURL.idl:
1401
1402 2017-04-05  Alejandro G. Castro  <alex@igalia.com>
1403
1404         [Webrtc] Mock realtime sources factories should be static after r213941
1405         https://bugs.webkit.org/show_bug.cgi?id=170282
1406
1407         Reviewed by Alex Christensen.
1408
1409         If we don't make the variables static we would be returning a
1410         local variable.
1411
1412         * platform/mock/MockRealtimeAudioSource.cpp:
1413         (WebCore::MockRealtimeAudioSource::factory):
1414         * platform/mock/MockRealtimeVideoSource.cpp:
1415         (WebCore::MockRealtimeVideoSource::factory):
1416
1417 2017-04-05  Alex Christensen  <achristensen@webkit.org>
1418
1419         Fix CMake build.
1420
1421         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
1422         Some JavaScript inline functions were not being accessed from this file with different enable flags.
1423         * platform/spi/cf/CFNetworkSPI.h:
1424         * platform/spi/cocoa/NSURLConnectionSPI.h:
1425         Moved NSURLSession-specific SPI from NSURLConnectionSPI.h to CFNetworkSPI.h.
1426
1427 2017-04-05  Chris Dumez  <cdumez@apple.com>
1428
1429         _blank / _self / _parent / _top browsing context names should be case-insensitive
1430         https://bugs.webkit.org/show_bug.cgi?id=169747
1431
1432         Reviewed by Alex Christensen.
1433
1434         _blank / _self / _parent / _top browsing context names should be case-insensitive
1435         as per the HTML specification:
1436         - https://html.spec.whatwg.org/#browsing-context-names
1437
1438         This aligns our behavior with Firefox as well. See discussion at:
1439         - https://github.com/whatwg/html/issues/2443
1440
1441         Tests: imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank.html
1442                imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001.html
1443                imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002.html
1444                imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html
1445                imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html
1446
1447         * loader/FrameLoader.cpp:
1448         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
1449         (WebCore::createWindow):
1450         * page/DOMWindow.cpp:
1451         (WebCore::DOMWindow::open):
1452         * page/FrameTree.cpp:
1453         (WebCore::FrameTree::uniqueChildName):
1454         (WebCore::FrameTree::find):
1455
1456 2017-04-05  Miguel Gomez  <magomez@igalia.com>
1457
1458         [GTK+] PNG animations that should run once are not played at all
1459         https://bugs.webkit.org/show_bug.cgi?id=170499
1460
1461         Reviewed by Carlos Garcia Campos.
1462
1463         The repetition count reported bu the PNGImageDecoder is wrong. It's returning m_playCount - 1, which
1464         means 0 for the animations that need to be played once. Change it to return an appropriate value.
1465
1466         Covered by existent tests.
1467
1468         * platform/image-decoders/png/PNGImageDecoder.cpp:
1469         (WebCore::PNGImageDecoder::repetitionCount):
1470         * platform/image-decoders/png/PNGImageDecoder.h:
1471
1472 2017-04-05  Andy Estes  <aestes@apple.com>
1473
1474         REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
1475         https://bugs.webkit.org/show_bug.cgi?id=170365
1476         <rdar://problem/29205721>
1477
1478         Reviewed by Tim Horton.
1479
1480         r202472 changed the node traversal in searchForLinkRemovingExistingDDLinks() to only
1481         consider nodes that are descendants of startNode, but we need to traverse all nodes between
1482         startNode and endNode to find existing non-DD links.
1483
1484         As a result, we'd add a Data Detector link to the following snippet and make the original
1485         links un-clickable:
1486
1487             <a href='#'>tomorrow</a> <a href='#'>night</a>
1488
1489         Fix this by not specifying a stayWithin node when calling NodeTraversal::next(). The loop
1490         will terminate when we reach endNode.
1491
1492         Updated WebKit2.DataDetectionReferenceDate API test.
1493
1494         * editing/cocoa/DataDetection.mm:
1495         (WebCore::searchForLinkRemovingExistingDDLinks):
1496
1497 2017-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1498
1499         Move WebErrors from WebProcess to Shared and get rid of ErrorsGtk in WebCore
1500         https://bugs.webkit.org/show_bug.cgi?id=156974
1501
1502         Reviewed by Sam Weinig.
1503
1504         Remove ErrorsGtk.
1505
1506         * PlatformGTK.cmake:
1507         * platform/gtk/ErrorsGtk.cpp: Removed.
1508         * platform/gtk/ErrorsGtk.h: Removed.
1509
1510 2017-04-05  Andy Estes  <aestes@apple.com>
1511
1512         [ios-simulator] API test WebKit2.DataDetectionReferenceDate timing out
1513         https://bugs.webkit.org/show_bug.cgi?id=161967
1514
1515         Reviewed by Alexey Proskuryakov.
1516
1517         DataDetectorsCoreSPI.h defined DDQueryOffset as a struct of two CFIndexes, which is 16 bytes
1518         on LP64, but the struct is actually defined as two CFIndex-typed 32-bit bitfields, which is
1519         8 bytes on LP64. This breaks the ABI on Public SDK builds when calling functions that take
1520         or return DDQueryOffsets.
1521
1522         * platform/spi/cocoa/DataDetectorsCoreSPI.h: Updated the DDQueryOffset definition for
1523         Public SDK builds, and added a static_assert to detect future size changes at compile time.
1524
1525 2017-04-04  Jer Noble  <jer.noble@apple.com>
1526
1527         Move AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h
1528         https://bugs.webkit.org/show_bug.cgi?id=170471
1529
1530         Reviewed by Eric Carlson.
1531
1532         Move the declaration of AVSampleBufferDisplayLayer (and related classes) into AVFoundationSPI.
1533
1534         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1535         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1536         * platform/spi/mac/AVFoundationSPI.h:
1537
1538 2017-04-04  Youenn Fablet  <youenn@apple.com>
1539
1540         Canvas is tainted when painting a video with MediaStreamTrack
1541         https://bugs.webkit.org/show_bug.cgi?id=170486
1542
1543         Reviewed by Eric Carlson.
1544
1545         Test: http/tests/media/media-stream/getusermedia-with-canvas.html
1546
1547         Adding the notion of isolated source so that we can later on implement WebRTC isolated tracks.
1548         For now, canvas will not be tainted if painted from a MediaStreamTrack.
1549
1550         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1551         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1552         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didPassCORSAccessCheck):
1553         * platform/mediastream/MediaStreamTrackPrivate.h:
1554         (WebCore::MediaStreamTrackPrivate::isIsolated):
1555         * platform/mediastream/RealtimeMediaSource.h:
1556
1557 2017-04-04  Commit Queue  <commit-queue@webkit.org>
1558
1559         Unreviewed, rolling out r214894, r214895, r214907, r214912,
1560         and r214918.
1561         https://bugs.webkit.org/show_bug.cgi?id=170491
1562
1563         Caused build failures on Mac (Requested by rniwa on #webkit).
1564
1565         Reverted changesets:
1566
1567         "Build fix."
1568         http://trac.webkit.org/changeset/214894
1569
1570         "Rolling back the build fix, as it broke other builds."
1571         http://trac.webkit.org/changeset/214895
1572
1573         "Move AVSampleBufferDisplayLayer declarations into
1574         AVFoundationSPI.h"
1575         https://bugs.webkit.org/show_bug.cgi?id=170471
1576         http://trac.webkit.org/changeset/214907
1577
1578         "Unreviewed build fix: fix compilation error on Sierra."
1579         http://trac.webkit.org/changeset/214912
1580
1581         "More build fixing."
1582         http://trac.webkit.org/changeset/214918
1583
1584 2017-04-04  Youenn Fablet  <youenn@apple.com>
1585
1586         [Mac] Add back web audio support for getUserMedia MediaStreamTrack
1587         https://bugs.webkit.org/show_bug.cgi?id=170482
1588
1589         Reviewed by Eric Carlson.
1590
1591         ´Covered by reenabled test.
1592
1593         Exporting method and class used in WebKit2.
1594
1595         * WebCore.xcodeproj/project.pbxproj:
1596         * platform/audio/mac/CAAudioStreamDescription.h:
1597         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
1598
1599 2017-04-04  Alexey Proskuryakov  <ap@apple.com>
1600
1601         More build fixing.
1602
1603         * platform/spi/mac/AVFoundationSPI.h:
1604
1605 2017-04-04  Simon Fraser  <simon.fraser@apple.com>
1606
1607         Do some minor FEColorMatrix code cleanup and optimization
1608         https://bugs.webkit.org/show_bug.cgi?id=170474
1609
1610         Reviewed by Dean Jackson.
1611
1612         Don't switch inside of a pixel processing loop; repeat the loop inside switch (filterType).
1613         
1614         Change matrix() and saturateAndHueRotate() to dereference the source pixels once, instead
1615         of multiple times, which is faster.
1616         
1617         This kind of code benefits from aligning things with spaces for readability, so do so,
1618         violating webkit style.
1619         
1620         Add some off-by-default performance logging code.
1621
1622         Increases pixel processing performance from about 86ms per megapixel to 65ms per megapixel.
1623
1624         * platform/graphics/filters/FEColorMatrix.cpp:
1625         (WebCore::matrix):
1626         (WebCore::saturateAndHueRotate):
1627         (WebCore::effectType):
1628         (WebCore::FEColorMatrix::platformApplySoftware):
1629
1630 2017-04-04  Brent Fulgham  <bfulgham@apple.com>
1631
1632         Do not assert when CharacterData representing an Attr fires events
1633         https://bugs.webkit.org/show_bug.cgi?id=170454
1634         <rdar://problem/30979320>
1635
1636         Reviewed by Ryosuke Niwa.
1637
1638         Make the NoEventDispatchAssertion in CharacterData::notifyParentAfterChange conditional
1639         since Attr elements should be allowed to fire events.
1640
1641         Tests: fast/dom/no-assert-for-malformed-js-url-attribute.html
1642
1643         * dom/CharacterData.cpp:
1644         (WebCore::CharacterData::notifyParentAfterChange):
1645
1646 2017-04-04  Youenn Fablet  <youenn@apple.com>
1647
1648         LayoutTest webrtc/libwebrtc/descriptionGetters.html is a flaky failure
1649         https://bugs.webkit.org/show_bug.cgi?id=169481
1650
1651         Reviewed by Eric Carlson.
1652
1653         No need to enumerate all network interfaces in most layout tests.
1654         Adding an Internals API for that in case we want to use TCP localhost candidates.
1655
1656         * testing/Internals.cpp:
1657         (WebCore::Internals::Internals):
1658         (WebCore::Internals::setEnumeratingAllNetworkInterfacesEnabled):
1659         * testing/Internals.h:
1660         * testing/Internals.idl:
1661
1662
1663 2017-04-04  Jer Noble  <jer.noble@apple.com>
1664
1665         Unreviewed build fix: fix compilation error on Sierra.
1666
1667         * platform/spi/mac/AVFoundationSPI.h:
1668
1669 2017-04-04  Jer Noble  <jer.noble@apple.com>
1670
1671         Move AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h
1672         https://bugs.webkit.org/show_bug.cgi?id=170471
1673
1674         Reviewed by Eric Carlson.
1675
1676         Move the declaration of AVSampleBufferDisplayLayer (and related classes) into AVFoundationSPI.
1677
1678         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1679         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer): Deleted.
1680         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeDisplayLayer): Deleted.
1681         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1682         * platform/spi/mac/AVFoundationSPI.h:
1683
1684 2017-04-04  Saam Barati  <sbarati@apple.com>
1685
1686         WebAssembly: JSWebAssemblyCallee should not be a JSCell
1687         https://bugs.webkit.org/show_bug.cgi?id=170135
1688
1689         Reviewed by Michael Saboff.
1690
1691         * bindings/js/JSDOMWindowBase.cpp:
1692         (WebCore::callerDOMWindow):
1693
1694 2017-04-04  Simon Fraser  <simon.fraser@apple.com>
1695
1696         Change Document's lastHandledUserGestureTimestamp to be a MonotonicTime
1697         https://bugs.webkit.org/show_bug.cgi?id=170468
1698
1699         Reviewed by Zalan Bujtas.
1700         
1701         Change the double to MonotonicTime. No behavior change.
1702
1703         * dom/Document.cpp:
1704         (WebCore::Document::updateLastHandledUserGestureTimestamp):
1705         * dom/Document.h:
1706         (WebCore::Document::lastHandledUserGestureTimestamp):
1707         * html/HTMLPlugInImageElement.cpp:
1708         (WebCore::documentHadRecentUserGesture):
1709         * loader/FrameLoader.cpp:
1710         (WebCore::shouldAskForNavigationConfirmation):
1711
1712 2017-04-04  Youenn Fablet  <youenn@apple.com>
1713
1714         [Debug] ASSERT(!throwScope.exception()) on imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html
1715         https://bugs.webkit.org/show_bug.cgi?id=170395
1716         <rdar://problem/31394017>
1717
1718         Reviewed by Mark Lam.
1719
1720         No change of behavior.
1721
1722         * bindings/js/JSDOMPromise.cpp:
1723         (WebCore::DeferredPromise::reject): Adding early ASSERT that creating an exception is happening correctly.
1724
1725 2017-04-04  Alexey Proskuryakov  <ap@apple.com>
1726
1727         Rolling back the build fix, as it broke other builds.
1728
1729         * platform/spi/mac/AVFoundationSPI.h:
1730
1731 2017-04-04  Alexey Proskuryakov  <ap@apple.com>
1732
1733         Build fix.
1734
1735         Rubber-stamped by Jer Noble.
1736
1737         * platform/spi/mac/AVFoundationSPI.h:
1738
1739 2017-04-04  Tim Horton  <timothy_horton@apple.com>
1740
1741         [Mac] -[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:] invokes the resultCollector with didWrap = NO even when it wraps
1742         https://bugs.webkit.org/show_bug.cgi?id=165801
1743         <rdar://problem/29649535>
1744
1745         Reviewed by Wenson Hsieh.
1746
1747         New API tests: WebKit2.FindInPageWrapping*
1748
1749         * page/FrameTree.cpp:
1750         (WebCore::FrameTree::traverseNextWithWrap):
1751         (WebCore::FrameTree::traversePreviousWithWrap):
1752         (WebCore::FrameTree::traverseNextInPostOrderWithWrap):
1753         * page/FrameTree.h:
1754         Add CanWrap and DidWrap boolean enums, and add an optional out argument
1755         to traverse*WithWrap indicating whether a wrap actually occurred.
1756
1757         * history/CachedPage.cpp:
1758         (WebCore::firePageShowAndPopStateEvents):
1759         * history/PageCache.cpp:
1760         (WebCore::destroyRenderTree):
1761         Adjust to the new CanWrap enum.
1762         
1763         * page/Page.cpp:
1764         (WebCore::incrementFrame):
1765         (WebCore::Page::findString):
1766         (WebCore::Page::findStringMatchingRanges):
1767         (WebCore::Page::rangeOfString):
1768         (WebCore::Page::findMatchesForText):
1769         (WebCore::Page::unmarkAllTextMatches):
1770         * page/Page.h:
1771         Adjust to the new CanWrap enum, and optionally plumb DidWrap through
1772         to callers of findString().
1773
1774 2017-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1775
1776         [GTK] PLATFORM(GTK) && !USE(COORDINATED_GRAPHICS_THREADED) is no longer possible
1777         https://bugs.webkit.org/show_bug.cgi?id=170458
1778
1779         Reviewed by Carlos Alberto Lopez Perez.
1780
1781         That is not supported anymore, so we can remove dead code from VideoSinkGStreamer.cpp
1782
1783         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
1784         (VideoRenderRequestScheduler::VideoRenderRequestScheduler):
1785
1786 2017-04-04  Per Arne Vollan  <pvollan@apple.com>
1787
1788         Unreviewed Windows build fix.
1789
1790         * bindings/js/JSDOMGuardedObject.h:
1791
1792 2017-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
1793
1794         Data interaction should register type identifiers in order of priority
1795         https://bugs.webkit.org/show_bug.cgi?id=170428
1796         <rdar://problem/30633296>
1797
1798         Reviewed by Tim Horton.
1799
1800         Currently, due to the shared logic for writing to a UIPasteboard (in the case of copy/paste) and the shared
1801         UIItemProvider-based pasteboard wrapper (in the case of data interaction), we don't enforce any particular
1802         ordering in which type identifiers are registered in the generated item provider. This is because
1803         -[UIPasteboard setItems:] only takes an unordered mapping of type identifiers to objects.
1804
1805         To fix this, we introduce a separate way to set pasteboard data that first writes a list of object
1806         representations in order of priority (which is dependent on the content being interacted with) and then register
1807         individual type-data mappings at the end.
1808
1809         Augmented existing API tests in DataInteractionTests to check for the existence and priority of type identifiers
1810         in the UIItemProviders created upon starting data interaction. Also adds a new unit test:
1811         DataInteractionTests.TextAreaToInput.
1812
1813         * WebCore.xcodeproj/project.pbxproj:
1814         * editing/cocoa/EditorCocoa.mm:
1815         (WebCore::archivedDataForAttributedString):
1816         (WebCore::Editor::writeSelectionToPasteboard):
1817         (WebCore::Editor::writeSelection):
1818         * platform/Pasteboard.h:
1819         * platform/PasteboardWriterData.h:
1820         * platform/PlatformPasteboard.h:
1821         * platform/ios/AbstractPasteboard.h:
1822         * platform/ios/AbstractPasteboard.mm: Copied from Source/WebCore/platform/ios/AbstractPasteboard.h.
1823
1824         Introduce WebPasteboardItemData, a wrapper around a list of objects representating the pasteboard data in order
1825         of priority, and a dictionary containing additional NSData blobs that contain data useful for private clients.
1826
1827         (+[WebPasteboardItemData itemWithRepresentingObjects:additionalData:]):
1828         (-[WebPasteboardItemData initWithRepresentingObjects:additionalData:]):
1829         (-[WebPasteboardItemData representingObjects]):
1830         (-[WebPasteboardItemData additionalData]):
1831         * platform/ios/PlatformPasteboardIOS.mm:
1832         (WebCore::richTextRepresentationsForPasteboardWebContent):
1833         (WebCore::PlatformPasteboard::writeObjectRepresentations):
1834         (WebCore::PlatformPasteboard::write):
1835
1836         Tweaked to check whether the pasteboard responds to -setItemsFromObjectRepresentations:. If so, uses the
1837         PlatformPasteboard::writeObjectRepresentations codepath to write data to the pasteboard, respecting type
1838         priority.
1839
1840         * platform/ios/WebItemProviderPasteboard.mm:
1841         (-[WebItemProviderPasteboard pasteboardTypes]):
1842         (-[WebItemProviderPasteboard setItemProviders:]):
1843         (-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]):
1844
1845         Replaces -setItems: with -setItemsFromObjectRepresentations:, which respects the priority of each object
1846         representation of the data in the pasteboard.
1847
1848         (-[WebItemProviderPasteboard setItems:]): Deleted.
1849
1850 2017-04-03  Javier Fernandez  <jfernandez@igalia.com>
1851
1852         [css-align] Adapt place-content alignment shorthand to the new baseline syntax
1853         https://bugs.webkit.org/show_bug.cgi?id=170340
1854
1855         Reviewed by David Hyatt.
1856
1857         Now that the align-content and justify-content CSS properties are
1858         adapted to the new baseline-position CSS values syntax we can adapt the
1859         shorthand that controls such properties to the new syntax as well.
1860
1861         No new tests, just adding some additional cases to the tests we already have.
1862
1863         * css/StyleProperties.cpp:
1864         (WebCore::StyleProperties::getPropertyValue):
1865         (WebCore::StyleProperties::placeContentPropertyValue):
1866         * css/StyleProperties.h:
1867         * css/parser/CSSPropertyParser.cpp:
1868         (WebCore::isContentDistributionKeyword):
1869         (WebCore::isContentPositionKeyword):
1870         (WebCore::isOverflowKeyword):
1871         (WebCore::getBaselineKeyword):
1872         (WebCore::consumeContentDistributionOverflowPosition):
1873         (WebCore::consumeSimplifiedContentPosition):
1874
1875 2017-04-03  Nan Wang  <n_wang@apple.com>
1876
1877         AX: Expose link children when doing search predication on iOS
1878         https://bugs.webkit.org/show_bug.cgi?id=170424
1879         <rdar://problem/31413335>
1880
1881         The children of links are accessible elements on iOS instead of the link itself, 
1882         so we should expose the children when doing predicated searches as well.
1883
1884         Reviewed by Chris Fleizach.
1885
1886         Test: accessibility/ios-simulator/ios-search-predicate-link-children.html
1887
1888         * accessibility/AccessibilityObject.cpp:
1889         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
1890
1891 2017-04-03  Jer Noble  <jer.noble@apple.com>
1892
1893         No audio output for MediaStream-backed audio elements on iOS
1894         https://bugs.webkit.org/show_bug.cgi?id=170427
1895
1896         Reviewed by Eric Carlson.
1897
1898         The logic for setting the output timestamp offset in AudioSampleDataSource was reversed; instead of
1899         subtracting out the timestamp of the first pull request, it effectively doubled it.
1900
1901         * platform/audio/mac/AudioSampleDataSource.mm:
1902         (WebCore::AudioSampleDataSource::pullSamplesInternal):
1903
1904 2017-04-03  Dave Hyatt  <hyatt@apple.com>
1905
1906         Japanese fonts in vertical text should support synthesized italics
1907         https://bugs.webkit.org/show_bug.cgi?id=169301
1908
1909         Reviewed by Simon Fraser.
1910
1911         Updated test in fast/text/international.
1912
1913         * platform/graphics/Font.cpp:
1914         (WebCore::Font::nonSyntheticItalicFont): Deleted.
1915         * platform/graphics/Font.h:
1916         Removed the non-synthetic italic font member, since it's not used.
1917
1918         * platform/graphics/FontCascadeFonts.cpp:
1919         (WebCore::glyphDataForNonCJKCharacterWithGlyphOrientation):
1920         Patched to ensure that a text-orientation-fallback font data is always
1921         returned in the synthetic oblique case, so that non-CJK and CJK are
1922         guaranteed to be broken up so that their slants can be applied differently.
1923
1924         (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
1925         (WebCore::FontCascadeFonts::glyphDataForNormalVariant):
1926         (WebCore::glyphDataForCJKCharacterWithoutSyntheticItalic): Deleted.
1927         Patched to no longer turn off synthetic oblique for CJK.
1928
1929         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1930         (WebCore::FontCascade::drawGlyphs):
1931         Apply the correct italic transform to CJK when in vertical text.
1932
1933 2017-04-03  Chris Dumez  <cdumez@apple.com>
1934
1935         REGRESSION (r206744): CSS background-image in style attribute ignored when using createHTMLDocument method of DOM parsing
1936         https://bugs.webkit.org/show_bug.cgi?id=170285
1937         <rdar://problem/31378543>
1938
1939         Reviewed by Andy Estes.
1940
1941         r206744 caused up to stop trying to resolve relative URLs when trying to load an image
1942         referred to by CSS. We already try to resolve the relative URL when parsing the CSS
1943         property so this will usually work fine. However, in the case when the CSS property
1944         is parsed in detached document and then moved to another document, we will not have
1945         the complete URL.
1946
1947         Test: fast/images/background-image-relative-url-changes-document.html
1948
1949         * css/CSSImageValue.cpp:
1950         (WebCore::CSSImageValue::loadImage):
1951
1952 2017-04-03  Jeremy Jones  <jeremyj@apple.com>
1953
1954         Do not set WebAVPlayerLayerView background to black in fullscreen.
1955         https://bugs.webkit.org/show_bug.cgi?id=170132
1956         rdar://problem/30839278
1957
1958         Reviewed by Tim Horton.
1959
1960         No new tests because no behavior change.
1961
1962         The black background on WebAVPlayerLayerView interferes with the fullscreen animation
1963         and has been removed.
1964
1965         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1966         (WebVideoFullscreenInterfaceAVKit::enterFullscreen):
1967         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard):
1968
1969 2017-04-03  Antti Koivisto  <antti@apple.com>
1970
1971         REGRESSION (r207669): FileMaker Pro Help pages do not render correctly
1972         https://bugs.webkit.org/show_bug.cgi?id=170402
1973         <rdar://problem/31004344>
1974
1975         Reviewed by Simon Fraser.
1976
1977         If a new stylesheet load is started from the load event the document.styleSheets does not
1978         always reflect the already loaded stylesheets.
1979
1980         Test: fast/css/document-stylesheets-dynamic.html
1981
1982         * style/StyleScope.cpp:
1983         (WebCore::Style::Scope::updateActiveStyleSheets):
1984
1985             Remove an old optimization where we would not update active stylesheets if there were pending
1986             (head) stylesheet loads and they had not been updated already.
1987             This is probably not a valuable optimization anymore with the new lazy stylesheet update strategy.
1988
1989         * style/StyleScope.h:
1990
1991 2017-04-03  Anders Carlsson  <andersca@apple.com>
1992
1993         Tweak ApplePaySession API
1994         https://bugs.webkit.org/show_bug.cgi?id=170409
1995         rdar://problem/31405459
1996
1997         Reviewed by Tim Horton.
1998
1999         Rename "address" to "addressLines". Add "postalAddress". Reorder the ApplePayError constructor parameters.
2000
2001         * Modules/applepay/ApplePayError.cpp:
2002         (WebCore::ApplePayError::create):
2003         (WebCore::ApplePayError::ApplePayError):
2004         * Modules/applepay/ApplePayError.h:
2005         * Modules/applepay/ApplePayError.idl:
2006         * Modules/applepay/PaymentRequest.h:
2007
2008 2017-04-03  Zan Dobersek  <zdobersek@igalia.com>
2009
2010         [GCrypt] Implement CryptoKeyEC::keySizeInBits(), ::platformGeneratePair()
2011         https://bugs.webkit.org/show_bug.cgi?id=170345
2012
2013         Reviewed by Michael Catanzaro.
2014
2015         Start implementing the libgcrypt-based platform bits of CryptoKeyEC.
2016
2017         Implement keySizeInBits() by returning the appropriate size for this
2018         object's curve type. An assertion is added to ensure that this size
2019         matches the one that's returned by gcry_pk_get_nbits() for this
2020         object's EC key as represented by the m_platformKey gcry_sexp_t object.
2021
2022         Implement platformGeneratePair() by constructing a genkey s-expression
2023         that requests a generation of an EC key for the specified curve type.
2024         The s-expression is then passed to gcry_pk_genkey(), and the public
2025         and private key data is then retrieved from the returned s-expression
2026         upon success and used to create the public and private CryptoKeyEC
2027         objects.
2028
2029         The PlatformECKey type alias is changed to match gcry_sexp_t. The
2030         CryptoKeyEC destructor releases the gcry_sexp_t object through
2031         a PAL::GCrypt::HandleDeleter<gcry_sexp_t> instance.
2032
2033         The method definitions in the CryptoKeyECGCrypt.cpp file are also
2034         sorted to match the declaration order in the header.
2035
2036         No new tests -- current ones cover this sufficiently, but are not yet
2037         enabled due to other missing platform-specific SUBTLE_CRYPTO
2038         implementations.
2039
2040         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
2041         (WebCore::curveSize):
2042         (WebCore::curveName):
2043         (WebCore::CryptoKeyEC::~CryptoKeyEC):
2044         (WebCore::CryptoKeyEC::keySizeInBits):
2045         (WebCore::CryptoKeyEC::platformGeneratePair):
2046         (WebCore::CryptoKeyEC::platformImportSpki):
2047         (WebCore::CryptoKeyEC::platformImportPkcs8):
2048         (WebCore::CryptoKeyEC::platformExportRaw):
2049         (WebCore::CryptoKeyEC::platformAddFieldElements):
2050         (WebCore::CryptoKeyEC::platformExportSpki):
2051         * crypto/keys/CryptoKeyEC.h:
2052
2053 2017-04-03  Zan Dobersek  <zdobersek@igalia.com>
2054
2055         [GCrypt] Implement AES_KW support
2056         https://bugs.webkit.org/show_bug.cgi?id=170274
2057
2058         Reviewed by Michael Catanzaro.
2059
2060         Implement the CryptoAlgorithmAES_KW::platform{Wrap,Unwrap}Key()
2061         functionality for configurations that use libgcrypt. This is done
2062         by leveraging the gcry_cipher_* APIs for the AES algorithm that's
2063         deducted appropriately from the key size and the AESWRAP cipher mode.
2064
2065         No new tests -- current ones cover this sufficiently, but are not yet
2066         enabled due to other missing platform-specific SUBTLE_CRYPTO
2067         implementations.
2068
2069         * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:
2070         (WebCore::gcryptWrapKey):
2071         (WebCore::gcryptUnwrapKey):
2072         (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
2073         (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
2074
2075 2017-04-03  Zan Dobersek  <zdobersek@igalia.com>
2076
2077         [GCrypt] Implement AES_GCM support
2078         https://bugs.webkit.org/show_bug.cgi?id=170271
2079
2080         Reviewed by Michael Catanzaro.
2081
2082         Implement the CryptoAlgorithmAES_GCM::platform{Encrypt,Decrypt}
2083         functionality for configurations that use libgcrypt. This is done
2084         by leveraging the gcry_cipher_* APIs for the AES algorithm that's
2085         deducted appropriately from the key size and the GCM cipher mode.
2086
2087         No new tests -- current ones cover this sufficiently, but are not yet
2088         enabled due to other missing platform-specific SUBTLE_CRYPTO
2089         implementations.
2090
2091         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
2092         (WebCore::gcryptEncrypt):
2093         (WebCore::gcryptDecrypt):
2094         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2095         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2096
2097 2017-04-03  Zan Dobersek  <zdobersek@igalia.com>
2098
2099         [GCrypt] Implement PBKDF2 support
2100         https://bugs.webkit.org/show_bug.cgi?id=170270
2101
2102         Reviewed by Michael Catanzaro.
2103
2104         Implement the CryptoAlgorithmPBKDF2::platformDeriveBits() functionality
2105         for configurations that use libgcrypt. This is done by leveraging the
2106         gcry_kdf_derive() API, using GCRY_KDF_PBKDF2 as the preferred KDF
2107         along with the properly deducted SHA algorithm.
2108
2109         No new tests -- current ones cover this sufficiently, but are not yet
2110         enabled due to other missing platform-specific SUBTLE_CRYPTO
2111         implementations.
2112
2113         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
2114         (WebCore::gcryptDeriveBits):
2115         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
2116
2117 2017-04-01  Simon Fraser  <simon.fraser@apple.com>
2118
2119         Clean up touch event handler registration when moving nodes between documents
2120         https://bugs.webkit.org/show_bug.cgi?id=170384
2121         rdar://problem/30816694
2122
2123         Reviewed by Chris Dumez.
2124
2125         Make sure that Node::didMoveToNewDocument() does the correct unregistration on the
2126         old document, and registration on the new document for nodes with touch event listeners,
2127         and gesture event listeners. Touch "handler" nodes (those for overflow and sliders) are
2128         already correctly moved via renderer-related teardown.
2129
2130         Add assertions that fire when removal was not complete.
2131
2132         Use references in more places.
2133
2134         Tests: fast/events/touch/ios/gesture-node-move-between-documents.html
2135                fast/events/touch/ios/overflow-node-move-between-documents.html
2136                fast/events/touch/ios/slider-node-move-between-documents.html
2137                fast/events/touch/ios/touch-node-move-between-documents.html
2138
2139         * dom/EventNames.h:
2140         (WebCore::EventNames::gestureEventNames):
2141         * dom/Node.cpp:
2142         (WebCore::Node::willBeDeletedFrom):
2143         (WebCore::Node::didMoveToNewDocument):
2144         (WebCore::tryAddEventListener):
2145         (WebCore::tryRemoveEventListener):
2146         * html/shadow/SliderThumbElement.cpp:
2147         (WebCore::SliderThumbElement::registerForTouchEvents):
2148         (WebCore::SliderThumbElement::unregisterForTouchEvents):
2149         * rendering/RenderLayer.cpp:
2150         (WebCore::RenderLayer::registerAsTouchEventListenerForScrolling):
2151         (WebCore::RenderLayer::unregisterAsTouchEventListenerForScrolling):
2152
2153 2017-04-03  Youenn Fablet  <youenn@apple.com>
2154
2155         captureStream is getting black frames with webgl canvas
2156         https://bugs.webkit.org/show_bug.cgi?id=170325
2157
2158         Reviewed by Dean Jackson.
2159
2160         Test: fast/mediastream/captureStream/canvas3d.html
2161
2162         Changing the webgl context to save buffers in case the canvas is captured.
2163         Adding a canvas changed notification in case of clear.
2164         In the future, we might want to change this notification and do it when endPaint or similar is called.
2165
2166         Adding an Internals API to grab the RGBA equivalent of the next track frame.
2167         For that purpose, adding a bunch of WEBCORE_EXPORT.
2168
2169         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
2170         (WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Adding constraints support so that track settings
2171         getter actually transmits the width and height of the source.
2172         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): ensuring webgl canvas context keep their drawing buffer.
2173         * Modules/mediastream/MediaStreamTrack.h:
2174         * bindings/js/JSDOMGuardedObject.h:
2175         * bindings/js/JSDOMPromise.h:
2176         (WebCore::DeferredPromise::resolve):
2177         (WebCore::DeferredPromise::reject):
2178         * dom/ActiveDOMCallback.h:
2179         * html/HTMLCanvasElement.cpp:
2180         (WebCore::HTMLCanvasElement::captureStream):
2181         * html/ImageData.h:
2182         * html/ImageData.idl:
2183         * html/canvas/WebGLRenderingContext.cpp:
2184         (WebCore::WebGLRenderingContext::clear): ensuring canvas observers get notified in case of clear calls.
2185         * html/canvas/WebGLRenderingContextBase.h:
2186         (WebCore::WebGLRenderingContextBase::preserveDrawingBuffer): Added to allow canvas capture to update this property.
2187         * platform/MediaSample.h:
2188         (WebCore::MediaSample::getRGBAImageData): Added for internals API.
2189         * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
2190         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
2191         (WebCore::MediaSampleAVFObjC::getRGBAImageData):
2192         * platform/graphics/cv/PixelBufferConformerCV.cpp:
2193         (WebCore::PixelBufferConformerCV::convert): Helper routine for getRGBAImageData.
2194         * platform/graphics/cv/PixelBufferConformerCV.h:
2195         * platform/mediastream/RealtimeMediaSourceSettings.h:
2196         (WebCore::RealtimeMediaSourceSettings::setSupportedConstraints):
2197         (WebCore::RealtimeMediaSourceSettings::setSupportedConstraits): Deleted.
2198         * platform/mediastream/mac/AVMediaCaptureSource.mm:
2199         (WebCore::AVMediaCaptureSource::initializeSettings):
2200         * platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h:
2201         * platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h:
2202         * platform/mock/MockRealtimeMediaSource.cpp:
2203         (WebCore::MockRealtimeMediaSource::initializeSettings):
2204         * testing/Internals.cpp:
2205         (WebCore::Internals::grabNextMediaStreamTrackFrame):
2206         (WebCore::Internals::videoSampleAvailable):
2207         * testing/Internals.h:
2208         * testing/Internals.idl:
2209
2210 2017-04-03  Per Arne Vollan  <pvollan@apple.com>
2211
2212         Implement stroke-miterlimit.
2213         https://bugs.webkit.org/show_bug.cgi?id=169078
2214
2215         Reviewed by Dean Jackson.
2216
2217         Support stroke-miterlimit for text rendering, see https://drafts.fxtf.org/paint/.
2218
2219         Tests: fast/css/stroke-miterlimit-default.html
2220                fast/css/stroke-miterlimit-large.html
2221                fast/css/stroke-miterlimit-zero.html
2222
2223         * css/CSSComputedStyleDeclaration.cpp:
2224         (WebCore::ComputedStyleExtractor::propertyValue):
2225         * css/CSSProperties.json:
2226         * css/SVGCSSComputedStyleDeclaration.cpp:
2227         (WebCore::ComputedStyleExtractor::svgPropertyValue):
2228         * rendering/TextPaintStyle.cpp:
2229         (WebCore::computeTextPaintStyle):
2230         (WebCore::updateGraphicsContext):
2231         * rendering/TextPaintStyle.h:
2232         * rendering/style/RenderStyle.cpp:
2233         (WebCore::RenderStyle::diff):
2234         * rendering/style/RenderStyle.h:
2235         (WebCore::RenderStyle::strokeMiterLimit):
2236         (WebCore::RenderStyle::setStrokeMiterLimit):
2237         (WebCore::RenderStyle::initialStrokeMiterLimit):
2238         (WebCore::RenderStyle::setStrokeDashOffset):
2239         * rendering/style/RenderStyleConstants.cpp:
2240         * rendering/style/RenderStyleConstants.h:
2241         * rendering/style/SVGRenderStyle.cpp:
2242         (WebCore::SVGRenderStyle::diff):
2243         * rendering/style/SVGRenderStyle.h:
2244         (WebCore::SVGRenderStyle::initialStrokeDashArray):
2245         (WebCore::SVGRenderStyle::strokeDashArray):
2246         (WebCore::SVGRenderStyle::initialStrokeMiterLimit): Deleted.
2247         (WebCore::SVGRenderStyle::strokeMiterLimit): Deleted.
2248         (WebCore::SVGRenderStyle::setStrokeMiterLimit): Deleted.
2249         * rendering/style/SVGRenderStyleDefs.cpp:
2250         (WebCore::StyleStrokeData::StyleStrokeData):
2251         (WebCore::StyleStrokeData::operator==):
2252         * rendering/style/SVGRenderStyleDefs.h:
2253         * rendering/style/StyleRareInheritedData.cpp:
2254         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
2255         (WebCore::StyleRareInheritedData::operator==):
2256         * rendering/style/StyleRareInheritedData.h:
2257         * rendering/svg/RenderSVGShape.cpp:
2258         (WebCore::RenderSVGShape::hasSmoothStroke):
2259         * rendering/svg/SVGRenderSupport.cpp:
2260         (WebCore::SVGRenderSupport::applyStrokeStyleToContext):
2261         * rendering/svg/SVGRenderTreeAsText.cpp:
2262         (WebCore::writeStyle):
2263
2264 2017-04-03  Alejandro G. Castro  <alex@igalia.com>
2265
2266         [OWR] Fix class structure for the OWR mock classes after last modifications
2267         https://bugs.webkit.org/show_bug.cgi?id=170173
2268
2269         Reviewed by Youenn Fablet.
2270
2271         In case of OWR MockRealtimeMediaSource inherits from
2272         RealtimeMediaSourceOwr, so we have to change some of the function
2273         interfaces.
2274
2275         * platform/mock/MockRealtimeMediaSource.h:
2276
2277 2017-04-02  Alexey Proskuryakov  <ap@apple.com>
2278
2279         Build fix for
2280         Add missing text styles
2281         https://bugs.webkit.org/show_bug.cgi?id=170295
2282
2283         * rendering/RenderThemeIOS.mm:
2284         (WebCore::RenderThemeIOS::cachedSystemFontDescription):
2285         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
2286
2287 2017-04-01  Zalan Bujtas  <zalan@apple.com>
2288
2289         Long Arabic text in ContentEditable with css white-space=pre hangs Safari
2290         https://bugs.webkit.org/show_bug.cgi?id=170245
2291
2292         Reviewed by Myles C. Maxfield.
2293
2294         While searching for mid-word break, we measure the text by codepoints in a loop until the accumulated width > available width.
2295         When we see that the accumulated width for the individual codepoints overflows, we join the codepoints and re-measure them.
2296         These 2 widths could be considerably different for number of reasons (ligatures is a prime example). When we figure that
2297         the run still fits, we go back to the main loop (since we are not supposed to wrap the line here) and take the next codepoint.
2298         However this time we start the measurement from the last whitespace, so we end up remeasuring a potentially long chuck of text
2299         until we hit the wrapping point. This is way too expensive.
2300         This patch changes the logic so that we just go back to measuring individual codepoints until we hit the constrain again.  
2301
2302         Covered by existing tests.
2303
2304         * rendering/line/BreakingContext.h:
2305         (WebCore::BreakingContext::handleText): canUseSimpleFontCodePath() is just to mitigate the potential risk of regression and
2306         complex text is more likely to fall into this category. 
2307
2308 2017-04-01  Jon Lee  <jonlee@apple.com>
2309
2310         Add missing text styles
2311         https://bugs.webkit.org/show_bug.cgi?id=170295
2312         rdar://problem/30219503
2313
2314         Reviewed by Dean Jackson.
2315
2316         Updated existing test to include new text styles.
2317
2318         * css/CSSValueKeywords.in: Add title0 and title4.
2319         * platform/spi/cocoa/CoreTextSPI.h:
2320         * rendering/RenderThemeIOS.mm:
2321         (WebCore::RenderThemeIOS::cachedSystemFontDescription):
2322         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
2323
2324 2017-04-01  Dan Bernstein  <mitz@apple.com>
2325
2326         [iOS] <input type=file> label should be specified using plural rules
2327         https://bugs.webkit.org/show_bug.cgi?id=170388
2328
2329         Reviewed by Alexey Proskuryakov.
2330
2331         * English.lproj/Localizable.strings: Updated using update-webkit-localizable-strings.
2332
2333         * English.lproj/Localizable.stringsdict: Added an entry for the new key "%lu photo(s) and
2334           %lu video(s)", with plural rules covering all the different combinations in English.
2335           Other localizations may specify additional combinations as needed.
2336
2337 2017-04-01  Alexey Proskuryakov  <ap@apple.com>
2338
2339         Rolling back <https://trac.webkit.org/r214697>, as it made WebKit2.DataDetectionReferenceDate time out.
2340
2341         Was REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
2342         https://bugs.webkit.org/show_bug.cgi?id=170365
2343
2344         * editing/cocoa/DataDetection.mm:
2345         (WebCore::searchForLinkRemovingExistingDDLinks):
2346
2347 2017-04-01  Chris Dumez  <cdumez@apple.com>
2348
2349         We should pause silent WebAudio rendering in background tabs
2350         https://bugs.webkit.org/show_bug.cgi?id=170299
2351         <rdar://problem/31289132>
2352
2353         Reviewed by Eric Carlson.
2354
2355         We should pause silent WebAudio rendering in background tabs since it uses CPU and is
2356         not observable by the user. Such silent WebAudio rendering seems to be used by
2357         doubleclick ads.
2358
2359         Test: webaudio/silent-audio-interrupted-in-background.html
2360
2361         * Modules/webaudio/AudioContext.cpp:
2362         (WebCore::AudioContext::lazyInitialize):
2363         (WebCore::AudioContext::uninitialize):
2364         Have AudioContext register / unregister itself with the Document to get
2365         visibility change notifications, similarly to what HTMLMediaElement was
2366         already doing.
2367
2368         (WebCore::AudioContext::visibilityStateChanged):
2369         Begin / End session interruption whenever the page visiblity changes.
2370
2371         * Modules/webaudio/AudioContext.h:
2372         * WebCore.xcodeproj/project.pbxproj:
2373
2374         * dom/Document.cpp:
2375         (WebCore::Document::registerForVisibilityStateChangedCallbacks):
2376         (WebCore::Document::unregisterForVisibilityStateChangedCallbacks):
2377         (WebCore::Document::visibilityStateChanged):
2378         * dom/Document.h:
2379         * dom/Element.h:
2380         * dom/VisibilityChangeClient.h: Added.
2381         (WebCore::VisibilityChangeClient::~VisibilityChangeClient):
2382         * html/HTMLMediaElement.h:
2383         Introduce a new VisibilityChangeClient interface and have both AudioContext
2384         and HTMLMediaElement subclass it. Previously, the visibilityStateChanged()
2385         function was on Element but this prevented AudioContext from registering
2386         itself since AudioContext is not an Element.
2387
2388 2017-04-01  Dan Bernstein  <mitz@apple.com>
2389
2390         [Cocoa] A couple of UI strings use three periods instead of an ellipsis
2391         https://bugs.webkit.org/show_bug.cgi?id=170386
2392
2393         Reviewed by Tim Horton.
2394
2395         * English.lproj/Localizable.strings: Updated using update-webkit-localizable-strings.
2396
2397         * platform/LocalizedStrings.cpp:
2398         (WebCore::mediaElementLoadingStateText): Changed "Loading..." to "Loading…".
2399
2400         * platform/cocoa/LocalizedStringsCocoa.mm:
2401         (WebCore::contextMenuItemTagStyles): Changed "Styles..." to "Styles…".
2402
2403 2017-04-01  Dan Bernstein  <mitz@apple.com>
2404
2405         Localizable strings files are out of date
2406         https://bugs.webkit.org/show_bug.cgi?id=170383
2407
2408         Reviewed by Tim Horton.
2409
2410         Ran update-webkit-localizable-strings.
2411
2412         * English.lproj/Localizable.strings:
2413
2414 2017-04-01  Dan Bernstein  <mitz@apple.com>
2415
2416         [Xcode] In engineering builds, linker warns about libwebrtc.dylib’s install name being invalid
2417         https://bugs.webkit.org/show_bug.cgi?id=170385
2418
2419         Reviewed by Tim Horton.
2420
2421         * Configurations/DebugRelease.xcconfig: Set WK_RELOCATABLE_FRAMEWORKS to YES like we do
2422           in some other projects’ DebugRelease.xcconfig. Engineering builds are always relocatable.
2423         * Configurations/WebCore.xcconfig: When WebCore is relocatable, tell the linker that it’s
2424           not going to be in the shared cache, even if its install name implies that it might be.
2425
2426 2017-04-01  Alexey Proskuryakov  <ap@apple.com>
2427
2428         Rolling back http://trac.webkit.org/r214663 - memory corruption
2429
2430         * Modules/streams/ReadableByteStreamInternals.js:
2431         (cloneArrayBuffer):
2432         * bindings/js/JSDOMGlobalObject.cpp:
2433         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
2434         * bindings/js/StructuredClone.cpp:
2435         (WebCore::structuredCloneArrayBuffer):
2436         (WebCore::cloneArrayBufferImpl): Deleted.
2437         (WebCore::cloneArrayBuffer): Deleted.
2438         * bindings/js/StructuredClone.h:
2439         * bindings/js/WebCoreBuiltinNames.h:
2440         * testing/Internals.cpp:
2441         (WebCore::markerTypeFrom):
2442         (WebCore::Internals::resetToConsistentState):
2443         (WebCore::Internals::isLoadingFromMemoryCache):
2444         (WebCore::Internals::setImageFrameDecodingDuration):
2445         (WebCore::deferredStyleRulesCountForList):
2446         (WebCore::deferredGroupRulesCountForList):
2447         (WebCore::deferredKeyframesRulesCountForList):
2448         (WebCore::Internals::eventThrottlingBehaviorOverride):
2449         (WebCore::Internals::enableMockSpeechSynthesizer):
2450         (WebCore::Internals::rangeForDictionaryLookupAtLocation):
2451         (WebCore::Internals::nodesFromRect):
2452         (WebCore::Internals::layerIDForElement):
2453         (WebCore::Internals::setElementUsesDisplayListDrawing):
2454         (WebCore::Internals::setElementTracksDisplayListReplay):
2455         (WebCore::Internals::styleRecalcCount):
2456         (WebCore::Internals::compositingUpdateCount):
2457         (WebCore::Internals::setCaptionDisplayMode):
2458         (WebCore::Internals::endMediaSessionInterruption):
2459         (WebCore::Internals::postRemoteControlCommand):
2460         (WebCore::appendOffsets):
2461         (WebCore::Internals::scrollSnapOffsets):
2462         (WebCore::Internals::setShowAllPlugins):
2463         (WebCore::Internals::cloneArrayBuffer): Deleted.
2464         * testing/Internals.h:
2465         * testing/Internals.idl:
2466
2467 2017-03-31  Zalan Bujtas  <zalan@apple.com>
2468
2469         <table>: Including <caption>, <thead> or <tbody> causes clipping across page breaks
2470         https://bugs.webkit.org/show_bug.cgi?id=170348
2471         <rdar://problem/24727151>
2472
2473         Reviewed by David Hyatt.
2474
2475         1. In RenderFlowThread::offsetFromLogicalTopOfFirstRegion() we need to take table section offset into account (they are skipped
2476         during the containing block traversal).
2477         2. Trigger paginated relayout when body is moved vertically due to caption/thead etc.
2478
2479         Test: fast/multicol/table-section-page-break.html
2480
2481         * rendering/RenderFlowThread.cpp:
2482         (WebCore::RenderFlowThread::offsetFromLogicalTopOfFirstRegion):
2483         * rendering/RenderTable.cpp:
2484         (WebCore::RenderTable::layout):
2485
2486 2017-03-31  Simon Fraser  <simon.fraser@apple.com>
2487
2488         Rename DOMWindow's m_touchEventListenerCount to m_touchAndGestureEventListenerCount
2489         https://bugs.webkit.org/show_bug.cgi?id=170371
2490
2491         Reviewed by Tim Horton.
2492
2493         This count tracks touch and gesture event listeners, so name it appropriately.
2494
2495         * page/DOMWindow.cpp:
2496         (WebCore::DOMWindow::addEventListener):
2497         (WebCore::DOMWindow::removeEventListener):
2498         (WebCore::DOMWindow::removeAllEventListeners):
2499         * page/DOMWindow.h:
2500
2501 2017-03-31  Simon Fraser  <simon.fraser@apple.com>
2502
2503         When destroying a Node, assert that it's been removed from all the touch handler maps
2504         https://bugs.webkit.org/show_bug.cgi?id=170363
2505         rdar://problem/31377469
2506
2507         Reviewed by Tim Horton.
2508
2509         Assert that the Node has been removed from the touch handler maps in all documents on destruction.
2510
2511         * dom/Document.h:
2512         (WebCore::Document::hasTouchEventHandlers):
2513         (WebCore::Document::touchEventTargetsContain):
2514         * dom/Node.cpp:
2515         (WebCore::Node::~Node):
2516
2517 2017-03-31  Alexey Proskuryakov  <ap@apple.com>
2518
2519         Rolling back https://trac.webkit.org/r214689, as it caused many crashes.
2520
2521         Was:
2522         Fix memory leak in CreateSessionDescriptionObserver::OnSuccess
2523         https://bugs.webkit.org/show_bug.cgi?id=170357
2524
2525         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2526         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded):
2527
2528 2017-03-31  Youenn Fablet  <youenn@apple.com>
2529
2530         Fix memory leak in RealtimeVideoIncomingSource
2531         https://bugs.webkit.org/show_bug.cgi?id=170356
2532
2533         Reviewed by Eric Carlson.
2534
2535         No change of behavior.
2536
2537         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
2538         (WebCore::RealtimeIncomingVideoSource::OnFrame): Adopting the newly created pointer.
2539
2540 2017-03-31  Andy Estes  <aestes@apple.com>
2541
2542         REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
2543         https://bugs.webkit.org/show_bug.cgi?id=170365
2544         <rdar://problem/29205721>
2545
2546         Reviewed by Tim Horton.
2547
2548         r202472 changed the node traversal in searchForLinkRemovingExistingDDLinks() to only
2549         consider nodes that are descendants of startNode, but we need to traverse all nodes between
2550         startNode and endNode to find existing non-DD links.
2551
2552         As a result, we'd add a Data Detector link to the following snippet and make the original
2553         links un-clickable:
2554
2555             <a href='#'>tomorrow</a> <a href='#'>night</a>
2556
2557         Fix this by not specifying a stayWithin node when calling NodeTraversal::next(). The loop
2558         will terminate when we reach endNode.
2559
2560         Updated WebKit2.DataDetectionReferenceDate API test.
2561
2562         * editing/cocoa/DataDetection.mm:
2563         (WebCore::searchForLinkRemovingExistingDDLinks):
2564
2565 2017-03-31  Eric Carlson  <eric.carlson@apple.com>
2566
2567         Incoming video source doesn't propogate frame rotation
2568         https://bugs.webkit.org/show_bug.cgi?id=170364
2569
2570         Reviewed by Youenn Fablet.
2571
2572         No new tests, the mock video source doesn't support rotation. Test will be added when
2573         this is fixed in https://bugs.webkit.org/show_bug.cgi?id=169822. The changes were 
2574         verified manually.
2575
2576         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
2577         (WebCore::RealtimeIncomingVideoSource::OnFrame): Convert frame rotation to sample
2578         orientation and swap width and height when necessary.
2579         (WebCore::RealtimeIncomingVideoSource::processNewSample):
2580         * platform/mediastream/mac/RealtimeIncomingVideoSource.h:
2581
2582 2017-03-31  Chris Dumez  <cdumez@apple.com>
2583
2584         Possible null dereference under SourceBuffer::sourceBufferPrivateDidReceiveSample()
2585         https://bugs.webkit.org/show_bug.cgi?id=159639
2586
2587         Reviewed by Eric Carlson.
2588
2589         Add a null check for trackBuffer.description before dereferencing as it seems
2590         it can be null.
2591
2592         * Modules/mediasource/SourceBuffer.cpp:
2593         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2594
2595 2017-03-31  Youenn Fablet  <youenn@apple.com>
2596
2597         Fix memory leak in CreateSessionDescriptionObserver::OnSuccess
2598         https://bugs.webkit.org/show_bug.cgi?id=170357
2599
2600         Reviewed by Geoffrey Garen.
2601
2602         No change of behavior.
2603
2604         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2605         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded): Adopting the raw pointer parameter.
2606
2607 2017-03-31  Fujii Hironori  <Hironori.Fujii@sony.com>
2608
2609         [WinCairo] WebCore::PlatformDisplay::terminateEGLDisplay causes a crash in libGLESv2.dll while processing atexit
2610         https://bugs.webkit.org/show_bug.cgi?id=170331
2611
2612         Reviewed by Michael Catanzaro.
2613
2614         WebCore::PlatformDisplay uses atexit to destruct EGL displays
2615         while exiting process. But, when the atexit will be processed,
2616         heap of libGLESv2.dll would be already destructed and causing a
2617         crash on Windows. Do not use atexit for Windows.
2618
2619         AppleWin port does not use PlatformDisplay. Thus, it does not have
2620         this bug.
2621
2622         * platform/graphics/PlatformDisplay.cpp:
2623         (WebCore::PlatformDisplay::initializeEGLDisplay): Do not use atexit for Windows.
2624         (WebCore::PlatformDisplay::shutDownEglDisplays): Added.
2625         * platform/graphics/PlatformDisplay.h: Added a declaration of shutDownEglDisplays.
2626
2627 2017-03-31  Yoav Weiss  <yoav@yoav.ws>
2628
2629         Remove PRELOAD_DEBUG related code.
2630         https://bugs.webkit.org/show_bug.cgi?id=170352
2631
2632         Reviewed by Youenn Fablet.
2633
2634         As the PRELOAD_DEBUG related code stopped building and it seems like no one noticed,
2635         it seems safe to assume that we can remove that code. This patch removes it.
2636
2637         No new tests as there's no functional change.
2638
2639         * loader/cache/CachedResourceLoader.cpp:
2640         (WebCore::CachedResourceLoader::preload):
2641         (WebCore::CachedResourceLoader::clearPreloads):
2642         (WebCore::CachedResourceLoader::printPreloadStats): Deleted.
2643
2644 2017-03-31  Brady Eidson  <beidson@apple.com>
2645
2646         Clean up the "StorageType" enum.
2647         https://bugs.webkit.org/show_bug.cgi?id=170349
2648
2649         Reviewed by Tim Horton.
2650
2651         - Make this `enum` into an `enum class`
2652         - Add a new type specific for "transient local storage"
2653
2654         No new tests (No behavior change).
2655
2656         * WebCore.xcodeproj/project.pbxproj:
2657         
2658         * inspector/InspectorDOMStorageAgent.cpp:
2659         (WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
2660         
2661         * inspector/InspectorInstrumentation.h:
2662         
2663         * loader/EmptyClients.cpp:
2664         
2665         * storage/Storage.cpp:
2666         (WebCore::Storage::isDisabledByPrivateBrowsing):
2667         
2668         * storage/StorageArea.h:
2669         (): Deleted.
2670         
2671         * storage/StorageEventDispatcher.cpp:
2672         (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
2673         (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
2674         
2675         * storage/StorageType.h:
2676         (WebCore::isLocalStorage):
2677
2678 2017-03-31  Chris Dumez  <cdumez@apple.com>
2679
2680         Unreviewed, Mark "HTML interactive form validation" as done.
2681
2682         It is shipping in Safari 10.1.
2683  
2684         * features.json:
2685
2686 2017-03-31  Csaba Osztrogonác  <ossy@webkit.org>
2687
2688         Mac cmake buildfix after r214666
2689         https://bugs.webkit.org/show_bug.cgi?id=170342
2690
2691         Unreviewed buildfix.
2692
2693         * PlatformMac.cmake:
2694         * testing/MockPreviewLoaderClient.h:
2695
2696 2017-03-31  Sam Weinig  <sam@webkit.org>
2697
2698         Remove unneeded custom constructors include.
2699
2700         * WebCore.xcodeproj/project.pbxproj:
2701         * bindings/js/ios: Removed.
2702         * bindings/js/ios/TouchConstructors.cpp: Removed.
2703
2704 2017-03-31  John Wilander  <wilander@apple.com>
2705
2706         Resource Load Statistics: Check if the store exists before clearing it
2707         https://bugs.webkit.org/show_bug.cgi?id=170324
2708         <rdar://problem/31258505>
2709
2710         Reviewed by Brent Fulgham.
2711
2712         No new tests. Added a null check.
2713
2714         * loader/ResourceLoadObserver.cpp:
2715         (WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore):
2716             Added a null check.
2717
2718 2017-03-31  Romain Bellessort  <romain.bellessort@crf.canon.fr>
2719
2720         [Readable Streams API] Implement cloneArrayBuffer in WebCore
2721         https://bugs.webkit.org/show_bug.cgi?id=170008
2722
2723         Reviewed by Youenn Fablet.
2724
2725         Implemented cloneArrayBuffer based on existing structuredCloneArrayBuffer
2726         implementation. The code has been factorized so that both cloneArrayBuffer
2727         and structuredCloneArrayBuffer rely on the same code (which is basically
2728         the previous implementation of structuredCloneArrayBuffer + the ability
2729         to clone only a part of considered buffer).
2730
2731         Added test to check cloneArrayBuffer behaviour.
2732
2733         * Modules/streams/ReadableByteStreamInternals.js: Deleted cloneArrayBuffer JS implementation.
2734         * bindings/js/JSDOMGlobalObject.cpp:
2735         (WebCore::JSDOMGlobalObject::addBuiltinGlobals): Add cloneArrayBuffer private declaration.
2736         * bindings/js/StructuredClone.cpp:
2737         (WebCore::cloneArrayBufferImpl): Added (mostly based on previous structuredCloneArrayBuffer).
2738         (WebCore::cloneArrayBuffer): Added.
2739         (WebCore::structuredCloneArrayBuffer): Updated.
2740         * bindings/js/StructuredClone.h: Added cloneArrayBuffer declaration.
2741         * bindings/js/WebCoreBuiltinNames.h: Added cloneArrayBuffer declaration.
2742         * testing/Internals.cpp: Added support for testing cloneArrayBuffer.
2743         * testing/Internals.h: Added support for testing cloneArrayBuffer.
2744         * testing/Internals.idl: Added support for testing cloneArrayBuffer.
2745
2746 2017-03-31  Antoine Quint  <graouts@apple.com>
2747
2748         [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
2749         https://bugs.webkit.org/show_bug.cgi?id=168409
2750         <rdar://problem/30799198>
2751
2752         Unreviewed. Yet more logging to determine under what circumstance ScriptedAnimationController gets suspended.
2753
2754         * dom/Document.cpp:
2755         (WebCore::Document::requestAnimationFrame):
2756
2757 2017-03-30  Zan Dobersek  <zdobersek@igalia.com>
2758
2759         Unreviewed GTK+ build fix. Add missing ANGLE build targets
2760         to the build.
2761
2762         * CMakeLists.txt:
2763
2764 2017-03-30  Simon Fraser  <simon.fraser@apple.com>
2765
2766         Ensure that Node::willBeDeletedFrom() always removes touch event handlers from the document
2767         https://bugs.webkit.org/show_bug.cgi?id=170323
2768         rdar://problem/23647630
2769
2770         Reviewed by Chris Dumez.
2771
2772         There are two instances where nodes are registered as touch event handlers without
2773         having normal touch event listeners: slider thumb elements, and elements with overflow scrolling,
2774         on iOS.
2775
2776         For such nodes, hasEventTargetData() will be false, but we want to ensure
2777         that they are removed from the Document's touchEventHandler set, so move the
2778         call to document.removeTouchEventHandler() outside of the conditional block.
2779
2780         This should be cheap in most cases when the touchEventHandler is empty.
2781
2782         * dom/Node.cpp:
2783         (WebCore::Node::willBeDeletedFrom):
2784
2785 2017-03-30  Simon Fraser  <simon.fraser@apple.com>
2786
2787         Minor cleanup checking for gesture event names
2788         https://bugs.webkit.org/show_bug.cgi?id=170319
2789
2790         Reviewed by Tim Horton.
2791
2792         Just use isGestureEventType() in a couple of places.
2793
2794         * dom/Node.cpp:
2795         (WebCore::tryAddEventListener):
2796         (WebCore::tryRemoveEventListener):
2797
2798 2017-03-30  Simon Fraser  <simon.fraser@apple.com>
2799
2800         Rename a touch event function, and new touch region test results
2801         https://bugs.webkit.org/show_bug.cgi?id=170309
2802         rdar://problem/31329520
2803
2804         Reviewed by Chris Dumez.
2805
2806         Adapt to a naming change in WebKitAdditions.
2807
2808         * dom/Document.cpp:
2809         (WebCore::Document::removeAllEventListeners):
2810         * page/FrameView.cpp:
2811         (WebCore::FrameView::layout):
2812         * rendering/RenderElement.cpp:
2813         (WebCore::RenderElement::styleWillChange):
2814         * rendering/RenderLayer.cpp:
2815         (WebCore::RenderLayer::scrollTo):
2816         (WebCore::RenderLayer::calculateClipRects):
2817
2818 2017-03-30  Matt Rajca  <mrajca@apple.com>
2819
2820         YouTube sometimes does not respect "user gesture" restriction for videos.
2821         https://bugs.webkit.org/show_bug.cgi?id=170297
2822
2823         I discovered a code path that does not honor the "user gesture" requirement and playback is able to begin
2824         even though we have a restriction in place. When using Media Source Extensions, which YouTube does, we transition
2825         from a "Have Metadata" to a "Future Data" state that causes playback to begin, however, we never check
2826         if we have a playback restriction in place.
2827
2828         Reviewed by Eric Carlson.
2829
2830         * html/HTMLMediaElement.cpp:
2831         (WebCore::HTMLMediaElement::setReadyState):
2832
2833 2017-03-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
2834
2835         REGRESSION (r213764): Background image from sprite sheet incorrectly scaled
2836         https://bugs.webkit.org/show_bug.cgi?id=169547
2837
2838         Reviewed by Simon Fraser.
2839
2840         The bug happens when drawing only a rectangle of an image not the whole
2841         image. In BitmapImage::draw(), sizeForDrawing was calculated as the destRect
2842         scaled by the transformation which is applied to the GraphicsContext. Two
2843         problems with this approach. The first one is destRect can be only part of
2844         the image. The second problem is, the ratio destRect / srcRect is another
2845         scaling that needs to be considered.
2846
2847         To fix this issue, first the base size has to be size of the image and not
2848         destRect.size(). Secondly, we need to scale this base size with the context
2849         transformation multiplied by the ratio destRect / srcRect. This scaling is
2850         exactly the same scaling which is calculated in subsamplingScale(). Finally
2851         we use this scaled size as the sizeForDrawing to send to the ImageDecoder.
2852
2853         Test: fast/images/sprite-sheet-image-draw.html
2854
2855         * platform/graphics/BitmapImage.cpp:
2856         (WebCore::BitmapImage::draw): Fix the bug.
2857         (WebCore::BitmapImage::stopAnimation): Stops the async image decoding for animated images only.
2858         The decoding for large images will be stopped when BitmapImage::newFrameNativeImageAvailableAtIndex()
2859         is called and the decoding queue is idle.
2860         (WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex): Add image logging.
2861         * platform/graphics/BitmapImage.h: Move sourceURL() to the Image class.
2862         * platform/graphics/GraphicsContext.cpp: Pass imagePaintingOptions.m_decodingMode to Image::drawTiled().
2863         (WebCore::GraphicsContext::drawTiledImage): Pass imagePaintingOptions.m_decodingMode) to Image::drawTiled().
2864         * platform/graphics/Image.cpp:
2865         (WebCore::Image::sourceURL): Moved from BitmapImage.
2866         (WebCore::Image::drawTiled): Add a DecodingMode argument instead of calling always with DecodingMode::Synchronous.
2867         * platform/graphics/Image.h:
2868         * platform/graphics/ImageFrameCache.cpp:
2869         (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): Add image logging.
2870         (WebCore::ImageFrameCache::startAsyncDecodingQueue): Ditto,
2871         (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Ditto.
2872         (WebCore::ImageFrameCache::stopAsyncDecodingQueue): Ditto.
2873         (WebCore::ImageFrameCache::sourceURL): A helper function to avoid checking the value of m_image.
2874         * platform/graphics/ImageFrameCache.h:
2875         * platform/graphics/NativeImage.h: Rename subsamplingScale() to nativeImageDrawingScale() and return image scaling instead.
2876         * platform/graphics/cairo/NativeImageCairo.cpp:
2877         (WebCore::nativeImageDrawingScale): Ditto.
2878         (WebCore::subsamplingScale): Deleted.
2879         * platform/graphics/cg/NativeImageCG.cpp:
2880         (WebCore::nativeImageDrawingScale): Ditto.
2881         (WebCore::subsamplingScale): Deleted.
2882         * platform/graphics/win/NativeImageDirect2D.cpp:
2883         (WebCore::nativeImageDrawingScale): Ditto.
2884         (WebCore::subsamplingScale): Deleted.
2885
2886 2017-03-30  Matt Baker  <mattbaker@apple.com>
2887
2888         Web Inspector: Assertion failure in InspectorStyleProperty::setRawTextFromStyleDeclaration
2889         https://bugs.webkit.org/show_bug.cgi?id=170279
2890         <rdar://problem/30200492>
2891
2892         Reviewed by David Hyatt.
2893
2894         The SourceRange for a CSSPropertySourceData should be relative to the start
2895         of the declaration body, not the start of the StyleSheetHandler’s parsed
2896         text. This only affected the ranges of unparsed (parsedOK == false) properties
2897         lacking a trailing semi-colon.
2898
2899         This patch doesn't change the behavior of InspectorStyleSheet other than
2900         silencing an irksome assert, as String::substring does a safety check on
2901         the passed in length.
2902
2903         * inspector/InspectorStyleSheet.cpp:
2904         (WebCore::fixUnparsedProperties):
2905
2906 2017-03-30  Youenn Fablet  <youenn@apple.com> and Jon Lee <jonlee@apple.com>
2907
2908         Clean up RTCDataChannel
2909         https://bugs.webkit.org/show_bug.cgi?id=169732
2910
2911         Reviewed by Chris Dumez.
2912
2913         Test: webrtc/datachannel/datachannel-event.html
2914               webrtc/datachannel/bufferedAmountLowThreshold.html
2915
2916         Making RTCDataChannel interface closer to the spec updating implementation accordingly.
2917         See https://w3c.github.io/webrtc-pc/#rtcdatachannel.
2918         In particular adding RTCDataChannelEvent constructor, and missing bufferedAmount related attributes.
2919         Doing some additional cleaning refactoring.
2920
2921         Making bufferedAmountIsDecreasing take a bufferedAmount argument so that we get the actual value passed by
2922         libwebrtc without needing to get it from the libwebrtc network thread again.
2923         In the future, we should store the bufferedAmount value in RTCDataChannel and update its value on each libwebrtc
2924         OnBufferedAmountChange. Special treatment may be needed when the data channel is closed, in which case the bufferedAmount should just be
2925         updated to increase in the send method.
2926
2927         Added some FIXMEs as RTCDataChannel is not aligned with the spec related to send and bufferedAmount.
2928
2929         * Modules/mediastream/RTCDataChannel.cpp:
2930         (WebCore::RTCDataChannel::send):
2931         (WebCore::RTCDataChannel::close):
2932         (WebCore::RTCDataChannel::didChangeReadyState):
2933         (WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
2934         * Modules/mediastream/RTCDataChannel.h:
2935         * Modules/mediastream/RTCDataChannel.idl:
2936         * Modules/mediastream/RTCDataChannelEvent.cpp:
2937         (WebCore::RTCDataChannelEvent::create):
2938         (WebCore::RTCDataChannelEvent::RTCDataChannelEvent):
2939         (WebCore::RTCDataChannelEvent::channel):
2940         * Modules/mediastream/RTCDataChannelEvent.h:
2941         * Modules/mediastream/RTCDataChannelEvent.idl:
2942         * Modules/mediastream/RTCPeerConnection.idl:
2943         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
2944         (WebCore::LibWebRTCDataChannelHandler::OnStateChange):
2945         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2946         (WebCore::LibWebRTCMediaEndpoint::addDataChannel):
2947         * WebCore.xcodeproj/project.pbxproj:
2948         * dom/EventNames.h:
2949         * platform/mediastream/RTCDataChannelHandler.h:
2950         * platform/mediastream/RTCDataChannelHandlerClient.h:
2951         * platform/mediastream/RTCDataChannelState.h: Added.
2952         * platform/mediastream/RTCPeerConnectionHandlerClient.h:
2953         * platform/mock/RTCDataChannelHandlerMock.cpp:
2954         (WebCore::RTCDataChannelHandlerMock::setClient):
2955         (WebCore::RTCDataChannelHandlerMock::close):
2956         * platform/mock/RTCNotifiersMock.cpp:
2957         (WebCore::IceConnectionNotifier::IceConnectionNotifier):
2958         (WebCore::SignalingStateNotifier::SignalingStateNotifier):
2959         (WebCore::DataChannelStateNotifier::DataChannelStateNotifier):
2960         * platform/mock/RTCNotifiersMock.h:
2961
2962 2017-03-30  Javier Fernandez  <jfernandez@igalia.com>
2963
2964         [css-align] Adapt content-alignment properties to the new baseline syntax
2965         https://bugs.webkit.org/show_bug.cgi?id=170262
2966
2967         Reviewed by David Hyatt.
2968
2969         The baseline-position syntax has changed recently, so we need to update
2970         the CSS properties using the old syntax. This patch address only the
2971         content-alignment (align-content and justify-content).
2972
2973         I used this patch to adapt the implementation of the parsing logic for
2974         these properties to the new Blink's CSS Parsing Design.
2975
2976         The new baseline syntax is "[first | last ]? baseline" which implies
2977         modifying the parsing and computed value logic.
2978
2979         There are several layout tests affected by this change, so I'll update
2980         them accordingly.
2981
2982         No new tests, just added/modified some cases to the tests we
2983         already have using the new baseline values.
2984
2985         * css/CSSComputedStyleDeclaration.cpp:
2986         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
2987         * css/CSSContentDistributionValue.cpp:
2988         (WebCore::CSSContentDistributionValue::customCSSText):
2989         * css/CSSPrimitiveValueMappings.h:
2990         (WebCore::CSSPrimitiveValue::operator ItemPosition):
2991         (WebCore::CSSPrimitiveValue::operator ContentPosition):
2992         * css/CSSValueKeywords.in:
2993         * css/parser/CSSPropertyParser.cpp:
2994         (WebCore::isBaselineKeyword):
2995         (WebCore::consumeBaselineKeyword):
2996         (WebCore::consumeContentDistributionOverflowPosition):
2997         (WebCore::consumeSelfPositionOverflowPosition):
2998
2999 2017-03-30  James Craig  <jcraig@apple.com>
3000
3001         AX: Expose a new AXSubrole for explicit ARIA "group" role
3002         https://bugs.webkit.org/show_bug.cgi?id=169810
3003         <rdar://problem/31039693>
3004
3005         Reviewed by Chris Fleizach.
3006
3007         Split GroupRole into generics (GroupRole) and explicit groups 
3008         (ApplicationGroupRole) so we can expose a subrole on the explicit 
3009         groups. Account for the change in ARIA Tree and Menu hierachies. 
3010         Update the computedRoleValue for WebKit Inspector usage, too.
3011
3012         Updated existing tests.
3013
3014         Test: accessibility/list-detection2.html:
3015         Test: accessibility/roles-computedRoleString.html:
3016         Test: inspector/dom/getAccessibilityPropertiesForNode.html:
3017         Test: inspector/dom/highlightFrame.html:
3018         Test: inspector/dom/highlightSelector.html:
3019
3020         * accessibility/AccessibilityNodeObject.cpp:
3021         (WebCore::AccessibilityNodeObject::helpText):
3022         (WebCore::AccessibilityNodeObject::hierarchicalLevel):
3023         (WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent):
3024         * accessibility/AccessibilityObject.cpp:
3025         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent):
3026         (WebCore::AccessibilityObject::ariaTreeItemContent):
3027         (WebCore::initializeRoleMap):
3028         (WebCore::AccessibilityObject::computedRoleString):
3029         * accessibility/AccessibilityObject.h:
3030         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3031         (atkRole):
3032         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3033         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
3034         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3035         (createAccessibilityRoleMap):
3036         (-[WebAccessibilityObjectWrapper subrole]):
3037
3038 2017-03-30  Chris Dumez  <cdumez@apple.com>
3039
3040         We are spending a lot of time bzero'ing AudioChannel buffers on uni-watch.com
3041         https://bugs.webkit.org/show_bug.cgi?id=170288
3042         <rdar://problem/31289132>
3043
3044         Reviewed by Eric Carlson.
3045
3046         We are spending a lot of time bzero'ing AudioChannel buffers on uni-watch.com due
3047         to doubleclick ads using WebAudio with a 0-gain GainNode. We should optimize the
3048         0-gain case as much as possible.
3049
3050         No new tests, only an optimization.
3051
3052         * Modules/webaudio/AudioNode.cpp:
3053         (WebCore::AudioNode::processIfNecessary):
3054         Drop call to unsilenceOutputs() before calling AudioNode::process(). The AudioChannel
3055         API already takes care of clearing its 'silent' flag whenever its buffer changes so
3056         there should be no need to explicitly clearing the 'silent' flag before calling
3057         process(). This was causing us to zero out buffers that were already filled with
3058         zeros because AudioChannel::zero() would no longer return early, not knowing the
3059         channel is already silent. This reduces the number of bzero() calls by ~3.5x on
3060         uni-watch.com (from 100 calls every ~20ms to 100 calls every ~70ms.
3061
3062         * Modules/webaudio/AudioNode.h:
3063         * platform/audio/mac/AudioDestinationMac.cpp:
3064         (WebCore::AudioDestinationMac::render):
3065         Avoid clamping the values in the channel buffer if the channel is silent since this
3066         will have no effect (given that the buffer only contains zeros).
3067
3068 2017-03-30  Eric Carlson  <eric.carlson@apple.com>
3069
3070         [Crash] WebCore::AudioBuffer::AudioBuffer don't checking illegal value
3071         https://bugs.webkit.org/show_bug.cgi?id=169956
3072
3073         Reviewed by Youenn Fablet.
3074
3075         Test: webaudio/audiobuffer-crash.html
3076
3077         * Modules/webaudio/AudioBuffer.cpp:
3078         (WebCore::AudioBuffer::AudioBuffer): Invalidate the object and return early if the channel 
3079         array allocation fails.
3080         (WebCore::AudioBuffer::AudioBuffer): Ditto.
3081         (WebCore::AudioBuffer::invalidate): Invalidate the object.
3082         * Modules/webaudio/AudioBuffer.h:
3083
3084 2017-03-30  Antoine Quint  <graouts@apple.com>
3085
3086         [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
3087         https://bugs.webkit.org/show_bug.cgi?id=168409
3088         <rdar://problem/30799198>
3089
3090         Unreview. Print the backtrace when we suspend scripted animations.
3091
3092         * page/Page.cpp:
3093         (WebCore::Page::suspendScriptedAnimations):
3094
3095 2017-03-30  Antoine Quint  <graouts@apple.com>
3096
3097         [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
3098         https://bugs.webkit.org/show_bug.cgi?id=168409
3099         <rdar://problem/30799198>
3100
3101         Unreview. Pring the backtrace when we suspend ScriptedAnimationController.
3102
3103         * dom/ScriptedAnimationController.cpp:
3104         (WebCore::ScriptedAnimationController::suspend):
3105
3106 2017-03-30  Antoine Quint  <graouts@apple.com>
3107
3108         [Modern Media Controls] Invalid placard icon is not visible for short video
3109         https://bugs.webkit.org/show_bug.cgi?id=170277
3110         <rdar://problem/31327955>
3111
3112         Reviewed by Eric Carlson.
3113
3114         Make the minimum dimension needed to display a placard icon configurable and let the
3115         invalid placard use a 50pt dimension. We also make a drive-by fix to reset "text-align"
3116         for media controls as having a "text-align: center" inherited value would mess up
3117         positioning of the placard icon and make it flush to the right of the placard.
3118
3119         Test: media/modern-media-controls/invalid-placard/invalid-placard-constrained-metrics.html
3120
3121         * Modules/modern-media-controls/controls/invalid-placard.js:
3122         (InvalidPlacard):
3123         * Modules/modern-media-controls/controls/media-controls.css:
3124         (.media-controls):
3125         * Modules/modern-media-controls/controls/placard.js:
3126         (Placard.prototype.layout):
3127
3128 2017-03-30  Zan Dobersek  <zdobersek@igalia.com>
3129
3130         [GCrypt] Register missing algorithms in CryptoAlgorithmRegistry::platformRegisterAlgoritmhs()
3131         https://bugs.webkit.org/show_bug.cgi?id=170273
3132
3133         Reviewed by Michael Catanzaro.
3134
3135         * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
3136         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
3137         Add registerAlgorithm<> calls for AES_CFB, AES_GCM, ECDH and
3138         PBKDF2 algorithms.
3139
3140 2017-03-30  Brent Fulgham  <bfulgham@apple.com>
3141
3142         Remove unused MediaControlsApple implementation
3143         https://bugs.webkit.org/show_bug.cgi?id=170258
3144         <rdar://problem/31331056>
3145
3146         Reviewed by Eric Carlson.
3147
3148         Remove dead code related to old media controls. We switched to HTML5-based media controls
3149         several years ago.
3150
3151         No new tests. Removing this dead code should have no change in behavior.
3152
3153         * WebCore.xcodeproj/project.pbxproj: Remove unused files.
3154         * dom/EventListener.h: Remove unused event type.
3155         * html/shadow/MediaControlsApple.cpp: Removed.
3156         * html/shadow/MediaControlsApple.h: Removed.
3157
3158 2017-03-30  Fujii Hironori  <Hironori.Fujii@sony.com>
3159
3160         [WinCairo] ImageCairoWin.cpp: error C2660: 'WebCore::BitmapImage::draw': function does not take 6 arguments
3161         https://bugs.webkit.org/show_bug.cgi?id=170275
3162
3163         Reviewed by Said Abou-Hallawa.
3164
3165         Apply the similar change of ImageCGWin.cpp of r214450 to ImageCairoWin.cpp.
3166
3167         * platform/graphics/win/ImageCairoWin.cpp:
3168         (WebCore::BitmapImage::getHBITMAPOfSize): Pass DecodingMode::Synchronous to Image::draw().
3169         (WebCore::BitmapImage::drawFrameMatchingSourceSize): Ditto.
3170
3171 2017-03-27  Sergio Villar Senin  <svillar@igalia.com>
3172
3173         [css-grid] Clamp the number of autorepeat tracks
3174         https://bugs.webkit.org/show_bug.cgi?id=170120
3175
3176         Reviewed by Manuel Rego Casasnovas.
3177
3178         As suggested by the specs we do clamp the maximum number of tracks per grid in order to
3179         minimize potential OOM situations. However we were not considering the case of the recently
3180         added auto repeat syntax. Abnormally huge values for the width/height on the grid container
3181         could lead to a number of auto repeat tracks higher than the maximum.
3182
3183         A new API was added to Internals in order to test limits without having to create huge
3184         grids. This new API allows clients to set an arbitrary limit to the number of tracks. The
3185         addition of this new API forced us to add GridPosition.cpp to the project to define the
3186         global variable we use for testing. We took the chance to move part of the implementation
3187         from the header file to the source file.
3188
3189         Last but not least, several new ASSERTs were added to Grid.cpp implementation to ensure that
3190         we do not surpass the grid track limits.
3191
3192         Test: fast/css-grid-layout/grid-auto-repeat-huge-grid.html
3193
3194         * CMakeLists.txt:
3195         * WebCore.xcodeproj/project.pbxproj:
3196         * css/parser/CSSPropertyParser.cpp:
3197         (WebCore::consumeGridTrackRepeatFunction):
3198         * rendering/Grid.cpp:
3199         (WebCore::Grid::ensureGridSize): Added ASSERT.
3200         (WebCore::Grid::setSmallestTracksStart): Ditto.
3201         (WebCore::Grid::setAutoRepeatTracks): Ditto.
3202         (WebCore::Grid::setAutoRepeatEmptyColumns): Ditto.
3203         (WebCore::Grid::setAutoRepeatEmptyRows): Ditto.
3204         * rendering/RenderGrid.cpp:
3205         (WebCore::RenderGrid::clampAutoRepeatTracks): New method.
3206         (WebCore::RenderGrid::placeItemsOnGrid): Clamp the number of auto repeat tracks before
3207         passing them to the Grid.
3208         * rendering/RenderGrid.h:
3209         * rendering/style/GridArea.h:
3210         (WebCore::GridSpan::GridSpan):
3211         * rendering/style/GridPosition.cpp: Added.
3212         (WebCore::GridPosition::setExplicitPosition):
3213         (WebCore::GridPosition::setAutoPosition):
3214         (WebCore::GridPosition::setSpanPosition):
3215         (WebCore::GridPosition::setNamedGridArea):
3216         (WebCore::GridPosition::integerPosition):
3217         (WebCore::GridPosition::namedGridLine):
3218         (WebCore::GridPosition::spanPosition):
3219         (WebCore::GridPosition::operator==):
3220         * rendering/style/GridPosition.h:
3221         (WebCore::GridPosition::shouldBeResolvedAgainstOppositePosition):
3222         (WebCore::GridPosition::max):
3223         (WebCore::GridPosition::min):
3224         (WebCore::GridPosition::setMaxPositionForTesting):
3225         (WebCore::GridPosition::setExplicitPosition): Deleted.
3226         (WebCore::GridPosition::setAutoPosition): Deleted.
3227         (WebCore::GridPosition::setSpanPosition): Deleted.
3228         (WebCore::GridPosition::setNamedGridArea): Deleted.
3229         (WebCore::GridPosition::integerPosition): Deleted.
3230         (WebCore::GridPosition::namedGridLine): Deleted.
3231         (WebCore::GridPosition::spanPosition): Deleted.
3232         (WebCore::GridPosition::operator==): Deleted.
3233         * rendering/style/GridPositionsResolver.cpp:
3234         (WebCore::GridPositionsResolver::explicitGridColumnCount):
3235         (WebCore::GridPositionsResolver::explicitGridRowCount):
3236         * testing/Internals.cpp:
3237         (WebCore::Internals::setGridMaxTracksLimit):
3238         * testing/Internals.h:
3239         * testing/Internals.idl:
3240
3241 2017-03-29  Ryosuke Niwa  <rniwa@webkit.org>
3242
3243         Disconnecting a HTMLObjectElement does not always unload its content document
3244         https://bugs.webkit.org/show_bug.cgi?id=169606
3245
3246         Reviewed by Andy Estes.
3247
3248         When removing a node, we first disconnect all subframes then update the focused element as we remove each child.
3249         However, when the removed element is a focused object element with a content document, removeFocusedNodeOfSubtree
3250         can update the style tree synchronously inside Document::setFocusedElement, and reload the document.
3251
3252         Avoid this by instantiating a SubframeLoadingDisabler on the parent of the focused element.
3253
3254         Test: fast/dom/removing-focused-object-element.html
3255
3256         * dom/Document.cpp:
3257         (WebCore::Document::removeFocusedNodeOfSubtree):
3258
3259 2017-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
3260
3261         Migrate to kCTFontCSSWidthAttribute
3262         https://bugs.webkit.org/show_bug.cgi?id=170265
3263
3264         Reviewed by Darin Adler.
3265
3266         Previously, we were mapping from Core Text widths to CSS widths in WebKit.
3267         However, on some OSes, Core Text can directly tell us what the CSS width
3268         value is.
3269
3270         No new tests because there is no behavior change.
3271
3272         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3273         (WebCore::getCSSAttribute):
3274         (WebCore::capabilitiesForFontDescriptor):
3275         * platform/spi/cocoa/CoreTextSPI.h:
3276
3277 2017-03-28  Simon Fraser  <simon.fraser@apple.com>
3278
3279         Make it possible to dump touch event regions for testing
3280         https://bugs.webkit.org/show_bug.cgi?id=170209
3281         <rdar://problem/31309258>
3282
3283         Reviewed by Tim Horton.
3284
3285         Expose internals.touchEventRectsForEvent() and internals.passiveTouchEventListenerRects(), which
3286         fetch data via Page.
3287
3288         Because the regions are normally updated on a timer, we have to force an eager update via Document::updateTouchEventRegions().
3289
3290         Test: fast/events/touch/ios/touch-event-regions.html
3291
3292         * page/Page.cpp:
3293         (WebCore::Page::nonFastScrollableRects):
3294         (WebCore::Page::touchEventRectsForEvent):
3295         (WebCore::Page::passiveTouchEventListenerRects):
3296         * page/Page.h:
3297         * testing/Internals.cpp:
3298         (WebCore::Internals::touchEventRectsForEvent):
3299         (WebCore::Internals::passiveTouchEventListenerRects):
3300         * testing/Internals.h:
3301         * testing/Internals.idl:
3302
3303 2017-03-29  Zalan Bujtas  <zalan@apple.com>
3304
3305         RenderBlockFlow::addFloatsToNewParent should check if float is already added to the object list.
3306         https://bugs.webkit.org/show_bug.cgi?id=170259
3307         <rdar://problem/31300584>
3308
3309         Reviewed by Simon Fraser.
3310
3311         r210145 assumed that m_floatingObjects would simply ignore the floating box if it was already in the list.  
3312
3313         Test: fast/block/float/placing-multiple-floats-crash.html
3314
3315         * rendering/RenderBlockFlow.cpp:
3316         (WebCore::RenderBlockFlow::addFloatsToNewParent):
3317
3318 2017-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
3319
3320         Try to normalize variation ranges
3321         https://bugs.webkit.org/show_bug.cgi?id=170119
3322
3323         Unreviewed.
3324
3325         Addressing post-review comment.
3326
3327         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3328         (WebCore::isGXVariableFont):
3329
3330 2017-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
3331
3332         Try to normalize variation ranges
3333         https://bugs.webkit.org/show_bug.cgi?id=170119
3334
3335         Reviewed by Simon Fraser.
3336
3337         TrueType GX-style variation fonts use one particular scale for values on their
3338         weight/width/slope axes - usually the values lie between -1 and 1 on that scale.
3339         However, OpenType 1.8-style fonts use the CSS scale for values on these axes.
3340         For the purposes of font selection, these values need to lie on the same scale.
3341         However, when font selection is completed and the variation values are actually
3342         being applied to the fonts, values which lie on the font's actual scale need to
3343         be applied. This patch adds normalize*() and denormalize*() functions to perform
3344         both of these operations. 
3345
3346         The conversion itself between the two scales isn't an exact mapping. Mapping
3347         slope is just a linear relationship with 0deg <=> 0 and 20deg <=> 1 (as per the
3348         CSS Fonts spec). Mapping widths is similar, it uses a 2-component piecewise
3349         linear relationship which includes the values given in the Microsoft OpenType
3350         spec for the OS/2 table's usWidthClass field. Weights are more difficult, so I
3351         plotted the CSS weights and the GX-style weights for every style of San
3352         Francisco, saw that the relationship appears to be linear, and ran a linear
3353         regression to compute the line equation.
3354
3355         As for the actual discrimination of determining whether a font is a GX-style
3356         font or not, we can use the presence of the 'STAT' table. This table didn't
3357         exist when GX fonts were being created, and OpenType 1.8 variable fonts are
3358         required to have this table.
3359
3360         Facebook uses the string ".SFNSText" in their @font-face blocks. This font is
3361         a variation font, but uses the GX-style values. Facebook asks us to create
3362         this font with a weight of 700, and because the values in the font are around
3363         1.0, we were erroneously thinking that the font wasn't bold, so we were then
3364         applying synthetic bold. This was causing text on facebook to look fuzzy and
3365         ugly.
3366
3367         Test: fast/text/variations/font-selection-properties-expected.html
3368
3369         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3370         (WebCore::isGXVariableFont):
3371         (WebCore::normalizeWeight):
3372         (WebCore::normalizeSlope):
3373         (WebCore::denormalizeWeight):
3374         (WebCore::denormalizeWidth):
3375         (WebCore::denormalizeSlope):
3376         (WebCore::normalizeWidth):
3377         (WebCore::preparePlatformFont): Instead of using FontSelectionValues for the
3378         intermediate values, we should use floats instead. This is because
3379         FontSelectionValues are fixed-point numbers with the denominator having 2 bits.
3380         When using this data type to represent values on the GX scale, which are usually
3381         between 0 and 1, you lose a lot of fidelity. Instead, our intermediate
3382         calculations should be done with floats, and converted to FontSelectionValues at
3383         the end when they are representative of values on the CSS scale.
3384         (WebCore::stretchFromCoreTextTraits):
3385         (WebCore::fontWeightFromCoreText):
3386         (WebCore::extractVariationBounds):
3387         (WebCore::variationCapabilitiesForFontDescriptor):
3388         (WebCore::capabilitiesForFontDescriptor):
3389
3390 2017-03-29  Saam Barati  <sbarati@apple.com>
3391
3392         LinkBuffer and ExecutableAllocator shouldn't have anything to do with VM
3393         https://bugs.webkit.org/show_bug.cgi?id=170210
3394
3395         Reviewed by Mark Lam.
3396
3397         * cssjit/SelectorCompiler.cpp:
3398         (WebCore::SelectorCompiler::compileSelector):
3399         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
3400
3401 2017-03-29  Javier Fernandez  <jfernandez@igalia.com>
3402
3403         [css-align] Adapt self-alignment properties to the new baseline syntax
3404         https://bugs.webkit.org/show_bug.cgi?id=170235
3405
3406         Reviewed by David Hyatt.
3407
3408         The baseline-position syntax has changed recently, so we need to update
3409         the CSS properties using the old syntax. This patch address only the
3410         self-alignment (align-self and justify-self) and default-alignment
3411         (align-items and justify-items).
3412
3413         The content-distribution properties (align-content and justify-content)
3414         will be updated in a follow up patch.
3415
3416         The new baseline syntax is "[first | last ]? baseline" which implies
3417         modifying the parsing and computed value logic.
3418
3419         There are several layout tests affected by this change, so I'll update
3420         them accordingly.
3421
3422         No new tests, just added/modified some cases to the tests we already have using the new baseline values.
3423
3424         * css/CSSComputedStyleDeclaration.cpp:
3425         (WebCore::valueForItemPositionWithOverflowAlignment):
3426         * css/CSSValueKeywords.in:
3427         * css/StyleBuilderConverter.h:
3428         (WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
3429         * css/parser/CSSPropertyParser.cpp:
3430         (WebCore::consumeBaselineKeyword):
3431         (WebCore::consumeSelfPositionOverflowPosition):
3432
3433 2017-03-29  Chris Dumez  <cdumez@apple.com>
3434
3435         Animated SVG images are not paused in pages loaded in the background
3436         https://bugs.webkit.org/show_bug.cgi?id=170043
3437         <rdar://problem/31234412>
3438
3439         Reviewed by Simon Fraser.
3440
3441         Animated SVG images are not paused in pages loaded in the background. We rely
3442         on FrameView::isOffscreen() to stop images animations in background tab (See
3443         logic in RenderElement's shouldRepaintForImageAnimation()). This works fine
3444         if a tab is visble and then becomes hidden (i.e. by switching to another
3445         tab). However, in the case where the tab gets loaded while in the background
3446         (e.g. opening link in new background tab, or session restore), then the
3447         animations would not be paused, due to FrameView::isOffscreen() erroneously
3448         returning false in this case.
3449
3450         Normally, the following chain of events happens:
3451         - Page is visible, we construct a main frame and its FrameView for loading
3452           the page. When a FrameView is constructed, we call FrameView::show() to
3453           make it visible. Then, if the page becomes non-visible, we call
3454           Page::setIsVisibleInternal(false) which calls FrameView::hide(). After
3455           that, FrameView::isOffscreen() correctly returns true because we properly
3456           called FrameView::hide().
3457
3458         However, when doing a load while the Page is hidden, the following was
3459         happening:
3460         - Page is not visible, we call Page::setIsVisibleInternal(false) which tries
3461           to call FrameView::hide() for the main frame but it does not have a FrameView
3462           yet (because the load has not started). We start the load and end up creating
3463           a FrameView. The FrameView constructor was calling FrameView::show()
3464           unconditionally, thus making the FrameView think is visible, even though its
3465           page isn't. At this point, FrameView::isOffscreen() was returning false
3466           and animations would keep running, even though the page is not visible.
3467
3468         To address the issue, we now call FrameView::show() in FrameView::create() only
3469         if the Page is actually visible, instead of calling it unconditionally. If the
3470         page ever becomes visible, Page::setIsVisibleInternal(true) will be called and
3471         it will take care of calling FrameView::show() then.
3472
3473         Tests: svg/animations/animations-paused-in-background-page-iframe.html
3474                svg/animations/animations-paused-in-background-page.html
3475
3476         * page/FrameView.cpp:
3477         (WebCore::FrameView::create):
3478
3479 2017-03-29  Wenson Hsieh  <wenson_hsieh@apple.com>
3480
3481         Links with empty hrefs should not be drag sources
3482         https://bugs.webkit.org/show_bug.cgi?id=170241
3483         <rdar://problem/31305505>
3484
3485         Reviewed by Tim Horton.
3486
3487         The m_dragSouceAction member of DragController represents the drag source actions that are available to the
3488         document, rather than the available actions given the dragging element. Thus, it is not correct to only check
3489         that (m_dragSourceAction & DragSourceActionAttachment) before proceeding down the attachment dragging codepath.
3490         This should be additionally guarded with a check that the element being dragged is, in fact, an attachment
3491         element.
3492
3493         New API test (see Tools/ChangeLog).
3494
3495         * page/DragController.cpp:
3496         (WebCore::DragController::startDrag):
3497
3498 2017-03-29  Jeremy Jones  <jeremyj@apple.com>
3499
3500         WebVideoFullscreenInterfaceAVKit needs a strong self ref before dispatching to the main thread.
3501         https://bugs.webkit.org/show_bug.cgi?id=170129
3502
3503         Reviewed by David Kilzer.
3504
3505         No new tests becuase no new behavior.
3506
3507         Hold a strong reference to WebVideoFullscreenInterfaceAVKit when dispatching to the main thread.
3508         Make WebVideoFullscreenInterfaceAVKit safe to retain from non-main thread.
3509
3510         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
3511         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3512         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
3513
3514 2017-03-29  Zan Dobersek  <zdobersek@igalia.com>
3515
3516         [GCrypt] Add a Handle<> class to help with GCrypt object lifetime control
3517         https://bugs.webkit.org/show_bug.cgi?id=170238
3518
3519         Reviewed by Michael Catanzaro.
3520
3521         The platform-specific CryptoAlgorithmHMAC implementation is modified
3522         to showcase the GCrypt::Handle<> use. HandleDeleter<gcry_mac_hd_t>
3523         is added accordingly.
3524
3525         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
3526         (WebCore::calculateSignature):
3527
3528 2017-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
3529
3530         Variation fonts: Make sure that feature detection and preprocessor macros are right
3531         https://bugs.webkit.org/show_bug.cgi?id=169518
3532
3533         Reviewed by Simon Fraser.
3534
3535         When I added variable fonts support, I made all OSes parse the newly accepted values,
3536         instead of just the OSes which support variable fonts.
3537
3538         Test: fast/text/font-variations-feature-detection.html
3539
3540         * css/parser/CSSPropertyParser.cpp:
3541         (WebCore::consumeFontStretch):
3542         (WebCore::consumeFontStyle):
3543         * css/parser/CSSPropertyParserHelpers.cpp:
3544         (WebCore::CSSPropertyParserHelpers::divisibleBy100):
3545         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
3546
3547 2017-03-29  Antoine Quint  <graouts@apple.com>
3548
3549         [Modern Media Controls] Controls bar may disappear while captions menu is visible (redux)
3550         https://bugs.webkit.org/show_bug.cgi?id=170239
3551         <rdar://problem/31320685>
3552
3553         Reviewed by Dean Jackson.
3554
3555         We did some work in webkit.org/b/168751 to prevent the controls bar from disappearing while the
3556         captions menu is visible. But there were two cases where the behavior was not as intended:
3557
3558             1. the controls bar would hide upon exiting the video.
3559             2. clicking on the controls bar while the caption panel is up would hide the controls bar
3560                as well as the captions panel.
3561
3562         Instead of determining that the "userInteractionEnabled" property being set to "false" is indicative
3563         of secondary UI, such as the tracks panel, being attached to the controls bar, we now have an
3564         explicit property to specify this. Now, when "hasSecondaryUIAttached" is "true", we prevent the
3565         controls bar from fading when exiting the media.
3566
3567         Additionally, when dismissing the tracks panel, we check whether a mouse event lead to this and check
3568         if the mouse was positioned over the controls bar. If that is the case, we no longer hide the controls
3569         bar and only dismiss the tracks panel.
3570
3571         Test: media/modern-media-controls/tracks-panel/tracks-panel-controls-bar-remains-visible-after-clicking-over-it.html
3572
3573         * Modules/modern-media-controls/controls/controls-bar.js:
3574         (ControlsBar.prototype.set userInteractionEnabled):
3575         (ControlsBar.prototype.handleEvent):
3576         (ControlsBar.prototype._autoHideTimerFired):
3577         * Modules/modern-media-controls/controls/macos-media-controls.js:
3578         (MacOSMediaControls.prototype.showTracksPanel):
3579         (MacOSMediaControls.prototype.hideTracksPanel):
3580
3581 2017-03-29  Antoine Quint  <graouts@apple.com>
3582
3583         [Modern Media Controls] Volume slider is initially empty
3584         https://bugs.webkit.org/show_bug.cgi?id=170237
3585         <rdar://problem/31319077>
3586
3587         Reviewed by Dean Jackson.
3588
3589         Fixing fallout from https://bugs.webkit.org/show_bug.cgi?id=167935 where we changed the behavior
3590         of layout() to happen prior to a commit. In this one instance, we were overriding layout() to run
3591         after a commit, so we now override commit(). Otherwise, the <canvas> that we draw the volume slider
3592         into would have its "width" and "height" properties set after we drew, which would clear the <canvas>.
3593
3594         * Modules/modern-media-controls/controls/slider.js:
3595         (Slider.prototype.commit):
3596         (Slider.prototype.layout): Deleted.
3597
3598 2017-03-29  Zan Dobersek  <zdobersek@igalia.com>
3599
3600         [GCrypt] Move over empty GnuTLS-based SUBTLE_CRYPTO implementation files
3601         https://bugs.webkit.org/show_bug.cgi?id=170232
3602
3603         Reviewed by Michael Catanzaro.
3604
3605         Migrate the GnuTLS SUBTLE_CRYPTO implementation files to the gcrypt/
3606         directory. The implementation files themselves are no-op, so this is
3607         a simple move-and-rename operation that will enable proceeding with
3608         the libgcrypt-based implementation of SUBTLE_CRYPTO functionality.
3609
3610         No change in behavior. The SUBTLE_CRYPTO feature should build as it
3611         did before, and the implementations are empty anyway.
3612
3613         * PlatformGTK.cmake:
3614         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp.
3615         * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_CFBGnuTLS.cpp.
3616         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_GCMGnuTLS.cpp.
3617         * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp.
3618         * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmECDHGnuTLS.cpp.
3619         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmPBKDF2GnuTLS.cpp.
3620         * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp.
3621         * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp: This one already exists.
3622         * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp.
3623         * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRegistryGnuTLS.cpp.
3624         * crypto/gcrypt/CryptoKeyECGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoKeyECGnuTLS.cpp.
3625         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoKeyRSAGnuTLS.cpp.
3626         * crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/SerializedCryptoKeyWrapGnuTLS.cpp.
3627         * crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp: Removed.
3628
3629 2017-03-29  Zan Dobersek  <zdobersek@igalia.com>
3630
3631         [GnuTLS] Remove unused CryptoDigestGnuTLS, CryptoAlgorithmHMACGnuTLS implementation files
3632         https://bugs.webkit.org/show_bug.cgi?id=170231
3633
3634         Reviewed by Michael Catanzaro.
3635
3636         * crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp: Removed. The GCrypt counterpart
3637         is already in use, and this file wasn't even being built.
3638
3639 2017-03-29  Youenn Fablet  <youenn@apple.com>
3640
3641         Move DTMF WebRTC extension behind its own compile flag
3642         https://bugs.webkit.org/show_bug.cgi?id=170226
3643
3644         Reviewed by Eric Carlson.
3645
3646         Moving RTCDTMFSender and RTCDTMFToneChangeEvent behinf a WEB_RTC_DTMF compile flag.
3647         This compile flag is not set on any supported platform yet.
3648         Disabling related test and updated test expectations.
3649
3650         * Modules/mediastream/RTCDTMFSender.cpp:
3651         * Modules/mediastream/RTCDTMFSender.h:
3652         * Modules/mediastream/RTCDTMFSender.idl:
3653         * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
3654         * Modules/mediastream/RTCDTMFToneChangeEvent.h:
3655         * Modules/mediastream/RTCDTMFToneChangeEvent.idl:
3656         * dom/EventNames.in:
3657         * dom/EventTargetFactory.in:
3658         * platform/mediastream/RTCDTMFSenderHandler.h:
3659         * platform/mediastream/RTCDTMFSenderHandlerClient.h:
3660
3661 2017-03-29  Antoine Quint  <graouts@apple.com>
3662
3663         [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
3664         https://bugs.webkit.org/show_bug.cgi?id=168409
3665         <rdar://problem/30799198>
3666
3667         Reviewed by Dean Jackson.
3668
3669         Add a new internals setting to opt into ScriptedAnimationController logging through DOM events dispatched
3670         through the document. This should allow this flaky test to get information as to why the frame isn't
3671         firing when it times out.
3672
3673         * dom/ScriptedAnimationController.cpp:
3674         (WebCore::ScriptedAnimationController::suspend):
3675         (WebCore::ScriptedAnimationController::resume):
3676         (WebCore::ScriptedAnimationController::addThrottlingReason):
3677         (WebCore::ScriptedAnimationController::removeThrottlingReason):
3678         (WebCore::ScriptedAnimationController::registerCallback):
3679         (WebCore::ScriptedAnimationController::cancelCallback):
3680         (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
3681         (WebCore::ScriptedAnimationController::scheduleAnimation):
3682         (WebCore::ScriptedAnimationController::dispatchLoggingEventIfRequired):
3683         * dom/ScriptedAnimationController.h:
3684         * page/Settings.in:
3685         * testing/InternalSettings.cpp:
3686         (WebCore::InternalSettings::resetToConsistentState):
3687         (WebCore::InternalSettings::shouldDispatchRequestAnimationFrameEvents):
3688         (WebCore::InternalSettings::setShouldDispatchRequestAnimationFrameEvents):
3689         * testing/InternalSettings.h:
3690         * testing/InternalSettings.idl:
3691
3692 2017-03-28  Youenn Fablet  <youenn@apple.com>
3693
3694         [WebRTC] After r214441 addIceCandidate no longer accepts an RTCIceCandidateInit dictionary
3695         https://bugs.webkit.org/show_bug.cgi?id=170192
3696
3697         Reviewed by Jon Lee.
3698
3699         Covered by updated tests.
3700
3701         * Modules/mediastream/RTCIceCandidate.idl: Candidate is no longer a required field in RTCIceCandidateInit.
3702         * Modules/mediastream/RTCPeerConnectionInternals.js: Reworking defaultsToNull to handle both undefined and null cases.
3703
3704 2017-03-28  Youenn Fablet  <youenn@apple.com>
3705
3706         LibWebRTCProvider should allow setting encoder and decoder factories
3707         https://bugs.webkit.org/show_bug.cgi?id=170212
3708
3709         Reviewed by Eric Carlson.
3710
3711         No change of behavior.
3712         Adding the ability to set encoder/decoder libwebrtc factory getters.
3713         Setting default cocoa factory getters.
3714
3715         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3716         (WebCore::staticFactoryAndThreads):
3717         (WebCore::initializePeerConnectionFactoryAndThreads):
3718         (WebCore::LibWebRTCProvider::setDecoderFactoryGetter):
3719         (WebCore::LibWebRTCProvider::setEncoderFactoryGetter):
3720         (WebCore::LibWebRTCProvider::setPeerConnectionFactory):
3721         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3722
3723 2017-03-27  Brent Fulgham  <bfulgham@apple.com>
3724
3725         Only attach Attributes to a given element one time
3726         https://bugs.webkit.org/show_bug.cgi?id=170125
3727         <rdar://problem/31279676>
3728
3729         Reviewed by Chris Dumez.
3730
3731         Attach the attribute node to the Element before calling 'setAttributeInternal', since that method may cause
3732         arbitrary JavaScript events to fire. 
3733
3734         Test: fast/dom/Attr/only-attach-attr-once.html
3735
3736         * dom/Element.cpp:
3737         (WebCore::Element::attachAttributeNodeIfNeeded): Added.
3738         (WebCore::Element::setAttributeNode): Use new method. Revise to attach attribute before calling 'setAttributeInternal'. 
3739         (WebCore::Element::setAttributeNodeNS): Ditto.
3740         * dom/Element.h:
3741
3742 2017-03-28  Youenn Fablet  <youenn@apple.com>
3743
3744         Stop RTCDataChannel when closing page
3745         https://bugs.webkit.org/show_bug.cgi?id=170166
3746
3747         Reviewed by Eric Carlson.
3748
3749         Test: webrtc/datachannel/datachannel-gc.html
3750
3751         Making RTCDataChannel an ActiveDOMObject.
3752         Closing the data channel backend and freeing upon close and stop.
3753
3754         * Modules/mediastream/RTCDataChannel.cpp:
3755         (WebCore::RTCDataChannel::create):
3756         (WebCore::RTCDataChannel::RTCDataChannel):
3757         (WebCore::RTCDataChannel::close):
3758         (WebCore::RTCDataChannel::stop):
3759         * Modules/mediastream/RTCDataChannel.h:
3760         * Modules/mediastream/RTCDataChannel.idl:
3761         * Modules/mediastream/RTCPeerConnection.h:
3762
3763 2017-03-28  Myles C. Maxfield  <mmaxfield@apple.com>
3764
3765         Ranges for variation font properties are not enforced
3766         https://bugs.webkit.org/show_bug.cgi?id=169979
3767
3768         Reviewed by David Hyatt.
3769
3770         The spec specifies that:
3771         - Font weights less than or equal to 0, or greater than or equal to 1000 are parse errors
3772         - Font stretch values less than or equal to 0% are parse errors
3773         - Font style values less than or equal to -90deg or greater than or equal to 90deg are parse errors
3774
3775         Test: fast/text/variations/out-of-bounds-selection-properties.html
3776
3777         * css/parser/CSSPropertyParser.cpp:
3778         (WebCore::consumeFontWeightRange):
3779         (WebCore::fontStretchIsWithinRange):
3780         (WebCore::consumeFontStretch):
3781         (WebCore::consumeFontStretchRange):
3782         (WebCore::fontStyleIsWithinRange):
3783         (WebCore::consumeFontStyle):
3784         (WebCore::consumeFontStyleRange):
3785
3786 2017-03-28  Andy Estes  <aestes@apple.com>
3787
3788         [iOS] Crash in -[WebPreviewLoader failed] when running http/tests/multipart/policy-ignore-crash.php
3789         https://bugs.webkit.org/show_bug.cgi?id=170197
3790         <rdar://problem/30314067>
3791
3792         Reviewed by Brady Eidson.
3793
3794         If QuickLook conversion fails, we call ResourceLoader::didFail() with the NSError from
3795         QuickLook, which will call back into PreviewLoader::didFail(). We only care about network
3796         failures in PreviewLoader, not conversion failures, so check if
3797         m_finishedLoadingDataIntoConverter is set before continuing (like we do in
3798         PreviewLoader::didFinishLoading()).
3799
3800         Fixes crash in http/tests/multipart/policy-ignore-crash.php.
3801
3802         * loader/ios/PreviewLoader.mm:
3803         (WebCore::PreviewLoader::didFail):
3804
3805 2017-03-28  Chris Dumez  <cdumez@apple.com>
3806
3807         Audio indicator is visible on uni-watch.com but there is no audible audio
3808         https://bugs.webkit.org/show_bug.cgi?id=170200
3809         <rdar://problem/31289132>
3810
3811         Reviewed by Eric Carlson.
3812
3813         Cherry-pick the following patch from Blink by <rtoy@chromium.org>:
3814         - https://chromium.googlesource.com/chromium/src.git/+/439de5bb2a31384666db1a0e2dadb2b97d2f3ce4
3815
3816         When the gain of a GainNode is 0 or 1, the operation of the node can
3817         be optimized.  When gain = 1, just copy the input to the output.  When
3818         gain = 0; just zero out the output.  Currently, the input is
3819         multiplied by the gain to produce the output.  This just optimizes the
3820         multiplication away for the two special cases.
3821
3822         Also, have the GainNode set the silence hint if the gain is 0.
3823
3824         And fix a bug in processIfNecessary when unsilenceOutputs was causing the
3825         silence hint to be cleared after the node's process method was finished
3826         and may have set the silence hint.  The processing should come after
3827         unsilenceOutputs to preserve any hints from processing the node.
3828
3829         * Modules/webaudio/AudioNode.cpp:
3830         (WebCore::AudioNode::processIfNecessary):
3831         * Modules/webaudio/GainNode.cpp:
3832         (WebCore::GainNode::process):
3833         * platform/audio/AudioBus.cpp:
3834         (WebCore::AudioBus::copyWithGainFrom):
3835
3836 2017-03-28  Chris Dumez  <cdumez@apple.com>
3837
3838         Animated SVG images are not paused when outside viewport
3839         https://bugs.webkit.org/show_bug.cgi?id=170155
3840         <rdar://problem/31288893>
3841
3842         Reviewed by Antti Koivisto.
3843
3844         Make sure animated SVG images get paused when outside the viewport,
3845         similarly to what was already done for animated GIF images. Also
3846         make sure they are paused when they no longer have any renderers
3847         using them.
3848
3849         Tests: svg/animations/animated-svg-image-outside-viewport-paused.html
3850                svg/animations/animated-svg-image-removed-from-document-paused.html
3851
3852         * loader/cache/CachedImage.cpp:
3853         (WebCore::CachedImage::didAddClient):
3854         Restart the animation whenever a new CachedImage client is added. This
3855         will cause us the re-evaluate if the animation should run. The animation
3856         will pause again if the new renderer is not inside the viewport.
3857
3858         (WebCore::CachedImage::animationAdvanced):
3859         Add a flag to newImageAnimationFrameAvailable() so that the renderers can
3860         let us know if we can pause the animation. Pause the animation if all no
3861         renderer requires it (i.e. they are all outside the viewport, or there
3862         are no renderers).
3863
3864         * loader/cache/CachedImageClient.h:
3865         (WebCore::CachedImageClient::newImageAnimationFrameAvailable):
3866         By default, the CachedImageClients allow pausing. Only renderer will
3867         potentially prevent pausing if they are inside the viewport.
3868
3869         * platform/graphics/BitmapImage.cpp:
3870         (WebCore::BitmapImage::isAnimating):
3871         * platform/graphics/BitmapImage.h:
3872         * platform/graphics/Image.h:
3873         (WebCore::Image::isAnimating):
3874         Add isAnimating() flag on Image for layout testing purposes.
3875
3876         * rendering/RenderElement.cpp:
3877         (WebCore::RenderElement::newImageAnimationFrameAvailable):
3878         Set canPause flag to true if the renderer is not inside the viewport.
3879
3880         (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded):
3881         Call startAnimation() if the renderer is now visible to resume SVG
3882         animations. Repainting is enough for GIF animations but not for SVG
3883         animations, we have to explicitly resume them.
3884
3885         * rendering/RenderElement.h:
3886         * rendering/RenderView.cpp:
3887         (WebCore::RenderView::addRendererWithPausedImageAnimations):
3888         (WebCore::RenderView::removeRendererWithPausedImageAnimations):
3889         (WebCore::RenderView::resumePausedImageAnimationsIfNeeded):
3890         * rendering/RenderView.h:
3891         Store CachedImages with the renderers that have paused animations.
3892         This is required for SVG where we need to explicitly resume the
3893         animation on the CachedImage when the renderer becomes visible
3894         again. Having access to the Image will also allow us to do smarter
3895         visibility checks in RenderElement's shouldRepaintForImageAnimation(),
3896         in the future.
3897
3898         * svg/SVGSVGElement.cpp:
3899         (WebCore::SVGSVGElement::hasActiveAnimation):
3900         * svg/SVGSVGElement.h:
3901         Add hasActiveAnimation() method.
3902
3903         * svg/graphics/SVGImage.cpp:
3904         (WebCore::SVGImage::startAnimation):
3905         Check that animations are paused before starting them. This avoid
3906         jumping due to unnecessary calls to rootElement->setCurrentTime(0).
3907
3908         (WebCore::SVGImage::isAnimating):
3909         Add isAnimating() method for layout tests purposes.
3910
3911         * svg/graphics/SVGImage.h:
3912         * svg/graphics/SVGImageClients.h:
3913         Call animationAdvanced() on the observer instead of the generic
3914         changedInRect() when the SVGImage is animating. This way, we go
3915         through the same code path as GIF animations and we end up calling
3916         CachedImage::animationAdvanced() which calls newImageAnimationFrameAvailable()
3917         on RenderElement, which determines if the animation should keep
3918         running or not.
3919
3920         * testing/Internals.cpp:
3921         (WebCore::Internals::isImageAnimating):
3922         * testing/Internals.h:
3923         * testing/Internals.idl:
3924         Add layout testing infrastructure.
3925
3926 2017-03-28  Antti Koivisto  <antti@apple.com>
3927
3928         Missing render tree position invalidation when tearing down renderers for display:contents subtree
3929         https://bugs.webkit.org/show_bug.cgi?id=170199
3930         <rdar://problem/31260856>
3931
3932         Reviewed by Zalan Bujtas.
3933
3934         Test: fast/shadow-dom/slot-renderer-teardown.html
3935
3936         * style/RenderTreeUpdater.cpp:
3937         (WebCore::RenderTreeUpdater::updateElementRenderer):
3938
3939             Invalidate the render tree position in case we do a teardown for an element without renderer.
3940
3941 2017-03-28  Ryan Haddad  <ryanhaddad@apple.com>
3942
3943         Unreviewed, rolling out r214485.
3944
3945         This change caused LayoutTest crashes.
3946
3947         Reverted changeset:
3948
3949         "Stop RTCDataChannel when closing page"
3950         https://bugs.webkit.org/show_bug.cgi?id=170166
3951         http://trac.webkit.org/changeset/214485
3952
3953 2017-03-28  Anders Carlsson  <andersca@apple.com>
3954
3955         ApplePayShippingContactUpdate.idl shouldn't have status field
3956         https://bugs.webkit.org/show_bug.cgi?id=170202
3957         rdar://problem/31307106
3958
3959         Reviewed by Beth Dakin.
3960
3961         * Modules/applepay/ApplePaySession.cpp:
3962         (WebCore::convertAndValidate):
3963         If status isn't set, infer it based on whether there are errors present or not.
3964
3965         * Modules/applepay/ApplePayShippingContactUpdate.h:
3966         Make status optional here; it's still used by the old code path.
3967
3968         * Modules/applepay/ApplePayShippingContactUpdate.idl:
3969         Remove status here.
3970
3971 2017-03-28  Brian Burg  <bburg@apple.com>
3972
3973         Web Inspector: Add "Disable Caches" option that only applies to the inspected page while Web Inspector is open
3974         https://bugs.webkit.org/show_bug.cgi?id=169865
3975         <rdar://problem/31250573>
3976
3977         Reviewed by Joseph Pecoraro.
3978
3979         Rewrite the network agent's command for disabling resource caching to use Page::setResourceCachingEnabled.
3980         The old implementation was doing weird stuff like setting no-cache headers and evicting the
3981         contents of the memory cache, neither of which is correct. The new approach has no side effects
3982         on the network, disk, or memory cache so it can be turned on temporarily without causing problems.
3983
3984         New tests:
3985         - http/tests/inspector/network/set-resource-caching-disabled-disk-cache.html
3986         - http/tests/inspector/network/set-resource-caching-disabled-memory-cache.html
3987
3988         * inspector/InspectorNetworkAgent.h:
3989         * inspector/InspectorNetworkAgent.cpp:
3990         (WebCore::InspectorNetworkAgent::setCacheDisabled): Deleted.
3991         (WebCore::InspectorNetworkAgent::setResourceCachingDisabled): Added.
3992         Implement new command.
3993
3994         (WebCore::InspectorNetworkAgent::willSendRequest):
3995         (WebCore::InspectorNetworkAgent::mainFrameNavigated):
3996         Remove crufty attempts to break caches. I believe these are intended to defeat caching
3997         proxies and similar middlemen, but this is just as likely to cause unusual loading behavior.
3998
3999         * page/Page.h:
4000         (WebCore::Page::isResourceCachingDisabled):
4001         (WebCore::Page::setResourceCachingDisabledOverride):
4002         Add an override setting so that Web Inspector's override does not mess up the value
4003         of isResourceCachingDisabled that may have been set by a WebKit API client.
4004
4005 2017-03-28  Youenn Fablet  <youenn@apple.com>
4006
4007         Fix addIceCandidate after r214441
4008         https://bugs.webkit.org/show_bug.cgi?id=170146
4009
4010         Reviewed by Chris Dumez.
4011
4012         Covered by rebased test.
4013
4014         * Modules/mediastream/RTCPeerConnection.js:
4015         (addIceCandidate): Setting function length to 1 and throwing if no parameter is passed.
4016
4017 2017-03-28  Youenn Fablet  <youenn@apple.com>
4018
4019         Stop RTCDataChannel when closing page
4020         https://bugs.webkit.org/show_bug.cgi?id=170166
4021
4022         Reviewed by Eric Carlson.
4023
4024         Test: webrtc/datachannel/datachannel-gc.html
4025
4026         Making RTCDataChannel an ActiveDOMObject.
4027         Closing the data channel backend and freeing upon close and stop.
4028
4029         * Modules/mediastream/RTCDataChannel.cpp:
4030         (WebCore::RTCDataChannel::create):
4031         (WebCore::RTCDataChannel::RTCDataChannel):
4032         (WebCore::RTCDataChannel::close):
4033         (WebCore::RTCDataChannel::stop):
4034         * Modules/mediastream/RTCDataChannel.h:
4035         * Modules/mediastream/RTCDataChannel.idl:
4036         * Modules/mediastream/RTCPeerConnection.h:
4037
4038 2017-03-27  Simon Fraser  <simon.fraser@apple.com>