[macOS,iOS] Add always-on logging for AVPlayerTimeControlStatus changes
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-05-23  Eric Carlson  <eric.carlson@apple.com>
2
3         [macOS,iOS] Add always-on logging for AVPlayerTimeControlStatus changes
4         https://bugs.webkit.org/show_bug.cgi?id=197946
5         <rdar://problem/50627457>
6
7         Reviewed by Jon Lee.
8
9         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
10         (WebCore::convertEnumerationToString):
11         (WTF::LogArgument<AVPlayerTimeControlStatus>::toString):
12         (WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange):
13
14 2019-05-23  Antoine Quint  <graouts@apple.com>
15
16         [Pointer Events] Compatibility mouse events can only be prevented while the pointer is pressed
17         https://bugs.webkit.org/show_bug.cgi?id=198178
18
19         Reviewed by Dean Jackson.
20
21         Test: pointerevents/mouse/compatibility-mouse-events-prevention-mouse-released.html
22
23         The Pointer Events spec, in https://www.w3.org/TR/pointerevents/#compatibility-mapping-with-mouse-events, says that "Mouse events
24         can only be prevented when the pointer is down. Hovering pointers (e.g. a mouse with no buttons pressed) cannot have their mouse
25         events prevented." We now track whether the pointer is pressed and clear the preventsCompatibilityMouseEvents when the pointer is
26         moved and it is not pressed.
27
28         * page/PointerCaptureController.cpp:
29         (WebCore::PointerCaptureController::pointerEventWasDispatched):
30         * page/PointerCaptureController.h:
31
32 2019-05-23  Simon Fraser  <simon.fraser@apple.com>
33
34         Build fix after r245695.
35
36         * dom/Element.cpp:
37
38 2019-05-23  Antoine Quint  <graouts@apple.com>
39
40         [Pointer Events] The mouseover, mouseout, mouseenter, and mouseleave events should not be prevented while the pointer is down
41         https://bugs.webkit.org/show_bug.cgi?id=198177
42
43         Reviewed by Dean Jackson.
44
45         Test: pointerevents/mouse/compatibility-mouse-events-prevention-mouse-pressed.html
46
47         The Pointer Event spec, in https://www.w3.org/TR/pointerevents/#compatibility-mapping-with-mouse-events, says that "the mouseover,
48         mouseout, mouseenter, and mouseleave events are never prevented (even if the pointer is down)." We add a new static function which
49         indicates what is "compatibility" mouse event since those should be excluded, along with "click", which we already excluded.
50
51         * dom/Element.cpp:
52         (WebCore::isCompatibilityMouseEvent):
53         (WebCore::Element::dispatchMouseEvent):
54
55 2019-05-23  Jon Davis  <jond@apple.com>
56
57         Update feature status for shipped features
58         https://bugs.webkit.org/show_bug.cgi?id=196783
59
60         Reviewed by Timothy Hatcher.
61         
62         Updated feature status for Beacon API, CSS Text Decoration Level 4, Intersection Observer,
63         Conic Gradients, Datalist Element, and Web Share.
64
65         * features.json:
66
67 2019-05-23  Simon Fraser  <simon.fraser@apple.com>
68
69         Create scrolling tree nodes for descendants of position:absolute inside stacking-context overflow
70         https://bugs.webkit.org/show_bug.cgi?id=198154
71
72         Reviewed by Antti Koivisto.
73         
74         There exists code that creates scrolling tree nodes for position:absolute when the containing block
75         chain skips an enclosing scroller, but the compositing ancestor tree includes the scroller. However
76         this code explicitly checked that the layer was position:absolute.
77
78         This needed to be generalized for any layer whose containing block ancestor chain includes
79         a position:absolute that skips the scroller, for example a transformed inside a position:absolute,
80         so remove an explicit isAbsolutelyPositioned() check and some similar assertions.
81
82         Test: scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow.html
83
84         * rendering/RenderLayerCompositor.cpp:
85         (WebCore::collectStationaryLayerRelatedOverflowNodes):
86         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
87         (WebCore::collectRelatedCoordinatedScrollingNodes):
88
89 2019-05-23  Adrian Perez de Castro  <aperez@igalia.com>
90
91         Fix a few missing header inclusions often masked by by unified sources
92         https://bugs.webkit.org/show_bug.cgi?id=198180
93
94         Reviewed by Eric Carlson.
95
96         * editing/markup.h: Add missing "FloatSize.h" inclusion.
97         * html/FeaturePolicy.cpp: Add missing "HTMLParserIdioms.h" inclusion.
98         * platform/text/TextCodec.cpp: Add missing <cstdio> inclusion.
99
100 2019-05-23  Myles C. Maxfield  <mmaxfield@apple.com>
101
102         [WHLSL] Implement property resolver
103         https://bugs.webkit.org/show_bug.cgi?id=195925
104         <rdar://problem/48219643>
105
106         Reviewed by Saam Barati and Robin Morisset.
107
108         The property resolver is the thing that replaces dot expressions, index expressions, and
109         read-modify-write expressions with calls to getters, setters, and anders. This patch doesn't
110         fully implement the property resolver, but implements enough for simple dot expressions to
111         work. This is enough for us to be able to test most of the rest of the compiler. Index
112         expressions and read-modify-write expressions are not fully included in this patch, and will
113         be finished in a follow-up patch.
114
115         The property resolver may introduce anonymous variables in various places. In order to do
116         this, after the property resolver runs, it will insert all these anonymous variables in the
117         beginning of the function. However, this means that entries in the VariableDeclarations
118         vector will all shift, which means VariableDeclarations have to be allocated on the heap so
119         backreferences to them stay valid. This patch moves the storage associated with these values
120         to living directly in the vector's storage to living in heap storage (via filling the vector
121         with UniqueRefs).
122
123         This patch also adds the third concept of value-ness. We now have right values, left values,
124         and abstract left values (for things which have setters but have no address). This addition
125         is required for the analysis the property resolver performs. This concept is also present in
126         the spec.
127
128         Test: webgpu/whlsl-dot-expressions.html
129
130         * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h:
131         (WebCore::WHLSL::AST::TypeAnnotation::TypeAnnotation):
132         (WebCore::WHLSL::AST::TypeAnnotation::leftAddressSpace const):
133         (WebCore::WHLSL::AST::TypeAnnotation::isRightValue const):
134         (WebCore::WHLSL::AST::TypeAnnotation::visit):
135         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
136         (WebCore::WHLSL::AST::AssignmentExpression::takeRight):
137         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
138         * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
139         * Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h:
140         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
141         (WebCore::WHLSL::AST::Expression::maybeResolvedType):
142         (WebCore::WHLSL::AST::Expression::resolvedType):
143         (WebCore::WHLSL::AST::Expression::maybeTypeAnnotation const):
144         (WebCore::WHLSL::AST::Expression::typeAnnotation const):
145         (WebCore::WHLSL::AST::Expression::setTypeAnnotation):
146         (WebCore::WHLSL::AST::Expression::addressSpace const): Deleted.
147         (WebCore::WHLSL::AST::Expression::setAddressSpace): Deleted.
148         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
149         (WebCore::WHLSL::AST::FloatLiteral::clone const):
150         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
151         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.cpp:
152         (WebCore::WHLSL::AST::IntegerLiteral::valueForSelectedType const):
153         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
154         (WebCore::WHLSL::AST::IntegerLiteral::clone const):
155         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
156         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::MakeArrayReferenceExpression):
157         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::leftValue):
158         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::lValue): Deleted.
159         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
160         (WebCore::WHLSL::AST::MakePointerExpression::MakePointerExpression):
161         (WebCore::WHLSL::AST::MakePointerExpression::leftValue):
162         (WebCore::WHLSL::AST::MakePointerExpression::lValue): Deleted.
163         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
164         (WebCore::WHLSL::AST::NullLiteral::clone const):
165         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
166         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleGetterOverloads):
167         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleSetterOverloads):
168         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleAnderOverloads):
169         (WebCore::WHLSL::AST::PropertyAccessExpression::getterFunction):
170         (WebCore::WHLSL::AST::PropertyAccessExpression::anderFunction):
171         (WebCore::WHLSL::AST::PropertyAccessExpression::threadAnderFunction):
172         (WebCore::WHLSL::AST::PropertyAccessExpression::setterFunction):
173         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleGetterOverloads):
174         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleAnderOverloads):
175         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleSetterOverloads):
176         (WebCore::WHLSL::AST::PropertyAccessExpression::setGetterFunction):
177         (WebCore::WHLSL::AST::PropertyAccessExpression::setAnderFunction):
178         (WebCore::WHLSL::AST::PropertyAccessExpression::setThreadAnderFunction):
179         (WebCore::WHLSL::AST::PropertyAccessExpression::setSetterFunction):
180         (WebCore::WHLSL::AST::PropertyAccessExpression::takeBase):
181         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleGetOverloads): Deleted.
182         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleSetOverloads): Deleted.
183         (WebCore::WHLSL::AST::PropertyAccessExpression::possibleAndOverloads): Deleted.
184         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleGetOverloads): Deleted.
185         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleSetOverloads): Deleted.
186         (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleAndOverloads): Deleted.
187         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
188         (WebCore::WHLSL::AST::ReadModifyWriteExpression::oldVariableReference):
189         (WebCore::WHLSL::AST::ReadModifyWriteExpression::newVariableReference):
190         (WebCore::WHLSL::AST::ReadModifyWriteExpression::leftValue):
191         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeLeftValue):
192         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeOldValue):
193         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeNewValue):
194         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeNewValueExpression):
195         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeResultExpression):
196         (WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression):
197         (WebCore::WHLSL::AST::ReadModifyWriteExpression::lValue): Deleted.
198         * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h:
199         (WebCore::WHLSL::AST::ResolvableType::maybeResolvedType const):
200         (WebCore::WHLSL::AST::ResolvableType::resolvedType const):
201         (WebCore::WHLSL::AST::ResolvableType::maybeResolvedType):
202         (WebCore::WHLSL::AST::ResolvableType::resolvedType):
203         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
204         (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
205         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
206         (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableType const):
207         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
208         (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableType const):
209         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
210         (WebCore::WHLSL::AST::StructureDefinition::find):
211         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
212         (WebCore::WHLSL::AST::TypeReference::maybeResolvedType const):
213         (WebCore::WHLSL::AST::TypeReference::resolvedType const):
214         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.cpp:
215         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::valueForSelectedType const):
216         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
217         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::clone const):
218         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
219         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h:
220         (WebCore::WHLSL::AST::VariableDeclarationsStatement::VariableDeclarationsStatement):
221         (WebCore::WHLSL::AST::VariableDeclarationsStatement::variableDeclarations):
222         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
223         (WebCore::WHLSL::Metal::attributeForSemantic):
224         (WebCore::WHLSL::Metal::EntryPointScaffolding::mangledInputPath):
225         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns):
226         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes):
227         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::unpack):
228         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
229         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::visit):
230         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
231         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
232         (WebCore::WHLSL::Metal::writeNativeFunction):
233         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
234         (WebCore::WHLSL::Metal::writeNativeType):
235         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
236         (WebCore::WHLSL::Metal::findInVector):
237         (WebCore::WHLSL::Metal::TypeNamer::visit):
238         (WebCore::WHLSL::Metal::TypeNamer::createNameNode):
239         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
240         (WebCore::WHLSL::ASTDumper::visit):
241         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
242         (WebCore::WHLSL::checkDuplicateFunctions):
243         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
244         (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
245         (WebCore::WHLSL::resolveWithOperatorLength):
246         (WebCore::WHLSL::resolveWithReferenceComparator):
247         (WebCore::WHLSL::resolveByInstantiation):
248         (WebCore::WHLSL::checkOperatorOverload):
249         (WebCore::WHLSL::Checker::assignTypes):
250         (WebCore::WHLSL::commit):
251         (WebCore::WHLSL::Checker::visit):
252         (WebCore::WHLSL::Checker::recurseAndGetInfo):
253         (WebCore::WHLSL::Checker::getInfo):
254         (WebCore::WHLSL::Checker::assignType):
255         (WebCore::WHLSL::Checker::forwardType):
256         (WebCore::WHLSL::getUnnamedType):
257         (WebCore::WHLSL::Checker::finishVisitingPropertyAccess): Deleted.
258         (WebCore::WHLSL::Checker::recurseAndWrapBaseType): Deleted.
259         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
260         (WebCore::WHLSL::Gatherer::takeEntryPointItems):
261         (WebCore::WHLSL::Gatherer::visit):
262         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
263         (WebCore::WHLSL::matchAndCommit):
264         (WebCore::WHLSL::commit):
265         (WebCore::WHLSL::inferTypesForCall):
266         * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp:
267         (WebCore::WHLSL::getNativeTypeDeclaration):
268         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
269         (WebCore::WHLSL::NameResolver::visit):
270         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
271         (WebCore::WHLSL::Parser::parseParameters):
272         (WebCore::WHLSL::Parser::parseVariableDeclarations):
273         * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h:
274         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
275         (WebCore::WHLSL::prepareShared):
276         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
277         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp: Added.
278         (WebCore::WHLSL::PropertyResolver::visit):
279         (WebCore::WHLSL::setterCall):
280         (WebCore::WHLSL::getterCall):
281         (WebCore::WHLSL::modify):
282         (WebCore::WHLSL::PropertyResolver::simplifyRightValue):
283         (WebCore::WHLSL::LeftValueSimplifier::visit):
284         (WebCore::WHLSL::PropertyResolver::simplifyLeftValue):
285         (WebCore::WHLSL::resolveProperties):
286         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h.
287         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
288         (WebCore::WHLSL::RecursiveTypeChecker::visit):
289         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
290         (WebCore::WHLSL::conversionCost):
291         * Modules/webgpu/WHLSL/WHLSLResolvingType.h:
292         (WebCore::WHLSL::ResolvingType::getUnnamedType):
293         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
294         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
295         (WebCore::WHLSL::FindArrayTypes::takeArrayTypes):
296         (WebCore::WHLSL::synthesizeArrayOperatorLength):
297         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
298         (WebCore::WHLSL::FindAllTypes::takeUnnamedTypes):
299         (WebCore::WHLSL::FindAllTypes::takeNamedTypes):
300         (WebCore::WHLSL::synthesizeConstructors):
301         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
302         (WebCore::WHLSL::synthesizeEnumerationFunctions):
303         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
304         (WebCore::WHLSL::synthesizeStructureAccessors):
305         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
306         (WebCore::WHLSL::Visitor::visit):
307         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
308         * Sources.txt:
309         * WebCore.xcodeproj/project.pbxproj:
310         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
311         (WebCore::trySetWHLSLFunctionsForPipelineDescriptor):
312
313 2019-05-22  Myles C. Maxfield  <mmaxfield@apple.com>
314
315         font-optical-sizing applies the wrong variation value
316         https://bugs.webkit.org/show_bug.cgi?id=197528
317         <rdar://problem/50152854>
318
319         Reviewed by Antti Koivisto.
320
321         The OpenType spec says in
322         https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxistag_opsz
323
324         "Scale interpretation: Values can be interpreted as text size, in points."
325
326         It turns out that it means "typographic point size" which is equal to CSS pixels, not
327         CSS points.
328
329         There are two parts of the font that are sensitive to optical sizing: variation values and
330         the trak table. We don't want to set the variation value directly because then the trak table
331         won't be affected. Instead, we can use kCTFontOpticalSizeAttribute to set both of them together.
332         We will only do this when the CSS says text-rendering:optimizeLegibility or when the font has
333         an opsz axis but no STAT table. Otherwise, we won't do anything special, which lets CoreText
334         handle the default behavior for us. This gives us the same default behavior as the rest of the
335         system.
336
337         Tests: fast/text/variations/optical-sizing-trak-2.html
338                fast/text/variations/optical-sizing-trak.html
339                fast/text/variations/optical-sizing-units-2.html
340                fast/text/variations/optical-sizing-units.html
341
342         * platform/graphics/cocoa/FontCacheCoreText.cpp:
343         (WebCore::FontType::FontType):
344         (WebCore::preparePlatformFont):
345         (WebCore::fontWithFamily):
346         (WebCore::FontCache::systemFallbackForCharacters):
347         * platform/graphics/cocoa/FontCacheCoreText.h:
348         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
349         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
350         * platform/graphics/mac/FontCustomPlatformData.cpp:
351         (WebCore::FontCustomPlatformData::fontPlatformData):
352
353 2019-05-22  Antti Koivisto  <antti@apple.com>
354
355         Subselectors not searched when determining property whitelist for selector
356         https://bugs.webkit.org/show_bug.cgi?id=198147
357         <rdar://problem/50405208>
358
359         Reviewed by Zalan Bujtas.
360
361         This can cause marker elements get style they shouldn't.
362
363         Test: fast/lists/marker-style-subselector-whitelist.html
364
365         * css/RuleSet.cpp:
366         (WebCore::determinePropertyWhitelistType):
367
368         Check subselectors too.
369
370 2019-05-22  Saam barati  <sbarati@apple.com>
371
372         WHLSL: fix enum parsing
373         https://bugs.webkit.org/show_bug.cgi?id=198087
374
375         Reviewed by Myles Maxfield.
376
377         This fixes two bugs:
378         
379         1. We were using a String by reference after moving the underlying owner of
380         the string. This would lead to the String becoming the empty value, and
381         crashing when used as a key in a hash map.
382         2. We were incorrectly producing a syntax error for enum declarations by
383         saying it's invalid if an enum value was added to a hash map for the first
384         time. This logic should be negated. We need to error when it's added for
385         the second time and onwards.
386
387         Test: webgpu/whlsl-dont-crash-parsing-enum.html
388
389         * Modules/webgpu/WHLSL/AST/WHLSLAST.h: Replaced.
390         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
391         (WebCore::WHLSL::AST::EnumerationDefinition::add):
392         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
393         (WebCore::WHLSL::AST::EnumerationMember::name):
394         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: Replaced.
395         (WebCore::WHLSL::ASTDumper::visit):
396         * Modules/webgpu/WHLSL/WHLSLASTDumper.h: Replaced.
397
398 2019-05-22  Simon Fraser  <simon.fraser@apple.com>
399
400         Fix scrolling tree state for more obscure combinations of positioning and paint order
401         https://bugs.webkit.org/show_bug.cgi?id=198139
402
403         Reviewed by Antti Koivisto.
404
405         There were three places in RenderLayerCompositor that used a version of ancestor
406         layer traversal looking at containing blocks, and all three had issues. So make a
407         shared function to do the ancestor walk, and use it thrice.
408
409         isScrolledByOverflowScrollLayer() fumbled containingBlockCanSkipLayers, so failed
410         to create a scrolling tree node for a composited layer inside position:fixed in
411         overflow (tested by composited-in-absolute-in-overflow.html).
412
413         collectStationaryLayerRelatedOverflowNodes() failed to handle nested
414         overflow:scroll; it needs to find all the composited scrollers that affect the
415         position of the given layer relative to its compositing ancestor, which may be the
416         scroller, or a descendant of the scroller. However, it didn't walk up far enough
417         and find more that one ancestor. Tested by absolute-in-nested-sc-scrollers.html.
418
419         enclosingClippingScopes() was OK but now uses the share function.
420
421         Tests: scrollingcoordinator/scrolling-tree/absolute-in-nested-sc-scrollers.html
422                scrollingcoordinator/scrolling-tree/composited-in-absolute-in-overflow.html
423
424         * rendering/RenderLayerCompositor.cpp:
425         (WebCore::traverseAncestorLayers):
426         (WebCore::enclosingClippingScopes):
427         (WebCore::isScrolledByOverflowScrollLayer):
428         (WebCore::collectStationaryLayerRelatedOverflowNodes):
429         (WebCore::collectRelatedCoordinatedScrollingNodes):
430
431 2019-05-22  Simon Fraser  <simon.fraser@apple.com>
432
433         Inner scroller of nested overflow:scrolls jitters when scrolling
434         https://bugs.webkit.org/show_bug.cgi?id=198131
435
436         Reviewed by Antti Koivisto.
437
438         enclosingCompositedScrollingLayer(layer) would return the layer itself, rather than
439         its scrolling ancestor, which meant that a composited scroller nested inside another
440         scroller would fail to get a "Moves" scrolling tree node, and therefore jitter
441         when scrolling.
442
443         Test: scrollingcoordinator/scrolling-tree/nested-overflow-scroll.html
444
445         * rendering/RenderLayerCompositor.cpp:
446         (WebCore::enclosingCompositedScrollingLayer):
447
448 2019-05-22  Ryan Haddad  <ryanhaddad@apple.com>
449
450         Unreviewed, rolling out r245598.
451
452         Breaks watchOS build.
453
454         Reverted changeset:
455
456         "font-optical-sizing applies the wrong variation value"
457         https://bugs.webkit.org/show_bug.cgi?id=197528
458         https://trac.webkit.org/changeset/245598
459
460 2019-05-22  Daniel Bates  <dabates@apple.com>
461
462         WebKit does not generate an ESC key event for CMD+.
463         https://bugs.webkit.org/show_bug.cgi?id=198137
464         <rdar://problem/51038641>
465
466         Reviewed by Brent Fulgham.
467
468         This patch maps the Command + '.' keystroke to the 'Escape'. This also requires a change to UIKit to properly pass
469         the key state to WebKit (see <rdar://problem/46431552>).
470
471         * platform/ios/WebEvent.mm:
472         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
473
474 2019-05-22  Ali Juma  <ajuma@chromium.org>
475
476         Intersection Observer: bounding client rect is wrong for an inline element
477         https://bugs.webkit.org/show_bug.cgi?id=198009
478
479         Reviewed by Simon Fraser.
480
481         Make target rect computation for inline elements share logic with the computation
482         of bounding client rects.
483
484         Test: imported/w3c/web-platform-tests/intersection-observer/inline-with-block-child-client-rect.html
485
486         * dom/Document.cpp:
487         (WebCore::computeIntersectionState):
488         * dom/Element.cpp:
489         (WebCore::Element::boundingAbsoluteRectWithoutLayout):
490         (WebCore::Element::boundingClientRect):
491         * dom/Element.h:
492
493 2019-05-22  Antoine Quint  <graouts@apple.com>
494
495         [iOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown
496         https://bugs.webkit.org/show_bug.cgi?id=198124
497         <rdar://problem/50410863>
498
499         Reviewed by Tim Horton.
500
501         This fix builds atop the one made for wkb.ug/198072 which fixes this bug on macOS alone.
502
503         In order to correctly prevent "compatibility" mouse events from being dispatched when the initial "pointerdown" event had preventDefault()
504         called while handled, we need to pass the PointerID for the touch that triggered a tap gesture in the UI process down in the Web process
505         and into the resulting PlatformMouseEvent. This will allow upon dispatch of a PlatformMouseEvent to call into PointerCaptureController
506         to identify if the dispatch of mouse events is allowed for the event's PointerID.
507
508         To support this, some refactoring was required. The PointerID header is now under platform/ such that PlatformMouseEvent may safely use it.
509         Additionally, PointerEvent::defaultMousePointerIdentifier() is now a global mousePointerID defined in PointerID.h.
510
511         Finally, PointerCaptureController::touchEndedOrWasCancelledForIdentifier() has been renamed to PointerCaptureController::touchWithIdentifierWasRemoved() and
512         has WEBCORE_EXPORT such that it may be called from WebKit as the indication that a pointer is no longer active will now be initiated in WebKit
513         on the UI process side.
514
515         Testing is covered by the pre-existing imported/w3c/web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_click.html
516         which will now run on iOS through a change to WebKitAdditions.
517
518         * Headers.cmake:
519         * WebCore.xcodeproj/project.pbxproj:
520         * dom/Element.cpp:
521         (WebCore::Element::dispatchMouseEvent): When dealing with a mouse event on iOS, check whether the mouse event's PointerID allows for compatibility
522         mouse events to be dispatched using PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier(). The "click" event is not a compatibility
523         mouse event.
524         * dom/PointerEvent.h:
525         * page/PointerCaptureController.cpp:
526         (WebCore::PointerCaptureController::PointerCaptureController):
527         (WebCore::PointerCaptureController::touchWithIdentifierWasRemoved):
528         (WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier): Deleted.
529         * page/PointerCaptureController.h:
530         * platform/PlatformMouseEvent.h:
531         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
532         (WebCore::PlatformMouseEvent::pointerId const):
533         * platform/PointerID.h: Renamed from Source/WebCore/dom/PointerID.h.
534         (WebCore::mousePointerID):
535
536 2019-05-22  Jiewen Tan  <jiewen_tan@apple.com>
537
538         [WebAuthN] Support Attestation Conveyance Preference
539         https://bugs.webkit.org/show_bug.cgi?id=192722
540         <rdar://problem/49939647>
541
542         Reviewed by Brent Fulgham.
543
544         This patch implements https://www.w3.org/TR/webauthn/#enumdef-attestationconveyancepreference, together with
545         Step 20 with regard to AttestationConveyancePreference of https://www.w3.org/TR/webauthn/#createCredential.
546         Few notes with regard to Step 20: 1) We treat indirect attestation as direct attestation as we don't MITM
547         the attestation process; 2) We won't distinguish self attestation and return it to keep consistency between
548         the response and the request. If callers want none attestation, they will very likely ignore fmt and attStmt
549         of the attestation object, and therefore it is meaningless to return self attestation.
550
551         Covered by new tests within existing files.
552
553         * CMakeLists.txt:
554         * DerivedSources-input.xcfilelist:
555         * DerivedSources-output.xcfilelist:
556         * DerivedSources.make:
557         * Headers.cmake:
558         * Modules/webauthn/AttestationConveyancePreference.h: Copied from Source/WebCore/Modules/webauthn/WebAuthenticationUtils.h.
559         * Modules/webauthn/AttestationConveyancePreference.idl: Copied from Source/WebCore/Modules/webauthn/WebAuthenticationUtils.h.
560         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
561         (WebCore::PublicKeyCredentialCreationOptions::encode const):
562         (WebCore::PublicKeyCredentialCreationOptions::decode):
563         * Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
564         * Modules/webauthn/WebAuthenticationConstants.h:
565         * Modules/webauthn/WebAuthenticationUtils.cpp:
566         (WebCore::buildAttestationObject):
567         * Modules/webauthn/WebAuthenticationUtils.h:
568         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
569         (fido::readCTAPMakeCredentialResponse):
570         * Modules/webauthn/fido/DeviceResponseConverter.h:
571         * Modules/webauthn/fido/FidoConstants.h:
572         noneAttestationValue is moved to WebAuthenticationConstants.h.
573         * Modules/webauthn/fido/U2fResponseConverter.cpp:
574         (fido::readU2fRegisterResponse):
575         * Modules/webauthn/fido/U2fResponseConverter.h:
576         * Sources.txt:
577         * WebCore.xcodeproj/project.pbxproj:
578
579 2019-05-22  Zalan Bujtas  <zalan@apple.com>
580
581         [Paste] Add support for preferred presentation size when pasting an image
582         https://bugs.webkit.org/show_bug.cgi?id=198132
583         <rdar://problem/50886917>
584
585         Reviewed by Wenson Hsieh.
586
587         Set the pasted <img> width/height attributes when the preferred presentation size is available.
588
589         * editing/WebContentReader.h:
590         * editing/cocoa/WebContentReaderCocoa.mm:
591         (WebCore::createFragmentForImageAttachment):
592         (WebCore::WebContentReader::readImage):
593         * editing/markup.cpp:
594         (WebCore::createFragmentForImageAndURL):
595         * editing/markup.h:
596         * platform/Pasteboard.h:
597         (WebCore::PasteboardWebContentReader::readImage):
598         * platform/PasteboardItemInfo.h:
599         (WebCore::PasteboardItemInfo::encode const):
600         (WebCore::PasteboardItemInfo::decode):
601         * platform/ios/PasteboardIOS.mm:
602         (WebCore::Pasteboard::readPasteboardWebContentDataForType):
603         (WebCore::Pasteboard::read):
604         (WebCore::Pasteboard::readRespectingUTIFidelities):
605         * platform/ios/PlatformPasteboardIOS.mm:
606         (WebCore::PlatformPasteboard::informationForItemAtIndex):
607
608 2019-05-22  Jer Noble  <jer.noble@apple.com>
609
610         Hide MediaCapabilities.encodingInfo() when the platform does not support it.
611         https://bugs.webkit.org/show_bug.cgi?id=197476
612
613         Reviewed by Eric Carlson.
614
615         Test: platform/mac/media/mediacapabilities/mediacapabilities-encodingInfo-undefined.html
616
617         Add a new IDL attribute, CustomEnabled, which allows non Settings-based enabling of attributes and objects.
618
619         * Modules/mediacapabilities/MediaCapabilities.idl:
620         * WebCore.xcodeproj/project.pbxproj:
621         * bindings/js/JSMediaCapabilitiesCustom.h: Copied from Source/WebCore/Modules/mediacapabilities/MediaCapabilities.idl.
622         (WebCore::JSMediaCapabilitiesEncodingInfoIsEnabled):
623         * bindings/scripts/CodeGeneratorJS.pm:
624         (NeedsRuntimeCheck):
625         (GenerateRuntimeEnableConditionalString):
626         * bindings/scripts/IDLAttributes.json:
627         * bindings/scripts/preprocess-idls.pl:
628         (GenerateConstructorAttributes):
629         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
630         (WebCore::MediaEngineConfigurationFactory::hasDecodingConfigurationFactory):
631         (WebCore::MediaEngineConfigurationFactory::hasEncodingConfigurationFactory):
632         * platform/mediacapabilities/MediaEngineConfigurationFactory.h:
633
634 2019-05-22  Youenn Fablet  <youenn@apple.com>
635
636         Implement Feature policy self/none/* parsing
637         https://bugs.webkit.org/show_bug.cgi?id=198078
638
639         Reviewed by Eric Carlson.
640
641         Start to implement https://w3c.github.io/webappsec-feature-policy/#algo-parse-policy-directive
642         'src' is not supported yet.
643         Apply the rules to getUserMedia.
644         Update getDisplayMedia keyword from 'display' to 'display-capture' as per spec.
645
646         Test: imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-feature-policy-none.https.html
647
648         * Headers.cmake:
649         * Modules/mediastream/UserMediaController.cpp:
650         (WebCore::isSecure):
651         (WebCore::isAllowedByFeaturePolicy):
652         (WebCore::isAllowedToUse):
653         * Sources.txt:
654         * WebCore.xcodeproj/project.pbxproj:
655         * html/FeaturePolicy.cpp: Added.
656         (WebCore::isAllowedByFeaturePolicy):
657         (WebCore::processOriginItem):
658         (WebCore::updateList):
659         (WebCore::FeaturePolicy::parse):
660         (WebCore::FeaturePolicy::allows const):
661         * html/FeaturePolicy.h: Added.
662         * html/HTMLIFrameElement.cpp:
663         (WebCore::HTMLIFrameElement::featurePolicy const):
664         * html/HTMLIFrameElement.h:
665
666 2019-05-21  Jer Noble  <jer.noble@apple.com>
667
668         Media controls don't show in WK2 video fullscreen sometimes
669         https://bugs.webkit.org/show_bug.cgi?id=198094
670         <rdar://problem/50970661>
671
672         Reviewed by Tim Horton.
673
674         Ensure that the WebAVPlayerLayer never allows hit testing, as this keeps touches from reaching
675         AVKit's controls.
676
677         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
678         (-[WebAVPlayerLayer init]):
679
680 2019-05-21  Saam barati  <sbarati@apple.com>
681
682         WHLSL: Add an AST dumper
683         https://bugs.webkit.org/show_bug.cgi?id=198059
684
685         Reviewed by Myles Maxfield.
686
687         This patch makes it so we can dump the WHLSL program's AST.
688         This will become useful when we're debugging passes that
689         transform the AST.
690         
691         The dumper mostly prints in a style where the dump is almost
692         valid WHLSL code. E.g, this WHLSL program:
693         ```
694         int foo(int arg) {
695             return arg + 1;
696         }
697         ```
698         
699         gets dumped as:
700         ```
701         int foo(int arg) {
702            return operator+(arg, 1);
703         }
704         ```
705         
706         This patch also adds a way to dump between each pass, after
707         parsing, or at the end of all passes. Currently, this is controlled
708         by a static variable. I'll make these runtime configurable in a follow
709         up: https://bugs.webkit.org/show_bug.cgi?id=198097
710
711         No new tests because this is used for logging.
712
713         * Modules/webgpu/WHLSL/AST/WHLSLAST.h: Added.
714         * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h:
715         (WebCore::WHLSL::AST::toString):
716         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
717         (WebCore::WHLSL::AST::BuiltInSemantic::toString const):
718         * Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h:
719         (WebCore::WHLSL::AST::toString):
720         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
721         (WebCore::WHLSL::AST::ResourceSemantic::toString):
722         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
723         (WebCore::WHLSL::Metal::toString): Deleted.
724         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: Added.
725         (WebCore::WHLSL::ASTDumper::visit):
726         * Modules/webgpu/WHLSL/WHLSLASTDumper.h: Added.
727         (WebCore::WHLSL::ASTDumper::toString):
728         (WebCore::WHLSL::ASTDumper::Indent::Indent):
729         (WebCore::WHLSL::ASTDumper::bumpIndent):
730         (WebCore::WHLSL::toString):
731         (WebCore::WHLSL::dumpAST):
732         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
733         (WebCore::WHLSL::dumpASTIfNeeded):
734         (WebCore::WHLSL::dumpASTAfterParsingIfNeeded):
735         (WebCore::WHLSL::dumpASTBetweenEachPassIfNeeded):
736         (WebCore::WHLSL::dumpASTAtEndIfNeeded):
737         (WebCore::WHLSL::prepareShared):
738         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
739         * Sources.txt:
740         * WebCore.xcodeproj/project.pbxproj:
741
742 2019-05-21  Saam barati  <sbarati@apple.com>
743
744         WHLSL: Parsing negative int literals parses the positive value instead
745         https://bugs.webkit.org/show_bug.cgi?id=198096
746
747         Reviewed by Dean Jackson.
748
749         I also made the code around < INT_MIN a bit easier to follow along with.
750
751         No new tests because we haven't imported WHLSL test suite yet.
752         Verified this works using the AST dumper.
753
754         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
755         (WebCore::WHLSL::intLiteralToInt):
756
757 2019-05-21  Myles C. Maxfield  <mmaxfield@apple.com>
758
759         font-optical-sizing applies the wrong variation value
760         https://bugs.webkit.org/show_bug.cgi?id=197528
761         <rdar://problem/50152854>
762
763         Reviewed by Antti Koivisto.
764
765         The OpenType spec says in
766         https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxistag_opsz
767
768         "Scale interpretation: Values can be interpreted as text size, in points."
769
770         It turns out that it means "typographic point size" which is equal to CSS pixels, not
771         CSS points.
772
773         There are two parts of the font that are sensitive to optical sizing: variation values and
774         the trak table. We don't want to set the variation value directly because then the trak table
775         won't be affected. Instead, we can use kCTFontOpticalSizeAttribute to set both of them together.
776         We will only do this when the CSS says text-rendering:optimizeLegibility or when the font has
777         an opsz axis but no STAT table. Otherwise, we won't do anything special, which lets CoreText
778         handle the default behavior for us. This gives us the same default behavior as the rest of the
779         system.
780
781         Tests: fast/text/variations/optical-sizing-trak-2.html
782                fast/text/variations/optical-sizing-trak.html
783                fast/text/variations/optical-sizing-units.html
784                fast/text/variations/optical-sizing-units-2.html
785
786         * platform/graphics/cocoa/FontCacheCoreText.cpp:
787         (WebCore::FontType::FontType):
788         (WebCore::preparePlatformFont):
789         (WebCore::fontWithFamily):
790         (WebCore::FontCache::systemFallbackForCharacters):
791         * platform/graphics/cocoa/FontCacheCoreText.h:
792         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
793         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
794         * platform/graphics/mac/FontCustomPlatformData.cpp:
795         (WebCore::FontCustomPlatformData::fontPlatformData):
796
797 2019-05-21  Simon Fraser  <simon.fraser@apple.com>
798
799         Layer flashing and poor perf during scrolling of message list on gmail.com and hotmail.com - overlap testing needs to constrained to clipping scopes
800         https://bugs.webkit.org/show_bug.cgi?id=198091
801         <rdar://problem/49403082>
802
803         Reviewed by Antti Koivisto.
804         
805         When overflow:scroll is scrolled asynchronously, we need to have already created compositing layers where necessary
806         for clipped-out layers in the scrolled content so that we have something to reveal. We also have ensure
807         that layers inside the scroller (but scrolled out of view) don't trigger overlap with layers outside the scroller.
808         All this has to work when the containing block hierarchy (clipping/scrolling) doesn't match the paint order hierarchy (structure
809         of the z-order and compositing trees).
810
811         Overlap testing previously simply used a list of rectangles per compositing container (OverlapMapContainer). This is
812         a series of layer bounds, built up as we traver the layer tree in z-order. Layers contribute to container N-2, and test
813         against container N-1.
814         
815         To handle overlap with non-stacking-context scrollers, introduce the concept of a ClippingScope, which encompasses
816         a set of layers sharing the same composited-scrolling containing-block ancestor. Within a ClippingScope, layer bounds
817         are computed unclipped. Between them, bounds are tested clipped.
818         
819         Conceptually, each OverlapMapContainer has a tree of ClippingScopes (reflecting the containing-block order tree of
820         composited overflow scroll), and rects are added to the appropriate ClippingScope. This tree is currently always
821         root-relative; the root node is the RenderView's RenderLayer, and will accumulate the bounds of layers not inside
822         composited overflow scroll (just like the old code).
823         
824         When a OverlapMapContainer is popped, the list of rectangles in its ClippingScope tree is merged with that of the previous
825         container.
826
827         Tests: compositing/layer-creation/clipping-scope/nested-scroller-overlap.html
828                compositing/layer-creation/clipping-scope/overlap-constrained-inside-scroller.html
829                compositing/layer-creation/clipping-scope/overlap-constrained-inside-stacking-context-scroller.html
830                compositing/layer-creation/clipping-scope/scroller-with-negative-z-children.html
831                compositing/layer-creation/clipping-scope/shared-layers-in-scroller.html
832
833         * rendering/LayerOverlapMap.cpp:
834         (WebCore::operator<<):
835         (WebCore::OverlapMapContainer::OverlapMapContainer):
836         (WebCore::OverlapMapContainer::ClippingScope::ClippingScope):
837         (WebCore::OverlapMapContainer::ClippingScope::childWithLayer const):
838         (WebCore::OverlapMapContainer::ClippingScope::addChildWithLayerAndBounds):
839         (WebCore::OverlapMapContainer::ClippingScope::addChild):
840         (WebCore::OverlapMapContainer::ClippingScope::appendRect):
841         (WebCore::OverlapMapContainer::clippingScopeContainingLayerChildRecursive):
842         (WebCore::OverlapMapContainer::scopeContainingLayer const):
843         (WebCore::OverlapMapContainer::rootScope const):
844         (WebCore::OverlapMapContainer::rootScope):
845         (WebCore::OverlapMapContainer::add):
846         (WebCore::OverlapMapContainer::overlapsLayers const):
847         (WebCore::OverlapMapContainer::mergeClippingScopesRecursive):
848         (WebCore::OverlapMapContainer::append):
849         (WebCore::OverlapMapContainer::ensureClippingScopeForLayers):
850         (WebCore::OverlapMapContainer::findClippingScopeForLayers const):
851         (WebCore::OverlapMapContainer::recursiveOutputToStream const):
852         (WebCore::OverlapMapContainer::dump const):
853         (WebCore::LayerOverlapMap::LayerOverlapMap):
854         (WebCore::LayerOverlapMap::add):
855         (WebCore::LayerOverlapMap::overlapsLayers const):
856         (WebCore::LayerOverlapMap::pushCompositingContainer):
857         (WebCore::LayerOverlapMap::popCompositingContainer):
858         (WebCore::OverlapMapContainer::unite): Deleted.
859         (WebCore::OverlapMapContainer::rectList const): Deleted.
860         * rendering/LayerOverlapMap.h:
861         * rendering/RenderLayerCompositor.cpp:
862         (WebCore::RenderLayerCompositor::BackingSharingState::appendSharingLayer):
863         (WebCore::RenderLayerCompositor::BackingSharingState::updateBeforeDescendantTraversal):
864         (WebCore::RenderLayerCompositor::updateCompositingLayers):
865         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
866         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
867         (WebCore::RenderLayerCompositor::computeExtent const):
868         (WebCore::createsClippingScope):
869         (WebCore::enclosingClippingScopes):
870         (WebCore::RenderLayerCompositor::addToOverlapMap const):
871         (WebCore::RenderLayerCompositor::updateOverlapMap const):
872         (WebCore::RenderLayerCompositor::layerOverlaps const):
873         * rendering/RenderLayerCompositor.h:
874
875 2019-05-21  Antoine Quint  <graouts@apple.com>
876
877         [macOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown
878         https://bugs.webkit.org/show_bug.cgi?id=198072
879         <rdar://problem/50983361>
880
881         Reviewed by Dean Jackson.
882
883         The Pointer Events spec says that "compatibility" mouse events, which means all mouse events save for "click",
884         should not be dispatched for a given pointer if preventDefault() was called during the dispatch of the "pointerdown"
885         event. Additionally, calling preventDefault() during the dispatch of "pointerup" has no effect.
886
887         * dom/Element.cpp:
888         (WebCore::Element::dispatchMouseEvent):
889         * page/PointerCaptureController.cpp:
890         (WebCore::PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier):
891         (WebCore::PointerCaptureController::pointerEventWasDispatched):
892         * page/PointerCaptureController.h:
893
894 2019-05-21  Antti Koivisto  <antti@apple.com>
895
896         RTL/overflow scroll tests fail with async overflow enabled
897         https://bugs.webkit.org/show_bug.cgi?id=196013
898         <rdar://problem/49066649>
899
900         Reviewed by Simon Fraser.
901
902         Test: compositing/ios/rtl-overflow-scrolling-2.html
903
904         This patch makes the basic RTL cases work in the scrolling tree.
905
906         * page/scrolling/AsyncScrollingCoordinator.cpp:
907         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
908         * page/scrolling/ScrollingTreeScrollingNode.cpp:
909         (WebCore::ScrollingTreeScrollingNode::minimumScrollPosition const):
910         (WebCore::ScrollingTreeScrollingNode::maximumScrollPosition const):
911
912         Add missing scroll offset <-> scroll position conversions.
913
914 2019-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>
915
916         [WPE] Add initial accessibility support using ATK
917         https://bugs.webkit.org/show_bug.cgi?id=197413
918
919         Reviewed by Michael Catanzaro.
920
921         Use USE(ATK) instead of PLATFORM(GTK) for ATK related code and use ATK when available for WPE port too.
922
923         * PlatformWPE.cmake:
924         * SourcesWPE.txt:
925         * accessibility/AXObjectCache.h:
926         * accessibility/AccessibilityList.cpp:
927         (WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers):
928         * accessibility/AccessibilityNodeObject.cpp:
929         (WebCore::AccessibilityNodeObject::canSetValueAttribute const):
930         * accessibility/AccessibilityObject.cpp:
931         (WebCore::AccessibilityObject::textIteratorBehaviorForTextRange const):
932         * accessibility/AccessibilityObject.h:
933         * accessibility/AccessibilityObjectInterface.h:
934         * accessibility/AccessibilityRenderObject.cpp:
935         (WebCore::AccessibilityRenderObject::indexForVisiblePosition const):
936         (WebCore::AccessibilityRenderObject::shouldNotifyActiveDescendant const):
937         * accessibility/AccessibilityTableColumn.cpp:
938         (WebCore::AccessibilityTableColumn::computeAccessibilityIsIgnored const):
939         * accessibility/AccessibilityTableHeaderContainer.cpp:
940         (WebCore::AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored const):
941         * accessibility/atk/WebKitAccessible.cpp:
942         (webkitAccessibleGetAttributes):
943         * accessibility/wpe/AXObjectCacheWPE.cpp: Removed.
944         * accessibility/wpe/AccessibilityObjectWPE.cpp: Removed.
945         * editing/FrameSelection.h:
946
947 2019-05-20  Ross Kirsling  <ross.kirsling@sony.com>
948
949         Make lossy LayoutUnit constructors explicit
950         https://bugs.webkit.org/show_bug.cgi?id=191811
951
952         Reviewed by Antti Koivisto.
953
954         * platform/LayoutUnit.h:
955         Make lossy unary constructors explicit.
956         For ergonomics, give float overloads to copy constructor and round/floor/ceil functions.
957
958         * css/LengthFunctions.h:
959         * platform/graphics/LayoutPoint.h:
960         * platform/graphics/LayoutRect.h:
961         * platform/graphics/LayoutSize.h:
962         * rendering/RenderBox.h:
963         * rendering/RenderElement.h:
964         Templatize common functions to allow LayoutUnit itself to dictate which types it allows.
965
966         * html/shadow/SliderThumbElement.cpp:
967         * page/FrameView.cpp:
968         * page/Page.cpp:
969         * page/SpatialNavigation.cpp:
970         * page/scrolling/AxisScrollSnapOffsets.cpp:
971         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
972         * layout/FormattingContextGeometry.cpp:
973         * layout/FormattingContextQuirks.cpp:
974         * layout/LayoutState.cpp:
975         * layout/displaytree/DisplayBox.h:
976         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
977         * layout/layouttree/LayoutReplaced.cpp:
978         * platform/animation/AnimationUtilities.h:
979         * platform/cocoa/ScrollSnapAnimatorState.mm:
980         * rendering/BorderEdge.cpp:
981         * rendering/EllipsisBox.cpp:
982         * rendering/FixedTableLayout.cpp:
983         * rendering/InlineBox.cpp:
984         * rendering/InlineFlowBox.cpp:
985         * rendering/InlineFlowBox.h:
986         * rendering/InlineTextBox.cpp:
987         * rendering/RenderBlock.cpp:
988         * rendering/RenderBlockFlow.cpp:
989         * rendering/RenderBlockLineLayout.cpp:
990         * rendering/RenderBox.cpp:
991         * rendering/RenderBoxModelObject.cpp:
992         * rendering/RenderBoxModelObject.h:
993         * rendering/RenderDeprecatedFlexibleBox.cpp:
994         * rendering/RenderElement.cpp:
995         * rendering/RenderImage.cpp:
996         * rendering/RenderInline.cpp:
997         * rendering/RenderLineBreak.cpp:
998         * rendering/RenderListMarker.cpp:
999         * rendering/RenderMultiColumnSet.cpp:
1000         * rendering/RenderMultiColumnSet.h:
1001         * rendering/RenderObject.cpp:
1002         * rendering/RenderReplaced.cpp:
1003         * rendering/RenderTable.cpp:
1004         * rendering/RenderTableCell.cpp:
1005         * rendering/RenderTableSection.cpp:
1006         * rendering/RenderText.cpp:
1007         * rendering/RenderTextControlMultiLine.cpp:
1008         * rendering/RenderThemeMac.mm:
1009         * rendering/RenderVTTCue.cpp:
1010         * rendering/RenderView.cpp:
1011         * rendering/RootInlineBox.cpp:
1012         * rendering/SimpleLineLayoutFunctions.cpp:
1013         * rendering/SimpleLineLayoutPagination.cpp:
1014         * rendering/SimpleLineLayoutResolver.cpp:
1015         * rendering/line/LineWidth.cpp:
1016         * rendering/mathml/MathOperator.cpp:
1017         * rendering/mathml/RenderMathMLBlock.cpp:
1018         * rendering/mathml/RenderMathMLBlock.h:
1019         * rendering/mathml/RenderMathMLFencedOperator.h:
1020         * rendering/mathml/RenderMathMLFraction.cpp:
1021         * rendering/mathml/RenderMathMLMenclose.cpp:
1022         * rendering/mathml/RenderMathMLOperator.cpp:
1023         * rendering/mathml/RenderMathMLRoot.cpp:
1024         * rendering/mathml/RenderMathMLScripts.cpp:
1025         * rendering/mathml/RenderMathMLToken.cpp:
1026         * rendering/shapes/BoxShape.cpp:
1027         * rendering/shapes/ShapeOutsideInfo.cpp:
1028         * rendering/style/CollapsedBorderValue.h:
1029         * rendering/style/NinePieceImage.cpp:
1030         * rendering/style/NinePieceImage.h:
1031         * rendering/style/RenderStyle.cpp:
1032         * rendering/style/RenderStyle.h:
1033         * rendering/svg/RenderSVGText.cpp:
1034         * rendering/svg/SVGInlineTextBox.cpp:
1035         Make usage of LayoutUnit(float) and LayoutUnit(double) explicit where needed.
1036
1037 2019-05-20  Jer Noble  <jer.noble@apple.com>
1038
1039         Provide an explicit UIModalPresentation style when creating an AVPlayerViewController for fullscreen.
1040         https://bugs.webkit.org/show_bug.cgi?id=198052
1041
1042         Reviewed by Tim Horton.
1043
1044         Make sure AVPlayerViewController has an "overFullScreen" modal style.
1045
1046         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1047         (-[WebAVPlayerViewController initWithFullscreenInterface:]):
1048
1049 2019-05-20  Chris Dumez  <cdumez@apple.com>
1050
1051         Fix security check in ScriptController::canAccessFromCurrentOrigin()
1052         https://bugs.webkit.org/show_bug.cgi?id=196730
1053         <rdar://problem/49731231>
1054
1055         Reviewed by Ryosuke Niwa.
1056
1057         Fix security check in ScriptController::canAccessFromCurrentOrigin() when there is no
1058         current JS exec state. Instead of returning true unconditionally, we now fall back to
1059         using the accessing document's origin for the security check. The new behavior is
1060         aligned with Blink:
1061         https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/html/html_frame_element_base.cc?rcl=d3f22423d512b45466f1694020e20da9e0c6ee6a&l=62
1062
1063         This fix is based on a patch from Sergei Glazunov <glazunov@google.com>.
1064
1065         Test: http/tests/security/showModalDialog-sync-cross-origin-page-load2.html
1066
1067         * bindings/js/ScriptController.cpp:
1068         (WebCore::ScriptController::canAccessFromCurrentOrigin):
1069         * bindings/js/ScriptController.h:
1070         * html/HTMLFrameElementBase.cpp:
1071         (WebCore::HTMLFrameElementBase::isURLAllowed const):
1072
1073 2019-05-20  Gabe Giosia  <giosia@google.com>
1074
1075         Range getBoundingClientRect returning zero rect on simple text node with <br> before it
1076         https://bugs.webkit.org/show_bug.cgi?id=182181
1077
1078         Reviewed by Antti Koivisto.
1079         
1080         Correct rect of RenderText in a block element when used in a Range
1081         over a line break element. The end offset was miscalculated.
1082
1083         Addded line-break case to fast/dom/Range/getBoundingClientRect.html
1084
1085         * rendering/SimpleLineLayoutFunctions.cpp:
1086         (WebCore::SimpleLineLayout::collectAbsoluteQuadsForRange):
1087         * rendering/SimpleLineLayoutResolver.cpp:
1088         (WebCore::SimpleLineLayout::RunResolver::rangeForRendererWithOffsets const):
1089
1090 2019-05-19  Brent Fulgham  <bfulgham@apple.com>
1091
1092         Unreviewed build fix after r245508.
1093
1094         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: Don't use
1095         an 'import' directive in a C++ file.
1096
1097 2019-05-19  Brent Fulgham  <bfulgham@apple.com>
1098
1099         Wait to get frame until after layout has been run
1100         https://bugs.webkit.org/show_bug.cgi?id=197999
1101         <rdar://problem/50800345>
1102
1103         Reviewed by Alex Christensen.
1104
1105         The current frame can change when layout runs, so don't bother retrieving
1106         the frame until the final layout pass is complete.
1107
1108         Test: fast/dom/window-inner-width-crash.html
1109
1110         * page/DOMWindow.cpp:
1111         (WebCore::DOMWindow::innerHeight const): Move frame access past the
1112         layout operation.
1113         (WebCore::DOMWindow::innerWidth const): Ditto.
1114         (WebCore::DOMWindow::scrollX const): Ditto.
1115         (WebCore::DOMWindow::scrollY const): Ditto.
1116
1117 2019-05-19  Brent Fulgham  <bfulgham@apple.com>
1118
1119         Unreviewed build fix
1120
1121         Attempting to build with only Open Source sources on shipping software with
1122         ASan enabled triggers build failures due to missing includes. This patch adds
1123         the necessary includes to cleanly build WebCore.
1124
1125         * Modules/applepay/ApplePaySession.cpp:
1126         * Modules/applepay/PaymentSession.cpp:
1127         * Modules/mediastream/UserMediaController.cpp:
1128         * bindings/js/ScriptController.cpp:
1129         * contentextensions/ContentExtensionsBackend.cpp:
1130         * dom/Document.cpp:
1131         * dom/ScriptedAnimationController.cpp:
1132         * editing/cocoa/EditorCocoa.mm:
1133         * editing/cocoa/HTMLConverter.mm:
1134         * editing/cocoa/WebContentReaderCocoa.mm:
1135         * editing/markup.cpp:
1136         * history/CachedFrame.cpp:
1137         * html/HTMLDocument.cpp:
1138         * html/HTMLHtmlElement.cpp:
1139         * html/HTMLMediaElement.cpp:
1140         * html/ImageDocument.cpp:
1141         * html/MediaDocument.cpp:
1142         * html/PluginDocument.cpp:
1143         * html/parser/HTMLDocumentParser.cpp:
1144         * html/parser/XSSAuditor.cpp:
1145         * inspector/InspectorInstrumentation.cpp:
1146         * inspector/agents/InspectorApplicationCacheAgent.cpp:
1147         * inspector/agents/InspectorNetworkAgent.cpp:
1148         * inspector/agents/InspectorPageAgent.cpp:
1149         * inspector/agents/page/PageNetworkAgent.cpp:
1150         * loader/ApplicationManifestLoader.cpp:
1151         * loader/FrameLoader.cpp:
1152         * loader/LoadTiming.cpp:
1153         * loader/NetscapePlugInStreamLoader.cpp:
1154         * loader/ResourceLoader.cpp:
1155         * loader/SubresourceLoader.cpp:
1156         * loader/appcache/ApplicationCacheHost.cpp:
1157         * loader/archive/cf/LegacyWebArchive.cpp:
1158         * loader/icon/IconLoader.cpp:
1159         * page/ContextMenuController.cpp:
1160         * page/FrameView.cpp:
1161         * page/Page.cpp:
1162         * page/Performance.cpp:
1163         * page/PerformanceNavigation.cpp:
1164         * page/Quirks.cpp:
1165         * page/UserContentProvider.cpp:
1166         * page/csp/ContentSecurityPolicy.cpp:
1167         * page/mac/PageMac.mm:
1168         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1169         * svg/graphics/SVGImage.cpp:
1170         * testing/Internals.cpp:
1171
1172 2019-05-19  Antoine Quint  <graouts@apple.com>
1173
1174         [Pointer Events] Listening to a "pointerover", "pointerenter", "pointerout" or "pointerleave" event alone does not fire the event on iOS
1175         https://bugs.webkit.org/show_bug.cgi?id=197882
1176         <rdar://problem/50769116>
1177
1178         Reviewed by Dean Jackson.
1179
1180         Tests: pointerevents/ios/pointerenter-alone.html
1181                pointerevents/ios/pointerleave-alone.html
1182                pointerevents/ios/pointerout-alone.html
1183                pointerevents/ios/pointerover-alone.html
1184
1185         * dom/EventNames.h:
1186         (WebCore::EventNames::isTouchRelatedEventType const):
1187         (WebCore::EventNames::touchRelatedEventNames const):
1188         (WebCore::EventNames::extendedTouchRelatedEventNames const):
1189
1190 2019-05-19  Antoine Quint  <graouts@apple.com>
1191
1192         [Pointer Events] A pointer should be marked as primary for all of its events
1193         https://bugs.webkit.org/show_bug.cgi?id=197909
1194         <rdar://problem/50801608>
1195
1196         Reviewed by Dean Jackson.
1197
1198         Add an ivar for EventHandler which we'll use in WebKitAdditions code to track the touch identifier
1199         of the very first touch to start in a given sequence.
1200
1201         * page/EventHandler.h:
1202
1203 2019-05-19  Darin Adler  <darin@apple.com>
1204
1205         Change String::number to use "shortest" instead of "fixed precision 6 digits"
1206         https://bugs.webkit.org/show_bug.cgi?id=178319
1207
1208         Reviewed by Sam Weinig.
1209
1210         * accessibility/atk/WebKitAccessibleInterfaceValue.cpp:
1211         (webkitAccessibleSetNewValue): Use String::numberToStringFixedPrecision
1212         instead of String::number to be explicit about the fact that it's fixed precision.
1213         * page/linux/ResourceUsageOverlayLinux.cpp:
1214         (gcTimerString): Ditto.
1215
1216         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1217         (printTransform): Use appendFixedPrecisionNumber instead of appendNumber
1218         to be explicit about the fact that it's fixed precision.
1219         (printLayer): Ditto.
1220         (WebCore::PlatformCALayerWin::layerTreeAsString const): Ditto.
1221         * platform/graphics/freetype/FontCacheFreeType.cpp:
1222         (buildVariationSettings): Ditto.
1223
1224         * svg/SVGNumberList.h: Use appendFixedPrecisionNumber instead of appendNumber
1225         to be explicit about the fact that it's fixed precision. We'll consider moving
1226         to shortest later.
1227
1228         * svg/SVGPathUtilities.cpp:
1229         (WebCore::buildStringFromPath): Use appendNumberShortest instead of
1230         appendNumberECMAScript since these are single-precision.
1231
1232         * svg/SVGPointList.h: Use appendFixedPrecisionNumber instead of appendNumber
1233         to be explicit about the fact that it's fixed precision. We'll consider moving
1234         to shortest later.
1235         * svg/SVGTransformValue.h: Ditto.
1236
1237 2019-05-19  Simon Fraser  <simon.fraser@apple.com>
1238
1239         Layers painting into shared backing need to contribute to overlap
1240         https://bugs.webkit.org/show_bug.cgi?id=198021
1241
1242         Reviewed by Zalan Bujtas.
1243         
1244         Layers that paint into a composited (non-root) layer get added to the overlap map so
1245         that later layers correct overlap them; this is done via the test against currentState.compositingAncestor.
1246
1247         We need the same logic for layers that paint into shared backing; they need to behave
1248         the same way in terms of how they contribute to overlap. We already had currentState.backingSharingAncestor
1249         which was unused, but now use it for this, and correctly null it out when a layer composites.
1250
1251         Bug was noticed during testing, and not known to affect any websites (though it probably does).
1252         
1253         Also move the overlap container popping into updateOverlapMap() so the two callers can
1254         share the code, and more explicitly track whether a container was pushed.
1255
1256         Test: compositing/shared-backing/sharing-child-contributes-to-overlap.html
1257
1258         * rendering/RenderLayerCompositor.cpp:
1259         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1260         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
1261         (WebCore::RenderLayerCompositor::updateOverlapMap const):
1262         * rendering/RenderLayerCompositor.h:
1263
1264 2019-05-17  Joonghun Park  <pjh0718@gmail.com>
1265
1266         Implement CSS `display: flow-root` (modern clearfix)
1267         https://bugs.webkit.org/show_bug.cgi?id=165603
1268
1269         Reviewed by Zalan Bujtas.
1270
1271         This change follows https://drafts.csswg.org/css-display-3/#valdef-display-flow-root as below.
1272
1273         'display: flow-root' generates a block container box, and lays out its contents using flow layout.
1274         It always establishes a new block formatting context for its contents.
1275
1276         * css/CSSPrimitiveValueMappings.h:
1277         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1278         * css/CSSValueKeywords.in:
1279         * css/StyleResolver.cpp:
1280         (WebCore::equivalentBlockDisplay):
1281         * css/parser/CSSParserFastPaths.cpp:
1282         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1283         * rendering/RenderBox.cpp:
1284         (WebCore::RenderBox::createsNewFormattingContext const):
1285         * rendering/RenderElement.cpp:
1286         (WebCore::RenderElement::createFor):
1287         * rendering/style/RenderStyleConstants.h:
1288
1289 2019-05-17  Don Olmstead  <don.olmstead@sony.com>
1290
1291         [CMake] Use builtin FindICU
1292         https://bugs.webkit.org/show_bug.cgi?id=197934
1293
1294         Reviewed by Michael Catanzaro.
1295
1296         Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.
1297
1298         * CMakeLists.txt:
1299         * PlatformPlayStation.cmake:
1300         * PlatformWPE.cmake:
1301
1302 2019-05-17  Alex Christensen  <achristensen@webkit.org>
1303
1304         Enable legacy EME for iOS WKWebView
1305         https://bugs.webkit.org/show_bug.cgi?id=197964
1306         <rdar://problem/50625666>
1307
1308         Reviewed by Wenson Hsieh.
1309
1310         This was attempted unsuccessfully in r230169.
1311         Verified manually that it works as desired.
1312
1313         * page/RuntimeEnabledFeatures.h:
1314
1315 2019-05-17  Sihui Liu  <sihui_liu@apple.com>
1316
1317         ASSERTION FAILED: !m_backingStore in WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore(uint64_t)
1318         https://bugs.webkit.org/show_bug.cgi?id=197741
1319         <rdar://problem/50625006>
1320
1321         Reviewed by Youenn Fablet.
1322
1323         If an open request is made before a delete request, open task should be performed before delete task on the
1324         database thread. After r242911, open request needs to wait decision of StorageQuotaManager before posting task
1325         to database thread, while delete request needs not. This makes deletion happen before open.
1326
1327         We need to make sure tasks are in correct order by not starting next open or delete request when database is in 
1328         the middle of open or deletion.
1329
1330         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1331         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
1332         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
1333
1334 2019-05-17  Antoine Quint  <graouts@apple.com>
1335
1336         Add a website policy to disable the legacy -webkit-overflow-scrolling:touch behavior
1337         https://bugs.webkit.org/show_bug.cgi?id=197943
1338         <rdar://problem/49078202>
1339
1340         Reviewed by Brent Fulgham.
1341
1342         Tests: fast/scrolling/ipad/overflow-scrolling-touch-enabled-stacking-modern-compatibility-mode.html
1343                platform/ipad/fast/css/webkit-overflow-scrolling-parsing-modern-compatibility-mode.html
1344
1345         * css/parser/CSSParserContext.cpp:
1346         (WebCore::CSSParserContext::CSSParserContext):
1347         * loader/DocumentLoader.h:
1348         (WebCore::DocumentLoader::legacyOverflowScrollingTouchPolicy const):
1349         (WebCore::DocumentLoader::setLegacyOverflowScrollingTouchPolicy):
1350
1351 2019-05-17  Alex Christensen  <achristensen@webkit.org>
1352
1353         Add SPI to set a list of hosts to which to send custom header fields cross-origin
1354         https://bugs.webkit.org/show_bug.cgi?id=197397
1355
1356         Reviewed by Geoff Garen.
1357
1358         In r223001 I added the ability to send custom headers, but with a restriction that they will not be sent except to the origin of the main document.
1359         We need the ability to specify what origins to send these headers to even if they are not first party requests.
1360         We get this information in a list of strings which are the hosts to send the headers to.  Some of the strings have an asterisk at the beginning,
1361         indicating that the headers are to be sent to all subdomains.
1362
1363         I repurposed some ObjC SPI that was never adopted, but I keep testing the C API that was to verify no regression.
1364         I also added some new API tests for the new behavior.
1365
1366         * Sources.txt:
1367         * WebCore.xcodeproj/project.pbxproj:
1368         * loader/CustomHeaderFields.cpp: Added.
1369         (WebCore::CustomHeaderFields::thirdPartyDomainsMatch const):
1370         * loader/CustomHeaderFields.h: Added.
1371         (WebCore::CustomHeaderFields::encode const):
1372         (WebCore::CustomHeaderFields::decode):
1373         * loader/DocumentLoader.cpp:
1374         (WebCore::DocumentLoader::setCustomHeaderFields): Deleted.
1375         * loader/DocumentLoader.h:
1376         (WebCore::DocumentLoader::setCustomHeaderFields):
1377         (WebCore::DocumentLoader::customHeaderFields const):
1378         (WebCore::DocumentLoader::customHeaderFields): Deleted.
1379         * loader/cache/CachedResourceLoader.cpp:
1380         (WebCore::CachedResourceLoader::requestResource):
1381
1382 2019-05-17  Youenn Fablet  <youenn@apple.com>
1383
1384         Make AVVideoCaptureSource more robust to configuration failures
1385         https://bugs.webkit.org/show_bug.cgi?id=197997
1386         rdar://problem/50875662
1387
1388         Reviewed by Eric Carlson.
1389
1390         Covered by manual testing.
1391
1392         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1393         (WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate):
1394         Make sure to commit configuration once calling beginConfiguration.
1395         In case of error in setting frame rate, log the error but continue capturing.
1396
1397 2019-05-17  Rob Buis  <rbuis@igalia.com>
1398
1399         Implement imagesrcset and imagesizes attributes on link rel=preload
1400         https://bugs.webkit.org/show_bug.cgi?id=192950
1401
1402         Reviewed by Youenn Fablet.
1403
1404         Implement imagesrcset and imagesizes attributes for both Link header
1405         and link element.
1406
1407         Tests: imported/w3c/web-platform-tests/preload/dynamic-adding-preload-imagesrcset.html
1408                imported/w3c/web-platform-tests/preload/link-header-preload-delay-onload.html
1409                imported/w3c/web-platform-tests/preload/link-header-preload-imagesrcset.html
1410                imported/w3c/web-platform-tests/preload/link-header-preload-nonce.html
1411                imported/w3c/web-platform-tests/preload/link-header-preload.html
1412                imported/w3c/web-platform-tests/preload/onload-event.html
1413                imported/w3c/web-platform-tests/preload/preload-with-type.html
1414
1415         * html/HTMLAttributeNames.in:
1416         * html/HTMLLinkElement.cpp:
1417         (WebCore::HTMLLinkElement::process):
1418         * html/HTMLLinkElement.idl:
1419         * loader/LinkHeader.cpp:
1420         (WebCore::paramterNameFromString):
1421         (WebCore::LinkHeader::setValue):
1422         (WebCore::LinkHeader::LinkHeader):
1423         * loader/LinkHeader.h:
1424         (WebCore::LinkHeader::imageSrcSet const):
1425         (WebCore::LinkHeader::imageSizes const):
1426         (WebCore::LinkHeader::isViewportDependent const):
1427         * loader/LinkLoader.cpp:
1428         (WebCore::LinkLoader::loadLinksFromHeader):
1429         (WebCore::LinkLoader::preloadIfNeeded):
1430         (WebCore::LinkLoader::loadLink):
1431         * loader/LinkLoader.h:
1432
1433 2019-05-17  Keith Rollin  <krollin@apple.com>
1434
1435         Re-enable generate-xcfilelists
1436         https://bugs.webkit.org/show_bug.cgi?id=197933
1437         <rdar://problem/50831677>
1438
1439         Reviewed by Jonathan Bedard.
1440
1441         The following two tasks have been completed, and we can re-enable
1442         generate-xcfilelists:
1443
1444         Bug 197619 <rdar://problem/50507392> Temporarily disable generate-xcfilelists (197619)
1445         Bug 197622 <rdar://problem/50508222> Rewrite generate-xcfilelists in Python (197622)
1446
1447         No new tests -- no change in user-visible functionality.
1448
1449         * Scripts/check-xcfilelists.sh:
1450
1451 2019-05-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1452
1453         Fix a typo in some user agent string logic
1454         https://bugs.webkit.org/show_bug.cgi?id=197992
1455         <rdar://problem/50895962>
1456
1457         Reviewed by Brent Fulgham.
1458
1459         Adjust the major version number for the desktop user agent string.
1460
1461         * platform/ios/UserAgentIOS.mm:
1462         (WebCore::standardUserAgentWithApplicationName):
1463
1464 2019-05-17  Simon Fraser  <simon.fraser@apple.com>
1465
1466         REGRESSION (r245170): gmail.com inbox table header flickers
1467         https://bugs.webkit.org/show_bug.cgi?id=198005
1468         <rdar://problem/50907718>
1469
1470         Reviewed by Antti Koivisto.
1471
1472         When a layer started as painting into shared backing, but then became independently
1473         composited (e.g. by having to clip composited children), it wouldn't have the "overlap"
1474         indirect compositing reason. This allowed requiresOwnBackingStore() to say that it
1475         could paint into some ancestor, but this breaks overlap. So in this code path,
1476         put IndirectCompositingReason::Overlap back on the layer which restores the previous
1477         behavior.
1478
1479         Make some logging changes to help diagnose things like this.
1480
1481         Test: compositing/shared-backing/overlap-after-end-sharing.html
1482
1483         * rendering/RenderLayer.cpp:
1484         (WebCore::RenderLayer::calculateClipRects const):
1485         (WebCore::outputPaintOrderTreeLegend):
1486         (WebCore::outputPaintOrderTreeRecursive):
1487         * rendering/RenderLayer.h:
1488         * rendering/RenderLayerCompositor.cpp:
1489         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1490         (WebCore::RenderLayerCompositor::updateBacking):
1491         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
1492         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
1493         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
1494         * rendering/RenderLayerCompositor.h:
1495
1496 2019-05-17  Simon Fraser  <simon.fraser@apple.com>
1497
1498         REGRESSION (r245170): gmail.com header flickers when hovering over the animating buttons
1499         https://bugs.webkit.org/show_bug.cgi?id=197975
1500         <rdar://problem/50865946>
1501
1502         Reviewed by Antti Koivisto.
1503
1504         When computeCompositingRequirements() determined that a layer could paint into shared backing, it
1505         pushed an overlap container. If that layer then converted to normal composting, we'd push a second
1506         overlap container, which left the overlap map in a bad state for the rest of the compositing
1507         traversal, causing layers to not get composited when necessary.
1508
1509         Test: compositing/shared-backing/overlap-after-shared-to-composited.html
1510
1511         * rendering/RenderLayerCompositor.cpp:
1512         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1513
1514 2019-05-17  Commit Queue  <commit-queue@webkit.org>
1515
1516         Unreviewed, rolling out r245401.
1517         https://bugs.webkit.org/show_bug.cgi?id=197990
1518
1519         Causing internal build failures (Requested by ShawnRoberts on
1520         #webkit).
1521
1522         Reverted changeset:
1523
1524         "Add SPI to set a list of hosts to which to send custom header
1525         fields cross-origin"
1526         https://bugs.webkit.org/show_bug.cgi?id=197397
1527         https://trac.webkit.org/changeset/245401
1528
1529 2019-05-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
1530
1531         SVGElement should detach itself from all its properties before it is deleted
1532         https://bugs.webkit.org/show_bug.cgi?id=197954
1533
1534         Reviewed by Simon Fraser.
1535
1536         Before deleting the SVGElement node, SVGElement::detachAllProperties()
1537         needs to be called. This will make the properties be detached objects
1538         which means no change will be committed unless these properties are
1539         attached to another owner.
1540
1541         Test: svg/dom/svg-properties-detach-change.html
1542
1543         * dom/Node.cpp:
1544         (WebCore::Node::removedLastRef):
1545         * svg/SVGElement.h:
1546         (WebCore::SVGElement::detachAllProperties):
1547
1548 2019-05-17  Eric Carlson  <eric.carlson@apple.com>
1549
1550         Allow sequential playback of media files when initial playback started with a user gesture
1551         https://bugs.webkit.org/show_bug.cgi?id=197959
1552         <rdar://problem/50655207>
1553
1554         Reviewed by Youenn Fablet.
1555
1556         Test: media/playlist-inherits-user-gesture.html
1557
1558         * dom/Document.cpp:
1559         (WebCore::Document::processingUserGestureForMedia const): Return true if it is within
1560         one second of the last HTMLMediaElement 'ended' event.
1561         * dom/Document.h:
1562         (WebCore::Document::mediaFinishedPlaying):
1563
1564         * html/HTMLMediaElement.cpp:
1565         (WebCore::HTMLMediaElement::parseAttribute): removeBehaviorsRestrictionsAfterFirstUserGesture -> 
1566         removeBehaviorRestrictionsAfterFirstUserGesture.
1567         (WebCore::HTMLMediaElement::load): Ditto. Don't call removeBehaviorsRestrictionsAfterFirstUserGesture,
1568         it will be done in prepareForLoad.
1569         (WebCore::HTMLMediaElement::prepareForLoad): removeBehaviorsRestrictionsAfterFirstUserGesture -> 
1570         removeBehaviorRestrictionsAfterFirstUserGesture.
1571         (WebCore::HTMLMediaElement::audioTrackEnabledChanged): Ditto.
1572         (WebCore::HTMLMediaElement::play): Ditto.
1573         (WebCore::HTMLMediaElement::pause): Ditto.
1574         (WebCore::HTMLMediaElement::setVolume): Ditto.
1575         (WebCore::HTMLMediaElement::setMuted): Ditto.
1576         (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker): Ditto.
1577         (WebCore::HTMLMediaElement::dispatchEvent): Call document().mediaFinishedPlaying()
1578         when dispatching the 'ended' event.
1579         (WebCore::HTMLMediaElement::removeBehaviorRestrictionsAfterFirstUserGesture): Rename. Set
1580         m_removedBehaviorRestrictionsAfterFirstUserGesture.
1581         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Deleted.
1582         * html/HTMLMediaElement.h:
1583         
1584         * html/HTMLVideoElement.cpp:
1585         (WebCore:HTMLVideoElement::nativeImageForCurrentTime): Convert to runtime logging.
1586         (WebCore:HTMLVideoElement::webkitEnterFullscreen): Ditto.
1587         (WebCore:HTMLVideoElement::webkitSetPresentationMode): Ditto.
1588         (WebCore:HTMLVideoElement::fullscreenModeChanged): Ditto.
1589
1590         * html/MediaElementSession.cpp:
1591         (WebCore::MediaElementSession::removeBehaviorRestriction): Update log message.
1592
1593 2019-05-17  Brent Fulgham  <bfulgham@apple.com>
1594
1595         Hardening: Prevent FrameLoader crash due to SetForScope
1596         https://bugs.webkit.org/show_bug.cgi?id=197458
1597         <rdar://problem/50368338>
1598
1599         Reviewed by Chris Dumez.
1600
1601         Since SetForScope takes action during a function returns, it might cause
1602         a crash if its scope is broader than the value it is resetting.
1603
1604         * loader/FrameLoader.cpp:
1605         (WebCore::FrameLoader::loadDifferentDocumentItem):
1606
1607 2019-05-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1608
1609         [GTK] Need WebKitContextMenuItemType to open emoji picker
1610         https://bugs.webkit.org/show_bug.cgi?id=176760
1611
1612         Reviewed by Michael Catanzaro.
1613
1614         Add a new context menu item to insert an emoji.
1615
1616         * loader/EmptyClients.cpp: Empty implementation of ContextMenuClient::insertEmoji().
1617         * page/ContextMenuClient.h: Add insertEmoji for GTK port.
1618         * page/ContextMenuController.cpp:
1619         (WebCore::ContextMenuController::contextMenuItemSelected): Handle insert emoji action.
1620         (WebCore::ContextMenuController::populate): Add insert emoji item after select all.
1621         (WebCore::ContextMenuController::checkOrEnableIfNeeded const): Handle insert emoji action.
1622         * platform/ContextMenuItem.h: Add insert emoji action.
1623         * platform/LocalizedStrings.h:
1624         * platform/gtk/LocalizedStringsGtk.cpp:
1625         (WebCore::contextMenuItemTagInsertEmoji):
1626
1627 2019-05-16  Greg Doolittle  <gr3g@apple.com>
1628
1629         AX: Unship some ARIA string reflectors that are to-be-replaced by element reflection
1630         https://bugs.webkit.org/show_bug.cgi?id=197764
1631         <rdar://problem/50649689>
1632
1633         Reviewed by Chris Fleizach.
1634
1635         Specifically these:
1636         - ariaActiveDescendant
1637         - ariaControls
1638         - ariaDescribedBy
1639         - ariaDetails
1640         - ariaErrorMessage
1641         - ariaFlowTo
1642         - ariaLabelledBy
1643         - ariaOwns
1644
1645         Test: LayoutTests/accessibility/ARIA-reflections.html (updated)
1646
1647         * accessibility/AriaAttributes.idl:
1648
1649 2019-05-16  Youenn Fablet  <youenn@apple.com>
1650
1651         CoreAudioCaptureSource should be marked as an audio capture track
1652         https://bugs.webkit.org/show_bug.cgi?id=197953
1653         <rdar://problem/50552007>
1654
1655         Reviewed by Eric Carlson.
1656
1657         Manually tested.
1658
1659         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1660         Mark it as microphone so that it can get muted properly.
1661
1662 2019-05-16  Alex Christensen  <achristensen@webkit.org>
1663
1664         Add SPI to set a list of hosts to which to send custom header fields cross-origin
1665         https://bugs.webkit.org/show_bug.cgi?id=197397
1666
1667         Reviewed by Geoff Garen.
1668
1669         In r223001 I added the ability to send custom headers, but with a restriction that they will not be sent except to the origin of the main document.
1670         We need the ability to specify what origins to send these headers to even if they are not first party requests.
1671         We get this information in a list of strings which are the hosts to send the headers to.  Some of the strings have an asterisk at the beginning,
1672         indicating that the headers are to be sent to all subdomains.
1673
1674         I repurposed some ObjC SPI that was never adopted, but I keep testing the C API that was to verify no regression.
1675         I also added some new API tests for the new behavior.
1676
1677         * Sources.txt:
1678         * WebCore.xcodeproj/project.pbxproj:
1679         * loader/CustomHeaderFields.cpp: Added.
1680         (WebCore::CustomHeaderFields::thirdPartyDomainsMatch const):
1681         * loader/CustomHeaderFields.h: Added.
1682         (WebCore::CustomHeaderFields::encode const):
1683         (WebCore::CustomHeaderFields::decode):
1684         * loader/DocumentLoader.cpp:
1685         (WebCore::DocumentLoader::setCustomHeaderFields): Deleted.
1686         * loader/DocumentLoader.h:
1687         (WebCore::DocumentLoader::setCustomHeaderFields):
1688         (WebCore::DocumentLoader::customHeaderFields const):
1689         (WebCore::DocumentLoader::customHeaderFields): Deleted.
1690         * loader/cache/CachedResourceLoader.cpp:
1691         (WebCore::CachedResourceLoader::requestResource):
1692
1693 2019-05-16  Ali Juma  <ajuma@chromium.org>
1694
1695         [IntersectionObserver] Regression: No initial observation when nothing else triggers rendering
1696         https://bugs.webkit.org/show_bug.cgi?id=197891
1697
1698         Reviewed by Simon Fraser.
1699
1700         Schedule a rendering update whenever a new IntersectionObserver target is added.
1701
1702         Test: intersection-observer/initial-observation.html
1703
1704         * page/IntersectionObserver.cpp:
1705         (WebCore::IntersectionObserver::observe):
1706
1707 2019-05-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1708
1709         [FreeType] Some character sequences with a variation selector are not rendered
1710         https://bugs.webkit.org/show_bug.cgi?id=197838
1711
1712         Reviewed by Michael Catanzaro.
1713
1714         We get the invalid glyph instead. See http://mts.io/2015/04/21/unicode-symbol-render-text-emoji/. In the table at
1715         the end the Emoji and Text columns are not correctly rendered. It happens also when copying an emoji from
1716         GtkEmojiChooser and pasting in WebKit text field, because GTK appends U+FE0F to all emojis to force the emoji
1717         style. We need to take into account the variation selector when checking if a font can render a combining
1718         sequence, using FT_Face_GetCharVariantIndex to get the right glyph in case of variation character present.
1719
1720         * platform/graphics/Font.cpp:
1721         (WebCore::Font::platformSupportsCodePoint const): Add optional variation parameter.
1722         (WebCore::Font::canRenderCombiningCharacterSequence const): Take into account variation selector characters
1723         * platform/graphics/Font.h:
1724         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
1725         (WebCore::FontCascade::fontForCombiningCharacterSequence const): Check variation selectors 0xFE0E and 0xFE0F to
1726         decide whether to use the emoji or text style.
1727         * platform/graphics/cocoa/FontCocoa.mm:
1728         (WebCore::Font::platformSupportsCodePoint const): Return false when a variation character is passed so that
1729         characters are checked individually.
1730         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
1731         (WebCore::Font::platformSupportsCodePoint const): Use FT_Face_GetCharVariantIndex when a variation character is
1732         passed.
1733         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
1734         (WebCore::harfBuzzFontFunctions): Do not return true when FT_Face_GetCharVariantIndex returns 0.
1735
1736 2019-05-16  Greg Hughes  <ghughes@apple.com>
1737
1738         Updated screenHasInvertedColors to use AppKit when available
1739         https://bugs.webkit.org/show_bug.cgi?id=197935
1740         <rdar://problem/50834405>
1741
1742         Reviewed by Chris Fleizach.
1743
1744         * platform/mac/PlatformScreenMac.mm:
1745         (WebCore::collectScreenProperties):
1746         (WebCore::screenHasInvertedColors):
1747
1748 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
1749
1750         Avoid a recursive descendants layer walk sometimes
1751         https://bugs.webkit.org/show_bug.cgi?id=197939
1752
1753         Reviewed by Zalan Bujtas.
1754
1755         If a layer got composited post-descendants because it needs to clip, for example, we'd do a recursive
1756         descendant tree walk to add layers to the overlap map. However, all the descendants would already
1757         have contributed to the overlap map if some non-root ancestor was already composited. So we can
1758         skip the addDescendantsToOverlapMapRecursive() if we know, before descendants, whether there's
1759         a non-root composited ancestor.
1760
1761         * rendering/RenderLayerCompositor.cpp:
1762         (WebCore::RenderLayerCompositor::CompositingState::hasNonRootCompositedAncestor const):
1763         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1764
1765 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
1766
1767         Clean up code related to compositing overlap map maintenance
1768         https://bugs.webkit.org/show_bug.cgi?id=197936
1769
1770         Reviewed by Zalan Bujtas.
1771
1772         Clarify the logic around updating the overlap map:
1773
1774         When a layer becomes composited, or paints into a non-root composited layer, we add it to the overlap map
1775         after traversing descendants (since it only affets layers later in traversal).
1776
1777         If a layer became composited after traversing descendants, we need to go back and add all the descendants
1778         to the overlap map with a recursive traversal.
1779
1780         We can do all this near the end of computeCompositingRequirements/traverseUnchangedSubtree because
1781         we only check overlap when we enter this function on later layers.
1782
1783         Add a CompositingOverlap log channel and use it to log the state of the overlap map.
1784
1785         * platform/Logging.h:
1786         * rendering/RenderLayerCompositor.cpp:
1787         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1788         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
1789         (WebCore::RenderLayerCompositor::addToOverlapMap const):
1790         (WebCore::RenderLayerCompositor::addDescendantsToOverlapMapRecursive const):
1791         (WebCore::RenderLayerCompositor::updateOverlapMap const):
1792         (WebCore::RenderLayerCompositor::addToOverlapMap): Deleted.
1793         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive): Deleted.
1794         * rendering/RenderLayerCompositor.h:
1795
1796 2019-05-15  Timothy Hatcher  <timothy@apple.com>
1797
1798         REGRESSION (r245072): Missing code in Document::styleColorOptions to propagate StyleColor::Options::UseInactiveAppearance
1799         https://bugs.webkit.org/show_bug.cgi?id=197930
1800         rdar://problem/49833954
1801
1802         Reviewed by Wenson Hsieh and Megan Gardner.
1803
1804         Add some code that was missing from Document in my original patch for r245072.
1805
1806         * dom/Document.cpp:
1807         (WebCore::Document::useSystemAppearance const): Drive-by fix code style.
1808         (WebCore::Document::useInactiveAppearance const): Added.
1809         (WebCore::Document::styleColorOptions const): Add StyleColor::Options::UseInactiveAppearance.
1810         * dom/Document.h: Added useInactiveAppearance().
1811
1812 2019-05-15  Devin Rousso  <drousso@apple.com>
1813
1814         Web Inspector: user gesture toggle should also force user interaction flag
1815         https://bugs.webkit.org/show_bug.cgi?id=197269
1816
1817         Reviewed by Joseph Pecoraro.
1818
1819         Test: inspector/runtime/evaluate-userGestureEmulation-userIsInteracting.html
1820
1821         * inspector/agents/page/PageRuntimeAgent.cpp:
1822         (WebCore::PageRuntimeAgent::evaluate):
1823
1824         * page/ChromeClient.h:
1825         (WebCore::ChromeClient::userIsInteracting const): Added.
1826         (WebCore::ChromeClient::setUserIsInteracting): Added.
1827
1828         * testing/Internals.idl:
1829         * testing/Internals.h:
1830         * testing/Internals.cpp:
1831         (WebCore::Internals::userIsInteracting): Added.
1832
1833 2019-05-15  Zalan Bujtas  <zalan@apple.com>
1834
1835         Do not create a shape object outside of the layout context
1836         https://bugs.webkit.org/show_bug.cgi?id=197926
1837         <rdar://problem/50627858>
1838
1839         Reviewed by Simon Fraser.
1840
1841         ShapeOutside objects are used to compute line constrains during layout (in a strict sense, they are part of the layout context and should only be mutated during layout).
1842         If we don't create one during layout, we probably don't need to know its geometry during paint (or any other non-layout activity) either.
1843
1844         Test: fast/block/float/float-with-shape-outside-crash.html
1845
1846         * rendering/FloatingObjects.cpp:
1847         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
1848         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
1849         * rendering/shapes/ShapeOutsideInfo.cpp:
1850         (WebCore::ShapeOutsideInfo::computeDeltasForContainingBlockLine):
1851
1852 2019-05-15  Youenn Fablet  <youenn@apple.com>
1853
1854         Mark beacon and ping loads as low priority
1855         https://bugs.webkit.org/show_bug.cgi?id=197919
1856         <rdar://problem/50818286>
1857
1858         Reviewed by Alex Christensen.
1859
1860         No JS observable change of behavior.
1861
1862         * Modules/beacon/NavigatorBeacon.cpp:
1863         (WebCore::NavigatorBeacon::sendBeacon):
1864         * loader/PingLoader.cpp:
1865         (WebCore::PingLoader::sendPing):
1866
1867 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
1868
1869         Clean up RenderLayerCompositor::computeCompositingRequirements() and traverseUnchangedSubtree()
1870         https://bugs.webkit.org/show_bug.cgi?id=197931
1871
1872         Reviewed by Zalan Bujtas.
1873
1874         These functions have grown and become hard to maintain, so try to undo some technical debt.
1875
1876         Rename "childState" to "currentState" since it's the state we pass to children, but also
1877         is state we change when the current layer becomes composited.
1878
1879         Separate the layerWillComposite() lambda from layerWillCompositePostDescendants().
1880
1881         Group the chunks of code at end of the functions into:
1882             - updating bits on RenderLayer
1883             - updating compositingState with changes from children and our state
1884             - doing post-traversal work on overlapMap and backingSharingState
1885
1886         Code shared between the two functions is pushed into CompositingState::updateWithDescendantStateAndLayer().
1887
1888         This moves code around but should not cause any behavior change.
1889
1890         * rendering/RenderLayerBacking.cpp:
1891         (WebCore::RenderLayerBacking::updateConfiguration):
1892         * rendering/RenderLayerCompositor.cpp:
1893         (WebCore::RenderLayerCompositor::OverlapExtent::knownToBeHaveExtentUncertainty const):
1894         (WebCore::RenderLayerCompositor::CompositingState::updateWithDescendantStateAndLayer):
1895         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1896         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
1897         (WebCore::RenderLayerCompositor::clipsCompositingDescendants):
1898         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren): Deleted.
1899         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree): Deleted.
1900         (WebCore::RenderLayerCompositor::clipsCompositingDescendants const): Deleted.
1901         * rendering/RenderLayerCompositor.h:
1902
1903 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
1904
1905         Make LayerOverlapMap able to output to a TextStream
1906         https://bugs.webkit.org/show_bug.cgi?id=197923
1907
1908         Reviewed by Zalan Bujtas.
1909
1910         Make it possible output LayerOverlapMap to a TextStream for logging.
1911
1912         * rendering/LayerOverlapMap.cpp:
1913         (WebCore::OverlapMapContainer::rectList const):
1914         (WebCore::operator<<):
1915         * rendering/LayerOverlapMap.h:
1916         (WebCore::LayerOverlapMap::overlapStack const):
1917
1918 2019-05-15  Youenn Fablet  <youenn@apple.com>
1919
1920         getUserMedia sandbox extensions should not be revoked when a getUserMedia allowed request is being processed
1921         https://bugs.webkit.org/show_bug.cgi?id=197851
1922
1923         Reviewed by Alex Christensen.
1924
1925         Add a completion handler to create a new capture stream.
1926         This is used by WK2 layer to acknowledge the pending capture request is completed.
1927         Just after the completion handler, make sure to update the document media state.
1928         This is done to ensure that, should capture failing, the UIProcess
1929         knows about it and can manage proper sandbox extension revocation.
1930
1931         Test: fast/mediastream/gum-stop-track.html
1932
1933         * Modules/mediastream/UserMediaRequest.cpp:
1934         (WebCore::UserMediaRequest::allow):
1935         (WebCore::UserMediaRequest::PendingActivationMediaStream::PendingActivationMediaStream):
1936         (WebCore::UserMediaRequest::PendingActivationMediaStream::~PendingActivationMediaStream):
1937         * Modules/mediastream/UserMediaRequest.h:
1938         (WebCore::UserMediaRequest::PendingActivationMediaStream::create):
1939         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1940         (WebCore::MockRealtimeMediaSourceCenter::mockRealtimeMediaSourceCenterEnabled):
1941         * platform/mock/MockRealtimeMediaSourceCenter.h:
1942
1943 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
1944
1945         Make LOG_WITH_STREAM more efficient
1946         https://bugs.webkit.org/show_bug.cgi?id=197905
1947
1948         Reviewed by Alex Christensen.
1949
1950         No longer need to conditionalize ClipRects logging on the channel being enabled
1951         since LOG_WITH_STREAM fix the performance problem.
1952
1953         Convert some RenderLayerCompositor logging to use LOG_WITH_STREAM.
1954
1955         * rendering/RenderLayer.cpp:
1956         (WebCore::RenderLayer::calculateClipRects const):
1957         (WebCore::clipRectsLogEnabled): Deleted.
1958         * rendering/RenderLayerCompositor.cpp:
1959         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1960         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
1961
1962 2019-05-15  Simon Fraser  <simon.fraser@apple.com>
1963
1964         Move RenderLayerCompositor's OverlapMap to its own file
1965         https://bugs.webkit.org/show_bug.cgi?id=197915
1966
1967         Reviewed by Alex Christensen.
1968
1969         Move OverlapMap to its own file.
1970         Make use of RectList, which was in the file but unused!
1971         Allocate OverlapMapContainer on the heap both to avoid header pollution of internals,
1972         and because they will get bigger in future.
1973
1974         No behavior change.
1975
1976         * Sources.txt:
1977         * WebCore.xcodeproj/project.pbxproj:
1978         * rendering/LayerOverlapMap.cpp: Added.
1979         (WebCore::RectList::append):
1980         (WebCore::RectList::intersects const):
1981         (WebCore::OverlapMapContainer::add):
1982         (WebCore::OverlapMapContainer::overlapsLayers const):
1983         (WebCore::OverlapMapContainer::unite):
1984         (WebCore::LayerOverlapMap::LayerOverlapMap):
1985         (WebCore::LayerOverlapMap::add):
1986         (WebCore::LayerOverlapMap::overlapsLayers const):
1987         (WebCore::LayerOverlapMap::pushCompositingContainer):
1988         (WebCore::LayerOverlapMap::popCompositingContainer):
1989         * rendering/LayerOverlapMap.h: Added.
1990         (WebCore::LayerOverlapMap::isEmpty const):
1991         (WebCore::LayerOverlapMap::geometryMap const):
1992         (WebCore::LayerOverlapMap::geometryMap):
1993         * rendering/RenderLayerCompositor.cpp:
1994         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1995         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1996         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
1997         (WebCore::RenderLayerCompositor::computeExtent const):
1998         (WebCore::RenderLayerCompositor::addToOverlapMap):
1999         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
2000         (WebCore::OverlapMapContainer::add): Deleted.
2001         (WebCore::OverlapMapContainer::overlapsLayers const): Deleted.
2002         (WebCore::OverlapMapContainer::unite): Deleted.
2003         (WebCore::RenderLayerCompositor::OverlapMap::OverlapMap): Deleted.
2004         (WebCore::RenderLayerCompositor::OverlapMap::add): Deleted.
2005         (WebCore::RenderLayerCompositor::OverlapMap::overlapsLayers const): Deleted.
2006         (WebCore::RenderLayerCompositor::OverlapMap::isEmpty const): Deleted.
2007         (WebCore::RenderLayerCompositor::OverlapMap::pushCompositingContainer): Deleted.
2008         (WebCore::RenderLayerCompositor::OverlapMap::popCompositingContainer): Deleted.
2009         (WebCore::RenderLayerCompositor::OverlapMap::geometryMap const): Deleted.
2010         (WebCore::RenderLayerCompositor::OverlapMap::geometryMap): Deleted.
2011         (WebCore::RenderLayerCompositor::OverlapMap::RectList::append): Deleted.
2012         (WebCore::RenderLayerCompositor::OverlapMap::RectList::intersects const): Deleted.
2013         * rendering/RenderLayerCompositor.h:
2014
2015 2019-05-15  Devin Rousso  <drousso@apple.com>
2016
2017         Web Automation: elements larger than the viewport have incorrect in-view center point
2018         https://bugs.webkit.org/show_bug.cgi?id=195696
2019         <rdar://problem/48737122>
2020
2021         Reviewed by Simon Fraser.
2022
2023         Original patch by Brian Burg <bburg@apple.com>.
2024
2025         Some conversion methods do not exist for `FloatRect`/`FloatPoint`. Fill them in as needed,
2026         and export some symbols used by WebDriver code to compute an element's in-view center point
2027         in various coordinate systems.
2028
2029         * dom/TreeScope.h:
2030         * dom/TreeScope.cpp:
2031         (WebCore::TreeScope::elementsFromPoint): Added.
2032         * page/FrameView.h:
2033         * page/FrameView.cpp:
2034         (WebCore::FrameView::absoluteToLayoutViewportPoint const): Added.
2035         (WebCore::FrameView::layoutViewportToAbsoluteRect const): Added.
2036         (WebCore::FrameView::absoluteToLayoutViewportRect const): Added.
2037         * platform/ScrollView.h:
2038         * platform/ScrollView.cpp:
2039         (WebCore::ScrollView::viewToContents const): Added.
2040         (WebCore::ScrollView::contentsToView const): Added.
2041         (WebCore::ScrollView::contentsToRootView const): Added.
2042         * platform/Widget.h:
2043         * platform/Widget.cpp:
2044         (WebCore::Widget::convertToRootView const): Added.
2045         (WebCore::Widget::convertFromRootView const): Added.
2046         (WebCore::Widget::convertToContainingView const): Added.
2047         (WebCore::Widget::convertFromContainingView const): Added.
2048
2049 2019-05-14  Wenson Hsieh  <wenson_hsieh@apple.com>
2050
2051         Missing cursor/caret showing in search field on google.com
2052         https://bugs.webkit.org/show_bug.cgi?id=197862
2053         <rdar://problem/50291989>
2054
2055         Reviewed by Simon Fraser.
2056
2057         In this bug, the search field is inside of a fixed position container, which is inside of an empty "overflow:
2058         hidden" form element (the new layout test demonstrates a simple version of this). The layer of the fixed
2059         position container's renderer has an overflow clipping layer of itself, and its clipping rect is non-empty, so
2060         the heuristic initially identifies the layer as not fully clipped. However, as the heuristic ascends the
2061         RenderLayer tree, it then finds the layer for the "overflow: hidden" form element's renderer; this layer is
2062         completely clipped, which causes the heuristic to incorrectly believe that the editable element is completely
2063         clipped.
2064
2065         To fix the bug, this patch reworks the clipping portion of the heuristic, such that we no longer need to ascend
2066         the layer tree. Instead of computing the clip rect relative to the nearest ancestor that has an overflow clip
2067         and then walking up the layer tree repeating this process, simply compute the clip rect relative to RenderView's
2068         layer, and then walk up to the parent frame and repeat if necessary.
2069
2070         Test: editing/selection/ios/do-not-hide-selection-in-visible-field.html
2071
2072         * rendering/RenderLayer.cpp:
2073         (WebCore::RenderLayer::isTransparentOrFullyClippedRespectingParentFrames const):
2074
2075 2019-05-14  Andy Estes  <aestes@apple.com>
2076
2077         [Apple Pay] Payment APIs should be completely disabled in web views into which clients have injected user scripts
2078         https://bugs.webkit.org/show_bug.cgi?id=197751
2079         <rdar://problem/50631563>
2080
2081         Reviewed by Alex Christensen.
2082
2083         In r243324, when a document has had user agent scripts injected into it, payment APIs were
2084         disabled at runtime by having all entry points return falsy values or throw exceptions
2085         (e.g., ApplePaySession.canMakePayments() returns false).
2086
2087         In the case of user scripts in particular (e.g., WKUserScript), since we know whether these
2088         exist at the time we create a document's DOMWindow, we can do better than r243324 by
2089         completely disabling the payment APIs in the presence of user scripts.
2090
2091         To achieve this, this change introduces the 'EnabledByContext' extended attribute for
2092         interfaces, which instructs the bindings generator to add a conjunct to the payment API
2093         constructors that asks the interface's implementation class whether it should be enabled for
2094         a given ScriptExecutionContext. The PaymentRequest and ApplePaySession interfaces adopt this
2095         new extended attribute to implement the new user script check.
2096
2097         Added new API tests.
2098
2099         * Modules/applepay/ApplePaySession.idl:
2100         * Modules/applepay/PaymentCoordinator.cpp:
2101         (WebCore::PaymentCoordinator::shouldEnableApplePayAPIs const):
2102         * Modules/applepay/PaymentCoordinator.h:
2103         * Modules/applepay/PaymentSession.cpp:
2104         (WebCore::PaymentSession::enabledForContext):
2105         * Modules/applepay/PaymentSession.h:
2106         * Modules/paymentrequest/PaymentHandler.cpp:
2107         (WebCore::PaymentHandler::enabledForContext):
2108         * Modules/paymentrequest/PaymentHandler.h:
2109         * Modules/paymentrequest/PaymentRequest.cpp:
2110         (WebCore::PaymentRequest::enabledForContext):
2111         * Modules/paymentrequest/PaymentRequest.h:
2112         * Modules/paymentrequest/PaymentRequest.idl:
2113         * bindings/scripts/CodeGeneratorJS.pm:
2114         (NeedsRuntimeCheck):
2115         (GenerateRuntimeEnableConditionalString):
2116         * bindings/scripts/IDLAttributes.json:
2117         * bindings/scripts/preprocess-idls.pl:
2118         (GenerateConstructorAttributes):
2119         * bindings/scripts/test/JS/JSTestEnabledForContext.cpp: Added.
2120         * bindings/scripts/test/JS/JSTestEnabledForContext.h: Added.
2121         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2122         (WebCore::JSTestGlobalObject::finishCreation):
2123         (WebCore::jsTestGlobalObjectTestEnabledForContextConstructorGetter):
2124         (WebCore::jsTestGlobalObjectTestEnabledForContextConstructor):
2125         (WebCore::setJSTestGlobalObjectTestEnabledForContextConstructorSetter):
2126         (WebCore::setJSTestGlobalObjectTestEnabledForContextConstructor):
2127         * bindings/scripts/test/TestEnabledForContext.idl: Added.
2128
2129 2019-05-14  Robin Morisset  <rmorisset@apple.com>
2130
2131         [WHLSL] parseEffectfulSuffix() is never called
2132         https://bugs.webkit.org/show_bug.cgi?id=195864
2133         <rdar://problem/50746278>
2134
2135         Reviewed by Myles C. Maxfield.
2136
2137         The fix is trivial: when parseEffectfulPrefix does not see a ++ or --, it must call parseEffectfulSuffix.
2138
2139         No test yet, as it is not testable until the property resolver is finished.
2140         It will be tested with the rest of the compiler, when we port the testsuite from the js implementation (it already covers this case).
2141
2142         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
2143         (WebCore::WHLSL::Parser::parseEffectfulPrefix):
2144
2145 2019-05-14  Robin Morisset  <rmorisset@apple.com>
2146
2147         [WHLSL] parseEffectfulAssignment should not call parseCallExpression directly
2148         https://bugs.webkit.org/show_bug.cgi?id=197890
2149
2150         Reviewed by Myles Maxfield.
2151
2152         callExpression already appears in effSuffix which is in effPrefix which is in effAssignment, so having it directly in effAssignment as well is useless (and ambiguous).
2153         I've already fixed the grammar (https://github.com/gpuweb/WHLSL/commit/a07005f4d692fe3370618dca5db218992b362049), the grammar was always good, this patch is fixing the parser.
2154
2155         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
2156         (WebCore::WHLSL::Parser::parseEffectfulAssignment):
2157
2158 2019-05-14  Ross Kirsling  <ross.kirsling@sony.com>
2159
2160         Unreviewed restoration of non-unified build.
2161
2162         * Modules/cache/DOMCache.cpp:
2163         * bindings/js/JSLazyEventListener.h:
2164         * loader/NavigationScheduler.h:
2165         * page/Quirks.cpp:
2166         * page/Quirks.h:
2167         * rendering/ClipRect.cpp:
2168
2169 2019-05-14  Zalan Bujtas  <zalan@apple.com>
2170
2171         Do not try to issue repaint while the render tree is being destroyed.
2172         https://bugs.webkit.org/show_bug.cgi?id=197461
2173         <rdar://problem/50368992>
2174
2175         Reviewed by Simon Fraser.
2176
2177         Test: http/tests/svg/crash-on-reload-with-filter.html
2178
2179         We don't need to compute repaint rects when the render tree is getting torn down. We'll issue a full repaint at some point.
2180         Also during full render tree destruction the inline tree state is undefined. We should avoid accessing it.
2181
2182         * rendering/svg/RenderSVGResourceContainer.cpp:
2183         (WebCore::RenderSVGResourceContainer::markAllClientLayersForInvalidation):
2184
2185 2019-05-14  Youenn Fablet  <youenn@apple.com>
2186
2187         A service worker process should app nap when all its clients app nap
2188         https://bugs.webkit.org/show_bug.cgi?id=185626
2189         <rdar://problem/46785908>
2190
2191         Reviewed by Alex Christensen.
2192
2193         Update RegistrableDomain to work with SecurityOriginData.
2194         Add internal API to enable accessing to service worker process throttle state.
2195
2196         Test: http/wpt/service-workers/mac/processSuppression.https.html
2197
2198         * platform/RegistrableDomain.h:
2199         (WebCore::RegistrableDomain::RegistrableDomain):
2200         (WebCore::RegistrableDomain::matches const):
2201         (WebCore::RegistrableDomain::registrableDomainFromHost):
2202         * testing/ServiceWorkerInternals.cpp:
2203         (WebCore::ServiceWorkerInternals::isThrottleable const):
2204         * testing/ServiceWorkerInternals.h:
2205         * testing/ServiceWorkerInternals.idl:
2206         * workers/service/SWClientConnection.h:
2207         * workers/service/context/SWContextManager.cpp:
2208         * workers/service/context/SWContextManager.h:
2209         * workers/service/server/SWServer.cpp:
2210         (WebCore::SWServer::serverToContextConnectionCreated):
2211         * workers/service/server/SWServer.h:
2212         (WebCore::SWServer::Connection::server const):
2213         (WebCore::SWServer::connections const):
2214         * workers/service/server/SWServerToContextConnection.h:
2215
2216 2019-05-14  Youenn Fablet  <youenn@apple.com>
2217
2218         getUserMedia capture changes on iOS after homing out
2219         https://bugs.webkit.org/show_bug.cgi?id=197707
2220
2221         Reviewed by Eric Carlson.
2222
2223         In case of muting an AVVideoCaptureSource on iOS, the session is cleared.
2224         We need to store the preset information, to setup the new session on unnmuting correctly.
2225         Manually tested.
2226
2227         * platform/mediastream/mac/AVVideoCaptureSource.h:
2228         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2229         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
2230         (WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate):
2231         (WebCore::AVVideoCaptureSource::setupCaptureSession):
2232
2233 2019-05-14  Oriol Brufau  <obrufau@igalia.com>
2234
2235         [css-grid] Update grid when changing auto repeat type
2236         https://bugs.webkit.org/show_bug.cgi?id=197849
2237
2238         Reviewed by Javier Fernandez.
2239
2240         Test: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-change-auto-repeat-tracks.html
2241
2242         This patch makes two 'repeat()' values for 'grid-template' be considered
2243         to be different if one uses 'auto-fill' and the other 'auto-fit'.
2244
2245         Previously, they were considered to be equal if the repeated values
2246         were the same, without comparing the repeat type. Therefore, the grid
2247         was not updated when setting both values one after the other.
2248
2249         * css/CSSGridAutoRepeatValue.cpp:
2250         (WebCore::CSSGridAutoRepeatValue::equals const):
2251         * css/CSSGridAutoRepeatValue.h:
2252
2253 2019-05-14  Antti Koivisto  <antti@apple.com>
2254
2255         Event region computation should respect transforms
2256         https://bugs.webkit.org/show_bug.cgi?id=197836
2257         <rdar://problem/50762971>
2258
2259         Reviewed by Darin Adler.
2260
2261         * platform/graphics/transforms/AffineTransform.cpp:
2262         (WebCore::AffineTransform::mapRegion const):
2263
2264         Add support for transforming regions. Non-rectlinear results use enclosing rects.
2265
2266         * platform/graphics/transforms/AffineTransform.h:
2267         * rendering/EventRegion.cpp:
2268         (WebCore::EventRegionContext::EventRegionContext):
2269         (WebCore::EventRegionContext::pushTransform):
2270         (WebCore::EventRegionContext::popTransform):
2271         (WebCore::EventRegionContext::unite):
2272         (WebCore::EventRegionContext::contains const):
2273
2274         Add a context object that holds the current transform.
2275
2276         * rendering/EventRegion.h:
2277         (WebCore::EventRegion::makeContext):
2278         * rendering/InlineTextBox.cpp:
2279         (WebCore::InlineTextBox::paint):
2280         * rendering/PaintInfo.h:
2281
2282         Replace the region object with the context.
2283
2284         * rendering/RenderBlock.cpp:
2285         (WebCore::RenderBlock::paintObject):
2286         * rendering/RenderLayer.cpp:
2287         (WebCore::RenderLayer::paintLayerByApplyingTransform):
2288
2289         Apply transforms to regions if needed.
2290
2291         (WebCore::RenderLayer::collectEventRegionForFragments):
2292         * rendering/RenderLayer.h:
2293         * rendering/RenderLayerBacking.cpp:
2294         (WebCore::RenderLayerBacking::updateEventRegion):
2295         * rendering/SimpleLineLayoutFunctions.cpp:
2296         (WebCore::SimpleLineLayout::paintFlow):
2297
2298 2019-05-14  Youenn Fablet  <youenn@apple.com>
2299
2300         Video frame resizing should be using Trim
2301         https://bugs.webkit.org/show_bug.cgi?id=197722
2302         <rdar://problem/50602188>
2303
2304         Reviewed by Eric Carlson.
2305
2306         Move from letter box to trim mode for resizing.
2307         This ensures no black stripes are present when rendering the stream.
2308
2309         Test: fast/mediastream/resize-trim.html
2310
2311         * platform/cocoa/VideoToolboxSoftLink.cpp:
2312         * platform/cocoa/VideoToolboxSoftLink.h:
2313         * platform/graphics/cv/ImageTransferSessionVT.mm:
2314         (WebCore::ImageTransferSessionVT::ImageTransferSessionVT):
2315
2316 2019-05-14  Yusuke Suzuki  <ysuzuki@apple.com>
2317
2318         [JSC] Shrink sizeof(UnlinkedFunctionExecutable) more
2319         https://bugs.webkit.org/show_bug.cgi?id=197833
2320
2321         Reviewed by Darin Adler.
2322
2323         * testing/Internals.cpp:
2324         (WebCore::Internals::parserMetaData):
2325
2326 2019-05-14  Antoine Quint  <graouts@apple.com>
2327
2328         [Pointer Events] The pointerenter and pointerleave events target the wrong element on iOS
2329         https://bugs.webkit.org/show_bug.cgi?id=197881
2330         <rdar://problem/50187657>
2331
2332         Reviewed by Dean Jackson.
2333
2334         Test: pointerevents/ios/enter-leave-target.html
2335
2336         The "pointerenter" and "pointerleave" should target the element on which the event listener was added and not
2337         the element that would otherwise hit test. This matches the behavior of "mouseenter" and "mouseleave" on macOS.
2338
2339         * page/PointerCaptureController.cpp:
2340         (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
2341
2342 2019-05-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
2343
2344         [CG] Adding support for HEIF-sequence ('public.heics') images
2345         https://bugs.webkit.org/show_bug.cgi?id=197384
2346
2347         Reviewed by Simon Fraser.
2348
2349         -- Get the image repetitionCount and the frame duration.
2350         -- Add a new function setAdditionalSupportedImageTypesForTesting() which
2351            takes a delimited String.
2352         -- Add internal APIs to retrive the image frame count and the frame
2353            duration.
2354
2355         Tests: fast/images/animated-heics-draw.html
2356                fast/images/animated-heics-verify.html
2357
2358         * platform/graphics/ImageSource.h:
2359         * platform/graphics/cg/ImageDecoderCG.cpp:
2360         (WebCore::animationPropertiesFromProperties):
2361         (WebCore::animationHEICSPropertiesFromProperties):
2362         (WebCore::ImageDecoderCG::repetitionCount const):
2363         (WebCore::ImageDecoderCG::frameDurationAtIndex const):
2364         * platform/graphics/cg/UTIRegistry.cpp:
2365         (WebCore::setAdditionalSupportedImageTypesForTesting):
2366         * platform/graphics/cg/UTIRegistry.h:
2367         * testing/Internals.cpp:
2368         (WebCore::Internals::imageFrameCount):
2369         (WebCore::Internals::imageFrameDurationAtIndex):
2370         * testing/Internals.h:
2371         * testing/Internals.idl:
2372         * testing/js/WebCoreTestSupport.cpp:
2373         (WebCoreTestSupport::setAdditionalSupportedImageTypesForTesting):
2374         * testing/js/WebCoreTestSupport.h:
2375
2376 2019-05-14  Manuel Rego Casasnovas  <rego@igalia.com>
2377
2378         [css-grid] Use max size to compute auto repeat tracks
2379         https://bugs.webkit.org/show_bug.cgi?id=197854
2380
2381         Reviewed by Javier Fernandez.
2382
2383         When available size is indefinite we should use max size to compute the number of auto repeat tracks.
2384
2385         The spec text is very clear (https://drafts.csswg.org/css-grid/#auto-repeat):
2386         > When auto-fill is given as the repetition number, if the grid container
2387         > has a definite size or **max size** in the relevant axis...
2388
2389         So far we were not doing that for widths, in this patch we modify RenderGrid::computeAutoRepeatTracksCount()
2390         to do the same than for heights.
2391
2392         We also take advantage to fix problems related to min|max sizes and box-sizing property,
2393         that were inconsistent for columns and rows.
2394
2395         Tests: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-001.html
2396                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-002.html
2397                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-max-size-001.html
2398                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-001.html
2399                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-002.html
2400
2401         * rendering/RenderGrid.cpp:
2402         (WebCore::RenderGrid::computeAutoRepeatTracksCount const):
2403
2404 2019-05-14  Joonghun Park  <pjh0718@gmail.com>
2405
2406         Implement page-break-* and -webkit-column-break-* as legacy-shorthands.
2407         https://bugs.webkit.org/show_bug.cgi?id=197656
2408
2409         Reviewed by Darin Adler.
2410
2411         According to https://drafts.csswg.org/css-cascade-4/#legacy-shorthand,
2412         implement page-break-* and -webkit-column-break-* as legacy-shorthands for break-*.
2413
2414         This change also serialize page-break-* properties
2415         to CSSStyleDeclaration,
2416         per https://drafts.csswg.org/css-break/#page-break-properties.
2417
2418         * css/CSSProperties.json:
2419         * css/StyleBuilderConverter.h:
2420         (WebCore::StyleBuilderConverter::convertFontSynthesis):
2421         (WebCore::StyleBuilderConverter::convertPageBreakBetween): Deleted.
2422         (WebCore::StyleBuilderConverter::convertPageBreakInside): Deleted.
2423         (WebCore::StyleBuilderConverter::convertColumnBreakBetween): Deleted.
2424         (WebCore::StyleBuilderConverter::convertColumnBreakInside): Deleted.
2425         * css/StyleProperties.cpp:
2426         (WebCore::StyleProperties::getPropertyValue const):
2427         (WebCore::StyleProperties::pageBreakPropertyValue const):
2428         * css/StyleProperties.h:
2429         * css/parser/CSSPropertyParser.cpp:
2430         (WebCore::CSSPropertyParser::parseValueStart):
2431         (WebCore::mapFromPageBreakBetween):
2432         (WebCore::CSSPropertyParser::parseShorthand):
2433         (WebCore::isLegacyBreakProperty): Deleted.
2434
2435 2019-05-14  Javier Fernandez  <jfernandez@igalia.com>
2436
2437         Implement "line-break: anywhere"
2438         https://bugs.webkit.org/show_bug.cgi?id=181169
2439         <rdar://problem/48507088>
2440
2441         Reviewed by Myles C. Maxfield.
2442
2443         The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
2444         CSS property in order to allow additional breaking opportunities not
2445         considered in the definition of the 'word-break: break-all'.
2446
2447         [1] https://github.com/w3c/csswg-drafts/issues/1171
2448
2449         Tests: imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-003.html
2450                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-004.html
2451                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-005.html
2452                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-006.html
2453                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-007.html
2454                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-008.html
2455                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-009.html
2456                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-010.html
2457                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-011.html
2458                imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-012.html
2459                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-016.html
2460                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-017.html
2461                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-018.html
2462                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-019.html
2463                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-021.html
2464                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-022.html
2465                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-023.html
2466                imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-024.html
2467
2468         * css/CSSPrimitiveValueMappings.h:
2469         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2470         (WebCore::CSSPrimitiveValue::operator LineBreak const):
2471         * css/CSSProperties.json:
2472         * css/CSSValueKeywords.in:
2473         * css/parser/CSSParserFastPaths.cpp:
2474         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2475         * rendering/BreakLines.h:
2476         (WebCore::nextBreakablePositionBreakCharacter):
2477         (WebCore::isBreakable):
2478         * rendering/RenderText.cpp:
2479         (WebCore::mapLineBreakToIteratorMode):
2480         (WebCore::RenderText::computePreferredLogicalWidths):
2481         * rendering/line/BreakingContext.h:
2482         (WebCore::BreakingContext::handleText):
2483         * rendering/style/RenderStyleConstants.h:
2484
2485 2019-05-13  Yusuke Suzuki  <ysuzuki@apple.com>
2486
2487         Unreviewed, build fix after 245258, missing ThreadSpecific.h include
2488         https://bugs.webkit.org/show_bug.cgi?id=197146
2489
2490         * platform/ios/wak/WebCoreThread.mm:
2491
2492 2019-05-13  Yusuke Suzuki  <ysuzuki@apple.com>
2493
2494         [WTF] Simplify GCThread and CompilationThread flags by adding them to WTF::Thread
2495         https://bugs.webkit.org/show_bug.cgi?id=197146
2496
2497         Reviewed by Saam Barati.
2498
2499         * Modules/indexeddb/IDBDatabase.cpp:
2500         (WebCore::IDBDatabase::hasPendingActivity const):
2501         * Modules/indexeddb/IDBRequest.cpp:
2502         (WebCore::IDBRequest::hasPendingActivity const):
2503         * Modules/indexeddb/IDBTransaction.cpp:
2504         (WebCore::IDBTransaction::hasPendingActivity const):
2505
2506 2019-05-13  Geoffrey Garen  <ggaren@apple.com>
2507
2508         Downgrade RELEASE_ASSERT TO RELEASE_LOG_FAULT for SQLite Class A files
2509         https://bugs.webkit.org/show_bug.cgi?id=197760
2510
2511         Reviewed by Jer Noble.
2512
2513         Only makeSafeToUseMemoryMapForPath() if needed. (Fixed missing brace.)
2514
2515         * platform/sql/SQLiteDatabase.cpp:
2516         (WebCore::SQLiteDatabase::open):
2517
2518 2019-05-13  Tadeu Zagallo  <tzagallo@apple.com>
2519
2520         JSObject::getOwnPropertyDescriptor is missing an exception check
2521         https://bugs.webkit.org/show_bug.cgi?id=197693
2522
2523         Reviewed by Saam Barati.
2524
2525         JSObject::getOwnPropertyDescriptor assumes that getOwnPropertySlot returns false
2526         if an exception is thrown, but that was not true for JSLocation::getOwnPropertySlotCommon.
2527
2528         This is already covered by http/tests/security/cross-frame-access-getOwnPropertyDescriptor.html
2529
2530         * bindings/js/JSLocationCustom.cpp:
2531         (WebCore::getOwnPropertySlotCommon):
2532         (WebCore::JSLocation::getOwnPropertySlot):
2533         (WebCore::JSLocation::getOwnPropertySlotByIndex):
2534
2535 2019-05-13  Antti Koivisto  <antti@apple.com>
2536
2537         REGRESSION (r245208): compositing/shared-backing/sharing-bounds-non-clipping-shared-layer.html asserts
2538         https://bugs.webkit.org/show_bug.cgi?id=197818
2539         <rdar://problem/50705762>
2540
2541         Reviewed by Simon Fraser.
2542
2543         Tests: fast/scrolling/ios/event-region-scale-transform-shared.html
2544                fast/scrolling/ios/event-region-translate-transform-shared.html
2545
2546         This fixes the assert. However the added tests demonstrate that transform is not taken into account
2547         when computing the event region, https://bugs.webkit.org/show_bug.cgi?id=197836.
2548
2549         * rendering/RenderLayerBacking.cpp:
2550         (WebCore::RenderLayerBacking::updateEventRegion):
2551
2552 2019-05-13  Wenson Hsieh  <wenson_hsieh@apple.com>
2553
2554         [macOS] Font formatting options don't work when composing a message in Yahoo mail
2555         https://bugs.webkit.org/show_bug.cgi?id=197813
2556         <rdar://problem/49382250>
2557
2558         Reviewed by Darin Adler.
2559
2560         The bug happens because on mousedown, the "Aa Font" menu item's event handler hides itself before changing the
2561         font at the text selection. This causes us to clear the selection in FocusController::setFocusedElement.
2562
2563         There is existing logic in clearSelectionIfNeeded that would normally prevent us from clearing the selection due
2564         to the mousePressNode not being able to start a selection. However, since the clickable element in this case is
2565         hidden during mousedown, it is missing a renderer, and we bail from the `mousePressNode->renderer() &&
2566         !mousePressNode->canStartSelection()` check as a result.
2567
2568         This check was orginally added in https://trac.webkit.org/r24334 to avoid clearing the selection when clicking
2569         a button; the intention appears to have been making it so that clicking on something that could not start a
2570         selection (back then, synonymous with -webkit-user-select: ignore;) would not clear the current selection; to
2571         this end, it seems odd to additionally require that the thing being clicked should still have a renderer, so
2572         it seems safe to remove this requirement.
2573
2574         Test: editing/selection/preserve-selection-when-clicking-button.html
2575
2576         * page/FocusController.cpp:
2577         (WebCore::clearSelectionIfNeeded):
2578
2579 2019-05-13  Eric Carlson  <eric.carlson@apple.com>
2580
2581         https://bugs.webkit.org/show_bug.cgi?id=197793
2582         <rdar://problem/46429187>
2583
2584         Unreviewed, build fix after r245199.
2585
2586         * platform/audio/ios/MediaSessionManagerIOS.mm:
2587         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
2588
2589 2019-05-13  Darin Adler  <darin@apple.com>
2590
2591         WHLSLPrepare.cpp always recompiles, even if nothing was changed
2592         https://bugs.webkit.org/show_bug.cgi?id=197151
2593
2594         Reviewed by Dan Bernstein and Keith Rollin.
2595
2596         * DerivedSources-input.xcfilelist: Script updated this automatically after
2597         DerivedSources.make was corrected.
2598         * DerivedSources-output.xcfilelist: Ditto, although I had to manually remove
2599         one bogus leftover reference to WHLSLStandardLibrary.cpp.
2600
2601         * DerivedSources.make: Updated the rule that builds WHSLStandardLibrary.h to
2602         no longer refer to nonexistent WHLSLStandardLibrary.cpp. Because the dependency
2603         was on a file that was never created, the rule to regenerate WHSLStandardLibrary.h
2604         was running on every build, instead of only when one of the dependencies changed.
2605
2606 2019-05-12  Simon Fraser  <simon.fraser@apple.com>
2607
2608         When the set of backing-sharing layers changes, we need to issue a repaint
2609         https://bugs.webkit.org/show_bug.cgi?id=197825
2610
2611         Reviewed by Zalan Bujtas.
2612
2613         If the set of layers painting into a shared backing store changes, we need
2614         to repaint that backing store. This happens when scrolling as shared layers
2615         enter the visible area.
2616
2617         Test: compositing/shared-backing/overflow-scroll/repaint-shared-on-scroll.html
2618
2619         * rendering/RenderLayerBacking.cpp:
2620         (WebCore::RenderLayerBacking::setBackingSharingLayers):
2621
2622 2019-05-02  Simon Fraser  <simon.fraser@apple.com>
2623
2624         Add logging for RenderLayer clip rects
2625         https://bugs.webkit.org/show_bug.cgi?id=197547
2626
2627         Reviewed by Zalan Bujtas.
2628
2629         Add a ClipRects log channel, and stream output for ClipRect and ClipRects.
2630
2631         The ClipRect code is performance sensitive, even in debug, so guard the log sites
2632         with clipRectsLogEnabled() because the macro still evaluates its arguments even if
2633         the channel is disabled (we need some better way to log that doesn't do this).
2634
2635         * platform/Logging.h:
2636         * rendering/ClipRect.cpp:
2637         (WebCore::operator<<):
2638         * rendering/ClipRect.h:
2639         * rendering/RenderLayer.cpp:
2640         (WebCore::operator<<):
2641         (WebCore::RenderLayer::calculateClipRects const):
2642         * rendering/RenderLayer.h:
2643
2644 2019-05-12  Simon Fraser  <simon.fraser@apple.com>
2645
2646         Refactor composited backing-sharing code
2647         https://bugs.webkit.org/show_bug.cgi?id=197824
2648
2649         Reviewed by Zalan Bujtas.
2650
2651         Clean up the backing-sharing code to share more code, and make it easier to understand.
2652         
2653         Moves more logic into member functions on BackingSharingState, which are named to make
2654         their functions clearer: startBackingSharingSequence/endBackingSharingSequence.
2655         
2656         computeCompositingRequirements() and traverseUnchangedSubtree() now just call
2657         updateBeforeDescendantTraversal/updateAfterDescendantTraversal.
2658
2659         No behavior change.
2660
2661         * rendering/RenderLayerBacking.cpp:
2662         (WebCore::RenderLayerBacking::willBeDestroyed):
2663         (WebCore::RenderLayerBacking::setBackingSharingLayers): Remove the early return, since
2664         we need to call setBackingProviderLayer() on the sharing layers in both code paths.
2665         (WebCore::RenderLayerBacking::removeBackingSharingLayer):
2666         (WebCore::RenderLayerBacking::clearBackingSharingLayers):
2667         * rendering/RenderLayerCompositor.cpp:
2668         (WebCore::RenderLayerCompositor::BackingSharingState::backingProviderCandidate const):
2669         (WebCore::RenderLayerCompositor::BackingSharingState::appendSharingLayer):
2670         (WebCore::RenderLayerCompositor::BackingSharingState::startBackingSharingSequence):
2671         (WebCore::RenderLayerCompositor::BackingSharingState::endBackingSharingSequence):
2672         (WebCore::RenderLayerCompositor::BackingSharingState::updateBeforeDescendantTraversal):
2673         (WebCore::RenderLayerCompositor::BackingSharingState::updateAfterDescendantTraversal):
2674         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2675         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
2676         (WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate): Deleted.
2677         * rendering/RenderLayerCompositor.h:
2678
2679 2019-05-12  Youenn Fablet  <youenn@apple.com>
2680
2681         Use clampTo in AVVideoCaptureSource::setSizeAndFrameRateWithPreset
2682         https://bugs.webkit.org/show_bug.cgi?id=197704
2683
2684         Reviewed by Alex Christensen.
2685
2686         Use clampTo as suggested in bug 196214 review.
2687         No change of behavior.
2688
2689         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2690         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
2691
2692 2019-05-12  Youenn Fablet  <youenn@apple.com>
2693
2694         Use the main screen for screen capture
2695         https://bugs.webkit.org/show_bug.cgi?id=197804
2696         <rdar://problem/47671383>
2697
2698         Reviewed by Eric Carlson.
2699
2700         If the main screen, i.e. the screen that has focus at the time of
2701         selection of the screen to capture, is capturable, add it to the list
2702         of screen devices, but do not add any other screen.
2703         This will make sure the main screen is selected.
2704         Manually tested.
2705
2706         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
2707         (WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDevices):
2708
2709 2019-05-12  Takashi Komori  <Takashi.Komori@sony.com>
2710
2711         [Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth.
2712         https://bugs.webkit.org/show_bug.cgi?id=197650
2713
2714         Reviewed by Fujii Hironori.
2715
2716         When Curl port accesses a page which checks Basic Authentication credential and server trust challenge occurs,
2717         Curl port calls extra didReceiveAuthenticationChallenge unnecessarily.
2718         This is because Curl port discards information about allowed server trust challenge before in NetworkDataTaskCurl::restartWithCredential.
2719
2720         Test: http/tests/ssl/curl/certificate-and-authentication.html
2721
2722         * platform/network/curl/CurlRequest.h:
2723         (WebCore::CurlRequest::isServerTrustEvaluationDisabled):
2724
2725 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
2726
2727         Overflow scroll that becomes non-scrollable should stop being composited
2728         https://bugs.webkit.org/show_bug.cgi?id=197817
2729         <rdar://problem/50697290>
2730
2731         Reviewed by Antti Koivisto.
2732
2733         Remove the iOS-specific #ifdef around code that triggers a compositing re-evaluation
2734         when scrolling state changes.
2735
2736         Test: compositing/scrolling/async-overflow-scrolling/become-non-scrollable.html
2737
2738         * rendering/RenderLayer.cpp:
2739         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
2740
2741 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
2742
2743         Layer bounds are incorrect for sharing layers that paint with transforms
2744         https://bugs.webkit.org/show_bug.cgi?id=197768
2745         <rdar://problem/50695493>
2746
2747         Reviewed by Zalan Bujtas.
2748
2749         We don't need to traverse shared layers if the backing-provider has overflow clip,
2750         because we know they are containing-block descendants and therefore clipped.
2751
2752         Note tha the CSS "clip" property doesn't guarantee this, because the clip rect
2753         can be larger than the element, so in that case we just traverse shared layers.
2754
2755         Tests: compositing/shared-backing/sharing-bounds-clip.html
2756                compositing/shared-backing/sharing-bounds-non-clipping-shared-layer.html
2757                compositing/shared-backing/sharing-bounds-transformed-sharing-layer.html
2758                compositing/shared-backing/sharing-bounds.html
2759
2760         * rendering/RenderLayerBacking.cpp:
2761         (WebCore::RenderLayerBacking::updateCompositedBounds):
2762
2763 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
2764
2765         Translucent gradient rendering bug due to will-change transform
2766         https://bugs.webkit.org/show_bug.cgi?id=197654
2767         <rdar://problem/50547664>
2768
2769         Reviewed by Dean Jackson.
2770         
2771         We failed to re-evaluate 'contentsOpaque' when a background changed, because this
2772         happened in updateGeometry() and that doesn't run for background changes.
2773         
2774         However, 'contentsOpaque' also requires knowing about geometry because we have to
2775         turn it off when there's subpixel positioning, and updateConfiguration()
2776         runs before updateGeometry().
2777         
2778         So compute m_hasSubpixelRounding in updateGeometry() and set contentsOpaque in
2779         updateAfterDescendants().
2780
2781         Test: compositing/contents-opaque/background-change-to-transparent.html
2782
2783         * rendering/RenderLayerBacking.cpp:
2784         (WebCore::RenderLayerBacking::updateConfiguration):
2785         (WebCore::RenderLayerBacking::updateGeometry):
2786         (WebCore::RenderLayerBacking::updateAfterDescendants):
2787         * rendering/RenderLayerBacking.h:
2788
2789 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
2790
2791         When the scroller hosting a shared layer becomes non-scrollable, content disappears
2792         https://bugs.webkit.org/show_bug.cgi?id=197766
2793         <rdar://problem/50695808>
2794
2795         Reviewed by Zalan Bujtas.
2796
2797         RenderLayerCompositor::requiresOwnBackingStore() should return true for a layer that shares
2798         its backing store. We always made backing for overlap layers, so even  if the sharing layers
2799         have no painted content, this should rarely be a backing store memory regression.
2800
2801         Test: compositing/shared-backing/overflow-scroll/sharing-layer-becomes-non-scrollable.html
2802
2803         * rendering/RenderLayerCompositor.cpp:
2804         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
2805
2806 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
2807
2808         Backing-sharing layers with transforms render incorrectly
2809         https://bugs.webkit.org/show_bug.cgi?id=197692
2810         <rdar://problem/50652127>
2811
2812         Reviewed by Antti Koivisto.
2813
2814         Layers that paint into shared backing need to enter the RenderLayer painting code
2815         in a way that paints the filters, transforms, opacity and blending.
2816         
2817         RenderLayerBacking::paintIntoLayer() normally enters at paintLayerContents(), because
2818         the effects are rendered via the GraphicsLayer, but shared layers will paint effects.
2819         Note that if the backing-provider has effects, it will be the stacking context
2820         for the shared layers, so it's correct that sharing layers are impacted by effects
2821         on the backing-provider.
2822
2823         In addition, we have to ensure that we don't over-eagerly make layers shared.
2824         Consider:
2825         
2826         <div class="clipping">
2827             <div class="sharing">
2828                 <div class="inner">
2829                 </div>
2830             </div>
2831         </div>
2832         
2833         Here "clipping" is the provider layer, "sharing" paints into shared backing, but
2834         we don't want to also mark "inner" as sharing, since "sharing" will just paint it.
2835         This is akin to avoiding unnecessary compositing of z-order descendants when they can just
2836         paint.
2837         
2838         To do this we need to ensure that sharing layers are treated like compositing layers
2839         in the overlap map, i.e. when a layer is sharing, we call overlapMap.pushCompositingContainer(),
2840         and later overlapMap.popCompositingContainer().
2841
2842         Tests: compositing/shared-backing/nested-shared-layers-with-opacity.html
2843                compositing/shared-backing/shared-layer-has-blending.html
2844                compositing/shared-backing/shared-layer-has-filter.html
2845                compositing/shared-backing/shared-layer-has-opacity.html
2846                compositing/shared-backing/shared-layer-has-reflection.html
2847                compositing/shared-backing/shared-layer-has-transform.html
2848                compositing/shared-backing/shared-layer-isolates-blending.html
2849                compositing/shared-backing/shared-transformed-layer-bounds.html
2850                compositing/shared-backing/sharing-layer-becomes-non-scrollable.html
2851                compositing/shared-backing/sharing-layer-has-effect.html
2852
2853         * rendering/RenderLayer.cpp:
2854         (WebCore::RenderLayer::paintLayer):
2855         (WebCore::RenderLayer::paintLayerWithEffects):
2856         * rendering/RenderLayer.h:
2857         * rendering/RenderLayerBacking.cpp:
2858         (WebCore::RenderLayerBacking::paintIntoLayer):
2859         * rendering/RenderLayerCompositor.cpp:
2860         (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const):
2861         (WebCore::backingProviderLayerCanIncludeLayer):
2862         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2863         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
2864
2865 2019-05-10  Youenn Fablet  <youenn@apple.com>
2866
2867         A service worker instance should be terminated when its SWServer is destroyed
2868         https://bugs.webkit.org/show_bug.cgi?id=197801
2869         <rdar://problem/50587270>
2870
2871         Reviewed by Chris Dumez.
2872
2873         On session destruction, the SWServer is destroyed.
2874         At that time, it should terminate all its running service workers.
2875         Covered by updated API test.
2876
2877         * workers/service/server/SWServer.cpp:
2878         (WebCore::SWServer::~SWServer):
2879
2880 2019-05-10  Eric Carlson  <eric.carlson@apple.com>
2881
2882         [iOS] HTMLMediaElement sometimes doesn't send 'webkitplaybacktargetavailabilitychanged' event
2883         https://bugs.webkit.org/show_bug.cgi?id=197793
2884         <rdar://problem/46429187>
2885
2886         Reviewed by Jer Noble.
2887
2888         * html/MediaElementSession.cpp:
2889         (WebCore::MediaElementSession::MediaElementSession): Initialize m_hasPlaybackTargets.
2890
2891         * platform/audio/ios/MediaSessionManagerIOS.mm:
2892         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange): Log
2893         target availability.
2894         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): Call the client 
2895         externalOutputDeviceAvailableDidChange method after the AVRouteDetector is available.
2896
2897 2019-05-09  Geoffrey Garen  <ggaren@apple.com>
2898
2899         Downgrade RELEASE_ASSERT TO RELEASE_LOG_FAULT for SQLite Class A files
2900         https://bugs.webkit.org/show_bug.cgi?id=197760
2901
2902         Reviewed by Jer Noble.
2903
2904         We have all the data we need, and this crash is happening more than
2905         expected.
2906
2907         * platform/sql/SQLiteDatabase.cpp:
2908         (WebCore::SQLiteDatabase::open):
2909
2910 2019-05-10  Zalan Bujtas  <zalan@apple.com>
2911
2912         [iOS] baidu.com: Synthetic bold renders too far apart, appears doubled.
2913         https://bugs.webkit.org/show_bug.cgi?id=197781
2914         <rdar://problem/48027412>
2915
2916         Reviewed by Simon Fraser.
2917
2918         Synthetic bold is essentially two regular glyphs painted with an offset. While on macOS this offset is always 1px (CSS), on iOS larger font produces higher offset value. At paint time, this offset value (in CSS px unit) get converted
2919         to a device pixel value taking context scale into account. This conversion ensures that the gap between the 2 regular glyphs won't get wider (in device pixels) as the user pinch zooms in.
2920         This works as long as the scale on the context is >= 1. This patch ensures that a scaled down context won't blow up this gap.
2921
2922         Test: fast/text/large-synthetic-bold-with-scale-transform.html
2923
2924         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2925         (WebCore::FontCascade::drawGlyphs):
2926
2927 2019-05-10  Brent Fulgham  <bfulgham@apple.com>
2928
2929         Gracefully handle inaccessible font face data
2930         https://bugs.webkit.org/show_bug.cgi?id=197762
2931         <rdar://problem/50433861>
2932
2933         Reviewed by Per Arne Vollan.
2934
2935         Make sure CSS Font Face handling gracefully recovers from
2936         missing font data.
2937
2938         Test: fast/text/missing-font-crash.html
2939
2940         * css/CSSFontFace.cpp:
2941         (WebCore::CSSFontFace::fontLoadEventOccurred):
2942         (WebCore::CSSFontFace::timeoutFired):
2943         (WebCore::CSSFontFace::fontLoaded):
2944         (WebCore::CSSFontFace::font):
2945
2946 2019-05-10  Simon Fraser  <simon.fraser@apple.com>
2947
2948         ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant()) on nytimes.com after r245170
2949         https://bugs.webkit.org/show_bug.cgi?id=197776
2950
2951         Reviewed by Zalan Bujtas.
2952
2953         Only try to paint into shared backing for layers that are able to be composited. This
2954         avoids trying to do sharing for non-self-painting layers, which doesn't make sense.
2955
2956         Test: compositing/shared-backing/overflow-scroll/non-self-painting-layer-should-not-share.html
2957
2958         * rendering/RenderLayerCompositor.cpp:
2959         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2960
2961 2019-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
2962
2963         Fix a bunch of compiler warnings
2964         https://bugs.webkit.org/show_bug.cgi?id=197785
2965
2966         Reviewed by Don Olmstead.
2967
2968         * CMakeLists.txt: WebCoreTestSupport should accept extra SYSTEM includes.
2969         * PlatformGTK.cmake: GTK includes should be added to SYSTEM headers to avoid warnings.
2970         * inspector/InspectorCanvas.cpp: Add preprocessor guards to fix unused function warning.
2971         * rendering/RenderLayer.cpp: Fix unused variable warning.
2972         (WebCore::RenderLayer::updateClipRects):
2973
2974 2019-05-10  Antti Koivisto  <antti@apple.com>
2975
2976         Event region generation needs to know about backing-sharing
2977         https://bugs.webkit.org/show_bug.cgi?id=197694
2978         <rdar://problem/50584991>
2979
2980         Reviewed by Simon Fraser.
2981
2982         Test: pointerevents/ios/touch-action-region-backing-sharing.html
2983
2984         * rendering/RenderLayerBacking.cpp:
2985         (WebCore::RenderLayerBacking::updateEventRegion):
2986
2987         Gather event region from backing sharing layers too.
2988
2989 2019-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
2990
2991         [WPE][GTK] Add WebKitWebPage::did-associate-form-controls-for-frame and deprecate original did-associate-form-controls
2992         https://bugs.webkit.org/show_bug.cgi?id=197271
2993
2994         Reviewed by Youenn Fablet.
2995
2996         * dom/Document.cpp:
2997         (WebCore::Document::didAssociateFormControlsTimerFired):
2998         * loader/EmptyClients.h:
2999         * page/ChromeClient.h:
3000
3001 2019-05-09  Simon Fraser  <simon.fraser@apple.com>
3002
3003         Implement backing-sharing in compositing layers, allowing overlap layers to paint into the backing store of another layer
3004         https://bugs.webkit.org/show_bug.cgi?id=197561
3005         <rdar://problem/50445998>
3006
3007         Reviewed by Antti Koivisto.
3008
3009         This change introduces the concept of layers that share backing store for compositing. A layer
3010         which is sharing its backing store first paints itself, and then some set of layers which come
3011         later in paint order in the same stacking context. This reduces the composited layer count in
3012         some overflow scrolling scenarios, thereby also simplifying the scrolling tree.
3013         
3014         A backing-shared layer stores a vector of "sharing" RenderLayer* in its RenderLayerBacking. At
3015         paint time, the owning layer is painted, then the sharing layers, setting the owning layer as the
3016         painting root so that positioning and clipping just work.
3017         
3018         Sharing layer relationships are constructed in RenderLayerCompositor::computeCompositingRequirements().
3019         We track the last layer which was composited in paint order as a shared candidate. If a later layer
3020         would composite for overlap (and no other reasons), then we allow it to share with the candidate
3021         if the candidate is in its ancestor containing block chain. Sharing is currently limited to layers
3022         in the same stacking context.
3023         
3024         isComposited() returns false for sharing layers, but they are like composited layers in that
3025         they behave as painting boundaries, so RenderLayer::paintLayer() needs to stop at them,
3026         and repaints in shared layers have to be directed to their shared layer, hence
3027         changes to RenderLayer::clippingRootForPainting() and RenderLayer::enclosingCompositingLayerForRepaint().
3028         
3029         The clipping boundary logic in RenderLayer::backgroundClipRect() needed to be generalized so that
3030         all calls to RenderLayer::parentClipRects() check for crossing painting boundaries and use
3031         TemporaryClipRects in that case.
3032
3033         Tests: compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller.html
3034                compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller.html
3035                compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html
3036                compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html
3037                compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping.html
3038                compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping.html
3039                compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll.html
3040                compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content.html
3041                compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip.html
3042                compositing/shared-backing/overflow-scroll/shared-layer-clipping.html
3043                compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds.html
3044                compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking.html
3045                compositing/shared-backing/overflow-scroll/shared-layer-repaint.html
3046                compositing/shared-backing/partial-compositing-update.html
3047                compositing/shared-backing/partial-compositing-update2.html
3048                compositing/shared-backing/remove-sharing-layer.html
3049                compositing/shared-backing/sharing-cached-clip-rects.html
3050
3051         * rendering/RenderLayer.cpp:
3052         (WebCore::RenderLayer::~RenderLayer):
3053         (WebCore::RenderLayer::ancestorLayerIsInContainingBlockChain const):
3054         (WebCore::RenderLayer::setBackingProviderLayer):
3055         (WebCore::RenderLayer::disconnectFromBackingProviderLayer):
3056         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
3057         (WebCore::RenderLayer::clippingRootForPainting const):
3058         (WebCore::RenderLayer::clipToRect):
3059         (WebCore::RenderLayer::paintLayer):
3060         (WebCore::RenderLayer::updateClipRects):
3061         (WebCore::RenderLayer::clipCrossesPaintingBoundary const):
3062         (WebCore::RenderLayer::calculateClipRects const):
3063         (WebCore::outputPaintOrderTreeLegend):
3064         (WebCore::outputPaintOrderTreeRecursive):
3065         (WebCore::inContainingBlockChain): Deleted.
3066         * rendering/RenderLayer.h:
3067         * rendering/RenderLayerBacking.cpp:
3068         (WebCore::RenderLayerBacking::willBeDestroyed):
3069         (WebCore::clearBackingSharingLayerProviders):
3070         (WebCore::RenderLayerBacking::setBackingSharingLayers):
3071         (WebCore::RenderLayerBacking::removeBackingSharingLayer):
3072         (WebCore::RenderLayerBacking::clearBackingSharingLayers):
3073         (WebCore::RenderLayerBacking::updateCompositedBounds):
3074         (WebCore::RenderLayerBacking::updateDrawsContent):
3075         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
3076         (WebCore::RenderLayerBacking::paintIntoLayer):
3077         (WebCore::RenderLayerBacking::paintContents):
3078         * rendering/RenderLayerBacking.h:
3079         * rendering/RenderLayerCompositor.cpp:
3080         (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const):
3081         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren):
3082         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree):
3083         (WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate):
3084         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3085         (WebCore::backingProviderLayerCanIncludeLayer):
3086         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3087         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
3088         (WebCore::RenderLayerCompositor::updateBacking):
3089         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
3090         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
3091         * rendering/RenderLayerCompositor.h:
3092         * rendering/RenderTreeAsText.cpp:
3093
3094 2019-05-09  Daniel Bates  <dabates@apple.com>
3095
3096         [iOS] Right command key has wrong value for property code
3097         https://bugs.webkit.org/show_bug.cgi?id=193876
3098         <rdar://problem/47577308>
3099
3100         Reviewed by Brent Fulgham.
3101
3102         We're looking for the wrong Windows virtual key code for the right command key.
3103         Substitute VK_APPS for VK_RWIN so we can identify the right command key and return
3104         the correct value for the code property of the DOM key event.
3105
3106         * platform/ios/PlatformEventFactoryIOS.mm:
3107         (WebCore::codeForKeyEvent):
3108
3109 2019-05-09  Daniel Bates  <dabates@apple.com>
3110
3111         [iOS] Numpad comma key has incorrect keyIdentifier property
3112         https://bugs.webkit.org/show_bug.cgi?id=197753
3113         <rdar://problem/50636274>
3114
3115         Reviewed by Brent Fulgham.
3116
3117         Map the Numpad Comma HID usage code to its Window virtual key code, VK_SEPARATOR,
3118         so that can compute the keyIdentifier property for the Numpad Comma key. Also
3119         consider this key as a keypad key just like we do on Mac. There is no discernable
3120         difference for doing so on iOS because the non-keypad code path computes the same result
3121         due to GraphicsServices having fixed up the input string for the Numpad Comma to be
3122         ",", which is want.
3123
3124         * platform/ios/KeyEventIOS.mm:
3125         (WebCore::windowsKeyCodeForKeyCode): Map kHIDUsage_KeypadComma to VK_SEPARATOR.
3126         * platform/ios/PlatformEventFactoryIOS.mm:
3127         (WebCore::codeForKeyEvent): Add a comment to explain that this key is only on
3128         JIS keyboards.
3129         (WebCore::isKeypadEvent): Return true for the Numpad Comma key.
3130
3131 2019-05-09  Zalan Bujtas  <zalan@apple.com>
3132
3133         Do not mix inline and block level boxes.
3134         https://bugs.webkit.org/show_bug.cgi?id=197462
3135         <rdar://problem/50369362>
3136
3137         Reviewed by Antti Koivisto.
3138
3139         This patch tightens the remove-anonymous-wrappers logic by checking if the removal would
3140         produce an inline-block sibling mix.
3141         When a block level box is removed from the tree, we check if after the removal the anonymous sibling block
3142         boxes are still needed or whether we can removed them as well (and have only inline level child boxes).
3143         In addition to checking if the container is anonymous and is part of a continuation, we also need to check
3144         if collapsing it (and by that moving its children one level up) would cause a inline-block box mix.
3145
3146         Test: fast/ruby/continuation-and-column-spanner-crash.html
3147
3148         * rendering/updating/RenderTreeBuilder.cpp:
3149         (WebCore::RenderTreeBuilder::removeAnonymousWrappersForInlineChildrenIfNeeded):
3150         * rendering/updating/RenderTreeBuilderContinuation.cpp:
3151         (WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy):
3152
3153 2019-05-09  Eric Carlson  <eric.carlson@apple.com>
3154
3155         Refine AudioSession route sharing policy
3156         https://bugs.webkit.org/show_bug.cgi?id=197742
3157         <rdar://problem/50590818>
3158
3159         Reviewed by Darin Adler.
3160
3161         No new tests, updated AVAudioSessionRouteSharingPolicy API test.
3162
3163         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
3164         (MediaSessionManagerCocoa::updateSessionState):
3165
3166 2019-05-09  Simon Fraser  <simon.fraser@apple.com>
3167
3168         fast/hidpi/video-controls-in-hidpi.html sometimes asserts in WK1
3169         https://bugs.webkit.org/show_bug.cgi?id=197695
3170
3171         Reviewed by Zalan Bujtas.
3172
3173         With the backing-sharing changes that landed in r245058, some WebKit1 tests with media controls asserted in
3174         RenderLayerBacking::computeParentGraphicsLayerRect() because a layer would have a m_ancestorClippingLayer,
3175         but backgroundClipRect() would return an infinite rect.
3176         
3177         This happened when a layer tree change caused the layer's compositing ancestor to no longer isolate
3178         composited blending (which affects the behavior of RenderLayerCompositor:clippedByAncestor()), but we failed
3179         to mark its composited children as needing the configuration update which would eliminate their m_ancestorClippingLayers.
3180         
3181         The fix is to call setChildrenNeedCompositingGeometryUpdate() when isolatesCompositedBlending changes. We don't haev
3182         setChildrenNeedCompositingConfigurationUpdate(), but setChildrenNeedCompositingGeometryUpdate() has the desired side-effect.
3183
3184         I was unable to make a standalone test case for this, but the code is exercised by media control tests.
3185
3186         * rendering/RenderLayerCompositor.cpp:
3187         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3188
3189 2019-05-09  Brent Fulgham  <bfulgham@apple.com>
3190
3191         Correct delayed load event handling
3192         https://bugs.webkit.org/show_bug.cgi?id=197679
3193         <rdar://problem/50423334>
3194
3195         Reviewed by Alex Christensen.
3196
3197         We need to properly account for the fact that JavaScript might run
3198         while performing loads.
3199
3200         * dom/Document.cpp:
3201         (WebCore::Document::loadEventDelayTimerFired):
3202
3203 2019-05-09  Antti Koivisto  <antti@apple.com>
3204
3205         Elements with "display: inline-block" don't have a touch-action region
3206         https://bugs.webkit.org/show_bug.cgi?id=197281
3207         <rdar://problem/50535081>
3208
3209         Reviewed by Antoine Quint.
3210
3211         Test: pointerevents/ios/touch-action-region-inline-block.html
3212
3213         PaintPhase::EventRegion failed to traverse into inline boxes.
3214
3215         * rendering/InlineElementBox.cpp:
3216         (WebCore::InlineElementBox::paint):
3217         * rendering/RenderElement.cpp:
3218         (WebCore::RenderElement::paintAsInlineBlock):
3219
3220 2019-05-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3221
3222         REGRESSION(r239915): [FreeType] White space skipped when rendering plain text with noto CJK font
3223         https://bugs.webkit.org/show_bug.cgi?id=197658
3224
3225         Reviewed by Michael Catanzaro.
3226
3227         Since r239915 we no longer overwrite control characters with zero width space, they are handled later when
3228         filling the glyph pages. In Font::platformGlyphInit() there's an optimization to get the glyph of zero with
3229         space character that assumes that control characters are always overwritten. Since the glyph for character at 0
3230         index is always overwritten with zero width space, we can avoid loading the page for the actual zero width space
3231         character and use the first page instead. In the particular case of noto CJK font, character at 0 is mapped to
3232         the same glyph as space character, so space and zero width space end up being the same glyph. That breaks the
3233         space width calculation, that returns 0 when isZeroWidthSpaceGlyph() is true. That's why spaces are no
3234         longer rendered, ComplexTextController::adjustGlyphsAndAdvances() is setting the x advance for the space glyphs
3235         to 0.
3236
3237         * platform/graphics/Font.cpp:
3238         (WebCore::Font::platformGlyphInit): Use the actual zero width space page to get the glyph instead of 0 when
3239         using FreeType.
3240
3241 2019-05-08  Alex Christensen  <achristensen@webkit.org>
3242
3243         Fix WPE build.
3244
3245         * CMakeLists.txt:
3246         Bots wanted a "PUBLIC" or "PRIVATE" keyword here.
3247
3248 2019-05-08  Alex Christensen  <achristensen@webkit.org>
3249
3250         Try to fix Linux build
3251
3252         * platform/graphics/ANGLEWebKitBridge.h:
3253         Include headers consistently on all platforms.
3254
3255 2019-05-08  Don Olmstead  <don.olmstead@sony.com>
3256
3257         Update ANGLE
3258         https://bugs.webkit.org/show_bug.cgi?id=197676
3259
3260         Reviewed by Alex Christensen.
3261
3262         * CMakeLists.txt:
3263         * PlatformGTK.cmake:
3264         * PlatformMac.cmake:
3265         * PlatformPlayStation.cmake:
3266         * PlatformWPE.cmake:
3267         * PlatformWin.cmake:
3268         * platform/graphics/GLContext.cpp:
3269         * platform/graphics/egl/GLContextEGL.cpp:
3270         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
3271         * platform/graphics/opengl/Extensions3DOpenGLES.h:
3272         * platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
3273         * platform/graphics/texmap/TextureMapperGLHeaders.h:
3274
3275 2019-05-08  Chris Dumez  <cdumez@apple.com>
3276
3277         [iOS Debug] ASSERTION FAILED: !m_originalNode in WebCore::JSLazyEventListener::checkValidityForEventTarget(WebCore::EventTarget &)
3278         https://bugs.webkit.org/show_bug.cgi?id=197696
3279         <rdar://problem/50586956>
3280
3281         Reviewed by Simon Fraser.
3282
3283         Setting the onorientationchange / onresize event handler on the body should set the event handler on the
3284         window object, as per the HTML specification. However, calling body.addEventListener() with 'orientationchange'
3285         or 'resize' should not set the event listener on the window object, only the body. Blink and Gecko seem to
3286         behave as per specification but WebKit had a quirk for the addEventListener case. The quirk's implementation
3287         is slightly wrong (because it is unsafe to take a JSLazyEventListener from a body element and add it to the
3288         window, given that the JSLazyEventListener keeps a raw pointer to its element) and was causing crashes such
3289         as <rdar://problem/24314027>. As a result, this patch simply drops the WebKit quirk, which will align our
3290         behavior with other browsers and fix the crashes altogether.
3291
3292         Test: fast/events/ios/rotation/orientationchange-event-listener-on.body.html
3293
3294         * dom/Node.cpp:
3295         (WebCore::tryAddEventListener):
3296         (WebCore::tryRemoveEventListener):
3297
3298 2019-05-08  Ryan Haddad  <ryanhaddad@apple.com>
3299
3300         Unreviewed, rolling out r245058.
3301
3302         Causes crashes under ASan / GuardMalloc
3303
3304         Reverted changeset:
3305
3306         "Implement backing-sharing in compositing layers, allowing
3307         overlap layers to paint into the backing store of another
3308         layer"
3309         https://bugs.webkit.org/show_bug.cgi?id=197561
3310         https://trac.webkit.org/changeset/245058
3311
3312 2019-05-08  Ryan Haddad  <ryanhaddad@apple.com>
3313
3314         Unreviewed, rolling out r245068.
3315
3316         Caused debug layout tests to exit early due to an assertion
3317         failure.
3318
3319         Reverted changeset:
3320
3321         "All prototypes should call didBecomePrototype()"
3322         https://bugs.webkit.org/show_bug.cgi?id=196315
3323         https://trac.webkit.org/changeset/245068
3324
3325 2019-05-08  Megan Gardner  <megan_gardner@apple.com>
3326
3327         Add quirks to emulate undo and redo in hidden editable areas on some websites
3328         https://bugs.webkit.org/show_bug.cgi?id=197452
3329
3330         Reviewed by Alex Christensen.
3331
3332         UI change, not testable.
3333
3334         We need to send synthetic keyboard events to the web process to emulate undo and redo
3335         key combinations for when we are trying to get our undo and redo UI to work
3336         on rich editing websites that only listen to keystrokes, and don't let us use our
3337         undo manager to help manage the input content.
3338
3339         * page/EventHandler.cpp:
3340         (WebCore::EventHandler::keyEvent):
3341         * platform/PlatformKeyboardEvent.h:
3342         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
3343         (WebCore::PlatformKeyboardEvent::isSyntheticEvent):
3344         (WebCore::PlatformKeyboardEvent::setSyntheticEvent):
3345         * platform/ios/KeyEventIOS.mm:
3346         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
3347         * platform/ios/PlatformEventFactoryIOS.mm:
3348         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
3349         * platform/mac/PlatformEventFactoryMac.mm:
3350         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
3351
3352 2019-05-08  Don Olmstead  <don.olmstead@sony.com>
3353
3354         CSSFontFaceSource fails to compile when !ENABLE(SVG_FONTS)
3355         https://bugs.webkit.org/show_bug.cgi?id=197720
3356
3357         Unreviewed build fix.
3358
3359         Add usesInDocumentSVGFont to the !ENABLE(SVG_FONT) path.
3360
3361         * css/CSSFontFaceSource.cpp:
3362         (WebCore::CSSFontFaceSource::font):
3363
3364 2019-05-08  Timothy Hatcher  <timothy@apple.com>
3365
3366         Add plumbing for inactive system colors in RenderTheme cache.
3367         https://bugs.webkit.org/show_bug.cgi?id=197699
3368         rdar://problem/49406936
3369
3370         Reviewed by Tim Horton.
3371
3372         * css/StyleColor.h:
3373         * page/Page.cpp:
3374         (WebCore::Page::effectiveAppearanceDidChange): Renamed from setUseDarkAppearance.
3375         * page/Page.h:
3376         (WebCore::Page::useInactiveAppearance const):
3377         * rendering/RenderTheme.cpp:
3378         (WebCore::RenderTheme::purgeCaches):
3379         (WebCore::RenderTheme::platformColorsDidChange):
3380         (WebCore::RenderTheme::colorCache const):
3381         * rendering/RenderTheme.h:
3382         * testing/InternalSettings.cpp:
3383         (WebCore::InternalSettings::setUseDarkAppearanceInternal):
3384
3385 2019-05-08  Robin Morisset  <rmorisset@apple.com>
3386
3387         All prototypes should call didBecomePrototype()
3388         https://bugs.webkit.org/show_bug.cgi?id=196315
3389
3390         Reviewed by Saam Barati.
3391
3392         This changelog already landed, but the commit was missing the actual changes.
3393
3394         It was found by existing tests, with the new assert in JSC::Structure
3395
3396         * bindings/js/JSWindowProxy.cpp:
3397         (WebCore::JSWindowProxy::setWindow):
3398         * bindings/scripts/CodeGeneratorJS.pm:
3399         (GeneratePrototypeDeclaration):
3400         (GenerateConstructorHelperMethods):
3401         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3402         (WebCore::JSInterfaceNamePrototype::JSInterfaceNamePrototype):
3403         * bindings/scripts/test/JS/JSMapLike.cpp:
3404         (WebCore::JSMapLikePrototype::JSMapLikePrototype):
3405         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3406         (WebCore::JSReadOnlyMapLikePrototype::JSReadOnlyMapLikePrototype):
3407         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3408         (WebCore::JSTestActiveDOMObjectPrototype::JSTestActiveDOMObjectPrototype):
3409         * bindings/scripts/test/JS/JSTest