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