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