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