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