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