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