Remove dead code: resetMediaState.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-10-08  Jeremy Jones  <jeremyj@apple.com>
2
3         Remove dead code: resetMediaState.
4         https://bugs.webkit.org/show_bug.cgi?id=190355
5
6         Reviewed by Jon Lee.
7
8         No new tests because no behavior change.
9
10         Remove resetMediaState since it is no longer used.
11
12         * platform/cocoa/PlaybackSessionInterface.h:
13         (WebCore::PlaybackSessionInterface::~PlaybackSessionInterface):
14         * platform/ios/PlaybackSessionInterfaceAVKit.h:
15         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
16         (WebCore::PlaybackSessionInterfaceAVKit::resetMediaState): Deleted.
17         * platform/ios/WebAVPlayerController.h:
18         * platform/ios/WebAVPlayerController.mm:
19         (-[WebAVPlayerController resetMediaState]): Deleted.
20         * platform/mac/PlaybackSessionInterfaceMac.h:
21         * platform/mac/PlaybackSessionInterfaceMac.mm:
22         (WebCore::PlaybackSessionInterfaceMac::resetMediaState): Deleted.
23
24 2018-10-08  Jeremy Jones  <jeremyj@apple.com>
25
26         Use MediaPlayerEnums::VideoGravity in VideoFullscreenModel.
27         https://bugs.webkit.org/show_bug.cgi?id=190357
28
29         Reviewed by Jon Lee.
30
31         No new tests because no behavior change.
32
33         Use MediaPlayerEnums::VideoGravity instead of creating another identical enum in VideoFullscreenModel.
34
35         * platform/cocoa/VideoFullscreenModel.h:
36         (): Deleted.
37         * platform/cocoa/VideoFullscreenModelVideoElement.h:
38         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
39         (WebCore::VideoFullscreenModelVideoElement::setVideoLayerGravity):
40         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
41         (-[WebAVPlayerLayer setVideoGravity:]):
42         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
43         (VideoFullscreenControllerContext::setVideoLayerGravity):
44         * platform/mac/VideoFullscreenInterfaceMac.mm:
45         (-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]):
46         (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
47
48 2018-10-08  Devin Rousso  <drousso@apple.com>
49
50         Web Inspector: group media network entries by the node that triggered the request
51         https://bugs.webkit.org/show_bug.cgi?id=189606
52         <rdar://problem/44438527>
53
54         Reviewed by Brian Burg.
55
56         Test: http/tests/inspector/network/resource-initiatorNode.html
57
58         Add extra arguments to functions that create `ResourceRequest` objects for media resources so
59         that `initiatorNodeIdentifier` can be set for WebInspector frontend to use for grouping.
60
61         * html/HTMLMediaElement.cpp:
62         (WebCore::HTMLMediaElement::loadResource):
63         * html/HTMLVideoElement.cpp:
64         (WebCore::HTMLVideoElement::setDisplayMode):
65         * loader/FrameLoader.h:
66         * loader/FrameLoader.cpp:
67         (WebCore::FrameLoader::willLoadMediaElementURL):
68         Handles initial (e.g. DNT) resource requests.
69
70         * loader/ImageLoader.cpp:
71         (ImageLoader::updateFromElement):
72         Handles "poster" requests.
73
74         * loader/MediaResourceLoader.cpp:
75         (MediaResourceLoader::requestResource):
76         Handles byte-range requests.
77
78         * html/track/LoadableTextTrack.cpp:
79         (WebCore::LoadableTextTrack::loadTimerFired):
80         * loader/TextTrackLoader.h:
81         * loader/TextTrackLoader.cpp:
82         (WebCore::TextTrackLoader::load):
83         * html/HTMLTrackElement.h:
84         Handles <track> (e.g. subtitle) requests.
85
86         * inspector/agents/InspectorDOMAgent.cpp:
87         (WebCore::InspectorDOMAgent::identifierForNode):
88         * inspector/InspectorInstrumentation.h:
89         (WebCore::InspectorInstrumentation::identifierForNode):
90         * inspector/InspectorInstrumentation.cpp:
91         (WebCore::InspectorInstrumentation::identifierForNodeImpl):
92         Allows callers to get a `DOM.nodeId` for the given `Node`, which is (in this patch) attached
93         to the `ResourceRequest` and later used by `InspectorNetworkAgent`.
94
95         * inspector/agents/InspectorNetworkAgent.h:
96         * inspector/agents/InspectorNetworkAgent.cpp:
97         (WebCore::InspectorNetworkAgent::willSendRequest):
98         (WebCore::InspectorNetworkAgent::didLoadResourceFromMemoryCache):
99         (WebCore::InspectorNetworkAgent::buildInitiatorObject):
100
101         * platform/network/ResourceRequestBase.h:
102         (WebCore::ResourceRequestBase::initiatorNodeIdentifier const):
103         (WebCore::ResourceRequestBase::setInitiatorNodeIdentifier):
104         * platform/network/ResourceRequestBase.cpp:
105         (WebCore::ResourceRequestBase::setAsIsolatedCopy):
106         * platform/network/cf/ResourceRequestCFNet.cpp:
107         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
108         * loader/cache/CachedResourceLoader.cpp:
109         (WebCore::CachedResourceLoader::shouldContinueAfterNotifyingLoadedFromMemoryCache):
110
111         * inspector/InspectorCanvas.h:
112         * inspector/InspectorCanvas.cpp:
113         (WebCore::InspectorCanvas::buildObjectForCanvas):
114         * inspector/agents/InspectorCanvasAgent.cpp:
115         (WebCore::InspectorCanvasAgent::enable):
116         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
117         Don't try to push the canvas' node to the frontend, as this will create a dangling node in
118         `InspectorDOMAgent` if the canvas' node is detached from the DOM.
119
120 2018-10-08  Andy Estes  <aestes@apple.com>
121
122         [Payment Request] Requests should be aborted after details settle when the user cancels
123         https://bugs.webkit.org/show_bug.cgi?id=190333
124
125         Reviewed by Alex Christensen.
126
127         In Payment Request's "update a PaymentRequest's details" algorithm, user agents are expected
128         to disable the payment UI when PaymentRequest details are being updated by the merchant.
129         This is to prevent the user from accepting a payment before updated details are displayed.
130
131         Further, Payment Request's "user aborts the payment request" algorithm says that the
132         algorithm should be terminated prior to throwing an AbortError if the request is currently
133         being updated, and also that user agents SHOULD ensure this never occurs. This is based on
134         the assumption that payment UIs are disabled during details updates.
135
136         For Apple Pay, while it is true that a payment cannot be accepted by the user while details
137         are being updated by the merchant, the payment UI is not completely disabled. In particular,
138         the user is allowed to abort the payment while details are being updated. We need to honor
139         the user's request to abort without doing so in the middle of a details update.
140
141         This patch defers a user-initiated abort until after details are settled, at which point the
142         promise returned by show() is rejected with an AbortError. This behaves as if the details
143         update promise were rejected by the merchant.
144
145         Added a test case to http/tests/paymentrequest/payment-request-show-method.https.html.
146
147         * Modules/paymentrequest/PaymentRequest.cpp:
148         (WebCore::PaymentRequest::settleDetailsPromise):
149         (WebCore::PaymentRequest::whenDetailsSettled):
150         (WebCore::PaymentRequest::cancel):
151         * Modules/paymentrequest/PaymentRequest.h:
152
153 2018-10-08  Chris Dumez  <cdumez@apple.com>
154
155         Have DOMWindowProperty get is frame from its associated DOMWindow
156         https://bugs.webkit.org/show_bug.cgi?id=190341
157
158         Reviewed by Alex Christensen.
159
160         Have DOMWindowProperty get is frame from its associated DOMWindow, instead of having its own
161         m_frame that can potentially get out-of-sync.
162
163         * Modules/cache/DOMWindowCaches.cpp:
164         (WebCore::DOMWindowCaches::DOMWindowCaches):
165         * Modules/geolocation/NavigatorGeolocation.cpp:
166         (WebCore::NavigatorGeolocation::NavigatorGeolocation):
167         (WebCore::NavigatorGeolocation::from):
168         * Modules/geolocation/NavigatorGeolocation.h:
169         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
170         (WebCore::DOMWindowIndexedDatabase::DOMWindowIndexedDatabase):
171         * Modules/mediastream/NavigatorMediaDevices.cpp:
172         (WebCore::NavigatorMediaDevices::NavigatorMediaDevices):
173         (WebCore::NavigatorMediaDevices::from):
174         * Modules/mediastream/NavigatorMediaDevices.h:
175         * Modules/quota/DOMWindowQuota.cpp:
176         (WebCore::DOMWindowQuota::DOMWindowQuota):
177         * Modules/quota/NavigatorStorageQuota.cpp:
178         (WebCore::NavigatorStorageQuota::NavigatorStorageQuota):
179         * Modules/quota/NavigatorStorageQuota.h:
180         * Modules/speech/DOMWindowSpeechSynthesis.cpp:
181         (WebCore::DOMWindowSpeechSynthesis::DOMWindowSpeechSynthesis):
182         * css/StyleMedia.cpp:
183         (WebCore::StyleMedia::StyleMedia):
184         (WebCore::StyleMedia::type const):
185         (WebCore::StyleMedia::matchMedium const):
186         * css/StyleMedia.h:
187         * loader/appcache/DOMApplicationCache.cpp:
188         (WebCore::DOMApplicationCache::DOMApplicationCache):
189         (WebCore::DOMApplicationCache::applicationCacheHost const):
190         (WebCore::DOMApplicationCache::scriptExecutionContext const):
191         * loader/appcache/DOMApplicationCache.h:
192         * page/BarProp.cpp:
193         (WebCore::BarProp::BarProp):
194         (WebCore::BarProp::visible const):
195         * page/BarProp.h:
196         (WebCore::BarProp::create):
197         * page/DOMSelection.cpp:
198         (WebCore::DOMSelection::DOMSelection):
199         (WebCore::DOMSelection::visibleSelection const):
200         (WebCore::DOMSelection::anchorNode const):
201         (WebCore::DOMSelection::anchorOffset const):
202         (WebCore::DOMSelection::focusNode const):
203         (WebCore::DOMSelection::focusOffset const):
204         (WebCore::DOMSelection::baseNode const):
205         (WebCore::DOMSelection::baseOffset const):
206         (WebCore::DOMSelection::extentNode const):
207         (WebCore::DOMSelection::extentOffset const):
208         (WebCore::DOMSelection::isCollapsed const):
209         (WebCore::DOMSelection::type const):
210         (WebCore::DOMSelection::rangeCount const):
211         (WebCore::DOMSelection::collapse):
212         (WebCore::DOMSelection::collapseToEnd):
213         (WebCore::DOMSelection::collapseToStart):
214         (WebCore::DOMSelection::empty):
215         (WebCore::DOMSelection::setBaseAndExtent):
216         (WebCore::DOMSelection::setPosition):
217         (WebCore::DOMSelection::modify):
218         (WebCore::DOMSelection::extend):
219         (WebCore::DOMSelection::getRangeAt):
220         (WebCore::DOMSelection::removeAllRanges):
221         (WebCore::DOMSelection::addRange):
222         (WebCore::DOMSelection::deleteFromDocument):
223         (WebCore::DOMSelection::containsNode const):
224         (WebCore::DOMSelection::toString):
225         (WebCore::DOMSelection::shadowAdjustedNode const):
226         (WebCore::DOMSelection::shadowAdjustedOffset const):
227         (WebCore::DOMSelection::isValidForPosition const):
228         * page/DOMSelection.h:
229         (WebCore::DOMSelection::create):
230         * page/DOMWindow.cpp:
231         (WebCore::DOMWindow::screen):
232         (WebCore::DOMWindow::history):
233         (WebCore::DOMWindow::locationbar):
234         (WebCore::DOMWindow::menubar):
235         (WebCore::DOMWindow::personalbar):
236         (WebCore::DOMWindow::scrollbars):
237         (WebCore::DOMWindow::statusbar):
238         (WebCore::DOMWindow::toolbar):
239         (WebCore::DOMWindow::applicationCache):
240         (WebCore::DOMWindow::navigator):
241         (WebCore::DOMWindow::location):
242         (WebCore::DOMWindow::visualViewport):
243         (WebCore::DOMWindow::webkitNamespace):
244         (WebCore::DOMWindow::getSelection):
245         (WebCore::DOMWindow::styleMedia):
246         * page/DOMWindow.h:
247         * page/DOMWindowExtension.cpp:
248         (WebCore::DOMWindowExtension::DOMWindowExtension):
249         * page/DOMWindowExtension.h:
250         (WebCore::DOMWindowExtension::create):
251         * page/DOMWindowProperty.cpp:
252         (WebCore::DOMWindowProperty::DOMWindowProperty):
253         (WebCore::DOMWindowProperty::~DOMWindowProperty):
254         (WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension):
255         (WebCore::DOMWindowProperty::reconnectFrameFromDocumentSuspension):
256         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame):
257         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame):
258         (WebCore::DOMWindowProperty::willDetachGlobalObjectFromFrame):
259         (WebCore::DOMWindowProperty::frame const):
260         * page/DOMWindowProperty.h:
261         (WebCore::DOMWindowProperty::window const):
262         * page/History.cpp:
263         (WebCore::History::History):
264         (WebCore::History::length const):
265         (WebCore::History::scrollRestoration const):
266         (WebCore::History::setScrollRestoration):
267         (WebCore::History::stateInternal const):
268         (WebCore::History::go):
269         (WebCore::History::urlForState):
270         (WebCore::History::stateObjectAdded):
271         * page/History.h:
272         * page/Location.cpp:
273         (WebCore::Location::Location):
274         (WebCore::Location::url const):
275         (WebCore::Location::href const):
276         (WebCore::Location::protocol const):
277         (WebCore::Location::host const):
278         (WebCore::Location::hostname const):
279         (WebCore::Location::port const):
280         (WebCore::Location::pathname const):
281         (WebCore::Location::search const):
282         (WebCore::Location::origin const):
283         (WebCore::Location::ancestorOrigins const):
284         (WebCore::Location::hash const):
285         (WebCore::Location::setHref):
286         (WebCore::Location::setProtocol):
287         (WebCore::Location::setHost):
288         (WebCore::Location::setHostname):
289         (WebCore::Location::setPort):
290         (WebCore::Location::setPathname):
291         (WebCore::Location::setSearch):
292         (WebCore::Location::setHash):
293         (WebCore::Location::assign):
294         (WebCore::Location::replace):
295         (WebCore::Location::reload):
296         (WebCore::Location::setLocation):
297         * page/Location.h:
298         (WebCore::Location::create):
299         * page/Navigator.cpp:
300         (WebCore::Navigator::Navigator):
301         (WebCore::Navigator::appVersion const):
302         (WebCore::Navigator::userAgent const):
303         (WebCore::Navigator::share):
304         (WebCore::Navigator::plugins):
305         (WebCore::Navigator::mimeTypes):
306         (WebCore::Navigator::cookieEnabled const):
307         (WebCore::Navigator::javaEnabled const):
308         (WebCore::Navigator::standalone const):
309         * page/Navigator.h:
310         * page/Performance.cpp:
311         (WebCore::Performance::navigation):
312         (WebCore::Performance::timing):
313         * page/PerformanceNavigation.cpp:
314         (WebCore::PerformanceNavigation::PerformanceNavigation):
315         (WebCore::PerformanceNavigation::type const):
316         (WebCore::PerformanceNavigation::redirectCount const):
317         * page/PerformanceNavigation.h:
318         (WebCore::PerformanceNavigation::create):
319         * page/PerformanceTiming.cpp:
320         (WebCore::PerformanceTiming::PerformanceTiming):
321         (WebCore::PerformanceTiming::documentLoader const):
322         (WebCore::PerformanceTiming::documentTiming const):
323         * page/PerformanceTiming.h:
324         (WebCore::PerformanceTiming::create):
325         * page/Screen.cpp:
326         (WebCore::Screen::Screen):
327         (WebCore::Screen::height const):
328         (WebCore::Screen::width const):
329         (WebCore::Screen::colorDepth const):
330         (WebCore::Screen::pixelDepth const):
331         (WebCore::Screen::availLeft const):
332         (WebCore::Screen::availTop const):
333         (WebCore::Screen::availHeight const):
334         (WebCore::Screen::availWidth const):
335         * page/Screen.h:
336         * page/VisualViewport.cpp:
337         (WebCore::VisualViewport::VisualViewport):
338         (WebCore::VisualViewport::scriptExecutionContext const):
339         (WebCore::VisualViewport::addEventListener):
340         (WebCore::VisualViewport::updateFrameLayout const):
341         (WebCore::VisualViewport::offsetLeft const):
342         (WebCore::VisualViewport::offsetTop const):
343         (WebCore::VisualViewport::pageLeft const):
344         (WebCore::VisualViewport::pageTop const):
345         (WebCore::VisualViewport::width const):
346         (WebCore::VisualViewport::height const):
347         (WebCore::VisualViewport::scale const):
348         (WebCore::VisualViewport::update):
349         (WebCore::VisualViewport::enqueueResizeEvent):
350         (WebCore::VisualViewport::enqueueScrollEvent):
351         * page/VisualViewport.h:
352         * page/WebKitNamespace.cpp:
353         (WebCore::WebKitNamespace::WebKitNamespace):
354         * page/WebKitNamespace.h:
355         (WebCore::WebKitNamespace::create):
356         * plugins/DOMMimeTypeArray.cpp:
357         (WebCore::DOMMimeTypeArray::DOMMimeTypeArray):
358         (WebCore::DOMMimeTypeArray::item):
359         (WebCore::DOMMimeTypeArray::namedItem):
360         (WebCore::DOMMimeTypeArray::getPluginData const):
361         * plugins/DOMMimeTypeArray.h:
362         (WebCore::DOMMimeTypeArray::create):
363         * plugins/DOMPluginArray.cpp:
364         (WebCore::DOMPluginArray::DOMPluginArray):
365         (WebCore::DOMPluginArray::item):
366         (WebCore::DOMPluginArray::namedItem):
367         (WebCore::DOMPluginArray::refresh):
368         (WebCore::DOMPluginArray::pluginData const):
369         * plugins/DOMPluginArray.h:
370         (WebCore::DOMPluginArray::create):
371         * storage/Storage.cpp:
372         (WebCore::Storage::create):
373         (WebCore::Storage::Storage):
374         (WebCore::Storage::setItem):
375         (WebCore::Storage::removeItem):
376         (WebCore::Storage::clear):
377         * storage/Storage.h:
378
379 2018-10-08  Antti Koivisto  <antti@apple.com>
380
381         Move FontCascadeDescription to a file of its own
382         https://bugs.webkit.org/show_bug.cgi?id=190348
383
384         Reviewed by Chris Dumez.
385
386         * Sources.txt:
387         * WebCore.xcodeproj/project.pbxproj:
388         * platform/graphics/FontCascade.h:
389         * platform/graphics/FontCascadeDescription.cpp: Copied from Source/WebCore/platform/graphics/FontDescription.cpp.
390         (WebCore::FontDescription::FontDescription): Deleted.
391         (WebCore::m_shouldAllowUserInstalledFonts): Deleted.
392         (WebCore::FontDescription::setLocale): Deleted.
393         (WebCore::FontDescription::invalidateCaches): Deleted.
394         * platform/graphics/FontCascadeDescription.h: Copied from Source/WebCore/platform/graphics/FontDescription.h.
395         (WebCore::FontDescription::operator!= const): Deleted.
396         (WebCore::FontDescription::computedSize const): Deleted.
397         (WebCore::FontDescription::computedPixelSize const): Deleted.
398         (WebCore::FontDescription::italic const): Deleted.
399         (WebCore::FontDescription::stretch const): Deleted.
400         (WebCore::FontDescription::weight const): Deleted.
401         (WebCore::FontDescription::fontSelectionRequest const): Deleted.
402         (WebCore::FontDescription::renderingMode const): Deleted.
403         (WebCore::FontDescription::textRenderingMode const): Deleted.
404         (WebCore::FontDescription::script const): Deleted.
405         (WebCore::FontDescription::locale const): Deleted.
406         (WebCore::FontDescription::orientation const): Deleted.
407         (WebCore::FontDescription::nonCJKGlyphOrientation const): Deleted.
408         (WebCore::FontDescription::widthVariant const): Deleted.
409         (WebCore::FontDescription::featureSettings const): Deleted.
410         (WebCore::FontDescription::variationSettings const): Deleted.
411         (WebCore::FontDescription::fontSynthesis const): Deleted.
412         (WebCore::FontDescription::variantCommonLigatures const): Deleted.
413         (WebCore::FontDescription::variantDiscretionaryLigatures const): Deleted.
414         (WebCore::FontDescription::variantHistoricalLigatures const): Deleted.
415         (WebCore::FontDescription::variantContextualAlternates const): Deleted.
416         (WebCore::FontDescription::variantPosition const): Deleted.
417         (WebCore::FontDescription::variantCaps const): Deleted.
418         (WebCore::FontDescription::variantNumericFigure const): Deleted.
419         (WebCore::FontDescription::variantNumericSpacing const): Deleted.
420         (WebCore::FontDescription::variantNumericFraction const): Deleted.
421         (WebCore::FontDescription::variantNumericOrdinal const): Deleted.
422         (WebCore::FontDescription::variantNumericSlashedZero const): Deleted.
423         (WebCore::FontDescription::variantAlternates const): Deleted.
424         (WebCore::FontDescription::variantEastAsianVariant const): Deleted.
425         (WebCore::FontDescription::variantEastAsianWidth const): Deleted.
426         (WebCore::FontDescription::variantEastAsianRuby const): Deleted.
427         (WebCore::FontDescription::variantSettings const): Deleted.
428         (WebCore::FontDescription::opticalSizing const): Deleted.
429         (WebCore::FontDescription::fontStyleAxis const): Deleted.
430         (WebCore::FontDescription::shouldAllowUserInstalledFonts const): Deleted.
431         (WebCore::FontDescription::setComputedSize): Deleted.
432         (WebCore::FontDescription::setItalic): Deleted.
433         (WebCore::FontDescription::setStretch): Deleted.
434         (WebCore::FontDescription::setIsItalic): Deleted.
435         (WebCore::FontDescription::setWeight): Deleted.
436         (WebCore::FontDescription::setRenderingMode): Deleted.
437         (WebCore::FontDescription::setTextRenderingMode): Deleted.
438         (WebCore::FontDescription::setOrientation): Deleted.
439         (WebCore::FontDescription::setNonCJKGlyphOrientation): Deleted.
440         (WebCore::FontDescription::setWidthVariant): Deleted.
441         (WebCore::FontDescription::setFeatureSettings): Deleted.
442         (WebCore::FontDescription::setVariationSettings): Deleted.
443         (WebCore::FontDescription::setFontSynthesis): Deleted.
444         (WebCore::FontDescription::setVariantCommonLigatures): Deleted.
445         (WebCore::FontDescription::setVariantDiscretionaryLigatures): Deleted.
446         (WebCore::FontDescription::setVariantHistoricalLigatures): Deleted.
447         (WebCore::FontDescription::setVariantContextualAlternates): Deleted.
448         (WebCore::FontDescription::setVariantPosition): Deleted.
449         (WebCore::FontDescription::setVariantCaps): Deleted.
450         (WebCore::FontDescription::setVariantNumericFigure): Deleted.
451         (WebCore::FontDescription::setVariantNumericSpacing): Deleted.
452         (WebCore::FontDescription::setVariantNumericFraction): Deleted.
453         (WebCore::FontDescription::setVariantNumericOrdinal): Deleted.
454         (WebCore::FontDescription::setVariantNumericSlashedZero): Deleted.
455         (WebCore::FontDescription::setVariantAlternates): Deleted.
456         (WebCore::FontDescription::setVariantEastAsianVariant): Deleted.
457         (WebCore::FontDescription::setVariantEastAsianWidth): Deleted.
458         (WebCore::FontDescription::setVariantEastAsianRuby): Deleted.
459         (WebCore::FontDescription::setOpticalSizing): Deleted.
460         (WebCore::FontDescription::setFontStyleAxis): Deleted.
461         (WebCore::FontDescription::setShouldAllowUserInstalledFonts): Deleted.
462         (WebCore::FontDescription::operator== const): Deleted.
463         * platform/graphics/FontDescription.cpp:
464         (WebCore::FontDescription::invalidateCaches):
465         (WebCore::FontCascadeDescription::FontCascadeDescription): Deleted.
466         (WebCore::FontCascadeDescription::effectiveFamilyCount const): Deleted.
467         (WebCore::FontCascadeDescription::effectiveFamilyAt const): Deleted.
468         (WebCore::FontCascadeDescription::lighterWeight): Deleted.
469         (WebCore::FontCascadeDescription::bolderWeight): Deleted.
470         (WebCore::FontCascadeDescription::familiesEqualForTextAutoSizing const): Deleted.
471         (WebCore::FontCascadeDescription::familyNamesAreEqual): Deleted.
472         (WebCore::FontCascadeDescription::familyNameHash): Deleted.
473         (WebCore::FontCascadeDescription::foldedFamilyName): Deleted.
474         * platform/graphics/FontDescription.h:
475         (WebCore::FontCascadeDescription::operator!= const): Deleted.
476         (WebCore::FontCascadeDescription::familyCount const): Deleted.
477         (WebCore::FontCascadeDescription::firstFamily const): Deleted.
478         (WebCore::FontCascadeDescription::familyAt const): Deleted.
479         (WebCore::FontCascadeDescription::families const): Deleted.
480         (WebCore::FontCascadeDescription::specifiedSize const): Deleted.
481         (WebCore::FontCascadeDescription::isAbsoluteSize const): Deleted.
482         (WebCore::FontCascadeDescription::lighterWeight const): Deleted.
483         (WebCore::FontCascadeDescription::bolderWeight const): Deleted.
484         (WebCore::FontCascadeDescription::useFixedDefaultSize const): Deleted.
485         (WebCore::FontCascadeDescription::kerning const): Deleted.
486         (WebCore::FontCascadeDescription::keywordSize const): Deleted.
487         (WebCore::FontCascadeDescription::keywordSizeAsIdentifier const): Deleted.
488         (WebCore::FontCascadeDescription::fontSmoothing const): Deleted.
489         (WebCore::FontCascadeDescription::isSpecifiedFont const): Deleted.
490         (WebCore::FontCascadeDescription::setOneFamily): Deleted.
491         (WebCore::FontCascadeDescription::setFamilies): Deleted.
492         (WebCore::FontCascadeDescription::setSpecifiedSize): Deleted.
493         (WebCore::FontCascadeDescription::setIsAbsoluteSize): Deleted.
494         (WebCore::FontCascadeDescription::setKerning): Deleted.
495         (WebCore::FontCascadeDescription::setKeywordSize): Deleted.
496         (WebCore::FontCascadeDescription::setKeywordSizeFromIdentifier): Deleted.
497         (WebCore::FontCascadeDescription::setFontSmoothing): Deleted.
498         (WebCore::FontCascadeDescription::setIsSpecifiedFont): Deleted.
499         (WebCore::FontCascadeDescription::equalForTextAutoSizing const): Deleted.
500         (WebCore::FontCascadeDescription::initialItalic): Deleted.
501         (WebCore::FontCascadeDescription::initialFontStyleAxis): Deleted.
502         (WebCore::FontCascadeDescription::initialWeight): Deleted.
503         (WebCore::FontCascadeDescription::initialStretch): Deleted.
504         (WebCore::FontCascadeDescription::initialSmallCaps): Deleted.
505         (WebCore::FontCascadeDescription::initialKerning): Deleted.
506         (WebCore::FontCascadeDescription::initialFontSmoothing): Deleted.
507         (WebCore::FontCascadeDescription::initialTextRenderingMode): Deleted.
508         (WebCore::FontCascadeDescription::initialFontSynthesis): Deleted.
509         (WebCore::FontCascadeDescription::initialVariantPosition): Deleted.
510         (WebCore::FontCascadeDescription::initialVariantCaps): Deleted.
511         (WebCore::FontCascadeDescription::initialVariantAlternates): Deleted.
512         (WebCore::FontCascadeDescription::initialOpticalSizing): Deleted.
513         (WebCore::FontCascadeDescription::initialLocale): Deleted.
514         (WebCore::FontCascadeDescription::operator== const): Deleted.
515         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
516         * rendering/style/RenderStyle.h:
517
518 2018-10-08  Yacine Bandou  <yacine.bandou_ext@softathome.com>
519
520         [EME][GStreamer] Add support for WebM encrypted caps "application/x-webm-enc"
521         https://bugs.webkit.org/show_bug.cgi?id=189239
522
523         Reviewed by Xabier Rodriguez-Calvar.
524
525         Add the support of GStreamer caps "application/x-webm-enc" in GStreamerCommon.
526
527         The DRM system id field in the encrypted event is set to GST_PROTECTION_UNSPECIFIED_SYSTEM_ID
528         in case of WebM, for details, see https://bugzilla.gnome.org/attachment.cgi?id=365211.
529
530         Tests: media/encrypted-media/clearKey/clearKey-encrypted-webm-eventmse.html
531                media/encrypted-media/clearKey/clearKey-webm-video-playback-mse.html
532
533         * platform/graphics/gstreamer/GStreamerCommon.cpp:
534         (WebCore::capsMediaType):
535         (WebCore::areEncryptedCaps):
536         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
537         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
538         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
539         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
540         (webkitMediaCommonEncryptionDecryptTransformCaps):
541
542 2018-10-07  Dan Bernstein  <mitz@apple.com>
543
544         Fixed building with the latest macOS SDK
545
546         * platform/graphics/cocoa/IOSurface.mm:
547         (WebCore::IOSurface::ensurePlatformContext): Suppressed deprecation warnings around use of
548           CGIOSurfaceContextSetDisplayMask.
549
550 2018-10-06  Justin Michaud  <justin_michaud@apple.com>
551
552         Properly determine if css custom property values are computationally independent
553         https://bugs.webkit.org/show_bug.cgi?id=190303
554
555         Reviewed by Antti Koivisto.
556
557         Add getDirectComputationalDependencies method to determine if a value is computationally
558         dependent. Use this method in CSS.registerProperty to replace existing substring checks.
559         No new tests are needed because the existing tests cover this behaviour.
560
561         * css/CSSCalculationValue.cpp:
562         (WebCore::determineCategory):
563         * css/CSSCalculationValue.h:
564         (WebCore::CSSCalcValue::getDirectComputationalDependencies const):
565         (WebCore::CSSCalcValue::getDirectRootComputationalDependencies const):
566         * css/CSSCustomPropertyValue.cpp:
567         (WebCore::CSSCustomPropertyValue::customCSSText const):
568         (WebCore::CSSCustomPropertyValue::tokens const):
569         (WebCore::CSSCustomPropertyValue::setResolvedTypedValue):
570         * css/CSSCustomPropertyValue.h:
571         * css/CSSPrimitiveValue.cpp:
572         (WebCore::CSSPrimitiveValue::getDirectComputationalDependencies const):
573         (WebCore::CSSPrimitiveValue::getDirectRootComputationalDependencies const):
574         * css/CSSPrimitiveValue.h:
575         * css/CSSValue.cpp:
576         (WebCore::CSSValue::getDirectComputationalDependencies const):
577         (WebCore::CSSValue::getDirectRootComputationalDependencies const):
578         * css/CSSValue.h:
579         * css/CSSVariableData.cpp:
580         (WebCore::CSSVariableData::CSSVariableData):
581         (WebCore::CSSVariableData::resolveVariableReference const):
582         * css/DOMCSSRegisterCustomProperty.cpp:
583         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
584
585 2018-10-05  Chris Dumez  <cdumez@apple.com>
586
587         Regression(r236862): Crash under DOMWindowExtension::willDetachGlobalObjectFromFrame()
588         https://bugs.webkit.org/show_bug.cgi?id=190320
589         <rdar://problem/45044814>
590
591         Reviewed by Geoffrey Garen.
592
593         r236862 caused DOMWindowProperty::willDetachGlobalObjectFromFrame() to get called several
594         times. There was no effect for most DOMWindowProperty objects. However, it would cause
595         crashes for DOMWindowExtension objects, which subclass DOMWindowProperty and override
596         DOMWindowProperty::willDetachGlobalObjectFromFrame() because they dereference the frame
597         without null checking it.
598
599         To address the issue, we now make sure DOMWindowProperty::willDetachGlobalObjectFromFrame()
600         is not called several times.
601
602         * dom/Document.cpp:
603         (WebCore::Document::detachFromFrame):
604         Stop calling DOMWindow::willDetachDocumentFromFrame() here as most call sites already
605         take care of calling DOMWindow::willDetachDocumentFromFrame() beforehand (e.g.
606         Document::prepareForDestruction()).
607         Also, return early if the Document is already detached from its frame.
608
609         (WebCore::Document::frameWasDisconnectedFromOwner):
610         Add new utility function called when a Frame is disconnected from its owner which
611         calls both Document::detachFromFrame() and DOMWindow::willDetachDocumentFromFrame().
612
613         * dom/Document.h:
614         * page/DOMWindow.cpp:
615         (WebCore::DOMWindow::willDetachDocumentFromFrame):
616         Return early if the Window is already detached from its frame.
617
618         * page/Frame.cpp:
619         (WebCore::Frame::disconnectOwnerElement):
620
621 2018-10-05  Jer Noble  <jer.noble@apple.com>
622
623         Further unreviewed watchOS build fix: videoPerformanceMetrics unavailable on watchOS.
624
625         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
626         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
627
628 2018-10-05  Jer Noble  <jer.noble@apple.com>
629
630        Unreviewed watchOS build fix: videoPerformanceMetrics unavailable on watchOS.
631
632         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
633         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
634
635 2018-10-05  Eric Carlson  <eric.carlson@apple.com>
636
637         [MediaStream] RealtimeMediaSource should be able to vend hashed IDs
638         https://bugs.webkit.org/show_bug.cgi?id=190142
639         <rdar://problem/44911109>
640
641         Reviewed by Youenn Fablet.
642
643         No new tests, covered by existing tests.
644
645         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
646         (WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Update order of parameters passed
647         to base class.
648
649         * Modules/mediastream/MediaDevicesRequest.cpp:
650         (WebCore::MediaDevicesRequest::start): ASSERT if document.deviceIDHashSalt is not the same
651         as passed salt.
652
653         * Modules/mediastream/MediaStreamTrack.cpp:
654         (WebCore::MediaStreamTrack::getSettings const): Don't need to hash ID.
655         (WebCore::MediaStreamTrack::getCapabilities const): Ditto.
656         * Modules/mediastream/MediaStreamTrack.h:
657         * Modules/mediastream/MediaStreamTrack.idl:
658
659         * Modules/mediastream/UserMediaRequest.cpp:
660         (WebCore::UserMediaRequest::allow): Pass hash salt to createMediaStream.
661
662         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
663         (WebCore::LibWebRTCPeerConnectionBackend::createReceiverForSource): Update order of parameters passed
664         to base class.
665
666         * Modules/webaudio/MediaStreamAudioSource.cpp:
667         (WebCore::MediaStreamAudioSource::MediaStreamAudioSource): Ditto.
668         * platform/mediastream/MediaConstraints.h:
669
670         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
671         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource): Ditto.
672
673         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
674         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource): Ditto.
675
676         * platform/mediastream/RealtimeMediaSource.cpp:
677         (WebCore::RealtimeMediaSource::RealtimeMediaSource): Calculate hashed ID.
678         (WebCore::RealtimeMediaSource::selectSettings): Use m_hashedID.
679         (WebCore::RealtimeMediaSource::hashedId const): New.
680         (WebCore::RealtimeMediaSource::deviceIDHashSalt const): New.
681         * platform/mediastream/RealtimeMediaSource.h:
682
683         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
684         (WebCore::RealtimeMediaSourceCenter::createMediaStream): Take hash salt, pass it when creating
685         a source.
686         (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices): Ditto.
687         (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
688         * platform/mediastream/RealtimeMediaSourceCenter.h:
689
690         * platform/mediastream/RealtimeMediaSourceFactory.h:
691         * platform/mediastream/RealtimeVideoSource.cpp:
692         (WebCore::RealtimeVideoSource::RealtimeVideoSource): Update parameters.
693         * platform/mediastream/RealtimeVideoSource.h:
694
695         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
696         (WebCore::GStreamerAudioCaptureSource::create): Ditto.
697         (WebCore::GStreamerAudioCaptureSource::GStreamerAudioCaptureSource): Ditto.
698         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
699
700         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
701         (WebCore::GStreamerVideoCaptureSource::create): Ditto.
702         (WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource): Ditto.
703         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
704
705         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
706         (WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource): Ditto.
707         (WebCore::MockRealtimeAudioSource::create): Ditto.
708         (WebCore::MockGStreamerAudioCaptureSource::MockGStreamerAudioCaptureSource): Ditto.
709         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
710
711         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
712         (WebCore::MockRealtimeVideoSource::create): Ditto.
713         (WebCore::MockGStreamerVideoCaptureSource::MockGStreamerVideoCaptureSource): Ditto.
714         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
715
716         * platform/mediastream/mac/AVVideoCaptureSource.h:
717         * platform/mediastream/mac/AVVideoCaptureSource.mm:
718         (WebCore::AVVideoCaptureSource::create): Ditto.
719         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Ditto.
720         (WebCore::AVVideoCaptureSource::settings): Use hashedId to set device ID.
721         (WebCore::AVVideoCaptureSource::capabilities): Ditto.
722
723         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
724         (WebCore::CoreAudioCaptureSource::create): Update parameters.
725         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): Ditto.
726         (WebCore::CoreAudioCaptureSource::capabilities): Use hashedId to set device ID.
727         (WebCore::CoreAudioCaptureSource::settings): Ditto.
728         * platform/mediastream/mac/CoreAudioCaptureSource.h:
729
730         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
731         (WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa): Update parameters.
732         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
733
734         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
735         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
736         (WebCore::MockRealtimeAudioSource::create): Ditto.
737         (WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac): Ditto.
738
739         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
740         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
741         (WebCore::MockRealtimeVideoSource::create): Ditto.
742         (WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac): Ditto.
743
744         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
745
746         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
747         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
748         (WebCore::ScreenDisplayCaptureSourceMac::create): Ditto.
749         (WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac): Ditto.
750         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Update logging.
751         (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
752         (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.
753
754         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
755         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm:
756         (WebCore::WindowDisplayCaptureSourceMac::create): Update parameters.
757
758         * platform/mock/MockRealtimeAudioSource.cpp:
759         (WebCore::MockRealtimeAudioSource::create): Ditto.
760         (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): Ditto.
761         (WebCore::MockRealtimeAudioSource::settings): Use hashedId to set device ID.
762         (WebCore::MockRealtimeAudioSource::capabilities): Ditto.
763         * platform/mock/MockRealtimeAudioSource.h:
764
765         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
766
767         * platform/mock/MockRealtimeVideoSource.cpp:
768         (WebCore::MockRealtimeVideoSource::create): Update parameters.
769         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Ditto.
770         (WebCore::MockRealtimeVideoSource::capabilities): Use hashedId to set device ID.
771         (WebCore::MockRealtimeVideoSource::settings): Ditto.
772         * platform/mock/MockRealtimeVideoSource.h:
773
774 2018-10-03  Jer Noble  <jer.noble@apple.com>
775
776         Add support for reporting "display composited video frames" through the VideoPlaybackQuality object.
777         https://bugs.webkit.org/show_bug.cgi?id=190266
778
779         Reviewed by Eric Carlson.
780
781         Test: TestWebKitAPI.VideoQualityDisplayCompositing
782
783         Modify VideoPlaybackQuality to take a VideoPlaybackQualityMetrics object in its
784         constructor (rather than individual fields). Add a new setting to control visibility
785         of the displayCompositedVideoFrames attribute on VideoPlaybackQuality. Add support
786         for VideoPlaybackQualityMetrics to MediaPlayerPrivateAVFoundationObjC.
787
788         * Modules/mediasource/VideoPlaybackQuality.cpp:
789         (WebCore::VideoPlaybackQuality::create):
790         (WebCore::VideoPlaybackQuality::VideoPlaybackQuality):
791         * Modules/mediasource/VideoPlaybackQuality.h:
792         (WebCore::VideoPlaybackQuality::displayCompositedVideoFrames const):
793         * Modules/mediasource/VideoPlaybackQuality.idl:
794         * html/HTMLMediaElement.cpp:
795         (WebCore::HTMLMediaElement::getVideoPlaybackQuality):
796         * html/HTMLMediaElement.h:
797         * html/HTMLMediaElement.idl:
798         * page/Settings.yaml:
799         * platform/graphics/MediaPlayer.h:
800         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
801         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
802         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
803         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
804         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
805         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
806         (WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics):
807
808 2018-10-05  Ryan Haddad  <ryanhaddad@apple.com>
809
810         Unreviewed, rolling out r236866.
811
812         Breaks internal builds.
813
814         Reverted changeset:
815
816         "Add support for reporting "display composited video frames"
817         through the VideoPlaybackQuality object."
818         https://bugs.webkit.org/show_bug.cgi?id=190266
819         https://trac.webkit.org/changeset/236866
820
821 2018-10-05  Antoine Quint  <graouts@apple.com>
822
823         [Web Animations] REGRESSION (r236809): crash under AnimationTimeline::updateCSSAnimationsForElement()
824         https://bugs.webkit.org/show_bug.cgi?id=190307
825         <rdar://problem/45009901>
826
827         Reviewed by Dean Jackson.
828
829         We could crash with an invalid access to cssAnimationsByName since cancelOrRemoveDeclarativeAnimation() already
830         does the job of clearing the m_elementToCSSAnimationByName entry for this particular element if there are no
831         animations targeting it anymore. This started happening in r236809 when we switched from a simple call to to cancel()
832         to a call to cancelOrRemoveDeclarativeAnimation(). We can safely remove the removal here since cancelOrRemoveDeclarativeAnimation()
833         will already have performed this task safely if needed.
834
835         * animation/AnimationTimeline.cpp:
836         (WebCore::AnimationTimeline::updateCSSAnimationsForElement):
837
838 2018-10-04  Jer Noble  <jer.noble@apple.com>
839
840         Add support for reporting "display composited video frames" through the VideoPlaybackQuality object.
841         https://bugs.webkit.org/show_bug.cgi?id=190266
842
843         Reviewed by Eric Carlson.
844
845         Test: TestWebKitAPI.VideoQualityDisplayCompositing
846
847         Modify VideoPlaybackQuality to take a VideoPlaybackQualityMetrics object in its
848         constructor (rather than individual fields). Add a new setting to control visibility
849         of the displayCompositedVideoFrames attribute on VideoPlaybackQuality. Add support
850         for VideoPlaybackQualityMetrics to MediaPlayerPrivateAVFoundationObjC.
851
852         * Modules/mediasource/VideoPlaybackQuality.cpp:
853         (WebCore::VideoPlaybackQuality::create):
854         (WebCore::VideoPlaybackQuality::VideoPlaybackQuality):
855         * Modules/mediasource/VideoPlaybackQuality.h:
856         (WebCore::VideoPlaybackQuality::displayCompositedVideoFrames const):
857         * Modules/mediasource/VideoPlaybackQuality.idl:
858         * html/HTMLMediaElement.cpp:
859         (WebCore::HTMLMediaElement::getVideoPlaybackQuality):
860         * html/HTMLMediaElement.h:
861         * html/HTMLMediaElement.idl:
862         * page/Settings.yaml:
863         * platform/graphics/MediaPlayer.h:
864         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
865         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
866         (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
867         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
868         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
869         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
870         (WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics):
871
872 2018-10-04  Chris Dumez  <cdumez@apple.com>
873
874         A Document / Window should lose its browsing context as soon as its iframe is removed from the document
875         https://bugs.webkit.org/show_bug.cgi?id=190282
876
877         Reviewed by Ryosuke Niwa.
878
879         A Document / Window should lose its browsing context (aka Frame) as soon as its iframe is removed from
880         the document. In WebKit, a Document / Window's Frame was only getting nulled out when the frame gets
881         destroyed, which happens later usually after a GC happens.
882
883         Specification:
884         - https://html.spec.whatwg.org/#the-iframe-element
885         """
886         When an iframe element is removed from a document, the user agent must discard the element's nested browsing
887         context, if it is not null, and then set the element's nested browsing context to null.
888         """
889
890         This was not consistent with the specification or other browsers (tested Chrome and Firefox) so this
891         patch is aligning our behavior.
892
893         In a follow-up, I am planning to look into making the Window not be a FrameDestructionObserver, and instead
894         get its frame from the Document. This should make the code simpler.
895
896         No new tests, rebaselined existing tests.
897
898         * Modules/mediastream/MediaDevices.cpp:
899         (WebCore::MediaDevices::getUserMedia const):
900         * Modules/mediastream/MediaDevices.h:
901         Update getUserMedia() to reject a the Promise with an InvalidStateError when calling after the
902         document has been detached, instead of throwing an InvalidStateError. This behavior is as per
903         specification:
904         - https://w3c.github.io/mediacapture-main/#dom-mediadevices-getusermedia (Step 4)
905         I needed to make this change to keep one of our layout tests passing.
906
907         * dom/Document.cpp:
908         (WebCore::Document::attachToCachedFrame):
909         (WebCore::Document::detachFromFrame):
910         * dom/Document.h:
911         * page/DOMWindow.cpp:
912         (WebCore::DOMWindow::didSecureTransitionTo):
913         (WebCore::DOMWindow::willDetachDocumentFromFrame):
914         (WebCore::DOMWindow::setStatus):
915         (WebCore::DOMWindow::detachFromFrame):
916         (WebCore::DOMWindow::attachToFrame):
917         * page/DOMWindow.h:
918         * page/DOMWindowProperty.cpp:
919         (WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension):
920         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame):
921         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame):
922         * page/Frame.cpp:
923         (WebCore::Frame::disconnectOwnerElement):
924
925         * platform/mock/MockRealtimeVideoSource.cpp:
926         (WebCore::MockRealtimeVideoSource::drawText):
927         Calling drawText() with a null String hits an assertion in debug. This was triggered by one of
928         our layout tests so I made sure we only call drawText when the String is not null.
929
930 2018-10-04  Jeremy Jones  <jeremyj@apple.com>
931
932         Unify implementation in VideoFullscreenInterfaceAVKit
933         https://bugs.webkit.org/show_bug.cgi?id=190091
934         rdar://problem/44734523
935
936         Reviewed by Jer Noble.
937
938         No new tests because no behavior change.
939
940         Unified code in VideoFullscreenInterfaceAVKit now that new code path is proven and include
941         any changes that had been made in the old path.
942
943         * platform/ios/VideoFullscreenInterfaceAVKit.h:
944         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
945         (-[WebAVPlayerViewControllerDelegate playerViewControllerShouldStartPictureInPictureFromInlineWhenEnteringBackground:]):
946         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
947         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
948         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
949         (VideoFullscreenControllerContext::requestUpdateInlineRect):
950         (VideoFullscreenControllerContext::requestVideoContentLayer):
951         (VideoFullscreenControllerContext::returnVideoContentLayer):
952         (VideoFullscreenControllerContext::didSetupFullscreen):
953         (VideoFullscreenControllerContext::didExitFullscreen):
954
955 2018-10-04  Justin Michaud  <justin_michaud@apple.com>
956
957         Bindings generator should support static attributes that are interfaces with CallWith
958         https://bugs.webkit.org/show_bug.cgi?id=190292
959
960         Reviewed by Chris Dumez.
961
962         Add support for static attributes that support callWith to the bindings generator. This
963         is needed for CSS.paintWorklet.
964
965         * bindings/scripts/CodeGeneratorJS.pm:
966         (GenerateAttributeGetterBodyDefinition):
967         * bindings/scripts/test/JS/JSTestObj.cpp:
968         (WebCore::jsTestObjConstructorTestStaticReadonlyObjGetter):
969         (WebCore::jsTestObjConstructorTestStaticReadonlyObj):
970         * bindings/scripts/test/TestObj.idl:
971
972 2018-10-04  Matt Lewis  <jlewis3@apple.com>
973
974         Unreviewed, rolling out r236730.
975
976         This caused a consistent crash in test http/tests/media/media-stream/get-display-media-prompt.html.
977
978         Reverted changeset:
979
980         "[MediaStream] RealtimeMediaSource should be able to vend
981         hashed IDs"
982         https://bugs.webkit.org/show_bug.cgi?id=190142
983         https://trac.webkit.org/changeset/236730
984
985 2018-10-04  Wenson Hsieh  <wenson_hsieh@apple.com>
986
987         [macOS] Fix some font attribute conversion bugs in preparation for "Font > Styles…" support in WebKit2
988         https://bugs.webkit.org/show_bug.cgi?id=190289
989         <rdar://problem/45020806>
990
991         Reviewed by Ryosuke Niwa.
992
993         Makes some small adjustments to fix two bugs in font attribute conversion logic. See below for more detail.
994
995         Tests:  FontManagerTests.AddFontShadowUsingFontOptions
996                 FontManagerTests.AddAndRemoveColorsUsingFontOptions
997
998         * editing/FontAttributeChanges.cpp:
999         (WebCore::cssValueListForShadow):
1000         * editing/cocoa/FontAttributesCocoa.mm:
1001
1002         Currently, we bail from adding a font shadow if the shadow's offset is empty. However, valid shadow offsets may
1003         have negative dimensions, so a check for `isZero()` should be used instead.
1004
1005         (WebCore::FontAttributes::createDictionary const):
1006         * platform/mac/WebCoreNSFontManagerExtras.mm:
1007
1008         Fall back to a transparent background color; this allows senders to remove the current background color by just
1009         removing NSBackgroundColorAttributeName from the attribute dictionary, rather than explicitly setting it to the
1010         transparent color (this scenario is exercised when using "Font > Styles…" to specify a font style without a
1011         background color).
1012
1013         (WebCore::computedFontAttributeChanges):
1014
1015 2018-10-03  Ryosuke Niwa  <rniwa@webkit.org>
1016
1017         MutationRecord doesn't keep JS wrappers of target, addedNodes, and removedNodes alive
1018         https://bugs.webkit.org/show_bug.cgi?id=190277
1019
1020         Reviewed by Antti Koivisto.
1021
1022         The bug was caused by JSMutationRecord not visiting any of the nodes referenced by mutation records.
1023
1024         Fixed the bug by adding JSMutationRecord::visitAdditionalChildren, which adds the root nodes of
1025         the root nodes of the target, addedNodes, and removedNodes in each mutation record.
1026
1027         Test: fast/dom/MutationObserver/mutation-record-keeps-js-wrappers-of-nodes-alive.html
1028
1029         * Sources.txt:
1030         * WebCore.xcodeproj/project.pbxproj:
1031         * bindings/js/JSMutationRecordCustom.cpp: Added.
1032         (WebCore::JSMutationRecord::visitAdditionalChildren): Added.
1033         * bindings/js/JSPerformanceObserverCustom.cpp: This file got dumped out of a unified build file
1034         where using namespace JSC was defined. Use the fully qualified names to refer to JSC types.
1035         (WebCore::JSPerformanceObserverOwner::isReachableFromOpaqueRoots):
1036         * dom/MutationRecord.cpp:
1037         (WebCore::ChildListRecord::visitNodesConcurrently): Added.
1038         (WebCore::RecordWithEmptyNodeLists::visitNodesConcurrently): Added.
1039         (WebCore::MutationRecordWithNullOldValue::visitNodesConcurrently): Added.
1040         * dom/MutationRecord.h:
1041         * dom/MutationRecord.idl:
1042
1043 2018-10-04  Jiewen Tan  <jiewen_tan@apple.com>
1044
1045         [WebAuthN] Move time out control from WebProcess to UIProcess
1046         https://bugs.webkit.org/show_bug.cgi?id=189642
1047         <rdar://problem/44476765>
1048
1049         Reviewed by Chris Dumez.
1050
1051         Since now the control unit of WebAuthN has been moved to UI Process, i.e. AuthenticatorManager,
1052         the time out timer should move to UI Process as well.
1053
1054         Tests: http/wpt/webauthn/public-key-credential-create-failure-local-silent.https.html
1055                http/wpt/webauthn/public-key-credential-get-failure-local-silent.https.html
1056
1057         * Modules/webauthn/AuthenticatorCoordinator.cpp:
1058         (WebCore::AuthenticatorCoordinator::create const):
1059         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
1060         (WebCore::AuthenticatorCoordinatorInternal::initTimeoutTimer): Deleted.
1061         (WebCore::AuthenticatorCoordinatorInternal::didTimeoutTimerFire): Deleted.
1062         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
1063         (WebCore::PublicKeyCredentialCreationOptions::encode const):
1064         (WebCore::PublicKeyCredentialCreationOptions::decode):
1065         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
1066         (WebCore::PublicKeyCredentialRequestOptions::encode const):
1067         (WebCore::PublicKeyCredentialRequestOptions::decode):
1068
1069 2018-10-04  Chris Dumez  <cdumez@apple.com>
1070
1071         Regression(r236779): Crash when changing the input element type from inside an 'input' event listener
1072         https://bugs.webkit.org/show_bug.cgi?id=190252
1073
1074         Reviewed by Alex Christensen.
1075
1076         Add a null check for element() after firing the 'input' event and before firing the 'change' event
1077         in case the input event listener changes the input type.
1078
1079         Tests: fast/dom/HTMLInputElement/change-type-in-click-event-listener.html
1080                fast/dom/HTMLInputElement/change-type-in-input-event-listener.html
1081
1082         * html/BaseCheckableInputType.cpp:
1083         (WebCore::BaseCheckableInputType::fireInputAndChangeEvents):
1084
1085 2018-10-04  Yuhan Wu  <yuhan_wu@apple.com>
1086
1087         runtime flag and IDL for MediaRecorder
1088         https://bugs.webkit.org/show_bug.cgi?id=190018
1089
1090         Reviewed by Youenn Fablet and Chris Dumez.
1091
1092         Covered by tests:
1093         imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html
1094         imported/w3c/web-platform-tests/mediacapture-record/BlobEvent-constructor.html
1095
1096         Add an architecture of the IDL and the class for MediaRecorder and BlobEvent.
1097
1098         * CMakeLists.txt:
1099         * DerivedSources.make:
1100         * Modules/mediarecorder/BlobEvent.h:
1101         (WebCore::BlobEvent::create):
1102         (WebCore::BlobEvent:::Event):
1103         * Modules/mediarecorder/BlobEvent.idl:
1104         * Modules/mediarecorder/MediaRecorder.cpp:
1105         (WebCore::MediaRecorder::create):
1106         (WebCore::MediaRecorder::MediaRecorder):
1107         (WebCore::MediaRecorder::activeDOMObjectName const):
1108         (WebCore::MediaRecorder::canSuspendForDocumentSuspension const):
1109         * Modules/mediarecorder/MediaRecorder.h: Added.
1110         (WebCore::MediaRecorder::state const):
1111         (WebCore::MediaRecorder::~MediaRecorder):
1112         * Modules/mediarecorder/MediaRecorder.idl:
1113         * Modules/mediastream/RTCRtpReceiver.cpp:
1114         * Sources.txt:
1115         * WebCore.xcodeproj/project.pbxproj:
1116         * bindings/js/WebCoreBuiltinNames.h:
1117         * page/RuntimeEnabledFeatures.h:
1118         (WebCore::RuntimeEnabledFeatures::mediaRecorderEnabled const):
1119         (WebCore::RuntimeEnabledFeatures::setMediaRecorderEnabled):
1120
1121 2018-10-04  Chris Dumez  <cdumez@apple.com>
1122
1123         Unreviewed, rolling out r236803.
1124
1125         Caused crashes on some bots
1126
1127         Reverted changeset:
1128
1129         "Regression(r236779): Crash when changing the input element
1130         type from inside an 'input' event listener"
1131         https://bugs.webkit.org/show_bug.cgi?id=190252
1132         https://trac.webkit.org/changeset/236803
1133
1134 2018-10-04  Dan Bernstein  <mitz@apple.com>
1135
1136         Tried to fix the Mojave build after r236832.
1137
1138         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1139         (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]):
1140         (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
1141
1142 2018-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1143
1144         ENABLE(ASSERT) used in grid code when !ASSERT_DISABLED is desired
1145         https://bugs.webkit.org/show_bug.cgi?id=190145
1146
1147         Reviewed by Javier Fernandez.
1148
1149         Replace ENABLE(ASSERT), which doesn't exist, with !ASSERT_DISABLED.
1150
1151         * rendering/RenderGrid.cpp:
1152         (WebCore::RenderGrid::placeItemsOnGrid const):
1153         (WebCore::RenderGrid::baselinePosition const):
1154         * rendering/style/GridArea.h:
1155         (WebCore::GridSpan::GridSpan):
1156
1157 2018-10-04  Dan Bernstein  <mitz@apple.com>
1158
1159         WebCore part of [Xcode] Update some build settings as recommended by Xcode 10
1160         https://bugs.webkit.org/show_bug.cgi?id=190250
1161
1162         Reviewed by Andy Estes.
1163
1164         * Configurations/Base.xcconfig: Enabled CLANG_WARN_COMMA, CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF,
1165           CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED, and CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS.
1166
1167         * WebCore.xcodeproj/project.pbxproj: Let Xcode update LastUpgradeCheck and remove a
1168           duplicate reference in a Compile Sources build phase.
1169
1170         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Suppress -Wdeprecated-implementations
1171           around implementations of deprecated accessibility methods.
1172
1173         * loader/TextResourceDecoder.cpp:
1174         (WebCore::TextResourceDecoder::checkForBOM): Addressed CLANG_WARN_COMMA.
1175
1176         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1177         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
1178           Suppress -Wdeprecated-implementations around implementations of this deprecated delegate method.
1179         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]): Ditto.
1180
1181 2018-10-02  Darin Adler  <darin@apple.com>
1182
1183         AudioNode.connect should use [ReturnValue]
1184         https://bugs.webkit.org/show_bug.cgi?id=190231
1185
1186         Reviewed by Eric Carlson.
1187
1188         This is a slightly more efficient way to return a value that is always
1189         identical to one of the arguments, so use it here.
1190
1191         * Modules/webaudio/AudioBasicInspectorNode.cpp:
1192         (WebCore::AudioBasicInspectorNode::connect): Return ExceptionOr<void>.
1193         * Modules/webaudio/AudioBasicInspectorNode.h: Ditto.
1194         * Modules/webaudio/AudioNode.cpp:
1195         (WebCore::AudioNode::connect): Ditto.
1196         * Modules/webaudio/AudioNode.h: Ditto.
1197
1198         * Modules/webaudio/AudioNode.idl: Use [ReturnValue].
1199
1200 2018-10-03  Justin Michaud  <justin_michaud@apple.com>
1201
1202         Registered custom properties should allow inheritance to be controlled
1203         https://bugs.webkit.org/show_bug.cgi?id=190038
1204
1205         Reviewed by Antti Koivisto.
1206
1207         Tests: css-custom-properties-api/inherits.html
1208                css-custom-properties-api/length.html
1209                css-custom-properties-api/length2.html
1210
1211         Add support for inherits property on registered css custom properties, as well
1212         as a starting point for evaluating registered custom properties with types. Registered
1213         custom properties are evaluated as length values before being substituted. Currently,
1214         relative unit cycles are not detected.
1215
1216         A proper solution is still needed to resolve relative unit cycles, and to apply properties like font
1217         and line-height before they are needed by custom properties. In this patch, the font-size property is
1218         applied twice, once before and once after resolving custom property values.
1219
1220         * Sources.txt:
1221         * WebCore.xcodeproj/project.pbxproj:
1222         * css/CSSComputedStyleDeclaration.cpp:
1223         (WebCore::ComputedStyleExtractor::customPropertyValue):
1224         (WebCore::CSSComputedStyleDeclaration::length const):
1225         (WebCore::CSSComputedStyleDeclaration::item const):
1226
1227         Allow JS to get custom properties that have been resolved to a length. Also add properties from
1228         m_rareNonInheritedData.
1229
1230         * css/CSSCustomPropertyValue.cpp:
1231         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const):
1232         (WebCore::CSSCustomPropertyValue::resolveVariableReferences const):
1233         * css/CSSCustomPropertyValue.h:
1234         * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h.
1235         (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
1236         (WebCore::CSSRegisteredCustomProperty::initialValueCopy const):
1237         * css/CSSRegisteredCustomProperty.h:
1238         (WebCore::CSSRegisteredCustomProperty::initialValue const):
1239         * css/CSSVariableData.cpp:
1240         (WebCore::CSSVariableData::checkVariablesForCycles const):
1241         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const):
1242         (WebCore::CSSVariableData::resolveVariableFallback const):
1243         (WebCore::CSSVariableData::resolveVariableReference const):
1244         (WebCore::CSSVariableData::resolveVariableReferences const):
1245         (WebCore::CSSVariableData::resolveTokenRange const):
1246         * css/CSSVariableData.h:
1247         * css/CSSVariableReferenceValue.cpp:
1248         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const):
1249         * css/CSSVariableReferenceValue.h:
1250         * css/DOMCSSRegisterCustomProperty.cpp:
1251         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
1252
1253         Use RenderStyle over passing in a customProperties map.
1254
1255         * css/StyleBuilder.h:
1256         * css/StyleBuilderConverter.h:
1257         (WebCore::StyleBuilderConverter::convertLength):
1258         (WebCore::StyleBuilderConverter::convertLengthOrAuto):
1259         (WebCore::StyleBuilderConverter::convertLengthSizing):
1260         (WebCore::StyleBuilderConverter::convertLengthMaxSizing):
1261         * css/StyleBuilderCustom.h:
1262         (WebCore::StyleBuilderCustom::applyInitialCustomProperty):
1263         (WebCore::StyleBuilderCustom::applyInheritCustomProperty):
1264         (WebCore::StyleBuilderCustom::applyValueCustomProperty):
1265         * css/StyleResolver.cpp:
1266         (WebCore::StyleResolver::useSVGZoomRules const):
1267         (WebCore::StyleResolver::useSVGZoomRulesForLength const):
1268         (WebCore::StyleResolver::applyProperty):
1269         (WebCore::StyleResolver::resolvedVariableValue const):
1270         (WebCore::StyleResolver::applyCascadedProperties):
1271         (WebCore::StyleResolver::useSVGZoomRules): Deleted.
1272         (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted.
1273         (WebCore::StyleResolver::resolvedVariableValue): Deleted.
1274         * css/StyleResolver.h:
1275         * css/makeprop.pl:
1276
1277         Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with
1278         inheritance, unset and revert values.
1279
1280         * css/parser/CSSParser.cpp:
1281         (WebCore::CSSParser::parseValueWithVariableReferences):
1282         * css/parser/CSSParser.h:
1283         * css/parser/CSSParserContext.cpp:
1284         (WebCore::CSSParserContext::CSSParserContext):
1285         * css/parser/CSSParserContext.h:
1286         * css/parser/CSSPropertyParser.cpp:
1287         (WebCore::CSSPropertyParser::parseSingleValue):
1288
1289         Allow parsing custom property values as lengths.
1290
1291         * rendering/style/RenderStyle.cpp:
1292         (WebCore::RenderStyle::checkVariablesInCustomProperties):
1293         * rendering/style/RenderStyle.h:
1294         (WebCore::RenderStyle::inheritedCustomProperties const):
1295         (WebCore::RenderStyle::nonInheritedCustomProperties const):
1296         (WebCore::RenderStyle::setInheritedCustomPropertyValue):
1297         (WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
1298         (WebCore::RenderStyle::getCustomProperty const):
1299         (WebCore::RenderStyle::customProperties const): Deleted.
1300         (WebCore::RenderStyle::setCustomPropertyValue): Deleted.
1301         * rendering/style/StyleRareNonInheritedData.cpp:
1302         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1303         (WebCore::StyleRareNonInheritedData::operator== const):
1304         * rendering/style/StyleRareNonInheritedData.h:
1305         * style/StyleResolveForDocument.cpp:
1306         (WebCore::Style::resolveForDocument):
1307
1308         Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find
1309         cycles between them.
1310
1311 2018-10-03  Ryosuke Niwa  <rniwa@webkit.org>
1312
1313         Clear m_pendingTargets in MutationObserver::takeRecords
1314         https://bugs.webkit.org/show_bug.cgi?id=190240
1315
1316         Reviewed by Geoffrey Garen.
1317
1318         In r236781, we delayed the clearing of m_pendingTargets until the end of microtask to avoid a race between
1319         mutation record's JS wrappers getting created and GC marking JS wrappers of elements in mutation records.
1320
1321         This patch shortens this delay to until mutation record's JS wrappers are created. Specifically, we make
1322         MutationObserver::takeRecords() return a struct which has both pending targets hash set and the vector of
1323         mutation records so that the hash set survives through the creation of JS wrappers for mutation records.
1324
1325         To do this, a new IDL extended attribute "ResultField" is introduced to specify the member variable in
1326         which the result is stored.
1327
1328         No new tests. Unfortunately, this race condition appears to be impossible to capture in a regression test.
1329
1330         * bindings/scripts/CodeGeneratorJS.pm:
1331         (GenerateOperationBodyDefinition):
1332         * bindings/scripts/IDLAttributes.json:
1333         * bindings/scripts/test/JS/JSTestInterface.cpp:
1334         (WebCore::jsTestInterfacePrototypeFunctionTakeNodesBody):
1335         (WebCore::jsTestInterfacePrototypeFunctionTakeNodes):
1336         * bindings/scripts/test/TestImplements.idl: Added a test case.
1337         * dom/MutationObserver.cpp:
1338         (WebCore::MutationObserver::takeRecords):
1339         (WebCore::MutationObserver::deliver):
1340         * dom/MutationObserver.h:
1341         * dom/MutationObserver.idl:
1342
1343 2018-10-03  Youenn Fablet  <youenn@apple.com>
1344
1345         Add VP8 support to WebRTC
1346         https://bugs.webkit.org/show_bug.cgi?id=189976
1347
1348         Reviewed by Eric Carlson.
1349
1350         Add a runtime flag to control activation of VP8 codec.
1351         Bind this runtime flag to the video codec factories.
1352         Test: webrtc/video-mute-vp8.html
1353
1354         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1355         (WebCore::createLibWebRTCPeerConnectionBackend):
1356         * page/RuntimeEnabledFeatures.h:
1357         (WebCore::RuntimeEnabledFeatures::webRTCVP8CodecEnabled const):
1358         (WebCore::RuntimeEnabledFeatures::setWebRTCVP8CodecEnabled):
1359         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1360         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
1361         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
1362         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
1363         * testing/Internals.cpp:
1364         (WebCore::Internals::resetToConsistentState):
1365         Enable VP8 codec for tests.
1366
1367 2018-09-28  Jiewen Tan  <jiewen_tan@apple.com>
1368
1369         [WebCrypto] ECDSA could not deal with invalid signature inputs
1370         https://bugs.webkit.org/show_bug.cgi?id=189879
1371         <rdar://problem/44701276>
1372
1373         Reviewed by Brent Fulgham.
1374
1375         Add some guards over detections of the start positions of r/s.
1376
1377         Covered by improved existing tests.
1378
1379         * crypto/mac/CryptoAlgorithmECDSAMac.cpp:
1380         (WebCore::verifyECDSA):
1381
1382 2018-10-03  Jer Noble  <jer.noble@apple.com>
1383
1384         Add a quirk to disable Modern EME for sites which are broken with it enabled
1385         https://bugs.webkit.org/show_bug.cgi?id=190051
1386
1387         Reviewed by Daniel Bates.
1388
1389         Add a new class, parallel to Settings, to track quirk behavior. Extend the bindings
1390         generator to support a DisabledByQuirk attribute, and set this attribute for all
1391         the Modern EME types. Check whether the quirk is set inside HTMLMediaElement in
1392         addition to the existing Setting.
1393
1394         * Modules/encryptedmedia/MediaKeyMessageEvent.idl:
1395         * Modules/encryptedmedia/MediaKeySession.idl:
1396         * Modules/encryptedmedia/MediaKeyStatusMap.idl:
1397         * Modules/encryptedmedia/MediaKeySystemAccess.idl:
1398         * Modules/encryptedmedia/MediaKeys.idl:
1399         * Modules/encryptedmedia/NavigatorEME.idl:
1400         * Sources.txt:
1401         * WebCore.xcodeproj/project.pbxproj:
1402         * bindings/scripts/CodeGenerator.pm:
1403         (WK_ucfirst):
1404         * bindings/scripts/CodeGeneratorJS.pm:
1405         (NeedsRuntimeCheck):
1406         (GenerateRuntimeEnableConditionalString):
1407         * bindings/scripts/IDLAttributes.json:
1408         * bindings/scripts/preprocess-idls.pl:
1409         (GenerateConstructorAttributes):
1410         * dom/Document.cpp:
1411         (WebCore::Document::Document):
1412         * dom/Document.h:
1413         (WebCore::Document::quirks const):
1414         * html/HTMLMediaElement.cpp:
1415         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
1416         (WebCore::HTMLMediaElement::mediaPlayerInitializationDataEncountered):
1417         * html/HTMLMediaElement.idl:
1418         * page/Quirks.cpp: Added.
1419         (Quirks::Quirks):
1420         (Quirks::disableEncryptedMediaAPIQuirk const):
1421         * page/Quirks.h: Added.
1422
1423 2018-10-03  Antoine Quint  <graouts@apple.com>
1424
1425         [Web Animations] REGRESSION: setting 'animation-name: none' after a 'fill: forwards' animation has completed does not revert to the unanimated style
1426         https://bugs.webkit.org/show_bug.cgi?id=190257
1427         <rdar://problem/41341473>
1428
1429         Reviewed by Dean Jackson.
1430
1431         Test: animations/animation-fill-forwards-removal.html
1432
1433         While we removed a declarative animation that was no longer targetting its element, we were not removing it from the declarative animation maps
1434         on the timeline, which means that the animation would still be picked up when resolving styles. We now notify the timeline that the animation
1435         was detached from the element. This preserves the DeclarativeAnimation relationship returning the element as its effect's target and the document
1436         timeline as its timeline, but the document timeline will no longer see this animation as targeting this element.
1437
1438         * animation/AnimationTimeline.cpp:
1439         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):
1440         * animation/DeclarativeAnimation.h:
1441         (WebCore::DeclarativeAnimation::target const):
1442
1443 2018-10-03  Jer Noble  <jer.noble@apple.com>
1444
1445         CRASH in CVPixelBufferGetBytePointerCallback()
1446         https://bugs.webkit.org/show_bug.cgi?id=190092
1447
1448         Reviewed by Eric Carlson.
1449
1450         Speculative fix for crash that occurs when callers of CVPixelBufferGetBytePointerCallback() attempt
1451         to read the last byte of a CVPixelBuffer (as a pre-flight check) and crash due to a memory access
1452         error. It's speculated that mismatching CVPixelBufferLockBytePointer / CVPixelBufferUnlockBytePointer
1453         calls could result in an incorrect state inside the CVPixelBuffer. Add log count checks, locking, and
1454         release logging to try to pinpoint if mismatch lock counts are occurring in this code path.
1455
1456         * platform/graphics/cv/PixelBufferConformerCV.cpp:
1457         (WebCore::CVPixelBufferGetBytePointerCallback):
1458         (WebCore::CVPixelBufferReleaseBytePointerCallback):
1459         (WebCore::CVPixelBufferReleaseInfoCallback):
1460         (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
1461
1462 2018-10-03  Chris Dumez  <cdumez@apple.com>
1463
1464         Regression(r236779): Crash when changing the input element type from inside an 'input' event listener
1465         https://bugs.webkit.org/show_bug.cgi?id=190252
1466
1467         Reviewed by Alex Christensen.
1468
1469         Add a null check for element() after firing the 'input' event and before firing the 'change' event
1470         in case the input event listener changes the input type.
1471
1472         Tests: fast/dom/HTMLInputElement/change-type-in-click-event-listener.html
1473                fast/dom/HTMLInputElement/change-type-in-input-event-listener.html
1474
1475         * html/BaseCheckableInputType.cpp:
1476         (WebCore::BaseCheckableInputType::fireInputAndChangeEvents):
1477
1478 2018-10-03  Chris Dumez  <cdumez@apple.com>
1479
1480         Passing noopener=NOOPENER to window.open() should cause the new window to not have an opener
1481         https://bugs.webkit.org/show_bug.cgi?id=190251
1482
1483         Reviewed by Alex Christensen.
1484
1485         Passing noopener=NOOPENER to window.open() should cause the new window to not have an opener,
1486         similarly to noopener=1:
1487         - https://html.spec.whatwg.org/#window-open-steps (step 5)
1488
1489         It does not matter what the value is, if there is a key named "noopener", then the new window
1490         should not have an opener.
1491
1492         No new tests, rebaselined existing test.
1493
1494         * page/WindowFeatures.cpp:
1495         (WebCore::setWindowFeature):
1496
1497 2018-10-03  Ryosuke Niwa  <rniwa@webkit.org>
1498
1499         GC can collect JS wrappers of nodes in the mutation records waiting to be delivered
1500         https://bugs.webkit.org/show_bug.cgi?id=190115
1501
1502         Reviewed by Geoffrey Garen.
1503
1504         Fixed the bug by retaining JS wrappers of elements in mutation records using GCReachableRef.
1505
1506         This patch deploys GCReachableRef in two places: MutationObserver where each mutation record's
1507         target is kept alive and MutationObserverRegistration where each node which had been removed
1508         from an observed tree is kept alive for a subtree observation.
1509
1510         No new test since the test which can reproduce this problem is too slow.
1511
1512         * dom/GCReachableRef.h:
1513         (WebCore::GCReachableRef): Made it work with hash table.
1514         (WebCore::GCReachableRef::operator T& const):
1515         (WebCore::GCReachableRef::GCReachableRef):
1516         (WebCore::GCReachableRef::isHashTableDeletedValue const):
1517         (WebCore::GCReachableRef::isHashTableEmptyValue const):
1518         (WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue const):
1519         (WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue):
1520         (WebCore::GCReachableRef::assignToHashTableEmptyValue):
1521         (WTF::HashTraits<WebCore::GCReachableRef<P>>::emptyValue):
1522         (WTF::HashTraits<WebCore::GCReachableRef<P>>::constructEmptyValue):
1523         (WTF::HashTraits<WebCore::GCReachableRef<P>>::isEmptyValue):
1524         (WTF::HashTraits<WebCore::GCReachableRef<P>>::assignToEmpty):
1525         (WTF::HashTraits<WebCore::GCReachableRef<P>>::peek):
1526         (WTF::HashTraits<WebCore::GCReachableRef<P>>::take):
1527         * dom/MutationObserver.cpp:
1528         (WebCore::MutationObserver::takeRecords): Don't clear m_pendingTargets because that would allow wrappers
1529         to be collected before elements in mutation records are accessed. We delay until the end of the current
1530         microtask at which point deliver() function is called.
1531         (WebCore::MutationObserver::disconnect):
1532         (WebCore::MutationObserver::enqueueMutationRecord): Add the target to the list of elements to keep alive.
1533         This is needed for a newly inserted node, a node with attribute change, etc...
1534         (WebCore::MutationObserver::deliver): Keep the set of transient registration targets alive until mutation
1535         records are delivered to each observer. These are nodes which had been removed from a tree and whose
1536         subtree had still been obsreved up until this point.
1537         * dom/MutationObserver.h:
1538         * dom/MutationObserverRegistration.cpp:
1539         (WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach):
1540         (WebCore::MutationObserverRegistration::takeTransientRegistrations): Return the hash set of elemenets
1541         that need to be kept alive so that MutationObserver::deliver can keep them alive until the deliver
1542         function had been called.
1543         (WebCore::MutationObserverRegistration::addRegistrationNodesToSet const):
1544         * dom/MutationObserverRegistration.h:
1545
1546 2018-10-03  Dean Jackson  <dino@apple.com>
1547
1548         Make the Pointer Events feature description valid
1549         https://bugs.webkit.org/show_bug.cgi?id=190254
1550
1551         Reviewed by Simon Fraser.
1552
1553         * features.json:
1554
1555 2018-10-03  Matt Lewis  <jlewis3@apple.com>
1556
1557         Unreviewed, rolling out r236781.
1558
1559         The test added with this commit is timing out consistently.
1560
1561         Reverted changeset:
1562
1563         "GC can collect JS wrappers of nodes in the mutation records
1564         waiting to be delivered"
1565         https://bugs.webkit.org/show_bug.cgi?id=190115
1566         https://trac.webkit.org/changeset/236781
1567
1568 2018-10-03  Dean Jackson  <dino@apple.com>
1569
1570         [macOS] Switching to discrete GPU should be done in the UI process
1571         https://bugs.webkit.org/show_bug.cgi?id=189361
1572         <rdar://problem/43949622>
1573
1574         Try to fix the IOSMAC build.
1575
1576         * platform/graphics/GraphicsContext3D.h:
1577
1578 2018-10-03  Chris Dumez  <cdumez@apple.com>
1579
1580         input.checked is incorrect while we're parsing its children
1581         https://bugs.webkit.org/show_bug.cgi?id=190227
1582
1583         Reviewed by Ryosuke Niwa.
1584
1585         input.checked was incorrect while we're parsing its children because we were delaying updating the
1586         checked state until HTMLInputElement::finishParsingChildren() is called, to avoid a bad interaction
1587         with form state restoration.
1588
1589         In this patch, we update the checked state as soon as the 'checked' attribute is set, when we know
1590         that no form state to restore.
1591
1592         fast/forms/radio/state-restore-radio-group.html covers the form restoration case and is still
1593         passing.
1594
1595         No new tests, rebaselined existing test.
1596
1597         * html/FormController.cpp:
1598         (WebCore::FormController::hasFormStateToRestore const):
1599         * html/FormController.h:
1600         * html/HTMLInputElement.cpp:
1601         (WebCore::HTMLInputElement::parseAttribute):
1602
1603 2018-10-03  Miguel Gomez  <magomez@igalia.com>
1604
1605         [GTK][WPE] Incorrect rendering of layers whose backingStore hasn't changed
1606         https://bugs.webkit.org/show_bug.cgi?id=190249
1607
1608         Reviewed by Žan Doberšek.
1609
1610         Do not overwrite m_nicosia.performLayerSync when updating the content buffers or we lose
1611         the value calculated during the layer flush. Use an OR instead to keep the old value.
1612
1613         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1614         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
1615
1616 2018-10-03  Youenn Fablet  <youenn@apple.com>
1617
1618         Enable H264 simulcast
1619         https://bugs.webkit.org/show_bug.cgi?id=190167
1620
1621         Reviewed by Eric Carlson.
1622
1623         Activate H264 simulcast trial field.
1624         Make track.getSettings() expose width and height for incoming tracks.
1625
1626         Test: webrtc/simulcast-h264.html
1627
1628         * Configurations/WebCore.xcconfig:
1629         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1630         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
1631         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
1632         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
1633
1634 2018-10-03  Michael Catanzaro  <mcatanzaro@igalia.com>
1635
1636         -Wunused-variable in RenderLayer::updateScrollableAreaSet
1637         https://bugs.webkit.org/show_bug.cgi?id=190200
1638
1639         Reviewed by Yusuke Suzuki.
1640
1641         Pass it through UNUSED_VARIABLE().
1642
1643         * rendering/RenderLayer.cpp:
1644         (WebCore::RenderLayer::calculateClipRects const):
1645
1646 2018-10-03  Zan Dobersek  <zdobersek@igalia.com>
1647
1648         Ref<FetchResponse> use-after-move in DOMCache::put()
1649         https://bugs.webkit.org/show_bug.cgi?id=190239
1650
1651         Reviewed by Youenn Fablet.
1652
1653         Retrieve reference from the Ref<FetchResponse> object before it's
1654         move-captured in the lambda that's passed to the
1655         FetchResponse::consumeBodyReceivedByChunk() method that is invoked on
1656         that very same object. This is a classic use-after-move bug that pops
1657         up on compilers with different C++ calling convention.
1658
1659         * Modules/cache/DOMCache.cpp:
1660         (WebCore::DOMCache::put):
1661
1662 2018-10-03  Ryosuke Niwa  <rniwa@webkit.org>
1663
1664         Enable selectionAcrossShadowBoundariesEnabled by default in WebKitLegacy
1665         https://bugs.webkit.org/show_bug.cgi?id=190238
1666
1667         Reviewed by Antti Koivisto.
1668
1669         Enable the feature by default.
1670
1671         * page/Settings.yaml:
1672
1673 2018-10-02  Ryosuke Niwa  <rniwa@webkit.org>
1674
1675         Copying content with shadow DOM doesn't copy any contents
1676         https://bugs.webkit.org/show_bug.cgi?id=157443
1677
1678         Reviewed by Wenson Hsieh.
1679
1680         This patch adds the support for copying and pasting content across shadow boundaries in HTML and plain text,
1681         which is enabled whenever selection across shadow boundaries is enabled.
1682
1683         To do this, TextIterator now has a constructor which takes two Positions, and the node traversal code in
1684         StyledMarkupAccumulator has been abstracted via helper functions as done for TextIterator.
1685
1686         When serializing a HTMl slot element, serialize it as a span with "display: contents" to make sure when
1687         the content is pasted into a shadow tree, it wouldn't affect the slot assignment of the shadow tree.
1688
1689         Tests: editing/pasteboard/copy-paste-across-shadow-boundaries-1.html
1690                editing/pasteboard/copy-paste-across-shadow-boundaries-2.html
1691                editing/pasteboard/copy-paste-across-shadow-boundaries-3.html
1692                editing/pasteboard/copy-paste-across-shadow-boundaries-4.html
1693                editing/pasteboard/copy-paste-across-shadow-boundaries-with-style-1.html
1694                editing/pasteboard/copy-paste-across-shadow-boundaries-with-style-2.html
1695                editing/pasteboard/copy-paste-with-shadow-content.html
1696
1697         * dom/ComposedTreeIterator.h:
1698         (WebCore::assignedSlotIgnoringUserAgentShadow): Moved from TextIterator.cpp.
1699         (WebCore::shadowRootIgnoringUserAgentShadow): Ditto.
1700         (WebCore::firstChildInComposedTreeIgnoringUserAgentShadow): Ditto.
1701         (WebCore::nextSiblingInComposedTreeIgnoringUserAgentShadow): Ditto.
1702         * dom/Position.h:
1703         (WebCore::Position::treeScope const): Added.
1704         * editing/EditingStyle.cpp:
1705         (WebCore::EditingStyle::addDisplayContents): Added.
1706         * editing/EditingStyle.h:
1707         * editing/Editor.cpp:
1708         (WebCore::Editor::selectedText const): Use the new behavior when selectionAcrossShadowBoundariesEnabled is set.
1709         (WebCore::Editor::selectedTextForDataTransfer const): Ditto.
1710         * editing/MarkupAccumulator.cpp:
1711         (WebCore::MarkupAccumulator::appendEndElement): Renamed from appendEndTag. Now takes StringBuilder.
1712         * editing/MarkupAccumulator.h:
1713         (WebCore::MarkupAccumulator::appendEndTag):
1714         * editing/TextIterator.cpp:
1715         (WebCore::TextIterator::TextIterator): Added a new variant which takes two positions.
1716         (WebCore::TextIterator::init):
1717         (WebCore::firstChild):
1718         (WebCore::nextSibling):
1719         (WebCore::plainText): Ditto.
1720         * editing/TextIterator.h:
1721         * editing/cocoa/EditorCocoa.mm:
1722         (WebCore::Editor::selectionInHTMLFormat): Use the new behavior if selectionAcrossShadowBoundariesEnabled is set.
1723         * editing/gtk/EditorGtk.cpp:
1724         (WebCore::Editor::writeSelectionToPasteboard): Ditto.
1725         * editing/markup.cpp:
1726         (WebCore::StyledMarkupAccumulator::parentNode): Added.
1727         (WebCore::StyledMarkupAccumulator::firstChild): Added.
1728         (WebCore::StyledMarkupAccumulator::nextSibling): Added.
1729         (WebCore::StyledMarkupAccumulator::nextSkippingChildren): Added.
1730         (WebCore::StyledMarkupAccumulator::hasChildNodes): Added.
1731         (WebCore::StyledMarkupAccumulator::isDescendantOf): Added.
1732         (WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator):
1733         (WebCore::StyledMarkupAccumulator::appendElement): Serialize a slot element as a span with display: contents.
1734         (WebCore::StyledMarkupAccumulator::appendEndElement): Added. Ditto.
1735         (WebCore::StyledMarkupAccumulator::serializeNodes):
1736         (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization): Use the newly added helper functions to
1737         traverse the composed tree when m_useComposedTree is set.
1738         (WebCore::commonShadowIncludingAncestor): Added.
1739         (WebCore::serializePreservingVisualAppearanceInternal): Added SerializeComposedTree as an argument. Also use
1740         StyledMarkupAccumulator::parentNode to serialize special common ancestors; e.g. to preserve b, i, etc...
1741         (WebCore::serializePreservingVisualAppearance): Ditto to the variant which takes VisibleSelection.
1742         (WebCore::sanitizedMarkupForFragmentInDocument):
1743         * editing/markup.h:
1744         * editing/wpe/EditorWPE.cpp:
1745         (WebCore::Editor::writeSelectionToPasteboard):
1746         * loader/archive/cf/LegacyWebArchive.cpp:
1747         (WebCore::LegacyWebArchive::createFromSelection):
1748         * page/PageSerializer.cpp:
1749         (WebCore::PageSerializer::SerializerMarkupAccumulator::appendEndElement):
1750         * testing/Internals.cpp:
1751         (WebCore::Internals::setSelectionWithoutValidation): Added. A helper function to create a selection across
1752         shadow boundaries for testing purposes.
1753         * testing/Internals.h:
1754         * testing/Internals.idl:
1755
1756 2018-10-02  Chris Dumez  <cdumez@apple.com>
1757
1758         MessageEvent.ports should return the same object
1759         https://bugs.webkit.org/show_bug.cgi?id=190151
1760
1761         Reviewed by Darin Adler.
1762
1763         MessageEvent.ports should return the same object it was initialized to instead of
1764         constructing a new JSValue every time.
1765
1766         No new tests, rebaselined existing test.
1767
1768         * bindings/js/JSMessageEventCustom.cpp:
1769         (WebCore::JSMessageEvent::ports const):
1770         (WebCore::JSMessageEvent::visitAdditionalChildren):
1771         * dom/MessageEvent.cpp:
1772         (WebCore::MessageEvent::initMessageEvent):
1773         * dom/MessageEvent.h:
1774         * dom/MessageEvent.idl:
1775
1776 2018-10-01  Ryosuke Niwa  <rniwa@webkit.org>
1777
1778         GC can collect JS wrappers of nodes in the mutation records waiting to be delivered
1779         https://bugs.webkit.org/show_bug.cgi?id=190115
1780
1781         Reviewed by Geoffrey Garen.
1782
1783         Fixed the bug by retaining JS wrappers of elements in mutation records using GCReachableRef.
1784
1785         This patch deploys GCReachableRef in two places: MutationObserver where each mutation record's
1786         target is kept alive and MutationObserverRegistration where each node which had been removed
1787         from an observed tree is kept alive for a subtree observation.
1788
1789         Test: fast/dom/MutationObserver/mutation-observer-retains-js-wrappers-of-targets-alive.html
1790
1791         * dom/GCReachableRef.h:
1792         (WebCore::GCReachableRef): Made it work with hash table.
1793         (WebCore::GCReachableRef::operator T& const):
1794         (WebCore::GCReachableRef::GCReachableRef):
1795         (WebCore::GCReachableRef::isHashTableDeletedValue const):
1796         (WebCore::GCReachableRef::isHashTableEmptyValue const):
1797         (WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue const):
1798         (WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue):
1799         (WebCore::GCReachableRef::assignToHashTableEmptyValue):
1800         (WTF::HashTraits<WebCore::GCReachableRef<P>>::emptyValue):
1801         (WTF::HashTraits<WebCore::GCReachableRef<P>>::constructEmptyValue):
1802         (WTF::HashTraits<WebCore::GCReachableRef<P>>::isEmptyValue):
1803         (WTF::HashTraits<WebCore::GCReachableRef<P>>::assignToEmpty):
1804         (WTF::HashTraits<WebCore::GCReachableRef<P>>::peek):
1805         (WTF::HashTraits<WebCore::GCReachableRef<P>>::take):
1806         * dom/MutationObserver.cpp:
1807         (WebCore::MutationObserver::takeRecords): Don't clear m_pendingTargets because that would allow wrappers
1808         to be collected before elements in mutation records are accessed. We delay until the end of the current
1809         microtask at which point deliver() function is called.
1810         (WebCore::MutationObserver::disconnect):
1811         (WebCore::MutationObserver::enqueueMutationRecord): Add the target to the list of elements to keep alive.
1812         This is needed for a newly inserted node, a node with attribute change, etc...
1813         (WebCore::MutationObserver::deliver): Keep the set of transient registration targets alive until mutation
1814         records are delivered to each observer. These are nodes which had been removed from a tree and whose
1815         subtree had still been obsreved up until this point.
1816         * dom/MutationObserver.h:
1817         * dom/MutationObserverRegistration.cpp:
1818         (WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach):
1819         (WebCore::MutationObserverRegistration::takeTransientRegistrations): Return the hash set of elemenets
1820         that need to be kept alive so that MutationObserver::deliver can keep them alive until the deliver
1821         function had been called.
1822         (WebCore::MutationObserverRegistration::addRegistrationNodesToSet const):
1823         * dom/MutationObserverRegistration.h:
1824
1825 2018-10-02  Chris Dumez  <cdumez@apple.com>
1826
1827         radio / checkbox inputs should fire "click, input, change" events in order when clicked
1828         https://bugs.webkit.org/show_bug.cgi?id=190223
1829
1830         Reviewed by Ryosuke Niwa.
1831
1832         radio / checkbox inputs should fire "click, input, change" events in order when clicked:
1833         - https://html.spec.whatwg.org/#radio-button-state-(type=radio)
1834         - https://html.spec.whatwg.org/#checkbox-state-(type=checkbox)
1835         - https://dom.spec.whatwg.org/#ref-for-eventtarget-activation-behavior③ (step 11)
1836
1837         Gecko and Blink already behave this way. However, WebKit has the following issues:
1838         - the input event is not fired
1839         - the click event is fired after the change event
1840
1841         No new tests, updated / rebaselined existing tests.
1842
1843         * html/BaseCheckableInputType.cpp:
1844         (WebCore::BaseCheckableInputType::fireInputAndChangeEvents):
1845         * html/BaseCheckableInputType.h:
1846         * html/CheckboxInputType.cpp:
1847         (WebCore::CheckboxInputType::willDispatchClick):
1848         (WebCore::CheckboxInputType::didDispatchClick):
1849         * html/HTMLInputElement.cpp:
1850         (WebCore::HTMLInputElement::setChecked):
1851         * html/HTMLInputElement.h:
1852         * html/RadioInputType.cpp:
1853         (WebCore::RadioInputType::willDispatchClick):
1854         (WebCore::RadioInputType::didDispatchClick):
1855
1856 2018-10-02  Chris Dumez  <cdumez@apple.com>
1857
1858         fieldset.elements should return an HTMLCollection instead of an HTMLFormControlsCollection
1859         https://bugs.webkit.org/show_bug.cgi?id=190218
1860
1861         Reviewed by Alex Christensen.
1862
1863         fieldset.elements should return an HTMLCollection instead of an HTMLFormControlsCollection:
1864         - https://github.com/whatwg/html/commit/8beedf0c2ffd38853caddec67490288f47afc8eb
1865
1866         Gecko has always behaved this way. Blink aligned with Gecko and the HTML specification in December 2016:
1867         - https://bugs.chromium.org/p/chromium/issues/detail?id=665291
1868
1869         This simplifies our HTMLFieldSetElement code a lot.
1870
1871         Test: fast/forms/fieldset/fieldset-elements-htmlcollection.html
1872
1873         * html/CollectionType.h:
1874         * html/GenericCachedHTMLCollection.cpp:
1875         (WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches const):
1876         * html/HTMLCollection.cpp:
1877         (WebCore::HTMLCollection::rootTypeFromCollectionType):
1878         (WebCore::invalidationTypeExcludingIdAndNameAttributes):
1879         * html/HTMLFieldSetElement.cpp:
1880         (WebCore::HTMLFieldSetElement::elements):
1881         * html/HTMLFieldSetElement.h:
1882         * html/HTMLFieldSetElement.idl:
1883         * html/HTMLFormControlsCollection.cpp:
1884         (WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection):
1885         (WebCore:: const):
1886         (WebCore::HTMLFormControlsCollection::copyFormControlElementsVector const):
1887         (WebCore::HTMLFormControlsCollection::ownerNode const):
1888         (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
1889         * html/HTMLFormControlsCollection.h:
1890
1891 2018-10-02  Devin Rousso  <drousso@apple.com>
1892
1893         Web Inspector: prevent layer events from firing until the layer information is re-requested
1894         https://bugs.webkit.org/show_bug.cgi?id=190159
1895
1896         Reviewed by Joseph Pecoraro.
1897
1898         Test: inspector/layers/layerTreeDidChange.html
1899
1900         * inspector/agents/InspectorLayerTreeAgent.h:
1901         * inspector/agents/InspectorLayerTreeAgent.cpp:
1902         (WebCore::InspectorLayerTreeAgent::reset):
1903         (WebCore::InspectorLayerTreeAgent::layerTreeDidChange):
1904         (WebCore::InspectorLayerTreeAgent::layersForNode):
1905
1906 2018-10-02  Brian Burg  <bburg@apple.com>
1907
1908         Web Automation: tab default key handler should always cycle focus when page is controlled by automation
1909         https://bugs.webkit.org/show_bug.cgi?id=190221
1910         <rdar://problem/44914534>
1911
1912         Reviewed by Joseph Pecoraro.
1913
1914         This change progresses WPT WebDriver test special_keys.py::test_webdriver_special_key_sends_keydown[TAB-expected24].
1915
1916         * page/FocusController.cpp:
1917         (WebCore::FocusController::advanceFocusInDocumentOrder):
1918         Always cycle focus if the page is controlled by automation. If the chrome takes
1919         focus, then the first responder will be something other than the WebView, which
1920         causes subsequent WebDriver commands to hang.
1921
1922 2018-10-01  Dean Jackson  <dino@apple.com>
1923
1924         [macOS] Switching to discrete GPU should be done in the UI process
1925         https://bugs.webkit.org/show_bug.cgi?id=189361
1926         <rdar://problem/43949622>
1927
1928         Reviewed by Simon Fraser.
1929
1930         Based on an earlier patch by Per Arne Vollan.
1931
1932         Due to the fact we can't talk to the Window Server, the Web Process can
1933         no longer muxing to the discrete GPU directly. Instead we have to get the
1934         UI Process to process the change. Do this by adding a new Chrome client
1935         called GPUClient, that will have implementations provided by both WebKit
1936         and legacy WebKit.
1937
1938         Unfortunately this can't be tested by a regular WKTR since:
1939         - it requires specific hardware
1940         - swapping to/from the discrete GPU takes about 20 seconds
1941         - running concurrent tests could confuse the tests into thinking
1942           the wrong GPU is active
1943
1944         Instead we'll write a specific test for this functionality and
1945         run it on a separate bot.
1946
1947         * WebCore.xcodeproj/project.pbxproj: Add GPUClient files.
1948
1949         * page/Chrome.cpp: Drive by clean-up.
1950         (WebCore::Chrome::windowScreenDidChange):
1951
1952         * platform/graphics/GraphicsContext3D.h: We need to keep track of
1953         whether we've muxed for this context, in order to not respond to
1954         the screen change notifications (they are misleading in the case
1955         of muxing).
1956
1957         * platform/graphics/GraphicsContext3DManager.cpp: Rather than try
1958         to mux directly, call into GPUClient.
1959         (WebCore::GraphicsContext3DManager::displayWasReconfigured):
1960         (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
1961         (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired):
1962         (WebCore::GraphicsContext3DManager::recycleContextIfNecessary):
1963         * platform/graphics/GraphicsContext3DManager.h:
1964
1965         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm: Only reconfigure
1966         the virtual display if it didn't happen from muxing.
1967         (WebCore::GraphicsContext3D::GraphicsContext3D):
1968         (WebCore::GraphicsContext3D::updateCGLContext):
1969         (WebCore::GraphicsContext3D::screenDidChange):
1970
1971         * platform/graphics/mac/SwitchingGPUClient.cpp: Added.
1972         (WebCore::SwitchingGPUClient::singleton):
1973         (WebCore::SwitchingGPUClient::setSingleton):
1974         * platform/graphics/mac/SwitchingGPUClient.h: Added.
1975
1976         * testing/Internals.cpp: Testing helper.
1977         (WebCore::Internals::hasMuxableGPU):
1978         * testing/Internals.h:
1979         * testing/Internals.idl:
1980
1981 2018-10-02  Chris Dumez  <cdumez@apple.com>
1982
1983         Image.__proto__ should be Function.prototype, not HTMLElement.prototype
1984         https://bugs.webkit.org/show_bug.cgi?id=190216
1985
1986         Reviewed by Alex Christensen.
1987
1988         Properties created for named constructors should always use Function.prototype as prototype, as per:
1989         - https://heycam.github.io/webidl/#named-constructors
1990
1991         Gecko and Blink agree with the Web IDL specification. However, WebKit was using the parent interface's
1992         prototype if such a parent existing. So Image.__proto__ would end up being HTMLElement.prototype
1993         instead of Function.prototype.
1994
1995         No new tests, rebaselined existing test.
1996
1997         * bindings/scripts/CodeGeneratorJS.pm:
1998         (GenerateConstructorHelperMethods):
1999
2000 2018-10-02  Alex Christensen  <achristensen@webkit.org>
2001
2002         Prepare WebCoreNSURLExtras for ARC
2003         https://bugs.webkit.org/show_bug.cgi?id=190219
2004
2005         Reviewed by Tim Horton.
2006
2007         ARC doesn't like the explicit sending of -release.
2008         Use RetainPtr instead.
2009
2010         * platform/mac/WebCoreNSURLExtras.mm:
2011         (WebCore::collectRangesThatNeedMapping):
2012         (WebCore::collectRangesThatNeedEncoding):
2013         (WebCore::collectRangesThatNeedDecoding):
2014         (WebCore::applyHostNameFunctionToMailToURLString):
2015         (WebCore::applyHostNameFunctionToURLString):
2016         (WebCore::mapHostNames):
2017         (WebCore::stringByTrimmingWhitespace):
2018         (WebCore::URLWithUserTypedString):
2019         (WebCore::userVisibleString):
2020         (WebCore::rangeOfURLScheme):
2021         (WebCore::looksLikeAbsoluteURL):
2022         (WebCore::retain): Deleted.
2023
2024 2018-10-02  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2025
2026         [Curl] Fix missing values of  resource timing API.
2027         https://bugs.webkit.org/show_bug.cgi?id=190193
2028
2029         Reviewed by Alex Christensen.
2030
2031         The property nextHopProtocol was not returned correctly. It was
2032         returned only when remote inspector is opened.
2033
2034         Tests: http/wpt/resource-timing/rt-nextHopProtocol.html
2035                http/wpt/resource-timing/rt-nextHopProtocol.worker.html
2036
2037         * platform/network/curl/CurlContext.cpp:
2038         (WebCore::CurlHandle::getNetworkLoadMetrics):
2039         (WebCore::CurlHandle::addExtraNetworkLoadMetrics):
2040
2041 2018-10-02  Alex Christensen  <achristensen@webkit.org>
2042
2043         Remove unused linked-on-or-before-iOS5 check
2044         https://bugs.webkit.org/show_bug.cgi?id=190164
2045
2046         Reviewed by Michael Saboff.
2047
2048         If an app hasn't been updated since iOS5, it can't run supported iOS.
2049         This value is also only checked in an uninstantiated template function.
2050
2051         * platform/URL.cpp:
2052         (WebCore::enableURLSchemeCanonicalization): Deleted.
2053         (WebCore::equal): Deleted.
2054         * platform/URL.h:
2055
2056 2018-10-02  Alex Christensen  <achristensen@webkit.org>
2057
2058         Remove ParsedURLString
2059         https://bugs.webkit.org/show_bug.cgi?id=190154
2060
2061         Reviewed by Chris Dumez.
2062
2063         Before the introduction of URLParser, it would indicate that we should assume the String
2064         is from a valid URL so we can skip canonicalization and just find the offsets inside the String
2065         to quickly create a URL.  It was a performance optimization that caused security issues when
2066         misused.  Since the introduction of URLParser, we have a fast path for all URL parsing, so
2067         right now it actually doesn't change any behavior.  It's just a relic of the past that complicates
2068         the URL class, making it harder to express which constructor to use and making it harder to move
2069         the class.
2070
2071         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
2072         (WebCore::NavigatorContentUtils::registerProtocolHandler):
2073         (WebCore::NavigatorContentUtils::isProtocolHandlerRegistered):
2074         (WebCore::NavigatorContentUtils::unregisterProtocolHandler):
2075         * dom/Document.cpp:
2076         (WebCore::Document::updateBaseURL):
2077         (WebCore::Document::initSecurityContext):
2078         * dom/ExtensionStyleSheets.cpp:
2079         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
2080         * dom/ProcessingInstruction.cpp:
2081         (WebCore::ProcessingInstruction::checkStyleSheet):
2082         * editing/markup.cpp:
2083         (WebCore::completeURLs):
2084         * fileapi/BlobURL.cpp:
2085         (WebCore::BlobURL::createBlobURL):
2086         * history/HistoryItem.cpp:
2087         (WebCore::HistoryItem::url const):
2088         (WebCore::HistoryItem::originalURL const):
2089         * html/HTMLFrameElementBase.cpp:
2090         (WebCore::HTMLFrameElementBase::location const):
2091         * html/HTMLMediaElement.cpp:
2092         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
2093         * html/PublicURLManager.cpp:
2094         (WebCore::PublicURLManager::stop):
2095         * inspector/InspectorStyleSheet.cpp:
2096         (WebCore::InspectorStyleSheet::resourceStyleSheetText const):
2097         * inspector/agents/InspectorPageAgent.cpp:
2098         (WebCore::InspectorPageAgent::getCookies):
2099         (WebCore::InspectorPageAgent::deleteCookie):
2100         (WebCore::InspectorPageAgent::getResourceContent):
2101         (WebCore::InspectorPageAgent::searchInResource):
2102         * inspector/agents/page/PageDebuggerAgent.cpp:
2103         (WebCore::PageDebuggerAgent::sourceMapURLForScript):
2104         * loader/DocumentLoader.cpp:
2105         (WebCore::DocumentLoader::subresources const):
2106         * loader/FrameLoader.cpp:
2107         (WebCore::FrameLoader::init):
2108         (WebCore::FrameLoader::initForSynthesizedDocument):
2109         * loader/HistoryController.cpp:
2110         (WebCore::HistoryController::pushState):
2111         (WebCore::HistoryController::replaceState):
2112         * loader/appcache/ApplicationCache.cpp:
2113         (WebCore::ApplicationCache::addResource):
2114         (WebCore::ApplicationCache::resourceForURL):
2115         * loader/appcache/ApplicationCacheGroup.cpp:
2116         (WebCore::ApplicationCacheGroup::startLoadingEntry):
2117         (WebCore::ApplicationCacheGroup::addEntry):
2118         * loader/appcache/ApplicationCacheStorage.cpp:
2119         (WebCore::ApplicationCacheStorage::cacheGroupForURL):
2120         (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
2121         (WebCore::ApplicationCacheStorage::loadCache):
2122         (WebCore::ApplicationCacheStorage::manifestURLs):
2123         * loader/archive/cf/LegacyWebArchive.cpp:
2124         (WebCore::LegacyWebArchive::create):
2125         * page/DOMWindow.cpp:
2126         (WebCore::DOMWindow::createWindow):
2127         * page/PageSerializer.cpp:
2128         (WebCore::PageSerializer::urlForBlankFrame):
2129         * platform/URL.cpp:
2130         (WebCore::blankURL):
2131         * platform/URL.h:
2132         (): Deleted.
2133         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2134         (WebCore::MediaPlayerPrivateAVFoundation::load):
2135         * platform/network/BlobRegistryImpl.cpp:
2136         (WebCore::BlobRegistryImpl::populateBlobsForFileWriting):
2137         * platform/network/ResourceRequestBase.h:
2138         (WebCore::ResourceRequestBase::decodeBase):
2139         * platform/network/ResourceResponseBase.cpp:
2140         (WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
2141         * platform/network/cf/DNSResolveQueueCFNet.cpp:
2142         (WebCore::DNSResolveQueueCFNet::updateIsUsingProxy):
2143         * platform/network/cf/ResourceRequest.h:
2144         (WebCore::ResourceRequest::ResourceRequest):
2145         * platform/network/curl/CookieJarDB.cpp:
2146         (WebCore::CookieJarDB::searchCookies):
2147         (WebCore::CookieJarDB::setCookie):
2148         (WebCore::CookieJarDB::deleteCookie):
2149         * platform/network/curl/ResourceRequest.h:
2150         (WebCore::ResourceRequest::ResourceRequest):
2151         * platform/network/soup/ResourceRequest.h:
2152         (WebCore::ResourceRequest::ResourceRequest):
2153         * xml/XSLTProcessorLibxslt.cpp:
2154         (WebCore::docLoaderFunc):
2155
2156 2018-10-02  Per Arne Vollan  <pvollan@apple.com>
2157
2158         [WebVTT] Cue with line setting is not rendered correctly
2159         https://bugs.webkit.org/show_bug.cgi?id=190168
2160
2161         Reviewed by Eric Carlson.
2162
2163         When the line setting contains an optional alignment value, the cue is not rendered at the correct position,
2164         see https://w3c.github.io/webvtt/#webvtt-line-cue-setting. This patch does not implement correct handling of
2165         the line setting alignment values, it only makes sure parsing does not fail when the cue has line alignment
2166         settings.
2167
2168         Test: media/track/track-cue-line-position.html
2169
2170         * html/track/VTTCue.cpp:
2171         (WebCore::VTTCueBox::applyCSSProperties):
2172         (WebCore::VTTCue::getPositionCoordinates const):
2173         (WebCore::VTTCue::setCueSettings):
2174
2175 2018-10-02  Antti Koivisto  <antti@apple.com>
2176
2177         User installed fonts are not always disabled when they should be
2178         https://bugs.webkit.org/show_bug.cgi?id=190195
2179
2180         Reviewed by Geoffrey Garen.
2181
2182         SVG images and some theme cases fail to respect the setting. Besides the obvious problem this
2183         is also a performance issue as various font caches include this setting in the key.
2184
2185         * platform/graphics/FontDescription.cpp:
2186         (WebCore::m_shouldAllowUserInstalledFonts):
2187
2188         Initialize to 'No' by default. All paths where user fonts make sense already set the bit from
2189         settings. This fixes some cases in system themes that construct FontDescriptions from scratch.
2190
2191         * rendering/RenderElement.cpp:
2192         (WebCore::RenderElement::styleWillChange):
2193
2194         Add assertion. This verified the change with the existing tests.
2195
2196         * svg/graphics/SVGImage.cpp:
2197         (WebCore::SVGImage::dataChanged):
2198
2199         Always disallow user fonts in SVG used as images.
2200
2201 2018-10-01  Dean Jackson  <dino@apple.com>
2202
2203         Remove CSS Animation Triggers
2204         https://bugs.webkit.org/show_bug.cgi?id=190175
2205         <rdar://problem/44925626>
2206
2207         Reviewed by Simon Fraser.
2208
2209         Remove the never-properly specified CSS Animation Triggers.
2210
2211         * Configurations/FeatureDefines.xcconfig:
2212         * Sources.txt:
2213         * WebCore.xcodeproj/project.pbxproj:
2214         * css/CSSAnimationTriggerScrollValue.cpp: Removed.
2215         * css/CSSAnimationTriggerScrollValue.h: Removed.
2216         * css/CSSComputedStyleDeclaration.cpp:
2217         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2218         (WebCore::createAnimationTriggerValue): Deleted.
2219         (WebCore::animationTriggerValue): Deleted.
2220         * css/CSSProperties.json:
2221         * css/CSSToStyleMap.cpp:
2222         (WebCore::CSSToStyleMap::mapAnimationTrigger): Deleted.
2223         * css/CSSToStyleMap.h:
2224         * css/CSSValue.cpp:
2225         (WebCore::CSSValue::equals const):
2226         (WebCore::CSSValue::cssText const):
2227         (WebCore::CSSValue::destroy):
2228         * css/CSSValue.h:
2229         (WebCore::CSSValue::isAnimationTriggerScrollValue const): Deleted.
2230         * css/parser/CSSPropertyParser.cpp:
2231         (WebCore::consumeAnimationValue):
2232         (WebCore::CSSPropertyParser::parseSingleValue):
2233         (WebCore::consumeWebkitAnimationTrigger): Deleted.
2234         * page/FrameView.cpp:
2235         (WebCore::FrameView::sendScrollEvent):
2236         * page/RuntimeEnabledFeatures.h:
2237         (WebCore::RuntimeEnabledFeatures::setAnimationTriggersEnabled): Deleted.
2238         (WebCore::RuntimeEnabledFeatures::animationTriggersEnabled const): Deleted.
2239         * page/animation/AnimationBase.cpp:
2240         (WebCore::AnimationBase::updateStateMachine):
2241         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
2242         (WebCore::AnimationBase::timeToNextService):
2243         (WebCore::AnimationBase::getElapsedTime const):
2244         * page/animation/CSSAnimationController.cpp:
2245         (WebCore::CSSAnimationControllerPrivate::animationWillBeRemoved):
2246         (WebCore::CSSAnimationControllerPrivate::addToAnimationsDependentOnScroll): Deleted.
2247         (WebCore::CSSAnimationControllerPrivate::removeFromAnimationsDependentOnScroll): Deleted.
2248         (WebCore::CSSAnimationControllerPrivate::scrollWasUpdated): Deleted.
2249         (WebCore::CSSAnimationController::wantsScrollUpdates const): Deleted.
2250         (WebCore::CSSAnimationController::scrollWasUpdated): Deleted.
2251         * page/animation/CSSAnimationController.h:
2252         * page/animation/CSSAnimationControllerPrivate.h:
2253         (WebCore::CSSAnimationControllerPrivate::wantsScrollUpdates const): Deleted.
2254         (WebCore::CSSAnimationControllerPrivate::scrollPosition const): Deleted.
2255         * page/animation/CompositeAnimation.cpp:
2256         (WebCore::CompositeAnimation::updateKeyframeAnimations):
2257         * page/animation/CompositeAnimation.h:
2258         (WebCore::CompositeAnimation::hasScrollTriggeredAnimation const): Deleted.
2259         * platform/animation/Animation.cpp:
2260         (WebCore::Animation::Animation):
2261         (WebCore::Animation::operator=):
2262         (WebCore::Animation::animationsMatch const):
2263         * platform/animation/Animation.h:
2264         (WebCore::Animation::isTimingFunctionSet const):
2265         (WebCore::Animation::isEmpty const):
2266         (WebCore::Animation::clearTimingFunction):
2267         (WebCore::Animation::clearAll):
2268         (WebCore::Animation::animationMode const):
2269         (WebCore::Animation::setAnimationMode):
2270         (WebCore::Animation::initialTimingFunction):
2271         (WebCore::Animation::isTriggerSet const): Deleted.
2272         (WebCore::Animation::clearTrigger): Deleted.
2273         (WebCore::Animation::trigger const): Deleted.
2274         (WebCore::Animation::setTrigger): Deleted.
2275         (WebCore::Animation::initialTrigger): Deleted.
2276         * platform/animation/AnimationTrigger.h: Removed.
2277         * platform/graphics/ca/GraphicsLayerCA.cpp:
2278         (WebCore::GraphicsLayerCA::animationCanBeAccelerated const):
2279 2018-10-02  Commit Queue  <commit-queue@webkit.org>
2280
2281         Unreviewed, rolling out r236624 and r236671.
2282         https://bugs.webkit.org/show_bug.cgi?id=190207
2283
2284         The change in r236624 introduced crashes on the bots
2285         (Requested by ryanhaddad on #webkit).
2286
2287         Reverted changesets:
2288
2289         "Refactoring: eliminate raw pointer usage in Fullscreen code"
2290         https://bugs.webkit.org/show_bug.cgi?id=188747
2291         https://trac.webkit.org/changeset/236624
2292
2293         "Unify implementation in VideoFullscreenInterfaceAVKit"
2294         https://bugs.webkit.org/show_bug.cgi?id=190091
2295         https://trac.webkit.org/changeset/236671
2296
2297 2018-10-02  Sihui Liu  <sihui_liu@apple.com>
2298
2299         Add release assertion to ensure m_owningPointerForClose is null in UniqueIDBDatabase::invokeOperationAndTransactionTimer()
2300         https://bugs.webkit.org/show_bug.cgi?id=190178
2301
2302         Reviewed by Chris Dumez.
2303
2304         This would help debug rdar://problem/44902833.
2305
2306         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2307         (WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer):
2308
2309 2018-10-02  Commit Queue  <commit-queue@webkit.org>
2310
2311         Unreviewed, rolling out r236719.
2312         https://bugs.webkit.org/show_bug.cgi?id=190197
2313
2314         this revision caused 39 layout test failures that tested for
2315         scrolling, a bug was also not present in the commit or change
2316         log. (Requested by Truitt on #webkit).
2317
2318         Reverted changeset:
2319
2320         "Unreviewed, fix unused variable in
2321         RenderLayer::updateScrollableAreaSet"
2322         https://trac.webkit.org/changeset/236719
2323
2324 2018-10-02  Alicia Boya García  <aboya@igalia.com>
2325
2326         [MSE][GStreamer] Add h264parse to accept MP4 without stss
2327         https://bugs.webkit.org/show_bug.cgi?id=190143
2328
2329         Reviewed by Xabier Rodriguez-Calvar.
2330
2331         The MP4 file used in this URL does not contain a stss (Sync Sample
2332         Box). In consequence, in acordance with the ISO BMFF spec, all samples
2333         are assumed to be sync frames... But in this case that is not true,
2334         it's just that the file is wrong (e.g. created with a buggy muxer).
2335
2336         http://orange-opensource.github.io/hasplayer.js/1.2.0/player.html?url=http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest
2337
2338         The way it works in other browsers is because instead of trusting the
2339         MP4 stss table, they rely on parsing the h264 frames. We can do that
2340         too.
2341
2342         This patch also changes RELEASE_ASSERT() when creating the parsers
2343         to GLib criticals.
2344
2345         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2346         (WebCore::createOptionalParserForFormat):
2347
2348 2018-10-02  Eric Carlson  <eric.carlson@apple.com>
2349
2350         [MediaStream] RealtimeMediaSource should be able to vend hashed IDs
2351         https://bugs.webkit.org/show_bug.cgi?id=190142
2352         <rdar://problem/44911109>
2353
2354         Reviewed by Youenn Fablet.
2355
2356         No new tests, covered by existing tests.
2357
2358         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
2359         (WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Update order of parameters passed
2360         to base class.
2361
2362         * Modules/mediastream/MediaDevicesRequest.cpp:
2363         (WebCore::MediaDevicesRequest::start): ASSERT if document.deviceIDHashSalt is not the same
2364         as passed salt.
2365
2366         * Modules/mediastream/MediaStreamTrack.cpp:
2367         (WebCore::MediaStreamTrack::getSettings const): Don't need to hash ID.
2368         (WebCore::MediaStreamTrack::getCapabilities const): Ditto.
2369         * Modules/mediastream/MediaStreamTrack.h:
2370         * Modules/mediastream/MediaStreamTrack.idl:
2371
2372         * Modules/mediastream/UserMediaRequest.cpp:
2373         (WebCore::UserMediaRequest::allow): Pass hash salt to createMediaStream.
2374
2375         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2376         (WebCore::LibWebRTCPeerConnectionBackend::createReceiverForSource): Update order of parameters passed
2377         to base class.
2378
2379         * Modules/webaudio/MediaStreamAudioSource.cpp:
2380         (WebCore::MediaStreamAudioSource::MediaStreamAudioSource): Ditto.
2381         * platform/mediastream/MediaConstraints.h:
2382
2383         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
2384         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource): Ditto.
2385
2386         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
2387         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource): Ditto.
2388
2389         * platform/mediastream/RealtimeMediaSource.cpp:
2390         (WebCore::RealtimeMediaSource::RealtimeMediaSource): Calculate hashed ID.
2391         (WebCore::RealtimeMediaSource::selectSettings): Use m_hashedID.
2392         (WebCore::RealtimeMediaSource::hashedId const): New.
2393         (WebCore::RealtimeMediaSource::deviceIDHashSalt const): New.
2394         * platform/mediastream/RealtimeMediaSource.h:
2395
2396         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
2397         (WebCore::RealtimeMediaSourceCenter::createMediaStream): Take hash salt, pass it when creating
2398         a source.
2399         (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices): Ditto.
2400         (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
2401         * platform/mediastream/RealtimeMediaSourceCenter.h:
2402
2403         * platform/mediastream/RealtimeMediaSourceFactory.h:
2404         * platform/mediastream/RealtimeVideoSource.cpp:
2405         (WebCore::RealtimeVideoSource::RealtimeVideoSource): Update parameters.
2406         * platform/mediastream/RealtimeVideoSource.h:
2407
2408         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
2409         (WebCore::GStreamerAudioCaptureSource::create): Ditto.
2410         (WebCore::GStreamerAudioCaptureSource::GStreamerAudioCaptureSource): Ditto.
2411         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
2412
2413         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
2414         (WebCore::GStreamerVideoCaptureSource::create): Ditto.
2415         (WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource): Ditto.
2416         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
2417
2418         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
2419         (WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource): Ditto.
2420         (WebCore::MockRealtimeAudioSource::create): Ditto.
2421         (WebCore::MockGStreamerAudioCaptureSource::MockGStreamerAudioCaptureSource): Ditto.
2422         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
2423
2424         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
2425         (WebCore::MockRealtimeVideoSource::create): Ditto.
2426         (WebCore::MockGStreamerVideoCaptureSource::MockGStreamerVideoCaptureSource): Ditto.
2427         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
2428
2429         * platform/mediastream/mac/AVVideoCaptureSource.h:
2430         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2431         (WebCore::AVVideoCaptureSource::create): Ditto.
2432         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Ditto.
2433         (WebCore::AVVideoCaptureSource::settings): Use hashedId to set device ID.
2434         (WebCore::AVVideoCaptureSource::capabilities): Ditto.
2435
2436         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2437         (WebCore::CoreAudioCaptureSource::create): Update parameters.
2438         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): Ditto.
2439         (WebCore::CoreAudioCaptureSource::capabilities): Use hashedId to set device ID.
2440         (WebCore::CoreAudioCaptureSource::settings): Ditto.
2441         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2442
2443         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
2444         (WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa): Update parameters.
2445         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
2446
2447         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
2448         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
2449         (WebCore::MockRealtimeAudioSource::create): Ditto.
2450         (WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac): Ditto.
2451
2452         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
2453         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
2454         (WebCore::MockRealtimeVideoSource::create): Ditto.
2455         (WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac): Ditto.
2456
2457         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2458
2459         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
2460         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
2461         (WebCore::ScreenDisplayCaptureSourceMac::create): Ditto.
2462         (WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac): Ditto.
2463         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Update logging.
2464         (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
2465         (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.
2466
2467         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
2468         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm:
2469         (WebCore::WindowDisplayCaptureSourceMac::create): Update parameters.
2470
2471         * platform/mock/MockRealtimeAudioSource.cpp:
2472         (WebCore::MockRealtimeAudioSource::create): Ditto.
2473         (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): Ditto.
2474         (WebCore::MockRealtimeAudioSource::settings): Use hashedId to set device ID.
2475         (WebCore::MockRealtimeAudioSource::capabilities): Ditto.
2476         * platform/mock/MockRealtimeAudioSource.h:
2477
2478         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2479
2480         * platform/mock/MockRealtimeVideoSource.cpp:
2481         (WebCore::MockRealtimeVideoSource::create): Update parameters.
2482         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Ditto.
2483         (WebCore::MockRealtimeVideoSource::capabilities): Use hashedId to set device ID.
2484         (WebCore::MockRealtimeVideoSource::settings): Ditto.
2485         * platform/mock/MockRealtimeVideoSource.h:
2486
2487 2018-10-02  Philippe Normand  <pnormand@igalia.com>
2488
2489         [GStreamer][playbin3] Stream tag lists leaks
2490         https://bugs.webkit.org/show_bug.cgi?id=190192
2491
2492         Reviewed by Xabier Rodriguez-Calvar.
2493
2494         The gst_stream_get_tags() result is transfer-full, so needs to be adopted to prevent a leak.
2495         Also check the tags list pointer which might be NULL in some cases.
2496
2497         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
2498         (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
2499         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2500         (WebCore::MediaPlayerPrivateGStreamer::naturalSize const):
2501         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
2502         (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
2503
2504 2018-10-01  Michael Catanzaro  <mcatanzaro@igalia.com>
2505
2506         Unreviewed, fix unused variable in RenderLayer::updateScrollableAreaSet
2507
2508         * rendering/RenderLayer.cpp:
2509         (WebCore::RenderLayer::calculateClipRects const): This is a prepare-ChangeLog bug. I don't
2510         have any changes in this function....
2511
2512 2018-10-02  Alicia Boya García  <aboya@igalia.com>
2513
2514         [MSE][GStreamer] Make same thread assert non-release
2515         https://bugs.webkit.org/show_bug.cgi?id=189924
2516
2517         Reviewed by Xabier Rodriguez-Calvar.
2518
2519         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2520         (WebCore::AppendPipeline::handleNewAppsinkSample):
2521
2522 2018-10-01  Ryosuke Niwa  <rniwa@webkit.org>
2523
2524         Add a new variant of serializePreservingVisualAppearance which takes VisibleSelection
2525         https://bugs.webkit.org/show_bug.cgi?id=190108
2526
2527         Reviewed by Wenson Hsieh.
2528
2529         Added a version of serializePreservingVisualAppearance which takes VisibleSelection so that we can avoid creating
2530         a range simply to get the first node and the end node of the selection later. This simple change also fixes a bug
2531         demonstrated in editing/pasteboard/paste-table-003.html.
2532
2533         Test: editing/pasteboard/paste-table-003.html
2534
2535         * editing/cocoa/EditorCocoa.mm:
2536         (WebCore::Editor::selectionInHTMLFormat): Adopt the new variant.
2537         * editing/gtk/EditorGtk.cpp:
2538         (WebCore::Editor::writeSelectionToPasteboard): Ditto.
2539         * editing/markup.cpp:
2540         (WebCore::serializePreservingVisualAppearance): Added.
2541         * editing/markup.h:
2542         * editing/wpe/EditorWPE.cpp:
2543         (WebCore::Editor::writeSelectionToPasteboard): Ditto.
2544         * loader/archive/cf/LegacyWebArchive.cpp:
2545         (WebCore::LegacyWebArchive::createFromSelection): Ditto.
2546         * platform/win/PasteboardWin.cpp:
2547         (WebCore::Pasteboard::writeSelection): Ditto.
2548
2549 2018-10-01  Alex Christensen  <achristensen@webkit.org>
2550
2551         Don't read from WebCore's bundle for IDNScriptWhiteList
2552         https://bugs.webkit.org/show_bug.cgi?id=190157
2553
2554         Reviewed by Dan Bernstein.
2555
2556         No change in behavior.  This increases performance by not reading from the WebCore bundle,
2557         and it makes it so that URL-related functionality can be moved to a place without
2558         a bundle for resources.
2559
2560         * Resources/IDNScriptWhiteList.txt: Removed.
2561         * WebCore.xcodeproj/project.pbxproj:
2562         * platform/mac/WebCoreNSURLExtras.mm:
2563         (WebCore::whiteListIDNScripts):
2564         (WebCore::allCharactersInIDNScriptWhiteList):
2565         (WebCore::readIDNScriptWhiteListFile): Deleted.
2566
2567 2018-10-01  Alex Christensen  <achristensen@webkit.org>
2568
2569         Unreviewed, rolling out r236551.
2570
2571         Fails URL validating too aggressively
2572
2573         Reverted changeset:
2574
2575         "URLWithUserTypedString should return nil for URLs deemed to
2576         be invalid by WebCore::URL"
2577         https://bugs.webkit.org/show_bug.cgi?id=189979
2578         https://trac.webkit.org/changeset/236551
2579
2580 2018-10-01  Keith Miller  <keith_miller@apple.com>
2581
2582         Create a RELEASE_AND_RETURN macro for ExceptionScopes
2583         https://bugs.webkit.org/show_bug.cgi?id=190163
2584
2585         Reviewed by Mark Lam.
2586
2587         The new RELEASE_AND_RETURN does all the work for cases
2588         where you want to return the result of some expression
2589         without explicitly checking for an exception. This is
2590         much like the existing RETURN_IF_EXCEPTION macro.
2591
2592         No new tests since this is a refactor.
2593
2594         * bridge/runtime_array.cpp:
2595         (JSC::RuntimeArray::put):
2596
2597 2018-10-01  Daniel Bates  <dabates@apple.com>
2598
2599         Attempt to fix the watchOS build after <https://trac.webkit.org/changeset/236678>
2600         (https://bugs.webkit.org/show_bug.cgi?id=189974)
2601
2602         Explicitly cast index to unsigned to make the operator[] call unambiguous.
2603
2604         * platform/ios/KeyEventIOS.mm:
2605         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
2606
2607 2018-10-01  Ryosuke Niwa  <rniwa@webkit.org>
2608
2609         ASAN failure in ~GCReachableRef()
2610         https://bugs.webkit.org/show_bug.cgi?id=190113
2611
2612         Reviewed by Darin Adler.
2613
2614         The bug was caused by ~GCReachableRef accessing Ref after it had been poisoned for ASAN
2615         in Ref::leakRef via Ref(Ref&& other). Fixed the bug by using RefPtr instead since that's
2616         the simplest solution here although we could unpoison Ref temporarily as done in ~Ref.
2617
2618         * dom/GCReachableRef.h:
2619         (WebCore::GCReachableRef::GCReachableRef):
2620         (WebCore::GCReachableRef::~GCReachableRef):
2621         (WebCore::GCReachableRef::operator-> const):
2622         (WebCore::GCReachableRef::get const):
2623         (WebCore::GCReachableRef::operator T& const):
2624         (WebCore::GCReachableRef::operator! const):
2625         (WebCore::GCReachableRef::isNull const): Deleted.
2626
2627 2018-10-01  Sihui Liu  <sihui_liu@apple.com>
2628
2629         Remove StorageProcess
2630         https://bugs.webkit.org/show_bug.cgi?id=189975
2631
2632         Reviewed by Geoffrey Garen.
2633
2634         Clean up code. No behavior change.
2635
2636         * English.lproj/Localizable.strings:
2637
2638 2018-10-01  Alicia Boya García  <aboya@igalia.com>
2639
2640         [MSE][GStreamer] Set a minimum sample duration
2641         https://bugs.webkit.org/show_bug.cgi?id=190125
2642
2643         Reviewed by Xabier Rodriguez-Calvar.
2644
2645         The last sample of the audio track in the asset used in this test
2646         player has a tiny duration (100 ns):
2647
2648         http://orange-opensource.github.io/hasplayer.js/1.2.0/player.html?url=http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest
2649
2650         So small, we were truncating it to zero. We're not supposed to have
2651         frames with zero duration. Instead, lets set a minimum frame duration
2652         for those fringe cases.
2653
2654         * platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
2655         (WebCore::MediaSampleGStreamer::MediaSampleGStreamer):
2656
2657 2018-10-01  Daniel Bates  <dabates@apple.com>
2658
2659         [iOS] Special keys are misidentified in DOM keyboard events
2660         https://bugs.webkit.org/show_bug.cgi?id=189974
2661
2662         Reviewed by Wenson Hsieh.
2663
2664         This patch fixes two issues:
2665             1. Special keyboard keys would be misidentified in dispatched DOM keyboard events.
2666             2. DOM keypress events may not be dispatched for some special keys.
2667
2668         UIKit uses special input strings to identify the Page Up, Page Down, Escape, Up Arrow, Down Arrow,
2669         Left Arrow, and Right Arrow keys. It also uses ASCII control characters to represent some other
2670         special keys, including Num Lock / Clear, Home, End, Forward Delete, and F1, ..., F24. We need
2671         to explicitly handle these special keyboard keys in order to be able to identify the key that
2672         was pressed as well as to correctly disambiguate a key down to know whether to dispatch a DOM
2673         keypress event for the key.
2674
2675         Unlike UIKit, AppKit reserves Unicode Private Use Area (PUA) code points in 0xF700–0xF8FF to
2676         represent special keyboard keys. This makes it straightforward to disambiguate such keys using
2677         the input string of the keyboard event alone. To simplify the implementation for iOS
2678         we normalize the input string be AppKit compatible. See the explaination for WebCore::windowsKeyCodeForCharCode()
2679         below for more details on why this is done.
2680
2681         Tests: fast/events/ios/keydown-keyup-arrow-keys-in-non-editable-element.html
2682                fast/events/ios/keypress-keys-in-non-editable-element.html
2683
2684         * SourcesCocoa.txt:
2685         * WebCore.xcodeproj/project.pbxproj:
2686         Do not use unified source build strategy when building WebEvent.mm as it makes
2687         use of SoftLinking macros that are incompatible with this strategy.
2688
2689         * platform/ios/KeyEventIOS.mm:
2690         (WebCore::windowsKeyCodeForCharCode): Recognize some special AppKit special char codes.
2691         These special char codes are generated by WebKit. WebKit uses the same special char codes
2692         as AppKit as a convenience instead of defining our own constants for the same purpose.
2693         Encoding the special UIKit input strings (e.g. up arrow) as distinct char codes allows us
2694         to use integer arithmetic and switch blocks to map characters to Windows virtual key
2695         codes as opposed to special cased branches to perform pointer or string comparisions.
2696         The latter would be necessary in Modern WebKit in order for key down events to be properly
2697         disambiguated to dispatch a DOM keypress event because pointers are not perserved, though
2698         what they point to is, when sending the WebEvent from UIProcess to the WebProcess and
2699         vice versa.
2700         (WebCore::isFunctionKey): Convenience function that determines whether the specified char
2701         code corresponds to a function key on the keyboard. The term "function key" is taken from
2702         AppKit parlance to describe a special keyboard key. These keys include F1, F2, ..., F24,
2703         and cursor keys among other special keyboard keys.
2704         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Write in terms of isFunctionKey().
2705         * platform/ios/PlatformEventFactoryIOS.h:
2706         * platform/ios/PlatformEventFactoryIOS.mm:
2707         (WebCore::keyIdentifierForKeyEvent): Remove code to handle UIKit special input strings as
2708         we now map such special input strings to char codes and hence can use the default code path.
2709         (WebCore::keyForKeyEvent): Ditto.
2710         (WebCore::codeForKeyEvent): Remove code to compute the Window virtual key code corresponding
2711         to a UIKit special key command now that we map such special input strings to char codes and
2712         subsequently map the char codes to the Windows virtual key code (see -[WebEvent initWithKeyEventType:...]
2713         constructors). So, we can now use WebEvent.keyCode directly to compute the DOM UIEvents code
2714         for the event.
2715         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): Remove code to fix up
2716         WebEvent.keyCode to account for UIKit special input strings now that we map such special key
2717         commands to char codes and subsequently map the char codes to the Windows virtual key code (see -[WebEvent initWithKeyEventType:...]
2718         constructors). So, we can now take WebEvent.keyCode verbatim to be the Window virtual key code.
2719         (WebCore::convertSpecialKeyToCharCode): Deleted.
2720         (WebCore::keyCodeForEvent): Deleted.
2721         * platform/ios/WebEvent.mm:
2722         (normalizedStringWithAppKitCompatibilityMapping): Added; converts a UIKit character string
2723         to the corresponding AppKit-compatible one (if not already compatible). See the explaination
2724         for WebCore::windowsKeyCodeForCharCode() above for more details on why this is done.
2725
2726         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
2727         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
2728         Normalize the character strings to be AppKit compatible.
2729
2730 2018-10-01  Simon Fraser  <simon.fraser@apple.com>
2731
2732         Optimize RenderStyle::diff() and clean up the code
2733         https://bugs.webkit.org/show_bug.cgi?id=190104
2734
2735         Reviewed by Dan Bernstein.
2736
2737         RenderStyle::changeRequiresLayout() and related should only check values on 
2738         m_rareNonInheritedData and m_rareInheritedData after checking for pointer equality.
2739         To reduce the chances of future changes regressing this, move code comparing values
2740         on StyleRare[Non]InheritedData into dedication functions.
2741         
2742         In addition, the transform comparison double-compared the transformOperations,
2743         because m_rareNonInheritedData->transform != other.m_rareNonInheritedData->transform
2744         is a deep comparison, and it was followed by *m_rareNonInheritedData->transform != *other.m_rareNonInheritedData->transform.
2745         Change the first to be a pointer comparison.
2746
2747         * rendering/style/RenderStyle.cpp:
2748         (WebCore::rareNonInheritedDataChangeRequiresLayout):
2749         (WebCore::rareInheritedDataChangeRequiresLayout):
2750         (WebCore::RenderStyle::changeRequiresLayout const):
2751         (WebCore::rareNonInheritedDataChangeRequiresLayerRepaint):
2752         (WebCore::RenderStyle::changeRequiresLayerRepaint const):
2753         (WebCore::rareNonInheritedDataChangeRequiresRepaint):
2754         (WebCore::rareInheritedDataChangeRequiresRepaint):
2755         (WebCore::RenderStyle::changeRequiresRepaint const):
2756
2757 2018-10-01  Alex Christensen  <achristensen@webkit.org>
2758
2759         URL should not use TextEncoding internally
2760         https://bugs.webkit.org/show_bug.cgi?id=190111
2761
2762         Reviewed by Andy Estes.
2763
2764         That dependency makes it impossible to move or use elsewhere.
2765         Using TextEncoding was overkill because we know the credentials are UTF-8 percent-encoded in a parsed URL.
2766         No change in behavior as verified by new API tests.
2767
2768         * page/SecurityOrigin.cpp:
2769         * page/csp/ContentSecurityPolicySourceList.cpp:
2770         * platform/URL.cpp:
2771         (WebCore::decodeEscapeSequencesFromParsedURL):
2772         (WebCore::URL::user const):
2773         (WebCore::URL::pass const):
2774         (WebCore::URL::fileSystemPath const):
2775         (WebCore::decodeURLEscapeSequences): Deleted.
2776         * platform/URL.h:
2777         * platform/network/DataURLDecoder.cpp:
2778         * platform/text/TextEncoding.cpp:
2779         (WebCore::decodeURLEscapeSequences):
2780         * platform/text/TextEncoding.h:
2781
2782 2018-10-01  Simon Pieters  <zcorpan@gmail.com>
2783
2784         <form> in quirks mode should have margin-block-end: 1em
2785         https://bugs.webkit.org/show_bug.cgi?id=157788
2786
2787         Reviewed by Simon Fraser.
2788
2789         Change the default style for forms to take writing-mode into account
2790         in quirks mode. Matches the behavior of Gecko and Edge and the HTML
2791         standard.
2792
2793         Spec: https://html.spec.whatwg.org/multipage/rendering.html#flow-content-3
2794
2795         Test: imported/w3c/web-platform-tests/html/rendering/non-replaced-elements/flow-content-0/form-margin-quirk.html
2796
2797         * css/quirks.css:
2798         (form):
2799
2800 2018-10-01  Jeremy Jones  <jeremyj@apple.com>
2801
2802         Unify implementation in VideoFullscreenInterfaceAVKit
2803         https://bugs.webkit.org/show_bug.cgi?id=190091
2804         rdar://problem/44734523
2805
2806         Reviewed by Jer Noble.
2807
2808         No new tests because no behavior change.
2809
2810         Unified code in VideoFullscreenInterfaceAVKit now that new code path is proven and include
2811         any changes that had been made in the old path.
2812
2813         * platform/ios/VideoFullscreenInterfaceAVKit.h:
2814         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2815         (-[WebAVPlayerViewControllerDelegate playerViewControllerShouldStartPictureInPictureFromInlineWhenEnteringBackground:]):
2816         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
2817         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
2818         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2819         (VideoFullscreenControllerContext::requestUpdateInlineRect):
2820         (VideoFullscreenControllerContext::requestVideoContentLayer):
2821         (VideoFullscreenControllerContext::returnVideoContentLayer):
2822         (VideoFullscreenControllerContext::didSetupFullscreen):
2823         (VideoFullscreenControllerContext::didExitFullscreen):
2824
2825 2018-10-01  Antoine Quint  <graouts@apple.com>
2826
2827         [Web Animations] Ensure renderers with accelerated animations have layers
2828         https://bugs.webkit.org/show_bug.cgi?id=189990
2829
2830         Reviewed by Simon Fraser.
2831
2832         In r236501 we added code that would make a RenderBox and a RenderInline query the document timeline for whether a given element has
2833         accelerated animations running on it. Since the calls to requiresLayer() are in a hot path, we instead keep a list of elements with
2834         exclusively accelerated animations running.
2835
2836         No new tests, this is already covered by webanimations/accelerated-animation-with-delay.html and webanimations/opacity-animation-yields-compositing-span.html
2837         which respectively check that we can apply an accelerated animation to a non-positioned block and an inline element.
2838
2839         * animation/AnimationTimeline.h:
2840         * animation/DocumentTimeline.cpp:
2841         (WebCore::DocumentTimeline::detachFromDocument):
2842         (WebCore::DocumentTimeline::animationWasAddedToElement):
2843         (WebCore::DocumentTimeline::animationWasRemovedFromElement):
2844         (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange):
2845         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): Iterate over an element's animations to determine
2846         whether all of its animations are running accelerated, then update the HashSet containing elements running accelerated animations to remove or
2847         add this element.
2848         (WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated const): Make a simple contains() call on the HashSet containing elements
2849         running accelerated animations.
2850         * animation/DocumentTimeline.h:
2851         * animation/KeyframeEffectReadOnly.cpp:
2852         (WebCore::KeyframeEffectReadOnly::updateAcceleratedAnimationState):
2853         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
2854         * rendering/RenderBoxModelObject.h:
2855
2856 2018-10-01  Alicia Boya García  <aboya@igalia.com>
2857
2858         [GStreamer] Fix abort in gst_sample_get_info()
2859         https://bugs.webkit.org/show_bug.cgi?id=190135
2860
2861         Reviewed by Philippe Normand.
2862
2863         A flush can occur before any frame has finished decoding -- especially
2864         in tests, where actions on the player often occur in quick succession.
2865
2866         Therefore, the code must not assume by the time a flush occurs any
2867         frame has reached the sink. This patch fixes a case when such wrong
2868         assumption was causing gst_sample_get_info() to abort (crashing
2869         WebKit).
2870
2871         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2872         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
2873         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink):
2874
2875 2018-10-01  Olivier Blin  <olivier.blin@softathome.com>
2876
2877         [WPE] fix buffer over-read in RenderThemeWPE::mediaControlsStyleSheet()
2878         https://bugs.webkit.org/show_bug.cgi?id=190139
2879
2880         Reviewed by Michael Catanzaro.
2881
2882         Like done upstream for EFL in r210213
2883         https://bugs.webkit.org/show_bug.cgi?id=166622
2884
2885         This has been detected by a charactersAreAllASCII() assert failure.
2886
2887         This is because ASCIILiteral() is wrongly used in mediaControlsStyleSheet().
2888         mediaControlsBaseUserAgentStyleSheet is a char array, not a null-terminated string.
2889         It is thus incorrect to use StringImpl::createFromLiteral() that calls
2890         strlen() to get the string length.
2891
2892         The String::ConstructFromLiteral constructor can not be used, since it
2893         skips the last character.
2894
2895         * platform/wpe/RenderThemeWPE.cpp:
2896         (WebCore::RenderThemeWPE::mediaControlsStyleSheet):
2897         Explicitely pass the size to the String constructor.
2898
2899 2018-10-01  Rob Buis  <rbuis@igalia.com>
2900
2901         Align XMLHttpRequest's overrideMimeType() with the standard
2902         https://bugs.webkit.org/show_bug.cgi?id=169276
2903
2904         Reviewed by Chris Dumez.
2905
2906         Implement the overrideMimeType() as specified in that standard, i.e.
2907         add a check that the passed mime type is valid and if not fallback
2908         to application/octet-stream.
2909
2910         In order for this patch to have any effect, I went ahead and
2911         made an improvement to the ContentType parsing, parseContentType now
2912         will reject mime types that do not match the type / subtype format, I
2913         believe this is required by both RFC2045 and mimesniff specs.
2914
2915         This behavior matches Chrome and Firefox.
2916
2917         Test: web-platform-tests/xhr/overridemimetype-invalid-mime-type.htm
2918
2919         * platform/network/ParsedContentType.cpp:
2920         (WebCore::parseContentType):
2921         * xml/XMLHttpRequest.cpp:
2922         (WebCore::XMLHttpRequest::overrideMimeType):
2923
2924
2925 2018-10-01  Chris Dumez  <cdumez@apple.com>
2926
2927         Make crossOriginObject.then undefined for promises
2928         https://bugs.webkit.org/show_bug.cgi?id=190094
2929
2930         Reviewed by Darin Adler.
2931
2932         Make crossOriginObject.then undefined for promises. This allows promises to work better with cross-origin WindowProxy
2933         and Location objects.
2934
2935         Specification:
2936         - https://github.com/whatwg/html/pull/3242
2937         - https://github.com/whatwg/dom/issues/536
2938
2939         This aligns our behavior with Blink and Gecko.
2940
2941         No new tests, rebaselined existing test.
2942
2943         * bindings/js/JSDOMWindowCustom.cpp:
2944         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
2945         (WebCore::addCrossOriginWindowOwnPropertyNames):
2946         * bindings/js/JSLocationCustom.cpp:
2947         (WebCore::getOwnPropertySlotCommon):
2948         (WebCore::addCrossOriginLocationOwnPropertyNames):
2949
2950 2018-10-01  Xan Lopez  <xan@igalia.com>
2951
2952         [SOUP] Fix the build for libsoup > 2.61.90
2953         https://bugs.webkit.org/show_bug.cgi?id=190126
2954
2955         Reviewed by Michael Catanzaro.
2956
2957         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
2958
2959 2018-10-01  Alicia Boya García  <aboya@igalia.com>
2960
2961         [MSE][GStreamer] Reset running time in PlaybackPipeline::flush()
2962         https://bugs.webkit.org/show_bug.cgi?id=190076
2963
2964         Reviewed by Philippe Normand.
2965
2966         Test: media/media-source/media-source-seek-redundant-append.html
2967
2968         PlaybackPipeline::flush() is called when already enqueued frames are
2969         appended again. This may be caused by a quality change or just a
2970         redundant append. Either way, the pipeline has to be flushed and
2971         playback begin again, but without changing the player position by
2972         much.
2973
2974         There are two kinds of time to consider here: stream time (i.e. the
2975         time of a frame as written in the file, e.g. a frame may have stream
2976         time 0:01:00), and running time (i.e. how much time since playback
2977         started should pass before the frame should be played, e.g. if we
2978         started playing at 0:00:59 that same frame would have a running time
2979         of just 1 second).
2980
2981         Notice how running time depends on where and when playback starts.
2982         Running time can also be optionally resetted after a flush. (This is
2983         indeed done currently by most demuxers after a seek.)
2984
2985         Instead of resetting running time, PlaybackPipeline used to modify the
2986         first GstSegment emitted after the flush. A GstSegment declares the
2987         mapping between stream time and running time for the following frames.
2988         There, PlaybackPipeline used to set `base` (the running time at which
2989         the segment starts) to the position reported by a position query
2990         (which is stream time).
2991
2992         This, of course, only worked when playback (or the last seek) started
2993         at stream time 0:00:00, since that's the only case where running time
2994         equals stream time. In other cases delays as long as the difference
2995         between these timelines would appear. This is demonstrated in the
2996         attached test, where seeks and appends are made in such an order that
2997         the difference is more than 5 minutes, making the playback stall for
2998         >5 minutes before playing 1 second of audio.
2999
3000         This patch fixes the problem by resetting running time with the flush
3001         and not modifying GstSegment.base anymore (it will be left as zero,
3002         which is now correct since the running time has been reset).
3003
3004         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
3005         (WebCore::PlaybackPipeline::flush):
3006         (WebCore::segmentFixerProbe): Deleted.
3007
3008 2018-09-30  Ryosuke Niwa  <rniwa@webkit.org>
3009
3010         Use Position instead of Range in createMarkupInternal
3011         https://bugs.webkit.org/show_bug.cgi?id=190107
3012
3013         Reviewed by Darin Adler.
3014
3015         Use two Position's indicating start and end instead of Range in createMarkupInternal and StylizedMarkupAccumulator
3016         in order to support copy & paste across shadow boundaries in the bug 157443. This patch also removes the use of
3017         Range in MarkupAccumulator since all uses of range is via StylizedMarkupAccumulator.
3018
3019         Also renamed createMarkupInternal to serializePreservingVisualAppearanceInternal to match the rename in r236612.
3020
3021         * dom/Position.cpp:
3022         (WebCore::Position::firstNode const):  Added.
3023         * dom/Position.h:
3024         * editing/MarkupAccumulator.cpp:
3025         (WebCore::MarkupAccumulator::MarkupAccumulator): No longer takes Range.
3026         (WebCore::MarkupAccumulator::appendText): Removed the code to truncate string at the boundary points of the range.
3027         * editing/MarkupAccumulator.h:
3028         (WebCore::MarkupAccumulator): Made this class non-copyable.
3029         * editing/markup.cpp:
3030         (WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator): Now takes and stores two positions.
3031
3032         (WebCore::StyledMarkupAccumulator::appendText): Use textContentRespectingRange in the case annotation is disabled
3033         instead of calling to MarkupAccumulator::appendText, which no longer respects boundary offsets.
3034
3035         (WebCore::StyledMarkupAccumulator::renderedTextRespectingRange): Renamed from renderedText. Updated to respect
3036         boundary offsets defined by m_start and m_end Positions instead of m_range Range.
3037
3038         (WebCore::StyledMarkupAccumulator::textContentRespectingRange): Renamed from stringValueForRange. Ditto.
3039
3040         (WebCore::StyledMarkupAccumulator::serializeNodes): Now computes startNode and pastEnd nodes from start and end
3041         Positions. Note that the end position is always the next node in the tree order  for a character node
3042         and computeNodeAfterPosition returns nullptr for a character data.
3043
3044         (WebCore::highestAncestorToWrapMarkup): Now takes two positions instead of a range.
3045
3046         (WebCore::serializePreservingVisualAppearanceInternal): Renamed from createMarkupInternal. Removed the obsolete
3047         comments which were added for DOMRange in WebKitLegacy.
3048
3049         (WebCore::serializePreservingVisualAppearance):
3050
3051         (WebCore::sanitizedMarkupForFragmentInDocument): Create positions instead of a range to pass to
3052         serializePreservingVisualAppearanceInternal.
3053
3054         (WebCore::serializeFragment):
3055
3056         * editing/markup.h:
3057         * page/PageSerializer.cpp:
3058         (WebCore::PageSerializer::SerializerMarkupAccumulator): Removed the unnecessary WebCore namespace qualifier.
3059
3060 2018-09-30  Walker Henderson  <wjahenderson@gmail.com>
3061
3062         AudioNode.connect should return passed destination node
3063         https://bugs.webkit.org/show_bug.cgi?id=188834
3064
3065         Reviewed by Eric Carlson.
3066
3067         No new tests, rebaselined existing test.
3068
3069         * Modules/webaudio/AudioBasicInspectorNode.cpp:
3070         (WebCore::AudioBasicInspectorNode::connect): Deleted.
3071         * Modules/webaudio/AudioBasicInspectorNode.h:
3072         * Modules/webaudio/AudioNode.cpp:
3073         * Modules/webaudio/AudioNode.h:
3074         * Modules/webaudio/AudioNode.idl:
3075
3076 2018-09-30  Eric Carlson  <eric.carlson@apple.com>
3077
3078         [MediaStream] Clean up RealtimeMediaSource settings change handling
3079         https://bugs.webkit.org/show_bug.cgi?id=189998
3080         <rdar://problem/44797884>
3081
3082         Reviewed by Youenn Fablet.
3083
3084         No new tests, updated webrtc/video-disabled-black.html.
3085
3086         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
3087         (WebCore::CanvasCaptureMediaStreamTrack::Source::Source):
3088         (WebCore::CanvasCaptureMediaStreamTrack::Source::settings):
3089         (WebCore::CanvasCaptureMediaStreamTrack::Source::settingsDidChange):
3090         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
3091         * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
3092         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
3093         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
3094         (WebCore::RealtimeIncomingVideoSource::settings):
3095         (WebCore::RealtimeIncomingVideoSource::settingsDidChange):
3096         * platform/mediastream/RealtimeIncomingVideoSource.h:
3097         * platform/mediastream/RealtimeMediaSource.cpp:
3098         (WebCore::RealtimeMediaSource::settingsDidChange):
3099         (WebCore::RealtimeMediaSource::notifySettingsDidChangeObservers):
3100         (WebCore::RealtimeMediaSource::setSize):
3101         (WebCore::RealtimeMediaSource::setFrameRate):
3102         (WebCore::RealtimeMediaSource::setAspectRatio):
3103         (WebCore::RealtimeMediaSource::setFacingMode):
3104         (WebCore::RealtimeMediaSource::setVolume):
3105         (WebCore::RealtimeMediaSource::setSampleRate):
3106         (WebCore::RealtimeMediaSource::setSampleSize):
3107         (WebCore::RealtimeMediaSource::setEchoCancellation):
3108         * platform/mediastream/RealtimeMediaSource.h:
3109         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
3110         (WebCore::GStreamerAudioCaptureSource::settingsDidChange):
3111         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
3112         (WebCore::GStreamerVideoCaptureSource::settingsDidChange):
3113         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3114         (WebCore::AVVideoCaptureSource::settingsDidChange):
3115         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3116         (WebCore::CoreAudioCaptureSource::settingsDidChange):
3117         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
3118         (WebCore::DisplayCaptureSourceCocoa::settingsDidChange):
3119         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
3120         (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
3121         * platform/mock/MockRealtimeAudioSource.cpp:
3122         (WebCore::MockRealtimeAudioSource::settingsDidChange):
3123         * platform/mock/MockRealtimeVideoSource.cpp:
3124         (WebCore::MockRealtimeVideoSource::settingsDidChange):
3125
3126 2018-09-30  Eric Carlson  <eric.carlson@apple.com>
3127
3128         [MediaStream] Use display-specific capture factories
3129         https://bugs.webkit.org/show_bug.cgi?id=190043
3130         <rdar://problem/44834412>
3131
3132         Reviewed by Youenn Fablet.
3133
3134         No new tests, no change in functionality.
3135
3136         * Sources.txt:
3137         * WebCore.xcodeproj/project.pbxproj:
3138         * platform/mediastream/RealtimeMediaSource.cpp:
3139         (WebCore::RealtimeMediaSource::AudioCaptureFactory::~AudioCaptureFactory): Deleted.
3140         (WebCore::RealtimeMediaSource::VideoCaptureFactory::~VideoCaptureFactory): Deleted.
3141         * platform/mediastream/RealtimeMediaSource.h:
3142         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
3143         (WebCore::RealtimeMediaSourceCenter::createMediaStream):
3144         (WebCore::RealtimeMediaSourceCenter::getDisplayMediaDevices):
3145         * platform/mediastream/RealtimeMediaSourceCenter.h:
3146         (WebCore::RealtimeMediaSourceCenter::setAudioFactory):
3147         (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
3148         * platform/mediastream/RealtimeMediaSourceFactory.cpp: Added.
3149         (WebCore::SingleSourceFactory::setActiveSource):
3150         (WebCore::SingleSourceFactory::unsetActiveSource):
3151         * platform/mediastream/RealtimeMediaSourceFactory.h: Added.
3152         (WebCore::SingleSourceFactory::activeSource):
3153         (WebCore::VideoCaptureFactory::setVideoCapturePageState):
3154         (WebCore::DisplayCaptureFactory::setDisplayCapturePageState):
3155         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
3156         (WebCore::libWebRTCVideoCaptureSourceFactory):
3157         (WebCore::libWebRTCDisplayCaptureSourceFactory):
3158         (WebCore::GStreamerVideoCaptureSource::factory):
3159         (WebCore::GStreamerVideoCaptureSource::displayFactory):
3160         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
3161         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
3162         (WebCore::RealtimeMediaSourceCenterLibWebRTC::audioCaptureSourceFactory):
3163         (WebCore::RealtimeMediaSourceCenterLibWebRTC::audioFactory):
3164         (WebCore::RealtimeMediaSourceCenterLibWebRTC::videoFactory):
3165         (WebCore::RealtimeMediaSourceCenterLibWebRTC::displayCaptureFactory):
3166         * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h:
3167         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3168         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
3169         (WebCore::AVVideoCaptureSource::setupCaptureSession):
3170         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3171         (WebCore::CoreAudioCaptureSource::factory):
3172         * platform/mediastream/mac/CoreAudioCaptureSource.h:
3173         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
3174         (WebCore::RealtimeMediaSourceCenterMac::videoCaptureSourceFactory):
3175         (WebCore::RealtimeMediaSourceCenterMac::displayCaptureSourceFactory):
3176         (WebCore::RealtimeMediaSourceCenterMac::audioCaptureSourceFactory):
3177         (WebCore::RealtimeMediaSourceCenterMac::audioFactory):
3178         (WebCore::RealtimeMediaSourceCenterMac::videoFactory):
3179         (WebCore::RealtimeMediaSourceCenterMac::displayCaptureFactory):
3180         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
3181         * platform/mock/MockRealtimeAudioSource.cpp:
3182         (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
3183         (WebCore::MockRealtimeAudioSource::startProducingData):
3184         (): Deleted.
3185         (WebCore::mockAudioCaptureSourceFactory): Deleted.
3186         (WebCore::MockRealtimeAudioSource::factory): Deleted.
3187         * platform/mock/MockRealtimeAudioSource.h:
3188         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
3189         (WebCore::MockRealtimeVideoSourceFactory::setVideoCapturePageState):
3190         (WebCore::MockRealtimeMediaSourceCenter::audioFactory):
3191         (WebCore::MockRealtimeMediaSourceCenter::videoFactory):
3192         (WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactory):
3193         * platform/mock/MockRealtimeMediaSourceCenter.h:
3194         * platform/mock/MockRealtimeVideoSource.cpp:
3195         (): Deleted.
3196         (WebCore::MockRealtimeVideoSourceFactory::setVideoCapturePageState): Deleted.
3197         (WebCore::mockVideoCaptureSourceFactory): Deleted.
3198         (WebCore::MockRealtimeVideoSource::factory): Deleted.
3199         * platform/mock/MockRealtimeVideoSource.h:
3200
3201 2018-09-29  Oriol Brufau  <obrufau@igalia.com>
3202
3203         [css-grid] Properly align items next to collapsed tracks with gutters
3204         https://bugs.webkit.org/show_bug.cgi?id=190089
3205
3206         Reviewed by Manuel Rego Casasnovas.
3207
3208         gridAreaPositionForInFlowChild could return a wrong end position for
3209         grid items adjacent to a collapsed track, because it didn't take into
3210         account that gutters collapse in that case. Therefore, "center" or
3211         "end" alignments displayed the item at the wrong position.
3212
3213         Test: imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-013.html
3214
3215         * rendering/RenderGrid.cpp:
3216         (WebCore::RenderGrid::gridAreaPositionForInFlowChild const):
3217
3218 2018-09-29  Alicia Boya García  <aboya@igalia.com>
3219
3220         [GStreamer][MSE] Use GObject for GST_TRACE_OBJECT
3221         https://bugs.webkit.org/show_bug.cgi?id=190045
3222
3223         Reviewed by Philippe Normand.
3224
3225         Passing a non-GObject object to GST_TRACE_OBJECT() can be
3226         theoretically misunderstood by the GStreamer logging function, so this
3227         patch avoids that.
3228
3229         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3230         (WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe):
3231         (WebCore::AppendPipeline::handleEndOfAppend):
3232         (WebCore::AppendPipeline::consumeAppsinkAvailableSamples):
3233         (WebCore::AppendPipeline::pushNewBuffer):
3234
3235 2018-09-28  Zamiul Haque  <zhaque@apple.com>
3236
3237         Angled gradient backgrounds in body render vertically when body height is 0
3238         https://bugs.webkit.org/show_bug.cgi?id=177232
3239         <rdar://problem/34548230>.
3240
3241         Reviewed by Tim Horton.
3242
3243         Specifically, gradients displayed at an angle (ie. 45 degrees) are rendered
3244         as if they are vertical when the body tag containing the gradient
3245         has a height of 0. Other browsers do not render under these circumstances,
3246         so WebKit was modified to follow in suit. The problem was due to layout sizes for
3247         fill tiles being calculated with a minimum height of 1px. A simple change of the
3248         minimum height and width to 0px was enough to bring about the desired behavior.
3249
3250         Tests: angled-background-repeating-gradient-rendering-vertical.html
3251
3252         * rendering/RenderBoxModelObject.cpp:
3253         (WebCore::RenderBoxModelObject::calculateFillTileSize const):
3254
3255 2018-09-28  Wenson Hsieh  <wenson_hsieh@apple.com>
3256
3257         No DOM API to instantiate an attachment for an img element
3258         https://bugs.webkit.org/show_bug.cgi?id=189934
3259         <rdar://problem/44743222>
3260
3261         Reviewed by Ryosuke Niwa.
3262
3263         Adds support for HTMLAttachmentElement.getAttachmentIdentifier, a function that internal WebKit clients can use
3264         to ensure that an image element is backed by a unique _WKAttachment. See below for more details.
3265
3266         Tests:  WKAttachmentTests.AddAttachmentToConnectedImageElement
3267                 WKAttachmentTests.ChangeFileWrapperForPastedImage
3268                 WKAttachmentTests.ConnectImageWithAttachmentToDocument
3269
3270         * dom/Document.cpp:
3271         (WebCore::Document::registerAttachmentIdentifier):
3272
3273         Add a new hook to register an empty _WKAttachment in the UI process with a given identifier. Used when creating
3274         a new empty attachment to back an image element.
3275
3276         * dom/Document.h:
3277         * editing/Editor.cpp:
3278         (WebCore::Editor::registerAttachmentIdentifier):
3279         (WebCore::Editor::notifyClientOfAttachmentUpdates):
3280         * editing/Editor.h:
3281         * html/HTMLAttachmentElement.cpp:
3282         (WebCore::HTMLAttachmentElement::getAttachmentIdentifier):
3283
3284         Creates an attachment element to back the image element, if an attachment does not already exist, and returns
3285         the unique identifier. This also causes an empty corresponding _WKAttachment to be created in the client, whose
3286         file wrapper determines the contents of the image.
3287
3288         (WebCore::HTMLAttachmentElement::ensureUniqueIdentifier):
3289         (WebCore::HTMLAttachmentElement::hasEnclosingImage const):
3290         (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
3291
3292         Add a helper that updates the source of the enclosing image element given a content type and image data, by
3293         creating a new blob and blob URL.
3294
3295         * html/HTMLAttachmentElement.h:
3296         * html/HTMLAttachmentElement.idl:
3297         * html/HTMLImageElement.idl:
3298
3299         Rename webkitAttachmentIdentifier to just attachmentIdentifier.
3300
3301         * page/EditorClient.h:
3302         (WebCore::EditorClient::registerAttachmentIdentifier):
3303         (WebCore::EditorClient::didInsertAttachmentWithIdentifier):
3304
3305 2018-09-28  Chris Dumez  <cdumez@apple.com>
3306
3307         The return value of an OnBeforeUnloadEventHandler should always be coerced into a DOMString
3308         https://bugs.webkit.org/show_bug.cgi?id=190090
3309
3310         Reviewed by Ryosuke Niwa.
3311
3312         The return value of an OnBeforeUnloadEventHandler should always be coerced into a DOMString:
3313         - https://html.spec.whatwg.org/#onbeforeunloadeventhandler
3314         - https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (Step 5)
3315
3316         In particular, this means that returning false in an OnBeforeUnloadEventHandler should NOT
3317         cancel the event when the event is a CustomEvent (and not a BeforeUnloadEvent). This is
3318         because the return value cannot be false at:
3319         - https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (Step 5. Otherwise case).
3320
3321         No new tests, rebaselined existing test.
3322
3323         * bindings/js/JSEventListener.cpp:
3324         (WebCore::JSEventListener::handleEvent):
3325
3326 2018-09-28  Simon Fraser  <simon.fraser@apple.com>
3327
3328         RenderLayer::removeOnlyThisLayer() should not call updateLayerPositions()
3329         https://bugs.webkit.org/show_bug.cgi?id=190093
3330
3331         Reviewed by Dean Jackson and Zalan Bujtas.
3332         
3333         It's wrong for RenderLayer::removeOnlyThisLayer() to call updateLayerPositions(),
3334         because this is called at style update time, and layout will be stale.
3335         
3336         It was added (see webkit.org/b/25252) so that opacity changes, which can destroy layers, correctly update
3337         descendants. However, RenderStyle::changeRequiresLayout() checks for opacity <=> no opacity
3338         changes and triggers layout accordingly, which will result in a full post-layout
3339         updateLayerPositions().
3340         
3341         This also revealed that changes to the "isolate" property fail to trigger any kind of style recalc or layout;
3342         we need it to trigger layout (for now) because it affects z-order.
3343
3344         Covered by existing tests.
3345
3346         * rendering/RenderLayer.cpp:
3347         (WebCore::RenderLayer::removeOnlyThisLayer):
3348         * rendering/style/RenderStyle.cpp:
3349         (WebCore::RenderStyle::changeRequiresLayout const):
3350
3351 2018-09-28  Jiewen Tan  <jiewen_tan@apple.com>
3352
3353         [WebAuthN] Polish WebAuthN auto-test environment
3354         https://bugs.webkit.org/show_bug.cgi?id=189283
3355         <rdar://problem/44117828>
3356
3357         Reviewed by Chris Dumez.
3358
3359         This patch removes the old mocking mechanism.
3360
3361         Tests: http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https.html
3362                http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https.html
3363                http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https.html
3364
3365         * DerivedSources.make:
3366         * WebCore.xcodeproj/project.pbxproj:
3367         * testing/Internals.cpp:
3368         (WebCore::Internals::Internals):
3369         (WebCore::Internals::mockAuthenticatorCoordinator const): Deleted.
3370         * testing/Internals.h:
3371         * testing/Internals.idl:
3372         * testing/MockAuthenticatorCoordinator.cpp: Removed.
3373         * testing/MockAuthenticatorCoordinator.h: Removed.
3374         * testing/MockAuthenticatorCoordinator.idl: Removed.
3375
3376 2018-09-28  Jer Noble  <jer.noble@apple.com>
3377
3378         Refactoring: eliminate raw pointer usage in Fullscreen code
3379         https://bugs.webkit.org/show_bug.cgi?id=188747
3380         <rdar://problem/43541164>
3381
3382         Reviewed by Alex Christensen.
3383
3384         Two sources of raw pointers in the Fullscreen code:
3385         - Model classes (PlaybackSessionModel and VideoFullscreenModel) aren't ref-able, so
3386           they are passed around as raw references.
3387         - Observer classes (PlaybackSessionModelClient and VideoFullscreenModelClient, and
3388           VideoFullscreenChangeObserver) are also passed around as raw pointers, but shouldn't
3389           be ref-able.
3390
3391         Make Model classes ref-able by adding ref() and deref() which call virtual refModel and
3392         derefModel methods, overridden by implementing subclasses. Make every concrete observer
3393         inherit from CanMakeWeakPtr, and every registration method take WeakPtr wrappers around
3394         the client interface.
3395
3396         Since every Interface class now holds a strong reference to its Model classes, and each
3397         Model class holds a weak reference to all its clients, no explicit invalidate() method
3398         is necessary.
3399
3400         Notes:
3401