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