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