a3017fab892f9f4c43fc0e82a316b892a11c0c7e
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-03-08  Per Arne Vollan  <pvollan@apple.com>
2
3         NSAnimation is not working in the WebContent process when WindowServer access is blocked.
4         https://bugs.webkit.org/show_bug.cgi?id=183291
5
6         Reviewed by Dean Jackson.
7
8         The animation can be implemented by using an NSTimer instead. Use the existing Bezier timing
9         function to create a smooth animation.
10
11         No new tests. This code is used to fade scrollbars in and out by animating the alpha value.
12         This scrollbar setting is not the default in macOS, which makes it non trivial to create
13         layout tests for this.
14
15         * platform/mac/ScrollAnimatorMac.mm:
16         (-[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]):
17         (-[WebScrollbarPartAnimation startAnimation]):
18         (-[WebScrollbarPartAnimation setCurrentProgress:setCurrentProgress:]):
19         (-[WebScrollbarPartAnimation invalidate]):
20         (-[WebScrollbarPartAnimation setDuration:]):
21         (-[WebScrollbarPartAnimation stopAnimation]):
22         (-[WebScrollbarPartAnimation setCurrentProgress:]): Deleted.
23
24 2018-03-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
25
26         Templatize SVGAnimatedType
27         https://bugs.webkit.org/show_bug.cgi?id=183017
28
29         Reviewed by Dean Jackson.
30
31         This is a work toward https://bugs.webkit.org/show_bug.cgi?id=168586. The
32         goal to have SVGAnimatedType be type independent. The appropriate method
33         of this template will be implicitly instantiated based to the type of the
34         animated attribute(s).
35
36         * Sources.txt: Delete SVGAnimatedType.cpp since its function became template
37         functions or short enough to be inline functions.
38         * WebCore.xcodeproj/project.pbxproj:
39         * svg/SVGAnimatedAngle.cpp:
40         (WebCore::SVGAnimatedAngleAnimator::constructFromString):
41         (WebCore::SVGAnimatedAngleAnimator::startAnimValAnimation):
42         (WebCore::SVGAnimatedAngleAnimator::resetAnimValToBaseVal):
43         (WebCore::SVGAnimatedAngleAnimator::addAnimatedTypes):
44         (WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue):
45         Use the template functions SVGAnimatedType::create<>() and SVGAnimatedType::as<>().
46
47         * svg/SVGAnimatedBoolean.cpp:
48         (WebCore::SVGAnimatedBooleanAnimator::constructFromString):
49         (WebCore::SVGAnimatedBooleanAnimator::startAnimValAnimation):
50         (WebCore::SVGAnimatedBooleanAnimator::resetAnimValToBaseVal):
51         (WebCore::SVGAnimatedBooleanAnimator::calculateAnimatedValue):
52         Ditto.
53
54         * svg/SVGAnimatedColor.cpp:
55         (WebCore::SVGAnimatedColorAnimator::constructFromString):
56         (WebCore::SVGAnimatedColorAnimator::addAnimatedTypes):
57         (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
58         Ditto.
59
60         * svg/SVGAnimatedEnumeration.cpp:
61         (WebCore::SVGAnimatedEnumerationAnimator::constructFromString):
62         (WebCore::SVGAnimatedEnumerationAnimator::startAnimValAnimation):
63         (WebCore::SVGAnimatedEnumerationAnimator::resetAnimValToBaseVal):
64         (WebCore::SVGAnimatedEnumerationAnimator::calculateAnimatedValue):
65         Ditto.
66
67         * svg/SVGAnimatedInteger.cpp:
68         (WebCore::SVGAnimatedIntegerAnimator::constructFromString):
69         (WebCore::SVGAnimatedIntegerAnimator::startAnimValAnimation):
70         (WebCore::SVGAnimatedIntegerAnimator::resetAnimValToBaseVal):
71         (WebCore::SVGAnimatedIntegerAnimator::addAnimatedTypes):
72         (WebCore::SVGAnimatedIntegerAnimator::calculateAnimatedValue):
73         Ditto.
74
75         * svg/SVGAnimatedIntegerOptionalInteger.cpp:
76         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::constructFromString):
77         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::startAnimValAnimation):
78         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::resetAnimValToBaseVal):
79         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::addAnimatedTypes):
80         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::calculateAnimatedValue):
81         Ditto.
82
83         * svg/SVGAnimatedLength.cpp:
84         (WebCore::SVGAnimatedLengthAnimator::constructFromString):
85         (WebCore::SVGAnimatedLengthAnimator::startAnimValAnimation):
86         (WebCore::SVGAnimatedLengthAnimator::resetAnimValToBaseVal):
87         (WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes):
88         (WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue):
89         Ditto.
90
91         * svg/SVGAnimatedLengthList.cpp:
92         (WebCore::SVGAnimatedLengthListAnimator::constructFromString):
93         (WebCore::SVGAnimatedLengthListAnimator::startAnimValAnimation):
94         (WebCore::SVGAnimatedLengthListAnimator::resetAnimValToBaseVal):
95         (WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes):
96         (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
97         Ditto.
98
99         * svg/SVGAnimatedNumber.cpp:
100         (WebCore::SVGAnimatedNumberAnimator::constructFromString):
101         (WebCore::SVGAnimatedNumberAnimator::startAnimValAnimation):
102         (WebCore::SVGAnimatedNumberAnimator::resetAnimValToBaseVal):
103         (WebCore::SVGAnimatedNumberAnimator::addAnimatedTypes):
104         (WebCore::SVGAnimatedNumberAnimator::calculateAnimatedValue):
105         Ditto.
106
107         * svg/SVGAnimatedNumberList.cpp:
108         (WebCore::SVGAnimatedNumberListAnimator::constructFromString):
109         (WebCore::SVGAnimatedNumberListAnimator::startAnimValAnimation):
110         (WebCore::SVGAnimatedNumberListAnimator::resetAnimValToBaseVal):
111         (WebCore::SVGAnimatedNumberListAnimator::addAnimatedTypes):
112         (WebCore::SVGAnimatedNumberListAnimator::calculateAnimatedValue):
113         Ditto.
114
115         * svg/SVGAnimatedNumberOptionalNumber.cpp:
116         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::constructFromString):
117         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::startAnimValAnimation):
118         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::resetAnimValToBaseVal):
119         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::addAnimatedTypes):
120         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::calculateAnimatedValue):
121         Ditto.
122
123         * svg/SVGAnimatedPath.cpp:
124         (WebCore::SVGAnimatedPathAnimator::constructFromString):
125         (WebCore::SVGAnimatedPathAnimator::startAnimValAnimation):
126         (WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal):
127         (WebCore::SVGAnimatedPathAnimator::addAnimatedTypes):
128         (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue):
129         Ditto.
130
131         * svg/SVGAnimatedPointList.cpp:
132         (WebCore::SVGAnimatedPointListAnimator::constructFromString):
133         (WebCore::SVGAnimatedPointListAnimator::startAnimValAnimation):
134         (WebCore::SVGAnimatedPointListAnimator::resetAnimValToBaseVal):
135         (WebCore::SVGAnimatedPointListAnimator::addAnimatedTypes):
136         (WebCore::SVGAnimatedPointListAnimator::calculateAnimatedValue):
137         Ditto.
138
139         * svg/SVGAnimatedPreserveAspectRatio.cpp:
140         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::constructFromString):
141         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::startAnimValAnimation):
142         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::resetAnimValToBaseVal):
143         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateAnimatedValue):
144         Ditto.
145
146         * svg/SVGAnimatedRect.cpp:
147         (WebCore::SVGAnimatedRectAnimator::constructFromString):
148         (WebCore::SVGAnimatedRectAnimator::startAnimValAnimation):
149         (WebCore::SVGAnimatedRectAnimator::resetAnimValToBaseVal):
150         (WebCore::SVGAnimatedRectAnimator::addAnimatedTypes):
151         (WebCore::SVGAnimatedRectAnimator::calculateAnimatedValue):
152         Ditto.
153
154         * svg/SVGAnimatedString.cpp:
155         (WebCore::SVGAnimatedStringAnimator::constructFromString):
156         (WebCore::SVGAnimatedStringAnimator::startAnimValAnimation):
157         (WebCore::SVGAnimatedStringAnimator::resetAnimValToBaseVal):
158         (WebCore::SVGAnimatedStringAnimator::calculateAnimatedValue):
159         Ditto.
160
161         * svg/SVGAnimatedTransformList.cpp:
162         (WebCore::SVGAnimatedTransformListAnimator::constructFromString):
163         (WebCore::SVGAnimatedTransformListAnimator::startAnimValAnimation):
164         (WebCore::SVGAnimatedTransformListAnimator::resetAnimValToBaseVal):
165         (WebCore::SVGAnimatedTransformListAnimator::addAnimatedTypes):
166         (WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
167         (WebCore::SVGAnimatedTransformListAnimator::calculateDistance):
168         Ditto.
169
170         * svg/SVGAnimatedType.cpp: Removed.
171         * svg/SVGAnimatedType.h:
172         (WebCore::SVGAnimatedType::create):
173         (WebCore::SVGAnimatedType::SVGAnimatedType):
174         (WebCore::SVGAnimatedType::~SVGAnimatedType):
175         (WebCore::SVGAnimatedType::as const):
176         (WebCore::SVGAnimatedType::as):
177         (WebCore::SVGAnimatedType::type const):
178         (WebCore::SVGAnimatedType::valueAsString const):
179         (WebCore::SVGAnimatedType::setValueAsString):
180         (WebCore::SVGAnimatedType::supportsAnimVal):
181         (WebCore::SVGAnimatedType::angleAndEnumeration const): Deleted.
182         (WebCore::SVGAnimatedType::boolean const): Deleted.
183         (WebCore::SVGAnimatedType::color const): Deleted.
184         (WebCore::SVGAnimatedType::enumeration const): Deleted.
185         (WebCore::SVGAnimatedType::integer const): Deleted.
186         (WebCore::SVGAnimatedType::integerOptionalInteger const): Deleted.
187         (WebCore::SVGAnimatedType::length const): Deleted.
188         (WebCore::SVGAnimatedType::lengthList const): Deleted.
189         (WebCore::SVGAnimatedType::number const): Deleted.
190         (WebCore::SVGAnimatedType::numberList const): Deleted.
191         (WebCore::SVGAnimatedType::numberOptionalNumber const): Deleted.
192         (WebCore::SVGAnimatedType::path const): Deleted.
193         (WebCore::SVGAnimatedType::pointList const): Deleted.
194         (WebCore::SVGAnimatedType::preserveAspectRatio const): Deleted.
195         (WebCore::SVGAnimatedType::rect const): Deleted.
196         (WebCore::SVGAnimatedType::string const): Deleted.
197         (WebCore::SVGAnimatedType::transformList const): Deleted.
198         (WebCore::SVGAnimatedType::angleAndEnumeration): Deleted.
199         (WebCore::SVGAnimatedType::boolean): Deleted.
200         (WebCore::SVGAnimatedType::color): Deleted.
201         (WebCore::SVGAnimatedType::enumeration): Deleted.
202         (WebCore::SVGAnimatedType::integer): Deleted.
203         (WebCore::SVGAnimatedType::integerOptionalInteger): Deleted.
204         (WebCore::SVGAnimatedType::length): Deleted.
205         (WebCore::SVGAnimatedType::lengthList): Deleted.
206         (WebCore::SVGAnimatedType::number): Deleted.
207         (WebCore::SVGAnimatedType::numberList): Deleted.
208         (WebCore::SVGAnimatedType::numberOptionalNumber): Deleted.
209         (WebCore::SVGAnimatedType::path): Deleted.
210         (WebCore::SVGAnimatedType::pointList): Deleted.
211         (WebCore::SVGAnimatedType::preserveAspectRatio): Deleted.
212         (WebCore::SVGAnimatedType::rect): Deleted.
213         (WebCore::SVGAnimatedType::string): Deleted.
214         (WebCore::SVGAnimatedType::transformList): Deleted.
215         Replace the union by a Variant. Replace all the type specific functions
216         by the template functions create() and as(). Use WTF::visit to get the
217         value stored in the variant. Use the SVGPropertyTraits to perform the
218         required operation.
219
220         * svg/SVGAnimatedTypeAnimator.h:
221         (WebCore::SVGAnimatedTypeAnimator::constructFromBaseValue):
222         (WebCore::SVGAnimatedTypeAnimator::resetFromBaseValue):
223         (WebCore::SVGAnimatedTypeAnimator::stopAnimValAnimationForType):
224         (WebCore::SVGAnimatedTypeAnimator::animValDidChangeForType):
225         (WebCore::SVGAnimatedTypeAnimator::animValWillChangeForType):
226         (WebCore::SVGAnimatedTypeAnimator::constructFromBaseValues):
227         (WebCore::SVGAnimatedTypeAnimator::resetFromBaseValues):
228         (WebCore::SVGAnimatedTypeAnimator::stopAnimValAnimationForTypes):
229         (WebCore::SVGAnimatedTypeAnimator::animValDidChangeForTypes):
230         (WebCore::SVGAnimatedTypeAnimator::animValWillChangeForTypes):
231         (WebCore::SVGAnimatedTypeAnimator::executeAction):
232         Rename the parameters and the local variables to match their types. Use
233         the SVGAnimatedType template functions create() and as().
234
235         * svg/SVGLengthValue.h:
236         (WebCore::SVGPropertyTraits<SVGLengthValue>::parse): This was moved from
237         SVGAnimatedType::setValueAsString()
238         (WebCore::SVGPropertyTraits<SVGLengthValue>::toString): This was moved from
239         SVGAnimatedType::valueAsString().
240
241         * svg/SVGMarkerTypes.h: Add placeholders for parse() and toString() so
242         SVGAnimatedType::valueAsString() and setValueAsString() can compile for 
243         all types.
244
245         * svg/SVGNumberListValues.h:
246         (WebCore::SVGPropertyTraits<SVGNumberListValues>::parse):
247         * svg/SVGPathByteStream.h:
248         (WebCore::SVGPropertyTraits<SVGPathByteStream>::parse):
249         (WebCore::SVGPropertyTraits<SVGPathByteStream>::toString):
250         * svg/SVGPointListValues.h:
251         (WebCore::SVGPropertyTraits<SVGPointListValues>::parse):
252         (WebCore::SVGPropertyTraits<SVGPointListValues>::toString):
253         * svg/SVGPreserveAspectRatioValue.h:
254         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::fromString):
255         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::parse):
256         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::toString):
257         Ditto.
258
259         * svg/SVGTransformListValues.h:
260         (WebCore::SVGPropertyTraits<SVGTransformListValues>::parse):
261         Ditto.
262
263         * svg/SVGValue.h: Added. SVGValueVariant is the replacement of the union
264         SVGAnimatedType::DataUnion.
265
266         * svg/properties/SVGPropertyInfo.h:
267         Add a minimum and maximum AnimatedPropertyType so, SVGAnimatedType::type()
268         can assert that the index of the variant is in the range of this enum.
269
270         * svg/properties/SVGPropertyTraits.h:
271         (WebCore::SVGPropertyTraits<bool>::parse):
272         (WebCore::SVGPropertyTraits<unsigned>::parse):
273         (WebCore::SVGPropertyTraits<int>::parse):
274         Ditto.
275
276 2018-03-08  Yusuke Suzuki  <utatane.tea@gmail.com>
277
278         [JSC][WebCore] Extend jsDynamicCast for WebCore types in WebCore and remove jsDynamicDowncast
279         https://bugs.webkit.org/show_bug.cgi?id=183449
280
281         Reviewed by Mark Lam.
282
283         This patch removes jsDynamicDowncast. Our JSC::jsDynamicCast can have a way to inject a fast
284         path that is similar to jsDynamicDowncast. WebCore can leverage this functionality to add
285         a fast path for WebCore's extended JS object types (JSEvent, JSElement, JSNode, and JSDocument).
286
287         No behavior change.
288
289         * WebCore.xcodeproj/project.pbxproj:
290         * bindings/js/CommonVM.cpp:
291         (WebCore::lexicalFrameFromCommonVM):
292         * bindings/js/JSDOMConvertBufferSource.h:
293         (WebCore::toPossiblySharedArrayBufferView):
294         * bindings/js/JSDOMConvertPromise.h:
295         (WebCore::Converter<IDLPromise<T>>::convert):
296         * bindings/js/JSDOMExceptionHandling.cpp:
297         (WebCore::reportException):
298         (WebCore::retrieveErrorMessage):
299         * bindings/js/JSDOMIterator.h:
300         (WebCore::IteratorTraits>::next):
301         * bindings/js/JSDOMWindowProxy.cpp:
302         (WebCore::JSDOMWindowProxy::toWrapped):
303         * bindings/js/JSDOMWrapperCache.h:
304         * bindings/js/JSDocumentCustom.h:
305         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSDocument>::inherits):
306         (WebCore::jsDocumentCast): Deleted.
307         * bindings/js/JSDynamicDowncast.h: Removed.
308         * bindings/js/JSElementCustom.h:
309         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSElement>::inherits):
310         (WebCore::jsElementCast): Deleted.
311         * bindings/js/JSEventCustom.h:
312         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSEvent>::inherits):
313         (WebCore::jsEventCast): Deleted.
314         * bindings/js/JSEventTargetCustom.cpp:
315         (WebCore::jsEventTargetCast):
316         * bindings/js/JSNodeCustom.h:
317         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSNode>::inherits):
318         (WebCore::jsNodeCast): Deleted.
319         * bindings/js/JSPluginElementFunctions.cpp:
320         (WebCore::pluginElementPropertyGetter):
321         * bindings/js/JSReadableStreamSourceCustom.cpp:
322         (WebCore::JSReadableStreamSource::start):
323         * bindings/js/JSWorkerGlobalScopeBase.cpp:
324         (WebCore::toJSDedicatedWorkerGlobalScope):
325         (WebCore::toJSWorkerGlobalScope):
326         (WebCore::toJSServiceWorkerGlobalScope):
327         * bindings/js/ReadableStream.cpp:
328         (WebCore::ReadableStream::create):
329         (WebCore::ReadableStream::isDisturbed):
330         * bindings/js/ReadableStream.h:
331         (WebCore::JSReadableStreamWrapperConverter::toWrapped):
332         * bindings/js/ScriptModuleLoader.cpp:
333         (WebCore::ScriptModuleLoader::evaluate):
334         * bindings/js/SerializedScriptValue.cpp:
335         (WebCore::CloneSerializer::dumpIfTerminal):
336         (WebCore::CloneSerializer::serialize):
337         * bindings/js/StructuredClone.cpp:
338         (WebCore::structuredCloneArrayBufferView):
339         * bindings/scripts/CodeGeneratorJS.pm:
340         (GetCastingHelperForThisObject):
341         (GenerateImplementation):
342         * bindings/scripts/test/JS/JSInterfaceName.cpp:
343         (WebCore::jsInterfaceNameConstructor):
344         (WebCore::setJSInterfaceNameConstructor):
345         (WebCore::JSInterfaceName::toWrapped):
346         * bindings/scripts/test/JS/JSMapLike.cpp:
347         (WebCore::IDLAttribute<JSMapLike>::cast):
348         (WebCore::IDLOperation<JSMapLike>::cast):
349         (WebCore::jsMapLikeConstructor):
350         (WebCore::setJSMapLikeConstructor):
351         (WebCore::JSMapLike::toWrapped):
352         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
353         (WebCore::IDLAttribute<JSReadOnlyMapLike>::cast):
354         (WebCore::IDLOperation<JSReadOnlyMapLike>::cast):
355         (WebCore::jsReadOnlyMapLikeConstructor):
356         (WebCore::setJSReadOnlyMapLikeConstructor):
357         (WebCore::JSReadOnlyMapLike::toWrapped):
358         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
359         (WebCore::IDLAttribute<JSTestActiveDOMObject>::cast):
360         (WebCore::IDLOperation<JSTestActiveDOMObject>::cast):
361         (WebCore::jsTestActiveDOMObjectConstructor):
362         (WebCore::setJSTestActiveDOMObjectConstructor):
363         (WebCore::JSTestActiveDOMObject::toWrapped):
364         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
365         (WebCore::IDLAttribute<JSTestCEReactions>::cast):
366         (WebCore::IDLOperation<JSTestCEReactions>::cast):
367         (WebCore::jsTestCEReactionsConstructor):
368         (WebCore::setJSTestCEReactionsConstructor):
369         (WebCore::JSTestCEReactions::toWrapped):
370         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
371         (WebCore::IDLAttribute<JSTestCEReactionsStringifier>::cast):
372         (WebCore::IDLOperation<JSTestCEReactionsStringifier>::cast):
373         (WebCore::jsTestCEReactionsStringifierConstructor):
374         (WebCore::setJSTestCEReactionsStringifierConstructor):
375         (WebCore::JSTestCEReactionsStringifier::toWrapped):
376         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
377         (WebCore::IDLAttribute<JSTestCallTracer>::cast):
378         (WebCore::IDLOperation<JSTestCallTracer>::cast):
379         (WebCore::jsTestCallTracerConstructor):
380         (WebCore::setJSTestCallTracerConstructor):
381         (WebCore::JSTestCallTracer::toWrapped):
382         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
383         (WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
384         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
385         (WebCore::JSTestClassWithJSBuiltinConstructor::toWrapped):
386         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
387         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
388         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
389         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
390         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
391         (WebCore::IDLAttribute<JSTestDOMJIT>::cast):
392         (WebCore::IDLOperation<JSTestDOMJIT>::cast):
393         (WebCore::jsTestDOMJITConstructor):
394         (WebCore::setJSTestDOMJITConstructor):
395         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
396         (WebCore::IDLAttribute<JSTestEnabledBySetting>::cast):
397         (WebCore::IDLOperation<JSTestEnabledBySetting>::cast):
398         (WebCore::jsTestEnabledBySettingConstructor):
399         (WebCore::setJSTestEnabledBySettingConstructor):
400         (WebCore::JSTestEnabledBySetting::toWrapped):
401         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
402         (WebCore::IDLAttribute<JSTestEventConstructor>::cast):
403         (WebCore::jsTestEventConstructorConstructor):
404         (WebCore::setJSTestEventConstructorConstructor):
405         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
406         (WebCore::IDLOperation<JSTestEventTarget>::cast):
407         (WebCore::jsTestEventTargetConstructor):
408         (WebCore::setJSTestEventTargetConstructor):
409         (WebCore::JSTestEventTarget::toWrapped):
410         * bindings/scripts/test/JS/JSTestException.cpp:
411         (WebCore::IDLAttribute<JSTestException>::cast):
412         (WebCore::jsTestExceptionConstructor):
413         (WebCore::setJSTestExceptionConstructor):
414         (WebCore::JSTestException::toWrapped):
415         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
416         (WebCore::IDLAttribute<JSTestGenerateIsReachable>::cast):
417         (WebCore::jsTestGenerateIsReachableConstructor):
418         (WebCore::setJSTestGenerateIsReachableConstructor):
419         (WebCore::JSTestGenerateIsReachable::toWrapped):
420         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
421         (WebCore::IDLAttribute<JSTestGlobalObject>::cast):
422         (WebCore::IDLOperation<JSTestGlobalObject>::cast):
423         (WebCore::jsTestGlobalObjectConstructor):
424         (WebCore::setJSTestGlobalObjectConstructor):
425         (WebCore::JSTestGlobalObject::toWrapped):
426         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
427         (WebCore::jsTestIndexedSetterNoIdentifierConstructor):
428         (WebCore::setJSTestIndexedSetterNoIdentifierConstructor):
429         (WebCore::JSTestIndexedSetterNoIdentifier::toWrapped):
430         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
431         (WebCore::jsTestIndexedSetterThrowingExceptionConstructor):
432         (WebCore::setJSTestIndexedSetterThrowingExceptionConstructor):
433         (WebCore::JSTestIndexedSetterThrowingException::toWrapped):
434         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
435         (WebCore::IDLOperation<JSTestIndexedSetterWithIdentifier>::cast):
436         (WebCore::jsTestIndexedSetterWithIdentifierConstructor):
437         (WebCore::setJSTestIndexedSetterWithIdentifierConstructor):
438         (WebCore::JSTestIndexedSetterWithIdentifier::toWrapped):
439         * bindings/scripts/test/JS/JSTestInterface.cpp:
440         (WebCore::IDLAttribute<JSTestInterface>::cast):
441         (WebCore::IDLOperation<JSTestInterface>::cast):
442         (WebCore::jsTestInterfaceConstructor):
443         (WebCore::setJSTestInterfaceConstructor):
444         (WebCore::JSTestInterface::toWrapped):
445         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
446         (WebCore::IDLAttribute<JSTestInterfaceLeadingUnderscore>::cast):
447         (WebCore::jsTestInterfaceLeadingUnderscoreConstructor):
448         (WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
449         (WebCore::JSTestInterfaceLeadingUnderscore::toWrapped):
450         * bindings/scripts/test/JS/JSTestIterable.cpp:
451         (WebCore::IDLOperation<JSTestIterable>::cast):
452         (WebCore::jsTestIterableConstructor):
453         (WebCore::setJSTestIterableConstructor):
454         (WebCore::JSTestIterable::toWrapped):
455         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
456         (WebCore::IDLAttribute<JSTestJSBuiltinConstructor>::cast):
457         (WebCore::IDLOperation<JSTestJSBuiltinConstructor>::cast):
458         (WebCore::jsTestJSBuiltinConstructorConstructor):
459         (WebCore::setJSTestJSBuiltinConstructorConstructor):
460         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
461         (WebCore::IDLOperation<JSTestMediaQueryListListener>::cast):
462         (WebCore::jsTestMediaQueryListListenerConstructor):
463         (WebCore::setJSTestMediaQueryListListenerConstructor):
464         (WebCore::JSTestMediaQueryListListener::toWrapped):
465         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
466         (WebCore::jsTestNamedAndIndexedSetterNoIdentifierConstructor):
467         (WebCore::setJSTestNamedAndIndexedSetterNoIdentifierConstructor):
468         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::toWrapped):
469         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
470         (WebCore::jsTestNamedAndIndexedSetterThrowingExceptionConstructor):
471         (WebCore::setJSTestNamedAndIndexedSetterThrowingExceptionConstructor):
472         (WebCore::JSTestNamedAndIndexedSetterThrowingException::toWrapped):
473         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
474         (WebCore::IDLOperation<JSTestNamedAndIndexedSetterWithIdentifier>::cast):
475         (WebCore::jsTestNamedAndIndexedSetterWithIdentifierConstructor):
476         (WebCore::setJSTestNamedAndIndexedSetterWithIdentifierConstructor):
477         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::toWrapped):
478         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
479         (WebCore::jsTestNamedConstructorConstructor):
480         (WebCore::setJSTestNamedConstructorConstructor):
481         (WebCore::JSTestNamedConstructor::toWrapped):
482         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
483         (WebCore::jsTestNamedDeleterNoIdentifierConstructor):
484         (WebCore::setJSTestNamedDeleterNoIdentifierConstructor):
485         (WebCore::JSTestNamedDeleterNoIdentifier::toWrapped):
486         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
487         (WebCore::jsTestNamedDeleterThrowingExceptionConstructor):
488         (WebCore::setJSTestNamedDeleterThrowingExceptionConstructor):
489         (WebCore::JSTestNamedDeleterThrowingException::toWrapped):
490         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
491         (WebCore::IDLOperation<JSTestNamedDeleterWithIdentifier>::cast):
492         (WebCore::jsTestNamedDeleterWithIdentifierConstructor):
493         (WebCore::setJSTestNamedDeleterWithIdentifierConstructor):
494         (WebCore::JSTestNamedDeleterWithIdentifier::toWrapped):
495         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
496         (WebCore::jsTestNamedDeleterWithIndexedGetterConstructor):
497         (WebCore::setJSTestNamedDeleterWithIndexedGetterConstructor):
498         (WebCore::JSTestNamedDeleterWithIndexedGetter::toWrapped):
499         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
500         (WebCore::jsTestNamedGetterCallWithConstructor):
501         (WebCore::setJSTestNamedGetterCallWithConstructor):
502         (WebCore::JSTestNamedGetterCallWith::toWrapped):
503         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
504         (WebCore::jsTestNamedGetterNoIdentifierConstructor):
505         (WebCore::setJSTestNamedGetterNoIdentifierConstructor):
506         (WebCore::JSTestNamedGetterNoIdentifier::toWrapped):
507         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
508         (WebCore::IDLOperation<JSTestNamedGetterWithIdentifier>::cast):
509         (WebCore::jsTestNamedGetterWithIdentifierConstructor):
510         (WebCore::setJSTestNamedGetterWithIdentifierConstructor):
511         (WebCore::JSTestNamedGetterWithIdentifier::toWrapped):
512         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
513         (WebCore::jsTestNamedSetterNoIdentifierConstructor):
514         (WebCore::setJSTestNamedSetterNoIdentifierConstructor):
515         (WebCore::JSTestNamedSetterNoIdentifier::toWrapped):
516         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
517         (WebCore::jsTestNamedSetterThrowingExceptionConstructor):
518         (WebCore::setJSTestNamedSetterThrowingExceptionConstructor):
519         (WebCore::JSTestNamedSetterThrowingException::toWrapped):
520         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
521         (WebCore::IDLOperation<JSTestNamedSetterWithIdentifier>::cast):
522         (WebCore::jsTestNamedSetterWithIdentifierConstructor):
523         (WebCore::setJSTestNamedSetterWithIdentifierConstructor):
524         (WebCore::JSTestNamedSetterWithIdentifier::toWrapped):
525         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
526         (WebCore::IDLOperation<JSTestNamedSetterWithIndexedGetter>::cast):
527         (WebCore::jsTestNamedSetterWithIndexedGetterConstructor):
528         (WebCore::setJSTestNamedSetterWithIndexedGetterConstructor):
529         (WebCore::JSTestNamedSetterWithIndexedGetter::toWrapped):
530         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
531         (WebCore::IDLOperation<JSTestNamedSetterWithIndexedGetterAndSetter>::cast):
532         (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterConstructor):
533         (WebCore::setJSTestNamedSetterWithIndexedGetterAndSetterConstructor):
534         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::toWrapped):
535         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
536         (WebCore::jsTestNamedSetterWithOverrideBuiltinsConstructor):
537         (WebCore::setJSTestNamedSetterWithOverrideBuiltinsConstructor):
538         (WebCore::JSTestNamedSetterWithOverrideBuiltins::toWrapped):
539         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
540         (WebCore::IDLAttribute<JSTestNamedSetterWithUnforgableProperties>::cast):
541         (WebCore::IDLOperation<JSTestNamedSetterWithUnforgableProperties>::cast):
542         (WebCore::jsTestNamedSetterWithUnforgablePropertiesConstructor):
543         (WebCore::setJSTestNamedSetterWithUnforgablePropertiesConstructor):
544         (WebCore::JSTestNamedSetterWithUnforgableProperties::toWrapped):
545         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
546         (WebCore::IDLAttribute<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>::cast):
547         (WebCore::IDLOperation<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>::cast):
548         (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor):
549         (WebCore::setJSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor):
550         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::toWrapped):
551         * bindings/scripts/test/JS/JSTestNode.cpp:
552         (WebCore::IDLAttribute<JSTestNode>::cast):
553         (WebCore::IDLOperation<JSTestNode>::cast):
554         (WebCore::jsTestNodeConstructor):
555         (WebCore::setJSTestNodeConstructor):
556         * bindings/scripts/test/JS/JSTestObj.cpp:
557         (WebCore::IDLAttribute<JSTestObj>::cast):
558         (WebCore::IDLOperation<JSTestObj>::cast):
559         (WebCore::jsTestObjConstructor):
560         (WebCore::setJSTestObjConstructor):
561         (WebCore::JSTestObj::toWrapped):
562         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
563         (WebCore::jsTestOverloadedConstructorsConstructor):
564         (WebCore::setJSTestOverloadedConstructorsConstructor):
565         (WebCore::JSTestOverloadedConstructors::toWrapped):
566         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
567         (WebCore::jsTestOverloadedConstructorsWithSequenceConstructor):
568         (WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor):
569         (WebCore::JSTestOverloadedConstructorsWithSequence::toWrapped):
570         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
571         (WebCore::IDLOperation<JSTestOverrideBuiltins>::cast):
572         (WebCore::jsTestOverrideBuiltinsConstructor):
573         (WebCore::setJSTestOverrideBuiltinsConstructor):
574         (WebCore::JSTestOverrideBuiltins::toWrapped):
575         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
576         (WebCore::jsTestPluginInterfaceConstructor):
577         (WebCore::setJSTestPluginInterfaceConstructor):
578         (WebCore::JSTestPluginInterface::toWrapped):
579         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
580         (WebCore::IDLAttribute<JSTestPromiseRejectionEvent>::cast):
581         (WebCore::jsTestPromiseRejectionEventConstructor):
582         (WebCore::setJSTestPromiseRejectionEventConstructor):
583         * bindings/scripts/test/JS/JSTestSerialization.cpp:
584         (WebCore::IDLAttribute<JSTestSerialization>::cast):
585         (WebCore::IDLOperation<JSTestSerialization>::cast):
586         (WebCore::jsTestSerializationConstructor):
587         (WebCore::setJSTestSerializationConstructor):
588         (WebCore::JSTestSerialization::toWrapped):
589         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
590         (WebCore::jsTestSerializationIndirectInheritanceConstructor):
591         (WebCore::setJSTestSerializationIndirectInheritanceConstructor):
592         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
593         (WebCore::IDLAttribute<JSTestSerializationInherit>::cast):
594         (WebCore::IDLOperation<JSTestSerializationInherit>::cast):
595         (WebCore::jsTestSerializationInheritConstructor):
596         (WebCore::setJSTestSerializationInheritConstructor):
597         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
598         (WebCore::IDLAttribute<JSTestSerializationInheritFinal>::cast):
599         (WebCore::IDLOperation<JSTestSerializationInheritFinal>::cast):
600         (WebCore::jsTestSerializationInheritFinalConstructor):
601         (WebCore::setJSTestSerializationInheritFinalConstructor):
602         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
603         (WebCore::IDLAttribute<JSTestSerializedScriptValueInterface>::cast):
604         (WebCore::IDLOperation<JSTestSerializedScriptValueInterface>::cast):
605         (WebCore::jsTestSerializedScriptValueInterfaceConstructor):
606         (WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
607         (WebCore::JSTestSerializedScriptValueInterface::toWrapped):
608         * bindings/scripts/test/JS/JSTestStringifier.cpp:
609         (WebCore::IDLOperation<JSTestStringifier>::cast):
610         (WebCore::jsTestStringifierConstructor):
611         (WebCore::setJSTestStringifierConstructor):
612         (WebCore::JSTestStringifier::toWrapped):
613         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
614         (WebCore::IDLOperation<JSTestStringifierAnonymousOperation>::cast):
615         (WebCore::jsTestStringifierAnonymousOperationConstructor):
616         (WebCore::setJSTestStringifierAnonymousOperationConstructor):
617         (WebCore::JSTestStringifierAnonymousOperation::toWrapped):
618         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
619         (WebCore::IDLOperation<JSTestStringifierNamedOperation>::cast):
620         (WebCore::jsTestStringifierNamedOperationConstructor):
621         (WebCore::setJSTestStringifierNamedOperationConstructor):
622         (WebCore::JSTestStringifierNamedOperation::toWrapped):
623         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
624         (WebCore::IDLOperation<JSTestStringifierOperationImplementedAs>::cast):
625         (WebCore::jsTestStringifierOperationImplementedAsConstructor):
626         (WebCore::setJSTestStringifierOperationImplementedAsConstructor):
627         (WebCore::JSTestStringifierOperationImplementedAs::toWrapped):
628         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
629         (WebCore::IDLOperation<JSTestStringifierOperationNamedToString>::cast):
630         (WebCore::jsTestStringifierOperationNamedToStringConstructor):
631         (WebCore::setJSTestStringifierOperationNamedToStringConstructor):
632         (WebCore::JSTestStringifierOperationNamedToString::toWrapped):
633         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
634         (WebCore::IDLAttribute<JSTestStringifierReadOnlyAttribute>::cast):
635         (WebCore::IDLOperation<JSTestStringifierReadOnlyAttribute>::cast):
636         (WebCore::jsTestStringifierReadOnlyAttributeConstructor):
637         (WebCore::setJSTestStringifierReadOnlyAttributeConstructor):
638         (WebCore::JSTestStringifierReadOnlyAttribute::toWrapped):
639         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
640         (WebCore::IDLAttribute<JSTestStringifierReadWriteAttribute>::cast):
641         (WebCore::IDLOperation<JSTestStringifierReadWriteAttribute>::cast):
642         (WebCore::jsTestStringifierReadWriteAttributeConstructor):
643         (WebCore::setJSTestStringifierReadWriteAttributeConstructor):
644         (WebCore::JSTestStringifierReadWriteAttribute::toWrapped):
645         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
646         (WebCore::IDLAttribute<JSTestTypedefs>::cast):
647         (WebCore::IDLOperation<JSTestTypedefs>::cast):
648         (WebCore::jsTestTypedefsConstructor):
649         (WebCore::setJSTestTypedefsConstructor):
650         (WebCore::JSTestTypedefs::toWrapped):
651         * bridge/objc/WebScriptObject.mm:
652         (-[WebScriptObject setValue:forKey:]):
653         * bridge/runtime_array.cpp:
654         (JSC::RuntimeArray::lengthGetter):
655         * bridge/runtime_method.cpp:
656         (JSC::RuntimeMethod::lengthGetter):
657         * html/HTMLMediaElement.cpp:
658         (WebCore::controllerJSValue):
659         (WebCore::HTMLMediaElement::updateCaptionContainer):
660         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
661         * inspector/agents/InspectorDOMAgent.cpp:
662         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
663
664 2018-03-08  Yusuke Suzuki  <utatane.tea@gmail.com>
665
666         [JSC] Add inherits<T>(VM&) leveraging JSCast fast path
667         https://bugs.webkit.org/show_bug.cgi?id=183429
668
669         Reviewed by Mark Lam.
670
671         * bindings/js/IDBBindingUtilities.cpp:
672         (WebCore::createIDBKeyFromValue):
673         * bindings/js/JSDOMConvertDate.cpp:
674         (WebCore::valueToDate):
675         * bindings/js/JSDOMGlobalObject.cpp:
676         (WebCore::JSDOMGlobalObject::scriptExecutionContext const):
677         * bindings/js/JSDOMWindowCustom.cpp:
678         (WebCore::JSDOMWindow::toWrapped):
679         * bindings/js/JSEventTargetCustom.cpp:
680         * bindings/js/JSNodeCustom.cpp:
681         (WebCore::JSNode::pushEventHandlerScope const):
682         * bindings/js/JSXPathNSResolverCustom.cpp:
683         (WebCore::JSXPathNSResolver::toWrapped):
684         * bindings/js/ScriptState.cpp:
685         (WebCore::domWindowFromExecState):
686         (WebCore::scriptExecutionContextFromExecState):
687         * bindings/js/SerializedScriptValue.cpp:
688         (WebCore::CloneSerializer::isArray):
689         (WebCore::CloneSerializer::isMap):
690         (WebCore::CloneSerializer::isSet):
691         (WebCore::CloneSerializer::dumpArrayBufferView):
692         (WebCore::CloneSerializer::dumpDOMPoint):
693         (WebCore::CloneSerializer::dumpDOMRect):
694         (WebCore::CloneSerializer::dumpDOMMatrix):
695         (WebCore::CloneSerializer::dumpIfTerminal):
696         (WebCore::CloneDeserializer::CloneDeserializer):
697         (WebCore::CloneDeserializer::readArrayBufferView):
698         * bindings/scripts/CodeGeneratorJS.pm:
699         (GenerateOverloadDispatcher):
700         * bindings/scripts/test/JS/JSTestObj.cpp:
701         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher):
702         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameterOverloadDispatcher):
703         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithDistinguishingUnionOverloadDispatcher):
704         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWith2DistinguishingUnionsOverloadDispatcher):
705         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithNonDistinguishingUnionOverloadDispatcher):
706         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnionOverloadDispatcher):
707         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameterOverloadDispatcher):
708         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunctionOverloadDispatcher):
709         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
710         (WebCore::JSTestOverloadedConstructorsConstructor::construct):
711         * bridge/c/c_instance.cpp:
712         (JSC::Bindings::CInstance::invokeMethod):
713         * bridge/objc/WebScriptObject.mm:
714         (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
715         * bridge/objc/objc_instance.mm:
716         (ObjcInstance::invokeMethod):
717         * bridge/objc/objc_runtime.mm:
718         (JSC::Bindings::callObjCFallbackObject):
719         * bridge/runtime_method.cpp:
720         (JSC::callRuntimeMethod):
721         * bridge/runtime_object.cpp:
722         (JSC::Bindings::callRuntimeObject):
723         (JSC::Bindings::callRuntimeConstructor):
724         * inspector/WebInjectedScriptHost.cpp:
725         (WebCore::WebInjectedScriptHost::subtype):
726         (WebCore::WebInjectedScriptHost::isHTMLAllCollection):
727
728 2018-03-08  Tim Horton  <timothy_horton@apple.com>
729
730         Stop linking ApplicationServices directly
731         https://bugs.webkit.org/show_bug.cgi?id=182867
732         <rdar://problem/38252142>
733
734         Reviewed by Alex Christensen.
735
736         The frameworks that we use that live inside ApplicationServices
737         have mostly moved out, so import them directly.
738
739         * Configurations/WebCore.xcconfig:
740         * html/canvas/CanvasRenderingContext2D.cpp:
741         * html/canvas/CanvasRenderingContext2DBase.cpp:
742         * platform/MIMETypeRegistry.cpp:
743         * platform/graphics/ComplexTextController.cpp:
744         * platform/graphics/cg/ColorCG.cpp:
745         * platform/graphics/cg/ImageDecoderCG.cpp:
746         * platform/graphics/cg/UTIRegistry.cpp:
747         * platform/graphics/cocoa/FontCocoa.mm:
748         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
749         * platform/graphics/mac/GlyphPageMac.cpp:
750         * platform/graphics/mac/PDFDocumentImageMac.mm:
751         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
752         * platform/graphics/win/FontCGWin.cpp:
753         * platform/graphics/win/FontCacheWin.cpp:
754         * platform/graphics/win/FontCustomPlatformData.cpp:
755         * platform/graphics/win/FontPlatformDataCGWin.cpp:
756         * platform/graphics/win/ImageCGWin.cpp:
757         * platform/graphics/win/SimpleFontDataCGWin.cpp:
758
759 2018-03-07  Tim Horton  <timothy_horton@apple.com>
760
761         Sort and separate FeatureDefines.xcconfig
762         https://bugs.webkit.org/show_bug.cgi?id=183427
763
764         Reviewed by Dan Bernstein.
765
766         * Configurations/FeatureDefines.xcconfig:
767         Sort and split FeatureDefines into paragraphs
768         (to make it easier to sort later).
769
770 2018-03-07  Zalan Bujtas  <zalan@apple.com>
771
772         Invalid innerTextRenderer in RenderTextControlSingleLine::styleDidChange()
773         https://bugs.webkit.org/show_bug.cgi?id=183385
774         <rdar://problem/38085397>
775
776         Reviewed by Antti Koivisto.
777
778         When HTMLInputElement::updateType() is called with a dirty value, we eagerly change the m_inputType first
779         and then we take care of the dirty value by calling setAttributeWithoutSynchronization().
780         With a DOMSubtreeModified event listener attached, setAttributeWithoutSynchronization() can end up running some
781         layout code (offsetHeight) with a renderer - m_inputType mismatch.
782
783         This patch ensures that we don't change the m_inputType until after we finished setting the new value.
784
785         Test: fast/DOM/HTMLInputElement/input-value-and-type-change-crash.html
786
787         * html/HTMLInputElement.cpp:
788         (WebCore::HTMLInputElement::updateType):
789
790 2018-03-07  Chris Dumez  <cdumez@apple.com>
791
792         Get rid of custom bindings for History's replaceState() / pushState()
793         https://bugs.webkit.org/show_bug.cgi?id=183372
794
795         Reviewed by Youenn Fablet.
796
797         Get rid of custom bindings for History's replaceState() / pushState() by
798         moving the cached state from the wrapper to the History implementation
799         object.
800
801         No new tests, no web-facing behavior change.
802
803         * bindings/js/JSHistoryCustom.cpp:
804         (WebCore::JSHistory::state const):
805         (WebCore::JSHistory::visitAdditionalChildren):
806         * page/History.cpp:
807         (WebCore::History::cachedState):
808         (WebCore::History::stateObjectAdded):
809         * page/History.h:
810         (WebCore::History::pushState):
811         (WebCore::History::replaceState):
812         * page/History.idl:
813
814 2018-03-07  Youenn Fablet  <youenn@apple.com>
815
816         Match unsupported plugins based on domains and not origin
817         https://bugs.webkit.org/show_bug.cgi?id=183384
818
819         Reviewed by Chris Dumez.
820
821         Move from an origin-keyed map to a vector of plugins.
822         We iterate through the vector and a match happens if the page host name ends with the provided matching domain.
823         This allows supporting rules for *.mydomain.com by passing 'mydomain.com'.
824         Covered by existing tests.
825         We are not testing subdomains like www.localhost since there is no support in our CI but this is tested through Unit tests.
826
827         * loader/EmptyClients.cpp:
828         * platform/URL.cpp:
829         (WebCore::URL::isMatchingDomain const):
830         * platform/URL.h:
831         * plugins/PluginData.h:
832         (WebCore::isSupportedPlugin):
833         (WebCore::SupportedPluginName::decode):
834         (WebCore::SupportedPluginName::encode const):
835         * plugins/PluginInfoProvider.h:
836
837 2017-12-18  Youenn Fablet  <youenn@apple.com>
838
839         Update to libwebrtc revision 4e70a72571dd26b85c2385e9c618e343428df5d3
840         https://bugs.webkit.org/show_bug.cgi?id=180843
841
842         Reviewed by Eric Carlson.
843
844         Covered by existing tests.
845
846         Moving H264 codecs and factories to libwebrtc.
847         Updating LibWebRTCProvider according new libwebrtc API.
848         Updating ref counting according new libwebrtc API.
849
850         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
851         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
852         (WebCore::LibWebRTCMediaEndpoint::AddRef const):
853         (WebCore::LibWebRTCMediaEndpoint::Release const):
854         (WTF::LogArgument<webrtc::RTCStats>::toString):
855         * WebCore.xcodeproj/project.pbxproj:
856         * platform/mediastream/RealtimeOutgoingAudioSource.h:
857         * platform/mediastream/RealtimeOutgoingVideoSource.h:
858         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
859         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
860         (WebCore::LibWebRTCProvider::createPeerConnectionFactory):
861         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
862         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
863         (WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
864         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
865         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
866         (WebCore::LibWebRTCProviderCocoa::setActive):
867         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
868         * platform/mediastream/libwebrtc/VideoToolBoxDecoderFactory.cpp: Removed.
869         * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.cpp: Removed.
870         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
871         (WebCore::ConvertToI420):
872         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
873         * testing/Internals.cpp:
874         (WebCore::Internals::setH264HardwareEncoderAllowed):
875         * testing/MockLibWebRTCPeerConnection.h:
876
877 2018-03-07  Sihui Liu  <sihui_liu@apple.com>
878
879         replaceState cause back/forward malfunction on html page with <base href="/"> tag
880         https://bugs.webkit.org/show_bug.cgi?id=182678
881         <rdar://problem/37517821>
882
883         Reviewed by Chris Dumez.
884
885         replaceState should not change URL when the URL argument is NULL, but should change URL when the URL argument is an empty string.
886
887         Test: http/tests/history/replacestate-no-url.html
888
889         * page/History.cpp:
890         (WebCore::History::urlForState):
891
892 2018-03-07  Antti Koivisto  <antti@apple.com>
893
894         Don't invalidate descendants for sibling combinators unless needed
895         https://bugs.webkit.org/show_bug.cgi?id=183410
896         <rdar://problem/38227297>
897
898         Reviewed by Zalan Bujtas.
899
900         If we know the matched sibling combinator doesn't affect descendants we shouldn't invalidate them.
901
902         * css/SelectorChecker.cpp:
903         (WebCore::SelectorChecker::matchRecursively const):
904
905             Use different bit for the descendant case.
906
907         * cssjit/SelectorCompiler.cpp:
908         (WebCore::SelectorCompiler::fragmentMatchesTheRightmostElement):
909
910             Remove unneeded context assert.
911
912         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
913
914             Use different bit for the descendant case.
915
916         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorCheckerExcludingPseudoElements):
917         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasPseudoElement):
918         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateRequestedPseudoElementEqualsToSelectorPseudoElement):
919         * dom/Element.cpp:
920         (WebCore::invalidateForSiblingCombinators):
921
922             Invalidate the target sibling or all descendants based on the bits.
923
924         * dom/Element.h:
925         (WebCore::Element::descendantsAffectedByPreviousSibling const):
926         (WebCore::Element::setDescendantsAffectedByPreviousSibling const):
927         * dom/Node.h:
928         * style/StyleRelations.cpp:
929         (WebCore::Style::commitRelationsToRenderStyle):
930         (WebCore::Style::commitRelations):
931         * style/StyleRelations.h:
932
933             Add DescendantsAffectedByPreviousSibling bit. AffectedByPreviousSibling is now just about the target element.
934
935 2018-03-07  Antti Koivisto  <antti@apple.com>
936
937         checkForSiblingStyleChanges should use internal versions of the invalidation functions
938         https://bugs.webkit.org/show_bug.cgi?id=183405
939         <rdar://problem/38218310>
940
941         Reviewed by Zalan Bujtas.
942
943         Non-internal invalidateStyleForElement/Subtree() implement sibling combinator invalidation. Checking this
944         is only needed if the element in question changed somehow. In checkForSiblingStyleChanges we know that
945         another element changed and we really just want to invalidate.
946
947         * css/SelectorChecker.cpp:
948         (WebCore::isFirstOfType):
949         (WebCore::SelectorChecker::checkOne const):
950
951         Also make :first-of-type use ChildrenAffectedByForwardPositionalRules for invalidation similar to :last-of-type
952         for more correct invalidation.
953
954         * dom/Element.cpp:
955         (WebCore::checkForSiblingStyleChanges):
956
957 2018-03-07  Yusuke Suzuki  <utatane.tea@gmail.com>
958
959         HTML `pattern` attribute should set `u` flag for regular expressions
960         https://bugs.webkit.org/show_bug.cgi?id=151598
961
962         Reviewed by Chris Dumez.
963
964         This patch attaches "u" flag to the RegExp compiled for HTML "pattern" attribute[1].
965
966         [1]: https://html.spec.whatwg.org/multipage/forms.html#the-pattern-attribute
967
968         * html/BaseTextInputType.cpp:
969         (WebCore::BaseTextInputType::patternMismatch const):
970
971 2018-03-07  Frederic Wang  <fwang@igalia.com>
972
973         Relayout frames after AsyncFrameScrolling or FrameFlattening option is changed
974         https://bugs.webkit.org/show_bug.cgi?id=183081
975
976         Reviewed by Antonio Gomes.
977
978         The frames may be resized when the FrameFlattening option is modified and hence this patch
979         forces a relayout. It also does that when AsyncFrameScrolling is modified too, since that
980         may imply changes in frame flattening after bug 173704. Forcing a relayout will also be
981         enough to trigger other updates for async frame scrolling in the future (see bug 149264 and
982         bug 171667).
983
984         Test: platform/ios/fast/frames/flattening/iframe-flattening-async-frame-scrolling-dynamic.html
985
986         * page/Settings.yaml: Call setNeedsRelayoutAllFrames when one of the AsyncFrameScrolling or
987         FrameFlattening options is changed.
988         * page/SettingsBase.cpp: Include RenderWidget to make call on frame->ownerRenderer().
989         (WebCore::SettingsBase::setNeedsRelayoutAllFrames):  Make layout and preferred widths dirty
990         on all frames in the page and schedule a relayout.
991         * page/SettingsBase.h: Declare setNeedsRelayoutAllFrames().
992
993 2018-03-07  Alejandro G. Castro  <alex@igalia.com>
994
995         Make NetworkRTCResolver port agnostic
996         https://bugs.webkit.org/show_bug.cgi?id=178855
997
998         Reviewed by Youenn Fablet.
999
1000         Add new API in the DNSResolveQueue allowing to revolve hostnames and get the result. Add platform
1001         specific code for soup platform and refactor the other platforms. Added new API to the DNS API header
1002         and move the general code to the DNS.cpp file, that way we can reuse that code in all the platforms
1003         and leave the ResolveQueue class of the platforms in a file.
1004
1005         No new tests because this is a refactor.
1006
1007         * PlatformAppleWin.cmake: Move the DNSCFNet class to DNSResolveQueueCFNet.
1008         * PlatformMac.cmake: Ditto.
1009         * Sources.txt: Add the DNS.cpp for compilation.
1010         * SourcesCocoa.txt: Move the DNSCFNet class to DNSResolveQueueCFNet.
1011         * WebCore.xcodeproj/project.pbxproj: Move the DNSCFNet class to DNSResolveQueueCFNet, add the DNS.cpp
1012         for compilation. Add the new DNSResolveQueueCFNet class.
1013         * platform/Curl.cmake: Move the DNSCFNet class to DNSResolveQueueCurl.
1014         * platform/network/DNS.cpp: Add this file with the default implementation of the DNS functions for
1015         all the platforms.
1016         (WebCore::prefetchDNS): Copied from every platform implementation.
1017         (WebCore::resolveDNS): Add the function, resolves a hostname, receives the identifier of the operation
1018         and the completion handler.
1019         (WebCore::stopResolveDNS): Add the function, stops a resolution operation, receives the identifier
1020         of the operation.
1021         * platform/network/DNS.h: Add the new APIs resolveDNS and stopResolveDNS with the classes used for the
1022         implementation.
1023         (WebCore::IPAddress::IPAddress): Add this class used to send the resolved address information, it does
1024         not depend on libwebrtc rtc classes.
1025         (WebCore::IPAddress::get): Get a reference to the struct sockaddr_in in the IPAddress class.
1026         (WebCore::DNSCompletionHandler): Add this CompletionHandler type to be used when resolving the DNS
1027         address.
1028         * platform/network/DNSResolveQueue.cpp: Add the DNSResolveQueue platform instantiation in the singleton.
1029         (WebCore::DNSResolveQueue::singleton): Use DNSResolveQueue platform classes when creating the singleton..
1030         (WebCore::DNSResolveQueue::resolve): Add this method to get the address of a hostname, it sends the
1031         identifier and the completion handler to use when returning the result.
1032         (WebCore::DNSResolveQueue::stopResolve): Add this method to stop the resolve operation when required.
1033         * platform/network/DNSResolveQueue.h: Add the new methods and make the class abstract, so that every
1034         platform can implement the functions.
1035         * platform/network/cf/DNSResolveQueueCFNet.cpp: Renamed from Source/WebCore/platform/network/cf/DNSCFNet.cpp.
1036         Add the methods to the new class DNSResolveQueueCFNet, move the prefetchDNS to the DNS.cpp general
1037         implementation.
1038         * platform/network/cf/DNSResolveQueueCFNet.h: Add the new class inheriting from the DNSResolveQueue. Add the
1039         new methods, we have to implement these methods and move the NetworkRTCResolver for COCOA code here.
1040         (WebCore::DNSResolveQueueCF::resolve): Dummy method, not implemented.
1041         (WebCore::DNSResolveQueueCF::stopResolve): Ditto.
1042         * platform/network/curl/DNSResolveQueueCurl.cpp: Renamed from Source/WebCore/platform/network/curl/DNSCurl.cpp.
1043         * platform/network/curl/DNSResolveQueueCurl.h: Add the new class inheriting from the DNSResolveQueue.
1044         (WebCore::DNSResolveQueueCurl::resolve): Ditto.
1045         (WebCore::DNSResolveQueueCurl::stopResolve): Ditto.
1046         * platform/network/soup/DNSResolveQueueSoup.h: New class inheriting from the DNSResolveQueue class, adding
1047         a HasMap with the active operations, it allows stopping them.
1048         * platform/network/soup/DNSResolveQueueSoup.cpp: Renamed from Source/WebCore/platform/network/curl/DNSSoup.cpp.
1049         (WebCore::resolvedWithObserverCallback): Called when the result address from the soup platform is ready,
1050         sends the address to the completion handler.
1051         (WebCore::DNSResolveQueueSoup::resolve): Launch the resolve operation with the soup library.
1052         (WebCore::DNSResolveQueueSoup::stopResolve): Stop the resolve operation on process with a GCancellable.
1053
1054 2018-03-06  Brian Burg  <bburg@apple.com>
1055
1056         [Cocoa] Stop copying ForwardingHeaders directory that no longer exists
1057         https://bugs.webkit.org/show_bug.cgi?id=183396
1058
1059         Reviewed by Dan Bernstein.
1060
1061         * WebCore.xcodeproj/project.pbxproj:
1062         Rename the phase to "Copy ICU Headers". ForwardingHeaders are no longer a thing.
1063
1064 2018-03-06  Youenn Fablet  <youenn@apple.com>
1065
1066         didReceiveServerRedirectForProvisionalNavigation is not called in case of document redirection with service worker registration change
1067         https://bugs.webkit.org/show_bug.cgi?id=183299
1068         <rdar://problem/37547029>
1069
1070         Reviewed by Alex Christensen.
1071
1072         In case of redirection with service worker registration change, we cancel the load and create a new one.
1073         This prevent ResourceLoader::willSendRequestInternal to call the didReceiveServerRedirectForProvisionalNavigation
1074         callback. We thus explictly call this callback after restarting the load with the new service worker step.
1075         We only call this callback if the main resource is there as we do not want to call it if it was blocked by content extension.
1076
1077         Test: http/wpt/service-workers/navigation-redirect-main-frame.https.html
1078
1079         * loader/DocumentLoader.cpp:
1080         (WebCore::DocumentLoader::restartLoadingDueToServiceWorkerRegistrationChange):
1081
1082 2018-03-06  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1083
1084         [Curl] Remove unnecessary copied ResourceRequest member variable.
1085         https://bugs.webkit.org/show_bug.cgi?id=183010
1086
1087         Reviewed by Youenn Fablet.
1088
1089         * platform/network/ResourceHandle.h:
1090         * platform/network/ResourceHandleInternal.h:
1091         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
1092         * platform/network/curl/CurlRequest.h:
1093         (WebCore::CurlRequest::resourceRequest const):
1094         * platform/network/curl/ResourceHandleCurl.cpp:
1095         (WebCore::ResourceHandle::start):
1096         (WebCore::ResourceHandle::addCacheValidationHeaders):
1097         (WebCore::ResourceHandle::createCurlRequest):
1098         (WebCore::ResourceHandle::restartRequestWithCredential):
1099         (WebCore::ResourceHandle::continueAfterWillSendRequest):
1100
1101 2018-03-06  Nan Wang  <n_wang@apple.com>
1102
1103         AX: Flaky test after r229310
1104         https://bugs.webkit.org/show_bug.cgi?id=183376
1105         <rdar://problem/38188685>
1106
1107         Reviewed by Chris Fleizach.
1108
1109         The test that forces the context menu to show sometimes locks up 
1110         the test runner. Also, we missed a case where calling AXShowMenu
1111         action on a combobox is not dispatching the accessibility event.
1112
1113         Using the combobox example to test the event dispatching in order to
1114         avoid the test hang.
1115
1116         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1117         (-[WebAccessibilityObjectWrapper accessibilityPerformShowMenuAction]):
1118         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
1119
1120 2018-03-06  Chris Dumez  <cdumez@apple.com>
1121
1122         fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed.html fails with async policy delegates
1123         https://bugs.webkit.org/show_bug.cgi?id=183345
1124
1125         Reviewed by Alex Christensen.
1126
1127         FrameLoader::loadURL() was calling loadWithNavigationAction() and then resetting the
1128         m_quickRedirectComing flag right after. This works if the navigation policy decision
1129         triggered by loadWithNavigationAction() is made synchronously. However, when it is
1130         made asynchronously, the flag gets reset too early, before the policy decision
1131         handler has been called. This is an issue because the policy decision handler
1132         relies on the m_quickRedirectComing flag.
1133
1134         Similarly, FrameLoader::loadFrameRequest() was calling loadPostRequest() / loadURL()
1135         and then focusing a frame right after. This does not work as intended when the navigation
1136         policy decision is made asynchronously.
1137
1138         To address the issue, we now pass a completion handler that gets called when the operation
1139         has actually completion, after the policy decision has been made. This maintains the
1140         behavior in place with synchronous policy delegates.
1141
1142         Test: fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed-async-delegates.html
1143
1144         * loader/FrameLoader.cpp:
1145         (WebCore::FrameLoader::loadURLIntoChildFrame):
1146         (WebCore::FrameLoader::loadFrameRequest):
1147         (WebCore::FrameLoader::loadURL):
1148         (WebCore::FrameLoader::loadWithNavigationAction):
1149         (WebCore::FrameLoader::load):
1150         (WebCore::FrameLoader::loadWithDocumentLoader):
1151         (WebCore::FrameLoader::reloadWithOverrideEncoding):
1152         (WebCore::FrameLoader::reload):
1153         (WebCore::FrameLoader::loadPostRequest):
1154         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
1155         (WebCore::FrameLoader::loadDifferentDocumentItem):
1156         * loader/FrameLoader.h:
1157
1158 2018-03-06  Antoine Quint  <graouts@apple.com>
1159
1160         [Web Animations] Add a new CSSTransition subclass of WebAnimation
1161         https://bugs.webkit.org/show_bug.cgi?id=183373
1162         <rdar://problem/38181985>
1163
1164         Reviewed by Dean Jackson.
1165
1166         Adding a new CSSAnimation subclass which we will create in a later patch while resolving styles
1167         upon identifying that a new CSS Animation has been added to an element.
1168
1169         * CMakeLists.txt:
1170         * DerivedSources.make:
1171         * Sources.txt:
1172         * WebCore.xcodeproj/project.pbxproj:
1173         * animation/CSSTransition.cpp: Added.
1174         (WebCore::CSSTransition::create):
1175         (WebCore::CSSTransition::CSSTransition):
1176         * animation/CSSTransition.h: Added.
1177         * animation/CSSTransition.idl: Added.
1178         * animation/KeyframeEffect.cpp:
1179         * animation/WebAnimation.h:
1180         (WebCore::WebAnimation::isCSSTransition const):
1181         * bindings/js/JSWebAnimationCustom.cpp:
1182         (WebCore::toJSNewlyCreated):
1183         * bindings/js/WebCoreBuiltinNames.h:
1184
1185 2018-03-06  Megan Gardner  <megan_gardner@apple.com>
1186
1187         Ensure system appearance is default for web content
1188         https://bugs.webkit.org/show_bug.cgi?id=183354
1189         <rdar://problem/36975571>
1190         <rdar://problem/38162381>
1191
1192         Make sure the the system appearance for web content is default, and
1193         consolidate that code to a single class.
1194
1195         Reviewed by Tim Horton.
1196
1197         Not currently testable, will add tests in a future patch.
1198
1199         * WebCore.xcodeproj/project.pbxproj:
1200         * platform/mac/LocalDefaultSystemAppearance.h: Added.
1201         * platform/mac/LocalDefaultSystemAppearance.mm: Added.
1202         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
1203         (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
1204         * platform/mac/ThemeMac.mm:
1205         (-[WebCoreThemeView init]):
1206         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
1207         * rendering/RenderThemeMac.mm:
1208         (WebCore::RenderThemeMac::systemColor const):
1209
1210 2018-03-06  Antoine Quint  <graouts@apple.com>
1211
1212         [Web Animations] Add a new runtime flag to control whether CSS Animations and CSS Transitions should run using the Web Animations timeline
1213         https://bugs.webkit.org/show_bug.cgi?id=183370
1214         <rdar://problem/38180729>
1215
1216         Reviewed by Dean Jackson.
1217
1218         Before we start creating WebAnimation objects to perform CSS Animations and CSS Transitions, which will replace the existing codepath
1219         involving CSSAnimationController and CompositeAnimation, we need a runtime flag that will allow all the new code to be turned off by
1220         default while we bring this feature up.
1221
1222         * page/RuntimeEnabledFeatures.h:
1223         (WebCore::RuntimeEnabledFeatures::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
1224         (WebCore::RuntimeEnabledFeatures::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled const):
1225
1226 2018-03-06  Daniel Bates  <dabates@apple.com>
1227
1228         Make more use of USE(OPENGL_ES) and replace typedefs with C++11 using statements
1229         in TextureCacheCV.h
1230
1231         Rubber-stamped by Tim Horton.
1232
1233         * platform/graphics/cv/TextureCacheCV.h:
1234
1235 2018-03-06  Antti Koivisto  <antti@apple.com>
1236
1237         Cache hasComplexSelectorsForStyleAttribute bit
1238         https://bugs.webkit.org/show_bug.cgi?id=183363
1239
1240         Reviewed by Andreas Kling.
1241
1242         * css/DocumentRuleSets.cpp:
1243         (WebCore::DocumentRuleSets::collectFeatures const):
1244         (WebCore::DocumentRuleSets::hasComplexSelectorsForStyleAttribute const):
1245
1246         Cache the bit to avoid hash lookups.
1247
1248         * css/DocumentRuleSets.h:
1249         * dom/StyledElement.cpp:
1250         (WebCore::StyledElement::invalidateStyleAttribute):
1251         (WebCore::shouldSynchronizeStyleAttributeImmediatelyForInvalidation): Deleted.
1252
1253         Move code to DocumentRuleSets.
1254
1255 2018-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
1256
1257         Change the type of SVGToOTFFontConverter::m_weight to be not a char
1258         https://bugs.webkit.org/show_bug.cgi?id=183339
1259
1260         Reviewed by Alex Christensen.
1261
1262         No new tests because there is no behavior change.
1263
1264         * svg/SVGToOTFFontConversion.cpp:
1265         (WebCore::SVGToOTFFontConverter::appendOS2Table):
1266         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
1267
1268 2018-03-06  Antoine Quint  <graouts@apple.com>
1269
1270         [Web Animations] Add a new CSSAnimation subclass of WebAnimation
1271         https://bugs.webkit.org/show_bug.cgi?id=183371
1272         <rdar://problem/38181724>
1273
1274         Reviewed by Dean Jackson.
1275
1276         Adding a new CSSAnimation subclass which we will create in a later patch while resolving styles
1277         upon identifying that a new CSS Animation has been added to an element.
1278
1279         * CMakeLists.txt:
1280         * DerivedSources.make:
1281         * Sources.txt:
1282         * WebCore.xcodeproj/project.pbxproj:
1283         * animation/CSSAnimation.cpp: Added.
1284         (WebCore::CSSAnimation::create):
1285         (WebCore::CSSAnimation::CSSAnimation):
1286         * animation/CSSAnimation.h: Added.
1287         * animation/CSSAnimation.idl: Added.
1288         * animation/KeyframeEffectReadOnly.cpp
1289         * animation/WebAnimation.h:
1290         (WebCore::WebAnimation::isCSSAnimation const):
1291         * animation/WebAnimation.idl:
1292         * bindings/js/JSWebAnimationCustom.cpp:
1293         (WebCore::toJSNewlyCreated):
1294         (WebCore::toJS):
1295         * bindings/js/WebCoreBuiltinNames.h:
1296
1297 2018-03-06  Ms2ger  <Ms2ger@igalia.com>
1298
1299         Explicitly qualify some method calls on this in lambdas in Service Worker code.
1300         https://bugs.webkit.org/show_bug.cgi?id=183367
1301
1302         Reviewed by Chris Dumez.
1303
1304         No new tests -- no change in behavior.
1305
1306         * loader/DocumentLoader.cpp:
1307         (WebCore::DocumentLoader::startLoadingMainResource):
1308         * workers/service/server/SWServer.cpp:
1309         (WebCore::SWServer::matchAll):
1310
1311 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
1312
1313         [CoordGraphics] Remove unused scrolling-related code in TextureMapperLayer, CoordinatedGraphics stack
1314         https://bugs.webkit.org/show_bug.cgi?id=183340
1315
1316         Reviewed by Michael Catanzaro.
1317
1318         TextureMapperLayer::scrollBy() method is completely unused and can be
1319         removed. This opens the gates on removing majority of scrolling-related
1320         code in TextureMapperLayer, CoordinatedGraphicsLayer and
1321         CoordinatedGraphicsScene classes, along with smaller bits in other
1322         closely-associated classes.
1323
1324         We're able to remove two virtual method overrides in the
1325         ScrollingCoordinatorCoordinatedGraphics class.
1326
1327         TextureMapperLayer can drop the ScrollingClient member variable, along
1328         with multiple others. Various unused methods in that class are removed
1329         as well.
1330
1331         CoordinatedGraphicsLayer and GraphicsLayerTextureMapper can both remove
1332         the custom scrolling state tracking.
1333
1334         No new tests -- no change in behavior.
1335
1336         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
1337         (WebCore::ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange): Deleted.
1338         (WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea): Deleted.
1339         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h:
1340         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
1341         (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
1342         (WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
1343         (WebCore::GraphicsLayerTextureMapper::didCommitScrollOffset): Deleted.
1344         (WebCore::GraphicsLayerTextureMapper::setIsScrollable): Deleted.
1345         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
1346         * platform/graphics/texmap/TextureMapperLayer.cpp:
1347         (WebCore::TextureMapperLayer::hitTest): Deleted.
1348         (WebCore::TextureMapperLayer::scrollableLayerHitTestCondition): Deleted.
1349         (WebCore::TextureMapperLayer::findScrollableContentsLayerAt): Deleted.
1350         (WebCore::TextureMapperLayer::mapScrollOffset): Deleted.
1351         (WebCore::TextureMapperLayer::commitScrollOffset): Deleted.
1352         (WebCore::TextureMapperLayer::scrollBy): Deleted.
1353         (WebCore::TextureMapperLayer::didCommitScrollOffset): Deleted.
1354         * platform/graphics/texmap/TextureMapperLayer.h:
1355         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1356         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
1357         (WebCore::CoordinatedGraphicsLayer::syncLayerState):
1358         (WebCore::CoordinatedGraphicsLayer::resetLayerState):
1359         (WebCore::CoordinatedGraphicsLayer::setScrollableArea): Deleted.
1360         (WebCore::CoordinatedGraphicsLayer::commitScrollOffset): Deleted.
1361         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1362         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
1363
1364 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
1365
1366         [CoordGraphics] Apply TextureMapperLayer animations with a single MonotonicTime value
1367         https://bugs.webkit.org/show_bug.cgi?id=183360
1368
1369         Reviewed by Sergio Villar Senin.
1370
1371         When animations are being applied on the TextureMapperLayer tree, the
1372         monotonic time value is retrieved repeatedly in TextureMapperAnimation
1373         class. Instead of spawning repeated syscalls that are required to obtain
1374         the time value, TextureMapperLayer::applyAnimationsRecursively() now
1375         accepts a MonotonicTime value that should be used for all animation
1376         updates.
1377
1378         No new tests -- no change in behavior.
1379
1380         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
1381         (WebCore::GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly):
1382         * platform/graphics/texmap/TextureMapperAnimation.cpp:
1383         (WebCore::TextureMapperAnimation::apply):
1384         (WebCore::TextureMapperAnimation::computeTotalRunningTime):
1385         (WebCore::TextureMapperAnimations::apply):
1386         * platform/graphics/texmap/TextureMapperAnimation.h:
1387         (WebCore::TextureMapperAnimation::keyframes const):
1388         (WebCore::TextureMapperAnimation::animation const):
1389         (WebCore::TextureMapperAnimation::boxSize const): Deleted.
1390         (WebCore::TextureMapperAnimation::listsMatch const): Deleted.
1391         (WebCore::TextureMapperAnimation::startTime const): Deleted.
1392         (WebCore::TextureMapperAnimation::pauseTime const): Deleted.
1393         * platform/graphics/texmap/TextureMapperLayer.cpp:
1394         (WebCore::TextureMapperLayer::applyAnimationsRecursively):
1395         (WebCore::TextureMapperLayer::syncAnimations):
1396         * platform/graphics/texmap/TextureMapperLayer.h:
1397
1398 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
1399
1400         [CoordGraphics] Clean up CoordinatedImageBacking
1401         https://bugs.webkit.org/show_bug.cgi?id=183332
1402
1403         Reviewed by Carlos Garcia Campos.
1404
1405         Clean up the CoordinatedImageBacking class. Prefer reference values in
1406         class functions, methods and member variables, where possible. Move
1407         member variables into a more sensible order. Initialize a few member
1408         variables at the place of declaration.
1409
1410         Drop releaseSurfaceIfNeeded() and updateVisibilityIfNeeded() methods,
1411         integrating them into the update() method, which was the only place
1412         where they were called from.
1413
1414         We don't have to keep a reference to the buffer object, since we're
1415         not using it internally after it's been passed to the client's
1416         updateImageBacking() implementation.
1417
1418         No new tests -- no change in behavior.
1419
1420         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1421         (WebCore::CoordinatedGraphicsLayer::syncImageBacking):
1422         (WebCore::CoordinatedGraphicsLayer::releaseImageBackingIfNeeded):
1423         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
1424         (WebCore::CoordinatedImageBacking::getCoordinatedImageBackingID):
1425         (WebCore::CoordinatedImageBacking::CoordinatedImageBacking):
1426         (WebCore::CoordinatedImageBacking::addHost):
1427         (WebCore::CoordinatedImageBacking::removeHost):
1428         (WebCore::CoordinatedImageBacking::update):
1429         (WebCore::CoordinatedImageBacking::clearContentsTimerFired):
1430         (WebCore::CoordinatedImageBacking::create): Deleted.
1431         (WebCore::CoordinatedImageBacking::markDirty): Deleted.
1432         (WebCore::CoordinatedImageBacking::releaseSurfaceIfNeeded): Deleted.
1433         (WebCore::CoordinatedImageBacking::updateVisibilityIfNeeded): Deleted.
1434         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h:
1435
1436 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
1437
1438         GraphicsLayerTextureMapper: remove the setAnimations() method
1439         https://bugs.webkit.org/show_bug.cgi?id=183358
1440
1441         Reviewed by Carlos Garcia Campos.
1442
1443         Remove the GraphicsLayerTextureMapper::setAnimations() method. This was
1444         not called from anywhere, and is not the way animations are generated
1445         for a given GraphicsLayer object (that would be addAnimation() method).
1446
1447         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
1448         (WebCore::GraphicsLayerTextureMapper::setAnimations): Deleted.
1449         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
1450
1451 2018-03-06  Nan Wang  <n_wang@apple.com>
1452
1453         AX: AOM: More accessibility events support
1454         https://bugs.webkit.org/show_bug.cgi?id=183023
1455         <rdar://problem/37764380>
1456
1457         Reviewed by Chris Fleizach.
1458
1459         Accessibility events.
1460         Spec: https://wicg.github.io/aom/spec/phase2.html
1461
1462         This change adds support for these new events:
1463           accessiblecontextmenu
1464           accessibledecrement
1465           accessibledismiss
1466           accessiblefocus
1467           accessibleincrement
1468           accessiblescrollintoview
1469           accessibleselect
1470
1471         Note: The show context menu action is only supported on macOS now.
1472         The dismiss action is not implemented for all the platforms yet.
1473
1474         Test: accessibility/mac/AOM-events-all.html
1475
1476         * accessibility/AccessibilityListBoxOption.cpp:
1477         (WebCore::AccessibilityListBoxOption::setSelected):
1478         * accessibility/AccessibilityMediaObject.cpp:
1479         (WebCore::AccessibilityMediaObject::increment):
1480         (WebCore::AccessibilityMediaObject::decrement):
1481         * accessibility/AccessibilityMenuListOption.cpp:
1482         (WebCore::AccessibilityMenuListOption::setSelected):
1483         * accessibility/AccessibilityNodeObject.cpp:
1484         (WebCore::AccessibilityNodeObject::increment):
1485         (WebCore::AccessibilityNodeObject::decrement):
1486         * accessibility/AccessibilityObject.cpp:
1487         (WebCore::AccessibilityObject::press):
1488         (WebCore::AccessibilityObject::dispatchAccessibilityEvent const):
1489         (WebCore::AccessibilityObject::dispatchAccessibilityEventWithType const):
1490         (WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent const):
1491         (WebCore::AccessibilityObject::scrollToMakeVisible const):
1492         (WebCore::AccessibilityObject::dispatchAccessibilityEvent): Deleted.
1493         (WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent): Deleted.
1494         * accessibility/AccessibilityObject.h:
1495         * accessibility/AccessibilityRenderObject.cpp:
1496         (WebCore::AccessibilityRenderObject::setFocused):
1497         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1498         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
1499         * dom/Element.idl:
1500         * dom/EventNames.h:
1501
1502 2018-03-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1503
1504         Fix std::make_unique / new[] using system malloc
1505         https://bugs.webkit.org/show_bug.cgi?id=182975
1506
1507         Reviewed by JF Bastien.
1508
1509         Use Vector, FAST_ALLOCATED, or UniqueArray instead.
1510
1511         * Modules/webaudio/AudioBufferSourceNode.cpp:
1512         (WebCore::AudioBufferSourceNode::setBuffer):
1513         * Modules/webaudio/AudioBufferSourceNode.h:
1514         * css/StyleRule.h:
1515         * cssjit/CompiledSelector.h:
1516         * html/HTMLFrameSetElement.h:
1517         * html/canvas/WebGLRenderingContextBase.cpp:
1518         (WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
1519         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
1520         (WebCore::WebGLRenderingContextBase::LRUImageBufferCache::LRUImageBufferCache):
1521         (WebCore::WebGLRenderingContextBase::LRUImageBufferCache::imageBuffer):
1522         (WebCore::WebGLRenderingContextBase::LRUImageBufferCache::bubbleToFront):
1523         * html/canvas/WebGLRenderingContextBase.h:
1524         * platform/Length.cpp:
1525         (WebCore::newCoordsArray):
1526         (WebCore::newLengthArray):
1527         (): Deleted.
1528         * platform/Length.h:
1529         * platform/audio/DynamicsCompressor.cpp:
1530         (WebCore::DynamicsCompressor::setNumberOfChannels):
1531         * platform/audio/DynamicsCompressor.h:
1532         * platform/audio/FFTFrame.h:
1533         * platform/audio/gstreamer/FFTFrameGStreamer.cpp:
1534         (WebCore::FFTFrame::FFTFrame):
1535         * platform/graphics/FormatConverter.h:
1536         (WebCore::FormatConverter::FormatConverter):
1537         * platform/graphics/GraphicsContext3D.cpp:
1538         (WebCore::GraphicsContext3D::texImage2DResourceSafe):
1539         * platform/graphics/GraphicsContext3D.h:
1540         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
1541         (WebCore::getDirtyRects):
1542         * platform/graphics/cairo/CairoUtilities.cpp:
1543         (WebCore::flipImageSurfaceVertically):
1544         * platform/graphics/cg/GraphicsContext3DCG.cpp:
1545         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
1546         * platform/graphics/gpu/Texture.cpp:
1547         (WebCore::Texture::updateSubRect):
1548         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1549         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
1550         (WebCore::GraphicsContext3D::compileShader):
1551         (WebCore::GraphicsContext3D::getActiveAttribImpl):
1552         (WebCore::GraphicsContext3D::getActiveUniformImpl):
1553         (WebCore::GraphicsContext3D::getProgramInfoLog):
1554         (WebCore::GraphicsContext3D::getShaderInfoLog):
1555         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
1556         (WebCore::getShaderLog):
1557         (WebCore::getProgramLog):
1558         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
1559         (WebCore::ImageBufferData::putData):
1560         * platform/image-decoders/png/PNGImageDecoder.cpp:
1561         (WebCore::PNGImageReader::PNGImageReader):
1562         (WebCore::PNGImageReader::close):
1563         (WebCore::PNGImageReader::interlaceBuffer const):
1564         (WebCore::PNGImageReader::createInterlaceBuffer):
1565         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
1566         (WebCore::WEBPImageDecoder::decodeFrame):
1567         * platform/network/curl/SocketStreamHandleImpl.h:
1568         (WebCore::SocketStreamHandleImpl::SocketData::SocketData):
1569         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
1570         (WebCore::createCopy):
1571         (WebCore::SocketStreamHandleImpl::readData):
1572         (): Deleted.
1573         * platform/network/soup/SocketStreamHandleImpl.h:
1574         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
1575         (WebCore::SocketStreamHandleImpl::connected):
1576         * platform/win/LoggingWin.cpp:
1577         (WebCore::logLevelString):
1578
1579 2018-03-05  Yoav Weiss  <yoav@yoav.ws>
1580
1581         Support for preconnect Link headers
1582         https://bugs.webkit.org/show_bug.cgi?id=181657
1583
1584         Reviewed by Darin Adler.
1585
1586         Move the preconnect functionality into its own function, and
1587         also call this function when Link headers are processed.
1588
1589         Test: http/tests/preconnect/link-header-rel-preconnect-http.php
1590
1591         * loader/LinkLoader.cpp:
1592         (WebCore::LinkLoader::loadLinksFromHeader): Call preconnectIfNeeded.
1593         (WebCore::LinkLoader::preconnectIfNeeded): Preconnect to a host functionality moved here.
1594         (WebCore::LinkLoader::loadLink): Call preconnectIfNeeded.
1595         * loader/LinkLoader.h:
1596
1597 2018-03-05  Antti Koivisto  <antti@apple.com>
1598
1599         Add ChildrenAffectedByForwardPositionalRules bit for nth-child pseudo class marking
1600         https://bugs.webkit.org/show_bug.cgi?id=183341
1601         <rdar://problem/38151470>
1602
1603         Reviewed by Zalan Bujtas.
1604
1605         Use it instead of AffectsNextSibling/AffectedByPreviousSibling bits, similar to ChildrenAffectedByBackwardPositionalRules bit.
1606         This is more efficient and requires way less marking.
1607
1608         * css/SelectorChecker.cpp:
1609         (WebCore::countElementsBefore):
1610         (WebCore::countElementsOfTypeBefore):
1611         (WebCore::SelectorChecker::checkOne const):
1612
1613             Mark with ChildrenAffectedByForwardPositionalRules.
1614
1615         * cssjit/SelectorCompiler.cpp:
1616         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
1617         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
1618
1619              Mark with ChildrenAffectedByForwardPositionalRules.
1620
1621         * dom/Element.cpp:
1622         (WebCore::checkForSiblingStyleChanges):
1623
1624             Invalidate siblings after added/removed element.
1625
1626         (WebCore::Element::setChildrenAffectedByForwardPositionalRules):
1627         (WebCore::Element::hasFlagsSetDuringStylingOfChildren const):
1628         (WebCore::Element::rareDataChildrenAffectedByForwardPositionalRules const):
1629
1630             Add the new marking bit.
1631
1632         * dom/Element.h:
1633         (WebCore::Element::childrenAffectedByForwardPositionalRules const):
1634         (WebCore::Element::attributeWithoutSynchronization const):
1635
1636             Remove assert so we can use this to get the current unresolved lazy value of style attrbute.
1637
1638         * dom/ElementRareData.h:
1639         (WebCore::ElementRareData::childrenAffectedByForwardPositionalRules const):
1640         (WebCore::ElementRareData::setChildrenAffectedByForwardPositionalRules):
1641         (WebCore::ElementRareData::ElementRareData):
1642         (WebCore::ElementRareData::resetStyleRelations):
1643
1644              Add the new marking bit.
1645
1646         * dom/StyledElement.cpp:
1647         (WebCore::StyledElement::invalidateStyleAttribute):
1648
1649             In special case where we have attribute selectors for style attribute, synchronize the attribute immediately so we get invalidation right.
1650             Tested by fast/css/style-attribute-invalidation-propagates-to-counted-siblings.html    
1651
1652         * style/StyleRelations.cpp:
1653         (WebCore::Style::commitRelationsToRenderStyle):
1654         (WebCore::Style::commitRelations):
1655
1656             Commit the new bit.
1657
1658         * style/StyleRelations.h:
1659
1660 2018-03-05  Ryan Haddad  <ryanhaddad@apple.com>
1661
1662         Unreviewed build fix, remove unused variables.
1663
1664         * css/parser/CSSPropertyParser.cpp:
1665         (WebCore::consumeSpeakAs):
1666         (WebCore::consumeHangingPunctuation):
1667
1668 2018-03-05  Chris Dumez  <cdumez@apple.com>
1669
1670         fast/loader/onload-policy-ignore-for-frame.html is timing out with async policy delegates
1671         https://bugs.webkit.org/show_bug.cgi?id=183337
1672
1673         Reviewed by Ryosuke Niwa.
1674
1675         Make sure we call checkCompleted() before calling checkLoadComplete() in
1676         FrameLoader::continueLoadAfterNavigationPolicy() when the client tells us
1677         to ignore the navigation, so that we properly recognize that the load is
1678         done. This matches what is already done in FrameLoader::receivedMainResourceError().
1679
1680         Test: fast/loader/onload-policy-ignore-for-frame-async-delegates.html
1681
1682         * loader/FrameLoader.cpp:
1683         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1684
1685 2018-03-05  Myles C. Maxfield  <mmaxfield@apple.com>
1686
1687         [Cocoa] Allow user-installed fonts to be disabled
1688         https://bugs.webkit.org/show_bug.cgi?id=183349
1689
1690         Rubber stamped by Brent Fulgham.
1691
1692         Tests: fast/text/user-installed-font.html
1693                fast/text/user-installed-fonts/disable.html
1694                fast/text/user-installed-fonts/shadow-disable.html
1695                fast/text/user-installed-fonts/shadow-family-disable.html
1696                fast/text/user-installed-fonts/shadow-family.html
1697                fast/text/user-installed-fonts/shadow-postscript-disable.html
1698                fast/text/user-installed-fonts/shadow-postscript-family-disable.html
1699                fast/text/user-installed-fonts/shadow-postscript-family.html
1700                fast/text/user-installed-fonts/shadow-postscript.html
1701                fast/text/user-installed-fonts/shadow.html
1702                fast/text/user-installed-fonts/system-ui.html
1703
1704         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1705
1706 2018-03-05  Myles C. Maxfield  <mmaxfield@apple.com>
1707
1708         Silence OpenGL and OpenGL ES deprecation warnings in newer SDKs
1709         https://bugs.webkit.org/show_bug.cgi?id=183350
1710
1711         Unreviewed.
1712
1713         * Configurations/WebCore.xcconfig:
1714
1715 2018-03-05  Andy Estes  <aestes@apple.com>
1716
1717         [Mac] Teach WebCore::Pasteboard about file promise drags
1718         https://bugs.webkit.org/show_bug.cgi?id=183314
1719         <rdar://problem/38105493>
1720
1721         Reviewed by Darin Adler.
1722
1723         While WebKit does support receiving file promise drags (since r210360), WebCore::Pasteboard
1724         has not been instructed on how to read their file paths. When the various pasteboard readers
1725         ask for file paths after a file promise drop, they receive an empty vector. This impacts
1726         various features, most notably the DataTransfer API.
1727
1728         Pasteboard actually cannot learn about promised file paths from the pasteboard itself, as
1729         the pasteboard only contains the dragged files' UTIs. Promised file paths aren't known until
1730         the WebKits call -[NSFilePromiseReceiver receivePromisedFilesAtDestination:...], at which
1731         point the file paths are passed to WebCore as part of WebCore::DragData.
1732
1733         When we construct new Pasteboards for drag and drop, we need to store any promised file
1734         paths from the DragData. Then, when the various pasteboard readers ask for file paths and
1735         NSFilesPromisePboardType is on the pasteboard, we can return these promised file paths.
1736
1737         Tests: editing/pasteboard/data-transfer-items-drag-drop-file-promise.html
1738                editing/pasteboard/data-transfer-items-drop-file-promise.html
1739                editing/pasteboard/datatransfer-items-drop-plaintext-file-promise.html
1740                editing/pasteboard/datatransfer-types-dropping-text-file-promise.html
1741                editing/pasteboard/drag-file-promises-to-editable-element-as-URLs.html
1742                editing/pasteboard/drag-file-promises-to-editable-element-as-attachment.html
1743                editing/pasteboard/file-input-files-access-promise.html
1744
1745         * platform/FileSystem.h:
1746         * platform/Pasteboard.h:
1747         (WebCore::Pasteboard::Pasteboard):
1748         * platform/mac/DragDataMac.mm:
1749         (WebCore::DragData::containsPromise const):
1750         * platform/mac/PasteboardMac.mm:
1751         (WebCore::Pasteboard::Pasteboard):
1752         (WebCore::Pasteboard::createForDragAndDrop):
1753         (WebCore::toString):
1754         (WebCore::Pasteboard::read):
1755         (WebCore::Pasteboard::readFilePaths):
1756         (WebCore::absoluteURLsFromPasteboardFilenames): Deleted.
1757         * platform/mac/PlatformPasteboardMac.mm:
1758         (WebCore::PlatformPasteboard::numberOfFiles const):
1759
1760 2018-03-05  Andy Estes  <aestes@apple.com>
1761
1762         [Mac] Fix the build
1763
1764         * Modules/applepay/ApplePaySession.cpp:
1765         (WebCore::convertAndValidate): Removed unused variables.
1766
1767 2018-03-05  Antti Koivisto  <antti@apple.com>
1768
1769         Don't invalidate all children when doing insertion/deletion in presence of backward positional selectors
1770         https://bugs.webkit.org/show_bug.cgi?id=183325
1771         <rdar://problem/38134480>
1772
1773         Reviewed by Zalan Bujtas.
1774
1775         It is sufficient to invalidate siblings before the mutation point.
1776
1777         * dom/Element.cpp:
1778         (WebCore::checkForSiblingStyleChanges):
1779
1780         We already do sibling walk in the case of forwards positional rules and sibling combinators. The work
1781         done here is insignifant compared to cost of overinvalidating.
1782
1783 2018-03-05  Ali Juma  <ajuma@chromium.org>
1784
1785         imported/w3c/web-platform-tests/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html times out with async policy delegates
1786         https://bugs.webkit.org/show_bug.cgi?id=183297
1787
1788         Reviewed by Chris Dumez.
1789
1790         When a FrameLoader's policy document loader is cleared after receiving a navigation policy decision
1791         to not continue loading, we still need to trigger a check for load completion, since this loader or
1792         an ancestor loader may have been in state isLoadingInAPISense only because of the existence of
1793         the just-cleared policy document loader. Without triggering this check, these loaders may never
1794         call WebFrameLoaderClient::dispatchDidFinishLoad.
1795
1796         Test: http/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html
1797
1798         * loader/FrameLoader.cpp:
1799         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1800
1801 2018-03-04  Yusuke Suzuki  <utatane.tea@gmail.com>
1802
1803         [WTF] Move currentCPUTime and sleep(Seconds) to CPUTime.h and Seconds.h respectively
1804         https://bugs.webkit.org/show_bug.cgi?id=183312
1805
1806         Reviewed by Mark Lam.
1807
1808         Remove wtf/CurrentTime.h include pragma.
1809
1810         * Modules/geolocation/Geolocation.cpp:
1811         * Modules/mediasource/SourceBuffer.cpp:
1812         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1813         * Modules/speech/SpeechSynthesis.cpp:
1814         * contentextensions/ContentExtensionCompiler.cpp:
1815         * contentextensions/ContentExtensionParser.cpp:
1816         * dom/Document.cpp:
1817         * dom/Element.cpp:
1818         * dom/Event.cpp:
1819         * dom/ScriptedAnimationController.cpp:
1820         * dom/SimulatedClick.cpp:
1821         * fileapi/File.cpp:
1822         * fileapi/FileReader.cpp:
1823         * history/CachedPage.cpp:
1824         * html/BaseDateAndTimeInputType.cpp:
1825         * html/DateTimeInputType.cpp:
1826         * html/HTMLMediaElement.cpp:
1827         * html/MediaController.cpp:
1828         * html/MediaElementSession.cpp:
1829         * html/MonthInputType.cpp:
1830         * html/TimeInputType.cpp:
1831         * html/parser/HTMLParserScheduler.h:
1832         * inspector/InspectorCanvas.cpp:
1833         * loader/FrameLoader.cpp:
1834         * loader/LoadTiming.cpp:
1835         * loader/NavigationScheduler.cpp:
1836         * loader/ProgressTracker.cpp:
1837         * loader/cache/CachedCSSStyleSheet.cpp:
1838         * loader/cache/CachedImage.cpp:
1839         * loader/cache/CachedResource.cpp:
1840         * loader/cache/MemoryCache.cpp:
1841         * page/DOMTimer.cpp:
1842         * page/DOMWindow.cpp:
1843         * page/DragController.cpp:
1844         * page/EventHandler.cpp:
1845         * page/FocusController.cpp:
1846         * page/FrameView.cpp:
1847         * page/Page.cpp:
1848         * page/Performance.cpp:
1849         * page/PerformanceTiming.cpp:
1850         * page/animation/AnimationBase.cpp:
1851         * page/animation/CSSAnimationController.cpp:
1852         * page/mac/WheelEventDeltaFilterMac.mm:
1853         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1854         * platform/ScrollAnimationKinetic.cpp:
1855         * platform/ScrollAnimationSmooth.cpp:
1856         * platform/ThreadTimers.cpp:
1857         * platform/Timer.cpp:
1858         * platform/audio/mac/AudioSampleDataSource.mm:
1859         * platform/cocoa/ScrollController.mm:
1860         * platform/gamepad/cocoa/GameControllerGamepad.mm:
1861         * platform/gamepad/mac/HIDGamepad.cpp:
1862         * platform/graphics/BitmapImage.cpp:
1863         * platform/graphics/DisplayRefreshMonitorManager.cpp:
1864         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1865         * platform/graphics/ca/GraphicsLayerCA.cpp:
1866         * platform/graphics/ca/LayerPool.cpp:
1867         * platform/graphics/ca/PlatformCALayer.h:
1868         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1869         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
1870         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1871         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
1872         * platform/graphics/cg/GraphicsContextCG.cpp:
1873         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
1874         * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
1875         * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
1876         * platform/graphics/texmap/BitmapTexturePool.h:
1877         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
1878         * platform/graphics/texmap/TextureMapper.cpp:
1879         * platform/graphics/texmap/TextureMapperAnimation.cpp:
1880         * platform/graphics/texmap/TextureMapperFPSCounter.cpp:
1881         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1882         * platform/graphics/win/GraphicsContextDirect2D.cpp:
1883         * platform/graphics/win/GraphicsLayerDirect2D.cpp:
1884         * platform/gtk/PlatformKeyboardEventGtk.cpp:
1885         * platform/gtk/ScrollAnimatorGtk.cpp:
1886         * platform/ios/LegacyTileCache.mm:
1887         * platform/ios/LegacyTileLayerPool.mm:
1888         * platform/ios/ScrollViewIOS.mm:
1889         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
1890         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
1891         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
1892         * platform/mock/MockRealtimeMediaSource.cpp:
1893         * platform/mock/MockRealtimeVideoSource.cpp:
1894         * platform/network/CacheValidation.cpp:
1895         * platform/network/DNSResolveQueue.cpp:
1896         * platform/network/ResourceResponseBase.cpp:
1897         * platform/network/curl/CurlCacheEntry.cpp:
1898         * platform/network/soup/ResourceHandleSoup.cpp:
1899         * platform/text/TextEncodingRegistry.cpp:
1900         * platform/text/win/LocaleWin.cpp:
1901         * platform/win/MainThreadSharedTimerWin.cpp:
1902         * platform/win/PlatformMouseEventWin.cpp:
1903         * rendering/RenderLayerCompositor.cpp:
1904         * rendering/RenderProgress.cpp:
1905         * svg/animation/SMILTimeContainer.cpp:
1906         * testing/MockGamepad.cpp:
1907         * workers/WorkerRunLoop.cpp:
1908
1909 2018-03-04  Tim Horton  <timothy_horton@apple.com>
1910
1911         Make !ENABLE(DATA_DETECTION) iOS build actually succeed
1912         https://bugs.webkit.org/show_bug.cgi?id=183283
1913         <rdar://problem/38062148>
1914
1915         Reviewed by Sam Weinig.
1916
1917         * Configurations/FeatureDefines.xcconfig:
1918
1919 2018-03-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
1920
1921         Delete incorrect version of clampTo() function from SVGToOTFFontConversion.cpp
1922         https://bugs.webkit.org/show_bug.cgi?id=183165
1923
1924         Reviewed by Darin Adler.
1925
1926         Some of the calls in SVGToOTFFontConversion.cpp were directed to the function
1927         in MathExtras.h while the rest were directed to this local static function.
1928         There should not be two versions with the same name while they are supposed
1929         to do the same thing. Besides, the local version does not work correctly
1930         if the type of the argument's max limit is less the max limit of the returned
1931         type, e.g. char -> uint16_t.
1932
1933         * svg/SVGToOTFFontConversion.cpp:
1934         (WebCore::clampTo): Deleted.
1935
1936 2018-03-03  Zalan Bujtas  <zalan@apple.com>
1937
1938         [RenderTreeBuilder] Move styleDidChange mutation logic to RenderTreeUpdater
1939         https://bugs.webkit.org/show_bug.cgi?id=183273
1940         <rdar://problem/38054892>
1941
1942         Reviewed by Antti Koivisto.
1943
1944         Covered by existing tests.
1945
1946         * rendering/RenderBlockFlow.cpp:
1947         (WebCore::RenderBlockFlow::styleDidChange):
1948         * rendering/RenderElement.cpp:
1949         (WebCore::RenderElement::styleDidChange):
1950         (WebCore::RenderElement::noLongerAffectsParentBlock const): Deleted.
1951         * rendering/RenderElement.h:
1952         * rendering/updating/RenderTreeUpdater.cpp:
1953         (WebCore::RenderTreeUpdater::updateElementRenderer):
1954
1955 2018-03-03  Yoav Weiss  <yoav@yoav.ws>
1956
1957         Link headers for subresources are not being processes
1958         https://bugs.webkit.org/show_bug.cgi?id=181789
1959
1960         Reviewed by Youenn Fablet.
1961
1962         Triggers Link header processing when the Link headers arrive on a subresource.
1963
1964         Test: http/tests/preload/link-header-on-subresource.html
1965
1966         * loader/LinkLoader.cpp:
1967         (WebCore::LinkLoader::loadLinksFromHeader): Change the media check conditions.
1968         * loader/LinkLoader.h: Add a third state for media checks.
1969         * loader/SubresourceLoader.cpp:
1970         (WebCore::SubresourceLoader::didReceiveResponse): Preload links from headers for subresources.
1971
1972 2018-03-02  Yusuke Suzuki  <utatane.tea@gmail.com>
1973
1974         [WTF] Remove RunLoop and RunLoop::Timer's interface using double as seconds
1975         https://bugs.webkit.org/show_bug.cgi?id=183293
1976
1977         Reviewed by Alex Christensen.
1978
1979         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
1980         (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
1981
1982 2018-03-02  Dean Jackson  <dino@apple.com>
1983
1984         Remove NP_GLContext since it is unsupported
1985         https://bugs.webkit.org/show_bug.cgi?id=183305
1986         <rdar://problem/36875555>
1987
1988         Reviewed by Simon Fraser.
1989
1990         * plugins/npapi.h: Remove NP_GLContext and mention that
1991         it is not supported.
1992
1993 2018-03-02  Chris Dumez  <cdumez@apple.com>
1994
1995         imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html crashes with async policy delegates
1996         https://bugs.webkit.org/show_bug.cgi?id=183294
1997         <rdar://problem/38073596>
1998
1999         Reviewed by Youenn Fablet.
2000
2001         Drop code that was added to SubresourceLoader::willCancel() in r228852. The purpose of this code
2002         was to make sure that SubresourceLoader::m_policyForResponseCompletionHandler always gets called,
2003         even when the load is cancelled. However, this code is not needed (since m_policyForResponseCompletionHandler
2004         is a CompletionHandler, an assertion will be hit if we fail to call it and we'll know). Calling
2005         the completionHandler inside SubresourceLoader::willCancel() is too early and leads to crashes.
2006
2007         The completionHandler currently gets called DocumentLoader::responseReceived() via a call to
2008         mainResourceLoader->didReceiveResponsePolicy(). Note that in r229177, we made sure that the
2009         call to didReceiveResponsePolicy() happens *after* the call to continueAfterContentPolicy()
2010         to maintain our non-async policy delegate behavior. However, continueAfterContentPolicy()
2011         would end up calling willCancel() and call the completionHandler when shouldContinue was
2012         false.
2013
2014         Test: http/wpt/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-async-delegate.html
2015
2016         * loader/SubresourceLoader.cpp:
2017         (WebCore::SubresourceLoader::willCancel):
2018
2019 2018-03-02  Tim Horton  <timothy_horton@apple.com>
2020
2021         Fix the build after r229185 and r229184
2022
2023         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2024         (WebCore::exernalDeviceDisplayNameForPlayer):
2025         * platform/ios/DeviceOrientationClientIOS.h:
2026         * platform/ios/DeviceOrientationClientIOS.mm:
2027
2028 2018-03-02  Tim Horton  <timothy_horton@apple.com>
2029
2030         Make the !ENABLE(DEVICE_ORIENTATION) iOS build succeed
2031         https://bugs.webkit.org/show_bug.cgi?id=183296
2032
2033         Reviewed by Dan Bernstein.
2034
2035         * platform/ios/DeviceMotionClientIOS.h:
2036         * platform/ios/DeviceMotionClientIOS.mm:
2037         * platform/ios/WebCoreMotionManager.h:
2038         * platform/ios/WebCoreMotionManager.mm:
2039
2040 2018-03-02  Tim Horton  <timothy_horton@apple.com>
2041
2042         Make it possible to build for iOS without Celestial
2043         https://bugs.webkit.org/show_bug.cgi?id=183295
2044         <rdar://problem/38074468>
2045
2046         Reviewed by Dan Bernstein.
2047
2048         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2049         (WebCore::exernalDeviceDisplayNameForPlayer):
2050
2051 2018-03-02  Youenn Fablet  <youenn@apple.com>
2052
2053         Clients should register to StorageProcess with their service worker registration identifier
2054         https://bugs.webkit.org/show_bug.cgi?id=182313
2055         <rdar://problem/38044403>
2056
2057         Reviewed by Chris Dumez.
2058
2059         Relanding with fixing matchAll for uncontrolled clients.
2060
2061         No observable change of behavior in regular conditions.
2062         When service worker process crashes, the service worker identifiers sent by the WebProcess might be wrong
2063         and we will not be able to retrieve the registration from these identifiers.
2064         The storage process will be able to still process correctly messages coming from the WebProcess to register clients of the registration.
2065         Otherwise, there is a chance that WebProcess clients will not be added to the SWServerRegistration.m_clientsUsingRegistration maps.
2066
2067         * dom/Document.cpp:
2068         (WebCore::Document::setServiceWorkerConnection):
2069         * workers/service/SWClientConnection.h:
2070         * workers/service/server/SWServer.cpp:
2071         (WebCore::SWServer::matchAll):
2072         (WebCore::SWServer::claim):
2073         (WebCore::SWServer::registerServiceWorkerClient):
2074         (WebCore::SWServer::unregisterServiceWorkerClient):
2075         (WebCore::SWServer::setClientActiveWorker): Deleted.
2076         * workers/service/server/SWServer.h:
2077         * workers/service/server/SWServerRegistration.cpp:
2078         (WebCore::SWServerRegistration::activate):
2079
2080 2018-03-02  Youenn Fablet  <youenn@apple.com>
2081
2082         Loads for a Document controlled by a Service Worker should not use AppCache
2083         https://bugs.webkit.org/show_bug.cgi?id=183148
2084
2085         Reviewed by Chris Dumez.
2086
2087         Covered by updated test.
2088
2089         Postponing document loading through app cache after matching service worker registration.
2090         Trying to load through app cache only if there is no service worker registration.
2091
2092         Disabling app cache for any load that has a service worker registration identifier.
2093
2094         * loader/DocumentLoader.cpp:
2095         (WebCore::DocumentLoader::redirectReceived):
2096         (WebCore::DocumentLoader::willSendRequest):
2097         (WebCore::DocumentLoader::tryLoadingRequestFromApplicationCache):
2098         (WebCore::DocumentLoader::tryLoadingRedirectRequestFromApplicationCache):
2099         (WebCore::DocumentLoader::restartLoadingDueToServiceWorkerRegistrationChange):
2100         (WebCore::DocumentLoader::scheduleSubstituteResourceLoad):
2101         (WebCore::DocumentLoader::startLoadingMainResource):
2102         * loader/DocumentLoader.h:
2103         * loader/appcache/ApplicationCacheHost.cpp:
2104         (WebCore::ApplicationCacheHost::maybeLoadMainResource):
2105         (WebCore::ApplicationCacheHost::maybeLoadMainResourceForRedirect):
2106         (WebCore::ApplicationCacheHost::maybeLoadResource):
2107         (WebCore::ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache):
2108         * loader/appcache/ApplicationCacheHost.h:
2109
2110 2018-03-02  Chris Dumez  <cdumez@apple.com>
2111
2112         fast/events/before-unload-remove-itself.html crashes with async policy delegates
2113         https://bugs.webkit.org/show_bug.cgi?id=183290
2114         <rdar://problem/38069045>
2115
2116         Reviewed by Alex Christensen.
2117
2118         When the navigation policy happens asynchronously, it is now possible for the
2119         Frame / FrameLoader to get destroyed between the point that policyChecker().checkNavigationPolicy()
2120         is called and when continueLoadAfterNavigationPolicy() is called.
2121
2122         To address the issue, we now protect the Frame and capture it in the lambda passed
2123         to policyChecker().checkNavigationPolicy().
2124
2125         Test: fast/events/before-unload-remove-itself-async-delegate.html
2126
2127         * loader/FrameLoader.cpp:
2128         (WebCore::FrameLoader::loadURL):
2129         (WebCore::FrameLoader::loadWithDocumentLoader):
2130
2131 2018-03-02  Chris Dumez  <cdumez@apple.com>
2132
2133         Converting a load to a download does not work with async policy delegates
2134         https://bugs.webkit.org/show_bug.cgi?id=183254
2135         <rdar://problem/38035334>
2136
2137         Reviewed by Youenn Fablet.
2138
2139         Update DocumentLoader::responseReceived() to call didReceiveResponsePolicy()
2140         on the mainResourceLoader *after* calling continueAfterContentPolicy(),
2141         not *before*. This makes sure that the WebResourceLoader sends the
2142         NetworkResourceLoader::ContinueDidReceiveResponse IPC back to the Network
2143         Process *after* the policy decision has been processed, which restores the
2144         pre-r228852 order.
2145
2146         Test: fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download-async-delegate.html
2147
2148         * loader/DocumentLoader.cpp:
2149         (WebCore::DocumentLoader::responseReceived):
2150
2151 2018-03-02  Youenn Fablet  <youenn@apple.com>
2152
2153         Some RealtimeMediaSource methods do not need to be marked as virtual
2154         https://bugs.webkit.org/show_bug.cgi?id=183272
2155
2156         Reviewed by Eric Carlson.
2157
2158         No change of behavior.
2159
2160         * platform/mediastream/RealtimeMediaSource.h:
2161
2162 2018-03-01  Yusuke Suzuki  <utatane.tea@gmail.com>
2163
2164         Remove monotonicallyIncreasingTime
2165         https://bugs.webkit.org/show_bug.cgi?id=182911
2166
2167         Reviewed by Michael Catanzaro.
2168
2169         While generic code uses MonotonicTime, CAAnimation uses media time (CFTimeInterval).
2170         At this boundary, we convert MonotonicTime to media time, this is the same logic to
2171         the code before this patch.
2172
2173         * Modules/gamepad/Gamepad.h:
2174         * Modules/mediasource/SourceBuffer.cpp:
2175         (WebCore::SourceBuffer::SourceBuffer):
2176         (WebCore::SourceBuffer::monitorBufferingRate):
2177         * Modules/mediasource/SourceBuffer.h:
2178         * Modules/speech/SpeechSynthesis.cpp:
2179         (WebCore::SpeechSynthesis::startSpeakingImmediately):
2180         (WebCore::SpeechSynthesis::fireEvent):
2181         * Modules/speech/SpeechSynthesisUtterance.h:
2182         * contentextensions/ContentExtensionCompiler.cpp:
2183         (WebCore::ContentExtensions::compileRuleList):
2184         * contentextensions/ContentExtensionParser.cpp:
2185         (WebCore::ContentExtensions::parseRuleList):
2186         * contentextensions/ContentExtensionsBackend.cpp:
2187         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):
2188         * dom/Element.cpp:
2189         (WebCore::Element::setActive):
2190         * history/CachedPage.cpp:
2191         (WebCore::CachedPage::CachedPage):
2192         (WebCore::CachedPage::hasExpired const):
2193         * history/CachedPage.h:
2194         * html/HTMLMediaElement.cpp:
2195         (WebCore::HTMLMediaElement::startProgressEventTimer):
2196         (WebCore::HTMLMediaElement::progressEventTimerFired):
2197         (WebCore::HTMLMediaElement::refreshCachedTime const):
2198         (WebCore::HTMLMediaElement::invalidateCachedTime const):
2199         (WebCore::HTMLMediaElement::currentMediaTime const):
2200         (WebCore::HTMLMediaElement::startPlaybackProgressTimer):
2201         * html/HTMLMediaElement.h:
2202         * html/MediaElementSession.cpp:
2203         (WebCore::MediaElementSession::removeBehaviorRestriction):
2204         (WebCore::MediaElementSession::mostRecentUserInteractionTime const):
2205         (WebCore::MediaElementSession::resetPlaybackSessionState):
2206         * html/MediaElementSession.h:
2207         * html/parser/HTMLParserScheduler.cpp:
2208         (WebCore::PumpSession::PumpSession):
2209         (WebCore::HTMLParserScheduler::HTMLParserScheduler):
2210         * html/parser/HTMLParserScheduler.h:
2211         (WebCore::HTMLParserScheduler::checkForYield):
2212         * inspector/InspectorCanvas.cpp:
2213         (WebCore::InspectorCanvas::recordAction):
2214         (WebCore::InspectorCanvas::finalizeFrame):
2215         * inspector/InspectorCanvas.h:
2216         * inspector/agents/InspectorMemoryAgent.cpp:
2217         (WebCore::InspectorMemoryAgent::startTracking):
2218         (WebCore::InspectorMemoryAgent::didHandleMemoryPressure):
2219         (WebCore::InspectorMemoryAgent::collectSample):
2220         * inspector/agents/InspectorNetworkAgent.cpp:
2221         (WebCore::InspectorNetworkAgent::buildObjectForTiming):
2222         (WebCore::InspectorNetworkAgent::timestamp):
2223         (WebCore::InspectorNetworkAgent::didFinishLoading):
2224         * inspector/agents/InspectorPageAgent.cpp:
2225         (WebCore::InspectorPageAgent::timestamp):
2226         * inspector/agents/InspectorTimelineAgent.cpp:
2227         (WebCore::InspectorTimelineAgent::timestamp):
2228         * inspector/agents/WebHeapAgent.cpp:
2229         (WebCore::WebHeapAgent::dispatchGarbageCollectedEvent):
2230         * inspector/agents/WebHeapAgent.h:
2231         * loader/cache/CachedCSSStyleSheet.cpp:
2232         (WebCore::CachedCSSStyleSheet::restoreParsedStyleSheet):
2233         * loader/cache/CachedImage.cpp:
2234         (WebCore::CachedImage::didDraw):
2235         * loader/cache/CachedResource.cpp:
2236         (WebCore::CachedResource::didAccessDecodedData):
2237         * loader/cache/CachedResource.h:
2238         * loader/cache/MemoryCache.cpp:
2239         (WebCore::MemoryCache::pruneLiveResourcesToSize):
2240         * page/EventHandler.cpp:
2241         (WebCore::MaximumDurationTracker::MaximumDurationTracker):
2242         (WebCore::MaximumDurationTracker::~MaximumDurationTracker):
2243         * page/FocusController.cpp:
2244         (WebCore::FocusController::setFocusedElement):
2245         (WebCore::FocusController::timeSinceFocusWasSet const):
2246         * page/FocusController.h:
2247         * page/FrameView.cpp:
2248         (WebCore::FrameView::reset):
2249         (WebCore::FrameView::willPaintContents):
2250         (WebCore::FrameView::didPaintContents):
2251         * page/FrameView.h:
2252         * page/animation/AnimationBase.cpp:
2253         (WebCore::AnimationBase::freezeAtTime):
2254         (WebCore::AnimationBase::beginAnimationUpdateTime const):
2255         * page/animation/AnimationBase.h:
2256         (WebCore::AnimationBase::onAnimationStartResponse):
2257         * page/animation/CSSAnimationController.cpp:
2258         (WebCore::CSSAnimationControllerPrivate::beginAnimationUpdateTime):
2259         (WebCore::CSSAnimationControllerPrivate::receivedStartTimeResponse):
2260         (WebCore::CSSAnimationControllerPrivate::startTimeResponse):
2261         (WebCore::CSSAnimationController::notifyAnimationStarted):
2262         * page/animation/CSSAnimationController.h:
2263         * page/animation/CSSAnimationControllerPrivate.h:
2264         * page/mac/WheelEventDeltaFilterMac.h:
2265         * page/mac/WheelEventDeltaFilterMac.mm:
2266         (WebCore::WheelEventDeltaFilterMac::beginFilteringDeltas):
2267         (WebCore::WheelEventDeltaFilterMac::updateFromDelta):
2268         (WebCore::WheelEventDeltaFilterMac::endFilteringDeltas):
2269         * platform/ControlStates.h:
2270         (WebCore::ControlStates::timeSinceControlWasFocused const):
2271         (WebCore::ControlStates::setTimeSinceControlWasFocused):
2272         * platform/PlatformSpeechSynthesisUtterance.h:
2273         (WebCore::PlatformSpeechSynthesisUtterance::startTime const):
2274         (WebCore::PlatformSpeechSynthesisUtterance::setStartTime):
2275         * platform/gamepad/PlatformGamepad.h:
2276         (WebCore::PlatformGamepad::lastUpdateTime const):
2277         (WebCore::PlatformGamepad::connectTime const):
2278         (WebCore::PlatformGamepad::PlatformGamepad):
2279         * platform/gamepad/cocoa/GameControllerGamepad.mm:
2280         (WebCore::GameControllerGamepad::setupAsExtendedGamepad):
2281         (WebCore::GameControllerGamepad::setupAsGamepad):
2282         * platform/gamepad/mac/HIDGamepad.cpp:
2283         (WebCore::HIDGamepad::HIDGamepad):
2284         (WebCore::HIDGamepad::valueChanged):
2285         * platform/graphics/GraphicsLayer.cpp:
2286         (WebCore::GraphicsLayer::suspendAnimations):
2287         * platform/graphics/GraphicsLayer.h:
2288         * platform/graphics/GraphicsLayerClient.h:
2289         (WebCore::GraphicsLayerClient::notifyAnimationStarted):
2290         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2291         (WebCore::LayerClient::platformCALayerAnimationStarted):
2292         (WebCore::AVFWrapper::createImageForTimeInRect):
2293         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2294         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
2295         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
2296         * platform/graphics/ca/GraphicsLayerCA.cpp:
2297         (WebCore::GraphicsLayerCA::addAnimation):
2298         (WebCore::GraphicsLayerCA::pauseAnimation):
2299         (WebCore::GraphicsLayerCA::platformCALayerAnimationStarted):
2300         (WebCore::GraphicsLayerCA::setAnimationOnLayer):
2301         (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer):
2302         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
2303         (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
2304         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2305         * platform/graphics/ca/GraphicsLayerCA.h:
2306         (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation):
2307         (WebCore::GraphicsLayerCA::AnimationProcessingAction::AnimationProcessingAction):
2308         * platform/graphics/ca/LayerPool.cpp:
2309         (WebCore::LayerPool::LayerPool):
2310         (WebCore::LayerPool::addLayer):
2311         (WebCore::LayerPool::decayedCapacity const):
2312         (WebCore::LayerPool::pruneTimerFired):
2313         * platform/graphics/ca/LayerPool.h:
2314         * platform/graphics/ca/PlatformCAAnimation.h:
2315         * platform/graphics/ca/PlatformCALayer.h:
2316         * platform/graphics/ca/PlatformCALayerClient.h:
2317         (WebCore::PlatformCALayerClient::platformCALayerAnimationStarted):
2318         * platform/graphics/ca/TileGrid.cpp:
2319         (WebCore::TileGrid::revalidateTiles):
2320         (WebCore::TileGrid::startedNewCohort):
2321         (WebCore::TileGrid::TileCohortInfo::timeUntilExpiration):
2322         (WebCore::TileGrid::cohortRemovalTimerFired):
2323         * platform/graphics/ca/TileGrid.h:
2324         (WebCore::TileGrid::TileCohortInfo::TileCohortInfo):
2325         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2326         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2327         (mediaTimeToCurrentTime):
2328         (-[WebAnimationDelegate animationDidStart:]):
2329         (PlatformCALayerCocoa::animationStarted):
2330         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
2331         (WebCore::CACFLayerTreeHost::notifyAnimationsStarted):
2332         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2333         (PlatformCALayerWin::animationStarted):
2334         (PlatformCALayerWin::layerTreeAsString const):
2335         * platform/graphics/ca/win/PlatformCALayerWin.h:
2336         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2337         (WebCore::WebCoreDecompressionSession::decodeSample):
2338         * platform/graphics/texmap/BitmapTexturePool.cpp:
2339         (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
2340         * platform/graphics/texmap/BitmapTexturePool.h:
2341         (WebCore::BitmapTexturePool::Entry::markIsInUse):
2342         (WebCore::BitmapTexturePool::Entry::canBeReleased const):
2343         (): Deleted.
2344         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2345         (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
2346         (WebCore::GraphicsLayerTextureMapper::addAnimation):
2347         (WebCore::GraphicsLayerTextureMapper::pauseAnimation):
2348         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
2349         * platform/graphics/texmap/TextureMapperAnimation.cpp:
2350         (WebCore::TextureMapperAnimation::TextureMapperAnimation):
2351         (WebCore::TextureMapperAnimation::apply):
2352         (WebCore::TextureMapperAnimation::pause):
2353         (WebCore::TextureMapperAnimation::resume):
2354         (WebCore::TextureMapperAnimation::computeTotalRunningTime):
2355         (WebCore::TextureMapperAnimations::pause):
2356         (WebCore::TextureMapperAnimations::suspend):
2357         * platform/graphics/texmap/TextureMapperAnimation.h:
2358         (WebCore::TextureMapperAnimation::startTime const):
2359         (WebCore::TextureMapperAnimation::pauseTime const):
2360         * platform/graphics/texmap/TextureMapperFPSCounter.cpp:
2361         (WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
2362         (WebCore::TextureMapperFPSCounter::updateFPSAndDisplay):
2363         * platform/graphics/texmap/TextureMapperFPSCounter.h:
2364         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
2365         (WebCore::TextureMapperPlatformLayerBuffer::markUsed):
2366         (WebCore::TextureMapperPlatformLayerBuffer::lastUsedTime const):
2367         (): Deleted.
2368         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
2369         (WebCore::TextureMapperPlatformLayerProxy::releaseUnusedBuffersTimerFired):
2370         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2371         (WebCore::CoordinatedGraphicsLayer::addAnimation):
2372         (WebCore::CoordinatedGraphicsLayer::pauseAnimation):
2373         (WebCore::CoordinatedGraphicsLayer::suspendAnimations):
2374         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2375         * platform/mediastream/RealtimeMediaSource.h:
2376         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
2377         (WebCore::RealtimeOutgoingVideoSource::sendFrame):
2378         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp:
2379         (WebCore::LibWebRTCAudioModule::StartPlayoutOnAudioThread):
2380         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
2381         (WebCore::DisplayCaptureSourceCocoa::startProducingData):
2382         (WebCore::DisplayCaptureSourceCocoa::stopProducingData):
2383         (WebCore::DisplayCaptureSourceCocoa::elapsedTime):
2384         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
2385         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
2386         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
2387         (WebCore::MockRealtimeAudioSourceMac::render):
2388         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
2389         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
2390         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
2391         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
2392         (WebCore::ScreenDisplayCaptureSourceMac::sampleBufferFromPixelBuffer):
2393         (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable):
2394         * platform/mock/MockRealtimeAudioSource.cpp:
2395         (WebCore::MockRealtimeAudioSource::startProducingData):
2396         (WebCore::MockRealtimeAudioSource::stopProducingData):
2397         (WebCore::MockRealtimeAudioSource::elapsedTime):
2398         (WebCore::MockRealtimeAudioSource::tick):
2399         (WebCore::MockRealtimeAudioSource::delaySamples):
2400         * platform/mock/MockRealtimeAudioSource.h:
2401         (WebCore::MockRealtimeAudioSource::render):
2402         * platform/mock/MockRealtimeVideoSource.cpp:
2403         (WebCore::MockRealtimeVideoSource::startProducingData):
2404         (WebCore::MockRealtimeVideoSource::stopProducingData):
2405         (WebCore::MockRealtimeVideoSource::elapsedTime):
2406         (WebCore::MockRealtimeVideoSource::drawText):
2407         (WebCore::MockRealtimeVideoSource::delaySamples):
2408         (WebCore::MockRealtimeVideoSource::generateFrame):
2409         * platform/mock/MockRealtimeVideoSource.h:
2410         * platform/network/DNSResolveQueue.cpp:
2411         (WebCore::DNSResolveQueue::DNSResolveQueue):
2412         (WebCore::DNSResolveQueue::isUsingProxy):
2413         * platform/network/DNSResolveQueue.h:
2414         * rendering/RenderBoxModelObject.cpp:
2415         (WebCore::RenderBoxModelObject::suspendAnimations):
2416         * rendering/RenderBoxModelObject.h:
2417         * rendering/RenderElement.cpp:
2418         (WebCore::RenderElement::paintFocusRing):
2419         * rendering/RenderImage.cpp:
2420         (WebCore::RenderImage::paintAreaElementFocusRing):
2421         * rendering/RenderLayerBacking.cpp:
2422         (WebCore::RenderLayerBacking::notifyAnimationStarted):
2423         (WebCore::RenderLayerBacking::suspendAnimations):
2424         * rendering/RenderLayerBacking.h:
2425         * rendering/RenderLayerCompositor.cpp:
2426         (WebCore::RenderLayerCompositor::didPaintBacking):
2427         * rendering/RenderProgress.cpp:
2428         (WebCore::RenderProgress::RenderProgress):
2429         (WebCore::RenderProgress::animationProgress const):
2430         (WebCore::RenderProgress::updateAnimationState):
2431         * rendering/RenderProgress.h:
2432         * rendering/RenderTheme.cpp:
2433         (WebCore::RenderTheme::animationDurationForProgressBar const):
2434         * rendering/RenderTheme.h:
2435         * rendering/RenderThemeGtk.cpp:
2436         (WebCore::RenderThemeGtk::animationDurationForProgressBar const):
2437         * rendering/RenderThemeGtk.h:
2438         * rendering/RenderThemeIOS.h:
2439         * rendering/RenderThemeIOS.mm:
2440         (WebCore::RenderThemeIOS::animationDurationForProgressBar const):
2441         * rendering/RenderThemeMac.h:
2442         * rendering/RenderThemeMac.mm:
2443         (WebCore::RenderThemeMac::animationDurationForProgressBar const):
2444         * svg/animation/SMILTimeContainer.cpp:
2445         (WebCore::SMILTimeContainer::SMILTimeContainer):
2446         (WebCore::SMILTimeContainer::elapsed const):
2447         (WebCore::SMILTimeContainer::isActive const):
2448         (WebCore::SMILTimeContainer::isPaused const):
2449         (WebCore::SMILTimeContainer::isStarted const):
2450         (WebCore::SMILTimeContainer::begin):
2451         (WebCore::SMILTimeContainer::pause):
2452         (WebCore::SMILTimeContainer::resume):
2453         (WebCore::SMILTimeContainer::setElapsed):
2454         (WebCore::SMILTimeContainer::timerFired):
2455         * svg/animation/SMILTimeContainer.h:
2456         * testing/Internals.cpp:
2457         (WebCore::Internals::delayMediaStreamTrackSamples):
2458         * testing/MockGamepad.cpp:
2459         (WebCore::MockGamepad::MockGamepad):
2460         (WebCore::MockGamepad::updateDetails):
2461         (WebCore::MockGamepad::setAxisValue):
2462         (WebCore::MockGamepad::setButtonValue):
2463
2464 2018-03-02  Alejandro G. Castro  <alex@igalia.com>
2465
2466         Make LibWebRTCProvider port agnostic again after r215424
2467         https://bugs.webkit.org/show_bug.cgi?id=183080
2468
2469         Reviewed by Youenn Fablet.
2470
2471         In the r215424 commit the webRTCAvailable function started to use a function from the DARWIN platform,
2472         we have moved that code to the cocoa class and created a glib implementation that will be used in the future
2473         to implement the LibWebRTCProviderGlib class.
2474
2475         No new tests, this is a refactor.
2476
2477         * Sources.txt: Add the compilation of the new file.
2478         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Remove the webRTCAvailable function from this file.
2479         (WebCore::LibWebRTCProvider::create): We want to use this even when LIBWEBRTC is not used.
2480         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
2481         (WebCore::LibWebRTCProvider::webRTCAvailable): Moved the code from the LibWebRTCProvider class.
2482         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
2483         (WebCore::LibWebRTCProvider::webRTCAvailable): Add the glib implementation, basically true, we are always
2484         linking libwebrtc for the moment in these situations.
2485
2486 2018-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2487
2488         REGRESSION(r222843): [HarfBuzz] Combining enclosed keycap not correctly handled
2489         https://bugs.webkit.org/show_bug.cgi?id=183246
2490
2491         Reviewed by Michael Catanzaro.
2492
2493         We are not correctly handling the combining enclosed keycap since we switched to use
2494         ComplexTextController. This is because fontForCombiningCharacterSequence() always returns the font of the first
2495         character, without checking if that font can render the whole sequence or not. Before 222843, the shaper did
2496         that check when creating the text runs. In this case the sequence was split and a different font was used for the
2497         text and the mark. This patch makes fontForCombiningCharacterSequence() try to find a suitable font for the
2498         whole sequence, first looking at the CSS fallbacks and finally at system ones. The result is much better than
2499         the old one, because we use the same font for both the text and the mark. If there isn't any font to render the
2500         mark, then we fallback to use the first character font, since we will end up rendering the missing glyph
2501         character, it's better to use the same font than the first character one.
2502
2503         Test: fast/text/combining-enclosing-keycap.html
2504
2505         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
2506         (WebCore::FontCascade::fontForCombiningCharacterSequence const): Check if the first charatcer font can render
2507         the whole sequence, trying with fallbacks otherwise.
2508         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2509         (WebCore::Font::canRenderCombiningCharacterSequence const): Check if the font face has glyphs for the whole
2510         sequence not just the first character.
2511
2512 2018-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2513
2514         [FreeType] Remove FontPlatformData fallbacks
2515         https://bugs.webkit.org/show_bug.cgi?id=183210
2516
2517         Reviewed by Michael Catanzaro.
2518
2519         They are only used by FontCache::systemFallbackForCharacters() where a direct FcFontMatch provides the same
2520         or better results.
2521
2522         * platform/graphics/FontPlatformData.h: Remove fallbacks.
2523         * platform/graphics/freetype/FontCacheFreeType.cpp:
2524         (WebCore::FontCache::systemFallbackForCharacters): Use FcFontMatch() only.
2525         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2526         (WebCore::FontPlatformData::fallbacks): Removed.
2527
2528 2018-03-01  Commit Queue  <commit-queue@webkit.org>
2529
2530         Unreviewed, rolling out r229153.
2531         https://bugs.webkit.org/show_bug.cgi?id=183274
2532
2533         it is breaking imported/w3c/web-platform-tests/service-workers
2534         /service-worker/clients-matchall-exact-controller.https.html
2535         (Requested by youenn on #webkit).
2536
2537         Reverted changeset:
2538
2539         "Clients should register to StorageProcess with their service
2540         worker registration identifier"
2541         https://bugs.webkit.org/show_bug.cgi?id=182313
2542         https://trac.webkit.org/changeset/229153
2543
2544 2018-03-01  Youenn Fablet  <youenn@apple.com>
2545
2546         Clients should register to StorageProcess with their service worker registration identifier
2547         https://bugs.webkit.org/show_bug.cgi?id=182313
2548
2549         Reviewed by Chris Dumez.
2550
2551         No observable change of behavior in regular conditions.
2552         When service worker process crashes, the service worker identifiers sent by the WebProcess might be wrong
2553         and we will not be able to retrieve the registration from these identifiers.
2554         The storage process will be able to still process correctly messages coming from the WebProcess to register clients of the registration.
2555         Otherwise, there is a chance that WebProcess clients will not be added to the SWServerRegistration.m_clientsUsingRegistration maps.
2556
2557         * dom/Document.cpp:
2558         (WebCore::Document::setServiceWorkerConnection):
2559         * workers/service/SWClientConnection.h:
2560         * workers/service/server/SWServer.cpp:
2561         (WebCore::SWServer::registerServiceWorkerClient):
2562         * workers/service/server/SWServer.h:
2563
2564 2018-03-01  Youenn Fablet  <youenn@apple.com>
2565
2566         Add API test to validate setting of service worker and cache storage directories
2567         https://bugs.webkit.org/show_bug.cgi?id=182543
2568
2569         Reviewed by Chris Dumez.
2570
2571         Covered by API tests.
2572
2573         Add getters to service worker registration directory.
2574
2575         * testing/Internals.cpp:
2576         (WebCore::Internals::serviceWorkerRegistrationDirectory):
2577         * testing/Internals.h:
2578         * testing/Internals.idl:
2579         * workers/service/SWClientConnection.h:
2580         * workers/service/server/RegistrationDatabase.h:
2581         (WebCore::RegistrationDatabase::serviceWorkerRegistrationDirectory const):
2582         * workers/service/server/RegistrationStore.h:
2583         (WebCore::RegistrationStore::serviceWorkerRegistrationDirectory const):
2584         * workers/service/server/SWServer.h:
2585         (WebCore::SWServer::serviceWorkerRegistrationDirectory const):
2586
2587 2018-03-01  Youenn Fablet  <youenn@apple.com>
2588
2589         SWServer::removeClientServiceWorkerRegistration should not log an error if there is no registration
2590         https://bugs.webkit.org/show_bug.cgi?id=183248
2591
2592         Reviewed by Chris Dumez.
2593
2594         No change of behavior.
2595         Removed the error logging.
2596         As can be seen from running api and layout tests, a web process can ask a registration to be unregistered
2597         and by the time it goes to the StorageProcess, the registration is already cleared.
2598
2599         * workers/service/server/SWServer.cpp:
2600         (WebCore::SWServer::removeClientServiceWorkerRegistration):
2601
2602 2018-03-01  Daniel Bates  <dabates@apple.com>
2603
2604         CSS ::selection stroke-color and stroke-width are not applied to selected text in text fields
2605         and ::selection:window-inactive stroke-color and stroke-width are never applied
2606         https://bugs.webkit.org/show_bug.cgi?id=183178
2607
2608         Reviewed by David Hyatt.
2609
2610         This change fixes the following two issues:
2611             1. Properties stroke-color and stroke-width are not applied to the ::selection pseudo-
2612                element of text fields.
2613             2. Properties stroke-color and stroke-width are never applied to ::selection:window-inactive
2614                pseudo elements.
2615
2616         Currently when computing the paint styles for selected text we query the cached styles for
2617         the ::selection pseudo element on the renderer. Text fields are implemented using a User Agent
2618         shadow DOM. With regards to issue (1) the renderer queried was the inner most renderer for
2619         the text in the text field. But it should have been the shadow host renderer (i.e. the renderer
2620         for the <input>). With regards to issue (2) we cannot retrieve cached styles for the
2621         ::selection pseudo element because it can be effected by a pseudo class, :window-inactive,
2622         which matches when the page is deactivated (i.e. the window is in the background as the user
2623         made another window the frontmost window). Both of these issues are fixed by making use
2624         of RenderElement::selectionPseudoStyle().
2625
2626         Tests: fast/selectors/selection-window-inactive-stroke-color.html
2627                fast/selectors/selection-window-inactive-text-shadow.html
2628                fast/selectors/text-field-selection-stroke-color.html
2629                fast/selectors/text-field-selection-text-shadow.html
2630                fast/selectors/text-field-selection-window-inactive-stroke-color.html
2631                fast/selectors/text-field-selection-window-inactive-text-shadow.html
2632
2633         * rendering/RenderText.h:
2634         (WebCore::RenderText::selectionPseudoStyle const): Add a convenience function that turns
2635         around and calls the function of the same name on its parent.
2636         * rendering/TextPaintStyle.cpp:
2637         (WebCore::computeTextSelectionPaintStyle): Modified to use RenderText::selectionPseudoStyle()
2638         instead of directly querying for the cached styles for the ::selection pseudo element.
2639
2640 2018-03-01  Per Arne Vollan  <pvollan@apple.com>
2641
2642         Scrollbar preferences are ignored when the WebContent process doesn't have access to the WindowServer.
2643         https://bugs.webkit.org/show_bug.cgi?id=183231
2644         <rdar://problem/37793457>
2645
2646         Reviewed by Brent Fulgham.
2647
2648         When the WebContent process doesn't have access to the WindowServer, the scrollbars are always of the overlay type.
2649         The notification about scrollbar preferences is never received by the WebContent process when there is no
2650         WindowServer access. This can be fixed by adding an observer of scrollbar preferences in the UI process, and
2651         notifying the WebProcess about this by sending it a message. This message should also contain the preferred
2652         scrollbar type, since the call '[NSScroller preferredScrollerStyle]' will always return the overlay style when
2653         there is no WindowServer access.
2654
2655         No new tests, covered by existing tests.
2656
2657         * WebCore.xcodeproj/project.pbxproj:
2658         * platform/mac/NSScrollerImpDetails.h:
2659         * platform/mac/NSScrollerImpDetails.mm:
2660         (WebCore::ScrollerStyle::recommendedScrollerStyle):
2661         (WebCore::ScrollerStyle::setUseOverlayScrollbars):
2662         (WebCore::recommendedScrollerStyle): Deleted.
2663         * platform/mac/ScrollAnimatorMac.mm:
2664         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
2665         (WebCore::ScrollAnimatorMac::mouseEnteredScrollbar const):
2666         (WebCore::ScrollAnimatorMac::mouseExitedScrollbar const):
2667         (WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
2668         * platform/mac/ScrollbarThemeMac.mm:
2669         (WebCore::ScrollbarThemeMac::registerScrollbar):
2670         (WebCore::ScrollbarThemeMac::scrollbarThickness):
2671         (WebCore::ScrollbarThemeMac::usesOverlayScrollbarsChanged):
2672
2673 2018-03-01  Myles C. Maxfield  <mmaxfield@apple.com>
2674
2675         Temporarily enable user-installed-fonts everywhere until we can stop crashing on launch
2676         https://bugs.webkit.org/show_bug.cgi?id=183255
2677
2678         Unreviewed.
2679
2680         Tests are already disabled.
2681
2682         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2683
2684 2018-03-01  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2685
2686         [Curl] Split DNS cache expiration and connection timeout setting.
2687         https://bugs.webkit.org/show_bug.cgi?id=182979
2688
2689         It was mis-implemented and was named ambiguous name 'enableTimeout'.
2690         Implement each feature correctly.
2691
2692         Reviewed by Per Arne Vollan.
2693
2694         * platform/network/curl/CurlContext.cpp:
2695         (WebCore::EnvironmentVariableReader::read):
2696         (WebCore::EnvironmentVariableReader::defined):
2697         (WebCore::EnvironmentVariableReader::readAs):
2698         (WebCore::EnvironmentVariableReader::sscanTemplate):
2699         (WebCore::EnvironmentVariableReader::sscanTemplate<unsigned>):
2700         (WebCore::CurlContext::CurlContext):
2701         (WebCore::safeTimeValue):
2702         (WebCore::CurlHandle::setDnsCacheTimeout):
2703         (WebCore::CurlHandle::setConnectTimeout):
2704         (WebCore::CurlHandle::setTimeout):
2705         (WebCore::CurlHandle::enableTimeout): Deleted.
2706         * platform/network/curl/CurlContext.h:
2707         (WebCore::CurlContext::dnsCacheTimeout const):
2708         (WebCore::CurlContext::connectTimeout const):
2709         * platform/network/curl/CurlRequest.cpp:
2710         (WebCore::CurlRequest::setupTransfer):
2711
2712 2018-03-01  Zalan Bujtas  <zalan@apple.com>
2713
2714         Remove RenderElement::s_noLongerAffectsParentBlock
2715         https://bugs.webkit.org/show_bug.cgi?id=183196
2716         <rdar://problem/38030797>
2717
2718         Reviewed by Antti Koivisto.
2719
2720         Remove the hack to track floating/out-of-flow changes between styleWillChange and styleDidChange.
2721
2722         Covered by existing tests.
2723
2724         * rendering/RenderBlockFlow.cpp:
2725         (WebCore::RenderBlockFlow::styleDidChange):
2726         * rendering/RenderElement.cpp:
2727         (WebCore::RenderElement::styleWillChange):
2728         (WebCore::RenderElement::noLongerAffectsParentBlock const):
2729         (WebCore::RenderElement::styleDidChange):
2730         * rendering/RenderElement.h:
2731         (WebCore::RenderElement::noLongerAffectsParentBlock const): Deleted.
2732
2733 2018-03-01  Chris Dumez  <cdumez@apple.com>
2734
2735         imported/w3c/web-platform-tests/html/browsers/windows/browsing-context.html fails with async policy delegates
2736         https://bugs.webkit.org/show_bug.cgi?id=183225
2737         <rdar://problem/38003828>
2738
2739         Reviewed by Alex Christensen.
2740
2741         Bypass navigation policy check when loading about:blank. This does not seem necessary and it would not
2742         be Web-compatible for such policy check to happen synchronously. This is because an iframe without src
2743         or src="about:blank" should load synchronously as per HTML specification.
2744
2745         Test: http/wpt/html/browsers/windows/browsing-context.html
2746
2747         * loader/PolicyChecker.cpp:
2748         (WebCore::PolicyChecker::checkNavigationPolicy):
2749
2750 2018-03-01  Christopher Reid  <chris.reid@sony.com>
2751
2752         [Curl] Linker errors in some curl files due to missing exports
2753         https://bugs.webkit.org/show_bug.cgi?id=183238
2754
2755         Reviewed by Alex Christensen.
2756
2757         No new tests, no change in behavior.
2758
2759         Adding WEBCORE_EXPORT to functions now used in WebKit.
2760
2761         * platform/network/NetworkStorageSession.h:
2762         * platform/network/curl/CookieJarDB.h:
2763         * platform/network/curl/CurlContext.h:
2764
2765 2018-03-01  Commit Queue  <commit-queue@webkit.org>
2766
2767         Unreviewed, rolling out r229130.
2768         https://bugs.webkit.org/show_bug.cgi?id=183244
2769
2770         It breaks AppleWin compilation (Requested by alexg__ on
2771         #webkit).
2772
2773         Reverted changeset:
2774
2775         "Make LibWebRTCProvider port agnostic again after r215424"
2776         https://bugs.webkit.org/show_bug.cgi?id=183080
2777         https://trac.webkit.org/changeset/229130
2778
2779 2018-03-01  Alejandro G. Castro  <alex@igalia.com>
2780
2781         Make LibWebRTCProvider port agnostic again after r215424
2782         https://bugs.webkit.org/show_bug.cgi?id=183080
2783
2784         Reviewed by Youenn Fablet.
2785
2786         In the r215424 commit the webRTCAvailable function started to use a function from the DARWIN platform,
2787         we have moved that code to the cocoa class and created a glib implementation that will be used in the future
2788         to implement the LibWebRTCProviderGlib class.
2789
2790         No new tests, this is a refactor.
2791
2792         * Sources.txt: Add the compilation of the new file.
2793         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Remove the webRTCAvailable function from this file.
2794         (WebCore::LibWebRTCProvider::create): We want to use this even when LIBWEBRTC is not used.
2795         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
2796         (WebCore::LibWebRTCProvider::webRTCAvailable): Moved the code from the LibWebRTCProvider class.
2797         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
2798         (WebCore::LibWebRTCProvider::webRTCAvailable): Add the glib implementation, basically true, we are always
2799         linking libwebrtc for the moment in these situations.
2800
2801 2018-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2802
2803         [FreeType] Color emojis in WebKitGTK+ for great justice
2804         https://bugs.webkit.org/show_bug.cgi?id=183155
2805
2806         Reviewed by Michael Catanzaro.
2807
2808         Emojis are actually rendered if there's an emoji font installed in the system, but the size is so tiny that we
2809         don't see them. This is because for some reason the matrix we are getting from fontconfig contains a scale,
2810         which we don't expect. We only get the fontconfig matrix to apply rotations in case of oblique fonts, and then we
2811         always apply the scale for the computed pixel font size. Ignoring the fontconfig matrix scale fixes the issue.
2812
2813         * platform/graphics/freetype/FontCacheFreeType.cpp:
2814         (WebCore::fontWeightToFontconfigWeight): Moved here since it's now used by configurePatternForFontDescription().
2815         (WebCore::configurePatternForFontDescription): Helper function to apply the same options for fallback pattern.
2816         (WebCore::createFontConfigPatternForCharacters): Use configurePatternForFontDescription().
2817         (WebCore::findBestFontGivenFallbacks): Adopt the returned reference.
2818         (WebCore::FontCache::systemFallbackForCharacters): Clean it up.
2819         (WebCore::FontCache::createFontPlatformData): Use configurePatternForFontDescription().
2820         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2821         (WebCore::FontPlatformData::buildScaledFont): Ignore the scale returned by fontconfig matrix.
2822
2823 2018-02-28  Philippe Normand  <pnormand@igalia.com>
2824
2825         [GStreamer] text samples no longer processed
2826         https://bugs.webkit.org/show_bug.cgi?id=183212
2827
2828         Reviewed by Xabier Rodriguez-Calvar.
2829
2830         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2831         (WebCore::MediaPlayerPrivateGStreamer::newTextSample): Refer to
2832         track stream ID instead of (potentially) manually generated track
2833         ID stored as hashmap keys.
2834
2835 2018-02-28  Tim Horton  <timothy_horton@apple.com>
2836
2837         Push WTF_PLATFORM_IOS down into preprocessor.pm instead of trying to determine it inside
2838         https://bugs.webkit.org/show_bug.cgi?id=183193
2839
2840         Reviewed by Andy Estes.
2841
2842         * DerivedSources.make:
2843         * bindings/scripts/preprocessor.pm:
2844         (applyPreprocessor):
2845         Instead of trying to discern WTF_PLATFORM_IOS inside preprocessor.pm,
2846         push it down from DerivedSources.make. Also clean up DerivedSources.make
2847         a tiny bit by adding a variable, FEATURE_AND_PLATFORM_DEFINES, which
2848         contains both FEATURE_DEFINES and WTF_PLATFORM macros if needed.
2849
2850 2018-02-28  Nan Wang  <n_wang@apple.com>
2851
2852         AX: AOM: Dispatch accessiblesetvalue event
2853         https://bugs.webkit.org/show_bug.cgi?id=183021
2854         <rdar://problem/37764242>
2855
2856         Reviewed by Chris Fleizach.
2857
2858         Accessibility events.
2859         Spec: https://wicg.github.io/aom/spec/phase2.html
2860
2861         Added a new event type AccessibleSetValueEvent. 
2862
2863         Test: accessibility/mac/AOM-event-accessiblesetvalue.html
2864
2865         * CMakeLists.txt:
2866         * DerivedSources.make:
2867         * Sources.txt:
2868         * WebCore.xcodeproj/project.pbxproj:
2869         * accessibility/AccessibilityAllInOne.cpp:
2870         * accessibility/AccessibilityNodeObject.cpp:
2871         (WebCore::AccessibilityNodeObject::canSetValueAttribute const):
2872         * accessibility/AccessibilityObject.cpp:
2873         (WebCore::AccessibilityObject::press):
2874         (WebCore::AccessibilityObject::dispatchAccessibilityEvent):
2875         (WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent):
2876         * accessibility/AccessibilityObject.h:
2877         * accessibility/AccessibilityRenderObject.cpp:
2878         (WebCore::AccessibilityRenderObject::setValue):
2879         * accessibility/AccessibilityScrollbar.cpp:
2880         (WebCore::AccessibilityScrollbar::setValue):
2881         * accessibility/AccessibilitySlider.cpp:
2882         (WebCore::AccessibilitySlider::setValue):
2883         * accessibility/AccessibleSetValueEvent.cpp: Added.
2884         (WebCore::AccessibleSetValueEvent::AccessibleSetValueEvent):
2885         * accessibility/AccessibleSetValueEvent.h: Added.
2886         (WebCore::AccessibleSetValueEvent::create):
2887         (WebCore::AccessibleSetValueEvent::value const):
2888         * accessibility/AccessibleSetValueEvent.idl: Added.
2889         * dom/Element.idl:
2890         * dom/EventNames.h:
2891         * dom/EventNames.in:
2892
2893 2018-02-28  Chris Dumez  <cdumez@apple.com>
2894
2895         html/browsers/browsing-the-web/navigating-across-documents/006.html fails with async policy delegates
2896         https://bugs.webkit.org/show_bug.cgi?id=183168
2897         <rdar://problem/37951341>
2898
2899         Reviewed by Alex Christensen.
2900
2901         The test has an anchor element with both a 'click' event handler which submits a form
2902         and an href attribute. When clicking the link, as per specification, things happen in
2903         this order:
2904         1. We fire the click event at the anchor, which will execute the event handler and submit the form.
2905            Submitting the form *schedules* a navigation to 'click.html'.
2906         2. We execute the anchor activation code which *navigates* to 'href.html'. The navigation to
2907            'href' is supposed to cancel the pending navigation to 'click.html' and we should navigate
2908            to 'href.html', which is what the test asserts.
2909
2910         The issue for us is that we do not cancel pending navigations until after the navigation
2911         policy decision is made, when the provisional loads actually starts, in FrameLoader::provisionalLoadStarted().
2912         Because the policy decision for the navigation can now be made asynchronously, the NavigationScheduler
2913         timer can now fire while the decision is made and we'll submit the form, thus navigating to
2914         'click.html'.
2915
2916         To address the issue, we now cancel any pending navigations in FrameLoader::loadWithDocumentLoader(),
2917         *before* doing the policy check for the navigation.
2918
2919         Test: http/wpt/html/browsers/browsing-the-web/navigating-across-documents/006.html
2920
2921         * loader/FrameLoader.cpp:
2922         (WebCore::FrameLoader::loadWithDocumentLoader):
2923
2924 2018-02-28  John Wilander  <wilander@apple.com>
2925
2926         Add a second tier of prevalence to facilitate telemetry on very prevalent domains
2927         https://bugs.webkit.org/show_bug.cgi?id=183218
2928         <rdar://problem/37992388>
2929
2930         Reviewed by Brent Fulgham.
2931
2932         Test: http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics.html
2933
2934         * loader/ResourceLoadStatistics.cpp:
2935         (WebCore::ResourceLoadStatistics::encode const):
2936         (WebCore::ResourceLoadStatistics::decode):
2937         (WebCore::ResourceLoadStatistics::toString const):
2938         (WebCore::ResourceLoadStatistics::merge):
2939             Handling of the new boolean field isVeryPrevalentResource.
2940         * loader/ResourceLoadStatistics.h:
2941             Added the new boolean field isVeryPrevalentResource.
2942
2943 2018-02-28  Alex Christensen  <achristensen@webkit.org>
2944
2945         Reduce use of NetworkingContext in WebKit
2946         https://bugs.webkit.org/show_bug.cgi?id=183213
2947
2948         Reviewed by Brady Eidson.
2949
2950         NetworkingContext is intended to be used only with ResourceHandle, which is now only used in WebKitLegacy.
2951         Now that we don't use ResourceHandle in the WebProcess, everything that was done through the NetworkingContext
2952         can now be done a cleaner way with no change in behavior.
2953
2954         * loader/FrameLoader.cpp:
2955         (WebCore::FrameLoader::loadResourceSynchronously):
2956         * loader/LinkLoader.cpp:
2957         (WebCore::LinkLoader::loadLink):
2958         * loader/LoaderStrategy.h:
2959         * platform/network/ProxyServer.h:
2960         * platform/network/cf/ProxyServerCFNet.cpp:
2961         (WebCore::proxyServersForURL):
2962         * platform/network/curl/ProxyServerCurl.cpp:
2963         (WebCore::proxyServersForURL):
2964         * platform/network/soup/ProxyServerSoup.cpp:
2965         (WebCore::proxyServersForURL):
2966
2967 2018-02-28  Zalan Bujtas  <zalan@apple.com>
2968
2969         Remove RenderElement::s_affectsParentBlock
2970         https://bugs.webkit.org/show_bug.cgi?id=183187
2971         <rdar://problem/37961079>
2972
2973         Reviewed by Antti Koivisto.
2974
2975         Remove the hack to track floating/out-of-flow changes between styleWillChange and styleDidChange.
2976
2977         Covered by existing tests.
2978
2979         * rendering/RenderElement.cpp:
2980         (WebCore::RenderElement::styleWillChange):
2981         (WebCore::RenderElement::styleDidChange):
2982         * rendering/RenderElement.h:
2983
2984 2018-02-28  Antti Koivisto  <antti@apple.com>
2985
2986         Filter attribute selectors with selector filter
2987         https://bugs.webkit.org/show_bug.cgi?id=183200
2988
2989         Reviewed by Zalan Bujtas.
2990
2991         Currently selector filtering is done based on tags, classes and ids. We should include attributes too.
2992
2993         This patch adds filtering based on attribute name (but not content).
2994
2995         * css/SelectorFilter.cpp:
2996         (WebCore::isExcludedAttribute):
2997
2998             Ignore id, class and style attributes. First two are already handled and the last is common but is rarely
2999             used in selectors.
3000
3001         (WebCore::collectElementIdentifierHashes):
3002
3003             Collect attributes.
3004             Remove the unnecessary StyledElement casting.
3005
3006         (WebCore::collectSimpleSelectorHash):
3007
3008             Collect attribute selectors.
3009
3010         (WebCore::chooseSelectorHashesForFilter):
3011
3012             Pick attributes with high priority for the filter as it is likely a good signal.
3013
3014 2018-02-27  Sergio Villar Senin  <svillar@igalia.com>
3015
3016         [WebVR] Convert VRPlatformDisplayInfo into a class
3017         https://bugs.webkit.org/show_bug.cgi?id=183162
3018
3019         Reviewed by Žan Doberšek.
3020
3021         In preparation for further changes we're transforming the
3022         VRPlatformDisplayInfo into a class. All the members are now private
3023         and the class provides the needed getters/setters.
3024
3025         Apart from that VRDisplayCapabilityFlags is now just an unsigned and
3026         the different flags are defined in VRDisplayCapabilityFlag enum.
3027         Another cleanup was the removal of VRDisplayCapabilities.cpp as
3028         everything can be implemented in the header.
3029
3030         * Modules/webvr/VRDisplay.cpp:
3031         (WebCore::VRDisplay::VRDisplay):
3032         (WebCore::VRDisplay::isConnected const):
3033         (WebCore::VRDisplay::stageParameters const):
3034         * Modules/webvr/VRDisplayCapabilities.cpp: Removed.
3035         * Modules/webvr/VRDisplayCapabilities.h:
3036         (WebCore::VRDisplayCapabilities::hasPosition const):
3037         (WebCore::VRDisplayCapabilities::hasOrientation const):
3038         (WebCore::VRDisplayCapabilities::hasExternalDisplay const):
3039         (WebCore::VRDisplayCapabilities::canPresent const):
3040         (WebCore::VRDisplayCapabilities::maxLayer const):
3041         (WebCore::VRDisplayCapabilities::VRDisplayCapabilities):
3042         * Sources.txt:
3043         * platform/vr/VRPlatformDisplay.h:
3044         (WebCore::VRPlatformDisplayInfo::displayName const):
3045         (WebCore::VRPlatformDisplayInfo::setDisplayName):
3046         (WebCore::VRPlatformDisplayInfo::isConnected const):
3047         (WebCore::VRPlatformDisplayInfo::setIsConnected):
3048         (WebCore::VRPlatformDisplayInfo::isMounted const):
3049         (WebCore::VRPlatformDisplayInfo::setIsMounted):
3050         (WebCore::VRPlatformDisplayInfo::capabilityFlags const):
3051         (WebCore::VRPlatformDisplayInfo::setCapabilityFlags):
3052         (WebCore::VRPlatformDisplayInfo::displayIdentifier const):
3053         (WebCore::VRPlatformDisplayInfo::setDisplayIdentifier):
3054         (WebCore::VRPlatformDisplayInfo::eyeTranslation const):
3055         (WebCore::VRPlatformDisplayInfo::setEyeTranslation):
3056         (WebCore::VRPlatformDisplayInfo::eyeFieldOfView const):
3057         (WebCore::VRPlatformDisplayInfo::setEyeFieldOfView):
3058         (WebCore::VRPlatformDisplayInfo::renderSize const):
3059         (WebCore::VRPlatformDisplayInfo::setRenderSize):
3060         (WebCore::VRPlatformDisplayInfo::setPlayAreaBounds):
3061         (WebCore::VRPlatformDisplayInfo::playAreaBounds const):
3062         (WebCore::VRPlatformDisplayInfo::setSittingToStandingTransform):
3063         (WebCore::VRPlatformDisplayInfo::sittingToStandingTransform const):
3064         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
3065         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
3066         (WebCore::VRPlatformDisplayOpenVR::updateEyeParameters):
3067         (WebCore::VRPlatformDisplayOpenVR::updateStageParameters):
3068
3069 2018-02-27  Commit Queue  <commit-queue@webkit.org>
3070
3071         Unreviewed, rolling out r229060.
3072         https://bugs.webkit.org/show_bug.cgi?id=183198
3073
3074         This patch causes crashes on two SVG tests (Requested by fredw
3075         on #webkit).
3076
3077         Reverted changeset:
3078
3079         "Relayout frames after AsyncFrameScrolling or FrameFlattening
3080         option is changed"
3081         https://bugs.webkit.org/show_bug.cgi?id=183081
3082         https://trac.webkit.org/changeset/229060
3083
3084 2018-02-27  Youenn Fablet  <youenn@apple.com>
3085
3086         Do not trigger a service worker match in case of document redirection if it will be already served by AppCache
3087         https://bugs.webkit.org/show_bug.cgi?id=183185
3088         <rdar://problem/37693796>
3089
3090         Reviewed by Chris Dumez.
3091
3092         Disabling service worker matching in case there is a substitute data.
3093         Otherwise there is a risk for a double load, substitute data first and the new load
3094         triggered if matching a new registration.
3095         A future fix should first do service worker registration matching and if there is no registration query appcache.
3096
3097         Test: http/tests/appcache/main-resource-redirect-with-sw.html
3098
3099         * loader/DocumentLoader.cpp:
3100         (WebCore::DocumentLoader::redirectReceived):
3101
3102 2018-02-27  Tim Horton  <timothy_horton@apple.com>
3103
3104         Ensure target triple is propagated correctly to DerivedSources.make
3105         https://bugs.webkit.org/show_bug.cgi?id=183189
3106         <rdar://problem/37959694>
3107
3108         Reviewed by Dan Bernstein.
3109
3110         If we don't propagate the target triple, we can sometimes build with
3111         the wrong options enabled.
3112
3113         * Configurations/Base.xcconfig:
3114         Mentioning LLVM_TARGET_TRIPLE_SUFFIX here is required to get it to be available to scripts.
3115
3116         * DerivedSources.make:
3117         Propagate the target triple into our compiler invocations.
3118
3119 2018-02-27  Doug Russell  <doug@getitdownonpaper.com>
3120
3121         AX: Spell check and style attributes should be optional when fetching attributed string
3122         https://bugs.webkit.org/show_bug.cgi?id=160744
3123
3124         Reviewed by Chris Fleizach.
3125
3126         The overhead of fetching a spell checked attributed string via AX API is substantial. 
3127         In some cases on the order of 7/8 of the total time spent fetching the string.
3128
3129         This change introduces the new attribute AXAttributedStringForTextMarkerRangeWithOptions which accepts an NSDictionary as it's parameter with keys "AXTextMarkerRange" (AXTextMarkerRangeRef) and "AXSpellCheck" (NSNumber(BOOL)).
3130
3131         AXAttributedStringForTextMarkerRange will remain unchanged.
3132
3133         Tests: accessibility/mac/attributed-string/attributed-string-for-range-with-options.html
3134                accessibility/mac/attributed-string/attributed-string-for-range.html
3135
3136         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3137         (AXAttributedStringAppendText):
3138         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]):
3139         (-[WebAccessibilityObjectWrapper accessibilityParameterizedAttributeNames]):
3140         (-[WebAccessibilityObjectWrapper doAXAttributedStringForRange:]):
3141         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
3142         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]): Deleted.
3143
3144 2018-02-27  Daniel Bates  <dabates@apple.com>
3145
3146         Standardize terminology for marked text
3147         https://bugs.webkit.org/show_bug.cgi?id=180999
3148
3149         Reviewed by Zalan Bujtas.
3150
3151         The name MarkerSubrange is a misnomer for a data structure that associates a text subrange with a type
3152         and optional document marker. In particular, a MarkerSubrange may not always correspond to a document
3153         marker. For instance, selected text is represented using a MarkerSubrange that does not have a
3154         corresponding document marker. Let's standardize on the phrase "marked text" as the canonical way to
3155         describe these tagged text subranges.
3156
3157         * Sources.txt:
3158         * WebCore.xcodeproj/project.pbxproj:
3159         * rendering/InlineTextBox.cpp:
3160         (WebCore::InlineTextBox::localSelectionRect const):
3161         (WebCore::InlineTextBox::MarkedTextStyle::areBackgroundMarkedTextStylesEqual):
3162         (WebCore::InlineTextBox::MarkedTextStyle::areForegroundMarkedTextStylesEqual):
3163         (WebCore::InlineTextBox::MarkedTextStyle::areDecorationMarkedTextStylesEqual):
3164         (WebCore::InlineTextBox::StyledMarkedText::StyledMarkedText):
3165         (WebCore::createMarkedTextFromSelectionInBox):
3166         (WebCore::InlineTextBox::paint):
3167         (WebCore::InlineTextBox::paintPlatformDocumentMarkers):
3168         (WebCore::InlineTextBox::paintPlatformDocumentMarker):
3169         (WebCore::InlineTextBox::computeStyleForUnmarkedMarkedText const):
3170         (WebCore::InlineTextBox::resolveStyleForMarkedText):
3171         (WebCore::InlineTextBox::subdivideAndResolveStyle):
3172         (WebCore::InlineTextBox::coalesceAdjacentMarkedTexts):
3173         (WebCore::InlineTextBox::collectMarkedTextsForDraggedContent):
3174         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers):
3175         (WebCore::InlineTextBox::paintMarkedTexts):
3176         (WebCore::InlineTextBox::paintMarkedTextBackground):
3177         (WebCore::InlineTextBox::paintMarkedTextForeground):
3178         (WebCore::InlineTextBox::paintMarkedTextDecoration):
3179         (WebCore::InlineTextBox::paintCompositionBackground):
3180         (WebCore::InlineTextBox::MarkerSubrangeStyle::areBackgroundMarkerSubrangeStylesEqual): Deleted.
3181         (WebCore::InlineTextBox::MarkerSubrangeStyle::areForegroundMarkerSubrangeStylesEqual): Deleted.
3182         (WebCore::InlineTextBox::MarkerSubrangeStyle::areDecorationMarkerSubrangeStylesEqual): Deleted.
3183         (WebCore::InlineTextBox::StyledMarkerSubrange::StyledMarkerSubrange): Deleted.
3184         (WebCore::createMarkerSubrangeFromSelectionInBox): Deleted.
3185         (WebCore::InlineTextBox::computeStyleForUnmarkedMarkerSubrange const): Deleted.
3186         (WebCore::InlineTextBox::resolveStyleForSubrange): Deleted.
3187         (WebCore::InlineTextBox::coalesceAdjacentSubranges): Deleted.
3188         (WebCore::InlineTextBox::collectSubrangesForDraggedContent): Deleted.
3189         (WebCore::InlineTextBox::collectSubrangesForDocumentMarkers): Deleted.
3190         (WebCore::InlineTextBox::paintMarkerSubranges): Deleted.
3191         (WebCore::InlineTextBox::paintTextSubrangeBackground): Deleted.
3192         (WebCore::InlineTextBox::paintTextSubrangeForeground): Deleted.
3193         (WebCore::InlineTextBox::paintTextSubrangeDecoration): Deleted.
3194         * rendering/InlineTextBox.h:
3195         (WebCore::InlineTextBox::paintMarkedTexts):
3196         (WebCore::InlineTextBox::paintMarkerSubranges): Deleted.
3197         * rendering/MarkedText.cpp: Renamed from Source/WebCore/rendering/MarkerSubrange.cpp.
3198         (WebCore::subdivide):
3199         * rendering/MarkedText.h: Renamed from Source/WebCore/rendering/MarkerSubrange.h.
3200         (WebCore::MarkedText::MarkedText):
3201         (WebCore::MarkedText::isEmpty const):
3202         (WebCore::MarkedText::operator!= const):
3203         (WebCore::MarkedText::operator== const):
3204
3205 2018-02-27  Chris Dumez  <cdumez@apple.com>
3206
3207         Unreviewed, roll out r228430.
3208
3209         Roll out r228430 now that it is no longer needed after r228852.
3210
3211         No new tests, initial fix is still covered by WebKit.RespondToPolicyForNavigationResponseAsynchronously
3212         API test.
3213
3214         * loader/FrameLoader.cpp:
3215         (WebCore::FrameLoader::stopLoading):
3216         * loader/NavigationScheduler.cpp:
3217         (WebCore::NavigationScheduler::schedule):
3218
3219 2018-02-27  Antoine Quint  <graouts@apple.com>
3220
3221         [Web Animations] Correct implementation of pending tasks and promises
3222         https://bugs.webkit.org/show_bug.cgi?id=183161
3223
3224         Reviewed by Dean Jackson.
3225
3226         We had an incorrect implementation of the spec due to two misinterpretations.
3227
3228         The first one is about pending tasks (play and pause) which the spec says should
3229         be performed by "scheduling a task". In WebCore, this means using postTask() on a
3230         ScriptExecutionContext, such as Document. One of the big practical changes is that
3231         calling play() on an animation correctly sets its startTime to null (unresolved)
3232         immediately after the call to play() returns before setting it to a resolved value
3233         when the task is performed asynchronously. As a result, the playState is now always
3234         accurate.
3235
3236         The second one is about promises where new promises need to be created in certain
3237         situations called out by the spec. We used to call clear() on them, but this merely
3238         resets the fulfillment or rejection state of the promise, while the spec requires
3239         a different object to be returned for the promise. We now create our promises using
3240         makeUniqueRef<> when new promise objects are expected to be created.
3241
3242         This patch also corrects a few smaller bugs and spec compliant issues, called out
3243         below, related to pending tasks and promises uncovered while looking at relevant
3244         WPT tests.
3245
3246         * animation/DocumentTimeline.h: Expose the Document used to create this timeline such
3247         that it may be used by WebAnimation objects registered for this timeline when scheduling
3248         a task is required via postTask().
3249         * animation/WebAnimation.cpp:
3250         (WebCore::WebAnimation::WebAnimation):
3251         (WebCore::WebAnimation::setBindingsStartTime):
3252         (WebCore::WebAnimation::setCurrentTime):
3253         (WebCore::WebAnimation::cancel): Ensure the finished promise has not already been fulfilled
3254         before rejecting it. While the spec does not specifically call this out, a promise may not
3255         be rejected after being fulfilled, and we would hit an ASSERT if we didn't also check that
3256         it was in the correct pending state before attemping to reject it.
3257         (WebCore::WebAnimation::resetPendingTasks):
3258         (WebCore::WebAnimation::finish):
3259         (WebCore::WebAnimation::updateFinishedState):
3260         (WebCore::WebAnimation::finishNotificationSteps):
3261         (WebCore::WebAnimation::play): We used to only check for a pending pause task before canceling
3262         that task, but the spec says to check for either a pending pause or play task (ie. pending())
3263         and to cancel whichever is scheduled.
3264         (WebCore::WebAnimation::runPendingPlayTask): We were missing an assertion called out by the
3265         spec when running a pending task.
3266         (WebCore::WebAnimation::pause):
3267         (WebCore::WebAnimation::runPendingPauseTask):
3268         (WebCore::WebAnimation::updatePendingTasks): We now use postTask() on the animation's associated
3269         timeline's document to schedule pending tasks for which the criteria to run are met, ie. there
3270         is an associated timeline.
3271         * animation/WebAnimation.h:
3272
3273 2018-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3274
3275         [Extra zoom mode] Implement additional SPI for adjusting viewport shrink-to-fit behavior
3276         https://bugs.webkit.org/show_bug.cgi?id=183100
3277         <rdar://problem/37840987>
3278
3279         Reviewed by Tim Horton.
3280
3281         Introduce new customization options to ViewportConfiguration. The first is m_forceHorizontalShrinkToFit, which
3282         (when set to true) forces the viewport to scale using shrink-to-fit heuristics, regardless of whether
3283         "shrink-to-fit=no" is specified via viewport parameters or if content width did not exceed minimum layout size.
3284         The second is m_viewSize, which reflects the true size of the viewport. See WebKit ChangeLog for more details.
3285
3286         Tests: ViewportSizingTests.ForceShrinkToFitViewportOverridesViewportParameters
3287                ViewportSizingTests.ShrinkToFitViewportWithMinimumAllowedLayoutWidth
3288
3289         * page/ViewportConfiguration.cpp:
3290         (WebCore::ViewportConfiguration::ViewportConfiguration):
3291         (WebCore::ViewportConfiguration::setMinimumLayoutSize):
3292
3293         Plumb the real size of the view alongside the minimum layout size when updating the minimum layout size.
3294
3295         (WebCore::ViewportConfiguration::setForceHorizontalShrinkToFit):
3296         (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
3297
3298         Bail early and return true if forceHorizontalShrinkToFit is set. This forces shrink-to-fit even in cases where
3299         "shrink-to-fit" is set to "no", or content dimensions don't exceed layout dimensions.
3300
3301         (WebCore::ViewportConfiguration::initialScaleFromSize const):
3302
3303         Use view dimensions rather than minimum layout dimensions when computing the initial scale. Minimum layout size
3304         is no longer always equal to the size of the view if the client has specified a minimum allowed layout width. As
3305         such, when computing the initial scale, to ensure that the content (which was laid out using the minimum layout
3306         size) fits within the real viewport, we need to divide real viewport dimensions by content dimensions.
3307
3308         (WebCore::ViewportConfiguration::minimumScale const):
3309
3310         Similarly, use view size instead of minimum layout size to compute minimum scale.
3311
3312         (WebCore::ViewportConfiguration::description const):
3313         * page/ViewportConfiguration.h:
3314
3315 2018-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3316
3317         Unreviewed, fix the debug build after r228877.
3318
3319         In the case where CAN_DISALLOW_USER_INSTALLED_FONTS is enabled, this function doesn't return anything when
3320         allowUserInstalledFonts != AllowUserInstalledFonts::No. Fix the build by moving `return nullptr;` back out of
3321         the `#else`.
3322
3323         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3324         (WebCore::installedFontMandatoryAttributes):
3325
3326 2018-02-27  Milan Crha  <mcrha@redhat.com>
3327
3328         Potential privacy issue: DNS prefetching can be re-enabled
3329         https://bugs.webkit.org/show_bug.cgi?id=182924
3330
3331         Reviewed by Michael Catanzaro.
3332
3333         * dom/Document.cpp:
3334         (WebCore::Document::parseDNSPrefetchControlHeader):
3335
3336 2018-02-26  Antoine Quint  <graouts@apple.com>
3337
3338         [Web Animations] Implement the procedure to set the target effect of an animation
3339         https://bugs.webkit.org/show_bug.cgi?id=183146
3340
3341         Reviewed by Dean Jackson.
3342
3343         We only had a partial implementation of setEffect() and we now update it to cover the entire
3344         implementation as mandated by the spec. While this doesn't yield any WPT results changes, this
3345         patch will help getting a significant number of new PASS results when we get around to implement
3346         correct support for async procedures (pending pause/play tasks and promises) in the next patch.
3347
3348         * animation/WebAnimation.cpp:
3349         (WebCore::WebAnimation::setEffect):
3350
3351 2018-02-26  Antoine Quint  <graouts@apple.com>
3352
3353         [Web Animations] Update the playState implementation
3354         https://bugs.webkit.org/show_bug.cgi?id=183145
3355
3356         Reviewed by Dean Jackson.
3357
3358         The Web Animations spec has changed since we first implemented the playState property and the "pending"
3359         enum value has been dropped since then (there is a separate "pending" property which we also implement).
3360         We update our implementation to match the latest spec text. This does not change WPT test results a lot,
3361         but this patch will help getting a significant number of new PASS results when we get around to implementing
3362         correct support for async procedures (pending pause/play tasks and promises) in a couple of patches.
3363   
3364         * animation/WebAnimation.cpp:
3365         (WebCore::WebAnimation::playState const):
3366         * animation/WebAnimation.h:
3367         * animation/WebAnimation.idl:
3368
3369 2018-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3370
3371         Address post-review comment after r229049.
3372         https://bugs.webkit.org/show_bug.cgi?id=183142
3373
3374         Reviewed by Tim Horton.
3375
3376         Wrap a newly added string literal with ASCIILiteral.
3377
3378         * rendering/RenderThemeIOS.mm:
3379         (WebCore::RenderThemeIOS::extraDefaultStyleSheet):
3380
3381 2018-02-26  Mark Lam  <mark.lam@apple.com>
3382
3383         Modernize FINALIZE_CODE and peer macros to use __VA_ARGS__ arguments.
3384         https://bugs.webkit.org/show_bug.cgi?id=183159
3385         <rdar://problem/37930837>
3386
3387         Reviewed by Keith Miller.
3388
3389         No new tests needed because this is just a refactoring patch.
3390
3391         * cssjit/SelectorCompiler.cpp:
3392         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
3393
3394 2018-02-26  Dan Bernstein  <mitz@apple.com>
3395
3396         Removed references to files that were removed in r228912.
3397
3398         * WebCore.xcodeproj/project.pbxproj: Removed references to SourcesIOS.txt and SourcesMac.txt.
3399
3400 2018-02-26  Wenson Hsieh  <wenson_hsieh@apple.com>
3401
3402         [Extra zoom mode] Tweak UA stylesheet to improve legibility of rendered text
3403         https://bugs.webkit.org/show_bug.cgi?id=183142
3404         <rdar://problem/37912966>
3405
3406         Reviewed by Tim Horton.
3407
3408         Force text-size-adjust and hyphens to be always on in EXTRA_ZOOM_MODE. To accomplish this, we override the extra
3409         style sheet in RenderTheme to include these two style rules.
3410
3411         * rendering/RenderThemeIOS.h:
3412         * rendering/RenderThemeIOS.mm:
3413         (WebCore::RenderThemeIOS::extraDefaultStyleSheet):
3414
3415 2018-02-26  Don Olmstead  <don.olmstead@sony.com>
3416
3417         Fix WebCore includes within WebKitLegacy
3418         https://bugs.webkit.org/show_bug.cgi?id=183147
3419
3420         Reviewed by Tim Horton.
3421
3422         No new tests. No change in behavior.
3423
3424         * PlatformWin.cmake:
3425         * platform/win/GDIUtilities.h:
3426
3427 2018-02-26  Youenn Fablet  <youenn@apple.com>
3428
3429         Add some more release logging related to DocumentWriter::addData crash
3430         https://bugs.webkit.org/show_bug.cgi?id=183141
3431
3432         Reviewed by Chris Dumez.
3433
3434         No change of behavior.
3435         Add some additional release logging to verify whether DocumentWriter::begin was called and exited before updating its state.
3436
3437         * loader/DocumentLoader.cpp:
3438         (WebCore::DocumentLoader::commitData):
3439         * loader/DocumentWriter.cpp:
3440         (WebCore::DocumentWriter::begin):
3441         * loader/DocumentWriter.h:
3442
3443 2018-02-26  Antoine Quint  <graouts@apple.com>
3444
3445         [Web Animations] Implement the procedure to set the start time
3446         https://bugs.webkit.org/show_bug.cgi?id=183137
3447
3448         Reviewed by Dean Jackson.
3449
3450         Implement the procedure to set the start time as setBindingsStartTime() and use the setStartTime() method as
3451         an internal method to set the m_startTime instance variable and invalidate the timing model rather than run
3452         the entire procedure which should only be called when setting the "startTime" property through the JS API.
3453
3454         * animation/WebAnimation.cpp:
3455         (WebCore::WebAnimation::setTimeline):
3456         (WebCore::WebAnimation::setBindingsStartTime):
3457         (WebCore::WebAnimation::setStartTime):
3458         (WebCore::WebAnimation::silentlySetCurrentTime):
3459         (WebCore::WebAnimation::finish):
3460         (WebCore::WebAnimation::updateFinishedState):
3461         (WebCore::WebAnimation::runPendingPlayTask):
3462         (WebCore::WebAnimation::runPendingPauseTask):
3463
3464 2018-02-26  Christopher Reid  <chris.reid@sony.com>
3465
3466         [Curl] Cookies are not being added to the Cookie field in Request Headers
3467         https://bugs.webkit.org/show_bug.cgi?id=183095
3468
3469         Reviewed by Alex Christensen.
3470
3471         Populating the Cookie request header field now that cookies are no longer handled in libcurl.
3472
3473         * platform/network/curl/CookieJarCurlDatabase.cpp: Renaming the httpOnly variable as its actual use wasn't clear
3474         * platform/network/curl/ResourceHandleCurl.cpp:
3475
3476 2018-02-26  Antoine Quint  <graouts@apple.com>
3477
3478         [Web Animations] Ensure setting the hold time invalidates the timing model
3479         https://bugs.webkit.org/show_bug.cgi?id=183136
3480
3481         Reviewed by Dean Jackson.
3482
3483         We used to always set the m_holdTime member variable directly, but the computation of the currentTime
3484         depends on the value of m_holdTime, so setting the hold time should invalidate the timing model as well
3485         as setting the m_holdTime member variable. In this patch we add a new setHoldTime() private method that
3486         sets the member variable and invalidates the timing model.
3487
3488         * animation/WebAnimation.cpp:
3489         (WebCore::WebAnimation::setTimeline):
3490         (WebCore::WebAnimation::setHoldTime):
3491         (WebCore::WebAnimation::silentlySetCurrentTime):
3492         (WebCore::WebAnimation::setCurrentTime):
3493         (WebCore::WebAnimation::cancel):
3494         (WebCore::WebAnimation::finish):
3495         (WebCore::WebAnimation::updateFinishedState):
3496         (WebCore::WebAnimation::play):
3497         (WebCore::WebAnimation::runPendingPlayTask):
3498         (WebCore::WebAnimation::pause):
3499         (WebCore::WebAnimation::runPendingPauseTask):
3500         * animation/WebAnimation.h:
3501
3502 2018-02-26  Youenn Fablet  <youenn@apple.com>
3503
3504         MessagePort is not always destroyed in the right thread
3505         https://bugs.webkit.org/show_bug.cgi?id=183053
3506
3507         Reviewed by Chris Dumez.
3508
3509         Make existingMessagePortForIdentifier take a lambda so that we hold the lock until there
3510         is no longer a need to keep the MessagePort around.
3511         This is very time sensitive and does not happen a lot when running WPT tests.
3512
3513         Update existing call sites to pass a lambda.
3514
3515         * dom/MessagePort.cpp:
3516         (WebCore::MessagePort::existingMessagePortForIdentifier):
3517         * dom/MessagePort.h:
3518         * dom/messageports/MessagePortChannelProviderImpl.cpp:
3519         (WebCore::MessagePortChannelProviderImpl::postMessageToRemote):
3520         (WebCore::MessagePortChannelProviderImpl::checkProcessLocalPortForActivity):
3521
3522 2018-02-26  Commit Queue  <commit-queue@webkit.org>
3523
3524         Unreviewed, rolling out r226745.
3525         https://bugs.webkit.org/show_bug.cgi?id=183132
3526
3527         This is breaking some websites (Requested by youenn on
3528         #webkit).
3529
3530         Reverted changeset:
3531
3532         "Use no-cache fetch mode when loading main documents with
3533         location.reload()"
3534         https://bugs.webkit.org/show_bug.cgi?id=181285
3535         https://trac.webkit.org/changeset/226745
3536
3537 2018-02-26  Philippe Normand  <pnormand@igalia.com>
3538
3539         Unreviewed, USE_GSTREAMER_PLAYBIN3 build fix.
3540
3541         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3542         There is no such ENABLE_GSTREAMER_PLAYBIN3.
3543
3544 2018-02-26  Philippe Normand  <pnormand@igalia.com>
3545
3546         Unreviewed, manual rollout of r228866 causing EGL_BAD_CONTEXT errors
3547
3548         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3549         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
3550         Create an EGL display, even in Wayland.
3551
3552 2018-02-21  Sergio Villar Senin  <svillar@igalia.com>
3553
3554         [WebVR][OpenVR] Retrieve displayId and the z-depth of eye view frustum
3555         https://bugs.webkit.org/show_bug.cgi?id=182999
3556
3557         Reviewed by Žan Doberšek.
3558
3559         Retrieve the z-depth of the eye view frustum and the HMD unique id.
3560         The unique identifier is generated by the VRPlatormManager whereas
3561         we use the default values from the spec for the z-depth (those can
3562         be changed by applications later via JavaScript).
3563
3564         Once this lands the only remaining data to be retrieved from VR
3565         backends for VRDisplay is the pose (getPose() call) and the frame
3566         data (getFrameData() call).
3567
3568         * Modules/webvr/VRDisplay.cpp:
3569         (WebCore::VRDisplay::VRDisplay):
3570         (WebCore::VRDisplay::displayId const): Deleted.
3571         (WebCore::VRDisplay::displayName const): Deleted.
3572         (WebCore::VRDisplay::depthNear const): Deleted.
3573         (WebCore::VRDisplay::setDepthNear): Deleted.
3574         (WebCore::VRDisplay::depthFar const): Deleted.
3575         (WebCore::VRDisplay::setDepthFar): Deleted.
3576         * Modules/webvr/VRDisplay.h:
3577         (WebCore::VRDisplay::displayId const): Moved implementation from
3578         source file.
3579         (WebCore::VRDisplay::displayName const): Ditto.
3580         (WebCore::VRDisplay::depthNear const):
3581         (WebCore::VRDisplay::setDepthNear):
3582         (WebCore::VRDisplay::depthFar const):
3583         (WebCore::VRDisplay::setDepthFar):
3584         * platform/vr/VRManager.cpp:
3585         (WebCore::VRManager::generateUniqueDisplayIdentifier):
3586         * platform/vr/VRManager.h:
3587         * platform/vr/VRPlatformDisplay.h:
3588         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
3589         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
3590
3591 2018-02-26  Charlie Turner  <cturner@igalia.com>
3592
3593         Fix build error with !LOG_DISABLED
3594         https://bugs.webkit.org/show_bug.cgi?id=183049
3595
3596         Reviewed by Philippe Normand.
3597
3598         The following error message was being reported when doing a
3599         release build with -DLOG_DISABLED=0:
3600
3601         ../../Source/WebCore/dom/messageports/MessagePortChannel.cpp: In member function ‘void WebCore::MessagePortChannel::entanglePortWithProcess(const WebCore::MessagePortIdentifier&, WebCore::ProcessIdentifier)’:
3602 ../../Source/WebCore/dom/messageports/MessagePortChannel.cpp:85:111: error: ‘logString’ was not declared in this scope
3603      LOG(MessagePorts, "MessagePortChannel %s (%p) entangling port %s (that port has %zu messages available)", logString().utf8().data(), this, port.logString().utf8().data(), m_pendingMessages[i].size());
3604
3605         Other uses of logString are guarded by !LOG_DISABLED rather than
3606         NDEBUG, which was the cause of this issue.
3607
3608         * dom/messageports/MessagePortChannel.h: Guard using !LOG_DISABLED
3609         rather than NDEBUG.
3610
3611 2018-02-26  Carlos Garcia Campos  <cgarcia@igalia.com>
3612
3613         [GStreamer] User current executable name instead of g_get_prgname() for gst_init
3614         https://bugs.webkit.org/show_bug.cgi?id=183119
3615
3616         Reviewed by Philippe Normand.
3617
3618         g_get_prgname() is only set for programs using GOptionContext, calling gtk_init or explicitly calling
3619         g_set_prgname(). Use WTF::getCurrentExecutableName() instead.
3620
3621         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
3622         (WebCore::initializeGStreamer):
3623
3624 2018-02-25  Wenson Hsieh  <wenson_hsieh@apple.com>
3625
3626         [Extra zoom mode] Disable downloadable binary fonts by default
3627         https://bugs.webkit.org/show_bug.cgi?id=183102
3628         <rdar://problem/37860699>
3629
3630         Reviewed by Tim Horton.
3631
3632         Disable downloadable binary fonts by default in extra zoom mode by making the initial value of
3633         `downloadableBinaryFontsEnabled` conditional. Layout tests are not possible at this time; test to be added once
3634         layout test support is in place.
3635
3636         * page/Settings.yaml:
3637         * page/SettingsBase.cpp:
3638         (WebCore::SettingsBase::defaultDownloadableBinaryFontsEnabled):
3639         * page/SettingsBase.h:
3640
3641 2018-02-25  Chris Dumez  <cdumez@apple.com>
3642
3643         Service workers do not work well inside Web.app
3644         https://bugs.webkit.org/show_bug.cgi?id=183105
3645         <rdar://problem/37864140>
3646
3647         Reviewed by Youenn Fablet.
3648
3649         SessionID::defaultSessionID() was hardcoded in the ServiceWorkerThread constructor
3650         instead of using the sessionID of the SWServer that created the service worker thread.
3651         As a result, when the Service Worker would establish a SWClientConnection to the
3652         server, it would use the wrong sessionID and would end up using a different SWServer
3653         (Since we have a different SWServer instance per sessionID). As a result,
3654         ServiceWorkerRegistration / ServiceWorker objects inside the service worker would not
3655         be kept in sync with the server (since they registered themselves with the wrong
3656         SWServer).
3657
3658         Covered by new API test.
3659
3660         * workers/service/ServiceWorkerContextData.cpp:
3661         (WebCore::ServiceWorkerContextData::isolatedCopy const):
3662         * workers/service/ServiceWorkerContextData.h:
3663         (WebCore::ServiceWorkerContextData::encode const):
3664         (WebCore::ServiceWorkerContextData::decode):
3665         * workers/service/context/ServiceWorkerThread.cpp:
3666         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
3667         * workers/service/context/ServiceWorkerThreadProxy.cpp:
3668         (WebCore::createPageForServiceWorker):
3669         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
3670         * workers/service/server/RegistrationDatabase.cpp:
3671         (WebCore::RegistrationDatabase::importRecords):
3672         * workers/service/server/RegistrationStore.h:
3673         (WebCore::RegistrationStore::server):
3674         * workers/service/server/SWServer.cpp:
3675         (WebCore::SWServer::updateWorker):
3676         * workers/service/server/SWServerWorker.cpp:
3677         (WebCore::SWServerWorker::contextData const):
3678
3679 2018-02-24  Fujii Hironori  <Hironori.Fujii@sony.com>
3680
3681         Null-dereference of the second argument `resource` of DocumentLoader::scheduleSubstituteResourceLoad
3682         https://bugs.webkit.org/show_bug.cgi?id=182920
3683
3684         Reviewed by Darin Adler.
3685
3686         A test case
3687         imported/w3c/web-platform-tests/html/browsers/offline/appcache/workers/appcache-worker.html
3688         always crashes due to a null-dereference if compiled and optimized
3689         by GCC 7.2. The second argument `resource` of
3690         DocumentLoader::scheduleSubstituteResourceLoad can be null if the
3691         resource can't be found in cache. I guess GCC optimizes inline
3692         HashMap::add based on assuming the `resource` never becomes null
3693         because its type is SubstituteResource&.
3694
3695         This changes introduces a new method
3696         DocumentLoader::scheduleCannotShowURLError because it looks tricky
3697         to pass a nullptr to the second argument of
3698         scheduleSubstituteResourceLoad.
3699
3700         No new tests (Covered by existing tests).
3701
3702         * loader/DocumentLoader.cpp:
3703         (WebCore::DocumentLoader::scheduleCannotShowURLError): Added a new method.
3704         * loader/DocumentLoader.h:
3705         * loader/appcache/ApplicationCacheHost.cpp:
3706         (WebCore::ApplicationCacheHost::maybeLoadResource):
3707         Call scheduleCannotShowURLError if the resource not found in the appcache.
3708
3709 2018-02-17  Darin Adler  <darin@apple.com>
3710
3711         Prepare for ExtendedColor changes (first step)
3712         https://bugs.webkit.org/show_bug.cgi?id=182904
3713
3714         Reviewed by Sam Weinig.
3715
3716         * css/CSSValuePool.cpp:
3717         (WebCore::CSSValuePool::createColorValue): Use HashMap::ensure.
3718         (WebCore::CSSValuePool::createFontFamilyValue): Ditto.
3719         (WebCore::CSSValuePool::createFontFaceValue): Ditto.
3720
3721         * css/parser/CSSParserFastPaths.cpp:
3722         (WebCore::CSSParserFastPaths::maybeParseValue): Tightened up
3723         the logic a bit.
3724
3725         * html/canvas/CanvasRenderingContext2D.cpp: Removed many unneeded includes.
3726
3727         * inspector/InspectorCanvas.cpp:
3728         (WebCore::InspectorCanvas::recordAction): Updated for Ref instead of
3729         RefPtr and to use move semantics.
3730         (WebCore::buildArrayForAffineTransform): Return Ref instead of RefPtr.
3731         (WebCore::buildArrayForVector): Ditto.
3732         (WebCore::InspectorCanvas::buildInitialState): Ditto. Also use auto more.
3733         (WebCore::InspectorCanvas::buildAction): Ditto.
3734         (WebCore::InspectorCanvas::buildArrayForCanvasGradient): Ditto.
3735         (WebCore::InspectorCanvas::buildArrayForCanvasPattern): Ditto.
3736         (WebCore::InspectorCanvas::buildArrayForImageData): Ditto.
3737         * inspector/InspectorCanvas.h: Updated for the above. Also us "using" instead
3738         of typedef and removed unneeded ErrorString typedef and some includes.
3739
3740         * page/DragController.cpp:
3741         (WebCore::DragController::concludeEditDrag): Use auto and Ref.
3742
3743         * platform/DragData.h: Used pragma once and reorganized includes a bit.
3744
3745         * platform/graphics/ImageFrame.h:
3746         (WebCore::ImageFrame::frameBytes const): Use uint32_t instead of RGBA32 to
3747         prepare for removal of the RGBA32 type coming in a future patch.
3748         * platform/graphics/ImageSource.cpp:
3749         (WebCore::ImageSource::cacheNativeImageAtIndex): Ditto.
3750         (WebCore::ImageSource::canUseAsyncDecoding): Ditto.
3751
3752         * platform/graphics/cocoa/GraphicsContextCocoa.mm: Tweaked #if for Mac-only
3753         code to use PLATFORM(MAC) to be easier to read.
3754         (WebCore::GraphicsContext::focusRingColor): Use sRGBColorSpaceRef instead of
3755         calling CGColorSpaceCreateWithName each time.
3756
3757         * platform/graphics/texmap/TextureMapperFPSCounter.cpp: Added include needed
3758         now that it was removed from some header.
3759
3760         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h: Use uint32_t
3761         instead of RGBA32 to prepare for removal of the RGBA32 type coming in a future patch.
3762         * platform/image-decoders/ScalableImageDecoder.cpp:
3763         (WebCore::ScalableImageDecoder::frameBytesAtIndex const): Ditto.
3764         * platform/image-decoders/cairo/ImageBackingStoreCairo.cpp:
3765         (WebCore::ImageBackingStore::image const): Ditto.
3766         * platform/image-decoders/gif/GIFImageDecoder.cpp:
3767         (WebCore::GIFImageDecoder::haveDecodedRow): Ditto.
3768         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
3769         (WebCore::setPixel): Ditto.
3770         (WebCore::JPEGImageDecoder::outputScanlines): Ditto.
3771         * platform/image-decoders/png/PNGImageDecoder.cpp:
3772         (WebCore::PNGImageDecoder::rowAvailable): Ditto.
3773         (WebCore::PNGImageDecoder::frameComplete): Ditto.
3774         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
3775         (WebCore::WEBPImageDecoder::decodeFrame): Ditto.
3776         (WebCore::WEBPImageDecoder::applyPostProcessing): Ditto.
3777
3778         * platform/mac/PlatformPasteboardMac.mm:
3779         (WebCore::PlatformPasteboard::color): Added comments.
3780
3781         * rendering/EllipsisBox.cpp:
3782         (WebCore::EllipsisBox::paintSelection): Use Color::isVisible.
3783
3784 2018-02-23  Chris Dumez  <cdumez@apple.com>
3785
3786         Crash under SchemeRegistry::shouldTreatURLSchemeAsLocal(WTF::String const&)
3787         https://bugs.webkit.org/show_bug.cgi?id=183066
3788         <rdar://problem/37804111>
3789
3790         Reviewed by Ryosuke Niwa.
3791
3792         SecurityOrigin objects are constructed on various threads. However, someone added a
3793         shouldTreatAsPotentiallyTrustworthy() call to the SecurityOrigin constructor which
3794         was not thread safe. This is because this function relies on SchemeRegistry::shouldTreatURLSchemeAsSecure()
3795         and SchemeRegistry::shouldTreatURLSchemeAsLocal() which were relying on global static HashMaps without
3796         locks.
3797
3798         Update SecurityOrigin to initialize m_isPotentiallyTrustworthy lazily, to avoid paying
3799         initialization cost in the constructor. This is only queries by SecurityContext::isSecureContext().
3800
3801         Make SchemeRegistry::shouldTreatURLSchemeAsLocal() and SchemeRegistry::shouldTreatURLSchemeAsSecure()
3802         thread-safe, since they are needed to initialize SecurityOrigin::m_isPotentiallyTrustworthy from
3803         various threads.
3804
3805         SchemeRegistry::shouldTreatURLSchemeAsSecure() is only called from SecurityOrigin (which requires
3806         thread-safety), and getUserMedia() which is not hot code so the extra locking there should not
3807         be an issue.
3808
3809         SchemeRegistry::shouldTreatURLSchemeAsLocal() is called from SecurityOrigin (which requires thread-
3810         safety). It is also called from isQuickLookPreviewURL(), MHTMLArchive::create(), Page::userStyleSheetLocationChanged(),
3811         isRemoteWebArchive() and HTMLPlugInImageElement. All these are not hot code so I do not think
3812         we need a fast path.
3813
3814         * page/SecurityOrigin.cpp:
3815         (WebCore::isLoopbackIPAddress):
3816         (WebCore::shouldTreatAsPotentiallyTrustworthy):
3817         (WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
3818         (WebCore::SecurityOrigin::isLocalHostOrLoopbackIPAddress):
3819         * page/SecurityOrigin.h:
3820         * platform/SchemeRegistry.cpp:
3821         (WebCore::localURLSchemesLock):
3822         (WebCore::localURLSchemes):
3823         (WebCore::secureSchemesLock):
3824         (WebCore::secureSchemes):
3825         (WebCore::SchemeRegistry::registerURLSchemeAsLocal):
3826         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
3827         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal):
3828         (WebCore::SchemeRegistry::registerURLSchemeAsSecure):
3829         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure):
3830         * platform/SchemeRegistry.h:
3831
3832 2018-02-23  Christopher Reid  <chris.reid@sony.com>
3833
3834         [Curl] Cookie Database files are wrongfully getting deleted when the database is opened
3835         https://bugs.webkit.org/show_bug.cgi?id=183051
3836
3837         Reviewed by Per Arne Vollan.
3838
3839         The file stat logic was backwards causing a wrongful detection of database corruption.
3840         Fixed the logic and abstracted these calls to use FileSystem.
3841
3842         * platform/network/curl/CookieJarDB.cpp:
3843
3844 2018-02-23  Zalan Bujtas  <zalan@apple.com>
3845
3846         [RenderTreeBuilder] Make RenderTreeBuilder::* classes WTF_MAKE_FAST_ALLOCATED
3847         https://bugs.webkit.org/show_bug.cgi?id=183084
3848         <rdar://problem/37828706>
3849
3850         Reviewed by Antti Koivisto.
3851
3852         * rendering/updating/RenderTreeBuilderBlock.h:
3853         * rendering/updating/RenderTreeBuilderBlockFlow.h:
3854         * rendering/updating/RenderTreeBuilderContinuation.h:
3855         * rendering/updating/RenderTreeBuilderFirstLetter.h:
3856         * rendering/updating/RenderTreeBuilderFormControls.h:
3857         * rendering/updating/RenderTreeBuilderFullScreen.h:
3858         * rendering/updating/RenderTreeBuilderInline.h:
3859         * rendering/updating/RenderTreeBuilderList.h:
3860         * rendering/updating/RenderTreeBuilderMathML.h:
3861         * rendering/updating/RenderTreeBuilderMultiColumn.h:
3862         * rendering/updating/RenderTreeBuilderRuby.h:
3863         * rendering/updating/RenderTreeBuilderSVG.h:
3864         * rendering/updating/RenderTreeBuilderTable.h:
3865         * rendering/updating/RenderTreeUpdaterGeneratedContent.h:
3866
3867 2018-02-23  Zalan Bujtas  <zalan@apple.com>
3868
3869         [RenderTreeBuilder] Move RenderFullScreen::createPlaceholder to RenderTreeBuilder
3870         https://bugs.webkit.org/show_bug.cgi?id=183027
3871         <rdar://problem/37773058>
3872
3873         Reviewed by Antti Koivisto.
3874
3875         No change in functionality.
3876
3877         * dom/Document.cpp:
3878         (WebCore::Document::setFullScreenRenderer):
3879         * dom/Document.h:
3880         * rendering/RenderFullScreen.cpp:
3881         (WebCore::RenderFullScreenPlaceholder::RenderFullScreenPlaceholder):
3882         (WebCore::RenderFullScreenPlaceholder::isRenderFullScreenPlaceholder const):
3883         (WebCore::RenderFullScreen::wrapNewRenderer):
3884         (WebCore::RenderFullScreen::wrapExistingRenderer):
3885         (): Deleted.
3886         (WebCore::RenderFullScreen::createPlaceholder): Deleted.
3887         * rendering/RenderFullScreen.h:
3888         * rendering/updating/RenderTreeBuilder.cpp:
3889         (WebCore::RenderTreeBuilder::createPlaceholderForFullScreen):
3890         * rendering/updating/RenderTreeBuilder.h:
3891         * rendering/updating/RenderTreeBuilderFullScreen.cpp:
3892         (WebCore::RenderTreeBuilder::FullScreen::createPlaceholder):
3893         * rendering/updating/RenderTreeBuilderFullScreen.h:
3894
3895 2018-02-23  Zalan Bujtas  <zalan@apple.com>
3896
3897         [RenderTreeBuilder] Add WARN_UNUSED_RETURN to detach()
3898         https://bugs.webkit.org/show_bug.cgi?id=183073
3899         <rdar://problem/37814585>
3900
3901         Reviewed by Antti Koivisto.
3902
3903         So that we don't destroy a renderer accidentally.
3904
3905         * rendering/updating/RenderTreeBuilderBlock.h:
3906         * rendering/updating/RenderTreeBuilderRuby.h:
3907         * rendering/updating/RenderTreeBuilderSVG.h:
3908
3909 2018-02-22  Antoine Quint  <graouts@apple.com>
3910
3911         REGRESSION (r228445): A big pause button shows over YouTube videos if you tap "Tap To Unmute" on iOS
3912         https://bugs.webkit.org/show_bug.cgi?id=183074
3913         <rdar://problem/37747028>
3914
3915         Reviewed by Eric Carlson.
3916
3917         Test: media/modern-media-controls/start-support/start-support-disable-controls-and-re-enable-post-play.html
3918
3919         In the fix for webkit.org/b/182668, we made it so that when the "controls" attribute is absent from a media
3920         element we stop listening to the bulk of media events and prevent controls from updating any DOM properties
3921         so as to minimize the amount of CPU usage by the Web process.
3922
3923         An unfortunate side effect was that, if the media controls were disabled at the time the video starts playing,
3924         the StartSupport class would thus not catch the "play" event and would not be able to set the "hasPlayed"
3925         property to "true" on the MediaController, which would then prevent the _shouldShowStartButton() from returning
3926         "false". As a result, if the "controls" attribute was turned back on after the media started playing, they
3927         would default to showing the start button, which would be then in the play state, ie. showing the pause icon.
3928
3929         We now set the "hasPlayed" property in the "play" event handler on MediaController, which is always registered
3930         regardless of the "controls" attribute setting. We also ensure we invalidate the "showStartButton" property on
3931         the media controls when StartSupport is enabled, which is the case when the "controls" attribute is toggled back
3932         to "true" from a previous "false" value.
3933
3934         * Modules/modern-media-controls/media/media-controller.js:
3935         (MediaController.prototype.handleEvent):
3936         * Modules/modern-media-controls/media/start-support.js:
3937         (StartSupport):
3938         (StartSupport.prototype.enable):
3939         (StartSupport.prototype.handleEvent):
3940         (StartSupport.prototype._updateShowsStartButton):
3941
3942 2018-02-23  Carlos Garcia Campos  <cgarcia@igalia.com>
3943
3944         [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
3945         https://bugs.webkit.org/show_bug.cgi?id=173655
3946         <rdar://problem/37706341>
3947
3948         Reviewed by Philippe Normand.
3949
3950         Do not assume gst is only used in the WebProcess, the MIMETypeRegistry also uses gst to get the list of
3951         supported media types. Move the code to extract gst options from the process command line to a helper function
3952         and use it in the UI process to pass the options to the WebProcess, but also in the current process when gst is
3953         initialized without providing options.
3954
3955         Fixes several unit tests that use MIMETypeRegistry in the UI process.
3956
3957         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
3958         (WebCore::extractGStreamerOptionsFromCommandLine): Helper to get the gst options from the current process
3959         command line.
3960         (WebCore::initializeGStreamer): Ensure this is called once. Get the gst options from the given vector or extract
3961         it from the command line if not provided.
3962         * platform/graphics/gstreamer/GStreamerUtilities.h:
3963         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3964         (WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements): Bring back the gst