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