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