Calling removeTrack with RTCRtpSender does not set SenderTrack to null
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-03-13  Youenn Fablet  <youenn@apple.com>
2
3         Calling removeTrack with RTCRtpSender does not set SenderTrack to null
4         https://bugs.webkit.org/show_bug.cgi?id=183308
5
6         Reviewed by Eric Carlson.
7
8         Covered by updated test.
9
10         * Modules/mediastream/RTCRtpSender.cpp:
11         (WebCore::RTCRtpSender::stop): Set track to null when being stopped i.e. removed.
12         * Modules/mediastream/RTCRtpSender.h:
13
14 2018-03-13  Youenn Fablet  <youenn@apple.com>
15
16         Changing link element rel attribute from preload to stylesheet should succeed loading the stylesheet
17         https://bugs.webkit.org/show_bug.cgi?id=183601
18         <rdar://problem/38309441>
19
20         Reviewed by Antti Koivisto.
21
22         Test: http/wpt/preload/change-link-rel-attribute.html
23
24         * loader/LinkPreloadResourceClients.h:
25         (WebCore::LinkPreloadResourceClient::clearResource): Remove the call to CachedResource::cancelLoad.
26         This call is expected to be called by ResourceLoader when cancelling the load from below CachedResource.
27         * loader/cache/CachedResource.cpp:
28         (WebCore::CachedResource::allClientsRemoved): In case of preload,
29         cancel the load if not finished when there is no more client attached to it.
30         * loader/cache/CachedResource.h:
31
32 2018-03-12  John Wilander  <wilander@apple.com>
33
34         Resource Load Statistics: Immediately forward cookie access at user interaction when there's an opener document
35         https://bugs.webkit.org/show_bug.cgi?id=183577
36         <rdar://problem/38266987>
37
38         Reviewed by Brent Fulgham.
39
40         Tested manually on live websites.
41         No new automated tests because of a bug in WebKitTestRunner:
42         https://bugs.webkit.org/show_bug.cgi?id=183578
43         The event sender triggers gestures in the opener rather than
44         in the popup.
45
46         * dom/Document.cpp:
47         (WebCore::Document::removedLastRef):
48             Clears the new m_primaryDomainsGrantedPageSpecificStorageAccess.
49         (WebCore::Document::hasGrantedPageSpecificStorageAccess):
50         (WebCore::Document::setHasGrantedPageSpecificStorageAccess):
51         * dom/Document.h:
52             Added member m_primaryDomainsGrantedPageSpecificStorageAccess
53             where we store domains that have been granted access.
54         * loader/ResourceLoadObserver.cpp:
55         (WebCore::ResourceLoadObserver::setGrantStorageAccessUnderOpenerCallback):
56         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
57             Now checks if there is a cross-origin opener and if so, immediately
58             grants cookie access to the popup's domain if it is partitioned or
59             blocked. 
60         * loader/ResourceLoadObserver.h:
61         * platform/network/NetworkStorageSession.h:
62             Added member m_pagesGrantedStorageAccess.
63         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
64         (WebCore::NetworkStorageSession::cookieStoragePartition const):
65         (WebCore::NetworkStorageSession::hasStorageAccess const):
66             Renamed from hasStorageAccessForFrame since the frameID now is optional.
67         (WebCore::NetworkStorageSession::grantStorageAccess):
68             Renamed from grantStorageAccessForFrame since the frameID now is optional.
69         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage):
70             Now removes the pageID entry in m_pagesGrantedStorageAccess.
71         (WebCore::NetworkStorageSession::hasStorageAccessForFrame const): Deleted.
72             Renamed since the frameID now is optional.
73         (WebCore::NetworkStorageSession::grantStorageAccessForFrame): Deleted.
74             Renamed since the frameID now is optional.
75
76 2018-03-12  Tim Horton  <timothy_horton@apple.com>
77
78         Stop using SDK conditionals to control feature definitions
79         https://bugs.webkit.org/show_bug.cgi?id=183430
80         <rdar://problem/38251619>
81
82         Reviewed by Dan Bernstein.
83
84         * Configurations/FeatureDefines.xcconfig:
85         * Configurations/WebKitTargetConditionals.xcconfig: Renamed.
86
87 2018-03-12  Chris Dumez  <cdumez@apple.com>
88
89         Return boolean from DOMTokenList's replace() method
90         https://bugs.webkit.org/show_bug.cgi?id=183567
91
92         Reviewed by Youenn Fablet.
93
94         Have DOMTokenList's replace() method return a boolean indicating if the
95         token was replaced, as per:
96         - https://dom.spec.whatwg.org/#dom-domtokenlist-replace
97
98         This is a recent addition to the DOM specification:
99         - https://github.com/whatwg/dom/pull/582
100
101         No new tests, rebaselined existing test.
102
103         * html/DOMTokenList.cpp:
104         (WebCore::replaceInOrderedSet):
105         (WebCore::DOMTokenList::replace):
106         * html/DOMTokenList.h:
107         * html/DOMTokenList.idl:
108
109 2018-03-12  Brian Burg  <bburg@apple.com>
110
111         Ignore some deprecation warnings encountered when compiling with newer versions of ICU
112         https://bugs.webkit.org/show_bug.cgi?id=183584
113         <rdar://problem/38395317>
114
115         Reviewed by Daniel Bates.
116
117         Ignore new deprecation warnings. Where a function has more than one
118         deprecation warning, mark out the entire function so it remains readable.
119
120         * editing/TextIterator.cpp:
121         * platform/graphics/SurrogatePairAwareTextIterator.cpp:
122         (WebCore::SurrogatePairAwareTextIterator::normalizeVoicingMarks):
123         * platform/text/TextEncoding.cpp:
124
125 2018-03-12  Yoav Weiss  <yoav@yoav.ws>
126
127         Runtime flag for link prefetch and remove link subresource.
128         https://bugs.webkit.org/show_bug.cgi?id=183540
129
130         Reviewed by Chris Dumez.
131
132         This patch removes the LINK_PREFETCH build time flag, removes
133         link subresource, adds an off-by-default runtime flag for link
134         prefetch and makes sure link prefetch only works when this flag is on.
135
136         Subresource is removed as it's not a part of any spec, nor supported by any
137         other browser. It was replaced by link preload.
138
139         No new tests as this is not adding any new functionality.
140
141         * Configurations/FeatureDefines.xcconfig: Remove the LINK_PREFETCH flag.
142         * html/LinkRelAttribute.cpp:
143         (WebCore::LinkRelAttribute::LinkRelAttribute): Put prefetch support behind the runtime flag.
144         (WebCore::LinkRelAttribute::isSupported): Add prefetch.
145         * html/LinkRelAttribute.h: Remove the LINK_PREFETCH flag.
146         * loader/LinkLoader.cpp:
147         (WebCore::createLinkPreloadResourceClient): Remove the LINK_PREFETCH flag.
148         (WebCore::LinkLoader::prefetchIfNeeded): Move the prefetch code to `prefetchIfNeeded()`. Remove subresource bits.
149         (WebCore::LinkLoader::loadLink): Call `prefetchIfNeeded()`.
150         * loader/LinkLoader.h:
151         * loader/ResourceLoadInfo.cpp:
152         (WebCore::toResourceType): Remove the LINK_PREFETCH flag as well as subresource.
153         * loader/SubresourceLoader.cpp:
154         (WebCore::logResourceLoaded): Remove the LINK_PREFETCH flag as well as subresource.
155         * loader/cache/CachedResource.cpp:
156         (WebCore::CachedResource::defaultPriorityForResourceType): Remove the LINK_PREFETCH flag as well as subresource.
157         (WebCore::CachedResource::load): Remove the LINK_PREFETCH flag.
158         * loader/cache/CachedResource.h:
159         (WebCore::CachedResource::ignoreForRequestCount const): Remove the LINK_PREFETCH flag as well as subresource.
160         * loader/cache/CachedResourceLoader.cpp:
161         (WebCore::createResource): Remove the LINK_PREFETCH flag as well as subresource.
162         (WebCore::CachedResourceLoader::requestLinkResource): Remove subresource.
163         (WebCore::contentTypeFromResourceType): Remove the LINK_PREFETCH flag as well as subresource.
164         (WebCore::CachedResourceLoader::checkInsecureContent const): Remove the LINK_PREFETCH flag as well as subresource.
165         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest): Remove the LINK_PREFETCH flag as well as subresource.
166         * loader/cache/CachedResourceLoader.h:
167         * page/RuntimeEnabledFeatures.h:
168         (WebCore::RuntimeEnabledFeatures::setLinkPrefetchEnabled): Set the prefetch flag.
169         (WebCore::RuntimeEnabledFeatures::linkPrefetchEnabled const): Get the prefetch flag.
170
171 2018-03-12  Youenn Fablet  <youenn@apple.com>
172
173         RTCPeerConnection's close method should update signalingState
174         https://bugs.webkit.org/show_bug.cgi?id=174314
175         <rdar://problem/33267977>
176
177         Reviewed by Eric Carlson.
178
179         Covered by rebased test.
180         Add closed as signalingState enum value.
181         Set peer connection signaling state to closed once close is called.
182
183         * Modules/mediastream/RTCPeerConnection.cpp:
184         (WebCore::RTCPeerConnection::doClose):
185         * Modules/mediastream/RTCSignalingState.idl:
186         * platform/mediastream/RTCSignalingState.h:
187
188 2018-03-12  Mark Lam  <mark.lam@apple.com>
189
190         Make a NativeFunction into a class to support pointer profiling.
191         https://bugs.webkit.org/show_bug.cgi?id=183573
192         <rdar://problem/38384697>
193
194         Reviewed by Filip Pizlo.
195
196         No new tests because there's no new behavior.  Only updating bindings.
197
198         * bindings/scripts/CodeGeneratorJS.pm:
199         (GenerateHashTableValueArray):
200         * bindings/scripts/test/JS/JSMapLike.cpp:
201         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
202         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
203         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
204         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
205         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
206         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
207         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
208         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
209         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
210         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
211         * bindings/scripts/test/JS/JSTestInterface.cpp:
212         * bindings/scripts/test/JS/JSTestIterable.cpp:
213         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
214         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
215         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
216         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
217         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
218         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
219         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
220         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
221         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
222         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
223         * bindings/scripts/test/JS/JSTestNode.cpp:
224         * bindings/scripts/test/JS/JSTestObj.cpp:
225         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
226         * bindings/scripts/test/JS/JSTestSerialization.cpp:
227         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
228         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
229         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
230         * bindings/scripts/test/JS/JSTestStringifier.cpp:
231         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
232         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
233         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
234         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
235         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
236         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
237         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
238
239 2018-03-12  Tim Horton  <timothy_horton@apple.com>
240
241         Use a different SPI header for some AudioToolbox enums
242         https://bugs.webkit.org/show_bug.cgi?id=183574
243         <rdar://problem/38385889>
244
245         Reviewed by Anders Carlsson.
246
247         * platform/audio/ios/AudioDestinationIOS.cpp:
248         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
249         Adjust SPI imports.
250
251 2018-03-12  Danyao Wang  <danyao@chromium.org>
252
253         Add a query and fragment exception to history API's unique origin restriction.
254         https://bugs.webkit.org/show_bug.cgi?id=183028
255
256         Reviewed by Brent Fulgham.
257
258         Tests: http/tests/navigation/pushstate-at-unique-origin-denied.php
259                Tools/TestWebKitAPI/Tests/WebCore/URL.cpp
260
261         * page/History.cpp:
262         (WebCore::History::stateObjectAdded):
263
264 2018-03-12  Antti Koivisto  <antti@apple.com>
265
266         Don't invalidate descendants for nth pseudo classes unless needed
267         https://bugs.webkit.org/show_bug.cgi?id=183566
268
269         Reviewed by Zalan Bujtas.
270
271         We currently invalidate the whole subtrees that may match :nth-child and similar. In many common
272         cases we know that only the direct siblings may be affected.
273
274         * css/SelectorChecker.cpp:
275         (WebCore::localContextForParent):
276         (WebCore::SelectorChecker::matchRecursively const):
277
278             Track if the context matches the subject element if the selector or its siblings only.
279
280         (WebCore::SelectorChecker::checkOne const):
281
282             Use different bits of descendant and child invalidation cases.
283
284         * cssjit/SelectorCompiler.cpp:
285         (WebCore::SelectorCompiler::fragmentMatchesRightmostOrAdjacentElement):
286         (WebCore::SelectorCompiler::constructFragmentsInternal):
287
288             Track if the context matches the subject element if the selector or its siblings only.
289
290         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
291         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
292         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild):
293
294             Use different bits of descendant and child invalidation cases.
295
296         * dom/Element.cpp:
297         (WebCore::invalidateForForwardPositionalRules):
298         (WebCore::invalidateForBackwardPositionalRules):
299
300             Invalidate more precisely based on the new bits.
301
302         (WebCore::checkForSiblingStyleChanges):
303         (WebCore::Element::setDescendantsAffectedByForwardPositionalRules):
304         (WebCore::Element::setDescendantsAffectedByBackwardPositionalRules):
305         (WebCore::Element::hasFlagsSetDuringStylingOfChildren const):
306         (WebCore::Element::rareDataDescendantsAffectedByForwardPositionalRules const):
307         (WebCore::Element::rareDataDescendantsAffectedByBackwardPositionalRules const):
308
309             New bits.
310
311         * dom/Element.h:
312         (WebCore::Element::descendantsAffectedByForwardPositionalRules const):
313         (WebCore::Element::descendantsAffectedByBackwardPositionalRules const):
314         * dom/ElementRareData.h:
315         (WebCore::ElementRareData::descendantsAffectedByForwardPositionalRules const):
316         (WebCore::ElementRareData::setDescendantsAffectedByForwardPositionalRules):
317         (WebCore::ElementRareData::descendantsAffectedByBackwardPositionalRules const):
318         (WebCore::ElementRareData::setDescendantsAffectedByBackwardPositionalRules):
319         (WebCore::ElementRareData::ElementRareData):
320         (WebCore::ElementRareData::resetStyleRelations):
321         * style/StyleRelations.cpp:
322         (WebCore::Style::commitRelationsToRenderStyle):
323         (WebCore::Style::commitRelations):
324         * style/StyleRelations.h:
325
326 2018-03-12  Javier Fernandez  <jfernandez@igalia.com>
327
328         Remove GridLayout runtime flag
329         https://bugs.webkit.org/show_bug.cgi?id=183484
330
331         Reviewed by Myles C. Maxfield.
332
333         The Grid Layout feature has been enabled by default for almost a
334         year, so I think it's time to remove the runtime flag and the
335         codepath run when the feature is disabled.
336
337         No new tests, because there are no changes in functionality.
338
339         * css/CSSComputedStyleDeclaration.cpp:
340         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
341         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
342         * css/StyleBuilderConverter.h:
343         (WebCore::StyleBuilderConverter::convertContentAlignmentData):
344         * css/parser/CSSParser.cpp:
345         (WebCore::CSSParserContext::CSSParserContext):
346         (WebCore::operator==):
347         * css/parser/CSSParserFastPaths.cpp:
348         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
349         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
350         * css/parser/CSSParserMode.h:
351         (WebCore::CSSParserContextHash::hash):
352         * css/parser/CSSPropertyParser.cpp:
353         (WebCore::CSSPropertyParser::parseSingleValue):
354         * dom/Document.cpp:
355         * dom/Document.h:
356         * page/RuntimeEnabledFeatures.h:
357         * rendering/RenderFlexibleBox.cpp:
358         (WebCore::alignmentOffset):
359         * rendering/style/RenderStyle.cpp:
360         * rendering/style/RenderStyle.h:
361         (WebCore::RenderStyle::initialDefaultAlignment):
362         * testing/InternalSettings.cpp:
363         (WebCore::InternalSettings::Backup::Backup):
364         (WebCore::InternalSettings::Backup::restoreTo):
365         * testing/InternalSettings.h:
366         * testing/InternalSettings.idl:
367
368 2018-03-12  Antoine Quint  <graouts@apple.com>
369
370         [Web Animations] Implement CSS Animations and CSS Transitions as Web Animations
371         https://bugs.webkit.org/show_bug.cgi?id=183504
372         <rdar://problem/38372965>
373
374         Reviewed by Dean Jackson and Jon Lee.
375
376         Tests: webanimations/css-animations.html
377                webanimations/css-transitions.html
378
379         This patch implements CSS Animations and CSS Transitions as Web Animations. The main changes are:
380
381         * StyleTreeResolver: StyleTreeResolver now has a code path to add CSSAnimation and CSSTransition objects onto the DocumentTimeline
382         to be picked up by the Web Animations engine. The previous CSSAnimationController code path is preserved if the runtime flag is disabled.
383
384         * AnimationTimeline: we add two new methods, updateCSSAnimationsForElement() and updateCSSTransitionsForElement() which are called from
385         TreeResolver::createAnimatedElementUpdate(). These look at the AnimationList for the old and new RenderStyle objects and create, update
386         and remove matching CSSAnimation and CSSTransition instances.
387
388         * DeclarativeAnimation: a new superclass to both CSSAnimation and CSSTransition which introduces the concept of a backingAnimation(),
389         which is an Animation held by the RenderStyle objects, and two virtual methods with base implementations, initialize() which is called
390         upon creating by create() methods in subclasses, and syncPropertiesWithBackingAnimation() which ensures that properties on the
391         DeclarativeAnimation objects (Web Animations side) match the backing animation (CSS side).
392
393         * KeyframeEffectReadOnly: two new important methods to create blending keyframes (KeyframeList) based on backing Animation objects,
394         computeCSSAnimationBlendingKeyframes() and computeCSSTransitionBlendingKeyframes().
395
396         * Sources.txt:
397         * WebCore.xcodeproj/project.pbxproj:
398         * animation/AnimationEffectReadOnly.h:
399         (WebCore::AnimationEffectReadOnly::isKeyframeEffectReadOnly const): We fix this method such that calling it on a KeyframeEffect, which
400         is a subclass of KeyframeEffectReadOnly, returns true.
401         * animation/AnimationEffectTimingReadOnly.cpp: In order for DeclarativeAnimation::syncPropertiesWithBackingAnimation() to set the timing
402         function for a declarative animation's effect, we need a public method to set an effect's timing function outside of just the "easing"
403         property setter exposed via the JS API. So we introduce a setTimingFunction() method and call it from setEasing().
404         (WebCore::AnimationEffectTimingReadOnly::setEasing):
405         (WebCore::AnimationEffectTimingReadOnly::setTimingFunction):
406         * animation/AnimationEffectTimingReadOnly.h:
407         * animation/AnimationTimeline.cpp:
408         (WebCore::AnimationTimeline::~AnimationTimeline): Clear all maps and sets containing WebAnimation references to ensure these get destructed
409         when the AnimationTimeline is being destructed and should no longer hold a reference to them.
410         (WebCore::AnimationTimeline::relevantMapForAnimation): We store various subclasses of WebAnimation in dedicated maps so we can composite
411         animations in the correct order when animating. This function returns the correct map for a given animation such that animationWasAddedToElement()
412         and animationWasRemovedFromElement() mutate the right map.
413         (WebCore::AnimationTimeline::animationWasAddedToElement):
414         (WebCore::AnimationTimeline::animationWasRemovedFromElement):
415         (WebCore::AnimationTimeline::animationsForElement): Make sure to look for animations in the lists of CSS Animations and CSS Transitions as well
416         as Web Animations.
417         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): This method is called by TreeResolver::createAnimatedElementUpdate() during style
418         resolution. It compares the AnimationList of the previous style and the new style for a given element, checks that animations with a given name
419         that were not present in the old AnimationList have a new matching CSSAnimation object for them added to the AnimationTimeline, that animations
420         with a given name that are no longer present in the new AnimationList have their matching CSSAnimation object removed from the AnimationTimeline,
421         and that animations with a given name that are present in both the old and new AnimationList have their matching CSSAnimation updated to match
422         the current state of the animation in the AnimationList.
423         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Similarly to updateCSSAnimationsForElement(), this method is called during style
424         resolution by TreeResolver::createAnimatedElementUpdate(). Its role is to create or remove CSSTransition objects based on the AnimationList found
425         in the old and new styles for a given element. It follows a slightly different logic than updateCSSAnimationsForElement() since for CSS Transitions,
426         there is no need to update CSSTransition objects for a CSS property existing in both the old and new AnimationList, since when a CSS transitions
427         property is changed, a whole new transition is initiated. However, it's important to check that different Animation objects and styles would actually
428         result in different timing properties and blending keyframes, so check for this as well before creating new CSSTransition objects.
429         * animation/AnimationTimeline.h:
430         (WebCore::AnimationTimeline::animations const): Change the m_animations type from HashSet to ListHashSet to guarantee we preserve the insertion order which is
431         required by getAnimations().
432         (WebCore::AnimationTimeline::hasElementAnimations const): Indicates to DocumentTimeline::updateAnimations() that there are animations targeting the provided element.
433         (WebCore::AnimationTimeline::elementToAnimationsMap):
434         (WebCore::AnimationTimeline::elementToCSSAnimationsMap):
435         (WebCore::AnimationTimeline::elementToCSSTransitionsMap):
436         * animation/CSSAnimation.cpp: CSSAnimation is now a subclass of DeclarativeAnimation and subclasses initialize() and syncPropertiesWithBackingAnimation()
437         to perform work specific to CSS Animations.
438         (WebCore::CSSAnimation::create): Set the animationName property based on the provided backing animation.
439         (WebCore::CSSAnimation::CSSAnimation):
440         (WebCore::CSSAnimation::initialize): Create the blending keyframes for this CSSAnimation.
441         (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation): Reflect the animation-fill-mode, animation-direction, animation-iteration-count and
442         animation-play-state CSS properties on the AnimationEffectTimingReadOnly object associated with this CSSAnimation.
443         * animation/CSSAnimation.h:
444         * animation/CSSTransition.cpp: CSSTransition is now a subclass of DeclarativeAnimation.
445         (WebCore::CSSTransition::create): Set the transitionProperty property based on the provided backing animation.
446         (WebCore::CSSTransition::CSSTransition):
447         (WebCore::CSSTransition::matchesBackingAnimationAndStyles const):
448         (WebCore::CSSTransition::canBeListed const): Subclass this method such that we also check that we have blending keyframes for a CSSTransition to be
449         listed by calls to getAnimations().
450         * animation/CSSTransition.h:
451         * animation/DeclarativeAnimation.cpp: Added. This new WebAnimation subclass now is the common base class for both CSSAnimation and CSSTransition.
452         It establishes a relationship with a "backing animation", which is an Animation obtained from a style's AnimationList while resolving styles.
453         These backing animations contain all of the parsed CSS styles related to CSS Animations and CSS Transitions and we use those to set matching properties
454         of the Web Animations timing model in the new syncPropertiesWithBackingAnimation() virtual method, which subclasses can override to perform further
455         work that is specific to a given declarative animation type. The initialize() method is called during create() methods to perform common animation
456         setup work. Note that while both initialize() and syncPropertiesWithBackingAnimation() are called, we suspend invalidation to that animation's effect
457         since these methods are meant to be called during style invalidation and we would hit an assertion if we followed the usual route of calling
458         updateStyleIfNeeded() on the target's document during invalidation.
459         (WebCore::DeclarativeAnimation::DeclarativeAnimation):
460         (WebCore::DeclarativeAnimation::setBackingAnimation):
461         (WebCore::DeclarativeAnimation::initialize): Create a KeyframeEffectReadOnly for this animation and set the provided element as its target, set that
462         element's document's timeline and play the animation if the backing animation's play state is playing.
463         (WebCore::DeclarativeAnimation::syncPropertiesWithBackingAnimation): Reflect the {animation|transition}-delay, {animation|transition}-duration and
464         {animation|transition}-timing-function properties as set on the backing animation.
465         * animation/DeclarativeAnimation.h: Added.
466         (WebCore::DeclarativeAnimation::backingAnimation const):
467         * animation/DocumentTimeline.cpp:
468         (WebCore::DocumentTimeline::updateAnimations): Trigger style invalidation for elements targeted not just by WebAnimation instances, but also by any
469         of the DeclarativeAnimation subclasses. We also remove the call to updateFinishedState() which should have been removed when we implemented correct
470         support for asynchronous WebAnimation operations.
471         (WebCore::DocumentTimeline::animatedStyleForRenderer): Declarative animations are backed by KeyframeEffectReadOnly effects, so make sure we check
472         for KeyframeEffectReadOnly or one of its subclasses and not just KeyframeEffect since there now are animation types that use the ReadOnly variant.
473         (WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated): Same as for animatedStyleForRenderer, check for KeyframeEffectReadOnly
474         and not simply KeyframeEffect.
475         * animation/KeyframeEffectReadOnly.cpp:
476         (WebCore::invalidateElement): Stop forcing a style resolution as we invalidate element, marking them as dirty is sufficient. Calls to getAnimations()
477         already force a style resolution as needed.
478         (WebCore::KeyframeEffectReadOnly::create): Add a new create() method that only provides a target and which is used by DeclarativeAnimation::initialize().
479         (WebCore::KeyframeEffectReadOnly::getKeyframes): The previous implementation of getKeyframes() used the ParsedKeyframe list held as m_parsedKeyframes
480         to compute keyframes. In the case of declarative animations, there are no ParsedKeyframe since the JS API was not involved, so we use the blending keyframes
481         to look for keyframe data.
482         (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes): Called by CSSAnimation::initialize(), this function creates blending keyframes by
483         looking up the keyframes date obtained from the @keyframes rule with this backing animation's name.
484         (WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes): Called by CSSTransition::create(), this function creates blending keyframes by
485         creating a 0-offset keyframe with the old style and a 1-offset keyframe with the new style as provided during TreeResolver::createAnimatedElementUpdate().
486         (WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): Called by AnimationTimeline::updateCSSTransitionsForElement()
487         to check that a provided backing Animation and a pair of old and new RenderStyles that may be different objects actually would yield different timing
488         properties and keyframe CSS values for a given CSS transition to avoid the deletion and creation of CSSTransition objects.
489         (WebCore::KeyframeEffectReadOnly::shouldRunAccelerated): We mistakenly assumed we always had blending keyframes, which is not always the case with a
490         CSSTransition where the transition style itself might be set first, but the target value after. So we should only run accelerated provided there are blending
491         keyframes at least, the function already returning false if it finds a blending keyframe animating a non-accelerated CSS property.
492         (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle): Check that there actually is a matching ParsedKeyframe to read the timing function from.
493         * animation/KeyframeEffectReadOnly.h:
494         (WebCore::KeyframeEffectReadOnly::hasBlendingKeyframes const):
495         * animation/WebAnimation.cpp:
496         (WebCore::WebAnimation::~WebAnimation): We used to do something very wrong when a WebAnimation was destroyed which uncovered crashes when dealing with
497         declarative animations. In AnimationTimeline's updateCSSAnimationsForElement() and updateCSSTransitionsForElement(), when we identify that a DeclarativeAnimation
498         no longer matches an Animation from the current style's AnimationList, we set that DeclarativeAnimation's effect to null and call removeAnimation() on
499         the timeline. This removes all references from AnimationTimeline to this DeclarativeAnimation and leads to ~WebAnimation being called. Calling removeAnimation()
500         again in the destructor means that we'd hit ASSERT_WITH_SECURITY_IMPLICATION(!m_deletionHasBegun) in ref(). It was also meaningless to perform this work in
501         the WebAnimation destructor since an animation could never be destroyed if it were still registered on a timeline.
502         (WebCore::WebAnimation::suspendEffectInvalidation): DeclarativeAnimation instances have their timing model properties set during style invalidation, so we need
503         a mechanism to allow the usual effect invalidation to be suspended in this case. We now maintain a simple m_suspendCount count that increases and decreases with
504         calls to this method and unsuspendEffectInvalidation() and a isEffectInvalidationSuspended() method returning true whenever that count is positive.
505         (WebCore::WebAnimation::unsuspendEffectInvalidation):
506         (WebCore::WebAnimation::timingModelDidChange): Check that effect invalidation is not suspended before proceeding with invalidating the effect.
507         (WebCore::WebAnimation::setEffect): Check for KeyframeEffectReadOnly and not just KeyframeEffect since declarative animations have ReadOnly effects.
508         (WebCore::WebAnimation::setTimeline): Check for KeyframeEffectReadOnly and not just KeyframeEffect since declarative animations have ReadOnly effects.
509         (WebCore::WebAnimation::scheduleMicrotaskIfNeeded): Ensure that the WebAnimation's lifecycle is extended at least to the completion of the scheduled microtask.
510         This would otherwise cause crashes after declarative animations were destroyed when they were no longer applied.
511         (WebCore::WebAnimation::runPendingPlayTask): Only fulfill the "ready" promise if it hasn't already been, which might have been the case if multiple calls to play()
512         are made as a result of updating the animation play state in CSSAnimation::syncPropertiesWithBackingAnimation().
513         (WebCore::WebAnimation::runPendingPauseTask): Same as above but with multiple pause() calls.
514         (WebCore::WebAnimation::startOrStopAccelerated): Check for KeyframeEffectReadOnly and not just KeyframeEffect since declarative animations have ReadOnly effects.
515         (WebCore::WebAnimation::canBeListed const): This new method is called by {Document|Element}::getAnimations() to check that an animation is in the correct state to
516         be listed. The Web Animations spec explains that only animations "that have an associated target effect which is current or in effect" can be listed. We implement
517         this behavior as specified.
518         * animation/WebAnimation.h:
519         (WebCore::WebAnimation::isDeclarativeAnimation const):
520         (WebCore::WebAnimation::isEffectInvalidationSuspended):
521         * dom/Document.cpp:
522         (WebCore::Document::getAnimations): Ensure that the document's pending styles are resolved before returning animations to ensure that any pending declarative
523         animations are created. Additionally, we ensure that we only list qualifying animations that have effects targeting elements that are children of thi document.
524         * dom/Element.cpp:
525         (WebCore::Element::getAnimations): Same as Document::getAnimations().
526         * style/StyleTreeResolver.cpp:
527         (WebCore::Style::TreeResolver::createAnimatedElementUpdate): When resolving styles, call into the AnimationTimeline if the runtime flag to enable CSS Animations and
528         CSS Transitions as Web Animations is on. Otherwise, use CSSAnimationController.
529
530 2018-03-12  Michael Catanzaro  <mcatanzaro@igalia.com>
531
532         [GTK] Crash in WebCore::PlatformDisplayWayland::~PlatformDisplayWayland
533         https://bugs.webkit.org/show_bug.cgi?id=176490
534
535         Reviewed by Žan Doberšek.
536
537         Destroy the wl_display with wl_display_disconnect() (client process API), not
538         wl_display_destroy() (server process API). It has to be destroyed last, so explicitly
539         destroy the wl_registry and wl_compositor first.
540
541         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
542         (WebCore::PlatformDisplayWayland::~PlatformDisplayWayland):
543
544 2018-03-10  Megan Gardner  <megan_gardner@apple.com>
545
546         Media query for default appearance
547         https://bugs.webkit.org/show_bug.cgi?id=183539
548         <rdar://problem/38326388>
549
550         Reviewed by Tim Horton.
551
552         Not currently testable, will add tests in a later patch.
553
554         Write a media query to evaluate appearance.
555
556         * css/CSSValueKeywords.in:
557         * css/MediaFeatureNames.h:
558         * css/MediaQueryEvaluator.cpp:
559         (WebCore::defaultAppearanceEvaluate):
560         * css/MediaQueryExpression.cpp:
561         (WebCore::featureWithValidIdent):
562         (WebCore::isFeatureValidWithoutValue):
563         * page/Page.h:
564         (WebCore::Page::defaultAppearance const):
565         (WebCore::Page::setDefaultAppearance):
566
567 2018-03-10  Daniel Bates  <dabates@apple.com>
568
569         InlineTextBox should own shadow data
570         https://bugs.webkit.org/show_bug.cgi?id=183359
571         <rdar://problem/38171343>
572
573         Reviewed by Darin Adler.
574
575         Following r229147 we recompute the selection style, including any shadow data, whenever we
576         paint the inline text box. Therefore, InlineTextBox needs to take ownership of the shadow
577         data or it may be deallocated before it can be used.
578
579         Covered by existing tests.
580
581         * rendering/InlineTextBox.cpp: Changed data type of InlineTextBox::MarkedTextStyle::textShadow
582         from const ShadowData* to std::optional<ShadowData>. Also removed explicitly deleted equality
583         and inequality operators as they are unnecessary. Layout tests should catch if these are ever
584         implemented and used when painting because the painted results will be wrong.
585         (WebCore::InlineTextBox::computeStyleForUnmarkedMarkedText const): Clone ShadowData.
586         (WebCore::InlineTextBox::resolveStyleForMarkedText): Simplified logic.
587         (WebCore::InlineTextBox::paintMarkedTextForeground): Modified code now that MarkedTextStyle
588         holds a std::optional<ShadowData>.
589         (WebCore::InlineTextBox::paintMarkedTextDecoration): Ditto.
590         * rendering/TextPaintStyle.cpp:
591         (WebCore::computeTextSelectionPaintStyle): Changed the out parameter type from const ShadowData*
592         to std::optional<ShadowData>& and modified code as needed.
593         * rendering/TextPaintStyle.h:
594         * rendering/style/ShadowData.cpp: Removed unncessary #include of header LayoutRect.h.
595         This header will be included via ShadowData.h.
596         (WebCore::ShadowData::clone): Convenience method that returns an std::optional to a
597         cloned ShadowData object.
598         * rendering/style/ShadowData.h:
599
600 2018-03-09  Zalan Bujtas  <zalan@apple.com>
601
602         Turn off offset*/scroll* optimization for input elements with shadow content
603         https://bugs.webkit.org/show_bug.cgi?id=182383
604         <rdar://problem/37114190>
605
606         Reviewed by Antti Koivisto.
607
608         We normally ensure clean tree before calling offsetHeight/Width, scrollHeight/Width.
609         In certain cases (see updateLayoutIfDimensionsOutOfDate() for details), it's okay to return
610         the previously computed values even when some part of the tree is dirty.
611         In case of shadow content, updateLayoutIfDimensionsOutOfDate() might return false (no need to layout)
612         for the root, while true (needs layout) for the shadow content.
613         This could confuse the caller (Element::scrollWidth/Height etc) and lead to incorrect result.
614
615         Test: fast/forms/scrollheight-with-mutation-crash.html
616
617         * dom/Document.cpp:
618         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
619
620 2018-03-10  Wenson Hsieh  <wenson_hsieh@apple.com>
621
622         [macOS] Copying a table from the Numbers app and pasting into iCloud Numbers fails
623         https://bugs.webkit.org/show_bug.cgi?id=183485
624         <rdar://problem/38041984>
625
626         Reviewed by Ryosuke Niwa.
627
628         After r222656, WebKit now treats raw image data on the pasteboard as files for the purposes of computing
629         DataTransfer.files and DataTransfer.types. However, this is combined with existing policies that suppress
630         DataTransfer.getData and DataTransfer.setData when the pasteboard contains files (generalized to copy/paste in
631         r222688). This means we now don't allow web pages to access "text/plain" in the case where the user copies part
632         of a table from the native Numbers app since Numbers additionally writes a snapshot of the table to the platform
633         pasteboard.
634
635         This restriction on getData/setData was intended to prevent web pages from extracting users' file paths when
636         pasting or dropping, so it doesn't make sense to enforce this restriction even when there is only in-memory
637         image data on the pasteboard. To fix this bug, we make Pasteboard::fileContentState() differentiate between
638         cases where there are (real) files on the pasteboard, and cases where we've fallen back to treating image data
639         as files.
640
641         Rebaselined existing LayoutTests to match new behavior.
642         Also covered by 4 new API tests:
643             - PasteMixedContent.ImageDataAndPlainText
644             - PasteMixedContent.ImageDataAndPlainTextAndURL
645             - PasteMixedContent.ImageDataAndPlainTextAndURLAndHTML
646             - UIPasteboardTests.DataTransferGetDataWhenPastingImageAndText
647
648         * dom/DataTransfer.cpp:
649         (WebCore::DataTransfer::shouldSuppressGetAndSetDataToAvoidExposingFilePaths const):
650
651         If custom pasteboard data is enabled, suppress getData and setData if and only if we might actually expose file
652         paths (see Pasteboard::fileContentState).
653
654         (WebCore::DataTransfer::types const):
655
656         Only allow "text/html" or "text/uri-list" in the case where there are actual files in the pasteboard. If there's
657         only image data, add all of the DOM-safe types back into the list of types.
658
659         * platform/Pasteboard.h:
660         * platform/StaticPasteboard.h:
661
662         Add an enum type to represent the result of Pasteboard::fileContentState.
663         -   NoFileOrImageData indicates that there was nothing on the pasteboard that could be considered a file
664             from the point of view of the page.
665         -   InMemoryImage indicates that there are no files on the pasteboard, but there is image data that we consider
666             to be files, exposed via DataTransfer API.
667         -   MayContainFilePaths indicates that there might be file paths on the pasteboard. This means that the source
668             has either written file paths to the pasteboard (for example, through NSFilenamesPboardType) or the source
669             has written image data along with a URL type of some sort that does not match one of the allowed URL schemes
670             that are safe to expose (currently, these are http-family, data, or blob).
671
672         * platform/cocoa/PasteboardCocoa.mm:
673         (WebCore::Pasteboard::fileContentState):
674
675         Refactor to return one of the three enum types described above.
676
677         (WebCore::Pasteboard::containsFiles): Deleted.
678         * platform/gtk/PasteboardGtk.cpp:
679         (WebCore::Pasteboard::fileContentState):
680         (WebCore::Pasteboard::containsFiles): Deleted.
681         * platform/win/PasteboardWin.cpp:
682         (WebCore::Pasteboard::fileContentState):
683         (WebCore::Pasteboard::containsFiles): Deleted.
684         * platform/wpe/PasteboardWPE.cpp:
685         (WebCore::Pasteboard::fileContentState):
686         (WebCore::Pasteboard::containsFiles): Deleted.
687
688         Adjust for Pasteboard::fileContentState() tweaks.
689
690 2018-03-09  Chris Fleizach  <cfleizach@apple.com>
691
692         AX: WebKit seems to be running spell checker even on non-editable content text
693         https://bugs.webkit.org/show_bug.cgi?id=183456
694         <rdar://problem/38076042>
695
696         Reviewed by Joanmarie Diggs.
697
698         Test: accessibility/mac/attributed-string/attributed-string-does-not-includes-misspelled-for-non-editable.html
699
700         Only apply misspelled attributes if it's for editable text. It's not useful or performant to do this for static text.
701
702         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
703         (AXAttributeStringSetSpelling):
704
705 2018-03-09  Nan Wang  <n_wang@apple.com>
706
707         AX: AOM: More accessibility events support
708         https://bugs.webkit.org/show_bug.cgi?id=183023
709         <rdar://problem/37764380>
710
711         Reviewed by Chris Fleizach.
712
713         The test is crashing when we call updateBackingStore when 
714         the AXObjectCache object is gone. Added a check to fix that.
715
716         Modified the test by using the right format of setTimeout and extended the delay.
717
718         * accessibility/AccessibilityObject.cpp:
719         (WebCore::AccessibilityObject::updateBackingStore):
720
721 2018-03-09  Ross Kirsling  <ross.kirsling@sony.com>
722
723         Unreviewed. Fix WinCairo build after r229497.
724
725         * platform/MIMETypeRegistry.cpp:
726         (WebCore::MIMETypeRegistry::getNormalizedMIMEType):
727
728 2018-03-09  Ross Kirsling  <ross.kirsling@sony.com>
729
730         Clean up MIMETypeRegistry::mimeTypeAssociationMap for Curl
731         https://bugs.webkit.org/show_bug.cgi?id=170529
732
733         Reviewed by Alex Christensen.
734
735         * platform/MIMETypeRegistry.cpp:
736         (WebCore::MIMETypeRegistry::getNormalizedMIMEType):
737         (WebCore::mimeTypeAssociationMap): Deleted.
738         Create map with makeNeverDestroyed and a loop instead.
739
740 2018-03-09  Brian Burg  <bburg@apple.com>
741
742         Web Inspector: there should only be one way for async backend commands to send failure
743         https://bugs.webkit.org/show_bug.cgi?id=183524
744
745         Reviewed by Timothy Hatcher.
746
747         Remove some useless ErrorString arguments. Fix some bugs where we
748         may never call the callback in an early exit situation.
749
750         Covered by existing Inspector and protocol generator tests.
751
752         * inspector/agents/InspectorDatabaseAgent.cpp:
753         (WebCore::InspectorDatabaseAgent::executeSQL):
754         * inspector/agents/InspectorDatabaseAgent.h:
755         * inspector/agents/InspectorIndexedDBAgent.h:
756         * inspector/agents/InspectorIndexedDBAgent.cpp:
757         (WebCore::getDocumentAndIDBFactoryFromFrameOrSendFailure):
758         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
759         (WebCore::InspectorIndexedDBAgent::requestDatabase):
760         (WebCore::InspectorIndexedDBAgent::requestData):
761         (WebCore::InspectorIndexedDBAgent::clearObjectStore):
762         (WebCore::assertDocument): Deleted.
763         (WebCore::assertIDBFactory): Deleted.
764         Modernize this code a little bit to share the document/idbFactory extraction code.
765
766         * inspector/agents/InspectorNetworkAgent.cpp:
767         (WebCore::InspectorNetworkAgent::loadResource):
768         * inspector/agents/InspectorNetworkAgent.h:
769
770 2018-03-09  Youenn Fablet  <youenn@apple.com>
771
772         Crash in ServiceWorkerContainer::ready
773         https://bugs.webkit.org/show_bug.cgi?id=183380
774
775         Reviewed by Chris Dumez.
776
777         Not using 'this' through lambdas.
778         Instead rely on the last lambda that is passed a ScriptExecutionContext& to get back 'this' which is a ServiceWorkerContainer.
779
780         Should be covered by imported/w3c/web-platform-tests/service-workers/service-worker/register-default-scope.https.html no longer crashing.
781         Although it should probably be LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ready.https.html that should crash
782         since this is the main test using ready.
783
784         * workers/service/ServiceWorkerContainer.cpp:
785         (WebCore::ServiceWorkerContainer::ready):
786
787 2018-03-09  Youenn Fablet  <youenn@apple.com>
788
789         RealtimeOutgoingAudioSource and RealtimeOutgoingVideoSource should be destroyed on the main thread
790         https://bugs.webkit.org/show_bug.cgi?id=183483
791         <rdar://problem/38214152>
792
793         Reviewed by Eric Carlson.
794
795         When dereferencing from libwebrtc code path, schedule a call to deref on main thread.
796         WebCore dereferencing is happening in the main thread so this guarantees destruction on the main thread.
797
798         Covered by updated mock libwebrtc peer connection backend.
799         We make mock senders to keep a reference to their source which are RealtimeOutgoingXXSource.
800         We then make mock peer connection backend to free the mock senders in a background thread.
801
802         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
803         (WebCore::LibWebRTCPeerConnectionBackend::doStop):
804         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
805         (WebCore::RealtimeOutgoingAudioSource::stop):
806         * platform/mediastream/RealtimeOutgoingAudioSource.h:
807         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
808         (WebCore::RealtimeOutgoingVideoSource::stop):
809         * platform/mediastream/RealtimeOutgoingVideoSource.h:
810         * testing/MockLibWebRTCPeerConnection.cpp:
811         (WebCore::ThreadKeeper::create):
812         (WebCore::ThreadKeeper::setThread):
813         (WebCore::MockLibWebRTCPeerConnection::~MockLibWebRTCPeerConnection):
814         * testing/MockLibWebRTCPeerConnection.h:
815
816 2018-03-09  Jer Noble  <jer.noble@apple.com>
817
818         Unconditionalize more methods in VideoFullscreenInterface (and related classes)
819         https://bugs.webkit.org/show_bug.cgi?id=183501
820
821         Reviewed by Eric Carlson.
822
823         No need for these methods to be PLATFORM(MAC) only.
824
825         * platform/cocoa/PlaybackSessionModel.h:
826         (WebCore::PlaybackSessionModelClient::ensureControlsManager):
827         * platform/ios/VideoFullscreenInterfaceAVKit.h:
828         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
829         (VideoFullscreenInterfaceAVKit::isPlayingVideoInEnhancedFullscreen const):
830         * platform/mac/VideoFullscreenInterfaceMac.h:
831
832 2018-03-09  Youenn Fablet  <youenn@apple.com>
833
834         ServiceWorker should respect IDB and DOMCache partitioning
835         https://bugs.webkit.org/show_bug.cgi?id=183496
836
837         Reviewed by Brady Eidson.
838
839         Test: http/wpt/service-workers/third-party-registration.html
840
841         Set the correct top origin of service worker ScriptExecutionContext.
842
843         * workers/service/context/ServiceWorkerThread.cpp:
844         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
845
846 2018-03-09  Youenn Fablet  <youenn@apple.com>
847
848         Cannot change audio input source device
849         https://bugs.webkit.org/show_bug.cgi?id=175975
850         <rdar://problem/34073589>
851
852         Reviewed by Eric Carlson.
853
854         Covered by manually testing https://webrtc.github.io/samples/src/content/devices/input-output/ with a USB web cam.
855
856         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
857         (WebCore::CoreAudioSharedUnit::setCaptureDeviceID):
858         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
859
860 2018-03-09  Jer Noble  <jer.noble@apple.com>
861
862         Add new CSS env constants for use with fullscreen
863         https://bugs.webkit.org/show_bug.cgi?id=183498
864
865         Reviewed by Dean Jackson.
866
867         Tests: fullscreen/fullscreen-auto-hide-delay.html
868                fullscreen/fullscreen-inset-top.html
869
870         * dom/ConstantPropertyMap.cpp:
871         (WebCore::ConstantPropertyMap::nameForProperty const):
872         (WebCore::variableDataForPositiveDuration):
873         (WebCore::ConstantPropertyMap::setFullscreenInsetTop):
874         (WebCore::ConstantPropertyMap::setFullscreenAutoHideDelay):
875         * dom/ConstantPropertyMap.h:
876         * page/Page.cpp:
877         (WebCore::Page::setFullscreenInsetTop):
878         (WebCore::Page::setFullscreenAutoHideDelay):
879         * page/Page.h:
880         * testing/Internals.cpp:
881         (WebCore::Internals::resetToConsistentState):
882         (WebCore::Internals::setFullscreenInsetTop):
883         (WebCore::Internals::setFullscreenAutoHideDelay):
884         * testing/Internals.h:
885         * testing/Internals.idl:
886
887 2018-03-09  Zalan Bujtas  <zalan@apple.com>
888
889         RenderTreeBuilder::splitAnonymousBoxesAroundChild should take multicolumn spanners into account.
890         https://bugs.webkit.org/show_bug.cgi?id=183493
891         <rdar://problem/38030461>
892
893         Reviewed by Antti Koivisto.
894
895         Multicolumn spanners are taken out of their original position and placed next
896         to a RenderMultiColumnSet. splitAnonymousBoxesAroundChild needs to know the original parent (in the render tree context).
897
898         Test: fast/multicol/adjust-beforeChild-for-spanner-crash.html
899
900         * rendering/updating/RenderTreeBuilder.cpp:
901         (WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
902         * rendering/updating/RenderTreeBuilder.h:
903         * rendering/updating/RenderTreeBuilderBlock.cpp:
904         (WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation):
905         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
906         (WebCore::RenderTreeBuilder::MultiColumn::adjustBeforeChildForMultiColumnSpannerIfNeeded):
907         * rendering/updating/RenderTreeBuilderMultiColumn.h:
908         * rendering/updating/RenderTreeBuilderRuby.cpp:
909         (WebCore::RenderTreeBuilder::Ruby::moveChildrenInternal):
910         * rendering/updating/RenderTreeBuilderTable.cpp:
911         (WebCore::RenderTreeBuilder::Table::attach):
912
913 2018-03-09  Jer Noble  <jer.noble@apple.com>
914
915         Add isPictureInPictureActive messaging across WebKit process boundary
916         https://bugs.webkit.org/show_bug.cgi?id=183499
917
918         Reviewed by Eric Carlson.
919
920         * platform/cocoa/PlaybackSessionModel.h:
921         (WebCore::PlaybackSessionModelClient::pictureInPictureActiveChanged):
922         * platform/cocoa/PlaybackSessionModelMediaElement.h:
923         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
924         (WebCore::PlaybackSessionModelMediaElement::updateForEventName):
925         (WebCore::PlaybackSessionModelMediaElement::isPictureInPictureActive const):
926         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
927         (VideoFullscreenControllerContext::isPictureInPictureActive const):
928
929 2018-03-09  Basuke Suzuki  <Basuke.Suzuki@sony.com>
930
931         [Curl] Implement connection limit.
932         https://bugs.webkit.org/show_bug.cgi?id=183016
933
934         Implement both connection limit per host and total
935         connection limit on curl network layer.
936
937         Reviewed by Youenn Fablet.
938
939         No new tests because there's no behavior change.
940
941         * platform/network/curl/CurlContext.cpp:
942         (WebCore::EnvironmentVariableReader::sscanTemplate<signed>):
943         (WebCore::CurlContext::CurlContext):
944         (WebCore::CurlMultiHandle::setMaxConnects):
945         (WebCore::CurlMultiHandle::setMaxTotalConnections):
946         (WebCore::CurlMultiHandle::setMaxHostConnections):
947         * platform/network/curl/CurlContext.h:
948         (WebCore::CurlContext::scheduler):
949         * platform/network/curl/CurlRequest.cpp:
950         (WebCore::CurlRequest::startWithJobManager):
951         (WebCore::CurlRequest::cancel):
952         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
953         (WebCore::CurlRequest::completeDidReceiveResponse):
954         (WebCore::CurlRequest::pausedStatusChanged):
955         * platform/network/curl/CurlRequestScheduler.cpp:
956         (WebCore::CurlRequestScheduler::CurlRequestScheduler):
957         (WebCore::CurlRequestScheduler::workerThread):
958         (WebCore::CurlRequestScheduler::singleton): Deleted.
959         * platform/network/curl/CurlRequestScheduler.h:
960
961 2018-03-09  Jer Noble  <jer.noble@apple.com>
962
963         webkitfullscreenchange event not fired at the same time as :-webkit-full-screen pseudo selector changes; causes glitchiness
964         https://bugs.webkit.org/show_bug.cgi?id=183383
965
966         Reviewed by Eric Carlson.
967
968         Fire the webkitfullscreenchange event at the same time as the pseudo class selector changes, during the handling
969         of webkitDidEnterFullScreenForElement. For WebKit2 clients, this is guaranteed to be asynchronous, since the
970         calling method originates in the UIProcess. For WebKit1 clients (and WKTR and DRT), there's the possibility that
971         webkitWillEnterFullScreenForElement will be called synchronously from within
972         Document::requestFullScreenForElement(), so break that synchronousness by starting the
973         ChromeClient::enterFullScreenForElement(...) process in a async task.
974
975         Previously, the firing of the fullscreenchange event was done through a zero-length timer. Use a
976         GenericTaskQueue instead.
977
978         A number of layout tests depend on the behavior that the element will be in fullscreen when the 'playing' event
979         fires. This was true for DRT (but not WKTR), since its fullscreen implementations were deliberately synchronous, but
980         won't necessarily be true for all ports. Fix this in a subsequent patch.
981
982         * dom/Document.cpp:
983         (WebCore::Document::requestFullScreenForElement):
984         (WebCore::Document::webkitExitFullscreen):
985         (WebCore::Document::webkitWillEnterFullScreenForElement):
986         (WebCore::Document::webkitDidEnterFullScreenForElement):
987         (WebCore::Document::webkitDidExitFullScreenForElement):
988         (WebCore::Document::dispatchFullScreenChangeEvents):
989         * dom/Document.h:
990         * html/HTMLMediaElement.cpp:
991         (WebCore::HTMLMediaElement::setReadyState):
992         (WebCore::HTMLMediaElement::playInternal):
993         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
994         (WebCore::HTMLMediaElement::updatePlayState):
995         (WebCore::HTMLMediaElement::setPlaying):
996
997 2018-03-09  Zan Dobersek  <zdobersek@igalia.com>
998
999         [Nicosia] Add threaded PaintingEngine implementation
1000         https://bugs.webkit.org/show_bug.cgi?id=183511
1001
1002         Reviewed by Carlos Garcia Campos.
1003
1004         Add Nicosia::PaintingEngineThreaded, class that internally uses a thread
1005         pool in which painting tasks are executed.
1006
1007         Implementation for now defaults to using GLib's GThreadPool, defaulting
1008         to 4 threads that are exclusive to this pool. These parameters should be
1009         fine-tuned in the future, or even made configurable, but are a solid
1010         basis for testing.
1011
1012         In PaintingEngineThreaded::paint(), PaintingContext implementation is
1013         used to record all the operations, and the gathered Vector is combined
1014         with the Buffer object and dispatched into the thread pool. In the
1015         thread function, the provided buffer and painting operations are run
1016         through the PaintingContext implementation, replaying all the operations
1017         on a painting context that draws into the given buffer.
1018
1019         The recorded operation objects implement the PaintingOperation interface
1020         contain all the data necessary to replay a given operation. They can be
1021         executed against a PaintingOperationReplay object, as is the case during
1022         PaintingContext::replay(), or they can be dumped into a TextStream
1023         object for debugging purposes.
1024
1025         PaintingContext now also provides the record() and replay() static
1026         functions. PaintingContext objects now differ per purpose, which can be
1027         either for painting or for recording. paint() and replay() use a
1028         for-painting PaintingContext, and record() uses a for-recording one.
1029         The for-painting PaintingContext receives a Buffer object, i.e. a memory
1030         area on which it can draw, while the for-recording PaintingContext uses
1031         the passed-in PaintingOperations Vector that should store all the
1032         recorded operations.
1033
1034         The current Cairo implementation of PaintingContext is moved into
1035         PaintingContextCairo::ForPainting. PaintingContextCairo::ForRecording is
1036         added but is currently no-op until a Cairo-specific GraphicsContextImpl
1037         with recording capabilities is added, allowing any call on the
1038         GraphicsContext object used in PaintingContext::record() to be recorded
1039         for later replay. PaintingOperationReplayCairo, inheriting from
1040         PaintingOperationReplay, will be used for replay purposes, providing
1041         only reference to the PlatformContextCairo object that is constructed in
1042         PaintingContextCairo::ForPainting.
1043
1044         The Cairo-specific GraphicsContextImpl implementation will be added in
1045         a separate patch. After that, PaintingEngine::create() will be modified
1046         so that the Nicosia::PaintingEngineThreaded implementation can be used
1047         for testing purposes, probably by setting an environment variable.
1048
1049         * platform/TextureMapper.cmake:
1050         * platform/graphics/nicosia/NicosiaPaintingContext.cpp:
1051         (Nicosia::PaintingContext::createForPainting):
1052         (Nicosia::PaintingContext::createForRecording):
1053         (Nicosia::PaintingContext::create): Deleted.
1054         * platform/graphics/nicosia/NicosiaPaintingContext.h:
1055         (Nicosia::PaintingContext::paint):
1056         (Nicosia::PaintingContext::record):
1057         (Nicosia::PaintingContext::replay):
1058         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp: Added.
1059         (Nicosia::s_threadFunc):
1060         (Nicosia::paintLayer):
1061         (Nicosia::PaintingEngineThreaded::PaintingEngineThreaded):
1062         (Nicosia::PaintingEngineThreaded::~PaintingEngineThreaded):
1063         (Nicosia::PaintingEngineThreaded::paint):
1064         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContext.cpp.
1065         * platform/graphics/nicosia/NicosiaPaintingOperation.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContext.cpp.
1066         * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp:
1067         (Nicosia::PaintingContextCairo::ForPainting::ForPainting):
1068         (Nicosia::PaintingContextCairo::ForPainting::~ForPainting):
1069         (Nicosia::PaintingContextCairo::ForPainting::graphicsContext):
1070         (Nicosia::PaintingContextCairo::ForPainting::replay):
1071         (Nicosia::PaintingContextCairo::ForRecording::ForRecording):
1072         (Nicosia::PaintingContextCairo::ForRecording::graphicsContext):
1073         (Nicosia::PaintingContextCairo::ForRecording::replay):
1074         (Nicosia::PaintingContextCairo::PaintingContextCairo): Deleted.
1075         (Nicosia::PaintingContextCairo::~PaintingContextCairo): Deleted.
1076         (Nicosia::PaintingContextCairo::graphicsContext): Deleted.
1077         * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.h:
1078         * platform/graphics/nicosia/cairo/NicosiaPaintingOperationReplayCairo.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContext.cpp.
1079         (Nicosia::PaintingOperationReplayCairo::PaintingOperationReplayCairo):
1080
1081 2018-03-09  Zan Dobersek  <zdobersek@igalia.com>
1082
1083         Remove some unused cruft in TextureMapperLayer.
1084
1085         The ScrollingClient class is not used anymore since r229318.
1086         findScrollableContentsLayerAt() is similarly unused, but also lacking
1087         an actual definition. ContentsLayerCount enum can also be purged.
1088
1089         Rubber-stamped by Carlos Garcia Campos.
1090
1091         * platform/graphics/texmap/TextureMapperLayer.h:
1092
1093 2018-03-08  Zan Dobersek  <zdobersek@igalia.com>
1094
1095         Add basic synchronization capability to Nicosia::Buffer
1096         https://bugs.webkit.org/show_bug.cgi?id=183500
1097
1098         Reviewed by Carlos Garcia Campos.
1099
1100         Have Nicosia::Buffer track a painting state, and allow that state to be
1101         modified and accessed from different threads. The PaintingState enum
1102         value is protected by a Lock object, and can be modified via the
1103         beginPainting() and completePainting() methods. Additionally, the
1104         waitUntilPaintingComplete() method allows the caller to wait until the
1105         painting is complete for the given Nicosia::Buffer object.
1106
1107         This added state doesn't affect a Nicosia::Buffer object internally, and
1108         doesn't have any effect on  existing usages of Nicosia::Buffer (which
1109         are not multi-threaded).
1110
1111         * platform/graphics/nicosia/NicosiaBuffer.cpp:
1112         (Nicosia::Buffer::beginPainting):
1113         (Nicosia::Buffer::completePainting):
1114         (Nicosia::Buffer::waitUntilPaintingComplete):
1115         * platform/graphics/nicosia/NicosiaBuffer.h:
1116
1117 2018-03-08  Zan Dobersek  <zdobersek@igalia.com>
1118
1119         Move NicosiaPaintingContextCairo files under Cairo-specific directory
1120         https://bugs.webkit.org/show_bug.cgi?id=183497
1121
1122         Reviewed by Carlos Garcia Campos.
1123
1124         Pack Cairo-specific files in the Nicosia subsystem under cairo/.
1125
1126         * platform/TextureMapper.cmake:
1127         * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp: Renamed from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContextCairo.cpp.
1128         * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.h: Renamed from Source/WebCore/platform/graphics/nicosia/NicosiaPaintingContextCairo.h.
1129
1130 2018-03-08  Nan Wang  <n_wang@apple.com>
1131
1132         AX: AOM: More accessibility events support
1133         https://bugs.webkit.org/show_bug.cgi?id=183023
1134         <rdar://problem/37764380>
1135
1136         Reviewed by Chris Fleizach.
1137
1138         Fixed the crash that we shouldn't dispatch the accessibility events if the
1139         event path is empty.
1140
1141         Also added a check to not dispatch events if the runtime flag is not enabled.
1142
1143         Test: accessibility/mac/AOM-events-webarea-crash.html
1144
1145         * accessibility/AccessibilityObject.cpp:
1146         (WebCore::AccessibilityObject::shouldDispatchAccessibilityEvent const):
1147         (WebCore::AccessibilityObject::dispatchAccessibilityEvent const):
1148         * accessibility/AccessibilityObject.h:
1149
1150 2018-03-08  Megan Gardner  <megan_gardner@apple.com>
1151
1152         Allow WebViews to disable system appearance
1153         https://bugs.webkit.org/show_bug.cgi?id=183418
1154         <rdar://problem/36975642>
1155
1156         Reviewed by Tim Horton.
1157
1158         Not currently testable, tests will be added in a later patch.
1159
1160         Allow webviews to choose whether or not to follow the default system appearance.
1161
1162         * css/StyleColor.cpp:
1163         (WebCore::StyleColor::colorFromKeyword):
1164         * css/StyleColor.h:
1165         * css/StyleResolver.cpp:
1166         (WebCore::StyleResolver::colorFromPrimitiveValue const):
1167         * css/parser/CSSParser.cpp:
1168         (WebCore::CSSParser::parseSystemColor):
1169         * css/parser/CSSParser.h:
1170         * css/parser/CSSParserMode.h:
1171         * html/canvas/CanvasRenderingContext2D.cpp:
1172         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
1173         * html/canvas/CanvasRenderingContext2DBase.cpp:
1174         (WebCore::CanvasRenderingContext2DBase::setStrokeColor):
1175         (WebCore::CanvasRenderingContext2DBase::setFillColor):
1176         * html/canvas/CanvasStyle.cpp:
1177         (WebCore::parseColor):
1178         (WebCore::parseColorOrCurrentColor):
1179         (WebCore::CanvasStyle::createFromString):
1180         (WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
1181         * html/canvas/CanvasStyle.h:
1182         * page/Page.h:
1183         (WebCore::Page::useSystemAppearance const):
1184         (WebCore::Page::setUseSystemAppearance):
1185         * platform/Theme.cpp:
1186         (WebCore::Theme::paint):
1187         * platform/Theme.h:
1188         * platform/mac/LocalDefaultSystemAppearance.h:
1189         * platform/mac/LocalDefaultSystemAppearance.mm:
1190         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
1191         (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
1192         * platform/mac/ThemeMac.h:
1193         * platform/mac/ThemeMac.mm:
1194         (-[WebCoreThemeView initWithUseSystemAppearance:]):
1195         (WebCore::paintToggleButton):
1196         (WebCore::paintButton):
1197         (WebCore::ThemeMac::ensuredView):
1198         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
1199         (WebCore::ThemeMac::paint):
1200         (-[WebCoreThemeView init]): Deleted.
1201         * rendering/RenderTheme.cpp:
1202         (WebCore::RenderTheme::paint):
1203         (WebCore::RenderTheme::systemColor const):
1204         (WebCore::RenderTheme::focusRingColor):
1205         * rendering/RenderTheme.h:
1206         (WebCore::RenderTheme::platformFocusRingColor const):
1207         * rendering/RenderThemeIOS.mm:
1208         (WebCore::RenderThemeIOS::systemColor const):
1209         * rendering/RenderThemeMac.h:
1210         * rendering/RenderThemeMac.mm:
1211         (WebCore::RenderThemeMac::documentViewFor const):
1212         (WebCore::RenderThemeMac::platformFocusRingColor const):
1213         (WebCore::RenderThemeMac::systemColor const):
1214         (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
1215         (WebCore::RenderThemeMac::paintSliderThumb):
1216         * rendering/TextPaintStyle.cpp:
1217         (WebCore::computeTextPaintStyle):
1218
1219 2018-03-08  Megan Gardner  <megan_gardner@apple.com>
1220
1221         Ensure default appearance for selection form control
1222         https://bugs.webkit.org/show_bug.cgi?id=183482
1223         <rdar://problem/38274894>
1224
1225         Reviewed by Tim Horton.
1226   
1227         The appearance for selection form controls was not set to default.
1228
1229         Not currently testable, will add tests in a later patch.
1230
1231         * rendering/RenderThemeMac.mm:
1232         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
1233
1234 2018-03-08  Per Arne Vollan  <pvollan@apple.com>
1235
1236         [Win] Compile error: pal/ExportMacros.h not found.
1237         https://bugs.webkit.org/show_bug.cgi?id=183467
1238
1239         Reviewed by Brent Fulgham.
1240
1241         PAL header files are no longer located under the WebCore folder in forwarding headers. An additional
1242         build step is required to copy the PAL header files to the internal include folder.
1243
1244         No new tests, no change in functionality. 
1245
1246         * PlatformWin.cmake:
1247         * WebCore.vcxproj/WebCore.proj:
1248
1249 2018-03-08  Megan Gardner  <megan_gardner@apple.com>
1250
1251         Ensure system appearance is default for legacy webkit
1252         https://bugs.webkit.org/show_bug.cgi?id=183473
1253         <rdar://problem/38210306>
1254
1255         Reviewed by Tim Horton.
1256
1257         Need to set the appearance on the window for legacy webkit due to differences in drawing.
1258
1259         Not currently testable, will add tests in a later patch.
1260
1261         * platform/mac/ThemeMac.mm:
1262         (WebCore::paintButton):
1263
1264 2018-03-08  Youenn Fablet  <youenn@apple.com>
1265
1266         libwebrtc update broke internal builds
1267         https://bugs.webkit.org/show_bug.cgi?id=183454
1268
1269         Reviewed by Eric Carlson.
1270
1271         No change of behavior.
1272         Fixed header search paths.
1273         Removed deleted file from XCode project as an additional clean-up.
1274
1275         * Configurations/WebCore.xcconfig:
1276         * WebCore.xcodeproj/project.pbxproj:
1277
1278 2018-03-08  Per Arne Vollan  <pvollan@apple.com>
1279
1280         NSAnimation is not working in the WebContent process when WindowServer access is blocked.
1281         https://bugs.webkit.org/show_bug.cgi?id=183291
1282
1283         Reviewed by Dean Jackson.
1284
1285         The animation can be implemented by using an NSTimer instead. Use the existing Bezier timing
1286         function to create a smooth animation.
1287
1288         No new tests. This code is used to fade scrollbars in and out by animating the alpha value.
1289         This scrollbar setting is not the default in macOS, which makes it non trivial to create
1290         layout tests for this.
1291
1292         * platform/mac/ScrollAnimatorMac.mm:
1293         (-[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]):
1294         (-[WebScrollbarPartAnimation startAnimation]):
1295         (-[WebScrollbarPartAnimation setCurrentProgress:setCurrentProgress:]):
1296         (-[WebScrollbarPartAnimation invalidate]):
1297         (-[WebScrollbarPartAnimation setDuration:]):
1298         (-[WebScrollbarPartAnimation stopAnimation]):
1299         (-[WebScrollbarPartAnimation setCurrentProgress:]): Deleted.
1300
1301 2018-03-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
1302
1303         Templatize SVGAnimatedType
1304         https://bugs.webkit.org/show_bug.cgi?id=183017
1305
1306         Reviewed by Dean Jackson.
1307
1308         This is a work toward https://bugs.webkit.org/show_bug.cgi?id=168586. The
1309         goal to have SVGAnimatedType be type independent. The appropriate method
1310         of this template will be implicitly instantiated based to the type of the
1311         animated attribute(s).
1312
1313         * Sources.txt: Delete SVGAnimatedType.cpp since its function became template
1314         functions or short enough to be inline functions.
1315         * WebCore.xcodeproj/project.pbxproj:
1316         * svg/SVGAnimatedAngle.cpp:
1317         (WebCore::SVGAnimatedAngleAnimator::constructFromString):
1318         (WebCore::SVGAnimatedAngleAnimator::startAnimValAnimation):
1319         (WebCore::SVGAnimatedAngleAnimator::resetAnimValToBaseVal):
1320         (WebCore::SVGAnimatedAngleAnimator::addAnimatedTypes):
1321         (WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue):
1322         Use the template functions SVGAnimatedType::create<>() and SVGAnimatedType::as<>().
1323
1324         * svg/SVGAnimatedBoolean.cpp:
1325         (WebCore::SVGAnimatedBooleanAnimator::constructFromString):
1326         (WebCore::SVGAnimatedBooleanAnimator::startAnimValAnimation):
1327         (WebCore::SVGAnimatedBooleanAnimator::resetAnimValToBaseVal):
1328         (WebCore::SVGAnimatedBooleanAnimator::calculateAnimatedValue):
1329         Ditto.
1330
1331         * svg/SVGAnimatedColor.cpp:
1332         (WebCore::SVGAnimatedColorAnimator::constructFromString):
1333         (WebCore::SVGAnimatedColorAnimator::addAnimatedTypes):
1334         (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
1335         Ditto.
1336
1337         * svg/SVGAnimatedEnumeration.cpp:
1338         (WebCore::SVGAnimatedEnumerationAnimator::constructFromString):
1339         (WebCore::SVGAnimatedEnumerationAnimator::startAnimValAnimation):
1340         (WebCore::SVGAnimatedEnumerationAnimator::resetAnimValToBaseVal):
1341         (WebCore::SVGAnimatedEnumerationAnimator::calculateAnimatedValue):
1342         Ditto.
1343
1344         * svg/SVGAnimatedInteger.cpp:
1345         (WebCore::SVGAnimatedIntegerAnimator::constructFromString):
1346         (WebCore::SVGAnimatedIntegerAnimator::startAnimValAnimation):
1347         (WebCore::SVGAnimatedIntegerAnimator::resetAnimValToBaseVal):
1348         (WebCore::SVGAnimatedIntegerAnimator::addAnimatedTypes):
1349         (WebCore::SVGAnimatedIntegerAnimator::calculateAnimatedValue):
1350         Ditto.
1351
1352         * svg/SVGAnimatedIntegerOptionalInteger.cpp:
1353         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::constructFromString):
1354         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::startAnimValAnimation):
1355         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::resetAnimValToBaseVal):
1356         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::addAnimatedTypes):
1357         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::calculateAnimatedValue):
1358         Ditto.
1359
1360         * svg/SVGAnimatedLength.cpp:
1361         (WebCore::SVGAnimatedLengthAnimator::constructFromString):
1362         (WebCore::SVGAnimatedLengthAnimator::startAnimValAnimation):
1363         (WebCore::SVGAnimatedLengthAnimator::resetAnimValToBaseVal):
1364         (WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes):
1365         (WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue):
1366         Ditto.
1367
1368         * svg/SVGAnimatedLengthList.cpp:
1369         (WebCore::SVGAnimatedLengthListAnimator::constructFromString):
1370         (WebCore::SVGAnimatedLengthListAnimator::startAnimValAnimation):
1371         (WebCore::SVGAnimatedLengthListAnimator::resetAnimValToBaseVal):
1372         (WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes):
1373         (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
1374         Ditto.
1375
1376         * svg/SVGAnimatedNumber.cpp:
1377         (WebCore::SVGAnimatedNumberAnimator::constructFromString):
1378         (WebCore::SVGAnimatedNumberAnimator::startAnimValAnimation):
1379         (WebCore::SVGAnimatedNumberAnimator::resetAnimValToBaseVal):
1380         (WebCore::SVGAnimatedNumberAnimator::addAnimatedTypes):
1381         (WebCore::SVGAnimatedNumberAnimator::calculateAnimatedValue):
1382         Ditto.
1383
1384         * svg/SVGAnimatedNumberList.cpp:
1385         (WebCore::SVGAnimatedNumberListAnimator::constructFromString):
1386         (WebCore::SVGAnimatedNumberListAnimator::startAnimValAnimation):
1387         (WebCore::SVGAnimatedNumberListAnimator::resetAnimValToBaseVal):
1388         (WebCore::SVGAnimatedNumberListAnimator::addAnimatedTypes):
1389         (WebCore::SVGAnimatedNumberListAnimator::calculateAnimatedValue):
1390         Ditto.
1391
1392         * svg/SVGAnimatedNumberOptionalNumber.cpp:
1393         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::constructFromString):
1394         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::startAnimValAnimation):
1395         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::resetAnimValToBaseVal):
1396         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::addAnimatedTypes):
1397         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::calculateAnimatedValue):
1398         Ditto.
1399
1400         * svg/SVGAnimatedPath.cpp:
1401         (WebCore::SVGAnimatedPathAnimator::constructFromString):
1402         (WebCore::SVGAnimatedPathAnimator::startAnimValAnimation):
1403         (WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal):
1404         (WebCore::SVGAnimatedPathAnimator::addAnimatedTypes):
1405         (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue):
1406         Ditto.
1407
1408         * svg/SVGAnimatedPointList.cpp:
1409         (WebCore::SVGAnimatedPointListAnimator::constructFromString):
1410         (WebCore::SVGAnimatedPointListAnimator::startAnimValAnimation):
1411         (WebCore::SVGAnimatedPointListAnimator::resetAnimValToBaseVal):
1412         (WebCore::SVGAnimatedPointListAnimator::addAnimatedTypes):
1413         (WebCore::SVGAnimatedPointListAnimator::calculateAnimatedValue):
1414         Ditto.
1415
1416         * svg/SVGAnimatedPreserveAspectRatio.cpp:
1417         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::constructFromString):
1418         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::startAnimValAnimation):
1419         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::resetAnimValToBaseVal):
1420         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateAnimatedValue):
1421         Ditto.
1422
1423         * svg/SVGAnimatedRect.cpp:
1424         (WebCore::SVGAnimatedRectAnimator::constructFromString):
1425         (WebCore::SVGAnimatedRectAnimator::startAnimValAnimation):
1426         (WebCore::SVGAnimatedRectAnimator::resetAnimValToBaseVal):
1427         (WebCore::SVGAnimatedRectAnimator::addAnimatedTypes):
1428         (WebCore::SVGAnimatedRectAnimator::calculateAnimatedValue):
1429         Ditto.
1430
1431         * svg/SVGAnimatedString.cpp:
1432         (WebCore::SVGAnimatedStringAnimator::constructFromString):
1433         (WebCore::SVGAnimatedStringAnimator::startAnimValAnimation):
1434         (WebCore::SVGAnimatedStringAnimator::resetAnimValToBaseVal):
1435         (WebCore::SVGAnimatedStringAnimator::calculateAnimatedValue):
1436         Ditto.
1437
1438         * svg/SVGAnimatedTransformList.cpp:
1439         (WebCore::SVGAnimatedTransformListAnimator::constructFromString):
1440         (WebCore::SVGAnimatedTransformListAnimator::startAnimValAnimation):
1441         (WebCore::SVGAnimatedTransformListAnimator::resetAnimValToBaseVal):
1442         (WebCore::SVGAnimatedTransformListAnimator::addAnimatedTypes):
1443         (WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
1444         (WebCore::SVGAnimatedTransformListAnimator::calculateDistance):
1445         Ditto.
1446
1447         * svg/SVGAnimatedType.cpp: Removed.
1448         * svg/SVGAnimatedType.h:
1449         (WebCore::SVGAnimatedType::create):
1450         (WebCore::SVGAnimatedType::SVGAnimatedType):
1451         (WebCore::SVGAnimatedType::~SVGAnimatedType):
1452         (WebCore::SVGAnimatedType::as const):
1453         (WebCore::SVGAnimatedType::as):
1454         (WebCore::SVGAnimatedType::type const):
1455         (WebCore::SVGAnimatedType::valueAsString const):
1456         (WebCore::SVGAnimatedType::setValueAsString):
1457         (WebCore::SVGAnimatedType::supportsAnimVal):
1458         (WebCore::SVGAnimatedType::angleAndEnumeration const): Deleted.
1459         (WebCore::SVGAnimatedType::boolean const): Deleted.
1460         (WebCore::SVGAnimatedType::color const): Deleted.
1461         (WebCore::SVGAnimatedType::enumeration const): Deleted.
1462         (WebCore::SVGAnimatedType::integer const): Deleted.
1463         (WebCore::SVGAnimatedType::integerOptionalInteger const): Deleted.
1464         (WebCore::SVGAnimatedType::length const): Deleted.
1465         (WebCore::SVGAnimatedType::lengthList const): Deleted.
1466         (WebCore::SVGAnimatedType::number const): Deleted.
1467         (WebCore::SVGAnimatedType::numberList const): Deleted.
1468         (WebCore::SVGAnimatedType::numberOptionalNumber const): Deleted.
1469         (WebCore::SVGAnimatedType::path const): Deleted.
1470         (WebCore::SVGAnimatedType::pointList const): Deleted.
1471         (WebCore::SVGAnimatedType::preserveAspectRatio const): Deleted.
1472         (WebCore::SVGAnimatedType::rect const): Deleted.
1473         (WebCore::SVGAnimatedType::string const): Deleted.
1474         (WebCore::SVGAnimatedType::transformList const): Deleted.
1475         (WebCore::SVGAnimatedType::angleAndEnumeration): Deleted.
1476         (WebCore::SVGAnimatedType::boolean): Deleted.
1477         (WebCore::SVGAnimatedType::color): Deleted.
1478         (WebCore::SVGAnimatedType::enumeration): Deleted.
1479         (WebCore::SVGAnimatedType::integer): Deleted.
1480         (WebCore::SVGAnimatedType::integerOptionalInteger): Deleted.
1481         (WebCore::SVGAnimatedType::length): Deleted.
1482         (WebCore::SVGAnimatedType::lengthList): Deleted.
1483         (WebCore::SVGAnimatedType::number): Deleted.
1484         (WebCore::SVGAnimatedType::numberList): Deleted.
1485         (WebCore::SVGAnimatedType::numberOptionalNumber): Deleted.
1486         (WebCore::SVGAnimatedType::path): Deleted.
1487         (WebCore::SVGAnimatedType::pointList): Deleted.
1488         (WebCore::SVGAnimatedType::preserveAspectRatio): Deleted.
1489         (WebCore::SVGAnimatedType::rect): Deleted.
1490         (WebCore::SVGAnimatedType::string): Deleted.
1491         (WebCore::SVGAnimatedType::transformList): Deleted.
1492         Replace the union by a Variant. Replace all the type specific functions
1493         by the template functions create() and as(). Use WTF::visit to get the
1494         value stored in the variant. Use the SVGPropertyTraits to perform the
1495         required operation.
1496
1497         * svg/SVGAnimatedTypeAnimator.h:
1498         (WebCore::SVGAnimatedTypeAnimator::constructFromBaseValue):
1499         (WebCore::SVGAnimatedTypeAnimator::resetFromBaseValue):
1500         (WebCore::SVGAnimatedTypeAnimator::stopAnimValAnimationForType):
1501         (WebCore::SVGAnimatedTypeAnimator::animValDidChangeForType):
1502         (WebCore::SVGAnimatedTypeAnimator::animValWillChangeForType):
1503         (WebCore::SVGAnimatedTypeAnimator::constructFromBaseValues):
1504         (WebCore::SVGAnimatedTypeAnimator::resetFromBaseValues):
1505         (WebCore::SVGAnimatedTypeAnimator::stopAnimValAnimationForTypes):
1506         (WebCore::SVGAnimatedTypeAnimator::animValDidChangeForTypes):
1507         (WebCore::SVGAnimatedTypeAnimator::animValWillChangeForTypes):
1508         (WebCore::SVGAnimatedTypeAnimator::executeAction):
1509         Rename the parameters and the local variables to match their types. Use
1510         the SVGAnimatedType template functions create() and as().
1511
1512         * svg/SVGLengthValue.h:
1513         (WebCore::SVGPropertyTraits<SVGLengthValue>::parse): This was moved from
1514         SVGAnimatedType::setValueAsString()
1515         (WebCore::SVGPropertyTraits<SVGLengthValue>::toString): This was moved from
1516         SVGAnimatedType::valueAsString().
1517
1518         * svg/SVGMarkerTypes.h: Add placeholders for parse() and toString() so
1519         SVGAnimatedType::valueAsString() and setValueAsString() can compile for 
1520         all types.
1521
1522         * svg/SVGNumberListValues.h:
1523         (WebCore::SVGPropertyTraits<SVGNumberListValues>::parse):
1524         * svg/SVGPathByteStream.h:
1525         (WebCore::SVGPropertyTraits<SVGPathByteStream>::parse):
1526         (WebCore::SVGPropertyTraits<SVGPathByteStream>::toString):
1527         * svg/SVGPointListValues.h:
1528         (WebCore::SVGPropertyTraits<SVGPointListValues>::parse):
1529         (WebCore::SVGPropertyTraits<SVGPointListValues>::toString):
1530         * svg/SVGPreserveAspectRatioValue.h:
1531         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::fromString):
1532         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::parse):
1533         (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::toString):
1534         Ditto.
1535
1536         * svg/SVGTransformListValues.h:
1537         (WebCore::SVGPropertyTraits<SVGTransformListValues>::parse):
1538         Ditto.
1539
1540         * svg/SVGValue.h: Added. SVGValueVariant is the replacement of the union
1541         SVGAnimatedType::DataUnion.
1542
1543         * svg/properties/SVGPropertyInfo.h:
1544         Add a minimum and maximum AnimatedPropertyType so, SVGAnimatedType::type()
1545         can assert that the index of the variant is in the range of this enum.
1546
1547         * svg/properties/SVGPropertyTraits.h:
1548         (WebCore::SVGPropertyTraits<bool>::parse):
1549         (WebCore::SVGPropertyTraits<unsigned>::parse):
1550         (WebCore::SVGPropertyTraits<int>::parse):
1551         Ditto.
1552
1553 2018-03-08  Yusuke Suzuki  <utatane.tea@gmail.com>
1554
1555         [JSC][WebCore] Extend jsDynamicCast for WebCore types in WebCore and remove jsDynamicDowncast
1556         https://bugs.webkit.org/show_bug.cgi?id=183449
1557
1558         Reviewed by Mark Lam.
1559
1560         This patch removes jsDynamicDowncast. Our JSC::jsDynamicCast can have a way to inject a fast
1561         path that is similar to jsDynamicDowncast. WebCore can leverage this functionality to add
1562         a fast path for WebCore's extended JS object types (JSEvent, JSElement, JSNode, and JSDocument).
1563
1564         No behavior change.
1565
1566         * WebCore.xcodeproj/project.pbxproj:
1567         * bindings/js/CommonVM.cpp:
1568         (WebCore::lexicalFrameFromCommonVM):
1569         * bindings/js/JSDOMConvertBufferSource.h:
1570         (WebCore::toPossiblySharedArrayBufferView):
1571         * bindings/js/JSDOMConvertPromise.h:
1572         (WebCore::Converter<IDLPromise<T>>::convert):
1573         * bindings/js/JSDOMExceptionHandling.cpp:
1574         (WebCore::reportException):
1575         (WebCore::retrieveErrorMessage):
1576         * bindings/js/JSDOMIterator.h:
1577         (WebCore::IteratorTraits>::next):
1578         * bindings/js/JSDOMWindowProxy.cpp:
1579         (WebCore::JSDOMWindowProxy::toWrapped):
1580         * bindings/js/JSDOMWrapperCache.h:
1581         * bindings/js/JSDocumentCustom.h:
1582         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSDocument>::inherits):
1583         (WebCore::jsDocumentCast): Deleted.
1584         * bindings/js/JSDynamicDowncast.h: Removed.
1585         * bindings/js/JSElementCustom.h:
1586         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSElement>::inherits):
1587         (WebCore::jsElementCast): Deleted.
1588         * bindings/js/JSEventCustom.h:
1589         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSEvent>::inherits):
1590         (WebCore::jsEventCast): Deleted.
1591         * bindings/js/JSEventTargetCustom.cpp:
1592         (WebCore::jsEventTargetCast):
1593         * bindings/js/JSNodeCustom.h:
1594         (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSNode>::inherits):
1595         (WebCore::jsNodeCast): Deleted.
1596         * bindings/js/JSPluginElementFunctions.cpp:
1597         (WebCore::pluginElementPropertyGetter):
1598         * bindings/js/JSReadableStreamSourceCustom.cpp:
1599         (WebCore::JSReadableStreamSource::start):
1600         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1601         (WebCore::toJSDedicatedWorkerGlobalScope):
1602         (WebCore::toJSWorkerGlobalScope):
1603         (WebCore::toJSServiceWorkerGlobalScope):
1604         * bindings/js/ReadableStream.cpp:
1605         (WebCore::ReadableStream::create):
1606         (WebCore::ReadableStream::isDisturbed):
1607         * bindings/js/ReadableStream.h:
1608         (WebCore::JSReadableStreamWrapperConverter::toWrapped):
1609         * bindings/js/ScriptModuleLoader.cpp:
1610         (WebCore::ScriptModuleLoader::evaluate):
1611         * bindings/js/SerializedScriptValue.cpp:
1612         (WebCore::CloneSerializer::dumpIfTerminal):
1613         (WebCore::CloneSerializer::serialize):
1614         * bindings/js/StructuredClone.cpp:
1615         (WebCore::structuredCloneArrayBufferView):
1616         * bindings/scripts/CodeGeneratorJS.pm:
1617         (GetCastingHelperForThisObject):
1618         (GenerateImplementation):
1619         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1620         (WebCore::jsInterfaceNameConstructor):
1621         (WebCore::setJSInterfaceNameConstructor):
1622         (WebCore::JSInterfaceName::toWrapped):
1623         * bindings/scripts/test/JS/JSMapLike.cpp:
1624         (WebCore::IDLAttribute<JSMapLike>::cast):
1625         (WebCore::IDLOperation<JSMapLike>::cast):
1626         (WebCore::jsMapLikeConstructor):
1627         (WebCore::setJSMapLikeConstructor):
1628         (WebCore::JSMapLike::toWrapped):
1629         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1630         (WebCore::IDLAttribute<JSReadOnlyMapLike>::cast):
1631         (WebCore::IDLOperation<JSReadOnlyMapLike>::cast):
1632         (WebCore::jsReadOnlyMapLikeConstructor):
1633         (WebCore::setJSReadOnlyMapLikeConstructor):
1634         (WebCore::JSReadOnlyMapLike::toWrapped):
1635         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1636         (WebCore::IDLAttribute<JSTestActiveDOMObject>::cast):
1637         (WebCore::IDLOperation<JSTestActiveDOMObject>::cast):
1638         (WebCore::jsTestActiveDOMObjectConstructor):
1639         (WebCore::setJSTestActiveDOMObjectConstructor):
1640         (WebCore::JSTestActiveDOMObject::toWrapped):
1641         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1642         (WebCore::IDLAttribute<JSTestCEReactions>::cast):
1643         (WebCore::IDLOperation<JSTestCEReactions>::cast):
1644         (WebCore::jsTestCEReactionsConstructor):
1645         (WebCore::setJSTestCEReactionsConstructor):
1646         (WebCore::JSTestCEReactions::toWrapped):
1647         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1648         (WebCore::IDLAttribute<JSTestCEReactionsStringifier>::cast):
1649         (WebCore::IDLOperation<JSTestCEReactionsStringifier>::cast):
1650         (WebCore::jsTestCEReactionsStringifierConstructor):
1651         (WebCore::setJSTestCEReactionsStringifierConstructor):
1652         (WebCore::JSTestCEReactionsStringifier::toWrapped):
1653         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1654         (WebCore::IDLAttribute<JSTestCallTracer>::cast):
1655         (WebCore::IDLOperation<JSTestCallTracer>::cast):
1656         (WebCore::jsTestCallTracerConstructor):
1657         (WebCore::setJSTestCallTracerConstructor):
1658         (WebCore::JSTestCallTracer::toWrapped):
1659         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1660         (WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
1661         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
1662         (WebCore::JSTestClassWithJSBuiltinConstructor::toWrapped):
1663         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1664         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
1665         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
1666         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
1667         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1668         (WebCore::IDLAttribute<JSTestDOMJIT>::cast):
1669         (WebCore::IDLOperation<JSTestDOMJIT>::cast):
1670         (WebCore::jsTestDOMJITConstructor):
1671         (WebCore::setJSTestDOMJITConstructor):
1672         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1673         (WebCore::IDLAttribute<JSTestEnabledBySetting>::cast):
1674         (WebCore::IDLOperation<JSTestEnabledBySetting>::cast):
1675         (WebCore::jsTestEnabledBySettingConstructor):
1676         (WebCore::setJSTestEnabledBySettingConstructor):
1677         (WebCore::JSTestEnabledBySetting::toWrapped):
1678         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1679         (WebCore::IDLAttribute<JSTestEventConstructor>::cast):
1680         (WebCore::jsTestEventConstructorConstructor):
1681         (WebCore::setJSTestEventConstructorConstructor):
1682         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1683         (WebCore::IDLOperation<JSTestEventTarget>::cast):
1684         (WebCore::jsTestEventTargetConstructor):
1685         (WebCore::setJSTestEventTargetConstructor):
1686         (WebCore::JSTestEventTarget::toWrapped):
1687         * bindings/scripts/test/JS/JSTestException.cpp:
1688         (WebCore::IDLAttribute<JSTestException>::cast):
1689         (WebCore::jsTestExceptionConstructor):
1690         (WebCore::setJSTestExceptionConstructor):
1691         (WebCore::JSTestException::toWrapped):
1692         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1693         (WebCore::IDLAttribute<JSTestGenerateIsReachable>::cast):
1694         (WebCore::jsTestGenerateIsReachableConstructor):
1695         (WebCore::setJSTestGenerateIsReachableConstructor):
1696         (WebCore::JSTestGenerateIsReachable::toWrapped):
1697         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1698         (WebCore::IDLAttribute<JSTestGlobalObject>::cast):
1699         (WebCore::IDLOperation<JSTestGlobalObject>::cast):
1700         (WebCore::jsTestGlobalObjectConstructor):
1701         (WebCore::setJSTestGlobalObjectConstructor):
1702         (WebCore::JSTestGlobalObject::toWrapped):
1703         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
1704         (WebCore::jsTestIndexedSetterNoIdentifierConstructor):
1705         (WebCore::setJSTestIndexedSetterNoIdentifierConstructor):
1706         (WebCore::JSTestIndexedSetterNoIdentifier::toWrapped):
1707         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
1708         (WebCore::jsTestIndexedSetterThrowingExceptionConstructor):
1709         (WebCore::setJSTestIndexedSetterThrowingExceptionConstructor):
1710         (WebCore::JSTestIndexedSetterThrowingException::toWrapped):
1711         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1712         (WebCore::IDLOperation<JSTestIndexedSetterWithIdentifier>::cast):
1713         (WebCore::jsTestIndexedSetterWithIdentifierConstructor):
1714         (WebCore::setJSTestIndexedSetterWithIdentifierConstructor):
1715         (WebCore::JSTestIndexedSetterWithIdentifier::toWrapped):
1716         * bindings/scripts/test/JS/JSTestInterface.cpp:
1717         (WebCore::IDLAttribute<JSTestInterface>::cast):
1718         (WebCore::IDLOperation<JSTestInterface>::cast):
1719         (WebCore::jsTestInterfaceConstructor):
1720         (WebCore::setJSTestInterfaceConstructor):
1721         (WebCore::JSTestInterface::toWrapped):
1722         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
1723         (WebCore::IDLAttribute<JSTestInterfaceLeadingUnderscore>::cast):
1724         (WebCore::jsTestInterfaceLeadingUnderscoreConstructor):
1725         (WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
1726         (WebCore::JSTestInterfaceLeadingUnderscore::toWrapped):
1727         * bindings/scripts/test/JS/JSTestIterable.cpp:
1728         (WebCore::IDLOperation<JSTestIterable>::cast):
1729         (WebCore::jsTestIterableConstructor):
1730         (WebCore::setJSTestIterableConstructor):
1731         (WebCore::JSTestIterable::toWrapped):
1732         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1733         (WebCore::IDLAttribute<JSTestJSBuiltinConstructor>::cast):
1734         (WebCore::IDLOperation<JSTestJSBuiltinConstructor>::cast):
1735         (WebCore::jsTestJSBuiltinConstructorConstructor):
1736         (WebCore::setJSTestJSBuiltinConstructorConstructor):
1737         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1738         (WebCore::IDLOperation<JSTestMediaQueryListListener>::cast):
1739         (WebCore::jsTestMediaQueryListListenerConstructor):
1740         (WebCore::setJSTestMediaQueryListListenerConstructor):
1741         (WebCore::JSTestMediaQueryListListener::toWrapped):
1742         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
1743         (WebCore::jsTestNamedAndIndexedSetterNoIdentifierConstructor):
1744         (WebCore::setJSTestNamedAndIndexedSetterNoIdentifierConstructor):
1745         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::toWrapped):
1746         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
1747         (WebCore::jsTestNamedAndIndexedSetterThrowingExceptionConstructor):
1748         (WebCore::setJSTestNamedAndIndexedSetterThrowingExceptionConstructor):
1749         (WebCore::JSTestNamedAndIndexedSetterThrowingException::toWrapped):
1750         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1751         (WebCore::IDLOperation<JSTestNamedAndIndexedSetterWithIdentifier>::cast):
1752         (WebCore::jsTestNamedAndIndexedSetterWithIdentifierConstructor):
1753         (WebCore::setJSTestNamedAndIndexedSetterWithIdentifierConstructor):
1754         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::toWrapped):
1755         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1756         (WebCore::jsTestNamedConstructorConstructor):
1757         (WebCore::setJSTestNamedConstructorConstructor):
1758         (WebCore::JSTestNamedConstructor::toWrapped):
1759         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1760         (WebCore::jsTestNamedDeleterNoIdentifierConstructor):
1761         (WebCore::setJSTestNamedDeleterNoIdentifierConstructor):
1762         (WebCore::JSTestNamedDeleterNoIdentifier::toWrapped):
1763         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1764         (WebCore::jsTestNamedDeleterThrowingExceptionConstructor):
1765         (WebCore::setJSTestNamedDeleterThrowingExceptionConstructor):
1766         (WebCore::JSTestNamedDeleterThrowingException::toWrapped):
1767         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1768         (WebCore::IDLOperation<JSTestNamedDeleterWithIdentifier>::cast):
1769         (WebCore::jsTestNamedDeleterWithIdentifierConstructor):
1770         (WebCore::setJSTestNamedDeleterWithIdentifierConstructor):
1771         (WebCore::JSTestNamedDeleterWithIdentifier::toWrapped):
1772         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1773         (WebCore::jsTestNamedDeleterWithIndexedGetterConstructor):
1774         (WebCore::setJSTestNamedDeleterWithIndexedGetterConstructor):
1775         (WebCore::JSTestNamedDeleterWithIndexedGetter::toWrapped):
1776         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
1777         (WebCore::jsTestNamedGetterCallWithConstructor):
1778         (WebCore::setJSTestNamedGetterCallWithConstructor):
1779         (WebCore::JSTestNamedGetterCallWith::toWrapped):
1780         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
1781         (WebCore::jsTestNamedGetterNoIdentifierConstructor):
1782         (WebCore::setJSTestNamedGetterNoIdentifierConstructor):
1783         (WebCore::JSTestNamedGetterNoIdentifier::toWrapped):
1784         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1785         (WebCore::IDLOperation<JSTestNamedGetterWithIdentifier>::cast):
1786         (WebCore::jsTestNamedGetterWithIdentifierConstructor):
1787         (WebCore::setJSTestNamedGetterWithIdentifierConstructor):
1788         (WebCore::JSTestNamedGetterWithIdentifier::toWrapped):
1789         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
1790         (WebCore::jsTestNamedSetterNoIdentifierConstructor):
1791         (WebCore::setJSTestNamedSetterNoIdentifierConstructor):
1792         (WebCore::JSTestNamedSetterNoIdentifier::toWrapped):
1793         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
1794         (WebCore::jsTestNamedSetterThrowingExceptionConstructor):
1795         (WebCore::setJSTestNamedSetterThrowingExceptionConstructor):
1796         (WebCore::JSTestNamedSetterThrowingException::toWrapped):
1797         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1798         (WebCore::IDLOperation<JSTestNamedSetterWithIdentifier>::cast):
1799         (WebCore::jsTestNamedSetterWithIdentifierConstructor):
1800         (WebCore::setJSTestNamedSetterWithIdentifierConstructor):
1801         (WebCore::JSTestNamedSetterWithIdentifier::toWrapped):
1802         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1803         (WebCore::IDLOperation<JSTestNamedSetterWithIndexedGetter>::cast):
1804         (WebCore::jsTestNamedSetterWithIndexedGetterConstructor):
1805         (WebCore::setJSTestNamedSetterWithIndexedGetterConstructor):
1806         (WebCore::JSTestNamedSetterWithIndexedGetter::toWrapped):
1807         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1808         (WebCore::IDLOperation<JSTestNamedSetterWithIndexedGetterAndSetter>::cast):
1809         (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterConstructor):
1810         (WebCore::setJSTestNamedSetterWithIndexedGetterAndSetterConstructor):
1811         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::toWrapped):
1812         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
1813         (WebCore::jsTestNamedSetterWithOverrideBuiltinsConstructor):
1814         (WebCore::setJSTestNamedSetterWithOverrideBuiltinsConstructor):
1815         (WebCore::JSTestNamedSetterWithOverrideBuiltins::toWrapped):
1816         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1817         (WebCore::IDLAttribute<JSTestNamedSetterWithUnforgableProperties>::cast):
1818         (WebCore::IDLOperation<JSTestNamedSetterWithUnforgableProperties>::cast):
1819         (WebCore::jsTestNamedSetterWithUnforgablePropertiesConstructor):
1820         (WebCore::setJSTestNamedSetterWithUnforgablePropertiesConstructor):
1821         (WebCore::JSTestNamedSetterWithUnforgableProperties::toWrapped):
1822         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1823         (WebCore::IDLAttribute<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>::cast):
1824         (WebCore::IDLOperation<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>::cast):
1825         (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor):
1826         (WebCore::setJSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor):
1827         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::toWrapped):
1828         * bindings/scripts/test/JS/JSTestNode.cpp:
1829         (WebCore::IDLAttribute<JSTestNode>::cast):
1830         (WebCore::IDLOperation<JSTestNode>::cast):
1831         (WebCore::jsTestNodeConstructor):
1832         (WebCore::setJSTestNodeConstructor):
1833         * bindings/scripts/test/JS/JSTestObj.cpp:
1834         (WebCore::IDLAttribute<JSTestObj>::cast):
1835         (WebCore::IDLOperation<JSTestObj>::cast):
1836         (WebCore::jsTestObjConstructor):
1837         (WebCore::setJSTestObjConstructor):
1838         (WebCore::JSTestObj::toWrapped):
1839         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1840         (WebCore::jsTestOverloadedConstructorsConstructor):
1841         (WebCore::setJSTestOverloadedConstructorsConstructor):
1842         (WebCore::JSTestOverloadedConstructors::toWrapped):
1843         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1844         (WebCore::jsTestOverloadedConstructorsWithSequenceConstructor):
1845         (WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor):
1846         (WebCore::JSTestOverloadedConstructorsWithSequence::toWrapped):
1847         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1848         (WebCore::IDLOperation<JSTestOverrideBuiltins>::cast):
1849         (WebCore::jsTestOverrideBuiltinsConstructor):
1850         (WebCore::setJSTestOverrideBuiltinsConstructor):
1851         (WebCore::JSTestOverrideBuiltins::toWrapped):
1852         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
1853         (WebCore::jsTestPluginInterfaceConstructor):
1854         (WebCore::setJSTestPluginInterfaceConstructor):
1855         (WebCore::JSTestPluginInterface::toWrapped):
1856         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1857         (WebCore::IDLAttribute<JSTestPromiseRejectionEvent>::cast):
1858         (WebCore::jsTestPromiseRejectionEventConstructor):
1859         (WebCore::setJSTestPromiseRejectionEventConstructor):
1860         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1861         (WebCore::IDLAttribute<JSTestSerialization>::cast):
1862         (WebCore::IDLOperation<JSTestSerialization>::cast):
1863         (WebCore::jsTestSerializationConstructor):
1864         (WebCore::setJSTestSerializationConstructor):
1865         (WebCore::JSTestSerialization::toWrapped):
1866         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
1867         (WebCore::jsTestSerializationIndirectInheritanceConstructor):
1868         (WebCore::setJSTestSerializationIndirectInheritanceConstructor):
1869         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
1870         (WebCore::IDLAttribute<JSTestSerializationInherit>::cast):
1871         (WebCore::IDLOperation<JSTestSerializationInherit>::cast):
1872         (WebCore::jsTestSerializationInheritConstructor):
1873         (WebCore::setJSTestSerializationInheritConstructor):
1874         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
1875         (WebCore::IDLAttribute<JSTestSerializationInheritFinal>::cast):
1876         (WebCore::IDLOperation<JSTestSerializationInheritFinal>::cast):
1877         (WebCore::jsTestSerializationInheritFinalConstructor):
1878         (WebCore::setJSTestSerializationInheritFinalConstructor):
1879         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1880         (WebCore::IDLAttribute<JSTestSerializedScriptValueInterface>::cast):
1881         (WebCore::IDLOperation<JSTestSerializedScriptValueInterface>::cast):
1882         (WebCore::jsTestSerializedScriptValueInterfaceConstructor):
1883         (WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
1884         (WebCore::JSTestSerializedScriptValueInterface::toWrapped):
1885         * bindings/scripts/test/JS/JSTestStringifier.cpp:
1886         (WebCore::IDLOperation<JSTestStringifier>::cast):
1887         (WebCore::jsTestStringifierConstructor):
1888         (WebCore::setJSTestStringifierConstructor):
1889         (WebCore::JSTestStringifier::toWrapped):
1890         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1891         (WebCore::IDLOperation<JSTestStringifierAnonymousOperation>::cast):
1892         (WebCore::jsTestStringifierAnonymousOperationConstructor):
1893         (WebCore::setJSTestStringifierAnonymousOperationConstructor):
1894         (WebCore::JSTestStringifierAnonymousOperation::toWrapped):
1895         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1896         (WebCore::IDLOperation<JSTestStringifierNamedOperation>::cast):
1897         (WebCore::jsTestStringifierNamedOperationConstructor):
1898         (WebCore::setJSTestStringifierNamedOperationConstructor):
1899         (WebCore::JSTestStringifierNamedOperation::toWrapped):
1900         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1901         (WebCore::IDLOperation<JSTestStringifierOperationImplementedAs>::cast):
1902         (WebCore::jsTestStringifierOperationImplementedAsConstructor):
1903         (WebCore::setJSTestStringifierOperationImplementedAsConstructor):
1904         (WebCore::JSTestStringifierOperationImplementedAs::toWrapped):
1905         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1906         (WebCore::IDLOperation<JSTestStringifierOperationNamedToString>::cast):
1907         (WebCore::jsTestStringifierOperationNamedToStringConstructor):
1908         (WebCore::setJSTestStringifierOperationNamedToStringConstructor):
1909         (WebCore::JSTestStringifierOperationNamedToString::toWrapped):
1910         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1911         (WebCore::IDLAttribute<JSTestStringifierReadOnlyAttribute>::cast):
1912         (WebCore::IDLOperation<JSTestStringifierReadOnlyAttribute>::cast):
1913         (WebCore::jsTestStringifierReadOnlyAttributeConstructor):
1914         (WebCore::setJSTestStringifierReadOnlyAttributeConstructor):
1915         (WebCore::JSTestStringifierReadOnlyAttribute::toWrapped):
1916         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1917         (WebCore::IDLAttribute<JSTestStringifierReadWriteAttribute>::cast):
1918         (WebCore::IDLOperation<JSTestStringifierReadWriteAttribute>::cast):
1919         (WebCore::jsTestStringifierReadWriteAttributeConstructor):
1920         (WebCore::setJSTestStringifierReadWriteAttributeConstructor):
1921         (WebCore::JSTestStringifierReadWriteAttribute::toWrapped):
1922         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1923         (WebCore::IDLAttribute<JSTestTypedefs>::cast):
1924         (WebCore::IDLOperation<JSTestTypedefs>::cast):
1925         (WebCore::jsTestTypedefsConstructor):
1926         (WebCore::setJSTestTypedefsConstructor):
1927         (WebCore::JSTestTypedefs::toWrapped):
1928         * bridge/objc/WebScriptObject.mm:
1929         (-[WebScriptObject setValue:forKey:]):
1930         * bridge/runtime_array.cpp:
1931         (JSC::RuntimeArray::lengthGetter):
1932         * bridge/runtime_method.cpp:
1933         (JSC::RuntimeMethod::lengthGetter):
1934         * html/HTMLMediaElement.cpp:
1935         (WebCore::controllerJSValue):
1936         (WebCore::HTMLMediaElement::updateCaptionContainer):
1937         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
1938         * inspector/agents/InspectorDOMAgent.cpp:
1939         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
1940
1941 2018-03-08  Yusuke Suzuki  <utatane.tea@gmail.com>
1942
1943         [JSC] Add inherits<T>(VM&) leveraging JSCast fast path
1944         https://bugs.webkit.org/show_bug.cgi?id=183429
1945
1946         Reviewed by Mark Lam.
1947
1948         * bindings/js/IDBBindingUtilities.cpp:
1949         (WebCore::createIDBKeyFromValue):
1950         * bindings/js/JSDOMConvertDate.cpp:
1951         (WebCore::valueToDate):
1952         * bindings/js/JSDOMGlobalObject.cpp:
1953         (WebCore::JSDOMGlobalObject::scriptExecutionContext const):
1954         * bindings/js/JSDOMWindowCustom.cpp:
1955         (WebCore::JSDOMWindow::toWrapped):
1956         * bindings/js/JSEventTargetCustom.cpp:
1957         * bindings/js/JSNodeCustom.cpp:
1958         (WebCore::JSNode::pushEventHandlerScope const):
1959         * bindings/js/JSXPathNSResolverCustom.cpp:
1960         (WebCore::JSXPathNSResolver::toWrapped):
1961         * bindings/js/ScriptState.cpp:
1962         (WebCore::domWindowFromExecState):
1963         (WebCore::scriptExecutionContextFromExecState):
1964         * bindings/js/SerializedScriptValue.cpp:
1965         (WebCore::CloneSerializer::isArray):
1966         (WebCore::CloneSerializer::isMap):
1967         (WebCore::CloneSerializer::isSet):
1968         (WebCore::CloneSerializer::dumpArrayBufferView):
1969         (WebCore::CloneSerializer::dumpDOMPoint):
1970         (WebCore::CloneSerializer::dumpDOMRect):
1971         (WebCore::CloneSerializer::dumpDOMMatrix):
1972         (WebCore::CloneSerializer::dumpIfTerminal):
1973         (WebCore::CloneDeserializer::CloneDeserializer):
1974         (WebCore::CloneDeserializer::readArrayBufferView):
1975         * bindings/scripts/CodeGeneratorJS.pm:
1976         (GenerateOverloadDispatcher):
1977         * bindings/scripts/test/JS/JSTestObj.cpp:
1978         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher):
1979         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameterOverloadDispatcher):
1980         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithDistinguishingUnionOverloadDispatcher):
1981         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWith2DistinguishingUnionsOverloadDispatcher):
1982         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithNonDistinguishingUnionOverloadDispatcher):
1983         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnionOverloadDispatcher):
1984         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameterOverloadDispatcher):
1985         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunctionOverloadDispatcher):
1986         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1987         (WebCore::JSTestOverloadedConstructorsConstructor::construct):
1988         * bridge/c/c_instance.cpp:
1989         (JSC::Bindings::CInstance::invokeMethod):
1990         * bridge/objc/WebScriptObject.mm:
1991         (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
1992         * bridge/objc/objc_instance.mm:
1993         (ObjcInstance::invokeMethod):
1994         * bridge/objc/objc_runtime.mm:
1995         (JSC::Bindings::callObjCFallbackObject):
1996         * bridge/runtime_method.cpp:
1997         (JSC::callRuntimeMethod):
1998         * bridge/runtime_object.cpp:
1999         (JSC::Bindings::callRuntimeObject):
2000         (JSC::Bindings::callRuntimeConstructor):
2001         * inspector/WebInjectedScriptHost.cpp:
2002         (WebCore::WebInjectedScriptHost::subtype):
2003         (WebCore::WebInjectedScriptHost::isHTMLAllCollection):
2004
2005 2018-03-08  Tim Horton  <timothy_horton@apple.com>
2006
2007         Stop linking ApplicationServices directly
2008         https://bugs.webkit.org/show_bug.cgi?id=182867
2009         <rdar://problem/38252142>
2010
2011         Reviewed by Alex Christensen.
2012
2013         The frameworks that we use that live inside ApplicationServices
2014         have mostly moved out, so import them directly.
2015
2016         * Configurations/WebCore.xcconfig:
2017         * html/canvas/CanvasRenderingContext2D.cpp:
2018         * html/canvas/CanvasRenderingContext2DBase.cpp:
2019         * platform/MIMETypeRegistry.cpp:
2020         * platform/graphics/ComplexTextController.cpp:
2021         * platform/graphics/cg/ColorCG.cpp:
2022         * platform/graphics/cg/ImageDecoderCG.cpp:
2023         * platform/graphics/cg/UTIRegistry.cpp:
2024         * platform/graphics/cocoa/FontCocoa.mm:
2025         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2026         * platform/graphics/mac/GlyphPageMac.cpp:
2027         * platform/graphics/mac/PDFDocumentImageMac.mm:
2028         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
2029         * platform/graphics/win/FontCGWin.cpp:
2030         * platform/graphics/win/FontCacheWin.cpp:
2031         * platform/graphics/win/FontCustomPlatformData.cpp:
2032         * platform/graphics/win/FontPlatformDataCGWin.cpp:
2033         * platform/graphics/win/ImageCGWin.cpp:
2034         * platform/graphics/win/SimpleFontDataCGWin.cpp:
2035
2036 2018-03-07  Tim Horton  <timothy_horton@apple.com>
2037
2038         Sort and separate FeatureDefines.xcconfig
2039         https://bugs.webkit.org/show_bug.cgi?id=183427
2040
2041         Reviewed by Dan Bernstein.
2042
2043         * Configurations/FeatureDefines.xcconfig:
2044         Sort and split FeatureDefines into paragraphs
2045         (to make it easier to sort later).
2046
2047 2018-03-07  Zalan Bujtas  <zalan@apple.com>
2048
2049         Invalid innerTextRenderer in RenderTextControlSingleLine::styleDidChange()
2050         https://bugs.webkit.org/show_bug.cgi?id=183385
2051         <rdar://problem/38085397>
2052
2053         Reviewed by Antti Koivisto.
2054
2055         When HTMLInputElement::updateType() is called with a dirty value, we eagerly change the m_inputType first
2056         and then we take care of the dirty value by calling setAttributeWithoutSynchronization().
2057         With a DOMSubtreeModified event listener attached, setAttributeWithoutSynchronization() can end up running some
2058         layout code (offsetHeight) with a renderer - m_inputType mismatch.
2059
2060         This patch ensures that we don't change the m_inputType until after we finished setting the new value.
2061
2062         Test: fast/DOM/HTMLInputElement/input-value-and-type-change-crash.html
2063
2064         * html/HTMLInputElement.cpp:
2065         (WebCore::HTMLInputElement::updateType):
2066
2067 2018-03-07  Chris Dumez  <cdumez@apple.com>
2068
2069         Get rid of custom bindings for History's replaceState() / pushState()
2070         https://bugs.webkit.org/show_bug.cgi?id=183372
2071
2072         Reviewed by Youenn Fablet.
2073
2074         Get rid of custom bindings for History's replaceState() / pushState() by
2075         moving the cached state from the wrapper to the History implementation
2076         object.
2077
2078         No new tests, no web-facing behavior change.
2079
2080         * bindings/js/JSHistoryCustom.cpp:
2081         (WebCore::JSHistory::state const):
2082         (WebCore::JSHistory::visitAdditionalChildren):
2083         * page/History.cpp:
2084         (WebCore::History::cachedState):
2085         (WebCore::History::stateObjectAdded):
2086         * page/History.h:
2087         (WebCore::History::pushState):
2088         (WebCore::History::replaceState):
2089         * page/History.idl:
2090
2091 2018-03-07  Youenn Fablet  <youenn@apple.com>
2092
2093         Match unsupported plugins based on domains and not origin
2094         https://bugs.webkit.org/show_bug.cgi?id=183384
2095
2096         Reviewed by Chris Dumez.
2097
2098         Move from an origin-keyed map to a vector of plugins.
2099         We iterate through the vector and a match happens if the page host name ends with the provided matching domain.
2100         This allows supporting rules for *.mydomain.com by passing 'mydomain.com'.
2101         Covered by existing tests.
2102         We are not testing subdomains like www.localhost since there is no support in our CI but this is tested through Unit tests.
2103
2104         * loader/EmptyClients.cpp:
2105         * platform/URL.cpp:
2106         (WebCore::URL::isMatchingDomain const):
2107         * platform/URL.h:
2108         * plugins/PluginData.h:
2109         (WebCore::isSupportedPlugin):
2110         (WebCore::SupportedPluginName::decode):
2111         (WebCore::SupportedPluginName::encode const):
2112         * plugins/PluginInfoProvider.h:
2113
2114 2017-12-18  Youenn Fablet  <youenn@apple.com>
2115
2116         Update to libwebrtc revision 4e70a72571dd26b85c2385e9c618e343428df5d3
2117         https://bugs.webkit.org/show_bug.cgi?id=180843
2118
2119         Reviewed by Eric Carlson.
2120
2121         Covered by existing tests.
2122
2123         Moving H264 codecs and factories to libwebrtc.
2124         Updating LibWebRTCProvider according new libwebrtc API.
2125         Updating ref counting according new libwebrtc API.
2126
2127         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2128         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2129         (WebCore::LibWebRTCMediaEndpoint::AddRef const):
2130         (WebCore::LibWebRTCMediaEndpoint::Release const):
2131         (WTF::LogArgument<webrtc::RTCStats>::toString):
2132         * WebCore.xcodeproj/project.pbxproj:
2133         * platform/mediastream/RealtimeOutgoingAudioSource.h:
2134         * platform/mediastream/RealtimeOutgoingVideoSource.h:
2135         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
2136         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2137         (WebCore::LibWebRTCProvider::createPeerConnectionFactory):
2138         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2139         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
2140         (WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
2141         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
2142         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
2143         (WebCore::LibWebRTCProviderCocoa::setActive):
2144         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
2145         * platform/mediastream/libwebrtc/VideoToolBoxDecoderFactory.cpp: Removed.
2146         * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.cpp: Removed.
2147         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
2148         (WebCore::ConvertToI420):
2149         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
2150         * testing/Internals.cpp:
2151         (WebCore::Internals::setH264HardwareEncoderAllowed):
2152         * testing/MockLibWebRTCPeerConnection.h:
2153
2154 2018-03-07  Sihui Liu  <sihui_liu@apple.com>
2155
2156         replaceState cause back/forward malfunction on html page with <base href="/"> tag
2157         https://bugs.webkit.org/show_bug.cgi?id=182678
2158         <rdar://problem/37517821>
2159
2160         Reviewed by Chris Dumez.
2161
2162         replaceState should not change URL when the URL argument is NULL, but should change URL when the URL argument is an empty string.
2163
2164         Test: http/tests/history/replacestate-no-url.html
2165
2166         * page/History.cpp:
2167         (WebCore::History::urlForState):
2168
2169 2018-03-07  Antti Koivisto  <antti@apple.com>
2170
2171         Don't invalidate descendants for sibling combinators unless needed
2172         https://bugs.webkit.org/show_bug.cgi?id=183410
2173         <rdar://problem/38227297>
2174
2175         Reviewed by Zalan Bujtas.
2176
2177         If we know the matched sibling combinator doesn't affect descendants we shouldn't invalidate them.
2178
2179         * css/SelectorChecker.cpp:
2180         (WebCore::SelectorChecker::matchRecursively const):
2181
2182             Use different bit for the descendant case.
2183
2184         * cssjit/SelectorCompiler.cpp:
2185         (WebCore::SelectorCompiler::fragmentMatchesTheRightmostElement):
2186
2187             Remove unneeded context assert.
2188
2189         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
2190
2191             Use different bit for the descendant case.
2192
2193         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorCheckerExcludingPseudoElements):
2194         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasPseudoElement):
2195         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateRequestedPseudoElementEqualsToSelectorPseudoElement):
2196         * dom/Element.cpp:
2197         (WebCore::invalidateForSiblingCombinators):
2198
2199             Invalidate the target sibling or all descendants based on the bits.
2200
2201         * dom/Element.h:
2202         (WebCore::Element::descendantsAffectedByPreviousSibling const):
2203         (WebCore::Element::setDescendantsAffectedByPreviousSibling const):
2204         * dom/Node.h:
2205         * style/StyleRelations.cpp:
2206         (WebCore::Style::commitRelationsToRenderStyle):
2207         (WebCore::Style::commitRelations):
2208         * style/StyleRelations.h:
2209
2210             Add DescendantsAffectedByPreviousSibling bit. AffectedByPreviousSibling is now just about the target element.
2211
2212 2018-03-07  Antti Koivisto  <antti@apple.com>
2213
2214         checkForSiblingStyleChanges should use internal versions of the invalidation functions
2215         https://bugs.webkit.org/show_bug.cgi?id=183405
2216         <rdar://problem/38218310>
2217
2218         Reviewed by Zalan Bujtas.
2219
2220         Non-internal invalidateStyleForElement/Subtree() implement sibling combinator invalidation. Checking this
2221         is only needed if the element in question changed somehow. In checkForSiblingStyleChanges we know that
2222         another element changed and we really just want to invalidate.
2223
2224         * css/SelectorChecker.cpp:
2225         (WebCore::isFirstOfType):
2226         (WebCore::SelectorChecker::checkOne const):
2227
2228         Also make :first-of-type use ChildrenAffectedByForwardPositionalRules for invalidation similar to :last-of-type
2229         for more correct invalidation.
2230
2231         * dom/Element.cpp:
2232         (WebCore::checkForSiblingStyleChanges):
2233
2234 2018-03-07  Yusuke Suzuki  <utatane.tea@gmail.com>
2235
2236         HTML `pattern` attribute should set `u` flag for regular expressions
2237         https://bugs.webkit.org/show_bug.cgi?id=151598
2238
2239         Reviewed by Chris Dumez.
2240
2241         This patch attaches "u" flag to the RegExp compiled for HTML "pattern" attribute[1].
2242
2243         [1]: https://html.spec.whatwg.org/multipage/forms.html#the-pattern-attribute
2244
2245         * html/BaseTextInputType.cpp:
2246         (WebCore::BaseTextInputType::patternMismatch const):
2247
2248 2018-03-07  Frederic Wang  <fwang@igalia.com>
2249
2250         Relayout frames after AsyncFrameScrolling or FrameFlattening option is changed
2251         https://bugs.webkit.org/show_bug.cgi?id=183081
2252
2253         Reviewed by Antonio Gomes.
2254
2255         The frames may be resized when the FrameFlattening option is modified and hence this patch
2256         forces a relayout. It also does that when AsyncFrameScrolling is modified too, since that
2257         may imply changes in frame flattening after bug 173704. Forcing a relayout will also be
2258         enough to trigger other updates for async frame scrolling in the future (see bug 149264 and
2259         bug 171667).
2260
2261         Test: platform/ios/fast/frames/flattening/iframe-flattening-async-frame-scrolling-dynamic.html
2262
2263         * page/Settings.yaml: Call setNeedsRelayoutAllFrames when one of the AsyncFrameScrolling or
2264         FrameFlattening options is changed.
2265         * page/SettingsBase.cpp: Include RenderWidget to make call on frame->ownerRenderer().
2266         (WebCore::SettingsBase::setNeedsRelayoutAllFrames):  Make layout and preferred widths dirty
2267         on all frames in the page and schedule a relayout.
2268         * page/SettingsBase.h: Declare setNeedsRelayoutAllFrames().
2269
2270 2018-03-07  Alejandro G. Castro  <alex@igalia.com>
2271
2272         Make NetworkRTCResolver port agnostic
2273         https://bugs.webkit.org/show_bug.cgi?id=178855
2274
2275         Reviewed by Youenn Fablet.
2276
2277         Add new API in the DNSResolveQueue allowing to revolve hostnames and get the result. Add platform
2278         specific code for soup platform and refactor the other platforms. Added new API to the DNS API header
2279         and move the general code to the DNS.cpp file, that way we can reuse that code in all the platforms
2280         and leave the ResolveQueue class of the platforms in a file.
2281
2282         No new tests because this is a refactor.
2283
2284         * PlatformAppleWin.cmake: Move the DNSCFNet class to DNSResolveQueueCFNet.
2285         * PlatformMac.cmake: Ditto.
2286         * Sources.txt: Add the DNS.cpp for compilation.
2287         * SourcesCocoa.txt: Move the DNSCFNet class to DNSResolveQueueCFNet.
2288         * WebCore.xcodeproj/project.pbxproj: Move the DNSCFNet class to DNSResolveQueueCFNet, add the DNS.cpp
2289         for compilation. Add the new DNSResolveQueueCFNet class.
2290         * platform/Curl.cmake: Move the DNSCFNet class to DNSResolveQueueCurl.
2291         * platform/network/DNS.cpp: Add this file with the default implementation of the DNS functions for
2292         all the platforms.
2293         (WebCore::prefetchDNS): Copied from every platform implementation.
2294         (WebCore::resolveDNS): Add the function, resolves a hostname, receives the identifier of the operation
2295         and the completion handler.
2296         (WebCore::stopResolveDNS): Add the function, stops a resolution operation, receives the identifier
2297         of the operation.
2298         * platform/network/DNS.h: Add the new APIs resolveDNS and stopResolveDNS with the classes used for the
2299         implementation.
2300         (WebCore::IPAddress::IPAddress): Add this class used to send the resolved address information, it does
2301         not depend on libwebrtc rtc classes.
2302         (WebCore::IPAddress::get): Get a reference to the struct sockaddr_in in the IPAddress class.
2303         (WebCore::DNSCompletionHandler): Add this CompletionHandler type to be used when resolving the DNS
2304         address.
2305         * platform/network/DNSResolveQueue.cpp: Add the DNSResolveQueue platform instantiation in the singleton.
2306         (WebCore::DNSResolveQueue::singleton): Use DNSResolveQueue platform classes when creating the singleton..
2307         (WebCore::DNSResolveQueue::resolve): Add this method to get the address of a hostname, it sends the
2308         identifier and the completion handler to use when returning the result.
2309         (WebCore::DNSResolveQueue::stopResolve): Add this method to stop the resolve operation when required.
2310         * platform/network/DNSResolveQueue.h: Add the new methods and make the class abstract, so that every
2311         platform can implement the functions.
2312         * platform/network/cf/DNSResolveQueueCFNet.cpp: Renamed from Source/WebCore/platform/network/cf/DNSCFNet.cpp.
2313         Add the methods to the new class DNSResolveQueueCFNet, move the prefetchDNS to the DNS.cpp general
2314         implementation.
2315         * platform/network/cf/DNSResolveQueueCFNet.h: Add the new class inheriting from the DNSResolveQueue. Add the
2316         new methods, we have to implement these methods and move the NetworkRTCResolver for COCOA code here.
2317         (WebCore::DNSResolveQueueCF::resolve): Dummy method, not implemented.
2318         (WebCore::DNSResolveQueueCF::stopResolve): Ditto.
2319         * platform/network/curl/DNSResolveQueueCurl.cpp: Renamed from Source/WebCore/platform/network/curl/DNSCurl.cpp.
2320         * platform/network/curl/DNSResolveQueueCurl.h: Add the new class inheriting from the DNSResolveQueue.
2321         (WebCore::DNSResolveQueueCurl::resolve): Ditto.
2322         (WebCore::DNSResolveQueueCurl::stopResolve): Ditto.
2323         * platform/network/soup/DNSResolveQueueSoup.h: New class inheriting from the DNSResolveQueue class, adding
2324         a HasMap with the active operations, it allows stopping them.
2325         * platform/network/soup/DNSResolveQueueSoup.cpp: Renamed from Source/WebCore/platform/network/curl/DNSSoup.cpp.
2326         (WebCore::resolvedWithObserverCallback): Called when the result address from the soup platform is ready,
2327         sends the address to the completion handler.
2328         (WebCore::DNSResolveQueueSoup::resolve): Launch the resolve operation with the soup library.
2329         (WebCore::DNSResolveQueueSoup::stopResolve): Stop the resolve operation on process with a GCancellable.
2330
2331 2018-03-06  Brian Burg  <bburg@apple.com>
2332
2333         [Cocoa] Stop copying ForwardingHeaders directory that no longer exists
2334         https://bugs.webkit.org/show_bug.cgi?id=183396
2335
2336         Reviewed by Dan Bernstein.
2337
2338         * WebCore.xcodeproj/project.pbxproj:
2339         Rename the phase to "Copy ICU Headers". ForwardingHeaders are no longer a thing.
2340
2341 2018-03-06  Youenn Fablet  <youenn@apple.com>
2342
2343         didReceiveServerRedirectForProvisionalNavigation is not called in case of document redirection with service worker registration change
2344         https://bugs.webkit.org/show_bug.cgi?id=183299
2345         <rdar://problem/37547029>
2346
2347         Reviewed by Alex Christensen.
2348
2349         In case of redirection with service worker registration change, we cancel the load and create a new one.
2350         This prevent ResourceLoader::willSendRequestInternal to call the didReceiveServerRedirectForProvisionalNavigation
2351         callback. We thus explictly call this callback after restarting the load with the new service worker step.
2352         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.
2353
2354         Test: http/wpt/service-workers/navigation-redirect-main-frame.https.html
2355
2356         * loader/DocumentLoader.cpp:
2357         (WebCore::DocumentLoader::restartLoadingDueToServiceWorkerRegistrationChange):
2358
2359 2018-03-06  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2360
2361         [Curl] Remove unnecessary copied ResourceRequest member variable.
2362         https://bugs.webkit.org/show_bug.cgi?id=183010
2363
2364         Reviewed by Youenn Fablet.
2365
2366         * platform/network/ResourceHandle.h:
2367         * platform/network/ResourceHandleInternal.h:
2368         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
2369         * platform/network/curl/CurlRequest.h:
2370         (WebCore::CurlRequest::resourceRequest const):
2371         * platform/network/curl/ResourceHandleCurl.cpp:
2372         (WebCore::ResourceHandle::start):
2373         (WebCore::ResourceHandle::addCacheValidationHeaders):
2374         (WebCore::ResourceHandle::createCurlRequest):
2375         (WebCore::ResourceHandle::restartRequestWithCredential):
2376         (WebCore::ResourceHandle::continueAfterWillSendRequest):
2377
2378 2018-03-06  Nan Wang  <n_wang@apple.com>
2379
2380         AX: Flaky test after r229310
2381         https://bugs.webkit.org/show_bug.cgi?id=183376
2382         <rdar://problem/38188685>
2383
2384         Reviewed by Chris Fleizach.
2385
2386         The test that forces the context menu to show sometimes locks up 
2387         the test runner. Also, we missed a case where calling AXShowMenu
2388         action on a combobox is not dispatching the accessibility event.
2389
2390         Using the combobox example to test the event dispatching in order to
2391         avoid the test hang.
2392
2393         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2394         (-[WebAccessibilityObjectWrapper accessibilityPerformShowMenuAction]):
2395         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
2396
2397 2018-03-06  Chris Dumez  <cdumez@apple.com>
2398
2399         fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed.html fails with async policy delegates
2400         https://bugs.webkit.org/show_bug.cgi?id=183345
2401
2402         Reviewed by Alex Christensen.
2403
2404         FrameLoader::loadURL() was calling loadWithNavigationAction() and then resetting the
2405         m_quickRedirectComing flag right after. This works if the navigation policy decision
2406         triggered by loadWithNavigationAction() is made synchronously. However, when it is
2407         made asynchronously, the flag gets reset too early, before the policy decision
2408         handler has been called. This is an issue because the policy decision handler
2409         relies on the m_quickRedirectComing flag.
2410
2411         Similarly, FrameLoader::loadFrameRequest() was calling loadPostRequest() / loadURL()
2412         and then focusing a frame right after. This does not work as intended when the navigation
2413         policy decision is made asynchronously.
2414
2415         To address the issue, we now pass a completion handler that gets called when the operation
2416         has actually completion, after the policy decision has been made. This maintains the
2417         behavior in place with synchronous policy delegates.
2418
2419         Test: fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed-async-delegates.html
2420
2421         * loader/FrameLoader.cpp:
2422         (WebCore::FrameLoader::loadURLIntoChildFrame):
2423         (WebCore::FrameLoader::loadFrameRequest):
2424         (WebCore::FrameLoader::loadURL):
2425         (WebCore::FrameLoader::loadWithNavigationAction):
2426         (WebCore::FrameLoader::load):
2427         (WebCore::FrameLoader::loadWithDocumentLoader):
2428         (WebCore::FrameLoader::reloadWithOverrideEncoding):
2429         (WebCore::FrameLoader::reload):
2430         (WebCore::FrameLoader::loadPostRequest):
2431         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
2432         (WebCore::FrameLoader::loadDifferentDocumentItem):
2433         * loader/FrameLoader.h:
2434
2435 2018-03-06  Antoine Quint  <graouts@apple.com>
2436
2437         [Web Animations] Add a new CSSTransition subclass of WebAnimation
2438         https://bugs.webkit.org/show_bug.cgi?id=183373
2439         <rdar://problem/38181985>
2440
2441         Reviewed by Dean Jackson.
2442
2443         Adding a new CSSAnimation subclass which we will create in a later patch while resolving styles
2444         upon identifying that a new CSS Animation has been added to an element.
2445
2446         * CMakeLists.txt:
2447         * DerivedSources.make:
2448         * Sources.txt:
2449         * WebCore.xcodeproj/project.pbxproj:
2450         * animation/CSSTransition.cpp: Added.
2451         (WebCore::CSSTransition::create):
2452         (WebCore::CSSTransition::CSSTransition):
2453         * animation/CSSTransition.h: Added.
2454         * animation/CSSTransition.idl: Added.
2455         * animation/KeyframeEffect.cpp:
2456         * animation/WebAnimation.h:
2457         (WebCore::WebAnimation::isCSSTransition const):
2458         * bindings/js/JSWebAnimationCustom.cpp:
2459         (WebCore::toJSNewlyCreated):
2460         * bindings/js/WebCoreBuiltinNames.h:
2461
2462 2018-03-06  Megan Gardner  <megan_gardner@apple.com>
2463
2464         Ensure system appearance is default for web content
2465         https://bugs.webkit.org/show_bug.cgi?id=183354
2466         <rdar://problem/36975571>
2467         <rdar://problem/38162381>
2468
2469         Make sure the the system appearance for web content is default, and
2470         consolidate that code to a single class.
2471
2472         Reviewed by Tim Horton.
2473
2474         Not currently testable, will add tests in a future patch.
2475
2476         * WebCore.xcodeproj/project.pbxproj:
2477         * platform/mac/LocalDefaultSystemAppearance.h: Added.
2478         * platform/mac/LocalDefaultSystemAppearance.mm: Added.
2479         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
2480         (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
2481         * platform/mac/ThemeMac.mm:
2482         (-[WebCoreThemeView init]):
2483         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
2484         * rendering/RenderThemeMac.mm:
2485         (WebCore::RenderThemeMac::systemColor const):
2486
2487 2018-03-06  Antoine Quint  <graouts@apple.com>
2488
2489         [Web Animations] Add a new runtime flag to control whether CSS Animations and CSS Transitions should run using the Web Animations timeline
2490         https://bugs.webkit.org/show_bug.cgi?id=183370
2491         <rdar://problem/38180729>
2492
2493         Reviewed by Dean Jackson.
2494
2495         Before we start creating WebAnimation objects to perform CSS Animations and CSS Transitions, which will replace the existing codepath
2496         involving CSSAnimationController and CompositeAnimation, we need a runtime flag that will allow all the new code to be turned off by
2497         default while we bring this feature up.
2498
2499         * page/RuntimeEnabledFeatures.h:
2500         (WebCore::RuntimeEnabledFeatures::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
2501         (WebCore::RuntimeEnabledFeatures::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled const):
2502
2503 2018-03-06  Daniel Bates  <dabates@apple.com>
2504
2505         Make more use of USE(OPENGL_ES) and replace typedefs with C++11 using statements
2506         in TextureCacheCV.h
2507
2508         Rubber-stamped by Tim Horton.
2509
2510         * platform/graphics/cv/TextureCacheCV.h:
2511
2512 2018-03-06  Antti Koivisto  <antti@apple.com>
2513
2514         Cache hasComplexSelectorsForStyleAttribute bit
2515         https://bugs.webkit.org/show_bug.cgi?id=183363
2516
2517         Reviewed by Andreas Kling.
2518
2519         * css/DocumentRuleSets.cpp:
2520         (WebCore::DocumentRuleSets::collectFeatures const):
2521         (WebCore::DocumentRuleSets::hasComplexSelectorsForStyleAttribute const):
2522
2523         Cache the bit to avoid hash lookups.
2524
2525         * css/DocumentRuleSets.h:
2526         * dom/StyledElement.cpp:
2527         (WebCore::StyledElement::invalidateStyleAttribute):
2528         (WebCore::shouldSynchronizeStyleAttributeImmediatelyForInvalidation): Deleted.
2529
2530         Move code to DocumentRuleSets.
2531
2532 2018-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
2533
2534         Change the type of SVGToOTFFontConverter::m_weight to be not a char
2535         https://bugs.webkit.org/show_bug.cgi?id=183339
2536
2537         Reviewed by Alex Christensen.
2538
2539         No new tests because there is no behavior change.
2540
2541         * svg/SVGToOTFFontConversion.cpp:
2542         (WebCore::SVGToOTFFontConverter::appendOS2Table):
2543         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
2544
2545 2018-03-06  Antoine Quint  <graouts@apple.com>
2546
2547         [Web Animations] Add a new CSSAnimation subclass of WebAnimation
2548         https://bugs.webkit.org/show_bug.cgi?id=183371
2549         <rdar://problem/38181724>
2550
2551         Reviewed by Dean Jackson.
2552
2553         Adding a new CSSAnimation subclass which we will create in a later patch while resolving styles
2554         upon identifying that a new CSS Animation has been added to an element.
2555
2556         * CMakeLists.txt:
2557         * DerivedSources.make:
2558         * Sources.txt:
2559         * WebCore.xcodeproj/project.pbxproj:
2560         * animation/CSSAnimation.cpp: Added.
2561         (WebCore::CSSAnimation::create):
2562         (WebCore::CSSAnimation::CSSAnimation):
2563         * animation/CSSAnimation.h: Added.
2564         * animation/CSSAnimation.idl: Added.
2565         * animation/KeyframeEffectReadOnly.cpp
2566         * animation/WebAnimation.h:
2567         (WebCore::WebAnimation::isCSSAnimation const):
2568         * animation/WebAnimation.idl:
2569         * bindings/js/JSWebAnimationCustom.cpp:
2570         (WebCore::toJSNewlyCreated):
2571         (WebCore::toJS):
2572         * bindings/js/WebCoreBuiltinNames.h:
2573
2574 2018-03-06  Ms2ger  <Ms2ger@igalia.com>
2575
2576         Explicitly qualify some method calls on this in lambdas in Service Worker code.
2577         https://bugs.webkit.org/show_bug.cgi?id=183367
2578
2579         Reviewed by Chris Dumez.
2580
2581         No new tests -- no change in behavior.
2582
2583         * loader/DocumentLoader.cpp:
2584         (WebCore::DocumentLoader::startLoadingMainResource):
2585         * workers/service/server/SWServer.cpp:
2586         (WebCore::SWServer::matchAll):
2587
2588 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
2589
2590         [CoordGraphics] Remove unused scrolling-related code in TextureMapperLayer, CoordinatedGraphics stack
2591         https://bugs.webkit.org/show_bug.cgi?id=183340
2592
2593         Reviewed by Michael Catanzaro.
2594
2595         TextureMapperLayer::scrollBy() method is completely unused and can be
2596         removed. This opens the gates on removing majority of scrolling-related
2597         code in TextureMapperLayer, CoordinatedGraphicsLayer and
2598         CoordinatedGraphicsScene classes, along with smaller bits in other
2599         closely-associated classes.
2600
2601         We're able to remove two virtual method overrides in the
2602         ScrollingCoordinatorCoordinatedGraphics class.
2603
2604         TextureMapperLayer can drop the ScrollingClient member variable, along
2605         with multiple others. Various unused methods in that class are removed
2606         as well.
2607
2608         CoordinatedGraphicsLayer and GraphicsLayerTextureMapper can both remove
2609         the custom scrolling state tracking.
2610
2611         No new tests -- no change in behavior.
2612
2613         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
2614         (WebCore::ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange): Deleted.
2615         (WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea): Deleted.
2616         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h:
2617         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2618         (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
2619         (WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
2620         (WebCore::GraphicsLayerTextureMapper::didCommitScrollOffset): Deleted.
2621         (WebCore::GraphicsLayerTextureMapper::setIsScrollable): Deleted.
2622         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
2623         * platform/graphics/texmap/TextureMapperLayer.cpp:
2624         (WebCore::TextureMapperLayer::hitTest): Deleted.
2625         (WebCore::TextureMapperLayer::scrollableLayerHitTestCondition): Deleted.
2626         (WebCore::TextureMapperLayer::findScrollableContentsLayerAt): Deleted.
2627         (WebCore::TextureMapperLayer::mapScrollOffset): Deleted.
2628         (WebCore::TextureMapperLayer::commitScrollOffset): Deleted.
2629         (WebCore::TextureMapperLayer::scrollBy): Deleted.
2630         (WebCore::TextureMapperLayer::didCommitScrollOffset): Deleted.
2631         * platform/graphics/texmap/TextureMapperLayer.h:
2632         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2633         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
2634         (WebCore::CoordinatedGraphicsLayer::syncLayerState):
2635         (WebCore::CoordinatedGraphicsLayer::resetLayerState):
2636         (WebCore::CoordinatedGraphicsLayer::setScrollableArea): Deleted.
2637         (WebCore::CoordinatedGraphicsLayer::commitScrollOffset): Deleted.
2638         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2639         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
2640
2641 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
2642
2643         [CoordGraphics] Apply TextureMapperLayer animations with a single MonotonicTime value
2644         https://bugs.webkit.org/show_bug.cgi?id=183360
2645
2646         Reviewed by Sergio Villar Senin.
2647
2648         When animations are being applied on the TextureMapperLayer tree, the
2649         monotonic time value is retrieved repeatedly in TextureMapperAnimation
2650         class. Instead of spawning repeated syscalls that are required to obtain
2651         the time value, TextureMapperLayer::applyAnimationsRecursively() now
2652         accepts a MonotonicTime value that should be used for all animation
2653         updates.
2654
2655         No new tests -- no change in behavior.
2656
2657         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2658         (WebCore::GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly):
2659         * platform/graphics/texmap/TextureMapperAnimation.cpp:
2660         (WebCore::TextureMapperAnimation::apply):
2661         (WebCore::TextureMapperAnimation::computeTotalRunningTime):
2662         (WebCore::TextureMapperAnimations::apply):
2663         * platform/graphics/texmap/TextureMapperAnimation.h:
2664         (WebCore::TextureMapperAnimation::keyframes const):
2665         (WebCore::TextureMapperAnimation::animation const):
2666         (WebCore::TextureMapperAnimation::boxSize const): Deleted.
2667         (WebCore::TextureMapperAnimation::listsMatch const): Deleted.
2668         (WebCore::TextureMapperAnimation::startTime const): Deleted.
2669         (WebCore::TextureMapperAnimation::pauseTime const): Deleted.
2670         * platform/graphics/texmap/TextureMapperLayer.cpp:
2671         (WebCore::TextureMapperLayer::applyAnimationsRecursively):
2672         (WebCore::TextureMapperLayer::syncAnimations):
2673         * platform/graphics/texmap/TextureMapperLayer.h:
2674
2675 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
2676
2677         [CoordGraphics] Clean up CoordinatedImageBacking
2678         https://bugs.webkit.org/show_bug.cgi?id=183332
2679
2680         Reviewed by Carlos Garcia Campos.
2681
2682         Clean up the CoordinatedImageBacking class. Prefer reference values in
2683         class functions, methods and member variables, where possible. Move
2684         member variables into a more sensible order. Initialize a few member
2685         variables at the place of declaration.
2686
2687         Drop releaseSurfaceIfNeeded() and updateVisibilityIfNeeded() methods,
2688         integrating them into the update() method, which was the only place
2689         where they were called from.
2690
2691         We don't have to keep a reference to the buffer object, since we're
2692         not using it internally after it's been passed to the client's
2693         updateImageBacking() implementation.
2694
2695         No new tests -- no change in behavior.
2696
2697         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2698         (WebCore::CoordinatedGraphicsLayer::syncImageBacking):
2699         (WebCore::CoordinatedGraphicsLayer::releaseImageBackingIfNeeded):
2700         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
2701         (WebCore::CoordinatedImageBacking::getCoordinatedImageBackingID):
2702         (WebCore::CoordinatedImageBacking::CoordinatedImageBacking):
2703         (WebCore::CoordinatedImageBacking::addHost):
2704         (WebCore::CoordinatedImageBacking::removeHost):
2705         (WebCore::CoordinatedImageBacking::update):
2706         (WebCore::CoordinatedImageBacking::clearContentsTimerFired):
2707         (WebCore::CoordinatedImageBacking::create): Deleted.
2708         (WebCore::CoordinatedImageBacking::markDirty): Deleted.
2709         (WebCore::CoordinatedImageBacking::releaseSurfaceIfNeeded): Deleted.
2710         (WebCore::CoordinatedImageBacking::updateVisibilityIfNeeded): Deleted.
2711         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h:
2712
2713 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
2714
2715         GraphicsLayerTextureMapper: remove the setAnimations() method
2716         https://bugs.webkit.org/show_bug.cgi?id=183358
2717
2718         Reviewed by Carlos Garcia Campos.
2719
2720         Remove the GraphicsLayerTextureMapper::setAnimations() method. This was
2721         not called from anywhere, and is not the way animations are generated
2722         for a given GraphicsLayer object (that would be addAnimation() method).
2723
2724         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2725         (WebCore::GraphicsLayerTextureMapper::setAnimations): Deleted.
2726         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
2727
2728 2018-03-06  Nan Wang  <n_wang@apple.com>
2729
2730         AX: AOM: More accessibility events support
2731         https://bugs.webkit.org/show_bug.cgi?id=183023
2732         <rdar://problem/37764380>
2733
2734         Reviewed by Chris Fleizach.
2735
2736         Accessibility events.
2737         Spec: https://wicg.github.io/aom/spec/phase2.html
2738
2739         This change adds support for these new events:
2740           accessiblecontextmenu
2741           accessibledecrement
2742           accessibledismiss
2743           accessiblefocus
2744           accessibleincrement
2745           accessiblescrollintoview
2746           accessibleselect
2747
2748         Note: The show context menu action is only supported on macOS now.
2749         The dismiss action is not implemented for all the platforms yet.
2750
2751         Test: accessibility/mac/AOM-events-all.html
2752
2753         * accessibility/AccessibilityListBoxOption.cpp:
2754         (WebCore::AccessibilityListBoxOption::setSelected):
2755         * accessibility/AccessibilityMediaObject.cpp:
2756         (WebCore::AccessibilityMediaObject::increment):
2757         (WebCore::AccessibilityMediaObject::decrement):
2758         * accessibility/AccessibilityMenuListOption.cpp:
2759         (WebCore::AccessibilityMenuListOption::setSelected):
2760         * accessibility/AccessibilityNodeObject.cpp:
2761         (WebCore::AccessibilityNodeObject::increment):
2762         (WebCore::AccessibilityNodeObject::decrement):
2763         * accessibility/AccessibilityObject.cpp:
2764         (WebCore::AccessibilityObject::press):
2765         (WebCore::AccessibilityObject::dispatchAccessibilityEvent const):
2766         (WebCore::AccessibilityObject::dispatchAccessibilityEventWithType const):
2767         (WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent const):
2768         (WebCore::AccessibilityObject::scrollToMakeVisible const):
2769         (WebCore::AccessibilityObject::dispatchAccessibilityEvent): Deleted.
2770         (WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent): Deleted.
2771         * accessibility/AccessibilityObject.h:
2772         * accessibility/AccessibilityRenderObject.cpp:
2773         (WebCore::AccessibilityRenderObject::setFocused):
2774         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2775         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
2776         * dom/Element.idl:
2777         * dom/EventNames.h:
2778
2779 2018-03-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2780
2781         Fix std::make_unique / new[] using system malloc
2782         https://bugs.webkit.org/show_bug.cgi?id=182975
2783
2784         Reviewed by JF Bastien.
2785
2786         Use Vector, FAST_ALLOCATED, or UniqueArray instead.
2787
2788         * Modules/webaudio/AudioBufferSourceNode.cpp:
2789         (WebCore::AudioBufferSourceNode::setBuffer):
2790         * Modules/webaudio/AudioBufferSourceNode.h:
2791         * css/StyleRule.h:
2792         * cssjit/CompiledSelector.h:
2793         * html/HTMLFrameSetElement.h:
2794         * html/canvas/WebGLRenderingContextBase.cpp:
2795         (WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
2796         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
2797         (WebCore::WebGLRenderingContextBase::LRUImageBufferCache::LRUImageBufferCache):
2798         (WebCore::WebGLRenderingContextBase::LRUImageBufferCache::imageBuffer):
2799         (WebCore::WebGLRenderingContextBase::LRUImageBufferCache::bubbleToFront):
2800         * html/canvas/WebGLRenderingContextBase.h:
2801         * platform/Length.cpp:
2802         (WebCore::newCoordsArray):
2803         (WebCore::newLengthArray):
2804         (): Deleted.
2805         * platform/Length.h:
2806         * platform/audio/DynamicsCompressor.cpp:
2807         (WebCore::DynamicsCompressor::setNumberOfChannels):
2808         * platform/audio/DynamicsCompressor.h:
2809         * platform/audio/FFTFrame.h:
2810         * platform/audio/gstreamer/FFTFrameGStreamer.cpp:
2811         (WebCore::FFTFrame::FFTFrame):
2812         * platform/graphics/FormatConverter.h:
2813         (WebCore::FormatConverter::FormatConverter):
2814         * platform/graphics/GraphicsContext3D.cpp:
2815         (WebCore::GraphicsContext3D::texImage2DResourceSafe):
2816         * platform/graphics/GraphicsContext3D.h:
2817         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
2818         (WebCore::getDirtyRects):
2819         * platform/graphics/cairo/CairoUtilities.cpp:
2820         (WebCore::flipImageSurfaceVertically):
2821         * platform/graphics/cg/GraphicsContext3DCG.cpp:
2822         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
2823         * platform/graphics/gpu/Texture.cpp:
2824         (WebCore::Texture::updateSubRect):
2825         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2826         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
2827         (WebCore::GraphicsContext3D::compileShader):
2828         (WebCore::GraphicsContext3D::getActiveAttribImpl):
2829         (WebCore::GraphicsContext3D::getActiveUniformImpl):
2830         (WebCore::GraphicsContext3D::getProgramInfoLog):
2831         (WebCore::GraphicsContext3D::getShaderInfoLog):
2832         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
2833         (WebCore::getShaderLog):
2834         (WebCore::getProgramLog):
2835         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
2836         (WebCore::ImageBufferData::putData):
2837         * platform/image-decoders/png/PNGImageDecoder.cpp:
2838         (WebCore::PNGImageReader::PNGImageReader):
2839         (WebCore::PNGImageReader::close):
2840         (WebCore::PNGImageReader::interlaceBuffer const):
2841         (WebCore::PNGImageReader::createInterlaceBuffer):
2842         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
2843         (WebCore::WEBPImageDecoder::decodeFrame):
2844         * platform/network/curl/SocketStreamHandleImpl.h:
2845         (WebCore::SocketStreamHandleImpl::SocketData::SocketData):
2846         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
2847         (WebCore::createCopy):
2848         (WebCore::SocketStreamHandleImpl::readData):
2849         (): Deleted.
2850         * platform/network/soup/SocketStreamHandleImpl.h:
2851         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
2852         (WebCore::SocketStreamHandleImpl::connected):
2853         * platform/win/LoggingWin.cpp:
2854         (WebCore::logLevelString):
2855
2856 2018-03-05  Yoav Weiss  <yoav@yoav.ws>
2857
2858         Support for preconnect Link headers
2859         https://bugs.webkit.org/show_bug.cgi?id=181657
2860
2861         Reviewed by Darin Adler.
2862
2863         Move the preconnect functionality into its own function, and
2864         also call this function when Link headers are processed.
2865
2866         Test: http/tests/preconnect/link-header-rel-preconnect-http.php
2867
2868         * loader/LinkLoader.cpp:
2869         (WebCore::LinkLoader::loadLinksFromHeader): Call preconnectIfNeeded.
2870         (WebCore::LinkLoader::preconnectIfNeeded): Preconnect to a host functionality moved here.
2871         (WebCore::LinkLoader::loadLink): Call preconnectIfNeeded.
2872         * loader/LinkLoader.h:
2873
2874 2018-03-05  Antti Koivisto  <antti@apple.com>
2875
2876         Add ChildrenAffectedByForwardPositionalRules bit for nth-child pseudo class marking
2877         https://bugs.webkit.org/show_bug.cgi?id=183341
2878         <rdar://problem/38151470>
2879
2880         Reviewed by Zalan Bujtas.
2881
2882         Use it instead of AffectsNextSibling/AffectedByPreviousSibling bits, similar to ChildrenAffectedByBackwardPositionalRules bit.
2883         This is more efficient and requires way less marking.
2884
2885         * css/SelectorChecker.cpp:
2886         (WebCore::countElementsBefore):
2887         (WebCore::countElementsOfTypeBefore):
2888         (WebCore::SelectorChecker::checkOne const):
2889
2890             Mark with ChildrenAffectedByForwardPositionalRules.
2891
2892         * cssjit/SelectorCompiler.cpp:
2893         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
2894         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
2895
2896              Mark with ChildrenAffectedByForwardPositionalRules.
2897
2898         * dom/Element.cpp:
2899         (WebCore::checkForSiblingStyleChanges):
2900
2901             Invalidate siblings after added/removed element.
2902
2903         (WebCore::Element::setChildrenAffectedByForwardPositionalRules):
2904         (WebCore::Element::hasFlagsSetDuringStylingOfChildren const):
2905         (WebCore::Element::rareDataChildrenAffectedByForwardPositionalRules const):
2906
2907             Add the new marking bit.
2908
2909         * dom/Element.h:
2910         (WebCore::Element::childrenAffectedByForwardPositionalRules const):
2911         (WebCore::Element::attributeWithoutSynchronization const):
2912
2913             Remove assert so we can use this to get the current unresolved lazy value of style attrbute.
2914
2915         * dom/ElementRareData.h:
2916         (WebCore::ElementRareData::childrenAffectedByForwardPositionalRules const):
2917         (WebCore::ElementRareData::setChildrenAffectedByForwardPositionalRules):
2918         (WebCore::ElementRareData::ElementRareData):
2919         (WebCore::ElementRareData::resetStyleRelations):
2920
2921              Add the new marking bit.
2922
2923         * dom/StyledElement.cpp:
2924         (WebCore::StyledElement::invalidateStyleAttribute):
2925
2926             In special case where we have attribute selectors for style attribute, synchronize the attribute immediately so we get invalidation right.
2927             Tested by fast/css/style-attribute-invalidation-propagates-to-counted-siblings.html    
2928
2929         * style/StyleRelations.cpp:
2930         (WebCore::Style::commitRelationsToRenderStyle):
2931         (WebCore::Style::commitRelations):
2932
2933             Commit the new bit.
2934
2935         * style/StyleRelations.h:
2936
2937 2018-03-05  Ryan Haddad  <ryanhaddad@apple.com>
2938
2939         Unreviewed build fix, remove unused variables.
2940
2941         * css/parser/CSSPropertyParser.cpp:
2942         (WebCore::consumeSpeakAs):
2943         (WebCore::consumeHangingPunctuation):
2944
2945 2018-03-05  Chris Dumez  <cdumez@apple.com>
2946
2947         fast/loader/onload-policy-ignore-for-frame.html is timing out with async policy delegates
2948         https://bugs.webkit.org/show_bug.cgi?id=183337
2949
2950         Reviewed by Ryosuke Niwa.
2951
2952         Make sure we call checkCompleted() before calling checkLoadComplete() in
2953         FrameLoader::continueLoadAfterNavigationPolicy() when the client tells us
2954         to ignore the navigation, so that we properly recognize that the load is
2955         done. This matches what is already done in FrameLoader::receivedMainResourceError().
2956
2957         Test: fast/loader/onload-policy-ignore-for-frame-async-delegates.html
2958
2959         * loader/FrameLoader.cpp:
2960         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2961
2962 2018-03-05  Myles C. Maxfield  <mmaxfield@apple.com>
2963
2964         [Cocoa] Allow user-installed fonts to be disabled
2965         https://bugs.webkit.org/show_bug.cgi?id=183349
2966
2967         Rubber stamped by Brent Fulgham.
2968
2969         Tests: fast/text/user-installed-font.html
2970                fast/text/user-installed-fonts/disable.html
2971                fast/text/user-installed-fonts/shadow-disable.html
2972                fast/text/user-installed-fonts/shadow-family-disable.html
2973                fast/text/user-installed-fonts/shadow-family.html
2974                fast/text/user-installed-fonts/shadow-postscript-disable.html
2975                fast/text/user-installed-fonts/shadow-postscript-family-disable.html
2976                fast/text/user-installed-fonts/shadow-postscript-family.html
2977                fast/text/user-installed-fonts/shadow-postscript.html
2978                fast/text/user-installed-fonts/shadow.html
2979                fast/text/user-installed-fonts/system-ui.html
2980
2981         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2982
2983 2018-03-05  Myles C. Maxfield  <mmaxfield@apple.com>
2984
2985         Silence OpenGL and OpenGL ES deprecation warnings in newer SDKs
2986         https://bugs.webkit.org/show_bug.cgi?id=183350
2987
2988         Unreviewed.
2989
2990         * Configurations/WebCore.xcconfig:
2991
2992 2018-03-05  Andy Estes  <aestes@apple.com>
2993
2994         [Mac] Teach WebCore::Pasteboard about file promise drags
2995         https://bugs.webkit.org/show_bug.cgi?id=183314
2996         <rdar://problem/38105493>
2997
2998         Reviewed by Darin Adler.
2999
3000         While WebKit does support receiving file promise drags (since r210360), WebCore::Pasteboard
3001         has not been instructed on how to read their file paths. When the various pasteboard readers
3002         ask for file paths after a file promise drop, they receive an empty vector. This impacts
3003         various features, most notably the DataTransfer API.
3004
3005         Pasteboard actually cannot learn about promised file paths from the pasteboard itself, as
3006         the pasteboard only contains the dragged files' UTIs. Promised file paths aren't known until
3007         the WebKits call -[NSFilePromiseReceiver receivePromisedFilesAtDestination:...], at which
3008         point the file paths are passed to WebCore as part of WebCore::DragData.
3009
3010         When we construct new Pasteboards for drag and drop, we need to store any promised file
3011         paths from the DragData. Then, when the various pasteboard readers ask for file paths and
3012         NSFilesPromisePboardType is on the pasteboard, we can return these promised file paths.
3013
3014         Tests: editing/pasteboard/data-transfer-items-drag-drop-file-promise.html
3015                editing/pasteboard/data-transfer-items-drop-file-promise.html
3016                editing/pasteboard/datatransfer-items-drop-plaintext-file-promise.html
3017                editing/pasteboard/datatransfer-types-dropping-text-file-promise.html
3018                editing/pasteboard/drag-file-promises-to-editable-element-as-URLs.html
3019                editing/pasteboard/drag-file-promises-to-editable-element-as-attachment.html
3020                editing/pasteboard/file-input-files-access-promise.html
3021
3022         * platform/FileSystem.h:
3023         * platform/Pasteboard.h:
3024         (WebCore::Pasteboard::Pasteboard):
3025         * platform/mac/DragDataMac.mm:
3026         (WebCore::DragData::containsPromise const):
3027         * platform/mac/PasteboardMac.mm:
3028         (WebCore::Pasteboard::Pasteboard):
3029         (WebCore::Pasteboard::createForDragAndDrop):
3030         (WebCore::toString):
3031         (WebCore::Pasteboard::read):
3032         (WebCore::Pasteboard::readFilePaths):
3033         (WebCore::absoluteURLsFromPasteboardFilenames): Deleted.
3034         * platform/mac/PlatformPasteboardMac.mm:
3035         (WebCore::PlatformPasteboard::numberOfFiles const):
3036
3037 2018-03-05  Andy Estes  <aestes@apple.com>
3038
3039         [Mac] Fix the build
3040
3041         * Modules/applepay/ApplePaySession.cpp:
3042         (WebCore::convertAndValidate): Removed unused variables.
3043
3044 2018-03-05  Antti Koivisto  <antti@apple.com>
3045
3046         Don't invalidate all children when doing insertion/deletion in presence of backward positional selectors
3047         https://bugs.webkit.org/show_bug.cgi?id=183325
3048         <rdar://problem/38134480>
3049
3050         Reviewed by Zalan Bujtas.
3051
3052         It is sufficient to invalidate siblings before the mutation point.
3053
3054         * dom/Element.cpp:
3055         (WebCore::checkForSiblingStyleChanges):
3056
3057         We already do sibling walk in the case of forwards positional rules and sibling combinators. The work
3058         done here is insignifant compared to cost of overinvalidating.
3059
3060 2018-03-05  Ali Juma  <ajuma@chromium.org>
3061
3062         imported/w3c/web-platform-tests/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html times out with async policy delegates
3063         https://bugs.webkit.org/show_bug.cgi?id=183297
3064
3065         Reviewed by Chris Dumez.
3066
3067         When a FrameLoader's policy document loader is cleared after receiving a navigation policy decision
3068         to not continue loading, we still need to trigger a check for load completion, since this loader or
3069         an ancestor loader may have been in state isLoadingInAPISense only because of the existence of
3070         the just-cleared policy document loader. Without triggering this check, these loaders may never
3071         call WebFrameLoaderClient::dispatchDidFinishLoad.
3072
3073         Test: http/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html
3074
3075         * loader/FrameLoader.cpp:
3076         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
3077
3078 2018-03-04  Yusuke Suzuki  <utatane.tea@gmail.com>
3079
3080         [WTF] Move currentCPUTime and sleep(Seconds) to CPUTime.h and Seconds.h respectively
3081         https://bugs.webkit.org/show_bug.cgi?id=183312
3082
3083         Reviewed by Mark Lam.
3084
3085         Remove wtf/CurrentTime.h include pragma.
3086
3087         * Modules/geolocation/Geolocation.cpp:
3088         * Modules/mediasource/SourceBuffer.cpp:
3089         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3090         * Modules/speech/SpeechSynthesis.cpp:
3091         * contentextensions/ContentExtensionCompiler.cpp:
3092         * contentextensions/ContentExtensionParser.cpp:
3093         * dom/Document.cpp:
3094         * dom/Element.cpp:
3095         * dom/Event.cpp:
3096         * dom/ScriptedAnimationController.cpp:
3097         * dom/SimulatedClick.cpp:
3098         * fileapi/File.cpp:
3099         * fileapi/FileReader.cpp:
3100         * history/CachedPage.cpp:
3101         * html/BaseDateAndTimeInputType.cpp:
3102         * html/DateTimeInputType.cpp:
3103         * html/HTMLMediaElement.cpp:
3104         * html/MediaController.cpp:
3105         * html/MediaElementSession.cpp:
3106         * html/MonthInputType.cpp:
3107         * html/TimeInputType.cpp:
3108         * html/parser/HTMLParserScheduler.h:
3109         * inspector/InspectorCanvas.cpp:
3110         * loader/FrameLoader.cpp:
3111         * loader/LoadTiming.cpp:
3112         * loader/NavigationScheduler.cpp:
3113         * loader/ProgressTracker.cpp:
3114         * loader/cache/CachedCSSStyleSheet.cpp:
3115         * loader/cache/CachedImage.cpp:
3116         * loader/cache/CachedResource.cpp:
3117         * loader/cache/MemoryCache.cpp:
3118         * page/DOMTimer.cpp:
3119         * page/DOMWindow.cpp:
3120         * page/DragController.cpp:
3121         * page/EventHandler.cpp:
3122         * page/FocusController.cpp:
3123         * page/FrameView.cpp:
3124         * page/Page.cpp:
3125         * page/Performance.cpp:
3126         * page/PerformanceTiming.cpp:
3127         * page/animation/AnimationBase.cpp:
3128         * page/animation/CSSAnimationController.cpp:
3129         * page/mac/WheelEventDeltaFilterMac.mm:
3130         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3131         * platform/ScrollAnimationKinetic.cpp:
3132         * platform/ScrollAnimationSmooth.cpp:
3133         * platform/ThreadTimers.cpp:
3134         * platform/Timer.cpp:
3135         * platform/audio/mac/AudioSampleDataSource.mm:
3136         * platform/cocoa/ScrollController.mm:
3137         * platform/gamepad/cocoa/GameControllerGamepad.mm:
3138         * platform/gamepad/mac/HIDGamepad.cpp:
3139         * platform/graphics/BitmapImage.cpp:
3140         * platform/graphics/DisplayRefreshMonitorManager.cpp:
3141         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3142         * platform/graphics/ca/GraphicsLayerCA.cpp:
3143         * platform/graphics/ca/LayerPool.cpp:
3144         * platform/graphics/ca/PlatformCALayer.h:
3145         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3146         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
3147         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
3148         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
3149         * platform/graphics/cg/GraphicsContextCG.cpp:
3150         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
3151         * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
3152         * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
3153         * platform/graphics/texmap/BitmapTexturePool.h:
3154         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
3155         * platform/graphics/texmap/TextureMapper.cpp:
3156         * platform/graphics/texmap/TextureMapperAnimation.cpp:
3157         * platform/graphics/texmap/TextureMapperFPSCounter.cpp:
3158         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3159         * platform/graphics/win/GraphicsContextDirect2D.cpp:
3160         * platform/graphics/win/GraphicsLayerDirect2D.cpp:
3161         * platform/gtk/PlatformKeyboardEventGtk.cpp:
3162         * platform/gtk/ScrollAnimatorGtk.cpp:
3163         * platform/ios/LegacyTileCache.mm:
3164         * platform/ios/LegacyTileLayerPool.mm:
3165         * platform/ios/ScrollViewIOS.mm:
3166         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
3167         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
3168         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
3169         * platform/mock/MockRealtimeMediaSource.cpp:
3170         * platform/mock/MockRealtimeVideoSource.cpp:
3171         * platform/network/CacheValidation.cpp:
3172         * platform/network/DNSResolveQueue.cpp:
3173         * platform/network/ResourceResponseBase.cpp:
3174         * platform/network/curl/CurlCacheEntry.cpp:
3175         * platform/network/soup/ResourceHandleSoup.cpp:
3176         * platform/text/TextEncodingRegistry.cpp:
3177         * platform/text/win/LocaleWin.cpp:
3178         * platform/win/MainThreadSharedTimerWin.cpp:
3179         * platform/win/PlatformMouseEventWin.cpp:
3180         * rendering/RenderLayerCompositor.cpp:
3181         * rendering/RenderProgress.cpp:
3182         * svg/animation/SMILTimeContainer.cpp:
3183         * testing/MockGamepad.cpp:
3184         * workers/WorkerRunLoop.cpp:
3185
3186 2018-03-04  Tim Horton  <timothy_horton@apple.com>
3187
3188         Make !ENABLE(DATA_DETECTION) iOS build actually succeed
3189         https://bugs.webkit.org/show_bug.cgi?id=183283
3190         <rdar://problem/38062148>
3191
3192         Reviewed by Sam Weinig.
3193
3194         * Configurations/FeatureDefines.xcconfig:
3195
3196 2018-03-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
3197
3198         Delete incorrect version of clampTo() function from SVGToOTFFontConversion.cpp
3199         https://bugs.webkit.org/show_bug.cgi?id=183165
3200
3201         Reviewed by Darin Adler.
3202
3203         Some of the calls in SVGToOTFFontConversion.cpp were directed to the function
3204         in MathExtras.h while the rest were directed to this local static function.
3205         There should not be two versions with the same name while they are supposed
3206         to do the same thing. Besides, the local version does not work correctly
3207         if the type of the argument's max limit is less the max limit of the returned
3208         type, e.g. char -> uint16_t.
3209
3210         * svg/SVGToOTFFontConversion.cpp:
3211         (WebCore::clampTo): Deleted.
3212
3213 2018-03-03  Zalan Bujtas  <zalan@apple.com>
3214
3215         [RenderTreeBuilder] Move styleDidChange mutation logic to RenderTreeUpdater
3216         https://bugs.webkit.org/show_bug.cgi?id=183273
3217         <rdar://problem/38054892>
3218
3219         Reviewed by Antti Koivisto.
3220
3221         Covered by existing tests.
3222
3223         * rendering/RenderBlockFlow.cpp:
3224         (WebCore::RenderBlockFlow::styleDidChange):
3225         * rendering/RenderElement.cpp:
3226         (WebCore::RenderElement::styleDidChange):
3227         (WebCore::RenderElement::noLongerAffectsParentBlock const): Deleted.
3228         * rendering/RenderElement.h:
3229         * rendering/updating/RenderTreeUpdater.cpp:
3230         (WebCore::RenderTreeUpdater::updateElementRenderer):
3231
3232 2018-03-03  Yoav Weiss  <yoav@yoav.ws>
3233
3234         Link headers for subresources are not being processes
3235         https://bugs.webkit.org/show_bug.cgi?id=181789
3236
3237         Reviewed by Youenn Fablet.
3238
3239         Triggers Link header processing when the Link headers arrive on a subresource.
3240
3241         Test: http/tests/preload/link-header-on-subresource.html
3242
3243         * loader/LinkLoader.cpp:
3244         (WebCore::LinkLoader::loadLinksFromHeader): Change the media check conditions.
3245         * loader/LinkLoader.h: Add a third state for media checks.
3246         * loader/SubresourceLoader.cpp:
3247         (WebCore::SubresourceLoader::didReceiveResponse): Preload links from headers for subresources.
3248
3249 2018-03-02  Yusuke Suzuki  <utatane.tea@gmail.com>
3250
3251         [WTF] Remove RunLoop and RunLoop::Timer's interface using double as seconds
3252         https://bugs.webkit.org/show_bug.cgi?id=183293
3253
3254         Reviewed by Alex Christensen.
3255
3256         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
3257         (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
3258
3259 2018-03-02  Dean Jackson  <dino@apple.com>
3260
3261         Remove NP_GLContext since it is unsupported
3262         https://bugs.webkit.org/show_bug.cgi?id=183305
3263         <rdar://problem/36875555>
3264
3265         Reviewed by Simon Fraser.
3266
3267         * plugins/npapi.h: Remove NP_GLContext and mention that
3268         it is not supported.
3269
3270 2018-03-02  Chris Dumez  <cdumez@apple.com>
3271
3272         imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html crashes with async policy delegates
3273         https://bugs.webkit.org/show_bug.cgi?id=183294
3274         <rdar://problem/38073596>
3275
3276         Reviewed by Youenn Fablet.
3277
3278         Drop code that was added to SubresourceLoader::willCancel() in r228852. The purpose of this code
3279         was to make sure that SubresourceLoader::m_policyForResponseCompletionHandler always gets called,
3280         even when the load is cancelled. However, this code is not needed (since m_policyForResponseCompletionHandler
3281         is a CompletionHandler, an assertion will be hit if we fail to call it and we'll know). Calling
3282         the completionHandler inside SubresourceLoader::willCancel() is too early and leads to crashes.
3283
3284         The completionHandler currently gets called DocumentLoader::responseReceived() via a call to
3285         mainResourceLoader->didReceiveResponsePolicy(). Note that in r229177, we made sure that the
3286         call to didReceiveResponsePolicy() happens *after* the call to continueAfterContentPolicy()
3287         to maintain our non-async policy delegate behavior. However, continueAfterContentPolicy()
3288         would end up calling willCancel() and call the completionHandler when shouldContinue was
3289         false.
3290
3291         Test: http/wpt/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-async-delegate.html
3292
3293         * loader/SubresourceLoader.cpp:
3294         (WebCore::SubresourceLoader::willCancel):
3295
3296 2018-03-02  Tim Horton  <timothy_horton@apple.com>
3297
3298         Fix the build after r229185 and r229184
3299
3300         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3301         (WebCore::exernalDeviceDisplayNameForPlayer):
3302         * platform/ios/DeviceOrientationClientIOS.h:
3303         * platform/ios/DeviceOrientationClientIOS.mm:
3304
3305 2018-03-02  Tim Horton  <timothy_horton@apple.com>
3306
3307         Make the !ENABLE(DEVICE_ORIENTATION) iOS build succeed
3308         https://bugs.webkit.org/show_bug.cgi?id=183296
3309
3310         Reviewed by Dan Bernstein.
3311
3312         * platform/ios/DeviceMotionClientIOS.h:
3313         * platform/ios/DeviceMotionClientIOS.mm:
3314         * platform/ios/WebCoreMotionManager.h:
3315         * platform/ios/WebCoreMotionManager.mm:
3316
3317 2018-03-02  Tim Horton  <timothy_horton@apple.com>
3318
3319         Make it possible to build for iOS without Celestial
3320         https://bugs.webkit.org/show_bug.cgi?id=183295
3321         <rdar://problem/38074468>
3322
3323         Reviewed by Dan Bernstein.
3324
3325         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3326         (WebCore::exernalDeviceDisplayNameForPlayer):
3327
3328 2018-03-02  Youenn Fablet  <youenn@apple.com>
3329
3330         Clients should register to StorageProcess with their service worker registration identifier
3331         https://bugs.webkit.org/show_bug.cgi?id=182313
3332         <rdar://problem/38044403>
3333
3334         Reviewed by Chris Dumez.
3335
3336         Relanding with fixing matchAll for uncontrolled clients.
3337
3338         No observable change of behavior in regular conditions.
3339         When service worker process crashes, the service worker identifiers sent by the WebProcess might be wrong
3340         and we will not be able to retrieve the registration from these identifiers.
3341         The storage process will be able to still process correctly messages coming from the WebProcess to register clients of the registration.
3342         Otherwise, there is a chance that WebProcess clients will not be added to the SWServerRegistration.m_clientsUsingRegistration maps.
3343
3344         * dom/Document.cpp:
3345         (WebCore::Document::setServiceWorkerConnection):
3346         * workers/service/SWClientConnection.h:
3347         * workers/service/server/SWServer.cpp:
3348         (WebCore::SWServer::matchAll):
3349         (WebCore::SWServer::claim):
3350         (WebCore::SWServer::registerServiceWorkerClient):
3351         (WebCore::SWServer::unregisterServiceWorkerClient):
3352         (WebCore::SWServer::setClientActiveWorker): Deleted.
3353         * workers/service/server/SWServer.h: