[GTK] Use the DisplayRefreshMonitor facilities
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-04-11  Zan Dobersek  <zdobersek@igalia.com>
2
3         [GTK] Use the DisplayRefreshMonitor facilities
4         https://bugs.webkit.org/show_bug.cgi?id=170599
5
6         Reviewed by Carlos Garcia Campos.
7
8         * CMakeLists.txt: Add missing files to the build.
9         * platform/graphics/DisplayRefreshMonitor.cpp: Build fixes.
10         (WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor):
11         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
12         (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer): Mark the
13         platform layer as updated in the layer's CoordinatedGraphicsState.
14         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
15
16 2017-04-11  Antoine Quint  <graouts@apple.com>
17
18         [Modern Media Controls] Allow modern-media-controls to be provided through WebKitAdditions
19         https://bugs.webkit.org/show_bug.cgi?id=170722
20         <rdar://problem/31553089>
21
22         Reviewed by Dean Jackson.
23
24         If modern media controls source files are provided through WebKitAdditions, use these instead
25         of the sources found in the WebCore module.
26
27         * WebCore.xcodeproj/project.pbxproj:
28
29 2017-04-11  Dean Jackson  <dino@apple.com>
30
31         Disable outdated WritableStream API
32         https://bugs.webkit.org/show_bug.cgi?id=170749
33         <rdar://problem/31446233>
34
35         Reviewed by Tim Horton.
36
37         The API we implement is no longer accurate. Disable it until we
38         are compatible with the new specification
39
40         * Configurations/FeatureDefines.xcconfig:
41
42 2017-04-11  Matt Rajca  <mrajca@apple.com>
43
44         Consider the current document when allowing autoplay quirks.
45         https://bugs.webkit.org/show_bug.cgi?id=170744
46
47         Reviewed by Eric Carlson.
48
49         Added API test.
50
51         In addition to checking if the top-level document supports autoplay quirks, we should check
52         if the current document supports quirks. This allows all embedded YouTube videos (which use
53         iframes) to play correctly if the client allows autoplay quirks on youtube.com.
54
55         * html/HTMLMediaElement.cpp:
56         (WebCore::HTMLMediaElement::dispatchPlayPauseEventsIfNeedsQuirks):
57
58 2017-04-11  Ryan Haddad  <ryanhaddad@apple.com>
59
60         Unreviewed, rolling out r215245.
61
62         This change broke internal builds.
63
64         Reverted changeset:
65
66         "[Modern Media Controls] Allow modern-media-controls to be
67         provided through WebKitAdditions"
68         https://bugs.webkit.org/show_bug.cgi?id=170722
69         http://trac.webkit.org/changeset/215245
70
71 2017-04-11  Antoine Quint  <graouts@apple.com>
72
73         [Modern Media Controls] Allow modern-media-controls to be provided through WebKitAdditions
74         https://bugs.webkit.org/show_bug.cgi?id=170722
75         <rdar://problem/31553089>
76
77         Reviewed by Dean Jackson.
78
79         If modern media controls source files are provided through WebKitAdditions, use these instead
80         of the sources found in the WebCore module.
81
82         * WebCore.xcodeproj/project.pbxproj:
83
84 2017-04-10  Matt Rajca  <mrajca@apple.com>
85
86         Change autoplay state to "prevented" when media is paused due to restrictions.
87         https://bugs.webkit.org/show_bug.cgi?id=170686
88
89         Reviewed by Alex Christensen.
90
91         Added API tests.
92
93         Currently, the autoplay state is set to "prevented" when playback is about to begin without
94         user interaction and there are restrictions in place. We should also be setting this flag when
95         autoplay is allowed but due to a change in audio tracks, for example, it gets paused.
96
97         This patch also moves some common logic into setPlaybackWithoutUserGesture without changing behavior.
98
99         * html/HTMLMediaElement.cpp:
100         (WebCore::HTMLMediaElement::setReadyState):
101         (WebCore::HTMLMediaElement::play):
102         (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack):
103         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
104         (WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture):
105         (WebCore::HTMLMediaElement::updateShouldPlay):
106
107 2017-04-11  Eric Carlson  <eric.carlson@apple.com>
108
109         [MediaStream] Set correct audio session category when capturing audio
110         https://bugs.webkit.org/show_bug.cgi?id=170736
111         <rdar://problem/31559405>
112
113         Reviewed by Jer Noble.
114
115         No new tests yet, filed bug 170737.
116
117         * Modules/mediastream/MediaStream.cpp:
118         (WebCore::MediaStream::MediaStream): Initialize m_mediaSession.
119         (WebCore::MediaStream::statusDidChange): Call canProduceAudioChanged.
120         (WebCore::MediaStream::mediaType): New. Return MediaStreamCapturingAudio when actively
121         capturing audio.
122         (WebCore::MediaStream::presentationType):
123         (WebCore::MediaStream::characteristics):
124         (WebCore::MediaStream::mayResumePlayback):
125         (WebCore::MediaStream::suspendPlayback):
126         (WebCore::MediaStream::sourceApplicationIdentifier):
127         (WebCore::MediaStream::canProduceAudio):
128         * Modules/mediastream/MediaStream.h:
129
130         * platform/audio/PlatformMediaSession.h: Add MediaStreamCapturingAudio.
131         * platform/audio/PlatformMediaSessionManager.cpp:
132         (WebCore::PlatformMediaSessionManager::has): Adjust assert for MediaStreamCapturingAudio.
133         (WebCore::PlatformMediaSessionManager::count): Ditto.
134         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
135         (PlatformMediaSessionManager::updateSessionState): Set small preferred buffer size when
136         capturing audio. Set audio session category to PlayAndRecord whenever there is a media
137         stream that is capturing audio.
138
139 2017-04-11  Yusuke Suzuki  <utatane.tea@gmail.com>
140
141         [WebCore][JSC] ResourceUsageData.{timeOfNextEdenCollection,timeOfNextFullCollection} should be MonotonicTime
142         https://bugs.webkit.org/show_bug.cgi?id=170725
143
144         Reviewed by Sam Weinig.
145
146         Use MonotonicTime instead of raw doubles.
147         Currently, large part of data structures and helper functions are the same in
148         ResourceUsageOverlayCocoa.mm and ResourceUsageOverlayLinux.cpp. This should be
149         unified in a separate patch.
150
151         * page/ResourceUsageData.h:
152         * page/cocoa/ResourceUsageOverlayCocoa.mm:
153         (WebCore::gcTimerString):
154         (WebCore::ResourceUsageOverlay::platformDraw):
155         * page/linux/ResourceUsageOverlayLinux.cpp:
156         (WebCore::gcTimerString):
157
158 2017-04-11  Youenn Fablet  <youenn@apple.com>
159
160         Activate WebRTC data channel tests for WK1
161         https://bugs.webkit.org/show_bug.cgi?id=170710
162
163         Reviewed by Eric Carlson.
164
165         Covered by existing and activated tests.
166
167         Making LibWebRTCProvider::factory not static.
168         For that purpose LibWebRTCMediaEndpoint now stores its peer connection factory reference.
169         Making LibWebRTCProvider use libebrtc networking by default.
170
171         Removing some no longer needed checks related to libwebrtc availability.
172
173         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
174         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
175         (WebCore::LibWebRTCMediaEndpoint::addTrack):
176         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
177         (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
178         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
179         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
180         (WebCore::LibWebRTCProvider::factory):
181         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
182
183 2017-04-11  Youenn Fablet  <youenn@apple.com>
184
185         MediaStream id should be equal to msid
186         https://bugs.webkit.org/show_bug.cgi?id=170712
187
188         Reviewed by Eric Carlson.
189
190         Covered by rebased tests.
191
192         Setting MediaStream id to libwebrtc mediastream label.
193         Refactoring to use more Ref<> in MediaStream code.
194
195         Making PeerConnection use the libwebrtc backend by default for layout tests instead of the mock.
196
197         * Modules/mediastream/MediaStream.cpp:
198         (WebCore::MediaStream::create):
199         (WebCore::createTrackPrivateVector):
200         (WebCore::MediaStream::MediaStream):
201         * Modules/mediastream/MediaStream.h:
202         * Modules/mediastream/MediaStreamRegistry.cpp:
203         (WebCore::MediaStreamRegistry::lookUp):
204         * Modules/mediastream/UserMediaRequest.cpp:
205         (WebCore::UserMediaRequest::allow):
206         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
207         (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
208         (WebCore::LibWebRTCMediaEndpoint::addRemoteStream):
209         (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
210         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
211         * platform/graphics/MediaPlayer.cpp:
212         (WebCore::MediaPlayer::load):
213         * platform/graphics/MediaPlayer.h:
214         * platform/mediastream/MediaStreamPrivate.cpp:
215         (WebCore::MediaStreamPrivate::MediaStreamPrivate):
216         * platform/mediastream/MediaStreamPrivate.h:
217         (WebCore::MediaStreamPrivate::create):
218         * testing/Internals.cpp:
219         (WebCore::Internals::Internals):
220
221 2017-04-11  Chris Fleizach  <cfleizach@apple.com>
222
223         AX: Web article navigation does not work (article rotor for Facebook, Twitter, Messages etc.)
224         https://bugs.webkit.org/show_bug.cgi?id=170330
225         <rdar://problem/31366105>
226
227         Reviewed by Joanmarie Diggs.
228
229         Add a search ability for the "article" role.
230
231         Test: accessibility/mac/search-predicate-article.html
232
233         * accessibility/AccessibilityObject.cpp:
234         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
235         * accessibility/AccessibilityObject.h:
236         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
237         (-[WebAccessibilityObjectWrapper _accessibilityArticleAncestor]):
238         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
239         (createAccessibilitySearchKeyMap):
240
241 2017-04-11  Chris Fleizach  <cfleizach@apple.com>
242
243         AX: PDF plugin needs to support PDF-DOM Mode
244         https://bugs.webkit.org/show_bug.cgi?id=170589
245
246         Reviewed by Tim Horton.
247
248         Provide WebCore support for accessibility connect to PDF document.
249         This includes the ability to connect a PDF annotation created node within WebKit to 
250          its PDFAnnotation parent (through use of shadowPluginParent).
251
252         * accessibility/AXObjectCache.h:
253         * accessibility/mac/AXObjectCacheMac.mm:
254         (WebCore::AXPostNotificationWithUserInfo):
255         * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
256         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
257         (-[WebAccessibilityObjectWrapper shadowPluginParent]):
258         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
259         * html/HTMLAttributeNames.in:
260         * plugins/PluginViewBase.h:
261         (WebCore::PluginViewBase::accessibilityShadowPluginParentForElement):
262
263 2017-04-11  Carlos Garcia Campos  <cgarcia@igalia.com>
264
265         REGRESSION(r215153): Request Animation Frame broken when building without REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR
266         https://bugs.webkit.org/show_bug.cgi?id=170719
267
268         Reviewed by Žan Doberšek.
269
270         This is because when not using the display refresh monitor, the timer is always used, not only when throttling,
271         but since r215153 the rAF timer is always aligned to 30ms.
272
273         Fixes: fast/animation/request-animation-frame-too-rapid.html
274
275         * dom/ScriptedAnimationController.cpp:
276         (WebCore::ScriptedAnimationController::scheduleAnimation): Only do the timer alignment when throttling.
277
278 2017-04-11  Yoav Weiss  <yoav@yoav.ws>
279
280         [link preload] Double downloads of preloaded content when it's in MemoryCache
281         https://bugs.webkit.org/show_bug.cgi?id=170122
282
283         Reviewed by Antti Koivisto.
284
285         No new tests, but unflaked http/tests/preload/single_download_preload_headers_charset.html.
286
287         The test was flaky because it appears as if MemoryCache is not being evicted between runs,
288         and running multiple iterations of the test resulted in preloaded being taken out of MemoryCache
289         and not having the unknown encoding flag. In those cases, the result was a double download and
290         a failed test.
291
292         * loader/TextResourceDecoder.cpp:
293         (WebCore::TextResourceDecoder::setEncoding): Set the m_encodingSet flag.
294         * loader/TextResourceDecoder.h: Added an m_encodingSet flag initialized to false.
295         * loader/cache/CachedCSSStyleSheet.cpp:
296         (WebCore::CachedCSSStyleSheet::setEncoding): Assert that stylesheets don't maintain decoded text.
297         * loader/cache/CachedResource.cpp:
298         (WebCore::CachedResource::CachedResource): Remove initialization of hasUnknownEncoding flag.
299         * loader/cache/CachedResource.h:
300         (WebCore::CachedResource::hasUnknownEncoding): Remove.
301         (WebCore::CachedResource::setHasUnknownEncoding): Remove.
302         (WebCore::CachedResource::CachedResource): Remove initialization of hasUnknownEncoding flag.
303         * loader/cache/CachedResourceLoader.cpp:
304         (WebCore::CachedResourceLoader::determineRevalidationPolicy): Set the encoding in case it changed.
305
306 2017-04-11  Miguel Gomez  <magomez@igalia.com>
307
308         REGRESSION(r215211): [GTK] Lots of image related tests are timing out, causing the test bot to exit early
309         https://bugs.webkit.org/show_bug.cgi?id=170727
310
311         Reviewed by Carlos Garcia Campos.
312
313         Since r215211 ImageDecoder::isSizeAvailable() calls encodedDataStatus() in the different decoder implementations,
314         and those implementations force a partial decoding of the image if the size is not available yet. But
315         ImageDecoder::isSizeAvailable() was already being used inside the decoders assuming that it wasn't going to
316         force this partial decoding. Due to this, there are some situations where the partial decoding is not
317         desired but it's happening anyway. For example, the check in setSize(), which causes the partial decoding
318         to happen again and again because no value is actually set to the animation size (which causes the timouts
319         in the test bot).
320
321         To avoid this, replace all the calls to ImageDecoder::isSizeAvailable() inside the decoders with calls to
322         ImageDecoder::encodedDataStatus(), which doesn't force the partial decoding.
323
324         Covered by existent tests.
325
326         * platform/image-decoders/gif/GIFImageDecoder.cpp:
327         (WebCore::GIFImageDecoder::setSize):
328         * platform/image-decoders/ico/ICOImageDecoder.cpp:
329         (WebCore::ICOImageDecoder::decodeAtIndex):
330         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
331         * platform/image-decoders/png/PNGImageDecoder.cpp:
332         (WebCore::PNGImageReader::decode):
333         (WebCore::PNGImageDecoder::frameBufferAtIndex):
334         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
335         (WebCore::WEBPImageDecoder::decode):
336
337 2017-04-11  Miguel Gomez  <magomez@igalia.com>
338
339         REGRESSION(r215211): [GTK] Lots of image related tests are crashing, causing the test bot to exit early
340         https://bugs.webkit.org/show_bug.cgi?id=170721
341
342         Reviewed by Carlos Garcia Campos.
343
344         r215211 caused an infinite loop because of calls between ImageDecoder::isSizeAvailable() and the specializations of
345         ImageDecoder::encodedDataStatus(). Change the different decoders so ImageDecoder::encodedDataStatus doesn't call
346         ImageDecoder::isSizeAvailable().
347
348         Covered by existent tests.
349
350         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
351         (WebCore::BMPImageDecoder::encodedDataStatus):
352         * platform/image-decoders/gif/GIFImageDecoder.cpp:
353         (WebCore::GIFImageDecoder::encodedDataStatus):
354         * platform/image-decoders/ico/ICOImageDecoder.cpp:
355         (WebCore::ICOImageDecoder::encodedDataStatus):
356         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
357         (WebCore::JPEGImageDecoder::encodedDataStatus):
358         * platform/image-decoders/png/PNGImageDecoder.cpp:
359         (WebCore::PNGImageDecoder::encodedDataStatus):
360         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
361         (WebCore::WEBPImageDecoder::encodedDataStatus):
362
363 2017-04-10  Alex Christensen  <achristensen@webkit.org>
364
365         Revert r215217
366         https://bugs.webkit.org/show_bug.cgi?id=170703
367
368         * Configurations/FeatureDefines.xcconfig:
369
370 2017-04-10  Chris Dumez  <cdumez@apple.com>
371
372         Fix bad change in r215167.
373         https://bugs.webkit.org/show_bug.cgi?id=170656
374
375         Reviewed by Yusuke Suzuki.
376
377         Revert mistake made in r215167.
378
379         * rendering/RenderThemeGtk.cpp:
380         (WebCore::RenderThemeGtk::caretBlinkInterval):
381
382 2017-04-10  Alex Christensen  <achristensen@webkit.org>
383
384         Continue enabling WebRTC
385         https://bugs.webkit.org/show_bug.cgi?id=170703
386
387         Reviewed by Youenn Fablet.
388
389         * Configurations/FeatureDefines.xcconfig:
390
391 2017-04-10  Jeremy Jones  <jeremyj@apple.com>
392
393         PlayerLayerView +layerClass methods should use return type Class.
394         https://bugs.webkit.org/show_bug.cgi?id=165406
395
396         Reviewed by Sam Weinig.
397
398         No new tests because not behavior change.
399
400         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
401         (WebAVPictureInPicturePlayerLayerView_layerClass):
402         (WebAVPlayerLayerView_layerClass):
403
404 2017-04-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
405
406         CachedImage should stop decoding images when unknown type is detected
407         https://bugs.webkit.org/show_bug.cgi?id=170530
408
409         Reviewed by Tim Horton.
410
411         If the status of the encoded data is "unknown type", WebKit should stop
412         decoding the rest of the data. Ideally WebKit should also cancel loading
413         the rest of the encoded data.
414         
415         To do that we need to add a function to the ImageDecoder to return the
416         encodedDataStatus(). We also need to change the return type of Image::setData()
417         and Image::dataChanged() form bool to EncodedDataStatus.
418
419         * WebCore.xcodeproj/project.pbxproj: Add ImageTypes.h to the WebCore project.
420         * loader/cache/CachedImage.cpp:
421         (WebCore::CachedImage::addIncrementalDataBuffer): Replace checking !sizeAvailable 
422         by checking if encodedDataStatus isn't an error but it has not reached
423         sizeAvailable state
424         * loader/cache/CachedResourceClientWalker.h:
425         (WebCore::CachedResourceClientWalker::CachedResourceClientWalker): Unrelated clean-up.
426         (WebCore::CachedResourceClientWalker::next): Ditto.
427         * loader/icon/IconRecord.cpp:
428         (WebCore::IconRecord::setImageData): Image::setData() used to return a bool. Now it returns
429         an EncodedDataStatus. !setData() now means setData() < EncodedDataStatus::SizeAvailable.
430         * platform/graphics/BitmapImage.cpp:
431         (WebCore::BitmapImage::dataChanged): Replace the return of dataChanged() from bool
432         by EncodedDataStatus.
433         * platform/graphics/BitmapImage.h: Replace isSizeAvailable() by a new function
434         named encodedDataStatus().
435         * platform/graphics/Image.cpp:
436         (WebCore::Image::setData): Code clean-up and adding a clarification comment.
437         * platform/graphics/Image.h: Change the return of setData() and dataChanged() to be
438         EncodedDataStatus.
439         (WebCore::Image::dataChanged): Return EncodedDataStatus::Unknown as an indication
440         the size is not available but we do not have an error.
441         * platform/graphics/ImageTypes.h: Added.
442         Image definitions which are shared among Image, ImageDecoder, ImageSource,
443         ImageFrameCache and ImageFrame used to be added to ImageFrame.h. This has
444         been annoying since these definitions aren't related to ImageFrame only.
445         A new header file named ImageTypes.h is to the to include such definitions.
446         (WebCore::operator++):
447         * platform/graphics/ImageFrame.h:
448         (WebCore::operator++): Deleted.
449         * platform/graphics/ImageFrameCache.cpp:
450         (WebCore::ImageFrameCache::ImageFrameCache): This is the case of a BitmapImage without
451         a decoder but with a NativeImage. The status has to be EncodedDataStatus::Complete.
452         (WebCore::ImageFrameCache::growFrames): Replace if (isSizeAvailable()) by
453         if (encodedDataStatus() >= EncodedDataStatus::SizeAvailable).
454         (WebCore::ImageFrameCache::metadata): Ditto.
455         (WebCore::ImageFrameCache::encodedDataStatus): This is a replacement for isSizeAvailable().
456         Don't cache the EncodedDataStatus until it is Complete. Don't call didDecodeProperties()
457         until the status >= EncodedDataStatus::SizeAvailable.
458         (WebCore::ImageFrameCache::isSizeAvailable): Deleted.
459         * platform/graphics/ImageFrameCache.h: Replace isSizeAvailable() by encodedDataStatus().
460         * platform/graphics/ImageSource.cpp:
461         (WebCore::ImageSource::dataChanged): Make return an EncodedDataStatus instead of returning
462         a bool for isSizeAvailable.
463         * platform/graphics/ImageSource.h:
464         (WebCore::ImageSource::encodedDataStatus): Replace isSizeAvailable() by encodedDataStatus().
465         (WebCore::ImageSource::isSizeAvailable): Deleted.
466         * platform/graphics/cg/ImageDecoderCG.cpp:
467         (WebCore::ImageDecoder::encodedDataStatus): Replace isSizeAvailable() by encodedDataStatus().
468         The logic of this function is the following:
469             -- CGImageSourceGetStatus() can return kCGImageStatusUnexpectedEOF, kCGImageStatusInvalidData
470             or kCGImageStatusReadingHeader even if CG will end up recovering form the error and drawing
471             the image. Actually CG initializes the status of CGImageSource before receiving any data
472             with kCGImageStatusInvalidData. So the status will be considered an error only if all the
473             data is received but CG does not move the status of this CGImageSource to Complete.
474             -- If CGImageSourceGetStatus() returns Incomplete, this means CG already created the image
475             reader and therefore the image type is known.
476             -- If CGImageSourceGetStatus() returns UnknownType, this means CG could not create the
477             image reader and this should be considered an error.
478         (WebCore::ImageDecoder::isSizeAvailable): Deleted.
479         * platform/graphics/cg/ImageDecoderCG.h: Replace isSizeAvailable() by encodedDataStatus().
480         * platform/graphics/cg/PDFDocumentImage.cpp:
481         (WebCore::PDFDocumentImage::dataChanged): The PDFDocument is created only when allDataReceived.
482         * platform/graphics/cg/PDFDocumentImage.h: Change the return type from bool to EncodedDataStatus.
483         * platform/image-decoders/ImageDecoder.h: 
484         (WebCore::ImageDecoder::encodedDataStatus): Add a new function encodedDataStatus(). Deduce the
485         status of the encoded data from the flags m_failed, m_isAllDataReceived and m_sizeAvailable in
486         this order.
487         (WebCore::ImageDecoder::isSizeAvailable): Make this function uses encodedDataStatus().
488         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
489         (WebCore::BMPImageDecoder::encodedDataStatus): Replace isSizeAvailable() by encodedDataStatus().
490         (WebCore::BMPImageDecoder::isSizeAvailable): Deleted.
491         * platform/image-decoders/bmp/BMPImageDecoder.h:
492         * platform/image-decoders/gif/GIFImageDecoder.cpp:
493         (WebCore::GIFImageDecoder::encodedDataStatus): Ditto.
494         (WebCore::GIFImageDecoder::isSizeAvailable): Deleted.
495         * platform/image-decoders/gif/GIFImageDecoder.h:
496         * platform/image-decoders/ico/ICOImageDecoder.cpp:
497         (WebCore::ICOImageDecoder::encodedDataStatus): Ditto.
498         (WebCore::ICOImageDecoder::isSizeAvailable): Deleted.
499         * platform/image-decoders/ico/ICOImageDecoder.h:
500         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
501         (WebCore::JPEGImageDecoder::encodedDataStatus): Ditto.
502         (WebCore::JPEGImageDecoder::isSizeAvailable): Deleted.
503         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
504         * platform/image-decoders/png/PNGImageDecoder.cpp:
505         (WebCore::PNGImageDecoder::encodedDataStatus): Ditto.
506         (WebCore::PNGImageDecoder::isSizeAvailable): Deleted.
507         * platform/image-decoders/png/PNGImageDecoder.h:
508         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
509         (WebCore::WEBPImageDecoder::encodedDataStatus): Ditto.
510         (WebCore::WEBPImageDecoder::isSizeAvailable): Deleted.
511         * platform/image-decoders/webp/WEBPImageDecoder.h:
512         * svg/graphics/SVGImage.cpp:
513         (WebCore::SVGImage::dataChanged): m_page is created only when allDataReceived is true.
514         * svg/graphics/SVGImage.h:
515
516 2017-04-10  Myles C. Maxfield  <mmaxfield@apple.com>
517
518         Mark SVG-Within-OpenType as "Under Consideration"
519         https://bugs.webkit.org/show_bug.cgi?id=170706
520
521         Reviewed by Brady Eidson.
522
523         * features.json:
524
525 2017-04-10  Jeremy Jones  <jeremyj@apple.com>
526
527         Add CoreAudioCaptureSource.
528         https://bugs.webkit.org/show_bug.cgi?id=170112
529         rdar://problem/30293338
530
531         Reviewed by Eric Carlson.
532
533         No new tests because this provides the same funcitonality as AVAudioCaptureSource. 
534         Funcionality is covered by existing test cases.
535
536         Add CoreAudioCaptureSource for audio capture. And use it by default in AVCaptureDeviceManager.
537         Add UseAVFoundationAudioCapture setting to switch back to AVFoundation for audio capture.
538
539         * WebCore.xcodeproj/project.pbxproj:
540         * page/Settings.cpp:
541         (WebCore::Settings::useAVFoundationAudioCapture):
542         (WebCore::Settings::setUseAVFoundationAudioCapture):
543         * page/Settings.h:
544         * platform/mediastream/mac/AVCaptureDeviceManager.h:
545         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
546         (WebCore::AVCaptureDeviceManager::setUseAVFoundationAudioCapture):
547         * platform/mediastream/mac/CoreAudioCaptureSource.cpp: Added.
548         (WebCore::CoreAudioCaptureSource::create):
549         (WebCore::CoreAudioCaptureSource::factory):
550         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
551         (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource):
552         (WebCore::CoreAudioCaptureSource::preferredSampleRate):
553         (WebCore::CoreAudioCaptureSource::preferredIOBufferDuration):
554         (WebCore::CoreAudioCaptureSource::configureMicrophoneProc):
555         (WebCore::CoreAudioCaptureSource::configureSpeakerProc):
556         (WebCore::CoreAudioCaptureSource::addMicrophoneDataConsumer):
557         (WebCore::CoreAudioCaptureSource::removeMicrophoneDataConsumer):
558         (WebCore::CoreAudioCaptureSource::addEchoCancellationSource):
559         (WebCore::CoreAudioCaptureSource::removeEchoCancellationSource):
560         (WebCore::CoreAudioCaptureSource::checkTimestamps):
561         (WebCore::CoreAudioCaptureSource::provideSpeakerData):
562         (WebCore::CoreAudioCaptureSource::speakerCallback):
563         (WebCore::CoreAudioCaptureSource::processMicrophoneSamples):
564         (WebCore::CoreAudioCaptureSource::microphoneCallback):
565         (WebCore::CoreAudioCaptureSource::defaultOutputDevice):
566         (WebCore::CoreAudioCaptureSource::defaultInputDevice):
567         (WebCore::CoreAudioCaptureSource::setupAudioUnits):
568         (WebCore::CoreAudioCaptureSource::startProducingData):
569         (WebCore::CoreAudioCaptureSource::stopProducingData):
570         (WebCore::CoreAudioCaptureSource::suspend):
571         (WebCore::CoreAudioCaptureSource::resume):
572         (WebCore::CoreAudioCaptureSource::capabilities):
573         (WebCore::CoreAudioCaptureSource::settings):
574         * platform/mediastream/mac/CoreAudioCaptureSource.h: Added.
575         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
576         (WebCore::RealtimeMediaSourceCenterMac::RealtimeMediaSourceCenterMac):
577         (WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory):
578
579 2017-04-10  Youenn Fablet  <youenn@apple.com>
580
581         Wrap legacy MediaStream API in runtime flag
582         https://bugs.webkit.org/show_bug.cgi?id=169877
583
584         Reviewed by Alex Christensen.
585
586         Covered by binding tests.
587
588         Marking navigator.getUserMedia and MediaStreamEvent as runtime enabled if mediastream and webrtclegacy api flags
589         are on.
590         Updated binding generator to support multiple runtime flags.
591
592         * Modules/mediastream/MediaStreamEvent.idl:
593         * Modules/mediastream/NavigatorUserMedia.idl:
594         * bindings/scripts/CodeGeneratorJS.pm:
595         (GetRuntimeEnableFunctionName):
596         (GenerateImplementation):
597         * bindings/scripts/test/JS/JSTestObj.cpp:
598         (WebCore::JSTestObjPrototype::finishCreation):
599         * bindings/scripts/test/TestObj.idl:
600
601 2017-04-10  Youenn Fablet  <youenn@apple.com>
602
603         Remove deprecated parts of media stream spec
604         https://bugs.webkit.org/show_bug.cgi?id=169879
605
606         Reviewed by Jon Lee.
607
608         Removing MediaStreamTrackState 'new' value which was unused.
609         Removing MediaStreamTrack _readonly attribute which was unused.
610
611         * Modules/mediastream/MediaStreamTrack.cpp:
612         (WebCore::MediaStreamTrack::readonly): Deleted.
613         * Modules/mediastream/MediaStreamTrack.h:
614         * Modules/mediastream/MediaStreamTrack.idl:
615         * platform/mediastream/MediaStreamTrackPrivate.cpp:
616         (WebCore::MediaStreamTrackPrivate::readonly): Deleted.
617         * platform/mediastream/MediaStreamTrackPrivate.h:
618         * platform/mediastream/RealtimeMediaSource.h:
619
620 2017-04-10  Ryan Haddad  <ryanhaddad@apple.com>
621
622         Unreviewed, rolling out r215175.
623
624         This change caused a flaky crash in existing media tests.
625
626         Reverted changeset:
627
628         "Add fallback fonts to video captions stylesheet."
629         https://bugs.webkit.org/show_bug.cgi?id=170495
630         http://trac.webkit.org/changeset/215175
631
632 2017-04-10  Wenson Hsieh  <wenson_hsieh@apple.com>
633
634         Data interaction on an image enclosed by an anchor should vend the anchor's URL
635         https://bugs.webkit.org/show_bug.cgi?id=170660
636         <rdar://problem/31043220>
637
638         Reviewed by Tim Horton.
639
640         When writing an image embedded inside an anchor to the pasteboard, actually use the enclosing anchor's href if
641         it exists. Previously, we were simply dropping this argument on the floor.
642
643         Covered by 2 new DataInteractionTests: ImageInLinkToInput and ImageInLinkWithoutHREFToInput.
644
645         * editing/ios/EditorIOS.mm:
646         (WebCore::Editor::writeImageToPasteboard):
647
648 2017-04-10  Jon Lee  <jonlee@apple.com>
649
650         Update localizable strings to "full screen" from "fullscreen"
651         https://bugs.webkit.org/show_bug.cgi?id=170675
652         rdar://problem/28207034
653
654         Reviewed by Antoine Quint.
655
656         For localizable strings, it should consistently be "full screen" instead of "fullscreen".
657
658         * English.lproj/Localizable.strings:
659         * English.lproj/modern-media-controls-localized-strings.js:
660         * platform/LocalizedStrings.cpp:
661         (WebCore::contextMenuItemTagExitVideoFullscreen):
662         (WebCore::localizedMediaControlElementString):
663         * platform/cocoa/LocalizedStringsCocoa.mm:
664         (WebCore::exitFullScreenButtonAccessibilityTitle):
665
666 2017-04-10  Andreas Kling  <akling@apple.com>
667
668         Don't generate extra scrolling tiles for non-visible pages.
669         https://bugs.webkit.org/show_bug.cgi?id=167213
670         <rdar://problem/30105774>
671
672         Reviewed by Antti Koivisto.
673
674         Reduce the tiling coverage to a minimum when the page is non-visible.
675         On macOS, this means that fully occluded web views can maintain a smaller set of tiles
676         in non-volatile surfaces, reducing net footprint.
677
678         Test: compositing/tiling/non-visible-window-tile-coverage.html
679
680         * rendering/RenderLayerBacking.cpp:
681         (WebCore::computePageTiledBackingCoverage): If the page's activity state is non-visible, use minimal tile coverage.
682         * platform/ScrollView.h:
683         * page/FrameView.h:
684         * page/FrameView.cpp:
685         (WebCore::FrameView::hide): Call adjustTiledBackingCoverage() in hide() since it now takes page visibility into account.
686
687         (WebCore::FrameView::enableSpeculativeTilingIfNeeded):
688         * testing/Internals.cpp:
689         (WebCore::Internals::setSpeculativeTilingDelayDisabledForTesting):
690         * testing/Internals.h:
691         * testing/Internals.idl: Add an internals API for disabling the 500ms delay before speculative tiling begins after
692         the main frame load finishes. This is needed for reliably testing this change.
693
694 2017-04-10  Per Arne Vollan  <pvollan@apple.com>
695
696         Add fallback fonts to video captions stylesheet.
697         https://bugs.webkit.org/show_bug.cgi?id=170495
698
699         Reviewed by Myles C. Maxfield.
700
701         The kCTFontCascadeListAttribute key is used to obtain the cascade list for a font reference.
702
703         I have not added a test, since CaptionUserPreferences::testingMode() returns true when running tests,
704         preventing this code path from being executed.
705
706         * page/CaptionUserPreferencesMediaAF.cpp:
707         (WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS):
708
709 2017-04-10  Chris Dumez  <cdumez@apple.com>
710
711         Drop Timer::startOneShot() overload taking a double
712         https://bugs.webkit.org/show_bug.cgi?id=170659
713
714         Reviewed by Yusuke Suzuki.
715
716         Drop Timer::startOneShot() overload taking a double as people should use Seconds type now.
717
718         * Modules/geolocation/GeoNotifier.cpp:
719         (WebCore::GeoNotifier::startTimerIfNeeded):
720         * Modules/mediasession/WebMediaSessionManager.cpp:
721         (WebCore::WebMediaSessionManager::configureWatchdogTimer):
722         * Modules/mediasession/WebMediaSessionManager.h:
723         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
724         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged):
725         * Modules/vibration/Vibration.cpp:
726         (WebCore::Vibration::timerFired):
727         * Modules/websockets/WebSocketChannel.cpp:
728         (WebCore::WebSocketChannel::close):
729         * accessibility/AXObjectCache.cpp:
730         (WebCore::AXObjectCache::enqueuePasswordValueChangeNotification):
731         (WebCore::AXObjectCache::postLiveRegionChangeNotification):
732         (WebCore::AXObjectCache::focusAriaModalNode):
733         * css/CSSFontFace.cpp:
734         (WebCore::CSSFontFace::setStatus):
735         * css/StyleResolver.cpp:
736         (WebCore::StyleResolver::addToMatchedPropertiesCache):
737         * dom/Document.cpp:
738         (WebCore::Document::setVisualUpdatesAllowed):
739         (WebCore::Document::finishedParsing):
740         * dom/ScriptedAnimationController.cpp:
741         * editing/AlternativeTextController.cpp:
742         (WebCore::AlternativeTextController::startAlternativeTextUITimer):
743         * html/HTMLMediaElement.cpp:
744         (WebCore::HTMLMediaElement::addBehaviorRestrictionsOnEndIfNecessary):
745         (WebCore::HTMLMediaElement::handleSeekToPlaybackPosition):
746         * html/SearchInputType.cpp:
747         (WebCore::SearchInputType::startSearchEventTimer):
748         * html/ValidationMessage.cpp:
749         (WebCore::ValidationMessage::setMessageDOMAndStartTimer):
750         * html/canvas/WebGLRenderingContextBase.cpp:
751         * html/shadow/MediaControlElements.cpp:
752         (WebCore::MediaControlPanelElement::startTimer):
753         (WebCore::MediaControlPanelElement::makeTransparent):
754         * html/track/VTTRegion.cpp:
755         (WebCore::VTTRegion::startTimer):
756         * inspector/InspectorInstrumentation.cpp:
757         (WebCore::InspectorInstrumentation::frameScheduledNavigationImpl):
758         * inspector/InspectorInstrumentation.h:
759         (WebCore::InspectorInstrumentation::frameScheduledNavigation):
760         * inspector/InspectorPageAgent.cpp:
761         (WebCore::InspectorPageAgent::frameScheduledNavigation):
762         * inspector/InspectorPageAgent.h:
763         * loader/NavigationScheduler.cpp:
764         (WebCore::NavigationScheduler::startTimer):
765         * loader/cache/CachedResourceLoader.cpp:
766         (WebCore::CachedResourceLoader::documentDidFinishLoadEvent):
767         * loader/icon/IconDatabase.cpp:
768         * page/EventHandler.cpp:
769         * page/EventSource.cpp:
770         (WebCore::EventSource::scheduleReconnect):
771         * page/FocusController.cpp:
772         (WebCore::FocusController::setFocusedElementNeedsRepaint):
773         * page/FrameView.cpp:
774         (WebCore::FrameView::scrollPositionChanged):
775         (WebCore::FrameView::enableSpeculativeTilingIfNeeded):
776         * page/Settings.cpp:
777         (WebCore::Settings::Settings):
778         * page/Settings.h:
779         (WebCore::Settings::setTimeWithoutMouseMovementBeforeHidingControls):
780         (WebCore::Settings::timeWithoutMouseMovementBeforeHidingControls):
781         * page/SuspendableTimer.h:
782         * page/animation/CSSAnimationController.cpp:
783         * page/mac/EventHandlerMac.mm:
784         * page/mac/TextIndicatorWindow.mm:
785         (WebCore::TextIndicatorWindow::setTextIndicator):
786         * platform/HysteresisActivity.h:
787         (WebCore::HysteresisActivity::stop):
788         * platform/ScrollAnimationSmooth.cpp:
789         (WebCore::getAnimationParametersForGranularity):
790         (WebCore::ScrollAnimationSmooth::updatePerAxisData):
791         (WebCore::ScrollAnimationSmooth::animateScroll):
792         (WebCore::ScrollAnimationSmooth::animationTimerFired):
793         (WebCore::ScrollAnimationSmooth::startNextTimer):
794         * platform/ScrollAnimationSmooth.h:
795         * platform/Timer.h:
796         (WebCore::TimerBase::startRepeating):
797         * platform/audio/PlatformMediaSession.cpp:
798         (WebCore::PlatformMediaSession::scheduleClientDataBufferingCheck):
799         * platform/cocoa/ScrollController.mm:
800         (WebCore::ScrollController::scheduleStatelessScrollSnap):
801         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
802         (WebCore::GameControllerGamepadProvider::gamepadHadInput):
803         * platform/gamepad/mac/HIDGamepadProvider.cpp:
804         (WebCore::HIDGamepadProvider::openAndScheduleManager):
805         (WebCore::HIDGamepadProvider::valuesChanged):
806         * platform/glib/MainThreadSharedTimerGLib.cpp:
807         (WebCore::MainThreadSharedTimer::setFireInterval):
808         * platform/graphics/BitmapImage.cpp:
809         (WebCore::BitmapImage::startTimer):
810         (WebCore::BitmapImage::internalStartAnimation):
811         (WebCore::BitmapImage::advanceAnimation):
812         (WebCore::BitmapImage::resetAnimation):
813         * platform/graphics/BitmapImage.h:
814         * platform/graphics/MediaPlaybackTargetPicker.cpp:
815         * platform/graphics/ShadowBlur.cpp:
816         (WebCore::ScratchBuffer::scheduleScratchBufferPurge):
817         * platform/graphics/ca/LayerPool.cpp:
818         (WebCore::LayerPool::schedulePrune):
819         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
820         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
821         * platform/graphics/mac/GraphicsContext3DMac.mm:
822         (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
823         * platform/graphics/texmap/BitmapTexturePool.cpp:
824         (WebCore::BitmapTexturePool::scheduleReleaseUnusedTextures):
825         (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
826         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
827         (WebCore::TextureMapperPlatformLayerProxy::scheduleReleaseUnusedBuffers):
828         (WebCore::TextureMapperPlatformLayerProxy::releaseUnusedBuffersTimerFired):
829         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
830         * platform/gtk/ScrollAnimatorGtk.cpp:
831         (WebCore::ScrollAnimatorGtk::overlayScrollbarAnimationTimerFired):
832         (WebCore::ScrollAnimatorGtk::showOverlayScrollbars):
833         (WebCore::ScrollAnimatorGtk::hideOverlayScrollbars):
834         * platform/gtk/ScrollAnimatorGtk.h:
835         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
836         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
837         * platform/mac/ScrollAnimatorMac.mm:
838         (WebCore::ScrollAnimatorMac::startScrollbarPaintTimer):
839         * platform/mock/MediaPlaybackTargetPickerMock.cpp:
840         * platform/mock/PlatformSpeechSynthesizerMock.cpp:
841         (WebCore::PlatformSpeechSynthesizerMock::speak):
842         * platform/mock/TimerEventBasedMock.h:
843         (WebCore::TimerEvent::TimerEvent):
844         * platform/network/DNSResolveQueue.cpp:
845         (WebCore::DNSResolveQueue::add):
846         (WebCore::DNSResolveQueue::timerFired):
847         * platform/network/PingHandle.h:
848         * platform/network/curl/ResourceHandleManager.cpp:
849         (WebCore::ResourceHandleManager::downloadTimerCallback):
850         (WebCore::ResourceHandleManager::add):
851         (WebCore::ResourceHandleManager::cancel):
852         * platform/network/mac/NetworkStateNotifierMac.cpp:
853         * platform/network/soup/ResourceHandleSoup.cpp:
854         (WebCore::ResourceHandle::sendPendingRequest):
855         * rendering/ImageQualityController.cpp:
856         (WebCore::ImageQualityController::restartTimer):
857         * rendering/RenderLayerCompositor.cpp:
858         * rendering/RenderProgress.cpp:
859         (WebCore::RenderProgress::RenderProgress):
860         * rendering/RenderProgress.h:
861         * rendering/RenderText.cpp:
862         (WebCore::SecureTextTimer::restart):
863         * rendering/RenderTheme.cpp:
864         (WebCore::RenderTheme::animationRepeatIntervalForProgressBar):
865         * rendering/RenderTheme.h:
866         (WebCore::RenderTheme::mediaControlsFadeOutDuration):
867         * rendering/RenderThemeGtk.cpp:
868         (WebCore::RenderThemeGtk::animationRepeatIntervalForProgressBar):
869         * rendering/RenderThemeGtk.h:
870         * rendering/RenderThemeIOS.h:
871         * rendering/RenderThemeIOS.mm:
872         (WebCore::RenderThemeIOS::animationRepeatIntervalForProgressBar):
873         * rendering/RenderThemeMac.h:
874         * rendering/RenderThemeMac.mm:
875         (WebCore::RenderThemeMac::animationRepeatIntervalForProgressBar):
876         (WebCore::RenderThemeMac::animationDurationForProgressBar):
877         * replay/EventLoopInputDispatcher.cpp:
878         (WebCore::EventLoopInputDispatcher::dispatchInputSoon):
879         * svg/animation/SMILTimeContainer.cpp:
880         (WebCore::SMILTimeContainer::startTimer):
881         * testing/InternalSettings.cpp:
882         (WebCore::InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls):
883         * testing/InternalSettings.h:
884         * testing/Internals.cpp:
885         (WebCore::Internals::setImageFrameDecodingDuration):
886         * xml/XMLHttpRequest.cpp:
887         (WebCore::XMLHttpRequest::createRequest):
888
889 2017-04-10  Miguel Gomez  <magomez@igalia.com>
890
891         REGRESSION(r205841): [GTK] Test fast/images/animated-png.html is failing since r205841
892         https://bugs.webkit.org/show_bug.cgi?id=168425
893
894         Reviewed by Said Abou-Hallawa.
895
896         There is a problem with animations that are blending their frames into the previous frame. Due to a change
897         in how pixel components are premultiplied (the result is now rounded up), the parameters to the blending
898         operation may vary in one unit, causing the result of the blending to be different from the expected result.
899         In order to fix this, a new parameter is added to indicate whether we want to use rounding up when
900         premultiplying or not, and ImageBackingStore uses that parameter to disable rounding up.
901
902         Adjusted the expectation for fast/images/animated-png.html, as it must pass now.
903
904         * platform/graphics/Color.cpp:
905         (WebCore::premultipliedChannel):
906         (WebCore::makePremultipliedRGBA):
907         * platform/graphics/Color.h:
908         * platform/graphics/ImageBackingStore.h:
909         (WebCore::ImageBackingStore::blendPixel):
910         (WebCore::ImageBackingStore::pixelValue):
911
912 2017-04-09  Wenson Hsieh  <wenson_hsieh@apple.com>
913
914         [WK2] Add infrastructure to perform actions after an asynchronous position information request finishes
915         https://bugs.webkit.org/show_bug.cgi?id=170658
916         <rdar://problem/31431450>
917
918         Reviewed by Tim Horton.
919
920         Minor adjustments to fix the build in the newest version of the SDK.
921
922         * platform/ios/WebItemProviderPasteboard.mm:
923         (-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]):
924         (-[WebItemProviderPasteboard _tryToCreateAndAppendObjectOfClass:toArray:usingProvider:]):
925
926 2017-04-09  Yusuke Suzuki  <utatane.tea@gmail.com>
927
928         [WTF] Annotate Seconds' member functions and operators with constexpr
929         https://bugs.webkit.org/show_bug.cgi?id=170662
930
931         Reviewed by Daniel Bates.
932
933         * page/Frame.cpp:
934
935 2017-04-09  Chris Dumez  <cdumez@apple.com>
936
937         Drop Timer::startRepeating() overload taking a double
938         https://bugs.webkit.org/show_bug.cgi?id=170656
939
940         Reviewed by Yusuke Suzuki.
941
942         Drop Timer::startRepeating() overload taking a double as people should use Seconds type now.
943
944         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
945         (WebCore::CanvasCaptureMediaStreamTrack::Source::startProducingData):
946         * editing/FrameSelection.cpp:
947         (WebCore::FrameSelection::updateAppearance):
948         * html/HTMLMediaElement.cpp:
949         (WebCore::HTMLMediaElement::startProgressEventTimer):
950         (WebCore::HTMLMediaElement::scheduleTimeupdateEvent):
951         * html/HTMLMediaElement.h:
952         * html/MediaController.cpp:
953         (MediaController::MediaController):
954         (MediaController::scheduleTimeupdateEvent):
955         * html/MediaController.h:
956         * html/MediaElementSession.cpp:
957         * inspector/InspectorOverlay.cpp:
958         (WebCore::InspectorOverlay::showPaintRect):
959         * loader/ProgressTracker.cpp:
960         * page/AutoscrollController.cpp:
961         * page/Frame.cpp:
962         * page/PageOverlay.cpp:
963         (WebCore::PageOverlay::startFadeAnimation):
964         * page/SuspendableTimer.h:
965         * page/WheelEventTestTrigger.cpp:
966         (WebCore::WheelEventTestTrigger::setTestCallbackAndStartNotificationTimer):
967         * platform/Theme.h:
968         (WebCore::Theme::caretBlinkInterval):
969         * platform/Timer.h:
970         * platform/cocoa/ScrollController.mm:
971         (WebCore::ScrollController::startSnapRubberbandTimer):
972         (WebCore::ScrollController::startScrollSnapTimer):
973         * platform/graphics/ca/TileGrid.cpp:
974         (WebCore::TileGrid::scheduleCohortRemoval):
975         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
976         (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
977         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
978         (WebCore::MockRealtimeAudioSourceMac::reconfigure):
979         * platform/mock/MockRealtimeAudioSource.cpp:
980         (WebCore::MockRealtimeAudioSource::startProducingData):
981         * platform/mock/MockRealtimeAudioSource.h:
982         (WebCore::MockRealtimeAudioSource::renderInterval):
983         * platform/mock/MockRealtimeVideoSource.cpp:
984         (WebCore::MockRealtimeVideoSource::startProducingData):
985         (WebCore::MockRealtimeVideoSource::applyFrameRate):
986         * rendering/RenderMarquee.cpp:
987         (WebCore::RenderMarquee::start):
988         (WebCore::RenderMarquee::updateMarqueeStyle):
989         * rendering/RenderTheme.h:
990         (WebCore::RenderTheme::caretBlinkInterval):
991         * rendering/RenderThemeGtk.cpp:
992         (WebCore::RenderThemeGtk::caretBlinkInterval):
993         * rendering/RenderThemeGtk.h:
994         * xml/XMLHttpRequestProgressEventThrottle.cpp:
995         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchThrottledProgressEvent):
996         * xml/XMLHttpRequestProgressEventThrottle.h:
997
998 2017-04-09  Fujii Hironori  <Hironori.Fujii@sony.com>
999
1000         generate-bindings-all.pl shouldn't use Perl threads
1001         https://bugs.webkit.org/show_bug.cgi?id=170106
1002
1003         Reviewed by Yusuke Suzuki.
1004
1005         The use of interpreter-based threads in Perl is officially
1006         discouraged and not all Linux distributions and BSD compile Perl
1007         with threads support. Use fork instead of threads to run
1008         generate-bindings.pl in parallel.
1009
1010         * bindings/scripts/generate-bindings-all.pl:
1011         (spawnGenerateBindingsIfNeeded): Added.
1012         (executeCommand): Removed the workaround for Cygwin Perl threads.
1013         (spawnCommand): Added.
1014         (worker): Deleted.
1015
1016 2017-04-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
1017
1018         REGRESSION(r214635): Calculate image subsampling only for CG
1019         https://bugs.webkit.org/show_bug.cgi?id=170353
1020
1021         Reviewed by Simon Fraser.
1022
1023         In r214635, we needed to calculate the image scaleFactor for all platforms.
1024         It was needed do the calculation: sizeForDrawing = sizeOfImage * imageScaleFactor.
1025         This made ImageSource::subsamplingLevelForScale() now returns a SubsamplingLevel
1026         not equal to SubsamplingLevel::Default if the image scaleFactor is greater
1027         than {1, 1} for all platforms. The subsamplingLevel should only be used for CG.
1028         
1029         This is also a chance to make nativeImageDrawingScale() a across platform
1030         function and move it to the GraphicsContext class.
1031
1032         * platform/graphics/BitmapImage.cpp:
1033         (WebCore::BitmapImage::draw):
1034         * platform/graphics/GraphicsContext.cpp:
1035         (WebCore::GraphicsContext::scaleFactorForDrawing):
1036         * platform/graphics/GraphicsContext.h:
1037         * platform/graphics/ImageSource.cpp:
1038         (WebCore::ImageSource::subsamplingLevelForScaleFactor):
1039         (WebCore::ImageSource::subsamplingLevelForScale): Deleted.
1040         * platform/graphics/ImageSource.h:
1041         * platform/graphics/NativeImage.h:
1042         * platform/graphics/cairo/NativeImageCairo.cpp:
1043         (WebCore::nativeImageDrawingScale): Deleted.
1044         * platform/graphics/cg/NativeImageCG.cpp:
1045         (WebCore::nativeImageDrawingScale): Deleted.
1046         * platform/graphics/win/NativeImageDirect2D.cpp:
1047         (WebCore::nativeImageDrawingScale): Deleted.
1048
1049 2017-04-09  Chris Dumez  <cdumez@apple.com>
1050
1051         Start dropping Timer API dealing with double
1052         https://bugs.webkit.org/show_bug.cgi?id=170649
1053
1054         Reviewed by Yusuke Suzuki.
1055
1056         Start dropping Timer API dealing with double as people should use Seconds now.
1057
1058         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1059         (WebCore::WebKitMediaKeySession::generateKeyRequest):
1060         (WebCore::WebKitMediaKeySession::update):
1061         * Modules/geolocation/GeoNotifier.cpp:
1062         (WebCore::GeoNotifier::setFatalError):
1063         (WebCore::GeoNotifier::setUseCachedPosition):
1064         * Modules/geolocation/Geolocation.cpp:
1065         (WebCore::Geolocation::resume):
1066         * Modules/indexeddb/IDBTransaction.cpp:
1067         (WebCore::IDBTransaction::schedulePendingOperationTimer):
1068         (WebCore::IDBTransaction::scheduleCompletedOperationTimer):
1069         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1070         (WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer):
1071         * Modules/mediasource/SourceBuffer.cpp:
1072         (WebCore::SourceBuffer::rangeRemoval):
1073         (WebCore::SourceBuffer::appendBufferInternal):
1074         * Modules/mediastream/MediaStream.cpp:
1075         (WebCore::MediaStream::scheduleActiveStateChange):
1076         * Modules/mediastream/RTCDTMFSender.cpp:
1077         (WebCore::RTCDTMFSender::scheduleDispatchEvent):
1078         * Modules/mediastream/RTCDataChannel.cpp:
1079         (WebCore::RTCDataChannel::scheduleDispatchEvent):
1080         * Modules/notifications/Notification.cpp:
1081         * Modules/notifications/NotificationCenter.cpp:
1082         (WebCore::NotificationCenter::requestPermission):
1083         * Modules/vibration/Vibration.cpp:
1084         (WebCore::Vibration::vibrate):
1085         * Modules/websockets/WebSocket.cpp:
1086         (WebCore::WebSocket::resume):
1087         * Modules/websockets/WebSocketChannel.cpp:
1088         (WebCore::WebSocketChannel::resume):
1089         * accessibility/AXObjectCache.cpp:
1090         (WebCore::AXObjectCache::postNotification):
1091         * bindings/js/GCController.cpp:
1092         (WebCore::GCController::garbageCollectOnNextRunLoop):
1093         * css/CSSFontSelector.cpp:
1094         (WebCore::CSSFontSelector::beginLoadingFontSoon):
1095         * dom/Document.cpp:
1096         (WebCore::Document::scheduleStyleRecalc):
1097         (WebCore::Document::updateFocusAppearanceSoon):
1098         (WebCore::Document::resumeScheduledTasks):
1099         (WebCore::Document::requestFullScreenForElement):
1100         (WebCore::Document::webkitDidEnterFullScreenForElement):
1101         (WebCore::Document::webkitDidExitFullScreenForElement):
1102         (WebCore::Document::decrementLoadEventDelayCount):
1103         (WebCore::Document::didAssociateFormControl):
1104         (WebCore::Document::setCachedDOMCookies):
1105         * dom/DocumentEventQueue.cpp:
1106         (WebCore::DocumentEventQueue::enqueueEvent):
1107         * dom/EventSender.h:
1108         (WebCore::EventSender<T>::dispatchEventSoon):
1109         * dom/Microtasks.cpp:
1110         (WebCore::MicrotaskQueue::append):
1111         * dom/ScriptRunner.cpp:
1112         (WebCore::ScriptRunner::resume):
1113         (WebCore::ScriptRunner::notifyFinished):
1114         * dom/ScriptableDocumentParser.cpp:
1115         (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheetsSoon):
1116         * editing/Editor.cpp:
1117         (WebCore::Editor::respondToChangedSelection):
1118         * editing/SpellChecker.cpp:
1119         (WebCore::SpellChecker::didCheck):
1120         * html/HTMLFormElement.cpp:
1121         (WebCore::HTMLFormElement::finishRequestAutocomplete):
1122         * html/HTMLMediaElement.cpp:
1123         (WebCore::HTMLMediaElement::scheduleDelayedAction):
1124         (WebCore::HTMLMediaElement::beginScanning):
1125         * html/HTMLPlugInElement.cpp:
1126         (WebCore::HTMLPlugInElement::setDisplayState):
1127         * html/HTMLSourceElement.cpp:
1128         (WebCore::HTMLSourceElement::scheduleErrorEvent):
1129         (WebCore::HTMLSourceElement::resume):
1130         * html/HTMLTrackElement.cpp:
1131         (WebCore::HTMLTrackElement::scheduleLoad):
1132         * html/MediaController.cpp:
1133         (MediaController::currentTime):
1134         (MediaController::scheduleEvent):
1135         * html/MediaDocument.cpp:
1136         (WebCore::MediaDocument::mediaElementSawUnsupportedTracks):
1137         * html/MediaElementSession.cpp:
1138         (WebCore::MediaElementSession::externalOutputDeviceAvailableDidChange):
1139         * html/ValidationMessage.cpp:
1140         (WebCore::ValidationMessage::setMessage):
1141         (WebCore::ValidationMessage::requestToHideMessage):
1142         * html/canvas/WebGLRenderingContextBase.cpp:
1143         (WebCore::WebGLRenderingContextBase::loseContextImpl):
1144         (WebCore::WebGLRenderingContextBase::forceRestoreContext):
1145         (WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
1146         * html/parser/HTMLParserScheduler.cpp:
1147         (WebCore::HTMLParserScheduler::continueNextChunkTimerFired):
1148         (WebCore::HTMLParserScheduler::scheduleForResume):
1149         (WebCore::HTMLParserScheduler::resume):
1150         * html/shadow/MediaControlElements.cpp:
1151         (WebCore::MediaControlTextTrackContainerElement::updateSizes):
1152         * html/track/LoadableTextTrack.cpp:
1153         (WebCore::LoadableTextTrack::scheduleLoad):
1154         * inspector/InspectorCSSAgent.cpp:
1155         (WebCore::ChangeRegionOversetTask::scheduleFor):
1156         * inspector/InspectorDOMAgent.cpp:
1157         (WebCore::RevalidateStyleAttributeTask::scheduleFor):
1158         * inspector/InspectorFrontendClientLocal.cpp:
1159         (WebCore::InspectorBackendDispatchTask::dispatch):
1160         (WebCore::InspectorBackendDispatchTask::timerFired):
1161         * inspector/WebHeapAgent.cpp:
1162         (WebCore::SendGarbageCollectionEventsTask::addGarbageCollection):
1163         * loader/DocumentLoader.cpp:
1164         (WebCore::DocumentLoader::startDataLoadTimer):
1165         (WebCore::DocumentLoader::deliverSubstituteResourcesAfterDelay):
1166         * loader/FrameLoader.cpp:
1167         (WebCore::FrameLoader::startCheckCompleteTimer):
1168         * loader/ImageLoader.cpp:
1169         (WebCore::ImageLoader::updatedHasPendingEvent):
1170         * loader/TextTrackLoader.cpp:
1171         (WebCore::TextTrackLoader::notifyFinished):
1172         (WebCore::TextTrackLoader::newCuesParsed):
1173         (WebCore::TextTrackLoader::fileFailedToParse):
1174         * loader/appcache/ApplicationCacheGroup.cpp:
1175         (WebCore::ApplicationCacheGroup::scheduleReachedMaxAppCacheSizeCallback):
1176         * loader/cache/CachedResource.cpp:
1177         (WebCore::CachedResource::Callback::Callback):
1178         * loader/cache/CachedResourceLoader.cpp:
1179         (WebCore::CachedResourceLoader::loadDone):
1180         * loader/cache/MemoryCache.cpp:
1181         (WebCore::MemoryCache::pruneSoon):
1182         * page/CaptionUserPreferences.cpp:
1183         (WebCore::CaptionUserPreferences::notify):
1184         * page/CaptionUserPreferencesMediaAF.cpp:
1185         (WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges):
1186         * page/DOMWindow.cpp:
1187         (WebCore::DOMWindow::postMessage):
1188         * page/DeviceController.cpp:
1189         (WebCore::DeviceController::addDeviceEventListener):
1190         * page/EventHandler.cpp:
1191         (WebCore::EventHandler::scheduleHoverStateUpdate):
1192         * page/EventSource.cpp:
1193         (WebCore::EventSource::scheduleInitialConnect):
1194         * page/FrameView.cpp:
1195         (WebCore::FrameView::layout):
1196         (WebCore::FrameView::performPostLayoutTasks):
1197         * page/Settings.cpp:
1198         (WebCore::Settings::setLoadsImagesAutomatically):
1199         (WebCore::Settings::setImagesEnabled):
1200         * page/SuspendableTimer.h:
1201         * page/animation/CSSAnimationController.cpp:
1202         (WebCore::CSSAnimationControllerPrivate::startUpdateStyleIfNeededDispatcher):
1203         * page/mac/ServicesOverlayController.mm:
1204         (WebCore::ServicesOverlayController::invalidateHighlightsOfType):
1205         * page/scrolling/AsyncScrollingCoordinator.cpp:
1206         (WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll):
1207         * page/scrolling/ios/ScrollingCoordinatorIOS.mm:
1208         (WebCore::ScrollingCoordinatorIOS::scheduleTreeStateCommit):
1209         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
1210         (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
1211         * platform/GenericTaskQueue.cpp:
1212         (WebCore::TaskDispatcher<Timer>::postTask):
1213         * platform/Scrollbar.cpp:
1214         (WebCore::Scrollbar::autoscrollPressedPart):
1215         (WebCore::Scrollbar::startTimerIfNeeded):
1216         * platform/Scrollbar.h:
1217         * platform/ScrollbarTheme.h:
1218         (WebCore::ScrollbarTheme::initialAutoscrollTimerDelay):
1219         (WebCore::ScrollbarTheme::autoscrollTimerDelay):
1220         * platform/Timer.cpp:
1221         * platform/Timer.h:
1222         (WebCore::TimerBase::startRepeating):
1223         (WebCore::TimerBase::startOneShot):
1224         (WebCore::TimerBase::augmentFireInterval):
1225         (WebCore::TimerBase::augmentRepeatInterval):
1226         * platform/gamepad/mac/HIDGamepadProvider.cpp:
1227         (WebCore::HIDGamepadProvider::deviceAdded):
1228         * platform/graphics/MediaPlayer.cpp:
1229         (WebCore::MediaPlayer::networkStateChanged):
1230         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
1231         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
1232         (WebCore::MediaSelectionGroupAVFObjC::setSelectedOption):
1233         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1234         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
1235         * platform/graphics/ca/TileCoverageMap.cpp:
1236         (WebCore::TileCoverageMap::setNeedsUpdate):
1237         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1238         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
1239         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
1240         (VideoRenderRequestScheduler::requestRender):
1241         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
1242         (WebCore::TextureMapperPlatformLayerProxy::scheduleUpdateOnCompositorThread):
1243         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1244         (WebCore::CoordinatedGraphicsLayer::addAnimation):
1245         * platform/gtk/ScrollAnimatorGtk.cpp:
1246         (WebCore::ScrollAnimatorGtk::showOverlayScrollbars):
1247         * platform/gtk/ScrollbarThemeGtk.h:
1248         * platform/ios/LegacyTileCache.mm:
1249         (WebCore::LegacyTileCache::finishedCreatingTiles):
1250         (WebCore::LegacyTileCache::setSpeculativeTileCreationEnabled):
1251         * platform/ios/ScrollbarThemeIOS.h:
1252         * platform/ios/ScrollbarThemeIOS.mm:
1253         (WebCore::ScrollbarThemeIOS::initialAutoscrollTimerDelay):
1254         (WebCore::ScrollbarThemeIOS::autoscrollTimerDelay):
1255         * platform/mac/ScrollAnimatorMac.mm:
1256         (WebCore::ScrollAnimatorMac::sendContentAreaScrolledSoon):
1257         * platform/mac/ScrollbarThemeMac.h:
1258         * platform/mac/ScrollbarThemeMac.mm:
1259         (WebCore::ScrollbarThemeMac::preferencesChanged):
1260         (WebCore::ScrollbarThemeMac::initialAutoscrollTimerDelay):
1261         (WebCore::ScrollbarThemeMac::autoscrollTimerDelay):
1262         * platform/mock/DeviceOrientationClientMock.cpp:
1263         (WebCore::DeviceOrientationClientMock::setOrientation):
1264         * platform/mock/GeolocationClientMock.cpp:
1265         (WebCore::GeolocationClientMock::asyncUpdatePermission):
1266         (WebCore::GeolocationClientMock::asyncUpdateController):
1267         * platform/mock/MockMediaEndpoint.cpp:
1268         (WebCore::MockMediaEndpoint::dispatchFakeIceCandidates):
1269         (WebCore::MockMediaEndpoint::iceCandidateTimerFired):
1270         (WebCore::MockMediaEndpoint::stepIceTransportStates):
1271         (WebCore::MockMediaEndpoint::iceTransportTimerFired):
1272         (WebCore::MockMediaEndpoint::unmuteRemoteSourcesByMid):
1273         (WebCore::MockMediaEndpoint::unmuteTimerFired):
1274         * platform/network/DataURLDecoder.cpp:
1275         (WebCore::DataURLDecoder::DecodingResultDispatcher::startTimer):
1276         * platform/network/ResourceHandle.cpp:
1277         (WebCore::ResourceHandle::scheduleFailure):
1278         (WebCore::ResourceHandle::setDefersLoading):
1279         * rendering/RenderLayerCompositor.cpp:
1280         (WebCore::RenderLayerCompositor::scheduleCompositingLayerUpdate):
1281         * rendering/RenderNamedFlowThread.cpp:
1282         (WebCore::RenderNamedFlowThread::dispatchRegionOversetChangeEventIfNeeded):
1283         * rendering/RenderScrollbarTheme.h:
1284         * rendering/RenderView.cpp:
1285         (WebCore::RenderView::scheduleLazyRepaint):
1286         * style/StyleScope.cpp:
1287         (WebCore::Style::Scope::scheduleUpdate):
1288         * svg/SVGElement.cpp:
1289         (WebCore::SVGElement::sendSVGLoadEventIfPossibleAsynchronously):
1290         * xml/XMLHttpRequest.cpp:
1291         (WebCore::XMLHttpRequest::prepareToSend):
1292         (WebCore::XMLHttpRequest::didFail):
1293         (WebCore::XMLHttpRequest::resume):
1294         * xml/XMLHttpRequestProgressEventThrottle.cpp:
1295         (WebCore::XMLHttpRequestProgressEventThrottle::resume):
1296
1297 2017-04-08  Myles C. Maxfield  <mmaxfield@apple.com>
1298
1299         [Variation Fonts] Width values of GX fonts are not mapped correctly
1300         https://bugs.webkit.org/show_bug.cgi?id=170367
1301
1302         Reviewed by Simon Fraser.
1303
1304         For some reason, when I performed my calculations for how to map the 'wdth' axis of GX-style
1305         variation fonts, I thought that font-stretch: 100% should map to a variation value of 0.0.
1306         Instead, this should map to 1.0.
1307
1308         Test: fast/text/variations/gx-width.html
1309
1310         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1311         (WebCore::denormalizeSlope):
1312         (WebCore::denormalizeVariationWidth):
1313         (WebCore::normalizeVariationWidth):
1314         (WebCore::normalizeWidth):
1315         (WebCore::preparePlatformFont):
1316         (WebCore::variationCapabilitiesForFontDescriptor):
1317         (WebCore::denormalizeWidth): Deleted.
1318
1319 2017-04-08  Eric Carlson  <eric.carlson@apple.com>
1320
1321         [MediaStream Mac] Revert change of Mac video capture format
1322         https://bugs.webkit.org/show_bug.cgi?id=170642
1323         <rdar://problem/31520492>
1324
1325         Reviewed by Sam Weinig.
1326
1327         Revert r214968 which changed macOS video capture format to kCVPixelFormatType_420YpCbCr8BiPlanarFullRange
1328         from kCVPixelFormatType_420YpCbCr8Planar because AVSampleBufferDisplayLayer sometimes fails
1329         to display the former.
1330
1331         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1332
1333 2017-04-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
1334
1335         A synchronous DecodingOptions should be compatible with any asynchronous sizeForDrawing DecodingOptions
1336         https://bugs.webkit.org/show_bug.cgi?id=170577
1337
1338         Reviewed by Simon Fraser.
1339
1340         Once a synchronous decoded frame is found, there is no need to decode it
1341         again. This decoded frame is suitable for any sizeForDrawing. This will
1342         prevent double decoding if one image client wants synchronous decoded
1343         frame while the other needs an asynchronous decode frame for a specific
1344         sizeForDrawing.
1345
1346         Test: fast/images/async-image-background-image-repeated.html
1347
1348         * platform/graphics/DecodingOptions.h:
1349         (WebCore::DecodingOptions::DecodingOptions):
1350         (WebCore::DecodingOptions::isNone):
1351         (WebCore::DecodingOptions::isAsynchronousCompatibleWith):
1352
1353 2017-04-08  Simon Fraser  <simon.fraser@apple.com>
1354
1355         Align the timers for throttled rAF to reduce power usage
1356         https://bugs.webkit.org/show_bug.cgi?id=170630
1357         rdar://problem/31490620
1358
1359         Reviewed by Chris Dumez.
1360
1361         Align the timers for all throttled ScriptedAnimationControllers in the process with
1362         a resolution of 30ms, which reduces process wake-ups and thus saves power.
1363
1364         * dom/ScriptedAnimationController.cpp:
1365         (WebCore::ScriptedAnimationController::scheduleAnimation):
1366
1367 2017-04-08  Chris Dumez  <cdumez@apple.com>
1368
1369         Drop std::chrono support from Timer class
1370         https://bugs.webkit.org/show_bug.cgi?id=170645
1371
1372         Reviewed by Sam Weinig.
1373
1374         Drop std::chrono support from Timer class now that we prefer using Seconds type.
1375
1376         * css/CSSImageGeneratorValue.cpp:
1377         * html/HTMLPlugInImageElement.cpp:
1378         * html/canvas/WebGLRenderingContextBase.cpp:
1379         * loader/cache/CachedResource.cpp:
1380         (WebCore::deadDecodedDataDeletionIntervalForResourceType):
1381         (WebCore::CachedResource::destroyDecodedDataIfNeeded):
1382         * loader/cache/MemoryCache.cpp:
1383         (WebCore::MemoryCache::MemoryCache):
1384         * loader/cache/MemoryCache.h:
1385         (WebCore::MemoryCache::setDeadDecodedDataDeletionInterval):
1386         (WebCore::MemoryCache::deadDecodedDataDeletionInterval):
1387         * page/PerformanceMonitor.cpp:
1388         * page/SuspendableTimer.h:
1389         * page/mac/ServicesOverlayController.h:
1390         * page/mac/ServicesOverlayController.mm:
1391         (WebCore::ServicesOverlayController::selectionRectsDidChange):
1392         (WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown):
1393         (WebCore::ServicesOverlayController::determineActiveHighlight):
1394         (WebCore::ServicesOverlayController::mouseEvent):
1395         * platform/Timer.h:
1396         (WebCore::TimerBase::startRepeating):
1397         (WebCore::TimerBase::startOneShot):
1398         (WebCore::TimerBase::augmentFireInterval):
1399         (WebCore::TimerBase::augmentRepeatInterval):
1400         (WebCore::DeferrableOneShotTimer::DeferrableOneShotTimer):
1401         * platform/graphics/FontCache.cpp:
1402         (WebCore::FontCache::fontForFamily):
1403         * platform/graphics/ca/TileController.cpp:
1404         * platform/graphics/cg/IOSurfacePool.cpp:
1405         * platform/graphics/cg/SubimageCacheWithTimer.cpp:
1406         * xml/XMLHttpRequest.cpp:
1407         (WebCore::XMLHttpRequest::setTimeout):
1408         (WebCore::XMLHttpRequest::createRequest):
1409         * xml/XMLHttpRequest.h:
1410
1411 2017-04-08  Simon Fraser  <simon.fraser@apple.com>
1412
1413         Update CSSProperties.json with correct fill-and-stroke status, and other cleanup
1414         https://bugs.webkit.org/show_bug.cgi?id=170643
1415
1416         Reviewed by Chris Dumez.
1417
1418         Structural changes:
1419             - move implementation-related "comment" blocks into "codegen-properties"
1420             - move status-related "comment" blocks into "status"
1421         
1422         Add the concept of "obsolete-category" and "obsolete-url" for properties
1423         like the text-fill-and-stroke properties that used to be specified in SVG but
1424         now have their own module shared with CSS.
1425         
1426         Update the status of paint-order, stroke-linecap, stroke-linejoin, stroke-miterlimit
1427         and stroke-width to "supported", overriding the default for css-text-fill-and-stroke which
1428         is "under consideration".
1429         
1430         Add display values "flow" and "flow-root" but mark them as unimplemented.
1431         
1432         Fix makeprop.pl to ignore comments inside codegen-properties.
1433
1434         * css/CSSProperties.json:
1435         * css/makeprop.pl:
1436         (addProperty):
1437
1438 2017-04-08  Eric Carlson  <eric.carlson@apple.com>
1439
1440         [MediaStream iOS] Update muted state when interrupted
1441         https://bugs.webkit.org/show_bug.cgi?id=170605
1442         <rdar://problem/31503896>
1443
1444         Reviewed by Youenn Fablet.
1445
1446         * platform/mediastream/RealtimeMediaSource.cpp:
1447         (WebCore::RealtimeMediaSource::setMuted): Don't check both m_stopped and stopped(). Split code
1448         to  notify observers out into notifyMutedObservers.
1449         (WebCore::RealtimeMediaSource::notifyMutedObservers): Split from setMuted.
1450         * platform/mediastream/RealtimeMediaSource.h:
1451
1452         * platform/mediastream/mac/AVMediaCaptureSource.h:
1453         * platform/mediastream/mac/AVMediaCaptureSource.mm:
1454         (WebCore::AVMediaCaptureSource::captureSessionIsRunningDidChange): Set m_muted directly and 
1455         call notifyMutedObservers because the session has already stopped running.
1456         (WebCore::AVMediaCaptureSource::isProducingData): Move from .h file to make debugging easier.
1457
1458 2017-04-08  Simon Fraser  <simon.fraser@apple.com>
1459
1460         Unprefix CSS cursor values grab and grabbing
1461         https://bugs.webkit.org/show_bug.cgi?id=170543
1462
1463         Reviewed by Jon Lee.
1464
1465         Add support for unprefixed "grab" and "grabbing" values for cursor (retaining
1466         support for the prefixed values) which are now in <https://drafts.csswg.org/css-ui-3/#cursor>
1467
1468         Canonicalize the order of the values based on the order in the spec in the enums
1469         and switch statements.
1470
1471         Tested by fast/css/cursor-parsing.html
1472
1473         * css/CSSPrimitiveValueMappings.h:
1474         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1475         (WebCore::CSSPrimitiveValue::operator ECursor):
1476         * css/CSSProperties.json:
1477         * css/CSSValueKeywords.in:
1478         * page/EventHandler.cpp:
1479         (WebCore::EventHandler::selectCursor):
1480         * rendering/style/RenderStyleConstants.h:
1481
1482 2017-04-08  Youenn Fablet  <youenn@apple.com>
1483
1484         WebRTC tests gardening
1485         https://bugs.webkit.org/show_bug.cgi?id=170508
1486
1487         Reviewed by Eric Carlson.
1488
1489         * Configurations/FeatureDefines.xcconfig: Changing webrtc enabling for ios.
1490
1491 2017-04-08  Youenn Fablet  <youenn@apple.com>
1492
1493         MediaStreamTrack id should be preserved by PeerConnection
1494         https://bugs.webkit.org/show_bug.cgi?id=170624
1495
1496         Reviewed by Eric Carlson.
1497
1498         Covered by updated test.
1499
1500         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1501         (WebCore::createReceiverForSource): Setting track id according source id.
1502
1503 2017-04-08  Chris Dumez  <cdumez@apple.com>
1504
1505         Timer's nextFireInterval() / repeatInterval() should return Seconds
1506         https://bugs.webkit.org/show_bug.cgi?id=170639
1507
1508         Reviewed by Simon Fraser.
1509
1510         Timer's nextFireInterval() / repeatInterval() should return Seconds, not double.
1511
1512         * loader/NavigationScheduler.cpp:
1513         * page/DOMTimer.cpp:
1514         (WebCore::DOMTimer::updateTimerIntervalIfNecessary):
1515         * page/SuspendableTimer.cpp:
1516         (WebCore::SuspendableTimer::suspend):
1517         (WebCore::SuspendableTimer::repeatInterval):
1518         * page/SuspendableTimer.h:
1519         * page/animation/AnimationBase.cpp:
1520         (WebCore::AnimationBase::timeToNextService):
1521         (WebCore::AnimationBase::getTimeToNextEvent):
1522         (WebCore::AnimationBase::goIntoEndingOrLoopingState):
1523         * page/animation/AnimationBase.h:
1524         * page/animation/CSSAnimationController.cpp:
1525         (WebCore::CSSAnimationControllerPrivate::updateAnimations):
1526         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimerForRenderer):
1527         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
1528         (WebCore::CSSAnimationControllerPrivate::animationFrameCallbackFired):
1529         * page/animation/CSSAnimationControllerPrivate.h:
1530         * page/animation/CompositeAnimation.cpp:
1531         (WebCore::CompositeAnimation::timeToNextService):
1532         * page/animation/CompositeAnimation.h:
1533         * page/animation/ImplicitAnimation.cpp:
1534         (WebCore::ImplicitAnimation::timeToNextService):
1535         * page/animation/ImplicitAnimation.h:
1536         * page/animation/KeyframeAnimation.cpp:
1537         (WebCore::KeyframeAnimation::timeToNextService):
1538         * page/animation/KeyframeAnimation.h:
1539         * platform/ThreadTimers.cpp:
1540         (WebCore::ThreadTimers::sharedTimerFiredInternal):
1541         * platform/Timer.cpp:
1542         (WebCore::TimerBase::nextFireInterval):
1543         * platform/Timer.h:
1544         (WebCore::TimerBase::repeatInterval):
1545         * platform/graphics/ca/TileController.cpp:
1546         (WebCore::TileController::setIsInWindow):
1547         (WebCore::TileController::scheduleTileRevalidation):
1548         * platform/graphics/ca/TileController.h:
1549         * platform/graphics/ca/TileGrid.cpp:
1550         (WebCore::TileGrid::revalidateTiles):
1551
1552 2017-04-08  Csaba Osztrogonác  <ossy@webkit.org>
1553
1554         Unreviewed Mac cmake buildfix after r215051, just for fun.
1555         https://bugs.webkit.org/show_bug.cgi?id=169761
1556
1557         * PlatformMac.cmake:
1558
1559 2017-04-07  Simon Fraser  <simon.fraser@apple.com>
1560
1561         Build fix: TimerBase::start(double, double) can't be inline and exported,
1562         so make it non-inline.
1563
1564         * platform/Timer.cpp:
1565         (WebCore::TimerBase::start):
1566         * platform/Timer.h:
1567         (WebCore::TimerBase::start): Deleted.
1568
1569 2017-04-07  Chris Dumez  <cdumez@apple.com>
1570
1571         REGRESSION (r203941): iAd Producer widgets fail to play in iBooks
1572         https://bugs.webkit.org/show_bug.cgi?id=170635
1573         <rdar://problem/30797958>
1574
1575         Reviewed by Daniel Bates.
1576
1577         Extend the MouseEvent::initMouseEvent() workaround we added for iAd Producer
1578         to iBooks since the iBooks widgets generated by iAd Producer contain the same
1579         bug.
1580
1581         * dom/MouseEvent.cpp:
1582         (WebCore::MouseEvent::initMouseEventQuirk):
1583
1584 2017-04-07  Chris Dumez  <cdumez@apple.com>
1585
1586         Start using MonotonicTime / Seconds in Timer class
1587         https://bugs.webkit.org/show_bug.cgi?id=170625
1588
1589         Reviewed by Simon Fraser.
1590
1591         Start using MonotonicTime / Seconds in Timer class. More work will be needed
1592         for the transition to be complete. I plan to do this in a follow-up.
1593
1594         * page/DOMTimer.cpp:
1595         (WebCore::DOMTimer::alignedFireTime):
1596         * page/DOMTimer.h:
1597         * page/SuspendableTimer.cpp:
1598         (WebCore::SuspendableTimer::suspend):
1599         (WebCore::SuspendableTimer::startRepeating):
1600         (WebCore::SuspendableTimer::startOneShot):
1601         (WebCore::SuspendableTimer::repeatInterval):
1602         (WebCore::SuspendableTimer::augmentFireInterval):
1603         (WebCore::SuspendableTimer::augmentRepeatInterval):
1604         * page/SuspendableTimer.h:
1605         (WebCore::SuspendableTimer::startRepeating):
1606         (WebCore::SuspendableTimer::startOneShot):
1607         (WebCore::SuspendableTimer::augmentFireInterval):
1608         (WebCore::SuspendableTimer::augmentRepeatInterval):
1609         * platform/ThreadTimers.cpp:
1610         (WebCore::ThreadTimers::ThreadTimers):
1611         (WebCore::ThreadTimers::setSharedTimer):
1612         (WebCore::ThreadTimers::updateSharedTimer):
1613         (WebCore::ThreadTimers::sharedTimerFiredInternal):
1614         (WebCore::ThreadTimers::fireTimersInNestedEventLoop):
1615         * platform/ThreadTimers.h:
1616         * platform/Timer.cpp:
1617         (WebCore::TimerHeapLessThanFunction::operator()):
1618         (WebCore::TimerBase::TimerBase):
1619         (WebCore::TimerBase::start):
1620         (WebCore::TimerBase::stop):
1621         (WebCore::TimerBase::nextFireInterval):
1622         (WebCore::TimerBase::heapPop):
1623         (WebCore::TimerBase::updateHeapIfNeeded):
1624         (WebCore::TimerBase::setNextFireTime):
1625         (WebCore::TimerBase::nextUnalignedFireInterval):
1626         * platform/Timer.h:
1627         (WebCore::TimerBase::start):
1628         (WebCore::TimerBase::startOneShot):
1629         (WebCore::TimerBase::repeatInterval):
1630         (WebCore::TimerBase::repeatIntervalSeconds):
1631         (WebCore::TimerBase::augmentFireInterval):
1632         (WebCore::TimerBase::augmentRepeatInterval):
1633         (WebCore::TimerBase::alignedFireTime):
1634         (WebCore::TimerBase::isActive):
1635         * testing/Internals.cpp:
1636         (WebCore::Internals::isTimerThrottled):
1637
1638 2017-04-07  Yuichiro Kikura  <y.kikura@gmail.com>
1639
1640         WebGPU: implement ComputeCommandEncoder and related components
1641         https://bugs.webkit.org/show_bug.cgi?id=170444
1642
1643         Reviewed by Alex Christensen.
1644
1645         I implemented WebGPUComputeCommandEncoder and related components based on the WebGPU proposal.
1646         https://webkit.org/wp-content/uploads/webgpu-api-proposal.html
1647
1648         Test: fast/canvas/webgpu/webgpu-dispatch.html
1649
1650         * CMakeLists.txt:
1651         * DerivedSources.make:
1652         * PlatformMac.cmake:
1653         * WebCore.xcodeproj/project.pbxproj:
1654         * bindings/js/JSWebGPUCommandBufferCustom.cpp: Added.
1655         (WebCore::JSWebGPUCommandBuffer::completed):
1656         * html/canvas/WebGPUCommandBuffer.cpp:
1657         (WebCore::WebGPUCommandBuffer::createComputeCommandEncoder):
1658         * html/canvas/WebGPUCommandBuffer.h:
1659         * html/canvas/WebGPUCommandBuffer.idl:
1660         * html/canvas/WebGPUComputeCommandEncoder.cpp: Added.
1661         (WebCore::GPUSizeMake):
1662         (WebCore::WebGPUComputeCommandEncoder::create):
1663         (WebCore::WebGPUComputeCommandEncoder::WebGPUComputeCommandEncoder):
1664         (WebCore::WebGPUComputeCommandEncoder::~WebGPUComputeCommandEncoder):
1665         (WebCore::WebGPUComputeCommandEncoder::setComputePipelineState):
1666         (WebCore::WebGPUComputeCommandEncoder::setBuffer):
1667         (WebCore::WebGPUComputeCommandEncoder::dispatch):
1668         (WebCore::WebGPUComputeCommandEncoder::endEncoding):
1669         * html/canvas/WebGPUComputeCommandEncoder.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.h.
1670         (WebCore::WebGPUComputeCommandEncoder::computeCommandEncoder):
1671         * html/canvas/WebGPUComputeCommandEncoder.idl: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
1672         * html/canvas/WebGPUComputePipelineState.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.cpp.
1673         (WebCore::WebGPUComputePipelineState::create):
1674         (WebCore::WebGPUComputePipelineState::WebGPUComputePipelineState):
1675         (WebCore::WebGPUComputePipelineState::~WebGPUComputePipelineState):
1676         * html/canvas/WebGPUComputePipelineState.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.h.
1677         (WebCore::WebGPUComputePipelineState::computePipelineState):
1678         * html/canvas/WebGPUComputePipelineState.idl: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
1679         * html/canvas/WebGPURenderingContext.cpp:
1680         (WebCore::WebGPURenderingContext::createComputePipelineState):
1681         * html/canvas/WebGPURenderingContext.h:
1682         * html/canvas/WebGPURenderingContext.idl:
1683         * html/canvas/WebGPUSize.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
1684         * html/canvas/WebGPUSize.idl: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
1685         * platform/graphics/cocoa/GPUCommandBufferMetal.mm:
1686         (WebCore::GPUCommandBuffer::completed):
1687         * platform/graphics/cocoa/GPUComputeCommandEncoderMetal.mm: Added.
1688         (WebCore::MTLSizeMake):
1689         (WebCore::GPUComputeCommandEncoder::GPUComputeCommandEncoder):
1690         (WebCore::GPUComputeCommandEncoder::setComputePipelineState):
1691         (WebCore::GPUComputeCommandEncoder::setBuffer):
1692         (WebCore::GPUComputeCommandEncoder::dispatch):
1693         (WebCore::GPUComputeCommandEncoder::endEncoding):
1694         (WebCore::GPUComputeCommandEncoder::platformComputeCommandEncoder):
1695         * platform/graphics/cocoa/GPUComputePipelineStateMetal.mm: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.cpp.
1696         (WebCore::GPUComputePipelineState::GPUComputePipelineState):
1697         (WebCore::GPUComputePipelineState::platformComputePipelineState):
1698         * platform/graphics/gpu/GPUCommandBuffer.cpp:
1699         (WebCore::GPUCommandBuffer::createComputeCommandEncoder):
1700         * platform/graphics/gpu/GPUCommandBuffer.h:
1701         * platform/graphics/gpu/GPUComputeCommandEncoder.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.cpp.
1702         (WebCore::GPUComputeCommandEncoder::create):
1703         (WebCore::GPUComputeCommandEncoder::~GPUComputeCommandEncoder):
1704         (WebCore::GPUComputeCommandEncoder::setComputePipelineState):
1705         (WebCore::GPUComputeCommandEncoder::setBuffer):
1706         (WebCore::GPUComputeCommandEncoder::endEncoding):
1707         * platform/graphics/gpu/GPUComputeCommandEncoder.h: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h.
1708         * platform/graphics/gpu/GPUComputePipelineState.cpp: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
1709         (WebCore::GPUComputePipelineState::create):
1710         (WebCore::GPUComputePipelineState::~GPUComputePipelineState):
1711         * platform/graphics/gpu/GPUComputePipelineState.h: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h.
1712         * platform/graphics/gpu/GPUSize.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
1713
1714 2017-04-07  Alex Christensen  <achristensen@webkit.org>
1715
1716         Private browsing sessions should not look in keychain for client certificates
1717         https://bugs.webkit.org/show_bug.cgi?id=170618
1718         <rdar://problem/18457427>
1719
1720         Reviewed by Dan Bernstein.
1721
1722         Our client certificate testing in WebKit leaves much to be desired.
1723         See rdar://problem/17694210 for reproduction steps.
1724
1725         * platform/spi/cf/CFNetworkSPI.h:
1726         Add some new SPI.
1727
1728 2017-04-07  Zalan Bujtas  <zalan@apple.com>
1729
1730         Simple line layout: FlowContents::segmentIndexForRunSlow skips empty runs.
1731         https://bugs.webkit.org/show_bug.cgi?id=170552
1732
1733         Reviewed by Antti Koivisto.
1734
1735         The compare function passed to std::lower_bound completely misses empty runs. 
1736
1737         Test: fast/text/simple-line-layout-hover-over-subsequent-linebreaks.html
1738
1739         * rendering/SimpleLineLayoutFlowContents.cpp:
1740         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForRunSlow):
1741
1742 2017-04-07  Chris Dumez  <cdumez@apple.com>
1743
1744         We should log how much CPU a background process was using when killing it due to CPU limiting
1745         https://bugs.webkit.org/show_bug.cgi?id=170619
1746
1747         Reviewed by Andreas Kling.
1748
1749         CPUMonitor now passes the CPU usage to the callback when it exceeds the threashold.
1750
1751         * platform/CPUMonitor.cpp:
1752         (WebCore::CPUMonitor::timerFired):
1753         * platform/CPUMonitor.h:
1754
1755 2017-04-07  Chris Dumez  <cdumez@apple.com>
1756
1757         Audible autoplay videos should not get paused when outside the viewport
1758         https://bugs.webkit.org/show_bug.cgi?id=170610
1759         <rdar://problem/31505984>
1760
1761         Reviewed by Eric Carlson.
1762
1763         Audible autoplay videos should not get paused when outside the viewport as this
1764         would be observable by the user.
1765
1766         Test: media/video-restricted-invisible-autoplay-allowed-if-audible.html
1767
1768         * html/MediaElementSession.cpp:
1769         (WebCore::MediaElementSession::autoplayPermitted):
1770
1771 2017-04-07  Myles C. Maxfield  <mmaxfield@apple.com>
1772
1773         REGRESSION(r211382): Complex text with justification erroneously overflows containers
1774         https://bugs.webkit.org/show_bug.cgi?id=170399
1775         <rdar://problem/31442008>
1776
1777         Reviewed by Simon Fraser.
1778
1779         When we perform justification, we adjust glyphs' advances to add extra space between words.
1780         ComplexTextController maintains an invariant where m_totalWidth is equal to the sum of these
1781         advances. However, in RTL text, inserting extra justification space to the left of a glyph
1782         would break that invariant, and would increase the advances of two glyphs instead of just
1783         one. Then, when we go to draw the text, the sum of the advances is wider than m_totalWidth,
1784         which means the glyphs would be drawn outside of their container.
1785
1786         This regressed in r211382 simply because of an oversight and because there were no tests for
1787         this codepath.
1788
1789         Test: ComplexTextControllerTest.TotalWidthWithJustification
1790
1791         * platform/graphics/ComplexTextController.cpp:
1792         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
1793         * rendering/InlineBox.h:
1794         (WebCore::InlineBox::InlineBox):
1795
1796 2017-04-07  Chris Dumez  <cdumez@apple.com>
1797
1798         Throttle / Align DOM Timers in cross-origin iframes to 30fps
1799         https://bugs.webkit.org/show_bug.cgi?id=170613
1800         <rdar://problem/31506444>
1801
1802         Reviewed by Simon Fraser.
1803
1804         Throttle / Align DOM Timers in cross-origin iframes to 30fps unless the user
1805         has interacted with them, in order to reduce power use.
1806
1807         Test: http/tests/frame-throttling/timer-throttle-in-cross-origin-subframe.html
1808
1809         * dom/Document.cpp:
1810         (WebCore::Document::domTimerAlignmentInterval):
1811         (WebCore::Document::updateLastHandledUserGestureTimestamp):
1812         * page/DOMTimer.h:
1813
1814 2017-04-07  John Wilander  <wilander@apple.com>
1815
1816         Follow-up fix for Soup platform.
1817         https://bugs.webkit.org/show_bug.cgi?id=170322
1818
1819         Unreviewed build fix. Error introduced by me in
1820         https://trac.webkit.org/changeset/215104/webkit.
1821
1822         No new tests.
1823
1824         * platform/network/soup/SocketStreamHandleImpl.h:
1825             Move parameter change to the right
1826             SocketStreamHandleImpl::create() function.
1827
1828 2017-04-07  John Wilander  <wilander@apple.com>
1829
1830         WebSocket streams should have network usage attributed to correct process
1831         https://bugs.webkit.org/show_bug.cgi?id=170322
1832         <rdar://problem/26413551>
1833
1834         Reviewed by Alex Christensen.
1835
1836         Tested manually since it requires a per-app VPN.
1837
1838         * page/SocketProvider.cpp:
1839         (WebCore::SocketProvider::createSocketStreamHandle):
1840             Sends in an empty struct since it doesn't have access to
1841             platform dependent sourceApplicationAuditData.
1842         * platform/network/SocketStreamHandle.h:
1843             Declaration of a per-platform struct to hold CF data for
1844             Cocoa platforms.
1845         * platform/network/cf/SocketStreamHandleImpl.h:
1846         (WebCore::SocketStreamHandleImpl::create):
1847             Now takes WebCore::SourceApplicationAuditToken which is
1848             passed on to the constructor.
1849         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1850         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
1851             Now takes WebCore::SourceApplicationAuditToken which is
1852             passed on to the streams once created.
1853         (WebCore::SocketStreamHandleImpl::createStreams):
1854             Now sets kCFStreamPropertySourceApplication for the two
1855             streams.
1856         * platform/network/curl/SocketStreamHandleImpl.h:
1857         (WebCore::SocketStreamHandleImpl::create):
1858             Added unused WebCore::SourceApplicationAuditToken parameter.
1859         * platform/network/soup/SocketStreamHandleImpl.h:
1860         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
1861         (WebCore::SocketStreamHandleImpl::create):
1862             Added unused WebCore::SourceApplicationAuditToken parameter.
1863
1864 2017-04-07  Alex Christensen  <achristensen@webkit.org>
1865
1866         REGRESSION(r204512): WebSocket errors with "Failed to send WebSocket frame."  if too much data is sent
1867         https://bugs.webkit.org/show_bug.cgi?id=170463
1868
1869         Reviewed by Michael Catanzaro.
1870
1871         This only reproduces when using WebSockets to communicate with an external server.
1872         When communicating with a local server, CFWriteStreamWrite succeeds too reliably, so
1873         CFWriteStreamCanAcceptBytes returns true, when sometimes it doesn't when communicating
1874         across the real internet.
1875
1876         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1877         (WebCore::SocketStreamHandleImpl::platformSendInternal):
1878         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
1879         (WebCore::SocketStreamHandleImpl::platformSendInternal):
1880         Returning std::nullopt means there was an error, which is not true when the socket stream
1881         is in a state where it cannot be written to because it is actively communicating.
1882         Returning 0 means 0 new bytes were sent, so we will try again later.
1883
1884 2017-04-07  Eric Carlson  <eric.carlson@apple.com>
1885
1886         MediaSample should store video sample rotation instead of orientation
1887         https://bugs.webkit.org/show_bug.cgi?id=170598
1888
1889         Reviewed by Youenn Fablet.
1890
1891         No new tests, no functional change.
1892
1893         * platform/MediaSample.h:
1894         (WebCore::MediaSample::videoRotation):
1895         (WebCore::MediaSample::videoOrientation): Deleted.
1896         * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
1897         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1898         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1899         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix):
1900         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
1901         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayLayer):
1902
1903         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1904         (WebCore::AVVideoCaptureSource::processNewFrame):
1905
1906         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
1907         (WebCore::RealtimeIncomingVideoSource::OnFrame):
1908         (WebCore::RealtimeIncomingVideoSource::processNewSample):
1909         * platform/mediastream/mac/RealtimeIncomingVideoSource.h:
1910
1911         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
1912         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
1913
1914 2017-04-07  Brent Fulgham  <bfulgham@apple.com>
1915
1916         WebKit should percent encode single quotes in query strings
1917         https://bugs.webkit.org/show_bug.cgi?id=170561
1918         <rdar://problem/7415154>
1919
1920         Reviewed by Alex Christensen.
1921
1922         Modify the characterClassTable to instruct the URLParser to convert
1923         the single-quote character ' to %27 in URL query strings.
1924
1925         Tests: URLParserTest in TestWebKitAPI.
1926             fast/events/popup-blocked-from-unique-frame-via-window-open-named-sibling-frame.html
1927             fast/frames/xss-auditor-handles-file-urls.html
1928             http/tests/security/xssAuditor
1929
1930         * platform/URLParser.cpp:
1931
1932 2017-04-07  Zalan Bujtas  <zalan@apple.com>
1933
1934         Text insertion cursor disappears after pressing enter
1935         https://bugs.webkit.org/show_bug.cgi?id=169291
1936         <rdar://problem/30899611>
1937
1938         Reviewed by Tim Horton.
1939
1940         Positon upstream/downstream (as the result of VisiblePosition -> canonicalPosition) require
1941         linebox tree. In addition to regular text, we need to bail out of simple line layout on line breaks too.
1942
1943         Test: editing/simple-line-layout-caret-is-gone.html
1944
1945         * dom/Position.cpp:
1946         (WebCore::ensureLineBoxesIfNeeded):
1947         (WebCore::Position::upstream):
1948         (WebCore::Position::downstream):
1949         (WebCore::Position::getInlineBoxAndOffset):
1950         * rendering/RenderLineBreak.cpp:
1951         (WebCore::RenderLineBreak::ensureLineBoxes):
1952         (WebCore::RenderLineBreak::positionForPoint):
1953         (WebCore::RenderLineBreak::setSelectionState):
1954         (WebCore::RenderLineBreak::collectSelectionRects):
1955         (WebCore::ensureLineBoxes): Deleted.
1956         * rendering/RenderLineBreak.h:
1957
1958 2017-04-07  Xan Lopez  <xlopez@igalia.com>
1959
1960         [GTK] Fix codec name in OWR ASSERT
1961         https://bugs.webkit.org/show_bug.cgi?id=170600
1962
1963         Reviewed by Carlos Garcia Campos.
1964
1965         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
1966         (WebCore::MediaEndpointOwr::prepareMediaSession): uppercase the
1967         codec name we are looking for, that's how they appear in the
1968         vector.
1969
1970 2017-04-07  Per Arne Vollan  <pvollan@apple.com>
1971
1972         Add hasVideo property to WebAVPlayerController.
1973         https://bugs.webkit.org/show_bug.cgi?id=170545
1974         rdar://problem/31325182
1975
1976         Reviewed by Eric Carlson.
1977
1978         Add a new "hasVideo" property which can be used to discover if any video content is present in the playback item,
1979         whether video content is currently enabled or not.
1980
1981         * platform/ios/WebAVPlayerController.h:
1982         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1983         (WebVideoFullscreenInterfaceAVKit::hasVideoChanged):
1984
1985 2017-04-07  Miguel Gomez  <magomez@igalia.com>
1986
1987         [GTK+] Animations not played properly when using synchronous decoding
1988         https://bugs.webkit.org/show_bug.cgi?id=170591
1989
1990         Reviewed by Carlos Garcia Campos.
1991
1992         Fix an index error when destroying decoded frames that was sometimes deleting the frame we wanted
1993         to keep.
1994
1995         Covered by exitent tests.
1996
1997         * platform/graphics/ImageFrameCache.cpp:
1998         (WebCore::ImageFrameCache::destroyDecodedData):
1999
2000 2017-04-07  Xan Lopez  <xan@igalia.com>
2001
2002         [GTK] Add message about missing codecs to ASSERT in OWR
2003         https://bugs.webkit.org/show_bug.cgi?id=170596
2004
2005         Reviewed by Carlos Garcia Campos.
2006
2007         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
2008         (WebCore::MediaEndpointOwr::prepareMediaSession): add a message
2009         about the missing coded to the ASSERT.
2010
2011 2017-04-07  Tomas Popela  <tpopela@redhat.com>
2012
2013         AX: Don't crash if no renderer is available for AccessibilityRenderObject
2014         https://bugs.webkit.org/show_bug.cgi?id=170448
2015
2016         Reviewed by Chris Fleizach.
2017
2018         Don't crash or assert if no renderer is available, but early return
2019         gracefully (as in other places in the AccessibilityRenderObject.cpp).
2020         Spotted by running some tests through dogtail.
2021
2022         * accessibility/AccessibilityRenderObject.cpp:
2023         (WebCore::AccessibilityRenderObject::isOffScreen):
2024         (WebCore::AccessibilityRenderObject::isUnvisited):
2025         (WebCore::AccessibilityRenderObject::isVisited):
2026
2027 2017-04-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2028
2029         [GTK] Update the priorities used in glib main loop sources
2030         https://bugs.webkit.org/show_bug.cgi?id=170457
2031
2032         Reviewed by Žan Doberšek.
2033
2034         * platform/glib/MainThreadSharedTimerGLib.cpp:
2035         (WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
2036         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
2037         (WebCore::TextureMapperPlatformLayerProxy::TextureMapperPlatformLayerProxy):
2038         (WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread):
2039
2040 2017-04-07  Zan Dobersek  <zdobersek@igalia.com>
2041
2042         [GCrypt] Implement AES_CBC support
2043         https://bugs.webkit.org/show_bug.cgi?id=170550
2044
2045         Reviewed by Michael Catanzaro.
2046
2047         Implement the CryptoAlgorithmAES_CBC::platform{Encrypt,Decrypt}
2048         functionality for configurations that use libgcrypt. This is done
2049         by leveraging the gcry_cipher_* APIs for the AES algorithm that's
2050         deduced appropriately from the key size and the CBC cipher mode.
2051         Additionally, the PKCS#7 padding is implemented for each operation,
2052         as demanded by the Web Crypto specification.
2053
2054         No new tests -- current ones cover this sufficiently, but are not yet
2055         enabled due to missing platform-specific SUBTLE_CRYPTO implementations.
2056
2057         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
2058         (WebCore::gcryptEncrypt):
2059         (WebCore::gcryptDecrypt):
2060         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
2061         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
2062
2063 2017-04-07  Zan Dobersek  <zdobersek@igalia.com>
2064
2065         [GCrypt] Implement raw and JWK imports and exports for EC keys
2066         https://bugs.webkit.org/show_bug.cgi?id=170546
2067
2068         Reviewed by Michael Catanzaro.
2069
2070         Implement import and export operations for EC keys, covering the raw
2071         and JWK import/export types.
2072
2073         CryptoKeyEC::platformImportRaw() builds a public-key s-expression,
2074         providing the curve name and the key data, and yields the gcry_sexp_t
2075         object to the new CryptoKeyEC.
2076
2077         CryptoKeyEC::platformImportJWKPublic() first constructs a Vector<uint8_t>
2078         object that contains the EC point in the uncompressed format. It then
2079         puts that data into a newly-constructed public-key s-expression that is
2080         then used to construct the new CryptoKeyEC object.
2081
2082         CryptoKeyEC::platformImportJWKPrivate() constructs the EC point data just
2083         the same, but it also lays out the private key field element data into
2084         the private-key s-expression that's then handed off to the CryptoKeyEC
2085         object.
2086
2087         CryptoKeyEC::platformExportRaw() constructs a new EC operations context
2088         and then uses it to retrieve the q parameter as an MPI. A Vector<uint8_t>
2089         is retrieved from the MPI data through the extractMPIData() helper
2090         function.
2091
2092         CryptoKeyEC::platformAddFieldElements() similarly uses the EC operations
2093         context to retrieve the q parameter data, which it then splits into the
2094         x and y field elements and Base64 URL-encodes them into a form that can
2095         be placed in a JsonWebKey. If the key is private, the d parameter is
2096         retrieved in the same fashion and again Base64 URL-encoded and stored
2097         in the JsonWebKey object.
2098
2099         No new tests -- current ones cover this sufficiently, but are not yet
2100         enabled due to other missing platform-specific SUBTLE_CRYPTO
2101         implementations.
2102
2103         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
2104         (WebCore::uncompressedPointSizeForCurve):
2105         (WebCore::uncompressedFieldElementSizeForCurve):
2106         (WebCore::extractMPIData):
2107         (WebCore::CryptoKeyEC::platformImportRaw):
2108         (WebCore::CryptoKeyEC::platformImportJWKPublic):
2109         (WebCore::CryptoKeyEC::platformImportJWKPrivate):
2110         (WebCore::CryptoKeyEC::platformExportRaw):
2111         (WebCore::CryptoKeyEC::platformAddFieldElements):
2112
2113 2017-04-07  Zan Dobersek  <zdobersek@igalia.com>
2114
2115         [GCrypt] Implement CryptoKeyRSA::generatePair()
2116         https://bugs.webkit.org/show_bug.cgi?id=170350
2117
2118         Reviewed by Michael Catanzaro.
2119
2120         Start implementing the libgcrypt-based platform bits of CryptoKeyRSA.
2121
2122         Implement generatePair() by constructing a genkey s-expression
2123         that requests a generation of an RSA key that should use a modulus
2124         of the specified bit-length and the specified exponent. The exponent
2125         is extracted from an uint8_t array through a helper function. The
2126         modulus length value is checked to be at least 16, since libgcrypt
2127         does not support generating primes of less than that length in bits.
2128
2129         The returned s-expression upon request will contain the data for
2130         both the public and the private key. gcry_sexp_t handles representing
2131         those s-expressions are then passed to CryptoKeyRSA::create() before
2132         invoking the success callback with a new CryptoKeyPair object in a
2133         separate ScriptExecutionContext task.
2134
2135         The CryptoKeyRSA constructor simply has the notImplemented() call
2136         removed. The destructor now invokes the HandleDeleter<gcry_sexp_t>
2137         object instance to destroy the object represented by the
2138         m_platformKey handle.
2139
2140         The methods in CryptoKeyRSA.cpp are also reordered to follow the
2141         declaration order used in the header.
2142
2143         No new tests -- current ones cover this sufficiently, but are not yet
2144         enabled due to other missing platform-specific SUBTLE_CRYPTO
2145         implementations.
2146
2147         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
2148         (WebCore::CryptoKeyRSA::CryptoKeyRSA):
2149         (WebCore::CryptoKeyRSA::~CryptoKeyRSA):
2150         (WebCore::exponentVectorToUInt32):
2151         (WebCore::CryptoKeyRSA::generatePair):
2152         (WebCore::CryptoKeyRSA::importSpki):
2153         (WebCore::CryptoKeyRSA::importPkcs8):
2154         (WebCore::CryptoKeyRSA::exportPkcs8):
2155         (WebCore::CryptoKeyRSA::buildAlgorithm):
2156         (WebCore::CryptoKeyRSA::exportData):
2157         * crypto/keys/CryptoKeyRSA.h:
2158
2159 2017-04-06  Youenn Fablet  <youenn@apple.com>
2160
2161         [Debug] ASSERT(!throwScope.exception()) on imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html
2162         https://bugs.webkit.org/show_bug.cgi?id=170395
2163         <rdar://problem/31394017>
2164
2165         Reviewed by Mark Lam.
2166
2167         * bindings/js/JSDOMPromise.cpp:
2168         (WebCore::DeferredPromise::reject): Exiting early in case of scope having an exception.
2169         Adding an assertion to ensure this is a worker termination exception.
2170
2171 2017-04-06  Andreas Kling  <akling@apple.com>
2172
2173         Inaudible background tabs should become eligible for memory kill after 8 minutes
2174         https://bugs.webkit.org/show_bug.cgi?id=170574
2175         <rdar://problem/31488686>
2176
2177         Reviewed by Gavin Barraclough.
2178
2179         Lower the delay for potentially marking background tabs as inactive from 60 minutes to 8 minutes.
2180         Letting a tab misbehave in the background for an entire hour was overly charitable.
2181
2182         * page/PerformanceMonitor.cpp:
2183
2184 2017-04-06  Wenson Hsieh  <wenson_hsieh@apple.com>
2185
2186         Scroll offset jumps after a programmatic scroll in an overflow container with scroll snapping
2187         https://bugs.webkit.org/show_bug.cgi?id=170560
2188         <rdar://problem/31484693>
2189
2190         Reviewed by Tim Horton.
2191
2192         Test: css3/scroll-snap/scroll-snap-programmatic-overflow-scroll.html
2193
2194         Logic for maintaining the scroll snap state in ScrollController was previously removed from iOS when refactoring
2195         ScrollController. This was done because scroll snapping on iOS is driven not by the ScrollController (as it is
2196         on Mac) but rather by sending scroll snap offsets to the UI process and hooking into UIScrollView delegates to
2197         handle retargeted scrolling.
2198
2199         However, on iOS, this ScrollController state is still important for the purposes of keeping the last active
2200         snap point index in sync with the UI process when the scroll offset changes outside of a user gesture (i.e.
2201         programmatic scrolling). Since the UI process does not get a chance to update the active snap offset during a
2202         programmatic scroll, our last active snap offset state was only being updated to the last snap position that the
2203         user manually scrolled to, making programmatic scrolling jump to this offset.
2204
2205         To fix this, we need to update scroll snap state on iOS within ScrollController. Also adds a new Layout test
2206         that exercises programmatic scrolling in an overflow scrolling container on all platforms.
2207
2208         * platform/cocoa/ScrollController.mm:
2209         (WebCore::otherScrollEventAxis):
2210         (WebCore::ScrollController::updateScrollSnapState):
2211         (WebCore::ScrollController::updateScrollSnapPoints):
2212
2213 2017-04-05  Simon Fraser  <simon.fraser@apple.com>
2214
2215         Throttle requestAnimationFrame in cross-origin iframes to 30fps
2216         https://bugs.webkit.org/show_bug.cgi?id=170534
2217
2218         Reviewed by Dan Bates.
2219
2220         Add a throttling reason to ScriptedAnimationController which is NonInteractedCrossOriginFrame,
2221         set on cross-origin iframes whose documents have never seen a user interaction. It's cleared
2222         as soon as an interaction on this frame or a child frame is detected.
2223
2224         Move the initialization of the LowPowerMode throttling reason to Document::requestAnimationFrame(),
2225         since it's more appropriate to compute NonInteractedCrossOriginFrame here than down in ScriptedAnimationController,
2226         and best to do both in the same place.
2227
2228         Tests: http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe.html
2229
2230         * dom/Document.cpp:
2231         (WebCore::Document::requestAnimationFrame):
2232         (WebCore::Document::updateLastHandledUserGestureTimestamp):
2233         * dom/Document.h:
2234         (WebCore::Document::hasHadUserInteraction):
2235         * dom/ScriptedAnimationController.cpp:
2236         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
2237         (WebCore::throttlingReasonToString):
2238         (WebCore::ScriptedAnimationController::interval):
2239         * dom/ScriptedAnimationController.h:
2240         * loader/FrameLoader.cpp:
2241         (WebCore::shouldAskForNavigationConfirmation):
2242
2243 2017-04-05  Simon Fraser  <simon.fraser@apple.com>
2244
2245         Use the Accelerate framework to optimize FEColorMatrix operations
2246         https://bugs.webkit.org/show_bug.cgi?id=170518
2247
2248         Reviewed by Tim Horton.
2249
2250         On macOS and iOS, we can use the Accelerate framework (vImage) to do color matrix
2251         math to optimize color matrix, hue rotate, saturation and luminosity to alpha filters.
2252         
2253         Change ImageBuffer::getUnmultipliedImageData() and getPremultipliedImageData() to
2254         return the size of the returned Uint8ClampedArray in physical pixels, because we
2255         need to pass that to vImage.
2256
2257         * html/canvas/CanvasRenderingContext2D.cpp:
2258         (WebCore::CanvasRenderingContext2D::getImageData):
2259         * platform/graphics/ImageBuffer.h:
2260         * platform/graphics/cairo/ImageBufferCairo.cpp:
2261         (WebCore::ImageBuffer::getUnmultipliedImageData):
2262         (WebCore::ImageBuffer::getPremultipliedImageData):
2263         * platform/graphics/cg/ImageBufferCG.cpp:
2264         (WebCore::ImageBuffer::getUnmultipliedImageData):
2265         (WebCore::ImageBuffer::getPremultipliedImageData):
2266         * platform/graphics/filters/FEColorMatrix.cpp:
2267         (WebCore::effectApplyAccelerated):
2268         (WebCore::effectType):
2269         (WebCore::FEColorMatrix::platformApplySoftware):
2270         * platform/graphics/filters/FEDropShadow.cpp:
2271         (WebCore::FEDropShadow::platformApplySoftware):
2272         * platform/graphics/win/ImageBufferDirect2D.cpp:
2273         (WebCore::ImageBuffer::getUnmultipliedImageData):
2274         (WebCore::ImageBuffer::getPremultipliedImageData):
2275
2276 2017-04-04  Simon Fraser  <simon.fraser@apple.com>
2277
2278         Do some minor FEColorMatrix code cleanup and optimization
2279         https://bugs.webkit.org/show_bug.cgi?id=170474
2280
2281         Reviewed by Dean Jackson.
2282
2283         Don't switch inside of a pixel processing loop; repeat the loop inside switch (filterType).
2284         
2285         Change matrix() and saturateAndHueRotate() to dereference the source pixels once, instead
2286         of multiple times, which is faster.
2287         
2288         This kind of code benefits from aligning things with spaces for readability, so do so,
2289         violating webkit style.
2290         
2291         Add some off-by-default performance logging code.
2292
2293         Increases pixel processing performance from about 86ms per megapixel to 65ms per megapixel.
2294
2295         * platform/graphics/filters/FEColorMatrix.cpp:
2296         (WebCore::matrix):
2297         (WebCore::saturateAndHueRotate):
2298         (WebCore::effectType):
2299         (WebCore::FEColorMatrix::platformApplySoftware):
2300
2301 2017-04-06  Ryan Haddad  <ryanhaddad@apple.com>
2302
2303         Unreviewed, rolling out r215041.
2304
2305         The LayoutTest for this change is failing on ios-simulator.
2306
2307         Reverted changeset:
2308
2309         "Rendering flexbox children across columns"
2310         https://bugs.webkit.org/show_bug.cgi?id=164166
2311         http://trac.webkit.org/changeset/215041
2312
2313 2017-04-06  Ryan Haddad  <ryanhaddad@apple.com>
2314
2315         Unreviewed, rolling out r215046.
2316
2317         This change broke internal builds.
2318
2319         Reverted changeset:
2320
2321         "WebRTC tests gardening"
2322         https://bugs.webkit.org/show_bug.cgi?id=170508
2323         http://trac.webkit.org/changeset/215046
2324
2325 2017-04-06  Joseph Pecoraro  <pecoraro@apple.com>
2326
2327         Web Inspector: Only Capture Extra Network Load Metrics when there is a Web Inspector Frontend
2328         https://bugs.webkit.org/show_bug.cgi?id=170525
2329
2330         Reviewed by Youenn Fablet.
2331
2332         Covered by existing tests that when Web Inspector is open we enable collecting the extra data.
2333
2334         * inspector/InspectorInstrumentation.cpp:
2335         (WebCore::InspectorInstrumentation::firstFrontendCreated):
2336         (WebCore::InspectorInstrumentation::lastFrontendDeleted):
2337         * inspector/InspectorInstrumentation.h:
2338         (WebCore::InspectorInstrumentation::frontendCreated):
2339         (WebCore::InspectorInstrumentation::frontendDeleted):
2340         When the first frontend is created enable a new loader strategy to
2341         collect extra network load metrics. When the last frontend is closed
2342         disable the extra metrics.
2343
2344         * loader/LoaderStrategy.h:
2345         * platform/PlatformStrategies.h:
2346         New load strategy to enable/disable new metrics.
2347
2348 2017-04-06  Joseph Pecoraro  <pecoraro@apple.com>
2349
2350         Web Inspector: Show all headers in the Request Headers section of the Resource details sidebar
2351         https://bugs.webkit.org/show_bug.cgi?id=16531
2352         <rdar://problem/5712895>
2353
2354         Reviewed by Timothy Hatcher.
2355
2356         Test: http/tests/inspector/network/resource-request-headers.html
2357
2358         * loader/ResourceTiming.cpp:
2359         (WebCore::ResourceTiming::ResourceTiming):
2360         Eliminate unnecessary data from the NetworkLoadTiming object
2361         when it is used for ResourceTiming. This clears up some memory
2362         that will otherwise never be used.
2363
2364         * platform/network/NetworkLoadMetrics.h:
2365         (WebCore::NetworkLoadMetrics::isolatedCopy):
2366         (WebCore::NetworkLoadMetrics::reset):
2367         (WebCore::NetworkLoadMetrics::clearNonTimingData):
2368         (WebCore::NetworkLoadMetrics::operator==):
2369         (WebCore::NetworkLoadMetrics::encode):
2370         (WebCore::NetworkLoadMetrics::decode):
2371         Include an optional HTTPHeaderMap for a refined list of
2372         request headers for this network load.
2373
2374         * inspector/InspectorNetworkAgent.cpp:
2375         (WebCore::InspectorNetworkAgent::buildObjectForMetrics):
2376         Include request headers with other optional metrics data
2377         when the load is completed.
2378
2379 2017-04-06  Tim Horton  <timothy_horton@apple.com>
2380
2381         Follow up to r209304, remove line numbers from one more StyleRule construction
2382         https://bugs.webkit.org/show_bug.cgi?id=170564
2383
2384         Reviewed by Simon Fraser.
2385
2386         * css/StyleRule.cpp:
2387         (WebCore::StyleRuleViewport::StyleRuleViewport):
2388         This one was missed in r209304.
2389
2390 2017-04-06  Timothy Horton  <timothy_horton@apple.com>
2391
2392         Remove an unused member and constructor parameter from CSSPropertyParser
2393         https://bugs.webkit.org/show_bug.cgi?id=170562
2394
2395         Reviewed by Simon Fraser.
2396
2397         * css/parser/CSSParser.cpp:
2398         (WebCore::CSSParser::parseSingleValue):
2399         (WebCore::CSSParser::parseValueWithVariableReferences):
2400         * css/parser/CSSParserImpl.cpp:
2401         (WebCore::CSSParserImpl::consumeDeclarationValue):
2402         * css/parser/CSSPropertyParser.cpp:
2403         (WebCore::CSSPropertyParser::CSSPropertyParser):
2404         (WebCore::CSSPropertyParser::parseValue):
2405         (WebCore::CSSPropertyParser::parseSingleValue):
2406         * css/parser/CSSPropertyParser.h:
2407         It is possible to get Clang to complain about the unused member, though
2408         I'm not sure why it doesn't in the build today.
2409
2410 2017-04-06  Zalan Bujtas  <zalan@apple.com>
2411
2412         Simple line layout: Hittest always returns the first renderer in the block.
2413         https://bugs.webkit.org/show_bug.cgi?id=170520
2414         <rdar://problem/30979175>
2415
2416         Reviewed by Antti Koivisto.
2417
2418         This is incorrect now with <br> support (multiple renderers within the same block flow).
2419
2420         Test: fast/dom/Document/CaretRangeFromPoint/simple-line-layout-hittest-with-caret-range-from-point.html
2421
2422         * rendering/RenderText.cpp:
2423         (WebCore::RenderText::positionForPoint): Related fix. We don't yet support positionForPoint with multiple renderes. 
2424         * rendering/SimpleLineLayoutFlowContents.h:
2425         (WebCore::SimpleLineLayout::FlowContents::segmentForRun): Empty runs are all valid.
2426         * rendering/SimpleLineLayoutFunctions.cpp:
2427         (WebCore::SimpleLineLayout::hitTestFlow):
2428         (WebCore::SimpleLineLayout::collectFlowOverflow):
2429         * rendering/SimpleLineLayoutResolver.cpp:
2430         (WebCore::SimpleLineLayout::LineResolver::Iterator::operator*): This should eventually return a list of renderes.
2431         * rendering/SimpleLineLayoutResolver.h:
2432         (WebCore::SimpleLineLayout::RunResolver::flowContents):
2433
2434 2017-04-06  Jon Davis  <jond@apple.com>
2435
2436         Updates feature status for recently shipped features
2437         https://bugs.webkit.org/show_bug.cgi?id=170359
2438
2439         Reviewed by Brian Burg.
2440
2441         Added missing Gamepad entry.
2442         Changed "Done" status to "Supported".
2443         Also changed status from "In Development" to "Supported" for:
2444         
2445         - CSS Grid Layout Level 1
2446         - CSS Inline Layout Module Level 3
2447         - CSS Scroll Snap Points Module Level 1
2448         - CSS Color Level 4
2449         - Fetch API
2450         - Indexed Database 2.0
2451         - Media Capture and Streams
2452         - Pointer Lock
2453         - Preload
2454         - Input Events
2455
2456         * features.json:
2457
2458 2017-03-31  Jiewen Tan  <jiewen_tan@apple.com>
2459
2460         [WebCrypto] Add support for AES-CTR
2461         https://bugs.webkit.org/show_bug.cgi?id=169761
2462         <rdar://problem/31331321>
2463
2464         Reviewed by Brent Fulgham.
2465
2466         This patch adds support for AES-CTR. Operations of AES-CTR include: encrypt, decrypt, generateKey,
2467         importKey, exportKey, wrapKey, and unwrapKey. This implementation follows the latest WebCryptoAPI
2468         spec: https://www.w3.org/TR/WebCryptoAPI/#aes-ctr.
2469
2470         Tests: crypto/subtle/aes-ctr-encrypt-malformed-parameters.html
2471                crypto/subtle/aes-ctr-encrypt-overflow.html
2472                crypto/subtle/aes-ctr-generate-export-key-jwk-length-128.html
2473                crypto/subtle/aes-ctr-generate-export-key-jwk-length-192.html
2474                crypto/subtle/aes-ctr-generate-export-key-jwk-length-256.html
2475                crypto/subtle/aes-ctr-generate-export-raw-key.html
2476                crypto/subtle/aes-ctr-generate-key-encrypt-decrypt.html
2477                crypto/subtle/aes-ctr-generate-key.html
2478                crypto/subtle/aes-ctr-import-jwk-key-length-128.html
2479                crypto/subtle/aes-ctr-import-jwk-key-length-192.html
2480                crypto/subtle/aes-ctr-import-jwk-key-length-256.html
2481                crypto/subtle/aes-ctr-import-key-decrypt.html
2482                crypto/subtle/aes-ctr-import-key-encrypt.html
2483                crypto/subtle/aes-ctr-import-key-unwrap-jwk-key.html
2484                crypto/subtle/aes-ctr-import-key-unwrap-raw-key.html
2485                crypto/subtle/aes-ctr-import-key-wrap-jwk-key.html
2486                crypto/subtle/aes-ctr-import-key-wrap-raw-key.html
2487                crypto/subtle/aes-ctr-import-raw-key.html
2488                crypto/workers/subtle/aes-ctr-import-key-decrypt.html
2489                crypto/workers/subtle/aes-ctr-import-key-encrypt.html
2490                crypto/workers/subtle/aes-ctr-import-key-unwrap-key.html
2491                crypto/workers/subtle/aes-ctr-import-key-wrap-key.html
2492
2493         * CMakeLists.txt:
2494         * DerivedSources.make:
2495         * PlatformGTK.cmake:
2496         * PlatformMac.cmake:
2497         * WebCore.xcodeproj/project.pbxproj:
2498         * bindings/js/JSSubtleCryptoCustom.cpp:
2499         (WebCore::normalizeCryptoAlgorithmParameters):
2500         * crypto/CryptoAlgorithmParameters.h:
2501         * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp: Added.
2502         (WebCore::usagesAreInvalidForCryptoAlgorithmAES_CTR):
2503         (WebCore::parametersAreValid):
2504         (WebCore::CryptoAlgorithmAES_CTR::create):
2505         (WebCore::CryptoAlgorithmAES_CTR::identifier):
2506         (WebCore::CryptoAlgorithmAES_CTR::encrypt):
2507         (WebCore::CryptoAlgorithmAES_CTR::decrypt):
2508         (WebCore::CryptoAlgorithmAES_CTR::generateKey):
2509         (WebCore::CryptoAlgorithmAES_CTR::importKey):
2510         (WebCore::CryptoAlgorithmAES_CTR::exportKey):
2511         (WebCore::CryptoAlgorithmAES_CTR::getKeyLength):
2512         * crypto/algorithms/CryptoAlgorithmAES_CTR.h: Added.
2513         * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp: Added.
2514         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
2515         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
2516         * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp: Added.
2517         (WebCore::bigIntegerToSize):
2518         (WebCore::transformAES_CTR):
2519         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
2520         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
2521         * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
2522         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
2523         * crypto/parameters/AesCtrParams.idl: Added.
2524         * crypto/parameters/CryptoAlgorithmAesCtrParams.h: Added.
2525
2526 2017-04-06  Youenn Fablet  <youenn@apple.com>
2527
2528         WebRTC tests gardening
2529         https://bugs.webkit.org/show_bug.cgi?id=170508
2530
2531         Reviewed by Eric Carlson.
2532
2533         * Configurations/FeatureDefines.xcconfig: Changing webrtc enabling for ios.
2534
2535 2017-04-06  Andreas Kling  <akling@apple.com>
2536
2537         Stop forcing CA commit when memory pressure changes.
2538         https://bugs.webkit.org/show_bug.cgi?id=170522
2539         <rdar://problem/31460236>
2540
2541         Reviewed by Antti Koivisto.
2542
2543         Don't force a CA commit when reaching critical memory pressure. We're already doing a ton
2544         of work in response to the pressure, and this was really a hack to try to react quickly on
2545         512 MB devices which we don't support anymore.
2546
2547         * page/MemoryRelease.cpp:
2548         (WebCore::releaseCriticalMemory):
2549
2550 2017-04-06  Romain Bellessort  <romain.bellessort@crf.canon.fr>
2551
2552         [Readable Streams API] Implement ReadableStreamBYOBRequest respondWithNewView()
2553         https://bugs.webkit.org/show_bug.cgi?id=170339
2554
2555         Reviewed by Youenn Fablet.
2556
2557         Implemented ReadableStreamBYOBRequest respondWithNewView().
2558
2559         Added new tests to check respondWithNewView() behaviour.
2560
2561         * Modules/streams/ReadableByteStreamInternals.js:
2562         (readableByteStreamControllerRespondWithNewView): Added.
2563         * Modules/streams/ReadableStreamBYOBRequest.js:
2564         (respondWithNewView): Updated.
2565
2566 2017-04-06  Eric Carlson  <eric.carlson@apple.com>
2567
2568         [MediaStream] Host application should be able to mute and unmute media streams
2569         https://bugs.webkit.org/show_bug.cgi?id=170519
2570         <rdar://problem/31174326>
2571
2572         Unreviewed, fix crash introduced in r214980.
2573
2574         * Modules/mediastream/MediaStream.cpp:
2575         (WebCore::MediaStream::MediaStream): NULL-check page.
2576
2577 2017-04-06  Dave Hyatt  <hyatt@apple.com>
2578
2579         Rendering flexbox children across columns
2580         https://bugs.webkit.org/show_bug.cgi?id=164166
2581         <rdar://problem/29055587>
2582
2583         Reviewed by Zalan Bujtas.
2584
2585         Added fast/multicol/flexbox-rows.html.
2586
2587         * rendering/RenderBlockFlow.cpp:
2588         (WebCore::RenderBlockFlow::adjustForUnsplittableChild):
2589         Treat block-level flexboxes that occur inside block flows the same as replaced
2590         and unsplittable elements and push them to the next page if they don't fit. We don't
2591         update the minimum page height though, since the flexbox is not really unsplittable.
2592
2593 2017-04-05  Simon Fraser  <simon.fraser@apple.com>
2594
2595         Set lastHandledUserGestureTimestamp on all ancestor documents, not just the top document
2596         https://bugs.webkit.org/show_bug.cgi?id=170479
2597
2598         Reviewed by Sam Weinig.
2599
2600         When interacting with a subframe document, set lastHandledUserGestureTimestamp on all ancestor
2601         documents up to the root.
2602
2603         This will be used in future for requestAnimationFrame throttling.
2604
2605         Test: fast/frames/user-gesture-timestamp-propagation.html
2606
2607         * dom/Document.cpp:
2608         (WebCore::Document::updateLastHandledUserGestureTimestamp):
2609         * dom/Document.h:
2610         * dom/UserGestureIndicator.cpp:
2611         (WebCore::UserGestureIndicator::UserGestureIndicator):
2612         * testing/Internals.cpp:
2613         (WebCore::Internals::lastHandledUserGestureTimestamp):
2614         * testing/Internals.h:
2615         * testing/Internals.idl:
2616
2617 2017-04-05  Eric Carlson  <eric.carlson@apple.com>
2618
2619         [MediaStream] Host application should be able to mute and unmute media streams
2620         https://bugs.webkit.org/show_bug.cgi?id=170519
2621         <rdar://problem/31174326>
2622
2623         Unreviewed, address review comments missed in the initial checkin.
2624
2625         * Modules/mediastream/MediaStream.cpp:
2626         (WebCore::MediaStream::MediaStream): Mute the private stream if the page doesn't allow
2627         capture.
2628         (WebCore::MediaStream::pageMutedStateDidChange): setMuted -> setCaptureTracksMuted.
2629
2630         * platform/mediastream/MediaStreamPrivate.cpp:
2631         (WebCore::MediaStreamPrivate::addTrack): Don't track muted state, the capture source already does.
2632         (WebCore::MediaStreamPrivate::startProducingData):  Ditto.
2633         (WebCore::MediaStreamPrivate::setCaptureTracksMuted): Renamed from setMuted.
2634         (WebCore::MediaStreamPrivate::setMuted): Deleted.
2635         * platform/mediastream/MediaStreamPrivate.h:
2636
2637 2017-04-05  Eric Carlson  <eric.carlson@apple.com>
2638
2639         [MediaStream] Host application should be able to mute and unmute media streams
2640         https://bugs.webkit.org/show_bug.cgi?id=170519
2641         <rdar://problem/31174326>
2642
2643         Reviewed by Youenn Fablet.
2644
2645         No new tests, fast/mediastream/MediaStream-page-muted.html was updated.
2646
2647         * Modules/mediastream/MediaStream.cpp:
2648         (WebCore::MediaStream::~MediaStream): Fix a typo.
2649         (WebCore::MediaStream::pageMutedStateDidChange): Don't store muted state, let the private
2650         stream store it.
2651         (WebCore::MediaStream::mediaState): Deal with new muted state flags.
2652         * Modules/mediastream/MediaStream.h:
2653
2654         * dom/Document.cpp:
2655         (WebCore::Document::prepareForDestruction): Clear media state before the frame is cleared.
2656
2657         * page/MediaProducer.h: Add muted flags.
2658
2659         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2660         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack): The display layer
2661         should not be visible when the video track is muted.
2662
2663         * platform/mediastream/MediaStreamPrivate.cpp:
2664         (WebCore::MediaStreamPrivate::addTrack): Mute the new track if necessary.
2665         (WebCore::MediaStreamPrivate::startProducingData): Do nothing when muted.
2666         (WebCore::MediaStreamPrivate::setExternallyMuted): New, mute/unmute tracks.
2667         * platform/mediastream/MediaStreamPrivate.h:
2668
2669         * platform/mediastream/RealtimeMediaSource.cpp:
2670         (WebCore::RealtimeMediaSource::setMuted): Start/stop producing data.
2671
2672         * testing/Internals.cpp:
2673         (WebCore::Internals::pageMediaState): Support new media stream muted flags.
2674
2675 2017-04-05  Andreas Kling  <akling@apple.com>
2676
2677         Make inactive web processes behave as though under memory pressure.
2678         https://bugs.webkit.org/show_bug.cgi?id=170042
2679         <rdar://problem/31038445>
2680
2681         Reviewed by Antti Koivisto.
2682
2683         Prevent PerformanceMonitor from marking the process as inactive at startup.
2684         This fixes the API test failure that caused this patch to get rolled out.
2685
2686         * page/PerformanceMonitor.h:
2687
2688 2017-04-05  Youenn Fablet  <youenn@apple.com>
2689
2690         Switch to kCVPixelFormatType_420YpCbCr8BiPlanarFullRange for Mac video capture format
2691         https://bugs.webkit.org/show_bug.cgi?id=170509
2692
2693         Reviewed by Eric Carlson.
2694
2695         Covered by existing tests.
2696
2697         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2698
2699 2017-04-05  Javier Fernandez  <jfernandez@igalia.com>
2700
2701         [css-align] Implement the place-items shorthand
2702         https://bugs.webkit.org/show_bug.cgi?id=168847
2703
2704         Reviewed by David Hyatt.
2705
2706         The CSS Box Alignment specification defines a new shorthand to set the
2707         Content Alignment properties (align-items and justify-items) at the
2708         same time.
2709
2710         This patch provides the implementation of the CSS parsing logic and the
2711         required regression tests. For the time being, as it happens with the
2712         rest of the new alignment properties, the new parsing logic is
2713         implemented behind the CSS Grid Layout runtime flag.
2714
2715         Test: css3/parse-place-items.html
2716
2717         * css/CSSComputedStyleDeclaration.cpp:
2718         (WebCore::ComputedStyleExtractor::propertyValue):
2719         * css/CSSProperties.json:
2720         * css/StyleProperties.cpp:
2721         (WebCore::StyleProperties::getPropertyValue):
2722         (WebCore::StyleProperties::getAlignmentShorthandValue):
2723         * css/StyleProperties.h:
2724         * css/parser/CSSPropertyParser.cpp:
2725         (WebCore::isAutoOrNormalOrStretch):
2726         (WebCore::consumeSelfPositionOverflowPosition):
2727         (WebCore::consumeSimplifiedItemPosition):
2728         (WebCore::CSSPropertyParser::consumePlaceItemsShorthand):
2729         * css/parser/CSSPropertyParser.h:
2730
2731 2017-04-05  Ryan Haddad  <ryanhaddad@apple.com>
2732
2733         Unreviewed, rolling out r214932.
2734
2735         This change broke an internal build.
2736
2737         Reverted changeset:
2738
2739         "[ios-simulator] API test WebKit2.DataDetectionReferenceDate
2740         timing out"
2741         https://bugs.webkit.org/show_bug.cgi?id=161967
2742         http://trac.webkit.org/changeset/214932
2743
2744 2017-04-05  Ryan Haddad  <ryanhaddad@apple.com>
2745
2746         Unreviewed, rolling out r214962.
2747
2748         Roll r214937 back in because it wasn't at fault for the build
2749         breakage.
2750
2751         Reverted changeset:
2752
2753         "Unreviewed, rolling out r214937."
2754         https://bugs.webkit.org/show_bug.cgi?id=170365
2755         http://trac.webkit.org/changeset/214962
2756
2757 2017-04-05  Ryan Haddad  <ryanhaddad@apple.com>
2758
2759         Unreviewed, rolling out r214937.
2760
2761         This change broke an internal build.
2762
2763         Reverted changeset:
2764
2765         "REGRESSION (r202472): Data Detection overwrites existing
2766         links in detected ranges"
2767         https://bugs.webkit.org/show_bug.cgi?id=170365
2768         http://trac.webkit.org/changeset/214937
2769
2770 2017-04-05  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2771
2772         [WebRTC][OpenWebRTC] Add support for SDP BUNDLE ("a:group:BUNDLE" and "a=bundle-only" lines)
2773         https://bugs.webkit.org/show_bug.cgi?id=170157
2774
2775         Reviewed by Alejandro G. Castro.
2776
2777         This implements support on the SDPProcessor for generating an "a=group:BUNDLE"
2778         attribute with the MID identifiers specified in the bundle group in the most
2779         recent answer.
2780         It also implements support for generating "a=bundle-only" attributes on the
2781         "m=" sections of the SDP according to the bundlePolicy defined.
2782
2783         Test: fast/mediastream/RTCPeerConnection-inspect-offer-bundlePolicy-bundle-only.html
2784
2785         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2786         (WebCore::MediaEndpointPeerConnection::createOfferTask):
2787         (WebCore::MediaEndpointPeerConnection::createAnswerTask):
2788         * Modules/mediastream/SDPProcessor.cpp:
2789         (WebCore::getBundlePolicyName):
2790         (WebCore::configurationToJSON):
2791         * Modules/mediastream/sdp.js:
2792         (SDP.generate):
2793         * platform/mediastream/MediaEndpointSessionConfiguration.h:
2794         (WebCore::MediaEndpointSessionConfiguration::bundlePolicy):
2795         (WebCore::MediaEndpointSessionConfiguration::setBundlePolicy):
2796         (WebCore::MediaEndpointSessionConfiguration::clone):
2797
2798 2017-04-05  Jer Noble  <jer.noble@apple.com>
2799
2800         [MSE] Seeks to currentTime=0 will fail if currentTime is already 0.
2801         https://bugs.webkit.org/show_bug.cgi?id=170510
2802         <rdar://problem/30988403>
2803
2804         Reviewed by Eric Carlson.
2805
2806         Test: media/media-source/media-source-unnecessary-seek-seeked.html
2807
2808         The AVSampleBufferRenderSynchronizer won't fire a time jumped notification if no seek is actully
2809         necessary. So short circuit the seek logic if the seek time is identical to the current synchronizer
2810         time.
2811
2812         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2813         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
2814
2815 2017-04-05  Chris Dumez  <cdumez@apple.com>
2816
2817         <input type="range"> changing to disabled while active breaks all pointer events
2818         https://bugs.webkit.org/show_bug.cgi?id=170447
2819         <rdar://problem/31442875>
2820
2821         Reviewed by Geoffrey Garen.
2822
2823         When a range's slider is being moved, we set SliderThumbElement's m_inDragMode flag
2824         to true and mark the range elements as the CapturingMouseEventsElement. When we get
2825         the mouseUp event, we are supposed to exit drag mode. However, when the range element
2826         gets disabled while dragging, we do not get the mouseUp event and we need to make
2827         sure we exit dragging mode anyway. r112547 tried to fix this by calling stopDragging()
2828         in SliderThumbElement::defaultEventHandler() when the input element is disabled.
2829         While this often works, this is fragile and we sometimes fail to exit dragging mode
2830         when we should.
2831
2832         This patch addressed the issue by calling stopDragging() in
2833         SliderThumbElement::disabledAttributeChanged() instead. This is much safer as we
2834         guarantee will exit dragging mode whenever the range element gets disabled, even
2835         if SliderThumbElement::defaultEventHandler() does not get called after that.
2836
2837         Test: fast/forms/range/disabled-while-dragging.html
2838
2839         * html/RangeInputType.cpp:
2840         (WebCore::RangeInputType::disabledAttributeChanged):
2841         * html/RangeInputType.h:
2842         * html/shadow/SliderThumbElement.cpp:
2843         (WebCore::SliderThumbElement::defaultEventHandler):
2844         (WebCore::SliderThumbElement::disabledAttributeChanged):
2845         * html/shadow/SliderThumbElement.h:
2846
2847 2017-04-05  Eric Carlson  <eric.carlson@apple.com>
2848
2849         [MediaStream] Video doesn't render in fullscreen on iOS
2850         https://bugs.webkit.org/show_bug.cgi?id=170404
2851
2852         Reviewed by Youenn Fablet.
2853         
2854         No new tests, filed https://bugs.webkit.org/show_bug.cgi?id=170512.
2855
2856         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
2857         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2858         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Include
2859         video fullscreen manager on iOS too.
2860         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix): Add paramater
2861         to force transform recalculation.
2862         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): Restructure code since
2863         the display layer resize happens elsewhere.
2864         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): Include video fullscreen
2865         manager on iOS too.
2866         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers): Ditto.
2867         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Ditto.
2868         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer): Ditto.
2869         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::backgroundLayerBoundsChanged): Change the
2870         display layer size and position immediately instead of waiting for the next sample buffer
2871         so the display is correct when fullscreen mode changes when paused.
2872
2873 2017-04-05  Youenn Fablet  <youenn@apple.com>
2874
2875         Deprecate and remove URL.createObjectURL(mediastream)
2876         https://bugs.webkit.org/show_bug.cgi?id=167518
2877         <rdar://problem/31149607>
2878
2879         Reviewed by Eric Carlson.
2880
2881         Covered by updated tests.
2882
2883         * CMakeLists.txt:
2884         * DerivedSources.cpp:
2885         * DerivedSources.make:
2886         * Modules/mediastream/DOMURLMediaStream.cpp: Removed.
2887         * Modules/mediastream/DOMURLMediaStream.h: Removed.
2888         * Modules/mediastream/DOMURLMediaStream.idl: Removed.
2889         * WebCore.xcodeproj/project.pbxproj:
2890         * html/DOMURL.idl:
2891
2892 2017-04-05  Alejandro G. Castro  <alex@igalia.com>
2893
2894         [Webrtc] Mock realtime sources factories should be static after r213941
2895         https://bugs.webkit.org/show_bug.cgi?id=170282
2896
2897         Reviewed by Alex Christensen.
2898
2899         If we don't make the variables static we would be returning a
2900         local variable.
2901
2902         * platform/mock/MockRealtimeAudioSource.cpp:
2903         (WebCore::MockRealtimeAudioSource::factory):
2904         * platform/mock/MockRealtimeVideoSource.cpp:
2905         (WebCore::MockRealtimeVideoSource::factory):
2906
2907 2017-04-05  Alex Christensen  <achristensen@webkit.org>
2908
2909         Fix CMake build.
2910
2911         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
2912         Some JavaScript inline functions were not being accessed from this file with different enable flags.
2913         * platform/spi/cf/CFNetworkSPI.h:
2914         * platform/spi/cocoa/NSURLConnectionSPI.h:
2915         Moved NSURLSession-specific SPI from NSURLConnectionSPI.h to CFNetworkSPI.h.
2916
2917 2017-04-05  Chris Dumez  <cdumez@apple.com>
2918
2919         _blank / _self / _parent / _top browsing context names should be case-insensitive
2920         https://bugs.webkit.org/show_bug.cgi?id=169747
2921
2922         Reviewed by Alex Christensen.
2923
2924         _blank / _self / _parent / _top browsing context names should be case-insensitive
2925         as per the HTML specification:
2926         - https://html.spec.whatwg.org/#browsing-context-names
2927
2928         This aligns our behavior with Firefox as well. See discussion at:
2929         - https://github.com/whatwg/html/issues/2443
2930
2931         Tests: imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank.html
2932                imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001.html
2933                imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002.html
2934                imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html
2935                imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html
2936
2937         * loader/FrameLoader.cpp:
2938         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
2939         (WebCore::createWindow):
2940         * page/DOMWindow.cpp:
2941         (WebCore::DOMWindow::open):
2942         * page/FrameTree.cpp:
2943         (WebCore::FrameTree::uniqueChildName):
2944         (WebCore::FrameTree::find):
2945
2946 2017-04-05  Miguel Gomez  <magomez@igalia.com>
2947
2948         [GTK+] PNG animations that should run once are not played at all
2949         https://bugs.webkit.org/show_bug.cgi?id=170499
2950
2951         Reviewed by Carlos Garcia Campos.
2952
2953         The repetition count reported bu the PNGImageDecoder is wrong. It's returning m_playCount - 1, which
2954         means 0 for the animations that need to be played once. Change it to return an appropriate value.
2955
2956         Covered by existent tests.
2957
2958         * platform/image-decoders/png/PNGImageDecoder.cpp:
2959         (WebCore::PNGImageDecoder::repetitionCount):
2960         * platform/image-decoders/png/PNGImageDecoder.h:
2961
2962 2017-04-05  Andy Estes  <aestes@apple.com>
2963
2964         REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
2965         https://bugs.webkit.org/show_bug.cgi?id=170365
2966         <rdar://problem/29205721>
2967
2968         Reviewed by Tim Horton.
2969
2970         r202472 changed the node traversal in searchForLinkRemovingExistingDDLinks() to only
2971         consider nodes that are descendants of startNode, but we need to traverse all nodes between
2972         startNode and endNode to find existing non-DD links.
2973
2974         As a result, we'd add a Data Detector link to the following snippet and make the original
2975         links un-clickable:
2976
2977             <a href='#'>tomorrow</a> <a href='#'>night</a>
2978
2979         Fix this by not specifying a stayWithin node when calling NodeTraversal::next(). The loop
2980         will terminate when we reach endNode.
2981
2982         Updated WebKit2.DataDetectionReferenceDate API test.
2983
2984         * editing/cocoa/DataDetection.mm:
2985         (WebCore::searchForLinkRemovingExistingDDLinks):
2986
2987 2017-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2988
2989         Move WebErrors from WebProcess to Shared and get rid of ErrorsGtk in WebCore
2990         https://bugs.webkit.org/show_bug.cgi?id=156974
2991
2992         Reviewed by Sam Weinig.
2993
2994         Remove ErrorsGtk.
2995
2996         * PlatformGTK.cmake:
2997         * platform/gtk/ErrorsGtk.cpp: Removed.
2998         * platform/gtk/ErrorsGtk.h: Removed.
2999
3000 2017-04-05  Andy Estes  <aestes@apple.com>
3001
3002         [ios-simulator] API test WebKit2.DataDetectionReferenceDate timing out
3003         https://bugs.webkit.org/show_bug.cgi?id=161967
3004
3005         Reviewed by Alexey Proskuryakov.
3006
3007         DataDetectorsCoreSPI.h defined DDQueryOffset as a struct of two CFIndexes, which is 16 bytes
3008         on LP64, but the struct is actually defined as two CFIndex-typed 32-bit bitfields, which is
3009         8 bytes on LP64. This breaks the ABI on Public SDK builds when calling functions that take
3010         or return DDQueryOffsets.
3011
3012         * platform/spi/cocoa/DataDetectorsCoreSPI.h: Updated the DDQueryOffset definition for
3013         Public SDK builds, and added a static_assert to detect future size changes at compile time.
3014
3015 2017-04-04  Jer Noble  <jer.noble@apple.com>
3016
3017         Move AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h
3018         https://bugs.webkit.org/show_bug.cgi?id=170471
3019
3020         Reviewed by Eric Carlson.
3021
3022         Move the declaration of AVSampleBufferDisplayLayer (and related classes) into AVFoundationSPI.
3023
3024         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3025         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3026         * platform/spi/mac/AVFoundationSPI.h:
3027
3028 2017-04-04  Youenn Fablet  <youenn@apple.com>
3029
3030         Canvas is tainted when painting a video with MediaStreamTrack
3031         https://bugs.webkit.org/show_bug.cgi?id=170486
3032
3033         Reviewed by Eric Carlson.
3034
3035         Test: http/tests/media/media-stream/getusermedia-with-canvas.html
3036
3037         Adding the notion of isolated source so that we can later on implement WebRTC isolated tracks.
3038         For now, canvas will not be tainted if painted from a MediaStreamTrack.
3039
3040         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
3041         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3042         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didPassCORSAccessCheck):
3043         * platform/mediastream/MediaStreamTrackPrivate.h:
3044         (WebCore::MediaStreamTrackPrivate::isIsolated):
3045         * platform/mediastream/RealtimeMediaSource.h:
3046
3047 2017-04-04  Commit Queue  <commit-queue@webkit.org>
3048
3049         Unreviewed, rolling out r214894, r214895, r214907, r214912,
3050         and r214918.
3051         https://bugs.webkit.org/show_bug.cgi?id=170491
3052
3053         Caused build failures on Mac (Requested by rniwa on #webkit).
3054
3055         Reverted changesets:
3056
3057         "Build fix."
3058         http://trac.webkit.org/changeset/214894
3059
3060         "Rolling back the build fix, as it broke other builds."
3061         http://trac.webkit.org/changeset/214895
3062
3063         "Move AVSampleBufferDisplayLayer declarations into
3064         AVFoundationSPI.h"
3065         https://bugs.webkit.org/show_bug.cgi?id=170471
3066         http://trac.webkit.org/changeset/214907
3067
3068         "Unreviewed build fix: fix compilation error on Sierra."
3069         http://trac.webkit.org/changeset/214912
3070
3071         "More build fixing."
3072         http://trac.webkit.org/changeset/214918
3073
3074 2017-04-04  Youenn Fablet  <youenn@apple.com>
3075
3076         [Mac] Add back web audio support for getUserMedia MediaStreamTrack
3077         https://bugs.webkit.org/show_bug.cgi?id=170482
3078
3079         Reviewed by Eric Carlson.
3080
3081         ´Covered by reenabled test.
3082
3083         Exporting method and class used in WebKit2.
3084
3085         * WebCore.xcodeproj/project.pbxproj:
3086         * platform/audio/mac/CAAudioStreamDescription.h:
3087         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
3088
3089 2017-04-04  Alexey Proskuryakov  <ap@apple.com>
3090
3091         More build fixing.
3092
3093         * platform/spi/mac/AVFoundationSPI.h:
3094
3095 2017-04-04  Simon Fraser  <simon.fraser@apple.com>
3096
3097         Do some minor FEColorMatrix code cleanup and optimization
3098         https://bugs.webkit.org/show_bug.cgi?id=170474
3099
3100         Reviewed by Dean Jackson.
3101
3102         Don't switch inside of a pixel processing loop; repeat the loop inside switch (filterType).
3103         
3104         Change matrix() and saturateAndHueRotate() to dereference the source pixels once, instead
3105         of multiple times, which is faster.
3106         
3107         This kind of code benefits from aligning things with spaces for readability, so do so,
3108         violating webkit style.
3109         
3110         Add some off-by-default performance logging code.
3111
3112         Increases pixel processing performance from about 86ms per megapixel to 65ms per megapixel.
3113
3114         * platform/graphics/filters/FEColorMatrix.cpp:
3115         (WebCore::matrix):
3116         (WebCore::saturateAndHueRotate):
3117         (WebCore::effectType):
3118         (WebCore::FEColorMatrix::platformApplySoftware):
3119
3120 2017-04-04  Brent Fulgham  <bfulgham@apple.com>
3121
3122         Do not assert when CharacterData representing an Attr fires events
3123         https://bugs.webkit.org/show_bug.cgi?id=170454
3124         <rdar://problem/30979320>
3125
3126         Reviewed by Ryosuke Niwa.
3127
3128         Make the NoEventDispatchAssertion in CharacterData::notifyParentAfterChange conditional
3129         since Attr elements should be allowed to fire events.
3130
3131         Tests: fast/dom/no-assert-for-malformed-js-url-attribute.html
3132
3133         * dom/CharacterData.cpp:
3134         (WebCore::CharacterData::notifyParentAfterChange):
3135
3136 2017-04-04  Youenn Fablet  <youenn@apple.com>
3137
3138         LayoutTest webrtc/libwebrtc/descriptionGetters.html is a flaky failure
3139         https://bugs.webkit.org/show_bug.cgi?id=169481
3140
3141         Reviewed by Eric Carlson.
3142
3143         No need to enumerate all network interfaces in most layout tests.
3144         Adding an Internals API for that in case we want to use TCP localhost candidates.
3145
3146         * testing/Internals.cpp:
3147         (WebCore::Internals::Internals):
3148         (WebCore::Internals::setEnumeratingAllNetworkInterfacesEnabled):
3149         * testing/Internals.h:
3150         * testing/Internals.idl:
3151
3152
3153 2017-04-04  Jer Noble  <jer.noble@apple.com>
3154
3155         Unreviewed build fix: fix compilation error on Sierra.
3156
3157         * platform/spi/mac/AVFoundationSPI.h:
3158
3159 2017-04-04  Jer Noble  <jer.noble@apple.com>
3160
3161         Move AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h
3162         https://bugs.webkit.org/show_bug.cgi?id=170471
3163
3164         Reviewed by Eric Carlson.
3165
3166         Move the declaration of AVSampleBufferDisplayLayer (and related classes) into AVFoundationSPI.
3167
3168         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3169         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer): Deleted.
3170         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeDisplayLayer): Deleted.
3171         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3172         * platform/spi/mac/AVFoundationSPI.h:
3173
3174 2017-04-04  Saam Barati  <sbarati@apple.com>
3175
3176         WebAssembly: JSWebAssemblyCallee should not be a JSCell
3177         https://bugs.webkit.org/show_bug.cgi?id=170135
3178
3179         Reviewed by Michael Saboff.
3180
3181         * bindings/js/JSDOMWindowBase.cpp:
3182         (WebCore::callerDOMWindow):
3183
3184 2017-04-04  Simon Fraser  <simon.fraser@apple.com>
3185
3186         Change Document's lastHandledUserGestureTimestamp to be a MonotonicTime
3187         https://bugs.webkit.org/show_bug.cgi?id=170468
3188
3189         Reviewed by Zalan Bujtas.
3190         
3191         Change the double to MonotonicTime. No behavior change.
3192
3193         * dom/Document.cpp:
3194         (WebCore::Document::updateLastHandledUserGestureTimestamp):
3195         * dom/Document.h:
3196         (WebCore::Document::lastHandledUserGestureTimestamp):
3197         * html/HTMLPlugInImageElement.cpp:
3198         (WebCore::documentHadRecentUserGesture):
3199         * loader/FrameLoader.cpp:
3200         (WebCore::shouldAskForNavigationConfirmation):
3201
3202 2017-04-04  Youenn Fablet  <youenn@apple.com>
3203
3204         [Debug] ASSERT(!throwScope.exception()) on imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html
3205         https://bugs.webkit.org/show_bug.cgi?id=170395
3206         <rdar://problem/31394017>
3207
3208         Reviewed by Mark Lam.
3209
3210         No change of behavior.
3211
3212         * bindings/js/JSDOMPromise.cpp:
3213         (WebCore::DeferredPromise::reject): Adding early ASSERT that creating an exception is happening correctly.
3214
3215 2017-04-04  Alexey Proskuryakov  <ap@apple.com>
3216
3217         Rolling back the build fix, as it broke other builds.
3218
3219         * platform/spi/mac/AVFoundationSPI.h:
3220
3221 2017-04-04  Alexey Proskuryakov  <ap@apple.com>
3222
3223         Build fix.
3224
3225         Rubber-stamped by Jer Noble.
3226
3227         * platform/spi/mac/AVFoundationSPI.h:
3228
3229 2017-04-04  Tim Horton  <timothy_horton@apple.com>
3230
3231         [Mac] -[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:] invokes the resultCollector with didWrap = NO even when it wraps
3232         https://bugs.webkit.org/show_bug.cgi?id=165801
3233         <rdar://problem/29649535>
3234
3235         Reviewed by Wenson Hsieh.
3236
3237         New API tests: WebKit2.FindInPageWrapping*
3238
3239         * page/FrameTree.cpp:
3240         (WebCore::FrameTree::traverseNextWithWrap):
3241         (WebCore::FrameTree::traversePreviousWithWrap):
3242         (WebCore::FrameTree::traverseNextInPostOrderWithWrap):
3243         * page/FrameTree.h:
3244         Add CanWrap and DidWrap boolean enums, and add an optional out argument
3245         to traverse*WithWrap indicating whether a wrap actually occurred.
3246
3247         * history/CachedPage.cpp:
3248         (WebCore::firePageShowAndPopStateEvents):
3249         * history/PageCache.cpp:
3250         (WebCore::destroyRenderTree):
3251         Adjust to the new CanWrap enum.
3252         
3253         * page/Page.cpp:
3254         (WebCore::incrementFrame):
3255         (WebCore::Page::findString):
3256         (WebCore::Page::findStringMatchingRanges):
3257         (WebCore::Page::rangeOfString):
3258         (WebCore::Page::findMatchesForText):
3259         (WebCore::Page::unmarkAllTextMatches):
3260         * page/Page.h:
3261         Adjust to the new CanWrap enum, and optionally plumb DidWrap through
3262         to callers of findString().
3263
3264 2017-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>
3265
3266         [GTK] PLATFORM(GTK) && !USE(COORDINATED_GRAPHICS_THREADED) is no longer possible
3267         https://bugs.webkit.org/show_bug.cgi?id=170458
3268
3269         Reviewed by Carlos Alberto Lopez Perez.
3270
3271         That is not supported anymore, so we can remove dead code from VideoSinkGStreamer.cpp
3272
3273         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
3274         (VideoRenderRequestScheduler::VideoRenderRequestScheduler):
3275
3276 2017-04-04  Per Arne Vollan  <pvollan@apple.com>
3277
3278         Unreviewed Windows build fix.
3279
3280         * bindings/js/JSDOMGuardedObject.h:
3281
3282 2017-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
3283
3284         Data interaction should register type identifiers in order of priority
3285         https://bugs.webkit.org/show_bug.cgi?id=170428
3286         <rdar://problem/30633296>
3287
3288         Reviewed by Tim Horton.
3289
3290         Currently, due to the shared logic for writing to a UIPasteboard (in the case of copy/paste) and the shared
3291         UIItemProvider-based pasteboard wrapper (in the case of data interaction), we don't enforce any particular
3292         ordering in which type identifiers are registered in the generated item provider. This is because
3293         -[UIPasteboard setItems:] only takes an unordered mapping of type identifiers to objects.
3294
3295         To fix this, we introduce a separate way to set pasteboard data that first writes a list of object
3296         representations in order of priority (which is dependent on the content being interacted with) and then register
3297         individual type-data mappings at the end.
3298
3299         Augmented existing API tests in DataInteractionTests to check for the existence and priority of type identifiers
3300         in the UIItemProviders created upon starting data interaction. Also adds a new unit test:
3301         DataInteractionTests.TextAreaToInput.
3302
3303         * WebCore.xcodeproj/project.pbxproj:
3304         * editing/cocoa/EditorCocoa.mm:
3305         (WebCore::archivedDataForAttributedString):
3306         (WebCore::Editor::writeSelectionToPasteboard):
3307         (WebCore::Editor::writeSelection):
3308         * platform/Pasteboard.h:
3309         * platform/PasteboardWriterData.h:
3310         * platform/PlatformPasteboard.h:
3311         * platform/ios/AbstractPasteboard.h:
3312         * platform/ios/AbstractPasteboard.mm: Copied from Source/WebCore/platform/ios/AbstractPasteboard.h.
3313
3314         Introduce WebPasteboardItemData, a wrapper around a list of objects representating the pasteboard data in order
3315         of priority, and a dictionary containing additional NSData blobs that contain data useful for private clients.
3316
3317         (+[WebPasteboardItemData itemWithRepresentingObjects:additionalData:]):
3318         (-[WebPasteboardItemData initWithRepresentingObjects:additionalData:]):
3319         (-[WebPasteboardItemData representingObjects]):
3320         (-[WebPasteboardItemData additionalData]):
3321         * platform/ios/PlatformPasteboardIOS.mm:
3322         (WebCore::richTextRepresentationsForPasteboardWebContent):
3323         (WebCore::PlatformPasteboard::writeObjectRepresentations):
3324         (WebCore::PlatformPasteboard::write):
3325
3326         Tweaked to check whether the pasteboard responds to -setItemsFromObjectRepresentations:. If so, uses the
3327         PlatformPasteboard::writeObjectRepresentations codepath to write data to the pasteboard, respecting type
3328         priority.
3329
3330         * platform/ios/WebItemProviderPasteboard.mm:
3331         (-[WebItemProviderPasteboard pasteboardTypes]):
3332         (-[WebItemProviderPasteboard setItemProviders:]):
3333         (-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]):
3334
3335         Replaces -setItems: with -setItemsFromObjectRepresentations:, which respects the priority of each object
3336         representation of the data in the pasteboard.
3337
3338         (-[WebItemProviderPasteboard setItems:]): Deleted.
3339
3340 2017-04-03  Javier Fernandez  <jfernandez@igalia.com>
3341
3342         [css-align] Adapt place-content alignment shorthand to the new baseline syntax
3343         https://bugs.webkit.org/show_bug.cgi?id=170340
3344
3345         Reviewed by David Hyatt.
3346
3347         Now that the align-content and justify-content CSS properties are
3348         adapted to the new baseline-position CSS values syntax we can adapt the
3349         shorthand that controls such properties to the new syntax as well.
3350
3351         No new tests, just adding some additional cases to the tests we already have.
3352
3353         * css/StyleProperties.cpp:
3354         (WebCore::StyleProperties::getPropertyValue):
3355         (WebCore::StyleProperties::placeContentPropertyValue):
3356         * css/StyleProperties.h:
3357         * css/parser/CSSPropertyParser.cpp:
3358         (WebCore::isContentDistributionKeyword):
3359         (WebCore::isContentPositionKeyword):
3360         (WebCore::isOverflowKeyword):
3361         (WebCore::getBaselineKeyword):
3362         (WebCore::consumeContentDistributionOverflowPosition):
3363         (WebCore::consumeSimplifiedContentPosition):
3364
3365 2017-04-03  Nan Wang  <n_wang@apple.com>
3366
3367         AX: Expose link children when doing search predication on iOS
3368         https://bugs.webkit.org/show_bug.cgi?id=170424
3369         <rdar://problem/31413335>
3370
3371         The children of links are accessible elements on iOS instead of the link itself, 
3372         so we should expose the children when doing predicated searches as well.
3373
3374         Reviewed by Chris Fleizach.
3375
3376         Test: accessibility/ios-simulator/ios-search-predicate-link-children.html
3377
3378         * accessibility/AccessibilityObject.cpp:
3379         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
3380
3381 2017-04-03  Jer Noble  <jer.noble@apple.com>
3382
3383         No audio output for MediaStream-backed audio elements on iOS
3384         https://bugs.webkit.org/show_bug.cgi?id=170427
3385
3386         Reviewed by Eric Carlson.
3387
3388         The logic for setting the output timestamp offset in AudioSampleDataSource was reversed; instead of
3389         subtracting out the timestamp of the first pull request, it effectively doubled it.
3390
3391         * platform/audio/mac/AudioSampleDataSource.mm:
3392         (WebCore::AudioSampleDataSource::pullSamplesInternal):
3393
3394 2017-04-03  Dave Hyatt  <hyatt@apple.com>
3395
3396         Japanese fonts in vertical text should support synthesized italics
3397         https://bugs.webkit.org/show_bug.cgi?id=169301
3398
3399         Reviewed by Simon Fraser.
3400
3401         Updated test in fast/text/international.
3402
3403         * platform/graphics/Font.cpp:
3404         (WebCore::Font::nonSyntheticItalicFont): Deleted.
3405         * platform/graphics/Font.h:
3406         Removed the non-synthetic italic font member, since it's not used.
3407
3408         * platform/graphics/FontCascadeFonts.cpp:
3409         (WebCore::glyphDataForNonCJKCharacterWithGlyphOrientation):
3410         Patched to ensure that a text-orientation-fallback font data is always
3411         returned in the synthetic oblique case, so that non-CJK and CJK are
3412         guaranteed to be broken up so that their slants can be applied differently.
3413
3414         (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
3415         (WebCore::FontCascadeFonts::glyphDataForNormalVariant):
3416         (WebCore::glyphDataForCJKCharacterWithoutSyntheticItalic): Deleted.
3417         Patched to no longer turn off synthetic oblique for CJK.
3418
3419         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3420         (WebCore::FontCascade::drawGlyphs):
3421         Apply the correct italic transform to CJK when in vertical text.
3422
3423 2017-04-03  Chris Dumez  <cdumez@apple.com>
3424
3425         REGRESSION (r206744): CSS background-image in style attribute ignored when using createHTMLDocument method of DOM parsing
3426         https://bugs.webkit.org/show_bug.cgi?id=170285
3427         <rdar://problem/31378543>
3428
3429         Reviewed by Andy Estes.
3430
3431         r206744 caused up to stop trying to resolve relative URLs when trying to load an image
3432         referred to by CSS. We already try to resolve the relative URL when parsing the CSS
3433         property so this will usually work fine. However, in the case when the CSS property
3434         is parsed in detached document and then moved to another document, we will not have
3435         the complete URL.
3436
3437         Test: fast/images/background-image-relative-url-changes-document.html
3438
3439         * css/CSSImageValue.cpp:
3440         (WebCore::CSSImageValue::loadImage):
3441
3442 2017-04-03  Jeremy Jones  <jeremyj@apple.com>
3443
3444         Do not set WebAVPlayerLayerView background to black in fullscreen.
3445         https://bugs.webkit.org/show_bug.cgi?id=170132
3446         rdar://problem/30839278
3447
3448         Reviewed by Tim Horton.
3449
3450         No new tests because no behavior change.
3451
3452         The black background on WebAVPlayerLayerView interferes with the fullscreen animation
3453         and has been removed.
3454
3455         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3456         (WebVideoFullscreenInterfaceAVKit::enterFullscreen):
3457         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard):
3458
3459 2017-04-03  Antti Koivisto  <antti@apple.com>
3460