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