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