Fetch: data: URL HEAD request should result in empty response body
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-10-08  Rob Buis  <rbuis@igalia.com>
2
3         Fetch: data: URL HEAD request should result in empty response body
4         https://bugs.webkit.org/show_bug.cgi?id=175764
5
6         Reviewed by Youenn Fablet.
7
8         Do not build the response body for HEAD requests for data urls:
9         https://fetch.spec.whatwg.org/#concept-main-fetch (Step 13)
10
11         Tests: imported/web-platform-tests/fetch/api/basic/scheme-data.any.js
12                imported/web-platform-tests/xhr/data-uri.html
13
14         * loader/ResourceLoader.cpp:
15         (WebCore::ResourceLoader::loadDataURL):
16
17 2019-10-08  Antti Koivisto  <antti@apple.com>
18
19         [CSS Shadow Parts] Implement style invalidation
20         https://bugs.webkit.org/show_bug.cgi?id=202632
21
22         Reviewed by Ryosuke Niwa.
23
24         Tests: fast/css/shadow-parts/invalidation-class-descendant-combinator-export.html
25                fast/css/shadow-parts/invalidation-class-descendant-combinator.html
26                fast/css/shadow-parts/invalidation-class-sibling-combinator-export.html
27                fast/css/shadow-parts/invalidation-class-sibling-combinator.html
28
29         * css/RuleFeature.cpp:
30         (WebCore::isSiblingOrSubject):
31
32         Don't treat crossing to host as moving to ancestor when computing elements impacted by a selector.
33         StyleInvalidator expects these relations to be about the host element, shadow tree invalidation in handled separately.
34
35         * dom/Element.cpp:
36         (WebCore::Element::attributeChanged):
37
38         Invalidate parts in shadow tree on 'exportparts' attribute mutation.
39
40         (WebCore::Element::partAttributeChanged):
41
42         Invalidate element on 'part' attribute mutation.
43
44         * style/StyleInvalidator.cpp:
45         (WebCore::Style::Invalidator::Invalidator):
46         (WebCore::Style::Invalidator::invalidateIfNeeded):
47
48         Invalidate parts in shadow tree during class and attribute mutation invalidation.
49
50         (WebCore::Style::Invalidator::invalidateShadowParts):
51         * style/StyleInvalidator.h:
52         (WebCore::Style::Invalidator::dirtiesAllStyle const):
53         (WebCore::Style::Invalidator::hasShadowPseudoElementRulesInAuthorSheet const): Deleted.
54
55         Remove an unncessary bool.
56
57 2019-10-08  Carlos Garcia Campos  <cgarcia@igalia.com>
58
59         Unreviewed. Remove unused WebKitSoupRequestGeneric after r250597
60
61         * platform/Soup.cmake:
62         * platform/SourcesSoup.txt:
63         * platform/network/soup/ResourceRequestSoup.cpp:
64         (WebCore::ResourceRequest::updateSoupRequest const):
65         * platform/network/soup/WebKitSoupRequestGeneric.cpp: Removed.
66         * platform/network/soup/WebKitSoupRequestGeneric.h: Removed.
67         * platform/network/soup/WebKitSoupRequestGenericClient.h: Removed.
68
69 2019-10-08  Antti Koivisto  <antti@apple.com>
70
71         [CSS Shadow Parts] Internal shadow pseudo elements should work with ::part
72         https://bugs.webkit.org/show_bug.cgi?id=202620
73
74         Reviewed by Ryosuke Niwa.
75
76         Selectors like ::part(foo)::placeholder should work.
77
78         This involves hop out of a UA shadow tree and then from an author shadow tree.
79
80         * css/ElementRuleCollector.cpp:
81         (WebCore::ElementRuleCollector::matchAuthorRules):
82         (WebCore::ElementRuleCollector::matchPartPseudoElementRules):
83
84         If we are matching a pseudo element in a UA shadow tree, see if part rules can match is the surrounding scope.
85
86         (WebCore::ElementRuleCollector::matchPartPseudoElementRulesForScope):
87         * css/ElementRuleCollector.h:
88         * css/RuleSet.cpp:
89         (WebCore::RuleSet::addRule):
90
91         Sort rules with both internal pseudo element and ::part to the part bucket.
92
93         * css/SelectorChecker.cpp:
94         (WebCore::SelectorChecker::matchRecursively const):
95         * css/parser/CSSSelectorParser.cpp:
96         (WebCore::CSSSelectorParser::splitCompoundAtImplicitShadowCrossingCombinator):
97
98         Allow multiple ShadowDescendant relations for ::part.
99
100 2019-10-07  Ryosuke Niwa  <rniwa@webkit.org>
101
102         Add IDL for requestIdleCallback
103         https://bugs.webkit.org/show_bug.cgi?id=202653
104
105         Reviewed by Geoffrey Garen.
106
107         Added the basic scaffolding for implementing requestIdleCallback disabled by default:
108         https://w3c.github.io/requestidlecallback/
109
110         This patch just adds the support for calling requestIdleCallback which generates a monotonically increasing number.
111         The callback is never called for now.
112
113         Tests: requestidlecallback/requestidlecallback-enabled.html
114                requestidlecallback/requestidlecallback-id.html
115                requestidlecallback/requestidlecallback-not-enabled.html
116
117         * CMakeLists.txt:
118         * DerivedSources.make:
119         * Sources.txt:
120         * WebCore.xcodeproj/project.pbxproj:
121         * bindings/js/WebCoreBuiltinNames.h:
122         * dom/Document.cpp:
123         (WebCore::Document::requestIdleCallback):
124         (WebCore::Document::cancelIdleCallback):
125         * dom/Document.h:
126         * dom/IdleCallbackController.cpp: Added.
127         (WebCore::IdleCallbackController::queueIdleCallback):
128         (WebCore::IdleCallbackController::removeIdleCallback):
129         * dom/IdleCallbackController.h: Added.
130         * dom/IdleDeadline.cpp: Added.
131         (WebCore::IdleDeadline::timeRemaining const):
132         (WebCore::IdleDeadline::didTimeout const):
133         * dom/IdleDeadline.h: Added.
134         * dom/IdleDeadline.idl: Added.
135         * dom/IdleRequestCallback.h: Added.
136         * dom/IdleRequestCallback.idl: Added.
137         * dom/IdleRequestOptions.h: Added.
138         * dom/IdleRequestOptions.idl: Added.
139         * page/DOMWindow.cpp:
140         (WebCore::DOMWindow::requestIdleCallback):
141         (WebCore::DOMWindow::cancelIdleCallback):
142         * page/DOMWindow.h:
143         * page/DOMWindow.idl:
144         * page/Settings.yaml:
145
146 2019-10-07  Jiewen Tan  <jiewen_tan@apple.com>
147
148         Only wrapping CryptoKeys for IDB during serialization
149         https://bugs.webkit.org/show_bug.cgi?id=202500
150         <rdar://problem/52445927>
151
152         Reviewed by Chris Dumez.
153
154         Wrapping CryptoKeys during IDB serialization is a legacy request from Netflix when WebKit was an
155         early adopter. It is not necessary for other kinds of serialization. However, given existing keys
156         stored in users' idb are wrapped, the wrapping/unwrapping mechanism cannot be easily discarded.
157         Therefore, this patch restricts the wrapping/unwrapping mechanism to idb only.
158
159         To do so, a isWrappingRequired flag is added to CryptoKey such that whenever idb sees a CryptoKey,
160         it can set it. SerializedScriptValue will then only wrap a CryptoKey when this flag is set. Otherwise,
161         a new tag UnwrappedCryptoKeyTag is used to store unwrapped CryptoKeys in order to keep the old CryptoKeyTag
162         binaries intact. For deserialization, each type will be deserialized differently.
163
164         Besides the above, this patch also hardens WorkerGlobalScope::wrapCryptoKey/unwrapCryptoKey for
165         any potential racy issues. CryptoBooleanContainer is introduced to capture boolean in the lambda.
166         workerGlobalScope is replaced with workerMessagingProxy. Now, every variables captured in the lambdas
167         should be either a copy or a thread safe ref of the original object.
168
169         Test: crypto/workers/subtle/aes-indexeddb.html
170
171         * Modules/indexeddb/IDBObjectStore.cpp:
172         (WebCore::JSC::setIsWrappingRequiredForCryptoKey):
173         (WebCore::IDBObjectStore::putOrAdd):
174         * bindings/js/SerializedScriptValue.cpp:
175         (WebCore::CloneSerializer::dumpIfTerminal):
176         (WebCore::CloneDeserializer::readTerminal):
177         * crypto/CryptoKey.h:
178         (WebCore::CryptoKey::isWrappingRequired const):
179         (WebCore::CryptoKey::setIsWrappingRequired):
180         * dom/ScriptExecutionContext.h:
181         * workers/WorkerGlobalScope.cpp:
182         (WebCore::CryptoBooleanContainer::create):
183         (WebCore::CryptoBooleanContainer::boolean const):
184         (WebCore::CryptoBooleanContainer::setBoolean):
185         (WebCore::WorkerGlobalScope::wrapCryptoKey):
186         (WebCore::WorkerGlobalScope::unwrapCryptoKey):
187         * workers/WorkerGlobalScope.h:
188         * workers/WorkerLoaderProxy.h:
189         (WebCore::WorkerLoaderProxy::isWorkerMessagingProxy const):
190         * workers/WorkerMessagingProxy.h:
191         (isType):
192
193 2019-10-07  Yusuke Suzuki  <ysuzuki@apple.com>
194
195         Unreviewed, build fix for Windows
196         https://bugs.webkit.org/show_bug.cgi?id=202569
197
198         * bindings/js/JSHTMLElementCustom.cpp:
199         (WebCore::constructJSHTMLElement):
200         * bindings/js/JSWebAnimationCustom.cpp:
201         (WebCore::constructJSWebAnimation):
202
203 2019-10-07  Yusuke Suzuki  <ysuzuki@apple.com>
204
205         [JSC] Change signature of HostFunction to (JSGlobalObject*, CallFrame*)
206         https://bugs.webkit.org/show_bug.cgi?id=202569
207
208         Reviewed by Saam Barati.
209
210         No behavior change.
211
212         While signature is changed, we still use `state` name for CallFrame* variable since changing this involves massive channge in
213         CodeGeneratorJS.pm. When replacing `ExecState*` to `JSGlobalObject*`, we just remove these `state` variable and use `globalObject`
214         instead.
215
216         * Modules/applepay/ApplePaySession.h:
217         * Modules/applepay/PaymentMerchantSession.h:
218         * Modules/fetch/FetchResponse.h:
219         * Modules/indexeddb/IDBFactory.h:
220         * Modules/indexeddb/IDBIndex.h:
221         * Modules/indexeddb/IDBKeyRange.h:
222         * Modules/indexeddb/IDBObjectStore.h:
223         * Modules/indexeddb/server/IDBSerializationContext.h:
224         * bindings/js/IDBBindingUtilities.h:
225         * bindings/js/JSDOMBindingSecurity.h:
226         * bindings/js/JSDOMBuiltinConstructor.h:
227         (WebCore::JSDOMBuiltinConstructor<JSClass>::construct):
228         * bindings/js/JSDOMConstructor.h:
229         * bindings/js/JSDOMConstructorBase.cpp:
230         (WebCore::callThrowTypeError):
231         * bindings/js/JSDOMConstructorNotConstructable.h:
232         (WebCore::JSDOMConstructorNotConstructable::callThrowTypeError):
233         * bindings/js/JSDOMGlobalObject.cpp:
234         (WebCore::makeThisTypeErrorForBuiltins):
235         (WebCore::makeGetterTypeErrorForBuiltins):
236         (WebCore::isReadableByteStreamAPIEnabled):
237         * bindings/js/JSDOMIterator.h:
238         (WebCore::IteratorTraits>::next):
239         * bindings/js/JSDOMNamedConstructor.h:
240         * bindings/js/JSDOMPromise.cpp:
241         (WebCore::DOMPromise::whenPromiseIsSettled):
242         * bindings/js/JSDOMWindowCustom.cpp:
243         (WebCore::jsDOMWindowInstanceFunctionOpenDatabase):
244         * bindings/js/JSExtendableMessageEventCustom.cpp:
245         (WebCore::constructJSExtendableMessageEvent):
246         * bindings/js/JSHTMLElementCustom.cpp:
247         (WebCore::constructJSHTMLElement):
248         * bindings/js/JSPluginElementFunctions.cpp:
249         (WebCore::callPlugin):
250         * bindings/js/JSWebAnimationCustom.cpp:
251         (WebCore::constructJSWebAnimation):
252         * bindings/js/ScriptController.cpp:
253         (WebCore::ScriptController::setupModuleScriptHandlers):
254         * bindings/js/ScriptController.h:
255         * bindings/js/ScriptModuleLoader.h:
256         * bindings/js/ScriptState.h:
257         * bindings/js/StructuredClone.cpp:
258         (WebCore::cloneArrayBufferImpl):
259         (WebCore::cloneArrayBuffer):
260         (WebCore::structuredCloneArrayBuffer):
261         (WebCore::structuredCloneArrayBufferView):
262         * bindings/js/StructuredClone.h:
263         * bindings/scripts/CodeGeneratorJS.pm:
264         (GenerateHeader):
265         (GenerateImplementation):
266         (GenerateOperationTrampolineDefinition):
267         (GenerateSerializerDefinition):
268         (GenerateLegacyCallerDefinitions):
269         (GenerateLegacyCallerDefinition):
270         (GenerateIterableDefinition):
271         (GenerateConstructorDefinitions):
272         (GenerateConstructorDefinition):
273         * bindings/scripts/test/JS/JSMapLike.cpp:
274         (WebCore::jsMapLikePrototypeFunctionGet):
275         (WebCore::jsMapLikePrototypeFunctionHas):
276         (WebCore::jsMapLikePrototypeFunctionEntries):
277         (WebCore::jsMapLikePrototypeFunctionKeys):
278         (WebCore::jsMapLikePrototypeFunctionValues):
279         (WebCore::jsMapLikePrototypeFunctionForEach):
280         (WebCore::jsMapLikePrototypeFunctionAdd):
281         (WebCore::jsMapLikePrototypeFunctionClear):
282         (WebCore::jsMapLikePrototypeFunctionDelete):
283         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
284         (WebCore::jsReadOnlyMapLikePrototypeFunctionGet):
285         (WebCore::jsReadOnlyMapLikePrototypeFunctionHas):
286         (WebCore::jsReadOnlyMapLikePrototypeFunctionEntries):
287         (WebCore::jsReadOnlyMapLikePrototypeFunctionKeys):
288         (WebCore::jsReadOnlyMapLikePrototypeFunctionValues):
289         (WebCore::jsReadOnlyMapLikePrototypeFunctionForEach):
290         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
291         (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
292         (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
293         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
294         (WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactions):
295         (WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactionsNotNeeded):
296         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
297         (WebCore::jsTestCEReactionsStringifierPrototypeFunctionToString):
298         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
299         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationInterface):
300         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationSpecified):
301         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithArguments):
302         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgument):
303         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgument):
304         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableVariantArgument):
305         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithOptionalVariantArgument):
306         (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithDefaultVariantArgument):
307         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
308         (WebCore::jsTestDOMJITPrototypeFunctionGetAttribute):
309         (WebCore::jsTestDOMJITPrototypeFunctionItem):
310         (WebCore::jsTestDOMJITPrototypeFunctionHasAttribute):
311         (WebCore::jsTestDOMJITPrototypeFunctionGetElementById):
312         (WebCore::jsTestDOMJITPrototypeFunctionGetElementsByName):
313         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
314         (WebCore::jsTestEnabledBySettingPrototypeFunctionEnabledBySettingOperation):
315         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
316         (WebCore::JSTestEventConstructorConstructor::construct):
317         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
318         (WebCore::jsTestEventTargetPrototypeFunctionItem):
319         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
320         (WebCore::jsTestGlobalObjectInstanceFunctionRegularOperation):
321         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation):
322         (WebCore::jsTestGlobalObjectConstructorFunctionEnabledAtRuntimeOperationStatic):
323         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorld):
324         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldWhenRuntimeFeatureEnabled):
325         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldWhenRuntimeFeaturesEnabled):
326         (WebCore::jsTestGlobalObjectInstanceFunctionTestPrivateFunction):
327         (WebCore::jsTestGlobalObjectInstanceFunctionCalculateSecretResult):
328         (WebCore::jsTestGlobalObjectInstanceFunctionGetSecretBoolean):
329         (WebCore::jsTestGlobalObjectInstanceFunctionTestFeatureGetSecretBoolean):
330         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
331         (WebCore::jsTestIndexedSetterWithIdentifierPrototypeFunctionIndexedSetter):
332         * bindings/scripts/test/JS/JSTestInterface.cpp:
333         (WebCore::JSTestInterfaceConstructor::construct):
334         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod1):
335         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
336         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod3):
337         (WebCore::jsTestInterfaceConstructorFunctionImplementsMethod4):
338         (WebCore::jsTestInterfacePrototypeFunctionTakeNodes):
339         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod1):
340         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
341         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod3):
342         (WebCore::jsTestInterfaceConstructorFunctionSupplementalMethod4):
343         * bindings/scripts/test/JS/JSTestIterable.cpp:
344         (WebCore::jsTestIterablePrototypeFunctionEntries):
345         (WebCore::jsTestIterablePrototypeFunctionKeys):
346         (WebCore::jsTestIterablePrototypeFunctionValues):
347         (WebCore::jsTestIterablePrototypeFunctionForEach):
348         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
349         (WebCore::jsTestJSBuiltinConstructorPrototypeFunctionTestCustomFunction):
350         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
351         (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
352         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
353         (WebCore::jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetter):
354         (WebCore::jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetter):
355         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
356         (WebCore::JSTestNamedConstructorNamedConstructor::construct):
357         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
358         (WebCore::jsTestNamedDeleterWithIdentifierPrototypeFunctionNamedDeleter):
359         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
360         (WebCore::jsTestNamedGetterWithIdentifierPrototypeFunctionGetterName):
361         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
362         (WebCore::jsTestNamedSetterWithIdentifierPrototypeFunctionNamedSetter):
363         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
364         (WebCore::jsTestNamedSetterWithIndexedGetterPrototypeFunctionNamedSetter):
365         (WebCore::jsTestNamedSetterWithIndexedGetterPrototypeFunctionIndexedSetter):
366         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
367         (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterPrototypeFunctionNamedSetter):
368         (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterPrototypeFunctionIndexedSetter):
369         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
370         (WebCore::jsTestNamedSetterWithUnforgablePropertiesInstanceFunctionUnforgeableOperation):
371         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
372         (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsInstanceFunctionUnforgeableOperation):
373         * bindings/scripts/test/JS/JSTestNode.cpp:
374         (WebCore::JSTestNodeConstructor::construct):
375         (WebCore::jsTestNodePrototypeFunctionTestWorkerPromise):
376         (WebCore::jsTestNodePrototypeFunctionCalculateSecretResult):
377         (WebCore::jsTestNodePrototypeFunctionGetSecretBoolean):
378         (WebCore::jsTestNodePrototypeFunctionTestFeatureGetSecretBoolean):
379         (WebCore::jsTestNodePrototypeFunctionEntries):
380         (WebCore::jsTestNodePrototypeFunctionKeys):
381         (WebCore::jsTestNodePrototypeFunctionValues):
382         (WebCore::jsTestNodePrototypeFunctionForEach):
383         (WebCore::jsTestNodePrototypeFunctionToJSON):
384         * bindings/scripts/test/JS/JSTestObj.cpp:
385         (WebCore::JSTestObjConstructor::construct):
386         (WebCore::callJSTestObj1):
387         (WebCore::callJSTestObj2):
388         (WebCore::callJSTestObj3):
389         (WebCore::callJSTestObj):
390         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation):
391         (WebCore::jsTestObjConstructorFunctionEnabledAtRuntimeOperationStatic):
392         (WebCore::jsTestObjPrototypeFunctionEnabledInSpecificWorldWhenRuntimeFeatureEnabled):
393         (WebCore::jsTestObjPrototypeFunctionWorldSpecificMethod):
394         (WebCore::jsTestObjPrototypeFunctionCalculateSecretResult):
395         (WebCore::jsTestObjPrototypeFunctionGetSecretBoolean):
396         (WebCore::jsTestObjPrototypeFunctionTestFeatureGetSecretBoolean):
397         (WebCore::jsTestObjPrototypeFunctionVoidMethod):
398         (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
399         (WebCore::jsTestObjPrototypeFunctionByteMethod):
400         (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
401         (WebCore::jsTestObjPrototypeFunctionOctetMethod):
402         (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
403         (WebCore::jsTestObjPrototypeFunctionLongMethod):
404         (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
405         (WebCore::jsTestObjPrototypeFunctionObjMethod):
406         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
407         (WebCore::jsTestObjInstanceFunctionUnforgeableMethod):
408         (WebCore::jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyString):
409         (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter):
410         (WebCore::jsTestObjPrototypeFunctionNullableStringMethod):
411         (WebCore::jsTestObjConstructorFunctionNullableStringStaticMethod):
412         (WebCore::jsTestObjPrototypeFunctionNullableStringSpecialMethod):
413         (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArg):
414         (WebCore::jsTestObjPrototypeFunctionMethodWithStandaloneEnumArg):
415         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArg):
416         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValue):
417         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
418         (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArg):
419         (WebCore::jsTestObjPrototypeFunctionMethodWithNullableUSVStringArg):
420         (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgTreatingNullAsEmptyString):
421         (WebCore::jsTestObjPrototypeFunctionMethodWithByteStringArg):
422         (WebCore::jsTestObjPrototypeFunctionMethodWithNullableByteStringArg):
423         (WebCore::jsTestObjPrototypeFunctionMethodWithByteStringArgTreatingNullAsEmptyString):
424         (WebCore::jsTestObjPrototypeFunctionSerializedValue):
425         (WebCore::jsTestObjPrototypeFunctionMethodWithRecord):
426         (WebCore::jsTestObjPrototypeFunctionMethodWithException):
427         (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionReturningLong):
428         (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionReturningObject):
429         (WebCore::jsTestObjPrototypeFunctionCustomMethod):
430         (WebCore::jsTestObjPrototypeFunctionCustomMethodWithArgs):
431         (WebCore::jsTestObjPrototypeFunctionPrivateMethod):
432         (WebCore::jsTestObjPrototypeFunctionPublicAndPrivateMethod):
433         (WebCore::jsTestObjPrototypeFunctionAddEventListener):
434         (WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
435         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoid):
436         (WebCore::jsTestObjPrototypeFunctionWithExecStateObj):
437         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidException):
438         (WebCore::jsTestObjPrototypeFunctionWithExecStateObjException):
439         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContext):
440         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecState):
441         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjException):
442         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpaces):
443         (WebCore::jsTestObjPrototypeFunctionWithDocumentArgument):
444         (WebCore::jsTestObjPrototypeFunctionWithCallerDocumentArgument):
445         (WebCore::jsTestObjPrototypeFunctionWithCallerWindowArgument):
446         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):
447         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue):
448         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
449         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
450         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
451         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVString):
452         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomString):
453         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue):
454         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringAndDefaultValue):
455         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNull):
456         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
457         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringIsNull):
458         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsEmptyString):
459         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVStringIsEmptyString):
460         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringIsEmptyString):
461         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaN):
462         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaN):
463         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLong):
464         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongIsZero):
465         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLong):
466         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongIsZero):
467         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequence):
468         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmpty):
469         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBoolean):
470         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalse):
471         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAny):
472         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalObject):
473         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapper):
474         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapperIsNull):
475         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolver):
476         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalRecord):
477         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalPromise):
478         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg):
479         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
480         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg):
481         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionArg):
482         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArg):
483         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionAndOptionalArg):
484         (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackAndOptionalArg):
485         (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackArg):
486         (WebCore::jsTestObjPrototypeFunctionConditionalMethod1):
487         (WebCore::jsTestObjPrototypeFunctionConditionalMethod2):
488         (WebCore::jsTestObjPrototypeFunctionConditionalMethod3):
489         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
490         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
491         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithDistinguishingUnion):
492         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWith2DistinguishingUnions):
493         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithNonDistinguishingUnion):
494         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion):
495         (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion):
496         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter):
497         (WebCore::jsTestObjConstructorFunctionClassMethod):
498         (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
499         (WebCore::jsTestObjConstructorFunctionClassMethod2):
500         (WebCore::jsTestObjConstructorFunctionOverloadedMethod1):
501         (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp):
502         (WebCore::jsTestObjPrototypeFunctionClassMethodWithClampOnOptional):
503         (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRange):
504         (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRangeOnOptional):
505         (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence):
506         (WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
507         (WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
508         (WebCore::jsTestObjPrototypeFunctionOperationWithOptionalUnionParameter):
509         (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence):
510         (WebCore::jsTestObjPrototypeFunctionGetElementById):
511         (WebCore::jsTestObjPrototypeFunctionGetSVGDocument):
512         (WebCore::jsTestObjPrototypeFunctionConvert1):
513         (WebCore::jsTestObjPrototypeFunctionConvert2):
514         (WebCore::jsTestObjPrototypeFunctionConvert3):
515         (WebCore::jsTestObjPrototypeFunctionConvert4):
516         (WebCore::jsTestObjPrototypeFunctionMutablePointFunction):
517         (WebCore::jsTestObjPrototypeFunctionOrange):
518         (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
519         (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
520         (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
521         (WebCore::jsTestObjPrototypeFunctionVariadicUnionMethod):
522         (WebCore::jsTestObjPrototypeFunctionAny):
523         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
524         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument):
525         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException):
526         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument):
527         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction):
528         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunction):
529         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithException):
530         (WebCore::jsTestObjPrototypeFunctionTestCustomPromiseFunction):
531         (WebCore::jsTestObjConstructorFunctionTestStaticCustomPromiseFunction):
532         (WebCore::jsTestObjPrototypeFunctionTestCustomReturnsOwnPromiseFunction):
533         (WebCore::jsTestObjPrototypeFunctionTestReturnsOwnPromiseAndPromiseProxyFunction):
534         (WebCore::jsTestObjPrototypeFunctionConditionalOverload):
535         (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload):
536         (WebCore::jsTestObjPrototypeFunctionAttachShadowRoot):
537         (WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameter):
538         (WebCore::jsTestObjPrototypeFunctionBufferSourceParameter):
539         (WebCore::jsTestObjPrototypeFunctionLegacyCallerNamed):
540         (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimization):
541         (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationWithException):
542         (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWindowFunction):
543         (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWorkerFunction):
544         (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWindowAndWorkerFunction):
545         (WebCore::jsTestObjPrototypeFunctionToString):
546         (WebCore::jsTestObjPrototypeFunctionToJSON):
547         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
548         (WebCore::constructJSTestOverloadedConstructors1):
549         (WebCore::constructJSTestOverloadedConstructors2):
550         (WebCore::constructJSTestOverloadedConstructors3):
551         (WebCore::constructJSTestOverloadedConstructors4):
552         (WebCore::constructJSTestOverloadedConstructors5):
553         (WebCore::JSTestOverloadedConstructorsConstructor::construct):
554         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
555         (WebCore::constructJSTestOverloadedConstructorsWithSequence1):
556         (WebCore::constructJSTestOverloadedConstructorsWithSequence2):
557         (WebCore::JSTestOverloadedConstructorsWithSequenceConstructor::construct):
558         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
559         (WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItem):
560         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
561         (WebCore::JSTestPromiseRejectionEventConstructor::construct):
562         * bindings/scripts/test/JS/JSTestSerialization.cpp:
563         (WebCore::jsTestSerializationPrototypeFunctionToJSON):
564         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
565         (WebCore::jsTestSerializationInheritPrototypeFunctionToJSON):
566         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
567         (WebCore::jsTestSerializationInheritFinalPrototypeFunctionToJSON):
568         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
569         (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionFunction):
570         (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionReturning):
571         * bindings/scripts/test/JS/JSTestStringifier.cpp:
572         (WebCore::jsTestStringifierPrototypeFunctionToString):
573         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
574         (WebCore::jsTestStringifierAnonymousOperationPrototypeFunctionToString):
575         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
576         (WebCore::jsTestStringifierNamedOperationPrototypeFunctionIdentifier):
577         (WebCore::jsTestStringifierNamedOperationPrototypeFunctionToString):
578         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
579         (WebCore::jsTestStringifierOperationImplementedAsPrototypeFunctionIdentifier):
580         (WebCore::jsTestStringifierOperationImplementedAsPrototypeFunctionToString):
581         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
582         (WebCore::jsTestStringifierOperationNamedToStringPrototypeFunctionToString):
583         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
584         (WebCore::jsTestStringifierReadOnlyAttributePrototypeFunctionToString):
585         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
586         (WebCore::jsTestStringifierReadWriteAttributePrototypeFunctionToString):
587         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
588         (WebCore::JSTestTypedefsConstructor::construct):
589         (WebCore::jsTestTypedefsPrototypeFunctionFunc):
590         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
591         (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg):
592         (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceArg):
593         (WebCore::jsTestTypedefsPrototypeFunctionSequenceOfNullablesArg):
594         (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceOfNullablesArg):
595         (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceOfUnionsArg):
596         (WebCore::jsTestTypedefsPrototypeFunctionUnionArg):
597         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
598         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampInTypedef):
599         (WebCore::jsTestTypedefsPrototypeFunctionPointFunction):
600         (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction):
601         (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction2):
602         (WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude):
603         (WebCore::jsTestTypedefsPrototypeFunctionMethodWithException):
604         * bridge/c/c_utility.h:
605         * bridge/objc/objc_runtime.mm:
606         (JSC::Bindings::callObjCFallbackObject):
607         * bridge/runtime_method.cpp:
608         (JSC::callRuntimeMethod):
609         * bridge/runtime_object.cpp:
610         (JSC::Bindings::callRuntimeObject):
611         (JSC::Bindings::callRuntimeConstructor):
612         * crypto/SubtleCrypto.h:
613         * css/CSSFontFace.h:
614         * dom/CustomElementReactionQueue.h:
615         * dom/Document.h:
616         * dom/MessagePort.h:
617         * dom/MouseEvent.h:
618         * dom/ScriptExecutionContext.h:
619         * html/HTMLFrameElementBase.h:
620         * html/canvas/WebGLAny.h:
621         * inspector/agents/InspectorDOMAgent.h:
622         * inspector/agents/page/PageRuntimeAgent.h:
623         * page/DOMWindow.h:
624         * page/PageConsoleClient.h:
625         * page/RemoteDOMWindow.h:
626         * page/csp/ContentSecurityPolicy.h:
627         * platform/ThreadGlobalData.h:
628         * plugins/PluginViewBase.h:
629         * workers/DedicatedWorkerGlobalScope.h:
630         * workers/Worker.h:
631         * workers/WorkerConsoleClient.h:
632         * workers/service/ExtendableMessageEvent.h:
633         * worklets/WorkletConsoleClient.h:
634
635 2019-10-07  Sihui Liu  <sihui_liu@apple.com>
636
637         ASSERTION FAILED: m_transactionOperationsInProgressQueue.first() == &operation in IDBTransaction::operationCompletedOnClient
638         https://bugs.webkit.org/show_bug.cgi?id=202552
639
640         Reviewed by Alex Christensen.
641
642         Dispatch task to database thread even if there is QuotaExceededError, to make sure request results are sent in 
643         order.
644
645         Modified existing test to cover this: storage/indexeddb/storage-limit.html. Test would hit this assertion 
646         without fix.
647
648         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
649         (WebCore::IDBServer::UniqueIDBDatabase::requestSpace):
650         (WebCore::IDBServer::UniqueIDBDatabase::waitForRequestSpaceCompletion):
651         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
652         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStoreAfterQuotaCheck):
653         (WebCore::IDBServer::UniqueIDBDatabase::performCreateObjectStore):
654         (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
655         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
656         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStoreAfterQuotaCheck):
657         (WebCore::IDBServer::UniqueIDBDatabase::performRenameObjectStore):
658         (WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
659         (WebCore::IDBServer::UniqueIDBDatabase::createIndex):
660         (WebCore::IDBServer::UniqueIDBDatabase::createIndexAfterQuotaCheck):
661         (WebCore::IDBServer::UniqueIDBDatabase::performCreateIndex):
662         (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
663         (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
664         (WebCore::IDBServer::UniqueIDBDatabase::renameIndexAfterQuotaCheck):
665         (WebCore::IDBServer::UniqueIDBDatabase::performRenameIndex):
666         (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
667         (WebCore::IDBServer::UniqueIDBDatabase::putOrAddAfterQuotaCheck):
668         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
669         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
670         (WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
671         (WebCore::IDBServer::UniqueIDBDatabase::getCount):
672         (WebCore::IDBServer::UniqueIDBDatabase::deleteRecord):
673         (WebCore::IDBServer::UniqueIDBDatabase::openCursor):
674         (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
675         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
676         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
677         * Modules/indexeddb/server/UniqueIDBDatabase.h:
678
679 2019-10-07  Keith Rollin  <krollin@apple.com>
680
681         Unreviewed, build fix after r250666. Fix 32- vs. 64-bit mismatch on
682         32-bit builds.
683
684         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
685         (WebCore::IDBServer::estimateSize):
686
687 2019-10-07  Ross Kirsling  <ross.kirsling@sony.com>
688
689         Unreviewed WinCairo build fix for r250786.
690
691         * Modules/cache/DOMCache.cpp:
692         (WebCore::DOMCache::addAll):
693
694 2019-10-07  Tim Horton  <timothy_horton@apple.com>
695
696         Fix the Windows build
697
698         * html/ImageBitmap.h:
699
700 2019-10-07  Ross Kirsling  <ross.kirsling@sony.com>
701
702         Unreviewed WinCairo build fix for r250758.
703
704         * workers/service/ServiceWorkerContainer.cpp:
705         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
706
707 2019-10-07  Ryosuke Niwa  <rniwa@webkit.org>
708
709         focus pseudo class should match a shadow host whose shadow tree contains the focused element
710         https://bugs.webkit.org/show_bug.cgi?id=202432
711
712         Reviewed by Antti Koivisto.
713
714         Note that focus pseudo class does not match a shadow host when its shadow tree contains a slot element
715         with a focused element or its ancestor assigned since such a shadow host has the actual focused element
716         in the same tree as the shadow host. (e.g. the focused element can be a direct child of the host).
717
718         In order to preserve the behavior of focus ring, which should be only drawn on the currently focused
719         element and not any shadow host which contains such an element, this patch introduces a new pseudo class,
720         -webkit-direct-focus, which is only available in the user agent stylesheet. Putting :host(:focus) rule
721         isn't sufficient because style rules inside shadow trees always has a lower precendence than rules
722         outside the shadow tree (the tree of its shadow host).
723
724         [1] Also see https://github.com/whatwg/html/pull/4731
725
726         Tests: fast/shadow-dom/direct-focus-pseudo-does-not-match-in-author-stylesheet.html
727                fast/shadow-dom/focus-pseudo-matches-on-shadow-host.html
728                fast/shadow-dom/focus-pseudo-on-shadow-host-1.html
729                fast/shadow-dom/focus-pseudo-on-shadow-host-2.html
730                fast/shadow-dom/focus-pseudo-on-shadow-host-3.html
731
732         * css/CSSSelector.cpp:
733         (WebCore::CSSSelector::selectorText const): Added the support for -webkit-direct-focus.
734         * css/CSSSelector.h:
735         * css/RuleSet.cpp:
736         (WebCore::RuleSet::addRule): Ditto.
737         * css/SelectorChecker.cpp:
738         (WebCore::SelectorChecker::checkOne const):: Ditto.
739         (WebCore::doesShadowTreeContainFocusedElement):: Ditto.
740         (WebCore::SelectorChecker::matchesFocusPseudoClass): Implemented the new behavior.
741         (WebCore::SelectorChecker::matchesDirectFocusPseudoClass): Added. Implements the old behavior for
742         the focus ring via -webkit-direct-focus pseudo class.
743         * css/SelectorChecker.h:
744         * css/SelectorPseudoClassAndCompatibilityElementMap.in: Added -webkit-direct-focus.
745         * css/html.css: Use -webkit-direct-focus pseudo class to preserve the existing behavior of focus ring.
746         * css/parser/CSSSelectorParser.cpp:
747         (WebCore::CSSSelectorParser::consumePseudo): Ignore -webkit-direct-focus in author and user stylesheets.
748         * cssjit/SelectorCompiler.cpp:
749         (WebCore::SelectorCompiler::addPseudoClassType): Added the support for -webkit-direct-focus.
750         * dom/Element.cpp:
751         (WebCore::Element::setFocus): Invoke setContainsFocusedElement on each shadow ancestor root of
752         the newly focused element. Note that we can't use :focus-within pseudo class since that would also match
753         the host of a shadow root which contains a slotted focused element, causing both the shadow host and
754         the slotted element to match :focus pseudo class in the host's tree.
755         * dom/ShadowRoot.h:
756
757 2019-10-07  Rob Buis  <rbuis@igalia.com>
758
759         Change Response's statusText's default
760         https://bugs.webkit.org/show_bug.cgi?id=191879
761
762         Reviewed by Youenn Fablet.
763
764         Change Response's statusText's default to "".
765
766         Tests: web-platform-tests/fetch/api/response/response-clone.html
767                web-platform-tests/fetch/api/response/response-init-001.html
768
769         * Modules/fetch/FetchResponse.h:
770         * Modules/fetch/FetchResponse.idl:
771
772 2019-10-07  Chris Dumez  <cdumez@apple.com>
773
774         DOMCache should not prevent pages from entering the back/forward cache
775         https://bugs.webkit.org/show_bug.cgi?id=202590
776
777         Reviewed by Youenn Fablet.
778
779         Allow DOMCache to suspend in the back/forward cache unconditionally, by
780         appending all promise resolutions to a SuspendableTaskQueue. This guarantees
781         that any asynchronous promise resolution is delayed while in the page cache,
782         until the page gets resumed.
783
784         Test: http/tests/navigation/page-cache-domcache-pending-promise.html
785
786         * Modules/cache/DOMCache.cpp:
787         (WebCore::DOMCache::DOMCache):
788         (WebCore::DOMCache::match):
789         (WebCore::DOMCache::matchAll):
790         (WebCore::DOMCache::addAll):
791         (WebCore::DOMCache::putWithResponseData):
792         (WebCore::DOMCache::put):
793         (WebCore::DOMCache::remove):
794         (WebCore::DOMCache::keys):
795         (WebCore::DOMCache::canSuspendForDocumentSuspension const):
796         * Modules/cache/DOMCache.h:
797
798 2019-10-07  Chris Dumez  <cdumez@apple.com>
799
800         PendingImageBitmap should not prevent entering the back/forward cache
801         https://bugs.webkit.org/show_bug.cgi?id=202585
802
803         Reviewed by Tim Horton.
804
805         Add PageCache support to PendingImageBitmap by doing the promise resolution on a
806         SuspendableTimer (which properly gets paused while in PageCache).
807
808         Test: fast/history/page-cache-createImageBitmap.html
809
810         * html/ImageBitmap.cpp:
811
812 2019-10-07  Dirk Schulze  <krit@webkit.org>
813
814         clip-path: <geometry-box> mapping incorrect
815         https://bugs.webkit.org/show_bug.cgi?id=202075
816
817         Reviewed by Simon Fraser.
818
819         For HTML elements:
820         - stroke-box, view-box consistently compute to border-box
821         - fill-box computes to content-box
822
823         Tests: css3/masking/clip-path-border-radius-fill-box-001.html
824                css3/masking/clip-path-border-radius-stroke-box-000.html
825                css3/masking/clip-path-border-radius-view-box-000.html
826
827         * rendering/RenderBlock.cpp:
828         (WebCore::RenderBlock::nodeAtPoint):
829         * rendering/shapes/BoxShape.cpp:
830         (WebCore::computeRoundedRectForBoxShape):
831
832 2019-10-07  Tim Horton  <timothy_horton@apple.com>
833
834         Fix the Windows build
835
836         * html/ImageBitmap.h:
837
838 2019-10-07  Zalan Bujtas  <zalan@apple.com>
839
840         [LFC] Add const version of LayoutState::displayBoxForLayoutBox
841         https://bugs.webkit.org/show_bug.cgi?id=202623
842         <rdar://problem/56025259>
843
844         Reviewed by Antti Koivisto.
845
846         * layout/LayoutState.cpp:
847         (WebCore::Layout::LayoutState::displayBoxForLayoutBox):
848         (WebCore::Layout::LayoutState::displayBoxForLayoutBox const):
849         * layout/LayoutState.h:
850         * layout/layouttree/LayoutTreeBuilder.cpp:
851         (WebCore::Layout::outputLayoutTree):
852
853 2019-10-07  youenn fablet  <youenn@apple.com>
854
855         [iOS] Unmuting capture of a page is not working
856         https://bugs.webkit.org/show_bug.cgi?id=202627
857
858         Reviewed by Eric Carlson.
859
860         Before the patch, we were muting the capture tracks but never unmuting them.
861         The patch updates the code to make sure we unmute capture tracks based on the document state.
862         In addition, the iOS code wass process-wide while capture might happen between two documents in the same process.
863         The patch updates the capturestate computation and muting logic to be Document based.
864         A follow-up refactoring will merge back iOS and MacOS code paths.
865         Covered by API test.
866
867         * Modules/mediastream/MediaStreamTrack.cpp:
868         (WebCore::MediaStreamTrack::captureState):
869         (WebCore::MediaStreamTrack::updateCaptureAccordingMutedState):
870         (WebCore::MediaStreamTrack::muteCapture): Deleted.
871         * Modules/mediastream/MediaStreamTrack.h:
872         * dom/Document.cpp:
873         (WebCore::Document::updateIsPlayingMedia):
874         (WebCore::Document::pageMutedStateDidChange):
875
876 2019-10-06  Ryosuke Niwa  <rniwa@webkit.org>
877
878         attachShadow should support attaching a shadow root to a main element
879         https://bugs.webkit.org/show_bug.cgi?id=197726
880
881         Reviewed by Antti Koivisto.
882
883         Added main element to the list of elements that support an author shadow root.
884
885         Test: fast/shadow-dom/attach-shadow-to-elements.html
886
887         * dom/Element.cpp:
888         (WebCore::canAttachAuthorShadowRoot):
889
890 2019-10-06  Zalan Bujtas  <zalan@apple.com>
891
892         [LFC][Painting] Introduce Display::Painter
893         https://bugs.webkit.org/show_bug.cgi?id=202614
894         <rdar://problem/56010347>
895
896         Reviewed by Antti Koivisto.
897
898         Display::Painter is responsible for rendering the nodes in the display tree. Testing purposes/WK1 only at this point.
899
900         * Sources.txt:
901         * WebCore.xcodeproj/project.pbxproj:
902         * layout/LayoutContext.cpp:
903         (WebCore::Layout::initializeLayoutState):
904         (WebCore::Layout::LayoutContext::runLayout):
905         (WebCore::Layout::LayoutContext::runLayoutAndVerify):
906         (WebCore::Layout::LayoutContext::runLayoutAndPaint):
907         (WebCore::Layout::LayoutContext::run): Deleted.
908         * layout/LayoutContext.h:
909         * layout/LayoutState.cpp:
910         (WebCore::Layout::LayoutState::LayoutState):
911         * layout/LayoutState.h:
912         (WebCore::Layout::LayoutState::root const):
913         * layout/Verification.cpp:
914         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree):
915         * layout/displaytree/DisplayPainter.cpp: Added.
916         (WebCore::Display::Painter::paint):
917         * layout/displaytree/DisplayPainter.h: Added.
918         * layout/layouttree/LayoutTreeBuilder.cpp:
919         (WebCore::Layout::printLayoutTreeForLiveDocuments):
920         * page/FrameView.cpp:
921         (WebCore::FrameView::paintContents):
922         * page/FrameViewLayoutContext.cpp:
923         (WebCore::layoutUsingFormattingContext):
924
925 2019-10-06  Antti Koivisto  <antti@apple.com>
926
927         Node::ref/deref should be const
928         https://bugs.webkit.org/show_bug.cgi?id=202562
929
930         Reviewed by Ryosuke Niwa.
931
932         This enables RefPtr<const Element> and matches RefCounted.
933
934         * css/ElementRuleCollector.cpp:
935         (WebCore::ElementRuleCollector::collectMatchingRules):
936         (WebCore::ElementRuleCollector::matchAuthorRules):
937         (WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
938         (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
939         (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
940         (WebCore::ElementRuleCollector::matchPartPseudoElementRules):
941         (WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
942         (WebCore::ElementRuleCollector::collectSlottedPseudoElementRulesForSlot):
943         (WebCore::ElementRuleCollector::matchUARules):
944         (WebCore::ElementRuleCollector::ruleMatches):
945         (WebCore::ElementRuleCollector::matchAllRules):
946
947         Use it to ref elements in ElementRuleCollector.
948
949         * css/ElementRuleCollector.h:
950         (WebCore::ElementRuleCollector::element const):
951         * dom/Node.h:
952         (WebCore::Node::ref const):
953         (WebCore::Node::deref const):
954         (WebCore::Node::ref): Deleted.
955         (WebCore::Node::deref): Deleted.
956
957 2019-10-05  Zalan Bujtas  <zalan@apple.com>
958
959         [LFC] LayoutChildtIteratorAdapter -> LayoutChildIteratorAdapter
960         https://bugs.webkit.org/show_bug.cgi?id=202612
961         <rdar://problem/56007611>
962
963         Reviewed by Anders Carlsson.
964
965         * layout/layouttree/LayoutChildIterator.h:
966         (WebCore::Layout::LayoutChildIterator<T>::LayoutChildIterator):
967         (WebCore::Layout::LayoutChildIterator<T>::operator):
968         (WebCore::Layout::LayoutChildIteratorAdapter<T>::LayoutChildIteratorAdapter):
969         (WebCore::Layout::LayoutChildIteratorAdapter<T>::begin const):
970         (WebCore::Layout::LayoutChildIteratorAdapter<T>::end const):
971         (WebCore::Layout::LayoutChildIteratorAdapter<T>::first const):
972         (WebCore::Layout::LayoutChildIteratorAdapter<T>::last const):
973         (WebCore::Layout::childrenOfType):
974         (WebCore::Layout::LayoutChildtIterator<T>::LayoutChildtIterator): Deleted.
975         (WebCore::Layout::LayoutChildtIterator<T>::operator): Deleted.
976         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::LayoutChildtIteratorAdapter): Deleted.
977         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::begin const): Deleted.
978         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::end const): Deleted.
979         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::first const): Deleted.
980         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::last const): Deleted.
981
982 2019-10-05  Zalan Bujtas  <zalan@apple.com>
983
984         [LFC] Remove redundant includes.
985         https://bugs.webkit.org/show_bug.cgi?id=202610
986         <rdar://problem/56003250>
987
988         Reviewed by Tim Horton.
989
990         * layout/FormattingContext.h:
991         * layout/FormattingContextGeometry.cpp:
992         * layout/FormattingContextQuirks.cpp:
993         * layout/FormattingState.h:
994         * layout/LayoutContext.h:
995         * layout/LayoutState.h:
996         * layout/LayoutUnits.h:
997         * layout/blockformatting/BlockFormattingContext.cpp:
998         * layout/blockformatting/BlockFormattingContext.h:
999         * layout/blockformatting/BlockFormattingState.cpp:
1000         * layout/blockformatting/BlockFormattingState.h:
1001         * layout/blockformatting/BlockInvalidation.h:
1002         * layout/displaytree/DisplayRect.h:
1003         * layout/displaytree/DisplayRun.h:
1004         * layout/floats/FloatAvoider.cpp:
1005         * layout/floats/FloatAvoider.h:
1006         * layout/floats/FloatBox.h:
1007         * layout/floats/FloatingContext.cpp:
1008         * layout/floats/FloatingContext.h:
1009         * layout/floats/FloatingState.h:
1010         * layout/inlineformatting/InlineFormattingContext.cpp:
1011         * layout/inlineformatting/InlineFormattingContext.h:
1012         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1013         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
1014         * layout/inlineformatting/InlineInvalidation.h:
1015         * layout/inlineformatting/InlineLine.h:
1016         * layout/inlineformatting/InlineLineBreaker.cpp:
1017         * layout/inlineformatting/InlineLineLayout.cpp:
1018         * layout/layouttree/LayoutBox.h:
1019         * layout/tableformatting/TableFormattingContext.h:
1020         * layout/tableformatting/TableFormattingContextGeometry.cpp:
1021         * layout/tableformatting/TableGrid.h:
1022         * layout/tableformatting/TableInvalidation.h:
1023
1024 2019-10-04  Ryosuke Niwa  <rniwa@webkit.org>
1025
1026         Change "InvalidStateError" to "NotSupportedError" for attachShadow()
1027         https://bugs.webkit.org/show_bug.cgi?id=197948
1028
1029         Reviewed by Wenson Hsieh.
1030
1031         Match the latest spec. See https://github.com/whatwg/dom/pull/761
1032
1033         * dom/Element.cpp:
1034         (WebCore::Element::attachShadow): Throw NotSupportedError when there is already a shadow tree.
1035
1036 2019-10-04  Chris Dumez  <cdumez@apple.com>
1037
1038         Allow pages using EventSource to enter the back/forward cache
1039         https://bugs.webkit.org/show_bug.cgi?id=202370
1040         <rdar://problem/55853142>
1041
1042         Reviewed by Geoffrey Garen.
1043
1044         Allow pages using EventSource to enter the back/forward cache. If the EventSource is
1045         connecting at the time it enters PageCache, it will resume connecting after restoring
1046         from PageCache (by making m_connectTimer a SuspendableTimer, which is PageCache-aware).
1047         If the EventSource is was open upon navigating, it gets closed upon navigating (since
1048         all pending loads get cancelled on navigation). To help the page recover, we fire an
1049         error event and attempt to reconnect automatically when restoring the page from page
1050         cache. It is allowed by the specification to attempt reconnection in case of non-fatal
1051         network errors.
1052
1053         Tests: http/tests/eventsource/eventsource-page-cache-connected.html
1054                http/tests/eventsource/eventsource-page-cache-connecting.html
1055
1056         * page/EventSource.cpp:
1057         (WebCore::EventSource::EventSource):
1058         (WebCore::EventSource::scheduleReconnect):
1059         (WebCore::EventSource::close):
1060         (WebCore::EventSource::didReceiveResponse):
1061         (WebCore::EventSource::dispatchErrorEvent):
1062         (WebCore::EventSource::didReceiveData):
1063         (WebCore::EventSource::didFinishLoading):
1064         (WebCore::EventSource::didFail):
1065         (WebCore::EventSource::abortConnectionAttempt):
1066         (WebCore::EventSource::doExplicitLoadCancellation):
1067         (WebCore::EventSource::canSuspendForDocumentSuspension const):
1068         (WebCore::EventSource::suspend):
1069         (WebCore::EventSource::resume):
1070         (WebCore::EventSource::dispatchMessageEvent):
1071         * page/EventSource.h:
1072
1073 2019-10-04  Chris Dumez  <cdumez@apple.com>
1074
1075         ServiceWorkerContainer should never prevent a page from entering the back/forward cache
1076         https://bugs.webkit.org/show_bug.cgi?id=202603
1077
1078         Reviewed by Geoff Garen.
1079
1080         Make it so that ServiceWorkerContainer can suspend, even if they have pending promises.
1081         We now queue all promise resolutions to a SuspendableTaskQueue to make sure that those
1082         promises do not get resolved while in the page cache.
1083
1084         Test: http/tests/workers/service/page-cache-service-worker-pending-promise.https.html
1085
1086         * workers/service/ServiceWorkerContainer.cpp:
1087         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
1088         (WebCore::ServiceWorkerContainer::ready):
1089         (WebCore::ServiceWorkerContainer::getRegistration):
1090         (WebCore::ServiceWorkerContainer::getRegistrations):
1091         (WebCore::ServiceWorkerContainer::jobFailedWithException):
1092         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
1093         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
1094         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
1095         (WebCore::ServiceWorkerContainer::canSuspendForDocumentSuspension const):
1096         * workers/service/ServiceWorkerContainer.h:
1097
1098 2019-10-04  Chris Dumez  <cdumez@apple.com>
1099
1100         Allow pages using IDBIndex to enter the PageCache
1101         https://bugs.webkit.org/show_bug.cgi?id=202430
1102         <rdar://problem/55887918>
1103
1104         Reviewed by Geoffrey Garen.
1105
1106         There is no reason to prevent PageCaching when an IDBIndex object is alive.
1107         No events are fired by IDBIndex and its API returns IDBRequest objects, which
1108         are already PageCache-aware.
1109
1110         I have seen Yahoo.com failing to enter the back/forward cache because of this.
1111
1112         No new tests, updated existing test.
1113
1114         * Modules/indexeddb/IDBIndex.cpp:
1115         (WebCore::IDBIndex::canSuspendForDocumentSuspension const):
1116
1117 2019-10-04  Heiko Becker  <heirecka@exherbo.org>
1118
1119         Fix build with icu 65.1
1120         https://bugs.webkit.org/show_bug.cgi?id=202600
1121
1122         Reviewed by Konstantin Tokarev.
1123
1124         * dom/Document.cpp:
1125         (WebCore::isValidNameNonASCII):
1126         (WebCore::Document::parseQualifiedName):
1127
1128 2019-10-04  James Darpinian  <jdarpinian@chromium.org>
1129
1130         Allow using WebGL 2 when USE_ANGLE=1
1131         https://bugs.webkit.org/show_bug.cgi?id=202593
1132
1133         Reviewed by Alex Christensen.
1134
1135         * html/canvas/WebGLRenderingContextBase.cpp:
1136         (WebCore::WebGLRenderingContextBase::create):
1137             Disable irrelevant extension check.
1138         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
1139         (WebCore::GraphicsContext3D::GraphicsContext3D):
1140             Use ES3 ANGLE context when WebGL 2 is requested.
1141
1142 2019-10-04  Alex Christensen  <achristensen@webkit.org>
1143
1144         Stop sending list of display-isolated schemes to NetworkProcess
1145         https://bugs.webkit.org/show_bug.cgi?id=202557
1146
1147         Reviewed by Youenn Fablet.
1148
1149         They are only ever used in the WebProcess in SecurityOrigin::canDisplay.
1150         If someone adds code that uses them in the NetworkProcess, they will hit my new assertion.
1151
1152         No change in behavior.
1153
1154         * page/SecurityOrigin.cpp:
1155         (WebCore::SecurityOrigin::canDisplay const):
1156         * platform/RuntimeApplicationChecks.h:
1157         (WebCore::isInNetworkProcess):
1158         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
1159         (WebCore::isInNetworkProcess):
1160
1161 2019-10-04  Alex Christensen  <achristensen@webkit.org>
1162
1163         Rename SchemeRegistry to LegacySchemeRegistry
1164         https://bugs.webkit.org/show_bug.cgi?id=202586
1165
1166         Reviewed by Tim Horton.
1167
1168         SchemeRegistry is process-global.  We need to replace it with a non-process-global registry, but Rome wasn't built in a day.
1169         This rename allows me to call the replacement object that will have ownership and configuration "SchemeRegistry"
1170         and it also indicates that new development should use the owned object instead of the global object.
1171
1172         * Headers.cmake:
1173         * Modules/mediastream/UserMediaController.cpp:
1174         (WebCore::isSecure):
1175         * Modules/mediastream/UserMediaRequest.cpp:
1176         * Modules/webauthn/AuthenticatorCoordinator.cpp:
1177         (WebCore::AuthenticatorCoordinatorInternal::processAppIdExtension):
1178         * Modules/webdatabase/DatabaseContext.cpp:
1179         (WebCore::DatabaseContext::allowDatabaseAccess const):
1180         * Sources.txt:
1181         * WebCore.xcodeproj/project.pbxproj:
1182         * dom/Document.cpp:
1183         (WebCore::Document::setDomain):
1184         * dom/ScriptExecutionContext.cpp:
1185         (WebCore::ScriptExecutionContext::hasServiceWorkerScheme const):
1186         * html/HTMLPlugInImageElement.cpp:
1187         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
1188         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
1189         * loader/CrossOriginAccessControl.cpp:
1190         (WebCore::isValidCrossOriginRedirectionURL):
1191         * loader/DocumentLoader.cpp:
1192         (WebCore::DocumentLoader::matchRegistration):
1193         (WebCore::DocumentLoader::disallowWebArchive const):
1194         (WebCore::DocumentLoader::commitData):
1195         (WebCore::DocumentLoader::maybeLoadEmpty):
1196         * loader/DocumentThreadableLoader.cpp:
1197         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
1198         (WebCore::DocumentThreadableLoader::checkURLSchemeAsCORSEnabled):
1199         * loader/archive/mhtml/MHTMLArchive.cpp:
1200         (WebCore::MHTMLArchive::create):
1201         * loader/cache/CachedResource.cpp:
1202         (WebCore::CachedResource::freshnessLifetime const):
1203         * page/Page.cpp:
1204         (WebCore::Page::userStyleSheetLocationChanged):
1205         * page/SecurityOrigin.cpp:
1206         (WebCore::shouldTreatAsUniqueOrigin):
1207         (WebCore::shouldTreatAsPotentiallyTrustworthy):
1208         (WebCore::SecurityOrigin::SecurityOrigin):
1209         (WebCore::SecurityOrigin::isSecure):
1210         (WebCore::SecurityOrigin::canDisplay const):
1211         (WebCore::SecurityOrigin::domainForCachePartition const):
1212         * page/csp/ContentSecurityPolicy.cpp:
1213         (WebCore::ContentSecurityPolicy::allowObjectFromSource const):
1214         (WebCore::ContentSecurityPolicy::allowChildFrameFromSource const):
1215         (WebCore::ContentSecurityPolicy::allowResourceFromSource const):
1216         (WebCore::ContentSecurityPolicy::allowConnectToSource const):
1217         (WebCore::ContentSecurityPolicy::allowBaseURI const):
1218         * platform/LegacySchemeRegistry.cpp: Copied from Source/WebCore/platform/SchemeRegistry.cpp.
1219         (WebCore::allBuiltinSchemes):
1220         (WebCore::LegacySchemeRegistry::registerURLSchemeAsLocal):
1221         (WebCore::LegacySchemeRegistry::removeURLSchemeRegisteredAsLocal):
1222         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsLocal):
1223         (WebCore::LegacySchemeRegistry::registerURLSchemeAsNoAccess):
1224         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsNoAccess):
1225         (WebCore::LegacySchemeRegistry::registerURLSchemeAsDisplayIsolated):
1226         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated):
1227         (WebCore::LegacySchemeRegistry::registerURLSchemeAsSecure):
1228         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsSecure):
1229         (WebCore::LegacySchemeRegistry::registerURLSchemeAsEmptyDocument):
1230         (WebCore::LegacySchemeRegistry::shouldLoadURLSchemeAsEmptyDocument):
1231         (WebCore::LegacySchemeRegistry::setDomainRelaxationForbiddenForURLScheme):
1232         (WebCore::LegacySchemeRegistry::isDomainRelaxationForbiddenForURLScheme):
1233         (WebCore::LegacySchemeRegistry::canDisplayOnlyIfCanRequest):
1234         (WebCore::LegacySchemeRegistry::registerAsCanDisplayOnlyIfCanRequest):
1235         (WebCore::LegacySchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs):
1236         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs):
1237         (WebCore::LegacySchemeRegistry::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing):
1238         (WebCore::LegacySchemeRegistry::allowsDatabaseAccessInPrivateBrowsing):
1239         (WebCore::LegacySchemeRegistry::registerURLSchemeAsCORSEnabled):
1240         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsCORSEnabled):
1241         (WebCore::LegacySchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy):
1242         (WebCore::LegacySchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
1243         (WebCore::LegacySchemeRegistry::schemeShouldBypassContentSecurityPolicy):
1244         (WebCore::LegacySchemeRegistry::registerURLSchemeAsAlwaysRevalidated):
1245         (WebCore::LegacySchemeRegistry::shouldAlwaysRevalidateURLScheme):
1246         (WebCore::LegacySchemeRegistry::registerURLSchemeAsCachePartitioned):
1247         (WebCore::LegacySchemeRegistry::shouldPartitionCacheForURLScheme):
1248         (WebCore::LegacySchemeRegistry::registerURLSchemeServiceWorkersCanHandle):
1249         (WebCore::LegacySchemeRegistry::canServiceWorkersHandleURLScheme):
1250         (WebCore::LegacySchemeRegistry::isServiceWorkerContainerCustomScheme):
1251         (WebCore::LegacySchemeRegistry::isUserExtensionScheme):
1252         (WebCore::LegacySchemeRegistry::isBuiltinScheme):
1253         (WebCore::SchemeRegistry::registerURLSchemeAsLocal): Deleted.
1254         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal): Deleted.
1255         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal): Deleted.
1256         (WebCore::SchemeRegistry::registerURLSchemeAsNoAccess): Deleted.
1257         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess): Deleted.
1258         (WebCore::SchemeRegistry::registerURLSchemeAsDisplayIsolated): Deleted.
1259         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated): Deleted.
1260         (WebCore::SchemeRegistry::registerURLSchemeAsSecure): Deleted.
1261         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure): Deleted.
1262         (WebCore::SchemeRegistry::registerURLSchemeAsEmptyDocument): Deleted.
1263         (WebCore::SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument): Deleted.
1264         (WebCore::SchemeRegistry::setDomainRelaxationForbiddenForURLScheme): Deleted.
1265         (WebCore::SchemeRegistry::isDomainRelaxationForbiddenForURLScheme): Deleted.
1266         (WebCore::SchemeRegistry::canDisplayOnlyIfCanRequest): Deleted.
1267         (WebCore::SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest): Deleted.
1268         (WebCore::SchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs): Deleted.
1269         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs): Deleted.
1270         (WebCore::SchemeRegistry::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing): Deleted.
1271         (WebCore::SchemeRegistry::allowsDatabaseAccessInPrivateBrowsing): Deleted.
1272         (WebCore::SchemeRegistry::registerURLSchemeAsCORSEnabled): Deleted.
1273         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsCORSEnabled): Deleted.
1274         (WebCore::SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy): Deleted.
1275         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy): Deleted.
1276         (WebCore::SchemeRegistry::schemeShouldBypassContentSecurityPolicy): Deleted.
1277         (WebCore::SchemeRegistry::registerURLSchemeAsAlwaysRevalidated): Deleted.
1278         (WebCore::SchemeRegistry::shouldAlwaysRevalidateURLScheme): Deleted.
1279         (WebCore::SchemeRegistry::registerURLSchemeAsCachePartitioned): Deleted.
1280         (WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme): Deleted.
1281         (WebCore::SchemeRegistry::registerURLSchemeServiceWorkersCanHandle): Deleted.
1282         (WebCore::SchemeRegistry::canServiceWorkersHandleURLScheme): Deleted.
1283         (WebCore::SchemeRegistry::isServiceWorkerContainerCustomScheme): Deleted.
1284         (WebCore::SchemeRegistry::isUserExtensionScheme): Deleted.
1285         (WebCore::SchemeRegistry::isBuiltinScheme): Deleted.
1286         * platform/LegacySchemeRegistry.h: Copied from Source/WebCore/platform/SchemeRegistry.h.
1287         * platform/SchemeRegistry.cpp: Removed.
1288         * platform/SchemeRegistry.h: Removed.
1289         * platform/ios/QuickLook.mm:
1290         * storage/Storage.cpp:
1291         * testing/Internals.cpp:
1292         (WebCore::Internals::registerURLSchemeAsBypassingContentSecurityPolicy):
1293         (WebCore::Internals::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
1294         * workers/service/ServiceWorkerContainer.cpp:
1295         (WebCore::ServiceWorkerContainer::addRegistration):
1296         * workers/service/ServiceWorkerProvider.cpp:
1297         (WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
1298         * workers/service/server/SWServerJobQueue.cpp:
1299         (WebCore::SWServerJobQueue::runRegisterJob):
1300
1301 2019-10-04  Antoine Quint  <graouts@apple.com>
1302
1303         Crash in debug build with imported/w3c/web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-replacement.html
1304         https://bugs.webkit.org/show_bug.cgi?id=202583
1305
1306         Reviewed by Dean Jackson.
1307
1308         Ensure we remove the animation from the timeline it's currently associated with since it may have changed since its creation. This caused
1309         a crash because we have an assertion in AnimationTimeline::removeAnimation() to check that the animation belonged to the timeline it's called on.
1310
1311         * animation/DocumentTimeline.cpp:
1312         (WebCore::DocumentTimeline::removeReplacedAnimations):
1313
1314 2019-10-04  Tim Horton  <timothy_horton@apple.com>
1315
1316         Clean up some includes to make the build a bit faster: DOMPromise
1317         https://bugs.webkit.org/show_bug.cgi?id=202570
1318
1319         Reviewed by Chris Dumez.
1320
1321         No new tests, just reorganizing.
1322
1323         Apply some profile-guided optimizations to our headers.
1324
1325         Get JSDOMPromiseDeferred.h and DOMPromiseProxy.h out of WebCore headers.
1326         One remains (FetchBodyConsumer.h); I leave it as an exercise to the reader.
1327         In my testing, this is worth a reliable 5-6% on the WebCore Build Benchmark.
1328
1329         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1330         * Modules/encryptedmedia/MediaKeySession.cpp:
1331         * Modules/encryptedmedia/MediaKeySession.h:
1332         * Modules/encryptedmedia/MediaKeySystemAccess.cpp:
1333         * Modules/encryptedmedia/MediaKeySystemAccess.h:
1334         * Modules/encryptedmedia/MediaKeys.cpp:
1335         * Modules/encryptedmedia/MediaKeys.h:
1336         * Modules/encryptedmedia/NavigatorEME.cpp:
1337         * Modules/encryptedmedia/NavigatorEME.h:
1338         * Modules/fetch/DOMWindowFetch.cpp:
1339         * Modules/fetch/DOMWindowFetch.h:
1340         * Modules/fetch/FetchBody.cpp:
1341         * Modules/fetch/FetchBody.h:
1342         * Modules/fetch/FetchLoader.cpp:
1343         * Modules/fetch/FetchLoader.h:
1344         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
1345         * Modules/fetch/WorkerGlobalScopeFetch.h:
1346         * Modules/mediacapabilities/MediaCapabilities.cpp:
1347         * Modules/mediacapabilities/MediaCapabilities.h:
1348         * Modules/mediastream/MediaDevices.cpp:
1349         * Modules/mediastream/MediaDevices.h:
1350         * Modules/mediastream/MediaStreamTrack.cpp:
1351         * Modules/mediastream/MediaStreamTrack.h:
1352         * Modules/mediastream/PeerConnectionBackend.cpp:
1353         * Modules/mediastream/PeerConnectionBackend.h:
1354         * Modules/mediastream/RTCPeerConnection.cpp:
1355         * Modules/mediastream/RTCRtpReceiver.h:
1356         * Modules/mediastream/RTCRtpSenderBackend.h:
1357         * Modules/mediastream/UserMediaRequest.cpp:
1358         * Modules/mediastream/UserMediaRequest.h:
1359         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1360         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
1361         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
1362         * Modules/paymentrequest/PaymentRequest.cpp:
1363         * Modules/paymentrequest/PaymentRequest.h:
1364         * Modules/paymentrequest/PaymentResponse.cpp:
1365         * Modules/paymentrequest/PaymentResponse.h:
1366         * Modules/streams/ReadableStreamSource.h:
1367         * Modules/webaudio/AudioContext.h:
1368         * Modules/webauthn/AuthenticatorCoordinator.cpp:
1369         * Modules/webauthn/AuthenticatorCoordinator.h:
1370         * Modules/webauthn/PublicKeyCredential.h:
1371         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
1372         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
1373         * Modules/webgpu/WebGPU.cpp:
1374         * Modules/webgpu/WebGPU.h:
1375         * Modules/webgpu/WebGPUAdapter.cpp:
1376         * Modules/webgpu/WebGPUAdapter.h:
1377         * Modules/webgpu/WebGPUBuffer.cpp:
1378         * Modules/webgpu/WebGPUBuffer.h:
1379         * Modules/webgpu/WebGPUDevice.cpp:
1380         * Modules/webgpu/WebGPUDevice.h:
1381         * Modules/webvr/NavigatorWebVR.cpp:
1382         * Modules/webvr/NavigatorWebVR.h:
1383         * Modules/webvr/VRDisplay.cpp:
1384         * Modules/webvr/VRDisplay.h:
1385         * Sources.txt:
1386         * WebCore.xcodeproj/project.pbxproj:
1387         * animation/KeyframeEffect.cpp:
1388         * animation/WebAnimation.cpp:
1389         * animation/WebAnimation.h:
1390         * bindings/js/CachedModuleScriptLoader.cpp:
1391         * bindings/js/CachedModuleScriptLoaderClient.h:
1392         * bindings/js/JSDOMPromiseDeferred.h:
1393         * bindings/js/JSHTMLTemplateElementCustom.cpp:
1394         * bindings/js/JSImageDataCustom.cpp:
1395         * bindings/js/JSReadableStreamSourceCustom.cpp:
1396         * bindings/js/JSWebAnimationCustom.cpp:
1397         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1398         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
1399         * bindings/js/JSWorkletGlobalScopeBase.cpp:
1400         * bindings/js/ScriptModuleLoader.cpp:
1401         * css/FontFace.cpp:
1402         * css/FontFace.h:
1403         * css/FontFaceSet.cpp:
1404         * css/FontFaceSet.h:
1405         * dom/CustomElementRegistry.cpp:
1406         * dom/DeviceOrientationOrMotionEvent.cpp:
1407         * dom/DeviceOrientationOrMotionEvent.h:
1408         * dom/MouseEvent.cpp:
1409         * dom/MouseEvent.h:
1410         * html/CustomPaintCanvas.h:
1411         * html/ImageBitmap.cpp:
1412         * html/ImageBitmap.h:
1413         * html/OffscreenCanvas.cpp:
1414         * html/OffscreenCanvas.h:
1415         * loader/ImageLoader.cpp:
1416         * loader/ImageLoader.h:
1417         * page/DOMWindow.cpp:
1418         * page/Navigator.h:
1419         * platform/graphics/CustomPaintImage.cpp:
1420         * testing/Internals.cpp:
1421         * testing/Internals.h:
1422         * testing/ServiceWorkerInternals.h:
1423         * testing/ServiceWorkerInternals.mm:
1424         * workers/service/ServiceWorkerContainer.cpp:
1425         * workers/service/ServiceWorkerContainer.h:
1426         * workers/service/ServiceWorkerJob.h:
1427         * workers/service/ServiceWorkerRegistration.cpp:
1428         * workers/service/ServiceWorkerRegistration.h:
1429         * worklets/PaintWorkletGlobalScope.cpp:
1430
1431 2019-10-04  Sihui Liu  <sihui_liu@apple.com>
1432
1433         Layout Test imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html is a Flaky Failure
1434         https://bugs.webkit.org/show_bug.cgi?id=201481
1435         <rdar://problem/55046055>
1436
1437         Reviewed by Alex Christensen.
1438
1439         We should not schedule timer if we know the timer function will be no-op.
1440
1441         * Modules/indexeddb/IDBTransaction.cpp:
1442         (WebCore::IDBTransaction::removeRequest):
1443         (WebCore::IDBTransaction::scheduleOperation):
1444         (WebCore::IDBTransaction::trySchedulePendingOperationTimer):
1445         (WebCore::IDBTransaction::pendingOperationTimerFired):
1446         (WebCore::IDBTransaction::didStart):
1447         (WebCore::IDBTransaction::operationCompletedOnClient):
1448         (WebCore::IDBTransaction::deactivate):
1449         (WebCore::IDBTransaction::schedulePendingOperationTimer): Deleted.
1450         * Modules/indexeddb/IDBTransaction.h:
1451
1452 2019-10-04  Chris Dumez  <cdumez@apple.com>
1453
1454         Unreviewed follow-up fix for r250693 to address assertion hits in debug.
1455
1456         * css/FontFaceSet.cpp:
1457         (WebCore::FontFaceSet::didFirstLayout):
1458         (WebCore::FontFaceSet::completedLoading):
1459         Make sure the ready promise is not already resolved before resolving it.
1460
1461         * platform/SuspendableTaskQueue.cpp:
1462         (WebCore::SuspendableTaskQueue::SuspendableTaskQueue):
1463         * platform/SuspendableTaskQueue.h:
1464         (WebCore::SuspendableTaskQueue::create):
1465         Add a new constructor that takes in a Document since the ActiveDOMObject's
1466         constructor taking a Document has some useful logic.
1467
1468 2019-10-04  Joonghun Park  <jh718.park@samsung.com>
1469
1470         Negative radii in radial gradients should be rejected.
1471         https://bugs.webkit.org/show_bug.cgi?id=202412
1472
1473         Per the spec, https://drafts.csswg.org/css-images-3/#radial-gradients
1474         "Negative values are invalid.",
1475         we reject negative radii values in radial-gradient.
1476
1477         This patch rejects negative radii during radial-gradient parsing
1478         for both webkit prefixed and non-prefixed ones.
1479
1480         Reviewed by Antti Koivisto.
1481
1482         Tests: imported/blink/css-parser/webkit-gradient.html
1483                imported/w3c/web-platform-tests/compat/webkit-radial-gradient-radii.html
1484                imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-image-invalid.html
1485
1486         * css/parser/CSSPropertyParserHelpers.cpp:
1487         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient):
1488         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
1489         (WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
1490
1491 2019-10-04  Alex Christensen  <achristensen@webkit.org>
1492
1493         Move WKProcessPool._registerURLSchemeServiceWorkersCanHandle to _WKWebsiteDataStoreConfiguration
1494         https://bugs.webkit.org/show_bug.cgi?id=202553
1495
1496         Reviewed by Youenn Fablet.
1497
1498         * workers/service/server/SWServer.cpp:
1499         (WebCore::SWServer::SWServer):
1500         * workers/service/server/SWServer.h:
1501         (WebCore::SWServer::registeredSchemes const):
1502         * workers/service/server/SWServerJobQueue.cpp:
1503         (WebCore::SWServerJobQueue::runRegisterJob):
1504
1505 2019-10-04  youenn fablet  <youenn@apple.com>
1506
1507         AbortSignal does not always emit the abort signal
1508         https://bugs.webkit.org/show_bug.cgi?id=201871
1509         <rdar://problem/55451712>
1510
1511         Reviewed by Chris Dumez.
1512
1513         Make sure a JSAbortSignal is not GCed until objects that can abort it are gone.
1514         This includes a followed signal and an AbortController.
1515         Current WebKit implementation only uses following of one signal at a time.
1516
1517         Test: http/tests/fetch/abort-signal-gc.html
1518
1519         * Sources.txt:
1520         * WebCore.xcodeproj/project.pbxproj:
1521         * bindings/js/JSAbortControllerCustom.cpp: Added.
1522         (WebCore::JSAbortController::visitAdditionalChildren):
1523         * bindings/js/JSAbortSignalCustom.cpp: Added.
1524         (WebCore::JSAbortSignalOwner::isReachableFromOpaqueRoots):
1525         * bindings/js/JSTypedOMCSSStyleValueCustom.cpp:
1526         * dom/AbortController.idl:
1527         * dom/AbortSignal.cpp:
1528         (WebCore::AbortSignal::follow):
1529         * dom/AbortSignal.h:
1530         * dom/AbortSignal.idl:
1531
1532 2019-10-04  youenn fablet  <youenn@apple.com>
1533
1534         Allow to suspend RTCPeerConnection when not connected
1535         https://bugs.webkit.org/show_bug.cgi?id=202403
1536
1537         Reviewed by Chris Dumez.
1538
1539         Implement suspend/resume in RTCPeerConnection by sending suspend/resume to the libwebrtc media endpoint,
1540         which suspends/resumes its socket factory.
1541
1542         We allow suspension when the connection is not connected.
1543         Pages with connected connections will not go in page cache yet.
1544
1545         Tests: webrtc/datachannel/datachannel-page-cache-send.html
1546                webrtc/datachannel/datachannel-page-cache.html
1547
1548         * Modules/mediastream/PeerConnectionBackend.h:
1549         (WebCore::PeerConnectionBackend::suspend):
1550         (WebCore::PeerConnectionBackend::resume):
1551         * Modules/mediastream/RTCPeerConnection.cpp:
1552         (WebCore::RTCPeerConnection::canSuspendForDocumentSuspension const):
1553         (WebCore::RTCPeerConnection::suspend):
1554         (WebCore::RTCPeerConnection::resume):
1555         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1556         (WebCore::LibWebRTCMediaEndpoint::suspend):
1557         (WebCore::LibWebRTCMediaEndpoint::resume):
1558         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1559         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1560         (WebCore::LibWebRTCPeerConnectionBackend::suspend):
1561         (WebCore::LibWebRTCPeerConnectionBackend::resume):
1562         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1563         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1564
1565 2019-10-04  Truitt Savell  <tsavell@apple.com>
1566
1567         Unreviewed, rolling out r250583.
1568
1569         Broke multiple internal API tests
1570
1571         Reverted changeset:
1572
1573         "[JSC] Place VM* in TLS"
1574         https://bugs.webkit.org/show_bug.cgi?id=202391
1575         https://trac.webkit.org/changeset/250583
1576
1577 2019-10-04  Alex Christensen  <achristensen@webkit.org>
1578
1579         Simplify sandbox enabling macros
1580         https://bugs.webkit.org/show_bug.cgi?id=202536
1581
1582         Reviewed by Brent Fulgham.
1583
1584         * Configurations/FeatureDefines.xcconfig:
1585
1586 2019-10-04  Chris Lord  <clord@igalia.com>
1587
1588         ImageBitmap should be serializable
1589         https://bugs.webkit.org/show_bug.cgi?id=202394
1590
1591         Reviewed by Žan Doberšek.
1592
1593         Test: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-serializable.html
1594
1595         * bindings/js/SerializedScriptValue.cpp:
1596         (WebCore::CloneSerializer::dumpImageBitmap):
1597         (WebCore::CloneDeserializer::readTransferredImageBitmap):
1598         (WebCore::CloneDeserializer::readImageBitmap):
1599         (WebCore::CloneDeserializer::readTerminal):
1600
1601 2019-10-03  Antoine Quint  <graouts@apple.com>
1602
1603         AppleTV named as XSS-payloads trigger when AirPlay is used
1604         https://bugs.webkit.org/show_bug.cgi?id=202534
1605         <rdar://55931262>
1606
1607         Reviewed by Eric Carlson.
1608
1609         Ensure we escape an AirPlay's device name before inserting its name into the DOM.
1610
1611         * Modules/modern-media-controls/media/placard-support.js:
1612         (PlacardSupport.prototype._updateAirPlayPlacard):
1613         (PlacardSupport):
1614         (escapeHTML):
1615
1616 2019-10-04  Oriol Brufau  <obrufau@igalia.com>
1617
1618         [css-grid] Preserve auto repeat() in getComputedStyle() for non-grids
1619         https://bugs.webkit.org/show_bug.cgi?id=202258
1620
1621         Reviewed by Javier Fernandez.
1622
1623         Tests: imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid.html
1624                imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed.html
1625                imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid.html
1626                imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed.html
1627
1628         Usually, the resolved value of grid-template-rows/columns is the used
1629         value, expanding the repeat() notation. But for elements with a non-grid
1630         display, the resolved value is just the computed value, with repeat(),
1631         since the used value doesn't exist.
1632         Before this patch, the repeat() was dropped, and line names after it
1633         appeared at the wrong position or were also dropped. There was also an
1634         assert failure in debug. This patch fixes the serialization for auto
1635         repeat(). Integer repeat() is still expanded at computed-value time, so
1636         it's not preserved in getComputedStyle().
1637
1638         * css/CSSComputedStyleDeclaration.cpp:
1639         (WebCore::OrderedNamedLinesCollector::OrderedNamedLinesCollector):
1640         (WebCore::OrderedNamedLinesCollectorInsideRepeat::OrderedNamedLinesCollectorInsideRepeat):
1641         (WebCore::OrderedNamedLinesCollectorInGridLayout::OrderedNamedLinesCollectorInGridLayout):
1642         (WebCore::OrderedNamedLinesCollector::collectLineNamesForIndex const):
1643         (WebCore::OrderedNamedLinesCollectorInsideRepeat::collectLineNamesForIndex const):
1644         (WebCore::OrderedNamedLinesCollectorInGridLayout::collectLineNamesForIndex const):
1645         (WebCore::populateGridTrackList):
1646         (WebCore::valueForGridTrackList):
1647
1648 2019-10-04  Antti Koivisto  <antti@apple.com>
1649
1650         [CSS Shadow Parts] Support 'exportparts' attribute
1651         https://bugs.webkit.org/show_bug.cgi?id=202520
1652
1653         Reviewed by Ryosuke Niwa.
1654
1655         Support 'exportparts' attribute for exporting part mappings from subcomponents.
1656
1657         * css/ElementRuleCollector.cpp:
1658         (WebCore::ElementRuleCollector::matchAuthorRules):
1659         (WebCore::ElementRuleCollector::matchPartPseudoElementRules):
1660
1661         Recurse to containing scopes to collect part rules if there are exported mappings.
1662
1663         (WebCore::ElementRuleCollector::ruleMatches):
1664         * css/ElementRuleCollector.h:
1665         * css/SelectorChecker.cpp:
1666         (WebCore::SelectorChecker::matchRecursively const):
1667
1668         Make ShadowDescendant fake combinator skip directly to the scope where the part rules are coming from.
1669
1670         (WebCore::SelectorChecker::checkOne const):
1671
1672         Resolve names via mappings if needed.
1673
1674         * css/SelectorChecker.h:
1675         * dom/Element.cpp:
1676         (WebCore::Element::attributeChanged):
1677
1678         Invalidate mappings as needed.
1679
1680         * dom/ShadowRoot.cpp:
1681         (WebCore::parsePartMappings):
1682
1683         Parse the mappings microsyntax.
1684
1685         (WebCore::ShadowRoot::partMappings const):
1686         (WebCore::ShadowRoot::invalidatePartMappings):
1687         * dom/ShadowRoot.h:
1688         * html/HTMLAttributeNames.in:
1689
1690 2019-10-04  Ryosuke Niwa  <rniwa@webkit.org>
1691
1692         A newly inserted element doesn't get assigned to a named slot if slot assignments had already happened
1693         https://bugs.webkit.org/show_bug.cgi?id=199733
1694
1695         Reviewed by Antti Koivisto.
1696
1697         The bug was caused by addSlotElementByName not invalidating slot assignments when a new slot element
1698         is inserted after corresponding elements with the slot content attribute had already been inserted.
1699
1700         Fixed the bug by always invalidating the slot assignment when a new slot element is inserted.
1701
1702         Tests: fast/shadow-dom/add-slotted-element-after-assignment-1.html
1703                fast/shadow-dom/add-slotted-element-after-assignment-2.html
1704                fast/shadow-dom/add-slotted-element-after-assignment-3.html
1705
1706         * dom/SlotAssignment.cpp:
1707         (WebCore::SlotAssignment::addSlotElementByName):
1708
1709 2019-10-04  Ryosuke Niwa  <rniwa@webkit.org>
1710
1711         Radio button groups are not scoped by shadow boundaries
1712         https://bugs.webkit.org/show_bug.cgi?id=199568
1713
1714         Reviewed by Antti Koivisto.
1715
1716         Fixed the bug that radio button groups are not scoped to each shadow tree by moving
1717         RadioButtonGroups from FormController, which is a per-document object, to TreeScope.
1718
1719         Test: imported/w3c/web-platform-tests/shadow-dom/input-type-radio.html
1720
1721         * dom/RadioButtonGroups.h:
1722         (WebCore::RadioButtonGroups): Made this bmalloc'ed now that it's allocated standalone.
1723         * dom/TreeScope.cpp:
1724         (WebCore::TreeScope::radioButtonGroups): Added.
1725         * dom/TreeScope.h:
1726         * html/FormController.h:
1727         (WebCore::FormController::radioButtonGroups): Deleted.
1728         * html/HTMLInputElement.cpp:
1729         (WebCore::HTMLInputElement::~HTMLInputElement):
1730         (WebCore::HTMLInputElement::removedFromAncestor): Update the radio button group here.
1731         (WebCore::HTMLInputElement::didMoveToNewDocument): Removed the code to update radio
1732         button group here since it's done in removedFromAncestor now. Note that insertion case
1733         is alrady taken care of by HTMLInputElement::didFinishInsertingNode.
1734         (WebCore::HTMLInputElement::radioButtonGroups const): Ditto.
1735
1736 2019-10-03  Antti Koivisto  <antti@apple.com>
1737
1738         [CSS Shadow Parts] Correct interaction with other pseudo elements
1739         https://bugs.webkit.org/show_bug.cgi?id=202526
1740
1741         Reviewed by Ryosuke Niwa.
1742
1743         Cases like foo::part(bar)::before should work.
1744
1745         This patch doesn't cover ::placeholder which is implemented as PseudoElementWebKitCustom (like internal -webkit-* properties).
1746
1747         * css/CSSSelector.h:
1748         (WebCore::isTreeStructuralPseudoClass):
1749
1750         Add a helper.
1751
1752         * css/parser/CSSSelectorParser.cpp:
1753
1754         Allow non-structural pseudo classes after ::part().
1755         Allow other pseudo elements after ::part().
1756
1757         (WebCore::CSSSelectorParser::consumePseudo):
1758
1759         No need for DisallowPseudoElementsScope, we are just parsing identifiers.
1760
1761 2019-10-03  James Darpinian  <jdarpinian@chromium.org>
1762
1763         Fix WebGL 1 conformance regressions when USE_ANGLE=1
1764         https://bugs.webkit.org/show_bug.cgi?id=202545
1765
1766         Prevent ANGLE from automatically using ES3 when ES2 is requested.
1767
1768         WEBGL_debug_shaders extension should not accept or return null.
1769
1770         Enable ANGLE's new support for emulating RGB on RGBA IOSurfaces.
1771
1772         Reviewed by Alex Christensen.
1773
1774         * html/canvas/WebGLDebugShaders.cpp:
1775         (WebCore::WebGLDebugShaders::getTranslatedShaderSource):
1776         * html/canvas/WebGLDebugShaders.h:
1777         * html/canvas/WebGLDebugShaders.idl:
1778         * html/canvas/WebGLRenderingContextBase.cpp:
1779         (WebCore::WebGLRenderingContextBase::validateVertexAttributes):
1780         * platform/graphics/angle/Extensions3DANGLE.cpp:
1781         (WebCore::Extensions3DANGLE::getTranslatedShaderSourceANGLE):
1782         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
1783         (WebCore::GraphicsContext3D::GraphicsContext3D):
1784         * platform/graphics/cocoa/WebGLLayer.mm:
1785         (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]):
1786
1787 2019-10-03  Jer Noble  <jer.noble@apple.com>
1788
1789     [iOS] WebContent process can be interrupted during suspension; loses "Now Playing" status
1790     https://bugs.webkit.org/show_bug.cgi?id=202537
1791     <rdar://problem/55952707>
1792
1793     Reviewed by Eric Carlson.
1794
1795     Always deactivate the AVAudioSession when the last playing PlatformAudioSession ends playback and the application is in the background.
1796
1797     * platform/audio/PlatformMediaSessionManager.cpp:
1798     (WebCore::PlatformMediaSessionManager::removeSession):
1799     (WebCore::PlatformMediaSessionManager::processWillSuspend):
1800     (WebCore::PlatformMediaSessionManager::maybeDeactivateAudioSession):
1801     * platform/audio/PlatformMediaSessionManager.h:
1802     (WebCore::PlatformMediaSessionManager::isApplicationInBackground const):
1803     * platform/audio/ios/MediaSessionManagerIOS.h:
1804     * platform/audio/ios/MediaSessionManagerIOS.mm:
1805     (WebCore::MediaSessionManageriOS::sessionWillEndPlayback):
1806
1807 2019-10-03  Chris Dumez  <cdumez@apple.com>
1808
1809         Allow pages using FontFaceSet to enter the back/forward cache
1810         https://bugs.webkit.org/show_bug.cgi?id=202476
1811
1812         Reviewed by Myles C. Maxfield.
1813
1814         Allow pages using FontFaceSet to enter the back/forward cache by updating its
1815         implementation to queue all its tasks that run script to a SuspendableTaskQueue.
1816         The SuspendableTaskQueue makes sure to properly suspend while in PageCache and
1817         run the tasks when resuming from PageCache.
1818
1819         Test: http/tests/navigation/page-cache-fontfaceset.html
1820
1821         * PlatformWin.cmake:
1822         * Sources.txt:
1823         * WebCore.xcodeproj/project.pbxproj:
1824         * css/CSSFontFace.cpp:
1825         (WebCore::CSSFontFace::fontLoadEventOccurred):
1826         * css/FontFaceSet.cpp:
1827         (WebCore::FontFaceSet::FontFaceSet):
1828         (WebCore::FontFaceSet::canSuspendForDocumentSuspension const):
1829         (WebCore::FontFaceSet::didFirstLayout):
1830         (WebCore::FontFaceSet::completedLoading):
1831         (WebCore::FontFaceSet::faceFinished):
1832         * css/FontFaceSet.h:
1833
1834         * platform/SuspendableTaskQueue.cpp: Added.
1835         (WebCore::SuspendableTaskQueue::SuspendableTaskQueue):
1836         (WebCore::SuspendableTaskQueue::close):
1837         (WebCore::SuspendableTaskQueue::cancelAllTasks):
1838         (WebCore::SuspendableTaskQueue::enqueueTask):
1839         (WebCore::SuspendableTaskQueue::runOneTask):
1840         (WebCore::SuspendableTaskQueue::activeDOMObjectName const):
1841         (WebCore::SuspendableTaskQueue::canSuspendForDocumentSuspension const):
1842         (WebCore::SuspendableTaskQueue::stop):
1843         (WebCore::SuspendableTaskQueue::suspend):
1844         (WebCore::SuspendableTaskQueue::resume):
1845         * platform/SuspendableTaskQueue.h: Added.
1846         (WebCore::SuspendableTaskQueue::create):
1847         (WebCore::SuspendableTaskQueue::isClosed const):
1848         (WebCore::SuspendableTaskQueue::hasPendingTasks const):
1849         Add a SuspendableTaskQueue class which is Page-Cache aware and can be used to queue
1850         generic tasks as WTF::Function<void<>> lambdas.
1851
1852 2019-10-03  Chris Dumez  <cdumez@apple.com>
1853
1854         Provisional / scheduled loads in subframes should not prevent a page from entering the back/forward cache
1855         https://bugs.webkit.org/show_bug.cgi?id=202474
1856
1857         Reviewed by Alex Christensen.
1858
1859         Provisional / scheduled loads in subframes should not prevent a page from entering the back/forward cache.
1860         To address the issue, we now make sure to stop all loads before checking for PageCache eligibility.
1861
1862         Test: fast/history/page-cache-quick-redirect-iframe.html
1863
1864         * history/PageCache.cpp:
1865         (WebCore::PageCache::addIfCacheable):
1866         * loader/FrameLoader.cpp:
1867         (WebCore::FrameLoader::stopForPageCache):
1868         * loader/FrameLoader.h:
1869
1870 2019-10-03  Chris Dumez  <cdumez@apple.com>
1871
1872         XMLHttpRequest sometimes prevents pages from entering the back/forward cache
1873         https://bugs.webkit.org/show_bug.cgi?id=202434
1874         <rdar://problem/55890340>
1875
1876         Reviewed by Geoffrey Garen.
1877
1878         XMLHttpRequest::canSuspendForDocumentSuspension() was returning false if the document has not fired
1879         the window's load event, with a comment explaining that cancelling the XHR in the upon suspension
1880         may cause the load event to get fired and thus run script when forbidden. However, we should only
1881         return false if the XMLHttpRequest is actually loading (m_loader is not null). XHRs that are not
1882         loading should never prevent page caching.
1883
1884         I saw failures to enter the back/forward cache on yandex.ru and taobao.com because of this.
1885
1886         Test: http/tests/navigation/page-cache-failed-xhr.html
1887
1888         * xml/XMLHttpRequest.cpp:
1889         (WebCore::XMLHttpRequest::canSuspendForDocumentSuspension const):
1890
1891 2019-10-03  John Wilander  <wilander@apple.com>
1892
1893         Resource Load Statistics: Downgrade document.referrer for all third-party iframes
1894         https://bugs.webkit.org/show_bug.cgi?id=202506
1895         <rdar://problem/55786397>
1896
1897         Reviewed by Brent Fulgham.
1898
1899         This change downgrades document.referrer for all third-party iframes if ITP/Resource Load Statistics
1900         is enabled. The behavior matches the downgrade of all HTTP referrers for third-party resources
1901         which landed in https://trac.webkit.org/changeset/250413/webkit.
1902
1903         Tests: http/tests/resourceLoadStatistics/downgrade-document-referrer-nested-third-party-iframe.html
1904                http/tests/resourceLoadStatistics/downgrade-document-referrer-third-party-iframe.html
1905                http/tests/resourceLoadStatistics/leave-empty-document-referrer-alone-third-party-iframe.html
1906
1907         * dom/Document.cpp:
1908         (WebCore::Document::referrer):
1909         (WebCore::Document::referrer const): Deleted.
1910             Can no longer be const since it lazily downgrades and saves the referrer on read.
1911         * dom/Document.h:
1912
1913 2019-10-03  Devin Rousso  <drousso@apple.com>
1914
1915         Web Inspector: remove `InspectorInstrumentationCookie`
1916         https://bugs.webkit.org/show_bug.cgi?id=202487
1917
1918         Reviewed by Matt Baker.
1919
1920         All it does is create a shallow-copy of the `InstrumentingAgents` (it copies a pointer to
1921         the `InstrumentingAgents` object, so any of the pointers to the `InspectorAgent` that are
1922         contained therein are shared between each instance) and save the tracking
1923         `InspectorTimelineAgent`'s id (monotonically increasing integer).
1924
1925         All uses of `InspectorInstrumentationCookie` are local values, so there's no way that the
1926         `InspectorTimelineAgent` (or the id) could change in between an
1927         `InspectorInstrumentation::will*` and an `InspectorInstrumentation::did*`, as both the
1928         tracking state and id are controlled by the frontend and cannot "interrupt".
1929
1930         Removing `InspectorInstrumentationCookie` _can_ cause issues is in situations where the
1931         `ScriptExecutionContext` (or `Page`) changes between the `InspectorInstrumentation::will*`
1932         and the `InspectorInstrumentation::did*`, but this can be avoided so long as a pointer to
1933         the "context" used for `InspectorInstrumentation::will*` is saved.
1934
1935         Covered by existing tests: inspector/timeline/*
1936
1937         * inspector/InspectorInstrumentationCookie.h: Removed.
1938         * inspector/InspectorInstrumentationCookie.cpp: Removed.
1939
1940         * inspector/agents/InspectorTimelineAgent.h:
1941         * inspector/agents/InspectorTimelineAgent.cpp:
1942         (WebCore::InspectorTimelineAgent::internalStop):
1943         (WebCore::InspectorTimelineAgent::didDispatchEvent):
1944         (WebCore::InspectorTimelineAgent::didPaint):
1945         (WebCore::InspectorTimelineAgent::clearRecordStack): Deleted.
1946
1947         * bindings/js/JSCallbackData.cpp:
1948         (WebCore::JSCallbackData::invokeCallback):
1949         * bindings/js/JSCustomElementInterface.cpp:
1950         (WebCore::constructCustomElementSynchronously):
1951         (WebCore::JSCustomElementInterface::upgradeElement):
1952         (WebCore::JSCustomElementInterface::invokeCallback):
1953         * bindings/js/JSErrorHandler.cpp:
1954         (WebCore::JSErrorHandler::handleEvent):
1955         * bindings/js/JSEventListener.cpp:
1956         (WebCore::JSEventListener::handleEvent):
1957         * bindings/js/JSExecState.h:
1958         * bindings/js/JSExecStateInstrumentation.h:
1959         (WebCore::JSExecState::instrumentFunctionInternal):
1960         (WebCore::JSExecState::instrumentFunctionCall):
1961         (WebCore::JSExecState::instrumentFunctionConstruct):
1962         * bindings/js/ScheduledAction.cpp:
1963         (WebCore::ScheduledAction::executeFunctionInContext):
1964         * bindings/js/ScriptController.cpp:
1965         (WebCore::ScriptController::evaluateInWorld):
1966         (WebCore::ScriptController::evaluateModule):
1967         * dom/Document.cpp:
1968         (WebCore::Document::resolveStyle):
1969         * dom/EventTarget.cpp:
1970         (WebCore::EventTarget::innerInvokeEventListeners):
1971         * dom/MutationObserver.cpp:
1972         (WebCore::MutationObserver::deliver):
1973         * dom/ScriptedAnimationController.cpp:
1974         (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
1975         * page/DOMTimer.cpp:
1976         (WebCore::DOMTimer::fired):
1977         * page/DOMWindow.cpp:
1978         (WebCore::DOMWindow::dispatchEvent):
1979         * page/FrameViewLayoutContext.cpp:
1980         (WebCore::FrameViewLayoutContext::layout):
1981         * page/IntersectionObserver.cpp:
1982         (WebCore::IntersectionObserver::notify):
1983         * page/PerformanceObserver.cpp:
1984         (WebCore::PerformanceObserver::deliver):
1985
1986         * inspector/InspectorInstrumentation.h:
1987         (WebCore::InspectorInstrumentation::willCallFunction):
1988         (WebCore::InspectorInstrumentation::didCallFunction):
1989         (WebCore::InspectorInstrumentation::willDispatchEvent):
1990         (WebCore::InspectorInstrumentation::didDispatchEvent):
1991         (WebCore::InspectorInstrumentation::willDispatchEventOnWindow):
1992         (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
1993         (WebCore::InspectorInstrumentation::willEvaluateScript):
1994         (WebCore::InspectorInstrumentation::didEvaluateScript):
1995         (WebCore::InspectorInstrumentation::willFireTimer):
1996         (WebCore::InspectorInstrumentation::didFireTimer):
1997         (WebCore::InspectorInstrumentation::willLayout):
1998         (WebCore::InspectorInstrumentation::didLayout):
1999         (WebCore::InspectorInstrumentation::willRecalculateStyle):
2000         (WebCore::InspectorInstrumentation::didRecalculateStyle):
2001         (WebCore::InspectorInstrumentation::willFireAnimationFrame):
2002         (WebCore::InspectorInstrumentation::didFireAnimationFrame):
2003         (WebCore::InspectorInstrumentation::willFireObserverCallback):
2004         (WebCore::InspectorInstrumentation::didFireObserverCallback):
2005         * inspector/InspectorInstrumentation.cpp:
2006         (WebCore::InspectorInstrumentation::willCallFunctionImpl):
2007         (WebCore::InspectorInstrumentation::didCallFunctionImpl):
2008         (WebCore::InspectorInstrumentation::willDispatchEventImpl):
2009         (WebCore::InspectorInstrumentation::didDispatchEventImpl):
2010         (WebCore::InspectorInstrumentation::willDispatchEventOnWindowImpl):
2011         (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
2012         (WebCore::InspectorInstrumentation::willEvaluateScriptImpl):
2013         (WebCore::InspectorInstrumentation::didEvaluateScriptImpl):
2014         (WebCore::InspectorInstrumentation::willFireTimerImpl):
2015         (WebCore::InspectorInstrumentation::didFireTimerImpl):
2016         (WebCore::InspectorInstrumentation::willLayoutImpl):
2017         (WebCore::InspectorInstrumentation::didLayoutImpl):
2018         (WebCore::InspectorInstrumentation::willRecalculateStyleImpl):
2019         (WebCore::InspectorInstrumentation::didRecalculateStyleImpl):
2020         (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
2021         (WebCore::InspectorInstrumentation::didFireAnimationFrameImpl):
2022         (WebCore::InspectorInstrumentation::willFireObserverCallbackImpl):
2023         (WebCore::InspectorInstrumentation::didFireObserverCallbackImpl):
2024         (WebCore::InspectorInstrumentation::retrieveTimelineAgent): Deleted.
2025
2026         * Sources.txt:
2027         * WebCore.xcodeproj/project.pbxproj:
2028
2029 2019-10-03  Sihui Liu  <sihui_liu@apple.com>
2030
2031         IndexedDB: add size estimate for key path when estimate task size
2032         https://bugs.webkit.org/show_bug.cgi?id=202480
2033
2034         Reviewed by Geoffrey Garen.
2035
2036         No observable behavior change.
2037
2038         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2039         (WebCore::IDBServer::estimateSize):
2040
2041 2019-10-03  youenn fablet  <youenn@apple.com>
2042
2043         Regression: iOS 13.1 MediaStreamTrack.enabled = false kills audio track
2044         https://bugs.webkit.org/show_bug.cgi?id=202405
2045         <rdar://problem/55922616>
2046
2047         Reviewed by Eric Carlson.
2048
2049         When the web page is setting enabled to false, media session might change from PlayRecord to None.
2050         This might trigger CoreAudio to no longer output audio samples, thus triggering our audio capture failure timer.
2051         This would end the track after 2 seconds.
2052         Given audio tracks can be reenabled by a web page, we should not change the Media Session setup based on that.
2053         This patch updates MediaStream::mediaType to return independently of the enabled state.
2054
2055         Add internals API to write a cross platform test.
2056
2057         Test: fast/mediastream/audio-track-enabled.html
2058         Manually tested as well.
2059
2060         * Modules/mediastream/MediaStream.cpp:
2061         (WebCore::MediaStream::mediaType const):
2062         * platform/mediastream/MediaStreamPrivate.cpp:
2063         (WebCore::MediaStreamPrivate::hasCaptureAudioSource const):
2064         * testing/Internals.cpp:
2065         (WebCore::Internals::supportsAudioSession const):
2066         (WebCore::Internals::audioSessionCategory const):
2067         * testing/Internals.h:
2068         * testing/Internals.idl:
2069
2070 2019-10-03  youenn fablet  <youenn@apple.com>
2071
2072         http/tests/security/navigate-when-restoring-cached-page.html should not use RTCPeerConnection to not enter in page cache
2073         https://bugs.webkit.org/show_bug.cgi?id=202521
2074
2075         Reviewed by Chris Dumez.
2076
2077         Introduce a dummy ActiveDOMObject which can never be suspended for document suspension.
2078         Allow a page to create this dummy ActiveDOMObject through internals.
2079         Covered by updated test.
2080
2081         * dom/ActiveDOMObject.h:
2082         * testing/Internals.cpp:
2083         (WebCore::Internals::preventDocumentForEnteringPageCache):
2084         * testing/Internals.h:
2085         * testing/Internals.idl:
2086
2087 2019-10-03  Tim Horton  <timothy_horton@apple.com>
2088
2089         WebKit doesn't build with trunk clang
2090         https://bugs.webkit.org/show_bug.cgi?id=202511
2091
2092         Reviewed by Anders Carlsson.
2093
2094         * Modules/fetch/FetchLoader.h:
2095         * Modules/geolocation/Geolocation.h:
2096         * Modules/indexeddb/IDBTransaction.h:
2097         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2098         * Modules/indexeddb/shared/InProcessIDBServer.h:
2099         * Modules/notifications/Notification.cpp:
2100         * Modules/notifications/Notification.h:
2101         * platform/graphics/ca/TileController.h:
2102         * workers/service/context/ServiceWorkerThreadProxy.h:
2103         Fix the build by exporting destructors and custom delete operators.
2104         I don't know why this changed, but trunk clang insists.
2105         There are also some new warnings; this only fixes the hard errors.
2106
2107 2019-10-03  Tim Horton  <timothy_horton@apple.com>
2108
2109         Yet another build fix
2110
2111         * css/typedom/TypedOMCSSImageValue.h:
2112         Forward declare Document.
2113
2114 2019-10-03  Jiewen Tan  <jiewen_tan@apple.com>
2115
2116         Support googleLegacyAppidSupport extension
2117         https://bugs.webkit.org/show_bug.cgi?id=202427
2118         <rdar://problem/55887473>
2119
2120         Reviewed by Brent Fulgham.
2121
2122         This patch adds support for googleLegacyAppidSupport extension, when set:
2123         1) user agent should only use the U2F transport protocol,
2124         2) should only communicate with roaming authenticators, and
2125         3) should use a hard-coded appID of https://www.gstatic.com/securitykey/origins.json.
2126         To be noticed as the name implies, this extension is exclusively for RP ID = google.com.
2127
2128         Implementation wise, all operations are captured in methods with name processGoogleLegacyAppIdSupportExtension.
2129         1) AuthenticatorCoordinator takes care of setting the value.
2130         2) U2fCommandConstructor takes care of hard coding the AppID.
2131         3) AuthenticatorManager takes care of removing AuthenticatorTransport::Internal from TransportSet, so startDiscovery
2132         will not poke platform authenticators.
2133         4) CtapAuthenticator takes care of downgrading to U2fAuthenticator.
2134         5) U2fAuthenticator takes care of setting the AppID in the response.
2135
2136         Partially covered by new test cases in existing tests, and remaining will be covered by manual tests.
2137
2138         * Modules/webauthn/AuthenticationExtensionsClientInputs.h:
2139         (WebCore::AuthenticationExtensionsClientInputs::encode const):
2140         (WebCore::AuthenticationExtensionsClientInputs::decode):
2141         * Modules/webauthn/AuthenticationExtensionsClientInputs.idl:
2142         * Modules/webauthn/AuthenticatorCoordinator.cpp:
2143         (WebCore::AuthenticatorCoordinatorInternal::processGoogleLegacyAppIdSupportExtension):
2144         (WebCore::AuthenticatorCoordinator::create const):
2145         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
2146         (WebCore::PublicKeyCredentialCreationOptions::encode const):
2147         (WebCore::PublicKeyCredentialCreationOptions::decode):
2148         * Modules/webauthn/fido/U2fCommandConstructor.cpp:
2149         (fido::convertToU2fRegisterCommand):
2150         (fido::processGoogleLegacyAppIdSupportExtension):
2151         * Modules/webauthn/fido/U2fCommandConstructor.h:
2152
2153 2019-10-03  Yury Semikhatsky  <yurys@chromium.org>
2154
2155         Web Inspector: tests under LayoutTests/inspector/debugger are flaky
2156         https://bugs.webkit.org/show_bug.cgi?id=137131
2157         <rdar://problem/18461335>
2158
2159         Reviewed by Devin Rousso.
2160
2161         Fix debugger tests on GTK. All tests that pause on breakpoint didn't work because
2162         in layout tests InspectorFrontendClientLocal was using Timer to dispatch commands
2163         sent from the local front-end page to the inspected one. When paused inside a script
2164         triggered by the front-end nested timer event would be scheduled but never fired
2165         because in glib implementation of RunLoop::TimerBase uses event source which doesn't
2166         allow recursion (g_source_set_can_recurse is not called on the source), so dispatching
2167         Debugger.resume command didn't work when paused inside another inspector command (e.g.
2168         eval). RunLoop itself uses event source which does allow recursion. So instead of using
2169         a timer for asynchronous command dispatching with delay=0 we now schedule a task in
2170         RunLoop's queue.
2171
2172         * inspector/InspectorFrontendClientLocal.cpp:
2173         (WebCore::InspectorBackendDispatchTask::dispatch):
2174         (WebCore::InspectorBackendDispatchTask::reset):
2175         (WebCore::InspectorBackendDispatchTask::InspectorBackendDispatchTask):
2176         (WebCore::InspectorBackendDispatchTask::scheduleOneShot): ensures that there is one inspector
2177         dispatch task in the queue.
2178         (WebCore::InspectorBackendDispatchTask::dispatchOneMessage): this is mostly the same behavior
2179         as was with timerFired, we should be able to dispatch all accumulated messages from the queue
2180         in one batch but for now I'd like to keep it one per iteration.
2181
2182 2019-10-03  Joonghun Park  <pjh0718@gmail.com>
2183
2184         CSS ellipse() doesn't accept single <shape-radius>
2185         https://bugs.webkit.org/show_bug.cgi?id=181745
2186
2187         CSS ellipse() should only accept 0 or 2 radii.
2188         The corresponding csswg discussion is
2189         https://github.com/w3c/csswg-drafts/issues/2175.
2190
2191         Reviewed by Antti Koivisto.
2192
2193         Tests: imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-computed.html
2194                imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-invalid.html
2195                imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-valid.html
2196                imported/w3c/web-platform-tests/css/css-masking/parsing/shape-outside-computed.html
2197                imported/w3c/web-platform-tests/css/css-masking/parsing/shape-outside-invalid.html
2198                imported/w3c/web-platform-tests/css/css-masking/parsing/shape-outside-valid.html
2199
2200         * css/CSSBasicShapes.cpp:
2201         (WebCore::CSSBasicShapeEllipse::cssText const):
2202         * css/parser/CSSPropertyParser.cpp:
2203         (WebCore::consumeBasicShapeEllipse):
2204
2205 2019-10-03  Zan Dobersek  <zdobersek@igalia.com>
2206
2207         [Nicosia] Enable runtime checks and triggers for async non-main-frame scrolling
2208         https://bugs.webkit.org/show_bug.cgi?id=202509
2209
2210         Reviewed by Carlos Garcia Campos.
2211
2212         Add build guards that would enable runtime checks of the asynchronous
2213         frame scrolling setting in the ScrollingCoordinator and
2214         RenderLayerCompositor classes for the Nicosia-using ports.
2215
2216         The check in ScrollingCoordinator avoids bailing on coordinating
2217         scrolling for non-main frames when the setting is enabled. The check in
2218         RenderLayerCompositor avoids imposing a requirement for a composition
2219         layer for any non-main frame when the setting is disabled.
2220
2221         * page/scrolling/ScrollingCoordinator.cpp:
2222         (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView const):
2223         * rendering/RenderLayerCompositor.cpp:
2224         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):
2225
2226 2019-10-02  Antti Koivisto  <antti@apple.com>
2227
2228         [CSS Shadow Parts] Support multiple arguments for ::part()
2229         https://bugs.webkit.org/show_bug.cgi?id=202482
2230
2231         Reviewed by Ryosuke Niwa.
2232
2233         Support ::part(foo bar).
2234
2235         * css/CSSSelector.cpp:
2236         (WebCore::CSSSelector::selectorText const):
2237         (WebCore::CSSSelector::setArgumentList):
2238         (WebCore::CSSSelector::setLangArgumentList): Deleted.
2239
2240         Give this a more generic name and use it for ::part() too.
2241
2242         * css/CSSSelector.h:
2243         (WebCore::CSSSelector::argumentList const):
2244         (WebCore::CSSSelector::langArgumentList const): Deleted.
2245         * css/SelectorChecker.cpp:
2246         (WebCore::SelectorChecker::checkOne const):
2247
2248         Match only if all parts are found from the element 'part' attribute.
2249
2250         * css/parser/CSSParserSelector.cpp:
2251         (WebCore::CSSParserSelector::setArgumentList):
2252         (WebCore::CSSParserSelector::setLangArgumentList): Deleted.
2253         * css/parser/CSSParserSelector.h:
2254         * css/parser/CSSSelectorParser.cpp:
2255         (WebCore::CSSSelectorParser::consumePseudo):
2256
2257         Parse the list.
2258
2259         * cssjit/SelectorCompiler.cpp:
2260         (WebCore::SelectorCompiler::addPseudoClassType):
2261
2262 2019-10-02  Andy Estes  <aestes@apple.com>
2263
2264         [iOS] When hit testing for a context menu interaction, do not consider whether the element is contenteditable
2265         https://bugs.webkit.org/show_bug.cgi?id=202498
2266         <rdar://problem/54723131>
2267
2268         Reviewed by Tim Horton.
2269
2270         When the user selects a context menu action, WebKit performs a hit test in order to find the
2271         acted-on element on the page. This is separate from the hit test performed to generate the
2272         context menu's targeted preview. Since an arbitrary amount of time can elapse between
2273         preview generation and action selection, this second hit-tests might return a different
2274         element.
2275
2276         One case where we know a different element can be returned is in apps that dynamically
2277         enable and disable editing. If editing is disabled when the first hit test occurs but is
2278         enabled when the second one occurs, different elements will be returned due to
2279         Frame::qualifyingNodeAtViewportLocation preferring to return the root editable element when
2280         the approximate node is contenteditable.
2281
2282         While the appropriate long-term fix is to only hit-test once and use that element for both
2283         preview generation and action selection, this patch implements a short-term fix to address
2284         the specific problem in rdar://problem/54723131 by disabling the contenteditable behavior
2285         described above for context menu interaction hit testing.
2286
2287         The long-term fix is tracked by <https://webkit.org/b/202499>.
2288
2289         * page/Frame.h:
2290         * page/ios/FrameIOS.mm:
2291         (WebCore::Frame::qualifyingNodeAtViewportLocation):
2292         (WebCore::Frame::approximateNodeAtViewportLocationLegacy):
2293         (WebCore::ancestorRespondingToClickEventsNodeQualifier):
2294         (WebCore::Frame::nodeRespondingToClickEvents):
2295         (WebCore::Frame::nodeRespondingToDoubleClickEvent):
2296         (WebCore::Frame::nodeRespondingToInteraction):
2297         (WebCore::Frame::nodeRespondingToScrollWheelEvents):
2298
2299 2019-10-02  Antti Koivisto  <antti@apple.com>
2300
2301         [CSS Shadow Parts] Basic ::part() pseudo element support
2302         https://bugs.webkit.org/show_bug.cgi?id=202456
2303
2304         Reviewed by Ryosuke Niwa.
2305
2306         Implement basic parsing and selector matching for ::part() pseudo element.
2307
2308         * css/CSSSelector.cpp:
2309         (WebCore::CSSSelector::pseudoId):
2310         (WebCore::CSSSelector::parsePseudoElementType):
2311         (WebCore::CSSSelector::selectorText const):
2312         * css/CSSSelector.h:
2313         * css/ElementRuleCollector.cpp:
2314         (WebCore::ElementRuleCollector::matchAuthorRules):
2315         (WebCore::ElementRuleCollector::matchPartPseudoElementRules):
2316         * css/ElementRuleCollector.h:
2317         * css/RuleSet.cpp:
2318         (WebCore::RuleSet::addRule):
2319         * css/RuleSet.h:
2320         (WebCore::RuleSet::partPseudoElementRules const):
2321         * css/SelectorChecker.cpp:
2322         (WebCore::SelectorChecker::checkOne const):
2323         * css/SelectorPseudoElementTypeMap.in:
2324         * css/parser/CSSParserSelector.cpp:
2325         (WebCore::CSSParserSelector::parsePseudoElementSelector):
2326
2327         Also added ::slotted to SelectorPseudoElementTypeMap.in to resolve a FIXME here.
2328
2329         * css/parser/CSSParserSelector.h:
2330         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching const):
2331         * css/parser/CSSSelectorParser.cpp:
2332         (WebCore::isOnlyPseudoElementFunction):
2333         (WebCore::CSSSelectorParser::consumePseudo):
2334
2335         Parse single values only, multipart ::part(foo bar) case is not yet handled.
2336
2337         * dom/Element.cpp:
2338         (WebCore::Element::partNames const):
2339
2340 2019-10-02  Antoine Quint  <graouts@apple.com>
2341
2342         Adopt copyToVector() in AnimationTimeline::animationsForElement()
2343         https://bugs.webkit.org/show_bug.cgi?id=202488
2344
2345         Reviewed by Wenson Hsieh.
2346
2347         * animation/AnimationTimeline.cpp:
2348         (WebCore::AnimationTimeline::animationsForElement const):
2349
2350 2019-10-02  Thibault Saunier  <tsaunier@igalia.com>
2351
2352         [GStreamer] Let playbin handle redirects for us when appropriate
2353         https://bugs.webkit.org/show_bug.cgi?id=195326
2354
2355         A simplified mechanism has been added in GStreamer to handle corner cases.
2356
2357         Reviewed by Xabier Rodriguez-Calvar.
2358
2359         Not easily testable at our level
2360
2361         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2362         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
2363
2364 2019-10-02  Tim Horton  <timothy_horton@apple.com>
2365
2366         Another build fix
2367
2368         * css/typedom/TypedOMCSSImageValue.cpp:
2369         (WebCore::TypedOMCSSImageValue::TypedOMCSSImageValue):
2370         * css/typedom/TypedOMCSSImageValue.h:
2371         I feel like I am actively being thwarted.
2372
2373 2019-10-02  Tim Horton  <timothy_horton@apple.com>
2374
2375         Another build fix
2376
2377         * css/typedom/TypedOMCSSImageValue.h:
2378
2379 2019-10-02  Tim Horton  <timothy_horton@apple.com>
2380
2381         Try to fix the Windows build
2382
2383         * css/typedom/TypedOMCSSImageValue.cpp:
2384         (WebCore::TypedOMCSSImageValue::document const):
2385         * css/typedom/TypedOMCSSImageValue.h:
2386         Out-of-line this instead of including Document.h in TypedOMCSSImageValue,
2387         which was an earlier build fix from r250610.
2388
2389         * platform/graphics/cg/GradientCG.cpp:
2390         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
2391         * platform/graphics/win/GraphicsContextCGWin.cpp:
2392         Try to fix the build.
2393
2394 2019-10-02  Keith Rollin  <krollin@apple.com>
2395
2396         Unreviewed build fix after r250595.
2397
2398         macCatalyst appears to have triggered the the problem where the build
2399         can sometimes fail if the unified sources mechanism doesn't group
2400         together the right set of files.
2401
2402         * css/typedom/TypedOMCSSImageValue.h:
2403
2404 2019-10-02  Antoine Quint  <graouts@apple.com>
2405
2406         [Web Animations] Implement replaced animations
2407         https://bugs.webkit.org/show_bug.cgi?id=202190
2408         <rdar://55697719>
2409
2410         Reviewed by Dean Jackson.
2411
2412         Implementing section "5.5 Replacing Animations" (https://drafts.csswg.org/web-animations/#replacing-animations) of the Web Animations
2413         specification which allows for Web Animations to be destroyed when they are superseded by another animation and the developer doesn't
2414         explicitly opt into persisting them using the persist() method.
2415
2416         An animation is marked as replaceable (to sum up) when it's finished and another animation for the same property takes precedence.
2417         As part of DocumentTimeline::internalUpdateAnimationsAndSendEvents(), we'll go through all replaceable animations, dispatch a "remove"
2418         DOM event, and remove them from our list of animations.
2419
2420         We also make a couple of fixes in this patch that were uncovered while working on the WPT tests for replaced animations:
2421         
2422         - we would incorrectly parse single values for a property that allows lists (change in KeyframeEffect's processKeyframeLikeObject())
2423         - we didn't account for the position in the global animation list when sorted animations by composite order (AnimationTimeline::animationsForElement())
2424
2425         Finally, to get more readable results, we implement a stub of commitStyles(). Its full implementation is tracked by http://wkb.ug/202193.
2426
2427         * animation/AnimationTimeline.cpp:
2428         (WebCore::AnimationTimeline::animationTimingDidChange): Mark the position of the animation in the global animation list, to which it may only be added once.
2429         (WebCore::AnimationTimeline::animationsForElement const): Account for the animation's position in the global animation when sorting.
2430         * animation/DeclarativeAnimation.cpp:
2431         (WebCore::DeclarativeAnimation::bindingsReplaceState const): Flush pending styles when querying the ready state for a declarative animation.
2432         * animation/DeclarativeAnimation.h:
2433         * animation/DocumentTimeline.cpp:
2434         (WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents): Run the "remove replaced animations" procedure as the second step in the "update animations
2435         and send events" procedure.
2436         (WebCore::DocumentTimeline::animationCanBeRemoved): Determine whether a given animation may be removed based on its finished state, replace state and whether
2437         it is fully superseded by another animation targeting the same property on the same target element.
2438         (WebCore::DocumentTimeline::removeReplacedAnimations): Remove any removable animation and dispatch a "remove" DOM event for each removed animation. 
2439         * animation/DocumentTimeline.h:
2440         * animation/KeyframeEffect.cpp:
2441         (WebCore::processKeyframeLikeObject): Fix an issue found in a replaced animations WPT test that showed that we didn't record the value of an animation that allows lists.
2442         * animation/WebAnimation.cpp:
2443         (WebCore::WebAnimation::isReplaceable const):
2444         (WebCore::WebAnimation::persist): Mark the replace state as "persisted" and ensure the animation is set on the animation list for its target element in case it had already
2445         been removed based on its persisted state.
2446         (WebCore::WebAnimation::commitStyles): Stub for a new function.
2447         * animation/WebAnimation.h:
2448         (WebCore::WebAnimation::replaceState const):
2449         (WebCore::WebAnimation::setReplaceState):
2450         (WebCore::WebAnimation::bindingsReplaceState const):
2451         (WebCore::WebAnimation::globalPosition const):
2452         (WebCore::WebAnimation::setGlobalPosition):
2453         * animation/WebAnimation.idl:
2454         * dom/EventNames.h: Add the new "remove" event so that the "onremove" DOM property is available on Animation objects. 
2455
2456 2019-10-02  Zan Dobersek  <zdobersek@igalia.com>
2457
2458         Unreviewed build fix in Nicosia's ScrollingTreePositionedNode class.
2459
2460         * page/scrolling/nicosia/ScrollingTreePositionedNode.cpp:
2461         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
2462         Fix the name of the variable included in the log call.
2463
2464 2019-10-02  youenn fablet  <youenn@apple.com>
2465
2466         Use strongly typed identifiers for webrtc sockets
2467         https://bugs.webkit.org/show_bug.cgi?id=202400
2468
2469         Reviewed by Chris Dumez.
2470
2471         No observable change of behavior.
2472
2473         * Headers.cmake:
2474         * WebCore.xcodeproj/project.pbxproj:
2475         * platform/mediastream/libwebrtc/LibWebRTCSocketIdentifier.h: Copied from Source/WebKit/NetworkProcess/webrtc/NetworkRTCSocket.h.
2476
2477 2019-10-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2478
2479         [GTK][WPE] Stop using legacy custom protocol implementation
2480         https://bugs.webkit.org/show_bug.cgi?id=202407
2481
2482         Reviewed by Žan Doberšek.
2483
2484         Remove the code to setup custom protocols in soup session.
2485
2486         * platform/network/soup/SoupNetworkSession.cpp:
2487         (WebCore::SoupNetworkSession::SoupNetworkSession):
2488         * platform/network/soup/SoupNetworkSession.h:
2489
2490 2019-10-02  Zan Dobersek  <zdobersek@igalia.com>
2491
2492         [Nicosia] Enable async scrolling at build-time for Nicosia-using ports
2493         https://bugs.webkit.org/show_bug.cgi?id=202397
2494
2495         Reviewed by Carlos Garcia Campos.
2496
2497         * PlatformPlayStation.cmake: Add missing build targets.
2498         * SourcesGTK.txt: Ditto.
2499
2500 2019-10-01  Tim Horton  <timothy_horton@apple.com>
2501
2502         Clean up some includes to make the build a bit faster
2503         https://bugs.webkit.org/show_bug.cgi?id=202444
2504
2505         Reviewed by Geoff Garen.
2506
2507         No new tests, just reorganizing.
2508
2509         Apply some profile-guided optimizations to our headers.
2510
2511         * bindings/js/CallTracerTypes.h:
2512         * css/typedom/TypedOMCSSImageValue.h:
2513         * html/canvas/WebGLObject.h:
2514         * html/canvas/WebGLVertexArrayObjectBase.h:
2515         * inspector/InspectorInstrumentation.cpp:
2516         (WebCore::InspectorInstrumentation::instrumentingAgentsForWebGPUDevice):
2517         (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
2518         (WebCore::InspectorInstrumentation::instrumentingAgentsForPage):
2519         (WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
2520         * inspector/InspectorInstrumentation.h:
2521         (WebCore::InspectorInstrumentation::didCreateWebGPUDevice):
2522         (WebCore::InspectorInstrumentation::willDestroyWebGPUDevice):
2523         (WebCore::InspectorInstrumentation::didCreateWebGPUPipeline):
2524         * platform/graphics/BitmapImage.cpp:
2525         * platform/graphics/Font.h:
2526         * platform/graphics/cg/GraphicsContextCG.cpp:
2527         (WebCore::getUserToBaseCTM):
2528         * platform/graphics/cg/GraphicsContextCG.h:
2529         (WebCore::getUserToBaseCTM): Deleted.
2530         * platform/graphics/cg/ImageBufferCG.cpp:
2531         * platform/graphics/cocoa/IOSurface.h:
2532         * platform/graphics/mac/PDFDocumentImageMac.mm:
2533         InspectorInstrumentation.h is one of the most expensive headers in the entire project.
2534         While not included in many places (70), it is fairly straightforward to reduce
2535         its per-inclusion cost by rougly 80%.
2536
2537 2019-10-01  Alex Christensen  <achristensen@webkit.org>
2538
2539         Progress towards a functioning CMake build on Mac
2540         https://bugs.webkit.org/show_bug.cgi?id=202443
2541
2542         Rubber-stamped by Tim Horton.
2543
2544         * testing/Internals.mm:
2545
2546 2019-10-01  John Wilander  <wilander@apple.com>
2547
2548         Storage Access API: document.hasStorageAccess() should return true when the cookie policy allows access
2549         https://bugs.webkit.org/show_bug.cgi?id=202435
2550         <rdar://problem/55718526>
2551
2552         Reviewed by Brent Fulgham.
2553
2554         WebKit's Storage Access API implementation has so far only looked at whether ITP is
2555         blocking cookie access or not. However, the default cookie policy is still in
2556         effect underneath ITP. document.hasStorageAccess() should return true if the
2557         third-party:
2558         a) is not classified by ITP, and
2559         b) has cookies which implies it can use cookies as third-party according to the
2560         default cookie policy.
2561
2562         Tests: http/tests/storageAccess/has-storage-access-false-by-default-ephemeral.html
2563                http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies-ephemeral.html
2564                http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies.html
2565
2566         * platform/network/NetworkStorageSession.h:
2567         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2568         (WebCore::NetworkStorageSession::hasCookies const):
2569         * platform/network/curl/NetworkStorageSessionCurl.cpp:
2570         (WebCore::NetworkStorageSession::hasCookies const):
2571             Not yet implemented. Always says false.
2572         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2573         (WebCore::NetworkStorageSession::hasCookies const):
2574             Not yet implemented. Always says false.
2575
2576 2019-10-01  Tim Horton  <timothy_horton@apple.com>
2577
2578         Clean up some includes to make the build a bit faster
2579         https://bugs.webkit.org/show_bug.cgi?id=202437
2580
2581         Reviewed by Jer Noble.
2582
2583         * Modules/webaudio/PannerNode.h:
2584         * Modules/webaudio/RealtimeAnalyser.h:
2585         * platform/audio/HRTFPanner.h:
2586         FFTFrame includes Accelerate.h, which is quite expensive.
2587
2588 2019-10-01  Antti Koivisto  <antti@apple.com>
2589
2590         [CSS Shadow Parts] Parse 'part' attribute
2591         https://bugs.webkit.org/show_bug.cgi?id=202409
2592
2593         Reviewed by Ryosuke Niwa.
2594
2595         Add parsing for Element 'part' attribute and the IDL interface.
2596         Also add a feature flag for CSS Shadow Parts.
2597
2598         * dom/Element.cpp:
2599         (WebCore::Element::attributeChanged):
2600         (WebCore::isNonEmptyTokenList):
2601         (WebCore::Element::classAttributeChanged):
2602         (WebCore::Element::partAttributeChanged):
2603         (WebCore::Element::partNames const):
2604         (WebCore::Element::part):
2605         (WebCore::classStringHasClassName): Deleted.
2606         * dom/Element.h:
2607         * dom/Element.idl:
2608         * dom/ElementRareData.cpp:
2609         * dom/ElementRareData.h:
2610         (WebCore::ElementRareData::partList const):
2611         (WebCore::ElementRareData::setPartList):
2612         (WebCore::ElementRareData::partNames const):
2613         (WebCore::ElementRareData::setPartNames):
2614         * html/HTMLAttributeNames.in:
2615         * page/RuntimeEnabledFeatures.h:
2616         (WebCore::RuntimeEnabledFeatures::setCSSShadowPartsEnabled):
2617         (WebCore::RuntimeEnabledFeatures::cssShadowPartsEnabled const):
2618
2619 2019-10-01  Yusuke Suzuki  <ysuzuki@apple.com>
2620
2621         [JSC] Place VM* in TLS
2622         https://bugs.webkit.org/show_bug.cgi?id=202391
2623
2624         Reviewed by Mark Lam.
2625
2626         Use JSLockHolder instead. It automatically puts VM* in TLS.
2627
2628         * bindings/js/IDBBindingUtilities.cpp:
2629         (WebCore::toJS):
2630         (WebCore::deserializeIDBValueToJSValue):
2631
2632 2019-10-01  youenn fablet  <youenn@apple.com>
2633
2634         Queue events and promise resolution in RTCPeerConnection when suspended for page cache
2635         https://bugs.webkit.org/show_bug.cgi?id=202396
2636
2637         Reviewed by Chris Dumez.
2638
2639         This patch prepares RTCPeerConnection to be suspendable to enter page cache.
2640         For that purpose, we queue events and promise resolution/rejection tasks if the RTCPeerConnection m_shouldDelayTasks is set to true.
2641         This queueing is enabled when RTCPeerConnection is asked to suspend itself.
2642         The queued tasks are then executed at resume time.
2643         Renamed fireEvent to dispatchEventWhenFeasible.
2644         No change of behavior for now.
2645
2646         * Modules/mediastream/PeerConnectionBackend.cpp:
2647         (WebCore::PeerConnectionBackend::createOfferSucceeded):
2648         (WebCore::PeerConnectionBackend::createOfferFailed):
2649         (WebCore::PeerConnectionBackend::createAnswerSucceeded):
2650         (WebCore::PeerConnectionBackend::createAnswerFailed):
2651         (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
2652         (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
2653         (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
2654         (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
2655         (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
2656         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
2657         * Modules/mediastream/RTCPeerConnection.cpp:
2658         (WebCore::RTCPeerConnection::doClose):
2659         (WebCore::RTCPeerConnection::suspend):
2660         (WebCore::RTCPeerConnection::resume):
2661         (WebCore::RTCPeerConnection::updateIceGatheringState):
2662         (WebCore::RTCPeerConnection::updateIceConnectionState):
2663         (WebCore::RTCPeerConnection::updateConnectionState):
2664         (WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent):
2665         (WebCore::RTCPeerConnection::doTask):
2666         (WebCore::RTCPeerConnection::fireEvent):
2667         * Modules/mediastream/RTCPeerConnection.h:
2668
2669 2019-10-01  Brent Fulgham  <bfulgham@apple.com>
2670
2671         [FTW] Correct additional canvas test failures
2672         https://bugs.webkit.org/show_bug.cgi?id=202388
2673
2674         Reviewed by Fujii Hironori.
2675
2676         This patch corrects a handful of errors in Direct2D's drawing code.
2677
2678         * platform/graphics/win/Direct2DOperations.cpp:
2679         (WebCore::Direct2D::clearRect): Use the transformed dimensions of
2680         rects to determine whether they intersect with the render target.
2681         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
2682         (WebCore::ImageBufferData::copyRectFromData const):
2683         (WebCore::ImageBufferData::loadDataToBitmapIfNeeded): It is not
2684         necessary (or correct) to 'endDraw' when loading image data to the
2685         Bitmap target.
2686         * platform/graphics/win/PathDirect2D.cpp:
2687         (WebCore::Path::strokeBoundingRect const): Provide an implementation.
2688
2689 2019-10-01  Alex Christensen  <achristensen@webkit.org>
2690
2691         Progress towards successful CMake build on Mac
2692         https://bugs.webkit.org/show_bug.cgi?id=202426
2693
2694         Rubber-stamped by Tim Horton.
2695
2696         * PlatformMac.cmake:
2697
2698 2019-10-01  Tim Horton  <timothy_horton@apple.com>
2699
2700         Clean up some includes to make the build a bit faster
2701         https://bugs.webkit.org/show_bug.cgi?id=202417
2702
2703         Reviewed by Jer Noble.
2704
2705         No new tests, just reorganizing.
2706
2707         Apply some profile-guided optimizations to our headers.
2708
2709         * Modules/mediasource/SourceBuffer.cpp:
2710         * WebCorePrefix.h:
2711         Add HashMap, which ends up included in all source files.
2712
2713         * html/HTMLImageElement.cpp:
2714         (WebCore::HTMLImageElement::HTMLImageElement):
2715         (WebCore::HTMLImageElement::selectImageSource):
2716         (WebCore::HTMLImageElement::didAttachRenderers):
2717         (WebCore::HTMLImageElement::insertedIntoAncestor):
2718         (WebCore::HTMLImageElement::width):
2719         (WebCore::HTMLImageElement::height):
2720         (WebCore::HTMLImageElement::naturalWidth const):
2721         (WebCore::HTMLImageElement::naturalHeight const):
2722         (WebCore::HTMLImageElement::complete const):
2723         (WebCore::HTMLImageElement::decode):
2724         (WebCore::HTMLImageElement::didMoveToNewDocument):
2725         (WebCore::HTMLImageElement::cachedImage const):
2726         (WebCore::HTMLImageElement::setLoadManually):
2727         (WebCore::HTMLImageElement::hasPendingActivity const):
2728         (WebCore::HTMLImageElement::pendingDecodePromisesCountForTesting const):
2729         * html/HTMLImageElement.h:
2730         (WebCore::HTMLImageElement::cachedImage const): Deleted.
2731         (WebCore::HTMLImageElement::setLoadManually): Deleted.
2732         (WebCore::HTMLImageElement::hasPendingActivity const): Deleted.
2733         (WebCore::HTMLImageElement::pendingDecodePromisesCountForTesting const): Deleted.
2734         HTMLImageLoader brings in JSDOMPromiseDeferred, which is known to be horribly expensive.
2735         Out-of-line m_imageLoader.
2736
2737         * platform/graphics/GraphicsLayer.h:
2738         Swap Animation for TimingFunction, which is much smaller.
2739
2740         * platform/graphics/MediaPlayer.h:
2741         InbandTextTrackPrivate brings in SerializedPlatformRepresentation.h,
2742         which is very expensive. MediaPlayer.h is included in many places.
2743         Break the link.
2744
2745         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2746
2747 2019-10-01  youenn fablet  <youenn@apple.com>
2748
2749         RTCDataChannel should not prevent entering page cache except if in open state
2750         https://bugs.webkit.org/show_bug.cgi?id=202395
2751
2752         Reviewed by Chris Dumez.
2753
2754         Only prevent entering page cache in open state.
2755         Enqueue message through the document event queue to handle suspension properly.
2756
2757         We cannot yet write page cache tests as a data channel requires a peer connection which
2758         currently forbids entering page cache.
2759
2760         * Modules/mediastream/RTCDataChannel.cpp:
2761         (WebCore::RTCDataChannel::RTCDataChannel):
2762         (WebCore::RTCDataChannel::didReceiveStringData):
2763         (WebCore::RTCDataChannel::didReceiveRawData):
2764         (WebCore::RTCDataChannel::didDetectError):
2765         (WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
2766         (WebCore::RTCDataChannel::scheduleDispatchEvent):
2767         (WebCore::RTCDataChannel::scheduledEventTimerFired): Deleted.
2768         * Modules/mediastream/RTCDataChannel.h:
2769
2770 2019-10-01  Rob Buis  <rbuis@igalia.com>
2771
2772         [Mac] Layout Test imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location.any.html fails
2773         https://bugs.webkit.org/show_bug.cgi?id=202350
2774
2775         Reviewed by Alex Christensen.
2776
2777         In some cases didReceiveResponse will deliver redirects (normally willSendRequestInternal will be used for redirects).
2778         When this is done in manual redirect mode make sure the response type is opaque redirect.
2779
2780         Test: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location.any.html
2781
2782         * loader/SubresourceLoader.cpp:
2783         (WebCore::SubresourceLoader::didReceiveResponse):
2784
2785 2019-10-01  Keith Rollin  <krollin@apple.com>
2786
2787         Remove some support for < iOS 13
2788         https://bugs.webkit.org/show_bug.cgi?id=202386
2789         <rdar://problem/55863017>
2790
2791         Reviewed by Eric Carlson.
2792
2793         Remove some support for iOS versions less than 13.0.
2794
2795         Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
2796         and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
2797         values >= 130000. This means that expressions like
2798         "__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
2799         "__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.
2800
2801         This removal is part of a series of patches effecting the removal of
2802         dead code for old versions of iOS. This particular pass involves
2803         changes in which Jer Noble was involved. These changes are isolated
2804         from other similar changes in order to facilitate the reviewing
2805         process.
2806
2807         No new tests -- no new or changed functionality.
2808
2809         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2810         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesLastModifiedTime const):
2811         (WebCore::MediaPlayerPrivateAVFoundationObjC::liveUpdateInterval const):
2812
2813 2019-10-01  Chris Dumez  <cdumez@apple.com>
2814
2815         Unreviewed attempt to fix Windows build after r250527.
2816
2817         * dom/GenericEventQueue.cpp:
2818         (WebCore::TaskQueueConstructor::construct):
2819         (WebCore::TaskQueueConstructor<Timer>::construct):
2820         (WebCore::GenericEventQueueBase<T>::enqueueEvent):
2821         (WebCore::GenericEventQueueBase<T>::close):
2822         (WebCore::GenericEventQueueBase<T>::cancelAllEvents):
2823         (WebCore::GenericEventQueueBase<T>::setPaused):
2824         (WebCore::GenericEventQueueBase<T>::suspend):
2825         (WebCore::GenericEventQueueBase<T>::rescheduleAllEventsIfNeeded):
2826         * dom/GenericEventQueue.h:
2827         * platform/GenericTaskQueue.h:
2828
2829 2019-10-01  Alex Christensen  <achristensen@webkit.org>
2830
2831         Fix internal build after r250549
2832         https://bugs.webkit.org/show_bug.cgi?id=202390
2833
2834         There is an internal #define confirm on some systems, so rename DOMWindow::confirm to DOMWindow::confirmForBindings.
2835
2836         * page/DOMWindow.cpp:
2837         (WebCore::DOMWindow::confirmForBindings):
2838         (WebCore::DOMWindow::confirm): Deleted.
2839         * page/DOMWindow.h:
2840         * page/DOMWindow.idl:
2841
2842 2019-10-01  Chris Dumez  <cdumez@apple.com>
2843
2844         Unreviewed attempt to fix Windows build after r250527.
2845
2846         * platform/GenericTaskQueue.h:
2847
2848 2019-10-01  Zan Dobersek  <zdobersek@igalia.com>
2849
2850         [CoordGraphics] Implement sync methods for position, bounds origin
2851         https://bugs.webkit.org/show_bug.cgi?id=202398
2852
2853         Reviewed by Carlos Garcia Campos.
2854
2855         Add the CoordinatedGraphicsLayer::syncPosition() and
2856         CoordinatedGraphicsLayer::syncBoundsOrigin() method overrides, both
2857         performing a synchronization of the given GraphicsLayer attribute.
2858
2859         These methods are used by the scrolling code to reflect changes in these
2860         attributes without causing a layer flush (which is not necessary since
2861         the changes have already been applied in an equivalent way).
2862
2863         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2864         (WebCore::CoordinatedGraphicsLayer::didChangeGeometry):
2865         (WebCore::CoordinatedGraphicsLayer::syncPosition):
2866         (WebCore::CoordinatedGraphicsLayer::syncBoundsOrigin):
2867         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2868
2869 2019-10-01  Joonghun Park  <jh718.park@samsung.com>
2870
2871         Make table's clientWidth/Height include its border sizes.
2872         https://bugs.webkit.org/show_bug.cgi?id=200974
2873
2874         WebKit doesn't have table wrapper box currently
2875         while Gecko has it,
2876         so this CL tries to mimic the behavior that
2877         clientWidth/Height refers to table wrapper box
2878         which doesn't have borders applied to itself
2879         and table grid box has the borders.
2880
2881         This CL adds table's border sizes
2882         to clientWidth/Height
2883         at |LayoutBox::PixelSnappedClientWidth/Height|.
2884
2885         As a result of this CL, table's clientWidth/Height
2886         and offsetWidth/Height are equal now, respectively.
2887
2888         The corresponding csswg discussion is
2889         https://github.com/w3c/csswg-drafts/issues/4245.
2890
2891         Reviewed by Antti Koivisto.
2892
2893         Tests: fast/table/border-collapsing/bug236727.html
2894                imported/w3c/web-platform-tests/css/cssom-view/table-border-collapse-client-width-height.html
2895                imported/w3c/web-platform-tests/css/cssom-view/table-border-separate-client-width-height.html
2896                imported/w3c/web-platform-tests/css/cssom-view/table-with-border-client-width-height.html
2897
2898         * dom/Element.cpp:
2899         (WebCore::Element::clientWidth):
2900         (WebCore::Element::clientHeight):
2901
2902 2019-10-01  youenn fablet  <youenn@apple.com>
2903
2904         Remove races condition when validating capture sandbox extension revocation
2905         https://bugs.webkit.org/show_bug.cgi?id=202133
2906         <rdar://problem/55660905>
2907
2908         Reviewed by Eric Carlson.
2909
2910         Covered by existing tests.
2911
2912         * Modules/mediastream/MediaStreamTrack.cpp:
2913         (WebCore::MediaStreamTrack::endCapture):
2914         Synchronously update document media state when capture is ended.
2915         This allows to validate the fact that no document is capturing while we revoke sandbox extensions.
2916
2917 2019-10-01  youenn fablet  <youenn@apple.com>
2918
2919         MediaDevices should be SecureContext
2920         https://bugs.webkit.org/show_bug.cgi?id=202267
2921
2922         Reviewed by Eric Carlson.
2923
2924         Manually tested since 127.0.0.1/localhost are secure contexts.
2925
2926         * Modules/mediastream/MediaDevices.idl:
2927         * bindings/js/WebCoreBuiltinNames.h:
2928
2929 2019-09-30  Alex Christensen  <achristensen@webkit.org>
2930
2931         Resurrect Mac CMake build
2932         https://bugs.webkit.org/show_bug.cgi?id=202384
2933
2934         Rubber-stamped by Tim Horton.
2935
2936         * PlatformMac.cmake:
2937
2938 2019-09-30  Chris Dumez  <cdumez@apple.com>
2939
2940         Make GenericEventQueue an ActiveDOMObject
2941         https://bugs.webkit.org/show_bug.cgi?id=202373
2942
2943         Reviewed by Eric Carlson.
2944
2945         Make GenericEventQueue an ActiveDOMObject so that it is guaranteed to never fire any events while
2946         suspended without requiring the client to explicitly suspend/resume the event queue.
2947
2948         * Modules/encryptedmedia/MediaKeySession.cpp:
2949         (WebCore::MediaKeySession::MediaKeySession):
2950         (WebCore::MediaKeySession::enqueueMessage):
2951         (WebCore::MediaKeySession::updateKeyStatuses):
2952         * Modules/encryptedmedia/MediaKeySession.h:
2953         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
2954         (WebCore::WebKitMediaKeySession::WebKitMediaKeySession):
2955         (WebCore::WebKitMediaKeySession::~WebKitMediaKeySession):
2956         (WebCore::WebKitMediaKeySession::addKeyTimerFired):
2957         (WebCore::WebKitMediaKeySession::sendMessage):
2958         (WebCore::WebKitMediaKeySession::sendError):
2959         (WebCore::WebKitMediaKeySession::hasPendingActivity const):
2960         (WebCore::WebKitMediaKeySession::stop):
2961         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
2962         * Modules/mediasource/MediaSource.cpp:
2963         (WebCore::MediaSource::MediaSource):
2964         (WebCore::MediaSource::hasPendingActivity const):
2965         (WebCore::MediaSource::stop):
2966         (WebCore::MediaSource::canSuspendForDocumentSuspension const):
2967         (WebCore::MediaSource::scheduleEvent):
2968         * Modules/mediasource/MediaSource.h:
2969         * Modules/mediasource/SourceBuffer.cpp:
2970         (WebCore::SourceBuffer::SourceBuffer):
2971         (WebCore::SourceBuffer::hasPendingActivity const):
2972         (WebCore::SourceBuffer::stop):
2973         (WebCore::SourceBuffer::scheduleEvent):
2974         * Modules/mediasource/SourceBuffer.h:
2975         * Modules/mediasource/SourceBufferList.cpp:
2976         (WebCore::SourceBufferList::SourceBufferList):
2977         (WebCore::SourceBufferList::scheduleEvent):
2978         (WebCore::SourceBufferList::canSuspendForDocumentSuspension const):
2979         * Modules/mediasource/SourceBufferList.h:
2980         * Modules/webaudio/AudioContext.cpp:
2981         (WebCore::AudioContext::AudioContext):
2982         (WebCore::AudioContext::stop):
2983         * Modules/webaudio/AudioContext.h:
2984         * animation/DeclarativeAnimation.cpp:
2985         (WebCore::DeclarativeAnimation::DeclarativeAnimation):
2986         (WebCore::DeclarativeAnimation::tick):
2987         (WebCore::DeclarativeAnimation::needsTick const):
2988         (WebCore::DeclarativeAnimation::remove):
2989         (WebCore::DeclarativeAnimation::enqueueDOMEvent):
2990         (WebCore::DeclarativeAnimation::stop):
2991         (WebCore::DeclarativeAnimation::suspend):
2992         (WebCore::DeclarativeAnimation::resume):
2993         * animation/DeclarativeAnimation.h:
2994         * dom/GenericEventQueue.cpp:
2995         (WebCore::GenericEventQueueBase<T>::GenericEventQueueBase):
2996         (WebCore::GenericEventQueueBase<T>::setPaused):
2997         (WebCore::GenericEventQueueBase<T>::canSuspendForDocumentSuspension const):
2998         (WebCore::GenericEventQueueBase<T>::suspend):
2999         (WebCore::GenericEventQueueBase<T>::resume):
3000         (WebCore::GenericEventQueueBase<T>::rescheduleAllEventsIfNeeded):
3001         (WebCore::GenericEventQueueBase<T>::stop):
3002         (WebCore::GenericEventQueueBase<T>::activeDOMObjectName const):
3003         (WebCore::GenericEventQueue::create):
3004         (WebCore::MainThreadGenericEventQueue::create):
3005         * dom/GenericEventQueue.h:
3006         * dom/MessagePort.cpp:
3007         (WebCore::MessagePort::MessagePort):
3008         (WebCore::MessagePort::close):
3009         (WebCore::MessagePort::dispatchMessages):
3010         * dom/MessagePort.h:
3011         * html/HTMLMediaElement.cpp:
3012         (WebCore::HTMLMediaElement::HTMLMediaElement):
3013         (WebCore::HTMLMediaElement::~HTMLMediaElement):
3014         (WebCore::HTMLMediaElement::scheduleEvent):
3015         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
3016         (WebCore::HTMLMediaElement::cancelPendingEventsAndCallbacks):
3017         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
3018         (WebCore::HTMLMediaElement::mediaPlayerInitializationDataEncountered):
3019         (WebCore::HTMLMediaElement::closeTaskQueues):
3020         (WebCore::HTMLMediaElement::suspend):
3021         (WebCore::HTMLMediaElement::resume):
3022         (WebCore::HTMLMediaElement::hasPendingActivity const):
3023         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
3024         * html/HTMLMediaElement.h:
3025         * html/track/TrackListBase.cpp:
3026         (WebCore::TrackListBase::TrackListBase):
3027         (WebCore::TrackListBase::scheduleTrackEvent):
3028         (WebCore::TrackListBase::scheduleChangeEvent):
3029         (WebCore::TrackListBase::isChangeEventScheduled const):
3030         (WebCore::TrackListBase::canSuspendForDocumentSuspension const):
3031         * html/track/TrackListBase.h:
3032         * workers/Worker.cpp:
3033         (WebCore::Worker::Worker):
3034         (WebCore::Worker::terminate):
3035         (WebCore::Worker::stop):
3036         (WebCore::Worker::hasPendingActivity const):
3037         (WebCore::Worker::enqueueEvent):
3038         (WebCore::Worker::dispatchEvent):
3039         * workers/Worker.h:
3040         * workers/service/ServiceWorkerContainer.cpp:
3041         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
3042         (WebCore::ServiceWorkerContainer::startMessages):
3043         (WebCore::ServiceWorkerContainer::postMessage):
3044         (WebCore::ServiceWorkerContainer::stop):
3045         * workers/service/ServiceWorkerContainer.h:
3046
3047 2019-09-30  Chris Dumez  <cdumez@apple.com>
3048
3049         IDBTransaction / IDBObjectStore should not prevent a page from entering the back / forward cache
3050         https://bugs.webkit.org/show_bug.cgi?id=202291
3051         <rdar://problem/55760106>
3052
3053         Reviewed by Geoffrey Garen.
3054
3055         IDBObjectStore does not fire any events and should therefore not cause any problem while in PageCache.
3056         IDBTransaction can only fire abort/complete/error events, all of which are being enqueued to the
3057         DocumentEventQueue. The DocumentEventQueue subclasses SuspendableTimer which will correctly suspend
3058         while the document is in page cache. IDBTransaction will therefore not cause events to fire (and JS
3059         to run) while in page cache.
3060
3061         Test: storage/indexeddb/IDBTransaction-page-cache.html
3062
3063         * Modules/indexeddb/IDBObjectStore.cpp:
3064         (WebCore::IDBObjectStore::canSuspendForDocumentSuspension const):
3065         * Modules/indexeddb/IDBTransaction.cpp:
3066         (WebCore::IDBTransaction::canSuspendForDocumentSuspension const):
3067
3068 2019-09-30  Chris Dumez  <cdumez@apple.com>
3069
3070         Refine restrictions for X-Temp-Tablet HTTP header experiment
3071         https://bugs.webkit.org/show_bug.cgi?id=202367
3072         <rdar://problem/55849139>
3073
3074         Reviewed by Geoffrey Garen.
3075
3076         Refine restrictions for X-Temp-Tablet HTTP header experiment:
3077         1. Only send the header if the embedding application is MobileSafari.
3078         2. Only send the header if the first party is google.com
3079         3. Only send the header if the current date is before 2/1/2020
3080         4. Send the header even if using an ephemeral session
3081
3082         * loader/cache/CachedResourceLoader.cpp:
3083         (WebCore::isXTempTabletHeaderExperimentOver):
3084         (WebCore::CachedResourceLoader::CachedResourceLoader):
3085         (WebCore::isGoogleSearch):
3086         (WebCore::CachedResourceLoader::shouldSendXTempTabletHeader const):
3087         (WebCore::CachedResourceLoader::requestResource):
3088         * loader/cache/CachedResourceLoader.h:
3089
3090 2019-09-30  Chris Dumez  <cdumez@apple.com>
3091
3092         Pages with Web Workers cannot enter the back / forward cache
3093         https://bugs.webkit.org/show_bug.cgi?id=202296
3094         <rdar://problem/55764073>
3095
3096         Reviewed by Jer Noble.
3097
3098         Allow pages that use Web Workers to enter the back / forward cache.
3099         This involves adding an EventQueue for all event firing on Woker
3100         objects and suspending this EventQueue while in the page cache.
3101
3102         This was preventing some of the pages on weather.com to enter the
3103         back / forward cache.
3104
3105         Test: fast/workers/worker-page-cache.html
3106
3107         * Modules/encryptedmedia/MediaKeySession.h:
3108         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
3109         * Modules/mediasource/MediaSource.h:
3110         * Modules/mediasource/SourceBuffer.h:
3111         * Modules/mediasource/SourceBufferList.h:
3112         * Modules/webaudio/AudioContext.cpp:
3113         (WebCore::AudioContext::AudioContext):
3114         * Modules/webaudio/AudioContext.h:
3115         * animation/DeclarativeAnimation.h:
3116
3117         * dom/GenericEventQueue.cpp:
3118         (WebCore::TaskQueueConstructor::construct):
3119         (WebCore::TaskQueueConstructor<Timer>::construct):
3120         (WebCore::GenericEventQueueBase<T>::GenericEventQueueBase):
3121         (WebCore::GenericEventQueueBase<T>::enqueueEvent):
3122         (WebCore::GenericEventQueueBase<T>::dispatchOneEvent):
3123         (WebCore::GenericEventQueueBase<T>::close):
3124         (WebCore::GenericEventQueueBase<T>::cancelAllEvents):
3125         (WebCore::GenericEventQueueBase<T>::hasPendingEvents const):
3126         (WebCore::GenericEventQueueBase<T>::hasPendingEventsOfType const):
3127         (WebCore::GenericEventQueueBase<T>::suspend):
3128         (WebCore::GenericEventQueueBase<T>::resume):
3129         * dom/GenericEventQueue.h:
3130         (WebCore::GenericEventQueueBase::isSuspended const):
3131         (WebCore::MainThreadGenericEventQueue::MainThreadGenericEventQueue):
3132         (WebCore::GenericEventQueue::GenericEventQueue):
3133         Rename GenericEventQueue to MainThreadGenericEventQueue since its implementation relies
3134         on a global shared Timer to fire events. Introduce a new GenericEventQueue which can
3135         actually be used from any thread. This is useful for MessagePort, which is used both
3136         on the main thread and on worker threads.
3137
3138         * dom/MessagePort.cpp:
3139         (WebCore::MessagePort::MessagePort):
3140         (WebCore::MessagePort::close):
3141         (WebCore::MessagePort::suspend):
3142         (WebCore::MessagePort::resume):
3143         (WebCore::MessagePort::dispatchMessages):
3144         * dom/MessagePort.h:
3145         Use an GenericEventQueue in MessagePort for consistency with Worker.
3146         MessagePort is an ActiveDOMobject which returns true in canSuspend(),
3147         we therefore need to make sure it suspends event firing while
3148         suspended.
3149
3150         * html/HTMLMediaElement.h:
3151         * html/track/TrackListBase.h:
3152         * workers/Worker.cpp:
3153         (WebCore::Worker::Worker):
3154         (WebCore::Worker::terminate):
3155         (WebCore::Worker::canSuspendForDocumentSuspension const):
3156         (WebCore::Worker::suspend):
3157         (WebCore::Worker::resume):
3158         (WebCore::Worker::stop):
3159         (WebCore::Worker::hasPendingActivity const):
3160         (WebCore::Worker::notifyFinished):
3161         (WebCore::Worker::enqueueEvent):
3162         (WebCore::Worker::dispatchEvent):
3163         * workers/Worker.h:
3164         * workers/WorkerMessagingProxy.cpp:
3165         (WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
3166         (WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
3167
3168 2019-09-27  Keith Rollin  <krollin@apple.com>
3169
3170         Coalesce or remove PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
3171         https://bugs.webkit.org/show_bug.cgi?id=202119
3172         <rdar://problem/55638792>
3173
3174         Unreviewed, address post landing review comments for r248533 from
3175         Darin Adler.
3176
3177         No new tests -- no new or changed functionality.
3178
3179         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
3180         (WebCore::convert):
3181         (WebCore::subLocality): Deleted.
3182         (WebCore::setSubLocality): Deleted.
3183         (WebCore::subAdministrativeArea): Deleted.
3184         (WebCore::setSubAdministrativeArea): Deleted.
3185
3186 2019-09-30  Antti Koivisto  <antti@apple.com>
3187
3188         RenderLineBreak should use LineLayoutTraversal
3189         https://bugs.webkit.org/show_bug.cgi?id=202316
3190
3191         Reviewed by Zalan Bujtas.
3192
3193         Replace more path specific code with LineLayoutTraversal.
3194
3195         * Headers.cmake:
3196         * rendering/RenderLineBreak.cpp:
3197         (WebCore::RenderLineBreak::linesBoundingBox const):
3198         (WebCore::RenderLineBreak::absoluteRects const):
3199         (WebCore::RenderLineBreak::absoluteQuads const):
3200         (WebCore::simpleLineLayout): Deleted.
3201         * rendering/RenderTreeAsText.cpp:
3202         (WebCore::RenderTreeAsText::writeRenderObject):
3203         (WebCore::writeTextBox):
3204         * rendering/SimpleLineLayoutFunctions.cpp:
3205         (WebCore::SimpleLineLayout::computeBoundingBox): Deleted.
3206         (WebCore::SimpleLineLayout::collectAbsoluteRects): Deleted.
3207         (WebCore::SimpleLineLayout::rendererForPosition): Deleted.
3208         * rendering/SimpleLineLayoutFunctions.h:
3209         * rendering/line/LineLayoutTraversal.cpp:
3210         (WebCore::LineLayoutTraversal::ElementBoxIterator::ElementBoxIterator):
3211         (WebCore::LineLayoutTraversal::ElementBoxIterator::atEnd const):
3212         (WebCore::LineLayoutTraversal::elementBoxFor):
3213         (WebCore::LineLayoutTraversal::TextBox::rect const): Deleted.
3214         (WebCore::LineLayoutTraversal::TextBox::logicalRect const): Deleted.
3215         (WebCore::LineLayoutTraversal::TextBox::hasHyphen const): Deleted.
3216         (WebCore::LineLayoutTraversal::TextBox::isLeftToRightDirection const): Deleted.
3217         (WebCore::LineLayoutTraversal::TextBox::dirOverride const): Deleted.
3218         (WebCore::LineLayoutTraversal::TextBox::text const): Deleted.
3219         (WebCore::LineLayoutTraversal::TextBox::isLineBreak const): Deleted.
3220         (WebCore::LineLayoutTraversal::TextBox::localStartOffset const): Deleted.
3221         (WebCore::LineLayoutTraversal::TextBox::localEndOffset const): Deleted.
3222         (WebCore::LineLayoutTraversal::TextBox::length const): Deleted.
3223         (WebCore::LineLayoutTraversal::TextBox::isLastOnLine const): Deleted.
3224         (WebCore::LineLayoutTraversal::TextBox::isLast const): Deleted.
3225         (WebCore::LineLayoutTraversal::TextBox::iterator const): Deleted.
3226
3227         Move to header as templates.
3228
3229         * rendering/line/LineLayoutTraversal.h:
3230         (WebCore::LineLayoutTraversal::ElementBoxIterator::ElementBoxIterator):
3231         (WebCore::LineLayoutTraversal::ElementBoxIterator::operator bool const):
3232         (WebCore::LineLayoutTraversal::ElementBoxIterator::operator* const):
3233         (WebCore::LineLayoutTraversal::ElementBoxIterator::operator-> const):
3234
3235         Add a new iterator type for element boxes.
3236         It doesn't currently really iterate, is just allows testing for end.
3237
3238         (WebCore::LineLayoutTraversal::Box<Iterator>::rect const):
3239         (WebCore::LineLayoutTraversal::Box<Iterator>::logicalRect const):
3240         (WebCore::LineLayoutTraversal::Box<Iterator>::isLeftToRightDirection const):
3241         (WebCore::LineLayoutTraversal::Box<Iterator>::dirOverride const):
3242         (WebCore::LineLayoutTraversal::Box<Iterator>::isLineBreak const):
3243         (WebCore::LineLayoutTraversal::Box<Iterator>::iterator const):
3244
3245         Split properties that all inline boxes have out from TextBox.
3246         Make it a template class.
3247
3248         (WebCore::LineLayoutTraversal::TextBox<Iterator>::hasHyphen const):
3249         (WebCore::LineLayoutTraversal::TextBox<Iterator>::text const):
3250         (WebCore::LineLayoutTraversal::TextBox<Iterator>::localStartOffset const):
3251         (WebCore::LineLayoutTraversal::TextBox<Iterator>::localEndOffset const):
3252         (WebCore::LineLayoutTraversal::TextBox<Iterator>::length const):
3253         (WebCore::LineLayoutTraversal::TextBox<Iterator>::isLastOnLine const):
3254         (WebCore::LineLayoutTraversal::TextBox<Iterator>::isLast const):
3255
3256         Make a template class.
3257
3258         (WebCore::LineLayoutTraversal::hasTextBoxes): Deleted.
3259
3260 2019-09-30  Rob Buis  <rbuis@igalia.com>
3261
3262         No-Cors check should take into account same-origin
3263         https://bugs.webkit.org/show_bug.cgi?id=202353
3264
3265         Reviewed by Youenn Fablet.
3266
3267         No-Cors check should take into account same-origin, in that case the
3268         check should bail out, since same-origin is already handled in
3269         the first step of [1].
3270
3271         Test: imported/web-platform-tests/fetch/api/redirect/redirect-mode.any.html
3272
3273         [1] https://fetch.spec.whatwg.org/#main-fetch Step 5
3274
3275         * loader/cache/CachedResourceLoader.cpp:
3276         (WebCore::CachedResourceLoader::canRequest):
3277
3278 2019-09-30  Zan Dobersek  <zdobersek@igalia.com>
3279
3280         [Nicosia] Complete ScrollingTreeNicosia::createScrollingTreeNode()
3281         https://bugs.webkit.org/show_bug.cgi?id=202358
3282
3283         Reviewed by Carlos Garcia Campos.
3284
3285         * page/scrolling/nicosia/ScrollingTreeNicosia.cpp:
3286         (WebCore::ScrollingTreeNicosia::createScrollingTreeNode):
3287         Return appropriate objects for the remaining node types.
3288
3289 2019-09-30  Zan Dobersek  <zdobersek@igalia.com>
3290
3291         [Nicosia] Add missing conversion casts for LayerRepresentation objects
3292         https://bugs.webkit.org/show_bug.cgi?id=202357
3293
3294         Reviewed by Carlos Garcia Campos.
3295
3296         After r250491, we have to request explicit conversion of
3297         LayerRepresentation objects to Nicosia::PlatformLayer pointers.
3298
3299         * page/scrolling/nicosia/ScrollingTreeFixedNode.cpp:
3300         (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
3301         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp:
3302         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateBeforeChildren):
3303         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent):
3304         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::repositionScrollingLayers):
3305         * page/scrolling/nicosia/ScrollingTreeOverflowScrollProxyNode.cpp:
3306         (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
3307         * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp:
3308         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::repositionScrollingLayers):
3309         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::handleWheelEvent):
3310         * page/scrolling/nicosia/ScrollingTreePositionedNode.cpp:
3311         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
3312         * page/scrolling/nicosia/ScrollingTreeStickyNode.cpp:
3313         (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
3314
3315 2019-09-29  Zan Dobersek  <zdobersek@igalia.com>
3316
3317         ScrollingTreeScrollingNode: use LayerRepresentation for scroll container, scrolled contents layers
3318         https://bugs.webkit.org/show_bug.cgi?id=202256
3319         <rdar://problem/55772092>
3320
3321         Reviewed by Simon Fraser.
3322
3323         Make the scroll container and scrolled contents layer holders
3324         platform-independent by using the LayerRepresentation as the underlying
3325         type for the two member variables in ScrollingTreeScrollingNode.
3326
3327         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3328         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
3329         * page/scrolling/ScrollingTreeScrollingNode.h:
3330         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3331         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
3332         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
3333         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
3334
3335 2019-09-28  Brent Fulgham  <bfulgham@apple.com>
3336
3337         [FTW] Correct compositing, shadow, and radial gradient implementations
3338         https://bugs.webkit.org/show_bug.cgi?id=202177
3339
3340         Reviewed by Fujii Hironori.
3341
3342         This patch corrects a number of implementation errors in basic Canvas
3343         drawing operations.
3344
3345         Tested by canvas/philip/tests 
3346
3347         * platform/graphics/win/Direct2DOperations.cpp:
3348         (WebCore::Direct2D::State::setCompositeOperation): Initialize blend and
3349         composite modes to correct defaults.
3350         (WebCore::Direct2D::drawWithShadowHelper): Correct value used for blur
3351         standard deviation to more closely match other browser output.
3352         * platform/graphics/win/Direct2DUtilities.cpp:
3353         (WebCore::Direct2D::createBitmapCopyFromContext): Added helper function.
3354         * platform/graphics/win/Direct2DUtilities.h:
3355         * platform/graphics/win/GradientDirect2D.cpp:
3356         (WebCore::Gradient::generateGradient): Properly handle the case of a non-zero
3357         initial gradient radius. Properly compute the final radius.
3358         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
3359         (WebCore::ImageBufferData::readDataFromBitmapIfNeeded const): Update to use ID2D1DeviceContext
3360         from platformContext, rather than searching for it each time.
3361         (WebCore::ImageBufferData::compatibleBitmap): Ditto.
3362         * platform/graphics/win/PlatformContextDirect2D.cpp:
3363         (WebCore::PlatformContextDirect2D::PlatformContextDirect2D): Grab the ID2D1DeviceContext for
3364         the RenderTarget at construction time.
3365         (WebCore::PlatformContextDirect2D::setRenderTarget): Ditto.
3366         (WebCore::PlatformContextDirect2D::endDraw): Perform compositing operations when needed.
3367         (WebCore::PlatformContextDirect2D::compositeIfNeeded): Added.
3368         (WebCore::PlatformContextDirect2D::setBlendAndCompositeMode): Update to properly set the
3369         blend and compositing mode (depending on global value set for the canvas.)
3370         * platform/graphics/win/PlatformContextDirect2D.h:
3371         (WebCore::PlatformContextDirect2D::deviceContext):
3372         (WebCore::PlatformContextDirect2D::setRenderTarget): Deleted.
3373         (WebCore::PlatformContextDirect2D::setBlendMode): Deleted.
3374         (WebCore::PlatformContextDirect2D::setCompositeMode): Deleted.
3375
3376 2019-09-29  Zan Dobersek  <zdobersek@igalia.com>
3377
3378         Tighten up LayerRepresentation operators
3379         https://bugs.webkit.org/show_bug.cgi?id=202344
3380
3381         Reviewed by Simon Fraser.
3382
3383         Make the operators on the LayerRepresentation class explicit.
3384         Additionally, the bool operator is added to the class, allowing objects
3385         of this class to be safely used in boolean contexts like null checks.
3386         Before, use in such contexts fell back to using the
3387         GraphicsLayer::PlatformLayerID operator which caused asserts when the
3388         internal representation was of different type.
3389
3390         While the explicit operators prevent misuse, they do require additional
3391         conversion casts to retrieve the internal LayerRepresentation value.
3392
3393         * page/scrolling/ScrollingStateNode.h:
3394         (WebCore::LayerRepresentation::operator GraphicsLayer* const):
3395         (WebCore::LayerRepresentation::operator PlatformLayer* const):
3396         (WebCore::LayerRepresentation::operator GraphicsLayer::PlatformLayerID const):
3397         (WebCore::LayerRepresentation::operator bool const):
3398         (WebCore::LayerRepresentation::toRepresentation const):
3399         Add a missing ASSERT_NOT_REACHED() invocation.
3400         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3401         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
3402         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
3403         (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
3404         * page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm:
3405         (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
3406         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
3407         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
3408         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
3409         (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
3410         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3411         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
3412
3413 2019-09-29  Zalan Bujtas  <zalan@apple.com>
3414
3415         [LFC][IFC] Remove InlineLayout abstraction layer
3416         https://bugs.webkit.org/show_bug.cgi?id=202352
3417         <rdar://problem/55811532>