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