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