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