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