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