[iOS WK2] A top fixed bar can flicker when scrolling with the keyboard up
[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-24  Simon Fraser  <simon.fraser@apple.com>
788
789         [iOS WK2] A top fixed bar can flicker when scrolling with the keyboard up
790         https://bugs.webkit.org/show_bug.cgi?id=200105
791         rdar://problem/52871975
792
793         Reviewed by Wenson Hsieh.
794
795         ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition() computes a visual viewport
796         from the current scroll position and scrollableAreaSize(). This doesn't know anything about
797         the impact of keyboards on the visual viewport, so it computes a too-large visual viewport
798         when the keyboard is up, triggering incorrect manipulations of the layout viewport. This
799         leads to the top bar flashing to position 0 when it should be hidden off the top.
800
801         Fix by feeding into the scrolling tree the height of the visual viewport which takes
802         FrameView::visualViewportOverrideRect() into account. This is stored on ScrollingStateFrameScrollingNode/
803         ScrollingTreeFrameScrollingNode.
804
805         Test: scrollingcoordinator/ios/fixed-scrolling-with-keyboard.html
806
807         * page/FrameView.h:
808         * page/scrolling/AsyncScrollingCoordinator.cpp:
809         (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
810         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
811         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
812         (WebCore::ScrollingStateFrameScrollingNode::setPropertyChangedBitsAfterReattach):
813         (WebCore::ScrollingStateFrameScrollingNode::setOverrideVisualViewportSize):
814         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
815         * page/scrolling/ScrollingStateFrameScrollingNode.h:
816         * page/scrolling/ScrollingTree.cpp:
817         (WebCore::ScrollingTree::commitTreeState): LOG_WITH_STREAM() doesn't evaluate scrollingTreeAsText()
818         every time.
819         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
820         (WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
821         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
822         (WebCore::ScrollingTreeFrameScrollingNode::dumpProperties const):
823         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
824
825 2019-07-23  Tim Horton  <timothy_horton@apple.com>
826
827         Long press hint of AirPods buy buttons are tall and narrow during animation
828         https://bugs.webkit.org/show_bug.cgi?id=200036
829         <rdar://problem/53145697>
830
831         Reviewed by Wenson Hsieh.
832
833         New test: fast/text-indicator/text-indicator-with-tiny-child.html
834
835         * dom/Range.cpp:
836         (WebCore::Range::borderAndTextRects const):
837         * dom/Range.h:
838         Add a BoundingRectBehavior that ignores 1x1 and smaller rects.
839
840         * page/TextIndicator.cpp:
841         (WebCore::absoluteBoundingRectForRange):
842         Enable IgnoreTinyRects.
843
844 2019-07-23  Wenson Hsieh  <wenson_hsieh@apple.com>
845
846         [macOS 10.15] Web process crashes when attempting to show the font panel via Font > Show Fonts
847         https://bugs.webkit.org/show_bug.cgi?id=200021
848         <rdar://problem/53301325>
849
850         Reviewed by Ryosuke Niwa.
851
852         In macOS 10.15, attempting to access ~/Library/FontCollections/ from the web process causes a Sandbox violation
853         and a subsequent crash. This can be triggered by trying to show the font panel via Font > Show Fonts in the
854         context menu after right clicking.
855
856         In the (near) future, we should fix this by moving logic to show the font panel, color panel and styles panel
857         from the Editor in the web process to the UI process in WebKit2. However, for the time being, we can just work
858         around this by adding a new EditorClient hook to determine whether to allow the font panel to show; this returns
859         true in the legacy macOS WebKit port, and false everywhere else.
860
861         Test: editing/mac/style/do-not-crash-when-showing-font-panel.html
862
863         * editing/mac/EditorMac.mm:
864         (WebCore::Editor::showFontPanel):
865         * loader/EmptyClients.cpp:
866         * page/EditorClient.h:
867
868 2019-07-23  Ryosuke Niwa  <rniwa@webkit.org>
869
870         WebKit should strip away system font names from the pasted content
871         https://bugs.webkit.org/show_bug.cgi?id=199975
872         <rdar://problem/53336353>
873
874         Reviewed by Darin Adler.
875
876         Cocoa HTML Writer sometimes generate system font names such as ".AppleSystemUIFont", ".SFUI-Regular", and ".SF UI Mono".
877         We need to strip away these font names upon paste to avoid these font names falling back to Times New Roman.
878
879         Added the code to strip these font names away in EditingStyle::mergeStyleFromRulesForSerialization, which is used by
880         StylizedMarkupAccumulator to generate HTML during copy. This works because WebContentReader::readWebArchive invokes
881         sanitizeMarkupWithArchive which inserts the pasteboard content into a temporary document then re-serializes back to HTML
882         using StylizedMarkupAccumulator before the actual pasting happens.
883
884         This approach has a few benefits over stripping away these font names in ReplaceSelectionCommand:
885
886         1. It would only affect clients that opts-in to copy & paste sanitization. e.g. it won't affect legacy WebKit clients
887         and those that opt out of pasteboard content sanitization.
888
889         2. It preserves font names such as ".SF Blah" that a website may insert as some kind of house keeping purposes if ever.
890         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
891         only affect cross-site and cross-app pasting, which is rare and less likely to affect real user scenarios.
892
893         3. It avoids exposing bogus .Apple* or .SF* font names to websites that directly use event.clipboardData.getData.
894         Indeed stripping away bogus markup like this is one of the key features / benefit of using copy & paste sanitization.
895
896         Test: editing/pasteboard/paste-cocoa-writer-markup-with-system-fonts.html
897
898         * editing/EditingStyle.cpp:
899         (WebCore::usesForbiddenSystemFontAsOnlyFontFamilyName): Added.
900         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization): Added the code to remove font-family property when needed.
901         * platform/graphics/FontCache.h:
902         * platform/graphics/cocoa/FontCacheCoreText.cpp:
903         (WebCore::isSystemFont): Moved.
904         (WebCore::FontCache::isSystemFontForbiddenForEditing): Added.
905         * platform/graphics/freetype/FontCacheFreeType.cpp:
906         (WebCore::FontCache::isSystemFontForbiddenForEditing): Added. Always returns false.
907         * platform/graphics/win/FontCacheWin.cpp:
908         (WebCore::FontCache::isSystemFontForbiddenForEditing): Ditto.
909
910 2019-07-22  Yusuke Suzuki  <ysuzuki@apple.com>
911
912         [bmalloc] Each IsoPage gets 1MB VA because VMHeap::tryAllocateLargeChunk rounds up
913         https://bugs.webkit.org/show_bug.cgi?id=200024
914
915         Reviewed by Saam Barati.
916
917         Changed how we interpret VM tags. Add IsoHeap VM tag support, and rename WebAssembly tag
918         to Gigacage tag.
919
920         * page/ResourceUsageData.h:
921         * page/ResourceUsageOverlay.h:
922         * page/cocoa/ResourceUsageOverlayCocoa.mm:
923         (WebCore::HistoricResourceUsageData::HistoricResourceUsageData):
924         * page/cocoa/ResourceUsageThreadCocoa.mm:
925         (WebCore::displayNameForVMTag):
926         (WebCore::categoryForVMTag):
927
928 2019-07-22  Youenn Fablet  <youenn@apple.com>
929
930         Fix inspector override conversion in InspectorPageAgent::overrideSetting
931         https://bugs.webkit.org/show_bug.cgi?id=200017
932
933         Reviewed by Devin Rousso.
934
935         Covered by inspector/page/overrideSetting-MockCaptureDevicesEnabled.html
936         which should not fail on bots not having cameras
937
938         * inspector/agents/InspectorPageAgent.cpp:
939         (WebCore::toOptionalBool):
940         (WebCore::InspectorPageAgent::overrideSetting):
941         Previously, the conversion for the mock capture value was implicit from a bool pointer to an optional.
942         Make an explicit conversion as done for regular settings.
943
944 2019-07-22  Ross Kirsling  <ross.kirsling@sony.com>
945
946         Unreviewed non-unified build fix.
947
948         * Modules/webdatabase/DatabaseContext.h:
949         * html/HTMLDialogElement.cpp:
950         * html/HTMLScriptElement.cpp:
951         * inspector/agents/InspectorDatabaseAgent.cpp:
952         * workers/service/server/SWServerWorker.cpp:
953         * workers/service/server/SWServerWorker.h:
954         * worklets/WorkletGlobalScope.cpp:
955         * worklets/WorkletGlobalScope.h:
956
957 2019-07-22  Wenson Hsieh  <wenson_hsieh@apple.com>
958
959         [iOS] [WK1] UIWebView always jumps to the top left corner when scrolling to reveal the selection
960         https://bugs.webkit.org/show_bug.cgi?id=200013
961         <rdar://problem/52526901>
962
963         Reviewed by Simon Fraser.
964
965         After <https://trac.webkit.org/r244141>, we no longer attempt to scroll to reveal the text selection in
966         UIWebView after changing the selection, due to how we use the legacy document view rect in legacy WebKit when
967         computing the visual viewport. This causes the viewRect in RenderLayer::scrollRectToVisible to be the same size
968         as the content size, which then causes us to always scroll to the origin when revealing the selection.
969
970         To make selection revealing work again in legacy WebKit, conditionally restore the old behavior of using the
971         unobscured content rect as the view rect, only in the case where scrolling is delegated and the platform widget
972         is present.
973
974         Test: WebKitLegacy.ScrollToRevealSelection
975
976         * page/FrameView.cpp:
977         (WebCore::FrameView::viewRectExpandedByContentInsets const):
978         (WebCore::FrameView::visualViewportRectExpandedByContentInsets const): Deleted.
979
980         Additionally rename visualViewportRectExpandedByContentInsets to viewRectExpandedByContentInsets, to reflect the
981         fact that this may either be the visual viewport rect or unobscured content rect.
982
983         * page/FrameView.h:
984         * rendering/RenderLayer.cpp:
985         (WebCore::RenderLayer::scrollRectToVisible):
986
987 2019-07-22  Brent Fulgham  <bfulgham@apple.com>
988
989         Correct web audio-related crash in seed reports
990         https://bugs.webkit.org/show_bug.cgi?id=200009
991         <rdar://problem/51565203>
992
993         Reviewed by Per Arne Vollan.
994
995         Update the 'createMix' method to do proper return value checking so that
996         we can clear the result of MTAudioProcessingTapCreate if the create operation
997         failed.
998
999         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1000         (WebCore::AudioSourceProviderAVFObjC::createMix):
1001
1002 2019-07-22  Per Arne Vollan  <pvollan@apple.com>
1003
1004         Prewarmed font does not find any matches
1005         https://bugs.webkit.org/show_bug.cgi?id=200007
1006
1007         Reviewed by Brent Fulgham.
1008
1009         Prewarming the font name 'SF Pro Text' does not find any matches. The font name ".SF NS Text/Display"
1010         should be used instead. Also add 'Lucida Grande' to the list of prewarmed font, since it is used as
1011         fallback font in many cases.
1012
1013         No new tests, covered by existing tests.
1014
1015         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1016         (WebCore::fontFamiliesForPrewarming):
1017
1018 2019-07-22  Youenn Fablet  <youenn@apple.com>
1019
1020         Make sure the player underlying volume is correctly set after creating a new player
1021         https://bugs.webkit.org/show_bug.cgi?id=199974
1022         <rdar://problem/52762559>
1023
1024         Reviewed by Eric Carlson.
1025
1026         When creating a player before starting to play, the volume might not be correctly initialized.
1027         Fix that by updating the volume like done for rate and muted state.
1028         A future refactoring should probably move that code in MediaPlayer.
1029
1030         Add an internal API to query the volume value from the underlying player.
1031
1032         Test: http/tests/media/audio-volume-zero.html
1033
1034         * html/HTMLMediaElement.cpp:
1035         (WebCore::HTMLMediaElement::updateVolume):
1036         (WebCore::HTMLMediaElement::updatePlayState):
1037         (WebCore::HTMLMediaElement::effectiveVolume const):
1038         (WebCore::HTMLMediaElement::effectiveMuted const):
1039         * html/HTMLMediaElement.h:
1040         * testing/Internals.cpp:
1041         (WebCore::Internals::privatePlayerVolume):
1042         * testing/Internals.h:
1043         * testing/Internals.idl:
1044         * testing/Internals.mm:
1045         (WebCore::Internals::privatePlayerVolume):
1046
1047 2019-07-22  Devin Rousso  <drousso@apple.com>
1048
1049         Web Inspector: Page: mark any WebCore::Setting inspector override as UNLIKELY
1050         https://bugs.webkit.org/show_bug.cgi?id=199925
1051
1052         Reviewed by Joseph Pecoraro.
1053
1054         * Scripts/SettingsTemplates/Settings.cpp.erb:
1055
1056 2019-07-22  Simon Fraser  <simon.fraser@apple.com>
1057
1058         Fix crashes in ScrollingStateNode::insertChild()
1059         https://bugs.webkit.org/show_bug.cgi?id=200023
1060         rdar://problem/53265378
1061
1062         Reviewed by Darin Adler.
1063
1064         Crash data suggest that ScrollingStateNode::insertChild() can be passed an index that
1065         is larger than the size of the vector, causing crashes.
1066
1067         Fix defensively by falling back to append() if the passed index is equal to or larger
1068         than the size of the children vector.
1069
1070         * page/scrolling/ScrollingStateNode.cpp:
1071         (WebCore::ScrollingStateNode::insertChild):
1072
1073 2019-07-22  Simon Fraser  <simon.fraser@apple.com>
1074
1075         Make some constructors explicit
1076         https://bugs.webkit.org/show_bug.cgi?id=199981
1077
1078         Reviewed by Daniel Bates.
1079
1080         Make explicit public constructors of objects that take POD or String& arguments,
1081         to reduce the changes of the compiler doing implicit conversions.
1082
1083         * Modules/indexeddb/server/IndexValueEntry.h:
1084         * Modules/indexeddb/server/IndexValueStore.h:
1085         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
1086         * Modules/webdatabase/ChangeVersionData.h:
1087         (WebCore::ChangeVersionData::ChangeVersionData):
1088         * Modules/webdatabase/OriginLock.h:
1089         * Modules/websockets/WebSocketExtensionParser.h:
1090         (WebCore::WebSocketExtensionParser::WebSocketExtensionParser):
1091         * bindings/js/ScriptCachedFrameData.h:
1092         * contentextensions/URLFilterParser.cpp:
1093         (WebCore::ContentExtensions::PatternParser::PatternParser):
1094         * css/parser/CSSTokenizer.h:
1095         * css/parser/SizesAttributeParser.h:
1096         * dom/SpaceSplitString.cpp:
1097         (WebCore::TokenIsEqualToCStringTokenProcessor::TokenIsEqualToCStringTokenProcessor):
1098         * html/FormController.cpp:
1099         (WebCore::SavedFormState::appendControlState):
1100         (WebCore::SavedFormState::takeControlState):
1101         * loader/ProgressTracker.cpp:
1102         (WebCore::ProgressItem::ProgressItem):
1103         * page/DragController.cpp:
1104         (WebCore::DragController::DragController):
1105         (WebCore::DragController::performDragOperation):
1106         * page/DragController.h:
1107         * page/animation/CSSPropertyAnimation.cpp:
1108         (WebCore::AnimationPropertyWrapperBase::AnimationPropertyWrapperBase):
1109         * page/ios/DOMTimerHoldingTank.h:
1110         (WebCore::DeferDOMTimersForScope::DeferDOMTimersForScope):
1111         * platform/CountedUserActivity.h:
1112         (WebCore::CountedUserActivity::CountedUserActivity):
1113         * platform/audio/DirectConvolver.h:
1114         * platform/audio/DownSampler.h:
1115         * platform/audio/DynamicsCompressorKernel.h:
1116         * platform/audio/EqualPowerPanner.h:
1117         * platform/audio/MultiChannelResampler.h:
1118         * platform/audio/ReverbAccumulationBuffer.h:
1119         * platform/audio/ReverbInputBuffer.h:
1120         * platform/audio/SincResampler.cpp:
1121         * platform/audio/UpSampler.h:
1122         * platform/audio/ios/AudioFileReaderIOS.h:
1123         * platform/audio/mac/AudioFileReaderMac.h:
1124         * platform/audio/mac/AudioSessionMac.cpp:
1125         (WebCore::AudioSessionPrivate::AudioSessionPrivate):
1126         * platform/cf/KeyedDecoderCF.h:
1127         * platform/graphics/WidthIterator.cpp:
1128         (WebCore::OriginalAdvancesForCharacterTreatedAsSpace::OriginalAdvancesForCharacterTreatedAsSpace):
1129         * platform/graphics/cocoa/FontCacheCoreText.h:
1130         (WebCore::SynthesisPair::SynthesisPair):
1131         * platform/graphics/displaylists/DisplayListItems.h:
1132         (WebCore::DisplayList::DrawingItem::DrawingItem):
1133         * platform/network/cf/ResourceRequest.h:
1134         (WebCore::ResourceRequest::ResourceRequest):
1135         * platform/text/TextCodecICU.h:
1136         * rendering/RenderTableSection.h:
1137         (WebCore::CellSpan::CellSpan):
1138         * rendering/shapes/RasterShape.cpp:
1139         * rendering/shapes/RasterShape.h:
1140         (WebCore::RasterShapeIntervals::RasterShapeIntervals):
1141         * testing/MockLibWebRTCPeerConnection.h:
1142         (WebCore::MockLibWebRTCIceCandidate::MockLibWebRTCIceCandidate):
1143
1144 2019-07-22  Rob Buis  <rbuis@igalia.com>
1145
1146         Remove some unneeded code in MathOperator
1147         https://bugs.webkit.org/show_bug.cgi?id=199935
1148
1149         Reviewed by Frédéric Wang.
1150
1151         Remove unused method.
1152
1153         No new tests, not changing behavior.
1154
1155         * rendering/mathml/MathOperator.h:
1156
1157 2019-07-21  Konstantin Tokarev  <annulen@yandex.ru>
1158
1159         Add DataListButtonElement.cpp to unified sources
1160         https://bugs.webkit.org/show_bug.cgi?id=199989
1161
1162         Reviewed by Michael Catanzaro.
1163
1164         * Sources.txt:
1165         * WebCore.xcodeproj/project.pbxproj:
1166
1167 2019-07-21  Andres Gonzalez  <andresg_22@apple.com>
1168
1169         Add accessibilityInsertText for text insertion in edit fields.
1170         https://bugs.webkit.org/show_bug.cgi?id=199973
1171
1172         Reviewed by Chris Fleizach.
1173
1174         Renamed accessibilityInsertText to _accessibilityInsertText.
1175
1176         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1177         (-[WebAccessibilityObjectWrapper _accessibilityInsertText:]):
1178         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]): Deleted.
1179         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1180         (-[WebAccessibilityObjectWrapper _accessibilityInsertText:]):
1181         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]): Deleted.
1182
1183 2019-07-21  Saam Barati  <sbarati@apple.com>
1184
1185         [WHLSL] Checker needs to setError() when a property access node can't commit its base type
1186         https://bugs.webkit.org/show_bug.cgi?id=199978
1187
1188         Reviewed by Dean Jackson.
1189
1190         Test: webgpu/whlsl/null-array-property-access.html
1191
1192         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1193         (WebCore::WHLSL::Checker::finishVisiting):
1194
1195 2019-07-21  Saam Barati  <sbarati@apple.com>
1196
1197         [WHLSL] Return the zero-value enum in the enum-from-integer constructor when the integer is not a valid enum value
1198         https://bugs.webkit.org/show_bug.cgi?id=199853
1199
1200         Reviewed by Dean Jackson.
1201
1202         Test: webgpu/whlsl/enum-integer-constructor.html
1203
1204         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
1205         (WebCore::WHLSL::Metal::writeNativeFunction):
1206
1207 2019-07-21  Myles C. Maxfield  <mmaxfield@apple.com>
1208
1209         [iOS] Fast and complex text codepaths disagree about how to lay out bopomofo with tone marks
1210         https://bugs.webkit.org/show_bug.cgi?id=199912
1211         <rdar://problem/52182454>
1212
1213         Reviewed by Simon Fraser.
1214
1215         This is because CoreText has special composition rules for CJK languages, which we don't have in our simple
1216         text codepath. Rather than implementing the composition rules in WebKit, we can simply disable them in
1217         CoreText.
1218
1219         Test: fast/text/international/system-language/composition.html
1220
1221         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
1222         (WebCore::Font::getCFStringAttributes const):
1223
1224 2019-07-20  Andres Gonzalez  <andresg_22@apple.com>
1225
1226         Add accessibilityInsertText for text insertion in edit fields.
1227         https://bugs.webkit.org/show_bug.cgi?id=199973
1228
1229         Reviewed by Chris Fleizach.
1230
1231         Tests: accessibility/insert-newline.html
1232                accessibility/ios-simulator/insert-newline.html
1233
1234         Accessibility clients like VoiceOver and Voice Control were entering
1235         text in text fields by replacing the entire content of the field
1236         (SetValue) and then setting the insertion point to the appropriate
1237         offset (SetSelectedTextRange). accessibilityInsertText gives a simpler
1238         interface to clients to insert text at the insertion point location.
1239         In addition, this provides a workaround for the issue encountered with
1240         the previous method when inserting a linebreak.
1241
1242         * accessibility/AccessibilityObject.cpp:
1243         (WebCore::AccessibilityObject::insertText):
1244         * accessibility/AccessibilityObject.h:
1245         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1246         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
1247         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1248         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
1249
1250 2019-07-20  Alexander Mikhaylenko  <exalm7659@gmail.com>
1251
1252         REGRESSION(r246033/r246496): [GTK] Kinetic scrolling doesn't work
1253         https://bugs.webkit.org/show_bug.cgi?id=199322
1254
1255         Reviewed by Michael Catanzaro.
1256
1257         Check ENABLE(KINETIC_SCROLLING) instead of ENABLE(ASYNC_SCROLLING) for kinetic scrolling.
1258
1259         * platform/PlatformWheelEvent.h:
1260         * platform/generic/ScrollAnimatorGeneric.cpp:
1261         (WebCore::ScrollAnimatorGeneric::handleWheelEvent):
1262         * platform/gtk/PlatformWheelEventGtk.cpp:
1263         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
1264
1265 2019-07-20  Zalan Bujtas  <zalan@apple.com>
1266
1267         [LFC][TFC] Introduce table formatting context.
1268         https://bugs.webkit.org/show_bug.cgi?id=199979
1269         <rdar://problem/53346292>
1270
1271         Reviewed by Antti Koivisto.
1272
1273         Add the basic class structure for the table formatting context.
1274         https://www.w3.org/TR/CSS22/tables.html
1275
1276         * Sources.txt:
1277         * WebCore.xcodeproj/project.pbxproj:
1278         * layout/FormattingState.h:
1279         (WebCore::Layout::FormattingState::isTableFormattingState const):
1280         * layout/tableformatting/TableFormattingContext.cpp: Added.
1281         (WebCore::Layout::TableFormattingContext::TableFormattingContext):
1282         (WebCore::Layout::TableFormattingContext::layout const):
1283         * layout/tableformatting/TableFormattingContext.h: Added.
1284         * layout/tableformatting/TableFormattingState.cpp: Added.
1285         (WebCore::Layout::TableFormattingState::TableFormattingState):
1286         (WebCore::Layout::TableFormattingState::~TableFormattingState):
1287         * layout/tableformatting/TableFormattingState.h: Added.
1288         * layout/tableformatting/TableInvalidation.cpp: Added.
1289         (WebCore::Layout::TableInvalidation::invalidate):
1290         * layout/tableformatting/TableInvalidation.h: Added.
1291
1292 2019-07-20  Zalan Bujtas  <zalan@apple.com>
1293
1294         [LFC][IFC] Add support for mid-word break.
1295         https://bugs.webkit.org/show_bug.cgi?id=199976
1296         <rdar://problem/53337349>
1297
1298         Reviewed by Antti Koivisto.
1299
1300         Introduce leading and trailing InlineTextItem to support incoming and outgoing partial content.
1301         TextUtil::split is a straight copy of SimpleLineLayout::split.
1302
1303         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1304         (WebCore::Layout::inlineItemWidth):
1305         (WebCore::Layout::LineLayout::close):
1306         (WebCore::Layout::LineLayout::placeInlineItem):
1307         (WebCore::Layout::LineLayout::layout):
1308         * layout/inlineformatting/InlineTextItem.cpp:
1309         (WebCore::Layout::InlineTextItem::split const):
1310         (WebCore::Layout::InlineTextItem::split): Deleted.
1311         * layout/inlineformatting/InlineTextItem.h:
1312         (WebCore::Layout::InlineTextItem::inlineBox const):
1313         * layout/inlineformatting/text/TextUtil.cpp:
1314         (WebCore::Layout::TextUtil::split):
1315         * layout/inlineformatting/text/TextUtil.h:
1316
1317 2019-07-20  Zalan Bujtas  <zalan@apple.com>
1318
1319         [Text autosizing] Do not nuke the style on dynamicViewportSizeUpdate
1320         https://bugs.webkit.org/show_bug.cgi?id=199718
1321         <rdar://problem/53344961>
1322
1323         Reviewed by Simon Fraser.
1324
1325         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.
1326         Currently we call setNeedsRecalcStyleInAllFrames() to accomplish it. Unfortunatelly setNeedsRecalcStyleInAllFrames destroys all the style information which means that the
1327         subsequent styleResolve() needs to start from scratch.
1328         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
1329         on a timer so that rapid dynamicViewportSizeUpdate() calls won't trigger redundant layouts.
1330
1331         * css/StyleResolver.cpp:
1332         (WebCore::hasTextChild):
1333         (WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):
1334         (WebCore::hasTextChildren): Deleted.
1335         * css/StyleResolver.h:
1336         * page/FrameView.h:
1337         * page/Page.cpp:
1338         (WebCore::Page::invalidateTextAutoSizeInAllFrames):
1339         * page/Page.h:
1340
1341 2019-07-20  Saam Barati  <sbarati@apple.com>
1342
1343         [WHLSL] Make enums work
1344         https://bugs.webkit.org/show_bug.cgi?id=199634
1345
1346         Reviewed by Robin Morisset.
1347
1348         This patch makes enums work. There were a couple changes needed to do this work:
1349         1. In the metal codegen, we were emitting code like "EnumType.EnumValue"
1350         instead of "EnumType::EnumValue".
1351         
1352         2. Inside the enumeration declaration AST node, we track enums in a HashMap
1353         because we need to look up names of enum values in that map in parts of the
1354         compiler. However, HashMap is not ordered but we were relying on the iteration
1355         order of it to generate the default values of enums. E.g, in: "enum { Foo = 10, Bar }",
1356         Bar should be 11. However, there was no guarantee that we iterated over Bar
1357         after Foo. Instead, we just track the default values as we parse an enum
1358         inside of the parser. This allows us to continue to keep using HashMap without
1359         also adding an auxiliary data structure (or using more memory in some way) to
1360         track the order of the enum elements.
1361         
1362         I've also filed a patch to do follow-up work on implementing the correct
1363         operational behavior when constructing an enum from its underlying type when
1364         the underlying value does not match any enum value:
1365         https://bugs.webkit.org/show_bug.cgi?id=199853
1366
1367         Tests: webgpu/whlsl/enums-2.html
1368                webgpu/whlsl/enums.html
1369
1370         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:
1371         (WebCore::WHLSL::AST::EnumerationMember::EnumerationMember):
1372         (WebCore::WHLSL::AST::EnumerationMember::value):
1373         (WebCore::WHLSL::AST::EnumerationMember::setValue): Deleted.
1374         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
1375         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
1376         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
1377         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
1378         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
1379         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
1380         (WebCore::WHLSL::ASTDumper::visit):
1381         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1382         (WebCore::WHLSL::Checker::visit):
1383         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
1384         (WebCore::WHLSL::Parser::parseEnumerationDefinition):
1385         (WebCore::WHLSL::Parser::parseEnumerationMember):
1386         * Modules/webgpu/WHLSL/WHLSLParser.h:
1387         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
1388         (WebCore::WHLSL::Visitor::visit):
1389
1390 2019-07-19  Youenn Fablet  <youenn@apple.com>
1391
1392         Remote WebInspector should enable mock capture devices in UIProcess if doing it in WebProcess
1393         https://bugs.webkit.org/show_bug.cgi?id=199924
1394         <rdar://problem/50552067>
1395
1396         Reviewed by Devin Rousso.
1397
1398         Add necessary API to set mock capture devices override.
1399         In case of desynchronization between webprocess and uiprocess, make sure to return early
1400         and fail capture instead of crashing.
1401
1402         * inspector/InspectorClient.h:
1403         (WebCore::InspectorClient::setMockCaptureDevicesEnabled):
1404         * inspector/agents/InspectorPageAgent.cpp:
1405         (WebCore::InspectorPageAgent::disable):
1406         (WebCore::InspectorPageAgent::overrideSetting):
1407         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1408
1409 2019-07-19  Andy Estes  <aestes@apple.com>
1410
1411         [Apple Pay] Log less in PaymentCoordinator::shouldEnableApplePayAPIs()
1412         https://bugs.webkit.org/show_bug.cgi?id=199958
1413
1414         Reviewed by Tim Horton.
1415
1416         Only log when APIs are disabled due to user scripts.
1417
1418         * Modules/applepay/PaymentCoordinator.cpp:
1419         (WebCore::PaymentCoordinator::shouldEnableApplePayAPIs const):
1420
1421 2019-07-19  Dean Jackson  <dino@apple.com>
1422
1423         Add a menu item to toggle between showing and hiding link previews
1424         https://bugs.webkit.org/show_bug.cgi?id=199940
1425         <rdar://problem/53032288>
1426
1427         Reviewed by Beth Dakin.
1428
1429         New strings for Show/Hide Link Previews.
1430
1431         * en.lproj/Localizable.strings:
1432
1433 2019-07-19  Antoine Quint  <graouts@apple.com>
1434
1435         Links stop working after long-pressing a link (WK1)
1436         https://bugs.webkit.org/show_bug.cgi?id=199952
1437         <rdar://problem/52291860>
1438
1439         Reviewed by Wenson Hsieh.
1440
1441         Test: fast/events/touch/ios/click-after-long-press.html
1442
1443         When EventHandler::tryToBeginDragAtPoint() is called, we must reset m_mousePressed to false so that
1444         WebChromeClientIOS::observedContentChange() is called by EventHandler::mousePressed() when we would
1445         process the next tap after a drag interaction.
1446
1447         * page/ios/EventHandlerIOS.mm:
1448         (WebCore::EventHandler::tryToBeginDragAtPoint):
1449
1450 2019-07-19  Sihui Liu  <sihui_liu@apple.com>
1451
1452         IndexedDB: error in starting version change transaction may be neglected
1453         https://bugs.webkit.org/show_bug.cgi?id=199818
1454         <rdar://problem/52925738>
1455
1456         Reviewed by Brady Eidson.
1457
1458         For version change transaction, IDBServer didn't wait the result of beginTransaction on the background thread 
1459         before giving the IDBClient the result of open request. In this case, beginTransaction may fail to update the 
1460         DatabaseVersion in database file or set m_originalDatabaseInfoBeforeVersionChange, but the transaction was
1461         marked as started. When we later set m_databaseInfo with m_originalDatabaseInfoBeforeVersionChange, 
1462         m_databaseInfo could become nullptr.
1463
1464         To write a test for this, we will need to simulate an SQLite error. I manually tested this by crafting the 
1465         SQLiteStatement in beginTransaction, making it an invalid statement, and verified that error event, instead of 
1466         ungradeneeded event is dispatched to the IDBRequest.
1467
1468         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1469         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
1470         (WebCore::IDBServer::UniqueIDBDatabase::performStartVersionChangeTransaction):
1471         (WebCore::IDBServer::UniqueIDBDatabase::didPerformStartVersionChangeTransaction):
1472         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
1473         (WebCore::IDBServer::UniqueIDBDatabase::beginTransactionInBackingStore): Deleted.
1474         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1475
1476 2019-07-19  Zalan Bujtas  <zalan@apple.com>
1477
1478         [LFC][IFC] Add partial content handling
1479         https://bugs.webkit.org/show_bug.cgi?id=199930
1480
1481         Reviewed by Antti Koivisto.
1482
1483         Move the actual inline item placement to a dedicated functions. This enables us to
1484         construct a dedicated InlineItem for the partial content and pass it in to this function.
1485
1486         <span>The quick brown fox jumps over the lazy dog</span> <- inline content
1487         [The][ ][quick][ ][brown][ ][fox][ ][jumps][ ][over][ ][the][ ][lazy][ ][dog] <- InlineItems
1488
1489         Line breaking:
1490         [The][ ][qu]
1491         [ick] <- Partial InlineItem (position: 6 length: 3) from [quick] (position: 4 length: 5)
1492
1493         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1494         (WebCore::Layout::LineLayout::close):
1495         (WebCore::Layout::LineLayout::placeInlineItem):
1496         (WebCore::Layout::LineLayout::layout):
1497         (WebCore::Layout::LineInput::LineInput):
1498         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
1499         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
1500         * layout/inlineformatting/InlineTextItem.cpp:
1501         (WebCore::Layout::InlineTextItem::split):
1502         * layout/inlineformatting/InlineTextItem.h:
1503
1504 2019-07-19  Charlie Turner  <cturner@igalia.com>
1505
1506         [GStreamer] Flush get_range calls during PAUSED->READY in WebKitWebSource
1507         https://bugs.webkit.org/show_bug.cgi?id=199934
1508
1509         Reviewed by Xabier Rodriguez-Calvar.
1510
1511         Unit testing not applicable.
1512
1513         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1514         (webKitWebSrcChangeState): A well-behaved element should unblock streaming threads
1515         during a PAUSED->READY transition, so do that here.
1516
1517 2019-07-19  Rob Buis  <rbuis@igalia.com>
1518
1519         Remove some unneeded code in MathOperator
1520         https://bugs.webkit.org/show_bug.cgi?id=199935
1521
1522         Reviewed by Frédéric Wang.
1523
1524         The initialize method is unneeded since the member
1525         variables all use default initialization.
1526
1527         No new tests, not changing behavior.
1528
1529         * rendering/mathml/MathOperator.cpp:
1530         (WebCore::MathOperator::MathOperator):
1531         (WebCore::MathOperator::GlyphAssemblyData::initialize): Deleted.
1532
1533 2019-07-18  Antoine Quint  <graouts@apple.com>
1534
1535         Enable simulated mouse events quirk for soundcloud.com
1536         https://bugs.webkit.org/show_bug.cgi?id=199908
1537         <rdar://problem/52915981>
1538
1539         Reviewed by Brent Fulgham.
1540
1541         Scrubbing on soundcloud.com relies on mouse events alone when displaying on iPad with the desktop UA string.
1542         Opting into the simulated mouse events quirk makes scrubbing work and we also ensure that page scrolling is
1543         disabled as a result of scrubbing by returning true in shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented().
1544
1545         Also making a drive-by fix in shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented() to use a reference
1546         instead of a pointer when downcasting a null-checked pointer.
1547
1548         * page/Quirks.cpp:
1549         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
1550         (WebCore::Quirks::shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented const):
1551
1552 2019-07-18  Per Arne Vollan  <pvollan@apple.com>
1553
1554         Prewarm font cache with more fonts
1555         https://bugs.webkit.org/show_bug.cgi?id=199283
1556
1557         Reviewed by Myles C. Maxfield.
1558
1559         Initialize the list of families requiring system fallback in the prewarming information struct, since
1560         this was part of the original, approved patch, and is needed for the performance improvement.
1561
1562         No new tests, covered by existing tests.
1563
1564         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1565         (WebCore::fontFamiliesForPrewarming):
1566         (WebCore::FontCache::prewarmGlobally):
1567
1568 2019-07-18  Ryan Haddad  <ryanhaddad@apple.com>
1569
1570         Unreviewed, rolling out r247531.
1571
1572         Caused multiple IndexedDB layout test crashes.
1573
1574         Reverted changeset:
1575
1576         "IndexedDB: error in starting version change transaction may
1577         be neglected"
1578         https://bugs.webkit.org/show_bug.cgi?id=199818
1579         https://trac.webkit.org/changeset/247531
1580
1581 2019-07-18  Antoine Quint  <graouts@apple.com>
1582
1583         Ensure Quirks::shouldDispatchSimulatedMouseEvents() works for all Google Maps and Amazon domains
1584         https://bugs.webkit.org/show_bug.cgi?id=199904
1585         <rdar://problem/53250104>
1586
1587         Reviewed by Dean Jackson.
1588
1589         Use topPrivatelyControlledDomain() to determine whether the URL is a Google or Amazon domain so as to apply
1590         Google Maps and Amazon quirks to all the various domain names used.
1591
1592         * page/Quirks.cpp:
1593         (WebCore::Quirks::isAmazon const):
1594         (WebCore::Quirks::isGoogleMaps const):
1595         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
1596         (WebCore::Quirks::simulatedMouseEventTypeForTarget const):
1597         * page/Quirks.h:
1598
1599 2019-07-18  Per Arne Vollan  <pvollan@apple.com>
1600
1601         Crash under WebPage::boundaryEventOccurred
1602         https://bugs.webkit.org/show_bug.cgi?id=199907
1603
1604         Reviewed by Chris Fleizach.
1605
1606         Add null pointer checks.
1607
1608         No new tests, since I have not been able to reproduce this in a test.
1609
1610         * Modules/speech/SpeechSynthesis.cpp:
1611         (WebCore::SpeechSynthesis::didStartSpeaking):
1612         (WebCore::SpeechSynthesis::didFinishSpeaking):
1613         (WebCore::SpeechSynthesis::didPauseSpeaking):
1614         (WebCore::SpeechSynthesis::didResumeSpeaking):
1615         (WebCore::SpeechSynthesis::speakingErrorOccurred):
1616         (WebCore::SpeechSynthesis::boundaryEventOccurred):
1617
1618 2019-07-18  Antoine Quint  <graouts@apple.com>
1619
1620         [Pointer Events] The button and buttons properties are incorrect on iOS
1621         https://bugs.webkit.org/show_bug.cgi?id=199910
1622         <rdar://problem/52778374>
1623
1624         Reviewed by Dean Jackson.
1625
1626         The button and buttons properties were always set to 0 on iOS. We now use the correct values such that
1627         button is always 0 except for "pointermove" where it's -1, and "buttons" is 1 as long as the pointer is
1628         in contact with the touch surface.
1629
1630         Tests: pointerevents/ios/pointer-event-button-and-buttons-pointer-cancel.html
1631                pointerevents/ios/pointer-event-button-and-buttons.html
1632
1633         * dom/ios/PointerEventIOS.cpp:
1634         (WebCore::buttonForType):
1635         (WebCore::buttonsForType):
1636         (WebCore::PointerEvent::PointerEvent):
1637
1638 2019-07-18  Antoine Quint  <graouts@apple.com>
1639
1640         REGRESSION: Unable to enable simulated mouse events using the runtime flag
1641         https://bugs.webkit.org/show_bug.cgi?id=199909
1642         <rdar://problem/53254895>
1643
1644         Reviewed by Dean Jackson.
1645
1646         The fix for wkb.ug/199508 (r247152) broke the ability enable simulated mouse events using the runtime flag.
1647         We now add a check for the flag in Quirks::shouldDispatchSimulatedMouseEvents() so that the runtime flag
1648         overrides the content of that function. This is more practical and allows for a quick override using the flag.
1649
1650         Additionally, we need only call shouldDispatchSimulatedMouseEvents() in simulatedMouseEventTypeForTarget() since
1651         that function already calls needsQuirks().
1652
1653         * dom/EventNames.h:
1654         (WebCore::EventNames::isTouchRelatedEventType const):
1655         * dom/Node.cpp:
1656         (WebCore::Node::moveNodeToNewDocument):
1657         * page/Quirks.cpp:
1658         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
1659         (WebCore::Quirks::simulatedMouseEventTypeForTarget const):
1660
1661 2019-07-18  Antoine Quint  <graouts@apple.com>
1662
1663         REGRESSION: Panning on an Amazon product image scrolls the page on iPadOS
1664         https://bugs.webkit.org/show_bug.cgi?id=199905
1665         <rdar://problem/49124529>
1666
1667         Reviewed by Dean Jackson.
1668
1669         Amazon product pages include images that the user can touch and pan to show zoomed details in a side image. This
1670         currently works on iPadOS thanks to the dispatch of simulated "mousemove" events on the product image, but the site
1671         doesn't call preventDefault() when handling those events as it wasn't necessary for macOS.
1672
1673         We add a new quirk that will indicate that a given element is such a product image.
1674
1675         * page/Quirks.cpp:
1676         (WebCore::Quirks::isAmazon const):
1677         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
1678         (WebCore::Quirks::shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented const):
1679         (WebCore::Quirks::simulatedMouseEventTypeForTarget const):
1680         * page/Quirks.h:
1681
1682 2019-07-18  Youenn Fablet  <youenn@apple.com>
1683
1684         Make sure to set kCTFontFallbackOptionAttribute to kCTFontFallbackOptionSystem for system fonts
1685         https://bugs.webkit.org/show_bug.cgi?id=199769
1686         <rdar://problem/49390297>
1687
1688         Reviewed by Myles C. Maxfield.
1689
1690         When getting a system font, set the appropriate attribute so that it
1691         does not fallback to a user initiated font.
1692         Add an ASSERT that checks that the font in use is not a user font if
1693         policy is to not use user installed fonts.
1694
1695         Tests: fast/text/user-installed-fonts/extended-character-with-user-font.html
1696                fast/text/user-installed-fonts/extended-character.html
1697
1698         * platform/graphics/Font.h:
1699         * platform/graphics/FontCascadeFonts.cpp:
1700         (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
1701         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1702         (WebCore::preparePlatformFont):
1703         (WebCore::FontDatabase::singletonAllowingUserInstalledFonts):
1704         (WebCore::FontDatabase::singletonDisallowingUserInstalledFonts):
1705         (WebCore::addAttributesForInstalledFonts):
1706         (WebCore::addAttributesForWebFonts):
1707         (WebCore::installedFontMandatoryAttributes):
1708         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
1709         (WebCore::Font::isUserInstalledFont const):
1710
1711 2019-07-18  Zalan Bujtas  <zalan@apple.com>
1712
1713         [LFC][IFC] InlineFormattingContext::LineLayout::placeInlineItems is getting too complex.
1714         https://bugs.webkit.org/show_bug.cgi?id=199898
1715         <rdar://problem/53235958>
1716
1717         Reviewed by Antti Koivisto.
1718
1719         It's time to restructure LineLayout::placeInlineItems to be able to expand it further.
1720         Introduce the LineLayout class. This class is responsible to place the inline items on the current line.
1721         (Rename InlineFormattingContext::lineLayout -> InlineFormattingContext::InlineLayout and
1722         use Line::InitialConstraints in LineInput)
1723
1724         * layout/inlineformatting/InlineFormattingContext.cpp:
1725         (WebCore::Layout::InlineFormattingContext::layout const):
1726         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
1727         * layout/inlineformatting/InlineFormattingContext.h:
1728         (WebCore::Layout::InlineFormattingContext::LineLayout::layoutState const): Deleted.
1729         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1730         (WebCore::Layout::inlineItemWidth):
1731         (WebCore::Layout::LineLayout::layoutState const):
1732         (WebCore::Layout::LineLayout::UncommittedContent::runs):
1733         (WebCore::Layout::LineLayout::UncommittedContent::isEmpty const):
1734         (WebCore::Layout::LineLayout::UncommittedContent::size const):
1735         (WebCore::Layout::LineLayout::UncommittedContent::width const):
1736         (WebCore::Layout::LineLayout::UncommittedContent::add):
1737         (WebCore::Layout::LineLayout::UncommittedContent::reset):
1738         (WebCore::Layout::LineLayout::LineLayout):
1739         (WebCore::Layout::LineLayout::commitPendingContent):
1740         (WebCore::Layout::LineLayout::close):
1741         (WebCore::Layout::LineLayout::layout):
1742         (WebCore::Layout::LineInput::LineInput):
1743         (WebCore::Layout::InlineFormattingContext::InlineLayout::InlineLayout):
1744         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
1745         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
1746         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
1747         (WebCore::Layout::InlineFormattingContext::InlineLayout::alignRuns const):
1748         (WebCore::Layout::UncommittedContent::runs): Deleted.
1749         (WebCore::Layout::UncommittedContent::isEmpty const): Deleted.
1750         (WebCore::Layout::UncommittedContent::size const): Deleted.
1751         (WebCore::Layout::UncommittedContent::width const): Deleted.
1752         (WebCore::Layout::UncommittedContent::add): Deleted.
1753         (WebCore::Layout::UncommittedContent::reset): Deleted.
1754         (WebCore::Layout::LineInput::HorizontalConstraint::HorizontalConstraint): Deleted.
1755         (WebCore::Layout::InlineFormattingContext::LineLayout::LineLayout): Deleted.
1756         (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const): Deleted.
1757         (WebCore::Layout::InlineFormattingContext::LineLayout::layout const): Deleted.
1758         (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const): Deleted.
1759         (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const): Deleted.
1760         (WebCore::Layout::InlineFormattingContext::LineLayout::alignRuns const): Deleted.
1761         * layout/inlineformatting/InlineLine.cpp:
1762         (WebCore::Layout::Line::Line):
1763         * layout/inlineformatting/InlineLine.h:
1764
1765 2019-07-18  Carlos Garcia Campos  <cgarcia@igalia.com>
1766
1767         [GTK] MOUSE_CURSOR_SCALE is not implemented
1768         https://bugs.webkit.org/show_bug.cgi?id=109469
1769
1770         Reviewed by Darin Adler.
1771
1772         Use gdk_cursor_new_from_surface() instead of gdk_cursor_new_from_pixbuf() to avoid the surface to pixbuf
1773         conversion.
1774
1775         * platform/gtk/CursorGtk.cpp:
1776         (WebCore::createCustomCursor):
1777
1778 2019-07-17  Chris Dumez  <cdumez@apple.com>
1779
1780         Prewarm local storage in the NetworkProcess to reduce WebContent process hangs
1781         https://bugs.webkit.org/show_bug.cgi?id=199879
1782         <rdar://problem/53217757>
1783
1784         Reviewed by Ryosuke Niwa.
1785
1786         When JS accesses window.localStorage for the first time, we end up doing a
1787         synchronous IPC to the network process to pull in all items in the local
1788         storage for the origin. If the network process does not have this data in
1789         memory, it has to read it from a database on disk, which may take a significant
1790         amount of time and hang the WebContent process during this time.
1791
1792         To alleviate this problem, this patch introduces prewarming on the local storage
1793         in the network process when loading a given origin in the WebContent process.
1794         This way, in most cases, when the JS accesses window.localStorage for the first
1795         time, the synchronous IPC to the network process returns much faster (measured
1796         50-100ms for a very large database, down from 250-300ms), as it only needs to
1797         IPC the data over, without the need to fetch it from disk.
1798
1799         As a safety net to avoid excessive prewarming, we currently prewarm at most 5
1800         security origins per page load.
1801
1802         * loader/DocumentLoader.cpp:
1803         (WebCore::DocumentLoader::commitData):
1804         * page/DOMWindow.cpp:
1805         (WebCore::DOMWindow::prewarmLocalStorageIfNecessary):
1806         * page/DOMWindow.h:
1807         * page/Frame.cpp:
1808         (WebCore::Frame::didPrewarmLocalStorage):
1809         (WebCore::Frame::mayPrewarmLocalStorage const):
1810         * page/Frame.h:
1811         * storage/Storage.cpp:
1812         (WebCore::Storage::prewarm):
1813         * storage/Storage.h:
1814         * storage/StorageArea.h:
1815         (WebCore::StorageArea::prewarm):
1816
1817 2019-07-17  Robin Morisset  <rmorisset@apple.com>
1818
1819         [WHLSL] The lexer should not choke on a single '/'
1820         https://bugs.webkit.org/show_bug.cgi?id=199886
1821
1822         Reviewed by Myles Maxfield.
1823
1824         The bug is trivial: just recognize that a single '/' without a '*' or '/' afterwards is not the beginning of a comment.
1825
1826         While investigating this bug, I also found that part of the parser fails to properly propagate errors, so I fixed it.
1827
1828         New test in LayoutTests/webgpu/whlsl/float-math.html
1829         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).
1830
1831         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
1832         (WebCore::WHLSL::Lexer::skipWhitespaceAndComments):
1833         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
1834         (WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
1835         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
1836         (WebCore::WHLSL::prepareShared):
1837         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
1838         (WebCore::WHLSL::includeStandardLibrary):
1839         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.h:
1840
1841 2019-07-17  Simon Fraser  <simon.fraser@apple.com>
1842
1843         Unreviewed build fix after r247549.
1844
1845         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
1846
1847 2019-07-17  Robin Morisset  <rmorisset@apple.com>
1848
1849         [WHLSL] Remove traps from the compiler
1850         https://bugs.webkit.org/show_bug.cgi?id=195811
1851         <rdar://problem/50746299>
1852
1853         Reviewed by Myles Maxfield.
1854
1855         Remove the Trap statement from the language, see https://github.com/gpuweb/WHLSL/issues/301.
1856
1857         No new tests, as this part of the language was already untested, and we are removing it, not adding anything.
1858
1859         * Modules/webgpu/WHLSL/AST/WHLSLAST.h:
1860         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
1861         (WebCore::WHLSL::AST::Statement::isSwitchStatement const):
1862         * Modules/webgpu/WHLSL/AST/WHLSLTrap.h: Removed.
1863         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
1864         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
1865         * Modules/webgpu/WHLSL/WHLSLASTDumper.h:
1866         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
1867         (WebCore::WHLSL::Token::typeName):
1868         (WebCore::WHLSL::Lexer::recognizeKeyword):
1869         * Modules/webgpu/WHLSL/WHLSLLexer.h:
1870         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
1871         (WebCore::WHLSL::Parser::parseStatement):
1872         * Modules/webgpu/WHLSL/WHLSLParser.h:
1873         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp:
1874         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
1875         (WebCore::WHLSL::Visitor::visit):
1876         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
1877         * WebCore.xcodeproj/project.pbxproj:
1878
1879 2019-07-17  Robin Morisset  <rmorisset@apple.com>
1880
1881         [WHLSL] checkRecursiveType should not have exponential complexity.
1882         https://bugs.webkit.org/show_bug.cgi?id=199835
1883
1884         Reviewed by Myles Maxfield.
1885
1886         The change is very similar to that in https://bugs.webkit.org/show_bug.cgi?id=199688.
1887         Just keep track of which types have already been visited, and don't visit them again.
1888
1889         No new tests as there is no intended functional change.
1890
1891         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
1892         (WebCore::WHLSL::RecursiveTypeChecker::visit):
1893         (WebCore::WHLSL::checkRecursiveTypes):
1894
1895 2019-07-17  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
1896
1897         Add missing #include's
1898         https://bugs.webkit.org/show_bug.cgi?id=199856
1899
1900         Reviewed by Simon Fraser.
1901
1902         The missing headers were found during development when unified sources changed.
1903
1904         No new tests required. Adding #include's only.
1905
1906         * Modules/speech/DOMWindowSpeechSynthesis.cpp:
1907         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp:
1908         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
1909         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
1910         * Modules/webgpu/WebGPUCommandEncoder.cpp:
1911
1912 2019-07-17  Ryosuke Niwa  <rniwa@webkit.org>
1913
1914         Add inputmode to the feature status page
1915         https://bugs.webkit.org/show_bug.cgi?id=199884
1916
1917         Reviewed by Wenson Hsieh.
1918
1919         Added as supported.
1920
1921         * features.json:
1922
1923 2019-07-17  Antoine Quint  <graouts@apple.com>
1924
1925         Disable Pointer Events prior to watchOS 6
1926         https://bugs.webkit.org/show_bug.cgi?id=199890
1927         <rdar://problem/53206113>
1928
1929         Reviewed by Dean Jackson.
1930
1931         * Configurations/FeatureDefines.xcconfig:
1932
1933 2019-07-17  Antoine Quint  <graouts@apple.com>
1934
1935         Unable to bring up custom media controls on iOS for video.sina.cn
1936         https://bugs.webkit.org/show_bug.cgi?id=199889
1937         <rdar://problem/51883919>
1938
1939         Reviewed by Dean Jackson.
1940
1941         Videos on video.sina.cn by default have the "controls" attribute and are set not to autoplay. This means that the original state
1942         of the media controls are set to show the built-in media controls and also show the prominent play button to begin playback. The
1943         display of the play button also requires a tap gesture recognizer, which calls preventDefault() when the "touchend" is received
1944         to prevent double-tap-to-zoom, but also has the side-effect of preventing a "click" event from being dispatched for a tap.
1945
1946         The video.sina.cn code would eventually remove the "controls" attribute, which would make the built-in media controls not visible,
1947         but still participate in hit-testing because we keep the shadow DOM around in order to potentially show the Airplay or picture-in-picture
1948         placards. Additionally, we wouldn't disable the tap gesture recognizer when the "controls" attribute was removed.
1949
1950         We now ensure that both gesture recognizers used by iOS inline media controls are only enabled when media controls are visible.
1951
1952         Test: media/modern-media-controls/media-controller/ios/media-controller-allows-click-over-video-with-no-controls.html
1953
1954         * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
1955         (IOSInlineMediaControls.prototype.set showsStartButton):
1956         (IOSInlineMediaControls.prototype.get visible):
1957         (IOSInlineMediaControls.prototype.set visible):
1958         (IOSInlineMediaControls.prototype._updateGestureRecognizers):
1959         (IOSInlineMediaControls.prototype._tapGestureRecognizerStateDidChange):
1960         (IOSInlineMediaControls.prototype._pinchGestureRecognizerStateDidChange):
1961
1962 2019-07-17  Christopher Reid  <chris.reid@sony.com>
1963
1964         Bytecode cache should use FileSystem
1965         https://bugs.webkit.org/show_bug.cgi?id=199759
1966
1967         Reviewed by Yusuke Suzuki.
1968
1969         * platform/SharedBuffer.cpp:
1970
1971 2019-07-17  Zalan Bujtas  <zalan@apple.com>
1972
1973         Unable to tap buttons at top of Wells Fargo app’s Payees screen
1974         https://bugs.webkit.org/show_bug.cgi?id=199846
1975         <rdar://problem/48112220>
1976
1977         Reviewed by Simon Fraser.
1978
1979         This patch restores the stop-before-reaching-the-body heuristics for the approximate node finding feature only.
1980         (WebFrame::approximateNodeAtViewportLocation mistakenly relied on this odd quirk of nodeRespondingToClickEvents.)
1981
1982         * page/Frame.h:
1983         * page/ios/FrameIOS.mm:
1984         (WebCore::Frame::approximateNodeAtViewportLocationLegacy):
1985
1986 2019-07-17  Simon Fraser  <simon.fraser@apple.com>
1987
1988         [iOS WK2] Avoid lots of compositing backing store for offscreen position:fixed descendants
1989         https://bugs.webkit.org/show_bug.cgi?id=199819
1990         rdar://problem/51977416
1991
1992         Reviewed by Zalan Bujtas.
1993
1994         There was code to ensure that position:fixed layers and their descendants don't have their
1995         backing store detached (thrown away to save memory when offscreen), since that can trigger
1996         flashing when async scrolling moves layers in and out of the visual viewport.
1997
1998         However, some pages have many descendant layers of positon:fixed which entrain backing
1999         store, because, for example, they have a stack of translated-offscreen menu elements inside
2000         a fixed header, and those elements may composite because of overflow:scroll.
2001
2002         To avoid using too much memory on such pages, allow backing store detachment for fixed
2003         layers that are outside the layout viewport. Add a flag to RenderLayer that's set for layers
2004         which are fixed, or descendants of fixed, and consult that flag in
2005         updateAllowsBackingStoreDetaching(). The logic there is similar to
2006         RenderLayerCompositor::requiresCompositingForPosition().
2007         
2008         I considered allowing all position:fixed to composite (since this patch would keep most of
2009         the memory saving), but historically we've avoided compositing out-of-viewport
2010         position:fixed because it's quite common to have them with negative z-index, and compositing
2011         those has significant compositing knock-on effects.
2012         
2013         GraphicsLayer flushing no longer needs to track the viewport-constrained status of layers,
2014         so remove that code.
2015         
2016         This patch removes backing-store pinning for sticky layers.
2017         scrolling/ios/reconcile-layer-position-recursive.html then revealed a bug in
2018         ScrollingStateStickyNode::reconcileLayerPositionForViewportRect(), which was assuming that
2019         the sticky element was scrolled by the page, causing a bad layer position to get sync'd onto
2020         the layer. Fixed by copying code from ScrollingTreeStickyNode that is smarter about
2021         computing layer positions.
2022         
2023         This patch fixes jetsams on kmart.com.au in iOS 13 beta.
2024
2025         Test: compositing/layer-creation/fixed-position-descendants-out-of-view.html
2026
2027         * page/scrolling/ScrollingStateStickyNode.cpp:
2028         (WebCore::ScrollingStateStickyNode::computeLayerPosition const):
2029         (WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect):
2030         * page/scrolling/ScrollingStateStickyNode.h:
2031         * platform/graphics/GraphicsLayer.h:
2032         (WebCore::GraphicsLayer::setAllowsBackingStoreDetaching):
2033         (WebCore::GraphicsLayer::allowsBackingStoreDetaching const):
2034         (WebCore::GraphicsLayer::setIsViewportConstrained): Deleted.
2035         (WebCore::GraphicsLayer::isViewportConstrained const): Deleted.
2036         (WebCore::GraphicsLayer::setCanDetachBackingStore): Deleted.
2037         (WebCore::GraphicsLayer::canDetachBackingStore const): Deleted.
2038         * platform/graphics/ca/GraphicsLayerCA.cpp:
2039         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
2040         (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
2041         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
2042         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2043         (WebCore::GraphicsLayerCA::updateCoverage):
2044         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2045         * platform/graphics/ca/GraphicsLayerCA.h:
2046         * rendering/RenderLayer.cpp:
2047         (WebCore::RenderLayer::RenderLayer):
2048         (WebCore::RenderLayer::updateLayerPositions):
2049         (WebCore::outputPaintOrderTreeLegend):
2050         (WebCore::outputPaintOrderTreeRecursive):
2051         * rendering/RenderLayer.h:
2052         * rendering/RenderLayerBacking.cpp:
2053         (WebCore::RenderLayerBacking::updateAllowsBackingStoreDetaching):
2054         (WebCore::RenderLayerBacking::updateOverflowControlsLayers):
2055         (WebCore::RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole): Deleted.
2056         * rendering/RenderLayerBacking.h:
2057         * rendering/RenderLayerCompositor.cpp:
2058         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2059         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
2060         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
2061         (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
2062
2063 2019-07-17  Chris Dumez  <cdumez@apple.com>
2064
2065         Avoid unnecessary copy of monitors under DisplayRefreshMonitorManager::displayWasUpdated()
2066         https://bugs.webkit.org/show_bug.cgi?id=199847
2067
2068         Reviewed by Said Abou-Hallawa.
2069
2070         There is always one one monitor in m_monitors for a given displayID so there is
2071         no need to copy the monitors inside DisplayRefreshMonitorManager::displayWasUpdated()
2072         and no need to iterate over all of them. This patch also factors a bit differently
2073         so that it becomes more obvious.
2074
2075         * platform/graphics/DisplayRefreshMonitorManager.cpp:
2076         (WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
2077         (WebCore::DisplayRefreshMonitorManager::unregisterClient):
2078         (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
2079         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
2080         (WebCore::DisplayRefreshMonitorManager::findMonitorForDisplay const):
2081         (WebCore::DisplayRefreshMonitorManager::monitorForDisplay const):
2082         * platform/graphics/DisplayRefreshMonitorManager.h:
2083
2084 2019-07-17  Sihui Liu  <sihui_liu@apple.com>
2085
2086         IndexedDB: error in starting version change transaction may be neglected
2087         https://bugs.webkit.org/show_bug.cgi?id=199818
2088         <rdar://problem/52925738>
2089
2090         Reviewed by Brady Eidson.
2091
2092         For version change transaction, IDBServer didn't wait the result of beginTransaction on the background thread 
2093         before giving the IDBClient the result of open request. In this case, beginTransaction may fail to update the 
2094         DatabaseVersion in database file or set m_originalDatabaseInfoBeforeVersionChange, but the transaction was
2095         marked as started. When we later set m_databaseInfo with m_originalDatabaseInfoBeforeVersionChange, 
2096         m_databaseInfo could become nullptr.
2097
2098         To write a test for this, we will need to simulate an SQLite error. I manually tested this by crafting the 
2099         SQLiteStatement in beginTransaction, making it an invalid statement, and verified that error event, instead of 
2100         ungradeneeded event is dispatched to the IDBRequest.
2101
2102         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2103         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
2104         (WebCore::IDBServer::UniqueIDBDatabase::performStartVersionChangeTransaction):
2105         (WebCore::IDBServer::UniqueIDBDatabase::didPerformStartVersionChangeTransaction):
2106         (WebCore::IDBServer::UniqueIDBDatabase::beginTransactionInBackingStore): Deleted.
2107         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2108
2109 2019-07-17  Daniel Bates  <dabates@apple.com>
2110
2111         Typing into a cell in a Google Sheet lags behind by one character
2112         https://bugs.webkit.org/show_bug.cgi?id=199587
2113         <rdar://problem/51616845>
2114
2115         Reviewed by Brent Fulgham.
2116
2117         Add a Google Sheets quirk. Put all DOM timers scheduled from keydown and keypress event listeners
2118         into a holding tank. The timers continue to tick, but are barred from executing their action until
2119         the next text insertion or deletion or 32 ms (on device) have elapsed, whichever is sooner. We only
2120         allocate a holding tank once per document, only if the quirk is active, and this allocation is done
2121         when the document schedules a timer on keydown or keypress. The holding tank lives for the lifetime
2122         of the document.
2123
2124         The story behind the quirk:
2125
2126         On keypress Google Sheets schedules timers and expects that a DOM update will occur (i.e. text
2127         will be inserted or deleted) within the same event loop iteration as the dispatched keypress. The
2128         UI Events spec. [1] makes no such guarantee of when a DOM update must occur in relation to the keypress
2129         event. It could happen in the same event loop iteration as the key press (as Google expects), the
2130         next iteration, 500ms later, 2 minutes later, etc. What the spec does guarantee is that by the time
2131         a DOM input event is dispatched that the DOM will be updated. And this is the solution to the problem
2132         Google Sheets is trying to solve, but is doing so using pre-IE 9 technology (though similar
2133         functionality was available via onpropertychange in IE < 9).
2134
2135         See also <https://github.com/w3c/uievents/issues/238>, which is tracking a spec. text update for
2136         this quirk.
2137
2138         Test: fast/events/ios/dom-update-on-keydown-quirk.html
2139
2140         [1] <https://w3c.github.io/uievents/> (Editor's Draft, 14 October 2018)
2141
2142         * SourcesCocoa.txt:
2143         * WebCore.xcodeproj/project.pbxproj:
2144         Add some files to the project.
2145
2146         * dom/Document.cpp:
2147         (WebCore::Document::domTimerHoldingTank): Added.
2148         * dom/Document.h:
2149         (WebCore::Document::domTimerHoldingTankIfExists): Added.
2150
2151         * page/DOMTimer.cpp:
2152         (WebCore::DOMTimer::install): Put the newly instantiated timer into the holding tank.
2153         (WebCore::DOMTimer::removeById): Remove the timer from the holding tank.
2154         (WebCore::DOMTimer::fired): Check if the timer is in the holding tank. If it is and it is a one-
2155         shot timer then schedule it for the next event loop iteration. If it's a repeating timer just
2156         let it continue ticking. Otherwise, do what we no now and execute the timer's action. The reason
2157         we do not suspend timers in the holding tank is because:
2158             1. Far out timers (Google Sheets registers timers as far out as 5 minutes!) are not penalized.
2159             Though smart supension logic could avoid this. See (3).
2160
2161             2. Empirical observations indicate that the keyboard will perform the insertion or deletion
2162             reasonably quickly (not the same event loop iteration as the keydown, but within two iterations out).
2163             So, the timers in the holding tank are short-lived.
2164
2165             3. Simplifies the code. There is no need to keep additional bookkeeping to track multiple timer
2166             suspension reasons (timers currently can only have one suspension reason) or alternatively defer
2167             scheduling a timer until a later time and computing a new "fair" firing time when scheduled.
2168         * page/EventHandler.cpp:
2169         (WebCore::EventHandler::internalKeyEvent): Place a token on the stack to put all DOM timers
2170         scheduled on keydown and keypress into the holding tank if the quirk is enabled.
2171         * page/Quirks.cpp:
2172         (WebCore::Quirks::needsDeferKeyDownAndKeyPressTimersUntilNextEditingCommand const): Added.
2173         * page/Quirks.h:
2174         * page/Settings.yaml: Added setting so that this quirk can be enabled from a layout test. This setting
2175         also lets us enable the quirk for all sites or for certain third-party apps if desired.
2176         * page/ios/DOMTimerHoldingTank.cpp: Added.
2177         (WebCore::DOMTimerHoldingTank::DOMTimerHoldingTank):
2178         (WebCore::DOMTimerHoldingTank::add):
2179         (WebCore::DOMTimerHoldingTank::remove):
2180         (WebCore::DOMTimerHoldingTank::contains):
2181         (WebCore::DOMTimerHoldingTank::removeAll):
2182         (WebCore::DOMTimerHoldingTank::stopExceededMaximumHoldTimer):
2183         * page/ios/DOMTimerHoldingTank.h: Added.
2184         (WebCore::DeferDOMTimersForScope::DeferDOMTimersForScope):
2185         (WebCore::DeferDOMTimersForScope::~DeferDOMTimersForScope):
2186         (WebCore::DeferDOMTimersForScope::isDeferring):
2187
2188 2019-07-17  Darin Adler  <darin@apple.com>
2189
2190         No need for isURLAllowed function in Frame
2191         https://bugs.webkit.org/show_bug.cgi?id=120266
2192
2193         Reviewed by Alex Christensen.
2194
2195         * css/SelectorCheckerTestFunctions.h:
2196         (WebCore::matchesFullScreenPseudoClass): Use is<> instead of
2197         the isFrameElementBase function. Also updated includes and spacing.
2198
2199         * dom/Document.cpp:
2200         (WebCore::Document::resolveStyle): Shortened an old, long comment
2201         that happened to mention HTMLFrameElementBase::isURLAllowed by name.
2202
2203         * dom/Element.h: Deleted isFrameElementBase.
2204
2205         * html/HTMLAppletElement.cpp:
2206         (WebCore::HTMLAppletElement::updateWidget): Tweaked comment.
2207
2208         * html/HTMLBodyElement.cpp:
2209         (WebCore::HTMLBodyElement::insertedIntoAncestor): Moved comment from
2210         here to didFinishInsertingNode, since the code it's talking about is there.
2211         Also got rid of unnecessary local variable.
2212         (WebCore::HTMLBodyElement::didFinishInsertingNode): Moved comment here
2213         and elaborated a bit. Also changed the code to copy margin attributes in a
2214         simpler way without requiring special getter functions. There is a slight
2215         behavior change here, but seems unlikely to affect any websites or tests.
2216         Would be good to add better test coverage, which I think should be done
2217         when fixing the problems described in the FIXME.
2218
2219         * html/HTMLEmbedElement.cpp:
2220         (WebCore::HTMLEmbedElement::updateWidget): allowedToLoadFrameURL -> canLoadURL
2221         Also Tweaked comments.
2222
2223         * html/HTMLFrameElement.cpp:
2224         (WebCore::HTMLFrameElement::rendererIsNeeded): isURLAllowed -> canLoad
2225
2226         * html/HTMLFrameElementBase.cpp:
2227         (WebCore::HTMLFrameElementBase::HTMLFrameElementBase): Removed initial
2228         values for no-longer-needed data members.
2229
2230         (WebCore::HTMLFrameElementBase::canLoadScriptURL const): Renamed from
2231         isURLAllowed. Also refactored so it now calls canLoadURL.
2232         (WebCore::HTMLFrameElementBase::canLoad const): Renamed from isURLAllowed.
2233         Also added FIXME comments about multiple ways that this code incorrectly
2234         handles the empty string. Might inspire some tests and future fixes.
2235         (WebCore::HTMLFrameElementBase::canLoadURL const): Renamed from isURLAllowed.
2236         Added an overload that takes a relative URL string largely to make this
2237         more parallel with the similar code in HTMLPlugInImageElement. Refactored
2238         to call canAddSubframe and isProhibitedSelfReference, removing the need
2239         to call Frame::isURLAllowed.
2240         (WebCore::HTMLFrameElementBase::openURL): isURLAllowed -> canLoad
2241         (WebCore::HTMLFrameElementBase::parseAttribute): Removed unneeded code
2242         to parse marginwidth, marginheight, and scrolling, which are now done
2243         as needed instead. Might have to add code back if we ever add code to
2244         make these cause dynamic updates when changed, but that was not the
2245         behavior of the existing code.
2246         (WebCore::HTMLFrameElementBase::scrollingMode const): Changed to call
2247         attributeWithoutSynchronization rather than reading from a data member.
2248
2249         * html/HTMLFrameElementBase.h: Moved scrollingMode into the .cpp file.
2250         Removed marginWidth and marginHeight since they are no longer called.
2251         Made canContainRangeEndPoint override be private. Renamed isURLAllowed
2252         to canLoad/canLoadScriptURL/canLoadURL. Removed unneeded isFrameElementBase
2253         since is<HTMLFrameElementBase> already works without it. Removed unneeded
2254         data members m_scrolling, m_marginWidth, and m_marginHeight.
2255
2256         * html/HTMLFrameOwnerElement.cpp:
2257         (WebCore::HTMLFrameOwnerElement::HTMLFrameOwnerElement): Moved initialization
2258         of m_contentFrame and m_sandboxFlags to the header.
2259         (WebCore::HTMLFrameOwnerElement::clearContentFrame): 0 -> nullptr
2260         (WebCore::HTMLFrameOwnerElement::canAddSubframe const): Added. Code was moved
2261         here from multiple functions that enforced the subframe count limit.
2262         (WebCore::HTMLFrameOwnerElement::isProhibitedSelfReference const): Added.
2263         Moved code here from Frame::isURLAllowed so it's easy to use as needed.
2264
2265         * html/HTMLFrameOwnerElement.h: Renamed isURLAllowed to canLoadScriptURL.
2266         Added protected canAddSubframe and isProhibitedSelfReference functions.
2267         Initialized the data members here.
2268
2269         * html/HTMLIFrameElement.cpp:
2270         (WebCore::HTMLIFrameElement::sandbox): Added braces for multi-line if statement.
2271         (WebCore::HTMLIFrameElement::parseAttribute): Removed unneeded storage of the
2272         allow attribute value. Added missing code to invalidate m_featurePolicy when
2273         the allow attribute changes. This could change behavior, but unlikely to affect
2274         any websites of tests. Would be good to add a test for this.
2275         (WebCore::HTMLIFrameElement::rendererIsNeeded): isURLAllowed -> canLoad. Also
2276         reordered the code to be more efficient for display: none (why not?).
2277         (WebCore::HTMLIFrameElement::featurePolicy const): Use attributeWithoutSynchronization
2278         to read the allow attribute rather than using a data member.
2279
2280         * html/HTMLIFrameElement.h: Removed the unneeded allow function member and
2281         m_allow data member since DOM reflection takes care of the function and the
2282         featurePolicy function can get the attribute without a data member.
2283
2284         * html/HTMLObjectElement.cpp:
2285         (WebCore::HTMLObjectElement::updateWidget): allowedToLoadFrameURL -> canLoadURL
2286         Also tweaked comments.
2287
2288         * html/HTMLPlugInElement.cpp:
2289         (WebCore::HTMLPlugInElement::canLoadScriptURL const): Added. Code moved here
2290         from HTMLFrameOwnerElement::isURLAllowed. Added comment about why this is not
2291         necessarily correct and might need improvement.
2292
2293         * html/HTMLPlugInElement.h: Added private override of canLoadScriptURL.
2294
2295         * html/HTMLPlugInImageElement.cpp:
2296         (WebCore::HTMLPlugInImageElement::canLoadURL const): Renamed from
2297         allowedToLoadFrameURL and refactored into two functions to match the
2298         structure of the similar function in HTMLFrameElementBase. Also refactored
2299         to use canAddSubframe and isProhibitedSelfReference rather than Frame::isURLAllowed.
2300         (WebCore::HTMLPlugInImageElement::canLoadPlugInContent const): Renamed from
2301         allowedToLoadPluginContent.
2302         (WebCore::HTMLPlugInImageElement::requestObject): allowedToLoadPluginContent
2303         -> canLoadPlugInContent
2304
2305         * html/HTMLPlugInImageElement.h: Renamed functions as mentioned above.
2306
2307         * loader/SubframeLoader.cpp:
2308         (WebCore::SubframeLoader::requestFrame): isURLAllowed -> canLoadScriptURL
2309
2310         * page/FocusController.h: Removed unneeded forward declaration of HTMLFrameOwnerElement.
2311
2312         * page/Frame.cpp:
2313         (WebCore::Frame::isURLAllowed const): Deleted.
2314         * page/Frame.h: Ditto.
2315
2316         * page/FrameView.cpp:
2317         (WebCore::FrameView::init): Removed code to initialize m_margins, since nothing
2318         was looking at it after that.
2319         (WebCore::FrameView::setMarginWidth): Deleted.
2320         (WebCore::FrameView::setMarginHeight): Deleted.
2321
2322         * page/FrameView.h: Removed marginWidth, marginHeight, setMarginWidth,
2323         setMarginHeight, and m_margins because there was no code anywhere calling
2324         marginWidth or marginHeight, and no other side effects of these functions.
2325
2326 2019-07-17  Alex Christensen  <achristensen@webkit.org>
2327
2328         Add a runtime-disabled dialog element skeleton
2329         https://bugs.webkit.org/show_bug.cgi?id=199839
2330
2331         Reviewed by Ryosuke Niwa.
2332
2333         Beginning implementation of https://html.spec.whatwg.org/multipage/interactive-elements.html#the-dialog-element
2334         Covered by rebaselining WPT tests.
2335
2336         * CMakeLists.txt:
2337         * DerivedSources-input.xcfilelist:
2338         * DerivedSources-output.xcfilelist:
2339         * DerivedSources.make:
2340         * Sources.txt:
2341         * WebCore.xcodeproj/project.pbxproj:
2342         * bindings/js/WebCoreBuiltinNames.h:
2343         * html/HTMLDialogElement.cpp: Added.
2344         (WebCore::HTMLDialogElement::HTMLDialogElement):
2345         (WebCore::HTMLDialogElement::open):
2346         (WebCore::HTMLDialogElement::setOpen):
2347         (WebCore::HTMLDialogElement::returnValue):
2348         (WebCore::HTMLDialogElement::setReturnValue):
2349         (WebCore::HTMLDialogElement::show):
2350         (WebCore::HTMLDialogElement::showModal):
2351         (WebCore::HTMLDialogElement::close):
2352         * html/HTMLDialogElement.h: Added.
2353         * html/HTMLDialogElement.idl: Added.
2354         * html/HTMLTagNames.in:
2355         * page/RuntimeEnabledFeatures.h:
2356         (WebCore::RuntimeEnabledFeatures::setDialogElementEnabled):
2357         (WebCore::RuntimeEnabledFeatures::dialogElementEnabled const):
2358
2359 2019-07-17  Youenn Fablet  <youenn@apple.com>
2360
2361         Hop to the main thread when doing logging in RealtimeIncomingVideoSourceCocoa
2362         https://bugs.webkit.org/show_bug.cgi?id=199865
2363
2364         Reviewed by Darin Adler.
2365
2366         LoggerHelper routines allow logging messages in system console and inspector console.
2367         These routines iterate through a Vector of log observers which is not thread safe.
2368         Document, the main log observer, also expects to be called on the main thread.
2369         Manually tested (writing a layout test for this would require more than 2 seconds).
2370
2371         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
2372         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
2373
2374 2019-07-17  Commit Queue  <commit-queue@webkit.org>
2375
2376         Unreviewed, rolling out r247505.
2377         https://bugs.webkit.org/show_bug.cgi?id=199871
2378
2379         "Caused failed ASSERT in stress test" (Requested by creid on
2380         #webkit).
2381
2382         Reverted changeset:
2383
2384         "Bytecode cache should use FileSystem"
2385         https://bugs.webkit.org/show_bug.cgi?id=199759
2386         https://trac.webkit.org/changeset/247505
2387
2388 2019-07-17  Youenn Fablet  <youenn@apple.com>
2389
2390         Add release logging to AudioSampleDataSource
2391         https://bugs.webkit.org/show_bug.cgi?id=199814
2392         <rdar://problem/53128140>
2393
2394         Reviewed by Eric Carlson.
2395
2396         Use release logging for AudioSampleDataSource in case of errors.
2397         This requires passing a logger and a logger identifier.
2398         For that purpose, pass a MediaStreamTrackPrivate to it constructor
2399         and reuse its logger and log identifier.
2400
2401         For each log, hop to the main thread as release logging requires to be done in the main thread.
2402         Add specific handling for RealtimeOutgoingAudioSource as its MediaStreamTrack can change in case of replaceTrack.
2403         In that case, we change of logger when changing the MediaStreamTrackPrivate.
2404
2405         No observable change of behavior, covered by existing tests.
2406
2407         * platform/audio/mac/AudioSampleDataSource.h:
2408         * platform/audio/mac/AudioSampleDataSource.mm:
2409         (WebCore::AudioSampleDataSource::create):
2410         (WebCore::AudioSampleDataSource::AudioSampleDataSource):
2411         (WebCore::AudioSampleDataSource::setupConverter):
2412         (WebCore::AudioSampleDataSource::pushSamplesInternal):
2413         (WebCore::AudioSampleDataSource::pullSamplesInternal):
2414         (WebCore::AudioSampleDataSource::setLogger):
2415         (WebCore::AudioSampleDataSource::logChannel const):
2416         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
2417         (WebCore::RealtimeOutgoingAudioSource::setSource):
2418         * platform/mediastream/RealtimeOutgoingAudioSource.h:
2419         (WebCore::RealtimeOutgoingAudioSource::sourceUpdated):
2420         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
2421         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
2422         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
2423         Instead of using its own logger/identifier member field, reuse its MediaStreamTrackPrivate.
2424         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
2425         (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
2426         (WebCore::RealtimeOutgoingAudioSourceCocoa::sourceUpdated):
2427         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
2428         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
2429         (WebCore::WebAudioSourceProviderAVFObjC::prepare):
2430
2431 2019-07-17  Kenneth Russell  <kbr@chromium.org>
2432
2433         Make ANGLE work inside WebKit2's sandbox
2434         https://bugs.webkit.org/show_bug.cgi?id=199844
2435
2436         Reviewed by Alex Christensen.
2437
2438         Fix missing #import introduced at the last minute while removing
2439         some debugging code in the last patch.
2440
2441         Tested with San Angeles WebGL demo and some conformance tests.
2442
2443         * platform/graphics/cocoa/WebGLLayer.mm:
2444
2445 2019-07-17  Andres Gonzalez  <andresg_22@apple.com>
2446
2447         Hang in WebCore::AccessibilityRenderObject::visiblePositionRangeForLine.
2448         https://bugs.webkit.org/show_bug.cgi?id=199845
2449         <rdar://problem/53121017>
2450
2451         Reviewed by Chris Fleizach.
2452
2453         - Added check for upper bound NSNotFound for parameter to visiblePositionRangeForLine.
2454         - Fixed signed/unsigned issue for AXTextMarkerRangeForLine attribute.
2455
2456         * accessibility/AccessibilityRenderObject.cpp:
2457         (WebCore::AccessibilityRenderObject::visiblePositionRangeForLine const):
2458         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2459         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
2460
2461 2019-07-17  Rob Buis  <rbuis@igalia.com>
2462
2463         Add referrerpolicy attribute support for <script> elements
2464         https://bugs.webkit.org/show_bug.cgi?id=185550
2465
2466         Reviewed by Youenn Fablet.
2467
2468         This patch adds 'referrerpolicy' attribute support for script elements.
2469         If set, the value is restricted to the ReferrerPolicy enum, and
2470         if valid it is used for the script fetch.
2471         If not set or invalid, the current behavior is kept.
2472
2473         Tests: http/tests/referrer-policy-script/no-referrer-when-downgrade/cross-origin-http-http.html
2474                http/tests/referrer-policy-script/no-referrer-when-downgrade/cross-origin-http.https.html
2475                http/tests/referrer-policy-script/no-referrer-when-downgrade/same-origin.html
2476                http/tests/referrer-policy-script/no-referrer/cross-origin-http-http.html
2477                http/tests/referrer-policy-script/no-referrer/cross-origin-http.https.html
2478                http/tests/referrer-policy-script/no-referrer/same-origin.html
2479                http/tests/referrer-policy-script/origin-when-cross-origin/cross-origin-http-http.html
2480                http/tests/referrer-policy-script/origin-when-cross-origin/cross-origin-http.https.html
2481                http/tests/referrer-policy-script/origin-when-cross-origin/same-origin.html
2482                http/tests/referrer-policy-script/origin/cross-origin-http-http.html
2483                http/tests/referrer-policy-script/origin/cross-origin-http.https.html
2484                http/tests/referrer-policy-script/origin/same-origin.html
2485                http/tests/referrer-policy-script/same-origin/cross-origin-http-http.html
2486                http/tests/referrer-policy-script/same-origin/cross-origin-http.https.html
2487                http/tests/referrer-policy-script/same-origin/same-origin.html
2488                http/tests/referrer-policy-script/strict-origin-when-cross-origin/cross-origin-http-http.html
2489                http/tests/referrer-policy-script/strict-origin-when-cross-origin/cross-origin-http.https.html
2490                http/tests/referrer-policy-script/strict-origin-when-cross-origin/same-origin.html
2491                http/tests/referrer-policy-script/strict-origin/cross-origin-http-http.html
2492                http/tests/referrer-policy-script/strict-origin/cross-origin-http.https.html
2493                http/tests/referrer-policy-script/strict-origin/same-origin.html
2494                http/tests/referrer-policy-script/unsafe-url/cross-origin-http-http.html
2495                http/tests/referrer-policy-script/unsafe-url/cross-origin-http.https.html
2496                http/tests/referrer-policy-script/unsafe-url/same-origin.html
2497
2498         * bindings/js/CachedScriptFetcher.cpp:
2499         (WebCore::CachedScriptFetcher::requestScriptWithCache const):
2500         * bindings/js/CachedScriptFetcher.h:
2501         (WebCore::CachedScriptFetcher::CachedScriptFetcher):
2502         * dom/InlineClassicScript.h:
2503         * dom/LoadableClassicScript.cpp:
2504         (WebCore::LoadableClassicScript::create):
2505         * dom/LoadableClassicScript.h:
2506         * dom/LoadableModuleScript.cpp:
2507         (WebCore::LoadableModuleScript::create):
2508         (WebCore::LoadableModuleScript::LoadableModuleScript):
2509         * dom/LoadableModuleScript.h:
2510         * dom/LoadableScript.h:
2511         (WebCore::LoadableScript::LoadableScript):
2512         * dom/ScriptElement.cpp:
2513         (WebCore::ScriptElement::requestClassicScript):
2514         (WebCore::ScriptElement::requestModuleScript):
2515         * dom/ScriptElement.h:
2516         * dom/ScriptElementCachedScriptFetcher.h:
2517         (WebCore::ScriptElementCachedScriptFetcher::ScriptElementCachedScriptFetcher):
2518         * html/HTMLIFrameElement.cpp:
2519         (WebCore::HTMLIFrameElement::referrerPolicyForBindings const):
2520         * html/HTMLScriptElement.cpp:
2521         (WebCore::HTMLScriptElement::setReferrerPolicyForBindings):
2522         (WebCore::HTMLScriptElement::referrerPolicyForBindings const):
2523         (WebCore::HTMLScriptElement::referrerPolicy const):
2524         * html/HTMLScriptElement.h:
2525         * html/HTMLScriptElement.idl:
2526         * html/parser/CSSPreloadScanner.cpp:
2527         (WebCore::CSSPreloadScanner::emitRule):
2528         * html/parser/HTMLPreloadScanner.cpp:
2529         (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest):
2530         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
2531         * html/parser/HTMLResourcePreloader.cpp:
2532         (WebCore::PreloadRequest::resourceRequest):
2533         * html/parser/HTMLResourcePreloader.h:
2534         (WebCore::PreloadRequest::PreloadRequest):
2535         * platform/ReferrerPolicy.cpp:
2536         (WebCore::referrerPolicyToString):
2537         * platform/ReferrerPolicy.h:
2538         * svg/SVGScriptElement.h:
2539
2540 2019-07-16  Christopher Reid  <chris.reid@sony.com>
2541
2542         Bytecode cache should use FileSystem
2543         https://bugs.webkit.org/show_bug.cgi?id=199759
2544
2545         Reviewed by Yusuke Suzuki.
2546
2547         * platform/SharedBuffer.cpp:
2548
2549 2019-07-16  Simon Fraser  <simon.fraser@apple.com>
2550
2551         Fix includes and make a constructor explicit to avoid unified-sources-triggered test failures
2552         https://bugs.webkit.org/show_bug.cgi?id=199849
2553
2554         Reviewed by Wenson Hsieh.
2555         
2556         webkit.org/b/199587 triggered some unexpected test failures because of unified sources include
2557         order. The TextStream operator in ScrollingTreeOverflowScrollingNode::dumpProperties() was invoking
2558         the implicit constructor of TransformOperations.
2559
2560         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp: Include TextStream.h
2561         * platform/graphics/transforms/TransformOperations.h: Make ctor explicit.
2562
2563 2019-07-16  Antoine Quint  <graouts@apple.com>
2564
2565         REGRESSION: fast/events/watchos/double-tap-to-zoom* tests crashing in com.apple.WebKit: -[WKContentView(WKInteraction) _singleTapDidReset:]
2566         https://bugs.webkit.org/show_bug.cgi?id=199840
2567         <rdar://problem/52856531>
2568
2569         Reviewed by Wenson Hsieh.
2570
2571         Fix a build error that occured when building for the watchOS Simulator in the debug configuration.
2572
2573         * rendering/RenderLayerCompositor.cpp:
2574         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingProxyRole):
2575
2576 2019-07-16  Justin Fan  <justin_fan@apple.com>
2577
2578         [WebGPU] Convert GPUComputePipeline LOG statements to generate GPUErrors
2579         https://bugs.webkit.org/show_bug.cgi?id=199773
2580
2581         Reviewed by Myles C. Maxfield.
2582
2583         Generate a GPUError if GPUComputePipeline creation fails.
2584         Rework the WHLSL test harness to take advantage of this.
2585
2586         Test: webgpu/compute-pipeline-errors.html
2587
2588         * Modules/webgpu/WebGPUComputePipelineDescriptor.cpp:
2589         (WebCore::WebGPUComputePipelineDescriptor::tryCreateGPUComputePipelineDescriptor const):
2590         * Modules/webgpu/WebGPUComputePipelineDescriptor.h:
2591         * Modules/webgpu/WebGPUDevice.cpp:
2592         (WebCore::WebGPUDevice::createComputePipeline const):
2593         * platform/graphics/gpu/GPUBuffer.h:
2594         * platform/graphics/gpu/GPUComputePipeline.h: 
2595                 Now inherits from GPUObjectBase, though this isn't super useful yet
2596                 since GPUComputePipeline itself does not expose any operations that can error. 
2597         * platform/graphics/gpu/GPUDevice.cpp:
2598         (WebCore::GPUDevice::tryCreateComputePipeline const):
2599         * platform/graphics/gpu/GPUDevice.h:
2600         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2601         (WebCore::GPUBuffer::validateBufferUsage):
2602         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
2603         (WebCore::trySetMetalFunctions):
2604         (WebCore::trySetFunctions):
2605         (WebCore::convertComputePipelineDescriptor):
2606         (WebCore::tryCreateMTLComputePipelineState):
2607         (WebCore::GPUComputePipeline::tryCreate):
2608         (WebCore::GPUComputePipeline::GPUComputePipeline):
2609
2610 2019-07-11  Justin Fan  <justin_fan@apple.com>
2611
2612         [WebGPU] Move error scopes out of GPUDevice for more portable error generation
2613         https://bugs.webkit.org/show_bug.cgi?id=199740
2614
2615         Reviewed by Myles C. Maxfield.
2616
2617         Move error generation into a separate RefCounted class to allow GPU objects to generate 
2618         errors independent of any GPUDevice.
2619         Create GPUObjectBase to delegate error generation and refactor GPUBuffer to inherit from GPUObjectBase.
2620
2621         No behavior change or new tests. Error scopes covered by error-scopes-test.html.
2622
2623         * Modules/webgpu/WebGPUDevice.cpp:
2624         (WebCore::WebGPUDevice::WebGPUDevice): Now creates a GPUErrorGenerator.
2625         (WebCore::WebGPUDevice::createBuffer const): Pass the GPUErrorGenerator to any created GPUBuffer.
2626         (WebCore::WebGPUDevice::createBufferMapped const): Ditto.
2627         (WebCore::WebGPUDevice::popErrorScope): Shouldn't be const. Can just ask for the GPUError rather than passing a lambda.
2628         (WebCore::WebGPUDevice::pushErrorScope const): Deleted.
2629         (WebCore::WebGPUDevice::popErrorScope const): Deleted.
2630         * Modules/webgpu/WebGPUDevice.h:
2631         (WebCore::WebGPUDevice::pushErrorScope):
2632         * Sources.txt:
2633         * WebCore.xcodeproj/project.pbxproj:
2634         * platform/graphics/gpu/GPUBuffer.h: Now inherits from GPUObjectBase for error generation ease.
2635         * platform/graphics/gpu/GPUDevice.cpp:
2636         (WebCore::GPUDevice::tryCreateBuffer): Ensure GPUBuffers reference the GPUErrorGenerator.
2637         (WebCore::GPUDevice::pushErrorScope): Deleted. No longer needed here.
2638         (WebCore::GPUDevice::popErrorScope): Deleted.
2639         (WebCore::GPUDevice::registerError): Deleted.
2640         * platform/graphics/gpu/GPUDevice.h: Move error scope logic out.
2641         * platform/graphics/gpu/GPUErrorGenerator.cpp: Added.
2642         (WebCore::GPUErrorGenerator::pushErrorScope):
2643         (WebCore::GPUErrorGenerator::popErrorScope):
2644         (WebCore::GPUErrorGenerator::generateError):
2645         * platform/graphics/gpu/GPUErrorGenerator.h: Added.
2646         (WebCore::GPUErrorGenerator::create):
2647         * platform/graphics/gpu/GPUObjectBase.h: Added.
2648         (WebCore::GPUObjectBase::generateError):
2649         (WebCore::GPUObjectBase::GPUObjectBase):
2650         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Use the GPUErrorGenerator directly during buffer creation.
2651         (WebCore::GPUBuffer::validateBufferUsage):
2652         (WebCore::GPUBuffer::tryCreate):
2653         (WebCore::GPUBuffer::GPUBuffer):
2654         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
2655         (WebCore::GPUQueue::submit): Prevent possible null dereference.
2656
2657 2019-07-10  Justin Fan  <justin_fan@apple.com>
2658
2659         [WebGPU] Implement GPUError and error scopes
2660         https://bugs.webkit.org/show_bug.cgi?id=199655
2661
2662         Reviewed by Myles C. Maxfield.
2663
2664         Add GPUErrorFilter, GPUError, and the ability to push and pop error scopes on a GPUDevice.
2665         This will allow us to check for WebGPU errors from JavaScript.
2666         Currently, only some GPUBuffer creation errors are reported for testing; more errors will follow in later patches.
2667
2668         Test: webgpu/error-scopes-test.html
2669
2670         * Modules/webgpu/GPUErrorFilter.idl: Added.
2671         * Modules/webgpu/GPUOutOfMemoryError.idl: Added.
2672         * Modules/webgpu/GPUValidationError.idl: Added.
2673         * Modules/webgpu/WebGPUDevice.cpp:
2674         (WebCore::WebGPUDevice::pushErrorScope):
2675         (WebCore::WebGPUDevice::popErrorScope): Resolve the Promise here, since GPUDevice shouldn't worry about DOM layer.
2676         * Modules/webgpu/WebGPUDevice.h:
2677         * Modules/webgpu/WebGPUDeviceErrorScopes.cpp: Added.
2678         (WebCore::WebGPUDeviceErrorScopes::pushErrorScope): Delegates to WebGPUDevice.
2679         (WebCore::WebGPUDeviceErrorScopes::popErrorScope): Ditto.
2680         * Modules/webgpu/WebGPUDeviceErrorScopes.h: Added.
2681         * Modules/webgpu/WebGPUDeviceErrorScopes.idl: Added.
2682         * platform/graphics/gpu/GPUBuffer.h:
2683         * platform/graphics/gpu/GPUDevice.cpp: The actual error stack lives here.
2684         (WebCore::GPUDevice::pushErrorScope):
2685         (WebCore::GPUDevice::popErrorScope): Calls a callback with a GPUError, if any.
2686         (WebCore::GPUDevice::registerError): Actually creates GPUErrors.
2687         * platform/graphics/gpu/GPUDevice.h:
2688         * platform/graphics/gpu/GPUError.cpp: Added.
2689         (WebCore::createError): Factory function for various error types.
2690         * platform/graphics/gpu/GPUError.h: Added.
2691         * platform/graphics/gpu/GPUErrorFilter.h: Added.
2692         * platform/graphics/gpu/GPUOutOfMemoryError.h: Added.
2693         (WebCore::GPUOutOfMemoryError::create):
2694         * platform/graphics/gpu/GPUValidationError.cpp: Added.
2695         (WebCore::GPUValidationError::create):
2696         (WebCore::GPUValidationError::GPUValidationError):
2697         * platform/graphics/gpu/GPUValidationError.h: Added.
2698         (WebCore::GPUValidationError::message const):
2699         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2700         (WebCore::GPUBuffer::validateBufferUsage): Create an actual GPUValidationError :)
2701         (WebCore::GPUBuffer::tryCreate): Create GPUOutOfMemoryErrors where appropriate.
2702
2703         Add file/name references:
2704         * CMakeLists.txt:
2705         * DerivedSources-input.xcfilelist:
2706         * DerivedSources-output.xcfilelist:
2707         * DerivedSources.make:
2708         * Sources.txt:
2709         * WebCore.xcodeproj/project.pbxproj:
2710         * bindings/js/WebCoreBuiltinNames.h:
2711
2712         Missing includes:
2713         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:
2714
2715 2019-07-16  Commit Queue  <commit-queue@webkit.org>
2716
2717         Unreviewed, rolling out r247493.
2718         https://bugs.webkit.org/show_bug.cgi?id=199841
2719
2720         "The new whlsl-for-loop.html test is failing on the bots"
2721         (Requested by rmorisset on #webkit).
2722
2723         Reverted changeset:
2724
2725         "[WHLSL] Desugar for loops and while loops"
2726         https://bugs.webkit.org/show_bug.cgi?id=199726
2727         https://trac.webkit.org/changeset/247493
2728
2729 2019-07-16  Per Arne Vollan  <pvollan@apple.com>
2730
2731         Prewarm font cache with more fonts
2732         https://bugs.webkit.org/show_bug.cgi?id=199283
2733
2734         Reviewed by Myles C. Maxfield.
2735
2736         Use the existing prewarm method in FontCache to prewarm the cache with a set of font family names.
2737         The font list consists of some of the fonts used by the 10 most popular sites on Alexa top sites.
2738         This is a confirmed improvement in page load time.
2739
2740         No new tests, covered by existing tests.
2741
2742         * page/ProcessWarming.cpp:
2743         (WebCore::ProcessWarming::prewarmGlobally):
2744         * platform/graphics/FontCache.cpp:
2745         (WebCore::FontCache::prewarmGlobally):
2746         * platform/graphics/FontCache.h:
2747         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2748         (WebCore::FontCache::prewarmGlobally):
2749
2750 2019-07-16  Robin Morisset  <rmorisset@apple.com>
2751
2752         [WHLSL] Desugar for loops and while loops
2753         https://bugs.webkit.org/show_bug.cgi?id=199726
2754
2755         Reviewed by Myles C. Maxfield.
2756
2757         This patch makes loops behave a lot more similarly to the spec.
2758         In particular, while loops are just degenerate for loops, so they can be desugared in the parser.
2759         And for loops can themselves be heavily desugared, into having no initializer, one condition and one increment
2760         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.
2761
2762         Debugging this patch revealed an unrelated bug where the parser would generate an empty comma expression on ";", which the checker would then choke on.
2763         The parser now generates an empty block in that case (as specified in the spec), which fixes the problem.
2764
2765         Finally, while updating the NameResolver for the new structure of loops I realized that it was needlessly generating extra NameContext.
2766         They are not expected by the spec, that forbids naked variable declarations outside of blocks anyway.
2767         So I removed this unnecessary work, and fixed the parser to correctly forbid such naked variable declarations.
2768
2769         * Modules/webgpu/WHLSL/AST/WHLSLAST.h:
2770         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
2771         (WebCore::WHLSL::AST::ForLoop::ForLoop):
2772         (WebCore::WHLSL::AST::ForLoop::condition):
2773         (WebCore::WHLSL::AST::ForLoop::increment):
2774         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
2775         (WebCore::WHLSL::AST::Statement::isVariableDeclarationsStatement const):
2776         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h: Removed.
2777         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
2778         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
2779         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
2780         (WebCore::WHLSL::ASTDumper::visit):
2781         * Modules/webgpu/WHLSL/WHLSLASTDumper.h:
2782         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2783         (WebCore::WHLSL::Checker::visit):
2784         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
2785         (WebCore::WHLSL::NameResolver::visit):
2786         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
2787         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
2788         (WebCore::WHLSL::Parser::parseBlockBody):
2789         (WebCore::WHLSL::Parser::parseForLoop):
2790         (WebCore::WHLSL::Parser::parseWhileLoop):
2791         (WebCore::WHLSL::Parser::parseStatement):
2792         (WebCore::WHLSL::Parser::parseEffectfulExpression):
2793         * Modules/webgpu/WHLSL/WHLSLParser.h:
2794         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp:
2795         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
2796         (WebCore::WHLSL::Visitor::visit):
2797         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
2798         * WebCore.xcodeproj/project.pbxproj:
2799
2800 2019-07-16  Tim Horton  <timothy_horton@apple.com>
2801
2802         NSTextFinder holes don't scroll with the page
2803         https://bugs.webkit.org/show_bug.cgi?id=199815
2804         <rdar://problem/52280514>
2805
2806         Reviewed by Simon Fraser.
2807
2808         * rendering/ScrollAlignment.h:
2809
2810 2019-07-16  Youenn Fablet  <youenn@apple.com>
2811
2812         [iOS] Make sure the first camera device in the list is the front camera
2813         https://bugs.webkit.org/show_bug.cgi?id=199811
2814         <rdar://problem/53125157>
2815
2816         Reviewed by Jer Noble.
2817
2818         Some websites call getUserMedia with a deviceId constraint and theey pick the
2819         first deviceId in the list provided by enumerateDevices.
2820         On iOS, this is the back camera which is often not what is expected by WebRTC applications.
2821         Instead, make sure the first camera device is the front camera.
2822
2823         Manually tested.
2824
2825         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2826
2827 2019-07-16  Chris Dumez  <cdumez@apple.com>
2828
2829         Speed up StorageManager::getValues()
2830         https://bugs.webkit.org/show_bug.cgi?id=199812
2831
2832         Reviewed by Alex Christensen.
2833
2834         * storage/StorageMap.cpp:
2835         (WebCore::StorageMap::importItems):
2836         * storage/StorageMap.h:
2837
2838 2019-07-16  Simon Fraser  <simon.fraser@apple.com>
2839
2840         Remove "GraphicsContext 0x7ffd8765f6b0 stack changed by" logging
2841         https://bugs.webkit.org/show_bug.cgi?id=199834
2842
2843         Reviewed by Dean Jackson.
2844
2845         I inadvertently left in a couple of GraphicsContextStateStackChecker (used to detect mismatched
2846         GraphicsContext save/restore) in r246725, so remove them.
2847
2848         * rendering/RenderLayer.cpp:
2849         (WebCore::RenderLayer::paintLayerContents):
2850         * rendering/RenderLayerBacking.cpp:
2851         (WebCore::RenderLayerBacking::paintIntoLayer):
2852
2853 2019-07-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2854
2855         [Text autosizing] [iPadOS] Paragraph text on the front page of LinkedIn.com is not boosted
2856         https://bugs.webkit.org/show_bug.cgi?id=199827
2857         <rdar://problem/53152660>
2858
2859         Reviewed by Zalan Bujtas.
2860
2861         After r247467, we try to avoid boosting some text that might cause vertical overflow due to line height
2862         increasing inside a container that expects a fixed integer number of lines. However, in the case of
2863         linkedin.com, the line height specified is a fixed value of 26px, which greatly exceeds the specified font size
2864         of 14px. In this case, it's safe to boost font size, since doing so would not affect the line height at all.
2865
2866         To handle this case, don't avoid text autosizing due to the "fixed number of lines" heuristic if the line height
2867         is fixed, and is much larger than the font size.
2868
2869         Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html
2870
2871         * rendering/style/TextSizeAdjustment.cpp:
2872         (WebCore::AutosizeStatus::updateStatus):
2873
2874 2019-07-16  Zalan Bujtas  <zalan@apple.com>
2875
2876         [ContentChangeObserver] Cancel ongoing content observation when tap is failed/cancelled
2877         https://bugs.webkit.org/show_bug.cgi?id=199828
2878         <rdar://problem/53152696>
2879
2880         Reviewed by Wenson Hsieh.
2881
2882         This patch ensures that we stop the content observation (initiated by touch start) when the tap
2883         is cancelled/failed.
2884
2885         Not testable.
2886
2887         * page/ios/ContentChangeObserver.cpp:
2888         (WebCore::ContentChangeObserver::didCancelPotentialTap):
2889         * page/ios/ContentChangeObserver.h:
2890
2891 2019-07-16  Rob Buis  <rbuis@igalia.com>
2892
2893         Remove support for beforeload on link=prefetch
2894         https://bugs.webkit.org/show_bug.cgi?id=199632
2895
2896         Reviewed by Youenn Fablet.
2897
2898         Remove support for beforeload on link=prefetch
2899         by not calling shouldLoadLink for prefetch.
2900         Also make loadLink return void since it always
2901         succeeds.
2902
2903         Tests: http/wpt/prefetch/beforeload-dynamic.html
2904                http/wpt/prefetch/beforeload.html
2905
2906         * html/HTMLLinkElement.cpp:
2907         (WebCore::HTMLLinkElement::process):
2908         * loader/LinkLoader.cpp:
2909         (WebCore::LinkLoader::prefetchIfNeeded):
2910         (WebCore::LinkLoader::loadLink):
2911         * loader/LinkLoader.h:
2912
2913 2019-07-16  Youenn Fablet  <youenn@apple.com>
2914
2915         Hop to main thread for release logging in RealtimeIncomingAudioSource
2916         https://bugs.webkit.org/show_bug.cgi?id=199813
2917
2918         Reviewed by Eric Carlson.
2919
2920         LoggerHelper routines allow logging messages in system console and inspector console.
2921         These routines iterate through a Vector of log observers which is not thread safe.
2922         Document, the main log observer, also expects to be called on the main thread.
2923         Manually tested (writing a layout test for this would require more than 2 seconds).
2924
2925         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
2926         (WebCore::RealtimeIncomingAudioSourceCocoa::OnData):
2927
2928 2019-07-15  Ryan Haddad  <ryanhaddad@apple.com>
2929
2930         Unreviewed, rolling out r247444.
2931
2932         Caused two scrolling tests to fail on iOS Simulator
2933
2934         Reverted changeset:
2935
2936         "Typing into a cell in a Google Sheet lags behind by one
2937         character"
2938         https://bugs.webkit.org/show_bug.cgi?id=199587
2939         https://trac.webkit.org/changeset/247444
2940
2941 2019-07-15  Zalan Bujtas  <zalan@apple.com>
2942
2943         outlook.live.com has odd viewport with edge gap
2944         https://bugs.webkit.org/show_bug.cgi?id=199822
2945         <rdar://problem/53029072>
2946
2947         Reviewed by Wenson Hsieh.
2948
2949         r244944 introduced a viewport width quirk because at certain screen size outlook.live.com's flex setup produced a slighly broken layout.
2950         We don't seem to need this quirk anymore (composed column's min-width is removed.)
2951
2952         * page/Quirks.cpp:
2953         (WebCore::Quirks::shouldIgnoreShrinkToFitContent const): Deleted.
2954         (WebCore::Quirks::overriddenViewLayoutWidth const): Deleted.
2955         * page/Quirks.h:
2956
2957 2019-07-15  Saam Barati  <sbarati@apple.com>
2958
2959         [WHLSL] Matrix memory layout should match HLSL by laying out columns linearly
2960         https://bugs.webkit.org/show_bug.cgi?id=199215
2961
2962         Reviewed by Myles C. Maxfield.
2963
2964         This patch makes it so that we lay out matrices in memory in the same
2965         way HLSL does. This is by laying out columns linearly in memory. So a float4x4
2966         composed by this series of floats in memory:
2967         [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
2968         
2969         composes this logical matrix:
2970         [[ 0,  4,  8, 12]
2971          [ 1,  5,  9, 13]
2972          [ 2,  6, 10, 14]
2973          [ 3,  7, 11, 15]]
2974         
2975         To implement this, we switch to using an array to represent the memory
2976         contents linear memory layout of a matrix. So the matrix float4x3 will now
2977         be an array<float, 12> in metal. Then, we change the indexed getter and
2978         setter methods for matrices to load and store from and to the correct
2979         memory locations. The memory layout of matrices is observable to WHLSL
2980         when using a matrix as an input/output to a shader.
2981
2982         Test: webgpu/whlsl-matrix-memory-layout.html
2983
2984         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
2985         (WebCore::WHLSL::Metal::writeNativeFunction):
2986         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
2987         (WebCore::WHLSL::Metal::writeNativeType):
2988
2989 2019-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2990
2991         [Text autosizing] [iPadOS] Product label text is clipped in portrait mode on the front page of sephora.com
2992         https://bugs.webkit.org/show_bug.cgi?id=199806
2993         <rdar://problem/52902482>
2994
2995         Reviewed by Zalan Bujtas.
2996
2997         On sephora.com, some product label text is currently boosted by idempotent text autosizing, which causes the
2998         labels be vertically clipped. This patch augments the idempotent text autosizing heuristic to avoid this case by
2999         checking if the element to be boosted has a fixed height or max height, whose value is very close to a small
3000         integer multiple of the line height. In this case, it's likely that the website expects the text to be no more
3001         than a few lines' worth of height, so boosting the text is likely to break the page.
3002
3003         Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html
3004
3005         * rendering/style/RenderStyle.cpp:
3006         (WebCore::RenderStyle::isIdempotentTextAutosizingCandidate const):
3007         * rendering/style/TextSizeAdjustment.cpp:
3008         (WebCore::AutosizeStatus::updateStatus):
3009         * rendering/style/TextSizeAdjustment.h:
3010
3011         Rename Fields::DisplayNone to Fields::AvoidSubtree to avoid introducing another bit in RenderStyle's inherited
3012         flags.
3013
3014 2019-07-15  Myles C. Maxfield  <mmaxfield@apple.com>
3015
3016         New York font erroneously gets synthetic bold
3017         https://bugs.webkit.org/show_bug.cgi?id=199653
3018
3019         Unreviewed watchOS build fix.
3020
3021         * page/ProcessWarming.cpp:
3022         (WebCore::ProcessWarming::prewarmGlobally):
3023         * page/cocoa/MemoryReleaseCocoa.mm:
3024         (WebCore::platformReleaseMemory):
3025         * platform/graphics/FontCascadeDescription.cpp:
3026         * platform/graphics/FontDescription.h:
3027         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3028         (WebCore::invalidateFontCache):
3029         (WebCore::lookupFallbackFont):
3030         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
3031         (WebCore::FontCascadeDescription::effectiveFamilyAt const):
3032         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
3033         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
3034         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
3035
3036 2019-07-15  Commit Queue  <commit-queue@webkit.org>
3037
3038         Unreviewed, rolling out r247462.
3039         https://bugs.webkit.org/show_bug.cgi?id=199816
3040
3041         completely messed up the patch (Requested by litherum on
3042         #webkit).
3043
3044         Reverted changeset:
3045
3046         "New York font erroneously gets synthetic bold"
3047         https://bugs.webkit.org/show_bug.cgi?id=199653
3048         https://trac.webkit.org/changeset/247462
3049
3050 2019-07-11  Simon Fraser  <simon.fraser@apple.com>
3051
3052         Fix builds where HAVE_DESIGN_SYSTEM_UI_FONTS is not defined.
3053
3054         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3055         (WebCore::fontWithFamilySpecialCase):
3056
3057 2019-07-11  Justin Fan  <justin_fan@apple.com>
3058
3059         Unreviewed build fix.
3060
3061         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp: Missing include.
3062
3063 2019-07-11  Myles C. Maxfield  <mmaxfield@apple.com>
3064
3065         New York font erroneously gets synthetic bold
3066         https://bugs.webkit.org/show_bug.cgi?id=199653
3067         <rdar://problem/51692592>
3068
3069         Reviewed by Simon Fraser.
3070
3071         This patch adds support for -apple-system-ui-serif, -apple-system-ui-monospaced,
3072         and -apple-system-ui-rounded, behind an SPI that is off-by-default. We don't want
3073         to expose these fonts to the web because we don't a standardization story for them
3074         yet, but we do want some apps to be able to use them.
3075
3076         WebKit clients who want to use these fonts can set
3077         -[WKPreferences _shouldAllowDesignSystemUIFonts] = YES.
3078
3079         The patch generalizes our existing system-ui infrastructure to handle these three
3080         additional fonts. It also explicitly disables the unsupported dot-prefixed names
3081         so they don't leak out into Web content.
3082
3083         Tests: fast/text/design-system-ui-10.html
3084                fast/text/design-system-ui-11.html
3085                fast/text/design-system-ui-12.html
3086                fast/text/design-system-ui-13.html
3087                fast/text/design-system-ui-14.html
3088                fast/text/design-system-ui-15.html
3089                fast/text/design-system-ui-16.html
3090                fast/text/design-system-ui-2.html
3091                fast/text/design-system-ui-3.html
3092                fast/text/design-system-ui-4.html
3093                fast/text/design-system-ui-5.html
3094                fast/text/design-system-ui-6.html
3095                fast/text/design-system-ui-7.html
3096                fast/text/design-system-ui-8.html
3097                fast/text/design-system-ui-9.html
3098                fast/text/design-system-ui.html
3099
3100         * css/CSSFontFace.cpp:
3101         (WebCore::CSSFontFace::shouldAllowDesignSystemUIFonts const):
3102         * css/CSSFontFace.h:
3103         * css/CSSFontFaceSource.cpp:
3104         (WebCore::CSSFontFaceSource::load):
3105         * css/StyleResolver.cpp:
3106         (WebCore::StyleResolver::initializeFontStyle):
3107         * page/Settings.yaml:
3108         * platform/graphics/FontDescription.cpp:
3109         (WebCore::m_shouldAllowDesignSystemUIFonts):
3110         (WebCore::m_shouldAllowUserInstalledFonts): Deleted.
3111         * platform/graphics/FontDescription.h:
3112         (WebCore::FontDescription::shouldAllowDesignSystemUIFonts const):
3113         (WebCore::FontDescription::setShouldAllowDesignSystemUIFonts):
3114         (WebCore::FontDescription::operator== const):
3115         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3116         (WebCore::platformFontLookupWithFamily):
3117         (WebCore::fontWithFamily):
3118         * platform/graphics/cocoa/FontCacheCoreText.h:
3119         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
3120         (WebCore::systemFontUse):
3121         (WebCore::systemFontCascadeList):
3122         (WebCore::FontCascadeDescription::effectiveFamilyCount const):
3123         (WebCore::FontCascadeDescription::effectiveFamilyAt const):
3124         (WebCore::isSystemFontString): Deleted.
3125         (WebCore::isUIFontTextStyle): Deleted.
3126         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
3127         (WebCore::FontPlatformData::ctFont const):
3128         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
3129         (WebCore::SystemFontDatabaseCoreText::createSystemUI):
3130         (WebCore::SystemFontDatabaseCoreText::createDesignSystemUI):
3131         (WebCore::SystemFontDatabaseCoreText::createTextStyle):
3132         (WebCore::SystemFontDatabaseCoreText::cascadeList):
3133         (WebCore::SystemFontDatabaseCoreText::applyWeightItalicsAndFallbackBehavior):
3134         (WebCore::SystemFontDatabaseCoreText::systemFontParameters):
3135         * platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
3136         * platform/graphics/ios/FontCacheIOS.mm:
3137         (WebCore::platformFontWithFamilySpecialCase):
3138         * platform/graphics/mac/FontCacheMac.mm:
3139         (WebCore::platformFontWithFamilySpecialCase):
3140         * style/StyleResolveForDocument.cpp:
3141         (WebCore::Style::resolveForDocument):
3142         * svg/graphics/SVGImage.cpp:
3143         (WebCore::SVGImage::dataChanged):
3144         * testing/InternalSettings.cpp:
3145         (WebCore::InternalSettings::Backup::Backup):
3146         (WebCore::InternalSettings::Backup::restoreTo):
3147         (WebCore::InternalSettings::setShouldAllowDesignSystemUIFonts):
3148         * testing/InternalSettings.h:
3149         * testing/InternalSettings.idl:
3150
3151 2019-07-15  Chris Dumez  <cdumez@apple.com>
3152
3153         Crash under DisplayRefreshMonitorManager::displayWasUpdated()
3154         https://bugs.webkit.org/show_bug.cgi?id=199808
3155         <rdar://problem/53070144>
3156
3157         Reviewed by Geoffrey Garen.
3158
3159         Copy m_monitors before iterating over it because the calling displayLinkFired() on the
3160         monitor may end up calling DisplayRefreshMonitorManager::displayDidRefresh() synchronously,
3161         which removes the monitor from m_monitors.
3162
3163         * platform/graphics/DisplayRefreshMonitorManager.cpp:
3164         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
3165
3166 2019-07-15  Yusuke Suzuki  <ysuzuki@apple.com>
3167
3168         [JSC] Improve wasm wpt test results by fixing miscellaneous issues
3169         https://bugs.webkit.org/show_bug.cgi?id=199783
3170
3171         Reviewed by Mark Lam.
3172
3173         Remove WebAssemblyPrototype.
3174
3175         Tests: imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.html
3176                imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.worker.html
3177                imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.html
3178                imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.worker.html
3179                imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.html
3180                imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.worker.html
3181                imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.html
3182                imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.worker.html
3183                imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.html
3184                imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.worker.html
3185                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.html
3186                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.worker.html
3187                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.html
3188                imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.worker.html
3189                imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.html
3190                imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.worker.html
3191                imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.html
3192                imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.worker.html
3193                imported/w3c/web-platform-tests/wasm/jsapi/interface.any.html
3194                imported/w3c/web-platform-tests/wasm/jsapi/interface.any.worker.html
3195                imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.html
3196                imported/w3c/web-platform-tests/wasm/jsapi/memory/buffer.any.worker.html
3197                imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.html
3198                imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.worker.html
3199                imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.html
3200                imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.worker.html
3201                imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.html
3202                imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.worker.html
3203                imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.html
3204                imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.worker.html
3205                imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.html
3206                imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.worker.html
3207                imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.html
3208                imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.worker.html
3209                imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.html
3210                imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.worker.html
3211                imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.html
3212                imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.worker.html
3213                imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.html
3214                imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.worker.html
3215                imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.html
3216                imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.worker.html
3217                imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.html
3218                imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.worker.html
3219                imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.html
3220                imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.worker.html
3221                imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.html
3222                imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.worker.html
3223
3224         * bindings/js/JSDOMWindowBase.cpp:
3225         (WebCore::JSDOMWindowBase::compileStreaming):
3226         (WebCore::JSDOMWindowBase::instantiateStreaming):
3227
3228 2019-07-15  Dean Jackson  <dino@apple.com>
3229
3230         [WebGL] Remove software rendering and simplify context creation on macOS
3231         https://bugs.webkit.org/show_bug.cgi?id=199789
3232
3233         Reviewed by Sam Weinig.
3234
3235         We don't ever want to fall-back to the software renderer. We'd be better
3236         off failing to create the context completely.
3237
3238         Also, the number of fall-back attempts we were making before hitting
3239         the software renderer was overkill. All hardware we support should
3240         handle a 32bpp buffer.
3241
3242         Lastly, we don't want to support supersampling - multisampling only.
3243
3244         I lied… there is one more thing - failing to create the context
3245         was causing an ASSERT trying to remove the GC3D from the global list.
3246
3247         * html/canvas/WebGLRenderingContextBase.cpp:
3248         (WebCore::WebGLRenderingContextBase::create):
3249         * page/Settings.yaml: Remove forceSoftwareWebGL setting.
3250         * platform/graphics/GraphicsContext3DAttributes.h:
3251         * platform/graphics/GraphicsContext3DManager.cpp:
3252         (WebCore::GraphicsContext3DManager::addContext):
3253         (WebCore::GraphicsContext3DManager::removeContext):
3254         (WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance):
3255         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
3256         (WebCore::GraphicsContext3D::GraphicsContext3D):
3257         (WebCore::setPixelFormat): Deleted.
3258
3259 2019-07-14  Dean Jackson  <dino@apple.com>
3260
3261         Move more WebGL things into unified builds
3262         https://bugs.webkit.org/show_bug.cgi?id=199787
3263
3264         Reviewed by Wenson Hsieh.
3265
3266         Unify as many WebGL files as possible.
3267
3268         * Sources.txt:
3269         * WebCore.xcodeproj/project.pbxproj:
3270         * html/canvas/WebGLFramebuffer.cpp:
3271         * html/canvas/WebGLObject.h: Move a helper function into an inline.
3272         (WebCore::objectOrZero):
3273         * html/canvas/WebGLRenderingContextBase.cpp:
3274         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3275         * platform/mediastream/MediaStreamTrackPrivate.cpp:
3276
3277 2019-07-15  Keith Rollin  <krollin@apple.com>
3278
3279         Add missing webgpu includes
3280         https://bugs.webkit.org/show_bug.cgi?id=199802
3281         <rdar://problem/53119120>
3282
3283         Reviewed by Myles C. Maxfield.
3284
3285         WHLSLFunctionWriter.cpp fails to compile on tvOS and watchOS due to
3286         missing includes. This file likely compiles on other platforms due to
3287         the Unified Sources facility that clumps several implementation files
3288         together, exposing those implementation files to the others' includes.
3289         It fails on tvOS and watchOS due to the different ways these
3290         implementation files can get clumped together on different platforms.
3291
3292         No new tests as there is no functional change.
3293
3294         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
3295
3296 2019-07-15  Michael Catanzaro  <mcatanzaro@igalia.com>
3297
3298         Unreviewed, rolling out r247440.
3299
3300         Broke builds
3301
3302         Reverted changeset:
3303
3304         "[JSC] Improve wasm wpt test results by fixing miscellaneous
3305         issues"
3306         https://bugs.webkit.org/show_bug.cgi?id=199783
3307         https://trac.webkit.org/changeset/247440
3308
3309 2019-07-15  Daniel Bates  <dabates@apple.com>
3310
3311         Typing into a cell in a Google Sheet lags behind by one character
3312         https://bugs.webkit.org/show_bug.cgi?id=199587
3313         <rdar://problem/51616845>
3314
3315         Reviewed by Brent Fulgham.
3316
3317         Add a Google Sheets quirk. Put all DOM timers scheduled from keydown and keypress event listeners
3318         into a holding tank. The timers continue to tick, but are barred from executing their action until
3319         the next text insertion or deletion or 32 ms (on device) have elapsed, whichever is sooner. We only
3320         allocate a holding tank once per document, only if the quirk is active, and this allocation is done
3321         when the document schedules a timer on keydown or keypress. The holding tank lives for the lifetime
3322         of the document.
3323
3324         The story behind the quirk:
3325
3326         On keypress Google Sheets schedules timers and expects that a DOM update will occur (i.e. text
3327         will be inserted or deleted) within the same event loop iteration as the dispatched keypress. The
3328         UI Events spec. [1] makes no such guarantee of when a DOM update must occur in relation to the keypress
3329         event. It could happen in the same event loop iteration as the key press (as Google expects), the
3330         next iteration, 500ms later, 2 minutes later, etc. What the spec does guarantee is that by the time
3331         a DOM input event is dispatched that the DOM will be updated. And this is the solution to the problem
3332         Google Sheets is trying to solve, but is doing so using pre-IE 9 technology (though similar
3333         functionality was available via onpropertychange in IE < 9).
3334
3335         See also <https://github.com/w3c/uievents/issues/238>, which is tracking a spec. text update for
3336         this quirk.
3337
3338         Test: fast/events/ios/dom-update-on-keydown-quirk.html
3339
3340         [1] <https://w3c.github.io/uievents/> (Editor's Draft, 14 October 2018)
3341
3342         * SourcesCocoa.txt:
3343         * WebCore.xcodeproj/project.pbxproj:
3344         Add some files to the project.
3345
3346         * dom/Document.cpp:
3347         (WebCore::Document::domTimerHoldingTank): Added.
3348         * dom/Document.h:
3349         (WebCore::Document::domTimerHoldingTankIfExists): Added.
3350
3351         * page/DOMTimer.cpp:
3352         (WebCore::DOMTimer::install): Put the newly instantiated timer into the holding tank.
3353         (WebCore::DOMTimer::removeById): Remove the timer from the holding tank.
3354         (WebCore::DOMTimer::fired): Check if the timer is in the holding tank. If it is and it is a one-
3355         shot timer then schedule it for the next event loop iteration. If it's a repeating timer just
3356         let it continue ticking. Otherwise, do what we no now and execute the timer's action. The reason
3357         we do not suspend timers in the holding tank is because:
3358             1. Far out timers (Google Sheets registers timers as far out as 5 minutes!) are not penalized.
3359             Though smart supension logic could avoid this. See (3).
3360
3361             2. Empirical observations indicate that the keyboard will perform the insertion or deletion
3362             reasonably quickly (not the same event loop iteration as the keydown, but within two iterations out).
3363             So, the timers in the holding tank are short-lived.
3364
3365             3. Simplifies the code. There is no need to keep additional bookkeeping to track multiple timer
3366             suspension reasons (timers currently can only have one suspension reason) or alternatively defer
3367             scheduling a timer until a later time and computing a new "fair" firing time when scheduled.
3368         * page/EventHandler.cpp:
3369         (WebCore::EventHandler::internalKeyEvent): Place a token on the stack to put all DOM timers
3370         scheduled on keydown and keypress into the holding tank if the quirk is enabled.
3371         * page/Quirks.cpp:
3372         (WebCore::Quirks::needsDeferKeyDownAndKeyPressTimersUntilNextEditingCommand const): Added.
3373         * page/Quirks.h:
3374         * page/Settings.yaml: Added setting so that this quirk can be enabled from a layout test. This setting
3375         also lets us enable the quirk for all sites or for certain third-party apps if desired.
3376         * page/ios/DOMTimerHoldingTank.cpp: Added.
3377         (WebCore::DOMTimerHoldingTank::DOMTimerHoldingTank):
3378         (WebCore::DOMTimerHoldingTank::add):
3379         (WebCore::DOMTimerHoldingTank::remove):
3380         (WebCore::DOMTimerHoldingTank::contains):
3381         (WebCore::DOMTimerHoldingTank::removeAll):
3382         (WebCore::DOMTimerHoldingTank::stopExceededMaximumHoldTimer):
3383         * page/ios/DOMTimerHoldingTank.h: Added.
3384         (WebCore::DeferDOMTimersForScope::DeferDOMTimersForScope):
3385         (WebCore::DeferDOMTimersForScope::~DeferDOMTimersForScope):
3386         (WebCore::DeferDOMTimersForScope::isDeferring):
3387
3388 2019-07-15  Ryan Haddad  <ryanhaddad@apple.com>
3389
3390         Unreviewed, rolling out r247397, r247378, r247366.