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