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