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