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