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