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