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