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