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