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