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