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