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