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