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