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