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