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