0a073a1ea5e266e8d6b41f1b3644198ea8584b59
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-09-15  JF Bastien  <jfbastien@apple.com>
2
3         WTF: use Forward.h when appropriate instead of Vector.h
4         https://bugs.webkit.org/show_bug.cgi?id=176984
5
6         Reviewed by Saam Barati.
7
8         There's no need to include Vector.h when Forward.h will suffice. All we need is to move the template default parameters from Vector, and then the forward declaration can be used in so many new places: if a header only takes Vector by reference, rvalue reference, pointer, returns any of these, or has them as members then the header doesn't need to see the definition because the declaration will suffice.
9
10         * Modules/entriesapi/FileSystemEntriesCallback.h:
11         * Modules/indexeddb/IDBEventDispatcher.h:
12         * Modules/indexeddb/IDBFactory.h:
13         * Modules/indexeddb/client/IDBConnectionProxy.h:
14         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
15         * Modules/webdatabase/DatabaseTask.h:
16         * Modules/websockets/WebSocketChannelClient.h:
17         * contentextensions/CombinedURLFilters.h:
18         * crypto/SerializedCryptoKeyWrap.h:
19         * css/InspectorCSSOMWrappers.h:
20         * css/PageRuleCollector.h:
21         * css/parser/CSSParserTokenRange.h:
22         * dom/DocumentTouch.h:
23         * dom/MutationCallback.h:
24         * editing/EditingStyle.h:
25         * editing/SpellChecker.h:
26         * editing/markup.h:
27         * fileapi/ThreadableBlobRegistry.h:
28         * html/FileListCreator.h:
29         * inspector/WebHeapAgent.h:
30         * loader/ContentFilter.cpp:
31         (WebCore::ContentFilter::ContentFilter):
32         * loader/ContentFilter.h:
33         * loader/CookieJar.h:
34         * loader/FrameLoaderClient.h:
35         * loader/LoaderStrategy.h:
36         * loader/SubframeLoader.h:
37         * page/ChromeClient.h:
38         * page/FrameSnapshotting.h:
39         * page/IntersectionObserverCallback.h:
40         * page/PageSerializer.h:
41         * page/UserContentURLPattern.h:
42         * page/scrolling/AxisScrollSnapOffsets.h:
43         * page/win/FrameWin.h:
44         * platform/CookiesStrategy.h:
45         * platform/KeyedCoding.h:
46         * platform/PasteboardStrategy.h:
47         * platform/SSLKeyGenerator.h:
48         * platform/ScrollableArea.h:
49         * platform/encryptedmedia/CDMFactory.h:
50         * platform/gamepad/EmptyGamepadProvider.cpp:
51         * platform/gamepad/GamepadProvider.h:
52         * platform/gamepad/GamepadProviderClient.h:
53         * platform/gamepad/PlatformGamepad.h:
54         * platform/graphics/GeometryUtilities.cpp:
55         * platform/graphics/GeometryUtilities.h:
56         * platform/graphics/Icon.h:
57         * platform/graphics/LayoutRect.h:
58         * platform/graphics/Path.h:
59         * platform/graphics/WOFFFileFormat.h:
60         * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
61         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.h:
62         * platform/graphics/ca/PlatformCAAnimation.h:
63         * platform/graphics/ca/win/PlatformCALayerWinInternal.h:
64         * platform/graphics/opentype/OpenTypeMathData.h:
65         * platform/image-encoders/JPEGImageEncoder.h:
66         * platform/image-encoders/PNGImageEncoder.h:
67         * platform/network/BlobRegistry.h:
68         * platform/network/HTTPParsers.h:
69         * platform/network/PlatformCookieJar.h:
70         * platform/network/cf/DownloadBundle.h:
71         * platform/network/curl/CurlCacheEntry.h:
72         * platform/network/curl/DownloadBundle.h:
73         * platform/text/LineEnding.h:
74         * platform/text/QuotedPrintable.cpp:
75         * platform/text/QuotedPrintable.h:
76         * rendering/FlexibleBoxAlgorithm.h:
77         * rendering/style/QuotesData.h:
78         * rendering/svg/SVGSubpathData.h:
79         * storage/StorageEventDispatcher.h:
80         * style/StyleInvalidator.h:
81         * style/StyleRelations.h:
82         * svg/SVGAltGlyphDefElement.h:
83         * svg/SVGAltGlyphItemElement.h:
84
85 2017-09-15  Youenn Fablet  <youenn@apple.com>
86
87         ASSERTION FAILED: writtenAudioDuration >= readAudioDuration in com.apple.WebCore:WebCore::RealtimeOutgoingAudioSource::isReachingBufferedAudioDataHighLimit() + 222
88         https://bugs.webkit.org/show_bug.cgi?id=175164
89         <rdar://problem/33712305>
90
91         Reviewed by Eric Carlson.
92
93         No observable change of behavior.
94
95         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
96         (WebCore::RealtimeOutgoingAudioSource::hasBufferedEngouhData):
97         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable): Calling pullData only if there is at least 0.01 seconds of available data.
98         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
99
100 2017-09-15  Youenn Fablet  <youenn@apple.com>
101
102         Move code using Vector::map to WTF:map
103         https://bugs.webkit.org/show_bug.cgi?id=176860
104
105         Reviewed by Jer Noble.
106
107         No change of behavior.
108
109         * loader/FormSubmission.cpp:
110         (WebCore::FormSubmission::create): Moving to WTF::map.
111         * page/Settings.cpp:
112         (WebCore::Settings::setMediaContentTypesRequiringHardwareSupport): Using iterator split to not create a temporary vector.
113         * platform/ContentType.cpp:
114         (WebCore::ContentType::ContentType):
115         (WebCore::splitParameters):
116         (WebCore::ContentType::codecs const): Ditto.
117         (WebCore::ContentType::profiles const): Ditto.
118         (WebCore::stripHTMLWhiteSpace): Deleted.
119         * platform/ContentType.h:
120         (WebCore::ContentType::create): Deleted.
121         * platform/graphics/MediaPlayer.cpp:
122         (WebCore::MediaPlayer::load): Minor count churning change.
123
124 2017-09-15  Youenn Fablet  <youenn@apple.com>
125
126         MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData should enqueue data if still useful
127         https://bugs.webkit.org/show_bug.cgi?id=177016
128
129         Reviewed by Jer Noble.
130
131         No change of behavior.
132
133         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
134         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData): exciting early in block to prevent enqueueing.
135
136 2017-09-15  Ryan Haddad  <ryanhaddad@apple.com>
137
138         Unreviewed, rolling out r222040.
139
140         The LayoutTest added with this change is a flaky image failure
141         on mac-wk1 debug bots.
142
143         Reverted changeset:
144
145         "Computing animated style should not require renderers"
146         https://bugs.webkit.org/show_bug.cgi?id=171926
147         http://trac.webkit.org/changeset/222040
148
149 2017-09-15  Tim Horton  <timothy_horton@apple.com>
150
151         Fix the macOS CMake build
152         https://bugs.webkit.org/show_bug.cgi?id=177015
153
154         Reviewed by Andy Estes.
155
156         * CMakeLists.txt:
157         Add Payment Request files.
158
159         * PlatformMac.cmake:
160         Add the CoreServices umbrella framework to the framework search path.
161         Add service workers directories to the forwarding headers path.
162         Add Modules/cache directory to the forwarding headers path.
163
164         * rendering/svg/RenderSVGRoot.cpp:
165         (WebCore::resolveLengthAttributeForSVG): Deleted unused function.
166
167 2017-09-15  John Wilander  <wilander@apple.com>
168
169         Storage Access API: Deny access to nested iframes
170         https://bugs.webkit.org/show_bug.cgi?id=176939
171         <rdar://problem/34439609>
172
173         Reviewed by Brent Fulgham.
174
175         Test: http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-nested-iframe.html
176
177         * dom/Document.cpp:
178         (WebCore::Document::requestStorageAccess):
179
180 2017-09-15  Antti Koivisto  <antti@apple.com>
181
182         AnimationBase should ref the element
183         https://bugs.webkit.org/show_bug.cgi?id=176993
184
185         Reviewed by Simon Fraser.
186
187         We now longer have renderer pointer. Element can be reffed for safety.
188
189         This doesn't create reference cycle as the element pointer is cleared when render tree is
190         torn down. This happens at the latest when the element is removed from the tree.
191
192         * page/animation/AnimationBase.cpp:
193         (WebCore::AnimationBase::~AnimationBase):
194         (WebCore::AnimationBase::clear):
195         * page/animation/AnimationBase.h:
196         (WebCore::AnimationBase::~AnimationBase): Deleted.
197         (WebCore::AnimationBase::clear): Deleted.
198         * page/animation/ImplicitAnimation.cpp:
199         (WebCore::ImplicitAnimation::pauseAnimation):
200         (WebCore::ImplicitAnimation::sendTransitionEvent):
201         (WebCore::ImplicitAnimation::reset):
202         * page/animation/KeyframeAnimation.cpp:
203         (WebCore::KeyframeAnimation::pauseAnimation):
204         (WebCore::KeyframeAnimation::endAnimation):
205         (WebCore::KeyframeAnimation::sendAnimationEvent):
206         (WebCore::KeyframeAnimation::resolveKeyframeStyles):
207
208 2017-09-15  Brent Fulgham  <bfulgham@apple.com>
209
210         Make DocumentLoader a FrameDestructionObserver
211         https://bugs.webkit.org/show_bug.cgi?id=176364
212         <rdar://problem/34254780>
213
214         Reviewed by Alex Christensen.
215
216         The DocumentLoader needs to know when its Frame is destroyed so that it can
217         perform properly cleanup.
218
219         Test: fast/events/beforeunload-dom-manipulation-crash.html
220
221         * loader/DocumentLoader.cpp:
222         (WebCore::DocumentLoader::DocumentLoader): Call FrameDestructionObserver constructor.
223         (WebCore::DocumentLoader::responseReceived): Drive-by fix. Make sure the current
224         object is valid during the callback.
225         (WebCore::DocumentLoader::attachToFrame): Use FrameDestructionObserver::observerFrame rather
226         than setting the m_frame variable directly.
227         (WebCore::DocumentLoader::detachFromFrame): Ditto.
228         * loader/DocumentLoader.h:
229         (WebCore::DocumentLoader::frame const): Deleted, as this is provided by the FrameDestructionObserver.
230
231 2017-09-15  Ms2ger  <Ms2ger@igalia.com>
232
233         Update some WebGL2 return types to match the specification.
234         https://bugs.webkit.org/show_bug.cgi?id=176996
235
236         Reviewed by Alex Christensen.
237
238         This should not change the behavior in any way, but it makes it simpler
239         to compare our IDL with the specification's.
240
241         No new tests because there is no behavior change.
242
243         * html/canvas/WebGL2RenderingContext.cpp:
244         (WebCore::WebGL2RenderingContext::getUniformIndices):
245         * html/canvas/WebGL2RenderingContext.h:
246         * html/canvas/WebGL2RenderingContext.idl:
247
248 2017-09-15  Antti Koivisto  <antti@apple.com>
249
250         Remove FilterOperation::blendingNeedsRendererSize()
251         https://bugs.webkit.org/show_bug.cgi?id=176994
252
253         Reviewed by Simon Fraser.
254
255         It is not used.
256
257         * page/animation/CSSPropertyAnimation.cpp:
258         (WebCore::blendFunc):
259         * platform/graphics/filters/FilterOperation.h:
260         (WebCore::FilterOperation::blend):
261         (WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin const):
262         (WebCore::FilterOperation::blendingNeedsRendererSize const): Deleted.
263
264 2017-09-15  Youenn Fablet  <youenn@apple.com>
265
266         Add an URL method to remove both query string and fragment identifier
267         https://bugs.webkit.org/show_bug.cgi?id=176911
268
269         Reviewed by Alex Christensen.
270
271         Covered by existing tests and new API tests.
272
273         * Modules/cache/DOMCache.cpp:
274         (WebCore::DOMCache::retrieveRecords): Using new helper method.
275         * platform/URL.cpp:
276         (WebCore::URL::removeQueryAndFragmentIdentifier):
277         * platform/URL.h:
278
279 2017-09-15  Andy Estes  <aestes@apple.com>
280
281         [Cocoa] Upstream MediaRemote and VideoToolbox WebKitSystemInterface functions
282         https://bugs.webkit.org/show_bug.cgi?id=176953
283
284         Reviewed by Eric Carlson.
285
286         * platform/cocoa/VideoToolboxSoftLink.cpp:
287         * platform/cocoa/VideoToolboxSoftLink.h:
288         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
289         (WebCore::queryDecoderAvailability):
290         (WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystem):
291         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
292         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
293         (WebCore::exernalDeviceDisplayNameForPlayer):
294         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName const):
295         * platform/ios/WebCoreSystemInterfaceIOS.mm:
296         * platform/mac/MediaRemoteSoftLink.cpp:
297         * platform/mac/MediaRemoteSoftLink.h:
298         * platform/mac/WebCoreSystemInterface.h:
299         * platform/mac/WebCoreSystemInterface.mm:
300
301 2017-09-15  Eric Carlson  <eric.carlson@apple.com>
302
303         Switch text tracks to release logging
304         https://bugs.webkit.org/show_bug.cgi?id=176809
305         <rdar://problem/34397605>
306
307         Reviewed by Jer Noble.
308
309         Make all track objects use the same logger and log identifier as the media element they
310         "belong" to. Convert all track logging from debug-only to release logging.
311
312         * WebCore.xcodeproj/project.pbxproj:
313         * html/HTMLMediaElement.cpp:
314         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
315         * html/HTMLMediaElement.h:
316         * html/track/AudioTrack.cpp:
317         (WebCore::AudioTrack::AudioTrack):
318         (WebCore::AudioTrack::setPrivate):
319         (WebCore::AudioTrack::setMediaElement):
320         * html/track/AudioTrack.h:
321         * html/track/DataCue.cpp:
322         (WebCore::DataCue::toString const):
323         * html/track/DataCue.h:
324         (PAL::LogArgument<WebCore::DataCue>::toString):
325         * html/track/InbandDataTextTrack.cpp:
326         (WebCore::InbandDataTextTrack::addDataCue):
327         (WebCore::InbandDataTextTrack::updateDataCue):
328         (WebCore::InbandDataTextTrack::removeDataCue):
329         * html/track/InbandDataTextTrack.h:
330         * html/track/InbandGenericTextTrack.cpp:
331         (WebCore::InbandGenericTextTrack::addGenericCue):
332         (WebCore::InbandGenericTextTrack::removeGenericCue):
333         (WebCore::InbandGenericTextTrack::newCuesParsed):
334         (WebCore::InbandGenericTextTrack::fileFailedToParse):
335         * html/track/InbandGenericTextTrack.h:
336         * html/track/InbandTextTrack.cpp:
337         (WebCore::InbandTextTrack::InbandTextTrack):
338         (WebCore::InbandTextTrack::setMediaElement):
339         * html/track/InbandTextTrack.h:
340         * html/track/InbandWebVTTTextTrack.cpp:
341         (WebCore::InbandWebVTTTextTrack::newCuesParsed):
342         (WebCore::InbandWebVTTTextTrack::fileFailedToParse):
343         * html/track/InbandWebVTTTextTrack.h:
344         * html/track/LoadableTextTrack.cpp:
345         (WebCore::LoadableTextTrack::newCuesAvailable):
346         (WebCore::LoadableTextTrack::cueLoadingCompleted):
347         * html/track/LoadableTextTrack.h:
348         * html/track/TextTrack.cpp:
349         (WebCore::TextTrack::addCue):
350         (WebCore::TextTrack::removeCue):
351         (WebCore::TextTrack::setLanguage):
352         * html/track/TextTrack.h:
353         * html/track/TextTrackCue.cpp:
354         (WebCore::TextTrackCue::toString const):
355         * html/track/TextTrackCue.h:
356         (PAL::LogArgument<WebCore::TextTrackCue>::toString):
357         * html/track/TextTrackCueGeneric.cpp:
358         (WebCore::TextTrackCueGeneric::setFontSize):
359         (WebCore::TextTrackCueGeneric::toString const):
360         * html/track/TextTrackCueGeneric.h:
361         (PAL::LogArgument<WebCore::TextTrackCueGeneric>::toString):
362         * html/track/TrackBase.cpp:
363         (WebCore::nextLogIdentifier):
364         (WebCore::nullLogger):
365         (WebCore::TrackBase::TrackBase):
366         (WebCore::TrackBase::setMediaElement):
367         (WebCore::TrackBase::logChannel const):
368         (WebCore::TrackBase::~TrackBase): Deleted.
369         * html/track/TrackBase.h:
370         (WebCore::TrackBase::setMediaElement): Deleted.
371         * html/track/VTTCue.cpp:
372         (WebCore::VTTCue::setFontSize):
373         (WebCore::VTTCue::toString const):
374         * html/track/VTTCue.h:
375         (PAL::LogArgument<WebCore::VTTCue>::toString):
376         * html/track/VideoTrack.cpp:
377         (WebCore::VideoTrack::VideoTrack):
378         (WebCore::VideoTrack::setPrivate):
379         (WebCore::VideoTrack::setMediaElement):
380         * html/track/VideoTrack.h:
381         * platform/graphics/AudioTrackPrivate.h:
382         * platform/graphics/InbandTextTrackPrivate.h:
383         (WebCore::InbandTextTrackPrivate::setClient):
384         * platform/graphics/InbandTextTrackPrivateClient.h:
385         (WebCore::GenericCueData::toString const):
386         (PAL::LogArgument<WebCore::GenericCueData>::toString):
387         * platform/graphics/TrackPrivateBase.cpp: Added.
388         (WebCore::TrackPrivateBase::setLogger):
389         (WebCore::TrackPrivateBase::logChannel const):
390         * platform/graphics/TrackPrivateBase.h:
391         * platform/graphics/VideoTrackPrivate.h:
392         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
393         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
394         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes):
395         (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues):
396         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
397         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
398         (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings):
399         (WebCore::InbandTextTrackPrivateAVF::removeCompletedCues):
400         (WebCore::InbandTextTrackPrivateAVF::resetCueValues):
401         (WebCore::InbandTextTrackPrivateAVF::processNativeSamples):
402         (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer):
403         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:
404         * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm:
405         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
406         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
407         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
408         (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
409         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
410
411 2017-09-15  Carlos Garcia Campos  <cgarcia@igalia.com>
412
413         [Harfbuzz] Material icons not rendered correctly when using the web font
414         https://bugs.webkit.org/show_bug.cgi?id=176995
415
416         Reviewed by Michael Catanzaro.
417
418         Only a few of them are correctly rendered and some others are wrong. We only render correctly the ones that
419         don't have an underscore in their name (or that start with a number like 3d_rotation). In the cases where the
420         name before the underscore is also an icon, we render that icon instead, that's why some of them are wrong. This
421         is happening because the underscore is causing the HarfbuffShaper to split the text in 3 runs, one for the word
422         before the underscore, another one for the underscore and another for the word after the underscore. So, we
423         end up trying to shape the 3 runs independently and we fail when the icon doesn't exist, or when it exists but
424         it's not the one we are looking for. The cause of this is that the underscore has a different script (Common)
425         than the rest of characters (Latin) which is a condition in HarfbuffShaper to create a different run. The
426         unicode spec says that characters with Common script should be handled differently, but we are just ignoring
427         it. The spec proposes to use an heuristic based on simply inheriting the script of the previous character, which
428         should work in most of the cases. We could take a more conservative approach and do that only if both characters
429         are ASCII. We should also consider handling other cases mentioned by the spec like brackets and quotation marks,
430         but that belongs to a different bug/commit.
431
432         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
433         (WebCore::scriptsAreCompatibleForCharacters): Helper function to check if the current and previous scripts are
434         compatible,
435         (WebCore::HarfBuzzShaper::collectHarfBuzzRuns): Use scriptsAreCompatibleForCharacters() to decided whether to
436         finish the current run or not. In case of Common script, inherit also the script from the previous character.
437
438 2017-09-15  Carlos Garcia Campos  <cgarcia@igalia.com>
439
440         [Harfbuzz] Fix incorrect font rendering when selecting texts in pages which specifies text-rendering: optimizeLegibility
441         https://bugs.webkit.org/show_bug.cgi?id=148220
442
443         Reviewed by Michael Catanzaro.
444
445         Add support for shaping a range of characters and return the advance to the first glyph in the range.
446
447         Covered by existing tests.
448
449         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
450         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText const): Pass "from" and "to" parameters to
451         HarfBuzzShaper::shape and return the x position of the selection rect.
452         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
453         (WebCore::HarfBuzzShaper::shape): Forward "from" and "to" parameters to fillGlyphBuffer().
454         (WebCore::HarfBuzzShaper::fillGlyphBufferFromHarfBuzzRun): Only add glyphs for the given character range.
455         (WebCore::HarfBuzzShaper::fillGlyphBuffer): Only consider runs in the given character range.
456         * platform/graphics/harfbuzz/HarfBuzzShaper.h:
457
458 2017-09-15  Zan Dobersek  <zdobersek@igalia.com>
459
460         [EME] ClearKey: list 'persistent-license' sessions as supported
461         https://bugs.webkit.org/show_bug.cgi?id=176985
462
463         Reviewed by Xabier Rodriguez-Calvar.
464
465         The ClearKey implementation should support the 'persistent-license'
466         session type for testing purposes. Methods in the CDMPrivateClearKey
467         class have been updated to handle that session type as supported:
468         - supportsSessionTypeWithConfiguration() returns true for the
469           'persistent-license' session type values,
470         - supportsConfiguration() allows persistent state as required in
471           case of the configured session type being 'persistent-license',
472         - supportsConfigurationWithRestrictions() as well allows persistent
473         state as required for 'persistent-license' session types.
474
475         No new tests -- affected tests have their baselines updated.
476
477         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
478         (WebCore::CDMPrivateClearKey::supportsConfiguration const):
479         (WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions const):
480         (WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration const):
481
482 2017-09-15  Ms2ger  <Ms2ger@igalia.com>
483
484         Disallow passing a null program to getFragDataLocation.
485         https://bugs.webkit.org/show_bug.cgi?id=176895
486
487         Reviewed by Sam Weinig.
488
489         This matches the specification as well as Gecko and Chromium.
490
491         Test: fast/canvas/webgl/webgl2/bindings.html
492
493         * html/canvas/WebGL2RenderingContext.cpp:
494         (WebCore::WebGL2RenderingContext::getFragDataLocation):
495         * html/canvas/WebGL2RenderingContext.h:
496         * html/canvas/WebGL2RenderingContext.idl:
497
498 2017-09-14  Carlos Garcia Campos  <cgarcia@igalia.com>
499
500         [FreeType] Complex text is enabled too often after r221909
501         https://bugs.webkit.org/show_bug.cgi?id=176907
502
503         Reviewed by Sergio Villar Senin.
504
505         In r221909 we enabled complex text by default following the same cocoa ifdefs, but I forgot another ifdef in the
506         cpp file.
507
508         * platform/graphics/FontCascade.cpp:
509         (WebCore::FontCascade::codePath const):
510
511 2017-09-14  Commit Queue  <commit-queue@webkit.org>
512
513         Unreviewed, rolling out r221932 and r221933.
514         https://bugs.webkit.org/show_bug.cgi?id=176969
515
516         This change did not fix the webgl test flakiness. (Requested
517         by ryanhaddad on #webkit).
518
519         Reverted changesets:
520
521         "[WebGL] accelerated texImage2D for video doesn't respect
522         flipY"
523         https://bugs.webkit.org/show_bug.cgi?id=176491
524         http://trac.webkit.org/changeset/221932
525
526         "[WebGL] VideoTextureCopierCV doesn't correctly restore vertex
527         attribute state"
528         https://bugs.webkit.org/show_bug.cgi?id=176771
529         http://trac.webkit.org/changeset/221933
530
531 2017-09-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>
532
533         [Curl] Replace the implementation with NetworkLoadMetrics
534         https://bugs.webkit.org/show_bug.cgi?id=176906
535
536         Reviewed by Alex Christensen.
537
538         * platform/network/curl/CurlContext.cpp:
539         (WebCore::CurlHandle::getEffectiveURL):
540         (WebCore::CurlHandle::getPrimaryPort):
541         (WebCore::CurlHandle::getResponseCode):
542         (WebCore::CurlHandle::getContentLenghtDownload):
543         (WebCore::CurlHandle::getHttpAuthAvail):
544         (WebCore::CurlHandle::getTimes):
545         (WebCore::CurlHandle::getEffectiveURL const): Deleted.
546         * platform/network/curl/CurlContext.h:
547         * platform/network/curl/CurlDownload.cpp:
548         (WebCore::CurlDownload::didReceiveHeader):
549         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
550         (WebCore::ResourceHandleCurlDelegate::dispatchSynchronousJob):
551         (WebCore::ResourceHandleCurlDelegate::notifyFinish):
552         (WebCore::ResourceHandleCurlDelegate::getProtectionSpace):
553         (WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders):
554         (WebCore::ResourceHandleCurlDelegate::handleLocalReceiveResponse):
555         (WebCore::ResourceHandleCurlDelegate::didFinish):
556         (WebCore::ResourceHandleCurlDelegate::getNetworkLoadMetrics):
557         (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
558         (WebCore::ResourceHandleCurlDelegate::didReceiveData):
559         (WebCore::ResourceHandleCurlDelegate::setWebTimings): Deleted.
560         * platform/network/curl/ResourceHandleCurlDelegate.h:
561         * platform/network/curl/ResourceResponse.h:
562         (WebCore::ResourceResponse::setDeprecatedNetworkLoadMetrics):
563
564 2017-09-14  Daniel Bates  <dabates@apple.com>
565
566         [Mac] Spelling, grammar and correction dots are painted upside down
567         https://bugs.webkit.org/show_bug.cgi?id=176949
568         <rdar://problem/34441098>
569
570         Reviewed by Simon Fraser.
571
572         Painting occurs in a vertically flipped context. Vertically flip the context ("unflip" it)
573         before painting the document markers on macOS so that they are painted right-side. This makes
574         the appearance of spelling, grammar and correction dots in WebKit match the AppKit appearance
575         of these dots.
576
577         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
578         (WebCore::GraphicsContext::drawLineForDocumentMarker): Flip the context as described above.
579         Also make use of RAII object CGContextStateSaver instead of manually saving and restoring
580         the state of the context.
581
582 2017-09-14  Joseph Pecoraro  <pecoraro@apple.com>
583
584         Unreviewed rollout r222036.
585         
586         The LayoutTests added with this change is flaky.
587
588         Reverted changeset
589         Web Inspector: Timeline should show when events preventDefault() was called on an event or not
590         https://bugs.webkit.org/show_bug.cgi?id=176824
591         http://trac.webkit.org/changeset/222036
592
593 2017-09-14  Ryosuke Niwa  <rniwa@webkit.org>
594
595         WebContentReader::readWebArchive doesn't need to handle image MIME type
596         https://bugs.webkit.org/show_bug.cgi?id=176884
597
598         Reviewed by Sam Weinig.
599
600         Remove the code to handle image MIME types in the web archive on macOS since we have a separate code path
601         to handle images in the pasteboard directly. As far as I can tell, this code is never used in practice.
602
603         This allows merging iOS and macOS code to read web archive from the pasteboard. Also merged member functions
604         for handling RTFD and RTF in iOS and macOS in WebContentReaderCocoa.mm.
605
606         * CMakeLists.txt:
607         * WebCore.xcodeproj/project.pbxproj:
608         * editing/WebContentReader.cpp: Added.
609         (WebCore::WebContentReader::addFragment): Moved from WebContentReaderIOS.mm and simplified since appendChild
610         knows how to add a DocumentFragment.
611         * editing/WebContentReader.h:
612         * editing/cocoa/WebContentReaderCocoa.mm:
613         (WebCore::createFragmentAndAddResources):
614         (WebCore::WebContentReader::readWebArchive): Merged iOS / macOS code here.
615         (WebCore::WebContentReader::readRTFD): Ditto.
616         (WebCore::WebContentReader::readRTF): Ditto.
617         (WebCore::WebContentReader::readPlainText): Ditto.
618         * editing/ios/EditorIOS.mm:
619         (WebCore::Editor::pasteWithPasteboard):
620         * editing/ios/WebContentReaderIOS.mm:
621         (WebCore::WebContentReader::readImage):
622         (WebCore::WebContentReader::readURL):
623         (WebCore::WebContentReader::readWebArchive): Moved to WebContentReaderCocoa.mm.
624         (WebCore::WebContentReader::readRTFD): Ditto.
625         (WebCore::WebContentReader::readRTF): Ditto.
626         (WebCore::WebContentReader::readPlainText): Ditto.
627         * editing/mac/WebContentReaderMac.mm:
628         (WebCore::WebContentReader::readWebArchive): Ditto.
629         (WebCore::WebContentReader::readRTFD): Ditto.
630         (WebCore::WebContentReader::readRTF): Ditto.
631
632 2017-09-14  Devin Rousso  <webkit@devinrousso.com>
633
634         Web Inspector: make recording swizzle async
635         https://bugs.webkit.org/show_bug.cgi?id=176936
636
637         Reviewed by Joseph Pecoraro.
638
639         * inspector/InspectorCanvas.cpp:
640         (WebCore::InspectorCanvas::buildArrayForCanvasPattern):
641         (WebCore::InspectorCanvas::buildAction):
642         For objects that are not able to be stringified (e.g. elements), send a deduplicated string
643         with the name of the object as a placeholder value (e.g. "Element").
644
645 2017-09-14  Andy Estes  <aestes@apple.com>
646
647         [Mac] Upstream SpeechSynthesis-related WebKitSystemInterface functions
648         https://bugs.webkit.org/show_bug.cgi?id=176931
649
650         Reviewed by Joseph Pecoraro.
651
652         * platform/mac/PlatformSpeechSynthesizerMac.mm:
653         (WebCore::speechSynthesisGetVoiceIdentifiers):
654         (WebCore::speechSynthesisGetDefaultVoiceIdentifierForLocale):
655         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
656         * platform/mac/WebCoreSystemInterface.h:
657         * platform/mac/WebCoreSystemInterface.mm:
658
659 2017-09-14  Youenn Fablet  <youenn@apple.com>
660
661         RTCDataChannel connectivity issues in Safari 11
662         https://bugs.webkit.org/show_bug.cgi?id=173052
663         <rdar://problem/32712143>
664
665         Reviewed by Alex Christensen.
666
667         Covered by updated test.
668
669         Before the patch, when sending an ArrayBufferView, RTCDataChannel was sending the whole ArrayBuffer backing the ArrayBufferView.
670         With this patch, RTCDataChannel will now send only the bytes the ArrayBufferView is exposing.
671
672         * Modules/mediastream/RTCDataChannel.cpp:
673         (WebCore::RTCDataChannel::send): Correctly handling sending of ArrayBufferView.
674         (WebCore::RTCDataChannel::sendRawData): Helper routine for raw data sending.
675         * Modules/mediastream/RTCDataChannel.h:
676
677 2017-09-14  Antti Koivisto  <antti@apple.com>
678
679         Computing animated style should not require renderers
680         https://bugs.webkit.org/show_bug.cgi?id=171926
681         <rdar://problem/34428035>
682
683         Reviewed by Sam Weinig.
684
685         CSS animation system is now element rather than renderer based. This allows cleaning up
686         style resolution and render tree update code.
687
688         This also fixes bug animation doesn't run if display property is animated from one rendered type
689         to another. Added a test case for this.
690
691         Test: transitions/transition-display-property-2.html
692
693         * page/animation/CSSAnimationController.cpp:
694         (WebCore::CSSAnimationController::updateAnimations):
695
696             Pass in the old style instead of getting it from the renderer.
697             Factor to return the animated style as a return value.
698
699         * page/animation/CSSAnimationController.h:
700         * rendering/RenderElement.cpp:
701         (WebCore::RenderElement::RenderElement):
702         (WebCore::RenderElement::willBeDestroyed):
703
704             Animation are now canceled by RenderTreeUpdater::tearDownRenderers.
705
706         * rendering/RenderElement.h:
707         (WebCore::RenderElement::hasInitialAnimatedStyle const): Deleted.
708         (WebCore::RenderElement::setHasInitialAnimatedStyle): Deleted.
709
710             We no longer need to this concept.
711
712         * style/RenderTreeUpdater.cpp:
713         (WebCore::RenderTreeUpdater::updateElementRenderer):
714         (WebCore::RenderTreeUpdater::createRenderer):
715
716             We now get correct animated style from style resolution in all cases so we don't need to compute
717             it separately for new renderers.
718
719         (WebCore::RenderTreeUpdater::tearDownRenderers):
720
721             Cancel animations when render tree is fully torn down. Keep them when updating style.
722
723         * style/RenderTreeUpdater.h:
724         * style/StyleTreeResolver.cpp:
725         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
726
727             We can now compute animated style without renderer. Special cases dealing with rendererless case
728             can be removed.
729
730 2017-09-14  Joseph Pecoraro  <pecoraro@apple.com>
731
732         Web Inspector: Timeline should show when events preventDefault() was called on an event or not
733         https://bugs.webkit.org/show_bug.cgi?id=176824
734         <rdar://problem/34290931>
735
736         Reviewed by Devin Rousso.
737
738         Test: inspector/timeline/timeline-event-EventDispatch.html
739
740         * dom/EventTarget.cpp:
741         (WebCore::EventTarget::fireEventListeners):
742         * page/DOMWindow.cpp:
743         (WebCore::DOMWindow::dispatchEvent):
744         Include defaultPrevented when notifying inspector.
745
746         * inspector/InspectorInstrumentation.cpp:
747         (WebCore::InspectorInstrumentation::didDispatchEventImpl):
748         (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
749         * inspector/InspectorInstrumentation.h:
750         (WebCore::InspectorInstrumentation::didDispatchEvent):
751         (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
752         Pass defaultPrevented on to agent.
753
754         * inspector/InspectorTimelineAgent.cpp:
755         (WebCore::InspectorTimelineAgent::didDispatchEvent):
756         (WebCore::InspectorTimelineAgent::didLayout):
757         (WebCore::InspectorTimelineAgent::didPaint):
758         * inspector/InspectorTimelineAgent.h:
759         * inspector/TimelineRecordFactory.cpp:
760         (WebCore::TimelineRecordFactory::appendLayoutRoot):
761         (WebCore::TimelineRecordFactory::appendDidDispatchEventData):
762         * inspector/TimelineRecordFactory.h:
763         Append a boolean defaultPrevented property on the EventDispatch timeline record's data.
764
765 2017-09-14  Ryan Haddad  <ryanhaddad@apple.com>
766
767         Unreviewed, rolling out r222015.
768
769         The LayoutTests added with this change are flaky.
770
771         Reverted changeset:
772
773         "Web Inspector: Timeline should show when events
774         preventDefault() was called on an event or not"
775         https://bugs.webkit.org/show_bug.cgi?id=176824
776         http://trac.webkit.org/changeset/222015
777
778 2017-09-14  Ms2ger  <Ms2ger@igalia.com>
779
780         Allow passing sequences to various WebGL2 methods.
781         https://bugs.webkit.org/show_bug.cgi?id=176892
782
783         Reviewed by Sam Weinig.
784
785         This matches the specification as well as Gecko and Chromium.
786
787         Test: fast/canvas/webgl/webgl2/sequences.html
788
789         * html/canvas/WebGL2RenderingContext.cpp:
790         (WebCore::WebGL2RenderingContext::uniform1uiv):
791         (WebCore::WebGL2RenderingContext::uniform2uiv):
792         (WebCore::WebGL2RenderingContext::uniform3uiv):
793         (WebCore::WebGL2RenderingContext::uniform4uiv):
794         (WebCore::WebGL2RenderingContext::uniformMatrix2x3fv):
795         (WebCore::WebGL2RenderingContext::uniformMatrix3x2fv):
796         (WebCore::WebGL2RenderingContext::uniformMatrix2x4fv):
797         (WebCore::WebGL2RenderingContext::uniformMatrix4x2fv):
798         (WebCore::WebGL2RenderingContext::uniformMatrix3x4fv):
799         (WebCore::WebGL2RenderingContext::uniformMatrix4x3fv):
800         (WebCore::WebGL2RenderingContext::vertexAttribI4iv):
801         (WebCore::WebGL2RenderingContext::vertexAttribI4uiv):
802         (WebCore::WebGL2RenderingContext::clearBufferiv):
803         (WebCore::WebGL2RenderingContext::clearBufferuiv):
804         (WebCore::WebGL2RenderingContext::clearBufferfv):
805         * html/canvas/WebGL2RenderingContext.h:
806         * html/canvas/WebGL2RenderingContext.idl:
807
808 2017-09-14  Sam Weinig  <sam@webkit.org>
809
810         [Cleanup] Cleanup uses of the FileList class
811         https://bugs.webkit.org/show_bug.cgi?id=176800
812
813         Reviewed by Alex Christensen.
814
815         * fileapi/FileList.cpp:
816         * fileapi/FileList.h:
817
818             Store list of files as Refs, rather than RefPtrs.
819             Add direct accessor to the underlying Vector for faster iteration.
820             Add file(unsigned) function to allow direct indexing, rather than using
821             the DOM exposed item function which always does a length check.
822
823         * Modules/entriesapi/HTMLInputElementEntriesAPI.cpp:
824         
825             Remove unused RuntimeEnabledFeatures.h #include.
826             Use modern for loop and the new direct file vector access. 
827         
828         * bindings/js/SerializedScriptValue.cpp:
829         (WebCore::CloneSerializer::dumpIfTerminal):
830         (WebCore::CloneSerializer::write):
831         (WebCore::CloneDeserializer::readFile):
832         (WebCore::CloneDeserializer::readTerminal):
833         
834             Remove unnecessary #includes, adopt auto, and use modern for-loop
835             for FileList.
836         
837         * dom/DataTransfer.cpp:
838         (WebCore::DataTransfer::files const):
839         (WebCore::DataTransfer::hasFileOfType):
840         
841             Use auto.
842         
843         (WebCore::DataTransfer::createForInputEvent):
844         
845             Use initializer list for the typeToStringMap.
846         
847         * dom/DataTransferItemList.cpp:
848         (WebCore::DataTransferItemList::ensureItems const):
849         
850             Use auto and modern for-loop for FileList.
851         
852         * html/FileInputType.cpp:
853         (WebCore::FileInputType::filesFromFormControlState):
854         (WebCore::FileInputType::saveFormControlState const):
855         (WebCore::FileInputType::appendFormData const):
856         (WebCore::FileInputType::handleDOMActivateEvent):
857         (WebCore::FileInputType::getTypeSpecificValue):
858         (WebCore::FileInputType::disabledAttributeChanged):
859         (WebCore::FileInputType::multipleAttributeChanged):
860         (WebCore::FileInputType::setFiles):
861         (WebCore::FileInputType::receiveDroppedFiles):
862         (WebCore::FileInputType::defaultToolTip const):
863
864             Adopt auto, brace-initialization, and modern for-loops.
865
866         * html/FileListCreator.cpp:
867         (WebCore::appendDirectoryFiles):
868         (WebCore::FileListCreator::createFileList):
869         
870             Update to work in terms of Vector<Ref<File>>.
871
872         * html/FormController.h:
873         (WebCore::FormControlState::FormControlState):
874         
875             Re-format existing constructors and add one that takes an r-value
876             Vector<String> to allow construction from a pre-created list (used 
877             in FileInputType::saveFormControlState)
878         
879         * platform/DragData.h:
880         * platform/gtk/DragDataGtk.cpp:
881         (WebCore::DragData::asFilenames const):
882         * platform/mac/DragDataMac.mm:
883         (WebCore::DragData::asFilenames const):
884         * platform/win/DragDataWin.cpp:
885         (WebCore::DragData::asFilenames const):
886         
887             Convert asFilenames to return, rather than take, a Vector<String>.
888
889 2017-09-14  Carlos Garcia Campos  <cgarcia@igalia.com>
890
891         [Harfbuzz] Wrong offset returned by HarfBuzzShaper::offsetForPosition() when target point is at the middle of a character
892         https://bugs.webkit.org/show_bug.cgi?id=176897
893
894         Reviewed by Michael Catanzaro.
895
896         We should include the character when the point is greater than the center of the character.
897
898         Fixes: fast/multicol/hit-test-end-of-column-with-line-height.html
899                fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-with-line-height.html
900
901         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
902         (WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition):
903
904 2017-09-14  Yusuke Suzuki  <utatane.tea@gmail.com>
905
906         [JSC] Add PrivateSymbolMode::{Include,Exclude} for PropertyNameArray
907         https://bugs.webkit.org/show_bug.cgi?id=176867
908
909         Reviewed by Sam Weinig.
910
911         * bindings/js/JSDOMConvertRecord.h:
912         * bindings/js/SerializedScriptValue.cpp:
913         (WebCore::CloneSerializer::serialize):
914         * bridge/NP_jsobject.cpp:
915         (_NPN_Enumerate):
916
917 2017-09-14  Joseph Pecoraro  <pecoraro@apple.com>
918
919         Web Inspector: Timeline should show when events preventDefault() was called on an event or not
920         https://bugs.webkit.org/show_bug.cgi?id=176824
921         <rdar://problem/34290931>
922
923         Reviewed by Devin Rousso.
924
925         Tests: inspector/timeline/timeline-event-CancelAnimationFrame.html
926                inspector/timeline/timeline-event-EventDispatch.html
927                inspector/timeline/timeline-event-FireAnimationFrame.html
928                inspector/timeline/timeline-event-RequestAnimationFrame.html
929                inspector/timeline/timeline-event-TimerFire.html
930                inspector/timeline/timeline-event-TimerInstall.html
931                inspector/timeline/timeline-event-TimerRemove.html
932
933         * dom/EventTarget.cpp:
934         (WebCore::EventTarget::fireEventListeners):
935         * page/DOMWindow.cpp:
936         (WebCore::DOMWindow::dispatchEvent):
937         Include defaultPrevented when notifying inspector.
938
939         * inspector/InspectorInstrumentation.cpp:
940         (WebCore::InspectorInstrumentation::didDispatchEventImpl):
941         (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
942         * inspector/InspectorInstrumentation.h:
943         (WebCore::InspectorInstrumentation::didDispatchEvent):
944         (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
945         Pass defaultPrevented on to agent.
946
947         * inspector/InspectorTimelineAgent.cpp:
948         (WebCore::InspectorTimelineAgent::didDispatchEvent):
949         (WebCore::InspectorTimelineAgent::didLayout):
950         (WebCore::InspectorTimelineAgent::didPaint):
951         * inspector/InspectorTimelineAgent.h:
952         * inspector/TimelineRecordFactory.cpp:
953         (WebCore::TimelineRecordFactory::appendLayoutRoot):
954         (WebCore::TimelineRecordFactory::appendDidDispatchEventData):
955         * inspector/TimelineRecordFactory.h:
956         Append a boolean defaultPrevented property on the EventDispatch timeline record's data.
957
958 2017-09-14  Maureen Daum  <mdaum@apple.com>
959
960         Introduce the option to mark an HTML element as having AutoFill available.
961         https://bugs.webkit.org/show_bug.cgi?id=176710
962
963         Reviewed by Alex Christensen.
964
965         Introduce the option to mark an HTML element as having AutoFill available. Accessibility
966         can use this property when deciding whether to announce that the focused field offers
967         AutoFill.
968
969         * accessibility/AccessibilityObject.cpp:
970         (WebCore::AccessibilityObject::isValueAutofillAvailable const):
971         Check if the field is explicitly marked as having AutoFill available.
972         * html/HTMLInputElement.cpp:
973         (WebCore::HTMLInputElement::HTMLInputElement):
974         * html/HTMLInputElement.h:
975         (WebCore::HTMLInputElement::isAutoFillAvailable const):
976         (WebCore::HTMLInputElement::setAutoFillAvailable):
977
978 2017-09-13  Basuke Suzuki  <Basuke.Suzuki@sony.com>
979
980         [Curl] Move response related features into ResourceResponse
981         https://bugs.webkit.org/show_bug.cgi?id=174654
982
983         Reviewed by Alex Christensen.
984
985         * platform/Curl.cmake:
986         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
987         (WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders):
988         (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
989         (WebCore::isHttpRedirect): Deleted.
990         (WebCore::isHttpAuthentication): Deleted.
991         (WebCore::isHttpNotModified): Deleted.
992         (WebCore::isAppendableHeader): Deleted.
993         (WebCore::ResourceHandleCurlDelegate::didReceiveHeaderLine): Deleted.
994         * platform/network/curl/ResourceHandleCurlDelegate.h:
995         * platform/network/curl/ResourceResponse.h:
996         (WebCore::ResourceResponse::platformSuggestedFilename const): Deleted.
997         * platform/network/curl/ResourceResponseCurl.cpp: Added.
998         (WebCore::ResourceResponse::isAppendableHeader):
999         (WebCore::ResourceResponse::appendHTTPHeaderField):
1000         (WebCore::ResourceResponse::setStatusLine):
1001         (WebCore::ResourceResponse::platformSuggestedFilename const):
1002         (WebCore::ResourceResponse::isRedirection const):
1003         (WebCore::ResourceResponse::isNotModified const):
1004         (WebCore::ResourceResponse::isUnauthorized const):
1005
1006 2017-09-13  Zalan Bujtas  <zalan@apple.com>
1007
1008         Switch multicolumn's spanner map from raw over to weak pointers.
1009         https://bugs.webkit.org/show_bug.cgi?id=176367
1010         <rdar://problem/34254896>
1011
1012         Reviewed by Antti Koivisto.
1013
1014         Test: fast/multicol/spanner-crash-when-adding-summary.html
1015
1016         * rendering/RenderMultiColumnFlowThread.cpp:
1017         (WebCore::RenderMultiColumnFlowThread::evacuateAndDestroy):
1018         (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted):
1019         (WebCore::RenderMultiColumnFlowThread::handleSpannerRemoval):
1020         * rendering/RenderMultiColumnFlowThread.h:
1021         * rendering/RenderMultiColumnSet.cpp:
1022         (WebCore::RenderMultiColumnSet::firstRendererInFlowThread const):
1023         (WebCore::RenderMultiColumnSet::lastRendererInFlowThread const):
1024         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
1025         (WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder):
1026         * rendering/RenderMultiColumnSpannerPlaceholder.h:
1027
1028 2017-09-13  John Wilander  <wilander@apple.com>
1029
1030         Introduce Storage Access API (document parts) as an experimental feature
1031         https://bugs.webkit.org/show_bug.cgi?id=175759
1032         <rdar://problem/34414107>
1033
1034         Reviewed by Alex Christensen.
1035
1036         Storage Access API is an experimental feature which allows cross-origin,
1037         sandboxed iframes to request access to their first-party storage (as
1038         opposed to partitioned storage). This might be restricted to cookies or
1039         might cover all stateful mechanisms.
1040
1041         It introduces the following three developer-facing things:
1042         - A new readonly attribute, document.hasStorageAccess.
1043         - A new function, document.requestStorageAccess().
1044         - A new iframe sandbox token, allow-storage-access-by-user-activation.
1045
1046         Tests: http/tests/storageAccess/request-and-deny-storage-access-cross-origin-iframe.html
1047                http/tests/storageAccess/request-and-deny-storage-access-cross-origin-sandboxed-iframe.html
1048                http/tests/storageAccess/request-and-grant-storage-access-cross-origin-iframe.html
1049                http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe.html
1050                http/tests/storageAccess/request-storage-access-cross-origin-sandboxed-iframe-with-unique-origin.html
1051                http/tests/storageAccess/request-storage-access-cross-origin-sandboxed-iframe-without-allow-token.html
1052                http/tests/storageAccess/request-storage-access-same-origin-iframe.html
1053                http/tests/storageAccess/request-storage-access-same-origin-sandboxed-iframe-without-allow-token.html
1054                http/tests/storageAccess/request-storage-access-same-origin-sandboxed-iframe.html
1055                http/tests/storageAccess/request-storage-access-top-frame.html
1056
1057         * dom/Document.cpp:
1058         (WebCore::Document::requestStorageAccess):
1059         * dom/Document.h:
1060         (WebCore::Document::hasStorageAccess const):
1061         (WebCore::Document::setUserGrantsStorageAccessOverride):
1062             See comments on WebCore::Internals below.
1063         * dom/Document.idl:
1064         * dom/SecurityContext.cpp:
1065         (WebCore::SecurityContext::isSupportedSandboxPolicy):
1066         (WebCore::SecurityContext::parseSandboxPolicy):
1067             Support for allow-storage-access-by-user-activation.
1068         * dom/SecurityContext.h:
1069         * loader/ResourceLoadObserver.cpp:
1070         (WebCore::ResourceLoadObserver::registerStorageAccess):
1071             Newly granted storage access is reported to 
1072             WebCore::ResourceLoadObserver.
1073         * loader/ResourceLoadObserver.h:
1074         * loader/ResourceLoadStatistics.cpp:
1075         (WebCore::encodeHashSet):
1076         (WebCore::ResourceLoadStatistics::encode const):
1077         (WebCore::decodeHashSet):
1078         (WebCore::ResourceLoadStatistics::decode):
1079         (WebCore::appendHashSet):
1080         (WebCore::ResourceLoadStatistics::toString const):
1081         (WebCore::mergeHashSet):
1082         (WebCore::ResourceLoadStatistics::merge):
1083             Storage of the new type of data.
1084         * loader/ResourceLoadStatistics.h:
1085         * page/Settings.in:
1086         * testing/Internals.cpp:
1087         (WebCore::Internals::resetToConsistentState):
1088         (WebCore::Internals::setUserGrantsStorageAccess):
1089         * testing/Internals.h:
1090         * testing/Internals.idl:
1091             Added setUserGrantsStorageAccess(). It is used to
1092             override the eventSender's keyboard input which
1093             always results in a cancel action on the confirm()
1094             dialog.
1095
1096 2017-09-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1097
1098         Submitting a form can cause HTMLFormElement's associated elements vector to be mutated during iteration
1099         https://bugs.webkit.org/show_bug.cgi?id=176368
1100         <rdar://problem/34254998>
1101
1102         Reviewed by Ryosuke Niwa.
1103
1104         In the process of iterating over form.associatedElements() during form submission in FormSubmission::create, the
1105         page may cause us to clobber the vector of FormAssociatedElements* we're currently iterating over by inserting
1106         new form controls beneath the form element we're in the process of submitting. This happens because
1107         FormSubmission::create calls HTMLTextAreaElement::appendFormData, which requires layout to be up to date, which
1108         in turn makes us updateLayout() and set focus, which fires a `change` event, upon which the page's JavaScript
1109         inserts additonal DOM nodes into the form, modifying the vector of associated elements.
1110
1111         To mitigate this, instead of iterating over HTMLFormElement::associatedElements(), which returns a reference to
1112         the HTMLFormElement's actual m_associatedElements vector, we iterate over a new vector of
1113         Ref<FormAssociatedElement>s created from m_associatedElements.
1114
1115         This patch also removes an event dispatch assertion added in r212026. This assertion was added to catch any
1116         other events dispatched in this scope, since dispatching events there would have had security implications, but
1117         after making iteration over associated elements robust, this NoEventDispatchAssertion is no longer useful.
1118
1119         Test: fast/forms/append-children-during-form-submission.html
1120
1121         * loader/FormSubmission.cpp:
1122         (WebCore::FormSubmission::create):
1123
1124 2017-09-13  Devin Rousso  <webkit@devinrousso.com>
1125
1126         Web Inspector: Event Listeners section does not update when listeners are added/removed
1127         https://bugs.webkit.org/show_bug.cgi?id=170570
1128         <rdar://problem/31501645>
1129
1130         Reviewed by Joseph Pecoraro.
1131
1132         Test: inspector/dom/event-listener-add-remove.html
1133
1134         * dom/EventTarget.cpp:
1135         (WebCore::EventTarget::setAttributeEventListener):
1136         Fire willRemoveEventListener/didAddEventListener events when an attribute event listener is
1137         replaced by another event listener.
1138
1139         * inspector/InspectorDOMAgent.h:
1140         * inspector/InspectorDOMAgent.cpp:
1141         (WebCore::InspectorDOMAgent::didAddEventListener):
1142         (WebCore::InspectorDOMAgent::willRemoveEventListener):
1143         Dispatch an event to the inspector frontend whenever an event listener is added/removed.
1144
1145         * inspector/InspectorInstrumentation.cpp:
1146         (WebCore::InspectorInstrumentation::didAddEventListenerImpl):
1147         (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
1148         Tie into existing instrumentation points for adding/removing event listeners.
1149
1150 2017-09-13  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1151
1152         [Curl] Bug fix for synchronous transfer
1153         https://bugs.webkit.org/show_bug.cgi?id=176552
1154
1155         Reviewed by Alex Christensen.
1156
1157         ResourceHandleInternal::m_delegate is null when transfer is synchronous. It should be set ResourceHandleCurlDelegate.
1158         Also the callback functions called when transfer is completed is wrong.
1159
1160         * platform/network/curl/ResourceHandleCurl.cpp:
1161         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
1162         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
1163         (WebCore::ResourceHandleCurlDelegate::dispatchSynchronousJob):
1164         (WebCore::ResourceHandleCurlDelegate::notifyFinish):
1165         (WebCore::ResourceHandleCurlDelegate::notifyFail):
1166         (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
1167         (WebCore::ResourceHandleCurlDelegate::didReceiveData):
1168         (WebCore::ResourceHandleCurlDelegate::willSendData):
1169
1170 2017-09-13  Matt Lewis  <jlewis3@apple.com>
1171
1172         Unreviewed, rolling out r221976.
1173
1174         The test introduced was flaky from point of addition.
1175
1176         Reverted changeset:
1177
1178         "Introduce Storage Access API (document parts) as an
1179         experimental feature"
1180         https://bugs.webkit.org/show_bug.cgi?id=175759
1181         http://trac.webkit.org/changeset/221976
1182
1183 2017-09-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
1184
1185         Followup (r221805): Address comments and add more tests
1186         https://bugs.webkit.org/show_bug.cgi?id=176732
1187
1188         Reviewed by Darin Adler.
1189
1190         Test: http/tests/images/decode-slow-load-static-image.html
1191
1192         Code clean up and adding a new test to ensure multiple decode() promises
1193         can be resolved or rejected simultaneously without any issues.
1194
1195         * loader/ImageLoader.cpp:
1196         (WebCore::ImageLoader::decode):
1197         (WebCore::ImageLoader::decodeError):
1198         * loader/ImageLoader.h:
1199         * platform/graphics/BitmapImage.cpp:
1200         (WebCore::BitmapImage::decode):
1201         (WebCore::BitmapImage::callDecodingCallbacks):
1202         * platform/graphics/BitmapImage.h:
1203
1204 2017-09-13  Youenn Fablet  <youenn@apple.com>
1205
1206         Internals clearCacheStorageMemoryRepresentation should return a Promise
1207         https://bugs.webkit.org/show_bug.cgi?id=176818
1208
1209         Reviewed by Alex Christensen.
1210
1211         No observable change of behavior.
1212
1213         * Modules/cache/DOMCacheEngine.h:
1214         * testing/Internals.cpp:
1215         (WebCore::Internals::clearCacheStorageMemoryRepresentation): Returning a promise when clearing is completed.
1216         * testing/Internals.h:
1217         * testing/Internals.idl:
1218
1219 2017-09-13  Nikita Vasilyev  <nvasilyev@apple.com>
1220
1221         Web Inspector: Frontend should be made to expect and handle disabled properties
1222         https://bugs.webkit.org/show_bug.cgi?id=166787
1223         <rdar://problem/34379593>
1224
1225         Reviewed by Joseph Pecoraro.
1226
1227         Include disabled (commented out) CSS properties in the payload.
1228
1229         Tests: inspector/css/css-property.html
1230                inspector/css/matched-style-properties.html
1231
1232         * inspector/InspectorStyleSheet.cpp:
1233         (WebCore::InspectorStyle::populateAllProperties const):
1234         (WebCore::InspectorStyle::styleWithProperties const):
1235
1236 2017-09-13  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1237
1238         [GTK] Fails to build because 'Float32Array' has not been declared in AudioContext.h
1239         https://bugs.webkit.org/show_bug.cgi?id=176870
1240
1241         Reviewed by Konstantin Tokarev.
1242
1243         Add missing include of Float32Array.h
1244
1245         No new tests, its a build fix.
1246
1247         * Modules/webaudio/AudioContext.h:
1248
1249 2017-09-13  Andy Estes  <aestes@apple.com>
1250
1251         [CF] Upstream CFNetwork-related WebKitSystemInterface functions
1252         https://bugs.webkit.org/show_bug.cgi?id=176729
1253
1254         Reviewed by Alex Christensen.
1255
1256         * platform/ios/WebCoreSystemInterfaceIOS.mm:
1257         * platform/mac/PublicSuffixMac.mm:
1258         (WebCore::isPublicSuffix):
1259         * platform/mac/WebCoreSystemInterface.h:
1260         * platform/mac/WebCoreSystemInterface.mm:
1261         * platform/network/cf/ResourceRequestCFNet.cpp:
1262         (WebCore::ResourceRequest::doUpdatePlatformRequest):
1263         (WebCore::ResourceRequest::doUpdateResourceRequest):
1264         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1265         (WebCore::setCONNECTProxyForStream):
1266         (WebCore::SocketStreamHandleImpl::createStreams):
1267         (WebCore::setCONNECTProxyAuthorizationForStream):
1268         (WebCore::SocketStreamHandleImpl::addCONNECTCredentials):
1269         (WebCore::copyCONNECTProxyResponse):
1270         (WebCore::SocketStreamHandleImpl::readStreamCallback):
1271         (WebCore::SocketStreamHandleImpl::writeStreamCallback):
1272         * platform/network/cocoa/ResourceRequestCocoa.mm:
1273         (WebCore::ResourceRequest::doUpdateResourceRequest):
1274         (WebCore::ResourceRequest::doUpdatePlatformRequest):
1275
1276 2017-09-13  Antti Koivisto  <antti@apple.com>
1277
1278         Make more of the CSS animation system internals element based
1279         https://bugs.webkit.org/show_bug.cgi?id=176832
1280
1281         Reviewed by Zalan Bujtas.
1282
1283         CSS animations animate element style. Continue moving away from renderers in the animation code.
1284
1285         Also do some general modernization.
1286
1287         * css/CSSComputedStyleDeclaration.cpp:
1288         (WebCore::computeRenderStyleForProperty):
1289         * page/animation/AnimationBase.cpp:
1290         (WebCore::AnimationBase::AnimationBase):
1291         * page/animation/AnimationBase.h:
1292         * page/animation/CSSAnimationController.cpp:
1293         (WebCore::CSSAnimationControllerPrivate::ensureCompositeAnimation):
1294         (WebCore::CSSAnimationControllerPrivate::clear):
1295         (WebCore::CSSAnimationControllerPrivate::updateAnimations):
1296         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimerForElement):
1297         (WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer const):
1298         (WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer const):
1299         (WebCore::CSSAnimationControllerPrivate::pauseAnimationAtTime):
1300         (WebCore::CSSAnimationControllerPrivate::pauseTransitionAtTime):
1301         (WebCore::CSSAnimationControllerPrivate::animatedStyleForElement):
1302         (WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation const):
1303         (WebCore::CSSAnimationController::cancelAnimations):
1304         (WebCore::CSSAnimationController::updateAnimations):
1305         (WebCore::CSSAnimationController::animatedStyleForRenderer):
1306         (WebCore::CSSAnimationController::computeExtentOfAnimation const):
1307         (WebCore::CSSAnimationController::pauseAnimationAtTime):
1308         (WebCore::CSSAnimationController::pauseTransitionAtTime):
1309         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimerForRenderer): Deleted.
1310         (WebCore::CSSAnimationControllerPrivate::getAnimatedStyleForRenderer): Deleted.
1311         (WebCore::CSSAnimationController::getAnimatedStyleForRenderer): Deleted.
1312         * page/animation/CSSAnimationController.h:
1313         * page/animation/CSSAnimationControllerPrivate.h:
1314         * page/animation/CompositeAnimation.cpp:
1315         (WebCore::CompositeAnimation::~CompositeAnimation):
1316         (WebCore::CompositeAnimation::clearElement):
1317         (WebCore::CompositeAnimation::updateTransitions):
1318         (WebCore::CompositeAnimation::updateKeyframeAnimations):
1319         (WebCore::CompositeAnimation::animate):
1320         (WebCore::CompositeAnimation::clearRenderer): Deleted.
1321         * page/animation/CompositeAnimation.h:
1322         * page/animation/ImplicitAnimation.cpp:
1323         (WebCore::ImplicitAnimation::ImplicitAnimation):
1324         (WebCore::ImplicitAnimation::animate):
1325         * page/animation/ImplicitAnimation.h:
1326         (WebCore::ImplicitAnimation::create):
1327         * page/animation/KeyframeAnimation.cpp:
1328         (WebCore::KeyframeAnimation::KeyframeAnimation):
1329         (WebCore::KeyframeAnimation::animate):
1330         * page/animation/KeyframeAnimation.h:
1331         * rendering/RenderElement.cpp:
1332         (WebCore::RenderElement::willBeDestroyed):
1333         * rendering/RenderLayer.cpp:
1334         (WebCore::RenderLayer::currentTransform const):
1335         * style/RenderTreeUpdater.cpp:
1336         (WebCore::RenderTreeUpdater::createRenderer):
1337         * style/StyleTreeResolver.cpp:
1338         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1339         * testing/Internals.cpp:
1340         (WebCore::Internals::pauseAnimationAtTimeOnElement):
1341         (WebCore::Internals::pauseAnimationAtTimeOnPseudoElement):
1342         (WebCore::Internals::pauseTransitionAtTimeOnElement):
1343         (WebCore::Internals::pauseTransitionAtTimeOnPseudoElement):
1344
1345 2017-09-13  Daniel Bates  <dabates@apple.com>
1346
1347         Make history.pushState()/replaceState() more closely aligned to the HTML standard
1348         https://bugs.webkit.org/show_bug.cgi?id=176730
1349         <rdar://problem/33839265>
1350
1351         Reviewed by Alex Christensen.
1352
1353         Update history.pushState()/replaceState() to more closely align with the algorithm
1354         specified in <https://html.spec.whatwg.org/multipage/history.html#dom-history-pushstate-2> (9 September 2017).
1355
1356         Test: http/tests/security/history-pushState-replaceState-from-sandboxed-iframe.html
1357
1358         * page/History.cpp:
1359         (WebCore::History::stateObjectAdded):
1360         * page/SecurityOrigin.cpp:
1361         (WebCore::SecurityOrigin::extractInnerURL): Use URL constructor that takes a base URL as opposed
1362         to using the special ParsedURLString-variant because the latter can only be used to parse a string
1363         returned from URL::string(). And the extracted inner URL does not meet this criterion. Using the
1364         ParsedURLString-variant of the URL constructor with a string that is not the result of URL::string()
1365         will cause an assertion failure in a debug build.
1366
1367 2017-09-13  John Wilander  <wilander@apple.com>
1368
1369         Introduce Storage Access API (document parts) as an experimental feature
1370         https://bugs.webkit.org/show_bug.cgi?id=175759
1371         <rdar://problem/33666847>
1372
1373         Reviewed by Alex Christensen.
1374
1375         Storage Access API is an experimental feature which allows cross-origin,
1376         sandboxed iframes to request access to their first-party storage (as
1377         opposed to partitioned storage). This might be restricted to cookies or
1378         might cover all stateful mechanisms.
1379
1380         It introduces the following three developer-facing things:
1381         - A new readonly attribute, document.hasStorageAccess.
1382         - A new function, document.requestStorageAccess().
1383         - A new iframe sandbox token, allow-storage-access-by-user-activation.
1384
1385         Tests: http/tests/loading/resourceLoadStatistics/request-and-deny-storage-access-cross-origin-iframe.html
1386                http/tests/loading/resourceLoadStatistics/request-and-deny-storage-access-cross-origin-sandboxed-iframe.html
1387                http/tests/loading/resourceLoadStatistics/request-and-grant-storage-access-cross-origin-iframe.html
1388                http/tests/loading/resourceLoadStatistics/request-and-grant-storage-access-cross-origin-sandboxed-iframe.html
1389                http/tests/loading/resourceLoadStatistics/request-storage-access-cross-origin-sandboxed-iframe-with-unique-origin.html
1390                http/tests/loading/resourceLoadStatistics/request-storage-access-cross-origin-sandboxed-iframe-without-allow-token.html
1391                http/tests/loading/resourceLoadStatistics/request-storage-access-same-origin-iframe.html
1392                http/tests/loading/resourceLoadStatistics/request-storage-access-same-origin-sandboxed-iframe-without-allow-token.html
1393                http/tests/loading/resourceLoadStatistics/request-storage-access-same-origin-sandboxed-iframe.html
1394                http/tests/loading/resourceLoadStatistics/request-storage-access-top-frame.html
1395
1396         * dom/Document.cpp:
1397         (WebCore::Document::requestStorageAccess):
1398         * dom/Document.h:
1399         (WebCore::Document::hasStorageAccess const):
1400         (WebCore::Document::setUserGrantsStorageAccessOverride):
1401             See comments on WebCore::Internals below.
1402         * dom/Document.idl:
1403         * dom/SecurityContext.cpp:
1404         (WebCore::SecurityContext::isSupportedSandboxPolicy):
1405         (WebCore::SecurityContext::parseSandboxPolicy):
1406             Support for allow-storage-access-by-user-activation.
1407         * dom/SecurityContext.h:
1408         * loader/ResourceLoadObserver.cpp:
1409         (WebCore::ResourceLoadObserver::registerStorageAccess):
1410             Newly granted storage access is reported to 
1411             WebCore::ResourceLoadObserver.
1412         * loader/ResourceLoadObserver.h:
1413         * loader/ResourceLoadStatistics.cpp:
1414         (WebCore::encodeHashSet):
1415         (WebCore::ResourceLoadStatistics::encode const):
1416         (WebCore::decodeHashSet):
1417         (WebCore::ResourceLoadStatistics::decode):
1418         (WebCore::appendHashSet):
1419         (WebCore::ResourceLoadStatistics::toString const):
1420         (WebCore::mergeHashSet):
1421         (WebCore::ResourceLoadStatistics::merge):
1422             Storage of the new type of data.
1423         * loader/ResourceLoadStatistics.h:
1424         * page/Settings.in:
1425         * testing/Internals.cpp:
1426         (WebCore::Internals::resetToConsistentState):
1427         (WebCore::Internals::setUserGrantsStorageAccess):
1428         * testing/Internals.h:
1429         * testing/Internals.idl:
1430             Added setUserGrantsStorageAccess(). It is used to
1431             override the eventSender's keyboard input which
1432             always results in a cancel action on the confirm()
1433             dialog.
1434
1435 2017-09-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1436
1437         [HarfBuzz] Wrong offset returned by HarfBuzzShaper::offsetForPosition in some cases
1438         https://bugs.webkit.org/show_bug.cgi?id=176848
1439
1440         Reviewed by Michael Catanzaro.
1441
1442         This patch rewrites HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition() to make it simpler and ensure we
1443         return the right offset in all the cases, also honoring now the includePartialGlyphs parameter that we were
1444         ignoring in FontCascade::offsetForPositionForComplexText().
1445
1446         Fixes several tests that started to fail after r221909.
1447
1448         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
1449         (WebCore::FontCascade::offsetForPositionForComplexText const):
1450         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
1451         (WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition):
1452         (WebCore::HarfBuzzShaper::offsetForPosition):
1453         * platform/graphics/harfbuzz/HarfBuzzShaper.h:
1454
1455 2017-09-13  Per Arne Vollan  <pvollan@apple.com>
1456
1457         Initialize InternalSettings member variable.
1458         https://bugs.webkit.org/show_bug.cgi?id=176838
1459
1460         Reviewed by Brent Fulgham.
1461
1462         Initialize the m_webVREnabled member in the constructor.
1463
1464         * testing/InternalSettings.cpp:
1465         (WebCore::InternalSettings::Backup::Backup):
1466
1467 2017-09-13  Ms2ger  <Ms2ger@igalia.com>
1468
1469         Make WebGLRenderingContextBase::TypedList::data() const-correct.
1470         https://bugs.webkit.org/show_bug.cgi?id=176833
1471
1472         Reviewed by Sam Weinig.
1473
1474         No change of behavior.
1475
1476         * html/canvas/WebGLRenderingContextBase.cpp:
1477         (WebCore::WebGLRenderingContextBase::validateUniformMatrixParameters):
1478         * html/canvas/WebGLRenderingContextBase.h:
1479         (WebCore::WebGLRenderingContextBase::TypedList::data const):
1480         * platform/graphics/GraphicsContext3D.h:
1481         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1482         (WebCore::GraphicsContext3D::uniform1fv):
1483         (WebCore::GraphicsContext3D::uniform2fv):
1484         (WebCore::GraphicsContext3D::uniform3fv):
1485         (WebCore::GraphicsContext3D::uniform4fv):
1486         (WebCore::GraphicsContext3D::uniform1iv):
1487         (WebCore::GraphicsContext3D::uniform2iv):
1488         (WebCore::GraphicsContext3D::uniform3iv):
1489         (WebCore::GraphicsContext3D::uniform4iv):
1490         (WebCore::GraphicsContext3D::uniformMatrix2fv):
1491         (WebCore::GraphicsContext3D::uniformMatrix3fv):
1492         (WebCore::GraphicsContext3D::uniformMatrix4fv):
1493         (WebCore::GraphicsContext3D::vertexAttrib1fv):
1494         (WebCore::GraphicsContext3D::vertexAttrib2fv):
1495         (WebCore::GraphicsContext3D::vertexAttrib3fv):
1496         (WebCore::GraphicsContext3D::vertexAttrib4fv):
1497
1498 2017-09-13  Sam Weinig  <sam@webkit.org>
1499
1500         Remove CanvasRenderingContext2D.commit(), it is a no-op and not part the standard
1501         https://bugs.webkit.org/show_bug.cgi?id=176821
1502
1503         Reviewed by Darin Adler.
1504
1505         * html/canvas/CanvasRenderingContext2D.h:
1506         * html/canvas/CanvasRenderingContext2D.idl:
1507         
1508             Remove the commit operation. It is no longer part the standard (it was
1509             moved to OffscreenCanvasRenderingContext2D) and it was a no-op.
1510
1511 2017-09-12  Matt Rajca  <mrajca@apple.com>
1512
1513         Ensure the user interacted with the page before setting m_userHasInteractedWithMediaElement
1514         https://bugs.webkit.org/show_bug.cgi?id=176816
1515
1516         Reviewed by Eric Carlson.
1517
1518         Currently, when the user presses a keyboard shortcut in the client to reload a page, that may
1519         get registered as a user gesture on the reloaded page. Before setting the
1520         m_userHasInteractedWithMediaElement flag, we should check if a user gesture was actually handled
1521         by checking the userDidInteractWithPage flag. In case of key events that aren't handled by the
1522         page, this will be set to false by EventHandler:
1523
1524             // If the key event was not handled, do not treat it as user interaction with the page.
1525             if (topDocument && !wasHandled)
1526                 topDocument->setUserDidInteractWithPage(savedUserDidInteractWithPage);
1527
1528         We need to revisit this in the future in webkit.org/b/176817 and ensure user gesture tokens
1529         don't carry over across reloads of the page.
1530
1531         Tests: I wasn't able to trigger the pathological scenario this aims to fix with a test that calls
1532         window.location.reload() from a synthetic keyDown event.
1533
1534         * dom/Document.cpp:
1535         (WebCore::Document::noteUserInteractionWithMediaElement):
1536
1537 2017-09-13  Ms2ger  <Ms2ger@igalia.com>
1538
1539         Disallow passing null values to various WebGL2 methods.
1540         https://bugs.webkit.org/show_bug.cgi?id=176829
1541
1542         Reviewed by Yusuke Suzuki.
1543
1544         This matches the specification as well as Gecko and Chromium.
1545
1546         Test: fast/canvas/webgl/webgl2/bindings.html
1547
1548         * html/canvas/WebGL2RenderingContext.cpp:
1549         (WebCore::WebGL2RenderingContext::beginQuery):
1550         (WebCore::WebGL2RenderingContext::getQueryParameter):
1551         (WebCore::WebGL2RenderingContext::samplerParameteri):
1552         (WebCore::WebGL2RenderingContext::samplerParameterf):
1553         (WebCore::WebGL2RenderingContext::getSamplerParameter):
1554         (WebCore::WebGL2RenderingContext::clientWaitSync):
1555         (WebCore::WebGL2RenderingContext::waitSync):
1556         (WebCore::WebGL2RenderingContext::getSyncParameter):
1557         (WebCore::WebGL2RenderingContext::transformFeedbackVaryings):
1558         (WebCore::WebGL2RenderingContext::getTransformFeedbackVarying):
1559         (WebCore::WebGL2RenderingContext::getUniformIndices):
1560         (WebCore::WebGL2RenderingContext::getUniformBlockIndex):
1561         (WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter):
1562         (WebCore::WebGL2RenderingContext::getActiveUniformBlockName):
1563         (WebCore::WebGL2RenderingContext::uniformBlockBinding):
1564         * html/canvas/WebGL2RenderingContext.h:
1565         * html/canvas/WebGL2RenderingContext.idl:
1566
1567 2017-09-13  Sergio Villar Senin  <svillar@igalia.com>
1568
1569         [WebVR] Add IDLs and stubs
1570         https://bugs.webkit.org/show_bug.cgi?id=174202
1571
1572         Reviewed by Dean Jackson.
1573
1574         Adding the complete set of IDLs for the WebVR 1.1 spec including the interface stubs which
1575         currently do nothing.
1576
1577         Tests: webvr/webvr-disabled.html
1578                webvr/webvr-enabled.html
1579
1580         * CMakeLists.txt:
1581         * DerivedSources.make:
1582         * Modules/webvr/DOMWindowWebVR.idl: Added.
1583         * Modules/webvr/GamepadWebVR.cpp: Added.
1584         (WebCore::GamepadWebVR::GamepadWebVR):
1585         (WebCore::GamepadWebVR::~GamepadWebVR):
1586         (WebCore::GamepadWebVR::displayId):
1587         * Modules/webvr/GamepadWebVR.h: Added.
1588         * Modules/webvr/GamepadWebVR.idl: Added.
1589         * Modules/webvr/NavigatorWebVR.cpp: Added.
1590         (WebCore::NavigatorWebVR::getVRDisplays):
1591         (WebCore::NavigatorWebVR::activeVRDisplays):
1592         (WebCore::NavigatorWebVR::vrEnabled):
1593         * Modules/webvr/NavigatorWebVR.h: Added.
1594         * Modules/webvr/NavigatorWebVR.idl: Added.
1595         * Modules/webvr/VRDisplay.cpp: Added.
1596         (WebCore::VRDisplay::create):
1597         (WebCore::VRDisplay::VRDisplay):
1598         (WebCore::VRDisplay::isConnected const):
1599         (WebCore::VRDisplay::isPresenting const):
1600         (WebCore::VRDisplay::capabilities const):
1601         (WebCore::VRDisplay::stageParameters const):
1602         (WebCore::VRDisplay::getEyeParameters const):
1603         (WebCore::VRDisplay::displayId const):
1604         (WebCore::VRDisplay::displayName const):
1605         (WebCore::VRDisplay::getFrameData const):
1606         (WebCore::VRDisplay::getPose const):
1607         (WebCore::VRDisplay::resetPose):
1608         (WebCore::VRDisplay::depthNear const):
1609         (WebCore::VRDisplay::setDepthNear):
1610         (WebCore::VRDisplay::depthFar const):
1611         (WebCore::VRDisplay::setDepthFar):
1612         (WebCore::VRDisplay::requestAnimationFrame):
1613         (WebCore::VRDisplay::cancelAnimationFrame):
1614         (WebCore::VRDisplay::requestPresent):
1615         (WebCore::VRDisplay::exitPresent):
1616         (WebCore::VRDisplay::getLayers const):
1617         (WebCore::VRDisplay::submitFrame):
1618         (WebCore::VRDisplay::hasPendingActivity const):
1619         (WebCore::VRDisplay::activeDOMObjectName const):
1620         (WebCore::VRDisplay::canSuspendForDocumentSuspension const):
1621         (WebCore::VRDisplay::stop):
1622         * Modules/webvr/VRDisplay.h: Added.
1623         * Modules/webvr/VRDisplay.idl: Added.
1624         * Modules/webvr/VRDisplayCapabilities.cpp: Added.
1625         (WebCore::VRDisplayCapabilities::hasPosition const):
1626         (WebCore::VRDisplayCapabilities::hasOrientation const):
1627         (WebCore::VRDisplayCapabilities::hasExternalDisplay const):
1628         (WebCore::VRDisplayCapabilities::canPresent const):
1629         (WebCore::VRDisplayCapabilities::maxLayer const):
1630         * Modules/webvr/VRDisplayCapabilities.h: Added.
1631         (WebCore::VRDisplayCapabilities::create):
1632         * Modules/webvr/VRDisplayCapabilities.idl: Added.
1633         * Modules/webvr/VRDisplayEvent.cpp: Added.
1634         (WebCore::VRDisplayEvent::VRDisplayEvent):
1635         (WebCore::VRDisplayEvent::display const):
1636         (WebCore::VRDisplayEvent::reason const):
1637         (WebCore::VRDisplayEvent::eventInterface const):
1638         * Modules/webvr/VRDisplayEvent.h: Added.
1639         * Modules/webvr/VRDisplayEvent.idl: Added.
1640         * Modules/webvr/VRDisplayEventReason.h: Added.
1641         * Modules/webvr/VRDisplayEventReason.idl: Added.
1642         * Modules/webvr/VREye.h: Added.
1643         * Modules/webvr/VREye.idl: Added.
1644         * Modules/webvr/VREyeParameters.cpp: Added.
1645         (WebCore::VREyeParameters::VREyeParameters):
1646         (WebCore::VREyeParameters::offset const):
1647         (WebCore::VREyeParameters::fieldOfView const):
1648         (WebCore::VREyeParameters::renderWidth const):
1649         (WebCore::VREyeParameters::renderHeight const):
1650         * Modules/webvr/VREyeParameters.h: Added.
1651         (WebCore::VREyeParameters::create):
1652         * Modules/webvr/VREyeParameters.idl: Added.
1653         * Modules/webvr/VRFieldOfView.cpp: Added.
1654         (WebCore::VRFieldOfView::upDegrees const):
1655         (WebCore::VRFieldOfView::rightDegrees const):
1656         (WebCore::VRFieldOfView::downDegrees const):
1657         (WebCore::VRFieldOfView::leftDegrees const):
1658         * Modules/webvr/VRFieldOfView.h: Added.
1659         (WebCore::VRFieldOfView::create):
1660         * Modules/webvr/VRFieldOfView.idl: Added.
1661         * Modules/webvr/VRFrameData.cpp: Added.
1662         (WebCore::VRFrameData::VRFrameData):
1663         (WebCore::VRFrameData::timestamp const):
1664         (WebCore::VRFrameData::leftProjectionMatrix const):
1665         (WebCore::VRFrameData::leftViewMatrix const):
1666         (WebCore::VRFrameData::rightProjectionMatrix const):
1667         (WebCore::VRFrameData::rightViewMatrix const):
1668         (WebCore::VRFrameData::pose const):
1669         * Modules/webvr/VRFrameData.h: Added.
1670         (WebCore::VRFrameData::create):
1671         * Modules/webvr/VRFrameData.idl: Added.
1672         * Modules/webvr/VRLayerInit.h: Added.
1673         * Modules/webvr/VRLayerInit.idl: Added.
1674         * Modules/webvr/VRPose.cpp: Added.
1675         (WebCore::VRPose::position const):
1676         (WebCore::VRPose::linearVelocity const):
1677         (WebCore::VRPose::linearAcceleration const):
1678         (WebCore::VRPose::orientation const):
1679         (WebCore::VRPose::angularVelocity const):
1680         (WebCore::VRPose::angularAcceleration const):
1681         * Modules/webvr/VRPose.h: Added.
1682         (WebCore::VRPose::create):
1683         * Modules/webvr/VRPose.idl: Added.
1684         * Modules/webvr/VRStageParameters.cpp: Added.
1685         (WebCore::VRStageParameters::sittingToStandingTransform const):
1686         (WebCore::VRStageParameters::sizeX const):
1687         (WebCore::VRStageParameters::sizeZ const):
1688         * Modules/webvr/VRStageParameters.h: Added.
1689         (WebCore::VRStageParameters::create):
1690         * Modules/webvr/VRStageParameters.idl: Added.
1691         * WebCore.xcodeproj/project.pbxproj:
1692         * bindings/js/WebCoreBuiltinNames.h:
1693         * dom/EventNames.h:
1694         * dom/EventNames.in:
1695         * dom/EventTargetFactory.in:
1696         * features.json:
1697         * page/RuntimeEnabledFeatures.h:
1698         (WebCore::RuntimeEnabledFeatures::setWebVREnabled):
1699         (WebCore::RuntimeEnabledFeatures::webVREnabled const):
1700         * testing/InternalSettings.cpp:
1701         (WebCore::InternalSettings::Backup::restoreTo):
1702         (WebCore::InternalSettings::setWebVREnabled):
1703         * testing/InternalSettings.h:
1704         * testing/InternalSettings.idl:
1705
1706 2017-09-13  Ms2ger  <Ms2ger@igalia.com>
1707
1708         Update the type of the texture argument to framebufferTextureLayer().
1709         https://bugs.webkit.org/show_bug.cgi?id=176785
1710
1711         Reviewed by Yusuke Suzuki.
1712
1713         This matches the specification as well as Gecko and Chromium.
1714
1715         Also move getInternalformatParameter() to the position it has in the
1716         specification, for easier comparison.
1717
1718         Test: fast/canvas/webgl/webgl2/bindings.html
1719
1720         * html/canvas/WebGL2RenderingContext.cpp:
1721         (WebCore::WebGL2RenderingContext::framebufferTextureLayer):
1722         * html/canvas/WebGL2RenderingContext.h:
1723         * html/canvas/WebGL2RenderingContext.idl:
1724
1725 2017-09-13  Zan Dobersek  <zdobersek@igalia.com>
1726
1727         [EME] Implement CDMInstanceClearKey::updateLicense()
1728         https://bugs.webkit.org/show_bug.cgi?id=176791
1729
1730         Reviewed by Xabier Rodriguez-Calvar.
1731
1732         Implement the updateLicense() method for CDMInstanceClearKey.
1733         The response data is parsed as JSON, matching that agains either
1734         'license' or 'license release acknowledgement' formats (depending
1735         on either 'keys' or 'kids' object keys being present). If any
1736         format is recognized, appropriate steps are taken.
1737
1738         In case of the 'license' format, the passed-in keys are matched
1739         against existing ones. If some keys have changed or have been
1740         newly introduced, the key information is sorted by key ID size
1741         and data to enforce order. After that the KeyStatusVector object
1742         is constructed, containing key ID and status information for all
1743         the keys associated with this session. Finally callback is
1744         dispatched, signalling a successful operation and passing the
1745         KeyStatusVector, if any, back to the caller.
1746
1747         In case of the 'license release acknowledgement' format, the
1748         session data for this session ID is removed from the ClearKey state
1749         singleton. The callback is dispatched signalling the session closure
1750         and successfull completion of the operation.
1751
1752         Finally, if no format is deduced, the callback is again dispatched,
1753         but now signalling an operation failure.
1754
1755         No new tests -- expectations for the relevant tests are updated
1756         to reflect the introduced changes.
1757
1758         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
1759         (WebCore::ClearKeyState::keys):
1760         (WebCore::ClearKeyState::singleton):
1761         (WebCore::parseLicenseFormat):
1762         (WebCore::parseLicenseReleaseAcknowledgementFormat):
1763         (WebCore::CDMInstanceClearKey::updateLicense):
1764
1765 2017-09-13  Ryosuke Niwa  <rniwa@webkit.org>
1766
1767         Refactor WebContentReader out of EditorMac and EditorIOS
1768         https://bugs.webkit.org/show_bug.cgi?id=176770
1769
1770         Reviewed by Sam Weinig.
1771
1772         Extracted WebContentReader.h, WebContentReaderMac.mm, and WebContentIOS.mm from Pasteboard.h,
1773         EditorMac.mm, and EditorIOS.mm respectively.
1774
1775         Also moved createFragmentAndAddResources from EditorCocoa.mm to WebContentReaderCocoa.mm
1776         and createFragmentForImageAndURL and createFragmentForImageResourceAndAddResource to markup.cpp.
1777
1778         * Configurations/WebCore.xcconfig:
1779         * PlatformMac.cmake:
1780         * WebCore.xcodeproj/project.pbxproj:
1781         * editing/Editor.cpp:
1782         (WebCore::Editor::createFragmentForImageAndURL): Deleted.
1783         * editing/Editor.h:
1784         * editing/WebContentReader.h: Added.
1785         * editing/cocoa/EditorCocoa.mm:
1786         (WebCore::Editor::replaceSelectionWithAttributedString):
1787         (WebCore::Editor::createFragment): Deleted.
1788         (WebCore::Editor::createFragmentForImageResourceAndAddResource): Deleted.
1789         (WebCore::Editor::createFragmentAndAddResources): Deleted.
1790         * editing/cocoa/WebContentReaderCocoa.mm: Added.
1791         (WebCore::createFragmentForImageResourceAndAddResource):
1792         (WebCore::createFragment):
1793         (WebCore::createFragmentAndAddResources):
1794         * editing/ios/EditorIOS.mm:
1795         (WebCore::Editor::WebContentReader): Moved to WebContentReaderIOS.mm.
1796         * editing/ios/WebContentReaderIOS.mm: Added.
1797         (WebCore::WebContentReader::addFragment):
1798         (WebCore::WebContentReader::readWebArchive):
1799         (WebCore::WebContentReader::readFilenames):
1800         (WebCore::WebContentReader::readHTML):
1801         (WebCore::WebContentReader::readRTFD):
1802         (WebCore::WebContentReader::readRTF):
1803         (WebCore::WebContentReader::readImage):
1804         (WebCore::WebContentReader::readURL):
1805         (WebCore::WebContentReader::readPlainText):
1806         * editing/mac/EditorMac.mm:
1807         (WebCore::Editor::WebContentReader): Moved to WebContentReaderMac.mm.
1808         * editing/mac/WebContentReaderMac.mm: Added.
1809         (WebCore::WebContentReader::readWebArchive):
1810         (WebCore::WebContentReader::readFilenames):
1811         (WebCore::WebContentReader::readHTML):
1812         (WebCore::WebContentReader::readRTFD):
1813         (WebCore::WebContentReader::readRTF):
1814         (WebCore::WebContentReader::readImage):
1815         (WebCore::WebContentReader::readURL):
1816         (WebCore::WebContentReader::readPlainText):
1817         * editing/markup.cpp:
1818         (WebCore::createFragmentForImageAndURL):
1819         (WebCore::createFragmentForImageResourceAndAddResource):
1820         * editing/markup.h:
1821
1822 2017-09-12  Yusuke Suzuki  <utatane.tea@gmail.com>
1823
1824         [DFG] Optimize WeakMap::get by adding intrinsic and fixup
1825         https://bugs.webkit.org/show_bug.cgi?id=176010
1826
1827         Reviewed by Filip Pizlo.
1828
1829         * platform/network/curl/CurlJobManager.cpp:
1830         (WebCore::CurlJobList::finishJobs):
1831
1832 2017-09-12  Frederic Wang  <fwang@igalia.com>
1833
1834         Rename isRootLayer to isRenderViewLayer
1835         https://bugs.webkit.org/show_bug.cgi?id=176684
1836
1837         Reviewed by Darin Adler.
1838
1839         This patch was generated with the help of do-webcore-rename with some coding style adjustment.
1840
1841         No new tests, behavior unchanged.
1842
1843         * rendering/RenderLayer.cpp:
1844         (WebCore::RenderLayer::RenderLayer):
1845         (WebCore::RenderLayer::enclosingTransformedAncestor const):
1846         (WebCore::RenderLayer::enclosingFilterRepaintLayer const):
1847         (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect):
1848         (WebCore::RenderLayer::clippingRootForPainting const):
1849         (WebCore::RenderLayer::beginTransparencyLayers):
1850         (WebCore::shouldSuppressPaintingLayer):
1851         (WebCore::RenderLayer::paintFixedLayersInNamedFlows):
1852         (WebCore::RenderLayer::hitTest):
1853         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
1854         (WebCore::RenderLayer::calculateClipRects const):
1855         * rendering/RenderLayer.h:
1856         * rendering/RenderLayerBacking.cpp:
1857         (WebCore::RenderLayerBacking::RenderLayerBacking):
1858         (WebCore::RenderLayerBacking::updateConfiguration):
1859         (WebCore::RenderLayerBacking::updateAfterDescendants):
1860         (WebCore::RenderLayerBacking::paintsIntoWindow const):
1861         (WebCore::RenderLayerBacking::paintIntoLayer):
1862         * rendering/RenderLayerCompositor.cpp:
1863         (WebCore::RenderLayerCompositor::logLayerInfo):
1864         (WebCore::RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer const):
1865         (WebCore::RenderLayerCompositor::updateBacking):
1866         (WebCore::RenderLayerCompositor::repaintInCompositedAncestor):
1867         (WebCore::RenderLayerCompositor::addToOverlapMap):
1868         (WebCore::RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed):
1869         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1870         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTreeForNamedFlowFixed):
1871         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
1872         (WebCore::RenderLayerCompositor::needsToBeComposited const):
1873         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const): Also move the IOS condition
1874         up to avoid that check-webkit-style complains.
1875         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
1876         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
1877         (WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer const):
1878         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
1879
1880 2017-09-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1881
1882         [iOS DnD] Support DataTransfer.getData and DataTransfer.setData when dragging or dropping
1883         https://bugs.webkit.org/show_bug.cgi?id=176672
1884         <rdar://problem/34353723>
1885
1886         Reviewed by Ryosuke Niwa.
1887
1888         Makes several tweaks to support DataTransfer.getData and DataTransfer.setData when dragging and dropping on iOS.
1889         See per-method changes below for more details. This patch also renames some old variable and property names
1890         along the way, so they no longer reference "data interaction", and instead refer to the feature by its post-WWDC
1891         name.
1892
1893         New test: DataInteractionTests.ExternalSourceInlineTextToFileInput
1894         Modified: DataInteractionTests.CanStartDragOnDivWithDraggableAttribute
1895                   DataInteractionTests.SinglePlainTextURLTypeIdentifiers
1896                   DataInteractionTests.SinglePlainTextWordTypeIdentifiers
1897
1898         * platform/ios/AbstractPasteboard.h:
1899         * platform/ios/PasteboardIOS.mm:
1900         (WebCore::cocoaTypeFromHTMLClipboardType):
1901
1902         In cocoaTypeFromHTMLClipboardType, map the "text/plain" MIME type to the "public.plain-text" UTI. Previously,
1903         this corresponded to "public.text", which is incorrect, since "public.text" also includes non-plain-text types
1904         such as "public.html", thereby confusing NSItemProviders. Importantly, this makes it so that plain text strings
1905         written via DataTransfer.setData() can actually be read back as a cocoa value, since "public.plain-text" is one
1906         of the UTIs in +[NSString readableTypeIdentifiersForItemProvider].
1907
1908         (WebCore::Pasteboard::writeString):
1909
1910         Instead of writing { type : data } to the pasteboard, write { cocoaType : data }. It appears that this was
1911         changed unintentionally in r156588 when upstreaming the iOS pasteboard implementation. This is made apparent by
1912         how Pasteboard::readString() requests the cocoa UTI from the platform pasteboard, but Pasteboard::writeString()
1913         sends the MIME type.
1914
1915         * platform/ios/PlatformPasteboardIOS.mm:
1916         (WebCore::PlatformPasteboard::filenamesForDataInteraction):
1917         (WebCore::PlatformPasteboard::write):
1918
1919         When writing plain text or a URL, specify that the item wants inline style representation. This prevents odd and
1920         unexpected behaviors (for instance, being able to drag plain text into the Files app as a file), but it also
1921         makes getData() not bail and return the null string on drop, due to forFileDrag() being true in
1922         DataTransfer::getData().
1923
1924         * platform/ios/WebItemProviderPasteboard.h:
1925         * platform/ios/WebItemProviderPasteboard.mm:
1926         (-[WebItemProviderRegistrationInfoList init]):
1927         (uiPreferredPresentationStyle):
1928         (-[WebItemProviderRegistrationInfoList itemProvider]):
1929
1930         Set the preferred presentation style when generating an item provider from a registration list.
1931
1932         (+[WebItemProviderLoadResult emptyLoadResult]):
1933         (+[WebItemProviderLoadResult loadResultWithFileURLMap:presentationStyle:]):
1934         (-[WebItemProviderLoadResult initWithFileURLMap:presentationStyle:]):
1935         (-[WebItemProviderLoadResult fileURLForType:]):
1936         (-[WebItemProviderLoadResult loadedFileURLs]):
1937         (-[WebItemProviderLoadResult loadedTypeIdentifiers]):
1938
1939         Introduce WebItemProviderLoadResult, an object that encapsulates information needed to represent the contents of
1940         an NSItemProvider dropped in web content. Previously, WebItemProviderPasteboard maintained an array of
1941         dictionaries of UTI => file URL, where each dictionary represents where the dropped data for a given item
1942         provider lives. Now that we additionally need to remember (for each item provider) whether we should consider
1943         its data as a file upload, it's more helpful to have a separate object representing the "load results" of a
1944         dropped item provider.
1945
1946         (-[WebItemProviderPasteboard init]):
1947         (-[WebItemProviderPasteboard pasteboardTypes]):
1948         (-[WebItemProviderPasteboard setItemProviders:]):
1949         (-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]):
1950         (-[WebItemProviderPasteboard droppedFileURLs]):
1951
1952         Respect item provider load results that should not be exposed as a file to the page.
1953
1954         (-[WebItemProviderPasteboard numberOfFiles]):
1955
1956         Respect item providers with UIPreferredPresentationStyleInline by not counting them towards the number of files.
1957
1958         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
1959
1960         Adjust for the transition from an array of dictionaries representing loaded item providers to an array of
1961         WebItemProviderLoadResults.
1962
1963         (-[WebItemProviderPasteboard fileURLsForDataInteraction]): Deleted.
1964         * platform/mac/DragDataMac.mm:
1965         (WebCore::DragData::containsFiles const):
1966
1967         DragData::containsFiles previously only considered whether or not particular UTIs appear in the pasteboard. In
1968         the case of Mac, this is NSFilesPromisePboardType and NSFilenamesPboardType, but in the case of iOS, this is a
1969         much broader category (anything conforming to "public.content"), since files are not exposed explicitly as
1970         "promise" or "file" types in the list of registered UTIs. This caused us to always bail in
1971         DataTransfer.getData() on drop on iOS, since we will always believe there's a file on the pasteboard if there's
1972         anything conforming to "public.content" at all.
1973
1974         To fix this and simplify the code at the same time, we simply replace the currently implementation of
1975         DragData::containsFiles to return true iff the number of files is nonzero. On Mac, DragData::numberOfFiles
1976         checks the same UTIs as DragData::containsFiles (NSFilesPromisePboardType and NSFilenamesPboardType), but
1977         additionally counts the number of file URLs corresponding to those UTIs.
1978
1979         On iOS, the implementation of numberOfFiles is new to iOS 11, and relevant only in the drag and drop flow.
1980         Previously, we would consider an item provider to "contain" a file if it had a UTI conforming to one of the UTIs
1981         acceptable for drag and drop (at the time of writing, these are ["public.content", "public.zip",
1982         "public.folder"]). With this patch, anything conforming to these UTIs will continue to be represented as files,
1983         but importantly, if an item provider indicates that it should be represented inline (i.e. a plain text
1984         selection), then we don't consider that item provider as vending a file. This allows us to distinguish between
1985         cases where we are dragging a plain text selection over a file input, and when we are dragging a plain text file.
1986         In both cases, "public.plain-text" is offered as a registered UTI, but in the former, the item provider should
1987         indicate that inline presentation style is preferred. Refer to <rdar://problem/32202542> for more details.
1988
1989 2017-09-12  Joseph Pecoraro  <pecoraro@apple.com>
1990
1991         QualifiedName::init should assume AtomicStrings::init was already called
1992         https://bugs.webkit.org/show_bug.cgi?id=176639
1993
1994         Reviewed by Sam Weinig.
1995
1996         * dom/QualifiedName.cpp:
1997         (WebCore::QualifiedName::init):
1998         All callers of QualifiedName::init precede it with their own call to
1999         AtomicString::init, so QualifiedName doesn't need to do it.
2000
2001 2017-09-12  Myles C. Maxfield  <mmaxfield@apple.com>
2002
2003         Unskip fast/text/system-font-synthetic-italic.html
2004         https://bugs.webkit.org/show_bug.cgi?id=175944
2005         <rdar://problem/32864306>
2006
2007         Reviewed by Jon Lee.
2008
2009         Our buildbots now all have this symbol.
2010
2011         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
2012         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
2013
2014 2017-09-12  Myles C. Maxfield  <mmaxfield@apple.com>
2015
2016         ASSERTION FAILED: !m_valueOrException under FontFaceSet::completedLoading loading a Serious Eats page
2017         https://bugs.webkit.org/show_bug.cgi?id=175899
2018
2019         Reviewed by Tim Horton.
2020
2021         Slight style update to r221835. Also adds a test.
2022
2023         Test: fast/text/document-fonts-while-loading-crash.html
2024
2025         * css/CSSFontFaceSet.h:
2026         * css/FontFaceSet.cpp:
2027         (WebCore::FontFaceSet::FontFaceSet):
2028
2029 2017-09-12  Myles C. Maxfield  <mmaxfield@apple.com>
2030
2031         Inline ParserUtilities.h
2032         https://bugs.webkit.org/show_bug.cgi?id=176572
2033
2034         Reviewed by Darin Adler.
2035
2036         Its contents are only ever used from SVG files which also include SVGParserUtilities.h.
2037
2038         No new tests because there is no behavior change.
2039
2040         * WebCore.xcodeproj/project.pbxproj:
2041         * platform/text/ParserUtilities.h: Removed.
2042         * svg/SVGParserUtilities.h:
2043         (WebCore::skipString):
2044
2045 2017-09-12  Ryosuke Niwa  <rniwa@webkit.org>
2046
2047         Dragging & dropping a file creates an attachment element even when it's disabled
2048         https://bugs.webkit.org/show_bug.cgi?id=176769
2049
2050         Reviewed by Tim Horton.
2051
2052         The bug that dropping a file always created an attachment element even when it's disabled by settings
2053         was caused by WebContentReader::readFilenames always creating an attachment element. Fixed this by
2054         checking the runtime flag. The fix is tested by drag-files-to-editable-element-as-URLs.html
2055
2056         To fix the bug that HTMLAttachmentElement is always exposed on the global object even when it's disabled
2057         by settings, replaced the setting to enable attachment element by an equivalent runtime enabled flag,
2058         and hid both the interface as well as the element behind it. Fixed various bugs in our code generator
2059         to make this work.
2060
2061         Tests: editing/pasteboard/drag-files-to-editable-element-as-URLs.html
2062                editing/pasteboard/drag-files-to-editable-element-as-attachment.html
2063
2064         * bindings/js/WebCoreBuiltinNames.h: Added symbols used in the generated code.
2065         * dom/make_event_factory.pl:
2066         (defaultItemFactory): Replaced "runtimeConditonal" option by "runtimeEnabled".
2067         (generateImplementation):
2068         * dom/make_names.pl:
2069         (defaultTagPropertyHash):
2070         (printConstructorInterior): Return a HTMLUnknownElement if the element is disabled by a runtime flag.
2071         (printTypeHelpers): Make is<HTMLAttachmentElement>(~) returns false when the feature is disabled by
2072         checking whether the given element is an instance of HTMLUnknownElement.
2073         (printWrapperFunctions): Simplified this code by matching the code for settingsConditional.
2074         * editing/mac/EditorMac.mm:
2075         (WebCore::Editor::WebContentReader::readFilenames): Fixed the bug that this code was always creating
2076         an attachment element even when the feature is disabled.
2077         * html/HTMLAttachmentElement.idl: Hide this behind a runtime flag.
2078         * html/HTMLTagNames.in: 
2079         * page/RuntimeEnabledFeatures.h:
2080         (WebCore::RuntimeEnabledFeatures::setAttachmentElementEnabled): Added.
2081         (WebCore::RuntimeEnabledFeatures::attachmentElementEnabled const): Added.
2082         * page/Settings.in: Removed attachmentElementEnabled.
2083
2084 2017-09-12  Youenn Fablet  <youenn@apple.com>
2085
2086         Introduce a RecordData for Cache to efficiently check whether it matches a corresponding request or not
2087         https://bugs.webkit.org/show_bug.cgi?id=176579
2088
2089         Reviewed by Alex Christensen.
2090
2091         No change of behavior.
2092
2093         Introducing another version of queryCacheMatch used for the NetworkProcess implementation of the Cache.
2094         Exporting the copy of a response body to be used also there.
2095
2096         * Modules/cache/DOMCacheEngine.cpp:
2097         (WebCore::DOMCacheEngine::matchURLs):
2098         (WebCore::DOMCacheEngine::queryCacheMatch):
2099         (WebCore::DOMCacheEngine::copyResponseBody):
2100         * Modules/cache/DOMCacheEngine.h:
2101
2102 2017-09-12  Antti Koivisto  <antti@apple.com>
2103
2104         AnimationBase should point to Element instead of RenderElement
2105         https://bugs.webkit.org/show_bug.cgi?id=176807
2106
2107         Reviewed by Andreas Kling.
2108
2109         This is a step towards making animation system operate on elements and styles instead renderers.
2110
2111         No functional changes.
2112
2113         * page/animation/AnimationBase.cpp:
2114         (WebCore::AnimationBase::AnimationBase):
2115         (WebCore::AnimationBase::renderer const):
2116         (WebCore::AnimationBase::compositedRenderer const):
2117         (WebCore::AnimationBase::updateStateMachine):
2118         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
2119         (WebCore::AnimationBase::timeToNextService):
2120         (WebCore::AnimationBase::freezeAtTime):
2121         (WebCore::AnimationBase::getElapsedTime const):
2122         * page/animation/AnimationBase.h:
2123         (WebCore::AnimationBase::clear):
2124         (WebCore::AnimationBase::renderer const): Deleted.
2125         * page/animation/ImplicitAnimation.cpp:
2126         (WebCore::ImplicitAnimation::shouldSendEventForListener const):
2127         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation const):
2128         (WebCore::ImplicitAnimation::startAnimation):
2129         (WebCore::ImplicitAnimation::pauseAnimation):
2130         (WebCore::ImplicitAnimation::endAnimation):
2131         (WebCore::ImplicitAnimation::sendTransitionEvent):
2132         (WebCore::ImplicitAnimation::reset):
2133         * page/animation/KeyframeAnimation.cpp:
2134         (WebCore::KeyframeAnimation::getAnimatedStyle):
2135         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation const):
2136         (WebCore::KeyframeAnimation::startAnimation):
2137         (WebCore::KeyframeAnimation::pauseAnimation):
2138         (WebCore::KeyframeAnimation::endAnimation):
2139         (WebCore::KeyframeAnimation::shouldSendEventForListener const):
2140         (WebCore::KeyframeAnimation::sendAnimationEvent):
2141         (WebCore::KeyframeAnimation::resolveKeyframeStyles):
2142
2143 2017-09-12  Per Arne Vollan  <pvollan@apple.com>
2144
2145         [Win] Add Modules/fetch to list of forwarding headers folders.
2146         https://bugs.webkit.org/show_bug.cgi?id=176747
2147
2148         Reviewed by Brent Fulgham.
2149
2150         * PlatformWin.cmake:
2151
2152 2017-09-12  Jer Noble  <jer.noble@apple.com>
2153
2154         [MSE] Don't increase the reported totalFrameDelay for non-displayed frames (or frames coming in while paused).
2155         https://bugs.webkit.org/show_bug.cgi?id=175900
2156
2157         Reviewed by Eric Carlson.
2158
2159         When seeking to a specific time, the decompression session necessarily needs to be fed samples from before that
2160         time (i.e., all samples from the previous I-frame forward). These shouldn't contribute to the "total frame
2161         delay" metric. Neither should samples delivered when the video is paused (like, during seeking), as a frame can't
2162         be "late" if time is not moving forward.
2163
2164         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2165         (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
2166         * platform/cf/CoreMediaSoftLink.cpp:
2167         * platform/cf/CoreMediaSoftLink.h:
2168
2169 2017-09-12  Sam Weinig  <sam@webkit.org>
2170
2171         Gtk build fix for "Finish off the FormData implementation" - https://bugs.webkit.org/show_bug.cgi?id=176659
2172
2173         * fileapi/Blob.cpp:
2174         (WebCore::Blob::Blob):
2175         * fileapi/Blob.h:
2176         * fileapi/File.cpp:
2177         (WebCore::File::File):
2178         
2179             Replace copy constructor with a tagged constructor.
2180
2181 2017-09-12  Dean Jackson  <dino@apple.com>
2182
2183         [WebGL] VideoTextureCopierCV doesn't correctly restore vertex attribute state
2184         https://bugs.webkit.org/show_bug.cgi?id=176771
2185         <rdar://problem/34386621>
2186
2187         Reviewed by Antoine Quint.
2188
2189         The OpenGL context in VideoTextureCopierCV wasn't being restored to
2190         the state it had before rendering a video to a texture. Specifically
2191         the vertex attribute values were never recorded by the state saver.
2192
2193         Update the existing test of VideoTextureCopierCV so that it is
2194         explicitly doing something different from the WebCore code, which
2195         means that state will have to be correctly restored for the test
2196         to pass.
2197
2198         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2199         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Make sure
2200         to record the vertex attribute state once we know the location of the position attribute.
2201         (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver):
2202         (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
2203         (WebCore::VideoTextureCopierCV::GC3DStateSaver::saveVertexAttribState): Save all the
2204         applicable vertex attribute state information.
2205         * platform/graphics/cv/VideoTextureCopierCV.h: GC3DStateSaver can use a reference
2206         to the GC3D rather than a pointer.
2207
2208 2017-09-12  Dean Jackson  <dino@apple.com>
2209
2210         [WebGL] accelerated texImage2D for video doesn't respect flipY
2211         https://bugs.webkit.org/show_bug.cgi?id=176491
2212         <rdar://problem/33833511>
2213
2214         Reviewed by Jer Noble.
2215
2216         (Take 2 - this was rolled out due to a test failure, but the following
2217         commit will fix that)
2218
2219         Previously, if UNPACK_FLIP_Y_WEBGL was set to true, we'd either fall
2220         back to software or fail to upload texture data. Fix this by intercepting
2221         the texImage2D call, checking the orientation of the video, and running
2222         a small shader program to flip it if necessary.
2223
2224         While there, implement UNPACK_PREMULTIPLY_ALPHA_WEBGL as well, although
2225         none of our media decoders support video with alpha, so unfortunately
2226         this will have no visible change.
2227
2228         Tests: fast/canvas/webgl/texImage2D-video-flipY-false.html
2229                fast/canvas/webgl/texImage2D-video-flipY-true.html
2230
2231         * platform/cocoa/CoreVideoSoftLink.cpp: Add link to CVOpenGL(ES)TextureGetCleanTexCoords,
2232         which is used to check the orientation of the source video.
2233         * platform/cocoa/CoreVideoSoftLink.h:
2234
2235         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2236         (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture): We can
2237         now handle flipped or premultiplied requests.
2238         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2239         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::copyVideoTextureToPlatformTexture): Ditto.
2240
2241         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2242         (WebCore::VideoTextureCopierCV::VideoTextureCopierCV): Rename readFramebuffer to
2243         simply framebuffer.
2244         (WebCore::VideoTextureCopierCV::~VideoTextureCopierCV): Delete the program and buffer
2245         if they were created.
2246         (WebCore::VideoTextureCopierCV::initializeContextObjects): Sets up the shader program
2247         and the vertex buffer for drawing. Also records the location of the uniforms.
2248         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Create a new
2249         framebuffer object, and render the video texture into that framebuffer using a
2250         shader that can flip the coordinates.
2251         (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver): Helper to restore
2252         the state of the user's GraphicsContext3D while we're intercepting calls.
2253         (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
2254         * platform/graphics/cv/VideoTextureCopierCV.h:
2255
2256         * platform/graphics/GraphicsContext3D.h: Add two new entry points, for direct shader
2257         compilation and attribute access. This avoids going through ANGLE.
2258         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2259         (WebCore::GraphicsContext3D::compileShader):
2260         (WebCore::GraphicsContext3D::compileShaderDirect):
2261         (WebCore::GraphicsContext3D::getAttribLocationDirect):
2262
2263 2017-09-12  Manuel Rego Casasnovas  <rego@igalia.com>
2264
2265         [css-grid] Stretching auto tracks should be done as part of the track sizing algorithm
2266         https://bugs.webkit.org/show_bug.cgi?id=176783
2267
2268         Reviewed by Sergio Villar Senin.
2269
2270         CSS WG has agreed to modify the track sizing algorithm to include
2271         a new step: https://drafts.csswg.org/css-grid/#algo-stretch
2272         We used to do the stretch of the "auto" tracks at the end of
2273         the track sizing algorithm, however this change integrates it
2274         into the algorithm itself as the last step.
2275         See: https://github.com/w3c/csswg-drafts/issues/1150
2276
2277         The patch moves the method
2278         RenderGrid::applyStretchAlignmentToTracksIfNeeded() to
2279         GridTrackSizingAlgorithm::stretchAutoTracks().
2280         And then modifies the grid track sizing algorithm to execute
2281         the new step.
2282
2283         This patch uses the WPT test updated to check the new behavior.
2284
2285         * rendering/GridTrackSizingAlgorithm.cpp:
2286         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes): Initialize
2287         the list of auto tracks.
2288         (WebCore::GridTrackSizingAlgorithm::stretchFlexibleTracks): Add
2289         early return if there are not flexible tracks.
2290         (WebCore::GridTrackSizingAlgorithm::stretchAutoTracks): Code moved from
2291         RenderGrid::applyStretchAlignmentToTracksIfNeeded().
2292         (WebCore::GridTrackSizingAlgorithm::setup): Reset list of auto tracks.
2293         (WebCore::GridTrackSizingAlgorithm::run): Add new step
2294         stretchAutoTracks().
2295         (WebCore::GridTrackSizingAlgorithm::reset): Reset auto tracks.
2296         * rendering/GridTrackSizingAlgorithm.h: Add m_autoSizedTracksIndex.
2297         * rendering/RenderGrid.cpp:
2298         (WebCore::RenderGrid::layoutBlock): Avoid applying stretch here.
2299         (WebCore::RenderGrid::contentAlignmentNormalBehaviorGrid): Make public.
2300         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded): Moved to
2301         GridTrackSizingAlgorithm::stretchAutoTracks().
2302         * rendering/RenderGrid.h:
2303
2304 2017-09-12  Eric Carlson  <eric.carlson@apple.com>
2305
2306         Switch MediaPlayerPrivateAVFoundation to release logging
2307         https://bugs.webkit.org/show_bug.cgi?id=176621
2308         <rdar://problem/34335311>
2309
2310         Reviewed by Jer Noble.
2311
2312         * html/HTMLMediaElement.h:
2313         * platform/graphics/MediaPlayer.cpp:
2314         (WebCore::nullLogger):
2315         (WebCore::MediaPlayer::mediaPlayerLogger):
2316         * platform/graphics/MediaPlayer.h:
2317         (WebCore::MediaPlayerClient::mediaPlayerLogIdentifier):
2318         (WebCore::MediaPlayerClient::mediaPlayerLogger):
2319         (WebCore::MediaPlayer::mediaPlayerLogIdentifier):
2320         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2321         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
2322         (WebCore::MediaPlayerPrivateAVFoundation::~MediaPlayerPrivateAVFoundation):
2323         (WebCore::MediaPlayerPrivateAVFoundation::setUpVideoRendering):
2324         (WebCore::MediaPlayerPrivateAVFoundation::tearDownVideoRendering):
2325         (WebCore::MediaPlayerPrivateAVFoundation::load):
2326         (WebCore::MediaPlayerPrivateAVFoundation::playabilityKnown):
2327         (WebCore::MediaPlayerPrivateAVFoundation::prepareToPlay):
2328         (WebCore::MediaPlayerPrivateAVFoundation::play):
2329         (WebCore::MediaPlayerPrivateAVFoundation::pause):
2330         (WebCore::MediaPlayerPrivateAVFoundation::durationMediaTime const):
2331         (WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance):
2332         (WebCore::MediaPlayerPrivateAVFoundation::setNaturalSize):
2333         (WebCore::MediaPlayerPrivateAVFoundation::maxMediaTimeSeekable const):
2334         (WebCore::MediaPlayerPrivateAVFoundation::minMediaTimeSeekable const):
2335         (WebCore::MediaPlayerPrivateAVFoundation::updateStates):
2336         (WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
2337         (WebCore::MediaPlayerPrivateAVFoundation::timeChanged):
2338         (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted):
2339         (WebCore::MediaPlayerPrivateAVFoundation::invalidateCachedDuration):
2340         (WebCore::MediaPlayerPrivateAVFoundation::setPreload):
2341         (WebCore::MediaPlayerPrivateAVFoundation::mainThreadCallback):
2342         (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
2343         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
2344         (WebCore::MediaPlayerPrivateAVFoundation::processNewAndRemovedTextTracks):
2345         (WebCore::MediaPlayerPrivateAVFoundation::logChannel const):
2346         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2347         (WebCore::MediaPlayerPrivateAVFoundation::logClassName const):
2348         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2349         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2350         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
2351         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
2352         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
2353         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
2354         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyImageGenerator):
2355         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
2356         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):
2357         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
2358         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
2359         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
2360         (WebCore::MediaPlayerPrivateAVFoundationObjC::checkPlayability):
2361         (WebCore::MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata):
2362         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMedia const):
2363         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPlay):
2364         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPause):
2365         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformDuration const):
2366         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
2367         (WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted):
2368         (WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible):
2369         (WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus const):
2370         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator):
2371         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
2372         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes):
2373         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
2374         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
2375         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
2376         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
2377         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoOutput):
2378         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
2379         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
2380         (WebCore::MediaPlayerPrivateAVFoundationObjC::createOpenGLVideoOutput):
2381         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyOpenGLVideoOutput):
2382         (WebCore::MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange):
2383         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
2384         (WebCore::MediaPlayerPrivateAVFoundationObjC::flushCues):
2385         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
2386         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
2387         (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const):
2388         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName const):
2389         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled const):
2390         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled):
2391         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
2392         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
2393         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData):
2394         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
2395         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2396         (WebCore::boolString): Deleted.
2397
2398 2017-09-12  Daniel Bates  <dabates@apple.com>
2399
2400         REGRESSION (r215784): The title of right-to-left pages are empty
2401         https://bugs.webkit.org/show_bug.cgi?id=176746
2402         <rdar://problem/34211419>
2403
2404         Reviewed by Brent Fulgham.
2405
2406         Left truncate a long right-to-left title.
2407
2408         Right-to-left text represents the visual ordering of text. Internally WebKit stores
2409         right-to-left text identically to left-to-right text in memory. So, we can use the
2410         same string operation to truncate right-to-left text as we do to truncate left-to-right
2411         text.
2412
2413         * platform/text/StringWithDirection.h:
2414         (WebCore::truncateFromEnd):
2415
2416 2017-09-12  Chris Fleizach  <cfleizach@apple.com>
2417
2418         AX: On generic container elements, WebKit should distinguish between tooltip (e.g. @title) and label (e.g. @aria-label) attributes
2419         https://bugs.webkit.org/show_bug.cgi?id=170475
2420         <rdar://problem/31439222>
2421
2422         Reviewed by Joanmarie Diggs.
2423
2424         Test: accessibility/title-tag-on-unimportant-elements-is-help-text.html
2425
2426         * accessibility/AccessibilityNodeObject.cpp:
2427         (WebCore::AccessibilityNodeObject::helpText):
2428         (WebCore::AccessibilityNodeObject::accessibilityDescription):
2429         (WebCore::AccessibilityNodeObject::roleIgnoresTitle):
2430         * accessibility/AccessibilityNodeObject.h:
2431
2432 2017-09-12  Brent Fulgham  <bfulgham@apple.com>
2433
2434         Show punycode to user if a URL mixes Armenian Seh or Vo with other scripts
2435         https://bugs.webkit.org/show_bug.cgi?id=176578
2436         <rdar://problem/33906231>
2437
2438         Reviewed by Alex Christensen.
2439
2440         Revise our "lookalike character" logic to include the Armenian Vo and Seh
2441         characters, which can be mistaken for 'n' and 'v' when displayed in
2442         certain fonts.
2443
2444         Tested by new API tests.
2445
2446         * platform/mac/WebCoreNSURLExtras.mm:
2447         (WebCore::isArmenianLookalikeCharacter): Added utility function.
2448         (WebCore::isArmenianScriptCharacter): Ditto.
2449         (WebCore::isLookalikeCharacter): Handle Armenian-lookalike cases.
2450
2451 2017-09-12  Antti Koivisto  <antti@apple.com>
2452
2453         Remove RenderElement::isCSSAnimating boolean
2454         https://bugs.webkit.org/show_bug.cgi?id=176779
2455
2456         Reviewed by Andreas Kling.
2457
2458         This optimization can be replaced with a simple style test that doesn't require keeping
2459         two sources of truth in sync.
2460
2461         * page/animation/CSSAnimationController.cpp:
2462         (WebCore::CSSAnimationControllerPrivate::ensureCompositeAnimation):
2463         (WebCore::CSSAnimationControllerPrivate::clear):
2464
2465             Can't test here as style might have become non-animating and we don't clear animation when that happens.
2466             This is only called on renderer destruction so it is not an important optimization.
2467
2468         (WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer const):
2469         (WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer const):
2470         (WebCore::CSSAnimationControllerPrivate::getAnimatedStyleForRenderer):
2471         (WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation const):
2472         (WebCore::CSSAnimationController::cancelAnimations):
2473         (WebCore::CSSAnimationController::getAnimatedStyleForRenderer):
2474         (WebCore::CSSAnimationController::computeExtentOfAnimation const):
2475         (WebCore::CSSAnimationController::isRunningAnimationOnRenderer const):
2476         (WebCore::CSSAnimationController::isRunningAcceleratedAnimationOnRenderer const):
2477
2478             Test if the style has any animations. This is roughly equivalent of the old test.
2479             (it is actually somewhat better as the boolean was never cleared on style changes)
2480
2481         * rendering/RenderElement.cpp:
2482         (WebCore::RenderElement::RenderElement):
2483         * rendering/RenderElement.h:
2484         (WebCore::RenderElement::isCSSAnimating const): Deleted.
2485         (WebCore::RenderElement::setIsCSSAnimating): Deleted.
2486         * rendering/style/RenderStyle.h:
2487         (WebCore::RenderStyle::hasAnimationsOrTransitions const):
2488
2489 2017-09-12  Ms2ger  <Ms2ger@igalia.com>
2490
2491         Disallow passing null data to uniform1uiv() and friends.
2492         https://bugs.webkit.org/show_bug.cgi?id=176777
2493
2494         Reviewed by Sam Weinig.
2495
2496         This matches the specification as well as Gecko and Chromium.
2497
2498         Test: fast/canvas/webgl/webgl2/bindings.html
2499
2500         * html/canvas/WebGL2RenderingContext.idl:
2501
2502 2017-09-12  Sam Weinig  <sam@webkit.org>
2503
2504         [Cleanup] Follow up cleanup for DOMFormData implementation
2505         https://bugs.webkit.org/show_bug.cgi?id=176740
2506
2507         Reviewed by Alex Christensen.
2508
2509         - Merges FormDataList into DOMFormData.
2510         - Streamline / refactor FormData creation from DOMFormData.
2511
2512         * CMakeLists.txt:
2513         * WebCore.xcodeproj/project.pbxproj:
2514         * html/FormDataList.cpp: Removed.
2515         * html/FormDataList.h: Removed.
2516
2517             Remove FormDataList.
2518
2519         * html/DOMFormData.cpp:
2520         (WebCore::DOMFormData::DOMFormData):
2521         (WebCore::DOMFormData::createFileEntry):
2522         (WebCore::DOMFormData::append):
2523         (WebCore::DOMFormData::set):
2524         (WebCore::DOMFormData::Iterator::next):
2525         * html/DOMFormData.h:
2526         (WebCore::DOMFormData::items const):
2527         (WebCore::DOMFormData::encoding const):
2528
2529             Merge FormDataList into DOMFormData. FormDataList's additional
2530             appendData/appendBlob functions have been removed, and their
2531             functionality inlined into DOMFormData's append functions. 
2532
2533             Adopted makeKeyValuePair in DOMFormData::Iterator::next().
2534
2535         * platform/network/FormData.cpp:
2536         (WebCore::FormData::create):
2537         (WebCore::FormData::createMultiPart):
2538         (WebCore::normalizeStringData):
2539         (WebCore::FormData::appendMultiPartFileValue):
2540         (WebCore::FormData::appendMultiPartStringValue):
2541         (WebCore::FormData::appendMultiPartKeyValuePairItems):
2542         (WebCore::FormData::appendNonMultiPartKeyValuePairItems):
2543         (WebCore::FormData::appendKeyValuePairItems): Deleted.
2544         * platform/network/FormData.h:
2545
2546             Split-up appendKeyValuePairItems into separate multipart and non-multipart
2547             functions, as the two edges of the branch didn't share much in common. Further
2548             split out multipart file and multipart string appending, since they too did not
2549             share that much in common and makes the code easier to follow. 
2550
2551             String value normalization has been moved entirely here (previously it was a member 
2552             function of FormDataList) as FormData is the only user.
2553
2554         * xml/XMLHttpRequest.cpp:
2555         (WebCore::XMLHttpRequest::send):
2556         * loader/FormSubmission.cpp:
2557         (WebCore::FormSubmission::create):
2558         * Modules/fetch/FetchBody.cpp:
2559         (WebCore::FetchBody::extract):
2560         
2561             Update for new FormData create functions which don't need the
2562             encoding passed explicitly, since it is part of the DOMFormData.
2563         
2564         * html/BaseButtonInputType.cpp:
2565         * html/BaseButtonInputType.h:
2566         * html/BaseCheckableInputType.cpp:
2567         * html/BaseCheckableInputType.h:
2568         * html/FileInputType.cpp:
2569         * html/FileInputType.h:
2570         * html/FormAssociatedElement.h:
2571         * html/HTMLButtonElement.cpp:
2572         * html/HTMLButtonElement.h:
2573         * html/HTMLFormControlElement.h:
2574         * html/HTMLInputElement.cpp:
2575         * html/HTMLInputElement.h:
2576         * html/HTMLKeygenElement.cpp:
2577         * html/HTMLKeygenElement.h:
2578         * html/HTMLMeterElement.cpp:
2579         * html/HTMLObjectElement.cpp:
2580         * html/HTMLObjectElement.h:
2581         * html/HTMLSelectElement.cpp:
2582         * html/HTMLSelectElement.h:
2583         * html/HTMLTextAreaElement.cpp:
2584         * html/HTMLTextAreaElement.h:
2585         * html/HiddenInputType.cpp:
2586         * html/HiddenInputType.h:
2587         * html/ImageInputType.cpp:
2588         * html/ImageInputType.h:
2589         * html/InputType.cpp:
2590         * html/InputType.h:
2591         * html/SubmitInputType.cpp:
2592         * html/SubmitInputType.h:
2593         * html/TextFieldInputType.cpp:
2594         * html/TextFieldInputType.h:
2595
2596             Update to use DOMFormData directly, rather than the FormDataList, which 
2597             has been removed.
2598
2599         * page/csp/ContentSecurityPolicy.cpp:
2600
2601             Remove unnecessary #include of unused (and now removed) FormDataList.h
2602
2603 2017-09-12  Zan Dobersek  <zdobersek@igalia.com>
2604
2605         [EME] Implement CDMInstanceClearKey::requestLicense()
2606         https://bugs.webkit.org/show_bug.cgi?id=176773
2607
2608         Reviewed by Xabier Rodriguez-Calvar.
2609
2610         Implement the requestLicense() method for CDMInstanceClearKey. Per
2611         the specification, the session ID must be a 32-bit numerical value.
2612         A session ID value counter is thus kept in a static uint32_ object
2613         and incremented upon each call of requestLicense(). Init data and
2614         the session ID value are then embedded in the asynchronous dispatch
2615         that invokes the callback. That invocation now also passes along the
2616         init data, the session ID in string format, and Succeeded to now
2617         indicate the operation was completed successfully.
2618
2619         No new tests -- expectations for the relevant tests are updated
2620         to reflect the introduced changes.
2621
2622         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
2623         (WebCore::CDMInstanceClearKey::requestLicense):
2624
2625 2017-09-12  Manuel Rego Casasnovas  <rego@igalia.com>
2626
2627         [css-grid] Use transferred size over content size for automatic minimum size
2628         https://bugs.webkit.org/show_bug.cgi?id=176688
2629
2630         Reviewed by Sergio Villar Senin.
2631
2632         CSS WG has agreed to modify the spec so now the transferred size is used
2633         (if it exists) independently if it's bigger or smaller
2634         than the content size.
2635         See: https://github.com/w3c/csswg-drafts/issues/1149
2636
2637         The spec text (https://drafts.csswg.org/css-grid/#min-size-auto):
2638           "The automatic minimum size for a grid item in a given dimension is
2639            its specified size if it exists, otherwise its transferred size
2640            if that exists, else its content size"
2641
2642         This patch use the WPT tests updated to check the new behavior.
2643
2644         * rendering/GridTrackSizingAlgorithm.cpp:
2645         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
2646         Modified so it always returns the transferred size (if any).
2647
2648 2017-09-12  Fujii Hironori  <Hironori.Fujii@sony.com>
2649
2650         [Freetype] Doesn't support coloured fonts
2651         https://bugs.webkit.org/show_bug.cgi?id=156579
2652
2653         Reviewed by Michael Catanzaro.
2654
2655         Covered by existing tests. This needs a large rebaseline that will be done in follow up commits.
2656
2657         * platform/graphics/FontCascade.h: Enable advance text rendering mode by default.
2658         (WebCore::FontCascade::advancedTextRenderingMode const):
2659         (WebCore::FontCascade::computeRequiresShaping const):
2660         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2661         (WebCore::Font::platformInit): Do not get metrics from OS/2 table for non-scalable fonts.
2662         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
2663         (WebCore::harfBuzzGetGlyph): Use U8_APPEND_UNSAFE() instead of converting to a String and then encoding it with
2664         UTF8Encoding().
2665
2666 2017-09-12  Frederic Wang  <fwang@igalia.com>
2667
2668         Remove unnecessary virtual keyword from JS test files
2669         https://bugs.webkit.org/show_bug.cgi?id=176683
2670
2671         Reviewed by Simon Fraser.
2672
2673         JS bindings headers do not comply with the WebKit coding style since they use both the
2674         "virtual" and "override" keywords. This patch modifies the generator script to only use
2675         "override" and regenerates the bindings accordingly.
2676
2677         No new tests, behavior unchanged.
2678
2679         * bindings/scripts/CodeGeneratorJS.pm:
2680         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
2681         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.h:
2682         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h:
2683         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h:
2684         * bindings/scripts/test/JS/JSTestCallbackInterface.h:
2685         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.h:
2686
2687 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2688
2689         [iOS DnD] Support DataTransfer.setDragImage when starting a drag on iOS
2690         https://bugs.webkit.org/show_bug.cgi?id=176721
2691         <rdar://problem/34373660>
2692
2693         Reviewed by Tim Horton.
2694
2695         Adds support for setting the drag lift preview frame in the case where DataTransfer.setDragImage is being used
2696         to override the default drag preview. Currently, the frame of the drag preview we supply in this case is the
2697         same as the bounds of the source element in root view coordinates, but this means that any custom drag image
2698         the page supplies will be stretched to fill the frame of the source element. Instead, when handling a DHTML drag,
2699         position the lift and cancel drag previews relative to the event location, respecting any drag offset specified
2700         in setDragImage. The size of this preview matches the size of the drag image source (since this is all in root
2701         view coordinates, this means the drag preview will also enlarge if the user pinches to zoom in). If a
2702         disconnected image source element was provided, then we just fall back to the image size.
2703
2704         Additionally, renames DragItem's elementBounds to dragPreviewFrameInRootViewCoordinates to better reflect the
2705         purpose of this variable. This patch also introduces API test plumbing to grab targeted drag previews from the
2706         drag interaction delegate (i.e. WKContentView), and uses this in a new API test that checks the frame of the
2707         resulting UITargetedDragPreview after initiating a drag in various circumstances (see changes in Tools/ for more
2708         detail).
2709
2710         Test: DataInteractionTests.DragLiftPreviewDataTransferSetDragImage
2711
2712         * dom/DataTransfer.cpp:
2713         (WebCore::DataTransfer::dragImageElement const):
2714         * dom/DataTransfer.h:
2715         * page/DragController.cpp:
2716         (WebCore::dragLocForDHTMLDrag):
2717
2718         The logic to flip the y offset when computing the drag location is only relevant on Mac, but currently, this is
2719         guarded by #if PLATFORM(COCOA), which causes the y offset to shift the drag image in the opposite direction on
2720         iOS. To fix this, simply change the platform define to Mac.
2721
2722         (WebCore::DragController::doSystemDrag):
2723         * platform/DragItem.h:
2724         (WebCore::DragItem::encode const):
2725         (WebCore::DragItem::decode):
2726
2727 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2728
2729         [iOS WK2] Support tapping to add items to the current drag session in web content
2730         https://bugs.webkit.org/show_bug.cgi?id=176421
2731         <rdar://problem/31144674>
2732
2733         Reviewed by Tim Horton.
2734
2735         Refactors some drag initiation logic to handle starting a drag when data has already been written to the
2736         pasteboard (in the case of iOS, WebItemProviderPasteboard). See annotated comments below for more detail.
2737
2738         Tests: DataInteractionTests.AdditionalLinkAndImageIntoContentEditable
2739
2740         * page/DragActions.h:
2741         * page/DragController.cpp:
2742         (WebCore::DragController::startDrag):
2743
2744         Add a HasNonDefaultPasteboardData argument here, and replace checks for !dataTransfer.pasteboard().hasData()
2745         with checks for whether the argument is HasNonDefaultPasteboardData::No. These checks for Pasteboard::hasData()
2746         currently prevent us from overwriting custom pasteboard data, in the case that the page has written pasteboard
2747         data using the event's DataTransfer. However, in the case of adding additional drag items to the session, we
2748         will already have pasteboard data, so these checks will prevent us from writing default data to the pasteboard.
2749         See EventHandler::handleDrag for more detail.
2750
2751         * page/DragController.h:
2752         * page/DragState.h:
2753
2754         Remove the draggedContentRange member from DragState. See below.
2755
2756         * page/EventHandler.cpp:
2757         (WebCore::removeDraggedContentDocumentMarkersFromAllFramesInPage):
2758
2759         Simplify the handling of dragged content range markers. Instead of storing the DOM Range being dragged and
2760         removing/repainting the range after dragging ends, just repaint the contentRenderer of the frame being dragged.
2761         When the dragging session has completely ended, remove all dragged content ranges from the page's mainframe and
2762         all of its subframes, and repaint everything.
2763
2764         (WebCore::EventHandler::dragCancelled):
2765         (WebCore::EventHandler::didStartDrag):
2766         (WebCore::EventHandler::dragSourceEndedAt):
2767
2768         Add a MayExtendDragSession argument, indicating whether or not the web process will attempt to continue the drag
2769         session, in which case EventHandler::dragSourceEndedAt should not remove any existing dragged content range
2770         document markers.
2771
2772         (WebCore::EventHandler::dispatchDragStartEvent):
2773
2774         Helper method to dispatch a `dragstart` event, return whether or not to proceed with the drag, and also compute
2775         (as an outparam) whether or not custom pasteboard data was written during the event.
2776
2777         (WebCore::EventHandler::handleDrag):
2778
2779         If custom data was written during `dragstart`, pass along HasNonDefaultPasteboardData::Yes when calling
2780         DragController::startDrag.
2781
2782         (WebCore::repaintContentsOfRange): Deleted.
2783         * page/EventHandler.h:
2784         * page/ios/EventHandlerIOS.mm:
2785         (WebCore::EventHandler::tryToBeginDataInteractionAtPoint):
2786         * platform/Pasteboard.h:
2787         * platform/ios/PasteboardIOS.mm:
2788         (WebCore::Pasteboard::changeCount const):
2789         * platform/ios/WebItemProviderPasteboard.mm:
2790         (-[WebItemProviderPasteboard setItemProviders:]):
2791
2792         Stop clearing out the staged item provider registration list when setting item providers. After refactoring in
2793         r221595, staged registration lists are now automatically cleared out when (1) the drag-and-drop interaction
2794         state is cleared out in the UI process, or (2) when the registration list is taken by WKContentView (see
2795         -takeRegistrationList) when generating an item provider.
2796
2797         * platform/mac/PasteboardMac.mm:
2798         (WebCore::Pasteboard::changeCount const):
2799
2800         Add a changeCount method to Pasteboard on Cocoa platforms (Mac, iOS) which support changeCount natively. In
2801         theory, there's no reason Windows, GTK and WPE ports can't also implement a similar mechanism in
2802         PlatformPasteboard, but this isn't needed for anything yet. Upon dragstart, it is safe to assume that the
2803         pasteboard has been cleared on these platforms, so checking for Pasteboard::hasData (as we do for all platforms
2804         currently) is sufficient.
2805
2806 2017-09-11  Ryan Haddad  <ryanhaddad@apple.com>
2807
2808         Unreviewed, rolling out r221762.
2809
2810         This change caused flakiness in a webgl LayoutTest.
2811
2812         Reverted changeset:
2813
2814         "[WebGL] accelerated texImage2D for video doesn't respect
2815         flipY"
2816         https://bugs.webkit.org/show_bug.cgi?id=176491
2817         http://trac.webkit.org/changeset/221762
2818
2819 2017-09-11  Per Arne Vollan  <pvollan@apple.com>
2820
2821         [Win] Add Modules/cache to list of forwarding headers folders.
2822         https://bugs.webkit.org/show_bug.cgi?id=176737
2823
2824         Reviewed by Alex Christensen.
2825
2826         * PlatformWin.cmake:
2827
2828 2017-09-11  Joanmarie Diggs  <jdiggs@igalia.com>
2829
2830         AX: [ATK] aria-autocomplete not exposed on comboboxes
2831         https://bugs.webkit.org/show_bug.cgi?id=176724
2832
2833         Reviewed by Chris Fleizach.
2834
2835         Add a check to AccessibilityObject::supportsARIAAutoComplete() for
2836         combobox because isARIATextControl() returns false for that role.
2837
2838         Add new combobox test cases to existing aria-autocomplete.html test.
2839
2840         * accessibility/AccessibilityObject.cpp:
2841         (WebCore::AccessibilityObject::supportsARIAAutoComplete const):
2842
2843 2017-09-11  Ryan Haddad  <ryanhaddad@apple.com>
2844
2845         Unreviewed, rolling out r221854.
2846
2847         The test added with this change fails on 32-bit JSC bots.
2848
2849         Reverted changeset:
2850
2851         "[DFG] Optimize WeakMap::get by adding intrinsic and fixup"
2852         https://bugs.webkit.org/show_bug.cgi?id=176010
2853         http://trac.webkit.org/changeset/221854
2854
2855 2017-09-11  Dean Jackson  <dino@apple.com>
2856
2857         [WebGL macOS] No need to multisample when blitting into WebGLLayer
2858         https://bugs.webkit.org/show_bug.cgi?id=176666
2859         <rdar://problem/27774626>
2860
2861         Reviewed by Sam Weinig.
2862
2863         We were seeing performance profiles suggesting WebGL was
2864         doing 8x MSAA, even though we explicitly set it to only
2865         use 4 samples in the GLPixelFormatObj used to create
2866         the WebGL CGLContextObj. However, that same CGLPixelFormatObj
2867         was also used for the WebGLLayer's CGLContextObj, meaning the
2868         blit of the WebGL FBO into the WebGLLayer's backing store was
2869         multisampling as well -- so an extra 4 samples on top of the
2870         original 4, making it look like we were doing 8x.
2871
2872         This was obviously unnecessary, since we already have the
2873         multisampled FBO and just want to copy it, as is, into the layer.
2874
2875         Now, instead of copying the CGLPixelFormatObj, we create
2876         a new one and copy most of the attributes, leaving out
2877         the multisample flags (and the depth buffer, since we're
2878         only doing 2d blits).
2879
2880         Covered by existing WebGL tests, since there should be no
2881         visible change.
2882
2883         * platform/graphics/cocoa/WebGLLayer.mm:
2884         (-[WebGLLayer copyCGLPixelFormatForDisplayMask:]): Create a new
2885         CGLPixelFormatObj that copies most of the values from
2886         the corresponding object on the WebGL's backing CGLContextObj.
2887
2888 2017-09-11  Zan Dobersek  <zdobersek@igalia.com>
2889
2890         [EME] ClearKey: implement CDMInstanceClearKey state modifiers, callback dispatches
2891         https://bugs.webkit.org/show_bug.cgi?id=176687
2892
2893         Reviewed by Xabier Rodriguez-Calvar.
2894
2895         Implement the state modification methods on the CDMInstanceClearKey class.
2896         Initialization method is a no-op, but returns Succeeded. Distinctive
2897         identifier and persistent state setters return Succeeded if the passed-in
2898         value is false. setServerCertificate() still returns Failed due to server
2899         certificates not being supported in this ClearKey implementation.
2900
2901         The license and session operation methods are also implemented, but for
2902         now the implementations simply schedule a main thread dispatch that
2903         invokes the callback with failure-indicating values. This avoids various
2904         tests timing out, instead preferring that the tests for now fail with an
2905         exception (in most cases NotSupportedError).
2906
2907         No new tests -- relevant tests have baselines updated.
2908
2909         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
2910         (WebCore::CDMInstanceClearKey::CDMInstanceClearKey):
2911         (WebCore::CDMInstanceClearKey::initializeWithConfiguration):
2912         (WebCore::CDMInstanceClearKey::setDistinctiveIdentifiersAllowed):
2913         (WebCore::CDMInstanceClearKey::setPersistentStateAllowed):
2914         (WebCore::CDMInstanceClearKey::setServerCertificate):
2915         (WebCore::CDMInstanceClearKey::requestLicense):
2916         (WebCore::CDMInstanceClearKey::updateLicense):
2917         (WebCore::CDMInstanceClearKey::loadSession):
2918         (WebCore::CDMInstanceClearKey::closeSession):
2919         (WebCore::CDMInstanceClearKey::removeSessionData):
2920         * platform/encryptedmedia/clearkey/CDMClearKey.h:
2921
2922 2017-09-11  Alex Christensen  <achristensen@webkit.org>
2923
2924         Modernize BoxExtent into RectEdges
2925         https://bugs.webkit.org/show_bug.cgi?id=176437
2926
2927         Reviewed by Simon Fraser.
2928
2929         And give it its own header.
2930         No change in behavior.
2931
2932         * WebCore.xcodeproj/project.pbxproj:
2933         * css/CSSProperty.cpp:
2934         (WebCore::resolveToPhysicalProperty):
2935         (WebCore::CSSProperty::resolveDirectionAwareProperty):
2936         * platform/LengthBox.h:
2937         (WebCore::LengthBox::LengthBox):
2938         (WebCore::BoxExtent::BoxExtent): Deleted.
2939         (WebCore::BoxExtent::at): Deleted.
2940         (WebCore::BoxExtent::top): Deleted.
2941         (WebCore::BoxExtent::right): Deleted.
2942         (WebCore::BoxExtent::bottom): Deleted.
2943         (WebCore::BoxExtent::left): Deleted.
2944         (WebCore::BoxExtent::at const): Deleted.
2945         (WebCore::BoxExtent::top const): Deleted.
2946         (WebCore::BoxExtent::right const): Deleted.
2947         (WebCore::BoxExtent::bottom const): Deleted.
2948         (WebCore::BoxExtent::left const): Deleted.
2949         (WebCore::BoxExtent::setAt): Deleted.
2950         (WebCore::BoxExtent::setTop): Deleted.
2951         (WebCore::BoxExtent::setRight): Deleted.
2952         (WebCore::BoxExtent::setBottom): Deleted.
2953         (WebCore::BoxExtent::setLeft): Deleted.
2954         (WebCore::BoxExtent::before): Deleted.
2955         (WebCore::BoxExtent::after): Deleted.
2956         (WebCore::BoxExtent::start): Deleted.
2957         (WebCore::BoxExtent::end): Deleted.
2958         (WebCore::BoxExtent::before const): Deleted.
2959         (WebCore::BoxExtent::after const): Deleted.
2960         (WebCore::BoxExtent::start const): Deleted.
2961         (WebCore::BoxExtent::end const): Deleted.
2962         (WebCore::BoxExtent::setBefore): Deleted.
2963         (WebCore::BoxExtent::setAfter): Deleted.
2964         (WebCore::BoxExtent::setStart): Deleted.
2965         (WebCore::BoxExtent::setEnd): Deleted.
2966         (WebCore::BoxExtent::operator== const): Deleted.
2967         (WebCore::BoxExtent::operator!= const): Deleted.
2968         * platform/RectEdges.h: Added.
2969         (WebCore::RectEdges::RectEdges):
2970         (WebCore::RectEdges::at):
2971         (WebCore::RectEdges::top):
2972         (WebCore::RectEdges::right):
2973         (WebCore::RectEdges::bottom):
2974         (WebCore::RectEdges::left):
2975         (WebCore::RectEdges::at const):
2976         (WebCore::RectEdges::top const):
2977         (WebCore::RectEdges::right const):
2978         (WebCore::RectEdges::bottom const):
2979         (WebCore::RectEdges::left const):
2980         (WebCore::RectEdges::setAt):
2981         (WebCore::RectEdges::setTop):
2982         (WebCore::RectEdges::setRight):
2983         (WebCore::RectEdges::setBottom):
2984         (WebCore::RectEdges::setLeft):
2985         (WebCore::RectEdges::before):
2986         (WebCore::RectEdges::after):
2987         (WebCore::RectEdges::start):
2988         (WebCore::RectEdges::end):
2989         (WebCore::RectEdges::before const):
2990         (WebCore::RectEdges::after const):
2991         (WebCore::RectEdges::start const):
2992         (WebCore::RectEdges::end const):
2993         (WebCore::RectEdges::setBefore):
2994         (WebCore::RectEdges::setAfter):
2995         (WebCore::RectEdges::setStart):
2996         (WebCore::RectEdges::setEnd):
2997         (WebCore::RectEdges::operator== const):
2998         (WebCore::RectEdges::operator!= const):
2999         * platform/graphics/ca/TileController.cpp:
3000         (WebCore::TileController::setHasMargins):
3001         * platform/graphics/ca/TileController.h:
3002         * platform/text/WritingMode.h:
3003         (WebCore::isHorizontalPhysicalSide):
3004         * rendering/style/NinePieceImage.cpp:
3005         (WebCore::NinePieceImage::isEmptyPieceRect):
3006         * rendering/style/NinePieceImage.h:
3007         (WebCore::imagePieceHorizontalSide):
3008         (WebCore::imagePieceVerticalSide):
3009         * rendering/style/RenderStyle.cpp:
3010         (WebCore::RenderStyle::getShadowInsetExtent const):
3011
3012 2017-09-11  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
3013
3014         [WinCairo] Fix the wincairo build after r221839
3015         https://bugs.webkit.org/show_bug.cgi?id=176681
3016
3017         Reviewed by Per Arne Vollan.
3018
3019         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
3020         (WebCore::ResourceHandleCurlDelegate::setupPOST):
3021
3022 2017-09-11  Andy Estes  <aestes@apple.com>
3023
3024         [Mac] Upstream QTKit-related WebKitSystemInterface functions
3025         https://bugs.webkit.org/show_bug.cgi?id=176472
3026
3027         Reviewed by Eric Carlson.
3028
3029         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3030         (WebCore::disableComponentsOnce):
3031         (WebCore::MediaPlayerPrivateQTKit::createQTMovie):
3032         (WebCore::MediaPlayerPrivateQTKit::hasClosedCaptions const):
3033         (WebCore::MediaPlayerPrivateQTKit::setClosedCaptionsVisible):
3034         (WebCore::selectPreferredAlternateTrackForMediaType):
3035         (WebCore::selectPreferredAlternates):
3036         (WebCore::MediaPlayerPrivateQTKit::updateStates):
3037         (WebCore::mimeModernTypesCache):
3038         (WebCore::MediaPlayerPrivateQTKit::originsInMediaCache):
3039         (WebCore::MediaPlayerPrivateQTKit::clearMediaCache):
3040         (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForOrigins):
3041         (WebCore::MediaPlayerPrivateQTKit::hasSingleSecurityOrigin const):
3042         (WebCore::MediaPlayerPrivateQTKit::movieLoadType const):
3043         (WebCore::MediaPlayerPrivateQTKit::canSaveMediaData const):
3044         * platform/mac/WebCoreSystemInterface.h:
3045         * platform/mac/WebCoreSystemInterface.mm:
3046         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
3047         (createMediaUIControl):
3048         (createControlWithMediaUIControlType):
3049         (createMediaUIBackgroundView):
3050         (-[WebVideoFullscreenHUDWindowController windowDidLoad]):
3051
3052 2017-09-08  Andy Estes  <aestes@apple.com>
3053
3054         Try to fix the Internal El Capitan build after r221773.
3055
3056         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3057         (WebCore::mimeModernTypesCache):
3058
3059 2017-09-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3060
3061         [WPE] Bump freetype version to 2.8.0
3062         https://bugs.webkit.org/show_bug.cgi?id=176501
3063
3064         Reviewed by Michael Catanzaro.
3065
3066         Enable back the changes done by r221670 that were disabled for WPE on r221719.
3067
3068         Covered by existing tests.
3069
3070         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
3071         (WebCore::scaledFontWithoutMetricsHinting):
3072         (WebCore::Font::platformInit):
3073
3074 2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
3075
3076         [DFG] Optimize WeakMap::get by adding intrinsic and fixup
3077         https://bugs.webkit.org/show_bug.cgi?id=176010
3078
3079         Reviewed by Filip Pizlo.
3080
3081         * platform/network/curl/CurlJobManager.cpp:
3082         (WebCore::CurlJobList::finishJobs):
3083
3084 2017-09-10  Zan Dobersek  <zdobersek@igalia.com>
3085
3086         [GStreamer] Drop libgcrypt initialization in webkit_media_clear_key_decrypt_init()
3087         https://bugs.webkit.org/show_bug.cgi?id=176656
3088
3089         Reviewed by Michael Catanzaro.
3090
3091         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
3092         (webkit_media_clear_key_decrypt_init): Don't re-initialize libgcrypt here
3093         since that's already done in the WebProcess main(), and the calls here
3094         only result in libgcrypt writing out 'Oops' warnings on stderr.
3095
3096 2017-09-10  Mark Lam  <mark.lam@apple.com>
3097
3098         Fix all ExceptionScope verification failures in JavaScriptCore.
3099         https://bugs.webkit.org/show_bug.cgi?id=176662
3100         <rdar://problem/34352085>
3101
3102         Reviewed by Filip Pizlo.
3103
3104         No new tests because this is covered by existing tests with the JSC_validateExceptionChecks=true enabled.
3105
3106         * bindings/js/JSCustomElementInterface.cpp:
3107         (WebCore::JSCustomElementInterface::tryToConstructCustomElement):
3108         * bindings/js/JSCustomElementRegistryCustom.cpp:
3109         (WebCore::whenDefinedPromise):
3110         * bindings/js/JSDOMConvertRecord.h:
3111         * bindings/js/JSDOMMapLike.cpp:
3112         (WebCore::createBackingMap):
3113         * bindings/js/JSDOMPromiseDeferred.cpp:
3114         (WebCore::DeferredPromise::callFunction):
3115         (WebCore::DeferredPromise::reject):
3116         * bindings/js/JSDOMPromiseDeferred.h:
3117         (WebCore::callPromiseFunction):
3118
3119 2017-09-10  Frederic Wang  <fwang@igalia.coml>
3120
3121         Make RenderLayerCompositor always use isRootLayer()
3122         https://bugs.webkit.org/show_bug.cgi?id=176591
3123
3124         Reviewed by Darin Adler.
3125
3126         RenderLayerCompositor contains a few comparisons of the form &layer == m_renderView.layer().
3127         This patch replaces them with "layer.isRootLayer()" which simply verifies that "layer" is
3128         associated to the one (and only one) RenderView of the RenderLayerCompositor. It makes things
3129         more readable and more consistent with the rest of the file.
3130
3131         No new tests, behavior unchanged.
3132
3133         * rendering/RenderLayerCompositor.cpp:
3134         (WebCore::RenderLayerCompositor::repaintInCompositedAncestor):
3135         (WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer const):
3136         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
3137
3138 2017-09-09  Sam Weinig  <sam@webkit.org>
3139
3140         Finish off the FormData implementation
3141         https://bugs.webkit.org/show_bug.cgi?id=176659
3142
3143         Reviewed by Darin Adler.
3144
3145         * fileapi/Blob.cpp:
3146         * fileapi/Blob.h:
3147         * fileapi/File.cpp:
3148         * fileapi/File.h:
3149
3150             Add constructors / create functions for making File objects
3151             from an existing Blob or File with an override name.
3152
3153         * html/DOMFormData.cpp:
3154         * html/DOMFormData.h:
3155
3156             Add missing operations and iterator implementation
3157             and bring append up to spec by no ignoring empty names.
3158
3159         * html/DOMFormData.idl:
3160
3161             Bring IDL up to spec. Leave its exposure to just the window for
3162             now, as FormData currently depends on the Document/Page for replace
3163             file generation and therefore cannot operate in a worker.
3164
3165         * html/FormDataList.cpp:
3166         * html/FormDataList.h:
3167
3168             Changes FormDataList::Item to a String key and Variant<RefPtr<File>, String>
3169             data, matching spec concepts more cleanly. Normalization / encoding has also
3170             been made lazy, and now does not happen until creating a FormData from the
3171             FormDataList.
3172
3173             Since we now store Files, rather than Blobs, we follow the spec's 'create an 
3174             entry' algorithm to convert Blobs into Files with the same backing bytes. This
3175             was previously done as part of FormData::appendKeyValuePairItems.
3176
3177         * html/HTMLKeygenElement.cpp:
3178         (WebCore::HTMLKeygenElement::appendFormData):
3179
3180             Remove unnecessary conversion to utf8, the data is base64 encoded, allowing
3181             us to remove an overload of appendData that took a CString.
3182
3183         * inspector/InspectorNetworkAgent.cpp:
3184         (WebCore::buildObjectForResourceRequest):
3185
3186             Update for new signature of FormData::flatten() which now
3187             returns a Vector, rather than takes one in.
3188
3189         * platform/network/FormData.h:
3190         * platform/network/FormData.cpp:
3191         (WebCore::FormData::FormData):
3192         (WebCore::FormData::create):
3193         (WebCore::FormData::createMultiPart):
3194         
3195             Cleanup redundancy by using auto.
3196         
3197         (WebCore::FormData::appendKeyValuePairItems):
3198         
3199             Updated to handle new FormDataList item format (e.g. pairs of key / data) allowing
3200             us to remove two-by-two iteration. Some complexity was removed around Blobs, as
3201             FormDataList now always creates File. 
3202
3203             Since FormDataList no longer eagerly encodes / normalizes the keys and string data
3204             values, we now perform those operations here.
3205         
3206         (WebCore::FormData::expandDataStore):
3207         (WebCore::appendBlobResolved):
3208         (WebCore::FormData::resolveBlobReferences):
3209         (WebCore::FormData::generateFiles):
3210         (WebCore::FormData::hasGeneratedFiles const):
3211         (WebCore::FormData::hasOwnedGeneratedFiles const):
3212         (WebCore::FormData::removeGeneratedFilesIfNeeded):
3213
3214             Adopt auto and modern for-in loops.
3215
3216         (WebCore::FormData::flatten const):
3217         (WebCore::FormData::flattenToString const):
3218
3219             Update flatten to return a Vector, rather than take it in.
3220
3221 2017-09-10  Darin Adler  <darin@apple.com>
3222
3223         Refactor Document::updateTitleElement to use traits instead of function pointers
3224         https://bugs.webkit.org/show_bug.cgi?id=176671
3225
3226         Reviewed by Sam Weinig.
3227
3228         This template implementation seems slightly more readable and
3229         also likely to be slightly more efficient. Also takes a suggestion
3230         from Antti of factoring out the "select a new title element" into a
3231         function, which is a natural thing to do in this version.
3232
3233         * dom/Document.cpp:
3234         (WebCore::TitleTraits<HTMLTitleElement>::isInEligibleLocation): Added.
3235         (WebCore::TitleTraits<HTMLTitleElement>::findTitleElement): Added.
3236         (WebCore::TitleTraits<SVGTitleElement>::isInEligibleLocation): Added.
3237         (WebCore::TitleTraits<SVGTitleElement>::findTitleElement): Added.
3238         (WebCore::selectNewTitleElement): Added.
3239         (WebCore::findHTMLTitle): Deleted.
3240         (WebCore::isHTMLTitle): Deleted.
3241         (WebCore::isHTMLTitleEligible): Deleted.
3242         (WebCore::findSVGTitle): Deleted.
3243         (WebCore::isSVGTitle): Deleted.
3244         (WebCore::isSVGTitleEligible): Deleted.
3245         (WebCore::Document::updateTitleElement): Call selectNewTitleElement
3246         instead of having the logic here.
3247
3248 2017-09-07  Darin Adler  <darin@apple.com>
3249
3250         Fix double resolve assertion in FontFaceSet seen while running tests
3251         https://bugs.webkit.org/show_bug.cgi?id=176525
3252
3253         Reviewed by Brent Fulgham.
3254
3255         * css/FontFaceSet.cpp:
3256         (WebCore::FontFaceSet::FontFaceSet): Only resolve the promise if the CSSFontFaceSet
3257         is already loaded. Otherwise, we will resolve it later when it calls completedLoading.
3258
3259 2017-09-08  Dean Jackson  <dino@apple.com>
3260
3261         gl.detachShader breaks shader program
3262         https://bugs.webkit.org/show_bug.cgi?id=137689
3263         <rdar://problem/34025056>
3264
3265         Reviewed by Sam Weinig.
3266
3267         It should be possible to compile shaders, attach them to a program,
3268         link the program, detach the shaders, delete the shaders, and then
3269         ask for the uniform and attribute locations. That is, once you've
3270         linked, the shaders can be thrown away.
3271
3272         We were using the attached shaders to look up uniform locations, so
3273         we now keep around a separate map that remembers what shaders were
3274         attached when the program links.
3275
3276         This fixes the bug, but the whole area is still a bit messy. For one,
3277         we're keeping around all the shader information even after it is
3278         no longer used.
3279         See https://bugs.webkit.org/show_bug.cgi?id=98204
3280
3281         Test: fast/canvas/webgl/detachShader-before-accessing-uniform.html
3282
3283         * platform/graphics/GraphicsContext3D.h: Add another map to remember
3284         what shaders were used when a program was linked.
3285         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3286         (WebCore::GraphicsContext3D::mappedSymbolInShaderSourceMap): New helper
3287         to look up a name in our source maps.
3288         (WebCore::GraphicsContext3D::mappedSymbolName): Use the helper, and look
3289         at linked shaders if there are no attached shaders.
3290         (WebCore::GraphicsContext3D::originalSymbolInShaderSourceMap): Does the
3291         reverse of the above.
3292         (WebCore::GraphicsContext3D::originalSymbolName):
3293         (WebCore::GraphicsContext3D::linkProgram): Add to the new map.
3294         (WebCore::GraphicsContext3D::deleteProgram): Delete the program from
3295         our shader entries.
3296
3297 2017-09-09  Mark Lam  <mark.lam@apple.com>
3298
3299         Avoid duplicate computations of ExecState::vm().
3300         https://bugs.webkit.org/show_bug.cgi?id=176647
3301
3302         Reviewed by Saam Barati.
3303
3304         No new tests because this is only a refactoring patch.  There is no
3305         significant behavior change.
3306
3307         * Modules/mediastream/SDPProcessor.cpp:
3308         (WebCore::SDPProcessor::callScript const):
3309         * Modules/plugins/QuickTimePluginReplacement.mm:
3310         (WebCore::QuickTimePluginReplacement::installReplacement):
3311         * bindings/js/JSCallbackData.cpp:
3312         (WebCore::JSCallbackData::invokeCallback):
3313         * bindings/js/JSCustomElementInterface.cpp:
3314         (WebCore::constructCustomElementSynchronously):
3315         (WebCore::JSCustomElementInterface::upgradeElement):
3316         (WebCore::JSCustomElementInterface::invokeCallback):
3317         * bindings/js/JSDOMConvertRecord.h:
3318         * bindings/js/JSDOMMapLike.h:
3319         (WebCore::forwardSizeToMapLike):
3320         (WebCore::forwardEntriesToMapLike):
3321         (WebCore::forwardKeysToMapLike):
3322         (WebCore::forwardValuesToMapLike):
3323         (WebCore::forwardGetToMapLike):
3324         (WebCore::forwardHasToMapLike):
3325         * bindings/js/JSDOMWindowCustom.cpp:
3326         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
3327         (WebCore::addCrossOriginWindowOwnPropertyNames):
3328         * bindings/js/JSDocumentCustom.cpp:
3329         (WebCore::reportMemoryForDocumentIfFrameless):
3330         * bindings/js/JSErrorHandler.cpp:
3331         (WebCore::JSErrorHandler::handleEvent):
3332         * bindings/js/JSImageDataCustom.cpp:
3333         (WebCore::toJSNewlyCreated):
3334         * bindings/js/JSLocationCustom.cpp:
3335         (WebCore::getOwnPropertySlotCommon):
3336         (WebCore::putCommon):
3337         (WebCore::addCrossOriginLocationPropertyNames):
3338         (WebCore::addCrossOriginLocationOwnPropertyNames):
3339         (WebCore::JSLocation::defineOwnProperty):
3340         (WebCore::JSLocationPrototype::put):
3341         (WebCore::JSLocationPrototype::defineOwnProperty):
3342         * bindings/js/SerializedScriptValue.cpp:
3343         (WebCore::CloneSerializer::serialize):
3344         * bindings/scripts/CodeGeneratorJS.pm:
3345         (GenerateImplementation):
3346         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3347         (WebCore::setJSInterfaceNameConstructor):
3348         * bindings/scripts/test/JS/JSMapLike.cpp:
3349         (WebCore::setJSMapLikeConstructor):
3350         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3351         (WebCore::setJSReadOnlyMapLikeConstructor):
3352         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3353         (WebCore::setJSTestActiveDOMObjectConstructor):
3354         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3355         (WebCore::setJSTestCEReactionsConstructor):
3356         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
3357         (WebCore::setJSTestCEReactionsStringifierConstructor):
3358         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3359         (WebCore::setJSTestCallTracerConstructor):
3360         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3361         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
3362         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3363         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
3364         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
3365         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
3366         (WebCore::setJSTestDOMJITConstructor):
3367         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
3368         (WebCore::setJSTestEnabledBySettingConstructor):
3369         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3370         (WebCore::setJSTestEventConstructorConstructor):
3371         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3372         (WebCore::setJSTestEventTargetConstructor):
3373         * bindings/scripts/test/JS/JSTestException.cpp:
3374         (WebCore::setJSTestExceptionConstructor):
3375         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3376         (WebCore::setJSTestGenerateIsReachableConstructor):
3377         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3378         (WebCore::setJSTestGlobalObjectConstructor):
3379         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
3380         (WebCore::setJSTestIndexedSetterNoIdentifierConstructor):
3381         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
3382         (WebCore::setJSTestIndexedSetterThrowingExceptionConstructor):
3383         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
3384         (WebCore::setJSTestIndexedSetterWithIdentifierConstructor):
3385         * bindings/scripts/test/JS/JSTestInterface.cpp:
3386         (WebCore::setJSTestInterfaceConstructor):
3387         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
3388         (WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
3389         * bindings/scripts/test/JS/JSTestIterable.cpp:
3390         (WebCore::setJSTestIterableConstructor):
3391         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
3392         (WebCore::setJSTestJSBuiltinConstructorConstructor):
3393         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3394         (WebCore::setJSTestMediaQueryListListenerConstructor):
3395         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
3396         (WebCore::setJSTestNamedAndIndexedSetterNoIdentifierConstructor):
3397         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
3398         (WebCore::setJSTestNamedAndIndexedSetterThrowingExceptionConstructor):
3399         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
3400         (WebCore::setJSTestNamedAndIndexedSetterWithIdentifierConstructor):
3401         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3402         (WebCore::setJSTestNamedConstructorConstructor):
3403         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
3404         (WebCore::setJSTestNamedDeleterNoIdentifierConstructor):
3405         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
3406         (WebCore::setJSTestNamedDeleterThrowingExceptionConstructor):
3407         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
3408         (WebCore::setJSTestNamedDeleterWithIdentifierConstructor):
3409         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
3410         (WebCore::setJSTestNamedDeleterWithIndexedGetterConstructor):
3411         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
3412         (WebCore::setJSTestNamedGetterCallWithConstructor):
3413         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
3414         (WebCore::setJSTestNamedGetterNoIdentifierConstructor):
3415         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
3416         (WebCore::setJSTestNamedGetterWithIdentifierConstructor):
3417         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
3418         (WebCore::setJSTestNamedSetterNoIdentifierConstructor):
3419         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
3420         (WebCore::setJSTestNamedSetterThrowingExceptionConstructor):
3421         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
3422         (WebCore::setJSTestNamedSetterWithIdentifierConstructor):
3423         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
3424         (WebCore::setJSTestNamedSetterWithIndexedGetterConstructor):
3425         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
3426         (WebCore::setJSTestNamedSetterWithIndexedGetterAndSetterConstructor):
3427         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
3428         (WebCore::setJSTestNamedSetterWithOverrideBuiltinsConstructor):
3429         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
3430         (WebCore::setJSTestNamedSetterWithUnforgablePropertiesConstructor):
3431         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
3432         (WebCore::setJSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor):
3433         * bindings/scripts/test/JS/JSTestNode.cpp:
3434         (WebCore::setJSTestNodeConstructor):
3435         * bindings/scripts/test/JS/JSTestObj.cpp:
3436         (WebCore::setJSTestObjConstructor):
3437         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3438         (WebCore::setJSTestOverloadedConstructorsConstructor):
3439         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3440         (WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor):
3441         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3442         (WebCore::setJSTestOverrideBuiltinsConstructor):
3443         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
3444         (WebCore::setJSTestPluginInterfaceConstructor):
3445         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
3446         (WebCore::setJSTestPromiseRejectionEventConstructor):
3447         * bindings/scripts/test/JS/JSTestSerialization.cpp:
3448         (WebCore::setJSTestSerializationConstructor):
3449         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
3450         (WebCore::setJSTestSerializationIndirectInheritanceConstructor):
3451         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
3452         (WebCore::setJSTestSerializationInheritConstructor):
3453         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
3454         (WebCore::setJSTestSerializationInheritFinalConstructor):
3455         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3456         (WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
3457         * bindings/scripts/test/JS/JSTestStringifier.cpp:
3458         (WebCore::setJSTestStringifierConstructor):
3459         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
3460         (WebCore::setJSTestStringifierAnonymousOperationConstructor):
3461         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
3462         (WebCore::setJSTestStringifierNamedOperationConstructor):
3463         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
3464         (WebCore::setJSTestStringifierOperationImplementedAsConstructor):
3465         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
3466         (WebCore::setJSTestStringifierOperationNamedToStringConstructor):
3467         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
3468         (WebCore::setJSTestStringifierReadOnlyAttributeConstructor):
3469         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
3470         (WebCore::setJSTestStringifierReadWriteAttributeConstructor):
3471         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3472         (WebCore::setJSTestTypedefsConstructor):
3473         * bridge/NP_jsobject.cpp:
3474         (_NPN_SetProperty):
3475         (_NPN_RemoveProperty):
3476         (_NPN_Enumerate):
3477         * bridge/c/c_instance.cpp:
3478         (JSC::Bindings::CRuntimeMethod::create):
3479         * bridge/objc/WebScriptObject.mm:
3480         (-[WebScriptObject setValue:forKey:]):
3481         (-[WebScriptObject removeWebScriptKey:]):
3482         (-[WebScriptObject setWebScriptValueAtIndex:value:]):
3483         * bridge/objc/objc_instance.mm:
3484         (ObjCRuntimeMethod::create):
3485         * bridge/objc/objc_runtime.h:
3486         (JSC::Bindings::ObjcFallbackObjectImp::create):
3487         * bridge/runtime_array.cpp:
3488         (JSC::RuntimeArray::getOwnPropertyNames):
3489         (JSC::RuntimeArray::getOwnPropertySlot):
3490         (JSC::RuntimeArray::put):
3491         * bridge/runtime_array.h:
3492         (JSC::RuntimeArray::create):
3493         * bridge/runtime_method.cpp:
3494         (JSC::RuntimeMethod::getOwnPropertySlot):
3495         * bridge/runtime_method.h:
3496         * html/HTMLMediaElement.cpp:
3497         (WebCore::HTMLMediaElement::updateCaptionContainer):
3498         (WebCore::HTMLMediaElement::setControllerJSProperty):
3499         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
3500         (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
3501         (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
3502         * html/HTMLPlugInImageElement.cpp:
3503         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
3504         * testing/Internals.cpp:
3505         (WebCore::Internals::cloneArrayBuffer):
3506
3507 2017-09-09  Zan Dobersek  <zdobersek@igalia.com>
3508
3509         [EME] MediaKeySession: handle MediaKeys association through a WeakPtr
3510         https://bugs.webkit.org/show_bug.cgi?id=176584
3511
3512         Reviewed by Xabier Rodriguez-Calvar.
3513
3514         Don't keep a raw pointer to the originating MediaKeys object in
3515         MediaKeySession that gets nulled out once MediaKeys is destroyed.
3516         Instead, make MediaKeys a WeakPtrFactory and use a WeakPtr<MediaKeys>
3517         object to maintain the association between MediaKeySession and
3518         MediaKeys.
3519
3520         * Modules/encryptedmedia/MediaKeySession.cpp:
3521         (WebCore::MediaKeySession::create):
3522         (WebCore::MediaKeySession::MediaKeySession):
3523         (WebCore::MediaKeySession::detachKeys): Deleted.
3524         * Modules/encryptedmedia/MediaKeySession.h:
3525         * Modules/encryptedmedia/MediaKeys.cpp:
3526         (WebCore::MediaKeys::MediaKeys):
3527         (WebCore::MediaKeys::createSession):
3528         (WebCore::MediaKeys::~MediaKeys): Deleted.
3529         * Modules/encryptedmedia/MediaKeys.h:
3530
3531 2017-09-09  Zan Dobersek  <zdobersek@igalia.com>
3532
3533         [GStreamer] Missing GRefPtr adoptions in MediaPlayerPrivateGStreamerBase, PlaybackPipeline
3534         https://bugs.webkit.org/show_bug.cgi?id=176646
3535
3536         Reviewed by Carlos Garcia Campos.
3537
3538         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3539         (WebCore::registerWebKitGStreamerElements): Adopt the return value
3540         of gst_element_factory_find(), which is transferred in full.
3541         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
3542         (WebCore::PlaybackPipeline::flush): Adopt the return values
3543         of gst_element_get_static_pad() and gst_pad_get_peer(), both being
3544         transferred in full.
3545
3546 2017-09-09  Frederic Wang  <fwang@igalia.com>
3547
3548         Use RenderLayerBacking::renderer() when possible
3549         https://bugs.webkit.org/show_bug.cgi?id=176585
3550
3551         The private member renderer() is a shorthand for m_owningLayer.renderer(). This patch uses
3552         it in RenderLayerBacking when possible.
3553
3554         Reviewed by Carlos Garcia Campos.
3555
3556         No new tests, behavior not changed.
3557
3558         * rendering/RenderLayerBacking.cpp:
3559         (WebCore::RenderLayerBacking::updateGeometry):
3560         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
3561         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
3562
3563 2017-09-08  Sam Weinig  <sam@webkit.org>
3564
3565         Replace JS builtin implementation of the FetchResponse constructor with a C++ one
3566         https://bugs.webkit.org/show_bug.cgi?id=176627
3567
3568         Reviewed by Alex Christensen.
3569
3570         Removes the last of the Fetch related JS builtin code.
3571
3572         * CMakeLists.txt:
3573         * DerivedSources.make:
3574         * WebCore.xcodeproj/project.pbxproj:
3575         * Modules/fetch/FetchInternals.js: Removed.
3576         * Modules/fetch/FetchResponse.js: Removed.
3577         
3578             Remove FetchInternals.js and FetchResponse.js.
3579
3580
3581         * Modules/fetch/FetchBody.idl:
3582         * Modules/fetch/FetchBodyConsumer.h:
3583
3584             Remove no longer correct FIXMEs.
3585
3586         * Modules/fetch/FetchBodySource.cpp:
3587
3588             Add missing newline between functions.
3589
3590         * Modules/fetch/FetchHeaders.idl:
3591         * Modules/fetch/FetchResponse.idl:
3592
3593             Remove builtin related operations and extended attributes.
3594
3595         * Modules/fetch/FetchHeaders.h:
3596         (WebCore::FetchHeaders::fastHas const):
3597         * Modules/fetch/FetchHeaders.cpp:
3598
3599             Added fastHas to allow checking for a header using a HTTPHeaderName. Remove
3600             now unused filter function.
3601
3602         * Modules/fetch/FetchResponse.cpp:
3603         (WebCore::isNullBodyStatus):
3604
3605             Added helper predicate for 'null body status' concept.
3606
3607         (WebCore::FetchResponse::create):
3608
3609             Add spec defined constructor implementation.
3610
3611         (WebCore::FetchResponse::setBodyData):
3612
3613             Reformatted to match more common WTF::switchOn style.
3614
3615         (WebCore::FetchResponse::setStatus): Deleted.
3616         (WebCore::FetchResponse::initializeWith): Deleted.
3617
3618             Removed now unused functions.
3619
3620         * Modules/fetch/FetchResponse.h:
3621         (WebCore::FetchResponse::create):
3622
3623             Move inline create out of the class definition to make things a bit less crowded.
3624
3625 2017-09-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
3626
3627         Implement HTMLImageElement.decoode() method
3628         https://bugs.webkit.org/show_bug.cgi?id=176016
3629
3630         Reviewed by Simon Fraser.
3631
3632         The specs is:
3633         https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-decode.
3634
3635         -- img.decode() waits till loading the image finishes. Otherwise it starts
3636         decoding the image immediately.
3637         -- If the image frame is already decoded, the promise will be resolved
3638         before return.
3639         -- If an error happens in loading the image or decoding the image frame,
3640         the promise will be rejected with 'EncodingError' exception.
3641         -- Animated image resolves the promise when the next frame is decoded and 
3642         the animation is advanced it. If the image is not displayed, decode() will
3643         request the decoding the first frame and start animating the image.
3644
3645         Tests: fast/images/decode-animated-image.html
3646                fast/images/decode-render-animated-image.html
3647                fast/images/decode-render-static-image.html
3648                fast/images/decode-static-image-reject.html
3649                fast/images/decode-static-image-resolve.html
3650
3651         * html/HTMLImageElement.cpp:
3652         (WebCore::HTMLImageElement::decode):
3653         * html/HTMLImageElement.h:
3654         * html/HTMLImageElement.idl:
3655         * loader/ImageLoader.cpp:
3656         (WebCore::ImageLoader::notifyFinished):
3657         (WebCore::ImageLoader::decode):
3658         (WebCore::ImageLoader::decodeError):
3659         * loader/ImageLoader.h:
3660         (WebCore::ImageLoader::hasPendingDecodePromise const):
3661         * platform/graphics/BitmapImage.cpp:
3662         (WebCore::BitmapImage::internalStartAnimation):
3663         (WebCore::BitmapImage::internalAdvanceAnimation):
3664         (WebCore::BitmapImage::decode):
3665         (WebCore::BitmapImage::imageFrameAvailableAtIndex):
3666         * platform/graphics/BitmapImage.h:
3667         * platform/graphics/Image.h:
3668         (WebCore::Image::decode):
3669
3670 2017-09-08  Joseph Pecoraro  <pecoraro@apple.com>
3671
3672         Fetch's Response.statusText is unexpectedly the full http status line for HTTP/2 responses
3673         https://bugs.webkit.org/show_bug.cgi?id=176479
3674
3675         Reviewed by Alex Christensen.
3676
3677         Test: http/wpt/fetch/response-status-text.html
3678
3679         HTTP/2 doesn't include a status reason phrase. So the "status line"
3680         ends up just being the version and status code. Fallback to the empty
3681         string instead of the full line.
3682
3683         * platform/network/HTTPParsers.cpp:
3684         (WebCore::extractReasonPhraseFromHTTPStatusLine):
3685
3686 2017-09-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
3687
3688         Implement the attribute HTMLImageElement.async 
3689         https://bugs.webkit.org/show_bug.cgi?id=176204
3690
3691         Reviewed by Darin Adler.
3692
3693         Adding this attribute to the <img> element will force async decoding for
3694         this image all the times. None of the heuristics, which  prevents flickering
3695         the image, will be checked.
3696
3697         Test: fast/images/async-attribute-with-small-image.html
3698
3699         * html/HTMLImageElement.cpp:
3700         (WebCore::HTMLImageElement::parseAttribute):
3701         * html/HTMLImageElement.h:
3702         (WebCore::HTMLImageElement::async const):
3703         * html/HTMLImageElement.idl:
3704         * rendering/RenderBoxModelObject.cpp:
3705         (WebCore::RenderBoxModelObject::decodingModeForImageDraw const):
3706
3707 2017-09-08  Commit Queue  <commit-queue@webkit.org>
3708
3709         Unreviewed, rolling out r221773.
3710         https://bugs.webkit.org/show_bug.cgi?id=176614
3711
3712         This caused build failures. (Requested by mlewis13 on
3713         #webkit).
3714
3715         Reverted changeset:
3716
3717         "[Mac] Upstream QTKit-related WebKitSystemInterface functions"
3718         https://bugs.webkit.org/show_bug.cgi?id=176472
3719         http://trac.webkit.org/changeset/221773
3720
3721 2017-09-08  Antti Koivisto  <antti@apple.com>
3722
3723         Remove support for >> descendant combinator syntax
3724         https://bugs.webkit.org/show_bug.cgi?id=175765
3725
3726         Reviewed by Sam Weinig.
3727
3728         This is an alternative syntax for the normal descendant combinator (just space) that was
3729         advertised as being consistent with > (child combinator) and >>> (shadow piercing combinator).
3730         The latter has been killed so it is not consistent with anything anymore.
3731
3732         No other engine besides WebKit has implemented this and the WPT tests have been removed
3733         (in https://github.com/w3c/web-platform-tests/pull/6785). Full removal from spec is still
3734         open (https://github.com/w3c/csswg-drafts/issues/641) but we shouldn't encourage adoption of
3735         this pointless feature.
3736
3737         While this has shipped the compatibility risk is low as no other engine implemented it and
3738         there were no incentives to use it over the standard syntax.
3739
3740         * css/CSSSelector.cpp:
3741         (WebCore::CSSSelector::selectorText const):
3742         * css/CSSSelector.h:
3743         (WebCore::CSSSelector::hasDescendantRelation const):
3744         * css/SelectorChecker.cpp:
3745         (WebCore::SelectorChecker::matchRecursively const):
3746         * css/SelectorFilter.cpp:
3747         (WebCore::SelectorFilter::collectIdentifierHashes):
3748         * css/parser/CSSParserSelector.cpp:
3749         (WebCore::CSSParserSelector::appendTagHistory):
3750         * css/parser/CSSParserSelector.h:
3751         * css/parser/CSSSelectorParser.cpp:
3752         (WebCore::isDescendantCombinator):
3753         (WebCore::CSSSelectorParser::consumeCombinator):
3754         * cssjit/SelectorCompiler.cpp:
3755         (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
3756
3757 2017-09-08  Zan Dobersek  <zdobersek@igalia.com>
3758
3759         [GStreamer] initializationDataEncountered() dispatch can outlive MediaPlayerPrivateGStreamerBase
3760         https://bugs.webkit.org/show_bug.cgi?id=176544
3761
3762         Reviewed by Xabier Rodriguez-Calvar.
3763
3764         The RunLoop dispatch that invokes MediaPlayer::initializationDataEncountered()
3765         can outlive the MediaPlayerPrivateGStreamerBase object that is referenced
3766         from the dispatched functor. To avoid this, a WeakPtrFactory is placed onto
3767         MediaPlayerPrivateGStreamerBase and a WeakPtr object is kept in the functor,
3768         bailing during dispatch if the factory (along with MediaPlayerPrivateGStreamerBase)
3769         has already been destroyed since the schedule of this dispatch.
3770
3771         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3772         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
3773         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
3774         Also remove the unused `sessionId` string.
3775         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3776
3777 2017-09-08  Zan Dobersek  <zdobersek@igalia.com>
3778
3779         [GStreamer] Add GRefPtr specializations for GstGLDisplay, GstGLContext
3780         https://bugs.webkit.org/show_bug.cgi?id=176543
3781
3782         Reviewed by Xabier Rodriguez-Calvar.
3783
3784         Both GstGLDisplay and GstGLContext inherit from GstObject, meaning
3785         gst_object_ref_sink() and gst_object_unref() should be used for
3786         incrementing and decrementing reference count. Template specializations
3787         for the adoptGRef(), refGPtr() and derefGPtr() are added for both types,
3788         preventing GRefPtr<> from falling back to using g_object_ref() and
3789         g_object_unref() for reference count modification purposes.
3790
3791         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
3792         (WTF::adoptGRef):
3793         (WTF::refGPtr<GstGLDisplay>):
3794         (WTF::derefGPtr<GstGLDisplay>):
3795         (WTF::refGPtr<GstGLContext>):
3796         (WTF::derefGPtr<GstGLContext>):
3797         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
3798
3799 2017-09-08  Zan Dobersek  <zdobersek@igalia.com>
3800
3801         [GStreamer] Incorrect GstCaps unreffing in GStreamerEMEUtilities::createDecryptor()
3802         https://bugs.webkit.org/show_bug.cgi?id=176540
3803
3804         Reviewed by Xabier Rodriguez-Calvar.
3805
3806         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp:
3807         Include the GRefPtrGStreamer.h header in order to use specialized template
3808         functions that correctly adopt and dereference GstCaps object that is
3809         wrapped the GRefPtr<>.
3810
3811 2017-09-07  Joseph Pecoraro  <pecoraro@apple.com>
3812
3813         WebKit should claim that it can show responses for a broader range of JSON MIMETypes
3814         https://bugs.webkit.org/show_bug.cgi?id=176252
3815         <rdar://problem/34212885>
3816
3817         Reviewed by Ryosuke Niwa.
3818
3819         * platform/MIMETypeRegistry.h:
3820         * platform/MIMETypeRegistry.cpp:
3821         (WebCore::MIMETypeRegistry::canShowMIMEType):
3822         Extend this to support JavaScript and JSON MIMETypes that WebKit
3823         knows how to treat as text.
3824
3825 2017-09-07  Andy Estes  <aestes@apple.com>
3826
3827         [Mac] Upstream QTKit-related WebKitSystemInterface functions
3828         https://bugs.webkit.org/show_bug.cgi?id=176472
3829
3830         Reviewed by Eric Carlson.
3831
3832         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3833         (WebCore::disableComponentsOnce):
3834         (WebCore::MediaPlayerPrivateQTKit::createQTMovie):
3835         (WebCore::MediaPlayerPrivateQTKit::hasClosedCaptions const):
3836         (WebCore::MediaPlayerPrivateQTKit::setClosedCaptionsVisible):
3837         (WebCore::selectPreferredAlternateTrackForMediaType):
3838         (WebCore::selectPreferredAlternates):
3839         (WebCore::MediaPlayerPrivateQTKit::updateStates):
3840         (WebCore::mimeModernTypesCache):
3841         (WebCore::MediaPlayerPrivateQTKit::originsInMediaCache):
3842         (WebCore::MediaPlayerPrivateQTKit::clearMediaCache):
3843         (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForOrigins):
3844         (WebCore::MediaPlayerPrivateQTKit::hasSingleSecurityOrigin const):
3845         (WebCore::MediaPlayerPrivateQTKit::movieLoadType const):
3846         (WebCore::MediaPlayerPrivateQTKit::canSaveMediaData const):
3847         * platform/mac/WebCoreSystemInterface.h:
3848         * platform/mac/WebCoreSystemInterface.mm:
3849         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
3850         (createMediaUIControl):
3851         (createControlWithMediaUIControlType):
3852         (createMediaUIBackgroundView):
3853         (-[WebVideoFullscreenHUDWindowController windowDidLoad]):
3854
3855 2017-09-07  Youenn Fablet  <youenn@apple.com>
3856
3857         Align FetchResponse and FetchRequest body handling
3858         https://bugs.webkit.org/show_bug.cgi?id=176539
3859
3860         Reviewed by Alex Christensen.
3861
3862         Covered by rebased tests.
3863
3864         Removing most of FetchResponse JS Builtins now that ReadableStream has full support.
3865         Implementing FetchResponse body cloning through ReadableStream.
3866         Cloning a loading FetchResponse still requires to create a ReadableStream for the purpose of teeing.
3867
3868         Moving exposure of the body from FetchResponse to FetchBodyOwner.
3869         This is controlled by a boolean flag set according response tainting.
3870
3871         Moving handling of body ReadableStream consuming from FetchResponse to FetchBodyConsumer.
3872         For that purpose, a loading boolean flag is added to FetchBodyConsumer so that it will resolve consume promises
3873         when loading is finished.
3874
3875         Added support for getting a body in case the request/response body is already consumed.
3876         In that case, a locked ReadableStream is returned.
3877
3878         * Modules/cache/DOMCache.cpp:
3879         (WebCore::DOMCache::doMatch):
3880         (WebCore::DOMCache::matchAll):
3881         * Modules/fetch/FetchBody.h:
3882         (WebCore::FetchBody::loadingBody):
3883         (WebCore::FetchBody::FetchBody):
3884         * Modules/fetch/FetchBody.idl:
3885         * Modules/fetch/FetchBodyConsumer.cpp:
3886         (WebCore::FetchBodyConsumer::resolve):
3887         (WebCore::FetchBodyConsumer::loadingFailed):
3888         (WebCore::FetchBodyConsumer::loadingSucceeded):
3889         * Modules/fetch/FetchBodyConsumer.h:
3890         (WebCore::FetchBodyConsumer::setAsLoading):
3891         * Modules/fetch/FetchBodyOwner.cpp:
3892         (WebCore::FetchBodyOwner::arrayBuffer):
3893         (WebCore::FetchBodyOwner::blob):
3894         (WebCore::FetchBodyOwner::formData):
3895         (WebCore::FetchBodyOwner::json):
3896         (WebCore::FetchBodyOwner::text):
3897         (WebCore::FetchBodyOwner::readableStream):
3898         * Modules/fetch/FetchBodyOwner.h:
3899         (WebCore::FetchBodyOwner::isBodyNullOrOpaque const):
3900         (WebCore::FetchBodyOwner::setBodyAsOpaque):
3901         (WebCore::FetchBodyOwner::isBodyOpaque const):
3902         * Modules/fetch/FetchInternals.js:
3903         (fillFetchHeaders):
3904         * Modules/fetch/FetchResponse.cpp:
3905         (WebCore::FetchResponse::clone):
3906         (WebCore::FetchResponse::fetch):
3907         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
3908         (WebCore::FetchResponse::setBodyData):
3909         (WebCore::FetchResponse::consumeChunk):
3910         (WebCore::FetchResponse::consumeBodyAsStream):
3911         * Modules/fetch/FetchResponse.h:
3912         * Modules/fetch/FetchResponse.idl:
3913         * Modules/fetch/FetchResponse.js:
3914         (initializeFetchResponse):
3915         * bindings/js/ReadableStream.cpp:
3916         (WebCore::ReadableStream::create):
3917         (WebCore::ReadableStream::lock):
3918         * bindings/js/ReadableStream.h:
3919         * bindings/js/WebCoreBuiltinNames.h:
3920
3921 2017-09-07  Michael Saboff  <msaboff@apple.com>
3922
3923         Add support for RegExp named capture groups
3924         https://bugs.webkit.org/show_bug.cgi?id=176435
3925
3926         Reviewed by Filip Pizlo.
3927
3928         Implemented stub routines to support named capture groups.  These are no-ops
3929         just like for number capture group.
3930
3931         No new tests as this is covered by existing tests.
3932
3933         * contentextensions/URLFilterParser.cpp:
3934         (WebCore::ContentExtensions::PatternParser::atomNamedBackReference):
3935         (WebCore::ContentExtensions::PatternParser::atomParenthesesSubpatternBegin):
3936
3937 2017-09-07  Myles C. Maxfield  <mmaxfield@apple.com>
3938
3939         [PAL] Unify PlatformUserPreferredLanguages.h with Language.h
3940         https://bugs.webkit.org/show_bug.cgi?id=176561
3941
3942         Reviewed by Brent Fulgham.
3943
3944         No new tests because there is no behavior change.
3945
3946         * CMakeLists.txt:
3947         * WebCore.xcodeproj/project.pbxproj:
3948         * accessibility/AccessibilitySVGElement.cpp:
3949         * bindings/js/JSDOMWindowBase.cpp:
3950         * bindings/js/JSWorkerGlobalScopeBase.cpp:
3951         * dom/Document.cpp:
3952         * html/HTMLInputElement.cpp:
3953         * html/HTMLMediaElement.cpp:
3954         * html/shadow/MediaControlElements.cpp:
3955         * html/track/TrackBase.cpp:
3956         * page/CaptionUserPreferences.cpp:
3957         * page/CaptionUserPreferencesMediaAF.cpp:
3958         * page/DOMWindow.cpp:
3959         * page/Navigator.cpp:
3960         * page/NavigatorBase.cpp:
3961         * platform/graphics/FontGenericFamilies.cpp:
3962         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
3963         * platform/network/HTTPParsers.cpp:
3964         * platform/text/PlatformLocale.h:
3965         * platform/text/cf/HyphenationCF.cpp:
3966         * platform/text/mac/LocaleMac.mm:
3967         * svg/SVGTests.cpp:
3968         * testing/InternalSettings.cpp:
3969         * testing/Internals.cpp:
3970         (WebCore::Internals::resetToConsistentState):
3971         (WebCore::Internals::userPreferredLanguages const):
3972         (WebCore::Internals::setUserPreferredLanguages):
3973
3974 2017-09-06  Dean Jackson  <dino@apple.com>
3975
3976         [WebGL] accelerated texImage2D for video doesn't respect flipY
3977         https://bugs.webkit.org/show_bug.cgi?id=176491
3978         <rdar://problem/33833511>
3979
3980         Reviewed by Jer Noble.
3981
3982         Previously, if UNPACK_FLIP_Y_WEBGL was set to true, we'd either fall
3983         back to software or fail to upload texture data. Fix this by intercepting
3984         the texImage2D call, checking the orientation of the video, and running
3985         a small shader program to flip it if necessary.
3986
3987         While there, implement UNPACK_PREMULTIPLY_ALPHA_WEBGL as well, although
3988         none of our media decoders support video with alpha, so unfortunately
3989         this will have no visible change.
3990
3991         Tests:&nb