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