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