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