3bae427f758211195d79c9c57a256827c9d732f4
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-03-29  Antoine Quint  <graouts@apple.com>
2
3         [Web Animations] CSSTransition objects should have fill: backwards to allow seeking prior to start time
4         https://bugs.webkit.org/show_bug.cgi?id=184129
5
6         Reviewed by Dean Jackson.
7
8         In order to allow a CSS Transition to be seeked prior to its start time, it needs to have its fill mode set
9         to backwards. Adding code to set the fill mode in CSSTransition::initialize() yields early timing model
10         invalidation and we could get in a situation where stylesWouldYieldNewCSSTransitionsBlendingKeyframes()
11         was called before we had a chance to create blending keyframes for a CSS transitions, since the call
12         to create blending keyframes is made after the call to initialize(), so we now cater for this case.
13
14         * animation/CSSTransition.cpp:
15         (WebCore::CSSTransition::initialize):
16         * animation/CSSTransition.h:
17         * animation/KeyframeEffectReadOnly.cpp:
18         (WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const):
19
20 2018-03-30  Daniel Bates  <dabates@apple.com>
21
22         Remove unused MIMETypeRegistry::getSupportedImageMIMETypesForEncoding()
23         https://bugs.webkit.org/show_bug.cgi?id=184154
24
25         Reviewed by Per Arne Vollan.
26
27         * platform/MIMETypeRegistry.cpp:
28         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypesForEncoding): Deleted.
29         * platform/MIMETypeRegistry.h:
30
31 2018-03-30  Ryan Haddad  <ryanhaddad@apple.com>
32
33         Unreviewed, rolling out r230102.
34
35         Caused assertion failures on JSC bots.
36
37         Reverted changeset:
38
39         "A stack overflow in the parsing of a builtin (called by
40         createExecutable) cause a crash instead of a catchable js
41         exception"
42         https://bugs.webkit.org/show_bug.cgi?id=184074
43         https://trac.webkit.org/changeset/230102
44
45 2018-03-30  Robin Morisset  <rmorisset@apple.com>
46
47         A stack overflow in the parsing of a builtin (called by createExecutable) cause a crash instead of a catchable js exception
48         https://bugs.webkit.org/show_bug.cgi?id=184074
49         <rdar://problem/37165897>
50
51         Reviewed by Keith Miller.
52
53         I had to slightly change the type of some bindings between JSC and WebCore. No functional change intended on the WebCore side.
54
55         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
56         (WebCore::JSBuiltinReadableStreamDefaultReaderPrivateConstructor::initializeExecutable):
57         (WebCore::JSBuiltinReadableStreamDefaultControllerPrivateConstructor::initializeExecutable):
58         (WebCore::JSBuiltinReadableByteStreamControllerPrivateConstructor::initializeExecutable):
59         (WebCore::JSBuiltinReadableStreamBYOBReaderPrivateConstructor::initializeExecutable):
60         (WebCore::JSBuiltinReadableStreamBYOBRequestPrivateConstructor::initializeExecutable):
61         * bindings/scripts/CodeGeneratorJS.pm:
62         (GenerateConstructorHelperMethods):
63         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
64         (WebCore::JSTestClassWithJSBuiltinConstructorConstructor::initializeExecutable):
65         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
66         (WebCore::JSTestJSBuiltinConstructorConstructor::initializeExecutable):
67
68 2018-03-29  Antoine Quint  <graouts@apple.com>
69
70         [Web Animations] Correctly obtain the timing function for a given keyframe
71         https://bugs.webkit.org/show_bug.cgi?id=184146
72
73         Reviewed by Dean Jackson.
74
75         The way we would get the timing function for a given KeyframeValue stored in a KeyframeList was really suboptimal.
76         When keyframes were created, we would set the animated element's style on each keyframe, and set keyframe-specific
77         properties and values on top. When figuring out the timing function for a KeyframeValue, we would look at its render
78         style, go through its list of animations, which could include animations that are irrelevant to this specific keyframe
79         list since all animations from the animated element are referenced, and we would have to look up the correct animation
80         by name and get the timing function, even though the timing function stored on the animation was now specific to this
81         particular keyframe.
82
83         We now simply set a m_timingFunction member on a KeyframeValue, which is null if no explicit animation-timing-function
84         was provided for this keyframe in CSS, and otherwise set to a valid TimingFunction.
85
86         This fixes our behavior for a 4 existing animation tests when opted into the CSS Animations and CSS Transitions as
87         Web Animations feature.
88
89         * animation/KeyframeEffectReadOnly.cpp:
90         (WebCore::KeyframeEffectReadOnly::timingFunctionForKeyframeAtIndex):
91         * css/StyleResolver.cpp:
92         (WebCore::StyleResolver::keyframeStylesForAnimation):
93         * page/animation/KeyframeAnimation.cpp:
94         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty const):
95         * platform/animation/TimingFunction.cpp:
96         (WebCore::TimingFunction::createFromCSSText):
97         (WebCore::TimingFunction::createFromCSSValue):
98         * platform/animation/TimingFunction.h:
99         * rendering/RenderLayerBacking.cpp:
100         (WebCore::RenderLayerBacking::startAnimation):
101         * rendering/style/KeyframeList.cpp:
102         (WebCore::KeyframeValue::timingFunction const): Deleted.
103         * rendering/style/KeyframeList.h:
104         (WebCore::KeyframeValue::timingFunction const):
105         (WebCore::KeyframeValue::setTimingFunction):
106
107 2018-03-29  Ryosuke Niwa  <rniwa@webkit.org>
108
109         Copying a list from Microsoft Word to TinyMCE fails when mso-list is on tags other than P
110         https://bugs.webkit.org/show_bug.cgi?id=182954
111         <rdar://problem/37713141>
112
113         Reviewed by Wenson Hsieh.
114
115         Fixed the bug by relaxing the restriction that we only preserve mso-list on p.
116
117         Tests: PasteHTML.PreservesMSOListOnH4
118
119         * editing/markup.cpp:
120         (WebCore::StyledMarkupAccumulator::shouldPreserveMSOListStyleForElement):
121
122 2018-03-29  JF Bastien  <jfbastien@apple.com>
123
124         Use Forward.h instead of forward-declaring WTF::String
125         https://bugs.webkit.org/show_bug.cgi?id=184172
126         <rdar://problem/39026146>
127
128         Reviewed by Yusuke Suzuki.
129
130         As part of #184164 I'm changing WTF::String, and the forward
131         declarations are just wrong because I'm making it templated. We
132         should use Forward.h anyways, so do that instead.
133
134         * css/makeprop.pl:
135         * platform/cocoa/PlaybackSessionInterface.h:
136         * platform/ios/Device.h:
137         * platform/ios/PlaybackSessionInterfaceAVKit.h:
138         * platform/ios/VideoFullscreenInterfaceAVKit.h:
139         * platform/win/PathWalker.h:
140         * testing/js/WebCoreTestSupport.h:
141
142 2018-03-29  Ross Kirsling  <ross.kirsling@sony.com>
143
144         MSVC __forceinline slows down JSC release build fivefold after r229391
145         https://bugs.webkit.org/show_bug.cgi?id=184062
146
147         Reviewed by Alex Christensen.
148
149         * platform/graphics/FormatConverter.cpp:
150         Factor ALWAYS_INLINE_EXCEPT_MSVC out to WTF.
151
152 2018-03-29  Ryan Haddad  <ryanhaddad@apple.com>
153
154         Unreviewed, rolling out r230087.
155
156         Introduced LayoutTest failures.
157
158         Reverted changeset:
159
160         "FrameSelection::appearanceUpdateTimerFired should be robust
161         against layout passes underneath it"
162         https://bugs.webkit.org/show_bug.cgi?id=183395
163         https://trac.webkit.org/changeset/230087
164
165 2018-03-29  Wenson Hsieh  <wenson_hsieh@apple.com>
166
167         FrameSelection::appearanceUpdateTimerFired should be robust against layout passes underneath it
168         https://bugs.webkit.org/show_bug.cgi?id=183395
169         <rdar://problem/38055732>
170
171         Reviewed by Zalan Bujtas.
172
173         In the case where a FrameSelection updates its appearance when m_appearanceUpdateTimer is fired, the
174         FrameSelection's Frame is unprotected, and can be removed by arbitrary script. This patch applies a simple
175         mitigation by wrapping the Frame in a Ref when firing the appearance update timer, and ensuring that layout is
176         really up to date before calling updateAppearanceAfterLayoutOrStyleChange() from the timer.
177
178         Test: editing/selection/iframe-update-selection-appearance.html
179
180         * editing/FrameSelection.cpp:
181         (WebCore::FrameSelection::appearanceUpdateTimerFired):
182
183 2018-03-29  Daniel Bates  <dabates@apple.com>
184
185         Substitute ArchiveFactory::isArchiveMIMEType() for ArchiveFactory::isArchiveMimeType().
186
187         * loader/DocumentLoader.cpp:
188         (WebCore::DocumentLoader::commitLoad):
189         * loader/archive/ArchiveFactory.cpp:
190         (WebCore::ArchiveFactory::isArchiveMIMEType):
191         (WebCore::ArchiveFactory::isArchiveMimeType): Deleted.
192         * loader/archive/ArchiveFactory.h:
193         * platform/MIMETypeRegistry.h:
194
195 2018-03-29  Daniel Bates  <dabates@apple.com>
196
197         MIMETypeRegistry should return const HashSets
198         https://bugs.webkit.org/show_bug.cgi?id=184150
199
200         Reviewed by Per Arne Vollan.
201
202         Only getSupportedNonImageMIMETypes() needs to return a non-const HashSet so that
203         LegacyWebKit can modify the set of non-image MIME types.
204
205         * platform/MIMETypeRegistry.cpp:
206         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes):
207         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes):
208         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypesForEncoding):
209         (WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes):
210         (WebCore::MIMETypeRegistry::getPDFMIMETypes):
211         (WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes):
212         * platform/MIMETypeRegistry.h:
213
214 2018-03-29  Brady Eidson  <beidson@apple.com>
215
216         Update Service Worker feature status.
217         https://bugs.webkit.org/show_bug.cgi?id=184139
218
219         Reviewed by Chris Dumez.
220
221         * features.json:
222
223 2018-03-29  Chris Dumez  <cdumez@apple.com>
224
225         Drop DOMWindow::frames() / DOMWindow::window() methods
226         https://bugs.webkit.org/show_bug.cgi?id=184112
227
228         Reviewed by Daniel Bates.
229
230         Drop DOMWindow::frames() / DOMWindow::window() methods as they are just aliases for DOMWindow::self().
231
232         * page/DOMWindow.h:
233         * page/DOMWindow.idl:
234
235 2018-03-29  Commit Queue  <commit-queue@webkit.org>
236
237         Unreviewed, rolling out r230062.
238         https://bugs.webkit.org/show_bug.cgi?id=184128
239
240         Broke mac port. web content process crashes while loading any
241         web page (Requested by rniwa on #webkit).
242
243         Reverted changeset:
244
245         "MSVC __forceinline slows down JSC release build fivefold
246         after r229391"
247         https://bugs.webkit.org/show_bug.cgi?id=184062
248         https://trac.webkit.org/changeset/230062
249
250 2018-03-28  Antoine Quint  <graouts@apple.com>
251
252         [Web Animations] Implement more CSSPropertyBlendingClient methods
253         https://bugs.webkit.org/show_bug.cgi?id=184077
254
255         Reviewed by Dean Jackson.
256
257         We only had stubs for several of the CSSPropertyBlendingClient methods and thus always implied that we
258         were animating non-matching transform, filter and backdrop-filter properties. We now implement those using
259         the same code used in KeyframeAnimation. This allows for 31 new tests to opt into the CSS Animations and
260         CSS Transitions as Web Animations feature.
261
262         We also ensure we only run a CSSAnimationController assertion in FrameView::didDestroyRenderTree() if
263         we're not using the CSS Animations and CSS Transitions as Web Animations feature.
264
265         * animation/KeyframeEffectReadOnly.cpp:
266         (WebCore::KeyframeEffectReadOnly::copyPropertiesFromSource):
267         (WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes):
268         (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
269         (WebCore::KeyframeEffectReadOnly::checkForMatchingTransformFunctionLists):
270         (WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists):
271         (WebCore::KeyframeEffectReadOnly::checkForMatchingBackdropFilterFunctionLists):
272         (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes):
273         (WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes):
274         * animation/KeyframeEffectReadOnly.h:
275         * page/FrameView.cpp:
276         (WebCore::FrameView::didDestroyRenderTree):
277
278 2018-03-28  Chris Dumez  <cdumez@apple.com>
279
280         Align XMLHttpRequest's open() / send() / abort() with the latest specification
281         https://bugs.webkit.org/show_bug.cgi?id=184108
282
283         Reviewed by Youenn Fablet.
284
285         Align XMLHttpRequest's open() / send() / abort() with the latest specification:
286         - https://xhr.spec.whatwg.org
287
288         No new tests, rebaselined existing layout tests.
289
290         * xml/XMLHttpRequest.cpp:
291         (WebCore::XMLHttpRequest::open):
292         Align with https://xhr.spec.whatwg.org/#the-open()-method:
293         - Change the order of some steps to match the order in the spec. In particular,
294           open() no longer resets the state to UNSENT or abort any existing load when it
295           fails early due to being passed a bad method.
296
297         (WebCore::XMLHttpRequest::createRequest):
298         Align with https://xhr.spec.whatwg.org/#the-send()-method:
299         - Use the simpler "upload listener flag" logic from the spec instead of our more
300           complex m_uploadEventsAllowed flag. This avoids constructing a SecurityOrigin
301           objects on a background thread when XHR is used inside Web Workers, which was
302           not thread-safe.
303         - Set the upload complete flag when the request has no body as per step 9.
304         - After firing the loadstartEvent, return early if the state is no longer OPEN or
305           if the send flag is unset, as per step 11.3.
306
307         (WebCore::XMLHttpRequest::abort):
308         Align with https://xhr.spec.whatwg.org/#the-abort()-method:
309         - Only set the state to UNSENT if the state is still DONE after firing the error
310           events, as per step 3.
311
312         (WebCore::XMLHttpRequest::didSendData):
313         Use new "upload listener flag".
314
315         (WebCore::XMLHttpRequest::dispatchErrorEvents):
316         Align with https://xhr.spec.whatwg.org/#request-error-steps:
317         - Stop firing a progress event in case of error as this is not as per specification
318           and Firefox does not fire those either.
319
320         * xml/XMLHttpRequest.h:
321
322 2018-03-28  Timothy Hatcher  <timothy@apple.com>
323
324         Consolidate NSColor to WebCore::Color conversion and fix system colors.
325
326         https://bugs.webkit.org/show_bug.cgi?id=184096
327         rdar://problem/38918925
328
329         Reviewed by Tim Horton.
330
331         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
332         (CreateCGColorIfDifferent): Use CGColor property on NSColor, don't manually create new CGColor.
333         * platform/graphics/mac/ColorMac.h:
334         * platform/graphics/mac/ColorMac.mm:
335         (WebCore::makeRGBAFromNSColor): Move pattern code from RenderThemeMac's convertNSColorToColor.
336         Also use nextafter for proper RGBA float conversion.
337         * platform/mac/PlatformPasteboardMac.mm:
338         (WebCore::PlatformPasteboard::color): Use colorFromNSColor.
339         * rendering/RenderThemeMac.mm:
340         (WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const): Use colorFromNSColor.
341         (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const): Ditto.
342         (WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const): Ditto.
343         (WebCore::RenderThemeMac::systemColor const): Ditto.
344         (WebCore::paintAttachmentTitleBackground): Ditto.
345         (WebCore::convertNSColorToColor): Deleted.
346
347 2018-03-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
348
349         The SVGAnimatedProperty wrappers have to be detached from the referenced values before the SVGAnimatedType is deleted
350         https://bugs.webkit.org/show_bug.cgi?id=183972
351
352         Reviewed by Daniel Bates.
353
354         If the SVGAnimatedType is a list type, e.g. SVGLengthListValues, the wrappers
355         of the animated properties have to be detached from the items in the list
356         before it's deleted.
357
358         * svg/SVGAnimateElementBase.cpp:
359         (WebCore::SVGAnimateElementBase::clearAnimatedType):
360
361 2018-03-28  Ross Kirsling  <ross.kirsling@sony.com>
362
363         MSVC __forceinline slows down JSC release build fivefold after r229391
364         https://bugs.webkit.org/show_bug.cgi?id=184062
365
366         Reviewed by Alex Christensen.
367
368         * platform/graphics/FormatConverter.cpp:
369         Factor ALWAYS_INLINE_EXCEPT_MSVC out to WTF.
370
371 2018-03-28  Zalan Bujtas  <zalan@apple.com>
372
373         Make it possible to override the screen size
374         https://bugs.webkit.org/show_bug.cgi?id=184111
375         <rdar://problem/38972181>
376
377         Reviewed by Tim Horton.
378
379         We just call screenSize() atm.
380
381         * page/Chrome.cpp:
382         (WebCore::Chrome::overrideScreenSize const):
383         * page/Chrome.h:
384         * page/ChromeClient.h:
385         * platform/HostWindow.h:
386         * platform/PlatformScreen.h:
387         * platform/ios/PlatformScreenIOS.mm:
388         (WebCore::screenRect):
389         (WebCore::overrideScreenSize):
390
391 2018-03-28  Timothy Hatcher  <timothy@apple.com>
392
393         Include the 'text' color keyword as a system color.
394
395         https://bugs.webkit.org/show_bug.cgi?id=184113
396         rdar://problem/38779267
397
398         Reviewed by Tim Horton.
399
400         * css/StyleColor.cpp:
401         (WebCore::StyleColor::isColorKeyword): Don't check CSSValueMenu, it is a system color and is included.
402         (WebCore::StyleColor::isSystemColor): Include CSSValueText. Check CSSValueWebkitFocusRingColor in the range,
403         since it is immediately after CSSValueAppleSystemYellow.
404
405 2018-03-28  Wenson Hsieh  <wenson_hsieh@apple.com>
406
407         [iOS] Multiple select appearance doesn't update when selecting or deselecting rows in the picker view
408         https://bugs.webkit.org/show_bug.cgi?id=184110
409         <rdar://problem/38796648>
410
411         Reviewed by Tim Horton.
412
413         HTMLSelectElement::optionSelectedByUser is invoked upon user interaction with a select menu. This currently
414         takes two separate codepaths, depending on whether or not the menu list appearance is being used to render the
415         select. If a menu list appearance is used, we call selectOption(), which updates validity, updates the element
416         renderer, and then dispatches a `change` event if needed.
417
418         However, if updateSelectedState() is used, we only update form validity and then dispatch the `change` event
419         without updating the renderer, leaving it stale.
420
421         Test: fast/forms/ios/ipad/multiple-select-updates-renderer.html
422
423         * html/HTMLSelectElement.cpp:
424         (WebCore::HTMLSelectElement::optionSelectedByUser):
425
426         Update the renderer after updating the DOM to reflect the selected option.
427
428 2018-03-28  Daniel Bates  <dabates@apple.com>
429
430         Substitute "strong password confirmation auto fill" for "strong confirmation password auto fill"
431         <rdar://problem/36518856>
432
433         * English.lproj/Localizable.strings:
434         * platform/LocalizedStrings.cpp:
435         (WebCore::AXAutoFillStrongConfirmationPasswordLabel):
436
437 2018-03-28  Daniel Bates  <dabates@apple.com>
438
439         WebSocket cookie incorrectly stored
440         https://bugs.webkit.org/show_bug.cgi?id=184100
441         <rdar://problem/37928715>
442
443         Reviewed by Brent Fulgham.
444
445         A cookie received in a WebSocket response should be stored with respect to the
446         origin of the WebSocket server in order for it to be sent in a subsequent request.
447
448         Also removed a FIXME about implementing support for the long since
449         deprecated Set-Cookie2 header.
450
451         Test: http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior.html
452
453         * Modules/websockets/WebSocketChannel.cpp:
454         (WebCore::WebSocketChannel::processBuffer):
455         * Modules/websockets/WebSocketHandshake.h:
456
457 2018-03-28  Chris Dumez  <cdumez@apple.com>
458
459         Do process swap when opening a cross-origin URL via window.open(url, '_blank', 'noopener')
460         https://bugs.webkit.org/show_bug.cgi?id=183962
461         <rdar://problem/38817833>
462
463         Reviewed by Brady Eidson.
464
465         Pass extra bits of information to the UIProcess via NavigationAction:
466         - Is it a cross origin navigation caused by window.open()
467         - Does the navigated frame have an opener
468
469         This information is useful to determine on UIProcess side if we want
470         to swap WebProcess.
471
472         * loader/FrameLoadRequest.h:
473         (WebCore::FrameLoadRequest::setIsCrossOriginWindowOpenNavigation):
474         (WebCore::FrameLoadRequest::isCrossOriginWindowOpenNavigation const):
475         * loader/FrameLoader.cpp:
476         (WebCore::FrameLoader::loadURL):
477         * loader/NavigationAction.h:
478         (WebCore::NavigationAction::setIsCrossOriginWindowOpenNavigation):
479         (WebCore::NavigationAction::isCrossOriginWindowOpenNavigation const):
480         (WebCore::NavigationAction::setOpener):
481         (WebCore::NavigationAction::opener const):
482         * page/DOMWindow.cpp:
483         (WebCore::DOMWindow::createWindow):
484
485 2018-03-28  Chris Dumez  <cdumez@apple.com>
486
487         Thread safety issue in IDBFactory' shouldThrowSecurityException()
488         https://bugs.webkit.org/show_bug.cgi?id=184064
489
490         Reviewed by Ryosuke Niwa.
491
492         shouldThrowSecurityException() gets called on a non-main thread but
493         it ended up using the SchemeRegistry via SecurityOrigin::canAccessDatabase()
494         which calls SecurityOrigin::isLocal().
495
496         Since using the SchemeRegistry from the background thread is not safe
497         (we recently added locks which we're trying to remove), and since SecurityOrigin
498         methods are often called from background threads, this patch make SecurityOrigin::isLocal()
499         safe to call from a background thread. To achieve this, we now query the SchemeRegistry
500         in the SecurityOrigin constructor instead as SecurityOrigin objects are expected to be
501         constructed on the main thread.
502
503         * page/SecurityOrigin.cpp:
504         (WebCore::SecurityOrigin::SecurityOrigin):
505         (WebCore::SecurityOrigin::isLocal const): Deleted.
506         * page/SecurityOrigin.h:
507         (WebCore::SecurityOrigin::isLocal const):
508
509 2018-03-28  Ryan Haddad  <ryanhaddad@apple.com>
510
511         Unreviewed, rolling out r230033.
512
513         The LayoutTests modified in this change fail an assertion on
514         WK1.
515
516         Reverted changeset:
517
518         "[Web Animations] Implement more CSSPropertyBlendingClient
519         methods"
520         https://bugs.webkit.org/show_bug.cgi?id=184077
521         https://trac.webkit.org/changeset/230033
522
523 2018-03-28  Chris Dumez  <cdumez@apple.com>
524
525         WebSocket::didReceiveMessage() may construct a SecurityOrigin object on a non-main thread
526         https://bugs.webkit.org/show_bug.cgi?id=184068
527
528         Reviewed by Youenn Fablet.
529
530         WebSocket::didReceiveMessage() may construct a SecurityOrigin object on a non-main thread,
531         which is not safe. We now use SecurityOriginData since we only need an origin String and
532         it is safe to construct a SecurityOriginData on any thread.
533
534         * Modules/websockets/WebSocket.cpp:
535         (WebCore::WebSocket::didReceiveMessage):
536
537 2018-03-28  Wenson Hsieh  <wenson_hsieh@apple.com>
538
539         [Extra zoom mode] Make boosted text autosizing values switchable at runtime
540         https://bugs.webkit.org/show_bug.cgi?id=184092
541         <rdar://problem/38939917>
542
543         Reviewed by Tim Horton.
544
545         In r228697, we introduced a new set of boosted text autosizing constants tuned for extra zoom mode, which are
546         currently hard-coded as default values in SettingsBase. However, we've since identified cases where clients may
547         want to opt in or out of boosted text autosizing values and just use the existing values.
548
549         This replaces settings to adjust text autosizing constants with a flag to enable or disable boosted text
550         autosizing; when changed, we update all three text autosizing parameters to their default or boosted values, and
551         then trigger style recalculation.
552
553         Test: TextAutosizingBoost.ChangeAutosizingBoostAtRuntime
554
555         * page/Settings.yaml:
556         * page/SettingsBase.cpp:
557         (WebCore::SettingsBase::shouldEnableTextAutosizingBoostChanged):
558         (WebCore::SettingsBase::defaultOneLineTextMultiplierCoefficient): Deleted.
559         (WebCore::SettingsBase::defaultMultiLineTextMultiplierCoefficient): Deleted.
560         (WebCore::SettingsBase::defaultMaxTextAutosizingScaleIncrease): Deleted.
561
562         Changed these to constant values instead of helper functions, and also introduced boosted text autosizing
563         constants for use in extra zoom mode.
564
565         * page/SettingsBase.h:
566         (WebCore::SettingsBase::oneLineTextMultiplierCoefficient const):
567         (WebCore::SettingsBase::multiLineTextMultiplierCoefficient const):
568         (WebCore::SettingsBase::maxTextAutosizingScaleIncrease const):
569         * rendering/RenderThemeIOS.mm:
570         (WebCore::RenderThemeIOS::extraDefaultStyleSheet):
571
572         Tweak the stylesheet to make `-webkit-text-size-adjust: auto` overridable by web content. Adding the !important
573         is breaking many websites that positioned text such that it is positioned within layout viewport bounds without
574         text autosizing.
575
576 2018-03-28  Brent Fulgham  <bfulgham@apple.com>
577
578         Avoid uninitialized mach ports
579         https://bugs.webkit.org/show_bug.cgi?id=184090
580         <rdar://problem/37261129>
581
582         Reviewed by Chris Dumez.
583
584         It is possible for mach_port_allocate to return an error, but we rarely check its return value. The value
585         of the argument passed to mach_port_allocate is not guaranteed to be valid when it returns an error, so
586         there is a potential for us to try to use invalid ports.
587
588         We should always check return values, and ensure that the mach port variables we seek to initialize are
589         kept in a valid state.
590
591         No new tests, no Web-facing behavior change.
592
593         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
594         (WebCore::attachToAppleGraphicsControl): Initialize masterPort to a default value.
595
596 2018-03-28  Antoine Quint  <graouts@apple.com>
597
598         [Web Animations] Implement more CSSPropertyBlendingClient methods
599         https://bugs.webkit.org/show_bug.cgi?id=184077
600
601         Reviewed by Dean Jackson.
602
603         We only had stubs for several of the CSSPropertyBlendingClient methods and thus always implied that we
604         were animating non-matching transform, filter and backdrop-filter properties. We now implement those using
605         the same code used in KeyframeAnimation. This allows for 31 new tests to opt into the CSS Animations and
606         CSS Transitions as Web Animations feature.
607
608         * animation/KeyframeEffectReadOnly.cpp:
609         (WebCore::KeyframeEffectReadOnly::copyPropertiesFromSource):
610         (WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes):
611         (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
612         (WebCore::KeyframeEffectReadOnly::checkForMatchingTransformFunctionLists):
613         (WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists):
614         (WebCore::KeyframeEffectReadOnly::checkForMatchingBackdropFilterFunctionLists):
615         (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes):
616         (WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes):
617         * animation/KeyframeEffectReadOnly.h:
618
619 2018-03-28  Antoine Quint  <graouts@apple.com>
620
621         [Web Animations] Comparing two matching FramesTimingFunction objects fails
622         https://bugs.webkit.org/show_bug.cgi?id=184078
623
624         Reviewed by Jon Lee.
625
626         Fix a stupid mistake in the == operator for FramesTimingFunction. Without a correct check, we would mistakenly interrupt and
627         restart any transition with a frames() timing function when we check that the Animation objects are similar.
628
629         * platform/animation/TimingFunction.h:
630
631 2018-03-28  Miguel Gomez  <magomez@igalia.com>
632
633         [GTK][WPE] Remove UpdateAtlas
634         https://bugs.webkit.org/show_bug.cgi?id=184042
635
636         Reviewed by Žan Doberšek.
637
638         Remove UpdateAtlas and AreaAllocator classes. Instead of using UpdateAtlas as a cache
639         of buffers to render tiles with cairo, allocate a new buffer for each tile instead.
640
641         Covered by existent tests.
642
643         * loader/EmptyClients.h:
644         * page/ChromeClient.h:
645         * platform/TextureMapper.cmake:
646         * platform/graphics/texmap/coordinated/AreaAllocator.cpp: Removed.
647         * platform/graphics/texmap/coordinated/AreaAllocator.h: Removed.
648         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
649         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
650         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
651         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
652         * platform/graphics/texmap/coordinated/SurfaceUpdateInfo.h:
653         (): Deleted.
654         * platform/graphics/texmap/coordinated/UpdateAtlas.cpp: Removed.
655         * platform/graphics/texmap/coordinated/UpdateAtlas.h: Removed.
656         * testing/Internals.cpp:
657         (WebCore::Internals::resetToConsistentState):
658
659 2018-03-27  Michael Catanzaro  <mcatanzaro@igalia.com>
660
661         Unreviewed, rolling out r230008.
662
663         Lots of HTTP test failures
664
665         Reverted changeset:
666
667         "Remove unused libsoup ResourceHandle implementation"
668         https://bugs.webkit.org/show_bug.cgi?id=184048
669         https://trac.webkit.org/changeset/230008
670
671 2018-03-27  Chris Dumez  <cdumez@apple.com>
672
673         Make it possible to call ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() from non-main threads
674         https://bugs.webkit.org/show_bug.cgi?id=184029
675
676         Reviewed by Youenn Fablet.
677
678         Make it possible to call ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() from non-main threads
679         by having it use SecurityOriginData (which is safe to construct on non-main threads) instead of
680         SecurityOrigin (which isn't).
681
682         ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() is already called from non-main thread in
683         FetchLoader, XHR and WebSocket when used in workers. This wasn't safe.
684
685         * loader/DocumentWriter.cpp:
686         (WebCore::DocumentWriter::begin):
687         * page/csp/ContentSecurityPolicy.cpp:
688         (WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded const):
689         (WebCore::ContentSecurityPolicy::setUpgradeInsecureRequests):
690         (WebCore::ContentSecurityPolicy::takeNavigationRequestsToUpgrade):
691         (WebCore::ContentSecurityPolicy::setInsecureNavigationRequestsToUpgrade):
692         * page/csp/ContentSecurityPolicy.h:
693
694 2018-03-27  Daniel Bates  <dabates@apple.com>
695
696         Attempt to fix media control layout tests after <https://trac.webkit.org/changeset/230006/>
697         (https://bugs.webkit.org/show_bug.cgi?id=179983)
698
699         Exempt elements in user agent shadow DOM from having to perform a potentially CORS-
700         enabled fetch for a mask image to try to fix the following tests from timing out:
701             media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-inline.html
702             media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-pip-to-inline.html
703
704         * style/StylePendingResources.cpp:
705         (WebCore::Style::loadPendingImage):
706
707 2018-03-27  Per Arne Vollan  <pvollan@apple.com>
708
709         The layout test fast/canvas/webgl/read-pixels-test.html is timing out.
710         https://bugs.webkit.org/show_bug.cgi?id=183923
711         <rdar://problem/38756869>
712
713         Reviewed by Brent Fulgham.
714
715         The test is timing out when we do not interact directly with the WindowServer, causing
716         OpenGL to fall back to software rendering. In this mode, any call to CGLChoosePixelFormat
717         requesting an accelerated pixel format will fail because it cannot determine which GPU is
718         connected to the display.
719
720         OpenGL treats all GPUs as if they were offline when used in a process (like the WebContent
721         process) that does not directly control the display.
722
723         We can get correct behavior if we tell OpenGL which GPU is currently connected to the
724         display, and if we instruct CGLChoosePixelFormat to create an offline renderer pixel format
725         by including the 'kCGLPFAAllowOfflineRenderers' flag in its arguments.
726
727         We can use CGLSetVirtualScreen with an OpenGL display mask that tells the OpenGL framework
728         which GPU it should use.
729
730         See https://developer.apple.com/library/content/technotes/tn2229/_index.html#//apple_ref/doc/uid/DTS40008924-CH1-SUBSECTION7
731         for details on how the virtual screen is found from the OpenGL display mask.
732
733         No new tests, covered by existing tests.
734
735         * WebCore.xcodeproj/project.pbxproj:
736         * platform/graphics/GraphicsContext3D.h:
737         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
738         (WebCore::setPixelFormat):
739         (WebCore::identifyAndSetCurrentGPU):
740         (WebCore::GraphicsContext3D::GraphicsContext3D):
741         (WebCore::GraphicsContext3D::setOpenGLDisplayMask):
742         (WebCore::GraphicsContext3D::allowOfflineRenderers):
743
744 2018-03-27  Jiewen Tan  <jiewen_tan@apple.com>
745
746         [WebAuthN] Implement authenticatorGetAssertion
747         https://bugs.webkit.org/show_bug.cgi?id=183881
748         <rdar://problem/37258628>
749
750         Reviewed by Brent Fulgham.
751
752         This patch does the following few things:
753         1) It implements the spec: https://www.w3.org/TR/webauthn/#op-get-assertion as of 5 December 2017.
754         2) It tweaks encoding/decoding of PublicKeyCredentialRequestOptions such that options can be passed
755         between UI and Web processes.
756         3) It refines the way how LocalAuthenticator::makeCredential find intersection between
757         excludeCredentialDescriptorList and existing credentials in the authenticator, such that it is faster.
758         Basically, it takes the CredentialID from the list and treat it as an ASCII string and put it into a
759         HashSet<String>. It should not matter if a duplicated CredentialID is added. If the hash set is not
760         empty, the algorithm then queries Keychain for all CredentialIDs related to the current RP ID once.
761         For every queried CredentialID, the algorithm then treats it as an ASCII string as well and look for
762         a match in the hash set to produce the intersetction. The new way is also employed in
763         LocalAuthenticator::getAssertion as well.
764         4) It abstracts the way to produce authData and thus reorders a bit of code in
765         LocalAuthenticator::makeCredential.
766
767         Covered by API tests.
768
769         * Modules/webauthn/AuthenticatorManager.cpp:
770         (WebCore::AuthenticatorManager::create const):
771         (WebCore::AuthenticatorManager::discoverFromExternalSource const):
772         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
773         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
774         (WebCore::PublicKeyCredentialRequestOptions::encode const):
775         (WebCore::PublicKeyCredentialRequestOptions::decode):
776         * Modules/webauthn/cocoa/LocalAuthenticator.h:
777         * Modules/webauthn/cocoa/LocalAuthenticator.mm:
778         (WebCore::LocalAuthenticatorInternal::buildAuthData):
779         (WebCore::LocalAuthenticatorInternal::produceHashSet):
780         (WebCore::LocalAuthenticator::makeCredential):
781         (WebCore::LocalAuthenticator::getAssertion):
782         (WebCore::LocalAuthenticator::issueClientCertificate const):
783         * WebCore.xcodeproj/project.pbxproj:
784
785 2018-03-27  Chris Dumez  <cdumez@apple.com>
786
787         Avoid constructing SecurityOrigin objects from non-main threads
788         https://bugs.webkit.org/show_bug.cgi?id=184024
789
790         Reviewed by Youenn Fablet.
791
792         Avoid constructing SecurityOrigin objects from non-main threads as much as possible
793         as it is not safe. This patch gets rid of most offending cases but not all of them
794         yet, which is why I haven't added a ASSERT(isMainThread()) to the SecurityOrigin
795         constructor yet.
796
797         For example, ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() currently
798         gets called from non-main threads and construct a SecurityOrigin. Fixing this
799         will require some refactoring that would have made this patch much larger.
800
801         * loader/DocumentLoader.cpp:
802         (WebCore::DocumentLoader::matchRegistration):
803         * page/EventSource.cpp:
804         (WebCore::EventSource::didReceiveResponse):
805         * page/SecurityOrigin.cpp:
806         (WebCore::SecurityOrigin::SecurityOrigin):
807         * page/SecurityOrigin.h:
808         (WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
809         * testing/Internals.cpp:
810         (WebCore::Internals::hasServiceWorkerRegistration):
811         * workers/DedicatedWorkerGlobalScope.cpp:
812         (WebCore::DedicatedWorkerGlobalScope::create):
813         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
814         * workers/DedicatedWorkerGlobalScope.h:
815         * workers/DedicatedWorkerThread.cpp:
816         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
817         * workers/DedicatedWorkerThread.h:
818         * workers/WorkerGlobalScope.cpp:
819         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
820         * workers/WorkerGlobalScope.h:
821         * workers/WorkerLocation.cpp:
822         (WebCore::WorkerLocation::origin const):
823         * workers/WorkerThread.cpp:
824         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
825         (WebCore::WorkerThread::workerThread):
826         * workers/WorkerThread.h:
827         * workers/service/SWClientConnection.h:
828         * workers/service/ServiceWorkerContainer.cpp:
829         (WebCore::ServiceWorkerContainer::getRegistration):
830         (WebCore::ServiceWorkerContainer::getRegistrations):
831         * workers/service/ServiceWorkerGlobalScope.cpp:
832         (WebCore::ServiceWorkerGlobalScope::create):
833         (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
834         * workers/service/ServiceWorkerGlobalScope.h:
835         * workers/service/ServiceWorkerProvider.cpp:
836         (WebCore::ServiceWorkerProvider::mayHaveServiceWorkerRegisteredForOrigin):
837         * workers/service/ServiceWorkerProvider.h:
838         * workers/service/context/ServiceWorkerThread.cpp:
839         (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
840         (WebCore::fireMessageEvent):
841         (WebCore::ServiceWorkerThread::postMessageToServiceWorker):
842         * workers/service/context/ServiceWorkerThread.h:
843
844 2018-03-27  Alex Christensen  <achristensen@webkit.org>
845
846         Remove unused libsoup ResourceHandle implementation
847         https://bugs.webkit.org/show_bug.cgi?id=184048
848
849         Reviewed by Michael Catanzaro.
850
851         This code is unused since r228901 so let's remove it!
852
853         * platform/network/ResourceHandle.h:
854         * platform/network/ResourceHandleInternal.h:
855         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
856         * platform/network/soup/ResourceHandleSoup.cpp:
857         (WebCore::ResourceHandle::~ResourceHandle):
858         (WebCore::ResourceHandleInternal::soupSession):
859         (WebCore::ResourceHandle::cancelledOrClientless):
860         (WebCore::ResourceHandle::ensureReadBuffer):
861         (WebCore::ResourceHandle::currentStreamPosition const):
862         (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
863         (WebCore::ResourceHandle::didStartRequest):
864         (WebCore::ResourceHandle::start):
865         (WebCore::ResourceHandle::releaseForDownload):
866         (WebCore::ResourceHandle::sendPendingRequest):
867         (WebCore::ResourceHandle::cancel):
868         (WebCore::ResourceHandle::shouldUseCredentialStorage):
869         (WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge):
870         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
871         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
872         (WebCore::ResourceHandle::receivedCredential):
873         (WebCore::ResourceHandle::receivedCancellation):
874         (WebCore::ResourceHandle::receivedChallengeRejection):
875         (WebCore::ResourceHandle::platformSetDefersLoading):
876         (WebCore::sessionFromContext): Deleted.
877         (WebCore::ResourceHandle::create): Deleted.
878         (WebCore::ResourceHandle::ResourceHandle): Deleted.
879         (WebCore::isAuthenticationFailureStatusCode): Deleted.
880         (WebCore::tlsErrorsChangedCallback): Deleted.
881         (WebCore::gotHeadersCallback): Deleted.
882         (WebCore::applyAuthenticationToRequest): Deleted.
883         (WebCore::restartedCallback): Deleted.
884         (WebCore::shouldRedirect): Deleted.
885         (WebCore::shouldRedirectAsGET): Deleted.
886         (WebCore::continueAfterWillSendRequest): Deleted.
887         (WebCore::doRedirect): Deleted.
888         (WebCore::redirectSkipCallback): Deleted.
889         (WebCore::wroteBodyDataCallback): Deleted.
890         (WebCore::cleanupSoupRequestOperation): Deleted.
891         (WebCore::nextMultipartResponsePartCallback): Deleted.
892         (WebCore::sendRequestCallback): Deleted.
893         (WebCore::continueAfterDidReceiveResponse): Deleted.
894         (WebCore::startingCallback): Deleted.
895         (WebCore::networkEventCallback): Deleted.
896         (WebCore::createSoupMessageForHandleAndRequest): Deleted.
897         (WebCore::createSoupRequestAndMessageForHandle): Deleted.
898         (WebCore::ResourceHandle::timeoutFired): Deleted.
899         (WebCore::waitingToSendRequest): Deleted.
900         (WebCore::readCallback): Deleted.
901
902 2018-03-27  Chris Dumez  <cdumez@apple.com>
903
904         Move online state detection from the WebProcess to the NetworkProcess
905         https://bugs.webkit.org/show_bug.cgi?id=183989
906         <rdar://problem/37093299>
907
908         Reviewed by Youenn Fablet.
909
910         Move online state detection from the WebProcess to the NetworkProcess. This avoid executing the same (expensive) code in
911         EACH web process whenever a network interface's state changes. Now, the Network Process monitors network interfaces
912         and determines the online state whenever an interface's state changes. If the onLine state changes, it notifies all
913         its connected WebProcesses via IPC.
914
915         * inspector/agents/InspectorApplicationCacheAgent.cpp:
916         (WebCore::InspectorApplicationCacheAgent::networkStateChanged):
917         * loader/LoaderStrategy.h:
918         * page/Navigator.cpp:
919         (WebCore::Navigator::onLine const):
920         * page/Page.cpp:
921         * platform/network/NetworkStateNotifier.h:
922         * workers/Worker.cpp:
923         (WebCore::Worker::Worker):
924         (WebCore::Worker::notifyFinished):
925         * workers/service/context/ServiceWorkerThread.cpp:
926         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
927         * workers/service/context/ServiceWorkerThreadProxy.cpp:
928         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
929
930 2018-03-27  Daniel Bates  <dabates@apple.com>
931
932         CSS mask images should be retrieved using potentially CORS-enabled fetch
933         https://bugs.webkit.org/show_bug.cgi?id=179983
934         <rdar://problem/35678149>
935
936         Reviewed by Brent Fulgham.
937
938         As per <https://drafts.fxtf.org/css-masking-1/#priv-sec> (Editor’s Draft, 23 December 2017)
939         we should fetch CSS mask images using a potentially CORS-enabled fetch.
940
941         Both cross-origin CSS shape-outside images and CSS mask images may be sensitive to timing
942         attacks that can be used to reveal their pixel data when retrieved without regard to CORS.
943         For the same reason that we fetch CSS shape-outside images using a potentially CORS-enabled
944         fetch we should fetch CSS mask the same way. This also makes the behavior of WebKit more
945         closely align with the behavior in the spec.
946
947         Test: http/tests/security/css-mask-image.html
948
949         * page/Settings.yaml: Add a setting for toggle "Anonymous" mode fetching of mask images (defaults: true).
950         We need this setting to avoid breaking the developer convenience feature that some modern media controls
951         layout tests employ to load assets from the filesystem as opposed to using the hardcoded data URLs baked
952         into the WebKit binary.
953         * style/StylePendingResources.cpp: Substitute LoadPolicy::NoCORS and LoadPolicy::Anonymous for
954         LoadPolicy::Normal and LoadPolicy::ShapeOutside, respectively, to match the terminology used
955         in the HTML, CSS Shapes Module Level 1, and CSS Masking Module Level 1 specs.
956         (WebCore::Style::loadPendingImage): Ditto.
957         (WebCore::Style::loadPendingResources): Use load policy LoadPolicy::Anonymous when fetching
958         a mask image or shape-outside image.
959
960 2018-03-27  Zalan Bujtas  <zalan@apple.com>
961
962         RenderBox::parent/firstChild/nextSibling/previousSiblingBox() functions should type check.
963         https://bugs.webkit.org/show_bug.cgi?id=184032
964         <rdar://problem/38384984>
965
966         Reviewed by Antti Koivisto.
967
968         We cannot rely on the correctness of the render tree structure when querying for parent/child/next and previous
969         sibling since some features (multicolumn/spanners) move subtrees out of their original position (which is highly
970         undesired and should not be encouraged at all though).
971         It should also be noted that these functions are not equivalent of typeOfChildren<RenderBox> and the following usage
972             for (auto* boxChild = firstChildBox(); boxChild; boxChild = boxChild->nextSiblingBox())
973         can lead to unexpected result.
974  
975         Test: fast/multicol/parent-box-when-spanner-is-present.html
976
977         * rendering/RenderBox.h:
978         (WebCore::RenderBox::parentBox const):
979         (WebCore::RenderBox::firstChildBox const):
980         (WebCore::RenderBox::lastChildBox const):
981         (WebCore::RenderBox::previousSiblingBox const):
982         (WebCore::RenderBox::nextSiblingBox const):
983         * rendering/RenderListItem.cpp:
984         (WebCore::RenderListItem::positionListMarker):
985         * rendering/RenderListMarker.cpp:
986         (WebCore::RenderListMarker::layout):
987         * rendering/RenderMultiColumnSet.cpp:
988         (WebCore::RenderMultiColumnSet::updateLogicalWidth):
989
990 2018-03-27  Brent Fulgham  <bfulgham@apple.com>
991
992         Further refine cookie read/write logging
993         https://bugs.webkit.org/show_bug.cgi?id=184044
994         <rdar://problem/38915610>
995
996         Reviewed by Chris Dumez.
997
998         Export 'shouldBlockCookies' so that it can be accessed by the WebKit framework.
999
1000         * platform/network/NetworkStorageSession.h:
1001
1002 2018-03-27  Antoine Quint  <graouts@apple.com>
1003
1004         [Web Animations] Stop using internals.pauseAnimationAtTimeOnElement() in favor of Web Animations API for animations tests
1005         https://bugs.webkit.org/show_bug.cgi?id=184038
1006
1007         Reviewed by Dean Jackson.
1008
1009         Expose a new method to indicate that the runtime flag for CSS Animations and CSS Transitions as Web Animations is enabled.
1010
1011         * testing/InternalSettings.cpp:
1012         (WebCore::InternalSettings::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
1013         * testing/InternalSettings.h:
1014         * testing/InternalSettings.idl:
1015
1016 2018-03-27  Thibault Saunier  <tsaunier@igalia.com>
1017
1018         [GStreamer] Enhance debugging in the BasePlayer
1019         https://bugs.webkit.org/show_bug.cgi?id=184035
1020
1021         Reviewed by Philippe Normand.
1022
1023         No behaviour changes so no test were added/enabled.
1024
1025         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1026         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
1027         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
1028         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
1029         (WebCore::MediaPlayerPrivateGStreamerBase::setVolume):
1030         (WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
1031         (WebCore::MediaPlayerPrivateGStreamerBase::setMuted):
1032         (WebCore::MediaPlayerPrivateGStreamerBase::muted const):
1033         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
1034         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
1035         (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
1036         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
1037         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
1038         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
1039         (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
1040
1041 2018-03-27  Eric Carlson  <eric.carlson@apple.com>
1042
1043         Make AVFoundationEnabled preference available on iOS
1044         https://bugs.webkit.org/show_bug.cgi?id=183876
1045         <rdar://problem/38726459>
1046
1047         Reviewed by Youenn Fablet.
1048
1049         Test: AVFoundationPref API test.
1050
1051         * html/HTMLAudioElement.idl: There is no need for a runtime setting to enable/disable audio,
1052         there is already settings.mediaEnabled.
1053         * html/HTMLMediaElement.cpp:
1054         (WebCore::HTMLMediaElement::prepareForLoad): Fail if there are no media engines registered.
1055         (WebCore::HTMLMediaElement::noneSupported): Return early if m_error has already been set.
1056         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Remove a typo.
1057
1058         * page/RuntimeEnabledFeatures.cpp:
1059         (WebCore::RuntimeEnabledFeatures::audioEnabled const): Deleted.
1060         * page/RuntimeEnabledFeatures.h:
1061
1062 2018-03-27  Fujii Hironori  <Hironori.Fujii@sony.com>
1063
1064         [GTK] Layout test editing/deleting/delete-surrogatepair.html crashing with CRITICAL **: enchant_dict_check: assertion 'g_utf8_validate(word, len, NULL)' failed
1065         https://bugs.webkit.org/show_bug.cgi?id=176799
1066
1067         Reviewed by Carlos Garcia Campos.
1068
1069         The length of a surrogate-pair UTF-16 character is 2 even though
1070         the number of characters is 1. An incorrect string length was
1071         passed to enchant_dict_check if the string contains a
1072         surrogate-pair character because the length was calculated by
1073         applying UTF-16 character position to UTF-8 string.
1074
1075         No new tests (Covered by existing tests).
1076
1077         * platform/text/enchant/TextCheckerEnchant.cpp:
1078         (WebCore::TextCheckerEnchant::checkSpellingOfWord): Changed the
1079         type of an argument `word` from CString to String. Convert a
1080         substring of the argument into UTF-8.
1081         (WebCore::TextCheckerEnchant::checkSpellingOfString): Pass the
1082         original UTF-16 string to checkSpellingOfWord instead of a
1083         converted UTF-8 string.
1084         * platform/text/enchant/TextCheckerEnchant.h: Changed the type of
1085         an argument `word` from CString to String.
1086
1087 2018-03-26  Ms2ger  <Ms2ger@igalia.com>
1088
1089         Remove an unnecessary const_cast from BitmapTextureGL::updateContents().
1090         https://bugs.webkit.org/show_bug.cgi?id=184007
1091
1092         Reviewed by Žan Doberšek.
1093
1094         No new tests.
1095
1096         * platform/graphics/texmap/BitmapTextureGL.cpp:
1097         (WebCore::BitmapTextureGL::updateContents):
1098
1099 2018-03-23  Antoine Quint  <graouts@apple.com>
1100
1101         [Web Animations] Make imported/mozilla/css-animations/test_animation-currenttime.html pass reliably
1102         https://bugs.webkit.org/show_bug.cgi?id=183819
1103
1104         Reviewed by Dean Jackson.
1105
1106         The current time for a CSS Animation exposed via the API should be clamped between 0 and the animation duration.
1107
1108         * animation/CSSAnimation.cpp:
1109         (WebCore::CSSAnimation::bindingsCurrentTime const):
1110         * animation/CSSAnimation.h:
1111         * animation/WebAnimation.h:
1112
1113 2018-03-23  Antoine Quint  <graouts@apple.com>
1114
1115         [Web Animations] Correctly handle timing functions specified by CSS Animations and CSS Transitions
1116         https://bugs.webkit.org/show_bug.cgi?id=183935
1117
1118         Reviewed by Dean Jackson.
1119
1120         We were incorrectly reflecting the animation-timing-function and transition-timing-function values on the generated
1121         DeclarativeAnimation effect timing "easing" property. In fact, those values should only be represented on the keyframes.
1122
1123         In the case of a CSS Animation, the animation-timing-function property set on the element's style serves as the default
1124         value used for all keyframes, and individual keyframes can specify an overriding animation-timing-function. For a CSS
1125         Transition, the transition-timing-function property set on the element's style serves as the timing function of the
1126         from keyframe.
1127
1128         To correctly reflect this, we provide a new timingFunctionForKeyframeAtIndex() function on KeyframeEffectReadOnly
1129         which will return the right TimingFunction object at a given index, regardless of the animation type. In the case
1130         of getKeyframes(), we manually return "linear" for the "to" keyframe since timingFunctionForKeyframeAtIndex()
1131         would otherwise return the same timing function as the "from" keyframe. This avoids creating an extra
1132         LinearTimingFunction object.
1133
1134         As a result, a number of Mozilla imported tests progress since we have correct information on the "easing" property
1135         of objects returned by getKeyframes() and the "progress" reported by getComputedTiming() now always uses a linear
1136         timing function.
1137
1138         * animation/DeclarativeAnimation.cpp:
1139         (WebCore::DeclarativeAnimation::syncPropertiesWithBackingAnimation): The timing function of the backing Animation should
1140         not be reflected on the effect's timing object.
1141         * animation/KeyframeEffectReadOnly.cpp:
1142         (WebCore::KeyframeEffectReadOnly::getKeyframes): Return the correct timing function for a keyframe, and use a "linear"
1143         value for the "to" keyframe of a CSS Transition.
1144         (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle):
1145         (WebCore::KeyframeEffectReadOnly::timingFunctionForKeyframeAtIndex):
1146         * animation/KeyframeEffectReadOnly.h:
1147
1148 2018-03-26  Chris Dumez  <cdumez@apple.com>
1149
1150         Use SecurityOriginData more consistently in Service Worker code
1151         https://bugs.webkit.org/show_bug.cgi?id=183969
1152
1153         Reviewed by Darin Adler.
1154
1155         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
1156         SecurityOrigin objects unnecessarily.
1157
1158         I also updated SecurityOrigin to use SecurityOriginData as a data member. This reduces
1159         code duplication a bit. This also avoids constructing SecurityOriginData unnecessarily
1160         in some cases as callers can now use SecurityOrigin::data() instead of
1161         SecurityOriginData::fromSecurityOrigin().
1162
1163         No new tests, no Web-facing behavior change.
1164
1165         * Modules/cache/DOMCacheStorage.cpp:
1166         (WebCore::DOMCacheStorage::origin const):
1167         * Modules/encryptedmedia/CDM.cpp:
1168         (WebCore::CDM::storageDirectory const):
1169         * Modules/encryptedmedia/MediaKeySession.cpp:
1170         (WebCore::MediaKeySession::mediaKeysStorageDirectory const):
1171         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1172         (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const):
1173         * Modules/indexeddb/IDBFactory.cpp:
1174         (WebCore::IDBFactory::openInternal):
1175         (WebCore::IDBFactory::deleteDatabase):
1176         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1177         (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
1178         * Modules/webdatabase/Database.cpp:
1179         (WebCore::Database::securityOrigin):
1180         * Modules/webdatabase/DatabaseContext.cpp:
1181         (WebCore::DatabaseContext::securityOrigin const):
1182         * Modules/webdatabase/DatabaseContext.h:
1183         * Modules/webdatabase/DatabaseManager.cpp:
1184         (WebCore::DatabaseManager::fullPathForDatabase):
1185         (WebCore::DatabaseManager::detailsForNameAndOrigin):
1186         * html/HTMLMediaElement.cpp:
1187         (WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const):
1188         * inspector/agents/InspectorDOMStorageAgent.cpp:
1189         (WebCore::InspectorDOMStorageAgent::findStorageArea):
1190         * loader/appcache/ApplicationCacheStorage.cpp:
1191         (WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
1192         (WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
1193         (WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
1194         (WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
1195         (WebCore::ApplicationCacheStorage::store):
1196         (WebCore::ApplicationCacheStorage::ensureOriginRecord):
1197         * page/DOMWindow.cpp:
1198         (WebCore:: const):
1199         * page/SecurityOrigin.cpp:
1200         (WebCore::SecurityOrigin::SecurityOrigin):
1201         (WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
1202         (WebCore::SecurityOrigin::canAccess const):
1203         (WebCore::SecurityOrigin::canDisplay const):
1204         (WebCore::SecurityOrigin::domainForCachePartition const):
1205         (WebCore::SecurityOrigin::isLocal const):
1206         (WebCore::SecurityOrigin::toString const):
1207         (WebCore::SecurityOrigin::toRawString const):
1208         (WebCore::SecurityOrigin::create):
1209         (WebCore::SecurityOrigin::isSameSchemeHostPort const):
1210         * page/SecurityOrigin.h:
1211         (WebCore::SecurityOrigin::protocol const):
1212         (WebCore::SecurityOrigin::host const):
1213         (WebCore::SecurityOrigin::port const):
1214         (WebCore::SecurityOrigin::data const):
1215         (WebCore::SecurityOrigin::isHTTPFamily const):
1216         * page/SecurityOriginData.cpp:
1217         (WebCore::SecurityOriginData::toString const):
1218         (WebCore::SecurityOriginData::fromFrame):
1219         * page/SecurityOriginData.h:
1220         (WebCore::SecurityOriginData::fromURL):
1221         * storage/StorageNamespaceProvider.cpp:
1222         (WebCore::StorageNamespaceProvider::localStorageArea):
1223         * testing/Internals.cpp:
1224         (WebCore::Internals::clearCacheStorageMemoryRepresentation):
1225         * workers/service/ServiceWorkerContainer.cpp:
1226         (WebCore::ServiceWorkerContainer::addRegistration):
1227         (WebCore::ServiceWorkerContainer::removeRegistration):
1228         (WebCore::ServiceWorkerContainer::updateRegistration):
1229         * workers/service/ServiceWorkerRegistrationKey.cpp:
1230         (WebCore::ServiceWorkerRegistrationKey::relatesToOrigin const):
1231         * workers/service/ServiceWorkerRegistrationKey.h:
1232         * workers/service/server/SWOriginStore.cpp:
1233         (WebCore::SWOriginStore::add):
1234         (WebCore::SWOriginStore::remove):
1235         (WebCore::SWOriginStore::clear):
1236         * workers/service/server/SWOriginStore.h:
1237         * workers/service/server/SWServer.cpp:
1238         (WebCore::SWServer::addRegistration):
1239         (WebCore::SWServer::removeRegistration):
1240         (WebCore::SWServer::clear):
1241         (WebCore::SWServer::tryInstallContextData):
1242         (WebCore::SWServer::serverToContextConnectionCreated):
1243         (WebCore::SWServer::markAllWorkersForOriginAsTerminated):
1244         (WebCore::SWServer::unregisterServiceWorkerClient):
1245         (WebCore::SWServer::needsServerToContextConnectionForOrigin const):
1246         * workers/service/server/SWServer.h:
1247         * workers/service/server/SWServerToContextConnection.cpp:
1248         (WebCore::SWServerToContextConnection::SWServerToContextConnection):
1249         (WebCore::SWServerToContextConnection::~SWServerToContextConnection):
1250         (WebCore::SWServerToContextConnection::connectionForOrigin):
1251         * workers/service/server/SWServerToContextConnection.h:
1252         (WebCore::SWServerToContextConnection::securityOrigin const):
1253         * workers/service/server/SWServerWorker.cpp:
1254         (WebCore::SWServerWorker::origin const):
1255         (WebCore::SWServerWorker::securityOrigin const):
1256         * workers/service/server/SWServerWorker.h:
1257
1258 2018-03-26  Brent Fulgham  <bfulgham@apple.com>
1259
1260         Warn against cookie access in the WebContent process using ProcessPrivilege assertions
1261         https://bugs.webkit.org/show_bug.cgi?id=183911
1262         <rdar://problem/38762306>
1263
1264         Reviewed by Youenn Fablet.
1265
1266         Add a set of ProcessPrivilege assertions to enforce the rule that the WebContent process
1267         should never call Cookie API directly. That should only happen in the Networking or
1268         UIProcess. 
1269
1270         Add a new static flag to NetworkStorageSession that indicates if the current process has
1271         permission to interact with the Cookie API.
1272
1273         No new tests since there is no change in behavior.
1274
1275         * platform/network/NetworkStorageSession.cpp:
1276         (WebCore::NetworkStorageSession::NetworkStorageSession):
1277         (WebCore::NetworkStorageSession::processMayUseCookieAPI): Added.
1278         (WebCore::NetworkStorageSession::permitProcessToUseCookieAPI): Added. This also adds
1279         the appropriate flag to the ProcessPrivileges data for the current process.
1280         * platform/network/NetworkStorageSession.h:
1281         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1282         (WebCore::createCFStorageSessionForIdentifier): Do not create cookie storage if the current
1283         process is prohibited from interacting with the Cookie API.
1284         (WebCore::NetworkStorageSession::NetworkStorageSession): Add assertions.
1285         (WebCore::NetworkStorageSession::switchToNewTestingSession): Do not create cookie storage if
1286         the current process is prohibited from interacting with the Cookie API.
1287         (WebCore::NetworkStorageSession::defaultStorageSession): Ditto.
1288         (WebCore::NetworkStorageSession::ensureSession): Ditto.
1289         (WebCore::NetworkStorageSession::cookieStorage const): Ditto.
1290         * platform/network/cocoa/CookieStorageObserver.mm:
1291         (WebCore::CookieStorageObserver::CookieStorageObserver): Assert if accessed from untrusted process.
1292         (WebCore::CookieStorageObserver::startObserving): Ditto.
1293         (WebCore::CookieStorageObserver::stopObserving): Ditto.
1294         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
1295         (WebCore::NetworkStorageSession::setCookie):
1296         (WebCore::NetworkStorageSession::setCookies):
1297         (WebCore::NetworkStorageSession::deleteCookie):
1298         (WebCore::nsCookiesToCookieVector):
1299         (WebCore::NetworkStorageSession::getAllCookies):
1300         (WebCore::NetworkStorageSession::getCookies):
1301         (WebCore::NetworkStorageSession::flushCookieStore):
1302         (WebCore::NetworkStorageSession::nsCookieStorage const):
1303         (WebCore::createPrivateStorageSession):
1304         * platform/network/mac/CookieJarMac.mm:
1305         (WebCore::httpCookies):
1306         (WebCore::deleteHTTPCookie):
1307         (WebCore::httpCookiesForURL):
1308         (WebCore::filterCookies):
1309         (WebCore::applyPartitionToCookies):
1310         (WebCore::cookiesInPartitionForURL):
1311         (WebCore::cookiesForSession):
1312         (WebCore::setHTTPCookiesForURL):
1313         (WebCore::deleteAllHTTPCookies):
1314         (WebCore::setCookiesFromDOM):
1315         (WebCore::httpCookieAcceptPolicy):
1316         (WebCore::deleteCookie):
1317         (WebCore::deleteCookiesForHostnames):
1318         (WebCore::deleteAllCookiesModifiedSince):
1319
1320 2018-03-26  Alex Christensen  <achristensen@webkit.org>
1321
1322         Merge ResourceHandleClient::willCacheResponseAsync with ResourceHandleClient::willCacheResponse
1323         https://bugs.webkit.org/show_bug.cgi?id=183965
1324
1325         Reviewed by Chris Dumez.
1326
1327         It turns out that ResourceHandleClient::willCacheResponseAsync didn't do anything and the logic in
1328         ResourceHandleClient::willCacheResponse was not being called.  This makes it so there is one code
1329         path and it executes the logic in ResourceHandleClient::willCacheResponse.
1330
1331         * loader/EmptyFrameLoaderClient.h:
1332         * loader/FrameLoaderClient.h:
1333         * loader/ResourceLoader.h:
1334         * loader/SubresourceLoader.h:
1335         * loader/cocoa/SubresourceLoaderCocoa.mm:
1336         (WebCore::SubresourceLoader::willCacheResponseAsync):
1337         (WebCore::SubresourceLoader::willCacheResponse): Deleted.
1338         * loader/mac/ResourceLoaderMac.mm:
1339         (WebCore::ResourceLoader::willCacheResponseAsync):
1340         (WebCore::ResourceLoader::willCacheResponse): Deleted.
1341         * platform/network/ResourceHandle.h:
1342         * platform/network/ResourceHandleClient.cpp:
1343         (WebCore::ResourceHandleClient::willCacheResponseAsync): Deleted.
1344         * platform/network/ResourceHandleClient.h:
1345         (WebCore::ResourceHandleClient::willCacheResponseAsync):
1346         (WebCore::ResourceHandleClient::shouldCacheResponse):
1347         (WebCore::ResourceHandleClient::willCacheResponse): Deleted.
1348         * platform/network/cf/ResourceHandleCFNet.cpp:
1349         (WebCore::ResourceHandle::continueWillCacheResponse): Deleted.
1350         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
1351         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1352         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
1353         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueWillCacheResponse): Deleted.
1354         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
1355         * platform/network/mac/ResourceHandleMac.mm:
1356         (WebCore::ResourceHandle::continueWillCacheResponse): Deleted.
1357         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
1358         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1359         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
1360         (-[WebCoreResourceHandleAsOperationQueueDelegate continueWillCacheResponse:]): Deleted.
1361
1362 2018-03-26  Miguel Gomez  <magomez@igalia.com>
1363
1364         [GTK][WPE] Upload correct buffer in BitmapTextureGL::updateContents()
1365         https://bugs.webkit.org/show_bug.cgi?id=184004
1366
1367         Reviewed by Žan Doberšek.
1368
1369         Do not upload the original buffer. Upload the result of creating a subImage buffer
1370         if it was required.
1371
1372         Covered by existent tests.
1373
1374         * platform/graphics/texmap/BitmapTextureGL.cpp:
1375         (WebCore::BitmapTextureGL::updateContents):
1376
1377 2018-03-25  Zan Dobersek  <zdobersek@igalia.com>
1378
1379         [TexMap] Clean up TextureMapperPlatformLayer, TextureMapperBackingStore code
1380         https://bugs.webkit.org/show_bug.cgi?id=183985
1381
1382         Reviewed by Michael Catanzaro.
1383
1384         Clean up TextureMapperPlatformLayer and TextureMapperBackingStore
1385         headers and implementation files. Remove dubious whitespace, use #pragma
1386         once, clean up constructors, destructors, method definitions and remove
1387         unnecessary includes in favor of forward declarations where possible.
1388
1389         The TextureMapperPlatformLayer::swapBuffers() method is removed as it
1390         wasn't called or overridden anywhere.
1391
1392         No new tests -- no change in functionality.
1393
1394         * platform/graphics/texmap/TextureMapperBackingStore.cpp:
1395         * platform/graphics/texmap/TextureMapperBackingStore.h:
1396         (WebCore::TextureMapperBackingStore::drawRepaintCounter):
1397         * platform/graphics/texmap/TextureMapperPlatformLayer.h:
1398         (WebCore::TextureMapperPlatformLayer::setClient):
1399         (WebCore::TextureMapperPlatformLayer::TextureMapperPlatformLayer): Deleted.
1400         (WebCore::TextureMapperPlatformLayer::swapBuffers): Deleted.
1401
1402 2018-03-25  Dan Bernstein  <mitz@apple.com>
1403
1404         [Xcode] Remove workaround only needed for deploying to iOS 10.0 and earlier
1405         https://bugs.webkit.org/show_bug.cgi?id=183999
1406
1407         Reviewed by Sam Weinig.
1408
1409         * Configurations/WebCore.xcconfig: Removed build settings.
1410         * Configurations/WebCoreTestSupport.xcconfig: Removed location of phony WebKitLegacy from
1411           frameworks search path.
1412         * Configurations/WebKitLegacyStub.iOS.tbd: Removed.
1413         * WebCore.xcodeproj/project.pbxproj: Removed script build phase from the Derived Sources target.
1414
1415 2018-03-25  Commit Queue  <commit-queue@webkit.org>
1416
1417         Unreviewed, rolling out r229954.
1418         https://bugs.webkit.org/show_bug.cgi?id=184000
1419
1420         Caused many layout tests to crash on Apple High Sierra,
1421         Sierra, iOS Simulator and GTK Linux Debug test bots (Requested
1422         by dydz on #webkit).
1423
1424         Reverted changeset:
1425
1426         "Use SecurityOriginData more consistently in Service Worker
1427         code"
1428         https://bugs.webkit.org/show_bug.cgi?id=183969
1429         https://trac.webkit.org/changeset/229954
1430
1431 2018-03-23  Alex Christensen  <achristensen@webkit.org>
1432
1433         Use completion handlers for ResourceHandleClient::canAuthenticateAgainstProtectionSpaceAsync
1434         https://bugs.webkit.org/show_bug.cgi?id=183966
1435
1436         Reviewed by Chris Dumez.
1437
1438         No change in behavior.
1439
1440         * loader/ResourceLoader.cpp:
1441         (WebCore::ResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
1442         * loader/ResourceLoader.h:
1443         * platform/network/BlobResourceHandle.cpp:
1444         * platform/network/PingHandle.h:
1445         * platform/network/ResourceHandle.h:
1446         * platform/network/ResourceHandleClient.h:
1447         * platform/network/SynchronousLoaderClient.cpp:
1448         (WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpaceAsync):
1449         * platform/network/SynchronousLoaderClient.h:
1450         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
1451         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1452         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
1453         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
1454         * platform/network/mac/ResourceHandleMac.mm:
1455         (WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
1456         (WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace): Deleted.
1457         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
1458         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1459         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
1460         (-[WebCoreResourceHandleAsOperationQueueDelegate continueCanAuthenticateAgainstProtectionSpace:]): Deleted.
1461
1462 2018-03-24  Chris Dumez  <cdumez@apple.com>
1463
1464         Use SecurityOriginData more consistently in Service Worker code
1465         https://bugs.webkit.org/show_bug.cgi?id=183969
1466
1467         Reviewed by Darin Adler.
1468
1469         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
1470         SecurityOrigin objects unnecessarily.
1471
1472         I also updated SecurityOrigin to use SecurityOriginData as a data member. This reduces
1473         code duplication a bit. This also avoids constructing SecurityOriginData unnecessarily
1474         in some cases as callers can now use SecurityOrigin::data() instead of
1475         SecurityOriginData::fromSecurityOrigin().
1476
1477         No new tests, no Web-facing behavior change.
1478
1479         * Modules/cache/DOMCacheStorage.cpp:
1480         (WebCore::DOMCacheStorage::origin const):
1481         * Modules/encryptedmedia/CDM.cpp:
1482         (WebCore::CDM::storageDirectory const):
1483         * Modules/encryptedmedia/MediaKeySession.cpp:
1484         (WebCore::MediaKeySession::mediaKeysStorageDirectory const):
1485         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1486         (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const):
1487         * Modules/indexeddb/IDBFactory.cpp:
1488         (WebCore::IDBFactory::openInternal):
1489         (WebCore::IDBFactory::deleteDatabase):
1490         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1491         (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
1492         * Modules/webdatabase/Database.cpp:
1493         (WebCore::Database::securityOrigin):
1494         * Modules/webdatabase/DatabaseContext.cpp:
1495         (WebCore::DatabaseContext::securityOrigin const):
1496         * Modules/webdatabase/DatabaseContext.h:
1497         * Modules/webdatabase/DatabaseManager.cpp:
1498         (WebCore::DatabaseManager::fullPathForDatabase):
1499         (WebCore::DatabaseManager::detailsForNameAndOrigin):
1500         * html/HTMLMediaElement.cpp:
1501         (WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const):
1502         * inspector/agents/InspectorDOMStorageAgent.cpp:
1503         (WebCore::InspectorDOMStorageAgent::findStorageArea):
1504         * loader/appcache/ApplicationCacheStorage.cpp:
1505         (WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
1506         (WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
1507         (WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
1508         (WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
1509         (WebCore::ApplicationCacheStorage::store):
1510         (WebCore::ApplicationCacheStorage::ensureOriginRecord):
1511         * page/DOMWindow.cpp:
1512         (WebCore:: const):
1513         * page/SecurityOrigin.cpp:
1514         (WebCore::SecurityOrigin::SecurityOrigin):
1515         (WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
1516         (WebCore::SecurityOrigin::canAccess const):
1517         (WebCore::SecurityOrigin::canDisplay const):
1518         (WebCore::SecurityOrigin::domainForCachePartition const):
1519         (WebCore::SecurityOrigin::isLocal const):
1520         (WebCore::SecurityOrigin::toString const):
1521         (WebCore::SecurityOrigin::toRawString const):
1522         (WebCore::SecurityOrigin::create):
1523         (WebCore::SecurityOrigin::isSameSchemeHostPort const):
1524         * page/SecurityOrigin.h:
1525         (WebCore::SecurityOrigin::protocol const):
1526         (WebCore::SecurityOrigin::host const):
1527         (WebCore::SecurityOrigin::port const):
1528         (WebCore::SecurityOrigin::data const):
1529         (WebCore::SecurityOrigin::isHTTPFamily const):
1530         * page/SecurityOriginData.cpp:
1531         (WebCore::SecurityOriginData::toString const):
1532         (WebCore::SecurityOriginData::fromFrame):
1533         * page/SecurityOriginData.h:
1534         (WebCore::SecurityOriginData::fromURL):
1535         * storage/StorageNamespaceProvider.cpp:
1536         (WebCore::StorageNamespaceProvider::localStorageArea):
1537         * testing/Internals.cpp:
1538         (WebCore::Internals::clearCacheStorageMemoryRepresentation):
1539         * workers/service/ServiceWorkerContainer.cpp:
1540         (WebCore::ServiceWorkerContainer::addRegistration):
1541         (WebCore::ServiceWorkerContainer::removeRegistration):
1542         (WebCore::ServiceWorkerContainer::updateRegistration):
1543         * workers/service/ServiceWorkerRegistrationKey.cpp:
1544         (WebCore::ServiceWorkerRegistrationKey::relatesToOrigin const):
1545         * workers/service/ServiceWorkerRegistrationKey.h:
1546         * workers/service/server/SWOriginStore.cpp:
1547         (WebCore::SWOriginStore::add):
1548         (WebCore::SWOriginStore::remove):
1549         (WebCore::SWOriginStore::clear):
1550         * workers/service/server/SWOriginStore.h:
1551         * workers/service/server/SWServer.cpp:
1552         (WebCore::SWServer::addRegistration):
1553         (WebCore::SWServer::removeRegistration):
1554         (WebCore::SWServer::clear):
1555         (WebCore::SWServer::tryInstallContextData):
1556         (WebCore::SWServer::serverToContextConnectionCreated):
1557         (WebCore::SWServer::markAllWorkersForOriginAsTerminated):
1558         (WebCore::SWServer::unregisterServiceWorkerClient):
1559         (WebCore::SWServer::needsServerToContextConnectionForOrigin const):
1560         * workers/service/server/SWServer.h:
1561         * workers/service/server/SWServerToContextConnection.cpp:
1562         (WebCore::SWServerToContextConnection::SWServerToContextConnection):
1563         (WebCore::SWServerToContextConnection::~SWServerToContextConnection):
1564         (WebCore::SWServerToContextConnection::connectionForOrigin):
1565         * workers/service/server/SWServerToContextConnection.h:
1566         (WebCore::SWServerToContextConnection::securityOrigin const):
1567         * workers/service/server/SWServerWorker.cpp:
1568         (WebCore::SWServerWorker::origin const):
1569         (WebCore::SWServerWorker::securityOrigin const):
1570         * workers/service/server/SWServerWorker.h:
1571
1572 2018-03-24  Commit Queue  <commit-queue@webkit.org>
1573
1574         Unreviewed, rolling out r229792.
1575         https://bugs.webkit.org/show_bug.cgi?id=183980
1576
1577         not actually necessary (Requested by thorton on #webkit).
1578
1579         Reverted changeset:
1580
1581         "Fix the build"
1582         https://trac.webkit.org/changeset/229792
1583
1584 2018-03-23  Tim Horton  <timothy_horton@apple.com>
1585
1586         Fix the geolocation build
1587         https://bugs.webkit.org/show_bug.cgi?id=183975
1588
1589         * Modules/geolocation/ios/GeolocationPositionIOS.mm:
1590         (WebCore::GeolocationPosition::GeolocationPosition):
1591
1592 2018-03-23  Tim Horton  <timothy_horton@apple.com>
1593
1594         Fix the build with no pasteboard
1595         https://bugs.webkit.org/show_bug.cgi?id=183973
1596
1597         Reviewed by Dan Bernstein.
1598
1599         * Configurations/FeatureDefines.xcconfig:
1600         * platform/ios/PlatformPasteboardIOS.mm:
1601
1602 2018-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1603
1604         [Extra zoom mode] Fix some localizable strings after r229878
1605         https://bugs.webkit.org/show_bug.cgi?id=183963
1606
1607         Reviewed by Tim Horton.
1608
1609         The WEB_UI_STRING macro was incorrectly used for certain localized strings pertaining to extra zoom mode. To
1610         correct this, make the "Done" string use WEB_UI_STRING with actual UI-facing text; since day, year and month
1611         labels in the date picker are less generalizable to other UI, leave these as unique keys, but change them to
1612         use WEB_UI_STRING_KEY instead.
1613
1614         Additionally, remove now-unused localizable strings for the text input view controller.
1615
1616         * English.lproj/Localizable.strings:
1617         * platform/LocalizedStrings.cpp:
1618         (WebCore::formControlDoneButtonTitle):
1619         (WebCore::datePickerDayLabelTitle):
1620         (WebCore::datePickerMonthLabelTitle):
1621         (WebCore::datePickerYearLabelTitle):
1622
1623 2018-03-23  Chris Dumez  <cdumez@apple.com>
1624
1625         NetworkStateNotifier::updateStateWithoutNotifying() is inefficient
1626         https://bugs.webkit.org/show_bug.cgi?id=183760
1627         <rdar://problem/37093299>
1628
1629         Reviewed by Ryosuke Niwa.
1630
1631         Update NetworkStateNotifier::updateStateWithoutNotifying() to stop calling
1632         SCDynamicStoreCopyKeyList(). SCDynamicStoreCopyKeyList() is expensive as it
1633         expects its key parameter to be a regular expression and it can match several
1634         keys. It is also unnecessary in our case since we already have an exact key.
1635         We now call the more efficient SCDynamicStoreCopyValue() instead, which is
1636         the right thing to call when we have an exact key.
1637
1638         This change was suggested by the SC team.
1639
1640         This was tested manually as there is no easy way to write an automated test
1641         for this.
1642
1643         In a follow-up, I also plan to call this code in the UIProcess (or NetworkProcess)
1644         to avoid calling it once per WebProcess.
1645
1646         * platform/network/mac/NetworkStateNotifierMac.cpp:
1647         (WebCore::NetworkStateNotifier::updateStateWithoutNotifying):
1648
1649 2018-03-23  Daniel Bates  <dabates@apple.com>
1650
1651         Unreviewed, rolling out r229868.
1652
1653         Caused media controls tests to timeout. Will investigate
1654         offline.
1655
1656         Reverted changeset:
1657
1658         "CSS mask images should be retrieved using potentially CORS-
1659         enabled fetch"
1660         https://bugs.webkit.org/show_bug.cgi?id=179983
1661         https://trac.webkit.org/changeset/229868
1662
1663 2018-03-23  Mark Lam  <mark.lam@apple.com>
1664
1665         Add pointer profiling hooks to the CSS JIT.
1666         https://bugs.webkit.org/show_bug.cgi?id=183947
1667         <rdar://problem/38803593>
1668
1669         Reviewed by JF Bastien.
1670
1671         No new tests needed.  Covered by existing tests.
1672
1673         * bindings/scripts/CodeGeneratorJS.pm:
1674         (GenerateImplementation):
1675         - Added a missing application of WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION().
1676
1677         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1678         (WebCore::toJSNewlyCreated):
1679         * bindings/scripts/test/JS/JSMapLike.cpp:
1680         (WebCore::toJSNewlyCreated):
1681         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1682         (WebCore::toJSNewlyCreated):
1683         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1684         (WebCore::toJSNewlyCreated):
1685         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1686         (WebCore::toJSNewlyCreated):
1687         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1688         (WebCore::toJSNewlyCreated):
1689         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1690         (WebCore::toJSNewlyCreated):
1691         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1692         (WebCore::toJSNewlyCreated):
1693         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1694         (WebCore::toJSNewlyCreated):
1695         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1696         (WebCore::toJSNewlyCreated):
1697         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1698         (WebCore::toJSNewlyCreated):
1699         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1700         (WebCore::toJSNewlyCreated):
1701         * bindings/scripts/test/JS/JSTestException.cpp:
1702         (WebCore::toJSNewlyCreated):
1703         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1704         (WebCore::toJSNewlyCreated):
1705         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1706         (WebCore::toJSNewlyCreated):
1707         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
1708         (WebCore::toJSNewlyCreated):
1709         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
1710         (WebCore::toJSNewlyCreated):
1711         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1712         (WebCore::toJSNewlyCreated):
1713         * bindings/scripts/test/JS/JSTestIterable.cpp:
1714         (WebCore::toJSNewlyCreated):
1715         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1716         (WebCore::toJSNewlyCreated):
1717         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
1718         (WebCore::toJSNewlyCreated):
1719         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
1720         (WebCore::toJSNewlyCreated):
1721         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1722         (WebCore::toJSNewlyCreated):
1723         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1724         (WebCore::toJSNewlyCreated):
1725         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1726         (WebCore::toJSNewlyCreated):
1727         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1728         (WebCore::toJSNewlyCreated):
1729         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1730         (WebCore::toJSNewlyCreated):
1731         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1732         (WebCore::toJSNewlyCreated):
1733         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
1734         (WebCore::toJSNewlyCreated):
1735         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
1736         (WebCore::toJSNewlyCreated):
1737         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1738         (WebCore::toJSNewlyCreated):
1739         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
1740         (WebCore::toJSNewlyCreated):
1741         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
1742         (WebCore::toJSNewlyCreated):
1743         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1744         (WebCore::toJSNewlyCreated):
1745         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1746         (WebCore::toJSNewlyCreated):
1747         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1748         (WebCore::toJSNewlyCreated):
1749         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
1750         (WebCore::toJSNewlyCreated):
1751         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1752         (WebCore::toJSNewlyCreated):
1753         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1754         (WebCore::toJSNewlyCreated):
1755         * bindings/scripts/test/JS/JSTestNode.cpp:
1756         (WebCore::toJSNewlyCreated):
1757         * bindings/scripts/test/JS/JSTestObj.cpp:
1758         (WebCore::toJSNewlyCreated):
1759         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1760         (WebCore::toJSNewlyCreated):
1761         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1762         (WebCore::toJSNewlyCreated):
1763         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1764         (WebCore::toJSNewlyCreated):
1765         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
1766         (WebCore::toJSNewlyCreated):
1767         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1768         (WebCore::toJSNewlyCreated):
1769         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1770         (WebCore::toJSNewlyCreated):
1771         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1772         (WebCore::toJSNewlyCreated):
1773         * bindings/scripts/test/JS/JSTestStringifier.cpp:
1774         (WebCore::toJSNewlyCreated):
1775         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1776         (WebCore::toJSNewlyCreated):
1777         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1778         (WebCore::toJSNewlyCreated):
1779         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1780         (WebCore::toJSNewlyCreated):
1781         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1782         (WebCore::toJSNewlyCreated):
1783         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1784         (WebCore::toJSNewlyCreated):
1785         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1786         (WebCore::toJSNewlyCreated):
1787         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1788         (WebCore::toJSNewlyCreated):
1789         * css/ElementRuleCollector.cpp:
1790         (WebCore::ElementRuleCollector::ruleMatches):
1791         * cssjit/SelectorCompiler.cpp:
1792         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
1793         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
1794         * cssjit/SelectorCompiler.h:
1795         (WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
1796         (WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
1797         (WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
1798         (WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
1799         * dom/SelectorQuery.cpp:
1800         (WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData const):
1801         (WebCore::SelectorDataList::execute const):
1802
1803 2018-03-23  Sihui Liu  <sihui_liu@apple.com>
1804
1805         Local storage getItem() for an empty string returned UNDEFINED value.
1806         https://bugs.webkit.org/show_bug.cgi?id=69138
1807         <rdar://problem/13410974>
1808
1809         Reviewed by Brady Eidson.
1810
1811         * platform/sql/SQLiteStatement.cpp:
1812         (WebCore::SQLiteStatement::getColumnBlobAsString):
1813
1814 2018-03-23  Chris Dumez  <cdumez@apple.com>
1815
1816         Promptly terminate service worker processes when they are no longer needed
1817         https://bugs.webkit.org/show_bug.cgi?id=183873
1818         <rdar://problem/38676995>
1819
1820         Reviewed by Youenn Fablet.
1821
1822         The StorageProcess now keeps track of service worker clients for each security
1823         origin. When there is no longer any clients for a given security origin, the
1824         StorageProcess asks the service worker process for the given origin to terminate
1825         and severs its connection to it.
1826
1827         Change is covered by API test.
1828
1829         * workers/service/server/SWServer.cpp:
1830         (WebCore::SWServer::markAllWorkersForOriginAsTerminated):
1831         Pass the security origin since this is called when a service worker process
1832         crashes. When a service worker process for origin A crashes, we only want
1833         to mark service workers in origin A as terminated, not ALL of them.
1834
1835         (WebCore::SWServer::registerServiceWorkerClient):
1836         (WebCore::SWServer::unregisterServiceWorkerClient):
1837         (WebCore::SWServer::needsServerToContextConnectionForOrigin const):
1838         Tweak logic so that we only relaunch a service worker process if we still
1839         have clients for its security origin.
1840
1841         * workers/service/server/SWServer.h:
1842         (WebCore::SWServer::disableServiceWorkerProcessTerminationDelay):
1843         Add a way to disable the service worker termination delay to facilitate
1844         testing.
1845
1846         * workers/service/server/SWServerToContextConnection.h:
1847
1848 2018-03-23  Brady Eidson  <beidson@apple.com>
1849
1850         Go to back/forward list items after a process-swapped navigation.
1851         <rdar://problem/38690544> and https://bugs.webkit.org/show_bug.cgi?id=183920
1852
1853         Reviewed by Andy Estes.
1854
1855         Covered by new API test.
1856
1857         Most of the changes to WebCore are teaching HistoryItem navigations to know when they should
1858         do a policy check or not.
1859
1860         * WebCore.xcodeproj/project.pbxproj:
1861
1862         * history/BackForwardController.cpp:
1863         (WebCore::BackForwardController::goBackOrForward):
1864         (WebCore::BackForwardController::goBack):
1865         (WebCore::BackForwardController::goForward):
1866
1867         * history/HistoryItem.cpp:
1868         (WebCore::HistoryItem::setStateObject): Actually push state object changes to the UIProcess.
1869           This was a long standing bug that made it difficult to effectively test this change.
1870
1871         * loader/FrameLoader.cpp:
1872         (WebCore::FrameLoader::loadURLIntoChildFrame):
1873         (WebCore::FrameLoader::loadDifferentDocumentItem):
1874         (WebCore::FrameLoader::loadItem):
1875         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
1876         * loader/FrameLoader.h:
1877         * loader/FrameLoaderTypes.h:
1878
1879         * loader/HistoryController.cpp:
1880         (WebCore::HistoryController::goToItem):
1881         (WebCore::HistoryController::setDefersLoading):
1882         (WebCore::HistoryController::recursiveGoToItem):
1883         * loader/HistoryController.h:
1884
1885         * loader/NavigationPolicyCheck.h:
1886
1887         * page/Page.cpp:
1888         (WebCore::Page::goToItem):
1889         * page/Page.h:
1890
1891 2018-03-23  John Wilander  <wilander@apple.com>
1892
1893         Resource Load Statistics: Fix decoder key isPrevalentResource->isVeryPrevalentResource
1894         https://bugs.webkit.org/show_bug.cgi?id=183950
1895         <rdar://problem/38806275>
1896
1897         Reviewed by Brent Fulgham.
1898
1899         * loader/ResourceLoadStatistics.cpp:
1900         (WebCore::ResourceLoadStatistics::decode):
1901             Now isVeryPrevalentResource is decoded to the correct field.
1902
1903 2018-03-23  Youenn Fablet  <youenn@apple.com>
1904
1905         WebProcessPool should not ask to register all clients for each service worker process creation
1906         https://bugs.webkit.org/show_bug.cgi?id=183941
1907
1908         Reviewed by Chris Dumez.
1909
1910         Covered by existing unit tests.
1911         Register all Documents of a process no matter its session ID when asked to.
1912         Make sure that whenever a WebProcess is asked to do so, any further Document will be registered
1913         by calling setMayHaveRegisteredServiceWorkers().
1914         This ensures that a WebProcess created before any service worker but empty at the time a service worker is created
1915         will actually register all its future clients.
1916
1917         Add some assertions to ensure that a client is not registered twice.
1918
1919         * workers/service/ServiceWorkerProvider.cpp:
1920         (WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
1921         * workers/service/ServiceWorkerProvider.h:
1922         * workers/service/server/SWServer.cpp:
1923         (WebCore::SWServer::registerServiceWorkerClient):
1924
1925 2018-03-23  Eric Carlson  <eric.carlson@apple.com>
1926
1927         HTMLElement factory doesn't need to call MediaPlayer::isAvailable
1928         https://bugs.webkit.org/show_bug.cgi?id=183946
1929         <rdar://problem/38802687>
1930
1931         Reviewed by Youenn Fablet.
1932
1933         Test: media/media-disabled.html
1934
1935         * dom/make_names.pl:
1936         (printConstructorInterior):
1937         * page/Settings.yaml:
1938         * page/SettingsDefaultValues.h:
1939
1940 2018-03-23  David Kilzer  <ddkilzer@apple.com>
1941
1942         Stop using dispatch_set_target_queue()
1943         <https://webkit.org/b/183908>
1944         <rdar://problem/33553533>
1945
1946         Reviewed by Daniel Bates.
1947
1948         No new tests since no change in behavior.
1949
1950         * platform/mediastream/mac/AVMediaCaptureSource.mm:
1951         (WebCore::globaVideoCaptureSerialQueue): Remove use of
1952         dispatch_set_target_queue() by changing dispatch_queue_create()
1953         to dispatch_queue_create_with_target().
1954
1955 2018-03-23  Youenn Fablet  <youenn@apple.com>
1956
1957         Use libwebrtc ObjectiveC H264 encoder and decoder
1958         https://bugs.webkit.org/show_bug.cgi?id=183912
1959
1960         Reviewed by Eric Carlson.
1961
1962         No observable change of behavior.
1963         Made use of libwebrtc WebKit utilities.
1964         Updated RealtimeINcomingVideoSourceCocoa as it now receives ObjcVideoFrame.
1965
1966         * Configurations/WebCore.xcconfig:
1967         * SourcesCocoa.txt:
1968         * WebCore.xcodeproj/project.pbxproj:
1969         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
1970         (WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
1971         (WebCore::LibWebRTCProviderCocoa::setH264HardwareEncoderAllowed):
1972         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
1973         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
1974         (WebCore::LibWebRTCProviderCocoa::setActive):
1975         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
1976         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: Renamed from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp.
1977         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
1978         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
1979         * testing/Internals.cpp: Removed commented out include.
1980
1981 2018-03-23  Youenn Fablet  <youenn@apple.com>
1982
1983         DocumentThreadableLoader should send credentials after redirections and preflight if fetch option credentials is include
1984         https://bugs.webkit.org/show_bug.cgi?id=183928
1985
1986         Reviewed by Chris Dumez.
1987
1988         Tests: imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.html
1989                imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.worker.html
1990
1991         In case mode is include, keep sending credentials even after redirection with preflight.
1992
1993         * loader/DocumentThreadableLoader.cpp:
1994         (WebCore::DocumentThreadableLoader::redirectReceived):
1995
1996 2018-03-23  Tim Horton  <timothy_horton@apple.com>
1997
1998         Fix the build after r229858
1999
2000         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2001
2002 2018-03-23  Youenn Fablet  <youenn@apple.com>
2003
2004         Allow fully whitelisted plug-ins to match non HTTP URLs
2005         https://bugs.webkit.org/show_bug.cgi?id=183938
2006         rdar://problem/38534312
2007
2008         Reviewed by Chris Dumez.
2009
2010         Covered by manual testing and unit testing.
2011
2012         * platform/URL.cpp:
2013         (WebCore::URL::isMatchingDomain const):
2014
2015 2018-03-23  Youenn Fablet  <youenn@apple.com>
2016
2017         ActiveDOMObject should assert that they are destroyed in the thread they are created
2018         https://bugs.webkit.org/show_bug.cgi?id=183671
2019
2020         Reviewed by Chris Dumez.
2021
2022         No change of behavior.
2023         Moved MessagePort assertion to ActiveDOMObject.
2024
2025         * dom/ActiveDOMObject.cpp:
2026         (WebCore::ActiveDOMObject::~ActiveDOMObject):
2027         * dom/ActiveDOMObject.h:
2028         * dom/MessagePort.cpp:
2029         (WebCore::MessagePort::~MessagePort):
2030         * dom/MessagePort.h:
2031
2032 2018-03-23  Youenn Fablet  <youenn@apple.com>
2033
2034         Safari WebKitWebRTCAudioModule crash during <video> tag update when audio track present in MediaStream
2035         https://bugs.webkit.org/show_bug.cgi?id=181180
2036         <rdar://problem/36302375>
2037
2038         Reviewed by Eric Carlson.
2039
2040         Test: webrtc/video-update-often.html
2041
2042         AudioTrackPrivateMediaStreamCocoa needs to be destroyed in the main thread since it owns a Ref to its MediaStreamTrackPrivate.
2043         We can still ref it on a background thread but we always deref it on the main thread.
2044
2045         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
2046         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
2047         (WebCore::AudioTrackPrivateMediaStreamCocoa::render):
2048
2049 2018-03-23  Sergio Villar Senin  <svillar@igalia.com>
2050
2051         [css-grid] Fix auto repeat tracks computation with definite min sizes
2052         https://bugs.webkit.org/show_bug.cgi?id=183933
2053
2054         Reviewed by Javier Fernandez.
2055
2056         Indefinitely sized containers use the specified definite min-size (if any) as available
2057         space in order to compute the number of auto repeat tracks to create. A bug in that code was
2058         causing the grid to be one track larger than expected. That was only happening in the case
2059         of the free space being a multiple of the total size of the autorepeat tracks.
2060
2061         Test: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-auto-repeat-001.html
2062
2063         * rendering/RenderGrid.cpp:
2064         (WebCore::RenderGrid::computeAutoRepeatTracksCount const):
2065
2066 2018-03-23  Miguel Gomez  <magomez@igalia.com>
2067
2068         [GTK][WPE] Avoid software color conversion inside BitmapTextureGL
2069         https://bugs.webkit.org/show_bug.cgi?id=183892
2070
2071         Reviewed by Žan Doberšek.
2072
2073         Always use RGBA format on BitmapTextureGL (when no other format is specifically requested). When
2074         the texture is updated from BGRA content, use a flag to indicate the shader to perform a color
2075         conversion during the painting. This way we don't need to swap the R and B components on the CPU.
2076         Also, remove one of the lists in BitmapTexturePool as now all of them have the same format, and
2077         remove the UpdateContentsFlag as we never need to modify the original image data.
2078
2079         Covered by existent tests.
2080
2081         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2082         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
2083         * platform/graphics/texmap/BitmapTexture.cpp:
2084         (WebCore::BitmapTexture::updateContents):
2085         * platform/graphics/texmap/BitmapTexture.h:
2086         * platform/graphics/texmap/BitmapTextureGL.cpp:
2087         (WebCore::BitmapTextureGL::BitmapTextureGL):
2088         (WebCore::BitmapTextureGL::didReset):
2089         (WebCore::BitmapTextureGL::updateContents):
2090         (WebCore::BitmapTextureGL::applyFilters):
2091         (WebCore::swizzleBGRAToRGBA): Deleted.
2092         (WebCore::BitmapTextureGL::updateContentsNoSwizzle): Deleted.
2093         * platform/graphics/texmap/BitmapTextureGL.h:
2094         (WebCore::BitmapTextureGL::colorConvertFlags const):
2095         * platform/graphics/texmap/BitmapTexturePool.cpp:
2096         (WebCore::BitmapTexturePool::acquireTexture):
2097         (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
2098         * platform/graphics/texmap/BitmapTexturePool.h:
2099         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2100         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
2101         * platform/graphics/texmap/TextureMapperContextAttributes.cpp:
2102         (WebCore::TextureMapperContextAttributes::get):
2103         * platform/graphics/texmap/TextureMapperContextAttributes.h:
2104         * platform/graphics/texmap/TextureMapperGL.cpp:
2105         (WebCore::TextureMapperGL::drawNumber):
2106         (WebCore::TextureMapperGL::drawTexture):
2107         * platform/graphics/texmap/TextureMapperGL.h:
2108         * platform/graphics/texmap/TextureMapperLayer.cpp:
2109         (WebCore::TextureMapperLayer::paintIntoSurface):
2110         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
2111         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
2112         * platform/graphics/texmap/TextureMapperTile.cpp:
2113         (WebCore::TextureMapperTile::updateContents):
2114         * platform/graphics/texmap/TextureMapperTile.h:
2115         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
2116         (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
2117         (WebCore::TextureMapperTiledBackingStore::updateContents):
2118         * platform/graphics/texmap/TextureMapperTiledBackingStore.h:
2119
2120 2018-03-23  Yusuke Suzuki  <utatane.tea@gmail.com>
2121
2122         [WTF] Add standard containers with FastAllocator specialization
2123         https://bugs.webkit.org/show_bug.cgi?id=183789
2124
2125         Reviewed by Darin Adler.
2126
2127         * Modules/indexeddb/IDBKeyData.h:
2128         * Modules/mediasource/SampleMap.h:
2129         * Modules/mediasource/SourceBuffer.cpp:
2130         * Modules/webauthn/cbor/CBORValue.h:
2131         It did not use FastAllocator for its container.
2132
2133         * page/WheelEventTestTrigger.h:
2134         * platform/audio/PlatformMediaSessionManager.h:
2135         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
2136         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
2137         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2138         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2139         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2140         (WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction):
2141         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2142         * platform/wpe/PlatformPasteboardWPE.cpp:
2143         * rendering/OrderIterator.h:
2144
2145 2018-03-23  Antoine Quint  <graouts@apple.com>
2146
2147         [Web Animations] infinite repeat counts aren't reflected for CSS Animations
2148         https://bugs.webkit.org/show_bug.cgi?id=183932
2149
2150         Reviewed by Dean Jackson.
2151
2152         The "infinite" value for animation-repeat-count is reflected as a special value which resolves to -1. We need to check
2153         for this special value before setting the iterations count on the AnimationEffectTimingReadOnly object.
2154
2155         * animation/CSSAnimation.cpp:
2156         (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
2157
2158 2018-03-22  Antoine Quint  <graouts@apple.com>
2159
2160         [Web Animations] Correctly cancel animations when a parent gets a "display: none" style or when an element is removed
2161         https://bugs.webkit.org/show_bug.cgi?id=183919
2162
2163         Reviewed by Dean Jackson.
2164
2165         The old CSSAnimationController provided a cancelAnimations(Element&) method that allowed for animations for a given element
2166         to be canceled when a parent element in the hierarchy gets a "display: none" style or if an element with animations is removed.
2167         We add a similar cancelAnimationsForElement(Element&) method on AnimationTimeline and update CSSAnimationController::cancelAnimations()
2168         call sites to use AnimationTimeline::cancelAnimationsForElement() when the flag to use Web Animations is on.
2169
2170         * animation/AnimationTimeline.cpp:
2171         (WebCore::AnimationTimeline::cancelAnimationsForElement): Iterate over all animations for the provided element and call cancel() on them.
2172         * animation/AnimationTimeline.h:
2173         * animation/DocumentTimeline.cpp:
2174         (WebCore::DocumentTimeline::animatedStyleForRenderer): Drive-by fix while I was reviewed call sites to animationsForElement() to make
2175         sure we don't create extra RefPtr<> objects.
2176         * dom/Element.cpp:
2177         (WebCore::Element::removedFromAncestor): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on when an
2178         element is removed.
2179         * dom/PseudoElement.cpp:
2180         (WebCore::PseudoElement::clearHostElement): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on when
2181         a pseudo-element is removed.
2182         * rendering/updating/RenderTreeUpdater.cpp:
2183         (WebCore::RenderTreeUpdater::tearDownRenderers): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on
2184         for all children elements when an element gets a "display: none" style.
2185
2186 2018-03-23  Antoine Quint  <graouts@apple.com>
2187
2188         [Web Animations] Animated transform styles are ignored when calling getComputedStyle()
2189         https://bugs.webkit.org/show_bug.cgi?id=183918
2190
2191         Reviewed by Dean Jackson.
2192
2193         Strictly looking at whether the renderer has a transform is a bad idea when determining whether a
2194         transform is applied for an element. Looking at the RenderStyle is preferable because in the case
2195         of animations running on the compositor, such as a transform-only animation or transition, the
2196         renderer doesn't necessarily have a transform style on it, since we don't blend properties in
2197         software as the animation progresses. Instead, all of the blending is performed by the compositor,
2198         and only the computed style object has the software-blended transform style on it.
2199
2200         We do need to account for inline renderers though as these do not support transforms.
2201
2202         * css/CSSComputedStyleDeclaration.cpp:
2203         (WebCore::computedTransform):
2204
2205 2018-03-22  Antoine Quint  <graouts@apple.com>
2206
2207         [Web Animations] Support "transition: all" for CSS Transitions as Web Animations
2208         https://bugs.webkit.org/show_bug.cgi?id=183917
2209
2210         Reviewed by Dean Jackson.
2211
2212         We now support "transition: all" CSS Transitions by iterating over all known CSS properties should the mode
2213         of the backing animation be AnimateAll. Any property that we find to have a different value in the previous
2214         and current style will have a backing CSSTransition object created for it. To support this, we now explicitly
2215         provide a CSSPropertyID when creating a CSSTransition since we can no longer infer the transition property
2216         from the backing animation, as Animation objects with mode AnimateAll report CSSPropertyInvalid as their
2217         property.
2218
2219         * animation/AnimationTimeline.cpp:
2220         (WebCore::shouldBackingAnimationBeConsideredForCSSTransition): New method that checks whether a given backing
2221         Animation object is suitable for consideration as a CSSTransition, where the mode must not be either AnimateNone
2222         or AnimateUnknownProperty, and should the mode be AnimateSingleProperty, the property must not be CSSPropertyInvalid.
2223         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): We now assemble the list of previously animated
2224         properties by looking at the m_elementToCSSTransitionByCSSPropertyID map and getting its keys. Then we compile
2225         all backing Animation objects found in the old style that match the conditions enforced by the new method
2226         shouldBackingAnimationBeConsideredForCSSTransition(). Then as we iterate over backing Animation objects found
2227         in the new style, we iterate over all known CSS properties if the mode is AnimateAll, indicating that we're dealing
2228         with a "transition: all" style. If we're dealing with a single property, we only process that single property.
2229         * animation/CSSTransition.cpp:
2230         (WebCore::CSSTransition::create): Expect a new CSSPropertyID parameter when creating a new CSSTransition since
2231         we can no longer infer it from the backing Animation object.
2232         (WebCore::CSSTransition::CSSTransition): Expect a new CSSPropertyID parameter when creating a new CSSTransition
2233         since we can no longer infer it from the backing Animation object.
2234         (WebCore::CSSTransition::matchesBackingAnimationAndStyles const): We can no longer use the == overloaded operator
2235         for backing Animation objects to determine whether their respective properties match since this would compare the
2236         "property" member of both Animation objects and when going from a "transition: all" style to one targeting a single
2237         property, we would falsely identify mis-matching Animation objects. Instead, we pass a false flag to animationsMatch()
2238         which indicates that we don't care about matching the transition property itself.
2239         * animation/CSSTransition.h: Expose a new property() accessor which returns the CSSPropertyID passed at construction.
2240         * animation/KeyframeEffectReadOnly.cpp:
2241         (WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes): Use the new property() accessor on
2242         CSSTransition to get at the transition property.
2243         * platform/animation/Animation.cpp:
2244         (WebCore::Animation::animationsMatch const): Replace the boolean parameter, which was not in use in WebCore, to indicate
2245         whether we should match the property-related fields. We need this in CSSTransition::matchesBackingAnimationAndStyles().
2246         * platform/animation/Animation.h:
2247
2248 2018-03-22  Tim Horton  <timothy_horton@apple.com>
2249
2250         Adopt WK_ALTERNATE_FRAMEWORKS_DIR in WebCore
2251         https://bugs.webkit.org/show_bug.cgi?id=183930
2252         <rdar://problem/38782249>
2253
2254         Reviewed by Dan Bernstein.
2255
2256         * Configurations/Base.xcconfig:
2257         * Configurations/WebCore.xcconfig:
2258         * Configurations/WebCoreTestSupport.xcconfig:
2259
2260 2018-03-22  Commit Queue  <commit-queue@webkit.org>
2261
2262         Unreviewed, rolling out r229876.
2263         https://bugs.webkit.org/show_bug.cgi?id=183929
2264
2265         Some webrtc tests are timing out on iOS simulator (Requested
2266         by youenn on #webkit).
2267
2268         Reverted changeset:
2269
2270         "Use libwebrtc ObjectiveC H264 encoder and decoder"
2271         https://bugs.webkit.org/show_bug.cgi?id=183912
2272         https://trac.webkit.org/changeset/229876
2273
2274 2018-03-22  Megan Gardner  <megan_gardner@apple.com>
2275
2276         Expose more system colors via CSS
2277         https://bugs.webkit.org/show_bug.cgi?id=183764
2278         <rdar://problem/36975898>
2279
2280         Reviewed by Tim Horton.
2281
2282         Test: fast/css/apple-system-control-colors.html
2283
2284         Expose Apple specific system colors via CSS.
2285
2286         * rendering/RenderThemeMac.mm:
2287         (WebCore::RenderThemeMac::systemColor const):
2288
2289 2018-03-22  Nan Wang  <n_wang@apple.com>
2290
2291         AX: Web table row count is incorrect when role row is added to <tr> in DOM
2292         https://bugs.webkit.org/show_bug.cgi?id=183922
2293
2294         Reviewed by Chris Fleizach.
2295
2296         Although the parent table for an ARIA grid row should be an ARIA table, we
2297         should return the native table if the row is native <tr>.
2298
2299         Test: accessibility/row-with-aria-role-in-native-table.html
2300
2301         * accessibility/AccessibilityARIAGridRow.cpp:
2302         (WebCore::AccessibilityARIAGridRow::parentTable const):
2303
2304 2018-03-22  Chris Dumez  <cdumez@apple.com>
2305
2306         Include security origin in the service worker process name
2307         https://bugs.webkit.org/show_bug.cgi?id=183913
2308
2309         Reviewed by Youenn Fablet.
2310
2311         Updated localizable strings.
2312
2313         * English.lproj/Localizable.strings:
2314
2315 2018-03-22  Youenn Fablet  <youenn@apple.com>
2316
2317         Use libwebrtc ObjectiveC H264 encoder and decoder
2318         https://bugs.webkit.org/show_bug.cgi?id=183912
2319
2320         Reviewed by Eric Carlson.
2321
2322         No observable change of behavior.
2323         Made use of libwebrtc WebKit utilities.
2324         Updated RealtimeINcomingVideoSourceCocoa as it now receives ObjcVideoFrame.
2325
2326         * Configurations/WebCore.xcconfig:
2327         * SourcesCocoa.txt:
2328         * WebCore.xcodeproj/project.pbxproj:
2329         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
2330         (WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
2331         (WebCore::LibWebRTCProviderCocoa::setH264HardwareEncoderAllowed):
2332         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
2333         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
2334         (WebCore::LibWebRTCProviderCocoa::setActive):
2335         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
2336         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: Renamed from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp.
2337         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
2338         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
2339         * testing/Internals.cpp: Removed commented out include.
2340
2341 2018-03-22  Michael Catanzaro  <mcatanzaro@gnome.org>
2342
2343         Unreviewed, fix format string warnings in service worker code
2344
2345         On Linux x86_64, uint64_t is unsigned long, not unsigned long long.
2346
2347         * workers/service/ServiceWorkerContainer.cpp:
2348         (WebCore::ServiceWorkerContainer::addRegistration):
2349         (WebCore::ServiceWorkerContainer::removeRegistration):
2350         (WebCore::ServiceWorkerContainer::updateRegistration):
2351         (WebCore::ServiceWorkerContainer::jobFailedWithException):
2352         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
2353         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
2354         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
2355         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
2356         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
2357
2358 2018-03-22  Daniel Bates  <dabates@apple.com>
2359
2360         Expose SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() as WebKit SPI
2361         https://bugs.webkit.org/show_bug.cgi?id=183907
2362         <rdar://problem/38759127>
2363
2364         Reviewed by Alex Christensen.
2365
2366         Exports SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() so that we can use it from WebKit.
2367
2368         * platform/SchemeRegistry.h:
2369
2370 2018-03-22  Daniel Bates  <dabates@apple.com>
2371
2372         CSS mask images should be retrieved using potentially CORS-enabled fetch
2373         https://bugs.webkit.org/show_bug.cgi?id=179983
2374         <rdar://problem/35678149>
2375
2376         Reviewed by Brent Fulgham.
2377
2378         As per <https://drafts.fxtf.org/css-masking-1/#priv-sec> (Editor's Draft, 23 December 2017)
2379         we should fetch CSS mask images using a potentially CORS-enabled fetch.
2380
2381         Both cross-origin CSS shape-outside images and CSS mask images may be sensitive to timing
2382         attacks that can be used to reveal their pixel data when retrieved without regard to CORS.
2383         For the same reason that we fetch CSS shape-outside images using a potentially CORS-enabled
2384         fetch we should fetch CSS mask the same way. This also makes the behavior of WebKit more
2385         closely align with the behavior in the spec.
2386
2387         Test: http/tests/security/css-mask-image.html
2388
2389         * style/StylePendingResources.cpp: Substitute LoadPolicy::NoCORS and LoadPolicy::Anonymous for
2390         LoadPolicy::Normal and LoadPolicy::ShapeOutside, respectively, to match the terminology used
2391         in the HTML, CSS Shapes Module Level 1, and CSS Masking Module Level 1 specs.
2392         (WebCore::Style::loadPendingImage): Ditto.
2393         (WebCore::Style::loadPendingResources): Use load policy LoadPolicy::Anonymous when fetching
2394         a mask image or shape-outside image.
2395
2396 2018-03-22  Zalan Bujtas  <zalan@apple.com>
2397
2398         [Simple line layout] Text with letter spacing is not positioned properly.
2399         https://bugs.webkit.org/show_bug.cgi?id=183079
2400         <rdar://problem/38762569>
2401
2402         Reviewed by Antti Koivisto.
2403
2404         We need to recompute RenderText::m_canUseSimplifiedTextMeasuring when the font cascade changes
2405         since we might not be able to use the fast path anymore.
2406
2407         Test: fast/text/simple-line-layout-dynamic-letter-word-spacing.html
2408
2409         * rendering/RenderText.cpp:
2410         (WebCore::RenderText::styleDidChange):
2411
2412 2018-03-21  Antoine Quint  <graouts@apple.com>
2413
2414         [Web Animations] Make imported/mozilla/css-animations/test_event-dispatch.html pass reliably
2415         https://bugs.webkit.org/show_bug.cgi?id=183845
2416
2417         Reviewed by Dean Jackson.
2418
2419         Finish the work to get DOM events for CSS Animations and CSS Transitions dispatching as specified.
2420
2421         * animation/AnimationEffectReadOnly.cpp: Move timeEpsilon to be shared as part of WebAnimationUtilities.h since we now need it in
2422         WebAnimation::timeToNextRequiredTick().
2423         * animation/AnimationTimeline.cpp:
2424         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): We add a pre-emptive return clause when we know that the AnimationList
2425         for previous and current styles are a match.
2426         * animation/CSSTransition.cpp:
2427         (WebCore::CSSTransition::matchesBackingAnimationAndStyles const): Ensure we have a valid effect before downcasting it.
2428         * animation/DeclarativeAnimation.cpp:
2429         (WebCore::DeclarativeAnimation::initialize): We need to call pause() for declarative animations that aren't playing so that the animation's
2430         playState is set correctly and the animation is not idle.
2431         * animation/DocumentTimeline.cpp:
2432         (WebCore::DocumentTimeline::updateAnimationSchedule): We no longer need to pass the current time to timeToNextRequiredTick() since the method has
2433         been reworked to use the animation's current time, which is based on the timeline's current time.
2434         (WebCore::DocumentTimeline::updateAnimations): Avoid creating a copy when iterating over pending hardware animations.
2435         * animation/KeyframeEffectReadOnly.cpp:
2436         (WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): We should never generate new blending keyframes if the
2437         old and new styles contain the same value, since there would be no transition between two equal values, and we should only look at whether the new
2438         style value and the recorded target value differ to determine if new blending keyframes are necessary.
2439         * animation/WebAnimation.cpp:
2440         (WebCore::WebAnimation::timeToNextRequiredTick const): We correct our scheduling code which was shown to be broken in several of the newly-imported
2441         Mozilla tests. Any running animation is now scheduled to invalidate again on the next tick, and we use timeEpsilon from WebAnimationUtilities.h to
2442         correctly check if we're right at the active threshold, when we also invalidate on the next tick. If our current time is negative, in other words
2443         when the animation has not yet started, we schedule this animation's next tick to be the negative of that value. In all other cases, no invalidation
2444         needs to be scheduled.
2445         * animation/WebAnimation.h: We move updateFinishedState() to private since this method is not actually used outside of WebAnimation.cpp.
2446         * animation/WebAnimationUtilities.h: Move timeEpsilon to be shared as part of WebAnimationUtilities.h.
2447
2448 2018-03-22  Tim Horton  <timothy_horton@apple.com>
2449
2450         Improve readability of WebCore's OTHER_LDFLAGS
2451         https://bugs.webkit.org/show_bug.cgi?id=183909
2452         <rdar://problem/38760992>
2453
2454         Reviewed by Dan Bernstein.
2455
2456         * Configurations/Base.xcconfig:
2457         * Configurations/FeatureDefines.xcconfig:
2458         * Configurations/WebCore.xcconfig:
2459
2460 2018-03-22  Tim Horton  <timothy_horton@apple.com>
2461
2462         Adopt USE(OPENGL[_ES]) in more places
2463         https://bugs.webkit.org/show_bug.cgi?id=183882
2464         <rdar://problem/37912195>
2465
2466         Reviewed by Dan Bernstein.
2467
2468         * platform/graphics/GraphicsContext3D.h:
2469         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2470         (WebCore::hasMuxableGPU):
2471         (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
2472         (WebCore::GraphicsContext3D::GraphicsContext3D):
2473         (WebCore::GraphicsContext3D::~GraphicsContext3D):
2474         (WebCore::GraphicsContext3D::makeContextCurrent):
2475         (WebCore::GraphicsContext3D::checkGPUStatus):
2476         (WebCore::GraphicsContext3D::texImageIOSurface2D):
2477         * platform/graphics/cocoa/WebGLLayer.h:
2478         * platform/graphics/cocoa/WebGLLayer.mm:
2479         (-[WebGLLayer initWithGraphicsContext3D:]):
2480         (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
2481         (-[WebGLLayer display]):
2482         * platform/graphics/ios/GraphicsContext3DIOS.h:
2483         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
2484         (WebCore::Extensions3DOpenGL::blitFramebuffer):
2485         (WebCore::Extensions3DOpenGL::createVertexArrayOES):
2486         (WebCore::Extensions3DOpenGL::deleteVertexArrayOES):
2487         (WebCore::Extensions3DOpenGL::isVertexArrayOES):
2488         (WebCore::Extensions3DOpenGL::bindVertexArrayOES):
2489         * platform/graphics/opengl/Extensions3DOpenGL.h:
2490         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
2491         (WebCore::GraphicsContext3D::reshapeFBOs):
2492         (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
2493         (WebCore::GraphicsContext3D::renderbufferStorage):
2494         (WebCore::GraphicsContext3D::getIntegerv):
2495         (WebCore::GraphicsContext3D::texImage2D):
2496         (WebCore::GraphicsContext3D::depthRange):
2497         (WebCore::GraphicsContext3D::clearDepth):
2498         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2499         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
2500         Make it a bit more clear which code is platform-dependent and which code is GL/GLES-dependent.
2501
2502 2018-03-22  Zan Dobersek  <zdobersek@igalia.com>
2503
2504         [TexMap] Make TextureMapperContextAttributes thread-specific
2505         https://bugs.webkit.org/show_bug.cgi?id=183895
2506
2507         Reviewed by Carlos Garcia Campos.
2508
2509         Store the TextureMapperContextAttributes in a thread-specific manner.
2510         The TextureMapperContextAttributes::get() method is now used to retrieve
2511         a reference to that thread-specific object. If it's not been initialized
2512         yet, then the current GL context is used for the initialization, as it
2513         used to be done in the now-removed initialize() method.
2514
2515         TextureMapperPlatformLayerBuffer::clone() method now doesn't need to
2516         be passed a TextureMapperGL object, since the texture can be created
2517         directly by calling BitmapTextureGL::create(), passing the
2518         TextureMapperContextAttributes object that's retrieved from the
2519         thread-specific storage. This further simplifies the
2520         TextureMapperPlatformLayerProxy::Compositor interface, removing the
2521         texmapGL() getter from it.
2522
2523         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2524         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
2525         * platform/graphics/texmap/TextureMapperContextAttributes.cpp:
2526         (WebCore::threadSpecificAttributes):
2527         (WebCore::TextureMapperContextAttributes::get):
2528         (WebCore::TextureMapperContextAttributes::initialize): Deleted.
2529         * platform/graphics/texmap/TextureMapperContextAttributes.h:
2530         * platform/graphics/texmap/TextureMapperGL.cpp:
2531         (WebCore::TextureMapperGL::TextureMapperGL):
2532         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
2533         (WebCore::TextureMapperPlatformLayerBuffer::clone):
2534         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
2535         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
2536         (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
2537         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
2538
2539 2018-03-22  Zalan Bujtas  <zalan@apple.com>
2540
2541         SVG root is skipped while marking percentage height descendants dirty.
2542         https://bugs.webkit.org/show_bug.cgi?id=183877
2543
2544         Reviewed by Antti Koivisto.
2545
2546         Calling continingBlock() to get to the correct container works as long as the ancestor inline element
2547         renderers are wrapped in anonymous blocks (continuation for example).
2548
2549         While the SVG root renderer is an inline renderer, it is not wrapped or normalized in any way,
2550         so containingBlock() will elegantly skip it and return an SVG root ancestor.
2551         dirtyForLayoutFromPercentageHeightDescendants calls containingBlock() to walk up
2552         on the ancestor chain to mark elements dirty. This fails when there's an SVG subtree in the block chain.
2553         This patch marks the SVG subtree chain dirty to ensure that layout will get to all the dirty leaf renderers 
2554         (note that the SVG subtree is supposed to have only statically positioned elements so parent == containing block).
2555
2556         Covered by existing tests.
2557
2558         * rendering/RenderBlock.cpp:
2559         (WebCore::RenderBlock::dirtyForLayoutFromPercentageHeightDescendants):
2560
2561 2018-03-22  Adrian Perez de Castro  <aperez@igalia.com>
2562
2563         [WPE][GTK] Build failure when ENABLE_VIDEO, ENABLE_WEB_AUDIO and ENABLE_XSLT are disabled
2564         https://bugs.webkit.org/show_bug.cgi?id=183896
2565
2566         Reviewed by Yusuke Suzuki.
2567
2568         No new tests needed.
2569
2570         * bindings/js/JSWebAnimationCustom.cpp: Add missing #include of Document.h
2571
2572 2018-03-21  Chris Dumez  <cdumez@apple.com>
2573
2574         Regression(r229828): WebKit.NoHistoryItemScrollToFragment API test is failing on iOS
2575         https://bugs.webkit.org/show_bug.cgi?id=183886
2576
2577         Reviewed by Wenson Hsieh.
2578
2579         Since r229828, the FrameLoader needs to call FrameLoaderClient::didDecidePolicyForNavigationAction()
2580         whenever a navigation policy decision is made. I added such a call r229828 to
2581         FrameLoader::continueLoadAfterNavigationPolicy() but forgot to add one to
2582         FrameLoader::continueFragmentScrollAfterNavigationPolicy(), which is the equivalent
2583         for fragment navigations.
2584
2585         * loader/FrameLoader.cpp:
2586         (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
2587
2588 2018-03-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
2589
2590         Disconnect the SVGPathSegList items from their SVGPathElement before rebuilding a new list
2591         https://bugs.webkit.org/show_bug.cgi?id=183723
2592         <rdar://problem/38517871>
2593
2594         Reviewed by Daniel Bates.
2595
2596         When setting the "d" attribute directly on a path, we rebuild the list
2597         of path segments held for creating the property tear off. The old path
2598         segments need to get disconnected from the path element. We already do 
2599         that when a path segment is replaced or removed.
2600
2601         Test: svg/dom/reuse-pathseg-after-changing-d.html
2602
2603         * svg/SVGPathElement.cpp:
2604         (WebCore::SVGPathElement::svgAttributeChanged):
2605         * svg/SVGPathSegList.cpp:
2606         (WebCore::SVGPathSegList::clear): SVGPathSegListValues::clearContextAndRoles()
2607         will now be called from SVGPathSegListValues::clear() via SVGListProperty::clearValues().
2608         (WebCore::SVGPathSegList::replaceItem):
2609         (WebCore::SVGPathSegList::removeItem):
2610         (WebCore::SVGPathSegList::clearContextAndRoles): Deleted.
2611         * svg/SVGPathSegList.h: SVGPathSegListValues::clearContextAndRoles() will
2612         now be called from SVGPathSegListValues::clear() via SVGListProperty::initializeValues().
2613         * svg/SVGPathSegListValues.cpp:
2614         (WebCore::SVGPathSegListValues::clearItemContextAndRole):
2615         (WebCore::SVGPathSegListValues::clearContextAndRoles):
2616         * svg/SVGPathSegListValues.h:
2617         (WebCore::SVGPathSegListValues::operator=):
2618         (WebCore::SVGPathSegListValues::clear):
2619
2620 2018-03-21  Antoine Quint  <graouts@apple.com>
2621
2622         [Web Animations] Ensure animationcancel and transitioncancel events are dispatched
2623         https://bugs.webkit.org/show_bug.cgi?id=183864
2624
2625         Reviewed by Dean Jackson.
2626
2627         In order to correctly dispatch animationcancel and transitioncancel events, we must call cancel() on CSSAnimation and CSSTransitions
2628         objects that are removed while in a play or pause phase. Additionally, we cancel declarative animations that are moving from a valid
2629         to a null timeline. Finally, when cancel() is called on a declarative animation, we record the timestamp and manually call
2630         invalidateDOMEvents() passing that timestamp in to ensure that the right phase change is recorded and results in the queuing of
2631         animationcancel and transitioncancel events.
2632
2633         * animation/AnimationTimeline.cpp:
2634         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Make sure we cancel all recorded CSS Animations when we newly get a
2635         "display: none" style. We also call the new cancelOrRemoveDeclarativeAnimation() method, instead of removing animations outright,
2636         for all animations that previously existed but are no longer listed in the current style.
2637         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Like in updateCSSAnimationsForElement(), we cancel all recorded CSS
2638         Transitions when we newly get a "display: none" style. We now use the refactored removeDeclarativeAnimation() method to remove an
2639         a transition for a property that was already transitioned in the previous style but has a new backing Animation object. Finally,
2640         like in updateCSSAnimationsForElement(), we call the new cancelOrRemoveDeclarativeAnimation() method, instead of removing transitions
2641         outright, for all transitions that previously existed but are no longer listed in the current style.
2642         (WebCore::AnimationTimeline::removeDeclarativeAnimation): Refactor code into this new method to remove a declarative animation.
2643         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): Cancels a DeclarativeAnimation if it's active or removes it right away.
2644         * animation/AnimationTimeline.h:
2645         * animation/DeclarativeAnimation.cpp:
2646         (WebCore::DeclarativeAnimation::setTimeline): If we're moving from a valid timeline to a null timeline, call cancel() on this animation
2647         such that an animationcancel or transitioncancel event can be dispatched.
2648         (WebCore::DeclarativeAnimation::cancel): Cancelations require the computation of the time at which a declarative animation was canceled,
2649         so we record the animation's active time as it's canceled and manually call invalidateDOMEvents() with that time after the general cancel()
2650         code has run.
2651         (WebCore::DeclarativeAnimation::invalidateDOMEvents): Accept an explicit timestamp for cancel events.
2652         * animation/DeclarativeAnimation.h:
2653         * animation/WebAnimation.h:
2654
2655 2018-03-21  Chris Dumez  <cdumez@apple.com>
2656
2657         ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash API test is failing with async delegates
2658         https://bugs.webkit.org/show_bug.cgi?id=183787
2659
2660         Reviewed by Wenson Hsieh.
2661
2662         * loader/FrameLoader.cpp:
2663         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2664         * loader/FrameLoaderClient.h:
2665
2666 2018-03-21  Eric Carlson  <eric.carlson@apple.com>
2667
2668         Clean up platform VideoFullscreenLayerManager
2669         https://bugs.webkit.org/show_bug.cgi?id=183859
2670         <rdar://problem/38715419>
2671
2672         Reviewed by Jer Noble.
2673
2674         No new tests, no functional change.
2675
2676         * WebCore.xcodeproj/project.pbxproj:
2677         * platform/graphics/VideoFullscreenLayerManager.h: Copied from Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h.
2678         (WebCore::VideoFullscreenLayerManager::~VideoFullscreenLayerManager):
2679         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2680         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2681         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
2682         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
2683         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):
2684         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer const):
2685         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
2686         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame):
2687         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity):
2688         (WebCore::MediaPlayerPrivateAVFoundationObjC::requiresTextTrackRepresentation const):
2689         (WebCore::MediaPlayerPrivateAVFoundationObjC::syncTextTrackBounds):
2690         (WebCore::MediaPlayerPrivateAVFoundationObjC::setTextTrackRepresentation):
2691         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2692         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2693         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
2694         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::platformLayer const):
2695         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
2696         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::destroyLayer):
2697         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer):
2698         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenFrame):
2699         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::requiresTextTrackRepresentation const):
2700         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::syncTextTrackBounds):
2701         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setTextTrackRepresentation):
2702         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
2703         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2704         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
2705         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
2706         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers):
2707         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer const):
2708         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer):
2709         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenFrame):
2710         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.h: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h.
2711         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm.
2712         (-[WebVideoContainerLayer setBounds:]):
2713         (-[WebVideoContainerLayer setPosition:]):
2714         (WebCore::VideoFullscreenLayerManagerObjC::VideoFullscreenLayerManagerObjC):
2715         (WebCore::VideoFullscreenLayerManagerObjC::setVideoLayer):
2716         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
2717         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenFrame):
2718         (WebCore::VideoFullscreenLayerManagerObjC::didDestroyVideoLayer):
2719         (WebCore::VideoFullscreenLayerManagerObjC::requiresTextTrackRepresentation const):
2720         (WebCore::VideoFullscreenLayerManagerObjC::syncTextTrackBounds):
2721         (WebCore::VideoFullscreenLayerManagerObjC::setTextTrackRepresentation):
2722
2723 2018-03-21  Antoine Quint  <graouts@apple.com>
2724
2725         [Web Animations] Dispatch DOM events for CSS Transitions and CSS Animations implemented as Web Animations
2726         https://bugs.webkit.org/show_bug.cgi?id=183781
2727
2728         Reviewed by Dean Jackson.
2729
2730         Now that we've implemented CSS Animations and CSS Transitions as Web Animations (webkit.org/b/183504) we can dispatch DOM events
2731         for targets of DeclarativeAnimation objects. To do that, we add a new invalidateDOMEvents() method on DeclarativeAnimations which
2732         is called when the timer scheduled after the timing model has been invalidated fires in DocumentTimeline::performInvalidationTask().
2733         When we check for DOM events to dispatch, we look at the last recorded phase and iteration and determine whether the state of the
2734         animation has changed. We use a GenericEventQueue to enqueue the events such that they are dispatched asynchronously at a moment
2735         when it is safe to evaluate script.
2736
2737         * animation/AnimationEffectReadOnly.h: Make currentIteration() public since we now need it in DeclarativeAnimation::invalidateDOMEvents().
2738         * animation/CSSAnimation.cpp:
2739         (WebCore::CSSAnimation::create): Pass the animation target to the constructor instead of its document.
2740         (WebCore::CSSAnimation::CSSAnimation): Pass the animation target to the superclass instead of its document.
2741         * animation/CSSAnimation.h:
2742         * animation/CSSTransition.cpp:
2743         (WebCore::CSSTransition::create): Pass the animation target to the constructor instead of its document.
2744         (WebCore::CSSTransition::CSSTransition): Pass the animation target to the superclass instead of its document.
2745         * animation/CSSTransition.h:
2746         * animation/DeclarativeAnimation.cpp:
2747         (WebCore::DeclarativeAnimation::DeclarativeAnimation): Expect an Element instead of a Document and use that element as the target of the
2748         GenericEventQueue that we initialize. We also register this element as our m_target.
2749         (WebCore::DeclarativeAnimation::~DeclarativeAnimation): Close the GenericEventQueue member upon destruction.
2750         (WebCore::DeclarativeAnimation::initialize): We need to call pause() for declarative animations that aren't playing so that the animation's
2751         playState is set correctly and the animation is not idle.
2752         (WebCore::DeclarativeAnimation::phaseWithoutEffect const): Because we may need to get an animation's current phase in invalidateDOMEvents()
2753         after an animation's effect has been removed, we provide an alternate way to compute the phase just by looking at the animation's current time.
2754         (WebCore::DeclarativeAnimation::invalidateDOMEvents): Based on the previous and current pending state, iteration and phase, we enqueue animation
2755         and transition DOM events as specified by the CSS Animations Level 2 and CSS Transitions Level 2 specifications.
2756         (WebCore::DeclarativeAnimation::enqueueDOMEvent): Enqueue an event on the GenericEventQueue based on the animation type.
2757         * animation/DeclarativeAnimation.h:
2758         * animation/DocumentTimeline.cpp:
2759         (WebCore::DocumentTimeline::performInvalidationTask): We call invalidateDOMEvents() on all declarative animations registered with this timeline
2760         now that the timing model has been invalidated.
2761         * dom/EventNames.h: Add the names of newly-implemented events (animationcancel, transitioncancel, transitionrun and transitionstart).
2762         * dom/GlobalEventHandlers.idl: Add new attribute-based event handlers for the newly-implemented events.
2763         * html/HTMLAttributeNames.in: Add new attribute-based event handlers for the newly-implemented events.
2764         * html/HTMLElement.cpp:
2765         (WebCore::HTMLElement::createEventHandlerNameMap): Add new attribute-based event handlers for the newly-implemented events.
2766
2767 2018-03-21  Per Arne Vollan  <pvollan@apple.com>
2768
2769         Compile error when not using IOSurface canvas backing store.
2770         https://bugs.webkit.org/show_bug.cgi?id=183855
2771
2772         Reviewed by Brent Fulgham.
2773
2774         The method IOSurface::createFromImageBuffer is only referenced when IOSurface
2775         is used as canvas backing store.
2776
2777         * platform/graphics/cocoa/IOSurface.h:
2778         * platform/graphics/cocoa/IOSurface.mm:
2779
2780 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
2781
2782         [CoordGraphics] Track dirty rects that need update in CoordinatedGraphicsLayer
2783         https://bugs.webkit.org/show_bug.cgi?id=175376
2784
2785         Reviewed by Carlos Garcia Campos.
2786
2787         Follow the GraphicsLayerCA class and track rectangles in need of display
2788         in a Vector object. In case the whole layer needs updating, it's marked
2789         separately, and further rects are ignored.
2790
2791         During layer flush, all the rects are used to invalidate the backing
2792         store, or a single layer-sized rect is used in case the whole layer has
2793         to be updated. We can also bail early from updateContentBuffers() if
2794         there are no dirty rects recorded and there's no pending visible rect
2795         adjustment.
2796
2797         At the end of updateContentBuffers() we now test for an existing
2798         previous backing store before inquiring the backing store if the visible
2799         area is already covered, enabling deletion of this backing store.
2800
2801         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2802         (WebCore::CoordinatedGraphicsLayer::setNeedsDisplay):
2803         (WebCore::CoordinatedGraphicsLayer::setNeedsDisplayInRect):
2804         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
2805         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2806
2807 2018-03-21  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2808
2809         [WPE] Build failure with ENABLE_VIDEO=OFF when GStreamer is not available
2810         https://bugs.webkit.org/show_bug.cgi?id=183811
2811
2812         Reviewed by Philippe Normand.
2813
2814         Add build guards for USE_GSTREAMER.
2815
2816         No new tests, it is a build fix.
2817
2818         * platform/graphics/gstreamer/GStreamerUtilities.h:
2819
2820 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
2821
2822         [Cairo] Draw Cairo patterns with cairo_paint_with_alpha()
2823         https://bugs.webkit.org/show_bug.cgi?id=183774
2824
2825         Reviewed by Carlos Garcia Campos.
2826
2827         In the drawPatternToCairoContext() helper in CairoOperations.cpp source
2828         file, always clip the painting region to the specified rectangle and
2829         then use cairo_paint_with_alpha() to paint the passed-in pattern object,
2830         not relaying rasterization to cairo_fill() when using opaque alpha. We
2831         still clamp the alpha value to the 0.0 - 1.0 range.
2832
2833         No new tests -- no change in behavior.
2834
2835         * platform/graphics/cairo/CairoOperations.cpp:
2836         (WebCore::Cairo::drawPatternToCairoContext):
2837
2838 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
2839
2840         [TexMap] Have TextureMapperLayer::applyAnimationsRecursively() return running animation status
2841         https://bugs.webkit.org/show_bug.cgi?id=183771
2842
2843         Reviewed by Carlos Garcia Campos.
2844
2845         TextureMapperLayer::applyAnimationsRecursively() should return true when
2846         the TextureMapperLayer tree has currently-running animations that
2847         require continuous scene update.
2848
2849         TextureMapperAnimation::ApplicationResult gains the hasRunningAnimation
2850         member that's set to true if any of the applied animations are still in
2851         playing state. That information is then returned in syncAnimations(),
2852         and the result is accumulated in the top applyAnimationsRecursively()
2853         call and returned there to the caller.
2854
2855         No new tests -- no change in behavior.
2856
2857         * platform/graphics/texmap/TextureMapperAnimation.cpp:
2858         (WebCore::TextureMapperAnimation::apply):
2859         * platform/graphics/texmap/TextureMapperAnimation.h:
2860         * platform/graphics/texmap/TextureMapperLayer.cpp:
2861         (WebCore::TextureMapperLayer::applyAnimationsRecursively):
2862         (WebCore::TextureMapperLayer::syncAnimations):
2863         * platform/graphics/texmap/TextureMapperLayer.h:
2864
2865 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
2866
2867         Use-after-move in SWContextManager::terminateWorker() with Linux x86_64 calling convention
2868         https://bugs.webkit.org/show_bug.cgi?id=183783
2869
2870         Reviewed by Chris Dumez.
2871
2872         In SWContextManager::terminateWorker(), some calling conventions can
2873         end up moving the ServiceWorkerThreadProxy RefPtr into the lambda struct
2874         before that proxy's thread (on which the lambda is bound to execute) is
2875         retrieved.
2876
2877         Avoid this by taking a reference to the thread in a separate earlier
2878         expression, before the RefPtr is moved into the lambda in the following
2879         one.
2880
2881         * workers/service/context/SWContextManager.cpp:
2882         (WebCore::SWContextManager::terminateWorker):
2883
2884 2018-03-21  Timothy Horton  <timothy_horton@apple.com>
2885
2886         Fix the build
2887
2888         * platform/network/cf/FormDataStreamCFNet.cpp:
2889
2890 2018-03-20  Tim Horton  <timothy_horton@apple.com>
2891
2892         Introduce HAVE_MEDIA_PLAYER and HAVE_CORE_VIDEO
2893         https://bugs.webkit.org/show_bug.cgi?id=183803
2894         <rdar://problem/38690487>
2895
2896         Reviewed by Sam Weinig.
2897
2898         * platform/audio/ios/MediaSessionManagerIOS.mm:
2899         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
2900         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
2901         (-[WebMediaSessionHelper initWithCallback:]):
2902         (-[WebMediaSessionHelper dealloc]):
2903         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]):
2904         * platform/cocoa/CoreVideoSoftLink.cpp:
2905         * platform/cocoa/CoreVideoSoftLink.h:
2906         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2907         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2908         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
2909         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasAvailableVideoFrame const):
2910         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
2911         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
2912         (WebCore::MediaSampleAVFObjC::getRGBAImageData const):
2913         * platform/graphics/cv/PixelBufferConformerCV.cpp:
2914         * platform/graphics/cv/PixelBufferConformerCV.h:
2915         * platform/graphics/cv/TextureCacheCV.h:
2916         * platform/graphics/cv/TextureCacheCV.mm:
2917         * platform/graphics/cv/VideoTextureCopierCV.cpp:
2918         * platform/graphics/cv/VideoTextureCopierCV.h:
2919         Make it possible to disable our dependency on MediaPlayer and CoreVideo.
2920
2921 2018-03-20  Tim Horton  <timothy_horton@apple.com>
2922
2923         Enable the minimal simulator feature flag when appropriate
2924         https://bugs.webkit.org/show_bug.cgi?id=183807
2925
2926         Reviewed by Dan Bernstein.
2927
2928         * Configurations/FeatureDefines.xcconfig:
2929
2930 2018-03-19  Ryosuke Niwa  <rniwa@webkit.org>
2931
2932         Expose content attributes on _WKLinkIconParameters
2933         https://bugs.webkit.org/show_bug.cgi?id=183768
2934
2935         Reviewed by Alex Christensen.
2936
2937         Collect a vector of content attributes upon finding touch and fav-icons in order to expose it in a WebKit API.
2938
2939         Tests: IconLoading.DefaultFavicon
2940
2941         * html/LinkIconCollector.cpp:
2942         (WebCore::LinkIconCollector::iconsOfTypes): Collect attributes.
2943         * loader/DocumentLoader.cpp:
2944         (WebCore::DocumentLoader::startIconLoading): Use an empty vector for /favicon.ico.
2945         * platform/LinkIcon.h:
2946         (WebCore::LinkIcon::encode const): Encode the vector of content attributes.
2947         (WebCore::LinkIcon::decode): Ditto for decoding.
2948
2949 2018-03-20  Zalan Bujtas  <zalan@apple.com>
2950
2951         RenderTreeNeedsLayoutChecker fails with absolutely positioned svg and <use>
2952         https://bugs.webkit.org/show_bug.cgi?id=183718
2953
2954         Reviewed by Antti Koivisto.
2955
2956         This patch ensures after resolving the style for an SVG element with a corresponding element (<use>),
2957         we adjust this style for the cloned SVG element too.
2958
2959         Test: svg/in-html/path-with-absolute-positioned-svg-and-use-crash.html
2960
2961         * css/StyleResolver.cpp:
2962         (WebCore::StyleResolver::adjustSVGElementStyle):
2963         (WebCore::StyleResolver::adjustRenderStyle):
2964         * css/StyleResolver.h:
2965         * svg/SVGElement.cpp:
2966         (WebCore::SVGElement::resolveCustomStyle):
2967
2968 2018-03-20  Brady Eidson  <beidson@apple.com>
2969
2970         First piece of process swapping on navigation.
2971         https://bugs.webkit.org/show_bug.cgi?id=183665
2972
2973         Reviewed by Andy Estes.
2974
2975         Covered by API test(s)
2976
2977         This patch:
2978         - A new PolicyAction::Suspend for future use in this feature
2979         - Makes sure that loads triggered as part of a process swap do *not* re-consult the policy delegate
2980
2981         * loader/DocumentLoader.cpp:
2982         (WebCore::DocumentLoader::continueAfterContentPolicy):
2983
2984         * loader/FrameLoadRequest.h:
2985         (WebCore::FrameLoadRequest::setShouldCheckNavigationPolicy):
2986         (WebCore::FrameLoadRequest::shouldCheckNavigationPolicy const):
2987
2988         * loader/FrameLoader.cpp:
2989         (WebCore::FrameLoader::load):
2990         (WebCore::FrameLoader::loadWithDocumentLoader):
2991         * loader/FrameLoader.h:
2992
2993         * loader/FrameLoaderTypes.h: Add a new Policy type "Suspend" to be used in the future
2994           by the process-swap-on-navigation mechanism.
2995
2996         * loader/PolicyChecker.cpp:
2997         (WebCore::PolicyChecker::checkNavigationPolicy):
2998         (WebCore::PolicyChecker::checkNewWindowPolicy):
2999
3000 2018-03-20  Chris Dumez  <cdumez@apple.com>
3001
3002         QuickLook.NavigationDelegate API test is failing on iOS with async policy delegates
3003         https://bugs.webkit.org/show_bug.cgi?id=183791
3004
3005         Reviewed by Alex Christensen.
3006
3007         Update PreviewLoader to not send data (or call finishFinishLoading) until
3008         the resource response has been processed.
3009
3010         * loader/ios/PreviewLoader.mm:
3011         (-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]):
3012         (-[WebPreviewLoader connection:didReceiveData:lengthReceived:]):
3013         (-[WebPreviewLoader connectionDidFinishLoading:]):
3014
3015 2018-03-20  Antoine Quint  <graouts@apple.com>
3016
3017         [Web Animations] Update the timing model when pending tasks schedule changes
3018         https://bugs.webkit.org/show_bug.cgi?id=183785
3019
3020         Reviewed by Dean Jackson.
3021
3022         Changing the time at which a pending play or pause task is scheduled changes the pending
3023         state of the animation and thus should notify that the timing model has changed and invalidate
3024         the effect.
3025
3026         * animation/WebAnimation.cpp:
3027         (WebCore::WebAnimation::setTimeToRunPendingPlayTask):
3028         (WebCore::WebAnimation::setTimeToRunPendingPauseTask):
3029         (WebCore::WebAnimation::updatePendingTasks):
3030
3031 2018-03-20  Tim Horton  <timothy_horton@apple.com>
3032
3033         Add and adopt WK_PLATFORM_NAME and adjust default feature defines
3034         https://bugs.webkit.org/show_bug.cgi?id=183758
3035         <rdar://problem/38017644>
3036
3037         Reviewed by Dan Bernstein.
3038
3039         * Configurations/Base.xcconfig:
3040         * Configurations/FeatureDefines.xcconfig:
3041         * WebCore.xcodeproj/project.pbxproj:
3042
3043 2018-03-19  Tim Horton  <timothy_horton@apple.com>
3044
3045         Apply some SDK checks in LocalDefaultSystemAppearance
3046         https://bugs.webkit.org/show_bug.cgi?id=183767
3047         <rdar://problem/38649611>
3048
3049         Reviewed by Zalan Bujtas.
3050
3051         * platform/mac/LocalDefaultSystemAppearance.h:
3052         * platform/mac/LocalDefaultSystemAppearance.mm:
3053         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
3054         (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
3055
3056 2018-03-19  Chris Dumez  <cdumez@apple.com>
3057
3058         Have one service worker process per security origin
3059         https://bugs.webkit.org/show_bug.cgi?id=183600
3060         <rdar://problem/35280128>
3061
3062         Reviewed by Brady Eidson.
3063
3064         Split service workers from different origins into their own processes
3065         for security reasons.
3066
3067         * workers/service/server/SWServer.cpp:
3068         (WebCore::SWServer::addRegistrationFromStore):
3069         (WebCore::SWServer::clear):
3070         (WebCore::SWServer::tryInstallContextData):
3071         (WebCore::SWServer::serverToContextConnectionCreated):
3072         (WebCore::SWServer::installContextData):
3073         (WebCore::SWServer::runServiceWorkerIfNecessary):
3074         (WebCore::SWServer::markAllWorkersAsTerminated):
3075         * workers/service/server/SWServer.h:
3076         * workers/service/server/SWServerToContextConnection.cpp:
3077         (WebCore::SWServerToContextConnection::SWServerToContextConnection):
3078         (WebCore::SWServerToContextConnection::~SWServerToContextConnection):
3079         (WebCore::SWServerToContextConnection::connectionForOrigin):
3080         * workers/service/server/SWServerToContextConnection.h:
3081         (WebCore::SWServerToContextConnection::origin):
3082         * workers/service/server/SWServerWorker.cpp:
3083         (WebCore::SWServerWorker::SWServerWorker):
3084         (WebCore::SWServerWorker::securityOrigin const):
3085         (WebCore::SWServerWorker::contextConnection):
3086         * workers/service/server/SWServerWorker.h:
3087
3088 2018-03-19  Megan Gardner  <megan_gardner@apple.com>
3089
3090         Have select element respect current appearance
3091         https://bugs.webkit.org/show_bug.cgi?id=183753
3092
3093         Reviewed by Tim Horton.
3094
3095         Not currently testable, will add tests in a later patch.
3096
3097         Have the menu lists/select elements follow the system colors.
3098
3099         * rendering/RenderThemeMac.mm:
3100         (WebCore::RenderThemeMac::adjustMenuListStyle const):
3101
3102 2018-03-19  Nan Wang  <n_wang@apple.com>
3103
3104         AX: embedded attachments do not work correctly with text marker APIs on macOS
3105         https://bugs.webkit.org/show_bug.cgi?id=183751
3106
3107         Reviewed by Chris Fleizach.
3108
3109         In WebKit1, embedded attachments are not working well with text marker APIs.
3110         We should use the corresponding attachment view in the following cases:
3111         1. Hit testing on an attachment object.
3112         2. Getting the attachment object at a text marker position.
3113         3. Asking for the associated element with NSAccessibilityAttachmentTextAttribute. 
3114
3115         Not able to construct a layout test because it relies on embedded attachments.
3116
3117         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3118         (AXAttributeStringSetElement):
3119         (-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
3120         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
3121
3122 2018-03-19  Jiewen Tan  <jiewen_tan@apple.com>
3123
3124         Unreviewed, another quick fix for r229699
3125
3126         Restricts ENABLE_WEB_AUTHN to only macOS and iOS.
3127
3128         * Configurations/FeatureDefines.xcconfig:
3129
3130 2018-03-19  Daniel Bates  <dabates@apple.com>
3131
3132         Fix case of Strong Password localized string
3133
3134         * English.lproj/Localizable.strings:
3135         * platform/LocalizedStrings.cpp:
3136         (WebCore::autoFillStrongPasswordLabel):
3137
3138 2018-03-19  Chris Dumez  <cdumez@apple.com>
3139
3140         WebKit.WebsitePoliciesAutoplayQuirks API test times out with async policy delegates
3141         https://bugs.webkit.org/show_bug.cgi?id=183702
3142         <rdar://problem/38566060>
3143
3144         Reviewed by Alex Christensen.
3145
3146         The issue is that the test calls loadHTMLString then loadRequest right after, without
3147         waiting for the first load to complete first. loadHTMLString is special as it relies
3148         on substitute data and which schedules a timer to commit the data. When doing the
3149         navigation policy check for the following loadRequest(), the substitute data timer
3150         would fire and commit its data and load. This would in turn cancel the pending
3151         navigation policy check for the loadRequest().
3152
3153         With sync policy delegates, this is not an issue because we take care of stopping
3154         all loaders when receiving the policy decision, which happens synchronously. However,
3155         when the policy decision happens asynchronously, the pending substitute data load
3156         does not get cancelled in time and it gets committed.
3157
3158         To address the issue, we now cancel any pending provisional load before doing the
3159         navigation policy check.
3160
3161         Test: fast/loader/inner-iframe-loads-data-url-into-parent-on-unload-crash-async-delegate.html
3162
3163         * loader/FrameLoader.cpp:
3164         (WebCore::FrameLoader::clearProvisionalLoadForPolicyCheck):
3165         * loader/FrameLoader.h:
3166         * loader/PolicyChecker.cpp:
3167         (WebCore::PolicyChecker::checkNavigationPolicy):
3168         Cancel any pending provisional load before starting the navigation policy check. This call
3169         needs to be here rather than in the call site of policyChecker().checkNavigationPolicy()
3170         because there is code in PolicyChecker::checkNavigationPolicy() which relies on
3171         FrameLoader::activeDocumentLoader().
3172         Also, we only cancel the provisional load if there is a policy document loader. In some
3173         rare cases (when we receive a redirect after navigation policy has been decided for the
3174         initial request), the provisional document loader needs to receive navigation policy
3175         decisions so we cannot clear the provisional document loader in such case.
3176
3177 2018-03-19  Eric Carlson  <eric.carlson@apple.com>
3178
3179         [Extra zoom mode] Require fullscreen for video playback
3180         https://bugs.webkit.org/show_bug.cgi?id=183742
3181         <rdar://problem/38235862>
3182
3183         Reviewed by Jer Noble.
3184
3185         * Modules/modern-media-controls/media/playback-support.js:
3186         (PlaybackSupport.prototype.syncControl): Always show the play button.
3187         * html/HTMLMediaElement.cpp:
3188         (WebCore::HTMLMediaElement::updatePlayState): Return immediately if playback requires fullscreen
3189         (WebCore::HTMLMediaElement::didBecomeFullscreenElement): Call updatePlayState in case 
3190         playback is pending.
3191         * html/HTMLMediaElement.h:
3192         * platform/cocoa/VideoFullscreenModel.h:
3193         (WebCore::VideoFullscreenModel::presentingViewController): New.
3194         (WebCore::VideoFullscreenModel::createVideoFullscreenViewController): New.
3195         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3196         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
3197         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
3198         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
3199         (WebCore::PlaybackSessionInterfaceAVKit::seekableRangesChanged):
3200
3201         * platform/ios/VideoFullscreenInterfaceAVKit.h:
3202         * platform/ios/VideoFullscreenInterfaceAVKit.mm: Wrap AVPlayerLayerView so we can change its
3203         behavior.
3204         (WebAVPlayerLayerView_playerLayer):
3205         (WebAVPlayerLayerView_videoView):
3206         (allocWebAVPlayerLayerViewInstance):
3207         (-[WebAVPlayerViewController initWithFullscreenInterface:]):
3208         (-[WebAVPlayerViewController playerViewControllerShouldHandleDoneButtonTap:]):
3209         (-[WebAVPlayerViewController enterFullScreenAnimated:completionHandler:]):
3210         (-[WebAVPlayerViewController exitFullScreenAnimated:completionHandler:]):
3211         (-[WebAVPlayerViewController NO_RETURN_DUE_TO_ASSERT]):
3212         (-[WebAVPlayerViewController isPictureInPicturePossible]):
3213         (-[WebAVPlayerViewController isPictureInPictureActive]):
3214         (-[WebAVPlayerViewController isPictureInPictureSuspended]):
3215         (-[WebAVPlayerViewController pictureInPictureActive]):
3216         (-[WebAVPlayerViewController pictureInPictureWasStartedWhenEnteringBackground]):
3217         (-[WebAVPlayerViewController view]):
3218         (-[WebAVPlayerViewController showsPlaybackControls]):
3219         (-[WebAVPlayerViewController setShowsPlaybackControls:]):
3220         (-[WebAVPlayerViewController setAllowsPictureInPicturePlayback:]):
3221         (-[WebAVPlayerViewController setDelegate:]):
3222         (-[WebAVPlayerViewController setPlayerController:]):
3223         (-[WebAVPlayerViewController avPlayerViewController]):
3224         (-[WebAVPlayerViewController removeFromParentViewController]):
3225         (VideoFullscreenInterfaceAVKit::setupFullscreen):
3226         (fallbackViewController):
3227         (VideoFullscreenInterfaceAVKit::presentingViewController):
3228         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
3229         (VideoFullscreenInterfaceAVKit::doSetup):
3230         (WebCore::supportsPictureInPicture):
3231
3232 2018-03-19  Per Arne Vollan  <pvollan@apple.com>
3233
3234         When the WebContent process is blocked from accessing the WindowServer, the call CVDisplayLinkCreateWithCGDisplay will fail.
3235         https://bugs.webkit.org/show_bug.cgi?id=183604
3236         <rdar://problem/38305109>
3237
3238         Reviewed by Brent Fulgham.
3239
3240         The call to CVDisplayLinkCreateWithCGDisplay can instead be made in the UIProcess. Notify the WebContent process
3241         about display updates by sending a message from the UIProcess on each screen update. This patch adds an extra
3242         IPC step when notifying the WebContent process about display updates. However, the MotionMark benchmark shows no
3243         performance regression when running it with this patch. A possible explanation for this is that the high priority
3244         display link thread is now running in the UIProcess instead of the WebContent process, which means there will be
3245         more available CPU resources for the WebContent process. A run loop observer is added to make sure that only one
3246         display callback (for each display observer) is executed in a single iteration of the run loop. This will make
3247         sure we are not filling the IPC message queue with unhandled display link messages.
3248
3249         No new tests, covered by existing tests. 
3250
3251         * platform/graphics/DisplayRefreshMonitor.h:
3252         (WebCore::DisplayRefreshMonitor::displayLinkFired):
3253         * platform/graphics/DisplayRefreshMonitorManager.cpp:
3254         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
3255         * platform/graphics/DisplayRefreshMonitorManager.h:
3256         * platform/graphics/mac/DisplayRefreshMonitorMac.h:
3257
3258 2018-03-19  Megan Gardner  <megan_gardner@apple.com>
3259
3260         Ensure local appearance actually mirrors the app's appearance
3261         https://bugs.webkit.org/show_bug.cgi?id=183743
3262
3263         Reviewed by Tim Horton.
3264
3265         Not currently testable, will add tests in a later patch.
3266
3267         Current appearance isn't always accurate by default and needs to be set manually.
3268
3269         * platform/mac/LocalDefaultSystemAppearance.mm:
3270         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
3271
3272 2018-03-19  Zan Dobersek  <zdobersek@igalia.com>
3273
3274         Unreviewed GCC 4.9 build-fix after r229672.
3275
3276         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
3277         (Nicosia::createCommand): Don't depend on implicit conversion of the
3278         returning std::unique_ptr<> object, and instead only wrap the
3279         heap-allocated PaintingOperation-derived in a std::unique_ptr<> at the
3280         point of return.
3281
3282 2018-03-18  Commit Queue  <commit-queue@webkit.org>
3283
3284         Unreviewed, rolling out r229689.
3285         https://bugs.webkit.org/show_bug.cgi?id=183735
3286
3287         Causes fast/loader/inner-iframe-loads-data-url-into-parent-on-
3288         unload-crash.html to fail with async delegates (Requested by
3289         cdumez_ on #webkit).
3290
3291         Reverted changeset:
3292
3293         "WebKit.WebsitePoliciesAutoplayQuirks API test times out with
3294         async policy delegates"
3295         https://bugs.webkit.org/show_bug.cgi?id=183702
3296         https://trac.webkit.org/changeset/229689
3297
3298 2018-03-17  Tim Horton  <timothy_horton@apple.com>
3299
3300         Correct redefined fnfErr type
3301         https://bugs.webkit.org/show_bug.cgi?id=183728
3302         <rdar://problem/38590063>
3303
3304         Reviewed by Dan Bernstein.
3305
3306         * platform/network/cf/FormDataStreamCFNet.cpp:
3307         CFStreamError's error parameter takes a SInt32, not an int.
3308         Make sure our redefinition has a compatible type.
3309
3310 2018-03-17  Jiewen Tan  <jiewen_tan@apple.com>
3311
3312         [WebAuthN] Implement authenticatorMakeCredential
3313         https://bugs.webkit.org/show_bug.cgi?id=183527
3314         <rdar://problem/35275886>
3315
3316         Reviewed by Brent Fulgham.
3317
3318         This patch does the following few things:
3319         1) It implements the authenticatorMakeCredential logic from the spec: https://www.w3.org/TR/webauthn/#op-make-cred.
3320         2) It tweaks enocding and deocding of PublicKeyCredentialCreationOptions between UIProccess and WebProcess.
3321         3) It soft links LocalAuthentication.Framework to WebCore, which was linked to WebKit.
3322         4) It creates SPI header for DeviceIdentity.Framework, and provides stubs to link it to WebCore.
3323
3324         Here is a detailed explanantion of 1):
3325         1. A helper class called LocalAuthenticator is crafted to represent Apple platform attached authenticator, i.e.
3326         the devices themselves. All operations are currently restricted to iOS at this moment as macOS lacks attestation
3327         support.
3328         2. To do testing, this helper class is then moved from WebKit to WebCore even though all operations can only happens
3329         in the UIProcess. We currently lack the ability to pretend a https environment in TestWebKitAPI which is required by
3330         the WebAuthN API, and thus it is moved to WebCore to perform unit tesing flavor API tests. This is not enough as it
3331         can't test message exchange between the UI and Web processes. We will address this in a subsequent patch.
3332         3. More on testing: The attestation process is abstracted into a protected method such that the testing enviroment can
3333         override it with self attestation as network access is restricted in the WebKit testing enviroment. Also, swizzlers of
3334         LocalAuthentication API are provided to override the behavoir of LAContext.
3335         4. More on testing: The actual Apple attestation can only happen in real device and with network access, therefore
3336         it can only be covered by manual tests at this moment.
3337         5. Back to LocalAuthenticator, it currently has two public methods:
3338                 5.1. makeCredential(): This method is the one does all the magic.
3339                 + It first checks some parameters.
3340                 + It then invokes LAContext to get user consent.
3341                 + It then talks to Apple Attestation Privacy CA to do attestations.
3342                 + It then stores necessary information into the Keychain.
3343                 + Finally it generates the attestation object.
3344                 5.2 isAvailable():
3345                 To check if a LocalAuthenticator is available or not.
3346         6. Even though files are of .mm format, they are written in a way that mixes NS, CF and C++ types. Here is the rule:
3347                 6.1 Use CF type only if it is requested by APIs.
3348                 6.2 Use NS type to manipulate all Objc objects.
3349                 6.3 Use C++ otherwise.
3350
3351         Covered by API tests.
3352
3353         * Configurations/WebCore.xcconfig:
3354         * Modules/credentialmanagement/CredentialsMessenger.cpp:
3355         (WebCore::getIdFromAttestationObject): Deleted.
3356         Decoding attestation object is tedious. UIProcess will instead return credential ID and attestation object
3357         at the same time. Therefore, this method is removed.
3358         * Modules/credentialmanagement/CredentialsMessenger.h:
3359         (WebCore::CreationReturnBundle::CreationReturnBundle): Deleted.
3360         (WebCore::AssertionReturnBundle::AssertionReturnBundle): Deleted.
3361         * Modules/webauthn/COSEConstants.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialType.h.
3362         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
3363         (WebCore::PublicKeyCredentialCreationOptions::isolatedPartialCopyPtr const):
3364         (WebCore::PublicKeyCredentialCreationOptions::Parameters::encode const):
3365         (WebCore::PublicKeyCredentialCreationOptions::Parameters::decode):
3366         (WebCore::PublicKeyCredentialCreationOptions::encode const):
3367         (WebCore::PublicKeyCredentialCreationOptions::decode):
3368         * Modules/webauthn/PublicKeyCredentialDescriptor.h:
3369         (WebCore::PublicKeyCredentialDescriptor::encode const):
3370         (WebCore::PublicKeyCredentialDescriptor::decode):
3371         * Modules/webauthn/PublicKeyCredentialType.h:
3372         * Modules/webauthn/cocoa/LocalAuthenticator.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h.
3373         * Modules/webauthn/cocoa/LocalAuthenticator.mm: Added.
3374         (WebCore::LocalAuthenticatorInternal::freePtrs):
3375         (WebCore::LocalAuthenticator::makeCredential const):
3376         (WebCore::LocalAuthenticator::isAvailable const):
3377         (WebCore::LocalAuthenticator::issueClientCertificate const):
3378         * SourcesCocoa.txt:
3379         * WebCore.xcodeproj/project.pbxproj:
3380         * platform/cocoa/LocalAuthenticationSoftLink.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialType.h.
3381         * platform/cocoa/LocalAuthenticationSoftLink.mm: Added.
3382         * testing/MockCredentialsMessenger.cpp:
3383         (WebCore::MockCredentialsMessenger::setCreationReturnBundle):
3384         (WebCore::MockCredentialsMessenger::makeCredential):
3385         (WebCore::MockCredentialsMessenger::makeCredentialReply):
3386         (WebCore::MockCredentialsMessenger::setAttestationObject): Deleted.
3387         * testing/MockCredentialsMessenger.h:
3388         * testing/MockCredentialsMessenger.idl:
3389
3390 2018-03-16  Brent Fulgham  <bfulgham@apple.com>
3391
3392         Correct debug assertion in Range::borderAndTextRects
3393         https://bugs.webkit.org/show_bug.cgi?id=183710
3394         <rdar://problem/38466976>
3395
3396         Reviewed by Ryosuke Niwa.
3397
3398         A debug assertion will fire if Range::borderAndTextRects is asked to evaluate a set of selected elements, where one of the elements does not have a parent.
3399
3400         We should consider a nullptr parent as satisfying the condition of a parent not being present in the selection set.
3401
3402         Tests: fast/dom/range/range-selection-empty-body.html
3403
3404         * dom/Range.cpp:
3405         (WebCore::Range::borderAndTextRects const):
3406
3407 2018-03-15  Filip Pizlo  <fpizlo@apple.com>
3408
3409         Put the DOM in IsoHeaps
3410         https://bugs.webkit.org/show_bug.cgi?id=183546
3411
3412         Reviewed by Daniel Bates.
3413
3414         No new tests because no change in behavior.
3415         
3416         This puts all descendants of WebCore::Node in isoheaps, so that UAFs on the DOM cannot be
3417         used for RCE attacks. This probably also makes it harder to use UAFs for UXSS, since it means
3418         that DOM UAFs cannot be used for universal read gadgets.
3419         
3420         This looks neutral on Speedometer and membuster, though I did have one round of testing
3421         that led me to believe that membuster was regressed - I just wasn't able to reproduce that
3422         result on subsequent testing.
3423
3424         * Sources.txt:
3425         * WebCore.xcodeproj/project.pbxproj:
3426         * dom/Attr.cpp:
3427         * dom/Attr.h:
3428         * dom/CDATASection.cpp:
3429         * dom/CDATASection.h:
3430         * dom/CharacterData.cpp:
3431         * dom/CharacterData.h:
3432         * dom/Comment.cpp:
3433         * dom/Comment.h:
3434         * dom/ContainerNode.cpp:
3435         * dom/ContainerNode.h:
3436         * dom/Document.cpp:
3437         * dom/Document.h:
3438         * dom/DocumentFragment.cpp:
3439         * dom/DocumentFragment.h:
3440         * dom/DocumentType.cpp:
3441         * dom/DocumentType.h:
3442         * dom/Node.cpp:
3443         * dom/Node.h:
3444         * dom/ProcessingInstruction.cpp:
3445         * dom/ProcessingInstruction.h:
3446         * dom/PseudoElement.cpp:
3447         * dom/PseudoElement.h:
3448         * dom/ShadowRoot.cpp:
3449         * dom/ShadowRoot.h:
3450         * dom/StyledElement.cpp:
3451         * dom/StyledElement.h:
3452         * dom/TemplateContentDocumentFragment.cpp: Added.
3453         * dom/TemplateContentDocumentFragment.h:
3454         * dom/Text.cpp:
3455         * dom/Text.h:
3456         * dom/XMLDocument.cpp: Added.
3457         * dom/XMLDocument.h:
3458         * html/FTPDirectoryDocument.cpp:
3459         * html/FTPDirectoryDocument.h:
3460         * html/FileInputType.cpp:
3461         * html/HTMLAnchorElement.cpp:
3462         * html/HTMLAnchorElement.h:
3463         * html/HTMLAppletElement.cpp:
3464         * html/HTMLAppletElement.h:
3465         * html/HTMLAreaElement.cpp:
3466         * html/HTMLAreaElement.h:
3467         * html/HTMLAttachmentElement.cpp:
3468         * html/HTMLAttachmentElement.h:
3469         * html/HTMLBDIElement.cpp: Added.
3470         * html/HTMLBDIElement.h:
3471         * html/HTMLBRElement.cpp:
3472         * html/HTMLBRElement.h:
3473         * html/HTMLBaseElement.cpp:
3474         * html/HTMLBaseElement.h:
3475         * html/HTMLBodyElement.cpp:
3476         * html/HTMLBodyElement.h:
3477         * html/HTMLButtonElement.cpp:
3478         * html/HTMLButtonElement.h:
3479         * html/HTMLCanvasElement.cpp:
3480         * html/HTMLCanvasElement.h:
3481         * html/HTMLDListElement.cpp:
3482         * html/HTMLDListElement.h:
3483         * html/HTMLDataElement.cpp:
3484         * html/HTMLDataElement.h:
3485         * html/HTMLDataListElement.cpp:
3486         * html/HTMLDataListElement.h:
3487         * html/HTMLDetailsElement.cpp:
3488         * html/HTMLDetailsElement.h:
3489         * html/HTMLDirectoryElement.cpp:
3490         * html/HTMLDirectoryElement.h:
3491         * html/HTMLDivElement.cpp:
3492         * html/HTMLDivElement.h:
3493         * html/HTMLDocument.cpp:
3494         * html/HTMLDocument.h:
3495         * html/HTMLElement.cpp:
3496         * html/HTMLElement.h:
3497         * html/HTMLEmbedElement.cpp:
3498         * html/HTMLEmbedElement.h:
3499         * html/HTMLFieldSetElement.cpp:
3500         * html/HTMLFieldSetElement.h:
3501         * html/HTMLFontElement.cpp:
3502         * html/HTMLFontElement.h:
3503         * html/HTMLFormControlElement.cpp:
3504         * html/HTMLFormControlElement.h:
3505         * html/HTMLFormControlElementWithState.cpp:
3506         * html/HTMLFormControlElementWithState.h:
3507         * html/HTMLFormElement.cpp:
3508         * html/HTMLFormElement.h:
3509         * html/HTMLFrameElement.cpp:
3510         * html/HTMLFrameElement.h:
3511         * html/HTMLFrameElementBase.cpp:
3512         * html/HTMLFrameElementBase.h:
3513         * html/HTMLFrameOwnerElement.cpp:
3514         * html/HTMLFrameOwnerElement.h:
3515         * html/HTMLFrameSetElement.cpp:
3516         * html/HTMLFrameSetElement.h:
3517         * html/HTMLHRElement.cpp:
3518         * html/HTMLHRElement.h:
3519         * html/HTMLHeadElement.cpp:
3520         * html/HTMLHeadElement.h:
3521         * html/HTMLHeadingElement.cpp:
3522         * html/HTMLHeadingElement.h:
3523         * html/HTMLHtmlElement.cpp:
3524         * html/HTMLHtmlElement.h:
3525         * html/HTMLIFrameElement.cpp:
3526         * html/HTMLIFrameElement.h:
3527         * html/HTMLImageElement.cpp:
3528         * html/HTMLImageElement.h:
3529         * html/HTMLInputElement.cpp:
3530         * html/HTMLInputElement.h:
3531         * html/HTMLKeygenElement.cpp:
3532         * html/HTMLKeygenElement.h:
3533         * html/HTMLLIElement.cpp:
3534         * html/HTMLLIElement.h:
3535         * html/HTMLLabelElement.cpp:
3536         * html/HTMLLabelElement.h:
3537         * html/HTMLLegendElement.cpp:
3538         * html/HTMLLegendElement.h:
3539         * html/HTMLLinkElement.cpp:
3540         * html/HTMLLinkElement.h:
3541         * html/HTMLMapElement.cpp:
3542         * html/HTMLMapElement.h:
3543         * html/HTMLMarqueeElement.cpp:
3544         * html/HTMLMarqueeElement.h:
3545         * html/HTMLMenuElement.cpp:
3546         * html/HTMLMenuElement.h:
3547         * html/HTMLMenuItemElement.cpp:
3548         * html/HTMLMenuItemElement.h:
3549         * html/HTMLMetaElement.cpp:
3550         * html/HTMLMetaElement.h:
3551         * html/HTMLMeterElement.cpp:
3552         * html/HTMLMeterElement.h:
3553         * html/HTMLModElement.cpp:
3554         * html/HTMLModElement.h:
3555         * html/HTMLOListElement.cpp:
3556         * html/HTMLOListElement.h:
3557         * html/HTMLObjectElement.cpp:
3558         * html/HTMLObjectElement.h:
3559         * html/HTMLOptGroupElement.cpp:
3560         * html/HTMLOptGroupElement.h:
3561         * html/HTMLOptionElement.cpp:
3562         * html/HTMLOptionElement.h:
3563         * html/HTMLOutputElement.cpp:
3564         * html/HTMLOutputElement.h:
3565         * html/HTMLParagraphElement.cpp:
3566         * html/HTMLParagraphElement.h:
3567         * html/HTMLParamElement.cpp:
3568         * html/HTMLParamElement.h:
3569         * html/HTMLPictureElement.cpp:
3570         * html/HTMLPictureElement.h:
3571         * html/HTMLPlugInElement.cpp:
3572         * html/HTMLPlugInElement.h:
3573         * html/HTMLPlugInImageElement.cpp:
3574         * html/HTMLPlugInImageElement.h:
3575         * html/HTMLPreElement.cpp:
3576         * html/HTMLPreElement.h:
3577         * html/HTMLProgressElement.cpp:
3578         * html/HTMLProgressElement.h:
3579         * html/HTMLQuoteElement.cpp:
3580         * html/HTMLQuoteElement.h:
3581         * html/HTMLScriptElement.cpp:
3582         * html/HTMLScriptElement.h:
3583         * html/HTMLSelectElement.cpp:
3584         * html/HTMLSelectElement.h:
3585         * html/HTMLSlotElement.cpp:
3586         * html/HTMLSlotElement.h:
3587         * html/HTMLSourceElement.cpp:
3588         * html/HTMLSourceElement.h:
3589         * html/HTMLSpanElement.cpp:
3590         * html/HTMLSpanElement.h:
3591         * html/HTMLStyleElement.cpp:
3592         * html/HTMLStyleElement.h:
3593         * html/HTMLSummaryElement.cpp:
3594         * html/HTMLSummaryElement.h:
3595         * html/HTMLTableCaptionElement.cpp:
3596         * html/HTMLTableCaptionElement.h:
3597         * html/HTMLTableCellElement.cpp:
3598         * html/HTMLTableCellElement.h:
3599         * html/HTMLTableColElement.cpp:
3600         * html/HTMLTableColElement.h:
3601         * html/HTMLTableElement.cpp:
3602         * html/HTMLTableElement.h:
3603         * html/HTMLTablePartElement.cpp:
3604         * html/HTMLTablePartElement.h:
3605         * html/HTMLTableRowElement.cpp:
3606         * html/HTMLTableRowElement.h:
3607         * html/HTMLTableSectionElement.cpp:
3608         * html/HTMLTableSectionElement.h:
3609         * html/HTMLTemplateElement.cpp:
3610         * html/HTMLTemplateElement.h:
3611         * html/HTMLTextAreaElement.cpp:
3612         * html/HTMLTextAreaElement.h:
3613         * html/HTMLTextFormControlElement.cpp:
3614         * html/HTMLTextFormControlElement.h:
3615         * html/HTMLTimeElement.cpp:
3616         * html/HTMLTimeElement.h:
3617         * html/HTMLTitleElement.cpp:
3618         * html/HTMLTitleElement.h:
3619         * html/HTMLTrackElement.cpp:
3620         * html/HTMLTrackElement.h:
3621         * html/HTMLUListElement.cpp:
3622         * html/HTMLUListElement.h:
3623         * html/HTMLUnknownElement.cpp: Added.
3624         * html/HTMLUnknownElement.h:
3625         * html/HTMLWBRElement.cpp:
3626         * html/HTMLWBRElement.h:
3627         * html/ImageDocument.cpp:
3628         * html/ImageDocument.h:
3629         * html/LabelableElement.cpp:
3630         * html/LabelableElement.h:
3631         * html/MediaController.cpp:
3632         (MediaController::create): Deleted.
3633         (MediaController::MediaController): Deleted.
3634         (MediaController::addMediaElement): Deleted.
3635         (MediaController::removeMediaElement): Deleted.
3636         (MediaController::containsMediaElement const): Deleted.
3637         (MediaController::buffered const): Deleted.
3638         (MediaController::seekable const): Deleted.
3639         (MediaController::played): Deleted.
3640         (MediaController::duration const): Deleted.
3641         (MediaController::currentTime const): Deleted.
3642         (MediaController::setCurrentTime): Deleted.
3643         (MediaController::unpause): Deleted.
3644         (MediaController::play): Deleted.
3645         (MediaController::pause): Deleted.
3646         (MediaController::setDefaultPlaybackRate): Deleted.
3647         (MediaController::playbackRate const): Deleted.
3648         (MediaController::setPlaybackRate): Deleted.
3649         (MediaController::setVolume): Deleted.
3650         (MediaController::setMuted): Deleted.
3651         (playbackStateWaiting): Deleted.
3652         (playbackStatePlaying): Deleted.
3653         (playbackStateEnded): Deleted.
3654         (MediaController::playbackState const): Deleted.
3655         (MediaController::reportControllerState): Deleted.
3656         (eventNameForReadyState): Deleted.
3657         (MediaController::updateReadyState): Deleted.
3658         (MediaController::updatePlaybackState): Deleted.
3659         (MediaController::updateMediaElements): Deleted.
3660         (MediaController::bringElementUpToSpeed): Deleted.
3661         (MediaController::isBlocked const): Deleted.
3662         (MediaController::hasEnded const): Deleted.
3663         (MediaController::scheduleEvent): Deleted.
3664         (MediaController::asyncEventTimerFired): Deleted.
3665         (MediaController::clearPositionTimerFired): Deleted.
3666         (MediaController::hasAudio const): Deleted.
3667         (MediaController::hasVideo const): Deleted.
3668         (MediaController::hasClosedCaptions const): Deleted.
3669         (MediaController::setClosedCaptionsVisible): Deleted.
3670         (MediaController::supportsScanning const): Deleted.
3671         (MediaController::beginScrubbing): Deleted.
3672         (MediaController::endScrubbing): Deleted.
3673         (MediaController::beginScanning): Deleted.
3674         (MediaController::endScanning): Deleted.
3675         (MediaController::canPlay const): Deleted.
3676         (MediaController::isLiveStream const): Deleted.
3677         (MediaController::hasCurrentSrc const): Deleted.
3678         (MediaController::returnToRealtime): Deleted.
3679         (MediaController::startTimeupdateTimer): Deleted.
3680         (MediaController::scheduleTimeupdateEvent): Deleted.
3681         * html/MediaDocument.cpp:
3682         * html/MediaDocument.h:
3683         * html/PluginDocument.cpp:
3684         * html/PluginDocument.h:
3685         * html/RubyElement.cpp:
3686         * html/RubyElement.h:
3687         * html/RubyTextElement.cpp:
3688         * html/RubyTextElement.h:
3689         * html/TextDocument.cpp:
3690         * html/TextDocument.h:
3691         * html/shadow/AutoFillButtonElement.cpp:
3692         * html/shadow/AutoFillButtonElement.h:
3693         * html/shadow/DetailsMarkerControl.cpp:
3694         * html/shadow/DetailsMarkerControl.h:
3695         * html/shadow/ImageControlsRootElement.cpp:
3696         * html/shadow/ImageControlsRootElement.h:
3697         * html/shadow/MediaControlElementTypes.cpp:
3698         * html/shadow/MediaControlElementTypes.h:
3699         * html/shadow/MediaControlElements.cpp:
3700         * html/shadow/MediaControlElements.h:
3701         * html/shadow/MediaControls.cpp:
3702         * html/shadow/MediaControls.h:
3703         * html/shadow/ProgressShadowElement.cpp:
3704         * html/shadow/ProgressShadowElement.h:
3705         * html/shadow/SliderThumbElement.cpp:
3706         * html/shadow/SliderThumbElement.h:
3707         * html/shadow/SpinButtonElement.cpp:
3708         * html/shadow/SpinButtonElement.h:
3709         * html/shadow/TextControlInnerElements.cpp:
3710         * html/shadow/TextControlInnerElements.h:
3711         * html/shadow/YouTubeEmbedShadowElement.cpp:
3712         * html/shadow/YouTubeEmbedShadowElement.h:
3713         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
3714         * html/shadow/mac/ImageControlsButtonElementMac.h:
3715         * html/shadow/mac/ImageControlsRootElementMac.cpp:
3716         * html/shadow/mac/ImageControlsRootElementMac.h:
3717         * html/track/TextTrackCueGeneric.cpp:
3718         * html/track/VTTCue.cpp:
3719         * html/track/VTTCue.h:
3720         * html/track/WebVTTElement.cpp:
3721         * html/track/WebVTTElement.h:
3722         * loader/SinkDocument.cpp:
3723         * loader/SinkDocument.h:
3724         * mathml/MathMLAnnotationElement.cpp:
3725         * mathml/MathMLAnnotationElement.h:
3726         * mathml/MathMLElement.cpp:
3727         * mathml/MathMLElement.h:
3728         * mathml/MathMLFractionElement.cpp:
3729         * mathml/MathMLFractionElement.h:
3730         * mathml/MathMLMathElement.cpp:
3731         * mathml/MathMLMathElement.h:
3732         * mathml/MathMLMencloseElement.cpp:
3733         * mathml/MathMLMencloseElement.h:
3734         * mathml/MathMLOperatorElement.cpp:
3735         * mathml/MathMLOperatorElement.h:
3736         * mathml/MathMLPaddedElement.cpp:
3737         * mathml/MathMLPaddedElement.h:
3738         * mathml/MathMLPresentationElement.cpp:
3739         * mathml/MathMLPresentationElement.h:
3740         * mathml/MathMLRootElement.cpp:
3741         * mathml/MathMLRootElement.h:
3742         * mathml/MathMLRowElement.cpp:
3743         * mathml/MathMLRowElement.h:
3744         * mathml/MathMLScriptsElement.cpp:
3745         * mathml/MathMLScriptsElement.h:
3746         * mathml/MathMLSelectElement.cpp:
3747         * mathml/MathMLSelectElement.h:
3748         * mathml/MathMLSpaceElement.cpp:
3749         * mathml/MathMLSpaceElement.h:
3750         * mathml/MathMLTokenElement.cpp:
3751         * mathml/MathMLTokenElement.h:
3752         * mathml/MathMLUnderOverElement.cpp:
3753         * mathml/MathMLUnderOverElement.h:
3754         * mathml/MathMLUnknownElement.cpp: Added.
3755         * mathml/MathMLUnknownElement.h:
3756         * svg/SVGAElement.cpp:
3757         * svg/SVGAElement.h:
3758         * svg/SVGAltGlyphDefElement.cpp:
3759         * svg/SVGAltGlyphDefElement.h:
3760         * svg/SVGAltGlyphElement.cpp:
3761         * svg/SVGAltGlyphElement.h:
3762         * svg/SVGAltGlyphItemElement.cpp:
3763         * svg/SVGAltGlyphItemElement.h:
3764         * svg/SVGAnimateColorElement.cpp:
3765         * svg/SVGAnimateColorElement.h:
3766         * svg/SVGAnimateElement.cpp:
3767         * svg/SVGAnimateElement.h:
3768         * svg/SVGAnimateElementBase.cpp:
3769         * svg/SVGAnimateElementBase.h:
3770         * svg/SVGAnimateMotionElement.cpp:
3771         * svg/SVGAnimateMotionElement.h:
3772         * svg/SVGAnimateTransformElement.cpp:
3773         * svg/SVGAnimateTransformElement.h:
3774         * svg/SVGAnimationElement.cpp:
3775         * svg/SVGAnimationElement.h:
3776         * svg/SVGCircleElement.cpp:
3777         * svg/SVGCircleElement.h:
3778         * svg/SVGClipPathElement.cpp:
3779         * svg/SVGClipPathElement.h:
3780         * svg/SVGComponentTransferFunctionElement.cpp:
3781         * svg/SVGComponentTransferFunctionElement.h:
3782         * svg/SVGCursorElement.cpp:
3783         * svg/SVGCursorElement.h:
3784         * svg/SVGDefsElement.cpp:
3785         * svg/SVGDefsElement.h:
3786         * svg/SVGDescElement.cpp:
3787         * svg/SVGDescElement.h:
3788         * svg/SVGDocument.cpp:
3789         * svg/SVGDocument.h:
3790         * svg/SVGElement.cpp:
3791         * svg/SVGElement.h:
3792         * svg/SVGEllipseElement.cpp:
3793         * svg/SVGEllipseElement.h:
3794         * svg/SVGFEBlendElement.cpp:
3795         * svg/SVGFEBlendElement.h:
3796         * svg/SVGFEColorMatrixElement.cpp:
3797         * svg/SVGFEColorMatrixElement.h:
3798         * svg/SVGFEComponentTransferElement.cpp:
3799         * svg/SVGFEComponentTransferElement.h:
3800         * svg/SVGFECompositeElement.cpp:
3801         * svg/SVGFECompositeElement.h:
3802         * svg/SVGFEConvolveMatrixElement.cpp:
3803         * svg/SVGFEConvolveMatrixElement.h:
3804         * svg/SVGFEDiffuseLightingElement.cpp:
3805         * svg/SVGFEDiffuseLightingElement.h:
3806         * svg/SVGFEDisplacementMapElement.cpp:
3807         * svg/SVGFEDisplacementMapElement.h:
3808         * svg/SVGFEDropShadowElement.cpp:
3809         * svg/SVGFEDropShadowElement.h:
3810         * svg/SVGFEFloodElement.cpp:
3811         * svg/SVGFEFloodElement.h:
3812         * svg/SVGFEGaussianBlurElement.cpp:
3813         * svg/SVGFEGaussianBlurElement.h:
3814         * svg/SVGFEImageElement.cpp:
3815         * svg/SVGFEImageElement.h:
3816         * svg/SVGFELightElement.cpp:
3817         * svg/SVGFELightElement.h:
3818         * svg/SVGFEMergeElement.cpp:
3819         * svg/SVGFEMergeElement.h:
3820         * svg/SVGFEMergeNodeElement.cpp:
3821         * svg/SVGFEMergeNodeElement.h:
3822         * svg/SVGFEMorphologyElement.cpp:
3823         * svg/SVGFEMorphologyElement.h:
3824         * svg/SVGFEOffsetElement.cpp:
3825         * svg/SVGFEOffsetElement.h:
3826         * svg/SVGFESpecularLightingElement.cpp:
3827         * svg/SVGFESpecularLightingElement.h:
3828         * svg/SVGFETileElement.cpp:
3829         * svg/SVGFETileElement.h:
3830         * svg/SVGFETurbulenceElement.cpp:
3831         * svg/SVGFETurbulenceElement.h:
3832         * svg/SVGFilterElement.cpp:
3833         * svg/SVGFilterElement.h:
3834         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
3835         * svg/SVGFilterPrimitiveStandardAttributes.h:
3836         * svg/SVGFontFaceElement.cpp:
3837         * svg/SVGFontFaceElement.h:
3838         * svg/SVGFontFaceFormatElement.cpp:
3839         * svg/SVGFontFaceFormatElement.h:
3840         * svg/SVGFontFaceNameElement.cpp:
3841         * svg/SVGFontFaceNameElement.h:
3842         * svg/SVGFontFaceSrcElement.cpp:
3843         * svg/SVGFontFaceSrcElement.h:
3844         * svg/SVGFontFaceUriElement.cpp:
3845         * svg/SVGFontFaceUriElement.h:
3846         * svg/SVGForeignObjectElement.cpp:
3847         * svg/SVGForeignObjectElement.h:
3848         * svg/SVGGElement.cpp:
3849         * svg/SVGGElement.h:
3850         * svg/SVGGlyphElement.cpp:
3851         * svg/SVGGlyphElement.h:
3852         * svg/SVGGlyphRefElement.cpp:
3853         * svg/SVGGlyphRefElement.h:
3854         * svg/SVGGradientElement.cpp:
3855         * svg/SVGGradientElement.h:
3856         * svg/SVGGraphicsElement.cpp:
3857         * svg/SVGGraphicsElement.h:
3858         * svg/SVGHKernElement.cpp:
3859         * svg/SVGHKernElement.h:
3860         * svg/SVGImageElement.cpp:
3861         * svg/SVGImageElement.h:
3862         * svg/SVGLineElement.cpp:
3863         * svg/SVGLineElement.h:
3864         * svg/SVGLinearGradientElement.cpp:
3865         * svg/SVGLinearGradientElement.h:
3866         * svg/SVGMPathElement.cpp:
3867         * svg/SVGMPathElement.h:
3868         * svg/SVGMarkerElement.cpp:
3869         * svg/SVGMarkerElement.h:
3870         * svg/SVGMaskElement.cpp:
3871         * svg/SVGMaskElement.h:
3872         * svg/SVGMetadataElement.cpp:
3873         * svg/SVGMetadataElement.h:
3874         * svg/SVGMissingGlyphElement.cpp:
3875         * svg/SVGMissingGlyphElement.h:
3876         * svg/SVGPathElement.cpp:
3877         * svg/SVGPathElement.h:
3878         * svg/SVGPatternElement.cpp:
3879         * svg/SVGPatternElement.h:
3880         * svg/SVGPolyElement.cpp:
3881         * svg/SVGPolyElement.h:
3882         * svg/SVGPolygonElement.cpp:
3883         * svg/SVGPolygonElement.h:
3884         * svg/SVGPolylineElement.cpp:
3885         * svg/SVGPolylineElement.h:
3886         * svg/SVGRadialGradientElement.cpp:
3887         * svg/SVGRadialGradientElement.h:
3888         * svg/SVGRectElement.cpp:
3889         * svg/SVGRectElement.h:
3890         * svg/SVGSVGElement.cpp:
3891         * svg/SVGSVGElement.h:
3892         * svg/SVGScriptElement.cpp:
3893         * svg/SVGScriptElement.h:
3894         * svg/SVGSetElement.cpp:
3895         * svg/SVGSetElement.h:
3896         * svg/SVGStopElement.cpp:
3897         * svg/SVGStopElement.h:
3898         * svg/SVGStyleElement.cpp:
3899         * svg/SVGStyleElement.h:
3900         * svg/SVGSwitchElement.cpp:
3901         * svg/SVGSwitchElement.h:
3902         * svg/SVGSymbolElement.cpp:
3903         * svg/SVGSymbolElement.h:
3904         * svg/SVGTRefElement.cpp:
3905         * svg/SVGTRefElement.h:
3906         * svg/SVGTSpanElement.cpp:
3907         * svg/SVGTSpanElement.h:
3908         * svg/SVGTextContentElement.cpp:
3909         * svg/SVGTextContentElement.h:
3910         * svg/SVGTextElement.cpp:
3911         * svg/SVGTextElement.h:
3912         * svg/SVGTextPathElement.cpp:
3913         * svg/SVGTextPathElement.h:
3914         * svg/SVGTextPositioningElement.cpp:
3915         * svg/SVGTextPositioningElement.h:
3916         * svg/SVGTitleElement.cpp:
3917         * svg/SVGTitleElement.h:
3918         * svg/SVGUnknownElement.cpp: Added.
3919         * svg/SVGUnknownElement.h:
3920         * svg/SVGUseElement.cpp:
3921         * svg/SVGUseElement.h:
3922         * svg/SVGVKernElement.cpp:
3923         * svg/SVGVKernElement.h:
3924         * svg/SVGViewElement.cpp:
3925         * svg/SVGViewElement.h:
3926         * svg/animation/SVGSMILElement.cpp:
3927         * svg/animation/SVGSMILElement.h:
3928
3929 2018-03-16  Youenn Fablet  <youenn@apple.com>
3930
3931         Ensure Document::responseReceived and clearResource are called on the main thread
3932         https://bugs.webkit.org/show_bug.cgi?id=183709
3933
3934         Reviewed by Chris Dumez.
3935
3936         No change of behavior.
3937
3938         * loader/DocumentLoader.cpp:
3939         (WebCore::DocumentLoader::responseReceived):
3940         (WebCore::DocumentLoader::clearMainResource):
3941
3942 2018-03-16  Chris Dumez  <cdumez@apple.com>
3943
3944         WebKit.WebsitePoliciesAutoplayQuirks API test times out with async policy delegates
3945         https://bugs.webkit.org/show_bug.cgi?id=183702
3946
3947         Reviewed by Alex Christensen.
3948
3949         The issue is that the test calls loadHTMLString then loadRequest right after, without
3950         waiting for the first load to complete first. loadHTMLString is special as it relies
3951         on substitute data and which schedules a timer to commit the data. When doing the
3952         navigation policy check for the following loadRequest(), the substitute data timer
3953         would fire and commit its data and load. This would in turn cancel the pending
3954         navigation policy check for the loadRequest().
3955
3956         With sync policy delegates, this is not an issue because we take care of stopping
3957         all loaders when receiving the policy decision, which happens synchronously. However,