Remove unused linked-on-or-before-iOS5 check
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-10-02  Alex Christensen  <achristensen@webkit.org>
2
3         Remove unused linked-on-or-before-iOS5 check
4         https://bugs.webkit.org/show_bug.cgi?id=190164
5
6         Reviewed by Michael Saboff.
7
8         If an app hasn't been updated since iOS5, it can't run supported iOS.
9         This value is also only checked in an uninstantiated template function.
10
11         * platform/URL.cpp:
12         (WebCore::enableURLSchemeCanonicalization): Deleted.
13         (WebCore::equal): Deleted.
14         * platform/URL.h:
15
16 2018-10-02  Alex Christensen  <achristensen@webkit.org>
17
18         Remove ParsedURLString
19         https://bugs.webkit.org/show_bug.cgi?id=190154
20
21         Reviewed by Chris Dumez.
22
23         Before the introduction of URLParser, it would indicate that we should assume the String
24         is from a valid URL so we can skip canonicalization and just find the offsets inside the String
25         to quickly create a URL.  It was a performance optimization that caused security issues when
26         misused.  Since the introduction of URLParser, we have a fast path for all URL parsing, so
27         right now it actually doesn't change any behavior.  It's just a relic of the past that complicates
28         the URL class, making it harder to express which constructor to use and making it harder to move
29         the class.
30
31         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
32         (WebCore::NavigatorContentUtils::registerProtocolHandler):
33         (WebCore::NavigatorContentUtils::isProtocolHandlerRegistered):
34         (WebCore::NavigatorContentUtils::unregisterProtocolHandler):
35         * dom/Document.cpp:
36         (WebCore::Document::updateBaseURL):
37         (WebCore::Document::initSecurityContext):
38         * dom/ExtensionStyleSheets.cpp:
39         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
40         * dom/ProcessingInstruction.cpp:
41         (WebCore::ProcessingInstruction::checkStyleSheet):
42         * editing/markup.cpp:
43         (WebCore::completeURLs):
44         * fileapi/BlobURL.cpp:
45         (WebCore::BlobURL::createBlobURL):
46         * history/HistoryItem.cpp:
47         (WebCore::HistoryItem::url const):
48         (WebCore::HistoryItem::originalURL const):
49         * html/HTMLFrameElementBase.cpp:
50         (WebCore::HTMLFrameElementBase::location const):
51         * html/HTMLMediaElement.cpp:
52         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
53         * html/PublicURLManager.cpp:
54         (WebCore::PublicURLManager::stop):
55         * inspector/InspectorStyleSheet.cpp:
56         (WebCore::InspectorStyleSheet::resourceStyleSheetText const):
57         * inspector/agents/InspectorPageAgent.cpp:
58         (WebCore::InspectorPageAgent::getCookies):
59         (WebCore::InspectorPageAgent::deleteCookie):
60         (WebCore::InspectorPageAgent::getResourceContent):
61         (WebCore::InspectorPageAgent::searchInResource):
62         * inspector/agents/page/PageDebuggerAgent.cpp:
63         (WebCore::PageDebuggerAgent::sourceMapURLForScript):
64         * loader/DocumentLoader.cpp:
65         (WebCore::DocumentLoader::subresources const):
66         * loader/FrameLoader.cpp:
67         (WebCore::FrameLoader::init):
68         (WebCore::FrameLoader::initForSynthesizedDocument):
69         * loader/HistoryController.cpp:
70         (WebCore::HistoryController::pushState):
71         (WebCore::HistoryController::replaceState):
72         * loader/appcache/ApplicationCache.cpp:
73         (WebCore::ApplicationCache::addResource):
74         (WebCore::ApplicationCache::resourceForURL):
75         * loader/appcache/ApplicationCacheGroup.cpp:
76         (WebCore::ApplicationCacheGroup::startLoadingEntry):
77         (WebCore::ApplicationCacheGroup::addEntry):
78         * loader/appcache/ApplicationCacheStorage.cpp:
79         (WebCore::ApplicationCacheStorage::cacheGroupForURL):
80         (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
81         (WebCore::ApplicationCacheStorage::loadCache):
82         (WebCore::ApplicationCacheStorage::manifestURLs):
83         * loader/archive/cf/LegacyWebArchive.cpp:
84         (WebCore::LegacyWebArchive::create):
85         * page/DOMWindow.cpp:
86         (WebCore::DOMWindow::createWindow):
87         * page/PageSerializer.cpp:
88         (WebCore::PageSerializer::urlForBlankFrame):
89         * platform/URL.cpp:
90         (WebCore::blankURL):
91         * platform/URL.h:
92         (): Deleted.
93         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
94         (WebCore::MediaPlayerPrivateAVFoundation::load):
95         * platform/network/BlobRegistryImpl.cpp:
96         (WebCore::BlobRegistryImpl::populateBlobsForFileWriting):
97         * platform/network/ResourceRequestBase.h:
98         (WebCore::ResourceRequestBase::decodeBase):
99         * platform/network/ResourceResponseBase.cpp:
100         (WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
101         * platform/network/cf/DNSResolveQueueCFNet.cpp:
102         (WebCore::DNSResolveQueueCFNet::updateIsUsingProxy):
103         * platform/network/cf/ResourceRequest.h:
104         (WebCore::ResourceRequest::ResourceRequest):
105         * platform/network/curl/CookieJarDB.cpp:
106         (WebCore::CookieJarDB::searchCookies):
107         (WebCore::CookieJarDB::setCookie):
108         (WebCore::CookieJarDB::deleteCookie):
109         * platform/network/curl/ResourceRequest.h:
110         (WebCore::ResourceRequest::ResourceRequest):
111         * platform/network/soup/ResourceRequest.h:
112         (WebCore::ResourceRequest::ResourceRequest):
113         * xml/XSLTProcessorLibxslt.cpp:
114         (WebCore::docLoaderFunc):
115
116 2018-10-02  Per Arne Vollan  <pvollan@apple.com>
117
118         [WebVTT] Cue with line setting is not rendered correctly
119         https://bugs.webkit.org/show_bug.cgi?id=190168
120
121         Reviewed by Eric Carlson.
122
123         When the line setting contains an optional alignment value, the cue is not rendered at the correct position,
124         see https://w3c.github.io/webvtt/#webvtt-line-cue-setting. This patch does not implement correct handling of
125         the line setting alignment values, it only makes sure parsing does not fail when the cue has line alignment
126         settings.
127
128         Test: media/track/track-cue-line-position.html
129
130         * html/track/VTTCue.cpp:
131         (WebCore::VTTCueBox::applyCSSProperties):
132         (WebCore::VTTCue::getPositionCoordinates const):
133         (WebCore::VTTCue::setCueSettings):
134
135 2018-10-02  Antti Koivisto  <antti@apple.com>
136
137         User installed fonts are not always disabled when they should be
138         https://bugs.webkit.org/show_bug.cgi?id=190195
139
140         Reviewed by Geoffrey Garen.
141
142         SVG images and some theme cases fail to respect the setting. Besides the obvious problem this
143         is also a performance issue as various font caches include this setting in the key.
144
145         * platform/graphics/FontDescription.cpp:
146         (WebCore::m_shouldAllowUserInstalledFonts):
147
148         Initialize to 'No' by default. All paths where user fonts make sense already set the bit from
149         settings. This fixes some cases in system themes that construct FontDescriptions from scratch.
150
151         * rendering/RenderElement.cpp:
152         (WebCore::RenderElement::styleWillChange):
153
154         Add assertion. This verified the change with the existing tests.
155
156         * svg/graphics/SVGImage.cpp:
157         (WebCore::SVGImage::dataChanged):
158
159         Always disallow user fonts in SVG used as images.
160
161 2018-10-01  Dean Jackson  <dino@apple.com>
162
163         Remove CSS Animation Triggers
164         https://bugs.webkit.org/show_bug.cgi?id=190175
165         <rdar://problem/44925626>
166
167         Reviewed by Simon Fraser.
168
169         Remove the never-properly specified CSS Animation Triggers.
170
171         * Configurations/FeatureDefines.xcconfig:
172         * Sources.txt:
173         * WebCore.xcodeproj/project.pbxproj:
174         * css/CSSAnimationTriggerScrollValue.cpp: Removed.
175         * css/CSSAnimationTriggerScrollValue.h: Removed.
176         * css/CSSComputedStyleDeclaration.cpp:
177         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
178         (WebCore::createAnimationTriggerValue): Deleted.
179         (WebCore::animationTriggerValue): Deleted.
180         * css/CSSProperties.json:
181         * css/CSSToStyleMap.cpp:
182         (WebCore::CSSToStyleMap::mapAnimationTrigger): Deleted.
183         * css/CSSToStyleMap.h:
184         * css/CSSValue.cpp:
185         (WebCore::CSSValue::equals const):
186         (WebCore::CSSValue::cssText const):
187         (WebCore::CSSValue::destroy):
188         * css/CSSValue.h:
189         (WebCore::CSSValue::isAnimationTriggerScrollValue const): Deleted.
190         * css/parser/CSSPropertyParser.cpp:
191         (WebCore::consumeAnimationValue):
192         (WebCore::CSSPropertyParser::parseSingleValue):
193         (WebCore::consumeWebkitAnimationTrigger): Deleted.
194         * page/FrameView.cpp:
195         (WebCore::FrameView::sendScrollEvent):
196         * page/RuntimeEnabledFeatures.h:
197         (WebCore::RuntimeEnabledFeatures::setAnimationTriggersEnabled): Deleted.
198         (WebCore::RuntimeEnabledFeatures::animationTriggersEnabled const): Deleted.
199         * page/animation/AnimationBase.cpp:
200         (WebCore::AnimationBase::updateStateMachine):
201         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
202         (WebCore::AnimationBase::timeToNextService):
203         (WebCore::AnimationBase::getElapsedTime const):
204         * page/animation/CSSAnimationController.cpp:
205         (WebCore::CSSAnimationControllerPrivate::animationWillBeRemoved):
206         (WebCore::CSSAnimationControllerPrivate::addToAnimationsDependentOnScroll): Deleted.
207         (WebCore::CSSAnimationControllerPrivate::removeFromAnimationsDependentOnScroll): Deleted.
208         (WebCore::CSSAnimationControllerPrivate::scrollWasUpdated): Deleted.
209         (WebCore::CSSAnimationController::wantsScrollUpdates const): Deleted.
210         (WebCore::CSSAnimationController::scrollWasUpdated): Deleted.
211         * page/animation/CSSAnimationController.h:
212         * page/animation/CSSAnimationControllerPrivate.h:
213         (WebCore::CSSAnimationControllerPrivate::wantsScrollUpdates const): Deleted.
214         (WebCore::CSSAnimationControllerPrivate::scrollPosition const): Deleted.
215         * page/animation/CompositeAnimation.cpp:
216         (WebCore::CompositeAnimation::updateKeyframeAnimations):
217         * page/animation/CompositeAnimation.h:
218         (WebCore::CompositeAnimation::hasScrollTriggeredAnimation const): Deleted.
219         * platform/animation/Animation.cpp:
220         (WebCore::Animation::Animation):
221         (WebCore::Animation::operator=):
222         (WebCore::Animation::animationsMatch const):
223         * platform/animation/Animation.h:
224         (WebCore::Animation::isTimingFunctionSet const):
225         (WebCore::Animation::isEmpty const):
226         (WebCore::Animation::clearTimingFunction):
227         (WebCore::Animation::clearAll):
228         (WebCore::Animation::animationMode const):
229         (WebCore::Animation::setAnimationMode):
230         (WebCore::Animation::initialTimingFunction):
231         (WebCore::Animation::isTriggerSet const): Deleted.
232         (WebCore::Animation::clearTrigger): Deleted.
233         (WebCore::Animation::trigger const): Deleted.
234         (WebCore::Animation::setTrigger): Deleted.
235         (WebCore::Animation::initialTrigger): Deleted.
236         * platform/animation/AnimationTrigger.h: Removed.
237         * platform/graphics/ca/GraphicsLayerCA.cpp:
238         (WebCore::GraphicsLayerCA::animationCanBeAccelerated const):
239 2018-10-02  Commit Queue  <commit-queue@webkit.org>
240
241         Unreviewed, rolling out r236624 and r236671.
242         https://bugs.webkit.org/show_bug.cgi?id=190207
243
244         The change in r236624 introduced crashes on the bots
245         (Requested by ryanhaddad on #webkit).
246
247         Reverted changesets:
248
249         "Refactoring: eliminate raw pointer usage in Fullscreen code"
250         https://bugs.webkit.org/show_bug.cgi?id=188747
251         https://trac.webkit.org/changeset/236624
252
253         "Unify implementation in VideoFullscreenInterfaceAVKit"
254         https://bugs.webkit.org/show_bug.cgi?id=190091
255         https://trac.webkit.org/changeset/236671
256
257 2018-10-02  Sihui Liu  <sihui_liu@apple.com>
258
259         Add release assertion to ensure m_owningPointerForClose is null in UniqueIDBDatabase::invokeOperationAndTransactionTimer()
260         https://bugs.webkit.org/show_bug.cgi?id=190178
261
262         Reviewed by Chris Dumez.
263
264         This would help debug rdar://problem/44902833.
265
266         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
267         (WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer):
268
269 2018-10-02  Commit Queue  <commit-queue@webkit.org>
270
271         Unreviewed, rolling out r236719.
272         https://bugs.webkit.org/show_bug.cgi?id=190197
273
274         this revision caused 39 layout test failures that tested for
275         scrolling, a bug was also not present in the commit or change
276         log. (Requested by Truitt on #webkit).
277
278         Reverted changeset:
279
280         "Unreviewed, fix unused variable in
281         RenderLayer::updateScrollableAreaSet"
282         https://trac.webkit.org/changeset/236719
283
284 2018-10-02  Alicia Boya García  <aboya@igalia.com>
285
286         [MSE][GStreamer] Add h264parse to accept MP4 without stss
287         https://bugs.webkit.org/show_bug.cgi?id=190143
288
289         Reviewed by Xabier Rodriguez-Calvar.
290
291         The MP4 file used in this URL does not contain a stss (Sync Sample
292         Box). In consequence, in acordance with the ISO BMFF spec, all samples
293         are assumed to be sync frames... But in this case that is not true,
294         it's just that the file is wrong (e.g. created with a buggy muxer).
295
296         http://orange-opensource.github.io/hasplayer.js/1.2.0/player.html?url=http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest
297
298         The way it works in other browsers is because instead of trusting the
299         MP4 stss table, they rely on parsing the h264 frames. We can do that
300         too.
301
302         This patch also changes RELEASE_ASSERT() when creating the parsers
303         to GLib criticals.
304
305         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
306         (WebCore::createOptionalParserForFormat):
307
308 2018-10-02  Eric Carlson  <eric.carlson@apple.com>
309
310         [MediaStream] RealtimeMediaSource should be able to vend hashed IDs
311         https://bugs.webkit.org/show_bug.cgi?id=190142
312         <rdar://problem/44911109>
313
314         Reviewed by Youenn Fablet.
315
316         No new tests, covered by existing tests.
317
318         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
319         (WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Update order of parameters passed
320         to base class.
321
322         * Modules/mediastream/MediaDevicesRequest.cpp:
323         (WebCore::MediaDevicesRequest::start): ASSERT if document.deviceIDHashSalt is not the same
324         as passed salt.
325
326         * Modules/mediastream/MediaStreamTrack.cpp:
327         (WebCore::MediaStreamTrack::getSettings const): Don't need to hash ID.
328         (WebCore::MediaStreamTrack::getCapabilities const): Ditto.
329         * Modules/mediastream/MediaStreamTrack.h:
330         * Modules/mediastream/MediaStreamTrack.idl:
331
332         * Modules/mediastream/UserMediaRequest.cpp:
333         (WebCore::UserMediaRequest::allow): Pass hash salt to createMediaStream.
334
335         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
336         (WebCore::LibWebRTCPeerConnectionBackend::createReceiverForSource): Update order of parameters passed
337         to base class.
338
339         * Modules/webaudio/MediaStreamAudioSource.cpp:
340         (WebCore::MediaStreamAudioSource::MediaStreamAudioSource): Ditto.
341         * platform/mediastream/MediaConstraints.h:
342
343         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
344         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource): Ditto.
345
346         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
347         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource): Ditto.
348
349         * platform/mediastream/RealtimeMediaSource.cpp:
350         (WebCore::RealtimeMediaSource::RealtimeMediaSource): Calculate hashed ID.
351         (WebCore::RealtimeMediaSource::selectSettings): Use m_hashedID.
352         (WebCore::RealtimeMediaSource::hashedId const): New.
353         (WebCore::RealtimeMediaSource::deviceIDHashSalt const): New.
354         * platform/mediastream/RealtimeMediaSource.h:
355
356         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
357         (WebCore::RealtimeMediaSourceCenter::createMediaStream): Take hash salt, pass it when creating
358         a source.
359         (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices): Ditto.
360         (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
361         * platform/mediastream/RealtimeMediaSourceCenter.h:
362
363         * platform/mediastream/RealtimeMediaSourceFactory.h:
364         * platform/mediastream/RealtimeVideoSource.cpp:
365         (WebCore::RealtimeVideoSource::RealtimeVideoSource): Update parameters.
366         * platform/mediastream/RealtimeVideoSource.h:
367
368         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
369         (WebCore::GStreamerAudioCaptureSource::create): Ditto.
370         (WebCore::GStreamerAudioCaptureSource::GStreamerAudioCaptureSource): Ditto.
371         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
372
373         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
374         (WebCore::GStreamerVideoCaptureSource::create): Ditto.
375         (WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource): Ditto.
376         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
377
378         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
379         (WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource): Ditto.
380         (WebCore::MockRealtimeAudioSource::create): Ditto.
381         (WebCore::MockGStreamerAudioCaptureSource::MockGStreamerAudioCaptureSource): Ditto.
382         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
383
384         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
385         (WebCore::MockRealtimeVideoSource::create): Ditto.
386         (WebCore::MockGStreamerVideoCaptureSource::MockGStreamerVideoCaptureSource): Ditto.
387         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
388
389         * platform/mediastream/mac/AVVideoCaptureSource.h:
390         * platform/mediastream/mac/AVVideoCaptureSource.mm:
391         (WebCore::AVVideoCaptureSource::create): Ditto.
392         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Ditto.
393         (WebCore::AVVideoCaptureSource::settings): Use hashedId to set device ID.
394         (WebCore::AVVideoCaptureSource::capabilities): Ditto.
395
396         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
397         (WebCore::CoreAudioCaptureSource::create): Update parameters.
398         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): Ditto.
399         (WebCore::CoreAudioCaptureSource::capabilities): Use hashedId to set device ID.
400         (WebCore::CoreAudioCaptureSource::settings): Ditto.
401         * platform/mediastream/mac/CoreAudioCaptureSource.h:
402
403         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
404         (WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa): Update parameters.
405         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
406
407         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
408         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
409         (WebCore::MockRealtimeAudioSource::create): Ditto.
410         (WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac): Ditto.
411
412         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
413         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
414         (WebCore::MockRealtimeVideoSource::create): Ditto.
415         (WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac): Ditto.
416
417         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
418
419         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
420         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
421         (WebCore::ScreenDisplayCaptureSourceMac::create): Ditto.
422         (WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac): Ditto.
423         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Update logging.
424         (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
425         (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.
426
427         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
428         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm:
429         (WebCore::WindowDisplayCaptureSourceMac::create): Update parameters.
430
431         * platform/mock/MockRealtimeAudioSource.cpp:
432         (WebCore::MockRealtimeAudioSource::create): Ditto.
433         (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): Ditto.
434         (WebCore::MockRealtimeAudioSource::settings): Use hashedId to set device ID.
435         (WebCore::MockRealtimeAudioSource::capabilities): Ditto.
436         * platform/mock/MockRealtimeAudioSource.h:
437
438         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
439
440         * platform/mock/MockRealtimeVideoSource.cpp:
441         (WebCore::MockRealtimeVideoSource::create): Update parameters.
442         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Ditto.
443         (WebCore::MockRealtimeVideoSource::capabilities): Use hashedId to set device ID.
444         (WebCore::MockRealtimeVideoSource::settings): Ditto.
445         * platform/mock/MockRealtimeVideoSource.h:
446
447 2018-10-02  Philippe Normand  <pnormand@igalia.com>
448
449         [GStreamer][playbin3] Stream tag lists leaks
450         https://bugs.webkit.org/show_bug.cgi?id=190192
451
452         Reviewed by Xabier Rodriguez-Calvar.
453
454         The gst_stream_get_tags() result is transfer-full, so needs to be adopted to prevent a leak.
455         Also check the tags list pointer which might be NULL in some cases.
456
457         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
458         (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
459         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
460         (WebCore::MediaPlayerPrivateGStreamer::naturalSize const):
461         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
462         (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
463
464 2018-10-01  Michael Catanzaro  <mcatanzaro@igalia.com>
465
466         Unreviewed, fix unused variable in RenderLayer::updateScrollableAreaSet
467
468         * rendering/RenderLayer.cpp:
469         (WebCore::RenderLayer::calculateClipRects const): This is a prepare-ChangeLog bug. I don't
470         have any changes in this function....
471
472 2018-10-02  Alicia Boya García  <aboya@igalia.com>
473
474         [MSE][GStreamer] Make same thread assert non-release
475         https://bugs.webkit.org/show_bug.cgi?id=189924
476
477         Reviewed by Xabier Rodriguez-Calvar.
478
479         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
480         (WebCore::AppendPipeline::handleNewAppsinkSample):
481
482 2018-10-01  Ryosuke Niwa  <rniwa@webkit.org>
483
484         Add a new variant of serializePreservingVisualAppearance which takes VisibleSelection
485         https://bugs.webkit.org/show_bug.cgi?id=190108
486
487         Reviewed by Wenson Hsieh.
488
489         Added a version of serializePreservingVisualAppearance which takes VisibleSelection so that we can avoid creating
490         a range simply to get the first node and the end node of the selection later. This simple change also fixes a bug
491         demonstrated in editing/pasteboard/paste-table-003.html.
492
493         Test: editing/pasteboard/paste-table-003.html
494
495         * editing/cocoa/EditorCocoa.mm:
496         (WebCore::Editor::selectionInHTMLFormat): Adopt the new variant.
497         * editing/gtk/EditorGtk.cpp:
498         (WebCore::Editor::writeSelectionToPasteboard): Ditto.
499         * editing/markup.cpp:
500         (WebCore::serializePreservingVisualAppearance): Added.
501         * editing/markup.h:
502         * editing/wpe/EditorWPE.cpp:
503         (WebCore::Editor::writeSelectionToPasteboard): Ditto.
504         * loader/archive/cf/LegacyWebArchive.cpp:
505         (WebCore::LegacyWebArchive::createFromSelection): Ditto.
506         * platform/win/PasteboardWin.cpp:
507         (WebCore::Pasteboard::writeSelection): Ditto.
508
509 2018-10-01  Alex Christensen  <achristensen@webkit.org>
510
511         Don't read from WebCore's bundle for IDNScriptWhiteList
512         https://bugs.webkit.org/show_bug.cgi?id=190157
513
514         Reviewed by Dan Bernstein.
515
516         No change in behavior.  This increases performance by not reading from the WebCore bundle,
517         and it makes it so that URL-related functionality can be moved to a place without
518         a bundle for resources.
519
520         * Resources/IDNScriptWhiteList.txt: Removed.
521         * WebCore.xcodeproj/project.pbxproj:
522         * platform/mac/WebCoreNSURLExtras.mm:
523         (WebCore::whiteListIDNScripts):
524         (WebCore::allCharactersInIDNScriptWhiteList):
525         (WebCore::readIDNScriptWhiteListFile): Deleted.
526
527 2018-10-01  Alex Christensen  <achristensen@webkit.org>
528
529         Unreviewed, rolling out r236551.
530
531         Fails URL validating too aggressively
532
533         Reverted changeset:
534
535         "URLWithUserTypedString should return nil for URLs deemed to
536         be invalid by WebCore::URL"
537         https://bugs.webkit.org/show_bug.cgi?id=189979
538         https://trac.webkit.org/changeset/236551
539
540 2018-10-01  Keith Miller  <keith_miller@apple.com>
541
542         Create a RELEASE_AND_RETURN macro for ExceptionScopes
543         https://bugs.webkit.org/show_bug.cgi?id=190163
544
545         Reviewed by Mark Lam.
546
547         The new RELEASE_AND_RETURN does all the work for cases
548         where you want to return the result of some expression
549         without explicitly checking for an exception. This is
550         much like the existing RETURN_IF_EXCEPTION macro.
551
552         No new tests since this is a refactor.
553
554         * bridge/runtime_array.cpp:
555         (JSC::RuntimeArray::put):
556
557 2018-10-01  Daniel Bates  <dabates@apple.com>
558
559         Attempt to fix the watchOS build after <https://trac.webkit.org/changeset/236678>
560         (https://bugs.webkit.org/show_bug.cgi?id=189974)
561
562         Explicitly cast index to unsigned to make the operator[] call unambiguous.
563
564         * platform/ios/KeyEventIOS.mm:
565         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
566
567 2018-10-01  Ryosuke Niwa  <rniwa@webkit.org>
568
569         ASAN failure in ~GCReachableRef()
570         https://bugs.webkit.org/show_bug.cgi?id=190113
571
572         Reviewed by Darin Adler.
573
574         The bug was caused by ~GCReachableRef accessing Ref after it had been poisoned for ASAN
575         in Ref::leakRef via Ref(Ref&& other). Fixed the bug by using RefPtr instead since that's
576         the simplest solution here although we could unpoison Ref temporarily as done in ~Ref.
577
578         * dom/GCReachableRef.h:
579         (WebCore::GCReachableRef::GCReachableRef):
580         (WebCore::GCReachableRef::~GCReachableRef):
581         (WebCore::GCReachableRef::operator-> const):
582         (WebCore::GCReachableRef::get const):
583         (WebCore::GCReachableRef::operator T& const):
584         (WebCore::GCReachableRef::operator! const):
585         (WebCore::GCReachableRef::isNull const): Deleted.
586
587 2018-10-01  Sihui Liu  <sihui_liu@apple.com>
588
589         Remove StorageProcess
590         https://bugs.webkit.org/show_bug.cgi?id=189975
591
592         Reviewed by Geoffrey Garen.
593
594         Clean up code. No behavior change.
595
596         * English.lproj/Localizable.strings:
597
598 2018-10-01  Alicia Boya García  <aboya@igalia.com>
599
600         [MSE][GStreamer] Set a minimum sample duration
601         https://bugs.webkit.org/show_bug.cgi?id=190125
602
603         Reviewed by Xabier Rodriguez-Calvar.
604
605         The last sample of the audio track in the asset used in this test
606         player has a tiny duration (100 ns):
607
608         http://orange-opensource.github.io/hasplayer.js/1.2.0/player.html?url=http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest
609
610         So small, we were truncating it to zero. We're not supposed to have
611         frames with zero duration. Instead, lets set a minimum frame duration
612         for those fringe cases.
613
614         * platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
615         (WebCore::MediaSampleGStreamer::MediaSampleGStreamer):
616
617 2018-10-01  Daniel Bates  <dabates@apple.com>
618
619         [iOS] Special keys are misidentified in DOM keyboard events
620         https://bugs.webkit.org/show_bug.cgi?id=189974
621
622         Reviewed by Wenson Hsieh.
623
624         This patch fixes two issues:
625             1. Special keyboard keys would be misidentified in dispatched DOM keyboard events.
626             2. DOM keypress events may not be dispatched for some special keys.
627
628         UIKit uses special input strings to identify the Page Up, Page Down, Escape, Up Arrow, Down Arrow,
629         Left Arrow, and Right Arrow keys. It also uses ASCII control characters to represent some other
630         special keys, including Num Lock / Clear, Home, End, Forward Delete, and F1, ..., F24. We need
631         to explicitly handle these special keyboard keys in order to be able to identify the key that
632         was pressed as well as to correctly disambiguate a key down to know whether to dispatch a DOM
633         keypress event for the key.
634
635         Unlike UIKit, AppKit reserves Unicode Private Use Area (PUA) code points in 0xF700–0xF8FF to
636         represent special keyboard keys. This makes it straightforward to disambiguate such keys using
637         the input string of the keyboard event alone. To simplify the implementation for iOS
638         we normalize the input string be AppKit compatible. See the explaination for WebCore::windowsKeyCodeForCharCode()
639         below for more details on why this is done.
640
641         Tests: fast/events/ios/keydown-keyup-arrow-keys-in-non-editable-element.html
642                fast/events/ios/keypress-keys-in-non-editable-element.html
643
644         * SourcesCocoa.txt:
645         * WebCore.xcodeproj/project.pbxproj:
646         Do not use unified source build strategy when building WebEvent.mm as it makes
647         use of SoftLinking macros that are incompatible with this strategy.
648
649         * platform/ios/KeyEventIOS.mm:
650         (WebCore::windowsKeyCodeForCharCode): Recognize some special AppKit special char codes.
651         These special char codes are generated by WebKit. WebKit uses the same special char codes
652         as AppKit as a convenience instead of defining our own constants for the same purpose.
653         Encoding the special UIKit input strings (e.g. up arrow) as distinct char codes allows us
654         to use integer arithmetic and switch blocks to map characters to Windows virtual key
655         codes as opposed to special cased branches to perform pointer or string comparisions.
656         The latter would be necessary in Modern WebKit in order for key down events to be properly
657         disambiguated to dispatch a DOM keypress event because pointers are not perserved, though
658         what they point to is, when sending the WebEvent from UIProcess to the WebProcess and
659         vice versa.
660         (WebCore::isFunctionKey): Convenience function that determines whether the specified char
661         code corresponds to a function key on the keyboard. The term "function key" is taken from
662         AppKit parlance to describe a special keyboard key. These keys include F1, F2, ..., F24,
663         and cursor keys among other special keyboard keys.
664         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Write in terms of isFunctionKey().
665         * platform/ios/PlatformEventFactoryIOS.h:
666         * platform/ios/PlatformEventFactoryIOS.mm:
667         (WebCore::keyIdentifierForKeyEvent): Remove code to handle UIKit special input strings as
668         we now map such special input strings to char codes and hence can use the default code path.
669         (WebCore::keyForKeyEvent): Ditto.
670         (WebCore::codeForKeyEvent): Remove code to compute the Window virtual key code corresponding
671         to a UIKit special key command now that we map such special input strings to char codes and
672         subsequently map the char codes to the Windows virtual key code (see -[WebEvent initWithKeyEventType:...]
673         constructors). So, we can now use WebEvent.keyCode directly to compute the DOM UIEvents code
674         for the event.
675         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): Remove code to fix up
676         WebEvent.keyCode to account for UIKit special input strings now that we map such special key
677         commands to char codes and subsequently map the char codes to the Windows virtual key code (see -[WebEvent initWithKeyEventType:...]
678         constructors). So, we can now take WebEvent.keyCode verbatim to be the Window virtual key code.
679         (WebCore::convertSpecialKeyToCharCode): Deleted.
680         (WebCore::keyCodeForEvent): Deleted.
681         * platform/ios/WebEvent.mm:
682         (normalizedStringWithAppKitCompatibilityMapping): Added; converts a UIKit character string
683         to the corresponding AppKit-compatible one (if not already compatible). See the explaination
684         for WebCore::windowsKeyCodeForCharCode() above for more details on why this is done.
685
686         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
687         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
688         Normalize the character strings to be AppKit compatible.
689
690 2018-10-01  Simon Fraser  <simon.fraser@apple.com>
691
692         Optimize RenderStyle::diff() and clean up the code
693         https://bugs.webkit.org/show_bug.cgi?id=190104
694
695         Reviewed by Dan Bernstein.
696
697         RenderStyle::changeRequiresLayout() and related should only check values on 
698         m_rareNonInheritedData and m_rareInheritedData after checking for pointer equality.
699         To reduce the chances of future changes regressing this, move code comparing values
700         on StyleRare[Non]InheritedData into dedication functions.
701         
702         In addition, the transform comparison double-compared the transformOperations,
703         because m_rareNonInheritedData->transform != other.m_rareNonInheritedData->transform
704         is a deep comparison, and it was followed by *m_rareNonInheritedData->transform != *other.m_rareNonInheritedData->transform.
705         Change the first to be a pointer comparison.
706
707         * rendering/style/RenderStyle.cpp:
708         (WebCore::rareNonInheritedDataChangeRequiresLayout):
709         (WebCore::rareInheritedDataChangeRequiresLayout):
710         (WebCore::RenderStyle::changeRequiresLayout const):
711         (WebCore::rareNonInheritedDataChangeRequiresLayerRepaint):
712         (WebCore::RenderStyle::changeRequiresLayerRepaint const):
713         (WebCore::rareNonInheritedDataChangeRequiresRepaint):
714         (WebCore::rareInheritedDataChangeRequiresRepaint):
715         (WebCore::RenderStyle::changeRequiresRepaint const):
716
717 2018-10-01  Alex Christensen  <achristensen@webkit.org>
718
719         URL should not use TextEncoding internally
720         https://bugs.webkit.org/show_bug.cgi?id=190111
721
722         Reviewed by Andy Estes.
723
724         That dependency makes it impossible to move or use elsewhere.
725         Using TextEncoding was overkill because we know the credentials are UTF-8 percent-encoded in a parsed URL.
726         No change in behavior as verified by new API tests.
727
728         * page/SecurityOrigin.cpp:
729         * page/csp/ContentSecurityPolicySourceList.cpp:
730         * platform/URL.cpp:
731         (WebCore::decodeEscapeSequencesFromParsedURL):
732         (WebCore::URL::user const):
733         (WebCore::URL::pass const):
734         (WebCore::URL::fileSystemPath const):
735         (WebCore::decodeURLEscapeSequences): Deleted.
736         * platform/URL.h:
737         * platform/network/DataURLDecoder.cpp:
738         * platform/text/TextEncoding.cpp:
739         (WebCore::decodeURLEscapeSequences):
740         * platform/text/TextEncoding.h:
741
742 2018-10-01  Simon Pieters  <zcorpan@gmail.com>
743
744         <form> in quirks mode should have margin-block-end: 1em
745         https://bugs.webkit.org/show_bug.cgi?id=157788
746
747         Reviewed by Simon Fraser.
748
749         Change the default style for forms to take writing-mode into account
750         in quirks mode. Matches the behavior of Gecko and Edge and the HTML
751         standard.
752
753         Spec: https://html.spec.whatwg.org/multipage/rendering.html#flow-content-3
754
755         Test: imported/w3c/web-platform-tests/html/rendering/non-replaced-elements/flow-content-0/form-margin-quirk.html
756
757         * css/quirks.css:
758         (form):
759
760 2018-10-01  Jeremy Jones  <jeremyj@apple.com>
761
762         Unify implementation in VideoFullscreenInterfaceAVKit
763         https://bugs.webkit.org/show_bug.cgi?id=190091
764         rdar://problem/44734523
765
766         Reviewed by Jer Noble.
767
768         No new tests because no behavior change.
769
770         Unified code in VideoFullscreenInterfaceAVKit now that new code path is proven and include
771         any changes that had been made in the old path.
772
773         * platform/ios/VideoFullscreenInterfaceAVKit.h:
774         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
775         (-[WebAVPlayerViewControllerDelegate playerViewControllerShouldStartPictureInPictureFromInlineWhenEnteringBackground:]):
776         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
777         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
778         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
779         (VideoFullscreenControllerContext::requestUpdateInlineRect):
780         (VideoFullscreenControllerContext::requestVideoContentLayer):
781         (VideoFullscreenControllerContext::returnVideoContentLayer):
782         (VideoFullscreenControllerContext::didSetupFullscreen):
783         (VideoFullscreenControllerContext::didExitFullscreen):
784
785 2018-10-01  Antoine Quint  <graouts@apple.com>
786
787         [Web Animations] Ensure renderers with accelerated animations have layers
788         https://bugs.webkit.org/show_bug.cgi?id=189990
789
790         Reviewed by Simon Fraser.
791
792         In r236501 we added code that would make a RenderBox and a RenderInline query the document timeline for whether a given element has
793         accelerated animations running on it. Since the calls to requiresLayer() are in a hot path, we instead keep a list of elements with
794         exclusively accelerated animations running.
795
796         No new tests, this is already covered by webanimations/accelerated-animation-with-delay.html and webanimations/opacity-animation-yields-compositing-span.html
797         which respectively check that we can apply an accelerated animation to a non-positioned block and an inline element.
798
799         * animation/AnimationTimeline.h:
800         * animation/DocumentTimeline.cpp:
801         (WebCore::DocumentTimeline::detachFromDocument):
802         (WebCore::DocumentTimeline::animationWasAddedToElement):
803         (WebCore::DocumentTimeline::animationWasRemovedFromElement):
804         (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange):
805         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): Iterate over an element's animations to determine
806         whether all of its animations are running accelerated, then update the HashSet containing elements running accelerated animations to remove or
807         add this element.
808         (WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated const): Make a simple contains() call on the HashSet containing elements
809         running accelerated animations.
810         * animation/DocumentTimeline.h:
811         * animation/KeyframeEffectReadOnly.cpp:
812         (WebCore::KeyframeEffectReadOnly::updateAcceleratedAnimationState):
813         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
814         * rendering/RenderBoxModelObject.h:
815
816 2018-10-01  Alicia Boya García  <aboya@igalia.com>
817
818         [GStreamer] Fix abort in gst_sample_get_info()
819         https://bugs.webkit.org/show_bug.cgi?id=190135
820
821         Reviewed by Philippe Normand.
822
823         A flush can occur before any frame has finished decoding -- especially
824         in tests, where actions on the player often occur in quick succession.
825
826         Therefore, the code must not assume by the time a flush occurs any
827         frame has reached the sink. This patch fixes a case when such wrong
828         assumption was causing gst_sample_get_info() to abort (crashing
829         WebKit).
830
831         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
832         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
833         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink):
834
835 2018-10-01  Olivier Blin  <olivier.blin@softathome.com>
836
837         [WPE] fix buffer over-read in RenderThemeWPE::mediaControlsStyleSheet()
838         https://bugs.webkit.org/show_bug.cgi?id=190139
839
840         Reviewed by Michael Catanzaro.
841
842         Like done upstream for EFL in r210213
843         https://bugs.webkit.org/show_bug.cgi?id=166622
844
845         This has been detected by a charactersAreAllASCII() assert failure.
846
847         This is because ASCIILiteral() is wrongly used in mediaControlsStyleSheet().
848         mediaControlsBaseUserAgentStyleSheet is a char array, not a null-terminated string.
849         It is thus incorrect to use StringImpl::createFromLiteral() that calls
850         strlen() to get the string length.
851
852         The String::ConstructFromLiteral constructor can not be used, since it
853         skips the last character.
854
855         * platform/wpe/RenderThemeWPE.cpp:
856         (WebCore::RenderThemeWPE::mediaControlsStyleSheet):
857         Explicitely pass the size to the String constructor.
858
859 2018-10-01  Rob Buis  <rbuis@igalia.com>
860
861         Align XMLHttpRequest's overrideMimeType() with the standard
862         https://bugs.webkit.org/show_bug.cgi?id=169276
863
864         Reviewed by Chris Dumez.
865
866         Implement the overrideMimeType() as specified in that standard, i.e.
867         add a check that the passed mime type is valid and if not fallback
868         to application/octet-stream.
869
870         In order for this patch to have any effect, I went ahead and
871         made an improvement to the ContentType parsing, parseContentType now
872         will reject mime types that do not match the type / subtype format, I
873         believe this is required by both RFC2045 and mimesniff specs.
874
875         This behavior matches Chrome and Firefox.
876
877         Test: web-platform-tests/xhr/overridemimetype-invalid-mime-type.htm
878
879         * platform/network/ParsedContentType.cpp:
880         (WebCore::parseContentType):
881         * xml/XMLHttpRequest.cpp:
882         (WebCore::XMLHttpRequest::overrideMimeType):
883
884
885 2018-10-01  Chris Dumez  <cdumez@apple.com>
886
887         Make crossOriginObject.then undefined for promises
888         https://bugs.webkit.org/show_bug.cgi?id=190094
889
890         Reviewed by Darin Adler.
891
892         Make crossOriginObject.then undefined for promises. This allows promises to work better with cross-origin WindowProxy
893         and Location objects.
894
895         Specification:
896         - https://github.com/whatwg/html/pull/3242
897         - https://github.com/whatwg/dom/issues/536
898
899         This aligns our behavior with Blink and Gecko.
900
901         No new tests, rebaselined existing test.
902
903         * bindings/js/JSDOMWindowCustom.cpp:
904         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
905         (WebCore::addCrossOriginWindowOwnPropertyNames):
906         * bindings/js/JSLocationCustom.cpp:
907         (WebCore::getOwnPropertySlotCommon):
908         (WebCore::addCrossOriginLocationOwnPropertyNames):
909
910 2018-10-01  Xan Lopez  <xan@igalia.com>
911
912         [SOUP] Fix the build for libsoup > 2.61.90
913         https://bugs.webkit.org/show_bug.cgi?id=190126
914
915         Reviewed by Michael Catanzaro.
916
917         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
918
919 2018-10-01  Alicia Boya García  <aboya@igalia.com>
920
921         [MSE][GStreamer] Reset running time in PlaybackPipeline::flush()
922         https://bugs.webkit.org/show_bug.cgi?id=190076
923
924         Reviewed by Philippe Normand.
925
926         Test: media/media-source/media-source-seek-redundant-append.html
927
928         PlaybackPipeline::flush() is called when already enqueued frames are
929         appended again. This may be caused by a quality change or just a
930         redundant append. Either way, the pipeline has to be flushed and
931         playback begin again, but without changing the player position by
932         much.
933
934         There are two kinds of time to consider here: stream time (i.e. the
935         time of a frame as written in the file, e.g. a frame may have stream
936         time 0:01:00), and running time (i.e. how much time since playback
937         started should pass before the frame should be played, e.g. if we
938         started playing at 0:00:59 that same frame would have a running time
939         of just 1 second).
940
941         Notice how running time depends on where and when playback starts.
942         Running time can also be optionally resetted after a flush. (This is
943         indeed done currently by most demuxers after a seek.)
944
945         Instead of resetting running time, PlaybackPipeline used to modify the
946         first GstSegment emitted after the flush. A GstSegment declares the
947         mapping between stream time and running time for the following frames.
948         There, PlaybackPipeline used to set `base` (the running time at which
949         the segment starts) to the position reported by a position query
950         (which is stream time).
951
952         This, of course, only worked when playback (or the last seek) started
953         at stream time 0:00:00, since that's the only case where running time
954         equals stream time. In other cases delays as long as the difference
955         between these timelines would appear. This is demonstrated in the
956         attached test, where seeks and appends are made in such an order that
957         the difference is more than 5 minutes, making the playback stall for
958         >5 minutes before playing 1 second of audio.
959
960         This patch fixes the problem by resetting running time with the flush
961         and not modifying GstSegment.base anymore (it will be left as zero,
962         which is now correct since the running time has been reset).
963
964         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
965         (WebCore::PlaybackPipeline::flush):
966         (WebCore::segmentFixerProbe): Deleted.
967
968 2018-09-30  Ryosuke Niwa  <rniwa@webkit.org>
969
970         Use Position instead of Range in createMarkupInternal
971         https://bugs.webkit.org/show_bug.cgi?id=190107
972
973         Reviewed by Darin Adler.
974
975         Use two Position's indicating start and end instead of Range in createMarkupInternal and StylizedMarkupAccumulator
976         in order to support copy & paste across shadow boundaries in the bug 157443. This patch also removes the use of
977         Range in MarkupAccumulator since all uses of range is via StylizedMarkupAccumulator.
978
979         Also renamed createMarkupInternal to serializePreservingVisualAppearanceInternal to match the rename in r236612.
980
981         * dom/Position.cpp:
982         (WebCore::Position::firstNode const):  Added.
983         * dom/Position.h:
984         * editing/MarkupAccumulator.cpp:
985         (WebCore::MarkupAccumulator::MarkupAccumulator): No longer takes Range.
986         (WebCore::MarkupAccumulator::appendText): Removed the code to truncate string at the boundary points of the range.
987         * editing/MarkupAccumulator.h:
988         (WebCore::MarkupAccumulator): Made this class non-copyable.
989         * editing/markup.cpp:
990         (WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator): Now takes and stores two positions.
991
992         (WebCore::StyledMarkupAccumulator::appendText): Use textContentRespectingRange in the case annotation is disabled
993         instead of calling to MarkupAccumulator::appendText, which no longer respects boundary offsets.
994
995         (WebCore::StyledMarkupAccumulator::renderedTextRespectingRange): Renamed from renderedText. Updated to respect
996         boundary offsets defined by m_start and m_end Positions instead of m_range Range.
997
998         (WebCore::StyledMarkupAccumulator::textContentRespectingRange): Renamed from stringValueForRange. Ditto.
999
1000         (WebCore::StyledMarkupAccumulator::serializeNodes): Now computes startNode and pastEnd nodes from start and end
1001         Positions. Note that the end position is always the next node in the tree order  for a character node
1002         and computeNodeAfterPosition returns nullptr for a character data.
1003
1004         (WebCore::highestAncestorToWrapMarkup): Now takes two positions instead of a range.
1005
1006         (WebCore::serializePreservingVisualAppearanceInternal): Renamed from createMarkupInternal. Removed the obsolete
1007         comments which were added for DOMRange in WebKitLegacy.
1008
1009         (WebCore::serializePreservingVisualAppearance):
1010
1011         (WebCore::sanitizedMarkupForFragmentInDocument): Create positions instead of a range to pass to
1012         serializePreservingVisualAppearanceInternal.
1013
1014         (WebCore::serializeFragment):
1015
1016         * editing/markup.h:
1017         * page/PageSerializer.cpp:
1018         (WebCore::PageSerializer::SerializerMarkupAccumulator): Removed the unnecessary WebCore namespace qualifier.
1019
1020 2018-09-30  Walker Henderson  <wjahenderson@gmail.com>
1021
1022         AudioNode.connect should return passed destination node
1023         https://bugs.webkit.org/show_bug.cgi?id=188834
1024
1025         Reviewed by Eric Carlson.
1026
1027         No new tests, rebaselined existing test.
1028
1029         * Modules/webaudio/AudioBasicInspectorNode.cpp:
1030         (WebCore::AudioBasicInspectorNode::connect): Deleted.
1031         * Modules/webaudio/AudioBasicInspectorNode.h:
1032         * Modules/webaudio/AudioNode.cpp:
1033         * Modules/webaudio/AudioNode.h:
1034         * Modules/webaudio/AudioNode.idl:
1035
1036 2018-09-30  Eric Carlson  <eric.carlson@apple.com>
1037
1038         [MediaStream] Clean up RealtimeMediaSource settings change handling
1039         https://bugs.webkit.org/show_bug.cgi?id=189998
1040         <rdar://problem/44797884>
1041
1042         Reviewed by Youenn Fablet.
1043
1044         No new tests, updated webrtc/video-disabled-black.html.
1045
1046         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
1047         (WebCore::CanvasCaptureMediaStreamTrack::Source::Source):
1048         (WebCore::CanvasCaptureMediaStreamTrack::Source::settings):
1049         (WebCore::CanvasCaptureMediaStreamTrack::Source::settingsDidChange):
1050         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
1051         * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
1052         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
1053         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
1054         (WebCore::RealtimeIncomingVideoSource::settings):
1055         (WebCore::RealtimeIncomingVideoSource::settingsDidChange):
1056         * platform/mediastream/RealtimeIncomingVideoSource.h:
1057         * platform/mediastream/RealtimeMediaSource.cpp:
1058         (WebCore::RealtimeMediaSource::settingsDidChange):
1059         (WebCore::RealtimeMediaSource::notifySettingsDidChangeObservers):
1060         (WebCore::RealtimeMediaSource::setSize):
1061         (WebCore::RealtimeMediaSource::setFrameRate):
1062         (WebCore::RealtimeMediaSource::setAspectRatio):
1063         (WebCore::RealtimeMediaSource::setFacingMode):
1064         (WebCore::RealtimeMediaSource::setVolume):
1065         (WebCore::RealtimeMediaSource::setSampleRate):
1066         (WebCore::RealtimeMediaSource::setSampleSize):
1067         (WebCore::RealtimeMediaSource::setEchoCancellation):
1068         * platform/mediastream/RealtimeMediaSource.h:
1069         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
1070         (WebCore::GStreamerAudioCaptureSource::settingsDidChange):
1071         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
1072         (WebCore::GStreamerVideoCaptureSource::settingsDidChange):
1073         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1074         (WebCore::AVVideoCaptureSource::settingsDidChange):
1075         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1076         (WebCore::CoreAudioCaptureSource::settingsDidChange):
1077         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
1078         (WebCore::DisplayCaptureSourceCocoa::settingsDidChange):
1079         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
1080         (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
1081         * platform/mock/MockRealtimeAudioSource.cpp:
1082         (WebCore::MockRealtimeAudioSource::settingsDidChange):
1083         * platform/mock/MockRealtimeVideoSource.cpp:
1084         (WebCore::MockRealtimeVideoSource::settingsDidChange):
1085
1086 2018-09-30  Eric Carlson  <eric.carlson@apple.com>
1087
1088         [MediaStream] Use display-specific capture factories
1089         https://bugs.webkit.org/show_bug.cgi?id=190043
1090         <rdar://problem/44834412>
1091
1092         Reviewed by Youenn Fablet.
1093
1094         No new tests, no change in functionality.
1095
1096         * Sources.txt:
1097         * WebCore.xcodeproj/project.pbxproj:
1098         * platform/mediastream/RealtimeMediaSource.cpp:
1099         (WebCore::RealtimeMediaSource::AudioCaptureFactory::~AudioCaptureFactory): Deleted.
1100         (WebCore::RealtimeMediaSource::VideoCaptureFactory::~VideoCaptureFactory): Deleted.
1101         * platform/mediastream/RealtimeMediaSource.h:
1102         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
1103         (WebCore::RealtimeMediaSourceCenter::createMediaStream):
1104         (WebCore::RealtimeMediaSourceCenter::getDisplayMediaDevices):
1105         * platform/mediastream/RealtimeMediaSourceCenter.h:
1106         (WebCore::RealtimeMediaSourceCenter::setAudioFactory):
1107         (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
1108         * platform/mediastream/RealtimeMediaSourceFactory.cpp: Added.
1109         (WebCore::SingleSourceFactory::setActiveSource):
1110         (WebCore::SingleSourceFactory::unsetActiveSource):
1111         * platform/mediastream/RealtimeMediaSourceFactory.h: Added.
1112         (WebCore::SingleSourceFactory::activeSource):
1113         (WebCore::VideoCaptureFactory::setVideoCapturePageState):
1114         (WebCore::DisplayCaptureFactory::setDisplayCapturePageState):
1115         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
1116         (WebCore::libWebRTCVideoCaptureSourceFactory):
1117         (WebCore::libWebRTCDisplayCaptureSourceFactory):
1118         (WebCore::GStreamerVideoCaptureSource::factory):
1119         (WebCore::GStreamerVideoCaptureSource::displayFactory):
1120         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
1121         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
1122         (WebCore::RealtimeMediaSourceCenterLibWebRTC::audioCaptureSourceFactory):
1123         (WebCore::RealtimeMediaSourceCenterLibWebRTC::audioFactory):
1124         (WebCore::RealtimeMediaSourceCenterLibWebRTC::videoFactory):
1125         (WebCore::RealtimeMediaSourceCenterLibWebRTC::displayCaptureFactory):
1126         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h:
1127         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1128         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
1129         (WebCore::AVVideoCaptureSource::setupCaptureSession):
1130         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1131         (WebCore::CoreAudioCaptureSource::factory):
1132         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1133         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
1134         (WebCore::RealtimeMediaSourceCenterMac::videoCaptureSourceFactory):
1135         (WebCore::RealtimeMediaSourceCenterMac::displayCaptureSourceFactory):
1136         (WebCore::RealtimeMediaSourceCenterMac::audioCaptureSourceFactory):
1137         (WebCore::RealtimeMediaSourceCenterMac::audioFactory):
1138         (WebCore::RealtimeMediaSourceCenterMac::videoFactory):
1139         (WebCore::RealtimeMediaSourceCenterMac::displayCaptureFactory):
1140         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
1141         * platform/mock/MockRealtimeAudioSource.cpp:
1142         (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
1143         (WebCore::MockRealtimeAudioSource::startProducingData):
1144         (): Deleted.
1145         (WebCore::mockAudioCaptureSourceFactory): Deleted.
1146         (WebCore::MockRealtimeAudioSource::factory): Deleted.
1147         * platform/mock/MockRealtimeAudioSource.h:
1148         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1149         (WebCore::MockRealtimeVideoSourceFactory::setVideoCapturePageState):
1150         (WebCore::MockRealtimeMediaSourceCenter::audioFactory):
1151         (WebCore::MockRealtimeMediaSourceCenter::videoFactory):
1152         (WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactory):
1153         * platform/mock/MockRealtimeMediaSourceCenter.h:
1154         * platform/mock/MockRealtimeVideoSource.cpp:
1155         (): Deleted.
1156         (WebCore::MockRealtimeVideoSourceFactory::setVideoCapturePageState): Deleted.
1157         (WebCore::mockVideoCaptureSourceFactory): Deleted.
1158         (WebCore::MockRealtimeVideoSource::factory): Deleted.
1159         * platform/mock/MockRealtimeVideoSource.h:
1160
1161 2018-09-29  Oriol Brufau  <obrufau@igalia.com>
1162
1163         [css-grid] Properly align items next to collapsed tracks with gutters
1164         https://bugs.webkit.org/show_bug.cgi?id=190089
1165
1166         Reviewed by Manuel Rego Casasnovas.
1167
1168         gridAreaPositionForInFlowChild could return a wrong end position for
1169         grid items adjacent to a collapsed track, because it didn't take into
1170         account that gutters collapse in that case. Therefore, "center" or
1171         "end" alignments displayed the item at the wrong position.
1172
1173         Test: imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-013.html
1174
1175         * rendering/RenderGrid.cpp:
1176         (WebCore::RenderGrid::gridAreaPositionForInFlowChild const):
1177
1178 2018-09-29  Alicia Boya García  <aboya@igalia.com>
1179
1180         [GStreamer][MSE] Use GObject for GST_TRACE_OBJECT
1181         https://bugs.webkit.org/show_bug.cgi?id=190045
1182
1183         Reviewed by Philippe Normand.
1184
1185         Passing a non-GObject object to GST_TRACE_OBJECT() can be
1186         theoretically misunderstood by the GStreamer logging function, so this
1187         patch avoids that.
1188
1189         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1190         (WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe):
1191         (WebCore::AppendPipeline::handleEndOfAppend):
1192         (WebCore::AppendPipeline::consumeAppsinkAvailableSamples):
1193         (WebCore::AppendPipeline::pushNewBuffer):
1194
1195 2018-09-28  Zamiul Haque  <zhaque@apple.com>
1196
1197         Angled gradient backgrounds in body render vertically when body height is 0
1198         https://bugs.webkit.org/show_bug.cgi?id=177232
1199         <rdar://problem/34548230>.
1200
1201         Reviewed by Tim Horton.
1202
1203         Specifically, gradients displayed at an angle (ie. 45 degrees) are rendered
1204         as if they are vertical when the body tag containing the gradient
1205         has a height of 0. Other browsers do not render under these circumstances,
1206         so WebKit was modified to follow in suit. The problem was due to layout sizes for
1207         fill tiles being calculated with a minimum height of 1px. A simple change of the
1208         minimum height and width to 0px was enough to bring about the desired behavior.
1209
1210         Tests: angled-background-repeating-gradient-rendering-vertical.html
1211
1212         * rendering/RenderBoxModelObject.cpp:
1213         (WebCore::RenderBoxModelObject::calculateFillTileSize const):
1214
1215 2018-09-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1216
1217         No DOM API to instantiate an attachment for an img element
1218         https://bugs.webkit.org/show_bug.cgi?id=189934
1219         <rdar://problem/44743222>
1220
1221         Reviewed by Ryosuke Niwa.
1222
1223         Adds support for HTMLAttachmentElement.getAttachmentIdentifier, a function that internal WebKit clients can use
1224         to ensure that an image element is backed by a unique _WKAttachment. See below for more details.
1225
1226         Tests:  WKAttachmentTests.AddAttachmentToConnectedImageElement
1227                 WKAttachmentTests.ChangeFileWrapperForPastedImage
1228                 WKAttachmentTests.ConnectImageWithAttachmentToDocument
1229
1230         * dom/Document.cpp:
1231         (WebCore::Document::registerAttachmentIdentifier):
1232
1233         Add a new hook to register an empty _WKAttachment in the UI process with a given identifier. Used when creating
1234         a new empty attachment to back an image element.
1235
1236         * dom/Document.h:
1237         * editing/Editor.cpp:
1238         (WebCore::Editor::registerAttachmentIdentifier):
1239         (WebCore::Editor::notifyClientOfAttachmentUpdates):
1240         * editing/Editor.h:
1241         * html/HTMLAttachmentElement.cpp:
1242         (WebCore::HTMLAttachmentElement::getAttachmentIdentifier):
1243
1244         Creates an attachment element to back the image element, if an attachment does not already exist, and returns
1245         the unique identifier. This also causes an empty corresponding _WKAttachment to be created in the client, whose
1246         file wrapper determines the contents of the image.
1247
1248         (WebCore::HTMLAttachmentElement::ensureUniqueIdentifier):
1249         (WebCore::HTMLAttachmentElement::hasEnclosingImage const):
1250         (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
1251
1252         Add a helper that updates the source of the enclosing image element given a content type and image data, by
1253         creating a new blob and blob URL.
1254
1255         * html/HTMLAttachmentElement.h:
1256         * html/HTMLAttachmentElement.idl:
1257         * html/HTMLImageElement.idl:
1258
1259         Rename webkitAttachmentIdentifier to just attachmentIdentifier.
1260
1261         * page/EditorClient.h:
1262         (WebCore::EditorClient::registerAttachmentIdentifier):
1263         (WebCore::EditorClient::didInsertAttachmentWithIdentifier):
1264
1265 2018-09-28  Chris Dumez  <cdumez@apple.com>
1266
1267         The return value of an OnBeforeUnloadEventHandler should always be coerced into a DOMString
1268         https://bugs.webkit.org/show_bug.cgi?id=190090
1269
1270         Reviewed by Ryosuke Niwa.
1271
1272         The return value of an OnBeforeUnloadEventHandler should always be coerced into a DOMString:
1273         - https://html.spec.whatwg.org/#onbeforeunloadeventhandler
1274         - https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (Step 5)
1275
1276         In particular, this means that returning false in an OnBeforeUnloadEventHandler should NOT
1277         cancel the event when the event is a CustomEvent (and not a BeforeUnloadEvent). This is
1278         because the return value cannot be false at:
1279         - https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (Step 5. Otherwise case).
1280
1281         No new tests, rebaselined existing test.
1282
1283         * bindings/js/JSEventListener.cpp:
1284         (WebCore::JSEventListener::handleEvent):
1285
1286 2018-09-28  Simon Fraser  <simon.fraser@apple.com>
1287
1288         RenderLayer::removeOnlyThisLayer() should not call updateLayerPositions()
1289         https://bugs.webkit.org/show_bug.cgi?id=190093
1290
1291         Reviewed by Dean Jackson and Zalan Bujtas.
1292         
1293         It's wrong for RenderLayer::removeOnlyThisLayer() to call updateLayerPositions(),
1294         because this is called at style update time, and layout will be stale.
1295         
1296         It was added (see webkit.org/b/25252) so that opacity changes, which can destroy layers, correctly update
1297         descendants. However, RenderStyle::changeRequiresLayout() checks for opacity <=> no opacity
1298         changes and triggers layout accordingly, which will result in a full post-layout
1299         updateLayerPositions().
1300         
1301         This also revealed that changes to the "isolate" property fail to trigger any kind of style recalc or layout;
1302         we need it to trigger layout (for now) because it affects z-order.
1303
1304         Covered by existing tests.
1305
1306         * rendering/RenderLayer.cpp:
1307         (WebCore::RenderLayer::removeOnlyThisLayer):
1308         * rendering/style/RenderStyle.cpp:
1309         (WebCore::RenderStyle::changeRequiresLayout const):
1310
1311 2018-09-28  Jiewen Tan  <jiewen_tan@apple.com>
1312
1313         [WebAuthN] Polish WebAuthN auto-test environment
1314         https://bugs.webkit.org/show_bug.cgi?id=189283
1315         <rdar://problem/44117828>
1316
1317         Reviewed by Chris Dumez.
1318
1319         This patch removes the old mocking mechanism.
1320
1321         Tests: http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https.html
1322                http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https.html
1323                http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https.html
1324
1325         * DerivedSources.make:
1326         * WebCore.xcodeproj/project.pbxproj:
1327         * testing/Internals.cpp:
1328         (WebCore::Internals::Internals):
1329         (WebCore::Internals::mockAuthenticatorCoordinator const): Deleted.
1330         * testing/Internals.h:
1331         * testing/Internals.idl:
1332         * testing/MockAuthenticatorCoordinator.cpp: Removed.
1333         * testing/MockAuthenticatorCoordinator.h: Removed.
1334         * testing/MockAuthenticatorCoordinator.idl: Removed.
1335
1336 2018-09-28  Jer Noble  <jer.noble@apple.com>
1337
1338         Refactoring: eliminate raw pointer usage in Fullscreen code
1339         https://bugs.webkit.org/show_bug.cgi?id=188747
1340         <rdar://problem/43541164>
1341
1342         Reviewed by Alex Christensen.
1343
1344         Two sources of raw pointers in the Fullscreen code:
1345         - Model classes (PlaybackSessionModel and VideoFullscreenModel) aren't ref-able, so
1346           they are passed around as raw references.
1347         - Observer classes (PlaybackSessionModelClient and VideoFullscreenModelClient, and
1348           VideoFullscreenChangeObserver) are also passed around as raw pointers, but shouldn't
1349           be ref-able.
1350
1351         Make Model classes ref-able by adding ref() and deref() which call virtual refModel and
1352         derefModel methods, overridden by implementing subclasses. Make every concrete observer
1353         inherit from CanMakeWeakPtr, and every registration method take WeakPtr wrappers around
1354         the client interface.
1355
1356         Since every Interface class now holds a strong reference to its Model classes, and each
1357         Model class holds a weak reference to all its clients, no explicit invalidate() method
1358         is necessary.
1359
1360         Notes:
1361
1362         - Since the weak pointer methods need to be able to downcast to the abstract base class,
1363           observers need to inherit publically (rather than privately) from those base classes.
1364         - Media element Models should compose EventListener rather than inheriting from it, since
1365           EventListener has its own RefCount.
1366         - WeakPtrs can't be held in HashSets (because they change value, and therefore hash, when
1367           their underlying object is destroyed), so clients should be stored in a Vector instead.
1368         - Interfaces should be given all required Refs at creation time, so that they can store
1369           those parameters as Refs instead of RefPtrs.
1370
1371         * platform/cocoa/PlaybackSessionInterface.h:
1372         (WebCore::PlaybackSessionInterface::~PlaybackSessionInterface): Deleted.
1373         * platform/cocoa/PlaybackSessionModel.h:
1374         (WebCore::PlaybackSessionModel::ref):
1375         (WebCore::PlaybackSessionModel::deref):
1376         (WebCore::PlaybackSessionModel::~PlaybackSessionModel): Deleted.
1377         * platform/cocoa/PlaybackSessionModelMediaElement.h:
1378         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
1379         (WebCore::PlaybackSessionModelMediaElement::PlaybackSessionModelMediaElement):
1380         (WebCore::PlaybackSessionModelMediaElement::~PlaybackSessionModelMediaElement):
1381         (WebCore::PlaybackSessionModelMediaElement::setMediaElement):
1382         (WebCore::PlaybackSessionModelMediaElement::updateForEventName):
1383         (WebCore::PlaybackSessionModelMediaElement::addClient):
1384         (WebCore::PlaybackSessionModelMediaElement::removeClient):
1385         (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions):
1386         (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionIndices):
1387         (WebCore::PlaybackSessionModelMediaElement::handleEvent): Deleted.
1388         * platform/cocoa/VideoFullscreenChangeObserver.h:
1389         (WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver): Deleted.
1390         * platform/cocoa/VideoFullscreenModel.h:
1391         (WebCore::VideoFullscreenModel::ref):
1392         (WebCore::VideoFullscreenModel::deref):
1393         (WebCore::VideoFullscreenModel::~VideoFullscreenModel): Deleted.
1394         * platform/cocoa/VideoFullscreenModelVideoElement.h:
1395         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
1396         (VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement):
1397         (VideoFullscreenModelVideoElement::setVideoElement):
1398         (VideoFullscreenModelVideoElement::addClient):
1399         (VideoFullscreenModelVideoElement::removeClient):
1400         (VideoFullscreenModelVideoElement::setHasVideo):
1401         (VideoFullscreenModelVideoElement::setVideoDimensions):
1402         (VideoFullscreenModelVideoElement::willEnterPictureInPicture):
1403         (VideoFullscreenModelVideoElement::didEnterPictureInPicture):
1404         (VideoFullscreenModelVideoElement::failedToEnterPictureInPicture):
1405         (VideoFullscreenModelVideoElement::willExitPictureInPicture):
1406         (VideoFullscreenModelVideoElement::didExitPictureInPicture):
1407         (VideoFullscreenModelVideoElement::handleEvent): Deleted.
1408         * platform/ios/PlaybackSessionInterfaceAVKit.h:
1409         (WebCore::PlaybackSessionInterfaceAVKit::create):
1410         (WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const):
1411         (): Deleted.
1412         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
1413         (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
1414         (WebCore::PlaybackSessionInterfaceAVKit::~PlaybackSessionInterfaceAVKit):
1415         (WebCore::PlaybackSessionInterfaceAVKit::invalidate): Deleted.
1416         * platform/ios/VideoFullscreenInterfaceAVKit.h:
1417         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1418         (-[WebAVPlayerLayer layoutSublayers]):
1419         (-[WebAVPlayerLayer resolveBounds]):
1420         (-[WebAVPlayerLayer setVideoGravity:]):
1421         (VideoFullscreenInterfaceAVKit::create):
1422         (VideoFullscreenInterfaceAVKit::VideoFullscreenInterfaceAVKit):
1423         (VideoFullscreenInterfaceAVKit::~VideoFullscreenInterfaceAVKit):
1424         (VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver):
1425         (VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
1426         (VideoFullscreenInterfaceAVKit::setupFullscreen):
1427         (VideoFullscreenInterfaceAVKit::presentingViewController):
1428         (VideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
1429         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
1430         (VideoFullscreenInterfaceAVKit::willStartPictureInPicture):
1431         (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
1432         (VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture):
1433         (VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
1434         (VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
1435         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
1436         (VideoFullscreenInterfaceAVKit::doSetup):
1437         (VideoFullscreenInterfaceAVKit::setMode):
1438         (VideoFullscreenInterfaceAVKit::clearMode):
1439         (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel): Deleted.
1440         (VideoFullscreenInterfaceAVKit::invalidate): Deleted.
1441         * platform/ios/WebAVPlayerController.h:
1442         * platform/ios/WebAVPlayerController.mm:
1443         (-[WebAVPlayerController delegate]):
1444         (-[WebAVPlayerController playbackSessionInterface]):
1445         (-[WebAVPlayerController setPlaybackSessionInterface:]):
1446         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1447         (VideoFullscreenControllerContext::didCleanupFullscreen):
1448         (VideoFullscreenControllerContext::addClient):
1449         (VideoFullscreenControllerContext::removeClient):
1450         (VideoFullscreenControllerContext::willEnterPictureInPicture):
1451         (VideoFullscreenControllerContext::didEnterPictureInPicture):
1452         (VideoFullscreenControllerContext::failedToEnterPictureInPicture):
1453         (VideoFullscreenControllerContext::willExitPictureInPicture):
1454         (VideoFullscreenControllerContext::didExitPictureInPicture):
1455         (VideoFullscreenControllerContext::setUpFullscreen):
1456         * platform/mac/PlaybackSessionInterfaceMac.h:
1457         * platform/mac/PlaybackSessionInterfaceMac.mm:
1458         (WebCore::PlaybackSessionInterfaceMac::create):
1459         (WebCore::PlaybackSessionInterfaceMac::PlaybackSessionInterfaceMac):
1460         (WebCore::PlaybackSessionInterfaceMac::playbackSessionModel const):
1461         (WebCore::PlaybackSessionInterfaceMac::rateChanged):
1462         (WebCore::PlaybackSessionInterfaceMac::beginScrubbing):
1463         (WebCore::PlaybackSessionInterfaceMac::endScrubbing):
1464         (WebCore::PlaybackSessionInterfaceMac::setPlayBackControlsManager):
1465         (WebCore::PlaybackSessionInterfaceMac::updatePlaybackControlsManagerTiming):
1466         (WebCore::PlaybackSessionInterfaceMac::~PlaybackSessionInterfaceMac): Deleted.
1467         (WebCore::PlaybackSessionInterfaceMac::invalidate): Deleted.
1468         * platform/mac/VideoFullscreenInterfaceMac.h:
1469         (WebCore::VideoFullscreenInterfaceMac::create):
1470         (WebCore::VideoFullscreenInterfaceMac::videoFullscreenModel const):
1471         (WebCore::VideoFullscreenInterfaceMac::playbackSessionModel const):
1472         (WebCore::VideoFullscreenInterfaceMac::videoFullscreenChangeObserver const):
1473         * platform/mac/VideoFullscreenInterfaceMac.mm:
1474         (-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]):
1475         (-[WebVideoFullscreenInterfaceMacObjC boundsDidChangeForVideoViewContainer:]):
1476         (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
1477         (-[WebVideoFullscreenInterfaceMacObjC pipActionPlay:]):
1478         (-[WebVideoFullscreenInterfaceMacObjC pipActionPause:]):
1479         (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]):
1480         (WebCore::VideoFullscreenInterfaceMac::VideoFullscreenInterfaceMac):
1481         (WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac):
1482         (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenChangeObserver):
1483         (WebCore::VideoFullscreenInterfaceMac::setMode):
1484         (WebCore::VideoFullscreenInterfaceMac::clearMode):
1485         (WebCore::VideoFullscreenInterfaceMac::invalidate):
1486         (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP):
1487         (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenModel): Deleted.
1488         * platform/mac/WebPlaybackControlsManager.mm:
1489         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
1490         (-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]):
1491         (-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]):
1492         (-[WebPlaybackControlsManager togglePlayback]):
1493         (-[WebPlaybackControlsManager setPlaying:]):
1494         (-[WebPlaybackControlsManager isPlaying]):
1495         (-[WebPlaybackControlsManager togglePictureInPicture]):
1496
1497 2018-09-28  Chris Dumez  <cdumez@apple.com>
1498
1499         Drop support for cross-origin-window-policy header
1500         https://bugs.webkit.org/show_bug.cgi?id=190081
1501
1502         Reviewed by Ryosuke Niwa.
1503
1504         Drop support for cross-origin-window-policy header as this was never enabled and its design has
1505         some issues we have not resolved. An alternative is being worked on but will be substantially
1506         different so there is not much value in keeping this code around.
1507
1508         * bindings/js/JSDOMBindingSecurity.cpp:
1509         * bindings/js/JSDOMBindingSecurity.h:
1510         * bindings/js/JSDOMWindowCustom.cpp:
1511         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
1512         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
1513         (WebCore::addCrossOriginWindowPropertyNames):
1514         (WebCore::addScopedChildrenIndexes):
1515         (WebCore::addCrossOriginWindowOwnPropertyNames):
1516         (WebCore::JSDOMWindow::getOwnPropertyNames):
1517         * bindings/js/JSDOMWindowCustom.h:
1518         * bindings/js/JSRemoteDOMWindowCustom.cpp:
1519         * bindings/scripts/CodeGeneratorJS.pm:
1520         (GenerateAttributeGetterBodyDefinition):
1521         (GenerateAttributeSetterBodyDefinition):
1522         (GenerateOperationBodyDefinition):
1523         * bindings/scripts/IDLAttributes.json:
1524         * dom/Document.cpp:
1525         (WebCore::Document::canNavigate):
1526         * loader/FrameLoader.cpp:
1527         (WebCore::FrameLoader::didBeginDocument):
1528         * page/AbstractDOMWindow.cpp:
1529         (WebCore::AbstractDOMWindow::AbstractDOMWindow):
1530         * page/AbstractDOMWindow.h:
1531         * page/DOMWindow.idl:
1532         * page/Settings.yaml:
1533         * platform/network/HTTPParsers.cpp:
1534         * platform/network/HTTPParsers.h:
1535
1536 2018-09-28  Daniel Bates  <dabates@apple.com>
1537
1538         [iOS] Allow programmatic focus when hardware keyboard is attached
1539         https://bugs.webkit.org/show_bug.cgi?id=190017
1540         <rdar://problem/42270463>
1541
1542         Reviewed by Wenson Hsieh.
1543
1544         Add support for checking if the embedding client is WebKitTestRunner and export isDumpRenderTree()
1545         so that we can make use of it from WebKit. We will make use of these functions to keep the current
1546         behavior of disallowing programmatic focus when running tests in these apps. This is needed to
1547         keep testing deterministic. Otherwise, test results would be dependent on whether a hardware
1548         keyboard is attached. When running tests in Simulator.app the hardware keyboard may also not be
1549         connected (i.e. Hardware > Keyboard > Connect Hardware Keyboard is disabled).
1550
1551         * platform/RuntimeApplicationChecks.h:
1552         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
1553         (WebCore::IOSApplication::isWebKitTestRunner): Added.
1554
1555 2018-09-28  Ryosuke Niwa  <rniwa@webkit.org>
1556
1557         REGRESSION(r236609): API tests for mso list preservation are failing
1558         https://bugs.webkit.org/show_bug.cgi?id=190095
1559
1560         Reviewed by Wenson Hsieh.
1561
1562         The regression was caused by appendNodeToPreserveMSOList called after an early return for not having renderer.
1563         Clearly, comment & style elements coming from a MS word document wouldn't have a renderer.
1564
1565         Fixed the bug by changing the order.
1566
1567         * editing/markup.cpp:
1568         (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
1569
1570 2018-09-28  Ryosuke Niwa  <rniwa@webkit.org>
1571
1572         Build fix after r236612.
1573
1574         * platform/win/PasteboardWin.cpp:
1575         (WebCore::Pasteboard::writeSelection):
1576
1577 2018-09-28  Andy Estes  <aestes@apple.com>
1578
1579         [Apple Pay] Remove the "in-store" button type
1580         https://bugs.webkit.org/show_bug.cgi?id=190079
1581
1582         Reviewed by Tim Horton.
1583
1584         According to <https://developer.apple.com/design/human-interface-guidelines/apple-pay/buttons-and-marks/buttons/>,
1585         this button is meant only for certain kinds of native apps. It shouldn't be available on the web.
1586
1587         Updated http/tests/ssl/applepay/ApplePayButton.html.
1588
1589         * css/CSSPrimitiveValueMappings.h:
1590         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1591         (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const):
1592         * css/CSSValueKeywords.in:
1593         * css/parser/CSSParserFastPaths.cpp:
1594         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1595         * rendering/RenderThemeCocoa.mm:
1596         (WebCore::toPKPaymentButtonType):
1597         * rendering/style/RenderStyleConstants.h:
1598
1599 2018-09-28  Chris Dumez  <cdumez@apple.com>
1600
1601         document.open() should throw errors for cross-origin calls
1602         https://bugs.webkit.org/show_bug.cgi?id=189371
1603         <rdar://problem/44282700>
1604
1605         Reviewed by Youenn Fablet.
1606
1607         document.open() / document.write() should throw errors for cross-origin calls as per:
1608         - https://html.spec.whatwg.org/#document-open-steps (Step 4)
1609
1610         No new tests, rebaselined existing tests.
1611
1612         * dom/Document.cpp:
1613         (WebCore::Document::open):
1614         (WebCore::Document::write):
1615         (WebCore::Document::writeln):
1616         * dom/Document.h:
1617
1618 2018-09-28  Ryosuke Niwa  <rniwa@webkit.org>
1619
1620         Rename createMarkup to serializePreservingVisualAppearance
1621         https://bugs.webkit.org/show_bug.cgi?id=190086
1622
1623         Reviewed by Wenson Hsieh.
1624
1625         Renamed the function to clarify what it does. Also removed the unused Range::toHTML.
1626
1627         * dom/Range.cpp:
1628         (WebCore::Range::toHTML const): Deleted.
1629         * dom/Range.h:
1630         * editing/CompositeEditCommand.cpp:
1631         (WebCore::CompositeEditCommand::moveParagraphs):
1632         * editing/cocoa/EditorCocoa.mm:
1633         (WebCore::Editor::selectionInHTMLFormat):
1634         * editing/gtk/EditorGtk.cpp:
1635         (WebCore::Editor::writeSelectionToPasteboard):
1636         * editing/markup.cpp:
1637         (WebCore::serializePreservingVisualAppearance):
1638         (WebCore::createMarkup): Deleted.
1639         * editing/markup.h:
1640         * editing/wpe/EditorWPE.cpp:
1641         (WebCore::Editor::writeSelectionToPasteboard):
1642         * loader/archive/cf/LegacyWebArchive.cpp:
1643         (WebCore::LegacyWebArchive::create):
1644         (WebCore::LegacyWebArchive::createFromSelection):
1645         * platform/win/PasteboardWin.cpp:
1646         (WebCore::Pasteboard::writeRangeToDataObject):
1647
1648 2018-09-28  Simon Fraser  <simon.fraser@apple.com>
1649
1650         Remove some unused RenderLayer code
1651         https://bugs.webkit.org/show_bug.cgi?id=190078
1652
1653         Reviewed by Zalan Bujtas.
1654
1655         The 'outOfFlowDescendantContainingBlocks' code was related to the accelerated overflow scrolling code that
1656         I removed recently.
1657         
1658         updateDescendantsLayerListsIfNeeded() is never called.
1659
1660         * rendering/RenderLayer.cpp:
1661         (WebCore::RenderLayer::updateDescendantDependentFlags):
1662         (WebCore::RenderLayer::calculateClipRects const):
1663         * rendering/RenderLayer.h:
1664
1665 2018-09-28  Commit Queue  <commit-queue@webkit.org>
1666
1667         Unreviewed, rolling out r236605.
1668         https://bugs.webkit.org/show_bug.cgi?id=190087
1669
1670         caused three API test timeouts (Requested by jernoble on
1671         #webkit).
1672
1673         Reverted changeset:
1674
1675         "Refactoring: eliminate raw pointer usage in Fullscreen code"
1676         https://bugs.webkit.org/show_bug.cgi?id=188747
1677         https://trac.webkit.org/changeset/236605
1678
1679 2018-09-28  Ryosuke Niwa  <rniwa@webkit.org>
1680
1681         Simplify StyledMarkupAccumulator::traverseNodesForSerialization
1682         https://bugs.webkit.org/show_bug.cgi?id=190073
1683
1684         Reviewed by Antti Koivisto.
1685
1686         Simplified the range traversal algorithm in traverseNodesForSerialization as it was too complicated
1687         to support shadow DOM for copy and paste.
1688
1689         Instead of using NodeTraversal::next to traverse past ancestors and then figuring out which ancestor
1690         must be closed or to wrap the existing markup with, new code collects the list of ancestors as we
1691         traverse out of them.
1692
1693         Also extracted lambdas for generating markup and deciding whether to skip a node as well as keeping
1694         track of the depth of the current markup. This further reduces the code complexity of the actual
1695         node traversal algorithm. Keeping track of the depth allows us to now generate ancestor elements'
1696         closing tags without keeping a stack of ancestor nodes we opened at all times.
1697
1698         * editing/markup.cpp:
1699         (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
1700
1701 2018-09-27  Ryosuke Niwa  <rniwa@webkit.org>
1702
1703         Replace every use of Node::offsetInCharacters() by Node::isCharacterDataNode()
1704         https://bugs.webkit.org/show_bug.cgi?id=190069
1705
1706         Reviewed by Zalan Bujtas.
1707
1708         Removed Node::offsetInCharacters() and replaced every use of it by isCharacterDataNode()
1709         because their implementations are identical.
1710
1711         Note that offsetInCharacters() sounds like a function which returns some kind of an offset
1712         but it doesn't. It returns true when called on a CharacterData and false elsewhere.
1713
1714         * accessibility/AXObjectCache.cpp:
1715         (WebCore::characterOffsetsInOrder):
1716         (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
1717         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
1718         * dom/CharacterData.cpp:
1719         (WebCore::CharacterData::offsetInCharacters const): Deleted.
1720         * dom/CharacterData.h:
1721         * dom/Node.cpp:
1722         (WebCore::Node::offsetInCharacters const): Deleted.
1723         * dom/Node.h:
1724         * dom/Position.cpp:
1725         (WebCore::Position::parentAnchoredEquivalent const):
1726         * dom/Position.h:
1727         (WebCore::lastOffsetInNode):
1728         (WebCore::minOffsetForNode):
1729         (WebCore::offsetIsBeforeLastNodeOffset):
1730         * dom/Range.cpp:
1731         (WebCore::Range::firstNode const):
1732         (WebCore::Range::pastLastNode const):
1733         * dom/RangeBoundaryPoint.h:
1734         (WebCore::RangeBoundaryPoint::setOffset):
1735         (WebCore::RangeBoundaryPoint::setToEndOfNode):
1736         * editing/Editing.cpp:
1737         (WebCore::lastOffsetForEditing):
1738         * editing/TextIterator.cpp:
1739         (WebCore::nextInPreOrderCrossingShadowBoundaries):
1740         (WebCore::TextIterator::node const):
1741         (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
1742         * page/DOMSelection.cpp:
1743         (WebCore::DOMSelection::extend):
1744
1745 2018-09-28  Jer Noble  <jer.noble@apple.com>
1746
1747         Refactoring: eliminate raw pointer usage in Fullscreen code
1748         https://bugs.webkit.org/show_bug.cgi?id=188747
1749         <rdar://problem/43541164>
1750
1751         Reviewed by Alex Christensen.
1752
1753         Two sources of raw pointers in the Fullscreen code:
1754         - Model classes (PlaybackSessionModel and VideoFullscreenModel) aren't ref-able, so
1755           they are passed around as raw references.
1756         - Observer classes (PlaybackSessionModelClient and VideoFullscreenModelClient, and
1757           VideoFullscreenChangeObserver) are also passed around as raw pointers, but shouldn't
1758           be ref-able.
1759
1760         Make Model classes ref-able by adding ref() and deref() which call virtual refModel and
1761         derefModel methods, overridden by implementing subclasses. Make every concrete observer
1762         inherit from CanMakeWeakPtr, and every registration method take WeakPtr wrappers around
1763         the client interface.
1764
1765         Since every Interface class now holds a strong reference to its Model classes, and each
1766         Model class holds a weak reference to all its clients, no explicit invalidate() method
1767         is necessary.
1768
1769         Notes:
1770
1771         - Since the weak pointer methods need to be able to downcast to the abstract base class,
1772           observers need to inherit publically (rather than privately) from those base classes.
1773         - Media element Models should compose EventListener rather than inheriting from it, since
1774           EventListener has its own RefCount.
1775         - WeakPtrs can't be held in HashSets (because they change value, and therefore hash, when
1776           their underlying object is destroyed), so clients should be stored in a Vector instead.
1777         - Interfaces should be given all required Refs at creation time, so that they can store
1778           those parameters as Refs instead of RefPtrs.
1779
1780         * platform/cocoa/PlaybackSessionInterface.h:
1781         (WebCore::PlaybackSessionInterface::~PlaybackSessionInterface): Deleted.
1782         * platform/cocoa/PlaybackSessionModel.h:
1783         (WebCore::PlaybackSessionModel::ref):
1784         (WebCore::PlaybackSessionModel::deref):
1785         (WebCore::PlaybackSessionModel::~PlaybackSessionModel): Deleted.
1786         * platform/cocoa/PlaybackSessionModelMediaElement.h:
1787         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
1788         (WebCore::PlaybackSessionModelMediaElement::PlaybackSessionModelMediaElement):
1789         (WebCore::PlaybackSessionModelMediaElement::~PlaybackSessionModelMediaElement):
1790         (WebCore::PlaybackSessionModelMediaElement::setMediaElement):
1791         (WebCore::PlaybackSessionModelMediaElement::updateForEventName):
1792         (WebCore::PlaybackSessionModelMediaElement::addClient):
1793         (WebCore::PlaybackSessionModelMediaElement::removeClient):
1794         (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions):
1795         (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionIndices):
1796         (WebCore::PlaybackSessionModelMediaElement::handleEvent): Deleted.
1797         * platform/cocoa/VideoFullscreenChangeObserver.h:
1798         (WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver): Deleted.
1799         * platform/cocoa/VideoFullscreenModel.h:
1800         (WebCore::VideoFullscreenModel::ref):
1801         (WebCore::VideoFullscreenModel::deref):
1802         (WebCore::VideoFullscreenModel::~VideoFullscreenModel): Deleted.
1803         * platform/cocoa/VideoFullscreenModelVideoElement.h:
1804         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
1805         (VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement):
1806         (VideoFullscreenModelVideoElement::setVideoElement):
1807         (VideoFullscreenModelVideoElement::addClient):
1808         (VideoFullscreenModelVideoElement::removeClient):
1809         (VideoFullscreenModelVideoElement::setHasVideo):
1810         (VideoFullscreenModelVideoElement::setVideoDimensions):
1811         (VideoFullscreenModelVideoElement::willEnterPictureInPicture):
1812         (VideoFullscreenModelVideoElement::didEnterPictureInPicture):
1813         (VideoFullscreenModelVideoElement::failedToEnterPictureInPicture):
1814         (VideoFullscreenModelVideoElement::willExitPictureInPicture):
1815         (VideoFullscreenModelVideoElement::didExitPictureInPicture):
1816         (VideoFullscreenModelVideoElement::handleEvent): Deleted.
1817         * platform/ios/PlaybackSessionInterfaceAVKit.h:
1818         (WebCore::PlaybackSessionInterfaceAVKit::create):
1819         (WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const):
1820         (): Deleted.
1821         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
1822         (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
1823         (WebCore::PlaybackSessionInterfaceAVKit::~PlaybackSessionInterfaceAVKit):
1824         (WebCore::PlaybackSessionInterfaceAVKit::invalidate): Deleted.
1825         * platform/ios/VideoFullscreenInterfaceAVKit.h:
1826         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1827         (-[WebAVPlayerLayer layoutSublayers]):
1828         (-[WebAVPlayerLayer resolveBounds]):
1829         (-[WebAVPlayerLayer setVideoGravity:]):
1830         (VideoFullscreenInterfaceAVKit::create):
1831         (VideoFullscreenInterfaceAVKit::VideoFullscreenInterfaceAVKit):
1832         (VideoFullscreenInterfaceAVKit::~VideoFullscreenInterfaceAVKit):
1833         (VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver):
1834         (VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
1835         (VideoFullscreenInterfaceAVKit::setupFullscreen):
1836         (VideoFullscreenInterfaceAVKit::presentingViewController):
1837         (VideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
1838         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
1839         (VideoFullscreenInterfaceAVKit::willStartPictureInPicture):
1840         (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
1841         (VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture):
1842         (VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
1843         (VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
1844         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
1845         (VideoFullscreenInterfaceAVKit::doSetup):
1846         (VideoFullscreenInterfaceAVKit::setMode):
1847         (VideoFullscreenInterfaceAVKit::clearMode):
1848         (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel): Deleted.
1849         (VideoFullscreenInterfaceAVKit::invalidate): Deleted.
1850         * platform/ios/WebAVPlayerController.h:
1851         * platform/ios/WebAVPlayerController.mm:
1852         (-[WebAVPlayerController delegate]):
1853         (-[WebAVPlayerController playbackSessionInterface]):
1854         (-[WebAVPlayerController setPlaybackSessionInterface:]):
1855         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1856         (VideoFullscreenControllerContext::didCleanupFullscreen):
1857         (VideoFullscreenControllerContext::addClient):
1858         (VideoFullscreenControllerContext::removeClient):
1859         (VideoFullscreenControllerContext::willEnterPictureInPicture):
1860         (VideoFullscreenControllerContext::didEnterPictureInPicture):
1861         (VideoFullscreenControllerContext::failedToEnterPictureInPicture):
1862         (VideoFullscreenControllerContext::willExitPictureInPicture):
1863         (VideoFullscreenControllerContext::didExitPictureInPicture):
1864         (VideoFullscreenControllerContext::setUpFullscreen):
1865         * platform/mac/PlaybackSessionInterfaceMac.h:
1866         * platform/mac/PlaybackSessionInterfaceMac.mm:
1867         (WebCore::PlaybackSessionInterfaceMac::create):
1868         (WebCore::PlaybackSessionInterfaceMac::PlaybackSessionInterfaceMac):
1869         (WebCore::PlaybackSessionInterfaceMac::playbackSessionModel const):
1870         (WebCore::PlaybackSessionInterfaceMac::rateChanged):
1871         (WebCore::PlaybackSessionInterfaceMac::beginScrubbing):
1872         (WebCore::PlaybackSessionInterfaceMac::endScrubbing):
1873         (WebCore::PlaybackSessionInterfaceMac::setPlayBackControlsManager):
1874         (WebCore::PlaybackSessionInterfaceMac::updatePlaybackControlsManagerTiming):
1875         (WebCore::PlaybackSessionInterfaceMac::~PlaybackSessionInterfaceMac): Deleted.
1876         (WebCore::PlaybackSessionInterfaceMac::invalidate): Deleted.
1877         * platform/mac/VideoFullscreenInterfaceMac.h:
1878         (WebCore::VideoFullscreenInterfaceMac::create):
1879         (WebCore::VideoFullscreenInterfaceMac::videoFullscreenModel const):
1880         (WebCore::VideoFullscreenInterfaceMac::playbackSessionModel const):
1881         (WebCore::VideoFullscreenInterfaceMac::videoFullscreenChangeObserver const):
1882         * platform/mac/VideoFullscreenInterfaceMac.mm:
1883         (-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]):
1884         (-[WebVideoFullscreenInterfaceMacObjC boundsDidChangeForVideoViewContainer:]):
1885         (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
1886         (-[WebVideoFullscreenInterfaceMacObjC pipActionPlay:]):
1887         (-[WebVideoFullscreenInterfaceMacObjC pipActionPause:]):
1888         (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]):
1889         (WebCore::VideoFullscreenInterfaceMac::VideoFullscreenInterfaceMac):
1890         (WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac):
1891         (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenChangeObserver):
1892         (WebCore::VideoFullscreenInterfaceMac::setMode):
1893         (WebCore::VideoFullscreenInterfaceMac::clearMode):
1894         (WebCore::VideoFullscreenInterfaceMac::invalidate):
1895         (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP):
1896         (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenModel): Deleted.
1897         * platform/mac/WebPlaybackControlsManager.mm:
1898         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
1899         (-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]):
1900         (-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]):
1901         (-[WebPlaybackControlsManager togglePlayback]):
1902         (-[WebPlaybackControlsManager setPlaying:]):
1903         (-[WebPlaybackControlsManager isPlaying]):
1904         (-[WebPlaybackControlsManager togglePictureInPicture]):
1905
1906 2018-09-28  Chris Dumez  <cdumez@apple.com>
1907
1908         Drop iOS specific quirk in SettingsBase::scriptEnabledChanged()
1909         https://bugs.webkit.org/show_bug.cgi?id=190077
1910         <rdar://problem/44812613>
1911
1912         Reviewed by Zalan Bujtas.
1913
1914         Drop iOS specific quirk in SettingsBase::scriptEnabledChanged() that would dirty style after the
1915         "JavaScriptEnabled" setting's state is toggled. I do not see a good reason to do this given that
1916         scripts would not get executed until a reload.
1917
1918         If we find out after dropping this that this is actually useful for some reason, then we can
1919         always bring it back and consider making this non-iOS specific, as well as documenting why this
1920         it is needed.
1921
1922         * page/Settings.yaml:
1923         * page/SettingsBase.cpp:
1924         (WebCore::SettingsBase::scriptEnabledChanged): Deleted.
1925         * page/SettingsBase.h:
1926
1927 2018-09-27  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1928
1929         [Curl] Fix priority issue with multiple cookies with different level of path.
1930         https://bugs.webkit.org/show_bug.cgi?id=189920
1931
1932         Reviewed by Fujii Hironori.
1933
1934         When multiple cookies are stored in the database for same site, the priority of
1935         multiple cookies which matches path criteria was not defined. The backend
1936         implementation `sqlite` then returns the first matching result, which is the one
1937         stored earlier.
1938
1939         Test: http/tests/cookies/cookie-with-multiple-level-path.html
1940
1941         * platform/network/curl/CookieJarDB.cpp:
1942         (WebCore::CookieJarDB::searchCookies):
1943
1944 2018-09-26  Ryosuke Niwa  <rniwa@webkit.org>
1945
1946         Use enum class in createMarkup arguments
1947         https://bugs.webkit.org/show_bug.cgi?id=190028
1948
1949         Reviewed by Wenson Hsieh.
1950
1951         Replaced enums used by createMarkup with equivalent enum classes: EChildrenOnly with SerializedNodes,
1952         EAbsoluteURLs with ResolveURLs, and EFragmentSerialization with SerializationSyntax.
1953
1954         Also replaced the boolean convertBlocksToInlines with an enum class of the same name.
1955
1956         Finally, renamed the createMarkup variant which doesn't serialize style and used for innerHTML and XMLSerializer
1957         to serializeFragment.
1958
1959         * dom/Element.cpp:
1960         (WebCore::Element::innerHTML const):
1961         (WebCore::Element::outerHTML const):
1962         * dom/ShadowRoot.cpp:
1963         (WebCore::ShadowRoot::innerHTML const):
1964         * editing/CompositeEditCommand.cpp:
1965         (WebCore::CompositeEditCommand::moveParagraphs):
1966         * editing/HTMLInterchange.h:
1967         (WebCore::AnnotateForInterchange): Renamed from EAnnotateForInterchange.
1968         * editing/MarkupAccumulator.cpp:
1969         (WebCore::MarkupAccumulator::MarkupAccumulator):
1970         (WebCore::MarkupAccumulator::serializeNodes):
1971         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
1972         (WebCore::MarkupAccumulator::resolveURLIfNeeded const):
1973         * editing/MarkupAccumulator.h:
1974         (WebCore::MarkupAccumulator::inXMLFragmentSerialization const):
1975         * editing/ReplaceRangeWithTextCommand.cpp:
1976         (WebCore::ReplaceRangeWithTextCommand::inputEventDataTransfer const):
1977         * editing/ReplaceSelectionCommand.cpp:
1978         (WebCore::ReplaceSelectionCommand::willApplyCommand):
1979         * editing/SpellingCorrectionCommand.cpp:
1980         (WebCore::SpellingCorrectionCommand::inputEventDataTransfer const):
1981         * editing/cocoa/EditorCocoa.mm:
1982         (WebCore::Editor::selectionInHTMLFormat):
1983         * editing/cocoa/WebContentReaderCocoa.mm:
1984         (WebCore::WebContentMarkupReader::readRTFD):
1985         (WebCore::WebContentMarkupReader::readRTF):
1986         * editing/gtk/EditorGtk.cpp:
1987         (WebCore::Editor::writeImageToPasteboard):
1988         (WebCore::Editor::writeSelectionToPasteboard):
1989         * editing/markup.cpp:
1990         (WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator):
1991         (WebCore::StyledMarkupAccumulator::serializeNodes):
1992         (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
1993         (WebCore::highestAncestorToWrapMarkup):
1994         (WebCore::createMarkupInternal):
1995         (WebCore::createMarkup):
1996         (WebCore::sanitizedMarkupForFragmentInDocument):
1997         (WebCore::serializeFragment): Renamed from createMarkup. This is used for innerHTML and XMLSerializer,
1998         which faithfully serializes the fragment without any computed style as inline styles.
1999         (WebCore::documentTypeString):
2000         (WebCore::createFullMarkup): Deleted two varinats used in WebKitLegacy.
2001         * editing/markup.h:
2002         (WebCore::ResolveURLs): Renamed from EAbsoluteURLs.
2003         (WebCore::ConvertBlocksToInlines): Added.
2004         (WebCore::SerializedNodes): Renamed from EChildrenOnly.
2005         (WebCore::SerializationSyntax): Renamed from EFragmentSerialization.
2006         * editing/wpe/EditorWPE.cpp:
2007         (WebCore::Editor::writeSelectionToPasteboard):
2008         * inspector/DOMEditor.cpp:
2009         * inspector/agents/InspectorDOMAgent.cpp:
2010         (WebCore::InspectorDOMAgent::getOuterHTML):
2011         * loader/archive/cf/LegacyWebArchive.cpp:
2012         (WebCore::LegacyWebArchive::create):
2013         (WebCore::LegacyWebArchive::createFromSelection):
2014         * page/PageSerializer.cpp:
2015         (WebCore::PageSerializer::SerializerMarkupAccumulator::SerializerMarkupAccumulator):
2016         (WebCore::PageSerializer::serializeFrame):
2017         * page/win/DragControllerWin.cpp:
2018         (WebCore::DragController::declareAndWriteDragImage):
2019         * Source/WebCore/platform/win/PasteboardWin.cpp:
2020         (WebCore::Pasteboard::writeRangeToDataObject):
2021         (WebCore::Pasteboard::writeSelection):
2022         * xml/XMLHttpRequest.cpp:
2023         (WebCore::XMLHttpRequest::send):
2024         * xml/XMLSerializer.cpp:
2025         (WebCore::XMLSerializer::serializeToString):
2026         * xml/XSLTProcessorLibxslt.cpp:
2027         (WebCore::xsltStylesheetPointer):
2028         (WebCore::xmlDocPtrFromNode):
2029
2030 2018-09-27  John Wilander  <wilander@apple.com>
2031
2032         Resource Load Statistics: Non-redirected top frame navigation should not get captured in statistics
2033         https://bugs.webkit.org/show_bug.cgi?id=190055
2034         <rdar://problem/44843460>
2035
2036         Reviewed by Chris Dumez.
2037
2038         Test: http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html
2039
2040         * loader/ResourceLoadStatistics.cpp:
2041         (WebCore::ResourceLoadStatistics::decode):
2042             Corrects legacy statistics for frames and triggers a re-classification.
2043
2044 2018-09-27  Jer Noble  <jer.noble@apple.com>
2045
2046         Unreviewed watchOS build fix; Fix declaration for ports which USE(ENCRYPTED_MEDIA) but don't
2047         HAVE(AVCONTENTKEYSESSION).
2048
2049         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2050
2051 2018-09-27  Justin Michaud  <justin_michaud@apple.com>
2052
2053         Remove duplicate CSS Properties and Values feature on status page
2054         https://bugs.webkit.org/show_bug.cgi?id=189909
2055
2056         Reviewed by Simon Fraser.
2057
2058         Update CSS properties and values api feature in features.json
2059
2060         * features.json:
2061
2062 2018-09-27  Jer Noble  <jer.noble@apple.com>
2063
2064         MediaPlayer should have mediaPlayerWaitingForKeyChanged() / bool waitingForKey() accessor
2065         https://bugs.webkit.org/show_bug.cgi?id=189951
2066
2067         Reviewed by Eric Carlson.
2068
2069         In order to implement the "Resume Playback" section of EME, part 4, we need to be able
2070         to query whether the MediaPlayer is still waiting for a key after attemptToDecrypt()
2071         has been called. Currently this involves no behavioral changes, as all modern EME ports
2072         will still just notify the media element that they no longer need keys after one has
2073         been added, but future ports may be able to wait for multiple keys before reporting
2074         that it is no longer waiting for keys.
2075
2076         * html/HTMLMediaElement.cpp:
2077         (WebCore::HTMLMediaElement::mediaPlayerWaitingForKeyChanged):
2078         (WebCore::HTMLMediaElement::attemptToResumePlaybackIfNecessary):
2079         (WebCore::HTMLMediaElement::mediaPlayerWaitingForKey): Deleted.
2080         * html/HTMLMediaElement.h:
2081         * platform/graphics/MediaPlayer.cpp:
2082         (WebCore::MediaPlayer::waitingForKeyChanged):
2083         (WebCore::MediaPlayer::waitingForKey const):
2084         (WebCore::MediaPlayer::waitingForKey): Deleted.
2085         * platform/graphics/MediaPlayer.h:
2086         (WebCore::MediaPlayerClient::mediaPlayerWaitingForKeyChanged):
2087         (WebCore::MediaPlayerClient::mediaPlayerWaitingForKey): Deleted.
2088         * platform/graphics/MediaPlayerPrivate.h:
2089         (WebCore::MediaPlayerPrivateInterface::waitingForKey const):
2090         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2091         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2092         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
2093         (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
2094         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2095         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2096         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
2097         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKey const):
2098         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKeyChanged):
2099         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered):
2100         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2101         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2102         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
2103         (WebCore::SourceBufferPrivateAVFObjC::attemptToDecrypt):
2104         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2105         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2106         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2107         (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey):
2108         (WebCore::MediaPlayerPrivateGStreamerBase::setWaitingForKey):
2109         (WebCore::MediaPlayerPrivateGStreamerBase::waitingForKey const):
2110         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2111         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2112         (webkitMediaCommonEncryptionDecryptSinkEventHandler):
2113
2114 2018-09-27  Alicia Boya García  <aboya@igalia.com>
2115
2116         [MSE] Fix unwanted sample erase from the decode queue
2117         https://bugs.webkit.org/show_bug.cgi?id=180643
2118
2119         Reviewed by Jer Noble.
2120
2121         Test: media/media-source/media-source-append-acb-no-frame-lost.html
2122
2123         This bug reproduced when unordered appends were made. For instance, if
2124         the application appended [0, 10) and then [20, 30), the frame at 20
2125         would be wrongly discarded from the decode queue.
2126
2127         Later the application could append [10, 20) and the gap at [20, 21)
2128         would persist in the decode queue, even if the frame remained in the
2129         track buffer table.
2130
2131         Thanks to Daniel Zhang for reporting the issue.
2132
2133         * Modules/mediasource/SourceBuffer.cpp:
2134         (WebCore::SourceBuffer::provideMediaData):
2135
2136 2018-09-27  Alex Christensen  <achristensen@webkit.org>
2137
2138         URLParser should use TextEncoding through an abstract class
2139         https://bugs.webkit.org/show_bug.cgi?id=190027
2140
2141         Reviewed by Andy Estes.
2142
2143         URLParser uses TextEncoding for one call to encode, which is only used for encoding the query of URLs in documents with non-UTF encodings.
2144         There are 3 call sites that specify the TextEncoding to use from the Document, and even those call sites use a UTF encoding most of the time.
2145         All other URL parsing is done using a well-optimized path which assumes UTF-8 encoding and uses macros from ICU headers, not a TextEncoding.
2146         Moving the logic in this way breaks URL and URLParser's dependency on TextEncoding, which makes it possible to use in a lower-level project
2147         without also moving TextEncoding, TextCodec, TextCodecICU, ThreadGlobalData, and the rest of WebCore and JavaScriptCore.
2148
2149         There is no observable change in behavior.  There is now one virtual function call in a code path in URLParser that is not performance-sensitive,
2150         and TextEncodings now have a vtable, which uses a few more bytes of memory total for WebKit.
2151
2152         * css/parser/CSSParserContext.h:
2153         (WebCore::CSSParserContext::completeURL const):
2154         * css/parser/CSSParserIdioms.cpp:
2155         (WebCore::completeURL):
2156         * dom/Document.cpp:
2157         (WebCore::Document::completeURL const):
2158         * html/HTMLBaseElement.cpp:
2159         (WebCore::HTMLBaseElement::href const):
2160         Move the call to encodingForFormSubmission from the URL constructor to the 3 call sites that specify the encoding from the Document.
2161         * loader/FormSubmission.cpp:
2162         (WebCore::FormSubmission::create):
2163         * loader/TextResourceDecoder.cpp:
2164         (WebCore::TextResourceDecoder::encodingForURLParsing):
2165         * loader/TextResourceDecoder.h:
2166         * platform/URL.cpp:
2167         (WebCore::URL::URL):
2168         * platform/URL.h:
2169         (WebCore::URLTextEncoding::~URLTextEncoding):
2170         * platform/URLParser.cpp:
2171         (WebCore::URLParser::encodeNonUTF8Query):
2172         (WebCore::URLParser::copyURLPartsUntil):
2173         (WebCore::URLParser::URLParser):
2174         (WebCore::URLParser::parse):
2175         (WebCore::URLParser::encodeQuery): Deleted.
2176         A pointer replaces the boolean isUTF8Encoding and the TextEncoding& which had a default value of UTF8Encoding.
2177         Now the pointer being null means that we use UTF8, and the pointer being non-null means we use that encoding.
2178         * platform/URLParser.h:
2179         (WebCore::URLParser::URLParser):
2180         * platform/text/TextEncoding.cpp:
2181         (WebCore::UTF7Encoding):
2182         (WebCore::TextEncoding::encodingForFormSubmissionOrURLParsing const):
2183         (WebCore::ASCIIEncoding):
2184         (WebCore::Latin1Encoding):
2185         (WebCore::UTF16BigEndianEncoding):
2186         (WebCore::UTF16LittleEndianEncoding):
2187         (WebCore::UTF8Encoding):
2188         (WebCore::WindowsLatin1Encoding):
2189         (WebCore::TextEncoding::encodingForFormSubmission const): Deleted.
2190         Use NeverDestroyed because TextEncoding now has a virtual destructor.
2191         * platform/text/TextEncoding.h:
2192         Rename encodingForFormSubmission to encodingForFormSubmissionOrURLParsing to make it more clear that we are intentionally using it for both.
2193
2194 2018-09-27  John Wilander  <wilander@apple.com>
2195
2196         Resource Load Statistics: Remove temporary compatibility fix for auto-dismiss popups
2197         https://bugs.webkit.org/show_bug.cgi?id=189980
2198         <rdar://problem/44780645>
2199
2200         Reviewed by Alex Christensen.
2201
2202         Test: http/tests/storageAccess/deny-storage-access-under-opener-if-auto-dismiss.html
2203
2204         The change in https://bugs.webkit.org/show_bug.cgi?id=183620 was a temporary
2205         compatibility fix as explained in:
2206         https://webkit.org/blog/8311/intelligent-tracking-prevention-2-0/. We should
2207         remove it.
2208
2209         Most of these changes remove the parameter isTriggeredByUserGesture since it's no longer needed.
2210
2211         * loader/ResourceLoadObserver.cpp:
2212         (WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
2213         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2214         (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
2215         (WebCore::ResourceLoadObserver::logWindowCreation): Deleted.
2216         * loader/ResourceLoadObserver.h:
2217         * page/DOMWindow.cpp:
2218         (WebCore::DOMWindow::createWindow):
2219             Now no longer logs anything to ResourceLoadObserver.
2220
2221 2018-09-27  Ryan Haddad  <ryanhaddad@apple.com>
2222
2223         Unreviewed, rolling out r236557.
2224
2225         Really roll out r236557 this time because it breaks internal
2226         builds.
2227
2228         Reverted changeset:
2229
2230         "Add VP8 support to WebRTC"
2231         https://bugs.webkit.org/show_bug.cgi?id=189976
2232         https://trac.webkit.org/changeset/236557
2233
2234 2018-09-27  Chris Dumez  <cdumez@apple.com>
2235
2236         Fragment should be stripped from document URL during document.open() URL propagation
2237         https://bugs.webkit.org/show_bug.cgi?id=189374
2238         <rdar://problem/44282736>
2239
2240         Reviewed by Alex Christensen.
2241
2242         Strip the Document URL fragment during document.open() URL propagation if the entry document
2243         is not the current document, as per:
2244         - https://html.spec.whatwg.org/#document-open-steps (Step 11.2.)
2245
2246         No new tests, rebaselined existing test.
2247
2248         * dom/Document.cpp:
2249         (WebCore::Document::open):
2250
2251 2018-09-27  Youenn Fablet  <youenn@apple.com>
2252
2253         Add VP8 support to WebRTC
2254         https://bugs.webkit.org/show_bug.cgi?id=189976
2255
2256         Reviewed by Eric Carlson.
2257
2258         Add a runtime flag to control activation of VP8 codec.
2259         Bind this runtime flag to the video codec factories.
2260         Test: webrtc/video-mute-vp8.html
2261
2262         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2263         (WebCore::createLibWebRTCPeerConnectionBackend):
2264         * page/RuntimeEnabledFeatures.h:
2265         (WebCore::RuntimeEnabledFeatures::webRTCVP8CodecEnabled const):
2266         (WebCore::RuntimeEnabledFeatures::setWebRTCVP8CodecEnabled):
2267         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2268         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
2269         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
2270         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
2271         * testing/Internals.cpp:
2272         (WebCore::Internals::resetToConsistentState):
2273         Enable VP8 codec for tests.
2274
2275 2018-09-27  Chris Dumez  <cdumez@apple.com>
2276
2277         Crash under WebCore::deleteCookiesForHostnames()
2278         https://bugs.webkit.org/show_bug.cgi?id=190040
2279         <rdar://problem/38020368>
2280
2281         Reviewed by Alex Christensen.
2282
2283         Update NetworkStorageSession::deleteCookiesForHostnames() to properly deal with the fact
2284         that NSHTTPCookie.domain can return nil.
2285
2286         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2287         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
2288
2289 2018-09-27  Youenn Fablet  <youenn@apple.com>
2290
2291         Use kCVPixelFormatType_420YpCbCr8Planar for capturing frames
2292         https://bugs.webkit.org/show_bug.cgi?id=190014
2293
2294         Reviewed by Eric Carlson.
2295
2296         On Mac, rely on the monoplanar format which can be displayed without any issue.
2297         Once rendering is fixed, we should change it back to biplanar as it is closer to what libwebrtc consumes.
2298         Covered by manual testing.
2299
2300         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2301         (WebCore::avVideoCapturePixelBufferFormat):
2302         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
2303         (WebCore::AVVideoCaptureSource::setupCaptureSession):
2304         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
2305
2306 2018-09-27  Andy Estes  <aestes@apple.com>
2307
2308         [Apple Pay] Support granular errors in PaymentDetailsUpdate
2309         https://bugs.webkit.org/show_bug.cgi?id=189938
2310
2311         Reviewed by Youenn Fablet.
2312
2313         Implemented the shippingAddressErrors, payerErrors, and paymentMethodErrors properties on
2314         PaymentDetailsUpdate, as specified in the Payment Request API W3C Editor's Draft of
2315         26 September 2018.
2316
2317         When these errors are specified in a PaymentDetailsUpdate, map them to PaymentErrors. For
2318         shippingAddressErrors and payerErrors, we use the "shippingContactInvalid" code and a
2319         contact field that matches the shippingAddressError or payerError property specified.
2320
2321         For paymentMethodErrors, we interpret this as a sequence of ApplePayErrors, which are
2322         converted to PaymentErrors as in Apple Pay JS.
2323
2324         Tests: http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrors.https.html
2325                http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https.html
2326
2327         * DerivedSources.make: Removed some tabs and added new .idl files.
2328         * Modules/applepay/ApplePayError.idl: Moved ApplePayErrorCode and ApplePayErrorContactField
2329         into their own .idl files so they can be used in MockPaymentError.
2330         * Modules/applepay/ApplePayErrorCode.h: Added.
2331         * Modules/applepay/ApplePayErrorCode.idl: Added.
2332         * Modules/applepay/ApplePayErrorContactField.h: Added.
2333         * Modules/applepay/ApplePayErrorContactField.idl: Added.
2334
2335         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2336         (WebCore::appendShippingContactInvalidError): Appended a "shippingContactInvalid"
2337         PaymentError to errors if the message is non-null.
2338         (WebCore::ApplePayPaymentHandler::computeErrors const):
2339         (WebCore::ApplePayPaymentHandler::detailsUpdated):
2340         (WebCore::ApplePayPaymentHandler::shippingAddressUpdated): Computed a vector of PaymentErrors
2341         based on shippingAddressErrors, payerErrors, and paymentMethodErrors.
2342
2343         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
2344
2345         * Modules/paymentrequest/PaymentDetailsUpdate.h:
2346         * Modules/paymentrequest/PaymentDetailsUpdate.idl: Defined shippingAddressErrors,
2347         payerErrors, and paymentMethodErrors.
2348
2349         * Modules/paymentrequest/PaymentHandler.h:
2350         * Modules/paymentrequest/PaymentRequest.cpp:
2351         (WebCore::PaymentRequest::paymentMethodChanged):
2352         (WebCore::PaymentRequest::settleDetailsPromise): Passed shippingAddressErrors, payerErrors,
2353         and paymentMethodErrors to the payment handler.
2354
2355         * SourcesCocoa.txt:
2356         * WebCore.xcodeproj/project.pbxproj:
2357
2358         * testing/MockPaymentCoordinator.cpp:
2359         (WebCore::MockPaymentCoordinator::completeShippingContactSelection): Stored errors in m_errors.
2360         * testing/MockPaymentCoordinator.h:
2361         * testing/MockPaymentCoordinator.idl: Added an errors attribute.
2362
2363         * testing/MockPaymentError.h: Added.
2364         * testing/MockPaymentError.idl: Added.
2365
2366 2018-09-27  Alex Christensen  <achristensen@webkit.org>
2367
2368         URLWithUserTypedString should return nil for URLs deemed to be invalid by WebCore::URL
2369         https://bugs.webkit.org/show_bug.cgi?id=189979
2370
2371         Reviewed by Youenn Fablet.
2372
2373         * platform/mac/WebCoreNSURLExtras.mm:
2374         (WebCore::URLWithUserTypedString):
2375         (WebCore::dataForURLComponentType):
2376         (WebCore::URLByRemovingComponentAndSubsequentCharacter):
2377         (WebCore::URLByCanonicalizingURL):
2378         (WebCore::originalURLData):
2379         (WebCore::userVisibleString):
2380
2381 2018-09-27  Chris Dumez  <cdumez@apple.com>
2382
2383         document.open() should not propagate URLs to non-fully active documents
2384         https://bugs.webkit.org/show_bug.cgi?id=189375
2385         <rdar://problem/44282755>
2386
2387         Reviewed by Youenn Fablet.
2388
2389         Update our document.open() to not propagate URLs to non-fully active documents, as per:
2390         - https://html.spec.whatwg.org/#document-open-steps (Step 11)
2391
2392         A "fully active" document is defined by at:
2393         - https://html.spec.whatwg.org/#fully-active
2394
2395         No new tests, rebaselined existing test.
2396
2397         * dom/Document.cpp:
2398         (WebCore::Document::open):
2399         (WebCore::Document::isFullyActive const):
2400         * dom/Document.h:
2401         * dom/Document.idl:
2402
2403 2018-09-27  Alicia Boya García  <aboya@igalia.com>
2404
2405         [MSE][GStreamer] Use sentinel buffer to detect end of append
2406         https://bugs.webkit.org/show_bug.cgi?id=189924
2407
2408         Reviewed by Philippe Normand.
2409
2410         This patch introduces a new mechanism to detect when an append has
2411         been consumed completely by the demuxer. It takes advantage of the
2412         fact that buffer pushing is synchronous: both the appsrc and the
2413         demuxer live in the same streaming thread. When appsrc pushes a
2414         buffer, it's actually making a qtdemux function call (it calls its
2415         "chain" function). The demuxer will return from that call when it has
2416         finished processing that buffer; only then the control returns to
2417         appsrc, that can push the next buffer.
2418
2419         By pushing an additional buffer and capturing it in a probe we can
2420         detect reliably when the previous buffer has been processed.
2421         Because the pipeline only has one thread, at this point no more frames
2422         can arrive to the appsink.
2423
2424         This replaces the old method of detecting end of append which relied
2425         on the `need-data` event, which is more difficult to handle correctly
2426         because it fires whenever the appsrc is empty (or below a given
2427         level), which also happens when a buffer has not been pushed yet or
2428         in response to a flush.
2429
2430         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2431         (WebCore::EndOfAppendMeta::init):
2432         (WebCore::EndOfAppendMeta::transform):
2433         (WebCore::EndOfAppendMeta::free):
2434         (WebCore::AppendPipeline::staticInitialization):
2435         (WebCore::AppendPipeline::AppendPipeline):
2436         (WebCore::AppendPipeline::~AppendPipeline):
2437         (WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe):
2438         (WebCore::AppendPipeline::handleApplicationMessage):
2439         (WebCore::AppendPipeline::handleEndOfAppend):
2440         (WebCore::AppendPipeline::consumeAppsinkAvailableSamples):
2441         (WebCore::AppendPipeline::resetPipeline):
2442         (WebCore::AppendPipeline::pushNewBuffer):
2443         (WebCore::AppendPipeline::handleAppsrcNeedDataReceived): Deleted.:
2444         (WebCore::AppendPipeline::handleAppsrcAtLeastABufferLeft): Deleted.
2445         (WebCore::AppendPipeline::checkEndOfAppend): Deleted.
2446         (WebCore::AppendPipeline::setAppsrcDataLeavingProbe): Deleted.
2447         (WebCore::AppendPipeline::removeAppsrcDataLeavingProbe): Deleted.
2448         (WebCore::AppendPipeline::reportAppsrcAtLeastABufferLeft): Deleted.
2449         (WebCore::AppendPipeline::reportAppsrcNeedDataReceived): Deleted.
2450         (WebCore::appendPipelineAppsrcDataLeaving): Deleted.
2451         (WebCore::appendPipelineAppsrcNeedData): Deleted.
2452         * platform/graphics/gstreamer/mse/AppendPipeline.h:
2453
2454 2018-09-27  Chris Dumez  <cdumez@apple.com>
2455
2456         The WebContent process should not process incoming IPC while waiting for a sync IPC reply
2457         https://bugs.webkit.org/show_bug.cgi?id=184183
2458         <rdar://problem/36800576>
2459
2460         Reviewed by Ryosuke Niwa.
2461
2462         Drop test infrastructure for the DoNotProcessIncomingMessagesWhenWaitingForSyncReply IPC::SendOption
2463         given that this SendOption was removed from this patch.
2464
2465         * page/ChromeClient.h:
2466         * testing/Internals.cpp:
2467         * testing/Internals.h:
2468         * testing/Internals.idl:
2469
2470 2018-09-27  Philippe Normand  <pnormand@igalia.com>
2471
2472         Unreviewed, GTK Ubuntu LTS build fix attempt after r236396.
2473
2474         * platform/graphics/gstreamer/GStreamerCommon.h:
2475
2476 2018-09-27  Antoine Quint  <graouts@apple.com>
2477
2478         [Web Animations] Turn Web Animations with CSS integration on
2479         https://bugs.webkit.org/show_bug.cgi?id=184819
2480         <rdar://problem/39597337>
2481
2482         Reviewed by Dean Jackson.
2483
2484         * page/RuntimeEnabledFeatures.h:
2485
2486 2018-09-26  YUHAN WU  <yuhan_wu@apple.com>
2487
2488         Video track clone cannot preserve original property
2489         https://bugs.webkit.org/show_bug.cgi?id=189872
2490         <rdar://problem/44706579>
2491
2492         Reviewed by Youenn Fablet.
2493
2494         Fix the issue that the cloned track created by canvas.captureStream().getVideoTracks() cannot keep some attributes, such as enabled.
2495         Updated a testcase expected result:
2496         LayoutTests/imported/w3c/web-platform-tests/mst-content-hint/MediaStreamTrack-contentHint.html
2497
2498         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
2499         (WebCore::CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack):
2500         (WebCore::CanvasCaptureMediaStreamTrack::create):
2501         (WebCore::CanvasCaptureMediaStreamTrack::clone):
2502         * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
2503         * Modules/mediastream/MediaStreamTrack.h:
2504
2505 2018-09-26  Alex Christensen  <achristensen@webkit.org>
2506
2507         Unreviewed, rolling out r236524.
2508
2509         Broke API tests
2510
2511         Reverted changeset:
2512
2513         "URLWithUserTypedString should return nil for URLs deemed to
2514         be invalid by WebCore::URL"
2515         https://bugs.webkit.org/show_bug.cgi?id=189979
2516         https://trac.webkit.org/changeset/236524
2517
2518 2018-09-26  Per Arne Vollan  <pvollan@apple.com>
2519
2520         WebVTT cue alignment broken
2521         https://bugs.webkit.org/show_bug.cgi?id=190004
2522
2523         Reviewed by Eric Carlson.
2524
2525         If the position of the queue is unspecified, the default value of 50 was used, which is incorrect.
2526         This patch also updates the API according to https://w3c.github.io/webvtt/#the-vttcue-interface.
2527         The position attribute should not be a double, but either a double or the "auto" keyword. Parts
2528         of this patch is inspired by the associated code in the Chromium project.
2529
2530         Test: media/track/track-cue-left-align.html
2531
2532         * html/track/TextTrackCueGeneric.cpp:
2533         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
2534         (WebCore::TextTrackCueGeneric::setPosition):
2535         * html/track/TextTrackCueGeneric.h:
2536         * html/track/VTTCue.cpp:
2537         (WebCore::VTTCueBox::applyCSSProperties):
2538         (WebCore::VTTCue::initialize):
2539         (WebCore::VTTCue::position const):
2540         (WebCore::VTTCue::setPosition):
2541         (WebCore::VTTCue::textPositionIsAuto const):
2542         (WebCore::VTTCue::calculateComputedTextPosition const):
2543         (WebCore::VTTCue::calculateDisplayParameters):
2544         (WebCore::VTTCue::toJSON const):
2545         * html/track/VTTCue.h:
2546         (WebCore::VTTCue::position const): Deleted.
2547         * html/track/VTTCue.idl:
2548
2549 2018-09-26  James Savage  <james.savage@apple.com>
2550
2551         Allow override of viewport configuration.
2552         https://bugs.webkit.org/show_bug.cgi?id=188772.
2553         <rdar://problem/43538892>.
2554
2555         Reviewed by Simon Fraser.
2556
2557         * page/Settings.yaml:
2558         * page/ViewportConfiguration.cpp:
2559         (WebCore::ViewportConfiguration::nativeWebpageParameters): Provide a viewport configuration
2560         similar to width=device-width, with initial scale set to 1.
2561         * page/ViewportConfiguration.h:
2562
2563 2018-09-26  Alex Christensen  <achristensen@webkit.org>
2564
2565         URLs with mismatched surrogate pairs in the host should fail to parse
2566         https://bugs.webkit.org/show_bug.cgi?id=190005
2567
2568         Reviewed by Chris Dumez.
2569
2570         Elsewhere in the URLParser, when we encounter mismatched surrogate pairs we use the replacement character,
2571         but that just fails later on in domainToASCII, so we may as well just fail.
2572         This behavior matches Chrome, but is unclear in the spec.  There are no valid uses of hosts containing mismatched surrogate pairs.
2573         Covered by new API tests.
2574
2575         * platform/URLParser.cpp:
2576         (WebCore::URLParser::parseHostAndPort):
2577
2578 2018-09-26  Alex Christensen  <achristensen@webkit.org>
2579
2580         uidna_nameToASCII only needs a buffer capacity of 64
2581         https://bugs.webkit.org/show_bug.cgi?id=190006
2582
2583         Reviewed by Chris Dumez.
2584
2585         This is specified in https://www.unicode.org/reports/tr46/#ToASCII
2586         This is how Chrome and Firefox also behave with long unicode hosts.
2587
2588         * platform/URLParser.cpp:
2589         (WebCore::URLParser::domainToASCII):
2590
2591 2018-09-26  Alex Christensen  <achristensen@webkit.org>
2592
2593         URLWithUserTypedString should return nil for URLs deemed to be invalid by WebCore::URL
2594         https://bugs.webkit.org/show_bug.cgi?id=189979
2595         <rdar://problem/44119696>
2596
2597         Reviewed by Chris Dumez.
2598
2599         Covered by an API test.
2600
2601         * platform/mac/WebCoreNSURLExtras.mm:
2602         (WebCore::URLWithData):
2603
2604 2018-09-26  Ryosuke Niwa  <rniwa@webkit.org>
2605
2606         Selection should work across shadow boundary when initiated by a mouse drag
2607         https://bugs.webkit.org/show_bug.cgi?id=151380
2608         <rdar://problem/24363872>
2609
2610         Revert the change that I said I would from r236519.
2611
2612         * editing/VisibleSelection.cpp:
2613         (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries):
2614
2615 2018-09-26  Commit Queue  <commit-queue@webkit.org>
2616
2617         Unreviewed, rolling out r236511.
2618         https://bugs.webkit.org/show_bug.cgi?id=190008
2619
2620         It is breaking some WebRTC tests (Requested by youenn on
2621         #webkit).
2622
2623         Reverted changeset:
2624
2625         "[MediaStream] Clean up RealtimeMediaSource settings change
2626         handling"
2627         https://bugs.webkit.org/show_bug.cgi?id=189998
2628         https://trac.webkit.org/changeset/236511
2629
2630 2018-09-26  Ryosuke Niwa  <rniwa@webkit.org>
2631
2632         Selection should work across shadow boundary when initiated by a mouse drag
2633         https://bugs.webkit.org/show_bug.cgi?id=151380
2634         <rdar://problem/24363872>
2635
2636         Reviewed by Antti Koivisto and Wenson Hsieh.
2637
2638         This patch adds the basic support for selecting content across shadow DOM boundaries to VisibleSelection,
2639         which is enough to allow users to select content across shadow DOM boundaries via a mouse drag.
2640
2641         This is the first step in allowing users to select, copy and paste content across shadow DOM boundaries,
2642         which is a serious user experience regression right now. The new behavior is disabled by default under
2643         an interal debug feature flag: selectionAcrossShadowBoundariesEnabled.
2644
2645         Like Chrome, we are not going to support selecting editable content across shadow DOM boundaries since
2646         we'd have to generalize every editing commands to make that work, and there aren't any HTML editors that
2647         use shadow DOM boundaries within an editable region yet. For simplicity, we also don't support extending
2648         a selection out of a shadow root which resides inside an editing region.
2649
2650         The keyboard based navigation & manipulation of selection as well as allowing copy & paste of content
2651         across shadow DOM boundaries will be implemented by separate patches. DOMSelection will not expose this new
2652         behavior either. This is tracked in the spec as https://github.com/w3c/webcomponents/issues/79
2653
2654         Tests: editing/selection/selection-across-shadow-boundaries-mixed-editability-1.html
2655                editing/selection/selection-across-shadow-boundaries-mixed-editability-2.html
2656                editing/selection/selection-across-shadow-boundaries-mixed-editability-3.html
2657                editing/selection/selection-across-shadow-boundaries-mixed-editability-4.html
2658                editing/selection/selection-across-shadow-boundaries-mixed-editability-5.html
2659                editing/selection/selection-across-shadow-boundaries-readonly-1.html
2660                editing/selection/selection-across-shadow-boundaries-readonly-2.html
2661                editing/selection/selection-across-shadow-boundaries-readonly-3.html
2662                editing/selection/selection-across-shadow-boundaries-user-select-all-1.html
2663
2664         * editing/VisibleSelection.cpp:
2665         (WebCore::isInUserAgentShadowRootOrHasEditableShadowAncestor): Added.
2666         (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries): When the feature is enabled,
2667         allow crossing shadow DOM boundaries except when either end is inside an user agent shadow root, or one of
2668         its shadow includign ancestor is inside an editable region. The latter check is needed to disallow
2669         an extension of a selection starting in a shadow tree inside a non-editable region inside an editable region
2670         to outside the editable region. The rest of the editing code is not ready to deal with selection like that.
2671         * page/Settings.yaml: Added an internal debug feature to enable this new behavior.
2672
2673 2018-09-26  Chris Dumez  <cdumez@apple.com>
2674
2675         Ignore-opens-during-unload counter of a parent should apply to its children during beforeunload event
2676         https://bugs.webkit.org/show_bug.cgi?id=189376
2677         <rdar://problem/44282754>
2678
2679         Reviewed by Ryosuke Niwa.
2680
2681         Make sure the Ignore-opens-during-unload counter of a parent stays incremented while we are firing the
2682         beforeunload event for its descendants, as per:
2683         - https://html.spec.whatwg.org/multipage/browsing-the-web.html#prompt-to-unload-a-document
2684
2685         No new tests, rebaselined existing tests.
2686
2687         * loader/FrameLoader.cpp:
2688         (WebCore::FrameLoader::shouldClose):
2689         (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
2690
2691 2018-09-26  Justin Fan  <justin_fan@apple.com>
2692
2693         WebGL 2: Adding logging to in-progress features
2694         https://bugs.webkit.org/show_bug.cgi?id=189978
2695
2696         Reviewed by Jon Lee.
2697
2698         Logging will allow us to better identify the most in-demand WebGL 2 features and prioritize our efforts.
2699
2700         No tests as no change in WebGL functionality.
2701
2702         * html/canvas/WebGL2RenderingContext.cpp: Added logging statement to every function not yet implemented.
2703         (WebCore::WebGL2RenderingContext::blitFramebuffer):
2704         (WebCore::WebGL2RenderingContext::framebufferTextureLayer):
2705         (WebCore::WebGL2RenderingContext::invalidateFramebuffer):
2706         (WebCore::WebGL2RenderingContext::invalidateSubFramebuffer):
2707         (WebCore::WebGL2RenderingContext::readBuffer):
2708         (WebCore::WebGL2RenderingContext::texStorage3D):
2709         (WebCore::WebGL2RenderingContext::texImage2D):
2710         (WebCore::WebGL2RenderingContext::texImage3D):
2711         (WebCore::WebGL2RenderingContext::texSubImage2D):
2712         (WebCore::WebGL2RenderingContext::texSubImage3D):
2713         (WebCore::WebGL2RenderingContext::copyTexSubImage3D):
2714         (WebCore::WebGL2RenderingContext::compressedTexImage2D):
2715         (WebCore::WebGL2RenderingContext::compressedTexImage3D):
2716         (WebCore::WebGL2RenderingContext::compressedTexSubImage3D):
2717         (WebCore::WebGL2RenderingContext::getFragDataLocation):
2718         (WebCore::WebGL2RenderingContext::uniform1ui):
2719         (WebCore::WebGL2RenderingContext::uniform2ui):
2720         (WebCore::WebGL2RenderingContext::uniform3ui):
2721         (WebCore::WebGL2RenderingContext::uniform4ui):
2722         (WebCore::WebGL2RenderingContext::uniform1uiv):
2723         (WebCore::WebGL2RenderingContext::uniform2uiv):
2724         (WebCore::WebGL2RenderingContext::uniform3uiv):
2725         (WebCore::WebGL2RenderingContext::uniform4uiv):
2726         (WebCore::WebGL2RenderingContext::uniformMatrix2x3fv):
2727         (WebCore::WebGL2RenderingContext::uniformMatrix3x2fv):
2728         (WebCore::WebGL2RenderingContext::uniformMatrix2x4fv):
2729         (WebCore::WebGL2RenderingContext::uniformMatrix4x2fv):
2730         (WebCore::WebGL2RenderingContext::uniformMatrix3x4fv):
2731         (WebCore::WebGL2RenderingContext::uniformMatrix4x3fv):
2732         (WebCore::WebGL2RenderingContext::vertexAttribI4i):
2733         (WebCore::WebGL2RenderingContext::vertexAttribI4iv):
2734         (WebCore::WebGL2RenderingContext::vertexAttribI4ui):
2735         (WebCore::WebGL2RenderingContext::vertexAttribI4uiv):
2736         (WebCore::WebGL2RenderingContext::vertexAttribIPointer):
2737         (WebCore::WebGL2RenderingContext::drawRangeElements):
2738         (WebCore::WebGL2RenderingContext::createQuery):
2739         (WebCore::WebGL2RenderingContext::deleteQuery):
2740         (WebCore::WebGL2RenderingContext::isQuery):
2741         (WebCore::WebGL2RenderingContext::beginQuery):
2742         (WebCore::WebGL2RenderingContext::endQuery):
2743         (WebCore::WebGL2RenderingContext::getQuery):
2744         (WebCore::WebGL2RenderingContext::getQueryParameter):
2745         (WebCore::WebGL2RenderingContext::createSampler):
2746         (WebCore::WebGL2RenderingContext::deleteSampler):
2747         (WebCore::WebGL2RenderingContext::isSampler):
2748         (WebCore::WebGL2RenderingContext::bindSampler):
2749         (WebCore::WebGL2RenderingContext::samplerParameteri):
2750         (WebCore::WebGL2RenderingContext::samplerParameterf):
2751         (WebCore::WebGL2RenderingContext::getSamplerParameter):
2752         (WebCore::WebGL2RenderingContext::fenceSync):
2753         (WebCore::WebGL2RenderingContext::isSync):
2754         (WebCore::WebGL2RenderingContext::deleteSync):
2755         (WebCore::WebGL2RenderingContext::clientWaitSync):
2756         (WebCore::WebGL2RenderingContext::waitSync):
2757         (WebCore::WebGL2RenderingContext::getSyncParameter):
2758         (WebCore::WebGL2RenderingContext::createTransformFeedback):
2759         (WebCore::WebGL2RenderingContext::deleteTransformFeedback):
2760         (WebCore::WebGL2RenderingContext::isTransformFeedback):
2761         (WebCore::WebGL2RenderingContext::bindTransformFeedback):
2762         (WebCore::WebGL2RenderingContext::beginTransformFeedback):
2763         (WebCore::WebGL2RenderingContext::endTransformFeedback):
2764         (WebCore::WebGL2RenderingContext::transformFeedbackVaryings):
2765         (WebCore::WebGL2RenderingContext::getTransformFeedbackVarying):
2766         (WebCore::WebGL2RenderingContext::pauseTransformFeedback):
2767         (WebCore::WebGL2RenderingContext::resumeTransformFeedback):
2768         (WebCore::WebGL2RenderingContext::bindBufferBase):
2769         (WebCore::WebGL2RenderingContext::bindBufferRange):
2770         (WebCore::WebGL2RenderingContext::getUniformIndices):
2771         (WebCore::WebGL2RenderingContext::getUniformBlockIndex):
2772         (WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter):
2773         (WebCore::WebGL2RenderingContext::getActiveUniformBlockName):
2774         (WebCore::WebGL2RenderingContext::uniformBlockBinding):
2775
2776 2018-09-26  Eric Carlson  <eric.carlson@apple.com>
2777
2778         [MediaStream] Clean up RealtimeMediaSource settings change handling
2779         https://bugs.webkit.org/show_bug.cgi?id=189998
2780         <rdar://problem/44797884>
2781
2782         Reviewed by Youenn Fablet.
2783
2784         No new tests, no change in functionality.
2785
2786         * platform/mediastream/RealtimeMediaSource.cpp:
2787         (WebCore::RealtimeMediaSource::notifySettingsDidChangeObservers):
2788         (WebCore::RealtimeMediaSource::setSize):
2789         (WebCore::RealtimeMediaSource::setFrameRate):
2790         (WebCore::RealtimeMediaSource::setAspectRatio):
2791         (WebCore::RealtimeMediaSource::setFacingMode):
2792         (WebCore::RealtimeMediaSource::setVolume):
2793         (WebCore::RealtimeMediaSource::setSampleRate):
2794         (WebCore::RealtimeMediaSource::setSampleSize):
2795         (WebCore::RealtimeMediaSource::setEchoCancellation):
2796         (WebCore::RealtimeMediaSource::settingsDidChange): Deleted.
2797         * platform/mediastream/RealtimeMediaSource.h:
2798         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2799         (WebCore::AVVideoCaptureSource::settingsDidChange):
2800         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2801         (WebCore::CoreAudioCaptureSource::settingsDidChange):
2802         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
2803         (WebCore::DisplayCaptureSourceCocoa::settingsDidChange):
2804         * platform/mock/MockRealtimeAudioSource.cpp:
2805         (WebCore::MockRealtimeAudioSource::settingsDidChange):
2806         * platform/mock/MockRealtimeVideoSource.cpp:
2807         (WebCore::MockRealtimeVideoSource::settingsDidChange):
2808
2809 2018-09-26  Antoine Quint  <graouts@apple.com>
2810
2811         [Web Animations] Ensure renderers with accelerated animations have layers
2812         https://bugs.webkit.org/show_bug.cgi?id=189990
2813         <rdar://problem/44791222>
2814
2815         Reviewed by Zalan Bujtas.
2816
2817         We have done some work already in webkit.org/b/189784 to prevent never-ending calls to DocumentTimeline::updateAnimations(). This was due to
2818         the change made for webkit.org/b/186930 where we queued calls to updateAnimations() in KeyframeEffectReadOnly::applyPendingAcceleratedActions()
2819         while we were waiting for a renderer with a layer backing for a given animation target. Instead of doing this, we now ensure renderers always
2820         have a layer when they have an accelerated animation applied.
2821
2822         No new tests, this is already covered by webanimations/accelerated-animation-with-delay.html and webanimations/opacity-animation-yields-compositing-span.html
2823         which respectively check that we can apply an accelerated animation to a non-positioned block and an inline element.
2824
2825         * animation/DocumentTimeline.cpp:
2826         (WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated const): This method should have been marked const all along and it is
2827         now required so it can be called through RenderBox::requiresLayer() and RenderInline::requiresLayer().
2828         (WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated): Deleted.
2829         * animation/DocumentTimeline.h:
2830         * animation/KeyframeEffectReadOnly.cpp:
2831         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Stop enqueuing the accelerated actions in case we're lacking a composited renderer
2832         since this situation should no longer arise.
2833         * rendering/RenderBox.h: Make requiresLayer() return true if this renderer's element is the target of accelerated animations.
2834         * rendering/RenderBoxModelObject.cpp:
2835         (WebCore::RenderBoxModelObject::hasRunningAcceleratedAnimations const): Query the document timeline, if it exists, to check that this renderer's element
2836         has accelerated animations applied.
2837         * rendering/RenderBoxModelObject.h:
2838         * rendering/RenderInline.h: Make requiresLayer() return true if this renderer's element is the target of accelerated animations.
2839
2840 2018-09-25  Eric Carlson  <eric.carlson@apple.com>
2841
2842         [MediaStream] Add Mac window capture source
2843         https://bugs.webkit.org/show_bug.cgi?id=189958
2844         <rdar://problem/44767616>
2845
2846         Reviewed by Youenn Fablet.
2847
2848         * SourcesCocoa.txt: Add WindowDisplayCaptureSourceMac.
2849         * WebCore.xcodeproj/project.pbxproj: Ditto.
2850
2851         * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
2852         (WebCore::DisplayCaptureManagerCocoa::captureDevices): Include window "devices".
2853         (WebCore::DisplayCaptureManagerCocoa::updateWindowCaptureDevices): New.
2854         (WebCore::DisplayCaptureManagerCocoa::windowCaptureDeviceWithPersistentID): New.
2855         (WebCore::DisplayCaptureManagerCocoa::captureDeviceWithPersistentID): Include window devices.
2856         * platform/mediastream/mac/DisplayCaptureManagerCocoa.h:
2857
2858         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
2859         (WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa):
2860         (WebCore::DisplayCaptureSourceCocoa::settings): Use frameSize, report surface type and 
2861         logical surface.
2862         (WebCore::DisplayCaptureSourceCocoa::settingsDidChange): Clear m_lastSampleBuffer when size changes.
2863         (WebCore::DisplayCaptureSourceCocoa::frameSize const): New, return size() or intrinsic size.
2864         (WebCore::DisplayCaptureSourceCocoa::setIntrinsicSize): New.
2865         (WebCore::DisplayCaptureSourceCocoa::emitFrame): generateFrame now returns a CVPixelBuffer
2866         so derived classes don't have to deal with resizing/transforming.
2867         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
2868
2869         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2870
2871         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
2872         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
2873         (WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac): Add fixme.
2874         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Update intrinsic size when
2875         width/height changes.
2876         (WebCore::ScreenDisplayCaptureSourceMac::generateFrame): Return a CVPixelBuffer.
2877
2878         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.h: Added.
2879         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm: Added.
2880         (WebCore::anyOfCGWindow):
2881         (WebCore::windowDescription):
2882         (WebCore::WindowDisplayCaptureSourceMac::create):
2883         (WebCore::WindowDisplayCaptureSourceMac::WindowDisplayCaptureSourceMac):
2884         (WebCore::WindowDisplayCaptureSourceMac::windowImage):
2885         (WebCore::WindowDisplayCaptureSourceMac::generateFrame):
2886         (WebCore::WindowDisplayCaptureSourceMac::pixelBufferFromCGImage):
2887         (WebCore::WindowDisplayCaptureSourceMac::windowCaptureDeviceWithPersistentID):
2888         (WebCore::WindowDisplayCaptureSourceMac::windowCaptureDevices):
2889
2890 2018-09-25  Justin Fan  <justin_fan@apple.com>
2891
2892         WebGL 2 Conformance: primitive restart and draw_primitive_restart WebGL2 sample
2893         https://bugs.webkit.org/show_bug.cgi?id=189625
2894         <rdar://problem/42882620>
2895
2896         Reviewed by Dean Jackson.
2897
2898         Ref test: webgl/webgl2-primitive-restart.html.
2899
2900         Implement support for Primitive Restart Fixed Index as expected 
2901         by the WebGL 2 specifications. 
2902
2903         * html/canvas/WebGL2RenderingContext.cpp:
2904         (WebCore::WebGL2RenderingContext::validateIndexArrayConservative):
2905         * html/canvas/WebGLRenderingContextBase.h:
2906         (WebCore::WebGLRenderingContextBase::getLastIndex): Template that must be defined in header.
2907         * html/canvas/WebGLRenderingContextBase.cpp:
2908         (WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
2909         * platform/graphics/GraphicsContext3D.h:
2910         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2911         (WebCore::GraphicsContext3D::GraphicsContext3D):
2912         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2913         (WebCore::GraphicsContext3D::primitiveRestartIndex):
2914
2915 2018-09-25  John Wilander  <wilander@apple.com>
2916
2917         Change from HAVE(CFNETWORK_STORAGE_PARTITIONING) to ENABLE(RESOURCE_LOAD_STATISTICS)
2918         https://bugs.webkit.org/show_bug.cgi?id=189959
2919         <rdar://problem/44767642>
2920
2921         Reviewed by Chris Dumez.
2922
2923         No new tests because of no code change.
2924
2925         We no longer make use of CFNetwork's cookie partitioning so we should
2926         change the compile-time flag to something that makes sense. This should
2927         also make it easier/cleaner for other ports.
2928
2929         * dom/Document.cpp:
2930         (WebCore::Document::hasStorageAccess):
2931         (WebCore::Document::requestStorageAccess):
2932         (WebCore::Document::setHasRequestedPageSpecificStorageAccessWithUserInteraction):
2933         * dom/Document.h:
2934         * loader/EmptyFrameLoaderClient.h:
2935         * loader/FrameLoaderClient.h:
2936         * loader/ResourceLoadObserver.cpp:
2937         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2938         (WebCore::ResourceLoadObserver::logWindowCreation):
2939         * loader/ResourceLoadObserver.h:
2940         * page/DOMWindow.cpp:
2941         (WebCore::DOMWindow::createWindow):
2942         * platform/network/NetworkStorageSession.h:
2943         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2944         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2945         (WebCore::cookiesForURL):
2946         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
2947
2948 2018-09-25  Jiewen Tan  <jiewen_tan@apple.com>
2949
2950         [WebAuthN] Make AuthenticatorManager
2951         https://bugs.webkit.org/show_bug.cgi?id=189279
2952         <rdar://problem/44116792>
2953
2954         Reviewed by Chris Dumez.
2955
2956         This patch does the following things in WebCore in order to support AuthenticatorManager:
2957         1) It separates AuthenticatorTransport from PublicKeyCredentialDescriptor such that the enum
2958         can be queried from WebKit directly.
2959         2) It adds AuthenticatorAttachment to PublicKeyCredentialCreationOptions such that relying parties
2960         could express their interests in cross platform authenticators.
2961         3) It enhances IPC encoder/decoder of a few such that Vectors and empty objects can be correctly coded.
2962         4) It moves the LocalAuthenticator implementation to WebKit to better integrate with AuthenticatorManager.
2963         5) It moves linking to LocalAuthentication.framework to WebKit as well.
2964         6) It temporarily bans old mock test mechanism in Internals so we could enable the new mock test mechanism in
2965         WebKitTestRunner which we will have a better coverage of codes in UI Process. Those tests will be either
2966         removed or ported to the new mechanism in Bug 189283.
2967         7) It also removes "using namespace WebCore" from the top namespace in some .mm files as they are reordered
2968         to where they could introduce name confusions.
2969
2970         Tests: http/wpt/webauthn/public-key-credential-create-failure-local.https.html
2971                http/wpt/webauthn/public-key-credential-create-success-local.https.html
2972                http/wpt/webauthn/public-key-credential-get-failure-local.https.html
2973                http/wpt/webauthn/public-key-credential-get-success-local.https.html
2974                http/wpt/webauthn/public-key-credential-is-user-verifying-platform-authenticator-available.html
2975
2976         * CMakeLists.txt:
2977         * Configurations/WebCore.xcconfig:
2978         * DerivedSources.make:
2979         * Modules/webauthn/AuthenticatorTransport.h: Copied from Source/WebCore/platform/cocoa/LocalAuthenticationSoftLink.h.
2980         * Modules/webauthn/AuthenticatorTransport.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialDescriptor.idl.
2981         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
2982         (WebCore::PublicKeyCredentialCreationOptions::encode const):
2983         (WebCore::PublicKeyCredentialCreationOptions::decode):
2984         * Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
2985         * Modules/webauthn/PublicKeyCredentialData.h:
2986         (WebCore::PublicKeyCredentialData::encode const):
2987         (WebCore::PublicKeyCredentialData::decode):
2988         * Modules/webauthn/PublicKeyCredentialDescriptor.h:
2989         (WebCore::PublicKeyCredentialDescriptor::encode const):
2990         * Modules/webauthn/PublicKeyCredentialDescriptor.idl:
2991         * Modules/webauthn/cocoa/LocalAuthenticator.mm: Removed.
2992         * Sources.txt:
2993         * SourcesCocoa.txt:
2994         * WebCore.xcodeproj/project.pbxproj:
2995         * dom/ExceptionData.h:
2996         * platform/cocoa/LocalAuthenticationSoftLink.mm: Removed.
2997         * platform/cocoa/SharedBufferCocoa.mm:
2998         (-[WebCoreSharedBufferData initWithSharedBufferDataSegment:]):
2999         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
3000         (VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement): Deleted.
3001         (VideoFullscreenModelVideoElement::~VideoFullscreenModelVideoElement): Deleted.
3002         (VideoFullscreenModelVideoElement::setVideoElement): Deleted.
3003         (VideoFullscreenModelVideoElement::handleEvent): Deleted.
3004         (VideoFullscreenModelVideoElement::updateForEventName): Deleted.
3005         (VideoFullscreenModelVideoElement::willExitFullscreen): Deleted.
3006         (VideoFullscreenModelVideoElement::setVideoFullscreenLayer): Deleted.
3007         (VideoFullscreenModelVideoElement::waitForPreparedForInlineThen): Deleted.
3008         (VideoFullscreenModelVideoElement::requestFullscreenMode): Deleted.
3009         (VideoFullscreenModelVideoElement::setVideoLayerFrame): Deleted.
3010         (VideoFullscreenModelVideoElement::setVideoLayerGravity): Deleted.
3011         (VideoFullscreenModelVideoElement::observedEventNames): Deleted.
3012         (VideoFullscreenModelVideoElement::eventNameAll): Deleted.
3013         (VideoFullscreenModelVideoElement::fullscreenModeChanged): Deleted.
3014         (VideoFullscreenModelVideoElement::addClient): Deleted.
3015         (VideoFullscreenModelVideoElement::removeClient): Deleted.
3016         (VideoFullscreenModelVideoElement::isVisible const): Deleted.
3017         (VideoFullscreenModelVideoElement::setHasVideo): Deleted.
3018         (VideoFullscreenModelVideoElement::setVideoDimensions): Deleted.
3019         (VideoFullscreenModelVideoElement::willEnterPictureInPicture): Deleted.
3020         (VideoFullscreenModelVideoElement::didEnterPictureInPicture): Deleted.
3021         (VideoFullscreenModelVideoElement::failedToEnterPictureInPicture): Deleted.
3022         (VideoFullscreenModelVideoElement::willExitPictureInPicture): Deleted.
3023         (VideoFullscreenModelVideoElement::didExitPictureInPicture): Deleted.
3024         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
3025         (WebCore::hasExplicitBeginTime):
3026         (WebCore::setHasExplicitBeginTime):
3027         (WebCore::toCAFillModeType):
3028         (WebCore::toCAValueFunctionType):
3029         (WebCore::toCAMediaTimingFunction):
3030         (WebCore::PlatformCAAnimationCocoa::setFromValue):
3031         (WebCore::PlatformCAAnimationCocoa::setToValue):
3032         (WebCore::PlatformCAAnimationCocoa::setValues):
3033         (fromCAFillModeType): Deleted.
3034         (fromCAValueFunctionType): Deleted.
3035         (PlatformCAAnimationCocoa::create): Deleted.
3036         (PlatformCAAnimationCocoa::PlatformCAAnimationCocoa): Deleted.
3037         (PlatformCAAnimationCocoa::~PlatformCAAnimationCocoa): Deleted.
3038         (PlatformCAAnimationCocoa::copy const): Deleted.
3039         (PlatformCAAnimationCocoa::platformAnimation const): Deleted.
3040         (PlatformCAAnimationCocoa::keyPath const): Deleted.
3041         (PlatformCAAnimationCocoa::beginTime const): Deleted.
3042         (PlatformCAAnimationCocoa::setBeginTime): Deleted.
3043         (PlatformCAAnimationCocoa::duration const): Deleted.
3044         (PlatformCAAnimationCocoa::setDuration): Deleted.
3045         (PlatformCAAnimationCocoa::speed const): Deleted.
3046         (PlatformCAAnimationCocoa::setSpeed): Deleted.
3047         (PlatformCAAnimationCocoa::timeOffset const): Deleted.
3048         (PlatformCAAnimationCocoa::setTimeOffset): Deleted.
3049         (PlatformCAAnimationCocoa::repeatCount const): Deleted.
3050         (PlatformCAAnimationCocoa::setRepeatCount): Deleted.
3051         (PlatformCAAnimationCocoa::autoreverses const): Deleted.
3052         (PlatformCAAnimationCocoa::setAutoreverses): Deleted.
3053         (PlatformCAAnimationCocoa::fillMode const): Deleted.
3054         (PlatformCAAnimationCocoa::setFillMode): Deleted.
3055         (PlatformCAAnimationCocoa::setTimingFunction): Deleted.
3056         (PlatformCAAnimationCocoa::copyTimingFunctionFrom): Deleted.
3057         (PlatformCAAnimationCocoa::isRemovedOnCompletion const): Deleted.
3058         (PlatformCAAnimationCocoa::setRemovedOnCompletion): Deleted.
3059         (PlatformCAAnimationCocoa::isAdditive const): Deleted.
3060         (PlatformCAAnimationCocoa::setAdditive): Deleted.
3061         (PlatformCAAnimationCocoa::valueFunction const): Deleted.
3062         (PlatformCAAnimationCocoa::setValueFunction): Deleted.
3063         (PlatformCAAnimationCocoa::setFromValue): Deleted.
3064         (PlatformCAAnimationCocoa::copyFromValueFrom): Deleted.
3065         (PlatformCAAnimationCocoa::setToValue): Deleted.
3066         (PlatformCAAnimationCocoa::copyToValueFrom): Deleted.
3067         (PlatformCAAnimationCocoa::setValues): Deleted.
3068         (PlatformCAAnimationCocoa::copyValuesFrom): Deleted.
3069         (PlatformCAAnimationCocoa::setKeyTimes): Deleted.
3070         (PlatformCAAnimationCocoa::copyKeyTimesFrom): Deleted.
3071         (PlatformCAAnimationCocoa::setTimingFunctions): Deleted.
3072         (PlatformCAAnimationCocoa::copyTimingFunctionsFrom): Deleted.
3073         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
3074         (PlatformCAFilters::filterValueForOperation): Deleted.
3075         (PlatformCAFilters::colorMatrixValueForFilter): Deleted.
3076         (PlatformCAFilters::setBlendingFiltersOnLayer): Deleted.
3077         (PlatformCAFilters::numAnimatedFilterProperties): Deleted.
3078         (PlatformCAFilters::animatedFilterPropertyName): Deleted.
3079         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3080         (-[WebAnimationDelegate animationDidStart:]):
3081         (-[WebAnimationDelegate animationDidStop:finished:]):
3082         (-[WebAnimationDelegate setOwner:]):
3083         (PlatformCALayerCocoa::create): Deleted.
3084         (PlatformCALayer::platformCALayer): Deleted.
3085         (mediaTimeToCurrentTime): Deleted.
3086         (PlatformCALayerCocoa::setOwner): Deleted.
3087         (toCAFilterType): Deleted.
3088         (PlatformCALayerCocoa::layerTypeForPlatformLayer): Deleted.
3089         (PlatformCALayerCocoa::PlatformCALayerCocoa): Deleted.
3090         (PlatformCALayerCocoa::commonInit): Deleted.
3091         (PlatformCALayerCocoa::clone const): Deleted.
3092         (PlatformCALayerCocoa::~PlatformCALayerCocoa): Deleted.
3093         (PlatformCALayerCocoa::animationStarted): Deleted.
3094         (PlatformCALayerCocoa::animationEnded): Deleted.
3095         (PlatformCALayerCocoa::setNeedsDisplay): Deleted.
3096         (PlatformCALayerCocoa::setNeedsDisplayInRect): Deleted.
3097         (PlatformCALayerCocoa::copyContentsFromLayer): Deleted.
3098         (PlatformCALayerCocoa::superlayer const): Deleted.
3099         (PlatformCALayerCocoa::removeFromSuperlayer): Deleted.
3100         (PlatformCALayerCocoa::setSublayers): Deleted.
3101         (PlatformCALayerCocoa::removeAllSublayers): Deleted.
3102         (PlatformCALayerCocoa::appendSublayer): Deleted.
3103         (PlatformCALayerCocoa::insertSublayer): Deleted.
3104         (PlatformCALayerCocoa::replaceSublayer): Deleted.
3105         (PlatformCALayerCocoa::adoptSublayers): Deleted.
3106         (PlatformCALayerCocoa::addAnimationForKey): Deleted.
3107         (PlatformCALayerCocoa::removeAnimationForKey): Deleted.
3108         (PlatformCALayerCocoa::animationForKey): Deleted.
3109         (PlatformCALayerCocoa::setMask): Deleted.
3110         (PlatformCALayerCocoa::isOpaque const): Deleted.
3111         (PlatformCALayerCocoa::setOpaque): Deleted.
3112         (PlatformCALayerCocoa::bounds const): Deleted.
3113         (PlatformCALayerCocoa::setBounds): Deleted.
3114         (PlatformCALayerCocoa::position const): Deleted.
3115         (PlatformCALayerCocoa::setPosition): Deleted.
3116         (PlatformCALayerCocoa::anchorPoint const): Deleted.
3117         (PlatformCALayerCocoa::setAnchorPoint): Deleted.
3118         (PlatformCALayerCocoa::transform const): Deleted.
3119         (PlatformCALayerCocoa::setTransform): Deleted.
3120         (PlatformCALayerCocoa::sublayerTransform const): Deleted.
3121         (PlatformCALayerCocoa::setSublayerTransform): Deleted.
3122         (PlatformCALayerCocoa::isHidden const): Deleted.
3123         (PlatformCALayerCocoa::setHidden): Deleted.
3124         (PlatformCALayerCocoa::contentsHidden const): Deleted.
3125         (PlatformCALayerCocoa::setContentsHidden): Deleted.
3126         (PlatformCALayerCocoa::userInteractionEnabled const): Deleted.
3127         (PlatformCALayerCocoa::setUserInteractionEnabled): Deleted.
3128         (PlatformCALayerCocoa::setBackingStoreAttached): Deleted.
3129         (PlatformCALayerCocoa::backingStoreAttached const): Deleted.
3130         (PlatformCALayerCocoa::geometryFlipped const): Deleted.
3131         (PlatformCALayerCocoa::setGeometryFlipped): Deleted.
3132         (PlatformCALayerCocoa::isDoubleSided const): Deleted.
3133         (PlatformCALayerCocoa::setDoubleSided): Deleted.
3134         (PlatformCALayerCocoa::masksToBounds const): Deleted.
3135         (PlatformCALayerCocoa::setMasksToBounds): Deleted.
3136         (PlatformCALayerCocoa::acceleratesDrawing const): Deleted.
3137         (PlatformCALayerCocoa::setAcceleratesDrawing): Deleted.
3138         (PlatformCALayerCocoa::wantsDeepColorBackingStore const): Deleted.
3139         (PlatformCALayerCocoa::setWantsDeepColorBackingStore): Deleted.
3140         (PlatformCALayerCocoa::supportsSubpixelAntialiasedText const): Deleted.
3141         (PlatformCALayerCocoa::setSupportsSubpixelAntialiasedText): Deleted.
3142         (PlatformCALayerCocoa::hasContents const): Deleted.
3143         (PlatformCALayerCocoa::contents const): Deleted.
3144         (PlatformCALayerCocoa::setContents): Deleted.
3145         (PlatformCALayerCocoa::setContentsRect): Deleted.
3146         (PlatformCALayerCocoa::setMinificationFilter): Deleted.
3147         (PlatformCALayerCocoa::setMagnificationFilter): Deleted.
3148         (PlatformCALayerCocoa::backgroundColor const): Deleted.
3149         (PlatformCALayerCocoa::setBackgroundColor): Deleted.
3150         (PlatformCALayerCocoa::setBorderWidth): Deleted.
3151         (PlatformCALayerCocoa::setBorderColor): Deleted.
3152         (PlatformCALayerCocoa::opacity const): Deleted.
3153         (PlatformCALayerCocoa::setOpacity): Deleted.
3154         (PlatformCALayerCocoa::setFilters): Deleted.
3155         (PlatformCALayerCocoa::copyFiltersFrom): Deleted.
3156         (PlatformCALayerCocoa::filtersCanBeComposited): Deleted.
3157         (PlatformCALayerCocoa::setBlendMode): Deleted.
3158         (PlatformCALayerCocoa::setName): Deleted.
3159         (PlatformCALayerCocoa::setSpeed): Deleted.
3160         (PlatformCALayerCocoa::setTimeOffset): Deleted.
3161         (PlatformCALayerCocoa::contentsScale const): Deleted.
3162         (PlatformCALayerCocoa::setContentsScale): Deleted.
3163         (PlatformCALayerCocoa::cornerRadius const): Deleted.
3164         (PlatformCALayerCocoa::setCornerRadius): Deleted.
3165         (PlatformCALayerCocoa::setEdgeAntialiasingMask): Deleted.
3166         (PlatformCALayerCocoa::shapeRoundedRect const): Deleted.
3167         (PlatformCALayerCocoa::setShapeRoundedRect): Deleted.
3168         (PlatformCALayerCocoa::shapeWindRule const): Deleted.
3169         (PlatformCALayerCocoa::setShapeWindRule): Deleted.
3170         (PlatformCALayerCocoa::shapePath const): Deleted.
3171         (PlatformCALayerCocoa::setShapePath): Deleted.
3172         (PlatformCALayerCocoa::requiresCustomAppearanceUpdateOnBoundsChange const): Deleted.
3173         (PlatformCALayerCocoa::updateCustomAppearance): Deleted.
3174         (layerContentsFormat): Deleted.
3175         (PlatformCALayerCocoa::updateContentsFormat): Deleted.
3176         (PlatformCALayerCocoa::tiledBacking): Deleted.
3177         (PlatformCALayer::isWebLayer): Deleted.
3178         (PlatformCALayer::setBoundsOnMainThread): Deleted.
3179         (PlatformCALayer::setPositionOnMainThread): Deleted.
3180         (PlatformCALayer::setAnchorPointOnMainThread): Deleted.
3181         (PlatformCALayer::collectRectsToPaint): Deleted.
3182         (PlatformCALayer::drawLayerContents): Deleted.
3183         (PlatformCALayer::frameForLayer): Deleted.
3184         (PlatformCALayerCocoa::createCompatibleLayer const): Deleted.
3185         (PlatformCALayerCocoa::enumerateRectsBeingDrawn): Deleted.
3186         (PlatformCALayerCocoa::backingStoreBytesPerPixel const): Deleted.
3187         (PlatformCALayerCocoa::avPlayerLayer const): Deleted.
3188         * platform/graphics/ca/cocoa/WebSystemBackdropLayer.mm:
3189         (-[WebLightSystemBackdropLayer init]):
3190         (-[WebDarkSystemBackdropLayer init]):
3191         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
3192         (-[WebTiledBackingLayer createTileController:]):
3193         (-[WebTiledBackingLayer setNeedsDisplayInRect:]):
3194         (-[WebTiledBackingLayer setBorderColor:]):
3195         * testing/Internals.cpp:
3196         (WebCore::Internals::Internals):
3197
3198 2018-09-25  YUHAN WU  <yuhan_wu@apple.com>
3199
3200         Implement MediaStreamTrack Content Hints
3201         https://bugs.webkit.org/show_bug.cgi?id=189262
3202         <rdar://problem/44101773>
3203
3204         Reviewed by Youenn Fablet.
3205
3206         contentHint is a new attribute which is stored in MediaStreamTrackPrivate.
3207         https://w3c.github.io/mst-content-hint/
3208
3209         Covered by tests: 
3210         LayoutTests/imported/w3c/web-platform-tests/mst-content-hint/MediaStreamTrack-contentHint.html
3211         LayoutTests/imported/w3c/web-platform-tests/mst-content-hint/idlharness.window.html
3212
3213         * Modules/mediastream/MediaStreamTrack.cpp:
3214         (WebCore::MediaStreamTrack::contentHint const):
3215         (WebCore::MediaStreamTrack::setContentHint):
3216         * Modules/mediastream/MediaStreamTrack.h:
3217         * Modules/mediastream/MediaStreamTrack.idl:
3218         * platform/mediastream/MediaStreamTrackPrivate.cpp:
3219         (WebCore::MediaStreamTrackPrivate::setContentHint):
3220         (WebCore::MediaStreamTrackPrivate::clone):
3221         * platform/mediastream/MediaStreamTrackPrivate.h:
3222         (WebCore::MediaStreamTrackPrivate::contentHint):
3223
3224 2018-09-25  Alex Christensen  <achristensen@webkit.org>
3225
3226         Allow for suffixes to com.apple.WebKit.WebContent
3227         https://bugs.webkit.org/show_bug.cgi?id=189972
3228
3229         Reviewed by Chris Dumez.
3230
3231         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
3232         (WebCore::isInWebProcess):
3233
3234 2018-09-25  Wenson Hsieh  <wenson_hsieh@apple.com>
3235
3236         [iOS] Fix the open source iOS 12 build after r236445
3237         https://bugs.webkit.org/show_bug.cgi?id=189953
3238
3239         Reviewed by Alex Christensen.
3240
3241         Remove soft-linking macros from several sources in WebCore, and instead import UIKitSoftLink from PAL. This
3242         allows different WebCore sources to soft-link UIKit (and its classes and symbols) without reimplementing
3243         WebCore::UIKitLibrary.
3244
3245         * editing/cocoa/FontAttributesCocoa.mm:
3246         * editing/cocoa/FontShadowCocoa.mm:
3247         (WebCore::FontShadow::createShadow const):
3248         * platform/graphics/cocoa/ColorCocoa.mm:
3249         (WebCore::platformColor):
3250         * platform/ios/PlatformScreenIOS.mm:
3251         (WebCore::screenIsMonochrome):
3252         (WebCore::screenHasInvertedColors):
3253         (WebCore::screenSize):
3254         (WebCore::availableScreenSize):
3255         (WebCore::screenScaleFactor):
3256
3257 2018-09-25  Thibault Saunier  <tsaunier@igalia.com>
3258
3259         [WPE][GTK][WebRTC] Fixup VP8 encoding support
3260         https://bugs.webkit.org/show_bug.cgi?id=189921
3261
3262         Previous leak fixing commit introduced a regression in
3263         the way the encoded buffer were prepared in the default
3264         GStreamerVideoEncoder::Fragmentize implementation (when
3265         encoding with VP8 basically).
3266
3267         + Fix a build warning in the decoder.
3268         + Fix some wrong object members namings.
3269         + Properly move the caps reference when setting restriction caps.
3270         + Do not raise a GStreamer error when GStreamerVideoEncoder::OnEncodedImage
3271           fails - this might be a network issue and other encoders do not consider that
3272           fatal.
3273         + Use GstMappedBuffer where appropriate.
3274
3275         Reviewed by Philippe Normand.
3276
3277         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
3278         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
3279         (WebCore::GStreamerVideoEncoder::InitEncode):
3280         (WebCore::GStreamerVideoEncoder::newSampleCallback):
3281         (WebCore::GStreamerVideoEncoder::Fragmentize):
3282         (WebCore::GStreamerVideoEncoder::SetRestrictionCaps):
3283
3284 2018-09-25  Eric Carlson  <eric.carlson@apple.com>
3285
3286         [MediaStream] Update constraints supported by getDisplayMedia
3287         https://bugs.webkit.org/show_bug.cgi?id=189930
3288
3289         Reviewed by Youenn Fablet.
3290
3291         No new tests, updated http/tests/media/media-stream/get-display-media-prompt.html.
3292
3293         * Modules/mediastream/MediaDevices.cpp:
3294         (WebCore::MediaDevices::getDisplayMedia const): Ignore audio constraints.
3295
3296         * Modules/mediastream/UserMediaRequest.cpp:
3297         (WebCore::hasInvalidGetDisplayMediaConstraint): Check for invalid constraints.
3298         (WebCore::UserMediaRequest::start): Check for invalid constraints.
3299         (WebCore::UserMediaRequest::deny): Support new error.
3300         * Modules/mediastream/UserMediaRequest.h:
3301
3302         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
3303         (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints):
3304
3305 2018-09-25  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3306
3307         [EME] Fix variable name that should have gone in r236317
3308         https://bugs.webkit.org/show_bug.cgi?id=189944
3309
3310         Reviewed by Jer Noble.
3311
3312         m_cdmInstanceClientWeakPtrFactory becomes
3313         m_cdmInstanceSessionClientWeakPtrFactory as its type changes to
3314         CDMInstanceSessionClient.
3315
3316         * Modules/encryptedmedia/MediaKeySession.cpp:
3317         (WebCore::MediaKeySession::MediaKeySession):
3318         * Modules/encryptedmedia/MediaKeySession.h:
3319
3320 2018-09-25  Simon Fraser  <simon.fraser@apple.com>
3321
3322         Clean up code around RenderLayer's "has accelerated scrolling" functions
3323         https://bugs.webkit.org/show_bug.cgi?id=189932
3324
3325         Reviewed by Zalan Bujtas.
3326         
3327         RenderLayer had:
3328         
3329         bool hasAcceleratedTouchScrolling()
3330         bool hasTouchScrollableOverflow()
3331         bool usesAcceleratedScrolling()
3332         bool usesCompositedScrolling()
3333         bool usesAsyncScrolling()
3334         
3335         which are hard to keep in your head. Removed usesAcceleratedScrolling() since it just returns hasTouchScrollableOverflow().
3336         Renamed hasAcceleratedTouchScrolling() to canUseAcceleratedTouchScrolling() to indicate that it just looks at style,
3337         not whether layout has given the layer scrollable overflow yet. Tidy up some #ifdefs.
3338         
3339         usesCompositedScrolling() and usesAsyncScrolling() are ScrollableArea overrides, and
3340         look at backing layers, so require that compositing has run already. Note this in comments.
3341
3342         * rendering/RenderLayer.cpp:
3343         (WebCore::RenderLayer::canUseAcceleratedTouchScrolling const):
3344         (WebCore::RenderLayer::hasTouchScrollableOverflow const):
3345         (WebCore::RenderLayer::handleTouchEvent):
3346         (WebCore::RenderLayer::usesAsyncScrolling const):
3347         (WebCore::RenderLayer::showsOverflowControls const):
3348         (WebCore::RenderLayer::calculateClipRects const):
3349         (WebCore::RenderLayer::hasAcceleratedTouchScrolling const): Deleted.
3350         (WebCore::RenderLayer::usesAcceleratedScrolling const): Deleted.
3351         * rendering/RenderLayer.h:
3352         * rendering/RenderLayerBacking.cpp:
3353         (WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling):
3354         (WebCore::RenderLayerBacking::updateConfiguration):
3355         * rendering/RenderLayerCompositor.cpp:
3356         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
3357         (WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const):
3358
3359 2018-09-24  Fujii Hironori  <Hironori.Fujii@sony.com>
3360
3361         Rename WTF_COMPILER_GCC_OR_CLANG to WTF_COMPILER_GCC_COMPATIBLE
3362         https://bugs.webkit.org/show_bug.cgi?id=189733
3363
3364         Reviewed by Michael Catanzaro.
3365
3366         No new tests (No behavior change).
3367
3368         * platform/graphics/cpu/arm/filters/FELightingNEON.cpp:
3369         * platform/graphics/cpu/arm/filters/FELightingNEON.h:
3370         * platform/graphics/filters/FELighting.cpp:
3371         (WebCore::FELighting::platformApply):
3372         * platform/graphics/filters/FELighting.h:
3373
3374 2018-09-24  John Wilander  <wilander@apple.com>
3375
3376         Cap lifetime of persistent cookies created client-side through document.cookie
3377         https://bugs.webkit.org/show_bug.cgi?id=189933
3378         <rdar://problem/44741888>
3379
3380     &nbs