Set lastHandledUserGestureTimestamp on all ancestor documents, not just the top document
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-04-05  Simon Fraser  <simon.fraser@apple.com>
2
3         Set lastHandledUserGestureTimestamp on all ancestor documents, not just the top document
4         https://bugs.webkit.org/show_bug.cgi?id=170479
5
6         Reviewed by Sam Weinig.
7
8         When interacting with a subframe document, set lastHandledUserGestureTimestamp on all ancestor
9         documents up to the root.
10
11         This will be used in future for requestAnimationFrame throttling.
12
13         Test: fast/frames/user-gesture-timestamp-propagation.html
14
15         * dom/Document.cpp:
16         (WebCore::Document::updateLastHandledUserGestureTimestamp):
17         * dom/Document.h:
18         * dom/UserGestureIndicator.cpp:
19         (WebCore::UserGestureIndicator::UserGestureIndicator):
20         * testing/Internals.cpp:
21         (WebCore::Internals::lastHandledUserGestureTimestamp):
22         * testing/Internals.h:
23         * testing/Internals.idl:
24
25 2017-04-05  Eric Carlson  <eric.carlson@apple.com>
26
27         [MediaStream] Host application should be able to mute and unmute media streams
28         https://bugs.webkit.org/show_bug.cgi?id=170519
29         <rdar://problem/31174326>
30
31         Unreviewed, address review comments missed in the initial checkin.
32
33         * Modules/mediastream/MediaStream.cpp:
34         (WebCore::MediaStream::MediaStream): Mute the private stream if the page doesn't allow
35         capture.
36         (WebCore::MediaStream::pageMutedStateDidChange): setMuted -> setCaptureTracksMuted.
37
38         * platform/mediastream/MediaStreamPrivate.cpp:
39         (WebCore::MediaStreamPrivate::addTrack): Don't track muted state, the capture source already does.
40         (WebCore::MediaStreamPrivate::startProducingData):  Ditto.
41         (WebCore::MediaStreamPrivate::setCaptureTracksMuted): Renamed from setMuted.
42         (WebCore::MediaStreamPrivate::setMuted): Deleted.
43         * platform/mediastream/MediaStreamPrivate.h:
44
45 2017-04-05  Eric Carlson  <eric.carlson@apple.com>
46
47         [MediaStream] Host application should be able to mute and unmute media streams
48         https://bugs.webkit.org/show_bug.cgi?id=170519
49         <rdar://problem/31174326>
50
51         Reviewed by Youenn Fablet.
52
53         No new tests, fast/mediastream/MediaStream-page-muted.html was updated.
54
55         * Modules/mediastream/MediaStream.cpp:
56         (WebCore::MediaStream::~MediaStream): Fix a typo.
57         (WebCore::MediaStream::pageMutedStateDidChange): Don't store muted state, let the private
58         stream store it.
59         (WebCore::MediaStream::mediaState): Deal with new muted state flags.
60         * Modules/mediastream/MediaStream.h:
61
62         * dom/Document.cpp:
63         (WebCore::Document::prepareForDestruction): Clear media state before the frame is cleared.
64
65         * page/MediaProducer.h: Add muted flags.
66
67         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
68         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack): The display layer
69         should not be visible when the video track is muted.
70
71         * platform/mediastream/MediaStreamPrivate.cpp:
72         (WebCore::MediaStreamPrivate::addTrack): Mute the new track if necessary.
73         (WebCore::MediaStreamPrivate::startProducingData): Do nothing when muted.
74         (WebCore::MediaStreamPrivate::setExternallyMuted): New, mute/unmute tracks.
75         * platform/mediastream/MediaStreamPrivate.h:
76
77         * platform/mediastream/RealtimeMediaSource.cpp:
78         (WebCore::RealtimeMediaSource::setMuted): Start/stop producing data.
79
80         * testing/Internals.cpp:
81         (WebCore::Internals::pageMediaState): Support new media stream muted flags.
82
83 2017-04-05  Andreas Kling  <akling@apple.com>
84
85         Make inactive web processes behave as though under memory pressure.
86         https://bugs.webkit.org/show_bug.cgi?id=170042
87         <rdar://problem/31038445>
88
89         Reviewed by Antti Koivisto.
90
91         Prevent PerformanceMonitor from marking the process as inactive at startup.
92         This fixes the API test failure that caused this patch to get rolled out.
93
94         * page/PerformanceMonitor.h:
95
96 2017-04-05  Youenn Fablet  <youenn@apple.com>
97
98         Switch to kCVPixelFormatType_420YpCbCr8BiPlanarFullRange for Mac video capture format
99         https://bugs.webkit.org/show_bug.cgi?id=170509
100
101         Reviewed by Eric Carlson.
102
103         Covered by existing tests.
104
105         * platform/mediastream/mac/AVVideoCaptureSource.mm:
106
107 2017-04-05  Javier Fernandez  <jfernandez@igalia.com>
108
109         [css-align] Implement the place-items shorthand
110         https://bugs.webkit.org/show_bug.cgi?id=168847
111
112         Reviewed by David Hyatt.
113
114         The CSS Box Alignment specification defines a new shorthand to set the
115         Content Alignment properties (align-items and justify-items) at the
116         same time.
117
118         This patch provides the implementation of the CSS parsing logic and the
119         required regression tests. For the time being, as it happens with the
120         rest of the new alignment properties, the new parsing logic is
121         implemented behind the CSS Grid Layout runtime flag.
122
123         Test: css3/parse-place-items.html
124
125         * css/CSSComputedStyleDeclaration.cpp:
126         (WebCore::ComputedStyleExtractor::propertyValue):
127         * css/CSSProperties.json:
128         * css/StyleProperties.cpp:
129         (WebCore::StyleProperties::getPropertyValue):
130         (WebCore::StyleProperties::getAlignmentShorthandValue):
131         * css/StyleProperties.h:
132         * css/parser/CSSPropertyParser.cpp:
133         (WebCore::isAutoOrNormalOrStretch):
134         (WebCore::consumeSelfPositionOverflowPosition):
135         (WebCore::consumeSimplifiedItemPosition):
136         (WebCore::CSSPropertyParser::consumePlaceItemsShorthand):
137         * css/parser/CSSPropertyParser.h:
138
139 2017-04-05  Ryan Haddad  <ryanhaddad@apple.com>
140
141         Unreviewed, rolling out r214932.
142
143         This change broke an internal build.
144
145         Reverted changeset:
146
147         "[ios-simulator] API test WebKit2.DataDetectionReferenceDate
148         timing out"
149         https://bugs.webkit.org/show_bug.cgi?id=161967
150         http://trac.webkit.org/changeset/214932
151
152 2017-04-05  Ryan Haddad  <ryanhaddad@apple.com>
153
154         Unreviewed, rolling out r214962.
155
156         Roll r214937 back in because it wasn't at fault for the build
157         breakage.
158
159         Reverted changeset:
160
161         "Unreviewed, rolling out r214937."
162         https://bugs.webkit.org/show_bug.cgi?id=170365
163         http://trac.webkit.org/changeset/214962
164
165 2017-04-05  Ryan Haddad  <ryanhaddad@apple.com>
166
167         Unreviewed, rolling out r214937.
168
169         This change broke an internal build.
170
171         Reverted changeset:
172
173         "REGRESSION (r202472): Data Detection overwrites existing
174         links in detected ranges"
175         https://bugs.webkit.org/show_bug.cgi?id=170365
176         http://trac.webkit.org/changeset/214937
177
178 2017-04-05  Carlos Alberto Lopez Perez  <clopez@igalia.com>
179
180         [WebRTC][OpenWebRTC] Add support for SDP BUNDLE ("a:group:BUNDLE" and "a=bundle-only" lines)
181         https://bugs.webkit.org/show_bug.cgi?id=170157
182
183         Reviewed by Alejandro G. Castro.
184
185         This implements support on the SDPProcessor for generating an "a=group:BUNDLE"
186         attribute with the MID identifiers specified in the bundle group in the most
187         recent answer.
188         It also implements support for generating "a=bundle-only" attributes on the
189         "m=" sections of the SDP according to the bundlePolicy defined.
190
191         Test: fast/mediastream/RTCPeerConnection-inspect-offer-bundlePolicy-bundle-only.html
192
193         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
194         (WebCore::MediaEndpointPeerConnection::createOfferTask):
195         (WebCore::MediaEndpointPeerConnection::createAnswerTask):
196         * Modules/mediastream/SDPProcessor.cpp:
197         (WebCore::getBundlePolicyName):
198         (WebCore::configurationToJSON):
199         * Modules/mediastream/sdp.js:
200         (SDP.generate):
201         * platform/mediastream/MediaEndpointSessionConfiguration.h:
202         (WebCore::MediaEndpointSessionConfiguration::bundlePolicy):
203         (WebCore::MediaEndpointSessionConfiguration::setBundlePolicy):
204         (WebCore::MediaEndpointSessionConfiguration::clone):
205
206 2017-04-05  Jer Noble  <jer.noble@apple.com>
207
208         [MSE] Seeks to currentTime=0 will fail if currentTime is already 0.
209         https://bugs.webkit.org/show_bug.cgi?id=170510
210         <rdar://problem/30988403>
211
212         Reviewed by Eric Carlson.
213
214         Test: media/media-source/media-source-unnecessary-seek-seeked.html
215
216         The AVSampleBufferRenderSynchronizer won't fire a time jumped notification if no seek is actully
217         necessary. So short circuit the seek logic if the seek time is identical to the current synchronizer
218         time.
219
220         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
221         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
222
223 2017-04-05  Chris Dumez  <cdumez@apple.com>
224
225         <input type="range"> changing to disabled while active breaks all pointer events
226         https://bugs.webkit.org/show_bug.cgi?id=170447
227         <rdar://problem/31442875>
228
229         Reviewed by Geoffrey Garen.
230
231         When a range's slider is being moved, we set SliderThumbElement's m_inDragMode flag
232         to true and mark the range elements as the CapturingMouseEventsElement. When we get
233         the mouseUp event, we are supposed to exit drag mode. However, when the range element
234         gets disabled while dragging, we do not get the mouseUp event and we need to make
235         sure we exit dragging mode anyway. r112547 tried to fix this by calling stopDragging()
236         in SliderThumbElement::defaultEventHandler() when the input element is disabled.
237         While this often works, this is fragile and we sometimes fail to exit dragging mode
238         when we should.
239
240         This patch addressed the issue by calling stopDragging() in
241         SliderThumbElement::disabledAttributeChanged() instead. This is much safer as we
242         guarantee will exit dragging mode whenever the range element gets disabled, even
243         if SliderThumbElement::defaultEventHandler() does not get called after that.
244
245         Test: fast/forms/range/disabled-while-dragging.html
246
247         * html/RangeInputType.cpp:
248         (WebCore::RangeInputType::disabledAttributeChanged):
249         * html/RangeInputType.h:
250         * html/shadow/SliderThumbElement.cpp:
251         (WebCore::SliderThumbElement::defaultEventHandler):
252         (WebCore::SliderThumbElement::disabledAttributeChanged):
253         * html/shadow/SliderThumbElement.h:
254
255 2017-04-05  Eric Carlson  <eric.carlson@apple.com>
256
257         [MediaStream] Video doesn't render in fullscreen on iOS
258         https://bugs.webkit.org/show_bug.cgi?id=170404
259
260         Reviewed by Youenn Fablet.
261         
262         No new tests, filed https://bugs.webkit.org/show_bug.cgi?id=170512.
263
264         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
265         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
266         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Include
267         video fullscreen manager on iOS too.
268         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix): Add paramater
269         to force transform recalculation.
270         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): Restructure code since
271         the display layer resize happens elsewhere.
272         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): Include video fullscreen
273         manager on iOS too.
274         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers): Ditto.
275         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Ditto.
276         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer): Ditto.
277         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::backgroundLayerBoundsChanged): Change the
278         display layer size and position immediately instead of waiting for the next sample buffer
279         so the display is correct when fullscreen mode changes when paused.
280
281 2017-04-05  Youenn Fablet  <youenn@apple.com>
282
283         Deprecate and remove URL.createObjectURL(mediastream)
284         https://bugs.webkit.org/show_bug.cgi?id=167518
285         <rdar://problem/31149607>
286
287         Reviewed by Eric Carlson.
288
289         Covered by updated tests.
290
291         * CMakeLists.txt:
292         * DerivedSources.cpp:
293         * DerivedSources.make:
294         * Modules/mediastream/DOMURLMediaStream.cpp: Removed.
295         * Modules/mediastream/DOMURLMediaStream.h: Removed.
296         * Modules/mediastream/DOMURLMediaStream.idl: Removed.
297         * WebCore.xcodeproj/project.pbxproj:
298         * html/DOMURL.idl:
299
300 2017-04-05  Alejandro G. Castro  <alex@igalia.com>
301
302         [Webrtc] Mock realtime sources factories should be static after r213941
303         https://bugs.webkit.org/show_bug.cgi?id=170282
304
305         Reviewed by Alex Christensen.
306
307         If we don't make the variables static we would be returning a
308         local variable.
309
310         * platform/mock/MockRealtimeAudioSource.cpp:
311         (WebCore::MockRealtimeAudioSource::factory):
312         * platform/mock/MockRealtimeVideoSource.cpp:
313         (WebCore::MockRealtimeVideoSource::factory):
314
315 2017-04-05  Alex Christensen  <achristensen@webkit.org>
316
317         Fix CMake build.
318
319         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
320         Some JavaScript inline functions were not being accessed from this file with different enable flags.
321         * platform/spi/cf/CFNetworkSPI.h:
322         * platform/spi/cocoa/NSURLConnectionSPI.h:
323         Moved NSURLSession-specific SPI from NSURLConnectionSPI.h to CFNetworkSPI.h.
324
325 2017-04-05  Chris Dumez  <cdumez@apple.com>
326
327         _blank / _self / _parent / _top browsing context names should be case-insensitive
328         https://bugs.webkit.org/show_bug.cgi?id=169747
329
330         Reviewed by Alex Christensen.
331
332         _blank / _self / _parent / _top browsing context names should be case-insensitive
333         as per the HTML specification:
334         - https://html.spec.whatwg.org/#browsing-context-names
335
336         This aligns our behavior with Firefox as well. See discussion at:
337         - https://github.com/whatwg/html/issues/2443
338
339         Tests: imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank.html
340                imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001.html
341                imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002.html
342                imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html
343                imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html
344
345         * loader/FrameLoader.cpp:
346         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
347         (WebCore::createWindow):
348         * page/DOMWindow.cpp:
349         (WebCore::DOMWindow::open):
350         * page/FrameTree.cpp:
351         (WebCore::FrameTree::uniqueChildName):
352         (WebCore::FrameTree::find):
353
354 2017-04-05  Miguel Gomez  <magomez@igalia.com>
355
356         [GTK+] PNG animations that should run once are not played at all
357         https://bugs.webkit.org/show_bug.cgi?id=170499
358
359         Reviewed by Carlos Garcia Campos.
360
361         The repetition count reported bu the PNGImageDecoder is wrong. It's returning m_playCount - 1, which
362         means 0 for the animations that need to be played once. Change it to return an appropriate value.
363
364         Covered by existent tests.
365
366         * platform/image-decoders/png/PNGImageDecoder.cpp:
367         (WebCore::PNGImageDecoder::repetitionCount):
368         * platform/image-decoders/png/PNGImageDecoder.h:
369
370 2017-04-05  Andy Estes  <aestes@apple.com>
371
372         REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
373         https://bugs.webkit.org/show_bug.cgi?id=170365
374         <rdar://problem/29205721>
375
376         Reviewed by Tim Horton.
377
378         r202472 changed the node traversal in searchForLinkRemovingExistingDDLinks() to only
379         consider nodes that are descendants of startNode, but we need to traverse all nodes between
380         startNode and endNode to find existing non-DD links.
381
382         As a result, we'd add a Data Detector link to the following snippet and make the original
383         links un-clickable:
384
385             <a href='#'>tomorrow</a> <a href='#'>night</a>
386
387         Fix this by not specifying a stayWithin node when calling NodeTraversal::next(). The loop
388         will terminate when we reach endNode.
389
390         Updated WebKit2.DataDetectionReferenceDate API test.
391
392         * editing/cocoa/DataDetection.mm:
393         (WebCore::searchForLinkRemovingExistingDDLinks):
394
395 2017-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>
396
397         Move WebErrors from WebProcess to Shared and get rid of ErrorsGtk in WebCore
398         https://bugs.webkit.org/show_bug.cgi?id=156974
399
400         Reviewed by Sam Weinig.
401
402         Remove ErrorsGtk.
403
404         * PlatformGTK.cmake:
405         * platform/gtk/ErrorsGtk.cpp: Removed.
406         * platform/gtk/ErrorsGtk.h: Removed.
407
408 2017-04-05  Andy Estes  <aestes@apple.com>
409
410         [ios-simulator] API test WebKit2.DataDetectionReferenceDate timing out
411         https://bugs.webkit.org/show_bug.cgi?id=161967
412
413         Reviewed by Alexey Proskuryakov.
414
415         DataDetectorsCoreSPI.h defined DDQueryOffset as a struct of two CFIndexes, which is 16 bytes
416         on LP64, but the struct is actually defined as two CFIndex-typed 32-bit bitfields, which is
417         8 bytes on LP64. This breaks the ABI on Public SDK builds when calling functions that take
418         or return DDQueryOffsets.
419
420         * platform/spi/cocoa/DataDetectorsCoreSPI.h: Updated the DDQueryOffset definition for
421         Public SDK builds, and added a static_assert to detect future size changes at compile time.
422
423 2017-04-04  Jer Noble  <jer.noble@apple.com>
424
425         Move AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h
426         https://bugs.webkit.org/show_bug.cgi?id=170471
427
428         Reviewed by Eric Carlson.
429
430         Move the declaration of AVSampleBufferDisplayLayer (and related classes) into AVFoundationSPI.
431
432         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
433         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
434         * platform/spi/mac/AVFoundationSPI.h:
435
436 2017-04-04  Youenn Fablet  <youenn@apple.com>
437
438         Canvas is tainted when painting a video with MediaStreamTrack
439         https://bugs.webkit.org/show_bug.cgi?id=170486
440
441         Reviewed by Eric Carlson.
442
443         Test: http/tests/media/media-stream/getusermedia-with-canvas.html
444
445         Adding the notion of isolated source so that we can later on implement WebRTC isolated tracks.
446         For now, canvas will not be tainted if painted from a MediaStreamTrack.
447
448         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
449         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
450         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didPassCORSAccessCheck):
451         * platform/mediastream/MediaStreamTrackPrivate.h:
452         (WebCore::MediaStreamTrackPrivate::isIsolated):
453         * platform/mediastream/RealtimeMediaSource.h:
454
455 2017-04-04  Commit Queue  <commit-queue@webkit.org>
456
457         Unreviewed, rolling out r214894, r214895, r214907, r214912,
458         and r214918.
459         https://bugs.webkit.org/show_bug.cgi?id=170491
460
461         Caused build failures on Mac (Requested by rniwa on #webkit).
462
463         Reverted changesets:
464
465         "Build fix."
466         http://trac.webkit.org/changeset/214894
467
468         "Rolling back the build fix, as it broke other builds."
469         http://trac.webkit.org/changeset/214895
470
471         "Move AVSampleBufferDisplayLayer declarations into
472         AVFoundationSPI.h"
473         https://bugs.webkit.org/show_bug.cgi?id=170471
474         http://trac.webkit.org/changeset/214907
475
476         "Unreviewed build fix: fix compilation error on Sierra."
477         http://trac.webkit.org/changeset/214912
478
479         "More build fixing."
480         http://trac.webkit.org/changeset/214918
481
482 2017-04-04  Youenn Fablet  <youenn@apple.com>
483
484         [Mac] Add back web audio support for getUserMedia MediaStreamTrack
485         https://bugs.webkit.org/show_bug.cgi?id=170482
486
487         Reviewed by Eric Carlson.
488
489         ´Covered by reenabled test.
490
491         Exporting method and class used in WebKit2.
492
493         * WebCore.xcodeproj/project.pbxproj:
494         * platform/audio/mac/CAAudioStreamDescription.h:
495         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
496
497 2017-04-04  Alexey Proskuryakov  <ap@apple.com>
498
499         More build fixing.
500
501         * platform/spi/mac/AVFoundationSPI.h:
502
503 2017-04-04  Simon Fraser  <simon.fraser@apple.com>
504
505         Do some minor FEColorMatrix code cleanup and optimization
506         https://bugs.webkit.org/show_bug.cgi?id=170474
507
508         Reviewed by Dean Jackson.
509
510         Don't switch inside of a pixel processing loop; repeat the loop inside switch (filterType).
511         
512         Change matrix() and saturateAndHueRotate() to dereference the source pixels once, instead
513         of multiple times, which is faster.
514         
515         This kind of code benefits from aligning things with spaces for readability, so do so,
516         violating webkit style.
517         
518         Add some off-by-default performance logging code.
519
520         Increases pixel processing performance from about 86ms per megapixel to 65ms per megapixel.
521
522         * platform/graphics/filters/FEColorMatrix.cpp:
523         (WebCore::matrix):
524         (WebCore::saturateAndHueRotate):
525         (WebCore::effectType):
526         (WebCore::FEColorMatrix::platformApplySoftware):
527
528 2017-04-04  Brent Fulgham  <bfulgham@apple.com>
529
530         Do not assert when CharacterData representing an Attr fires events
531         https://bugs.webkit.org/show_bug.cgi?id=170454
532         <rdar://problem/30979320>
533
534         Reviewed by Ryosuke Niwa.
535
536         Make the NoEventDispatchAssertion in CharacterData::notifyParentAfterChange conditional
537         since Attr elements should be allowed to fire events.
538
539         Tests: fast/dom/no-assert-for-malformed-js-url-attribute.html
540
541         * dom/CharacterData.cpp:
542         (WebCore::CharacterData::notifyParentAfterChange):
543
544 2017-04-04  Youenn Fablet  <youenn@apple.com>
545
546         LayoutTest webrtc/libwebrtc/descriptionGetters.html is a flaky failure
547         https://bugs.webkit.org/show_bug.cgi?id=169481
548
549         Reviewed by Eric Carlson.
550
551         No need to enumerate all network interfaces in most layout tests.
552         Adding an Internals API for that in case we want to use TCP localhost candidates.
553
554         * testing/Internals.cpp:
555         (WebCore::Internals::Internals):
556         (WebCore::Internals::setEnumeratingAllNetworkInterfacesEnabled):
557         * testing/Internals.h:
558         * testing/Internals.idl:
559
560
561 2017-04-04  Jer Noble  <jer.noble@apple.com>
562
563         Unreviewed build fix: fix compilation error on Sierra.
564
565         * platform/spi/mac/AVFoundationSPI.h:
566
567 2017-04-04  Jer Noble  <jer.noble@apple.com>
568
569         Move AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h
570         https://bugs.webkit.org/show_bug.cgi?id=170471
571
572         Reviewed by Eric Carlson.
573
574         Move the declaration of AVSampleBufferDisplayLayer (and related classes) into AVFoundationSPI.
575
576         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
577         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer): Deleted.
578         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeDisplayLayer): Deleted.
579         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
580         * platform/spi/mac/AVFoundationSPI.h:
581
582 2017-04-04  Saam Barati  <sbarati@apple.com>
583
584         WebAssembly: JSWebAssemblyCallee should not be a JSCell
585         https://bugs.webkit.org/show_bug.cgi?id=170135
586
587         Reviewed by Michael Saboff.
588
589         * bindings/js/JSDOMWindowBase.cpp:
590         (WebCore::callerDOMWindow):
591
592 2017-04-04  Simon Fraser  <simon.fraser@apple.com>
593
594         Change Document's lastHandledUserGestureTimestamp to be a MonotonicTime
595         https://bugs.webkit.org/show_bug.cgi?id=170468
596
597         Reviewed by Zalan Bujtas.
598         
599         Change the double to MonotonicTime. No behavior change.
600
601         * dom/Document.cpp:
602         (WebCore::Document::updateLastHandledUserGestureTimestamp):
603         * dom/Document.h:
604         (WebCore::Document::lastHandledUserGestureTimestamp):
605         * html/HTMLPlugInImageElement.cpp:
606         (WebCore::documentHadRecentUserGesture):
607         * loader/FrameLoader.cpp:
608         (WebCore::shouldAskForNavigationConfirmation):
609
610 2017-04-04  Youenn Fablet  <youenn@apple.com>
611
612         [Debug] ASSERT(!throwScope.exception()) on imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html
613         https://bugs.webkit.org/show_bug.cgi?id=170395
614         <rdar://problem/31394017>
615
616         Reviewed by Mark Lam.
617
618         No change of behavior.
619
620         * bindings/js/JSDOMPromise.cpp:
621         (WebCore::DeferredPromise::reject): Adding early ASSERT that creating an exception is happening correctly.
622
623 2017-04-04  Alexey Proskuryakov  <ap@apple.com>
624
625         Rolling back the build fix, as it broke other builds.
626
627         * platform/spi/mac/AVFoundationSPI.h:
628
629 2017-04-04  Alexey Proskuryakov  <ap@apple.com>
630
631         Build fix.
632
633         Rubber-stamped by Jer Noble.
634
635         * platform/spi/mac/AVFoundationSPI.h:
636
637 2017-04-04  Tim Horton  <timothy_horton@apple.com>
638
639         [Mac] -[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:] invokes the resultCollector with didWrap = NO even when it wraps
640         https://bugs.webkit.org/show_bug.cgi?id=165801
641         <rdar://problem/29649535>
642
643         Reviewed by Wenson Hsieh.
644
645         New API tests: WebKit2.FindInPageWrapping*
646
647         * page/FrameTree.cpp:
648         (WebCore::FrameTree::traverseNextWithWrap):
649         (WebCore::FrameTree::traversePreviousWithWrap):
650         (WebCore::FrameTree::traverseNextInPostOrderWithWrap):
651         * page/FrameTree.h:
652         Add CanWrap and DidWrap boolean enums, and add an optional out argument
653         to traverse*WithWrap indicating whether a wrap actually occurred.
654
655         * history/CachedPage.cpp:
656         (WebCore::firePageShowAndPopStateEvents):
657         * history/PageCache.cpp:
658         (WebCore::destroyRenderTree):
659         Adjust to the new CanWrap enum.
660         
661         * page/Page.cpp:
662         (WebCore::incrementFrame):
663         (WebCore::Page::findString):
664         (WebCore::Page::findStringMatchingRanges):
665         (WebCore::Page::rangeOfString):
666         (WebCore::Page::findMatchesForText):
667         (WebCore::Page::unmarkAllTextMatches):
668         * page/Page.h:
669         Adjust to the new CanWrap enum, and optionally plumb DidWrap through
670         to callers of findString().
671
672 2017-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>
673
674         [GTK] PLATFORM(GTK) && !USE(COORDINATED_GRAPHICS_THREADED) is no longer possible
675         https://bugs.webkit.org/show_bug.cgi?id=170458
676
677         Reviewed by Carlos Alberto Lopez Perez.
678
679         That is not supported anymore, so we can remove dead code from VideoSinkGStreamer.cpp
680
681         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
682         (VideoRenderRequestScheduler::VideoRenderRequestScheduler):
683
684 2017-04-04  Per Arne Vollan  <pvollan@apple.com>
685
686         Unreviewed Windows build fix.
687
688         * bindings/js/JSDOMGuardedObject.h:
689
690 2017-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
691
692         Data interaction should register type identifiers in order of priority
693         https://bugs.webkit.org/show_bug.cgi?id=170428
694         <rdar://problem/30633296>
695
696         Reviewed by Tim Horton.
697
698         Currently, due to the shared logic for writing to a UIPasteboard (in the case of copy/paste) and the shared
699         UIItemProvider-based pasteboard wrapper (in the case of data interaction), we don't enforce any particular
700         ordering in which type identifiers are registered in the generated item provider. This is because
701         -[UIPasteboard setItems:] only takes an unordered mapping of type identifiers to objects.
702
703         To fix this, we introduce a separate way to set pasteboard data that first writes a list of object
704         representations in order of priority (which is dependent on the content being interacted with) and then register
705         individual type-data mappings at the end.
706
707         Augmented existing API tests in DataInteractionTests to check for the existence and priority of type identifiers
708         in the UIItemProviders created upon starting data interaction. Also adds a new unit test:
709         DataInteractionTests.TextAreaToInput.
710
711         * WebCore.xcodeproj/project.pbxproj:
712         * editing/cocoa/EditorCocoa.mm:
713         (WebCore::archivedDataForAttributedString):
714         (WebCore::Editor::writeSelectionToPasteboard):
715         (WebCore::Editor::writeSelection):
716         * platform/Pasteboard.h:
717         * platform/PasteboardWriterData.h:
718         * platform/PlatformPasteboard.h:
719         * platform/ios/AbstractPasteboard.h:
720         * platform/ios/AbstractPasteboard.mm: Copied from Source/WebCore/platform/ios/AbstractPasteboard.h.
721
722         Introduce WebPasteboardItemData, a wrapper around a list of objects representating the pasteboard data in order
723         of priority, and a dictionary containing additional NSData blobs that contain data useful for private clients.
724
725         (+[WebPasteboardItemData itemWithRepresentingObjects:additionalData:]):
726         (-[WebPasteboardItemData initWithRepresentingObjects:additionalData:]):
727         (-[WebPasteboardItemData representingObjects]):
728         (-[WebPasteboardItemData additionalData]):
729         * platform/ios/PlatformPasteboardIOS.mm:
730         (WebCore::richTextRepresentationsForPasteboardWebContent):
731         (WebCore::PlatformPasteboard::writeObjectRepresentations):
732         (WebCore::PlatformPasteboard::write):
733
734         Tweaked to check whether the pasteboard responds to -setItemsFromObjectRepresentations:. If so, uses the
735         PlatformPasteboard::writeObjectRepresentations codepath to write data to the pasteboard, respecting type
736         priority.
737
738         * platform/ios/WebItemProviderPasteboard.mm:
739         (-[WebItemProviderPasteboard pasteboardTypes]):
740         (-[WebItemProviderPasteboard setItemProviders:]):
741         (-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]):
742
743         Replaces -setItems: with -setItemsFromObjectRepresentations:, which respects the priority of each object
744         representation of the data in the pasteboard.
745
746         (-[WebItemProviderPasteboard setItems:]): Deleted.
747
748 2017-04-03  Javier Fernandez  <jfernandez@igalia.com>
749
750         [css-align] Adapt place-content alignment shorthand to the new baseline syntax
751         https://bugs.webkit.org/show_bug.cgi?id=170340
752
753         Reviewed by David Hyatt.
754
755         Now that the align-content and justify-content CSS properties are
756         adapted to the new baseline-position CSS values syntax we can adapt the
757         shorthand that controls such properties to the new syntax as well.
758
759         No new tests, just adding some additional cases to the tests we already have.
760
761         * css/StyleProperties.cpp:
762         (WebCore::StyleProperties::getPropertyValue):
763         (WebCore::StyleProperties::placeContentPropertyValue):
764         * css/StyleProperties.h:
765         * css/parser/CSSPropertyParser.cpp:
766         (WebCore::isContentDistributionKeyword):
767         (WebCore::isContentPositionKeyword):
768         (WebCore::isOverflowKeyword):
769         (WebCore::getBaselineKeyword):
770         (WebCore::consumeContentDistributionOverflowPosition):
771         (WebCore::consumeSimplifiedContentPosition):
772
773 2017-04-03  Nan Wang  <n_wang@apple.com>
774
775         AX: Expose link children when doing search predication on iOS
776         https://bugs.webkit.org/show_bug.cgi?id=170424
777         <rdar://problem/31413335>
778
779         The children of links are accessible elements on iOS instead of the link itself, 
780         so we should expose the children when doing predicated searches as well.
781
782         Reviewed by Chris Fleizach.
783
784         Test: accessibility/ios-simulator/ios-search-predicate-link-children.html
785
786         * accessibility/AccessibilityObject.cpp:
787         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
788
789 2017-04-03  Jer Noble  <jer.noble@apple.com>
790
791         No audio output for MediaStream-backed audio elements on iOS
792         https://bugs.webkit.org/show_bug.cgi?id=170427
793
794         Reviewed by Eric Carlson.
795
796         The logic for setting the output timestamp offset in AudioSampleDataSource was reversed; instead of
797         subtracting out the timestamp of the first pull request, it effectively doubled it.
798
799         * platform/audio/mac/AudioSampleDataSource.mm:
800         (WebCore::AudioSampleDataSource::pullSamplesInternal):
801
802 2017-04-03  Dave Hyatt  <hyatt@apple.com>
803
804         Japanese fonts in vertical text should support synthesized italics
805         https://bugs.webkit.org/show_bug.cgi?id=169301
806
807         Reviewed by Simon Fraser.
808
809         Updated test in fast/text/international.
810
811         * platform/graphics/Font.cpp:
812         (WebCore::Font::nonSyntheticItalicFont): Deleted.
813         * platform/graphics/Font.h:
814         Removed the non-synthetic italic font member, since it's not used.
815
816         * platform/graphics/FontCascadeFonts.cpp:
817         (WebCore::glyphDataForNonCJKCharacterWithGlyphOrientation):
818         Patched to ensure that a text-orientation-fallback font data is always
819         returned in the synthetic oblique case, so that non-CJK and CJK are
820         guaranteed to be broken up so that their slants can be applied differently.
821
822         (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
823         (WebCore::FontCascadeFonts::glyphDataForNormalVariant):
824         (WebCore::glyphDataForCJKCharacterWithoutSyntheticItalic): Deleted.
825         Patched to no longer turn off synthetic oblique for CJK.
826
827         * platform/graphics/cocoa/FontCascadeCocoa.mm:
828         (WebCore::FontCascade::drawGlyphs):
829         Apply the correct italic transform to CJK when in vertical text.
830
831 2017-04-03  Chris Dumez  <cdumez@apple.com>
832
833         REGRESSION (r206744): CSS background-image in style attribute ignored when using createHTMLDocument method of DOM parsing
834         https://bugs.webkit.org/show_bug.cgi?id=170285
835         <rdar://problem/31378543>
836
837         Reviewed by Andy Estes.
838
839         r206744 caused up to stop trying to resolve relative URLs when trying to load an image
840         referred to by CSS. We already try to resolve the relative URL when parsing the CSS
841         property so this will usually work fine. However, in the case when the CSS property
842         is parsed in detached document and then moved to another document, we will not have
843         the complete URL.
844
845         Test: fast/images/background-image-relative-url-changes-document.html
846
847         * css/CSSImageValue.cpp:
848         (WebCore::CSSImageValue::loadImage):
849
850 2017-04-03  Jeremy Jones  <jeremyj@apple.com>
851
852         Do not set WebAVPlayerLayerView background to black in fullscreen.
853         https://bugs.webkit.org/show_bug.cgi?id=170132
854         rdar://problem/30839278
855
856         Reviewed by Tim Horton.
857
858         No new tests because no behavior change.
859
860         The black background on WebAVPlayerLayerView interferes with the fullscreen animation
861         and has been removed.
862
863         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
864         (WebVideoFullscreenInterfaceAVKit::enterFullscreen):
865         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard):
866
867 2017-04-03  Antti Koivisto  <antti@apple.com>
868
869         REGRESSION (r207669): FileMaker Pro Help pages do not render correctly
870         https://bugs.webkit.org/show_bug.cgi?id=170402
871         <rdar://problem/31004344>
872
873         Reviewed by Simon Fraser.
874
875         If a new stylesheet load is started from the load event the document.styleSheets does not
876         always reflect the already loaded stylesheets.
877
878         Test: fast/css/document-stylesheets-dynamic.html
879
880         * style/StyleScope.cpp:
881         (WebCore::Style::Scope::updateActiveStyleSheets):
882
883             Remove an old optimization where we would not update active stylesheets if there were pending
884             (head) stylesheet loads and they had not been updated already.
885             This is probably not a valuable optimization anymore with the new lazy stylesheet update strategy.
886
887         * style/StyleScope.h:
888
889 2017-04-03  Anders Carlsson  <andersca@apple.com>
890
891         Tweak ApplePaySession API
892         https://bugs.webkit.org/show_bug.cgi?id=170409
893         rdar://problem/31405459
894
895         Reviewed by Tim Horton.
896
897         Rename "address" to "addressLines". Add "postalAddress". Reorder the ApplePayError constructor parameters.
898
899         * Modules/applepay/ApplePayError.cpp:
900         (WebCore::ApplePayError::create):
901         (WebCore::ApplePayError::ApplePayError):
902         * Modules/applepay/ApplePayError.h:
903         * Modules/applepay/ApplePayError.idl:
904         * Modules/applepay/PaymentRequest.h:
905
906 2017-04-03  Zan Dobersek  <zdobersek@igalia.com>
907
908         [GCrypt] Implement CryptoKeyEC::keySizeInBits(), ::platformGeneratePair()
909         https://bugs.webkit.org/show_bug.cgi?id=170345
910
911         Reviewed by Michael Catanzaro.
912
913         Start implementing the libgcrypt-based platform bits of CryptoKeyEC.
914
915         Implement keySizeInBits() by returning the appropriate size for this
916         object's curve type. An assertion is added to ensure that this size
917         matches the one that's returned by gcry_pk_get_nbits() for this
918         object's EC key as represented by the m_platformKey gcry_sexp_t object.
919
920         Implement platformGeneratePair() by constructing a genkey s-expression
921         that requests a generation of an EC key for the specified curve type.
922         The s-expression is then passed to gcry_pk_genkey(), and the public
923         and private key data is then retrieved from the returned s-expression
924         upon success and used to create the public and private CryptoKeyEC
925         objects.
926
927         The PlatformECKey type alias is changed to match gcry_sexp_t. The
928         CryptoKeyEC destructor releases the gcry_sexp_t object through
929         a PAL::GCrypt::HandleDeleter<gcry_sexp_t> instance.
930
931         The method definitions in the CryptoKeyECGCrypt.cpp file are also
932         sorted to match the declaration order in the header.
933
934         No new tests -- current ones cover this sufficiently, but are not yet
935         enabled due to other missing platform-specific SUBTLE_CRYPTO
936         implementations.
937
938         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
939         (WebCore::curveSize):
940         (WebCore::curveName):
941         (WebCore::CryptoKeyEC::~CryptoKeyEC):
942         (WebCore::CryptoKeyEC::keySizeInBits):
943         (WebCore::CryptoKeyEC::platformGeneratePair):
944         (WebCore::CryptoKeyEC::platformImportSpki):
945         (WebCore::CryptoKeyEC::platformImportPkcs8):
946         (WebCore::CryptoKeyEC::platformExportRaw):
947         (WebCore::CryptoKeyEC::platformAddFieldElements):
948         (WebCore::CryptoKeyEC::platformExportSpki):
949         * crypto/keys/CryptoKeyEC.h:
950
951 2017-04-03  Zan Dobersek  <zdobersek@igalia.com>
952
953         [GCrypt] Implement AES_KW support
954         https://bugs.webkit.org/show_bug.cgi?id=170274
955
956         Reviewed by Michael Catanzaro.
957
958         Implement the CryptoAlgorithmAES_KW::platform{Wrap,Unwrap}Key()
959         functionality for configurations that use libgcrypt. This is done
960         by leveraging the gcry_cipher_* APIs for the AES algorithm that's
961         deducted appropriately from the key size and the AESWRAP cipher mode.
962
963         No new tests -- current ones cover this sufficiently, but are not yet
964         enabled due to other missing platform-specific SUBTLE_CRYPTO
965         implementations.
966
967         * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:
968         (WebCore::gcryptWrapKey):
969         (WebCore::gcryptUnwrapKey):
970         (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
971         (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
972
973 2017-04-03  Zan Dobersek  <zdobersek@igalia.com>
974
975         [GCrypt] Implement AES_GCM support
976         https://bugs.webkit.org/show_bug.cgi?id=170271
977
978         Reviewed by Michael Catanzaro.
979
980         Implement the CryptoAlgorithmAES_GCM::platform{Encrypt,Decrypt}
981         functionality for configurations that use libgcrypt. This is done
982         by leveraging the gcry_cipher_* APIs for the AES algorithm that's
983         deducted appropriately from the key size and the GCM cipher mode.
984
985         No new tests -- current ones cover this sufficiently, but are not yet
986         enabled due to other missing platform-specific SUBTLE_CRYPTO
987         implementations.
988
989         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
990         (WebCore::gcryptEncrypt):
991         (WebCore::gcryptDecrypt):
992         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
993         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
994
995 2017-04-03  Zan Dobersek  <zdobersek@igalia.com>
996
997         [GCrypt] Implement PBKDF2 support
998         https://bugs.webkit.org/show_bug.cgi?id=170270
999
1000         Reviewed by Michael Catanzaro.
1001
1002         Implement the CryptoAlgorithmPBKDF2::platformDeriveBits() functionality
1003         for configurations that use libgcrypt. This is done by leveraging the
1004         gcry_kdf_derive() API, using GCRY_KDF_PBKDF2 as the preferred KDF
1005         along with the properly deducted SHA algorithm.
1006
1007         No new tests -- current ones cover this sufficiently, but are not yet
1008         enabled due to other missing platform-specific SUBTLE_CRYPTO
1009         implementations.
1010
1011         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
1012         (WebCore::gcryptDeriveBits):
1013         (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
1014
1015 2017-04-01  Simon Fraser  <simon.fraser@apple.com>
1016
1017         Clean up touch event handler registration when moving nodes between documents
1018         https://bugs.webkit.org/show_bug.cgi?id=170384
1019         rdar://problem/30816694
1020
1021         Reviewed by Chris Dumez.
1022
1023         Make sure that Node::didMoveToNewDocument() does the correct unregistration on the
1024         old document, and registration on the new document for nodes with touch event listeners,
1025         and gesture event listeners. Touch "handler" nodes (those for overflow and sliders) are
1026         already correctly moved via renderer-related teardown.
1027
1028         Add assertions that fire when removal was not complete.
1029
1030         Use references in more places.
1031
1032         Tests: fast/events/touch/ios/gesture-node-move-between-documents.html
1033                fast/events/touch/ios/overflow-node-move-between-documents.html
1034                fast/events/touch/ios/slider-node-move-between-documents.html
1035                fast/events/touch/ios/touch-node-move-between-documents.html
1036
1037         * dom/EventNames.h:
1038         (WebCore::EventNames::gestureEventNames):
1039         * dom/Node.cpp:
1040         (WebCore::Node::willBeDeletedFrom):
1041         (WebCore::Node::didMoveToNewDocument):
1042         (WebCore::tryAddEventListener):
1043         (WebCore::tryRemoveEventListener):
1044         * html/shadow/SliderThumbElement.cpp:
1045         (WebCore::SliderThumbElement::registerForTouchEvents):
1046         (WebCore::SliderThumbElement::unregisterForTouchEvents):
1047         * rendering/RenderLayer.cpp:
1048         (WebCore::RenderLayer::registerAsTouchEventListenerForScrolling):
1049         (WebCore::RenderLayer::unregisterAsTouchEventListenerForScrolling):
1050
1051 2017-04-03  Youenn Fablet  <youenn@apple.com>
1052
1053         captureStream is getting black frames with webgl canvas
1054         https://bugs.webkit.org/show_bug.cgi?id=170325
1055
1056         Reviewed by Dean Jackson.
1057
1058         Test: fast/mediastream/captureStream/canvas3d.html
1059
1060         Changing the webgl context to save buffers in case the canvas is captured.
1061         Adding a canvas changed notification in case of clear.
1062         In the future, we might want to change this notification and do it when endPaint or similar is called.
1063
1064         Adding an Internals API to grab the RGBA equivalent of the next track frame.
1065         For that purpose, adding a bunch of WEBCORE_EXPORT.
1066
1067         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
1068         (WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Adding constraints support so that track settings
1069         getter actually transmits the width and height of the source.
1070         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): ensuring webgl canvas context keep their drawing buffer.
1071         * Modules/mediastream/MediaStreamTrack.h:
1072         * bindings/js/JSDOMGuardedObject.h:
1073         * bindings/js/JSDOMPromise.h:
1074         (WebCore::DeferredPromise::resolve):
1075         (WebCore::DeferredPromise::reject):
1076         * dom/ActiveDOMCallback.h:
1077         * html/HTMLCanvasElement.cpp:
1078         (WebCore::HTMLCanvasElement::captureStream):
1079         * html/ImageData.h:
1080         * html/ImageData.idl:
1081         * html/canvas/WebGLRenderingContext.cpp:
1082         (WebCore::WebGLRenderingContext::clear): ensuring canvas observers get notified in case of clear calls.
1083         * html/canvas/WebGLRenderingContextBase.h:
1084         (WebCore::WebGLRenderingContextBase::preserveDrawingBuffer): Added to allow canvas capture to update this property.
1085         * platform/MediaSample.h:
1086         (WebCore::MediaSample::getRGBAImageData): Added for internals API.
1087         * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
1088         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
1089         (WebCore::MediaSampleAVFObjC::getRGBAImageData):
1090         * platform/graphics/cv/PixelBufferConformerCV.cpp:
1091         (WebCore::PixelBufferConformerCV::convert): Helper routine for getRGBAImageData.
1092         * platform/graphics/cv/PixelBufferConformerCV.h:
1093         * platform/mediastream/RealtimeMediaSourceSettings.h:
1094         (WebCore::RealtimeMediaSourceSettings::setSupportedConstraints):
1095         (WebCore::RealtimeMediaSourceSettings::setSupportedConstraits): Deleted.
1096         * platform/mediastream/mac/AVMediaCaptureSource.mm:
1097         (WebCore::AVMediaCaptureSource::initializeSettings):
1098         * platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h:
1099         * platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h:
1100         * platform/mock/MockRealtimeMediaSource.cpp:
1101         (WebCore::MockRealtimeMediaSource::initializeSettings):
1102         * testing/Internals.cpp:
1103         (WebCore::Internals::grabNextMediaStreamTrackFrame):
1104         (WebCore::Internals::videoSampleAvailable):
1105         * testing/Internals.h:
1106         * testing/Internals.idl:
1107
1108 2017-04-03  Per Arne Vollan  <pvollan@apple.com>
1109
1110         Implement stroke-miterlimit.
1111         https://bugs.webkit.org/show_bug.cgi?id=169078
1112
1113         Reviewed by Dean Jackson.
1114
1115         Support stroke-miterlimit for text rendering, see https://drafts.fxtf.org/paint/.
1116
1117         Tests: fast/css/stroke-miterlimit-default.html
1118                fast/css/stroke-miterlimit-large.html
1119                fast/css/stroke-miterlimit-zero.html
1120
1121         * css/CSSComputedStyleDeclaration.cpp:
1122         (WebCore::ComputedStyleExtractor::propertyValue):
1123         * css/CSSProperties.json:
1124         * css/SVGCSSComputedStyleDeclaration.cpp:
1125         (WebCore::ComputedStyleExtractor::svgPropertyValue):
1126         * rendering/TextPaintStyle.cpp:
1127         (WebCore::computeTextPaintStyle):
1128         (WebCore::updateGraphicsContext):
1129         * rendering/TextPaintStyle.h:
1130         * rendering/style/RenderStyle.cpp:
1131         (WebCore::RenderStyle::diff):
1132         * rendering/style/RenderStyle.h:
1133         (WebCore::RenderStyle::strokeMiterLimit):
1134         (WebCore::RenderStyle::setStrokeMiterLimit):
1135         (WebCore::RenderStyle::initialStrokeMiterLimit):
1136         (WebCore::RenderStyle::setStrokeDashOffset):
1137         * rendering/style/RenderStyleConstants.cpp:
1138         * rendering/style/RenderStyleConstants.h:
1139         * rendering/style/SVGRenderStyle.cpp:
1140         (WebCore::SVGRenderStyle::diff):
1141         * rendering/style/SVGRenderStyle.h:
1142         (WebCore::SVGRenderStyle::initialStrokeDashArray):
1143         (WebCore::SVGRenderStyle::strokeDashArray):
1144         (WebCore::SVGRenderStyle::initialStrokeMiterLimit): Deleted.
1145         (WebCore::SVGRenderStyle::strokeMiterLimit): Deleted.
1146         (WebCore::SVGRenderStyle::setStrokeMiterLimit): Deleted.
1147         * rendering/style/SVGRenderStyleDefs.cpp:
1148         (WebCore::StyleStrokeData::StyleStrokeData):
1149         (WebCore::StyleStrokeData::operator==):
1150         * rendering/style/SVGRenderStyleDefs.h:
1151         * rendering/style/StyleRareInheritedData.cpp:
1152         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1153         (WebCore::StyleRareInheritedData::operator==):
1154         * rendering/style/StyleRareInheritedData.h:
1155         * rendering/svg/RenderSVGShape.cpp:
1156         (WebCore::RenderSVGShape::hasSmoothStroke):
1157         * rendering/svg/SVGRenderSupport.cpp:
1158         (WebCore::SVGRenderSupport::applyStrokeStyleToContext):
1159         * rendering/svg/SVGRenderTreeAsText.cpp:
1160         (WebCore::writeStyle):
1161
1162 2017-04-03  Alejandro G. Castro  <alex@igalia.com>
1163
1164         [OWR] Fix class structure for the OWR mock classes after last modifications
1165         https://bugs.webkit.org/show_bug.cgi?id=170173
1166
1167         Reviewed by Youenn Fablet.
1168
1169         In case of OWR MockRealtimeMediaSource inherits from
1170         RealtimeMediaSourceOwr, so we have to change some of the function
1171         interfaces.
1172
1173         * platform/mock/MockRealtimeMediaSource.h:
1174
1175 2017-04-02  Alexey Proskuryakov  <ap@apple.com>
1176
1177         Build fix for
1178         Add missing text styles
1179         https://bugs.webkit.org/show_bug.cgi?id=170295
1180
1181         * rendering/RenderThemeIOS.mm:
1182         (WebCore::RenderThemeIOS::cachedSystemFontDescription):
1183         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
1184
1185 2017-04-01  Zalan Bujtas  <zalan@apple.com>
1186
1187         Long Arabic text in ContentEditable with css white-space=pre hangs Safari
1188         https://bugs.webkit.org/show_bug.cgi?id=170245
1189
1190         Reviewed by Myles C. Maxfield.
1191
1192         While searching for mid-word break, we measure the text by codepoints in a loop until the accumulated width > available width.
1193         When we see that the accumulated width for the individual codepoints overflows, we join the codepoints and re-measure them.
1194         These 2 widths could be considerably different for number of reasons (ligatures is a prime example). When we figure that
1195         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.
1196         However this time we start the measurement from the last whitespace, so we end up remeasuring a potentially long chuck of text
1197         until we hit the wrapping point. This is way too expensive.
1198         This patch changes the logic so that we just go back to measuring individual codepoints until we hit the constrain again.  
1199
1200         Covered by existing tests.
1201
1202         * rendering/line/BreakingContext.h:
1203         (WebCore::BreakingContext::handleText): canUseSimpleFontCodePath() is just to mitigate the potential risk of regression and
1204         complex text is more likely to fall into this category. 
1205
1206 2017-04-01  Jon Lee  <jonlee@apple.com>
1207
1208         Add missing text styles
1209         https://bugs.webkit.org/show_bug.cgi?id=170295
1210         rdar://problem/30219503
1211
1212         Reviewed by Dean Jackson.
1213
1214         Updated existing test to include new text styles.
1215
1216         * css/CSSValueKeywords.in: Add title0 and title4.
1217         * platform/spi/cocoa/CoreTextSPI.h:
1218         * rendering/RenderThemeIOS.mm:
1219         (WebCore::RenderThemeIOS::cachedSystemFontDescription):
1220         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
1221
1222 2017-04-01  Dan Bernstein  <mitz@apple.com>
1223
1224         [iOS] <input type=file> label should be specified using plural rules
1225         https://bugs.webkit.org/show_bug.cgi?id=170388
1226
1227         Reviewed by Alexey Proskuryakov.
1228
1229         * English.lproj/Localizable.strings: Updated using update-webkit-localizable-strings.
1230
1231         * English.lproj/Localizable.stringsdict: Added an entry for the new key "%lu photo(s) and
1232           %lu video(s)", with plural rules covering all the different combinations in English.
1233           Other localizations may specify additional combinations as needed.
1234
1235 2017-04-01  Alexey Proskuryakov  <ap@apple.com>
1236
1237         Rolling back <https://trac.webkit.org/r214697>, as it made WebKit2.DataDetectionReferenceDate time out.
1238
1239         Was REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
1240         https://bugs.webkit.org/show_bug.cgi?id=170365
1241
1242         * editing/cocoa/DataDetection.mm:
1243         (WebCore::searchForLinkRemovingExistingDDLinks):
1244
1245 2017-04-01  Chris Dumez  <cdumez@apple.com>
1246
1247         We should pause silent WebAudio rendering in background tabs
1248         https://bugs.webkit.org/show_bug.cgi?id=170299
1249         <rdar://problem/31289132>
1250
1251         Reviewed by Eric Carlson.
1252
1253         We should pause silent WebAudio rendering in background tabs since it uses CPU and is
1254         not observable by the user. Such silent WebAudio rendering seems to be used by
1255         doubleclick ads.
1256
1257         Test: webaudio/silent-audio-interrupted-in-background.html
1258
1259         * Modules/webaudio/AudioContext.cpp:
1260         (WebCore::AudioContext::lazyInitialize):
1261         (WebCore::AudioContext::uninitialize):
1262         Have AudioContext register / unregister itself with the Document to get
1263         visibility change notifications, similarly to what HTMLMediaElement was
1264         already doing.
1265
1266         (WebCore::AudioContext::visibilityStateChanged):
1267         Begin / End session interruption whenever the page visiblity changes.
1268
1269         * Modules/webaudio/AudioContext.h:
1270         * WebCore.xcodeproj/project.pbxproj:
1271
1272         * dom/Document.cpp:
1273         (WebCore::Document::registerForVisibilityStateChangedCallbacks):
1274         (WebCore::Document::unregisterForVisibilityStateChangedCallbacks):
1275         (WebCore::Document::visibilityStateChanged):
1276         * dom/Document.h:
1277         * dom/Element.h:
1278         * dom/VisibilityChangeClient.h: Added.
1279         (WebCore::VisibilityChangeClient::~VisibilityChangeClient):
1280         * html/HTMLMediaElement.h:
1281         Introduce a new VisibilityChangeClient interface and have both AudioContext
1282         and HTMLMediaElement subclass it. Previously, the visibilityStateChanged()
1283         function was on Element but this prevented AudioContext from registering
1284         itself since AudioContext is not an Element.
1285
1286 2017-04-01  Dan Bernstein  <mitz@apple.com>
1287
1288         [Cocoa] A couple of UI strings use three periods instead of an ellipsis
1289         https://bugs.webkit.org/show_bug.cgi?id=170386
1290
1291         Reviewed by Tim Horton.
1292
1293         * English.lproj/Localizable.strings: Updated using update-webkit-localizable-strings.
1294
1295         * platform/LocalizedStrings.cpp:
1296         (WebCore::mediaElementLoadingStateText): Changed "Loading..." to "Loading…".
1297
1298         * platform/cocoa/LocalizedStringsCocoa.mm:
1299         (WebCore::contextMenuItemTagStyles): Changed "Styles..." to "Styles…".
1300
1301 2017-04-01  Dan Bernstein  <mitz@apple.com>
1302
1303         Localizable strings files are out of date
1304         https://bugs.webkit.org/show_bug.cgi?id=170383
1305
1306         Reviewed by Tim Horton.
1307
1308         Ran update-webkit-localizable-strings.
1309
1310         * English.lproj/Localizable.strings:
1311
1312 2017-04-01  Dan Bernstein  <mitz@apple.com>
1313
1314         [Xcode] In engineering builds, linker warns about libwebrtc.dylib’s install name being invalid
1315         https://bugs.webkit.org/show_bug.cgi?id=170385
1316
1317         Reviewed by Tim Horton.
1318
1319         * Configurations/DebugRelease.xcconfig: Set WK_RELOCATABLE_FRAMEWORKS to YES like we do
1320           in some other projects’ DebugRelease.xcconfig. Engineering builds are always relocatable.
1321         * Configurations/WebCore.xcconfig: When WebCore is relocatable, tell the linker that it’s
1322           not going to be in the shared cache, even if its install name implies that it might be.
1323
1324 2017-04-01  Alexey Proskuryakov  <ap@apple.com>
1325
1326         Rolling back http://trac.webkit.org/r214663 - memory corruption
1327
1328         * Modules/streams/ReadableByteStreamInternals.js:
1329         (cloneArrayBuffer):
1330         * bindings/js/JSDOMGlobalObject.cpp:
1331         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
1332         * bindings/js/StructuredClone.cpp:
1333         (WebCore::structuredCloneArrayBuffer):
1334         (WebCore::cloneArrayBufferImpl): Deleted.
1335         (WebCore::cloneArrayBuffer): Deleted.
1336         * bindings/js/StructuredClone.h:
1337         * bindings/js/WebCoreBuiltinNames.h:
1338         * testing/Internals.cpp:
1339         (WebCore::markerTypeFrom):
1340         (WebCore::Internals::resetToConsistentState):
1341         (WebCore::Internals::isLoadingFromMemoryCache):
1342         (WebCore::Internals::setImageFrameDecodingDuration):
1343         (WebCore::deferredStyleRulesCountForList):
1344         (WebCore::deferredGroupRulesCountForList):
1345         (WebCore::deferredKeyframesRulesCountForList):
1346         (WebCore::Internals::eventThrottlingBehaviorOverride):
1347         (WebCore::Internals::enableMockSpeechSynthesizer):
1348         (WebCore::Internals::rangeForDictionaryLookupAtLocation):
1349         (WebCore::Internals::nodesFromRect):
1350         (WebCore::Internals::layerIDForElement):
1351         (WebCore::Internals::setElementUsesDisplayListDrawing):
1352         (WebCore::Internals::setElementTracksDisplayListReplay):
1353         (WebCore::Internals::styleRecalcCount):
1354         (WebCore::Internals::compositingUpdateCount):
1355         (WebCore::Internals::setCaptionDisplayMode):
1356         (WebCore::Internals::endMediaSessionInterruption):
1357         (WebCore::Internals::postRemoteControlCommand):
1358         (WebCore::appendOffsets):
1359         (WebCore::Internals::scrollSnapOffsets):
1360         (WebCore::Internals::setShowAllPlugins):
1361         (WebCore::Internals::cloneArrayBuffer): Deleted.
1362         * testing/Internals.h:
1363         * testing/Internals.idl:
1364
1365 2017-03-31  Zalan Bujtas  <zalan@apple.com>
1366
1367         <table>: Including <caption>, <thead> or <tbody> causes clipping across page breaks
1368         https://bugs.webkit.org/show_bug.cgi?id=170348
1369         <rdar://problem/24727151>
1370
1371         Reviewed by David Hyatt.
1372
1373         1. In RenderFlowThread::offsetFromLogicalTopOfFirstRegion() we need to take table section offset into account (they are skipped
1374         during the containing block traversal).
1375         2. Trigger paginated relayout when body is moved vertically due to caption/thead etc.
1376
1377         Test: fast/multicol/table-section-page-break.html
1378
1379         * rendering/RenderFlowThread.cpp:
1380         (WebCore::RenderFlowThread::offsetFromLogicalTopOfFirstRegion):
1381         * rendering/RenderTable.cpp:
1382         (WebCore::RenderTable::layout):
1383
1384 2017-03-31  Simon Fraser  <simon.fraser@apple.com>
1385
1386         Rename DOMWindow's m_touchEventListenerCount to m_touchAndGestureEventListenerCount
1387         https://bugs.webkit.org/show_bug.cgi?id=170371
1388
1389         Reviewed by Tim Horton.
1390
1391         This count tracks touch and gesture event listeners, so name it appropriately.
1392
1393         * page/DOMWindow.cpp:
1394         (WebCore::DOMWindow::addEventListener):
1395         (WebCore::DOMWindow::removeEventListener):
1396         (WebCore::DOMWindow::removeAllEventListeners):
1397         * page/DOMWindow.h:
1398
1399 2017-03-31  Simon Fraser  <simon.fraser@apple.com>
1400
1401         When destroying a Node, assert that it's been removed from all the touch handler maps
1402         https://bugs.webkit.org/show_bug.cgi?id=170363
1403         rdar://problem/31377469
1404
1405         Reviewed by Tim Horton.
1406
1407         Assert that the Node has been removed from the touch handler maps in all documents on destruction.
1408
1409         * dom/Document.h:
1410         (WebCore::Document::hasTouchEventHandlers):
1411         (WebCore::Document::touchEventTargetsContain):
1412         * dom/Node.cpp:
1413         (WebCore::Node::~Node):
1414
1415 2017-03-31  Alexey Proskuryakov  <ap@apple.com>
1416
1417         Rolling back https://trac.webkit.org/r214689, as it caused many crashes.
1418
1419         Was:
1420         Fix memory leak in CreateSessionDescriptionObserver::OnSuccess
1421         https://bugs.webkit.org/show_bug.cgi?id=170357
1422
1423         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1424         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded):
1425
1426 2017-03-31  Youenn Fablet  <youenn@apple.com>
1427
1428         Fix memory leak in RealtimeVideoIncomingSource
1429         https://bugs.webkit.org/show_bug.cgi?id=170356
1430
1431         Reviewed by Eric Carlson.
1432
1433         No change of behavior.
1434
1435         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
1436         (WebCore::RealtimeIncomingVideoSource::OnFrame): Adopting the newly created pointer.
1437
1438 2017-03-31  Andy Estes  <aestes@apple.com>
1439
1440         REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
1441         https://bugs.webkit.org/show_bug.cgi?id=170365
1442         <rdar://problem/29205721>
1443
1444         Reviewed by Tim Horton.
1445
1446         r202472 changed the node traversal in searchForLinkRemovingExistingDDLinks() to only
1447         consider nodes that are descendants of startNode, but we need to traverse all nodes between
1448         startNode and endNode to find existing non-DD links.
1449
1450         As a result, we'd add a Data Detector link to the following snippet and make the original
1451         links un-clickable:
1452
1453             <a href='#'>tomorrow</a> <a href='#'>night</a>
1454
1455         Fix this by not specifying a stayWithin node when calling NodeTraversal::next(). The loop
1456         will terminate when we reach endNode.
1457
1458         Updated WebKit2.DataDetectionReferenceDate API test.
1459
1460         * editing/cocoa/DataDetection.mm:
1461         (WebCore::searchForLinkRemovingExistingDDLinks):
1462
1463 2017-03-31  Eric Carlson  <eric.carlson@apple.com>
1464
1465         Incoming video source doesn't propogate frame rotation
1466         https://bugs.webkit.org/show_bug.cgi?id=170364
1467
1468         Reviewed by Youenn Fablet.
1469
1470         No new tests, the mock video source doesn't support rotation. Test will be added when
1471         this is fixed in https://bugs.webkit.org/show_bug.cgi?id=169822. The changes were 
1472         verified manually.
1473
1474         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
1475         (WebCore::RealtimeIncomingVideoSource::OnFrame): Convert frame rotation to sample
1476         orientation and swap width and height when necessary.
1477         (WebCore::RealtimeIncomingVideoSource::processNewSample):
1478         * platform/mediastream/mac/RealtimeIncomingVideoSource.h:
1479
1480 2017-03-31  Chris Dumez  <cdumez@apple.com>
1481
1482         Possible null dereference under SourceBuffer::sourceBufferPrivateDidReceiveSample()
1483         https://bugs.webkit.org/show_bug.cgi?id=159639
1484
1485         Reviewed by Eric Carlson.
1486
1487         Add a null check for trackBuffer.description before dereferencing as it seems
1488         it can be null.
1489
1490         * Modules/mediasource/SourceBuffer.cpp:
1491         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
1492
1493 2017-03-31  Youenn Fablet  <youenn@apple.com>
1494
1495         Fix memory leak in CreateSessionDescriptionObserver::OnSuccess
1496         https://bugs.webkit.org/show_bug.cgi?id=170357
1497
1498         Reviewed by Geoffrey Garen.
1499
1500         No change of behavior.
1501
1502         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1503         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded): Adopting the raw pointer parameter.
1504
1505 2017-03-31  Fujii Hironori  <Hironori.Fujii@sony.com>
1506
1507         [WinCairo] WebCore::PlatformDisplay::terminateEGLDisplay causes a crash in libGLESv2.dll while processing atexit
1508         https://bugs.webkit.org/show_bug.cgi?id=170331
1509
1510         Reviewed by Michael Catanzaro.
1511
1512         WebCore::PlatformDisplay uses atexit to destruct EGL displays
1513         while exiting process. But, when the atexit will be processed,
1514         heap of libGLESv2.dll would be already destructed and causing a
1515         crash on Windows. Do not use atexit for Windows.
1516
1517         AppleWin port does not use PlatformDisplay. Thus, it does not have
1518         this bug.
1519
1520         * platform/graphics/PlatformDisplay.cpp:
1521         (WebCore::PlatformDisplay::initializeEGLDisplay): Do not use atexit for Windows.
1522         (WebCore::PlatformDisplay::shutDownEglDisplays): Added.
1523         * platform/graphics/PlatformDisplay.h: Added a declaration of shutDownEglDisplays.
1524
1525 2017-03-31  Yoav Weiss  <yoav@yoav.ws>
1526
1527         Remove PRELOAD_DEBUG related code.
1528         https://bugs.webkit.org/show_bug.cgi?id=170352
1529
1530         Reviewed by Youenn Fablet.
1531
1532         As the PRELOAD_DEBUG related code stopped building and it seems like no one noticed,
1533         it seems safe to assume that we can remove that code. This patch removes it.
1534
1535         No new tests as there's no functional change.
1536
1537         * loader/cache/CachedResourceLoader.cpp:
1538         (WebCore::CachedResourceLoader::preload):
1539         (WebCore::CachedResourceLoader::clearPreloads):
1540         (WebCore::CachedResourceLoader::printPreloadStats): Deleted.
1541
1542 2017-03-31  Brady Eidson  <beidson@apple.com>
1543
1544         Clean up the "StorageType" enum.
1545         https://bugs.webkit.org/show_bug.cgi?id=170349
1546
1547         Reviewed by Tim Horton.
1548
1549         - Make this `enum` into an `enum class`
1550         - Add a new type specific for "transient local storage"
1551
1552         No new tests (No behavior change).
1553
1554         * WebCore.xcodeproj/project.pbxproj:
1555         
1556         * inspector/InspectorDOMStorageAgent.cpp:
1557         (WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
1558         
1559         * inspector/InspectorInstrumentation.h:
1560         
1561         * loader/EmptyClients.cpp:
1562         
1563         * storage/Storage.cpp:
1564         (WebCore::Storage::isDisabledByPrivateBrowsing):
1565         
1566         * storage/StorageArea.h:
1567         (): Deleted.
1568         
1569         * storage/StorageEventDispatcher.cpp:
1570         (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
1571         (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
1572         
1573         * storage/StorageType.h:
1574         (WebCore::isLocalStorage):
1575
1576 2017-03-31  Chris Dumez  <cdumez@apple.com>
1577
1578         Unreviewed, Mark "HTML interactive form validation" as done.
1579
1580         It is shipping in Safari 10.1.
1581  
1582         * features.json:
1583
1584 2017-03-31  Csaba Osztrogonác  <ossy@webkit.org>
1585
1586         Mac cmake buildfix after r214666
1587         https://bugs.webkit.org/show_bug.cgi?id=170342
1588
1589         Unreviewed buildfix.
1590
1591         * PlatformMac.cmake:
1592         * testing/MockPreviewLoaderClient.h:
1593
1594 2017-03-31  Sam Weinig  <sam@webkit.org>
1595
1596         Remove unneeded custom constructors include.
1597
1598         * WebCore.xcodeproj/project.pbxproj:
1599         * bindings/js/ios: Removed.
1600         * bindings/js/ios/TouchConstructors.cpp: Removed.
1601
1602 2017-03-31  John Wilander  <wilander@apple.com>
1603
1604         Resource Load Statistics: Check if the store exists before clearing it
1605         https://bugs.webkit.org/show_bug.cgi?id=170324
1606         <rdar://problem/31258505>
1607
1608         Reviewed by Brent Fulgham.
1609
1610         No new tests. Added a null check.
1611
1612         * loader/ResourceLoadObserver.cpp:
1613         (WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore):
1614             Added a null check.
1615
1616 2017-03-31  Romain Bellessort  <romain.bellessort@crf.canon.fr>
1617
1618         [Readable Streams API] Implement cloneArrayBuffer in WebCore
1619         https://bugs.webkit.org/show_bug.cgi?id=170008
1620
1621         Reviewed by Youenn Fablet.
1622
1623         Implemented cloneArrayBuffer based on existing structuredCloneArrayBuffer
1624         implementation. The code has been factorized so that both cloneArrayBuffer
1625         and structuredCloneArrayBuffer rely on the same code (which is basically
1626         the previous implementation of structuredCloneArrayBuffer + the ability
1627         to clone only a part of considered buffer).
1628
1629         Added test to check cloneArrayBuffer behaviour.
1630
1631         * Modules/streams/ReadableByteStreamInternals.js: Deleted cloneArrayBuffer JS implementation.
1632         * bindings/js/JSDOMGlobalObject.cpp:
1633         (WebCore::JSDOMGlobalObject::addBuiltinGlobals): Add cloneArrayBuffer private declaration.
1634         * bindings/js/StructuredClone.cpp:
1635         (WebCore::cloneArrayBufferImpl): Added (mostly based on previous structuredCloneArrayBuffer).
1636         (WebCore::cloneArrayBuffer): Added.
1637         (WebCore::structuredCloneArrayBuffer): Updated.
1638         * bindings/js/StructuredClone.h: Added cloneArrayBuffer declaration.
1639         * bindings/js/WebCoreBuiltinNames.h: Added cloneArrayBuffer declaration.
1640         * testing/Internals.cpp: Added support for testing cloneArrayBuffer.
1641         * testing/Internals.h: Added support for testing cloneArrayBuffer.
1642         * testing/Internals.idl: Added support for testing cloneArrayBuffer.
1643
1644 2017-03-31  Antoine Quint  <graouts@apple.com>
1645
1646         [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
1647         https://bugs.webkit.org/show_bug.cgi?id=168409
1648         <rdar://problem/30799198>
1649
1650         Unreviewed. Yet more logging to determine under what circumstance ScriptedAnimationController gets suspended.
1651
1652         * dom/Document.cpp:
1653         (WebCore::Document::requestAnimationFrame):
1654
1655 2017-03-30  Zan Dobersek  <zdobersek@igalia.com>
1656
1657         Unreviewed GTK+ build fix. Add missing ANGLE build targets
1658         to the build.
1659
1660         * CMakeLists.txt:
1661
1662 2017-03-30  Simon Fraser  <simon.fraser@apple.com>
1663
1664         Ensure that Node::willBeDeletedFrom() always removes touch event handlers from the document
1665         https://bugs.webkit.org/show_bug.cgi?id=170323
1666         rdar://problem/23647630
1667
1668         Reviewed by Chris Dumez.
1669
1670         There are two instances where nodes are registered as touch event handlers without
1671         having normal touch event listeners: slider thumb elements, and elements with overflow scrolling,
1672         on iOS.
1673
1674         For such nodes, hasEventTargetData() will be false, but we want to ensure
1675         that they are removed from the Document's touchEventHandler set, so move the
1676         call to document.removeTouchEventHandler() outside of the conditional block.
1677
1678         This should be cheap in most cases when the touchEventHandler is empty.
1679
1680         * dom/Node.cpp:
1681         (WebCore::Node::willBeDeletedFrom):
1682
1683 2017-03-30  Simon Fraser  <simon.fraser@apple.com>
1684
1685         Minor cleanup checking for gesture event names
1686         https://bugs.webkit.org/show_bug.cgi?id=170319
1687
1688         Reviewed by Tim Horton.
1689
1690         Just use isGestureEventType() in a couple of places.
1691
1692         * dom/Node.cpp:
1693         (WebCore::tryAddEventListener):
1694         (WebCore::tryRemoveEventListener):
1695
1696 2017-03-30  Simon Fraser  <simon.fraser@apple.com>
1697
1698         Rename a touch event function, and new touch region test results
1699         https://bugs.webkit.org/show_bug.cgi?id=170309
1700         rdar://problem/31329520
1701
1702         Reviewed by Chris Dumez.
1703
1704         Adapt to a naming change in WebKitAdditions.
1705
1706         * dom/Document.cpp:
1707         (WebCore::Document::removeAllEventListeners):
1708         * page/FrameView.cpp:
1709         (WebCore::FrameView::layout):
1710         * rendering/RenderElement.cpp:
1711         (WebCore::RenderElement::styleWillChange):
1712         * rendering/RenderLayer.cpp:
1713         (WebCore::RenderLayer::scrollTo):
1714         (WebCore::RenderLayer::calculateClipRects):
1715
1716 2017-03-30  Matt Rajca  <mrajca@apple.com>
1717
1718         YouTube sometimes does not respect "user gesture" restriction for videos.
1719         https://bugs.webkit.org/show_bug.cgi?id=170297
1720
1721         I discovered a code path that does not honor the "user gesture" requirement and playback is able to begin
1722         even though we have a restriction in place. When using Media Source Extensions, which YouTube does, we transition
1723         from a "Have Metadata" to a "Future Data" state that causes playback to begin, however, we never check
1724         if we have a playback restriction in place.
1725
1726         Reviewed by Eric Carlson.
1727
1728         * html/HTMLMediaElement.cpp:
1729         (WebCore::HTMLMediaElement::setReadyState):
1730
1731 2017-03-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
1732
1733         REGRESSION (r213764): Background image from sprite sheet incorrectly scaled
1734         https://bugs.webkit.org/show_bug.cgi?id=169547
1735
1736         Reviewed by Simon Fraser.
1737
1738         The bug happens when drawing only a rectangle of an image not the whole
1739         image. In BitmapImage::draw(), sizeForDrawing was calculated as the destRect
1740         scaled by the transformation which is applied to the GraphicsContext. Two
1741         problems with this approach. The first one is destRect can be only part of
1742         the image. The second problem is, the ratio destRect / srcRect is another
1743         scaling that needs to be considered.
1744
1745         To fix this issue, first the base size has to be size of the image and not
1746         destRect.size(). Secondly, we need to scale this base size with the context
1747         transformation multiplied by the ratio destRect / srcRect. This scaling is
1748         exactly the same scaling which is calculated in subsamplingScale(). Finally
1749         we use this scaled size as the sizeForDrawing to send to the ImageDecoder.
1750
1751         Test: fast/images/sprite-sheet-image-draw.html
1752
1753         * platform/graphics/BitmapImage.cpp:
1754         (WebCore::BitmapImage::draw): Fix the bug.
1755         (WebCore::BitmapImage::stopAnimation): Stops the async image decoding for animated images only.
1756         The decoding for large images will be stopped when BitmapImage::newFrameNativeImageAvailableAtIndex()
1757         is called and the decoding queue is idle.
1758         (WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex): Add image logging.
1759         * platform/graphics/BitmapImage.h: Move sourceURL() to the Image class.
1760         * platform/graphics/GraphicsContext.cpp: Pass imagePaintingOptions.m_decodingMode to Image::drawTiled().
1761         (WebCore::GraphicsContext::drawTiledImage): Pass imagePaintingOptions.m_decodingMode) to Image::drawTiled().
1762         * platform/graphics/Image.cpp:
1763         (WebCore::Image::sourceURL): Moved from BitmapImage.
1764         (WebCore::Image::drawTiled): Add a DecodingMode argument instead of calling always with DecodingMode::Synchronous.
1765         * platform/graphics/Image.h:
1766         * platform/graphics/ImageFrameCache.cpp:
1767         (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): Add image logging.
1768         (WebCore::ImageFrameCache::startAsyncDecodingQueue): Ditto,
1769         (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Ditto.
1770         (WebCore::ImageFrameCache::stopAsyncDecodingQueue): Ditto.
1771         (WebCore::ImageFrameCache::sourceURL): A helper function to avoid checking the value of m_image.
1772         * platform/graphics/ImageFrameCache.h:
1773         * platform/graphics/NativeImage.h: Rename subsamplingScale() to nativeImageDrawingScale() and return image scaling instead.
1774         * platform/graphics/cairo/NativeImageCairo.cpp:
1775         (WebCore::nativeImageDrawingScale): Ditto.
1776         (WebCore::subsamplingScale): Deleted.
1777         * platform/graphics/cg/NativeImageCG.cpp:
1778         (WebCore::nativeImageDrawingScale): Ditto.
1779         (WebCore::subsamplingScale): Deleted.
1780         * platform/graphics/win/NativeImageDirect2D.cpp:
1781         (WebCore::nativeImageDrawingScale): Ditto.
1782         (WebCore::subsamplingScale): Deleted.
1783
1784 2017-03-30  Matt Baker  <mattbaker@apple.com>
1785
1786         Web Inspector: Assertion failure in InspectorStyleProperty::setRawTextFromStyleDeclaration
1787         https://bugs.webkit.org/show_bug.cgi?id=170279
1788         <rdar://problem/30200492>
1789
1790         Reviewed by David Hyatt.
1791
1792         The SourceRange for a CSSPropertySourceData should be relative to the start
1793         of the declaration body, not the start of the StyleSheetHandler’s parsed
1794         text. This only affected the ranges of unparsed (parsedOK == false) properties
1795         lacking a trailing semi-colon.
1796
1797         This patch doesn't change the behavior of InspectorStyleSheet other than
1798         silencing an irksome assert, as String::substring does a safety check on
1799         the passed in length.
1800
1801         * inspector/InspectorStyleSheet.cpp:
1802         (WebCore::fixUnparsedProperties):
1803
1804 2017-03-30  Youenn Fablet  <youenn@apple.com> and Jon Lee <jonlee@apple.com>
1805
1806         Clean up RTCDataChannel
1807         https://bugs.webkit.org/show_bug.cgi?id=169732
1808
1809         Reviewed by Chris Dumez.
1810
1811         Test: webrtc/datachannel/datachannel-event.html
1812               webrtc/datachannel/bufferedAmountLowThreshold.html
1813
1814         Making RTCDataChannel interface closer to the spec updating implementation accordingly.
1815         See https://w3c.github.io/webrtc-pc/#rtcdatachannel.
1816         In particular adding RTCDataChannelEvent constructor, and missing bufferedAmount related attributes.
1817         Doing some additional cleaning refactoring.
1818
1819         Making bufferedAmountIsDecreasing take a bufferedAmount argument so that we get the actual value passed by
1820         libwebrtc without needing to get it from the libwebrtc network thread again.
1821         In the future, we should store the bufferedAmount value in RTCDataChannel and update its value on each libwebrtc
1822         OnBufferedAmountChange. Special treatment may be needed when the data channel is closed, in which case the bufferedAmount should just be
1823         updated to increase in the send method.
1824
1825         Added some FIXMEs as RTCDataChannel is not aligned with the spec related to send and bufferedAmount.
1826
1827         * Modules/mediastream/RTCDataChannel.cpp:
1828         (WebCore::RTCDataChannel::send):
1829         (WebCore::RTCDataChannel::close):
1830         (WebCore::RTCDataChannel::didChangeReadyState):
1831         (WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
1832         * Modules/mediastream/RTCDataChannel.h:
1833         * Modules/mediastream/RTCDataChannel.idl:
1834         * Modules/mediastream/RTCDataChannelEvent.cpp:
1835         (WebCore::RTCDataChannelEvent::create):
1836         (WebCore::RTCDataChannelEvent::RTCDataChannelEvent):
1837         (WebCore::RTCDataChannelEvent::channel):
1838         * Modules/mediastream/RTCDataChannelEvent.h:
1839         * Modules/mediastream/RTCDataChannelEvent.idl:
1840         * Modules/mediastream/RTCPeerConnection.idl:
1841         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
1842         (WebCore::LibWebRTCDataChannelHandler::OnStateChange):
1843         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1844         (WebCore::LibWebRTCMediaEndpoint::addDataChannel):
1845         * WebCore.xcodeproj/project.pbxproj:
1846         * dom/EventNames.h:
1847         * platform/mediastream/RTCDataChannelHandler.h:
1848         * platform/mediastream/RTCDataChannelHandlerClient.h:
1849         * platform/mediastream/RTCDataChannelState.h: Added.
1850         * platform/mediastream/RTCPeerConnectionHandlerClient.h:
1851         * platform/mock/RTCDataChannelHandlerMock.cpp:
1852         (WebCore::RTCDataChannelHandlerMock::setClient):
1853         (WebCore::RTCDataChannelHandlerMock::close):
1854         * platform/mock/RTCNotifiersMock.cpp:
1855         (WebCore::IceConnectionNotifier::IceConnectionNotifier):
1856         (WebCore::SignalingStateNotifier::SignalingStateNotifier):
1857         (WebCore::DataChannelStateNotifier::DataChannelStateNotifier):
1858         * platform/mock/RTCNotifiersMock.h:
1859
1860 2017-03-30  Javier Fernandez  <jfernandez@igalia.com>
1861
1862         [css-align] Adapt content-alignment properties to the new baseline syntax
1863         https://bugs.webkit.org/show_bug.cgi?id=170262
1864
1865         Reviewed by David Hyatt.
1866
1867         The baseline-position syntax has changed recently, so we need to update
1868         the CSS properties using the old syntax. This patch address only the
1869         content-alignment (align-content and justify-content).
1870
1871         I used this patch to adapt the implementation of the parsing logic for
1872         these properties to the new Blink's CSS Parsing Design.
1873
1874         The new baseline syntax is "[first | last ]? baseline" which implies
1875         modifying the parsing and computed value logic.
1876
1877         There are several layout tests affected by this change, so I'll update
1878         them accordingly.
1879
1880         No new tests, just added/modified some cases to the tests we
1881         already have using the new baseline values.
1882
1883         * css/CSSComputedStyleDeclaration.cpp:
1884         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
1885         * css/CSSContentDistributionValue.cpp:
1886         (WebCore::CSSContentDistributionValue::customCSSText):
1887         * css/CSSPrimitiveValueMappings.h:
1888         (WebCore::CSSPrimitiveValue::operator ItemPosition):
1889         (WebCore::CSSPrimitiveValue::operator ContentPosition):
1890         * css/CSSValueKeywords.in:
1891         * css/parser/CSSPropertyParser.cpp:
1892         (WebCore::isBaselineKeyword):
1893         (WebCore::consumeBaselineKeyword):
1894         (WebCore::consumeContentDistributionOverflowPosition):
1895         (WebCore::consumeSelfPositionOverflowPosition):
1896
1897 2017-03-30  James Craig  <jcraig@apple.com>
1898
1899         AX: Expose a new AXSubrole for explicit ARIA "group" role
1900         https://bugs.webkit.org/show_bug.cgi?id=169810
1901         <rdar://problem/31039693>
1902
1903         Reviewed by Chris Fleizach.
1904
1905         Split GroupRole into generics (GroupRole) and explicit groups 
1906         (ApplicationGroupRole) so we can expose a subrole on the explicit 
1907         groups. Account for the change in ARIA Tree and Menu hierachies. 
1908         Update the computedRoleValue for WebKit Inspector usage, too.
1909
1910         Updated existing tests.
1911
1912         Test: accessibility/list-detection2.html:
1913         Test: accessibility/roles-computedRoleString.html:
1914         Test: inspector/dom/getAccessibilityPropertiesForNode.html:
1915         Test: inspector/dom/highlightFrame.html:
1916         Test: inspector/dom/highlightSelector.html:
1917
1918         * accessibility/AccessibilityNodeObject.cpp:
1919         (WebCore::AccessibilityNodeObject::helpText):
1920         (WebCore::AccessibilityNodeObject::hierarchicalLevel):
1921         (WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent):
1922         * accessibility/AccessibilityObject.cpp:
1923         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent):
1924         (WebCore::AccessibilityObject::ariaTreeItemContent):
1925         (WebCore::initializeRoleMap):
1926         (WebCore::AccessibilityObject::computedRoleString):
1927         * accessibility/AccessibilityObject.h:
1928         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1929         (atkRole):
1930         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1931         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
1932         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1933         (createAccessibilityRoleMap):
1934         (-[WebAccessibilityObjectWrapper subrole]):
1935
1936 2017-03-30  Chris Dumez  <cdumez@apple.com>
1937
1938         We are spending a lot of time bzero'ing AudioChannel buffers on uni-watch.com
1939         https://bugs.webkit.org/show_bug.cgi?id=170288
1940         <rdar://problem/31289132>
1941
1942         Reviewed by Eric Carlson.
1943
1944         We are spending a lot of time bzero'ing AudioChannel buffers on uni-watch.com due
1945         to doubleclick ads using WebAudio with a 0-gain GainNode. We should optimize the
1946         0-gain case as much as possible.
1947
1948         No new tests, only an optimization.
1949
1950         * Modules/webaudio/AudioNode.cpp:
1951         (WebCore::AudioNode::processIfNecessary):
1952         Drop call to unsilenceOutputs() before calling AudioNode::process(). The AudioChannel
1953         API already takes care of clearing its 'silent' flag whenever its buffer changes so
1954         there should be no need to explicitly clearing the 'silent' flag before calling
1955         process(). This was causing us to zero out buffers that were already filled with
1956         zeros because AudioChannel::zero() would no longer return early, not knowing the
1957         channel is already silent. This reduces the number of bzero() calls by ~3.5x on
1958         uni-watch.com (from 100 calls every ~20ms to 100 calls every ~70ms.
1959
1960         * Modules/webaudio/AudioNode.h:
1961         * platform/audio/mac/AudioDestinationMac.cpp:
1962         (WebCore::AudioDestinationMac::render):
1963         Avoid clamping the values in the channel buffer if the channel is silent since this
1964         will have no effect (given that the buffer only contains zeros).
1965
1966 2017-03-30  Eric Carlson  <eric.carlson@apple.com>
1967
1968         [Crash] WebCore::AudioBuffer::AudioBuffer don't checking illegal value
1969         https://bugs.webkit.org/show_bug.cgi?id=169956
1970
1971         Reviewed by Youenn Fablet.
1972
1973         Test: webaudio/audiobuffer-crash.html
1974
1975         * Modules/webaudio/AudioBuffer.cpp:
1976         (WebCore::AudioBuffer::AudioBuffer): Invalidate the object and return early if the channel 
1977         array allocation fails.
1978         (WebCore::AudioBuffer::AudioBuffer): Ditto.
1979         (WebCore::AudioBuffer::invalidate): Invalidate the object.
1980         * Modules/webaudio/AudioBuffer.h:
1981
1982 2017-03-30  Antoine Quint  <graouts@apple.com>
1983
1984         [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
1985         https://bugs.webkit.org/show_bug.cgi?id=168409
1986         <rdar://problem/30799198>
1987
1988         Unreview. Print the backtrace when we suspend scripted animations.
1989
1990         * page/Page.cpp:
1991         (WebCore::Page::suspendScriptedAnimations):
1992
1993 2017-03-30  Antoine Quint  <graouts@apple.com>
1994
1995         [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
1996         https://bugs.webkit.org/show_bug.cgi?id=168409
1997         <rdar://problem/30799198>
1998
1999         Unreview. Pring the backtrace when we suspend ScriptedAnimationController.
2000
2001         * dom/ScriptedAnimationController.cpp:
2002         (WebCore::ScriptedAnimationController::suspend):
2003
2004 2017-03-30  Antoine Quint  <graouts@apple.com>
2005
2006         [Modern Media Controls] Invalid placard icon is not visible for short video
2007         https://bugs.webkit.org/show_bug.cgi?id=170277
2008         <rdar://problem/31327955>
2009
2010         Reviewed by Eric Carlson.
2011
2012         Make the minimum dimension needed to display a placard icon configurable and let the
2013         invalid placard use a 50pt dimension. We also make a drive-by fix to reset "text-align"
2014         for media controls as having a "text-align: center" inherited value would mess up
2015         positioning of the placard icon and make it flush to the right of the placard.
2016
2017         Test: media/modern-media-controls/invalid-placard/invalid-placard-constrained-metrics.html
2018
2019         * Modules/modern-media-controls/controls/invalid-placard.js:
2020         (InvalidPlacard):
2021         * Modules/modern-media-controls/controls/media-controls.css:
2022         (.media-controls):
2023         * Modules/modern-media-controls/controls/placard.js:
2024         (Placard.prototype.layout):
2025
2026 2017-03-30  Zan Dobersek  <zdobersek@igalia.com>
2027
2028         [GCrypt] Register missing algorithms in CryptoAlgorithmRegistry::platformRegisterAlgoritmhs()
2029         https://bugs.webkit.org/show_bug.cgi?id=170273
2030
2031         Reviewed by Michael Catanzaro.
2032
2033         * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
2034         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
2035         Add registerAlgorithm<> calls for AES_CFB, AES_GCM, ECDH and
2036         PBKDF2 algorithms.
2037
2038 2017-03-30  Brent Fulgham  <bfulgham@apple.com>
2039
2040         Remove unused MediaControlsApple implementation
2041         https://bugs.webkit.org/show_bug.cgi?id=170258
2042         <rdar://problem/31331056>
2043
2044         Reviewed by Eric Carlson.
2045
2046         Remove dead code related to old media controls. We switched to HTML5-based media controls
2047         several years ago.
2048
2049         No new tests. Removing this dead code should have no change in behavior.
2050
2051         * WebCore.xcodeproj/project.pbxproj: Remove unused files.
2052         * dom/EventListener.h: Remove unused event type.
2053         * html/shadow/MediaControlsApple.cpp: Removed.
2054         * html/shadow/MediaControlsApple.h: Removed.
2055
2056 2017-03-30  Fujii Hironori  <Hironori.Fujii@sony.com>
2057
2058         [WinCairo] ImageCairoWin.cpp: error C2660: 'WebCore::BitmapImage::draw': function does not take 6 arguments
2059         https://bugs.webkit.org/show_bug.cgi?id=170275
2060
2061         Reviewed by Said Abou-Hallawa.
2062
2063         Apply the similar change of ImageCGWin.cpp of r214450 to ImageCairoWin.cpp.
2064
2065         * platform/graphics/win/ImageCairoWin.cpp:
2066         (WebCore::BitmapImage::getHBITMAPOfSize): Pass DecodingMode::Synchronous to Image::draw().
2067         (WebCore::BitmapImage::drawFrameMatchingSourceSize): Ditto.
2068
2069 2017-03-27  Sergio Villar Senin  <svillar@igalia.com>
2070
2071         [css-grid] Clamp the number of autorepeat tracks
2072         https://bugs.webkit.org/show_bug.cgi?id=170120
2073
2074         Reviewed by Manuel Rego Casasnovas.
2075
2076         As suggested by the specs we do clamp the maximum number of tracks per grid in order to
2077         minimize potential OOM situations. However we were not considering the case of the recently
2078         added auto repeat syntax. Abnormally huge values for the width/height on the grid container
2079         could lead to a number of auto repeat tracks higher than the maximum.
2080
2081         A new API was added to Internals in order to test limits without having to create huge
2082         grids. This new API allows clients to set an arbitrary limit to the number of tracks. The
2083         addition of this new API forced us to add GridPosition.cpp to the project to define the
2084         global variable we use for testing. We took the chance to move part of the implementation
2085         from the header file to the source file.
2086
2087         Last but not least, several new ASSERTs were added to Grid.cpp implementation to ensure that
2088         we do not surpass the grid track limits.
2089
2090         Test: fast/css-grid-layout/grid-auto-repeat-huge-grid.html
2091
2092         * CMakeLists.txt:
2093         * WebCore.xcodeproj/project.pbxproj:
2094         * css/parser/CSSPropertyParser.cpp:
2095         (WebCore::consumeGridTrackRepeatFunction):
2096         * rendering/Grid.cpp:
2097         (WebCore::Grid::ensureGridSize): Added ASSERT.
2098         (WebCore::Grid::setSmallestTracksStart): Ditto.
2099         (WebCore::Grid::setAutoRepeatTracks): Ditto.
2100         (WebCore::Grid::setAutoRepeatEmptyColumns): Ditto.
2101         (WebCore::Grid::setAutoRepeatEmptyRows): Ditto.
2102         * rendering/RenderGrid.cpp:
2103         (WebCore::RenderGrid::clampAutoRepeatTracks): New method.
2104         (WebCore::RenderGrid::placeItemsOnGrid): Clamp the number of auto repeat tracks before
2105         passing them to the Grid.
2106         * rendering/RenderGrid.h:
2107         * rendering/style/GridArea.h:
2108         (WebCore::GridSpan::GridSpan):
2109         * rendering/style/GridPosition.cpp: Added.
2110         (WebCore::GridPosition::setExplicitPosition):
2111         (WebCore::GridPosition::setAutoPosition):
2112         (WebCore::GridPosition::setSpanPosition):
2113         (WebCore::GridPosition::setNamedGridArea):
2114         (WebCore::GridPosition::integerPosition):
2115         (WebCore::GridPosition::namedGridLine):
2116         (WebCore::GridPosition::spanPosition):
2117         (WebCore::GridPosition::operator==):
2118         * rendering/style/GridPosition.h:
2119         (WebCore::GridPosition::shouldBeResolvedAgainstOppositePosition):
2120         (WebCore::GridPosition::max):
2121         (WebCore::GridPosition::min):
2122         (WebCore::GridPosition::setMaxPositionForTesting):
2123         (WebCore::GridPosition::setExplicitPosition): Deleted.
2124         (WebCore::GridPosition::setAutoPosition): Deleted.
2125         (WebCore::GridPosition::setSpanPosition): Deleted.
2126         (WebCore::GridPosition::setNamedGridArea): Deleted.
2127         (WebCore::GridPosition::integerPosition): Deleted.
2128         (WebCore::GridPosition::namedGridLine): Deleted.
2129         (WebCore::GridPosition::spanPosition): Deleted.
2130         (WebCore::GridPosition::operator==): Deleted.
2131         * rendering/style/GridPositionsResolver.cpp:
2132         (WebCore::GridPositionsResolver::explicitGridColumnCount):
2133         (WebCore::GridPositionsResolver::explicitGridRowCount):
2134         * testing/Internals.cpp:
2135         (WebCore::Internals::setGridMaxTracksLimit):
2136         * testing/Internals.h:
2137         * testing/Internals.idl:
2138
2139 2017-03-29  Ryosuke Niwa  <rniwa@webkit.org>
2140
2141         Disconnecting a HTMLObjectElement does not always unload its content document
2142         https://bugs.webkit.org/show_bug.cgi?id=169606
2143
2144         Reviewed by Andy Estes.
2145
2146         When removing a node, we first disconnect all subframes then update the focused element as we remove each child.
2147         However, when the removed element is a focused object element with a content document, removeFocusedNodeOfSubtree
2148         can update the style tree synchronously inside Document::setFocusedElement, and reload the document.
2149
2150         Avoid this by instantiating a SubframeLoadingDisabler on the parent of the focused element.
2151
2152         Test: fast/dom/removing-focused-object-element.html
2153
2154         * dom/Document.cpp:
2155         (WebCore::Document::removeFocusedNodeOfSubtree):
2156
2157 2017-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
2158
2159         Migrate to kCTFontCSSWidthAttribute
2160         https://bugs.webkit.org/show_bug.cgi?id=170265
2161
2162         Reviewed by Darin Adler.
2163
2164         Previously, we were mapping from Core Text widths to CSS widths in WebKit.
2165         However, on some OSes, Core Text can directly tell us what the CSS width
2166         value is.
2167
2168         No new tests because there is no behavior change.
2169
2170         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2171         (WebCore::getCSSAttribute):
2172         (WebCore::capabilitiesForFontDescriptor):
2173         * platform/spi/cocoa/CoreTextSPI.h:
2174
2175 2017-03-28  Simon Fraser  <simon.fraser@apple.com>
2176
2177         Make it possible to dump touch event regions for testing
2178         https://bugs.webkit.org/show_bug.cgi?id=170209
2179         <rdar://problem/31309258>
2180
2181         Reviewed by Tim Horton.
2182
2183         Expose internals.touchEventRectsForEvent() and internals.passiveTouchEventListenerRects(), which
2184         fetch data via Page.
2185
2186         Because the regions are normally updated on a timer, we have to force an eager update via Document::updateTouchEventRegions().
2187
2188         Test: fast/events/touch/ios/touch-event-regions.html
2189
2190         * page/Page.cpp:
2191         (WebCore::Page::nonFastScrollableRects):
2192         (WebCore::Page::touchEventRectsForEvent):
2193         (WebCore::Page::passiveTouchEventListenerRects):
2194         * page/Page.h:
2195         * testing/Internals.cpp:
2196         (WebCore::Internals::touchEventRectsForEvent):
2197         (WebCore::Internals::passiveTouchEventListenerRects):
2198         * testing/Internals.h:
2199         * testing/Internals.idl:
2200
2201 2017-03-29  Zalan Bujtas  <zalan@apple.com>
2202
2203         RenderBlockFlow::addFloatsToNewParent should check if float is already added to the object list.
2204         https://bugs.webkit.org/show_bug.cgi?id=170259
2205         <rdar://problem/31300584>
2206
2207         Reviewed by Simon Fraser.
2208
2209         r210145 assumed that m_floatingObjects would simply ignore the floating box if it was already in the list.  
2210
2211         Test: fast/block/float/placing-multiple-floats-crash.html
2212
2213         * rendering/RenderBlockFlow.cpp:
2214         (WebCore::RenderBlockFlow::addFloatsToNewParent):
2215
2216 2017-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
2217
2218         Try to normalize variation ranges
2219         https://bugs.webkit.org/show_bug.cgi?id=170119
2220
2221         Unreviewed.
2222
2223         Addressing post-review comment.
2224
2225         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2226         (WebCore::isGXVariableFont):
2227
2228 2017-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
2229
2230         Try to normalize variation ranges
2231         https://bugs.webkit.org/show_bug.cgi?id=170119
2232
2233         Reviewed by Simon Fraser.
2234
2235         TrueType GX-style variation fonts use one particular scale for values on their
2236         weight/width/slope axes - usually the values lie between -1 and 1 on that scale.
2237         However, OpenType 1.8-style fonts use the CSS scale for values on these axes.
2238         For the purposes of font selection, these values need to lie on the same scale.
2239         However, when font selection is completed and the variation values are actually
2240         being applied to the fonts, values which lie on the font's actual scale need to
2241         be applied. This patch adds normalize*() and denormalize*() functions to perform
2242         both of these operations. 
2243
2244         The conversion itself between the two scales isn't an exact mapping. Mapping
2245         slope is just a linear relationship with 0deg <=> 0 and 20deg <=> 1 (as per the
2246         CSS Fonts spec). Mapping widths is similar, it uses a 2-component piecewise
2247         linear relationship which includes the values given in the Microsoft OpenType
2248         spec for the OS/2 table's usWidthClass field. Weights are more difficult, so I
2249         plotted the CSS weights and the GX-style weights for every style of San
2250         Francisco, saw that the relationship appears to be linear, and ran a linear
2251         regression to compute the line equation.
2252
2253         As for the actual discrimination of determining whether a font is a GX-style
2254         font or not, we can use the presence of the 'STAT' table. This table didn't
2255         exist when GX fonts were being created, and OpenType 1.8 variable fonts are
2256         required to have this table.
2257
2258         Facebook uses the string ".SFNSText" in their @font-face blocks. This font is
2259         a variation font, but uses the GX-style values. Facebook asks us to create
2260         this font with a weight of 700, and because the values in the font are around
2261         1.0, we were erroneously thinking that the font wasn't bold, so we were then
2262         applying synthetic bold. This was causing text on facebook to look fuzzy and
2263         ugly.
2264
2265         Test: fast/text/variations/font-selection-properties-expected.html
2266
2267         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2268         (WebCore::isGXVariableFont):
2269         (WebCore::normalizeWeight):
2270         (WebCore::normalizeSlope):
2271         (WebCore::denormalizeWeight):
2272         (WebCore::denormalizeWidth):
2273         (WebCore::denormalizeSlope):
2274         (WebCore::normalizeWidth):
2275         (WebCore::preparePlatformFont): Instead of using FontSelectionValues for the
2276         intermediate values, we should use floats instead. This is because
2277         FontSelectionValues are fixed-point numbers with the denominator having 2 bits.
2278         When using this data type to represent values on the GX scale, which are usually
2279         between 0 and 1, you lose a lot of fidelity. Instead, our intermediate
2280         calculations should be done with floats, and converted to FontSelectionValues at
2281         the end when they are representative of values on the CSS scale.
2282         (WebCore::stretchFromCoreTextTraits):
2283         (WebCore::fontWeightFromCoreText):
2284         (WebCore::extractVariationBounds):
2285         (WebCore::variationCapabilitiesForFontDescriptor):
2286         (WebCore::capabilitiesForFontDescriptor):
2287
2288 2017-03-29  Saam Barati  <sbarati@apple.com>
2289
2290         LinkBuffer and ExecutableAllocator shouldn't have anything to do with VM
2291         https://bugs.webkit.org/show_bug.cgi?id=170210
2292
2293         Reviewed by Mark Lam.
2294
2295         * cssjit/SelectorCompiler.cpp:
2296         (WebCore::SelectorCompiler::compileSelector):
2297         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
2298
2299 2017-03-29  Javier Fernandez  <jfernandez@igalia.com>
2300
2301         [css-align] Adapt self-alignment properties to the new baseline syntax
2302         https://bugs.webkit.org/show_bug.cgi?id=170235
2303
2304         Reviewed by David Hyatt.
2305
2306         The baseline-position syntax has changed recently, so we need to update
2307         the CSS properties using the old syntax. This patch address only the
2308         self-alignment (align-self and justify-self) and default-alignment
2309         (align-items and justify-items).
2310
2311         The content-distribution properties (align-content and justify-content)
2312         will be updated in a follow up patch.
2313
2314         The new baseline syntax is "[first | last ]? baseline" which implies
2315         modifying the parsing and computed value logic.
2316
2317         There are several layout tests affected by this change, so I'll update
2318         them accordingly.
2319
2320         No new tests, just added/modified some cases to the tests we already have using the new baseline values.
2321
2322         * css/CSSComputedStyleDeclaration.cpp:
2323         (WebCore::valueForItemPositionWithOverflowAlignment):
2324         * css/CSSValueKeywords.in:
2325         * css/StyleBuilderConverter.h:
2326         (WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
2327         * css/parser/CSSPropertyParser.cpp:
2328         (WebCore::consumeBaselineKeyword):
2329         (WebCore::consumeSelfPositionOverflowPosition):
2330
2331 2017-03-29  Chris Dumez  <cdumez@apple.com>
2332
2333         Animated SVG images are not paused in pages loaded in the background
2334         https://bugs.webkit.org/show_bug.cgi?id=170043
2335         <rdar://problem/31234412>
2336
2337         Reviewed by Simon Fraser.
2338
2339         Animated SVG images are not paused in pages loaded in the background. We rely
2340         on FrameView::isOffscreen() to stop images animations in background tab (See
2341         logic in RenderElement's shouldRepaintForImageAnimation()). This works fine
2342         if a tab is visble and then becomes hidden (i.e. by switching to another
2343         tab). However, in the case where the tab gets loaded while in the background
2344         (e.g. opening link in new background tab, or session restore), then the
2345         animations would not be paused, due to FrameView::isOffscreen() erroneously
2346         returning false in this case.
2347
2348         Normally, the following chain of events happens:
2349         - Page is visible, we construct a main frame and its FrameView for loading
2350           the page. When a FrameView is constructed, we call FrameView::show() to
2351           make it visible. Then, if the page becomes non-visible, we call
2352           Page::setIsVisibleInternal(false) which calls FrameView::hide(). After
2353           that, FrameView::isOffscreen() correctly returns true because we properly
2354           called FrameView::hide().
2355
2356         However, when doing a load while the Page is hidden, the following was
2357         happening:
2358         - Page is not visible, we call Page::setIsVisibleInternal(false) which tries
2359           to call FrameView::hide() for the main frame but it does not have a FrameView
2360           yet (because the load has not started). We start the load and end up creating
2361           a FrameView. The FrameView constructor was calling FrameView::show()
2362           unconditionally, thus making the FrameView think is visible, even though its
2363           page isn't. At this point, FrameView::isOffscreen() was returning false
2364           and animations would keep running, even though the page is not visible.
2365
2366         To address the issue, we now call FrameView::show() in FrameView::create() only
2367         if the Page is actually visible, instead of calling it unconditionally. If the
2368         page ever becomes visible, Page::setIsVisibleInternal(true) will be called and
2369         it will take care of calling FrameView::show() then.
2370
2371         Tests: svg/animations/animations-paused-in-background-page-iframe.html
2372                svg/animations/animations-paused-in-background-page.html
2373
2374         * page/FrameView.cpp:
2375         (WebCore::FrameView::create):
2376
2377 2017-03-29  Wenson Hsieh  <wenson_hsieh@apple.com>
2378
2379         Links with empty hrefs should not be drag sources
2380         https://bugs.webkit.org/show_bug.cgi?id=170241
2381         <rdar://problem/31305505>
2382
2383         Reviewed by Tim Horton.
2384
2385         The m_dragSouceAction member of DragController represents the drag source actions that are available to the
2386         document, rather than the available actions given the dragging element. Thus, it is not correct to only check
2387         that (m_dragSourceAction & DragSourceActionAttachment) before proceeding down the attachment dragging codepath.
2388         This should be additionally guarded with a check that the element being dragged is, in fact, an attachment
2389         element.
2390
2391         New API test (see Tools/ChangeLog).
2392
2393         * page/DragController.cpp:
2394         (WebCore::DragController::startDrag):
2395
2396 2017-03-29  Jeremy Jones  <jeremyj@apple.com>
2397
2398         WebVideoFullscreenInterfaceAVKit needs a strong self ref before dispatching to the main thread.
2399         https://bugs.webkit.org/show_bug.cgi?id=170129
2400
2401         Reviewed by David Kilzer.
2402
2403         No new tests becuase no new behavior.
2404
2405         Hold a strong reference to WebVideoFullscreenInterfaceAVKit when dispatching to the main thread.
2406         Make WebVideoFullscreenInterfaceAVKit safe to retain from non-main thread.
2407
2408         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
2409         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2410         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
2411
2412 2017-03-29  Zan Dobersek  <zdobersek@igalia.com>
2413
2414         [GCrypt] Add a Handle<> class to help with GCrypt object lifetime control
2415         https://bugs.webkit.org/show_bug.cgi?id=170238
2416
2417         Reviewed by Michael Catanzaro.
2418
2419         The platform-specific CryptoAlgorithmHMAC implementation is modified
2420         to showcase the GCrypt::Handle<> use. HandleDeleter<gcry_mac_hd_t>
2421         is added accordingly.
2422
2423         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
2424         (WebCore::calculateSignature):
2425
2426 2017-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
2427
2428         Variation fonts: Make sure that feature detection and preprocessor macros are right
2429         https://bugs.webkit.org/show_bug.cgi?id=169518
2430
2431         Reviewed by Simon Fraser.
2432
2433         When I added variable fonts support, I made all OSes parse the newly accepted values,
2434         instead of just the OSes which support variable fonts.
2435
2436         Test: fast/text/font-variations-feature-detection.html
2437
2438         * css/parser/CSSPropertyParser.cpp:
2439         (WebCore::consumeFontStretch):
2440         (WebCore::consumeFontStyle):
2441         * css/parser/CSSPropertyParserHelpers.cpp:
2442         (WebCore::CSSPropertyParserHelpers::divisibleBy100):
2443         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
2444
2445 2017-03-29  Antoine Quint  <graouts@apple.com>
2446
2447         [Modern Media Controls] Controls bar may disappear while captions menu is visible (redux)
2448         https://bugs.webkit.org/show_bug.cgi?id=170239
2449         <rdar://problem/31320685>
2450
2451         Reviewed by Dean Jackson.
2452
2453         We did some work in webkit.org/b/168751 to prevent the controls bar from disappearing while the
2454         captions menu is visible. But there were two cases where the behavior was not as intended:
2455
2456             1. the controls bar would hide upon exiting the video.
2457             2. clicking on the controls bar while the caption panel is up would hide the controls bar
2458                as well as the captions panel.
2459
2460         Instead of determining that the "userInteractionEnabled" property being set to "false" is indicative
2461         of secondary UI, such as the tracks panel, being attached to the controls bar, we now have an
2462         explicit property to specify this. Now, when "hasSecondaryUIAttached" is "true", we prevent the
2463         controls bar from fading when exiting the media.
2464
2465         Additionally, when dismissing the tracks panel, we check whether a mouse event lead to this and check
2466         if the mouse was positioned over the controls bar. If that is the case, we no longer hide the controls
2467         bar and only dismiss the tracks panel.
2468
2469         Test: media/modern-media-controls/tracks-panel/tracks-panel-controls-bar-remains-visible-after-clicking-over-it.html
2470
2471         * Modules/modern-media-controls/controls/controls-bar.js:
2472         (ControlsBar.prototype.set userInteractionEnabled):
2473         (ControlsBar.prototype.handleEvent):
2474         (ControlsBar.prototype._autoHideTimerFired):
2475         * Modules/modern-media-controls/controls/macos-media-controls.js:
2476         (MacOSMediaControls.prototype.showTracksPanel):
2477         (MacOSMediaControls.prototype.hideTracksPanel):
2478
2479 2017-03-29  Antoine Quint  <graouts@apple.com>
2480
2481         [Modern Media Controls] Volume slider is initially empty
2482         https://bugs.webkit.org/show_bug.cgi?id=170237
2483         <rdar://problem/31319077>
2484
2485         Reviewed by Dean Jackson.
2486
2487         Fixing fallout from https://bugs.webkit.org/show_bug.cgi?id=167935 where we changed the behavior
2488         of layout() to happen prior to a commit. In this one instance, we were overriding layout() to run
2489         after a commit, so we now override commit(). Otherwise, the <canvas> that we draw the volume slider
2490         into would have its "width" and "height" properties set after we drew, which would clear the <canvas>.
2491
2492         * Modules/modern-media-controls/controls/slider.js:
2493         (Slider.prototype.commit):
2494         (Slider.prototype.layout): Deleted.
2495
2496 2017-03-29  Zan Dobersek  <zdobersek@igalia.com>
2497
2498         [GCrypt] Move over empty GnuTLS-based SUBTLE_CRYPTO implementation files
2499         https://bugs.webkit.org/show_bug.cgi?id=170232
2500
2501         Reviewed by Michael Catanzaro.
2502
2503         Migrate the GnuTLS SUBTLE_CRYPTO implementation files to the gcrypt/
2504         directory. The implementation files themselves are no-op, so this is
2505         a simple move-and-rename operation that will enable proceeding with
2506         the libgcrypt-based implementation of SUBTLE_CRYPTO functionality.
2507
2508         No change in behavior. The SUBTLE_CRYPTO feature should build as it
2509         did before, and the implementations are empty anyway.
2510
2511         * PlatformGTK.cmake:
2512         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp.
2513         * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_CFBGnuTLS.cpp.
2514         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_GCMGnuTLS.cpp.
2515         * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp.
2516         * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmECDHGnuTLS.cpp.
2517         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmPBKDF2GnuTLS.cpp.
2518         * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp.
2519         * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp: This one already exists.
2520         * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp.
2521         * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRegistryGnuTLS.cpp.
2522         * crypto/gcrypt/CryptoKeyECGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoKeyECGnuTLS.cpp.
2523         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoKeyRSAGnuTLS.cpp.
2524         * crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/SerializedCryptoKeyWrapGnuTLS.cpp.
2525         * crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp: Removed.
2526
2527 2017-03-29  Zan Dobersek  <zdobersek@igalia.com>
2528
2529         [GnuTLS] Remove unused CryptoDigestGnuTLS, CryptoAlgorithmHMACGnuTLS implementation files
2530         https://bugs.webkit.org/show_bug.cgi?id=170231
2531
2532         Reviewed by Michael Catanzaro.
2533
2534         * crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp: Removed. The GCrypt counterpart
2535         is already in use, and this file wasn't even being built.
2536
2537 2017-03-29  Youenn Fablet  <youenn@apple.com>
2538
2539         Move DTMF WebRTC extension behind its own compile flag
2540         https://bugs.webkit.org/show_bug.cgi?id=170226
2541
2542         Reviewed by Eric Carlson.
2543
2544         Moving RTCDTMFSender and RTCDTMFToneChangeEvent behinf a WEB_RTC_DTMF compile flag.
2545         This compile flag is not set on any supported platform yet.
2546         Disabling related test and updated test expectations.
2547
2548         * Modules/mediastream/RTCDTMFSender.cpp:
2549         * Modules/mediastream/RTCDTMFSender.h:
2550         * Modules/mediastream/RTCDTMFSender.idl:
2551         * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
2552         * Modules/mediastream/RTCDTMFToneChangeEvent.h:
2553         * Modules/mediastream/RTCDTMFToneChangeEvent.idl:
2554         * dom/EventNames.in:
2555         * dom/EventTargetFactory.in:
2556         * platform/mediastream/RTCDTMFSenderHandler.h:
2557         * platform/mediastream/RTCDTMFSenderHandlerClient.h:
2558
2559 2017-03-29  Antoine Quint  <graouts@apple.com>
2560
2561         [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
2562         https://bugs.webkit.org/show_bug.cgi?id=168409
2563         <rdar://problem/30799198>
2564
2565         Reviewed by Dean Jackson.
2566
2567         Add a new internals setting to opt into ScriptedAnimationController logging through DOM events dispatched
2568         through the document. This should allow this flaky test to get information as to why the frame isn't
2569         firing when it times out.
2570
2571         * dom/ScriptedAnimationController.cpp:
2572         (WebCore::ScriptedAnimationController::suspend):
2573         (WebCore::ScriptedAnimationController::resume):
2574         (WebCore::ScriptedAnimationController::addThrottlingReason):
2575         (WebCore::ScriptedAnimationController::removeThrottlingReason):
2576         (WebCore::ScriptedAnimationController::registerCallback):
2577         (WebCore::ScriptedAnimationController::cancelCallback):
2578         (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
2579         (WebCore::ScriptedAnimationController::scheduleAnimation):
2580         (WebCore::ScriptedAnimationController::dispatchLoggingEventIfRequired):
2581         * dom/ScriptedAnimationController.h:
2582         * page/Settings.in:
2583         * testing/InternalSettings.cpp:
2584         (WebCore::InternalSettings::resetToConsistentState):
2585         (WebCore::InternalSettings::shouldDispatchRequestAnimationFrameEvents):
2586         (WebCore::InternalSettings::setShouldDispatchRequestAnimationFrameEvents):
2587         * testing/InternalSettings.h:
2588         * testing/InternalSettings.idl:
2589
2590 2017-03-28  Youenn Fablet  <youenn@apple.com>
2591
2592         [WebRTC] After r214441 addIceCandidate no longer accepts an RTCIceCandidateInit dictionary
2593         https://bugs.webkit.org/show_bug.cgi?id=170192
2594
2595         Reviewed by Jon Lee.
2596
2597         Covered by updated tests.
2598
2599         * Modules/mediastream/RTCIceCandidate.idl: Candidate is no longer a required field in RTCIceCandidateInit.
2600         * Modules/mediastream/RTCPeerConnectionInternals.js: Reworking defaultsToNull to handle both undefined and null cases.
2601
2602 2017-03-28  Youenn Fablet  <youenn@apple.com>
2603
2604         LibWebRTCProvider should allow setting encoder and decoder factories
2605         https://bugs.webkit.org/show_bug.cgi?id=170212
2606
2607         Reviewed by Eric Carlson.
2608
2609         No change of behavior.
2610         Adding the ability to set encoder/decoder libwebrtc factory getters.
2611         Setting default cocoa factory getters.
2612
2613         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2614         (WebCore::staticFactoryAndThreads):
2615         (WebCore::initializePeerConnectionFactoryAndThreads):
2616         (WebCore::LibWebRTCProvider::setDecoderFactoryGetter):
2617         (WebCore::LibWebRTCProvider::setEncoderFactoryGetter):
2618         (WebCore::LibWebRTCProvider::setPeerConnectionFactory):
2619         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2620
2621 2017-03-27  Brent Fulgham  <bfulgham@apple.com>
2622
2623         Only attach Attributes to a given element one time
2624         https://bugs.webkit.org/show_bug.cgi?id=170125
2625         <rdar://problem/31279676>
2626
2627         Reviewed by Chris Dumez.
2628
2629         Attach the attribute node to the Element before calling 'setAttributeInternal', since that method may cause
2630         arbitrary JavaScript events to fire. 
2631
2632         Test: fast/dom/Attr/only-attach-attr-once.html
2633
2634         * dom/Element.cpp:
2635         (WebCore::Element::attachAttributeNodeIfNeeded): Added.
2636         (WebCore::Element::setAttributeNode): Use new method. Revise to attach attribute before calling 'setAttributeInternal'. 
2637         (WebCore::Element::setAttributeNodeNS): Ditto.
2638         * dom/Element.h:
2639
2640 2017-03-28  Youenn Fablet  <youenn@apple.com>
2641
2642         Stop RTCDataChannel when closing page
2643         https://bugs.webkit.org/show_bug.cgi?id=170166
2644
2645         Reviewed by Eric Carlson.
2646
2647         Test: webrtc/datachannel/datachannel-gc.html
2648
2649         Making RTCDataChannel an ActiveDOMObject.
2650         Closing the data channel backend and freeing upon close and stop.
2651
2652         * Modules/mediastream/RTCDataChannel.cpp:
2653         (WebCore::RTCDataChannel::create):
2654         (WebCore::RTCDataChannel::RTCDataChannel):
2655         (WebCore::RTCDataChannel::close):
2656         (WebCore::RTCDataChannel::stop):
2657         * Modules/mediastream/RTCDataChannel.h:
2658         * Modules/mediastream/RTCDataChannel.idl:
2659         * Modules/mediastream/RTCPeerConnection.h:
2660
2661 2017-03-28  Myles C. Maxfield  <mmaxfield@apple.com>
2662
2663         Ranges for variation font properties are not enforced
2664         https://bugs.webkit.org/show_bug.cgi?id=169979
2665
2666         Reviewed by David Hyatt.
2667
2668         The spec specifies that:
2669         - Font weights less than or equal to 0, or greater than or equal to 1000 are parse errors
2670         - Font stretch values less than or equal to 0% are parse errors
2671         - Font style values less than or equal to -90deg or greater than or equal to 90deg are parse errors
2672
2673         Test: fast/text/variations/out-of-bounds-selection-properties.html
2674
2675         * css/parser/CSSPropertyParser.cpp:
2676         (WebCore::consumeFontWeightRange):
2677         (WebCore::fontStretchIsWithinRange):
2678         (WebCore::consumeFontStretch):
2679         (WebCore::consumeFontStretchRange):
2680         (WebCore::fontStyleIsWithinRange):
2681         (WebCore::consumeFontStyle):
2682         (WebCore::consumeFontStyleRange):
2683
2684 2017-03-28  Andy Estes  <aestes@apple.com>
2685
2686         [iOS] Crash in -[WebPreviewLoader failed] when running http/tests/multipart/policy-ignore-crash.php
2687         https://bugs.webkit.org/show_bug.cgi?id=170197
2688         <rdar://problem/30314067>
2689
2690         Reviewed by Brady Eidson.
2691
2692         If QuickLook conversion fails, we call ResourceLoader::didFail() with the NSError from
2693         QuickLook, which will call back into PreviewLoader::didFail(). We only care about network
2694         failures in PreviewLoader, not conversion failures, so check if
2695         m_finishedLoadingDataIntoConverter is set before continuing (like we do in
2696         PreviewLoader::didFinishLoading()).
2697
2698         Fixes crash in http/tests/multipart/policy-ignore-crash.php.
2699
2700         * loader/ios/PreviewLoader.mm:
2701         (WebCore::PreviewLoader::didFail):
2702
2703 2017-03-28  Chris Dumez  <cdumez@apple.com>
2704
2705         Audio indicator is visible on uni-watch.com but there is no audible audio
2706         https://bugs.webkit.org/show_bug.cgi?id=170200
2707         <rdar://problem/31289132>
2708
2709         Reviewed by Eric Carlson.
2710
2711         Cherry-pick the following patch from Blink by <rtoy@chromium.org>:
2712         - https://chromium.googlesource.com/chromium/src.git/+/439de5bb2a31384666db1a0e2dadb2b97d2f3ce4
2713
2714         When the gain of a GainNode is 0 or 1, the operation of the node can
2715         be optimized.  When gain = 1, just copy the input to the output.  When
2716         gain = 0; just zero out the output.  Currently, the input is
2717         multiplied by the gain to produce the output.  This just optimizes the
2718         multiplication away for the two special cases.
2719
2720         Also, have the GainNode set the silence hint if the gain is 0.
2721
2722         And fix a bug in processIfNecessary when unsilenceOutputs was causing the
2723         silence hint to be cleared after the node's process method was finished
2724         and may have set the silence hint.  The processing should come after
2725         unsilenceOutputs to preserve any hints from processing the node.
2726
2727         * Modules/webaudio/AudioNode.cpp:
2728         (WebCore::AudioNode::processIfNecessary):
2729         * Modules/webaudio/GainNode.cpp:
2730         (WebCore::GainNode::process):
2731         * platform/audio/AudioBus.cpp:
2732         (WebCore::AudioBus::copyWithGainFrom):
2733
2734 2017-03-28  Chris Dumez  <cdumez@apple.com>
2735
2736         Animated SVG images are not paused when outside viewport
2737         https://bugs.webkit.org/show_bug.cgi?id=170155
2738         <rdar://problem/31288893>
2739
2740         Reviewed by Antti Koivisto.
2741
2742         Make sure animated SVG images get paused when outside the viewport,
2743         similarly to what was already done for animated GIF images. Also
2744         make sure they are paused when they no longer have any renderers
2745         using them.
2746
2747         Tests: svg/animations/animated-svg-image-outside-viewport-paused.html
2748                svg/animations/animated-svg-image-removed-from-document-paused.html
2749
2750         * loader/cache/CachedImage.cpp:
2751         (WebCore::CachedImage::didAddClient):
2752         Restart the animation whenever a new CachedImage client is added. This
2753         will cause us the re-evaluate if the animation should run. The animation
2754         will pause again if the new renderer is not inside the viewport.
2755
2756         (WebCore::CachedImage::animationAdvanced):
2757         Add a flag to newImageAnimationFrameAvailable() so that the renderers can
2758         let us know if we can pause the animation. Pause the animation if all no
2759         renderer requires it (i.e. they are all outside the viewport, or there
2760         are no renderers).
2761
2762         * loader/cache/CachedImageClient.h:
2763         (WebCore::CachedImageClient::newImageAnimationFrameAvailable):
2764         By default, the CachedImageClients allow pausing. Only renderer will
2765         potentially prevent pausing if they are inside the viewport.
2766
2767         * platform/graphics/BitmapImage.cpp:
2768         (WebCore::BitmapImage::isAnimating):
2769         * platform/graphics/BitmapImage.h:
2770         * platform/graphics/Image.h:
2771         (WebCore::Image::isAnimating):
2772         Add isAnimating() flag on Image for layout testing purposes.
2773
2774         * rendering/RenderElement.cpp:
2775         (WebCore::RenderElement::newImageAnimationFrameAvailable):
2776         Set canPause flag to true if the renderer is not inside the viewport.
2777
2778         (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded):
2779         Call startAnimation() if the renderer is now visible to resume SVG
2780         animations. Repainting is enough for GIF animations but not for SVG
2781         animations, we have to explicitly resume them.
2782
2783         * rendering/RenderElement.h:
2784         * rendering/RenderView.cpp:
2785         (WebCore::RenderView::addRendererWithPausedImageAnimations):
2786         (WebCore::RenderView::removeRendererWithPausedImageAnimations):
2787         (WebCore::RenderView::resumePausedImageAnimationsIfNeeded):
2788         * rendering/RenderView.h:
2789         Store CachedImages with the renderers that have paused animations.
2790         This is required for SVG where we need to explicitly resume the
2791         animation on the CachedImage when the renderer becomes visible
2792         again. Having access to the Image will also allow us to do smarter
2793         visibility checks in RenderElement's shouldRepaintForImageAnimation(),
2794         in the future.
2795
2796         * svg/SVGSVGElement.cpp:
2797         (WebCore::SVGSVGElement::hasActiveAnimation):
2798         * svg/SVGSVGElement.h:
2799         Add hasActiveAnimation() method.
2800
2801         * svg/graphics/SVGImage.cpp:
2802         (WebCore::SVGImage::startAnimation):
2803         Check that animations are paused before starting them. This avoid
2804         jumping due to unnecessary calls to rootElement->setCurrentTime(0).
2805
2806         (WebCore::SVGImage::isAnimating):
2807         Add isAnimating() method for layout tests purposes.
2808
2809         * svg/graphics/SVGImage.h:
2810         * svg/graphics/SVGImageClients.h:
2811         Call animationAdvanced() on the observer instead of the generic
2812         changedInRect() when the SVGImage is animating. This way, we go
2813         through the same code path as GIF animations and we end up calling
2814         CachedImage::animationAdvanced() which calls newImageAnimationFrameAvailable()
2815         on RenderElement, which determines if the animation should keep
2816         running or not.
2817
2818         * testing/Internals.cpp:
2819         (WebCore::Internals::isImageAnimating):
2820         * testing/Internals.h:
2821         * testing/Internals.idl:
2822         Add layout testing infrastructure.
2823
2824 2017-03-28  Antti Koivisto  <antti@apple.com>
2825
2826         Missing render tree position invalidation when tearing down renderers for display:contents subtree
2827         https://bugs.webkit.org/show_bug.cgi?id=170199
2828         <rdar://problem/31260856>
2829
2830         Reviewed by Zalan Bujtas.
2831
2832         Test: fast/shadow-dom/slot-renderer-teardown.html
2833
2834         * style/RenderTreeUpdater.cpp:
2835         (WebCore::RenderTreeUpdater::updateElementRenderer):
2836
2837             Invalidate the render tree position in case we do a teardown for an element without renderer.
2838
2839 2017-03-28  Ryan Haddad  <ryanhaddad@apple.com>
2840
2841         Unreviewed, rolling out r214485.
2842
2843         This change caused LayoutTest crashes.
2844
2845         Reverted changeset:
2846
2847         "Stop RTCDataChannel when closing page"
2848         https://bugs.webkit.org/show_bug.cgi?id=170166
2849         http://trac.webkit.org/changeset/214485
2850
2851 2017-03-28  Anders Carlsson  <andersca@apple.com>
2852
2853         ApplePayShippingContactUpdate.idl shouldn't have status field
2854         https://bugs.webkit.org/show_bug.cgi?id=170202
2855         rdar://problem/31307106
2856
2857         Reviewed by Beth Dakin.
2858
2859         * Modules/applepay/ApplePaySession.cpp:
2860         (WebCore::convertAndValidate):
2861         If status isn't set, infer it based on whether there are errors present or not.
2862
2863         * Modules/applepay/ApplePayShippingContactUpdate.h:
2864         Make status optional here; it's still used by the old code path.
2865
2866         * Modules/applepay/ApplePayShippingContactUpdate.idl:
2867         Remove status here.
2868
2869 2017-03-28  Brian Burg  <bburg@apple.com>
2870
2871         Web Inspector: Add "Disable Caches" option that only applies to the inspected page while Web Inspector is open
2872         https://bugs.webkit.org/show_bug.cgi?id=169865
2873         <rdar://problem/31250573>
2874
2875         Reviewed by Joseph Pecoraro.
2876
2877         Rewrite the network agent's command for disabling resource caching to use Page::setResourceCachingEnabled.
2878         The old implementation was doing weird stuff like setting no-cache headers and evicting the
2879         contents of the memory cache, neither of which is correct. The new approach has no side effects
2880         on the network, disk, or memory cache so it can be turned on temporarily without causing problems.
2881
2882         New tests:
2883         - http/tests/inspector/network/set-resource-caching-disabled-disk-cache.html
2884         - http/tests/inspector/network/set-resource-caching-disabled-memory-cache.html
2885
2886         * inspector/InspectorNetworkAgent.h:
2887         * inspector/InspectorNetworkAgent.cpp:
2888         (WebCore::InspectorNetworkAgent::setCacheDisabled): Deleted.
2889         (WebCore::InspectorNetworkAgent::setResourceCachingDisabled): Added.
2890         Implement new command.
2891
2892         (WebCore::InspectorNetworkAgent::willSendRequest):
2893         (WebCore::InspectorNetworkAgent::mainFrameNavigated):
2894         Remove crufty attempts to break caches. I believe these are intended to defeat caching
2895         proxies and similar middlemen, but this is just as likely to cause unusual loading behavior.
2896
2897         * page/Page.h:
2898         (WebCore::Page::isResourceCachingDisabled):
2899         (WebCore::Page::setResourceCachingDisabledOverride):
2900         Add an override setting so that Web Inspector's override does not mess up the value
2901         of isResourceCachingDisabled that may have been set by a WebKit API client.
2902
2903 2017-03-28  Youenn Fablet  <youenn@apple.com>
2904
2905         Fix addIceCandidate after r214441
2906         https://bugs.webkit.org/show_bug.cgi?id=170146
2907
2908         Reviewed by Chris Dumez.
2909
2910         Covered by rebased test.
2911
2912         * Modules/mediastream/RTCPeerConnection.js:
2913         (addIceCandidate): Setting function length to 1 and throwing if no parameter is passed.
2914
2915 2017-03-28  Youenn Fablet  <youenn@apple.com>
2916
2917         Stop RTCDataChannel when closing page
2918         https://bugs.webkit.org/show_bug.cgi?id=170166
2919
2920         Reviewed by Eric Carlson.
2921
2922         Test: webrtc/datachannel/datachannel-gc.html
2923
2924         Making RTCDataChannel an ActiveDOMObject.
2925         Closing the data channel backend and freeing upon close and stop.
2926
2927         * Modules/mediastream/RTCDataChannel.cpp:
2928         (WebCore::RTCDataChannel::create):
2929         (WebCore::RTCDataChannel::RTCDataChannel):
2930         (WebCore::RTCDataChannel::close):
2931         (WebCore::RTCDataChannel::stop):
2932         * Modules/mediastream/RTCDataChannel.h:
2933         * Modules/mediastream/RTCDataChannel.idl:
2934         * Modules/mediastream/RTCPeerConnection.h:
2935
2936 2017-03-27  Simon Fraser  <simon.fraser@apple.com>
2937
2938         Enhance the touch region debug overlay to show regions for the different events
2939         https://bugs.webkit.org/show_bug.cgi?id=170162
2940
2941         Reviewed by Tim Horton.
2942
2943         Have NonFastScrollableRegionOverlay use a different color for each region in EventTrackingRegions,
2944         and to draw a legend showing what the colors mean.
2945         
2946         On Mac, this overlay displays the non-fast scrollable region (which we don't keep separate from the wheel event
2947         region).
2948
2949         * page/DebugPageOverlays.cpp:
2950         (WebCore::NonFastScrollableRegionOverlay::updateRegion):
2951         (WebCore::touchEventRegionColors):
2952         (WebCore::drawRightAlignedText):
2953         (WebCore::NonFastScrollableRegionOverlay::drawRect):
2954         (WebCore::RegionOverlay::drawRect):
2955         (WebCore::RegionOverlay::drawRegion):
2956
2957 2017-03-27  Simon Fraser  <simon.fraser@apple.com>
2958
2959         Make sure the non-fast scrolling debug overlay is correctly updated
2960         https://bugs.webkit.org/show_bug.cgi?id=170142
2961
2962         Reviewed by Tim Horton.
2963
2964         AsyncScrollingCoordinator::frameViewEventTrackingRegionsChanged() is called on a timer
2965         from Document code, so the existing DebugPageOverlays::didLayout() call at the end
2966         of FrameView::layout() wasn't sufficient to keep the non-fast scrollable region up-to-date
2967         on iOS.
2968
2969         * page/scrolling/AsyncScrollingCoordinator.cpp:
2970         (WebCore::AsyncScrollingCoordinator::frameViewEventTrackingRegionsChanged):
2971
2972 2017-03-28  Antoine Quint  <graouts@apple.com>
2973
2974         [Modern Media Controls] AirPlay placard text looks bad on 1x displays
2975         https://bugs.webkit.org/show_bug.cgi?id=170183
2976         <rdar://problem/30663416>
2977
2978         Reviewed by Dean Jackson.
2979
2980         Use subpixel antialiasing for all text in modern media controls.
2981
2982         * Modules/modern-media-controls/controls/media-controls.css:
2983         (.media-controls-container,):
2984
2985 2017-03-28  Antoine Quint  <graouts@apple.com>
2986
2987         [Modern Media Controls] Improve appearance of tracks panel on macOS
2988         https://bugs.webkit.org/show_bug.cgi?id=168929
2989         <rdar://problem/30741589>
2990
2991         Reviewed by Eric Carlson.
2992
2993         We use a solid color for the focus state that matches the style used on macOS
2994         and blend the titles the same way we blend other non-solid labels in the controls bar.
2995
2996         * Modules/modern-media-controls/controls/tracks-panel.css:
2997         (.tracks-panel section):
2998         (.tracks-panel section > h3):
2999         (.tracks-panel section > ul > li:focus):
3000
3001 2017-03-28  Yoav Weiss  <yoav@yoav.ws>
3002
3003         Add a warning for unused link preloads.
3004         https://bugs.webkit.org/show_bug.cgi?id=165670
3005
3006         Reviewed by Youenn Fablet.
3007
3008         Tests: http/tests/preload/single_download_preload_headers_charset.php
3009                http/tests/preload/unused_preload_warning.html
3010
3011         * dom/Document.cpp:
3012         (WebCore::Document::prepareForDestruction): Stop the timer once the document is destructed.
3013         * loader/LinkPreloadResourceClients.h: Add shouldMarkAsReferenced overides for the LinkPreloadResourceClient classes.
3014         * loader/cache/CachedResource.cpp:
3015         (WebCore::CachedResource::addClientToSet): Make sure LinkPreloadResourceClients don't set resource to be referenced.
3016         * loader/cache/CachedResourceClient.h:
3017         (WebCore::CachedResourceClient::shouldMarkAsReferenced): Make sure that ResourceClients mark preloads as referenced by default.
3018         * loader/cache/CachedResourceLoader.cpp:
3019         (WebCore::CachedResourceLoader::CachedResourceLoader): Initialize timer.
3020         (WebCore::CachedResourceLoader::~CachedResourceLoader): Stop timer.
3021         (WebCore::CachedResourceLoader::documentDidFinishLoadEvent): Trigger a timer if preloads weren't cleared at load time.
3022         (WebCore::CachedResourceLoader::stopUnusedPreloadsTimer): Stop the timer.
3023         (WebCore::CachedResourceLoader::warnUnusedPreloads): Iterate over m_preloads and issue a warning for non-referenced preloads.
3024         * loader/cache/CachedResourceLoader.h:
3025         * page/DOMWindow.cpp:
3026         (WebCore::DOMWindow::willDetachDocumentFromFrame): Clear Resource Timing buffer when document detaches, to avoid test flakiness.
3027
3028 2017-03-28  Antoine Quint  <graouts@apple.com>
3029
3030         REGRESSION: Double-clicking the captions button while the captions popover is open prevents the popover from being opened again
3031         https://bugs.webkit.org/show_bug.cgi?id=170171
3032         <rdar://problem/31095500>
3033
3034         Reviewed by Dean Jackson.
3035
3036         We used to consider that the tracks panel was presented as long as it had a parent, but since we were using for the animated
3037         transition to complete before actually removing the panel from the node hierarchy, consecutive calls to hide then present
3038         would fail to present the panel. We now use a private instance variable to track the presented state which is set immediately
3039         as presentInParent() and hide() are called.
3040
3041         Test: media/modern-media-controls/tracks-support/tracks-support-show-panel-then-double-click-on-tracks-button.html
3042
3043         * Modules/modern-media-controls/controls/tracks-panel.js:
3044         (TracksPanel.prototype.get presented):
3045         (TracksPanel.prototype.presentInParent):
3046         (TracksPanel.prototype.hide):
3047
3048 2017-03-28  Aaron Chu  <aaron_chu@apple.com>
3049
3050         AX: Media controls should be able to be re-activated after faded away
3051         https://bugs.webkit.org/show_bug.cgi?id=170048
3052         <rdar://problem/30157179>
3053
3054         Reviewed by Antoine Quint.
3055
3056         Added a "foucsin" listener for the controls bar so that when an element
3057         within fires a "focusin" event, the controls bar reappears if it is faded.
3058
3059         Test: media/modern-media-controls/media-controls/media-controls-appear-when-focus.html
3060
3061         * Modules/modern-media-controls/controls/controls-bar.js:
3062         (ControlsBar.prototype.handleEvent):
3063
3064 2017-03-28  Antoine Quint  <graouts@apple.com>
3065
3066         [Modern Media Controls] Improve media documents across macOS, iPhone and iPad
3067         https://bugs.webkit.org/show_bug.cgi?id=169145
3068         <rdar://problem/17048858>
3069
3070         Reviewed by Dean Jackson.
3071
3072         There were a variety of issues with media documents, some longstanding, and some specifically
3073         about modern media controls.
3074
3075         One issue was that fullscreen and picture-in-picture buttons would show for audio media documents,
3076         due to using a <video> element to load the audio file. We now have additional logic in MediaController
3077         to identify if the loaded media is really an audio file, and using this information to hide the
3078         fullscreen and picture-in-picture buttons.
3079
3080         Another issue was that we would inject style in MediaDocument.cpp that was specific to modern media
3081         controls when we could have the modern-media-controls module injected CSS handle this styling. We now
3082         use the injected style in the shadow root to size media documents based on the device characteristics
3083         and ensuring that page styles are overridden.
3084
3085         We also simplify how MediaDocument.cpp sets the source of the media element to simply use the "src"
3086         attribute and not a <source> element.
3087
3088         Finally, we introduce a MediaDocumentController class that is instantiated when we're dealing with
3089         a media document to hide the controls while we determine the type of media we're loading (audio vs.
3090         video) in order to apply the appropriate styling without flashes.
3091
3092         As a result of the new styles applied by the modern-media-controls module, media documents have a
3093         similar behavior on macOS and iPad, where we only enforce a min-width for video allowing them
3094         to play at their natural size otherwise, and enforcing a fixed width for audio. On iPhone however,
3095         we want to always play the media at full width, with some padding in the case of audio.
3096
3097         Tests: media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only.html
3098                media/modern-media-controls/media-documents/ipad/media-document-audio-ios-sizing.html
3099                media/modern-media-controls/media-documents/ipad/media-document-video-ios-sizing.html
3100                media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html
3101                media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html
3102                media/modern-media-controls/media-documents/media-document-video-ios-sizing.html
3103                media/modern-media-controls/media-documents/media-document-video-mac-sizing.html
3104                media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only.html
3105
3106         * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
3107         (:host(audio) .media-controls.ios.inline > .controls-bar:before,):
3108         (:host(audio) .media-controls.ios.inline > .controls-bar:before): Deleted.
3109         * Modules/modern-media-controls/controls/macos-media-controls.css:
3110         (:host(audio) .media-controls.mac.inline > .controls-bar,):
3111         (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint,):
3112         (:host(audio) .media-controls.mac.inline > .controls-bar): Deleted.
3113         (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint): Deleted.
3114         * Modules/modern-media-controls/controls/media-document.css: Copied from Source/WebCore/Modules/modern-media-controls/controls/macos-media-controls.css.
3115         (:host(.media-document)):
3116         (:host(.media-document.ready)):
3117         (:host(.media-document.audio.mac)):
3118         (:host(.media-document.audio.ipad)):
3119         (:host(.media-document.audio.iphone)):
3120         (:host(.media-document.video.mac)):
3121         (:host(.media-document.video.ipad)):
3122         (:host(.media-document.video.iphone)):
3123         * Modules/modern-media-controls/js-files:
3124         * Modules/modern-media-controls/media/fullscreen-support.js:
3125         (FullscreenSupport.prototype.syncControl):
3126         (FullscreenSupport):
3127         * Modules/modern-media-controls/media/media-controller.js:
3128         (MediaController):
3129         (MediaController.prototype.get isAudio):
3130         * Modules/modern-media-controls/media/media-document-controller.js: Copied from Source/WebCore/Modules/modern-media-controls/media/fullscreen-support.js.
3131         (MediaDocumentController):
3132         (MediaDocumentController.prototype.handleEvent):
3133         (MediaDocumentController.prototype._mediaDocumentHasMetadata):
3134         (MediaDocumentController.prototype._mediaDocumentHasSize):
3135         * Modules/modern-media-controls/media/pip-support.js:
3136         (PiPSupport.prototype.syncControl):
3137         (PiPSupport):
3138         * html/MediaDocument.cpp:
3139         (WebCore::MediaDocumentParser::createDocumentStructure):
3140
3141 2017-03-28  Myles C. Maxfield  <mmaxfield@apple.com>
3142
3143         Follow-up patch after r214364.
3144         https://bugs.webkit.org/show_bug.cgi?id=168895
3145
3146         Unreviewed.
3147
3148         * platform/graphics/FontDescription.cpp:
3149         (WebCore::FontDescription::FontDescription):
3150
3151 2017-03-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
3152
3153         REGRESSION(213764): Large images should not be decoded asynchronously when they are drawn on a canvas
3154         https://bugs.webkit.org/show_bug.cgi?id=169771
3155
3156         Reviewed by Simon Fraser.
3157
3158         Sometimes we have to draw the image immediately like when a canvas calls  
3159         drawImage. In this case we have to decode the image synchronously to guarantee
3160         the drawing. Other times we need to decode with the native size of the image.
3161         The animated images have to be decoded with native size always. Otherwise
3162         the frame cache will be messed up if the same image is animated with different
3163         sizes. Currently we always decode asynchronously with sizeForDrawing. We need
3164         to decouple the decoding mode from the sizeForDrawing.
3165
3166         This patch introduce the DecodingOptions class which can store and compare the
3167         following four cases:
3168             -- Synchronous: The frame has be decoded with native size only.
3169             -- Asynchronous + anySize: This is passed from the Image::draw() callers.
3170             -- Asynchronous + fullSize: The image has to be decoded with its full size.
3171             -- Asynchronous + sizeForDrawing: The image can be decoded with sizeForDrawing unless
3172             it was decoded with either a full size or sizeForDrawing which is larger than the
3173             requested sizeForDrawing.
3174             
3175         A new argument of type DecodingMode will be added to Image::draw() function.
3176         Only when the drawing comes from the render tree, it will be Asynchronous.
3177         Otherwise it will be Synchronous.
3178
3179         Tests: fast/images/animated-image-different-dest-size.html
3180                fast/images/async-image-background-image.html
3181                fast/images/async-image-canvas-draw-image.html
3182
3183         * WebCore.xcodeproj/project.pbxproj:
3184         * platform/graphics/BitmapImage.cpp:
3185         (WebCore::BitmapImage::frameImageAtIndexCacheIfNeeded): Gets the frame image, cache it synchronously if
3186         the current one is invalid. frameImageAtIndex() returns whatever stored in the cache.
3187         (WebCore::BitmapImage::nativeImage): Call frameImageAtIndexCacheIfNeeded() instead of frameImageAtIndex().
3188         (WebCore::BitmapImage::nativeImageForCurrentFrame): Ditto.
3189         (WebCore::BitmapImage::nativeImageOfSize): Ditto.
3190         (WebCore::BitmapImage::framesNativeImages): Ditto.
3191         (WebCore::BitmapImage::draw): Change the logic to do the following:
3192         -- The animated image has to be decoded with its full size.
3193         -- The animated image expects the current frame to be ready for drawing.
3194         -- The large image decoding does not need to call internalStartAnimation().
3195         -- The large image has to request async image decoding but draw the current one if it exists.
3196         (WebCore::BitmapImage::drawPattern): Draw the pattern synchronously.
3197         (WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImages): Delete the call to shouldUseAsyncDecodingForTesting()
3198         since it is only applied for animated images.
3199         (WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImages): Call shouldUseAsyncDecodingForAnimatedImageForTesting().
3200         (WebCore::BitmapImage::internalStartAnimation): Request decoding with the full size.
3201         (WebCore::BitmapImage::advanceAnimation): Call shouldUseAsyncDecodingForAnimatedImageForTesting().
3202         (WebCore::BitmapImage::internalAdvanceAnimation): Assert the current frame is not being decoding asynchronously for any size.
3203         (WebCore::BitmapImage::frameImageAtIndex): Deleted. Moved to the header file but with a new purpose: return
3204         the current frame from the frame cache as is; do not cache a new one.
3205         (WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImage): Deleted. Function was renamed to shouldUseAsyncDecodingForLargeImages.
3206         (WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImage): Deleted. Function was renamed to shouldUseAsyncDecodingForAnimatedImages.
3207         * platform/graphics/BitmapImage.h:
3208         * platform/graphics/CrossfadeGeneratedImage.cpp:
3209         (WebCore::CrossfadeGeneratedImage::draw): Add a new argument of type DecodingMode.
3210         * platform/graphics/CrossfadeGeneratedImage.h:
3211         * platform/graphics/DecodingOptions.h: Added.
3212         (WebCore::DecodingOptions::DecodingOptions): Default constructor: Synchronous mode.
3213         (WebCore::DecodingOptions::operator==): Compares two DecodingOptions for equality.
3214         (WebCore::DecodingOptions::isSynchronous): Is the frame decoded synchronously?
3215         (WebCore::DecodingOptions::isAsynchronous): Is the frame decoded asynchronously?
3216         (WebCore::DecodingOptions::isAsynchronousCompatibleWith): Is this DecodingOptions compatible with another one?
3217         (WebCore::DecodingOptions::hasFullSize): Is the decoding mode asynchronous but for the image full size?
3218         (WebCore::DecodingOptions::hasSizeForDrawing): Is this decoding mode asynchronous but for a sizeForDrawing?
3219         (WebCore::DecodingOptions::sizeForDrawing): Returns the sizeForDrawing. m_decodingModeOrSize has to hold an IntSize.
3220         (WebCore::DecodingOptions::maxDimension): Moved form ImageFrame.cpp.
3221         (WebCore::DecodingOptions::has): A helper function.
3222         (WebCore::DecodingOptions::hasDecodingMode): Does m_decodingModeOrSize a DecodingMode?
3223         (WebCore::DecodingOptions::hasSize): Does m_decodingModeOrSize an IntSize?
3224         * platform/graphics/GeneratedImage.h: Add a new argument of type DecodingMode.
3225         * platform/graphics/GradientImage.cpp:
3226         (WebCore::GradientImage::draw): Ditto.
3227         * platform/graphics/GradientImage.h: Ditto.
3228         * platform/graphics/GraphicsContext.cpp:
3229         (WebCore::GraphicsContext::drawImage): Pass the ImagePaintingOptions::m_DecodingMode to Image::draw().
3230         * platform/graphics/GraphicsContext.h:
3231         (WebCore::ImagePaintingOptions::ImagePaintingOptions): Add a new member of type DecodingMode to ImagePaintingOptions.
3232         * platform/graphics/Image.cpp:
3233         (WebCore::Image::drawTiled): Pass DecodingMode::Synchronous to Image::draw().
3234         * platform/graphics/Image.h: Add a new argument of type DecodingMode to Image::draw().
3235         * platform/graphics/ImageFrame.cpp:
3236         (WebCore::ImageFrame::operator=): Replace m_sizeForDrawing by m_decodingOptions.
3237         (WebCore::ImageFrame::hasNativeImage): Check if m_nativeImage is valid and the subsamplingLevels match.
3238         (WebCore::ImageFrame::hasFullSizeNativeImage): Checks hasNativeImage() and whether the image frame was
3239         decoded for the image full size.
3240         (WebCore::ImageFrame::hasDecodedNativeImageCompatibleWithOptions): Checks hasNativeImage() and the DecodingOptions match.
3241         (WebCore::maxDimension): Deleted. Moved to DecodingOptions.h.
3242         (WebCore::ImageFrame::isBeingDecoded): Deleted. The check for having an ImageFrame being decoded is
3243         moved to ImageFrameCache.
3244         (WebCore::ImageFrame::hasValidNativeImage): Deleted. No need to this function.
3245         * platform/graphics/ImageFrame.h:
3246         (WebCore::ImageFrame::hasNativeImage): Add an std::optional<SubsamplingLevel> argument.
3247         (WebCore::ImageFrame::hasFullSizeNativeImage): Checks whether the ImageFrame was decoded for the image full size.
3248         (WebCore::ImageFrame::enqueueSizeForDecoding): Deleted.
3249         (WebCore::ImageFrame::dequeueSizeForDecoding): Deleted.
3250         (WebCore::ImageFrame::clearSizeForDecoding): Deleted.
3251         (WebCore::ImageFrame::isBeingDecoded): Deleted.
3252         (WebCore::ImageFrame::sizeForDrawing): Deleted.
3253         (WebCore::ImageFrame::hasDecodedNativeImage): Deleted.
3254         The logic of knowing whether an ImageFrame is being decoded is moved to ImageFrameCache.
3255         * platform/graphics/ImageFrameCache.cpp:
3256         (WebCore::ImageFrameCache::cacheFrameMetadataAtIndex): Caches the metadata of an ImageFrame. If the NativeImage
3257         was decoded for a sizeForDrawing, the size of the ImageFrame will be the nativeImageSize(). Otherwise, the
3258         frameSizeAtIndex() will be called.
3259         (WebCore::ImageFrameCache::cacheFrameNativeImageAtIndex): Cache a new NativeImage which involves caching new
3260         metadata and updating the memory cache. No need to check if the existing native image is valid or not for the
3261         DecodingOptions. Actually it would be a bug if it happens. This is why cacheNativeImageForFrameRequest() asserts
3262         !frame.hasAsyncNativeImage() before calling cacheFrameNativeImageAtIndex().
3263         (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): Cache new NativeImage which was decoded asynchronously.
3264         (WebCore::ImageFrameCache::startAsyncDecodingQueue): Call cacheAsyncFrameNativeImageAtIndex() instead of
3265         cacheNativeImageForFrameRequest() for clarity.
3266         (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Call hasAsyncNativeImage() instead of hasValidNativeImage()
3267         Call frameIsDecodingCompatibleWithOptionsAtIndex() instead of frame.isBeingDecoded(). Replace the call to enqueueSizeForDecoding()
3268         by appending the same ImageFrameRequest to m_frameCommitQueue.
3269         (WebCore::ImageFrameCache::isAsyncDecodingQueueIdle): Use m_frameCommitQueue to answer the question whether the decodingQueue is idle.
3270         (WebCore::ImageFrameCache::stopAsyncDecodingQueue): Use m_frameCommitQueue to loop through all the ImageFrames which are currently being decoded.
3271         (WebCore::ImageFrameCache::frameAtIndexCacheIfNeeded): For getting the metadata, this function needs a valid frame. If it is requested
3272         to decode the nativeImage, it has to do it synchronously.
3273         (WebCore::ImageFrameCache::singlePixelSolidColor): Don't cache the frame if it is an animated image or the size is not a single pixel.
3274         (WebCore::ImageFrameCache::frameIsBeingDecodedAndIsCompatibleWithOptionsAtIndex): Use m_frameCommitQueue to answer the question whether an ImageFrame
3275         is being decoded and is compatible with DecodingOptions.
3276         (WebCore::ImageFrameCache::frameHasFullSizeNativeImageAtIndex): Calls ImageFrame::hasFullNativeImage() for a frame. 
3277         (WebCore::ImageFrameCache::frameHasDecodedNativeImageCompatibleWithOptionsAtIndex): Calls ImageFrame::hasDecodedNativeImageCompatibleWithOptions() for a frame.
3278         (WebCore::ImageFrameCache::frameImageAtIndex): Returns the current NativeImage without caching.
3279         (WebCore::ImageFrameCache::frameImageAtIndexCacheIfNeeded): Returns the current NativeImage but cache it synchronously if needed.
3280         (WebCore::ImageFrameCache::setFrameNativeImageAtIndex): Deleted.
3281         (WebCore::ImageFrameCache::setFrameMetadataAtIndex): Deleted.
3282         (WebCore::ImageFrameCache::replaceFrameNativeImageAtIndex): Deleted.
3283         (WebCore::ImageFrameCache::frameIsBeingDecodedAtIndex): Deleted.
3284         (WebCore::ImageFrameCache::frameHasImageAtIndex): Deleted.
3285         (WebCore::ImageFrameCache::frameHasValidNativeImageAtIndex): Deleted.
3286         (WebCore::ImageFrameCache::frameHasDecodedNativeImage): Deleted.
3287         * platform/graphics/ImageFrameCache.h: Two ImageFrameRequest queues will be used.
3288         -- The existing one m_frameRequestQueue which is shared between the main thread and decoding thread. The requests will be
3289         dequeued from it before starting the decoding. The decoded NativeImage will be cached only on the main thread. The decoding
3290         thread is not blocked by the callOnMainThread(). This means there might be multiple ImageFrameRequests which were dequeued
3291         while their NativeImages have not been cached yet.
3292         -- A new one m_frameCommitQueue which is track all the ImageFrameRequests whose NativeImages have not been cached yet.
3293         (WebCore::ImageFrameCache::frameAtIndexCacheIfNeeded): Be explicit about caching the image frame. frameImageAtIndex()
3294         returns the current image frame without caching. frameAtIndexCacheIfNeeded(). returns the current image frame but cache
3295         it if needed.
3296         (WebCore::ImageFrameCache::ImageFrameRequest::operator==): Compares two ImageFrameRequests for equality.
3297         * platform/graphics/ImageSource.cpp:
3298         (WebCore::ImageSource::frameImageAtIndexCacheIfNeeded): 
3299         (WebCore::ImageSource::frameImageAtIndex): Deleted.
3300         * platform/graphics/ImageSource.h:
3301         (WebCore::ImageSource::requestFrameAsyncDecodingAtIndex): Change the type of the argument from IntSize to be const std::optional<IntSize>.
3302         (WebCore::ImageSource::frameIsBeingDecodedAndIsCompatibleWithOptionsAtIndex): Rename of frameIsBeingDecodedAtIndex(). Replace the argument of type
3303         std::optional<IntSize> by an argument of type DecodingOptions.
3304         (WebCore::ImageSource::frameHasFullSizeNativeImageAtIndex): A wrapper around the ImageFrameCache function.
3305         (WebCore::ImageSource::frameHasDecodedNativeImageCompatibleWithOptionsAtIndex): Ditto.
3306         (WebCore::ImageSource::frameImageAtIndex): Ditto.
3307         (WebCore::ImageSource::frameIsBeingDecodedAtIndex): Deleted.
3308         (WebCore::ImageSource::frameHasValidNativeImageAtIndex): Deleted.
3309         (WebCore::ImageSource::frameHasDecodedNativeImage): Deleted.
3310         * platform/graphics/NamedImageGeneratedImage.cpp:
3311         (WebCore::NamedImageGeneratedImage::draw): Add a new argument of type DecodingMode.
3312         * platform/graphics/NamedImageGeneratedImage.h: Ditto.
3313         * platform/graphics/cairo/ImageBufferCairo.cpp:
3314         (WebCore::ImageBuffer::draw): Add a new argument of type DecodingMode.
3315         * platform/graphics/cg/ImageDecoderCG.cpp:
3316         (WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument. Add a new handling
3317         for decoding asynchronously for the image full size.
3318         * platform/graphics/cg/ImageDecoderCG.h: Change the prototype of the function.
3319         * platform/graphics/cg/PDFDocumentImage.cpp:
3320         (WebCore::PDFDocumentImage::draw): Add a new argument of type DecodingMode.
3321         * platform/graphics/cg/PDFDocumentImage.h:
3322         * platform/graphics/win/ImageCGWin.cpp:
3323         (WebCore::BitmapImage::getHBITMAPOfSize): Pass DecodingMode::Synchronous to Image::draw().
3324         (WebCore::BitmapImage::drawFrameMatchingSourceSize): Ditto.
3325         * platform/graphics/win/ImageDecoderDirect2D.cpp:
3326         (WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument.
3327         * platform/graphics/win/ImageDecoderDirect2D.h: Change the prototype of the function.
3328         * platform/image-decoders/ImageDecoder.cpp: 
3329         (WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument.
3330         * platform/image-decoders/ImageDecoder.h: Change the prototype of the function.
3331         * rendering/RenderBoxModelObject.cpp:
3332         (WebCore::RenderBoxModelObject::paintFillLayerExtended): Draw the background image asynchronously if the image size is large.
3333         * rendering/RenderImage.cpp:
3334         (WebCore::RenderImage::paintIntoRect): Draw the background image element asynchronously if the image size is large.
3335         * svg/graphics/SVGImage.cpp:
3336         (WebCore::SVGImage::drawForContainer): Pass DecodingMode::Synchronous to draw().
3337         (WebCore::SVGImage::nativeImageForCurrentFrame): Ditto.
3338         (WebCore::SVGImage::nativeImage): Ditto.
3339         (WebCore::SVGImage::draw): Add a new argument of type DecodingMode.
3340         * svg/graphics/SVGImage.h: Change the prototype of the function.
3341         * svg/graphics/SVGImageForContainer.cpp:
3342         (WebCore::SVGImageForContainer::draw): Add a new argument of type DecodingMode.
3343         * svg/graphics/SVGImageForContainer.h: Change the prototype of the function.
3344
3345 2017-03-27  Youenn Fablet  <youenn@apple.com>
3346
3347         Activate release libwebrtc logging when WebRTC log channel is on
3348         https://bugs.webkit.org/show_bug.cgi?id=169659
3349
3350         Reviewed by Alex Christensen.
3351
3352         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3353         (WebCore::initializePeerConnectionFactoryAndThreads):
3354
3355 2017-03-27  Antti Koivisto  <antti@apple.com>
3356
3357         Move visibleInViewportStateChanged callback from Element to render tree
3358         https://bugs.webkit.org/show_bug.cgi?id=170039
3359
3360         Reviewed by Zalan Bujtas.
3361
3362         Make it easier to use from the render tree.
3363
3364         Also for simplicity move the bits from RenderObject rare data to RenderElement.
3365         There is plenty of space there.
3366
3367         * dom/Element.h:
3368         (WebCore::Element::isVisibleInViewportChanged): Deleted.
3369         * html/HTMLMediaElement.h:
3370         * rendering/RenderElement.cpp:
3371         (WebCore::RenderElement::RenderElement):
3372         (WebCore::RenderElement::willBeDestroyed):
3373         (WebCore::RenderElement::registerForVisibleInViewportCallback):
3374         (WebCore::RenderElement::unregisterForVisibleInViewportCallback):
3375         (WebCore::RenderElement::setVisibleInViewportState):
3376         (WebCore::RenderElement::visibleInViewportStateChanged):
3377         * rendering/RenderElement.h:
3378         (WebCore::RenderElement::visibleInViewportState):
3379         * rendering/RenderObject.cpp:
3380         (WebCore::RenderObject::setIsRegisteredForVisibleInViewportCallback): Deleted.
3381         (WebCore::RenderObject::setVisibleInViewportState): Deleted.
3382         * rendering/RenderObject.h:
3383         (WebCore::RenderObject::hasOutlineAutoAncestor):
3384         (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
3385         (WebCore::RenderObject::isRegisteredForVisibleInViewportCallback): Deleted.
3386         (WebCore::RenderObject::visibleInViewportState): Deleted.
3387         * rendering/RenderVideo.cpp:
3388         (WebCore::RenderVideo::visibleInViewportStateChanged):
3389         * rendering/RenderVideo.h:
3390         * rendering/RenderView.cpp:
3391         (WebCore::RenderView::updateVisibleViewportRect):
3392
3393 2017-03-27  Youenn Fablet  <youenn@apple.com>
3394
3395         addIceCandidate should not throw if passed null or undefined
3396         https://bugs.webkit.org/show_bug.cgi?id=170118
3397
3398         Reviewed by Eric Carlson.
3399
3400         Covered by updated test.
3401
3402         A null/undefined candidate passed to addIceCandidate means end of Ice candidate..
3403
3404         * Modules/mediastream/PeerConnectionBackend.cpp:
3405         (WebCore::PeerConnectionBackend::addIceCandidate):
3406         * Modules/mediastream/PeerConnectionBackend.h:
3407         (WebCore::PeerConnectionBackend::endOfIceCandidates):
3408         * Modules/mediastream/RTCPeerConnection.cpp:
3409         (WebCore::RTCPeerConnection::queuedAddIceCandidate):
3410         * Modules/mediastream/RTCPeerConnection.h:
3411         * Modules/mediastream/RTCPeerConnection.idl:
3412         * Modules/mediastream/RTCPeerConnection.js:
3413         (addIceCandidate):
3414
3415 2017-03-27  Antti Koivisto  <antti@apple