Running RTCRtpSender.getCapabilities("video") before initial offer breaks VP8
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-02-08  Youenn Fablet  <youenn@apple.com>
2
3         Running RTCRtpSender.getCapabilities("video") before initial offer breaks VP8
4         https://bugs.webkit.org/show_bug.cgi?id=194380
5         <rdar://problem/47916514>
6
7         Reviewed by Eric Carlson.
8
9         Set whether VP8 is supported at creation of the page.
10         This ensures that any call creating a peer connection factory will end up supporting the runtime flag configuration.
11
12         Add internal API to enable resetting the factory to enable proper testing.
13
14         Covered by updated test.
15
16         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
17         (WebCore::createLibWebRTCPeerConnectionBackend):
18         * page/Page.cpp:
19         (WebCore::m_applicationManifest):
20         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
21         * testing/Internals.cpp:
22         (WebCore::Internals::clearPeerConnectionFactory):
23         * testing/Internals.h:
24         * testing/Internals.idl:
25
26 2019-02-08  Andy Estes  <aestes@apple.com>
27
28         [WebIDL] Support serializing sequences and FrozenArrays of non-interfaces
29         https://bugs.webkit.org/show_bug.cgi?id=190997
30         <rdar://problem/35983035>
31
32         Reviewed by Brent Fulgham.
33
34         Support serializing sequences and FrozenArrays of types that aren't interfaces. This is
35         needed to properly serialize PaymentAddress, which has a FrozenArray of DOMStrings.
36
37         We should support serializing sequences of interfaces too, but that's slightly more
38         complicated since it involves iterating the sequence and serializing each of its items. I
39         left that as a follow-up task, since I don't see any IDLs that currently need this.
40
41         We also don't support serializing sequences with the CachedAttribute or CustomGetter
42         extended attributes, because WebIDL specifies that a new array should be created when
43         converting an IDL sequence into an ECMAScript value.
44
45         Added bindings test cases to TestSerialization.idl and PaymentAddress test cases to
46         http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html.
47
48         * bindings/scripts/CodeGenerator.pm:
49         (GetInterfaceForType): Renamed from GetInterfaceForAttribute.
50         (IsSerializableType): Modified to allow sequences and FrozenArrays of non-interface types.
51         (hasCachedAttributeOrCustomGetterExtendedAttribute): Added a helper to determine if an
52         attribute has the CachedAttribute or CustomGetter extended attributes.
53         (IsSerializableAttribute): Checked for sequences with the CachedAttribute or CustomGetter
54         extended attributes before calling IsSerializableType.
55         (GetInterfaceForAttribute): Renamed to GetInterfaceForType.
56         * bindings/scripts/test/JS/JSTestSerialization.cpp:
57         * bindings/scripts/test/TestSerialization.idl:
58
59 2019-02-08  Sihui Liu  <sihui_liu@apple.com>
60
61         IndexedDB tests leak documents
62         https://bugs.webkit.org/show_bug.cgi?id=189435
63         <rdar://problem/44240043>
64
65         Reviewed by Geoffrey Garen.
66
67         Remove use of JSC::Strong in IndexedDatabase.
68
69         * Modules/indexeddb/IDBCursor.cpp:
70         (WebCore::IDBCursor::update):
71         (WebCore::IDBCursor::continuePrimaryKey):
72         (WebCore::IDBCursor::continueFunction):
73         (WebCore::IDBCursor::deleteFunction):
74         (WebCore::IDBCursor::setGetResult):
75         * Modules/indexeddb/IDBCursor.h:
76         (WebCore::IDBCursor::key):
77         (WebCore::IDBCursor::primaryKey):
78         (WebCore::IDBCursor::value):
79         (WebCore::IDBCursor::keyWrapper):
80         (WebCore::IDBCursor::primaryKeyWrapper):
81         (WebCore::IDBCursor::valueWrapper):
82         (WebCore::IDBCursor::key const): Deleted.
83         (WebCore::IDBCursor::primaryKey const): Deleted.
84         (WebCore::IDBCursor::value const): Deleted.
85         * Modules/indexeddb/IDBCursor.idl:
86         * Modules/indexeddb/IDBCursorWithValue.idl:
87         * Modules/indexeddb/IDBObjectStore.cpp:
88         (WebCore::IDBObjectStore::putForCursorUpdate):
89         * Modules/indexeddb/IDBObjectStore.h:
90         * Modules/indexeddb/IDBRequest.cpp:
91         (WebCore::IDBRequest::IDBRequest):
92         (WebCore::IDBRequest::~IDBRequest):
93         (WebCore::IDBRequest::result const):
94         (WebCore::IDBRequest::setResult):
95         (WebCore::IDBRequest::setResultToStructuredClone):
96         (WebCore::IDBRequest::setResultToUndefined):
97         (WebCore::IDBRequest::resultCursor):
98         (WebCore::IDBRequest::willIterateCursor):
99         (WebCore::IDBRequest::didOpenOrIterateCursor):
100         * Modules/indexeddb/IDBRequest.h:
101         (WebCore::IDBRequest::resultWrapper):
102         * Modules/indexeddb/IDBRequest.idl:
103         * Sources.txt:
104         * WebCore.xcodeproj/project.pbxproj:
105         * bindings/js/JSIDBCursorCustom.cpp:
106         (WebCore::JSIDBCursor::key const):
107         (WebCore::JSIDBCursor::primaryKey const):
108         (WebCore::JSIDBCursor::visitAdditionalChildren):
109         * bindings/js/JSIDBCursorWithValueCustom.cpp:
110         (WebCore::JSIDBCursorWithValue::value const):
111         (WebCore::JSIDBCursorWithValue::visitAdditionalChildren):
112         * bindings/js/JSIDBRequestCustom.cpp: Added.
113         (WebCore::JSIDBRequest::result const):
114         (WebCore::JSIDBRequest::visitAdditionalChildren):
115         * inspector/agents/InspectorIndexedDBAgent.cpp:
116
117 2019-02-08  Zalan Bujtas  <zalan@apple.com>
118
119         [LFC] The used containing block width value is optional
120         https://bugs.webkit.org/show_bug.cgi?id=194428
121
122         Reviewed by Antti Koivisto.
123
124         The preferred width codepath cannot provide a valid used containing block width value.
125
126         "The percentage is calculated with respect to the width of the generated box's containing block.
127         If the containing block's width depends on this element's width, then the resulting layout is undefined in CSS 2.2."
128
129         Let's use 0 as used value for now.
130
131         * layout/FormattingContextGeometry.cpp:
132         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
133         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
134         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
135         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
136         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
137         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
138         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
139         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
140         * layout/LayoutUnits.h:
141         (WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
142         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
143         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
144         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
145         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
146         * page/FrameViewLayoutContext.cpp:
147
148 2019-02-08  Zalan Bujtas  <zalan@apple.com>
149
150         [LFC] Horizontal geometry compute functions should take the containing block's width as a used value
151         https://bugs.webkit.org/show_bug.cgi?id=194424
152
153         Reviewed by Antti Koivisto.
154
155         This is in preparation for passing optional containing block width for the preferred with codepath. 
156
157         * layout/FormattingContext.cpp:
158         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
159         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
160         * layout/FormattingContext.h:
161         * layout/FormattingContextGeometry.cpp:
162         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
163         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
164         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
165         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
166         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
167         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
168         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
169         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
170         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
171         * layout/LayoutUnits.h:
172         (WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
173         * layout/blockformatting/BlockFormattingContext.cpp:
174         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
175         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
176         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
177         * layout/inlineformatting/InlineFormattingContext.cpp:
178         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
179         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
180         * layout/inlineformatting/InlineFormattingContext.h:
181         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
182         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
183
184 2019-02-08  Benjamin Poulain  <benjamin@webkit.org>
185
186         clampTo(): do not convert the input to double when dealing with integers
187         https://bugs.webkit.org/show_bug.cgi?id=194263
188         <rdar://problem/47692312>
189
190         Reviewed by Darin Adler.
191
192         Make the calls to clampTo<float>() unambiguous.
193
194         * page/FrameView.cpp:
195         (WebCore::FrameView::computeUpdatedLayoutViewportRect):
196         * rendering/style/RenderStyle.h:
197         (WebCore::RenderStyle::setOpacity):
198         (WebCore::RenderStyle::setShapeImageThreshold):
199
200 2019-02-08  Eric Liang  <ericliang@apple.com>
201
202         When performing AXPress, check to see if the menu list is disabled.
203         https://bugs.webkit.org/show_bug.cgi?id=193878
204
205         Reviewed by Chris Fleizach.
206
207         Test: accessibility/mac/press-not-work-for-disabled-menu-list.html
208
209         * accessibility/AXObjectCache.h:
210         * accessibility/AccessibilityMenuList.cpp:
211         (WebCore::AccessibilityMenuList::press):
212         * accessibility/mac/AXObjectCacheMac.mm:
213         (WebCore::AXObjectCache::postPlatformNotification):
214
215 2019-02-07  Devin Rousso  <drousso@apple.com>
216
217         PseudoElement created for any ::before/::after selector regardless of whether a content property exists
218         https://bugs.webkit.org/show_bug.cgi?id=194423
219         <rdar://problem/46787260>
220
221         Reviewed by Antti Koivisto.
222
223         Test: inspector/css/pseudo-creation.html
224
225         * style/StyleTreeResolver.cpp:
226         (WebCore::Style::TreeResolver::resolvePseudoStyle):
227         We should only be creating `PseudoElement`s if we actually have a `content` proprety in the
228         `PseudoElement`'s style. Otherwise, we end up creating `PseudoElement`s for every CSS rule
229         that has a `::before`/`::after`, only to immediately destroy them as there is nothing to show.
230
231 2019-02-07  Chris Dumez  <cdumez@apple.com>
232
233         Mark more heap-allocated classes as fast allocated
234         https://bugs.webkit.org/show_bug.cgi?id=194422
235
236         Reviewed by Ryosuke Niwa.
237
238         * Modules/applepay/PaymentCoordinator.h:
239         * Modules/beacon/NavigatorBeacon.h:
240         * Modules/cache/DOMWindowCaches.h:
241         * Modules/cache/WorkerGlobalScopeCaches.h:
242         * Modules/credentialmanagement/NavigatorCredentials.h:
243         * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
244         * Modules/gamepad/NavigatorGamepad.h:
245         * Modules/indexeddb/IDBGetAllResult.h:
246         * Modules/indexeddb/IDBGetResult.h:
247         * Modules/indexeddb/IDBKeyData.h:
248         * Modules/indexeddb/IDBValue.h:
249         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
250         * Modules/indexeddb/server/IndexValueEntry.h:
251         * Modules/indexeddb/server/IndexValueStore.h:
252         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
253         * Modules/indexeddb/server/MemoryCursor.h:
254         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
255         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
256         * Modules/indexeddb/server/SQLiteIDBCursor.h:
257         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
258         * Modules/indexeddb/server/UniqueIDBDatabase.h:
259         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
260         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
261         * Modules/indexeddb/shared/IDBTransactionInfo.h:
262         * Modules/mediacapabilities/NavigatorMediaCapabilities.h:
263         * Modules/mediasession/WebMediaSessionManager.cpp:
264         * Modules/mediastream/NavigatorMediaDevices.h:
265         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
266         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h:
267         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
268         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h:
269         * Modules/navigatorcontentutils/NavigatorContentUtils.h:
270         * Modules/quota/DOMWindowQuota.h:
271         * Modules/quota/NavigatorStorageQuota.h:
272         * Modules/quota/WorkerNavigatorStorageQuota.h:
273         * Modules/speech/DOMWindowSpeechSynthesis.h:
274         * Modules/webaudio/BiquadProcessor.h:
275         * Modules/webaudio/DelayProcessor.h:
276         * Modules/webauthn/fido/FidoHidPacket.h:
277         * Modules/webdriver/NavigatorWebDriver.h:
278         * Modules/webgpu/DOMWindowWebGPU.h:
279         * Modules/websockets/WebSocketChannel.h:
280         * Modules/webvr/NavigatorWebVR.h:
281         * accessibility/AXObjectCache.h:
282         * bindings/js/DOMGCOutputConstraint.h:
283         * bindings/js/DOMPromiseProxy.h:
284         * bridge/c/c_runtime.h:
285         * contentextensions/CombinedURLFilters.cpp:
286         * crypto/CryptoAlgorithmParameters.h:
287         * css/CSSComputedStyleDeclaration.h:
288         * css/CSSRegisteredCustomProperty.h:
289         * css/DOMCSSPaintWorklet.h:
290         * css/DOMCSSRegisterCustomProperty.h:
291         * css/StyleRule.h:
292         * dom/ConstantPropertyMap.h:
293         * dom/CustomElementReactionQueue.h:
294         * dom/Document.h:
295         * dom/GenericEventQueue.h:
296         * dom/RejectedPromiseTracker.h:
297         * dom/UserGestureIndicator.h:
298         * editing/ReplaceSelectionCommand.cpp:
299         * editing/SelectionRectGatherer.h:
300         * editing/TextIterator.h:
301         * editing/cocoa/HTMLConverter.mm:
302         * fileapi/AsyncFileStream.cpp:
303         * fileapi/AsyncFileStream.h:
304         * html/forms/FileIconLoader.h:
305         * html/parser/HTMLTreeBuilder.h:
306         * html/track/WebVTTParser.h:
307         * inspector/DOMPatchSupport.cpp:
308         * loader/FrameLoaderClient.h:
309         * loader/WorkerThreadableLoader.cpp:
310         * page/IntersectionObserver.h:
311         * page/PerformanceMonitor.h:
312         * page/PerformanceUserTiming.h:
313         * page/PrintContext.h:
314         * page/ValidationMessageClient.h:
315         * platform/ColorChooser.h:
316         * platform/ControlStates.h:
317         * platform/DataListSuggestionPicker.h:
318         * platform/FileStream.h:
319         * platform/KeyedCoding.h:
320         * platform/LowPowerModeNotifier.h:
321         * platform/PlatformSpeechSynthesizer.h:
322         * platform/WebGLStateTracker.h:
323         * platform/audio/AudioArray.h:
324         * platform/audio/AudioDestination.h:
325         * platform/audio/DownSampler.h:
326         * platform/audio/DynamicsCompressor.h:
327         * platform/audio/FFTFrame.h:
328         * platform/audio/HRTFDatabase.h:
329         * platform/audio/MultiChannelResampler.h:
330         * platform/audio/Panner.h:
331         * platform/audio/Reverb.h:
332         * platform/audio/ReverbConvolver.h:
333         * platform/audio/ReverbConvolverStage.h:
334         * platform/audio/UpSampler.h:
335         * platform/audio/mac/AudioSessionMac.cpp:
336         * platform/audio/mac/CAAudioStreamDescription.h:
337         * platform/audio/mac/CARingBuffer.h:
338         * platform/cocoa/ScrollSnapAnimatorState.h:
339         * platform/gamepad/PlatformGamepad.h:
340         * platform/graphics/GraphicsLayer.cpp:
341         * platform/graphics/GraphicsLayerFactory.h:
342         * platform/graphics/PlatformTimeRanges.h:
343         * platform/graphics/TextTrackRepresentation.h:
344         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
345         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
346         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
347         * platform/graphics/displaylists/DisplayListRecorder.h:
348         * platform/network/cocoa/WebCoreNSURLSession.mm:
349         * platform/sql/SQLiteDatabase.h:
350         * platform/text/TextCodecICU.h:
351         * rendering/GridBaselineAlignment.h:
352         * rendering/GridTrackSizingAlgorithm.h:
353         * rendering/RenderObject.h:
354         * rendering/style/GridArea.h:
355         * workers/service/context/SWContextManager.h:
356
357 2019-02-07  Justin Fan  <justin_fan@apple.com>
358
359         [Web GPU] GPUDevice::createTexture implementation prototype
360         https://bugs.webkit.org/show_bug.cgi?id=194409
361         <rdar://problem/47894312>
362
363         Reviewed by Myles C. Maxfield.
364
365         Test: textures-textureviews.html updated to test new functionality.
366
367         Implement GPUDevice::createTexture():
368         * Modules/webgpu/WebGPUDevice.cpp:
369         (WebCore::WebGPUDevice::createTexture const):
370         * Modules/webgpu/WebGPUDevice.h:
371         * Modules/webgpu/WebGPUDevice.idl:
372         * Modules/webgpu/WebGPUTexture.cpp:
373         (WebCore::WebGPUTexture::create): Modified to return non-nullable to match direction of API.
374         (WebCore::WebGPUTexture::WebGPUTexture):
375         * Modules/webgpu/WebGPUTexture.h:
376
377         Metal backend MTLTextureDescriptor and MTLTexture creation:
378         * platform/graphics/gpu/GPUDevice.cpp:
379         (WebCore::GPUDevice::tryCreateTexture const):
380         * platform/graphics/gpu/GPUDevice.h:
381         * platform/graphics/gpu/GPUTexture.h:
382         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
383         (WebCore::mtlTextureTypeForGPUTextureDescriptor):
384         (WebCore::mtlTextureUsageForGPUTextureUsageFlags):
385         (WebCore::storageModeForPixelFormatAndSampleCount):
386         (WebCore::tryCreateMtlTextureDescriptor):
387         (WebCore::GPUTexture::tryCreate):
388         (WebCore::GPUTexture::createDefaultTextureView): Add ObjC try/catch guards.
389
390         Add GPUUtils.h/cpp for shared utility functions:
391         * SourcesCocoa.txt:
392         * WebCore.xcodeproj/project.pbxproj:
393         * platform/graphics/gpu/GPUUtils.h: Added. Moved platformTextureFormatForGPUTextureFormat here.
394         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
395         (WebCore::GPUSwapChain::setFormat):
396         (WebCore::platformTextureFormatForGPUTextureFormat): Moved to GPUUtils.
397         * platform/graphics/gpu/cocoa/GPUUtilsMetal.mm: Added.
398         (WebCore::platformTextureFormatForGPUTextureFormat): Moved here to be referenced by multiple files.
399
400 2019-02-07  Sihui Liu  <sihui_liu@apple.com>
401
402         REGRESSION(r239887): Crash under IDBConnectionToClient::didDeleteDatabase(WebCore::IDBResultData const&)
403         https://bugs.webkit.org/show_bug.cgi?id=194402
404         <rdar://problem/47858241>
405
406         Reviewed by Geoffrey Garen.
407
408         r239887 removed a reference cycle of IDBConnectionToClient so that IDBConnectionToClient would no longer be
409         around forever. Therefore, ServerOpenRequest should keep a reference to IDBConnectionToClient to make sure it
410         is valid during access.
411
412         * Modules/indexeddb/server/ServerOpenDBRequest.cpp:
413         (WebCore::IDBServer::ServerOpenDBRequest::maybeNotifyRequestBlocked):
414         (WebCore::IDBServer::ServerOpenDBRequest::notifyDidDeleteDatabase):
415         * Modules/indexeddb/server/ServerOpenDBRequest.h:
416
417 2019-02-07  Timothy Hatcher  <timothy@apple.com>
418
419         Overflow element scrollbar is light for dark mode content.
420         https://bugs.webkit.org/show_bug.cgi?id=194407
421         rdar://problem/45991585
422
423         Reviewed by Beth Dakin.
424
425         Tested by css-dark-mode/supported-color-schemes-scrollbar.html.
426
427         * page/ChromeClient.h:
428         (WebCore::FrameView::preferredScrollbarOverlayStyle): Return WTF::nullopt by default to avoid
429         short-circuiting auto detection in recalculateScrollbarOverlayStyle() for clients, like WK1,
430         that do not implement preferredScrollbarOverlayStyle().
431         * page/FrameView.cpp:
432         (WebCore::FrameView::recalculateScrollbarOverlayStyle): Use WTF::nullopt in the false case
433         to auto detect overlay style when page() is null.
434         * rendering/RenderLayer.cpp:
435         (WebCore::RenderLayer::useDarkAppearance const): Added.
436         * rendering/RenderLayer.h:
437         * testing/Internals.cpp:
438         (WebCore::Internals::scrollbarOverlayStyle const): Added Node argument.
439         (WebCore::Internals::scrollbarUsingDarkAppearance const): Added.
440         * testing/Internals.h:
441         * testing/Internals.idl:
442
443 2019-02-07  Eric Carlson  <eric.carlson@apple.com>
444
445         [MSE] Convert debug-only logging to runtime logging
446         https://bugs.webkit.org/show_bug.cgi?id=194348
447         <rdar://problem/47566449>
448
449         Reviewed by Jer Noble.
450
451         No new tests, this just changes existing logging.
452
453         * Modules/mediasource/MediaSource.cpp:
454         (WebCore::convertEnumerationToString):
455         (WebCore::MediaSource::MediaSource):
456         (WebCore::MediaSource::~MediaSource):
457         (WebCore::MediaSource::setPrivateAndOpen):
458         (WebCore::MediaSource::addedToRegistry):
459         (WebCore::MediaSource::removedFromRegistry):
460         (WebCore::MediaSource::durationChanged):
461         (WebCore::MediaSource::seekToTime):
462         (WebCore::MediaSource::completeSeek):
463         (WebCore::MediaSource::setLiveSeekableRange):
464         (WebCore::MediaSource::clearLiveSeekableRange):
465         (WebCore::MediaSource::setDuration):
466         (WebCore::MediaSource::setDurationInternal):
467         (WebCore::MediaSource::setReadyState):
468         (WebCore::MediaSource::endOfStream):
469         (WebCore::MediaSource::streamEndedWithError):
470         (WebCore::MediaSource::addSourceBuffer):
471         (WebCore::MediaSource::removeSourceBuffer):
472         (WebCore::MediaSource::isTypeSupported):
473         (WebCore::MediaSource::detachFromElement):
474         (WebCore::MediaSource::attachToElement):
475         (WebCore::MediaSource::openIfInEndedState):
476         (WebCore::MediaSource::suspend):
477         (WebCore::MediaSource::resume):
478         (WebCore::MediaSource::stop):
479         (WebCore::MediaSource::onReadyStateChange):
480         (WebCore::MediaSource::scheduleEvent):
481         (WebCore::MediaSource::logChannel const):
482         (WebCore::MediaSourceInternal::toString): Deleted.
483         * Modules/mediasource/MediaSource.h:
484         (WTF::LogArgument<WebCore::MediaSource::EndOfStreamError>::toString):
485         (WTF::LogArgument<WebCore::MediaSource::ReadyState>::toString):
486         * Modules/mediasource/SourceBuffer.cpp:
487         (WebCore::SourceBuffer::SourceBuffer):
488         (WebCore::SourceBuffer::~SourceBuffer):
489         (WebCore::SourceBuffer::remove):
490         (WebCore::SourceBuffer::seekToTime):
491         (WebCore::SourceBuffer::appendBufferInternal):
492         (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
493         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError):
494         (WebCore::removeSamplesFromTrackBuffer):
495         (WebCore::SourceBuffer::removeCodedFrames):
496         (WebCore::SourceBuffer::evictCodedFrames):
497         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
498         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
499         (WebCore::SourceBuffer::sourceBufferPrivateReenqueSamples):
500         (WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples):
501         (WebCore::SourceBuffer::provideMediaData):
502         (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
503         (WebCore::SourceBuffer::monitorBufferingRate):
504         (WebCore::SourceBuffer::logChannel const):
505         * Modules/mediasource/SourceBuffer.h:
506         * dom/Document.cpp:
507         (WebCore::messageSourceForWTFLogChannel):
508         (WebCore::Document::didLogMessage):
509         * html/HTMLMediaElement.cpp:
510         (WebCore::convertEnumerationToString):
511         (WebCore::HTMLMediaElement::scheduleCheckPlaybackTargetCompatability):
512         (WebCore::HTMLMediaElement::selectMediaResource):
513         (WebCore::HTMLMediaElement::loadResource):
514         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
515         (WebCore::HTMLMediaElement::scheduleConfigureTextTracks):
516         (WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated):
517         (WebCore::HTMLMediaElement::scheduleUpdatePlayState):
518         (WebCore::HTMLMediaElement::scheduleUpdateMediaState):
519         * platform/ContentType.cpp:
520         (WebCore::ContentType::toJSONString const):
521         * platform/ContentType.h:
522         (WTF::LogArgument<WebCore::ContentType>::toString):
523         * platform/MediaSample.h:
524         (WebCore::MediaSample::toJSONString const):
525         (WTF::LogArgument<WebCore::MediaSample>::toString):
526         * platform/graphics/FloatSize.cpp:
527         (WebCore::FloatSize::toJSONObject const):
528         (WebCore::FloatSize::toJSONString const):
529         * platform/graphics/FloatSize.h:
530         (WTF::LogArgument<WebCore::FloatSize>::toString):
531         * platform/graphics/MediaSourcePrivate.h:
532         (WebCore::MediaSourcePrivate::mediaSourceLogIdentifier):
533         (WTF::LogArgument<WebCore::MediaSourcePrivate::AddStatus>::toString):
534         (WTF::LogArgument<WebCore::MediaSourcePrivate::EndOfStreamStatus>::toString):
535         * platform/graphics/SourceBufferPrivate.h:
536         (WebCore::SourceBufferPrivate::sourceBufferLogger const):
537         (WebCore::SourceBufferPrivate::sourceBufferLogIdentifier):
538         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
539         (WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted):
540         (WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible):
541         (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const):
542         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled const):
543         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled):
544         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
545         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData):
546         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
547         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogIdentifier):
548         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogger):
549         (WTF::LogArgument<WebCore::MediaPlayerPrivateMediaSourceAVFObjC::SeekState>::toString):
550         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
551         (WebCore::convertEnumerationToString):
552         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
553         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC):
554         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load):
555         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play):
556         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal):
557         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause):
558         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal):
559         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
560         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
561         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVisible):
562         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
563         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
564         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitForSeekCompleted):
565         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekCompleted):
566         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
567         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame):
568         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateAllRenderersHaveAvailableSamples):
569         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged):
570         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize):
571         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
572         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
573         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached):
574         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached):
575         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
576         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKeyChanged):
577         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered):
578         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState):
579         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNetworkState):
580         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget):
581         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless const):
582         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::logChannel const):
583         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
584         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
585         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
586         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
587         (WebCore::MediaSampleAVFObjC::toJSONString const):
588         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
589         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
590         (WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC):
591         (WebCore::MediaSourcePrivateAVFObjC::~MediaSourcePrivateAVFObjC):
592         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
593         (WebCore::MediaSourcePrivateAVFObjC::logChannel const):
594         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
595         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
596         (WebCore::bufferWasConsumedCallback):
597         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
598         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
599         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
600         (WebCore::SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError):
601         (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
602         (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
603         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
604         (WebCore::SourceBufferPrivateAVFObjC::append):
605         (WebCore::SourceBufferPrivateAVFObjC::abort):
606         (WebCore::SourceBufferPrivateAVFObjC::resetParserState):
607         (WebCore::SourceBufferPrivateAVFObjC::removedFromMediaSource):
608         (WebCore::SourceBufferPrivateAVFObjC::setReadyState):
609         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
610         (WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
611         (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
612         (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
613         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
614         (WebCore::SourceBufferPrivateAVFObjC::flush):
615         (WebCore::SourceBufferPrivateAVFObjC::flushVideo):
616         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
617         (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed):
618         (WebCore::SourceBufferPrivateAVFObjC::setActive):
619         (WebCore::SourceBufferPrivateAVFObjC::willSeek):
620         (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):
621         (WebCore::SourceBufferPrivateAVFObjC::canSwitchToType):
622         (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession):
623         (WebCore::SourceBufferPrivateAVFObjC::logChannel const):
624
625 2019-02-07  Youenn Fablet  <youenn@apple.com>
626
627         Simplify applyConstraints callbacks
628         https://bugs.webkit.org/show_bug.cgi?id=194297
629
630         Reviewed by Eric Carlson.
631
632         Make use of one callback for both success and failure cases.
633         No changed of behavior.
634
635         * Modules/mediastream/MediaStreamTrack.cpp:
636         (WebCore::MediaStreamTrack::applyConstraints):
637         * platform/mediastream/MediaStreamTrackPrivate.cpp:
638         (WebCore::MediaStreamTrackPrivate::applyConstraints):
639         * platform/mediastream/MediaStreamTrackPrivate.h:
640         * platform/mediastream/RealtimeMediaSource.cpp:
641         (WebCore::RealtimeMediaSource::applyConstraints):
642         * platform/mediastream/RealtimeMediaSource.h:
643         * platform/mediastream/mac/AVVideoCaptureSource.mm:
644         (WebCore::AVVideoCaptureSource::create):
645         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
646         (WebCore::CoreAudioCaptureSource::create):
647         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
648         (WebCore::MockGStreamerAudioCaptureSource::applyConstraints):
649         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
650         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
651         (WebCore::MockGStreamerVideoCaptureSource::applyConstraints):
652         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
653
654 2019-02-07  Youenn Fablet  <youenn@apple.com>
655
656         Unable to sign in leetcode.
657         https://bugs.webkit.org/show_bug.cgi?id=194366
658         rdar://problem/47259025.
659
660         Reviewed by Chris Dumez.
661
662         In case a signal is passed as part of a FetchRequestInit,
663         the IDL binding code is throwing an exception in case signal is not an AbortSignal object.
664         This breaks an AbortSignal shim used in some web sites.
665         Relaxed the IDL binding rule by marking signal as any and doing the conversion in FetchRequest.
666
667         Test: http/wpt/fetch/request-abort.html
668         Also covered by manually signing in to leetcode.
669
670         * Modules/fetch/FetchRequest.cpp:
671         (WebCore::FetchRequest::initializeWith):
672         * Modules/fetch/FetchRequestInit.h:
673         (WebCore::FetchRequestInit::hasMembers const):
674         * Modules/fetch/FetchRequestInit.idl:
675
676 2019-02-07  Youenn Fablet  <youenn@apple.com>
677
678         Make to clear sources from UserMediaCaptureManagerProxy and UserMediaCaptureManager when no longer needed
679         https://bugs.webkit.org/show_bug.cgi?id=194312
680
681         Reviewed by Eric Carlson.
682
683         Add a way for sources to know when they are ended, i.e. that they will never be started again.
684         No observable change of behavior.
685
686         * platform/mediastream/RealtimeMediaSource.cpp:
687         (WebCore::RealtimeMediaSource::requestStop):
688         * platform/mediastream/RealtimeMediaSource.h:
689
690 2019-02-07  Jer Noble  <jer.noble@apple.com>
691
692         HTMLMediaElement registers wrong ScriptExecutionContext with its ActiveDOMObject parent class
693         https://bugs.webkit.org/show_bug.cgi?id=194360
694
695         HTMLMediaElement registers the Document used to create it with ActiveDOMObject, when it should
696         really use that Document's contextDocument(). Rather than just fix this in HTMLMediaElement,
697         make sure that the correct document is used everywhere by adding a new ActiveDOMObject constructor
698         taking a Document&, and making an explicitly deleted Document* constructor to catch any new cases.
699
700         Reviewed by Geoffrey Garen.
701
702         * Modules/applepay/ApplePaySession.cpp:
703         (WebCore::ApplePaySession::ApplePaySession):
704         * Modules/mediarecorder/MediaRecorder.cpp:
705         (WebCore::MediaRecorder::MediaRecorder):
706         * Modules/mediastream/MediaDevices.cpp:
707         (WebCore::MediaDevices::MediaDevices):
708         * Modules/mediastream/UserMediaRequest.cpp:
709         (WebCore::UserMediaRequest::UserMediaRequest):
710         * Modules/notifications/Notification.cpp:
711         (WebCore::Notification::Notification):
712         * Modules/paymentrequest/PaymentRequest.cpp:
713         (WebCore::PaymentRequest::PaymentRequest):
714         * Modules/webaudio/AudioContext.cpp:
715         (WebCore::AudioContext::AudioContext):
716         * animation/WebAnimation.cpp:
717         (WebCore::WebAnimation::WebAnimation):
718         * css/FontFaceSet.cpp:
719         (WebCore::FontFaceSet::FontFaceSet):
720         * dom/ActiveDOMObject.cpp:
721         (WebCore::ActiveDOMObject::ActiveDOMObject):
722         * dom/ActiveDOMObject.h:
723         * dom/Document.h:
724         (WebCore::ActiveDOMObject::ActiveDOMObject):
725         * html/HTMLMarqueeElement.cpp:
726         (WebCore::HTMLMarqueeElement::HTMLMarqueeElement):
727         * html/HTMLMediaElement.cpp:
728         (WebCore::HTMLMediaElement::HTMLMediaElement):
729         * html/HTMLSourceElement.cpp:
730         (WebCore::HTMLSourceElement::HTMLSourceElement):
731         * page/IntersectionObserver.cpp:
732         (WebCore::IntersectionObserver::IntersectionObserver):
733
734 2019-02-07  Zalan Bujtas  <zalan@apple.com>
735
736         [LFC][Out-of-flow] Use the containing block's padding width when computing min/max width.
737         https://bugs.webkit.org/show_bug.cgi?id=194391
738
739         Reviewed by Antti Koivisto.
740
741         The spec is not clear about this but that's what matches the current behaviour.
742
743         Test: fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding.html
744
745         * layout/FormattingContext.cpp:
746         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
747
748 2019-02-07  Zalan Bujtas  <zalan@apple.com>
749
750         [LFC] Use dedicated data structures for optional used values (input to geometry functions)
751         https://bugs.webkit.org/show_bug.cgi?id=194376
752
753         Reviewed by Antti Koivisto.
754
755         This is in preparation for being able to pass in the containing block's width as an optional used value.
756         During layout we always have a valid width for the containing block, however it's not the case while computing the preferred width.
757
758         * layout/FormattingContext.cpp:
759         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
760         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
761         * layout/FormattingContext.h:
762         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry): Deleted.
763         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry): Deleted.
764         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin): Deleted.
765         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin): Deleted.
766         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): Deleted.
767         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): Deleted.
768         (): Deleted.
769         (WebCore::Layout::FormattingContext::Geometry::complicatedCases): Deleted.
770         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): Deleted.
771         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): Deleted.
772         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): Deleted.
773         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): Deleted.
774         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin): Deleted.
775         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): Deleted.
776         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): Deleted.
777         * layout/FormattingContextGeometry.cpp:
778         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
779         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
780         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
781         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
782         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
783         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
784         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
785         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
786         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
787         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
788         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
789         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
790         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
791         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
792         * layout/LayoutUnits.h:
793         * layout/blockformatting/BlockFormattingContext.cpp:
794         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
795         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
796         * layout/blockformatting/BlockFormattingContext.h:
797         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): Deleted.
798         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): Deleted.
799         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): Deleted.
800         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): Deleted.
801         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): Deleted.
802         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
803         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
804         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
805         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
806         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
807         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
808         * layout/inlineformatting/InlineFormattingContext.cpp:
809         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
810         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
811         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
812         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
813         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
814         * page/FrameViewLayoutContext.cpp:
815         (WebCore::layoutUsingFormattingContext):
816
817 2019-02-07  Antti Koivisto  <antti@apple.com>
818
819         Infinite recursion via CachedResource::~CachedResource
820         https://bugs.webkit.org/show_bug.cgi?id=194378
821         <rdar://problem/42023295>
822
823         Reviewed by Daniel Bates.
824
825         I don't know the exact steps to trigger this but the mechanism seems clear.
826
827         1) An existing resource is removed from or replaced in CachedResourceLoader::m_documentResources map.
828         2) This decrements the handle count of resource and causes it be deleted.
829         3) CachedResource::~CachedResource calls m_owningCachedResourceLoader->removeCachedResource(*this). This only happens with
830            resources that are "owned" by CachedResourceLoader which is a rare special case (used by image document and if memory cache is disabled).
831         4) CachedResourceLoader::removeCachedResource looks up the resource from the map which causes a temporary CachedResourceHandle to be created.
832            This increments the handle count of the resource from 0 back to 1.
833         5) When the temporary dies, CachedResource::~CachedResource is called again and we cycle back to 3).
834
835         The fix here is simply to remove CachedResourceLoader::removeCachedResource call from ~CachedResource.
836         It is a leftover from when the map contained raw pointers instead of owning CachedResourceHandles.
837
838         Since m_documentResources map has a handle to the resource, the only way we are in the destructor is that the resource
839         has been removed from the map already (or is in process of being removed like in this crash). Any call that does anything
840         other than bail out is going to crash.
841
842         CachedResource::n_owningCachedResourceLoader member and CachedResourceLoader::removeCachedResource function only exist to
843         support this erranous call so they are removed as well.
844
845         * loader/ImageLoader.cpp:
846         (WebCore::ImageLoader::updateFromElement):
847         * loader/cache/CachedResource.cpp:
848         (WebCore::CachedResource::~CachedResource):
849
850         This is the substantive change. The rest just removes now-dead code.
851
852         * loader/cache/CachedResource.h:
853         (WebCore::CachedResource::setOwningCachedResourceLoader): Deleted.
854         * loader/cache/CachedResourceLoader.cpp:
855         (WebCore::CachedResourceLoader::~CachedResourceLoader):
856         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
857         (WebCore::CachedResourceLoader::requestResource):
858         (WebCore::CachedResourceLoader::loadResource):
859         (WebCore::CachedResourceLoader::garbageCollectDocumentResources):
860         (WebCore::CachedResourceLoader::removeCachedResource): Deleted.
861         * loader/cache/CachedResourceLoader.h:
862
863 2019-02-07  Miguel Gomez  <magomez@igalia.com>
864
865         [WPE] Implement GStreamer based holepunch
866         https://bugs.webkit.org/show_bug.cgi?id=193715
867
868         Reviewed by Xabier Rodriguez-Calvar.
869
870         Implement GStreamer based holepunch functionality. Instead of getting the video frames from the
871         video sink and drawing then, the player just draws a transparent rectangle on the position where
872         the video should be. MediaPlayerPrivateGStreamerBase will instantiate a platform dependant video
873         sink which will be in charge of displaying the video frames in some way (usually on a plane below
874         the browser), and will push empty frames to the compositor indicating that the rectangle to draw
875         should overwrite the existent content. TextureMapperPlatformLayerBuffer::HolePunchClient is used
876         to tell the video sink where to position the video so it's set below the browser transparent hole.
877
878         Added ManualTest wpe/video-player-holepunch.html to test the feature.
879
880         * platform/graphics/MediaPlayer.cpp:
881         (WebCore::MediaPlayer::shouldIgnoreIntrinsicSize):
882         * platform/graphics/MediaPlayer.h:
883         * platform/graphics/MediaPlayerPrivate.h:
884         (WebCore::MediaPlayerPrivateInterface::shouldIgnoreIntrinsicSize):
885         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
886         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
887         (WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded):
888         (WebCore::setRectangleToVideoSink):
889         (WebCore::GStreamerHolePunchClient::GStreamerHolePunchClient):
890         (WebCore::MediaPlayerPrivateGStreamerBase::createHolePunchVideoSink):
891         (WebCore::MediaPlayerPrivateGStreamerBase::pushNextHolePunchBuffer):
892         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
893         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
894         * platform/graphics/texmap/TextureMapper.h:
895         * platform/graphics/texmap/TextureMapperGL.cpp:
896         (WebCore::TextureMapperGL::drawSolidColor):
897         * platform/graphics/texmap/TextureMapperGL.h:
898         * platform/graphics/texmap/TextureMapperLayer.cpp:
899         (WebCore::TextureMapperLayer::paintSelf):
900         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
901         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
902         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
903         (WebCore::TextureMapperPlatformLayerBuffer::setHolePunchClient):
904         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
905         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
906         * rendering/RenderVideo.cpp:
907         (WebCore::RenderVideo::videoBox const):
908
909 2019-02-06  Benjamin Poulain  <benjamin@webkit.org>
910
911         Unreviewed, rolling out r240759 and r240944.
912
913         Some timer uses are done off the main thread, WebCore::Timer
914         cannot be used
915
916         Reverted changesets:
917
918         "<rdar://problem/47570443> Responsiveness timers are too
919         expensive for frequent events"
920         https://bugs.webkit.org/show_bug.cgi?id=194003
921         https://trac.webkit.org/changeset/240759
922
923         "Use deferrable timer to restart the Responsiveness Timer on
924         each wheel event"
925         https://bugs.webkit.org/show_bug.cgi?id=194135
926         https://trac.webkit.org/changeset/240944
927
928 2019-02-06  Keith Rollin  <krollin@apple.com>
929
930         Update .xcfilelist files
931
932         Unreviewed build fix.
933
934         * DerivedSources-input.xcfilelist:
935         * DerivedSources-output.xcfilelist:
936
937 2019-02-06  Devin Rousso  <drousso@apple.com>
938
939         Web Inspector: DOM: don't send the entire function string with each event listener
940         https://bugs.webkit.org/show_bug.cgi?id=194293
941         <rdar://problem/47822809>
942
943         Reviewed by Joseph Pecoraro.
944
945         Test: inspector/dom/getEventListenersForNode.html
946
947         * inspector/agents/InspectorDOMAgent.cpp:
948         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
949
950 2019-02-06  Andy Estes  <aestes@apple.com>
951
952         [Payment Request] It should be possible to require a phonetic name for shipping contacts
953         https://bugs.webkit.org/show_bug.cgi?id=194311
954         <rdar://46733045>
955
956         Reviewed by Alex Christensen.
957
958         It should be possible to require that a shipping contact has a phonetic name in Payment Request.
959         To accomplish this, move requiredShippingContactFields from ApplePayPaymentRequest to
960         ApplePayRequestBase so that it can be used as part of an Apple Pay payment method data.
961
962         Since required shipping contact fields can now be specified both in
963         requiredShippingContactFields and PaymentOptions, we merge the required fields from these
964         two sources such that, e.g., email is required if it is specified in either place.
965
966         So that clients can detect this new feature, the API version number is bumped from 5 to 6.
967
968         Added test cases to ApplePayRequestShippingContact.https.html and ApplePayRequestShippingContactV3.https.html.
969
970         * DerivedSources.make:
971         * Modules/applepay/ApplePayPaymentRequest.h:
972         * Modules/applepay/ApplePayPaymentRequest.idl:
973         * Modules/applepay/ApplePayRequestBase.cpp:
974         (WebCore::convertAndValidate):
975         * Modules/applepay/ApplePayRequestBase.h:
976         * Modules/applepay/ApplePayRequestBase.idl:
977         * Modules/applepay/ApplePaySession.cpp:
978         (WebCore::convertAndValidate):
979         * Modules/applepay/PaymentCoordinatorClient.cpp: Added.
980         (WebCore::PaymentCoordinatorClient::supportsVersion):
981         * Modules/applepay/PaymentCoordinatorClient.h:
982         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
983         (WebCore::mergePaymentOptions):
984         (WebCore::ApplePayPaymentHandler::show):
985         * SourcesCocoa.txt:
986         * WebCore.xcodeproj/project.pbxproj:
987         * loader/EmptyClients.cpp:
988         * testing/MockPaymentContactFields.h: Added.
989         (WebCore::MockPaymentContactFields::MockPaymentContactFields):
990         * testing/MockPaymentContactFields.idl: Added.
991         * testing/MockPaymentCoordinator.cpp:
992         (WebCore::MockPaymentCoordinator::showPaymentUI):
993         (WebCore::MockPaymentCoordinator::supportsVersion): Deleted.
994         * testing/MockPaymentCoordinator.h:
995         * testing/MockPaymentCoordinator.idl:
996
997 2019-02-06  Yusuke Suzuki  <ysuzuki@apple.com>
998
999         [JSC] PrivateName to PublicName hash table is wasteful
1000         https://bugs.webkit.org/show_bug.cgi?id=194277
1001
1002         Reviewed by Michael Saboff.
1003
1004         Use WebCoreBuiltinNames instead of adding WebCore names to JSC CommonIdentifiers.
1005
1006         * bindings/js/JSDOMWindowCustom.cpp:
1007         (WebCore::addCrossOriginPropertyNames):
1008         * bindings/js/JSLocationCustom.cpp:
1009         (WebCore::getOwnPropertySlotCommon):
1010         (WebCore::putCommon):
1011         * bindings/js/WebCoreBuiltinNames.h:
1012
1013 2019-02-06  Keith Rollin  <krollin@apple.com>
1014
1015         Really enable the automatic checking and regenerations of .xcfilelists during builds
1016         https://bugs.webkit.org/show_bug.cgi?id=194357
1017         <rdar://problem/47861231>
1018
1019         Reviewed by Chris Dumez.
1020
1021         Bug 194124 was supposed to enable the automatic checking and
1022         regenerating of .xcfilelist files during the build. While related
1023         changes were included in that patch, the change to actually enable the
1024         operation somehow was omitted. This patch actually enables the
1025         operation. The check-xcfilelist.sh scripts now check
1026         WK_DISABLE_CHECK_XCFILELISTS, and if it's "1", opts-out the developer
1027         from the checking.
1028
1029         No new tests since there should be no observable behavior difference.
1030
1031         * Scripts/check-xcfilelists.sh:
1032
1033 2019-02-06  John Wilander  <wilander@apple.com>
1034
1035         Forward Ad Click Attribution data from HTMLAnchorElement::handleClick() to WebKit::NavigationActionData
1036         https://bugs.webkit.org/show_bug.cgi?id=194325
1037         <rdar://problem/47840283>
1038
1039         Reviewed by Chris Dumez.
1040
1041         No new tests. This is just data forwarding. Once the data is stored, I will create
1042         test infrastructure to query it.
1043
1044         * html/HTMLAnchorElement.cpp:
1045         (WebCore::HTMLAnchorElement::handleClick):
1046         * loader/AdClickAttribution.h:
1047         (WebCore::AdClickAttribution::encode const):
1048         (WebCore::AdClickAttribution::decode):
1049         (WebCore::AdClickAttribution::Conversion::encode const):
1050         (WebCore::AdClickAttribution::Conversion::decode):
1051             Infrastructure for IPC.
1052         * loader/FrameLoader.cpp:
1053         (WebCore::FrameLoader::urlSelected):
1054         (WebCore::FrameLoader::loadURLIntoChildFrame):
1055         (WebCore::FrameLoader::loadFrameRequest):
1056         (WebCore::FrameLoader::loadURL):
1057             These functions forward the optional WebCore::AdClickAttribution object
1058             FrameLoader::loadURL() creates the NavigationAction object and sets the
1059             WebCore::AdClickAttribution object on there.
1060         * loader/FrameLoader.h:
1061         (WebCore::FrameLoader::urlSelected):
1062         (WebCore::FrameLoader::loadURL):
1063         * loader/NavigationAction.h:
1064         (WebCore::NavigationAction::adClickAttribution):
1065         (WebCore::NavigationAction::setAdClickAttribution):
1066
1067 2019-02-06  Justin Fan  <justin_fan@apple.com>
1068
1069         [Web GPU] Implement supporting dictionaries for GPUTexture
1070         https://bugs.webkit.org/show_bug.cgi?id=194354
1071
1072         Reviewed by Dean Jackson.
1073
1074         Add dictionaries needed to create a GPUTextureDescriptor.
1075
1076         No new tests; no change in behavior. 
1077
1078         New interface and dictionaries added:
1079         * Modules/webgpu/GPUExtent3D.idl:
1080         * Modules/webgpu/GPUTextureDescriptor.idl:
1081         * Modules/webgpu/GPUTextureDimension.idl:
1082         * Modules/webgpu/GPUTextureUsage.idl:
1083         * platform/graphics/gpu/GPUExtent3D.h:
1084         * platform/graphics/gpu/GPUTextureDescriptor.h:
1085         * platform/graphics/gpu/GPUTextureDimension.h:
1086         * platform/graphics/gpu/GPUTextureUsage.h:
1087
1088         Update WebGPUTextureFormatEnum to GPUTextureFormat:
1089         * Modules/webgpu/WebGPUTextureFormatEnum.h: Removed.
1090         * Modules/webgpu/GPUTextureFormat.idl: Renamed from WebGPUTextureFormatEnum.idl and updated to hyphen-case.
1091         * platform/graphics/gpu/GPUTextureFormat.h: Renamed from GPUTextureFormatEnum and updated for hyphen-case IDL.
1092         * Modules/webgpu/WebGPUSwapChain.cpp:
1093         * Modules/webgpu/WebGPUSwapChain.h:
1094         * Modules/webgpu/WebGPUSwapChain.idl:
1095         * platform/graphics/gpu/GPUSwapChain.h:
1096         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
1097         (WebCore::platformTextureFormatForGPUTextureFormat):
1098         (WebCore::GPUSwapChain::setFormat):
1099
1100         Update project files with new symbols:
1101         * CMakeLists.txt:
1102         * DerivedSources.make:
1103         * Sources.txt:
1104         * WebCore.xcodeproj/project.pbxproj:
1105         * bindings/js/WebCoreBuiltinNames.h:
1106
1107 2019-02-06  Dean Jackson  <dino@apple.com>
1108
1109         Fix potential build error in GPUDevice
1110         https://bugs.webkit.org/show_bug.cgi?id=194359
1111
1112         Reviewed by Joseph Pecoraro.
1113
1114         Add an UNUSED_PARAM for non-macOS platforms.
1115
1116         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
1117         (WebCore::GPUDevice::create):
1118
1119 2019-02-06  Daniel Bates  <dabates@apple.com>
1120
1121         Standardize on ControlKey instead of CtrlKey
1122         https://bugs.webkit.org/show_bug.cgi?id=194317
1123
1124         Reviewed by Tim Horton.
1125
1126         * dom/UIEventWithKeyState.cpp:
1127         (WebCore::UIEventWithKeyState::modifiersFromInitializer):
1128         (WebCore::UIEventWithKeyState::setModifierKeys):
1129         * dom/UIEventWithKeyState.h:
1130         (WebCore::UIEventWithKeyState::ctrlKey const):
1131         * page/ios/EventHandlerIOS.mm:
1132         (WebCore::EventHandler::accessKeyModifiers):
1133         * page/mac/EventHandlerMac.mm:
1134         (WebCore::EventHandler::accessKeyModifiers):
1135         * platform/PlatformEvent.h:
1136         (WebCore::PlatformEvent::controlKey const):
1137         (WebCore::PlatformEvent::PlatformEvent):
1138         (WebCore::PlatformEvent::ctrlKey const): Deleted.
1139         * platform/cocoa/KeyEventCocoa.mm:
1140         (WebCore::PlatformKeyboardEvent::getCurrentModifierState):
1141         * platform/gtk/PlatformKeyboardEventGtk.cpp:
1142         (WebCore::modifiersForGdkKeyEvent):
1143         * platform/gtk/PlatformMouseEventGtk.cpp:
1144         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1145         * platform/gtk/PlatformWheelEventGtk.cpp:
1146         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
1147         * platform/ios/KeyEventIOS.mm:
1148         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
1149         * platform/ios/PlatformEventFactoryIOS.mm:
1150         (WebCore::modifiersForEvent):
1151         * platform/mac/KeyEventMac.mm:
1152         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
1153         * platform/mac/PlatformEventFactoryMac.mm:
1154         (WebCore::modifiersForEvent):
1155         * testing/Internals.cpp:
1156         (WebCore::Internals::accessKeyModifiers const):
1157
1158 2019-02-06  Alex Christensen  <achristensen@webkit.org>
1159
1160         Fix WatchOS build
1161         https://bugs.webkit.org/show_bug.cgi?id=194353
1162
1163         Rubber stamped by Tim Horton and Wenson Hsieh.
1164
1165         * rendering/RenderThemeIOS.mm:
1166         (WebCore::iconForAttachment):
1167
1168 2019-02-06  Olivier Blin  <olivier.blin@softathome.com>
1169
1170         [SVG] fix SVGURIReference build by including SVGElement
1171         https://bugs.webkit.org/show_bug.cgi?id=194292
1172
1173         Reviewed by Michael Catanzaro.
1174
1175         * svg/SVGURIReference.h:
1176         SVGURIReference is making use of SVGElement in its constructor, but
1177         it was not declared.
1178
1179         The issue was not seen in unified builds because it was grouped with
1180         other files including SVGElement.
1181
1182 2019-02-06  Zalan Bujtas  <zalan@apple.com>
1183
1184         [LFC][IFC] Move line layout code to a dedicated file
1185         https://bugs.webkit.org/show_bug.cgi?id=194328
1186
1187         Reviewed by Antti Koivisto.
1188
1189         * Sources.txt:
1190         * WebCore.xcodeproj/project.pbxproj:
1191         * layout/inlineformatting/InlineFormattingContext.cpp:
1192         (WebCore::Layout::InlineFormattingContext::layout const):
1193         (WebCore::Layout::isTrimmableContent): Deleted.
1194         (WebCore::Layout::InlineFormattingContext::initializeNewLine const): Deleted.
1195         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): Deleted.
1196         (WebCore::Layout::InlineFormattingContext::createFinalRuns const): Deleted.
1197         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const): Deleted.
1198         (WebCore::Layout::InlineFormattingContext::closeLine const): Deleted.
1199         (WebCore::Layout::InlineFormattingContext::appendContentToLine const): Deleted.
1200         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): Deleted.
1201         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const): Deleted.
1202         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const): Deleted.
1203         * layout/inlineformatting/InlineFormattingContext.h:
1204         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::hasContent const):
1205         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::isClosed const):
1206         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::isFirstLine const):
1207         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::runs):
1208         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::contentLogicalLeft const):
1209         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::availableWidth const):
1210         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::lastRunType const):
1211         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalTop const):
1212         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalBottom const):
1213         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalHeight const):
1214         (WebCore::Layout::InlineFormattingContext::Line::hasContent const): Deleted.
1215         (WebCore::Layout::InlineFormattingContext::Line::isClosed const): Deleted.
1216         (WebCore::Layout::InlineFormattingContext::Line::isFirstLine const): Deleted.
1217         (WebCore::Layout::InlineFormattingContext::Line::runs): Deleted.
1218         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const): Deleted.
1219         (WebCore::Layout::InlineFormattingContext::Line::availableWidth const): Deleted.
1220         (WebCore::Layout::InlineFormattingContext::Line::lastRunType const): Deleted.
1221         (WebCore::Layout::InlineFormattingContext::Line::logicalTop const): Deleted.
1222         (WebCore::Layout::InlineFormattingContext::Line::logicalBottom const): Deleted.
1223         (WebCore::Layout::InlineFormattingContext::Line::logicalHeight const): Deleted.
1224         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1225         (WebCore::Layout::adjustedLineLogicalLeft): Deleted.
1226         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns): Deleted.
1227         (WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities): Deleted.
1228         (WebCore::Layout::InlineFormattingContext::Geometry::alignRuns): Deleted.
1229         (WebCore::Layout::InlineFormattingContext::Geometry::runWidth): Deleted.
1230         * layout/inlineformatting/Line.cpp:
1231         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::init):
1232         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::adjustLogicalLeft):
1233         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::adjustLogicalRight):
1234         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::contentLogicalRight const):
1235         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::appendContent):
1236         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::close):
1237         (WebCore::Layout::InlineFormattingContext::Line::init): Deleted.
1238         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft): Deleted.
1239         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight): Deleted.
1240         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const): Deleted.
1241         (WebCore::Layout::InlineFormattingContext::Line::appendContent): Deleted.
1242         (WebCore::Layout::InlineFormattingContext::Line::close): Deleted.
1243
1244 2019-02-06  Youenn Fablet  <youenn@apple.com>
1245
1246         CoreAudioCaptureSource should not configure its audio unit until it starts producing data
1247         https://bugs.webkit.org/show_bug.cgi?id=194310
1248
1249         Reviewed by Eric Carlson.
1250
1251         Delay the configuration of the audio unit until the source is instructed to start producing data.
1252         This allows the UIProcess to not start changing the audio unit when
1253         checking for constraints during getUserMedia call before the prompt.
1254         Covered by manual testing.
1255
1256         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1257         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
1258         (WebCore::CoreAudioCaptureSource::initializeToStartProducingData):
1259         (WebCore::CoreAudioCaptureSource::startProducingData):
1260         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1261
1262 2019-02-06  Youenn Fablet  <youenn@apple.com>
1263
1264         Disable audio ducking at Audio Unit setup time
1265         https://bugs.webkit.org/show_bug.cgi?id=194303
1266
1267         Reviewed by Eric Carlson.
1268
1269         When creating a CoreAudioCaptureSource, the audio unit might be
1270         reconfigured if a past audio capture was done.
1271         This might trigger audio ducking which is undone in startInternal.
1272         In some cases, startInternal will never call start.
1273         In that case, the audio unit will continue ducking the other processing.
1274         To ensure ducking is disabled, unduck in setupAudioUnit as well as startInternal.
1275
1276         In addition to that, once a shared unit is created, it stays alive until the UIProcess exits.
1277         This might affect all applications.
1278         Instead, whenever the shared unit is stopped, clean it so as to restore the state as if no capture ever happened.
1279         This has noticeable effects in the quality of audio being played on bluetooth devices.
1280
1281         Covered by manual tests.
1282
1283         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1284         (WebCore::CoreAudioSharedUnit::setupAudioUnit):
1285         (WebCore::CoreAudioSharedUnit::unduck):
1286         (WebCore::CoreAudioSharedUnit::startInternal):
1287         (WebCore::CoreAudioSharedUnit::captureFailed):
1288         (WebCore::CoreAudioSharedUnit::stopProducingData):
1289
1290 2019-02-06  Antti Koivisto  <antti@apple.com>
1291
1292         RELEASE_ASSERT(!m_document.isResolvingTreeStyle()) in com.apple.WebKit.WebContent at WebCore: WebCore::StyleResolver::~StyleResolver
1293         https://bugs.webkit.org/show_bug.cgi?id=194333
1294         <rdar://problem/47822929>
1295
1296         Reviewed by Zalan Bujtas.
1297
1298         Content extensions may mutate the extension stylesheet in the middle of a style resolution as a result of
1299         the legacy animation code triggering a resource load.
1300
1301         Test: http/tests/contentextensions/css-display-none-keyframe.html
1302
1303         * style/StyleScope.cpp:
1304         (WebCore::Style::Scope::scheduleUpdate):
1305
1306         Avoid clearing the style resolver if we are in the middle of a style resolution.
1307         A better fix that avoid doing this in the first place is tracked by https://bugs.webkit.org/show_bug.cgi?id=194335.
1308
1309 2019-02-06  Pablo Saavedra  <psaavedra@igalia.com>
1310
1311         Build failure after r240315
1312         https://bugs.webkit.org/show_bug.cgi?id=194341
1313
1314         Reviewed by Wenson Hsieh.
1315
1316         * bindings/js/JSUndoItemCustom.cpp:
1317         (WebCore::JSUndoItemOwner::isReachableFromOpaqueRoots):
1318
1319 2019-02-05  Ryosuke Niwa  <rniwa@webkit.org>
1320
1321         REGRESSION (r240909): Release assert in FrameLoader::loadURL when navigating with a non-existent target name
1322         https://bugs.webkit.org/show_bug.cgi?id=194329
1323
1324         Reviewed by Geoffrey Garen.
1325
1326         The bug was caused by the code path for when navigating with a specific target frame name that does not exist
1327         never setting the load type of PolicyChecker. As a result, we would use whatever load type used in the previous
1328         navigation, resulting in this release assertion.
1329
1330         Updating the load type here should in theory fix the underlying bug r240909 was meant to catch & fix.
1331
1332         Test: fast/loader/navigate-with-new-target-after-back-forward-navigation.html
1333
1334         * loader/FrameLoader.cpp:
1335         (WebCore::FrameLoader::loadURL):
1336
1337 2019-02-05  Claudio Saavedra  <csaavedra@igalia.com>
1338
1339         [FreeType] Build fix for Debian stable
1340
1341         Unreviewed build fix.
1342
1343         Debian stable currently has a version of fontconfig that doesn't
1344         yet have FC_COLOR. #ifdef its use to fix the build.
1345
1346         * platform/graphics/freetype/FontCacheFreeType.cpp:
1347         (WebCore::FontCache::systemFallbackForCharacters):
1348
1349 2019-02-05  Alex Christensen  <achristensen@webkit.org>
1350
1351         Stop using blobRegistry in NetworkProcess
1352         https://bugs.webkit.org/show_bug.cgi?id=194027
1353
1354         Reviewed by Youenn Fablet.
1355
1356         Also stop using NetworkBlobRegistry::singleton.
1357         Instead, have the NetworkProcess own a NetworkBlobRegistry which owns a BlobRegistryImpl.
1358         We now have to resolve all blob file references while we still have a
1359         NetworkConnectionToWebProcess/NetworkProcess/NetworkBlobRegistry/BlobRegistryImpl instead of
1360         using the singleton after we have passed everything to the loading code, but it works the same
1361         as it did before.  We must consume the sandbox extension from the BlobRegistryImpl before using
1362         the resolved files, so I pass around a Vector<RefPtr<WebCore::BlobDataFileReference>> so we know
1363         which extensions to revoke.
1364
1365         * platform/network/BlobRegistryImpl.h:
1366         * platform/network/FormData.cpp:
1367         (WebCore::appendBlobResolved):
1368         (WebCore::FormData::resolveBlobReferences):
1369         * platform/network/FormData.h:
1370         * platform/network/cf/FormDataStreamCFNet.cpp:
1371         (WebCore::createHTTPBodyCFReadStream):
1372         * platform/network/curl/CurlFormDataStream.cpp:
1373         (WebCore::CurlFormDataStream::CurlFormDataStream):
1374
1375 2019-02-05  Truitt Savell  <tsavell@apple.com>
1376
1377         Unreviewed, rolling out r240984.
1378
1379         Revision casued two API timeouts
1380
1381         Reverted changeset:
1382
1383         "Stop using blobRegistry in NetworkProcess"
1384         https://bugs.webkit.org/show_bug.cgi?id=194027
1385         https://trac.webkit.org/changeset/240984
1386
1387 2019-02-05  Keith Rollin  <krollin@apple.com>
1388
1389         Enable the automatic checking and regenerations of .xcfilelists during builds
1390         https://bugs.webkit.org/show_bug.cgi?id=194124
1391         <rdar://problem/47721277>
1392
1393         Reviewed by Tim Horton.
1394
1395         Bug 193790 add a facility for checking -- during build time -- that
1396         any needed .xcfilelist files are up-to-date and for updating them if
1397         they are not. This facility was initially opt-in by setting
1398         WK_ENABLE_CHECK_XCFILELISTS until other pieces were in place and until
1399         the process seemed robust. Its now time to enable this facility and
1400         make it opt-out. If there is a need to disable this facility, set and
1401         export WK_DISABLE_CHECK_XCFILELISTS=1 in your environment before
1402         running `make` or `build-webkit`, or before running Xcode from the
1403         command line.
1404
1405         Additionally, remove the step that generates a list of source files
1406         going into the UnifiedSources build step. It's only necessarily to
1407         specify Sources.txt and SourcesCocoa.txt as inputs.
1408
1409         No new tests since there should be no observable behavior difference.
1410
1411         * UnifiedSources-input.xcfilelist: Removed.
1412         * WebCore.xcodeproj/project.pbxproj:
1413
1414 2019-02-05  Keith Rollin  <krollin@apple.com>
1415
1416         Update .xcfilelist files
1417         https://bugs.webkit.org/show_bug.cgi?id=194121
1418         <rdar://problem/47720863>
1419
1420         Reviewed by Tim Horton.
1421
1422         Preparatory to enabling the facility for automatically updating the
1423         .xcfilelist files, check in a freshly-updated set so that not everyone
1424         runs up against having to regenerate them themselves.
1425
1426         No new tests since there should be no observable behavior difference.
1427
1428         * DerivedSources-input.xcfilelist:
1429         * DerivedSources-output.xcfilelist:
1430
1431 2019-02-05  Alex Christensen  <achristensen@webkit.org>
1432
1433         Stop using blobRegistry in NetworkProcess
1434         https://bugs.webkit.org/show_bug.cgi?id=194027
1435
1436         Reviewed by Youenn Fablet.
1437
1438         Also stop using NetworkBlobRegistry::singleton.
1439         Instead, have the NetworkProcess own a NetworkBlobRegistry which owns a BlobRegistryImpl.
1440         We now have to resolve all blob file references while we still have a
1441         NetworkConnectionToWebProcess/NetworkProcess/NetworkBlobRegistry/BlobRegistryImpl instead of
1442         using the singleton after we have passed everything to the loading code, but it works the same
1443         as it did before.  We must consume the sandbox extension from the BlobRegistryImpl before using
1444         the resolved files, so I pass around a Vector<RefPtr<WebCore::BlobDataFileReference>> so we know
1445         which extensions to revoke.
1446
1447         * platform/network/BlobRegistryImpl.h:
1448         * platform/network/FormData.cpp:
1449         (WebCore::appendBlobResolved):
1450         (WebCore::FormData::resolveBlobReferences):
1451         * platform/network/FormData.h:
1452         * platform/network/cf/FormDataStreamCFNet.cpp:
1453         (WebCore::createHTTPBodyCFReadStream):
1454         * platform/network/curl/CurlFormDataStream.cpp:
1455         (WebCore::CurlFormDataStream::CurlFormDataStream):
1456
1457 2019-02-05  Ryan Haddad  <ryanhaddad@apple.com>
1458
1459         Unreviewed, rolling out r240742.
1460
1461         Causes crashes on iOS simulator.
1462
1463         Reverted changeset:
1464
1465         "[iOS] Keyups for non-modifier keys identified as "Dead" when
1466         not focused in a content-editable element"
1467         https://bugs.webkit.org/show_bug.cgi?id=192824
1468         https://trac.webkit.org/changeset/240742
1469
1470 2019-02-05  Zalan Bujtas  <zalan@apple.com>
1471
1472         [LFC][IFC] collectInlineContent should use pre-computed margins, paddings and borders
1473         https://bugs.webkit.org/show_bug.cgi?id=194269
1474
1475         Reviewed by Antti Koivisto.
1476
1477         In this patch we pre-compute the margins padding and borders for formatting context roots, replaced boxes and non-replaced containers.
1478         These property values are input to collectInlineContent's inline item detaching logic.
1479
1480         * layout/inlineformatting/InlineFormattingContext.cpp:
1481         (WebCore::Layout::nextInPreOrder):
1482         (WebCore::Layout::InlineFormattingContext::layout const):
1483         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
1484         (WebCore::Layout::InlineFormattingContext::collectInlineContent const):
1485         * layout/inlineformatting/InlineFormattingContext.h:
1486         * layout/layouttree/LayoutBox.h: ran out bits. 
1487
1488 2019-02-05  Antoine Quint  <graouts@apple.com>
1489
1490         REGRESSION (r240579): com.apple.WebKit.WebContent at WebCore: WebCore::Document::absoluteEventRegionForNode
1491         https://bugs.webkit.org/show_bug.cgi?id=194284
1492         <rdar://problem/47774298>
1493
1494         Reviewed by Antti Koivisto.
1495
1496         The m_touchActionElements list needs to be HashSet<RefPtr<Element>> instead of HashSet<Element*>. It was initially storing raw pointers based on m_touchEventTargets
1497         which is an EventTargetSet (typedef’d to HashCountedSet<Node*>), but that's because these nodes have an event listener registered for them and as such are kept alive,
1498         whereas elements with a touch-action property aren’t. Elements are removed from this list from Document::nodeWillBeRemoved() and from Document::updateTouchActionElements(),
1499         the latter being called from Style::TreeResolver::resolveElement().
1500
1501         * dom/Document.cpp:
1502         (WebCore::Document::updateTouchActionElements):
1503         * dom/Document.h:
1504         (WebCore::Document::touchActionElements const):
1505
1506 2019-02-05  Benjamin Poulain  <benjamin@webkit.org>
1507
1508         Hit testing functions optimizations
1509         https://bugs.webkit.org/show_bug.cgi?id=194073
1510         <rdar://problem/47692312>
1511
1512         Reviewed by Zalan Bujtas.
1513
1514         This patch implements some easy optimizations that speed up
1515         hit testing without changing the algorithms.
1516
1517         * page/FrameViewLayoutContext.h:
1518         The code for:
1519             view().frameView().layoutContext().isPaintOffsetCacheEnabled()
1520         followed by:
1521             view().frameView().layoutContext().layoutState()
1522         was loading all the intermediate values twice and calling layoutState()
1523         twice.
1524
1525         By marking the function as pure, Clang can CSE the whole thing and
1526         remove the duplicated code.
1527
1528         * platform/graphics/LayoutRect.h:
1529         (WebCore::LayoutRect::isInfinite const):
1530         That one is pretty funny.
1531
1532         Since LayoutRect::isInfinite() was implemented before operator==() is
1533         declared, the compiler was falling back to the implicit convertion to FloatRect()
1534         before doing any comparison.
1535
1536         This explains a bunch of the convertions to float when using LayoutRect.
1537
1538         * rendering/RenderBox.cpp:
1539         (WebCore::RenderBox::mapLocalToContainer const):
1540         Just reoder to make the register nice and clean for the optimization described above.
1541
1542 2019-02-04  Yusuke Suzuki  <ysuzuki@apple.com>
1543
1544         [JSC] Shrink size of VM by lazily allocating IsoSubspaces for non-common types
1545         https://bugs.webkit.org/show_bug.cgi?id=193993
1546
1547         Reviewed by Keith Miller.
1548
1549         * bindings/scripts/CodeGeneratorJS.pm:
1550         (GenerateHeader):
1551         * bridge/runtime_method.h:
1552
1553 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
1554
1555         Move some macOS/iOS scrolling code into the scrolling/cocoa directory
1556         https://bugs.webkit.org/show_bug.cgi?id=194245
1557
1558         Reviewed by Zalan Bujtas.
1559
1560         ScrollingTreeFixedNode and ScrollingTreeStickyNode are used on iOS and macOS, so move them to the cocoa
1561         directory.
1562
1563         Standardize on the ordering of ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC).
1564
1565         Stop building ScrollingThread for iOS (it's never used), and stub out some functions so things build.
1566
1567         * SourcesCocoa.txt:
1568         * WebCore.xcodeproj/project.pbxproj:
1569         * page/scrolling/ScrollingThread.cpp:
1570         (WebCore::ScrollingThread::initializeRunLoop):
1571         (WebCore::ScrollingThread::wakeUpRunLoop):
1572         (WebCore::ScrollingThread::threadRunLoopSourceCallback):
1573         * page/scrolling/cocoa/ScrollingTreeFixedNode.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.h.
1574         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.mm.
1575         * page/scrolling/cocoa/ScrollingTreeStickyNode.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.h.
1576         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm.
1577         * page/scrolling/mac/ScrollingThreadMac.mm:
1578         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
1579         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
1580
1581 2019-02-04  Ms2ger  <Ms2ger@igalia.com>
1582
1583         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
1584         https://bugs.webkit.org/show_bug.cgi?id=174816
1585
1586         Reviewed by Michael Catanzaro.
1587
1588         Tests: enabled fast/url/user-visible/.
1589
1590         * testing/Internals.cpp:
1591         (WebCore::Internals::userVisibleString): Enable method on all platforms.
1592
1593 2019-02-04  Fujii Hironori  <Hironori.Fujii@sony.com>
1594
1595         [curl] ASSERTION FAILED: !m_didNotifyResponse || m_multipartHandle
1596         https://bugs.webkit.org/show_bug.cgi?id=190895
1597
1598         Reviewed by Ross Kirsling.
1599
1600         An assertion was failing in CurlRequest::invokeDidReceiveResponse
1601         because DidReceiveResponse was already dispatched. This condition
1602         was met if CurlRequestScheduler::completeTransfer is called while
1603         waiting for the reply for the first DidReceiveResponse.
1604
1605         No new tests, covered by existing tests.
1606
1607         * platform/network/curl/CurlRequest.h:
1608         (WebCore::CurlRequest::needToInvokeDidReceiveResponse const):
1609         Return true if m_didNotifyResponse is false disregard to
1610         m_didReturnFromNotify.
1611
1612 2019-02-04  Said Abou-Hallawa  <said@apple.com>
1613
1614         [CG] Enable setAdditionalSupportedImageTypes for WK1
1615         https://bugs.webkit.org/show_bug.cgi?id=194190
1616
1617         Reviewed by Tim Horton.
1618
1619         Move the function webCoreStringVectorFromNSStringArray from WebKit to
1620         WebCore so it can be used by both WebKit and WebKitLegacy.
1621
1622         * platform/mac/StringUtilities.h:
1623         * platform/mac/StringUtilities.mm:
1624         (WebCore::webCoreStringVectorFromNSStringArray):
1625
1626 2019-02-04  Justin Fan  <justin_fan@apple.com>
1627
1628         [Web GPU] Code clean-up for RenderPipeline backend
1629         https://bugs.webkit.org/show_bug.cgi?id=194238
1630
1631         Reviewed by Dean Jackson.
1632
1633         Replace dot syntax setters with calls to setter methods, and remove unnecessary setter calls for 
1634         the input state's descriptor arrays.
1635
1636         Covered by existing tests; no change in behavior.
1637
1638         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
1639         (WebCore::tryCreateMtlDepthStencilState): Refactor to use implicit setters rather than dot syntax.
1640         (WebCore::setInputStateForPipelineDescriptor): Ditto, and remove unnecessary setter calls on array objects.
1641
1642 2019-02-04  Benjamin Poulain  <benjamin@webkit.org>
1643
1644         Use deferrable timer to restart the Responsiveness Timer on each wheel event
1645         https://bugs.webkit.org/show_bug.cgi?id=194135
1646         <rdar://problem/47724099>
1647
1648         Reviewed by Simon Fraser.
1649
1650         The original DeferrableOneShotTimer was not really deferrable.
1651         What it allows is to restart the count down from scratch after
1652         firing.
1653
1654         For this optimization, I want to keep the correct timing but avoid
1655         starting a real timer every time.
1656
1657         I renamed DeferrableOneShotTimer to ResettableOneShotTimer and
1658         created a real DeferrableOneShotTimer that support deadlines.
1659
1660         * css/CSSImageGeneratorValue.cpp:
1661         * html/HTMLPlugInImageElement.h:
1662         * loader/cache/CachedResource.h:
1663         * platform/Timer.cpp:
1664         (WebCore::DeferrableOneShotTimer::startOneShot):
1665         (WebCore::DeferrableOneShotTimer::fired):
1666         * platform/Timer.h:
1667         (WebCore::TimerBase::nextFireTime const):
1668         (WebCore::ResettableOneShotTimer::ResettableOneShotTimer):
1669         (WebCore::DeferrableOneShotTimer::DeferrableOneShotTimer):
1670         (WebCore::DeferrableOneShotTimer::stop):
1671         (WebCore::DeferrableOneShotTimer::restart): Deleted.
1672         * platform/graphics/ca/TileController.h:
1673         * platform/graphics/cg/SubimageCacheWithTimer.h:
1674
1675 2019-02-04  Antoine Quint  <graouts@apple.com>
1676
1677         Use constants for pointer types
1678         https://bugs.webkit.org/show_bug.cgi?id=194232
1679
1680         Reviewed by Dean Jackson.
1681
1682         We cannot use an enum for the pointer type since a custom pointer type can be created by developers when creating a
1683         pointer event using JavaScript, but we can at least used string constants for the ones created internally.
1684
1685         * dom/PointerEvent.cpp:
1686         (WebCore::PointerEvent::mousePointerType):
1687         (WebCore::PointerEvent::penPointerType):
1688         (WebCore::PointerEvent::touchPointerType):
1689         * dom/PointerEvent.h:
1690         * dom/ios/PointerEventIOS.cpp:
1691
1692 2019-02-04  Zalan Bujtas  <zalan@apple.com>
1693
1694         [First paint] Adjust "finishedParsingMainDocument" flag by taking deferred and async scripts into account.
1695         https://bugs.webkit.org/show_bug.cgi?id=194168
1696
1697         Reviewed by Simon Fraser.
1698
1699         First paint should not be blocked by async or deferred scripts.
1700
1701         * page/FrameView.cpp:
1702         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
1703
1704 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
1705
1706         Async overflow scroll with border-radius renders incorrectly
1707         https://bugs.webkit.org/show_bug.cgi?id=194205
1708         <rdar://problem/47771668>
1709
1710         Reviewed by Zalan Bujtas.
1711
1712         When an element has composited overflow:scroll and border-radius, we need to make a layer
1713         to clip to the inside of the border radius if necessary.
1714
1715         Existing code simply turned off needsDescendantsClippingLayer for composited scrolling
1716         layers, but now we check to see if the inner border is rounded. If we have both a m_childContainmentLayer
1717         and scrolling layers, we need to adjust the location of the scrolling layers (which are parented
1718         in m_childContainmentLayer).
1719
1720         Also fix offsetFromRenderer for these layers; it's positive for layers inset from the top left
1721         of the border box.
1722
1723         Tests: compositing/clipping/border-radius-async-overflow-clipping-layer.html
1724                compositing/clipping/border-radius-async-overflow-non-stacking.html
1725                compositing/clipping/border-radius-async-overflow-stacking.html
1726
1727         * rendering/RenderLayerBacking.cpp:
1728         (WebCore::RenderLayerBacking::updateConfiguration):
1729         (WebCore::RenderLayerBacking::updateGeometry):
1730         (WebCore::RenderLayerBacking::updateChildClippingStrategy): Layout is always up-to-date now, so remove the comment.
1731
1732 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
1733
1734         PageOverlayController's layers should be created lazily
1735         https://bugs.webkit.org/show_bug.cgi?id=194199
1736
1737         Reviewed by Tim Horton.
1738
1739         Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
1740         and use them to only parent the overlay-hosting layers when necessary.
1741
1742         For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
1743         simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
1744         which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
1745         compositing updates that parents the layerWithDocumentOverlays().
1746
1747         View overlays are added to the layer tree via the DrawingArea. When we go between having
1748         none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
1749         on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
1750         compositing flush (this has to be done manually because view overlay layers are outside the
1751         subtree managed by RenderLayerCompositor).
1752         
1753         Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
1754         there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
1755         overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
1756         having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().
1757
1758         * loader/EmptyClients.h:
1759         * page/ChromeClient.h:
1760         * page/FrameView.cpp:
1761         (WebCore::FrameView::setNeedsCompositingConfigurationUpdate): These functions need to schedule a compositing flush
1762         because there may be nothing else that does.
1763         (WebCore::FrameView::setNeedsCompositingGeometryUpdate):
1764         * page/Page.cpp:
1765         (WebCore::Page::installedPageOverlaysChanged):
1766         * page/Page.h:
1767         * page/PageOverlayController.cpp:
1768         (WebCore::PageOverlayController::hasDocumentOverlays const):
1769         (WebCore::PageOverlayController::hasViewOverlays const):
1770         (WebCore::PageOverlayController::attachViewOverlayLayers): PageOverlayController has the Page so it
1771         might as well be the one to call through the ChromeClient.
1772         (WebCore::PageOverlayController::detachViewOverlayLayers):
1773         (WebCore::PageOverlayController::installPageOverlay):
1774         (WebCore::PageOverlayController::uninstallPageOverlay):
1775         * page/PageOverlayController.h:
1776         * rendering/RenderLayerCompositor.cpp:
1777         (WebCore::RenderLayerCompositor::updateCompositingLayers): isFullUpdate is always true; remove it.
1778         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
1779         (WebCore::RenderLayerCompositor::attachRootLayer):
1780         (WebCore::RenderLayerCompositor::detachRootLayer):
1781
1782 2019-02-04  Eric Liang  <ericliang@apple.com>
1783
1784         When performing Increment or Decrement on sliders, check to see if the slider is disabled.
1785         https://bugs.webkit.org/show_bug.cgi?id=173497
1786
1787         Reviewed by Chris Fleizach.
1788
1789         Test: accessibility/set-value-not-work-for-disabled-sliders.html
1790
1791         * accessibility/AccessibilityNodeObject.cpp:
1792         (WebCore::AccessibilityNodeObject::alterSliderValue):
1793
1794 2019-02-04  Sihui Liu  <sihui_liu@apple.com>
1795
1796         IndexedDB: leak WebIDBConnectionToServer in layout tests
1797         https://bugs.webkit.org/show_bug.cgi?id=193688
1798         <rdar://problem/47353263>
1799
1800         Reviewed by Geoffrey Garen.
1801
1802         Let IDBConnectionToServer keep a WeakPtr of IDBConnectionToServerDelegate.
1803
1804         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1805         (WebCore::IDBClient::IDBConnectionToServer::IDBConnectionToServer):
1806         * Modules/indexeddb/client/IDBConnectionToServer.h:
1807         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
1808
1809 2019-02-04  Youenn Fablet  <youenn@apple.com>
1810
1811         Make sure to remove the device observer in AVVideoCaptureSource
1812         https://bugs.webkit.org/show_bug.cgi?id=194181
1813         <rdar://problem/47739247>
1814
1815         Reviewed by Eric Carlson.
1816
1817         Make sure to remove the device observer when the observer is destroyed.
1818         To simplify things, add the observer in AVVideoCaptureSource constructor and remove it in the destructor.
1819
1820         Make also sure the session observer is also removed whenever the session is released by AVVideoCaptureSource.
1821
1822         Covered by manual test.
1823
1824        * platform/mediastream/mac/AVVideoCaptureSource.h:
1825         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1826         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
1827         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
1828         (WebCore::AVVideoCaptureSource::initializeSession):
1829         (WebCore::AVVideoCaptureSource::clearSession):
1830         (WebCore::AVVideoCaptureSource::stopProducingData):
1831         (WebCore::AVVideoCaptureSource::setupSession):
1832
1833 2019-02-04  Antoine Quint  <graouts@apple.com>
1834
1835         Use a dedicated type instead of int32_t for pointer identifiers
1836         https://bugs.webkit.org/show_bug.cgi?id=194217
1837
1838         Reviewed by Antti Koivisto.
1839
1840         * WebCore.xcodeproj/project.pbxproj:
1841         * dom/PointerEvent.h:
1842         * dom/PointerID.h: Added.
1843         * page/PointerCaptureController.cpp:
1844         (WebCore::PointerCaptureController::setPointerCapture):
1845         (WebCore::PointerCaptureController::releasePointerCapture):
1846         (WebCore::PointerCaptureController::hasPointerCapture):
1847         (WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier):
1848         (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier):
1849         (WebCore::PointerCaptureController::cancelPointer):
1850         * page/PointerCaptureController.h:
1851
1852 2019-02-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1853
1854         [iOS] Unable to make a selection in jsfiddle.net using arrow keys when requesting desktop site
1855         Followup to https://bugs.webkit.org/show_bug.cgi?id=193758
1856
1857         Reviewed by Daniel Bates.
1858
1859         Put the iOS-specific behavior behind an EditingBehavior check, rather than a compile-time guard. No change in
1860         behavior.
1861
1862         * editing/EditingBehavior.h:
1863         (WebCore::EditingBehavior::shouldMoveSelectionToEndWhenFocusingTextInput const):
1864         * html/HTMLInputElement.cpp:
1865         (WebCore::HTMLInputElement::setDefaultSelectionAfterFocus):
1866
1867 2019-02-04  Zalan Bujtas  <zalan@apple.com>
1868
1869         [LFC][IFC] Make InlineFormattingContext::collectInlineContent non-recursive.
1870         https://bugs.webkit.org/show_bug.cgi?id=194210
1871
1872         Reviewed by Antti Koivisto.
1873
1874         Use iterative algorithm to collect inline content (and add breaking rules).
1875         This is in preparation for fixing the inline preferred width computation.  
1876
1877         * layout/Verification.cpp:
1878         (WebCore::Layout::resolveForRelativePositionIfNeeded):
1879         * layout/inlineformatting/InlineFormattingContext.cpp:
1880         (WebCore::Layout::addDetachingRules):
1881         (WebCore::Layout::createAndAppendInlineItem):
1882         (WebCore::Layout::InlineFormattingContext::collectInlineContent const):
1883         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): Deleted.
1884         * layout/inlineformatting/InlineFormattingContext.h:
1885
1886 2019-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1887
1888         Unreviewed, fix unused variable warnings introduced in r240912
1889         https://bugs.webkit.org/show_bug.cgi?id=194198
1890         <rdar://problem/47776051>
1891
1892         * page/FrameView.cpp:
1893         (WebCore::FrameView::setNeedsCompositingConfigurationUpdate):
1894         (WebCore::FrameView::setNeedsCompositingGeometryUpdate):
1895
1896 2019-02-04  Frederic Wang  <fwang@igalia.com>
1897
1898         [css-scroll-snap] scroll-snap-align not honored on child with non-visible overflow
1899         https://bugs.webkit.org/show_bug.cgi?id=191816
1900
1901         Reviewed by Wenson Hsieh.
1902
1903         This patch fixes a bug that prevents children of a scroll container to create snap positions
1904         when they have non-visible overflow. This happens because for such a child, the function
1905         RenderBox::findEnclosingScrollableContainer() will return the child itself rather than the
1906         scroll container. To address that issue, we introduce a new
1907         RenderObject::enclosingScrollableContainerForSnapping() helper function that ensures that
1908         a real RenderBox ancestor is returned.
1909
1910         Test: css3/scroll-snap/scroll-snap-children-with-overflow.html
1911
1912         * page/scrolling/AxisScrollSnapOffsets.cpp:
1913         (WebCore::updateSnapOffsetsForScrollableArea): Use enclosingScrollableContainerForSnapping()
1914         so that we don't skip children with non-visible overflow.
1915         * rendering/RenderLayerModelObject.cpp:
1916         (WebCore::RenderLayerModelObject::styleDidChange): Ditto. The new function calls
1917         enclosingBox().
1918         * rendering/RenderObject.cpp:
1919         (WebCore::RenderObject::enclosingScrollableContainerForSnapping const): Return
1920         the scrollable container of the enclosing box. If it is actually the render object itself
1921         then start the search from the parent box instead.
1922         * rendering/RenderObject.h: Declare enclosingScrollableContainerForSnapping(). 
1923
1924 2019-02-04  Antti Koivisto  <antti@apple.com>
1925
1926         Rename GraphicsLayer and PlatformCALayer scrolling layer type enum values to be less ambiguous
1927         https://bugs.webkit.org/show_bug.cgi?id=194215
1928
1929         Reviewed by Frédéric Wang.
1930
1931         GraphicsLayer::Type::Scrolling -> GraphicsLayer::Type::ScrollContainer
1932         PlatformCALayer::LayerTypeScrollingLayer -> PlatformCALayer::LayerTypeScrollContainerLayer
1933
1934         * platform/graphics/GraphicsLayer.cpp:
1935         (WebCore::GraphicsLayer::supportsLayerType):
1936         * platform/graphics/GraphicsLayer.h:
1937         * platform/graphics/ca/GraphicsLayerCA.cpp:
1938         (WebCore::GraphicsLayer::supportsLayerType):
1939         (WebCore::GraphicsLayerCA::initialize):
1940         * platform/graphics/ca/PlatformCALayer.cpp:
1941         (WebCore::operator<<):
1942         * platform/graphics/ca/PlatformCALayer.h:
1943         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1944         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
1945         (WebCore::PlatformCALayerCocoa::commonInit):
1946         * rendering/RenderLayerBacking.cpp:
1947         (WebCore::RenderLayerBacking::updateScrollingLayers):
1948         * rendering/RenderLayerCompositor.cpp:
1949         (WebCore::RenderLayerCompositor::ensureRootLayer):
1950
1951 2019-02-03  Antti Koivisto  <antti@apple.com>
1952
1953         [iOS] Tiles not created in large scrollable iframes
1954         https://bugs.webkit.org/show_bug.cgi?id=193665
1955
1956         Reviewed by Simon Fraser.
1957
1958         We are not syncing scroll position back to the graphics layer tree correctly.
1959
1960         Test by Frédéric Wang.
1961
1962         * page/scrolling/AsyncScrollingCoordinator.cpp:
1963         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
1964         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
1965         (WebCore::AsyncScrollingCoordinator::reconcileScrollPosition):
1966
1967         Factor setting and syncing scrolling layer positions into a function.
1968         Use bounds.origin scrolling mechanic when scrollContainerLayer is present.
1969
1970         (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
1971         (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
1972         (WebCore::AsyncScrollingCoordinator::updateScrollLayerPosition): Deleted.
1973         * page/scrolling/AsyncScrollingCoordinator.h:
1974         * page/scrolling/ScrollingCoordinator.cpp:
1975         (WebCore::ScrollingCoordinator::scrollContainerLayerForFrameView):
1976         (WebCore::ScrollingCoordinator::scrolledContentsLayerForFrameView):
1977         (WebCore::ScrollingCoordinator::scrollLayerForFrameView): Deleted.
1978         * page/scrolling/ScrollingCoordinator.h:
1979         * rendering/RenderLayerCompositor.cpp:
1980
1981         Rename scrollLayer to scrolledContentsLayer according to out preferred naming scheme and use it in that role only.
1982         Add scrollContainerLayer as a separate layer. It is only constructed when using async scrolling on iOS.
1983
1984         (WebCore::RenderLayerCompositor::~RenderLayerCompositor):
1985         (WebCore::RenderLayerCompositor::customPositionForVisibleRectComputation const):
1986         (WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
1987         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
1988         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
1989         (WebCore::RenderLayerCompositor::updateScrollLayerPosition):
1990         (WebCore::RenderLayerCompositor::frameViewDidScroll):
1991         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
1992         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
1993         (WebCore::RenderLayerCompositor::updateLayerForHeader):
1994         (WebCore::RenderLayerCompositor::updateLayerForFooter):
1995         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
1996         (WebCore::RenderLayerCompositor::ensureRootLayer):
1997         (WebCore::RenderLayerCompositor::destroyRootLayer):
1998         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
1999         * rendering/RenderLayerCompositor.h:
2000
2001 2019-02-03  Simon Fraser  <simon.fraser@apple.com>
2002
2003         Make setNeedsLayout on the root more explicitly about triggering its side-effects
2004         https://bugs.webkit.org/show_bug.cgi?id=194198
2005
2006         Reviewed by Antti Koivisto.
2007
2008         Calling setNeedsLayout() on the FrameView or RenderView is an odd concept; the render tree
2009         generally manages its own dirty state.
2010
2011         Most callers of setNeedsLayout() on the root are really trying to trigger the side-effects
2012         of layout, like compositing updates, which are required when view configuration state, like
2013         headers, footers and transparency, change. These dependencies are currently implicit and
2014         poorly defined.
2015
2016         Renaming "setNeedsLayout" on FrameView is a step towards being more explicit about pure
2017         rendering updates, vs updates of downstream data strutures like compositing. It's now called
2018         setNeedsLayoutAfterViewConfigurationChange(). In addition, expose
2019         setNeedsCompositingConfigurationUpdate() and setNeedsCompositingGeometryUpdate() so callers
2020         can trigger the appropriate types of compositing updates on the root layer.
2021
2022         In addition, FrameViewLayoutContext::setNeedsLayoutAfterViewConfigurationChange() schedules a
2023         layout. Withtout this, some callers would dirty the RenderView's layout but rely on some
2024         other trigger to make the layout happen.
2025
2026         This cleanup was prompted by noticing that FrameView::setHeaderHeight() dirtied layout
2027         but never scheduled it, making banner insertion in MiniBrowser unreliable.
2028
2029         This patch also removes the aliasing of headerHeight/footerHeight between Page and
2030         FrameView. Banners are a property of Page, so FrameView fetches the banner heights
2031         from Page.
2032
2033         * page/FrameView.cpp:
2034         (WebCore::FrameView::headerHeight const):
2035         (WebCore::FrameView::footerHeight const):
2036         (WebCore::FrameView::availableContentSizeChanged):
2037         (WebCore::FrameView::setNeedsLayoutAfterViewConfigurationChange):
2038         (WebCore::FrameView::setNeedsCompositingConfigurationUpdate):
2039         (WebCore::FrameView::setNeedsCompositingGeometryUpdate):
2040         (WebCore::FrameView::scheduleSelectionUpdate):
2041         (WebCore::FrameView::setTransparent):
2042         (WebCore::FrameView::setBaseBackgroundColor):
2043         (WebCore::FrameView::setAutoSizeFixedMinimumHeight):
2044         (WebCore::FrameView::enableAutoSizeMode):
2045         (WebCore::FrameView::setHeaderHeight): Deleted.
2046         (WebCore::FrameView::setFooterHeight): Deleted.
2047         (WebCore::FrameView::setNeedsLayout): Deleted.
2048         * page/FrameView.h:
2049         * page/FrameViewLayoutContext.cpp:
2050         (WebCore::FrameViewLayoutContext::setNeedsLayoutAfterViewConfigurationChange):
2051         (WebCore::FrameViewLayoutContext::setNeedsLayout): Deleted.
2052         * page/FrameViewLayoutContext.h:
2053         * page/Page.cpp:
2054         (WebCore::Page::setPageScaleFactor):
2055         (WebCore::Page::setHeaderHeight):
2056         (WebCore::Page::setFooterHeight):
2057         (WebCore::Page::addHeaderWithHeight): Deleted.
2058         (WebCore::Page::addFooterWithHeight): Deleted.
2059         * page/Page.h:
2060         * rendering/RenderLayerCompositor.cpp:
2061         (WebCore::RenderLayerCompositor::updateBacking):
2062         * testing/Internals.cpp:
2063         (WebCore::Internals::resetToConsistentState):
2064         (WebCore::Internals::setHeaderHeight):
2065         (WebCore::Internals::setFooterHeight):
2066
2067 2019-02-03  John Wilander  <wilander@apple.com>
2068
2069         Parse and handle Ad Click Attribution attributes in HTMLAnchorElement::handleClick()
2070         https://bugs.webkit.org/show_bug.cgi?id=194104
2071         <rdar://problem/47649991>
2072
2073         Reviewed by Chris Dumez, Daniel Bates, and Darin Adler.
2074
2075         Test: http/tests/adClickAttribution/anchor-tag-attributes-validation.html
2076
2077         This patch adds parsing and validation of the two new Ad Click Attribution
2078         attributes in anchor elements: adcampaignid and addestination. The data is
2079         not yet forwarded into the loader.
2080
2081         * html/HTMLAnchorElement.cpp:
2082         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
2083         (WebCore::HTMLAnchorElement::handleClick):
2084             Now calls HTMLAnchorElement::parseAdClickAttribution().
2085         * html/HTMLAnchorElement.h:
2086         * loader/AdClickAttribution.h:
2087             Made WebCore::AdClickAttribution copyable since it's needed to have it be
2088             WTF::Optional. Also made AdClickAttribution::MaxEntropy public. Changed
2089             numeric types from unsigned short to uint32_t.
2090         (WebCore::AdClickAttribution::Campaign::isValid const):
2091         (WebCore::AdClickAttribution::Conversion::isValid const):
2092
2093 2019-02-03  Ryosuke Niwa  <rniwa@webkit.org>
2094
2095         Validate navigation policy decisions to avoid crashes in continueLoadAfterNavigationPolicy
2096         https://bugs.webkit.org/show_bug.cgi?id=194189
2097
2098         Reviewed by Geoffrey Garen.
2099
2100         Introduced PolicyCheckIdentifier to pair each navigation policy check request with a decision,
2101         and deployed it in PolicyChecker. The identifier is passed from WebContent process to UI process
2102         in WebKit2, and passed it back with the policy decision.
2103
2104         Because PolicyCheckIdentifier embeds the process identifier from which a navigation policy is checked,
2105         we would be able to detect when UI process had sent the decision to a wrong WebContent process.
2106
2107         This patch also adds release assertions to make sure history().provisionalItem() is set whenever
2108         we're requesting a navigation policy check.
2109
2110         These code changes should either:
2111         1. Fix crashes in FrameLoader::continueLoadAfterNavigationPolicy where isBackForwardLoadType would
2112            return true yet history().provisionalItem() is null.
2113         2. Detect a bug that UI process can send a navigation policy decision to a wrong WebContent process.
2114         3. Rule out the possibility that (2) exists.
2115
2116         * loader/DocumentLoader.cpp:
2117         (WebCore::DocumentLoader::willSendRequest):
2118         (WebCore::DocumentLoader::responseReceived):
2119         * loader/EmptyClients.cpp:
2120         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
2121         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2122         * loader/EmptyFrameLoaderClient.h:
2123         * loader/FrameLoader.cpp:
2124         (WebCore::FrameLoader::checkContentPolicy):
2125         (WebCore::FrameLoader::loadURL):
2126         (WebCore::FrameLoader::load):
2127         (WebCore::FrameLoader::loadWithDocumentLoader):
2128         (WebCore::FrameLoader::loadPostRequest):
2129         * loader/FrameLoader.h:
2130         * loader/FrameLoaderClient.h:
2131         * loader/FrameLoaderTypes.h:
2132         (WebCore::PolicyCheckIdentifier): Added.
2133         (WebCore::PolicyCheckIdentifier::operator== const): Added.
2134         (WebCore::PolicyCheckIdentifier::PolicyCheckIdentifier): Added.
2135         (WebCore::PolicyCheckIdentifier::encode const): Added.
2136         (WebCore::PolicyCheckIdentifier::decode): Added.
2137         * loader/PolicyChecker.cpp:
2138         (WebCore::PolicyCheckIdentifier::generate):
2139         (WebCore::PolicyCheckIdentifier::isValidFor): Returns true if the identifer matches. Also release asserts
2140         that the process ID is same, and that m_check is always not zero (meaning it's a generated value).
2141         The failure of these release assertions would indicate that there is a bug in UI process, which results in
2142         a policy decision response being sent to a wrong Web process.
2143         (WebCore::PolicyChecker::checkNavigationPolicy): Exit early if isValidFor fails.
2144         (WebCore::PolicyChecker::checkNewWindowPolicy):
2145
2146 2019-02-03  Antti Koivisto  <antti@apple.com>
2147
2148         Don't include ScrollCoordinator.h from Element.h
2149         https://bugs.webkit.org/show_bug.cgi?id=194206
2150
2151         Reviewed by Daniel Bates.
2152
2153         * dom/Element.h:
2154
2155 2019-02-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2156
2157         Unable to move selection into editable roots with 0 height
2158         https://bugs.webkit.org/show_bug.cgi?id=194143
2159         <rdar://problem/47767284>
2160
2161         Reviewed by Ryosuke Niwa.
2162
2163         Currently, positions inside editable elements of height 0 are not considered to be candidates when
2164         canonicalizing a position to its visible counterpart. This prevents us from moving the selection into these
2165         editable roots at all. To fix this, we relax this constraint by allowing positions anchored by root editable
2166         elements to be candidates.
2167
2168         Test: editing/selection/insert-text-in-empty-content-editable.html
2169
2170         * dom/Position.cpp:
2171         (WebCore::Position::isCandidate const):
2172
2173 2019-02-03  Simon Fraser  <simon.fraser@apple.com>
2174
2175         Tidyup of Pagination and FrameView m_mediaType initialization
2176         https://bugs.webkit.org/show_bug.cgi?id=194203
2177
2178         Reviewed by Darin Adler.
2179
2180         Fix post-commit feedback on lines around code changed in r240901.
2181
2182         * page/FrameView.cpp:
2183         (WebCore::FrameView::FrameView):
2184         * page/FrameView.h:
2185         * rendering/Pagination.h:
2186         (WebCore::Pagination::operator!= const):
2187
2188 2019-02-03  Megan Gardner  <megan_gardner@apple.com>
2189
2190         Turn on Smart Paste
2191         https://bugs.webkit.org/show_bug.cgi?id=193786
2192
2193         Reviewed by Ryosuke Niwa.
2194
2195         Turned on a modified tests:
2196         LayoutTests/editing/pasteboard/smart-paste-001.html
2197         LayoutTests/editing/pasteboard/smart-paste-002.html
2198         LayoutTests/editing/pasteboard/smart-paste-003.html
2199         LayoutTests/editing/pasteboard/smart-paste-004.html
2200         LayoutTests/editing/pasteboard/smart-paste-005.html
2201         LayoutTests/editing/pasteboard/smart-paste-006.html
2202         LayoutTests/editing/pasteboard/smart-paste-007.html
2203         LayoutTests/editing/pasteboard/smart-paste-008.html
2204
2205         * platform/ios/PasteboardIOS.mm:
2206         (WebCore::Pasteboard::canSmartReplace):
2207         Turn on smart replace.
2208
2209 2019-02-02  Simon Fraser  <simon.fraser@apple.com>
2210
2211         Tidy up data memebers of FrameView and related classes to shrink class sizes
2212         https://bugs.webkit.org/show_bug.cgi?id=194197
2213
2214         Reviewed by Zalan Bujtas.
2215
2216         Make various enums 8-bit. Re-order data members of FrameView, FrameViewLayoutContext, Widget
2217         and ScrollView to optimize padding.
2218
2219         Use more data member initializers.
2220
2221         This shrinks FrameView from 1168 (144 padding bytes) to 1096 (96 padding bytes).
2222
2223         * dom/Element.h:
2224         * page/FrameView.cpp:
2225         (WebCore::FrameView::FrameView):
2226         * page/FrameView.h:
2227         * page/FrameViewLayoutContext.h:
2228         * platform/ScrollTypes.h:
2229         * platform/ScrollView.h: Data members should come after member functions.
2230         * platform/Widget.h:
2231         * rendering/Pagination.h:
2232         (WebCore::Pagination::Pagination): Deleted.
2233
2234 2019-02-02  Simon Fraser  <simon.fraser@apple.com>
2235
2236         Rename "scrollingLayer" in RenderLayerBacking to "scrollContainerLayer" for clarity
2237         https://bugs.webkit.org/show_bug.cgi?id=194194
2238
2239         Rubber-stampted by Antti Koivisto.
2240
2241         Our desired terminology is "scrollContainerLayer" for the outer, clipping layer
2242         for scrolling, and "scrolledContentsLayer" for the contents that move when you scroll.
2243
2244         * rendering/RenderLayerBacking.cpp:
2245         (WebCore::RenderLayerBacking::updateDebugIndicators):
2246         (WebCore::RenderLayerBacking::destroyGraphicsLayers):
2247         (WebCore::RenderLayerBacking::updateGeometry):
2248         (WebCore::RenderLayerBacking::setLocationOfScrolledContents):
2249         (WebCore::RenderLayerBacking::updateAfterDescendants):
2250         (WebCore::RenderLayerBacking::updateInternalHierarchy):
2251         (WebCore::RenderLayerBacking::updateDrawsContent):
2252         (WebCore::RenderLayerBacking::updateScrollingLayers):
2253         * rendering/RenderLayerBacking.h:
2254         * rendering/RenderLayerCompositor.cpp:
2255         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
2256         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
2257         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
2258         (WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer):
2259         (WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllScrollingLayers):
2260         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
2261
2262 2019-02-02  Justin Fan  <justin_fan@apple.com>
2263
2264         [Web GPU] Fix GPURenderPassEncoder::setVertexBuffers and allow overlapping indices with GPUBindGroups
2265         https://bugs.webkit.org/show_bug.cgi?id=194125
2266
2267         Reviewed by Myles C. Maxfield.
2268
2269         GPURenderPassEncoder::setVertexBuffers is now actually written to set all buffers provided. In addition,
2270         shift vertex input buffer indices so that any resource bindings can bind vertex buffer resources to the same indices. 
2271
2272         Existing tests cover setVertexBuffers. Updated buffer-resource-triangles to assign bind groups and vertex buffers to the same index.
2273
2274         * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.cpp: Added.
2275         (WebCore::WHLSL::Metal::calculateVertexBufferIndex): Simple shifting function for vertex input buffer indices.
2276         * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.h: Added.
2277         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
2278         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const): Limit maximum bind group indices to 0 to 3.
2279         * Modules/webgpu/WebGPURenderPassEncoder.cpp: 
2280         (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Limit vertex input indices to 0 to 15.
2281         * Modules/webgpu/WebGPURenderPassEncoder.h: Move IDL/bindings bug note to IDL file.
2282         * Modules/webgpu/WebGPURenderPassEncoder.idl: Ditto.
2283         * platform/graphics/gpu/GPULimits.h: Added. Home for Web GPU limits constants shared between files.
2284         * platform/graphics/gpu/GPURenderPassEncoder.h: Change IDL/bindings bug workaround to unsigned long long to prevent narrowing compared to spec.
2285         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
2286         (WebCore::GPURenderPassEncoder::setVertexBuffers): Now properly calls Metal's setVertexBuffers. 
2287         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2288         (WebCore::setInputStateForPipelineDescriptor): Fix validation checks for vertex attribute numbers and vertex buffer indices. 
2289
2290         Add symbols to project:
2291         * Sources.txt:
2292         * WebCore.xcodeproj/project.pbxproj:
2293
2294 2019-02-01  Simon Fraser  <simon.fraser@apple.com>
2295
2296         Async overflow scroll is jumpy on macOS if the main thread is busy
2297         https://bugs.webkit.org/show_bug.cgi?id=194184
2298         <rdar://problem/47758655>
2299
2300         Reviewed by Antti Koivisto.
2301
2302         This change extends to macOS some existing overflow-scroll functionality for iOS.
2303         When an async scroll is in process in the scroll thread (or UI process), we periodically
2304         message back to the web process main thread with scroll position updates. These
2305         can trigger post-scroll compositing updates, but we need to ensure that this update
2306         doesn't clobber the scroll position of the native layers, which would trigger
2307         stutters.
2308
2309         To do this we have the notion of a scroll position "sync" (ScrollingLayerPositionAction::Sync) which
2310         pokes the new value into the GraphicsLayer (hence making visible rect computations work), but doesn't
2311         propagate it to the platform layer. This patch wires up syncs for macOS during async overflow scrolling,
2312         coming out of AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll().
2313
2314         In RenderLayerBacking, m_scrollingContentsLayer is renamed to m_scrolledContentsLayer, and I added
2315         updateScrollOffset() and setLocationOfScrolledContents() to handle the set vs. sync, and to keep
2316         the iOS vs macOS differences in one function. This allows for more code sharing in RenderLayerBacking::updateGeometry().
2317
2318         There's a confusing bit in the m_childClippingMaskLayer code (trac.webkit.org/178029) where the setOffsetFromRenderer()
2319         just looks wrong; it should match m_scrollingLayer. This code is never hit for Cocoa, which never has m_childClippingMaskLayer.
2320
2321         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2322         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition): Logging
2323         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition): Logging
2324         * rendering/RenderLayer.cpp:
2325         (WebCore::RenderLayer::RenderLayer):
2326         (WebCore::RenderLayer::scrollTo):
2327         * rendering/RenderLayer.h: Rename m_requiresScrollBoundsOriginUpdate to m_requiresScrollPositionReconciliation
2328         and make it available on all platforms. Just reorder m_adjustForIOSCaretWhenScrolling to reduce #ifdef nesting confusion.
2329         * rendering/RenderLayerBacking.cpp:
2330         (WebCore::RenderLayerBacking::updateDebugIndicators):
2331         (WebCore::RenderLayerBacking::destroyGraphicsLayers):
2332         (WebCore::RenderLayerBacking::updateGeometry):
2333         (WebCore::RenderLayerBacking::setLocationOfScrolledContents):
2334         (WebCore::RenderLayerBacking::updateScrollOffset):
2335         (WebCore::RenderLayerBacking::updateDrawsContent):
2336         (WebCore::RenderLayerBacking::updateScrollingLayers):
2337         (WebCore::RenderLayerBacking::paintingPhaseForPrimaryLayer const):
2338         (WebCore::RenderLayerBacking::parentForSublayers const):
2339         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
2340         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
2341         (WebCore::RenderLayerBacking::paintContents):
2342         (WebCore::RenderLayerBacking::backingStoreMemoryEstimate const):
2343         * rendering/RenderLayerBacking.h:
2344
2345 2019-02-02  Zalan Bujtas  <zalan@apple.com>
2346
2347         [LFC] Initialize ICB's style with fixed width/height.
2348         https://bugs.webkit.org/show_bug.cgi?id=194188
2349
2350         Reviewed by Antti Koivisto.
2351
2352         Let's set ICB's logical width/height to Fixed so that it's available when we try to resolve a box's height
2353         in FormattingContext::Geometry::computedHeightValue() by using the containing block's height (ICB in this case).
2354
2355         * layout/LayoutState.cpp:
2356         (WebCore::Layout::LayoutState::LayoutState):
2357         * layout/LayoutState.h:
2358         * layout/layouttree/LayoutTreeBuilder.cpp:
2359         (WebCore::Layout::TreeBuilder::createLayoutTree):
2360
2361 2019-02-02  Zalan Bujtas  <zalan@apple.com>
2362
2363         [LFC] Add missing case to out-of-flow non-replaced horizontal used margin value computation
2364         https://bugs.webkit.org/show_bug.cgi?id=194185
2365
2366         Reviewed by Antti Koivisto.
2367
2368         If none of horizontal values (left, right, width, margin-left/right) are auto, then usedHorizontalMarginValues = computedHorizontalMarginValues.
2369
2370         Test: fast/block/block-only/absolute-position-left-right-margin.html
2371
2372         * layout/FormattingContextGeometry.cpp:
2373         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2374
2375 2018-12-16  Darin Adler  <darin@apple.com>
2376
2377         Convert additional String::format clients to alternative approaches
2378         https://bugs.webkit.org/show_bug.cgi?id=192746
2379
2380         Reviewed by Alexey Proskuryakov.
2381
2382         This round of conversions covers less-trivial cases such as floating
2383         point numerals and hexadecimal. Not yet taking on pointer serialization
2384         ("%p") or padding with spaces of zero digits, so call sites using those
2385         have been left untouched.
2386
2387         In some cases these new idioms are a bit clumsy, and we could follow up
2388         with additional convenience functions to make them more elegant.
2389
2390         * Modules/indexeddb/IDBKeyData.cpp:
2391         (WebCore::IDBKeyData::loggingString const): Use more ASCIILiteral and
2392         more appendLiteral for efficiency. Use upperNibbleToLowercaseASCIIHexDigit,
2393         lowerNibbleToLowercaseASCIIHexDigit, and also makeString and FormattedNumber.
2394
2395         * css/MediaQueryEvaluator.cpp:
2396         (WebCore::aspectRatioValueAsString): Use makeString and FormattedNumber.
2397         Doing it this way makes it a little clearer that we have an unpleasant
2398         use of fixed 6-digit precision here.
2399
2400         * html/FTPDirectoryDocument.cpp:
2401         (WebCore::processFilesizeString): Use makeString and FormattedNumber.
2402         * html/track/VTTCue.cpp:
2403         (WebCore::VTTCueBox::applyCSSProperties): Ditto.
2404         * page/CaptionUserPreferencesMediaAF.cpp:
2405         (WebCore::CaptionUserPreferencesMediaAF::windowRoundedCornerRadiusCSS const): Ditto.
2406         * page/History.cpp:
2407         (WebCore::History::stateObjectAdded): Ditto.
2408         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2409         (WebCore::formatByteNumber): Ditto.
2410         (WebCore::gcTimerString): Use String::number.
2411         (WebCore::ResourceUsageOverlay::platformDraw): Use makeString and FormattedNumber.
2412
2413         * page/scrolling/AxisScrollSnapOffsets.cpp:
2414         (WebCore::snapOffsetsToString): Removed some unnecessary copying in the for loop,
2415         use appendLiteral, and use appendFixedWidthNumber.
2416         (WebCore::snapOffsetRangesToString): Ditto.
2417         (WebCore::snapPortOrAreaToString): Use makeString and FormattedNumber.
2418
2419         * platform/animation/TimingFunction.cpp:
2420         (WebCore::TimingFunction::cssText const): Use makeString.
2421
2422         * platform/cocoa/KeyEventCocoa.mm:
2423         (WebCore::keyIdentifierForCharCode): Use makeString and the ASCIIHexDigit
2424         functions.
2425         * platform/graphics/Color.cpp:
2426         (WebCore::Color::nameForRenderTreeAsText const): Ditto.
2427
2428         * platform/mock/MockRealtimeVideoSource.cpp:
2429         (WebCore::MockRealtimeVideoSource::drawText): Use makeString and FormattedNumber.
2430
2431         * platform/text/PlatformLocale.cpp:
2432         (WebCore::DateTimeStringBuilder::visitField): Use String::numberToStringFixedWidth.
2433
2434 2019-02-01  Simon Fraser  <simon.fraser@apple.com>
2435
2436         Remove the unused layerForScrolling()
2437         https://bugs.webkit.org/show_bug.cgi?id=194180
2438
2439         Reviewed by Zalan Bujtas.
2440
2441         Remove ScrollableArea::layerForScrolling() and derivations. This was unused.
2442
2443         * page/FrameView.cpp:
2444         (WebCore::FrameView::layerForScrolling const): Deleted.
2445         * page/FrameView.h:
2446         * page/scrolling/ScrollingCoordinator.cpp:
2447         (WebCore::ScrollingCoordinator::scrollLayerForScrollableArea): Deleted.
2448         * page/scrolling/ScrollingCoordinator.h:
2449         * platform/ScrollableArea.h:
2450         (WebCore::ScrollableArea::layerForScrolling const): Deleted.
2451         * rendering/RenderLayer.cpp:
2452         (WebCore::RenderLayer::calculateClipRects const):
2453         * rendering/RenderLayer.h:
2454
2455 2019-02-01  Zalan Bujtas  <zalan@apple.com>
2456
2457         [LFC] Fix statically positioned replaced out-of-flow horizontal geometry
2458         https://bugs.webkit.org/show_bug.cgi?id=194163
2459
2460         Reviewed by Simon Fraser.
2461
2462         Fix a typo.
2463
2464         * layout/FormattingContextGeometry.cpp:
2465         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2466
2467 2019-02-01  Chris Dumez  <cdumez@apple.com>
2468
2469         REGRESSION: Flaky ASSERTION FAILED: m_uncommittedState.state == State::Committed on http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html
2470         https://bugs.webkit.org/show_bug.cgi?id=193740
2471         <rdar://problem/47527267>
2472
2473         Reviewed by Alex Christensen.
2474
2475         * loader/DocumentLoader.cpp:
2476         (WebCore::DocumentLoader::willSendRequest):
2477         (WebCore::DocumentLoader::continueAfterContentPolicy):
2478         * loader/FrameLoader.cpp:
2479         (WebCore::FrameLoader::loadURL):
2480         (WebCore::FrameLoader::loadWithDocumentLoader):
2481         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2482         * loader/FrameLoader.h:
2483         * loader/FrameLoaderTypes.h:
2484         * loader/PolicyChecker.cpp:
2485         (WebCore::PolicyChecker::checkNavigationPolicy):
2486         (WebCore::PolicyChecker::checkNewWindowPolicy):
2487         * loader/PolicyChecker.h:
2488
2489 2019-02-01  Antoine Quint  <graouts@apple.com>
2490
2491         Dispatch pointercancel events when content is panned or zoomed on iOS
2492         https://bugs.webkit.org/show_bug.cgi?id=193962
2493         <rdar://problem/47629134>
2494
2495         Reviewed by Dean Jackson.
2496
2497         Expose two new methods on PointerCaptureController so that, given a pointer id, it can be established whether this pointer
2498         has been cancelled, which is important because a cancelled pointer should no longer dispatch any further pointer events, and
2499         to cancel a pointer.
2500
2501         Tests: pointerevents/ios/touch-action-pointercancel-pan-x.html
2502                pointerevents/ios/touch-action-pointercancel-pan-y.html
2503                pointerevents/ios/touch-action-pointercancel-pinch-zoom.html
2504
2505         * WebCore.xcodeproj/project.pbxproj: Make PointerCaptureController.h Private so that it can be imported from WebKit.
2506         * dom/PointerEvent.h: Remove an unnecessary #if ENABLE(POINTER_EVENTS) since the entire file is already contained in one.
2507         Then we add a new create() method that takes an event type, a pointer id and a pointer type (touch vs. pen) that we use
2508         to create pointercancel events in PointerCaptureController::cancelPointer().
2509         * page/Page.cpp:
2510         (WebCore::Page::Page): Pass the Page as a parameter when creating the PointerCaptureController.
2511         * page/PointerCaptureController.cpp:
2512         (WebCore::PointerCaptureController::PointerCaptureController): Add a Page reference to the constructor since we'll need
2513         the page to access its main frame's EventHandler to perform hit testing in case we do not have a capture target override
2514         in cancelPointer().
2515         (WebCore::PointerCaptureController::releasePointerCapture): Drive-by, remove the the implicit parameter since on iOS we
2516         don't need to differentiate. We'll bring this back for the macOS work.
2517         (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier): New method we'll use when dispatching pointer
2518         events to identify whether a pointer id has already been cancelled which will allow for _not_ dispatching any further
2519         pointer events for this pointer id.
2520         (WebCore::PointerCaptureController::pointerEventWillBeDispatched): Keep track of the pointer type so we can preserve it
2521         when dispatching pointercancel events for a given pointer id.
2522         (WebCore::PointerCaptureController::cancelPointer): Dispatch a pointercancel for the provided pointer id, using the capture
2523         target override as the event's target, if there is one, and otherwise hit-testing at the provided location to figure out
2524         what the target should be.
2525         * page/PointerCaptureController.h: Switch the target overrides from Element* to RefPtr<Element> to ensure it may not be
2526         deleted while we still need them. Existing code already ensures these get set to nullptr.
2527
2528 2019-02-01  Jer Noble  <jer.noble@apple.com>
2529
2530         Make the WebKit default for media source based on the WebCore default.
2531         https://bugs.webkit.org/show_bug.cgi?id=194172
2532
2533         Reviewed by Eric Carlson.
2534
2535         * page/SettingsBase.h:
2536
2537 2019-02-01  Joseph Pecoraro  <pecoraro@apple.com>
2538
2539         Web Inspector: Memory timeline starts from zero when both CPU and Memory timeline are enabled
2540         https://bugs.webkit.org/show_bug.cgi?id=194111
2541         <rdar://problem/47714555>
2542
2543         Rubber-stamped by Devin Rousso.
2544
2545         * page/ResourceUsageThread.cpp:
2546         (WebCore::ResourceUsageThread::waitUntilObservers):
2547         (WebCore::ResourceUsageThread::threadBody):
2548         Wait a short period of time before the first listener registers
2549         and we start sampling. This will allow multiple listeners to
2550         register, each that wants different data.
2551
2552 2019-02-01  Antti Koivisto  <antti@apple.com>
2553
2554         Don't use base layer() as the scroll layer in scrolling tree.
2555         https://bugs.webkit.org/show_bug.cgi?id=194160
2556
2557         Reviewed by Simon Fraser.
2558
2559         Maintain scrollContainerLayer() and scrolledContentsLayer() separately in ScrollingTreeScrollingNode.
2560
2561         * page/scrolling/AsyncScrollingCoordinator.cpp:
2562         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
2563         (WebCore::AsyncScrollingCoordinator::setNodeLayers):
2564         * page/scrolling/AsyncScrollingCoordinator.h:
2565         * page/scrolling/ScrollingCoordinator.h:
2566         (WebCore::ScrollingCoordinator::setNodeLayers):
2567
2568         Turn the long layer parameter list into a struct.
2569
2570         * page/scrolling/ScrollingStateNode.cpp:
2571         (WebCore::ScrollingStateNode::ScrollingStateNode):
2572         (WebCore::ScrollingStateNode::setAllPropertiesChanged):
2573         (WebCore::ScrollingStateNode::setLayer):
2574         * page/scrolling/ScrollingStateNode.h:
2575         * page/scrolling/ScrollingStateScrollingNode.cpp:
2576         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
2577         (WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
2578         (WebCore::ScrollingStateScrollingNode::setScrollContainerLayer):
2579         (WebCore::ScrollingStateScrollingNode::dumpProperties const):
2580         * page/scrolling/ScrollingStateScrollingNode.h:
2581         (WebCore::ScrollingStateScrollingNode::scrollContainerLayer const):
2582         * page/scrolling/ScrollingTree.cpp:
2583         (WebCore::ScrollingTree::commitTreeState):
2584         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2585         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
2586         * page/scrolling/ScrollingTreeScrollingNode.h:
2587         (WebCore::ScrollingTreeScrollingNode::scrollContainerLayer const):
2588         (WebCore::ScrollingTreeScrollingNode::scrolledContentsLayer const):
2589         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
2590         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
2591         (WebCore::ScrollingTreeFrameScrollingNodeIOS::commitStateBeforeChildren):
2592         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollPosition const):
2593         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollLayerPosition):
2594         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollLayer const): Deleted.
2595         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
2596         (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
2597         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2598         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2599         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
2600         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
2601         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const):
2602         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
2603         (WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea const):
2604         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
2605         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2606         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
2607         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const):
2608         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
2609         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
2610         (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
2611         * rendering/RenderLayerCompositor.cpp:
2612         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
2613         (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
2614         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
2615         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
2616
2617 2019-02-01  Simon Fraser  <simon.fraser@apple.com>
2618
2619         REGRESSION (r240698): fast/scrolling/sticky-to-fixed.html can cause a crash
2620         https://bugs.webkit.org/show_bug.cgi?id=194134
2621         rdar://problem/47721210
2622
2623         Reviewed by Daniel Bates.
2624
2625         fast/scrolling/sticky-to-fixed.html changes the scrolling node type, which causes
2626         scrollingCoordinator->insertNode() to return a different ScrollingNodeID to the one
2627         passed in. We have to handle this, removing the node for the nodeID and unregistering
2628         the layer with the old nodeID.
2629
2630         * rendering/RenderLayerCompositor.cpp:
2631         (WebCore::RenderLayerCompositor::attachScrollingNode):
2632
2633 2019-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2634
2635         REGRESSION(r239915): css3/font-feature-font-face-local.html failing on WPE
2636         https://bugs.webkit.org/show_bug.cgi?id=194008
2637
2638         Reviewed by Žan Doberšek.
2639
2640         We need to replace control characters with zero width space too.
2641
2642         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
2643         (WebCore::GlyphPage::fill):
2644         * platform/text/CharacterProperties.h:
2645         (WebCore::isControlCharacter):
2646
2647 2019-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2648
2649         ComplexText: Test fast/text/word-space-nbsp.html fails when using complex text path
2650         https://bugs.webkit.org/show_bug.cgi?id=193279
2651
2652         Reviewed by Michael Catanzaro.
2653
2654         The fix applied in r135884 to WidthIterator should also be applied to ComplexTextController.
2655
2656         * platform/graphics/ComplexTextController.cpp:
2657         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
2658
2659 2019-02-01  Zalan Bujtas  <zalan@apple.com>
2660
2661         [LFC] Adjust replaced element's intrinsic ratio
2662         https://bugs.webkit.org/show_bug.cgi?id=194154
2663
2664         Reviewed by Antti Koivisto.
2665
2666         Decouple image and iframe replaced types and set intrinsic ratio accordingly.
2667
2668         * layout/layouttree/LayoutBox.cpp:
2669         (WebCore::Layout::Box::Box):
2670         * layout/layouttree/LayoutBox.h:
2671         (WebCore::Layout::Box::isReplaced const):
2672         (WebCore::Layout::Box::isIFrame const):
2673         (WebCore::Layout::Box::isImage const):
2674         * layout/layouttree/LayoutReplaced.cpp:
2675         (WebCore::Layout::Replaced::hasIntrinsicRatio const):
2676         (WebCore::Layout::Replaced::intrinsicRatio const):
2677         (WebCore::Layout::Replaced::hasAspectRatio const):
2678         * layout/layouttree/LayoutReplaced.h:
2679         * layout/layouttree/LayoutTreeBuilder.cpp:
2680         (WebCore::Layout::TreeBuilder::createSubTree):
2681
2682 2019-02-01  Zalan Bujtas  <zalan@apple.com>
2683
2684         [LFC] Set intrinsic size on Layout::Replaced
2685         https://bugs.webkit.org/show_bug.cgi?id=194139
2686
2687         Reviewed by Antti Koivisto.
2688
2689         Eventually Layout::Replaced will track intrinsic size internally until then let's query the RenderReplaced. 
2690
2691         * layout/layouttree/LayoutBox.h:
2692         (WebCore::Layout::Box::replaced):
2693         * layout/layouttree/LayoutReplaced.cpp:
2694         (WebCore::Layout::Replaced::hasIntrinsicWidth const):
2695         (WebCore::Layout::Replaced::hasIntrinsicHeight const):
2696         (WebCore::Layout::Replaced::intrinsicWidth const):
2697         (WebCore::Layout::Replaced::intrinsicHeight const):
2698         * layout/layouttree/LayoutReplaced.h:
2699         (WebCore::Layout::Replaced::setIntrinsicSize):
2700         (WebCore::Layout::Replaced::setIntrinsicRatio):
2701         * layout/layouttree/LayoutTreeBuilder.cpp:
2702         (WebCore::Layout::TreeBuilder::createSubTree):
2703         * rendering/RenderReplaced.h:
2704
2705 2019-02-01  Claudio Saavedra  <csaavedra@igalia.com>
2706
2707         Race-condition during scrolling thread creation
2708         https://bugs.webkit.org/show_bug.cgi?id=194016
2709
2710         Reviewed by Saam Barati.
2711
2712         There is a threading issue during the initialization
2713         of the scrolling thread caused by createThreadIfNeeded
2714         locking only on the creation of the thread but not on
2715         the initialization of the main loop, making it possible
2716         for a thread to try to spin the main loop before it's
2717         created.
2718
2719         Fix this by unconditionally waiting on the main loop
2720         being created. This makes it necessary to always hold
2721         the lock, even when the thread is already created.
2722
2723         * page/scrolling/ScrollingThread.cpp:
2724         (WebCore::ScrollingThread::createThreadIfNeeded):
2725
2726 2019-02-01  Simon Fraser  <simon.fraser@apple.com>
2727
2728         Use ScrollingNodeID in more places, and improve the name of a ScrollableArea function that returns a ScrollingNodeID
2729         https://bugs.webkit.org/show_bug.cgi?id=194126
2730
2731         Reviewed by Frédéric Wang.
2732         
2733         Change uint64_t ScrollableArea::scrollLayerID() to ScrollingNodeID ScrollableArea::scrollingNodeID()
2734         and fix callers.
2735
2736         * page/FrameView.cpp:
2737         (WebCore::FrameView::scrollingNodeID const):
2738         (WebCore::FrameView::scrollLayerID const): Deleted.
2739         * page/FrameView.h:
2740         * page/scrolling/AsyncScrollingCoordinator.cpp:
2741         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
2742         (WebCore::AsyncScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView):
2743         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
2744         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
2745         (WebCore::AsyncScrollingCoordinator::frameViewForScrollingNode const):
2746         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
2747         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
2748         (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
2749         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
2750         (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
2751         (WebCore::AsyncScrollingCoordinator::setActiveScrollSnapIndices):
2752         (WebCore::AsyncScrollingCoordinator::updateScrollSnapPropertiesWithFrameView):
2753         * page/scrolling/ScrollingCoordinatorTypes.h:
2754         * platform/ScrollTypes.h:
2755         * platform/ScrollableArea.h:
2756         (WebCore::ScrollableArea::scrollingNodeID const):
2757         (WebCore::ScrollableArea::scrollLayerID const): Deleted.
2758         * rendering/RenderLayerCompositor.cpp:
2759         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
2760         (WebCore::RenderLayerCompositor::detachRootLayer):
2761
2762 2019-01-31  Myles C. Maxfield  <mmaxfield@apple.com>
2763
2764         [WHLSL] Expressions can't be copyable
2765         https://bugs.webkit.org/show_bug.cgi?id=194116
2766
2767         Reviewed by Keith Rollin.
2768
2769         Expressions have UniqueRef members, which can't be copied. Describe this constraint explicitly rather than implicitly.
2770
2771         No new tests because there is no behavior change.
2772
2773         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
2774         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
2775
2776 2019-01-31  Takashi Komori  <Takashi.Komori@sony.com>
2777
2778         [Curl] Remove unnecessary member from NetworkStorageSession.
2779         https://bugs.webkit.org/show_bug.cgi?id=194137
2780
2781         Reviewed by Don Olmstead.
2782
2783         No new tests since there is no behavior change.
2784
2785         * platform/network/NetworkStorageSession.h:
2786         * platform/network/curl/NetworkStorageSessionCurl.cpp:
2787         (WebCore::NetworkStorageSession::NetworkStorageSession):
2788         (WebCore::NetworkStorageSession::context const): Deleted.
2789
2790 2019-01-31  Jer Noble  <jer.noble@apple.com>
2791
2792         NSInvalidArgumentException in [WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]
2793         https://bugs.webkit.org/show_bug.cgi?id=194123
2794         <rdar://problem/47721094>
2795
2796         Reviewed by Eric Carlson.
2797
2798         According to crash logs, AVSampleBufferDisplayLayer.error can go from an NSError* to nil; when such a change is KVO'd,
2799         the NSKeyValueChangeNewKey is a NSNull. Detect this state and bail out early.
2800
2801         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2802         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
2803
2804 2019-01-31  Jer Noble  <jer.noble@apple.com>
2805
2806         [Cocoa][EME] AirPlaying a FairPlay-protected HLS stream fails to decrypt
2807         https://bugs.webkit.org/show_bug.cgi?id=194114
2808
2809         Reviewed by Eric Carlson.
2810
2811         The AVAssetResourceLoaderDelegate must explicitly... delegate responsibility for FairPlay key
2812         requests to the AVContentKeySession.
2813
2814         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2815         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
2816
2817 2019-01-31  Megan Gardner  <megan_gardner@apple.com>
2818
2819         Don't insert spaces at the beginning of a newline when using smart-copy-paste
2820         https://bugs.webkit.org/show_bug.cgi?id=194070
2821
2822         Reviewed by Tim Horton.
2823
2824         If our inserted content end is at the beginning of a paragraph, do not insert a space.
2825         Also, if our inserted content beginning is at the end of a paragraph, do not insert a space.
2826
2827         Test: editing/pasteboard/mac/copy-smartpaste-first-line-in-textarea.html
2828
2829         * editing/ReplaceSelectionCommand.cpp:
2830         (WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
2831
2832 2019-01-31  Justin Fan  <justin_fan@apple.com>
2833
2834         [WebGPU] Build fix: disable MTLCopyAllDevices call on non-Mac platforms
2835         https://bugs.webkit.org/show_bug.cgi?id=194120
2836
2837         Unreviewed build fix. 
2838
2839         No new tests; no change in behavior.
2840
2841         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
2842         (WebCore::GPUDevice::create): Wrap problem code in #if PLATFORM(MAC).
2843
2844 2019-01-31  Simon Fraser  <simon.fraser@apple.com>
2845
2846         Basic scrollability for async overflow scrolling on macOS
2847         https://bugs.webkit.org/show_bug.cgi?id=194093
2848
2849         Reviewed by Antti Koivisto.
2850
2851         Give a ScrollingTreeOverflowScrollingNodeMac a ScrollingTreeScrollingNodeDelegateMac and have it keep track
2852         of its layers so basic scrolling works for async overflow scroll.
2853
2854         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
2855         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2856         (WebCore::ScrollingTreeOverflowScrollingNodeMac::create):
2857         (WebCore::ScrollingTreeOverflowScrollingNodeMac::ScrollingTreeOverflowScrollingNodeMac):
2858         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
2859         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
2860         (WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent):
2861         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const):
2862         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition):
2863         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
2864         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
2865         * rendering/RenderLayerBacking.cpp:
2866         (WebCore::RenderLayerBacking::updateScrollingLayers):
2867
2868 2019-01-31  Simon Fraser  <simon.fraser@apple.com>
2869
2870         Generalize ScrollingTreeScrollingNodeDelegate for use in macOS too, add a macOS subclass for frame/overflow scrolling
2871         https://bugs.webkit.org/show_bug.cgi?id=194080
2872
2873         Reviewed by Antti Koivisto.
2874
2875         To share code between ScrollingTreeFrameScrollingNodeMac and ScrollingTreeOverflowScrollingNodeMac, build ScrollingTreeScrollingNodeDelegate
2876         for macOS too, and add some helper functions to ScrollingTreeScrollingNodeDelegate.
2877
2878         Add a macOS subclass, ScrollingTreeScrollingNodeDelegateMac, which takes over the basic scrolling, rubber-banding
2879         and scroll snapping functionality from ScrollingTreeFrameScrollingNodeMac. The delegate owns the ScrollController and
2880         implements ScrollControllerClient.
2881
2882         ScrollingTreeFrameScrollingNodeMac now owns a ScrollingTreeScrollingNodeDelegateMac. A future patch
2883         will add one to ScrollingTreeOverflowScrollingNodeMac.
2884
2885         No behavior change.
2886
2887         * SourcesCocoa.txt:
2888         * WebCore.xcodeproj/project.pbxproj:
2889         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2890         (WebCore::ScrollingTreeFrameScrollingNode::scrollBy): Deleted.
2891         (WebCore::ScrollingTreeFrameScrollingNode::scrollByWithoutContentEdgeConstraints): Deleted.
2892         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2893         (WebCore::ScrollingTreeFrameScrollingNode::frameScaleFactor const):
2894         * page/scrolling/ScrollingTreeNode.cpp:
2895         (WebCore::ScrollingTreeNode::isRootNode const):
2896         * page/scrolling/ScrollingTreeNode.h:
2897         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2898         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
2899         (WebCore::ScrollingTreeScrollingNode::scrollBy):
2900         (WebCore::ScrollingTreeScrollingNode::scrollByWithoutContentEdgeConstraints):
2901         * page/scrolling/ScrollingTreeScrollingNode.h:
2902         (WebCore::ScrollingTreeScrollingNode::expectsWheelEventTestTrigger const):
2903         * page/scrolling/ScrollingTreeScrollingNodeDelegate.cpp:
2904         * page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
2905         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollPosition const):
2906         (WebCore::ScrollingTreeScrollingNodeDelegate::minimumScrollPosition const):
2907         (WebCore::ScrollingTreeScrollingNodeDelegate::maximumScrollPosition const):
2908         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollableAreaSize const):
2909         (WebCore::ScrollingTreeScrollingNodeDelegate::totalContentsSize const):
2910         (WebCore::ScrollingTreeScrollingNodeDelegate::hasEnabledHorizontalScrollbar const):
2911         (WebCore::ScrollingTreeScrollingNodeDelegate::hasEnabledVerticalScrollbar const):
2912         (WebCore::ScrollingTreeScrollingNodeDelegate::horizontalScrollElasticity const):
2913         (WebCore::ScrollingTreeScrollingNodeDelegate::verticalScrollElasticity const):
2914         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2915         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2916         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
2917         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
2918         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
2919         (WebCore::ScrollingTreeFrameScrollingNodeMac::minimumScrollPosition const):
2920         (WebCore::ScrollingTreeFrameScrollingNodeMac::maximumScrollPosition const):
2921         (WebCore::newGestureIsStarting): Deleted.
2922         (WebCore::ScrollingTreeFrameScrollingNodeMac::isAlreadyPinnedInDirectionOfGesture): Deleted.
2923         (WebCore::ScrollingTreeFrameScrollingNodeMac::allowsHorizontalStretching): Deleted.
2924         (WebCore::ScrollingTreeFrameScrollingNodeMac::allowsVerticalStretching): Deleted.
2925         (WebCore::ScrollingTreeFrameScrollingNodeMac::stretchAmount): Deleted.
2926         (WebCore::ScrollingTreeFrameScrollingNodeMac::pinnedInDirection): Deleted.
2927         (WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollHorizontally): Deleted.
2928         (WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollVertically): Deleted.
2929         (WebCore::ScrollingTreeFrameScrollingNodeMac::shouldRubberBandInDirection): Deleted.
2930         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollBy): Deleted.
2931         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollByWithoutContentEdgeConstraints): Deleted.
2932         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer): Deleted.
2933         (WebCore::ScrollingTreeFrameScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary): Deleted.
2934         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffset const): Deleted.
2935         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Deleted.
2936         (WebCore::ScrollingTreeFrameScrollingNodeMac::pageScaleFactor const): Deleted.
2937         (WebCore::ScrollingTreeFrameScrollingNodeMac::startScrollSnapTimer): Deleted.
2938         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopScrollSnapTimer): Deleted.
2939         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollExtent const): Deleted.
2940         (WebCore::ScrollingTreeFrameScrollingNodeMac::viewportSize const): Deleted.
2941         (WebCore::ScrollingTreeFrameScrollingNodeMac::deferTestsForReason const): Deleted.
2942         (WebCore::ScrollingTreeFrameScrollingNodeMac::removeTestDeferralForReason const): Deleted.
2943         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h.
2944         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: Added.
2945         (WebCore::ScrollingTreeScrollingNodeDelegateMac::ScrollingTreeScrollingNodeDelegateMac):
2946         (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateScrollSnapPoints):
2947         (WebCore::ScrollingTreeScrollingNodeDelegateMac::setActiveScrollSnapIndexForAxis):
2948         (WebCore::ScrollingTreeScrollingNodeDelegateMac::activeScrollSnapIndexForAxis const):
2949         (WebCore::ScrollingTreeScrollingNodeDelegateMac::activeScrollSnapIndexDidChange const):
2950         (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
2951         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isScrollSnapInProgress const):
2952         (WebCore::newGestureIsStarting):
2953         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture):
2954         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsHorizontalStretching):
2955         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsVerticalStretching):
2956         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
2957         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection):
2958         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollHorizontally):
2959         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollVertically):
2960         (WebCore::ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection):
2961         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollBy):
2962         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollByWithoutContentEdgeConstraints):
2963         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stopSnapRubberbandTimer):
2964         (WebCore::ScrollingTreeScrollingNodeDelegateMac::adjustScrollPositionToBoundsIfNecessary):
2965         (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const):
2966         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollOnAxis):
2967         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pageScaleFactor const):
2968         (WebCore::ScrollingTreeScrollingNodeDelegateMac::startScrollSnapTimer):
2969         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stopScrollSnapTimer):
2970         (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollExtent const):
2971         (WebCore::ScrollingTreeScrollingNodeDelegateMac::viewportSize const):
2972         (WebCore::ScrollingTreeScrollingNodeDelegateMac::deferTestsForReason const):
2973         (WebCore::ScrollingTreeScrollingNodeDelegateMac::removeTestDeferralForReason const):
2974
2975 2019-01-31  Jer Noble  <jer.noble@apple.com>
2976
2977         [Mac] Requesting PiP from two different WebViews gets PiP window "stuck"
2978         https://bugs.webkit.org/show_bug.cgi?id=194099
2979         <rdar://problem/47271323>
2980
2981         Reviewed by Eric Carlson.
2982
2983         When a different client requests the PiP window, the PiP framework will call -pipDidClose: without
2984         first calling -pipActionStop:. This leaves the internal fullscreen state in a confused state where
2985         the WebView will attempt to re-enter PiP once it gets focus, and can lead to a state where the two
2986         WebViews will constantly try to steal PiP from one another, ad infinitum.
2987
2988         When receiving a notification that the PiP window closed when our internal state tells us that the
2989         close was not requested, notify the client that PiP mode was exited, allowing them to set their
2990         expected state to a correct and sane value.
2991
2992         * platform/mac/VideoFullscreenInterfaceMac.mm:
2993         (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
2994
2995 2019-01-31  Keith Rollin  <krollin@apple.com>
2996
2997         WebCore::WHLSL::AST::Expression copy constructor needs to be be default, not delete
2998         https://bugs.webkit.org/show_bug.cgi?id=194055
2999         <rdar://problem/47684570>
3000
3001         Reviewed by Myles C. Maxfield.
3002
3003         WebCore::WHLSL::AST::Expression has a deleted copy constructor.
3004         EnumerationMemberLiteral, a subclass, has a default copy constructor.
3005         Some compilers may complain that the latter's c'tor can't access the
3006         former's, because it doesn't exist. Fix this by marking Expression's
3007         c'tor as default.
3008
3009         No new tests since there should be no observable behavior difference.
3010
3011         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
3012
3013 2019-01-31  Alex Christensen  <achristensen@webkit.org>
3014
3015         Revert r238819 which is unneeded and caused a performance regression.
3016         https://bugs.webkit.org/show_bug.cgi?id=192272
3017         <rdar://problem/46664625>
3018
3019         * loader/EmptyFrameLoaderClient.h:
3020         * loader/FrameLoader.cpp:
3021         (WebCore::FrameLoader::prepareForLoadStart):
3022         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
3023         (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
3024         * loader/FrameLoader.h:
3025         * loader/FrameLoaderClient.h:
3026
3027 2019-01-31  Justin Fan  <justin_fan@apple.com>
3028
3029         [WebGPU] WebGPUAdapterDescriptor -> GPURequestAdapterOptions and take powerPreference into account
3030         https://bugs.webkit.org/show_bug.cgi?id=194068
3031         <rdar://problem/47680215>
3032
3033         Reviewed by Dean Jackson.
3034         
3035         Per the Web GPU IDL, WebGPUAdapterDescriptor is now known as GPURequestAdapterOptions and is optional.
3036         In addition, Web GPU now actually attempts to return an integrated GPU when a low-power adapter is requested.
3037
3038         Test: adapter-options.html
3039
3040         * Modules/webgpu/GPURequestAdapterOptions.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUAdapterDescriptor.idl.
3041         * Modules/webgpu/WebGPU.cpp:
3042         (WebCore::WebGPU::requestAdapter const):
3043         * Modules/webgpu/WebGPU.h:
3044         * Modules/webgpu/WebGPU.idl:
3045         * Modules/webgpu/WebGPUAdapter.cpp:
3046         (WebCore::WebGPUAdapter::create):
3047         (WebCore::WebGPUAdapter::WebGPUAdapter):
3048         * Modules/webgpu/WebGPUAdapter.h:
3049         (WebCore::WebGPUAdapter::options const):
3050         * Modules/webgpu/WebGPUDevice.cpp:
3051         (WebCore::WebGPUDevice::create):
3052         * platform/graphics/gpu/GPUDevice.h:
3053         * platform/graphics/gpu/GPURequestAdapterOptions.h: Renamed from Source/WebCore/Modules/webgpu/WebGPUAdapterDescriptor.h.
3054         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
3055         (WebCore::GPUDevice::create):
3056
3057 2019-01-31  Jiewen Tan  <jiewen_tan@apple.com>
3058
3059         Formalize WebKitAdditions mechanism of LoadOptimizer
3060         https://bugs.webkit.org/show_bug.cgi?id=193886
3061         <rdar://problem/47696809>
3062
3063         Reviewed by Brent Fulgham.
3064
3065         Covered by existing tests.
3066
3067         * platform/network/ResourceRequestBase.h:
3068         Export isolatedCopy().
3069
3070 2019-01-31  Jer Noble  <jer.noble@apple.com>
3071
3072         [Cocoa][EME] Modern EME uses a different path for SecureStop data than Legacy EME
3073         https://bugs.webkit.org/show_bug.cgi?id=193988
3074
3075         Reviewed by Jon Lee.
3076
3077         Modern EME is writing SecureStop data as a file at the same path as the
3078         directory used by Legacy EME; meaning, when Modern EME attempts to write
3079         to that file, it will fail because a directory exists at the same path.
3080
3081         Add a migration step to take care of those instances where Modern EME Secure
3082         Stop data was already written to disk, and move that previously written data
3083         to the correct file path.
3084
3085         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
3086         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
3087         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
3088         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setStorageDirectory):
3089         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
3090         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
3091         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
3092         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
3093
3094 2019-01-31  Antti Koivisto  <antti@apple.com>
3095
3096         Call the frame main contents layer "rootContentsLayer" consistently.
3097         https://bugs.webkit.org/show_bug.cgi?id=194089
3098
3099         Reviewed by Simon Fraser.
3100
3101         This is currently called "rootContentLayer" in the compositor and "scrolledContentsLayer" in the scrolling tree.
3102         We want to reserve term "scrolledContentsLayer" to mean the direct child layer of the  scroll container layer
3103         without any positioning oddities (which this isn't).
3104
3105         * page/scrolling/AsyncScrollingCoordinator.cpp:
3106         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
3107         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
3108         (WebCore::AsyncScrollingCoordinator::setNodeLayers):
3109
3110         Set the rootContentsLayer for frame. It is only used by the Mac frame scrolling code.
3111
3112         * page/scrolling/AsyncScrollingCoordinator.h:
3113         * page/scrolling/ScrollingCoordinator.cpp:
3114         (WebCore::ScrollingCoordinator::rootContentsLayerForFrameView):
3115         (WebCore::ScrollingCoordinator::rootContentLayerForFrameView): Deleted.
3116         * page/scrolling/ScrollingCoordinator.h:
3117         (WebCore::ScrollingCoordinator::setNodeLayers):
3118         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
3119         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
3120         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
3121         (WebCore::ScrollingStateFrameScrollingNode::setRootContentsLayer):
3122         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
3123         * page/scrolling/ScrollingStateFrameScrollingNode.h:
3124
3125         Introduce rootContentLayer for frames only.
3126
3127         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
3128         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3129         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
3130         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
3131
3132         Switch to using rootContentsLayer.
3133
3134         * rendering/RenderLayerCompositor.cpp:
3135         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
3136         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3137         (WebCore::RenderLayerCompositor::updateRootContentLayerClipping):
3138         (WebCore::RenderLayerCompositor::layerTreeAsText):
3139         (WebCore::RenderLayerCompositor::rootGraphicsLayer const):
3140         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
3141         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
3142         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
3143         (WebCore::RenderLayerCompositor::updateLayerForHeader):
3144         (WebCore::RenderLayerCompositor::updateLayerForFooter):
3145         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
3146         (WebCore::RenderLayerCompositor::ensureRootLayer):
3147         (WebCore::RenderLayerCompositor::destroyRootLayer):
3148         (WebCore::RenderLayerCompositor::attachRootLayer):
3149         (WebCore::RenderLayerCompositor::detachRootLayer):
3150         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
3151         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
3152
3153         Pass rootContentsLayer separately for frames only.
3154         Pass null as frame scrolledContentsLayer until these are rearranged (it is not used).
3155
3156         * rendering/RenderLayerCompositor.h:
3157
3158 2019-01-31  Keith Rollin  <krollin@apple.com>
3159
3160         GCGamepad is deprecated
3161         https://bugs.webkit.org/show_bug.cgi?id=194056
3162         <rdar://problem/47685010>
3163
3164         Reviewed by Brady Eidson.
3165
3166         GCGamepad is deprecated, resulting in compiler warnings. Address this
3167         for now by employing ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
3168
3169         No new tests since there should be no observable behavior difference.
3170
3171         * platform/gamepad/cocoa/GameControllerGamepad.mm:
3172         (WebCore::GameControllerGamepad::setupAsGamepad):
3173
3174 2019-01-31  Darin Adler  <darin@apple.com>
3175
3176         Simplify and streamline code that creates an appropriate document based on MIME type
3177         https://bugs.webkit.org/show_bug.cgi?id=193756
3178
3179         Reviewed by Chris Dumez.
3180
3181         * dom/DOMImplementation.cpp:
3182         (WebCore::DOMImplementation::createDocument): Use equalLettersIgnoringASCIICase rather
3183         than == for all the MIME type checks. Use MIMETypeRegistry::isSupportedImageMIMEType
3184         instead of Image::supportsType. Rearranged checks so that all the combinations that
3185         that take precedence over plug-ins are checked first, fixing some unimportant edge
3186         cases where the plug-in database is initialized and doesn't need to be. Straightened
3187         out the logic for various special types so that the checks are more independent from
3188         each other and hence easier to understand.
3189
3190 2019-01-31  Alicia Boya García  <aboya@igalia.com>
3191
3192         [MSE][GStreamer] Unreviewed debug build fix, obsolete assert
3193
3194         Since m_playerPrivate is now a reference, it no longer has a default
3195         cast to bool. But there is also no longer a need to assert it's non
3196         null, so just remove the assert.
3197
3198         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
3199         (WebCore::MediaSourceClientGStreamerMSE::append):
3200
3201 2019-01-31  Alicia Boya García  <aboya@igalia.com>
3202
3203         [MSE][GStreamer] Use reference instead of pointer in m_playerPrivate
3204         https://bugs.webkit.org/show_bug.cgi?id=194091
3205
3206         Reviewed by Xabier Rodriguez-Calvar.
3207
3208         Since the pointer is initialized with the class, it's never null and
3209         never changes, it's preferrable to use a reference instead of a
3210         pointer.
3211
3212         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
3213         (WebCore::MediaSourceClientGStreamerMSE::MediaSourceClientGStreamerMSE):
3214         (WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
3215         (WebCore::MediaSourceClientGStreamerMSE::durationChanged):
3216         (WebCore::MediaSourceClientGStreamerMSE::abort):
3217         (WebCore::MediaSourceClientGStreamerMSE::resetParserState):
3218         (WebCore::MediaSourceClientGStreamerMSE::append):
3219         (WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
3220         (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
3221         (WebCore::MediaSourceClientGStreamerMSE::flush):
3222         (WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
3223         (WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
3224         (WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc):
3225         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
3226
3227 2019-01-31  Alexander Mikhaylenko  <exalm7659@gmail.com>
3228
3229         [GTK] Momentum scrolling stops abruptly before websites end
3230         https://bugs.webkit.org/show_bug.cgi?id=193350
3231
3232         Reviewed by Carlos Garcia Campos.
3233
3234         Don't immediately set velocity to 0 when position reaches upper or bottom limit.
3235         Instead, set it to the overshot distance, so that position exactly matches upper
3236         or lower limit on the next frame, and then clamp velocity to 0 using the existing
3237         mechanism.
3238
3239         * platform/ScrollAnimationKinetic.cpp:
3240         (WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll):
3241
3242 2019-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
3243
3244         Unreviewed, fix incorrect string format
3245         https://bugs.webkit.org/show_bug.cgi?id=193907
3246         <rdar://problem/47604080>
3247
3248         * page/scrolling/ScrollingTree.cpp:
3249         (WebCore::ScrollingTree::commitTreeState):
3250
3251 2019-01-30  Simon Fraser  <simon.fraser@apple.com>
3252
3253         [Mac] Implement basic hit testing in the scrolling tree
3254         https://bugs.webkit.org/show_bug.cgi?id=172917
3255         <rdar://problem/34215516>
3256
3257         Reviewed by Antti Koivisto.
3258
3259         First steps to getting hit testing of scrolling nodes in the scrolling tree. Based on patch
3260         by Frédéric Wang.
3261
3262         First we pipe the "async scrolling enabled" setting through to the ScrollingTree via
3263         the root node (like the other settings; weird, but that's how it's done). For now,
3264         we hit test in the scrolling tree if either async overflow or frame scrolling are enabled
3265         (it's hard to deal with one without the other).
3266
3267         Nodes in the scrolling tree implement scrollingNodeForPoint() to implement hit testing.
3268         Two helper functions exist to simplify coordinate conversion: parentToLocalPoint()
3269         and localToContentsPoint(). Child nodes are hit-testing in reverse order to find nodes
3270         hightest in Z first. Only scrolling nodes are returned (not sure if we'll ever need
3271         to hit-test non-scrolling nodes). Nodes use parentRelativeScrollableRect and scroll positions
3272         to do these point mappings.
3273
3274         handleWheelEvent() is changed to return a ScrollingEventResult.
3275
3276         Latching is not correct with this change when async frame scrolling is enabled. That needs
3277         to be fixed separately.
3278
3279         No tests yet; for ease of testing, I'd like to add an Internals API to hit-test the
3280         scrolling tree, rather than doing eventSender stuff everywhere.
3281
3282         * page/scrolling/AsyncScrollingCoordinator.cpp:
3283         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
3284         (WebCore::AsyncScrollingCoordinator::asyncFrameOrOverflowScrollingEnabled const):
3285         * page/scrolling/AsyncScrollingCoordinator.h:
3286         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
3287         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
3288         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
3289         (WebCore::ScrollingStateFrameScrollingNode::setAsyncFrameOrOverflowScrollingEnabled):
3290         * page/scrolling/ScrollingStateFrameScrollingNode.h:
3291         * page/scrolling/ScrollingTree.cpp:
3292         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
3293         (WebCore::ScrollingTree::handleWheelEvent):
3294         (WebCore::ScrollingTree::commitTreeState):
3295         (WebCore::ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled):
3296         * page/scrolling/ScrollingTree.h:
3297         (WebCore::ScrollingTree::asyncFrameOrOverflowScrollingEnabled const):
3298         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
3299         (WebCore::ScrollingTreeFrameHostingNode::parentToLocalPoint const):
3300         * page/scrolling/ScrollingTreeFrameHostingNode.h:
3301         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
3302         (WebCore::ScrollingTreeFrameScrollingNode::parentToLocalPoint const):
3303         (WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const):
3304         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
3305         * page/scrolling/ScrollingTreeNode.cpp:
3306         (WebCore::ScrollingTreeNode::scrollingNodeForPoint const):
3307         * page/scrolling/ScrollingTreeNode.h:
3308         (WebCore::ScrollingTreeNode::children const):
3309         (WebCore::ScrollingTreeNode::parentToLocalPoint const):
3310         (WebCore::ScrollingTreeNode::localToContentsPoint const):
3311         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3312         (WebCore::ScrollingTreeScrollingNode::scrollLimitReached const):
3313         (WebCore::ScrollingTreeScrollingNode::parentToLocalPoint const):
3314         (WebCore::ScrollingTreeScrollingNode::localToContentsPoint const):
3315         (WebCore::ScrollingTreeScrollingNode::scrollingNodeForPoint const):
3316         * page/scrolling/ScrollingTreeScrollingNode.h:
3317         * page/scrolling/ThreadedScrollingTree.cpp:
3318         (WebCore::ThreadedScrollingTree::handleWheelEvent):
3319         * page/scrolling/ThreadedScrollingTree.h:
3320         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
3321         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
3322         (WebCore::ScrollingTreeFrameScrollingNodeIOS::handleWheelEvent):
3323         * page/scrolling/ios/ScrollingTreeIOS.h:
3324         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
3325         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3326         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
3327         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
3328
3329 2019-01-31  Alicia Boya García  <aboya@igalia.com>
3330
3331         [MSE][GStreamer] Remove unused GstFlowReturn in AppendPipeline methods
3332         https://bugs.webkit.org/show_bug.cgi?id=194067
3333
3334         Reviewed by Xabier Rodriguez-Calvar.
3335
3336         A couple methods in AppendPipeline were returning GstFlowReturn
3337         despite there being no codepath (sans assertions) where values other
3338         than GST_FLOW_OK are returned.
3339
3340         Therefore, it makes sense to just make these methods return void.
3341
3342         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3343         (WebCore::AppendPipeline::pushNewBuffer):
3344         (WebCore::AppendPipeline::handleAppsinkNewSampleFromStreamingThread):
3345         * platform/graphics/gstreamer/mse/AppendPipeline.h:
3346         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
3347         (WebCore::MediaSourceClientGStreamerMSE::append):
3348         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
3349         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
3350         (WebCore::SourceBufferPrivateGStreamer::append):
3351
3352 2019-01-31  Alicia Boya García  <aboya@igalia.com>
3353
3354         [MSE][GStreamer] Remove if (m_playerPrivate) from MediaSourceClientGStreamerMSE
3355         https://bugs.webkit.org/show_bug.cgi?id=194069
3356
3357         Reviewed by Xabier Rodriguez-Calvar.
3358
3359         m_playerPrivate is non-NULL since MediaSourceClientGStreamerMSE
3360         creation well until its destruction.
3361
3362         The only case that could make a NULL m_playerPrivate is
3363         clearPlayerPrivate() but that method is not used anymore.
3364
3365         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
3366         (WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
3367         (WebCore::MediaSourceClientGStreamerMSE::durationChanged):
3368         (WebCore::MediaSourceClientGStreamerMSE::abort):
3369         (WebCore::MediaSourceClientGStreamerMSE::resetParserState):
3370         (WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
3371         (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
3372         (WebCore::MediaSourceClientGStreamerMSE::flush):
3373         (WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
3374         (WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
3375         (WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc):
3376         (WebCore::MediaSourceClientGStreamerMSE::clearPlayerPrivate): Deleted.
3377         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
3378
3379 2019-01-31  Thibault Saunier  <tsaunier@igalia.com>
3380
3381         [GStreamer][WebRTC] Avoid returning FLUSHING when it is not the case in GStreamerMediaStreamSource
3382         https://bugs.webkit.org/show_bug.cgi?id=194087
3383
3384         Basically GstFlowCombiner was mostly designed for element that have 1 sinkpad and several srcpad
3385         meaning that it makes sense that when any of the downstream pad is returning flushing, you should
3386         return FLUSHING upstream. But in our case we have several sinkpads and FLUSHING should be returned
3387         *only* if the internally linked srcpad is FLUSHING otherwise we might end up setting the upstream
3388         source element task to PAUSED (because downstream returned flushing) on a branch that was not
3389         flushing!
3390
3391         Reviewed by Philippe Normand.
3392
3393         This is a theorical race we can't really cover with tests.
3394
3395         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
3396         (WebCore::webkitMediaStreamSrcChain):
3397
3398 2019-01-31  Zalan Bujtas  <zalan@apple.com>
3399
3400         [LFC] Margin before/after/start/end initial value is 0 and not auto.
3401         https://bugs.webkit.org/show_bug.cgi?id=194090
3402
3403         Reviewed by Antti Koivisto.
3404
3405         Don't treat it like auto.
3406
3407         * layout/FormattingContextGeometry.cpp:
3408         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
3409         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
3410
3411 2019-01-31  Zalan Bujtas  <zalan@apple.com>
3412
3413         [LFC] Use the used margin values in outOfFlowReplacedHorizontalGeometry consistently
3414         https://bugs.webkit.org/show_bug.cgi?id=194074
3415
3416         Reviewed by Antti Koivisto.
3417
3418         Check the used margin variables whether we already computed start/end values.
3419
3420         Test: fast/block/block-only/absolute-position-with-margin-auto-simple2.html
3421
3422         * layout/FormattingContextGeometry.cpp:
3423         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
3424
3425 2019-01-31  Zalan Bujtas  <zalan@apple.com>
3426
3427         [LFC][BFC] Add support for block level replaced box.
3428         https://bugs.webkit.org/show_bug.cgi?id=194071
3429
3430         Reviewed by Antti Koivisto.
3431
3432         * layout/layouttree/LayoutBox.cpp:
3433         (WebCore::Layout::Box::Box):
3434         * layout/layouttree/LayoutBox.h:
3435         * layout/layouttree/LayoutTreeBuilder.cpp:
3436         (WebCore::Layout::TreeBuilder::createSubTree):
3437         (WebCore::Layout::outputLayoutBox):
3438
3439 2019-01-31  Chris Fleizach  <cfleizach@apple.com>
3440
3441         ASSERTION FAILED: cache under WebCore::AXObjectCache::postTextStateChangePlatformNotification
3442         https://bugs.webkit.org/show_bug.cgi?id=189094
3443         <rdar://problem/43853526>
3444
3445         Reviewed by Zalan Bujtas.
3446
3447         Protect against access to objects and cache's that can be removed while an object is still in memory.
3448
3449         Unskipped flaky tests on mac-wk2.
3450
3451         * accessibility/mac/AXObjectCacheMac.mm:
3452         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
3453         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3454         (textMarkerForVisiblePosition):
3455         (textMarkerRangeFromVisiblePositions):
3456
3457 2019-01-30  Chris Dumez  <cdumez@apple.com>
3458
3459         Regression(PSON) History navigations to twitter.com lead to a 403 HTTP error
3460         https://bugs.webkit.org/show_bug.cgi?id=194023
3461         <rdar://problem/47417981>
3462
3463         Reviewed by Geoffrey Garen.
3464
3465         The issue was caused by the 'isTopSite' flag not getting properly set on the network request
3466         in case of a cross-site history navigation (with process-swap). As a result, twitter.com was
3467         not getting its same-site lax cookies.
3468
3469         The 'isTopSite' flag normally gets set by FrameLoader::addExtraFieldsToRequest(), but we were
3470         bypassing this method entirely when continuing a load in a new process after a swap. This was
3471         intentional as the network request is normally already fully populated by the previous process
3472         and we do not want the new process to modify the request in any way (e.g. we would not want to
3473         add a Origin header back after it was removed by the previous process). However, in case of a
3474         History navigation, we do not actually pass a request along from one process to another. Instead,
3475         we pass a HistoryItem and then build a fresh new request from the HistoryItem in the new process.
3476         In this case, we *want* addExtraFieldsToRequest() to be called on the new request, even though
3477         we are technically continuing a load in a new process.
3478
3479         We thus address the issue by bypassing FrameLoader::addExtraFieldsToRequest() only if we're
3480         continuing a load with a request and not when we're continuing a load with a HistoryItem.
3481
3482         Test: http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php
3483
3484         * loader/FrameLoader.cpp:
3485         (WebCore::FrameLoader::load):
3486         (WebCore::FrameLoader::loadWithDocumentLoader):
3487         (WebCore::FrameLoader::addExtraFieldsToRequest):
3488         (WebCore::FrameLoader::loadDifferentDocumentItem):
3489         * loader/FrameLoader.h:
3490         (WebCore::FrameLoader::shouldTreatCurrentLoadAsContinuingLoad const):
3491
3492 2019-01-30  Justin Fan  <justin_fan@apple.com>
3493
3494         [WebGPU] Support GPUDepthStencilStateDescriptor
3495         https://bugs.webkit.org/show_bug.cgi?id=194048
3496         <rdar://problem/46289645>
3497
3498         Reviewed by Dean Jackson.
3499
3500         Implement GPUDepthStencilStateDescriptor to specify a MTLDepthStencilState that is set on the command encoder.
3501
3502         Existing tests cover changes to pipeline. Behavior does not change as DepthStencilState has no effect 
3503         without a depth texture attached.
3504
3505         New interface files added:
3506         * Modules/webgpu/GPUCompareFunction.idl:
3507         * Modules/webgpu/GPUDepthStencilStateDescriptor.idl:
3508         * platform/graphics/gpu/GPUCompareFunction.h:
3509         * platform/graphics/gpu/GPUDepthStencilStateDescriptor.h:
3510
3511         Modifications:
3512         * Modules/webgpu/WebGPUDevice.cpp: Include depthStencilState when creating pipeline.
3513         (WebCore::WebGPUDevice::createRenderPipeline const):
3514         * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Add depthStencilState to the descriptor.
3515         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Ditto.
3516         * platform/graphics/gpu/GPURenderPipeline.h: Ditto.
3517         (WebCore::GPURenderPipeline::depthStencilState const): Getter.
3518         (WebCore::GPURenderPipeline::platformRenderPipeline const):
3519         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Update constructor to take depthStencilState.
3520         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
3521         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: Setting pipeline also sets the included depthStencilState.
3522         (WebCore::GPURenderPassEncoder::setPipeline):
3523         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Convert DepthStencilStateDescriptor to MTLDepthStencilState.
3524         (WebCore::validateAndConvertDepthCompareFunctionToMtl):
3525         (WebCore::tryCreateMtlDepthStencilState):
3526         (WebCore::tryCreateMtlRenderPipelineState): Refactored logic out of GPURenderPipeline::create.
3527         (WebCore::GPURenderPipeline::create):
3528         (WebCore::GPURenderPipeline::GPURenderPipeline):
3529
3530         Added symbols for CompareFunction, DepthStencilStateDescriptor to the project:
3531         * CMakeLists.txt:
3532         * DerivedSources.make:
3533         * Sources.txt:
3534         * WebCore.xcodeproj/project.pbxproj:
3535
3536         * Modules/webgpu/WebGPUDevice.idl: Cleaned up IDL to match current version.
3537
3538 2019-01-30  Jer Noble  <jer.noble@apple.com>
3539
3540         [Cocoa][EME] persistent-usage-record data not issued after MediaKeySession.remove()
3541         https://bugs.webkit.org/show_bug.cgi?id=193984
3542
3543         Reviewed by Eric Carlson.
3544
3545         MediaKeySession.sessionId is empty during the CDMInstance->requestLicense success callback handler. The
3546         KVO notification that AVContentKeySession.contentProtectionSessionIdentifier changed isn't called until
3547         after the -[AVContentKeyRequest makeStreamingContentKeyRequestDataForApp:contentIdentifier:options:completionHandler:]
3548         completion handler is called.
3549
3550         Explicitly ask for the -contentProtectionSessionIdentifier inside that handler, and just in case the sessionID
3551         changes after that, add a new client callback method to notify the MediaKeySession that the ID has changed.
3552
3553         * Modules/encryptedmedia/MediaKeySession.cpp:
3554         (WebCore::MediaKeySession::sessionIdChanged):
3555         * Modules/encryptedmedia/MediaKeySession.h:
3556         * platform/encryptedmedia/CDMInstanceSession.h:
3557         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
3558         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
3559         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest):
3560
3561 2019-01-30  Keith Rollin  <krollin@apple.com>
3562
3563         FloatWithRect has invalid and inaccessible default constructor
3564         https://bugs.webkit.org/show_bug.cgi?id=194057
3565         <rdar://problem/47685211>
3566
3567         Reviewed by Zalan Bujtas.
3568
3569         FloatWithRect has a default constructor declared as 'default'. This
3570         constructor is invalid because FloatWithRect has a data member that's
3571         a reference that will not get initialized with this constructor. Since
3572         it's invalid, and since it's private and not accessed by anything,
3573         remove this constructor.
3574
3575         No new tests since there should be no observable behavior difference.
3576
3577         * rendering/line/LineLayoutState.h:
3578
3579 2019-01-30  Daniel Bates  <dabates@apple.com>
3580
3581         [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
3582         https://bugs.webkit.org/show_bug.cgi?id=192824
3583         <rdar://problem/47100332>
3584
3585         Reviewed by Wenson Hsieh.
3586
3587         When building with USE(UIKIT_KEYBOARD_ADDITIONS) enabled, normalize input strings for some more key codes
3588         now that hardware key events to non-editable elements use the same code path as for editable elements. 
3589
3590         * platform/ios/KeyEventIOS.mm:
3591         (WebCore::windowsKeyCodeForCharCode): Demarcate mappings that are only needed when building with
3592         !USE(UIKIT_KEYBOARD_ADDITIONS) in the hope that one day we can remove this code.
3593         (WebCore::isFunctionKey): Ditto.
3594         * platform/ios/WebEvent.mm:
3595         (normalizedStringWithAppKitCompatibilityMapping): Normalize some more input strings when building with
3596         USE(UIKIT_KEYBOARD_ADDITIONS) enabled.
3597
3598 2019-01-30  Jer Noble  <jer.noble@apple.com>
3599
3600         Ensure ENABLE_MEDIA_SOURCE is defined inside DerivedSources.make
3601         https://bugs.webkit.org/show_bug.cgi?id=194063
3602
3603         Reviewed by Jon Lee.
3604
3605         * DerivedSources.make:
3606
3607 2019-01-30  Youenn Fablet  <youenn@apple.com>
3608
3609         Refactor ServiceWorkerJob management by ServiceWorkerContainer to make it more memory safe
3610         https://bugs.webkit.org/show_bug.cgi?id=193747
3611         <rdar://problem/47498196>
3612
3613         Reviewed by Chris Dumez.
3614
3615         Make ServiceWorkerJob be no longer ref counted.
3616         Instead its lifetime is fully controlled by ServiceWorkerContainer.
3617
3618         Make sure that a failing load will remove the job from ServiceWorkerContainer job map.
3619         This allows to ensure that these jobs do not stay forever.
3620         Before the patch, the jobs map was never cleared, which is creating a ref cycle whenever a job is not succesful.
3621
3622         Before the patch, unsetPendingActivity was only called for successful jobs finishing.
3623         In case of failing loads, ServiceWorkerContainer would leak.
3624         Make sure that setPendingActivity/unsetPendingActivity is balanced by storing
3625         a pending activity in the job map next to the job.
3626
3627         When ServiceWorkerContainer is stopped, notify that all jobs are cancelled to NetworkProcess.
3628         This makes these jobs in NetworkProcess-side to not stay until the corresponding WebProcess is gone.
3629
3630         Simplify ServiceWorkerJob promise rejection handling so that it is clear when promise is rejected and when it is not.
3631         Update type of exception to be SecurityError when load fails due to AccessControl.
3632
3633         Covered by existing tests.
3634
3635         * workers/service/ServiceWorkerContainer.cpp:
3636         (WebCore::ServiceWorkerContainer::addRegistration):
3637         (WebCore::ServiceWorkerContainer::removeRegistration):
3638         (WebCore::ServiceWorkerContainer::updateRegistration):
3639         (WebCore::ServiceWorkerContainer::scheduleJob):
3640         (WebCore::ServiceWorkerContainer::jobFailedWithException):
3641         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
3642         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
3643         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
3644         (WebCore::ServiceWorkerContainer::jobDidFinish):
3645         (WebCore::ServiceWorkerContainer::stop):
3646         (WebCore::ServiceWorkerContainer::job):
3647         * workers/service/ServiceWorkerContainer.h:
3648         * workers/service/ServiceWorkerJob.cpp:
3649         (WebCore::ServiceWorkerJob::failedWithException):
3650         (WebCore::ServiceWorkerJob::resolvedWithRegistration):
3651         (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult):
3652         (WebCore::ServiceWorkerJob::startScriptFetch):
3653         (WebCore::ServiceWorkerJob::didReceiveResponse):
3654         (WebCore::ServiceWorkerJob::notifyFinished):
3655         (WebCore::ServiceWorkerJob::cancelPendingLoad):
3656         * workers/service/ServiceWorkerJob.h:
3657         (WebCore::ServiceWorkerJob::hasPromise const):
3658         (WebCore::ServiceWorkerJob::takePromise):
3659         * workers/service/ServiceWorkerJobClient.h:
3660         * workers/service/server/SWServerJobQueue.cpp:
3661         (WebCore::SWServerJobQueue::scriptFetchFinished):
3662
3663 2019-01-30  Dean Jackson  <dino@apple.com>
3664
3665         PointerEvents - tiltX and tiltY are reversed
3666         https://bugs.webkit.org/show_bug.cgi?id=194032
3667         <rdar://problem/47674184>
3668
3669         Reviewed by Jon Lee.
3670
3671         I got tiltX and tiltY the wrong way around.
3672
3673         * dom/ios/PointerEventIOS.cpp: Flip the values.
3674
3675 2019-01-30  Zalan Bujtas  <zalan@apple.com>
3676
3677         [LFC][IFC] nextBreakablePosition returns the same position on hyphen characters
3678         https://bugs.webkit.org/show_bug.cgi?id=194001
3679
3680         Reviewed by Antti Koivisto.
3681
3682         Skip to the next position manually. This is exactly what we do in simple line layout.
3683
3684         * layout/inlineformatting/InlineRunProvider.cpp:
3685         (WebCore::Layout::InlineRunProvider::moveToNextBreakablePosition):
3686
3687 2019-01-30  Simon Fraser  <simon.fraser@apple.com>
3688
3689         Add some basic geometry information to the scrolling tree
3690         https://bugs.webkit.org/show_bug.cgi?id=194002
3691         rdar://problem/47656294
3692
3693         Reviewed by Antti Koivisto.
3694
3695         To allow hit-testing in the scrolling tree, store a parent-relative scrollable
3696         rect in "scrolling" and "frame hosting" nodes. This is a rect whose size is the size
3697         of the scrollable area, and whose origin is relative to the parent scrolling tree node.
3698         
3699         Frame hosting nodes need this rect because they take care of the geometry offset between
3700         an iframe and its scrolling tree ancestor in the parent document.
3701         
3702         Based on a patch by Frédéric Wang in bug 172917.
3703
3704         * page/scrolling/AsyncScrollingCoordinator.cpp:
3705         (WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry):
3706         * page/scrolling/ScrollingStateFrameHostingNode.cpp:
3707         (WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
3708         (WebCore::ScrollingStateFrameHostingNode::setAllPropertiesChanged):
3709         (WebCore::ScrollingStateFrameHostingNode::setParentRelativeScrollableRect):
3710         (WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
3711         * page/scrolling/ScrollingStateFrameHostingNode.h:
3712         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
3713         (WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
3714         (WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
3715         * page/scrolling/ScrollingTreeFrameHostingNode.h:
3716         (WebCore::ScrollingTreeFrameHostingNode::parentRelativeScrollableRect const):
3717         * rendering/RenderLayer.h:
3718         * rendering/RenderLayerBacking.cpp:
3719         (WebCore::RenderLayerBacking::updateScrollingLayers):
3720         * rendering/RenderLayerCompositor.cpp:
3721         (WebCore::RenderLayerCompositor::computeFrameScrollingGeometry const):
3722         (WebCore::RenderLayerCompositor::computeFrameHostingGeometry const):
3723         (WebCore::RenderLayerCompositor::computeOverflowScrollingGeometry const):
3724         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
3725         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
3726         (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView const):
3727         (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView): Deleted.
3728         * rendering/RenderLayerCompositor.h:
3729
3730 2019-01-30  Zalan Bujtas  <zalan@apple.com>
3731
3732         [LFC] Use the used margin values in outOfFlowReplacedVerticalGeometry consistently
3733         https://bugs.webkit.org/show_bug.cgi?id=194020
3734
3735         Reviewed by Antti Koivisto.
3736
3737         Check the used margin variables whether we already computed before/after values.
3738
3739         Test: fast/block/block-only/absolute-position-with-margin-auto-simple.html
3740
3741         * layout/FormattingContextGeometry.cpp:
3742         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
3743
3744 2019-01-30  Chris Fleizach  <cfleizach@apple.com>
3745
3746         AX: Support color well on iOS
3747         https://bugs.webkit.org/show_bug.cgi?id=194010
3748
3749         Reviewed by Joanmarie Diggs.
3750
3751         Test: accessibility/ios-simulator/color-well.html
3752
3753         Add support for color well on iOS.
3754
3755         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3756         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
3757         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
3758         (-[WebAccessibilityObjectWrapper accessibilityRoleDescription]):
3759         (-[WebAccessibilityObjectWrapper accessibilityColorStringValue]):
3760         * en.lproj/Localizable.strings:
3761         * platform/LocalizedStrings.cpp:
3762         (WebCore::AXColorWellText):
3763         * platform/LocalizedStrings.h:
3764
3765 2019-01-30  Chris Fleizach  <cfleizach@apple.com>
3766
3767         AX: Role=switch not returning correct accessibilityValue
3768         https://bugs.webkit.org/show_bug.cgi?id=194006
3769
3770         Reviewed by Joanmarie Diggs.
3771
3772         Return the toggle state of a role=switch element.        
3773
3774         Test: accessibility/ios-simulator/role-switch.html
3775
3776         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3777         (-[WebAccessibilityObjectWrapper accessibilityValue]):
3778
3779 2019-01-29  Rob Buis  <rbuis@igalia.com>
3780
3781         Align with Fetch on data: URLs
3782         https://bugs.webkit.org/show_bug.cgi?id=182325
3783
3784         Reviewed by Alex Christensen.
3785
3786         Implement most remaining steps for data: URL processing [1].
3787         Serialization is still to be implemented.
3788
3789         To make the code in DataURLDecoder::parseMediaType more efficient,
3790         refactor ParsedContentType so that validation and parsing is done
3791         in one pass.
3792
3793         Test: web-platform-tests/fetch/data-urls/processing.any.js
3794
3795         [1] https://fetch.spec.whatwg.org/#data-urls
3796
3797         * Modules/encryptedmedia/CDM.cpp:
3798         (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
3799         * platform/network/DataURLDecoder.cpp:
3800         (WebCore::DataURLDecoder::parseMediaType):
3801         (WebCore::DataURLDecoder::DecodeTask::process):
3802         * platform/network/MIMEHeader.cpp:
3803         (WebCore::MIMEHeader::parseHeader):
3804         * platform/network/ParsedContentType.cpp:
3805         (WebCore::containsNewline):
3806         (WebCore::ParsedContentType::parseContentType):
3807         (WebCore::ParsedContentType::create):
3808         (WebCore::isValidContentType):
3809         (WebCore::ParsedContentType::ParsedContentType):
3810         (WebCore::DummyParsedContentType::setContentType const): Deleted.
3811         (WebCore::DummyParsedContentType::setContentTypeParameter const): Deleted.
3812         (WebCore::parseContentType): Deleted.
3813         * platform/network/ParsedContentType.h:
3814
3815 2019-01-29  Eric Carlson  <eric.carlson@apple.com>
3816
3817         [MSE] add more source buffer logging
3818         https://bugs.webkit.org/show_bug.cgi?id=193995
3819         <rdar://problem/47650399>
3820
3821         Reviewed by Jon Lee.
3822
3823         No new tests, no functional change.
3824
3825         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3826         (WebCore::SourceBufferPrivateAVFObjC::resetParserState):
3827         (WebCore::SourceBufferPrivateAVFObjC::setReadyState):
3828         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
3829         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
3830         (WebCore::SourceBufferPrivateAVFObjC::willSeek):
3831         (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession):
3832
3833 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
3834
3835         Add nodes to the scrolling tree in z-index order.
3836         https://bugs.webkit.org/show_bug.cgi?id=192529
3837         <rdar://problem/47402708>
3838
3839         Reviewed by Dean Jackson.
3840
3841         We currently add nodes to the scrolling tree via RenderLayerBacking::updateGeometry() and some other places.
3842         This is sub-optimal, because we don't readily know the scrolling ancestor at these times, so have to do RenderLayer
3843         walks to find them.
3844
3845         With this change we update the scrolling tree during the RenderLayerCompositor::updateBackingAndHierarchy()
3846         tree walk, storing state along the way so we always know our scrolling tree ancestor, and the sibling index
3847         (which makes it so that the scrolling tree correctly reflects layer z-order).
3848
3849         The reattachSubframeScrollLayers() code path is removed, since we can now reliably parent frame nodes via FrameHosting
3850         nodes in their parent document.
3851
3852         There is also some minor cleanup around RenderLayerBacking teardown; it used to be the case that cleanup in ~RenderLayerBacking
3853         was hard because the backing was already disconnected from its owning RenderLayer, so I added RenderLayerBacking::willBeDestroyed()
3854         to do work that requires that layer->backing() is still valid. This allows for fewer callsites for detachFromScrollingCoordinator().
3855
3856         updateScrollCoordinatedLayersAfterFlushIncludingSubframes() is now iOS-only because it's only relevant for iOS WK1,
3857         and m_scrollCoordinatedLayers can be moved to LegacyWebKitScrollingLayerCoordinator.
3858
3859         Tests: scrollingcoordinator/scrolling-tree/overflow-in-fixed.html
3860                scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order.html
3861
3862         * page/scrolling/ScrollingStateTree.cpp:
3863         (WebCore::ScrollingStateTree::insertNode):
3864         * page/scrolling/ScrollingTreeNode.cpp:
3865         (WebCore::ScrollingTreeNode::~ScrollingTreeNode):
3866         * platform/Logging.cpp:
3867         (WebCore::initializeLogChannelsIfNecessary):
3868         * rendering/RenderLayer.cpp:
3869         (WebCore::RenderLayer::setParent):
3870         (WebCore::RenderLayer::calculateClipRects const):
3871         * rendering/RenderLayerBacking.cpp:
3872         (WebCore::RenderLayerBacking::~RenderLayerBacking):
3873         (WebCore::RenderLayerBacking::willBeDestroyed):
3874         (WebCore::RenderLayerBacking::updateGeometry):
3875         (WebCore::RenderLayerBacking::updateBackgroundLayer):
3876         (WebCore::RenderLayerBacking::coordinatedScrollingRoles const):
3877         * rendering/RenderLayerBacking.h:
3878         * rendering/RenderLayerCompositor.cpp:
3879         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
3880         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
3881         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
3882         (WebCore::frameHostingNodeForFrame):
3883         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3884         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
3885         (WebCore::RenderLayerCompositor::updateBacking):
3886         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
3887         (WebCore::RenderLayerCompositor::setIsInWindow):
3888         (WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants):
3889         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
3890         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
3891         (WebCore::RenderLayerCompositor::attachScrollingNode):
3892         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
3893         (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
3894         (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
3895         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
3896         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
3897         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
3898         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
3899         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
3900         (WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
3901         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
3902         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeLayer):
3903         (WebCore::LegacyWebKitScrollingLayerCoordinator::addViewportConstrainedLayer):
3904         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeViewportConstrainedLayer):
3905         (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush): Deleted.
3906         (WebCore::RenderLayerCompositor::setCompositingParent): Deleted. This was always called with a null parentLayer, so was a no-op.
3907         (WebCore::RenderLayerCompositor::removeCompositedChildren): Deleted.
3908         (WebCore::RenderLayerCompositor::fixedRootBackgroundLayerChanged): Deleted. The work happens via didChangePlatformLayerForLayer() now.
3909         (WebCore::canCoordinateScrollingForLayer): Deleted.
3910         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Deleted.
3911         (WebCore::enclosingScrollingNodeID): Deleted.
3912         (WebCore::scrollCoordinatedAncestorInParentOfFrame): Deleted.
3913         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): Deleted.
3914         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): Deleted.
3915         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Deleted.
3916         * rendering/RenderLayerCompositor.h:
3917
3918 2019-01-29  Brent Fulgham  <bfulgham@apple.com>
3919
3920         Make sure we have a frame before trying to access its loader 
3921         https://bugs.webkit.org/show_bug.cgi?id=193985
3922         <rdar://problem/47618239>
3923
3924         Reviewed by Ryosuke Niwa.
3925
3926         * loader/ResourceLoadObserver.cpp:
3927         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3928
3929 2019-01-29  Andy Estes  <aestes@apple.com>
3930
3931         Try to fix the watchOS build.
3932
3933         * dom/Element.cpp:
3934
3935 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
3936
3937         REGRESSION(r240553): [iOS] Crash in ScrollingTree::updateTreeFromStateNode when attempting to log in to icloud.com
3938  &n