Introduce IDL files for runtime-enabled UndoManager and UndoItem JavaScript API
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         Introduce IDL files for runtime-enabled UndoManager and UndoItem JavaScript API
4         https://bugs.webkit.org/show_bug.cgi?id=193109
5         <rdar://problem/44807048>
6
7         Reviewed by Ryosuke Niwa.
8
9         Adds new IDL files and stubs for UndoManager and UndoItem. This is an experimental DOM API that (in the near
10         future) is intended only for use in internal WebKit text editing clients. This API allows the page to
11         participate in the processes of undoing and redoing by defining custom undo and redo handlers, to be executed
12         when undo or redo is triggered.
13
14         Tests: editing/undo-manager/undo-manager-interfaces.html
15                editing/undo-manager/undo-manager-keeps-wrapper-alive.html
16
17         * CMakeLists.txt:
18         * DerivedSources-input.xcfilelist:
19         * DerivedSources-output.xcfilelist:
20         * DerivedSources.make:
21         * Sources.txt:
22         * UnifiedSources-input.xcfilelist:
23         * WebCore.xcodeproj/project.pbxproj:
24
25         Add new source files.
26
27         * bindings/js/WebCoreBuiltinNames.h:
28
29         Add "UndoManager" and "UndoItem" names.
30
31         * dom/Document.cpp:
32         (WebCore::m_undoManager):
33
34         Have the document own a UndoManager.
35
36         * dom/Document.h:
37         (WebCore::Document::undoManager const):
38         * dom/Document.idl:
39         * page/RuntimeEnabledFeatures.h:
40         (WebCore::RuntimeEnabledFeatures::setUndoManagerAPIEnabled):
41         (WebCore::RuntimeEnabledFeatures::undoManagerAPIEnabled const):
42
43         Guard the new bindings behind a runtime-enabled feature flag.
44
45         * page/UndoItem.h: Added.
46         (WebCore::UndoItem::create):
47         (WebCore::UndoItem::label const):
48         (WebCore::UndoItem::undoHandler const):
49         (WebCore::UndoItem::redoHandler const):
50         (WebCore::UndoItem::UndoItem):
51         * page/UndoItem.idl: Added.
52         * page/UndoManager.cpp: Added.
53         (WebCore::UndoManager::addItem):
54         * page/UndoManager.h: Added.
55         (WebCore::UndoManager::create):
56         (WebCore::UndoManager::document):
57         (WebCore::UndoManager::UndoManager):
58         * page/UndoManager.idl: Added.
59         * page/mac/WheelEventDeltaFilterMac.h:
60
61         Necessary (albeit unrelated) build fix to appease unified sources.
62
63 2019-01-11  Zalan Bujtas  <zalan@apple.com>
64
65         [LFC][BFC][MarginCollapsing] Adjust vertical position when box margin collapses through.
66         https://bugs.webkit.org/show_bug.cgi?id=193346
67
68         Reviewed by Antti Koivisto.
69
70         If the top and bottom margins of a box are adjoining, then it is possible for margins to collapse through it.
71         In this case, the position of the element depends on its relationship with the other elements whose margins are being collapsed.
72
73         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.
74         2. Otherwise, either the element's parent is not taking part in the margin collapsing, or only the parent's bottom margin is involved.
75            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.
76
77         Test: fast/block/block-only/collapsed-through-with-parent.html
78
79         * layout/MarginTypes.h:
80         (WebCore::Layout::EstimatedMarginBefore::usedValue const):
81         * layout/blockformatting/BlockFormattingContext.cpp:
82         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
83         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
84         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
85         * layout/blockformatting/BlockFormattingContext.h:
86         * layout/blockformatting/BlockMarginCollapse.cpp:
87         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
88         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeIgnoringCollapsingThrough):
89
90 2019-01-10  Myles C. Maxfield  <mmaxfield@apple.com>
91
92         [WHLSL] Include the standard library
93         https://bugs.webkit.org/show_bug.cgi?id=192994
94
95         Reviewed by Jon Lee.
96
97         A small section of the standard library is present in WHLSLStandardLibrary.txt. This gets turned into a header file containing
98         its raw data at build time by invoking our xxd.pl script (which WebCore already uses for other purposes). The standard
99         library is generated by running a JavaScript script, but currently there is no way to invoke JavaScript from our build
100         process, so this patch includes in the standard library's raw text instead. Once the parser is faster, we can include the
101         entire standard library.
102
103         No new tests because it isn't hooked up yet.
104
105         * DerivedSources.make:
106         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: Added.
107         * WebCore.xcodeproj/project.pbxproj:
108
109 2019-01-10  Jer Noble  <jer.noble@apple.com>
110
111         <video> elements do not enter 'paused' state when playing to end over AirPlay
112         https://bugs.webkit.org/show_bug.cgi?id=193295
113         <rdar://problem/46708670>
114
115         Reviewed by Eric Carlson.
116
117         Adopt the -[AVPlayer timeControlStatus] API, which reports whether the AVPlayer is paused, playing, or blocked waiting
118         for more data before playing. AirPlay devices report this state back from the remote device, and this allows the
119         MediaPlayerPrivateAVFoundationObjC to differentiate between user-generated pauses and simple stalling.
120
121         Adopting this API allows us to remove the heuristic from rateChanged() which inteprets a rate change when the
122         readyState > HAVE_ENOUGH as an intentional pause.
123
124         Drive-by fix: MediaPlayerPrivateAVFoundation had some code to delay calling platformPlay()
125         until the first frame became available. But this code was entirely undermined by the previous
126         behavior of setRate(). Fixing setRate()/setRateDouble() to only start playback if playback was
127         actually requested started making this code work for the first time, and broke some API tests.
128         Thus, we're removing this previously dead code.
129
130         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
131         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
132         (WebCore::MediaPlayerPrivateAVFoundation::play):
133         (WebCore::MediaPlayerPrivateAVFoundation::pause):
134         (WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
135         (WebCore::MediaPlayerPrivateAVFoundation::updateStates):
136         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
137         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
138         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
139         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
140         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
141         (WebCore::MediaPlayerPrivateAVFoundationObjC::didEnd):
142         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPlay):
143         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPause):
144         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
145         (WebCore::MediaPlayerPrivateAVFoundationObjC::setRateDouble):
146         (WebCore::MediaPlayerPrivateAVFoundationObjC::setPlayerRate):
147         (WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange):
148         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus):
149         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
150
151 2019-01-10  Myles C. Maxfield  <mmaxfield@apple.com>
152
153         Fix the build after r239844
154         https://bugs.webkit.org/show_bug.cgi?id=192991
155
156         Unreviewed.
157
158         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
159         (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableType const):
160         (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableForShaderItemDirection const):
161         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
162         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
163         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableForShaderItemDirection const):
164         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
165         (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableType const):
166         (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableForShaderItemDirection const):
167         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
168         (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableType const):
169         (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableForShaderItemDirection const):
170
171 2019-01-10  Justin Fan  <justin_fan@apple.com>
172
173         [WebGPU] WebGPUBindGroup and device::createBindGroup prototype
174         https://bugs.webkit.org/show_bug.cgi?id=193341
175
176         Reviewed by Myles C. Maxfield.
177
178         Add *GPUBindGroup class stubs and the ability to create WebGPUBindGroups via the API.
179
180         Test: bind-groups.html
181
182         * CMakeLists.txt:
183         * DerivedSources.make:
184         * Sources.txt:
185         * WebCore.xcodeproj/project.pbxproj:
186         * bindings/js/WebCoreBuiltinNames.h:
187
188         * Modules/webgpu/WebGPUBindGroup.cpp:
189         (WebCore::WebGPUBindGroup::create):
190         (WebCore::WebGPUBindGroup::WebGPUBindGroup):
191         * Modules/webgpu/WebGPUBindGroup.h:
192         * Modules/webgpu/WebGPUBindGroup.idl: Enable createBindGroup().
193         * Modules/webgpu/WebGPUDevice.cpp:
194         (WebCore::BindingResourceVisitor::operator() const): Added. Validate and convert WebGPUBindGroupDescriptor to GPU* version.
195         (WebCore::WebGPUDevice::createBindGroup const): Added.
196         * Modules/webgpu/WebGPUDevice.h:
197         * platform/graphics/gpu/GPUBindGroup.cpp:
198         (WebCore::GPUBindGroup::create):
199         (WebCore::GPUBindGroup::GPUBindGroup):
200         * platform/graphics/gpu/GPUBindGroup.h:
201         * platform/graphics/gpu/GPUBufferBinding.h:
202         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
203         (WebCore::appendArgumentToArray): Pass RetainPtr by reference to actually update descriptor.
204
205 2019-01-10  Simon Fraser  <simon.fraser@apple.com>
206
207         Fix rare crash under ScrollbarThemeMac::paintScrollCorner()
208         https://bugs.webkit.org/show_bug.cgi?id=193337
209         rdar://problem/47179993
210
211         Reviewed by Zalan Bujtas.
212         
213         Async image decoding can trigger a FrameView::traverseForPaintInvalidation() fake paint,
214         which creates a GraphicsContext with no platform context. However, we could hit ScrollView::paintScrollbars()
215         which tried to get at the platform context, and then crashed.
216         
217         So protect two functions in ScrollbarThemeMac with if (context.paintingDisabled()) checks. I verified
218         that other scrollbar-related painting code paths were already protected.
219
220         Hard to test because it depends on async image decoding timing.
221
222         * platform/mac/ScrollbarThemeMac.mm:
223         (WebCore::ScrollbarThemeMac::paint):
224         (WebCore::ScrollbarThemeMac::paintScrollCorner):
225
226 2019-01-10  Myles C. Maxfield  <mmaxfield@apple.com>
227
228         [WHLSL] Implement parser AST nodes
229         https://bugs.webkit.org/show_bug.cgi?id=192991
230
231         Reviewed by Alex Christensen.
232
233         This patch creates all the AST nodes which will be the result of running the parser.
234         This patch used to be a part of the "create a WHLSL parser" patch but I split them
235         out in order to aid reviewing.
236
237         The classes were mechanically created to match the result of the parser. There are
238         nodes for things like ForLoops, LogicalNotExpressions, DereferenceExpressions,
239         StructureDefinitions, and things like that. The classes don't actually have any logic
240         in them - they are currently just containers to hold the structure of the parsed
241         program. Some of these nodes (like constexprs) are just Variants of the various things
242         they can in the form of.
243
244         No new tests because the parser doesn't exist to create the new AST nodes yet.
245
246         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h: Added.
247         (WebCore::WHLSL::AST::ArrayReferenceType::ArrayReferenceType):
248         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h: Added.
249         (WebCore::WHLSL::AST::ArrayType::ArrayType):
250         (WebCore::WHLSL::AST::ArrayType::type const):
251         (WebCore::WHLSL::AST::ArrayType::type):
252         (WebCore::WHLSL::AST::ArrayType::numElements const):
253         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h: Added.
254         (WebCore::WHLSL::AST::AssignmentExpression::AssignmentExpression):
255         (WebCore::WHLSL::AST::AssignmentExpression::left):
256         (WebCore::WHLSL::AST::AssignmentExpression::right):
257         * Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h: Added.
258         (WebCore::WHLSL::AST::BaseFunctionAttribute::BaseFunctionAttribute):
259         * Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h: Added.
260         (WebCore::WHLSL::AST::BaseSemantic::BaseSemantic):
261         * Modules/webgpu/WHLSL/AST/WHLSLBlock.h: Added.
262         (WebCore::WHLSL::AST::Block::Block):
263         (WebCore::WHLSL::AST::Block::statements):
264         * Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h: Added.
265         (WebCore::WHLSL::AST::BooleanLiteral::BooleanLiteral):
266         (WebCore::WHLSL::AST::BooleanLiteral::value const):
267         (WebCore::WHLSL::AST::BooleanLiteral::clone const):
268         * Modules/webgpu/WHLSL/AST/WHLSLBreak.h: Added.
269         (WebCore::WHLSL::AST::Break::Break):
270         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp: Added.
271         (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableType const):
272         (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableForShaderItemDirection const):
273         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h: Added.
274         (WebCore::WHLSL::AST::BuiltInSemantic::BuiltInSemantic):
275         (WebCore::WHLSL::AST::BuiltInSemantic::variable const):
276         (WebCore::WHLSL::AST::BuiltInSemantic::operator== const):
277         (WebCore::WHLSL::AST::BuiltInSemantic::operator!= const):
278         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h: Added.
279         (WebCore::WHLSL::AST::CallExpression::CallExpression):
280         (WebCore::WHLSL::AST::CallExpression::arguments):
281         (WebCore::WHLSL::AST::CallExpression::name):
282         (WebCore::WHLSL::AST::CallExpression::setCastData):
283         (WebCore::WHLSL::AST::CallExpression::isCast):
284         (WebCore::WHLSL::AST::CallExpression::castReturnType):
285         (WebCore::WHLSL::AST::CallExpression::hasOverloads const):
286         (WebCore::WHLSL::AST::CallExpression::overloads):
287         (WebCore::WHLSL::AST::CallExpression::setOverloads):
288         (WebCore::WHLSL::AST::CallExpression::setFunction):
289         * Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h: Added.
290         (WebCore::WHLSL::AST::CommaExpression::CommaExpression):
291         (WebCore::WHLSL::AST::CommaExpression::list):
292         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h: Added.
293         (WebCore::WHLSL::AST::ConstantExpression::ConstantExpression):
294         (WebCore::WHLSL::AST::ConstantExpression::integerLiteral):
295         (WebCore::WHLSL::AST::ConstantExpression::visit):
296         (WebCore::WHLSL::AST::ConstantExpression::visit const):
297         (WebCore::WHLSL::AST::ConstantExpression::clone const):
298         (WebCore::WHLSL::AST::ConstantExpression::matches const):
299         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpressionEnumerationMemberReference.h: Added.
300         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::ConstantExpressionEnumerationMemberReference):
301         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::left const):
302         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::right const):
303         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::clone const):
304         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::enumerationDefinition):
305         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::enumerationDefinition const):
306         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::enumerationMember):
307         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::enumerationMember const):
308         (WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::setEnumerationMember):
309         * Modules/webgpu/WHLSL/AST/WHLSLContinue.h: Added.
310         (WebCore::WHLSL::AST::Continue::Continue):
311         * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h: Added.
312         (WebCore::WHLSL::AST::DereferenceExpression::DereferenceExpression):
313         (WebCore::WHLSL::AST::DereferenceExpression::pointer):
314         * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h: Added.
315         (WebCore::WHLSL::AST::DoWhileLoop::DoWhileLoop):
316         (WebCore::WHLSL::AST::DoWhileLoop::body):
317         (WebCore::WHLSL::AST::DoWhileLoop::conditional):
318         * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h: Added.
319         (WebCore::WHLSL::AST::DotExpression::DotExpression):
320         (WebCore::WHLSL::AST::DotExpression::fieldName):
321         * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h: Added.
322         (WebCore::WHLSL::AST::EffectfulExpressionStatement::EffectfulExpressionStatement):
323         (WebCore::WHLSL::AST::EffectfulExpressionStatement::effectfulExpression):
324         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h: Added.
325         (WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition):
326         (WebCore::WHLSL::AST::EnumerationDefinition::type):
327         (WebCore::WHLSL::AST::EnumerationDefinition::add):
328         (WebCore::WHLSL::AST::EnumerationDefinition::memberByName):
329         (WebCore::WHLSL::AST::EnumerationDefinition::enumerationMembers):
330         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h: Added.
331         (WebCore::WHLSL::AST::EnumerationMember::EnumerationMember):
332         (WebCore::WHLSL::AST::EnumerationMember::origin const):
333         (WebCore::WHLSL::AST::EnumerationMember::name):
334         (WebCore::WHLSL::AST::EnumerationMember::value):
335         (WebCore::WHLSL::AST::EnumerationMember::setValue):
336         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h: Added.
337         (WebCore::WHLSL::AST::EnumerationMemberLiteral::EnumerationMemberLiteral):
338         (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember):
339         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h: Added.
340         (WebCore::WHLSL::AST::Expression::Expression):
341         (WebCore::WHLSL::AST::Expression::origin const):
342         (WebCore::WHLSL::AST::Expression::isAssignmentExpression const):
343         (WebCore::WHLSL::AST::Expression::isBooleanLiteral const):
344         (WebCore::WHLSL::AST::Expression::isCallExpression const):
345         (WebCore::WHLSL::AST::Expression::isCommaExpression const):
346         (WebCore::WHLSL::AST::Expression::isDereferenceExpression const):
347         (WebCore::WHLSL::AST::Expression::isDotExpression const):
348         (WebCore::WHLSL::AST::Expression::isFloatLiteral const):
349         (WebCore::WHLSL::AST::Expression::isIndexExpression const):
350         (WebCore::WHLSL::AST::Expression::isIntegerLiteral const):
351         (WebCore::WHLSL::AST::Expression::isLogicalExpression const):
352         (WebCore::WHLSL::AST::Expression::isLogicalNotExpression const):
353         (WebCore::WHLSL::AST::Expression::isMakeArrayReferenceExpression const):
354         (WebCore::WHLSL::AST::Expression::isMakePointerExpression const):
355         (WebCore::WHLSL::AST::Expression::isNullLiteral const):
356         (WebCore::WHLSL::AST::Expression::isPropertyAccessExpression const):
357         (WebCore::WHLSL::AST::Expression::isReadModifyWriteExpression const):
358         (WebCore::WHLSL::AST::Expression::isTernaryExpression const):
359         (WebCore::WHLSL::AST::Expression::isUnsignedIntegerLiteral const):
360         (WebCore::WHLSL::AST::Expression::isVariableReference const):
361         (WebCore::WHLSL::AST::Expression::isEnumerationMemberLiteral const):
362         * Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h: Added.
363         (WebCore::WHLSL::AST::Fallthrough::Fallthrough):
364         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h: Added.
365         (WebCore::WHLSL::AST::FloatLiteral::FloatLiteral):
366         (WebCore::WHLSL::AST::FloatLiteral::type):
367         (WebCore::WHLSL::AST::FloatLiteral::value const):
368         (WebCore::WHLSL::AST::FloatLiteral::clone const):
369         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp: Added.
370         (WebCore::WHLSL::AST::FloatLiteralType::FloatLiteralType):
371         (WebCore::WHLSL::AST::FloatLiteralType::canResolve const):
372         (WebCore::WHLSL::AST::FloatLiteralType::conversionCost const):
373         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h: Added.
374         (WebCore::WHLSL::AST::FloatLiteralType::preferredType):
375         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h: Added.
376         (WebCore::WHLSL::AST::ForLoop::ForLoop):
377         (WebCore::WHLSL::AST::ForLoop::~ForLoop):
378         (WebCore::WHLSL::AST::ForLoop::initialization):
379         (WebCore::WHLSL::AST::ForLoop::condition):
380         (WebCore::WHLSL::AST::ForLoop::increment):
381         (WebCore::WHLSL::AST::ForLoop::body):
382         * Modules/webgpu/WHLSL/AST/WHLSLFunctionAttribute.h: Added.
383         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h: Added.
384         (WebCore::WHLSL::AST::FunctionDeclaration::FunctionDeclaration):
385         (WebCore::WHLSL::AST::FunctionDeclaration::isFunctionDefinition const):
386         (WebCore::WHLSL::AST::FunctionDeclaration::isNativeFunctionDeclaration const):
387         (WebCore::WHLSL::AST::FunctionDeclaration::attributeBlock):
388         (WebCore::WHLSL::AST::FunctionDeclaration::entryPointType const):
389         (WebCore::WHLSL::AST::FunctionDeclaration::type const):
390         (WebCore::WHLSL::AST::FunctionDeclaration::type):
391         (WebCore::WHLSL::AST::FunctionDeclaration::name const):
392         (WebCore::WHLSL::AST::FunctionDeclaration::isCast const):
393         (WebCore::WHLSL::AST::FunctionDeclaration::parameters const):
394         (WebCore::WHLSL::AST::FunctionDeclaration::parameters):
395         (WebCore::WHLSL::AST::FunctionDeclaration::semantic):
396         (WebCore::WHLSL::AST::FunctionDeclaration::isOperator const):
397         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h: Added.
398         (WebCore::WHLSL::AST::FunctionDefinition::FunctionDefinition):
399         (WebCore::WHLSL::AST::FunctionDefinition::block):
400         (WebCore::WHLSL::AST::FunctionDefinition::restricted const):
401         * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h: Added.
402         (WebCore::WHLSL::AST::IfStatement::IfStatement):
403         (WebCore::WHLSL::AST::IfStatement::conditional):
404         (WebCore::WHLSL::AST::IfStatement::body):
405         (WebCore::WHLSL::AST::IfStatement::elseBody):
406         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h: Added.
407         (WebCore::WHLSL::AST::IndexExpression::IndexExpression):
408         (WebCore::WHLSL::AST::IndexExpression::indexExpression):
409         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.cpp: Added.
410         (WebCore::WHLSL::AST::IntegerLiteral::valueForSelectedType const):
411         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h: Added.
412         (WebCore::WHLSL::AST::IntegerLiteral::IntegerLiteral):
413         (WebCore::WHLSL::AST::IntegerLiteral::type):
414         (WebCore::WHLSL::AST::IntegerLiteral::value const):
415         (WebCore::WHLSL::AST::IntegerLiteral::clone const):
416         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp: Added.
417         (WebCore::WHLSL::AST::IntegerLiteralType::IntegerLiteralType):
418         (WebCore::WHLSL::AST::IntegerLiteralType::canResolve const):
419         (WebCore::WHLSL::AST::IntegerLiteralType::conversionCost const):
420         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h: Added.
421         (WebCore::WHLSL::AST::IntegerLiteralType::preferredType):
422         * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h: Added.
423         (WebCore::WHLSL::AST::LogicalExpression::LogicalExpression):
424         (WebCore::WHLSL::AST::LogicalExpression::type const):
425         (WebCore::WHLSL::AST::LogicalExpression::left):
426         (WebCore::WHLSL::AST::LogicalExpression::right):
427         * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h: Added.
428         (WebCore::WHLSL::AST::LogicalNotExpression::LogicalNotExpression):
429         (WebCore::WHLSL::AST::LogicalNotExpression::operand):
430         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h: Added.
431         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::MakeArrayReferenceExpression):
432         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::lValue):
433         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h: Added.
434         (WebCore::WHLSL::AST::MakePointerExpression::MakePointerExpression):
435         (WebCore::WHLSL::AST::MakePointerExpression::lValue):
436         * Modules/webgpu/WHLSL/AST/WHLSLNamedType.h: Added.
437         (WebCore::WHLSL::AST::NamedType::NamedType):
438         (WebCore::WHLSL::AST::NamedType::origin const):
439         (WebCore::WHLSL::AST::NamedType::name):
440         (WebCore::WHLSL::AST::NamedType::isTypeDefinition const):
441         (WebCore::WHLSL::AST::NamedType::isStructureDefinition const):
442         (WebCore::WHLSL::AST::NamedType::isEnumerationDefinition const):
443         (WebCore::WHLSL::AST::NamedType::isNativeTypeDeclaration const):
444         (WebCore::WHLSL::AST::NamedType::unifyNode const):
445         (WebCore::WHLSL::AST::NamedType::unifyNode):
446         * Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h: Added.
447         (WebCore::WHLSL::AST::NativeFunctionDeclaration::NativeFunctionDeclaration):
448         (WebCore::WHLSL::AST::NativeFunctionDeclaration::restricted const):
449         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h: Added.
450         (WebCore::WHLSL::AST::NativeTypeDeclaration::NativeTypeDeclaration):
451         (WebCore::WHLSL::AST::NativeTypeDeclaration::name const):
452         (WebCore::WHLSL::AST::NativeTypeDeclaration::name):
453         (WebCore::WHLSL::AST::NativeTypeDeclaration::typeArguments):
454         (WebCore::WHLSL::AST::NativeTypeDeclaration::isInt const):
455         (WebCore::WHLSL::AST::NativeTypeDeclaration::isNumber const):
456         (WebCore::WHLSL::AST::NativeTypeDeclaration::isFloating const):
457         (WebCore::WHLSL::AST::NativeTypeDeclaration::isVector const):
458         (WebCore::WHLSL::AST::NativeTypeDeclaration::isMatrix const):
459         (WebCore::WHLSL::AST::NativeTypeDeclaration::isTexture const):
460         (WebCore::WHLSL::AST::NativeTypeDeclaration::isSigned const):
461         (WebCore::WHLSL::AST::NativeTypeDeclaration::std::function<bool const):
462         (WebCore::WHLSL::AST::NativeTypeDeclaration::std::function<int64_t const):
463         (WebCore::WHLSL::AST::NativeTypeDeclaration::iterateAllValues):
464         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsInt):
465         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsNumber):
466         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsFloating):
467         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsVector):
468         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsMatrix):
469         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsTexture):
470         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsSigned):
471         (WebCore::WHLSL::AST::NativeTypeDeclaration::setCanRepresentInteger):
472         (WebCore::WHLSL::AST::NativeTypeDeclaration::setCanRepresentUnsignedInteger):
473         (WebCore::WHLSL::AST::NativeTypeDeclaration::setCanRepresentFloat):
474         (WebCore::WHLSL::AST::NativeTypeDeclaration::setSuccessor):
475         (WebCore::WHLSL::AST::NativeTypeDeclaration::setFormatValueFromInteger):
476         (WebCore::WHLSL::AST::NativeTypeDeclaration::setFormatValueFromUnsignedInteger):
477         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIterateAllValues):
478         * Modules/webgpu/WHLSL/AST/WHLSLNode.h: Added.
479         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h: Added.
480         (WebCore::WHLSL::AST::NullLiteral::NullLiteral):
481         (WebCore::WHLSL::AST::NullLiteral::type):
482         (WebCore::WHLSL::AST::NullLiteral::clone const):
483         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.cpp: Added.
484         (WebCore::WHLSL::AST::NullLiteralType::canResolve const):
485         (WebCore::WHLSL::AST::NullLiteralType::conversionCost const):
486         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.h: Added.
487         * Modules/webgpu/WHLSL/AST/WHLSLNumThreadsFunctionAttribute.h: Added.
488         (WebCore::WHLSL::AST::NumThreadsFunctionAttribute::NumThreadsFunctionAttribute):
489         (WebCore::WHLSL::AST::NumThreadsFunctionAttribute::width const):
490         (WebCore::WHLSL::AST::NumThreadsFunctionAttribute::height const):
491         (WebCore::WHLSL::AST::NumThreadsFunctionAttribute::depth const):
492         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h: Added.
493         (WebCore::WHLSL::AST::PointerType::PointerType):
494         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h: Added.
495         (WebCore::WHLSL::AST::PropertyAccessExpression::PropertyAccessExpression):
496         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleGetOverloads):
497         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleSetOverloads):
498         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleAndOverloads):
499         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleGetOverloads):
500         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleSetOverloads):
501         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleAndOverloads):
502         (WebCore::WHLSL::AST::PropertyAccessExpression::base):
503         * Modules/webgpu/WHLSL/AST/WHLSLQualifier.h: Added.
504         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h: Added.
505         (WebCore::WHLSL::AST::ReadModifyWriteExpression::create):
506         (WebCore::WHLSL::AST::ReadModifyWriteExpression::setNewValueExpression):
507         (WebCore::WHLSL::AST::ReadModifyWriteExpression::setResultExpression):
508         (WebCore::WHLSL::AST::ReadModifyWriteExpression::oldVariableReference):
509         (WebCore::WHLSL::AST::ReadModifyWriteExpression::newVariableReference):
510         (WebCore::WHLSL::AST::ReadModifyWriteExpression::lValue):
511         (WebCore::WHLSL::AST::ReadModifyWriteExpression::oldValue):
512         (WebCore::WHLSL::AST::ReadModifyWriteExpression::newValue):
513         (WebCore::WHLSL::AST::ReadModifyWriteExpression::newValueExpression):
514         (WebCore::WHLSL::AST::ReadModifyWriteExpression::resultExpression):
515         (WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression):
516         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h: Added.
517         (WebCore::WHLSL::AST::ReferenceType::ReferenceType):
518         (WebCore::WHLSL::AST::ReferenceType::addressSpace const):
519         (WebCore::WHLSL::AST::ReferenceType::elementType const):
520         (WebCore::WHLSL::AST::ReferenceType::elementType):
521         * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h: Added.
522         (WebCore::WHLSL::AST::ResolvableType::isFloatLiteralType const):
523         (WebCore::WHLSL::AST::ResolvableType::isIntegerLiteralType const):
524         (WebCore::WHLSL::AST::ResolvableType::isNullLiteralType const):
525         (WebCore::WHLSL::AST::ResolvableType::isUnsignedIntegerLiteralType const):
526         (WebCore::WHLSL::AST::ResolvableType::resolvedType const):
527         (WebCore::WHLSL::AST::ResolvableType::resolvedType):
528         (WebCore::WHLSL::AST::ResolvableType::resolve):
529         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp: Added.
530         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
531         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableForShaderItemDirection const):
532         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h: Added.
533         (WebCore::WHLSL::AST::ResourceSemantic::ResourceSemantic):
534         (WebCore::WHLSL::AST::ResourceSemantic::mode const):
535         (WebCore::WHLSL::AST::ResourceSemantic::index const):
536         (WebCore::WHLSL::AST::ResourceSemantic::space const):
537         (WebCore::WHLSL::AST::ResourceSemantic::operator== const):
538         (WebCore::WHLSL::AST::ResourceSemantic::operator!= const):
539         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h: Added.
540         (WebCore::WHLSL::AST::Return::Return):
541         (WebCore::WHLSL::AST::Return::value):
542         (WebCore::WHLSL::AST::Return::function):
543         (WebCore::WHLSL::AST::Return::setFunction):
544         * Modules/webgpu/WHLSL/AST/WHLSLSemantic.h: Added.
545         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp: Added.
546         (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableType const):
547         (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableForShaderItemDirection const):
548         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h: Added.
549         (WebCore::WHLSL::AST::SpecializationConstantSemantic::SpecializationConstantSemantic):
550         (WebCore::WHLSL::AST::SpecializationConstantSemantic::operator== const):
551         (WebCore::WHLSL::AST::SpecializationConstantSemantic::operator!= const):
552         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp: Added.
553         (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableType const):
554         (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableForShaderItemDirection const):
555         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h: Added.
556         (WebCore::WHLSL::AST::StageInOutSemantic::StageInOutSemantic):
557         (WebCore::WHLSL::AST::StageInOutSemantic::index const):
558         (WebCore::WHLSL::AST::StageInOutSemantic::operator== const):
559         (WebCore::WHLSL::AST::StageInOutSemantic::operator!= const):
560         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h: Added.
561         (WebCore::WHLSL::AST::Statement::Statement):
562         (WebCore::WHLSL::AST::Statement::isBlock const):
563         (WebCore::WHLSL::AST::Statement::isBreak const):
564         (WebCore::WHLSL::AST::Statement::isContinue const):
565         (WebCore::WHLSL::AST::Statement::isDoWhileLoop const):
566         (WebCore::WHLSL::AST::Statement::isEffectfulExpressionStatement const):
567         (WebCore::WHLSL::AST::Statement::isFallthrough const):
568         (WebCore::WHLSL::AST::Statement::isForLoop const):
569         (WebCore::WHLSL::AST::Statement::isIfStatement const):
570         (WebCore::WHLSL::AST::Statement::isReturn const):
571         (WebCore::WHLSL::AST::Statement::isSwitchCase const):
572         (WebCore::WHLSL::AST::Statement::isSwitchStatement const):
573         (WebCore::WHLSL::AST::Statement::isTrap const):
574         (WebCore::WHLSL::AST::Statement::isVariableDeclarationsStatement const):
575         (WebCore::WHLSL::AST::Statement::isWhileLoop const):
576         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h: Added.
577         (WebCore::WHLSL::AST::StructureDefinition::StructureDefinition):
578         (WebCore::WHLSL::AST::StructureDefinition::structureElements):
579         * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h: Added.
580         (WebCore::WHLSL::AST::StructureElement::StructureElement):
581         (WebCore::WHLSL::AST::StructureElement::origin const):
582         (WebCore::WHLSL::AST::StructureElement::type):
583         (WebCore::WHLSL::AST::StructureElement::name):
584         (WebCore::WHLSL::AST::StructureElement::semantic):
585         * Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h: Added.
586         (WebCore::WHLSL::AST::SwitchCase::SwitchCase):
587         (WebCore::WHLSL::AST::SwitchCase::value):
588         (WebCore::WHLSL::AST::SwitchCase::block):
589         * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h: Added.
590         (WebCore::WHLSL::AST::SwitchStatement::SwitchStatement):
591         (WebCore::WHLSL::AST::SwitchStatement::value):
592         (WebCore::WHLSL::AST::SwitchStatement::switchCases):
593         * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h: Added.
594         (WebCore::WHLSL::AST::TernaryExpression::TernaryExpression):
595         (WebCore::WHLSL::AST::TernaryExpression::predicate):
596         (WebCore::WHLSL::AST::TernaryExpression::bodyExpression):
597         (WebCore::WHLSL::AST::TernaryExpression::elseExpression):
598         * Modules/webgpu/WHLSL/AST/WHLSLTrap.h: Added.
599         (WebCore::WHLSL::AST::Trap::Trap):
600         * Modules/webgpu/WHLSL/AST/WHLSLType.h: Added.
601         (WebCore::WHLSL::AST::Type::isNamedType const):
602         (WebCore::WHLSL::AST::Type::isUnnamedType const):
603         (WebCore::WHLSL::AST::Type::isResolvableType const):
604         * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.cpp: Added.
605         (WebCore::WHLSL::AST::clone):
606         * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.h: Added.
607         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h: Added.
608         (WebCore::WHLSL::AST::TypeDefinition::TypeDefinition):
609         (WebCore::WHLSL::AST::TypeDefinition::type):
610         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.cpp: Added.
611         (WebCore::WHLSL::AST::TypeReference::wrap):
612         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h: Added.
613         (WebCore::WHLSL::AST::TypeReference::TypeReference):
614         (WebCore::WHLSL::AST::TypeReference::name):
615         (WebCore::WHLSL::AST::TypeReference::typeArguments):
616         (WebCore::WHLSL::AST::TypeReference::resolvedType const):
617         (WebCore::WHLSL::AST::TypeReference::setResolvedType):
618         (WebCore::WHLSL::AST::TypeReference::cloneTypeReference const):
619         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h: Added.
620         (WebCore::WHLSL::AST::UnnamedType::UnnamedType):
621         (WebCore::WHLSL::AST::UnnamedType::isTypeReference const):
622         (WebCore::WHLSL::AST::UnnamedType::isPointerType const):
623         (WebCore::WHLSL::AST::UnnamedType::isArrayReferenceType const):
624         (WebCore::WHLSL::AST::UnnamedType::isArrayType const):
625         (WebCore::WHLSL::AST::UnnamedType::isReferenceType const):
626         (WebCore::WHLSL::AST::UnnamedType::unifyNode const):
627         (WebCore::WHLSL::AST::UnnamedType::unifyNode):
628         (WebCore::WHLSL::AST::UnnamedType::origin const):
629         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.cpp: Added.
630         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::valueForSelectedType const):
631         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h: Added.
632         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::UnsignedIntegerLiteral):
633         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::type):
634         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::value const):
635         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::clone const):
636         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp: Added.
637         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::UnsignedIntegerLiteralType):
638         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::canResolve const):
639         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::conversionCost const):
640         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h: Added.
641         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::preferredType):
642         * Modules/webgpu/WHLSL/AST/WHLSLValue.h: Added.
643         (WebCore::WHLSL::AST::Value::Value):
644         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h: Added.
645         (WebCore::WHLSL::AST::VariableDeclaration::VariableDeclaration):
646         (WebCore::WHLSL::AST::VariableDeclaration::origin const):
647         (WebCore::WHLSL::AST::VariableDeclaration::name):
648         (WebCore::WHLSL::AST::VariableDeclaration::type const):
649         (WebCore::WHLSL::AST::VariableDeclaration::type):
650         (WebCore::WHLSL::AST::VariableDeclaration::semantic):
651         (WebCore::WHLSL::AST::VariableDeclaration::initializer):
652         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h: Added.
653         (WebCore::WHLSL::AST::VariableDeclarationsStatement::VariableDeclarationsStatement):
654         (WebCore::WHLSL::AST::VariableDeclarationsStatement::variableDeclarations):
655         * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h: Added.
656         (WebCore::WHLSL::AST::VariableReference::VariableReference):
657         (WebCore::WHLSL::AST::VariableReference::wrap):
658         (WebCore::WHLSL::AST::VariableReference::name):
659         (WebCore::WHLSL::AST::VariableReference::variable):
660         (WebCore::WHLSL::AST::VariableReference::setVariable):
661         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h: Added.
662         (WebCore::WHLSL::AST::WhileLoop::WhileLoop):
663         (WebCore::WHLSL::AST::WhileLoop::conditional):
664         (WebCore::WHLSL::AST::WhileLoop::body):
665         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
666         * Modules/webgpu/WHLSL/WHLSLParser.cpp: Added.
667         * Modules/webgpu/WHLSL/WHLSLParser.h: Added.
668         * Modules/webgpu/WHLSL/WHLSLProgram.h: Added.
669         (WebCore::WHLSL::Program::append):
670         (WebCore::WHLSL::Program::nameContext):
671         (WebCore::WHLSL::Program::intrinsics):
672         (WebCore::WHLSL::Program::typeDefinitions):
673         (WebCore::WHLSL::Program::structureDefinitions):
674         (WebCore::WHLSL::Program::enumerationDefinitions):
675         (WebCore::WHLSL::Program::functionDefinitions const):
676         (WebCore::WHLSL::Program::functionDefinitions):
677         (WebCore::WHLSL::Program::nativeFunctionDeclarations const):
678         (WebCore::WHLSL::Program::nativeFunctionDeclarations):
679         (WebCore::WHLSL::Program::nativeTypeDeclarations):
680
681 2019-01-10  Wenson Hsieh  <wenson_hsieh@apple.com>
682
683         Bindings generator emits incorrect code when using VoidCallback as an IDL dictionary attribute
684         https://bugs.webkit.org/show_bug.cgi?id=193328
685
686         Reviewed by Chris Dumez.
687
688         Currently, when generating the function body of `convertDictionary`, our bindings generator does not pass in an
689         argument to use as the `$globalObjectReference` in `JSValueToNative`, when generating code to convert a wrapped
690         attribute value to the native value. As a result, if the generated IDL type returns `true` from
691         `JSValueToNativeDOMConvertNeedsGlobalObject` (i.e. for callback function types), we will end up using the empty
692         string as the generated expression for the global object. This emits syntactically incorrect code:
693
694             `convert<IDLCallbackFunction<JSVoidCallback>>(state, someValue, );`
695
696         To fix this, we pass in a string to use as the global object, which uses the given ExecState to grab the global
697         object. Tested by augmenting TestStandaloneDictionary.idl and its generated expectation.
698
699         * bindings/scripts/CodeGeneratorJS.pm:
700         (GenerateDictionaryImplementationContent):
701         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
702         (WebCore::convertDictionary<DictionaryImplName>):
703         * bindings/scripts/test/TestStandaloneDictionary.idl:
704
705 2019-01-10  Eric Carlson  <eric.carlson@apple.com>
706
707         Define page media state flags for display capture.
708         https://bugs.webkit.org/show_bug.cgi?id=193230
709         <rdar://problem/47095142>
710
711         Reviewed by Youenn Fablet.
712
713         Test: fast/mediastream/get-display-media-muted.html
714
715         * Modules/mediastream/MediaStreamTrack.cpp:
716         (WebCore::MediaStreamTrack::mediaState const):
717         * page/MediaProducer.h:
718         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
719         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
720         * platform/mediastream/RealtimeMediaSource.h:
721         * platform/mediastream/mac/AVVideoCaptureSource.h:
722         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
723         * platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
724         * platform/mock/MockRealtimeAudioSource.h:
725         * platform/mock/MockRealtimeVideoSource.h:
726         * testing/Internals.cpp:
727         (WebCore::Internals::pageMediaState):
728
729 2019-01-10  Justin Fan  <justin_fan@apple.com>
730
731         [WebGPU] Add BindGroupBinding, BindGroupDescriptor, and BufferBinding dictionaries from API
732         https://bugs.webkit.org/show_bug.cgi?id=193298
733
734         Reviewed by Dean Jackson.
735
736         No new tests. No change in behavior.
737
738         * CMakeLists.txt:
739         * DerivedSources.make:
740         * Modules/webgpu/WebGPUBindGroupBinding.h: Added.
741         * Modules/webgpu/WebGPUBindGroupBinding.idl: Added.
742         * Modules/webgpu/WebGPUBindGroupDescriptor.h: Added.
743         * Modules/webgpu/WebGPUBindGroupDescriptor.idl: Added.
744         * Modules/webgpu/WebGPUBufferBinding.h: Added.
745         * Modules/webgpu/WebGPUBufferBinding.idl: Added.
746         * Sources.txt:
747         * WebCore.xcodeproj/project.pbxproj:
748         * platform/graphics/gpu/GPUBindGroupBinding.h: Added.
749         * platform/graphics/gpu/GPUBindGroupDescriptor.h: Added.
750         * platform/graphics/gpu/GPUBufferBinding.h: Added.
751
752 2019-01-09  Justin Fan  <justin_fan@apple.com>
753
754         [WebGPU] Fix vertex-buffer-triangle-strip test and small update to GPURenderPipeline
755         https://bugs.webkit.org/show_bug.cgi?id=193289
756
757         Reviewed by Dean Jackson.
758
759         Fix broken test after pipeline layouts were added, and a small refactoring to GPURenderPipeline to avoid
760         retaining its descriptor after creation.
761
762         * platform/graphics/gpu/GPURenderPipeline.h:
763         (WebCore::GPURenderPipeline::primitiveTopology const):
764         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
765         (WebCore::GPURenderPipeline::GPURenderPipeline):
766
767 2019-01-09  Dean Jackson  <dino@apple.com>
768
769         Safari Crashing in Version 12.0.1 (14606.2.104.1.1) WebCore::GraphicsLayerCA::updateBackdropFilters
770         https://bugs.webkit.org/show_bug.cgi?id=193309
771         <rdar://problem/45279224>
772
773         Reviewed by Antoine Quint.
774
775         A speculative fix for a CheckedArithmetic crash triggered in updateBackdropFilters.
776
777         The crash log indicates we crash in a Checked<> class that is not recording
778         overflow i.e. it is crashing due to an overflow. The only place in this function
779         where that could happen is when we convert the FloatRect for the backdrop
780         region into a Checked<unsigned> for width and height. This suggests that either
781         the width or height are negative, or the float values are too large for integers,
782         or the product of the two overflows.
783
784         Avoid this by using RecordOverflow, but also changing the code a little to
785         bail if the rectangle is incorrect.
786
787         * platform/graphics/ca/GraphicsLayerCA.cpp:
788         (WebCore::GraphicsLayerCA::updateBackdropFilters):
789
790 2019-01-10  Oriol Brufau  <obrufau@igalia.com>
791
792         [css-grid] Let abspos items reference implicit grid lines
793         https://bugs.webkit.org/show_bug.cgi?id=193313
794
795         Reviewed by Manuel Rego Casasnovas.
796
797         While they can't create new implicit grid lines, abspos items
798         can reference existing ones as clarified in
799         https://github.com/w3c/csswg-drafts/commit/511bb63
800
801         This patch makes WebKit match Blink, Firefox and Edge.
802
803         Tests: web-platform-tests/css/css-grid/abspos/grid-positioned-items-padding-001.html
804                web-platform-tests/css/css-grid/abspos/grid-positioned-items-unknown-named-grid-line-001.html
805
806         * rendering/RenderGrid.cpp:
807         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator const):
808         Remove argument from spanSizeForAutoPlacedItem call.
809         (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid const):
810         Remove argument from spanSizeForAutoPlacedItem call.
811         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid const):
812         Remove argument from spanSizeForAutoPlacedItem call.
813         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid const):
814         Remove argument from spanSizeForAutoPlacedItem call.
815         (WebCore::RenderGrid::gridAreaBreadthForOutOfFlowChild):
816         Don't treat implicit grid lines as 'auto'.
817         * rendering/RenderGrid.h:
818         Remove unused gridPositionIsAutoForOutOfFlow.
819         * rendering/style/GridPositionsResolver.cpp:
820         (WebCore::adjustGridPositionsFromStyle):
821         Don't treat implicit grid lines as 'auto'.
822         Remove unused gridContainerStyle parameter.
823         (WebCore::GridPositionsResolver::spanSizeForAutoPlacedItem):
824         Remove argument from adjustGridPositionsFromStyle call.
825         Remove unused gridContainerStyle parameter.
826         (WebCore::resolveGridPositionFromStyle):
827         Remove unnecessary assert that uses isValidNamedLineOrArea.
828         (WebCore::GridPositionsResolver::resolveGridPositionsFromStyle):
829         Remove argument from adjustGridPositionsFromStyle call.
830         * rendering/style/GridPositionsResolver.h:
831         Remove unused isValidNamedLineOrArea.
832         Remove unused parameter from spanSizeForAutoPlacedItem.
833
834 2019-01-09  Matt Rajca  <mrajca@apple.com>
835
836         Put per-document autoplay behavior behind runtime website policies quirk instead of a compile time flag
837         https://bugs.webkit.org/show_bug.cgi?id=193301
838
839         Reviewed by Jer Noble.
840
841         Instead of unconditionally enabling this with a compile-time flag, let clients
842         enable the quirk on a per-load basis.
843
844         Tests: added API tests in favor of the current layout test as this behavior is no
845                longer on by default unless a client opts in.
846
847         * html/MediaElementSession.cpp:
848         (WebCore::needsPerDocumentAutoplayBehaviorQuirk):
849         (WebCore::MediaElementSession::playbackPermitted const):
850         * loader/DocumentLoader.h:
851
852 2019-01-10  Zalan Bujtas  <zalan@apple.com>
853
854         [LFC][BFC][MarginCollapsing] Take collapsed through siblings into account when computing vertical position
855         https://bugs.webkit.org/show_bug.cgi?id=193310
856
857         Reviewed by Antti Koivisto.
858
859         If the block inflow element has previous siblings with collapsed through vertical margins,
860         then this box's before margin could _indirectly_ collapse with the parent. Use the previous siblings
861         to check for margin collapsing.
862
863         Test: fast/block/block-only/collapsed-through-siblings.html
864
865         * layout/blockformatting/BlockFormattingContext.cpp:
866         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
867         * page/FrameViewLayoutContext.cpp:
868         (WebCore::layoutUsingFormattingContext):
869
870 2019-01-10  Alicia Boya García  <aboya@igalia.com>
871
872         [MSE][GStreamer] Use GRefPtr in AppendPipeline::pushNewBuffer()
873         https://bugs.webkit.org/show_bug.cgi?id=192934
874
875         Reviewed by Xabier Rodriguez-Calvar.
876
877         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
878         (WebCore::AppendPipeline::pushNewBuffer):
879         * platform/graphics/gstreamer/mse/AppendPipeline.h:
880         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
881         (WebCore::MediaSourceClientGStreamerMSE::append):
882
883 2019-01-10  Carlos Garcia Campos  <cgarcia@igalia.com>
884
885         [FreeType] Color emoji not properly supported
886         https://bugs.webkit.org/show_bug.cgi?id=191976
887
888         Reviewed by Michael Catanzaro.
889
890         Always try to fallback to a colored font for emojis.
891
892         Test: platform/gtk/fonts/font-emoji-system-fallback.html
893
894         * platform/graphics/ComplexTextController.cpp:
895         (WebCore::advanceByCombiningCharacterSequence): Group regional indicators in pairs.
896         * platform/graphics/Font.cpp:
897         (WebCore::CharacterFallbackMapKey::CharacterFallbackMapKey):
898         (WebCore::Font::systemFallbackFontForCharacter const): Pass PreferColoredFont::No to FontCache::systemFallbackForCharacters.
899         * platform/graphics/Font.h: Add IsForPlatformFont enum to replace the bool parameter in systemFallbackFontForCharacter().
900         * platform/graphics/FontCache.h:
901         * platform/graphics/FontCascadeFonts.cpp:
902         (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
903         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
904         (WebCore::characterSequenceIsEmoji): Check whether the character sequence is an emoji.
905         (WebCore::FontCascade::fontForCombiningCharacterSequence const): In case of emojis try to fallback to a colored
906         font even if base font can render the emoji in black and white.
907         * platform/graphics/cocoa/FontCacheCoreText.cpp:
908         (WebCore::FontCache::systemFallbackForCharacters): Add PreferColoredFont parameter that is ignored.
909         * platform/graphics/freetype/FontCacheFreeType.cpp:
910         (WebCore::FontCache::systemFallbackForCharacters): Add PreferColoredFont parameter.
911         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
912         (WebCore::FontPlatformData::FontPlatformData): Initialize m_isColorBitmapFont.
913         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
914         (WebCore::Font::variantCapsSupportsCharacterForSynthesis const): Moved from cross-platform file.
915         (WebCore::Font::platformSupportsCodePoint const): Add freetype implementation.
916         * platform/graphics/win/FontCacheWin.cpp:
917         (WebCore::FontCache::systemFallbackForCharacters): Add PreferColoredFont parameter that is ignored.
918         * platform/text/CharacterProperties.h:
919         (WebCore::isEmojiKeycapBase):
920         (WebCore::isEmojiRegionalIndicator):
921         (WebCore::isEmojiWithPresentationByDefault):
922         (WebCore::isEmojiModifierBase):
923
924 2019-01-09  Antoine Quint  <graouts@apple.com>
925
926         [Web Animations] Audit Web Animations classes for memory reduction
927         https://bugs.webkit.org/show_bug.cgi?id=193195
928
929         Reviewed by Simon Fraser and Yusuke Suzuki.
930
931         The classes, enums and structs added to support Web Animations were not as memory-efficient as they could be. We now order
932         members in a way that reduces padding, use Markable<T, Traits> instead of Optional<T> where applicable, declare enums as uint8_t
933         and removed unnecessary members.
934
935         As a result, classes and structs have shrunk as follows:
936
937         WebAnimation: 256 > 216
938         DeclarativeAnimation: 392 > 344
939         CSSAnimation: 416 > 368
940         CSSTransition: 440 > 392
941         AnimationEffect: 88 > 72
942         KeyframeEffect: 208 > 184
943         AnimationPlaybackEvent: 104 > 88
944         EffectTiming: 72 > 64
945         ComputedEffectTiming: 136 > 112
946         AnimationTimeline: 264 > 248
947         DocumentTimeline: 496 > 464
948         OptionalEffectTiming: 112 > 80
949         BaseKeyframe: 32 > 24
950         ParsedKeyframe: 80 > 72
951         BaseComputedKeyframe: 40 > 32
952
953         * animation/AnimationEffect.h: Order members in decreasing size, except for m_fill and m_direction, which we put at the top to
954         save 8 bytes (2 bytes of padding instead of 4 before m_animation and saving 6 bytes of padding at the end).
955         * animation/AnimationPlaybackEvent.cpp:
956         (WebCore::AnimationPlaybackEvent::AnimationPlaybackEvent):
957         * animation/AnimationPlaybackEvent.h:
958         * animation/AnimationPlaybackEventInit.h:
959         * animation/AnimationTimeline.cpp:
960         (WebCore::AnimationTimeline::AnimationTimeline):
961         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
962         * animation/AnimationTimeline.h: We remove the m_classType member and instead make isDocumentTimeline() virtual.
963         (WebCore::AnimationTimeline::isDocumentTimeline const):
964         (): Deleted.
965         (WebCore::AnimationTimeline::classType const): Deleted.
966         * animation/CompositeOperation.h:
967         * animation/CompositeOperationOrAuto.h:
968         * animation/ComputedEffectTiming.h:
969         * animation/DeclarativeAnimation.cpp:
970         (WebCore::DeclarativeAnimation::DeclarativeAnimation):
971         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
972         * animation/DeclarativeAnimation.h: We keep m_wasPending and m_previousPhase at the top to save some padding at the end.
973         * animation/DocumentTimeline.cpp:
974         (WebCore::DocumentTimeline::DocumentTimeline):
975         * animation/DocumentTimeline.h:
976         * animation/EffectTiming.h:
977         * animation/FillMode.h:
978         * animation/IterationCompositeOperation.h:
979         * animation/KeyframeEffect.cpp:
980         (WebCore::computeMissingKeyframeOffsets):
981         (WebCore::KeyframeEffect::create):
982         (WebCore::KeyframeEffect::KeyframeEffect):
983         * animation/KeyframeEffect.h:
984         * animation/OptionalEffectTiming.h:
985         * animation/PlaybackDirection.h:
986         * animation/WebAnimation.h:
987         * animation/WebAnimationUtilities.h:
988         (WebCore::WebAnimationsMarkableDoubleTraits::isEmptyValue):
989         (WebCore::WebAnimationsMarkableDoubleTraits::emptyValue):
990
991 2019-01-09  Ryosuke Niwa  <rniwa@webkit.org>
992
993         ThreadTimers should not store a raw pointer in its heap
994         https://bugs.webkit.org/show_bug.cgi?id=192975
995         <rdar://problem/46893946>
996
997         Reviewed by Geoffrey Garen.
998
999         Right now, ThreadTimers's heap data structure stores a raw pointer to TimerBase. In order to harden the timer code,
1000         this patch replaces it with ThreadTimerHeapItem, a newly introduced struct, which effectively acks like
1001         WeakReference<TimerBase*> as the timer heap and TimerBase both store RefPtr to it, and TimerBase's destructor clears
1002         the raw pointer back to TimerBase*.
1003
1004         This approach was taken instead of an out-right adoptation of WeakPtr since the heap data structure requires each node
1005         in the heap to have a fixed "priority" yet WeakPtr with no valid pointer back to TimerBase would effectively lose its
1006         "priority" thereby corrupting the heap data structure. That is, each item in the heap must remember its fire time and
1007         insertion order even when the underlying TimerBase had gone away (this should never happen but the whole point of this
1008         hardening is to make it work even in the precense of such a bug).
1009
1010         This patch also moves the heap index in TimerBase to ThreadTimerHeapItem, and replaces the pointer to the heap vector
1011         in TimerBase by a reference to ThreadTimers in ThreadTimerHeapItem. Note that ThreadTimers is a per-thread singleton.
1012
1013         The correctness of this hardening was tested by commenting out the call to stop() and !isInHeap() assertion in
1014         TimerBase::~TimerBase() as well as the !isInHeap() assertion in ThreadTimerHeapItem::clearTimer() and observing that
1015         layout tests run successfully without hitting any debug assertions.
1016
1017         No new tests since there should be no observable behavior difference.
1018
1019         * WebCore.xcodeproj/project.pbxproj: Export ThreadTimers.h as a private header since it's now included in Timer.h
1020         * platform/ThreadTimers.cpp:
1021         (WebCore::ThreadTimers::updateSharedTimer): Delete ThreadTimerHeapItem's with nullptr TimerBase* (TimerBase had
1022         already been deleted). This should only happen when TimerBase's destructor failed to remove itself from the timer heap,
1023         which should never happen.
1024         (WebCore::ThreadTimers::sharedTimerFiredInternal): Ditto. Also removed the redundant code which had removed the timer
1025         from the heap since setNextFireTime does the removal already.
1026         * platform/ThreadTimers.h: Outdented the whole file.
1027         (WebCore::ThreadTimers::timerHeap): We use Vector<RefPtr<ThreadTimerHeapItem>> instead of Vector<Ref<~>> since Ref<~>
1028         doesn't have a copy constructor which is used by std::push_heap.
1029         (WebCore::ThreadTimerHeapItem): Added.
1030         (WebCore::ThreadTimerHeapItem::hasTimer const): Added.
1031         (WebCore::ThreadTimerHeapItem::setNotInHeap): Added. ThreadTimerHeapItem uses unsigned -1 as the single value which
1032         signifies the item not being in the heap instead of all negative values as in the old code in TimerBase.
1033         (WebCore::ThreadTimerHeapItem::isInHeap const): Added.
1034         (WebCore::ThreadTimerHeapItem::isFirstInHeap const): Added.
1035         (WebCore::ThreadTimerHeapItem::timer): Added.
1036         (WebCore::ThreadTimerHeapItem::clearTimer): Added.
1037         (WebCore::ThreadTimerHeapItem::heapIndex const): Added.
1038         (WebCore::ThreadTimerHeapItem::setHeapIndex): Added.
1039         (WebCore::ThreadTimerHeapItem::timerHeap const): Added.
1040         * platform/Timer.cpp:
1041         (WebCore::threadGlobalTimerHeap): This function is now only used in assertions.
1042         (WebCore::ThreadTimerHeapItem::ThreadTimerHeapItem): Added.
1043         (WebCore::ThreadTimerHeapItem::create): Added.
1044         (WebCore::TimerHeapPointer::TimerHeapPointer):
1045         (WebCore::TimerHeapPointer::operator-> const):
1046         (WebCore::TimerHeapReference::TimerHeapReference): Added a copy constructor.
1047         (WebCore::TimerHeapReference::copyRef const): Added.
1048         (WebCore::TimerHeapReference::operator RefPtr<ThreadTimerHeapItem>& const):
1049         (WebCore::TimerHeapPointer::operator* const):
1050         (WebCore::TimerHeapReference::operator=): Use move assignment operator.
1051         (WebCore::TimerHeapReference::swapWith):
1052         (WebCore::TimerHeapReference::updateHeapIndex): Extracted to share code between two verions of operator=.
1053         (WebCore::swap):
1054         (WebCore::TimerHeapIterator::TimerHeapIterator):
1055         (WebCore::TimerHeapIterator::operator-> const):
1056         (WebCore::TimerHeapLessThanFunction::compare): Added variants which take RefPtr<ThreadTimerHeapItem>.
1057         (WebCore::TimerHeapLessThanFunction::operator() const):
1058         (WebCore::TimerBase::TimerBase):
1059         (WebCore::TimerBase::~TimerBase):Clear the raw pointer in ThreadTimerHeapItem.
1060         (WebCore::TimerBase::stop):
1061         (WebCore::TimerBase::nextFireInterval const):
1062         (WebCore::TimerBase::checkHeapIndex const): Added the consistency check for other items in the heap.
1063         (WebCore::TimerBase::checkConsistency const):
1064         (WebCore::TimerBase::heapDecreaseKey):
1065         (WebCore::TimerBase::heapDelete):
1066         (WebCore::TimerBase::heapDeleteMin):
1067         (WebCore::TimerBase::heapIncreaseKey):
1068         (WebCore::TimerBase::heapInsert):
1069         (WebCore::TimerBase::heapPop):
1070         (WebCore::TimerBase::heapPopMin):
1071         (WebCore::TimerBase::heapDeleteNullMin): Added. Used to delete ThreadTimerHeapItem which no longer has a valid TimerBase.
1072         (WebCore::parentHeapPropertyHolds):
1073         (WebCore::childHeapPropertyHolds):
1074         (WebCore::TimerBase::hasValidHeapPosition const):
1075         (WebCore::TimerBase::updateHeapIfNeeded): Tweaked the heap index assertion as heapIndex() itself would assert when called
1076         on an item with an invalid (-1) heap index.
1077         (WebCore::TimerBase::setNextFireTime): Create ThreadTimerHeapItem. Note m_heapItem is never cleared until this TimerBase
1078         is deleted.
1079         (WebCore::TimerHeapReference::operator TimerBase* const): Deleted.
1080         * platform/Timer.h:
1081         (WebCore::TimerBase): Replaced m_nextFireTime, m_heapIndex, m_heapInsertionOrder, and m_cachedThreadGlobalTimerHeap
1082         by m_heapItem, RefPtr to an ThreadTimerHeapItem.
1083         (WebCore::TimerBase::augmentFireInterval):
1084         (WebCore::TimerBase::inHeap const):
1085         (WebCore::TimerBase::nextFireTime const):
1086         (WebCore::TimerBase::isActive const):
1087         (WebCore::TimerBase:: const): Deleted.
1088
1089 2019-01-09  Alex Christensen  <achristensen@webkit.org>
1090
1091         REGRESSION(239737) iOS quicklook tests should not dereference null
1092         https://bugs.webkit.org/show_bug.cgi?id=193307
1093
1094         Reviewed by Brent Fulgham.
1095
1096         The quicklook tests rely on ResourceHandle on iOS for some reason.
1097         This is a problem we'll fix later, but for now keep them working by not crashing.
1098
1099         * platform/network/mac/ResourceHandleMac.mm:
1100         (WebCore::ResourceHandle::createNSURLConnection):
1101         (WebCore::ResourceHandle::start):
1102         (WebCore::ResourceHandle::willSendRequest):
1103         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
1104         (WebCore::ResourceHandle::receivedCredential):
1105
1106 2019-01-09  Zalan Bujtas  <zalan@apple.com>
1107
1108         [Datalist] Crash when input with datalist is dynamically added.
1109         https://bugs.webkit.org/show_bug.cgi?id=193012
1110         <rdar://problem/45923457>
1111
1112         Reviewed by Brent Fulgham.
1113
1114         In certain cases (cloning, setAttribute), it's too early to check for the list attribute in createShadowSubtree
1115         to see whether the input needs datalist related items. The list attribute is simply not set yet.
1116         This patch only addresses the obvious crash. m_dataListDropdownIndicator clearly lacks proper lifecycle management (see webkit.org/b/193032). 
1117
1118         Test: fast/forms/datalist/datalist-crash-when-dynamic.html
1119
1120         * html/TextFieldInputType.cpp:
1121         (WebCore::TextFieldInputType::createShadowSubtree):
1122         (WebCore::TextFieldInputType::attributeChanged):
1123         (WebCore::TextFieldInputType::createDataListDropdownIndicator):
1124         * html/TextFieldInputType.h:
1125
1126 2019-01-09  Justin Fan  <justin_fan@apple.com>
1127
1128         [WebGPU] Fix vertex-buffer-triangle-strip test and small update to GPURenderPipeline
1129         https://bugs.webkit.org/show_bug.cgi?id=193289
1130
1131         Reviewed by Dean Jackson.
1132
1133         Fix broken test after pipeline layouts were added, and a small refactoring to GPURenderPipeline to avoid
1134         retaining its descriptor after creation.
1135
1136         * platform/graphics/gpu/GPURenderPipeline.h:
1137         (WebCore::GPURenderPipeline::primitiveTopology const):
1138         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
1139         (WebCore::GPURenderPipeline::GPURenderPipeline):
1140
1141 2019-01-09  Devin Rousso  <drousso@apple.com>
1142
1143         Web Inspector: Protocol Logging: log messages as objects if inspector^2 is open
1144         https://bugs.webkit.org/show_bug.cgi?id=193284
1145
1146         Reviewed by Joseph Pecoraro.
1147
1148         No newe tests, as this is simply exposes a value.
1149
1150         * inspector/InspectorFrontendHost.idl:
1151         * inspector/InspectorFrontendHost.h:
1152         * inspector/InspectorFrontendHost.cpp:
1153         (WebCore::InspectorFrontendHost::isBeingInspected): Added.
1154
1155 2019-01-09  Zalan Bujtas  <zalan@apple.com>
1156
1157         [LFC][BFC][MarginCollapsing] Add support for peculiar cases.
1158         https://bugs.webkit.org/show_bug.cgi?id=192625
1159
1160         Reviewed by Antti Koivisto.
1161
1162         Implement some of the more peculiar cases like margin collpasing through multiple boxes etc.
1163         Add ~100 new passing cases.
1164
1165         * layout/FormattingContextGeometry.cpp:
1166         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1167         * layout/LayoutState.h:
1168         (WebCore::Layout::LayoutState::hasFormattingState const):
1169         * layout/MarginTypes.h:
1170         * layout/blockformatting/BlockFormattingContext.cpp:
1171         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
1172         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
1173         (WebCore::Layout::hasPrecomputedMarginBefore):
1174         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1175         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
1176         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1177         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1178         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
1179         * layout/blockformatting/BlockFormattingContext.h:
1180         (WebCore::Layout::BlockFormattingContext::blockFormattingState const):
1181         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1182         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1183         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1184         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBefore): Deleted.
1185         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginAfter): Deleted.
1186         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1187         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
1188         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginAfter):
1189         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight): Deleted.
1190         * layout/blockformatting/BlockFormattingState.h:
1191         (WebCore::Layout::BlockFormattingState::setPositiveAndNegativeVerticalMargin):
1192         (WebCore::Layout::BlockFormattingState::hasPositiveAndNegativeVerticalMargin const):
1193         (WebCore::Layout::BlockFormattingState::positiveAndNegativeVerticalMargin const):
1194         (WebCore::Layout::BlockFormattingState::setHasEstimatedMarginBefore):
1195         (WebCore::Layout::BlockFormattingState::clearHasEstimatedMarginBefore):
1196         (WebCore::Layout::BlockFormattingState::hasEstimatedMarginBefore const):
1197         * layout/blockformatting/BlockMarginCollapse.cpp:
1198         (WebCore::Layout::hasClearance):
1199         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
1200         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
1201         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
1202         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
1203         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
1204         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
1205         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
1206         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSiblingMarginBefore):
1207         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
1208         (WebCore::Layout::computedPositiveAndNegativeMargin):
1209         (WebCore::Layout::marginValue):
1210         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateCollapsedMarginAfter):
1211         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
1212         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
1213         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
1214         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
1215         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
1216         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBefore): Deleted.
1217         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginAfter): Deleted.
1218         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBefore): Deleted.
1219         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginAfter): Deleted.
1220         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBeforeFromFirstChild): Deleted.
1221         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginAfterFromLastChild): Deleted.
1222         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSibling): Deleted.
1223         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSibling): Deleted.
1224         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBefore): Deleted.
1225         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfter): Deleted.
1226         * layout/displaytree/DisplayBox.cpp:
1227         (WebCore::Display::Box::Box):
1228         * layout/displaytree/DisplayBox.h:
1229         (WebCore::Display::Box::hasClearance const):
1230         (WebCore::Display::Box::setEstimatedMarginBefore):
1231         (WebCore::Display::Box::estimatedMarginBefore const):
1232         (WebCore::Display::Box::setHasClearance):
1233         (WebCore::Display::Box::invalidateEstimatedMarginBefore):
1234         (WebCore::Display::Box::setVerticalMargin):
1235         (WebCore::Display::Box::rectWithMargin const):
1236         * layout/floats/FloatingContext.cpp:
1237         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
1238         * layout/inlineformatting/InlineFormattingContext.cpp:
1239         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
1240
1241 2019-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
1242
1243         REGRESSION(r239156): [FreeType] fixed width, and synthetic bold/italic not correctly applied since r239156
1244         https://bugs.webkit.org/show_bug.cgi?id=193276
1245
1246         Reviewed by Žan Doberšek.
1247
1248         FontCache::createFontPlatformData() is calling getFontPropertiesFromPattern() with the configure pattern instead
1249         of the result one after the match.
1250
1251         * platform/graphics/freetype/FontCacheFreeType.cpp:
1252         (WebCore::FontCache::createFontPlatformData):
1253
1254 2019-01-08  Dean Jackson  <dino@apple.com>
1255
1256         Blob references for System Previews don't get a correct file extension
1257         https://bugs.webkit.org/show_bug.cgi?id=193268
1258         <rdar://problem/47133037>
1259
1260         Reviewed by Tim Horton.
1261
1262         Apple platforms don't yet have a mapping from the USD MIME type to
1263         file extensions (and we support some non-standard MIME types), which
1264         means that downloads from Blob references don't get correctly named.
1265
1266         Fix this by adding an explicit mapping between System Preview types
1267         and ".usdz".
1268
1269         WebKit API test: _WKDownload.SystemPreviewUSDZBlobNaming
1270
1271         * platform/MIMETypeRegistry.cpp:
1272         (WebCore::MIMETypeRegistry::isSystemPreviewMIMEType): Remove USE(SYSTEM_PREVIEW) since
1273         this applies to macOS and iOS now.
1274         * platform/MIMETypeRegistry.h:
1275         * platform/cocoa/MIMETypeRegistryCocoa.mm:
1276         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): Add a mapping
1277         for USDZ.
1278
1279 2019-01-08  Tim Horton  <timothy_horton@apple.com>
1280
1281         Editable images sometimes don't become focused when tapped
1282         https://bugs.webkit.org/show_bug.cgi?id=193259
1283         <rdar://problem/47038424>
1284
1285         Reviewed by Wenson Hsieh.
1286
1287         Often when tapping an editable image inside an editable text area, the
1288         text area's selection will change instead of focusing the editable image.
1289
1290         No new tests; I have had no luck writing a test that reliably failed 
1291         beforehand (the "sometimes" is a problem).
1292
1293         * html/HTMLImageElement.cpp:
1294         (WebCore::HTMLImageElement::defaultEventHandler):
1295         * html/HTMLImageElement.h:
1296         Override mousedown on editable images, focus the image, and prevent
1297         the default behavior.
1298
1299 2019-01-08  Jiewen Tan  <jiewen_tan@apple.com>
1300
1301         [WebAuthN] Support U2F HID Authenticators on macOS
1302         https://bugs.webkit.org/show_bug.cgi?id=191535
1303         <rdar://problem/47102027>
1304
1305         Reviewed by Brent Fulgham.
1306
1307         This patch changes U2fCommandConstructor to produce register commands with
1308         enforcing test of user presence. Otherwise, authenticators would silently
1309         generate credentials. It also renames readFromU2fSignResponse to
1310         readU2fSignResponse.
1311
1312         Tests: http/wpt/webauthn/public-key-credential-create-failure-u2f-silent.https.html
1313                http/wpt/webauthn/public-key-credential-create-failure-u2f.https.html
1314                http/wpt/webauthn/public-key-credential-create-success-u2f.https.html
1315                http/wpt/webauthn/public-key-credential-get-failure-u2f-silent.https.html
1316                http/wpt/webauthn/public-key-credential-get-failure-u2f.https.html
1317                http/wpt/webauthn/public-key-credential-get-success-u2f.https.html
1318
1319         * Modules/webauthn/fido/U2fCommandConstructor.cpp:
1320         (fido::WebCore::constructU2fRegisterCommand):
1321         * Modules/webauthn/fido/U2fResponseConverter.cpp:
1322         (fido::readU2fSignResponse):
1323         (fido::readFromU2fSignResponse): Deleted.
1324         * Modules/webauthn/fido/U2fResponseConverter.h:
1325
1326 2019-01-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1327
1328         [iOS] Dispatch a synthetic mousedown event prior to starting drags
1329         https://bugs.webkit.org/show_bug.cgi?id=193229
1330         <rdar://problem/46717097>
1331
1332         Reviewed by Tim Horton.
1333
1334         Tweaks some drag initiation logic on iOS to actually send a "mousedown" event to the page prior to drag start.
1335         This improves drag and drop compatibility with web pages that expect a mousedown to always precede dragging.
1336         Additionally, ensure that preventing the "mousedown" event also prevents "dragstart", which matches macOS
1337         behavior.
1338
1339         Test: DragAndDropTests.PreventingMouseDownShouldPreventDragStart
1340
1341         * page/EventHandler.cpp:
1342
1343         Make the text drag delay 0 on iOS. This was introduced on iOS when originally bringing up drag and drop, and was
1344         made to simply match macOS. However, it doesn't make sense to respect the delay here, since the purpose of this
1345         delay is to disambiguate between making a text selection and starting a drag when pressing on text that is
1346         already selected; on iOS (including iOSMac), this gesture conflict is already resolved by platform gesture
1347         recognizers in the client layer, so there is always no delay between mouse down and drag here.
1348
1349         * page/ios/EventHandlerIOS.mm:
1350
1351         Dispatch a mousedown and inspect the value of `m_mouseDownMayStartDrag` when starting a drag on iOS. This brings
1352         our behavior closer in line with macOS.
1353
1354         (WebCore::EventHandler::tryToBeginDataInteractionAtPoint):
1355
1356 2019-01-08  Youenn Fablet  <youenn@apple.com>
1357
1358         service worker fetch handler results in bad referrer
1359         https://bugs.webkit.org/show_bug.cgi?id=188248
1360         <rdar://problem/47050478>
1361
1362         Reviewed by Alex Christensen.
1363
1364         Response sanitization was removing the ReferrerPolicy header from opaque redirect responses.
1365         Reduce sanitization of opaque redirect responses to opaque responses and allow Location header.
1366         Make sure referrer policy is updated for all load redirections, not only CORS loads.
1367
1368         Test: http/tests/security/referrer-policy-redirect-link-downgrade.html
1369
1370         * loader/SubresourceLoader.cpp:
1371         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
1372         * platform/network/ResourceResponseBase.cpp:
1373         (WebCore::isSafeCrossOriginResponseHeader):
1374         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
1375
1376 2019-01-08  Youenn Fablet  <youenn@apple.com>
1377
1378         IDB storage of Crypto keys does not work in private browsing mode
1379         https://bugs.webkit.org/show_bug.cgi?id=193219
1380
1381         Reviewed by Brady Eidson.
1382
1383         https://trac.webkit.org/changeset/238677 moved from using a JSGlobalObject to a JSDOMGlobalObject for serialization/deserialization.
1384         This does not work for crypto keys as they require not only a JSDOMGlobalObject but either a window or worker global object.
1385
1386         To fix the issue, revert 238677, and fix it by checking whether the dumping of an ArrayBuffer happens for a JSDOMGlobalObject or a JSGlobalObject.
1387         If it is the latter, use JSC routines instead of toJS() which requires a JSDOMGlobalObject.
1388
1389         Covered by updated test.
1390
1391         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1392         (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadVM):
1393         (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadExecState):
1394         * bindings/js/JSDOMGlobalObject.cpp:
1395         * bindings/js/JSDOMGlobalObject.h:
1396         * bindings/js/JSDOMWrapper.cpp:
1397         (WebCore::JSDOMObject::JSDOMObject):
1398         * bindings/js/SerializedScriptValue.cpp:
1399         (WebCore::CloneSerializer::dumpArrayBufferView):
1400         (WebCore::CloneSerializer::toJSArrayBuffer):
1401
1402 2019-01-08  Justin Fan  <justin_fan@apple.com>
1403
1404         [WebGPU] Update createRenderPipeline for WebGPUPipelineLayout
1405         https://bugs.webkit.org/show_bug.cgi?id=193247
1406
1407         Reviewed by Dean Jackson.
1408
1409         Add WebGPUPipelineLayout to WebGPURenderPipeline via WebGPUPipelineDescriptorBase.
1410
1411         Test: Updated render-pipelines.html to test new functionality.
1412
1413         * Modules/webgpu/WebGPUDevice.cpp:
1414         (WebCore::WebGPUDevice::createRenderPipeline const): Convert WebGPUPipelineLayout to GPUPipelineLayout.
1415         * Modules/webgpu/WebGPUPipelineDescriptorBase.h:
1416         * Modules/webgpu/WebGPUPipelineDescriptorBase.idl: Add layout field.
1417         * Modules/webgpu/WebGPUPipelineLayout.h: 
1418         (WebCore::WebGPUPipelineLayout::pipelineLayout): Added. Getter.
1419         * platform/graphics/gpu/GPUPipelineDescriptorBase.h: Updated from out-of-date version.
1420         * platform/graphics/gpu/GPUPipelineLayout.cpp:
1421         (WebCore::GPUPipelineLayout::GPUPipelineLayout): Now retains bindGroupLayouts from descriptor.
1422         * platform/graphics/gpu/GPUPipelineLayout.h:
1423         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Now inherits from GPUPipelineDescriptorBase.
1424         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Custom constructor for non-aggregate struct.
1425
1426 2019-01-08  Chris Dumez  <cdumez@apple.com>
1427
1428         Prevent cross-site top-level navigations from third-party iframes
1429         https://bugs.webkit.org/show_bug.cgi?id=193076
1430         <rdar://problem/36074736>
1431
1432         Reviewed by Alex Christensen.
1433
1434         Prevent cross-site top-level navigations from third-party iframes if the following conditions are met:
1435         1. Its tries to navigate the top-level page cross-site (different eTDL+1)
1436         2. The user has never interacted with the third-party iframe or any of its subframes
1437
1438         This experiment's intent is to block suspicious main-frame navigations by third-party content. The feature
1439         is behind a runtime experimental feature flag, on by default.
1440
1441         Tests: http/tests/security/allow-top-level-navigations-by-third-party-iframes-to-same-origin.html
1442                http/tests/security/allow-top-level-navigations-by-third-party-iframes-with-previous-user-activation.html
1443                http/tests/security/allow-top-level-navigations-by-third-party-iframes-with-user-activation.html
1444                http/tests/security/block-top-level-navigations-by-third-party-iframes.html
1445
1446         * dom/Document.cpp:
1447         (WebCore::printNavigationErrorMessage):
1448         (WebCore::Document::canNavigate):
1449         (WebCore::Document::canNavigateInternal):
1450         (WebCore::Document::isNavigationBlockedByThirdPartyIFrameRedirectBlocking):
1451         * dom/Document.h:
1452         * dom/UserGestureIndicator.cpp:
1453         * page/DOMWindow.cpp:
1454         (WebCore::DOMWindow::setLocation):
1455         * page/DOMWindow.h:
1456         * page/Frame.h:
1457         * page/Location.cpp:
1458         (WebCore::Location::replace):
1459         (WebCore::Location::setLocation):
1460         * page/Settings.yaml:
1461
1462 2019-01-08  Alex Christensen  <achristensen@webkit.org>
1463
1464         Stop using NetworkStorageSession in WebProcess
1465         https://bugs.webkit.org/show_bug.cgi?id=193236
1466
1467         Reviewed by Don Olmstead.
1468
1469         No change in behavior.  Some code was only used for ResourceHandle, which isn't used in modern WebKit,
1470         and for cookies, which are handled in the NetworkProcess in modern WebKit.
1471
1472         * loader/CookieJar.cpp:
1473         (WebCore::storageSession):
1474         * loader/EmptyClients.cpp:
1475         * platform/network/NetworkingContext.h:
1476         * platform/network/mac/ResourceHandleMac.mm:
1477         (WebCore::ResourceHandle::createNSURLConnection):
1478         (WebCore::ResourceHandle::start):
1479         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
1480         (WebCore::ResourceHandle::willSendRequest):
1481         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
1482         (WebCore::ResourceHandle::receivedCredential):
1483
1484 2019-01-08  Alex Christensen  <achristensen@webkit.org>
1485
1486         Unreviewed, rolling out r239727.
1487
1488         Broke API tests
1489
1490         Reverted changeset:
1491
1492         "Stop using NetworkStorageSession in WebProcess"
1493         https://bugs.webkit.org/show_bug.cgi?id=193236
1494         https://trac.webkit.org/changeset/239727
1495
1496 2019-01-08  Alex Christensen  <achristensen@webkit.org>
1497
1498         Stop using NetworkStorageSession in WebProcess
1499         https://bugs.webkit.org/show_bug.cgi?id=193236
1500
1501         Reviewed by Don Olmstead.
1502
1503         No change in behavior.  Some code was only used for ResourceHandle, which isn't used in modern WebKit,
1504         and for cookies, which are handled in the NetworkProcess in modern WebKit.
1505
1506         * loader/CookieJar.cpp:
1507         (WebCore::storageSession):
1508         * loader/EmptyClients.cpp:
1509         * platform/network/NetworkingContext.h:
1510         * platform/network/mac/ResourceHandleMac.mm:
1511         (WebCore::ResourceHandle::createNSURLConnection):
1512         (WebCore::ResourceHandle::start):
1513         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
1514         (WebCore::ResourceHandle::willSendRequest):
1515         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
1516         (WebCore::ResourceHandle::receivedCredential):
1517
1518 2019-01-08  Chris Dumez  <cdumez@apple.com>
1519
1520         Regression(PSON-r239182): Blank view when navigating back and forth between google.com and stack overflow
1521         https://bugs.webkit.org/show_bug.cgi?id=193224
1522         <rdar://problem/47097726>
1523
1524         Reviewed by Alex Christensen.
1525
1526         Since r239182, pages get suspended in-place when we suspend the old process after a process-swap on navigation.
1527         When we return to a suspended page, we load the current history item again and it normally properly restores
1528         the page from PageCache, even though we load the same history item and the current one and even though the
1529         page is suspended in-place (i.e. we did not navigate away, which is the usual case for page cache).
1530
1531         The issue is that if the page URL contains a fragment, FrameLoader::shouldPerformFragmentNavigation() would
1532         return true because both the source and destination URLs (which are the same) contains a fragment. To address
1533         the issue, update FrameLoader::shouldPerformFragmentNavigation() to return false if the current page is
1534         suspended.
1535
1536         * loader/FrameLoader.cpp:
1537         (WebCore::FrameLoader::shouldPerformFragmentNavigation):
1538
1539 2019-01-08  Alex Christensen  <achristensen@webkit.org>
1540
1541         Move Windows-specific code from NetworkStorageSessionCFNet.cpp to its own file
1542         https://bugs.webkit.org/show_bug.cgi?id=192958
1543
1544         Reviewed by Yusuke Suzuki.
1545
1546         This makes it easier to reason about what code is used where.
1547
1548         * PlatformAppleWin.cmake:
1549         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1550         (WebCore::createPrivateStorageSession): Deleted.
1551         (WebCore::cookieDomain): Deleted.
1552         (WebCore::canonicalCookieTime): Deleted.
1553         (WebCore::cookieCreatedTime): Deleted.
1554         (WebCore::cookieExpirationTime): Deleted.
1555         (WebCore::cookieName): Deleted.
1556         (WebCore::cookiePath): Deleted.
1557         (WebCore::cookieValue): Deleted.
1558         (WebCore::filterCookies): Deleted.
1559         (WebCore::copyCookiesForURLWithFirstPartyURL): Deleted.
1560         (WebCore::createCookies): Deleted.
1561         (WebCore::NetworkStorageSession::setCookiesFromDOM const): Deleted.
1562         (WebCore::containsSecureCookies): Deleted.
1563         (WebCore::NetworkStorageSession::cookiesForDOM const): Deleted.
1564         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const): Deleted.
1565         (WebCore::NetworkStorageSession::cookiesEnabled const): Deleted.
1566         (WebCore::NetworkStorageSession::getRawCookies const): Deleted.
1567         (WebCore::NetworkStorageSession::deleteCookie const): Deleted.
1568         (WebCore::NetworkStorageSession::getHostnamesWithCookies): Deleted.
1569         (WebCore::NetworkStorageSession::deleteAllCookies): Deleted.
1570         (WebCore::NetworkStorageSession::deleteCookiesForHostnames): Deleted.
1571         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince): Deleted.
1572         * platform/network/cf/NetworkStorageSessionCFNetWin.cpp: Added.
1573         (WebCore::createPrivateStorageSession):
1574         (WebCore::NetworkStorageSession::setCookies):
1575         (WebCore::cookieDomain):
1576         (WebCore::canonicalCookieTime):
1577         (WebCore::cookieCreatedTime):
1578         (WebCore::cookieExpirationTime):
1579         (WebCore::cookieName):
1580         (WebCore::cookiePath):
1581         (WebCore::cookieValue):
1582         (WebCore::filterCookies):
1583         (WebCore::copyCookiesForURLWithFirstPartyURL):
1584         (WebCore::createCookies):
1585         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
1586         (WebCore::containsSecureCookies):
1587         (WebCore::NetworkStorageSession::cookiesForDOM const):
1588         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
1589         (WebCore::NetworkStorageSession::cookiesEnabled const):
1590         (WebCore::NetworkStorageSession::getRawCookies const):
1591         (WebCore::NetworkStorageSession::deleteCookie const):
1592         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
1593         (WebCore::NetworkStorageSession::deleteAllCookies):
1594         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
1595         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
1596
1597 2018-12-19  Antoine Quint  <graouts@apple.com>
1598
1599         [Web Animations] Compute animation effect timing properties in batch
1600         https://bugs.webkit.org/show_bug.cgi?id=192850
1601
1602         Reviewed by Dean Jackson.
1603
1604         We remove a host of functions from AnimationEffect that would allow the computation of various timing properties
1605         defined by the Web Animations specification: phase, progress, current iteration, etc. Indeed, a lot of these functions
1606         would call each other in a chain, and we would re-compute a lot of the earlier properties in those chains several times
1607         when doing something like querying the animation progress. Additionally, some functions, such as WebAnimation::computeRelevance()
1608         and WebAnimation::timeToNextTick() would yield the computation of several such properties numerous times. All of those
1609         functions are called during each animation frame and are ripe for optimizations.
1610
1611         We now compute all timing properties across two functions:
1612         
1613         1. the new AnimationEffect::getBasicTiming() which computes the local time, end time, active duration, active time and phase,
1614         2. the existing AnimationEffect::getComputedTiming() which now also exposes the phase and simple iteration progress.
1615
1616         To support this we introduce a new BasicEffectTiming struct to contain the values computed in AnimationEffect::getBasicTiming()
1617         and spun the AnimationEffect::Phase struct as AnimationEffectPhase so that it may be used across BasicEffectTiming and
1618         ComputedEffectTiming.
1619
1620         No new test since there is no user-observable change.
1621
1622         * WebCore.xcodeproj/project.pbxproj:
1623         * animation/AnimationEffect.cpp:
1624         (WebCore::AnimationEffect::getTiming const):
1625         (WebCore::AnimationEffect::getBasicTiming const):
1626         (WebCore::AnimationEffect::getComputedTiming const):
1627         (WebCore::AnimationEffect::localTime const): Deleted.
1628         (WebCore::AnimationEffect::phase const): Deleted.
1629         (WebCore::AnimationEffect::activeTime const): Deleted.
1630         (WebCore::AnimationEffect::overallProgress const): Deleted.
1631         (WebCore::AnimationEffect::simpleIterationProgress const): Deleted.
1632         (WebCore::AnimationEffect::currentIteration const): Deleted.
1633         (WebCore::AnimationEffect::currentDirection const): Deleted.
1634         (WebCore::AnimationEffect::directedProgress const): Deleted.
1635         (WebCore::AnimationEffect::transformedProgress const): Deleted.
1636         (WebCore::AnimationEffect::iterationProgress const): Deleted.
1637         (WebCore::AnimationEffect::getTiming): Deleted.
1638         (WebCore::AnimationEffect::getComputedTiming): Deleted.
1639         (WebCore::AnimationEffect::endTime const): Deleted.
1640         (WebCore::AnimationEffect::activeDuration const): Deleted.
1641         * animation/AnimationEffect.h:
1642         * animation/AnimationEffectPhase.h: Copied from Source/WebCore/animation/ComputedEffectTiming.h.
1643         * animation/AnimationTimeline.cpp:
1644         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
1645         * animation/AnimationTimeline.h:
1646         * animation/BasicEffectTiming.h: Copied from Source/WebCore/animation/ComputedEffectTiming.h.
1647         * animation/ComputedEffectTiming.h:
1648         * animation/DeclarativeAnimation.cpp:
1649         (WebCore::DeclarativeAnimation::cancel):
1650         (WebCore::DeclarativeAnimation::phaseWithoutEffect const):
1651         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
1652         * animation/DeclarativeAnimation.h:
1653         * animation/KeyframeEffect.cpp:
1654         (WebCore::KeyframeEffect::apply):
1655         (WebCore::KeyframeEffect::getAnimatedStyle):
1656         * animation/WebAnimation.cpp:
1657         (WebCore::WebAnimation::effectEndTime const):
1658         (WebCore::WebAnimation::computeRelevance):
1659         (WebCore::WebAnimation::timeToNextTick const):
1660
1661 2019-01-07  Youenn Fablet  <youenn@apple.com>
1662
1663         Crash in SWServer::Connection::resolveRegistrationReadyRequests
1664         https://bugs.webkit.org/show_bug.cgi?id=193217
1665
1666         Reviewed by Chris Dumez.
1667
1668         As can be seen from the traces, SWServer might clear its connections HashMap in its destructor.
1669         This might then trigger calling SWServer::resolveRegistrationReadyRequests.
1670         This method is iterating on the connections HashMap which is being cleared.
1671         To remove this problem, move the HashMap in a temporary variable and clear the temporary variable.
1672
1673         * workers/service/server/SWServer.cpp:
1674         (WebCore::SWServer::~SWServer):
1675
1676 2019-01-07  Jer Noble  <jer.noble@apple.com>
1677
1678         REGRESSION (r239519): ASSERTION FAILED: !m_adoptionIsRequired in com.apple.WebCore: void WTF::refIfNotNull<WebCore::CDMSessionMediaSourceAVFObjC> + 53
1679         https://bugs.webkit.org/show_bug.cgi?id=193211
1680         <rdar://problem/46937412>
1681
1682         Reviewed by Eric Carlson.
1683
1684         Make CDMSessionMediaSourceAVFObjC a CanMakeWeakPtr rather than RefCounted, as CDMSessions are stored in
1685         std::unique_ptrs, and not in Ref or RefPtr.
1686
1687         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
1688         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1689         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1690         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
1691
1692 2019-01-07  David Kilzer  <ddkilzer@apple.com>
1693
1694         Prefer RetainPtr<NSObject> to RetainPtr<NSObject *>
1695         <https://webkit.org/b/193056>
1696
1697         Reviewed by Alex Christensen.
1698
1699         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1700         (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]):
1701         (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:withDiscontinuity:]):
1702         * platform/network/cf/AuthenticationChallenge.h:
1703         - Remove '*' from RetainPtr<> type.
1704
1705         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
1706         (WebCore::cookiesForURL):
1707         - Once retainPtr() was changed to return RetainPtr<NSArray>
1708           instead of RetainPtr<NSArray *> here, that forced the type of
1709           `cookiesPtr` to change as well since
1710           Optional<RetainPtr<NSArray>> is not assignable to
1711           Optional<RetainPtr<NSArray *>> without further template
1712           specialization, which didn't seem useful since
1713           Optional<RetainPtr<>> variable types are rarely used.
1714
1715 2019-01-07  Devin Rousso  <drousso@apple.com>
1716
1717         Web Inspector: extend XHR breakpoints to work with fetch
1718         https://bugs.webkit.org/show_bug.cgi?id=185843
1719         <rdar://problem/40431027>
1720
1721         Reviewed by Matt Baker.
1722
1723         Test: inspector/dom-debugger/url-breakpoints.html
1724
1725         * Modules/fetch/FetchResponse.cpp:
1726         (WebCore::FetchResponse::fetch):
1727
1728         * inspector/InspectorInstrumentation.h:
1729         (WebCore::InspectorInstrumentation::willFetch): Added.
1730         * inspector/InspectorInstrumentation.cpp:
1731         (WebCore::InspectorInstrumentation::willFetchImpl): Added.
1732
1733         * inspector/agents/InspectorDOMDebuggerAgent.h:
1734         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
1735         (WebCore::InspectorDOMDebuggerAgent::disable):
1736         (WebCore::InspectorDOMDebuggerAgent::discardBindings):
1737         (WebCore::InspectorDOMDebuggerAgent::setURLBreakpoint): Added.
1738         (WebCore::InspectorDOMDebuggerAgent::removeURLBreakpoint): Added.
1739         (WebCore::InspectorDOMDebuggerAgent::breakOnURLIfNeeded): Added.
1740         (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
1741         (WebCore::InspectorDOMDebuggerAgent::willFetch): Added.
1742         (WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint): Deleted.
1743         (WebCore::InspectorDOMDebuggerAgent::removeXHRBreakpoint): Deleted.
1744
1745 2019-01-07  Eric Carlson  <eric.carlson@apple.com>
1746
1747         Cleanup AudioTrackPrivateMediaStreamCocoa
1748         https://bugs.webkit.org/show_bug.cgi?id=193208
1749         <rdar://problem/42225870>
1750
1751         Reviewed by Youenn Fablet.
1752
1753         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
1754         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable): Clear input and
1755         output format descriptions after stopping the audio unit.
1756
1757 2019-01-07  Devin Rousso  <drousso@apple.com>
1758
1759         Web Inspector: Network: show secure connection details per-request
1760         https://bugs.webkit.org/show_bug.cgi?id=191539
1761         <rdar://problem/45979891>
1762
1763         Reviewed by Joseph Pecoraro.
1764
1765         Test: http/tests/inspector/network/resource-security-connection.html
1766
1767         * platform/network/NetworkLoadMetrics.h:
1768         (WebCore::NetworkLoadMetrics:isolatedCopy):
1769         (WebCore::NetworkLoadMetrics:clearNonTimingData):
1770         (WebCore::NetworkLoadMetrics:operator==):
1771         (WebCore::NetworkLoadMetrics:encode):
1772         (WebCore::NetworkLoadMetrics:decode):
1773
1774         * inspector/agents/InspectorNetworkAgent.cpp:
1775         (WebCore::InspectorNetworkAgent::buildObjectForMetrics):
1776
1777 2019-01-07  Eric Carlson  <eric.carlson@apple.com>
1778
1779         Deactivate audio session whenever possible
1780         https://bugs.webkit.org/show_bug.cgi?id=193188
1781         <rdar://problem/42678977>
1782
1783         Reviewed by Jer Noble.
1784
1785         Test: media/deactivate-audio-session.html
1786
1787         * platform/audio/AudioSession.cpp:
1788         (WebCore::AudioSession::tryToSetActive):
1789         (WebCore::AudioSession::tryToSetActiveInternal):
1790         * platform/audio/AudioSession.h:
1791         (WebCore::AudioSession::isActive const):
1792
1793         * platform/audio/PlatformMediaSessionManager.cpp:
1794         (WebCore::PlatformMediaSessionManager::removeSession):
1795         (WebCore::deactivateAudioSession):
1796         (WebCore::PlatformMediaSessionManager::shouldDeactivateAudioSession):
1797         (WebCore::PlatformMediaSessionManager::setShouldDeactivateAudioSession):
1798         * platform/audio/PlatformMediaSessionManager.h:
1799
1800         * platform/audio/ios/AudioSessionIOS.mm:
1801         (WebCore::AudioSession::tryToSetActiveInternal):
1802         (WebCore::AudioSession::tryToSetActive): Deleted.
1803
1804         * platform/audio/mac/AudioSessionMac.cpp:
1805         (WebCore::AudioSession::tryToSetActiveInternal):
1806         (WebCore::AudioSession::tryToSetActive): Deleted.
1807
1808         * testing/Internals.cpp:
1809         (WebCore::Internals::audioSessionActive const):
1810         * testing/Internals.h:
1811         * testing/Internals.idl:
1812
1813 2019-01-07  David Kilzer  <ddkilzer@apple.com>
1814
1815         PlatformECKey should use a std::unique_ptr
1816         <https://webkit.org/b/193170>
1817
1818         Reviewed by Brent Fulgham.
1819
1820         Broadly:
1821         - Switch from using raw pointers to using std::unique_ptr<> to
1822           hold PlatformECKey.
1823         - Introduce PlatformECKeyContainer type to handle different
1824           std::unique_ptr<> types on each platform.
1825         - Get rid of custom CryptoKeyEC destructors since the
1826           std::unique_ptr<> handles that with a Deleter.
1827         - Initialize stack variables to nullptr.
1828
1829         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
1830         (WebCore::CryptoKeyEC::keySizeInBits const):
1831         (WebCore::CryptoKeyEC::platformGeneratePair):
1832         (WebCore::CryptoKeyEC::platformImportRaw):
1833         (WebCore::CryptoKeyEC::platformImportJWKPublic):
1834         (WebCore::CryptoKeyEC::platformImportJWKPrivate):
1835         (WebCore::CryptoKeyEC::platformImportSpki):
1836         (WebCore::CryptoKeyEC::platformImportPkcs8):
1837         (WebCore::CryptoKeyEC::platformExportRaw const):
1838         (WebCore::CryptoKeyEC::platformAddFieldElements const):
1839         (WebCore::CryptoKeyEC::platformExportSpki const):
1840         (WebCore::CryptoKeyEC::platformExportPkcs8 const):
1841         (WebCore::CryptoKeyEC::~CryptoKeyEC): Deleted.
1842         * crypto/keys/CryptoKeyEC.cpp:
1843         (WebCore::CryptoKeyEC::CryptoKeyEC):
1844         * crypto/keys/CryptoKeyEC.h:
1845         (WebCore::CCECCryptorRefDeleter::operator() const):
1846         * crypto/mac/CryptoKeyECMac.cpp:
1847         (WebCore::CryptoKeyEC::keySizeInBits const):
1848         (WebCore::CryptoKeyEC::platformGeneratePair):
1849         (WebCore::CryptoKeyEC::platformImportRaw):
1850         (WebCore::CryptoKeyEC::platformExportRaw const):
1851         (WebCore::CryptoKeyEC::platformImportJWKPublic):
1852         (WebCore::CryptoKeyEC::platformImportJWKPrivate):
1853         (WebCore::CryptoKeyEC::platformAddFieldElements const):
1854         (WebCore::CryptoKeyEC::platformImportSpki):
1855         (WebCore::CryptoKeyEC::platformExportSpki const):
1856         (WebCore::CryptoKeyEC::platformImportPkcs8):
1857         (WebCore::CryptoKeyEC::platformExportPkcs8 const):
1858         (WebCore::CryptoKeyEC::~CryptoKeyEC): Deleted.
1859
1860 2019-01-07  Antti Koivisto  <antti@apple.com>
1861
1862         UI process side scrollbars for UI side compositing on Mac
1863         https://bugs.webkit.org/show_bug.cgi?id=193106
1864
1865         Reviewed by Tim Horton.
1866
1867         * page/FrameView.cpp:
1868         (WebCore::FrameView::paintScrollCorner):
1869         * page/scrolling/AsyncScrollingCoordinator.cpp:
1870         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1871
1872         Pass scrollbar host layers and the dark appearance bit to the scrolling tree.
1873
1874         * page/scrolling/ScrollingCoordinator.cpp:
1875         (WebCore::ScrollingCoordinator::verticalScrollbarLayerForFrameView):
1876         (WebCore::ScrollingCoordinator::horizontalScrollbarLayerForFrameView):
1877         * page/scrolling/ScrollingCoordinator.h:
1878         (WebCore::ScrollableAreaParameters::ScrollableAreaParameters):
1879         (WebCore::ScrollableAreaParameters::operator== const):
1880         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1881         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
1882         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarLayers):
1883         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1884         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1885         * page/scrolling/ScrollingTreeScrollingNode.h:
1886         (WebCore::ScrollingTreeScrollingNode::scrollableAreaSize const):
1887         (WebCore::ScrollingTreeScrollingNode::totalContentsSize const):
1888         (WebCore::ScrollingTreeScrollingNode::useDarkAppearanceForScrollbars const):
1889         (WebCore::ScrollingTreeScrollingNode::lastCommittedScrollPosition const):
1890         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1891         * platform/ScrollableArea.cpp:
1892         (WebCore::ScrollableArea::useDarkAppearanceForScrollbars const):
1893
1894         Factor into a function as this is used in several places.
1895
1896         * platform/ScrollableArea.h:
1897         * platform/mac/NSScrollerImpDetails.h:
1898         * platform/mac/ScrollAnimatorMac.mm:
1899         (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]):
1900         * platform/mac/ScrollbarThemeMac.h:
1901
1902 2019-01-07  Wenson Hsieh  <wenson_hsieh@apple.com>
1903
1904         Native caret shows up alongside the page's caret when requesting desktop site on jsfiddle.net
1905         https://bugs.webkit.org/show_bug.cgi?id=193180
1906         <rdar://problem/45971041>
1907
1908         Reviewed by Tim Horton.
1909
1910         Adjust a method on RenderObject to additionally detect when the RenderObject is inside of an `overflow: hidden`
1911         container that is also empty. See WebKit ChangeLog for more details.
1912
1913         Test:   editing/selection/ios/hide-selection-in-empty-overflow-hidden-container.html
1914                 editing/selection/ios/show-selection-in-empty-overflow-hidden-document.html
1915
1916         * rendering/RenderObject.cpp:
1917         (WebCore::RenderObject::isTransparentOrFullyClippedRespectingParentFrames const):
1918         (WebCore::RenderObject::isTransparentRespectingParentFrames const): Deleted.
1919         * rendering/RenderObject.h:
1920
1921 2019-01-07  Zalan Bujtas  <zalan@apple.com>
1922
1923         [LFC][BFC] Margin collapsing should not be limited to in-flow non-replaced boxes.
1924         https://bugs.webkit.org/show_bug.cgi?id=193183
1925
1926         Reviewed by Antti Koivisto.
1927
1928         * layout/FormattingContext.cpp:
1929         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1930         * layout/FormattingContextGeometry.cpp:
1931         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1932         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1933         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1934         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1935         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1936         * layout/LayoutUnits.h:
1937         * layout/blockformatting/BlockFormattingContext.cpp:
1938         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1939         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1940         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1941         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1942         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1943         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
1944         * layout/inlineformatting/InlineFormattingContext.cpp:
1945         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
1946
1947 2019-01-07  Zalan Bujtas  <zalan@apple.com>
1948
1949         [LFC][BFC] Move MarginCollapse from BlockFormattingContext::Geometry to BlockFormattingContext
1950         https://bugs.webkit.org/show_bug.cgi?id=193181
1951
1952         Reviewed by Antti Koivisto.
1953
1954         This is in preparation to share margin collapsing across all boxes in block formatting context.
1955
1956         * layout/blockformatting/BlockFormattingContext.h:
1957         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1958         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1959         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
1960         * layout/blockformatting/BlockMarginCollapse.cpp:
1961         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBefore):
1962         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginAfter):
1963         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBefore):
1964         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginAfter):
1965         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBeforeFromFirstChild):
1966         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginAfterFromLastChild):
1967         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
1968         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
1969         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
1970         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
1971         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
1972         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
1973         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSibling):
1974         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
1975         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBefore):
1976         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfter):
1977         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore): Deleted.
1978         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter): Deleted.
1979         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore): Deleted.
1980         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter): Deleted.
1981         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild): Deleted.
1982         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild): Deleted.
1983         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter): Deleted.
1984         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore): Deleted.
1985         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance): Deleted.
1986         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore): Deleted.
1987         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter): Deleted.
1988         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling): Deleted.
1989         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling): Deleted.
1990         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough): Deleted.
1991         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore): Deleted.
1992         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter): Deleted.
1993
1994 2019-01-07  Zan Dobersek  <zdobersek@igalia.com>
1995
1996         [WPE] Use Widget bounds for PlatformScreen rectangle information
1997         https://bugs.webkit.org/show_bug.cgi?id=193190
1998
1999         Reviewed by Philippe Normand.
2000
2001         Provide a better screen area estimate in screenRect() and
2002         screenAvailableRect() return values than the current 1240x640 value by
2003         using the Widget's bounds rectangle.
2004
2005         This approach is only factually correct when the Widget-associated view
2006         is displayed in fullscreen, but it provides a better estimate even when
2007         displayed in any other case as well. WPE doesn't provide specific API
2008         that could enable the embedding environment to provide this information.
2009
2010         * platform/wpe/PlatformScreenWPE.cpp:
2011         (WebCore::screenRect): Return bounds of the Widget object.
2012         (WebCore::screenAvailableRect): Relay the call to screenRect().
2013
2014 2019-01-07  Zan Dobersek  <zdobersek@igalia.com>
2015
2016         Make Gradient::gradientSpaceTransform(), Pattern::patternSpaceTransform() methods const
2017         https://bugs.webkit.org/show_bug.cgi?id=193189
2018
2019         Reviewed by Philippe Normand.
2020
2021         The transform getter methods on the Gradient and Pattern classes both
2022         return const references to the transform objects, and don't modify any
2023         internal state. They should be marked const accordingly, allowing
2024         invocations of these two methods through const references to Gradient
2025         and Pattern objects.
2026
2027         * platform/graphics/Gradient.h:
2028         (WebCore::Gradient::gradientSpaceTransform): Now const.
2029         * platform/graphics/Pattern.h:
2030         (WebCore::Pattern::patternSpaceTransform): Now const.
2031
2032 2019-01-07  Zan Dobersek  <zdobersek@igalia.com>
2033
2034         REGRESSION(r239636): ImageDecoder::setEncodedDataStatusChangeCallback() can be called on a null decoder
2035         https://bugs.webkit.org/show_bug.cgi?id=193187
2036
2037         Reviewed by Philippe Normand.
2038
2039         * platform/graphics/ImageSource.cpp:
2040         (WebCore::ImageSource::ensureDecoderAvailable): Bail before calling the
2041         setEncodedDataStatusChangeCallback() method when the returned
2042         ImageDecoder object is null.
2043
2044 2019-01-06  Zan Dobersek  <zdobersek@igalia.com>
2045
2046         [Nicosia] Take over CoordinatedGraphics-named implementation of async scrolling classes
2047         https://bugs.webkit.org/show_bug.cgi?id=193133
2048
2049         Reviewed by Michael Catanzaro.
2050
2051         Move the CoordinatedGraphics-specific files under
2052         page/scrolling/coordinatedgraphics/ to page/scrolling/nicosia/, along
2053         with renaming the files and classes accordingly. Implementation will
2054         only depend on the Nicosia-specific layer structure and is not specific
2055         to the CoordinatedGraphics system.
2056
2057         * PlatformPlayStation.cmake:
2058         * SourcesGTK.txt:
2059         * SourcesWPE.txt:
2060         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp.
2061         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h.
2062         * page/scrolling/nicosia/ScrollingStateNodeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp.
2063         * page/scrolling/nicosia/ScrollingTreeFixedNode.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp.
2064         * page/scrolling/nicosia/ScrollingTreeFixedNode.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h.
2065         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp.
2066         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h.
2067         * page/scrolling/nicosia/ScrollingTreeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp.
2068         * page/scrolling/nicosia/ScrollingTreeNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h.
2069         * page/scrolling/nicosia/ScrollingTreeStickyNode.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp.
2070         * page/scrolling/nicosia/ScrollingTreeStickyNode.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h.
2071         * platform/TextureMapper.cmake:
2072
2073 2019-01-06  Jiewen Tan  <jiewen_tan@apple.com>
2074
2075         [WebAuthN] Import U2F command/response converters from Chromium
2076         https://bugs.webkit.org/show_bug.cgi?id=193150
2077         <rdar://problem/47054028>
2078
2079         Reviewed by Brent Fulgham.
2080
2081         This patch imports Chromium's U2F command/response converters:
2082         https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-client-to-authenticator-protocol-v2.0-id-20180227.html#u2f-interoperability
2083         1. It directly imports the following files and suit them to WebKit's coding style:
2084         https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor.cc?l=1&rcl=db624110317d01efa78cd32e7be1524190e1beb0
2085         https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor.h?rcl=db624110317d01efa78cd32e7be1524190e1beb0
2086         https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor_unittest.cc?rcl=db624110317d01efa78cd32e7be1524190e1beb0
2087         2. It gathers the following methods into U2fResponseConverter:
2088         AuthenticatorMakeCredentialResponse::CreateFromU2fRegisterResponse()
2089         AuthenticatorGetAssertionResponse::CreateFromU2fSignResponse()
2090         3. It also updates FidoConstants.h, FidoTestData.h and CtapResponseTest.cpp accordingly.
2091
2092         Besides importing stuff from Chroimum, it also gathers a bunch of constants and helper functions into WebAuthenticationConstants.h
2093         and WebAuthenticationUtils.h. It also fixes Bug 183534: 2) and 7).
2094
2095         Covered by API tests.
2096
2097         * Modules/webauthn/AuthenticatorCoordinator.cpp:
2098         (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJsonHash):
2099         * Modules/webauthn/WebAuthenticationConstants.h: Copied from Source/WebCore/Modules/webauthn/COSEConstants.h.
2100         * Modules/webauthn/WebAuthenticationUtils.cpp: Added.
2101         (WebCore::convertBytesToVector):
2102         (WebCore::produceRpIdHash):
2103         (WebCore::encodeES256PublicKeyAsCBOR):
2104         (WebCore::buildAttestedCredentialData):
2105         (WebCore::buildAuthData):
2106         (WebCore::buildAttestationObject):
2107         * Modules/webauthn/WebAuthenticationUtils.h: Renamed from Source/WebCore/Modules/webauthn/COSEConstants.h.
2108         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
2109         (fido::getCredentialId):
2110         (fido::readCTAPGetInfoResponse):
2111         * Modules/webauthn/fido/FidoConstants.h:
2112         * Modules/webauthn/fido/U2fCommandConstructor.cpp: Added.
2113         (fido::WebCore::constructU2fRegisterCommand):
2114         (fido::WebCore::constructU2fSignCommand):
2115         (fido::isConvertibleToU2fRegisterCommand):
2116         (fido::isConvertibleToU2fSignCommand):
2117         (fido::convertToU2fRegisterCommand):
2118         (fido::convertToU2fCheckOnlySignCommand):
2119         (fido::convertToU2fSignCommand):
2120         (fido::constructBogusU2fRegistrationCommand):
2121         * Modules/webauthn/fido/U2fCommandConstructor.h: Added.
2122         * Modules/webauthn/fido/U2fResponseConverter.cpp: Added.
2123         (fido::WebCore::extractECPublicKeyFromU2fRegistrationResponse):
2124         (fido::WebCore::extractCredentialIdFromU2fRegistrationResponse):
2125         (fido::WebCore::createAttestedCredentialDataFromU2fRegisterResponse):
2126         (fido::WebCore::parseX509Length):
2127         (fido::WebCore::createFidoAttestationStatementFromU2fRegisterResponse):
2128         (fido::readU2fRegisterResponse):
2129         (fido::readFromU2fSignResponse):
2130         * Modules/webauthn/fido/U2fResponseConverter.h: Added.
2131         * Modules/webgpu/WebGPUCommandBuffer.cpp:
2132         * Sources.txt:
2133         * WebCore.xcodeproj/project.pbxproj:
2134
2135 2019-01-06  David Kilzer  <ddkilzer@apple.com>
2136
2137         Leak of WTF::Function objects in WebCore::CryptoKeyRSA::generatePair() (64-80 bytes each) in com.apple.WebKit.WebContent running WebKit layout tests
2138         <https://webkit.org/b/193177>
2139         <rdar://problem/47072196>
2140
2141         Reviewed by Saam Barati.
2142
2143         * crypto/mac/CryptoKeyRSAMac.cpp:
2144         (WebCore::CryptoKeyRSA::generatePair): Fix the leak by changing
2145         raw pointers to heap-allocated __block variables to hold the
2146         WTF::Function objects until they are consumed within the block
2147         passed to dispatch_async().  The __block variables act like
2148         captured variables in a C++ lambda and have the same lifetime as
2149         the block that they are captured in.  Note that we would have to
2150         convert the source file from C++ to Objective-C++ to use a C++
2151         lambda functor with dispatch_async(), which creates its own
2152         issue because the comipiler requires a copy constructor to
2153         convert the C++ lambda to a block functor, but the copy
2154         constructor for the C++ lambda is implicitly deleted because the
2155         WTF::Function copy constructor is explicitly deleted.  Whew!
2156
2157 2019-01-06  Pablo Saavedra  <psaavedra@igalia.com>
2158
2159         [WPE][GTK] Building with ENABLE_VIDEO=OFF fails trying to use Document MediaPlayback functions.
2160         https://bugs.webkit.org/show_bug.cgi?id=193174
2161
2162         Reviewed by Michael Catanzaro.
2163
2164         * page/Page.cpp:
2165         (WebCore::Page::stopAllMediaPlayback):
2166         (WebCore::Page::suspendAllMediaPlayback):
2167         (WebCore::Page::resumeAllMediaPlayback):
2168
2169 2019-01-05  David Kilzer  <ddkilzer@apple.com>
2170
2171         Leak of two CCRSACryptorRef (4.0 Kbytes/1 page each) in com.apple.WebKit.WebContent running WebKit layout tests
2172         <https://webkit.org/b/193154>
2173         <rdar://problem/47052993>
2174
2175         Reviewed by Brent Fulgham.
2176
2177         Broadly:
2178         - Fix leaks by switching from using raw pointers to using
2179           std::unique_ptr<>.
2180         - Introduce PlatformRSAKeyContainer type to handle different
2181           std::unique_ptr<> on each platform.
2182         - Get rid of custom CryptoKeyRSA destructors since the
2183           std::unique_ptr<> handles that with a Deleter.
2184         - Initialize stack variables to nullptr.
2185
2186         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
2187         (WebCore::CryptoKeyRSA::create):
2188         (WebCore::CryptoKeyRSA::CryptoKeyRSA):
2189         (WebCore::CryptoKeyRSA::keySizeInBits const):
2190         (WebCore::CryptoKeyRSA::generatePair):
2191         (WebCore::CryptoKeyRSA::importSpki):
2192         (WebCore::CryptoKeyRSA::importPkcs8):
2193         (WebCore::CryptoKeyRSA::exportSpki const):
2194         (WebCore::CryptoKeyRSA::exportPkcs8 const):
2195         (WebCore::CryptoKeyRSA::algorithm const):
2196         (WebCore::CryptoKeyRSA::exportData const):
2197         (WebCore::CryptoKeyRSA::~CryptoKeyRSA): Deleted.
2198         * crypto/keys/CryptoKeyRSA.h:
2199         (WebCore::CCRSACryptorRefDeleter::operator() const):
2200         * crypto/mac/CryptoKeyRSAMac.cpp:
2201         (WebCore::getPublicKeyComponents):
2202         (WebCore::getPrivateKeyComponents):
2203         (WebCore::CryptoKeyRSA::CryptoKeyRSA):
2204         (WebCore::CryptoKeyRSA::create):
2205         (WebCore::CryptoKeyRSA::exportData const):
2206         (WebCore::CryptoKeyRSA::generatePair):
2207         (WebCore::CryptoKeyRSA::importSpki):
2208         (WebCore::CryptoKeyRSA::importPkcs8):
2209         (WebCore::CryptoKeyRSA::~CryptoKeyRSA): Deleted.
2210
2211 2019-01-05  Zalan Bujtas  <zalan@apple.com>
2212
2213         Incorrect clipping across compositing boundary.
2214         https://bugs.webkit.org/show_bug.cgi?id=193172
2215         <rdar://problem/44693008>
2216
2217         Reviewed by Simon Fraser.
2218
2219         Use temporary cliprect type when crossing compositing boundary to prevent cliprect caching.
2220
2221         The issue here is that RenderLayer::backgroundClipRect() could cross compositing boundary by calling parentClipRects() which triggers
2222         clip rect update using the wrong painting root. This happens when the layer hierarchy and the compositing context do not match.
2223         For clip rect computation, we need to climb up on the layer hierarchy (calling parent layer's cliprect functions)
2224         but we also need to make sure that the computed cliprects on any given layer are cached only when the painting root is correct.
2225         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. 
2226
2227         Test: compositing/clipping/cached-cliprect-with-compositing-boundary.html
2228
2229         * rendering/RenderLayer.cpp:
2230         (WebCore::RenderLayer::calculateClipRects const):
2231
2232 2019-01-05  Youenn Fablet  <youenn@apple.com>
2233
2234         Service Worker fetch should obey its referrer policy
2235         https://bugs.webkit.org/show_bug.cgi?id=193152
2236
2237         Reviewed by Chris Dumez.
2238
2239         Pass referrer policy retrieved when fetching the service worker script to the SWServer.
2240         The SWServer then stores it persistently and sends it to the manager creating service workers.
2241         This manager will then set the referrer policy on the dummy Document of the corresponding service worker.
2242
2243         Covered by rebased test.
2244
2245         * workers/WorkerScriptLoader.cpp:
2246         (WebCore::WorkerScriptLoader::didReceiveResponse):
2247         * workers/WorkerScriptLoader.h:
2248         (WebCore::WorkerScriptLoader::referrerPolicy const):
2249         * workers/service/SWClientConnection.cpp:
2250         (WebCore::SWClientConnection::failedFetchingScript):
2251         * workers/service/ServiceWorkerContainer.cpp:
2252         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
2253         * workers/service/ServiceWorkerContainer.h:
2254         * workers/service/ServiceWorkerContextData.cpp:
2255         (WebCore::ServiceWorkerContextData::isolatedCopy const):
2256         * workers/service/ServiceWorkerContextData.h:
2257         (WebCore::ServiceWorkerContextData::encode const):
2258         (WebCore::ServiceWorkerContextData::decode):
2259         * workers/service/ServiceWorkerFetchResult.h:
2260         (WebCore::ServiceWorkerFetchResult::encode const):
2261         (WebCore::ServiceWorkerFetchResult::decode):
2262         * workers/service/ServiceWorkerJob.cpp:
2263         (WebCore::ServiceWorkerJob::notifyFinished):
2264         * workers/service/ServiceWorkerJobClient.h:
2265         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2266         (WebCore::createPageForServiceWorker):
2267         * workers/service/server/RegistrationDatabase.cpp:
2268         (WebCore::recordsTableSchema):
2269         (WebCore::RegistrationDatabase::doPushChanges):
2270         (WebCore::RegistrationDatabase::importRecords):
2271         * workers/service/server/SWServer.cpp:
2272         (WebCore::SWServer::addRegistrationFromStore):
2273         (WebCore::SWServer::updateWorker):
2274         (WebCore::SWServer::installContextData):
2275         * workers/service/server/SWServer.h:
2276         * workers/service/server/SWServerJobQueue.cpp:
2277         (WebCore::SWServerJobQueue::scriptFetchFinished):
2278         * workers/service/server/SWServerWorker.cpp:
2279         (WebCore::SWServerWorker::SWServerWorker):
2280         (WebCore::SWServerWorker::contextData const):
2281         * workers/service/server/SWServerWorker.h:
2282
2283 2019-01-04  Simon Fraser  <simon.fraser@apple.com>
2284
2285         Factor legacy WK1 code for fixed and scrolling layers into their own helper class
2286         https://bugs.webkit.org/show_bug.cgi?id=193165
2287
2288         Reviewed by Frédéric Wang.
2289
2290         RenderLayerCompositor has some code to handle registration of viewport-constrained
2291         and scrolling layers which is specific to iOS WK1. To reduce pollution, move this
2292         into its own helper class called LegacyWebKitScrollingLayerCoordinator, which is only
2293         allocated for iOS WK1.
2294         
2295         iOS WK1 never has a ScrollingCoordinator, so rather than the check for scrollingCoordinator(),
2296         we know that we only made a LegacyWebKitScrollingLayerCoordinator when there's a platform widget
2297         (i.e. WK1).
2298         
2299         * page/ChromeClient.h:
2300         * rendering/RenderLayerCompositor.cpp:
2301         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
2302         (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush):
2303         (WebCore::RenderLayerCompositor::didFlushChangesForLayer):
2304         (WebCore::RenderLayerCompositor::setIsInWindow):
2305         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking): No longer check the page cache state; now we
2306         destroy the render tree of pages in the page cache, so we should never hit this code path.
2307         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
2308         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
2309         (WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllViewportConstrainedLayers):
2310         (WebCore::scrollbarHasDisplayNone):
2311         (WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer):
2312         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllScrollingLayers):
2313         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerScrollingLayersNeedingUpdate):
2314         (WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllScrollingLayers):
2315         (WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
2316         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
2317         (WebCore::LegacyWebKitScrollingLayerCoordinator::didFlushChangesForLayer):
2318         (WebCore::updateScrollingLayerWithClient): Deleted.
2319         (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers): Deleted.
2320         (WebCore::RenderLayerCompositor::unregisterAllViewportConstrainedLayers): Deleted.
2321         (WebCore::RenderLayerCompositor::registerAllScrollingLayers): Deleted.
2322         (WebCore::RenderLayerCompositor::unregisterAllScrollingLayers): Deleted.
2323         * rendering/RenderLayerCompositor.h:
2324         (WebCore::LegacyWebKitScrollingLayerCoordinator::LegacyWebKitScrollingLayerCoordinator):
2325         * workers/service/ServiceWorkerContainer.cpp:
2326         (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer):
2327
2328 2019-01-05  Zalan Bujtas  <zalan@apple.com>
2329
2330         [LFC] VerticalMargin should only have the used values.
2331         https://bugs.webkit.org/show_bug.cgi?id=193168
2332
2333         Reviewed by Antti Koivisto.
2334
2335         Split VerticalMargin into ComputedVerticalMargin and UsedVerticalMargin.
2336         ComputedVerticalMargin holds the computed (optional) values while UsedVerticalMargin holds both the
2337         collapsed (optional) and the non-collapsed values.
2338
2339         * layout/FormattingContext.cpp:
2340         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
2341         * layout/FormattingContext.h:
2342         * layout/FormattingContextGeometry.cpp:
2343         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2344         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2345         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
2346         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
2347         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2348         (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin):
2349         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue): Deleted.
2350         * layout/FormattingContextQuirks.cpp:
2351         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
2352         * layout/LayoutUnits.h:
2353         * layout/MarginTypes.h:
2354         (WebCore::Layout::UsedVerticalMargin::before const):
2355         (WebCore::Layout::UsedVerticalMargin::after const):
2356         (WebCore::Layout::UsedVerticalMargin::nonCollapsedValues const):
2357         (WebCore::Layout::UsedVerticalMargin::collapsedValues const):
2358         (WebCore::Layout::UsedVerticalMargin::hasCollapsedValues const):
2359         (WebCore::Layout::UsedVerticalMargin::setCollapsedValues):
2360         (WebCore::Layout::UsedVerticalMargin::UsedVerticalMargin):
2361         (WebCore::Layout::VerticalMargin::nonCollapsedValues const): Deleted.
2362         (WebCore::Layout::VerticalMargin::collapsedValues const): Deleted.
2363         (WebCore::Layout::VerticalMargin::setCollapsedValues): Deleted.
2364         (WebCore::Layout::VerticalMargin::VerticalMargin): Deleted.
2365         (WebCore::Layout::VerticalMargin::usedValues const): Deleted.
2366         * layout/blockformatting/BlockFormattingContext.cpp:
2367         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2368         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2369         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2370         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2371         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
2372         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
2373         * layout/blockformatting/BlockMarginCollapse.cpp:
2374         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
2375         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
2376         * layout/displaytree/DisplayBox.h:
2377         (WebCore::Display::Box::setVerticalMargin):
2378         (WebCore::Display::Box::verticalMargin const):
2379         (WebCore::Display::Box::marginBefore const):
2380         (WebCore::Display::Box::marginAfter const):
2381         * layout/floats/FloatingContext.cpp:
2382         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
2383         * layout/inlineformatting/InlineFormattingContext.cpp:
2384         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
2385
2386 2019-01-04  Daniel Bates  <dabates@apple.com>
2387
2388         REGRESSION (r238522): Erratic scrolling on Google flights search result page and vrbo.com
2389         https://bugs.webkit.org/show_bug.cgi?id=192996
2390         <rdar://problem/46573552>
2391
2392         Reviewed by Simon Fraser.
2393
2394         Only scroll a text field if its inner text size changes and it is the currently active and
2395         focused element on the page.
2396
2397         Test: fast/scrolling/page-should-not-scroll-on-unfocused-text-field-layout.html
2398
2399         * rendering/RenderTextControlSingleLine.cpp:
2400         (WebCore::RenderTextControlSingleLine::layout):
2401
2402 2019-01-04  Alex Christensen  <achristensen@webkit.org>
2403
2404         Progress towards fixing Mac CMake build
2405         https://bugs.webkit.org/show_bug.cgi?id=193105
2406
2407         Reviewed by Don Olmstead.
2408
2409         * PlatformMac.cmake:
2410         * Sources.txt:
2411         * SourcesCocoa.txt:
2412         * WebCore.xcodeproj/project.pbxproj:
2413         * platform/graphics/gpu/GPURenderPassEncoder.h:
2414
2415 2019-01-04  Zalan Bujtas  <zalan@apple.com>
2416
2417         [iOS] ERROR: post-layout: dirty renderer(s) in WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker()
2418         https://bugs.webkit.org/show_bug.cgi?id=189608
2419         <rdar://problem/44473299>
2420
2421         Reviewed by Simon Fraser.
2422
2423         When a frameset/iframe is hidden and we skip layout, clear the dirty flag on its subtree as well.
2424
2425         Covered by fast/frames/invalid-frameset.html.
2426
2427         * rendering/RenderFrameSet.cpp:
2428         (WebCore::clearSiblingSubtrees):
2429         (WebCore::RenderFrameSet::positionFrames):
2430         (WebCore::RenderFrameSet::positionFramesWithFlattening):
2431
2432 2019-01-04  Youenn Fablet  <youenn@apple.com>
2433
2434         [Fetch API] Implement abortable fetch
2435         https://bugs.webkit.org/show_bug.cgi?id=174980
2436         <rdar://problem/46861402>
2437
2438         Reviewed by Chris Dumez.
2439
2440         Add an AbortSignal to FetchRequest.
2441
2442         Add support for AbortSignal algorithm.
2443         The fetch request signal is added an algorithm to abort the fetch.
2444         Update clone algorithm to let signal of the cloned request be following the origin request.
2445
2446         Update ReadableStream error handling to return an exception instead of a string.
2447         This allows passing an AbortError instead of a TypeError as previously done.
2448
2449         Update FetchBodyOwner to store a loading error either as an exception or as a resource error.
2450         The latter is used for passing the error from service worker back to the page.
2451         The former is used to pass it to ReadableStream or body accessors.
2452
2453         Covered by enabled tests.
2454
2455         * Modules/cache/DOMCache.cpp:
2456         (WebCore::DOMCache::put):
2457         * Modules/fetch/FetchBody.cpp:
2458         (WebCore::FetchBody::consumeAsStream):
2459         (WebCore::FetchBody::loadingFailed):
2460         * Modules/fetch/FetchBody.h:
2461         * Modules/fetch/FetchBodyConsumer.cpp:
2462         (WebCore::FetchBodyConsumer::loadingFailed):
2463         * Modules/fetch/FetchBodyConsumer.h:
2464         * Modules/fetch/FetchBodyOwner.cpp:
2465         (WebCore::FetchBodyOwner::arrayBuffer):
2466         (WebCore::FetchBodyOwner::blob):
2467         (WebCore::FetchBodyOwner::cloneBody):
2468         (WebCore::FetchBodyOwner::formData):
2469         (WebCore::FetchBodyOwner::json):
2470         (WebCore::FetchBodyOwner::text):
2471         (WebCore::FetchBodyOwner::loadBlob):
2472         (WebCore::FetchBodyOwner::blobLoadingFailed):
2473         (WebCore::FetchBodyOwner::consumeBodyAsStream):
2474         (WebCore::FetchBodyOwner::setLoadingError):
2475         * Modules/fetch/FetchBodyOwner.h:
2476         (WebCore::FetchBodyOwner::loadingError const):
2477         (WebCore::FetchBodyOwner::loadingException const):
2478         * Modules/fetch/FetchBodySource.cpp:
2479         (WebCore::FetchBodySource::error):
2480         * Modules/fetch/FetchBodySource.h:
2481         * Modules/fetch/FetchRequest.cpp:
2482         (WebCore::FetchRequest::initializeWith):
2483         (WebCore::FetchRequest::clone):
2484         * Modules/fetch/FetchRequest.h:
2485         (WebCore::FetchRequest::FetchRequest):
2486         * Modules/fetch/FetchRequest.idl:
2487         * Modules/fetch/FetchRequestInit.h:
2488         (WebCore::FetchRequestInit::hasMembers const):
2489         * Modules/fetch/FetchRequestInit.idl:
2490         * Modules/fetch/FetchResponse.cpp:
2491         (WebCore::FetchResponse::clone):
2492         (WebCore::FetchResponse::fetch):
2493         (WebCore::FetchResponse::BodyLoader::didFail):
2494         * Modules/fetch/FetchResponse.h:
2495         * bindings/js/ReadableStreamDefaultController.h:
2496         (WebCore::ReadableStreamDefaultController::error):
2497         * dom/AbortSignal.cpp:
2498         (WebCore::AbortSignal::abort):
2499         (WebCore::AbortSignal::follow):
2500         * dom/AbortSignal.h:
2501
2502 2019-01-04  Brent Fulgham  <bfulgham@apple.com>
2503
2504         Parsed protocol of javascript URLs with embedded newlines and carriage returns do not match parsed protocol in Chrome and Firefox
2505         https://bugs.webkit.org/show_bug.cgi?id=193155
2506         <rdar://problem/40230982>
2507
2508         Reviewed by Chris Dumez.
2509
2510         Test: fast/loader/comment-only-javascript-url.html
2511
2512         Make a special case for URLs beginning with 'javascript:'. We should always
2513         treat these as JS URLs, even if the content contained within the URL
2514         string might match other parts of the URL parsing spec.
2515
2516         * html/URLUtils.h:
2517         (WebCore::URLUtils<T>::protocol const):
2518
2519 2019-01-04  Jer Noble  <jer.noble@apple.com>
2520
2521         [WebKitLegacy] Media playback pauses on scroll
2522         https://bugs.webkit.org/show_bug.cgi?id=192829
2523
2524         Reviewed by Eric Carlson.
2525
2526         New API tests:
2527             WebKitLegacy.ScrollingDoesNotPauseMedia
2528             WKWebView.StopAllMediaPlayback
2529             WKWebView.SuspendResumeAllMediaPlayback
2530
2531         Do not use suspendActiveDOMObjects(ReasonForSuspension::PageWillBeSuspended) to pause
2532         video. Roll back the changes to HTMLMediaElement, and introduce a new set of Page calls
2533         suspendAllMediaPlayback() & resumeAllMediaPlayback() which replaces the removed bahavior.
2534
2535         * dom/Document.cpp:
2536         (WebCore::Document::~Document):
2537         (WebCore::Document::stopAllMediaPlayback):
2538         (WebCore::Document::suspendAllMediaPlayback):
2539         (WebCore::Document::resumeAllMediaPlayback):
2540         * dom/Document.h:
2541         * html/HTMLMediaElement.cpp:
2542         (WebCore::HTMLMediaElement::HTMLMediaElement):
2543         (WebCore::HTMLMediaElement::parseAttribute):
2544         (WebCore::HTMLMediaElement::didFinishInsertingNode):
2545         (WebCore::HTMLMediaElement::setSrcObject):
2546         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
2547         (WebCore::HTMLMediaElement::suspend):
2548         (WebCore::HTMLMediaElement::resume):
2549         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const):
2550         * html/HTMLMediaElement.h:
2551         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const): Deleted.
2552         * html/MediaElementSession.cpp:
2553         (WebCore::MediaElementSession::playbackPermitted const):
2554         * page/Page.cpp:
2555         (WebCore::Page::stopAllMediaPlayback):
2556         (WebCore::Page::suspendAllMediaPlayback):
2557         (WebCore::Page::resumeAllMediaPlayback):
2558         * page/Page.h:
2559         (WebCore::Page::mediaPlaybackIsSuspended):
2560         * platform/audio/PlatformMediaSession.h:
2561         * platform/audio/PlatformMediaSessionManager.cpp:
2562         (WebCore::PlatformMediaSessionManager::suspendAllMediaPlaybackForDocument):
2563         (WebCore::PlatformMediaSessionManager::resumeAllMediaPlaybackForDocument):
2564         * platform/audio/PlatformMediaSessionManager.h:
2565
2566 2019-01-04  Chris Dumez  <cdumez@apple.com>
2567
2568         Add support for toggling device orientation API support per site
2569         https://bugs.webkit.org/show_bug.cgi?id=193143
2570         <rdar://problem/46605724>
2571
2572         Reviewed by Alex Christensen.
2573
2574         Add support for toggling device orientation API support per site via _WKWebsitePolicies.
2575
2576         * dom/Document.cpp:
2577         (WebCore::Document::simulateDeviceOrientationChange):
2578         * dom/Document.h:
2579         * loader/DocumentLoader.h:
2580         (WebCore::DocumentLoader::deviceOrientationEventEnabled const):
2581         (WebCore::DocumentLoader::setDeviceOrientationEventEnabled):
2582         * page/DOMWindow.cpp:
2583         (WebCore::DOMWindow::addEventListener):
2584
2585 2019-01-04  Jer Noble  <jer.noble@apple.com>
2586
2587         Web Content process main thread blocked beneath ImageDecoderAVFObjC::readSamples for many seconds on imgur.com
2588         https://bugs.webkit.org/show_bug.cgi?id=191806
2589         <rdar://problem/46151477>
2590
2591         Reviewed by Dean Jackson.
2592
2593         Test: http/tests/images/mp4-partial-load.html
2594
2595         Rather than use an AVAssetReaderTrackOutput, which will load both sample metadata and sample data
2596         synchronously when a sample is requested, use AVAssetReaderSampleReferenceOutput, which only loads
2597         sample metadata, including the byte offset and byte length of the sample data. By waiting until the
2598         AVAsset signals that it's own metadata is loaded, we can safely parse all the sample metadata without
2599         blocking on network loads. Once enough data is loaded, we can replace the byte reference and offset
2600         attachements in the sample with actual data, and mark the sample as "complete".
2601
2602         Because the existing ImageSource assumes that image data parsing will occur synchronously, and that
2603         synchronous parsing could cause a hang if the metadata is not loaded, add a new callback method which
2604         allows the ImageSource to be notified when the encodedDataStatus changes. The ImageSource notifies the
2605         CacheImage, which notifies the RenderImage, and thus the asynchronous parsing will kick off the
2606         renderer's animation loop.
2607
2608         * loader/cache/CachedImage.cpp:
2609         (WebCore::CachedImage::CachedImageObserver::encodedDataStatusChanged):
2610         (WebCore::CachedImage::encodedDataStatusChanged):
2611         * loader/cache/CachedImage.h:
2612         * platform/graphics/ImageDecoder.h:
2613         (WebCore::ImageDecoder::setEncodedDataStatusChangeCallback):
2614         * platform/graphics/ImageObserver.h:
2615         (WebCore::ImageObserver::encodedDataStatusChanged):
2616         * platform/graphics/ImageSource.cpp:
2617         (WebCore::ImageSource::ensureDecoderAvailable):
2618         (WebCore::ImageSource::encodedDataStatusChanged):
2619         (WebCore::ImageSource::frameDecodingStatusAtIndex):
2620         * platform/graphics/ImageSource.h:
2621         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
2622         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
2623         (-[WebCoreSharedBufferResourceLoaderDelegate data]):
2624         (WebCore::ImageDecoderAVFObjCSample::byteRange const):
2625         (WebCore::ImageDecoderAVFObjC::readSamples):
2626         (WebCore::ImageDecoderAVFObjC::setEncodedDataStatusChangeCallback):
2627         (WebCore::ImageDecoderAVFObjC::encodedDataStatus const):
2628         (WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const):
2629         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
2630         (WebCore::ImageDecoderAVFObjC::sampleIsComplete const):
2631
2632 2019-01-04  Youenn Fablet  <youenn@apple.com>
2633
2634         CSP violation reports should bypass CSP checks
2635         https://bugs.webkit.org/show_bug.cgi?id=192857
2636         <rdar://problem/46887236>
2637
2638         Reviewed by Chris Dumez.
2639
2640         For ping loads, pass the option to do CSP checks from PingLoader to LoaderStrategy.
2641         This new option is unused by WebKit Legacy.
2642         It is used by WebKit loader strategy to only send any CSP response header to network process
2643         in case CSP checks should be done.
2644
2645         This option is used to disable CSP checks for Ping Loads that report CSP violations.
2646
2647         Test: http/wpt/fetch/csp-reports-bypass-csp-checks.html
2648
2649         * loader/LoaderStrategy.h:
2650         * loader/PingLoader.cpp:
2651         (WebCore::PingLoader::loadImage):
2652         (WebCore::PingLoader::sendPing):
2653         (WebCore::PingLoader::sendViolationReport):
2654         (WebCore::PingLoader::startPingLoad):
2655         * loader/PingLoader.h:
2656         * loader/cache/CachedResource.cpp:
2657         (WebCore::CachedResource::load):
2658
2659 2019-01-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2660
2661         [Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function
2662         https://bugs.webkit.org/show_bug.cgi?id=193129
2663
2664         Reviewed by Tim Horton.
2665
2666         Adds a new helper function that returns the undo/redo name for a given EditAction. No change in behavior.
2667
2668         * Sources.txt:
2669         * WebCore.xcodeproj/project.pbxproj:
2670         * editing/EditAction.cpp: Copied from Source/WebKit/UIProcess/WebEditCommandProxy.cpp.
2671         (WebCore::nameForUndoRedo):
2672         * editing/EditAction.h:
2673         * editing/Editor.cpp:
2674
2675 2019-01-03  Matt Rajca  <mrajca@apple.com>
2676
2677         Make DidPlayMediaPreventedFromPlaying autoplay event more generic.
2678         https://bugs.webkit.org/show_bug.cgi?id=193128
2679         rdar://34554231
2680
2681         Reviewed by Jer Noble.
2682
2683         Today, the "DidPlayMediaPreventedFromPlaying" autoplay event is only sent for
2684         media prevented from autoplaying. It could be generalized to a "DidPlayMediaWithUserGesture"
2685         event along with a flag that indicates whether or not autoplay was actually prevented.
2686         Moreover, we can include a flag that indicates whether the media element in question
2687         is main content. Clients will then know in more cases when media was played with a user
2688         gesture, whether or not it has audio, as well as its main content status. While the main
2689         content heuristics may not be perfect, they covered the top 20 video-centric websites that
2690         this was tested with and are meant to be used by clients for data evaluation purposes.
2691
2692         As part of this, the PlaybackWithoutUserGesture enum was renamed to AutoplayEventPlaybackState
2693         since it now also applies to cases where there is a user gesture. The
2694         `m_playbackWithoutUserGestureStartedTime` member variable was also removed in favor of
2695         `playbackStartedTime` which also covers all the cases we care about.
2696
2697         Tests: existing API tests were updated to reflect the new names. New API tests
2698         were added for the new case in which the "DidPlayMediaWithUserGesture" event is sent.
2699
2700         * html/HTMLMediaElement.cpp:
2701         (WebCore::convertEnumerationToString): Update to new enum cases.
2702         (WebCore::HTMLMediaElement::setReadyState): Ditto.
2703         (WebCore::HTMLMediaElement::play): Ditto.
2704         (WebCore::HTMLMediaElement::playInternal): Also cover the case where
2705          playback was not prevented but there was a user gesture.
2706         (WebCore::HTMLMediaElement::pauseInternal): Use new name.
2707         (WebCore::HTMLMediaElement::setVolume): Use new name.
2708         (WebCore::HTMLMediaElement::playbackProgressTimerFired): Dispatch the
2709          DidPlayMediaWithUserGesture event when playback was started with a user
2710          gesture as well.
2711         (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Use new name.
2712         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Ditto.
2713         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto.
2714         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto.
2715         (WebCore::HTMLMediaElement::handleAutoplayEvent): Pass along new media state.
2716         (WebCore::HTMLMediaElement::userDidInterfereWithAutoplay): Use new name.
2717         (WebCore::HTMLMediaElement::setAutoplayEventPlaybackState): Stop setting
2718          m_playbackWithoutUserGestureStartedTime in favor of using playbackStartedTime.
2719         (WebCore::HTMLMediaElement::updateShouldPlay): Use new name.
2720         (WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture): Renamed.
2721         * html/HTMLMediaElement.h:
2722         (WTF::LogArgument<WebCore::HTMLMediaElement::AutoplayEventPlaybackState>::toString): Renamed from...
2723         (WTF::LogArgument<WebCore::HTMLMediaElement::PlaybackWithoutUserGesture>::toString):
2724         * html/MediaElementSession.cpp:
2725         (WebCore::MediaElementSession::isMainContentForPurposesOfAutoplayEvents const): Don't
2726          do the hit testing check for the purposes of autoplay events. It seems to fail on the
2727          basic Vimeo player due to overlapping divs.
2728         (WebCore::isElementMainContentForPurposesOfAutoplay):
2729         (WebCore::MediaElementSession::updateIsMainContent const): Keep the existing behavior
2730          here of hit testing.
2731         (WebCore::isMainContentForPurposesOfAutoplay): Renamed.
2732         * html/MediaElementSession.h:
2733         * page/AutoplayEvent.h:
2734
2735 2019-01-04  Youenn Fablet  <youenn@apple.com>
2736
2737         Crash in WebCore::ServiceWorkerGlobalScope
2738         https://bugs.webkit.org/show_bug.cgi?id=192513
2739         <rdar://problem/46563880>
2740
2741         Reviewed by Alex Christensen.
2742
2743         Store the identifier in its own variable to make sure we do not use workerThread after being moved.
2744
2745         * workers/service/ServiceWorkerGlobalScope.cpp:
2746         (WebCore::ServiceWorkerGlobalScope::skipWaiting):
2747
2748 2019-01-04  Chris Fleizach  <cfleizach@apple.com>
2749
2750         AX: String check: "Rule" does not reflect the meaning of the <hr> html tag
2751         https://bugs.webkit.org/show_bug.cgi?id=193041
2752         <rdar://problem/46954090>
2753
2754         Reviewed by Zalan Bujtas.
2755
2756         * en.lproj/Localizable.strings:
2757         * platform/cocoa/LocalizedStringsCocoa.mm:
2758         (WebCore::AXHorizontalRuleDescriptionText):
2759
2760 2019-01-04  Zalan Bujtas  <zalan@apple.com>
2761
2762         [LFC] ComputedHorizontalMargin should have optional members
2763         https://bugs.webkit.org/show_bug.cgi?id=193131
2764
2765         Reviewed by Antti Koivisto.
2766
2767         Split HorizontalMargin into UsedHorizontalMargin and ComputedHorizontalMargin. ComputedHorizontalMargin's members are optional.
2768         (see computed vs used values)
2769
2770         * layout/FormattingContext.h:
2771         * layout/FormattingContextGeometry.cpp:
2772         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2773         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2774         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
2775         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
2776         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2777         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
2778         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue): Deleted.
2779         * layout/LayoutUnits.h:
2780         * layout/MarginTypes.h:
2781         * layout/Verification.cpp:
2782         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
2783         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2784         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2785         * layout/displaytree/DisplayBox.h:
2786         (WebCore::Display::Box::setHorizontalMargin):
2787         (WebCore::Display::Box::setHorizontalComputedMargin):
2788         (WebCore::Display::Box::computedMarginStart const):
2789         (WebCore::Display::Box::computedMarginEnd const):
2790         * layout/floats/FloatAvoider.h:
2791         (WebCore::Layout::FloatAvoider::marginStart const):
2792         (WebCore::Layout::FloatAvoider::marginEnd const):
2793         * layout/inlineformatting/InlineFormattingContext.cpp:
2794         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2795         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2796         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
2797
2798 2019-01-04  Zalan Bujtas  <zalan@apple.com>
2799
2800         [LFC][BFC] Use computedValue and usedValue consistently
2801         https://bugs.webkit.org/show_bug.cgi?id=193059
2802
2803         Reviewed by Antti Koivisto.
2804
2805         https://www.w3.org/TR/CSS22/cascade.html#value-stages
2806
2807         6.1.2 Computed values
2808         Specified values are resolved to computed values during the cascade; for example URIs are made absolute and 'em' and 'ex' units
2809         are computed to pixel or absolute lengths. Computing a value never requires the user agent to render the document...
2810
2811         6.1.3 Used values
2812         Computed values are processed as far as possible without formatting the document. Some values, however, can only be determined when the document
2813         is being laid out. For example, if the width of an element is set to be a certain percentage of its containing block, the width cannot be determined
2814         until the width of the containing block has been determined. The used value is the result of taking the computed value and resolving any remaining
2815         dependencies into an absolute value.
2816
2817         * layout/FormattingContext.cpp:
2818         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
2819         * layout/FormattingContextGeometry.cpp:
2820         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2821         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2822         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2823         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
2824         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2825         * layout/LayoutState.cpp:
2826         (WebCore::Layout::LayoutState::LayoutState):
2827         * layout/LayoutUnits.h:
2828         * layout/Verification.cpp:
2829         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
2830         * layout/blockformatting/BlockFormattingContext.cpp:
2831         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
2832         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2833         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2834         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
2835         * layout/displaytree/DisplayBox.cpp:
2836         (WebCore::Display::Box::Box):
2837         * layout/displaytree/DisplayBox.h:
2838         (WebCore::Display::Box::setHasValidHorizontalComputedMargin):
2839         (WebCore::Display::Box::setHorizontalComputedMargin):
2840         (WebCore::Display::Box::computedMarginStart const):
2841         (WebCore::Display::Box::computedMarginEnd const):
2842         (WebCore::Display::Box::setHasValidHorizontalNonComputedMargin): Deleted.
2843         (WebCore::Display::Box::setHorizontalNonComputedMargin): Deleted.
2844         (WebCore::Display::Box::nonComputedMarginStart const): Deleted.
2845         (WebCore::Display::Box::nonComputedMarginEnd const): Deleted.
2846         * layout/floats/FloatAvoider.h:
2847         (WebCore::Layout::FloatAvoider::marginStart const):
2848         (WebCore::Layout::FloatAvoider::marginEnd const):
2849         * layout/inlineformatting/InlineFormattingContext.cpp:
2850         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
2851
2852 2019-01-03  Zalan Bujtas  <zalan@apple.com>
2853
2854         REGRESSION: -webkit-appearance test case crashes
2855         https://bugs.webkit.org/show_bug.cgi?id=189302
2856         <rdar://problem/44143049>
2857
2858         Reviewed by Wenson Hsieh.
2859
2860         The painting and the layout positions of the cancel button need to match in order to be able to interact with it.
2861         This patch removes the previous position inlining attempts.
2862
2863         Test: fast/forms/webkit-appearance-searchfield-cancel-button-crash.html
2864
2865         * rendering/RenderThemeMac.mm:
2866         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
2867
2868 2019-01-03  David Kilzer  <ddkilzer@apple.com>
2869
2870         Leak of WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback (48 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
2871         <https://webkit.org/b/193122>
2872         <rdar://problem/47022987>
2873
2874         Reviewed by Youenn Fablet.
2875
2876         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
2877         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::AddRef const):
2878         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::Release const):
2879         - Remove `final` keyword so that
2880           `new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()`
2881           can be called.
2882         (WebCore::LibWebRTCCertificateGenerator::generateCertificate):
2883         - To fix the leak call
2884           `new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()`
2885           to create the object.
2886
2887 2019-01-03  Simon Fraser  <simon.fraser@apple.com>
2888
2889         REGRESSION (r238090): After showing the Find banner or tab bar, hit tests are vertically offset (or painting is not offset)
2890         https://bugs.webkit.org/show_bug.cgi?id=193124
2891         rdar://problem/46755409
2892
2893         Reviewed by Tim Horton.
2894
2895         Top content inset feeds into scrolling tree geometry, so when it changes we need to trigger
2896         an update of the root scrolling node, which happens via RenderLayerBacking::updateGeometry().
2897         So set a dirty bit on the root layer in frameViewDidChangeSize(), which is called from the code
2898         path that runs when top content inset changes.
2899
2900         Find banner behavior is not easily testable. platform/mac/fast/events/content-inset-hit-testing.html did not detect the regression.
2901
2902         * rendering/RenderLayerCompositor.cpp:
2903         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
2904
2905 2019-01-03  Chris Dumez  <cdumez@apple.com>
2906
2907         Potential infinite recursion in isFrameFamiliarWith(Frame&, Frame&)
2908         https://bugs.webkit.org/show_bug.cgi?id=192997
2909         <rdar://problem/46217271>
2910
2911         Reviewed by Antti Koivisto.
2912
2913         isFrameFamiliarWith(Frame&, Frame&) was called recursively using the passed frames' openers.
2914         The issue is that a Frame can be its opener. There could also be a cycle in the opener chain.
2915
2916         To address the issue, simplify isFrameFamiliarWith() so that it is no longer recursive. We now
2917         only check if the frames belong to the same pages or if their openers do. We no longer check
2918         openers' opener and up.
2919
2920         Note that this function is used to check if a frame is allowed to target another. In practice,
2921         it is unlikely to be useful to navigate an opener's opener and an openee's openee.
2922
2923         Tests: fast/dom/Window/window-open-opener-cycle.html
2924                fast/dom/Window/window-open-self-as-opener.html
2925
2926         * page/FrameTree.cpp:
2927         (WebCore::isFrameFamiliarWith):
2928
2929 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
2930
2931         REGRESSION (r239306): Don't disable font smoothing in transparent layers on macOS Mojave and later
2932         https://bugs.webkit.org/show_bug.cgi?id=193095
2933         <rdar://problem/47014944>
2934
2935         Reviewed by Zalan Bujtas.
2936         
2937         In r239306 we stopped making CALayers for font-smoothed text when not necessary on macOS Mojave
2938         and later. However, we still turned off smoothing for non-opaque layers (setShouldSmoothFonts(false)),
2939         which continues to affect the appearance of text.
2940         
2941         Fix by only calling setShouldSmoothFonts(false) when the OS supports font smoothing.
2942
2943         Test: compositing/contents-format/subpixel-antialiased-text.html
2944
2945         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2946         (WebCore::PlatformCALayer::drawLayerContents):
2947
2948 2019-01-02  David Kilzer  <ddkilzer@apple.com>
2949
2950         Leak of CMSampleBuffer (752 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
2951         <https://webkit.org/b/193016>
2952         <rdar://problem/46925703>
2953
2954         Reviewed by Simon Fraser.
2955
2956         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
2957         (WebCore::copySampleBufferWithCurrentTimeStamp):
2958         - Change to return RetainPtr<CMSampleBufferRef>.
2959         - Check return value of CMSampleBufferCreateCopyWithNewTiming().
2960         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
2961         - Check return value of copySampleBufferWithCurrentTimeStamp().
2962         - Fix leak by using RetainPtr<CMSampleBufferRef> returned from
2963           copySampleBufferWithCurrentTimeStamp() instead of leaking
2964           `bufferWithCurrentTime` by using retainPtr().
2965         (WebCore::createAudioFormatDescription):
2966         - Extract method from appendAudioSampleBuffer() to return
2967           RetainPtr<CMFormatDescriptionRef> after calling
2968           CMAudioFormatDescriptionCreate().
2969         - Check return value of CMAudioFormatDescriptionCreate().
2970         (WebCore::createAudioSampleBufferWithPacketDescriptions):
2971         - Extract method from appendAudioSampleBuffer() to return
2972           RetainPtr<CMSampleBufferRef> after calling
2973           CMAudioSampleBufferCreateWithPacketDescriptions().
2974         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
2975         - Check return values of createAudioFormatDescription() and
2976           createAudioSampleBufferWithPacketDescriptions().
2977         - Fix leaks by extracting code into helper methods that return
2978           RetainPtr<> objects instead of leaking CMFormatDescriptionRef
2979           directly or leaking `sampleBuffer` by using retainPtr().
2980
2981 2019-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2982
2983         Add support for using the current text selection as the find string on iOS
2984         https://bugs.webkit.org/show_bug.cgi?id=193034
2985         <rdar://problem/45138739>
2986
2987         Reviewed by Tim Horton.
2988
2989         Add support for "TakeFindStringFromSelection" on iOS. Unlike macOS, iOS does not have a notion of a "find
2990         pasteboard" like macOS; instead, we handle this editing command by sending the selection string to the UI
2991         process, where it is exposed via WebKit SPI so that clients that present find-in-page UI (i.e. MobileSafari) are
2992         able to trigger find-in-page with this string.
2993
2994         Test: WebKit.UseSelectionAsFindString
2995
2996         * editing/Editor.cpp:
2997         (WebCore::Editor::canCopyExcludingStandaloneImages const):
2998
2999         Make this helper function cross-platform.
3000
3001         * editing/Editor.h:
3002         * editing/EditorCommand.cpp:
3003         (WebCore::createCommandMap):
3004         * editing/cocoa/EditorCocoa.mm:
3005         (WebCore::Editor::takeFindStringFromSelection):
3006
3007         Move this from EditorMac to EditorCocoa, and implement it on iOS by calling into the editor client to update the
3008         find string (see WebKit/ChangeLog for more details).
3009
3010         * editing/mac/EditorMac.mm:
3011         (WebCore::Editor::canCopyExcludingStandaloneImages): Deleted.
3012         (WebCore::Editor::takeFindStringFromSelection): Deleted.
3013         * loader/EmptyClients.cpp:
3014         * page/EditorClient.h:
3015
3016         Add a new editor client method to send the string for find-in-page to the UI process.
3017
3018 2019-01-02  Devin Rousso  <webkit@devinrousso.com>
3019
3020         Web Inspector: Implement `queryObjects` Command Line API
3021         https://bugs.webkit.org/show_bug.cgi?id=176766
3022         <rdar://problem/34890689>
3023
3024         Reviewed by Joseph Pecoraro.
3025
3026         Test: inspector/console/queryObjects.html
3027
3028         * inspector/CommandLineAPIModuleSource.js:
3029         (CommandLineAPI):
3030         (CommandLineAPIImpl.prototype.queryObjects): Added.
3031
3032 2019-01-02  Charles Vazac  <cvazac@gmail.com>
3033
3034         Fix resourcetimingbufferfull bubbles attribute
3035         https://bugs.webkit.org/show_bug.cgi?id=193087
3036
3037         Reviewed by Chris Dumez.
3038
3039         This change is covered by web-platform-tests [1].
3040
3041         [1] https://github.com/web-platform-tests/wpt/blob/master/resource-timing/buffer-full-when-populate-entries.html#L20
3042
3043         * page/Performance.cpp:
3044         (WebCore::Performance::resourceTimingBufferFullTimerFired):
3045
3046 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
3047
3048         Rename LayerScrollCoordinationRole to ScrollCoordinationRole and make an enum class
3049         https://bugs.webkit.org/show_bug.cgi?id=193010
3050
3051         Reviewed by Zalan Bujtas.
3052
3053         Move the enum LayerScrollCoordinationRole from RenderLayer.h to RenderLayerCompositor.h,
3054         and make it an enum class.
3055
3056         * page/FrameView.cpp:
3057         (WebCore::FrameView::scrollLayerID const):
3058         * rendering/RenderLayer.h:
3059         * rendering/RenderLayerBacking.cpp:
3060         (WebCore::RenderLayerBacking::~RenderLayerBacking):
3061         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
3062         (WebCore::operator<<):
3063         * rendering/RenderLayerBacking.h:
3064         * rendering/RenderLayerCompositor.cpp:
3065         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
3066         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
3067         (WebCore::scrollCoordinationRoleForNodeType):
3068         (WebCore::RenderLayerCompositor::attachScrollingNode):
3069         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
3070         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
3071         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
3072         * rendering/RenderLayerCompositor.h:
3073
3074 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
3075
3076         Don't spin up a CalcParser if the current token is not a function token
3077         https://bugs.webkit.org/show_bug.cgi?id=193067
3078
3079         Reviewed by Zalan Bujtas.
3080
3081         Various functions in CSSPropertyParserHelpers fall back to trying to parse
3082         a calc expression if the normal parsing fails. Don't do this unless the
3083         current token is a function token, which should be slightly more efficient.
3084
3085         * css/parser/CSSPropertyParserHelpers.cpp:
3086         (WebCore::CSSPropertyParserHelpers::consumeInteger):
3087         (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
3088         (WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
3089         (WebCore::CSSPropertyParserHelpers::consumeNumber):
3090         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
3091         (WebCore::CSSPropertyParserHelpers::consumeLength):
3092         (WebCore::CSSPropertyParserHelpers::consumePercent):
3093         (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
3094         (WebCore::CSSPropertyParserHelpers::consumeAngle):
3095         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
3096         (WebCore::CSSPropertyParserHelpers::consumeTime):
3097
3098 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
3099
3100         Support css-color-4 rgb functions
3101         https://bugs.webkit.org/show_bug.cgi?id=192321
3102
3103         Reviewed by Zalan Bujtas.
3104         
3105         Support the new rgb()/rgba() syntax described in https://drafts.csswg.org/css-color/#rgb-functions.
3106         The differences are:
3107         1. There is a new comma-free syntax, where the optional alpha is separated by a slash:
3108             rgb(128 34 56)
3109             rgb(128 34 56 / 50%)
3110         2. Floating point values are allowed, and rounded:
3111             rgb(128.5 34.2 56.5) becomes rgb(129 34 57)
3112         3. rgba() is a pure alias for rgb(), so these are equivalent:
3113             rgb(128 34 56 / 50%)
3114             rgba(128 34 56 / 50%)
3115             
3116         hsl()/hsla() parsing was already updated to this new syntax in r230861.
3117
3118         Tested by tests in imported/w3c/web-platform-tests/css/css-color/
3119
3120         * css/parser/CSSPropertyParserHelpers.cpp:
3121         (WebCore::CSSPropertyParserHelpers::clampRGBComponent):
3122         (WebCore::CSSPropertyParserHelpers::parseRGBParameters):
3123         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
3124
3125 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
3126
3127         Handle calc() expressions in gradient color stops
3128         https://bugs.webkit.org/show_bug.cgi?id=193066
3129         rdar://problem/46961985
3130
3131         Reviewed by Sam Weinig.
3132         
3133         Fix two issues that prevented calc() expressions from working in conic-gradient color stops,
3134         for the angle or percent value. First, consumeAngleOrPercent() needs to look for CalculationCategory::Percent
3135         calc values as well as angle ones.
3136
3137         Second, CSSPrimitiveValue::isAngle() needs to use primitiveType() (which takes calc into account),
3138         just as isPx() etc do.
3139
3140         Test: fast/gradients/conic-calc-stop-position.html
3141
3142         * css/CSSPrimitiveValue.h:
3143         (WebCore::CSSPrimitiveValue::isAngle const):
3144         * css/parser/CSSPropertyParserHelpers.cpp:
3145         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
3146         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
3147
3148 2018-12-31  Keith Miller  <keith_miller@apple.com>
3149
3150         SourceProviders should use an actual URL instead of a string
3151         https://bugs.webkit.org/show_bug.cgi?id=192734
3152
3153         Reviewed by Yusuke Suzuki.
3154
3155         Remove ScriptSourceCode's URL member and make the url() method
3156         reference the URL on the SourceProvider. Also, avoid some
3157         ref count churn.
3158
3159         Additionally, this patch fixes an existing bug in
3160         WorkletGlobalScope() that would use a ScriptSourceCode after
3161         WTFMoving it.
3162
3163         * bindings/js/CachedScriptSourceProvider.h:
3164         (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
3165         * bindings/js/ScheduledAction.cpp:
3166         (WebCore::ScheduledAction::execute):
3167         * bindings/js/ScriptController.cpp:
3168         (WebCore::ScriptController::executeScriptInWorld):
3169         (WebCore::ScriptController::executeScript):
3170         * bindings/js/ScriptSourceCode.h:
3171         (WebCore::ScriptSourceCode::ScriptSourceCode):
3172         (WebCore::ScriptSourceCode::m_code):
3173         (WebCore::ScriptSourceCode::url const):
3174         (WebCore::ScriptSourceCode::m_url): Deleted.
3175         * dom/ScriptElement.cpp:
3176         (WebCore::ScriptElement::prepareScript):
3177         (WebCore::ScriptElement::requestModuleScript):
3178         (WebCore::ScriptElement::executePendingScript):
3179         * html/HTMLMediaElement.cpp:
3180         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
3181         * page/Frame.cpp:
3182         (WebCore::Frame::injectUserScriptImmediately):
3183         * workers/WorkerGlobalScope.cpp:
3184         (WebCore::WorkerGlobalScope::importScripts):
3185         * workers/WorkerThread.cpp:
3186         (WebCore::WorkerThread::workerThread):
3187         * worklets/WorkletGlobalScope.cpp:
3188         (WebCore::WorkletGlobalScope::WorkletGlobalScope):
3189         * xml/parser/XMLDocumentParserLibxml2.cpp:
3190         (WebCore::XMLDocumentParser::endElementNs):
3191
3192 2019-01-01  Jeff Miller  <jeffm@apple.com>
3193
3194         Update user-visible copyright strings to include 2019
3195         https://bugs.webkit.org/show_bug.cgi?id=192811
3196
3197         Reviewed by Mark Lam.
3198
3199         * Info.plist:
3200
3201 2018-12-30  David Kilzer  <ddkilzer@apple.com>
3202
3203         clang-tidy: Save 8 padding bytes on WebCore::BorderEdge
3204         <https://webkit.org/b/193058>
3205         <rdar://problem/46979275>
3206
3207         Reviewed by Yusuke Suzuki.
3208
3209         * rendering/BorderEdge.cpp:
3210         (WebCore::BorderEdge::BorderEdge): Reorder initialization to
3211         match new instance variable order.
3212         * rendering/BorderEdge.h: Reorder instance variables to save
3213         8 padding bytes.
3214
3215 2018-12-28  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3216
3217         [JSC] Remove one indirection in JSObject::toStringName
3218         https://bugs.webkit.org/show_bug.cgi?id=193037
3219
3220         Reviewed by Keith Miller.
3221
3222         Use old JSObject::toStringName function here.
3223
3224         * bindings/js/JSDOMConstructorBase.cpp:
3225         (WebCore::JSDOMConstructorBase::className):
3226         (WebCore::JSDOMConstructorBase::toStringName):
3227         * bindings/js/JSDOMConstructorBase.h:
3228         (WebCore::JSDOMConstructorBase::className): Deleted.
3229
3230 2018-12-27  Alex Christensen  <achristensen@webkit.org>
3231
3232         Resurrect Mac CMake build
3233         https://bugs.webkit.org/show_bug.cgi?id=192658
3234
3235         Reviewed by Yusuke Suzuki.
3236
3237         This makes it so JSC and most of WebCore builds.
3238         WebCore's use of ARC seems inconsistent, so I'll fix that later.
3239
3240         * PlatformMac.cmake:
3241         * config.h:
3242
3243 2018-12-26  Jim Mason  <jmason@ibinx.com>
3244
3245         [FreeType] Restore conditional compilation logic for recent HarfBuzz refactoring
3246         https://bugs.webkit.org/show_bug.cgi?id=193036
3247
3248         Reviewed by Michael Catanzaro.
3249
3250         * platform/graphics/FontPlatformData.h:
3251         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
3252
3253 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
3254
3255         Remove "using namespace std;"
3256         https://bugs.webkit.org/show_bug.cgi?id=192973
3257         <rdar://problem/46937309>
3258
3259         Unreviewed Windows port Debug builds fix.
3260
3261         No new tests since no behavior changes.
3262
3263         * accessibility/win/AXObjectCacheWin.cpp:
3264         (WebCore::AXObjectCache::postPlatformNotification): Add "std::" prefix to numeric_limits in ASSERT macro.
3265
3266 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
3267
3268         Remove "using namespace std;"
3269         https://bugs.webkit.org/show_bug.cgi?id=192973
3270
3271         Reviewed by Alex Christensen.
3272
3273         Removed "using namespace std" statement, and use std:: prefix.
3274
3275         No new tests since no behavior changes.
3276
3277         * accessibility/win/AXObjectCacheWin.cpp:
3278         * platform/graphics/GraphicsContext3DPrivate.cpp:
3279         * platform/graphics/cairo/ImageBufferCairo.cpp:
3280         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
3281         * platform/graphics/win/FontWin.cpp:
3282         (WebCore::FontCascade::floatWidthForComplexText const):
3283         * platform/graphics/win/GraphicsContextCGWin.cpp:
3284         * platform/graphics/win/GraphicsContextCairoWin.cpp:
3285         * platform/graphics/win/GraphicsContextDirect2D.cpp:
3286         * platform/graphics/win/GraphicsContextWin.cpp:
3287         * platform/graphics/win/SimpleFontDataCGWin.cpp:
3288         * platform/graphics/win/UniscribeController.cpp:
3289         (WebCore::UniscribeController::UniscribeController):
3290         (WebCore::UniscribeController::shapeAndPlaceItem):
3291         * platform/image-decoders/ScalableImageDecoder.cpp:
3292         * platform/text/LocaleICU.cpp:
3293         * platform/text/win/LocaleWin.cpp:
3294         * platform/win/ScrollbarThemeWin.cpp:
3295         * rendering/RenderRubyRun.cpp:
3296         (WebCore::RenderRubyRun::layoutBlock):
3297         * rendering/RenderThemeWin.cpp:
3298         (WebCore::RenderThemeWin::adjustMenuListButtonStyle const):
3299         (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
3300         (WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle const):
3301         (WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle const):
3302         (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
3303         (WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle const):
3304         (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
3305
3306 2018-12-24  Simon Fraser  <simon.fraser@apple.com>
3307
3308         Change ScrollingNodeType to an enum class
3309         https://bugs.webkit.org/show_bug.cgi?id=193009
3310
3311         Reviewed by Zalan Bujtas.
3312
3313         Change the ScrollingNodeType enum to an enum class.
3314         
3315         No behavior change.
3316
3317         * page/scrolling/AsyncScrollingCoordinator.cpp:
3318         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
3319         * page/scrolling/ScrollingCoordinator.cpp:
3320         (WebCore::operator<<):
3321         * page/scrolling/ScrollingCoordinator.h:
3322         * page/scrolling/ScrollingStateFixedNode.cpp:
3323         (WebCore::ScrollingStateFixedNode::ScrollingStateFixedNode):
3324         * page/scrolling/ScrollingStateNode.h:
3325         (WebCore::ScrollingStateNode::isFixedNode const):
3326         (WebCore::ScrollingStateNode::isStickyNode const):
3327         (WebCore::ScrollingStateNode::isFrameScrollingNode const):
3328         (WebCore::ScrollingStateNode::isOverflowScrollingNode const):
3329         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
3330         (WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
3331         * page/scrolling/ScrollingStateStickyNode.cpp:
3332         (WebCore::ScrollingStateStickyNode::ScrollingStateStickyNode):
3333         * page/scrolling/ScrollingStateTree.cpp:
3334         (WebCore::ScrollingStateTree::createNode):
3335         (WebCore::ScrollingStateTree::attachNode):
3336         * page/scrolling/ScrollingTreeNode.h:
3337         (WebCore::ScrollingTreeNode::isFixedNode const):
3338         (WebCore::ScrollingTreeNode::isStickyNode const):
3339         (WebCore::ScrollingTreeNode::isFrameScrollingNode const):
3340         (WebCore::ScrollingTreeNode::isOverflowScrollingNode const):
3341         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
3342         (WebCore::ScrollingTreeOverflowScrollingNode::ScrollingTreeOverflowScrollingNode):
3343         * page/sc