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