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