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