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