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