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