Unreviewed, rolling out r245068.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-05-08  Ryan Haddad  <ryanhaddad@apple.com>
2
3         Unreviewed, rolling out r245068.
4
5         Caused debug layout tests to exit early due to an assertion
6         failure.
7
8         Reverted changeset:
9
10         "All prototypes should call didBecomePrototype()"
11         https://bugs.webkit.org/show_bug.cgi?id=196315
12         https://trac.webkit.org/changeset/245068
13
14 2019-05-08  Megan Gardner  <megan_gardner@apple.com>
15
16         Add quirks to emulate undo and redo in hidden editable areas on some websites
17         https://bugs.webkit.org/show_bug.cgi?id=197452
18
19         Reviewed by Alex Christensen.
20
21         UI change, not testable.
22
23         We need to send synthetic keyboard events to the web process to emulate undo and redo
24         key combinations for when we are trying to get our undo and redo UI to work
25         on rich editing websites that only listen to keystrokes, and don't let us use our
26         undo manager to help manage the input content.
27
28         * page/EventHandler.cpp:
29         (WebCore::EventHandler::keyEvent):
30         * platform/PlatformKeyboardEvent.h:
31         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
32         (WebCore::PlatformKeyboardEvent::isSyntheticEvent):
33         (WebCore::PlatformKeyboardEvent::setSyntheticEvent):
34         * platform/ios/KeyEventIOS.mm:
35         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
36         * platform/ios/PlatformEventFactoryIOS.mm:
37         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
38         * platform/mac/PlatformEventFactoryMac.mm:
39         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
40
41 2019-05-08  Don Olmstead  <don.olmstead@sony.com>
42
43         CSSFontFaceSource fails to compile when !ENABLE(SVG_FONTS)
44         https://bugs.webkit.org/show_bug.cgi?id=197720
45
46         Unreviewed build fix.
47
48         Add usesInDocumentSVGFont to the !ENABLE(SVG_FONT) path.
49
50         * css/CSSFontFaceSource.cpp:
51         (WebCore::CSSFontFaceSource::font):
52
53 2019-05-08  Timothy Hatcher  <timothy@apple.com>
54
55         Add plumbing for inactive system colors in RenderTheme cache.
56         https://bugs.webkit.org/show_bug.cgi?id=197699
57         rdar://problem/49406936
58
59         Reviewed by Tim Horton.
60
61         * css/StyleColor.h:
62         * page/Page.cpp:
63         (WebCore::Page::effectiveAppearanceDidChange): Renamed from setUseDarkAppearance.
64         * page/Page.h:
65         (WebCore::Page::useInactiveAppearance const):
66         * rendering/RenderTheme.cpp:
67         (WebCore::RenderTheme::purgeCaches):
68         (WebCore::RenderTheme::platformColorsDidChange):
69         (WebCore::RenderTheme::colorCache const):
70         * rendering/RenderTheme.h:
71         * testing/InternalSettings.cpp:
72         (WebCore::InternalSettings::setUseDarkAppearanceInternal):
73
74 2019-05-08  Robin Morisset  <rmorisset@apple.com>
75
76         All prototypes should call didBecomePrototype()
77         https://bugs.webkit.org/show_bug.cgi?id=196315
78
79         Reviewed by Saam Barati.
80
81         This changelog already landed, but the commit was missing the actual changes.
82
83         It was found by existing tests, with the new assert in JSC::Structure
84
85         * bindings/js/JSWindowProxy.cpp:
86         (WebCore::JSWindowProxy::setWindow):
87         * bindings/scripts/CodeGeneratorJS.pm:
88         (GeneratePrototypeDeclaration):
89         (GenerateConstructorHelperMethods):
90         * bindings/scripts/test/JS/JSInterfaceName.cpp:
91         (WebCore::JSInterfaceNamePrototype::JSInterfaceNamePrototype):
92         * bindings/scripts/test/JS/JSMapLike.cpp:
93         (WebCore::JSMapLikePrototype::JSMapLikePrototype):
94         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
95         (WebCore::JSReadOnlyMapLikePrototype::JSReadOnlyMapLikePrototype):
96         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
97         (WebCore::JSTestActiveDOMObjectPrototype::JSTestActiveDOMObjectPrototype):
98         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
99         (WebCore::JSTestCEReactionsPrototype::JSTestCEReactionsPrototype):
100         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
101         (WebCore::JSTestCEReactionsStringifierPrototype::JSTestCEReactionsStringifierPrototype):
102         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
103         (WebCore::JSTestCallTracerPrototype::JSTestCallTracerPrototype):
104         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
105         (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::JSTestClassWithJSBuiltinConstructorPrototype):
106         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
107         (WebCore::JSTestDOMJITPrototype::JSTestDOMJITPrototype):
108         (WebCore::JSTestDOMJITConstructor::prototypeForStructure):
109         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
110         (WebCore::JSTestEnabledBySettingPrototype::JSTestEnabledBySettingPrototype):
111         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
112         (WebCore::JSTestEventConstructorPrototype::JSTestEventConstructorPrototype):
113         (WebCore::JSTestEventConstructorConstructor::prototypeForStructure):
114         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
115         (WebCore::JSTestEventTargetPrototype::JSTestEventTargetPrototype):
116         (WebCore::JSTestEventTargetConstructor::prototypeForStructure):
117         * bindings/scripts/test/JS/JSTestException.cpp:
118         (WebCore::JSTestExceptionPrototype::JSTestExceptionPrototype):
119         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
120         (WebCore::JSTestGenerateIsReachablePrototype::JSTestGenerateIsReachablePrototype):
121         * bindings/scripts/test/JS/JSTestGlobalObject.h:
122         (WebCore::JSTestGlobalObjectPrototype::JSTestGlobalObjectPrototype):
123         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
124         (WebCore::JSTestIndexedSetterNoIdentifierPrototype::JSTestIndexedSetterNoIdentifierPrototype):
125         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
126         (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::JSTestIndexedSetterThrowingExceptionPrototype):
127         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
128         (WebCore::JSTestIndexedSetterWithIdentifierPrototype::JSTestIndexedSetterWithIdentifierPrototype):
129         * bindings/scripts/test/JS/JSTestInterface.cpp:
130         (WebCore::JSTestInterfacePrototype::JSTestInterfacePrototype):
131         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
132         (WebCore::JSTestInterfaceLeadingUnderscorePrototype::JSTestInterfaceLeadingUnderscorePrototype):
133         * bindings/scripts/test/JS/JSTestIterable.cpp:
134         (WebCore::JSTestIterablePrototype::JSTestIterablePrototype):
135         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
136         (WebCore::JSTestJSBuiltinConstructorPrototype::JSTestJSBuiltinConstructorPrototype):
137         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
138         (WebCore::JSTestMediaQueryListListenerPrototype::JSTestMediaQueryListListenerPrototype):
139         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
140         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::JSTestNamedAndIndexedSetterNoIdentifierPrototype):
141         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
142         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::JSTestNamedAndIndexedSetterThrowingExceptionPrototype):
143         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
144         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::JSTestNamedAndIndexedSetterWithIdentifierPrototype):
145         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
146         (WebCore::JSTestNamedConstructorPrototype::JSTestNamedConstructorPrototype):
147         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
148         (WebCore::JSTestNamedDeleterNoIdentifierPrototype::JSTestNamedDeleterNoIdentifierPrototype):
149         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
150         (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::JSTestNamedDeleterThrowingExceptionPrototype):
151         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
152         (WebCore::JSTestNamedDeleterWithIdentifierPrototype::JSTestNamedDeleterWithIdentifierPrototype):
153         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
154         (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::JSTestNamedDeleterWithIndexedGetterPrototype):
155         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
156         (WebCore::JSTestNamedGetterCallWithPrototype::JSTestNamedGetterCallWithPrototype):
157         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
158         (WebCore::JSTestNamedGetterNoIdentifierPrototype::JSTestNamedGetterNoIdentifierPrototype):
159         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
160         (WebCore::JSTestNamedGetterWithIdentifierPrototype::JSTestNamedGetterWithIdentifierPrototype):
161         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
162         (WebCore::JSTestNamedSetterNoIdentifierPrototype::JSTestNamedSetterNoIdentifierPrototype):
163         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
164         (WebCore::JSTestNamedSetterThrowingExceptionPrototype::JSTestNamedSetterThrowingExceptionPrototype):
165         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
166         (WebCore::JSTestNamedSetterWithIdentifierPrototype::JSTestNamedSetterWithIdentifierPrototype):
167         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
168         (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::JSTestNamedSetterWithIndexedGetterPrototype):
169         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
170         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::JSTestNamedSetterWithIndexedGetterAndSetterPrototype):
171         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
172         (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::JSTestNamedSetterWithOverrideBuiltinsPrototype):
173         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
174         (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::JSTestNamedSetterWithUnforgablePropertiesPrototype):
175         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
176         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype):
177         * bindings/scripts/test/JS/JSTestNode.cpp:
178         (WebCore::JSTestNodePrototype::JSTestNodePrototype):
179         (WebCore::JSTestNodeConstructor::prototypeForStructure):
180         * bindings/scripts/test/JS/JSTestObj.cpp:
181         (WebCore::JSTestObjPrototype::JSTestObjPrototype):
182         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
183         (WebCore::JSTestOverloadedConstructorsPrototype::JSTestOverloadedConstructorsPrototype):
184         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
185         (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::JSTestOverloadedConstructorsWithSequencePrototype):
186         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
187         (WebCore::JSTestOverrideBuiltinsPrototype::JSTestOverrideBuiltinsPrototype):
188         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
189         (WebCore::JSTestPluginInterfacePrototype::JSTestPluginInterfacePrototype):
190         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
191         (WebCore::JSTestPromiseRejectionEventPrototype::JSTestPromiseRejectionEventPrototype):
192         (WebCore::JSTestPromiseRejectionEventConstructor::prototypeForStructure):
193         * bindings/scripts/test/JS/JSTestSerialization.cpp:
194         (WebCore::JSTestSerializationPrototype::JSTestSerializationPrototype):
195         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
196         (WebCore::JSTestSerializationIndirectInheritancePrototype::JSTestSerializationIndirectInheritancePrototype):
197         (WebCore::JSTestSerializationIndirectInheritanceConstructor::prototypeForStructure):
198         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
199         (WebCore::JSTestSerializationInheritPrototype::JSTestSerializationInheritPrototype):
200         (WebCore::JSTestSerializationInheritConstructor::prototypeForStructure):
201         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
202         (WebCore::JSTestSerializationInheritFinalPrototype::JSTestSerializationInheritFinalPrototype):
203         (WebCore::JSTestSerializationInheritFinalConstructor::prototypeForStructure):
204         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
205         (WebCore::JSTestSerializedScriptValueInterfacePrototype::JSTestSerializedScriptValueInterfacePrototype):
206         * bindings/scripts/test/JS/JSTestStringifier.cpp:
207         (WebCore::JSTestStringifierPrototype::JSTestStringifierPrototype):
208         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
209         (WebCore::JSTestStringifierAnonymousOperationPrototype::JSTestStringifierAnonymousOperationPrototype):
210         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
211         (WebCore::JSTestStringifierNamedOperationPrototype::JSTestStringifierNamedOperationPrototype):
212         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
213         (WebCore::JSTestStringifierOperationImplementedAsPrototype::JSTestStringifierOperationImplementedAsPrototype):
214         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
215         (WebCore::JSTestStringifierOperationNamedToStringPrototype::JSTestStringifierOperationNamedToStringPrototype):
216         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
217         (WebCore::JSTestStringifierReadOnlyAttributePrototype::JSTestStringifierReadOnlyAttributePrototype):
218         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
219         (WebCore::JSTestStringifierReadWriteAttributePrototype::JSTestStringifierReadWriteAttributePrototype):
220         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
221         (WebCore::JSTestTypedefsPrototype::JSTestTypedefsPrototype):
222
223 2019-05-08  Don Olmstead  <don.olmstead@sony.com>
224
225         WEBCORE_EXPORT shouldn't be on the class and its methods
226         https://bugs.webkit.org/show_bug.cgi?id=197681
227
228         Reviewed by Simon Fraser.
229
230         Remove WEBCORE_EXPORT from the methods.
231
232         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
233         * page/scrolling/ScrollingTreeScrollingNode.h:
234
235 2019-05-08  Wenson Hsieh  <wenson_hsieh@apple.com>
236
237         [iOS] Add a quirk to synthesize mouse events when modifying the selection
238         https://bugs.webkit.org/show_bug.cgi?id=197683
239         <rdar://problem/48003980>
240
241         Reviewed by Tim Horton.
242
243         See WebKit ChangeLog for more details.
244
245         Test: editing/selection/ios/dispatch-mouse-events-when-modifying-selection-quirk.html
246
247         * page/EventHandler.cpp:
248         (WebCore::EventHandler::handleMousePressEvent):
249         (WebCore::EventHandler::supportsSelectionUpdatesOnMouseDrag const):
250
251         Add some platform hooks to prevent mousemove events from updating the selection on iOS.
252
253         (WebCore::EventHandler::shouldAllowMouseDownToStartDrag const):
254
255         Add some platform hooks to prevent drag and drop from kicking in when sending synthetic mousemove events to the
256         page on iOS (drag and drop is instead triggered by EventHandler::tryToBeginDragAtPoint).
257
258         (WebCore::EventHandler::updateSelectionForMouseDrag):
259         * page/EventHandler.h:
260         * page/Quirks.cpp:
261         (WebCore::Quirks::shouldDispatchSyntheticMouseEventsWhenModifyingSelection const):
262         * page/Quirks.h:
263
264         Add the new site-specific quirk.
265
266         * page/Settings.yaml:
267         * page/ios/EventHandlerIOS.mm:
268         (WebCore::EventHandler::tryToBeginDragAtPoint):
269         (WebCore::EventHandler::supportsSelectionUpdatesOnMouseDrag const):
270         (WebCore::EventHandler::shouldAllowMouseDownToStartDrag const):
271         * testing/InternalSettings.cpp:
272         (WebCore::InternalSettings::Backup::Backup):
273         (WebCore::InternalSettings::Backup::restoreTo):
274         (WebCore::InternalSettings::setShouldDispatchSyntheticMouseEventsWhenModifyingSelection):
275         * testing/InternalSettings.h:
276         * testing/InternalSettings.idl:
277
278         Add an internal settings hook to opt into this quirk, for use in layout tests.
279
280 2019-05-08  Simon Fraser  <simon.fraser@apple.com>
281
282         Implement backing-sharing in compositing layers, allowing overlap layers to paint into the backing store of another layer
283         https://bugs.webkit.org/show_bug.cgi?id=197561
284         <rdar://problem/50445998>
285
286         Reviewed by Antti Koivisto.
287
288         This change introduces the concept of layers that share backing store for compositing. A layer
289         which is sharing its backing store first paints itself, and then some set of layers which come
290         later in paint order in the same stacking context. This reduces the composited layer count in
291         some overflow scrolling scenarios, thereby also simplifying the scrolling tree.
292         
293         A backing-shared layer stores a vector of "sharing" RenderLayer* in its RenderLayerBacking. At
294         paint time, the owning layer is painted, then the sharing layers, setting the owning layer as the
295         painting root so that positioning and clipping just work.
296         
297         Sharing layer relationships are constructed in RenderLayerCompositor::computeCompositingRequirements().
298         We track the last layer which was composited in paint order as a shared candidate. If a later layer
299         would composite for overlap (and no other reasons), then we allow it to share with the candidate
300         if the candidate is in its ancestor containing block chain. Sharing is currently limited to layers
301         in the same stacking context.
302         
303         isComposited() returns false for sharing layers, but they are like composited layers in that
304         they behave as painting boundaries, so RenderLayer::paintLayer() needs to stop at them,
305         and repaints in shared layers have to be directed to their shared layer, hence
306         changes to RenderLayer::clippingRootForPainting() and RenderLayer::enclosingCompositingLayerForRepaint().
307         
308         The clipping boundary logic in RenderLayer::backgroundClipRect() needed to be generalized so that
309         all calls to RenderLayer::parentClipRects() check for crossing painting boundaries and use
310         TemporaryClipRects in that case.
311
312         Tests: compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller.html
313                compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller.html
314                compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html
315                compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html
316                compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping.html
317                compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping.html
318                compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll.html
319                compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content.html
320                compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip.html
321                compositing/shared-backing/overflow-scroll/shared-layer-clipping.html
322                compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds.html
323                compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking.html
324                compositing/shared-backing/overflow-scroll/shared-layer-repaint.html
325                compositing/shared-backing/partial-compositing-update.html
326                compositing/shared-backing/partial-compositing-update2.html
327                compositing/shared-backing/remove-sharing-layer.html
328                compositing/shared-backing/sharing-cached-clip-rects.html
329
330         * rendering/RenderLayer.cpp:
331         (WebCore::RenderLayer::~RenderLayer):
332         (WebCore::RenderLayer::ancestorLayerIsInContainingBlockChain const):
333         (WebCore::RenderLayer::setBackingProviderLayer):
334         (WebCore::RenderLayer::disconnectFromBackingProviderLayer):
335         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
336         (WebCore::RenderLayer::clippingRootForPainting const):
337         (WebCore::RenderLayer::clipToRect):
338         (WebCore::RenderLayer::paintLayer):
339         (WebCore::RenderLayer::updateClipRects):
340         (WebCore::RenderLayer::clipCrossesPaintingBoundary const):
341         (WebCore::RenderLayer::calculateClipRects const):
342         (WebCore::outputPaintOrderTreeLegend):
343         (WebCore::outputPaintOrderTreeRecursive):
344         (WebCore::inContainingBlockChain): Deleted.
345         * rendering/RenderLayer.h:
346         * rendering/RenderLayerBacking.cpp:
347         (WebCore::RenderLayerBacking::willBeDestroyed):
348         (WebCore::clearBackingSharingLayerProviders):
349         (WebCore::RenderLayerBacking::setBackingSharingLayers):
350         (WebCore::RenderLayerBacking::removeBackingSharingLayer):
351         (WebCore::RenderLayerBacking::clearBackingSharingLayers):
352         (WebCore::RenderLayerBacking::updateCompositedBounds):
353         (WebCore::RenderLayerBacking::updateDrawsContent):
354         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
355         (WebCore::RenderLayerBacking::paintIntoLayer):
356         (WebCore::RenderLayerBacking::paintContents):
357         * rendering/RenderLayerBacking.h:
358         * rendering/RenderLayerCompositor.cpp:
359         (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const):
360         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren):
361         (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree):
362         (WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate):
363         (WebCore::RenderLayerCompositor::updateCompositingLayers):
364         (WebCore::backingProviderLayerCanIncludeLayer):
365         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
366         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
367         (WebCore::RenderLayerCompositor::updateBacking):
368         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
369         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
370         * rendering/RenderLayerCompositor.h:
371         * rendering/RenderTreeAsText.cpp:
372
373 2019-05-08  Brent Fulgham  <bfulgham@apple.com>
374
375         Correct delayed load event handling
376         https://bugs.webkit.org/show_bug.cgi?id=197679
377         <rdar://problem/50423334>
378
379         Reviewed by Alex Christensen.
380
381         We need to properly account for the fact that JavaScript might run
382         while performing loads.
383
384         * dom/Document.cpp:
385         (WebCore::Document::loadEventDelayTimerFired):
386
387 2019-05-08  Philippe Normand  <pnormand@igalia.com>
388
389         REGRESSION(r243197): [GStreamer] Error playing redirected streams
390         https://bugs.webkit.org/show_bug.cgi?id=197410
391
392         Reviewed by Carlos Garcia Campos.
393
394         Revert the change introduced in r243197 that was checking the
395         redirected URI instead of the original URI. Non-main URIs should
396         be ignored only when they are HLS (or similar) fragments.
397
398         Test http/tests/security/canvas-remote-read-remote-video-hls.html still passes.
399
400         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
401         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
402
403 2019-05-08  Rob Buis  <rbuis@igalia.com>
404
405         Link prefetch not useful for top-level navigation
406         https://bugs.webkit.org/show_bug.cgi?id=195623
407
408         Reviewed by Youenn Fablet.
409
410         Cache cross-domain top-level prefetches in a dedicated cache and not in the
411         memory cache.
412
413         Tests: http/tests/cache/link-prefetch-main-resource-iframe.html
414                http/tests/cache/link-prefetch-main-resource.html
415                http/tests/contentextensions/prefetch-blocked.html
416
417         * loader/LinkLoader.cpp:
418         (WebCore::LinkLoader::prefetchIfNeeded):
419         * loader/ResourceLoadInfo.cpp:
420         (WebCore::toResourceType):
421
422 2019-05-07  Don Olmstead  <don.olmstead@sony.com>
423
424         Fix !HAVE(ACCESSIBILITY) build
425         https://bugs.webkit.org/show_bug.cgi?id=197680
426
427         Reviewed by Fujii Hironori.
428
429         * accessibility/AXObjectCache.h:
430         (WebCore::AXObjectCache::focusedUIElementForPage):
431         Update declaration for !HAVE(ACCESSIBILITY)
432         * accessibility/AccessibilityObject.h:
433         Add wrapper implementation for !HAVE(ACCESSIBILITY)
434         * accessibility/AccessibilityProgressIndicator.cpp:
435         (WebCore::AccessibilityProgressIndicator::roleValue const):
436         Add ENABLE(METER_ELEMENT) guard.
437
438 2019-05-07  Ryan Haddad  <ryanhaddad@apple.com>
439
440         Unreviewed, rolling out r245038.
441
442         Breaks internal builds.
443
444         Reverted changeset:
445
446         "Add SPI to set a list of hosts to which to send custom header
447         fields cross-origin"
448         https://bugs.webkit.org/show_bug.cgi?id=197397
449         https://trac.webkit.org/changeset/245038
450
451 2019-05-07  Jiewen Tan  <jiewen_tan@apple.com>
452
453         [WebAuthN] A new request should always suppress the pending request if any
454         https://bugs.webkit.org/show_bug.cgi?id=191517
455         <rdar://problem/46888222>
456
457         Reviewed by Brent Fulgham.
458
459         Blocking new requests from the same page when there is a pending request could DoS the
460         WebAuthN API in the period between [the page is refreshed, the pending request is
461         hanedled/timeout]. Therefore, the policy will be to always cancel any pending requests
462         whenever a new request is made. This will enforce the policy of handling only one
463         request at a time.
464
465         Covered by new tests in existing files.
466
467         * Modules/webauthn/AuthenticatorCoordinatorClient.cpp:
468         (WebCore::AuthenticatorCoordinatorClient::requestReply):
469         (WebCore::AuthenticatorCoordinatorClient::setRequestCompletionHandler):
470         (WebCore::AuthenticatorCoordinatorClient::addQueryCompletionHandler):
471         * Modules/webauthn/AuthenticatorCoordinatorClient.h:
472
473 2019-05-07  Eric Carlson  <eric.carlson@apple.com>
474
475         Define media buffering policy
476         https://bugs.webkit.org/show_bug.cgi?id=196979
477         <rdar://problem/28383861>
478
479         Reviewed by Jer Noble.
480
481         Test: MediaBufferingPolicy API test.
482
483         * html/HTMLMediaElement.cpp:
484         (WebCore::HTMLMediaElement::HTMLMediaElement):
485         (WebCore::HTMLMediaElement::suspend):
486         (WebCore::HTMLMediaElement::resume):
487         (WebCore::HTMLMediaElement::createMediaPlayer):
488         (WebCore::HTMLMediaElement::setBufferingPolicy):
489         (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
490         (WebCore::HTMLMediaElement::bufferingPolicy const):
491         (WebCore::HTMLMediaElement::setShouldBufferData): Deleted.
492         * html/HTMLMediaElement.h:
493         (WebCore::HTMLMediaElement::shouldBufferData const): Deleted.
494         * html/MediaElementSession.cpp:
495         (WebCore::MediaElementSession::updateClientDataBuffering):
496         (WebCore::MediaElementSession::preferredBufferingPolicy const):
497         (WebCore::MediaElementSession::dataBufferingPermitted const): Deleted.
498         * html/MediaElementSession.h:
499         * platform/graphics/MediaPlayer.cpp:
500         (WebCore::MediaPlayer::setBufferingPolicy):
501         (WebCore::convertEnumerationToString):
502         (WebCore::MediaPlayer::setShouldBufferData): Deleted.
503         * platform/graphics/MediaPlayer.h:
504         * platform/graphics/MediaPlayerEnums.h:
505         (WTF::LogArgument<WebCore::MediaPlayerEnums::BufferingPolicy>::toString):
506         * platform/graphics/MediaPlayerPrivate.h:
507         (WebCore::MediaPlayerPrivateInterface::setBufferingPolicy):
508         (WebCore::MediaPlayerPrivateInterface::setShouldBufferData): Deleted.
509         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
510         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
511         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
512         (WebCore::MediaPlayerPrivateAVFoundationObjC::setBufferingPolicy):
513         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData): Deleted.
514         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
515         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
516         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setBufferingPolicy):
517         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushAndRemoveVideoSampleBuffers): Deleted.
518         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setShouldBufferData): Deleted.
519         * testing/Internals.cpp:
520         (WebCore::Internals::elementShouldBufferData):
521         (WebCore::Internals::elementBufferingPolicy):
522         * testing/Internals.h:
523         * testing/Internals.idl:
524
525 2019-05-07  Alex Christensen  <achristensen@webkit.org>
526
527         Add SPI to set a list of hosts to which to send custom header fields cross-origin
528         https://bugs.webkit.org/show_bug.cgi?id=197397
529
530         Reviewed by Geoff Garen.
531
532         In r223001 I added the ability to send custom headers, but with a restriction that they will not be sent except to the origin of the main document.
533         We need the ability to specify what origins to send these headers to even if they are not first party requests.
534         We get this information in a list of strings which are the hosts to send the headers to.  Some of the strings have an asterisk at the beginning,
535         indicating that the headers are to be sent to all subdomains.
536
537         I repurposed some ObjC SPI that was never adopted, but I keep testing the C API that was to verify no regression.
538         I also added some new API tests for the new behavior.
539
540         * Sources.txt:
541         * WebCore.xcodeproj/project.pbxproj:
542         * loader/CustomHeaderFields.cpp: Added.
543         (WebCore::CustomHeaderFields::thirdPartyDomainsMatch const):
544         * loader/CustomHeaderFields.h: Added.
545         (WebCore::CustomHeaderFields::encode const):
546         (WebCore::CustomHeaderFields::decode):
547         * loader/DocumentLoader.cpp:
548         (WebCore::DocumentLoader::setCustomHeaderFields): Deleted.
549         * loader/DocumentLoader.h:
550         (WebCore::DocumentLoader::setCustomHeaderFields):
551         (WebCore::DocumentLoader::customHeaderFields const):
552         (WebCore::DocumentLoader::customHeaderFields): Deleted.
553         * loader/cache/CachedResourceLoader.cpp:
554         (WebCore::CachedResourceLoader::requestResource):
555
556 2019-05-07  Andy Estes  <aestes@apple.com>
557
558         run-bindings-tests should test global scope constructor generation
559         https://bugs.webkit.org/show_bug.cgi?id=197669
560
561         Reviewed by Alex Christensen.
562
563         For interfaces that are exposed on a global object, preprocess-idls.pl generates a partial
564         interface for the global object defining attributes for the interfaces' constructors. Most
565         interfaces don't specify a global object, so preprocess-idls.pl defaults to DOMWindow.
566         Since there is no DOMWindow.idl test case, we never generate the code for exposed interface
567         constructors when running bindings tests. This means that we can't test changes to how these
568         constructors are generated.
569
570         To fix this, teach preprocess-idls.pl to treat 'TestGlobalObject' as the default global
571         object when running bindings tests. This means that all exposed interface test cases will
572         generate their constructors as part of JSTestGlobalObject (unless otherwise specified
573         by the 'Exposed' extended attribute).
574
575         * bindings/scripts/preprocess-idls.pl:
576         Added --testGlobalContextName and --testGlobalScopeConstructorsFile arguments for use by
577         run-bindings-tests.
578
579         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
580         Updated expected results.
581
582 2019-05-07  Youenn Fablet  <youenn@apple.com>
583
584         Video stream freeze on front camera orientation changing
585         https://bugs.webkit.org/show_bug.cgi?id=197227
586         <rdar://problem/50175498>
587
588         Reviewed by Eric Carlson.
589
590         Use m_currentRotationSessionAngle instead of m_currentRotation to create or not a new rotation session.
591         Covered by updated test.
592
593         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
594         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
595         (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
596
597 2019-05-07  Youenn Fablet  <youenn@apple.com>
598
599         getUserMedia framerate unusable under low light in iOS 12.2
600         https://bugs.webkit.org/show_bug.cgi?id=196214
601         <rdar://problem/49232193>
602
603         Reviewed by Geoffrey Garen.
604
605         When setting the frame rate, set it to the exact value instead of a range.
606         Otherwise, the capture device might use the lowest frame rate according the light conditions
607         for best picture quality which is not what is expected by most web pages.
608
609         Move frame rate range computation to closer where actually used.
610         Since frame rate matching is fuzzy, add some checks in case the expected frame rate is slightly out of min/max range.
611
612         Manually tested on a real device.
613
614         * platform/mediastream/mac/AVVideoCaptureSource.mm:
615         (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
616
617 2019-05-07  Robin Morisset  <rmorisset@apple.com>
618
619         All prototypes should call didBecomePrototype()
620         https://bugs.webkit.org/show_bug.cgi?id=196315
621
622         Reviewed by Saam Barati.
623
624         It was found by existing tests, with the new assert in JSC::Structure
625
626         * bindings/js/JSWindowProxy.cpp:
627         (WebCore::JSWindowProxy::setWindow):
628         * bindings/scripts/CodeGeneratorJS.pm:
629         (GeneratePrototypeDeclaration):
630         (GenerateConstructorHelperMethods):
631
632 2019-05-07  John Wilander  <wilander@apple.com>
633
634         Storage Access API: Make two changes requested by developers and complete refactoring and cleanup
635         https://bugs.webkit.org/show_bug.cgi?id=197648
636         <rdar://problem/50527493>
637
638         Reviewed by Chris Dumez.
639
640         Developers have requested two minor changes to the Storage Access API:
641         - Only consume the user gesture when the user explicitly denies access.
642         - Make document.hasStorageAccess() return true instead of false when the feature is off.
643
644         In addition to this, we have refactoring and cleanup to do. Namely:
645         - Make use of WebCore::RegistrableDomain all the way.
646         - Remove dead code in WebKit::NetworkProcess since the calls now go through NetworkConnectionToWebProcess.
647         - Introduce boolean enums for state handling.
648         - Break out the Storage Access API functionality into a supplement of WebCore::Document.
649
650         Reviewed by Chris Dumez.
651
652         Tests: http/tests/storageAccess/deny-with-prompt-does-not-preserve-gesture.html
653                http/tests/storageAccess/deny-without-prompt-preserves-gesture.html
654                http/tests/storageAccess/grant-with-prompt-preserves-gesture.html
655                http/tests/storageAccess/has-storage-access-true-if-feature-off.html
656
657         * DerivedSources-input.xcfilelist:
658         * DerivedSources-output.xcfilelist:
659         * DerivedSources.make:
660         * Headers.cmake:
661         * Sources.txt:
662         * WebCore.xcodeproj/project.pbxproj:
663         * dom/Document.cpp:
664         (WebCore::Document::hasStorageAccess): Deleted.
665         (WebCore::Document::requestStorageAccess): Deleted.
666         (WebCore::Document::enableTemporaryTimeUserGesture): Deleted.
667         (WebCore::Document::consumeTemporaryTimeUserGesture): Deleted.
668         (WebCore::Document::hasFrameSpecificStorageAccess const): Deleted.
669         (WebCore::Document::setHasFrameSpecificStorageAccess): Deleted.
670         * dom/Document.h:
671         (WebCore::Document::setUserGrantsStorageAccessOverride): Deleted.
672             All of this has been moved to the supplement WebCore::DocumentStorageAccess.
673         * dom/Document.idl:
674             The Storage Access API has been moved to DocumentStorageAccess.idl.
675         * dom/DocumentStorageAccess.cpp: Added.
676         (WebCore::DocumentStorageAccess::from):
677         (WebCore::DocumentStorageAccess::supplementName):
678         (WebCore::DocumentStorageAccess::hasStorageAccess):
679         (WebCore::DocumentStorageAccess::requestStorageAccess):
680         (WebCore::DocumentStorageAccess::enableTemporaryTimeUserGesture):
681         (WebCore::DocumentStorageAccess::consumeTemporaryTimeUserGesture):
682         (WebCore::DocumentStorageAccess::hasFrameSpecificStorageAccess const):
683         (WebCore::DocumentStorageAccess::setHasFrameSpecificStorageAccess):
684         * dom/DocumentStorageAccess.h: Added.
685         * dom/DocumentStorageAccess.idl: Added.
686         * page/ChromeClient.h:
687         * testing/Internals.cpp:
688         (WebCore::Internals::setUserGrantsStorageAccess): Deleted.
689             This was dead code.
690         * testing/Internals.h:
691         * testing/Internals.idl:
692
693 2019-05-07  Antoine Quint  <graouts@apple.com>
694
695         [Pointer Events] isPrimary property of pointercancel events should match previous events for that pointer
696         https://bugs.webkit.org/show_bug.cgi?id=197665
697
698         Reviewed by Dean Jackson.
699
700         The test at web-platform-tests/pointerevents/pointerevent_pointercancel_touch.html would fail early because one of the first assertions
701         would check that isPrimary for a pointercancel event would match the isPrimary property of the previous pointer event dispatched for that
702         pointer id. This prevented many further assertions from passing and also was the cause of flakiness for the next test since this test was
703         ended early and the state of touches created using UIScriptController were not in a clean state.
704
705         We now track the isPrimary state for a given pointer using the CapturingData and use that value when dispatching a pointercancel event.
706
707         * dom/PointerEvent.cpp:
708         (WebCore::PointerEvent::create):
709         (WebCore::PointerEvent::PointerEvent):
710         * dom/PointerEvent.h:
711         * page/PointerCaptureController.cpp:
712         (WebCore::PointerCaptureController::pointerEventWasDispatched):
713         (WebCore::PointerCaptureController::cancelPointer):
714         * page/PointerCaptureController.h:
715
716 2019-05-07  Ryan Haddad  <ryanhaddad@apple.com>
717
718         Unreviewed, rolling out r244900.
719
720         Caused media/track/track-cue-missing.html to fail on debug
721         queues
722
723         Reverted changeset:
724
725         "Add logging for RenderLayer clip rects"
726         https://bugs.webkit.org/show_bug.cgi?id=197547
727         https://trac.webkit.org/changeset/244900
728
729 2019-05-07  Antti Koivisto  <antti@apple.com>
730
731         <body> with overflow:hidden CSS is scrollable on iOS
732         https://bugs.webkit.org/show_bug.cgi?id=153852
733         <rdar://problem/38715356>
734
735         Reviewed by Antoine Quint.
736
737         Tests: fast/scrolling/ios/body-overflow-hidden-frame.html
738                fast/scrolling/ios/body-overflow-hidden.html
739
740         * page/scrolling/ScrollingTreeScrollingNode.h:
741
742 2019-05-07  Antoine Quint  <graouts@apple.com>
743
744         Mouse event simulation should be limited to the graphing calculator on Desmos.com
745         https://bugs.webkit.org/show_bug.cgi?id=197652
746         <rdar://problem/47068176>
747
748         Reviewed by Antti Koivisto.
749
750         * page/Quirks.cpp:
751         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
752
753 2019-05-06  James Savage  <james.savage@apple.com>
754
755         Improve coordination for creating UIWindow instances.
756         https://bugs.webkit.org/show_bug.cgi?id=197578.
757         <rdar://problem/50456965>.
758
759         Reviewed by Wenson Hsieh.
760
761         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
762         (makeWindowFromView): Pull out window creation.
763         (VideoFullscreenInterfaceAVKit::doSetup): Call new helper function.
764
765 2019-05-06  Tim Horton  <timothy_horton@apple.com>
766
767         _overrideViewportWithArguments does not work when called before loading
768         https://bugs.webkit.org/show_bug.cgi?id=197638
769         <rdar://problem/50505111>
770
771         Reviewed by Wenson Hsieh.
772
773         * dom/Document.cpp:
774         (WebCore::Document::viewportArguments const):
775         (WebCore::Document::updateViewportArguments):
776         (WebCore::Document::setOverrideViewportArguments): Deleted.
777         * dom/Document.h:
778         (WebCore::Document::viewportArguments const): Deleted.
779         * page/Page.cpp:
780         (WebCore::Page::setOverrideViewportArguments):
781         * page/Page.h:
782         (WebCore::Page::overrideViewportArguments const):
783         * page/ViewportConfiguration.cpp:
784         (WebCore::ViewportConfiguration::setViewportArguments):
785         Move overrideViewportArguments to Page, since it is view-global in the API.
786
787 2019-05-06  Chris Dumez  <cdumez@apple.com>
788
789         Add assertions to JSLazyEventListener to help catch the cause of a crash
790         https://bugs.webkit.org/show_bug.cgi?id=197617
791
792         Reviewed by Alexey Proskuryakov.
793
794         Add assertions to JSLazyEventListener to help catch the cause of <rdar://problem/24314027>.
795
796         * bindings/js/JSLazyEventListener.cpp:
797         (WebCore::JSLazyEventListener::checkValidityForEventTarget):
798         * bindings/js/JSLazyEventListener.h:
799         * dom/EventListener.h:
800         (WebCore::EventListener::checkValidityForEventTarget):
801         * dom/EventTarget.cpp:
802         (WebCore::EventTarget::addEventListener):
803         (WebCore::EventTarget::setAttributeEventListener):
804         (WebCore::EventTarget::innerInvokeEventListeners):
805
806 2019-05-04  Per Arne Vollan  <pvollan@apple.com>
807
808         -[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:] doesn't delete _WKWebsiteDataTypeCredentials
809         https://bugs.webkit.org/show_bug.cgi?id=197510
810         <rdar://problem/50372338>
811
812         Reviewed by Alex Christensen.
813
814         This patch implements deletion of non persistent credentials for a set of origins. In order for this to work, fetching
815         credentials from the credential storage needs to return a set of SecurityOriginData objects, instead of a set of origin
816         strings. This is implemented by iterating over all the elements in the credential map, and creating a SecurityOriginData
817         object for each credential based on the protection space.
818
819         API test: WKWebsiteDataStore.RemoveNonPersistentCredentials
820
821         * platform/network/CredentialStorage.cpp:
822         (WebCore::CredentialStorage::removeCredentialsWithOrigin):
823         (WebCore::CredentialStorage::originsWithCredentials const):
824         * platform/network/CredentialStorage.h:
825         (WebCore::CredentialStorage::originsWithCredentials const): Deleted.
826
827 2019-05-06  Keith Rollin  <krollin@apple.com>
828
829         Temporarily disable generate-xcfilelists
830         https://bugs.webkit.org/show_bug.cgi?id=197619
831         <rdar://problem/50507392>
832
833         Reviewed by Alex Christensen.
834
835         We need to perform a significant update to the generate-xcfilelist
836         scripts. This work involves coordinated work with another facility. If
837         the work does not occur in tandem, the build will be broken. To avoid
838         this, disable the invoking of the scripts during the transition. The
839         checking will be restored once the new scripts are in place.
840
841         No new tests -- no change in user-visible functionality.
842
843         * Scripts/check-xcfilelists.sh:
844
845 2019-05-06  Andres Gonzalez  <andresg_22@apple.com>
846
847         Hitpoint for link which spans two lines in web content is incorrect
848         https://bugs.webkit.org/show_bug.cgi?id=197511
849         <rdar://problem/49971483>
850
851         Reviewed by Chris Fleizach.
852
853         - Special case for links to return first char location as clickPoint instead of middle point of bounding rect.
854         - Modified iOS ActivationPoint to use clickPoint. This way all code paths go through the same function.
855         - Made boundsForRects to return content coordinates in all platforms. Adjusted all callers, directly or indirectly, appropriately.
856
857         Tests: accessibility/ios-simulator/links-activation.html
858                accessibility/links-activation.html
859
860         * accessibility/AccessibilityRenderObject.cpp:
861         (WebCore::AccessibilityRenderObject::clickPoint):
862         (WebCore::AccessibilityRenderObject::boundsForRects):
863         (WebCore::AccessibilityRenderObject::boundsForRects const): Deleted.
864         * accessibility/AccessibilityRenderObject.h:
865         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
866         (-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
867         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
868         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
869
870 2019-05-06  Jer Noble  <jer.noble@apple.com>
871
872         Adopt AVStreamDataParser.audiovisualMIMETypes
873         https://bugs.webkit.org/show_bug.cgi?id=197581
874         <rdar://problem/50458981>
875
876         Reviewed by Eric Carlson.
877
878         Add a new singleton class, AVStreamDataParserMIMETypeCache, and rename AVFoundationMIMETypeCache to the more precise
879         AVAssetMIMETypeCache.  Update all the old AVFoundationMIMETypeCache with the new name.
880
881         * SourcesCocoa.txt:
882         * WebCore.xcodeproj/project.pbxproj:
883         * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h.
884         (WebCore::AVAssetMIMETypeCache::setCacheMIMETypesCallback):
885         * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm.
886         (WebCore::AVAssetMIMETypeCache::singleton):
887         (WebCore::AVAssetMIMETypeCache::setSupportedTypes):
888         (WebCore::AVAssetMIMETypeCache::types):
889         (WebCore::AVAssetMIMETypeCache::supportsContentType):
890         (WebCore::AVAssetMIMETypeCache::canDecodeType):
891         (WebCore::AVAssetMIMETypeCache::isAvailable const):
892         (WebCore::AVAssetMIMETypeCache::loadMIMETypes):
893         * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.h: Added.
894         * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm: Added.
895         (WebCore::AVStreamDataParserMIMETypeCache::singleton):
896         (WebCore::AVStreamDataParserMIMETypeCache::types):
897         (WebCore::AVStreamDataParserMIMETypeCache::supportsContentType):
898         (WebCore::AVStreamDataParserMIMETypeCache::canDecodeType):
899         (WebCore::AVStreamDataParserMIMETypeCache::isAvailable const):
900         (WebCore::AVStreamDataParserMIMETypeCache::loadMIMETypes):
901         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
902         (WebCore::ImageDecoderAVFObjC::create):
903         (WebCore::ImageDecoderAVFObjC::supportsMediaType):
904         (WebCore::ImageDecoderAVFObjC::supportsContentType):
905         (WebCore::ImageDecoderAVFObjC::canDecodeType):
906         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
907         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine):
908         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes):
909         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
910         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
911         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
912         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine):
913         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes):
914         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
915
916 2019-05-06  Youenn Fablet  <youenn@apple.com>
917
918         WebAudio Node JS wrappers should not be collected if events can be fired
919         https://bugs.webkit.org/show_bug.cgi?id=197533
920
921         Reviewed by Jer Noble.
922
923         Before the patch, some web audio nodes could fire event listeners, but were not protected from GC.
924         Use CustomIsReachable to ensure theses nodes can be collected if:
925         - their AudioContext is stopped (typically due to document being navigated away).
926         - their AudioContext is closed.
927         - nodes do not have event listeners.
928
929         Covered by WPT mediacapture-streams/MediaStreamTrack-MediaElement-disabled-audio-is-silence.https.html and
930         WPT webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html
931         and web audio WebRTC tests.
932         Specific newly added test: webaudio/webaudio-gc.html
933
934         * Modules/webaudio/AudioContext.h:
935         (WebCore::AudioContext::isClosed const):
936         * Modules/webaudio/AudioNode.idl:
937         * Sources.txt:
938         * WebCore.xcodeproj/project.pbxproj:
939         * bindings/js/JSAudioNodeCustom.cpp: Added.
940         (WebCore::JSAudioNodeOwner::isReachableFromOpaqueRoots):
941
942 2019-05-06  Daniel Bates  <dabates@apple.com>
943
944         Google Docs & Yahoo! Japan: Can’t compose characters with Chinese or Japanese keyboard
945         https://bugs.webkit.org/show_bug.cgi?id=197474
946         <rdar://problem/47219324>
947
948         Reviewed by Ryosuke Niwa.
949
950         Fix up some #if defs to compile more Mac code when building on iOS.
951
952         * dom/KeyboardEvent.cpp:
953         (WebCore::KeyboardEvent::KeyboardEvent):
954         * platform/PlatformKeyboardEvent.h:
955         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
956
957 2019-05-06  Chris Dumez  <cdumez@apple.com>
958
959         Add assertions to CachedFrame to help figure out crash in CachedFrame constructor
960         https://bugs.webkit.org/show_bug.cgi?id=197621
961
962         Reviewed by Geoffrey Garen.
963
964         Add release assertions to try and figure out who is sometimes detaching the document from its
965         frame while constructing CachedFrames for its descendants.
966
967         * dom/Document.cpp:
968         (WebCore::Document::detachFromFrame):
969         * dom/Document.h:
970         (WebCore::Document::setMayBeDetachedFromFrame):
971         * history/CachedFrame.cpp:
972         (WebCore::CachedFrame::CachedFrame):
973
974 2019-05-06  Zan Dobersek  <zdobersek@igalia.com>
975
976         [GLib] WebCore::MainThreadSharedTimer should use the appropriate GSource priority, name
977         https://bugs.webkit.org/show_bug.cgi?id=197606
978
979         Reviewed by Carlos Garcia Campos.
980
981         * platform/MainThreadSharedTimer.cpp:
982         (WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
983         Use the MainThreadSharedTimer GLib priority for this timer. The name is
984         also adjusted accordingly.
985
986 2019-05-05  Wenson Hsieh  <wenson_hsieh@apple.com>
987
988         fast/attachment/attachment-folder-icon.html is an Image Only failure on recent macOS builds
989         https://bugs.webkit.org/show_bug.cgi?id=197593
990         <rdar://problem/50379267>
991
992         Reviewed by Tim Horton.
993
994         On recent versions of macOS, -[NSWorkspace iconForFileType:] returns the generic document icon for
995         "public.directory". Instead of using this UTI to generate attachment icons for "multipart/x-folder" and
996         "application/vnd.apple.folder", we should instead be using "public.folder", which has a folder icon. This fixes
997         the existing test fast/attachment/attachment-folder-icon.html, which currently results in an image diff on these
998         builds of macOS.
999
1000         * rendering/RenderThemeMac.mm:
1001         (WebCore::iconForAttachment):
1002
1003 2019-05-04  Alex Christensen  <achristensen@webkit.org>
1004
1005         Revert r244953 and r244954 because they broke internal builds.
1006         https://bugs.webkit.org/show_bug.cgi?id=197534
1007
1008         * platform/ios/PlatformPasteboardIOS.mm:
1009         (WebCore::PlatformPasteboard::changeCount const):
1010         (WebCore::PlatformPasteboard::write):
1011
1012 2019-05-04  Alex Christensen  <achristensen@webkit.org>
1013
1014         Merge the three UIKitSPI.h files into a single one in PAL
1015         https://bugs.webkit.org/show_bug.cgi?id=197534
1016
1017         Reviewed by Darin Adler.
1018
1019         * platform/ios/PlatformPasteboardIOS.mm:
1020         (WebCore::PlatformPasteboard::changeCount const):
1021         (WebCore::PlatformPasteboard::write):
1022
1023 2019-05-04  Youenn Fablet  <youenn@apple.com>
1024
1025         Convert some RealtimeOutgoingVideoSourceCocoa logging to ERROR_LOG
1026         https://bugs.webkit.org/show_bug.cgi?id=197549
1027
1028         Reviewed by Eric Carlson.
1029
1030         No change of behavior.
1031
1032         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
1033         (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
1034
1035 2019-05-03  Simon Fraser  <simon.fraser@apple.com>
1036
1037         [macOS] Fix programmatic scrolling with async overflow scroll
1038         https://bugs.webkit.org/show_bug.cgi?id=197590
1039
1040         Reviewed by Sam Weinig.
1041         
1042         ScrollingTreeOverflowScrollingNodeMac needs to handle RequestedScrollPosition.
1043
1044         Tests: scrollingcoordinator/mac/programmatic-frame-scroll.html
1045                scrollingcoordinator/mac/programmatic-overflow-scroll.html
1046
1047         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1048         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
1049
1050 2019-05-03  Zalan Bujtas  <zalan@apple.com>
1051
1052         [iOS] outlook.live.com: Compose email frame not fully visible and not scrollable
1053         https://bugs.webkit.org/show_bug.cgi?id=197573
1054         <rdar://problem/48008441>
1055
1056         Reviewed by Wenson Hsieh.
1057
1058         The outlook mail view's flex column setup produces a somewhat unfortunate layout at certain viewport widths.
1059         This patch addresses the issue by ensuring that we never fall into that range.
1060
1061         * page/Quirks.cpp:
1062         (WebCore::Quirks::shouldIgnoreShrinkToFitContent const):
1063         (WebCore::Quirks::overriddenViewportLayoutWidth const):
1064         * page/Quirks.h:
1065
1066 2019-05-02  Jiewen Tan  <jiewen_tan@apple.com>
1067
1068         [WebAuthN] A focused document should be required
1069         https://bugs.webkit.org/show_bug.cgi?id=197543
1070         <rdar://problem/50430989>
1071
1072         Reviewed by Brent Fulgham.
1073
1074         This patch adds a check to see if the invoking document is focused before
1075         calling into WebAuthN. This patch also removes some out-to-dated comments.
1076
1077         Test: http/wpt/webauthn/public-key-credential-unfocused-document.https.html
1078
1079         * Modules/credentialmanagement/CredentialsContainer.cpp:
1080         (WebCore::CredentialsContainer::get):
1081         (WebCore::CredentialsContainer::isCreate):
1082         * Modules/webauthn/AuthenticatorCoordinator.cpp:
1083         (WebCore::AuthenticatorCoordinator::create const):
1084         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
1085
1086 2019-05-03  Devin Rousso  <drousso@apple.com>
1087
1088         Web Inspector: DOM: rename "low power" to "display composited"
1089         https://bugs.webkit.org/show_bug.cgi?id=197296
1090
1091         Reviewed by Joseph Pecoraro.
1092
1093         Removed specific ChangeLog entries since it is almost entirely mechanical changes.
1094
1095         * inspector/agents/InspectorDOMAgent.h:
1096         * inspector/agents/InspectorDOMAgent.cpp:
1097
1098 2019-05-03  Daniel Bates  <dabates@apple.com>
1099
1100         Pass KeyboardEvent by reference in more places
1101         https://bugs.webkit.org/show_bug.cgi?id=197480
1102
1103         Reviewed by Wenson Hsieh.
1104
1105         * editing/Editor.cpp:
1106         (WebCore::Editor::handleKeyboardEvent):
1107         (WebCore::Editor::handleInputMethodKeydown):
1108         * loader/EmptyClients.cpp:
1109         * page/EditorClient.h:
1110
1111 2019-05-03  Chris Dumez  <cdumez@apple.com>
1112
1113         [iOS Sim Debug] ASSERTION FAILED The atomic string comes from an other thread! Layout Test imported/w3c/web-platform-tests/workers/WorkerNavigator_appName.htm is a flaky crash
1114         https://bugs.webkit.org/show_bug.cgi?id=197530
1115         <rdar://problem/50448285>
1116
1117         Reviewed by Geoffrey Garen.
1118
1119         The issue is that NavigatorBase::platform() was not thread safe but was called by both Navigator on
1120         the main thread and WorkerNavigator on worker threads.
1121
1122         No new tests, covered by existing tests.
1123
1124         * page/Navigator.cpp:
1125         (WebCore::Navigator::platform const):
1126         * page/Navigator.h:
1127
1128         * page/NavigatorBase.cpp:
1129         (WebCore::NavigatorBase::platform const):
1130         * page/NavigatorBase.h:
1131         Make NavigatorBase::platform() thread safe.
1132
1133         * platform/ios/Device.cpp:
1134         (WebCore::deviceName):
1135         * platform/ios/Device.h:
1136         Make WebCore::deviceName() thread safe.
1137
1138         * platform/ios/UserAgentIOS.mm:
1139         (WebCore::deviceNameForUserAgent):
1140         Cache value returned by WebCore::deviceName() for performance.
1141
1142 2019-05-03  Chris Dumez  <cdumez@apple.com>
1143
1144         Use WeakPtr for JSLazyEventListener::m_originalNode for safety
1145         https://bugs.webkit.org/show_bug.cgi?id=197576
1146         <rdar://problem/24314027>
1147
1148         Reviewed by Alex Christensen.
1149
1150         * bindings/js/JSLazyEventListener.cpp:
1151         (WebCore::JSLazyEventListener::JSLazyEventListener):
1152         (WebCore::JSLazyEventListener::create):
1153         * bindings/js/JSLazyEventListener.h:
1154
1155 2019-05-03  Eric Carlson  <eric.carlson@apple.com>
1156
1157         AVFoundation framework isn't always installed
1158         https://bugs.webkit.org/show_bug.cgi?id=197577
1159         <rdar://problem/50447841>
1160
1161         Reviewed by Jer Noble.
1162         
1163         Use PAL::isAVFoundationFrameworkAvailable() to check to see if AVFoundation is
1164         installed, not PAL::AVFoundationLibrary().
1165
1166         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
1167         (WebCore::AVFoundationMIMETypeCache::isAvailable const):
1168         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
1169         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1170         (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
1171         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
1172         (WebCore::exernalDeviceDisplayNameForPlayer):
1173         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1174         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
1175         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1176         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
1177         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
1178         (WebCore::validateHEVCParameters):
1179         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1180         (WebCore::AVCaptureDeviceManager::isAvailable):
1181
1182 2019-05-03  Sihui Liu  <sihui_liu@apple.com>
1183
1184         Add assertion to check whether shm files have maximum FileProtection of CompleteUnlessOpen
1185         https://bugs.webkit.org/show_bug.cgi?id=197390
1186         <rdar://problem/42685773>
1187
1188         Reviewed by Geoffrey Garen.
1189
1190         We have seen crashes about accessing database files after device is locked. We are suspecting this is because 
1191         shm files have wrong data protection class, but shm files should not have Complete class protection when it 
1192         is created. It is likely the protection class is changed later. Add an assertion to verify our guess. If the 
1193         crash signature changes after this patch, we probably need to change database implementation. If it is not, we
1194         have other problem than data protection.
1195
1196         * platform/sql/SQLiteDatabase.cpp:
1197         (WebCore::SQLiteDatabase::open):
1198
1199 2019-05-03  Youenn Fablet  <youenn@apple.com>
1200
1201         Cache.add and Cache.addAll should compute a correct response body size
1202         https://bugs.webkit.org/show_bug.cgi?id=197464
1203
1204         Reviewed by Chris Dumez.
1205
1206         Compute the response body size as we do for regular Cache.put
1207
1208         Test: http/wpt/cache-storage/cache-quota-add.any.html
1209
1210         * Modules/cache/CacheStorageConnection.cpp:
1211         (WebCore::CacheStorageConnection::computeRecordBodySize):
1212         * Modules/cache/CacheStorageConnection.h:
1213         * Modules/cache/DOMCache.cpp:
1214         (WebCore::FetchTasksHandler::addResponseBody):
1215         (WebCore::DOMCache::addAll):
1216         Compute the response body size requires getting access to the connection.
1217         'this' is added to the lambda which is fine since taskHandler keeps a
1218         Ref to 'this' in its completion handler.
1219         (WebCore::DOMCache::toConnectionRecord):
1220         * Modules/fetch/FetchResponse.h:
1221
1222 2019-05-03  Tomoki Imai  <Tomoki.Imai@sony.com>
1223
1224         [Cairo] Improve ShadowBlur performance using tiling optimization
1225         https://bugs.webkit.org/show_bug.cgi?id=197308
1226         Reviewed by Žan Doberšek.
1227
1228         Enable tiling tiling-based optimization for drawRectShadow() and drawInsetShadow().
1229         Since r228776, cairo ports doesn't have tiling-based optimization.
1230
1231         For AppleWin, this patch refactors code and it shares almost same code as cairo port.
1232         Only the difference is that AppleWin uses ScratchBuffer, but cairo ports doesn't.
1233         This should avoid a performance regression for AppleWin.
1234
1235         No new tests, covered by existing tests.
1236
1237         * platform/graphics/ShadowBlur.cpp:
1238         (WebCore::calculateLobes):
1239         Fix stylecheck errors
1240
1241         (WebCore::ShadowBlur::blurLayerImage):
1242         Fix stylecheck errors
1243
1244         (WebCore::ShadowBlur::calculateLayerBoundingRect):
1245         We don't use position of m_sourceRect, so change the type to FloatSize.
1246
1247         (WebCore::ShadowBlur::drawShadowBuffer):
1248         Use m_layerSize instead of m_shadowedResultSize to fillRect, as m_layerSize is always smaller than m_shadowedResultSize.
1249         It's because in m_layerSize is equal to m_shadowedResultSize if it's not clipped.
1250         Clipping doesn't increase size of m_layerSize, so m_layerSize is always smaller than or equal to m_shadowedResultSize.
1251
1252         (WebCore::ShadowBlur::templateSize const):
1253         Fix stylecheck errors
1254
1255         (WebCore::ShadowBlur::drawRectShadow):
1256         (WebCore::ShadowBlur::drawInsetShadow):
1257         (WebCore::ShadowBlur::drawRectShadowWithoutTiling):
1258         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
1259         (WebCore::ShadowBlur::drawRectShadowWithTiling):
1260         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
1261         Incorporate tile-based drawing.
1262         To accomplish it, this patch abstracts GraphicsContext::drawImageBuffer to ShadowBlur::DrawImageCallback,
1263         GraphicsContext::fillRect to ShadowBlur::FillRectCallback, drawing rect with hole to  ShadowBlur::FillRectWithHoleCallback.
1264
1265         Variants which takes GraphicsContext as parameter now just calls another drawRectShadow.
1266
1267         (WebCore::ShadowBlur::drawLayerPieces):
1268         Instead of graphicsContext.drawImageBuffer, call corresponding callback.
1269
1270         (WebCore::ShadowBlur::drawLayerPiecesAndFillCenter):
1271         This function calls drawLayerPieces and fill center for outer shadow.
1272         Drawing outer shadow requires another callback for graphicsContext.fillRect.
1273
1274         (WebCore::ShadowBlur::drawShadowLayer):
1275         Use m_layerSize instead of m_shadowedResultSize to fillRect,
1276         as m_layerSize is always smaller than m_shadowedResultSize.
1277
1278         * platform/graphics/ShadowBlur.h:
1279         Rename m_sourceRect to m_shadowedResultSize, and change it to FloatSize from FloatRect.
1280         Remove GraphicsContext usage as much as possible and replace them by corresponding callbacks.
1281
1282         * platform/graphics/cairo/CairoOperations.cpp:
1283         (WebCore::Cairo::drawShadowImage):
1284         This function corresponds to ShadowBlur::DrawImageCallback.
1285
1286         (WebCore::Cairo::fillShadowBuffer):
1287         Erase sourceRect, as it's always bigger than layerSize.
1288
1289         (WebCore::Cairo::drawPathShadow):
1290         (WebCore::Cairo::drawGlyphsShadow):
1291         Erase unused parameter.
1292
1293         (WebCore::Cairo::fillRect):
1294         (WebCore::Cairo::fillRoundedRect):
1295         (WebCore::Cairo::fillRectWithRoundedHole):
1296         For tile-based optimization, add extra arguments to drawRectShadow.
1297
1298         (WebCore::Cairo::drawSurface):
1299         Erase unused parameter.
1300
1301 2019-05-03  Antti Koivisto  <antti@apple.com>
1302
1303         Add a quirk to make youtube navigation bar scrollable without mouse hover on iOS
1304         https://bugs.webkit.org/show_bug.cgi?id=197555
1305         <rdar://problem/49582231>
1306
1307         Reviewed by Brent Fulgham.
1308
1309         * css/StyleResolver.cpp:
1310         (WebCore::StyleResolver::adjustRenderStyleForSiteSpecificQuirks):
1311
1312         Turn 'overflow:hidden' into 'overflow:auto' on element with id="guide-inner-content".
1313
1314         * page/Quirks.cpp:
1315         (WebCore::Quirks::needsYouTubeOverflowScrollQuirk const):
1316         * page/Quirks.h:
1317
1318 2019-05-03  Devin Rousso  <drousso@apple.com>
1319
1320         Web Inspector: Record actions performed on WebGL2RenderingContext
1321         https://bugs.webkit.org/show_bug.cgi?id=176008
1322         <rdar://problem/34213884>
1323
1324         Reviewed by Joseph Pecoraro.
1325
1326         Tests: inspector/canvas/recording-webgl2.html
1327                inspector/canvas/recording-webgl2-snapshots.html
1328
1329         * html/canvas/WebGL2RenderingContext.idl:
1330
1331         * bindings/js/CallTracerTypes.h:
1332         * inspector/RecordingSwizzleTypes.h:
1333
1334         * inspector/InspectorCanvas.h:
1335         * inspector/InspectorCanvas.cpp:
1336         (WebCore::InspectorCanvas::canvasChanged): Added.
1337         (WebCore::InspectorCanvas::resetRecordingData):
1338         (WebCore::shouldSnapshotWebGL2Action): Added.
1339         (WebCore::InspectorCanvas::recordAction):
1340         (WebCore::InspectorCanvas::releaseObjectForRecording):
1341         (WebCore::InspectorCanvas::appendActionSnapshotIfNeeded):
1342         (WebCore::InspectorCanvas::buildAction):
1343         * inspector/agents/InspectorCanvasAgent.h:
1344         * inspector/agents/InspectorCanvasAgent.cpp:
1345         (WebCore::InspectorCanvasAgent::canvasChanged): Added.
1346         (WebCore::InspectorCanvasAgent::startRecording):
1347         Provide an actual implementation of `CanvasObserver::canvasChanged` since it can be used to
1348         determine whether or not an action needs a snapshot.
1349
1350         * page/PageConsoleClient.cpp:
1351         (WebCore::canvasRenderingContext):
1352
1353 2019-05-03  Commit Queue  <commit-queue@webkit.org>
1354
1355         Unreviewed, rolling out r244881.
1356         https://bugs.webkit.org/show_bug.cgi?id=197559
1357
1358         Breaks compilation of jsconly on linux, breaking compilation
1359         for jsc-i386-ews, jsc-mips-ews and jsc-armv7-ews (Requested by
1360         guijemont on #webkit).
1361
1362         Reverted changeset:
1363
1364         "[CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into
1365         WEBKIT_COPY_FILES"
1366         https://bugs.webkit.org/show_bug.cgi?id=197174
1367         https://trac.webkit.org/changeset/244881
1368
1369 2019-05-03  Joonghun Park  <jh718.park@samsung.com>
1370
1371         Resolve the percentage values of inset properties against proper box.
1372         https://bugs.webkit.org/show_bug.cgi?id=189549
1373
1374         Reviewed by Antti Koivisto.
1375
1376         Before this CL, sticky element's layout was executed relative to
1377         a box's overflow container,
1378         but the value returned by getComputedStyle was resolved against
1379         its containing block.
1380
1381         So, the computed value and the actual value used in layout
1382         was different before this change.
1383
1384         Tests: imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-sticky-container-for-abspos.html
1385                imported/w3c/web-platform-tests/css/cssom/getComputedStyle-sticky-pos-percent.html
1386
1387         * css/CSSComputedStyleDeclaration.cpp:
1388         (WebCore::positionOffsetValue):
1389         * rendering/RenderBox.cpp:
1390         (WebCore::RenderBox::enclosingScrollportBox const):
1391         * rendering/RenderBox.h:
1392
1393 2019-05-02  Antti Koivisto  <antti@apple.com>
1394
1395         Add a quirk to make gmail navigation bar scrollable without mouse hover on iOS
1396         https://bugs.webkit.org/show_bug.cgi?id=197529
1397         <rdar://problem/49403416>
1398
1399         Reviewed by Simon Fraser.
1400
1401         * css/StyleResolver.cpp:
1402         (WebCore::StyleResolver::adjustRenderStyle):
1403         (WebCore::StyleResolver::adjustRenderStyleForSiteSpecificQuirks):
1404
1405         Turn 'overflow:hidden' to 'overflow:auto' on element with role="navigation".
1406         This should be both reasonably targeted and robust.
1407
1408         * css/StyleResolver.h:
1409         * page/Quirks.cpp:
1410         (WebCore::Quirks::needsGMailOverflowScrollQuirk const):
1411         * page/Quirks.h:
1412
1413 2019-05-02  Simon Fraser  <simon.fraser@apple.com>
1414
1415         Add logging for RenderLayer clip rects
1416         https://bugs.webkit.org/show_bug.cgi?id=197547
1417
1418         Reviewed by Zalan Bujtas.
1419
1420         Add a ClipRects log channel, and stream output for ClipRect and ClipRects.
1421
1422         * platform/Logging.h:
1423         * rendering/ClipRect.cpp:
1424         (WebCore::operator<<):
1425         * rendering/ClipRect.h:
1426         * rendering/RenderLayer.cpp:
1427         (WebCore::operator<<):
1428         (WebCore::RenderLayer::calculateClipRects const):
1429         * rendering/RenderLayer.h:
1430
1431 2019-05-02  Youenn Fablet  <youenn@apple.com>
1432
1433         Make AudioContext::scriptExecutionContext() private
1434         https://bugs.webkit.org/show_bug.cgi?id=197512
1435
1436         Reviewed by Eric Carlson.
1437
1438         Refactor code to make audio nodes not rely on AudioContext::scriptExecutionContext.
1439         Instead, let AudioContext provide the necessary API for its nodes.
1440         Covered by existing tests.
1441
1442         * Modules/webaudio/AudioBufferSourceNode.cpp:
1443         (WebCore::AudioBufferSourceNode::looping):
1444         (WebCore::AudioBufferSourceNode::setLooping):
1445         * Modules/webaudio/AudioContext.cpp:
1446         (WebCore::AudioContext::postTask):
1447         (WebCore::AudioContext::origin const):
1448         (WebCore::AudioContext::addConsoleMessage):
1449         * Modules/webaudio/AudioContext.h:
1450         (WebCore::AudioContext::isStopped const):
1451         * Modules/webaudio/AudioNode.cpp:
1452         (WebCore::AudioNode::scriptExecutionContext const):
1453         * Modules/webaudio/AudioNode.h:
1454         * Modules/webaudio/AudioScheduledSourceNode.cpp:
1455         (WebCore::AudioScheduledSourceNode::finish):
1456         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
1457         (WebCore::DefaultAudioDestinationNode::resume):
1458         (WebCore::DefaultAudioDestinationNode::suspend):
1459         (WebCore::DefaultAudioDestinationNode::close):
1460         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
1461         (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
1462         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
1463         (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
1464         * Modules/webaudio/ScriptProcessorNode.cpp:
1465         (WebCore::ScriptProcessorNode::fireProcessEvent):
1466
1467 2019-05-02  Ryosuke Niwa  <rniwa@webkit.org>
1468
1469         Disable software keyboard for a math field textarea on desmos.com
1470         https://bugs.webkit.org/show_bug.cgi?id=197488
1471
1472         Reviewed by Wenson Hsieh.
1473
1474         Treat a textarea inside a math field span as if it had inputmode content attribute set to none to suppress
1475         the software keyboard on desmos.com as it interferes with website's own UI.
1476
1477         * html/HTMLElement.cpp:
1478         (WebCore::HTMLElement::canonicalInputMode const):
1479         * page/Quirks.cpp:
1480         (WebCore::Quirks::needsInputModeNoneImplicitly const):
1481         * page/Quirks.h:
1482
1483 2019-05-02  Timothy Hatcher  <timothy@apple.com>
1484
1485         NSAttributedString conversion in a loop returns nil and WKUnknownError every other time.
1486         https://bugs.webkit.org/show_bug.cgi?id=197523
1487
1488         Reviewed by Darin Adler.
1489
1490         * editing/cocoa/HTMLConverter.mm:
1491         (HTMLConverter::convert): Don't return early if m_dataSource is nil. This is already null
1492         checked later and only needed in specific cases, it shouldn't fail the whole conversion.
1493
1494 2019-05-02  Chris Dumez  <cdumez@apple.com>
1495
1496         Setting a frame's src to a javascript URL should not run it synchronously
1497         https://bugs.webkit.org/show_bug.cgi?id=197466
1498
1499         Reviewed by Darin Adler.
1500
1501         When an iframe's src attribute is set to a javascript URL, whether when parsing
1502         or later on via JS, we now execute the URL's JavaScript asynchronously. We used
1503         to execute it synchronously, which was a source of bugs and also did not match
1504         other browsers.
1505
1506         I have verified that our new behavior is aligned with both Firefox and Chrome.
1507
1508         Note that for backward-compatibility and interoperability with Blink
1509         (https://bugs.chromium.org/p/chromium/issues/detail?id=923585), the
1510         "javascript:''" URL will still run synchronously. We should consider dropping
1511         this quirk at some point.
1512
1513         Test: fast/dom/frame-src-javascript-url-async.html
1514
1515         * loader/NavigationScheduler.cpp:
1516         (WebCore::ScheduledLocationChange::ScheduledLocationChange):
1517         (WebCore::ScheduledLocationChange::~ScheduledLocationChange):
1518         (WebCore::NavigationScheduler::scheduleLocationChange):
1519         * loader/NavigationScheduler.h:
1520         (WebCore::NavigationScheduler::scheduleLocationChange):
1521         * loader/SubframeLoader.cpp:
1522         (WebCore::SubframeLoader::requestFrame):
1523
1524 2019-05-02  Gary Katsevman  <git@gkatsev.com>
1525
1526         WebVTT: fix vertical cue alignment.
1527         https://bugs.webkit.org/show_bug.cgi?id=136627.
1528         <rdar://problem/49725538>
1529
1530         Reviewed by Eric Carlson.
1531
1532         Updated existing test results.
1533
1534         * html/track/VTTCue.cpp:
1535         (WebCore::VTTCueBox::applyCSSProperties):
1536
1537 2019-05-02  Don Olmstead  <don.olmstead@sony.com>
1538
1539         [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
1540         https://bugs.webkit.org/show_bug.cgi?id=197174
1541
1542         Reviewed by Alex Christensen.
1543
1544         Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES and make dependencies
1545         for framework headers explicit.
1546
1547         * CMakeLists.txt:
1548
1549 2019-05-02  Jiewen Tan  <jiewen_tan@apple.com>
1550
1551         [WebAuthN] Add a quirk for google.com when processing AppID extension
1552         https://bugs.webkit.org/show_bug.cgi?id=196046
1553         <rdar://problem/49088479>
1554
1555         Reviewed by Brent Fulgham.
1556
1557         Relaxing the same site restriction on AppID while in google.com and any
1558         of its subdomains to allow two www.gstatic.com AppIDs to slip in.
1559
1560         Covered by manual tests on Google.com.
1561
1562         * Modules/webauthn/AuthenticatorCoordinator.cpp:
1563         (WebCore::AuthenticatorCoordinatorInternal::needsAppIdQuirks):
1564         (WebCore::AuthenticatorCoordinatorInternal::processAppIdExtension):
1565
1566 2019-05-02  Ross Kirsling  <ross.kirsling@sony.com>
1567
1568         Unreviewed fix for non-unified build after r244853.
1569
1570         * page/SecurityOrigin.cpp:
1571
1572 2019-05-02  Frederic Wang  <fwang@igalia.com>
1573
1574         [GTK][WPE] Disable "thin", "thick", "medium" values of mfrac@linethickness at runtime
1575         https://bugs.webkit.org/show_bug.cgi?id=196142
1576
1577         This patch introduces some experimental runtime flag to let users
1578         disable MathML features that are removed from MathML Core [1]. For now,
1579         these features are only disabled on GTK and WPE ports. This patch also
1580         adds a condition to disable "thin", "thick", "medium" values of
1581         mfrac@linethickness at runtime as agreed in [2].
1582
1583         [1] https://mathml-refresh.github.io/mathml-core/
1584         [2] https://github.com/mathml-refresh/mathml/issues/4
1585
1586         Reviewed by Rob Buis.
1587
1588         No new tests, covered by frac-linethickness-0001.html
1589
1590         * mathml/MathMLFractionElement.cpp:
1591         (WebCore::MathMLFractionElement::lineThickness): Just do standard
1592         parsing for MathML lengths when non-core MathML features are disabled.
1593         * page/Settings.yaml: Add WebCore setting.
1594
1595 2019-05-01  Jiewen Tan  <jiewen_tan@apple.com>
1596
1597         [WebAuthN] Adopt SecurityOrigin::isMatchingRegistrableDomainSuffix()
1598         https://bugs.webkit.org/show_bug.cgi?id=197481
1599
1600         Reviewed by Brent Fulgham.
1601
1602         This patch implements Step 6-7 from:
1603         https://www.w3.org/TR/webauthn/#createCredential,
1604         https://www.w3.org/TR/webauthn/#discover-from-external-source.
1605
1606         Test: http/wpt/webauthn/public-key-credential-ip-address.html
1607
1608         * Modules/webauthn/AuthenticatorCoordinator.cpp:
1609         (WebCore::AuthenticatorCoordinator::create const):
1610         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
1611
1612 2019-05-01  Youenn Fablet  <youenn@apple.com>
1613
1614         Add back hasNullReferences() assert in Document::updateIsPlayingMedia
1615         https://bugs.webkit.org/show_bug.cgi?id=197477
1616
1617         Reviewed by Eric Carlson.
1618
1619         AudioContext had a special scriptExecutionContext() getter
1620         that was returning nullptr when AudioContext is stopped.
1621         Instead, make this getter behave as all other scriptExecutionContext() getters
1622         and make sure existing call sites of the getter are fine with the change.
1623
1624         Covered by existing tests.
1625
1626         * Modules/webaudio/AudioContext.cpp:
1627         (WebCore::AudioContext::AudioContext):
1628         No need to check whether offline since this constructor is for non offline AudioContext.
1629         (WebCore::AudioContext::scriptExecutionContext const):
1630         (WebCore::AudioContext::fireCompletionEvent):
1631         * dom/Document.cpp:
1632         (WebCore::Document::updateIsPlayingMedia):
1633
1634 2019-05-01  Justin Fan  <justin_fan@apple.com>
1635
1636         Update WebGPU class names based on sketch.idl
1637         https://bugs.webkit.org/show_bug.cgi?id=194260
1638
1639         Reviewed by Dean Jackson.
1640
1641         Update all exposed Web GPU interface names to GPU* prefix.
1642
1643         Existing Web GPU tests updated to expect new names.
1644
1645         * Modules/webgpu/WebGPU.idl:
1646         * Modules/webgpu/WebGPUAdapter.idl:
1647         * Modules/webgpu/WebGPUBindGroup.idl:
1648         * Modules/webgpu/WebGPUBindGroupLayout.idl:
1649         * Modules/webgpu/WebGPUBuffer.idl:
1650         * Modules/webgpu/WebGPUDevice.idl:
1651         * Modules/webgpu/WebGPUInputStepMode.h: Removed.
1652         * Modules/webgpu/WebGPUPipelineLayout.idl:
1653         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
1654         * Modules/webgpu/WebGPUQueue.idl:
1655         * Modules/webgpu/WebGPURenderPassEncoder.idl:
1656         * Modules/webgpu/WebGPURenderPipeline.idl:
1657         * Modules/webgpu/WebGPUSampler.idl:
1658         * Modules/webgpu/WebGPUTexture.idl:
1659         * Modules/webgpu/WebGPUTextureView.idl:
1660         * WebCore.xcodeproj/project.pbxproj:
1661         * bindings/js/WebCoreBuiltinNames.h:
1662
1663 2019-05-01  Jiewen Tan  <jiewen_tan@apple.com>
1664
1665         Move Document::domainIsRegisterable to SecurityOrigin::isMatchingRegistrableDomainSuffix
1666         https://bugs.webkit.org/show_bug.cgi?id=181950
1667         <rdar://problem/43357371>
1668
1669         Reviewed by Brent Fulgham.
1670
1671         This patch moves Document::domainIsRegisterable to SecurityOrigin::isMatchingRegistrableDomainSuffix
1672         to be more aligned with the HTML standard:
1673         https://html.spec.whatwg.org/multipage/origin.html#is-a-registrable-domain-suffix-of-or-is-equal-to.
1674         Besides that, it also removes redundant codes within the original method that is also done in
1675         OriginAccessEntry::matchesOrigin.
1676
1677         Covered by new API tests.
1678
1679         * dom/Document.cpp:
1680         (WebCore::Document::setDomain):
1681         (WebCore::Document::domainIsRegisterable const): Deleted.
1682         * dom/Document.h:
1683         * page/SecurityOrigin.cpp:
1684         (WebCore::SecurityOrigin::isMatchingRegistrableDomainSuffix const):
1685         * page/SecurityOrigin.h:
1686
1687 2019-05-01  Ryosuke Niwa  <rniwa@webkit.org>
1688
1689         [iOS] Element::focus and Element::scrollIntoView do not clamp scroll positions
1690         https://bugs.webkit.org/show_bug.cgi?id=197211
1691
1692         Reviewed by Simon Fraser.
1693
1694         Fixed the bug that Element::focus and Element::scrollIntoView were not clamping scroll offsets,
1695         which causes scrollTop etc... to return a bogus negative scrolling offset.
1696
1697         Unfortunately, we can't just use FrameView's ScrollableArea::constrainScrollPosition since
1698         scrollRectToVisible relies on the visible rect being expanded by the content insets in order to scroll to
1699         a position within the content insets of UIScrollView; e.g. revealing the top of the page as the center.
1700         We manually expand minimumScrollPosition() and maximumScrollPosition() by the content insets instead.
1701
1702         Tests: fast/scrolling/ios/programmatic-scroll-via-focus-should-clamp-top.html
1703                fast/scrolling/ios/programmatic-scroll-via-scrollIntoView-inside-iframe-should-clamp-top.html
1704                fast/scrolling/ios/programmatic-scroll-via-scrollIntoView-should-clamp-top.html
1705
1706         * rendering/RenderLayer.cpp:
1707         (WebCore::RenderLayer::scrollRectToVisible):
1708
1709 2019-05-01  Wenson Hsieh  <wenson_hsieh@apple.com>
1710
1711         [iOS] Add a version of viewport shrink-to-fit heuristics that preserves page layout
1712         https://bugs.webkit.org/show_bug.cgi?id=197342
1713         <rdar://problem/50063091>
1714
1715         Reviewed by Tim Horton.
1716
1717         Adds support for a new shrink-to-fit heuristic that attempts to lay out the contents of the page at a larger
1718         width in order to shrink content to fit the viewport. See WebKit ChangeLog for more details.
1719
1720         Tests: fast/viewport/ios/shrink-to-fit-content-constant-width.html
1721                fast/viewport/ios/shrink-to-fit-content-large-width-breakpoint.html
1722                fast/viewport/ios/shrink-to-fit-content-no-viewport.html
1723                fast/viewport/ios/shrink-to-fit-content-responsive-viewport-with-horizontal-overflow.html
1724                fast/viewport/ios/shrink-to-fit-content-temporary-overflow.html
1725
1726         * page/ViewportConfiguration.cpp:
1727         (WebCore::ViewportConfiguration::setMinimumEffectiveDeviceWidth):
1728         (WebCore::ViewportConfiguration::setIsKnownToLayOutWiderThanViewport):
1729         (WebCore::ViewportConfiguration::description const):
1730         * page/ViewportConfiguration.h:
1731         (WebCore::ViewportConfiguration::canIgnoreScalingConstraints const):
1732         (WebCore::ViewportConfiguration::minimumEffectiveDeviceWidth const):
1733
1734         Add several new getters and setters in ViewportConfiguration.
1735
1736         (WebCore::ViewportConfiguration::isKnownToLayOutWiderThanViewport const):
1737         (WebCore::ViewportConfiguration::shouldIgnoreMinimumEffectiveDeviceWidth const):
1738
1739         Importantly, only allow ignoring the minimum effective device width in webpages with responsive viewports, if
1740         they also have *not* laid out wider than the viewport.
1741
1742         (WebCore::ViewportConfiguration::setForceAlwaysUserScalable):
1743
1744 2019-05-01  Zalan Bujtas  <zalan@apple.com>
1745
1746         [iOS] Star rating is covered with a black circle when writing a review on Yelp
1747         https://bugs.webkit.org/show_bug.cgi?id=197469
1748         <rdar://problem/48094446>
1749
1750         Reviewed by Dean Jackson.
1751
1752         This patch moves the background painting of the radio/checkbox form controls in checked state to RenderTheme.
1753         It enables content authors to disable default appearance using -webkit-appearance: none (it is also inline with what we do on macOS).
1754
1755         Test: fast/forms/radio-and-checkbox-checked-with-no-appearance.html
1756
1757         * css/html.css:
1758         (input:matches([type="checkbox"], [type="radio"]):checked):
1759         * rendering/RenderThemeIOS.mm:
1760         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
1761         (WebCore::RenderThemeIOS::paintRadioDecorations):
1762
1763 2019-05-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
1764
1765         REGRESSION (r244182): RenderingUpdate should not be scheduled for invisible pages
1766         https://bugs.webkit.org/show_bug.cgi?id=197451
1767
1768         Reviewed by Simon Fraser.
1769
1770         Before r244182, some web pages never need to schedule a RenderingUpdate.
1771         Only pages with rAF callbacks, web animations, intersection and resize 
1772         observers needed to do so. After r244182, all pages have to schedule a
1773         RenderingUpdate when a page rendering update is required.
1774
1775         When Safari opens, it create a 'blank' web page. The blank page will not
1776         be visible unless the user selects to show the 'Empty page' in the new
1777         tab. Although the blank page is not visible, the loader needs to resolveStyle()
1778         which requires to scheduleLayerFlushNow(). 
1779
1780         We need to optimize this case: calling scheduleLayerFlushNow() for invisible
1781         pages. We do that by checking if the page is visible before scheduling
1782         the RenderingUpdate.
1783
1784         Also we need to change or get rid of scheduleLayerFlushNow() since its name
1785         has become confusing. It suggests that it is going to schedule flushing
1786         the layer 'now'. But after r244182, it does scheduleRenderingUpdate() first.
1787         And when it fires, scheduleCompositingLayerFlush() will be called.
1788
1789         * page/RenderingUpdateScheduler.cpp:
1790         (WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate):
1791         * rendering/RenderLayerCompositor.cpp:
1792         (WebCore::RenderLayerCompositor::scheduleLayerFlush):
1793         (WebCore::RenderLayerCompositor::didChangeVisibleRect):
1794         (WebCore::RenderLayerCompositor::frameViewDidScroll):
1795         (WebCore::RenderLayerCompositor::attachRootLayer):
1796         (WebCore::RenderLayerCompositor::setLayerFlushThrottlingEnabled):
1797         (WebCore::RenderLayerCompositor::layerFlushTimerFired):
1798         (WebCore::RenderLayerCompositor::scheduleLayerFlushNow): Deleted.
1799         * rendering/RenderLayerCompositor.h:
1800
1801 2019-05-01  Darin Adler  <darin@apple.com>
1802
1803         WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
1804         https://bugs.webkit.org/show_bug.cgi?id=195535
1805
1806         Reviewed by Alexey Proskuryakov.
1807
1808         * platform/SharedBuffer.cpp:
1809         (WebCore::utf8Buffer): Removed unnecessary "strict" argument to convertUTF16ToUTF8 since
1810         that is the default behavior. Also updated for changes to return values.
1811
1812         * xml/XSLTProcessorLibxslt.cpp:
1813         (WebCore::writeToStringBuilder): Removed unnecessary use of StringBuffer for a temporary
1814         buffer for characters. Rewrote to use U8_NEXT and U16_APPEND directly.
1815
1816         * xml/parser/XMLDocumentParserLibxml2.cpp:
1817         (WebCore::convertUTF16EntityToUTF8): Updated for changes to CompletionResult.
1818
1819 2019-05-01  Shawn Roberts  <sroberts@apple.com>
1820
1821         Unreviewed, rolling out r244821.
1822
1823         Causing
1824
1825         Reverted changeset:
1826
1827         "WebKit has too much of its own UTF-8 code and should rely
1828         more on ICU's UTF-8 support"
1829         https://bugs.webkit.org/show_bug.cgi?id=195535
1830         https://trac.webkit.org/changeset/244821
1831
1832 2019-05-01  Shawn Roberts  <sroberts@apple.com>
1833
1834         Unreviewed, rolling out r244822.
1835
1836         Causing
1837
1838         Reverted changeset:
1839
1840         https://trac.webkit.org/changeset/244822
1841
1842 2019-05-01  Youenn Fablet  <youenn@apple.com>
1843
1844         Reject/throw when calling AudioContext methods on a stopped AudioContext
1845         https://bugs.webkit.org/show_bug.cgi?id=197391
1846
1847         Reviewed by Eric Carlson.
1848
1849         Return InvalidStateError in that case.
1850         ASSERT that we do not call lazyInitialize after being stopped
1851         since this would mean we are doing unneeded processing.
1852
1853         Test: http/wpt/webaudio/audiocontext-stopped.html
1854
1855         * Modules/webaudio/AudioContext.cpp:
1856         (WebCore::AudioContext::lazyInitialize):
1857         (WebCore::AudioContext::createBufferSource):
1858         (WebCore::AudioContext::createMediaElementSource):
1859         (WebCore::AudioContext::createMediaStreamSource):
1860         (WebCore::AudioContext::createMediaStreamDestination):
1861         (WebCore::AudioContext::createScriptProcessor):
1862         (WebCore::AudioContext::createBiquadFilter):
1863         (WebCore::AudioContext::createWaveShaper):
1864         (WebCore::AudioContext::createPanner):
1865         (WebCore::AudioContext::createConvolver):
1866         (WebCore::AudioContext::createDynamicsCompressor):
1867         (WebCore::AudioContext::createAnalyser):
1868         (WebCore::AudioContext::createGain):
1869         (WebCore::AudioContext::createDelay):
1870         (WebCore::AudioContext::createChannelSplitter):
1871         (WebCore::AudioContext::createChannelMerger):
1872         (WebCore::AudioContext::createOscillator):
1873         (WebCore::AudioContext::createPeriodicWave):
1874         (WebCore::AudioContext::startRendering):
1875         (WebCore::AudioContext::suspend):
1876         (WebCore::AudioContext::resume):
1877         (WebCore::AudioContext::close):
1878         * Modules/webaudio/AudioContext.h:
1879         * Modules/webaudio/AudioContext.idl:
1880
1881 2019-05-01  Eric Carlson  <eric.carlson@apple.com>
1882
1883         XMLHttpRequest should propagate user gestures for media playback
1884         https://bugs.webkit.org/show_bug.cgi?id=197428
1885         <rdar://problem/46677392>
1886
1887         Reviewed by Jer Noble.
1888
1889         A user gesture the would allow media state change in effect when XMLHttpRequest.send is 
1890         called should be active when the event handlers fire after the transaction completes successfully.
1891
1892         Test: http/tests/media/user-gesture-preserved-across-xmlhttprequest.html
1893
1894         * dom/UserGestureIndicator.cpp:
1895         (WebCore::UserGestureIndicator::UserGestureIndicator): Add a 'scope' parameter to potentially
1896         limit the scope of the gesture to just media.
1897         (WebCore::UserGestureIndicator::~UserGestureIndicator): Clear the scope.
1898         * dom/UserGestureIndicator.h:
1899         (WebCore::UserGestureToken::processingUserGesture const):
1900         (WebCore::UserGestureToken::setScope):
1901         (WebCore::UserGestureToken::resetScope):
1902         (WebCore::UserGestureToken::hasExpired const):
1903
1904         * page/DOMTimer.cpp:
1905         (WebCore::DOMTimerFireState::DOMTimerFireState): Don't need to store the nested timer interval,
1906         UserGestureIndicator knows when it started.
1907         (WebCore::DOMTimer::DOMTimer): Ditto.
1908         (WebCore::DOMTimer::fired): Ditto.
1909         (WebCore::DOMTimerFireState::nestedTimerInterval const): Deleted.
1910         (WebCore::shouldForwardUserGesture): Deleted.
1911         (WebCore::userGestureTokenToForward): Deleted.
1912         (WebCore::currentNestedTimerInterval): Deleted.
1913         * page/DOMTimer.h:
1914
1915         * testing/Internals.cpp:
1916         (WebCore::Internals::setXHRMaximumIntervalForUserGestureForwarding): Override the maximum
1917         user gesture interval for testing.
1918         * testing/Internals.h:
1919         * testing/Internals.idl:
1920
1921         * xml/XMLHttpRequest.cpp:
1922         (WebCore::XMLHttpRequest::XMLHttpRequest): 
1923         (WebCore::XMLHttpRequest::send): Stash the user gesture token.
1924         (WebCore::XMLHttpRequest::dispatchEvent): Clear user gesture token if it has expired. If still
1925         valid, activate it.
1926         * xml/XMLHttpRequest.h:
1927
1928 2019-04-29  Darin Adler  <darin@apple.com>
1929
1930         WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
1931         https://bugs.webkit.org/show_bug.cgi?id=195535
1932
1933         Reviewed by Alexey Proskuryakov.
1934
1935         * platform/SharedBuffer.cpp:
1936         (WebCore::utf8Buffer): Removed unnecessary "strict" argument to convertUTF16ToUTF8 since
1937         that is the default behavior. Also updated for changes to return values.
1938
1939         * xml/XSLTProcessorLibxslt.cpp:
1940         (WebCore::writeToStringBuilder): Removed unnecessary use of StringBuffer for a temporary
1941         buffer for characters. Rewrote to use U8_NEXT and U16_APPEND directly.
1942
1943         * xml/parser/XMLDocumentParserLibxml2.cpp:
1944         (WebCore::convertUTF16EntityToUTF8): Updated for changes to CompletionResult.
1945
1946 2019-04-30  John Wilander  <wilander@apple.com>
1947
1948         Add logging of Ad Click Attribution errors and events to a dedicated channel
1949         https://bugs.webkit.org/show_bug.cgi?id=197332
1950         <rdar://problem/49918800>
1951
1952         Reviewed by Youenn Fablet.
1953
1954         This patch adds an experimental Ad Click Attribution debug mode which
1955         logs information.
1956
1957         No new tests.
1958
1959         * loader/AdClickAttribution.cpp:
1960         (WebCore::AdClickAttribution::parseConversionRequest):
1961         (WebCore::AdClickAttribution::debugModeEnabled):
1962         * loader/AdClickAttribution.h:
1963         * page/RuntimeEnabledFeatures.h:
1964         (WebCore::RuntimeEnabledFeatures::adClickAttributionDebugModeEnabled const):
1965         (WebCore::RuntimeEnabledFeatures::setAdClickAttributionDebugModeEnabled):
1966         * platform/Logging.h:
1967
1968 2019-04-30  Myles C. Maxfield  <mmaxfield@apple.com>
1969
1970         font-weight: 1000 is not parsed successfully
1971         https://bugs.webkit.org/show_bug.cgi?id=197427
1972
1973         Reviewed by Dean Jackson.
1974
1975         The spec says:
1976         "Only values greater than or equal to 1, and less than or equal to 1000, are valid"
1977
1978         This change brings us in-line with all the other browsers.
1979
1980         Test: fast/text/font-weight-1-1000.html
1981
1982         * css/parser/CSSPropertyParserHelpers.cpp:
1983         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
1984
1985 2019-04-30  Youenn Fablet  <youenn@apple.com>
1986
1987         Make Document audio producers use WeakPtr
1988         https://bugs.webkit.org/show_bug.cgi?id=197382
1989
1990         Reviewed by Eric Carlson.
1991
1992         Move from a hash set of raw pointers to a hash set of weak pointers.
1993         This helps make the code cleaner.
1994         No observable change of behavior.
1995
1996         * Modules/mediastream/MediaStreamTrack.h:
1997         * dom/Document.cpp:
1998         (WebCore::Document::addAudioProducer):
1999         (WebCore::Document::removeAudioProducer):
2000         (WebCore::Document::updateIsPlayingMedia):
2001         (WebCore::Document::pageMutedStateDidChange):
2002         * dom/Document.h:
2003         * html/HTMLMediaElement.cpp:
2004         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
2005         * html/HTMLMediaElement.h:
2006         * page/MediaProducer.h:
2007
2008 2019-04-30  Youenn Fablet  <youenn@apple.com>
2009
2010         [macOS WK1] ASSERTION FAILED: formData in WebCore::ResourceRequest::doUpdateResourceHTTPBody()
2011         https://bugs.webkit.org/show_bug.cgi?id=196864
2012         <rdar://problem/49854497>
2013
2014         Reviewed by Alex Christensen.
2015
2016         In case of redirection, it is sometimes not possible to retrieve the form data
2017         from its NSInputStream in case of redirections.
2018         To handle this case, reuse the first request form data if the new request has a body.
2019         We also clear the HTTP content type in such a case if the original request has no content type.
2020
2021         Covered by re-enabled tests.
2022
2023         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2024         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
2025
2026 2019-04-30  Commit Queue  <commit-queue@webkit.org>
2027
2028         Unreviewed, rolling out r244773.
2029         https://bugs.webkit.org/show_bug.cgi?id=197436
2030
2031         Causing assertion failures on debug queues (Requested by
2032         ShawnRoberts on #webkit).
2033
2034         Reverted changeset:
2035
2036         "Make Document audio producers use WeakPtr"
2037         https://bugs.webkit.org/show_bug.cgi?id=197382
2038         https://trac.webkit.org/changeset/244773
2039
2040 2019-04-30  Commit Queue  <commit-queue@webkit.org>
2041
2042         Unreviewed, rolling out r244774.
2043         https://bugs.webkit.org/show_bug.cgi?id=197431
2044
2045         Causing assertion failures on debug queues (Requested by
2046         ShawnRoberts on #webkit).
2047
2048         Reverted changeset:
2049
2050         "Reject/throw when calling AudioContext methods on a stopped
2051         AudioContext"
2052         https://bugs.webkit.org/show_bug.cgi?id=197391
2053         https://trac.webkit.org/changeset/244774
2054
2055 2019-04-30  Alex Christensen  <achristensen@webkit.org>
2056
2057         Add WKContentRuleList ping resource-type
2058         https://bugs.webkit.org/show_bug.cgi?id=197325
2059         <rdar://problem/49841404>
2060
2061         Reviewed by Geoff Garen.
2062
2063         Tests: http/tests/contentextensions/block-ping-resource-type-ping.html and http/tests/contentextensions/block-ping-resource-type-raw.html
2064
2065         * contentextensions/ContentExtensionsBackend.cpp:
2066         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):
2067         * contentextensions/ContentExtensionsBackend.h:
2068         * loader/PingLoader.cpp:
2069         (WebCore::processContentRuleListsForLoad):
2070         (WebCore::PingLoader::sendPing):
2071         * loader/ResourceLoadInfo.cpp:
2072         (WebCore::ContentExtensions::readResourceType):
2073         (WebCore::ContentExtensions::ResourceLoadInfo::getResourceFlags const):
2074         * loader/ResourceLoadInfo.h:
2075         * page/UserContentProvider.cpp:
2076         (WebCore::UserContentProvider::processContentRuleListsForLoad):
2077         * page/UserContentProvider.h:
2078
2079 2019-04-30  Justin Fan  <justin_fan@apple.com>
2080
2081         [WebGPU] Move 'gpu' API entry point from DOMWindow to Navigator
2082         https://bugs.webkit.org/show_bug.cgi?id=197348
2083
2084         Reviewed by Myles C. Maxfield.
2085
2086         Latest API provides 'gpu' through Navigator instead of DOMWindow. Replace DOMWindowWebGPU with NavigatorGPU.
2087
2088         Existing tests updated to match. Add test: webgpu-enabled-in-worker.html to ensure workers can access WebGPU.
2089
2090         * CMakeLists.txt:
2091         * DerivedSources.make:
2092         * Modules/webgpu/NavigatorGPU.cpp:
2093         (WebCore::NavigatorGPU::from):
2094         (WebCore::NavigatorGPU::supplementName):
2095         (WebCore::NavigatorGPU::gpu):
2096         (WebCore::NavigatorGPU::gpu const):
2097         * Modules/webgpu/NavigatorGPU.h:
2098         * Modules/webgpu/NavigatorGPU.idl:
2099         * Modules/webgpu/WorkerNavigatorGPU.cpp:
2100         (WebCore::WorkerNavigatorGPU::from):
2101         (WebCore::WorkerNavigatorGPU::supplementName):
2102         (WebCore::WorkerNavigatorGPU::gpu):
2103         (WebCore::WorkerNavigatorGPU::gpu const):
2104         * Modules/webgpu/WorkerNavigatorGPU.h:
2105         * Modules/webgpu/WorkerNavigatorGPU.idl:
2106         * Sources.txt:
2107         * WebCore.xcodeproj/project.pbxproj:
2108
2109 2019-04-30  Zalan Bujtas  <zalan@apple.com>
2110
2111         Double-tapping a post to like doesn't work on Instagram.com (needs 'dblclick' event)
2112         https://bugs.webkit.org/show_bug.cgi?id=197347
2113         <rdar://problem/49393423>
2114
2115         Reviewed by Wenson Hsieh.
2116
2117         Tests: fast/events/touch/ios/double-tap-for-double-click1.html
2118                fast/events/touch/ios/double-tap-for-double-click2.html
2119
2120         * page/Frame.h:
2121         * page/ios/FrameIOS.mm:
2122         (WebCore::Frame::nodeRespondingToDoubleClickEvent):
2123
2124 2019-04-30  Youenn Fablet  <youenn@apple.com>
2125
2126         Reject/throw when calling AudioContext methods on a stopped AudioContext
2127         https://bugs.webkit.org/show_bug.cgi?id=197391
2128
2129         Reviewed by Eric Carlson.
2130
2131         Return InvalidStateError in that case.
2132         ASSERT that we do not call lazyInitialize after being stopped
2133         since this would mean we are doing unneeded processing.
2134
2135         Test: http/wpt/webaudio/audiocontext-stopped.html
2136
2137         * Modules/webaudio/AudioContext.cpp:
2138         (WebCore::AudioContext::lazyInitialize):
2139         (WebCore::AudioContext::createBufferSource):
2140         (WebCore::AudioContext::createMediaElementSource):
2141         (WebCore::AudioContext::createMediaStreamSource):
2142         (WebCore::AudioContext::createMediaStreamDestination):
2143         (WebCore::AudioContext::createScriptProcessor):
2144         (WebCore::AudioContext::createBiquadFilter):
2145         (WebCore::AudioContext::createWaveShaper):
2146         (WebCore::AudioContext::createPanner):
2147         (WebCore::AudioContext::createConvolver):
2148         (WebCore::AudioContext::createDynamicsCompressor):
2149         (WebCore::AudioContext::createAnalyser):
2150         (WebCore::AudioContext::createGain):
2151         (WebCore::AudioContext::createDelay):
2152         (WebCore::AudioContext::createChannelSplitter):
2153         (WebCore::AudioContext::createChannelMerger):
2154         (WebCore::AudioContext::createOscillator):
2155         (WebCore::AudioContext::createPeriodicWave):
2156         (WebCore::AudioContext::startRendering):
2157         (WebCore::AudioContext::suspend):
2158         (WebCore::AudioContext::resume):
2159         (WebCore::AudioContext::close):
2160         * Modules/webaudio/AudioContext.h:
2161         * Modules/webaudio/AudioContext.idl:
2162
2163 2019-04-30  Youenn Fablet  <youenn@apple.com>
2164
2165         Make Document audio producers use WeakPtr
2166         https://bugs.webkit.org/show_bug.cgi?id=197382
2167
2168         Reviewed by Eric Carlson.
2169
2170         Move from a hash set of raw pointers to a hash set of weak pointers.
2171         This helps make the code cleaner.
2172         No observable change of behavior.
2173
2174         * Modules/mediastream/MediaStreamTrack.h:
2175         * dom/Document.cpp:
2176         (WebCore::Document::addAudioProducer):
2177         (WebCore::Document::removeAudioProducer):
2178         (WebCore::Document::updateIsPlayingMedia):
2179         (WebCore::Document::pageMutedStateDidChange):
2180         * dom/Document.h:
2181         * html/HTMLMediaElement.cpp:
2182         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
2183         * html/HTMLMediaElement.h:
2184         * page/MediaProducer.h:
2185
2186 2019-04-30  Antti Koivisto  <antti@apple.com>
2187
2188         Tighten type of ScrollingTree:rootNode() to ScrollingTreeFrameScrollingNode
2189         https://bugs.webkit.org/show_bug.cgi?id=197414
2190
2191         Reviewed by Frédéric Wang.
2192
2193         * page/scrolling/ScrollingTree.cpp:
2194         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
2195         (WebCore::ScrollingTree::handleWheelEvent):
2196         (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
2197         (WebCore::ScrollingTree::updateTreeFromStateNode):
2198         * page/scrolling/ScrollingTree.h:
2199         (WebCore::ScrollingTree::rootNode const):
2200
2201 2019-04-30  Youenn Fablet  <youenn@apple.com>
2202
2203         Refactor AudioContext to register/unregister itself at construction/destruction time
2204         https://bugs.webkit.org/show_bug.cgi?id=197383
2205
2206         Reviewed by Eric Carlson.
2207
2208         Registering/Unregistering is cheap.
2209         Instead of registering/unregistering in initialize/uninitialize,
2210         move this code to constructor/destructor.
2211         No observable change of behavior.
2212
2213         * Modules/webaudio/AudioContext.cpp:
2214         (WebCore::AudioContext::AudioContext):
2215         (WebCore::AudioContext::~AudioContext):
2216         (WebCore::AudioContext::lazyInitialize):
2217         (WebCore::AudioContext::uninitialize):
2218         (WebCore::AudioContext::visibilityStateChanged):
2219
2220 2019-04-30  Michael Catanzaro  <mcatanzaro@igalia.com>
2221
2222         WebCore::StyleColorScheme should not have explicitly-declared copy constructor
2223         https://bugs.webkit.org/show_bug.cgi?id=197412
2224
2225         Reviewed by Don Olmstead.
2226
2227         Either we need to explicitly declare a copy assignment operator here, or the copy
2228         constructor needs to be removed. Having one without the other causes a huge warning spam
2229         with GCC 9. In this case, the copy constructor is redundant because it's identical to an
2230         implicitly-declared copy constructor, so let's just remove it.
2231
2232         * rendering/style/StyleColorScheme.h:
2233
2234 2019-04-30  Carlos Garcia Campos  <cgarcia@igalia.com>
2235
2236         [GTK] Support prefers-color-scheme media query
2237         https://bugs.webkit.org/show_bug.cgi?id=196685
2238
2239         Reviewed by Michael Catanzaro.
2240
2241         Change the gtk-application-prefer-dark-theme setting when tests change the useDarkModeAppearance setting.
2242
2243         * PlatformGTK.cmake:
2244         * testing/InternalSettings.cpp:
2245         (WebCore::InternalSettings::resetToConsistentState):
2246         (WebCore::InternalSettings::setUseDarkAppearanceInternal):
2247         (WebCore::InternalSettings::setUseDarkAppearance):
2248         * testing/InternalSettings.h:
2249
2250 2019-04-29  Truitt Savell  <tsavell@apple.com>
2251
2252         Unreviewed, rolling out r244755.
2253
2254         Casued several test failures on iOS
2255
2256         Reverted changeset:
2257
2258         "Double-tapping a post to like doesn't work on Instagram.com
2259         (needs 'dblclick' event)"
2260         https://bugs.webkit.org/show_bug.cgi?id=197347
2261         https://trac.webkit.org/changeset/244755
2262
2263 2019-04-29  Alex Christensen  <achristensen@webkit.org>
2264
2265         <rdar://problem/50299396> Fix internal High Sierra build
2266         https://bugs.webkit.org/show_bug.cgi?id=197388
2267
2268         * Configurations/Base.xcconfig:
2269
2270 2019-04-29  Zalan Bujtas  <zalan@apple.com>
2271
2272         Double-tapping a post to like doesn't work on Instagram.com (needs 'dblclick' event)
2273         https://bugs.webkit.org/show_bug.cgi?id=197347
2274         <rdar://problem/49393423>
2275
2276         Reviewed by Wenson Hsieh.
2277
2278         Tests: fast/events/touch/ios/double-tap-for-double-click1.html
2279                fast/events/touch/ios/double-tap-for-double-click2.html
2280
2281         * page/Frame.h:
2282         * page/ios/FrameIOS.mm:
2283         (WebCore::Frame::nodeRespondingToDoubleClickEvent):
2284
2285 2019-04-30  Simon Fraser  <simon.fraser@apple.com>
2286
2287         Transform is sometimes left in a bad state after an animation
2288         https://bugs.webkit.org/show_bug.cgi?id=197401
2289         rdar://problem/48179186
2290
2291         Reviewed by Dean Jackson.
2292         
2293         In some more complex compositing scenarios, at the end of an animation we'd
2294         fail to push a new transform onto a layer, because updateGeometry() would
2295         think there's an animation running (which there is, but in the "Ending" state).
2296
2297         It's simpler in this code to just always push transform and opacity to the layer;
2298         they will get overridden by the animation while it's running. The current code
2299         dates from the first landing of the file, and the reason for the if (!isRunningAcceleratedTransformAnimation)
2300         check is lost in the sands of time.
2301
2302         I was not able to get a reliable ref or layer tree test for this, because the next compositing update
2303         fixes it, and WTR seems to trigger one.  But the added test does show the bug
2304         in Safari, and is a good test to have.
2305
2306         Test: compositing/animation/transform-after-animation.html
2307
2308         * rendering/RenderLayerBacking.cpp:
2309         (WebCore::RenderLayerBacking::updateGeometry):
2310
2311 2019-04-29  Youenn Fablet  <youenn@apple.com>
2312
2313         getDisplayMedia should be called on user gesture
2314         https://bugs.webkit.org/show_bug.cgi?id=197356
2315
2316         Reviewed by Eric Carlson.
2317
2318         Allow getDisplayMedia on user gesture only.
2319         Otherwise reject the promise.
2320         Minor refactoring to align getDisplayMedia, getUserMedia and
2321         enumerateDevices when called with no document.
2322
2323         Test: fast/mediastream/screencapture-user-gesture.html
2324
2325         * Modules/mediastream/MediaDevices.cpp:
2326         (WebCore::MediaDevices::getUserMedia const):
2327         * Modules/mediastream/MediaDevices.h:
2328         * Modules/mediastream/NavigatorMediaDevices.h:
2329         * page/DOMWindow.h:
2330         * testing/Internals.cpp:
2331         (WebCore::Internals::setDisableGetDisplayMediaUserGestureConstraint):
2332         * testing/Internals.h:
2333         * testing/Internals.idl:
2334
2335 2019-04-29  Javier Fernandez  <jfernandez@igalia.com>
2336
2337         line should not be broken before the first space after a word
2338         https://bugs.webkit.org/show_bug.cgi?id=197278
2339
2340         Reviewed by Myles C. Maxfield.
2341
2342         The 'white-space: break-spaces' only adds breaking opportunities after
2343         a white space character. However, it's possible to break before the
2344         first space after a word when the feature is used in combination with
2345         other properties, like overflow-wrap.
2346
2347         However, breaking before the first space should not be allowed if
2348         there are previous opportunities. We wrongly assumed that we had to
2349         consider these previous breaking opportunities if the proper combination
2350         of line breaking properties is being used, so that breaking before the
2351         first space after a word is allowed.
2352
2353         This wrong assumption caused several issues, like the one described in
2354         the bug, that lead to incorrectly break before the first space even
2355         though there are previous opportunities, either white spaces or between
2356         letters.
2357
2358         Theses issues have been analyzed [1] by the CSS WG and finally agreed on a
2359         expected behavior, represented in the Web Platform tests added in this
2360         patch.
2361
2362         For the later case, of considering previous opportunities between
2363         letters, we have a seperated issue #952254, so the tests covering such
2364         cases will be added to the TestExpecations as Failure entries.
2365
2366         [1] https://github.com/w3c/csswg-drafts/issues/3701
2367
2368         Tests: imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-001.html
2369                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-002.html
2370                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-003.html
2371                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-004.html
2372                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-005.html
2373                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-006.html
2374                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-007.html
2375                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-008.html
2376                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-009.html
2377                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-010.html
2378                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-011.html
2379                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-012.html
2380                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-013.html
2381
2382         * rendering/line/BreakingContext.h:
2383         (WebCore::BreakingContext::handleText):
2384         (WebCore::BreakingContext::trailingSpacesHang):
2385
2386 2019-04-29  Simon Fraser  <simon.fraser@apple.com>
2387
2388         REGRESSION (r238090): animation on https://www.robotodyssey.online gets stuck; site broken
2389         https://bugs.webkit.org/show_bug.cgi?id=197381
2390
2391         Reviewed by Zalan Bujtas.
2392
2393         When -webkit-clip-path changes on a composited layer, we need to trigger a backing geometry update
2394         to push the changes to GraphicsLayers.
2395
2396         Test: compositing/style-change/clip-path-change.html
2397
2398         * rendering/RenderLayerCompositor.cpp:
2399         (WebCore::recompositeChangeRequiresGeometryUpdate):
2400
2401 2019-04-29  Chris Dumez  <cdumez@apple.com>
2402
2403         User-facing strings should use curly quotes instead of straight
2404         https://bugs.webkit.org/show_bug.cgi?id=197370
2405
2406         Reviewed by Geoffrey Garen.
2407
2408         Update localizable strings.
2409
2410         * en.lproj/Localizable.strings:
2411
2412 2019-04-29  Ross Kirsling  <ross.kirsling@sony.com>
2413
2414         Unreviewed fix for non-unified build after r244687.
2415
2416         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
2417
2418 2019-04-29  Youenn Fablet  <youenn@apple.com>
2419
2420         RTCTrackEvent should be delayed until the whole remote description is set
2421         https://bugs.webkit.org/show_bug.cgi?id=196808
2422         <rdar://problem/49802649>
2423
2424         Reviewed by Eric Carlson.
2425
2426         As per https://w3c.github.io/webrtc-pc/#set-description,
2427         fire events just before resolving the setRemoteDescription promise.
2428         This ensures that the exposed stream has all necessary tracks from the beginning.
2429         Pending track events are created in LibWebRTCMediaEndpoint and stored in PeerConnectionBackend.
2430
2431         Covered by updated test.
2432
2433         * Modules/mediastream/PeerConnectionBackend.cpp:
2434         (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
2435         (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
2436         (WebCore::PeerConnectionBackend::addPendingTrackEvent):
2437         (WebCore::PeerConnectionBackend::stop):
2438         * Modules/mediastream/PeerConnectionBackend.h:
2439         * Modules/mediastream/RTCPeerConnection.cpp:
2440         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2441         (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
2442         (WebCore::LibWebRTCMediaEndpoint::addPendingTrackEvent):
2443         (WebCore::LibWebRTCMediaEndpoint::newTransceiver):
2444         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2445
2446 2019-04-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2447
2448         REGRESSION(r244635): [GTK] Wrong background color used in non-dark mode
2449         https://bugs.webkit.org/show_bug.cgi?id=197276
2450
2451         Reviewed by Michael Catanzaro.
2452
2453         Since r244635, we are now getting the frame view background color from the theme. That's correct for dark mode,
2454         but in non-dark mode we still want to use white backgrounds by default. This made a lot of tests to fail.
2455
2456         * css/CSSValueKeywords.in: Add -webkit-control-background when HAVE(OS_DARK_MODE_SUPPORT).
2457         * css/html.css: Use -webkit-control-background instead of -apple-system-control-background.
2458         * page/FrameView.cpp:
2459         (WebCore::FrameView::updateBackgroundRecursively): Use CSSValueWindow instead of CSSValueWindowframe.
2460         * rendering/RenderThemeGtk.cpp:
2461         (WebCore::RenderThemeGtk::systemColor const): Only get the window background from the theme in dark mode. Handle
2462         also CSSValueWebkitControlBackground.
2463         * rendering/RenderThemeMac.mm:
2464         (WebCore::RenderThemeMac::systemColor const): Handle CSSValueWebkitControlBackground when HAVE(OS_DARK_MODE_SUPPORT).
2465
2466 2019-04-28  Andy Estes  <aestes@apple.com>
2467
2468         [Apple Pay] Increment the API version from 6 to 7
2469         https://bugs.webkit.org/show_bug.cgi?id=197041
2470         <rdar://problem/49986625>
2471
2472         Reviewed by Geoffrey Garen.
2473
2474         * Modules/applepay/PaymentCoordinatorClient.cpp:
2475         (WebCore::PaymentCoordinatorClient::supportsVersion):
2476
2477 2019-04-28  Andy Estes  <aestes@apple.com>
2478
2479         Fix the watchOS engineering build.
2480
2481         * Modules/webgpu/WebGPUComputePassEncoder.cpp: Included Logging.h.
2482
2483 2019-04-28  Youenn Fablet  <youenn@apple.com>
2484
2485         Remove no longer needed mDNS ICE candidate resolution code
2486         https://bugs.webkit.org/show_bug.cgi?id=197315
2487
2488         Reviewed by Eric Carlson.
2489
2490         No change of behavior.
2491         Removed code is no longer exercised as mDNS resolution happens inside libwebrtc
2492         using the same resolution mechanism as for TURN/STUN server names.
2493
2494         * Modules/mediastream/PeerConnectionBackend.cpp:
2495         (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
2496         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
2497         * Modules/mediastream/PeerConnectionBackend.h:
2498
2499 2019-04-27  Simon Fraser  <simon.fraser@apple.com>
2500
2501         Move some Compositing logging to the Layers log channel
2502         https://bugs.webkit.org/show_bug.cgi?id=197345
2503
2504         Reviewed by Sam Weinig.
2505
2506         Make Compositing logging a bit less verbose by moving the GraphicsLayer tree dump
2507         to the Layers log channel. Also log GraphicsLayers after flushing, when we'll have
2508         accurate visible rects. 
2509
2510         * platform/graphics/ca/GraphicsLayerCA.cpp:
2511         (WebCore::GraphicsLayerCA::updateCoverage):
2512         * rendering/RenderLayerCompositor.cpp:
2513         (WebCore::layersLogEnabled):
2514         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
2515         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2516
2517 2019-04-27  Megan Gardner  <megan_gardner@apple.com>
2518
2519         Lookup only looking up the first word in selection
2520         https://bugs.webkit.org/show_bug.cgi?id=197341
2521         <rdar://problem/48221414>
2522
2523         Reviewed by Wenson Hsieh.
2524
2525         Lookup is not testable.
2526
2527         Reveal needs the full range in order to correctly create the item for the popover.
2528
2529         * editing/cocoa/DictionaryLookup.mm:
2530         (WebCore::showPopupOrCreateAnimationController):
2531
2532 2019-04-26  Jer Noble  <jer.noble@apple.com>
2533
2534         Reduce the number of copies made during SourceBufferPrivateAVFObjC::append() using SharedBuffer
2535         https://bugs.webkit.org/show_bug.cgi?id=197335
2536         <rdar://problem/49175604>
2537
2538         Rubber-stamped by Alex Christensen.
2539
2540         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2541         (WebCore::SourceBufferPrivateAVFObjC::append):
2542
2543 2019-04-26  Jessie Berlin  <jberlin@webkit.org>
2544
2545         Add new mac target numbers
2546         https://bugs.webkit.org/show_bug.cgi?id=197313
2547
2548         Reviewed by Alex Christensen.
2549
2550         * Configurations/Version.xcconfig:
2551         * Configurations/WebKitTargetConditionals.xcconfig:
2552
2553 2019-04-26  Commit Queue  <commit-queue@webkit.org>
2554
2555         Unreviewed, rolling out r244708.
2556         https://bugs.webkit.org/show_bug.cgi?id=197334
2557
2558         "Broke the debug build" (Requested by rmorisset on #webkit).
2559
2560         Reverted changeset:
2561
2562         "All prototypes should call didBecomePrototype()"
2563         https://bugs.webkit.org/show_bug.cgi?id=196315
2564         https://trac.webkit.org/changeset/244708
2565
2566 2019-04-26  Robin Morisset  <rmorisset@apple.com>
2567
2568         All prototypes should call didBecomePrototype()
2569         https://bugs.webkit.org/show_bug.cgi?id=196315
2570
2571         Reviewed by Saam Barati.
2572
2573         It was found by existing tests, with the new assert in JSC::Structure
2574
2575         * bindings/js/JSWindowProxy.cpp:
2576         (WebCore::JSWindowProxy::setWindow):
2577         * bindings/scripts/CodeGeneratorJS.pm:
2578         (GeneratePrototypeDeclaration):
2579         (GenerateConstructorHelperMethods):
2580
2581 2019-04-26  Eric Carlson  <eric.carlson@apple.com>
2582
2583         Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
2584         https://bugs.webkit.org/show_bug.cgi?id=197171
2585         <rdar://problem/47454979>
2586
2587         Reviewed by Youenn Fablet.
2588
2589         Tests: TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm
2590
2591         * Modules/plugins/QuickTimePluginReplacement.mm:
2592         (WebCore::jsValueWithValueInContext):
2593         (WebCore::jsValueWithAVMetadataItemInContext):
2594         * WebCore.xcodeproj/project.pbxproj:
2595         * platform/audio/ios/AudioSessionIOS.mm:
2596         (WebCore::AudioSession::setCategory):
2597         (WebCore::AudioSession::category const):
2598         (WebCore::AudioSession::routeSharingPolicy const):
2599         (WebCore::AudioSession::routingContextUID const):
2600         (WebCore::AudioSession::sampleRate const):
2601         (WebCore::AudioSession::bufferSize const):
2602         (WebCore::AudioSession::numberOfOutputChannels const):
2603         (WebCore::AudioSession::tryToSetActiveInternal):
2604         (WebCore::AudioSession::preferredBufferSize const):
2605         (WebCore::AudioSession::setPreferredBufferSize):
2606         * platform/audio/ios/MediaSessionManagerIOS.mm:
2607         (-[WebMediaSessionHelper initWithCallback:]):
2608         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
2609         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
2610         (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const):
2611         (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const):
2612         (WebCore::AVTrackPrivateAVFObjCImpl::label const):
2613         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
2614         (WebCore::AudioSourceProviderAVFObjC::createMix):
2615         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
2616         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
2617         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
2618         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
2619         (WebCore::AVFoundationMIMETypeCache::canDecodeType):
2620         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
2621         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
2622         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistableState):
2623         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys):
2624         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability):
2625         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
2626         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
2627         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
2628         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
2629         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
2630         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
2631         (WebCore::CDMSessionAVContentKeySession::isAvailable):
2632         (WebCore::CDMSessionAVContentKeySession::releaseKeys):
2633         (WebCore::CDMSessionAVContentKeySession::update):
2634         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
2635         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
2636         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
2637         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
2638         (WebCore::CDMSessionAVStreamSession::releaseKeys):
2639         (WebCore::CDMSessionAVStreamSession::update):
2640         (WebCore::CDMSessionAVStreamSession::setStreamSession):
2641         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
2642         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
2643         (WebCore::imageDecoderAssetOptions):
2644         (WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC):
2645         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
2646         (WebCore::ImageDecoderAVFObjC::readSamples):
2647         (SOFT_LINK_CONSTANT_MAY_FAIL): Deleted.
2648         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
2649         (WebCore::InbandTextTrackPrivateAVFObjC::label const):
2650         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
2651         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label const):
2652         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2653         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
2654         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2655         (WebCore::assetCacheForPath):
2656         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
2657         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
2658         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
2659         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
2660         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
2661         (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState):
2662         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
2663         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem):
2664         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
2665         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
2666         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
2667         (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
2668         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
2669         (WebCore::determineChangedTracksFromNewTracksAndOldItems):
2670         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
2671         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
2672         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
2673         (WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
2674         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia):
2675         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia):
2676         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia):
2677         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
2678         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
2679         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
2680         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
2681         (WebCore::exernalDeviceDisplayNameForPlayer):
2682         (WebCore::metadataType):
2683         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
2684         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2685         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
2686         (-[WebCoreAVFPullDelegate outputSequenceWasFlushed:]):
2687         (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks): Deleted.
2688         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2689         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
2690         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
2691         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
2692         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
2693         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession):
2694         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2695         (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
2696         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
2697         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
2698         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2699         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
2700         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
2701         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
2702         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
2703         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
2704         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2705         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
2706         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
2707         (WebCore::PlatformCALayerCocoa::clone const):
2708         (WebCore::PlatformCALayerCocoa::avPlayerLayer const):
2709         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
2710         (WebCore::validateHEVCParameters):
2711         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
2712         (getAVSpeechUtteranceDefaultSpeechRate):
2713         (getAVSpeechUtteranceMaximumSpeechRate):
2714         (-[WebSpeechSynthesisWrapper speakUtterance:]):
2715         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
2716         (SOFT_LINK_CONSTANT): Deleted.
2717         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2718         (-[WebAVPlayerLayer init]):
2719         (-[WebAVPlayerLayer layoutSublayers]):
2720         (-[WebAVPlayerLayer setVideoGravity:]):
2721         (-[WebAVPlayerLayer videoRect]):
2722         (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView):
2723         * platform/mac/SerializedPlatformRepresentationMac.mm:
2724         (WebCore::jsValueWithValueInContext):
2725         (WebCore::jsValueWithAVMetadataItemInContext):
2726         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
2727         (WebCore::getAVFormatIDKeyWithFallback):
2728         (WebCore::getAVNumberOfChannelsKeyWithFallback):
2729         (WebCore::getAVSampleRateKeyWithFallback):
2730         (WebCore::getAVEncoderBitRateKeyWithFallback):
2731         (WebCore::MediaRecorderPrivateWriter::create):
2732         (WebCore::MediaRecorderPrivateWriter::setVideoInput):
2733         (WebCore::MediaRecorderPrivateWriter::setAudioInput):
2734         * platform/mediastream/RealtimeVideoSource.h:
2735         * platform/mediastream/VideoPreset.h:
2736         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
2737         (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):
2738         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
2739         (-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]):
2740         (-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]):
2741         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2742         (WebCore::deviceIsAvailable):
2743         (WebCore::AVCaptureDeviceManager::updateCachedAVCaptureDevices):
2744         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
2745         (WebCore::AVCaptureDeviceManager::isAvailable):
2746         (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager):
2747         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2748         (WebCore::AVVideoPreset::create):
2749         (WebCore::AVVideoPreset::AVVideoPreset):
2750         (WebCore::AVVideoCaptureSource::create):
2751         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
2752         (WebCore::AVVideoCaptureSource::capabilities):
2753         (WebCore::sensorOrientationFromVideoOutput):
2754         (WebCore::AVVideoCaptureSource::setupSession):
2755         (WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
2756         (WebCore::AVVideoCaptureSource::setupCaptureSession):
2757         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
2758         (WebCore::AVVideoCaptureSource::generatePresets):
2759         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
2760         (-[WebCoreAVVideoCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]):
2761
2762 2019-04-26  Commit Queue  <commit-queue@webkit.org>
2763
2764         Unreviewed, rolling out r244683.
2765         https://bugs.webkit.org/show_bug.cgi?id=197320
2766
2767         Causing crash on iOS Simulator and EWS failures (Requested by
2768         sroberts on #webkit).
2769
2770         Reverted changeset:
2771
2772         "[iOS] Add internal setting to force -webkit-text-size-adjust
2773         to "auto""
2774         https://bugs.webkit.org/show_bug.cgi?id=197275
2775         https://trac.webkit.org/changeset/244683
2776
2777 2019-04-26  Youenn Fablet  <youenn@apple.com>
2778
2779         Use normal loading path for ping loads
2780         https://bugs.webkit.org/show_bug.cgi?id=196807
2781
2782         Reviewed by Alex Christensen.
2783
2784         Make use of regular code path for ping loads and beacon.
2785         This is done conditionally on KeepAlive flag.
2786         The benefits are a single loading code path and service worker interception.
2787
2788         For that purpose, introduce a LoaderStrategy switch based on KeepAlive runtime flag.
2789         This switch is used to use ping loads when keepAlive is set or regular loads.
2790         In case of regular loads, the keepAlive flag should be used to extend the lifetime of the load.
2791
2792         Migrate ping loads to use CachedResourceLoader instead of PingLoad.
2793         For that purpose, introduce a new Ping CachedResource type.
2794
2795         Covered by existing tests.
2796
2797         * Modules/beacon/NavigatorBeacon.cpp:
2798         (WebCore::NavigatorBeacon::sendBeacon):
2799         * inspector/agents/InspectorPageAgent.cpp:
2800         (WebCore::InspectorPageAgent::inspectorResourceType):
2801         * loader/LinkLoader.cpp:
2802         (WebCore::createLinkPreloadResourceClient):
2803         * loader/LoaderStrategy.h:
2804         * loader/PingLoader.cpp:
2805         (WebCore::PingLoader::loadImage):
2806         (WebCore::PingLoader::sendPing):
2807         (WebCore::PingLoader::sendViolationReport):
2808         (WebCore::PingLoader::startPingLoad):
2809         * loader/PingLoader.h:
2810         * loader/ResourceLoadInfo.cpp:
2811         (WebCore::toResourceType):
2812         * loader/SubresourceLoader.cpp:
2813         (WebCore::logResourceLoaded):
2814         * loader/cache/CachedResource.cpp:
2815         (WebCore::CachedResource::defaultPriorityForResourceType):
2816         (WebCore::CachedResource::load):
2817         (WebCore::CachedResource::cancelLoad):
2818         * loader/cache/CachedResource.h:
2819         (WebCore::CachedResource::shouldUsePingLoad):
2820         (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const):
2821         * loader/cache/CachedResourceLoader.cpp:
2822         (WebCore::createResource):
2823         (WebCore::CachedResourceLoader::requestPingResource):
2824         (WebCore::contentTypeFromResourceType):
2825         (WebCore::CachedResourceLoader::checkInsecureContent const):
2826         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const):
2827         (WebCore::CachedResourceLoader::canRequest):
2828         (WebCore::isResourceSuitableForDirectReuse):
2829         (WebCore::destinationForType):
2830         * loader/cache/CachedResourceLoader.h:
2831
2832 2019-04-26  Alex Christensen  <achristensen@webkit.org>
2833
2834         Fix Windows build after r244695
2835        ​https://bugs.webkit.org/show_bug.cgi?id=197165
2836
2837         * loader/PingLoader.cpp:
2838
2839 2019-04-26  Alex Christensen  <achristensen@webkit.org>
2840
2841         Fix internal High Sierra build after r244653
2842         https://bugs.webkit.org/show_bug.cgi?id=197131
2843
2844         * DerivedSources.make:
2845         -std=gnu++17 didn't exist yet.  -std=gnu++1z did.
2846
2847 2019-04-26  Alex Christensen  <achristensen@webkit.org>
2848
2849         Add ENABLE(CONTENT_EXTENSIONS) and namespace ContentExtensions to ResourceLoadInfo.h
2850         https://bugs.webkit.org/show_bug.cgi?id=197165
2851
2852         Reviewed by Youenn Fablet.
2853
2854         No change in behavior.  This will just make it harder for people working on the loader to mistake
2855         these ContentExtension specific structures for other structures general to loading.
2856         One such mistake was made in r244248.
2857
2858         * Modules/websockets/WebSocketChannel.cpp:
2859         (WebCore::WebSocketChannel::connect):
2860         * contentextensions/ContentExtensionsBackend.h:
2861         * css/StyleSheetContents.cpp:
2862         (WebCore::StyleSheetContents::subresourcesAllowReuse const):
2863         * html/HTMLMediaElement.cpp:
2864         (WebCore::HTMLMediaElement::loadResource):
2865         * loader/FrameLoader.cpp:
2866         (WebCore::FrameLoader::loadResourceSynchronously):
2867         * loader/NetscapePlugInStreamLoader.cpp:
2868         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
2869         * loader/PingLoader.cpp:
2870         (WebCore::processContentRuleListsForLoad):
2871         (WebCore::PingLoader::loadImage):
2872         (WebCore::PingLoader::sendPing):
2873         (WebCore::PingLoader::sendViolationReport):
2874         * loader/ResourceLoadInfo.cpp:
2875         (WebCore::toResourceType): Deleted.
2876         (WebCore::readResourceType): Deleted.
2877         (WebCore::readLoadType): Deleted.
2878         (WebCore::ResourceLoadInfo::isThirdParty const): Deleted.
2879         (WebCore::ResourceLoadInfo::getResourceFlags const): Deleted.
2880         * loader/ResourceLoadInfo.h:
2881         * loader/ResourceLoader.cpp:
2882         (WebCore::ResourceLoader::willSendRequestInternal):
2883         * loader/ResourceLoader.h:
2884         * loader/SubresourceLoader.cpp:
2885         (WebCore::SubresourceLoader::SubresourceLoader):
2886         * loader/cache/CachedResourceLoader.cpp:
2887         (WebCore::CachedResourceLoader::requestResource):
2888         * page/DOMWindow.cpp:
2889         (WebCore::DOMWindow::open):
2890         * page/UserContentProvider.cpp:
2891         (WebCore::UserContentProvider::processContentRuleListsForLoad):
2892         (WebCore::UserContentProvider::actionsForResourceLoad):
2893         * page/UserContentProvider.h:
2894
2895 2019-04-26  Alex Christensen  <achristensen@webkit.org>
2896
2897         Fix an internal High Sierra build after r244653
2898        ​https://bugs.webkit.org/show_bug.cgi?id=197131
2899
2900         * DerivedSources.make:
2901         Apparently we can't use gnu++17 when preprocessing Platform.h in the makefile.
2902
2903 2019-04-26  Chris Fleizach  <cfleizach@apple.com>
2904
2905         AX: Provide iOS method for setting focus
2906         https://bugs.webkit.org/show_bug.cgi?id=197200
2907         <rdar://problem/50131679>
2908
2909         Reviewed by Alex Christensen.
2910
2911         Put the focus setting code in a place that iOS and macOS can access.
2912         Override a platform level method for setting focus on iOS.
2913
2914         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2915         (-[WebAccessibilityObjectWrapper _accessibilitySetFocus:]):
2916         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
2917         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2918         (-[WebAccessibilityObjectWrapperBase baseAccessibilitySetFocus:]):
2919         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2920         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
2921
2922 2019-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
2923
2924         propertyRegistry() was not overridden for SVGFEFloodElement and SVGFEMergeElement
2925         https://bugs.webkit.org/show_bug.cgi?id=197303
2926
2927         Reviewed by Alex Christensen.
2928
2929         Therefore SVGElement::propertyRegistry() was called instead. This means
2930         these two elements will not have access to the properties of the base
2931         class SVGFilterPrimitiveStandardAttributes.
2932
2933         Tests: svg/dom/SVGFEFloodElement-filter-standard-attributes.svg
2934
2935         * svg/SVGElement.cpp:
2936         (WebCore::SVGElement::commitPropertyChange):
2937         * svg/SVGFEFloodElement.h:
2938         * svg/SVGFEMergeElement.h:
2939
2940 2019-04-26  Youenn Fablet  <youenn@apple.com>
2941
2942         [Mac WK2 iOS Sim] Layout Test imported/w3c/web-platform-tests/webrtc/RTCRtpReceiver-getSynchronizationSources.https.html is a flaky failure
2943         https://bugs.webkit.org/show_bug.cgi?id=196633
2944         <rdar://problem/49627667>
2945
2946         Reviewed by Alex Christensen.
2947
2948         Use formula defined in https://w3c.github.io/webrtc-stats/#dom-rtcrtpcontributingsourcestats-audiolevel
2949         to compute the audio level from the RTP header information.
2950         Covered by rebased test.
2951
2952         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
2953         (WebCore::fillRTCRtpContributingSource):
2954
2955 2019-04-26  Sihui Liu  <sihui_liu@apple.com>
2956
2957         Stop IDB transactions to release locked database files when network process is ready to suspend
2958         https://bugs.webkit.org/show_bug.cgi?id=196372
2959         <rdar://problem/48930116>
2960
2961         Reviewed by Brady Eidson.
2962
2963         Suspend IDB database thread and finish ongoing IDB transactions on the main thread before suspending network 
2964         process.
2965
2966         API test: IndexedDB.IndexedDBSuspendImminently
2967
2968         * Modules/indexeddb/server/IDBBackingStore.h:
2969         * Modules/indexeddb/server/IDBServer.cpp:
2970         (WebCore::IDBServer::IDBServer::tryStop):
2971         (WebCore::IDBServer::IDBServer::resume):
2972         * Modules/indexeddb/server/IDBServer.h:
2973         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2974         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: Remove some error log messages, because now we may try
2975         performing database operations without an active transaction if the transaction is finished on the main thread.
2976         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
2977         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
2978         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
2979         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
2980         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
2981         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
2982         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
2983         (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
2984         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
2985         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
2986         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
2987         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
2988         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
2989         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
2990         (WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
2991         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
2992         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
2993         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
2994         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
2995         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
2996         (WebCore::IDBServer::SQLiteIDBBackingStore::hasTransaction const):
2997         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2998         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2999         (WebCore::IDBServer::UniqueIDBDatabase::prepareToFinishTransaction):
3000         (WebCore::IDBServer::UniqueIDBDatabase::commitTransactionAfterQuotaCheck):
3001         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction):
3002         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
3003         (WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction):
3004         (WebCore::IDBServer::UniqueIDBDatabase::abortTransactionOnMainThread):
3005         (WebCore::IDBServer::UniqueIDBDatabase::commitTransactionOnMainThread):
3006         (WebCore::IDBServer::UniqueIDBDatabase::finishActiveTransactions):
3007         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3008         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
3009         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::setState):
3010         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::state const):
3011         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::setResult):
3012         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::result const):
3013         * platform/sql/SQLiteDatabaseTracker.cpp:
3014         (WebCore::SQLiteDatabaseTracker::hasTransactionInProgress):
3015         * platform/sql/SQLiteDatabaseTracker.h:
3016
3017 2019-04-26  Takashi Komori  <Takashi.Komori@sony.com>
3018
3019         [Curl] Fix Curl Request Scheduler not to release wrong Curl handle when request is cancelled.
3020         https://bugs.webkit.org/show_bug.cgi?id=191650
3021
3022         Reviewed by Fujii Hironori.
3023
3024         Test: http/tests/misc/repeat-open-cancel.html
3025
3026         * platform/network/curl/CurlRequest.cpp:
3027         (WebCore::CurlRequest::cancel):
3028         (WebCore::CurlRequest::isCancelled):
3029         (WebCore::CurlRequest::isCompletedOrCancelled):
3030         (WebCore::CurlRequest::didCompleteTransfer):
3031         (WebCore::CurlRequest::completeDidReceiveResponse):
3032         (WebCore::CurlRequest::pausedStatusChanged):
3033         * platform/network/curl/CurlRequest.h:
3034         (WebCore::CurlRequest::isCompleted const): Deleted.
3035         (WebCore::CurlRequest::isCancelled const): Deleted.
3036         (WebCore::CurlRequest::isCompletedOrCancelled const): Deleted.
3037         * platform/network/curl/CurlRequestScheduler.cpp:
3038         (WebCore::CurlRequestScheduler::cancel):
3039         (WebCore::CurlRequestScheduler::callOnWorkerThread):
3040         (WebCore::CurlRequestScheduler::startThreadIfNeeded):
3041         (WebCore::CurlRequestScheduler::stopThreadIfNoMoreJobRunning):
3042         (WebCore::CurlRequestScheduler::stopThread):
3043         (WebCore::CurlRequestScheduler::executeTasks):
3044         (WebCore::CurlRequestScheduler::workerThread):
3045         (WebCore::CurlRequestScheduler::startTransfer):
3046         (WebCore::CurlRequestScheduler::completeTransfer):
3047         (WebCore::CurlRequestScheduler::cancelTransfer):
3048         (WebCore::CurlRequestScheduler::finalizeTransfer):
3049         * platform/network/curl/CurlRequestScheduler.h:
3050
3051 2019-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
3052
3053         [iOS] Add internal setting to force -webkit-text-size-adjust to "auto"
3054         https://bugs.webkit.org/show_bug.cgi?id=197275
3055         <rdar://problem/50211019>
3056
3057         Reviewed by Simon Fraser.
3058
3059         This setting makes it easier to investigate the autosizing work we've been doing
3060         in https://bugs.webkit.org/show_bug.cgi?id=197250.
3061
3062         * page/Settings.yaml:
3063         * rendering/RenderBlockFlow.cpp:
3064         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
3065         * rendering/TextAutoSizing.cpp:
3066         (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
3067
3068 2019-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
3069
3070         [iOS] Implement idempotent mode for text autosizing
3071         https://bugs.webkit.org/show_bug.cgi?id=197250
3072         <rdar://problem/50211034>
3073
3074         Reviewed by Jon Lee.
3075
3076         Our text autosizing code has this interesting behavior where it is sensitive to the width of the text's container
3077         and the number of lines of text inside the element. Not only is it sensitive to those things, but as those things
3078         change, their values are stored inside the RenderObject itself and then never recomputed. This means that the text
3079         autosizing parameters are sensitive to the entire history of an element. So, a newly created element with the same
3080         style as an existing element can have dramatically different results.
3081
3082         This patch adds a new mode for text autosizing, which isn't sensitive to either of those things, and therefore
3083         maintains the invariant that a newly created element will behave the same as an existing element with the same style.
3084         Instead of using container size, it instead uses the viewport's initial scale. As the viewport's initial scale
3085         changes, new layouts will be triggered, which will cause the autosizing code to use the new value.
3086
3087         Tests: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-identity.html
3088                fast/text-autosizing/ios/idempotentmode/idempotent-autosizing.html
3089
3090         * page/FrameViewLayoutContext.cpp:
3091         (WebCore::FrameViewLayoutContext::applyTextSizingIfNeeded):
3092         * page/Page.cpp:
3093         (WebCore::Page::setInitialScale): WebKit will push the initial scale down into the page.
3094         * page/Page.h:
3095         (WebCore::Page::initialScale const):
3096         * page/SettingsBase.h:
3097         * page/cocoa/SettingsBaseCocoa.mm:
3098         (WebCore::SettingsBase::textAutosizingUsesIdempotentMode):
3099         (WebCore::SettingsBase::defaultTextAutosizingEnabled):
3100         * rendering/RenderBlockFlow.cpp:
3101         (WebCore::idempotentTextSize): Describe a piecewise-linear curve for the text size to follow. The curve scales
3102         depending on the viewport's initial scale.
3103         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
3104         * rendering/RenderBlockFlow.h:
3105         * rendering/RenderElement.cpp:
3106         (WebCore::includeNonFixedHeight): This new mode should consider max-height as well as height when determining if
3107         content overflows.
3108         (WebCore::RenderElement::adjustComputedFontSizesOnBlocks):
3109         (WebCore::RenderElement::resetTextAutosizing):
3110         * rendering/RenderElement.h:
3111         * rendering/RenderObject.h:
3112
3113 2019-04-25  Simon Fraser  <simon.fraser@apple.com>
3114
3115         REGRESSION (r234330): 3 legacy-animation-engine/compositing tests are flaky failures
3116         https://bugs.webkit.org/show_bug.cgi?id=188357
3117         <rdar://problem/42986633>
3118
3119         Reviewed by Dean Jackson.
3120
3121         DumpRenderTree had no code that set page.setCompositingPolicyOverride() to Normal, so some
3122         tests would fall into low memory mode and have different behavior.
3123         
3124         Fix by moving the code that calls setCompositingPolicyOverride(Normal) from the WK2 layer
3125         to Internals, so it's shared by DRT and WTR.
3126         
3127         We no longer need the WK2 C SPI glue.
3128
3129         * testing/Internals.cpp:
3130         (WebCore::Internals::resetToConsistentState):
3131
3132 2019-04-25  Sihui Liu  <sihui_liu@apple.com>
3133
3134         [ iOS Sim ] REGRESSION (r242986) Layout Test storage/indexeddb/modern/idbtransaction-objectstore-failures-private.html is a flaky failure
3135         https://bugs.webkit.org/show_bug.cgi?id=196357
3136         <rdar://problem/49386836>
3137
3138         Reviewed by Geoffrey Garen.
3139
3140         Dispatch IDBRequest event to IDBTransaction if event of IDBTransaction has not been dispatched.
3141
3142         Covered by existing tests.
3143
3144         * Modules/indexeddb/IDBRequest.cpp:
3145         (WebCore::IDBRequest::dispatchEvent):
3146         * Modules/indexeddb/IDBTransaction.cpp:
3147         (WebCore::IDBTransaction::dispatchEvent):
3148         * Modules/indexeddb/IDBTransaction.h:
3149
3150 2019-04-25  Chris Dumez  <cdumez@apple.com>
3151
3152         ASSERT(scriptExecutionContext()) in Performance::resourceTimingBufferFullTimerFired()
3153         https://bugs.webkit.org/show_bug.cgi?id=197300
3154         <rdar://problem/49965990>
3155
3156         Reviewed by Youenn Fablet.
3157
3158         We crash because the scriptExecutionContext has been destroyed by the time the m_resourceTimingBufferFullTimer
3159         timer fires. However, r241598 already makes sure that we stop the timer when the script execution context
3160         is destroyed. This makes me think that somebody restarts the timer *after* the script execution context has
3161         been destroyed. The thing is that we only start the timer in Performance::addResourceTiming() and there are
3162         only 2 call sites for this method. Both call sites get the Performance object from the Window object, which
3163         they get from the Document object. As a result, I would believe that the Window's document is alive, even
3164         though the Performance object's scriptExecutionContext is not. This could indicate that the Performance
3165         object's scriptExecutionContext gets out of sync with its Window's document. I have found one place where
3166         it could happen in theory (DOMWindow::didSecureTransitionTo()). I have not been able to write a test
3167         confirming my theory though so this is a speculative fix. I have also added a few assertions to help us
3168         track down the issue if my speculative fix turns out to be ineffective.
3169
3170         No new tests, we do not know how to reproduce.
3171
3172         * page/DOMWindow.cpp:
3173         (WebCore::DOMWindow::didSecureTransitionTo):
3174         This is a speculative fix for the crash. When a DOMWindow transitions from one document to
3175         another, reset its data members which store the DOMWindow's document to make sure that they
3176         do not get out of sync.
3177
3178         (WebCore::DOMWindow::crypto const):
3179         (WebCore::DOMWindow::navigator):
3180         (WebCore::DOMWindow::performance const):
3181         Add assertions to make sure that the member's scriptExecutionContext is in sync with
3182         the window's.
3183
3184         * page/Performance.cpp:
3185         (WebCore::Performance::addResourceTiming):
3186         Add assertion to make sure that the scriptExecutionContext() is non-null when calling this
3187         as this may start the m_resourceTimingBufferFullTimer timer. If my speculative fix above
3188         does not work, we should hit this and this should tell us which call site is causing this.
3189
3190 2019-04-25  Timothy Hatcher  <timothy@apple.com>
3191
3192         Disable ContentChangeObserver on iOSMac.
3193         https://bugs.webkit.org/show_bug.cgi?id=197292
3194         rdar://problem/49039957
3195
3196         Reviewed by Zalan Bujtas.
3197
3198         We don’t need to run any of ContentChangeObserver, because we have hover events on iOSMac.
3199         Disabling it skips the synthetic mouse move events and speeds up clicks.
3200
3201         * page/SettingsBase.cpp:
3202         (WebCore::SettingsBase::defaultContentChangeObserverEnabled): Return false for PLATFORM(IOSMAC).
3203
3204 2019-04-25  Timothy Hatcher  <timothy@apple.com>
3205
3206         Disable date and time inputs on iOSMac.
3207         https://bugs.webkit.org/show_bug.cgi?id=197287
3208         rdar://problem/46794376
3209
3210         Reviewed by Wenson Hsieh.
3211
3212         * Configurations/FeatureDefines.xcconfig:
3213         * platform/text/mac/LocaleMac.h:
3214         * platform/text/mac/LocaleMac.mm:
3215         (WebCore::LocaleMac::formatDateTime):
3216
3217 2019-04-25  Alex Christensen  <achristensen@webkit.org>
3218
3219         Fix more Windows builds after r244653
3220         https://bugs.webkit.org/show_bug.cgi?id=197131
3221
3222         * svg/properties/SVGAnimatedPropertyList.h:
3223         * svg/properties/SVGProperty.h:
3224         * svg/properties/SVGPropertyList.h:
3225
3226 2019-04-25  Alex Christensen  <achristensen@webkit.org>
3227
3228         Fix more builds after r244653
3229         https://bugs.webkit.org/show_bug.cgi?id=197131
3230
3231         * svg/properties/SVGValuePropertyList.h:
3232         Something is preventing MSVC from seeing protected constructors from subclasses.
3233
3234 2019-04-25  Per Arne Vollan  <pvollan@apple.com>
3235
3236         -[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:] never returns _WKWebsiteDataTypeCredentials
3237         https://bugs.webkit.org/show_bug.cgi?id=196991
3238         <rdar://problem/45507423>
3239
3240         Reviewed by Alex Christensen.
3241
3242         Add method to get all origins with persistent credentials from credential storage.
3243
3244         API tests: WKWebsiteDataStore.FetchNonPersistentCredentials
3245                    WKWebsiteDataStore.FetchPersistentCredentials
3246
3247         * platform/network/CredentialStorage.h:
3248         * platform/network/mac/CredentialStorageMac.mm:
3249         (WebCore::CredentialStorage::originsWithPersistentCredentials):
3250
3251 2019-04-25  Alex Christensen  <achristensen@webkit.org>
3252
3253         Fix MSVC build after r244653
3254         https://bugs.webkit.org/show_bug.cgi?id=197131
3255
3256         * svg/properties/SVGValueProperty.h:
3257         MSVC doesn't think it can access these protected constructors from subclasses.
3258         Make the build work and investigate this later.
3259
3260 2019-04-25  Alex Christensen  <achristensen@webkit.org>
3261
3262         Start using C++17
3263         https://bugs.webkit.org/show_bug.cgi?id=197131
3264
3265         Reviewed by Darin Adler.
3266
3267         * Configurations/Base.xcconfig:
3268         * DerivedSources.make:
3269
3270 2019-04-25  Commit Queue  <commit-queue@webkit.org>
3271
3272         Unreviewed, rolling out r244627.
3273         https://bugs.webkit.org/show_bug.cgi?id=197282
3274
3275         Causing internal build failures (Requested by ShawnRoberts on
3276         #webkit).
3277
3278         Reverted changeset:
3279
3280         "Create AVFoundationSoftLink.{h,mm} to reduce duplicate code"
3281         https://bugs.webkit.org/show_bug.cgi?id=197171
3282         https://trac.webkit.org/changeset/244627
3283
3284 2019-04-25  Antti Koivisto  <antti@apple.com>
3285
3286         redefinition of enumerator 'NSAttachmentCharacter' with Apple internal build
3287         https://bugs.webkit.org/show_bug.cgi?id=197279
3288
3289         Reviewed by Antoine Quint.
3290
3291         Try to fix the build.
3292
3293         * platform/mac/WebNSAttributedStringExtras.mm:
3294
3295 2019-04-25  Antti Koivisto  <antti@apple.com>
3296
3297         Visited link hash should be computed only once
3298         https://bugs.webkit.org/show_bug.cgi?id=197229
3299         <rdar://problem/48438924>
3300
3301         Reviewed by Alex Christensen.
3302
3303         Test: fast/history/visited-href-mutation.html
3304
3305         Visited link style is now based on the first target URL of the link element. Further href mutations don't affect styling.
3306
3307         * dom/Document.cpp:
3308         (WebCore::Document::updateBaseURL):
3309         * dom/VisitedLinkState.cpp:
3310         (WebCore::linkAttribute):
3311         (WebCore::linkHashForElement):
3312
3313         Visited link support is now limited to HTML and SVG <a> elements.
3314
3315         (WebCore::VisitedLinkState::invalidateStyleForLink):
3316         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
3317         * html/HTMLAnchorElement.cpp:
3318         (WebCore::HTMLAnchorElement::HTMLAnchorElement):
3319         (WebCore::HTMLAnchorElement::parseAttribute):
3320         * html/HTMLAnchorElement.h:
3321         (WebCore::HTMLAnchorElement::visitedLinkHash const):
3322         (WebCore::HTMLAnchorElement::invalidateCachedVisitedLinkHash): Deleted.
3323         * svg/SVGAElement.cpp:
3324         (WebCore::SVGAElement::visitedLinkHash const):
3325         * svg/SVGAElement.h:
3326
3327 2019-04-25  Philippe Normand  <pnormand@igalia.com>
3328
3329         [GStreamer] gst_element_get_state: assertion 'GST_IS_ELEMENT (element)' failed in WebCore::MediaPlayerPrivateGStreamer::paused
3330         https://bugs.webkit.org/show_bug.cgi?id=196691
3331
3332         Reviewed by Eric Carlson.
3333
3334         For gif assets, fail media loading early and notify the
3335         MediaPlayer by setting both network and ready states, so that the
3336         MediaPlayer will try with with the next media engine or pass the
3337         error to HTMLMediaElement if there are none.
3338
3339         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3340         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
3341         (WebCore::MediaPlayerPrivateGStreamer::loadingFailed):
3342         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3343
3344 2019-04-25  Philippe Normand  <pnormand@igalia.com>
3345
3346         [REGRESSION(r243197)][GStreamer] http/tests/media/clearkey/collect-webkit-media-session.html hits an ASSERT
3347         https://bugs.webkit.org/show_bug.cgi?id=197230
3348
3349         Reviewed by Xabier Rodriguez-Calvar.
3350
3351         Perform the resource loader disposal and destruction from the main
3352         thread. Also ensure there's no circular reference between the
3353         CachedResourceStreamingClient and WebKitWebSrc when disposing of
3354         the private WebKitWebSrc storage.
3355
3356         * platform/graphics/gstreamer/MainThreadNotifier.h:
3357         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3358         (_WebKitWebSrcPrivate::~_WebKitWebSrcPrivate):
3359         (webkit_web_src_class_init):
3360         (webKitWebSrcDispose):
3361         (webKitWebSrcCloseSession):
3362         (webKitWebSrcFinalize): Deleted.
3363
3364 2019-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
3365
3366         [GTK] Hardcoded text color in input fields
3367         https://bugs.webkit.org/show_bug.cgi?id=126907
3368
3369         Reviewed by Michael Catanzaro.
3370
3371         Enable HAVE_OS_DARK_MODE_SUPPORT for GTK port to ensure that dark mode is used when Page::useDarkAppearance()
3372         returns true. This patch reverts r232913, I'll reopen the bug, I think we need to find a better solution for
3373         that.
3374
3375         * CMakeLists.txt: Add HAVE_OS_DARK_MODE_SUPPORT to FEATURE_DEFINES_WITH_SPACE_SEPARATOR if enabled.
3376         * css/CSSDefaultStyleSheets.cpp: Ensure html{color:text} is used in simple style sheet when
3377         HAVE_OS_DARK_MODE_SUPPORT is enabled.
3378         * page/FrameView.cpp:
3379         (WebCore::FrameView::updateBackgroundRecursively): Use CSSValueWindowframe to get the frame view background
3380         color when HAVE_OS_DARK_MODE_SUPPORT is enabled for non-mac ports.
3381         * platform/gtk/RenderThemeWidget.cpp:
3382         (WebCore::RenderThemeWidget::getOrCreate): Create window widget.
3383         (WebCore::RenderThemeWindow::RenderThemeWindow): Add window widget.
3384         * platform/gtk/RenderThemeWidget.h:
3385         * rendering/RenderThemeGtk.cpp:
3386         (WebCore::RenderThemeGtk::disabledTextColor const): Always use the color from the theme for consistency with
3387         other form controls.
3388         (WebCore::RenderThemeGtk::systemColor const): Get the color from the theme for CSSValueText, CSSValueGraytext
3389         and CSSValueWindowframe.
3390         * rendering/RenderThemeGtk.h:
3391
3392 2019-04-24  Zalan Bujtas  <zalan@apple.com>
3393
3394         Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
3395         https://bugs.webkit.org/show_bug.cgi?id=196948
3396         <rdar://problem/49927131>
3397
3398         Reviewed by Tim Horton.
3399
3400         Covered by existing tests.
3401
3402         * loader/EmptyClients.h:
3403         * page/ChromeClient.h:
3404         * page/FrameView.cpp:
3405         (WebCore::FrameView::autoSizeIfEnabled):
3406         (WebCore::FrameView::enableAutoSizeMode):
3407         * page/FrameView.h:
3408
3409 2019-04-24  Youenn Fablet  <youenn@apple.com>
3410
3411         Do not restart WebRTC stats timer if backend is stopped
3412         https://bugs.webkit.org/show_bug.cgi?id=197257
3413         <rdar://problem/50095879>
3414
3415         Reviewed by Eric Carlson.
3416
3417         We used to stop and reschedule the stat gathering timer in case the
3418         gathering delay is changing. Timer should not be rescheduled if the backend is stopped.
3419
3420         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3421         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
3422
3423 2019-04-24  Andres Gonzalez  <andresg_22@apple.com>
3424
3425         Flaky crash under WebCore::AXObjectCache::stopCachingComputedObjectAttributes()
3426         https://bugs.webkit.org/show_bug.cgi?id=187391
3427         <rdar://problem/40681396
3428
3429         Check for null value returned by AccessibilityObject::axObjectCache.
3430
3431         Reviewed by Chris Fleizach.
3432
3433         No need for new test since existing tests caught this problem.
3434
3435         * accessibility/AccessibilityNodeObject.cpp:
3436         (WebCore::AccessibilityNodeObject::firstChild const):
3437         (WebCore::AccessibilityNodeObject::lastChild const):
3438         (WebCore::AccessibilityNodeObject::previousSibling const):
3439         (WebCore::AccessibilityNodeObject::nextSibling const):
3440         (WebCore::AccessibilityNodeObject::addChildren):
3441         (WebCore::AccessibilityNodeObject::anchorElement const):
3442         (WebCore::AccessibilityNodeObject::changeValueByStep):
3443         (WebCore::AccessibilityNodeObject::changeValueByPercent):
3444         (WebCore::AccessibilityNodeObject::textForLabelElement const):
3445         (WebCore::AccessibilityNodeObject::titleElementText const):
3446         (WebCore::AccessibilityNodeObject::alternativeText const):
3447         (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
3448         (WebCore::AccessibilityNodeObject::helpText const):
3449
3450 2019-04-24  Simon Fraser  <simon.fraser@apple.com>
3451
3452         REGRESSION (r242132): Nested position:sticky elements move incorrectly
3453         https://bugs.webkit.org/show_bug.cgi?id=197255
3454         rdar://problem/50137744
3455
3456         Reviewed by Zalan Bujtas.
3457         
3458         Revert to the behavior of the code before r242132, where we looked at the direct parent
3459         scrolling tree node instead of walking up the ancestor chain to find an enclosing scrolling node.
3460         This fixes nested sticky behavior.
3461
3462         Test: scrollingcoordinator/mac/nested-sticky.html
3463
3464         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
3465         (WebCore::ScrollingTreeStickyNode::applyLayerPositions):
3466
3467 2019-04-24  Eric Carlson  <eric.carlson@apple.com>
3468
3469         Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
3470         https://bugs.webkit.org/show_bug.cgi?id=197171
3471         <rdar://problem/47454979>
3472
3473         Reviewed by Youenn Fablet.
3474
3475         Tests: TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm
3476
3477         * Modules/plugins/QuickTimePluginReplacement.mm:
3478         (WebCore::jsValueWithValueInContext):
3479         (WebCore::jsValueWithAVMetadataItemInContext):
3480         * WebCore.xcodeproj/project.pbxproj:
3481         * platform/audio/ios/AudioSessionIOS.mm:
3482         (WebCore::AudioSession::setCategory):
3483         (WebCore::AudioSession::category const):
3484         (WebCore::AudioSession::routeSharingPolicy const):
3485         (WebCore::AudioSession::routingContextUID const):
3486         (WebCore::AudioSession::sampleRate const):
3487         (WebCore::AudioSession::bufferSize const):
3488         (WebCore::AudioSession::numberOfOutputChannels const):
3489         (WebCore::AudioSession::tryToSetActiveInternal):
3490         (WebCore::AudioSession::preferredBufferSize const):
3491         (WebCore::AudioSession::setPreferredBufferSize):
3492         * platform/audio/ios/MediaSessionManagerIOS.mm:
3493         (-[WebMediaSessionHelper initWithCallback:]):
3494         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
3495         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
3496         (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const):
3497         (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const):
3498         (WebCore::AVTrackPrivateAVFObjCImpl::label const):
3499         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
3500         (WebCore::AudioSourceProviderAVFObjC::createMix):
3501         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
3502         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
3503         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
3504         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
3505         (WebCore::AVFoundationMIMETypeCache::canDecodeType):
3506         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
3507         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
3508         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistableState):
3509         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys):
3510         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability):
3511         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
3512         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
3513         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
3514         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
3515         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
3516         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
3517         (WebCore::CDMSessionAVContentKeySession::isAvailable):
3518         (WebCore::CDMSessionAVContentKeySession::releaseKeys):
3519         (WebCore::CDMSessionAVContentKeySession::update):
3520         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
3521         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
3522         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
3523         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
3524         (WebCore::CDMSessionAVStreamSession::releaseKeys):
3525         (WebCore::CDMSessionAVStreamSession::update):
3526         (WebCore::CDMSessionAVStreamSession::setStreamSession):
3527         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
3528         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
3529         (WebCore::imageDecoderAssetOptions):
3530         (WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC):
3531         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
3532         (WebCore::ImageDecoderAVFObjC::readSamples):
3533         (SOFT_LINK_CONSTANT_MAY_FAIL): Deleted.
3534         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
3535         (WebCore::InbandTextTrackPrivateAVFObjC::label const):
3536         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
3537         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label const):
3538         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
3539         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
3540         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3541         (WebCore::assetCacheForPath):
3542         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
3543         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
3544         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
3545         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
3546         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
3547         (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState):
3548         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
3549         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem):
3550         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
3551         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
3552         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
3553         (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
3554         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
3555         (WebCore::determineChangedTracksFromNewTracksAndOldItems):
3556         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
3557         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
3558         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
3559         (WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
3560         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia):
3561         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia):
3562         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia):
3563         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
3564         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
3565         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
3566         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
3567         (WebCore::exernalDeviceDisplayNameForPlayer):
3568         (WebCore::metadataType):
3569         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
3570         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
3571         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
3572         (-[WebCoreAVFPullDelegate outputSequenceWasFlushed:]):
3573         (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks): Deleted.
3574         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3575         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
3576         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
3577         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
3578         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
3579         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession):
3580         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3581         (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
3582         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
3583         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
3584         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3585         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
3586         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
3587         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
3588         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
3589         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
3590         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3591         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
3592         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
3593         (WebCore::PlatformCALayerCocoa::clone const):
3594         (WebCore::PlatformCALayerCocoa::avPlayerLayer const):
3595         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
3596         (WebCore::validateHEVCParameters):
3597         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
3598         (getAVSpeechUtteranceDefaultSpeechRate):
3599         (getAVSpeechUtteranceMaximumSpeechRate):
3600         (-[WebSpeechSynthesisWrapper speakUtterance:]):
3601         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
3602         (SOFT_LINK_CONSTANT): Deleted.
3603         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3604         (-[WebAVPlayerLayer init]):
3605         (-[WebAVPlayerLayer layoutSublayers]):
3606         (-[WebAVPlayerLayer setVideoGravity:]):
3607         (-[WebAVPlayerLayer videoRect]):
3608         (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView):
3609         * platform/mac/SerializedPlatformRepresentationMac.mm:
3610         (WebCore::jsValueWithValueInContext):
3611         (WebCore::jsValueWithAVMetadataItemInContext):
3612         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
3613         (WebCore::getAVFormatIDKeyWithFallback):
3614         (WebCore::getAVNumberOfChannelsKeyWithFallback):
3615         (WebCore::getAVSampleRateKeyWithFallback):
3616         (WebCore::getAVEncoderBitRateKeyWithFallback):
3617         (WebCore::MediaRecorderPrivateWriter::create):
3618         (WebCore::MediaRecorderPrivateWriter::setVideoInput):
3619         (WebCore::MediaRecorderPrivateWriter::setAudioInput):
3620         * platform/mediastream/RealtimeVideoSource.h:
3621         * platform/mediastream/VideoPreset.h:
3622         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
3623         (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):
3624         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
3625         (-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]):
3626         (-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]):
3627         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
3628         (WebCore::deviceIsAvailable):
3629         (WebCore::AVCaptureDeviceManager::updateCachedAVCaptureDevices):
3630         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
3631         (WebCore::AVCaptureDeviceManager::isAvailable):
3632         (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager):
3633         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3634         (WebCore::AVVideoPreset::create):
3635         (WebCore::AVVideoPreset::AVVideoPreset):
3636         (WebCore::AVVideoCaptureSource::create):
3637         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
3638         (WebCore::AVVideoCaptureSource::capabilities):
3639         (WebCore::sensorOrientationFromVideoOutput):
3640         (WebCore::AVVideoCaptureSource::setupSession):
3641         (WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
3642         (WebCore::AVVideoCaptureSource::setupCaptureSession):
3643         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
3644         (WebCore::AVVideoCaptureSource::generatePresets):
3645         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
3646         (-[WebCoreAVVideoCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]):
3647
3648 2019-04-24  Brady Eidson  <beidson@apple.com>
3649
3650         XMLHTTPRequest POSTs to a custom WKURLSchemeHandler protocol are missing the HTTP body.
3651         https://bugs.webkit.org/show_bug.cgi?id=191362
3652
3653         Reviewed by Alex Christensen.
3654
3655         Covered by new API tests.
3656
3657         In 2008 some refactoring added an HTTP(S)-only restriction to copying the form body for
3658         XHRs that POST, and it added that restriction with no explanation.
3659
3660         We definitely want to allow that.
3661
3662         Blobs are broken at this time (covered by bug 197237)
3663
3664         * xml/XMLHttpRequest.cpp:
3665         (WebCore::XMLHttpRequest::send):
3666         (WebCore::XMLHttpRequest::sendBytesData):
3667
3668 2019-04-24  John Wilander  <wilander@apple.com>
3669
3670         Age out unconverted Ad Click Attributions after one week.
3671         https://bugs.webkit.org/show_bug.cgi?id=197238
3672         <rdar://problem/50177349>
3673
3674         Reviewed by Chris Dumez.
3675
3676         This patch adds the two functions AdClickAttribution::markAsExpired()
3677         and AdClickAttribution::hasExpired() which make use of the existing
3678         m_timeOfAdClick member.
3679
3680         Test: http/tests/adClickAttribution/expired-attributions-removed.html
3681
3682         * loader/AdClickAttribution.cpp:
3683         (WebCore::AdClickAttribution::markAsExpired):
3684         (WebCore::AdClickAttribution::hasExpired const):
3685         * loader/AdClickAttribution.h:
3686
3687 2019-04-24  Simon Fraser  <simon.fraser@apple.com>
3688
3689         REGRESSION (iOS 12.2): CSS perspective property value can only be set correctly once
3690         https://bugs.webkit.org/show_bug.cgi?id=197105
3691         rdar://problem/50068230
3692
3693         Reviewed by Zalan Bujtas.
3694
3695         Make sure we trigger a geometry update when style properties change that
3696         result in a StyleDifference::RecompositeLayer, and which are updated on layers
3697         via RenderLayerBacking::updateGeometry().
3698
3699         Tests: compositing/style-change/backface-visibility-change.html
3700                compositing/style-change/perspective-change.html
3701                compositing/style-change/perspective-origin-change.html
3702                compositing/style-change/transform-origin-change.html
3703                compositing/style-change/transform-style-change.html
3704
3705         * rendering/RenderLayerCompositor.cpp:
3706         (WebCore::recompositeChangeRequiresGeometryUpdate):
3707         (WebCore::RenderLayerCompositor::layerStyleChanged):
3708
3709 2019-04-24  Simon Fraser  <simon.fraser@apple.com>
3710
3711         Make it possible to control the renderTreeAsText output by setting options on testRunner
3712         https://bugs.webkit.org/show_bug.cgi?id=197133
3713
3714         Reviewed by Sam Weinig.
3715
3716         Add testRunner.setRenderTreeDumpOptions() and expose the subset of RenderAsTextFlag flags
3717         that make sense in testing (those that don't dump unstable data like addresses), and plumb
3718         these flags through the various framework layers.
3719
3720         Convert RenderAsTextBehavior to an OptionSet<RenderAsTextFlag>.
3721
3722         Fix code generation in WebKitTestRunner to generate bindings for IDL const values,
3723         and hand-code DumpRenderTree bindings.
3724
3725         Some cleanup of the TestRunners, using member initializers.
3726
3727         Test: fast/harness/render-tree-as-text-options.html
3728
3729         * rendering/RenderLayer.cpp:
3730         (WebCore::showLayerTree):
3731         * rendering/RenderTreeAsText.cpp:
3732         (WebCore::RenderTreeAsText::writeRenderObject):
3733         (WebCore::writeDebugInfo):
3734         (WebCore::write):
3735         (WebCore::writeLayer):
3736         (WebCore::writeLayerRenderers):
3737         (WebCore::writeLayers):
3738         (WebCore::externalRepresentation):
3739         * rendering/RenderTreeAsText.h:
3740         (WebCore::externalRepresentation):
3741         (WebCore::write):
3742         (WebCore::writeDebugInfo):
3743         (): Deleted.
3744         * rendering/svg/SVGRenderTreeAsText.cpp:
3745         (WebCore::writePositionAndStyle):
3746         (WebCore::writeStandardPrefix):
3747         (WebCore::writeChildren):
3748         (WebCore::writeSVGResourceContainer):
3749         (WebCore::writeSVGContainer):
3750         (WebCore::write):
3751         (WebCore::writeSVGText):
3752         (WebCore::writeSVGInlineText):
3753         (WebCore::writeSVGImage):
3754         (WebCore::writeSVGGradientStop):
3755         (WebCore::writeResources):
3756         * rendering/svg/SVGRenderTreeAsText.h:
3757
3758 2019-04-24  Antoine Quint  <graouts@apple.com>
3759
3760         [iOS] Calling preventDefault() when handling a pointerdown event should not prevent panning, zooming or click event dispatch
3761         https://bugs.webkit.org/show_bug.cgi?id=195839
3762         <rdar://problem/48946154>
3763
3764         Reviewed by Brent Fulgham.
3765
3766         Tests: pointerevents/ios/pointer-events-prevent-default-allows-click-event.html
3767                pointerevents/ios/pointer-events-prevent-default-allows-scrolling.html
3768
3769         The Pointer Events specification defines that the default action of any and all pointer events MUST NOT
3770         be a manipulation of the viewport (e.g. panning or zooming). In practice, this means that calling
3771         preventDefault() while handling a Pointer Event has no effect on the inner workings of the user agent,
3772         so we change the method signature of PointerCaptureController::dispatchEventForTouchAtIndex() to return
3773         void since we don't need to know whether preventDefault() was called.
3774
3775         https://www.w3.org/TR/pointerevents/#declaring-candidate-regions-for-default-touch-behaviors
3776
3777         * page/PointerCaptureController.cpp:
3778         (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
3779         * page/PointerCaptureController.h:
3780
3781 2019-04-24  Frederic Wang  <fwang@igalia.com>
3782
3783         With async scrolling enabled, this MathML test asserts
3784         https://bugs.webkit.org/show_bug.cgi?id=196123
3785
3786         This patch ensures that updateScrollInfoAfterLayout() is called during MathML layout. This
3787         fixes assertions when async scrolling is enabled and MathML elements have non-visible overflow.
3788
3789         Reviewed by Rob Buis.
3790
3791         Test: mathml/mathml-overflow-crash.html
3792
3793         * rendering/mathml/RenderMathMLBlock.cpp:
3794         (WebCore::RenderMathMLBlock::layoutBlock):
3795         (WebCore::RenderMathMLBlock::layoutInvalidMarkup):
3796         * rendering/mathml/RenderMathMLFraction.cpp:
3797         (WebCore::RenderMathMLFraction::layoutBlock):
3798         * rendering/mathml/RenderMathMLMath.cpp:
3799         (WebCore::RenderMathMLMath::layoutBlock):
3800         * rendering/mathml/RenderMathMLMenclose.cpp:
3801         (WebCore::RenderMathMLMenclose::layoutBlock):
3802         * rendering/mathml/RenderMathMLOperator.cpp:
3803         (WebCore::RenderMathMLOperator::layoutBlock):
3804         * rendering/mathml/RenderMathMLPadded.cpp:
3805         (WebCore::RenderMathMLPadded::layoutBlock):
3806         * rendering/mathml/RenderMathMLRoot.cpp:
3807         (WebCore::RenderMathMLRoot::layoutBlock):
3808         * rendering/mathml/RenderMathMLRow.cpp:
3809         (WebCore::RenderMathMLRow::layoutBlock):
3810         * rendering/mathml/RenderMathMLScripts.cpp:
3811         (WebCore::RenderMathMLScripts::layoutBlock):
3812         * rendering/mathml/RenderMathMLSpace.cpp:
3813         (WebCore::RenderMathMLSpace::layoutBlock):
3814         * rendering/mathml/RenderMathMLToken.cpp:
3815         (WebCore::RenderMathMLToken::layoutBlock):
3816         * rendering/mathml/RenderMathMLUnderOver.cpp:
3817         (WebCore::RenderMathMLUnderOver::layoutBlock):
3818
3819 2019-04-24  Greg V  <greg@unrelenting.technology>
3820
3821         Fix -Wc++11-narrowing on unsigned char platforms like FreeBSD/aarch64
3822         https://bugs.webkit.org/show_bug.cgi?id=197148
3823
3824         Reviewed by Alex Christensen.
3825
3826         * contentextensions/DFACombiner.cpp:
3827         * contentextensions/NFAToDFA.cpp:
3828
3829 2019-04-24  Chris Dumez  <cdumez@apple.com>
3830
3831         X-Frame-Options header should be ignored when frame-ancestors CSP directive is present
3832         https://bugs.webkit.org/show_bug.cgi?id=197226
3833         <rdar://problem/50155649>
3834
3835         Reviewed by Alex Christensen.
3836
3837         X-Frame-Options header should be ignored when frame-ancestors CSP directive is present:
3838         - https://www.w3.org/TR/CSP3/#frame-ancestors-and-frame-options
3839
3840         Specification says:
3841         """
3842         In order to allow backwards-compatible deployment, the frame-ancestors directive _obsoletes_ the
3843         X-Frame-Options header. If a resource is delivered with an policy that includes a directive named
3844         frame-ancestors and whose disposition is "enforce", then the X-Frame-Options header MUST be ignored.
3845         """
3846
3847         Gecko and Blink follow the specification, WebKit does not. As a result, page [1] is broken with
3848         WebKit-only on Schwab.com. The page height is wrong and you cannot see all the ETFs as a result.
3849
3850         [1] https://www.schwab.com/public/schwab/investing/investment_help/investment_research/etf_research/etfs.html?&path=/Prospect/Research/etfs/overview/oneSourceETFs.asp
3851
3852         Test: http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-overrides-X-Frames-Options.html
3853
3854         * loader/DocumentLoader.cpp:
3855         (WebCore::DocumentLoader::responseReceived):
3856         * page/csp/ContentSecurityPolicy.cpp:
3857         (WebCore::ContentSecurityPolicy::overridesXFrameOptions const):
3858         * page/csp/ContentSecurityPolicy.h:
3859         * page/csp/ContentSecurityPolicyDirectiveList.h:
3860         (WebCore::ContentSecurityPolicyDirectiveList::hasFrameAncestorsDirective const):
3861
3862 2019-04-24  Zalan Bujtas  <zalan@apple.com>
3863
3864         [ContentChangeObserver] Do not use the global _WKContentChange in WebKitLegacy
3865         https://bugs.webkit.org/show_bug.cgi?id=196286
3866         <rdar://problem/49364417>
3867
3868         Reviewed by Simon Fraser.
3869
3870         By reporting WKContentIndeterminateChange in sendMouseMoveEvent enables us to remove the global _WKContentChange state.
3871         Using _WKContentChange is fine as long as only the observed frame reports content change during the synthetic click event.
3872         In case of multiple frames, we should really consult the local state instead.
3873         Unfortunately sendMouseMoveEvent has no access to the observed Document object so we can't really identify the observed content change.
3874         WKContentIndeterminateChange triggers asynchronous decision making at the callsite and in the callback we have access
3875         to the active Document/ContentChangeObverver object and can report the correct state.
3876         This is inline with current WebKit(WK2) behaviour.
3877
3878         Manually tested with a WebKitLegacy test app.
3879
3880         * SourcesCocoa.txt:
3881         * WebCore.xcodeproj/project.pbxproj:
3882         * page/ios/ContentChangeObserver.h:
3883         (WebCore::ContentChangeObserver::setHasNoChangeState):
3884         (WebCore::ContentChangeObserver::setHasIndeterminateState):
3885         (WebCore::ContentChangeObserver::setHasVisibleChangeState):
3886         (WebCore::ContentChangeObserver::setObservedContentState): Deleted.
3887         * page/ios/EventHandlerIOS.mm:
3888         (WebCore::EventHandler::mouseMoved):
3889         * platform/ios/wak/WAKWindow.mm:
3890         (-[WAKWindow sendMouseMoveEvent:contentChange:]):
3891         * platform/ios/wak/WKContentObservation.cpp: Removed.
3892         * platform/ios/wak/WKContentObservation.h:
3893
3894 2019-04-24  Philippe Normand  <pnormand@igalia.com>
3895
3896         [GTK][GStreamer] Flaky ASSERTION FAILED: m_lock.isHeld() in TextureMapperPlatformLayerProxy
3897         https://bugs.webkit.org/show_bug.cgi?id=196739
3898
3899         Reviewed by Xabier Rodriguez-Calvar.
3900
3901         The crash was triggered because m_videoDecoderPlatform not being
3902         explicitely set, its value would be inferred as one of the enum
3903         class values. Making it Optional avoids this issue.
3904
3905         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3906
3907 2019-04-24  Philippe Normand  <pnormand@igalia.com>
3908
3909         [GStreamer] Crash in AudioTrackPrivate with playbin3 enabled
3910         https://bugs.webkit.org/show_bug.cgi?id=196913
3911
3912         Reviewed by Xabier Rodriguez-Calvar.
3913
3914         The crash was due to a playbin3 code path being triggered during
3915         MSE playback, which is not supposed to work in playbin3 anyway.
3916         The problem is that setting the USE_PLAYBIN3 environment variable
3917         to "1" makes the GStreamer playback plugin register the playbin3
3918         element under the playbin name. So that leads to playbin3 being
3919         used everywhere in WebKit where we assume the playbin element is
3920         used. So the proposed solution is to:
3921
3922         - use a WebKit-specific environment variable instead of the
3923         GStreamer USE_PLAYBIN3 variable.
3924         - emit a warning if the USE_PLAYBIN3 environment variable is
3925         detected. We can't unset it ourselves for security reasons.
3926
3927         The patch also includes a code cleanup of the player method
3928         handling the pipeline creation. The previous code had a bug
3929         leading to playbin3 being used for MSE.
3930
3931         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3932         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
3933
3934 2019-04-24  chris fleizach  <cfleizach@apple.com>
3935
3936         AX: Remove deprecated Accessibility Object Model events
3937         https://bugs.webkit.org/show_bug.cgi?id=197073
3938         <rdar://problem/50027819>
3939
3940         Reviewed by Ryosuke Niwa.
3941
3942         Test: accessibility/mac/replace-text-with-range.html
3943
3944         * DerivedSources.make:
3945         * Sources.txt:
3946         * WebCore.xcodeproj/project.pbxproj:
3947         * accessibility/AccessibilityListBoxOption.cpp:
3948         (WebCore::AccessibilityListBoxOption::setSelected):
3949         * accessibility/AccessibilityMediaObject.cpp:
3950         (WebCore::AccessibilityMediaObject::increment):
3951         (WebCore::AccessibilityMediaObject::decrement):
3952         * accessibility/AccessibilityMenuListOption.cpp:
3953         (WebCore::AccessibilityMenuListOption::setSelected):
3954         * accessibility/AccessibilityNodeObject.cpp:
3955         (WebCore::AccessibilityNodeObject::increment):
3956         (WebCore::AccessibilityNodeObject::decrement):
3957         * accessibility/AccessibilityObject.cpp:
3958         (WebCore::AccessibilityObject::press):
3959         (WebCore::AccessibilityObject::replaceTextInRange):
3960         (WebCore::AccessibilityObject::scrollToMakeVisible const):
3961         (WebCore::AccessibilityObject::shouldDispatchAccessibilityEvent const): Deleted.
3962         (WebCore::AccessibilityObject::dispatchAccessibilityEvent const): Deleted.
3963         (WebCore::AccessibilityObject::dispatchAccessibilityEventWithType const): Deleted.
3964         (WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent const): Deleted.
3965         * accessibility/AccessibilityObject.h:
3966         * accessibility/AccessibilityRenderObject.cpp:
3967         (WebCore::AccessibilityRenderObject::setFocused):
3968         (WebCore::AccessibilityRenderObject::setValue):
3969         * accessibility/AccessibilityScrollbar.cpp:
3970         (WebCore::AccessibilityScrollbar::setValue):
3971         * accessibility/AccessibilitySlider.cpp:
3972         (WebCore::AccessibilitySlider::setValue):
3973         * accessibility/ios/AccessibilityObjectIOS.mm:
3974         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
3975         (WebCore::AccessibilityObject::hasAccessibleDismissEventListener const): Deleted.
3976         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3977         (-[WebAccessibilityObjectWrapper accessibilityPerformEscape]): Deleted.
3978         (-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]): Deleted.
3979         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3980         (-[WebAccessibilityObjectWrapper accessibilityPerformShowMenuAction]):
3981         * dom/Element.idl:
3982         * dom/EventNames.h:
3983         * dom/EventNames.in:
3984         * html/HTMLAttributeNames.in:
3985         * html/HTMLElement.cpp:
3986         (WebCore::HTMLElement::createEventHandlerNameMap):
3987         * page/Settings.yaml:
3988         * testing/InternalSettings.cpp:
3989         (WebCore::InternalSettings::Backup::Backup):
3990         (WebCore::InternalSettings::Backup::restoreTo):
3991         (WebCore::InternalSettings::setAccessibilityEventsEnabled): Deleted.
3992         * testing/InternalSettings.h:
3993         * testing/InternalSettings.idl:
3994
3995 2019-04-23  Andy Estes  <aestes@apple.com>
3996
3997         [iOS] QuickLook documents loaded from file: URLs should be allowed to perform same-document navigations
3998         https://bugs.webkit.org/show_bug.cgi?id=196749
3999         <rdar://problem/35773454>
4000
4001         Reviewed by Daniel Bates.
4002
4003         QuickLook previews are in a non-local origin defined by a unique x-apple-ql-id: URL, which
4004     &n