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