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