Web Inspector: Search: allow DOM searches to be case sensitive
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-03-20  Devin Rousso  <drousso@apple.com>
2
3         Web Inspector: Search: allow DOM searches to be case sensitive
4         https://bugs.webkit.org/show_bug.cgi?id=194673
5         <rdar://problem/48087577>
6
7         Reviewed by Timothy Hatcher.
8
9         Tests: inspector/dom/dom-search.html
10                inspector/dom/dom-search-caseSensitive.html
11
12         Since `DOM.performSearch` also searches by selector and XPath, some results may appear
13         as unexpected. As an example, searching for "BoDy" will still return the <body> as a result,
14         as although the literal node name ("BODY") didn't match, it did match via selector/XPath.
15
16         * inspector/agents/InspectorDOMAgent.h:
17         * inspector/agents/InspectorDOMAgent.cpp:
18         (WebCore::InspectorDOMAgent::performSearch):
19
20         * inspector/InspectorNodeFinder.h:
21         * inspector/InspectorNodeFinder.cpp:
22         (WebCore::InspectorNodeFinder::InspectorNodeFinder):
23         (WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
24         (WebCore::InspectorNodeFinder::checkEquals): Added.
25         (WebCore::InspectorNodeFinder::checkContains): Added.
26         (WebCore::InspectorNodeFinder::checkStartsWith): Added.
27         (WebCore::InspectorNodeFinder::checkEndsWith): Added.
28         (WebCore::InspectorNodeFinder::matchesAttribute):
29         (WebCore::InspectorNodeFinder::matchesElement):
30         (WebCore::InspectorNodeFinder::searchUsingXPath):
31         (WebCore::InspectorNodeFinder::searchUsingCSSSelectors):
32
33 2019-03-20  Michael Catanzaro  <mcatanzaro@igalia.com>
34
35         Remove copyRef() calls added in r243163
36         https://bugs.webkit.org/show_bug.cgi?id=195962
37
38         Reviewed by Chris Dumez.
39
40         The first two cases here can just directly return the RefPtr.
41
42         In the third case, we have to work around a GCC 6 bug because GCC 6 is unable to pick the
43         right constructor to use, unlike modern compilers.
44
45         * Modules/fetch/FetchBody.cpp:
46         (WebCore::FetchBody::bodyAsFormData const):
47         (WebCore::FetchBody::take):
48
49 2019-03-20  Alicia Boya García  <aboya@igalia.com>
50
51         [MSE][GStreamer] Fix handling of resolution changes in AppendPipeline
52         https://bugs.webkit.org/show_bug.cgi?id=195855
53
54         Reviewed by Xabier Rodriguez-Calvar.
55
56         MediaSample instances produced by the AppendPipeline were not
57         accounting for resolution changes. The causes of this are twofold:
58
59         1) m_presentationSize is set by connectDemuxerSrcPadToAppsink() (by
60         calling parseDemuxerSrcPadCaps()), but not by appsinkCapsChanged().
61
62         2) appsinkCapsChanged() was being called in the main thread as an
63         asynchronous task. In consequence, even if m_presentationSize is set
64         there, many samples with the new resolution would still be wrapped in
65         a MediaSampleGStreamer using the old resolution by the main thread
66         running consumeAppsinkAvailableSamples() before appsinkCapsChanged()
67         is dispatched.
68
69         This patch fixes these problems by updating m_presentationSize in
70         appsinkCapsChanged() and making the streaming thread block until the
71         main thread has dispatched appsinkCapsChanged(). This way the handling
72         of caps changes is serialized with the handling of frames.
73
74         Test: media/media-source/media-source-samples-resolution-change.html
75
76         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
77         (WebCore::AppendPipeline::AppendPipeline):
78         (WebCore::AppendPipeline::appsinkCapsChanged):
79
80 2019-03-20  Joanmarie Diggs  <jdiggs@igalia.com>
81
82         AX: Implement support for new meter ARIA role
83         https://bugs.webkit.org/show_bug.cgi?id=195966
84
85         Reviewed by Chris Fleizach.
86
87         Add the new ARIA role to the internal rolemap so that it is treated
88         in the same fashion as its HTML element counterpart.
89
90         No new tests. Instead add the role to the existing role-exposure tests.
91
92         * accessibility/AccessibilityObject.cpp:
93         (WebCore::AccessibilityObject::isMeter const):
94         (WebCore::initializeRoleMap):
95         (WebCore::AccessibilityObject::computedRoleString const):
96         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
97         (atkRole):
98
99 2019-03-20  Philippe Normand  <pnormand@igalia.com>
100
101         [GStreamer] Switch back to webkitwebsrc for adaptive streaming fragments downloading
102         https://bugs.webkit.org/show_bug.cgi?id=195948
103
104         Reviewed by Xabier Rodriguez-Calvar.
105
106         The webkitwebsrc element now behaves much better when used through
107         GStreamer's adaptivedemux, so use it for all WebKit media
108         downloads. The MediaPlayer needed by the webkitwebsrc element now
109         travels through GstContext messages and queries so that it can be
110         shared by multiple elements, typically the first webkitwebsrc
111         element downloads the HLS manifest and then adaptivedemux, through
112         uridownloader, will create new webkitwebsrc elements for fragments
113         downloading. Those new elements will query the first webkitwebsrc
114         element for its context.
115
116         The previous hack used to check SecurityOrigins can
117         also be cleaned-up. The origins are now cached upon reception of
118         the HTTP headers message from webkitwebsrc.
119
120         No new tests, existing http/tests/media/hls tests cover this change.
121
122         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
123         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
124         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
125         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
126         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
127         (WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const):
128         (WebCore::convertToInternalProtocol): Deleted.
129         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
130         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
131         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
132         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
133         (webkit_web_src_class_init):
134         (webKitWebSrcSetContext):
135         (webKitWebSrcStart):
136         (webKitWebSrcGetProtocols):
137         (webKitWebSrcSetUri):
138         (CachedResourceStreamingClient::responseReceived):
139         (convertPlaybinURI): Deleted.
140         (webKitSrcWouldTaintOrigin): Deleted.
141         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
142
143 2019-03-20  Thibault Saunier  <tsaunier@igalia.com>
144
145         [GStreamer][WebRTC]: Refactor to make the encoding happen synchronously
146         https://bugs.webkit.org/show_bug.cgi?id=195674
147
148         This simplifies the code and make sure that everything is called from the right
149         thread. It also makes it so we follow the same way of doing things as other libwebrtc
150         encoders.
151
152         Also "s/codecSpecifiInfos/codecSpecificInfos/"
153
154         Reviewed by Philippe Normand.
155
156         No new test as this is just a refactoring
157
158         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
159         (WebCore::GStreamerVideoEncoder::InitEncode):
160         (WebCore::GStreamerVideoEncoder::returnFromFlowReturn):
161
162 2019-03-20  Tim Horton  <timothy_horton@apple.com>
163
164         Add an platform-driven spell-checking mechanism
165         https://bugs.webkit.org/show_bug.cgi?id=195795
166
167         Reviewed by Ryosuke Niwa.
168
169         * dom/Document.cpp:
170         (WebCore::Document::textInserted):
171         PlatformTextChecking markers are not expected
172         to propagate to newly inserted text, so remove them.
173
174         * dom/DocumentMarker.h:
175         (WebCore::DocumentMarker::allMarkers):
176         Add a new type of DocumentMarker, PlatformTextChecking,
177         and a new data variant that stores a key value pair of strings.
178
179         * dom/DocumentMarkerController.cpp:
180         (WebCore::DocumentMarkerController::addPlatformTextCheckingMarker):
181         (WebCore::DocumentMarkerController::removeMarkers):
182         (WebCore::DocumentMarkerController::filterMarkers):
183         (WebCore::shouldInsertAsSeparateMarker):
184         * dom/DocumentMarkerController.h:
185         Export some things.
186         Add addPlatformTextCheckingMarker, like the others.
187         Make it possible to filter out markers of a particular type
188         in a range with a predicate function.
189
190         * editing/CompositeEditCommand.cpp:
191         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
192         Propagate PlatformTextChecking data.
193         A future change should probably make it possible for
194         any DocumentMarker to copy its data here, instead of
195         special-casing each type that is important.
196
197         * editing/Editor.cpp:
198         (WebCore::Editor::markMisspellingsAfterTypingToWord):
199         (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
200         (WebCore::Editor::markMisspellingsAndBadGrammar):
201         * editing/TextCheckingHelper.cpp:
202         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
203         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const):
204         (WebCore::platformDrivenTextCheckerEnabled):
205         * editing/TextCheckingHelper.h:
206         Bail from traditional spell checking if this mechanism is
207         enabled. (I wrote it this way to make it runtime switchable
208         in the near future, and to be similar to unifiedTextCheckerEnabled).
209
210 2019-03-19  Jiewen Tan  <jiewen_tan@apple.com>
211
212         [WebAuthN] Implement FIDO AppID extension
213         https://bugs.webkit.org/show_bug.cgi?id=143491
214         <rdar://problem/48298273>
215
216         Reviewed by Brent Fulgham.
217
218         This patch adds support for FIDO AppID extension: https://www.w3.org/TR/webauthn/#sctn-appid-extension.
219         To be noticed, this implementation follows what spec suggested in the 'Note' session and what Chrome/Firefox
220         do in practice to avoid some unnecessary steps of
221         https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-appid-and-facets-v2.0-id-20180227.html#determining-if-a-caller-s-facetid-is-authorized-for-an-appid.
222
223         In fido::convertToU2fSignCommand, the checkOnly flag is deleted as it is never used.
224
225         Covered by new tests in existing files.
226
227         * CMakeLists.txt:
228         * DerivedSources-input.xcfilelist:
229         * DerivedSources-output.xcfilelist:
230         * DerivedSources.make:
231         * Modules/webauthn/AuthenticationExtensionsClientInputs.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
232         (WebCore::AuthenticationExtensionsClientInputs::encode const):
233         (WebCore::AuthenticationExtensionsClientInputs::decode):
234         * Modules/webauthn/AuthenticationExtensionsClientInputs.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.idl.
235         * Modules/webauthn/AuthenticatorCoordinator.cpp:
236         (WebCore::AuthenticatorCoordinatorInternal::processAppIdExtension):
237         (WebCore::AuthenticatorCoordinator::create const):
238         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
239         * Modules/webauthn/PublicKeyCredential.cpp:
240         (WebCore::PublicKeyCredential::tryCreate):
241         (WebCore::PublicKeyCredential::PublicKeyCredential):
242         (WebCore::PublicKeyCredential::getClientExtensionResults const):
243         (WebCore::PublicKeyCredential::create): Deleted.
244         * Modules/webauthn/PublicKeyCredential.h:
245         * Modules/webauthn/PublicKeyCredential.idl:
246         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
247         * Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
248         * Modules/webauthn/PublicKeyCredentialData.h:
249         (WebCore::PublicKeyCredentialData::encode const):
250         (WebCore::PublicKeyCredentialData::decode):
251         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
252         (WebCore::PublicKeyCredentialRequestOptions::encode const):
253         (WebCore::PublicKeyCredentialRequestOptions::decode):
254         * Modules/webauthn/PublicKeyCredentialRequestOptions.idl:
255         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
256         (fido::readCTAPMakeCredentialResponse):
257         (fido::readCTAPGetAssertionResponse):
258         * Modules/webauthn/fido/U2fCommandConstructor.cpp:
259         (fido::convertToU2fSignCommand):
260         * Modules/webauthn/fido/U2fCommandConstructor.h:
261         * Modules/webauthn/fido/U2fResponseConverter.cpp:
262         (fido::readU2fRegisterResponse):
263         (fido::readU2fSignResponse):
264         * Sources.txt:
265         * WebCore.xcodeproj/project.pbxproj:
266
267 2019-03-19  Devin Rousso  <drousso@apple.com>
268
269         Web Inspector: Debugger: lazily create the agent
270         https://bugs.webkit.org/show_bug.cgi?id=195973
271         <rdar://problem/49039674>
272
273         Reviewed by Joseph Pecoraro.
274
275         No change in functionality.
276
277         * inspector/WorkerInspectorController.cpp:
278         (WebCore::WorkerInspectorController::WorkerInspectorController):
279         (WebCore::WorkerInspectorController::createLazyAgents):
280
281         * inspector/agents/WebDebuggerAgent.cpp:
282         (WebCore::WebDebuggerAgent::disable):
283
284         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
285         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
286         (WebCore::InspectorDOMDebuggerAgent::discardAgent):
287
288 2019-03-18  Maciej Stachowiak  <mjs@apple.com>
289
290         Simplify Cocoa platform user agent logic by using string constants instead of function calls for the frozen parts
291         https://bugs.webkit.org/show_bug.cgi?id=195936
292
293         Reviewed by Dean Jackson.
294
295         No new tests because no behavior changes. Existing behavior is tested by fast/dom/navigator-userAgent-frozen.html
296
297         * platform/UserAgent.h: Remove prototype of removed function.
298         * platform/cocoa/UserAgentCocoa.mm:
299         (WebCore::userAgentBundleVersion): Deleted.
300         * platform/ios/UserAgentIOS.mm:
301         * platform/ios/UserAgentIOS.mm:
302         (WebCore::osNameForUserAgent): Use WTF String instead of NSString
303         (WebCore::deviceNameForUserAgent): dutto
304         (WebCore::standardUserAgentWithApplicationName): Simplify this
305         function to account for WebKit version now being frozen. Also
306         use String instead of NSString.
307         * platform/mac/UserAgentMac.mm:
308         (WebCore::standardUserAgentWithApplicationName): Simplify this
309         function to account for CPU and WEbKit version now being
310         frozen. Also avoid two separate but very similar calls to
311         makeString().
312
313 2019-03-19  Ross Kirsling  <ross.kirsling@sony.com>
314
315         Unreviewed adjustment to r242842 per Darin's request.
316
317         * platform/win/LoggingWin.cpp:
318         (WebCore::logLevelString):
319
320 2019-03-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
321
322         Remove the SVG property tear off objects of SVGAnimatedPreserveAspectRatio
323         https://bugs.webkit.org/show_bug.cgi?id=195960
324
325         Reviewed by Simon Fraser.
326
327         -- Define SVGAnimatedPreserveAspectRatio to be SVGAnimatedValueProperty<
328            SVGPreserveAspectRatio>.
329
330         -- Make SVGPreserveAspectRatio be derived form SVGValueProperty<
331            SVGPreserveAspectRatioValue>.
332
333         -- Add SVGAnimatedPreserveAspectRatioAccessor to access the animated 
334            property.
335
336         -- Add SVGAnimatedPreserveAspectRatioAnimator to animate the animated
337            property of the target element and all its instances.
338
339         -- Add SVGAnimationPreserveAspectRatioFunction to progress animVal of
340            animated property in a period of time.
341
342         SVGFilterPrimitiveStandardAttributes::build() should be const function.
343         This is required for this patch because SVGFEImageElement::build() calls
344         SVGFEImageElement::preserveAspectRatio() which is const.
345
346         * Sources.txt:
347         * WebCore.xcodeproj/project.pbxproj:
348         * svg/SVGAnimatedPreserveAspectRatio.cpp: Removed.
349         * svg/SVGAnimatedPreserveAspectRatio.h: Removed.
350         * svg/SVGAnimatorFactory.h:
351         (WebCore::SVGAnimatorFactory::create):
352         * svg/SVGFEBlendElement.cpp:
353         (WebCore::SVGFEBlendElement::build const):
354         (WebCore::SVGFEBlendElement::build): Deleted.
355         * svg/SVGFEBlendElement.h:
356         * svg/SVGFEColorMatrixElement.cpp:
357         (WebCore::SVGFEColorMatrixElement::build const):
358         (WebCore::SVGFEColorMatrixElement::build): Deleted.
359         * svg/SVGFEColorMatrixElement.h:
360         * svg/SVGFEComponentTransferElement.cpp:
361         (WebCore::SVGFEComponentTransferElement::build const):
362         (WebCore::SVGFEComponentTransferElement::build): Deleted.
363         * svg/SVGFEComponentTransferElement.h:
364         * svg/SVGFECompositeElement.cpp:
365         (WebCore::SVGFECompositeElement::build const):
366         (WebCore::SVGFECompositeElement::build): Deleted.
367         * svg/SVGFECompositeElement.h:
368         * svg/SVGFEConvolveMatrixElement.cpp:
369         (WebCore::SVGFEConvolveMatrixElement::build const):
370         (WebCore::SVGFEConvolveMatrixElement::build): Deleted.
371         * svg/SVGFEConvolveMatrixElement.h:
372         * svg/SVGFEDiffuseLightingElement.cpp:
373         (WebCore::SVGFEDiffuseLightingElement::build const):
374         (WebCore::SVGFEDiffuseLightingElement::build): Deleted.
375         * svg/SVGFEDiffuseLightingElement.h:
376         * svg/SVGFEDisplacementMapElement.cpp:
377         (WebCore::SVGFEDisplacementMapElement::build const):
378         (WebCore::SVGFEDisplacementMapElement::build): Deleted.
379         * svg/SVGFEDisplacementMapElement.h:
380         * svg/SVGFEDropShadowElement.cpp:
381         (WebCore::SVGFEDropShadowElement::build const):
382         (WebCore::SVGFEDropShadowElement::build): Deleted.
383         * svg/SVGFEDropShadowElement.h:
384         * svg/SVGFEFloodElement.cpp:
385         (WebCore::SVGFEFloodElement::build const):
386         (WebCore::SVGFEFloodElement::build): Deleted.
387         * svg/SVGFEFloodElement.h:
388         * svg/SVGFEGaussianBlurElement.cpp:
389         (WebCore::SVGFEGaussianBlurElement::build const):
390         (WebCore::SVGFEGaussianBlurElement::build): Deleted.
391         * svg/SVGFEGaussianBlurElement.h:
392         * svg/SVGFEImageElement.cpp:
393         (WebCore::SVGFEImageElement::SVGFEImageElement):
394         (WebCore::SVGFEImageElement::parseAttribute):
395         (WebCore::SVGFEImageElement::build const):
396         (WebCore::SVGFEImageElement::registerAttributes): Deleted.
397         (WebCore::SVGFEImageElement::build): Deleted.
398         * svg/SVGFEImageElement.h:
399         * svg/SVGFEMergeElement.cpp:
400         (WebCore::SVGFEMergeElement::build const):
401         (WebCore::SVGFEMergeElement::build): Deleted.
402         * svg/SVGFEMergeElement.h:
403         * svg/SVGFEMorphologyElement.cpp:
404         (WebCore::SVGFEMorphologyElement::build const):
405         (WebCore::SVGFEMorphologyElement::build): Deleted.
406         * svg/SVGFEMorphologyElement.h:
407         * svg/SVGFEOffsetElement.cpp:
408         (WebCore::SVGFEOffsetElement::build const):
409         (WebCore::SVGFEOffsetElement::build): Deleted.
410         * svg/SVGFEOffsetElement.h:
411         * svg/SVGFESpecularLightingElement.cpp:
412         (WebCore::SVGFESpecularLightingElement::build const):
413         (WebCore::SVGFESpecularLightingElement::build): Deleted.
414         * svg/SVGFESpecularLightingElement.h:
415         * svg/SVGFETileElement.cpp:
416         (WebCore::SVGFETileElement::build const):
417         (WebCore::SVGFETileElement::build): Deleted.
418         * svg/SVGFETileElement.h:
419         * svg/SVGFETurbulenceElement.cpp:
420         (WebCore::SVGFETurbulenceElement::build const):
421         (WebCore::SVGFETurbulenceElement::build): Deleted.
422         * svg/SVGFETurbulenceElement.h:
423         * svg/SVGFilterPrimitiveStandardAttributes.h:
424         * svg/SVGFitToViewBox.cpp:
425         (WebCore::SVGFitToViewBox::SVGFitToViewBox):
426         (WebCore::SVGFitToViewBox::parseViewBox):
427         (WebCore::SVGFitToViewBox::registerAttributes): Deleted.
428         * svg/SVGFitToViewBox.h:
429         (WebCore::SVGFitToViewBox::preserveAspectRatio const):
430         (WebCore::SVGFitToViewBox::preserveAspectRatioAnimated):
431         (WebCore::SVGFitToViewBox::setPreserveAspectRatio):
432         (WebCore::SVGFitToViewBox::resetPreserveAspectRatio):
433         (WebCore::SVGFitToViewBox::preserveAspectRatioString const):
434         * svg/SVGImageElement.cpp:
435         (WebCore::SVGImageElement::SVGImageElement):
436         (WebCore::SVGImageElement::registerAttributes):
437         (WebCore::SVGImageElement::parseAttribute):
438         * svg/SVGImageElement.h:
439         * svg/SVGMarkerElement.h:
440         * svg/SVGPatternElement.h:
441         * svg/SVGPreserveAspectRatio.h:
442         (WebCore::SVGPreserveAspectRatio::create):
443         (WebCore::SVGPreserveAspectRatio::align const):
444         (WebCore::SVGPreserveAspectRatio::setAlign):
445         (WebCore::SVGPreserveAspectRatio::meetOrSlice const):
446         (WebCore::SVGPreserveAspectRatio::setMeetOrSlice):
447         (WebCore::SVGPreserveAspectRatio::align): Deleted.
448         (WebCore::SVGPreserveAspectRatio::meetOrSlice): Deleted.
449         (WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio): Deleted.
450         * svg/SVGSVGElement.h:
451         * svg/SVGStringList.h:
452         * svg/SVGSymbolElement.h:
453         * svg/SVGViewSpec.h:
454         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
455         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
456         * svg/properties/SVGAnimatedPropertyImpl.h:
457         * svg/properties/SVGAnimationDiscreteFunctionImpl.h:
458         * svg/properties/SVGAttributeRegistry.h:
459         * svg/properties/SVGPropertyOwnerRegistry.h:
460         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
461
462 2019-03-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
463
464         Remove the SVG property tear off objects of SVGAnimatedRect
465         https://bugs.webkit.org/show_bug.cgi?id=195949
466
467         Reviewed by Simon Fraser.
468
469         SVGRect is an SVG type, so we need to introduce two classes to represent
470         it and its animated property SVGAnimatedRect.
471
472         -- SVGValueProperty: It is derived from SVGProperty and it will be the 
473            base class of all the SVG type based properties. It is basically a
474            RefCounted object with m_value member. For SVGRect, m_value will be
475            of type FloatRect.
476
477         -- SVGAnimatedValueProperty: It is derived from SVGAnimatedProperty and
478            it will be the base class of all the animated SVG type based properties.
479            It is RefCounted object with two RefCounted members: baseVal and animVal.
480            These two members are of type SVGValueProperty. For SVGAnimatedRect,
481            baseVal and animVal will be of type SVGRect.
482
483         SVGAnimatedValueProperty will be responsible for:
484
485         1) Providing access to its baseVal and animVal. Note the same interface
486            is used internally and used by the DOM.
487
488         2) Managing the animation of the property by starting and stopping it.
489
490         3) Coordinating the changes in its baseVal and animVal with the owner
491            element.
492
493         * Sources.txt:
494         * WebCore.xcodeproj/project.pbxproj:
495         * svg/SVGAnimatedRect.cpp: Removed.
496         * svg/SVGAnimatedRect.h: Removed.
497         * svg/SVGAnimatorFactory.h:
498         (WebCore::SVGAnimatorFactory::create):
499         * svg/SVGAttributeAnimationController.cpp:
500         (WebCore::SVGAttributeAnimationController::calculateAnimatedValue):
501         This is a bug from r243036. The <set> can be the tag of m_animationElement
502         not m_targetElement.
503         * svg/SVGAttributeAnimationController.h:
504         * svg/SVGAttributeAnimationControllerBase.h:
505         * svg/SVGFitToViewBox.cpp:
506         (WebCore::SVGFitToViewBox::SVGFitToViewBox):
507         (WebCore::SVGFitToViewBox::registerAttributes):
508         (WebCore::SVGFitToViewBox::setViewBox):
509         (WebCore::SVGFitToViewBox::resetViewBox):
510         * svg/SVGFitToViewBox.h:
511         (WebCore::SVGFitToViewBox::viewBox const):
512         (WebCore::SVGFitToViewBox::viewBoxAnimated):
513         (WebCore::SVGFitToViewBox::viewBoxString const):
514         * svg/SVGMarkerElement.h:
515         * svg/SVGPatternElement.h:
516         * svg/SVGRect.h:
517         (WebCore::SVGRect::create):
518         (WebCore::SVGRect::x):
519         (WebCore::SVGRect::setX):
520         (WebCore::SVGRect::y):
521         (WebCore::SVGRect::setY):
522         (WebCore::SVGRect::width):
523         (WebCore::SVGRect::setWidth):
524         (WebCore::SVGRect::height):
525         (WebCore::SVGRect::setHeight):
526         (WebCore::SVGRect::SVGRect): Deleted.
527         * svg/SVGSVGElement.cpp:
528         (WebCore::checkIntersectionWithoutUpdatingLayout):
529         (WebCore::checkEnclosureWithoutUpdatingLayout):
530         * svg/SVGSVGElement.h:
531         * svg/SVGSymbolElement.h:
532         * svg/SVGViewSpec.cpp:
533         (WebCore::SVGViewSpec::SVGViewSpec):
534         * svg/SVGViewSpec.h:
535         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
536         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
537         * svg/properties/SVGAnimatedPropertyImpl.h:
538         * svg/properties/SVGAnimatedValueProperty.h: Added.
539         (WebCore::SVGAnimatedValueProperty::create):
540         (WebCore::SVGAnimatedValueProperty::~SVGAnimatedValueProperty):
541         (WebCore::SVGAnimatedValueProperty::setBaseValInternal):
542         (WebCore::SVGAnimatedValueProperty::baseVal const):
543         (WebCore::SVGAnimatedValueProperty::baseVal):
544         (WebCore::SVGAnimatedValueProperty::setAnimVal):
545         (WebCore::SVGAnimatedValueProperty::animVal const):
546         (WebCore::SVGAnimatedValueProperty::animVal):
547         (WebCore::SVGAnimatedValueProperty::currentValue const):
548         (WebCore::SVGAnimatedValueProperty::SVGAnimatedValueProperty):
549         (WebCore::SVGAnimatedValueProperty::ensureAnimVal):
550         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
551         (WebCore::SVGAnimationRectFunction::progress):
552         * svg/properties/SVGAttributeRegistry.h:
553         * svg/properties/SVGPropertyOwnerRegistry.h:
554         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
555         * svg/properties/SVGValueProperty.h: Added.
556         (WebCore::SVGValueProperty::create):
557         (WebCore::SVGValueProperty::value const):
558         (WebCore::SVGValueProperty::setValue):
559         (WebCore::SVGValueProperty::value):
560         (WebCore::SVGValueProperty::SVGValueProperty):
561
562 2019-03-19  John Wilander  <wilander@apple.com>
563
564         Resource Load Statistics (experimental): Clear non-cookie website data for sites that have been navigated to, with link decoration, by a prevalent resource
565         https://bugs.webkit.org/show_bug.cgi?id=195923
566         <rdar://problem/49001272>
567
568         Reviewed by Alex Christensen.
569
570         Adds a new experimental feature.
571
572         Test: http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html
573
574         * page/RuntimeEnabledFeatures.h:
575         (WebCore::RuntimeEnabledFeatures::setIsITPFirstPartyWebsiteDataRemovalEnabled):
576         (WebCore::RuntimeEnabledFeatures::isITPFirstPartyWebsiteDataRemovalEnabled const):
577
578 2019-03-19  Ryosuke Niwa  <rniwa@webkit.org>
579
580         Reparenting during a mutation event inside appendChild could result in a circular DOM tree
581         https://bugs.webkit.org/show_bug.cgi?id=192825
582
583         Reviewed by Zalan Bujtas.
584
585         The bug was caused by appendChildWithoutPreInsertionValidityCheck, insertBefore and replaceChild
586         checking the circular dependency against newChild instead of targets even though when newChild
587         is a document fragment, appendChildWithoutPreInsertionValidityCheck inserts the children of
588         the document fragment. Fixed the bug by checking the circular dependency against each target child.
589
590         Also fixed the bug that checkAcceptChildGuaranteedNodeTypes was not considering shadow inclusive
591         ancestors or template host elements.
592
593         Tests: fast/dom/append-child-with-mutation-event-removal-and-circular-insertion.html
594                fast/dom/append-child-with-mutation-event-removal-and-circular-shadow-insertion.html
595                fast/dom/append-child-with-mutation-event-removal-and-circular-template-insertion.html
596                fast/dom/insert-child-with-mutation-event-removal-and-circular-insertion.html
597                fast/dom/insert-child-with-mutation-event-removal-and-circular-shadow-insertion.html
598                fast/dom/insert-child-with-mutation-event-removal-and-circular-template-insertion.html
599                fast/dom/replace-child-with-mutation-event-removal-and-circular-insertion.html
600                fast/dom/replace-child-with-mutation-event-removal-and-circular-shadow-insertion.html
601                fast/dom/replace-child-with-mutation-event-removal-and-circular-template-insertion.html
602
603         * dom/ContainerNode.cpp:
604         (WebCore::checkAcceptChildGuaranteedNodeTypes):
605         (WebCore::ContainerNode::insertBefore):
606         (WebCore::ContainerNode::replaceChild):
607         (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck):
608
609 2019-03-19  Brent Fulgham  <bfulgham@apple.com>
610
611         Add default prompt implementation for the Storage Access API
612         https://bugs.webkit.org/show_bug.cgi?id=195866
613         <rdar://problem/45150009>
614
615         Reviewed by Chris Dumez.
616
617         * en.lproj/Localizable.strings: Update with new strings used by the
618         Storage Access API dialog.
619
620 2019-03-19  Thibault Saunier  <tsaunier@igalia.com>
621
622         [GStreamer][WebRTC] Create sps/pps for all frames to please libwebrtc
623         https://bugs.webkit.org/show_bug.cgi?id=195677
624
625         Reviewed by Xabier Rodriguez-Calvar.
626
627         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
628         (gst_webrtc_video_encoder_set_format):
629         (register_known_encoder):
630         (setup_x264enc):
631         (setup_openh264enc):
632         (setup_omxh264enc):
633         (set_bitrate_bit_per_sec):
634         (gst_webrtc_video_encoder_class_init):
635
636 2019-03-19  Timothy Hatcher  <timothy@apple.com>
637
638         REGRESSION (r239904): Update dark mode defines in a few places that got missed.
639         https://bugs.webkit.org/show_bug.cgi?id=195958
640
641         Reviewed by Megan Gardner.
642
643         * DerivedSources.make: Support HAVE_OS_DARK_MODE_SUPPORT in html.css.
644         * css/html.css: Update dark mode defines.
645         * page/FrameView.cpp:
646         (WebCore::FrameView::updateBackgroundRecursively): Ditto.
647
648 2019-03-19  Chris Dumez  <cdumez@apple.com>
649
650         media/track/track-in-band-style.html is flaky
651         https://bugs.webkit.org/show_bug.cgi?id=195922
652
653         Reviewed by Eric Carlson.
654
655         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
656         (WebCore::InbandTextTrackPrivateAVF::processCueAttributes):
657         Small optimization: some of the if checks were missing their "continue;"
658         statement. This would cause us to keep checking following keys even though
659         we already got a match.
660
661 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
662
663         Build cleanly with GCC 9
664         https://bugs.webkit.org/show_bug.cgi?id=195920
665
666         Reviewed by Chris Dumez.
667
668         WebKit triggers three new GCC 9 warnings:
669
670         """
671         -Wdeprecated-copy, implied by -Wextra, warns about the C++11 deprecation of implicitly
672         declared copy constructor and assignment operator if one of them is user-provided.
673         """
674
675         Solution is to either add a copy constructor or copy assignment operator, if required, or
676         else remove one if it is redundant.
677
678         """
679         -Wredundant-move, implied by -Wextra, warns about redundant calls to std::move.
680         -Wpessimizing-move, implied by -Wall, warns when a call to std::move prevents copy elision.
681         """
682
683         These account for most of this patch. Solution is to just remove the bad WTFMove().
684
685         Additionally, -Wclass-memaccess has been enhanced to catch a few cases that GCC 8 didn't.
686         These are solved by casting nontrivial types to void* before using memcpy. (Of course, it
687         would be safer to not use memcpy on nontrivial types, but that's too complex for this
688         patch. Searching for memcpy used with static_cast<void*> will reveal other cases to fix.)
689
690         * Modules/encryptedmedia/CDM.cpp:
691         (WebCore::CDM::getSupportedConfiguration):
692         * Modules/encryptedmedia/MediaKeys.cpp:
693         (WebCore::MediaKeys::createSession):
694         * Modules/entriesapi/DOMFileSystem.cpp:
695         (WebCore::listDirectoryWithMetadata):
696         (WebCore::toFileSystemEntries):
697         * Modules/fetch/FetchBody.cpp:
698         (WebCore::FetchBody::fromFormData):
699         (WebCore::FetchBody::bodyAsFormData const):
700         (WebCore::FetchBody::take):
701         * Modules/fetch/FetchRequest.cpp:
702         (WebCore::FetchRequest::create):
703         (WebCore::FetchRequest::clone):
704         * Modules/fetch/FetchResponse.cpp:
705         (WebCore::FetchResponse::create):
706         (WebCore::FetchResponse::redirect):
707         (WebCore::FetchResponse::clone):
708         * Modules/indexeddb/IDBCursor.cpp:
709         (WebCore::IDBCursor::update):
710         (WebCore::IDBCursor::deleteFunction):
711         * Modules/indexeddb/IDBDatabase.cpp:
712         (WebCore::IDBDatabase::transaction):
713         * Modules/indexeddb/IDBDatabaseIdentifier.h:
714         (WebCore::IDBDatabaseIdentifier::decode):
715         * Modules/indexeddb/IDBKeyData.h:
716         (WebCore::IDBKeyData::decode):
717         * Modules/indexeddb/IDBObjectStore.cpp:
718         (WebCore::IDBObjectStore::createIndex):
719         (WebCore::IDBObjectStore::index):
720         * Modules/indexeddb/IDBValue.h:
721         (WebCore::IDBValue::decode):
722         * Modules/indexeddb/shared/IDBError.cpp:
723         (WebCore::IDBError::operator=): Deleted.
724         * Modules/indexeddb/shared/IDBError.h:
725         * Modules/indexeddb/shared/IDBResultData.h:
726         (WebCore::IDBResultData::decode):
727         * Modules/mediarecorder/MediaRecorder.cpp:
728         (WebCore::MediaRecorder::create):
729         * Modules/mediasource/MediaSource.cpp:
730         (WebCore::MediaSource::addSourceBuffer):
731         * Modules/mediastream/RTCPeerConnection.cpp:
732         (WebCore::iceServersFromConfiguration):
733         (WebCore::RTCPeerConnection::certificatesFromConfiguration):
734         (WebCore::certificateTypeFromAlgorithmIdentifier):
735         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
736         (WebCore::LibWebRTCMediaEndpoint::getStats):
737         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
738         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
739         (WebCore::LibWebRTCPeerConnectionBackend::addUnifiedPlanTransceiver):
740         * Modules/webaudio/AudioBuffer.cpp:
741         (WebCore::AudioBuffer::create):
742         * Modules/webaudio/AudioContext.cpp:
743         (WebCore::AudioContext::createMediaElementSource):
744         (WebCore::AudioContext::createMediaStreamSource):
745         (WebCore::AudioContext::createScriptProcessor):
746         * Modules/webaudio/OfflineAudioContext.cpp:
747         (WebCore::OfflineAudioContext::create):
748         * Modules/webdatabase/DatabaseManager.cpp:
749         (WebCore::DatabaseManager::tryToOpenDatabaseBackend):
750         * Modules/webdatabase/DatabaseTracker.cpp:
751         (WebCore::DatabaseTracker::canEstablishDatabase):
752         (WebCore::DatabaseTracker::retryCanEstablishDatabase):
753         * Modules/webdatabase/SQLResultSetRowList.cpp:
754         (WebCore::SQLResultSetRowList::item const):
755         * Modules/websockets/WebSocket.cpp:
756         (WebCore::WebSocket::create):
757         * accessibility/AXObjectCache.cpp:
758         (WebCore::AXObjectCache::rangeForNodeContents):
759         (WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets):
760         * animation/KeyframeEffect.cpp:
761         (WebCore::KeyframeEffect::create):
762         (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const):
763         * bindings/js/JSCustomElementInterface.cpp:
764         (WebCore::JSCustomElementInterface::constructElementWithFallback):
765         * bindings/js/JSDOMConvertVariadic.h:
766         (WebCore::VariadicConverter::convert):
767         (WebCore::convertVariadicArguments):
768         * bindings/js/SerializedScriptValue.cpp:
769         (WebCore::CloneDeserializer::readDOMPointInit):
770         (WebCore::transferArrayBuffers):
771         * bindings/scripts/CodeGeneratorJS.pm:
772         (GenerateCallbackImplementationContent):
773         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
774         (WebCore::JSTestCallbackFunction::handleEvent):
775         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
776         (WebCore::JSTestCallbackFunctionRethrow::handleEvent):
777         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
778         (WebCore::JSTestCallbackInterface::callbackWithAReturnValue):
779         (WebCore::JSTestCallbackInterface::callbackThatRethrowsExceptions):
780         (WebCore::JSTestCallbackInterface::callbackThatSkipsInvokeCheck):
781         (WebCore::JSTestCallbackInterface::callbackWithThisObject):
782         * contentextensions/ContentExtensionParser.cpp:
783         (WebCore::ContentExtensions::getStringList):
784         (WebCore::ContentExtensions::loadTrigger):
785         (WebCore::ContentExtensions::loadEncodedRules):
786         (WebCore::ContentExtensions::parseRuleList):
787         * crypto/SubtleCrypto.cpp:
788         (WebCore::normalizeCryptoAlgorithmParameters):
789         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
790         (WebCore::calculateSignature):
791         * crypto/keys/CryptoKeyEC.cpp:
792         (WebCore::CryptoKeyEC::exportJwk const):
793         * css/CSSComputedStyleDeclaration.cpp:
794         (WebCore::computedTransform):
795         (WebCore::ComputedStyleExtractor::valueForShadow):
796         (WebCore::ComputedStyleExtractor::valueForFilter):
797         (WebCore::specifiedValueForGridTrackSize):
798         (WebCore::valueForGridTrackList):
799         (WebCore::valueForGridPosition):
800         (WebCore::willChangePropertyValue):
801         (WebCore::fontVariantLigaturesPropertyValue):
802         (WebCore::fontVariantNumericPropertyValue):
803         (WebCore::fontVariantEastAsianPropertyValue):
804         (WebCore::touchActionFlagsToCSSValue):
805         (WebCore::renderTextDecorationFlagsToCSSValue):
806         (WebCore::renderEmphasisPositionFlagsToCSSValue):
807         (WebCore::speakAsToCSSValue):
808         (WebCore::hangingPunctuationToCSSValue):
809         (WebCore::fillRepeatToCSSValue):
810         (WebCore::fillSizeToCSSValue):
811         (WebCore::counterToCSSValue):
812         (WebCore::fontVariantFromStyle):
813         (WebCore::fontSynthesisFromStyle):
814         (WebCore::shapePropertyValue):
815         (WebCore::paintOrder):
816         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
817         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
818         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
819         * css/CSSFontFaceSet.cpp:
820         (WebCore::CSSFontFaceSet::matchingFacesExcludingPreinstalledFonts):
821         * css/CSSGradientValue.cpp:
822         (WebCore::CSSGradientValue::image):
823         * css/CSSStyleSheet.cpp:
824         (WebCore::CSSStyleSheet::rules):
825         * css/DOMMatrixReadOnly.cpp:
826         (WebCore::DOMMatrixReadOnly::parseStringIntoAbstractMatrix):
827         * css/FontFace.cpp:
828         (WebCore::FontFace::create):
829         * css/FontVariantBuilder.cpp:
830         (WebCore::computeFontVariant):
831         * css/PropertySetCSSStyleDeclaration.cpp:
832         (WebCore::PropertySetCSSStyleDeclaration::removeProperty):
833         * css/SVGCSSComputedStyleDeclaration.cpp:
834         (WebCore::strokeDashArrayToCSSValueList):
835         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
836         * css/StyleBuilderConverter.h:
837         (WebCore::StyleBuilderConverter::convertReflection):
838         * css/WebKitCSSMatrix.cpp:
839         (WebCore::WebKitCSSMatrix::create):
840         (WebCore::WebKitCSSMatrix::multiply const):
841         * css/parser/CSSPropertyParser.cpp:
842         (WebCore::consumeFontVariationSettings):
843         (WebCore::consumeBasicShapePath):
844         (WebCore::consumeImplicitGridAutoFlow):
845         * cssjit/StackAllocator.h:
846         * dom/DOMImplementation.cpp:
847         (WebCore::DOMImplementation::createDocument):
848         * dom/Document.cpp:
849         (WebCore::Document::cloneNodeInternal):
850         * dom/DocumentFragment.cpp:
851         (WebCore::DocumentFragment::cloneNodeInternal):
852         * dom/Element.cpp:
853         (WebCore::Element::setAttributeNode):
854         (WebCore::Element::setAttributeNodeNS):
855         (WebCore::Element::removeAttributeNode):
856         (WebCore::Element::parseAttributeName):
857         (WebCore::Element::animate):
858         * dom/MessagePort.cpp:
859         (WebCore::MessagePort::disentanglePorts):
860         * dom/NodeIterator.cpp:
861         (WebCore::NodeIterator::nextNode):
862         (WebCore::NodeIterator::previousNode):
863         * dom/Range.cpp:
864         (WebCore::Range::processContents):
865         (WebCore::processContentsBetweenOffsets):
866         (WebCore::processAncestorsAndTheirSiblings):
867         * dom/RangeBoundaryPoint.h:
868         * dom/ScriptDisallowedScope.h:
869         (WebCore::ScriptDisallowedScope::operator=):
870         * dom/Text.cpp:
871         (WebCore::Text::splitText):
872         * dom/TextDecoder.cpp:
873         (WebCore::TextDecoder::create):
874         (WebCore::TextDecoder::decode):
875         * editing/CompositeEditCommand.cpp:
876         (WebCore::CompositeEditCommand::insertBlockPlaceholder):
877         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
878         * editing/Editing.cpp:
879         (WebCore::createTabSpanElement):
880         * editing/EditingStyle.cpp:
881         (WebCore::EditingStyle::styleAtSelectionStart):
882         * editing/TextIterator.cpp:
883         (WebCore::TextIterator::rangeFromLocationAndLength):
884         * editing/VisibleSelection.cpp:
885         (WebCore::makeSearchRange):
886         * editing/markup.cpp:
887         (WebCore::styleFromMatchedRulesAndInlineDecl):
888         (WebCore::createFragmentForInnerOuterHTML):
889         (WebCore::createContextualFragment):
890         * html/FormController.cpp:
891         (WebCore::deserializeFormControlState):
892         * html/HTMLCanvasElement.cpp:
893         (WebCore::HTMLCanvasElement::captureStream):
894         * html/HTMLMediaElement.cpp:
895         (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
896         * html/HTMLOptionElement.cpp:
897         (WebCore::HTMLOptionElement::createForJSConstructor):
898         * html/HTMLPlugInImageElement.cpp:
899         (WebCore::HTMLPlugInImageElement::createElementRenderer):
900         * html/HTMLTableElement.cpp:
901         (WebCore::HTMLTableElement::createSharedCellStyle):
902         * html/HTMLTableRowElement.cpp:
903         (WebCore::HTMLTableRowElement::insertCell):
904         * html/ImageData.cpp:
905         (WebCore::ImageData::create):
906         * html/OffscreenCanvas.cpp:
907         (WebCore::OffscreenCanvas::transferToImageBitmap):
908         * html/canvas/CanvasRenderingContext2DBase.cpp:
909         (WebCore::CanvasRenderingContext2DBase::createLinearGradient):
910         (WebCore::CanvasRenderingContext2DBase::createRadialGradient):
911         * html/canvas/OESVertexArrayObject.cpp:
912         (WebCore::OESVertexArrayObject::createVertexArrayOES):
913         * html/canvas/WebGLRenderingContextBase.cpp:
914         (WebCore::WebGLRenderingContextBase::createBuffer):
915         (WebCore::WebGLRenderingContextBase::createFramebuffer):
916         (WebCore::WebGLRenderingContextBase::createTexture):
917         (WebCore::WebGLRenderingContextBase::createProgram):
918         (WebCore::WebGLRenderingContextBase::createRenderbuffer):
919         (WebCore::WebGLRenderingContextBase::createShader):
920         (WebCore::WebGLRenderingContextBase::getContextAttributes):
921         (WebCore::WebGLRenderingContextBase::getUniform):
922         * html/shadow/TextControlInnerElements.cpp:
923         (WebCore::TextControlInnerContainer::resolveCustomStyle):
924         (WebCore::TextControlPlaceholderElement::resolveCustomStyle):
925         * html/track/BufferedLineReader.cpp:
926         (WebCore::BufferedLineReader::nextLine):
927         * html/track/VTTCue.cpp:
928         (WebCore::VTTCue::getCueAsHTML):
929         (WebCore::VTTCue::createCueRenderingTree):
930         * html/track/WebVTTElement.cpp:
931         (WebCore::WebVTTElement::cloneElementWithoutAttributesAndChildren):
932         * inspector/InspectorStyleSheet.cpp:
933         (WebCore::asCSSRuleList):
934         (WebCore::InspectorStyle::buildObjectForStyle const):
935         (WebCore::InspectorStyleSheet::buildObjectForStyleSheet):
936         (WebCore::InspectorStyleSheet::buildObjectForRule):
937         * inspector/agents/InspectorCSSAgent.cpp:
938         (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
939         * inspector/agents/InspectorDOMAgent.cpp:
940         (WebCore::InspectorDOMAgent::buildArrayForPseudoElements):
941         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
942         * inspector/agents/InspectorNetworkAgent.cpp:
943         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
944         * loader/FetchOptions.h:
945         (WebCore::FetchOptions::decode):
946         * loader/MediaResourceLoader.cpp:
947         (WebCore::MediaResourceLoader::requestResource):
948         * loader/appcache/ApplicationCacheStorage.cpp:
949         (WebCore::ApplicationCacheStorage::loadCache):
950         (WebCore::ApplicationCacheStorage::manifestURLs):
951         * loader/archive/mhtml/MHTMLParser.cpp:
952         (WebCore::MHTMLParser::parseArchiveWithHeader):
953         * loader/cache/CachedResourceLoader.cpp:
954         (WebCore::CachedResourceLoader::requestResource):
955         * page/DOMWindow.cpp:
956         (WebCore::DOMWindow::getMatchedCSSRules const):
957         * page/DragController.cpp:
958         (WebCore::documentFragmentFromDragData):
959         * page/EventSource.cpp:
960         (WebCore::EventSource::create):
961         * page/PerformanceUserTiming.cpp:
962         (WebCore::UserTiming::mark):
963         (WebCore::UserTiming::measure):
964         * page/SecurityOrigin.h:
965         (WebCore::SecurityOrigin::decode):
966         * page/scrolling/ScrollingConstraints.h:
967         (WebCore::FixedPositionViewportConstraints::FixedPositionViewportConstraints):
968         (WebCore::LayoutConstraints::LayoutConstraints): Deleted.
969         * platform/Length.h:
970         (WebCore::Length::Length):
971         * platform/animation/TimingFunction.cpp:
972         (WebCore::TimingFunction::createFromCSSText):
973         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
974         (WebCore::parseLicenseFormat):
975         * platform/graphics/FloatPoint3D.h:
976         * platform/graphics/Font.cpp:
977         (WebCore::createAndFillGlyphPage):
978         * platform/graphics/GLContext.cpp:
979         (WebCore::GLContext::createContextForWindow):
980         (WebCore::GLContext::createSharingContext):
981         * platform/graphics/GraphicsContext.cpp:
982         * platform/graphics/HEVCUtilities.cpp:
983         (WebCore::parseHEVCCodecParameters):
984         * platform/graphics/gtk/ImageGtk.cpp:
985         (WebCore::loadImageFromGResource):
986         (WebCore::loadMissingImageIconFromTheme):
987         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
988         (WebCore::PlatformDisplayWayland::create):
989         * platform/mediastream/MediaConstraints.h:
990         (WebCore::MediaTrackConstraintSetMap::decode):
991         * platform/mediastream/MediaStreamRequest.h:
992         (WebCore::MediaStreamRequest::decode):
993         * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp:
994         (WebCore::GStreamerSampleFromLibWebRTCVideoFrame):
995         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
996         (WebCore::RealtimeIncomingAudioSource::create):
997         * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp:
998         (WebCore::RealtimeIncomingVideoSource::create):
999         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1000         (WebCore::MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID):
1001         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
1002         (WebCore::MockMediaSample::createNonDisplayingCopy const):
1003         * platform/network/BlobRegistryImpl.cpp:
1004         (WebCore::BlobRegistryImpl::createResourceHandle):
1005         * platform/network/CookieRequestHeaderFieldProxy.h:
1006         (WebCore::CookieRequestHeaderFieldProxy::decode):
1007         * platform/network/FormData.h:
1008         (WebCore::FormData::decode):
1009         * platform/network/MIMEHeader.cpp:
1010         (WebCore::MIMEHeader::parseHeader):
1011         * platform/network/ResourceHandle.cpp:
1012         (WebCore::ResourceHandle::create):
1013         * platform/network/soup/DNSResolveQueueSoup.cpp:
1014         (WebCore::DNSResolveQueueSoup::takeCompletionAndCancelHandlers):
1015         * rendering/RenderElement.cpp:
1016         (WebCore::RenderElement::createFor):
1017         * rendering/shapes/Shape.cpp:
1018         (WebCore::Shape::createRasterShape):
1019         (WebCore::Shape::createBoxShape):
1020         * rendering/style/BasicShapes.cpp:
1021         (WebCore::BasicShapeCircle::blend const):
1022         (WebCore::BasicShapeEllipse::blend const):
1023         (WebCore::BasicShapePolygon::blend const):
1024         (WebCore::BasicShapePath::blend const):
1025         (WebCore::BasicShapeInset::blend const):
1026         * rendering/style/BasicShapes.h:
1027         (WebCore::BasicShapeRadius::BasicShapeRadius):
1028         * rendering/style/ContentData.cpp:
1029         (WebCore::ImageContentData::createContentRenderer const):
1030         (WebCore::TextContentData::createContentRenderer const):
1031         (WebCore::QuoteContentData::createContentRenderer const):
1032         * rendering/style/ContentData.h:
1033         * rendering/svg/RenderSVGInline.cpp:
1034         (WebCore::RenderSVGInline::createInlineFlowBox):
1035         * rendering/svg/RenderSVGInlineText.cpp:
1036         (WebCore::RenderSVGInlineText::createTextBox):
1037         * rendering/svg/RenderSVGText.cpp:
1038         (WebCore::RenderSVGText::createRootInlineBox):
1039         * svg/SVGFEBlendElement.cpp:
1040         (WebCore::SVGFEBlendElement::build):
1041         * svg/SVGFEColorMatrixElement.cpp:
1042         (WebCore::SVGFEColorMatrixElement::build):
1043         * svg/SVGFEComponentTransferElement.cpp:
1044         (WebCore::SVGFEComponentTransferElement::build):
1045         * svg/SVGFECompositeElement.cpp:
1046         (WebCore::SVGFECompositeElement::build):
1047         * svg/SVGFEConvolveMatrixElement.cpp:
1048         (WebCore::SVGFEConvolveMatrixElement::build):
1049         * svg/SVGFEDiffuseLightingElement.cpp:
1050         (WebCore::SVGFEDiffuseLightingElement::build):
1051         * svg/SVGFEDisplacementMapElement.cpp:
1052         (WebCore::SVGFEDisplacementMapElement::build):
1053         * svg/SVGFEDropShadowElement.cpp:
1054         (WebCore::SVGFEDropShadowElement::build):
1055         * svg/SVGFEGaussianBlurElement.cpp:
1056         (WebCore::SVGFEGaussianBlurElement::build):
1057         * svg/SVGFEMergeElement.cpp:
1058         (WebCore::SVGFEMergeElement::build):
1059         * svg/SVGFEMorphologyElement.cpp:
1060         (WebCore::SVGFEMorphologyElement::build):
1061         * svg/SVGFEOffsetElement.cpp:
1062         (WebCore::SVGFEOffsetElement::build):
1063         * svg/SVGFESpecularLightingElement.cpp:
1064         (WebCore::SVGFESpecularLightingElement::build):
1065         * svg/SVGFETileElement.cpp:
1066         (WebCore::SVGFETileElement::build):
1067         * svg/SVGTransformList.h:
1068         * svg/properties/SVGList.h:
1069         (WebCore::SVGList::initialize):
1070         (WebCore::SVGList::insertItemBefore):
1071         (WebCore::SVGList::replaceItem):
1072         (WebCore::SVGList::removeItem):
1073         (WebCore::SVGList::appendItem):
1074         * svg/properties/SVGListProperty.h:
1075         (WebCore::SVGListProperty::initializeValuesAndWrappers):
1076         (WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
1077         (WebCore::SVGListProperty::replaceItemValuesAndWrappers):
1078         (WebCore::SVGListProperty::removeItemValues):
1079         (WebCore::SVGListProperty::appendItemValuesAndWrappers):
1080         * svg/properties/SVGPrimitiveList.h:
1081         * testing/Internals.cpp:
1082         (WebCore::Internals::elementRenderTreeAsText):
1083         (WebCore::parseFindOptions):
1084         * workers/AbstractWorker.cpp:
1085         (WebCore::AbstractWorker::resolveURL):
1086         * workers/Worker.cpp:
1087         (WebCore::Worker::create):
1088         * workers/service/ServiceWorkerJobData.h:
1089         (WebCore::ServiceWorkerJobData::decode):
1090         * xml/DOMParser.cpp:
1091         (WebCore::DOMParser::parseFromString):
1092         * xml/XPathExpression.cpp:
1093         (WebCore::XPathExpression::evaluate):
1094
1095 2019-03-19  Devin Rousso  <drousso@apple.com>
1096
1097         Web Inspector: Provide $event in the console when paused on an event listener
1098         https://bugs.webkit.org/show_bug.cgi?id=188672
1099
1100         Reviewed by Timothy Hatcher.
1101
1102         Implement similiar methods/logic as to the way that `$exception` is set.
1103
1104         * inspector/CommandLineAPIModuleSource.js:
1105         (CommandLineAPI):
1106
1107         * inspector/InspectorInstrumentation.h:
1108         (WebCore::InspectorInstrumentation::willHandleEvent):
1109         * inspector/InspectorInstrumentation.cpp:
1110         (WebCore::InspectorInstrumentation::willHandleEventImpl):
1111         (WebCore::InspectorInstrumentation::didHandleEventImpl):
1112
1113         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
1114         * inspector/agents/InspectorDOMDebuggerAgent.h:
1115         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
1116         (WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
1117         (WebCore::InspectorDOMDebuggerAgent::didHandleEvent): Added.
1118
1119 2019-03-19  Devin Rousso  <drousso@apple.com>
1120
1121         Web Inspector: ScriptProfiler: lazily create the agent
1122         https://bugs.webkit.org/show_bug.cgi?id=195591
1123         <rdar://problem/48791756>
1124
1125         Reviewed by Joseph Pecoraro.
1126
1127         No change in functionality.
1128
1129         * inspector/InspectorController.cpp:
1130         (WebCore::InspectorController::InspectorController):
1131         (WebCore::InspectorController::createLazyAgents):
1132
1133 2019-03-19  Devin Rousso  <drousso@apple.com>
1134
1135         Web Inspector: DOMStorage: lazily create the agent
1136         https://bugs.webkit.org/show_bug.cgi?id=195588
1137         <rdar://problem/48791878>
1138
1139         Reviewed by Joseph Pecoraro.
1140
1141         No change in functionality.
1142
1143         Make functions used by `CommandLineAPIHost` static so that an `InspectorDOMStorageAgent`
1144         doesn't need to be created to call them.
1145
1146         * inspector/agents/InspectorDOMStorageAgent.h:
1147         * inspector/agents/InspectorDOMStorageAgent.cpp:
1148         (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
1149         (WebCore::InspectorDOMStorageAgent::enable):
1150         (WebCore::InspectorDOMStorageAgent::disable):
1151         (WebCore::InspectorDOMStorageAgent::storageId):
1152         (WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
1153         (WebCore::InspectorDOMStorageAgent::findStorageArea):
1154         (WebCore::InspectorDOMStorageAgent::~InspectorDOMStorageAgent): Deleted.
1155
1156         * inspector/CommandLineAPIHost.h:
1157         (WebCore::CommandLineAPIHost::init):
1158         * inspector/CommandLineAPIHost.cpp:
1159         (WebCore::CommandLineAPIHost::disconnect):
1160         (WebCore::CommandLineAPIHost::storageId):
1161
1162         * inspector/InspectorController.cpp:
1163         (WebCore::InspectorController::InspectorController):
1164         (WebCore::InspectorController::createLazyAgents):
1165         * inspector/WorkerInspectorController.cpp:
1166         (WebCore::WorkerInspectorController::WorkerInspectorController):
1167
1168 2019-03-19  Youenn Fablet  <youenn@apple.com>
1169
1170         REGRESSION: Layout Test http/tests/security/cross-origin-indexeddb.html is crashing
1171         https://bugs.webkit.org/show_bug.cgi?id=195779
1172
1173         Reviewed by Chris Dumez.
1174
1175         When requesting space, we might delay execution of the task.
1176         In such a case, a task to close the database might be done before the task continues.
1177         Check that the database is not closing to continue the task.
1178         This should ensure that the cross thread queue is not already killed.
1179
1180         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1181         (WebCore::IDBServer::UniqueIDBDatabase::requestSpace):
1182
1183 2019-03-19  Zalan Bujtas  <zalan@apple.com>
1184
1185         RenderElement::startAnimation should take const Animation&
1186         https://bugs.webkit.org/show_bug.cgi?id=195929
1187
1188         Reviewed by Daniel Bates.
1189
1190         * animation/KeyframeEffect.cpp:
1191         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
1192         * page/animation/KeyframeAnimation.cpp:
1193         (WebCore::KeyframeAnimation::startAnimation):
1194         (WebCore::KeyframeAnimation::endAnimation):
1195         * rendering/RenderElement.h:
1196         (WebCore::RenderElement::startAnimation):
1197         (WebCore::RenderElement::animationFinished):
1198         * rendering/RenderLayerBacking.cpp:
1199         (WebCore::RenderLayerBacking::startAnimation):
1200         * rendering/RenderLayerBacking.h:
1201         * rendering/RenderLayerModelObject.cpp:
1202         (WebCore::RenderLayerModelObject::startAnimation):
1203         (WebCore::RenderLayerModelObject::animationFinished):
1204         * rendering/RenderLayerModelObject.h:
1205
1206 2019-03-19  Devin Rousso  <drousso@apple.com>
1207
1208         Web Inspector: Heap: lazily create the agent
1209         https://bugs.webkit.org/show_bug.cgi?id=195590
1210         <rdar://problem/48791750>
1211
1212         Reviewed by Joseph Pecoraro.
1213
1214         No change in functionality.
1215
1216         * inspector/agents/page/PageHeapAgent.cpp:
1217         (WebCore::PageHeapAgent::disable):
1218         * inspector/agents/WebHeapAgent.h:
1219         * inspector/agents/WebHeapAgent.cpp:
1220         (WebCore::WebHeapAgent::WebHeapAgent):
1221         (WebCore::WebHeapAgent::enable): Added.
1222         (WebCore::WebHeapAgent::disable):
1223
1224         * inspector/agents/page/PageConsoleAgent.h:
1225         * inspector/agents/page/PageConsoleAgent.cpp:
1226         (WebCore::PageConsoleAgent::PageConsoleAgent):
1227         * inspector/agents/WebConsoleAgent.h:
1228         * inspector/agents/WebConsoleAgent.cpp:
1229         (WebCore::WebConsoleAgent::WebConsoleAgent):
1230         * inspector/agents/worker/WorkerConsoleAgent.h:
1231         * inspector/agents/worker/WorkerConsoleAgent.cpp:
1232         (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
1233
1234         * inspector/InspectorController.cpp:
1235         (WebCore::InspectorController::InspectorController):
1236         (WebCore::InspectorController::createLazyAgents):
1237         * inspector/WorkerInspectorController.cpp:
1238         (WebCore::WorkerInspectorController::WorkerInspectorController):
1239         (WebCore::WorkerInspectorController::createLazyAgents):
1240
1241 2019-03-19  Simon Fraser  <simon.fraser@apple.com>
1242
1243         Fix GraphicsLayer-related crashes after r243129
1244         https://bugs.webkit.org/show_bug.cgi?id=195953
1245
1246         Reviewed by Dean Jackson.
1247
1248         Extending the lifetime of GraphicsLayers by referencing them in the scrolling tree (r243129)
1249         revealed a bug where RenderLayerCompositor was failing to clear itself as the client of
1250         GraphicsLayers that it owned, causing crashes.
1251
1252         Fix by using the GraphicsLayer::unparentAndClear() helper to clean up all the GraphicsLayers
1253         owned by RenderLayerCompositor.
1254
1255         * rendering/RenderLayerCompositor.cpp:
1256         (WebCore::RenderLayerCompositor::~RenderLayerCompositor):
1257         * rendering/RenderLayerCompositor.h:
1258
1259 2019-03-19  Simon Fraser  <simon.fraser@apple.com>
1260
1261         [Async overflow] Handle positioned nodes in a few more places
1262         https://bugs.webkit.org/show_bug.cgi?id=195946
1263
1264         Reviewed by Zalan Bujtas.
1265
1266         When I added support for positioned nodes in the scrolling tree I missed handling
1267         the ScrollCoordinationRole::Positioning in a few places.
1268
1269         I wasn't able to come up with a test for this; when a positioned node toggles between
1270         tiled and non-tiled, hitting the code in didChangePlatformLayerForLayer(), we already
1271         update the node with the new layer.
1272
1273         * rendering/RenderLayer.cpp:
1274         (WebCore::outputPaintOrderTreeRecursive): Logging.
1275         * rendering/RenderLayerBacking.cpp:
1276         (WebCore::operator<<): Logging.
1277         * rendering/RenderLayerCompositor.cpp:
1278         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer): Update the node's layer.
1279         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): Handle detaching of this node type.
1280
1281 2019-03-19  Alex Christensen  <achristensen@webkit.org>
1282
1283         Make WTFLogChannelState and WTFLogLevel enum classes
1284         https://bugs.webkit.org/show_bug.cgi?id=195904
1285
1286         Reviewed by Eric Carlson.
1287
1288         * Modules/mediasource/SourceBuffer.cpp:
1289         (WebCore::removeSamplesFromTrackBuffer):
1290         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1291         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
1292         (WebCore::LibWebRTCMediaEndpoint::statsLogInterval const):
1293         * dom/Document.cpp:
1294         (WebCore::messageLevelFromWTFLogLevel):
1295         * html/FTPDirectoryDocument.cpp:
1296         (WebCore::FTPDirectoryDocument::FTPDirectoryDocument):
1297         * html/HTMLMediaElement.cpp:
1298         (WebCore::HTMLMediaElement::seekTask):
1299         (WebCore::HTMLMediaElement::selectNextSourceChild):
1300         (WebCore::HTMLMediaElement::sourceWasAdded):
1301         (WebCore::HTMLMediaElement::sourceWasRemoved):
1302         * inspector/agents/WebConsoleAgent.cpp:
1303         (WebCore::WebConsoleAgent::getLoggingChannels):
1304         (WebCore::channelConfigurationForString):
1305         * platform/Logging.cpp:
1306         (WebCore::isLogChannelEnabled):
1307         (WebCore::setLogChannelToAccumulate):
1308         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1309         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1310         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1311         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
1312         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1313         (WebCore::initializePeerConnectionFactoryAndThreads):
1314         * rendering/RenderLayerCompositor.cpp:
1315         (WebCore::compositingLogEnabled):
1316
1317 2019-03-19  Philippe Normand  <pnormand@igalia.com>
1318
1319         REGRESSION(r243058): [GStreamer] 3 tests now timing out
1320         https://bugs.webkit.org/show_bug.cgi?id=195888
1321
1322         Reviewed by Xabier Rodriguez-Calvar.
1323
1324         A breaking change was introduced in r243058. Now on-disk-buffering
1325         is disabled when the reported Content-Length is 0 or not present
1326         at all. This broke the progress event logic in didLoadProgress()
1327         because leading to progress events not being fired as expected.
1328
1329         The proposed solution is to make webkitwebsrc notify the player
1330         every time the network process receives data from the network. So
1331         the player can now easily determine if the load progressed by
1332         checking the reported statistics.
1333
1334         No new tests, existing media tests cover this change.
1335
1336         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1337         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1338         (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const):
1339         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1340         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1341         (CachedResourceStreamingClient::dataReceived):
1342
1343 2019-03-19  Alicia Boya García  <aboya@igalia.com>
1344
1345         [MSE] Use tolerance in eraseBeginTime
1346         https://bugs.webkit.org/show_bug.cgi?id=195911
1347
1348         Reviewed by Jer Noble.
1349
1350         https://bugs.webkit.org/show_bug.cgi?id=190085 introduced tolerance
1351         when erasing frames during the Coded Frame Processing algorithm in
1352         such a way that, in files with less than perfect timestamps, a frame
1353         existing before after the current append is not erased accidentally
1354         due to small overlaps.
1355
1356         This patch takes care of the opposite problem: we don't want an old
1357         frame being accidentally NOT erased by a new one with the same
1358         timestamps just because these overlaps make
1359         highestPresentationTimestamp very slightly higher than the frame PTS.
1360
1361         This bug in practice causes some frames of the old quality to not be
1362         erased when the new quality is appended, resulting in some seemingly
1363         still frames from a different quality appearing at some points during
1364         WebM video in presence of quality changes.
1365
1366         This bug can be reduced to this minimal test case that illustrates the
1367         timestamp imprecission of a typical WebM file:
1368
1369         function sampleRun(generation) {
1370             return concatenateSamples([
1371                 makeASample(     0,      0, 166667, 1000000, 1, SAMPLE_FLAG.SYNC, generation),
1372                 makeASample(167000, 167000, 166667, 1000000, 1, SAMPLE_FLAG.NONE, generation),
1373                 makeASample(333000, 333000, 166667, 1000000, 1, SAMPLE_FLAG.SYNC, generation), // overlaps previous frame
1374                 makeASample(500000, 500000, 166667, 1000000, 1, SAMPLE_FLAG.NONE, generation),
1375             ]);
1376         }
1377
1378         After appending this twice it would be expected that the second
1379         generation takes fully over the first, since the timestamps are
1380         completely the same. Due to the bug, sync frames with an overlap, like
1381         the third one in that list, actually persist from the first
1382         generation, due to lack of tolerance when comparing the start of a new
1383         frame with highestPresentationTimestamp.
1384
1385         This patch introduces the tolerance in that case too to fix this
1386         problem.
1387
1388         Test: media/media-source/media-source-append-twice-overlapping-sync-frame.html
1389
1390         * Modules/mediasource/SourceBuffer.cpp:
1391         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
1392
1393 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
1394
1395         Unreviewed GTK build fix
1396         https://bugs.webkit.org/show_bug.cgi?id=195863
1397         <rdar://problem/49006248>
1398
1399         Patch by Diego Pino.
1400
1401         * svg/SVGTests.h:
1402
1403 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
1404
1405         Unreviewed, rolling out r243132.
1406
1407         Broke GTK build
1408
1409         Reverted changeset:
1410
1411         "Make WTFLogChannelState and WTFLogLevel enum classes"
1412         https://bugs.webkit.org/show_bug.cgi?id=195904
1413         https://trac.webkit.org/changeset/243132
1414
1415 2019-03-19  Antti Koivisto  <antti@apple.com>
1416
1417         Layer with no backing store should still hit-test over a scroller
1418         https://bugs.webkit.org/show_bug.cgi?id=195378
1419         <rdar://problem/48652078>
1420
1421         Reviewed by Simon Fraser.
1422
1423         Tests: fast/scrolling/ios/overflow-scroll-overlap-3.html
1424                fast/scrolling/ios/overflow-scroll-overlap-4.html
1425
1426         Move collecting event region from paint to compositing update time.
1427         This solves a number of problems including regions for non-painting layers.
1428
1429         * platform/graphics/GraphicsLayer.h:
1430         * rendering/RenderBlock.cpp:
1431         (WebCore::RenderBlock::paintObject):
1432
1433         Use the existing visibleToHitTesting() helper.
1434
1435         * rendering/RenderLayer.cpp:
1436         (WebCore::RenderLayer::paintLayerContents):
1437
1438         Use flag for event region collecting, don't paint content.
1439
1440         (WebCore::RenderLayer::paintList):
1441
1442         We can bail out immediately if there is no overflow.
1443
1444         (WebCore::RenderLayer::paintForegroundForFragments):
1445         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
1446         (WebCore::RenderLayer::collectEventRegionForFragments):
1447
1448         Move to a separate function.
1449
1450         * rendering/RenderLayer.h:
1451         * rendering/RenderLayerBacking.cpp:
1452         (WebCore::RenderLayerBacking::updateConfiguration):
1453
1454         Update event region on backing configuration update. This is called after anything interesting changes on a sublayer.
1455
1456         (WebCore::RenderLayerBacking::updateEventRegion):
1457         (WebCore::RenderLayerBacking::paintIntoLayer):
1458         * rendering/RenderLayerBacking.h:
1459
1460 2019-03-18  Alex Christensen  <achristensen@webkit.org>
1461
1462         Make WTFLogChannelState and WTFLogLevel enum classes
1463         https://bugs.webkit.org/show_bug.cgi?id=195904
1464
1465         Reviewed by Eric Carlson.
1466
1467         * Modules/mediasource/SourceBuffer.cpp:
1468         (WebCore::removeSamplesFromTrackBuffer):
1469         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1470         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
1471         (WebCore::LibWebRTCMediaEndpoint::statsLogInterval const):
1472         * dom/Document.cpp:
1473         (WebCore::messageLevelFromWTFLogLevel):
1474         * html/FTPDirectoryDocument.cpp:
1475         (WebCore::FTPDirectoryDocument::FTPDirectoryDocument):
1476         * html/HTMLMediaElement.cpp:
1477         (WebCore::HTMLMediaElement::seekTask):
1478         (WebCore::HTMLMediaElement::selectNextSourceChild):
1479         (WebCore::HTMLMediaElement::sourceWasAdded):
1480         (WebCore::HTMLMediaElement::sourceWasRemoved):
1481         * inspector/agents/WebConsoleAgent.cpp:
1482         (WebCore::WebConsoleAgent::getLoggingChannels):
1483         (WebCore::channelConfigurationForString):
1484         * platform/Logging.cpp:
1485         (WebCore::isLogChannelEnabled):
1486         (WebCore::setLogChannelToAccumulate):
1487         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1488         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1489         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1490         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
1491         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1492         (WebCore::initializePeerConnectionFactoryAndThreads):
1493         * rendering/RenderLayerCompositor.cpp:
1494         (WebCore::compositingLogEnabled):
1495
1496 2019-03-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
1497
1498         Remove the SVG property tear off objects for SVGStringList
1499         https://bugs.webkit.org/show_bug.cgi?id=195863
1500
1501         Reviewed by Simon Fraser.
1502
1503         SVGStringList is not animated list. So we need to introduce two new classes:
1504
1505         -- SVGProperty: This will be the base of all the non-animated properties.
1506            Like the SVGAnimatedProperty, SVGProperty will be registered with the
1507            attribute name in SVGPropertyRegistery. It will also commit changes
1508            to the reflecting attribute. And it will provide a synchronize string
1509            for lazy attribute update.
1510
1511         -- SVGList: It will be the base of all the list properties. It can hold
1512            primitive types or SVG types. In this patch primitive types will be 
1513            supported only. To do that, a superclass called SVGPrimitiveList is
1514            added. Its items are of primitive type such as String type.
1515
1516         * Sources.txt:
1517         * WebCore.xcodeproj/project.pbxproj:
1518         * svg/SVGElement.cpp:
1519         (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const):
1520         (WebCore::SVGElement::commitPropertyChange):
1521         * svg/SVGElement.h:
1522         * svg/SVGStringList.h:
1523         * svg/SVGStringListValues.cpp: Removed.
1524         * svg/SVGStringListValues.h: Removed.
1525         * svg/SVGTests.cpp:
1526         (WebCore::SVGTests::SVGTests):
1527         (WebCore::SVGTests::isKnownAttribute):
1528         (WebCore::SVGTests::isValid const):
1529         (WebCore::SVGTests::parseAttribute):
1530         (WebCore::SVGTests::registerAttributes): Deleted.
1531         (WebCore::SVGTests::requiredFeatures): Deleted.
1532         (WebCore::SVGTests::requiredExtensions): Deleted.
1533         (WebCore::SVGTests::systemLanguage): Deleted.
1534         * svg/SVGTests.h:
1535         (WebCore::SVGTests::requiredFeatures):
1536         (WebCore::SVGTests::requiredExtensions):
1537         (WebCore::SVGTests::systemLanguage):
1538         (): Deleted.
1539         * svg/SVGTests.idl:
1540         * svg/SVGTextPositioningElement.h:
1541         * svg/SVGViewElement.cpp:
1542         (WebCore::SVGViewElement::SVGViewElement):
1543         (WebCore::SVGViewElement::parseAttribute):
1544         (WebCore::SVGViewElement::viewTarget): Deleted.
1545         * svg/SVGViewElement.h:
1546         * svg/properties/SVGAnimatedListPropertyTearOff.h:
1547         * svg/properties/SVGAnimatedPrimitiveProperty.h:
1548         (WebCore::SVGAnimatedPrimitiveProperty::setBaseVal):
1549         * svg/properties/SVGAnimatedProperty.cpp:
1550         (WebCore::SVGAnimatedProperty::commitPropertyChange):
1551         * svg/properties/SVGAnimatedProperty.h:
1552         * svg/properties/SVGAttributeRegistry.h:
1553         * svg/properties/SVGList.h: Added.
1554         (WebCore::SVGList::numberOfItems const):
1555         (WebCore::SVGList::clear):
1556         (WebCore::SVGList::getItem):
1557         (WebCore::SVGList::initialize):
1558         (WebCore::SVGList::insertItemBefore):
1559         (WebCore::SVGList::replaceItem):
1560         (WebCore::SVGList::removeItem):
1561         (WebCore::SVGList::appendItem):
1562         (WebCore::SVGList::items):
1563         (WebCore::SVGList::items const):
1564         (WebCore::SVGList::size const):
1565         (WebCore::SVGList::isEmpty const):
1566         (WebCore::SVGList::clearItems):
1567         (WebCore::SVGList::canAlterList const):
1568         (WebCore::SVGList::canGetItem):
1569         (WebCore::SVGList::canReplaceItem):
1570         (WebCore::SVGList::canRemoveItem):
1571         (WebCore::SVGList::detachItems):
1572         * svg/properties/SVGMemberAccessor.h:
1573         (WebCore::SVGMemberAccessor::matches const):
1574         * svg/properties/SVGPrimitiveList.h: Added.
1575         * svg/properties/SVGProperty.h:
1576         (WebCore::SVGProperty::isAttached const):
1577         (WebCore::SVGProperty::attach):
1578         (WebCore::SVGProperty::detach):
1579         (WebCore::SVGProperty::contextElement const):
1580         (WebCore::SVGProperty::commitChange):
1581         (WebCore::SVGProperty::access const):
1582         (WebCore::SVGProperty::isReadOnly const):
1583         (WebCore::SVGProperty::isDirty const):
1584         (WebCore::SVGProperty::setDirty):
1585         (WebCore::SVGProperty::synchronize):
1586         (WebCore::SVGProperty::valueAsString const):
1587         (WebCore::SVGProperty::SVGProperty):
1588         * svg/properties/SVGPropertyAccessor.h: Added.
1589         * svg/properties/SVGPropertyAccessorImpl.h: Added.
1590         * svg/properties/SVGPropertyOwner.h:
1591         (WebCore::SVGPropertyOwner::commitPropertyChange):
1592         * svg/properties/SVGPropertyOwnerRegistry.h:
1593         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
1594         * svg/properties/SVGPropertyRegistry.h:
1595         * svg/properties/SVGStaticListPropertyTearOff.h: Removed.
1596
1597 2019-03-18  Simon Fraser  <simon.fraser@apple.com>
1598
1599         Unreviewed followup to r243126.
1600
1601         LayerRepresentation operator=() needs to copy m_graphicsLayer now that it doesn't
1602         share a pointer with m_typelessPlatformLayer. Also make the LayerRepresentation construction
1603         from a GraphiscLayer* explicit.
1604
1605         * page/scrolling/ScrollingStateNode.h:
1606         (WebCore::LayerRepresentation::operator=):
1607         (WebCore::LayerRepresentation::toRepresentation const):
1608
1609 2019-03-18  Simon Fraser  <simon.fraser@apple.com>
1610
1611         Scrolling state nodes should hold references to GraphicsLayers
1612         https://bugs.webkit.org/show_bug.cgi?id=195844
1613         <rdar://problem/48949634>
1614
1615         Reviewed by Tim Horton.
1616
1617         GraphicsLayers are refcounted, and the scrolling tree keeps GraphicsLayer pointers,
1618         so for safely the scrolling tree should store RefPtr<GraphicsLayer> instead.
1619
1620         I removed the union (since it would be weird with a RefPtr and raw pointer). This code
1621         should probably use WTF::Variant<> in future.
1622
1623         * page/scrolling/ScrollingStateNode.h:
1624         (WebCore::LayerRepresentation::LayerRepresentation):
1625         (WebCore::LayerRepresentation::operator GraphicsLayer* const):
1626
1627 2019-03-18  Commit Queue  <commit-queue@webkit.org>
1628
1629         Unreviewed, rolling out r243092 and r243096.
1630         https://bugs.webkit.org/show_bug.cgi?id=195926
1631
1632         Caused assertions in tests (Requested by smfr on #webkit).
1633
1634         Reverted changesets:
1635
1636         "Layer with no backing store should still hit-test over a
1637         scroller"
1638         https://bugs.webkit.org/show_bug.cgi?id=195378
1639         https://trac.webkit.org/changeset/243092
1640
1641         "Try to fix Windows build."
1642         https://trac.webkit.org/changeset/243096
1643
1644 2019-03-18  Megan Gardner  <megan_gardner@apple.com>
1645
1646         Smart Insert for paragraphs.
1647         https://bugs.webkit.org/show_bug.cgi?id=194880
1648
1649         Reviewed by Ryosuke Niwa.
1650
1651         Add additional newlines to maintain spacing around paragraphs.
1652
1653         Tests: editing/pasteboard/smart-paste-paragraph-001.html
1654                editing/pasteboard/smart-paste-paragraph-002.html
1655                editing/pasteboard/smart-paste-paragraph-003.html
1656                editing/pasteboard/smart-paste-paragraph-004.html
1657
1658         * dom/Document.cpp:
1659         (WebCore::Document::editingBehavior const):
1660         * dom/Document.h:
1661
1662         Expose editing behaviour through document so that is can be access from the selection commands
1663         and allow the editing behaviour to be used.
1664
1665         * editing/CompositeEditCommand.h:
1666         * editing/EditingBehavior.h:
1667         (WebCore::EditingBehavior::shouldSmartInsertDeleteParagraphs const):
1668
1669         Only have editing insert paragraphs on iOS and in editing elements that support multiple lines.
1670
1671         * editing/ReplaceSelectionCommand.cpp:
1672         (WebCore::ReplaceSelectionCommand::doApply):
1673         (WebCore::ReplaceSelectionCommand::shouldPerformSmartParagraphReplace const):
1674         (WebCore::ReplaceSelectionCommand::addNewLinesForSmartReplace):
1675         * editing/ReplaceSelectionCommand.h:
1676
1677         Add addititional newlines when pasting full paragraphs to maintian two newlines between paragraphs
1678         if that is what the original document had. If there are not multiple lines between paragraphs, do not
1679         add additional new lines.
1680
1681 2019-03-18  Ryosuke Niwa  <rniwa@webkit.org>
1682
1683         Reduce the size of Node::deref by eliminating an explicit parentNode check
1684         https://bugs.webkit.org/show_bug.cgi?id=195776
1685
1686         Reviewed by Geoffrey Garen.
1687
1688         This patch eliminates the nullity check of m_parentNode in Node::deref as well as the store to
1689         m_refCount in the case of invoking Node::removedLastRef() as done for RefCounted in r30042.
1690         Together, this patch shrinks WebCore's size by 46KB or ~0.7%.
1691
1692         To do this, we take we take a similar approach as WTF::String by using the lowest bit of m_refCount
1693         to indicate whether a node has a parent or not. Regular ref-counting is done on the upper 31 bits.
1694         Node::setParentNode updates this flag, and Node::deref() would only `delete this` if m_refCount
1695         is identically equal to 0.
1696
1697         For a Document, we set m_refCounted to 0 before in the case of non-zero m_referencingNodeCount
1698         since decrementReferencingNodeCount needs to be able to tell if there is an outstanding Ref/RefPtr
1699         or not when m_referencingNodeCount becomes 0.
1700
1701         No new tests since there should be no behavioral change.
1702
1703         * dom/Document.cpp:
1704         (WebCore::Document::removedLastRef):
1705         * dom/Document.h:
1706         (WebCore::Document::decrementReferencingNodeCount):
1707         * dom/Node.cpp:
1708         (WebCore::Node::Node): Moved the initialization of m_refCount to the member variable declaration.
1709         (WebCore::Node::~Node):
1710         (WebCore::Node::removedLastRef):
1711         * dom/Node.h:
1712         (WebCore::Node): Changed the type of m_refCount from signed int to uint32_t. It was changed from
1713         unsigned int to signed int back in r11492 but I don't think the signedness is needed.
1714         (WebCore::Node::ref): Increment the ref count by 2 (upper 31-bit).
1715         (WebCore::Node::deref): Implemented the optimization. This is what shrinks the WebCore binary size.
1716         (WebCore::Node::hasOneRef const):
1717         (WebCore::Node::refCount const): Ignore the lowest bit. Without this fix, the optimization in
1718         replaceChildrenWithFragment to avoid replacing the text node is disabled whenever there is a parent.
1719         (WebCore::Node::setParentNode): Sets the lowest bit to 1 if the node has a parent and 0 otherwise.
1720
1721 2019-03-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
1722
1723         Remove the SVG property tear off objects for SVGAnimatedBoolean
1724         https://bugs.webkit.org/show_bug.cgi?id=195862
1725
1726         Reviewed by Simon Fraser.
1727
1728         -- SVGAnimatedBoolean will be defined as SVGAnimatedPrimitiveProperty<bool>.
1729         -- SVGAnimatedBooleanAccessor is added to access a member of this type.
1730         -- A function registerProperty() is added to SVGPropertyOwnerRegistry
1731            to register this type.
1732         -- SVGAnimatedBooleanAnimator is added to animate a member of this type.
1733         -- SVGAnimationBooleanFunction is added to handle the progress of this
1734            new type over a period of time.
1735
1736         SVGAnimationDiscreteFunction is the base class of SVGAnimationBooleanFunction.
1737         It will be the base class of all the discrete animation function types:
1738         string, bool, enum and PreserveAspectRatio types.
1739
1740         * Sources.txt:
1741         * WebCore.xcodeproj/project.pbxproj:
1742         * svg/SVGAnimationElement.h:
1743         * svg/SVGAnimatorFactory.h:
1744         (WebCore::SVGAnimatorFactory::create):
1745         * svg/SVGClipPathElement.h:
1746         * svg/SVGCursorElement.h:
1747         * svg/SVGDefsElement.h:
1748         * svg/SVGExternalResourcesRequired.cpp:
1749         (WebCore::SVGExternalResourcesRequired::SVGExternalResourcesRequired):
1750         (WebCore::SVGExternalResourcesRequired::parseAttribute):
1751         (WebCore::SVGExternalResourcesRequired::registerAttributes): Deleted.
1752         * svg/SVGExternalResourcesRequired.h:
1753         (WebCore::SVGExternalResourcesRequired::externalResourcesRequired const):
1754         (WebCore::SVGExternalResourcesRequired::externalResourcesRequiredAnimated):
1755         (WebCore::SVGExternalResourcesRequired::setExternalResourcesRequired): Deleted.
1756         * svg/SVGFEConvolveMatrixElement.cpp:
1757         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
1758         (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
1759         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
1760         * svg/SVGFEConvolveMatrixElement.h:
1761         * svg/SVGFEImageElement.h:
1762         * svg/SVGFontElement.h:
1763         * svg/SVGForeignObjectElement.h:
1764         * svg/SVGGElement.h:
1765         * svg/SVGGradientElement.h:
1766         * svg/SVGMPathElement.h:
1767         * svg/SVGMarkerElement.h:
1768         * svg/SVGMaskElement.h:
1769         * svg/SVGPathElement.h:
1770         * svg/SVGPatternElement.h:
1771         * svg/SVGRectElement.h:
1772         * svg/SVGSVGElement.h:
1773         * svg/SVGScriptElement.h:
1774         * svg/SVGSwitchElement.h:
1775         * svg/SVGSymbolElement.h:
1776         * svg/SVGTextContentElement.h:
1777         * svg/SVGUseElement.h:
1778         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
1779         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
1780         * svg/properties/SVGAnimatedPropertyImpl.h:
1781         * svg/properties/SVGAnimationDiscreteFunction.h: Added.
1782         (WebCore::SVGAnimationDiscreteFunction::SVGAnimationDiscreteFunction):
1783         (WebCore::SVGAnimationDiscreteFunction::progress):
1784         * svg/properties/SVGAnimationDiscreteFunctionImpl.h: Added.
1785         * svg/properties/SVGAttributeRegistry.h:
1786         * svg/properties/SVGPropertyOwnerRegistry.h:
1787         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
1788
1789 2019-03-18  Simon Fraser  <simon.fraser@apple.com>
1790
1791         Crash when reloading test with async overflow scrolling
1792         https://bugs.webkit.org/show_bug.cgi?id=195629
1793         <rdar://problem/48814045>
1794
1795         Reviewed by Antoine Quint.
1796
1797         RenderLayerCompositor::removeFromScrollCoordinatedLayers needs to pass the Positioning
1798         bit to make sure we remove RenderLayers added m_scrollingNodeToLayerMap for Positioning
1799         scrolling nodes.
1800
1801         Fixes crashes seen in compositing/clipping/border-radius-async-overflow-non-stacking.html
1802         and scrollingcoordinator/scrolling-tree/remove-coordinated-frame.html.
1803
1804         * rendering/RenderLayerBacking.cpp:
1805         (WebCore::RenderLayerBacking::~RenderLayerBacking):
1806         * rendering/RenderLayerCompositor.cpp:
1807         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
1808
1809 2019-03-18  Devin Rousso  <drousso@apple.com>
1810
1811         Web Inspector: Timeline: lazily create the agent
1812         https://bugs.webkit.org/show_bug.cgi?id=195865
1813         <rdar://problem/48965403>
1814
1815         Reviewed by Joseph Pecoraro.
1816
1817         No change in functionality.
1818
1819         * inspector/agents/InspectorTimelineAgent.h:
1820         * inspector/agents/InspectorTimelineAgent.cpp:
1821         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
1822         (WebCore::InspectorTimelineAgent::toggleScriptProfilerInstrument):
1823         (WebCore::InspectorTimelineAgent::toggleHeapInstrument):
1824         (WebCore::InspectorTimelineAgent::setFrameIdentifier):
1825
1826         * inspector/InspectorInstrumentation.h:
1827         (WebCore::InspectorInstrumentation::startProfiling):
1828         (WebCore::InspectorInstrumentation::stopProfiling):
1829         (WebCore::InspectorInstrumentation::didRequestAnimationFrame):
1830         (WebCore::InspectorInstrumentation::didCancelAnimationFrame):
1831
1832         * inspector/InstrumentingAgents.h:
1833         (WebCore::InstrumentingAgents::inspectorScriptProfilerAgent const): Added.
1834         (WebCore::InstrumentingAgents::setInspectorScriptProfilerAgent): Added.
1835         * inspector/InstrumentingAgents.cpp:
1836         (WebCore::InstrumentingAgents::reset):
1837
1838         * inspector/InspectorController.cpp:
1839         (WebCore::InspectorController::InspectorController):
1840         (WebCore::InspectorController::createLazyAgents):
1841
1842 2019-03-18  Darin Adler  <darin@apple.com>
1843
1844         Cut down on use of StringBuffer, possibly leading toward removing it entirely
1845         https://bugs.webkit.org/show_bug.cgi?id=195870
1846
1847         Reviewed by Daniel Bates.
1848
1849         * dom/Document.cpp:
1850         (WebCore::canonicalizedTitle): Fixed all the problems mentioned in "FIXME".
1851         Made this a single function rather than a function template. Switch to
1852         StringBuilder instead of StringBuffer. Return the original string if the
1853         canonicalize operation doesn't change anything.
1854         (WebCore::Document::updateTitle): Updated for the change above.
1855
1856         * platform/Length.cpp:
1857         (WebCore::newCoordsArray): Use createUninitialized instead of StringBuffer.
1858         Also got rid of unneeded use of upconvertedCharacters on a temporary string
1859         that we explicitly created with 16-bit characters. The performance of this
1860         function could be considerably simplified by not copying the original string
1861         at all, but didn't do that at this time.
1862
1863         * platform/text/TextCodecUTF16.cpp:
1864         (WebCore::TextCodecUTF16::decode): Use createUninitialized instead of
1865         StringBuffer. Also renamed numChars to numCodeUnits to both switch to complete
1866         words and to be slightly more accurate.
1867
1868         * rendering/RenderText.cpp:
1869         (WebCore::convertNoBreakSpace): Added.
1870         (WebCore::capitalize): Use Vector instead of StringBuffer. Simplify code by
1871         using convertNoBreakSpace function. Removed code that was using StringImpl
1872         directly for a tiny speed boost; if we want to optimize the performance of
1873         this function we would need to do more than that. Return the original string
1874         if it happens to already be capitalized.
1875
1876 2019-03-18  Timothy Hatcher  <timothy@apple.com>
1877
1878         WKWebView.GetContentsShouldReturnAttributedString is crashing on iOS Simulator.
1879         https://bugs.webkit.org/show_bug.cgi?id=195916
1880
1881         Reviewed by Tim Horton.
1882
1883         * WebCore.xcodeproj/project.pbxproj: Make ColorIOS.h a private header.
1884         * platform/ios/ColorIOS.h: Export colorFromUIColor.
1885
1886 2019-03-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
1887
1888         Define the type of SVGPropertyOwnerRegistry for all SVG elements
1889         https://bugs.webkit.org/show_bug.cgi?id=195859
1890
1891         Reviewed by Simon Fraser.
1892
1893         SVGPropertyOwnerRegistry will eventually replace SVGAttributeOwnerProxyImpl.
1894
1895         * svg/SVGAElement.h:
1896         * svg/SVGAltGlyphElement.h:
1897         * svg/SVGAnimationElement.h:
1898         * svg/SVGCircleElement.h:
1899         * svg/SVGClipPathElement.h:
1900         * svg/SVGComponentTransferFunctionElement.h:
1901         (WebCore::SVGComponentTransferFunctionElement::attributeRegistry):
1902         (WebCore::SVGComponentTransferFunctionElement::isKnownAttribute):
1903         * svg/SVGCursorElement.h:
1904         * svg/SVGDefsElement.h:
1905         * svg/SVGElement.h:
1906         * svg/SVGEllipseElement.h:
1907         * svg/SVGExternalResourcesRequired.h:
1908         (WebCore::SVGExternalResourcesRequired::isKnownAttribute):
1909         * svg/SVGFEBlendElement.h:
1910         * svg/SVGFEColorMatrixElement.h:
1911         * svg/SVGFEComponentTransferElement.h:
1912         * svg/SVGFECompositeElement.h:
1913         * svg/SVGFEConvolveMatrixElement.h:
1914         * svg/SVGFEDiffuseLightingElement.h:
1915         * svg/SVGFEDisplacementMapElement.h:
1916         * svg/SVGFEDropShadowElement.h:
1917         * svg/SVGFEGaussianBlurElement.h:
1918         * svg/SVGFEImageElement.h:
1919         * svg/SVGFELightElement.h:
1920         (WebCore::SVGFELightElement::attributeRegistry):
1921         (WebCore::SVGFELightElement::isKnownAttribute):
1922         * svg/SVGFEMergeNodeElement.h:
1923         * svg/SVGFEMorphologyElement.h:
1924         * svg/SVGFEOffsetElement.h:
1925         * svg/SVGFESpecularLightingElement.h:
1926         * svg/SVGFETileElement.h:
1927         * svg/SVGFETurbulenceElement.cpp:
1928         (WebCore::SVGFETurbulenceElement::svgAttributeChanged):
1929         * svg/SVGFETurbulenceElement.h:
1930         * svg/SVGFilterElement.h:
1931         * svg/SVGFilterPrimitiveStandardAttributes.h:
1932         (WebCore::SVGFilterPrimitiveStandardAttributes::isKnownAttribute):
1933         * svg/SVGFitToViewBox.h:
1934         (WebCore::SVGFitToViewBox::isKnownAttribute):
1935         * svg/SVGFontElement.h:
1936         * svg/SVGForeignObjectElement.h:
1937         * svg/SVGGElement.h:
1938         * svg/SVGGeometryElement.h:
1939         (WebCore::SVGGeometryElement::isKnownAttribute):
1940         * svg/SVGGlyphRefElement.h:
1941         * svg/SVGGradientElement.h:
1942         (WebCore::SVGGradientElement::isKnownAttribute):
1943         * svg/SVGGraphicsElement.h:
1944         (WebCore::SVGGraphicsElement::isKnownAttribute):
1945         * svg/SVGImageElement.h:
1946         * svg/SVGLineElement.h:
1947         * svg/SVGLinearGradientElement.h:
1948         * svg/SVGMPathElement.h:
1949         * svg/SVGMarkerElement.h:
1950         * svg/SVGMaskElement.h:
1951         * svg/SVGPathElement.h:
1952         * svg/SVGPatternElement.h:
1953         * svg/SVGPolyElement.h:
1954         (WebCore::SVGPolyElement::attributeRegistry):
1955         (WebCore::SVGPolyElement::isKnownAttribute):
1956         * svg/SVGRadialGradientElement.h:
1957         * svg/SVGRectElement.h:
1958         * svg/SVGSVGElement.h:
1959         * svg/SVGScriptElement.h:
1960         * svg/SVGStopElement.h:
1961         * svg/SVGSwitchElement.h:
1962         * svg/SVGSymbolElement.h:
1963         * svg/SVGTRefElement.h:
1964         * svg/SVGTests.h:
1965         * svg/SVGTextContentElement.h:
1966         (WebCore::SVGTextContentElement::isKnownAttribute):
1967         * svg/SVGTextPathElement.h:
1968         * svg/SVGTextPositioningElement.h:
1969         (WebCore::SVGTextPositioningElement::isKnownAttribute):
1970         * svg/SVGURIReference.h:
1971         * svg/SVGUseElement.h:
1972         * svg/SVGViewElement.h:
1973         * svg/SVGViewSpec.h:
1974         * svg/SVGZoomAndPan.cpp:
1975         (WebCore::SVGZoomAndPan::parseZoomAndPan):
1976         (WebCore::SVGZoomAndPan::parseAttribute):
1977         (WebCore::SVGZoomAndPan::SVGZoomAndPan): Deleted.
1978         (WebCore::SVGZoomAndPan::registerAttributes): Deleted.
1979         * svg/SVGZoomAndPan.h:
1980         (WebCore::SVGZoomAndPan::zoomAndPan const):
1981         (WebCore::SVGZoomAndPan::setZoomAndPan):
1982         (WebCore::SVGZoomAndPan::reset):
1983         (WebCore::SVGZoomAndPan::attributeRegistry): Deleted.
1984         (WebCore::SVGZoomAndPan::isKnownAttribute): Deleted.
1985
1986 2019-03-18  Timothy Hatcher  <timothy@apple.com>
1987
1988         Add new NSAttributedString API for converting HTML.
1989         https://bugs.webkit.org/show_bug.cgi?id=195636
1990         rdar://problem/45055697
1991
1992         Reviewed by Tim Horton.
1993
1994         * en.lproj/Localizable.strings: Updated.
1995
1996 2019-03-18  Zalan Bujtas  <zalan@apple.com>
1997
1998         Call transition and animation callbacks on non-composited renderers too.
1999         https://bugs.webkit.org/show_bug.cgi?id=195907
2000
2001         Reviewed by Simon Fraser.
2002
2003         These callbacks are not composited specific functions.
2004
2005         * page/animation/AnimationBase.cpp:
2006         (WebCore::AnimationBase::freezeAtTime):
2007         (WebCore::AnimationBase::compositedRenderer const): Deleted.
2008         * page/animation/AnimationBase.h:
2009         * page/animation/ImplicitAnimation.cpp:
2010         (WebCore::ImplicitAnimation::startAnimation):
2011         (WebCore::ImplicitAnimation::pauseAnimation):
2012         (WebCore::ImplicitAnimation::endAnimation):
2013         * page/animation/KeyframeAnimation.cpp:
2014         (WebCore::KeyframeAnimation::startAnimation):
2015         (WebCore::KeyframeAnimation::pauseAnimation):
2016         (WebCore::KeyframeAnimation::endAnimation):
2017         * rendering/RenderLayerModelObject.cpp:
2018         (WebCore::RenderLayerModelObject::startTransition):
2019         (WebCore::RenderLayerModelObject::transitionPaused):
2020         (WebCore::RenderLayerModelObject::transitionFinished):
2021         (WebCore::RenderLayerModelObject::startAnimation):
2022         (WebCore::RenderLayerModelObject::animationPaused):
2023         (WebCore::RenderLayerModelObject::animationSeeked):
2024         (WebCore::RenderLayerModelObject::animationFinished):
2025         (WebCore::RenderLayerModelObject::suspendAnimations):
2026
2027 2019-03-18  Jer Noble  <jer.noble@apple.com>
2028
2029         Add experimental "alphaChannel" property to VideoConfiguration
2030         https://bugs.webkit.org/show_bug.cgi?id=195853
2031
2032         Reviewed by Eric Carlson.
2033
2034         Test: media/mediacapabilities/mock-decodingInfo-alphaChannel.html
2035
2036         Add a new, experimental addition to Media Capabilities to allow pages to query for
2037         alpha channel support.
2038
2039         * Modules/mediacapabilities/MediaCapabilities.cpp:
2040         (WebCore::MediaCapabilities::decodingInfo):
2041         * Modules/mediacapabilities/MediaCapabilities.h:
2042         * Modules/mediacapabilities/MediaCapabilities.idl:
2043         * Modules/mediacapabilities/VideoConfiguration.idl:
2044         * SourcesCocoa.txt:
2045         * WebCore.xcodeproj/project.pbxproj:
2046         * platform/cocoa/VideoToolboxSoftLink.cpp:
2047         * platform/cocoa/VideoToolboxSoftLink.h:
2048         * platform/graphics/cocoa/HEVCUtilitiesCocoa.h:
2049         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm: Renamed from Source/WebCore/platform/graphics/cocoa/HEVCUtilitiesCocoa.cpp.
2050         (WebCore::validateHEVCParameters):
2051         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
2052         (WebCore::createMediaPlayerDecodingConfigurationCocoa):
2053         * platform/mediacapabilities/VideoConfiguration.h:
2054         * platform/mock/MediaEngineConfigurationFactoryMock.cpp:
2055         (WebCore::canDecodeMedia):
2056         (WebCore::canEncodeMedia):
2057
2058 2019-03-18  Ryosuke Niwa  <rniwa@webkit.org>
2059
2060         Remove unused webkitEditableContentChanged event
2061         https://bugs.webkit.org/show_bug.cgi?id=195909
2062
2063         Reviewed by Wenson Hsieh.
2064
2065         Removed webkitEditableContentChanged event which is no longer used after r206944.
2066
2067         Note that only WebKit's C++ code can fire events in TextControlInnerElements
2068         since the element is an implementation detail of input and textarea elements.
2069
2070         * dom/EventNames.h:
2071         * html/shadow/TextControlInnerElements.cpp:
2072         (WebCore::TextControlInnerTextElement::defaultEventHandler):
2073
2074 2019-03-18  Myles C. Maxfield  <mmaxfield@apple.com>
2075
2076         [WHLSL] Hook up the compiler to our WebGPU implementation
2077         https://bugs.webkit.org/show_bug.cgi?id=195509
2078
2079         Unreviewed.
2080
2081         Update after r243091.
2082
2083         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
2084         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2085         (WebCore::trySetWHLSLFunctionsForPipelineDescriptor):
2086
2087 2019-03-18  Chris Dumez  <cdumez@apple.com>
2088
2089         REGRESSION(r236862): early frame decoupling leaves JSC ArrayBuffer objects lingering
2090         https://bugs.webkit.org/show_bug.cgi?id=195322
2091
2092         Reviewed by Ryosuke Niwa.
2093
2094         Since r236862, DOMWindow objects get disconnected from their Frame object as soon as
2095         their iframe element gets removed from the document. Previously, DOMWindow was a
2096         FrameDestructionObserver and would stay connected to its frame until the frame died.
2097
2098         This means that some of the work that we were doing in DOMWindow::frameDestroyed() and
2099         Document::willDetachPage() no longer happens for subframe windows because they get
2100         disconnected from their frame because they get a chance to get such notifications.
2101         To address this issue, we now also do this work in DOMWindow::willDetachDocumentFromFrame()
2102         which gets called when the iframe gets removed from the document and the document / window
2103         get disconnected from the Frame element.
2104
2105         No new tests, verified locally that the leak is gone on JetStream.
2106
2107         * page/DOMWindow.cpp:
2108         (WebCore::DOMWindow::willDetachDocumentFromFrame):
2109
2110 2019-03-18  Zalan Bujtas  <zalan@apple.com>
2111
2112         Move animation and transition functions from RenderBoxModelObject to RenderElement
2113         https://bugs.webkit.org/show_bug.cgi?id=195903
2114
2115         Reviewed by Simon Fraser.
2116
2117         Transitions and animations do not require RenderBoxModelObject. Move these functions to RenderElement and override them at RenderLayerModelObject to support
2118         composition related callbacks.
2119
2120         * page/animation/AnimationBase.cpp:
2121         (WebCore::AnimationBase::compositedRenderer const):
2122         * page/animation/AnimationBase.h:
2123         * rendering/RenderBoxModelObject.cpp:
2124         (WebCore::RenderBoxModelObject::startTransition): Deleted.
2125         (WebCore::RenderBoxModelObject::transitionPaused): Deleted.
2126         (WebCore::RenderBoxModelObject::transitionFinished): Deleted.
2127         (WebCore::RenderBoxModelObject::startAnimation): Deleted.
2128         (WebCore::RenderBoxModelObject::animationPaused): Deleted.
2129         (WebCore::RenderBoxModelObject::animationSeeked): Deleted.
2130         (WebCore::RenderBoxModelObject::animationFinished): Deleted.
2131         (WebCore::RenderBoxModelObject::suspendAnimations): Deleted.
2132         * rendering/RenderBoxModelObject.h:
2133         * rendering/RenderElement.cpp:
2134         (WebCore::RenderElement::startTransition):
2135         (WebCore::RenderElement::transitionPaused):
2136         (WebCore::RenderElement::transitionFinished):
2137         (WebCore::RenderElement::startAnimation):
2138         (WebCore::RenderElement::animationPaused):
2139         (WebCore::RenderElement::animationSeeked):
2140         (WebCore::RenderElement::animationFinished):
2141         (WebCore::RenderElement::suspendAnimations):
2142         * rendering/RenderElement.h:
2143
2144 2019-03-18  Antti Koivisto  <antti@apple.com>
2145
2146         Try to fix Windows build.
2147
2148         * rendering/RenderLayerBacking.cpp:
2149         (WebCore::RenderLayerBacking::updateEventRegion):
2150
2151 2019-03-18  Antti Koivisto  <antti@apple.com>
2152
2153         Layer with no backing store should still hit-test over a scroller
2154         https://bugs.webkit.org/show_bug.cgi?id=195378
2155         <rdar://problem/48652078>
2156
2157         Reviewed by Simon Fraser.
2158
2159         Tests: fast/scrolling/ios/overflow-scroll-overlap-3.html
2160                fast/scrolling/ios/overflow-scroll-overlap-4.html
2161
2162         Move collecting event region from paint to compositing update time.
2163         This solves a number of problems including regions for non-painting layers.
2164
2165         * platform/graphics/GraphicsLayer.h:
2166         * rendering/RenderBlock.cpp:
2167         (WebCore::RenderBlock::paintObject):
2168
2169         Use the existing visibleToHitTesting() helper.
2170
2171         * rendering/RenderLayer.cpp:
2172         (WebCore::RenderLayer::paintLayerContents):
2173
2174         Use flag for event region collecting, don't paint content.
2175
2176         (WebCore::RenderLayer::paintList):
2177
2178         We can bail out immediately if there is no overflow.
2179
2180         (WebCore::RenderLayer::paintForegroundForFragments):
2181         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
2182         (WebCore::RenderLayer::collectEventRegionForFragments):
2183
2184         Move to a separate function.
2185
2186         * rendering/RenderLayer.h:
2187         * rendering/RenderLayerBacking.cpp:
2188         (WebCore::RenderLayerBacking::updateConfiguration):
2189
2190         Update event region on backing configuration update. This is called after anything interesting changes on a sublayer.
2191
2192         (WebCore::RenderLayerBacking::updateEventRegion):
2193         (WebCore::RenderLayerBacking::paintIntoLayer):
2194         * rendering/RenderLayerBacking.h:
2195
2196 2019-03-18  Myles C. Maxfield  <mmaxfield@apple.com>
2197
2198         [WHLSL] Hook up the compiler to our WebGPU implementation
2199         https://bugs.webkit.org/show_bug.cgi?id=195509
2200
2201         Reviewed by Dean Jackson.
2202
2203         This represents a collection of changes necessary to compile and run the first WHLSL program in WebKit.
2204
2205         Because WHLSL isn't fully implemented yet, this patch doesn't remove the existing method for supplying
2206         Metal shaders to WebGPU. Instead, it adds a new boolean to WebGPUShaderModuleDescriptor, "isWHLSL" which
2207         causes us to run the WHLSL compiler.
2208
2209         More details below.
2210
2211         Test: webgpu/whlsl.html
2212
2213         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h: Use raw pointer instead of Optional<std::reference_wrapper>.
2214         (WebCore::WHLSL::AST::CallExpression::setCastData):
2215         (WebCore::WHLSL::AST::CallExpression::isCast):
2216         (WebCore::WHLSL::AST::CallExpression::castReturnType):
2217         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
2218         (WebCore::WHLSL::AST::NativeTypeDeclaration::isAtomic const):
2219         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsAtomic):
2220         (WebCore::WHLSL::AST::NativeTypeDeclaration::name const): Deleted. The parent class already has a name string.
2221         (WebCore::WHLSL::AST::NativeTypeDeclaration::name): Deleted.
2222         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
2223         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
2224         (WebCore::WHLSL::AST::TypeReference::cloneTypeReference const): When cloning a type reference, make sure to
2225         clone the pointer to its resolved type, too.
2226         * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
2227         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: Incorporate resolution from
2228         https://github.com/gpuweb/gpuweb/pull/188.
2229         (WebCore::WHLSL::Metal::EntryPointScaffolding::EntryPointScaffolding):
2230         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
2231         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceSignature):
2232         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::helperTypes):
2233         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::unpack):
2234         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::pack): Support semantics being placed directly on the
2235         entry point, instead of being placed on a structure member.
2236         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes):
2237         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::pack): Ditto.
2238         (WebCore::WHLSL::Metal::EntryPointScaffolding::mappedBindGroups const): Deleted.
2239         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
2240         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
2241         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
2242         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::createEntryPointScaffolding):
2243         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::createEntryPointScaffolding):
2244         (WebCore::WHLSL::Metal::metalFunctions):
2245         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::takeVertexMappedBindGroups): Deleted. After
2246         https://github.com/gpuweb/gpuweb/pull/188, we don't need the mappings.
2247         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::takeFragmentMappedBindGroups): Deleted. Ditto.
2248         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::takeMappedBindGroups): Deleted. Ditto.
2249         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h: Ditto.
2250         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp: Ditto.
2251         (WebCore::WHLSL::Metal::generateMetalCodeShared):
2252         (WebCore::WHLSL::Metal::generateMetalCode):
2253         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h: Ditto.
2254         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp: Support compiler-generated functions. Change
2255         CRASH() to notImplemented().
2256         (WebCore::WHLSL::Metal::writeNativeFunction):
2257         (WebCore::WHLSL::Metal::getNativeName): Deleted.
2258         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
2259         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
2260         (WebCore::WHLSL::Metal::writeNativeType): 
2261         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp: The dependency graph needs to track all unnamed types. Also,
2262         we need to track types that are the results of expressions (not just types literally spelled out in the
2263         program). Enumerations need to be emitted after their base types are emitted.
2264         (WebCore::WHLSL::Metal::TypeNamer::visit):
2265         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::MetalTypeDeclarationWriter):
2266         (WebCore::WHLSL::Metal::TypeNamer::metalTypeDeclarations):
2267         (WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
2268         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
2269         (WebCore::WHLSL::Metal::TypeNamer::emitAllUnnamedTypeDefinitions):
2270         (WebCore::WHLSL::Metal::TypeNamer::metalTypeDefinitions):
2271         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h:
2272         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
2273         (WebCore::WHLSL::checkDuplicateFunctions):
2274         * Modules/webgpu/WHLSL/WHLSLChecker.cpp: Wrap ResolvingType in a class to make sure it plays nicely with
2275         HashMap. Also, use raw pointers instead of Optional<std::reference_wrapper>s.
2276         (WebCore::WHLSL::resolveWithReferenceComparator):
2277         (WebCore::WHLSL::resolveByInstantiation):
2278         (WebCore::WHLSL::checkOperatorOverload):
2279         (WebCore::WHLSL::Checker::assignTypes):
2280         (WebCore::WHLSL::Checker::checkShaderType):
2281         (WebCore::WHLSL::Checker::visit):
2282         (WebCore::WHLSL::matchAndCommit):
2283         (WebCore::WHLSL::Checker::recurseAndGetInfo):
2284         (WebCore::WHLSL::Checker::assignType):
2285         (WebCore::WHLSL::Checker::forwardType):
2286         (WebCore::WHLSL::getUnnamedType):
2287         (WebCore::WHLSL::Checker::finishVisitingPropertyAccess):
2288         (WebCore::WHLSL::Checker::isBoolType):
2289         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
2290         (WebCore::WHLSL::Gatherer::visit):
2291         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
2292         (WebCore::WHLSL::inferTypesForCall):
2293         * Modules/webgpu/WHLSL/WHLSLInferTypes.h:
2294         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
2295         (WebCore::WHLSL::Intrinsics::addPrimitive):
2296         (WebCore::WHLSL::Intrinsics::addFullTexture):
2297         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
2298         (WebCore::WHLSL::Intrinsics::ucharType const):
2299         (WebCore::WHLSL::Intrinsics::ushortType const):
2300         (WebCore::WHLSL::Intrinsics::charType const):
2301         (WebCore::WHLSL::Intrinsics::shortType const):
2302         (WebCore::WHLSL::Intrinsics::intType const):
2303         (WebCore::WHLSL::Intrinsics::uchar2Type const):
2304         (WebCore::WHLSL::Intrinsics::uchar4Type const):
2305         (WebCore::WHLSL::Intrinsics::ushort2Type const):
2306         (WebCore::WHLSL::Intrinsics::ushort4Type const):
2307         (WebCore::WHLSL::Intrinsics::uint2Type const):
2308         (WebCore::WHLSL::Intrinsics::uint4Type const):
2309         (WebCore::WHLSL::Intrinsics::char2Type const):
2310         (WebCore::WHLSL::Intrinsics::char4Type const):
2311         (WebCore::WHLSL::Intrinsics::short2Type const):
2312         (WebCore::WHLSL::Intrinsics::short4Type const):
2313         (WebCore::WHLSL::Intrinsics::int2Type const):
2314         (WebCore::WHLSL::Intrinsics::int4Type const):
2315         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
2316         (WebCore::WHLSL::Lexer::recognizeKeyword):
2317         * Modules/webgpu/WHLSL/WHLSLNameContext.cpp:
2318         (WebCore::WHLSL::NameContext::add):
2319         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
2320         (WebCore::WHLSL::NameResolver::visit): Don't visit recursive types.
2321         Also, make sure we preserve the CurrentFunction in our recursive scopes.
2322         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
2323         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
2324         (WebCore::WHLSL::Parser::fail):
2325         (WebCore::WHLSL::Parser::peek):
2326         (WebCore::WHLSL::Parser::parseType):
2327         (WebCore::WHLSL::Parser::parseBuiltInSemantic):
2328         * Modules/webgpu/WHLSL/WHLSLParser.h:
2329         * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h:
2330         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
2331         (WebCore::WHLSL::prepareShared):
2332         (WebCore::WHLSL::prepare):
2333         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
2334         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp: Move big inline functions out-of-line.
2335         (WebCore::WHLSL::RecursiveTypeChecker::visit):
2336         (WebCore::WHLSL::checkRecursiveTypes):
2337         (): Deleted.
2338         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
2339         (WebCore::WHLSL::conversionCost):
2340         (WebCore::WHLSL::resolveFunctionOverloadImpl):
2341         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.h:
2342         * Modules/webgpu/WHLSL/WHLSLResolvingType.h:
2343         (WebCore::WHLSL::ResolvingType::ResolvingType):
2344         (WebCore::WHLSL::ResolvingType::operator=):
2345         (WebCore::WHLSL::ResolvingType::getUnnamedType):
2346         (WebCore::WHLSL::ResolvingType::visit):
2347         * Modules/webgpu/WHLSL/WHLSLScopedSetAdder.h: Renamed from Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLMappedBindings.h.
2348         (WebCore::WHLSL::ScopedSetAdder::ScopedSetAdder):
2349         (WebCore::WHLSL::ScopedSetAdder::~ScopedSetAdder):
2350         (WebCore::WHLSL::ScopedSetAdder::isNewEntry const):
2351         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp:
2352         (WebCore::WHLSL::isAcceptableFormat):
2353         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: Turns out a bunch of texture types don't exist in MSL.
2354         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
2355         (WebCore::WHLSL::synthesizeArrayOperatorLength):
2356         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.h:
2357         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: Adding to the program can fail.
2358         (WebCore::WHLSL::synthesizeConstructors): Some constructors shouldn't be generated for "void" and for atomic types.
2359         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.h: Adding to the program can fail.
2360         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp: Ditto.
2361         (WebCore::WHLSL::synthesizeEnumerationFunctions):
2362         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.h: Ditto.
2363         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp: Ditto.
2364         (WebCore::WHLSL::synthesizeStructureAccessors):
2365         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.h: Ditto.
2366         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
2367         (WebCore::WHLSL::Visitor::visit):
2368         * Modules/webgpu/WebGPUDevice.cpp: Add flag that triggers the WHLSL compiler.
2369         (WebCore::WebGPUDevice::createShaderModule const):
2370         * Modules/webgpu/WebGPUShaderModuleDescriptor.h: Ditto.
2371         * Modules/webgpu/WebGPUShaderModuleDescriptor.idl: Ditto.
2372         * WebCore.xcodeproj/project.pbxproj:
2373         * platform/graphics/gpu/GPUPipelineLayout.h:
2374         (WebCore::GPUPipelineLayout::bindGroupLayouts const):
2375         * platform/graphics/gpu/GPUShaderModule.h: Add a string that represents the WHLSL shader source. The compiler currently
2376         needs the rest of the pipeline state descriptor, so we defer compilation until create*Pipeline().
2377         (WebCore::GPUShaderModule::platformShaderModule const):
2378         (WebCore::GPUShaderModule::whlslSource const):
2379         * platform/graphics/gpu/GPUShaderModuleDescriptor.h:
2380         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Convert GPU types into WHLSL types, and invoke the compiler.
2381         (WebCore::convertVertexFormat):
2382         (WebCore::convertShaderStageFlags):
2383         (WebCore::convertBindingType):
2384         (WebCore::convertTextureFormat):
2385         (WebCore::convertLayout):
2386         (WebCore::convertRenderPipelineDescriptor):
2387         (WebCore::trySetMetalFunctionsForPipelineDescriptor):
2388         (WebCore::trySetWHLSLFunctionsForPipelineDescriptor):
2389         (WebCore::trySetFunctionsForPipelineDescriptor):
2390         (WebCore::tryCreateMtlRenderPipelineState):
2391         * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm:
2392         (WebCore::GPUShaderModule::create):
2393         (WebCore::GPUShaderModule::GPUShaderModule):
2394
2395 2019-03-18  Justin Fan  <justin_fan@apple.com>
2396
2397         [Web GPU] GPUAdapter.createDevice -> GPUAdapter.requestDevice
2398         https://bugs.webkit.org/show_bug.cgi?id=195781
2399
2400         Reviewed by Myles C. Maxfield.
2401
2402         A Web GPU device is now acquired via a promise returned from GPUAdapter.requestDevice().
2403
2404         Existing tests updated for new behavior.
2405
2406         * Modules/webgpu/WebGPUAdapter.cpp:
2407         (WebCore::WebGPUAdapter::requestDevice const):
2408         (WebCore::WebGPUAdapter::createDevice): Deleted.
2409         * Modules/webgpu/WebGPUAdapter.h:
2410         * Modules/webgpu/WebGPUAdapter.idl:
2411         * Modules/webgpu/WebGPUDevice.cpp:
2412         (WebCore::WebGPUDevice::tryCreate):
2413         (WebCore::WebGPUDevice::WebGPUDevice):
2414         (WebCore::WebGPUDevice::create): Deleted.
2415         * Modules/webgpu/WebGPUDevice.h:
2416         * platform/graphics/gpu/GPUDevice.h:
2417         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
2418         (WebCore::GPUDevice::tryCreate):
2419         (WebCore::GPUDevice::create): Deleted.
2420
2421 2019-03-18  Justin Fan  <justin_fan@apple.com>
2422
2423         [Web GPU] API updates: GPUTexture.createDefaultView and type-safe GPURenderPassEncoder.setPipeline
2424         https://bugs.webkit.org/show_bug.cgi?id=195896
2425
2426         Reviewed by Jon Lee.
2427
2428         Rename createDefaultTextureView -> createDefaultView and move setPipeline from GPUProgrammablePassEncoder to GPURenderPassEncoder.
2429
2430         Existing tests updated for createDefaultView name.
2431
2432         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
2433         (WebCore::WebGPUProgrammablePassEncoder::setPipeline): Deleted.
2434         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
2435         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
2436         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
2437         (WebCore::WebGPURenderPassEncoder::setPipeline):
2438         * Modules/webgpu/WebGPURenderPassEncoder.h:
2439         * Modules/webgpu/WebGPURenderPassEncoder.idl:
2440         * Modules/webgpu/WebGPUTexture.cpp:
2441         (WebCore::WebGPUTexture::createDefaultView):
2442         (WebCore::WebGPUTexture::createDefaultTextureView): Deleted.
2443         * Modules/webgpu/WebGPUTexture.h:
2444         * Modules/webgpu/WebGPUTexture.idl:
2445         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
2446         * platform/graphics/gpu/GPURenderPassEncoder.h:
2447
2448 2019-03-18  Chris Dumez  <cdumez@apple.com>
2449
2450         [iOS] The network process sometimes gets killed for trying to suspend while holding locked files
2451         https://bugs.webkit.org/show_bug.cgi?id=195890
2452         <rdar://problem/48934338>
2453
2454         Reviewed by Geoffrey Garen.
2455
2456         The network process sometimes gets killed for trying to suspend while holding locked files while
2457         under SQLiteDatabase::open(). The SQLiteDatabaseTracker normally keeps tracking of "transactions"
2458         in progress so we know that we're holding locked files and the WebSQLiteDatabaseTracker takes
2459         care of notifying the UIProcess via IPC that it should hold a background assertion on our behalf
2460         to avoid trying to suspend while holding locked files.
2461         However, we were missing a SQLiteTransactionInProgressAutoCounter when trying to execute the
2462         PRAGMA statement.
2463
2464         Note that we have a similar SQLiteTransactionInProgressAutoCounter in SQLiteDatabase::useWALJournalMode()
2465         when executing such PRAGMA statement already.
2466
2467         * platform/sql/SQLiteDatabase.cpp:
2468         (WebCore::SQLiteDatabase::open):
2469
2470 2019-03-18  Ryan Haddad  <ryanhaddad@apple.com>
2471
2472         Unreviewed, rolling out r243037.
2473
2474         Broke the Windows build
2475
2476         Reverted changeset:
2477
2478         "Reduce the size of Node::deref by eliminating an explicit
2479         parentNode check"
2480         https://bugs.webkit.org/show_bug.cgi?id=195776
2481         https://trac.webkit.org/changeset/243037
2482
2483 2019-03-18  Eric Carlson  <eric.carlson@apple.com>
2484
2485         Change some logging levels
2486         https://bugs.webkit.org/show_bug.cgi?id=195861
2487         <rdar://problem/48961669>
2488
2489         Reviewed by Jer Noble.
2490
2491         * Modules/mediastream/RTCPeerConnection.cpp:
2492         (WebCore::RTCPeerConnection::dispatchEvent):
2493         * Modules/webaudio/AudioNode.cpp:
2494         (WebCore::AudioNode::addInput):
2495         (WebCore::AudioNode::addOutput):
2496         (WebCore::AudioNode::connect):
2497         (WebCore::AudioNode::disconnect):
2498         * Modules/webaudio/AudioParam.cpp:
2499         (WebCore::AudioParam::connect):
2500         (WebCore::AudioParam::disconnect):
2501         * Modules/webaudio/WaveShaperNode.cpp:
2502         (WebCore::WaveShaperNode::setOversample):
2503         * html/HTMLMediaElement.cpp:
2504         (WebCore::HTMLMediaElement::canPlayType const):
2505         (WebCore::HTMLMediaElement::seekTask):
2506         (WebCore::HTMLMediaElement::dispatchEvent):
2507         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
2508         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
2509         (WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor):
2510         * html/track/InbandGenericTextTrack.cpp:
2511         (WebCore::InbandGenericTextTrack::addGenericCue):
2512         (WebCore::InbandGenericTextTrack::removeGenericCue):
2513         (WebCore::InbandGenericTextTrack::newCuesParsed):
2514         * html/track/InbandWebVTTTextTrack.cpp:
2515         (WebCore::InbandWebVTTTextTrack::newCuesParsed):
2516         * html/track/LoadableTextTrack.cpp:
2517         (WebCore::LoadableTextTrack::newCuesAvailable):
2518         * html/track/TextTrack.cpp:
2519         (WebCore::TextTrack::removeCue):
2520         * inspector/agents/WebConsoleAgent.cpp:
2521         (WebCore::WebConsoleAgent::getLoggingChannels):
2522         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
2523         (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings):
2524         (WebCore::InbandTextTrackPrivateAVF::removeCompletedCues):
2525         (WebCore::InbandTextTrackPrivateAVF::processNativeSamples):
2526         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2527         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
2528         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
2529         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
2530         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2531         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
2532         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
2533         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless const):
2534
2535 2019-03-15  Antoine Quint  <graouts@apple.com>
2536
2537         Make mouse event simulation a quirk
2538         https://bugs.webkit.org/show_bug.cgi?id=195218
2539         <rdar://problem/48516794>
2540
2541         Reviewed by Dean Jackson.
2542
2543         Add new quirks to control whether we should dispatch simulated mouse events and whether we should assume
2544         preventDefault() was called when a simulated "mousemove" event was handled. Currently both return false
2545         but will be made to return more interesting results as we determine heuristics or specific sites that
2546         may require such quirks.
2547
2548         * page/Quirks.cpp:
2549         (WebCore::Quirks::shouldDispatchSimulateMouseEvents const):
2550         (WebCore::Quirks::shouldMousemoveEventHandlingPreventDefault const):
2551         * page/Quirks.h:
2552
2553 2019-03-18  Philippe Normand  <pnormand@igalia.com>
2554
2555         [GStreamer] Rewrite HTTP source element using pushsrc base class
2556         https://bugs.webkit.org/show_bug.cgi?id=195631
2557
2558         Reviewed by Xabier Rodriguez-Calvar.
2559
2560         If we want to use webkitwebsrc in adaptivedemux (HLS, DASH, etc)
2561         we need a source element that behaves like souphttpsrc, which is
2562         implemented using pushsrc. This rewrite might also fix some seek
2563         issues.
2564
2565         No new tests, existing http/tests/media tests cover this patch.
2566
2567         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2568         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2569         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2570         (webkit_web_src_class_init):
2571         (webkitWebSrcReset):
2572         (webkit_web_src_init):
2573         (webKitWebSrcCreate):
2574         (webKitWebSrcStart):
2575         (webKitWebSrcCloseSession):
2576         (webKitWebSrcStop):
2577         (webKitWebSrcGetSize):
2578         (webKitWebSrcIsSeekable):
2579         (webKitWebSrcDoSeek):
2580         (webKitWebSrcQuery):
2581         (webKitWebSrcUnLock):
2582         (webKitWebSrcUnLockStop):
2583         (webKitWebSrcChangeState):
2584         (CachedResourceStreamingClient::checkUpdateBlocksize):
2585         (CachedResourceStreamingClient::responseReceived):
2586         (CachedResourceStreamingClient::dataReceived):
2587         (CachedResourceStreamingClient::accessControlCheckFailed):
2588         (CachedResourceStreamingClient::loadFailed):
2589         (CachedResourceStreamingClient::loadFinished):
2590         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
2591
2592 2019-03-18  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2593
2594         [WPE][GTK] Fix a build warning because of missing to handle an enum value
2595         https://bugs.webkit.org/show_bug.cgi?id=195876
2596
2597         Reviewed by Žan Doberšek.
2598
2599         When building WPE or GTK port, there is a build warning. The switch-case needs to
2600         handle *Positioned* enum value as well in order to avoid the build warning.
2601
2602         * page/scrolling/nicosia/ScrollingTreeNicosia.cpp:
2603         (WebCore::ScrollingTreeNicosia::createScrollingTreeNode): Add case ScrollingNodeType::Positioned.
2604
2605 2019-03-17  Yusuke Suzuki  <ysuzuki@apple.com>
2606
2607         REGRESSION: !vm.isInitializingObject() void* JSC::tryAllocateCellHelper<JSC::Structure> JSC::Structure::create
2608         https://bugs.webkit.org/show_bug.cgi?id=195858
2609
2610         Reviewed by Mark Lam.
2611
2612         Changed the accessor names.
2613
2614         * bindings/js/SerializedScriptValue.cpp:
2615         (WebCore::CloneDeserializer::readTerminal):
2616
2617 2019-03-16  Darin Adler  <darin@apple.com>
2618
2619         Improve normalization code, including moving from unorm.h to unorm2.h
2620         https://bugs.webkit.org/show_bug.cgi?id=195330
2621
2622         Reviewed by Michael Catanzaro.
2623
2624         * editing/TextIterator.cpp: Include unorm2.h.
2625         (WebCore::normalizeCharacters): Rewrote to use unorm2_normalize rather than
2626         unorm_normalize, but left the logic otherwise the same.
2627
2628         * platform/graphics/SurrogatePairAwareTextIterator.cpp: Include unorm2.h.
2629         (WebCore::SurrogatePairAwareTextIterator::normalizeVoicingMarks):
2630         Use unorm2_composePair instead of unorm_normalize.
2631
2632         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
2633         (characterSequenceIsEmoji): Changed to use existing SurrogatePairAwareTextIterator.
2634         (FontCascade::fontForCombiningCharacterSequence): Use normalizedNFC instead of
2635         calling unorm2_normalize directly.
2636
2637         * WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2638         Removed unneeded include of <unicode/normlzr.h>.
2639
2640         * platform/text/TextEncoding.cpp:
2641         (WebCore::TextEncoding::encode const): Use normalizedNFC instead of the
2642         code that was here. The normalizedNFC function is better in multiple ways,
2643         but primarily it handles 8-bit strings and other already-normalized
2644         strings much more efficiently.
2645
2646 2019-03-16  Jer Noble  <jer.noble@apple.com>
2647
2648         Unreviewed unified-build fix; GPUBindGroupMetal uses symbols from the Metal.framework; it should import it.
2649
2650         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
2651
2652 2019-03-16  Jer Noble  <jer.noble@apple.com>
2653
2654         Add a new MediaCapabilitiesExtensionsEnabled setting
2655         https://bugs.webkit.org/show_bug.cgi?id=195843
2656
2657         Reviewed by Geoffrey Garen.
2658
2659         Add a new setting, MediaCapabilitiesExtensionsEnabled, which controls whether extensions
2660         to the Media Capabilities API are available.
2661
2662         Drive-by fix: make sure that the configuration is passed through to MediaCapabilitiesInfo
2663         when no factory can support the configuration.
2664
2665         * Modules/mediacapabilities/MediaCapabilitiesDecodingInfo.idl:
2666         * Modules/mediacapabilities/MediaCapabilitiesEncodingInfo.idl:
2667         * bindings/scripts/CodeGeneratorJS.pm:
2668         (GenerateDictionaryImplementationContent):
2669         * bindings/scripts/IDLAttributes.json:
2670         * page/Settings.yaml:
2671         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
2672         (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
2673
2674 2019-03-16  Zalan Bujtas  <zalan@apple.com>
2675
2676         [iOS] Unable to close trending window on naver.com.
2677         https://bugs.webkit.org/show_bug.cgi?id=195842
2678         <rdar://problem/48067338>
2679
2680         This patch issues a synthetic mouse move to the tap location after we decided to hover.
2681         It ensures that the node under the mouse is up-to-date and when a new tap comes in we can
2682         send the mouseout event to the correct node. It fixes the case when the hover content is positioned over
2683         the tap target so that the tap target is no longer "under the mouse".
2684         On desktop this "transition" happens automatically since the mouse is always present. 
2685
2686         Reviewed by Simon Fraser.
2687
2688         Tests: fast/events/touch/ios/content-observation/new-content-covers-tap-target.html
2689                fast/events/touch/ios/content-observation/prevent-default-on-touch-start.html
2690
2691         * page/EventHandler.h:
2692         * page/ios/EventHandlerIOS.mm:
2693         (WebCore::EventHandler::dispatchSyntheticMouseMove):
2694
2695 2019-03-16  Sihui Liu  <sihui_liu@apple.com>
2696
2697         Layout tests imported/w3c/web-platform-tests/IndexedDB/*-exception-order.html are failing
2698         https://bugs.webkit.org/show_bug.cgi?id=195650
2699
2700         Reviewed by Ryosuke Niwa.
2701
2702         Fix some exception orders in IDB.
2703
2704         * Modules/indexeddb/IDBDatabase.cpp:
2705         (WebCore::IDBDatabase::createObjectStore):
2706         Step 6 of https://www.w3.org/TR/IndexedDB-2/#dom-idbdatabase-createobjectstore.
2707
2708         (WebCore::IDBDatabase::transaction):
2709         Step 1 of https://www.w3.org/TR/IndexedDB-2/#dom-idbdatabase-transaction.
2710
2711         * Modules/indexeddb/IDBIndex.cpp:
2712         (WebCore::IDBIndex::doOpenCursor):
2713         (WebCore::IDBIndex::openCursor):
2714         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-opencursor.
2715
2716         (WebCore::IDBIndex::doOpenKeyCursor):
2717         (WebCore::IDBIndex::openKeyCursor):
2718         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-openkeycursor.
2719
2720         (WebCore::IDBIndex::count):
2721         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-count.
2722
2723         (WebCore::IDBIndex::doCount):
2724         (WebCore::IDBIndex::get):
2725         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-get.
2726
2727         (WebCore::IDBIndex::doGet):
2728         (WebCore::IDBIndex::getKey):
2729         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-getkey.
2730
2731         (WebCore::IDBIndex::doGetKey):
2732         (WebCore::IDBIndex::doGetAll):
2733         (WebCore::IDBIndex::getAll):
2734         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-getkey.
2735         (WebCore::IDBIndex::doGetAllKeys):
2736         (WebCore::IDBIndex::getAllKeys):
2737         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-getallkeys.
2738
2739         * Modules/indexeddb/IDBIndex.h:
2740         * Modules/indexeddb/IDBObjectStore.cpp:
2741         (WebCore::IDBObjectStore::doOpenCursor):
2742         (WebCore::IDBObjectStore::openCursor):
2743         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-opencursor.
2744
2745         (WebCore::IDBObjectStore::doOpenKeyCursor):
2746         (WebCore::IDBObjectStore::openKeyCursor):
2747         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-openkeycursor.
2748
2749         (WebCore::IDBObjectStore::deleteFunction):
2750         (WebCore::IDBObjectStore::doDelete):
2751         (WebCore::IDBObjectStore::count):
2752         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-count.
2753
2754         (WebCore::IDBObjectStore::doCount):
2755         (WebCore::IDBObjectStore::doGetAll):
2756         (WebCore::IDBObjectStore::getAll):
2757         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-getall.
2758
2759         (WebCore::IDBObjectStore::doGetAllKeys):
2760         (WebCore::IDBObjectStore::getAllKeys):
2761         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-getallkeys.
2762         * Modules/indexeddb/IDBObjectStore.h:
2763
2764 2019-03-16  Ryosuke Niwa  <rniwa@webkit.org>
2765
2766         Reduce the size of Node::deref by eliminating an explicit parentNode check
2767         https://bugs.webkit.org/show_bug.cgi?id=195776
2768
2769         Reviewed by Geoffrey Garen.
2770
2771         This patch eliminates the nullity check of m_parentNode in Node::deref as well as the store to
2772         m_refCount in the case of invoking Node::removedLastRef() as done for RefCounted in r30042.
2773         Together, this patch shrinks WebCore's size by 46KB or ~0.7%.
2774
2775         To do this, we take we take a similar approach as WTF::String by using the lowest bit of m_refCount
2776         to indicate whether a node has a parent or not. Regular ref-counting is done on the upper 31 bits.
2777         Node::setParentNode updates this flag, and Node::deref() would only `delete this` if m_refCount
2778         is identically equal to 0.
2779
2780         For a Document, we set m_refCounted to 0 before in the case of non-zero m_referencingNodeCount
2781         since decrementReferencingNodeCount needs to be able to tell if there is an outstanding Ref/RefPtr
2782         or not when m_referencingNodeCount becomes 0.
2783
2784         No new tests since there should be no behavioral change.
2785
2786         * dom/Document.cpp:
2787         (WebCore::Document::removedLastRef):
2788         * dom/Document.h:
2789         (WebCore::Document::decrementReferencingNodeCount):
2790         * dom/Node.cpp:
2791         (WebCore::Node::Node): Moved the initialization of m_refCount to the member variable declaration.
2792         (WebCore::Node::~Node):
2793         (WebCore::Node::removedLastRef):
2794         * dom/Node.h:
2795         (WebCore::Node): Changed the type of m_refCount from signed int to uint32_t. It was changed from
2796         unsigned int to signed int back in r11492 but I don't think the signedness is needed.
2797         (WebCore::Node::ref): Increment the ref count by 2 (upper 31-bit).
2798         (WebCore::Node::deref): Implemented the optimization. This is what shrinks the WebCore binary size.
2799         (WebCore::Node::hasOneRef const):
2800         (WebCore::Node::refCount const): Ignore the lowest bit. Without this fix, the optimization in
2801         replaceChildrenWithFragment to avoid replacing the text node is disabled whenever there is a parent.
2802         (WebCore::Node::setParentNode): Sets the lowest bit to 1 if the node has a parent and 0 otherwise.
2803
2804 2019-03-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
2805
2806         Remove the SVG property tear off objects for SVGAnimatedInteger
2807         https://bugs.webkit.org/show_bug.cgi?id=195722
2808
2809         Reviewed by Simon Fraser.
2810
2811         Instead of saving a raw integer value in the SVGElement and then wrapping
2812         the pointer to this raw data in a tear off object, we will represent the
2813         integer as Ref<SVGAnimatedInteger> in SVGElement. This will make the 
2814         representation of the property in IDL file match the C++ header file.
2815
2816         When the DOM requests the SVGAnimatedInteger, we get return a reference
2817         to the new animated property. When the rendering code asks for the current
2818         value of the this animated property, we return the animVal() or the
2819         baseVal() depending on whether the property is animating or not.
2820
2821         A pointer to a member in the SVGElement will be registered along with the
2822         associated attribute name in SVGPropertyRegistry. Registering the property
2823         creates an SVGMemberAccessor and links to the associated attribute. The
2824         function of SVGMemberAccessor is to retrieve the value of the property
2825         given a pointer to an SVGElement.
2826
2827         SVGPropertyRegistry manages all the properties of SVGElement. It takes
2828         into account the inherited properties as well.
2829
2830         SVGElement will have a virtual method called propertyRegistry(). Every
2831         superclass will override this method to return a reference to its registry
2832         which includes all the registered properties of this class and its bases.
2833
2834         One important function of the SVGPropertyRegistry and SVGAccessor is they
2835         create the appropriate SVGAttributeAnimator for this property.
2836
2837         SVGAttributeAnimator is just a connection between the animated property
2838         and SVGAnimationFunction. SVGAnimationFunction calculates the values of
2839         the animated property within a time interval. SVGAnimatedPropertyAnimator
2840         updates animVal of the animated property and invalidates the associated
2841         SVGElement and all the instances that references this element.
2842
2843         The plan is to remove all the SVG tear off objects like what this patch
2844         does for SVGAnimatedInteger. So for a period of time the old code and the
2845         new code will co-exist together. These things to consider when reviewing
2846         this patch:
2847
2848         -- SVGAnimatedElementBase was re-factored to use SVGAttributeAnimationControllerBase
2849         which is inherited by SVGLegacyAttributeAnimationController and
2850         SVGAttributeAnimationController. The tear-off properties code which uses
2851         SVGAnimatedType now lives in SVGLegacyAttributeAnimationController. The
2852         new code was added to SVGAttributeAnimationController. The plan is to 
2853         remove the three animation controllers and to move the code of
2854         SVGAttributeAnimationController to SVGAnimatedElementBase when all the tear
2855         off code is removed.
2856
2857         -- SVGElement now keeps two registries one for the tear-off world and the
2858         other for the new world. Eventually we need to get rid of tear-off registry.
2859
2860         -- SVGElement will differentiate between the type of the property by the
2861         the method isAnimatedAttribute().
2862
2863         * Sources.txt:
2864         * WebCore.xcodeproj/project.pbxproj:
2865         * bindings/scripts/CodeGeneratorJS.pm:
2866         (GenerateHeader):
2867         * svg/SVGAnimateElementBase.cpp:
2868         (WebCore::SVGAnimateElementBase::SVGAnimateElementBase):
2869         (WebCore::SVGAnimateElementBase::attributeAnimationController):
2870         (WebCore::SVGAnimateElementBase::attributeAnimationControllerIfExists):
2871         (WebCore::SVGAnimateElementBase::hasValidAttributeType const):
2872         (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType const):
2873         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
2874         (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):
2875         (WebCore::SVGAnimateElementBase::calculateFromAndToValues):
2876         (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
2877         (WebCore::SVGAnimateElementBase::resetAnimatedType):
2878         (WebCore::SVGAnimateElementBase::clearAnimatedType):
2879         (WebCore::SVGAnimateElementBase::applyResultsToTarget):
2880         (WebCore::SVGAnimateElementBase::isAdditive const):
2881         (WebCore::SVGAnimateElementBase::calculateDistance):
2882         (WebCore::SVGAnimateElementBase::setTargetElement):
2883         (WebCore::SVGAnimateElementBase::setAttributeName):
2884         (WebCore::SVGAnimateElementBase::resetAnimation):
2885         (WebCore::SVGAnimateElementBase::hasInvalidCSSAttributeType const):
2886         (WebCore::SVGAnimateElementBase::hasValidAttributeType): Deleted.
2887         (WebCore::propertyTypesAreConsistent): Deleted.
2888         (WebCore::applyCSSPropertyToTarget): Deleted.
2889         (WebCore::removeCSSPropertyFromTarget): Deleted.
2890         (WebCore::applyCSSPropertyToTargetAndInstances): Deleted.
2891         (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted.
2892         (WebCore::notifyTargetAboutAnimValChange): Deleted.
2893         (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted.
2894         (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition const): Deleted.
2895         (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): Deleted.
2896         (WebCore::SVGAnimateElementBase::ensureAnimator): Deleted.
2897         * svg/SVGAnimateElementBase.h:
2898         * svg/SVGAnimateMotionElement.cpp:
2899         (WebCore::SVGAnimateMotionElement::hasValidAttributeType const):
2900         (WebCore::SVGAnimateMotionElement::hasValidAttributeName const):
2901         (WebCore::SVGAnimateMotionElement::hasValidAttributeType): Deleted.
2902         (WebCore::SVGAnimateMotionElement::hasValidAttributeName): Deleted.
2903         * svg/SVGAnimateMotionElement.h:
2904         * svg/SVGAnimateTransformElement.cpp:
2905         (WebCore::SVGAnimateTransformElement::hasValidAttributeType const):
2906         (WebCore::SVGAnimateTransformElement::hasValidAttributeType): Deleted.
2907         * svg/SVGAnimateTransformElement.h:
2908         * svg/SVGAnimatedInteger.cpp: Removed.
2909         * svg/SVGAnimatedInteger.h: Removed.
2910         * svg/SVGAnimatedIntegerOptionalInteger.cpp: Removed.
2911         * svg/SVGAnimatedIntegerOptionalInteger.h: Removed.
2912         * svg/SVGAnimatedPointList.h:
2913         * svg/SVGAnimationElement.cpp:
2914         (WebCore::SVGAnimationElement::setAttributeType):
2915         (WebCore::SVGAnimationElement::resetAnimation):
2916         (WebCore::SVGAnimationElement::resetAnimatedPropertyType): Deleted.
2917         (WebCore::SVGAnimationElement::setTargetElement): Deleted.
2918         (WebCore::SVGAnimationElement::checkInvalidCSSAttributeType): Deleted.
2919         * svg/SVGAnimationElement.h:
2920         (WebCore::SVGAnimationElement::attributeType const):
2921         (WebCore::SVGAnimationElement::hasInvalidCSSAttributeType const): Deleted.
2922         * svg/SVGAnimatorFactory.h:
2923         (WebCore::SVGAnimatorFactory::create):
2924         * svg/SVGAttributeAnimationController.cpp: Added.
2925         (WebCore::SVGAttributeAnimationController::SVGAttributeAnimationController):
2926         (WebCore::SVGAttributeAnimationController::animator const):
2927         (WebCore::SVGAttributeAnimationController::isDiscreteAnimator const):
2928         (WebCore::SVGAttributeAnimationController::isAdditive const):
2929         (WebCore::SVGAttributeAnimationController::hasValidAttributeType const):
2930         (WebCore::SVGAttributeAnimationController::calculateFromAndToValues):
2931         (WebCore::SVGAttributeAnimationController::calculateFromAndByValues):
2932         (WebCore::SVGAttributeAnimationController::calculateToAtEndOfDurationValue):
2933         (WebCore::SVGAttributeAnimationController::resetAnimatedType):
2934         (WebCore::SVGAttributeAnimationController::calculateAnimatedValue):
2935         (WebCore::SVGAttributeAnimationController::applyResultsToTarget):
2936         (WebCore::SVGAttributeAnimationController::clearAnimatedType):
2937         (WebCore::SVGAttributeAnimationController::calculateDistance):
2938         * svg/SVGAttributeAnimationController.h: Added.
2939         (WebCore::SVGAttributeAnimationController::animatorIfExists const):
2940         * svg/SVGAttributeAnimationControllerBase.cpp: Added.
2941         (WebCore::SVGAttributeAnimationControllerBase::SVGAttributeAnimationControllerBase):
2942         (WebCore::SVGAttributeAnimationControllerBase::determineAnimatedPropertyType):
2943         * svg/SVGAttributeAnimationControllerBase.h: Added.
2944         * svg/SVGElement.cpp:
2945         (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute):
2946         (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const):
2947         (WebCore::SVGElement::commitPropertyChange):
2948         (WebCore::SVGElement::isAnimatedPropertyAttribute const):
2949         (WebCore::SVGElement::isAnimatedAttribute const):
2950         (WebCore::SVGElement::createAnimator):
2951         * svg/SVGElement.h:
2952         (WebCore::SVGElement::propertyRegistry const):
2953         * svg/SVGFEConvolveMatrixElement.cpp:
2954         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
2955         (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
2956         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
2957         (WebCore::SVGFEConvolveMatrixElement::setOrder):
2958         (WebCore::SVGFEConvolveMatrixElement::orderXIdentifier): Deleted.
2959         (WebCore::SVGFEConvolveMatrixElement::orderYIdentifier): Deleted.
2960         * svg/SVGFEConvolveMatrixElement.h:
2961         * svg/SVGFETurbulenceElement.cpp:
2962         (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
2963         (WebCore::SVGFETurbulenceElement::registerAttributes):
2964         (WebCore::SVGFETurbulenceElement::parseAttribute):
2965         (WebCore::SVGFETurbulenceElement::svgAttributeChanged):
2966         * svg/SVGFETurbulenceElement.h:
2967         * svg/SVGFilterElement.h:
2968         * svg/SVGLegacyAttributeAnimationController.cpp: Added.
2969         (WebCore::SVGLegacyAttributeAnimationController::SVGLegacyAttributeAnimationController):
2970         (WebCore::SVGLegacyAttributeAnimationController::animatedTypeAnimator):
2971         (WebCore::SVGLegacyAttributeAnimationController::isAdditive const):
2972         (WebCore::SVGLegacyAttributeAnimationController::hasValidAttributeType const):
2973         (WebCore::SVGLegacyAttributeAnimationController::calculateFromAndToValues):
2974         (WebCore::SVGLegacyAttributeAnimationController::calculateFromAndByValues):
2975         (WebCore::SVGLegacyAttributeAnimationController::calculateToAtEndOfDurationValue):
2976         (WebCore::propertyTypesAreConsistent):
2977         (WebCore::SVGLegacyAttributeAnimationController::resetAnimatedType):
2978         (WebCore::SVGLegacyAttributeAnimationController::calculateAnimatedValue):
2979         (WebCore::applyCSSPropertyToTarget):
2980         (WebCore::removeCSSPropertyFromTarget):
2981         (WebCore::applyCSSPropertyToTargetAndInstances):
2982         (WebCore::removeCSSPropertyFromTargetAndInstances):
2983         (WebCore::notifyTargetAboutAnimValChange):
2984         (WebCore::notifyTargetAndInstancesAboutAnimValChange):
2985         (WebCore::SVGLegacyAttributeAnimationController::applyResultsToTarget):
2986         (WebCore::SVGLegacyAttributeAnimationController::clearAnimatedType):
2987         (WebCore::SVGLegacyAttributeAnimationController::calculateDistance):
2988         * svg/SVGLegacyAttributeAnimationController.h: Added.
2989         * svg/animation/SVGSMILElement.cpp:
2990         (WebCore::SVGSMILElement::hasValidAttributeName const):
2991         (WebCore::SVGSMILElement::hasValidAttributeName): Deleted.
2992         * svg/animation/SVGSMILElement.h:
2993         * svg/properties/SVGAnimatedPrimitiveProperty.h: Added.
2994         (WebCore::SVGAnimatedPrimitiveProperty::create):
2995         (WebCore::SVGAnimatedPrimitiveProperty::setBaseVal):
2996         (WebCore::SVGAnimatedPrimitiveProperty::setBaseValInternal):
2997         (WebCore::SVGAnimatedPrimitiveProperty::baseVal const):
2998         (WebCore::SVGAnimatedPrimitiveProperty::setAnimVal):
2999         (WebCore::SVGAnimatedPrimitiveProperty::animVal const):
3000         (WebCore::SVGAnimatedPrimitiveProperty::animVal):
3001         (WebCore::SVGAnimatedPrimitiveProperty::currentValue const):
3002         (WebCore::SVGAnimatedPrimitiveProperty::SVGAnimatedPrimitiveProperty):
3003         * svg/properties/SVGAnimatedProperty.cpp: Added.
3004         (WebCore::SVGAnimatedProperty::owner const):
3005         (WebCore::SVGAnimatedProperty::commitPropertyChange):
3006         * svg/properties/SVGAnimatedProperty.h: Added.
3007         (WebCore::SVGAnimatedProperty::isAttached const):
3008         (WebCore::SVGAnimatedProperty::detach):
3009         (WebCore::SVGAnimatedProperty::contextElement const):
3010         (WebCore::SVGAnimatedProperty::baseValAsString const):
3011         (WebCore::SVGAnimatedProperty::animValAsString const):
3012         (WebCore::SVGAnimatedProperty::isDirty const):
3013         (WebCore::SVGAnimatedProperty::setDirty):
3014         (WebCore::SVGAnimatedProperty::synchronize):
3015         (WebCore::SVGAnimatedProperty::isAnimating const):
3016         (WebCore::SVGAnimatedProperty::startAnimation):
3017         (WebCore::SVGAnimatedProperty::stopAnimation):
3018         (WebCore::SVGAnimatedProperty::instanceStartAnimation):
3019         (WebCore::SVGAnimatedProperty::instanceStopAnimation):
3020         (WebCore::SVGAnimatedProperty::SVGAnimatedProperty):
3021         * svg/properties/SVGAnimatedPropertyAccessor.h: Added.
3022         * svg/properties/SVGAnimatedPropertyAccessorImpl.h: Added.
3023         * svg/properties/SVGAnimatedPropertyAnimator.h: Added.
3024         (WebCore::SVGAnimatedPropertyAnimator::appendAnimatedInstance):
3025         (WebCore::SVGAnimatedPropertyAnimator::SVGAnimatedPropertyAnimator):
3026         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h: Added.
3027         * svg/properties/SVGAnimatedPropertyImpl.h: Added.
3028         * svg/properties/SVGAnimatedPropertyPairAccessor.h: Added.
3029         (WebCore::SVGAnimatedPropertyPairAccessor::SVGAnimatedPropertyPairAccessor):
3030         (WebCore::SVGAnimatedPropertyPairAccessor::singleton):
3031         (WebCore::SVGAnimatedPropertyPairAccessor::property1 const):
3032         (WebCore::SVGAnimatedPropertyPairAccessor::property2 const):
3033         * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h: Added.
3034         * svg/properties/SVGAnimatedPropertyPairAnimator.h: Added.
3035         (WebCore::SVGAnimatedPropertyPairAnimator::appendAnimatedInstance):
3036         (WebCore::SVGAnimatedPropertyPairAnimator::SVGAnimatedPropertyPairAnimator):
3037         * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h: Added.
3038         * svg/properties/SVGAnimationAdditiveFunction.h: Added.
3039         (WebCore::SVGAnimationAdditiveFunction::SVGAnimationAdditiveFunction):
3040         (WebCore::SVGAnimationAdditiveFunction::progress):
3041         * svg/properties/SVGAnimationAdditiveValueFunction.h: Added.
3042         (WebCore::SVGAnimationAdditiveValueFunction::toAtEndOfDuration const):
3043         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: Added.
3044         (WebCore::SVGAnimationIntegerFunction::progress):
3045         * svg/properties/SVGAnimationFunction.h: Added.
3046         (WebCore::SVGAnimationFunction::isDiscrete const):
3047         (WebCore::SVGAnimationFunction::calculateDistance const):
3048         (WebCore::SVGAnimationFunction::SVGAnimationFunction):
3049         (WebCore::SVGAnimationFunction::addFromAndToValues):
3050         * svg/properties/SVGAttributeAnimator.cpp: Added.
3051         (WebCore::SVGAttributeAnimator::applyAnimatedPropertyChange):
3052         * svg/properties/SVGAttributeAnimator.h: Added.
3053         (WebCore::SVGAttributeAnimator::SVGAttributeAnimator):
3054         (WebCore::SVGAttributeAnimator::isDiscrete const):
3055         (WebCore::SVGAttributeAnimator::setFromAndToValues):
3056         (WebCore::SVGAttributeAnimator::setFromAndByValues):
3057         (WebCore::SVGAttributeAnimator::setToAtEndOfDurationValue):
3058         (WebCore::SVGAttributeAnimator::calculateDistance const):
3059         * svg/properties/SVGAttributeOwnerProxy.cpp:
3060         * svg/properties/SVGAttributeOwnerProxy.h:
3061         * svg/properties/SVGAttributeRegistry.h:
3062         * svg/properties/SVGMemberAccessor.h: Added.
3063         (WebCore::SVGMemberAccessor::detach const):
3064         (WebCore::SVGMemberAccessor::isAnimatedProperty const):
3065         (WebCore::SVGMemberAccessor::isAnimatedLength const):
3066         (WebCore::SVGMemberAccessor::matches const):
3067         (WebCore::SVGMemberAccessor::synchronize const):
3068         (WebCore::SVGMemberAccessor::createAnimator const):
3069         (WebCore::SVGMemberAccessor::appendAnimatedInstance const):
3070         * svg/properties/SVGPointerMemberAccessor.h: Added.
3071         (WebCore::SVGPointerMemberAccessor::SVGPointerMemberAccessor):
3072         (WebCore::SVGPointerMemberAccessor::property const):
3073         (WebCore::SVGPointerMemberAccessor::singleton):
3074         * svg/properties/SVGProperty.h: Added.
3075         * svg/properties/SVGPropertyOwner.h: Added.
3076         (WebCore::SVGPropertyOwner::owner const):
3077         (WebCore::SVGPropertyOwner::attributeContextElement const):
3078         (WebCore::SVGPropertyOwner::commitPropertyChange):
3079         * svg/properties/SVGPropertyOwnerRegistry.h: Added.
3080         (WebCore::SVGPropertyOwnerRegistry::SVGPropertyOwnerRegistry):
3081         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
3082         (WebCore::SVGPropertyOwnerRegistry::enumerateRecursively):
3083         (WebCore::SVGPropertyOwnerRegistry::isKnownAttribute):
3084         (WebCore::SVGPropertyOwnerRegistry::enumerateRecursivelyBaseTypes):
3085         (WebCore::SVGPropertyOwnerRegistry::findAccessor):
3086         * svg/properties/SVGPropertyRegistry.h: Added.
3087
3088 2019-03-16  Ryosuke Niwa  <rniwa@webkit.org>
3089
3090         Remove LayoutAssertionDisableScope after r241289
3091         https://bugs.webkit.org/show_bug.cgi?id=195848
3092
3093         Reviewed by Antti Koivisto.
3094
3095         Remove LayoutAssertionDisableScope for good now that the underlying bug has been fixed in r241289.
3096
3097         * dom/Document.cpp:
3098         (WebCore::isSafeToUpdateStyleOrLayout):
3099         * dom/ScriptDisallowedScope.h:
3100         (WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope): Deleted.
3101         * page/FrameViewLayoutContext.cpp:
3102         (WebCore::FrameViewLayoutContext::layout):
3103
3104 2019-03-15  Eric Carlson  <eric.carlson@apple.com>
3105
3106         Add media stream release logging
3107         https://bugs.webkit.org/show_bug.cgi?id=195823
3108         <rdar://problem/48939406>
3109
3110         Reviewed by Youenn Fablet.
3111
3112         No new tests, no behavioral change.
3113
3114         * Modules/mediastream/MediaStream.cpp:
3115         (WebCore::MediaStream::MediaStream):
3116         (WebCore::MediaStream::clone):
3117         (WebCore::MediaStream::addTrack):
3118         (WebCore::MediaStream::removeTrack):
3119         (WebCore::MediaStream::addTrackFromPlatform):
3120         (WebCore::MediaStream::setIsActive):
3121         (WebCore::MediaStream::mediaCanStart):
3122         (WebCore::MediaStream::startProducingData):
3123         (WebCore::MediaStream::stopProducingData):
3124         (WebCore::MediaStream::endCaptureTracks):
3125         (WebCore::MediaStream::stop):
3126         (WebCore::MediaStream::logChannel const):
3127         * Modules/mediastream/MediaStream.h:
3128         * Modules/mediastream/MediaStreamTrack.cpp:
3129         (WebCore::MediaStreamTrack::MediaStreamTrack):
3130         (WebCore::MediaStreamTrack::logChannel const):
3131         * Modules/mediastream/MediaStreamTrack.h:
3132         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3133         (WebCore::LibWebRTCMediaEndpoint::addTrack):
3134         (WebCore::LibWebRTCMediaEndpoint::sourceFromNewReceiver):
3135         * Modules/webaudio/AudioContext.cpp:
3136         (WebCore::AudioContext::AudioContext):
3137         (WebCore::nextLogIdentifier): Deleted.
3138         * html/HTMLMediaElement.cpp:
3139         (WebCore::HTMLMediaElement::HTMLMediaElement):
3140         (WebCore::nextLogIdentifier): Deleted.
3141         * html/HTMLMediaElement.h:
3142         * platform/audio/PlatformMediaSession.cpp:
3143         (WebCore::PlatformMediaSession::PlatformMediaSession):
3144         (WebCore::nextLogIdentifier): Deleted.
3145         * platform/audio/PlatformMediaSession.h:
3146         * platform/graphics/IntSize.cpp:
3147         (WebCore::IntSize::toJSONObject const):
3148         (WebCore::IntSize::toJSONString const):
3149         * platform/graphics/IntSize.h:
3150         (WTF::LogArgument<WebCore::IntSize>::toString):
3151         * platform/mediastream/MediaStreamPrivate.cpp:
3152         (WebCore::MediaStreamPrivate::addTrack):
3153         (WebCore::MediaStreamPrivate::removeTrack):
3154         (WebCore::MediaStreamPrivate::startProducingData):
3155         (WebCore::MediaStreamPrivate::stopProducingData):
3156         (WebCore::MediaStreamPrivate::setCaptureTracksMuted):
3157         (WebCore::MediaStreamPrivate::trackMutedChanged):
3158         (WebCore::MediaStreamPrivate::trackEnabledChanged):
3159         (WebCore::MediaStreamPrivate::trackStarted):
3160         (WebCore::MediaStreamPrivate::trackEnded):
3161         (WebCore::MediaStreamPrivate::setLogger):
3162         (WebCore::MediaStreamPrivate::logChannel const):
3163         * platform/mediastream/MediaStreamPrivate.h:
3164         * platform/mediastream/MediaStreamTrackPrivate.cpp:
3165         (WebCore::MediaStreamTrackPrivate::setLogger):
3166         (WebCore::MediaStreamTrackPrivate::logChannel const):
3167         * platform/mediastream/MediaStreamTrackPrivate.h:
3168         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
3169         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
3170         (WebCore::RealtimeIncomingAudioSource::logChannel const): Deleted.
3171         (WebCore::RealtimeIncomingAudioSource::logger const): Deleted.
3172         * platform/mediastream/RealtimeIncomingAudioSource.h:
3173         (WebCore::RealtimeIncomingAudioSource::setLogger): Deleted.
3174         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
3175         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
3176         (WebCore::RealtimeIncomingVideoSource::logChannel const): Deleted.
3177         (WebCore::RealtimeIncomingVideoSource::logger const): Deleted.
3178         * platform/mediastream/RealtimeIncomingVideoSource.h:
3179         (WebCore::RealtimeIncomingVideoSource::setLogger): Deleted.
3180         * platform/mediastream/RealtimeMediaSource.cpp:
3181         (WebCore::RealtimeMediaSource::RealtimeMediaSource):
3182         (WebCore::RealtimeMediaSource::setInterrupted):
3183         (WebCore::RealtimeMediaSource::setMuted):
3184         (WebCore::RealtimeMediaSource::notifyMutedChange):
3185         (WebCore::RealtimeMediaSource::notifySettingsDidChangeObservers):
3186         (WebCore::RealtimeMediaSource::videoSampleAvailable):
3187         (WebCore::RealtimeMediaSource::start):
3188         (WebCore::RealtimeMediaSource::stop):
3189         (WebCore::RealtimeMediaSource::captureFailed):
3190         (WebCore::RealtimeMediaSource::applyConstraint):
3191         (WebCore::RealtimeMediaSource::supportsConstraints):
3192         (WebCore::RealtimeMediaSource::applyConstraints):
3193         (WebCore::RealtimeMediaSource::setSize):
3194         (WebCore::RealtimeMediaSource::setIntrinsicSize):
3195         (WebCore::RealtimeMediaSource::setFrameRate):
3196         (WebCore::RealtimeMediaSource::setAspectRatio):
3197         (WebCore::RealtimeMediaSource::setFacingMode):
3198         (WebCore::RealtimeMediaSource::setVolume):
3199         (WebCore::RealtimeMediaSource::setSampleRate):
3200         (WebCore::RealtimeMediaSource::setSampleSize):
3201         (WebCore::RealtimeMediaSource::setEchoCancellation):
3202         (WebCore::RealtimeMediaSource::setLogger):
3203         (WebCore::RealtimeMediaSource::logChannel const):
3204         (WebCore::convertEnumerationToString):
3205         * platform/mediastream/RealtimeMediaSource.h:
3206         (WTF::LogArgument<WebCore::RealtimeMediaSource::Type>::toString):
3207         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
3208         (WebCore::RealtimeMediaSourceSettings::convertFlagsToString):
3209         (WebCore::convertEnumerationToString):
3210         * platform/mediastream/RealtimeMediaSourceSettings.h:
3211         (WTF::LogArgument<WebCore::RealtimeMediaSourceSettings::VideoFacingMode>::toString):
3212         (WTF::LogArgument<OptionSet<WebCore::RealtimeMediaSourceSettings::Flag>>::toString):
3213         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
3214         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
3215         (WebCore::RealtimeOutgoingAudioSource::logChannel const):
3216         (WebCore::RealtimeOutgoingAudioSource::logger const): Deleted.
3217         * platform/mediastream/RealtimeOutgoingAudioSource.h:
3218         (WebCore::RealtimeOutgoingAudioSource::setLogger): Deleted.
3219         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
3220         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
3221         (WebCore::RealtimeOutgoingVideoSource::sendOneBlackFrame):
3222         (WebCore::RealtimeOutgoingVideoSource::sendFrame):
3223         (WebCore::RealtimeOutgoingVideoSource::logChannel const):
3224         (WebCore::RealtimeOutgoingVideoSource::logger const): Deleted.
3225         * platform/mediastream/RealtimeOutgoingVideoSource.h:
3226         (WebCore::RealtimeOutgoingVideoSource::setLogger): Deleted.
3227         * platform/mediastream/RealtimeVideoSource.cpp:
3228         (WebCore::RealtimeVideoSource::setSizeAndFrameRate):
3229         (WebCore::SizeAndFrameRate::toJSONObject const):
3230         (WebCore::SizeAndFrameRate::toJSONString const):
3231         * platform/mediastream/RealtimeVideoSource.h:
3232         (WTF::LogArgument<WebCore::SizeAndFrameRate>::toString):
3233         * platform/mediastream/mac/AVVideoCaptureSource.h:
3234         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3235         (WebCore::AVVideoCaptureSource::clearSession):
3236         (WebCore::AVVideoCaptureSource::startProducingData):
3237         (WebCore::AVVideoCaptureSource::stopProducingData):
3238         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
3239         (WebCore::AVVideoCaptureSource::setupSession):
3240         (WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
3241         (WebCore::AVVideoCaptureSource::setupCaptureSession):
3242         (WebCore::AVVideoCaptureSource::captureSessionIsRunningDidChange):
3243         (WebCore::AVVideoCaptureSource::captureDeviceSuspendedDidChange):
3244         (WebCore::AVVideoCaptureSource::captureSessionRuntimeError):
3245         (WebCore::AVVideoCaptureSource::captureSessionBeginInterruption):
3246         (WebCore::AVVideoCaptureSource::captureSessionEndInterruption):
3247         (WebCore::AVVideoCaptureSource::deviceDisconnected):
3248         (-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]):
3249         (-[WebCoreAVVideoCaptureSourceObserver deviceConnectedDidChange:]):
3250         (-[WebCoreAVVideoCaptureSourceObserver sessionRuntimeError:]):
3251         (-[WebCoreAVVideoCaptureSourceObserver beginSessionInterrupted:]):
3252         (-[WebCoreAVVideoCaptureSourceObserver endSessionInterrupted:]):
3253         (WebCore::AVVideoCaptureSource::initializeSession): Deleted.
3254         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3255         (WebCore::CoreAudioSharedUnit::setupAudioUnit):
3256         (WebCore::CoreAudioSharedUnit::verifyIsCapturing):
3257         (WebCore::CoreAudioSharedUnit::captureFailed):
3258         (WebCore::CoreAudioCaptureSource::initializeToStartProducingData):
3259         (WebCore::CoreAudioCaptureSource::addEchoCancellationSource):
3260         (WebCore::CoreAudioCaptureSource::removeEchoCancellationSource):
3261         (WebCore::CoreAudioCaptureSource::startProducingData):
3262         (WebCore::CoreAudioCaptureSource::stopProducingData):
3263         (WebCore::CoreAudioCaptureSource::scheduleReconfiguration):
3264         (WebCore::CoreAudioCaptureSource::beginInterruption):
3265         (WebCore::CoreAudioCaptureSource::endInterruption):
3266         * platform/mediastream/mac/CoreAudioCaptureSource.h:
3267         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
3268         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
3269         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
3270         (WebCore::ScreenDisplayCaptureSourceMac::startProducingData):
3271         (WebCore::ScreenDisplayCaptureSourceMac::stopProducingData):
3272         (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream):
3273
3274 2019-03-15  Devin Rousso  <drousso@apple.com>
3275
3276         Web Inspector: Canvas: remove agent as observer when disabling
3277         https://bugs.webkit.org/show_bug.cgi?id=195825
3278         <rdar://problem/48940255>
3279
3280         Reviewed by Joseph Pecoraro.
3281
3282         No change in functionality.
3283
3284         * inspector/agents/InspectorCanvasAgent.cpp:
3285         (WebCore::InspectorCanvasAgent::disable):
3286
3287 2019-03-15  Ryosuke Niwa  <rniwa@webkit.org>
3288
3289         REGRESSION (r239814): Most classes that user Timer have 7 bytes of padding after the Timer
3290         https://bugs.webkit.org/show_bug.cgi?id=194196
3291
3292         Reviewed by Simon Fraser.
3293
3294         Use std::nan as the value of m_unalignedNextFireTime to indicate the timer had been deleted
3295         instead of having a dedicated boolean, which consumes 7 extra bytes for padding.
3296
3297         Note that some code in WebKit uses +Infinity as a fire time so we can't use that.
3298
3299         * platform/Timer.cpp:
3300         (WebCore::TimerBase::TimerBase):
3301         (WebCore::TimerBase::~TimerBase):
3302         (WebCore::TimerBase::setNextFireTime):
3303         (WebCore::TimerBase::nextUnalignedFireInterval const):
3304         * platform/Timer.h:
3305
3306 2019-03-15  Sihui Liu  <sihui_liu@apple.com>
3307
3308         [ Mojave WK1 ] Layout Test storage/indexeddb/database-odd-names.html is failing
3309         https://bugs.webkit.org/show_bug.cgi?id=190350
3310         <rdar://problem/45089503>
3311
3312         Reviewed by Geoffrey Garen.
3313
3314         Start to use hash for database file names so that the files can work on any filesystem.
3315
3316         We created v0 folder in IndexedDB directory to put the legacy databases, and v1 folder to put the upgraded 
3317         databases.
3318
3319         Tests: TestWebKitAPI.IndexedDB.IndexedDBFileName
3320                TestWebKitAPI.IndexedDB.IndexedDBFileNameV0
3321                TestWebKitAPI.IndexedDB.IndexedDBFileNameV1
3322                TestWebKitAPI.IndexedDB.IndexedDBFileNameAPI
3323                TestWebKitAPI.IndexedDB.HashCollision
3324
3325         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
3326         (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot const):
3327         (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot):
3328         * Modules/indexeddb/IDBDatabaseIdentifier.h:
3329         * Modules/indexeddb/server/IDBServer.cpp:
3330         (WebCore::IDBServer::m_quotaManagerGetter):
3331         (WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
3332         (WebCore::IDBServer::removeAllDatabasesForFullOriginPath):
3333         (WebCore::IDBServer::removeAllDatabasesForOriginPath):
3334         (WebCore::IDBServer::IDBServer::removeDatabasesModifiedSinceForVersion):
3335         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince):
3336         (WebCore::IDBServer::IDBServer::removeDatabasesWithOriginsForVersion):
3337         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
3338         (WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
3339         (WebCore::IDBServer::IDBServer::upgradeFilesIfNecessary):
3340         * Modules/indexeddb/server/IDBServer.h:
3341         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3342         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
3343         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabasePathForDirectory):
3344         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabasePath const):
3345         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromFile):
3346         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade):
3347         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
3348         (WebCore::IDBServer::SQLiteIDBBackingStore::quotaForOrigin const):
3349         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const):
3350         (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
3351         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
3352         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectory const): Deleted.
3353         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3354         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseDirectory const):
3355         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
3356         (WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
3357         (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
3358         * platform/sql/SQLiteFileSystem.cpp:
3359         (WebCore::SQLiteFileSystem::computeHashForFileName):
3360         * platform/sql/SQLiteFileSystem.h:
3361
3362 2019-03-15  Zalan Bujtas  <zalan@apple.com>
3363
3364         [ContentChangeObserver] HTMLImageElement::willRespondToMouseClickEvents returns quirk value.
3365         https://bugs.webkit.org/show_bug.cgi?id=195657
3366         <rdar://problem/48834987>
3367
3368         Reviewed by Simon Fraser.
3369
3370         Images should not trigger hover by default (only when they actually respond to mouse events).
3371
3372         Test: fast/events/touch/ios/content-observation/visibility-change-with-image-content.html
3373
3374         * page/ios/ContentChangeObserver.cpp:
3375         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const):
3376
3377 2019-03-15  Jer Noble  <jer.noble@apple.com>
3378
3379         Add a "supportedConfiguration" dictionary to MediaCapabilitiesDecodingInfo and MediaCapabilitiesEncodingInfo
3380         https://bugs.webkit.org/show_bug.cgi?id=195763
3381
3382         Reviewed by Jon Lee.
3383
3384         Test: media/mediacapabilities/mock-decodingInfo-supportedConfiguration.html
3385
3386         Add support for a proposed addition to the Media Capabilities spec that would future-proof additional changes
3387         to Media Capabilities by allowing sites to check exactly what properties were queried by the browser when
3388         answering a decodeInfo() or enocdeInfo() query.
3389
3390         * CMakeLists.txt:
3391         * DerivedSources-input.xcfilelist:
3392         * DerivedSources-output.xcfilelist:
3393         * DerivedSources.make:
3394         * Modules/mediacapabilities/AudioConfiguration.idl:
3395         * Modules/mediacapabilities/MediaCapabilities.cpp:
3396         (WebCore::MediaCapabilities::decodingInfo):
3397         (WebCore::MediaCapabilities::encodingInfo):
3398         * Modules/mediacapabilities/MediaCapabilities.idl:
3399         * Modules/mediacapabilities/MediaCapabilitiesDecodingInfo.idl:
3400         * Modules/mediacapabilities/MediaCapabilitiesEncodingInfo.idl:
3401         * Modules/mediacapabilities/MediaCapabilitiesInfo.idl:
3402         * Modules/mediacapabilities/MediaDecodingConfiguration.idl:
3403         * Modules/mediacapabilities/MediaEncodingConfiguration.idl: