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