[Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointereven...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-04-18  Antoine Quint  <graouts@apple.com>
2
3         [Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html
4         https://bugs.webkit.org/show_bug.cgi?id=197004
5
6         Reviewed by Antti Koivisto.
7
8         We need to release pointer capture when an element that has pointer capture is disconnected from the DOM.
9
10         * dom/Element.cpp:
11         (WebCore::Element::removedFromAncestor): Notify the PointerCaptureController that an element was disconnected.
12         * dom/PointerEvent.cpp:
13         (WebCore::PointerEvent::create): Broaden createPointerCancelEvent() to take in an event type so that we may use it to create a
14         lostpointercapture event as well.
15         (WebCore::PointerEvent::createPointerCancelEvent): Deleted.
16         * dom/PointerEvent.h:
17         * page/PointerCaptureController.cpp:
18         (WebCore::PointerCaptureController::elementWasRemoved): Check whether the provided element matches one of the target overrides recorded
19         in the map of captured pointer IDs.
20         (WebCore::PointerCaptureController::pointerEventWasDispatched): This block of code was actually useless in this location, the new code
21         added in elementWasRemoved() performs the actions that the spec text mandates.
22         (WebCore::PointerCaptureController::cancelPointer): Replace the call to createPointerCancelEvent() with one to create().
23         * page/PointerCaptureController.h:
24
25 2019-04-17  Antoine Quint  <graouts@apple.com>
26
27         [Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerevent_on_event_handlers.html
28         https://bugs.webkit.org/show_bug.cgi?id=197006
29
30         Reviewed by Antti Koivisto.
31
32         Add support for on* HTML attributes and JS properties for pointer events.
33
34         * dom/GlobalEventHandlers.idl:
35         * html/HTMLAttributeNames.in:
36         * html/HTMLElement.cpp:
37         (WebCore::HTMLElement::createEventHandlerNameMap):
38
39 2019-04-17  Timothy Hatcher  <timothy@apple.com>
40
41         Standardize the `<meta name="color-scheme">` separator.
42         https://bugs.webkit.org/show_bug.cgi?id=193931
43
44         Reviewed by Simon Fraser.
45
46         Drop support for comma as a valid seperator in <meta name="color-scheme"> to
47         match the proposal being tracked by: https://github.com/whatwg/html/issues/4504
48
49         Tests: css-dark-mode/color-scheme-meta.html
50                css-dark-mode/older-syntax/supported-color-schemes-meta.html
51
52         * dom/Document.cpp:
53         (WebCore::isColorSchemeSeparator): Drop support for comma.
54
55 2019-04-17  Timothy Hatcher  <timothy@apple.com>
56
57         Rename `supported-color-schemes` to `color-scheme`.
58         https://bugs.webkit.org/show_bug.cgi?id=197016
59         rdar://problem/49980259
60
61         Reviewed by Simon Fraser.
62
63         Changed `supported-color-schemes` to `color-scheme` to follow the spec changes
64         being tracked by: https://github.com/w3c/csswg-drafts/issues/3807
65
66         The old `supported-color-schemes` is now an alias of `color-scheme` for compatibility.
67
68         Tests: css-dark-mode/color-scheme-css-parse.html
69                css-dark-mode/color-scheme-css.html
70                css-dark-mode/color-scheme-meta.html
71                css-dark-mode/color-scheme-priority.html
72                css-dark-mode/color-scheme-scrollbar.html
73                css-dark-mode/older-syntax/supported-color-schemes-css.html
74                css-dark-mode/older-syntax/supported-color-schemes-meta.html
75                css-dark-mode/older-systems/color-scheme-css.html
76                css-dark-mode/older-systems/color-scheme-meta.html
77
78         * WebCore.xcodeproj/project.pbxproj:
79         * css/CSSComputedStyleDeclaration.cpp:
80         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
81         * css/CSSProperties.json:
82         * css/CSSValueKeywords.in:
83         * css/StyleBuilderConverter.h:
84         (WebCore::StyleBuilderConverter::updateColorScheme):
85         (WebCore::StyleBuilderConverter::convertColorScheme):
86         (WebCore::StyleBuilderConverter::updateSupportedColorSchemes): Deleted.
87         (WebCore::StyleBuilderConverter::convertSupportedColorSchemes): Deleted.
88         * css/StyleBuilderCustom.h:
89         (WebCore::StyleBuilderCustom::applyValueColorScheme):
90         (WebCore::StyleBuilderCustom::applyValueSupportedColorSchemes): Deleted.
91         * css/StyleResolver.cpp:
92         (WebCore::StyleResolver::applyMatchedProperties):
93         * css/parser/CSSPropertyParser.cpp:
94         (WebCore::consumeColorScheme):
95         (WebCore::CSSPropertyParser::parseSingleValue):
96         (WebCore::consumeSupportedColorSchemes): Deleted.
97         * dom/Document.cpp:
98         (WebCore::processColorSchemeString):
99         (WebCore::Document::processColorScheme):
100         (WebCore::Document::useDarkAppearance const):
101         (WebCore::processColorSchemes): Deleted.
102         (WebCore::Document::processSupportedColorSchemes): Deleted.
103         * dom/Document.h:
104         * html/HTMLMetaElement.cpp:
105         (WebCore::HTMLMetaElement::process):
106         * page/FrameView.cpp:
107         (WebCore::FrameView::rendererForColorScheme const):
108         (WebCore::FrameView::useDarkAppearance const):
109         (WebCore::FrameView::styleColorOptions const):
110         (WebCore::FrameView::rendererForSupportedColorSchemes const): Deleted.
111         * page/FrameView.h:
112         * rendering/style/RenderStyle.cpp:
113         (WebCore::rareInheritedDataChangeRequiresRepaint):
114         * rendering/style/RenderStyle.h:
115         (WebCore::RenderStyle::colorScheme const):
116         (WebCore::RenderStyle::setHasExplicitlySetColorScheme):
117         (WebCore::RenderStyle::hasExplicitlySetColorScheme const):
118         (WebCore::RenderStyle::setColorScheme):
119         (WebCore::RenderStyle::initialColorScheme):
120         (WebCore::RenderStyle::NonInheritedFlags::operator== const):
121         (WebCore::RenderStyle::supportedColorSchemes const): Deleted.
122         (WebCore::RenderStyle::setHasExplicitlySetSupportedColorSchemes): Deleted.
123         (WebCore::RenderStyle::hasExplicitlySetSupportedColorSchemes const): Deleted.
124         (WebCore::RenderStyle::setSupportedColorSchemes): Deleted.
125         (WebCore::RenderStyle::initialSupportedColorSchemes): Deleted.
126         * rendering/style/RenderStyleConstants.h:
127         * rendering/style/StyleColorScheme.h: Renamed from Source/WebCore/rendering/style/StyleSupportedColorSchemes.h.
128         (WebCore::StyleColorScheme::StyleColorScheme):
129         (WebCore::StyleColorScheme::operator== const):
130         (WebCore::StyleColorScheme::operator!= const):
131         (WebCore::StyleColorScheme::isAuto const):
132         (WebCore::StyleColorScheme::isOnly const):
133         (WebCore::StyleColorScheme::colorScheme const):
134         (WebCore::StyleColorScheme::add):
135         (WebCore::StyleColorScheme::contains const):
136         (WebCore::StyleColorScheme::setAllowsTransformations):
137         (WebCore::StyleColorScheme::allowsTransformations const):
138         * rendering/style/StyleRareInheritedData.cpp:
139         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
140         (WebCore::StyleRareInheritedData::operator== const):
141         * rendering/style/StyleRareInheritedData.h:
142
143 2019-04-17  Justin Fan  <justin_fan@apple.com>
144
145         [Web GPU] GPUComputePassEncoder::dispatch number of thread groups, not grid size
146         https://bugs.webkit.org/show_bug.cgi?id=196984
147
148         Reviewed by Myles C. Maxfield.
149
150         Test: Updated compute-squares.html.
151
152         * platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm:
153         (WebCore::GPUComputePassEncoder::dispatch):
154
155 2019-04-17  Andy Estes  <aestes@apple.com>
156
157         [iOS] Support multiple file selection in UIDocumentPickerViewController
158         https://bugs.webkit.org/show_bug.cgi?id=197014
159         <rdar://problem/49963514>
160
161         Reviewed by Tim Horton.
162
163         * platform/LocalizedStrings.h:
164         Exported multipleFileUploadText().
165
166 2019-04-17  John Wilander  <wilander@apple.com>
167
168         Add prioritization of ad click conversions and cleaning of sent ad click conversions
169         https://bugs.webkit.org/show_bug.cgi?id=196934
170         <rdar://problem/49917773>
171
172         Reviewed by Chris Dumez.
173
174         Tests: http/tests/adClickAttribution/second-attribution-converted-with-higher-priority.html
175                http/tests/adClickAttribution/second-attribution-converted-with-lower-priority.html
176                http/tests/adClickAttribution/second-conversion-with-higher-priority.html
177                http/tests/adClickAttribution/second-conversion-with-lower-priority.html
178
179         * loader/AdClickAttribution.cpp:
180         (WebCore::AdClickAttribution::hasHigherPriorityThan const):
181             Added to facilitate priority comparison between two attributions.
182         * loader/AdClickAttribution.h:
183         (WebCore::AdClickAttribution::Destination::Destination):
184             Added a WTF::HashTableDeletedValueType constructor and changed the copy constructor to
185             a move constructor.
186         (WebCore::AdClickAttribution::isEmpty const):
187
188 2019-04-17  Devin Rousso  <drousso@apple.com>
189
190         AX: AccessibilityObject::parentObject() doesn't need to be pure virtual
191         https://bugs.webkit.org/show_bug.cgi?id=197026
192         <rdar://problem/49448209>
193
194         Reviewed by Timothy Hatcher.
195
196         * accessibility/AccessibilityObject.h:
197         (WebCore::AccessibilityObject::parentObject const):
198
199 2019-04-17  Zalan Bujtas  <zalan@apple.com>
200
201         [ContentChangeObserver] Use aria role as a hint whether a tap should result in a synthetic click
202         https://bugs.webkit.org/show_bug.cgi?id=196988
203         <rdar://problem/49955328>
204
205         Reviewed by Simon Fraser.
206
207         Test: fast/events/touch/ios/content-observation/tap-on-input-looking-div-with-role.html
208
209         * accessibility/AccessibilityObject.h:
210
211 2019-04-17  Alex Christensen  <achristensen@webkit.org>
212
213         WebSocketHandshake should not know about a Document
214         https://bugs.webkit.org/show_bug.cgi?id=196468
215
216         Reviewed by Tim Horton.
217
218         I'll need to move WebSocketHandshake to the NetworkProcess for rdar://problem/46287028
219         It currently uses the Document pointer for 3 things:
220         1. To get the user agent, which we can pass in as a creation parameter.
221         2. To get the origin, which we can also pass in as a creation parameter.
222         3. To get cookies for the web inspector.  We can pass in a functor instead and have the inspector provide cookies itself.
223
224         * Modules/websockets/WebSocketChannel.cpp:
225         (WebCore::WebSocketChannel::connect):
226         (WebCore::WebSocketChannel::disconnect):
227         (WebCore::WebSocketChannel::didOpenSocketStream):
228         (WebCore::WebSocketChannel::clientHandshakeRequest):
229         * Modules/websockets/WebSocketChannel.h:
230         (WebCore::WebSocketChannel::document):
231         * Modules/websockets/WebSocketHandshake.cpp:
232         (WebCore::WebSocketHandshake::WebSocketHandshake):
233         (WebCore::WebSocketHandshake::clientHandshakeMessage const):
234         (WebCore::WebSocketHandshake::clientHandshakeRequest const):
235         (WebCore::WebSocketHandshake::clientOrigin const): Deleted.
236         (WebCore::WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy const): Deleted.
237         (WebCore::WebSocketHandshake::clearDocument): Deleted.
238         * Modules/websockets/WebSocketHandshake.h:
239         * inspector/agents/InspectorNetworkAgent.cpp:
240         (WebCore::InspectorNetworkAgent::enable):
241
242 2019-04-17  Timothy Hatcher  <timothy@apple.com>
243
244         Unreviewed build fix for iOSMac after r244223.
245
246         * platform/audio/ios/AudioSessionIOS.mm:
247         (WebCore::AudioSession::routeSharingPolicy const): Add ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END
248         around AVAudioSessionRouteSharingPolicyLongForm use.
249
250 2019-04-17  Chris Dumez  <cdumez@apple.com>
251
252         Remember device orientation permission for the duration of the browsing session
253         https://bugs.webkit.org/show_bug.cgi?id=196992
254         <rdar://problem/49946067>
255
256         Reviewed by Alex Christensen.
257
258         Use DeviceOrientationOrMotionPermissionState type more consistently in the code base
259         instead of bool or Optional<bool>. Added "Prompt" value to this enumeration which is the
260         default state and which indicates we should ask the client.
261
262         * WebCore.xcodeproj/project.pbxproj:
263         * dom/DeviceOrientationAndMotionAccessController.cpp:
264         (WebCore::DeviceOrientationAndMotionAccessController::DeviceOrientationAndMotionAccessController):
265         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
266         * dom/DeviceOrientationAndMotionAccessController.h:
267         (WebCore::DeviceOrientationAndMotionAccessController::accessState const):
268         * dom/DeviceOrientationOrMotionEvent.cpp:
269         (WebCore::DeviceOrientationOrMotionEvent::requestPermission):
270         * dom/DeviceOrientationOrMotionPermissionState.h:
271         * loader/DocumentLoader.h:
272         (WebCore::DocumentLoader::deviceOrientationAndMotionAccessState const):
273         (WebCore::DocumentLoader::setDeviceOrientationAndMotionAccessState):
274         * page/ChromeClient.h:
275         * page/DOMWindow.cpp:
276         (WebCore::DOMWindow::isAllowedToAddDeviceMotionOrientationListener const):
277
278 2019-04-17  Rob Buis  <rbuis@igalia.com>
279
280         XMLHttpRequest has the wrong fallback encoding
281         https://bugs.webkit.org/show_bug.cgi?id=191741
282
283         Reviewed by Alex Christensen.
284
285         Allow overriding the response charset as specified here:
286         https://xhr.spec.whatwg.org/#final-charset
287
288         Behavior matches Firefox and Chrome.
289
290         Tests: imported/w3c/web-platform-tests/encoding/replacement-encodings.any.html
291                imported/w3c/web-platform-tests/encoding/replacement-encodings.any.worker.html
292                imported/w3c/web-platform-tests/encoding/unsupported-encodings.any.html
293                imported/w3c/web-platform-tests/encoding/unsupported-encodings.any.worker.html
294
295         * xml/XMLHttpRequest.cpp:
296         (WebCore::XMLHttpRequest::finalResponseCharset const):
297         (WebCore::XMLHttpRequest::createDecoder const):
298         * xml/XMLHttpRequest.h:
299
300 2019-04-16  Antoine Quint  <graouts@apple.com>
301
302         Opt Google Maps into simulated mouse events dispatch quirk
303         https://bugs.webkit.org/show_bug.cgi?id=196965
304         <rdar://problem/49934766>
305
306         Reviewed by Dean Jackson.
307
308         Use the correct Google Maps path.
309
310         * page/Quirks.cpp:
311         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
312
313 2019-04-16  Antoine Quint  <graouts@apple.com>
314
315         Opt flipkart.com into simulated mouse events dispatch quirk
316         https://bugs.webkit.org/show_bug.cgi?id=196961
317         <rdar://problem/49648520>
318
319         Reviewed by Dean Jackson.
320
321         * page/Quirks.cpp:
322         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
323
324 2019-04-16  Antoine Quint  <graouts@apple.com>
325
326         Opt MSN.com into simulated mouse events dispatch quirk
327         https://bugs.webkit.org/show_bug.cgi?id=196960
328         <rdar://problem/49403260>
329
330         Reviewed by Dean Jackson.
331
332         * page/Quirks.cpp:
333         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
334
335 2019-04-16  Zan Dobersek  <zdobersek@igalia.com>
336
337         ScalableImageDecoder: don't forcefully decode image data when querying frame completeness, duration
338         https://bugs.webkit.org/show_bug.cgi?id=191354
339         <rdar://problem/46123406>
340
341         Reviewed by Michael Catanzaro.
342
343         ScalableImageDecoder::frameIsCompleteAtIndex() should only check the
344         index validity and, if the index is valid, check for completeness of the
345         corresponding frame. ScalableImageDecoder::frameDurationAtIndex() should
346         also only retrieve duration for already-complete frames, or expand the
347         default 0-second value according to the flashing-protection rule when
348         the target frame is not yet complete.
349
350         Both methods avoid calling ScalableImageDecoder::frameBufferAtIndex()
351         as that method goes on and decodes image data to determine specific
352         information. The ImageSource class that's querying this information
353         doesn't anticipate this, and doesn't handle the increased memory
354         consumption of the decoded data, leaving MemoryCache in the blind about
355         the image resource's actual amount of consumed memory. ImageSource can
356         instead gracefully handle any incomplete frame by marking the decoding
357         status for this frame as only partial.
358
359         * platform/image-decoders/ScalableImageDecoder.cpp:
360         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
361         (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
362         (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
363
364 2019-04-16  Ross Kirsling  <ross.kirsling@sony.com>
365
366         Unreviewed non-unified build fix after r244307.
367
368         * page/DiagnosticLoggingClient.h:
369
370 2019-04-16  Chris Dumez  <cdumez@apple.com>
371
372         URL set by document.open() is not communicated to the UIProcess
373         https://bugs.webkit.org/show_bug.cgi?id=196941
374         <rdar://problem/49237544>
375
376         Reviewed by Geoff Garen.
377
378         Notify the FrameLoaderClient whenever an explicit open was done and provide it with
379         the latest document URL.
380
381         * loader/FrameLoader.cpp:
382         (WebCore::FrameLoader::didExplicitOpen):
383         * loader/FrameLoaderClient.h:
384
385 2019-04-16  Timothy Hatcher  <timothy@apple.com>
386
387         FrameView base background color always starts white.
388         https://bugs.webkit.org/show_bug.cgi?id=196976
389
390         Reviewed by Beth Dakin.
391
392         * page/FrameView.cpp:
393         (WebCore::FrameView::setBaseBackgroundColor): Bail early if the base background
394         color did not change.
395
396 2019-04-16  Devin Rousso  <drousso@apple.com>
397
398         Unprefix -webkit-sticky
399         https://bugs.webkit.org/show_bug.cgi?id=196962
400         <rdar://problem/40903458>
401
402         Reviewed by Simon Fraser.
403
404         Updated existing tests.
405
406         This change doesn't modify functionality, only exposing a new unprefixed CSS value.
407
408         * css/CSSProperties.json:
409         * css/CSSValueKeywords.in:
410
411         * css/CSSPrimitiveValueMappings.h:
412         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
413         (WebCore::CSSPrimitiveValue::operator PositionType const):
414
415         * css/parser/CSSParserFastPaths.cpp:
416         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
417
418         * editing/EditingStyle.cpp:
419         (WebCore::EditingStyle::convertPositionStyle):
420
421 2019-04-16  Commit Queue  <commit-queue@webkit.org>
422
423         Unreviewed, rolling out r244321.
424         https://bugs.webkit.org/show_bug.cgi?id=196968
425
426         Causing all WK2 Debug builds to exit early after Assertion
427         failures. (Requested by ShawnRoberts on #webkit).
428
429         Reverted changeset:
430
431         "URL set by document.open() is not communicated to the
432         UIProcess"
433         https://bugs.webkit.org/show_bug.cgi?id=196941
434         https://trac.webkit.org/changeset/244321
435
436 2019-04-16  Caitlin Potter  <caitp@igalia.com>
437
438         [JSC] Filter DontEnum properties in ProxyObject::getOwnPropertyNames()
439         https://bugs.webkit.org/show_bug.cgi?id=176810
440
441         Reviewed by Saam Barati.
442
443         Previously, there was a comment here indicating uncertainty of whether it
444         was necessary to filter DontEnum properties explicitly or not. It turns
445         out that it was necessary in the case of JSC ProxyObjects.
446
447         This patch adds DontEnum filtering for ProxyObjects, however we continue
448         to explicitly filter them in JSDOMConvertRecord, which needs to use the
449         property descriptor after filtering. This change prevents observably
450         fetching the property descriptor twice per property.
451
452         * bindings/js/JSDOMConvertRecord.h:
453
454 2019-04-15  Antoine Quint  <graouts@apple.com>
455
456         [iOS] Redundant pointer events causes material design buttons to flush twice
457         https://bugs.webkit.org/show_bug.cgi?id=196914
458         <rdar://problem/49571860>
459
460         Reviewed by Dean Jackson.
461
462         Test: pointerevents/ios/pointer-event-order.html
463
464         Do not dispatch pointer events for mouse events on iOS since we're already dispatching them when processing touch events.
465
466         * dom/Element.cpp:
467         (WebCore::Element::dispatchMouseEvent):
468
469 2019-04-15  John Wilander  <wilander@apple.com>
470
471         Add a query string nonce to LayoutTests/http/tests/adClickAttribution/send-attribution-conversion-request.html to address flakiness
472         https://bugs.webkit.org/show_bug.cgi?id=196955
473
474         Unreviewed test gardening. The WebCore change is only in a dedicated
475         test function.
476
477         No new tests. Existing test updated.
478
479         * loader/AdClickAttribution.cpp:
480         (WebCore::AdClickAttribution::urlForTesting const):
481             Now preserves the query string in the test URL.
482
483 2019-04-15  Chris Dumez  <cdumez@apple.com>
484
485         URL set by document.open() is not communicated to the UIProcess
486         https://bugs.webkit.org/show_bug.cgi?id=196941
487         <rdar://problem/49237544>
488
489         Reviewed by Geoffrey Garen.
490
491         Notify the FrameLoaderClient whenever an explicit open was done and provide it with
492         the latest document URL.
493
494         * loader/FrameLoader.cpp:
495         (WebCore::FrameLoader::didExplicitOpen):
496         * loader/FrameLoaderClient.h:
497
498 2019-04-15  Eike Rathke  <erack@redhat.com>
499
500         Fix logic flow for error log
501         https://bugs.webkit.org/show_bug.cgi?id=196933
502
503         Reviewed by Alexey Proskuryakov.
504
505         Missing block braces logged an error always, not just
506         if (actionIfInvalid == Complain).
507
508         * html/HTMLMediaElement.cpp:
509         (WebCore::HTMLMediaElement::isSafeToLoadURL):
510
511 2019-04-15  Myles C. Maxfield  <mmaxfield@apple.com>
512
513         [Cocoa] FontPlatformData objects aren't cached at all when using font-family:system-ui
514         https://bugs.webkit.org/show_bug.cgi?id=196846
515         <rdar://problem/49499971>
516
517         Reviewed by Simon Fraser and Darin Adler.
518
519         When adding the special codepath for system-ui to behave as an entire list of fonts rather than a single item,
520         I never added a cache for the FontPlatformData objects that codepath creates. The non-system-ui codepath already
521         has a cache in fontPlatformDataCache() in FontCache.cpp.
522
523         This patch causes a 16.8x performance improvement on the attached benchmark.
524
525         Test: PerformanceTests/Layout/system-ui-rebuild-emoji.html
526
527         * page/cocoa/MemoryReleaseCocoa.mm:
528         (WebCore::platformReleaseMemory):
529         * platform/graphics/cocoa/FontCacheCoreText.cpp:
530         (WebCore::invalidateFontCache):
531         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
532         (WebCore::FontFamilySpecificationKey::FontFamilySpecificationKey):
533         (WebCore::FontFamilySpecificationKey::operator== const):
534         (WebCore::FontFamilySpecificationKey::operator!= const):
535         (WebCore::FontFamilySpecificationKey::isHashTableDeletedValue const):
536         (WebCore::FontFamilySpecificationKey::computeHash const):
537         (WebCore::FontFamilySpecificationKeyHash::hash):
538         (WebCore::FontFamilySpecificationKeyHash::equal):
539         (WebCore::fontMap):
540         (WebCore::clearFontFamilySpecificationCoreTextCache):
541         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
542         * platform/graphics/cocoa/FontFamilySpecificationCoreText.h:
543         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
544         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
545         (WebCore::safeCFEqual): Deleted.
546
547 2019-04-15  Devin Rousso  <drousso@apple.com>
548
549         Web Inspector: fake value descriptors for promises add a catch handler, preventing "rejectionhandled" events from being fired
550         https://bugs.webkit.org/show_bug.cgi?id=196484
551         <rdar://problem/49114725>
552
553         Reviewed by Joseph Pecoraro.
554
555         Test: inspector/runtime/promise-native-getter.html
556
557         Mark errors created from getters as being `isNativeGetterTypeError`.
558
559         * bindings/js/JSDOMExceptionHandling.cpp:
560         (WebCore::throwGetterTypeError):
561         (WebCore::rejectPromiseWithGetterTypeError):
562         (WebCore::rejectPromiseWithThisTypeError):
563
564         * bindings/js/JSDOMGlobalObject.cpp:
565         (WebCore::makeGetterTypeErrorForBuiltins):
566
567         * bindings/js/JSDOMPromiseDeferred.h:
568         * bindings/js/JSDOMPromiseDeferred.cpp:
569         (WebCore::createRejectedPromiseWithTypeError):
570
571         * Modules/streams/WritableStream.js:
572         (getter.closed):
573         (getter.ready):
574
575 2019-04-15  Jer Noble  <jer.noble@apple.com>
576
577         Add a DiagnosticLogging method taking an arbitrary dictionary of values.
578         https://bugs.webkit.org/show_bug.cgi?id=196773
579
580         Reviewed by Alex Christensen.
581
582         * page/DiagnosticLoggingClient.h:
583
584 2019-04-15  Justin Fan  <justin_fan@apple.com>
585
586         Let WTF::convertSafely deduce types from arguments.
587
588         Reviewer's (Darin Adler) follow-up to https://bugs.webkit.org/show_bug.cgi?id=196793.
589
590         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
591         (WebCore::GPUBuffer::tryCreate):
592         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
593         (WebCore::GPUCommandBuffer::copyBufferToTexture):
594         (WebCore::GPUCommandBuffer::copyTextureToBuffer):
595         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
596         (WebCore::trySetInputStateForPipelineDescriptor):
597
598 2019-04-12  Ryosuke Niwa  <rniwa@webkit.org>
599
600         Throw TypeError when custom element constructor returns a wrong element or tries to create itself
601         https://bugs.webkit.org/show_bug.cgi?id=196892
602
603         Reviewed by Dean Jackson.
604
605         Throw TypeError instead of InvalidStateError for consistency. This updates WebKit's custom elements
606         implementation for https://github.com/whatwg/html/pull/4525.
607
608         Tests: imported/w3c/web-platform-tests/custom-elements/upgrading/Node-cloneNode.html
609                imported/w3c/web-platform-tests/custom-elements/upgrading/upgrading-parser-created-element.html
610
611         * bindings/js/JSCustomElementInterface.cpp:
612         (WebCore::JSCustomElementInterface::upgradeElement):
613         * bindings/js/JSHTMLElementCustom.cpp:
614         (WebCore::constructJSHTMLElement):
615
616 2019-04-15  Don Olmstead  <don.olmstead@sony.com>
617
618         [CMake] WebCore derived sources should only be referenced inside WebCore
619         https://bugs.webkit.org/show_bug.cgi?id=196904
620
621         Reviewed by Konstantin Tokarev.
622
623         Use WebCore_DERIVED_SOURCES_DIR instead of DERIVED_SOURCES_WEBCORE_DIR.
624
625         * CMakeLists.txt:
626         * PlatformGTK.cmake:
627         * PlatformWin.cmake:
628         * WebCoreMacros.cmake:
629
630 2019-04-15  John Wilander  <wilander@apple.com>
631
632         Send delayed Ad Click Attribution conversion requests to the click source
633         https://bugs.webkit.org/show_bug.cgi?id=196838
634         <rdar://problem/47650157>
635
636         Reviewed by Chris Dumez and Youenn Fablet.
637
638         WebCore::AdClickAttribution now:
639         - Sets m_earliestTimeToSend correctly based on WallTime::now().
640         - Allows for a test override of the base URL for conversions.
641         - Holds state for whether or not a conversion request has been sent.
642         - Outputs m_earliestTimeToSend and m_conversion->hasBeenSent in toString().
643         - Returns m_earliestTimeToSend as a result of a call to
644         convertAndGetEarliestTimeToSend() which used to be called setConversion().
645
646         Test: http/tests/adClickAttribution/send-attribution-conversion-request.html
647
648         * loader/AdClickAttribution.cpp:
649         (WebCore::AdClickAttribution::convertAndGetEarliestTimeToSend):
650         (WebCore::AdClickAttribution::url const):
651         (WebCore::AdClickAttribution::urlForTesting const):
652         (WebCore::AdClickAttribution::markConversionAsSent):
653         (WebCore::AdClickAttribution::wasConversionSent const):
654         (WebCore::AdClickAttribution::toString const):
655         (WebCore::AdClickAttribution::setConversion): Deleted.
656             Renamed convertAndGetEarliestTimeToSend().
657         * loader/AdClickAttribution.h:
658         (WebCore::AdClickAttribution::Conversion::Conversion):
659         (WebCore::AdClickAttribution::Conversion::encode const):
660         (WebCore::AdClickAttribution::Conversion::decode):
661         * platform/Timer.h:
662             Now exports nextFireInterval.
663
664 2019-04-15  Chris Dumez  <cdumez@apple.com>
665
666         Regression(r237903) Speedometer 2 is 1-2% regressed on iOS
667         https://bugs.webkit.org/show_bug.cgi?id=196841
668         <rdar://problem/45957016>
669
670         Reviewed by Myles C. Maxfield.
671
672         Speedometer 2 content does not use the text-underline-offset and text-decoration-thickness
673         features that were added in r237903 so I looked for behavior changes in the context of
674         Speedometer from r237903. I found that RenderStyle::changeAffectsVisualOverflow() started
675         returning true a lot more often after r237903. The reason is that r237903 dropped the
676         visualOverflowForDecorations() checks in this method and started returning true a lot
677         more as a result.
678
679         To restore previous behavior, this patch adds back the visualOverflowForDecorations() checks
680         that were dropped in r237903. I have verified that with this patch,
681         RenderStyle::changeAffectsVisualOverflow() returns true as many times as it used to before
682         r237903.
683
684         * rendering/style/RenderStyle.cpp:
685         (WebCore::RenderStyle::changeAffectsVisualOverflow const):
686
687 2019-04-15  Said Abou-Hallawa  <said@apple.com>
688
689         ASSERT fires when removing a disallowed clone from the shadow tree without reseting its corresponding element
690         https://bugs.webkit.org/show_bug.cgi?id=196895
691
692         Reviewed by Darin Adler.
693
694         When cloning elements to the shadow tree of an SVGUseElement, the
695         corresponding element links are set from the clones to the originals.
696         Later some of the elements may be disallowed to exist in the shadow tree.
697         For example the SVGPatternElement is disallowed and has to be removed 
698         even after cloning. The problem is the corresponding elements are not
699         reset to null. Usually this is not a problem because the removed elements
700         will be deleted and the destructor of SVGElement will reset the corresponding
701         element links. However in some cases, the cloned element is referenced
702         from another SVGElement, for example the target of a SVGTRefElement. In
703         this case the clone won't be deleted but it will be linked to the original
704         and the event listeners won't be copied from the original. When the
705         original is deleted, its event listeners have to be removed. The event
706         listeners of the clones also ave to be removed. But because the event
707         listeners of the original were not copied when cloning, the assertion in
708         SVGElement::removeEventListener() fires.
709
710         Test: svg/custom/use-disallowed-element-clear-corresponding-element.html
711
712         * svg/SVGUseElement.cpp:
713         (WebCore::disassociateAndRemoveClones):
714
715 2019-04-15  Devin Rousso  <drousso@apple.com>
716
717         Web Inspector: DOMDebugger: "Attribute Modified" breakpoints pause after the modification occurs for the style attribute
718         https://bugs.webkit.org/show_bug.cgi?id=196556
719         <rdar://problem/49570681>
720
721         Reviewed by Timothy Hatcher.
722
723         Test: inspector/dom-debugger/attribute-modified-style.html
724
725         * css/PropertySetCSSStyleDeclaration.h:
726         * css/PropertySetCSSStyleDeclaration.cpp:
727         (WebCore::StyleAttributeMutationScope::~StyleAttributeMutationScope):
728         (WebCore::InlineCSSStyleDeclaration::willMutate): Added.
729
730         * dom/StyledElement.cpp:
731         (WebCore::StyledElement::styleAttributeChanged):
732         (WebCore::StyledElement::inlineStyleChanged):
733
734         * inspector/InspectorInstrumentation.h:
735         (WebCore::InspectorInstrumentation::willInvalidateStyleAttr): Added.
736         (WebCore::InspectorInstrumentation::didInvalidateStyleAttr):
737         * inspector/InspectorInstrumentation.cpp:
738         (WebCore::InspectorInstrumentation::willInvalidateStyleAttrImpl): Added.
739         (WebCore::InspectorInstrumentation::didInvalidateStyleAttrImpl):
740
741         * inspector/agents/InspectorDOMAgent.h:
742         * inspector/agents/InspectorDOMAgent.cpp:
743         (WebCore::InspectorDOMAgent::didInvalidateStyleAttr):
744
745         * inspector/agents/InspectorDOMDebuggerAgent.h:
746         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
747         (WebCore::InspectorDOMDebuggerAgent::willInvalidateStyleAttr): Added.
748         (WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr): Deleted.
749
750 2019-04-15  Devin Rousso  <drousso@apple.com>
751
752         Web Inspector: Elements: event listener change events should only be fired for the selected node and it's ancestors
753         https://bugs.webkit.org/show_bug.cgi?id=196887
754         <rdar://problem/49870627>
755
756         Reviewed by Timothy Hatcher.
757
758         Test: inspector/dom/event-listener-add-remove.html
759               inspector/dom/event-listener-inspected-node.html
760
761         * inspector/agents/InspectorDOMAgent.h:
762         * inspector/agents/InspectorDOMAgent.cpp:
763         (WebCore::InspectorDOMAgent::getEventListenersForNode):
764         (WebCore::InspectorDOMAgent::setInspectedNode):
765         (WebCore::InspectorDOMAgent::didAddEventListener):
766         (WebCore::InspectorDOMAgent::willRemoveEventListener):
767
768 2019-04-15  Antoine Quint  <graouts@apple.com>
769
770         Ensure iOS layout traits are used for media controls in modern compatibility mode
771         https://bugs.webkit.org/show_bug.cgi?id=196812
772         <rdar://problem/47460637>
773
774         Unreviewed. Speculative fix for test regressions on open-source bots.
775
776         * Modules/modern-media-controls/media/media-controller.js:
777         (MediaController.prototype.get layoutTraits):
778
779 2019-04-11  Antoine Quint  <graouts@apple.com>
780
781         Ensure iOS layout traits are used for media controls in modern compatibility mode
782         https://bugs.webkit.org/show_bug.cgi?id=196812
783         <rdar://problem/47460637>
784
785         Reviewed by Dean Jackson.
786
787         Test: media/modern-media-controls/media-controller/ios/media-controller-ios-layout-traits-modern-compatibility-mode.html
788
789         Instead of looking at the UA string, check whether we support touches which is the correct indicator of whether we should
790         be using the iOS layout traits for media controls.
791
792         * Modules/modern-media-controls/media/media-controller.js:
793         (MediaController.prototype.get layoutTraits):
794
795 2019-04-14  Rob Buis  <rbuis@igalia.com>
796
797         Link prefetch not useful for top-level navigation
798         https://bugs.webkit.org/show_bug.cgi?id=195623
799
800         Reviewed by Youenn Fablet.
801
802         Cache cross-domain top-level prefetches in a dedicated cache and not in the
803         memory cache. Ignore prefetches for content extension checks.
804
805         Tests: http/tests/cache/link-prefetch-main-resource-iframe.html
806                http/tests/cache/link-prefetch-main-resource.html
807
808         * loader/LinkLoader.cpp:
809         (WebCore::LinkLoader::prefetchIfNeeded):
810         * loader/ResourceLoadInfo.cpp:
811         (WebCore::toResourceType):
812         * loader/ResourceLoadInfo.h:
813         * loader/ResourceLoader.cpp:
814         (WebCore::ResourceLoader::willSendRequestInternal):
815         * loader/cache/CachedResourceLoader.cpp:
816         (WebCore::CachedResourceLoader::requestResource):
817
818 2019-04-14  Dean Jackson  <dino@apple.com>
819
820         Extract UTI mapping and allow for additions
821         https://bugs.webkit.org/show_bug.cgi?id=196822
822         <rdar://problem/49822339>
823
824         Reviewed by Darin Adler
825
826         Post landing feedback on minimizing String constructors.
827
828         * platform/network/mac/UTIUtilities.mm:
829         (WebCore::MIMETypeFromUTITree):
830         (WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
831
832 2019-04-14  Don Olmstead  <don.olmstead@sony.com>
833
834         [CMake] JavaScriptCore derived sources should only be referenced inside JavaScriptCore
835         https://bugs.webkit.org/show_bug.cgi?id=196742
836
837         Reviewed by Konstantin Tokarev.
838
839         Don't set JavaScriptCore_SCRIPTS_DIR now that it is set within WebKitFS.
840
841         * CMakeLists.txt:
842
843 2019-04-12  Antoine Quint  <graouts@apple.com>
844
845         Provide a quirk to disable Pointer Events
846         https://bugs.webkit.org/show_bug.cgi?id=196877
847         <rdar://problem/49863470>
848
849         Reviewed by Dean Jackson.
850
851         Add a quirk to disable Pointer Events. We also opt a website that has compatibility issues with Pointer Events into this new quirk.
852
853         * dom/PointerEvent.idl:
854         * page/Quirks.cpp:
855         (WebCore::Quirks::shouldDisablePointerEventsQuirk const):
856         * page/Quirks.h:
857         * page/scrolling/ScrollingCoordinator.cpp:
858         (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const):
859         * style/StyleTreeResolver.cpp:
860         (WebCore::Style::TreeResolver::resolveElement):
861
862 2019-04-12  Wenson Hsieh  <wenson_hsieh@apple.com>
863
864         Enable modern compatibility mode by default in WKWebView on some devices
865         https://bugs.webkit.org/show_bug.cgi?id=196883
866         <rdar://problem/49864527>
867
868         Reviewed by Tim Horton.
869
870         Add a new helper function to determine whether an app is pre-installed on iOS, for the purposes of ensuring
871         compatibility with existing Apple apps that are not affected by linked-on-or-after. This involves all apps with
872         a bundle ID that begins with "com.apple.".
873
874         * platform/RuntimeApplicationChecks.h:
875         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
876         (WebCore::setApplicationBundleIdentifier):
877         (WebCore::applicationBundleStartsWith):
878         (WebCore::IOSApplication::isAppleApplication):
879
880 2019-04-12  Justin Fan  <justin_fan@apple.com>
881
882         [Web GPU] Prevent narrowing conversions during Metal function calls on 32-bit platforms
883         https://bugs.webkit.org/show_bug.cgi?id=196793
884
885         Reviewed by Darin Adler.
886
887         On 32-bit platforms, NSUInteger is 32-bit, which limits certain Web GPU parameters. 
888         Ensure that valid parameters are properly converted to NSUInteger for Metal calls, regardless of platform.
889
890         * platform/graphics/gpu/GPUBuffer.h:
891         (WebCore::GPUBuffer::byteLength const):
892         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
893         (WebCore::tryGetResourceAsBufferBinding):
894         (WebCore::setBufferOnEncoder):
895         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
896         (WebCore::GPUBuffer::validateBufferUsage):
897         (WebCore::GPUBuffer::tryCreate):
898         (WebCore::GPUBuffer::GPUBuffer):
899         (WebCore::GPUBuffer::setSubData):
900         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
901         (WebCore::GPUCommandBuffer::copyBufferToBuffer):
902         (WebCore::GPUCommandBuffer::copyBufferToTexture):
903         (WebCore::GPUCommandBuffer::copyTextureToBuffer):
904         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
905         (WebCore::GPURenderPassEncoder::drawIndexed):
906         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
907         (WebCore::trySetInputStateForPipelineDescriptor):
908
909 2019-04-12  Ross Kirsling  <ross.kirsling@sony.com>
910
911         Unreviewed fix for non-unified build.
912
913         * dom/ScriptedAnimationController.h:
914         Add missing include from r244182.
915
916 2019-04-11  Ryosuke Niwa  <rniwa@webkit.org>
917
918         WebThread should run at a higher priority than user initiated
919         https://bugs.webkit.org/show_bug.cgi?id=196849
920         <rdar://problem/46851062>
921
922         Reviewed by Geoffrey Garen.
923
924         Use QOS_CLASS_USER_INTERACTIVE on WebThread with -10 relative priority so that WebThread
925         won't wait for other threads with priority 30-37 but does not content with the main thread.
926
927         Also removed the call to pthread_attr_setschedparam which disables QoS.
928
929         This improves the blocked time in StartWebThread from 2~3ms to 250μs while cold launching
930         iBooks to an opened book.
931
932         * platform/ios/wak/WebCoreThread.mm:
933         (StartWebThread): Replaced 200 * 4096 by 800 * KB for a better readability.
934
935 2019-04-12  Ryosuke Niwa  <rniwa@webkit.org>
936
937         Add CSS Shadow Parts as a feature under consideration
938         https://bugs.webkit.org/show_bug.cgi?id=196835
939
940         Reviewed by Antti Koivisto.
941
942         This feature is under consideration.
943
944         * features.json:
945
946 2019-04-12  Ross Kirsling  <ross.kirsling@sony.com>
947
948         WebKit should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
949         https://bugs.webkit.org/show_bug.cgi?id=196845
950
951         Reviewed by Ryosuke Niwa.
952
953         * html/canvas/CanvasRenderingContext2DBase.cpp:
954         (WebCore::CanvasRenderingContext2DBase::FontProxy::initialize):
955         (WebCore::CanvasRenderingContext2DBase::FontProxy::fontMetrics const):
956         (WebCore::CanvasRenderingContext2DBase::FontProxy::fontDescription const):
957         (WebCore::CanvasRenderingContext2DBase::FontProxy::width const):
958         (WebCore::CanvasRenderingContext2DBase::FontProxy::drawBidiText const):
959         (WebCore::CanvasRenderingContext2DBase::beginCompositeLayer):
960         (WebCore::CanvasRenderingContext2DBase::endCompositeLayer):
961         Remove inline specifier to address linking errors (regardless of CMake platform).
962         Doing this in a .cpp file interferes with symbol creation.
963
964         * Modules/mediastream/MediaStreamTrack.cpp:
965         * Modules/webvr/VREyeParameters.cpp:
966         * Modules/webvr/VRFrameData.cpp:
967         * Modules/webvr/VRPose.cpp:
968         * accessibility/AccessibilityList.cpp:
969         * accessibility/isolatedtree/AXIsolatedTree.cpp:
970         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
971         * bindings/js/JSDOMConvertWebGL.cpp:
972         * bindings/js/JSHistoryCustom.cpp:
973         * bindings/js/JSIDBCursorWithValueCustom.cpp:
974         * bindings/js/JSPerformanceObserverCustom.cpp:
975         * bindings/js/WindowProxy.cpp:
976         * platform/ColorData.gperf:
977         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
978         * platform/network/DNSResolveQueue.cpp:
979         * workers/service/ServiceWorkerClientQueryOptions.h:
980         * workers/service/ServiceWorkerContainer.cpp:
981         Add missing includes to address compiler errors on GTK.
982
983 2019-04-12  Zalan Bujtas  <zalan@apple.com>
984
985         REGRESSION (r244098): [ Mac WK1 ] Layout Test fast/dynamic/paused-event-dispatch.html is Timing out
986         https://bugs.webkit.org/show_bug.cgi?id=196789
987         <rdar://problem/49855255>
988
989         Reviewed by Tim Horton.
990
991         Disable auto-sizing mode at the start of each test.
992
993         * testing/Internals.cpp:
994         (WebCore::Internals::resetToConsistentState):
995
996 2019-04-12  Eric Carlson  <eric.carlson@apple.com>
997
998         Update AudioSession route sharing policy
999         https://bugs.webkit.org/show_bug.cgi?id=196776
1000         <rdar://problem/46501611>
1001
1002         Reviewed by Jer Noble.
1003
1004         No new tests, updated an API test.
1005
1006         * platform/audio/AudioSession.cpp:
1007         (WebCore::convertEnumerationToString):
1008         * platform/audio/AudioSession.h:
1009         (WTF::LogArgument<WebCore::RouteSharingPolicy>::toString):
1010         (WTF::LogArgument<WebCore::AudioSession::CategoryType>::toString):
1011         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
1012         (MediaSessionManagerCocoa::updateSessionState):
1013         * platform/audio/ios/AudioSessionIOS.mm:
1014         (WebCore::AudioSession::setCategory):
1015         (WebCore::AudioSession::routeSharingPolicy const):
1016         * platform/audio/mac/AudioSessionMac.cpp:
1017         (WebCore::AudioSession::setCategory):
1018
1019 2019-04-12  Antoine Quint  <graouts@apple.com>
1020
1021         Opt some websites into the simulated mouse events dispatch quirk when in modern compatibility mode
1022         https://bugs.webkit.org/show_bug.cgi?id=196830
1023         <rdar://problem/49124313>
1024
1025         Reviewed by Wenson Hsieh.
1026
1027         We add a new policy to determine whether simulated mouse events dispatch are allowed and use it to determine whether the
1028         simulated mouse events dispatch quirk can be used for a given website. We then check the domain name for the current page's
1029         document to see if it matches some known websites that require this quirk.
1030
1031         We needed to add some calls into Quirks::shouldDispatchSimulateMouseEvents() where we used to only consult the RuntimeEnabledFeature
1032         flag to ensure we correctly created touch regions for simulated mouse events.
1033
1034         * dom/EventNames.h:
1035         (WebCore::EventNames::isTouchRelatedEventType const):
1036         * dom/Node.cpp:
1037         (WebCore::Node::moveNodeToNewDocument):
1038         (WebCore::tryAddEventListener):
1039         (WebCore::tryRemoveEventListener):
1040         (WebCore::Node::defaultEventHandler):
1041         * loader/DocumentLoader.h:
1042         (WebCore::DocumentLoader::simulatedMouseEventsDispatchPolicy const):
1043         (WebCore::DocumentLoader::setSimulatedMouseEventsDispatchPolicy):
1044         * page/DOMWindow.cpp:
1045         (WebCore::DOMWindow::addEventListener):
1046         (WebCore::DOMWindow::removeEventListener):
1047         * page/Quirks.cpp:
1048         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
1049         (WebCore::Quirks::shouldDispatchSimulateMouseEvents const): Deleted.
1050         * page/Quirks.h:
1051
1052 2019-04-11  Simon Fraser  <simon.fraser@apple.com>
1053
1054         [iOS WK2] Wrong scrolling behavior for nested absolute position elements inside overflow scroll
1055         https://bugs.webkit.org/show_bug.cgi?id=196146
1056
1057         Reviewed by Antti Koivisto.
1058         
1059         computeCoordinatedPositioningForLayer() failed to handle nested positions elements
1060         inside overflow scroll, because it only walked up to the first containing block of
1061         a nested position:absolute. We need to walk all the way up the ancestor layer chain,
1062         looking at containing block, scroller and composited ancestor relationships.
1063
1064         Make this code easier to understand by writing it in terms of "is foo scrolled by bar", rather than
1065         trying to collapse all the logic into a single ancestor walk, which was really hard. This is a few
1066         more ancestor traversals, but we now only run this code if there's composited scrolling
1067         in the ancestor chain.
1068
1069         Tests: scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow.html
1070                scrollingcoordinator/scrolling-tree/nested-absolute-in-overflow.html
1071                scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow.html
1072                scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html
1073
1074         * rendering/RenderLayerCompositor.cpp:
1075         (WebCore::enclosingCompositedScrollingLayer):
1076         (WebCore::isScrolledByOverflowScrollLayer):
1077         (WebCore::isNonScrolledLayerInsideScrolledCompositedAncestor):
1078         (WebCore::RenderLayerCompositor::layerContainingBlockCrossesCoordinatedScrollingBoundary):
1079         (WebCore::collectStationaryLayerRelatedOverflowNodes):
1080         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
1081         (WebCore::collectRelatedCoordinatedScrollingNodes):
1082         (WebCore::layerParentedAcrossCoordinatedScrollingBoundary): Deleted.
1083
1084 2019-04-12  Manuel Rego Casasnovas  <rego@igalia.com>
1085
1086         [css-flex][css-grid] Fix synthesized baseline
1087         https://bugs.webkit.org/show_bug.cgi?id=196312
1088
1089         Reviewed by Javier Fernandez.
1090
1091         When a flex or grid container has no baseline,
1092         its baseline should be synthesized from the border edges.
1093         The same happens for flex and grid items.
1094         
1095         Right now we were using the content box in some cases
1096         and even using the margin box in a particular scenario.
1097         The patch fixes this.
1098         
1099         At the same time this is also fixing the baseline for
1100         inline flex/grid containers to make it interoperable with Firefox.
1101         Inline blocks have a special behavior per legacy reasons,
1102         which applies to inline flex/grid containers when they have no items;
1103         otherwise the items should be used to compute its baseline.
1104         See more at: https://github.com/w3c/csswg-drafts/issues/3416
1105
1106         Note that we need to keep current behavior for buttons,
1107         as the flexbox spec doesn't apply to them.
1108
1109         Tests: css3/flexbox/flexbox-baseline-margins.html
1110                fast/css-grid-layout/grid-baseline-margins-1.html
1111                fast/css-grid-layout/grid-baseline-margins-2.html
1112                imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-flexbox-001.html
1113                imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-grid-001.html
1114                imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-inline-block-001.html
1115
1116         * rendering/RenderButton.cpp:
1117         (WebCore::synthesizedBaselineFromContentBox):
1118         (WebCore::RenderButton::baselinePosition const):
1119         * rendering/RenderButton.h:
1120         * rendering/RenderFlexibleBox.cpp:
1121         (WebCore::synthesizedBaselineFromBorderBox):
1122         (WebCore::RenderFlexibleBox::baselinePosition const):
1123         (WebCore::RenderFlexibleBox::firstLineBaseline const):
1124         (WebCore::RenderFlexibleBox::inlineBlockBaseline const):
1125         * rendering/RenderGrid.cpp:
1126         (WebCore::RenderGrid::baselinePosition const):
1127         (WebCore::RenderGrid::inlineBlockBaseline const):
1128
1129 2019-04-11  Simon Fraser  <simon.fraser@apple.com>
1130
1131         Avoid doing positioned scrolling tree node work for layers not inside overflow:scroll
1132         https://bugs.webkit.org/show_bug.cgi?id=196848
1133
1134         Reviewed by Zalan Bujtas.
1135
1136         Maintain a bit on RenderLayer which says if a layer has a composited scrolling ancestor
1137         in the layer tree. We only need to do work related to making positioned scrolling tree nodes
1138         for layers which are layer tree descendants of overflow:scroll.
1139
1140         * rendering/RenderLayer.cpp:
1141         (WebCore::RenderLayer::RenderLayer):
1142         (WebCore::RenderLayer::updateLayerPositions):
1143         (WebCore::outputPaintOrderTreeLegend):
1144         (WebCore::outputPaintOrderTreeRecursive):
1145         * rendering/RenderLayer.h:
1146         * rendering/RenderLayerCompositor.cpp:
1147         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
1148         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
1149         (WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
1150         (WebCore::RenderLayerCompositor::fixedLayerIntersectsViewport const):
1151         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
1152
1153 2019-04-11  Zalan Bujtas  <zalan@apple.com>
1154
1155         Try to fix Windows build.
1156
1157         * page/PrintContext.cpp:
1158         (WebCore::PrintContext::computedPageMargin):
1159
1160 2019-04-11  Megan Gardner  <megan_gardner@apple.com>
1161
1162         Update 'Save Image' to more clear instructions
1163         https://bugs.webkit.org/show_bug.cgi?id=196833
1164         <rdar://problem/47446845>
1165
1166         Reviewed by Wenson Hsieh.
1167
1168         Not testable, UI change only.
1169
1170         * en.lproj/Localizable.strings:
1171
1172 2019-04-11  Zalan Bujtas  <zalan@apple.com>
1173
1174         Add @page margin support
1175         https://bugs.webkit.org/show_bug.cgi?id=196680
1176         <rdar://problem/45217707>
1177
1178         Reviewed by Tim Horton.
1179
1180         This patch adds support for @page margin. This feature is currently behind a runtime flag and is off by default.
1181         We resolve the @page margin values in the WebProcess (currently no pseudo class is supported) and transfer them to the UIProcess through computedPagesCallback.
1182         UIProcess is responsible for applying these new values on the printer. We also re-compute the available width/height for the current printing context
1183         in the WebProcess if needed (see PrintInfo for current printer margins).
1184
1185         Tests: printing/page-with-10mm-left-margin.html
1186                printing/page-with-zero-margin.html
1187
1188         * page/PrintContext.cpp:
1189         (WebCore::PrintContext::computedPageMargin):
1190         (WebCore::PrintContext::computedPageSize):
1191         * page/PrintContext.h:
1192         * page/RuntimeEnabledFeatures.h:
1193         (WebCore::RuntimeEnabledFeatures::pageAtRuleSupportEnabled const):
1194         (WebCore::RuntimeEnabledFeatures::setPageAtRuleSupportEnabled):
1195
1196 2019-04-11  Dean Jackson  <dino@apple.com>
1197
1198         Extract UTI mapping and allow for additions
1199         https://bugs.webkit.org/show_bug.cgi?id=196822
1200         <rdar://problem/49822339>
1201
1202         Reviewed by Tim Horton.
1203
1204         Add an ADDITIONAL_SYSTEM_PREVIEW_TYPES macro to the list
1205         of accepted MIME types. And add a new helper to map
1206         MIME types to UTI types when the system was unable to
1207         find an existing type.
1208
1209         * platform/MIMETypeRegistry.cpp:
1210         (WebCore::MIMETypeRegistry::systemPreviewMIMETypes):
1211         * platform/network/mac/UTIUtilities.mm:
1212         (WebCore::UTIFromUnknownMIMEType):
1213         (WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
1214
1215 2019-04-09  Ryosuke Niwa  <rniwa@webkit.org>
1216
1217         [iOS] Moving backwards by word granularity does not work if the previous line was inside another block element
1218         https://bugs.webkit.org/show_bug.cgi?id=196670
1219
1220         Reviewed by Wenson Hsieh.
1221
1222         The bug was ultimately caused by two reasons:
1223          1. On iOS, previousWordPositionBoundary would identify a blank line as a word boundary.
1224          2. SimplifiedBackwardsTextIterator generates a new line character (\n) between two block elements.
1225
1226         When moving backwards by word granularity, therefore, previousBoundary would encounter a new line created by (2)
1227         and then previousWordPositionBoundary would identify it as a word boundary.
1228
1229         Fixed the bug (2) by adding the same check as TextIterator::exitNode has to avoid generating an extra new line
1230         character following an exiting new line character. Also added internals.rangeAsTextUsingBackwardsTextIterator
1231         to make SimplifiedBackwardsTextIterator directly testable in layout tests.
1232
1233         This fix unveiled an unrelated bug when moving backwards with sentence granularity at the beginning of a line.
1234         In this case, WebKit was previously feeding ICU with the previous line's content followed by two new lines,
1235         which constituted a new sentence. However after the fix, ICU no longer detects a new sentence after the end
1236         of the prevous line. This patch, therefore, introduces a new optional argument to previousBoundary which forces
1237         the succeeding paragraph's content (i.e. the content of the line from which we're moving backwards with sentence
1238         granularity) to be fed to ICU. This fixes the bug that we were previously not being able to move backwards
1239         with sentence granularity at the beginning of a line as indicated by the new tests.
1240
1241         Tests: editing/selection/extend-selection-backward-at-beginning-of-line-by-sentence-granularity.html
1242                editing/selection/extend-selection-backward-at-beginning-of-line-by-word-granularity.html
1243                editing/selection/move-selection-backward-at-beginning-of-line-by-sentence-granularity.html
1244                editing/selection/move-selection-backward-at-beginning-of-line-by-word-granularity.html
1245                editing/text-iterator/backwards-text-iterator-basic.html
1246
1247         * accessibility/AXObjectCache.cpp:
1248         (WebCore::AXObjectCache::previousBoundary): Fixed the bug that moving backwards with sentence granularity at
1249         the beginning of a line does not work like we did in VisibleUnits. See the description below. It's tested by
1250         an existing layout test accessibility/mac/text-marker-sentence-nav.html, which would fail without this fix.
1251         (WebCore::AXObjectCache::startCharacterOffsetOfSentence):
1252         * accessibility/AXObjectCache.h:
1253         (WebCore::CharacterOffset::isEqual const):
1254         * editing/TextIterator.cpp:
1255         (WebCore::SimplifiedBackwardsTextIterator::handleNonTextNode): Fixed the bug that we were generating two line
1256         lines between block elements. This fixes the bug that moving backwards with word granularity at the beginning
1257         of a line fails on iOS.
1258         (WebCore::plainTextUsingBackwardsTextIteratorForTesting): Added.
1259         * editing/TextIterator.h:
1260         * editing/VisibleUnits.cpp:
1261         (WebCore::previousBoundary): Added the code to extract the succeeding paragraph's content as context for ICU.
1262         This fixes the bug that moving backwards with sentence granularity at the beginning of a line fails.
1263         Limit the length of backwards iteration at the current position to avoid traversing backwards beyond
1264         the current position, and fixed a bug that an early return for the text node was not taking the suffix length
1265         into account when deciding whether next position resides in the starting container node or not.
1266         (WebCore::startSentenceBoundary):
1267         (WebCore::startOfSentence):
1268         * testing/Internals.cpp:
1269         (WebCore::Internals::rangeAsTextUsingBackwardsTextIterator): Added.
1270         * testing/Internals.h:
1271         * testing/Internals.idl:
1272
1273 2019-04-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1274
1275         Allow the MediaSource API to be enabled via website policy
1276         https://bugs.webkit.org/show_bug.cgi?id=196429
1277         <rdar://problem/48774333>
1278
1279         Reviewed by Tim Horton.
1280
1281         Add support in DocumentLoader for adjusting page settings using its per-site policies. See WebKit ChangeLog for
1282         more detail (in particular, the implementation of applyToDocumentLoader).
1283
1284         Test: fast/media/ios/ipad/enable-MediaSource-API-in-modern-compatibility-mode.html
1285
1286         * loader/DocumentLoader.cpp:
1287         (WebCore::DocumentLoader::applyPoliciesToSettings const):
1288         (WebCore::DocumentLoader::attachToFrame):
1289         * loader/DocumentLoader.h:
1290
1291         Add an enum class for MediaSource policies; while we're at it, make all of these enum values 8 bits wide.
1292
1293         (WebCore::DocumentLoader::mediaSourcePolicy const):
1294         (WebCore::DocumentLoader::setMediaSourcePolicy):
1295
1296 2019-04-11  Youenn Fablet  <youenn@apple.com>
1297
1298         Support RTCDataChannel blob binaryType
1299         https://bugs.webkit.org/show_bug.cgi?id=196821
1300
1301         Reviewed by Eric Carlson.
1302
1303         Add support for receiving blobs.
1304         Default value is still left to 'arraybuffer' which is not spec compliant.
1305         Covered by rebased test.
1306
1307         * Modules/mediastream/RTCDataChannel.cpp:
1308         (WebCore::RTCDataChannel::setBinaryType):
1309         (WebCore::RTCDataChannel::didReceiveRawData):
1310
1311 2019-04-11  Devin Rousso  <drousso@apple.com>
1312
1313         Web Inspector: Timelines: can't reliably stop/start a recording
1314         https://bugs.webkit.org/show_bug.cgi?id=196778
1315         <rdar://problem/47606798>
1316
1317         Reviewed by Timothy Hatcher.
1318
1319         * inspector/agents/InspectorTimelineAgent.cpp:
1320         (WebCore::InspectorTimelineAgent::startProgrammaticCapture):
1321         (WebCore::InspectorTimelineAgent::stopProgrammaticCapture):
1322         It is possible to determine when programmatic capturing starts/stops in the frontend based
1323         on the state when the backend causes the state to change, such as if the state is "inactive"
1324         when the frontend is told that the backend has started capturing.
1325
1326         * inspector/agents/InspectorCPUProfilerAgent.cpp:
1327         (WebCore::InspectorCPUProfilerAgent::stopTracking):
1328         * inspector/agents/InspectorMemoryAgent.cpp:
1329         (WebCore::InspectorMemoryAgent::stopTracking):
1330         Send an end timestamp to match other instruments.
1331
1332 2019-04-11  Truitt Savell  <tsavell@apple.com>
1333
1334         Unreviewed, rolling out r244158.
1335
1336         Casued 8 inspector/timeline/ test failures.
1337
1338         Reverted changeset:
1339
1340         "Web Inspector: Timelines: can't reliably stop/start a
1341         recording"
1342         https://bugs.webkit.org/show_bug.cgi?id=196778
1343         https://trac.webkit.org/changeset/244158
1344
1345 2019-04-11  Pablo Saavedra  <psaavedra@igalia.com>
1346
1347         [WPE] Build error with ENABLE_VIDEO=OFF after r244078
1348         https://bugs.webkit.org/show_bug.cgi?id=196811
1349
1350         createGenericCue() is only defined when VIDEO_TRACK is enabled.
1351
1352         Reviewed by Eric Carlson.
1353
1354         * testing/Internals.cpp:
1355         (WebCore::Internals::createGenericCue):
1356         * testing/Internals.h:
1357
1358 2019-04-11  Carlos Garcia Campos  <cgarcia@igalia.com>
1359
1360         [GTK] Layout test accessibility/aria-hidden-false-works-in-subtrees.html fails after r184890
1361         https://bugs.webkit.org/show_bug.cgi?id=146718
1362         <rdar://problem/21722487>
1363
1364         Reviewed by Joanmarie Diggs.
1365
1366         Allow to get the text under element for nodes hidden in DOM but explicitly exposed to accessibility with
1367         aria-hidden="false".
1368
1369         Fixes: accessibility/aria-hidden-false-works-in-subtrees.html
1370
1371         * accessibility/AccessibilityNodeObject.cpp:
1372         (WebCore::AccessibilityNodeObject::textUnderElement const):
1373         * accessibility/atk/WebKitAccessible.cpp:
1374         (roleIsTextType): Also consider ApplicationGroup role as text elements, so that <div>text</div> is equivalent to
1375         <div role="roup">test</div>.
1376
1377 2019-04-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
1378
1379         requestAnimationFrame should execute before the next frame
1380         https://bugs.webkit.org/show_bug.cgi?id=177484
1381
1382         Reviewed by Simon Fraser.
1383
1384         This change fixes these issues with animation timing:
1385
1386         1. Calling the requestAnimationFrame callbacks would have happened when
1387            the DisplayLink fires. This may have happened even if the frame is
1388            missed and no display is committed.
1389
1390         2. Style changes and layout triggered by script could trigger painting
1391            at more than 60fps. CoreAnimation commits could happen at more than
1392            60fps, although WindowServer will throttle those, and only some will
1393            be shown on the screen.
1394
1395         This change introduces a new paint scheduling model where painting is
1396         driven by a "RenderingUpdateScheduler", which only triggers paints once
1397         per 16.7ms frame.
1398
1399         Code that previously scheduled a compositing layer flush now schedules a
1400         "RenderingUpdate", and that update is driven by a DisplayRefreshMonitor
1401         callback. When the render happens, we service requestAnimationFrame callbacks,
1402         Web Animations, intersection observations and resize observations per the
1403         "Update the rendering" step of the HTML Event Loop specification:
1404         <https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.
1405
1406         In the future, more rendering steps will be added to this code.
1407
1408         * Sources.txt:
1409         * WebCore.xcodeproj/project.pbxproj:
1410         * accessibility/mac/AXObjectCacheMac.mm:
1411         (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
1412         Fix layout tests by adding null check.
1413
1414         * animation/DocumentAnimationScheduler.cpp: Removed.
1415         * animation/DocumentAnimationScheduler.h: Removed.
1416         * animation/DocumentTimeline.cpp:
1417         (WebCore::DocumentTimeline::DocumentTimeline):
1418         (WebCore::DocumentTimeline::updateThrottlingState):
1419         (WebCore::DocumentTimeline::suspendAnimations):
1420         (WebCore::DocumentTimeline::resumeAnimations):
1421         (WebCore::DocumentTimeline::liveCurrentTime const):
1422         (WebCore::DocumentTimeline::currentTime):
1423         (WebCore::DocumentTimeline::cacheCurrentTime):
1424         (WebCore::DocumentTimeline::animationTimingDidChange):
1425         (WebCore::DocumentTimeline::scheduleAnimationResolution):
1426         (WebCore::DocumentTimeline::unscheduleAnimationResolution):
1427         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents):
1428         (WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents):
1429         (WebCore::DocumentTimeline::scheduleNextTick):
1430         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
1431         Simplify this function by handling the case of no-animations separately.
1432
1433         (WebCore::DocumentTimeline::resolveAnimationsForElement):
1434         Simplify the loop and delete hasPendingAcceleratedAnimations because it
1435         is initialized to true and is not changed inside the loop.
1436
1437         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Deleted.
1438         (WebCore::DocumentTimeline::animationResolutionTimerFired): Deleted.
1439         * animation/DocumentTimeline.h:
1440         * dom/Document.cpp:
1441         (WebCore::Document::resolveStyle):
1442         There is no need to force update in resolveStyle(). notifyFlushRequired()
1443         will be called eventually which will scheduleRenderingUpdate().
1444
1445         (WebCore::Document::prepareForDestruction):
1446         (WebCore::Document::updateAnimationsAndSendEvents):
1447         (WebCore::Document::serviceRequestAnimationFrameCallbacks):
1448         (WebCore::Document::windowScreenDidChange):
1449         (WebCore::Document::scheduleRenderingUpdate):
1450         (WebCore::Document::updateIntersectionObservations):
1451         (WebCore::Document::addResizeObserver):
1452         (WebCore::Document::updateResizeObservations):
1453         (WebCore::Document::scheduleForcedIntersectionObservationUpdate): Deleted.
1454         (WebCore::Document::scheduleResizeObservations): Deleted.
1455         (WebCore::Document::animationScheduler): Deleted.
1456         No need to schedule web-animations, intersection observations and resize
1457         observations updates separately. All of them will be updated through the
1458         "Update the rendering" step, i.e. Page::updateRendering().        
1459
1460         * dom/Document.h:
1461         (WebCore::Document::numberOfIntersectionObservers const):
1462         * dom/ScriptedAnimationController.cpp:
1463         (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
1464         (WebCore::ScriptedAnimationController::scheduleAnimation):
1465         (WebCore::ScriptedAnimationController::animationTimerFired):
1466         (WebCore::ScriptedAnimationController::serviceScriptedAnimations): Deleted.
1467         (WebCore::ScriptedAnimationController::documentAnimationSchedulerDidFire): Deleted.
1468         * dom/ScriptedAnimationController.h:
1469         * page/FrameView.cpp:
1470         (WebCore::FrameView::didLayout):
1471         (WebCore::FrameView::viewportContentsChanged):
1472         * page/FrameViewLayoutContext.cpp:
1473         (WebCore::FrameViewLayoutContext::layoutTimerFired):
1474         * page/IntersectionObserver.cpp:
1475         (WebCore::IntersectionObserver::observe):
1476         * page/Page.cpp:
1477         (WebCore::Page::Page):
1478         (WebCore::Page::layoutIfNeeded):
1479         (WebCore::Page::updateRendering):
1480         (WebCore::Page::renderingUpdateScheduler):
1481         (WebCore::Page::willDisplayPage): Deleted.
1482         (WebCore::Page::addDocumentNeedingIntersectionObservationUpdate): Deleted.
1483         (WebCore::Page::updateIntersectionObservations): Deleted.
1484         (WebCore::Page::scheduleForcedIntersectionObservationUpdate): Deleted.
1485         (WebCore::Page::hasResizeObservers const): Deleted.
1486         (WebCore::Page::gatherDocumentsNeedingResizeObservationCheck): Deleted.
1487         (WebCore::Page::checkResizeObservations): Deleted.
1488         (WebCore::Page::scheduleResizeObservations): Deleted.
1489         (WebCore::Page::notifyResizeObservers): Deleted.
1490         * page/Page.h:
1491         (WebCore::Page::setNeedsCheckResizeObservations): Deleted.
1492         (WebCore::Page::needsCheckResizeObservations const): Deleted.
1493         The IntersectionObserver and the ResizeObserver do not need to schedule
1494         their own timers. The RenderingUpdateScheduler will schedule the "Update
1495         the rendering" step in which these obverses will be served.
1496
1497         * page/PageOverlayController.cpp:
1498         (WebCore::PageOverlayController::didChangeViewExposedRect):
1499         (WebCore::PageOverlayController::notifyFlushRequired):
1500         Force committing the layers to be 60 fps at maximum.
1501
1502         * page/RenderingUpdateScheduler.cpp: Added.
1503         (WebCore::RenderingUpdateScheduler::RenderingUpdateScheduler):
1504         (WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate):
1505         (WebCore::RenderingUpdateScheduler::isScheduled const):
1506         (WebCore::RenderingUpdateScheduler::startTimer):
1507         (WebCore::RenderingUpdateScheduler::clearScheduled):
1508         (WebCore::RenderingUpdateScheduler::createDisplayRefreshMonitor const):
1509         (WebCore::RenderingUpdateScheduler::windowScreenDidChange):
1510         (WebCore::RenderingUpdateScheduler::displayRefreshFired):
1511         (WebCore::RenderingUpdateScheduler::scheduleCompositingLayerFlush):
1512         * page/RenderingUpdateScheduler.h: Added.
1513         (WebCore::RenderingUpdateScheduler::create):
1514         * page/ResizeObserver.cpp:
1515         (WebCore::ResizeObserver::observe):
1516         (WebCore::ResizeObserver::scheduleObservations): Deleted.
1517         * page/ResizeObserver.h:
1518         (WebCore::ResizeObserver::hasActiveObservations const):
1519         * page/ios/ContentChangeObserver.h:
1520         * page/mac/ServicesOverlayController.mm:
1521         (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
1522         * page/scrolling/ScrollingStateTree.cpp:
1523         * rendering/RenderLayerCompositor.cpp:
1524         (WebCore::RenderLayerCompositor::scheduleLayerFlushNow):
1525         (WebCore::RenderLayerCompositor::layerTreeAsText):
1526
1527 2019-04-10  Ryosuke Niwa  <rniwa@webkit.org>
1528
1529         Nullptr crash in CompositeEditCommand::moveParagraphs when root editable element goes away
1530         https://bugs.webkit.org/show_bug.cgi?id=193027
1531
1532         Reviewed by Wenson Hsieh.
1533
1534         Added an early exit when the root editable element (editing host in HTML5 spec terminology) is null
1535         during CompositeEditCommand::moveParagraphs. This could happen when the website does something crazy
1536         like removing contenteditable content attribute during DOM mutations or when the destination becomes
1537         disconnected (orphaned) from the document due to bugs elsewhere in the codebase.
1538
1539         Test: editing/deleting/merge-paragraphs-null-root-editable-element-crash.html
1540
1541         * editing/CompositeEditCommand.cpp:
1542         (WebCore::CompositeEditCommand::moveParagraphs): Added an early exit.
1543
1544 2019-04-10  Devin Rousso  <drousso@apple.com>
1545
1546         Web Inspector: save sheet should be anchored underneath the tab bar when detached
1547         https://bugs.webkit.org/show_bug.cgi?id=196722
1548         <rdar://problem/49613280>
1549
1550         Reviewed by Timothy Hatcher.
1551
1552         No web observable change.
1553
1554         * inspector/InspectorFrontendClient.h:
1555         (WebCore::InspectorFrontendClient::changeSheetRect): Added.
1556
1557         * inspector/InspectorFrontendClientLocal.h:
1558         * inspector/InspectorFrontendClientLocal.cpp:
1559         (WebCore::InspectorFrontendClientLocal::changeSheetRect): Added.
1560
1561         * inspector/InspectorFrontendHost.idl:
1562         * inspector/InspectorFrontendHost.h:
1563         * inspector/InspectorFrontendHost.cpp:
1564         (WebCore::InspectorFrontendHost::setSheetRect): Added.
1565
1566         * testing/Internals.cpp:
1567         (WebCore::InspectorStubFrontend::setSheetRect): Added.
1568
1569 2019-04-10  Devin Rousso  <drousso@apple.com>
1570
1571         Web Inspector: Inspector: lazily create the agent
1572         https://bugs.webkit.org/show_bug.cgi?id=195971
1573         <rdar://problem/49039645>
1574
1575         Reviewed by Joseph Pecoraro.
1576
1577         No change in functionality.
1578
1579         * inspector/InspectorController.h:
1580         * inspector/InspectorController.cpp:
1581         (WebCore::InspectorController::InspectorController):
1582         (WebCore::InspectorController::createLazyAgents):
1583         (WebCore::InspectorController::evaluateForTestInFrontend):
1584         (WebCore::InspectorController::ensureInspectorAgent):
1585
1586 2019-04-10  Megan Gardner  <megan_gardner@apple.com>
1587
1588         Remove unneeded extern C
1589         https://bugs.webkit.org/show_bug.cgi?id=196786
1590
1591         Reviewed by Tim Horton.
1592
1593         No tests needed, just needs to compile.
1594
1595         Removing staging hack for Reveal framework.
1596
1597         * editing/cocoa/DictionaryLookup.mm:
1598
1599 2019-04-10  Devin Rousso  <drousso@apple.com>
1600
1601         Web Inspector: REGRESSION: lazy agents used outside of frontend/instrumentation can be accessed before being created
1602         https://bugs.webkit.org/show_bug.cgi?id=196725
1603         <rdar://problem/49669810>
1604
1605         Reviewed by Timothy Hatcher.
1606
1607         Move the logic for creating the `InspectorPageAgent` and `InspectorDOMAgent` into separate
1608         functions so that callers into `InspectorController` can be guaranteed to have a valid
1609         instance of the agent.
1610
1611         This doesn't interfere with the `Page.enable` command, as it doesn't clear any saved state.
1612         There is no `DOM.enable` command, so there's no issue there either.
1613
1614         * inspector/InspectorController.h:
1615         (WebCore::InspectorController::pageAgent): Deleted.
1616         * inspector/InspectorController.cpp:
1617         (WebCore::InspectorController::createLazyAgents):
1618         (WebCore::InspectorController::inspect):
1619         (WebCore::InspectorController::hideHighlight):
1620         (WebCore::InspectorController::ensureDOMAgent): Added.
1621         (WebCore::InspectorController::ensurePageAgent): Added.
1622
1623         * inspector/InspectorFrontendClientLocal.cpp:
1624         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame):
1625
1626 2019-04-10  Alex Christensen  <achristensen@webkit.org>
1627
1628         Add SPI WKNavigationResponse._downloadAttribute
1629         https://bugs.webkit.org/show_bug.cgi?id=196755
1630         <rdar://49587365>
1631
1632         Reviewed by Brady Eidson.
1633
1634         Covered by an API test that validates the attribute is correctly sent through the FrameLoader to the API.
1635         When a user clicks on a link with a download attribute, the download attribute should be used as the suggested filename sometimes.
1636         The application needs this information after it has received the response in order to make fully informed decisions about downloads.
1637         In order to get this attribute to the decidePolicyForNavigationResponse, we need to store the attribute on the DocumentLoader
1638         from the FrameLoadRequest then send it from the DocumentLoader when the response is received.
1639
1640         * loader/DocumentLoader.h:
1641         (WebCore::DocumentLoader::setDownloadAttribute):
1642         (WebCore::DocumentLoader::downloadAttribute const):
1643         * loader/EmptyFrameLoaderClient.h:
1644         * loader/FrameLoader.cpp:
1645         (WebCore::FrameLoader::checkContentPolicy):
1646         (WebCore::FrameLoader::loadURL):
1647         (WebCore::FrameLoader::loadWithNavigationAction):
1648         (WebCore::FrameLoader::loadPostRequest):
1649         * loader/FrameLoader.h:
1650         (WebCore::FrameLoader::loadWithNavigationAction):
1651         * loader/FrameLoaderClient.h:
1652
1653 2019-04-10  Youenn Fablet  <youenn@apple.com>
1654
1655         SWClientConnection should not double hop to fire some events
1656         https://bugs.webkit.org/show_bug.cgi?id=196735
1657
1658         Reviewed by Alex Christensen.
1659
1660         Some events, like postMessage in service workers is hopping from main thread to service worker thread to dispatch events.
1661         Some other events, like service worker state update, are hopping from main thread to service worker thread, then posting a task to dispatch events.
1662         This may create ordering problems.
1663
1664         To fix the issue, we now hop to the service worker thread and dispatch the events.
1665         In addition, for documents, we post a task and do the whole service worker processing in it.
1666         This ensures that some tests, like whether there is a service worker container,
1667         or creation of a service worker are done consistently.
1668
1669         Covered by unflaked test.
1670
1671         * workers/service/SWClientConnection.cpp:
1672         (WebCore::SWClientConnection::updateRegistrationState):
1673         (WebCore::SWClientConnection::updateWorkerState):
1674         (WebCore::SWClientConnection::fireUpdateFoundEvent):
1675         (WebCore::SWClientConnection::notifyClientsOfControllerChange):
1676         * workers/service/ServiceWorker.cpp:
1677         (WebCore::ServiceWorker::updateState):
1678         * workers/service/ServiceWorker.h:
1679         * workers/service/ServiceWorkerContainer.cpp:
1680         (WebCore::ServiceWorkerContainer::updateRegistrationState):
1681         (WebCore::ServiceWorkerContainer::fireUpdateFoundEvent):
1682         (WebCore::ServiceWorkerContainer::fireControllerChangeEvent):
1683         * workers/service/ServiceWorkerContainer.h:
1684         * workers/service/ServiceWorkerJob.cpp:
1685         (WebCore::ServiceWorkerJob::notifyFinished):
1686         Notify of the script URL in the error message.
1687         This will help diagnose flakiness issues.
1688         * workers/service/ServiceWorkerRegistration.cpp:
1689         (WebCore::ServiceWorkerRegistration::fireUpdateFoundEvent):
1690         * workers/service/ServiceWorkerRegistration.h:
1691
1692 2019-04-10  Devin Rousso  <drousso@apple.com>
1693
1694         Web Inspector: Timelines: can't reliably stop/start a recording
1695         https://bugs.webkit.org/show_bug.cgi?id=196778
1696         <rdar://problem/47606798>
1697
1698         Reviewed by Timothy Hatcher.
1699
1700         * inspector/agents/InspectorTimelineAgent.cpp:
1701         (WebCore::InspectorTimelineAgent::startProgrammaticCapture):
1702         (WebCore::InspectorTimelineAgent::stopProgrammaticCapture):
1703         It is possible to determine when programmatic capturing starts/stops in the frontend based
1704         on the state when the backend causes the state to change, such as if the state is "inactive"
1705         when the frontend is told that the backend has started capturing.
1706
1707         * inspector/agents/InspectorCPUProfilerAgent.cpp:
1708         (WebCore::InspectorCPUProfilerAgent::stopTracking):
1709         * inspector/agents/InspectorMemoryAgent.cpp:
1710         (WebCore::InspectorMemoryAgent::stopTracking):
1711         Send an end timestamp to match other instruments.
1712
1713 2019-04-10  Tim Horton  <timothy_horton@apple.com>
1714
1715         Add modern API for overriding the page's specified viewport configuration
1716         https://bugs.webkit.org/show_bug.cgi?id=167734
1717         <rdar://problem/30331795>
1718
1719         Reviewed by Simon Fraser.
1720
1721         New API test: WebKit.OverrideViewportArguments
1722
1723         * dom/Document.cpp:
1724         (WebCore::Document::updateViewportArguments):
1725         * dom/Document.h:
1726         (WebCore::Document::viewportArguments const):
1727         Make the viewportArguments() getter respect the overridden arguments.
1728
1729         * dom/ViewportArguments.cpp:
1730         (WebCore::numericPrefix):
1731         (WebCore::findSizeValue):
1732         (WebCore::findScaleValue):
1733         (WebCore::findBooleanValue):
1734         (WebCore::parseViewportFitValue):
1735         (WebCore::viewportErrorMessage):
1736         (WebCore::reportViewportWarning):
1737         (WebCore::setViewportFeature):
1738         * dom/ViewportArguments.h:
1739         Make it possible to parse ViewportArguments without a Document, so
1740         that it can be used in the UI process. We only used the Document for
1741         two things: error reporting, and getting the state of one setting.
1742         Refactor error handling to use a passed-arund function, and add a
1743         variant of setViewportFeature() that doesn't take a Document.
1744
1745 2019-04-10  Justin Fan  <justin_fan@apple.com>
1746
1747         [Web GPU] Indexed drawing and GPUCommandEncoder crash prevention
1748         https://bugs.webkit.org/show_bug.cgi?id=196758
1749
1750         Reviewed by Dean Jackson.
1751
1752         Test: webgpu/draw-indexed-triangles.html
1753
1754         Implement GPURenderPassEncoder::setIndexBuffer and GPURenderPassEncoder::drawIndexed to enable indexed drawing.
1755         Disable GPUCommandEncoders with active pass encoders from being submitted or encoding blits. 
1756
1757         Prevent active GPUCommandEncoders from being submitted or encoding blit commands:
1758         * Modules/webgpu/WebGPUCommandEncoder.cpp:
1759         (WebCore::WebGPUCommandEncoder::finish):
1760         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
1761         (WebCore::GPUCommandBuffer::copyBufferToBuffer):
1762         (WebCore::GPUCommandBuffer::copyBufferToTexture):
1763         (WebCore::GPUCommandBuffer::copyTextureToBuffer):
1764         (WebCore::GPUCommandBuffer::copyTextureToTexture):
1765
1766         Implement GPURenderPassEncoder::setIndexBuffer and GPURenderPassEncoder::drawIndexed:
1767         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1768         (WebCore::WebGPURenderPassEncoder::setIndexBuffer):
1769         (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Remove unnecessary move operations.
1770         (WebCore::WebGPURenderPassEncoder::drawIndexed): Added.
1771         * Modules/webgpu/WebGPURenderPassEncoder.h:
1772         * Modules/webgpu/WebGPURenderPassEncoder.idl:
1773         * platform/graphics/gpu/GPUBuffer.h:
1774         (WebCore::GPUBuffer::isIndex const):
1775         * platform/graphics/gpu/GPUInputStateDescriptor.h:
1776         * platform/graphics/gpu/GPURenderPassEncoder.h: Cache the index buffer, as Metal does not set the index buffer separate from the draw call.
1777         * platform/graphics/gpu/GPURenderPipeline.h:
1778         (WebCore::GPURenderPipeline::indexFormat const):
1779         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
1780         (WebCore::GPURenderPassEncoder::setIndexBuffer):
1781         (WebCore::GPURenderPassEncoder::setVertexBuffers):
1782         (WebCore::mtlPrimitiveTypeForGPUPrimitiveTopology):
1783         (WebCore::GPURenderPassEncoder::draw):
1784         (WebCore::mtlIndexTypeForGPUIndexFormat): Added.
1785         (WebCore::GPURenderPassEncoder::drawIndexed): Added.
1786         (WebCore::primitiveTypeForGPUPrimitiveTopology): Deleted.
1787         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
1788         (WebCore::GPURenderPipeline::tryCreate):
1789         (WebCore::GPURenderPipeline::GPURenderPipeline):
1790
1791 2019-04-09  Ryosuke Niwa  <rniwa@webkit.org>
1792
1793         OfflineAudioDestinationNode::startRendering leaks OfflineAudioDestinationNode if offlineRender exists early
1794         https://bugs.webkit.org/show_bug.cgi?id=196759
1795
1796         Reviewed by Eric Carlson.
1797
1798         OfflineAudioDestinationNode::startRendering unconditionally ref's itself before invoking offlineRender() in a new thread.
1799         But offlineRender can early exit without ever calling deref() in the main thread, leading to the leak of
1800         OfflineAudioDestinationNode. Fixed the leak by always calling deref in the main thread after calling offlineRender().
1801
1802         Also removed the debug assertion in offlineRender which always hits when we run the relevant test.
1803
1804         Test: imported/w3c/web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size.html
1805
1806         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
1807         (WebCore::OfflineAudioDestinationNode::startRendering):
1808         (WebCore::OfflineAudioDestinationNode::offlineRender):
1809         (WebCore::OfflineAudioDestinationNode::notifyComplete): Merged into startRendering.
1810         * Modules/webaudio/OfflineAudioDestinationNode.h:
1811
1812 2019-04-10  Megan Gardner  <megan_gardner@apple.com>
1813
1814         Fix text autoscrolling when typing in modern webkit
1815         https://bugs.webkit.org/show_bug.cgi?id=196718
1816         <rdar://problem/49225507>
1817
1818         Reviewed by Tim Horton.
1819
1820         Tests: fast/events/autoscroll-when-input-is-offscreen.html
1821                fast/events/autoscroll-with-software-keyboard.html
1822
1823         We have been relying on UIKit to scroll editable text, but
1824         since we cannot give them enough information for them to always
1825         do the right thing, we should just do all the work in WebKit.
1826         This has the added benifit of fixing some tricky autoscrolling
1827         bugs that have cropped up recently.
1828
1829         * editing/Editor.cpp:
1830         (WebCore::Editor::insertTextWithoutSendingTextEvent):
1831         (WebCore::Editor::revealSelectionAfterEditingOperation):
1832         We should be scrolling the main frame in WebKit. We have been relying on UIKit,
1833         but we cannot give them enough information to guarantee a correct scroll, so just
1834         do all the work in WebKit.
1835         * page/FrameView.cpp:
1836         (WebCore::FrameView::unobscuredContentRectExpandedByContentInsets const):
1837         Update to use the rect that is actually visible, accounting for the software keyboard.
1838
1839 2019-04-10  Ross Kirsling  <ross.kirsling@sony.com>
1840
1841         WebCore should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
1842         https://bugs.webkit.org/show_bug.cgi?id=196762
1843
1844         Reviewed by Ryosuke Niwa.
1845
1846         * Modules/indexeddb/IDBCursor.h:
1847         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1848         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
1849         * Modules/websockets/WebSocketFrame.cpp:
1850         * accessibility/AccessibilityARIAGridRow.cpp:
1851         (WebCore::AccessibilityARIAGridRow::parentTable const):
1852         * accessibility/AccessibilityObject.cpp:
1853         * accessibility/AccessibilityRenderObject.cpp:
1854         * animation/CSSAnimation.cpp:
1855         * animation/DeclarativeAnimation.cpp:
1856         * bindings/js/DOMGCOutputConstraint.h:
1857         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
1858         (WebCore::root):
1859         (WebCore::JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
1860         (WebCore::JSCanvasRenderingContext2D::visitAdditionalChildren):
1861         * bindings/js/JSDOMConvertNumbers.cpp:
1862         * bindings/js/JSDOMWindowCustom.cpp:
1863         * bindings/js/JSExtendableMessageEventCustom.cpp:
1864         * bindings/js/SerializedScriptValue.cpp:
1865         * css/CSSFontFaceSource.cpp:
1866         * css/CSSFontFaceSource.h:
1867         * css/MediaQueryMatcher.h:
1868         * css/parser/CSSPropertyParserHelpers.cpp:
1869         * dom/DocumentParser.cpp:
1870         * dom/EventPath.cpp:
1871         * dom/MouseEvent.h:
1872         * dom/SpectreGadget.cpp:
1873         * dom/SpectreGadget.h:
1874         * editing/ChangeListTypeCommand.cpp:
1875         * editing/EditAction.cpp:
1876         * editing/ReplaceSelectionCommand.cpp:
1877         * editing/TextGranularity.h:
1878         * html/HTMLFormControlsCollection.cpp:
1879         * html/HTMLImageElement.cpp:
1880         * html/canvas/CanvasRenderingContext2DBase.cpp:
1881         * inspector/InspectorController.cpp:
1882         * inspector/agents/InspectorApplicationCacheAgent.cpp:
1883         * inspector/agents/InspectorCanvasAgent.cpp:
1884         * inspector/agents/WebHeapAgent.cpp:
1885         * inspector/agents/page/PageAuditAgent.cpp:
1886         * inspector/agents/page/PageConsoleAgent.cpp:
1887         * inspector/agents/page/PageNetworkAgent.cpp:
1888         * inspector/agents/worker/WorkerAuditAgent.cpp:
1889         * loader/CrossOriginAccessControl.h:
1890         * loader/CrossOriginPreflightResultCache.h:
1891         * loader/NavigationAction.cpp:
1892         * loader/ResourceLoadObserver.cpp:
1893         * page/FrameTree.cpp:
1894         * page/IntersectionObserver.cpp:
1895         * page/PageConfiguration.cpp:
1896         * page/PerformanceResourceTiming.cpp:
1897         * page/ResizeObservation.cpp:
1898         * page/UndoManager.cpp:
1899         * plugins/PluginData.cpp:
1900         * rendering/Grid.h:
1901         * rendering/GridBaselineAlignment.cpp:
1902         * rendering/GridBaselineAlignment.h:
1903         * rendering/GridLayoutFunctions.cpp:
1904         * rendering/GridLayoutFunctions.h:
1905         * rendering/GridTrackSizingAlgorithm.h:
1906         * rendering/RenderDeprecatedFlexibleBox.cpp:
1907         * rendering/RenderFlexibleBox.cpp:
1908         * rendering/RenderIFrame.cpp:
1909         * rendering/RenderLayerFilters.cpp:
1910         * rendering/TextDecorationPainter.cpp:
1911         * rendering/TextDecorationPainter.h:
1912         * rendering/TextPainter.cpp:
1913         * rendering/TextPainter.h:
1914         * rendering/style/StyleRareNonInheritedData.cpp:
1915         * rendering/style/StyleRareNonInheritedData.h:
1916         * rendering/svg/SVGRenderSupport.h:
1917         * rendering/updating/RenderTreeBuilder.cpp:
1918         * rendering/updating/RenderTreeBuilderSVG.cpp:
1919         * style/InlineTextBoxStyle.cpp:
1920         * style/InlineTextBoxStyle.h:
1921         * style/StylePendingResources.cpp:
1922         * svg/SVGMatrix.h:
1923         * svg/SVGViewSpec.h:
1924         * svg/SVGZoomAndPan.h:
1925         * workers/WorkerScriptLoader.cpp:
1926         * workers/WorkerScriptLoader.h:
1927         * workers/service/ServiceWorker.cpp:
1928         * workers/service/ServiceWorkerClientData.cpp:
1929         * workers/service/ServiceWorkerClients.cpp:
1930         * workers/service/ServiceWorkerClients.h:
1931         * workers/service/ServiceWorkerGlobalScope.cpp:
1932         * workers/service/ServiceWorkerJob.cpp:
1933         * workers/service/ServiceWorkerProvider.cpp:
1934         * workers/service/context/ServiceWorkerFetch.cpp:
1935         * workers/service/context/ServiceWorkerInspectorProxy.h:
1936         * workers/service/context/ServiceWorkerThread.cpp:
1937         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1938         * workers/service/server/SWServerJobQueue.cpp:
1939         * workers/service/server/SWServerToContextConnection.cpp:
1940         * workers/service/server/SWServerWorker.cpp:
1941         * workers/service/server/SWServerWorker.h:
1942         * worklets/Worklet.h:
1943
1944 2019-04-10  Antoine Quint  <graouts@apple.com>
1945
1946         Enable Pointer Events on watchOS
1947         https://bugs.webkit.org/show_bug.cgi?id=196771
1948         <rdar://problem/49040909>
1949
1950         Reviewed by Dean Jackson.
1951
1952         * Configurations/FeatureDefines.xcconfig:
1953
1954 2019-04-10  Youenn Fablet  <youenn@apple.com>
1955
1956         Delay initialization of quota users until the first quota request
1957         https://bugs.webkit.org/show_bug.cgi?id=196467
1958
1959         Reviewed by Chris Dumez.
1960
1961         Instead of triggering initialization of each user when being added,
1962         delay initialization until the first call to requestSpace with a non zero task size.
1963         This will make sure we do not load Cache API information in memory or check for
1964         IDB space until actually necessary.
1965
1966         To implement that, move from a HashSet of being initialized users to a HashMap where the key is user and
1967         the value is the user initialization state.
1968
1969         When removing a user, delay the call to processPendingRequest so that a synchronous call to addUser
1970         can be taken into consideration.
1971
1972         This unflakes some Cache API tests as these tests do clear the Cache API and check for the clearing result.
1973         Clearing the caches triggers a removeUser/addUser dance which then triggers initialization of the Caches structure.
1974
1975         Covered by existing tests.
1976
1977         * storage/StorageQuotaManager.cpp:
1978         (WebCore::StorageQuotaManager::initializeUsersIfNeeded):
1979         (WebCore::StorageQuotaManager::askUserToInitialize):
1980         (WebCore::StorageQuotaManager::addUser):
1981         (WebCore::StorageQuotaManager::requestSpace):
1982         * storage/StorageQuotaManager.h:
1983
1984 2019-04-10  Philippe Normand  <pnormand@igalia.com>
1985
1986         there is no vp8 support in youtube.com/html5 page with libwebkit2gtk 2.24 (MSE enabled)
1987         https://bugs.webkit.org/show_bug.cgi?id=196615
1988
1989         Reviewed by Xabier Rodriguez-Calvar.
1990
1991         Add vp8.0 and vp9.0 in supported mime-types if the corresponding video decoders are found.
1992
1993         No new tests, existing web-platform-tests cover this change.
1994
1995         * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
1996         (WebCore::GStreamerRegistryScanner::initialize):
1997
1998 2019-04-10  Philippe Normand  <pnormand@igalia.com>
1999
2000         [GStreamer] Adaptive streaming playback broken with GStreamer < 1.12
2001         https://bugs.webkit.org/show_bug.cgi?id=196765
2002
2003         Reviewed by Xabier Rodriguez-Calvar.
2004
2005         Without the following patch in gst-plugins-bad, the uridownloader
2006         doesn't relay need-context messages to its parent, so in our case
2007         the player can't share its context with secondary webkitwebsrc
2008         elements and a RELEASE_ASSERT is hit in the WebProcess.
2009
2010         So the workaround is to use again webkit+ protocol prefixes for
2011         GStreamer versions older than 1.12.
2012
2013         https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/commit/8cf858fb27919e1d631223375f81b98055623733
2014
2015         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2016         (WebCore::convertToInternalProtocol):
2017         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
2018         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
2019         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2020         (WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const):
2021         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2022         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2023         (webKitWebSrcStart):
2024         (webKitWebSrcGetProtocols):
2025         (convertPlaybinURI):
2026         (webKitWebSrcSetUri):
2027         (CachedResourceStreamingClient::responseReceived):
2028         (webKitSrcWouldTaintOrigin):
2029         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
2030
2031 2019-04-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2032
2033         [ATK] Defer the emision of AtkObject::children-changed signal after layout is done
2034         https://bugs.webkit.org/show_bug.cgi?id=187948
2035
2036         Reviewed by Michael Catanzaro.
2037
2038         The signal AtkObject::children-changed is emitted from AXObjectCache::attachWrapper() and
2039         AXObjectCache::detachWrapper(). Both can be called in the middle of a layout, so we need to defer the emission
2040         of the signal after the layout is done, to avoid other atk entry points from being called at that point, since
2041         most of them update the backing store at the beginning.
2042
2043         Fixes: accessibility/children-changed-sends-notification.html
2044
2045         * accessibility/AXObjectCache.cpp:
2046         (WebCore::AXObjectCache::performDeferredCacheUpdate): Call platformPerformDeferredCacheUpdate().
2047         * accessibility/AXObjectCache.h:
2048         * accessibility/atk/AXObjectCacheAtk.cpp:
2049         (WebCore::wrapperParent): Helper to get the AtkObject parent of a given WebKitAccessible.
2050         (WebCore::AXObjectCache::detachWrapper): Add wrapper to m_deferredDetachedWrapperList.
2051         (WebCore::AXObjectCache::attachWrapper): Add object to m_deferredAttachedWrapperObjectList.
2052         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate): Emit AtkObject::children-changed::add for objects
2053         in m_deferredAttachedWrapperObjectList and AtkObject::children-changed::remove for wrappers in m_deferredDetachedWrapperList.
2054         * accessibility/ios/AXObjectCacheIOS.mm:
2055         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
2056         * accessibility/mac/AXObjectCacheMac.mm:
2057         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
2058         * accessibility/win/AXObjectCacheWin.cpp:
2059         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
2060         * accessibility/wpe/AXObjectCacheWPE.cpp:
2061         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
2062
2063 2019-04-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2064
2065         [ATK] Test accessibility/insert-children-assert.html is crashing since added in r216980
2066         https://bugs.webkit.org/show_bug.cgi?id=172281
2067         <rdar://problem/37030990>
2068
2069         Reviewed by Joanmarie Diggs.
2070
2071         The crash happens because at some point the test tries to get the anonymous block text, getting the RenderText as
2072         first child and RenderFullScreen as last child and the latter doesn't have a node. This is because in atk we do
2073         things differently, we don't include the static text elements individually, but parent element uses
2074         textUnderElement() to get all the pieces together. We can just turn the asserts into actual nullptr checks.
2075
2076         Fixes: accessibility/insert-children-assert.html
2077
2078         * accessibility/AccessibilityRenderObject.cpp:
2079         (WebCore::AccessibilityRenderObject::textUnderElement const):
2080
2081 2019-04-09  Keith Rollin  <krollin@apple.com>
2082
2083         Unreviewed build maintenance -- update .xcfilelists.
2084
2085         * DerivedSources-input.xcfilelist:
2086         * DerivedSources-output.xcfilelist:
2087
2088 2019-04-09  Zalan Bujtas  <zalan@apple.com>
2089
2090         [AutoSizing] Avoid making text paragraphs scroll horizontally when there is a wide table
2091         https://bugs.webkit.org/show_bug.cgi?id=196743
2092         <rdar://problem/43897551>
2093
2094         Reviewed by Tim Horton.
2095
2096         This patch changes the auto size behavior by using fixed constraint (instead of a min/max pair) to compute the content height.
2097         Now with the initial containing block width is firmly set to auto-sizing width, the overflow content will not stretch the ICB. Instead it overflows the ICB
2098         and triggers scrolling the same way the non-auto-sizing mode does.
2099
2100         * page/FrameView.cpp:
2101         (WebCore::FrameView::autoSizeIfEnabled):
2102         (WebCore::FrameView::enableAutoSizeMode):
2103         * page/FrameView.h:
2104         * testing/Internals.cpp:
2105         (WebCore::Internals::enableAutoSizeMode):
2106         * testing/Internals.h:
2107         * testing/Internals.idl:
2108
2109 2019-04-09  Youenn Fablet  <youenn@apple.com>
2110
2111         Close service worker database on network process suspension
2112         https://bugs.webkit.org/show_bug.cgi?id=196623
2113         <rdar://problem/48930869>
2114
2115         Reviewed by Alex Christensen.
2116
2117         Add suspend/resume support to SWServer.
2118         On suspend, close the service worker database and stop pushing for changes.
2119         On resume, push changes if needed.
2120
2121         * workers/service/server/RegistrationDatabase.cpp:
2122         (WebCore::RegistrationDatabase::close):
2123         * workers/service/server/RegistrationDatabase.h:
2124         (WebCore::RegistrationDatabase::isClosed const): Deleted.
2125         * workers/service/server/RegistrationStore.cpp:
2126         (WebCore::RegistrationStore::closeDatabase):
2127         * workers/service/server/RegistrationStore.cpp:
2128         (WebCore::RegistrationStore::pushChangesToDatabase):
2129         (WebCore::RegistrationStore::clearAll):
2130         (WebCore::RegistrationStore::startSuspension):
2131         (WebCore::RegistrationStore::endSuspension):
2132         * workers/service/server/RegistrationStore.h:
2133         * workers/service/server/SWServer.cpp:
2134         (WebCore::SWServer::startSuspension):
2135         (WebCore::SWServer::endSuspension):
2136         * workers/service/server/SWServer.h:
2137
2138 2019-04-09  Justin Fan  <justin_fan@apple.com>
2139
2140         [Web GPU] GPURenderPassEncoder updates: setBlendColor, setViewport, setScissorRect
2141         https://bugs.webkit.org/show_bug.cgi?id=196719
2142
2143         Reviewed by Myles C. Maxfield.
2144
2145         Implement setBlendColor, setViewport, and setScissorRect for GPURenderPassEncoder.
2146
2147         Tests: webgpu/viewport-scissor-rect-triangle-strip.html, webgpu/blend-color-triangle-strip.html
2148
2149         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
2150         (WebCore::WebGPURenderPassEncoder::setBlendColor):
2151         (WebCore::WebGPURenderPassEncoder::setViewport):
2152         (WebCore::WebGPURenderPassEncoder::setScissorRect):
2153         * Modules/webgpu/WebGPURenderPassEncoder.h:
2154         * Modules/webgpu/WebGPURenderPassEncoder.idl:
2155         * platform/graphics/gpu/GPURenderPassEncoder.h:
2156         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
2157         (WebCore::GPURenderPassEncoder::setBlendColor):
2158         (WebCore::GPURenderPassEncoder::setViewport):
2159         (WebCore::GPURenderPassEncoder::setScissorRect):
2160
2161 2019-04-09  Andy Estes  <aestes@apple.com>
2162
2163         [Apple Pay] Add release logging to PaymentCoordinator
2164         https://bugs.webkit.org/show_bug.cgi?id=196738
2165
2166         Reviewed by Alex Christensen.
2167
2168         When allowed, log interactions with PaymentCoordinator to os_log to help diagnose Apple Pay bugs.
2169
2170         The following information might be logged: names of functions called, merchant API versions,
2171         boolean results of canMakePayments(), boolean results of beginPaymentSession(), whether
2172         completePaymentSession() was called with a final state result, boolean results of
2173         shouldAllowApplePay(), whether a document has evaluated user agent scripts or is running
2174         user scripts, and whether a client supports unrestricted Apple Pay.
2175
2176         * Modules/applepay/PaymentCoordinator.cpp:
2177         (WebCore::PaymentCoordinator::supportsVersion const):
2178         (WebCore::PaymentCoordinator::canMakePayments):
2179         (WebCore::PaymentCoordinator::canMakePaymentsWithActiveCard):
2180         (WebCore::PaymentCoordinator::openPaymentSetup):
2181         (WebCore::PaymentCoordinator::beginPaymentSession):
2182         (WebCore::PaymentCoordinator::completeMerchantValidation):
2183         (WebCore::PaymentCoordinator::completeShippingMethodSelection):
2184         (WebCore::PaymentCoordinator::completeShippingContactSelection):
2185         (WebCore::PaymentCoordinator::completePaymentMethodSelection):
2186         (WebCore::PaymentCoordinator::completePaymentSession):
2187         (WebCore::PaymentCoordinator::abortPaymentSession):
2188         (WebCore::PaymentCoordinator::cancelPaymentSession):
2189         (WebCore::PaymentCoordinator::validateMerchant):
2190         (WebCore::PaymentCoordinator::didAuthorizePayment):
2191         (WebCore::PaymentCoordinator::didSelectPaymentMethod):
2192         (WebCore::PaymentCoordinator::didSelectShippingMethod):
2193         (WebCore::PaymentCoordinator::didSelectShippingContact):
2194         (WebCore::PaymentCoordinator::didCancelPaymentSession):
2195         (WebCore::PaymentCoordinator::shouldAllowApplePay const):
2196         (WebCore::PaymentCoordinator::shouldAllowUserAgentScripts const):
2197         * Modules/applepay/PaymentCoordinatorClient.h:
2198         (WebCore::PaymentCoordinatorClient::isAlwaysOnLoggingAllowed const):
2199         * platform/Logging.h:
2200         * testing/MockPaymentCoordinator.h:
2201
2202 2019-04-09  John Wilander  <wilander@apple.com>
2203
2204         Pick up Ad Click Attribution conversions in NetworkResourceLoader::willSendRedirectedRequest()
2205         https://bugs.webkit.org/show_bug.cgi?id=196558
2206         <rdar://problem/47650245>
2207
2208         Reviewed by Youenn Fablet.
2209
2210         Tests: http/tests/adClickAttribution/attribution-conversion-through-cross-site-image-redirect.html
2211                http/tests/adClickAttribution/attribution-conversion-through-image-redirect-with-priority.html
2212                http/tests/adClickAttribution/attribution-conversion-through-image-redirect-without-priority.html
2213
2214         The existing API tests were expanded too.
2215
2216         * html/HTMLAnchorElement.cpp:
2217         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
2218            Enhanced the use of AdClickAttribution::MaxEntropy.
2219         * loader/AdClickAttribution.cpp:
2220         (WebCore::AdClickAttribution::parseConversionRequest):
2221             New function to parse and validate URLs with a path starting with
2222             /.well-known/ad-click-attribution/.
2223         (WebCore::AdClickAttribution::toString const):
2224             Added output for the conversion priority for testing purposes.
2225         * loader/AdClickAttribution.h:
2226         (WebCore::AdClickAttribution::Campaign::isValid const):
2227         (WebCore::AdClickAttribution::Conversion::isValid const):
2228            Enhanced the use of AdClickAttribution::MaxEntropy.
2229
2230 2019-04-09  Don Olmstead  <don.olmstead@sony.com>
2231
2232         [CMake] Apple builds should use ICU_INCLUDE_DIRS
2233         https://bugs.webkit.org/show_bug.cgi?id=196720
2234
2235         Reviewed by Konstantin Tokarev.
2236
2237         * PlatformMac.cmake:
2238
2239 2019-04-09  Jer Noble  <jer.noble@apple.com>
2240
2241         Test for: 196095 Inband Text Track cues interspersed with Data cues can display out of order.
2242         https://bugs.webkit.org/show_bug.cgi?id=196097
2243
2244         Reviewed by Eric Carlson.
2245
2246         Test: media/track/track-in-band-metadata-display-order.html
2247
2248         Add a method in Internals to create a TextTrackCueGeneric (which can normally only be created
2249         by parsing an in-band media track). This requires adding IDL for TextTrackCueGeneric, and exporting
2250         TextTrackCueGeneric for testing.
2251
2252         Drive-by fixes:
2253
2254         Add runtime logging to MediaControlTextTrackContainerElement. This necessitates modifying the
2255         parentMediaElement() method to take a const Node*, and const_cast that constness away in order to return
2256         a HTMLMediaElement*
2257
2258         TextTrackCue, VTTCue, TextTrackCueGeneric, and DataCue should all use the WTF TypeCasts macros to
2259         enable use of is<> and downcast<>.
2260
2261         * Source/WebCore/CMakeLists.txt:
2262         * DerivedSources-input.xcfilelist:
2263         * DerivedSources-output.xcfilelist:
2264         * DerivedSources.make:
2265         * WebCore.xcodeproj/project.pbxproj:
2266         * Sources.txt:
2267         * html/shadow/MediaControlElementTypes.cpp:
2268         (WebCore::parentMediaElement):
2269         * html/shadow/MediaControlElementTypes.h:
2270         * html/shadow/MediaControlElements.cpp:
2271         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
2272         (WebCore::MediaControlTextTrackContainerElement::logger const):
2273         (WebCore::MediaControlTextTrackContainerElement::logIdentifier const):
2274         (WebCore::MediaControlTextTrackContainerElement::logChannel const):
2275         * html/shadow/MediaControlElements.h:
2276         * html/track/DataCue.h:
2277         (isType):
2278         * html/track/TextTrackCueGeneric.h:
2279         (isType):
2280         * html/track/TextTrackCueGeneric.idl: Added.
2281         * html/track/VTTCue.h:
2282         (isType):
2283         * testing/Internals.cpp:
2284         (WebCore::Internals::createGenericCue):
2285         * testing/Internals.h:
2286         * testing/Internals.idl:
2287
2288 2019-04-09  Sihui Liu  <sihui_liu@apple.com>
2289
2290         Remove unnecessary network process assertion for IDB close
2291         https://bugs.webkit.org/show_bug.cgi?id=196693
2292
2293         Reviewed by Geoffrey Garen.
2294
2295         We already took assertion at WebCore::SQLiteDatabase::close.
2296
2297         * Modules/indexeddb/server/IDBServer.cpp:
2298         (WebCore::IDBServer::IDBServer::create):
2299         (WebCore::IDBServer::IDBServer::IDBServer):
2300         (WebCore::IDBServer::m_quotaManagerGetter): Deleted.
2301         (WebCore::IDBServer::IDBServer::closeDatabase): Deleted.
2302         (WebCore::IDBServer::IDBServer::didCloseDatabase): Deleted.
2303         * Modules/indexeddb/server/IDBServer.h:
2304         (WebCore::IDBServer::IDBServer::create): Deleted.
2305         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2306         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
2307         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
2308         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
2309         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
2310         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
2311         (WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose): Deleted.
2312         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2313
2314 2019-04-09  Eike Rathke  <erack@redhat.com>
2315
2316         Initialize trackTypeAsString for call to GST_INFO_OBJECT() in TrackType::Text
2317         https://bugs.webkit.org/show_bug.cgi?id=196350
2318
2319         Reviewed by Xabier Rodriguez-Calvar.
2320
2321         trackTypeAsString was uninitialized in the
2322         TrackPrivateBaseGStreamer::TrackType::Text case when calling
2323         GST_INFO_OBJECT().
2324
2325         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2326         (WebCore::MediaPlayerPrivateGStreamer::enableTrack):
2327
2328 2019-04-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2329
2330         [ATK] Cleanup WebKitAccessibleHyperlink
2331         https://bugs.webkit.org/show_bug.cgi?id=196602
2332
2333         Reviewed by Michael Catanzaro.
2334
2335         Cleanups:
2336
2337          - Rename webkitAccessibleHyperlinkNew() as webkitAccessibleHyperlinkGetOrCreate() and move the code to get/set
2338            the object data here.
2339          - Use WEBKIT_DEFINE_TYPE instead of custom type registration. This ensures that all CStrings used in private
2340            struct are no longer leaked.
2341          - Remove all confusing core() functions and simply use webkitAccessibleGetAccessibilityObject().
2342          - Use nullptr instead of 0 and other coding style issues.
2343
2344         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
2345         (webkitAccessibleHyperlinkActionDoAction):
2346         (webkitAccessibleHyperlinkActionGetNActions):
2347         (webkitAccessibleHyperlinkActionGetDescription):
2348         (webkitAccessibleHyperlinkActionGetKeybinding):
2349         (webkitAccessibleHyperlinkActionGetName):
2350         (atk_action_interface_init):
2351         (webkitAccessibleHyperlinkGetURI):
2352         (webkitAccessibleHyperlinkGetObject):
2353         (rangeLengthForObject):
2354         (webkitAccessibleHyperlinkGetStartIndex):
2355         (webkitAccessibleHyperlinkGetEndIndex):
2356         (webkitAccessibleHyperlinkIsValid):
2357         (webkitAccessibleHyperlinkGetNAnchors):
2358         (webkitAccessibleHyperlinkIsSelectedLink):
2359         (webkitAccessibleHyperlinkGetProperty):
2360         (webkitAccessibleHyperlinkSetProperty):
2361         (webkit_accessible_hyperlink_class_init):
2362         (webkitAccessibleHyperlinkGetOrCreate):
2363         (core): Deleted.
2364         (atkActionInterfaceInit): Deleted.
2365         (getRangeLengthForObject): Deleted.
2366         (webkitAccessibleHyperlinkFinalize): Deleted.
2367         (webkitAccessibleHyperlinkClassInit): Deleted.
2368         (webkitAccessibleHyperlinkInit): Deleted.
2369         (webkitAccessibleHyperlinkGetType): Deleted.
2370         (webkitAccessibleHyperlinkNew): Deleted.
2371         (webkitAccessibleHyperlinkGetAccessibilityObject): Deleted.
2372         * accessibility/atk/WebKitAccessibleHyperlink.h:
2373         * accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp:
2374         (webkitAccessibleHyperlinkImplGetHyperlink):
2375         (webkitAccessibleHyperlinkImplInterfaceInit):
2376
2377 2019-04-08  Simon Fraser  <simon.fraser@apple.com>
2378
2379         Remove some iOS #ifdefs around sticky-related code
2380         https://bugs.webkit.org/show_bug.cgi?id=196726
2381
2382         Reviewed by Zalan Bujtas.
2383
2384         Now that async overflow scrolling can be enabled on macOS, RenderLayerCompositor::isAsyncScrollableStickyLayer()
2385         should not have iOS-only code.
2386
2387         The answer to the FIXME in RenderLayerCompositor::computeStickyViewportConstraints is obvious: composited
2388         overflow:scroll can be the container for sticky. The assertion can be removed.
2389
2390         * rendering/RenderLayer.cpp: Fix spacing in some logging.
2391         (WebCore::outputPaintOrderTreeRecursive):
2392         * rendering/RenderLayerCompositor.cpp:
2393         (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const):
2394         (WebCore::RenderLayerCompositor::computeStickyViewportConstraints const):
2395
2396 2019-04-08  Don Olmstead  <don.olmstead@sony.com>
2397
2398         [CMake][WinCairo] Separate copied headers into different directories
2399         https://bugs.webkit.org/show_bug.cgi?id=196655
2400
2401         Reviewed by Michael Catanzaro.
2402
2403         * CMakeLists.txt:
2404         * PlatformWin.cmake:
2405
2406 2019-04-08  Chris Fleizach  <cfleizach@apple.com>
2407
2408         AX: Automatically compute accessibility labels for Apple Pay buttons
2409         https://bugs.webkit.org/show_bug.cgi?id=196661
2410
2411         Reviewed by Joanmarie Diggs.
2412
2413         Detect Apple Pay buttons and return a standard role and label for them based on their type.
2414
2415         Test: accessibility/mac/apple-pay-labels.html
2416               accessibility/mac/apple-pay-session-v4.html
2417
2418         * accessibility/AccessibilityNodeObject.cpp:
2419         (WebCore::AccessibilityNodeObject::isControl const):
2420         * accessibility/AccessibilityNodeObject.h:
2421         * accessibility/AccessibilityRenderObject.cpp:
2422         (WebCore::AccessibilityRenderObject::applePayButtonDescription const):
2423         (WebCore::AccessibilityRenderObject::titleElementText const):
2424         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2425         (WebCore::AccessibilityRenderObject::isApplePayButton const):
2426         (WebCore::AccessibilityRenderObject::applePayButtonType const):
2427         * accessibility/AccessibilityRenderObject.h:
2428         * en.lproj/Localizable.strings:
2429         * platform/LocalizedStrings.cpp:
2430         (WebCore::AXApplePayPlainLabel):
2431         (WebCore::AXApplePayBuyLabel):
2432         (WebCore::AXApplePaySetupLabel):
2433         (WebCore::AXApplePayDonateLabel):
2434         (WebCore::AXApplePayCheckOutLabel):
2435         (WebCore::AXApplePayBookLabel):
2436         (WebCore::AXApplePaySubscribeLabel):
2437         * platform/LocalizedStrings.h:
2438
2439 2019-04-08  Chris Fleizach  <cfleizach@apple.com>
2440
2441         AX: Support API: accessibilityReplaceRange:withText
2442         https://bugs.webkit.org/show_bug.cgi?id=196636
2443
2444         Reviewed by Daniel Bates.
2445
2446         Support this platform API on mac to provide a way to replace a range of editable text.
2447
2448         Test: accessibility/mac/replace-text-with-range.html
2449
2450         * accessibility/AccessibilityObject.cpp:
2451         (WebCore::AccessibilityObject::replaceTextInRange):
2452         * accessibility/AccessibilityObject.h:
2453         * accessibility/mac/AccessibilityObjectBase.mm:
2454         (WebCore::PlainTextRange::PlainTextRange):
2455         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2456         (-[WebAccessibilityObjectWrapper accessibilityReplaceRange:withText:]):
2457
2458 2019-04-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2459
2460         [iOS] Do not allow starting selection drags when selection views are not visible
2461         https://bugs.webkit.org/show_bug.cgi?id=196686
2462         <rdar://problem/49399192>
2463
2464         Reviewed by Tim Horton.
2465
2466         See WebKit ChangeLog for more details.
2467
2468         Tests:  DragAndDropTests.CanDragImageWhenNotFirstResponder
2469                 DragAndDropTests.DoNotPerformSelectionDragWhenNotFirstResponder
2470
2471         * page/DragController.cpp:
2472         (WebCore::DragController::draggableElement const):
2473
2474         Make this respect the case where m_dragSourceAction does not include DragSourceActionSelection. All the other
2475         drag source types are currently consulted in this method, with the exception of DragSourceActionSelection.
2476
2477 2019-04-08  Youenn Fablet  <youenn@apple.com>
2478
2479         Add a test to check for the service worker process name
2480         https://bugs.webkit.org/show_bug.cgi?id=196621
2481
2482         Reviewed by Chris Dumez.
2483
2484         Add a service worker internal API to get process name.
2485         Covered by updated test.
2486
2487         * WebCore.xcodeproj/project.pbxproj:
2488         * testing/ServiceWorkerInternals.cpp:
2489         (WebCore::ServiceWorkerInternals::processName const):
2490         * testing/ServiceWorkerInternals.h:
2491         * testing/ServiceWorkerInternals.idl:
2492         * testing/ServiceWorkerInternals.mm: Added.
2493
2494 2019-04-08  Yusuke Suzuki  <ysuzuki@apple.com>
2495
2496         Unreviewed, speculative fix for build failure in old macOS after r243887
2497         https://bugs.webkit.org/show_bug.cgi?id=196475
2498
2499         * dom/NodeList.h:
2500
2501 2019-04-08  Justin Fan  <justin_fan@apple.com>
2502
2503         [Web GPU] Fix Web GPU experimental feature on iOS
2504         https://bugs.webkit.org/show_bug.cgi?id=196632
2505
2506         Reviewed by Myles C. Maxfield.
2507
2508         Add feature conditionals for iOS 11.
2509         Properly make Web GPU available on iOS 11+.
2510
2511         * Configurations/FeatureDefines.xcconfig:
2512         * Configurations/WebKitTargetConditionals.xcconfig:
2513
2514 2019-04-08  Timothy Hatcher  <timothy@apple.com>
2515
2516         Unreviewed build fix for iOSMac after r243893.
2517         https://bugs.webkit.org/show_bug.cgi?id=196707
2518
2519         * dom/Element.cpp:
2520         (WebCore::parentCrossingFrameBoundaries): Remove ENABLE(POINTER_EVENTS) since computedTouchActions()
2521         no longer uses parentCrossingFrameBoundaries().
2522
2523 2019-04-08  Youenn Fablet  <youenn@apple.com>
2524
2525         Lazily construct Navigator serviceWorker
2526         https://bugs.webkit.org/show_bug.cgi?id=196692
2527
2528         Reviewed by Chris Dumez.
2529
2530         Make NavigatorBase a ContextDestructionObserver.
2531         This allows to get the navigator script execution context.
2532         Use it when creating the navigator ServiceWorkerContainer object.
2533         For GC, introduce serviceWorkerIfAny which returns the container if created.
2534         No JS observable change of behavior.
2535         Covered by existing tests.
2536
2537         * bindings/js/JSNavigatorCustom.cpp:
2538         (WebCore::JSNavigator::visitAdditionalChildren):
2539         * bindings/js/JSWorkerNavigatorCustom.cpp:
2540         (WebCore::JSWorkerNavigator::visitAdditionalChildren):
2541         * page/NavigatorBase.cpp:
2542         (WebCore::NavigatorBase::NavigatorBase):
2543         (WebCore::NavigatorBase::serviceWorkerIfAny):
2544         (WebCore::NavigatorBase::serviceWorker):
2545         * page/NavigatorBase.h:
2546
2547 2019-04-08  Antti Koivisto  <antti@apple.com>
2548
2549         Update touch-action region on property changes
2550         https://bugs.webkit.org/show_bug.cgi?id=196608
2551
2552         Reviewed by Simon Fraser.
2553
2554         Test: pointerevents/ios/touch-action-region-dynamic.html
2555
2556         * rendering/EventRegion.cpp:
2557         (WebCore::EventRegion::touchActionsForPoint const):
2558
2559         Correctly return 'auto' when nothing is found from the regions (this code is not used yet).
2560
2561         * rendering/RenderElement.cpp:
2562         (WebCore::RenderElement::styleWillChange):
2563
2564         React to 'touch-action' property changes, similarly to 'pointer-events'.
2565
2566         * rendering/RenderLayer.cpp:
2567         (WebCore::RenderLayer::invalidateEventRegion):
2568
2569         Test if need to invalidate.
2570
2571         * rendering/RenderLayerBacking.cpp:
2572         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
2573         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
2574
2575         Call invalidateEventRegion explicitly instead of relying on compositing update. This ensures
2576         that we update the top level event region correctly when we have touch-actions.
2577
2578 2019-04-08  Javier Fernandez  <jfernandez@igalia.com>
2579
2580         Implement white-space:break-spaces value
2581         https://bugs.webkit.org/show_bug.cgi?id=177327
2582
2583         Reviewed by Myles Maxfield and Zalan Bujtas.
2584
2585         Finally the CSS WG decided [1] to move back the 'break-spaces' value to
2586         the 'white-space' property. This makes the parsing logic easier than
2587         the previous approach of using the 'overflow-wrap' property.
2588
2589         This new value prevents the white-space sequence to collapse and gives
2590         breaking opportunities after every preserved white-space.
2591
2592         https://drafts.csswg.org/css-text-3/#valdef-white-space-break-spaces
2593
2594         Additionally, unlike 'pre-wrap', non-collapsible spaces or tabs at the
2595         end of a line cannot be hung or visually collapsed, since we want them
2596         to be preserved and broken.
2597
2598         [1] https://github.com/w3c/csswg-drafts/pull/2841
2599
2600         Tests: imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-008.html
2601                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-003.html
2602                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-009.html
2603
2604         * css/CSSPrimitiveValueMappings.h:
2605         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): New mapping for CSSVaueBreakSpaces.
2606         (WebCore::CSSPrimitiveValue::operator WhiteSpace const): New value BreakSpaces for the Whitespace enum.
2607         * css/CSSProperties.json: new 'break-spaces' value for the 'white-space' property.
2608         * css/CSSValueKeywords.in: new break-spaces keyword
2609         * css/parser/CSSParserFastPaths.cpp:
2610         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2611         * rendering/SimpleLineLayout.cpp:  The SimpleLineLayut codepath must handle properly the new behavior of preserved whitespaces.
2612         (WebCore::SimpleLineLayout::LineState::hasTrailingWhitespace const): Require that m_trailingWhitespaceWidth being greater than zero.
2613         (WebCore::SimpleLineLayout::LineState::hasWhitespaceFragments const): New function to detect former whitespae fragments that could be breaking opportunities.
2614         (WebCore::SimpleLineLayout::removeTrailingWhitespace): The 'break-spaces' feature forbids to remove any trailing whitespace.
2615         (WebCore::SimpleLineLayout::firstFragment): We have now leading whitespace sequences comming from the previous line.
2616         (WebCore::SimpleLineLayout::createLineRuns): We should revert some breaking opportunities if others were formerly found in the line.
2617         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2618         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style): New style fields to determine whether the break-space feature is being used. Also split out the break-all and breal-all values.
2619         * rendering/SimpleLineLayoutTextFragmentIterator.h:
2620         * rendering/line/BreakingContext.h: Different codepath but similar changes to properly handle the new behavior of preserved whitespace.
2621         (WebCore::BreakingContext::BreakingContext): New class field to determine whether there are some whitespace that may prevent the word ot be broken.
2622         (WebCore::BreakingContext::handleText): New line-breaking logic to implement the break-spaces behavior.
2623         (WebCore::BreakingContext::trailingSpacesHang): Cases where the preserved breakspaces should hand or overflow.
2624         * rendering/style/RenderStyle.h:
2625         (WebCore::RenderStyle::collapseWhiteSpace): With break-spaces collapsing whitespaces is not allowed.
2626         (WebCore::RenderStyle::breakOnlyAfterWhiteSpace const): Add the WhiteSpace::BreakSpaces to this group.
2627         * rendering/style/RenderStyleConstants.h: A new constan added.
2628
2629 2019-04-08  Youenn Fablet  <youenn@apple.com>
2630
2631         LibWebRTCMediaEndpoint does not need to hop to the signaling thread to gather stats
2632         https://bugs.webkit.org/show_bug.cgi?id=196697
2633         <rdar://problem/47477113>
2634
2635         Reviewed by Eric Carlson.
2636
2637         It is not thread safe to use m_backend in another thread than the main thread.
2638         It is not useful anymore to hop to the signaling thread to gather stats.
2639         No change of behavior.
2640
2641         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2642         (WebCore::LibWebRTCMediaEndpoint::getStats):
2643         (WebCore::LibWebRTCMediaEndpoint::gatherStatsForLogging):
2644
2645 2019-04-08  Antoine Quint  <graouts@apple.com>
2646
2647         [ Mac WK2 iOS Debug ] REGRESSION(r233667) Layout Test imported/w3c/web-platform-tests/web-animations/interfaces/DocumentTimeline/constructor.html is a flaky failure
2648         https://bugs.webkit.org/show_bug.cgi?id=195233
2649         <rdar://problem/48527231>
2650
2651         Reviewed by Dean Jackson.
2652
2653         We need to create the "main" document timeline (document.timeline) if it doesn't already exist and use its current time as a basis for any other DocumentTimeline instance.
2654
2655         * animation/DocumentTimeline.cpp:
2656         (WebCore::DocumentTimeline::currentTime):
2657
2658 2019-04-08  Antoine Quint  <graouts@apple.com>
2659
2660         [Web Animations] JS wrapper may be deleted while animation is yet to dispatch its finish event
2661         https://bugs.webkit.org/show_bug.cgi?id=196118
2662         <rdar://problem/46614137>
2663
2664         Reviewed by Chris Dumez.
2665
2666         Test: webanimations/js-wrapper-kept-alive.html
2667
2668         We need to teach WebAnimation to keep its JS wrapper alive if it's relevant or could become relevant again by virtue of having a timeline.
2669         We also need to ensure that the new implementation of hasPendingActivity() does not interfere with the ability of pages to enter the page
2670         cache when running animations.
2671
2672         * animation/WebAnimation.cpp:
2673         (WebCore::WebAnimation::canSuspendForDocumentSuspension const):
2674         (WebCore::WebAnimation::stop):
2675         (WebCore::WebAnimation::hasPendingActivity const):
2676         * animation/WebAnimation.h:
2677
2678 2019-04-08  Eric Liang  <ericliang@apple.com>
2679
2680         AX: <svg> elements with labels and no accessible contents are exposed as empty AXGroups
2681         https://bugs.webkit.org/show_bug.cgi?id=156774
2682
2683         Reviewed by Chris Fleizach.
2684
2685         Labelled SVGs without accessible descendants are exposed as AXImage rather than groups.
2686
2687         Unlabelled equivalents are not exposed. Otherwise, SVGs with accessible descendants are exposed as AXGroup. 
2688         Also added back functionalities from last patch of determining whether a SVG element should be ignored.
2689         
2690         Test: accessibility/svg-shape-labelled.html
2691
2692         * accessibility/AccessibilityRenderObject.cpp:
2693         (WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation):
2694         * accessibility/AccessibilitySVGElement.cpp:
2695         (WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored const):
2696
2697 2019-04-08  Youenn Fablet  <youenn@apple.com>
2698
2699         Make sure UniqueIDBDatabaseConnection unregisters itself even if its database is gone
2700         https://bugs.webkit.org/show_bug.cgi?id=196651
2701
2702         Reviewed by Brady Eidson.
2703
2704         In UniqueIDBDatabase methods, many operations are refing the transaction
2705         so that it stays alive until a quota check decision is made.
2706         This extends the lifetime of the transaction which may be lasting
2707         longer than its database that may be cleared without waiting for the quota check decisions.
2708
2709         We therefore need to make sure that the transaction is cleaning itself correctly at destruction time.
2710
2711         Make sure that the transaction is unregistering itself from its IDBServer.
2712         To do so, the transaction keeps a weak ref to the IDBServer.
2713
2714         This is timing sensitive hence difficult to test.
2715
2716         * Modules/indexeddb/server/IDBServer.h:
2717         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
2718         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
2719         Like done below for UniqueIDBDatabaseConnection::didCommitTransaction,
2720         add a check to ensure that either the database is we are in an error case.
2721         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
2722         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
2723         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::~UniqueIDBDatabaseTransaction):
2724         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
2725
2726 2019-04-08  Christopher Reid  <chris.reid@sony.com>
2727
2728         Undefined Behavior: m_experimentalImageMenuEnabled isn't initialized in HTMLImageElement when SERVICE_CONTROLS is disabled
2729         https://bugs.webkit.org/show_bug.cgi?id=196664
2730
2731         Reviewed by Ross Kirsling.
2732
2733         No observable change in behavior.
2734
2735         Initialize m_experimentalImageMenuEnabled regardless of ENABLE(SERVICE_CONTROLS)
2736
2737         * html/HTMLImageElement.cpp:
2738
2739 2019-04-08  Ryan Haddad  <ryanhaddad@apple.com>
2740
2741         Unreviewed, rolling out r243943.
2742
2743         Caused test262 failures.
2744
2745         Reverted changeset:
2746
2747         "[JSC] Filter DontEnum properties in
2748         ProxyObject::getOwnPropertyNames()"
2749         https://bugs.webkit.org/show_bug.cgi?id=176810
2750         https://trac.webkit.org/changeset/243943
2751
2752 2019-04-05  Sergio Villar Senin  <svillar@igalia.com>
2753
2754         [GTK][WPE] outlook.live.com displays old-fashioned UI
2755         https://bugs.webkit.org/show_bug.cgi?id=196642
2756
2757         Reviewed by Carlos Garcia Campos.
2758
2759         The new good looking UI is shown as long as pretend we're a Mac in the UA.
2760
2761         * platform/UserAgentQuirks.cpp:
2762         (WebCore::urlRequiresChromeBrowser):
2763
2764 2019-04-08  Carlos Garcia Campos  <cgarcia@igalia.com>
2765
2766         [ATK] Cleanup accessible wrapper base class
2767         https://bugs.webkit.org/show_bug.cgi?id=196601
2768
2769         Reviewed by Mario Sanchez Prada.
2770
2771         Cleanups:
2772
2773          - Rename WebKitAccessibleWrapperAtk cpp and header as WebKitAccessible for consistency with the class name.
2774          - Use WEBKIT_DEFINE_TYPE instead of custom type registration. This ensures that all CStrings used in private
2775            struct are no longer leaked.
2776          - Move core object pointer to the private struct.
2777          - Remove confusing core() function and simply get the core object from the private struct.
2778          - Use nullptr instead of 0 and other coding style issues.
2779          - Rename cacheAndReturnAtkProperty as webkitAccessibleCacheAndReturnAtkProperty and use WebKitAccessible as
2780            instance parameter.
2781          - Make webkitAccessibleGetAccessibilityObject() return a reference, since we use a fallback object on detach it
2782            never returns nullptr.
2783          - Move objectFocusedAndCaretOffsetUnignored() to WebKitAccessibleUtil.
2784
2785         * SourcesGTK.txt:
2786         * accessibility/atk/AXObjectCacheAtk.cpp:
2787         * accessibility/atk/WebKitAccessible.cpp: Renamed from Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp.
2788         (webkitAccessibleGetName):
2789         (webkitAccessibleGetDescription):
2790         (setAtkRelationSetFromCoreObject):
2791         (isRootObject):
2792         (webkitAccessibleGetParent):
2793         (webkitAccessibleGetNChildren):
2794         (webkitAccessibleRefChild):
2795         (webkitAccessibleGetIndexInParent):
2796         (webkitAccessibleGetAttributes):
2797         (atkRole):
2798         (webkitAccessibleGetRole):
2799         (webkitAccessibleRefStateSet):
2800         (webkitAccessibleRefRelationSet):
2801         (webkitAccessibleInit):
2802         (webkitAccessibleGetObjectLocale):
2803         (webkit_accessible_class_init):
2804         (interfaceMaskFromObject):
2805         (uniqueAccessibilityTypeName):
2806         (accessibilityTypeFromObject):
2807         (webkitAccessibleNew):
2808         (webkitAccessibleGetAccessibilityObject):
2809         (webkitAccessibleDetach):
2810         (webkitAccessibleIsDetached):
2811         (webkitAccessibleCacheAndReturnAtkProperty):
2812         * accessibility/atk/WebKitAccessible.h: Renamed from Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.h.
2813         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
2814         (core):
2815         * accessibility/atk/WebKitAccessibleInterfaceAction.cpp:
2816         (core):
2817         (webkitAccessibleActionGetKeybinding):
2818         (webkitAccessibleActionGetName):
2819         * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
2820         (core):
2821         * accessibility/atk/WebKitAccessibleInterfaceDocument.cpp:
2822         (core):
2823         (documentAttributeValue):
2824         * accessibility/atk/WebKitAccessibleInterfaceEditableText.cpp:
2825         (core):
2826         * accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp:
2827         (core):
2828         * accessibility/atk/WebKitAccessibleInterfaceImage.cpp:
2829         (core):
2830         (webkitAccessibleImageGetImageDescription):
2831         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
2832         (core):
2833         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
2834         (core):
2835         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
2836         (core):
2837         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2838         (core):
2839         * accessibility/atk/WebKitAccessibleInterfaceValue.cpp:
2840         (core):
2841         * accessibility/atk/WebKitAccessibleUtil.cpp:
2842         (objectFocusedAndCaretOffsetUnignored):
2843         * accessibility/atk/WebKitAccessibleUtil.h:
2844         * editing/atk/FrameSelectionAtk.cpp:
2845
2846 2019-04-06  Antti Koivisto  <antti@apple.com>
2847
2848         Combine event and touch action regions into a single class
2849         https://bugs.webkit.org/show_bug.cgi?id=196644
2850         <rdar://problem/49643614>
2851
2852         Reviewed by Darin Adler.
2853
2854         This patch replaces the existing TouchActionRegion class with the more general EventRegion class.
2855         It collects both the overall event region and the touch action regions. This avoids duplication
2856         and simplifies the code.
2857
2858         The patch also adds serialization support for EventRegion, so touch-action regions gets passed
2859         to the UI process too.
2860
2861         * Sources.txt:
2862         * WebCore.xcodeproj/project.pbxproj:
2863         * platform/graphics/GraphicsLayer.cpp:
2864         (WebCore::GraphicsLayer::setEventRegion):
2865         (WebCore::GraphicsLayer::dumpProperties const):
2866         (WebCore::GraphicsLayer::setTouchActionRegion): Deleted.
2867         * platform/graphics/GraphicsLayer.h:
2868         (WebCore::GraphicsLayer::eventRegion const):
2869         (WebCore::GraphicsLayer::touchActionRegion const): Deleted.
2870         * platform/graphics/Region.cpp:
2871         (WebCore::operator<<):
2872         * platform/graphics/ca/GraphicsLayerCA.cpp:
2873         (WebCore::GraphicsLayerCA::setEventRegion):
2874         (WebCore::GraphicsLayerCA::setTouchActionRegion): Deleted.
2875         * platform/graphics/ca/GraphicsLayerCA.h:
2876         * platform/graphics/ca/PlatformCALayer.h:
2877         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2878         * rendering/EventRegion.cpp: Copied from Source/WebCore/rendering/TouchActionRegion.cpp.
2879         (WebCore::EventRegion::operator== const):
2880         (WebCore::EventRegion::unite):
2881         (WebCore::EventRegion::translate):
2882         (WebCore::EventRegion::uniteTouchActions):
2883         (WebCore::EventRegion::touchActionsForPoint const):
2884         (WebCore::operator<<):
2885         (WebCore::TouchActionRegion::unite): Deleted.
2886         (WebCore::TouchActionRegion::actionsForPoint const): Deleted.
2887         (WebCore::TouchActionRegion::translate): Deleted.
2888         * rendering/EventRegion.h: Copied from Source/WebCore/rendering/TouchActionRegion.h.
2889         (WebCore::EventRegion::isEmpty const):
2890         (WebCore::EventRegion::contains const):
2891         (WebCore::EventRegion::hasTouchActions const):
2892         (WebCore::EventRegion::encode const):
2893         (WebCore::EventRegion::decode):
2894         (WebCore::TouchActionRegion::isEmpty const): Deleted.
2895         (WebCore::TouchActionRegion::operator== const): Deleted.
2896         * rendering/InlineTextBox.cpp:
2897         (WebCore::InlineTextBox::paint):
2898         * rendering/PaintInfo.h:
2899         * rendering/RenderBlock.cpp:
2900         (WebCore::RenderBlock::paintObject):
2901         * rendering/RenderLayer.cpp:
2902         (WebCore::RenderLayer::collectEventRegionForFragments):
2903         * rendering/RenderLayer.h:
2904         * rendering/RenderLayerBacking.cpp:
2905         (WebCore::RenderLayerBacking::updateEventRegion):
2906         * rendering/RenderLayerModelObject.cpp:
2907         * rendering/SimpleLineLayoutFunctions.cpp:
2908         (WebCore::SimpleLineLayout::paintFlow):
2909         * rendering/TouchActionRegion.cpp: Removed.
2910         * rendering/TouchActionRegion.h: Removed.
2911
2912 2019-04-05  Yongjun Zhang  <yongjun_zhang@apple.com>
2913
2914         We should pass minimumEffectiveDeviceWidth to web process on new page creation.
2915         https://bugs.webkit.org/show_bug.cgi?id=196077
2916         <rdar://problem/49108202>
2917
2918         Reviewed by Chris Dumez.
2919
2920         If the page doesn't specify it requires to use the device width in viewport tag, we should try to scale down
2921         the page to fit the window width.
2922
2923         Test: fast/viewport/ios/shrink-to-fit-for-page-without-viewport-meta.html
2924
2925         * page/ViewportConfiguration.cpp:
2926         (WebCore::ViewportConfiguration::updateDefaultConfiguration): Also update the minimum layout size
2927             when the default configuration is changed.
2928         (WebCore::ViewportConfiguration::nativeWebpageParametersWithShrinkToFit): Make sure we fit the content
2929             to window width.
2930
2931 2019-04-05  Jer Noble  <jer.noble@apple.com>
2932
2933         [Cocoa] Deactivate the audio session before the WebProcess suspends.
2934         https://bugs.webkit.org/show_bug.cgi?id=196658
2935
2936         Reviewed by Eric Carlson.
2937
2938         Test: platform/mac/media/audio-session-deactivated-when-suspended.html
2939
2940         Deactivate the audio session when we are notified that the session will suspend.
2941
2942         Drive-by fix: don't try to begin playback when the process is suspended.
2943
2944         * platform/audio/PlatformMediaSessionManager.cpp:
2945         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
2946         (WebCore::PlatformMediaSessionManager::processWillSuspend):
2947         (WebCore::PlatformMediaSessionManager::processDidResume):
2948         * platform/audio/PlatformMediaSessionManager.h:
2949         (WebCore::PlatformMediaSessionManager::processIsSuspended const):
2950         * testing/InternalSettings.cpp:
2951         (WebCore::InternalSettings::Backup::Backup):
2952         (WebCore::InternalSettings::Backup::restoreTo):
2953         (WebCore::InternalSettings::setShouldDeactivateAudioSession):
2954         * testing/InternalSettings.h:
2955         * testing/InternalSettings.idl:
2956         * testing/Internals.cpp:
2957         (WebCore::Internals::processWillSuspend):
2958         (WebCore::Internals::processDidResume):
2959         * testing/Internals.h:
2960         * testing/Internals.idl:
2961
2962 2019-04-05  Sihui Liu  <sihui_liu@apple.com>
2963
2964         [iOS] Web process gets suspended while holding locked database files
2965         https://bugs.webkit.org/show_bug.cgi?id=196519
2966         <rdar://problem/49531797>
2967
2968         Reviewed by Chris Dumez.
2969
2970         Don't use DatabaseTracker singleton before it is initialized.
2971
2972         * Modules/webdatabase/DatabaseTracker.cpp:
2973         (WebCore::DatabaseTracker::isInitialized):
2974         * Modules/webdatabase/DatabaseTracker.h:
2975
2976 2019-04-05  Ryosuke Niwa  <rniwa@webkit.org>
2977
2978         Make WeakPtr<Element> possible and deploy it in form associated elements code
2979         https://bugs.webkit.org/show_bug.cgi?id=196626
2980
2981         Reviewed by Antti Koivisto.
2982
2983         Make Element inherit from CanMakeWeakPtr and deploy WeakPtr<*Element> in FormAssociatedElement and HTMLFormElement.
2984
2985         No new tests sine there should be no behavioral change.
2986
2987         * dom/Element.h:
2988         * html/FormAssociatedElement.cpp:
2989         (WebCore::FormAssociatedElement::FormAssociatedElement):
2990         (WebCore::FormAssociatedElement::insertedIntoAncestor):
2991         (WebCore::FormAssociatedElement::setForm):
2992         (WebCore::FormAssociatedElement::resetFormOwner):
2993         (WebCore::FormAssociatedElement::formAttributeChanged):
2994         * html/FormAssociatedElement.h:
2995         (WebCore::FormAssociatedElement::form const):
2996         * html/HTMLElement.cpp:
2997         (WebCore::HTMLElement::asFormNamedItem):
2998         (WebCore::HTMLElement::asFormAssociatedElement):
2999         * html/HTMLElement.h:
3000         (WebCore::HTMLElement::asFormNamedItem): Deleted.
3001         * html/HTMLFormControlElement.h:
3002         * html/HTMLFormControlsCollection.cpp:
3003         (WebCore::HTMLFormControlsCollection::formImageElements const): Inlined into updateNamedElementCache.
3004         (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
3005         * html/HTMLFormControlsCollection.h:
3006         * html/HTMLFormElement.cpp:
3007         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
3008         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
3009         (WebCore::HTMLFormElement::registerImgElement):
3010         (WebCore::HTMLFormElement::defaultButton const):
3011         (WebCore::HTMLFormElement::resetDefaultButton):
3012         (WebCore::HTMLFormElement::matchesValidPseudoClass const):
3013         (WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
3014         * html/HTMLFormElement.h:
3015         * html/HTMLImageElement.cpp:
3016         (WebCore::HTMLImageElement::HTMLImageElement):
3017         (WebCore::HTMLImageElement::insertedIntoAncestor):
3018         * html/HTMLImageElement.h:
3019         * html/HTMLInputElement.h:
3020         * html/HTMLMediaElement.h:
3021         * html/HTMLObjectElement.h:
3022         * html/HTMLPictureElement.h:
3023         * html/HTMLSlotElement.h:
3024         * svg/SVGElement.h:
3025
3026 2019-04-05  Caitlin Potter  <caitp@igalia.com>
3027
3028         [JSC] Filter DontEnum properties in ProxyObject::getOwnPropertyNames()
3029         https://bugs.webkit.org/show_bug.cgi?id=176810
3030
3031         Reviewed by Saam Barati.
3032
3033         Previously, there was a comment here indicating uncertainty of whether it
3034         was necessary to filter DontEnum properties explicitly or not. It turns
3035         out that it was necessary in the case of JSC ProxyObjects.
3036
3037         This patch adds DontEnum filtering for ProxyObjects, however we continue
3038         to explicitly filter them in JSDOMConvertRecord, which needs to use the
3039         property descriptor after filtering. This change prevents observably
3040         fetching the property descriptor twice per property.
3041
3042         * bindings/js/JSDOMConvertRecord.h:
3043
3044 2019-04-05  Michael Catanzaro  <mcatanzaro@igalia.com>
3045
3046         Unreviewed manual rollout of r243929
3047         https://bugs.webkit.org/show_bug.cgi?id=196626
3048
3049         * dom/Element.h:
3050         * html/FormAssociatedElement.cpp:
3051         (WebCore::FormAssociatedElement::FormAssociatedElement):
3052         (WebCore::FormAssociatedElement::insertedIntoAncestor):
3053         (WebCore::FormAssociatedElement::setForm):
3054         (WebCore::FormAssociatedElement::resetFormOwner):
3055         (WebCore::FormAssociatedElement::formAttributeChanged):
3056         * html/FormAssociatedElement.h:
3057         (WebCore::FormAssociatedElement::form const):
3058         * html/HTMLElement.cpp:
3059         (WebCore::HTMLElement::asFormNamedItem): Deleted.
3060         (WebCore::HTMLElement::asFormAssociatedElement): Deleted.
3061         * html/HTMLElement.h:
3062         (WebCore::HTMLElement::asFormNamedItem):
3063         * html/HTMLFormControlElement.h:
3064         * html/HTMLFormControlsCollection.cpp:
3065         (WebCore:: const):
3066         (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
3067         * html/HTMLFormControlsCollection.h:
3068         * html/HTMLFormElement.cpp:
3069         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
3070         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
3071         (WebCore::HTMLFormElement::registerImgElement):
3072         (WebCore::HTMLFormElement::defaultButton const):
3073         (WebCore::HTMLFormElement::resetDefaultButton):
3074         (WebCore::HTMLFormElement::matchesValidPseudoClass const):
3075         (WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
3076         * html/HTMLFormElement.h:
3077         * html/HTMLImageElement.cpp:
3078         (WebCore::HTMLImageElement::HTMLImageElement):
3079         (WebCore::HTMLImageElement::insertedIntoAncestor):
3080         * html/HTMLImageElement.h:
3081         * html/HTMLInputElement.h:
3082         * html/HTMLMediaElement.h:
3083         * html/HTMLObjectElement.h:
3084         * html/HTMLPictureElement.h:
3085         * html/HTMLSlotElement.h:
3086         * svg/SVGElement.h:
3087
3088 2019-04-05  Sihui Liu  <sihui_liu@apple.com>
3089
3090         [iOS] Web process gets suspended while holding locked database files
3091         https://bugs.webkit.org/show_bug.cgi?id=196519
3092         <rdar://problem/49531797>
3093
3094         Reviewed by Chris Dumez.
3095
3096         We should close all databases and make sure not open new databases when web process is ready to suspend.
3097
3098         * platform/sql/SQLiteDatabase.cpp:
3099         (WebCore::SQLiteDatabase::setIsDatabaseOpeningForbidden):
3100         (WebCore::SQLiteDatabase::open):
3101         * platform/sql/SQLiteDatabase.h:
3102         * platform/sql/SQLiteDatabaseTracker.cpp:
3103         (WebCore::SQLiteDatabaseTracker::setClient):
3104         (WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount):
3105         (WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount):
3106         (WebCore::SQLiteDatabaseTracker::hasTransactionInProgress):
3107
3108 2019-04-05  Commit Queue  <commit-queue@webkit.org>
3109
3110         Unreviewed, rolling out r243833.
3111         https://bugs.webkit.org/show_bug.cgi?id=196645
3112
3113         This change breaks build of WPE and GTK ports (Requested by
3114         annulen on #webkit).
3115
3116         Reverted changeset:
3117
3118         "[CMake][WTF] Mirror XCode header directories"
3119         https://bugs.webkit.org/show_bug.cgi?id=191662
3120         https://trac.webkit.org/changeset/243833
3121
3122 2019-04-05  David Kilzer  <ddkilzer@apple.com>
3123
3124         REGRESSION(r243887): Try to fix Windows builds by including <wtf/IsoMalloc.h>
3125
3126         Caused by:
3127             [WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
3128             https://bugs.webkit.org/show_bug.cgi?id=196475
3129
3130         * css/CSSComputedStyleDeclaration.h:
3131         * dom/DOMRectReadOnly.h:
3132         * dom/LiveNodeList.h:
3133         * dom/NodeIterator.h:
3134         * dom/TreeWalker.h:
3135         * fileapi/Blob.h:
3136         * fileapi/File.h:
3137         * fileapi/FileList.h:
3138         * html/CachedHTMLCollection.h:
3139         * html/HTMLFormElement.h:
3140         * html/HTMLNameCollection.h:
3141         * html/canvas/GPUBasedCanvasRenderingContext.h:
3142         * page/RemoteDOMWindow.h:
3143
3144 2019-04-05  Ryosuke Niwa  <rniwa@webkit.org>
3145
3146         Make WeakPtr<Element> possible and deploy it in form associated elements code
3147         https://bugs.webkit.org/show_bug.cgi?id=196626
3148
3149         Reviewed by Antti Koivisto.
3150
3151         Make Element inherit from CanMakeWeakPtr and deploy WeakPtr<*Element> in FormAssociatedElement and HTMLFormElement.
3152
3153         No new tests sine there should be no behavioral change.
3154
3155         * dom/Element.h:
3156         * html/FormAssociatedElement.cpp:
3157         (WebCore::FormAssociatedElement::FormAssociatedElement):
3158         (WebCore::FormAssociatedElement::insertedIntoAncestor):
3159         (WebCore::FormAssociatedElement::setForm):
3160         (WebCore::FormAssociatedElement::resetFormOwner):
3161         (WebCore::FormAssociatedElement::formAttributeChanged):
3162         * html/FormAssociatedElement.h:
3163         (WebCore::FormAssociatedElement::form const):
3164         * html/HTMLElement.cpp:
3165         (WebCore::HTMLElement::asFormNamedItem):
3166         (WebCore::HTMLElement::asFormAssociatedElement):
3167         * html/HTMLElement.h:
3168         (WebCore::HTMLElement::asFormNamedItem): Deleted.
3169         * html/HTMLFormControlElement.h:
3170         * html/HTMLFormControlsCollection.cpp:
3171         (WebCore::HTMLFormControlsCollection::formImageElements const): Inlined into updateNamedElementCache.
3172         (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
3173         * html/HTMLFormControlsCollection.h:
3174         * html/HTMLFormElement.cpp:
3175         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
3176         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
3177         (WebCore::HTMLFormElement::registerImgElement):
3178         (WebCore::HTMLFormElement::defaultButton const):
3179         (WebCore::HTMLFormElement::resetDefaultButton):
3180         (WebCore::HTMLFormElement::matchesValidPseudoClass const):
3181         (WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
3182         * html/HTMLFormElement.h:
3183         * html/HTMLImageElement.cpp:
3184         (WebCore::HTMLImageElement::HTMLImageElement):
3185         (WebCore::HTMLImageElement::insertedIntoAncestor):
3186         * html/HTMLImageElement.h:
3187         * html/HTMLInputElement.h:
3188         * html/HTMLMediaElement.h:
3189         * html/HTMLObjectElement.h:
3190         * html/HTMLPictureElement.h:
3191         * html/HTMLSlotElement.h:
3192         * svg/SVGElement.h:
3193
3194 2019-04-05  Carlos Garcia Campos  <cgarcia@igalia.com>
3195
3196         [ATK] Use a smart pointer for AccessibilityObject wrapper and remove GTK specific code
3197         https://bugs.webkit.org/show_bug.cgi?id=196593
3198         <rdar://problem/49599153>
3199
3200         Reviewed by Michael Catanzaro.
3201
3202         We have specific code for GTK to get/set the wrapper only because we don't use smart pointers. Also use
3203         WebKitAccessible as AccessibilityObjectWrapper instead of generic AtkObject, to enforce wrappers to be
3204         WebKitAccessible instances. This requires a few casts to AtkObject.
3205
3206         * accessibility/AccessibilityObject.h:
3207         (WebCore::AccessibilityObject::setWrapper):
3208         * accessibility/AccessibilityObjectInterface.h:
3209         * accessibility/atk/AXObjectCacheAtk.cpp:
3210         (WebCore::AXObjectCache::detachWrapper):
3211         (WebCore::AXObjectCache::attachWrapper):
3212         (WebCore::notifyChildrenSelectionChange):
3213         (WebCore::AXObjectCache::postPlatformNotification):
3214         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
3215         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
3216         (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
3217         * accessibility/atk/AccessibilityObjectAtk.cpp:
3218         * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
3219         (webkitAccessibleComponentRefAccessibleAtPoint):
3220         * accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp:
3221         (webkitAccessibleHypertextGetLink):
3222         (webkitAccessibleHypertextGetNLinks):
3223         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
3224         (webkitAccessibleSelectionRefSelection):
3225         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
3226         (webkitAccessibleTableRefAt):
3227         (webkitAccessibleTableGetColumnHeader):
3228         (webkitAccessibleTableGetRowHeader):
3229         (webkitAccessibleTableGetCaption):
3230         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
3231         (convertToGPtrArray):
3232         (webkitAccessibleTableCellGetTable):
3233         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
3234         (accessibilityObjectLength):
3235         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3236         (setAtkRelationSetFromCoreObject):
3237         (atkParentOfRootObject):
3238         (webkitAccessibleGetParent):
3239         (webkitAccessibleRefChild):
3240         (isTextWithCaret):
3241         * editing/atk/FrameSelectionAtk.cpp:
3242         (WebCore::emitTextSelectionChange):
3243         (WebCore::maybeEmitTextFocusChange):
3244
3245 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
3246
3247         [iOS WK2] REGRESSION (r242687): Programmatic scroll of overflow scroll results in bad rendering
3248         https://bugs.webkit.org/show_bug.cgi?id=195584
3249
3250         Reviewed by Zalan Bujtas.
3251
3252         Push data to the scrolling tree about whether an overflow:scroll scroll was programmatic, by having
3253         RenderLayer::scrollToOffset() call into AsyncScrollingCoordinator::requestScrollPositionUpdate(),
3254         just as we do for frames.
3255
3256         AsyncScrollingCoordinator::requestScrollPositionUpdate() is generalized to take any ScrollableArea.
3257
3258         Fix an assumption in the ScrollingTree that we only care about programmatic scrolls on the root node.
3259         ScrollingTree::commitTreeState() no longer sets isHandlingProgrammaticScroll; instead,
3260         callers of ScrollingTreeScrollingNode::scrollTo() pass a ScrollType. Commit functions pass
3261         ScrollType::Programmatic when handling RequestedScrollPosition changes as necessary.
3262
3263         Programmatic scrolls need to get to the scrolling tree in the UI process so that we update
3264         the tree's notion of scroll position, and trigger actual UIScrollView scrolls (layers may have
3265         already been put in the right locations, but the UI process needs to know that a scroll happened).
3266         However, we need to prevent notifications from programmatic scrolls getting back to the
3267         web process, because this causes jumpiness. This is done via an early return in
3268         RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll().
3269
3270         Tests: scrollingcoordinator/ios/programmatic-overflow-scroll.html
3271                scrollingcoordinator/ios/programmatic-page-scroll.html
3272
3273         * page/scrolling/AsyncScrollingCoordinator.cpp:
3274         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
3275         * page/scrolling/AsyncScrollingCoordinator.h:
3276         * page/scrolling/ScrollingCoordinator.h:
3277         (WebCore::ScrollingCoordinator::requestScrollPositionUpdate):
3278         * page/scrolling/ScrollingTree.cpp:
3279         (WebCore::ScrollingTree::commitTreeState):
3280         (WebCore::ScrollingTree::isHandlingProgrammaticScroll): Deleted.
3281         * page/scrolling/ScrollingTree.h:
3282         (WebCore::ScrollingTree::isHandlingProgrammaticScroll const):
3283         (WebCore::ScrollingTree::setIsHandlingProgrammaticScroll):
3284         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3285         (WebCore::ScrollingTreeScrollingNode::scrollBy):
3286         (WebCore::ScrollingTreeScrollingNode::scrollTo):
3287         * page/scrolling/ScrollingTreeScrollingNode.h:
3288         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3289         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
3290         * rendering/RenderLayer.cpp:
3291         (WebCore::RenderLayer::scrollToOffset):
3292         (WebCore::RenderLayer::scrollingNodeID const):
3293         * rendering/RenderLayer.h:
3294         * rendering/RenderMarquee.cpp:
3295         (WebCore::RenderMarquee::timerFired):
3296
3297 2019-04-04  Yusuke Suzuki  <ysuzuki@apple.com>
3298
3299         Unreviewed, speculative fix for build failure
3300         https://bugs.webkit.org/show_bug.cgi?id=196475
3301
3302         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
3303
3304 2019-04-04  Ryosuke Niwa  <rniwa@webkit.org>
3305
3306         Element::isFocusable() debug asserts too frequently
3307         https://bugs.webkit.org/show_bug.cgi?id=196634
3308
3309         Reviewed by Geoffrey Garen.
3310
3311         Remove the debug assertion for now.
3312
3313         * dom/Element.cpp:
3314         (WebCore::Element::isFocusable const):
3315
3316 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
3317
3318         Have ScrollableArea store a ScrollType for the current scroll
3319         https://bugs.webkit.org/show_bug.cgi?id=196627
3320
3321         Reviewed by Zalan Bujtas.
3322
3323         RenderLayer had isInUserScroll() which is the opposite of ScrollableArea::inProgrammaticScroll(),
3324         so just have ScrollableArea store a ScrollType.
3325
3326         RenderLayer's scrolling bottleneck, scrollToOffset(), now takes a ScrollType, and pushes
3327         it onto the base class.
3328
3329         AsyncScrollingCoordinator::requestScrollPositionUpdate() can use the incoming scrollType (currently
3330         incorrect for iOS WK2 overflow) rather than deducing a user scroll from ScrollingLayerPositionAction.
3331
3332         No behavior change.
3333
3334         * page/FrameView.cpp:
3335         (WebCore::FrameView::setFrameRect):
3336         (WebCore::FrameView::topContentInsetDidChange):
3337         (WebCore::FrameView::updateLayoutViewport):
3338         (WebCore::FrameView::setScrollPosition):
3339         (WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling const):
3340         (WebCore::FrameView::setWasScrolledByUser):
3341         * page/FrameViewLayoutContext.cpp:
3342         (WebCore::LayoutScope::LayoutScope):
3343         (WebCore::LayoutScope::~LayoutScope):
3344         * page/ios/FrameIOS.mm:
3345         (WebCore::Frame::overflowScrollPositionChangedForNode):
3346         * page/scrolling/AsyncScrollingCoordinator.cpp:
3347         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
3348         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
3349         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
3350         * platform/ScrollView.cpp:
3351         (WebCore::ScrollView::setScrollPosition):
3352         * platform/ScrollableArea.cpp:
3353         (WebCore::ScrollableArea::ScrollableArea):
3354         * platform/ScrollableArea.h:
3355         (WebCore::ScrollableArea::currentScrollType const):
3356         (WebCore::ScrollableArea::setCurrentScrollType):
3357         (WebCore::ScrollableArea::setIsUserScroll): Deleted.
3358         (WebCore::ScrollableArea::inProgrammaticScroll const): Deleted.
3359         (WebCore::ScrollableArea::setInProgrammaticScroll): Deleted.
3360         * rendering/RenderLayer.cpp:
3361         (WebCore::RenderLayer::RenderLayer):
3362         (WebCore::RenderLayer::scrollToXPosition):
3363         (WebCore::RenderLayer::scrollToYPosition):
3364         (WebCore::RenderLayer::scrollToOffset):
3365         (WebCore::RenderLayer::scrollTo):
3366         * rendering/RenderLayer.h:
3367         * rendering/RenderLayerBacking.cpp:
3368         (WebCore::RenderLayerBacking::updateScrollOffset):
3369         * rendering/RenderMarquee.cpp:
3370         (WebCore::RenderMarquee::start):
3371
3372 2019-04-04  Shawn Roberts  <sroberts@apple.com>
3373
3374         Unreviewed, rolling out r243868.
3375
3376         Causing timeouts failures on several queues
3377
3378         Reverted changeset:
3379
3380         "[Web Animations] JS wrapper may be deleted while animation is
3381         yet to dispatch its finish event"
3382         https://bugs.webkit.org/show_bug.cgi?id=196118
3383         https://trac.webkit.org/changeset/243868
3384
3385 2019-04-04  Youenn Fablet  <youenn@apple.com>
3386
3387         Pass storage quota parameters from UIProcess to NetworkProcess as part of WebsiteDataStore parameters
3388         https://bugs.webkit.org/show_bug.cgi?id=196543
3389
3390         Reviewed by Alex Christensen.
3391
3392         Add a default routine to compute a third party quota from a per origin quota.
3393         No change of behavior.
3394
3395         * storage/StorageQuotaManager.h:
3396         (WebCore::StorageQuotaManager::defaultThirdPartyQuotaFromPerOriginQuota):
3397         (WebCore::StorageQuotaManager::defaultThirdPartyQuota):
3398
3399 2019-04-04  Commit Queue  <commit-queue@webkit.org>
3400
3401         Unreviewed, rolling out r243807 and r243824.
3402         https://bugs.webkit.org/show_bug.cgi?id=196611
3403
3404         Test added is a flaky timeout on iOS Simulator, 3 tests
3405         unskipped are flaky failures (Requested by ShawnRoberts on
3406         #webkit).
3407
3408         Reverted changesets:
3409
3410         "Blob type cannot be stored correctly in IDB when
3411         IDBObjectStore has autoIncrement and keyPath options"
3412         https://bugs.webkit.org/show_bug.cgi?id=196128
3413         https://trac.webkit.org/changeset/243807
3414
3415         "Follow up fix for r243807: Use MarkedArgumentBuffer instead
3416         of Vector for JSValue"
3417         https://bugs.webkit.org/show_bug.cgi?id=196547
3418         https://trac.webkit.org/changeset/243824
3419
3420 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
3421
3422         Fix rare crash under collectRelatedCoordinatedScrollingNodes()
3423         https://bugs.webkit.org/show_bug.cgi?id=196610
3424         rdar://problem/49595426
3425
3426         Reviewed by Zalan Bujtas.
3427
3428         hasCompositedScrollableOverflow() doesn't check whether a layer is composited (it has
3429         to report the right status before layers have been created), so collectRelatedCoordinatedScrollingNodes()
3430         needs to check whether there's backing.
3431
3432         * rendering/RenderLayerCompositor.cpp:
3433         (WebCore::collectRelatedCoordinatedScrollingNodes):
3434
3435 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
3436
3437         Move "inProgrammaticScroll" down to ScrollableArea
3438         https://bugs.webkit.org/show_bug.cgi?id=196614
3439
3440         Reviewed by Zalan Bujtas.
3441
3442         A future patch will need to update "inProgrammaticScroll" on RenderLayers, so push
3443         inProgrammaticScroll() down to ScrollableArea.
3444
3445         ScrollableArea already has "isScrolledProgrammatically", which I rename to "scrollShouldClearLatchedState"
3446         to reduce confusion. It might be possible to remove this in future with some refactoring.
3447
3448         Sadly we can no longer use SetForScope<> in FrameView after this change so add some manual save/restore code.
3449
3450         * dom/Element.cpp:
3451         (WebCore::Element::setScrollLeft):
3452         (WebCore::Element::setScrollTop):
3453         * page/EventHandler.cpp:
3454         (WebCore::EventHandler::completeWidgetWheelEvent):
3455         (WebCore::EventHandler::handleWheelEvent):
3456         * page/FrameView.cpp:
3457         (WebCore::FrameView::setFrameRect):
3458         (WebCore::FrameView::topContentInsetDidChange):
3459         (WebCore::FrameView::updateLayoutViewport):
3460         (WebCore::FrameView::setScrollPosition):
3461         (WebCore::FrameView::setWasScrolledByUser):
3462         * page/FrameView.h:
3463         * platform/ScrollView.h:
3464         (WebCore::ScrollView::inProgrammaticScroll const): Deleted.
3465         * platform/ScrollableArea.cpp:
3466         (WebCore::ScrollableArea::ScrollableArea):
3467         * platform/ScrollableArea.h:
3468         (WebCore::ScrollableArea::inProgrammaticScroll const):
3469         (WebCore::ScrollableArea::setInProgrammaticScroll):
3470         (WebCore::ScrollableArea::scrollShouldClearLatchedState const):
3471         (WebCore::ScrollableArea::setScrollShouldClearLatchedState):
3472         (WebCore::ScrollableArea::isScrolledProgrammatically const): Deleted.
3473         (WebCore::ScrollableArea::setScrolledProgrammatically): Deleted.
3474
3475 2019-04-04  Sihui Liu  <sihui_liu@apple.com>
3476
3477         Leak of UniqueIDBDatabase in network process running layout tests
3478         https://bugs.webkit.org/show_bug.cgi?id=196565
3479         <rdar://problem/49346139>
3480
3481         Reviewed by Geoffrey Garen.
3482
3483         UniqueIDBDatabase will null itself after it receives confirmation about connecton close from its clients, but it
3484         is possible that the web process to network process connection closes before servers gets the 
3485         confirmDidCloseFromServer. Therefore, we should let UniqueIDBDatabase forget connection when it receives a 
3486         conenctionClosedFromClient.
3487
3488         No new test because this bug is caused by race between network receiving conenctionClosedFromClient and 
3489         receiving confirmDidCloseFromServer. This is testable by running some existing layout tests in a row with leak 
3490         option.
3491
3492         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3493         (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
3494         (WebCore::IDBServer::UniqueIDBDatabase::confirmDidCloseFromServer):
3495
3496 2019-04-04  Chris Dumez  <cdumez@apple.com>
3497
3498         Unreviewed, fix iOS build with recent SDKs.
3499
3500         * platform/gamepad/cocoa/GameControllerGamepad.mm:
3501         (WebCore::GameControllerGamepad::GameControllerGamepad):
3502
3503 2019-04-04  Eric Carlson  <eric.carlson@apple.com>
3504
3505         [MediaStream] Host should be able to mute screen capture and camera/microphone independently
3506         https://bugs.webkit.org/show_bug.cgi?id=196555
3507         <rdar://problem/47303865>
3508
3509         Reviewed by Youenn Fablet.
3510
3511         Test: fast/mediastream/media-stream-page-muted.html
3512
3513         * Modules/mediastream/MediaStream.cpp:
3514         (WebCore::MediaStream::MediaStream): Call setCaptureTracksMuted to pass page muted 
3515         state to tracks.
3516         (WebCore::MediaStream::startProducingData): Ditto.
3517         (WebCore::MediaStream::setCaptureTracksMuted): New.
3518         * Modules/mediastream/MediaStream.h:
3519
3520         * Modules/mediastream/MediaStreamTrack.cpp:
3521         (WebCore::MediaStreamTrack::MediaStreamTrack): Call setMuted with page muted state.
3522         (WebCore::MediaStreamTrack::setMuted): Set muted according to page state and source type.
3523         (WebCore::MediaStreamTrack::pageMutedStateDidChange): Call setMuted.
3524         (WebCore::MediaStreamTrack::mediaState const): Update for new page state.
3525         * Modules/mediastream/MediaStreamTrack.h:
3526
3527         * page/MediaProducer.h: Split capture muted state into two: camera/microphone and screen.
3528
3529         * page/Page.h:
3530         (WebCore::Page::isMediaCaptureMuted const): Update for state changes.
3531
3532         * platform/mediastream/MediaStreamPrivate.cpp:
3533         (WebCore::MediaStreamPrivate::setCaptureTracksMuted): Deleted.
3534         (WebCore::MediaStreamPrivate::hasCaptureVideoSource const): Deleted.
3535         * platform/mediastream/MediaStreamPrivate.h:
3536
3537         * platform/mediastream/RealtimeMediaSource.cpp:
3538         (WebCore::RealtimeMediaSource::setMuted): Log state.
3539         (WebCore::RealtimeMediaSource::notifyMutedChange): Call notifyMutedObservers on the
3540         next runloop so events aren't dispatched synchronously.
3541
3542         * testing/Internals.cpp:
3543         (WebCore::Internals::setPageMuted): Add new state.
3544
3545 2019-04-04  Chris Dumez  <cdumez@apple.com>
3546
3547         Unreviewed, update r243884 to use macros in Compiler.h instead.
3548
3549         * platform/ios/LegacyTileGrid.mm:
3550         (WebCore::LegacyTileGrid::dropDistantTiles):
3551
3552 2019-04-04  Chris Fleizach  <cfleizach@apple.com>
3553
3554         AX: Crash under WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored()
3555         https://bugs.webkit.org/show_bug.cgi?id=196600
3556         <rdar://problem/49572996>
3557
3558         Reviewed by Joanmarie Diggs.
3559
3560         Audit AX code to not dereference renderer before checking if it's null.
3561         Not clear how to reproduce at this time.
3562
3563         * accessibility/AccessibilityRenderObject.cpp:
3564         (WebCore::webAreaIsPresentational):
3565         (WebCore::AccessibilityRenderObject::layoutCount const):
3566         (WebCore::AccessibilityRenderObject::widget const):
3567
3568 2019-04-04  Antti Koivisto  <antti@apple.com>
3569
3570         Compute accurate regions for touch-action
3571         https://bugs.webkit.org/show_bug.cgi?id=196536
3572         <rdar://problem/49516022>
3573
3574         Reviewed by Simon Fraser.
3575
3576         Tests: pointerevents/ios/touch-action-region-basic.html
3577                pointerevents/ios/touch-action-region-layers.html
3578                pointerevents/ios/touch-action-region-pan-x-y.html
3579
3580         - Use style system to compute effective touch-action without additional tree walks.
3581         - Compute touch-action region in a fake paint, at the same time with the event region.
3582
3583         This patch doesn't yet use the computed region for anything except test output.
3584
3585         * Sources.txt:
3586         * WebCore.xcodeproj/project.pbxproj:
3587         * css/StyleResolver.cpp:
3588         (WebCore::computeEffectiveTouchActions):
3589         (WebCore::StyleResolver::adjustRenderStyle):
3590
3591         Update RenderStyle::effectiveTouchAction.
3592
3593         * dom/Element.cpp:
3594         (WebCore::Element::computedTouchActions const):
3595
3596         Just get it from the style.
3597
3598         * platform/graphics/GraphicsLayer.cpp:
3599         (WebCore::GraphicsLayer::setEventRegion):
3600         (WebCore::GraphicsLayer::setTouchActionRegion):
3601         (WebCore::GraphicsLayer::dumpProperties const):
3602         * platform/graphics/GraphicsLayer.h:
3603         (WebCore::GraphicsLayer::touchActionRegion const):
3604         * platform/graphics/ca/GraphicsLayerCA.cpp:
3605         (WebCore::GraphicsLayerCA::setTouchActionRegion):
3606         * platform/graphics/ca/GraphicsLayerCA.h:
3607         * rendering/PaintInfo.h:
3608         * rendering/RenderBlock.cpp:
3609         (WebCore::RenderBlock::paintObject):
3610         * rendering/RenderLayer.cpp:
3611         (WebCore::RenderLayer::collectEventRegionForFragments):
3612         * rendering/RenderLayer.h:
3613         * rendering/RenderLayerBacking.cpp:
3614         (WebCore::RenderLayerBacking::updateConfiguration):
3615
3616         Need to do this for the top compositing layer too.
3617
3618         (WebCore::RenderLayerBacking::updateEventRegion):
3619
3620         Compute touch-action region too.
3621         As a basic optimization avoid doing any extra work if there are no elements with non-default touch-action property.
3622
3623         * rendering/TouchActionRegion.cpp: Added.
3624         (WebCore::toIndex):
3625         (WebCore::toTouchAction):
3626         (WebCore::toString):
3627         (WebCore::TouchActionRegion::unite):
3628         (WebCore::TouchActionRegion::actionsForPoint const):
3629         (WebCore::TouchActionRegion::translate):
3630         (WebCore::operator<<):
3631         * rendering/TouchActionRegion.h: Added.
3632
3633         Class for collecting and maintaining touch-action region.
3634
3635         (WebCore::TouchActionRegion::isEmpty const):
3636         (WebCore::TouchActionRegion::operator== const):
3637         * rendering/style/RenderStyle.h:
3638         (WebCore::RenderStyle::effectiveTouchActions const):
3639         (WebCore::RenderStyle::setEffectiveTouchActions):
3640
3641         Implement as inherited property for efficiency (touch-action itself is non-inherited).
3642
3643         * rendering/style/StyleRareInheritedData.cpp:
3644         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
3645         (WebCore::StyleRareInheritedData::operator== const):
3646         * rendering/style/StyleRareInheritedData.h:
3647
3648 2019-04-04  Yusuke Suzuki  <ysuzuki@apple.com>
3649
3650         Unreviewed, fix linking error because the build of RTCIceTransport.cpp is handled in Xcode project side accidentally
3651         https://bugs.webkit.org/show_bug.cgi?id=196475
3652
3653         We did not have RTCIceTransport.cpp in Sources.txt.
3654
3655         * WebCore.xcodeproj/project.pbxproj:
3656
3657 2019-04-04  Yusuke Suzuki  <ysuzuki@apple.com>
3658
3659         [WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
3660         https://bugs.webkit.org/show_bug.cgi?id=196475
3661
3662         Reviewed by Saam Barati.
3663
3664         This patch puts most of derived classes of ScriptWrappable into IsoHeap. We do not include derived classes of Event simply
3665         because Internal repository code also inherits it. After watching the result of this patch, we will try Event and its derived
3666         classes into IsoHeap too.
3667
3668         This patch makes the following things IsoHeap-allocated. These classes are listed by using lldb python script.
3669
3670             1. DOM collections (HTMLCollection etc.)
3671             2. WebAudio nodes
3672             3. IDB classes
3673             4. FileSystem API classes
3674             5. Canvas contexts
3675             6. WebRTC classses
3676             7. XMLHttpRequest related classes
3677             8. WebSocket related classes
3678             9. Worker and Worklet related classes
3679             10. Other misc classes
3680
3681         * Modules/applepay/ApplePaySession.cpp:
3682         * Modules/applepay/ApplePaySession.h:
3683         * Modules/encryptedmedia/MediaKeySession.cpp:
3684         * Modules/encryptedmedia/MediaKeySession.h:
3685         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
3686         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
3687         * Modules/entriesapi/DOMFileSystem.cpp:
3688         * Modules/entriesapi/DOMFileSystem.h:
3689         (WebCore::DOMFileSystem::createEntryForFile): Deleted.
3690         (WebCore::DOMFileSystem::name const): Deleted.
3691         * Modules/entriesapi/FileSystemDirectoryEntry.h:
3692         * Modules/entriesapi/FileSystemDirectoryReader.cpp:
3693         * Modules/entriesapi/FileSystemDirectoryReader.h:
3694         * Modules/entriesapi/FileSystemEntry.cpp:
3695         * Modules/entriesapi/FileSystemEntry.h:
3696         * Modules/entriesapi/FileSystemFileEntry.h:
3697         * Modules/geolocation/Geolocation.cpp:
3698         * Modules/geolocation/Geolocation.h:
3699         (WebCore::Geolocation::document const): Deleted.
3700         (WebCore::Geolocation::frame const): Deleted.
3701         (WebCore::Geolocation::resetIsAllowed): Deleted.
3702         (WebCore::Geolocation::isAllowed const): Deleted.
3703         (WebCore::Geolocation::isDenied const): Deleted.
3704         (WebCore::Geolocation::hasListeners const): Deleted.
3705         * Modules/indexeddb/IDBCursor.cpp:
3706         * Modules/indexeddb/IDBCursor.h:
3707         * Modules/indexeddb/IDBCursorWithValue.cpp:
3708         * Modules/indexeddb/IDBCursorWithValue.h:
3709         * Modules/indexeddb/IDBDatabase.cpp:
3710         * Modules/indexeddb/IDBDatabase.h:
3711         (WebCore::IDBDatabase::info const): Deleted.
3712         (WebCore::IDBDatabase::databaseConnectionIdentifier const): Deleted.
3713         (WebCore::IDBDatabase::connectionProxy): Deleted.
3714         (WebCore::IDBDatabase::isClosingOrClosed const): Deleted.
3715         * Modules/indexeddb/IDBKeyRange.cpp:
3716         * Modules/indexeddb/IDBKeyRange.h:
3717         (WebCore::IDBKeyRange::lower const): Deleted.
3718         (WebCore::IDBKeyRange::upper const): Deleted.
3719         (WebCore::IDBKeyRange::lowerOpen const): Deleted.
3720         (WebCore::IDBKeyRange::upperOpen const): Deleted.
3721         * Modules/indexeddb/IDBOpenDBRequest.cpp:
3722         * Modules/indexeddb/IDBOpenDBRequest.h:
3723         * Modules/indexeddb/IDBRequest.cpp:
3724         * Modules/indexeddb/IDBRequest.h:
3725         * Modules/indexeddb/IDBTransaction.cpp:
3726         * Modules/indexeddb/IDBTransaction.h:
3727         (WebCore::IDBTransaction::mode const): Deleted.
3728         (WebCore::IDBTransaction::info const): Deleted.
3729         (WebCore::IDBTransaction::database): Deleted.
3730         (WebCore::IDBTransaction::database const): Deleted.
3731         (WebCore::IDBTransaction::originalDatabaseInfo const): Deleted.
3732         (WebCore::IDBTransaction::isVersionChange const): Deleted.
3733         (WebCore::IDBTransaction::isReadOnly const): Deleted.
3734         (WebCore::IDBTransaction::isFinished const): Deleted.
3735         * Modules/mediarecorder/MediaRecorder.cpp:
3736         * Modules/mediarecorder/MediaRecorder.h:
3737         * Modules/mediasession/MediaRemoteControls.cpp:
3738         * Modules/mediasession/MediaRemoteControls.h:
3739         (WebCore::MediaRemoteControls::create): Deleted.
3740         (WebCore::MediaRemoteControls::previousTrackEnabled const): Deleted.
3741         (WebCore::MediaRemoteControls::nextTrackEnabled const): Deleted.
3742         * Modules/mediasource/MediaSource.cpp:
3743         * Modules/mediasource/MediaSource.h:
3744         * Modules/mediasource/SourceBuffer.cpp:
3745         * Modules/mediasource/SourceBuffer.h:
3746         * Modules/mediasource/SourceBufferList.cpp:
3747         * Modules/mediasource/SourceBufferList.h:
3748         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
3749         * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
3750         * Modules/mediastream/MediaDeviceInfo.cpp:
3751         * Modules/mediastream/MediaDeviceInfo.h:
3752         (WebCore::MediaDeviceInfo::label const): Deleted.
3753         (WebCore::MediaDeviceInfo::deviceId const): Deleted.
3754         (WebCore::MediaDeviceInfo::groupId const): Deleted.
3755         (WebCore::MediaDeviceInfo::kind const): Deleted.
3756         * Modules/mediastream/MediaDevices.cpp:
3757         * Modules/mediastream/MediaDevices.h:
3758         * Modules/mediastream/MediaStream.cpp:
3759         * Modules/mediastream/MediaStream.h:
3760         * Modules/mediastream/MediaStreamTrack.cpp:
3761         * Modules/mediastream/MediaStreamTrack.h:
3762         * Modules/mediastream/RTCDTMFSender.cpp:
3763         * Modules/mediastream/RTCDTMFSender.h:
3764         * Modules/mediastream/RTCDataChannel.cpp:
3765         * Modules/mediastream/RTCDataChannel.h:
3766         * Modules/mediastream/RTCIceCandidate.cpp:
3767         * Modules/mediastream/RTCIceCandidate.h:
3768         (WebCore::RTCIceCandidate::candidate const): Deleted.
3769         (WebCore::RTCIceCandidate::sdpMid const): Deleted.
3770         (WebCore::RTCIceCandidate::sdpMLineIndex const): Deleted.
3771         (WebCore::RTCIceCandidate::setCandidate): Deleted.
3772         * Modules/mediastream/RTCIceTransport.cpp:
3773         * Modules/mediastream/RTCIceTransport.h:
3774         (WebCore::RTCIceTransport::create): Deleted.
3775         (WebCore::RTCIceTransport::state const): Deleted.
3776         (WebCore::RTCIceTransport::setState): Deleted.
3777         (WebCore::RTCIceTransport::gatheringState const): Deleted.
3778         (WebCore::RTCIceTransport::setGatheringState): Deleted.
3779         (WebCore::RTCIceTransport::RTCIceTransport): Deleted.
3780         * Modules/mediastream/RTCPeerConnection.cpp:
3781         * Modules/mediastream/RTCPeerConnection.h:
3782         * Modules/mediastream/RTCRtpReceiver.cpp:
3783         * Modules/mediastream/RTCRtpReceiver.h:
3784         (WebCore::RTCRtpReceiver::create): Deleted.
3785         (WebCore::RTCRtpReceiver::setBackend): Deleted.
3786         (WebCore::RTCRtpReceiver::getParameters): Deleted.
3787         (WebCore::RTCRtpReceiver::getContributingSources const): Deleted.
3788         (WebCore::RTCRtpReceiver::getSynchronizationSources const): Deleted.
3789         (WebCore::RTCRtpReceiver::track): Deleted.
3790         (WebCore::RTCRtpReceiver::backend): Deleted.
3791         * Modules/mediastream/RTCRtpSender.cpp:
3792         * Modules/mediastream/RTCRtpSender.h:
3793         (WebCore::RTCRtpSender::track): Deleted.
3794         (WebCore::RTCRtpSender::trackId const): Deleted.
3795         (WebCore::RTCRtpSender::trackKind const): Deleted.
3796         (WebCore::RTCRtpSender::mediaStreamIds const): Deleted.
3797         (WebCore::RTCRtpSender::setMediaStreamIds): Deleted.
3798         (WebCore::RTCRtpSender::isStopped const): Deleted.
3799         (WebCore::RTCRtpSender::backend): Deleted.
3800         * Modules/mediastream/RTCRtpTransceiver.cpp:
3801         * Modules/mediastream/RTCRtpTransceiver.h:
3802         (WebCore::RTCRtpTransceiver::create): Deleted.
3803         (WebCore::RTCRtpTransceiver::sender): Deleted.
3804         (WebCore::RTCRtpTransceiver::receiver): Deleted.
3805         (WebCore::RTCRtpTransceiver::iceTransport): Deleted.
3806         (WebCore::RTCRtpTransceiver::backend): Deleted.
3807         * Modules/mediastream/RTCSessionDescription.cpp:
3808         * Modules/mediastream/RTCSessionDescription.h:
3809         (WebCore::RTCSessionDescription::type const): Deleted.
3810         (WebCore::RTCSessionDescription::sdp const): Deleted.
3811         (WebCore::RTCSessionDescription::setSdp): Deleted.
3812         * Modules/notifications/Notification.cpp:
3813         * Modules/notifications/Notification.h:
3814         * Modules/paymentrequest/PaymentRequest.cpp:
3815         * Modules/paymentrequest/PaymentRequest.h:
3816         * Modules/paymentrequest/PaymentResponse.cpp:
3817         * Modules/paymentrequest/PaymentResponse.h:
3818         * Modules/speech/SpeechSynthesisUtterance.cpp:
3819         * Modules/speech/SpeechSynthesisUtterance.h:
3820         * Modules/webaudio/AnalyserNode.cpp:
3821         * Modules/webaudio/AnalyserNode.h:
3822         * Modules/webaudio/AudioBasicInspectorNode.cpp:
3823         * Modules/webaudio/AudioBasicInspectorNode.h:
3824         * Modules/webaudio/AudioBasicProcessorNode.cpp:
3825         * Modules/webaudio/AudioBasicProcessorNode.h:
3826         * Modules/webaudio/AudioBufferSourceNode.cpp:
3827         * Modules/webaudio/AudioBufferSourceNode.h:
3828         * Modules/webaudio/AudioContext.cpp:
3829         * Modules/webaudio/AudioContext.h:
3830         * Modules/webaudio/AudioDestinationNode.cpp:
3831         * Modules/webaudio/AudioDestinationNode.h:
3832         * Modules/webaudio/AudioNode.cpp:
3833         * Modules/webaudio/AudioNode.h:
3834         * Modules/webaudio/AudioScheduledSourceNode.cpp:
3835         * Modules/webaudio/AudioScheduledSourceNode.h:
3836         * Modules/webaudio/BiquadFilterNode.cpp:
3837         * Modules/webaudio/BiquadFilterNode.h:
3838         * Modules/webaudio/ChannelMergerNode.cpp:
3839         * Modules/webaudio/ChannelMergerNode.h:
3840         * Modules/webaudio/ChannelSplitterNode.cpp:
3841         * Modules/webaudio/ChannelSplitterNode.h:
3842         * Modules/webaudio/ConvolverNode.cpp:
3843         * Modules/webaudio/ConvolverNode.h:
3844         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
3845         * Modules/webaudio/DefaultAudioDestinationNode.h:
3846         * Modules/webaudio/DelayNode.cpp:
3847         * Modules/webaudio/DelayNode.h:
3848         * Modules/webaudio/DynamicsCompressorNode.cpp:
3849         * Modules/webaudio/DynamicsCompressorNode.h:
3850         * Modules/webaudio/GainNode.cpp:
3851         * Modules/webaudio/GainNode.h:
3852         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
3853         * Modules/webaudio/MediaElementAudioSourceNode.h:
3854         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
3855         * Modules/webaudio/MediaStreamAudioDestinationNode.h:
3856         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
3857         * Modules/webaudio/MediaStreamAudioSourceNode.h:
3858         * Modules/webaudio/OfflineAudioContext.cpp:
3859         * Modules/webaudio/OfflineAudioContext.h:
3860         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
3861         * Modules/webaudio/OfflineAudioDestinationNode.h:
3862         * Modules/webaudio/OscillatorNode.cpp:
3863         * Modules/webaudio/OscillatorNode.h:
3864         * Modules/webaudio/PannerNode.cpp:
3865         * Modules/webaudio/PannerNode.h:
3866         * Modules/webaudio/ScriptProcessorNode.cpp:
3867         * Modules/webaudio/ScriptProcessorNode.h:
3868         * Modules/webaudio/WaveShaperNode.cpp:
3869         * Modules/webaudio/WaveShaperNode.h:
3870         * Modules/webgpu/GPUCanvasContext.cpp:
3871         * Modules/webgpu/GPUCanvasContext.h:
3872         * Modules/websockets/WebSocket.cpp:
3873         * Modules/websockets/WebSocket.h:
3874         * Modules/webvr/VRDisplay.cpp:
3875         * Modules/webvr/VRDisplay.h:
3876         (WebCore::VRDisplay::isPresenting const): Deleted.
3877         (WebCore::VRDisplay::displayName const): Deleted.
3878         (WebCore::VRDisplay::displayId const): Deleted.
3879         (WebCore::VRDisplay::depthNear const): Deleted.
3880         (WebCore::VRDisplay::setDepthNear): Deleted.
3881         (WebCore::VRDisplay::depthFar const): Deleted.
3882         (WebCore::VRDisplay::setDepthFar): Deleted.
3883         (WebCore::VRDisplay::document): Deleted.
3884         * Sources.txt:
3885         * WebCore.xcodeproj/project.pbxproj:
3886         * animation/CSSAnimation.cpp:
3887         * animation/CSSAnimation.h:
3888         * animation/CSSTransition.cpp:
3889         * animation/CSSTransition.h:
3890         * animation/DeclarativeAnimation.cpp:
3891         * animation/DeclarativeAnimation.h:
3892         * animation/WebAnimation.cpp:
3893         * animation/WebAnimation.h:
3894         * bindings/js/ScriptWrappable.h:
3895         * css/CSSComputedStyleDeclaration.cpp:
3896         * css/CSSComputedStyleDeclaration.h:
3897         * css/CSSStyleDeclaration.cpp:
3898         (): Deleted.
3899         * css/CSSStyleDeclaration.h:
3900         * css/DOMMatrix.h:
3901         * css/DOMMatrixReadOnly.cpp:
3902         * css/DOMMatrixReadOnly.h:
3903         * css/FontFaceSet.cpp:
3904         * css/FontFaceSet.h:
3905         * css/PropertySetCSSStyleDeclaration.cpp:
3906         * css/PropertySetCSSStyleDeclaration.h:
3907         * css/WebKitCSSMatrix.cpp:
3908         * css/WebKitCSSMatrix.h:
3909         * css/typedom/TypedOMCSSImageValue.cpp: Added.
3910         * css/typedom/TypedOMCSSImageValue.h:
3911         * css/typedom/TypedOMCSSNumericValue.cpp: Added.
3912         * css/typedom/TypedOMCSSNumericValue.h:
3913         * css/typedom/TypedOMCSSStyleValue.cpp: Added.
3914         * css/typedom/TypedOMCSSStyleValue.h:
3915         * css/typedom/TypedOMCSSUnitValue.cpp: Added.
3916         * css/typedom/TypedOMCSSUnitValue.h:
3917         * css/typedom/TypedOMCSSUnparsedValue.cpp: Added.
3918         * css/typedom/TypedOMCSSUnparsedValue.h:
3919         * dom/AbortController.cpp:
3920         * dom/AbortController.h:
3921         * dom/AbortSignal.cpp:
3922         * dom/AbortSignal.h:
3923         * dom/AllDescendantsCollection.cpp: Copied from Source/WebCore/xml/XMLHttpRequestEventTarget.h.
3924         * dom/AllDescendantsCollection.h:
3925         * dom/ChildNodeList.cpp:
3926         * dom/ChildNodeList.h:
3927         * dom/ClassCollection.cpp:
3928         * dom/ClassCollection.h:
3929         * dom/DOMImplementation.cpp:
3930         * dom/DOMImplementation.h:
3931         (WebCore::DOMImplementation::ref): Deleted.
3932         (WebCore::DOMImplementation::deref): Deleted.
3933         (WebCore::DOMImplementation::document): Deleted.
3934         (WebCore::DOMImplementation::hasFeature): Deleted.
3935         * dom/DOMPoint.h:
3936         * dom/DOMPointReadOnly.cpp:
3937         * dom/DOMPointReadOnly.h:
3938         * dom/DOMQuad.cpp:
3939         * dom/DOMQuad.h:
3940         * dom/DOMRect.h:
3941         * dom/DOMRectReadOnly.cpp: Copied from Source/WebCore/dom/DOMPointReadOnly.cpp.
3942         * dom/DOMRectReadOnly.h:
3943         * dom/DataTransferItemList.cpp:
3944         * dom/DataTransferItemList.h:
3945         (WebCore::DataTransferItemList::ref): Deleted.
3946         (WebCore::DataTransferItemList::deref): Deleted.
3947         (WebCore::DataTransferItemList::dataTransfer): Deleted.
3948         (WebCore::DataTransferItemList::hasItems const): Deleted.
3949         (WebCore::DataTransferItemList::items const): Deleted.
3950         * dom/DatasetDOMStringMap.cpp:
3951         * dom/DatasetDOMStringMap.h:
3952         * dom/DocumentParser.h:
3953         * dom/EventTarget.cpp:
3954         * dom/EventTarget.h:
3955         * dom/LiveNodeList.cpp:
3956         * dom/LiveNodeList.h:
3957         * dom/MessageChannel.cpp:
3958         * dom/MessagePort.cpp:
3959         * dom/MessagePort.h:
3960         * dom/NameNodeList.cpp:
3961         * dom/NameNodeList.h:
3962         * dom/NamedNodeMap.cpp:
3963         * dom/NamedNodeMap.h:
3964         (WebCore::NamedNodeMap::NamedNodeMap): Deleted.
3965         (WebCore::NamedNodeMap::element): Deleted.
3966         * dom/NodeIterator.cpp:
3967         * dom/NodeIterator.h:
3968         (WebCore::NodeIterator::detach): Deleted.
3969         (WebCore::NodeIterator::referenceNode const): Deleted.
3970         (WebCore::NodeIterator::pointerBeforeReferenceNode const): Deleted.
3971         * dom/NodeList.cpp: Copied from Source/WebCore/xml/XMLHttpRequestEventTarget.h.
3972         * dom/NodeList.h:
3973         * dom/NodeRareData.cpp:
3974         * dom/ScriptExecutionContext.cpp:
3975         * dom/SimulatedClick.cpp:
3976         * dom/StaticNodeList.cpp:
3977         * dom/StaticNodeList.h:
3978         * dom/TagCollection.cpp:
3979         * dom/TagCollection.h:
3980         * dom/TreeWalker.cpp:
3981         * dom/TreeWalker.h:
3982         (WebCore::TreeWalker::create): Deleted.
3983         (WebCore::TreeWalker::currentNode): Deleted.
3984         (WebCore::TreeWalker::currentNode const): Deleted.
3985         * fileapi/Blob.cpp:
3986         * fileapi/Blob.h:
3987         * fileapi/File.cpp:
3988         * fileapi/File.h:
3989         * fileapi/FileList.cpp:
3990         * fileapi/FileList.h:
3991         (WebCore::FileList::create): Deleted.
3992         (WebCore::FileList::length const): Deleted.
3993         (WebCore::FileList::isEmpty const): Deleted.
3994         (WebCore::FileList::files const): Deleted.
3995         (WebCore::FileList::file const): Deleted.
3996         (WebCore::FileList::FileList): Deleted.
3997         (WebCore::FileList::append): Deleted.
3998         (WebCore::FileList::clear): Deleted.
3999         * fileapi/FileReader.cpp:
4000         * fileapi/FileReader.h:
4001         * html/CachedHTMLCollection.h:
4002         * html/GenericCachedHTMLCollection.cpp:
4003         * html/GenericCachedHTMLCollection.h:
4004         * html/HTMLAllCollection.cpp:
4005         * html/HTMLAllCollection.h:
4006         * html/HTMLCollection.cpp: