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