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