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