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