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