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