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