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