Remove unused fields from Scrollbar
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-01-15  Antti Koivisto  <antti@apple.com>
2
3         Remove unused fields from Scrollbar
4         https://bugs.webkit.org/show_bug.cgi?id=193442
5
6         Reviewed by Zalan Bujtas.
7
8         * platform/Scrollbar.cpp:
9         (WebCore::Scrollbar::Scrollbar):
10         * platform/Scrollbar.h:
11         (WebCore::Scrollbar::isCustomScrollbar const):
12
13         Make virtual so it doesn't need a bit.
14
15         (WebCore::Scrollbar::isAlphaLocked const): Deleted.
16         (WebCore::Scrollbar::setIsAlphaLocked): Deleted.
17         * platform/mac/ScrollAnimatorMac.mm:
18         (WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
19         * rendering/RenderScrollbar.cpp:
20         (WebCore::RenderScrollbar::RenderScrollbar):
21         * rendering/RenderScrollbar.h:
22
23 2019-01-15  Zalan Bujtas  <zalan@apple.com>
24
25         [LFC] Use the containing block's padding box to position out-of-flow elements.
26         https://bugs.webkit.org/show_bug.cgi?id=193431
27
28         Reviewed by Antti Koivisto.
29
30         If the element has 'position: absolute', the containing block is established by the nearest ancestor
31         with a 'position' of 'absolute', 'relative' or 'fixed', in the following way:
32
33         1. In the case that the ancestor is an inline element, the containing block is the bounding box around the padding
34         boxes of the first and the last inline boxes generated for that element. In CSS 2.2, if the inline element is split
35         across multiple lines, the containing block is undefined.
36
37         2. Otherwise, the containing block is formed by the padding edge of the ancestor.
38
39         This patch covers #2. 
40
41         Test: fast/block/block-only/out-of-flow-with-containing-block-border-padding.html
42
43         * layout/displaytree/DisplayBox.h:
44         (WebCore::Display::Box::width const):
45         (WebCore::Display::Box::height const):
46         (WebCore::Display::Box::contentBoxTop const):
47         (WebCore::Display::Box::contentBoxLeft const):
48         (WebCore::Display::Box::paddingBoxTop const):
49         (WebCore::Display::Box::paddingBoxLeft const):
50         (WebCore::Display::Box::paddingBoxBottom const):
51         (WebCore::Display::Box::paddingBoxRight const):
52         (WebCore::Display::Box::paddingBoxHeight const):
53         (WebCore::Display::Box::paddingBoxWidth const):
54         * page/FrameViewLayoutContext.cpp:
55         (WebCore::layoutUsingFormattingContext):
56
57 2019-01-11  Antoine Quint  <graouts@apple.com>
58
59         Support parsing of additional values for the touch-action property
60         https://bugs.webkit.org/show_bug.cgi?id=193314
61         <rdar://problem/47176519>
62
63         Reviewed by Dean Jackson.
64
65         We add parsing support for the "none", "pan-x", "pan-y" and "pinch-zoom" values of the CSS "touch-action" property.
66
67         * WebCore.xcodeproj/project.pbxproj:
68         * css/CSSComputedStyleDeclaration.cpp:
69         (WebCore::touchActionFlagsToCSSValue):
70         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
71         * css/CSSPrimitiveValueMappings.h:
72         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
73         (WebCore::CSSPrimitiveValue::operator OptionSet<TouchAction> const):
74         (WebCore::CSSPrimitiveValue::operator TouchAction const): Deleted.
75         * css/CSSProperties.json:
76         * css/CSSValueKeywords.in:
77         * css/StyleBuilderConverter.h:
78         (WebCore::StyleBuilderConverter::convertTouchAction):
79         * css/parser/CSSParserFastPaths.cpp:
80         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
81         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
82         * css/parser/CSSPropertyParser.cpp:
83         (WebCore::consumeTouchAction):
84         * dom/Element.cpp:
85         (WebCore::Element::allowsDoubleTapGesture const):
86         * platform/TouchAction.h: Added.
87         * rendering/style/RenderStyle.h:
88         (WebCore::RenderStyle::touchActions const):
89         (WebCore::RenderStyle::setTouchActions):
90         (WebCore::RenderStyle::initialTouchActions):
91         (WebCore::RenderStyle::touchAction const): Deleted.
92         (WebCore::RenderStyle::setTouchAction): Deleted.
93         (WebCore::RenderStyle::initialTouchAction): Deleted.
94         * rendering/style/RenderStyleConstants.h:
95         * rendering/style/StyleRareNonInheritedData.cpp:
96         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
97         (WebCore::StyleRareNonInheritedData::operator== const):
98         * rendering/style/StyleRareNonInheritedData.h:
99
100 2019-01-15  Devin Rousso  <drousso@apple.com>
101
102         Web Inspector: Audit: create new IDL type for exposing special functionality in test context
103         https://bugs.webkit.org/show_bug.cgi?id=193149
104         <rdar://problem/46801218>
105
106         Reviewed by Joseph Pecoraro.
107
108         Tests: inspector/audit/run.html
109                inspector/audit/setup.html
110                inspector/audit/teardown.html
111
112         Create a new `AuditAgent` (and various subclasses for different inspection targets), as well
113         as `InspectorAuditAccessibilityObject` and `InspectorAuditDOMObject` objects that will
114         be injected into the test function to allow for more advanced testing.
115
116         * inspector/InspectorAuditAccessibilityObject.idl: Added.
117         * inspector/InspectorAuditAccessibilityObject.h: Added.
118         (WebCore::InspectorAuditAccessibilityObject::create):
119         * inspector/InspectorAuditAccessibilityObject.cpp: Added.
120         (WebCore::InspectorAuditAccessibilityObject::InspectorAuditAccessibilityObject):
121
122         * inspector/InspectorAuditDOMObject.idl: Added.
123         * inspector/InspectorAuditDOMObject.h: Added.
124         (WebCore::InspectorAuditDOMObject::create):
125         * inspector/InspectorAuditDOMObject.cpp: Added.
126         (WebCore::InspectorAuditDOMObject::InspectorAuditDOMObject):
127
128         * inspector/agents/page/PageAuditAgent.h: Added.
129         * inspector/agents/page/PageAuditAgent.cpp: Added.
130         (WebCore::PageAuditAgent::PageAuditAgent):
131         (WebCore::PageAuditAgent::injectedScriptForEval):
132         (WebCore::PageAuditAgent::populateAuditObject):
133         (WebCore::PageAuditAgent::muteConsole):
134         (WebCore::PageAuditAgent::unmuteConsole):
135
136         * inspector/agents/worker/WorkerAuditAgent.h: Added.
137         * inspector/agents/worker/WorkerAuditAgent.cpp: Added.
138         (WebCore::WorkerAuditAgent::WorkerAuditAgent):
139         (WebCore::WorkerAuditAgent::injectedScriptForEval):
140
141         * inspector/InspectorController.cpp:
142         (WebCore::InspectorController::createLazyAgents):
143
144         * inspector/WorkerInspectorController.cpp:
145         (WebCore::WorkerInspectorController::createLazyAgents):
146
147         * CMakeLists.txt:
148         * DerivedSources-input.xcfilelist:
149         * DerivedSources-output.xcfilelist:
150         * DerivedSources.make:
151         * Sources.txt:
152         * UnifiedSources-input.xcfilelist:
153         * WebCore.xcodeproj/project.pbxproj:
154
155 2019-01-14  Myles C. Maxfield  <mmaxfield@apple.com>
156
157         [WHLSL] Implement the Type Checker
158         https://bugs.webkit.org/show_bug.cgi?id=193080
159
160         Reviewed by Dean Jackson.
161
162         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/Checker.mjs into C++.
163
164         The Checker passes types between nested expressions. An inner expression figures out what type it is, and
165         passes that information up to an outer expression. This is done via reading/writing into a HashMap,
166         because all the type information needs to be saved so that the Metal codegen can emit the correct types.
167
168         These types can have two forms: A regular type (like "int[]") or a ResolvableType. ResolvableTypes
169         represent literals, since a literal needs to know its context before it knows what type it should be. So,
170         if you have a function like "void foo(int x)" and you have a call like "foo(3)", the 3's ResolvableType
171         gets passed to the CallExpression, which then unifies it with the function's parameter type, thereby
172         resolving the 3 to be an int.
173
174         There are a few examples where multiple expressions will have the same type: "return (foo, 3)." If those
175         types are regular types, then it's no problem; we can just clone() the type and stick both in the HashMap.
176         However, if the type is a ResolvableType, an outer expression will only resolve that type once, so the two
177         ResolvableTypes can't be distinct. The Checker solves this problem by making a reference-counted wrapper
178         around ResolvableTypes and using that in the HashMap instead.
179
180         Once all the ResolvableTypes have been resolved, a second pass runs through the entire HashMap and assigns
181         the known types to all the expressions. LValues and their associated address spaces are held in a parallel
182         HashMap, and are assigned to the expression at the same time. The type is an Optional<AddressSpace> because
183         address spaces are only relevant if the value is an lvalue; if it's nullopt then that means the expression
184         is an rvalue.
185
186         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
187         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
188
189         * Modules/webgpu/WHLSL/WHLSLChecker.cpp: Added.
190         (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
191         (WebCore::WHLSL::resolveWithOperatorLength):
192         (WebCore::WHLSL::resolveWithReferenceComparator):
193         (WebCore::WHLSL::resolveByInstantiation):
194         (WebCore::WHLSL::checkSemantics):
195         (WebCore::WHLSL::checkOperatorOverload):
196         (WebCore::WHLSL::Checker::Checker):
197         (WebCore::WHLSL::Checker::visit):
198         (WebCore::WHLSL::Checker::assignTypes):
199         (WebCore::WHLSL::Checker::checkShaderType):
200         (WebCore::WHLSL::matchAndCommit):
201         (WebCore::WHLSL::Checker::recurseAndGetInfo):
202         (WebCore::WHLSL::Checker::getInfo):
203         (WebCore::WHLSL::Checker::assignType):
204         (WebCore::WHLSL::Checker::forwardType):
205         (WebCore::WHLSL::getUnnamedType):
206         (WebCore::WHLSL::Checker::finishVisitingPropertyAccess):
207         (WebCore::WHLSL::Checker::recurseAndWrapBaseType):
208         (WebCore::WHLSL::Checker::isBoolType):
209         (WebCore::WHLSL::Checker::recurseAndRequireBoolType):
210         (WebCore::WHLSL::check):
211         * Modules/webgpu/WHLSL/WHLSLChecker.h: Added.
212         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp: Added.
213         (WebCore::WHLSL::Gatherer::Gatherer):
214         (WebCore::WHLSL::Gatherer::reset):
215         (WebCore::WHLSL::Gatherer::takeEntryPointItems):
216         (WebCore::WHLSL::Gatherer::visit):
217         (WebCore::WHLSL::gatherEntryPointItems):
218         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h: Added.
219         (WebCore::WHLSL::EntryPointItem::EntryPointItem):
220         * Sources.txt:
221         * WebCore.xcodeproj/project.pbxproj:
222
223 2019-01-14  Alex Christensen  <achristensen@webkit.org>
224
225         Split headerValueForVary into specialized functions for NetworkProcess and WebProcess/WebKitLegacy
226         https://bugs.webkit.org/show_bug.cgi?id=193429
227
228         Reviewed by Joseph Pecoraro.
229
230         headerValueForVary is a strange function that is causing trouble with my NetworkProcess global state removal project.
231         It currently accesses the cookie storage to see if there's a match in two different ways currently written as fallbacks.
232         In the WebProcess or in WebKitLegacy, it uses cookiesStrategy to access cookies via IPC or directly, respectively,
233         depending on the PlatformStrategies implementation of cookiesStrategy for that process.
234         In the NetworkProcess, it uses WebCore::NetworkStorageSession to access cookies directly.
235         Both of these cookie accessing methods use global state in the process, and I must split them to refactor them separately.
236         This patch does the split by passing in the method of cookie access: a CookiesStrategy& or a NetworkStorageSession&.
237         Further refactoring will be done in bug 193368 and bug 161106 to build on this and replace the global state with
238         member variables of the correct containing objects.
239
240         * loader/cache/CachedResource.cpp:
241         (WebCore::CachedResource::setResponse):
242         (WebCore::CachedResource::varyHeaderValuesMatch):
243         * platform/network/CacheValidation.cpp:
244         (WebCore::cookieRequestHeaderFieldValue):
245         (WebCore::headerValueForVary):
246         (WebCore::collectVaryingRequestHeaders):
247         (WebCore::verifyVaryingRequestHeaders):
248         * platform/network/CacheValidation.h:
249
250 2019-01-14  Simon Fraser  <simon.fraser@apple.com>
251
252         Only run the node comparison code in FrameSelection::respondToNodeModification() for range selections
253         https://bugs.webkit.org/show_bug.cgi?id=193416
254
255         Reviewed by Wenson Hsieh.
256
257         The code inside the m_selection.firstRange() clause needs to only run for non-collapsed selections, and
258         it shows up on Speedometer profiles so optimize to only run this code if we have a selection range.
259
260         * editing/FrameSelection.cpp:
261         (WebCore::FrameSelection::respondToNodeModification):
262
263 2019-01-14  Simon Fraser  <simon.fraser@apple.com>
264
265         Animation and other code is too aggressive about invalidating layer composition
266         https://bugs.webkit.org/show_bug.cgi?id=193343
267
268         Reviewed by Antoine Quint.
269         
270         We used to have the concept of a "SyntheticStyleChange", which was used to trigger
271         style updates for animation, and also to get compositing updated.
272         
273         That morphed into a call to Element::invalidateStyleAndLayerComposition(), which causes
274         a style update to result in a "RecompositeLayer" diff, which in turn triggers compositing work,
275         and dirties DOM touch event regions (which can be expensive to update).
276         
277         However, not all the callers of Element::invalidateStyleAndLayerComposition() need to trigger
278         compositing, and doing so from animations caused excessive touch event regions on yahoo.com,
279         which has several visibility:hidden elements with background-position animation.
280         
281         So fix callers of invalidateStyleAndLayerComposition() which don't care about compositing to instead
282         call just invalidateStyle().
283         
284         Also fix KeyframeAnimation::animate to correctly return true when animation state changes—it failed to
285         do so, because fireAnimationEventsIfNeeded() can run the state machine and change state.
286
287         * animation/KeyframeEffect.cpp:
288         (WebCore::invalidateElement):
289         * page/animation/AnimationBase.cpp:
290         (WebCore::AnimationBase::setNeedsStyleRecalc):
291         * page/animation/CSSAnimationController.cpp:
292         (WebCore::CSSAnimationControllerPrivate::updateAnimations):
293         (WebCore::CSSAnimationControllerPrivate::fireEventsAndUpdateStyle):
294         (WebCore::CSSAnimationControllerPrivate::pauseAnimationAtTime):
295         (WebCore::CSSAnimationControllerPrivate::pauseTransitionAtTime):
296         (WebCore::CSSAnimationController::cancelAnimations):
297         * page/animation/KeyframeAnimation.cpp:
298         (WebCore::KeyframeAnimation::animate):
299         * rendering/RenderImage.cpp:
300         (WebCore::RenderImage::imageChanged):
301         * rendering/RenderLayer.cpp:
302         (WebCore::RenderLayer::calculateClipRects const):
303         * rendering/svg/SVGResourcesCache.cpp:
304         (WebCore::SVGResourcesCache::clientStyleChanged):
305         * style/StyleTreeResolver.cpp:
306         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
307         * svg/SVGAnimateElementBase.cpp:
308         (WebCore::applyCSSPropertyToTarget):
309         (WebCore::removeCSSPropertyFromTarget):
310
311 2019-01-14  Sihui Liu  <sihui_liu@apple.com>
312
313         IndexedDB: When deleting databases, some open databases might be missed
314         https://bugs.webkit.org/show_bug.cgi?id=193090
315
316         Reviewed by Brady Eidson.
317
318         We should close all databases with an open backing store instead of looking at which ones have an open database
319         connection. This is because a database might be in the process of getting a backing store before its connection
320         has been created.
321
322         * Modules/indexeddb/server/IDBServer.cpp:
323         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
324         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
325
326 2019-01-14  Ryosuke Niwa  <rniwa@webkit.org>
327
328         Remove redundant check for alignAttr and hiddenAttr in various isPresentationAttribute overrides
329         https://bugs.webkit.org/show_bug.cgi?id=193410
330
331         Reviewed by Simon Fraser.
332
333         Removed redundant checks for check for alignAttr and hiddenAttr in isPresentationAttribute overrides
334         in HTMLElement subclasses since HTMLElement::isPresentationAttribute already checks for those attributes.
335
336         * html/HTMLDivElement.cpp:
337         (WebCore::HTMLDivElement::isPresentationAttribute const): Deleted.
338         * html/HTMLDivElement.h:
339         * html/HTMLEmbedElement.cpp:
340         (WebCore::HTMLEmbedElement::isPresentationAttribute const): Deleted.
341         * html/HTMLEmbedElement.h:
342         * html/HTMLHRElement.cpp:
343         (WebCore::HTMLHRElement::isPresentationAttribute const):
344         * html/HTMLIFrameElement.cpp:
345         (WebCore::HTMLIFrameElement::isPresentationAttribute const):
346         * html/HTMLImageElement.cpp:
347         (WebCore::HTMLImageElement::isPresentationAttribute const):
348         * html/HTMLInputElement.cpp:
349         (WebCore::HTMLInputElement::isPresentationAttribute const):
350         * html/HTMLParagraphElement.cpp:
351         (WebCore::HTMLParagraphElement::isPresentationAttribute const): Deleted.
352         * html/HTMLParagraphElement.h:
353         * html/HTMLTableCaptionElement.cpp:
354         (WebCore::HTMLTableCaptionElement::isPresentationAttribute const): Deleted.
355         * html/HTMLTableCaptionElement.h:
356         * html/HTMLTableElement.cpp:
357         (WebCore::HTMLTableElement::isPresentationAttribute const):
358         * html/HTMLTablePartElement.cpp:
359         (WebCore::HTMLTablePartElement::isPresentationAttribute const):
360
361 2019-01-14  Commit Queue  <commit-queue@webkit.org>
362
363         Unreviewed, rolling out r239901, r239909, r239910, r239912,
364         r239913, and r239914.
365         https://bugs.webkit.org/show_bug.cgi?id=193407
366
367         These revisions caused an internal failure (Requested by
368         Truitt on #webkit).
369
370         Reverted changesets:
371
372         "[Cocoa] Avoid importing directly from subumbrella frameworks"
373         https://bugs.webkit.org/show_bug.cgi?id=186016
374         https://trac.webkit.org/changeset/239901
375
376         "Tried to fix USE(APPLE_INTERNAL_SDK) builds after r239901."
377         https://trac.webkit.org/changeset/239909
378
379         "Tried to fix the build."
380         https://trac.webkit.org/changeset/239910
381
382         "Fixed iOS builds after r239910."
383         https://trac.webkit.org/changeset/239912
384
385         "More build fixing."
386         https://trac.webkit.org/changeset/239913
387
388         "Tried to fix USE(APPLE_INTERNAL_SDK) 32-bit builds."
389         https://trac.webkit.org/changeset/239914
390
391 2019-01-14  Mark Lam  <mark.lam@apple.com>
392
393         Re-enable ability to build --cloop builds.
394         https://bugs.webkit.org/show_bug.cgi?id=192955
395
396         Reviewed by Saam barati and Keith Miller.
397
398         * Configurations/FeatureDefines.xcconfig:
399
400 2019-01-14  Jer Noble  <jer.noble@apple.com>
401
402         https://bugs.webkit.org/show_bug.cgi?id=193403
403         <rdar://problem/46750743>
404
405         Continue fix in r239711 by using WeakPtr in SourceBufferPrivateAVFObjC.
406
407         Reviewed by Eric Carlson.
408
409         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
410         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
411         (WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
412
413 2019-01-14  Justin Fan  <justin_fan@apple.com>
414
415         [WebGPU] Map WebGPUBindGroupLayoutBindings from the BindGroupLayoutDescriptor for error checking and later referencing
416         https://bugs.webkit.org/show_bug.cgi?id=193405
417
418         Reviewed by Dean Jackson.
419
420         When creating a WebGPUBindGroupLayout, cache the WebGPUBindGroupLayoutDescriptor's list of BindGroupLayoutBindings
421         in a HashMap, keyed by binding number, for quick reference during the WebGPUProgrammablePassEncoder::setBindGroups 
422         implementation to follow. Also add error-checking e.g. detecting duplicate binding numbers in the same WebGPUBindGroupLayout
423         and non-existent binding numbers when creating the WebGPUBindGroup.
424
425         No new tests. BindGroups and BindGroupLayouts reflect the (canonical?) strategy of returning empty 
426         objects upon creation failure and reporting errors elswhere. Since error reporting is not yet implemented, 
427         the error checks aren't testable from LayoutTests right now. Expected behavior unchanged and covered by existing tests.
428
429         * Modules/webgpu/WebGPUDevice.cpp:
430         (WebCore::WebGPUDevice::createBindGroup const): 
431                 Number of bindings must be consistent between bindings and layout bindings.
432                 BindGroupBindings should only refer to existing BindGroupLayoutBindings.
433         * platform/graphics/gpu/GPUBindGroup.h: 
434         * platform/graphics/gpu/GPUBindGroupLayout.h:
435         (WebCore::GPUBindGroupLayout::bindingsMap const): Added. Cache map of BindGroupLayoutBindings.
436         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Disallow duplicate binding numbers in BindGroupLayoutBindings.
437         (WebCore::GPUBindGroupLayout::tryCreate):
438         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
439
440 2019-01-14  Myles C. Maxfield  <mmaxfield@apple.com>
441
442         [WHLSL] Assorted cleanup
443         https://bugs.webkit.org/show_bug.cgi?id=193389
444
445         Reviewed by Dean Jackson.
446
447         This is a bunch of non-behavior-changing cleanup.
448
449         - The compiler uses UniqueRef all over the place, and UniqueRef has an implicit operator T&. Therefore,
450           we don't need to static_cast<T&> everywhere.
451         - ConstantExpressionEnumerationMemberReference is the exact same thing as EnumerationMemberLiteral, so
452           this patch deletes the longer-named class in favor of the shorter-named class.
453         - Because of the header dependency tree, this patch moves EntryPointType into its own file so it can be
454           used by files that FunctionDeclaration depends on. Same thing for AddressSpace.
455         - EnumTypes have to have non-null base types. The parser will make sure this is always true.
456
457         No new tests because there is no behavior change.
458
459         * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h.
460         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
461         (WebCore::WHLSL::AST::ArrayType::type const):
462         (WebCore::WHLSL::AST::ArrayType::type):
463         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
464         (WebCore::WHLSL::AST::AssignmentExpression::left):
465         (WebCore::WHLSL::AST::AssignmentExpression::right):
466         * Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h:
467         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
468         (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableForShaderItemDirection const):
469         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
470         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
471         (WebCore::WHLSL::AST::ConstantExpression::ConstantExpression):
472         (WebCore::WHLSL::AST::ConstantExpression::clone const):
473         (WebCore::WHLSL::AST::ConstantExpression::matches const):
474         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpressionEnumerationMemberReference.h: Removed.
475         * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
476         (WebCore::WHLSL::AST::DereferenceExpression::pointer):
477         * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
478         (WebCore::WHLSL::AST::DoWhileLoop::body):
479         (WebCore::WHLSL::AST::DoWhileLoop::conditional):
480         * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
481         (WebCore::WHLSL::AST::EffectfulExpressionStatement::effectfulExpression):
482         * Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h.
483         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
484         (WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition):
485         (WebCore::WHLSL::AST::EnumerationDefinition::type):
486         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
487         (WebCore::WHLSL::AST::EnumerationMemberLiteral::EnumerationMemberLiteral):
488         (WebCore::WHLSL::AST::EnumerationMemberLiteral::wrap):
489         (WebCore::WHLSL::AST::EnumerationMemberLiteral::left const):
490         (WebCore::WHLSL::AST::EnumerationMemberLiteral::right const):
491         (WebCore::WHLSL::AST::EnumerationMemberLiteral::clone const):
492         (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationDefinition):
493         (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationDefinition const):
494         (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember):
495         (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember const):
496         (WebCore::WHLSL::AST::EnumerationMemberLiteral::setEnumerationMember):
497         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
498         (WebCore::WHLSL::AST::Expression::type):
499         (WebCore::WHLSL::AST::Expression::setType):
500         (WebCore::WHLSL::AST::Expression::addressSpace const):
501         (WebCore::WHLSL::AST::Expression::setAddressSpace):
502         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp:
503         (WebCore::WHLSL::AST::FloatLiteralType::conversionCost const):
504         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
505         (WebCore::WHLSL::AST::FloatLiteralType::preferredType):
506         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
507         (WebCore::WHLSL::AST::ForLoop::condition):
508         (WebCore::WHLSL::AST::ForLoop::increment):
509         (WebCore::WHLSL::AST::ForLoop::body):
510         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
511         (WebCore::WHLSL::AST::FunctionDeclaration::type const):
512         (WebCore::WHLSL::AST::FunctionDeclaration::type):
513         * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
514         (WebCore::WHLSL::AST::IfStatement::conditional):
515         (WebCore::WHLSL::AST::IfStatement::body):
516         (WebCore::WHLSL::AST::IfStatement::elseBody):
517         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
518         (WebCore::WHLSL::AST::IndexExpression::indexExpression):
519         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
520         (WebCore::WHLSL::AST::IntegerLiteralType::conversionCost const):
521         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
522         (WebCore::WHLSL::AST::IntegerLiteralType::preferredType):
523         * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
524         (WebCore::WHLSL::AST::LogicalExpression::left):
525         (WebCore::WHLSL::AST::LogicalExpression::right):
526         * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
527         (WebCore::WHLSL::AST::LogicalNotExpression::operand):
528         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
529         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::lValue):
530         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
531         (WebCore::WHLSL::AST::MakePointerExpression::lValue):
532         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
533         (WebCore::WHLSL::AST::PropertyAccessExpression::base):
534         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
535         (WebCore::WHLSL::AST::ReadModifyWriteExpression::lValue):
536         (WebCore::WHLSL::AST::ReadModifyWriteExpression::newValueExpression):
537         (WebCore::WHLSL::AST::ReadModifyWriteExpression::resultExpression):
538         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
539         (WebCore::WHLSL::AST::ReferenceType::elementType const):
540         (WebCore::WHLSL::AST::ReferenceType::elementType):
541         * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h:
542         (WebCore::WHLSL::AST::ResolvableType::resolvedType const):
543         (WebCore::WHLSL::AST::ResolvableType::resolvedType):
544         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
545         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
546         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableForShaderItemDirection const):
547         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
548         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
549         (WebCore::WHLSL::AST::Return::value):
550         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
551         (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableForShaderItemDirection const):
552         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h:
553         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
554         (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableForShaderItemDirection const):
555         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h:
556         * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
557         (WebCore::WHLSL::AST::StructureElement::type):
558         * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
559         (WebCore::WHLSL::AST::SwitchStatement::value):
560         * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
561         (WebCore::WHLSL::AST::TernaryExpression::predicate):
562         (WebCore::WHLSL::AST::TernaryExpression::bodyExpression):
563         (WebCore::WHLSL::AST::TernaryExpression::elseExpression):
564         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
565         (WebCore::WHLSL::AST::TypeDefinition::type):
566         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
567         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::conversionCost const):
568         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
569         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::preferredType):
570         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
571         (WebCore::WHLSL::AST::VariableDeclaration::type):
572         (WebCore::WHLSL::AST::VariableDeclaration::initializer):
573         (WebCore::WHLSL::AST::VariableDeclaration::isAnonymous const):
574         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
575         (WebCore::WHLSL::AST::WhileLoop::conditional):
576         (WebCore::WHLSL::AST::WhileLoop::body):
577         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
578         (WebCore::WHLSL::checkDuplicateFunctions):
579         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
580         (WebCore::WHLSL::commit):
581         (WebCore::WHLSL::inferTypesForTypeArguments):
582         (WebCore::WHLSL::inferTypesForCall):
583         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
584         (WebCore::WHLSL::NameResolver::visit):
585         (WebCore::WHLSL::resolveNamesInTypes):
586         (WebCore::WHLSL::resolveNamesInFunctions):
587         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
588         * Modules/webgpu/WHLSL/WHLSLParser.h:
589         * Modules/webgpu/WHLSL/WHLSLProgram.h:
590         (WebCore::WHLSL::Program::append):
591         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
592         (WebCore::WHLSL::synthesizeEnumerationFunctions):
593         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
594         (WebCore::WHLSL::synthesizeStructureAccessors):
595         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
596         (WebCore::WHLSL::Visitor::visit):
597         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
598         * WebCore.xcodeproj/project.pbxproj:
599
600 2019-01-14  Zan Dobersek  <zdobersek@igalia.com>
601
602         DOMCacheStorage: use-after-move in doSequentialMatch()
603         https://bugs.webkit.org/show_bug.cgi?id=193396
604
605         Reviewed by Youenn Fablet.
606
607         Depending on the platform- and compiler-specific calling conventions,
608         the doSequentialMatch() code can move out the Vector<Ref<DOMCache>>
609         object into the callback lambda before the DOMCache object at the
610         specified index is retrieved for the DOMCache::doMatch() invocation.
611
612         This problem is now avoided by retrieving reference to the target
613         DOMCache object in an earlier expression.
614
615         * Modules/cache/DOMCacheStorage.cpp:
616         (WebCore::doSequentialMatch):
617
618 2019-01-14  Zalan Bujtas  <zalan@apple.com>
619
620         [LFC][BFC] Add basic box-sizing support.
621         https://bugs.webkit.org/show_bug.cgi?id=193392
622
623         Reviewed by Antti Koivisto.
624
625         No min/max support yet.
626
627         Test: fast/block/block-only/box-sizing-inflow-out-of-flow-simple.html
628
629         * layout/FormattingContextGeometry.cpp:
630         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
631         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
632         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
633         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
634         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
635         * page/FrameViewLayoutContext.cpp:
636         (WebCore::layoutUsingFormattingContext):
637
638 2019-01-14  Thibault Saunier  <tsaunier@igalia.com>
639
640         [GStreamer][WebRTC] Override DeviceType() in RealtimeMediaSource implementations
641         https://bugs.webkit.org/show_bug.cgi?id=193397
642
643         This was necessary but wasn't done.
644
645         Reviewed by Philippe Normand.
646
647         No test required as this fixes a regression in all WebRTC tests when built in debug mode.
648
649         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
650         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
651
652 2019-01-14  Zan Dobersek  <zdobersek@igalia.com>
653
654         Unreviewed WPE debug build fix after r239921.
655
656         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
657         (webKitMediaClearKeyDecryptorDecrypt): Fix the assert that checks the
658         size of the mapped buffer containing IV data.
659
660 2019-01-14  Charlie Turner  <cturner@igalia.com>
661
662         [GStreamer] Add sharedBuffer utility to GstMappedBuffer, and a testsuite
663         https://bugs.webkit.org/show_bug.cgi?id=192977
664
665         Reviewed by Carlos Garcia Campos.
666
667         Add a utility method on GstMappedBuffer to return a SharedBuffer
668         view over the mapped data with no copies.
669
670         This patch also introduces a new gstreamer port API test
671         directory, and includes some tests for GstMappedBuffer.
672
673         New tests in the API section.
674
675         * platform/SharedBuffer.cpp: Add a new overload for
676         GstMappedBuffer that allows sharing the mapped GStreamer buffers
677         with zero copies.
678         (WebCore::SharedBuffer::create):
679         (WebCore::SharedBuffer::SharedBuffer):
680         (WebCore::SharedBuffer::DataSegment::data const):
681         (WebCore::SharedBuffer::DataSegment::size const):
682         * platform/SharedBuffer.h:
683         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
684         (webKitWebAudioSrcAllocateBuffersAndRenderAudio): Update to new
685         API.
686         * platform/graphics/gstreamer/GStreamerCommon.cpp:
687         (WebCore::GstMappedBuffer::createSharedBuffer): Return a shared
688         buffer sharing this mapped buffer. The buffer must be shareable to
689         use this method.
690         * platform/graphics/gstreamer/GStreamerCommon.h:
691         (WebCore::GstMappedBuffer::create): Make GstMappedBuffer RefCounted
692         (WebCore::GstMappedBuffer::~GstMappedBuffer):
693         (WebCore::GstMappedBuffer::data):
694         (WebCore::GstMappedBuffer::data const):
695         (WebCore::GstMappedBuffer::size const):
696         (WebCore::GstMappedBuffer::isSharable const): New predicate to
697         check whether this buffer can be shared (i.e., is not writable)
698         (WebCore::GstMappedBuffer::GstMappedBuffer):
699         (WebCore::GstMappedBuffer::operator bool const): Deleted.
700         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
701         (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample):
702         Update to use new API.
703         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
704         (WebCore::InitData::InitData): Ditto.
705         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
706         (webKitMediaClearKeyDecryptorFindAndSetKey): Ditto.
707         (webKitMediaClearKeyDecryptorDecrypt): Ditto.
708         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
709         (WebCore::WrappedMockRealtimeAudioSource::render): Ditto.
710         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
711         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): Ditto.
712         * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:
713         (WebCore::RealtimeOutgoingVideoSourceLibWebRTC::createBlackFrame): Ditto.
714         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
715         (WebCore::GStreamerVideoEncoder::Fragmentize): Ditto.
716
717 2019-01-14  Karl Leplat  <karl.leplat_ext@softathome.com>
718
719         [GTK][WPE] Graphic issue with invalidations on composited layers with subpixel positions
720         https://bugs.webkit.org/show_bug.cgi?id=193239
721
722         Reviewed by Žan Doberšek.
723
724         Test: compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions.html
725
726         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
727         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers): Use enclosed dirty rect values
728         when invalidating the CoordinatedBackingStore areas.
729
730 2019-01-13  Carlos Garcia Campos  <cgarcia@igalia.com>
731
732         [FreeType] Support emoji modifiers
733         https://bugs.webkit.org/show_bug.cgi?id=177040
734
735         Reviewed by Myles C. Maxfield.
736
737         The problem only happens with emojis having the zero with joiner (U+200D) in the sequence. The sequence is
738         broken because createAndFillGlyphPage() in Font.cpp overwrites zero with joiner with zero width space (U+200B),
739         but the emoji font actually supports zero with joiner. This patch moves the control characters override from
740         createAndFillGlyphPage() to GlyphPage::fill() only for FreeType based ports. This way we can do the override
741         only for the cases where the code point is not supported by the font.
742
743         * platform/graphics/Font.cpp:
744         (WebCore::overrideControlCharacters): Helper function to override the control characters.
745         (WebCore::createAndFillGlyphPage): Call overrideControlCharacters() only when not using FreeType.
746         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
747         (WebCore::GlyphPage::fill): Use zero width space as fallback when the font doesn't support characters with
748         Default_Ignorable Unicode property.
749
750 2019-01-13  Dan Bernstein  <mitz@apple.com>
751
752         More build fixing.
753
754         * editing/cocoa/DictionaryLookup.mm:
755
756 2019-01-13  Simon Fraser  <simon.fraser@apple.com>
757
758         Minor optimization to RenderText::setRenderedText()
759         https://bugs.webkit.org/show_bug.cgi?id=193388
760
761         Reviewed by Ryosuke Niwa.
762
763         Avoid the call to applyTextTransform() if TextTransform is None, so that we don't
764         have to call previousCharacter() and reassign m_text.
765         
766         Similar optimization in RenderText::textWithoutConvertingBackslashToYenSymbol().
767
768         Speedometer profiles show a few samples here, but this isn't going to win any prizes.
769
770         * rendering/RenderText.cpp:
771         (WebCore::RenderText::setRenderedText):
772         (WebCore::RenderText::textWithoutConvertingBackslashToYenSymbol const):
773
774 2019-01-13  Dan Bernstein  <mitz@apple.com>
775
776         Tried to fix the build.
777
778         * editing/cocoa/DictionaryLookup.mm:
779
780 2019-01-13  Dan Bernstein  <mitz@apple.com>
781
782         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r239901.
783
784         Patch by Keith Rollin.
785
786         * accessibility/mac/AXObjectCacheMac.mm:
787
788 2019-01-13  Zalan Bujtas  <zalan@apple.com>
789
790         [LFC] Adjust assert for statically positioned fixed elements
791         https://bugs.webkit.org/show_bug.cgi?id=193385
792
793         Reviewed by Antti Koivisto.
794
795         While computing the static position and traversing the ancestor chain, we can surely hit a positioned container
796         (since we need to go all the way up to the initial containing block).
797
798         * layout/FormattingContextGeometry.cpp:
799         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
800         (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
801
802 2019-01-13  Antti Koivisto  <antti@apple.com>
803
804         Release assert with <img usemap> in shadow tree
805         https://bugs.webkit.org/show_bug.cgi?id=193378
806
807         Reviewed by Ryosuke Niwa.
808
809         When a shadow host that has <img usemap> in the shadow tree is removed from the document, we try
810         to remove the map from the scope of the host.
811
812         * html/HTMLImageElement.cpp:
813         (WebCore::HTMLImageElement::parseAttribute):
814         (WebCore::HTMLImageElement::insertedIntoAncestor):
815         (WebCore::HTMLImageElement::removedFromAncestor):
816
817         Tree scope changes are relevant, not the connection to the document.
818
819 2019-01-12  Timothy Hatcher  <timothy@apple.com>
820
821         Have prefers-color-scheme: light always match on macOS versions before Mojave.
822         https://bugs.webkit.org/show_bug.cgi?id=191655
823         rdar://problem/46074680
824
825         Reviewed by Megan Gardner.
826
827         Tests: css-dark-mode/older-systems/prefers-color-scheme.html
828                css-dark-mode/older-systems/supported-color-schemes-css.html
829                css-dark-mode/older-systems/supported-color-schemes.html
830
831         Use new HAVE(OS_DARK_MODE_SUPPORT) to make it easier to find code.
832         Added HAVE(OS_DARK_MODE_SUPPORT) around more bits to make it work on older systems.
833
834         * Configurations/FeatureDefines.xcconfig:
835         * dom/Document.cpp:
836         (WebCore::Document::useDarkAppearance const):
837         * inspector/agents/InspectorPageAgent.cpp:
838         (WebCore::InspectorPageAgent::enable):
839         * page/Page.cpp:
840         (WebCore::Page::setUseDarkAppearance):
841         (WebCore::Page::useDarkAppearance const):
842         (WebCore::Page::setUseDarkAppearanceOverride):
843         * platform/mac/LocalDefaultSystemAppearance.h:
844         (WebCore::LocalDefaultSystemAppearance::usingDarkAppearance const):
845         * platform/mac/LocalDefaultSystemAppearance.mm:
846         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
847         (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
848         * platform/mac/ScrollAnimatorMac.mm:
849         * rendering/RenderThemeMac.mm:
850         (-[WebCoreTextFieldCell _adjustedCoreUIDrawOptionsForDrawingBordersOnly:]):
851         (-[WebListButtonCell drawWithFrame:inView:]):
852         (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const):
853         (WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const):
854         (WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const):
855         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
856         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const):
857         (WebCore::RenderThemeMac::systemColor const):
858
859 2019-01-12  Zalan Bujtas  <zalan@apple.com>
860
861         [LFC] Block/InlinFormattingContext should take Block/InlineFormattingState
862         https://bugs.webkit.org/show_bug.cgi?id=193383
863
864         Reviewed by Antti Koivisto.
865
866         This is just a downcast really.
867
868         * layout/FormattingContext.cpp:
869         (WebCore::Layout::FormattingContext::FormattingContext):
870         (WebCore::Layout::FormattingContext::formattingState const): Deleted.
871         * layout/FormattingContext.h:
872         * layout/LayoutState.cpp:
873         (WebCore::Layout::LayoutState::createFormattingContext):
874         * layout/blockformatting/BlockFormattingContext.cpp:
875         (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
876         * layout/blockformatting/BlockFormattingContext.h:
877         (WebCore::Layout::BlockFormattingContext::formattingState const):
878         (WebCore::Layout::BlockFormattingContext::blockFormattingState const): Deleted.
879         * layout/inlineformatting/InlineFormattingContext.cpp:
880         (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
881         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
882         (WebCore::Layout::InlineFormattingContext::createFinalRuns const):
883         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
884         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
885         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
886         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
887         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
888         * layout/inlineformatting/InlineFormattingContext.h:
889         (WebCore::Layout::InlineFormattingContext::formattingState const):
890         (WebCore::Layout::InlineFormattingContext::inlineFormattingState const): Deleted.
891         * page/FrameViewLayoutContext.cpp:
892         (WebCore::layoutUsingFormattingContext):
893
894 2019-01-12  Myles C. Maxfield  <mmaxfield@apple.com>
895
896         [WHLSL] Add native function synthesis passes
897         https://bugs.webkit.org/show_bug.cgi?id=193360
898
899         Reviewed by Dean Jackson.
900
901         This patch includes all the passes in prepare() that are between the name resolver and the
902         type checker. It involves a few small pieces:
903
904         - CheckDuplicateFunctions which makes sure the same function isn't defined twice
905         - Intrinsics, which remembers all of the native types so they can be referred to by the
906           rest of the compiler
907         - RecursiveTypeChecker which makes sure types don't refer to themselves
908         - SynthesizeArrayOperatorLength which creates operator.length() functions for arrays
909         - SynthesizeConstructors which creates copy constructors and default constructors for all
910           types
911         - SynthesizeEnumerationFunctions which provides cast operators between enum types and their
912           base types
913         - SynthesizeStructureAccessors which provides getters, setters, and anders for each member
914           of a struct
915
916         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
917         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
918
919         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
920         (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableType const):
921         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
922         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
923         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp: Added.
924         (WebCore::WHLSL::checkDuplicateFunctions):
925         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
926         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp: Added.
927         (WebCore::WHLSL::Intrinsics::Intrinsics):
928         (WebCore::WHLSL::Intrinsics::add):
929         (WebCore::WHLSL::Intrinsics::addPrimitive):
930         (WebCore::WHLSL::Intrinsics::addVector):
931         (WebCore::WHLSL::Intrinsics::addMatrix):
932         (WebCore::WHLSL::Intrinsics::addFullTexture):
933         (WebCore::WHLSL::Intrinsics::addDepthTexture):
934         (WebCore::WHLSL::Intrinsics::addTexture):
935         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h: Added.
936         (WebCore::WHLSL::Intrinsics::voidType const):
937         (WebCore::WHLSL::Intrinsics::boolType const):
938         (WebCore::WHLSL::Intrinsics::intType const):
939         (WebCore::WHLSL::Intrinsics::uintType const):
940         (WebCore::WHLSL::Intrinsics::samplerType const):
941         (WebCore::WHLSL::Intrinsics::floatType const):
942         (WebCore::WHLSL::Intrinsics::float3Type const):
943         (WebCore::WHLSL::Intrinsics::float4Type const):
944         * Modules/webgpu/WHLSL/WHLSLProgram.h:
945         (WebCore::WHLSL::Program::append):
946         (WebCore::WHLSL::Program::intrinsics):
947         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp: Added.
948         (WebCore::WHLSL::checkRecursiveTypes):
949         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
950         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp: Added.
951         (WebCore::WHLSL::FindArrayTypes::takeArrayTypes):
952         (WebCore::WHLSL::synthesizeArrayOperatorLength):
953         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
954         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: Added.
955         (WebCore::WHLSL::FindAllTypes::takeUnnamedTypes):
956         (WebCore::WHLSL::FindAllTypes::takeNamedTypes):
957         (WebCore::WHLSL::synthesizeConstructors):
958         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
959         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp: Added.
960         (WebCore::WHLSL::synthesizeEnumerationFunctions):
961         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
962         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp: Added.
963         (WebCore::WHLSL::synthesizeStructureAccessors):
964         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
965         * Sources.txt:
966         * WebCore.xcodeproj/project.pbxproj:
967
968 2019-01-12  Dan Bernstein  <mitz@apple.com>
969
970         [Cocoa] Avoid importing directly from subumbrella frameworks
971         https://bugs.webkit.org/show_bug.cgi?id=186016
972         <rdar://problem/40591038>
973
974         Reviewed by Sam Weinig.
975
976         * Configurations/WebCore.xcconfig: Removed -iframework options from OTHER_CFLAGS and
977           OTHER_CPLUSPLUSFLAGS.
978         * editing/mac/DictionaryLookupLegacy.mm: Import Quartz.h instead of a PDFKit header.
979         * platform/mac/PlatformEventFactoryMac.mm: Import Carbon.h instead of HIToolbox headers.
980         * platform/text/mac/TextEncodingRegistryMac.mm: Import Carbon.h instead of CarbonCore.h.
981
982 2019-01-12  Zalan Bujtas  <zalan@apple.com>
983
984         [LFC] Move formatting context creation from FormattingState to LayoutState
985         https://bugs.webkit.org/show_bug.cgi?id=193381
986
987         Reviewed by Antti Koivisto.
988
989         layoutState().createFormattingStateForFormattingRootIfNeeded(root).createFormattingContext(root) is not only mouthful
990         but also feels unintuitive. Use layoutState().createFormattingContext(root) instead.
991
992         * layout/FormattingContext.cpp:
993         (WebCore::Layout::FormattingContext::FormattingContext):
994         (WebCore::Layout::FormattingContext::~FormattingContext):
995         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
996         * layout/FormattingContextGeometry.cpp:
997         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
998         * layout/FormattingState.h:
999         * layout/LayoutState.cpp:
1000         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
1001         (WebCore::Layout::LayoutState::createFormattingContext):
1002         * layout/LayoutState.h:
1003         (WebCore::Layout::LayoutState::deregisterFormattingContext):
1004         (WebCore::Layout::LayoutState::registerFormattingContext):
1005         * layout/blockformatting/BlockFormattingContext.cpp:
1006         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1007         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
1008         * layout/blockformatting/BlockFormattingState.cpp:
1009         (WebCore::Layout::BlockFormattingState::createFormattingContext): Deleted.
1010         * layout/blockformatting/BlockFormattingState.h:
1011         * layout/inlineformatting/InlineFormattingContext.cpp:
1012         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
1013         * layout/inlineformatting/InlineFormattingState.cpp:
1014         (WebCore::Layout::InlineFormattingState::createFormattingContext): Deleted.
1015         * layout/inlineformatting/InlineFormattingState.h:
1016
1017 2019-01-12  Zalan Bujtas  <zalan@apple.com>
1018
1019         [LFC][BFC][MarginCollapsing] Move estimatedMarginBefore flag from state/display box to BlockFormattingContext
1020         https://bugs.webkit.org/show_bug.cgi?id=193375
1021
1022         Reviewed by Antti Koivisto.
1023
1024         The estimated marginBefore is a pre-computed, temporary value. We need to keep it around until the final vertical margin value is computed.
1025         Neither BlockFormattingState nor Display should hold temporary values.
1026
1027         * layout/blockformatting/BlockFormattingContext.cpp:
1028         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
1029         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
1030         (WebCore::Layout::BlockFormattingContext::hasPrecomputedMarginBefore const):
1031         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1032         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
1033         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1034         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1035         (WebCore::Layout::BlockFormattingContext::setEstimatedMarginBefore const):
1036         (WebCore::Layout::BlockFormattingContext::hasEstimatedMarginBefore const):
1037         (WebCore::Layout::hasPrecomputedMarginBefore): Deleted.
1038         * layout/blockformatting/BlockFormattingContext.h:
1039         (WebCore::Layout::BlockFormattingContext::removeEstimatedMarginBefore const):
1040         (WebCore::Layout::BlockFormattingContext::estimatedMarginBefore const):
1041         * layout/blockformatting/BlockFormattingState.h:
1042         (WebCore::Layout::BlockFormattingState::setHasEstimatedMarginBefore): Deleted.
1043         (WebCore::Layout::BlockFormattingState::clearHasEstimatedMarginBefore): Deleted.
1044         (WebCore::Layout::BlockFormattingState::hasEstimatedMarginBefore const): Deleted.
1045         * layout/displaytree/DisplayBox.cpp:
1046         (WebCore::Display::Box::Box):
1047         * layout/displaytree/DisplayBox.h:
1048         (WebCore::Display::Box::setHasEstimatedMarginBefore):
1049         (WebCore::Display::Box::invalidateEstimatedMarginBefore):
1050         (WebCore::Display::Box::top const):
1051         (WebCore::Display::Box::topLeft const):
1052         (WebCore::Display::Box::setEstimatedMarginBefore): Deleted.
1053         (WebCore::Display::Box::estimatedMarginBefore const): Deleted.
1054         * page/FrameViewLayoutContext.cpp:
1055         (WebCore::layoutUsingFormattingContext):
1056
1057 2019-01-11  Myles C. Maxfield  <mmaxfield@apple.com>
1058
1059         [WHLSL] Implement the NameResolver
1060         https://bugs.webkit.org/show_bug.cgi?id=193007
1061
1062         Reviewed by Dean Jackson.
1063
1064         This is the base implementation for WHLSL's name resolver. The name resolver matches three kinds of things:
1065         1. It matches VariableRefs to VariableDecls
1066         2. It matches TypeRefs to NamedTypes
1067         3. It matches CallExpressions to FunctionDeclarations
1068
1069         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
1070         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
1071
1072         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp: Now that InferTypes.h exists, we can implement these
1073         functions.
1074         (WebCore::WHLSL::AST::FloatLiteralType::canResolve const):
1075         (WebCore::WHLSL::AST::FloatLiteralType::conversionCost const):
1076         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h: Remove unnecessary function.
1077         (WebCore::WHLSL::AST::FloatLiteralType::value const): Deleted.
1078         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp: Now that InferTypes.h exists, we can implement these
1079         functions.
1080         (WebCore::WHLSL::AST::IntegerLiteralType::canResolve const):
1081         (WebCore::WHLSL::AST::IntegerLiteralType::conversionCost const):
1082         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h: Remove unnecessary function.
1083         (WebCore::WHLSL::AST::IntegerLiteralType::value const): Deleted.
1084         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp: Modifying Sources.txt caused the sources
1085         to get shuffled around, so the #includes need to be fixed.
1086         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp: Now that InferTypes.h exists, we can implement
1087         these functions.
1088         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::canResolve const):
1089         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::conversionCost const):
1090         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h: Remove unnecessary function.
1091         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::value const): Deleted.
1092         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp: Added. This is the replacement for UnificationContext in the
1093         reference compiler. It's much simpler (and we should remove UnificationContext in the reference compiler in
1094         favor of this design). It has three sets of functions: Tell if two types are the same, tell if two types are
1095         the same and commit the resolvable type, and run the above functions on type references or function arguments.
1096         (WebCore::WHLSL::matches):
1097         (WebCore::WHLSL::matchAndCommit):
1098         (WebCore::WHLSL::commit):
1099         (WebCore::WHLSL::inferTypesForTypeArguments):
1100         (WebCore::WHLSL::inferTypesForCall):
1101         * Modules/webgpu/WHLSL/WHLSLInferTypes.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp.
1102         * Modules/webgpu/WHLSL/WHLSLNameContext.cpp: Added. This is the data structure that remembers NamedTypes,
1103         FunctionDeclarations, and VariableDeclarations so NameResolver can work.
1104         (WebCore::WHLSL::NameContext::NameContext):
1105         (WebCore::WHLSL::NameContext::add):
1106         (WebCore::WHLSL::NameContext::getTypes):
1107         (WebCore::WHLSL::NameContext::getFunctions):
1108         (WebCore::WHLSL::NameContext::getVariable):
1109         (WebCore::WHLSL::NameContext::exists):
1110         * Modules/webgpu/WHLSL/WHLSLNameContext.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h.
1111         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp: Added. Use the NameContext to match up the three types of names.
1112         (WebCore::WHLSL::NameResolver::NameResolver):
1113         (WebCore::WHLSL::NameResolver::visit):
1114         (WebCore::WHLSL::resolveNamesInTypes):
1115         (WebCore::WHLSL::resolveNamesInFunctions):
1116         * Modules/webgpu/WHLSL/WHLSLNameResolver.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h.
1117         (WebCore::WHLSL::NameResolver::setCurrentFunctionDefinition):
1118         * Modules/webgpu/WHLSL/WHLSLProgram.h:
1119         (WebCore::WHLSL::Program::append): The parser needs to add all global declarations to the name context so the
1120         name resolver is ready to go as soon as parsing is finished.
1121         (WebCore::WHLSL::Program::nameContext):
1122         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp: Added. Pick the appropriate FunctionDeclaration or
1123         NamedType for a particular CallExpression or TypeReference.
1124         (WebCore::WHLSL::conversionCost):
1125         (WebCore::WHLSL::resolveFunctionOverloadImpl):
1126         (WebCore::WHLSL::resolveTypeOverloadImpl):
1127         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp.
1128         * Modules/webgpu/WHLSL/WHLSLResolvingType.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp. This describes the two states that a type in the type resolver can be in: either an owned
1129         UnnamedType, or a reference to a ResolvableType. This is because every expression needs to have a type
1130         associated with it, but those types might be the type of a literal (aka a ResolvableType). Multiple
1131         expressions might need to reference the same ResolvableType so when it gets resolved, all the expressions
1132         get the result.
1133         (WebCore::WHLSL::ResolvableTypeReference::ResolvableTypeReference):
1134         (WebCore::WHLSL::ResolvableTypeReference::resolvableType):
1135         * Sources.txt:
1136         * WebCore.xcodeproj/project.pbxproj:
1137
1138 2019-01-11  Myles C. Maxfield  <mmaxfield@apple.com>
1139
1140         [WHLSL] Add a Visitor class
1141         https://bugs.webkit.org/show_bug.cgi?id=192826
1142
1143         Reviewed by Dean Jackson.
1144
1145         This patch exposes a bunch of the private members of WHLSL's AST nodes so that Visitor can recurse on constituent nodes.
1146         It also writes the recursion in Visitor.h. This is a virtual base class that gets subclassed for compiler passes.
1147
1148         I've split this part into its own patch to aid reviewing of the compiler.
1149
1150         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
1151         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp: Added.
1152         (WebCore::WHLSL::Visitor::visit):
1153         (WebCore::WHLSL::Visitor::checkErrorAndVisit):
1154         * Modules/webgpu/WHLSL/WHLSLVisitor.h: Added.
1155         (WebCore::WHLSL::Visitor::setError):
1156         (WebCore::WHLSL::Visitor::error const):
1157         * Sources.txt:
1158         * WebCore.xcodeproj/project.pbxproj:
1159
1160 2019-01-11  Jer Noble  <jer.noble@apple.com>
1161
1162         REGRESSION(r239419): Crash in AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC()
1163         https://bugs.webkit.org/show_bug.cgi?id=193342
1164         <rdar://problem/47119836>
1165
1166         Reviewed by Eric Carlson.
1167
1168         Make the TapStorage used by AudioSourceProviderAVFObjC thread-safe RefCounted.
1169
1170         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
1171         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1172         (WebCore::AudioSourceProviderAVFObjC::initCallback):
1173         (WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
1174
1175 2019-01-11  John Wilander  <wilander@apple.com>
1176
1177         Compile out Web API Statistics Collection
1178         https://bugs.webkit.org/show_bug.cgi?id=193370
1179         <rdar://problem/45388584>
1180
1181         Reviewed by Brent Fulgham.
1182
1183         No new tests. This patch disables functionality. The associated tests
1184         are skipped.
1185
1186         These functions are now no-ops unless web API statistics is enabled.
1187
1188         * Configurations/FeatureDefines.xcconfig:
1189         * loader/ResourceLoadObserver.cpp:
1190         (WebCore::ResourceLoadObserver::logFontLoad):
1191         (WebCore::ResourceLoadObserver::logCanvasRead):
1192         (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
1193         (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
1194         (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
1195         * loader/ResourceLoadStatistics.cpp:
1196         (WebCore::ResourceLoadStatistics::encode const):
1197         (WebCore::ResourceLoadStatistics::decode):
1198         (WebCore::ResourceLoadStatistics::toString const):
1199         (WebCore::ResourceLoadStatistics::merge):
1200         * loader/ResourceLoadStatistics.h:
1201             The associated struct members are skipped unless web API
1202             statistics is enabled.
1203
1204 2019-01-11  Sihui Liu  <sihui_liu@apple.com>
1205
1206         IndexedDB: leak WebIDBConnectionToClient for retain cycle
1207         https://bugs.webkit.org/show_bug.cgi?id=193097
1208         <rdar://problem/46899601>
1209
1210         Reviewed by Brady Eidson.
1211
1212         Let IDBConnectionToClient hold a WeakPtr of IDBConnectionToClientDelegate.
1213
1214         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
1215         (WebCore::IDBServer::IDBConnectionToClient::IDBConnectionToClient):
1216         (WebCore::IDBServer::IDBConnectionToClient::identifier const):
1217         (WebCore::IDBServer::IDBConnectionToClient::didDeleteDatabase):
1218         (WebCore::IDBServer::IDBConnectionToClient::didOpenDatabase):
1219         (WebCore::IDBServer::IDBConnectionToClient::didAbortTransaction):
1220         (WebCore::IDBServer::IDBConnectionToClient::didCreateObjectStore):
1221         (WebCore::IDBServer::IDBConnectionToClient::didDeleteObjectStore):
1222         (WebCore::IDBServer::IDBConnectionToClient::didRenameObjectStore):
1223         (WebCore::IDBServer::IDBConnectionToClient::didClearObjectStore):
1224         (WebCore::IDBServer::IDBConnectionToClient::didCreateIndex):
1225         (WebCore::IDBServer::IDBConnectionToClient::didDeleteIndex):
1226         (WebCore::IDBServer::IDBConnectionToClient::didRenameIndex):
1227         (WebCore::IDBServer::IDBConnectionToClient::didPutOrAdd):
1228         (WebCore::IDBServer::IDBConnectionToClient::didGetRecord):
1229         (WebCore::IDBServer::IDBConnectionToClient::didGetAllRecords):
1230         (WebCore::IDBServer::IDBConnectionToClient::didGetCount):
1231         (WebCore::IDBServer::IDBConnectionToClient::didDeleteRecord):
1232         (WebCore::IDBServer::IDBConnectionToClient::didOpenCursor):
1233         (WebCore::IDBServer::IDBConnectionToClient::didIterateCursor):
1234         (WebCore::IDBServer::IDBConnectionToClient::didCommitTransaction):
1235         (WebCore::IDBServer::IDBConnectionToClient::fireVersionChangeEvent):
1236         (WebCore::IDBServer::IDBConnectionToClient::didStartTransaction):
1237         (WebCore::IDBServer::IDBConnectionToClient::didCloseFromServer):
1238         (WebCore::IDBServer::IDBConnectionToClient::notifyOpenDBRequestBlocked):
1239         (WebCore::IDBServer::IDBConnectionToClient::didGetAllDatabaseNames):
1240         * Modules/indexeddb/server/IDBConnectionToClient.h:
1241         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
1242
1243 2019-01-11  Myles C. Maxfield  <mmaxfield@apple.com>
1244
1245         Fix the build after r239844
1246         https://bugs.webkit.org/show_bug.cgi?id=192991
1247
1248         Unreviewed.
1249
1250         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
1251         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
1252         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
1253         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
1254
1255 2019-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1256
1257         [iOS] Precision drop state thrashes when dragging near the top edge of an editable element
1258         https://bugs.webkit.org/show_bug.cgi?id=193364
1259         <rdar://problem/47214117>
1260
1261         Reviewed by Tim Horton.
1262
1263         Add a new helper method on DragCaretController to compute the bounds of the editable element around the drop
1264         caret position. This is either the enclosing form control (in the case of text fields and text areas), or the
1265         highest editable root. See WebKit ChangeLog for more details.
1266
1267         Test: DragAndDropTests.AvoidPreciseDropNearTopOfTextArea
1268
1269         * editing/FrameSelection.cpp:
1270         (WebCore::DragCaretController::editableElementRectInRootViewCoordinates const):
1271         * editing/FrameSelection.h:
1272
1273 2019-01-11  Tim Horton  <timothy_horton@apple.com>
1274
1275         REGRESSION (PSON): Firefox app lacks Open in New Tab in menu
1276         https://bugs.webkit.org/show_bug.cgi?id=193366
1277         <rdar://problem/46097212>
1278
1279         Reviewed by Simon Fraser.
1280
1281         * platform/RuntimeApplicationChecks.h:
1282         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
1283         (WebCore::IOSApplication::isFirefox):
1284         Add a Firefox Mobile bundle check.
1285
1286 2019-01-11  Antti Koivisto  <antti@apple.com>
1287
1288         Release assert when removing element with a map element in the shadow tree
1289         https://bugs.webkit.org/show_bug.cgi?id=193351
1290         <rdar://problem/47208807>
1291
1292         Reviewed by Ryosuke Niwa.
1293
1294         When a shadow host that has a map element in the shadow tree is removed from the document, we try
1295         to remove the map from the scope of the host.
1296
1297         Test: fast/shadow-dom/image-map-tree-scope.html
1298
1299         * html/HTMLMapElement.cpp:
1300         (WebCore::HTMLMapElement::insertedIntoAncestor):
1301         (WebCore::HTMLMapElement::removedFromAncestor):
1302
1303         Add and remove image maps when the scope changes, not when the document changes.
1304         This matches how id/name/etc updates work in the HTMLElement.
1305
1306 2019-01-11  Sihui Liu  <sihui_liu@apple.com>
1307
1308         Fix an assertion in UniqueIDBDatabase
1309         https://bugs.webkit.org/show_bug.cgi?id=193096
1310
1311         Reviewed by Brady Eidson.
1312
1313         m_objectStoreTransactionCounts.count(objectStore) == 1 in UniqueIDBDatabase::operationAndTransactionTimerFired()
1314         is not necessarily true because m_objectStoreTransactionCounts may be cleared in immediateCloseForUserDelete.
1315
1316         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1317         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
1318
1319 2019-01-11  Miguel Gomez  <magomez@igalia.com>
1320
1321         [GTK] Garbled rendering on Youtube while scrolling under X11.
1322         https://bugs.webkit.org/show_bug.cgi?id=192982
1323
1324         Reviewed by Carlos Garcia Campos.
1325
1326         When creating a GLX window context, try to get a GLXFBConfig that has depth and stencil buffers for
1327         the default framebuffer.
1328
1329         * platform/graphics/glx/GLContextGLX.cpp:
1330         (WebCore::compatibleVisuals):
1331         (WebCore::GLContextGLX::createWindowContext):
1332
1333 2019-01-11  Sihui Liu  <sihui_liu@apple.com>
1334
1335         IndexedDB: leak IDBTransaction, TransactionOperation and IDBRequest in layout tests
1336         https://bugs.webkit.org/show_bug.cgi?id=193167
1337         <rdar://problem/46891688>
1338
1339         Reviewed by Geoffrey Garen.
1340
1341         Do some cleanup to break retain cycle when context is stopped. 
1342
1343         * Modules/indexeddb/IDBOpenDBRequest.cpp:
1344         (WebCore::IDBOpenDBRequest::cancelForStop):
1345         * Modules/indexeddb/IDBTransaction.cpp:
1346         (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
1347         (WebCore::IDBTransaction::stop):
1348         (WebCore::IDBTransaction::removeRequest):
1349         * Modules/indexeddb/client/TransactionOperation.h:
1350         (WebCore::IDBClient::TransactionOperation::doComplete):
1351
1352 2019-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1353
1354         Introduce IDL files for runtime-enabled UndoManager and UndoItem JavaScript API
1355         https://bugs.webkit.org/show_bug.cgi?id=193109
1356         <rdar://problem/44807048>
1357
1358         Reviewed by Ryosuke Niwa.
1359
1360         Adds new IDL files and stubs for UndoManager and UndoItem. This is an experimental DOM API that (in the near
1361         future) is intended only for use in internal WebKit text editing clients. This API allows the page to
1362         participate in the processes of undoing and redoing by defining custom undo and redo handlers, to be executed
1363         when undo or redo is triggered.
1364
1365         Tests: editing/undo-manager/undo-manager-interfaces.html
1366                editing/undo-manager/undo-manager-keeps-wrapper-alive.html
1367
1368         * CMakeLists.txt:
1369         * DerivedSources-input.xcfilelist:
1370         * DerivedSources-output.xcfilelist:
1371         * DerivedSources.make:
1372         * Sources.txt:
1373         * UnifiedSources-input.xcfilelist:
1374         * WebCore.xcodeproj/project.pbxproj:
1375
1376         Add new source files.
1377
1378         * bindings/js/WebCoreBuiltinNames.h:
1379
1380         Add "UndoManager" and "UndoItem" names.
1381
1382         * dom/Document.cpp:
1383         (WebCore::m_undoManager):
1384
1385         Have the document own a UndoManager.
1386
1387         * dom/Document.h:
1388         (WebCore::Document::undoManager const):
1389         * dom/Document.idl:
1390         * page/RuntimeEnabledFeatures.h:
1391         (WebCore::RuntimeEnabledFeatures::setUndoManagerAPIEnabled):
1392         (WebCore::RuntimeEnabledFeatures::undoManagerAPIEnabled const):
1393
1394         Guard the new bindings behind a runtime-enabled feature flag.
1395
1396         * page/UndoItem.h: Added.
1397         (WebCore::UndoItem::create):
1398         (WebCore::UndoItem::label const):
1399         (WebCore::UndoItem::undoHandler const):
1400         (WebCore::UndoItem::redoHandler const):
1401         (WebCore::UndoItem::UndoItem):
1402         * page/UndoItem.idl: Added.
1403         * page/UndoManager.cpp: Added.
1404         (WebCore::UndoManager::addItem):
1405         * page/UndoManager.h: Added.
1406         (WebCore::UndoManager::create):
1407         (WebCore::UndoManager::document):
1408         (WebCore::UndoManager::UndoManager):
1409         * page/UndoManager.idl: Added.
1410         * page/mac/WheelEventDeltaFilterMac.h:
1411
1412         Necessary (albeit unrelated) build fix to appease unified sources.
1413
1414 2019-01-11  Zalan Bujtas  <zalan@apple.com>
1415
1416         [LFC][BFC][MarginCollapsing] Adjust vertical position when box margin collapses through.
1417         https://bugs.webkit.org/show_bug.cgi?id=193346
1418
1419         Reviewed by Antti Koivisto.
1420
1421         If the top and bottom margins of a box are adjoining, then it is possible for margins to collapse through it.
1422         In this case, the position of the element depends on its relationship with the other elements whose margins are being collapsed.
1423
1424         1. If the element's margins are collapsed with its parent's top margin, the top border edge of the box is defined to be the same as the parent's.
1425         2. Otherwise, either the element's parent is not taking part in the margin collapsing, or only the parent's bottom margin is involved.
1426            The position of the element's top border edge is the same as it would have been if the element had a non-zero bottom border.
1427
1428         Test: fast/block/block-only/collapsed-through-with-parent.html
1429
1430         * layout/MarginTypes.h:
1431         (WebCore::Layout::EstimatedMarginBefore::usedValue const):
1432         * layout/blockformatting/BlockFormattingContext.cpp:
1433         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
1434         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1435         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
1436         * layout/blockformatting/BlockFormattingContext.h:
1437         * layout/blockformatting/BlockMarginCollapse.cpp:
1438         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
1439         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeIgnoringCollapsingThrough):
1440
1441 2019-01-10  Myles C. Maxfield  <mmaxfield@apple.com>
1442
1443         [WHLSL] Include the standard library
1444         https://bugs.webkit.org/show_bug.cgi?id=192994
1445
1446         Reviewed by Jon Lee.
1447
1448         A small section of the standard library is present in WHLSLStandardLibrary.txt. This gets turned into a header file containing
1449         its raw data at build time by invoking our xxd.pl script (which WebCore already uses for other purposes). The standard
1450         library is generated by running a JavaScript script, but currently there is no way to invoke JavaScript from our build
1451         process, so this patch includes in the standard library's raw text instead. Once the parser is faster, we can include the
1452         entire standard library.
1453
1454         No new tests because it isn't hooked up yet.
1455
1456         * DerivedSources.make:
1457         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: Added.
1458         * WebCore.xcodeproj/project.pbxproj:
1459
1460 2019-01-10  Jer Noble  <jer.noble@apple.com>
1461
1462         <video> elements do not enter 'paused' state when playing to end over AirPlay
1463         https://bugs.webkit.org/show_bug.cgi?id=193295
1464         <rdar://problem/46708670>
1465
1466         Reviewed by Eric Carlson.
1467
1468         Adopt the -[AVPlayer timeControlStatus] API, which reports whether the AVPlayer is paused, playing, or blocked waiting
1469         for more data before playing. AirPlay devices report this state back from the remote device, and this allows the
1470         MediaPlayerPrivateAVFoundationObjC to differentiate between user-generated pauses and simple stalling.
1471
1472         Adopting this API allows us to remove the heuristic from rateChanged() which inteprets a rate change when the
1473         readyState > HAVE_ENOUGH as an intentional pause.
1474
1475         Drive-by fix: MediaPlayerPrivateAVFoundation had some code to delay calling platformPlay()
1476         until the first frame became available. But this code was entirely undermined by the previous
1477         behavior of setRate(). Fixing setRate()/setRateDouble() to only start playback if playback was
1478         actually requested started making this code work for the first time, and broke some API tests.
1479         Thus, we're removing this previously dead code.
1480
1481         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1482         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
1483         (WebCore::MediaPlayerPrivateAVFoundation::play):
1484         (WebCore::MediaPlayerPrivateAVFoundation::pause):
1485         (WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
1486         (WebCore::MediaPlayerPrivateAVFoundation::updateStates):
1487         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1488         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1489         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1490         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
1491         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
1492         (WebCore::MediaPlayerPrivateAVFoundationObjC::didEnd):
1493         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPlay):
1494         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPause):
1495         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
1496         (WebCore::MediaPlayerPrivateAVFoundationObjC::setRateDouble):
1497         (WebCore::MediaPlayerPrivateAVFoundationObjC::setPlayerRate):
1498         (WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange):
1499         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus):
1500         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1501
1502 2019-01-10  Myles C. Maxfield  <mmaxfield@apple.com>
1503
1504         Fix the build after r239844
1505         https://bugs.webkit.org/show_bug.cgi?id=192991
1506
1507         Unreviewed.
1508
1509         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
1510         (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableType const):
1511         (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableForShaderItemDirection const):
1512         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
1513         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
1514         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableForShaderItemDirection const):
1515         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
1516         (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableType const):
1517         (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableForShaderItemDirection const):
1518         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
1519         (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableType const):
1520         (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableForShaderItemDirection const):
1521
1522 2019-01-10  Justin Fan  <justin_fan@apple.com>
1523
1524         [WebGPU] WebGPUBindGroup and device::createBindGroup prototype
1525         https://bugs.webkit.org/show_bug.cgi?id=193341
1526
1527         Reviewed by Myles C. Maxfield.
1528
1529         Add *GPUBindGroup class stubs and the ability to create WebGPUBindGroups via the API.
1530
1531         Test: bind-groups.html
1532
1533         * CMakeLists.txt:
1534         * DerivedSources.make:
1535         * Sources.txt:
1536         * WebCore.xcodeproj/project.pbxproj:
1537         * bindings/js/WebCoreBuiltinNames.h:
1538
1539         * Modules/webgpu/WebGPUBindGroup.cpp:
1540         (WebCore::WebGPUBindGroup::create):
1541         (WebCore::WebGPUBindGroup::WebGPUBindGroup):
1542         * Modules/webgpu/WebGPUBindGroup.h:
1543         * Modules/webgpu/WebGPUBindGroup.idl: Enable createBindGroup().
1544         * Modules/webgpu/WebGPUDevice.cpp:
1545         (WebCore::BindingResourceVisitor::operator() const): Added. Validate and convert WebGPUBindGroupDescriptor to GPU* version.
1546         (WebCore::WebGPUDevice::createBindGroup const): Added.
1547         * Modules/webgpu/WebGPUDevice.h:
1548         * platform/graphics/gpu/GPUBindGroup.cpp:
1549         (WebCore::GPUBindGroup::create):
1550         (WebCore::GPUBindGroup::GPUBindGroup):
1551         * platform/graphics/gpu/GPUBindGroup.h:
1552         * platform/graphics/gpu/GPUBufferBinding.h:
1553         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
1554         (WebCore::appendArgumentToArray): Pass RetainPtr by reference to actually update descriptor.
1555
1556 2019-01-10  Simon Fraser  <simon.fraser@apple.com>
1557
1558         Fix rare crash under ScrollbarThemeMac::paintScrollCorner()
1559         https://bugs.webkit.org/show_bug.cgi?id=193337
1560         rdar://problem/47179993
1561
1562         Reviewed by Zalan Bujtas.
1563         
1564         Async image decoding can trigger a FrameView::traverseForPaintInvalidation() fake paint,
1565         which creates a GraphicsContext with no platform context. However, we could hit ScrollView::paintScrollbars()
1566         which tried to get at the platform context, and then crashed.
1567         
1568         So protect two functions in ScrollbarThemeMac with if (context.paintingDisabled()) checks. I verified
1569         that other scrollbar-related painting code paths were already protected.
1570
1571         Hard to test because it depends on async image decoding timing.
1572
1573         * platform/mac/ScrollbarThemeMac.mm:
1574         (WebCore::ScrollbarThemeMac::paint):
1575         (WebCore::ScrollbarThemeMac::paintScrollCorner):
1576
1577 2019-01-10  Myles C. Maxfield  <mmaxfield@apple.com>
1578
1579         [WHLSL] Implement parser AST nodes
1580         https://bugs.webkit.org/show_bug.cgi?id=192991
1581
1582         Reviewed by Alex Christensen.
1583
1584         This patch creates all the AST nodes which will be the result of running the parser.
1585         This patch used to be a part of the "create a WHLSL parser" patch but I split them
1586         out in order to aid reviewing.
1587
1588         The classes were mechanically created to match the result of the parser. There are
1589         nodes for things like ForLoops, LogicalNotExpressions, DereferenceExpressions,
1590         StructureDefinitions, and things like that. The classes don't actually have any logic
1591         in them - they are currently just containers to hold the structure of the parsed
1592         program. Some of these nodes (like constexprs) are just Variants of the various things
1593         they can in the form of.
1594
1595         No new tests because the parser doesn't exist to create the new AST nodes yet.
1596
1597         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h: Added.
1598         (WebCore::WHLSL::AST::ArrayReferenceType::ArrayReferenceType):
1599         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h: Added.
1600         (WebCore::WHLSL::AST::ArrayType::ArrayType):
1601         (WebCore::WHLSL::AST::ArrayType::type const):
1602         (WebCore::WHLSL::AST::ArrayType::type):
1603         (WebCore::WHLSL::AST::ArrayType::numElements const):
1604         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h: Added.
1605         (WebCore::WHLSL::AST::AssignmentExpression::AssignmentExpression):
1606         (WebCore::WHLSL::AST::AssignmentExpression::left):
1607         (WebCore::WHLSL::AST::AssignmentExpression::right):
1608         * Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h: Added.
1609         (WebCore::WHLSL::AST::BaseFunctionAttribute::BaseFunctionAttribute):
1610         * Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h: Added.
1611         (WebCore::WHLSL::AST::BaseSemantic::BaseSemantic):
1612         * Modules/webgpu/WHLSL/AST/WHLSLBlock.h: Added.
1613         (WebCore::WHLSL::AST::Block::Block):
1614         (WebCore::WHLSL::AST::Block::statements):
1615         * Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h: Added.
1616         (WebCore::WHLSL::AST::BooleanLiteral::BooleanLiteral):
1617         (WebCore::WHLSL::AST::BooleanLiteral::value const):
1618         (WebCore::WHLSL::AST::BooleanLiteral::clone const):
1619         * Modules/webgpu/WHLSL/AST/WHLSLBreak.h: Added.
1620         (WebCore::WHLSL::AST::Break::Break):
1621         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp: Added.
1622         (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableType const):
1623         (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableForShaderItemDirection const):
1624         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h: Added.
1625         (WebCore::WHLSL::AST::BuiltInSemantic::BuiltInSemantic):
1626         (WebCore::WHLSL::AST::BuiltInSemantic::variable const):
1627         (WebCore::WHLSL::AST::BuiltInSemantic::operator== const):
1628         (WebCore::WHLSL::AST::BuiltInSemantic::operator!= const):
1629         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h: Added.
1630         (WebCore::WHLSL::AST::CallExpression::CallExpression):
1631         (WebCore::WHLSL::AST::CallExpression::arguments):
1632         (WebCore::WHLSL::AST::CallExpression::name):
1633         (WebCore::WHLSL::AST::CallExpression::setCastData):
1634         (WebCore::WHLSL::AST::CallExpression::isCast):
1635         (WebCore::WHLSL::AST::CallExpression::castReturnType):
1636         (WebCore::WHLSL::AST::CallExpression::hasOverloads const):
1637         (WebCore::WHLSL::AST::CallExpression::overloads):
1638         (WebCore::WHLSL::AST::CallExpression::setOverloads):
1639         (WebCore::WHLSL::AST::CallExpression::setFunction):
1640         * Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h: Added.
1641         (WebCore::WHLSL::AST::CommaExpression::CommaExpression):
1642         (WebCore::WHLSL::AST::CommaExpression::list):
1643         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h: Added.
1644         (WebCore::WHLSL::AST::ConstantExpression::ConstantExpression):
1645         (WebCore::WHLSL::AST::ConstantExpression::integerLiteral):
1646         (WebCore::WHLSL::AST::ConstantExpression::visit):
1647         (WebCore::WHLSL::AST::ConstantExpression::visit const):
1648         (WebCore::WHLSL::AST::ConstantExpression::clone const):
1649         (WebCore::WHLSL::AST::ConstantExpression::matches const):
1650         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpressionEnumerationMemberReference.h: Added.
1651         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::ConstantExpressionEnumerationMemberReference):
1652         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::left const):
1653         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::right const):
1654         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::clone const):
1655         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::enumerationDefinition):
1656         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::enumerationDefinition const):
1657         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::enumerationMember):
1658         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::enumerationMember const):
1659         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::setEnumerationMember):
1660         * Modules/webgpu/WHLSL/AST/WHLSLContinue.h: Added.
1661         (WebCore::WHLSL::AST::Continue::Continue):
1662         * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h: Added.
1663         (WebCore::WHLSL::AST::DereferenceExpression::DereferenceExpression):
1664         (WebCore::WHLSL::AST::DereferenceExpression::pointer):
1665         * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h: Added.
1666         (WebCore::WHLSL::AST::DoWhileLoop::DoWhileLoop):
1667         (WebCore::WHLSL::AST::DoWhileLoop::body):
1668         (WebCore::WHLSL::AST::DoWhileLoop::conditional):
1669         * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h: Added.
1670         (WebCore::WHLSL::AST::DotExpression::DotExpression):
1671         (WebCore::WHLSL::AST::DotExpression::fieldName):
1672         * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h: Added.
1673         (WebCore::WHLSL::AST::EffectfulExpressionStatement::EffectfulExpressionStatement):
1674         (WebCore::WHLSL::AST::EffectfulExpressionStatement::effectfulExpression):
1675         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h: Added.
1676         (WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition):
1677         (WebCore::WHLSL::AST::EnumerationDefinition::type):
1678         (WebCore::WHLSL::AST::EnumerationDefinition::add):
1679         (WebCore::WHLSL::AST::EnumerationDefinition::memberByName):
1680         (WebCore::WHLSL::AST::EnumerationDefinition::enumerationMembers):
1681         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h: Added.
1682         (WebCore::WHLSL::AST::EnumerationMember::EnumerationMember):
1683         (WebCore::WHLSL::AST::EnumerationMember::origin const):
1684         (WebCore::WHLSL::AST::EnumerationMember::name):
1685         (WebCore::WHLSL::AST::EnumerationMember::value):
1686         (WebCore::WHLSL::AST::EnumerationMember::setValue):
1687         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h: Added.
1688         (WebCore::WHLSL::AST::EnumerationMemberLiteral::EnumerationMemberLiteral):
1689         (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember):
1690         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h: Added.
1691         (WebCore::WHLSL::AST::Expression::Expression):
1692         (WebCore::WHLSL::AST::Expression::origin const):
1693         (WebCore::WHLSL::AST::Expression::isAssignmentExpression const):
1694         (WebCore::WHLSL::AST::Expression::isBooleanLiteral const):
1695         (WebCore::WHLSL::AST::Expression::isCallExpression const):
1696         (WebCore::WHLSL::AST::Expression::isCommaExpression const):
1697         (WebCore::WHLSL::AST::Expression::isDereferenceExpression const):
1698         (WebCore::WHLSL::AST::Expression::isDotExpression const):
1699         (WebCore::WHLSL::AST::Expression::isFloatLiteral const):
1700         (WebCore::WHLSL::AST::Expression::isIndexExpression const):
1701         (WebCore::WHLSL::AST::Expression::isIntegerLiteral const):
1702         (WebCore::WHLSL::AST::Expression::isLogicalExpression const):
1703         (WebCore::WHLSL::AST::Expression::isLogicalNotExpression const):
1704         (WebCore::WHLSL::AST::Expression::isMakeArrayReferenceExpression const):
1705         (WebCore::WHLSL::AST::Expression::isMakePointerExpression const):
1706         (WebCore::WHLSL::AST::Expression::isNullLiteral const):
1707         (WebCore::WHLSL::AST::Expression::isPropertyAccessExpression const):
1708         (WebCore::WHLSL::AST::Expression::isReadModifyWriteExpression const):
1709         (WebCore::WHLSL::AST::Expression::isTernaryExpression const):
1710         (WebCore::WHLSL::AST::Expression::isUnsignedIntegerLiteral const):
1711         (WebCore::WHLSL::AST::Expression::isVariableReference const):
1712         (WebCore::WHLSL::AST::Expression::isEnumerationMemberLiteral const):
1713         * Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h: Added.
1714         (WebCore::WHLSL::AST::Fallthrough::Fallthrough):
1715         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h: Added.
1716         (WebCore::WHLSL::AST::FloatLiteral::FloatLiteral):
1717         (WebCore::WHLSL::AST::FloatLiteral::type):
1718         (WebCore::WHLSL::AST::FloatLiteral::value const):
1719         (WebCore::WHLSL::AST::FloatLiteral::clone const):
1720         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp: Added.
1721         (WebCore::WHLSL::AST::FloatLiteralType::FloatLiteralType):
1722         (WebCore::WHLSL::AST::FloatLiteralType::canResolve const):
1723         (WebCore::WHLSL::AST::FloatLiteralType::conversionCost const):
1724         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h: Added.
1725         (WebCore::WHLSL::AST::FloatLiteralType::preferredType):
1726         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h: Added.
1727         (WebCore::WHLSL::AST::ForLoop::ForLoop):
1728         (WebCore::WHLSL::AST::ForLoop::~ForLoop):
1729         (WebCore::WHLSL::AST::ForLoop::initialization):
1730         (WebCore::WHLSL::AST::ForLoop::condition):
1731         (WebCore::WHLSL::AST::ForLoop::increment):
1732         (WebCore::WHLSL::AST::ForLoop::body):
1733         * Modules/webgpu/WHLSL/AST/WHLSLFunctionAttribute.h: Added.
1734         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h: Added.
1735         (WebCore::WHLSL::AST::FunctionDeclaration::FunctionDeclaration):
1736         (WebCore::WHLSL::AST::FunctionDeclaration::isFunctionDefinition const):
1737         (WebCore::WHLSL::AST::FunctionDeclaration::isNativeFunctionDeclaration const):
1738         (WebCore::WHLSL::AST::FunctionDeclaration::attributeBlock):
1739         (WebCore::WHLSL::AST::FunctionDeclaration::entryPointType const):
1740         (WebCore::WHLSL::AST::FunctionDeclaration::type const):
1741         (WebCore::WHLSL::AST::FunctionDeclaration::type):
1742         (WebCore::WHLSL::AST::FunctionDeclaration::name const):
1743         (WebCore::WHLSL::AST::FunctionDeclaration::isCast const):
1744         (WebCore::WHLSL::AST::FunctionDeclaration::parameters const):
1745         (WebCore::WHLSL::AST::FunctionDeclaration::parameters):
1746         (WebCore::WHLSL::AST::FunctionDeclaration::semantic):
1747         (WebCore::WHLSL::AST::FunctionDeclaration::isOperator const):
1748         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h: Added.
1749         (WebCore::WHLSL::AST::FunctionDefinition::FunctionDefinition):
1750         (WebCore::WHLSL::AST::FunctionDefinition::block):
1751         (WebCore::WHLSL::AST::FunctionDefinition::restricted const):
1752         * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h: Added.
1753         (WebCore::WHLSL::AST::IfStatement::IfStatement):
1754         (WebCore::WHLSL::AST::IfStatement::conditional):
1755         (WebCore::WHLSL::AST::IfStatement::body):
1756         (WebCore::WHLSL::AST::IfStatement::elseBody):
1757         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h: Added.
1758         (WebCore::WHLSL::AST::IndexExpression::IndexExpression):
1759         (WebCore::WHLSL::AST::IndexExpression::indexExpression):
1760         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.cpp: Added.
1761         (WebCore::WHLSL::AST::IntegerLiteral::valueForSelectedType const):
1762         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h: Added.
1763         (WebCore::WHLSL::AST::IntegerLiteral::IntegerLiteral):
1764         (WebCore::WHLSL::AST::IntegerLiteral::type):
1765         (WebCore::WHLSL::AST::IntegerLiteral::value const):
1766         (WebCore::WHLSL::AST::IntegerLiteral::clone const):
1767         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp: Added.
1768         (WebCore::WHLSL::AST::IntegerLiteralType::IntegerLiteralType):
1769         (WebCore::WHLSL::AST::IntegerLiteralType::canResolve const):
1770         (WebCore::WHLSL::AST::IntegerLiteralType::conversionCost const):
1771         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h: Added.
1772         (WebCore::WHLSL::AST::IntegerLiteralType::preferredType):
1773         * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h: Added.
1774         (WebCore::WHLSL::AST::LogicalExpression::LogicalExpression):
1775         (WebCore::WHLSL::AST::LogicalExpression::type const):
1776         (WebCore::WHLSL::AST::LogicalExpression::left):
1777         (WebCore::WHLSL::AST::LogicalExpression::right):
1778         * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h: Added.
1779         (WebCore::WHLSL::AST::LogicalNotExpression::LogicalNotExpression):
1780         (WebCore::WHLSL::AST::LogicalNotExpression::operand):
1781         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h: Added.
1782         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::MakeArrayReferenceExpression):
1783         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::lValue):
1784         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h: Added.
1785         (WebCore::WHLSL::AST::MakePointerExpression::MakePointerExpression):
1786         (WebCore::WHLSL::AST::MakePointerExpression::lValue):
1787         * Modules/webgpu/WHLSL/AST/WHLSLNamedType.h: Added.
1788         (WebCore::WHLSL::AST::NamedType::NamedType):
1789         (WebCore::WHLSL::AST::NamedType::origin const):
1790         (WebCore::WHLSL::AST::NamedType::name):
1791         (WebCore::WHLSL::AST::NamedType::isTypeDefinition const):
1792         (WebCore::WHLSL::AST::NamedType::isStructureDefinition const):
1793         (WebCore::WHLSL::AST::NamedType::isEnumerationDefinition const):
1794         (WebCore::WHLSL::AST::NamedType::isNativeTypeDeclaration const):
1795         (WebCore::WHLSL::AST::NamedType::unifyNode const):
1796         (WebCore::WHLSL::AST::NamedType::unifyNode):
1797         * Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h: Added.
1798         (WebCore::WHLSL::AST::NativeFunctionDeclaration::NativeFunctionDeclaration):
1799         (WebCore::WHLSL::AST::NativeFunctionDeclaration::restricted const):
1800         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h: Added.
1801         (WebCore::WHLSL::AST::NativeTypeDeclaration::NativeTypeDeclaration):
1802         (WebCore::WHLSL::AST::NativeTypeDeclaration::name const):
1803         (WebCore::WHLSL::AST::NativeTypeDeclaration::name):
1804         (WebCore::WHLSL::AST::NativeTypeDeclaration::typeArguments):
1805         (WebCore::WHLSL::AST::NativeTypeDeclaration::isInt const):
1806         (WebCore::WHLSL::AST::NativeTypeDeclaration::isNumber const):
1807         (WebCore::WHLSL::AST::NativeTypeDeclaration::isFloating const):
1808         (WebCore::WHLSL::AST::NativeTypeDeclaration::isVector const):
1809         (WebCore::WHLSL::AST::NativeTypeDeclaration::isMatrix const):
1810         (WebCore::WHLSL::AST::NativeTypeDeclaration::isTexture const):
1811         (WebCore::WHLSL::AST::NativeTypeDeclaration::isSigned const):
1812         (WebCore::WHLSL::AST::NativeTypeDeclaration::std::function<bool const):
1813         (WebCore::WHLSL::AST::NativeTypeDeclaration::std::function<int64_t const):
1814         (WebCore::WHLSL::AST::NativeTypeDeclaration::iterateAllValues):
1815         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsInt):
1816         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsNumber):
1817         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsFloating):
1818         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsVector):
1819         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsMatrix):
1820         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsTexture):
1821         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsSigned):
1822         (WebCore::WHLSL::AST::NativeTypeDeclaration::setCanRepresentInteger):
1823         (WebCore::WHLSL::AST::NativeTypeDeclaration::setCanRepresentUnsignedInteger):
1824         (WebCore::WHLSL::AST::NativeTypeDeclaration::setCanRepresentFloat):
1825         (WebCore::WHLSL::AST::NativeTypeDeclaration::setSuccessor):
1826         (WebCore::WHLSL::AST::NativeTypeDeclaration::setFormatValueFromInteger):
1827         (WebCore::WHLSL::AST::NativeTypeDeclaration::setFormatValueFromUnsignedInteger):
1828         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIterateAllValues):
1829         * Modules/webgpu/WHLSL/AST/WHLSLNode.h: Added.
1830         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h: Added.
1831         (WebCore::WHLSL::AST::NullLiteral::NullLiteral):
1832         (WebCore::WHLSL::AST::NullLiteral::type):
1833         (WebCore::WHLSL::AST::NullLiteral::clone const):
1834         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.cpp: Added.
1835         (WebCore::WHLSL::AST::NullLiteralType::canResolve const):
1836         (WebCore::WHLSL::AST::NullLiteralType::conversionCost const):
1837         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.h: Added.
1838         * Modules/webgpu/WHLSL/AST/WHLSLNumThreadsFunctionAttribute.h: Added.
1839         (WebCore::WHLSL::AST::NumThreadsFunctionAttribute::NumThreadsFunctionAttribute):
1840         (WebCore::WHLSL::AST::NumThreadsFunctionAttribute::width const):
1841         (WebCore::WHLSL::AST::NumThreadsFunctionAttribute::height const):
1842         (WebCore::WHLSL::AST::NumThreadsFunctionAttribute::depth const):
1843         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h: Added.
1844         (WebCore::WHLSL::AST::PointerType::PointerType):
1845         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h: Added.
1846         (WebCore::WHLSL::AST::PropertyAccessExpression::PropertyAccessExpression):
1847         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleGetOverloads):
1848         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleSetOverloads):
1849         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleAndOverloads):
1850         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleGetOverloads):
1851         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleSetOverloads):
1852         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleAndOverloads):
1853         (WebCore::WHLSL::AST::PropertyAccessExpression::base):
1854         * Modules/webgpu/WHLSL/AST/WHLSLQualifier.h: Added.
1855         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h: Added.
1856         (WebCore::WHLSL::AST::ReadModifyWriteExpression::create):
1857         (WebCore::WHLSL::AST::ReadModifyWriteExpression::setNewValueExpression):
1858         (WebCore::WHLSL::AST::ReadModifyWriteExpression::setResultExpression):
1859         (WebCore::WHLSL::AST::ReadModifyWriteExpression::oldVariableReference):
1860         (WebCore::WHLSL::AST::ReadModifyWriteExpression::newVariableReference):
1861         (WebCore::WHLSL::AST::ReadModifyWriteExpression::lValue):
1862         (WebCore::WHLSL::AST::ReadModifyWriteExpression::oldValue):
1863         (WebCore::WHLSL::AST::ReadModifyWriteExpression::newValue):
1864         (WebCore::WHLSL::AST::ReadModifyWriteExpression::newValueExpression):
1865         (WebCore::WHLSL::AST::ReadModifyWriteExpression::resultExpression):
1866         (WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression):
1867         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h: Added.
1868         (WebCore::WHLSL::AST::ReferenceType::ReferenceType):
1869         (WebCore::WHLSL::AST::ReferenceType::addressSpace const):
1870         (WebCore::WHLSL::AST::ReferenceType::elementType const):
1871         (WebCore::WHLSL::AST::ReferenceType::elementType):
1872         * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h: Added.
1873         (WebCore::WHLSL::AST::ResolvableType::isFloatLiteralType const):
1874         (WebCore::WHLSL::AST::ResolvableType::isIntegerLiteralType const):
1875         (WebCore::WHLSL::AST::ResolvableType::isNullLiteralType const):
1876         (WebCore::WHLSL::AST::ResolvableType::isUnsignedIntegerLiteralType const):
1877         (WebCore::WHLSL::AST::ResolvableType::resolvedType const):
1878         (WebCore::WHLSL::AST::ResolvableType::resolvedType):
1879         (WebCore::WHLSL::AST::ResolvableType::resolve):
1880         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp: Added.
1881         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
1882         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableForShaderItemDirection const):
1883         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h: Added.
1884         (WebCore::WHLSL::AST::ResourceSemantic::ResourceSemantic):
1885         (WebCore::WHLSL::AST::ResourceSemantic::mode const):
1886         (WebCore::WHLSL::AST::ResourceSemantic::index const):
1887         (WebCore::WHLSL::AST::ResourceSemantic::space const):
1888         (WebCore::WHLSL::AST::ResourceSemantic::operator== const):
1889         (WebCore::WHLSL::AST::ResourceSemantic::operator!= const):
1890         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h: Added.
1891         (WebCore::WHLSL::AST::Return::Return):
1892         (WebCore::WHLSL::AST::Return::value):
1893         (WebCore::WHLSL::AST::Return::function):
1894         (WebCore::WHLSL::AST::Return::setFunction):
1895         * Modules/webgpu/WHLSL/AST/WHLSLSemantic.h: Added.
1896         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp: Added.
1897         (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableType const):
1898         (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableForShaderItemDirection const):
1899         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h: Added.
1900         (WebCore::WHLSL::AST::SpecializationConstantSemantic::SpecializationConstantSemantic):
1901         (WebCore::WHLSL::AST::SpecializationConstantSemantic::operator== const):
1902         (WebCore::WHLSL::AST::SpecializationConstantSemantic::operator!= const):
1903         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp: Added.
1904         (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableType const):
1905         (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableForShaderItemDirection const):
1906         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h: Added.
1907         (WebCore::WHLSL::AST::StageInOutSemantic::StageInOutSemantic):
1908         (WebCore::WHLSL::AST::StageInOutSemantic::index const):
1909         (WebCore::WHLSL::AST::StageInOutSemantic::operator== const):
1910         (WebCore::WHLSL::AST::StageInOutSemantic::operator!= const):
1911         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h: Added.
1912         (WebCore::WHLSL::AST::Statement::Statement):
1913         (WebCore::WHLSL::AST::Statement::isBlock const):
1914         (WebCore::WHLSL::AST::Statement::isBreak const):
1915         (WebCore::WHLSL::AST::Statement::isContinue const):
1916         (WebCore::WHLSL::AST::Statement::isDoWhileLoop const):
1917         (WebCore::WHLSL::AST::Statement::isEffectfulExpressionStatement const):
1918         (WebCore::WHLSL::AST::Statement::isFallthrough const):
1919         (WebCore::WHLSL::AST::Statement::isForLoop const):
1920         (WebCore::WHLSL::AST::Statement::isIfStatement const):
1921         (WebCore::WHLSL::AST::Statement::isReturn const):
1922         (WebCore::WHLSL::AST::Statement::isSwitchCase const):
1923         (WebCore::WHLSL::AST::Statement::isSwitchStatement const):
1924         (WebCore::WHLSL::AST::Statement::isTrap const):
1925         (WebCore::WHLSL::AST::Statement::isVariableDeclarationsStatement const):
1926         (WebCore::WHLSL::AST::Statement::isWhileLoop const):
1927         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h: Added.
1928         (WebCore::WHLSL::AST::StructureDefinition::StructureDefinition):
1929         (WebCore::WHLSL::AST::StructureDefinition::structureElements):
1930         * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h: Added.
1931         (WebCore::WHLSL::AST::StructureElement::StructureElement):
1932         (WebCore::WHLSL::AST::StructureElement::origin const):
1933         (WebCore::WHLSL::AST::StructureElement::type):
1934         (WebCore::WHLSL::AST::StructureElement::name):
1935         (WebCore::WHLSL::AST::StructureElement::semantic):
1936         * Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h: Added.
1937         (WebCore::WHLSL::AST::SwitchCase::SwitchCase):
1938         (WebCore::WHLSL::AST::SwitchCase::value):
1939         (WebCore::WHLSL::AST::SwitchCase::block):
1940         * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h: Added.
1941         (WebCore::WHLSL::AST::SwitchStatement::SwitchStatement):
1942         (WebCore::WHLSL::AST::SwitchStatement::value):
1943         (WebCore::WHLSL::AST::SwitchStatement::switchCases):
1944         * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h: Added.
1945         (WebCore::WHLSL::AST::TernaryExpression::TernaryExpression):
1946         (WebCore::WHLSL::AST::TernaryExpression::predicate):
1947         (WebCore::WHLSL::AST::TernaryExpression::bodyExpression):
1948         (WebCore::WHLSL::AST::TernaryExpression::elseExpression):
1949         * Modules/webgpu/WHLSL/AST/WHLSLTrap.h: Added.
1950         (WebCore::WHLSL::AST::Trap::Trap):
1951         * Modules/webgpu/WHLSL/AST/WHLSLType.h: Added.
1952         (WebCore::WHLSL::AST::Type::isNamedType const):
1953         (WebCore::WHLSL::AST::Type::isUnnamedType const):
1954         (WebCore::WHLSL::AST::Type::isResolvableType const):
1955         * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.cpp: Added.
1956         (WebCore::WHLSL::AST::clone):
1957         * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.h: Added.
1958         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h: Added.
1959         (WebCore::WHLSL::AST::TypeDefinition::TypeDefinition):
1960         (WebCore::WHLSL::AST::TypeDefinition::type):
1961         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.cpp: Added.
1962         (WebCore::WHLSL::AST::TypeReference::wrap):
1963         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h: Added.
1964         (WebCore::WHLSL::AST::TypeReference::TypeReference):
1965         (WebCore::WHLSL::AST::TypeReference::name):
1966         (WebCore::WHLSL::AST::TypeReference::typeArguments):
1967         (WebCore::WHLSL::AST::TypeReference::resolvedType const):
1968         (WebCore::WHLSL::AST::TypeReference::setResolvedType):
1969         (WebCore::WHLSL::AST::TypeReference::cloneTypeReference const):
1970         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h: Added.
1971         (WebCore::WHLSL::AST::UnnamedType::UnnamedType):
1972         (WebCore::WHLSL::AST::UnnamedType::isTypeReference const):
1973         (WebCore::WHLSL::AST::UnnamedType::isPointerType const):
1974         (WebCore::WHLSL::AST::UnnamedType::isArrayReferenceType const):
1975         (WebCore::WHLSL::AST::UnnamedType::isArrayType const):
1976         (WebCore::WHLSL::AST::UnnamedType::isReferenceType const):
1977         (WebCore::WHLSL::AST::UnnamedType::unifyNode const):
1978         (WebCore::WHLSL::AST::UnnamedType::unifyNode):
1979         (WebCore::WHLSL::AST::UnnamedType::origin const):
1980         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.cpp: Added.
1981         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::valueForSelectedType const):
1982         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h: Added.
1983         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::UnsignedIntegerLiteral):
1984         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::type):
1985         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::value const):
1986         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::clone const):
1987         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp: Added.
1988         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::UnsignedIntegerLiteralType):
1989         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::canResolve const):
1990         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::conversionCost const):
1991         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h: Added.
1992         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::preferredType):
1993         * Modules/webgpu/WHLSL/AST/WHLSLValue.h: Added.
1994         (WebCore::WHLSL::AST::Value::Value):
1995         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h: Added.
1996         (WebCore::WHLSL::AST::VariableDeclaration::VariableDeclaration):
1997         (WebCore::WHLSL::AST::VariableDeclaration::origin const):
1998         (WebCore::WHLSL::AST::VariableDeclaration::name):
1999         (WebCore::WHLSL::AST::VariableDeclaration::type const):
2000         (WebCore::WHLSL::AST::VariableDeclaration::type):
2001         (WebCore::WHLSL::AST::VariableDeclaration::semantic):
2002         (WebCore::WHLSL::AST::VariableDeclaration::initializer):
2003         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h: Added.
2004         (WebCore::WHLSL::AST::VariableDeclarationsStatement::VariableDeclarationsStatement):
2005         (WebCore::WHLSL::AST::VariableDeclarationsStatement::variableDeclarations):
2006         * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h: Added.
2007         (WebCore::WHLSL::AST::VariableReference::VariableReference):
2008         (WebCore::WHLSL::AST::VariableReference::wrap):
2009         (WebCore::WHLSL::AST::VariableReference::name):
2010         (WebCore::WHLSL::AST::VariableReference::variable):
2011         (WebCore::WHLSL::AST::VariableReference::setVariable):
2012         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h: Added.
2013         (WebCore::WHLSL::AST::WhileLoop::WhileLoop):
2014         (WebCore::WHLSL::AST::WhileLoop::conditional):
2015         (WebCore::WHLSL::AST::WhileLoop::body):
2016         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
2017         * Modules/webgpu/WHLSL/WHLSLParser.cpp: Added.
2018         * Modules/webgpu/WHLSL/WHLSLParser.h: Added.
2019         * Modules/webgpu/WHLSL/WHLSLProgram.h: Added.
2020         (WebCore::WHLSL::Program::append):
2021         (WebCore::WHLSL::Program::nameContext):
2022         (WebCore::WHLSL::Program::intrinsics):
2023         (WebCore::WHLSL::Program::typeDefinitions):
2024         (WebCore::WHLSL::Program::structureDefinitions):
2025         (WebCore::WHLSL::Program::enumerationDefinitions):
2026         (WebCore::WHLSL::Program::functionDefinitions const):
2027         (WebCore::WHLSL::Program::functionDefinitions):
2028         (WebCore::WHLSL::Program::nativeFunctionDeclarations const):
2029         (WebCore::WHLSL::Program::nativeFunctionDeclarations):
2030         (WebCore::WHLSL::Program::nativeTypeDeclarations):
2031
2032 2019-01-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2033
2034         Bindings generator emits incorrect code when using VoidCallback as an IDL dictionary attribute
2035         https://bugs.webkit.org/show_bug.cgi?id=193328
2036
2037         Reviewed by Chris Dumez.
2038
2039         Currently, when generating the function body of `convertDictionary`, our bindings generator does not pass in an
2040         argument to use as the `$globalObjectReference` in `JSValueToNative`, when generating code to convert a wrapped
2041         attribute value to the native value. As a result, if the generated IDL type returns `true` from
2042         `JSValueToNativeDOMConvertNeedsGlobalObject` (i.e. for callback function types), we will end up using the empty
2043         string as the generated expression for the global object. This emits syntactically incorrect code:
2044
2045             `convert<IDLCallbackFunction<JSVoidCallback>>(state, someValue, );`
2046
2047         To fix this, we pass in a string to use as the global object, which uses the given ExecState to grab the global
2048         object. Tested by augmenting TestStandaloneDictionary.idl and its generated expectation.
2049
2050         * bindings/scripts/CodeGeneratorJS.pm:
2051         (GenerateDictionaryImplementationContent):
2052         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
2053         (WebCore::convertDictionary<DictionaryImplName>):
2054         * bindings/scripts/test/TestStandaloneDictionary.idl:
2055
2056 2019-01-10  Eric Carlson  <eric.carlson@apple.com>
2057
2058         Define page media state flags for display capture.
2059         https://bugs.webkit.org/show_bug.cgi?id=193230
2060         <rdar://problem/47095142>
2061
2062         Reviewed by Youenn Fablet.
2063
2064         Test: fast/mediastream/get-display-media-muted.html
2065
2066         * Modules/mediastream/MediaStreamTrack.cpp:
2067         (WebCore::MediaStreamTrack::mediaState const):
2068         * page/MediaProducer.h:
2069         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
2070         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
2071         * platform/mediastream/RealtimeMediaSource.h:
2072         * platform/mediastream/mac/AVVideoCaptureSource.h:
2073         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
2074         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
2075         * platform/mock/MockRealtimeAudioSource.h:
2076         * platform/mock/MockRealtimeVideoSource.h:
2077         * testing/Internals.cpp:
2078         (WebCore::Internals::pageMediaState):
2079
2080 2019-01-10  Justin Fan  <justin_fan@apple.com>
2081
2082         [WebGPU] Add BindGroupBinding, BindGroupDescriptor, and BufferBinding dictionaries from API
2083         https://bugs.webkit.org/show_bug.cgi?id=193298
2084
2085         Reviewed by Dean Jackson.
2086
2087         No new tests. No change in behavior.
2088
2089         * CMakeLists.txt:
2090         * DerivedSources.make:
2091         * Modules/webgpu/WebGPUBindGroupBinding.h: Added.
2092         * Modules/webgpu/WebGPUBindGroupBinding.idl: Added.
2093         * Modules/webgpu/WebGPUBindGroupDescriptor.h: Added.
2094         * Modules/webgpu/WebGPUBindGroupDescriptor.idl: Added.
2095         * Modules/webgpu/WebGPUBufferBinding.h: Added.
2096         * Modules/webgpu/WebGPUBufferBinding.idl: Added.
2097         * Sources.txt:
2098         * WebCore.xcodeproj/project.pbxproj:
2099         * platform/graphics/gpu/GPUBindGroupBinding.h: Added.
2100         * platform/graphics/gpu/GPUBindGroupDescriptor.h: Added.
2101         * platform/graphics/gpu/GPUBufferBinding.h: Added.
2102
2103 2019-01-09  Justin Fan  <justin_fan@apple.com>
2104
2105         [WebGPU] Fix vertex-buffer-triangle-strip test and small update to GPURenderPipeline
2106         https://bugs.webkit.org/show_bug.cgi?id=193289
2107
2108         Reviewed by Dean Jackson.
2109
2110         Fix broken test after pipeline layouts were added, and a small refactoring to GPURenderPipeline to avoid
2111         retaining its descriptor after creation.
2112
2113         * platform/graphics/gpu/GPURenderPipeline.h:
2114         (WebCore::GPURenderPipeline::primitiveTopology const):
2115         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2116         (WebCore::GPURenderPipeline::GPURenderPipeline):
2117
2118 2019-01-09  Dean Jackson  <dino@apple.com>
2119
2120         Safari Crashing in Version 12.0.1 (14606.2.104.1.1) WebCore::GraphicsLayerCA::updateBackdropFilters
2121         https://bugs.webkit.org/show_bug.cgi?id=193309
2122         <rdar://problem/45279224>
2123
2124         Reviewed by Antoine Quint.
2125
2126         A speculative fix for a CheckedArithmetic crash triggered in updateBackdropFilters.
2127
2128         The crash log indicates we crash in a Checked<> class that is not recording
2129         overflow i.e. it is crashing due to an overflow. The only place in this function
2130         where that could happen is when we convert the FloatRect for the backdrop
2131         region into a Checked<unsigned> for width and height. This suggests that either
2132         the width or height are negative, or the float values are too large for integers,
2133         or the product of the two overflows.
2134
2135         Avoid this by using RecordOverflow, but also changing the code a little to
2136         bail if the rectangle is incorrect.
2137
2138         * platform/graphics/ca/GraphicsLayerCA.cpp:
2139         (WebCore::GraphicsLayerCA::updateBackdropFilters):
2140
2141 2019-01-10  Oriol Brufau  <obrufau@igalia.com>
2142
2143         [css-grid] Let abspos items reference implicit grid lines
2144         https://bugs.webkit.org/show_bug.cgi?id=193313
2145
2146         Reviewed by Manuel Rego Casasnovas.
2147
2148         While they can't create new implicit grid lines, abspos items
2149         can reference existing ones as clarified in
2150         https://github.com/w3c/csswg-drafts/commit/511bb63
2151
2152         This patch makes WebKit match Blink, Firefox and Edge.
2153
2154         Tests: web-platform-tests/css/css-grid/abspos/grid-positioned-items-padding-001.html
2155                web-platform-tests/css/css-grid/abspos/grid-positioned-items-unknown-named-grid-line-001.html
2156
2157         * rendering/RenderGrid.cpp:
2158         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator const):
2159         Remove argument from spanSizeForAutoPlacedItem call.
2160         (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid const):
2161         Remove argument from spanSizeForAutoPlacedItem call.
2162         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid const):
2163         Remove argument from spanSizeForAutoPlacedItem call.
2164         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid const):
2165         Remove argument from spanSizeForAutoPlacedItem call.
2166         (WebCore::RenderGrid::gridAreaBreadthForOutOfFlowChild):
2167         Don't treat implicit grid lines as 'auto'.
2168         * rendering/RenderGrid.h:
2169         Remove unused gridPositionIsAutoForOutOfFlow.
2170         * rendering/style/GridPositionsResolver.cpp:
2171         (WebCore::adjustGridPositionsFromStyle):
2172         Don't treat implicit grid lines as 'auto'.
2173         Remove unused gridContainerStyle parameter.
2174         (WebCore::GridPositionsResolver::spanSizeForAutoPlacedItem):
2175         Remove argument from adjustGridPositionsFromStyle call.
2176         Remove unused gridContainerStyle parameter.
2177         (WebCore::resolveGridPositionFromStyle):
2178         Remove unnecessary assert that uses isValidNamedLineOrArea.
2179         (WebCore::GridPositionsResolver::resolveGridPositionsFromStyle):
2180         Remove argument from adjustGridPositionsFromStyle call.
2181         * rendering/style/GridPositionsResolver.h:
2182         Remove unused isValidNamedLineOrArea.
2183         Remove unused parameter from spanSizeForAutoPlacedItem.
2184
2185 2019-01-09  Matt Rajca  <mrajca@apple.com>
2186
2187         Put per-document autoplay behavior behind runtime website policies quirk instead of a compile time flag
2188         https://bugs.webkit.org/show_bug.cgi?id=193301
2189
2190         Reviewed by Jer Noble.
2191
2192         Instead of unconditionally enabling this with a compile-time flag, let clients
2193         enable the quirk on a per-load basis.
2194
2195         Tests: added API tests in favor of the current layout test as this behavior is no
2196                longer on by default unless a client opts in.
2197
2198         * html/MediaElementSession.cpp:
2199         (WebCore::needsPerDocumentAutoplayBehaviorQuirk):
2200         (WebCore::MediaElementSession::playbackPermitted const):
2201         * loader/DocumentLoader.h:
2202
2203 2019-01-10  Zalan Bujtas  <zalan@apple.com>
2204
2205         [LFC][BFC][MarginCollapsing] Take collapsed through siblings into account when computing vertical position
2206         https://bugs.webkit.org/show_bug.cgi?id=193310
2207
2208         Reviewed by Antti Koivisto.
2209
2210         If the block inflow element has previous siblings with collapsed through vertical margins,
2211         then this box's before margin could _indirectly_ collapse with the parent. Use the previous siblings
2212         to check for margin collapsing.
2213
2214         Test: fast/block/block-only/collapsed-through-siblings.html
2215
2216         * layout/blockformatting/BlockFormattingContext.cpp:
2217         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
2218         * page/FrameViewLayoutContext.cpp:
2219         (WebCore::layoutUsingFormattingContext):
2220
2221 2019-01-10  Alicia Boya García  <aboya@igalia.com>
2222
2223         [MSE][GStreamer] Use GRefPtr in AppendPipeline::pushNewBuffer()
2224         https://bugs.webkit.org/show_bug.cgi?id=192934
2225
2226         Reviewed by Xabier Rodriguez-Calvar.
2227
2228         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2229         (WebCore::AppendPipeline::pushNewBuffer):
2230         * platform/graphics/gstreamer/mse/AppendPipeline.h:
2231         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
2232         (WebCore::MediaSourceClientGStreamerMSE::append):
2233
2234 2019-01-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2235
2236         [FreeType] Color emoji not properly supported
2237         https://bugs.webkit.org/show_bug.cgi?id=191976
2238
2239         Reviewed by Michael Catanzaro.
2240
2241         Always try to fallback to a colored font for emojis.
2242
2243         Test: platform/gtk/fonts/font-emoji-system-fallback.html
2244
2245         * platform/graphics/ComplexTextController.cpp:
2246         (WebCore::advanceByCombiningCharacterSequence): Group regional indicators in pairs.
2247         * platform/graphics/Font.cpp:
2248         (WebCore::CharacterFallbackMapKey::CharacterFallbackMapKey):
2249         (WebCore::Font::systemFallbackFontForCharacter const): Pass PreferColoredFont::No to FontCache::systemFallbackForCharacters.
2250         * platform/graphics/Font.h: Add IsForPlatformFont enum to replace the bool parameter in systemFallbackFontForCharacter().
2251         * platform/graphics/FontCache.h:
2252         * platform/graphics/FontCascadeFonts.cpp:
2253         (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
2254         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
2255         (WebCore::characterSequenceIsEmoji): Check whether the character sequence is an emoji.
2256         (WebCore::FontCascade::fontForCombiningCharacterSequence const): In case of emojis try to fallback to a colored
2257         font even if base font can render the emoji in black and white.
2258         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2259         (WebCore::FontCache::systemFallbackForCharacters): Add PreferColoredFont parameter that is ignored.
2260         * platform/graphics/freetype/FontCacheFreeType.cpp:
2261         (WebCore::FontCache::systemFallbackForCharacters): Add PreferColoredFont parameter.
2262         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2263         (WebCore::FontPlatformData::FontPlatformData): Initialize m_isColorBitmapFont.
2264         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2265         (WebCore::Font::variantCapsSupportsCharacterForSynthesis const): Moved from cross-platform file.
2266         (WebCore::Font::platformSupportsCodePoint const): Add freetype implementation.
2267         * platform/graphics/win/FontCacheWin.cpp:
2268         (WebCore::FontCache::systemFallbackForCharacters): Add PreferColoredFont parameter that is ignored.
2269         * platform/text/CharacterProperties.h:
2270         (WebCore::isEmojiKeycapBase):
2271         (WebCore::isEmojiRegionalIndicator):
2272         (WebCore::isEmojiWithPresentationByDefault):
2273         (WebCore::isEmojiModifierBase):
2274
2275 2019-01-09  Antoine Quint  <graouts@apple.com>
2276
2277         [Web Animations] Audit Web Animations classes for memory reduction
2278         https://bugs.webkit.org/show_bug.cgi?id=193195
2279
2280         Reviewed by Simon Fraser and Yusuke Suzuki.
2281
2282         The classes, enums and structs added to support Web Animations were not as memory-efficient as they could be. We now order
2283         members in a way that reduces padding, use Markable<T, Traits> instead of Optional<T> where applicable, declare enums as uint8_t
2284         and removed unnecessary members.
2285
2286         As a result, classes and structs have shrunk as follows:
2287
2288         WebAnimation: 256 > 216
2289         DeclarativeAnimation: 392 > 344
2290         CSSAnimation: 416 > 368
2291         CSSTransition: 440 > 392
2292         AnimationEffect: 88 > 72
2293         KeyframeEffect: 208 > 184
2294         AnimationPlaybackEvent: 104 > 88
2295         EffectTiming: 72 > 64
2296         ComputedEffectTiming: 136 > 112
2297         AnimationTimeline: 264 > 248
2298         DocumentTimeline: 496 > 464
2299         OptionalEffectTiming: 112 > 80
2300         BaseKeyframe: 32 > 24
2301         ParsedKeyframe: 80 > 72
2302         BaseComputedKeyframe: 40 > 32
2303
2304         * animation/AnimationEffect.h: Order members in decreasing size, except for m_fill and m_direction, which we put at the top to
2305         save 8 bytes (2 bytes of padding instead of 4 before m_animation and saving 6 bytes of padding at the end).
2306         * animation/AnimationPlaybackEvent.cpp:
2307         (WebCore::AnimationPlaybackEvent::AnimationPlaybackEvent):
2308         * animation/AnimationPlaybackEvent.h:
2309         * animation/AnimationPlaybackEventInit.h:
2310         * animation/AnimationTimeline.cpp:
2311         (WebCore::AnimationTimeline::AnimationTimeline):
2312         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
2313         * animation/AnimationTimeline.h: We remove the m_classType member and instead make isDocumentTimeline() virtual.
2314         (WebCore::AnimationTimeline::isDocumentTimeline const):
2315         (): Deleted.
2316         (WebCore::AnimationTimeline::classType const): Deleted.
2317         * animation/CompositeOperation.h:
2318         * animation/CompositeOperationOrAuto.h:
2319         * animation/ComputedEffectTiming.h:
2320         * animation/DeclarativeAnimation.cpp:
2321         (WebCore::DeclarativeAnimation::DeclarativeAnimation):
2322         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
2323         * animation/DeclarativeAnimation.h: We keep m_wasPending and m_previousPhase at the top to save some padding at the end.
2324         * animation/DocumentTimeline.cpp:
2325         (WebCore::DocumentTimeline::DocumentTimeline):
2326         * animation/DocumentTimeline.h:
2327         * animation/EffectTiming.h:
2328         * animation/FillMode.h:
2329         * animation/IterationCompositeOperation.h:
2330         * animation/KeyframeEffect.cpp:
2331         (WebCore::computeMissingKeyframeOffsets):
2332         (WebCore::KeyframeEffect::create):
2333         (WebCore::KeyframeEffect::KeyframeEffect):
2334         * animation/KeyframeEffect.h:
2335         * animation/OptionalEffectTiming.h:
2336         * animation/PlaybackDirection.h:
2337         * animation/WebAnimation.h:
2338         * animation/WebAnimationUtilities.h:
2339         (WebCore::WebAnimationsMarkableDoubleTraits::isEmptyValue):
2340         (WebCore::WebAnimationsMarkableDoubleTraits::emptyValue):
2341
2342 2019-01-09  Ryosuke Niwa  <rniwa@webkit.org>
2343
2344         ThreadTimers should not store a raw pointer in its heap
2345         https://bugs.webkit.org/show_bug.cgi?id=192975
2346         <rdar://problem/46893946>
2347
2348         Reviewed by Geoffrey Garen.
2349
2350         Right now, ThreadTimers's heap data structure stores a raw pointer to TimerBase. In order to harden the timer code,
2351         this patch replaces it with ThreadTimerHeapItem, a newly introduced struct, which effectively acks like
2352         WeakReference<TimerBase*> as the timer heap and TimerBase both store RefPtr to it, and TimerBase's destructor clears
2353         the raw pointer back to TimerBase*.
2354
2355         This approach was taken instead of an out-right adoptation of WeakPtr since the heap data structure requires each node
2356         in the heap to have a fixed "priority" yet WeakPtr with no valid pointer back to TimerBase would effectively lose its
2357         "priority" thereby corrupting the heap data structure. That is, each item in the heap must remember its fire time and
2358         insertion order even when the underlying TimerBase had gone away (this should never happen but the whole point of this
2359         hardening is to make it work even in the precense of such a bug).
2360
2361         This patch also moves the heap index in TimerBase to ThreadTimerHeapItem, and replaces the pointer to the heap vector
2362         in TimerBase by a reference to ThreadTimers in ThreadTimerHeapItem. Note that ThreadTimers is a per-thread singleton.
2363
2364         The correctness of this hardening was tested by commenting out the call to stop() and !isInHeap() assertion in
2365         TimerBase::~TimerBase() as well as the !isInHeap() assertion in ThreadTimerHeapItem::clearTimer() and observing that
2366         layout tests run successfully without hitting any debug assertions.
2367
2368         No new tests since there should be no observable behavior difference.
2369
2370         * WebCore.xcodeproj/project.pbxproj: Export ThreadTimers.h as a private header since it's now included in Timer.h
2371         * platform/ThreadTimers.cpp:
2372         (WebCore::ThreadTimers::updateSharedTimer): Delete ThreadTimerHeapItem's with nullptr TimerBase* (TimerBase had
2373         already been deleted). This should only happen when TimerBase's destructor failed to remove itself from the timer heap,
2374         which should never happen.
2375         (WebCore::ThreadTimers::sharedTimerFiredInternal): Ditto. Also removed the redundant code which had removed the timer
2376         from the heap since setNextFireTime does the removal already.
2377         * platform/ThreadTimers.h: Outdented the whole file.
2378         (WebCore::ThreadTimers::timerHeap): We use Vector<RefPtr<ThreadTimerHeapItem>> instead of Vector<Ref<~>> since Ref<~>
2379         doesn't have a copy constructor which is used by std::push_heap.
2380         (WebCore::ThreadTimerHeapItem): Added.
2381         (WebCore::ThreadTimerHeapItem::hasTimer const): Added.
2382         (WebCore::ThreadTimerHeapItem::setNotInHeap): Added. ThreadTimerHeapItem uses unsigned -1 as the single value which
2383         signifies the item not being in the heap instead of all negative values as in the old code in TimerBase.
2384         (WebCore::ThreadTimerHeapItem::isInHeap const): Added.
2385         (WebCore::ThreadTimerHeapItem::isFirstInHeap const): Added.
2386         (WebCore::ThreadTimerHeapItem::timer): Added.
2387         (WebCore::ThreadTimerHeapItem::clearTimer): Added.
2388         (WebCore::ThreadTimerHeapItem::heapIndex const): Added.
2389         (WebCore::ThreadTimerHeapItem::setHeapIndex): Added.
2390         (WebCore::ThreadTimerHeapItem::timerHeap const): Added.
2391         * platform/Timer.cpp:
2392         (WebCore::threadGlobalTimerHeap): This function is now only used in assertions.
2393         (WebCore::ThreadTimerHeapItem::ThreadTimerHeapItem): Added.
2394         (WebCore::ThreadTimerHeapItem::create): Added.
2395         (WebCore::TimerHeapPointer::TimerHeapPointer):
2396         (WebCore::TimerHeapPointer::operator-> const):
2397         (WebCore::TimerHeapReference::TimerHeapReference): Added a copy constructor.
2398         (WebCore::TimerHeapReference::copyRef const): Added.
2399         (WebCore::TimerHeapReference::operator RefPtr<ThreadTimerHeapItem>& const):
2400         (WebCore::TimerHeapPointer::operator* const):
2401         (WebCore::TimerHeapReference::operator=): Use move assignment operator.
2402         (WebCore::TimerHeapReference::swapWith):
2403         (WebCore::TimerHeapReference::updateHeapIndex): Extracted to share code between two verions of operator=.
2404         (WebCore::swap):
2405         (WebCore::TimerHeapIterator::TimerHeapIterator):
2406         (WebCore::TimerHeapIterator::operator-> const):
2407         (WebCore::TimerHeapLessThanFunction::compare): Added variants which take RefPtr<ThreadTimerHeapItem>.
2408         (WebCore::TimerHeapLessThanFunction::operator() const):
2409         (WebCore::TimerBase::TimerBase):
2410         (WebCore::TimerBase::~TimerBase):Clear the raw pointer in ThreadTimerHeapItem.
2411         (WebCore::TimerBase::stop):
2412         (WebCore::TimerBase::nextFireInterval const):
2413         (WebCore::TimerBase::checkHeapIndex const): Added the consistency check for other items in the heap.
2414         (WebCore::TimerBase::checkConsistency const):
2415         (WebCore::TimerBase::heapDecreaseKey):
2416         (WebCore::TimerBase::heapDelete):
2417         (WebCore::TimerBase::heapDeleteMin):
2418         (WebCore::TimerBase::heapIncreaseKey):
2419         (WebCore::TimerBase::heapInsert):
2420         (WebCore::TimerBase::heapPop):
2421         (WebCore::TimerBase::heapPopMin):
2422         (WebCore::TimerBase::heapDeleteNullMin): Added. Used to delete ThreadTimerHeapItem which no longer has a valid TimerBase.
2423         (WebCore::parentHeapPropertyHolds):
2424         (WebCore::childHeapPropertyHolds):
2425         (WebCore::TimerBase::hasValidHeapPosition const):
2426         (WebCore::TimerBase::updateHeapIfNeeded): Tweaked the heap index assertion as heapIndex() itself would assert when called
2427         on an item with an invalid (-1) heap index.
2428         (WebCore::TimerBase::setNextFireTime): Create ThreadTimerHeapItem. Note m_heapItem is never cleared until this TimerBase
2429         is deleted.
2430         (WebCore::TimerHeapReference::operator TimerBase* const): Deleted.
2431         * platform/Timer.h:
2432         (WebCore::TimerBase): Replaced m_nextFireTime, m_heapIndex, m_heapInsertionOrder, and m_cachedThreadGlobalTimerHeap
2433         by m_heapItem, RefPtr to an ThreadTimerHeapItem.
2434         (WebCore::TimerBase::augmentFireInterval):
2435         (WebCore::TimerBase::inHeap const):
2436         (WebCore::TimerBase::nextFireTime const):
2437         (WebCore::TimerBase::isActive const):
2438         (WebCore::TimerBase:: const): Deleted.
2439
2440 2019-01-09  Alex Christensen  <achristensen@webkit.org>
2441
2442         REGRESSION(239737) iOS quicklook tests should not dereference null
2443         https://bugs.webkit.org/show_bug.cgi?id=193307
2444
2445         Reviewed by Brent Fulgham.
2446
2447         The quicklook tests rely on ResourceHandle on iOS for some reason.
2448         This is a problem we'll fix later, but for now keep them working by not crashing.
2449
2450         * platform/network/mac/ResourceHandleMac.mm:
2451         (WebCore::ResourceHandle::createNSURLConnection):
2452         (WebCore::ResourceHandle::start):
2453         (WebCore::ResourceHandle::willSendRequest):
2454         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
2455         (WebCore::ResourceHandle::receivedCredential):
2456
2457 2019-01-09  Zalan Bujtas  <zalan@apple.com>
2458
2459         [Datalist] Crash when input with datalist is dynamically added.
2460         https://bugs.webkit.org/show_bug.cgi?id=193012
2461         <rdar://problem/45923457>
2462
2463         Reviewed by Brent Fulgham.
2464
2465         In certain cases (cloning, setAttribute), it's too early to check for the list attribute in createShadowSubtree
2466         to see whether the input needs datalist related items. The list attribute is simply not set yet.
2467         This patch only addresses the obvious crash. m_dataListDropdownIndicator clearly lacks proper lifecycle management (see webkit.org/b/193032). 
2468
2469         Test: fast/forms/datalist/datalist-crash-when-dynamic.html
2470
2471         * html/TextFieldInputType.cpp:
2472         (WebCore::TextFieldInputType::createShadowSubtree):
2473         (WebCore::TextFieldInputType::attributeChanged):
2474         (WebCore::TextFieldInputType::createDataListDropdownIndicator):
2475         * html/TextFieldInputType.h:
2476
2477 2019-01-09  Justin Fan  <justin_fan@apple.com>
2478
2479         [WebGPU] Fix vertex-buffer-triangle-strip test and small update to GPURenderPipeline
2480         https://bugs.webkit.org/show_bug.cgi?id=193289
2481
2482         Reviewed by Dean Jackson.
2483
2484         Fix broken test after pipeline layouts were added, and a small refactoring to GPURenderPipeline to avoid
2485         retaining its descriptor after creation.
2486
2487         * platform/graphics/gpu/GPURenderPipeline.h:
2488         (WebCore::GPURenderPipeline::primitiveTopology const):
2489         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2490         (WebCore::GPURenderPipeline::GPURenderPipeline):
2491
2492 2019-01-09  Devin Rousso  <drousso@apple.com>
2493
2494         Web Inspector: Protocol Logging: log messages as objects if inspector^2 is open
2495         https://bugs.webkit.org/show_bug.cgi?id=193284
2496
2497         Reviewed by Joseph Pecoraro.
2498
2499         No newe tests, as this is simply exposes a value.
2500
2501         * inspector/InspectorFrontendHost.idl:
2502         * inspector/InspectorFrontendHost.h:
2503         * inspector/InspectorFrontendHost.cpp:
2504         (WebCore::InspectorFrontendHost::isBeingInspected): Added.
2505
2506 2019-01-09  Zalan Bujtas  <zalan@apple.com>
2507
2508         [LFC][BFC][MarginCollapsing] Add support for peculiar cases.
2509         https://bugs.webkit.org/show_bug.cgi?id=192625
2510
2511         Reviewed by Antti Koivisto.
2512
2513         Implement some of the more peculiar cases like margin collpasing through multiple boxes etc.
2514         Add ~100 new passing cases.
2515
2516         * layout/FormattingContextGeometry.cpp:
2517         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
2518         * layout/LayoutState.h:
2519         (WebCore::Layout::LayoutState::hasFormattingState const):
2520         * layout/MarginTypes.h:
2521         * layout/blockformatting/BlockFormattingContext.cpp:
2522         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
2523         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
2524         (WebCore::Layout::hasPrecomputedMarginBefore):
2525         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
2526         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
2527         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
2528         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2529         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
2530         * layout/blockformatting/BlockFormattingContext.h:
2531         (WebCore::Layout::BlockFormattingContext::blockFormattingState const):
2532         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2533         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2534         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2535         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBefore): Deleted.
2536         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginAfter): Deleted.
2537         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
2538         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
2539         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginAfter):
2540         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight): Deleted.
2541         * layout/blockformatting/BlockFormattingState.h:
2542         (WebCore::Layout::BlockFormattingState::setPositiveAndNegativeVerticalMargin):
2543         (WebCore::Layout::BlockFormattingState::hasPositiveAndNegativeVerticalMargin const):
2544         (WebCore::Layout::BlockFormattingState::positiveAndNegativeVerticalMargin const):
2545         (WebCore::Layout::BlockFormattingState::setHasEstimatedMarginBefore):
2546         (WebCore::Layout::BlockFormattingState::clearHasEstimatedMarginBefore):
2547         (WebCore::Layout::BlockFormattingState::hasEstimatedMarginBefore const):
2548         * layout/blockformatting/BlockMarginCollapse.cpp:
2549         (WebCore::Layout::hasClearance):
2550         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
2551         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
2552         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
2553         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
2554         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
2555         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
2556         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
2557         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSiblingMarginBefore):
2558         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
2559         (WebCore::Layout::computedPositiveAndNegativeMargin):
2560         (WebCore::Layout::marginValue):
2561         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateCollapsedMarginAfter):
2562         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
2563         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
2564         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
2565         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
2566         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
2567         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBefore): Deleted.
2568         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginAfter): Deleted.
2569         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBefore): Deleted.
2570         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginAfter): Deleted.
2571         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBeforeFromFirstChild): Deleted.
2572         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginAfterFromLastChild): Deleted.
2573         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSibling): Deleted.
2574         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSibling): Deleted.
2575         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBefore): Deleted.
2576         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfter): Deleted.
2577         * layout/displaytree/DisplayBox.cpp:
2578         (WebCore::Display::Box::Box):
2579         * layout/displaytree/DisplayBox.h:
2580         (WebCore::Display::Box::hasClearance const):
2581         (WebCore::Display::Box::setEstimatedMarginBefore):
2582         (WebCore::Display::Box::estimatedMarginBefore const):
2583         (WebCore::Display::Box::setHasClearance):
2584         (WebCore::Display::Box::invalidateEstimatedMarginBefore):
2585         (WebCore::Display::Box::setVerticalMargin):
2586         (WebCore::Display::Box::rectWithMargin const):
2587         * layout/floats/FloatingContext.cpp:
2588         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
2589         * layout/inlineformatting/InlineFormattingContext.cpp:
2590         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2591
2592 2019-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2593
2594         REGRESSION(r239156): [FreeType] fixed width, and synthetic bold/italic not correctly applied since r239156
2595         https://bugs.webkit.org/show_bug.cgi?id=193276
2596
2597         Reviewed by Žan Doberšek.
2598
2599         FontCache::createFontPlatformData() is calling getFontPropertiesFromPattern() with the configure pattern instead
2600         of the result one after the match.
2601
2602         * platform/graphics/freetype/FontCacheFreeType.cpp:
2603         (WebCore::FontCache::createFontPlatformData):
2604
2605 2019-01-08  Dean Jackson  <dino@apple.com>
2606
2607         Blob references for System Previews don't get a correct file extension
2608         https://bugs.webkit.org/show_bug.cgi?id=193268
2609         <rdar://problem/47133037>
2610
2611         Reviewed by Tim Horton.
2612
2613         Apple platforms don't yet have a mapping from the USD MIME type to
2614         file extensions (and we support some non-standard MIME types), which
2615         means that downloads from Blob references don't get correctly named.
2616
2617         Fix this by adding an explicit mapping between System Preview types
2618         and ".usdz".
2619
2620         WebKit API test: _WKDownload.SystemPreviewUSDZBlobNaming
2621
2622         * platform/MIMETypeRegistry.cpp:
2623         (WebCore::MIMETypeRegistry::isSystemPreviewMIMEType): Remove USE(SYSTEM_PREVIEW) since
2624         this applies to macOS and iOS now.
2625         * platform/MIMETypeRegistry.h:
2626         * platform/cocoa/MIMETypeRegistryCocoa.mm:
2627         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): Add a mapping
2628         for USDZ.
2629
2630 2019-01-08  Tim Horton  <timothy_horton@apple.com>
2631
2632         Editable images sometimes don't become focused when tapped
2633         https://bugs.webkit.org/show_bug.cgi?id=193259
2634         <rdar://problem/47038424>
2635
2636         Reviewed by Wenson Hsieh.
2637
2638         Often when tapping an editable image inside an editable text area, the
2639         text area's selection will change instead of focusing the editable image.
2640
2641         No new tests; I have had no luck writing a test that reliably failed 
2642         beforehand (the "sometimes" is a problem).
2643
2644         * html/HTMLImageElement.cpp:
2645         (WebCore::HTMLImageElement::defaultEventHandler):
2646         * html/HTMLImageElement.h:
2647         Override mousedown on editable images, focus the image, and prevent
2648         the default behavior.
2649
2650 2019-01-08  Jiewen Tan  <jiewen_tan@apple.com>
2651
2652         [WebAuthN] Support U2F HID Authenticators on macOS
2653         https://bugs.webkit.org/show_bug.cgi?id=191535
2654         <rdar://problem/47102027>
2655
2656         Reviewed by Brent Fulgham.
2657
2658         This patch changes U2fCommandConstructor to produce register commands with
2659         enforcing test of user presence. Otherwise, authenticators would silently
2660         generate credentials. It also renames readFromU2fSignResponse to
2661         readU2fSignResponse.
2662
2663         Tests: http/wpt/webauthn/public-key-credential-create-failure-u2f-silent.https.html
2664                http/wpt/webauthn/public-key-credential-create-failure-u2f.https.html
2665                http/wpt/webauthn/public-key-credential-create-success-u2f.https.html
2666                http/wpt/webauthn/public-key-credential-get-failure-u2f-silent.https.html
2667                http/wpt/webauthn/public-key-credential-get-failure-u2f.https.html
2668                http/wpt/webauthn/public-key-credential-get-success-u2f.https.html
2669
2670         * Modules/webauthn/fido/U2fCommandConstructor.cpp:
2671         (fido::WebCore::constructU2fRegisterCommand):
2672         * Modules/webauthn/fido/U2fResponseConverter.cpp:
2673         (fido::readU2fSignResponse):
2674         (fido::readFromU2fSignResponse): Deleted.
2675         * Modules/webauthn/fido/U2fResponseConverter.h:
2676
2677 2019-01-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2678
2679         [iOS] Dispatch a synthetic mousedown event prior to starting drags
2680         https://bugs.webkit.org/show_bug.cgi?id=193229
2681         <rdar://problem/46717097>
2682
2683         Reviewed by Tim Horton.
2684
2685         Tweaks some drag initiation logic on iOS to actually send a "mousedown" event to the page prior to drag start.
2686         This improves drag and drop compatibility with web pages that expect a mousedown to always precede dragging.
2687         Additionally, ensure that preventing the "mousedown" event also prevents "dragstart", which matches macOS
2688         behavior.
2689
2690         Test: DragAndDropTests.PreventingMouseDownShouldPreventDragStart
2691
2692         * page/EventHandler.cpp:
2693
2694         Make the text drag delay 0 on iOS. This was introduced on iOS when originally bringing up drag and drop, and was
2695         made to simply match macOS. However, it doesn't make sense to respect the delay here, since the purpose of this
2696         delay is to disambiguate between making a text selection and starting a drag when pressing on text that is
2697         already selected; on iOS (including iOSMac), this gesture conflict is already resolved by platform gesture
2698         recognizers in the client layer, so there is always no delay between mouse down and drag here.
2699
2700         * page/ios/EventHandlerIOS.mm:
2701
2702         Dispatch a mousedown and inspect the value of `m_mouseDownMayStartDrag` when starting a drag on iOS. This brings
2703         our behavior closer in line with macOS.
2704
2705         (WebCore::EventHandler::tryToBeginDataInteractionAtPoint):
2706
2707 2019-01-08  Youenn Fablet  <youenn@apple.com>
2708
2709         service worker fetch handler results in bad referrer
2710         https://bugs.webkit.org/show_bug.cgi?id=188248
2711         <rdar://problem/47050478>
2712
2713         Reviewed by Alex Christensen.
2714
2715         Response sanitization was removing the ReferrerPolicy header from opaque redirect responses.
2716         Reduce sanitization of opaque redirect responses to opaque responses and allow Location header.
2717         Make sure referrer policy is updated for all load redirections, not only CORS loads.
2718
2719         Test: http/tests/security/referrer-policy-redirect-link-downgrade.html
2720
2721         * loader/SubresourceLoader.cpp:
2722         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
2723         * platform/network/ResourceResponseBase.cpp:
2724         (WebCore::isSafeCrossOriginResponseHeader):
2725         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
2726
2727 2019-01-08  Youenn Fablet  <youenn@apple.com>
2728
2729         IDB storage of Crypto keys does not work in private browsing mode
2730         https://bugs.webkit.org/show_bug.cgi?id=193219
2731
2732         Reviewed by Brady Eidson.
2733
2734         https://trac.webkit.org/changeset/238677 moved from using a JSGlobalObject to a JSDOMGlobalObject for serialization/deserialization.
2735         This does not work for crypto keys as they require not only a JSDOMGlobalObject but either a window or worker global object.
2736
2737         To fix the issue, revert 238677, and fix it by checking whether the dumping of an ArrayBuffer happens for a JSDOMGlobalObject or a JSGlobalObject.
2738         If it is the latter, use JSC routines instead of toJS() which requires a JSDOMGlobalObject.
2739
2740         Covered by updated test.
2741
2742         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2743         (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadVM):
2744         (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadExecState):
2745         * bindings/js/JSDOMGlobalObject.cpp:
2746         * bindings/js/JSDOMGlobalObject.h:
2747         * bindings/js/JSDOMWrapper.cpp:
2748         (WebCore::JSDOMObject::JSDOMObject):
2749         * bindings/js/SerializedScriptValue.cpp:
2750         (WebCore::CloneSerializer::dumpArrayBufferView):
2751         (WebCore::CloneSerializer::toJSArrayBuffer):
2752
2753 2019-01-08  Justin Fan  <justin_fan@apple.com>
2754
2755         [WebGPU] Update createRenderPipeline for WebGPUPipelineLayout
2756         https://bugs.webkit.org/show_bug.cgi?id=193247
2757
2758         Reviewed by Dean Jackson.
2759
2760         Add WebGPUPipelineLayout to WebGPURenderPipeline via WebGPUPipelineDescriptorBase.
2761
2762         Test: Updated render-pipelines.html to test new functionality.
2763
2764         * Modules/webgpu/WebGPUDevice.cpp:
2765         (WebCore::WebGPUDevice::createRenderPipeline const): Convert WebGPUPipelineLayout to GPUPipelineLayout.
2766         * Modules/webgpu/WebGPUPipelineDescriptorBase.h:
2767         * Modules/webgpu/WebGPUPipelineDescriptorBase.idl: Add layout field.
2768         * Modules/webgpu/WebGPUPipelineLayout.h: 
2769         (WebCore::WebGPUPipelineLayout::pipelineLayout): Added. Getter.
2770         * platform/graphics/gpu/GPUPipelineDescriptorBase.h: Updated from out-of-date version.
2771         * platform/graphics/gpu/GPUPipelineLayout.cpp:
2772         (WebCore::GPUPipelineLayout::GPUPipelineLayout): Now retains bindGroupLayouts from descriptor.
2773         * platform/graphics/gpu/GPUPipelineLayout.h:
2774         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Now inherits from GPUPipelineDescriptorBase.
2775         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Custom constructor for non-aggregate struct.
2776
2777 2019-01-08  Chris Dumez  <cdumez@apple.com>
2778
2779         Prevent cross-site top-level navigations from third-party iframes
2780         https://bugs.webkit.org/show_bug.cgi?id=193076
2781         <rdar://problem/36074736>
2782
2783         Reviewed by Alex Christensen.
2784
2785         Prevent cross-site top-level navigations from third-party iframes if the following conditions are met:
2786         1. Its tries to navigate the top-level page cross-site (different eTDL+1)
2787         2. The user has never interacted with the third-party iframe or any of its subframes
2788
2789         This experiment's intent is to block suspicious main-frame navigations by third-party content. The feature
2790         is behind a runtime experimental feature flag, on by default.
2791
2792         Tests: http/tests/security/allow-top-level-navigations-by-third-party-iframes-to-same-origin.html
2793                http/tests/security/allow-top-level-navigations-by-third-party-iframes-with-previous-user-activation.html
2794                http/tests/security/allow-top-level-navigations-by-third-party-iframes-with-user-activation.html
2795                http/tests/security/block-top-level-navigations-by-third-party-iframes.html
2796
2797         * dom/Document.cpp:
2798         (WebCore::printNavigationErrorMessage):
2799         (WebCore::Document::canNavigate):
2800         (WebCore::Document::canNavigateInternal):
2801         (WebCore::Document::isNavigationBlockedByThirdPartyIFrameRedirectBlocking):
2802         * dom/Document.h:
2803         * dom/UserGestureIndicator.cpp:
2804         * page/DOMWindow.cpp:
2805         (WebCore::DOMWindow::setLocation):
2806         * page/DOMWindow.h:
2807         * page/Frame.h:
2808         * page/Location.cpp:
2809         (WebCore::Location::replace):
2810         (WebCore::Location::setLocation):
2811         * page/Settings.yaml:
2812
2813 2019-01-08  Alex Christensen  <achristensen@webkit.org>
2814
2815         Stop using NetworkStorageSession in WebProcess
2816         https://bugs.webkit.org/show_bug.cgi?id=193236
2817
2818         Reviewed by Don Olmstead.
2819
2820         No change in behavior.  Some code was only used for ResourceHandle, which isn't used in modern WebKit,
2821         and for cookies, which are handled in the NetworkProcess in modern WebKit.
2822
2823         * loader/CookieJar.cpp:
2824         (WebCore::storageSession):
2825         * loader/EmptyClients.cpp:
2826         * platform/network/NetworkingContext.h:
2827         * platform/network/mac/ResourceHandleMac.mm:
2828         (WebCore::ResourceHandle::createNSURLConnection):
2829         (WebCore::ResourceHandle::start):
2830         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
2831         (WebCore::ResourceHandle::willSendRequest):
2832         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
2833         (WebCore::ResourceHandle::receivedCredential):
2834
2835 2019-01-08  Alex Christensen  <achristensen@webkit.org>
2836
2837         Unreviewed, rolling out r239727.
2838
2839         Broke API tests
2840
2841         Reverted changeset:
2842
2843         "Stop using NetworkStorageSession in WebProcess"
2844         https://bugs.webkit.org/show_bug.cgi?id=193236
2845         https://trac.webkit.org/changeset/239727
2846
2847 2019-01-08  Alex Christensen  <achristensen@webkit.org>
2848
2849         Stop using NetworkStorageSession in WebProcess
2850         https://bugs.webkit.org/show_bug.cgi?id=193236
2851
2852         Reviewed by Don Olmstead.
2853
2854         No change in behavior.  Some code was only used for ResourceHandle, which isn't used in modern WebKit,
2855         and for cookies, which are handled in the NetworkProcess in modern WebKit.
2856
2857         * loader/CookieJar.cpp:
2858         (WebCore::storageSession):
2859         * loader/EmptyClients.cpp:
2860         * platform/network/NetworkingContext.h:
2861         * platform/network/mac/ResourceHandleMac.mm:
2862         (WebCore::ResourceHandle::createNSURLConnection):
2863         (WebCore::ResourceHandle::start):
2864         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
2865         (WebCore::ResourceHandle::willSendRequest):
2866         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
2867         (WebCore::ResourceHandle::receivedCredential):
2868
2869 2019-01-08  Chris Dumez  <cdumez@apple.com>
2870
2871         Regression(PSON-r239182): Blank view when navigating back and forth between google.com and stack overflow
2872         https://bugs.webkit.org/show_bug.cgi?id=193224
2873         <rdar://problem/47097726>
2874
2875         Reviewed by Alex Christensen.
2876
2877         Since r239182, pages get suspended in-place when we suspend the old process after a process-swap on navigation.
2878         When we return to a suspended page, we load the current history item again and it normally properly restores
2879         the page from PageCache, even though we load the same history item and the current one and even though the
2880         page is suspended in-place (i.e. we did not navigate away, which is the usual case for page cache).
2881
2882         The issue is that if the page URL contains a fragment, FrameLoader::shouldPerformFragmentNavigation() would
2883         return true because both the source and destination URLs (which are the same) contains a fragment. To address
2884         the issue, update FrameLoader::shouldPerformFragmentNavigation() to return false if the current page is
2885         suspended.
2886
2887         * loader/FrameLoader.cpp:
2888         (WebCore::FrameLoader::shouldPerformFragmentNavigation):
2889
2890 2019-01-08  Alex Christensen  <achristensen@webkit.org>
2891
2892         Move Windows-specific code from NetworkStorageSessionCFNet.cpp to its own file
2893         https://bugs.webkit.org/show_bug.cgi?id=192958
2894
2895         Reviewed by Yusuke Suzuki.
2896
2897         This makes it easier to reason about what code is used where.
2898
2899         * PlatformAppleWin.cmake:
2900         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2901         (WebCore::createPrivateStorageSession): Deleted.
2902         (WebCore::cookieDomain): Deleted.
2903         (WebCore::canonicalCookieTime): Deleted.
2904         (WebCore::cookieCreatedTime): Deleted.
2905         (WebCore::cookieExpirationTime): Deleted.
2906         (WebCore::cookieName): Deleted.
2907         (WebCore::cookiePath): Deleted.
2908         (WebCore::cookieValue): Deleted.
2909         (WebCore::filterCookies): Deleted.
2910         (WebCore::copyCookiesForURLWithFirstPartyURL): Deleted.
2911         (WebCore::createCookies): Deleted.
2912         (WebCore::NetworkStorageSession::setCookiesFromDOM const): Deleted.
2913         (WebCore::containsSecureCookies): Deleted.
2914         (WebCore::NetworkStorageSession::cookiesForDOM const): Deleted.
2915         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const): Deleted.
2916         (WebCore::NetworkStorageSession::cookiesEnabled const): Deleted.
2917         (WebCore::NetworkStorageSession::getRawCookies const): Deleted.
2918         (WebCore::NetworkStorageSession::deleteCookie const): Deleted.
2919         (WebCore::NetworkStorageSession::getHostnamesWithCookies): Deleted.
2920         (WebCore::NetworkStorageSession::deleteAllCookies): Deleted.
2921         (WebCore::NetworkStorageSession::deleteCookiesForHostnames): Deleted.
2922         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince): Deleted.
2923         * platform/network/cf/NetworkStorageSessionCFNetWin.cpp: Added.
2924         (WebCore::createPrivateStorageSession):
2925         (WebCore::NetworkStorageSession::setCookies):
2926         (WebCore::cookieDomain):
2927         (WebCore::canonicalCookieTime):
2928         (WebCore::cookieCreatedTime):
2929         (WebCore::cookieExpirationTime):
2930         (WebCore::cookieName):
2931         (WebCore::cookiePath):
2932         (WebCore::cookieValue):
2933         (WebCore::filterCookies):
2934         (WebCore::copyCookiesForURLWithFirstPartyURL):
2935         (WebCore::createCookies):
2936         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
2937         (WebCore::containsSecureCookies):
2938         (WebCore::NetworkStorageSession::cookiesForDOM const):
2939         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
2940         (WebCore::NetworkStorageSession::cookiesEnabled const):
2941         (WebCore::NetworkStorageSession::getRawCookies const):
2942         (WebCore::NetworkStorageSession::deleteCookie const):
2943         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
2944         (WebCore::NetworkStorageSession::deleteAllCookies):
2945         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
2946         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
2947
2948 2018-12-19  Antoine Quint  <graouts@apple.com>
2949
2950         [Web Animations] Compute animation effect timing properties in batch
2951         https://bugs.webkit.org/show_bug.cgi?id=192850
2952
2953         Reviewed by Dean Jackson.
2954
2955         We remove a host of functions from AnimationEffect that would allow the computation of various timing properties
2956         defined by the Web Animations specification: phase, progress, current iteration, etc. Indeed, a lot of these functions
2957         would call each other in a chain, and we would re-compute a lot of the earlier properties in those chains several times
2958         when doing something like querying the animation progress. Additionally, some functions, such as WebAnimation::computeRelevance()
2959         and WebAnimation::timeToNextTick() would yield the computation of several such properties numerous times. All of those
2960         functions are called during each animation frame and are ripe for optimizations.
2961
2962         We now compute all timing properties across two functions:
2963         
2964         1. the new AnimationEffect::getBasicTiming() which computes the local time, end time, active duration, active time and phase,
2965         2. the existing AnimationEffect::getComputedTiming() which now also exposes the phase and simple iteration progress.
2966
2967         To support this we introduce a new BasicEffectTiming struct to contain the values computed in AnimationEffect::getBasicTiming()
2968         and spun the AnimationEffect::Phase struct as AnimationEffectPhase so that it may be used across BasicEffectTiming and
2969         ComputedEffectTiming.
2970
2971         No new test since there is no user-observable change.
2972
2973         * WebCore.xcodeproj/project.pbxproj:
2974         * animation/AnimationEffect.cpp:
2975         (WebCore::AnimationEffect::getTiming const):
2976         (WebCore::AnimationEffect::getBasicTiming const):
2977         (WebCore::AnimationEffect::getComputedTiming const):
2978         (WebCore::AnimationEffect::localTime const): Deleted.
2979         (WebCore::AnimationEffect::phase const): Deleted.
2980         (WebCore::AnimationEffect::activeTime const): Deleted.
2981         (WebCore::AnimationEffect::overallProgress const): Deleted.
2982         (WebCore::AnimationEffect::simpleIterationProgress const): Deleted.
2983         (WebCore::AnimationEffect::currentIteration const): Deleted.
2984         (WebCore::AnimationEffect::currentDirection const): Deleted.
2985         (WebCore::AnimationEffect::directedProgress const): Deleted.
2986         (WebCore::AnimationEffect::transformedProgress const): Deleted.
2987         (WebCore::AnimationEffect::iterationProgress const): Deleted.
2988         (WebCore::AnimationEffect::getTiming): Deleted.
2989         (WebCore::AnimationEffect::getComputedTiming): Deleted.
2990         (WebCore::AnimationEffect::endTime const): Deleted.
2991         (WebCore::AnimationEffect::activeDuration const): Deleted.
2992         * animation/AnimationEffect.h:
2993         * animation/AnimationEffectPhase.h: Copied from Source/WebCore/animation/ComputedEffectTiming.h.
2994         * animation/AnimationTimeline.cpp:
2995         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
2996         * animation/AnimationTimeline.h:
2997         * animation/BasicEffectTiming.h: Copied from Source/WebCore/animation/ComputedEffectTiming.h.
2998         * animation/ComputedEffectTiming.h:
2999         * animation/DeclarativeAnimation.cpp:
3000         (WebCore::DeclarativeAnimation::cancel):
3001         (WebCore::DeclarativeAnimation::phaseWithoutEffect const):
3002         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
3003         * animation/DeclarativeAnimation.h:
3004         * animation/KeyframeEffect.cpp:
3005         (WebCore::KeyframeEffect::apply):
3006         (WebCore::KeyframeEffect::getAnimatedStyle):
3007         * animation/WebAnimation.cpp:
3008         (WebCore::WebAnimation::effectEndTime const):
3009         (WebCore::WebAnimation::computeRelevance):
3010         (WebCore::WebAnimation::timeToNextTick const):
3011
3012 2019-01-07  Youenn Fablet  <youenn@apple.com>
3013
3014         Crash in SWServer::Connection::resolveRegistrationReadyRequests
3015         https://bugs.webkit.org/show_bug.cgi?id=193217
3016
3017         Reviewed by Chris Dumez.
3018
3019         As can be seen from the traces, SWServer might clear its connections HashMap in its destructor.
3020         This might then trigger calling SWServer::resolveRegistrationReadyRequests.
3021         This method is iterating on the connections HashMap which is being cleared.
3022         To remove this problem, move the HashMap in a temporary variable and clear the temporary variable.
3023
3024         * workers/service/server/SWServer.cpp:
3025         (WebCore::SWServer::~SWServer):
3026
3027 2019-01-07  Jer Noble  <jer.noble@apple.com>
3028
3029         REGRESSION (r239519): ASSERTION FAILED: !m_adoptionIsRequired in com.apple.WebCore: void WTF::refIfNotNull<WebCore::CDMSessionMediaSourceAVFObjC> + 53
3030         https://bugs.webkit.org/show_bug.cgi?id=193211
3031         <rdar://problem/46937412>
3032
3033         Reviewed by Eric Carlson.
3034
3035         Make CDMSessionMediaSourceAVFObjC a CanMakeWeakPtr rather than RefCounted, as CDMSessions are stored in
3036         std::unique_ptrs, and not in Ref or RefPtr.
3037
3038         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
3039         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3040         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3041         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
3042
3043 2019-01-07  David Kilzer  <ddkilzer@apple.com>
3044
3045         Prefer RetainPtr<NSObject> to RetainPtr<NSObject *>
3046         <https://webkit.org/b/193056>
3047
3048         Reviewed by Alex Christensen.
3049
3050         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3051         (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]):
3052         (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:withDiscontinuity:]):
3053         * platform/network/cf/AuthenticationChallenge.h:
3054         - Remove '*' from RetainPtr<> type.
3055
3056         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
3057         (WebCore::cookiesForURL):
3058         - Once retainPtr() was changed to return RetainPtr<NSArray>
3059           instead of RetainPtr<NSArray *> here, that forced the type of
3060           `cookiesPtr` to change as well since
3061           Optional<RetainPtr<NSArray>> is not assignable to
3062           Optional<RetainPtr<NSArray *>> without further template
3063           specialization, which didn't seem useful since
3064           Optional<RetainPtr<>> variable types are rarely used.
3065
3066 2019-01-07  Devin Rousso  <drousso@apple.com>
3067
3068         Web Inspector: extend XHR breakpoints to work with fetch
3069         https://bugs.webkit.org/show_bug.cgi?id=185843
3070         <rdar://problem/40431027>
3071
3072         Reviewed by Matt Baker.
3073
3074         Test: inspector/dom-debugger/url-breakpoints.html
3075
3076         * Modules/fetch/FetchResponse.cpp:
3077         (WebCore::FetchResponse::fetch):
3078
3079         * inspector/InspectorInstrumentation.h:
3080         (WebCore::InspectorInstrumentation::willFetch): Added.
3081         * inspector/InspectorInstrumentation.cpp:
3082         (WebCore::InspectorInstrumentation::willFetchImpl): Added.
3083
3084         * inspector/agents/InspectorDOMDebuggerAgent.h:
3085         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
3086         (WebCore::InspectorDOMDebuggerAgent::disable):
3087         (WebCore::InspectorDOMDebuggerAgent::discardBindings):
3088         (WebCore::InspectorDOMDebuggerAgent::setURLBreakpoint): Added.
3089         (WebCore::InspectorDOMDebuggerAgent::removeURLBreakpoint): Added.
3090         (WebCore::InspectorDOMDebuggerAgent::breakOnURLIfNeeded): Added.
3091         (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
3092         (WebCore::InspectorDOMDebuggerAgent::willFetch): Added.
3093         (WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint): Deleted.
3094         (WebCore::InspectorDOMDebuggerAgent::removeXHRBreakpoint): Deleted.
3095
3096 2019-01-07  Eric Carlson  <eric.carlson@apple.com>
3097
3098         Cleanup AudioTrackPrivateMediaStreamCocoa
3099         https://bugs.webkit.org/show_bug.cgi?id=193208
3100         <rdar://problem/42225870>
3101
3102         Reviewed by Youenn Fablet.
3103
3104         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
3105         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable): Clear input and
3106         output format descriptions after stopping the audio unit.
3107
3108 2019-01-07  Devin Rousso  <drousso@apple.com>
3109
3110         Web Inspector: Network: show secure connection details per-request
3111         https://bugs.webkit.org/show_bug.cgi?id=191539
3112         <rdar://problem/45979891>
3113
3114         Reviewed by Joseph Pecoraro.
3115
3116         Test: http/tests/inspector/network/resource-security-connection.html
3117
3118         * platform/network/NetworkLoadMetrics.h:
3119         (WebCore::NetworkLoadMetrics:isolatedCopy):
3120         (WebCore::NetworkLoadMetrics:clearNonTimingData):
3121         (WebCore::NetworkLoadMetrics:operator==):
3122         (WebCore::NetworkLoadMetrics:encode):
3123         (WebCore::NetworkLoadMetrics:decode):
3124
3125         * inspector/agents/InspectorNetworkAgent.cpp:
3126         (WebCore::InspectorNetworkAgent::buildObjectForMetrics):
3127
3128 2019-01-07  Eric Carlson  <eric.carlson@apple.com>
3129
3130         Deactivate audio session whenever possible
3131         https://bugs.webkit.org/show_bug.cgi?id=193188
3132         <rdar://problem/42678977>
3133
3134         Reviewed by Jer Noble.
3135
3136         Test: media/deactivate-audio-session.html
3137
3138         * platform/audio/AudioSession.cpp:
3139         (WebCore::AudioSession::tryToSetActive):
3140         (WebCore::AudioSession::tryToSetActiveInternal):
3141         * platform/audio/AudioSession.h:
3142         (WebCore::AudioSession::isActive const):
3143
3144         * platform/audio/PlatformMediaSessionManager.cpp:
3145         (WebCore::PlatformMediaSessionManager::removeSession):
3146         (WebCore::deactivateAudioSession):
3147         (WebCore::PlatformMediaSessionManager::shouldDeactivateAudioSession):
3148         (WebCore::PlatformMediaSessionManager::setShouldDeactivateAudioSession):
3149         * platform/audio/PlatformMediaSessionManager.h:
3150
3151         * platform/audio/ios/AudioSessionIOS.mm:
3152         (WebCore::AudioSession::tryToSetActiveInternal):
3153         (WebCore::AudioSession::tryToSetActive): Deleted.
3154
3155         * platform/audio/mac/AudioSessionMac.cpp:
3156         (WebCore::AudioSession::tryToSetActiveInternal):
3157         (WebCore::AudioSession::tryToSetActive): Deleted.
3158
3159         * testing/Internals.cpp:
3160         (WebCore::Internals::audioSessionActive const):
3161         * testing/Internals.h:
3162         * testing/Internals.idl:
3163
3164 2019-01-07  David Kilzer  <ddkilzer@apple.com>
3165
3166         PlatformECKey should use a std::unique_ptr
3167         <https://webkit.org/b/193170>
3168
3169         Reviewed by Brent Fulgham.
3170
3171         Broadly:
3172         - Switch from using raw pointers to using std::unique_ptr<> to
3173           hold PlatformECKey.
3174         - Introduce PlatformECKeyContainer type to handle different
3175           std::unique_ptr<> types on each platform.
3176         - Get rid of custom CryptoKeyEC destructors since the
3177           std::unique_ptr<> handles that with a Deleter.
3178         - Initialize stack variables to nullptr.
3179
3180         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
3181         (WebCore::CryptoKeyEC::keySizeInBits const):
3182         (WebCore::CryptoKeyEC::platformGeneratePair):
3183         (WebCore::CryptoKeyEC::platformImportRaw):
3184         (WebCore::CryptoKeyEC::platformImportJWKPublic):
3185         (WebCore::CryptoKeyEC::platformImportJWKPrivate):
3186         (WebCore::CryptoKeyEC::platformImportSpki):
3187         (WebCore::CryptoKeyEC::platformImportPkcs8):
3188         (WebCore::CryptoKeyEC::platformExportRaw const):
3189         (WebCore::CryptoKeyEC::platformAddFieldElements const):
3190         (WebCore::CryptoKeyEC::platformExportSpki const):
3191         (WebCore::CryptoKeyEC::platformExportPkcs8 const):
3192         (WebCore::CryptoKeyEC::~CryptoKeyEC): Deleted.
3193         * crypto/keys/CryptoKeyEC.cpp:
3194         (WebCore::CryptoKeyEC::CryptoKeyEC):
3195         * crypto/keys/CryptoKeyEC.h:
3196         (WebCore::CCECCryptorRefDeleter::operator() const):
3197         * crypto/mac/CryptoKeyECMac.cpp:
3198         (WebCore::CryptoKeyEC::keySizeInBits const):
3199         (WebCore::CryptoKeyEC::platformGeneratePair):
3200         (WebCore::CryptoKeyEC::platformImportRaw):
3201         (WebCore::CryptoKeyEC::platformExportRaw const):
3202         (WebCore::CryptoKeyEC::platformImportJWKPublic):
3203         (WebCore::CryptoKeyEC::platformImportJWKPrivate):
3204         (WebCore::CryptoKeyEC::platformAddFieldElements const):
3205         (WebCore::CryptoKeyEC::platformImportSpki):
3206         (WebCore::CryptoKeyEC::platformExportSpki const):
3207         (WebCore::CryptoKeyEC::platformImportPkcs8):
3208         (WebCore::CryptoKeyEC::platformExportPkcs8 const):
3209         (WebCore::CryptoKeyEC::~CryptoKeyEC): Deleted.
3210
3211 2019-01-07  Antti Koivisto  <antti@apple.com>
3212
3213         UI process side scrollbars for UI side compositing on Mac
3214         https://bugs.webkit.org/show_bug.cgi?id=193106
3215
3216         Reviewed by Tim Horton.
3217
3218         * page/FrameView.cpp:
3219         (WebCore::FrameView::paintScrollCorner):
3220         * page/scrolling/AsyncScrollingCoordinator.cpp:
3221         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
3222
3223         Pass scrollbar host layers and the dark appearance bit to the scrolling tree.
3224
3225         * page/scrolling/ScrollingCoordinator.cpp:
3226         (WebCore::ScrollingCoordinator::verticalScrollbarLayerForFrameView):
3227         (WebCore::ScrollingCoordinator::horizontalScrollbarLayerForFrameView):
3228         * page/scrolling/ScrollingCoordinator.h:
3229         (WebCore::ScrollableAreaParameters::ScrollableAreaParameters):
3230         (WebCore::ScrollableAreaParameters::operator== const):
3231         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
3232         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
3233         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarLayers):
3234         * page/scrolling/ScrollingStateFrameScrollingNode.h:
3235         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
3236         * page/scrolling/ScrollingTreeScrollingNode.h:
3237         (WebCore::ScrollingTreeScrollingNode::scrollableAreaSize const):
3238         (WebCore::ScrollingTreeScrollingNode::totalContentsSize const):
3239         (WebCore::ScrollingTreeScrollingNode::useDarkAppearanceForScrollbars const):
3240         (WebCore::ScrollingTreeScrollingNode::lastCommittedScrollPosition const):
3241         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
3242         * platform/ScrollableArea.cpp:
3243         (WebCore::ScrollableArea::useDarkAppearanceForScrollbars const):
3244
3245         Factor into a function as this is used in several places.
3246
3247         * platform/ScrollableArea.h:
3248         * platform/mac/NSScrollerImpDetails.h:
3249         * platform/mac/ScrollAnimatorMac.mm:
3250         (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]):
3251         * platform/mac/ScrollbarThemeMac.h:
3252
3253 2019-01-07  Wenson Hsieh  <wenson_hsieh@apple.com>
3254
3255         Native caret shows up alongside the page's caret when requesting desktop site on jsfiddle.net
3256         https://bugs.webkit.org/show_bug.cgi?id=193180
3257         <rdar://problem/45971041>
3258
3259         Reviewed by Tim Horton.
3260
3261         Adjust a method on RenderObject to additionally detect when the RenderObject is inside of an `overflow: hidden`
3262         container that is also empty. See WebKit ChangeLog for more details.
3263
3264         Test:   editing/selection/ios/hide-selection-in-empty-overflow-hidden-container.html
3265                 editing/selection/ios/show-selection-in-empty-overflow-hidden-document.html
3266
3267         * rendering/RenderObject.cpp:
3268         (WebCore::RenderObject::isTransparentOrFullyClippedRespectingParentFrames const):
3269         (WebCore::RenderObject::isTransparentRespectingParentFrames const): Deleted.
3270         * rendering/RenderObject.h:
3271
3272 2019-01-07  Zalan Bujtas  <zalan@apple.com>
3273
3274         [LFC][BFC] Margin collapsing should not be limited to in-flow non-replaced boxes.
3275         https://bugs.webkit.org/show_bug.cgi?id=193183
3276
3277         Reviewed by Antti Koivisto.
3278
3279         * layout/FormattingContext.cpp:
3280         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
3281         * layout/FormattingContextGeometry.cpp:
3282         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
3283         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
3284         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
3285         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
3286         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
3287         * layout/LayoutUnits.h:
3288         * layout/blockformatting/BlockFormattingContext.cpp:
3289         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
3290         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3291         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3292         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
3293         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
3294         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
3295         * layout/inlineformatting/InlineFormattingContext.cpp:
3296         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
3297
3298 2019-01-07  Zalan Bujtas  <zalan@apple.com>
3299
3300         [LFC][BFC] Move MarginCollapse from BlockFormattingContext::Geometry to BlockFormattingContext
3301         https://bugs.webkit.org/show_bug.cgi?id=193181
3302
3303         Reviewed by Antti Koivisto.
3304
3305         This is in preparation to share margin collapsing across all boxes in block formatting context.
3306
3307         * layout/blockformatting/BlockFormattingContext.h:
3308         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3309         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
3310         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
3311         * layout/blockformatting/BlockMarginCollapse.cpp:
3312         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBefore):
3313         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginAfter):
3314         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBefore):
3315         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginAfter):
3316         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBeforeFromFirstChild):
3317         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginAfterFromLastChild):
3318         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
3319         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
3320         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
3321         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
3322         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
3323         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
3324         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSibling):
3325         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
3326         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBefore):
3327         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfter):
3328         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore): Deleted.
3329         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter): Deleted.
3330         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore): Deleted.
3331         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter): Deleted.
3332         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild): Deleted.
3333         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild): Deleted.
3334         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter): Deleted.
3335         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore): Deleted.
3336         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance): Deleted.
3337         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore): Deleted.
3338         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter): Deleted.
3339         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling): Deleted.
3340         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling): Deleted.
3341         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough): Deleted.
3342         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore): Deleted.
3343         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter): Deleted.
3344
3345 2019-01-07  Zan Dobersek  <zdobersek@igalia.com>
3346
3347         [WPE] Use Widget bounds for PlatformScreen rectangle information
3348         https://bugs.webkit.org/show_bug.cgi?id=193190
3349
3350         Reviewed by Philippe Normand.
3351
3352         Provide a better screen area estimate in screenRect() and
3353         screenAvailableRect() return values than the current 1240x640 value by
3354         using the Widget's bounds rectangle.
3355
3356         This approach is only factually correct when the Widget-associated view
3357         is displayed in fullscreen, but it provides a better estimate even when
3358         displayed in any other case as well. WPE doesn't provide specific API
3359         that could enable the embedding environment to provide this information.
3360
3361         * platform/wpe/PlatformScreenWPE.cpp:
3362         (WebCore::screenRect): Return bounds of the Widget object.
3363         (WebCore::screenAvailableRect): Relay the call to screenRect().
3364
3365 2019-01-07  Zan Dobersek  <zdobersek@igalia.com>
3366
3367         Make Gradient::gradientSpaceTransform(), Pattern::patternSpaceTransform() methods const
3368         https://bugs.webkit.org/show_bug.cgi?id=193189
3369
3370         Reviewed by Philippe Normand.
3371
3372         The transform getter methods on the Gradient and Pattern classes both
3373         return const references to the transform objects, and don't modify any
3374         internal state. They should be marked const accordingly, allowing
3375         invocations of these two methods through const references to Gradient
3376         and Pattern objects.
3377
3378         * platform/graphics/Gradient.h:
3379         (WebCore::Gradient::gradientSpaceTransform): Now const.
3380         * platform/graphics/Pattern.h:
3381         (WebCore::Pattern::patternSpaceTransform): Now const.
3382
3383 2019-01-07  Zan Dobersek  <zdobersek@igalia.com>
3384
3385         REGRESSION(r239636): ImageDecoder::setEncodedDataStatusChangeCallback() can be called on a null decoder
3386         https://bugs.webkit.org/show_bug.cgi?id=193187
3387
3388         Reviewed by Philippe Normand.
3389
3390         * platform/graphics/ImageSource.cpp:
3391         (WebCore::ImageSource::ensureDecoderAvailable): Bail before calling the
3392         setEncodedDataStatusChangeCallback() method when the returned
3393         ImageDecoder object is null.
3394
3395 2019-01-06  Zan Dobersek  <zdobersek@igalia.com>
3396
3397         [Nicosia] Take over CoordinatedGraphics-named implementation of async scrolling classes
3398         https://bugs.webkit.org/show_bug.cgi?id=193133
3399
3400         Reviewed by Michael Catanzaro.
3401
3402         Move the CoordinatedGraphics-specific files under
3403         page/scrolling/coordinatedgraphics/ to page/scrolling/nicosia/, along
3404         with renaming the files and classes accordingly. Implementation will
3405         only depend on the Nicosia-specific layer structure and is not specific
3406         to the CoordinatedGraphics system.
3407
3408         * PlatformPlayStation.cmake:
3409         * SourcesGTK.txt:
3410         * SourcesWPE.txt:
3411         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp.
3412         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h.
3413         * page/scrolling/nicosia/ScrollingStateNodeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp.
3414         * page/scrolling/nicosia/ScrollingTreeFixedNode.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp.
3415         * page/scrolling/nicosia/ScrollingTreeFixedNode.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h.
3416         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp.
3417         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h.
3418         * page/scrolling/nicosia/ScrollingTreeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp.
3419         * page/scrolling/nicosia/ScrollingTreeNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h.
3420         * page/scrolling/nicosia/ScrollingTreeStickyNode.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp.
3421         * page/scrolling/nicosia/ScrollingTreeStickyNode.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h.
3422         * platform/TextureMapper.cmake:
3423
3424 2019-01-06  Jiewen Tan  <jiewen_tan@apple.com>
3425
3426         [WebAuthN] Import U2F command/response converters from Chromium
3427         https://bugs.webkit.org/show_bug.cgi?id=193150
3428         <rdar://problem/47054028>
3429
3430         Reviewed by Brent Fulgham.
3431
3432         This patch imports Chromium's U2F command/response converters:
3433         https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-client-to-authenticator-protocol-v2.0-id-20180227.html#u2f-interoperability
3434         1. It directly imports the following files and suit them to WebKit's coding style:
3435         https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor.cc?l=1&rcl=db624110317d01efa78cd32e7be1524190e1beb0
3436         https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor.h?rcl=db624110317d01efa78cd32e7be1524190e1beb0
3437         https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor_unittest.cc?rcl=db624110317d01efa78cd32e7be1524190e1beb0
3438         2. It gathers the following methods into U2fResponseConverter:
3439         AuthenticatorMakeCredentialResponse::CreateFromU2fRegisterResponse()
3440         AuthenticatorGetAssertionResponse::CreateFromU2fSignResponse()
3441         3. It also updates FidoConstants.h, FidoTestData.h and CtapResponseTest.cpp accordingly.
3442
3443         Besides importing stuff from Chroimum, it also gathers a bunch of constants and helper functions into WebAuthenticationConstants.h
3444         and WebAuthenticationUtils.h. It also fixes Bug 183534: 2) and 7).
3445
3446         Covered by API tests.
3447
3448         * Modules/webauthn/AuthenticatorCoordinator.cpp:
3449         (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJsonHash):
3450         * Modules/webauthn/WebAuthenticationConstants.h: Copied from Source/WebCore/Modules/webauthn/COSEConstants.h.
3451         * Modules/webauthn/WebAuthenticationUtils.cpp: Added.
3452         (WebCore::convertBytesToVector):
3453         (WebCore::produceRpIdHash):
3454         (WebCore::encodeES256PublicKeyAsCBOR):
3455         (WebCore::buildAttestedCredentialData):
3456         (WebCore::buildAuthData):
3457         (WebCore::buildAttestationObject):
3458         * Modules/webauthn/WebAuthenticationUtils.h: Renamed from Source/WebCore/Modules/webauthn/COSEConstants.h.
3459         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
3460         (fido::getCredentialId):
3461         (fido::readCTAPGetInfoResponse):
3462         * Modules/webauthn/fido/FidoConstants.h:
3463         * Modules/webauthn/fido/U2fCommandConstructor.cpp: Added.
3464         (fido::WebCore::constructU2fRegisterCommand):
3465         (fido::WebCore::constructU2fSignCommand):
3466         (fido::isConvertibleToU2fRegisterCommand):
3467         (fido::isConvertibleToU2fSignCommand):
3468         (fido::convertToU2fRegisterCommand):
3469         (fido::convertToU2fCheckOnlySignCommand):
3470         (fido::convertToU2fSignCommand):
3471         (fido::constructBogusU2fRegistrationCommand):
3472         * Modules/webauthn/fido/U2fCommandConstructor.h: Added.
3473         * Modules/webauthn/fido/U2fResponseConverter.cpp: Added.
3474         (fido::WebCore::extractECPublicKeyFromU2fRegistrationResponse):
3475         (fido::WebCore::extractCredentialIdFromU2fRegistrationResponse):
3476         (fido::WebCore::createAttestedCredentialDataFromU2fRegisterResponse):
3477         (fido::WebCore::parseX509Length):
3478         (fido::WebCore::createFidoAttestationStatementFromU2fRegisterResponse):
3479         (fido::readU2fRegisterResponse):
3480         (fido::readFromU2fSignResponse):
3481         * Modules/webauthn/fido/U2fResponseConverter.h: Added.
3482         * Modules/webgpu/WebGPUCommandBuffer.cpp:
3483         * Sources.txt:
3484         * WebCore.xcodeproj/project.pbxproj:
3485
3486 2019-01-06  David Kilzer  <ddkilzer@apple.com>
3487
3488         Leak of WTF::Function objects in WebCore::CryptoKeyRSA::generatePair() (64-80 bytes each) in com.apple.WebKit.WebContent running WebKit layout tests
3489         <https://webkit.org/b/193177>
3490         <rdar://problem/47072196>
3491
3492         Reviewed by Saam Barati.
3493
3494         * crypto/mac/CryptoKeyRSAMac.cpp:
3495         (WebCore::CryptoKeyRSA::generatePair): Fix the leak by changing
3496         raw pointers to heap-allocated __block variables to hold the
3497         WTF::Function objects until they are consumed within the block
3498         passed to dispatch_async().  The __block variables act like
3499         captured variables in a C++ lambda and have the same lifetime as
3500         the block that they are captured in.  Note that we would have to
3501         convert the source file from C++ to Objective-C++ to use a C++
3502         lambda functor with dispatch_async(), which creates its own
3503         issue because the comipiler requires a copy constructor to
3504         convert the C++ lambda to a block functor, but the copy
3505         constructor for the C++ lambda is implicitly deleted because the
3506         WTF::Function copy constructor is explicitly deleted.  Whew!
3507
3508 2019-01-06  Pablo Saavedra  <psaavedra@igalia.com>
3509
3510         [WPE][GTK] Building with ENABLE_VIDEO=OFF fails trying to use Document MediaPlayback functions.
3511         https://bugs.webkit.org/show_bug.cgi?id=193174
3512
3513         Reviewed by Michael Catanzaro.
3514
3515         * page/Page.cpp:
3516         (WebCore::Page::stopAllMediaPlayback):
3517         (WebCore::Page::suspendAllMediaPlayback):
3518         (WebCore::Page::resumeAllMediaPlayback):
3519
3520 2019-01-05  David Kilzer  <ddkilzer@apple.com>
3521
3522         Leak of two CCRSACryptorRef (4.0 Kbytes/1 page each) in com.apple.WebKit.WebContent running WebKit layout tests
3523         <https://webkit.org/b/193154>
3524         <rdar://problem/47052993>
3525
3526         Reviewed by Brent Fulgham.
3527
3528         Broadly:
3529         - Fix leaks by switching from using raw pointers to using
3530           std::unique_ptr<>.
3531         - Introduce PlatformRSAKeyContainer type to handle different
3532           std::unique_ptr<> on each platform.
3533         - Get rid of custom CryptoKeyRSA destructors since the
3534           std::unique_ptr<> handles that with a Deleter.
3535         - Initialize stack variables to nullptr.
3536
3537         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
3538         (WebCore::CryptoKeyRSA::create):
3539         (WebCore::CryptoKeyRSA::CryptoKeyRSA):
3540         (WebCore::CryptoKeyRSA::keySizeInBits const):
3541         (WebCore::CryptoKeyRSA::generatePair):
3542         (WebCore::CryptoKeyRSA::importSpki):
3543         (WebCore::CryptoKeyRSA::importPkcs8):
3544         (WebCore::CryptoKeyRSA::exportSpki const):
3545         (WebCore::CryptoKeyRSA::exportPkcs8 const):
3546         (WebCore::CryptoKeyRSA::algorithm const):
3547         (WebCore::CryptoKeyRSA::exportData const):
3548         (WebCore::CryptoKeyRSA::~CryptoKeyRSA): Deleted.
3549         * crypto/keys/CryptoKeyRSA.h:
3550         (WebCore::CCRSACryptorRefDeleter::operator() const):
3551         * crypto/mac/CryptoKeyRSAMac.cpp:
3552         (WebCore::getPublicKeyComponents):
3553         (WebCore::getPrivateKeyComponents):
3554         (WebCore::CryptoKeyRSA::CryptoKeyRSA):
3555         (WebCore::CryptoKeyRSA::create):
3556         (WebCore::CryptoKeyRSA::exportData const):
3557         (WebCore::CryptoKeyRSA::generatePair):
3558         (WebCore::CryptoKeyRSA::importSpki):
3559         (WebCore::CryptoKeyRSA::importPkcs8):
3560         (WebCore::CryptoKeyRSA::~CryptoKeyRSA): Deleted.
3561
3562 2019-01-05  Zalan Bujtas  <zalan@apple.com>
3563
3564         Incorrect clipping across compositing boundary.
3565         https://bugs.webkit.org/show_bug.cgi?id=193172
3566         <rdar://problem/44693008>
3567
3568         Reviewed by Simon Fraser.
3569
3570         Use temporary cliprect type when crossing compositing boundary to prevent cliprect caching.
3571
3572         The issue here is that RenderLayer::backgroundClipRect() could cross compositing boundary by calling parentClipRects() which triggers
3573         clip rect update using the wrong painting root. This happens when the layer hierarchy and the compositing context do not match.
3574         For clip rect computation, we need to climb up on the layer hierarchy (calling parent layer's cliprect functions)
3575         but we also need to make sure that the computed cliprects on any given layer are cached only when the painting root is correct.
3576         It ensures that when we paint a layer (with the painting root as entry point), the cached cliprects are always based on its onw painting root. 
3577
3578         Test: compositing/clipping/cached-cliprect-with-compositing-boundary.html
3579
3580         * rendering/RenderLayer.cpp:
3581         (WebCore::RenderLayer::calculateClipRects const):
3582
3583 2019-01-05  Youenn Fablet  <youenn@apple.com>
3584
3585         Service Worker fetch should obey its referrer policy
3586         https://bugs.webkit.org/show_bug.cgi?id=193152
3587
3588         Reviewed by Chris Dumez.
3589
3590         Pass referrer policy retrieved when fetching the service worker script to the SWServer.
3591         The SWServer then stores it persistently and sends it to the manager creating service workers.
3592         This manager will then set the referrer policy on the dummy Document of the corresponding service worker.
3593
3594         Covered by rebased test.
3595
3596         * workers/WorkerScriptLoader.cpp:
3597         (WebCore::WorkerScriptLoader::didReceiveResponse):
3598         * workers/WorkerScriptLoader.h:
3599         (WebCore::WorkerScriptLoader::referrerPolicy const):
3600         * workers/service/SWClientConnection.cpp:
3601         (WebCore::SWClientConnection::failedFetchingScript):
3602         * workers/service/ServiceWorkerContainer.cpp:
3603         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
3604         * workers/service/ServiceWorkerContainer.h:
3605         * workers/service/ServiceWorkerContextData.cpp:
3606         (WebCore::ServiceWorkerContextData::isolatedCopy const):
3607         * workers/service/ServiceWorkerContextData.h:
3608         (WebCore::ServiceWorkerContextData::encode const):
3609         (WebCore::ServiceWorkerContextData::decode):
3610         * workers/service/ServiceWorkerFetchResult.h:
3611         (WebCore::ServiceWorkerFetchResult::encode const):
3612         (WebCore::ServiceWorkerFetchResult::decode):
3613         * workers/service/ServiceWorkerJob.cpp:
3614         (WebCore::ServiceWorkerJob::notifyFinished):
3615         * workers/service/ServiceWorkerJobClient.h:
3616         * workers/service/context/ServiceWorkerThreadProxy.cpp:
3617         (WebCore::createPageForServiceWorker):
3618         * workers/service/server/RegistrationDatabase.cpp:
3619         (WebCore::recordsTableSchema):
3620         (WebCore::RegistrationDatabase::doPushChanges):
3621         (WebCore::RegistrationDatabase::importRecords):
3622         * workers/service/server/SWServer.cpp:
3623         (WebCore::SWServer::addRegistrationFromStore):
3624         (WebCore::SWServer::updateWorker):
3625         (WebCore::SWServer::installContextData):
3626         * workers/service/server/SWServer.h:
3627         * workers/service/server/SWServerJobQueue.cpp:
3628         (WebCore::SWServerJobQueue::scriptFetchFinished):
3629         * workers/service/server/SWServerWorker.cpp:
3630         (WebCore::SWServerWorker::SWServerWorker):
3631         (WebCore::SWServerWorker::contextData const):
3632         * workers/service/server/SWServerWorker.h:
3633
3634 2019-01-04  Simon Fraser  <simon.fraser@apple.com>
3635
3636         Factor legacy WK1 code for fixed and scrolling layers into their own helper class
3637         https://bugs.webkit.org/show_bug.cgi?id=193165
3638
3639         Reviewed by Frédéric Wang.
3640
3641         RenderLayerCompositor has some code to handle registration of viewport-constrained
3642         and scrolling layers which is specific to iOS WK1. To reduce pollution, move this
3643         into its own helper class called LegacyWebKitScrollingLayerCoordinator, which is only
3644         allocated for iOS WK1.
3645         
3646         iOS WK1 never has a ScrollingCoordinator, so rather than the check for scrollingCoordinator(),
3647         we know that we only made a LegacyWebKitScrollingLayerCoordinator when there's a platform widget
3648         (i.e. WK1).
3649         
3650         * page/ChromeClient.h:
3651         * rendering/RenderLayerCompositor.cpp:
3652         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
3653         (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush):
3654         (WebCore::RenderLayerCompositor::didFlushChangesForLayer):
3655         (WebCore::RenderLayerCompositor::setIsInWindow):
3656         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking): No longer check the page cache state; now we
3657         destroy the render tree of pages in the page cache, so we should never hit this code path.
3658         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
3659         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
3660         (WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllViewportConstrainedLayers):
3661         (WebCore::scrollbarHasDisplayNone):
3662         (WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer):
3663         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllScrollingLayers):
3664         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerScrollingLayersNeedingUpdate):
3665         (WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllScrollingLayers):
3666         (WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
3667         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
3668         (WebCore::LegacyWebKitScrollingLayerCoordinator::didFlushChangesForLayer):
3669         (WebCore::updateScrollingLayerWithClient): Deleted.
3670         (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers): Deleted.
3671         (WebCore::RenderLayerCompositor::unregisterAllViewportConstrainedLayers): Deleted.
3672         (WebCore::RenderLayerCompositor::registerAllScrollingLayers): Deleted.
3673         (WebCore::RenderLayerCompositor::unregisterAllScrollingLayers): Deleted.
3674         * rendering/RenderLayerCompositor.h:
3675         (WebCore::LegacyWebKitScrollingLayerCoordinator::LegacyWebKitScrollingLayerCoordinator):
3676         * workers/service/ServiceWorkerContainer.cpp:
3677         (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer):
3678
3679 2019-01-05  Zalan Bujtas  <zalan@apple.com>
3680
3681         [LFC] VerticalMargin should only have the used values.
3682         https://bugs.webkit.org/show_bug.cgi?id=193168
3683
3684         Reviewed by Antti Koivisto.
3685
3686         Split VerticalMargin into ComputedVerticalMargin and UsedVerticalMargin.
3687         ComputedVerticalMargin holds the computed (optional) values while UsedVerticalMargin holds both the
3688         collapsed (optional) and the non-collapsed values.
3689
3690         * layout/FormattingContext.cpp:
3691         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
3692         * layout/FormattingContext.h:
3693         * layout/FormattingContextGeometry.cpp:
3694         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
3695         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
3696         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
3697         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
3698         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
3699         (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin):
3700         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue): Deleted.
3701         * layout/FormattingContextQuirks.cpp:
3702         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
3703         * layout/LayoutUnits.h:
3704         * layout/MarginTypes.h:
3705         (WebCore::Layout::UsedVerticalMargin::before const):
3706         (WebCore::Layout::UsedVerticalMargin::after const):
3707         (WebCore::Layout::UsedVerticalMargin::nonCollapsedValues const):
3708         (WebCore::Layout::UsedVerticalMargin::collapsedValues const):
3709         (WebCore::Layout::UsedVerticalMargin::hasCollapsedValues const):
3710         (WebCore::Layout::UsedVerticalMargin::setCollapsedValues):
3711         (WebCore::Layout::UsedVerticalMargin::UsedVerticalMargin):
3712         (WebCore::Layout::VerticalMargin::nonCollapsedValues const): Deleted.
3713         (WebCore::Layout::VerticalMargin::collapsedValues const): Deleted.
3714         (WebCore::Layout::VerticalMargin::setCollapsedValues): Deleted.
3715         (WebCore::Layout::VerticalMargin::VerticalMargin): Deleted.
3716         (WebCore::Layout::VerticalMargin::usedValues const): Deleted.
3717         * layout/blockformatting/BlockFormattingContext.cpp:
3718         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
3719         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3720         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3721         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
3722         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
3723         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
3724         * layout/blockformatting/BlockMarginCollapse.cpp:
3725         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
3726         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
3727         * layout/displaytree/DisplayBox.h:
3728         (WebCore::Display::Box::setVerticalMargin):
3729         (WebCore::Display::Box::verticalMargin const):
3730         (WebCore::Display::Box::marginBefore const):
3731         (WebCore::Display::Box::marginAfter const):
3732         * layout/floats/FloatingContext.cpp:
3733         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
3734         * layout/inlineformatting/InlineFormattingContext.cpp:
3735         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
3736
3737 2019-01-04  Daniel Bates  <dabates@apple.com>
3738
3739         REGRESSION (r238522): Erratic scrolling on Google flights search result page and vrbo.com
3740         https://bugs.webkit.org/show_bug.cgi?id=192996
3741         <rdar://problem/46573552>
3742
3743         Reviewed by Simon Fraser.
3744
3745         Only scroll a text field if its inner text size changes and it is the currently active and
3746         focused element on the page.
3747
3748         Test: fast/scrolling/page-should-not-scroll-on-unfocused-text-field-layout.html
3749
3750         * rendering/RenderTextControlSingleLine.cpp:
3751         (WebCore::RenderTextControlSingleLine::layout):
3752
3753 2019-01-04  Alex Christensen  <achristensen@webkit.org>
3754
3755         Progress towards fixing Mac CMake build
3756         https://bugs.webkit.org/show_bug.cgi?id=193105
3757
3758         Reviewed by Don Olmstead.
3759
3760         * PlatformMac.cmake:
3761         * Sources.txt:
3762         * SourcesCocoa.txt:
3763         * WebCore.xcodeproj/project.pbxproj:
3764         * platform/graphics/gpu/GPURenderPassEncoder.h:
3765
3766 2019-01-04  Zalan Bujtas  <zalan@apple.com>
3767
3768         [iOS] ERROR: post-layout: dirty renderer(s) in WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker()
3769         https://bugs.webkit.org/show_bug.cgi?id=189608
3770         <rdar://problem/44473299>
3771
3772         Reviewed by Simon Fraser.
3773
3774         When a frameset/iframe is hidden and we skip layout, clear the dirty flag on its subtree as well.
3775
3776         Covered by fast/frames/invalid-frameset.html.
3777
3778         * rendering/RenderFrameSet.cpp:
3779         (WebCore::clearSiblingSubtrees):
3780         (WebCore::RenderFrameSet::positionFrames):
3781         (WebCore::RenderFrameSet::positionFramesWithFlattening):
3782
3783 2019-01-04  Youenn Fablet  <youenn@apple.com>
3784
3785         [Fetch API] Implement abortable fetch
3786         https://bugs.webkit.org/show_bug.cgi?id=174980
3787         <rdar://problem/46861402>
3788
3789         Reviewed by Chris Dumez.
3790
3791         Add an AbortSignal to FetchRequest.
3792
3793         Add support for AbortSignal algorithm.
3794         The fetch request signal is added an algorithm to abort the fetch.
3795         Update clone algorithm to let signal of the cloned request be following the origin request.
3796
3797         Update ReadableStream error handling to return an exception instead of a string.
3798         This allows passing an AbortError instead of a TypeError as previously done.
3799
3800         Update FetchBodyOwner to store a loading error either as an exception or as a resource error.
3801         The latter is used for passing the error from service worker back to the page.
3802         The former is used to pass it to ReadableStream or body accessors.
3803
3804         Covered by enabled tests.
3805
3806         * Modules/cache/DOMCache.cpp:
3807         (WebCore::DOMCache::put):
3808         * Modules/fetch/FetchBody.cpp:
3809         (WebCore::FetchBody::consumeAsStream):
3810         (WebCore::FetchBody::loadingFailed):
3811         * Modules/fetch/FetchBody.h:
3812         * Modules/fetch/FetchBodyConsumer.cpp:
3813         (WebCore::FetchBodyConsumer::loadingFailed):
3814         * Modules/fetch/FetchBodyConsumer.h:
3815         * Modules/fetch/FetchBodyOwner.cpp:
3816         (WebCore::FetchBodyOwner::arrayBuffer):
3817         (WebCore::FetchBodyOwner::blob):
3818         (WebCore::FetchBodyOwner::cloneBody):
3819         (WebCore::FetchBodyOwner::formData):
3820         (WebCore::FetchBodyOwner::json):
3821         (WebCore::FetchBodyOwner::text):
3822         (WebCore::FetchBodyOwner::loadBlob):
3823         (WebCore::FetchBodyOwner::blobLoadingFailed):
3824         (WebCore::FetchBodyOwner::consumeBodyAsStream):
3825         (WebCore::FetchBodyOwner::setLoadingError):
3826         * Modules/fetch/FetchBodyOwner.h:
3827         (WebCore::FetchBodyOwner::loadingError const):
3828         (WebCore::FetchBodyOwner::loadingException const):
3829         * Modules/fetch/FetchBodySource.cpp:
3830         (WebCore::FetchBodySource::error):
3831         * Modules/fetch/FetchBodySource.h:
3832         * Modules/fetch/FetchRequest.cpp:
3833         (WebCore::FetchRequest::initializeWith):
3834         (WebCore::FetchRequest::clone):
3835         * Modules/fetch/FetchRequest.h:
3836         (WebCore::FetchRequest::FetchRequest):
3837         * Modules/fetch/FetchRequest.idl:
3838         * Modules/fetch/FetchRequestInit.h:
3839         (WebCore::FetchRequestInit::hasMembers const):
3840         * Modules/fetch/FetchRequestInit.idl:
3841         * Modules/fetch/FetchResponse.cpp:
3842         (WebCore::FetchResponse::clone):
3843         (WebCore::FetchResponse::fetch):
3844         (WebCore::FetchResponse::BodyLoader::didFail):
3845         * Modules/fetch/FetchResponse.h:
3846         * bindings/js/ReadableStreamDefaultController.h:
3847         (WebCore::ReadableStreamDefaultController::error):
3848         * dom/AbortSignal.cpp:
3849         (WebCore::AbortSignal::abort):
3850         (WebCore::AbortSignal::follow):
3851         * dom/AbortSignal.h:
3852
3853 2019-01-04  Brent Fulgham  <bfulgham@apple.com>
3854
3855         Parsed protocol of javascript URLs with embedded newlines and carriage returns do not match parsed protocol in Chrome and Firefox
3856         https://bugs.webkit.org/show_bug.cgi?id=193155
3857         <rdar://problem/40230982>
3858
3859         Reviewed by Chris Dumez.
3860
3861         Test: fast/loader/comment-only-javascript-url.html