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