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