038e7e243a5903446bc18ea8a727b06742366603
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-07-25  Dean Jackson  <dino@apple.com>
2
3         Add helper for ignoring deprecated implementation warnings
4         https://bugs.webkit.org/show_bug.cgi?id=200135
5
6         Reviewed by Wenson Hsieh.
7
8         Add ALLOW_DEPRECATED_IMPLEMENTATIONS_BEGIN/END macro which
9         is IGNORE_WARNINGS_BEGIN("deprecated-implementations")
10
11         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
12         (-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
13         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
14         (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
15         (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
16         (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
17         (-[WebAccessibilityObjectWrapper accessibilityActionDescription:]):
18         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
19         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]): Deleted.
20         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
21         (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]):
22         (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
23         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
24         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
25         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
26
27 2019-07-25  Saam Barati  <sbarati@apple.com>
28
29         Unreviewed. Speculative build fix for tvOS of missing include.
30
31         * Modules/webgpu/WHLSL/WHLSLLexer.h:
32
33 2019-07-25  Michael Catanzaro  <mcatanzaro@igalia.com>
34
35         Unreviewed, fix -Wunused-parameter warning
36
37         * testing/Internals.cpp:
38         (WebCore::Internals::privatePlayerVolume):
39
40 2019-07-25  Saam Barati  <sbarati@apple.com>
41
42         [WHLSL] Add descriptive error messages
43         https://bugs.webkit.org/show_bug.cgi?id=195682
44         <rdar://problem/50746322>
45
46         Reviewed by Myles C. Maxfield.
47
48         This patch adds error messages to the WHLSL compiler. I'm taking a first pass
49         at having decent error messages everywhere we set an error. However, we will
50         probably refine these messages to be more accurate and descriptive over time.
51         
52         Passes that can fail no longer return a boolean. Instead, they return Expected<void, Error>.
53         From Error, we can generate a descriptive error message. Visitor::setError now
54         requires an Error as an argument. So anywhere in Visitor that might fail is
55         now required to provide an error message.
56         
57         In a follow-up to this, we should actually make our checkFail tests test that
58         they get the expected error message: https://bugs.webkit.org/show_bug.cgi?id=200049
59
60         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
61         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
62         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
63         * Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h:
64         * Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h:
65         * Modules/webgpu/WHLSL/AST/WHLSLBlock.h:
66         * Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h:
67         * Modules/webgpu/WHLSL/AST/WHLSLBreak.h:
68         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
69         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
70         * Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h:
71         * Modules/webgpu/WHLSL/AST/WHLSLContinue.h:
72         * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
73         * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
74         * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
75         * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
76         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
77         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
78         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
79         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
80         * Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h:
81         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
82         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
83         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
84         * Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h:
85         * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
86         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
87         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
88         * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
89         * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
90         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
91         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
92         * Modules/webgpu/WHLSL/AST/WHLSLNamedType.h:
93         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
94         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
95         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
96         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
97         * Modules/webgpu/WHLSL/AST/WHLSLQualifier.h:
98         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
99         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
100         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
101         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
102         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h:
103         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h:
104         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
105         * Modules/webgpu/WHLSL/AST/WHLSLStatementList.h:
106         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
107         * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
108         * Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h:
109         * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
110         * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
111         * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.h:
112         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
113         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
114         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
115         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
116         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
117         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h:
118         * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
119         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
120         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp:
121         (WebCore::WHLSL::AutoInitialize::visit):
122         (WebCore::WHLSL::autoInitializeVariables):
123         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.h:
124         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
125         (WebCore::WHLSL::checkDuplicateFunctions):
126         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.h:
127         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:
128         (WebCore::WHLSL::TextureReferencesChecker::visit):
129         (WebCore::WHLSL::checkTextureReferences):
130         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.h:
131         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
132         (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
133         (WebCore::WHLSL::resolveWithOperatorLength):
134         (WebCore::WHLSL::resolveWithReferenceComparator):
135         (WebCore::WHLSL::resolveByInstantiation):
136         (WebCore::WHLSL::resolveFunction):
137         (WebCore::WHLSL::checkSemantics):
138         (WebCore::WHLSL::Checker::assignTypes):
139         (WebCore::WHLSL::Checker::visit):
140         (WebCore::WHLSL::Checker::recurseAndGetInfo):
141         (WebCore::WHLSL::Checker::getInfo):
142         (WebCore::WHLSL::Checker::finishVisiting):
143         (WebCore::WHLSL::Checker::recurseAndRequireBoolType):
144         (WebCore::WHLSL::check):
145         * Modules/webgpu/WHLSL/WHLSLChecker.h:
146         * Modules/webgpu/WHLSL/WHLSLCodeLocation.h: Added.
147         (WebCore::WHLSL::CodeLocation::CodeLocation):
148         (WebCore::WHLSL::CodeLocation::startOffset const):
149         (WebCore::WHLSL::CodeLocation::endOffset const):
150         (WebCore::WHLSL::CodeLocation::operator== const):
151         (WebCore::WHLSL::CodeLocation::operator!= const):
152         (WebCore::WHLSL::CodeLocation::operator bool const):
153         * Modules/webgpu/WHLSL/WHLSLComputeDimensions.cpp:
154         (WebCore::WHLSL::computeDimensions):
155         * Modules/webgpu/WHLSL/WHLSLError.h: Added.
156         (WebCore::WHLSL::Error::Error):
157         (WebCore::WHLSL::Error::codeLocation const):
158         (WebCore::WHLSL::Error::message const):
159         * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.cpp:
160         (WebCore::WHLSL::checkFunctionStages):
161         * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.h:
162         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
163         (WebCore::WHLSL::Gatherer::reset):
164         (WebCore::WHLSL::Gatherer::visit):
165         (WebCore::WHLSL::gatherEntryPointItems):
166         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
167         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
168         (WebCore::WHLSL::Lexer::lineAndColumnNumberFromOffset):
169         (WebCore::WHLSL::Lexer::errorString):
170         (WebCore::WHLSL::Lexer::lineNumberFromOffset): Deleted.
171         * Modules/webgpu/WHLSL/WHLSLLexer.h:
172         (WebCore::WHLSL::CodeLocation::CodeLocation):
173         (WebCore::WHLSL::Lexer::errorString):
174         (WebCore::WHLSL::AST::CodeLocation::CodeLocation): Deleted.
175         (WebCore::WHLSL::AST::CodeLocation::startOffset const): Deleted.
176         (WebCore::WHLSL::AST::CodeLocation::endOffset const): Deleted.
177         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
178         (WebCore::WHLSL::NameResolver::~NameResolver):
179         (WebCore::WHLSL::NameResolver::visit):
180         (WebCore::WHLSL::resolveNamesInTypes):
181         (WebCore::WHLSL::resolveTypeNamesInFunctions):
182         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
183         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
184         (WebCore::WHLSL::Parser::parse):
185         (WebCore::WHLSL::intLiteralToInt):
186         (WebCore::WHLSL::uintLiteralToUint):
187         (WebCore::WHLSL::floatLiteralToFloat):
188         (WebCore::WHLSL::recognizeSimpleUnsignedInteger):
189         (WebCore::WHLSL::Parser::parseTypeArgument):
190         (WebCore::WHLSL::Parser::parseType):
191         (WebCore::WHLSL::Parser::parseForLoop):
192         (WebCore::WHLSL::Parser::parseWhileLoop):
193         (WebCore::WHLSL::Parser::parseEffectfulExpression):
194         (WebCore::WHLSL::Parser::parseLimitedSuffixOperator):
195         (WebCore::WHLSL::Parser::parseSuffixOperator):
196         (WebCore::WHLSL::Parser::parseExpression):
197         (WebCore::WHLSL::Parser::completeTernaryConditional):
198         (WebCore::WHLSL::Parser::completeAssignment):
199         (WebCore::WHLSL::Parser::completePossibleLogicalBinaryOperation):
200         (WebCore::WHLSL::Parser::completePossibleRelationalBinaryOperation):
201         (WebCore::WHLSL::Parser::completePossibleShift):
202         (WebCore::WHLSL::Parser::completePossibleAdd):
203         (WebCore::WHLSL::Parser::completePossibleMultiply):
204         (WebCore::WHLSL::Parser::parsePossiblePrefix):
205         (WebCore::WHLSL::Parser::parseCallExpression):
206         * Modules/webgpu/WHLSL/WHLSLParser.h:
207         (WebCore::WHLSL::Parser::Error::Error): Deleted.
208         (WebCore::WHLSL::Parser::Error::dump const): Deleted.
209         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
210         (WebCore::WHLSL::prepareShared):
211         (WebCore::WHLSL::prepare):
212         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
213         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
214         (WebCore::WHLSL::setterCall):
215         (WebCore::WHLSL::getterCall):
216         (WebCore::WHLSL::modify):
217         (WebCore::WHLSL::PropertyResolver::visit):
218         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:
219         (WebCore::WHLSL::checkRecursion):
220         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.h:
221         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
222         (WebCore::WHLSL::checkRecursiveTypes):
223         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.h:
224         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
225         (WebCore::WHLSL::includeStandardLibrary):
226         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp:
227         (WebCore::WHLSL::checkStatementBehavior):
228         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h:
229         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
230         (WebCore::WHLSL::synthesizeArrayOperatorLength):
231         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.h:
232         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
233         (WebCore::WHLSL::synthesizeConstructors):
234         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.h:
235         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
236         (WebCore::WHLSL::synthesizeEnumerationFunctions):
237         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.h:
238         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
239         (WebCore::WHLSL::synthesizeStructureAccessors):
240         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.h:
241         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
242         (WebCore::WHLSL::Visitor::hasError const):
243         (WebCore::WHLSL::Visitor::expectedError):
244         (WebCore::WHLSL::Visitor::checkErrorAndVisit):
245         (WebCore::WHLSL::Visitor::setError):
246         (WebCore::WHLSL::Visitor::error const): Deleted.
247         (): Deleted.
248         * WebCore.xcodeproj/project.pbxproj:
249         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
250         (WebCore::trySetFunctions):
251
252 2019-07-25  Saam Barati  <sbarati@apple.com>
253
254         [WHLSL] Add optional logging for phase timings
255         https://bugs.webkit.org/show_bug.cgi?id=200099
256
257         Reviewed by Dean Jackson.
258
259         As we're doing WHLSL compiler speedup work, it helps to be able to
260         log phase times. I think a few of us have written such patches locally.
261         In this patch, I'm adding a way to easily switch this logging on and
262         off by flipping a "constexpr bool" and rebuilding.
263
264         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
265         (WebCore::WHLSL::logPhaseTimes):
266         (WebCore::WHLSL::PhaseTimer::PhaseTimer):
267         (WebCore::WHLSL::PhaseTimer::~PhaseTimer):
268         (WebCore::WHLSL::prepareShared):
269         (WebCore::WHLSL::prepare):
270
271 2019-07-25  Chris Dumez  <cdumez@apple.com>
272
273         Avoid some unnecessary HashMap copies
274         https://bugs.webkit.org/show_bug.cgi?id=200129
275
276         Reviewed by Youenn Fablet.
277
278         * workers/service/server/SWServer.cpp:
279         (WebCore::SWServer::addRegistrationFromStore):
280
281 2019-07-25  Joshua Watt  <JPEW.hacker@gmail.com>
282
283         [WPE] Draw other button types
284         https://bugs.webkit.org/show_bug.cgi?id=199377
285
286         Reviewed by Michael Catanzaro.
287
288         There are other button types that should be drawn with the default style
289         besides just push buttons.
290
291         * platform/wpe/ThemeWPE.cpp:
292         (WebCore::ThemeWPE::paint):
293         (WebCore::ThemeWPE::paintButton):
294         * platform/wpe/ThemeWPE.h:
295
296 2019-07-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
297
298         REGRESSION (r244995): Assertion failure when addEventListener to an SVGElement which has an. instance in shadow tree
299         https://bugs.webkit.org/show_bug.cgi?id=200083
300
301         Reviewed by Ryosuke Niwa.
302
303         When adding an event listener to an SVGElement, the same event listener
304         has to be add to all the instances of SVGElement in the shadow tree. See
305         SVGElement::addEventListener().
306
307         In r244995, an assertion was added to ensure if the event listener is
308         attached to an event target, the new event target has be the same as the
309         attached one. This assertion isn't correct for the event targets which 
310         were copied from the targetElement sub tree of an SVGUseElement to the
311         shadow tree.
312
313         Test: svg/custom/add-event-listener-shadow-tree-element.html
314
315         * bindings/js/JSLazyEventListener.cpp:
316         (WebCore::isCloneInShadowTreeOfSVGUseElement):
317         (WebCore::JSLazyEventListener::checkValidityForEventTarget):
318
319 2019-07-25  Truitt Savell  <tsavell@apple.com>
320
321         Unreviewed, rolling out r247821.
322
323         Caused two crashing Layout Tests
324
325         Reverted changeset:
326
327         "Make storing cross-origin top-level prefetches in HTTP cache
328         optional"
329         https://bugs.webkit.org/show_bug.cgi?id=199499
330         https://trac.webkit.org/changeset/247821
331
332 2019-07-25  Chris Dumez  <cdumez@apple.com>
333
334         Avoid UI Process hangs when the WebContent process is showing JS prompts / alerts
335         https://bugs.webkit.org/show_bug.cgi?id=200107
336         <rdar://problem/53034592>
337
338         Reviewed by Geoffrey Garen.
339
340         Add testing infrastructure for SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply.
341
342         Test: fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply.html
343
344         * page/ChromeClient.h:
345         * testing/Internals.cpp:
346         (WebCore::Internals::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
347         * testing/Internals.h:
348         * testing/Internals.idl:
349
350 2019-07-25  Rob Buis  <rbuis@igalia.com>
351
352         Make storing cross-origin top-level prefetches in HTTP cache optional
353         https://bugs.webkit.org/show_bug.cgi?id=199499
354
355         Reviewed by Youenn Fablet.
356
357         Add Internals API for adding an event listener to prefetch load.
358
359         Test: http/wpt/prefetch/link-prefetch-skip-disk-cache.html
360
361         * bindings/js/JSEventListener.h:
362         * dom/EventTarget.h:
363         (WebCore::EventTarget::addEventListener):
364         * dom/Node.h:
365         * html/HTMLLinkElement.h:
366         * testing/Internals.cpp:
367         (WebCore::Internals::addPrefetchLoadEventListener):
368         * testing/Internals.h:
369         * testing/Internals.idl:
370
371 2019-07-24  Yusuke Suzuki  <ysuzuki@apple.com>
372
373         [bmalloc] Add IsoHeap test to ensure that IsoHeap pages are not allocating too large VA
374         https://bugs.webkit.org/show_bug.cgi?id=200103
375
376         Reviewed by Mark Lam.
377
378         No behavior change in WebCore.
379
380         * page/MemoryRelease.cpp:
381         * page/ResourceUsageThread.h:
382         (WebCore::TagInfo::TagInfo): Deleted.
383         * page/cocoa/ResourceUsageThreadCocoa.mm:
384         (WebCore::vmPageSize): Deleted.
385         (WebCore::logFootprintComparison): Deleted.
386         (WebCore::displayNameForVMTag): Deleted.
387         (WebCore::pagesPerVMTag): Deleted.
388
389 2019-07-24  Devin Rousso  <drousso@apple.com>
390
391         Web Inspector: support `console.screenshot` with detached Nodes that are graphical
392         https://bugs.webkit.org/show_bug.cgi?id=199309
393
394         Reviewed by Joseph Pecoraro.
395
396         Test: inspector/console/console-screenshot.html
397
398         * page/PageConsoleClient.cpp:
399         (WebCore::PageConsoleClient::screenshot):
400
401 2019-07-24  Saam Barati  <sbarati@apple.com>
402
403         [WHLSL] Use bmalloc instead of system malloc for WHLSL data structures
404         https://bugs.webkit.org/show_bug.cgi?id=200063
405
406         Rubber-stamped by Sam Weinig.
407
408         This is a 25-30% WHLSL compile time speedup on Justin's textured-cube demo
409         and a ~40% compile time speedup on the hello-cube demo.
410         
411         The phases that speed up from this are:
412         checker
413         includeStandardLibrary
414         autoInitializeVariables
415         resolveProperties
416
417         * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h:
418         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
419         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
420         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
421         * Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h:
422         * Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h:
423         * Modules/webgpu/WHLSL/AST/WHLSLBlock.h:
424         * Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h:
425         * Modules/webgpu/WHLSL/AST/WHLSLBreak.h:
426         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
427         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
428         * Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h:
429         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
430         * Modules/webgpu/WHLSL/AST/WHLSLContinue.h:
431         * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
432         * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
433         * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
434         * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
435         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
436         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
437         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
438         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
439         * Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h:
440         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
441         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
442         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
443         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
444         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h:
445         * Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h:
446         * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
447         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
448         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
449         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
450         * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
451         * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
452         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
453         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
454         * Modules/webgpu/WHLSL/AST/WHLSLNamedType.h:
455         * Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h:
456         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
457         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
458         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.h:
459         * Modules/webgpu/WHLSL/AST/WHLSLNumThreadsFunctionAttribute.h:
460         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
461         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
462         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
463         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
464         * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h:
465         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
466         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
467         * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h:
468         * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h:
469         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
470         * Modules/webgpu/WHLSL/AST/WHLSLStatementList.h:
471         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
472         * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
473         * Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h:
474         * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
475         * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
476         * Modules/webgpu/WHLSL/AST/WHLSLType.h:
477         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
478         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
479         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
480         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
481         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
482         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
483         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h:
484         * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
485         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
486         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
487
488 2019-07-24  Devin Rousso  <drousso@apple.com>
489
490         Web Inspector: support `console.screenshot` with ImageData and ImageBitmap
491         https://bugs.webkit.org/show_bug.cgi?id=199304
492
493         Reviewed by Joseph Pecoraro.
494
495         Test: inspector/console/console-screenshot.html
496
497         * page/PageConsoleClient.cpp:
498         (WebCore::PageConsoleClient::screenshot):
499
500 2019-07-24  Devin Rousso  <drousso@apple.com>
501
502         Web Inspector: REGRESSION: Overlay: highlighting a ::before/::after shows the node info of the parent instead
503         https://bugs.webkit.org/show_bug.cgi?id=200051
504
505         Reviewed by Joseph Pecoraro.
506
507         When highlighting a pseudo-element, only use the parent node for selector information. All
508         rendering data should still come from the pseudo-element itself.
509
510         * inspector/InspectorOverlay.cpp:
511         (WebCore::drawShapeHighlight):
512         (WebCore::InspectorOverlay::drawElementTitle):
513
514 2019-07-24  Devin Rousso  <drousso@apple.com>
515
516         Web Inspector: support `console.screenshot` with subclasses of CanvasRenderingContext
517         https://bugs.webkit.org/show_bug.cgi?id=199305
518
519         Reviewed by Joseph Pecoraro.
520
521         Test: inspector/console/console-screenshot.html
522
523         * page/PageConsoleClient.cpp:
524         (WebCore::canvasRenderingContext):
525         (WebCore::PageConsoleClient::record):
526         (WebCore::PageConsoleClient::recordEnd):
527         (WebCore::PageConsoleClient::screenshot):
528
529 2019-07-24  Youenn Fablet  <youenn@apple.com>
530
531         Remove MediaPlayerPrivate::supportsMuting()
532         https://bugs.webkit.org/show_bug.cgi?id=200005
533
534         Reviewed by Eric Carlson.
535
536         Remove no longer needed interface method.
537         No change of behavior.
538
539         * WebCore.order:
540         * platform/graphics/MediaPlayer.cpp:
541         (WebCore::MediaPlayer::setVolume):
542         (WebCore::MediaPlayer::setMuted):
543         * platform/graphics/MediaPlayerPrivate.h:
544         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
545         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
546         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
547         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
548         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
549         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
550
551 2019-07-24  Tim Horton  <timothy_horton@apple.com>
552
553         Daring Fireball long press highlights are unnecessarily inflated due to false illegibility
554         https://bugs.webkit.org/show_bug.cgi?id=200064
555
556         Reviewed by Geoff Garen.
557
558         If we consider text illegible on the given estimated background color,
559         we bail from doing a tightly fitted selection-only TextIndicator and
560         instead just paint the page without modification into the indicator,
561         causing ugly overlap and an excessively inflated indicator.
562
563         Change the mechanism we use to determine illegibility to be based on
564         a standard, instead of a constant chosen by hand 13 years ago.
565
566         Test: fast/text-indicator/text-indicator-with-low-contrast-text.html
567
568         * platform/graphics/ColorUtilities.cpp:
569         (WebCore::luminance):
570         Fix a typo.
571
572         (WebCore::contrastRatio):
573         Add a function that computes the contrast ratio given two colors using
574         the formula from WCAG.
575
576         * platform/graphics/ColorUtilities.h:
577         * rendering/TextPaintStyle.cpp:
578         (WebCore::textColorIsLegibleAgainstBackgroundColor):
579         Make use of WCAG's minimum legible contrast ratio instead of an
580         arbitrary color difference cutoff for determining whether we consider
581         text legible. It seems sensible and also considers the text on DF readable
582         (which it seems to be to me!).
583
584         * testing/Internals.cpp:
585         (WebCore::Internals::TextIndicatorInfo::TextIndicatorInfo):
586         * testing/Internals.h:
587         * testing/Internals.idl:
588         Expose all of the text rects to Internals, not just the bounding rect.
589         Expose some more TextIndicator options to Internals so that we can
590         turn on the legibility mechanism.
591
592 2019-07-24  Devin Rousso  <drousso@apple.com>
593
594         Web Inspector: print the target of `console.screenshot` last so the target is the closest item to the image
595         https://bugs.webkit.org/show_bug.cgi?id=199308
596
597         Reviewed by Joseph Pecoraro.
598
599         Right now, evaluating `console.screenshot(document, "test", 1);` will log a message to the
600         console with `#document`, `"test"`, and `1`, all on different lines (togglable by a
601         disclosure triangle) since `#document` isn't stringifiable.
602
603         The ideal situation would be to have `"test"` and `1` logged on the same line, and then have
604         `#document` be in a disclosure triangle. This way, you can "label" your images using
605         additional arguments (e.g. `console.screenshot(document.images[1], "second image");`), as
606         well as provide other data.
607
608         If the only argument was the target, it should print as if it was `console.log(target);`.
609
610         If there are no arguments, it should print the text "Viewport"` before the image.
611
612         Test: inspector/console/console-screenshot.html
613
614         * page/PageConsoleClient.cpp:
615         (WebCore::PageConsoleClient::addMessage):
616         (WebCore::PageConsoleClient::screenshot):
617
618 2019-07-24  Alicia Boya García  <aboya@igalia.com>
619
620         [MSE] Reenqueue after removeCodedFrames()
621         https://bugs.webkit.org/show_bug.cgi?id=199749
622
623         Reviewed by Xabier Rodriguez-Calvar.
624
625         Before this patch, SourceBuffer::removeCodedFrames() did not trigger
626         an immediate reenqueue, but rather just set the `needsReenqueuing`
627         flag, deferring it for the next append... but there may not be another
628         append! In that case, the removed frames would still wrongly play.
629
630         This is the case for instance in tests where a single long media
631         append is done and then "cropped" with SourceBuffer.erase().
632
633         Test: media/media-source/media-source-erase-after-last-append.html
634
635         * Modules/mediasource/SourceBuffer.cpp:
636         (WebCore::SourceBuffer::removeCodedFrames):
637
638 2019-07-24  Jer Noble  <jer.noble@apple.com>
639
640         Add per-document autoplay quirk for netflix.com.
641         https://bugs.webkit.org/show_bug.cgi?id=200058
642
643         Reviewed by Eric Carlson.
644
645         Opt netflix.com into the desktop-style per-document autoplay quirk.
646
647         * page/Quirks.cpp:
648         (WebCore::Quirks::needsPerDocumentAutoplayBehavior const):
649
650 2019-07-24  Alicia Boya García  <aboya@igalia.com>
651
652         [GStreamer] Don't crash with empty video src
653         https://bugs.webkit.org/show_bug.cgi?id=200081
654
655         When a <video> element is set to load empty or about:blank, a player is still
656         created, but no pipeline is loaded. This patch fixes some assertion errors that
657         manifested in that case.
658
659         Reviewed by Philippe Normand.
660
661         Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_crash_empty_src.html
662
663         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
664         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
665         (WebCore::MediaPlayerPrivateGStreamer::platformDuration const):
666         (WebCore::MediaPlayerPrivateGStreamer::paused const):
667
668 2019-07-23  Justin Fan  <justin_fan@apple.com>
669
670         [WebGPU] Implement errors for GPURenderPipeline creation
671         https://bugs.webkit.org/show_bug.cgi?id=200046
672
673         Reviewed by Myles C. Maxfield.
674
675         Replacing error logging in GPURenderPipeline creation with GPUError generation. 
676         Update GPUErrorScopes to re-use an error message prefix for less boiler-plate.
677
678         Test: webgpu/render-pipeline-errors.html
679
680         * Modules/webgpu/WebGPUDevice.cpp:
681         (WebCore::WebGPUDevice::createRenderPipeline const):
682         * Modules/webgpu/WebGPURenderPipelineDescriptor.cpp:
683         (WebCore::WebGPURenderPipelineDescriptor::tryCreateGPURenderPipelineDescriptor const):
684         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
685         * platform/graphics/gpu/GPUDevice.cpp:
686         (WebCore::GPUDevice::tryCreateRenderPipeline const):
687         * platform/graphics/gpu/GPUDevice.h:
688         * platform/graphics/gpu/GPUErrorScopes.cpp:
689         (WebCore::GPUErrorScopes::generatePrefixedError):
690         * platform/graphics/gpu/GPUErrorScopes.h:
691         (WebCore::GPUErrorScopes::setErrorPrefix):
692         * platform/graphics/gpu/GPURenderPipeline.h:
693         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
694         (WebCore::tryCreateMtlDepthStencilState):
695         (WebCore::trySetVertexInput):
696         (WebCore::trySetColorStates):
697         (WebCore::trySetMetalFunctions):
698         (WebCore::trySetFunctions):
699         (WebCore::convertRenderPipelineDescriptor):
700         (WebCore::tryCreateMtlRenderPipelineState):
701         (WebCore::GPURenderPipeline::tryCreate):
702         (WebCore::GPURenderPipeline::GPURenderPipeline):
703
704 2019-07-23  Konstantin Tokarev  <annulen@yandex.ru>
705
706         ImageDecoderDirect2D::hotSpot() should return WTF::nullopt instead of default constructed value
707         https://bugs.webkit.org/show_bug.cgi?id=200055
708
709         Reviewed by Brent Fulgham.
710
711         * platform/graphics/win/ImageDecoderDirect2D.cpp:
712         (WebCore::ImageDecoderDirect2D::hotSpot const):
713
714 2019-07-23  Tim Horton  <timothy_horton@apple.com>
715
716         Long press hint has half blue shape in Feedly.com
717         https://bugs.webkit.org/show_bug.cgi?id=200053
718         <rdar://problem/53323369>
719
720         Reviewed by Simon Fraser.
721
722         No new tests, because TextIndicator snapshots are not yet testable.
723
724         * rendering/RenderLayer.cpp:
725         (WebCore::RenderLayer::paintForegroundForFragments):
726         Paint ChildBlockBackgrounds when painting selection AND backgrounds;
727         only exclude it when doing a selection-only paint.
728
729 2019-07-23  Chris Fleizach  <cfleizach@apple.com>
730
731         AX: CrashTracer: com.apple.WebKit.WebContent at WebKit: WebKit::WebSpeechSynthesisClient::speak
732         https://bugs.webkit.org/show_bug.cgi?id=199988
733
734         Reviewed by Per Arne Vollan.
735
736         Implement the reset state to cancel current speech jobs.
737
738         * Modules/speech/SpeechSynthesis.cpp:
739         (WebCore::SpeechSynthesis::startSpeakingImmediately):
740         (WebCore::SpeechSynthesis::cancel):
741         * platform/PlatformSpeechSynthesizer.h:
742         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
743         (WebCore::PlatformSpeechSynthesizer::resetState):
744         * platform/mac/PlatformSpeechSynthesizerMac.mm:
745         (WebCore::PlatformSpeechSynthesizer::resetState):
746
747 2019-07-23  Zalan Bujtas  <zalan@apple.com>
748
749         [iOS] Tapping the search field on a search results page on zillow.com shows and immediately dismisses the keyboard
750         https://bugs.webkit.org/show_bug.cgi?id=200044
751         <rdar://problem/53103732>
752
753         Reviewed by Wenson Hsieh.
754
755         1. The keyboard gets dismissed as the result of scroll event.
756         2. The (horizontal)scroll event is initiated by WebKit as we try to re-center the content.
757         3. The content gets off-centered as the result of the newly constructed drop-down menu which slightly sticks out of the document to the right (layout overflows).
758
759         It works with shipping version of iOS because _zoomToFocusRect operates on stale viewport information (see r244494 for the progression).
760         This patch applies a site specific quirk to restore shipping behavior.
761
762         * page/Quirks.cpp:
763         (WebCore::Quirks::shouldAvoidScrollingWhenFocusedContentIsVisible const):
764         * page/Quirks.h:
765
766 2019-07-23  Said Abou-Hallawa  <sabouhallawa@apple.com>
767
768         CanvasRenderingContext2D.setTransfrom() reads only the aliases attributes of DOMMatrix2DInit
769         https://bugs.webkit.org/show_bug.cgi?id=199850
770
771         Reviewed by Simon Fraser.
772
773         The validateAndFixup step of DOMMatrix2DInit sets the matrix attributes 
774         (m** fields) from the aliases attributes (a, b, c, d, e, f) if the former
775         ones do not exist and the later ones exist. See
776         https://www.w3.org/TR/geometry-1/#dommatrixinit-dictionary and
777         DOMMatrixReadOnly::validateAndFixup(DOMMatrix2DInit& init).
778
779         Since CanvasRenderingContext2DBase::setTransform() validates and fixes
780         the input DOMMatrix2DInit, it should rely on matrix attributes.
781
782         Test: fast/canvas/setTransfrom-aliases-transform.html
783
784         * html/canvas/CanvasRenderingContext2DBase.cpp:
785         (WebCore::CanvasRenderingContext2DBase::setTransform):
786
787 2019-07-23  Tim Horton  <timothy_horton@apple.com>
788
789         Long press hint of AirPods buy buttons are tall and narrow during animation
790         https://bugs.webkit.org/show_bug.cgi?id=200036
791         <rdar://problem/53145697>
792
793         Reviewed by Wenson Hsieh.
794
795         New test: fast/text-indicator/text-indicator-with-tiny-child.html
796
797         * dom/Range.cpp:
798         (WebCore::Range::borderAndTextRects const):
799         * dom/Range.h:
800         Add a BoundingRectBehavior that ignores 1x1 and smaller rects.
801
802         * page/TextIndicator.cpp:
803         (WebCore::absoluteBoundingRectForRange):
804         Enable IgnoreTinyRects.
805
806 2019-07-23  Wenson Hsieh  <wenson_hsieh@apple.com>
807
808         [macOS 10.15] Web process crashes when attempting to show the font panel via Font > Show Fonts
809         https://bugs.webkit.org/show_bug.cgi?id=200021
810         <rdar://problem/53301325>
811
812         Reviewed by Ryosuke Niwa.
813
814         In macOS 10.15, attempting to access ~/Library/FontCollections/ from the web process causes a Sandbox violation
815         and a subsequent crash. This can be triggered by trying to show the font panel via Font > Show Fonts in the
816         context menu after right clicking.
817
818         In the (near) future, we should fix this by moving logic to show the font panel, color panel and styles panel
819         from the Editor in the web process to the UI process in WebKit2. However, for the time being, we can just work
820         around this by adding a new EditorClient hook to determine whether to allow the font panel to show; this returns
821         true in the legacy macOS WebKit port, and false everywhere else.
822
823         Test: editing/mac/style/do-not-crash-when-showing-font-panel.html
824
825         * editing/mac/EditorMac.mm:
826         (WebCore::Editor::showFontPanel):
827         * loader/EmptyClients.cpp:
828         * page/EditorClient.h:
829
830 2019-07-23  Ryosuke Niwa  <rniwa@webkit.org>
831
832         WebKit should strip away system font names from the pasted content
833         https://bugs.webkit.org/show_bug.cgi?id=199975
834         <rdar://problem/53336353>
835
836         Reviewed by Darin Adler.
837
838         Cocoa HTML Writer sometimes generate system font names such as ".AppleSystemUIFont", ".SFUI-Regular", and ".SF UI Mono".
839         We need to strip away these font names upon paste to avoid these font names falling back to Times New Roman.
840
841         Added the code to strip these font names away in EditingStyle::mergeStyleFromRulesForSerialization, which is used by
842         StylizedMarkupAccumulator to generate HTML during copy. This works because WebContentReader::readWebArchive invokes
843         sanitizeMarkupWithArchive which inserts the pasteboard content into a temporary document then re-serializes back to HTML
844         using StylizedMarkupAccumulator before the actual pasting happens.
845
846         This approach has a few benefits over stripping away these font names in ReplaceSelectionCommand:
847
848         1. It would only affect clients that opts-in to copy & paste sanitization. e.g. it won't affect legacy WebKit clients
849         and those that opt out of pasteboard content sanitization.
850
851         2. It preserves font names such as ".SF Blah" that a website may insert as some kind of house keeping purposes if ever.
852         While we don't have any evidence that there is any such a website but it's a real risk nonetheless. The copy side fix would
853         only affect cross-site and cross-app pasting, which is rare and less likely to affect real user scenarios.
854
855         3. It avoids exposing bogus .Apple* or .SF* font names to websites that directly use event.clipboardData.getData.
856         Indeed stripping away bogus markup like this is one of the key features / benefit of using copy & paste sanitization.
857
858         Test: editing/pasteboard/paste-cocoa-writer-markup-with-system-fonts.html
859
860         * editing/EditingStyle.cpp:
861         (WebCore::usesForbiddenSystemFontAsOnlyFontFamilyName): Added.
862         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization): Added the code to remove font-family property when needed.
863         * platform/graphics/FontCache.h:
864         * platform/graphics/cocoa/FontCacheCoreText.cpp:
865         (WebCore::isSystemFont): Moved.
866         (WebCore::FontCache::isSystemFontForbiddenForEditing): Added.
867         * platform/graphics/freetype/FontCacheFreeType.cpp:
868         (WebCore::FontCache::isSystemFontForbiddenForEditing): Added. Always returns false.
869         * platform/graphics/win/FontCacheWin.cpp:
870         (WebCore::FontCache::isSystemFontForbiddenForEditing): Ditto.
871
872 2019-07-22  Yusuke Suzuki  <ysuzuki@apple.com>
873
874         [bmalloc] Each IsoPage gets 1MB VA because VMHeap::tryAllocateLargeChunk rounds up
875         https://bugs.webkit.org/show_bug.cgi?id=200024
876
877         Reviewed by Saam Barati.
878
879         Changed how we interpret VM tags. Add IsoHeap VM tag support, and rename WebAssembly tag
880         to Gigacage tag.
881
882         * page/ResourceUsageData.h:
883         * page/ResourceUsageOverlay.h:
884         * page/cocoa/ResourceUsageOverlayCocoa.mm:
885         (WebCore::HistoricResourceUsageData::HistoricResourceUsageData):
886         * page/cocoa/ResourceUsageThreadCocoa.mm:
887         (WebCore::displayNameForVMTag):
888         (WebCore::categoryForVMTag):
889
890 2019-07-22  Youenn Fablet  <youenn@apple.com>
891
892         Fix inspector override conversion in InspectorPageAgent::overrideSetting
893         https://bugs.webkit.org/show_bug.cgi?id=200017
894
895         Reviewed by Devin Rousso.
896
897         Covered by inspector/page/overrideSetting-MockCaptureDevicesEnabled.html
898         which should not fail on bots not having cameras
899
900         * inspector/agents/InspectorPageAgent.cpp:
901         (WebCore::toOptionalBool):
902         (WebCore::InspectorPageAgent::overrideSetting):
903         Previously, the conversion for the mock capture value was implicit from a bool pointer to an optional.
904         Make an explicit conversion as done for regular settings.
905
906 2019-07-22  Ross Kirsling  <ross.kirsling@sony.com>
907
908         Unreviewed non-unified build fix.
909
910         * Modules/webdatabase/DatabaseContext.h:
911         * html/HTMLDialogElement.cpp:
912         * html/HTMLScriptElement.cpp:
913         * inspector/agents/InspectorDatabaseAgent.cpp:
914         * workers/service/server/SWServerWorker.cpp:
915         * workers/service/server/SWServerWorker.h:
916         * worklets/WorkletGlobalScope.cpp:
917         * worklets/WorkletGlobalScope.h:
918
919 2019-07-22  Wenson Hsieh  <wenson_hsieh@apple.com>
920
921         [iOS] [WK1] UIWebView always jumps to the top left corner when scrolling to reveal the selection
922         https://bugs.webkit.org/show_bug.cgi?id=200013
923         <rdar://problem/52526901>
924
925         Reviewed by Simon Fraser.
926
927         After <https://trac.webkit.org/r244141>, we no longer attempt to scroll to reveal the text selection in
928         UIWebView after changing the selection, due to how we use the legacy document view rect in legacy WebKit when
929         computing the visual viewport. This causes the viewRect in RenderLayer::scrollRectToVisible to be the same size
930         as the content size, which then causes us to always scroll to the origin when revealing the selection.
931
932         To make selection revealing work again in legacy WebKit, conditionally restore the old behavior of using the
933         unobscured content rect as the view rect, only in the case where scrolling is delegated and the platform widget
934         is present.
935
936         Test: WebKitLegacy.ScrollToRevealSelection
937
938         * page/FrameView.cpp:
939         (WebCore::FrameView::viewRectExpandedByContentInsets const):
940         (WebCore::FrameView::visualViewportRectExpandedByContentInsets const): Deleted.
941
942         Additionally rename visualViewportRectExpandedByContentInsets to viewRectExpandedByContentInsets, to reflect the
943         fact that this may either be the visual viewport rect or unobscured content rect.
944
945         * page/FrameView.h:
946         * rendering/RenderLayer.cpp:
947         (WebCore::RenderLayer::scrollRectToVisible):
948
949 2019-07-22  Brent Fulgham  <bfulgham@apple.com>
950
951         Correct web audio-related crash in seed reports
952         https://bugs.webkit.org/show_bug.cgi?id=200009
953         <rdar://problem/51565203>
954
955         Reviewed by Per Arne Vollan.
956
957         Update the 'createMix' method to do proper return value checking so that
958         we can clear the result of MTAudioProcessingTapCreate if the create operation
959         failed.
960
961         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
962         (WebCore::AudioSourceProviderAVFObjC::createMix):
963
964 2019-07-22  Per Arne Vollan  <pvollan@apple.com>
965
966         Prewarmed font does not find any matches
967         https://bugs.webkit.org/show_bug.cgi?id=200007
968
969         Reviewed by Brent Fulgham.
970
971         Prewarming the font name 'SF Pro Text' does not find any matches. The font name ".SF NS Text/Display"
972         should be used instead. Also add 'Lucida Grande' to the list of prewarmed font, since it is used as
973         fallback font in many cases.
974
975         No new tests, covered by existing tests.
976
977         * platform/graphics/cocoa/FontCacheCoreText.cpp:
978         (WebCore::fontFamiliesForPrewarming):
979
980 2019-07-22  Youenn Fablet  <youenn@apple.com>
981
982         Make sure the player underlying volume is correctly set after creating a new player
983         https://bugs.webkit.org/show_bug.cgi?id=199974
984         <rdar://problem/52762559>
985
986         Reviewed by Eric Carlson.
987
988         When creating a player before starting to play, the volume might not be correctly initialized.
989         Fix that by updating the volume like done for rate and muted state.
990         A future refactoring should probably move that code in MediaPlayer.
991
992         Add an internal API to query the volume value from the underlying player.
993
994         Test: http/tests/media/audio-volume-zero.html
995
996         * html/HTMLMediaElement.cpp:
997         (WebCore::HTMLMediaElement::updateVolume):
998         (WebCore::HTMLMediaElement::updatePlayState):
999         (WebCore::HTMLMediaElement::effectiveVolume const):
1000         (WebCore::HTMLMediaElement::effectiveMuted const):
1001         * html/HTMLMediaElement.h:
1002         * testing/Internals.cpp:
1003         (WebCore::Internals::privatePlayerVolume):
1004         * testing/Internals.h:
1005         * testing/Internals.idl:
1006         * testing/Internals.mm:
1007         (WebCore::Internals::privatePlayerVolume):
1008
1009 2019-07-22  Devin Rousso  <drousso@apple.com>
1010
1011         Web Inspector: Page: mark any WebCore::Setting inspector override as UNLIKELY
1012         https://bugs.webkit.org/show_bug.cgi?id=199925
1013
1014         Reviewed by Joseph Pecoraro.
1015
1016         * Scripts/SettingsTemplates/Settings.cpp.erb:
1017
1018 2019-07-22  Simon Fraser  <simon.fraser@apple.com>
1019
1020         Fix crashes in ScrollingStateNode::insertChild()
1021         https://bugs.webkit.org/show_bug.cgi?id=200023
1022         rdar://problem/53265378
1023
1024         Reviewed by Darin Adler.
1025
1026         Crash data suggest that ScrollingStateNode::insertChild() can be passed an index that
1027         is larger than the size of the vector, causing crashes.
1028
1029         Fix defensively by falling back to append() if the passed index is equal to or larger
1030         than the size of the children vector.
1031
1032         * page/scrolling/ScrollingStateNode.cpp:
1033         (WebCore::ScrollingStateNode::insertChild):
1034
1035 2019-07-22  Simon Fraser  <simon.fraser@apple.com>
1036
1037         Make some constructors explicit
1038         https://bugs.webkit.org/show_bug.cgi?id=199981
1039
1040         Reviewed by Daniel Bates.
1041
1042         Make explicit public constructors of objects that take POD or String& arguments,
1043         to reduce the changes of the compiler doing implicit conversions.
1044
1045         * Modules/indexeddb/server/IndexValueEntry.h:
1046         * Modules/indexeddb/server/IndexValueStore.h:
1047         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
1048         * Modules/webdatabase/ChangeVersionData.h:
1049         (WebCore::ChangeVersionData::ChangeVersionData):
1050         * Modules/webdatabase/OriginLock.h:
1051         * Modules/websockets/WebSocketExtensionParser.h:
1052         (WebCore::WebSocketExtensionParser::WebSocketExtensionParser):
1053         * bindings/js/ScriptCachedFrameData.h:
1054         * contentextensions/URLFilterParser.cpp:
1055         (WebCore::ContentExtensions::PatternParser::PatternParser):
1056         * css/parser/CSSTokenizer.h:
1057         * css/parser/SizesAttributeParser.h:
1058         * dom/SpaceSplitString.cpp:
1059         (WebCore::TokenIsEqualToCStringTokenProcessor::TokenIsEqualToCStringTokenProcessor):
1060         * html/FormController.cpp:
1061         (WebCore::SavedFormState::appendControlState):
1062         (WebCore::SavedFormState::takeControlState):
1063         * loader/ProgressTracker.cpp:
1064         (WebCore::ProgressItem::ProgressItem):
1065         * page/DragController.cpp:
1066         (WebCore::DragController::DragController):
1067         (WebCore::DragController::performDragOperation):
1068         * page/DragController.h:
1069         * page/animation/CSSPropertyAnimation.cpp:
1070         (WebCore::AnimationPropertyWrapperBase::AnimationPropertyWrapperBase):
1071         * page/ios/DOMTimerHoldingTank.h:
1072         (WebCore::DeferDOMTimersForScope::DeferDOMTimersForScope):
1073         * platform/CountedUserActivity.h:
1074         (WebCore::CountedUserActivity::CountedUserActivity):
1075         * platform/audio/DirectConvolver.h:
1076         * platform/audio/DownSampler.h:
1077         * platform/audio/DynamicsCompressorKernel.h:
1078         * platform/audio/EqualPowerPanner.h:
1079         * platform/audio/MultiChannelResampler.h:
1080         * platform/audio/ReverbAccumulationBuffer.h:
1081         * platform/audio/ReverbInputBuffer.h:
1082         * platform/audio/SincResampler.cpp:
1083         * platform/audio/UpSampler.h:
1084         * platform/audio/ios/AudioFileReaderIOS.h:
1085         * platform/audio/mac/AudioFileReaderMac.h:
1086         * platform/audio/mac/AudioSessionMac.cpp:
1087         (WebCore::AudioSessionPrivate::AudioSessionPrivate):
1088         * platform/cf/KeyedDecoderCF.h:
1089         * platform/graphics/WidthIterator.cpp:
1090         (WebCore::OriginalAdvancesForCharacterTreatedAsSpace::OriginalAdvancesForCharacterTreatedAsSpace):
1091         * platform/graphics/cocoa/FontCacheCoreText.h:
1092         (WebCore::SynthesisPair::SynthesisPair):
1093         * platform/graphics/displaylists/DisplayListItems.h:
1094         (WebCore::DisplayList::DrawingItem::DrawingItem):
1095         * platform/network/cf/ResourceRequest.h:
1096         (WebCore::ResourceRequest::ResourceRequest):
1097         * platform/text/TextCodecICU.h:
1098         * rendering/RenderTableSection.h:
1099         (WebCore::CellSpan::CellSpan):
1100         * rendering/shapes/RasterShape.cpp:
1101         * rendering/shapes/RasterShape.h:
1102         (WebCore::RasterShapeIntervals::RasterShapeIntervals):
1103         * testing/MockLibWebRTCPeerConnection.h:
1104         (WebCore::MockLibWebRTCIceCandidate::MockLibWebRTCIceCandidate):
1105
1106 2019-07-22  Rob Buis  <rbuis@igalia.com>
1107
1108         Remove some unneeded code in MathOperator
1109         https://bugs.webkit.org/show_bug.cgi?id=199935
1110
1111         Reviewed by Frédéric Wang.
1112
1113         Remove unused method.
1114
1115         No new tests, not changing behavior.
1116
1117         * rendering/mathml/MathOperator.h:
1118
1119 2019-07-21  Konstantin Tokarev  <annulen@yandex.ru>
1120
1121         Add DataListButtonElement.cpp to unified sources
1122         https://bugs.webkit.org/show_bug.cgi?id=199989
1123
1124         Reviewed by Michael Catanzaro.
1125
1126         * Sources.txt:
1127         * WebCore.xcodeproj/project.pbxproj:
1128
1129 2019-07-21  Andres Gonzalez  <andresg_22@apple.com>
1130
1131         Add accessibilityInsertText for text insertion in edit fields.
1132         https://bugs.webkit.org/show_bug.cgi?id=199973
1133
1134         Reviewed by Chris Fleizach.
1135
1136         Renamed accessibilityInsertText to _accessibilityInsertText.
1137
1138         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1139         (-[WebAccessibilityObjectWrapper _accessibilityInsertText:]):
1140         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]): Deleted.
1141         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1142         (-[WebAccessibilityObjectWrapper _accessibilityInsertText:]):
1143         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]): Deleted.
1144
1145 2019-07-21  Saam Barati  <sbarati@apple.com>
1146
1147         [WHLSL] Checker needs to setError() when a property access node can't commit its base type
1148         https://bugs.webkit.org/show_bug.cgi?id=199978
1149
1150         Reviewed by Dean Jackson.
1151
1152         Test: webgpu/whlsl/null-array-property-access.html
1153
1154         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1155         (WebCore::WHLSL::Checker::finishVisiting):
1156
1157 2019-07-21  Saam Barati  <sbarati@apple.com>
1158
1159         [WHLSL] Return the zero-value enum in the enum-from-integer constructor when the integer is not a valid enum value
1160         https://bugs.webkit.org/show_bug.cgi?id=199853
1161
1162         Reviewed by Dean Jackson.
1163
1164         Test: webgpu/whlsl/enum-integer-constructor.html
1165
1166         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
1167         (WebCore::WHLSL::Metal::writeNativeFunction):
1168
1169 2019-07-21  Myles C. Maxfield  <mmaxfield@apple.com>
1170
1171         [iOS] Fast and complex text codepaths disagree about how to lay out bopomofo with tone marks
1172         https://bugs.webkit.org/show_bug.cgi?id=199912
1173         <rdar://problem/52182454>
1174
1175         Reviewed by Simon Fraser.
1176
1177         This is because CoreText has special composition rules for CJK languages, which we don't have in our simple
1178         text codepath. Rather than implementing the composition rules in WebKit, we can simply disable them in
1179         CoreText.
1180
1181         Test: fast/text/international/system-language/composition.html
1182
1183         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
1184         (WebCore::Font::getCFStringAttributes const):
1185
1186 2019-07-20  Andres Gonzalez  <andresg_22@apple.com>
1187
1188         Add accessibilityInsertText for text insertion in edit fields.
1189         https://bugs.webkit.org/show_bug.cgi?id=199973
1190
1191         Reviewed by Chris Fleizach.
1192
1193         Tests: accessibility/insert-newline.html
1194                accessibility/ios-simulator/insert-newline.html
1195
1196         Accessibility clients like VoiceOver and Voice Control were entering
1197         text in text fields by replacing the entire content of the field
1198         (SetValue) and then setting the insertion point to the appropriate
1199         offset (SetSelectedTextRange). accessibilityInsertText gives a simpler
1200         interface to clients to insert text at the insertion point location.
1201         In addition, this provides a workaround for the issue encountered with
1202         the previous method when inserting a linebreak.
1203
1204         * accessibility/AccessibilityObject.cpp:
1205         (WebCore::AccessibilityObject::insertText):
1206         * accessibility/AccessibilityObject.h:
1207         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1208         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
1209         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1210         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
1211
1212 2019-07-20  Alexander Mikhaylenko  <exalm7659@gmail.com>
1213
1214         REGRESSION(r246033/r246496): [GTK] Kinetic scrolling doesn't work
1215         https://bugs.webkit.org/show_bug.cgi?id=199322
1216
1217         Reviewed by Michael Catanzaro.
1218
1219         Check ENABLE(KINETIC_SCROLLING) instead of ENABLE(ASYNC_SCROLLING) for kinetic scrolling.
1220
1221         * platform/PlatformWheelEvent.h:
1222         * platform/generic/ScrollAnimatorGeneric.cpp:
1223         (WebCore::ScrollAnimatorGeneric::handleWheelEvent):
1224         * platform/gtk/PlatformWheelEventGtk.cpp:
1225         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
1226
1227 2019-07-20  Zalan Bujtas  <zalan@apple.com>
1228
1229         [LFC][TFC] Introduce table formatting context.
1230         https://bugs.webkit.org/show_bug.cgi?id=199979
1231         <rdar://problem/53346292>
1232
1233         Reviewed by Antti Koivisto.
1234
1235         Add the basic class structure for the table formatting context.
1236         https://www.w3.org/TR/CSS22/tables.html
1237
1238         * Sources.txt:
1239         * WebCore.xcodeproj/project.pbxproj:
1240         * layout/FormattingState.h:
1241         (WebCore::Layout::FormattingState::isTableFormattingState const):
1242         * layout/tableformatting/TableFormattingContext.cpp: Added.
1243         (WebCore::Layout::TableFormattingContext::TableFormattingContext):
1244         (WebCore::Layout::TableFormattingContext::layout const):
1245         * layout/tableformatting/TableFormattingContext.h: Added.
1246         * layout/tableformatting/TableFormattingState.cpp: Added.
1247         (WebCore::Layout::TableFormattingState::TableFormattingState):
1248         (WebCore::Layout::TableFormattingState::~TableFormattingState):
1249         * layout/tableformatting/TableFormattingState.h: Added.
1250         * layout/tableformatting/TableInvalidation.cpp: Added.
1251         (WebCore::Layout::TableInvalidation::invalidate):
1252         * layout/tableformatting/TableInvalidation.h: Added.
1253
1254 2019-07-20  Zalan Bujtas  <zalan@apple.com>
1255
1256         [LFC][IFC] Add support for mid-word break.
1257         https://bugs.webkit.org/show_bug.cgi?id=199976
1258         <rdar://problem/53337349>
1259
1260         Reviewed by Antti Koivisto.
1261
1262         Introduce leading and trailing InlineTextItem to support incoming and outgoing partial content.
1263         TextUtil::split is a straight copy of SimpleLineLayout::split.
1264
1265         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1266         (WebCore::Layout::inlineItemWidth):
1267         (WebCore::Layout::LineLayout::close):
1268         (WebCore::Layout::LineLayout::placeInlineItem):
1269         (WebCore::Layout::LineLayout::layout):
1270         * layout/inlineformatting/InlineTextItem.cpp:
1271         (WebCore::Layout::InlineTextItem::split const):
1272         (WebCore::Layout::InlineTextItem::split): Deleted.
1273         * layout/inlineformatting/InlineTextItem.h:
1274         (WebCore::Layout::InlineTextItem::inlineBox const):
1275         * layout/inlineformatting/text/TextUtil.cpp:
1276         (WebCore::Layout::TextUtil::split):
1277         * layout/inlineformatting/text/TextUtil.h:
1278
1279 2019-07-20  Zalan Bujtas  <zalan@apple.com>
1280
1281         [Text autosizing] Do not nuke the style on dynamicViewportSizeUpdate
1282         https://bugs.webkit.org/show_bug.cgi?id=199718
1283         <rdar://problem/53344961>
1284
1285         Reviewed by Simon Fraser.
1286
1287         When the page scale changes (e.g. as the result of shink to fit mode) we need to visit all the text content on the page and check whether they need to be boosted.
1288         Currently we call setNeedsRecalcStyleInAllFrames() to accomplish it. Unfortunatelly setNeedsRecalcStyleInAllFrames destroys all the style information which means that the
1289         subsequent styleResolve() needs to start from scratch.
1290         This patch addresses this issue by directly adjusting the computed style information when text boosting is required and schedules layout accordingly. We also trigger this style adjusting
1291         on a timer so that rapid dynamicViewportSizeUpdate() calls won't trigger redundant layouts.
1292
1293         * css/StyleResolver.cpp:
1294         (WebCore::hasTextChild):
1295         (WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):
1296         (WebCore::hasTextChildren): Deleted.
1297         * css/StyleResolver.h:
1298         * page/FrameView.h:
1299         * page/Page.cpp:
1300         (WebCore::Page::invalidateTextAutoSizeInAllFrames):
1301         * page/Page.h:
1302
1303 2019-07-20  Saam Barati  <sbarati@apple.com>
1304
1305         [WHLSL] Make enums work
1306         https://bugs.webkit.org/show_bug.cgi?id=199634
1307
1308         Reviewed by Robin Morisset.
1309
1310         This patch makes enums work. There were a couple changes needed to do this work:
1311         1. In the metal codegen, we were emitting code like "EnumType.EnumValue"
1312         instead of "EnumType::EnumValue".
1313         
1314         2. Inside the enumeration declaration AST node, we track enums in a HashMap
1315         because we need to look up names of enum values in that map in parts of the
1316         compiler. However, HashMap is not ordered but we were relying on the iteration
1317         order of it to generate the default values of enums. E.g, in: "enum { Foo = 10, Bar }",
1318         Bar should be 11. However, there was no guarantee that we iterated over Bar
1319         after Foo. Instead, we just track the default values as we parse an enum
1320         inside of the parser. This allows us to continue to keep using HashMap without
1321         also adding an auxiliary data structure (or using more memory in some way) to
1322         track the order of the enum elements.
1323         
1324         I've also filed a patch to do follow-up work on implementing the correct
1325         operational behavior when constructing an enum from its underlying type when
1326         the underlying value does not match any enum value:
1327         https://bugs.webkit.org/show_bug.cgi?id=199853
1328
1329         Tests: webgpu/whlsl/enums-2.html
1330                webgpu/whlsl/enums.html
1331
1332         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
1333         (WebCore::WHLSL::AST::EnumerationMember::EnumerationMember):
1334         (WebCore::WHLSL::AST::EnumerationMember::value):
1335         (WebCore::WHLSL::AST::EnumerationMember::setValue): Deleted.
1336         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
1337         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
1338         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
1339         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
1340         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
1341         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
1342         (WebCore::WHLSL::ASTDumper::visit):
1343         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1344         (WebCore::WHLSL::Checker::visit):
1345         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
1346         (WebCore::WHLSL::Parser::parseEnumerationDefinition):
1347         (WebCore::WHLSL::Parser::parseEnumerationMember):
1348         * Modules/webgpu/WHLSL/WHLSLParser.h:
1349         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
1350         (WebCore::WHLSL::Visitor::visit):
1351
1352 2019-07-19  Youenn Fablet  <youenn@apple.com>
1353
1354         Remote WebInspector should enable mock capture devices in UIProcess if doing it in WebProcess
1355         https://bugs.webkit.org/show_bug.cgi?id=199924
1356         <rdar://problem/50552067>
1357
1358         Reviewed by Devin Rousso.
1359
1360         Add necessary API to set mock capture devices override.
1361         In case of desynchronization between webprocess and uiprocess, make sure to return early
1362         and fail capture instead of crashing.
1363
1364         * inspector/InspectorClient.h:
1365         (WebCore::InspectorClient::setMockCaptureDevicesEnabled):
1366         * inspector/agents/InspectorPageAgent.cpp:
1367         (WebCore::InspectorPageAgent::disable):
1368         (WebCore::InspectorPageAgent::overrideSetting):
1369         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1370
1371 2019-07-19  Andy Estes  <aestes@apple.com>
1372
1373         [Apple Pay] Log less in PaymentCoordinator::shouldEnableApplePayAPIs()
1374         https://bugs.webkit.org/show_bug.cgi?id=199958
1375
1376         Reviewed by Tim Horton.
1377
1378         Only log when APIs are disabled due to user scripts.
1379
1380         * Modules/applepay/PaymentCoordinator.cpp:
1381         (WebCore::PaymentCoordinator::shouldEnableApplePayAPIs const):
1382
1383 2019-07-19  Dean Jackson  <dino@apple.com>
1384
1385         Add a menu item to toggle between showing and hiding link previews
1386         https://bugs.webkit.org/show_bug.cgi?id=199940
1387         <rdar://problem/53032288>
1388
1389         Reviewed by Beth Dakin.
1390
1391         New strings for Show/Hide Link Previews.
1392
1393         * en.lproj/Localizable.strings:
1394
1395 2019-07-19  Antoine Quint  <graouts@apple.com>
1396
1397         Links stop working after long-pressing a link (WK1)
1398         https://bugs.webkit.org/show_bug.cgi?id=199952
1399         <rdar://problem/52291860>
1400
1401         Reviewed by Wenson Hsieh.
1402
1403         Test: fast/events/touch/ios/click-after-long-press.html
1404
1405         When EventHandler::tryToBeginDragAtPoint() is called, we must reset m_mousePressed to false so that
1406         WebChromeClientIOS::observedContentChange() is called by EventHandler::mousePressed() when we would
1407         process the next tap after a drag interaction.
1408
1409         * page/ios/EventHandlerIOS.mm:
1410         (WebCore::EventHandler::tryToBeginDragAtPoint):
1411
1412 2019-07-19  Sihui Liu  <sihui_liu@apple.com>
1413
1414         IndexedDB: error in starting version change transaction may be neglected
1415         https://bugs.webkit.org/show_bug.cgi?id=199818
1416         <rdar://problem/52925738>
1417
1418         Reviewed by Brady Eidson.
1419
1420         For version change transaction, IDBServer didn't wait the result of beginTransaction on the background thread 
1421         before giving the IDBClient the result of open request. In this case, beginTransaction may fail to update the 
1422         DatabaseVersion in database file or set m_originalDatabaseInfoBeforeVersionChange, but the transaction was
1423         marked as started. When we later set m_databaseInfo with m_originalDatabaseInfoBeforeVersionChange, 
1424         m_databaseInfo could become nullptr.
1425
1426         To write a test for this, we will need to simulate an SQLite error. I manually tested this by crafting the 
1427         SQLiteStatement in beginTransaction, making it an invalid statement, and verified that error event, instead of 
1428         ungradeneeded event is dispatched to the IDBRequest.
1429
1430         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1431         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
1432         (WebCore::IDBServer::UniqueIDBDatabase::performStartVersionChangeTransaction):
1433         (WebCore::IDBServer::UniqueIDBDatabase::didPerformStartVersionChangeTransaction):
1434         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
1435         (WebCore::IDBServer::UniqueIDBDatabase::beginTransactionInBackingStore): Deleted.
1436         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1437
1438 2019-07-19  Zalan Bujtas  <zalan@apple.com>
1439
1440         [LFC][IFC] Add partial content handling
1441         https://bugs.webkit.org/show_bug.cgi?id=199930
1442
1443         Reviewed by Antti Koivisto.
1444
1445         Move the actual inline item placement to a dedicated functions. This enables us to
1446         construct a dedicated InlineItem for the partial content and pass it in to this function.
1447
1448         <span>The quick brown fox jumps over the lazy dog</span> <- inline content
1449         [The][ ][quick][ ][brown][ ][fox][ ][jumps][ ][over][ ][the][ ][lazy][ ][dog] <- InlineItems
1450
1451         Line breaking:
1452         [The][ ][qu]
1453         [ick] <- Partial InlineItem (position: 6 length: 3) from [quick] (position: 4 length: 5)
1454
1455         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1456         (WebCore::Layout::LineLayout::close):
1457         (WebCore::Layout::LineLayout::placeInlineItem):
1458         (WebCore::Layout::LineLayout::layout):
1459         (WebCore::Layout::LineInput::LineInput):
1460         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
1461         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
1462         * layout/inlineformatting/InlineTextItem.cpp:
1463         (WebCore::Layout::InlineTextItem::split):
1464         * layout/inlineformatting/InlineTextItem.h:
1465
1466 2019-07-19  Charlie Turner  <cturner@igalia.com>
1467
1468         [GStreamer] Flush get_range calls during PAUSED->READY in WebKitWebSource
1469         https://bugs.webkit.org/show_bug.cgi?id=199934
1470
1471         Reviewed by Xabier Rodriguez-Calvar.
1472
1473         Unit testing not applicable.
1474
1475         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1476         (webKitWebSrcChangeState): A well-behaved element should unblock streaming threads
1477         during a PAUSED->READY transition, so do that here.
1478
1479 2019-07-19  Rob Buis  <rbuis@igalia.com>
1480
1481         Remove some unneeded code in MathOperator
1482         https://bugs.webkit.org/show_bug.cgi?id=199935
1483
1484         Reviewed by Frédéric Wang.
1485
1486         The initialize method is unneeded since the member
1487         variables all use default initialization.
1488
1489         No new tests, not changing behavior.
1490
1491         * rendering/mathml/MathOperator.cpp:
1492         (WebCore::MathOperator::MathOperator):
1493         (WebCore::MathOperator::GlyphAssemblyData::initialize): Deleted.
1494
1495 2019-07-18  Antoine Quint  <graouts@apple.com>
1496
1497         Enable simulated mouse events quirk for soundcloud.com
1498         https://bugs.webkit.org/show_bug.cgi?id=199908
1499         <rdar://problem/52915981>
1500
1501         Reviewed by Brent Fulgham.
1502
1503         Scrubbing on soundcloud.com relies on mouse events alone when displaying on iPad with the desktop UA string.
1504         Opting into the simulated mouse events quirk makes scrubbing work and we also ensure that page scrolling is
1505         disabled as a result of scrubbing by returning true in shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented().
1506
1507         Also making a drive-by fix in shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented() to use a reference
1508         instead of a pointer when downcasting a null-checked pointer.
1509
1510         * page/Quirks.cpp:
1511         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
1512         (WebCore::Quirks::shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented const):
1513
1514 2019-07-18  Per Arne Vollan  <pvollan@apple.com>
1515
1516         Prewarm font cache with more fonts
1517         https://bugs.webkit.org/show_bug.cgi?id=199283
1518
1519         Reviewed by Myles C. Maxfield.
1520
1521         Initialize the list of families requiring system fallback in the prewarming information struct, since
1522         this was part of the original, approved patch, and is needed for the performance improvement.
1523
1524         No new tests, covered by existing tests.
1525
1526         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1527         (WebCore::fontFamiliesForPrewarming):
1528         (WebCore::FontCache::prewarmGlobally):
1529
1530 2019-07-18  Ryan Haddad  <ryanhaddad@apple.com>
1531
1532         Unreviewed, rolling out r247531.
1533
1534         Caused multiple IndexedDB layout test crashes.
1535
1536         Reverted changeset:
1537
1538         "IndexedDB: error in starting version change transaction may
1539         be neglected"
1540         https://bugs.webkit.org/show_bug.cgi?id=199818
1541         https://trac.webkit.org/changeset/247531
1542
1543 2019-07-18  Antoine Quint  <graouts@apple.com>
1544
1545         Ensure Quirks::shouldDispatchSimulatedMouseEvents() works for all Google Maps and Amazon domains
1546         https://bugs.webkit.org/show_bug.cgi?id=199904
1547         <rdar://problem/53250104>
1548
1549         Reviewed by Dean Jackson.
1550
1551         Use topPrivatelyControlledDomain() to determine whether the URL is a Google or Amazon domain so as to apply
1552         Google Maps and Amazon quirks to all the various domain names used.
1553
1554         * page/Quirks.cpp:
1555         (WebCore::Quirks::isAmazon const):
1556         (WebCore::Quirks::isGoogleMaps const):
1557         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
1558         (WebCore::Quirks::simulatedMouseEventTypeForTarget const):
1559         * page/Quirks.h:
1560
1561 2019-07-18  Per Arne Vollan  <pvollan@apple.com>
1562
1563         Crash under WebPage::boundaryEventOccurred
1564         https://bugs.webkit.org/show_bug.cgi?id=199907
1565
1566         Reviewed by Chris Fleizach.
1567
1568         Add null pointer checks.
1569
1570         No new tests, since I have not been able to reproduce this in a test.
1571
1572         * Modules/speech/SpeechSynthesis.cpp:
1573         (WebCore::SpeechSynthesis::didStartSpeaking):
1574         (WebCore::SpeechSynthesis::didFinishSpeaking):
1575         (WebCore::SpeechSynthesis::didPauseSpeaking):
1576         (WebCore::SpeechSynthesis::didResumeSpeaking):
1577         (WebCore::SpeechSynthesis::speakingErrorOccurred):
1578         (WebCore::SpeechSynthesis::boundaryEventOccurred):
1579
1580 2019-07-18  Antoine Quint  <graouts@apple.com>
1581
1582         [Pointer Events] The button and buttons properties are incorrect on iOS
1583         https://bugs.webkit.org/show_bug.cgi?id=199910
1584         <rdar://problem/52778374>
1585
1586         Reviewed by Dean Jackson.
1587
1588         The button and buttons properties were always set to 0 on iOS. We now use the correct values such that
1589         button is always 0 except for "pointermove" where it's -1, and "buttons" is 1 as long as the pointer is
1590         in contact with the touch surface.
1591
1592         Tests: pointerevents/ios/pointer-event-button-and-buttons-pointer-cancel.html
1593                pointerevents/ios/pointer-event-button-and-buttons.html
1594
1595         * dom/ios/PointerEventIOS.cpp:
1596         (WebCore::buttonForType):
1597         (WebCore::buttonsForType):
1598         (WebCore::PointerEvent::PointerEvent):
1599
1600 2019-07-18  Antoine Quint  <graouts@apple.com>
1601
1602         REGRESSION: Unable to enable simulated mouse events using the runtime flag
1603         https://bugs.webkit.org/show_bug.cgi?id=199909
1604         <rdar://problem/53254895>
1605
1606         Reviewed by Dean Jackson.
1607
1608         The fix for wkb.ug/199508 (r247152) broke the ability enable simulated mouse events using the runtime flag.
1609         We now add a check for the flag in Quirks::shouldDispatchSimulatedMouseEvents() so that the runtime flag
1610         overrides the content of that function. This is more practical and allows for a quick override using the flag.
1611
1612         Additionally, we need only call shouldDispatchSimulatedMouseEvents() in simulatedMouseEventTypeForTarget() since
1613         that function already calls needsQuirks().
1614
1615         * dom/EventNames.h:
1616         (WebCore::EventNames::isTouchRelatedEventType const):
1617         * dom/Node.cpp:
1618         (WebCore::Node::moveNodeToNewDocument):
1619         * page/Quirks.cpp:
1620         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
1621         (WebCore::Quirks::simulatedMouseEventTypeForTarget const):
1622
1623 2019-07-18  Antoine Quint  <graouts@apple.com>
1624
1625         REGRESSION: Panning on an Amazon product image scrolls the page on iPadOS
1626         https://bugs.webkit.org/show_bug.cgi?id=199905
1627         <rdar://problem/49124529>
1628
1629         Reviewed by Dean Jackson.
1630
1631         Amazon product pages include images that the user can touch and pan to show zoomed details in a side image. This
1632         currently works on iPadOS thanks to the dispatch of simulated "mousemove" events on the product image, but the site
1633         doesn't call preventDefault() when handling those events as it wasn't necessary for macOS.
1634
1635         We add a new quirk that will indicate that a given element is such a product image.
1636
1637         * page/Quirks.cpp:
1638         (WebCore::Quirks::isAmazon const):
1639         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
1640         (WebCore::Quirks::shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented const):
1641         (WebCore::Quirks::simulatedMouseEventTypeForTarget const):
1642         * page/Quirks.h:
1643
1644 2019-07-18  Youenn Fablet  <youenn@apple.com>
1645
1646         Make sure to set kCTFontFallbackOptionAttribute to kCTFontFallbackOptionSystem for system fonts
1647         https://bugs.webkit.org/show_bug.cgi?id=199769
1648         <rdar://problem/49390297>
1649
1650         Reviewed by Myles C. Maxfield.
1651
1652         When getting a system font, set the appropriate attribute so that it
1653         does not fallback to a user initiated font.
1654         Add an ASSERT that checks that the font in use is not a user font if
1655         policy is to not use user installed fonts.
1656
1657         Tests: fast/text/user-installed-fonts/extended-character-with-user-font.html
1658                fast/text/user-installed-fonts/extended-character.html
1659
1660         * platform/graphics/Font.h:
1661         * platform/graphics/FontCascadeFonts.cpp:
1662         (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
1663         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1664         (WebCore::preparePlatformFont):
1665         (WebCore::FontDatabase::singletonAllowingUserInstalledFonts):
1666         (WebCore::FontDatabase::singletonDisallowingUserInstalledFonts):
1667         (WebCore::addAttributesForInstalledFonts):
1668         (WebCore::addAttributesForWebFonts):
1669         (WebCore::installedFontMandatoryAttributes):
1670         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
1671         (WebCore::Font::isUserInstalledFont const):
1672
1673 2019-07-18  Zalan Bujtas  <zalan@apple.com>
1674
1675         [LFC][IFC] InlineFormattingContext::LineLayout::placeInlineItems is getting too complex.
1676         https://bugs.webkit.org/show_bug.cgi?id=199898
1677         <rdar://problem/53235958>
1678
1679         Reviewed by Antti Koivisto.
1680
1681         It's time to restructure LineLayout::placeInlineItems to be able to expand it further.
1682         Introduce the LineLayout class. This class is responsible to place the inline items on the current line.
1683         (Rename InlineFormattingContext::lineLayout -> InlineFormattingContext::InlineLayout and
1684         use Line::InitialConstraints in LineInput)
1685
1686         * layout/inlineformatting/InlineFormattingContext.cpp:
1687         (WebCore::Layout::InlineFormattingContext::layout const):
1688         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
1689         * layout/inlineformatting/InlineFormattingContext.h:
1690         (WebCore::Layout::InlineFormattingContext::LineLayout::layoutState const): Deleted.
1691         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1692         (WebCore::Layout::inlineItemWidth):
1693         (WebCore::Layout::LineLayout::layoutState const):
1694         (WebCore::Layout::LineLayout::UncommittedContent::runs):
1695         (WebCore::Layout::LineLayout::UncommittedContent::isEmpty const):
1696         (WebCore::Layout::LineLayout::UncommittedContent::size const):
1697         (WebCore::Layout::LineLayout::UncommittedContent::width const):
1698         (WebCore::Layout::LineLayout::UncommittedContent::add):
1699         (WebCore::Layout::LineLayout::UncommittedContent::reset):
1700         (WebCore::Layout::LineLayout::LineLayout):
1701         (WebCore::Layout::LineLayout::commitPendingContent):
1702         (WebCore::Layout::LineLayout::close):
1703         (WebCore::Layout::LineLayout::layout):
1704         (WebCore::Layout::LineInput::LineInput):
1705         (WebCore::Layout::InlineFormattingContext::InlineLayout::InlineLayout):
1706         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
1707         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
1708         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
1709         (WebCore::Layout::InlineFormattingContext::InlineLayout::alignRuns const):
1710         (WebCore::Layout::UncommittedContent::runs): Deleted.
1711         (WebCore::Layout::UncommittedContent::isEmpty const): Deleted.
1712         (WebCore::Layout::UncommittedContent::size const): Deleted.
1713         (WebCore::Layout::UncommittedContent::width const): Deleted.
1714         (WebCore::Layout::UncommittedContent::add): Deleted.
1715         (WebCore::Layout::UncommittedContent::reset): Deleted.
1716         (WebCore::Layout::LineInput::HorizontalConstraint::HorizontalConstraint): Deleted.
1717         (WebCore::Layout::InlineFormattingContext::LineLayout::LineLayout): Deleted.
1718         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const): Deleted.
1719         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const): Deleted.
1720         (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const): Deleted.
1721         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const): Deleted.
1722         (WebCore::Layout::InlineFormattingContext::LineLayout::alignRuns const): Deleted.
1723         * layout/inlineformatting/InlineLine.cpp:
1724         (WebCore::Layout::Line::Line):
1725         * layout/inlineformatting/InlineLine.h:
1726
1727 2019-07-18  Carlos Garcia Campos  <cgarcia@igalia.com>
1728
1729         [GTK] MOUSE_CURSOR_SCALE is not implemented
1730         https://bugs.webkit.org/show_bug.cgi?id=109469
1731
1732         Reviewed by Darin Adler.
1733
1734         Use gdk_cursor_new_from_surface() instead of gdk_cursor_new_from_pixbuf() to avoid the surface to pixbuf
1735         conversion.
1736
1737         * platform/gtk/CursorGtk.cpp:
1738         (WebCore::createCustomCursor):
1739
1740 2019-07-17  Chris Dumez  <cdumez@apple.com>
1741
1742         Prewarm local storage in the NetworkProcess to reduce WebContent process hangs
1743         https://bugs.webkit.org/show_bug.cgi?id=199879
1744         <rdar://problem/53217757>
1745
1746         Reviewed by Ryosuke Niwa.
1747
1748         When JS accesses window.localStorage for the first time, we end up doing a
1749         synchronous IPC to the network process to pull in all items in the local
1750         storage for the origin. If the network process does not have this data in
1751         memory, it has to read it from a database on disk, which may take a significant
1752         amount of time and hang the WebContent process during this time.
1753
1754         To alleviate this problem, this patch introduces prewarming on the local storage
1755         in the network process when loading a given origin in the WebContent process.
1756         This way, in most cases, when the JS accesses window.localStorage for the first
1757         time, the synchronous IPC to the network process returns much faster (measured
1758         50-100ms for a very large database, down from 250-300ms), as it only needs to
1759         IPC the data over, without the need to fetch it from disk.
1760
1761         As a safety net to avoid excessive prewarming, we currently prewarm at most 5
1762         security origins per page load.
1763
1764         * loader/DocumentLoader.cpp:
1765         (WebCore::DocumentLoader::commitData):
1766         * page/DOMWindow.cpp:
1767         (WebCore::DOMWindow::prewarmLocalStorageIfNecessary):
1768         * page/DOMWindow.h:
1769         * page/Frame.cpp:
1770         (WebCore::Frame::didPrewarmLocalStorage):
1771         (WebCore::Frame::mayPrewarmLocalStorage const):
1772         * page/Frame.h:
1773         * storage/Storage.cpp:
1774         (WebCore::Storage::prewarm):
1775         * storage/Storage.h:
1776         * storage/StorageArea.h:
1777         (WebCore::StorageArea::prewarm):
1778
1779 2019-07-17  Robin Morisset  <rmorisset@apple.com>
1780
1781         [WHLSL] The lexer should not choke on a single '/'
1782         https://bugs.webkit.org/show_bug.cgi?id=199886
1783
1784         Reviewed by Myles Maxfield.
1785
1786         The bug is trivial: just recognize that a single '/' without a '*' or '/' afterwards is not the beginning of a comment.
1787
1788         While investigating this bug, I also found that part of the parser fails to properly propagate errors, so I fixed it.
1789
1790         New test in LayoutTests/webgpu/whlsl/float-math.html
1791         I also added a new flag to WHLSLPrepare.cpp. It can be used to parse the full standard library (this is how I found this bug in the first place).
1792
1793         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
1794         (WebCore::WHLSL::Lexer::skipWhitespaceAndComments):
1795         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
1796         (WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
1797         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
1798         (WebCore::WHLSL::prepareShared):
1799         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
1800         (WebCore::WHLSL::includeStandardLibrary):
1801         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.h:
1802
1803 2019-07-17  Simon Fraser  <simon.fraser@apple.com>
1804
1805         Unreviewed build fix after r247549.
1806
1807         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
1808
1809 2019-07-17  Robin Morisset  <rmorisset@apple.com>
1810
1811         [WHLSL] Remove traps from the compiler
1812         https://bugs.webkit.org/show_bug.cgi?id=195811
1813         <rdar://problem/50746299>
1814
1815         Reviewed by Myles Maxfield.
1816
1817         Remove the Trap statement from the language, see https://github.com/gpuweb/WHLSL/issues/301.
1818
1819         No new tests, as this part of the language was already untested, and we are removing it, not adding anything.
1820
1821         * Modules/webgpu/WHLSL/AST/WHLSLAST.h:
1822         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
1823         (WebCore::WHLSL::AST::Statement::isSwitchStatement const):
1824         * Modules/webgpu/WHLSL/AST/WHLSLTrap.h: Removed.
1825         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
1826         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
1827         * Modules/webgpu/WHLSL/WHLSLASTDumper.h:
1828         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
1829         (WebCore::WHLSL::Token::typeName):
1830         (WebCore::WHLSL::Lexer::recognizeKeyword):
1831         * Modules/webgpu/WHLSL/WHLSLLexer.h:
1832         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
1833         (WebCore::WHLSL::Parser::parseStatement):
1834         * Modules/webgpu/WHLSL/WHLSLParser.h:
1835         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp:
1836         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
1837         (WebCore::WHLSL::Visitor::visit):
1838         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
1839         * WebCore.xcodeproj/project.pbxproj:
1840
1841 2019-07-17  Robin Morisset  <rmorisset@apple.com>
1842
1843         [WHLSL] checkRecursiveType should not have exponential complexity.
1844         https://bugs.webkit.org/show_bug.cgi?id=199835
1845
1846         Reviewed by Myles Maxfield.
1847
1848         The change is very similar to that in https://bugs.webkit.org/show_bug.cgi?id=199688.
1849         Just keep track of which types have already been visited, and don't visit them again.
1850
1851         No new tests as there is no intended functional change.
1852
1853         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
1854         (WebCore::WHLSL::RecursiveTypeChecker::visit):
1855         (WebCore::WHLSL::checkRecursiveTypes):
1856
1857 2019-07-17  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
1858
1859         Add missing #include's
1860         https://bugs.webkit.org/show_bug.cgi?id=199856
1861
1862         Reviewed by Simon Fraser.
1863
1864         The missing headers were found during development when unified sources changed.
1865
1866         No new tests required. Adding #include's only.
1867
1868         * Modules/speech/DOMWindowSpeechSynthesis.cpp:
1869         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp:
1870         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
1871         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
1872         * Modules/webgpu/WebGPUCommandEncoder.cpp:
1873
1874 2019-07-17  Ryosuke Niwa  <rniwa@webkit.org>
1875
1876         Add inputmode to the feature status page
1877         https://bugs.webkit.org/show_bug.cgi?id=199884
1878
1879         Reviewed by Wenson Hsieh.
1880
1881         Added as supported.
1882
1883         * features.json:
1884
1885 2019-07-17  Antoine Quint  <graouts@apple.com>
1886
1887         Disable Pointer Events prior to watchOS 6
1888         https://bugs.webkit.org/show_bug.cgi?id=199890
1889         <rdar://problem/53206113>
1890
1891         Reviewed by Dean Jackson.
1892
1893         * Configurations/FeatureDefines.xcconfig:
1894
1895 2019-07-17  Antoine Quint  <graouts@apple.com>
1896
1897         Unable to bring up custom media controls on iOS for video.sina.cn
1898         https://bugs.webkit.org/show_bug.cgi?id=199889
1899         <rdar://problem/51883919>
1900
1901         Reviewed by Dean Jackson.
1902
1903         Videos on video.sina.cn by default have the "controls" attribute and are set not to autoplay. This means that the original state
1904         of the media controls are set to show the built-in media controls and also show the prominent play button to begin playback. The
1905         display of the play button also requires a tap gesture recognizer, which calls preventDefault() when the "touchend" is received
1906         to prevent double-tap-to-zoom, but also has the side-effect of preventing a "click" event from being dispatched for a tap.
1907
1908         The video.sina.cn code would eventually remove the "controls" attribute, which would make the built-in media controls not visible,
1909         but still participate in hit-testing because we keep the shadow DOM around in order to potentially show the Airplay or picture-in-picture
1910         placards. Additionally, we wouldn't disable the tap gesture recognizer when the "controls" attribute was removed.
1911
1912         We now ensure that both gesture recognizers used by iOS inline media controls are only enabled when media controls are visible.
1913
1914         Test: media/modern-media-controls/media-controller/ios/media-controller-allows-click-over-video-with-no-controls.html
1915
1916         * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
1917         (IOSInlineMediaControls.prototype.set showsStartButton):
1918         (IOSInlineMediaControls.prototype.get visible):
1919         (IOSInlineMediaControls.prototype.set visible):
1920         (IOSInlineMediaControls.prototype._updateGestureRecognizers):
1921         (IOSInlineMediaControls.prototype._tapGestureRecognizerStateDidChange):
1922         (IOSInlineMediaControls.prototype._pinchGestureRecognizerStateDidChange):
1923
1924 2019-07-17  Christopher Reid  <chris.reid@sony.com>
1925
1926         Bytecode cache should use FileSystem
1927         https://bugs.webkit.org/show_bug.cgi?id=199759
1928
1929         Reviewed by Yusuke Suzuki.
1930
1931         * platform/SharedBuffer.cpp:
1932
1933 2019-07-17  Zalan Bujtas  <zalan@apple.com>
1934
1935         Unable to tap buttons at top of Wells Fargo app’s Payees screen
1936         https://bugs.webkit.org/show_bug.cgi?id=199846
1937         <rdar://problem/48112220>
1938
1939         Reviewed by Simon Fraser.
1940
1941         This patch restores the stop-before-reaching-the-body heuristics for the approximate node finding feature only.
1942         (WebFrame::approximateNodeAtViewportLocation mistakenly relied on this odd quirk of nodeRespondingToClickEvents.)
1943
1944         * page/Frame.h:
1945         * page/ios/FrameIOS.mm:
1946         (WebCore::Frame::approximateNodeAtViewportLocationLegacy):
1947
1948 2019-07-17  Simon Fraser  <simon.fraser@apple.com>
1949
1950         [iOS WK2] Avoid lots of compositing backing store for offscreen position:fixed descendants
1951         https://bugs.webkit.org/show_bug.cgi?id=199819
1952         rdar://problem/51977416
1953
1954         Reviewed by Zalan Bujtas.
1955
1956         There was code to ensure that position:fixed layers and their descendants don't have their
1957         backing store detached (thrown away to save memory when offscreen), since that can trigger
1958         flashing when async scrolling moves layers in and out of the visual viewport.
1959
1960         However, some pages have many descendant layers of positon:fixed which entrain backing
1961         store, because, for example, they have a stack of translated-offscreen menu elements inside
1962         a fixed header, and those elements may composite because of overflow:scroll.
1963
1964         To avoid using too much memory on such pages, allow backing store detachment for fixed
1965         layers that are outside the layout viewport. Add a flag to RenderLayer that's set for layers
1966         which are fixed, or descendants of fixed, and consult that flag in
1967         updateAllowsBackingStoreDetaching(). The logic there is similar to
1968         RenderLayerCompositor::requiresCompositingForPosition().
1969         
1970         I considered allowing all position:fixed to composite (since this patch would keep most of
1971         the memory saving), but historically we've avoided compositing out-of-viewport
1972         position:fixed because it's quite common to have them with negative z-index, and compositing
1973         those has significant compositing knock-on effects.
1974         
1975         GraphicsLayer flushing no longer needs to track the viewport-constrained status of layers,
1976         so remove that code.
1977         
1978         This patch removes backing-store pinning for sticky layers.
1979         scrolling/ios/reconcile-layer-position-recursive.html then revealed a bug in
1980         ScrollingStateStickyNode::reconcileLayerPositionForViewportRect(), which was assuming that
1981         the sticky element was scrolled by the page, causing a bad layer position to get sync'd onto
1982         the layer. Fixed by copying code from ScrollingTreeStickyNode that is smarter about
1983         computing layer positions.
1984         
1985         This patch fixes jetsams on kmart.com.au in iOS 13 beta.
1986
1987         Test: compositing/layer-creation/fixed-position-descendants-out-of-view.html
1988
1989         * page/scrolling/ScrollingStateStickyNode.cpp:
1990         (WebCore::ScrollingStateStickyNode::computeLayerPosition const):
1991         (WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect):
1992         * page/scrolling/ScrollingStateStickyNode.h:
1993         * platform/graphics/GraphicsLayer.h:
1994         (WebCore::GraphicsLayer::setAllowsBackingStoreDetaching):
1995         (WebCore::GraphicsLayer::allowsBackingStoreDetaching const):
1996         (WebCore::GraphicsLayer::setIsViewportConstrained): Deleted.
1997         (WebCore::GraphicsLayer::isViewportConstrained const): Deleted.
1998         (WebCore::GraphicsLayer::setCanDetachBackingStore): Deleted.
1999         (WebCore::GraphicsLayer::canDetachBackingStore const): Deleted.
2000         * platform/graphics/ca/GraphicsLayerCA.cpp:
2001         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
2002         (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
2003         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
2004         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2005         (WebCore::GraphicsLayerCA::updateCoverage):
2006         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2007         * platform/graphics/ca/GraphicsLayerCA.h:
2008         * rendering/RenderLayer.cpp:
2009         (WebCore::RenderLayer::RenderLayer):
2010         (WebCore::RenderLayer::updateLayerPositions):
2011         (WebCore::outputPaintOrderTreeLegend):
2012         (WebCore::outputPaintOrderTreeRecursive):
2013         * rendering/RenderLayer.h:
2014         * rendering/RenderLayerBacking.cpp:
2015         (WebCore::RenderLayerBacking::updateAllowsBackingStoreDetaching):
2016         (WebCore::RenderLayerBacking::updateOverflowControlsLayers):
2017         (WebCore::RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole): Deleted.
2018         * rendering/RenderLayerBacking.h:
2019         * rendering/RenderLayerCompositor.cpp:
2020         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2021         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
2022         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
2023         (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
2024
2025 2019-07-17  Chris Dumez  <cdumez@apple.com>
2026
2027         Avoid unnecessary copy of monitors under DisplayRefreshMonitorManager::displayWasUpdated()
2028         https://bugs.webkit.org/show_bug.cgi?id=199847
2029
2030         Reviewed by Said Abou-Hallawa.
2031
2032         There is always one one monitor in m_monitors for a given displayID so there is
2033         no need to copy the monitors inside DisplayRefreshMonitorManager::displayWasUpdated()
2034         and no need to iterate over all of them. This patch also factors a bit differently
2035         so that it becomes more obvious.
2036
2037         * platform/graphics/DisplayRefreshMonitorManager.cpp:
2038         (WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
2039         (WebCore::DisplayRefreshMonitorManager::unregisterClient):
2040         (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
2041         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
2042         (WebCore::DisplayRefreshMonitorManager::findMonitorForDisplay const):
2043         (WebCore::DisplayRefreshMonitorManager::monitorForDisplay const):
2044         * platform/graphics/DisplayRefreshMonitorManager.h:
2045
2046 2019-07-17  Sihui Liu  <sihui_liu@apple.com>
2047
2048         IndexedDB: error in starting version change transaction may be neglected
2049         https://bugs.webkit.org/show_bug.cgi?id=199818
2050         <rdar://problem/52925738>
2051
2052         Reviewed by Brady Eidson.
2053
2054         For version change transaction, IDBServer didn't wait the result of beginTransaction on the background thread 
2055         before giving the IDBClient the result of open request. In this case, beginTransaction may fail to update the 
2056         DatabaseVersion in database file or set m_originalDatabaseInfoBeforeVersionChange, but the transaction was
2057         marked as started. When we later set m_databaseInfo with m_originalDatabaseInfoBeforeVersionChange, 
2058         m_databaseInfo could become nullptr.
2059
2060         To write a test for this, we will need to simulate an SQLite error. I manually tested this by crafting the 
2061         SQLiteStatement in beginTransaction, making it an invalid statement, and verified that error event, instead of 
2062         ungradeneeded event is dispatched to the IDBRequest.
2063
2064         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2065         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
2066         (WebCore::IDBServer::UniqueIDBDatabase::performStartVersionChangeTransaction):
2067         (WebCore::IDBServer::UniqueIDBDatabase::didPerformStartVersionChangeTransaction):
2068         (WebCore::IDBServer::UniqueIDBDatabase::beginTransactionInBackingStore): Deleted.
2069         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2070
2071 2019-07-17  Daniel Bates  <dabates@apple.com>
2072
2073         Typing into a cell in a Google Sheet lags behind by one character
2074         https://bugs.webkit.org/show_bug.cgi?id=199587
2075         <rdar://problem/51616845>
2076
2077         Reviewed by Brent Fulgham.
2078
2079         Add a Google Sheets quirk. Put all DOM timers scheduled from keydown and keypress event listeners
2080         into a holding tank. The timers continue to tick, but are barred from executing their action until
2081         the next text insertion or deletion or 32 ms (on device) have elapsed, whichever is sooner. We only
2082         allocate a holding tank once per document, only if the quirk is active, and this allocation is done
2083         when the document schedules a timer on keydown or keypress. The holding tank lives for the lifetime
2084         of the document.
2085
2086         The story behind the quirk:
2087
2088         On keypress Google Sheets schedules timers and expects that a DOM update will occur (i.e. text
2089         will be inserted or deleted) within the same event loop iteration as the dispatched keypress. The
2090         UI Events spec. [1] makes no such guarantee of when a DOM update must occur in relation to the keypress
2091         event. It could happen in the same event loop iteration as the key press (as Google expects), the
2092         next iteration, 500ms later, 2 minutes later, etc. What the spec does guarantee is that by the time
2093         a DOM input event is dispatched that the DOM will be updated. And this is the solution to the problem
2094         Google Sheets is trying to solve, but is doing so using pre-IE 9 technology (though similar
2095         functionality was available via onpropertychange in IE < 9).
2096
2097         See also <https://github.com/w3c/uievents/issues/238>, which is tracking a spec. text update for
2098         this quirk.
2099
2100         Test: fast/events/ios/dom-update-on-keydown-quirk.html
2101
2102         [1] <https://w3c.github.io/uievents/> (Editor's Draft, 14 October 2018)
2103
2104         * SourcesCocoa.txt:
2105         * WebCore.xcodeproj/project.pbxproj:
2106         Add some files to the project.
2107
2108         * dom/Document.cpp:
2109         (WebCore::Document::domTimerHoldingTank): Added.
2110         * dom/Document.h:
2111         (WebCore::Document::domTimerHoldingTankIfExists): Added.
2112
2113         * page/DOMTimer.cpp:
2114         (WebCore::DOMTimer::install): Put the newly instantiated timer into the holding tank.
2115         (WebCore::DOMTimer::removeById): Remove the timer from the holding tank.
2116         (WebCore::DOMTimer::fired): Check if the timer is in the holding tank. If it is and it is a one-
2117         shot timer then schedule it for the next event loop iteration. If it's a repeating timer just
2118         let it continue ticking. Otherwise, do what we no now and execute the timer's action. The reason
2119         we do not suspend timers in the holding tank is because:
2120             1. Far out timers (Google Sheets registers timers as far out as 5 minutes!) are not penalized.
2121             Though smart supension logic could avoid this. See (3).
2122
2123             2. Empirical observations indicate that the keyboard will perform the insertion or deletion
2124             reasonably quickly (not the same event loop iteration as the keydown, but within two iterations out).
2125             So, the timers in the holding tank are short-lived.
2126
2127             3. Simplifies the code. There is no need to keep additional bookkeeping to track multiple timer
2128             suspension reasons (timers currently can only have one suspension reason) or alternatively defer
2129             scheduling a timer until a later time and computing a new "fair" firing time when scheduled.
2130         * page/EventHandler.cpp:
2131         (WebCore::EventHandler::internalKeyEvent): Place a token on the stack to put all DOM timers
2132         scheduled on keydown and keypress into the holding tank if the quirk is enabled.
2133         * page/Quirks.cpp:
2134         (WebCore::Quirks::needsDeferKeyDownAndKeyPressTimersUntilNextEditingCommand const): Added.
2135         * page/Quirks.h:
2136         * page/Settings.yaml: Added setting so that this quirk can be enabled from a layout test. This setting
2137         also lets us enable the quirk for all sites or for certain third-party apps if desired.
2138         * page/ios/DOMTimerHoldingTank.cpp: Added.
2139         (WebCore::DOMTimerHoldingTank::DOMTimerHoldingTank):
2140         (WebCore::DOMTimerHoldingTank::add):
2141         (WebCore::DOMTimerHoldingTank::remove):
2142         (WebCore::DOMTimerHoldingTank::contains):
2143         (WebCore::DOMTimerHoldingTank::removeAll):
2144         (WebCore::DOMTimerHoldingTank::stopExceededMaximumHoldTimer):
2145         * page/ios/DOMTimerHoldingTank.h: Added.
2146         (WebCore::DeferDOMTimersForScope::DeferDOMTimersForScope):
2147         (WebCore::DeferDOMTimersForScope::~DeferDOMTimersForScope):
2148         (WebCore::DeferDOMTimersForScope::isDeferring):
2149
2150 2019-07-17  Darin Adler  <darin@apple.com>
2151
2152         No need for isURLAllowed function in Frame
2153         https://bugs.webkit.org/show_bug.cgi?id=120266
2154
2155         Reviewed by Alex Christensen.
2156
2157         * css/SelectorCheckerTestFunctions.h:
2158         (WebCore::matchesFullScreenPseudoClass): Use is<> instead of
2159         the isFrameElementBase function. Also updated includes and spacing.
2160
2161         * dom/Document.cpp:
2162         (WebCore::Document::resolveStyle): Shortened an old, long comment
2163         that happened to mention HTMLFrameElementBase::isURLAllowed by name.
2164
2165         * dom/Element.h: Deleted isFrameElementBase.
2166
2167         * html/HTMLAppletElement.cpp:
2168         (WebCore::HTMLAppletElement::updateWidget): Tweaked comment.
2169
2170         * html/HTMLBodyElement.cpp:
2171         (WebCore::HTMLBodyElement::insertedIntoAncestor): Moved comment from
2172         here to didFinishInsertingNode, since the code it's talking about is there.
2173         Also got rid of unnecessary local variable.
2174         (WebCore::HTMLBodyElement::didFinishInsertingNode): Moved comment here
2175         and elaborated a bit. Also changed the code to copy margin attributes in a
2176         simpler way without requiring special getter functions. There is a slight
2177         behavior change here, but seems unlikely to affect any websites or tests.
2178         Would be good to add better test coverage, which I think should be done
2179         when fixing the problems described in the FIXME.
2180
2181         * html/HTMLEmbedElement.cpp:
2182         (WebCore::HTMLEmbedElement::updateWidget): allowedToLoadFrameURL -> canLoadURL
2183         Also Tweaked comments.
2184
2185         * html/HTMLFrameElement.cpp:
2186         (WebCore::HTMLFrameElement::rendererIsNeeded): isURLAllowed -> canLoad
2187
2188         * html/HTMLFrameElementBase.cpp:
2189         (WebCore::HTMLFrameElementBase::HTMLFrameElementBase): Removed initial
2190         values for no-longer-needed data members.
2191
2192         (WebCore::HTMLFrameElementBase::canLoadScriptURL const): Renamed from
2193         isURLAllowed. Also refactored so it now calls canLoadURL.
2194         (WebCore::HTMLFrameElementBase::canLoad const): Renamed from isURLAllowed.
2195         Also added FIXME comments about multiple ways that this code incorrectly
2196         handles the empty string. Might inspire some tests and future fixes.
2197         (WebCore::HTMLFrameElementBase::canLoadURL const): Renamed from isURLAllowed.
2198         Added an overload that takes a relative URL string largely to make this
2199         more parallel with the similar code in HTMLPlugInImageElement. Refactored
2200         to call canAddSubframe and isProhibitedSelfReference, removing the need
2201         to call Frame::isURLAllowed.
2202         (WebCore::HTMLFrameElementBase::openURL): isURLAllowed -> canLoad
2203         (WebCore::HTMLFrameElementBase::parseAttribute): Removed unneeded code
2204         to parse marginwidth, marginheight, and scrolling, which are now done
2205         as needed instead. Might have to add code back if we ever add code to
2206         make these cause dynamic updates when changed, but that was not the
2207         behavior of the existing code.
2208         (WebCore::HTMLFrameElementBase::scrollingMode const): Changed to call
2209         attributeWithoutSynchronization rather than reading from a data member.
2210
2211         * html/HTMLFrameElementBase.h: Moved scrollingMode into the .cpp file.
2212         Removed marginWidth and marginHeight since they are no longer called.
2213         Made canContainRangeEndPoint override be private. Renamed isURLAllowed
2214         to canLoad/canLoadScriptURL/canLoadURL. Removed unneeded isFrameElementBase
2215         since is<HTMLFrameElementBase> already works without it. Removed unneeded
2216         data members m_scrolling, m_marginWidth, and m_marginHeight.
2217
2218         * html/HTMLFrameOwnerElement.cpp:
2219         (WebCore::HTMLFrameOwnerElement::HTMLFrameOwnerElement): Moved initialization
2220         of m_contentFrame and m_sandboxFlags to the header.
2221         (WebCore::HTMLFrameOwnerElement::clearContentFrame): 0 -> nullptr
2222         (WebCore::HTMLFrameOwnerElement::canAddSubframe const): Added. Code was moved
2223         here from multiple functions that enforced the subframe count limit.
2224         (WebCore::HTMLFrameOwnerElement::isProhibitedSelfReference const): Added.
2225         Moved code here from Frame::isURLAllowed so it's easy to use as needed.
2226
2227         * html/HTMLFrameOwnerElement.h: Renamed isURLAllowed to canLoadScriptURL.
2228         Added protected canAddSubframe and isProhibitedSelfReference functions.
2229         Initialized the data members here.
2230
2231         * html/HTMLIFrameElement.cpp:
2232         (WebCore::HTMLIFrameElement::sandbox): Added braces for multi-line if statement.
2233         (WebCore::HTMLIFrameElement::parseAttribute): Removed unneeded storage of the
2234         allow attribute value. Added missing code to invalidate m_featurePolicy when
2235         the allow attribute changes. This could change behavior, but unlikely to affect
2236         any websites of tests. Would be good to add a test for this.
2237         (WebCore::HTMLIFrameElement::rendererIsNeeded): isURLAllowed -> canLoad. Also
2238         reordered the code to be more efficient for display: none (why not?).
2239         (WebCore::HTMLIFrameElement::featurePolicy const): Use attributeWithoutSynchronization
2240         to read the allow attribute rather than using a data member.
2241
2242         * html/HTMLIFrameElement.h: Removed the unneeded allow function member and
2243         m_allow data member since DOM reflection takes care of the function and the
2244         featurePolicy function can get the attribute without a data member.
2245
2246         * html/HTMLObjectElement.cpp:
2247         (WebCore::HTMLObjectElement::updateWidget): allowedToLoadFrameURL -> canLoadURL
2248         Also tweaked comments.
2249
2250         * html/HTMLPlugInElement.cpp:
2251         (WebCore::HTMLPlugInElement::canLoadScriptURL const): Added. Code moved here
2252         from HTMLFrameOwnerElement::isURLAllowed. Added comment about why this is not
2253         necessarily correct and might need improvement.
2254
2255         * html/HTMLPlugInElement.h: Added private override of canLoadScriptURL.
2256
2257         * html/HTMLPlugInImageElement.cpp:
2258         (WebCore::HTMLPlugInImageElement::canLoadURL const): Renamed from
2259         allowedToLoadFrameURL and refactored into two functions to match the
2260         structure of the similar function in HTMLFrameElementBase. Also refactored
2261         to use canAddSubframe and isProhibitedSelfReference rather than Frame::isURLAllowed.
2262         (WebCore::HTMLPlugInImageElement::canLoadPlugInContent const): Renamed from
2263         allowedToLoadPluginContent.
2264         (WebCore::HTMLPlugInImageElement::requestObject): allowedToLoadPluginContent
2265         -> canLoadPlugInContent
2266
2267         * html/HTMLPlugInImageElement.h: Renamed functions as mentioned above.
2268
2269         * loader/SubframeLoader.cpp:
2270         (WebCore::SubframeLoader::requestFrame): isURLAllowed -> canLoadScriptURL
2271
2272         * page/FocusController.h: Removed unneeded forward declaration of HTMLFrameOwnerElement.
2273
2274         * page/Frame.cpp:
2275         (WebCore::Frame::isURLAllowed const): Deleted.
2276         * page/Frame.h: Ditto.
2277
2278         * page/FrameView.cpp:
2279         (WebCore::FrameView::init): Removed code to initialize m_margins, since nothing
2280         was looking at it after that.
2281         (WebCore::FrameView::setMarginWidth): Deleted.
2282         (WebCore::FrameView::setMarginHeight): Deleted.
2283
2284         * page/FrameView.h: Removed marginWidth, marginHeight, setMarginWidth,
2285         setMarginHeight, and m_margins because there was no code anywhere calling
2286         marginWidth or marginHeight, and no other side effects of these functions.
2287
2288 2019-07-17  Alex Christensen  <achristensen@webkit.org>
2289
2290         Add a runtime-disabled dialog element skeleton
2291         https://bugs.webkit.org/show_bug.cgi?id=199839
2292
2293         Reviewed by Ryosuke Niwa.
2294
2295         Beginning implementation of https://html.spec.whatwg.org/multipage/interactive-elements.html#the-dialog-element
2296         Covered by rebaselining WPT tests.
2297
2298         * CMakeLists.txt:
2299         * DerivedSources-input.xcfilelist:
2300         * DerivedSources-output.xcfilelist:
2301         * DerivedSources.make:
2302         * Sources.txt:
2303         * WebCore.xcodeproj/project.pbxproj:
2304         * bindings/js/WebCoreBuiltinNames.h:
2305         * html/HTMLDialogElement.cpp: Added.
2306         (WebCore::HTMLDialogElement::HTMLDialogElement):
2307         (WebCore::HTMLDialogElement::open):
2308         (WebCore::HTMLDialogElement::setOpen):
2309         (WebCore::HTMLDialogElement::returnValue):
2310         (WebCore::HTMLDialogElement::setReturnValue):
2311         (WebCore::HTMLDialogElement::show):
2312         (WebCore::HTMLDialogElement::showModal):
2313         (WebCore::HTMLDialogElement::close):
2314         * html/HTMLDialogElement.h: Added.
2315         * html/HTMLDialogElement.idl: Added.
2316         * html/HTMLTagNames.in:
2317         * page/RuntimeEnabledFeatures.h:
2318         (WebCore::RuntimeEnabledFeatures::setDialogElementEnabled):
2319         (WebCore::RuntimeEnabledFeatures::dialogElementEnabled const):
2320
2321 2019-07-17  Youenn Fablet  <youenn@apple.com>
2322
2323         Hop to the main thread when doing logging in RealtimeIncomingVideoSourceCocoa
2324         https://bugs.webkit.org/show_bug.cgi?id=199865
2325
2326         Reviewed by Darin Adler.
2327
2328         LoggerHelper routines allow logging messages in system console and inspector console.
2329         These routines iterate through a Vector of log observers which is not thread safe.
2330         Document, the main log observer, also expects to be called on the main thread.
2331         Manually tested (writing a layout test for this would require more than 2 seconds).
2332
2333         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
2334         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
2335
2336 2019-07-17  Commit Queue  <commit-queue@webkit.org>
2337
2338         Unreviewed, rolling out r247505.
2339         https://bugs.webkit.org/show_bug.cgi?id=199871
2340
2341         "Caused failed ASSERT in stress test" (Requested by creid on
2342         #webkit).
2343
2344         Reverted changeset:
2345
2346         "Bytecode cache should use FileSystem"
2347         https://bugs.webkit.org/show_bug.cgi?id=199759
2348         https://trac.webkit.org/changeset/247505
2349
2350 2019-07-17  Youenn Fablet  <youenn@apple.com>
2351
2352         Add release logging to AudioSampleDataSource
2353         https://bugs.webkit.org/show_bug.cgi?id=199814
2354         <rdar://problem/53128140>
2355
2356         Reviewed by Eric Carlson.
2357
2358         Use release logging for AudioSampleDataSource in case of errors.
2359         This requires passing a logger and a logger identifier.
2360         For that purpose, pass a MediaStreamTrackPrivate to it constructor
2361         and reuse its logger and log identifier.
2362
2363         For each log, hop to the main thread as release logging requires to be done in the main thread.
2364         Add specific handling for RealtimeOutgoingAudioSource as its MediaStreamTrack can change in case of replaceTrack.
2365         In that case, we change of logger when changing the MediaStreamTrackPrivate.
2366
2367         No observable change of behavior, covered by existing tests.
2368
2369         * platform/audio/mac/AudioSampleDataSource.h:
2370         * platform/audio/mac/AudioSampleDataSource.mm:
2371         (WebCore::AudioSampleDataSource::create):
2372         (WebCore::AudioSampleDataSource::AudioSampleDataSource):
2373         (WebCore::AudioSampleDataSource::setupConverter):
2374         (WebCore::AudioSampleDataSource::pushSamplesInternal):
2375         (WebCore::AudioSampleDataSource::pullSamplesInternal):
2376         (WebCore::AudioSampleDataSource::setLogger):
2377         (WebCore::AudioSampleDataSource::logChannel const):
2378         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
2379         (WebCore::RealtimeOutgoingAudioSource::setSource):
2380         * platform/mediastream/RealtimeOutgoingAudioSource.h:
2381         (WebCore::RealtimeOutgoingAudioSource::sourceUpdated):
2382         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
2383         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
2384         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
2385         Instead of using its own logger/identifier member field, reuse its MediaStreamTrackPrivate.
2386         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
2387         (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
2388         (WebCore::RealtimeOutgoingAudioSourceCocoa::sourceUpdated):
2389         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
2390         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
2391         (WebCore::WebAudioSourceProviderAVFObjC::prepare):
2392
2393 2019-07-17  Kenneth Russell  <kbr@chromium.org>
2394
2395         Make ANGLE work inside WebKit2's sandbox
2396         https://bugs.webkit.org/show_bug.cgi?id=199844
2397
2398         Reviewed by Alex Christensen.
2399
2400         Fix missing #import introduced at the last minute while removing
2401         some debugging code in the last patch.
2402
2403         Tested with San Angeles WebGL demo and some conformance tests.
2404
2405         * platform/graphics/cocoa/WebGLLayer.mm:
2406
2407 2019-07-17  Andres Gonzalez  <andresg_22@apple.com>
2408
2409         Hang in WebCore::AccessibilityRenderObject::visiblePositionRangeForLine.
2410         https://bugs.webkit.org/show_bug.cgi?id=199845
2411         <rdar://problem/53121017>
2412
2413         Reviewed by Chris Fleizach.
2414
2415         - Added check for upper bound NSNotFound for parameter to visiblePositionRangeForLine.
2416         - Fixed signed/unsigned issue for AXTextMarkerRangeForLine attribute.
2417
2418         * accessibility/AccessibilityRenderObject.cpp:
2419         (WebCore::AccessibilityRenderObject::visiblePositionRangeForLine const):
2420         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2421         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
2422
2423 2019-07-17  Rob Buis  <rbuis@igalia.com>
2424
2425         Add referrerpolicy attribute support for <script> elements
2426         https://bugs.webkit.org/show_bug.cgi?id=185550
2427
2428         Reviewed by Youenn Fablet.
2429
2430         This patch adds 'referrerpolicy' attribute support for script elements.
2431         If set, the value is restricted to the ReferrerPolicy enum, and
2432         if valid it is used for the script fetch.
2433         If not set or invalid, the current behavior is kept.
2434
2435         Tests: http/tests/referrer-policy-script/no-referrer-when-downgrade/cross-origin-http-http.html
2436                http/tests/referrer-policy-script/no-referrer-when-downgrade/cross-origin-http.https.html
2437                http/tests/referrer-policy-script/no-referrer-when-downgrade/same-origin.html
2438                http/tests/referrer-policy-script/no-referrer/cross-origin-http-http.html
2439                http/tests/referrer-policy-script/no-referrer/cross-origin-http.https.html
2440                http/tests/referrer-policy-script/no-referrer/same-origin.html
2441                http/tests/referrer-policy-script/origin-when-cross-origin/cross-origin-http-http.html
2442                http/tests/referrer-policy-script/origin-when-cross-origin/cross-origin-http.https.html
2443                http/tests/referrer-policy-script/origin-when-cross-origin/same-origin.html
2444                http/tests/referrer-policy-script/origin/cross-origin-http-http.html
2445                http/tests/referrer-policy-script/origin/cross-origin-http.https.html
2446                http/tests/referrer-policy-script/origin/same-origin.html
2447                http/tests/referrer-policy-script/same-origin/cross-origin-http-http.html
2448                http/tests/referrer-policy-script/same-origin/cross-origin-http.https.html
2449                http/tests/referrer-policy-script/same-origin/same-origin.html
2450                http/tests/referrer-policy-script/strict-origin-when-cross-origin/cross-origin-http-http.html
2451                http/tests/referrer-policy-script/strict-origin-when-cross-origin/cross-origin-http.https.html
2452                http/tests/referrer-policy-script/strict-origin-when-cross-origin/same-origin.html
2453                http/tests/referrer-policy-script/strict-origin/cross-origin-http-http.html
2454                http/tests/referrer-policy-script/strict-origin/cross-origin-http.https.html
2455                http/tests/referrer-policy-script/strict-origin/same-origin.html
2456                http/tests/referrer-policy-script/unsafe-url/cross-origin-http-http.html
2457                http/tests/referrer-policy-script/unsafe-url/cross-origin-http.https.html
2458                http/tests/referrer-policy-script/unsafe-url/same-origin.html
2459
2460         * bindings/js/CachedScriptFetcher.cpp:
2461         (WebCore::CachedScriptFetcher::requestScriptWithCache const):
2462         * bindings/js/CachedScriptFetcher.h:
2463         (WebCore::CachedScriptFetcher::CachedScriptFetcher):
2464         * dom/InlineClassicScript.h:
2465         * dom/LoadableClassicScript.cpp:
2466         (WebCore::LoadableClassicScript::create):
2467         * dom/LoadableClassicScript.h:
2468         * dom/LoadableModuleScript.cpp:
2469         (WebCore::LoadableModuleScript::create):
2470         (WebCore::LoadableModuleScript::LoadableModuleScript):
2471         * dom/LoadableModuleScript.h:
2472         * dom/LoadableScript.h:
2473         (WebCore::LoadableScript::LoadableScript):
2474         * dom/ScriptElement.cpp:
2475         (WebCore::ScriptElement::requestClassicScript):
2476         (WebCore::ScriptElement::requestModuleScript):
2477         * dom/ScriptElement.h:
2478         * dom/ScriptElementCachedScriptFetcher.h:
2479         (WebCore::ScriptElementCachedScriptFetcher::ScriptElementCachedScriptFetcher):
2480         * html/HTMLIFrameElement.cpp:
2481         (WebCore::HTMLIFrameElement::referrerPolicyForBindings const):
2482         * html/HTMLScriptElement.cpp:
2483         (WebCore::HTMLScriptElement::setReferrerPolicyForBindings):
2484         (WebCore::HTMLScriptElement::referrerPolicyForBindings const):
2485         (WebCore::HTMLScriptElement::referrerPolicy const):
2486         * html/HTMLScriptElement.h:
2487         * html/HTMLScriptElement.idl:
2488         * html/parser/CSSPreloadScanner.cpp:
2489         (WebCore::CSSPreloadScanner::emitRule):
2490         * html/parser/HTMLPreloadScanner.cpp:
2491         (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest):
2492         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
2493         * html/parser/HTMLResourcePreloader.cpp:
2494         (WebCore::PreloadRequest::resourceRequest):
2495         * html/parser/HTMLResourcePreloader.h:
2496         (WebCore::PreloadRequest::PreloadRequest):
2497         * platform/ReferrerPolicy.cpp:
2498         (WebCore::referrerPolicyToString):
2499         * platform/ReferrerPolicy.h:
2500         * svg/SVGScriptElement.h:
2501
2502 2019-07-16  Christopher Reid  <chris.reid@sony.com>
2503
2504         Bytecode cache should use FileSystem
2505         https://bugs.webkit.org/show_bug.cgi?id=199759
2506
2507         Reviewed by Yusuke Suzuki.
2508
2509         * platform/SharedBuffer.cpp:
2510
2511 2019-07-16  Simon Fraser  <simon.fraser@apple.com>
2512
2513         Fix includes and make a constructor explicit to avoid unified-sources-triggered test failures
2514         https://bugs.webkit.org/show_bug.cgi?id=199849
2515
2516         Reviewed by Wenson Hsieh.
2517         
2518         webkit.org/b/199587 triggered some unexpected test failures because of unified sources include
2519         order. The TextStream operator in ScrollingTreeOverflowScrollingNode::dumpProperties() was invoking
2520         the implicit constructor of TransformOperations.
2521
2522         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp: Include TextStream.h
2523         * platform/graphics/transforms/TransformOperations.h: Make ctor explicit.
2524
2525 2019-07-16  Antoine Quint  <graouts@apple.com>
2526
2527         REGRESSION: fast/events/watchos/double-tap-to-zoom* tests crashing in com.apple.WebKit: -[WKContentView(WKInteraction) _singleTapDidReset:]
2528         https://bugs.webkit.org/show_bug.cgi?id=199840
2529         <rdar://problem/52856531>
2530
2531         Reviewed by Wenson Hsieh.
2532
2533         Fix a build error that occured when building for the watchOS Simulator in the debug configuration.
2534
2535         * rendering/RenderLayerCompositor.cpp:
2536         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingProxyRole):
2537
2538 2019-07-16  Justin Fan  <justin_fan@apple.com>
2539
2540         [WebGPU] Convert GPUComputePipeline LOG statements to generate GPUErrors
2541         https://bugs.webkit.org/show_bug.cgi?id=199773
2542
2543         Reviewed by Myles C. Maxfield.
2544
2545         Generate a GPUError if GPUComputePipeline creation fails.
2546         Rework the WHLSL test harness to take advantage of this.
2547
2548         Test: webgpu/compute-pipeline-errors.html
2549
2550         * Modules/webgpu/WebGPUComputePipelineDescriptor.cpp:
2551         (WebCore::WebGPUComputePipelineDescriptor::tryCreateGPUComputePipelineDescriptor const):
2552         * Modules/webgpu/WebGPUComputePipelineDescriptor.h:
2553         * Modules/webgpu/WebGPUDevice.cpp:
2554         (WebCore::WebGPUDevice::createComputePipeline const):
2555         * platform/graphics/gpu/GPUBuffer.h:
2556         * platform/graphics/gpu/GPUComputePipeline.h: 
2557                 Now inherits from GPUObjectBase, though this isn't super useful yet
2558                 since GPUComputePipeline itself does not expose any operations that can error. 
2559         * platform/graphics/gpu/GPUDevice.cpp:
2560         (WebCore::GPUDevice::tryCreateComputePipeline const):
2561         * platform/graphics/gpu/GPUDevice.h:
2562         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2563         (WebCore::GPUBuffer::validateBufferUsage):
2564         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
2565         (WebCore::trySetMetalFunctions):
2566         (WebCore::trySetFunctions):
2567         (WebCore::convertComputePipelineDescriptor):
2568         (WebCore::tryCreateMTLComputePipelineState):
2569         (WebCore::GPUComputePipeline::tryCreate):
2570         (WebCore::GPUComputePipeline::GPUComputePipeline):
2571
2572 2019-07-11  Justin Fan  <justin_fan@apple.com>
2573
2574         [WebGPU] Move error scopes out of GPUDevice for more portable error generation
2575         https://bugs.webkit.org/show_bug.cgi?id=199740
2576
2577         Reviewed by Myles C. Maxfield.
2578
2579         Move error generation into a separate RefCounted class to allow GPU objects to generate 
2580         errors independent of any GPUDevice.
2581         Create GPUObjectBase to delegate error generation and refactor GPUBuffer to inherit from GPUObjectBase.
2582
2583         No behavior change or new tests. Error scopes covered by error-scopes-test.html.
2584
2585         * Modules/webgpu/WebGPUDevice.cpp:
2586         (WebCore::WebGPUDevice::WebGPUDevice): Now creates a GPUErrorGenerator.
2587         (WebCore::WebGPUDevice::createBuffer const): Pass the GPUErrorGenerator to any created GPUBuffer.
2588         (WebCore::WebGPUDevice::createBufferMapped const): Ditto.
2589         (WebCore::WebGPUDevice::popErrorScope): Shouldn't be const. Can just ask for the GPUError rather than passing a lambda.
2590         (WebCore::WebGPUDevice::pushErrorScope const): Deleted.
2591         (WebCore::WebGPUDevice::popErrorScope const): Deleted.
2592         * Modules/webgpu/WebGPUDevice.h:
2593         (WebCore::WebGPUDevice::pushErrorScope):
2594         * Sources.txt:
2595         * WebCore.xcodeproj/project.pbxproj:
2596         * platform/graphics/gpu/GPUBuffer.h: Now inherits from GPUObjectBase for error generation ease.
2597         * platform/graphics/gpu/GPUDevice.cpp:
2598         (WebCore::GPUDevice::tryCreateBuffer): Ensure GPUBuffers reference the GPUErrorGenerator.
2599         (WebCore::GPUDevice::pushErrorScope): Deleted. No longer needed here.
2600         (WebCore::GPUDevice::popErrorScope): Deleted.
2601         (WebCore::GPUDevice::registerError): Deleted.
2602         * platform/graphics/gpu/GPUDevice.h: Move error scope logic out.
2603         * platform/graphics/gpu/GPUErrorGenerator.cpp: Added.
2604         (WebCore::GPUErrorGenerator::pushErrorScope):
2605         (WebCore::GPUErrorGenerator::popErrorScope):
2606         (WebCore::GPUErrorGenerator::generateError):
2607         * platform/graphics/gpu/GPUErrorGenerator.h: Added.
2608         (WebCore::GPUErrorGenerator::create):
2609         * platform/graphics/gpu/GPUObjectBase.h: Added.
2610         (WebCore::GPUObjectBase::generateError):
2611         (WebCore::GPUObjectBase::GPUObjectBase):
2612         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Use the GPUErrorGenerator directly during buffer creation.
2613         (WebCore::GPUBuffer::validateBufferUsage):
2614         (WebCore::GPUBuffer::tryCreate):
2615         (WebCore::GPUBuffer::GPUBuffer):
2616         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
2617         (WebCore::GPUQueue::submit): Prevent possible null dereference.
2618
2619 2019-07-10  Justin Fan  <justin_fan@apple.com>
2620
2621         [WebGPU] Implement GPUError and error scopes
2622         https://bugs.webkit.org/show_bug.cgi?id=199655
2623
2624         Reviewed by Myles C. Maxfield.
2625
2626         Add GPUErrorFilter, GPUError, and the ability to push and pop error scopes on a GPUDevice.
2627         This will allow us to check for WebGPU errors from JavaScript.
2628         Currently, only some GPUBuffer creation errors are reported for testing; more errors will follow in later patches.
2629
2630         Test: webgpu/error-scopes-test.html
2631
2632         * Modules/webgpu/GPUErrorFilter.idl: Added.
2633         * Modules/webgpu/GPUOutOfMemoryError.idl: Added.
2634         * Modules/webgpu/GPUValidationError.idl: Added.
2635         * Modules/webgpu/WebGPUDevice.cpp:
2636         (WebCore::WebGPUDevice::pushErrorScope):
2637         (WebCore::WebGPUDevice::popErrorScope): Resolve the Promise here, since GPUDevice shouldn't worry about DOM layer.
2638         * Modules/webgpu/WebGPUDevice.h:
2639         * Modules/webgpu/WebGPUDeviceErrorScopes.cpp: Added.
2640         (WebCore::WebGPUDeviceErrorScopes::pushErrorScope): Delegates to WebGPUDevice.
2641         (WebCore::WebGPUDeviceErrorScopes::popErrorScope): Ditto.
2642         * Modules/webgpu/WebGPUDeviceErrorScopes.h: Added.
2643         * Modules/webgpu/WebGPUDeviceErrorScopes.idl: Added.
2644         * platform/graphics/gpu/GPUBuffer.h:
2645         * platform/graphics/gpu/GPUDevice.cpp: The actual error stack lives here.
2646         (WebCore::GPUDevice::pushErrorScope):
2647         (WebCore::GPUDevice::popErrorScope): Calls a callback with a GPUError, if any.
2648         (WebCore::GPUDevice::registerError): Actually creates GPUErrors.
2649         * platform/graphics/gpu/GPUDevice.h:
2650         * platform/graphics/gpu/GPUError.cpp: Added.
2651         (WebCore::createError): Factory function for various error types.
2652         * platform/graphics/gpu/GPUError.h: Added.
2653         * platform/graphics/gpu/GPUErrorFilter.h: Added.
2654         * platform/graphics/gpu/GPUOutOfMemoryError.h: Added.
2655         (WebCore::GPUOutOfMemoryError::create):
2656         * platform/graphics/gpu/GPUValidationError.cpp: Added.
2657         (WebCore::GPUValidationError::create):
2658         (WebCore::GPUValidationError::GPUValidationError):
2659         * platform/graphics/gpu/GPUValidationError.h: Added.
2660         (WebCore::GPUValidationError::message const):
2661         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2662         (WebCore::GPUBuffer::validateBufferUsage): Create an actual GPUValidationError :)
2663         (WebCore::GPUBuffer::tryCreate): Create GPUOutOfMemoryErrors where appropriate.
2664
2665         Add file/name references:
2666         * CMakeLists.txt:
2667         * DerivedSources-input.xcfilelist:
2668         * DerivedSources-output.xcfilelist:
2669         * DerivedSources.make:
2670         * Sources.txt:
2671         * WebCore.xcodeproj/project.pbxproj:
2672         * bindings/js/WebCoreBuiltinNames.h:
2673
2674         Missing includes:
2675         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:
2676
2677 2019-07-16  Commit Queue  <commit-queue@webkit.org>
2678
2679         Unreviewed, rolling out r247493.
2680         https://bugs.webkit.org/show_bug.cgi?id=199841
2681
2682         "The new whlsl-for-loop.html test is failing on the bots"
2683         (Requested by rmorisset on #webkit).
2684
2685         Reverted changeset:
2686
2687         "[WHLSL] Desugar for loops and while loops"
2688         https://bugs.webkit.org/show_bug.cgi?id=199726
2689         https://trac.webkit.org/changeset/247493
2690
2691 2019-07-16  Per Arne Vollan  <pvollan@apple.com>
2692
2693         Prewarm font cache with more fonts
2694         https://bugs.webkit.org/show_bug.cgi?id=199283
2695
2696         Reviewed by Myles C. Maxfield.
2697
2698         Use the existing prewarm method in FontCache to prewarm the cache with a set of font family names.
2699         The font list consists of some of the fonts used by the 10 most popular sites on Alexa top sites.
2700         This is a confirmed improvement in page load time.
2701
2702         No new tests, covered by existing tests.
2703
2704         * page/ProcessWarming.cpp:
2705         (WebCore::ProcessWarming::prewarmGlobally):
2706         * platform/graphics/FontCache.cpp:
2707         (WebCore::FontCache::prewarmGlobally):
2708         * platform/graphics/FontCache.h:
2709         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2710         (WebCore::FontCache::prewarmGlobally):
2711
2712 2019-07-16  Robin Morisset  <rmorisset@apple.com>
2713
2714         [WHLSL] Desugar for loops and while loops
2715         https://bugs.webkit.org/show_bug.cgi?id=199726
2716
2717         Reviewed by Myles C. Maxfield.
2718
2719         This patch makes loops behave a lot more similarly to the spec.
2720         In particular, while loops are just degenerate for loops, so they can be desugared in the parser.
2721         And for loops can themselves be heavily desugared, into having no initializer, one condition and one increment
2722         by putting any initializer in a block around the loop, putting true in the condition if there is none, and putting any litteral in the increment if there is none.
2723
2724         Debugging this patch revealed an unrelated bug where the parser would generate an empty comma expression on ";", which the checker would then choke on.
2725         The parser now generates an empty block in that case (as specified in the spec), which fixes the problem.
2726
2727         Finally, while updating the NameResolver for the new structure of loops I realized that it was needlessly generating extra NameContext.
2728         They are not expected by the spec, that forbids naked variable declarations outside of blocks anyway.
2729         So I removed this unnecessary work, and fixed the parser to correctly forbid such naked variable declarations.
2730
2731         * Modules/webgpu/WHLSL/AST/WHLSLAST.h:
2732         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
2733         (WebCore::WHLSL::AST::ForLoop::ForLoop):
2734         (WebCore::WHLSL::AST::ForLoop::condition):
2735         (WebCore::WHLSL::AST::ForLoop::increment):
2736         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
2737         (WebCore::WHLSL::AST::Statement::isVariableDeclarationsStatement const):
2738         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h: Removed.
2739         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
2740         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
2741         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
2742         (WebCore::WHLSL::ASTDumper::visit):
2743         * Modules/webgpu/WHLSL/WHLSLASTDumper.h:
2744         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2745         (WebCore::WHLSL::Checker::visit):
2746         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
2747         (WebCore::WHLSL::NameResolver::visit):
2748         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
2749         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
2750         (WebCore::WHLSL::Parser::parseBlockBody):
2751         (WebCore::WHLSL::Parser::parseForLoop):
2752         (WebCore::WHLSL::Parser::parseWhileLoop):
2753         (WebCore::WHLSL::Parser::parseStatement):
2754         (WebCore::WHLSL::Parser::parseEffectfulExpression):
2755         * Modules/webgpu/WHLSL/WHLSLParser.h:
2756         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp:
2757         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
2758         (WebCore::WHLSL::Visitor::visit):
2759         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
2760         * WebCore.xcodeproj/project.pbxproj:
2761
2762 2019-07-16  Tim Horton  <timothy_horton@apple.com>
2763
2764         NSTextFinder holes don't scroll with the page
2765         https://bugs.webkit.org/show_bug.cgi?id=199815
2766         <rdar://problem/52280514>
2767
2768         Reviewed by Simon Fraser.
2769
2770         * rendering/ScrollAlignment.h:
2771
2772 2019-07-16  Youenn Fablet  <youenn@apple.com>
2773
2774         [iOS] Make sure the first camera device in the list is the front camera
2775         https://bugs.webkit.org/show_bug.cgi?id=199811
2776         <rdar://problem/53125157>
2777
2778         Reviewed by Jer Noble.
2779
2780         Some websites call getUserMedia with a deviceId constraint and theey pick the
2781         first deviceId in the list provided by enumerateDevices.
2782         On iOS, this is the back camera which is often not what is expected by WebRTC applications.
2783         Instead, make sure the first camera device is the front camera.
2784
2785         Manually tested.
2786
2787         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2788
2789 2019-07-16  Chris Dumez  <cdumez@apple.com>
2790
2791         Speed up StorageManager::getValues()
2792         https://bugs.webkit.org/show_bug.cgi?id=199812
2793
2794         Reviewed by Alex Christensen.
2795
2796         * storage/StorageMap.cpp:
2797         (WebCore::StorageMap::importItems):
2798         * storage/StorageMap.h:
2799
2800 2019-07-16  Simon Fraser  <simon.fraser@apple.com>
2801
2802         Remove "GraphicsContext 0x7ffd8765f6b0 stack changed by" logging
2803         https://bugs.webkit.org/show_bug.cgi?id=199834
2804
2805         Reviewed by Dean Jackson.
2806
2807         I inadvertently left in a couple of GraphicsContextStateStackChecker (used to detect mismatched
2808         GraphicsContext save/restore) in r246725, so remove them.
2809
2810         * rendering/RenderLayer.cpp:
2811         (WebCore::RenderLayer::paintLayerContents):
2812         * rendering/RenderLayerBacking.cpp:
2813         (WebCore::RenderLayerBacking::paintIntoLayer):
2814
2815 2019-07-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2816
2817         [Text autosizing] [iPadOS] Paragraph text on the front page of LinkedIn.com is not boosted
2818         https://bugs.webkit.org/show_bug.cgi?id=199827
2819         <rdar://problem/53152660>
2820
2821         Reviewed by Zalan Bujtas.
2822
2823         After r247467, we try to avoid boosting some text that might cause vertical overflow due to line height
2824         increasing inside a container that expects a fixed integer number of lines. However, in the case of
2825         linkedin.com, the line height specified is a fixed value of 26px, which greatly exceeds the specified font size
2826         of 14px. In this case, it's safe to boost font size, since doing so would not affect the line height at all.
2827
2828         To handle this case, don't avoid text autosizing due to the "fixed number of lines" heuristic if the line height
2829         is fixed, and is much larger than the font size.
2830
2831         Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html
2832
2833         * rendering/style/TextSizeAdjustment.cpp:
2834         (WebCore::AutosizeStatus::updateStatus):
2835
2836 2019-07-16  Zalan Bujtas  <zalan@apple.com>
2837
2838         [ContentChangeObserver] Cancel ongoing content observation when tap is failed/cancelled
2839         https://bugs.webkit.org/show_bug.cgi?id=199828
2840         <rdar://problem/53152696>
2841
2842         Reviewed by Wenson Hsieh.
2843
2844         This patch ensures that we stop the content observation (initiated by touch start) when the tap
2845         is cancelled/failed.
2846
2847         Not testable.
2848
2849         * page/ios/ContentChangeObserver.cpp:
2850         (WebCore::ContentChangeObserver::didCancelPotentialTap):
2851         * page/ios/ContentChangeObserver.h:
2852
2853 2019-07-16  Rob Buis  <rbuis@igalia.com>
2854
2855         Remove support for beforeload on link=prefetch
2856         https://bugs.webkit.org/show_bug.cgi?id=199632
2857
2858         Reviewed by Youenn Fablet.
2859
2860         Remove support for beforeload on link=prefetch
2861         by not calling shouldLoadLink for prefetch.
2862         Also make loadLink return void since it always
2863         succeeds.
2864
2865         Tests: http/wpt/prefetch/beforeload-dynamic.html
2866                http/wpt/prefetch/beforeload.html
2867
2868         * html/HTMLLinkElement.cpp:
2869         (WebCore::HTMLLinkElement::process):
2870         * loader/LinkLoader.cpp:
2871         (WebCore::LinkLoader::prefetchIfNeeded):
2872         (WebCore::LinkLoader::loadLink):
2873         * loader/LinkLoader.h:
2874
2875 2019-07-16  Youenn Fablet  <youenn@apple.com>
2876
2877         Hop to main thread for release logging in RealtimeIncomingAudioSource
2878         https://bugs.webkit.org/show_bug.cgi?id=199813
2879
2880         Reviewed by Eric Carlson.
2881
2882         LoggerHelper routines allow logging messages in system console and inspector console.
2883         These routines iterate through a Vector of log observers which is not thread safe.
2884         Document, the main log observer, also expects to be called on the main thread.
2885         Manually tested (writing a layout test for this would require more than 2 seconds).
2886
2887         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
2888         (WebCore::RealtimeIncomingAudioSourceCocoa::OnData):
2889
2890 2019-07-15  Ryan Haddad  <ryanhaddad@apple.com>
2891
2892         Unreviewed, rolling out r247444.
2893
2894         Caused two scrolling tests to fail on iOS Simulator
2895
2896         Reverted changeset:
2897
2898         "Typing into a cell in a Google Sheet lags behind by one
2899         character"
2900         https://bugs.webkit.org/show_bug.cgi?id=199587
2901         https://trac.webkit.org/changeset/247444
2902
2903 2019-07-15  Zalan Bujtas  <zalan@apple.com>
2904
2905         outlook.live.com has odd viewport with edge gap
2906         https://bugs.webkit.org/show_bug.cgi?id=199822
2907         <rdar://problem/53029072>
2908
2909         Reviewed by Wenson Hsieh.
2910
2911         r244944 introduced a viewport width quirk because at certain screen size outlook.live.com's flex setup produced a slighly broken layout.
2912         We don't seem to need this quirk anymore (composed column's min-width is removed.)
2913
2914         * page/Quirks.cpp:
2915         (WebCore::Quirks::shouldIgnoreShrinkToFitContent const): Deleted.
2916         (WebCore::Quirks::overriddenViewLayoutWidth const): Deleted.
2917         * page/Quirks.h:
2918
2919 2019-07-15  Saam Barati  <sbarati@apple.com>
2920
2921         [WHLSL] Matrix memory layout should match HLSL by laying out columns linearly
2922         https://bugs.webkit.org/show_bug.cgi?id=199215
2923
2924         Reviewed by Myles C. Maxfield.
2925
2926         This patch makes it so that we lay out matrices in memory in the same
2927         way HLSL does. This is by laying out columns linearly in memory. So a float4x4
2928         composed by this series of floats in memory:
2929         [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
2930         
2931         composes this logical matrix:
2932         [[ 0,  4,  8, 12]
2933          [ 1,  5,  9, 13]
2934          [ 2,  6, 10, 14]
2935          [ 3,  7, 11, 15]]
2936         
2937         To implement this, we switch to using an array to represent the memory
2938         contents linear memory layout of a matrix. So the matrix float4x3 will now
2939         be an array<float, 12> in metal. Then, we change the indexed getter and
2940         setter methods for matrices to load and store from and to the correct
2941         memory locations. The memory layout of matrices is observable to WHLSL
2942         when using a matrix as an input/output to a shader.
2943
2944         Test: webgpu/whlsl-matrix-memory-layout.html
2945
2946         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
2947         (WebCore::WHLSL::Metal::writeNativeFunction):
2948         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
2949         (WebCore::WHLSL::Metal::writeNativeType):
2950
2951 2019-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2952
2953         [Text autosizing] [iPadOS] Product label text is clipped in portrait mode on the front page of sephora.com
2954         https://bugs.webkit.org/show_bug.cgi?id=199806
2955         <rdar://problem/52902482>
2956
2957         Reviewed by Zalan Bujtas.
2958
2959         On sephora.com, some product label text is currently boosted by idempotent text autosizing, which causes the
2960         labels be vertically clipped. This patch augments the idempotent text autosizing heuristic to avoid this case by
2961         checking if the element to be boosted has a fixed height or max height, whose value is very close to a small
2962         integer multiple of the line height. In this case, it's likely that the website expects the text to be no more
2963         than a few lines' worth of height, so boosting the text is likely to break the page.
2964
2965         Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html
2966
2967         * rendering/style/RenderStyle.cpp:
2968         (WebCore::RenderStyle::isIdempotentTextAutosizingCandidate const):
2969         * rendering/style/TextSizeAdjustment.cpp:
2970         (WebCore::AutosizeStatus::updateStatus):
2971         * rendering/style/TextSizeAdjustment.h:
2972
2973         Rename Fields::DisplayNone to Fields::AvoidSubtree to avoid introducing another bit in RenderStyle's inherited
2974         flags.
2975
2976 2019-07-15  Myles C. Maxfield  <mmaxfield@apple.com>
2977
2978         New York font erroneously gets synthetic bold
2979         https://bugs.webkit.org/show_bug.cgi?id=199653
2980
2981         Unreviewed watchOS build fix.
2982
2983         * page/ProcessWarming.cpp:
2984         (WebCore::ProcessWarming::prewarmGlobally):
2985         * page/cocoa/MemoryReleaseCocoa.mm:
2986         (WebCore::platformReleaseMemory):
2987         * platform/graphics/FontCascadeDescription.cpp:
2988         * platform/graphics/FontDescription.h:
2989         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2990         (WebCore::invalidateFontCache):
2991         (WebCore::lookupFallbackFont):
2992         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
2993         (WebCore::FontCascadeDescription::effectiveFamilyAt const):
2994         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
2995         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
2996         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
2997
2998 2019-07-15  Commit Queue  <commit-queue@webkit.org>
2999
3000         Unreviewed, rolling out r247462.
3001         https://bugs.webkit.org/show_bug.cgi?id=199816
3002
3003         completely messed up the patch (Requested by litherum on
3004         #webkit).
3005
3006         Reverted changeset:
3007
3008         "New York font erroneously gets synthetic bold"
3009         https://bugs.webkit.org/show_bug.cgi?id=199653
3010         https://trac.webkit.org/changeset/247462
3011
3012 2019-07-11  Simon Fraser  <simon.fraser@apple.com>
3013
3014         Fix builds where HAVE_DESIGN_SYSTEM_UI_FONTS is not defined.
3015
3016         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3017         (WebCore::fontWithFamilySpecialCase):
3018
3019 2019-07-11  Justin Fan  <justin_fan@apple.com>
3020
3021         Unreviewed build fix.
3022
3023         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp: Missing include.
3024
3025 2019-07-11  Myles C. Maxfield  <mmaxfield@apple.com>
3026
3027         New York font erroneously gets synthetic bold
3028         https://bugs.webkit.org/show_bug.cgi?id=199653
3029         <rdar://problem/51692592>
3030
3031         Reviewed by Simon Fraser.
3032
3033         This patch adds support for -apple-system-ui-serif, -apple-system-ui-monospaced,
3034         and -apple-system-ui-rounded, behind an SPI that is off-by-default. We don't want
3035         to expose these fonts to the web because we don't a standardization story for them
3036         yet, but we do want some apps to be able to use them.
3037
3038         WebKit clients who want to use these fonts can set
3039         -[WKPreferences _shouldAllowDesignSystemUIFonts] = YES.
3040
3041         The patch generalizes our existing system-ui infrastructure to handle these three
3042         additional fonts. It also explicitly disables the unsupported dot-prefixed names
3043         so they don't leak out into Web content.
3044
3045         Tests: fast/text/design-system-ui-10.html
3046                fast/text/design-system-ui-11.html
3047                fast/text/design-system-ui-12.html
3048                fast/text/design-system-ui-13.html
3049                fast/text/design-system-ui-14.html
3050                fast/text/design-system-ui-15.html
3051                fast/text/design-system-ui-16.html
3052                fast/text/design-system-ui-2.html
3053                fast/text/design-system-ui-3.html
3054                fast/text/design-system-ui-4.html
3055                fast/text/design-system-ui-5.html
3056                fast/text/design-system-ui-6.html
3057                fast/text/design-system-ui-7.html
3058                fast/text/design-system-ui-8.html
3059                fast/text/design-system-ui-9.html
3060                fast/text/design-system-ui.html
3061
3062         * css/CSSFontFace.cpp:
3063         (WebCore::CSSFontFace::shouldAllowDesignSystemUIFonts const):
3064         * css/CSSFontFace.h:
3065         * css/CSSFontFaceSource.cpp:
3066         (WebCore::CSSFontFaceSource::load):
3067         * css/StyleResolver.cpp:
3068         (WebCore::StyleResolver::initializeFontStyle):
3069         * page/Settings.yaml:
3070         * platform/graphics/FontDescription.cpp:
3071         (WebCore::m_shouldAllowDesignSystemUIFonts):
3072         (WebCore::m_shouldAllowUserInstalledFonts): Deleted.
3073         * platform/graphics/FontDescription.h:
3074         (WebCore::FontDescription::shouldAllowDesignSystemUIFonts const):
3075         (WebCore::FontDescription::setShouldAllowDesignSystemUIFonts):
3076         (WebCore::FontDescription::operator== const):
3077         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3078         (WebCore::platformFontLookupWithFamily):
3079         (WebCore::fontWithFamily):
3080         * platform/graphics/cocoa/FontCacheCoreText.h:
3081         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
3082         (WebCore::systemFontUse):
3083         (WebCore::systemFontCascadeList):
3084         (WebCore::FontCascadeDescription::effectiveFamilyCount const):
3085         (WebCore::FontCascadeDescription::effectiveFamilyAt const):
3086         (WebCore::isSystemFontString): Deleted.
3087         (WebCore::isUIFontTextStyle): Deleted.
3088         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
3089         (WebCore::FontPlatformData::ctFont const):
3090         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
3091         (WebCore::SystemFontDatabaseCoreText::createSystemUI):
3092         (WebCore::SystemFontDatabaseCoreText::createDesignSystemUI):
3093         (WebCore::SystemFontDatabaseCoreText::createTextStyle):
3094         (WebCore::SystemFontDatabaseCoreText::cascadeList):
3095         (WebCore::SystemFontDatabaseCoreText::applyWeightItalicsAndFallbackBehavior):
3096         (WebCore::SystemFontDatabaseCoreText::systemFontParameters):
3097         * platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
3098         * platform/graphics/ios/FontCacheIOS.mm:
3099         (WebCore::platformFontWithFamilySpecialCase):
3100         * platform/graphics/mac/FontCacheMac.mm:
3101         (WebCore::platformFontWithFamilySpecialCase):
3102         * style/StyleResolveForDocument.cpp:
3103         (WebCore::Style::resolveForDocument):
3104         * svg/graphics/SVGImage.cpp:
3105         (WebCore::SVGImage::dataChanged):
3106         * testing/InternalSettings.cpp:
3107         (WebCore::InternalSettings::Backup::Backup):
3108         (WebCore::InternalSettings::Backup::restoreTo):
3109         (WebCore::InternalSettings::setShouldAllowDesignSystemUIFonts):
3110         * testing/InternalSettings.h:
3111         * testing/InternalSettings.idl:
3112
3113 2019-07-15  Chris Dumez  <cdumez@apple.com>
3114
3115         Crash under DisplayRefreshMonitorManager::displayWasUpdated()
3116         https://bugs.webkit.org/show_bug.cgi?id=199808
3117         <rdar://problem/53070144>
3118
3119         Reviewed by Geoffrey Garen.
3120
3121         Copy m_monitors before iterating over it because the calling displayLinkFired() on the
3122         monitor may end up calling DisplayRefreshMonitorManager::displayDidRefresh() synchronously,
3123         which removes the monitor from m_monitors.
3124
3125         * platform/graphics/DisplayRefreshMonitorManager.cpp:
3126         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
3127
3128 2019-07-15  Yusuke Suzuki  <ysuzuki@apple.com>
3129
3130         [JSC] Improve wasm wpt test results by fixing miscellaneous issues
3131         https://bugs.webkit.org/show_bug.cgi?id=199783
3132
3133         Reviewed by Mark Lam.
3134
3135         Remove WebAssemblyPrototype.
3136
3137         Tests: imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.html
3138                imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.worker.html
3139                imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.html
3140                imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.worker.html
3141                imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.html
3142                imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.worker.html
3143                imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.html
3144                imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.worker.html
3145                imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.html
3146                imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.worker.html
3147                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.html
3148                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.worker.html
3149                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.html
3150                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.worker.html
3151                imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.html
3152                imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.worker.html
3153                imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.html
3154                imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.worker.html
3155                imported/w3c/web-platform-tests/wasm/jsapi/interface.any.html
3156                imported/w3c/web-platform-tests/wasm/jsapi/interface.any.worker.html
3157                imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.html
3158                imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.worker.html
3159                imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.html
3160                imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.worker.html
3161                imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.html
3162                imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.worker.html
3163                imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.html
3164                imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.worker.html
3165                imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.html
3166                imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.worker.html
3167                imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.html
3168                imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.worker.html
3169                imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.html
3170                imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.worker.html
3171                imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.html
3172                imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.worker.html
3173                imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.html
3174                imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.worker.html
3175                imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.html
3176                imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.worker.html
3177                imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.html
3178                imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.worker.html
3179                imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.html
3180                imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.worker.html
3181                imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.html
3182                imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.worker.html
3183                imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.html
3184                imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.worker.html
3185
3186         * bindings/js/JSDOMWindowBase.cpp:
3187         (WebCore::JSDOMWindowBase::compileStreaming):
3188         (WebCore::JSDOMWindowBase::instantiateStreaming):
3189
3190 2019-07-15  Dean Jackson  <dino@apple.com>
3191
3192         [WebGL] Remove software rendering and simplify context creation on macOS
3193         https://bugs.webkit.org/show_bug.cgi?id=199789
3194
3195         Reviewed by Sam Weinig.
3196
3197         We don't ever want to fall-back to the software renderer. We'd be better
3198         off failing to create the context completely.
3199
3200         Also, the number of fall-back attempts we were making before hitting
3201         the software renderer was overkill. All hardware we support should
3202         handle a 32bpp buffer.
3203
3204         Lastly, we don't want to support supersampling - multisampling only.
3205
3206         I lied… there is one more thing - failing to create the context
3207         was causing an ASSERT trying to remove the GC3D from the global list.
3208
3209         * html/canvas/WebGLRenderingContextBase.cpp:
3210         (WebCore::WebGLRenderingContextBase::create):
3211         * page/Settings.yaml: Remove forceSoftwareWebGL setting.
3212         * platform/graphics/GraphicsContext3DAttributes.h:
3213         * platform/graphics/GraphicsContext3DManager.cpp:
3214         (WebCore::GraphicsContext3DManager::addContext):
3215         (WebCore::GraphicsContext3DManager::removeContext):
3216         (WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance):
3217         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
3218         (WebCore::GraphicsContext3D::GraphicsContext3D):
3219         (WebCore::setPixelFormat): Deleted.
3220
3221 2019-07-14  Dean Jackson  <dino@apple.com>
3222
3223         Move more WebGL things into unified builds
3224         https://bugs.webkit.org/show_bug.cgi?id=199787
3225
3226         Reviewed by Wenson Hsieh.
3227
3228         Unify as many WebGL files as possible.
3229
3230         * Sources.txt:
3231         * WebCore.xcodeproj/project.pbxproj:
3232         * html/canvas/WebGLFramebuffer.cpp:
3233         * html/canvas/WebGLObject.h: Move a helper function into an inline.
3234         (WebCore::objectOrZero):
3235         * html/canvas/WebGLRenderingContextBase.cpp:
3236         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3237         * platform/mediastream/MediaStreamTrackPrivate.cpp:
3238
3239 2019-07-15  Keith Rollin  <krollin@apple.com>
3240
3241         Add missing webgpu includes
3242         https://bugs.webkit.org/show_bug.cgi?id=199802
3243         <rdar://problem/53119120>
3244
3245         Reviewed by Myles C. Maxfield.
3246
3247         WHLSLFunctionWriter.cpp fails to compile on tvOS and watchOS due to
3248         missing includes. This file likely compiles on other platforms due to
3249         the Unified Sources facility that clumps several implementation files
3250         together, exposing those implementation files to the others' includes.
3251         It fails on tvOS and watchOS due to the different ways these
3252         implementation files can get clumped together on different platforms.
3253
3254         No new tests as there is no functional change.
3255
3256         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
3257
3258 2019-07-15  Michael Catanzaro  <mcatanzaro@igalia.com>
3259
3260         Unreviewed, rolling out r247440.
3261
3262         Broke builds
3263
3264         Reverted changeset:
3265
3266         "[JSC] Improve wasm wpt test results by fixing miscellaneous
3267         issues"
3268         https://bugs.webkit.org/show_bug.cgi?id=199783
3269         https://trac.webkit.org/changeset/247440
3270
3271 2019-07-15  Daniel Bates  <dabates@apple.com>
3272
3273         Typing into a cell in a Google Sheet lags behind by one character
3274         https://bugs.webkit.org/show_bug.cgi?id=199587
3275         <rdar://problem/51616845>
3276
3277         Reviewed by Brent Fulgham.
3278
3279         Add a Google Sheets quirk. Put all DOM timers scheduled from keydown and keypress event listeners
3280         into a holding tank. The timers continue to tick, but are barred from executing their action until
3281         the next text insertion or deletion or 32 ms (on device) have elapsed, whichever is sooner. We only
3282         allocate a holding tank once per document, only if the quirk is active, and this allocation is done
3283         when the document schedules a timer on keydown or keypress. The holding tank lives for the lifetime
3284         of the document.
3285
3286         The story behind the quirk:
3287
3288         On keypress Google Sheets schedules timers and expects that a DOM update will occur (i.e. text
3289         will be inserted or deleted) within the same event loop iteration as the dispatched keypress. The
3290         UI Events spec. [1] makes no such guarantee of when a DOM update must occur in relation to the keypress
3291         event. It could happen in the same event loop iteration as the key press (as Google expects), the
3292         next iteration, 500ms later, 2 minutes later, etc. What the spec does guarantee is that by the time
3293         a DOM input event is dispatched that the DOM will be updated. And this is the solution to the problem
3294         Google Sheets is trying to solve, but is doing so using pre-IE 9 technology (though similar
3295         functionality was available via onpropertychange in IE < 9).
3296
3297         See also <https://github.com/w3c/uievents/issues/238>, which is tracking a spec. text update for
3298         this quirk.
3299
3300         Test: fast/events/ios/dom-update-on-keydown-quirk.html
3301
3302         [1] <https://w3c.github.io/uievents/> (Editor's Draft, 14 October 2018)
3303
3304         * SourcesCocoa.txt:
3305         * WebCore.xcodeproj/project.pbxproj:
3306         Add some files to the project.
3307
3308         * dom/Document.cpp:
3309         (WebCore::Document::domTimerHoldingTank): Added.
3310         * dom/Document.h:
3311         (WebCore::Document::domTimerHoldingTankIfExists): Added.
3312
3313         * page/DOMTimer.cpp:
3314         (WebCore::DOMTimer::install): Put the newly instantiated timer into the holding tank.
3315         (WebCore::DOMTimer::removeById): Remove the timer from the holding tank.
3316         (WebCore::DOMTimer::fired): Check if the timer is in the holding tank. If it is and it is a one-
3317         shot timer then schedule it for the next event loop iteration. If it's a repeating timer just
3318         let it continue ticking. Otherwise, do what we no now and execute the timer's action. The reason
3319         we do not suspend timers in the holding tank is because:
3320             1. Far out timers (Google Sheets registers timers as far out as 5 minutes!) are not penalized.
3321             Though smart supension logic could avoid this. See (3).
3322
3323             2. Empirical observations indicate that the keyboard will perform the insertion or deletion
3324             reasonably quickly (not the same event loop iteration as the keydown, but within two iterations out).
3325             So, the timers in the holding tank are short-lived.
3326
3327             3. Simplifies the code. There is no need to keep additional bookkeeping to track multiple timer
3328             suspension reasons (timers currently can only have one suspension reason) or alternatively defer
3329             scheduling a timer until a later time and computing a new "fair" firing time when scheduled.
3330         * page/EventHandler.cpp:
3331         (WebCore::EventHandler::internalKeyEvent): Place a token on the stack to put all DOM timers
3332         scheduled on keydown and keypress into the holding tank if the quirk is enabled.
3333         * page/Quirks.cpp:
3334         (WebCore::Quirks::needsDeferKeyDownAndKeyPressTimersUntilNextEditingCommand const): Added.
3335         * page/Quirks.h:
3336         * page/Settings.yaml: Added setting so that this quirk can be enabled from a layout test. This setting
3337         also lets us enable the quirk for all sites or for certain third-party apps if desired.
3338         * page/ios/DOMTimerHoldingTank.cpp: Added.
3339         (WebCore::DOMTimerHoldingTank::DOMTimerHoldingTank):
3340         (WebCore::DOMTimerHoldingTank::add):
3341         (WebCore::DOMTimerHoldingTank::remove):
3342         (WebCore::DOMTimerHoldingTank::contains):
3343         (WebCore::DOMTimerHoldingTank::removeAll):
3344         (WebCore::DOMTimerHoldingTank::stopExceededMaximumHoldTimer):
3345         * page/ios/DOMTimerHoldingTank.h: Added.
3346         (WebCore::DeferDOMTimersForScope::DeferDOMTimersForScope):
3347         (WebCore::DeferDOMTimersForScope::~DeferDOMTimersForScope):
3348         (WebCore::DeferDOMTimersForScope::isDeferring):
3349
3350 2019-07-15  Ryan Haddad  <ryanhaddad@apple.com>
3351
3352         Unreviewed, rolling out r247397, r247378, r247366.
3353
3354         Broke watchOS builds.
3355
3356         Reverted changesets:
3357
3358         "[WebGPU] Implement GPUError and error scopes"
3359         https://bugs.webkit.org/show_bug.cgi?id=199655
3360         https://trac.webkit.org/changeset/247366/webkit
3361
3362         "[WebGPU] Move error scopes out of GPUDevice for more portable error generation"
3363         https://bugs.webkit.org/show_bug.cgi?id=199740
3364         https://trac.webkit.org/changeset/247397/webkit
3365
3366 2019-07-15  Rob Buis  <rbuis@igalia.com>
3367
3368         MathML WPT test for RadicalDegreeBottomRaisePercent fails
3369         https://bugs.webkit.org/show_bug.cgi?id=183631
3370
3371         Reviewed by Frédéric Wang.
3372
3373         When stretching the radical operator also take thickness
3374         and radical gap into account:
3375         https://mathml-refresh.github.io/mathml-core/#radicals-msqrt-mroot
3376
3377         Test: imported/w3c/web-platform-tests/mathml/presentation-markup/radicals/root-parameters-1.html
3378
3379         * rendering/mathml/RenderMathMLRoot.cpp:
3380         (WebCore::RenderMathMLRoot::layoutBlock):
3381
3382 2019-07-15  Yusuke Suzuki  <ysuzuki@apple.com>
3383
3384         [JSC] Improve wasm wpt test results by fixing miscellaneous issues
3385         https://bugs.webkit.org/show_bug.cgi?id=199783
3386
3387         Reviewed by Mark Lam.
3388
3389         Remove WebAssemblyPrototype.
3390
3391         Tests: imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.html
3392                imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.worker.html
3393                imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.html
3394                imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.worker.html
3395                imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.html
3396                imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.worker.html
3397                imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.html
3398                imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.worker.html
3399                imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.html
3400                imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.worker.html
3401                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.html
3402                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.worker.html
3403                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.html
3404                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.worker.html
3405                imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.html
3406                imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.worker.html
3407                imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.html
3408                imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.worker.html
3409                imported/w3c/web-platform-tests/wasm/jsapi/interface.any.html
3410                imported/w3c/web-platform-tests/wasm/jsapi/interface.any.worker.html
3411                imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.html
3412                imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.worker.html
3413                imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.html
3414                imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.worker.html
3415                imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.html
3416                imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.worker.html
3417                imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.html
3418                imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.worker.html
3419                imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.html
3420                imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.worker.html
3421                imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.html
3422                imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.worker.html
3423                imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.html
3424                imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.worker.html
3425                imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.html
3426                imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.worker.html
3427                imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.html
3428                imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.worker.html
3429                imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.html
3430                imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.worker.html
3431                imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.html
3432                imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.worker.html
3433                imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.html
3434                imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.worker.html
3435                imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.html
3436                imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.worker.html
3437                imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.html
3438                imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.worker.html
3439
3440         * bindings/js/JSDOMWindowBase.cpp:
3441         (WebCore::JSDOMWindowBase::compileStreaming):
3442         (WebCore::JSDOMWindowBase::instantiateStreaming):
3443
3444 2019-07-15  Youenn Fablet  <youenn@apple.com>
3445
3446         Enable a debug WebRTC mode without any encryption
3447         https://bugs.webkit.org/show_bug.cgi?id=199177
3448         <rdar://problem/52074986>
3449
3450         Reviewed by Eric Carlson.
3451
3452         For every RTCPeerConnection, first set whether to use encryption or not
3453         based on page settings.
3454         If encryption is disabled, log it.
3455         Add internals API to toggle the switch from tests.
3456         Test: webrtc/disable-encryption.html
3457
3458         * Modules/mediastream/RTCPeerConnection.cpp:
3459         (WebCore::RTCPeerConnection::RTCPeerConnection):
3460         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3461         (WebCore::createLibWebRTCPeerConnectionBackend):
3462         * inspector/agents/InspectorPageAgent.cpp:
3463         * page/Settings.yaml:
3464         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3465         (WebCore::LibWebRTCProvider::setEnableWebRTCEncryption):
3466         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3467         * testing/Internals.cpp:
3468         (WebCore::Internals::resetToConsistentState):
3469         (WebCore::Internals::setEnableWebRTCEncryption):
3470         * testing/Internals.h:
3471         * testing/Internals.idl:
3472
3473 2019-07-15  Sihui Liu  <sihui_liu@apple.com>
3474
3475         window.openDatabase is not writable
3476         https://bugs.webkit.org/show_bug.cgi?id=199737
3477         <rdar://problem/52551332>
3478
3479         Reviewed by Chris Dumez.
3480
3481         In r246707 we made openDatabase an undetectable attribute of window, and it was set to be read-only. This broke 
3482         some sites which replace window.openDatabase with their own implementation when window.openDatabase does not 
3483         exists or WebSQL is not implemented. 
3484
3485         This patch removes the readonly property and adds a setter for openDatabase.
3486
3487         * Modules/webdatabase/DOMWindowWebDatabase.idl:
3488         * bindings/js/JSDOMWindowCustom.cpp:
3489         (WebCore::JSDOMWindow::setOpenDatabase):
3490
3491 2019-07-15  Youenn Fablet  <youenn@apple.com>
3492
3493         Filter SDP c lines
3494         https://bugs.webkit.org/show_bug.cgi?id=199791
3495
3496         Reviewed by Eric Carlson.
3497
3498         As discussed in https://github.com/rtcweb-wg/mdns-ice-candidates/issues/91,
3499         use 0.0.0.0 for c lines when filtering the SDP.
3500         Covered by updated test.
3501
3502         * Modules/mediastream/PeerConnectionBackend.cpp:
3503         (WebCore::PeerConnectionBackend::filterSDP const):
3504
3505 2019-07-15  Zalan Bujtas  <zalan@apple.com>
3506
3507         naver.com: Video stops when tapping on the video to use buttons
3508         https://bugs.webkit.org/show_bug.cgi?id=199784
3509         <rdar://problem/48068610>
3510
3511         Reviewed by Maciej Stachowiak.
3512
3513         Opt out of simulated mouse event sending for tv.naver.com.
3514         When tv.naver.com receives the simulated mouseUp at touchEnd, it pauses the video right away and calls preventDefault()
3515         which prevents us from running the hover heuristics.
3516
3517         * page/Quirks.cpp:
3518         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
3519
3520 2019-07-15  Michael Catanzaro  <mcatanzaro@igalia.com>
3521
3522         [GTK] GitHub breaks on FreeBSD because of "unsupported browser"
3523         https://bugs.webkit.org/show_bug.cgi?id=199745
3524
3525         Reviewed by Carlos Garcia Campos.
3526
3527         It's been a while since I last updated the fake version numbers in our user agent, both for
3528         the user agent quirks for naughty websites and also the Safari version in our standard user
3529         agent. Update them. This should fix github.com on FreeBSD at least. I also noticed some
3530         wonkiness on Google Docs recently that I thought required this update, but I didn't do
3531         anything about it at the time because I wasn't able to reproduce the issue when I tried
3532         again later.
3533
3534         This could absolutely break websites, because the web is awful, but that's calculated risk.
3535
3536         * platform/UserAgentQuirks.cpp:
3537         (WebCore::UserAgentQuirks::stringForQuirk):
3538         * platform/glib/UserAgentGLib.cpp:
3539         (WebCore::buildUserAgentString):
3540
3541 2019-07-14  Chris Dumez  <cdumez@apple.com>
3542
3543         Add threading assertion to WeakPtrFactory::createWeakPtr()
3544         https://bugs.webkit.org/show_bug.cgi?id=199639
3545
3546         Reviewed by Ryosuke Niwa.
3547
3548         * platform/ScrollableArea.cpp:
3549         * rendering/RenderObject.cpp:
3550
3551 2019-07-14  Dean Jackson  <dino@apple.com>
3552
3553         WebGL not supported on WKWebView on UIKit for Mac
3554         https://bugs.webkit.org/show_bug.cgi?id=199785
3555         <rdar://problem/52911449>
3556
3557         Reviewed by Antoine Quint.
3558
3559         UIKit for Mac was not creating a CGLPixelFormatObj because
3560         it wasn't using the code hidden in PLATFORM(MAC). Instead
3561         we should be guarding for USE(OPENGL).
3562
3563         There are still some inconsistencies: <rdar://53062794>
3564
3565         Test: webgl/smell-test.html
3566
3567         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
3568         (WebCore::GraphicsContext3D::GraphicsContext3D):
3569         (WebCore::GraphicsContext3D::allowOfflineRenderers const): We have to return
3570         true for this, since we don't have access to the Window Server.
3571
3572 2019-07-13  Wenson Hsieh  <wenson_hsieh@apple.com>
3573
3574         [Text autosizing] [iPadOS] Further adjust our heuristics to determine text autosizing candidates
3575         https://bugs.webkit.org/show_bug.cgi?id=199780
3576         <rdar://problem/52289088>
3577
3578         Reviewed by Simon Fraser.
3579
3580         Our current idempotent text autosizing candidate heuristic makes the right judgment call most of the time, but
3581         there is still a large batch of text autosizing bugs left unfixed by the first iteration of the heuristic added
3582         in r246781. This patch attempts to address most of these bugs by adjusting the decision-tree-based heuristic
3583         once again, mostly with improvements to the model generation pipeline.
3584
3585         During the first iteration, I placed emphasis on tuning the max tree depth and min leaf size hyperparameters
3586         when coming up with my decision tree, and didn't consider the inclusion or exclusion of each feature as a
3587         hyperparameters. As such, the trees generated using the pipeline tended to use too many features, and as a
3588         result, tended to have cross-validation overall accuracy scores hovering around 73%.
3589
3590         In this revised model generation pipeline, I now consider the inclusion of each feature (along with max depth
3591         and min leaf size, as before) as a hyperparameter. Since this increases the number of hyperparameters by many
3592         orders of magnitude, a naive grid search (as described in the prior ChangeLog entry) is no longer a tractible
3593         procedure for tuning hyperparameters to the training algorithm.
3594
3595         Instead, I now use a stochastic greedy algorithm to search for good sets of hyperparameters; this process begins
3596         with seeding some number (usually 20-24) of "searchers" with completely randomized sets of hyperparameters (i.e.
3597         random max depth, random leaf size, and random subsets of features). I then evaluate the average performance of
3598         each set of hyperparameters by using them to generate 2000 decision trees over 90% of the training data, and
3599         then cross-validating these trees against the remaining 10%. These cross-validation scores are aggregated into a
3600         single confusion matrix, which is then passed into a loss function that computes a single value indicating how
3601         well training with the set of hyperparameters generalized to cross-validation data. After experimenting with
3602         various loss functions, I settled on the following:
3603
3604         `k(false positive rate)^2 + (false negative rate)^2`
3605
3606         ...where a constant k is chosen to penalize false positives (i.e. broken layout) more harshly than false
3607         negatives (small text). Additionally, squaring the false negative and false positive rates seems to help avoid
3608         converging on solutions that heavily favor reducing only false positives or false negatives, or vice versa.
3609
3610         The stochastic algorithm starts by computing a loss value for the randomly generated configuration. Then, for
3611         an indefinite number of iterations, it randomly mutates the configuration (e.g. by adding or removing features,
3612         or changing min leaf size or max tree depth) and computes a new loss value for the mutated configuration. If the
3613         mutated configuration performs better (i.e. achieves lower loss) than the current configuration, I set the
3614         current configuration to be the mutated configuration. Otherwise, I keep the current (non-mutated) configuration
3615         as-is. The stochastic algorithm then proceeds, ad-infinitum, with this current configuration.
3616
3617         Of course, since each mutation is small, this strategy so far is prone to leaving each searcher stuck in local
3618         optima. To mitigate this, for each searcher, I keep track of a side-table of configurations that have already
3619         been tested; when random mutations would normally lead to testing a configuration that has already been tested,
3620         each searcher instead increases the chance of applying additional mutations. This has the effect of searchers
3621         initially exhausting similar configurations, and expanding to test more and more dissimilar configurations as
3622         the local alternatives all turn out to be worse. This allows searchers to effectively jump out of local optima
3623         after being stuck for a long time.
3624
3625         So, using these strategies, I simultaneously ran a handful of searchers until they all appeared to converge
3626         (a process that takes 8-12 hours on my current dataset). Many of the searchers achieved configurations with
3627         cross-validation scores of 81% and above, up from the 73% of the previous attempt. These additionally have the
3628         added bonus of reducing the number of features, often making the final trees themselves shallower and simpler to
3629         understand than before.
3630
3631         This patch introduces one such decision tree generated using a set of hyperparameters acquired via this
3632         stochasic search algorithm; it appears to simultaneously use fewer features, and achieve better cross-validation
3633         performance.
3634
3635         Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html
3636
3637         * css/StyleResolver.cpp:
3638         (WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):
3639
3640         Adjust the early return to bail if either (1) the element is a candidate and the computed size is already equal
3641         to the boosted size, or (2) the element is not a candidate and the computed size is already equal to the
3642         specified size. Since the autosizing candidate heuristic depends on styles specified on the element itself (as
3643         opposed to styles on any element in the ancestor chain), a parent may be an autosizing candidate, but a child of
3644         it may not.
3645
3646         * rendering/style/RenderStyle.cpp:
3647         (WebCore::RenderStyle::isIdempotentTextAutosizingCandidate const):
3648
3649         Revamp the idempotent text autosizing candidate heuristic. See the explanation above for more details.
3650
3651         * rendering/style/RenderStyle.h:
3652
3653         Remove some bits from RenderStyle's autosizeStatus, now that we care about fewer bits of information from the
3654         inherited flags.
3655
3656         * rendering/style/TextSizeAdjustment.cpp:
3657         (WebCore::AutosizeStatus::updateStatus):
3658         * rendering/style/TextSizeAdjustment.h:
3659
3660 2019-07-13  Simon Fraser  <simon.fraser@apple.com>
3661
3662         Don't do async overflow scrolling for visibility:hidden scrollers
3663         https://bugs.webkit.org/show_bug.cgi?id=199779
3664
3665         Reviewed by Dean Jackson.
3666         
3667         An overflow:scroll with visibility:hidden is not scrollable on macOS, even if it has visible
3668         content. So disable async overflow:scroll when the scroller has non-visible visibility (this also
3669         takes visibility on ancestors into account).
3670         
3671         visibility:hidden overflow:scroll can be common because some JS libraries use it
3672         (https://github.com/wnr/element-resize-detector).
3673
3674         Test: compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers.html
3675
3676         * rendering/RenderLayer.cpp:
3677         (WebCore::RenderLayer::canUseCompositedScrolling const): Don't use hasVisibleContent() because
3678         that's affected by  visible children.
3679
3680 2019-07-13  Robin Morisset  <rmorisset@apple.com>
3681
3682         [WHLSL] Return statements don't need to keep track of the function they're in
3683         https://bugs.webkit.org/show_bug.cgi?id=199763
3684
3685         Reviewed by Myles C. Maxfield.
3686
3687         Return::m_function is only used in the Checker, and it can easily enough keep track of the current function.
3688         This means we no longer need to keep track of the current function in the NameResolver, and we can save 8 bytes per Return
3689
3690         Since I was touching the NameResolver I also removed a few pointless overrides of Visitor::visit().
3691
3692         No new tests as there is no intended functional change.
3693
3694         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
3695         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
3696         (WebCore::WHLSL::Checker::visit):
3697         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
3698         (WebCore::WHLSL::NameResolver::NameResolver):
3699         (WebCore::WHLSL::resolveTypeNamesInFunctions):
3700         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
3701
3702 2019-07-13  Andres Gonzalez  <andresg_22@apple.com>
3703
3704         Add accessibility support to WKDataListSuggestionsView.
3705         https://bugs.webkit.org/show_bug.cgi?id=199772
3706         <rdar://problem/47095851>
3707
3708         Reviewed by Chris Fleizach.
3709
3710         Localizable strings for accessibility announcements.
3711
3712         * en.lproj/Localizable.strings:
3713
3714 2019-07-13  Chris Dumez  <cdumez@apple.com>
3715
3716         Drop non thread-safe usage of WeakPtr in VideoFullscreenInterfaceAVKit
3717         https://bugs.webkit.org/show_bug.cgi?id=199775
3718
3719         Reviewed by Eric Carlson.
3720
3721         The VideoFullscreenInterfaceAVKit constructor was making a weakPtr on the UI Thread
3722         of an WebThread object. The WeakPtr would then be used as a data member throughout
3723         the class on the UIThread. This is not thread-safe.
3724
3725         This patch switches to using a raw pointer instead of a WeakPtr. This is a partial
3726         rollout of r243298, which turned the raw pointer into a WeakPtr for hardening
3727         purposes. For extra safety, this patch updates the VideoFullscreenControllerContext
3728         so that it notifies its clients (i.e. PlaybackSessionInterfaceAVKit) that it is
3729         getting destroyed, so that they can null-out their m_videoFullscreenModel &
3730         m_fullscreenChangeObserver data members. This gives the sames guarantees as WeakPtr
3731         but in a thread-safe way.
3732
3733         This is very similar to the fix that was done for PlaybackSessionInterfaceAVKit in
3734         r247380.
3735
3736         * platform/cocoa/VideoFullscreenModel.h:
3737         (WebCore::VideoFullscreenModelClient::modelDestroyed):
3738         * platform/ios/VideoFullscreenInterfaceAVKit.h:
3739         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3740         (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel):
3741         (VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver):
3742         (VideoFullscreenInterfaceAVKit::modelDestroyed):
3743         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3744         (VideoFullscreenControllerContext::~VideoFullscreenControllerContext):
3745
3746 2019-07-13  Zalan Bujtas  <zalan@apple.com>
3747
3748         Cannot bring up custom media controls at all on v.youku.com
3749         https://bugs.webkit.org/show_bug.cgi?id=199699
3750         <rdar://problem/51835327>
3751
3752         Reviewed by Simon Fraser.
3753
3754         The "find the node under the finger" heuristic should only find nodes that are visible to hit-testing.
3755
3756         When the user taps on the screen, we run a "find the best node under the finger" heuristic and use the node's location
3757         to dispatch the associated event (e.g. mousePressed).
3758         Ideally the "best node under the finger" and the final target node for the associated event are the same.
3759         However these two methods configure the hit-testing process differently which could lead to node mismatch.
3760         The "best node" heuristic calls hit-testing with AllowChildFrameContent. This flag allows hit-testing to descend into
3761         subframes even if the subframe is not visible to hit-testing (visibility: hidden).
3762         While event dispatching never descends into subfames through hit-testing, but instead it forwards the dispatching to subframes that are visible to hit-testing.
3763
3764         This patch addresses the mismatching node issue by calling the descending version of hit-testing with a flag that enforces visiblity check before descending into a subframe.
3765
3766         Tests: fast/events/touch/ios/visibility-hidden-iframe-click.html
3767                fast/events/touch/ios/visibility-hidden-nested-iframe-click.html
3768
3769         * page/ios/FrameIOS.mm:
3770         (WebCore::Frame::hitTestResultAtViewportLocation):
3771         * rendering/HitTestRequest.h:
3772         (WebCore::HitTestRequest::skipsChildFrameContentInvisibleToHitTest const):
3773         * rendering/RenderWidget.cpp:
3774         (WebCore::RenderWidget::nodeAtPoint):
3775
3776 2019-07-13  Chris Dumez  <cdumez@apple.com>
3777
3778         Fix non thread-safe usage of makeWeakPtr() in MediaPlayerPrivateAVFoundation
3779         https://bugs.webkit.org/show_bug.cgi?id=199777
3780
3781         Reviewed by Eric Carlson.
3782
3783         The code was calling makeWeakPtr() on a main-thread object, from a background thread.
3784         This is not thread safe. To address the issue, this patches creates the WeakPtr ahead
3785         of time, on the main thread.
3786
3787         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3788         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
3789         (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
3790         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
3791         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3792
3793 2019-07-12  Thibault Saunier  <tsaunier@igalia.com>
3794
3795         [GStreamer] Mock GStreamer realtime sources should keep a Ref of their mock realtime media sources
3796         https://bugs.webkit.org/show_bug.cgi?id=194326
3797
3798         WrappedMockRealtimeVideoSource is a subclass of RealtimeMediaSource which is refcounted, we can't
3799         use a unique_ptr on those.
3800
3801         Also changed m_wrappedSource type to its actual type so it is cleaner even if needed
3802         to upcast it to RealtimeMediaSource so some method that are made private in the mock
3803         can still be called.
3804
3805         Reviewed by Youenn Fablet.
3806
3807         This fixes MediaStream tests
3808
3809         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
3810         (WebCore::WrappedMockRealtimeAudioSource::create):
3811         (WebCore::WrappedMockRealtimeAudioSource::asRealtimeMediaSource):
3812         (WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource):
3813         (WebCore::m_wrappedSource):
3814         (WebCore::MockGStreamerAudioCaptureSource::startProducingData):
3815         (WebCore::MockGStreamerAudioCaptureSource::settings):
3816         (WebCore::MockGStreamerAudioCaptureSource::capabilities):
3817         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
3818         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
3819         (WebCore::WrappedMockRealtimeVideoSource::create):
3820         (WebCore::WrappedMockRealtimeVideoSource::asRealtimeMediaSource):
3821         (WebCore::WrappedMockRealtimeVideoSource::WrappedMockRealtimeVideoSource):
3822         (WebCore::m_wrappedSource):
3823         (WebCore::MockGStreamerVideoCaptureSource::settings):
3824         (WebCore::MockGStreamerVideoCaptureSource::capabilities):
3825         * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
3826
3827 2019-07-12  Alex Christensen  <achristensen@webkit.org>
3828
3829         Change RELEASE_ASSERT in DocumentWriter::addData to ASSERT and early return
3830         https://bugs.webkit.org/show_bug.cgi?id=199756
3831         <rdar://problem/51554775>
3832
3833         Reviewed by Brady Eidson.
3834
3835         Attempts to reach this assertion were unsuccessful, but sometimes this assertion crashes.
3836         Let's change it to an early return to prevent crashes.
3837
3838         * loader/DocumentWriter.cpp:
3839         (WebCore::DocumentWriter::addData):
3840
3841 2019-07-12  Justin Fan  <justin_fan@apple.com>
3842
3843         [WebGPU] Move error scopes out of GPUDevice for more portable error generation
3844         https://bugs.webkit.org/show_bug.cgi?id=199740
3845
3846         Reviewed by Myles C. Maxfield.
3847
3848         Move error generation into a separate RefCounted class to allow GPU objects to generate 
3849         errors independent of any GPUDevice.
3850         Create GPUObjectBase to delegate error generation and refactor GPUBuffer to inherit from GPUObjectBase.
3851
3852         No behavior change or new tests. Error scopes covered by error-scopes-test.html.
3853
3854         * Modules/webgpu/WebGPUDevice.cpp:
3855         (WebCore::WebGPUDevice::WebGPUDevice): Now creates a GPUErrorGenerator.
3856         (WebCore::WebGPUDevice::createBuffer const): Pass the GPUErrorGenerator to any created GPUBuffer.
3857         (WebCore::WebGPUDevice::createBufferMapped const): Ditto.
3858         (WebCore::WebGPUDevice::popErrorScope): Shouldn't be const. Can just ask for the GPUError rather than passing a lambda.
3859         (WebCore::WebGPUDevice::pushErrorScope const): Deleted.
3860         (WebCore::WebGPUDevice::popErrorScope const): Deleted.
3861         * Modules/webgpu/WebGPUDevice.h:
3862         (WebCore::WebGPUDevice::pushErrorScope):
3863         * Sources.txt:
3864         * WebCore.xcodeproj/project.pbxproj:
3865         * platform/graphics/gpu/GPUBuffer.h: Now inherits from GPUObjectBase for error generation ease.
3866         * platform/graphics/gpu/GPUDevice.cpp:
3867         (WebCore::GPUDevice::tryCreateBuffer): Ensure GPUBuffers reference the GPUErrorGenerator.
3868         (WebCore::GPUDevice::pushErrorScope): Deleted. No longer needed here.
3869         (WebCore::GPUDevice::popErrorScope): Deleted.
3870         (WebCore::GPUDevice::registerError): Deleted.
3871         * platform/graphics/gpu/GPUDevice.h: Move error scope logic out.
3872         * platform/graphics/gpu/GPUErrorGenerator.cpp: Added.
3873         (WebCore::GPUErrorGenerator::pushErrorScope):
3874         (WebCore::GPUErrorGenerator::popErrorScope):
3875         (WebCore::GPUErrorGenerator::generateError):
3876         * platform/graphics/gpu/GPUErrorGenerator.h: Added.
3877         (WebCore::GPUErrorGenerator::create):
3878         * platform/graphics/gpu/GPUObjectBase.h: Added.
3879         (WebCore::GPUObjectBase::generateError):
3880         (WebCore::GPUObjectBase::GPUObjectBase):
3881         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Use the GPUErrorGenerator directly during buffer creation.
3882         (WebCore::GPUBuffer::validateBufferUsage):
3883         (WebCore::GPUBuffer::tryCreate):
3884         (WebCore::GPUBuffer::GPUBuffer):
3885         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
3886         (WebCore::GPUQueue::submit): Prevent possible null dereference.
3887
3888 2019-07-12  Youenn Fablet  <youenn@apple.com>
3889
3890         Add release logging for quota checks
3891         https://bugs.webkit.org/show_bug.cgi?id=199697
3892
3893         Reviewed by Alex Christensen.
3894
3895         Log whether a request to extend quota is made and the result of the request.
3896         This logging should happen in the networking process.
3897         No change of behavior.
3898
3899         * platform/Logging.h:
3900         * storage/StorageQuotaManager.cpp:
3901         (WebCore::StorageQuotaManager::askForMoreSpace):
3902         (WebCore::StorageQuotaManager::processPendingRequests):
3903
3904 2019-07-12  Youenn Fablet  <youenn@apple.com>
3905
3906         Stopping a cloned MediaStream video track should not stop any other video track
3907         https://bugs.webkit.org/show_bug.cgi?id=199635
3908
3909         Reviewed by Eric Carlson.
3910
3911         In case a track is requesting its source to end, the
3912         RealtimeVideoSource should request its own source to end and not stop it directly.
3913
3914         Also, if a track is removing itself as an observer to a RealtimeVideoSource, we should
3915         stop the underlying source only if this one does not have any other observer.
3916         Covered by updated test.
3917
3918         * platform/mediastream/RealtimeMediaSource.cpp:
3919         (WebCore::RealtimeMediaSource::removeObserver):
3920         * platform/mediastream/RealtimeMediaSource.h:
3921         * platform/mediastream/RealtimeVideoSource.cpp:
3922         (WebCore::RealtimeVideoSource::requestToEnd):
3923         (WebCore::RealtimeVideoSource::stopBeingObserved):
3924         * platform/mediastream/RealtimeVideoSource.h:
3925
3926 2019-07-12  Timothy Hatcher  <timothy@apple.com>
3927
3928         Drop DarkModeCSSEnabled as an experimental feature and always enable it.
3929         https://bugs.webkit.org/show_bug.cgi?id=199725
3930         rdar://problem/52970972
3931
3932         Reviewed by Megan Gardner.
3933
3934         Tests: css-dark-mode
3935
3936         * css/CSSComputedStyleDeclaration.cpp:
3937         (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
3938         * css/MediaQueryEvaluator.cpp:
3939         (WebCore::prefersColorSchemeEv