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