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