3064fc1b561bee08186569b361f18cc271c0307e
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
2
3         Build cleanly with GCC 9
4         https://bugs.webkit.org/show_bug.cgi?id=195920
5
6         Reviewed by Chris Dumez.
7
8         WebKit triggers three new GCC 9 warnings:
9
10         """
11         -Wdeprecated-copy, implied by -Wextra, warns about the C++11 deprecation of implicitly
12         declared copy constructor and assignment operator if one of them is user-provided.
13         """
14
15         Solution is to either add a copy constructor or copy assignment operator, if required, or
16         else remove one if it is redundant.
17
18         """
19         -Wredundant-move, implied by -Wextra, warns about redundant calls to std::move.
20         -Wpessimizing-move, implied by -Wall, warns when a call to std::move prevents copy elision.
21         """
22
23         These account for most of this patch. Solution is to just remove the bad WTFMove().
24
25         Additionally, -Wclass-memaccess has been enhanced to catch a few cases that GCC 8 didn't.
26         These are solved by casting nontrivial types to void* before using memcpy. (Of course, it
27         would be safer to not use memcpy on nontrivial types, but that's too complex for this
28         patch. Searching for memcpy used with static_cast<void*> will reveal other cases to fix.)
29
30         * Modules/encryptedmedia/CDM.cpp:
31         (WebCore::CDM::getSupportedConfiguration):
32         * Modules/encryptedmedia/MediaKeys.cpp:
33         (WebCore::MediaKeys::createSession):
34         * Modules/entriesapi/DOMFileSystem.cpp:
35         (WebCore::listDirectoryWithMetadata):
36         (WebCore::toFileSystemEntries):
37         * Modules/fetch/FetchBody.cpp:
38         (WebCore::FetchBody::fromFormData):
39         (WebCore::FetchBody::bodyAsFormData const):
40         (WebCore::FetchBody::take):
41         * Modules/fetch/FetchRequest.cpp:
42         (WebCore::FetchRequest::create):
43         (WebCore::FetchRequest::clone):
44         * Modules/fetch/FetchResponse.cpp:
45         (WebCore::FetchResponse::create):
46         (WebCore::FetchResponse::redirect):
47         (WebCore::FetchResponse::clone):
48         * Modules/indexeddb/IDBCursor.cpp:
49         (WebCore::IDBCursor::update):
50         (WebCore::IDBCursor::deleteFunction):
51         * Modules/indexeddb/IDBDatabase.cpp:
52         (WebCore::IDBDatabase::transaction):
53         * Modules/indexeddb/IDBDatabaseIdentifier.h:
54         (WebCore::IDBDatabaseIdentifier::decode):
55         * Modules/indexeddb/IDBKeyData.h:
56         (WebCore::IDBKeyData::decode):
57         * Modules/indexeddb/IDBObjectStore.cpp:
58         (WebCore::IDBObjectStore::createIndex):
59         (WebCore::IDBObjectStore::index):
60         * Modules/indexeddb/IDBValue.h:
61         (WebCore::IDBValue::decode):
62         * Modules/indexeddb/shared/IDBError.cpp:
63         (WebCore::IDBError::operator=): Deleted.
64         * Modules/indexeddb/shared/IDBError.h:
65         * Modules/indexeddb/shared/IDBResultData.h:
66         (WebCore::IDBResultData::decode):
67         * Modules/mediarecorder/MediaRecorder.cpp:
68         (WebCore::MediaRecorder::create):
69         * Modules/mediasource/MediaSource.cpp:
70         (WebCore::MediaSource::addSourceBuffer):
71         * Modules/mediastream/RTCPeerConnection.cpp:
72         (WebCore::iceServersFromConfiguration):
73         (WebCore::RTCPeerConnection::certificatesFromConfiguration):
74         (WebCore::certificateTypeFromAlgorithmIdentifier):
75         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
76         (WebCore::LibWebRTCMediaEndpoint::getStats):
77         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
78         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
79         (WebCore::LibWebRTCPeerConnectionBackend::addUnifiedPlanTransceiver):
80         * Modules/webaudio/AudioBuffer.cpp:
81         (WebCore::AudioBuffer::create):
82         * Modules/webaudio/AudioContext.cpp:
83         (WebCore::AudioContext::createMediaElementSource):
84         (WebCore::AudioContext::createMediaStreamSource):
85         (WebCore::AudioContext::createScriptProcessor):
86         * Modules/webaudio/OfflineAudioContext.cpp:
87         (WebCore::OfflineAudioContext::create):
88         * Modules/webdatabase/DatabaseManager.cpp:
89         (WebCore::DatabaseManager::tryToOpenDatabaseBackend):
90         * Modules/webdatabase/DatabaseTracker.cpp:
91         (WebCore::DatabaseTracker::canEstablishDatabase):
92         (WebCore::DatabaseTracker::retryCanEstablishDatabase):
93         * Modules/webdatabase/SQLResultSetRowList.cpp:
94         (WebCore::SQLResultSetRowList::item const):
95         * Modules/websockets/WebSocket.cpp:
96         (WebCore::WebSocket::create):
97         * accessibility/AXObjectCache.cpp:
98         (WebCore::AXObjectCache::rangeForNodeContents):
99         (WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets):
100         * animation/KeyframeEffect.cpp:
101         (WebCore::KeyframeEffect::create):
102         (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const):
103         * bindings/js/JSCustomElementInterface.cpp:
104         (WebCore::JSCustomElementInterface::constructElementWithFallback):
105         * bindings/js/JSDOMConvertVariadic.h:
106         (WebCore::VariadicConverter::convert):
107         (WebCore::convertVariadicArguments):
108         * bindings/js/SerializedScriptValue.cpp:
109         (WebCore::CloneDeserializer::readDOMPointInit):
110         (WebCore::transferArrayBuffers):
111         * bindings/scripts/CodeGeneratorJS.pm:
112         (GenerateCallbackImplementationContent):
113         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
114         (WebCore::JSTestCallbackFunction::handleEvent):
115         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
116         (WebCore::JSTestCallbackFunctionRethrow::handleEvent):
117         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
118         (WebCore::JSTestCallbackInterface::callbackWithAReturnValue):
119         (WebCore::JSTestCallbackInterface::callbackThatRethrowsExceptions):
120         (WebCore::JSTestCallbackInterface::callbackThatSkipsInvokeCheck):
121         (WebCore::JSTestCallbackInterface::callbackWithThisObject):
122         * contentextensions/ContentExtensionParser.cpp:
123         (WebCore::ContentExtensions::getStringList):
124         (WebCore::ContentExtensions::loadTrigger):
125         (WebCore::ContentExtensions::loadEncodedRules):
126         (WebCore::ContentExtensions::parseRuleList):
127         * crypto/SubtleCrypto.cpp:
128         (WebCore::normalizeCryptoAlgorithmParameters):
129         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
130         (WebCore::calculateSignature):
131         * crypto/keys/CryptoKeyEC.cpp:
132         (WebCore::CryptoKeyEC::exportJwk const):
133         * css/CSSComputedStyleDeclaration.cpp:
134         (WebCore::computedTransform):
135         (WebCore::ComputedStyleExtractor::valueForShadow):
136         (WebCore::ComputedStyleExtractor::valueForFilter):
137         (WebCore::specifiedValueForGridTrackSize):
138         (WebCore::valueForGridTrackList):
139         (WebCore::valueForGridPosition):
140         (WebCore::willChangePropertyValue):
141         (WebCore::fontVariantLigaturesPropertyValue):
142         (WebCore::fontVariantNumericPropertyValue):
143         (WebCore::fontVariantEastAsianPropertyValue):
144         (WebCore::touchActionFlagsToCSSValue):
145         (WebCore::renderTextDecorationFlagsToCSSValue):
146         (WebCore::renderEmphasisPositionFlagsToCSSValue):
147         (WebCore::speakAsToCSSValue):
148         (WebCore::hangingPunctuationToCSSValue):
149         (WebCore::fillRepeatToCSSValue):
150         (WebCore::fillSizeToCSSValue):
151         (WebCore::counterToCSSValue):
152         (WebCore::fontVariantFromStyle):
153         (WebCore::fontSynthesisFromStyle):
154         (WebCore::shapePropertyValue):
155         (WebCore::paintOrder):
156         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
157         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
158         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
159         * css/CSSFontFaceSet.cpp:
160         (WebCore::CSSFontFaceSet::matchingFacesExcludingPreinstalledFonts):
161         * css/CSSGradientValue.cpp:
162         (WebCore::CSSGradientValue::image):
163         * css/CSSStyleSheet.cpp:
164         (WebCore::CSSStyleSheet::rules):
165         * css/DOMMatrixReadOnly.cpp:
166         (WebCore::DOMMatrixReadOnly::parseStringIntoAbstractMatrix):
167         * css/FontFace.cpp:
168         (WebCore::FontFace::create):
169         * css/FontVariantBuilder.cpp:
170         (WebCore::computeFontVariant):
171         * css/PropertySetCSSStyleDeclaration.cpp:
172         (WebCore::PropertySetCSSStyleDeclaration::removeProperty):
173         * css/SVGCSSComputedStyleDeclaration.cpp:
174         (WebCore::strokeDashArrayToCSSValueList):
175         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
176         * css/StyleBuilderConverter.h:
177         (WebCore::StyleBuilderConverter::convertReflection):
178         * css/WebKitCSSMatrix.cpp:
179         (WebCore::WebKitCSSMatrix::create):
180         (WebCore::WebKitCSSMatrix::multiply const):
181         * css/parser/CSSPropertyParser.cpp:
182         (WebCore::consumeFontVariationSettings):
183         (WebCore::consumeBasicShapePath):
184         (WebCore::consumeImplicitGridAutoFlow):
185         * cssjit/StackAllocator.h:
186         * dom/DOMImplementation.cpp:
187         (WebCore::DOMImplementation::createDocument):
188         * dom/Document.cpp:
189         (WebCore::Document::cloneNodeInternal):
190         * dom/DocumentFragment.cpp:
191         (WebCore::DocumentFragment::cloneNodeInternal):
192         * dom/Element.cpp:
193         (WebCore::Element::setAttributeNode):
194         (WebCore::Element::setAttributeNodeNS):
195         (WebCore::Element::removeAttributeNode):
196         (WebCore::Element::parseAttributeName):
197         (WebCore::Element::animate):
198         * dom/MessagePort.cpp:
199         (WebCore::MessagePort::disentanglePorts):
200         * dom/NodeIterator.cpp:
201         (WebCore::NodeIterator::nextNode):
202         (WebCore::NodeIterator::previousNode):
203         * dom/Range.cpp:
204         (WebCore::Range::processContents):
205         (WebCore::processContentsBetweenOffsets):
206         (WebCore::processAncestorsAndTheirSiblings):
207         * dom/RangeBoundaryPoint.h:
208         * dom/ScriptDisallowedScope.h:
209         (WebCore::ScriptDisallowedScope::operator=):
210         * dom/Text.cpp:
211         (WebCore::Text::splitText):
212         * dom/TextDecoder.cpp:
213         (WebCore::TextDecoder::create):
214         (WebCore::TextDecoder::decode):
215         * editing/CompositeEditCommand.cpp:
216         (WebCore::CompositeEditCommand::insertBlockPlaceholder):
217         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
218         * editing/Editing.cpp:
219         (WebCore::createTabSpanElement):
220         * editing/EditingStyle.cpp:
221         (WebCore::EditingStyle::styleAtSelectionStart):
222         * editing/TextIterator.cpp:
223         (WebCore::TextIterator::rangeFromLocationAndLength):
224         * editing/VisibleSelection.cpp:
225         (WebCore::makeSearchRange):
226         * editing/markup.cpp:
227         (WebCore::styleFromMatchedRulesAndInlineDecl):
228         (WebCore::createFragmentForInnerOuterHTML):
229         (WebCore::createContextualFragment):
230         * html/FormController.cpp:
231         (WebCore::deserializeFormControlState):
232         * html/HTMLCanvasElement.cpp:
233         (WebCore::HTMLCanvasElement::captureStream):
234         * html/HTMLMediaElement.cpp:
235         (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
236         * html/HTMLOptionElement.cpp:
237         (WebCore::HTMLOptionElement::createForJSConstructor):
238         * html/HTMLPlugInImageElement.cpp:
239         (WebCore::HTMLPlugInImageElement::createElementRenderer):
240         * html/HTMLTableElement.cpp:
241         (WebCore::HTMLTableElement::createSharedCellStyle):
242         * html/HTMLTableRowElement.cpp:
243         (WebCore::HTMLTableRowElement::insertCell):
244         * html/ImageData.cpp:
245         (WebCore::ImageData::create):
246         * html/OffscreenCanvas.cpp:
247         (WebCore::OffscreenCanvas::transferToImageBitmap):
248         * html/canvas/CanvasRenderingContext2DBase.cpp:
249         (WebCore::CanvasRenderingContext2DBase::createLinearGradient):
250         (WebCore::CanvasRenderingContext2DBase::createRadialGradient):
251         * html/canvas/OESVertexArrayObject.cpp:
252         (WebCore::OESVertexArrayObject::createVertexArrayOES):
253         * html/canvas/WebGLRenderingContextBase.cpp:
254         (WebCore::WebGLRenderingContextBase::createBuffer):
255         (WebCore::WebGLRenderingContextBase::createFramebuffer):
256         (WebCore::WebGLRenderingContextBase::createTexture):
257         (WebCore::WebGLRenderingContextBase::createProgram):
258         (WebCore::WebGLRenderingContextBase::createRenderbuffer):
259         (WebCore::WebGLRenderingContextBase::createShader):
260         (WebCore::WebGLRenderingContextBase::getContextAttributes):
261         (WebCore::WebGLRenderingContextBase::getUniform):
262         * html/shadow/TextControlInnerElements.cpp:
263         (WebCore::TextControlInnerContainer::resolveCustomStyle):
264         (WebCore::TextControlPlaceholderElement::resolveCustomStyle):
265         * html/track/BufferedLineReader.cpp:
266         (WebCore::BufferedLineReader::nextLine):
267         * html/track/VTTCue.cpp:
268         (WebCore::VTTCue::getCueAsHTML):
269         (WebCore::VTTCue::createCueRenderingTree):
270         * html/track/WebVTTElement.cpp:
271         (WebCore::WebVTTElement::cloneElementWithoutAttributesAndChildren):
272         * inspector/InspectorStyleSheet.cpp:
273         (WebCore::asCSSRuleList):
274         (WebCore::InspectorStyle::buildObjectForStyle const):
275         (WebCore::InspectorStyleSheet::buildObjectForStyleSheet):
276         (WebCore::InspectorStyleSheet::buildObjectForRule):
277         * inspector/agents/InspectorCSSAgent.cpp:
278         (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
279         * inspector/agents/InspectorDOMAgent.cpp:
280         (WebCore::InspectorDOMAgent::buildArrayForPseudoElements):
281         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
282         * inspector/agents/InspectorNetworkAgent.cpp:
283         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
284         * loader/FetchOptions.h:
285         (WebCore::FetchOptions::decode):
286         * loader/MediaResourceLoader.cpp:
287         (WebCore::MediaResourceLoader::requestResource):
288         * loader/appcache/ApplicationCacheStorage.cpp:
289         (WebCore::ApplicationCacheStorage::loadCache):
290         (WebCore::ApplicationCacheStorage::manifestURLs):
291         * loader/archive/mhtml/MHTMLParser.cpp:
292         (WebCore::MHTMLParser::parseArchiveWithHeader):
293         * loader/cache/CachedResourceLoader.cpp:
294         (WebCore::CachedResourceLoader::requestResource):
295         * page/DOMWindow.cpp:
296         (WebCore::DOMWindow::getMatchedCSSRules const):
297         * page/DragController.cpp:
298         (WebCore::documentFragmentFromDragData):
299         * page/EventSource.cpp:
300         (WebCore::EventSource::create):
301         * page/PerformanceUserTiming.cpp:
302         (WebCore::UserTiming::mark):
303         (WebCore::UserTiming::measure):
304         * page/SecurityOrigin.h:
305         (WebCore::SecurityOrigin::decode):
306         * page/scrolling/ScrollingConstraints.h:
307         (WebCore::FixedPositionViewportConstraints::FixedPositionViewportConstraints):
308         (WebCore::LayoutConstraints::LayoutConstraints): Deleted.
309         * platform/Length.h:
310         (WebCore::Length::Length):
311         * platform/animation/TimingFunction.cpp:
312         (WebCore::TimingFunction::createFromCSSText):
313         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
314         (WebCore::parseLicenseFormat):
315         * platform/graphics/FloatPoint3D.h:
316         * platform/graphics/Font.cpp:
317         (WebCore::createAndFillGlyphPage):
318         * platform/graphics/GLContext.cpp:
319         (WebCore::GLContext::createContextForWindow):
320         (WebCore::GLContext::createSharingContext):
321         * platform/graphics/GraphicsContext.cpp:
322         * platform/graphics/HEVCUtilities.cpp:
323         (WebCore::parseHEVCCodecParameters):
324         * platform/graphics/gtk/ImageGtk.cpp:
325         (WebCore::loadImageFromGResource):
326         (WebCore::loadMissingImageIconFromTheme):
327         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
328         (WebCore::PlatformDisplayWayland::create):
329         * platform/mediastream/MediaConstraints.h:
330         (WebCore::MediaTrackConstraintSetMap::decode):
331         * platform/mediastream/MediaStreamRequest.h:
332         (WebCore::MediaStreamRequest::decode):
333         * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp:
334         (WebCore::GStreamerSampleFromLibWebRTCVideoFrame):
335         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
336         (WebCore::RealtimeIncomingAudioSource::create):
337         * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp:
338         (WebCore::RealtimeIncomingVideoSource::create):
339         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
340         (WebCore::MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID):
341         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
342         (WebCore::MockMediaSample::createNonDisplayingCopy const):
343         * platform/network/BlobRegistryImpl.cpp:
344         (WebCore::BlobRegistryImpl::createResourceHandle):
345         * platform/network/CookieRequestHeaderFieldProxy.h:
346         (WebCore::CookieRequestHeaderFieldProxy::decode):
347         * platform/network/FormData.h:
348         (WebCore::FormData::decode):
349         * platform/network/MIMEHeader.cpp:
350         (WebCore::MIMEHeader::parseHeader):
351         * platform/network/ResourceHandle.cpp:
352         (WebCore::ResourceHandle::create):
353         * platform/network/soup/DNSResolveQueueSoup.cpp:
354         (WebCore::DNSResolveQueueSoup::takeCompletionAndCancelHandlers):
355         * rendering/RenderElement.cpp:
356         (WebCore::RenderElement::createFor):
357         * rendering/shapes/Shape.cpp:
358         (WebCore::Shape::createRasterShape):
359         (WebCore::Shape::createBoxShape):
360         * rendering/style/BasicShapes.cpp:
361         (WebCore::BasicShapeCircle::blend const):
362         (WebCore::BasicShapeEllipse::blend const):
363         (WebCore::BasicShapePolygon::blend const):
364         (WebCore::BasicShapePath::blend const):
365         (WebCore::BasicShapeInset::blend const):
366         * rendering/style/BasicShapes.h:
367         (WebCore::BasicShapeRadius::BasicShapeRadius):
368         * rendering/style/ContentData.cpp:
369         (WebCore::ImageContentData::createContentRenderer const):
370         (WebCore::TextContentData::createContentRenderer const):
371         (WebCore::QuoteContentData::createContentRenderer const):
372         * rendering/style/ContentData.h:
373         * rendering/svg/RenderSVGInline.cpp:
374         (WebCore::RenderSVGInline::createInlineFlowBox):
375         * rendering/svg/RenderSVGInlineText.cpp:
376         (WebCore::RenderSVGInlineText::createTextBox):
377         * rendering/svg/RenderSVGText.cpp:
378         (WebCore::RenderSVGText::createRootInlineBox):
379         * svg/SVGFEBlendElement.cpp:
380         (WebCore::SVGFEBlendElement::build):
381         * svg/SVGFEColorMatrixElement.cpp:
382         (WebCore::SVGFEColorMatrixElement::build):
383         * svg/SVGFEComponentTransferElement.cpp:
384         (WebCore::SVGFEComponentTransferElement::build):
385         * svg/SVGFECompositeElement.cpp:
386         (WebCore::SVGFECompositeElement::build):
387         * svg/SVGFEConvolveMatrixElement.cpp:
388         (WebCore::SVGFEConvolveMatrixElement::build):
389         * svg/SVGFEDiffuseLightingElement.cpp:
390         (WebCore::SVGFEDiffuseLightingElement::build):
391         * svg/SVGFEDisplacementMapElement.cpp:
392         (WebCore::SVGFEDisplacementMapElement::build):
393         * svg/SVGFEDropShadowElement.cpp:
394         (WebCore::SVGFEDropShadowElement::build):
395         * svg/SVGFEGaussianBlurElement.cpp:
396         (WebCore::SVGFEGaussianBlurElement::build):
397         * svg/SVGFEMergeElement.cpp:
398         (WebCore::SVGFEMergeElement::build):
399         * svg/SVGFEMorphologyElement.cpp:
400         (WebCore::SVGFEMorphologyElement::build):
401         * svg/SVGFEOffsetElement.cpp:
402         (WebCore::SVGFEOffsetElement::build):
403         * svg/SVGFESpecularLightingElement.cpp:
404         (WebCore::SVGFESpecularLightingElement::build):
405         * svg/SVGFETileElement.cpp:
406         (WebCore::SVGFETileElement::build):
407         * svg/SVGTransformList.h:
408         * svg/properties/SVGList.h:
409         (WebCore::SVGList::initialize):
410         (WebCore::SVGList::insertItemBefore):
411         (WebCore::SVGList::replaceItem):
412         (WebCore::SVGList::removeItem):
413         (WebCore::SVGList::appendItem):
414         * svg/properties/SVGListProperty.h:
415         (WebCore::SVGListProperty::initializeValuesAndWrappers):
416         (WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
417         (WebCore::SVGListProperty::replaceItemValuesAndWrappers):
418         (WebCore::SVGListProperty::removeItemValues):
419         (WebCore::SVGListProperty::appendItemValuesAndWrappers):
420         * svg/properties/SVGPrimitiveList.h:
421         * testing/Internals.cpp:
422         (WebCore::Internals::elementRenderTreeAsText):
423         (WebCore::parseFindOptions):
424         * workers/AbstractWorker.cpp:
425         (WebCore::AbstractWorker::resolveURL):
426         * workers/Worker.cpp:
427         (WebCore::Worker::create):
428         * workers/service/ServiceWorkerJobData.h:
429         (WebCore::ServiceWorkerJobData::decode):
430         * xml/DOMParser.cpp:
431         (WebCore::DOMParser::parseFromString):
432         * xml/XPathExpression.cpp:
433         (WebCore::XPathExpression::evaluate):
434
435 2019-03-19  Devin Rousso  <drousso@apple.com>
436
437         Web Inspector: Provide $event in the console when paused on an event listener
438         https://bugs.webkit.org/show_bug.cgi?id=188672
439
440         Reviewed by Timothy Hatcher.
441
442         Implement similiar methods/logic as to the way that `$exception` is set.
443
444         * inspector/CommandLineAPIModuleSource.js:
445         (CommandLineAPI):
446
447         * inspector/InspectorInstrumentation.h:
448         (WebCore::InspectorInstrumentation::willHandleEvent):
449         * inspector/InspectorInstrumentation.cpp:
450         (WebCore::InspectorInstrumentation::willHandleEventImpl):
451         (WebCore::InspectorInstrumentation::didHandleEventImpl):
452
453         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
454         * inspector/agents/InspectorDOMDebuggerAgent.h:
455         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
456         (WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
457         (WebCore::InspectorDOMDebuggerAgent::didHandleEvent): Added.
458
459 2019-03-19  Devin Rousso  <drousso@apple.com>
460
461         Web Inspector: ScriptProfiler: lazily create the agent
462         https://bugs.webkit.org/show_bug.cgi?id=195591
463         <rdar://problem/48791756>
464
465         Reviewed by Joseph Pecoraro.
466
467         No change in functionality.
468
469         * inspector/InspectorController.cpp:
470         (WebCore::InspectorController::InspectorController):
471         (WebCore::InspectorController::createLazyAgents):
472
473 2019-03-19  Devin Rousso  <drousso@apple.com>
474
475         Web Inspector: DOMStorage: lazily create the agent
476         https://bugs.webkit.org/show_bug.cgi?id=195588
477         <rdar://problem/48791878>
478
479         Reviewed by Joseph Pecoraro.
480
481         No change in functionality.
482
483         Make functions used by `CommandLineAPIHost` static so that an `InspectorDOMStorageAgent`
484         doesn't need to be created to call them.
485
486         * inspector/agents/InspectorDOMStorageAgent.h:
487         * inspector/agents/InspectorDOMStorageAgent.cpp:
488         (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
489         (WebCore::InspectorDOMStorageAgent::enable):
490         (WebCore::InspectorDOMStorageAgent::disable):
491         (WebCore::InspectorDOMStorageAgent::storageId):
492         (WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
493         (WebCore::InspectorDOMStorageAgent::findStorageArea):
494         (WebCore::InspectorDOMStorageAgent::~InspectorDOMStorageAgent): Deleted.
495
496         * inspector/CommandLineAPIHost.h:
497         (WebCore::CommandLineAPIHost::init):
498         * inspector/CommandLineAPIHost.cpp:
499         (WebCore::CommandLineAPIHost::disconnect):
500         (WebCore::CommandLineAPIHost::storageId):
501
502         * inspector/InspectorController.cpp:
503         (WebCore::InspectorController::InspectorController):
504         (WebCore::InspectorController::createLazyAgents):
505         * inspector/WorkerInspectorController.cpp:
506         (WebCore::WorkerInspectorController::WorkerInspectorController):
507
508 2019-03-19  Youenn Fablet  <youenn@apple.com>
509
510         REGRESSION: Layout Test http/tests/security/cross-origin-indexeddb.html is crashing
511         https://bugs.webkit.org/show_bug.cgi?id=195779
512
513         Reviewed by Chris Dumez.
514
515         When requesting space, we might delay execution of the task.
516         In such a case, a task to close the database might be done before the task continues.
517         Check that the database is not closing to continue the task.
518         This should ensure that the cross thread queue is not already killed.
519
520         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
521         (WebCore::IDBServer::UniqueIDBDatabase::requestSpace):
522
523 2019-03-19  Zalan Bujtas  <zalan@apple.com>
524
525         RenderElement::startAnimation should take const Animation&
526         https://bugs.webkit.org/show_bug.cgi?id=195929
527
528         Reviewed by Daniel Bates.
529
530         * animation/KeyframeEffect.cpp:
531         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
532         * page/animation/KeyframeAnimation.cpp:
533         (WebCore::KeyframeAnimation::startAnimation):
534         (WebCore::KeyframeAnimation::endAnimation):
535         * rendering/RenderElement.h:
536         (WebCore::RenderElement::startAnimation):
537         (WebCore::RenderElement::animationFinished):
538         * rendering/RenderLayerBacking.cpp:
539         (WebCore::RenderLayerBacking::startAnimation):
540         * rendering/RenderLayerBacking.h:
541         * rendering/RenderLayerModelObject.cpp:
542         (WebCore::RenderLayerModelObject::startAnimation):
543         (WebCore::RenderLayerModelObject::animationFinished):
544         * rendering/RenderLayerModelObject.h:
545
546 2019-03-19  Devin Rousso  <drousso@apple.com>
547
548         Web Inspector: Heap: lazily create the agent
549         https://bugs.webkit.org/show_bug.cgi?id=195590
550         <rdar://problem/48791750>
551
552         Reviewed by Joseph Pecoraro.
553
554         No change in functionality.
555
556         * inspector/agents/page/PageHeapAgent.cpp:
557         (WebCore::PageHeapAgent::disable):
558         * inspector/agents/WebHeapAgent.h:
559         * inspector/agents/WebHeapAgent.cpp:
560         (WebCore::WebHeapAgent::WebHeapAgent):
561         (WebCore::WebHeapAgent::enable): Added.
562         (WebCore::WebHeapAgent::disable):
563
564         * inspector/agents/page/PageConsoleAgent.h:
565         * inspector/agents/page/PageConsoleAgent.cpp:
566         (WebCore::PageConsoleAgent::PageConsoleAgent):
567         * inspector/agents/WebConsoleAgent.h:
568         * inspector/agents/WebConsoleAgent.cpp:
569         (WebCore::WebConsoleAgent::WebConsoleAgent):
570         * inspector/agents/worker/WorkerConsoleAgent.h:
571         * inspector/agents/worker/WorkerConsoleAgent.cpp:
572         (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
573
574         * inspector/InspectorController.cpp:
575         (WebCore::InspectorController::InspectorController):
576         (WebCore::InspectorController::createLazyAgents):
577         * inspector/WorkerInspectorController.cpp:
578         (WebCore::WorkerInspectorController::WorkerInspectorController):
579         (WebCore::WorkerInspectorController::createLazyAgents):
580
581 2019-03-19  Simon Fraser  <simon.fraser@apple.com>
582
583         Fix GraphicsLayer-related crashes after r243129
584         https://bugs.webkit.org/show_bug.cgi?id=195953
585
586         Reviewed by Dean Jackson.
587
588         Extending the lifetime of GraphicsLayers by referencing them in the scrolling tree (r243129)
589         revealed a bug where RenderLayerCompositor was failing to clear itself as the client of
590         GraphicsLayers that it owned, causing crashes.
591
592         Fix by using the GraphicsLayer::unparentAndClear() helper to clean up all the GraphicsLayers
593         owned by RenderLayerCompositor.
594
595         * rendering/RenderLayerCompositor.cpp:
596         (WebCore::RenderLayerCompositor::~RenderLayerCompositor):
597         * rendering/RenderLayerCompositor.h:
598
599 2019-03-19  Simon Fraser  <simon.fraser@apple.com>
600
601         [Async overflow] Handle positioned nodes in a few more places
602         https://bugs.webkit.org/show_bug.cgi?id=195946
603
604         Reviewed by Zalan Bujtas.
605
606         When I added support for positioned nodes in the scrolling tree I missed handling
607         the ScrollCoordinationRole::Positioning in a few places.
608
609         I wasn't able to come up with a test for this; when a positioned node toggles between
610         tiled and non-tiled, hitting the code in didChangePlatformLayerForLayer(), we already
611         update the node with the new layer.
612
613         * rendering/RenderLayer.cpp:
614         (WebCore::outputPaintOrderTreeRecursive): Logging.
615         * rendering/RenderLayerBacking.cpp:
616         (WebCore::operator<<): Logging.
617         * rendering/RenderLayerCompositor.cpp:
618         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer): Update the node's layer.
619         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): Handle detaching of this node type.
620
621 2019-03-19  Alex Christensen  <achristensen@webkit.org>
622
623         Make WTFLogChannelState and WTFLogLevel enum classes
624         https://bugs.webkit.org/show_bug.cgi?id=195904
625
626         Reviewed by Eric Carlson.
627
628         * Modules/mediasource/SourceBuffer.cpp:
629         (WebCore::removeSamplesFromTrackBuffer):
630         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
631         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
632         (WebCore::LibWebRTCMediaEndpoint::statsLogInterval const):
633         * dom/Document.cpp:
634         (WebCore::messageLevelFromWTFLogLevel):
635         * html/FTPDirectoryDocument.cpp:
636         (WebCore::FTPDirectoryDocument::FTPDirectoryDocument):
637         * html/HTMLMediaElement.cpp:
638         (WebCore::HTMLMediaElement::seekTask):
639         (WebCore::HTMLMediaElement::selectNextSourceChild):
640         (WebCore::HTMLMediaElement::sourceWasAdded):
641         (WebCore::HTMLMediaElement::sourceWasRemoved):
642         * inspector/agents/WebConsoleAgent.cpp:
643         (WebCore::WebConsoleAgent::getLoggingChannels):
644         (WebCore::channelConfigurationForString):
645         * platform/Logging.cpp:
646         (WebCore::isLogChannelEnabled):
647         (WebCore::setLogChannelToAccumulate):
648         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
649         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
650         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
651         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
652         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
653         (WebCore::initializePeerConnectionFactoryAndThreads):
654         * rendering/RenderLayerCompositor.cpp:
655         (WebCore::compositingLogEnabled):
656
657 2019-03-19  Philippe Normand  <pnormand@igalia.com>
658
659         REGRESSION(r243058): [GStreamer] 3 tests now timing out
660         https://bugs.webkit.org/show_bug.cgi?id=195888
661
662         Reviewed by Xabier Rodriguez-Calvar.
663
664         A breaking change was introduced in r243058. Now on-disk-buffering
665         is disabled when the reported Content-Length is 0 or not present
666         at all. This broke the progress event logic in didLoadProgress()
667         because leading to progress events not being fired as expected.
668
669         The proposed solution is to make webkitwebsrc notify the player
670         every time the network process receives data from the network. So
671         the player can now easily determine if the load progressed by
672         checking the reported statistics.
673
674         No new tests, existing media tests cover this change.
675
676         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
677         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
678         (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const):
679         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
680         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
681         (CachedResourceStreamingClient::dataReceived):
682
683 2019-03-19  Alicia Boya García  <aboya@igalia.com>
684
685         [MSE] Use tolerance in eraseBeginTime
686         https://bugs.webkit.org/show_bug.cgi?id=195911
687
688         Reviewed by Jer Noble.
689
690         https://bugs.webkit.org/show_bug.cgi?id=190085 introduced tolerance
691         when erasing frames during the Coded Frame Processing algorithm in
692         such a way that, in files with less than perfect timestamps, a frame
693         existing before after the current append is not erased accidentally
694         due to small overlaps.
695
696         This patch takes care of the opposite problem: we don't want an old
697         frame being accidentally NOT erased by a new one with the same
698         timestamps just because these overlaps make
699         highestPresentationTimestamp very slightly higher than the frame PTS.
700
701         This bug in practice causes some frames of the old quality to not be
702         erased when the new quality is appended, resulting in some seemingly
703         still frames from a different quality appearing at some points during
704         WebM video in presence of quality changes.
705
706         This bug can be reduced to this minimal test case that illustrates the
707         timestamp imprecission of a typical WebM file:
708
709         function sampleRun(generation) {
710             return concatenateSamples([
711                 makeASample(     0,      0, 166667, 1000000, 1, SAMPLE_FLAG.SYNC, generation),
712                 makeASample(167000, 167000, 166667, 1000000, 1, SAMPLE_FLAG.NONE, generation),
713                 makeASample(333000, 333000, 166667, 1000000, 1, SAMPLE_FLAG.SYNC, generation), // overlaps previous frame
714                 makeASample(500000, 500000, 166667, 1000000, 1, SAMPLE_FLAG.NONE, generation),
715             ]);
716         }
717
718         After appending this twice it would be expected that the second
719         generation takes fully over the first, since the timestamps are
720         completely the same. Due to the bug, sync frames with an overlap, like
721         the third one in that list, actually persist from the first
722         generation, due to lack of tolerance when comparing the start of a new
723         frame with highestPresentationTimestamp.
724
725         This patch introduces the tolerance in that case too to fix this
726         problem.
727
728         Test: media/media-source/media-source-append-twice-overlapping-sync-frame.html
729
730         * Modules/mediasource/SourceBuffer.cpp:
731         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
732
733 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
734
735         Unreviewed GTK build fix
736         https://bugs.webkit.org/show_bug.cgi?id=195863
737         <rdar://problem/49006248>
738
739         Patch by Diego Pino.
740
741         * svg/SVGTests.h:
742
743 2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
744
745         Unreviewed, rolling out r243132.
746
747         Broke GTK build
748
749         Reverted changeset:
750
751         "Make WTFLogChannelState and WTFLogLevel enum classes"
752         https://bugs.webkit.org/show_bug.cgi?id=195904
753         https://trac.webkit.org/changeset/243132
754
755 2019-03-19  Antti Koivisto  <antti@apple.com>
756
757         Layer with no backing store should still hit-test over a scroller
758         https://bugs.webkit.org/show_bug.cgi?id=195378
759         <rdar://problem/48652078>
760
761         Reviewed by Simon Fraser.
762
763         Tests: fast/scrolling/ios/overflow-scroll-overlap-3.html
764                fast/scrolling/ios/overflow-scroll-overlap-4.html
765
766         Move collecting event region from paint to compositing update time.
767         This solves a number of problems including regions for non-painting layers.
768
769         * platform/graphics/GraphicsLayer.h:
770         * rendering/RenderBlock.cpp:
771         (WebCore::RenderBlock::paintObject):
772
773         Use the existing visibleToHitTesting() helper.
774
775         * rendering/RenderLayer.cpp:
776         (WebCore::RenderLayer::paintLayerContents):
777
778         Use flag for event region collecting, don't paint content.
779
780         (WebCore::RenderLayer::paintList):
781
782         We can bail out immediately if there is no overflow.
783
784         (WebCore::RenderLayer::paintForegroundForFragments):
785         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
786         (WebCore::RenderLayer::collectEventRegionForFragments):
787
788         Move to a separate function.
789
790         * rendering/RenderLayer.h:
791         * rendering/RenderLayerBacking.cpp:
792         (WebCore::RenderLayerBacking::updateConfiguration):
793
794         Update event region on backing configuration update. This is called after anything interesting changes on a sublayer.
795
796         (WebCore::RenderLayerBacking::updateEventRegion):
797         (WebCore::RenderLayerBacking::paintIntoLayer):
798         * rendering/RenderLayerBacking.h:
799
800 2019-03-18  Alex Christensen  <achristensen@webkit.org>
801
802         Make WTFLogChannelState and WTFLogLevel enum classes
803         https://bugs.webkit.org/show_bug.cgi?id=195904
804
805         Reviewed by Eric Carlson.
806
807         * Modules/mediasource/SourceBuffer.cpp:
808         (WebCore::removeSamplesFromTrackBuffer):
809         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
810         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
811         (WebCore::LibWebRTCMediaEndpoint::statsLogInterval const):
812         * dom/Document.cpp:
813         (WebCore::messageLevelFromWTFLogLevel):
814         * html/FTPDirectoryDocument.cpp:
815         (WebCore::FTPDirectoryDocument::FTPDirectoryDocument):
816         * html/HTMLMediaElement.cpp:
817         (WebCore::HTMLMediaElement::seekTask):
818         (WebCore::HTMLMediaElement::selectNextSourceChild):
819         (WebCore::HTMLMediaElement::sourceWasAdded):
820         (WebCore::HTMLMediaElement::sourceWasRemoved):
821         * inspector/agents/WebConsoleAgent.cpp:
822         (WebCore::WebConsoleAgent::getLoggingChannels):
823         (WebCore::channelConfigurationForString):
824         * platform/Logging.cpp:
825         (WebCore::isLogChannelEnabled):
826         (WebCore::setLogChannelToAccumulate):
827         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
828         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
829         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
830         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
831         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
832         (WebCore::initializePeerConnectionFactoryAndThreads):
833         * rendering/RenderLayerCompositor.cpp:
834         (WebCore::compositingLogEnabled):
835
836 2019-03-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
837
838         Remove the SVG property tear off objects for SVGStringList
839         https://bugs.webkit.org/show_bug.cgi?id=195863
840
841         Reviewed by Simon Fraser.
842
843         SVGStringList is not animated list. So we need to introduce two new classes:
844
845         -- SVGProperty: This will be the base of all the non-animated properties.
846            Like the SVGAnimatedProperty, SVGProperty will be registered with the
847            attribute name in SVGPropertyRegistery. It will also commit changes
848            to the reflecting attribute. And it will provide a synchronize string
849            for lazy attribute update.
850
851         -- SVGList: It will be the base of all the list properties. It can hold
852            primitive types or SVG types. In this patch primitive types will be 
853            supported only. To do that, a superclass called SVGPrimitiveList is
854            added. Its items are of primitive type such as String type.
855
856         * Sources.txt:
857         * WebCore.xcodeproj/project.pbxproj:
858         * svg/SVGElement.cpp:
859         (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const):
860         (WebCore::SVGElement::commitPropertyChange):
861         * svg/SVGElement.h:
862         * svg/SVGStringList.h:
863         * svg/SVGStringListValues.cpp: Removed.
864         * svg/SVGStringListValues.h: Removed.
865         * svg/SVGTests.cpp:
866         (WebCore::SVGTests::SVGTests):
867         (WebCore::SVGTests::isKnownAttribute):
868         (WebCore::SVGTests::isValid const):
869         (WebCore::SVGTests::parseAttribute):
870         (WebCore::SVGTests::registerAttributes): Deleted.
871         (WebCore::SVGTests::requiredFeatures): Deleted.
872         (WebCore::SVGTests::requiredExtensions): Deleted.
873         (WebCore::SVGTests::systemLanguage): Deleted.
874         * svg/SVGTests.h:
875         (WebCore::SVGTests::requiredFeatures):
876         (WebCore::SVGTests::requiredExtensions):
877         (WebCore::SVGTests::systemLanguage):
878         (): Deleted.
879         * svg/SVGTests.idl:
880         * svg/SVGTextPositioningElement.h:
881         * svg/SVGViewElement.cpp:
882         (WebCore::SVGViewElement::SVGViewElement):
883         (WebCore::SVGViewElement::parseAttribute):
884         (WebCore::SVGViewElement::viewTarget): Deleted.
885         * svg/SVGViewElement.h:
886         * svg/properties/SVGAnimatedListPropertyTearOff.h:
887         * svg/properties/SVGAnimatedPrimitiveProperty.h:
888         (WebCore::SVGAnimatedPrimitiveProperty::setBaseVal):
889         * svg/properties/SVGAnimatedProperty.cpp:
890         (WebCore::SVGAnimatedProperty::commitPropertyChange):
891         * svg/properties/SVGAnimatedProperty.h:
892         * svg/properties/SVGAttributeRegistry.h:
893         * svg/properties/SVGList.h: Added.
894         (WebCore::SVGList::numberOfItems const):
895         (WebCore::SVGList::clear):
896         (WebCore::SVGList::getItem):
897         (WebCore::SVGList::initialize):
898         (WebCore::SVGList::insertItemBefore):
899         (WebCore::SVGList::replaceItem):
900         (WebCore::SVGList::removeItem):
901         (WebCore::SVGList::appendItem):
902         (WebCore::SVGList::items):
903         (WebCore::SVGList::items const):
904         (WebCore::SVGList::size const):
905         (WebCore::SVGList::isEmpty const):
906         (WebCore::SVGList::clearItems):
907         (WebCore::SVGList::canAlterList const):
908         (WebCore::SVGList::canGetItem):
909         (WebCore::SVGList::canReplaceItem):
910         (WebCore::SVGList::canRemoveItem):
911         (WebCore::SVGList::detachItems):
912         * svg/properties/SVGMemberAccessor.h:
913         (WebCore::SVGMemberAccessor::matches const):
914         * svg/properties/SVGPrimitiveList.h: Added.
915         * svg/properties/SVGProperty.h:
916         (WebCore::SVGProperty::isAttached const):
917         (WebCore::SVGProperty::attach):
918         (WebCore::SVGProperty::detach):
919         (WebCore::SVGProperty::contextElement const):
920         (WebCore::SVGProperty::commitChange):
921         (WebCore::SVGProperty::access const):
922         (WebCore::SVGProperty::isReadOnly const):
923         (WebCore::SVGProperty::isDirty const):
924         (WebCore::SVGProperty::setDirty):
925         (WebCore::SVGProperty::synchronize):
926         (WebCore::SVGProperty::valueAsString const):
927         (WebCore::SVGProperty::SVGProperty):
928         * svg/properties/SVGPropertyAccessor.h: Added.
929         * svg/properties/SVGPropertyAccessorImpl.h: Added.
930         * svg/properties/SVGPropertyOwner.h:
931         (WebCore::SVGPropertyOwner::commitPropertyChange):
932         * svg/properties/SVGPropertyOwnerRegistry.h:
933         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
934         * svg/properties/SVGPropertyRegistry.h:
935         * svg/properties/SVGStaticListPropertyTearOff.h: Removed.
936
937 2019-03-18  Simon Fraser  <simon.fraser@apple.com>
938
939         Unreviewed followup to r243126.
940
941         LayerRepresentation operator=() needs to copy m_graphicsLayer now that it doesn't
942         share a pointer with m_typelessPlatformLayer. Also make the LayerRepresentation construction
943         from a GraphiscLayer* explicit.
944
945         * page/scrolling/ScrollingStateNode.h:
946         (WebCore::LayerRepresentation::operator=):
947         (WebCore::LayerRepresentation::toRepresentation const):
948
949 2019-03-18  Simon Fraser  <simon.fraser@apple.com>
950
951         Scrolling state nodes should hold references to GraphicsLayers
952         https://bugs.webkit.org/show_bug.cgi?id=195844
953         <rdar://problem/48949634>
954
955         Reviewed by Tim Horton.
956
957         GraphicsLayers are refcounted, and the scrolling tree keeps GraphicsLayer pointers,
958         so for safely the scrolling tree should store RefPtr<GraphicsLayer> instead.
959
960         I removed the union (since it would be weird with a RefPtr and raw pointer). This code
961         should probably use WTF::Variant<> in future.
962
963         * page/scrolling/ScrollingStateNode.h:
964         (WebCore::LayerRepresentation::LayerRepresentation):
965         (WebCore::LayerRepresentation::operator GraphicsLayer* const):
966
967 2019-03-18  Commit Queue  <commit-queue@webkit.org>
968
969         Unreviewed, rolling out r243092 and r243096.
970         https://bugs.webkit.org/show_bug.cgi?id=195926
971
972         Caused assertions in tests (Requested by smfr on #webkit).
973
974         Reverted changesets:
975
976         "Layer with no backing store should still hit-test over a
977         scroller"
978         https://bugs.webkit.org/show_bug.cgi?id=195378
979         https://trac.webkit.org/changeset/243092
980
981         "Try to fix Windows build."
982         https://trac.webkit.org/changeset/243096
983
984 2019-03-18  Megan Gardner  <megan_gardner@apple.com>
985
986         Smart Insert for paragraphs.
987         https://bugs.webkit.org/show_bug.cgi?id=194880
988
989         Reviewed by Ryosuke Niwa.
990
991         Add additional newlines to maintain spacing around paragraphs.
992
993         Tests: editing/pasteboard/smart-paste-paragraph-001.html
994                editing/pasteboard/smart-paste-paragraph-002.html
995                editing/pasteboard/smart-paste-paragraph-003.html
996                editing/pasteboard/smart-paste-paragraph-004.html
997
998         * dom/Document.cpp:
999         (WebCore::Document::editingBehavior const):
1000         * dom/Document.h:
1001
1002         Expose editing behaviour through document so that is can be access from the selection commands
1003         and allow the editing behaviour to be used.
1004
1005         * editing/CompositeEditCommand.h:
1006         * editing/EditingBehavior.h:
1007         (WebCore::EditingBehavior::shouldSmartInsertDeleteParagraphs const):
1008
1009         Only have editing insert paragraphs on iOS and in editing elements that support multiple lines.
1010
1011         * editing/ReplaceSelectionCommand.cpp:
1012         (WebCore::ReplaceSelectionCommand::doApply):
1013         (WebCore::ReplaceSelectionCommand::shouldPerformSmartParagraphReplace const):
1014         (WebCore::ReplaceSelectionCommand::addNewLinesForSmartReplace):
1015         * editing/ReplaceSelectionCommand.h:
1016
1017         Add addititional newlines when pasting full paragraphs to maintian two newlines between paragraphs
1018         if that is what the original document had. If there are not multiple lines between paragraphs, do not
1019         add additional new lines.
1020
1021 2019-03-18  Ryosuke Niwa  <rniwa@webkit.org>
1022
1023         Reduce the size of Node::deref by eliminating an explicit parentNode check
1024         https://bugs.webkit.org/show_bug.cgi?id=195776
1025
1026         Reviewed by Geoffrey Garen.
1027
1028         This patch eliminates the nullity check of m_parentNode in Node::deref as well as the store to
1029         m_refCount in the case of invoking Node::removedLastRef() as done for RefCounted in r30042.
1030         Together, this patch shrinks WebCore's size by 46KB or ~0.7%.
1031
1032         To do this, we take we take a similar approach as WTF::String by using the lowest bit of m_refCount
1033         to indicate whether a node has a parent or not. Regular ref-counting is done on the upper 31 bits.
1034         Node::setParentNode updates this flag, and Node::deref() would only `delete this` if m_refCount
1035         is identically equal to 0.
1036
1037         For a Document, we set m_refCounted to 0 before in the case of non-zero m_referencingNodeCount
1038         since decrementReferencingNodeCount needs to be able to tell if there is an outstanding Ref/RefPtr
1039         or not when m_referencingNodeCount becomes 0.
1040
1041         No new tests since there should be no behavioral change.
1042
1043         * dom/Document.cpp:
1044         (WebCore::Document::removedLastRef):
1045         * dom/Document.h:
1046         (WebCore::Document::decrementReferencingNodeCount):
1047         * dom/Node.cpp:
1048         (WebCore::Node::Node): Moved the initialization of m_refCount to the member variable declaration.
1049         (WebCore::Node::~Node):
1050         (WebCore::Node::removedLastRef):
1051         * dom/Node.h:
1052         (WebCore::Node): Changed the type of m_refCount from signed int to uint32_t. It was changed from
1053         unsigned int to signed int back in r11492 but I don't think the signedness is needed.
1054         (WebCore::Node::ref): Increment the ref count by 2 (upper 31-bit).
1055         (WebCore::Node::deref): Implemented the optimization. This is what shrinks the WebCore binary size.
1056         (WebCore::Node::hasOneRef const):
1057         (WebCore::Node::refCount const): Ignore the lowest bit. Without this fix, the optimization in
1058         replaceChildrenWithFragment to avoid replacing the text node is disabled whenever there is a parent.
1059         (WebCore::Node::setParentNode): Sets the lowest bit to 1 if the node has a parent and 0 otherwise.
1060
1061 2019-03-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
1062
1063         Remove the SVG property tear off objects for SVGAnimatedBoolean
1064         https://bugs.webkit.org/show_bug.cgi?id=195862
1065
1066         Reviewed by Simon Fraser.
1067
1068         -- SVGAnimatedBoolean will be defined as SVGAnimatedPrimitiveProperty<bool>.
1069         -- SVGAnimatedBooleanAccessor is added to access a member of this type.
1070         -- A function registerProperty() is added to SVGPropertyOwnerRegistry
1071            to register this type.
1072         -- SVGAnimatedBooleanAnimator is added to animate a member of this type.
1073         -- SVGAnimationBooleanFunction is added to handle the progress of this
1074            new type over a period of time.
1075
1076         SVGAnimationDiscreteFunction is the base class of SVGAnimationBooleanFunction.
1077         It will be the base class of all the discrete animation function types:
1078         string, bool, enum and PreserveAspectRatio types.
1079
1080         * Sources.txt:
1081         * WebCore.xcodeproj/project.pbxproj:
1082         * svg/SVGAnimationElement.h:
1083         * svg/SVGAnimatorFactory.h:
1084         (WebCore::SVGAnimatorFactory::create):
1085         * svg/SVGClipPathElement.h:
1086         * svg/SVGCursorElement.h:
1087         * svg/SVGDefsElement.h:
1088         * svg/SVGExternalResourcesRequired.cpp:
1089         (WebCore::SVGExternalResourcesRequired::SVGExternalResourcesRequired):
1090         (WebCore::SVGExternalResourcesRequired::parseAttribute):
1091         (WebCore::SVGExternalResourcesRequired::registerAttributes): Deleted.
1092         * svg/SVGExternalResourcesRequired.h:
1093         (WebCore::SVGExternalResourcesRequired::externalResourcesRequired const):
1094         (WebCore::SVGExternalResourcesRequired::externalResourcesRequiredAnimated):
1095         (WebCore::SVGExternalResourcesRequired::setExternalResourcesRequired): Deleted.
1096         * svg/SVGFEConvolveMatrixElement.cpp:
1097         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
1098         (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
1099         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
1100         * svg/SVGFEConvolveMatrixElement.h:
1101         * svg/SVGFEImageElement.h:
1102         * svg/SVGFontElement.h:
1103         * svg/SVGForeignObjectElement.h:
1104         * svg/SVGGElement.h:
1105         * svg/SVGGradientElement.h:
1106         * svg/SVGMPathElement.h:
1107         * svg/SVGMarkerElement.h:
1108         * svg/SVGMaskElement.h:
1109         * svg/SVGPathElement.h:
1110         * svg/SVGPatternElement.h:
1111         * svg/SVGRectElement.h:
1112         * svg/SVGSVGElement.h:
1113         * svg/SVGScriptElement.h:
1114         * svg/SVGSwitchElement.h:
1115         * svg/SVGSymbolElement.h:
1116         * svg/SVGTextContentElement.h:
1117         * svg/SVGUseElement.h:
1118         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
1119         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
1120         * svg/properties/SVGAnimatedPropertyImpl.h:
1121         * svg/properties/SVGAnimationDiscreteFunction.h: Added.
1122         (WebCore::SVGAnimationDiscreteFunction::SVGAnimationDiscreteFunction):
1123         (WebCore::SVGAnimationDiscreteFunction::progress):
1124         * svg/properties/SVGAnimationDiscreteFunctionImpl.h: Added.
1125         * svg/properties/SVGAttributeRegistry.h:
1126         * svg/properties/SVGPropertyOwnerRegistry.h:
1127         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
1128
1129 2019-03-18  Simon Fraser  <simon.fraser@apple.com>
1130
1131         Crash when reloading test with async overflow scrolling
1132         https://bugs.webkit.org/show_bug.cgi?id=195629
1133         <rdar://problem/48814045>
1134
1135         Reviewed by Antoine Quint.
1136
1137         RenderLayerCompositor::removeFromScrollCoordinatedLayers needs to pass the Positioning
1138         bit to make sure we remove RenderLayers added m_scrollingNodeToLayerMap for Positioning
1139         scrolling nodes.
1140
1141         Fixes crashes seen in compositing/clipping/border-radius-async-overflow-non-stacking.html
1142         and scrollingcoordinator/scrolling-tree/remove-coordinated-frame.html.
1143
1144         * rendering/RenderLayerBacking.cpp:
1145         (WebCore::RenderLayerBacking::~RenderLayerBacking):
1146         * rendering/RenderLayerCompositor.cpp:
1147         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
1148
1149 2019-03-18  Devin Rousso  <drousso@apple.com>
1150
1151         Web Inspector: Timeline: lazily create the agent
1152         https://bugs.webkit.org/show_bug.cgi?id=195865
1153         <rdar://problem/48965403>
1154
1155         Reviewed by Joseph Pecoraro.
1156
1157         No change in functionality.
1158
1159         * inspector/agents/InspectorTimelineAgent.h:
1160         * inspector/agents/InspectorTimelineAgent.cpp:
1161         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
1162         (WebCore::InspectorTimelineAgent::toggleScriptProfilerInstrument):
1163         (WebCore::InspectorTimelineAgent::toggleHeapInstrument):
1164         (WebCore::InspectorTimelineAgent::setFrameIdentifier):
1165
1166         * inspector/InspectorInstrumentation.h:
1167         (WebCore::InspectorInstrumentation::startProfiling):
1168         (WebCore::InspectorInstrumentation::stopProfiling):
1169         (WebCore::InspectorInstrumentation::didRequestAnimationFrame):
1170         (WebCore::InspectorInstrumentation::didCancelAnimationFrame):
1171
1172         * inspector/InstrumentingAgents.h:
1173         (WebCore::InstrumentingAgents::inspectorScriptProfilerAgent const): Added.
1174         (WebCore::InstrumentingAgents::setInspectorScriptProfilerAgent): Added.
1175         * inspector/InstrumentingAgents.cpp:
1176         (WebCore::InstrumentingAgents::reset):
1177
1178         * inspector/InspectorController.cpp:
1179         (WebCore::InspectorController::InspectorController):
1180         (WebCore::InspectorController::createLazyAgents):
1181
1182 2019-03-18  Darin Adler  <darin@apple.com>
1183
1184         Cut down on use of StringBuffer, possibly leading toward removing it entirely
1185         https://bugs.webkit.org/show_bug.cgi?id=195870
1186
1187         Reviewed by Daniel Bates.
1188
1189         * dom/Document.cpp:
1190         (WebCore::canonicalizedTitle): Fixed all the problems mentioned in "FIXME".
1191         Made this a single function rather than a function template. Switch to
1192         StringBuilder instead of StringBuffer. Return the original string if the
1193         canonicalize operation doesn't change anything.
1194         (WebCore::Document::updateTitle): Updated for the change above.
1195
1196         * platform/Length.cpp:
1197         (WebCore::newCoordsArray): Use createUninitialized instead of StringBuffer.
1198         Also got rid of unneeded use of upconvertedCharacters on a temporary string
1199         that we explicitly created with 16-bit characters. The performance of this
1200         function could be considerably simplified by not copying the original string
1201         at all, but didn't do that at this time.
1202
1203         * platform/text/TextCodecUTF16.cpp:
1204         (WebCore::TextCodecUTF16::decode): Use createUninitialized instead of
1205         StringBuffer. Also renamed numChars to numCodeUnits to both switch to complete
1206         words and to be slightly more accurate.
1207
1208         * rendering/RenderText.cpp:
1209         (WebCore::convertNoBreakSpace): Added.
1210         (WebCore::capitalize): Use Vector instead of StringBuffer. Simplify code by
1211         using convertNoBreakSpace function. Removed code that was using StringImpl
1212         directly for a tiny speed boost; if we want to optimize the performance of
1213         this function we would need to do more than that. Return the original string
1214         if it happens to already be capitalized.
1215
1216 2019-03-18  Timothy Hatcher  <timothy@apple.com>
1217
1218         WKWebView.GetContentsShouldReturnAttributedString is crashing on iOS Simulator.
1219         https://bugs.webkit.org/show_bug.cgi?id=195916
1220
1221         Reviewed by Tim Horton.
1222
1223         * WebCore.xcodeproj/project.pbxproj: Make ColorIOS.h a private header.
1224         * platform/ios/ColorIOS.h: Export colorFromUIColor.
1225
1226 2019-03-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
1227
1228         Define the type of SVGPropertyOwnerRegistry for all SVG elements
1229         https://bugs.webkit.org/show_bug.cgi?id=195859
1230
1231         Reviewed by Simon Fraser.
1232
1233         SVGPropertyOwnerRegistry will eventually replace SVGAttributeOwnerProxyImpl.
1234
1235         * svg/SVGAElement.h:
1236         * svg/SVGAltGlyphElement.h:
1237         * svg/SVGAnimationElement.h:
1238         * svg/SVGCircleElement.h:
1239         * svg/SVGClipPathElement.h:
1240         * svg/SVGComponentTransferFunctionElement.h:
1241         (WebCore::SVGComponentTransferFunctionElement::attributeRegistry):
1242         (WebCore::SVGComponentTransferFunctionElement::isKnownAttribute):
1243         * svg/SVGCursorElement.h:
1244         * svg/SVGDefsElement.h:
1245         * svg/SVGElement.h:
1246         * svg/SVGEllipseElement.h:
1247         * svg/SVGExternalResourcesRequired.h:
1248         (WebCore::SVGExternalResourcesRequired::isKnownAttribute):
1249         * svg/SVGFEBlendElement.h:
1250         * svg/SVGFEColorMatrixElement.h:
1251         * svg/SVGFEComponentTransferElement.h:
1252         * svg/SVGFECompositeElement.h:
1253         * svg/SVGFEConvolveMatrixElement.h:
1254         * svg/SVGFEDiffuseLightingElement.h:
1255         * svg/SVGFEDisplacementMapElement.h:
1256         * svg/SVGFEDropShadowElement.h:
1257         * svg/SVGFEGaussianBlurElement.h:
1258         * svg/SVGFEImageElement.h:
1259         * svg/SVGFELightElement.h:
1260         (WebCore::SVGFELightElement::attributeRegistry):
1261         (WebCore::SVGFELightElement::isKnownAttribute):
1262         * svg/SVGFEMergeNodeElement.h:
1263         * svg/SVGFEMorphologyElement.h:
1264         * svg/SVGFEOffsetElement.h:
1265         * svg/SVGFESpecularLightingElement.h:
1266         * svg/SVGFETileElement.h:
1267         * svg/SVGFETurbulenceElement.cpp:
1268         (WebCore::SVGFETurbulenceElement::svgAttributeChanged):
1269         * svg/SVGFETurbulenceElement.h:
1270         * svg/SVGFilterElement.h:
1271         * svg/SVGFilterPrimitiveStandardAttributes.h:
1272         (WebCore::SVGFilterPrimitiveStandardAttributes::isKnownAttribute):
1273         * svg/SVGFitToViewBox.h:
1274         (WebCore::SVGFitToViewBox::isKnownAttribute):
1275         * svg/SVGFontElement.h:
1276         * svg/SVGForeignObjectElement.h:
1277         * svg/SVGGElement.h:
1278         * svg/SVGGeometryElement.h:
1279         (WebCore::SVGGeometryElement::isKnownAttribute):
1280         * svg/SVGGlyphRefElement.h:
1281         * svg/SVGGradientElement.h:
1282         (WebCore::SVGGradientElement::isKnownAttribute):
1283         * svg/SVGGraphicsElement.h:
1284         (WebCore::SVGGraphicsElement::isKnownAttribute):
1285         * svg/SVGImageElement.h:
1286         * svg/SVGLineElement.h:
1287         * svg/SVGLinearGradientElement.h:
1288         * svg/SVGMPathElement.h:
1289         * svg/SVGMarkerElement.h:
1290         * svg/SVGMaskElement.h:
1291         * svg/SVGPathElement.h:
1292         * svg/SVGPatternElement.h:
1293         * svg/SVGPolyElement.h:
1294         (WebCore::SVGPolyElement::attributeRegistry):
1295         (WebCore::SVGPolyElement::isKnownAttribute):
1296         * svg/SVGRadialGradientElement.h:
1297         * svg/SVGRectElement.h:
1298         * svg/SVGSVGElement.h:
1299         * svg/SVGScriptElement.h:
1300         * svg/SVGStopElement.h:
1301         * svg/SVGSwitchElement.h:
1302         * svg/SVGSymbolElement.h:
1303         * svg/SVGTRefElement.h:
1304         * svg/SVGTests.h:
1305         * svg/SVGTextContentElement.h:
1306         (WebCore::SVGTextContentElement::isKnownAttribute):
1307         * svg/SVGTextPathElement.h:
1308         * svg/SVGTextPositioningElement.h:
1309         (WebCore::SVGTextPositioningElement::isKnownAttribute):
1310         * svg/SVGURIReference.h:
1311         * svg/SVGUseElement.h:
1312         * svg/SVGViewElement.h:
1313         * svg/SVGViewSpec.h:
1314         * svg/SVGZoomAndPan.cpp:
1315         (WebCore::SVGZoomAndPan::parseZoomAndPan):
1316         (WebCore::SVGZoomAndPan::parseAttribute):
1317         (WebCore::SVGZoomAndPan::SVGZoomAndPan): Deleted.
1318         (WebCore::SVGZoomAndPan::registerAttributes): Deleted.
1319         * svg/SVGZoomAndPan.h:
1320         (WebCore::SVGZoomAndPan::zoomAndPan const):
1321         (WebCore::SVGZoomAndPan::setZoomAndPan):
1322         (WebCore::SVGZoomAndPan::reset):
1323         (WebCore::SVGZoomAndPan::attributeRegistry): Deleted.
1324         (WebCore::SVGZoomAndPan::isKnownAttribute): Deleted.
1325
1326 2019-03-18  Timothy Hatcher  <timothy@apple.com>
1327
1328         Add new NSAttributedString API for converting HTML.
1329         https://bugs.webkit.org/show_bug.cgi?id=195636
1330         rdar://problem/45055697
1331
1332         Reviewed by Tim Horton.
1333
1334         * en.lproj/Localizable.strings: Updated.
1335
1336 2019-03-18  Zalan Bujtas  <zalan@apple.com>
1337
1338         Call transition and animation callbacks on non-composited renderers too.
1339         https://bugs.webkit.org/show_bug.cgi?id=195907
1340
1341         Reviewed by Simon Fraser.
1342
1343         These callbacks are not composited specific functions.
1344
1345         * page/animation/AnimationBase.cpp:
1346         (WebCore::AnimationBase::freezeAtTime):
1347         (WebCore::AnimationBase::compositedRenderer const): Deleted.
1348         * page/animation/AnimationBase.h:
1349         * page/animation/ImplicitAnimation.cpp:
1350         (WebCore::ImplicitAnimation::startAnimation):
1351         (WebCore::ImplicitAnimation::pauseAnimation):
1352         (WebCore::ImplicitAnimation::endAnimation):
1353         * page/animation/KeyframeAnimation.cpp:
1354         (WebCore::KeyframeAnimation::startAnimation):
1355         (WebCore::KeyframeAnimation::pauseAnimation):
1356         (WebCore::KeyframeAnimation::endAnimation):
1357         * rendering/RenderLayerModelObject.cpp:
1358         (WebCore::RenderLayerModelObject::startTransition):
1359         (WebCore::RenderLayerModelObject::transitionPaused):
1360         (WebCore::RenderLayerModelObject::transitionFinished):
1361         (WebCore::RenderLayerModelObject::startAnimation):
1362         (WebCore::RenderLayerModelObject::animationPaused):
1363         (WebCore::RenderLayerModelObject::animationSeeked):
1364         (WebCore::RenderLayerModelObject::animationFinished):
1365         (WebCore::RenderLayerModelObject::suspendAnimations):
1366
1367 2019-03-18  Jer Noble  <jer.noble@apple.com>
1368
1369         Add experimental "alphaChannel" property to VideoConfiguration
1370         https://bugs.webkit.org/show_bug.cgi?id=195853
1371
1372         Reviewed by Eric Carlson.
1373
1374         Test: media/mediacapabilities/mock-decodingInfo-alphaChannel.html
1375
1376         Add a new, experimental addition to Media Capabilities to allow pages to query for
1377         alpha channel support.
1378
1379         * Modules/mediacapabilities/MediaCapabilities.cpp:
1380         (WebCore::MediaCapabilities::decodingInfo):
1381         * Modules/mediacapabilities/MediaCapabilities.h:
1382         * Modules/mediacapabilities/MediaCapabilities.idl:
1383         * Modules/mediacapabilities/VideoConfiguration.idl:
1384         * SourcesCocoa.txt:
1385         * WebCore.xcodeproj/project.pbxproj:
1386         * platform/cocoa/VideoToolboxSoftLink.cpp:
1387         * platform/cocoa/VideoToolboxSoftLink.h:
1388         * platform/graphics/cocoa/HEVCUtilitiesCocoa.h:
1389         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm: Renamed from Source/WebCore/platform/graphics/cocoa/HEVCUtilitiesCocoa.cpp.
1390         (WebCore::validateHEVCParameters):
1391         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
1392         (WebCore::createMediaPlayerDecodingConfigurationCocoa):
1393         * platform/mediacapabilities/VideoConfiguration.h:
1394         * platform/mock/MediaEngineConfigurationFactoryMock.cpp:
1395         (WebCore::canDecodeMedia):
1396         (WebCore::canEncodeMedia):
1397
1398 2019-03-18  Ryosuke Niwa  <rniwa@webkit.org>
1399
1400         Remove unused webkitEditableContentChanged event
1401         https://bugs.webkit.org/show_bug.cgi?id=195909
1402
1403         Reviewed by Wenson Hsieh.
1404
1405         Removed webkitEditableContentChanged event which is no longer used after r206944.
1406
1407         Note that only WebKit's C++ code can fire events in TextControlInnerElements
1408         since the element is an implementation detail of input and textarea elements.
1409
1410         * dom/EventNames.h:
1411         * html/shadow/TextControlInnerElements.cpp:
1412         (WebCore::TextControlInnerTextElement::defaultEventHandler):
1413
1414 2019-03-18  Myles C. Maxfield  <mmaxfield@apple.com>
1415
1416         [WHLSL] Hook up the compiler to our WebGPU implementation
1417         https://bugs.webkit.org/show_bug.cgi?id=195509
1418
1419         Unreviewed.
1420
1421         Update after r243091.
1422
1423         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
1424         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
1425         (WebCore::trySetWHLSLFunctionsForPipelineDescriptor):
1426
1427 2019-03-18  Chris Dumez  <cdumez@apple.com>
1428
1429         REGRESSION(r236862): early frame decoupling leaves JSC ArrayBuffer objects lingering
1430         https://bugs.webkit.org/show_bug.cgi?id=195322
1431
1432         Reviewed by Ryosuke Niwa.
1433
1434         Since r236862, DOMWindow objects get disconnected from their Frame object as soon as
1435         their iframe element gets removed from the document. Previously, DOMWindow was a
1436         FrameDestructionObserver and would stay connected to its frame until the frame died.
1437
1438         This means that some of the work that we were doing in DOMWindow::frameDestroyed() and
1439         Document::willDetachPage() no longer happens for subframe windows because they get
1440         disconnected from their frame because they get a chance to get such notifications.
1441         To address this issue, we now also do this work in DOMWindow::willDetachDocumentFromFrame()
1442         which gets called when the iframe gets removed from the document and the document / window
1443         get disconnected from the Frame element.
1444
1445         No new tests, verified locally that the leak is gone on JetStream.
1446
1447         * page/DOMWindow.cpp:
1448         (WebCore::DOMWindow::willDetachDocumentFromFrame):
1449
1450 2019-03-18  Zalan Bujtas  <zalan@apple.com>
1451
1452         Move animation and transition functions from RenderBoxModelObject to RenderElement
1453         https://bugs.webkit.org/show_bug.cgi?id=195903
1454
1455         Reviewed by Simon Fraser.
1456
1457         Transitions and animations do not require RenderBoxModelObject. Move these functions to RenderElement and override them at RenderLayerModelObject to support
1458         composition related callbacks.
1459
1460         * page/animation/AnimationBase.cpp:
1461         (WebCore::AnimationBase::compositedRenderer const):
1462         * page/animation/AnimationBase.h:
1463         * rendering/RenderBoxModelObject.cpp:
1464         (WebCore::RenderBoxModelObject::startTransition): Deleted.
1465         (WebCore::RenderBoxModelObject::transitionPaused): Deleted.
1466         (WebCore::RenderBoxModelObject::transitionFinished): Deleted.
1467         (WebCore::RenderBoxModelObject::startAnimation): Deleted.
1468         (WebCore::RenderBoxModelObject::animationPaused): Deleted.
1469         (WebCore::RenderBoxModelObject::animationSeeked): Deleted.
1470         (WebCore::RenderBoxModelObject::animationFinished): Deleted.
1471         (WebCore::RenderBoxModelObject::suspendAnimations): Deleted.
1472         * rendering/RenderBoxModelObject.h:
1473         * rendering/RenderElement.cpp:
1474         (WebCore::RenderElement::startTransition):
1475         (WebCore::RenderElement::transitionPaused):
1476         (WebCore::RenderElement::transitionFinished):
1477         (WebCore::RenderElement::startAnimation):
1478         (WebCore::RenderElement::animationPaused):
1479         (WebCore::RenderElement::animationSeeked):
1480         (WebCore::RenderElement::animationFinished):
1481         (WebCore::RenderElement::suspendAnimations):
1482         * rendering/RenderElement.h:
1483
1484 2019-03-18  Antti Koivisto  <antti@apple.com>
1485
1486         Try to fix Windows build.
1487
1488         * rendering/RenderLayerBacking.cpp:
1489         (WebCore::RenderLayerBacking::updateEventRegion):
1490
1491 2019-03-18  Antti Koivisto  <antti@apple.com>
1492
1493         Layer with no backing store should still hit-test over a scroller
1494         https://bugs.webkit.org/show_bug.cgi?id=195378
1495         <rdar://problem/48652078>
1496
1497         Reviewed by Simon Fraser.
1498
1499         Tests: fast/scrolling/ios/overflow-scroll-overlap-3.html
1500                fast/scrolling/ios/overflow-scroll-overlap-4.html
1501
1502         Move collecting event region from paint to compositing update time.
1503         This solves a number of problems including regions for non-painting layers.
1504
1505         * platform/graphics/GraphicsLayer.h:
1506         * rendering/RenderBlock.cpp:
1507         (WebCore::RenderBlock::paintObject):
1508
1509         Use the existing visibleToHitTesting() helper.
1510
1511         * rendering/RenderLayer.cpp:
1512         (WebCore::RenderLayer::paintLayerContents):
1513
1514         Use flag for event region collecting, don't paint content.
1515
1516         (WebCore::RenderLayer::paintList):
1517
1518         We can bail out immediately if there is no overflow.
1519
1520         (WebCore::RenderLayer::paintForegroundForFragments):
1521         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
1522         (WebCore::RenderLayer::collectEventRegionForFragments):
1523
1524         Move to a separate function.
1525
1526         * rendering/RenderLayer.h:
1527         * rendering/RenderLayerBacking.cpp:
1528         (WebCore::RenderLayerBacking::updateConfiguration):
1529
1530         Update event region on backing configuration update. This is called after anything interesting changes on a sublayer.
1531
1532         (WebCore::RenderLayerBacking::updateEventRegion):
1533         (WebCore::RenderLayerBacking::paintIntoLayer):
1534         * rendering/RenderLayerBacking.h:
1535
1536 2019-03-18  Myles C. Maxfield  <mmaxfield@apple.com>
1537
1538         [WHLSL] Hook up the compiler to our WebGPU implementation
1539         https://bugs.webkit.org/show_bug.cgi?id=195509
1540
1541         Reviewed by Dean Jackson.
1542
1543         This represents a collection of changes necessary to compile and run the first WHLSL program in WebKit.
1544
1545         Because WHLSL isn't fully implemented yet, this patch doesn't remove the existing method for supplying
1546         Metal shaders to WebGPU. Instead, it adds a new boolean to WebGPUShaderModuleDescriptor, "isWHLSL" which
1547         causes us to run the WHLSL compiler.
1548
1549         More details below.
1550
1551         Test: webgpu/whlsl.html
1552
1553         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h: Use raw pointer instead of Optional<std::reference_wrapper>.
1554         (WebCore::WHLSL::AST::CallExpression::setCastData):
1555         (WebCore::WHLSL::AST::CallExpression::isCast):
1556         (WebCore::WHLSL::AST::CallExpression::castReturnType):
1557         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
1558         (WebCore::WHLSL::AST::NativeTypeDeclaration::isAtomic const):
1559         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsAtomic):
1560         (WebCore::WHLSL::AST::NativeTypeDeclaration::name const): Deleted. The parent class already has a name string.
1561         (WebCore::WHLSL::AST::NativeTypeDeclaration::name): Deleted.
1562         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
1563         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
1564         (WebCore::WHLSL::AST::TypeReference::cloneTypeReference const): When cloning a type reference, make sure to
1565         clone the pointer to its resolved type, too.
1566         * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
1567         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: Incorporate resolution from
1568         https://github.com/gpuweb/gpuweb/pull/188.
1569         (WebCore::WHLSL::Metal::EntryPointScaffolding::EntryPointScaffolding):
1570         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
1571         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceSignature):
1572         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::helperTypes):
1573         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::unpack):
1574         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::pack): Support semantics being placed directly on the
1575         entry point, instead of being placed on a structure member.
1576         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes):
1577         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::pack): Ditto.
1578         (WebCore::WHLSL::Metal::EntryPointScaffolding::mappedBindGroups const): Deleted.
1579         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
1580         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
1581         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
1582         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::createEntryPointScaffolding):
1583         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::createEntryPointScaffolding):
1584         (WebCore::WHLSL::Metal::metalFunctions):
1585         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::takeVertexMappedBindGroups): Deleted. After
1586         https://github.com/gpuweb/gpuweb/pull/188, we don't need the mappings.
1587         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::takeFragmentMappedBindGroups): Deleted. Ditto.
1588         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::takeMappedBindGroups): Deleted. Ditto.
1589         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h: Ditto.
1590         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp: Ditto.
1591         (WebCore::WHLSL::Metal::generateMetalCodeShared):
1592         (WebCore::WHLSL::Metal::generateMetalCode):
1593         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h: Ditto.
1594         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp: Support compiler-generated functions. Change
1595         CRASH() to notImplemented().
1596         (WebCore::WHLSL::Metal::writeNativeFunction):
1597         (WebCore::WHLSL::Metal::getNativeName): Deleted.
1598         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
1599         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
1600         (WebCore::WHLSL::Metal::writeNativeType): 
1601         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp: The dependency graph needs to track all unnamed types. Also,
1602         we need to track types that are the results of expressions (not just types literally spelled out in the
1603         program). Enumerations need to be emitted after their base types are emitted.
1604         (WebCore::WHLSL::Metal::TypeNamer::visit):
1605         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::MetalTypeDeclarationWriter):
1606         (WebCore::WHLSL::Metal::TypeNamer::metalTypeDeclarations):
1607         (WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
1608         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
1609         (WebCore::WHLSL::Metal::TypeNamer::emitAllUnnamedTypeDefinitions):
1610         (WebCore::WHLSL::Metal::TypeNamer::metalTypeDefinitions):
1611         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h:
1612         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
1613         (WebCore::WHLSL::checkDuplicateFunctions):
1614         * Modules/webgpu/WHLSL/WHLSLChecker.cpp: Wrap ResolvingType in a class to make sure it plays nicely with
1615         HashMap. Also, use raw pointers instead of Optional<std::reference_wrapper>s.
1616         (WebCore::WHLSL::resolveWithReferenceComparator):
1617         (WebCore::WHLSL::resolveByInstantiation):
1618         (WebCore::WHLSL::checkOperatorOverload):
1619         (WebCore::WHLSL::Checker::assignTypes):
1620         (WebCore::WHLSL::Checker::checkShaderType):
1621         (WebCore::WHLSL::Checker::visit):
1622         (WebCore::WHLSL::matchAndCommit):
1623         (WebCore::WHLSL::Checker::recurseAndGetInfo):
1624         (WebCore::WHLSL::Checker::assignType):
1625         (WebCore::WHLSL::Checker::forwardType):
1626         (WebCore::WHLSL::getUnnamedType):
1627         (WebCore::WHLSL::Checker::finishVisitingPropertyAccess):
1628         (WebCore::WHLSL::Checker::isBoolType):
1629         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
1630         (WebCore::WHLSL::Gatherer::visit):
1631         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
1632         (WebCore::WHLSL::inferTypesForCall):
1633         * Modules/webgpu/WHLSL/WHLSLInferTypes.h:
1634         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
1635         (WebCore::WHLSL::Intrinsics::addPrimitive):
1636         (WebCore::WHLSL::Intrinsics::addFullTexture):
1637         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
1638         (WebCore::WHLSL::Intrinsics::ucharType const):
1639         (WebCore::WHLSL::Intrinsics::ushortType const):
1640         (WebCore::WHLSL::Intrinsics::charType const):
1641         (WebCore::WHLSL::Intrinsics::shortType const):
1642         (WebCore::WHLSL::Intrinsics::intType const):
1643         (WebCore::WHLSL::Intrinsics::uchar2Type const):
1644         (WebCore::WHLSL::Intrinsics::uchar4Type const):
1645         (WebCore::WHLSL::Intrinsics::ushort2Type const):
1646         (WebCore::WHLSL::Intrinsics::ushort4Type const):
1647         (WebCore::WHLSL::Intrinsics::uint2Type const):
1648         (WebCore::WHLSL::Intrinsics::uint4Type const):
1649         (WebCore::WHLSL::Intrinsics::char2Type const):
1650         (WebCore::WHLSL::Intrinsics::char4Type const):
1651         (WebCore::WHLSL::Intrinsics::short2Type const):
1652         (WebCore::WHLSL::Intrinsics::short4Type const):
1653         (WebCore::WHLSL::Intrinsics::int2Type const):
1654         (WebCore::WHLSL::Intrinsics::int4Type const):
1655         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
1656         (WebCore::WHLSL::Lexer::recognizeKeyword):
1657         * Modules/webgpu/WHLSL/WHLSLNameContext.cpp:
1658         (WebCore::WHLSL::NameContext::add):
1659         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
1660         (WebCore::WHLSL::NameResolver::visit): Don't visit recursive types.
1661         Also, make sure we preserve the CurrentFunction in our recursive scopes.
1662         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
1663         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
1664         (WebCore::WHLSL::Parser::fail):
1665         (WebCore::WHLSL::Parser::peek):
1666         (WebCore::WHLSL::Parser::parseType):
1667         (WebCore::WHLSL::Parser::parseBuiltInSemantic):
1668         * Modules/webgpu/WHLSL/WHLSLParser.h:
1669         * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h:
1670         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
1671         (WebCore::WHLSL::prepareShared):
1672         (WebCore::WHLSL::prepare):
1673         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
1674         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp: Move big inline functions out-of-line.
1675         (WebCore::WHLSL::RecursiveTypeChecker::visit):
1676         (WebCore::WHLSL::checkRecursiveTypes):
1677         (): Deleted.
1678         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
1679         (WebCore::WHLSL::conversionCost):
1680         (WebCore::WHLSL::resolveFunctionOverloadImpl):
1681         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.h:
1682         * Modules/webgpu/WHLSL/WHLSLResolvingType.h:
1683         (WebCore::WHLSL::ResolvingType::ResolvingType):
1684         (WebCore::WHLSL::ResolvingType::operator=):
1685         (WebCore::WHLSL::ResolvingType::getUnnamedType):
1686         (WebCore::WHLSL::ResolvingType::visit):
1687         * Modules/webgpu/WHLSL/WHLSLScopedSetAdder.h: Renamed from Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLMappedBindings.h.
1688         (WebCore::WHLSL::ScopedSetAdder::ScopedSetAdder):
1689         (WebCore::WHLSL::ScopedSetAdder::~ScopedSetAdder):
1690         (WebCore::WHLSL::ScopedSetAdder::isNewEntry const):
1691         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp:
1692         (WebCore::WHLSL::isAcceptableFormat):
1693         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: Turns out a bunch of texture types don't exist in MSL.
1694         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
1695         (WebCore::WHLSL::synthesizeArrayOperatorLength):
1696         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.h:
1697         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: Adding to the program can fail.
1698         (WebCore::WHLSL::synthesizeConstructors): Some constructors shouldn't be generated for "void" and for atomic types.
1699         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.h: Adding to the program can fail.
1700         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp: Ditto.
1701         (WebCore::WHLSL::synthesizeEnumerationFunctions):
1702         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.h: Ditto.
1703         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp: Ditto.
1704         (WebCore::WHLSL::synthesizeStructureAccessors):
1705         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.h: Ditto.
1706         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
1707         (WebCore::WHLSL::Visitor::visit):
1708         * Modules/webgpu/WebGPUDevice.cpp: Add flag that triggers the WHLSL compiler.
1709         (WebCore::WebGPUDevice::createShaderModule const):
1710         * Modules/webgpu/WebGPUShaderModuleDescriptor.h: Ditto.
1711         * Modules/webgpu/WebGPUShaderModuleDescriptor.idl: Ditto.
1712         * WebCore.xcodeproj/project.pbxproj:
1713         * platform/graphics/gpu/GPUPipelineLayout.h:
1714         (WebCore::GPUPipelineLayout::bindGroupLayouts const):
1715         * platform/graphics/gpu/GPUShaderModule.h: Add a string that represents the WHLSL shader source. The compiler currently
1716         needs the rest of the pipeline state descriptor, so we defer compilation until create*Pipeline().
1717         (WebCore::GPUShaderModule::platformShaderModule const):
1718         (WebCore::GPUShaderModule::whlslSource const):
1719         * platform/graphics/gpu/GPUShaderModuleDescriptor.h:
1720         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Convert GPU types into WHLSL types, and invoke the compiler.
1721         (WebCore::convertVertexFormat):
1722         (WebCore::convertShaderStageFlags):
1723         (WebCore::convertBindingType):
1724         (WebCore::convertTextureFormat):
1725         (WebCore::convertLayout):
1726         (WebCore::convertRenderPipelineDescriptor):
1727         (WebCore::trySetMetalFunctionsForPipelineDescriptor):
1728         (WebCore::trySetWHLSLFunctionsForPipelineDescriptor):
1729         (WebCore::trySetFunctionsForPipelineDescriptor):
1730         (WebCore::tryCreateMtlRenderPipelineState):
1731         * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm:
1732         (WebCore::GPUShaderModule::create):
1733         (WebCore::GPUShaderModule::GPUShaderModule):
1734
1735 2019-03-18  Justin Fan  <justin_fan@apple.com>
1736
1737         [Web GPU] GPUAdapter.createDevice -> GPUAdapter.requestDevice
1738         https://bugs.webkit.org/show_bug.cgi?id=195781
1739
1740         Reviewed by Myles C. Maxfield.
1741
1742         A Web GPU device is now acquired via a promise returned from GPUAdapter.requestDevice().
1743
1744         Existing tests updated for new behavior.
1745
1746         * Modules/webgpu/WebGPUAdapter.cpp:
1747         (WebCore::WebGPUAdapter::requestDevice const):
1748         (WebCore::WebGPUAdapter::createDevice): Deleted.
1749         * Modules/webgpu/WebGPUAdapter.h:
1750         * Modules/webgpu/WebGPUAdapter.idl:
1751         * Modules/webgpu/WebGPUDevice.cpp:
1752         (WebCore::WebGPUDevice::tryCreate):
1753         (WebCore::WebGPUDevice::WebGPUDevice):
1754         (WebCore::WebGPUDevice::create): Deleted.
1755         * Modules/webgpu/WebGPUDevice.h:
1756         * platform/graphics/gpu/GPUDevice.h:
1757         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
1758         (WebCore::GPUDevice::tryCreate):
1759         (WebCore::GPUDevice::create): Deleted.
1760
1761 2019-03-18  Justin Fan  <justin_fan@apple.com>
1762
1763         [Web GPU] API updates: GPUTexture.createDefaultView and type-safe GPURenderPassEncoder.setPipeline
1764         https://bugs.webkit.org/show_bug.cgi?id=195896
1765
1766         Reviewed by Jon Lee.
1767
1768         Rename createDefaultTextureView -> createDefaultView and move setPipeline from GPUProgrammablePassEncoder to GPURenderPassEncoder.
1769
1770         Existing tests updated for createDefaultView name.
1771
1772         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
1773         (WebCore::WebGPUProgrammablePassEncoder::setPipeline): Deleted.
1774         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
1775         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
1776         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1777         (WebCore::WebGPURenderPassEncoder::setPipeline):
1778         * Modules/webgpu/WebGPURenderPassEncoder.h:
1779         * Modules/webgpu/WebGPURenderPassEncoder.idl:
1780         * Modules/webgpu/WebGPUTexture.cpp:
1781         (WebCore::WebGPUTexture::createDefaultView):
1782         (WebCore::WebGPUTexture::createDefaultTextureView): Deleted.
1783         * Modules/webgpu/WebGPUTexture.h:
1784         * Modules/webgpu/WebGPUTexture.idl:
1785         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
1786         * platform/graphics/gpu/GPURenderPassEncoder.h:
1787
1788 2019-03-18  Chris Dumez  <cdumez@apple.com>
1789
1790         [iOS] The network process sometimes gets killed for trying to suspend while holding locked files
1791         https://bugs.webkit.org/show_bug.cgi?id=195890
1792         <rdar://problem/48934338>
1793
1794         Reviewed by Geoffrey Garen.
1795
1796         The network process sometimes gets killed for trying to suspend while holding locked files while
1797         under SQLiteDatabase::open(). The SQLiteDatabaseTracker normally keeps tracking of "transactions"
1798         in progress so we know that we're holding locked files and the WebSQLiteDatabaseTracker takes
1799         care of notifying the UIProcess via IPC that it should hold a background assertion on our behalf
1800         to avoid trying to suspend while holding locked files.
1801         However, we were missing a SQLiteTransactionInProgressAutoCounter when trying to execute the
1802         PRAGMA statement.
1803
1804         Note that we have a similar SQLiteTransactionInProgressAutoCounter in SQLiteDatabase::useWALJournalMode()
1805         when executing such PRAGMA statement already.
1806
1807         * platform/sql/SQLiteDatabase.cpp:
1808         (WebCore::SQLiteDatabase::open):
1809
1810 2019-03-18  Ryan Haddad  <ryanhaddad@apple.com>
1811
1812         Unreviewed, rolling out r243037.
1813
1814         Broke the Windows build
1815
1816         Reverted changeset:
1817
1818         "Reduce the size of Node::deref by eliminating an explicit
1819         parentNode check"
1820         https://bugs.webkit.org/show_bug.cgi?id=195776
1821         https://trac.webkit.org/changeset/243037
1822
1823 2019-03-18  Eric Carlson  <eric.carlson@apple.com>
1824
1825         Change some logging levels
1826         https://bugs.webkit.org/show_bug.cgi?id=195861
1827         <rdar://problem/48961669>
1828
1829         Reviewed by Jer Noble.
1830
1831         * Modules/mediastream/RTCPeerConnection.cpp:
1832         (WebCore::RTCPeerConnection::dispatchEvent):
1833         * Modules/webaudio/AudioNode.cpp:
1834         (WebCore::AudioNode::addInput):
1835         (WebCore::AudioNode::addOutput):
1836         (WebCore::AudioNode::connect):
1837         (WebCore::AudioNode::disconnect):
1838         * Modules/webaudio/AudioParam.cpp:
1839         (WebCore::AudioParam::connect):
1840         (WebCore::AudioParam::disconnect):
1841         * Modules/webaudio/WaveShaperNode.cpp:
1842         (WebCore::WaveShaperNode::setOversample):
1843         * html/HTMLMediaElement.cpp:
1844         (WebCore::HTMLMediaElement::canPlayType const):
1845         (WebCore::HTMLMediaElement::seekTask):
1846         (WebCore::HTMLMediaElement::dispatchEvent):
1847         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
1848         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
1849         (WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor):
1850         * html/track/InbandGenericTextTrack.cpp:
1851         (WebCore::InbandGenericTextTrack::addGenericCue):
1852         (WebCore::InbandGenericTextTrack::removeGenericCue):
1853         (WebCore::InbandGenericTextTrack::newCuesParsed):
1854         * html/track/InbandWebVTTTextTrack.cpp:
1855         (WebCore::InbandWebVTTTextTrack::newCuesParsed):
1856         * html/track/LoadableTextTrack.cpp:
1857         (WebCore::LoadableTextTrack::newCuesAvailable):
1858         * html/track/TextTrack.cpp:
1859         (WebCore::TextTrack::removeCue):
1860         * inspector/agents/WebConsoleAgent.cpp:
1861         (WebCore::WebConsoleAgent::getLoggingChannels):
1862         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
1863         (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings):
1864         (WebCore::InbandTextTrackPrivateAVF::removeCompletedCues):
1865         (WebCore::InbandTextTrackPrivateAVF::processNativeSamples):
1866         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1867         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
1868         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
1869         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
1870         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1871         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
1872         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
1873         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless const):
1874
1875 2019-03-15  Antoine Quint  <graouts@apple.com>
1876
1877         Make mouse event simulation a quirk
1878         https://bugs.webkit.org/show_bug.cgi?id=195218
1879         <rdar://problem/48516794>
1880
1881         Reviewed by Dean Jackson.
1882
1883         Add new quirks to control whether we should dispatch simulated mouse events and whether we should assume
1884         preventDefault() was called when a simulated "mousemove" event was handled. Currently both return false
1885         but will be made to return more interesting results as we determine heuristics or specific sites that
1886         may require such quirks.
1887
1888         * page/Quirks.cpp:
1889         (WebCore::Quirks::shouldDispatchSimulateMouseEvents const):
1890         (WebCore::Quirks::shouldMousemoveEventHandlingPreventDefault const):
1891         * page/Quirks.h:
1892
1893 2019-03-18  Philippe Normand  <pnormand@igalia.com>
1894
1895         [GStreamer] Rewrite HTTP source element using pushsrc base class
1896         https://bugs.webkit.org/show_bug.cgi?id=195631
1897
1898         Reviewed by Xabier Rodriguez-Calvar.
1899
1900         If we want to use webkitwebsrc in adaptivedemux (HLS, DASH, etc)
1901         we need a source element that behaves like souphttpsrc, which is
1902         implemented using pushsrc. This rewrite might also fix some seek
1903         issues.
1904
1905         No new tests, existing http/tests/media tests cover this patch.
1906
1907         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1908         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1909         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1910         (webkit_web_src_class_init):
1911         (webkitWebSrcReset):
1912         (webkit_web_src_init):
1913         (webKitWebSrcCreate):
1914         (webKitWebSrcStart):
1915         (webKitWebSrcCloseSession):
1916         (webKitWebSrcStop):
1917         (webKitWebSrcGetSize):
1918         (webKitWebSrcIsSeekable):
1919         (webKitWebSrcDoSeek):
1920         (webKitWebSrcQuery):
1921         (webKitWebSrcUnLock):
1922         (webKitWebSrcUnLockStop):
1923         (webKitWebSrcChangeState):
1924         (CachedResourceStreamingClient::checkUpdateBlocksize):
1925         (CachedResourceStreamingClient::responseReceived):
1926         (CachedResourceStreamingClient::dataReceived):
1927         (CachedResourceStreamingClient::accessControlCheckFailed):
1928         (CachedResourceStreamingClient::loadFailed):
1929         (CachedResourceStreamingClient::loadFinished):
1930         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
1931
1932 2019-03-18  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1933
1934         [WPE][GTK] Fix a build warning because of missing to handle an enum value
1935         https://bugs.webkit.org/show_bug.cgi?id=195876
1936
1937         Reviewed by Žan Doberšek.
1938
1939         When building WPE or GTK port, there is a build warning. The switch-case needs to
1940         handle *Positioned* enum value as well in order to avoid the build warning.
1941
1942         * page/scrolling/nicosia/ScrollingTreeNicosia.cpp:
1943         (WebCore::ScrollingTreeNicosia::createScrollingTreeNode): Add case ScrollingNodeType::Positioned.
1944
1945 2019-03-17  Yusuke Suzuki  <ysuzuki@apple.com>
1946
1947         REGRESSION: !vm.isInitializingObject() void* JSC::tryAllocateCellHelper<JSC::Structure> JSC::Structure::create
1948         https://bugs.webkit.org/show_bug.cgi?id=195858
1949
1950         Reviewed by Mark Lam.
1951
1952         Changed the accessor names.
1953
1954         * bindings/js/SerializedScriptValue.cpp:
1955         (WebCore::CloneDeserializer::readTerminal):
1956
1957 2019-03-16  Darin Adler  <darin@apple.com>
1958
1959         Improve normalization code, including moving from unorm.h to unorm2.h
1960         https://bugs.webkit.org/show_bug.cgi?id=195330
1961
1962         Reviewed by Michael Catanzaro.
1963
1964         * editing/TextIterator.cpp: Include unorm2.h.
1965         (WebCore::normalizeCharacters): Rewrote to use unorm2_normalize rather than
1966         unorm_normalize, but left the logic otherwise the same.
1967
1968         * platform/graphics/SurrogatePairAwareTextIterator.cpp: Include unorm2.h.
1969         (WebCore::SurrogatePairAwareTextIterator::normalizeVoicingMarks):
1970         Use unorm2_composePair instead of unorm_normalize.
1971
1972         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
1973         (characterSequenceIsEmoji): Changed to use existing SurrogatePairAwareTextIterator.
1974         (FontCascade::fontForCombiningCharacterSequence): Use normalizedNFC instead of
1975         calling unorm2_normalize directly.
1976
1977         * WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp:
1978         Removed unneeded include of <unicode/normlzr.h>.
1979
1980         * platform/text/TextEncoding.cpp:
1981         (WebCore::TextEncoding::encode const): Use normalizedNFC instead of the
1982         code that was here. The normalizedNFC function is better in multiple ways,
1983         but primarily it handles 8-bit strings and other already-normalized
1984         strings much more efficiently.
1985
1986 2019-03-16  Jer Noble  <jer.noble@apple.com>
1987
1988         Unreviewed unified-build fix; GPUBindGroupMetal uses symbols from the Metal.framework; it should import it.
1989
1990         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
1991
1992 2019-03-16  Jer Noble  <jer.noble@apple.com>
1993
1994         Add a new MediaCapabilitiesExtensionsEnabled setting
1995         https://bugs.webkit.org/show_bug.cgi?id=195843
1996
1997         Reviewed by Geoffrey Garen.
1998
1999         Add a new setting, MediaCapabilitiesExtensionsEnabled, which controls whether extensions
2000         to the Media Capabilities API are available.
2001
2002         Drive-by fix: make sure that the configuration is passed through to MediaCapabilitiesInfo
2003         when no factory can support the configuration.
2004
2005         * Modules/mediacapabilities/MediaCapabilitiesDecodingInfo.idl:
2006         * Modules/mediacapabilities/MediaCapabilitiesEncodingInfo.idl:
2007         * bindings/scripts/CodeGeneratorJS.pm:
2008         (GenerateDictionaryImplementationContent):
2009         * bindings/scripts/IDLAttributes.json:
2010         * page/Settings.yaml:
2011         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
2012         (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
2013
2014 2019-03-16  Zalan Bujtas  <zalan@apple.com>
2015
2016         [iOS] Unable to close trending window on naver.com.
2017         https://bugs.webkit.org/show_bug.cgi?id=195842
2018         <rdar://problem/48067338>
2019
2020         This patch issues a synthetic mouse move to the tap location after we decided to hover.
2021         It ensures that the node under the mouse is up-to-date and when a new tap comes in we can
2022         send the mouseout event to the correct node. It fixes the case when the hover content is positioned over
2023         the tap target so that the tap target is no longer "under the mouse".
2024         On desktop this "transition" happens automatically since the mouse is always present. 
2025
2026         Reviewed by Simon Fraser.
2027
2028         Tests: fast/events/touch/ios/content-observation/new-content-covers-tap-target.html
2029                fast/events/touch/ios/content-observation/prevent-default-on-touch-start.html
2030
2031         * page/EventHandler.h:
2032         * page/ios/EventHandlerIOS.mm:
2033         (WebCore::EventHandler::dispatchSyntheticMouseMove):
2034
2035 2019-03-16  Sihui Liu  <sihui_liu@apple.com>
2036
2037         Layout tests imported/w3c/web-platform-tests/IndexedDB/*-exception-order.html are failing
2038         https://bugs.webkit.org/show_bug.cgi?id=195650
2039
2040         Reviewed by Ryosuke Niwa.
2041
2042         Fix some exception orders in IDB.
2043
2044         * Modules/indexeddb/IDBDatabase.cpp:
2045         (WebCore::IDBDatabase::createObjectStore):
2046         Step 6 of https://www.w3.org/TR/IndexedDB-2/#dom-idbdatabase-createobjectstore.
2047
2048         (WebCore::IDBDatabase::transaction):
2049         Step 1 of https://www.w3.org/TR/IndexedDB-2/#dom-idbdatabase-transaction.
2050
2051         * Modules/indexeddb/IDBIndex.cpp:
2052         (WebCore::IDBIndex::doOpenCursor):
2053         (WebCore::IDBIndex::openCursor):
2054         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-opencursor.
2055
2056         (WebCore::IDBIndex::doOpenKeyCursor):
2057         (WebCore::IDBIndex::openKeyCursor):
2058         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-openkeycursor.
2059
2060         (WebCore::IDBIndex::count):
2061         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-count.
2062
2063         (WebCore::IDBIndex::doCount):
2064         (WebCore::IDBIndex::get):
2065         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-get.
2066
2067         (WebCore::IDBIndex::doGet):
2068         (WebCore::IDBIndex::getKey):
2069         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-getkey.
2070
2071         (WebCore::IDBIndex::doGetKey):
2072         (WebCore::IDBIndex::doGetAll):
2073         (WebCore::IDBIndex::getAll):
2074         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-getkey.
2075         (WebCore::IDBIndex::doGetAllKeys):
2076         (WebCore::IDBIndex::getAllKeys):
2077         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-getallkeys.
2078
2079         * Modules/indexeddb/IDBIndex.h:
2080         * Modules/indexeddb/IDBObjectStore.cpp:
2081         (WebCore::IDBObjectStore::doOpenCursor):
2082         (WebCore::IDBObjectStore::openCursor):
2083         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-opencursor.
2084
2085         (WebCore::IDBObjectStore::doOpenKeyCursor):
2086         (WebCore::IDBObjectStore::openKeyCursor):
2087         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-openkeycursor.
2088
2089         (WebCore::IDBObjectStore::deleteFunction):
2090         (WebCore::IDBObjectStore::doDelete):
2091         (WebCore::IDBObjectStore::count):
2092         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-count.
2093
2094         (WebCore::IDBObjectStore::doCount):
2095         (WebCore::IDBObjectStore::doGetAll):
2096         (WebCore::IDBObjectStore::getAll):
2097         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-getall.
2098
2099         (WebCore::IDBObjectStore::doGetAllKeys):
2100         (WebCore::IDBObjectStore::getAllKeys):
2101         Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-getallkeys.
2102         * Modules/indexeddb/IDBObjectStore.h:
2103
2104 2019-03-16  Ryosuke Niwa  <rniwa@webkit.org>
2105
2106         Reduce the size of Node::deref by eliminating an explicit parentNode check
2107         https://bugs.webkit.org/show_bug.cgi?id=195776
2108
2109         Reviewed by Geoffrey Garen.
2110
2111         This patch eliminates the nullity check of m_parentNode in Node::deref as well as the store to
2112         m_refCount in the case of invoking Node::removedLastRef() as done for RefCounted in r30042.
2113         Together, this patch shrinks WebCore's size by 46KB or ~0.7%.
2114
2115         To do this, we take we take a similar approach as WTF::String by using the lowest bit of m_refCount
2116         to indicate whether a node has a parent or not. Regular ref-counting is done on the upper 31 bits.
2117         Node::setParentNode updates this flag, and Node::deref() would only `delete this` if m_refCount
2118         is identically equal to 0.
2119
2120         For a Document, we set m_refCounted to 0 before in the case of non-zero m_referencingNodeCount
2121         since decrementReferencingNodeCount needs to be able to tell if there is an outstanding Ref/RefPtr
2122         or not when m_referencingNodeCount becomes 0.
2123
2124         No new tests since there should be no behavioral change.
2125
2126         * dom/Document.cpp:
2127         (WebCore::Document::removedLastRef):
2128         * dom/Document.h:
2129         (WebCore::Document::decrementReferencingNodeCount):
2130         * dom/Node.cpp:
2131         (WebCore::Node::Node): Moved the initialization of m_refCount to the member variable declaration.
2132         (WebCore::Node::~Node):
2133         (WebCore::Node::removedLastRef):
2134         * dom/Node.h:
2135         (WebCore::Node): Changed the type of m_refCount from signed int to uint32_t. It was changed from
2136         unsigned int to signed int back in r11492 but I don't think the signedness is needed.
2137         (WebCore::Node::ref): Increment the ref count by 2 (upper 31-bit).
2138         (WebCore::Node::deref): Implemented the optimization. This is what shrinks the WebCore binary size.
2139         (WebCore::Node::hasOneRef const):
2140         (WebCore::Node::refCount const): Ignore the lowest bit. Without this fix, the optimization in
2141         replaceChildrenWithFragment to avoid replacing the text node is disabled whenever there is a parent.
2142         (WebCore::Node::setParentNode): Sets the lowest bit to 1 if the node has a parent and 0 otherwise.
2143
2144 2019-03-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
2145
2146         Remove the SVG property tear off objects for SVGAnimatedInteger
2147         https://bugs.webkit.org/show_bug.cgi?id=195722
2148
2149         Reviewed by Simon Fraser.
2150
2151         Instead of saving a raw integer value in the SVGElement and then wrapping
2152         the pointer to this raw data in a tear off object, we will represent the
2153         integer as Ref<SVGAnimatedInteger> in SVGElement. This will make the 
2154         representation of the property in IDL file match the C++ header file.
2155
2156         When the DOM requests the SVGAnimatedInteger, we get return a reference
2157         to the new animated property. When the rendering code asks for the current
2158         value of the this animated property, we return the animVal() or the
2159         baseVal() depending on whether the property is animating or not.
2160
2161         A pointer to a member in the SVGElement will be registered along with the
2162         associated attribute name in SVGPropertyRegistry. Registering the property
2163         creates an SVGMemberAccessor and links to the associated attribute. The
2164         function of SVGMemberAccessor is to retrieve the value of the property
2165         given a pointer to an SVGElement.
2166
2167         SVGPropertyRegistry manages all the properties of SVGElement. It takes
2168         into account the inherited properties as well.
2169
2170         SVGElement will have a virtual method called propertyRegistry(). Every
2171         superclass will override this method to return a reference to its registry
2172         which includes all the registered properties of this class and its bases.
2173
2174         One important function of the SVGPropertyRegistry and SVGAccessor is they
2175         create the appropriate SVGAttributeAnimator for this property.
2176
2177         SVGAttributeAnimator is just a connection between the animated property
2178         and SVGAnimationFunction. SVGAnimationFunction calculates the values of
2179         the animated property within a time interval. SVGAnimatedPropertyAnimator
2180         updates animVal of the animated property and invalidates the associated
2181         SVGElement and all the instances that references this element.
2182
2183         The plan is to remove all the SVG tear off objects like what this patch
2184         does for SVGAnimatedInteger. So for a period of time the old code and the
2185         new code will co-exist together. These things to consider when reviewing
2186         this patch:
2187
2188         -- SVGAnimatedElementBase was re-factored to use SVGAttributeAnimationControllerBase
2189         which is inherited by SVGLegacyAttributeAnimationController and
2190         SVGAttributeAnimationController. The tear-off properties code which uses
2191         SVGAnimatedType now lives in SVGLegacyAttributeAnimationController. The
2192         new code was added to SVGAttributeAnimationController. The plan is to 
2193         remove the three animation controllers and to move the code of
2194         SVGAttributeAnimationController to SVGAnimatedElementBase when all the tear
2195         off code is removed.
2196
2197         -- SVGElement now keeps two registries one for the tear-off world and the
2198         other for the new world. Eventually we need to get rid of tear-off registry.
2199
2200         -- SVGElement will differentiate between the type of the property by the
2201         the method isAnimatedAttribute().
2202
2203         * Sources.txt:
2204         * WebCore.xcodeproj/project.pbxproj:
2205         * bindings/scripts/CodeGeneratorJS.pm:
2206         (GenerateHeader):
2207         * svg/SVGAnimateElementBase.cpp:
2208         (WebCore::SVGAnimateElementBase::SVGAnimateElementBase):
2209         (WebCore::SVGAnimateElementBase::attributeAnimationController):
2210         (WebCore::SVGAnimateElementBase::attributeAnimationControllerIfExists):
2211         (WebCore::SVGAnimateElementBase::hasValidAttributeType const):
2212         (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType const):
2213         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
2214         (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):
2215         (WebCore::SVGAnimateElementBase::calculateFromAndToValues):
2216         (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
2217         (WebCore::SVGAnimateElementBase::resetAnimatedType):
2218         (WebCore::SVGAnimateElementBase::clearAnimatedType):
2219         (WebCore::SVGAnimateElementBase::applyResultsToTarget):
2220         (WebCore::SVGAnimateElementBase::isAdditive const):
2221         (WebCore::SVGAnimateElementBase::calculateDistance):
2222         (WebCore::SVGAnimateElementBase::setTargetElement):
2223         (WebCore::SVGAnimateElementBase::setAttributeName):
2224         (WebCore::SVGAnimateElementBase::resetAnimation):
2225         (WebCore::SVGAnimateElementBase::hasInvalidCSSAttributeType const):
2226         (WebCore::SVGAnimateElementBase::hasValidAttributeType): Deleted.
2227         (WebCore::propertyTypesAreConsistent): Deleted.
2228         (WebCore::applyCSSPropertyToTarget): Deleted.
2229         (WebCore::removeCSSPropertyFromTarget): Deleted.
2230         (WebCore::applyCSSPropertyToTargetAndInstances): Deleted.
2231         (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted.
2232         (WebCore::notifyTargetAboutAnimValChange): Deleted.
2233         (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted.
2234         (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition const): Deleted.
2235         (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): Deleted.
2236         (WebCore::SVGAnimateElementBase::ensureAnimator): Deleted.
2237         * svg/SVGAnimateElementBase.h:
2238         * svg/SVGAnimateMotionElement.cpp:
2239         (WebCore::SVGAnimateMotionElement::hasValidAttributeType const):
2240         (WebCore::SVGAnimateMotionElement::hasValidAttributeName const):
2241         (WebCore::SVGAnimateMotionElement::hasValidAttributeType): Deleted.
2242         (WebCore::SVGAnimateMotionElement::hasValidAttributeName): Deleted.
2243         * svg/SVGAnimateMotionElement.h:
2244         * svg/SVGAnimateTransformElement.cpp:
2245         (WebCore::SVGAnimateTransformElement::hasValidAttributeType const):
2246         (WebCore::SVGAnimateTransformElement::hasValidAttributeType): Deleted.
2247         * svg/SVGAnimateTransformElement.h:
2248         * svg/SVGAnimatedInteger.cpp: Removed.
2249         * svg/SVGAnimatedInteger.h: Removed.
2250         * svg/SVGAnimatedIntegerOptionalInteger.cpp: Removed.
2251         * svg/SVGAnimatedIntegerOptionalInteger.h: Removed.
2252         * svg/SVGAnimatedPointList.h:
2253         * svg/SVGAnimationElement.cpp:
2254         (WebCore::SVGAnimationElement::setAttributeType):
2255         (WebCore::SVGAnimationElement::resetAnimation):
2256         (WebCore::SVGAnimationElement::resetAnimatedPropertyType): Deleted.
2257         (WebCore::SVGAnimationElement::setTargetElement): Deleted.
2258         (WebCore::SVGAnimationElement::checkInvalidCSSAttributeType): Deleted.
2259         * svg/SVGAnimationElement.h:
2260         (WebCore::SVGAnimationElement::attributeType const):
2261         (WebCore::SVGAnimationElement::hasInvalidCSSAttributeType const): Deleted.
2262         * svg/SVGAnimatorFactory.h:
2263         (WebCore::SVGAnimatorFactory::create):
2264         * svg/SVGAttributeAnimationController.cpp: Added.
2265         (WebCore::SVGAttributeAnimationController::SVGAttributeAnimationController):
2266         (WebCore::SVGAttributeAnimationController::animator const):
2267         (WebCore::SVGAttributeAnimationController::isDiscreteAnimator const):
2268         (WebCore::SVGAttributeAnimationController::isAdditive const):
2269         (WebCore::SVGAttributeAnimationController::hasValidAttributeType const):
2270         (WebCore::SVGAttributeAnimationController::calculateFromAndToValues):
2271         (WebCore::SVGAttributeAnimationController::calculateFromAndByValues):
2272         (WebCore::SVGAttributeAnimationController::calculateToAtEndOfDurationValue):
2273         (WebCore::SVGAttributeAnimationController::resetAnimatedType):
2274         (WebCore::SVGAttributeAnimationController::calculateAnimatedValue):
2275         (WebCore::SVGAttributeAnimationController::applyResultsToTarget):
2276         (WebCore::SVGAttributeAnimationController::clearAnimatedType):
2277         (WebCore::SVGAttributeAnimationController::calculateDistance):
2278         * svg/SVGAttributeAnimationController.h: Added.
2279         (WebCore::SVGAttributeAnimationController::animatorIfExists const):
2280         * svg/SVGAttributeAnimationControllerBase.cpp: Added.
2281         (WebCore::SVGAttributeAnimationControllerBase::SVGAttributeAnimationControllerBase):
2282         (WebCore::SVGAttributeAnimationControllerBase::determineAnimatedPropertyType):
2283         * svg/SVGAttributeAnimationControllerBase.h: Added.
2284         * svg/SVGElement.cpp:
2285         (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute):
2286         (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const):
2287         (WebCore::SVGElement::commitPropertyChange):
2288         (WebCore::SVGElement::isAnimatedPropertyAttribute const):
2289         (WebCore::SVGElement::isAnimatedAttribute const):
2290         (WebCore::SVGElement::createAnimator):
2291         * svg/SVGElement.h:
2292         (WebCore::SVGElement::propertyRegistry const):
2293         * svg/SVGFEConvolveMatrixElement.cpp:
2294         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
2295         (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
2296         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
2297         (WebCore::SVGFEConvolveMatrixElement::setOrder):
2298         (WebCore::SVGFEConvolveMatrixElement::orderXIdentifier): Deleted.
2299         (WebCore::SVGFEConvolveMatrixElement::orderYIdentifier): Deleted.
2300         * svg/SVGFEConvolveMatrixElement.h:
2301         * svg/SVGFETurbulenceElement.cpp:
2302         (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
2303         (WebCore::SVGFETurbulenceElement::registerAttributes):
2304         (WebCore::SVGFETurbulenceElement::parseAttribute):
2305         (WebCore::SVGFETurbulenceElement::svgAttributeChanged):
2306         * svg/SVGFETurbulenceElement.h:
2307         * svg/SVGFilterElement.h:
2308         * svg/SVGLegacyAttributeAnimationController.cpp: Added.
2309         (WebCore::SVGLegacyAttributeAnimationController::SVGLegacyAttributeAnimationController):
2310         (WebCore::SVGLegacyAttributeAnimationController::animatedTypeAnimator):
2311         (WebCore::SVGLegacyAttributeAnimationController::isAdditive const):
2312         (WebCore::SVGLegacyAttributeAnimationController::hasValidAttributeType const):
2313         (WebCore::SVGLegacyAttributeAnimationController::calculateFromAndToValues):
2314         (WebCore::SVGLegacyAttributeAnimationController::calculateFromAndByValues):
2315         (WebCore::SVGLegacyAttributeAnimationController::calculateToAtEndOfDurationValue):
2316         (WebCore::propertyTypesAreConsistent):
2317         (WebCore::SVGLegacyAttributeAnimationController::resetAnimatedType):
2318         (WebCore::SVGLegacyAttributeAnimationController::calculateAnimatedValue):
2319         (WebCore::applyCSSPropertyToTarget):
2320         (WebCore::removeCSSPropertyFromTarget):
2321         (WebCore::applyCSSPropertyToTargetAndInstances):
2322         (WebCore::removeCSSPropertyFromTargetAndInstances):
2323         (WebCore::notifyTargetAboutAnimValChange):
2324         (WebCore::notifyTargetAndInstancesAboutAnimValChange):
2325         (WebCore::SVGLegacyAttributeAnimationController::applyResultsToTarget):
2326         (WebCore::SVGLegacyAttributeAnimationController::clearAnimatedType):
2327         (WebCore::SVGLegacyAttributeAnimationController::calculateDistance):
2328         * svg/SVGLegacyAttributeAnimationController.h: Added.
2329         * svg/animation/SVGSMILElement.cpp:
2330         (WebCore::SVGSMILElement::hasValidAttributeName const):
2331         (WebCore::SVGSMILElement::hasValidAttributeName): Deleted.
2332         * svg/animation/SVGSMILElement.h:
2333         * svg/properties/SVGAnimatedPrimitiveProperty.h: Added.
2334         (WebCore::SVGAnimatedPrimitiveProperty::create):
2335         (WebCore::SVGAnimatedPrimitiveProperty::setBaseVal):
2336         (WebCore::SVGAnimatedPrimitiveProperty::setBaseValInternal):
2337         (WebCore::SVGAnimatedPrimitiveProperty::baseVal const):
2338         (WebCore::SVGAnimatedPrimitiveProperty::setAnimVal):
2339         (WebCore::SVGAnimatedPrimitiveProperty::animVal const):
2340         (WebCore::SVGAnimatedPrimitiveProperty::animVal):
2341         (WebCore::SVGAnimatedPrimitiveProperty::currentValue const):
2342         (WebCore::SVGAnimatedPrimitiveProperty::SVGAnimatedPrimitiveProperty):
2343         * svg/properties/SVGAnimatedProperty.cpp: Added.
2344         (WebCore::SVGAnimatedProperty::owner const):
2345         (WebCore::SVGAnimatedProperty::commitPropertyChange):
2346         * svg/properties/SVGAnimatedProperty.h: Added.
2347         (WebCore::SVGAnimatedProperty::isAttached const):
2348         (WebCore::SVGAnimatedProperty::detach):
2349         (WebCore::SVGAnimatedProperty::contextElement const):
2350         (WebCore::SVGAnimatedProperty::baseValAsString const):
2351         (WebCore::SVGAnimatedProperty::animValAsString const):
2352         (WebCore::SVGAnimatedProperty::isDirty const):
2353         (WebCore::SVGAnimatedProperty::setDirty):
2354         (WebCore::SVGAnimatedProperty::synchronize):
2355         (WebCore::SVGAnimatedProperty::isAnimating const):
2356         (WebCore::SVGAnimatedProperty::startAnimation):
2357         (WebCore::SVGAnimatedProperty::stopAnimation):
2358         (WebCore::SVGAnimatedProperty::instanceStartAnimation):
2359         (WebCore::SVGAnimatedProperty::instanceStopAnimation):
2360         (WebCore::SVGAnimatedProperty::SVGAnimatedProperty):
2361         * svg/properties/SVGAnimatedPropertyAccessor.h: Added.
2362         * svg/properties/SVGAnimatedPropertyAccessorImpl.h: Added.
2363         * svg/properties/SVGAnimatedPropertyAnimator.h: Added.
2364         (WebCore::SVGAnimatedPropertyAnimator::appendAnimatedInstance):
2365         (WebCore::SVGAnimatedPropertyAnimator::SVGAnimatedPropertyAnimator):
2366         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h: Added.
2367         * svg/properties/SVGAnimatedPropertyImpl.h: Added.
2368         * svg/properties/SVGAnimatedPropertyPairAccessor.h: Added.
2369         (WebCore::SVGAnimatedPropertyPairAccessor::SVGAnimatedPropertyPairAccessor):
2370         (WebCore::SVGAnimatedPropertyPairAccessor::singleton):
2371         (WebCore::SVGAnimatedPropertyPairAccessor::property1 const):
2372         (WebCore::SVGAnimatedPropertyPairAccessor::property2 const):
2373         * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h: Added.
2374         * svg/properties/SVGAnimatedPropertyPairAnimator.h: Added.
2375         (WebCore::SVGAnimatedPropertyPairAnimator::appendAnimatedInstance):
2376         (WebCore::SVGAnimatedPropertyPairAnimator::SVGAnimatedPropertyPairAnimator):
2377         * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h: Added.
2378         * svg/properties/SVGAnimationAdditiveFunction.h: Added.
2379         (WebCore::SVGAnimationAdditiveFunction::SVGAnimationAdditiveFunction):
2380         (WebCore::SVGAnimationAdditiveFunction::progress):
2381         * svg/properties/SVGAnimationAdditiveValueFunction.h: Added.
2382         (WebCore::SVGAnimationAdditiveValueFunction::toAtEndOfDuration const):
2383         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: Added.
2384         (WebCore::SVGAnimationIntegerFunction::progress):
2385         * svg/properties/SVGAnimationFunction.h: Added.
2386         (WebCore::SVGAnimationFunction::isDiscrete const):
2387         (WebCore::SVGAnimationFunction::calculateDistance const):
2388         (WebCore::SVGAnimationFunction::SVGAnimationFunction):
2389         (WebCore::SVGAnimationFunction::addFromAndToValues):
2390         * svg/properties/SVGAttributeAnimator.cpp: Added.
2391         (WebCore::SVGAttributeAnimator::applyAnimatedPropertyChange):
2392         * svg/properties/SVGAttributeAnimator.h: Added.
2393         (WebCore::SVGAttributeAnimator::SVGAttributeAnimator):
2394         (WebCore::SVGAttributeAnimator::isDiscrete const):
2395         (WebCore::SVGAttributeAnimator::setFromAndToValues):
2396         (WebCore::SVGAttributeAnimator::setFromAndByValues):
2397         (WebCore::SVGAttributeAnimator::setToAtEndOfDurationValue):
2398         (WebCore::SVGAttributeAnimator::calculateDistance const):
2399         * svg/properties/SVGAttributeOwnerProxy.cpp:
2400         * svg/properties/SVGAttributeOwnerProxy.h:
2401         * svg/properties/SVGAttributeRegistry.h:
2402         * svg/properties/SVGMemberAccessor.h: Added.
2403         (WebCore::SVGMemberAccessor::detach const):
2404         (WebCore::SVGMemberAccessor::isAnimatedProperty const):
2405         (WebCore::SVGMemberAccessor::isAnimatedLength const):
2406         (WebCore::SVGMemberAccessor::matches const):
2407         (WebCore::SVGMemberAccessor::synchronize const):
2408         (WebCore::SVGMemberAccessor::createAnimator const):
2409         (WebCore::SVGMemberAccessor::appendAnimatedInstance const):
2410         * svg/properties/SVGPointerMemberAccessor.h: Added.
2411         (WebCore::SVGPointerMemberAccessor::SVGPointerMemberAccessor):
2412         (WebCore::SVGPointerMemberAccessor::property const):
2413         (WebCore::SVGPointerMemberAccessor::singleton):
2414         * svg/properties/SVGProperty.h: Added.
2415         * svg/properties/SVGPropertyOwner.h: Added.
2416         (WebCore::SVGPropertyOwner::owner const):
2417         (WebCore::SVGPropertyOwner::attributeContextElement const):
2418         (WebCore::SVGPropertyOwner::commitPropertyChange):
2419         * svg/properties/SVGPropertyOwnerRegistry.h: Added.
2420         (WebCore::SVGPropertyOwnerRegistry::SVGPropertyOwnerRegistry):
2421         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
2422         (WebCore::SVGPropertyOwnerRegistry::enumerateRecursively):
2423         (WebCore::SVGPropertyOwnerRegistry::isKnownAttribute):
2424         (WebCore::SVGPropertyOwnerRegistry::enumerateRecursivelyBaseTypes):
2425         (WebCore::SVGPropertyOwnerRegistry::findAccessor):
2426         * svg/properties/SVGPropertyRegistry.h: Added.
2427
2428 2019-03-16  Ryosuke Niwa  <rniwa@webkit.org>
2429
2430         Remove LayoutAssertionDisableScope after r241289
2431         https://bugs.webkit.org/show_bug.cgi?id=195848
2432
2433         Reviewed by Antti Koivisto.
2434
2435         Remove LayoutAssertionDisableScope for good now that the underlying bug has been fixed in r241289.
2436
2437         * dom/Document.cpp:
2438         (WebCore::isSafeToUpdateStyleOrLayout):
2439         * dom/ScriptDisallowedScope.h:
2440         (WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope): Deleted.
2441         * page/FrameViewLayoutContext.cpp:
2442         (WebCore::FrameViewLayoutContext::layout):
2443
2444 2019-03-15  Eric Carlson  <eric.carlson@apple.com>
2445
2446         Add media stream release logging
2447         https://bugs.webkit.org/show_bug.cgi?id=195823
2448         <rdar://problem/48939406>
2449
2450         Reviewed by Youenn Fablet.
2451
2452         No new tests, no behavioral change.
2453
2454         * Modules/mediastream/MediaStream.cpp:
2455         (WebCore::MediaStream::MediaStream):
2456         (WebCore::MediaStream::clone):
2457         (WebCore::MediaStream::addTrack):
2458         (WebCore::MediaStream::removeTrack):
2459         (WebCore::MediaStream::addTrackFromPlatform):
2460         (WebCore::MediaStream::setIsActive):
2461         (WebCore::MediaStream::mediaCanStart):
2462         (WebCore::MediaStream::startProducingData):
2463         (WebCore::MediaStream::stopProducingData):
2464         (WebCore::MediaStream::endCaptureTracks):
2465         (WebCore::MediaStream::stop):
2466         (WebCore::MediaStream::logChannel const):
2467         * Modules/mediastream/MediaStream.h:
2468         * Modules/mediastream/MediaStreamTrack.cpp:
2469         (WebCore::MediaStreamTrack::MediaStreamTrack):
2470         (WebCore::MediaStreamTrack::logChannel const):
2471         * Modules/mediastream/MediaStreamTrack.h:
2472         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2473         (WebCore::LibWebRTCMediaEndpoint::addTrack):
2474         (WebCore::LibWebRTCMediaEndpoint::sourceFromNewReceiver):
2475         * Modules/webaudio/AudioContext.cpp:
2476         (WebCore::AudioContext::AudioContext):
2477         (WebCore::nextLogIdentifier): Deleted.
2478         * html/HTMLMediaElement.cpp:
2479         (WebCore::HTMLMediaElement::HTMLMediaElement):
2480         (WebCore::nextLogIdentifier): Deleted.
2481         * html/HTMLMediaElement.h:
2482         * platform/audio/PlatformMediaSession.cpp:
2483         (WebCore::PlatformMediaSession::PlatformMediaSession):
2484         (WebCore::nextLogIdentifier): Deleted.
2485         * platform/audio/PlatformMediaSession.h:
2486         * platform/graphics/IntSize.cpp:
2487         (WebCore::IntSize::toJSONObject const):
2488         (WebCore::IntSize::toJSONString const):
2489         * platform/graphics/IntSize.h:
2490         (WTF::LogArgument<WebCore::IntSize>::toString):
2491         * platform/mediastream/MediaStreamPrivate.cpp:
2492         (WebCore::MediaStreamPrivate::addTrack):
2493         (WebCore::MediaStreamPrivate::removeTrack):
2494         (WebCore::MediaStreamPrivate::startProducingData):
2495         (WebCore::MediaStreamPrivate::stopProducingData):
2496         (WebCore::MediaStreamPrivate::setCaptureTracksMuted):
2497         (WebCore::MediaStreamPrivate::trackMutedChanged):
2498         (WebCore::MediaStreamPrivate::trackEnabledChanged):
2499         (WebCore::MediaStreamPrivate::trackStarted):
2500         (WebCore::MediaStreamPrivate::trackEnded):
2501         (WebCore::MediaStreamPrivate::setLogger):
2502         (WebCore::MediaStreamPrivate::logChannel const):
2503         * platform/mediastream/MediaStreamPrivate.h:
2504         * platform/mediastream/MediaStreamTrackPrivate.cpp:
2505         (WebCore::MediaStreamTrackPrivate::setLogger):
2506         (WebCore::MediaStreamTrackPrivate::logChannel const):
2507         * platform/mediastream/MediaStreamTrackPrivate.h:
2508         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
2509         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
2510         (WebCore::RealtimeIncomingAudioSource::logChannel const): Deleted.
2511         (WebCore::RealtimeIncomingAudioSource::logger const): Deleted.
2512         * platform/mediastream/RealtimeIncomingAudioSource.h:
2513         (WebCore::RealtimeIncomingAudioSource::setLogger): Deleted.
2514         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
2515         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
2516         (WebCore::RealtimeIncomingVideoSource::logChannel const): Deleted.
2517         (WebCore::RealtimeIncomingVideoSource::logger const): Deleted.
2518         * platform/mediastream/RealtimeIncomingVideoSource.h:
2519         (WebCore::RealtimeIncomingVideoSource::setLogger): Deleted.
2520         * platform/mediastream/RealtimeMediaSource.cpp:
2521         (WebCore::RealtimeMediaSource::RealtimeMediaSource):
2522         (WebCore::RealtimeMediaSource::setInterrupted):
2523         (WebCore::RealtimeMediaSource::setMuted):
2524         (WebCore::RealtimeMediaSource::notifyMutedChange):
2525         (WebCore::RealtimeMediaSource::notifySettingsDidChangeObservers):
2526         (WebCore::RealtimeMediaSource::videoSampleAvailable):
2527         (WebCore::RealtimeMediaSource::start):
2528         (WebCore::RealtimeMediaSource::stop):
2529         (WebCore::RealtimeMediaSource::captureFailed):
2530         (WebCore::RealtimeMediaSource::applyConstraint):
2531         (WebCore::RealtimeMediaSource::supportsConstraints):
2532         (WebCore::RealtimeMediaSource::applyConstraints):
2533         (WebCore::RealtimeMediaSource::setSize):
2534         (WebCore::RealtimeMediaSource::setIntrinsicSize):
2535         (WebCore::RealtimeMediaSource::setFrameRate):
2536         (WebCore::RealtimeMediaSource::setAspectRatio):
2537         (WebCore::RealtimeMediaSource::setFacingMode):
2538         (WebCore::RealtimeMediaSource::setVolume):
2539         (WebCore::RealtimeMediaSource::setSampleRate):
2540         (WebCore::RealtimeMediaSource::setSampleSize):
2541         (WebCore::RealtimeMediaSource::setEchoCancellation):
2542         (WebCore::RealtimeMediaSource::setLogger):
2543         (WebCore::RealtimeMediaSource::logChannel const):
2544         (WebCore::convertEnumerationToString):
2545         * platform/mediastream/RealtimeMediaSource.h:
2546         (WTF::LogArgument<WebCore::RealtimeMediaSource::Type>::toString):
2547         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
2548         (WebCore::RealtimeMediaSourceSettings::convertFlagsToString):
2549         (WebCore::convertEnumerationToString):
2550         * platform/mediastream/RealtimeMediaSourceSettings.h:
2551         (WTF::LogArgument<WebCore::RealtimeMediaSourceSettings::VideoFacingMode>::toString):
2552         (WTF::LogArgument<OptionSet<WebCore::RealtimeMediaSourceSettings::Flag>>::toString):
2553         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
2554         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
2555         (WebCore::RealtimeOutgoingAudioSource::logChannel const):
2556         (WebCore::RealtimeOutgoingAudioSource::logger const): Deleted.
2557         * platform/mediastream/RealtimeOutgoingAudioSource.h:
2558         (WebCore::RealtimeOutgoingAudioSource::setLogger): Deleted.
2559         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
2560         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
2561         (WebCore::RealtimeOutgoingVideoSource::sendOneBlackFrame):
2562         (WebCore::RealtimeOutgoingVideoSource::sendFrame):
2563         (WebCore::RealtimeOutgoingVideoSource::logChannel const):
2564         (WebCore::RealtimeOutgoingVideoSource::logger const): Deleted.
2565         * platform/mediastream/RealtimeOutgoingVideoSource.h:
2566         (WebCore::RealtimeOutgoingVideoSource::setLogger): Deleted.
2567         * platform/mediastream/RealtimeVideoSource.cpp:
2568         (WebCore::RealtimeVideoSource::setSizeAndFrameRate):
2569         (WebCore::SizeAndFrameRate::toJSONObject const):
2570         (WebCore::SizeAndFrameRate::toJSONString const):
2571         * platform/mediastream/RealtimeVideoSource.h:
2572         (WTF::LogArgument<WebCore::SizeAndFrameRate>::toString):
2573         * platform/mediastream/mac/AVVideoCaptureSource.h:
2574         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2575         (WebCore::AVVideoCaptureSource::clearSession):
2576         (WebCore::AVVideoCaptureSource::startProducingData):
2577         (WebCore::AVVideoCaptureSource::stopProducingData):
2578         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
2579         (WebCore::AVVideoCaptureSource::setupSession):
2580         (WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
2581         (WebCore::AVVideoCaptureSource::setupCaptureSession):
2582         (WebCore::AVVideoCaptureSource::captureSessionIsRunningDidChange):
2583         (WebCore::AVVideoCaptureSource::captureDeviceSuspendedDidChange):
2584         (WebCore::AVVideoCaptureSource::captureSessionRuntimeError):
2585         (WebCore::AVVideoCaptureSource::captureSessionBeginInterruption):
2586         (WebCore::AVVideoCaptureSource::captureSessionEndInterruption):
2587         (WebCore::AVVideoCaptureSource::deviceDisconnected):
2588         (-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]):
2589         (-[WebCoreAVVideoCaptureSourceObserver deviceConnectedDidChange:]):
2590         (-[WebCoreAVVideoCaptureSourceObserver sessionRuntimeError:]):
2591         (-[WebCoreAVVideoCaptureSourceObserver beginSessionInterrupted:]):
2592         (-[WebCoreAVVideoCaptureSourceObserver endSessionInterrupted:]):
2593         (WebCore::AVVideoCaptureSource::initializeSession): Deleted.
2594         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2595         (WebCore::CoreAudioSharedUnit::setupAudioUnit):
2596         (WebCore::CoreAudioSharedUnit::verifyIsCapturing):
2597         (WebCore::CoreAudioSharedUnit::captureFailed):
2598         (WebCore::CoreAudioCaptureSource::initializeToStartProducingData):
2599         (WebCore::CoreAudioCaptureSource::addEchoCancellationSource):
2600         (WebCore::CoreAudioCaptureSource::removeEchoCancellationSource):
2601         (WebCore::CoreAudioCaptureSource::startProducingData):
2602         (WebCore::CoreAudioCaptureSource::stopProducingData):
2603         (WebCore::CoreAudioCaptureSource::scheduleReconfiguration):
2604         (WebCore::CoreAudioCaptureSource::beginInterruption):
2605         (WebCore::CoreAudioCaptureSource::endInterruption):
2606         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2607         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
2608         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
2609         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
2610         (WebCore::ScreenDisplayCaptureSourceMac::startProducingData):
2611         (WebCore::ScreenDisplayCaptureSourceMac::stopProducingData):
2612         (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream):
2613
2614 2019-03-15  Devin Rousso  <drousso@apple.com>
2615
2616         Web Inspector: Canvas: remove agent as observer when disabling
2617         https://bugs.webkit.org/show_bug.cgi?id=195825
2618         <rdar://problem/48940255>
2619
2620         Reviewed by Joseph Pecoraro.
2621
2622         No change in functionality.
2623
2624         * inspector/agents/InspectorCanvasAgent.cpp:
2625         (WebCore::InspectorCanvasAgent::disable):
2626
2627 2019-03-15  Ryosuke Niwa  <rniwa@webkit.org>
2628
2629         REGRESSION (r239814): Most classes that user Timer have 7 bytes of padding after the Timer
2630         https://bugs.webkit.org/show_bug.cgi?id=194196
2631
2632         Reviewed by Simon Fraser.
2633
2634         Use std::nan as the value of m_unalignedNextFireTime to indicate the timer had been deleted
2635         instead of having a dedicated boolean, which consumes 7 extra bytes for padding.
2636
2637         Note that some code in WebKit uses +Infinity as a fire time so we can't use that.
2638
2639         * platform/Timer.cpp:
2640         (WebCore::TimerBase::TimerBase):
2641         (WebCore::TimerBase::~TimerBase):
2642         (WebCore::TimerBase::setNextFireTime):
2643         (WebCore::TimerBase::nextUnalignedFireInterval const):
2644         * platform/Timer.h:
2645
2646 2019-03-15  Sihui Liu  <sihui_liu@apple.com>
2647
2648         [ Mojave WK1 ] Layout Test storage/indexeddb/database-odd-names.html is failing
2649         https://bugs.webkit.org/show_bug.cgi?id=190350
2650         <rdar://problem/45089503>
2651
2652         Reviewed by Geoffrey Garen.
2653
2654         Start to use hash for database file names so that the files can work on any filesystem.
2655
2656         We created v0 folder in IndexedDB directory to put the legacy databases, and v1 folder to put the upgraded 
2657         databases.
2658
2659         Tests: TestWebKitAPI.IndexedDB.IndexedDBFileName
2660                TestWebKitAPI.IndexedDB.IndexedDBFileNameV0
2661                TestWebKitAPI.IndexedDB.IndexedDBFileNameV1
2662                TestWebKitAPI.IndexedDB.IndexedDBFileNameAPI
2663                TestWebKitAPI.IndexedDB.HashCollision
2664
2665         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
2666         (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot const):
2667         (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot):
2668         * Modules/indexeddb/IDBDatabaseIdentifier.h:
2669         * Modules/indexeddb/server/IDBServer.cpp:
2670         (WebCore::IDBServer::m_quotaManagerGetter):
2671         (WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
2672         (WebCore::IDBServer::removeAllDatabasesForFullOriginPath):
2673         (WebCore::IDBServer::removeAllDatabasesForOriginPath):
2674         (WebCore::IDBServer::IDBServer::removeDatabasesModifiedSinceForVersion):
2675         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince):
2676         (WebCore::IDBServer::IDBServer::removeDatabasesWithOriginsForVersion):
2677         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
2678         (WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
2679         (WebCore::IDBServer::IDBServer::upgradeFilesIfNecessary):
2680         * Modules/indexeddb/server/IDBServer.h:
2681         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2682         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
2683         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabasePathForDirectory):
2684         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabasePath const):
2685         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromFile):
2686         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade):
2687         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
2688         (WebCore::IDBServer::SQLiteIDBBackingStore::quotaForOrigin const):
2689         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const):
2690         (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
2691         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
2692         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectory const): Deleted.
2693         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2694         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseDirectory const):
2695         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
2696         (WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
2697         (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
2698         * platform/sql/SQLiteFileSystem.cpp:
2699         (WebCore::SQLiteFileSystem::computeHashForFileName):
2700         * platform/sql/SQLiteFileSystem.h:
2701
2702 2019-03-15  Zalan Bujtas  <zalan@apple.com>
2703
2704         [ContentChangeObserver] HTMLImageElement::willRespondToMouseClickEvents returns quirk value.
2705         https://bugs.webkit.org/show_bug.cgi?id=195657
2706         <rdar://problem/48834987>
2707
2708         Reviewed by Simon Fraser.
2709
2710         Images should not trigger hover by default (only when they actually respond to mouse events).
2711
2712         Test: fast/events/touch/ios/content-observation/visibility-change-with-image-content.html
2713
2714         * page/ios/ContentChangeObserver.cpp:
2715         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const):
2716
2717 2019-03-15  Jer Noble  <jer.noble@apple.com>
2718
2719         Add a "supportedConfiguration" dictionary to MediaCapabilitiesDecodingInfo and MediaCapabilitiesEncodingInfo
2720         https://bugs.webkit.org/show_bug.cgi?id=195763
2721
2722         Reviewed by Jon Lee.
2723
2724         Test: media/mediacapabilities/mock-decodingInfo-supportedConfiguration.html
2725
2726         Add support for a proposed addition to the Media Capabilities spec that would future-proof additional changes
2727         to Media Capabilities by allowing sites to check exactly what properties were queried by the browser when
2728         answering a decodeInfo() or enocdeInfo() query.
2729
2730         * CMakeLists.txt:
2731         * DerivedSources-input.xcfilelist:
2732         * DerivedSources-output.xcfilelist:
2733         * DerivedSources.make:
2734         * Modules/mediacapabilities/AudioConfiguration.idl:
2735         * Modules/mediacapabilities/MediaCapabilities.cpp:
2736         (WebCore::MediaCapabilities::decodingInfo):
2737         (WebCore::MediaCapabilities::encodingInfo):
2738         * Modules/mediacapabilities/MediaCapabilities.idl:
2739         * Modules/mediacapabilities/MediaCapabilitiesDecodingInfo.idl:
2740         * Modules/mediacapabilities/MediaCapabilitiesEncodingInfo.idl:
2741         * Modules/mediacapabilities/MediaCapabilitiesInfo.idl:
2742         * Modules/mediacapabilities/MediaDecodingConfiguration.idl:
2743         * Modules/mediacapabilities/MediaEncodingConfiguration.idl:
2744         * Modules/mediacapabilities/VideoConfiguration.idl:
2745         * Sources.txt:
2746         * WebCore.xcodeproj/project.pbxproj:
2747         * platform/MediaCapabilitiesDecodingInfo.h: Copied from Source/WebCore/platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h.
2748         (WebCore::MediaCapabilitiesDecodingInfo::MediaCapabilitiesDecodingInfo):
2749         * platform/MediaCapabilitiesEncodingInfo.h: Copied from Source/WebCore/platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h.
2750         (WebCore::MediaCapabilitiesEncodingInfo::MediaCapabilitiesEncodingInfo):
2751         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
2752         (WebCore::createMediaPlayerDecodingConfigurationCocoa):
2753         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h:
2754         * platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.cpp:
2755         (WebCore::createMediaPlayerDecodingConfigurationGStreamer):
2756         * platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.h:
2757         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
2758         (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
2759         (WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
2760         * platform/mediacapabilities/MediaEngineConfigurationFactory.h:
2761         * platform/mock/MediaEngineConfigurationFactoryMock.cpp:
2762         (WebCore::MediaEngineConfigurationFactoryMock::createDecodingConfiguration):
2763         (WebCore::MediaEngineConfigurationFactoryMock::createEncodingConfiguration):
2764         * platform/mock/MediaEngineConfigurationFactoryMock.h:
2765
2766 2019-03-15  Antti Koivisto  <antti@apple.com>
2767
2768         Use Region for event region even when it is a rectangle
2769         https://bugs.webkit.org/show_bug.cgi?id=195803
2770
2771         Reviewed by Simon Fraser.
2772
2773         Region type is now optimized for the common single-rectangle case so we can simplify code.
2774
2775         * platform/graphics/GraphicsLayer.cpp:
2776         (WebCore::GraphicsLayer::setEventRegion):
2777         * platform/graphics/GraphicsLayer.h:
2778         (WebCore::GraphicsLayer::eventRegion const):
2779         * platform/graphics/ca/GraphicsLayerCA.cpp:
2780         (WebCore::GraphicsLayerCA::setEventRegion):
2781         * platform/graphics/ca/GraphicsLayerCA.h:
2782         * platform/graphics/ca/PlatformCALayer.h:
2783         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2784         * rendering/RenderLayerBacking.cpp:
2785         (WebCore::RenderLayerBacking::paintIntoLayer):
2786
2787 2019-03-15  Jer Noble  <jer.noble@apple.com>
2788
2789         Unreviewed unified build fix: GPUBindGroup has a default public constructor and destructor, so all its member
2790         variables must be fully defined.
2791
2792         * platform/graphics/gpu/GPUBindGroup.h:
2793
2794 2019-03-15  Per Arne Vollan  <pvollan@apple.com>
2795
2796         [macOS] Broker access to Speech Synthesis
2797         https://bugs.webkit.org/show_bug.cgi?id=195645
2798         <rdar://problem/35369026>
2799
2800         Reviewed by Brent Fulgham.
2801
2802         To be able to close the connection to the speech synthesis daemon in the WebContent process,
2803         speech synthesis should be performed in the UI process. This patch forwards speech synthesis
2804         requests to the UI process by sending messages. On the UI process side, the speech synthesis
2805         is performed by simply using the existing platform speech synthesizer. Speech synthesis
2806         events are sent back to the WebContent process. All messages are async, except for the
2807         message to get the list of available voices.
2808
2809         No new tests, covered by existing tests.
2810
2811         * Modules/speech/DOMWindowSpeechSynthesis.cpp:
2812         (WebCore::DOMWindowSpeechSynthesis::speechSynthesis):
2813         * Modules/speech/SpeechSynthesis.cpp:
2814         (WebCore::SpeechSynthesis::create):
2815         (WebCore::SpeechSynthesis::SpeechSynthesis):
2816         (WebCore::SpeechSynthesis::setPlatformSynthesizer):
2817         (WebCore::SpeechSynthesis::getVoices):
2818         (WebCore::SpeechSynthesis::startSpeakingImmediately):
2819         (WebCore::SpeechSynthesis::cancel):
2820         (WebCore::SpeechSynthesis::pause):
2821         (WebCore::SpeechSynthesis::resume):
2822         (WebCore::SpeechSynthesis::boundaryEventOccurred):
2823         (WebCore::SpeechSynthesis::didStartSpeaking):
2824         (WebCore::SpeechSynthesis::didFinishSpeaking):
2825         (WebCore::SpeechSynthesis::didPauseSpeaking):
2826         (WebCore::SpeechSynthesis::didResumeSpeaking):
2827         (WebCore::SpeechSynthesis::speakingErrorOccurred):
2828         (WebCore::SpeechSynthesis::voicesChanged):
2829         * Modules/speech/SpeechSynthesis.h:
2830         * WebCore.xcodeproj/project.pbxproj:
2831         * page/Page.cpp:
2832         (WebCore::Page::Page):
2833         * page/Page.h:
2834         (WebCore::Page::speechSynthesisClient const):
2835         * page/PageConfiguration.cpp:
2836         * page/PageConfiguration.h:
2837         * page/SpeechSynthesisClient.h: Added.
2838         * platform/PlatformSpeechSynthesisUtterance.h:
2839         * platform/PlatformSpeechSynthesizer.h:
2840         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
2841         (-[WebSpeechSynthesisWrapper speechSynthesizer:willSpeakRangeOfSpeechString:utterance:]):
2842         * platform/mac/PlatformSpeechSynthesizerMac.mm:
2843         (-[WebSpeechSynthesisWrapper speechSynthesizer:willSpeakWord:ofString:]):
2844         * platform/mock/PlatformSpeechSynthesizerMock.cpp:
2845         (WebCore::PlatformSpeechSynthesizerMock::speak):
2846
2847 2019-03-15  Antti Koivisto  <antti@apple.com>
2848
2849         Try to fix watchOS build.
2850
2851         * platform/graphics/Region.h:
2852         (WebCore::Region::Span::decode):
2853
2854 2019-03-15  Simon Fraser  <simon.fraser@apple.com>
2855
2856         [Async overflow Scrolling] Update positioned node layers when overflows are scrolled
2857         https://bugs.webkit.org/show_bug.cgi?id=195733
2858         rdar://problem/11642295
2859
2860         Reviewed by Antti Koivisto.
2861
2862         Make ScrollingTree positioned nodes in the two cases where we need them, as
2863         detected by RenderLayerCompositor::computeCoordinatedPositioningForLayer().
2864
2865         For "Moves" layers we know that the overflow is not in the z-order ancestor chain,
2866         so ScrollingTree needs a map of overflow node -> affected positioned nodes which
2867         notifyRelatedNodesAfterScrollPositionChange() uses to find nodes to update after
2868         a scroll. Computing these dependent nodes in RenderLayerCompositor() would require
2869         correct dependency analysis between an overflow layers and "positioned" layers which
2870         is hard. It's easier to have "positioned" layers figure out which overflow nodes
2871         affect them, then compute the inverse relationship when the scrolling tree is updated
2872         which happens in ScrollingTreePositionedNode::commitStateBeforeChildren().
2873
2874         Tests: scrollingcoordinator/ios/absolute-layer-should-not-move-with-scroll.html
2875                scrollingcoordinator/ios/relative-layer-should-move-with-scroll.html
2876
2877         * page/scrolling/ScrollingTree.cpp:
2878         (WebCore::ScrollingTree::commitTreeState):
2879         (WebCore::ScrollingTree::applyLayerPositions):
2880         (WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
2881         (WebCore::ScrollingTree::scrollingTreeAsText):
2882         * page/scrolling/ScrollingTree.h:
2883         (WebCore::ScrollingTree::overflowRelatedNodes):
2884         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
2885         (WebCore::ScrollingTreeOverflowScrollingNode::dumpProperties const):
2886         * page/scrolling/ScrollingTreeOverflowScrollingNode.h:
2887         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
2888         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
2889         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
2890         (WebCore::ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange):
2891         * rendering/RenderLayerCompositor.cpp:
2892         (WebCore::layerContainingBlockCrossesCoordinatedScrollingBoundary):
2893         (WebCore::layerParentedAcrossCoordinatedScrollingBoundary):
2894         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
2895         (WebCore::collectRelatedCoordinatedScrollingNodes):
2896         (WebCore::RenderLayerCompositor::updateScrollingNodeForPositioningRole):
2897
2898 2019-03-15  Antti Koivisto  <antti@apple.com>
2899
2900         Optimize Region for single rectangle case
2901         https://bugs.webkit.org/show_bug.cgi?id=195743
2902
2903         Reviewed by Simon Fraser.
2904
2905         Instrumentation shows vast majority of Region objects consist of a single rectangle. However it always allocates
2906         the large Shape data structure. This makes it unsuitable to use as a member in any popular objects.
2907
2908         This patch optimizes the single rectangle case by using only the bounds rectangle to describe it.
2909         Shape is allocated on demand. This makes it safe to use Region as a data member where a rectangle is the common case.
2910
2911         The patch also modernizes Region encoding/decoding support.
2912
2913         * platform/graphics/Region.cpp:
2914         (WebCore::Region::Region):
2915         (WebCore::Region::~Region):
2916         (WebCore::Region::operator=):
2917         (WebCore::Region::rects const):
2918         (WebCore::Region::contains const):
2919         (WebCore::Region::intersects const):
2920         (WebCore::Region::Shape::Shape):
2921         (WebCore::Region::Shape::appendSpan):
2922         (WebCore::Region::dump const):
2923         (WebCore::Region::intersect):
2924         (WebCore::Region::unite):
2925         (WebCore::Region::subtract):
2926         (WebCore::Region::translate):
2927         (WebCore::Region::setShape):
2928         (WebCore::Region::Shape::isValid const): Deleted.
2929         (WebCore::Region::Shape::swap): Deleted.
2930         (WebCore::Region::updateBoundsFromShape): Deleted.
2931
2932         Remove some now unused function.
2933
2934         * platform/graphics/Region.h:
2935         (WebCore::Region::isRect const):
2936         (WebCore::Region::gridSize const):
2937         (WebCore::Region::copyShape const):
2938         (WebCore::operator==):
2939         (WebCore::Region::Span::encode const):
2940         (WebCore::Region::Span::decode):
2941         (WebCore::Region::Shape::encode const):
2942         (WebCore::Region::Shape::decode):
2943         (WebCore::Region::encode const):
2944         (WebCore::Region::decode):
2945
2946         This is now part of type.
2947
2948         (WebCore::Region::isValid const): Deleted.
2949         (WebCore::Region::Span::Span): Deleted.
2950         (WebCore::Region::shapeSegments const): Deleted.
2951         (WebCore::Region::shapeSpans const): Deleted.
2952         (WebCore::Region::setShapeSegments): Deleted.
2953         (WebCore::Region::setShapeSpans): Deleted.
2954         (WebCore::Region::Shape::segments const): Deleted.
2955         (WebCore::Region::Shape::spans const): Deleted.
2956         (WebCore::Region::Shape::setSegments): Deleted.
2957         (WebCore::Region::Shape::setSpans): Deleted.
2958
2959         No need to expose these for encoding anymore.
2960
2961 2019-03-15  Devin Rousso  <drousso@apple.com>
2962
2963         Web Inspector: provide a way to capture a screenshot of a node from within the page
2964         https://bugs.webkit.org/show_bug.cgi?id=194279
2965         <rdar://problem/10731573>
2966
2967         Reviewed by Joseph Pecoraro.
2968
2969         Test: inspector/console/console-screenshot.html
2970
2971         Add `console.screenshot` functionality, which displays a screenshot of a given object (if
2972         able) within Web Inspector's Console tab. From there, it can be viewed and saved.
2973
2974         Currently, `console.screenshot` will
2975          - capture an image of a `Node` (if provided)
2976          - capture an image of the viewport if nothing is provided
2977
2978         * page/PageConsoleClient.h:
2979         * page/PageConsoleClient.cpp:
2980         (WebCore::PageConsoleClient::addMessage):
2981         (WebCore::PageConsoleClient::screenshot): Added.
2982
2983         * workers/WorkerConsoleClient.h:
2984         * workers/WorkerConsoleClient.cpp:
2985         (WebCore::WorkerConsoleClient::screenshot): Added.
2986         * worklets/WorkletConsoleClient.h:
2987         * worklets/WorkletConsoleClient.cpp:
2988         (WebCore::WorkletConsoleClient::screenshot): Added.
2989
2990         * inspector/CommandLineAPIModuleSource.js:
2991         (CommandLineAPIImpl.prototype.screenshot): Added.
2992
2993         * inspector/InspectorInstrumentation.h:
2994
2995 2019-03-14  Yusuke Suzuki  <ysuzuki@apple.com>
2996
2997         [JSC] Retain PrivateName of Symbol before passing it to operations potentially incurring GC
2998         https://bugs.webkit.org/show_bug.cgi?id=195791
2999         <rdar://problem/48806130>
3000
3001         Reviewed by Mark Lam.
3002
3003         * bindings/js/ScriptController.cpp:
3004         (WebCore::ScriptController::setupModuleScriptHandlers):
3005
3006 2019-03-14  Brent Fulgham  <bfulgham@apple.com>
3007
3008         Move CoreCrypto SPI declarations to an appropriate PAL/spi header
3009         https://bugs.webkit.org/show_bug.cgi?id=195754
3010         <rdar://problem/48591957>
3011
3012         Reviewed by Jiewen Tan.
3013
3014         Move the forward declarations of various CoreCrypto SPI to an appropriate PAL/spi header.
3015         Update the const correctness of one function call to match new SDK declaration.
3016
3017         No tests because there are no changes in behavior.
3018
3019         * crypto/CommonCryptoUtilities.h:
3020         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
3021         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
3022
3023 2019-03-14  Sihui Liu  <sihui_liu@apple.com>
3024
3025         IndexedDB: re-enable some leak tests
3026         https://bugs.webkit.org/show_bug.cgi?id=194806
3027
3028         Reviewed by Geoffrey Garen.
3029
3030         Protected JSIDBCursor object when advance/continue request on IDBCursor is not finished, because after the 
3031         advance operation completes on success, we need to return the same JSIDBCursor object as before the advance, 
3032         and during the wait for advance operation to complete, we need to return error as the result. 
3033  
3034         Covered by existing tests.
3035
3036         * Modules/indexeddb/IDBCursor.cpp:
3037         (WebCore::IDBCursor::setGetResult):
3038         (WebCore::IDBCursor::clearWrappers):
3039         * Modules/indexeddb/IDBCursor.h:
3040         * Modules/indexeddb/IDBRequest.cpp:
3041         (WebCore::IDBRequest::stop):
3042         (WebCore::IDBRequest::setResult):
3043         (WebCore::IDBRequest::setResultToStructuredClone):
3044         (WebCore::IDBRequest::setResultToUndefined):
3045         (WebCore::IDBRequest::willIterateCursor):
3046         (WebCore::IDBRequest::didOpenOrIterateCursor):
3047         (WebCore::IDBRequest::clearWrappers):
3048         * Modules/indexeddb/IDBRequest.h:
3049         (WebCore::IDBRequest::cursorWrapper):
3050         * bindings/js/JSIDBRequestCustom.cpp:
3051         (WebCore::JSIDBRequest::visitAdditionalChildren):
3052         * bindings/js/JSValueInWrappedObject.h:
3053         (WebCore::JSValueInWrappedObject::JSValueInWrappedObject):
3054         (WebCore::JSValueInWrappedObject::operator=):
3055         (WebCore::JSValueInWrappedObject::clear):
3056
3057 2019-03-14  Shawn Roberts  <sroberts@apple.com>
3058
3059         Unreviewed, rolling out r242981.
3060
3061         Causing internal build failures on watch/tv OS
3062
3063         Reverted changeset:
3064
3065         "Move CoreCrypto SPI declarations to an appropriate PAL/spi
3066         header"
3067         https://bugs.webkit.org/show_bug.cgi?id=195754
3068         https://trac.webkit.org/changeset/242981
3069
3070 2019-03-14  Sihui Liu  <sihui_liu@apple.com>
3071
3072         Web process is put to suspended when holding locked WebSQL files
3073         https://bugs.webkit.org/show_bug.cgi?id=195768
3074
3075         Reviewed by Geoffrey Garen.
3076
3077         We need to keep processes active during database close, because SQLite database may run a checkpoint operation
3078         and lock database files.
3079
3080         * platform/sql/SQLiteDatabase.cpp:
3081         (WebCore::SQLiteDatabase::useWALJournalMode):
3082         (WebCore::SQLiteDatabase::close):
3083         * platform/sql/SQLiteDatabase.h:
3084
3085 2019-03-14  Brent Fulgham  <bfulgham@apple.com>
3086
3087         Move CoreCrypto SPI declarations to an appropriate PAL/spi header
3088         https://bugs.webkit.org/show_bug.cgi?id=195754
3089         <rdar://problem/48591957>
3090
3091         Reviewed by Jiewen Tan.
3092
3093         Move the forward declarations of various CoreCrypto SPI to an appropriate PAL/spi header.
3094         Update the const correctness of one function call to match new SDK declaration.
3095
3096         No tests because there are no changes in behavior.
3097
3098         * crypto/CommonCryptoUtilities.h:
3099         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
3100         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
3101
3102 2019-03-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
3103
3104         Rename SVGProperty to SVGLegacyProperty and rename SVGAnimatedProperty to SVGLegacyAnimatedProperty
3105         https://bugs.webkit.org/show_bug.cgi?id=195767
3106
3107         Reviewed by Tim Horton.
3108
3109         This is a step towards removing the SVG properties tear off objects.
3110
3111         * Sources.txt:
3112         * WebCore.xcodeproj/project.pbxproj:
3113         * svg/SVGAngle.h:
3114         (WebCore::SVGAngle::create):
3115         (WebCore::SVGAngle::SVGAngle):
3116         * svg/SVGAnimateElement.h:
3117         * svg/SVGAnimatedTypeAnimator.h:
3118         (WebCore::SVGAnimatedTypeAnimator::castAnimatedPropertyToActualType):
3119         * svg/SVGElement.h:
3120         (WebCore::SVGElement::lookupAnimatedProperty const):
3121         (WebCore::SVGElement::lookupOrCreateAnimatedProperty):
3122         (WebCore::SVGElement::lookupOrCreateAnimatedProperties):
3123         * svg/SVGLength.h:
3124         (WebCore::SVGLength::create):
3125         (WebCore::SVGLength::SVGLength):
3126         * svg/SVGMatrix.h:
3127         (WebCore::SVGMatrix::create):
3128         (WebCore::SVGMatrix::SVGMatrix):
3129         * svg/SVGNumber.h:
3130         (WebCore::SVGNumber::create):
3131         (WebCore::SVGNumber::SVGNumber):
3132         * svg/SVGPathElement.cpp:
3133         (WebCore::SVGPathElement::lookupOrCreateDWrapper):
3134         * svg/SVGPathElement.h:
3135         * svg/SVGPathSegList.cpp:
3136         (WebCore::SVGPathSegList::processIncomingListItemValue):
3137         * svg/SVGPathSegWithContext.h:
3138         (WebCore::SVGPathSegWithContext::animatedProperty const):
3139         * svg/SVGPoint.h:
3140         (WebCore::SVGPoint::create):
3141         (WebCore::SVGPoint::SVGPoint):
3142         * svg/SVGPreserveAspectRatio.h:
3143         (WebCore::SVGPreserveAspectRatio::create):
3144         (WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio):
3145         * svg/SVGRect.h:
3146         (WebCore::SVGRect::create):
3147         (WebCore::SVGRect::SVGRect):
3148         * svg/SVGTransform.h:
3149         (WebCore::SVGTransform::create):
3150         (WebCore::SVGTransform::SVGTransform):
3151         * svg/properties/SVGAnimatedListPropertyTearOff.h:
3152         (WebCore::SVGAnimatedListPropertyTearOff::findItem):
3153         (WebCore::SVGAnimatedListPropertyTearOff::SVGAnimatedListPropertyTearOff):
3154         * svg/properties/SVGAnimatedProperty.cpp: Removed.
3155         * svg/properties/SVGAnimatedProperty.h: Removed.
3156         * svg/properties/SVGAnimatedPropertyTearOff.h:
3157         * svg/properties/SVGAnimatedStaticPropertyTearOff.h:
3158         (WebCore::SVGAnimatedStaticPropertyTearOff::SVGAnimatedStaticPropertyTearOff):
3159         * svg/properties/SVGAttributeAccessor.h:
3160         (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperty const):
3161         (WebCore::SVGAttributeAccessor::lookupAnimatedProperty const):
3162         (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperties const):
3163         (WebCore::SVGAnimatedAttributeAccessor::lookupOrCreateAnimatedProperty):
3164         (WebCore::SVGAnimatedAttributeAccessor::lookupAnimatedProperty):
3165         * svg/properties/SVGAttributeOwnerProxy.h:
3166         * svg/properties/SVGAttributeOwnerProxyImpl.h:
3167         * svg/properties/SVGAttributeRegistry.h:
3168         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperty const):
3169         (WebCore::SVGAttributeRegistry::lookupAnimatedProperty const):
3170         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperties const):
3171         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertyBaseTypes):
3172         (WebCore::SVGAttributeRegistry::lookupAnimatedPropertyBaseTypes):
3173         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertiesBaseTypes):
3174         * svg/properties/SVGLegacyAnimatedProperty.cpp: Copied from Source/WebCore/svg/properties/SVGAnimatedProperty.cpp.
3175         (WebCore::SVGLegacyAnimatedProperty::SVGLegacyAnimatedProperty):
3176         (WebCore::SVGLegacyAnimatedProperty::~SVGLegacyAnimatedProperty):
3177         (WebCore::SVGLegacyAnimatedProperty::commitChange):
3178         (WebCore::SVGAnimatedProperty::SVGAnimatedProperty): Deleted.
3179         (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty): Deleted.
3180         (WebCore::SVGAnimatedProperty::commitChange): Deleted.
3181         * svg/properties/SVGLegacyAnimatedProperty.h: Copied from Source/WebCore/svg/properties/SVGAnimatedProperty.h.
3182         (WebCore::SVGLegacyAnimatedProperty::lookupOrCreateAnimatedProperty):
3183         (WebCore::SVGLegacyAnimatedProperty::lookupAnimatedProperty):
3184         (WebCore::SVGAnimatedProperty::isAnimating const): Deleted.
3185         (WebCore::SVGAnimatedProperty::isAnimatedListTearOff const): Deleted.
3186         (WebCore::SVGAnimatedProperty::contextElement const): Deleted.
3187         (WebCore::SVGAnimatedProperty::attributeName const): Deleted.
3188         (WebCore::SVGAnimatedProperty::animatedPropertyType const): Deleted.
3189         (WebCore::SVGAnimatedProperty::isReadOnly const): Deleted.
3190         (WebCore::SVGAnimatedProperty::setIsReadOnly): Deleted.
3191         (WebCore::SVGAnimatedProperty::lookupOrCreateAnimatedProperty): Deleted.
3192         (WebCore::SVGAnimatedProperty::lookupAnimatedProperty): Deleted.
3193         (WebCore::SVGAnimatedProperty::animatedPropertyCache): Deleted.
3194         * svg/properties/SVGLegacyProperty.h: Copied from Source/WebCore/svg/properties/SVGProperty.h.
3195         * svg/properties/SVGListProperty.h:
3196         * svg/properties/SVGProperty.h: Removed.
3197         * svg/properties/SVGPropertyTearOff.h:
3198         (WebCore::SVGPropertyTearOff::create):
3199         (WebCore::SVGPropertyTearOff::animatedProperty const):
3200         (WebCore::SVGPropertyTearOff::setAnimatedProperty):
3201         (WebCore::SVGPropertyTearOff::SVGPropertyTearOff):
3202
3203 2019-03-14  Ryan Haddad  <ryanhaddad@apple.com>
3204
3205         Unreviewed, rolling out r242963.
3206
3207         Breaks watchOS build.
3208
3209         Reverted changeset:
3210
3211         "Move CommonCrypto SPI declarations to an appropriate PAL/spi
3212         header"
3213         https://bugs.webkit.org/show_bug.cgi?id=195754
3214         https://trac.webkit.org/changeset/242963
3215
3216 2019-03-14  Chris Dumez  <cdumez@apple.com>
3217
3218         Unreviewed, update xcfilelist files as they are out of sync.
3219
3220         * DerivedSources-input.xcfilelist:
3221         * DerivedSources-output.xcfilelist:
3222
3223 2019-03-14  Justin Fan  <justin_fan@apple.com>
3224
3225         [Web GPU] Updates to GPUCommandBuffer for new GPUCommandEncoder concept
3226         https://bugs.webkit.org/show_bug.cgi?id=195083
3227         <rdar://problem/48423591>
3228
3229         Reviewed by Dean Jackson.
3230
3231         Fixing build error and re-introducing rolled-out changes.
3232         WebGPUCommandBuffer now represents a completed GPUCommandBuffer that can only be used in queue submits. The previous WebGPUCommandBuffer
3233         is now WebGPUCommandEncoder.
3234
3235         Affected Web GPU tests updated to match new API.
3236
3237         New files and symbols:
3238         * CMakeLists.txt:
3239         * DerivedSources.make:
3240         * Sources.txt:
3241         * WebCore.xcodeproj/project.pbxproj:
3242         * bindings/js/WebCoreBuiltinNames.h:
3243
3244         Implement new WebGPUCommandBuffer, now just a DOM object carrier for a finished GPUCommandBuffer:
3245         * Modules/webgpu/WebGPUCommandBuffer.cpp:
3246         (WebCore::WebGPUCommandBuffer::create):
3247         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
3248         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const): Deleted.
3249         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const): Deleted.
3250         (WebCore::WebGPUCommandBuffer::beginRenderPass): Deleted.
3251         (WebCore::WebGPUCommandBuffer::copyBufferToBuffer): Deleted.
3252         (WebCore::WebGPUCommandBuffer::copyBufferToTexture): Deleted.
3253         (WebCore::WebGPUCommandBuffer::copyTextureToBuffer): Deleted.
3254         (WebCore::WebGPUCommandBuffer::copyTextureToTexture): Deleted.
3255         * Modules/webgpu/WebGPUCommandBuffer.h:
3256         (WebCore::WebGPUCommandBuffer::commandBuffer):
3257         (WebCore::WebGPUCommandBuffer::commandBuffer const): Deleted.
3258         * Modules/webgpu/WebGPUCommandBuffer.idl:
3259
3260         Rename old WebGPUCommandBuffer to WebGPUCommandEncoder:
3261         * Modules/webgpu/WebGPUCommandEncoder.cpp: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.cpp.
3262         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const):
3263         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const):
3264         (WebCore::WebGPUCommandEncoder::create):
3265         (WebCore::WebGPUCommandEncoder::WebGPUCommandEncoder):
3266         (WebCore::WebGPUCommandEncoder::beginRenderPass):
3267         (WebCore::WebGPUCommandEncoder::copyBufferToBuffer):
3268         (WebCore::WebGPUCommandEncoder::copyBufferToTexture):
3269         (WebCore::WebGPUCommandEncoder::copyTextureToBuffer):
3270         (WebCore::WebGPUCommandEncoder::copyTextureToTexture):
3271         (WebCore::WebGPUCommandEncoder::finish): Added. "Completes" this and invalidates it. Returns its GPUCommandBuffer, ready for submission.
3272         * Modules/webgpu/WebGPUCommandEncoder.h: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.h.
3273         * Modules/webgpu/WebGPUCommandEncoder.idl: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.idl.
3274         * Modules/webgpu/WebGPUDevice.cpp:
3275         (WebCore::WebGPUDevice::createCommandEncoder const): Renamed fom createCommandBuffer. Now returns non-nullable.
3276         (WebCore::WebGPUDevice::createCommandBuffer const): Deleted.
3277         * Modules/webgpu/WebGPUDevice.h:
3278         * Modules/webgpu/WebGPUDevice.idl:
3279         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
3280         (WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder):
3281         (WebCore::WebGPUProgrammablePassEncoder::endPass): No longer returns the original WebGPUCommandBuffer.
3282         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
3283         (WebCore::WebGPUProgrammablePassEncoder::setPipeline):
3284         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
3285         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
3286         * Modules/webgpu/WebGPUQueue.cpp:
3287         (WebCore::WebGPUQueue::submit): Replace unnecessary rvalue reference parameter.
3288         * Modules/webgpu/WebGPUQueue.h:
3289         * Modules/webgpu/WebGPUQueue.idl:
3290         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
3291         (WebCore::WebGPURenderPassEncoder::create):
3292         (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
3293         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
3294         (WebCore::WebGPURenderPassEncoder::draw):
3295         (WebCore::WebGPURenderPassEncoder::passEncoder const): Now returns a pointer since it is properly backed by a RefPtr.
3296         * Modules/webgpu/WebGPURenderPassEncoder.h:
3297         * Modules/webgpu/WebGPUSwapChain.cpp:
3298         (WebCore::WebGPUSwapChain::getCurrentTexture): No longer invalidates m_currentTexture. Doh!
3299         * platform/graphics/gpu/GPUCommandBuffer.h: Missing includes for the *CopyView structs.
3300         * platform/graphics/gpu/GPUDevice.cpp:
3301         (WebCore::GPUDevice::tryCreateCommandBuffer const): Renamed from createCommandBuffer.
3302         (WebCore::GPUDevice::createCommandBuffer): Deleted.
3303         * platform/graphics/gpu/GPUDevice.h:
3304         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
3305         (WebCore::GPUCommandBuffer::tryCreate): Renamed from create.
3306         (WebCore::GPUCommandBuffer::create): Deleted.
3307
3308 2019-03-14  Justin Fan  <justin_fan@apple.com>
3309
3310         [Web GPU] Enum cleanup
3311         https://bugs.webkit.org/show_bug.cgi?id=195766
3312
3313         Reviewed by Myles C. Maxfield.
3314
3315         Clean up enum implementations in Web GPU. Enums referenced by only one class now share implementation files with that class to reduce clutter.
3316         
3317         No change in behavior.
3318
3319         * DerivedSources.make:
3320         * Modules/webgpu/GPUBindGroupLayoutBinding.h:
3321         * Modules/webgpu/GPUBindGroupLayoutBinding.idl:
3322         * Modules/webgpu/GPUInputStateDescriptor.idl:
3323         * Modules/webgpu/GPURequestAdapterOptions.idl:
3324         * Modules/webgpu/GPUSamplerDescriptor.idl:
3325         * Modules/webgpu/GPUTextureDescriptor.idl:
3326         * Modules/webgpu/GPUTextureDimension.idl: Removed.
3327         * Modules/webgpu/GPUVertexAttributeDescriptor.idl:
3328         * Modules/webgpu/GPUVertexInputDescriptor.idl:
3329         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
3330         (WebCore::validateBufferBindingType):
3331         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
3332         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
3333         * Sources.txt:
3334         * WebCore.xcodeproj/project.pbxproj:
3335         * platform/graphics/gpu/GPUInputStateDescriptor.h:
3336         * platform/graphics/gpu/GPURequestAdapterOptions.h:
3337         * platform/graphics/gpu/GPUSamplerDescriptor.h:
3338         * platform/graphics/gpu/GPUTextureDescriptor.h:
3339         * platform/graphics/gpu/GPUTextureDimension.h: Removed.
3340         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
3341         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
3342         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
3343         (WebCore::MTLDataTypeForBindingType):
3344         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
3345         (WebCore::GPUBindGroup::tryCreate):
3346         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
3347         (WebCore::GPUDevice::create):
3348         * platform/graphics/gpu/cocoa/GPUSamplerMetal.mm:
3349         (WebCore::mtlAddressModeForAddressMode):
3350         (WebCore::mtlMinMagFilterForFilterMode):
3351         (WebCore::mtlMipFilterForFilterMode):
3352
3353 2019-03-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
3354
3355         Use enum class for AnimationMode
3356         https://bugs.webkit.org/show_bug.cgi?id=195762
3357
3358         Reviewed by Tim Horton.
3359
3360         Convert AnimationMode into an enum class.
3361
3362         * svg/SVGAnimateElementBase.cpp:
3363         (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
3364         (WebCore::SVGAnimateElementBase::isAdditive const):
3365         * svg/SVGAnimateMotionElement.cpp:
3366         (WebCore::SVGAnimateMotionElement::calculateFromAndByValues):
3367         (WebCore::SVGAnimateMotionElement::calculateAnimatedValue):
3368         (WebCore::SVGAnimateMotionElement::updateAnimationMode):
3369         * svg/SVGAnimatedAngle.cpp:
3370         (WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue):
3371         * svg/SVGAnimatedBoolean.cpp:
3372         (WebCore::SVGAnimatedBooleanAnimator::calculateAnimatedValue):
3373         * svg/SVGAnimatedColor.cpp:
3374         (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
3375         * svg/SVGAnimatedEnumeration.cpp:
3376         (WebCore::SVGAnimatedEnumerationAnimator::calculateAnimatedValue):
3377         * svg/SVGAnimatedInteger.cpp:
3378         (WebCore::SVGAnimatedIntegerAnimator::calculateAnimatedValue):
3379         * svg/SVGAnimatedIntegerOptionalInteger.cpp:
3380         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::calculateAnimatedValue):
3381         * svg/SVGAnimatedLength.cpp:
3382         (WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue):
3383         * svg/SVGAnimatedLengthList.cpp:
3384         (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
3385         * svg/SVGAnimatedNumber.cpp:
3386         (WebCore::SVGAnimatedNumberAnimator::calculateAnimatedValue):
3387         * svg/SVGAnimatedNumberList.cpp:
3388         (WebCore::SVGAnimatedNumberListAnimator::calculateAnimatedValue):
3389         * svg/SVGAnimatedNumberOptionalNumber.cpp:
3390         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::calculateAnimatedValue):
3391         * svg/SVGAnimatedPath.cpp:
3392         (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue):
3393         * svg/SVGAnimatedPointList.cpp:
3394         (WebCore::SVGAnimatedPointListAnimator::calculateAnimatedValue):
3395         * svg/SVGAnimatedPreserveAspectRatio.cpp:
3396         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateAnimatedValue):
3397         * svg/SVGAnimatedRect.cpp:
3398         (WebCore::SVGAnimatedRectAnimator::calculateAnimatedValue):
3399         * svg/SVGAnimatedTransformList.cpp:
3400         (WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
3401         * svg/SVGAnimationElement.cpp:
3402         (WebCore::SVGAnimationElement::updateAnimationMode):
3403         (WebCore::SVGAnimationElement::isAdditive const):
3404         (WebCore::SVGAnimationElement::isAccumulated const):
3405         (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced):
3406         (WebCore::SVGAnimationElement::startedActiveInterval):
3407         (WebCore::SVGAnimationElement::updateAnimation):
3408         * svg/SVGAnimationElement.h:
3409         (WebCore::SVGAnimationElement::adjustFromToListValues):
3410         (WebCore::SVGAnimationElement::animateDiscreteType):
3411         (WebCore::SVGAnimationElement::animateAdditiveNumber):
3412         * svg/SVGSetElement.cpp:
3413         (WebCore::SVGSetElement::SVGSetElement):
3414         (WebCore::SVGSetElement::updateAnimationMode):
3415
3416 2019-03-14  Ryosuke Niwa  <rniwa@webkit.org>
3417
3418         Storing a Node in Ref/RefPtr inside its destructor results in double delete
3419         https://bugs.webkit.org/show_bug.cgi?id=195661
3420
3421         Reviewed by Brent Fulgham.
3422
3423         Set Node::m_refCount to 1 before calling its virtual destructor.
3424
3425         This is a security mitigation to prevent any code which ends up storing the node to Ref / RefPtr
3426         inside the destructor, which is a programming error caught by debug assertions, from triggering
3427         a double-delete on the same Node.
3428
3429         Such a code would hit the debug assertions in Node::deref() because m_inRemovedLastRefFunction
3430         had been set to true by then.
3431
3432         * dom/Document.cpp:
3433         (WebCore::Document::removedLastRef):
3434         * dom/Document.h:
3435         (WebCore::Document::decrementReferencingNodeCount):
3436         * dom/Node.cpp:
3437         (WebCore::Node::~Node):
3438         (WebCore::Node::removedLastRef):
3439
3440 2019-03-14  Brent Fulgham  <bfulgham@apple.com>
3441
3442         Move CommonCrypto SPI declarations to an appropriate PAL/spi header
3443         https://bugs.webkit.org/show_bug.cgi?id=195754
3444         <rdar://problem/48591957>
3445
3446         Reviewed by Jiewen Tan.
3447
3448         Move the forward declarations of various CommonCrypto SPI to an appropriate PAL/spi header.
3449         Update the const correctness of one function call to match new SDK declaration.
3450
3451         No tests because there are no changes in behavior.
3452
3453         * crypto/CommonCryptoUtilities.h:
3454         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
3455         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
3456
3457 2019-03-14  Chris Dumez  <cdumez@apple.com>
3458
3459         Add WebsitePolicy for the client to specify the device orientation & motion access policy
3460         https://bugs.webkit.org/show_bug.cgi?id=195750
3461
3462         Reviewed by Geoffrey Garen.
3463
3464         Add WebsitePolicy for the client to specify the device orientation & motion access policy. If
3465         the client already knows access to the device motion & orientation API will be granted / denied,
3466         it can let WebKit know via WebsitePolicies so that WebKit will not ask the client when the
3467         permission is requested by JS.
3468
3469         * dom/DeviceOrientationAndMotionAccessController.cpp:
3470         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
3471         (WebCore::DeviceOrientationAndMotionAccessController::setAccessState):
3472         (WebCore::DeviceOrientationAndMotionAccessController::accessState const):
3473         * dom/DeviceOrientationAndMotionAccessController.h:
3474         * loader/DocumentLoader.h:
3475         (WebCore::DocumentLoader::deviceOrientationAndMotionAccessState const):
3476         (WebCore::DocumentLoader::setDeviceOrientationAndMotionAccessState):
3477         * page/DOMWindow.cpp:
3478         (WebCore::DOMWindow::isAllowedToUseDeviceMotionOrientation const):
3479
3480 2019-03-14  Shawn Roberts  <sroberts@apple.com>
3481
3482         Unreviewed, rolling out r242931.
3483
3484         Causing internal watch/tv OS build failures
3485
3486         Reverted changeset:
3487
3488         "[Web GPU] Updates to GPUCommandBuffer for new GPUCommandQueue
3489         concept"
3490         https://bugs.webkit.org/show_bug.cgi?id=195083
3491         https://trac.webkit.org/changeset/242931
3492
3493 2019-03-14  Chris Dumez  <cdumez@apple.com>
3494
3495         Device orientation's permission should only require a user gesture to prompt the user
3496         https://bugs.webkit.org/show_bug.cgi?id=195731
3497
3498         Reviewed by Geoffrey Garen.
3499
3500         Device orientation's permission should only require a user gesture to prompt the user. If the
3501         user already made a decision, we should resolve the promise with this decision, even without
3502         user gesture.
3503
3504         This is useful for JS to figure out if they are access to device orientation or not because
3505         showing UI for the user to give permission.
3506
3507         No new tests, updated existing tests.
3508
3509         * dom/DeviceOrientationAndMotionAccessController.cpp:
3510         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
3511         * dom/DeviceOrientationAndMotionAccessController.h:
3512         * dom/DeviceOrientationOrMotionEvent.cpp:
3513         (WebCore::DeviceOrientationOrMotionEvent::requestPermission):
3514
3515 2019-03-14  Youenn Fablet  <youenn@apple.com>
3516
3517         Reset storage quota when clearing IDB/Cache API entries
3518         https://bugs.webkit.org/show_bug.cgi?id=195716
3519
3520         Reviewed by Chris Dumez.
3521
3522         On clearing of databases, reset all quota users.
3523         This will ensure all layout test runs start with a clean state.
3524
3525         * Modules/indexeddb/server/IDBServer.cpp:
3526         (WebCore::IDBServer::IDBServer::didPerformCloseAndDeleteDatabases):
3527         * storage/StorageQuotaManager.h:
3528         (WebCore::StorageQuotaManager::resetQuota):
3529
3530 2019-03-14  Jer Noble  <jer.noble@apple.com>
3531
3532         Certain videos are causing a crash when used as WebGL texture
3533         https://bugs.webkit.org/show_bug.cgi?id=195700
3534         <rdar://problem/48869347>
3535
3536         Reviewed by Eric Carlson.
3537
3538         CFEqual is not null-safe, so perform a null and type check before comparing.
3539
3540         * platform/graphics/cv/VideoTextureCopierCV.cpp:
3541         (WebCore::transferFunctionFromString):
3542
3543 2019-03-14  Zalan Bujtas  <zalan@apple.com>
3544
3545         Cleanup inline boxes when list marker gets blockified
3546         https://bugs.webkit.org/show_bug.cgi?id=195746
3547         <rdar://problem/48049175>
3548
3549         Reviewed by Antti Koivisto.
3550
3551         Normally when an element gets blockified (inline -> block) we destroy its renderer and construct a new one (RenderInline -> RenderBlock).
3552         During this process the associated inline boxtree gets destroyed as well. Since RenderListMarker is just a generic RenderBox, the blockifying
3553         change does not require a new renderer.
3554         This patch takes care of destroying the inline boxtree when the marker gains block display type. 
3555
3556         Test: fast/block/float/list-marker-is-float-crash.html
3557
3558         * rendering/RenderListMarker.cpp:
3559         (WebCore::RenderListMarker::styleDidChange):
3560
3561 2019-03-14  Devin Rousso  <drousso@apple.com>
3562
3563         Web Inspector: Audit: provide a way to get the contents of resources
3564         https://bugs.webkit.org/show_bug.cgi?id=195266
3565         <rdar://problem/48550911>
3566
3567         Reviewed by Joseph Pecoraro.
3568
3569         Test: inspector/audit/run-resources.html
3570
3571         * inspector/InspectorAuditResourcesObject.idl: Added.
3572         * inspector/InspectorAuditResourcesObject.h: Added.
3573         (WebCore::InspectorAuditResourcesObject::create):
3574         (WebCore::InspectorAuditResourcesObject::Resource):
3575         (WebCore::InspectorAuditResourcesObject::ResourceContent):
3576         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedResourceClient):
3577         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedFontClient):
3578         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedImageClient):
3579         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedRawResourceClient):
3580         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedStyleSheetClient):
3581         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedSVGDocumentClient):
3582         * inspector/InspectorAuditResourcesObject.cpp: Added.
3583         (WebCore::InspectorAuditResourcesObject::InspectorAuditResourcesObject):
3584         (WebCore::InspectorAuditResourcesObject::getResources):
3585         (WebCore::InspectorAuditResourcesObject::getResourceContent):
3586         (WebCore::InspectorAuditResourcesObject::clientForResource):
3587
3588         * inspector/agents/InspectorPageAgent.h:
3589         * inspector/agents/InspectorPageAgent.cpp:
3590         (WebCore::InspectorPageAgent::cachedResourcesForFrame): Added.
3591         (WebCore::allResourcesURLsForFrame):
3592         Moved a file static function to be a class static function so it can be used elsewhere.
3593
3594         * CMakeLists.txt:
3595         * DerivedSources-input.xcfilelist:
3596         * DerivedSources-output.xcfilelist:
3597         * DerivedSources.make:
3598         * Sources.txt:
3599         * WebCore.xcodeproj/project.pbxproj:
3600
3601 2019-03-14  Devin Rousso  <drousso@apple.com>
3602
3603         Web Inspector: Console: getEventListeners should work for any EventTarget
3604         https://bugs.webkit.org/show_bug.cgi?id=195713
3605
3606         Reviewed by Joseph Pecoraro.
3607
3608         Test: inspector/console/command-line-api-getEventListeners.html
3609
3610         * dom/EventTarget.h:
3611         * dom/EventTarget.cpp:
3612         (WebCore::EventTarget::eventTypes): Added.
3613
3614         * inspector/CommandLineAPIHost.idl:
3615         * inspector/CommandLineAPIHost.h:
3616         (WebCore::CommandLineAPIHost::init):
3617         * inspector/CommandLineAPIHost.cpp:
3618         (WebCore::CommandLineAPIHost::disconnect):
3619         (WebCore::CommandLineAPIHost::getEventListeners):
3620         (WebCore::listenerEntriesFromListenerInfo): Deleted.
3621
3622         * inspector/CommandLineAPIModuleSource.js:
3623         (CommandLineAPIImpl.prototype.getEventListeners):
3624
3625         * inspector/InspectorController.cpp:
3626         (WebCore::InspectorController::InspectorController):
3627         * inspector/WorkerInspectorController.cpp:
3628         (WebCore::WorkerInspectorController::WorkerInspectorController):
3629
3630 2019-03-14  Devin Rousso  <drousso@apple.com>
3631
3632         Web Inspector: Styles: `::-webkit-scrollbar*` rules aren't shown
3633         https://bugs.webkit.org/show_bug.cgi?id=195123
3634         <rdar://problem/48450148>
3635
3636         Reviewed by Joseph Pecoraro.
3637
3638         Test: inspector/css/getMatchedStylesForNode.html
3639
3640         * inspector/agents/InspectorCSSAgent.cpp:
3641         (WebCore::protocolValueForPseudoId): Added.
3642         (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
3643
3644 2019-03-13  Benjamin Poulain  <benjamin@webkit.org>
3645
3646         Fix the argument type of RenderView::resumePausedImageAnimationsIfNeeded()
3647         https://bugs.webkit.org/show_bug.cgi?id=195659
3648
3649         Reviewed by Saam Barati.
3650
3651         The two callers of resumePausedImageAnimationsIfNeeded() both get the IntRect
3652         as a reference. The rect was going on the stack then used as a reference again.
3653
3654         * rendering/RenderView.cpp:
3655         (WebCore::RenderView::resumePausedImageAnimationsIfNeeded):
3656         * rendering/RenderView.h:
3657
3658 2019-03-13  Zalan Bujtas  <zalan@apple.com>
3659
3660         [ContentChangeObserver] Stop content observation when content calls preventDefault() on touch events
3661         https://bugs.webkit.org/show_bug.cgi?id=195724
3662         <rdar://problem/48873456>
3663
3664         Reviewed by Simon Fraser.
3665
3666         Call willNotProceedWithClick on preventDefault. This is very similar to the long press case.
3667
3668         * page/ios/ContentChangeObserver.cpp:
3669         (WebCore::willNotProceedWithClick):
3670         (WebCore::ContentChangeObserver::didRecognizeLongPress):
3671         (WebCore::ContentChangeObserver::didPreventDefaultForEvent):
3672         * page/ios/ContentChangeObserver.h:
3673
3674 2019-03-13  Justin Fan  <justin_fan@apple.com>
3675
3676         [Web GPU] Updates to GPUCommandBuffer for new GPUCommandQueue concept
3677         https://bugs.webkit.org/show_bug.cgi?id=195083
3678         <rdar://problem/48423591>
3679
3680         Reviewed by Dean Jackson.
3681
3682         WebGPUCommandBuffer now represents a completed GPUCommandBuffer that can only be used in queue submits. The previous WebGPUCommandBuffer
3683         is now WebGPUCommandEncoder.
3684
3685         Affected Web GPU tests updated to match new API.
3686
3687         New files and symbols:
3688         * CMakeLists.txt:
3689         * DerivedSources.make:
3690         * Sources.txt:
3691         * WebCore.xcodeproj/project.pbxproj:
3692         * bindings/js/WebCoreBuiltinNames.h:
3693
3694         Implement new WebGPUCommandBuffer, now just a DOM object carrier for a finished GPUCommandBuffer:
3695         * Modules/webgpu/WebGPUCommandBuffer.cpp:
3696         (WebCore::WebGPUCommandBuffer::create):
3697         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
3698         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const): Deleted.
3699         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const): Deleted.
3700         (WebCore::WebGPUCommandBuffer::beginRenderPass): Deleted.
3701         (WebCore::WebGPUCommandBuffer::copyBufferToBuffer): Deleted.
3702         (WebCore::WebGPUCommandBuffer::copyBufferToTexture): Deleted.
3703         (WebCore::WebGPUCommandBuffer::copyTextureToBuffer): Deleted.
3704         (WebCore::WebGPUCommandBuffer::copyTextureToTexture): Deleted.
3705         * Modules/webgpu/WebGPUCommandBuffer.h:
3706         (WebCore::WebGPUCommandBuffer::commandBuffer):
3707         (WebCore::WebGPUCommandBuffer::commandBuffer const): Deleted.
3708         * Modules/webgpu/WebGPUCommandBuffer.idl:
3709
3710         Rename old WebGPUCommandBuffer to WebGPUCommandEncoder:
3711         * Modules/webgpu/WebGPUCommandEncoder.cpp: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.cpp.
3712         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const):
3713         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const):
3714         (WebCore::WebGPUCommandEncoder::create):
3715         (WebCore::WebGPUCommandEncoder::WebGPUCommandEncoder):
3716         (WebCore::WebGPUCommandEncoder::beginRenderPass):
3717         (WebCore::WebGPUCommandEncoder::copyBufferToBuffer):
3718         (WebCore::WebGPUCommandEncoder::copyBufferToTexture):
3719         (WebCore::WebGPUCommandEncoder::copyTextureToBuffer):
3720         (WebCore::WebGPUCommandEncoder::copyTextureToTexture):
3721         (WebCore::WebGPUCommandEncoder::finish): Added. "Completes" this and invalidates it. Returns its GPUCommandBuffer, ready for submission.
3722         * Modules/webgpu/WebGPUCommandEncoder.h: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.h.
3723         * Modules/webgpu/WebGPUCommandEncoder.idl: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.idl.
3724         * Modules/webgpu/WebGPUDevice.cpp:
3725         (WebCore::WebGPUDevice::createCommandEncoder const): Renamed fom createCommandBuffer. Now returns non-nullable.
3726         (WebCore::WebGPUDevice::createCommandBuffer const): Deleted.
3727         * Modules/webgpu/WebGPUDevice.h:
3728         * Modules/webgpu/WebGPUDevice.idl:
3729         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
3730         (WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder):
3731         (WebCore::WebGPUProgrammablePassEncoder::endPass): No longer returns the original WebGPUCommandBuffer.
3732         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
3733         (WebCore::WebGPUProgrammablePassEncoder::setPipeline):
3734         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
3735         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
3736         * Modules/webgpu/WebGPUQueue.cpp:
3737         (WebCore::WebGPUQueue::submit): Replace unnecessary rvalue reference parameter.
3738         * Modules/webgpu/WebGPUQueue.h:
3739         * Modules/webgpu/WebGPUQueue.idl:
3740         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
3741         (WebCore::WebGPURenderPassEncoder::create):
3742         (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
3743         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
3744         (WebCore::WebGPURenderPassEncoder::draw):
3745         (WebCore::WebGPURenderPassEncoder::passEncoder const): Now returns a pointer since it is properly backed by a RefPtr.
3746         * Modules/webgpu/WebGPURenderPassEncoder.h:
3747         * Modules/webgpu/WebGPUSwapChain.cpp:
3748         (WebCore::WebGPUSwapChain::getCurrentTexture): No longer invalidates m_currentTexture. Doh!
3749         * platform/graphics/gpu/GPUCommandBuffer.h: Missing includes for the *CopyView structs.
3750         * platform/graphics/gpu/GPUDevice.cpp:
3751         (WebCore::GPUDevice::tryCreateCommandBuffer const): Renamed from createCommandBuffer.
3752         (WebCore::GPUDevice::createCommandBuffer): Deleted.
3753         * platform/graphics/gpu/GPUDevice.h:
3754         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
3755         (WebCore::GPUCommandBuffer::tryCreate): Renamed from create.
3756         (WebCore::GPUCommandBuffer::create): Deleted.
3757
3758 2019-03-13  Zalan Bujtas  <zalan@apple.com>
3759
3760         [WeakPtr] RenderListMarker::m_listItem should be a WeakPtr
3761         https://bugs.webkit.org/show_bug.cgi?id=195704
3762         <rdar://problem/48486278>
3763
3764         Reviewed by Simon Fraser.
3765
3766         * rendering/RenderListMarker.cpp:
3767         (WebCore::RenderListMarker::RenderListMarker):
3768         (WebCore::RenderListMarker::paint):
3769         (WebCore::RenderListMarker::layout):
3770         (WebCore::RenderListMarker::updateContent):
3771         (WebCore::RenderListMarker::computePreferredLogicalWidths):
3772         (WebCore::RenderListMarker::lineHeight const):
3773         (WebCore::RenderListMarker::baselinePosition const):
3774         (WebCore::RenderListMarker::suffix const):
3775         (WebCore::RenderListMarker::isInside const):
3776         (WebCore::RenderListMarker::getRelativeMarkerRect):
3777         * rendering/RenderListMarker.h:
3778
3779 2019-03-13  Dean Jackson  <dino@apple.com>
3780
3781         Block all plugins smaller than 5x5px
3782         https://bugs.webkit.org/show_bug.cgi?id=195702
3783         <rdar://problem/28435204>
3784
3785         Reviewed by Sam Weinig.
3786
3787         Block all plugins that are smaller than a threshold, in this case
3788         5px x 5px. Other browsers have implemented this for a while, and now
3789         that we have Intersection Observers, small plugins are no longer
3790         necessary.
3791
3792         Test: plugins/small-plugin-blocked.html
3793
3794         * en.lproj/Localizable.strings: New message for a small plugin.
3795         * platform/LocalizedStrings.cpp:
3796         (WebCore::pluginTooSmallText):
3797         * platform/LocalizedStrings.h:
3798
3799         * html/HTMLPlugInElement.cpp: Helper function for Internals testing.
3800         (WebCore::HTMLPlugInElement::isBelowSizeThreshold const):
3801         * html/HTMLPlugInElement.h:
3802
3803         * loader/EmptyClients.cpp: Removed an unused function.
3804         (WebCore::EmptyFrameLoaderClient::recreatePlugin): Deleted.
3805         * loader/EmptyFrameLoaderClient.h:
3806         * loader/FrameLoaderClient.h:
3807
3808         * page/Settings.yaml: Add flag for new feature.
3809
3810         * rendering/RenderEmbeddedObject.cpp: New unavailability reason for
3811         embedded objects.
3812         (WebCore::unavailablePluginReplacementText):
3813         * rendering/RenderEmbeddedObject.h:
3814         (WebCore::RenderEmbeddedObject::pluginUnavailabilityReason const):
3815
3816         * testing/Internals.cpp: Helper function for testing.
3817         (WebCore::Internals::pluginIsBelowSizeThreshold):
3818         * testing/Internals.h:
3819         * testing/Internals.idl:
3820
3821 2019-03-13  Zalan Bujtas  <zalan@apple.com>
3822
3823         Use RenderBox::previousSiblingBox/nextSiblingBox in RenderMultiColumnFlow
3824         https://bugs.webkit.org/show_bug.cgi?id=195701
3825         <rdar://problem/48448658>
3826
3827         Reviewed by Simon Fraser.
3828
3829         It's safer to use existing RenderBox functions to get sibling boxes.
3830
3831         Test: fast/ruby/crash-when-paginated-ruby.html
3832
3833         * rendering/RenderMultiColumnFlow.cpp:
3834         (WebCore::RenderMultiColumnFlow::nextColumnSetOrSpannerSiblingOf):
3835         (WebCore::RenderMultiColumnFlow::previousColumnSetOrSpannerSiblingOf):
3836
3837 2019-03-13  Keith Rollin  <krollin@apple.com>
3838
3839         Add support for new StagedFrameworks layout
3840         https://bugs.webkit.org/show_bug.cgi?id=195543
3841
3842         Reviewed by Alexey Proskuryakov.
3843
3844         When creating the WebKit layout for out-of-band Safari/WebKit updates,
3845         use an optional path prefix when called for.
3846
3847         No new tests since there should be no observable behavior difference.
3848
3849         * Configurations/WebCore.xcconfig:
3850
3851 2019-03-13  Wenson Hsieh  <wenson_hsieh@apple.com>
3852
3853         Fix an edge case where HTMLFormElement::removeFormElement is invoked twice with the same element
3854         https://bugs.webkit.org/show_bug.cgi?id=195663
3855         <rdar://problem/48576391>
3856
3857         Reviewed by Ryosuke Niwa.
3858
3859         Currently, it's possible for HTMLFormControlElement's destructor to be reentrant. This may happen if the form
3860         control element is ref'd while carrying out its destructor's logic. This may happen in two places in
3861         HTMLFormControlElement (didChangeForm and resetDefaultButton), both of which actually don't require ensuring a
3862         protected reference to the form control element since they should never result in any script execution.
3863
3864         To fix the bug, convert these strong references into raw pointers, and add ScriptDisallowedScope to ensure that
3865         we don't change these codepaths in the future, such that they trigger arbitrary script execution.
3866
3867         Test: fast/forms/remove-associated-element-after-gc.html
3868
3869         * html/HTMLFormControlElement.cpp:
3870         (WebCore::HTMLFormControlElement::didChangeForm):
3871         * html/HTMLFormElement.cpp:
3872         (WebCore::HTMLFormElement::resetDefaultButton):
3873
3874 2019-03-13  Daniel Bates  <dabates@apple.com>
3875
3876         Remove some unnecessary !USE(UIKIT_KEYBOARD_ADDITIONS) guards
3877         https://bugs.webkit.org/show_bug.cgi?id=195703
3878
3879         Reviewed by Tim Horton.
3880
3881         Remove out-of-date comment and unncessary !USE(UIKIT_KEYBOARD_ADDITIONS) guards. Following
3882         r240604 we now make use of WebCore::windowsKeyCodeForCharCode() even for hardware key events
3883         when USE(UIKIT_KEYBOARD_ADDITIONS) is enabled.
3884
3885         No functionality changed. So, no new tests.
3886
3887         * platform/ios/KeyEventIOS.mm:
3888         (WebCore::windowsKeyCodeForCharCode):
3889         * platform/ios/WebEvent.mm:
3890         (normalizedStringWithAppKitCompatibilityMapping):
3891
3892 2019-03-13  Simon Fraser  <simon.fraser@apple.com>
3893
3894         Scrolling tree should reposition non-stacking order descendents of overflow:scroll
3895         https://bugs.webkit.org/show_bug.cgi?id=195608
3896
3897         Reviewed by Zalan Bujtas.
3898         
3899         Step 1: add scrolling tree positioning nodes classes (but don't create them yet).
3900
3901         Add Scrolling{State,Tree}PositionedNode to track composited layers that have to be repositioned when
3902         an async overflow:scroll scrolls. There are two instances in which this is necessary, reflected by
3903         the values of ScrollPositioningBehavior:
3904
3905         ScrollPositioningBehavior::Moves - a composited layer whose containing block chain includes an
3906             async overflow scroller, but whose composited (i.e. z-order) parent is outside of the overflow.
3907             When the overflow scrolls, this layer has to move along with the overflow.
3908
3909         ScrollPositioningBehavior::Stationary - a composited layer whose containing block chain skips the
3910             overflow scroller, but whose compositing (z-order) parent is the scroller, or inside the scroller.
3911             This only applies to position:absolute, on, for example, an overflow:scroll ith opacity.
3912
3913         PositionedNodes are modeled after Fixed/Sticky nodes, with a new type of layout constraint just called LayoutConstraints.
3914         
3915         This patch adds support for PositionedNodes in the scrolling trees, but RenderLayerCompositor::computeCoordinatedPositioningForLayer()
3916         is just a stub so the new node types aren't created yet.
3917         
3918         RenderLayerBacking stores a ScrollingNodeID for the positioning role (just like the other roles). Since the Positioning
3919         role is about position relative to ancestors, a node with both Positioning and FrameHosting or Scrolling roles treats
3920         the Positioning node as the parent of the other types. A node should never have both Positioning and ViewportConstrained roles.
3921
3922         Test: scrollingcoordinator/scrolling-tree/positioned-nodes.html
3923
3924         * Sources.txt:
3925         * SourcesCocoa.txt:
3926         * WebCore.xcodeproj/project.pbxproj:
3927         * page/scrolling/AsyncScrollingCoordinator.cpp:
3928         (WebCore::AsyncScrollingCoordinator::setPositionedNodeGeometry):
3929         (WebCore::AsyncScrollingCoordinator::setRelatedOverflowScrollingNodes):
3930         * page/scrolling/AsyncScrollingCoordinator.h:
3931         * page/scrolling/ScrollingConstraints.cpp:
3932         (WebCore::operator<<):
3933         * page/scrolling/ScrollingConstraints.h:
3934         (WebCore::LayoutConstraints::LayoutConstraints):
3935         (WebCore::LayoutConstraints::operator== const):
3936         (WebCore::LayoutConstraints::operator!= const):
3937         (WebCore::LayoutConstraints::alignmentOffset const):
3938         (WebCore::LayoutConstraints::setAlignmentOffset):
3939         (WebCore::LayoutConstraints::layerPositionAtLastLayout const):
3940         (WebCore::LayoutConstraints::setLayerPositionAtLastLayout):
3941         (WebCore::LayoutConstraints::scrollPositioningBehavior const):
3942         (WebCore::LayoutConstraints::setScrollPositioningBehavior):
3943         * page/scrolling/ScrollingCoordinator.cpp:
3944         (WebCore::operator<<):
3945         * page/scrolling/ScrollingCoordinator.h:
3946         (WebCore::ScrollingCoordinator::setPositionedNodeGeometry):
3947         (WebCore::ScrollingCoordinator::setRelatedOverflowScrollingNodes):
3948         * page/scrolling/ScrollingCoordinatorTypes.h:
3949         * page/scrolling/ScrollingStateNode.h:
3950         (WebCore::ScrollingStateNode::isPositionedNode const):
3951         * page/scrolling/ScrollingStatePositionedNode.cpp: Added.
3952         (WebCore::ScrollingStatePositionedNode::create):
3953         (WebCore::ScrollingStatePositionedNode::ScrollingStatePositionedNode):
3954         (WebCore::ScrollingStatePositionedNode::clone):
3955         (WebCore::ScrollingStatePositionedNode::setAllPropertiesChanged):
3956         (WebCore::ScrollingStatePositionedNode::setRelatedOverflowScrollingNodes):
3957         (WebCore::ScrollingStatePositionedNode::updateConstraints):
3958         (WebCore::ScrollingStatePositionedNode::dumpProperties const):
3959         * page/scrolling/ScrollingStatePositionedNode.h: Added.
3960         * page/scrolling/ScrollingStateTree.cpp:
3961         (WebCore::ScrollingStateTree::createNode):
3962         * page/scrolling/ScrollingTree.cpp:
3963         (WebCore::ScrollingTree::updateTreeFromStateNode):
3964         * page/scrolling/ScrollingTree.h:
3965         * page/scrolling/ScrollingTreeNode.h:
3966         (WebCore::ScrollingTreeNode::isPositionedNode const):
3967         * page/scrolling/cocoa/ScrollingTreePositionedNode.h: Copied from Source/WebCore/page/scrolling/cocoa/ScrollingTreeStickyNode.h.
3968         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm: Added.
3969         (WebCore::ScrollingTreePositionedNode::create):
3970         (WebCore::ScrollingTreePositionedNode::ScrollingTreePositionedNode):
3971         (WebCore::ScrollingTreePositionedNode::~ScrollingTreePositionedNode):
3972         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
3973         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
3974         (WebCore::ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange):
3975         (WebCore::ScrollingTreePositionedNode::dumpProperties const):
3976         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
3977         * page/scrolling/mac/ScrollingTreeMac.cpp:
3978         (ScrollingTreeMac::createScrollingTreeNode):
3979         * platform/ScrollTypes.h: