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