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