Delay initialization of quota users until the first quota request
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-04-10  Youenn Fablet  <youenn@apple.com>
2
3         Delay initialization of quota users until the first quota request
4         https://bugs.webkit.org/show_bug.cgi?id=196467
5
6         Reviewed by Chris Dumez.
7
8         Instead of triggering initialization of each user when being added,
9         delay initialization until the first call to requestSpace with a non zero task size.
10         This will make sure we do not load Cache API information in memory or check for
11         IDB space until actually necessary.
12
13         To implement that, move from a HashSet of being initialized users to a HashMap where the key is user and
14         the value is the user initialization state.
15
16         When removing a user, delay the call to processPendingRequest so that a synchronous call to addUser
17         can be taken into consideration.
18
19         This unflakes some Cache API tests as these tests do clear the Cache API and check for the clearing result.
20         Clearing the caches triggers a removeUser/addUser dance which then triggers initialization of the Caches structure.
21
22         Covered by existing tests.
23
24         * storage/StorageQuotaManager.cpp:
25         (WebCore::StorageQuotaManager::initializeUsersIfNeeded):
26         (WebCore::StorageQuotaManager::askUserToInitialize):
27         (WebCore::StorageQuotaManager::addUser):
28         (WebCore::StorageQuotaManager::requestSpace):
29         * storage/StorageQuotaManager.h:
30
31 2019-04-10  Philippe Normand  <pnormand@igalia.com>
32
33         there is no vp8 support in youtube.com/html5 page with libwebkit2gtk 2.24 (MSE enabled)
34         https://bugs.webkit.org/show_bug.cgi?id=196615
35
36         Reviewed by Xabier Rodriguez-Calvar.
37
38         Add vp8.0 and vp9.0 in supported mime-types if the corresponding video decoders are found.
39
40         No new tests, existing web-platform-tests cover this change.
41
42         * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
43         (WebCore::GStreamerRegistryScanner::initialize):
44
45 2019-04-10  Philippe Normand  <pnormand@igalia.com>
46
47         [GStreamer] Adaptive streaming playback broken with GStreamer < 1.12
48         https://bugs.webkit.org/show_bug.cgi?id=196765
49
50         Reviewed by Xabier Rodriguez-Calvar.
51
52         Without the following patch in gst-plugins-bad, the uridownloader
53         doesn't relay need-context messages to its parent, so in our case
54         the player can't share its context with secondary webkitwebsrc
55         elements and a RELEASE_ASSERT is hit in the WebProcess.
56
57         So the workaround is to use again webkit+ protocol prefixes for
58         GStreamer versions older than 1.12.
59
60         https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/commit/8cf858fb27919e1d631223375f81b98055623733
61
62         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
63         (WebCore::convertToInternalProtocol):
64         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
65         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
66         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
67         (WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const):
68         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
69         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
70         (webKitWebSrcStart):
71         (webKitWebSrcGetProtocols):
72         (convertPlaybinURI):
73         (webKitWebSrcSetUri):
74         (CachedResourceStreamingClient::responseReceived):
75         (webKitSrcWouldTaintOrigin):
76         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
77
78 2019-04-10  Carlos Garcia Campos  <cgarcia@igalia.com>
79
80         [ATK] Defer the emision of AtkObject::children-changed signal after layout is done
81         https://bugs.webkit.org/show_bug.cgi?id=187948
82
83         Reviewed by Michael Catanzaro.
84
85         The signal AtkObject::children-changed is emitted from AXObjectCache::attachWrapper() and
86         AXObjectCache::detachWrapper(). Both can be called in the middle of a layout, so we need to defer the emission
87         of the signal after the layout is done, to avoid other atk entry points from being called at that point, since
88         most of them update the backing store at the beginning.
89
90         Fixes: accessibility/children-changed-sends-notification.html
91
92         * accessibility/AXObjectCache.cpp:
93         (WebCore::AXObjectCache::performDeferredCacheUpdate): Call platformPerformDeferredCacheUpdate().
94         * accessibility/AXObjectCache.h:
95         * accessibility/atk/AXObjectCacheAtk.cpp:
96         (WebCore::wrapperParent): Helper to get the AtkObject parent of a given WebKitAccessible.
97         (WebCore::AXObjectCache::detachWrapper): Add wrapper to m_deferredDetachedWrapperList.
98         (WebCore::AXObjectCache::attachWrapper): Add object to m_deferredAttachedWrapperObjectList.
99         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate): Emit AtkObject::children-changed::add for objects
100         in m_deferredAttachedWrapperObjectList and AtkObject::children-changed::remove for wrappers in m_deferredDetachedWrapperList.
101         * accessibility/ios/AXObjectCacheIOS.mm:
102         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
103         * accessibility/mac/AXObjectCacheMac.mm:
104         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
105         * accessibility/win/AXObjectCacheWin.cpp:
106         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
107         * accessibility/wpe/AXObjectCacheWPE.cpp:
108         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
109
110 2019-04-10  Carlos Garcia Campos  <cgarcia@igalia.com>
111
112         [ATK] Test accessibility/insert-children-assert.html is crashing since added in r216980
113         https://bugs.webkit.org/show_bug.cgi?id=172281
114         <rdar://problem/37030990>
115
116         Reviewed by Joanmarie Diggs.
117
118         The crash happens because at some point the test tries to get the anonymous block text, getting the RenderText as
119         first child and RenderFullScreen as last child and the latter doesn't have a node. This is because in atk we do
120         things differently, we don't include the static text elements individually, but parent element uses
121         textUnderElement() to get all the pieces together. We can just turn the asserts into actual nullptr checks.
122
123         Fixes: accessibility/insert-children-assert.html
124
125         * accessibility/AccessibilityRenderObject.cpp:
126         (WebCore::AccessibilityRenderObject::textUnderElement const):
127
128 2019-04-09  Keith Rollin  <krollin@apple.com>
129
130         Unreviewed build maintenance -- update .xcfilelists.
131
132         * DerivedSources-input.xcfilelist:
133         * DerivedSources-output.xcfilelist:
134
135 2019-04-09  Zalan Bujtas  <zalan@apple.com>
136
137         [AutoSizing] Avoid making text paragraphs scroll horizontally when there is a wide table
138         https://bugs.webkit.org/show_bug.cgi?id=196743
139         <rdar://problem/43897551>
140
141         Reviewed by Tim Horton.
142
143         This patch changes the auto size behavior by using fixed constraint (instead of a min/max pair) to compute the content height.
144         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
145         and triggers scrolling the same way the non-auto-sizing mode does.
146
147         * page/FrameView.cpp:
148         (WebCore::FrameView::autoSizeIfEnabled):
149         (WebCore::FrameView::enableAutoSizeMode):
150         * page/FrameView.h:
151         * testing/Internals.cpp:
152         (WebCore::Internals::enableAutoSizeMode):
153         * testing/Internals.h:
154         * testing/Internals.idl:
155
156 2019-04-09  Youenn Fablet  <youenn@apple.com>
157
158         Close service worker database on network process suspension
159         https://bugs.webkit.org/show_bug.cgi?id=196623
160         <rdar://problem/48930869>
161
162         Reviewed by Alex Christensen.
163
164         Add suspend/resume support to SWServer.
165         On suspend, close the service worker database and stop pushing for changes.
166         On resume, push changes if needed.
167
168         * workers/service/server/RegistrationDatabase.cpp:
169         (WebCore::RegistrationDatabase::close):
170         * workers/service/server/RegistrationDatabase.h:
171         (WebCore::RegistrationDatabase::isClosed const): Deleted.
172         * workers/service/server/RegistrationStore.cpp:
173         (WebCore::RegistrationStore::closeDatabase):
174         * workers/service/server/RegistrationStore.cpp:
175         (WebCore::RegistrationStore::pushChangesToDatabase):
176         (WebCore::RegistrationStore::clearAll):
177         (WebCore::RegistrationStore::startSuspension):
178         (WebCore::RegistrationStore::endSuspension):
179         * workers/service/server/RegistrationStore.h:
180         * workers/service/server/SWServer.cpp:
181         (WebCore::SWServer::startSuspension):
182         (WebCore::SWServer::endSuspension):
183         * workers/service/server/SWServer.h:
184
185 2019-04-09  Justin Fan  <justin_fan@apple.com>
186
187         [Web GPU] GPURenderPassEncoder updates: setBlendColor, setViewport, setScissorRect
188         https://bugs.webkit.org/show_bug.cgi?id=196719
189
190         Reviewed by Myles C. Maxfield.
191
192         Implement setBlendColor, setViewport, and setScissorRect for GPURenderPassEncoder.
193
194         Tests: webgpu/viewport-scissor-rect-triangle-strip.html, webgpu/blend-color-triangle-strip.html
195
196         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
197         (WebCore::WebGPURenderPassEncoder::setBlendColor):
198         (WebCore::WebGPURenderPassEncoder::setViewport):
199         (WebCore::WebGPURenderPassEncoder::setScissorRect):
200         * Modules/webgpu/WebGPURenderPassEncoder.h:
201         * Modules/webgpu/WebGPURenderPassEncoder.idl:
202         * platform/graphics/gpu/GPURenderPassEncoder.h:
203         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
204         (WebCore::GPURenderPassEncoder::setBlendColor):
205         (WebCore::GPURenderPassEncoder::setViewport):
206         (WebCore::GPURenderPassEncoder::setScissorRect):
207
208 2019-04-09  Andy Estes  <aestes@apple.com>
209
210         [Apple Pay] Add release logging to PaymentCoordinator
211         https://bugs.webkit.org/show_bug.cgi?id=196738
212
213         Reviewed by Alex Christensen.
214
215         When allowed, log interactions with PaymentCoordinator to os_log to help diagnose Apple Pay bugs.
216
217         The following information might be logged: names of functions called, merchant API versions,
218         boolean results of canMakePayments(), boolean results of beginPaymentSession(), whether
219         completePaymentSession() was called with a final state result, boolean results of
220         shouldAllowApplePay(), whether a document has evaluated user agent scripts or is running
221         user scripts, and whether a client supports unrestricted Apple Pay.
222
223         * Modules/applepay/PaymentCoordinator.cpp:
224         (WebCore::PaymentCoordinator::supportsVersion const):
225         (WebCore::PaymentCoordinator::canMakePayments):
226         (WebCore::PaymentCoordinator::canMakePaymentsWithActiveCard):
227         (WebCore::PaymentCoordinator::openPaymentSetup):
228         (WebCore::PaymentCoordinator::beginPaymentSession):
229         (WebCore::PaymentCoordinator::completeMerchantValidation):
230         (WebCore::PaymentCoordinator::completeShippingMethodSelection):
231         (WebCore::PaymentCoordinator::completeShippingContactSelection):
232         (WebCore::PaymentCoordinator::completePaymentMethodSelection):
233         (WebCore::PaymentCoordinator::completePaymentSession):
234         (WebCore::PaymentCoordinator::abortPaymentSession):
235         (WebCore::PaymentCoordinator::cancelPaymentSession):
236         (WebCore::PaymentCoordinator::validateMerchant):
237         (WebCore::PaymentCoordinator::didAuthorizePayment):
238         (WebCore::PaymentCoordinator::didSelectPaymentMethod):
239         (WebCore::PaymentCoordinator::didSelectShippingMethod):
240         (WebCore::PaymentCoordinator::didSelectShippingContact):
241         (WebCore::PaymentCoordinator::didCancelPaymentSession):
242         (WebCore::PaymentCoordinator::shouldAllowApplePay const):
243         (WebCore::PaymentCoordinator::shouldAllowUserAgentScripts const):
244         * Modules/applepay/PaymentCoordinatorClient.h:
245         (WebCore::PaymentCoordinatorClient::isAlwaysOnLoggingAllowed const):
246         * platform/Logging.h:
247         * testing/MockPaymentCoordinator.h:
248
249 2019-04-09  John Wilander  <wilander@apple.com>
250
251         Pick up Ad Click Attribution conversions in NetworkResourceLoader::willSendRedirectedRequest()
252         https://bugs.webkit.org/show_bug.cgi?id=196558
253         <rdar://problem/47650245>
254
255         Reviewed by Youenn Fablet.
256
257         Tests: http/tests/adClickAttribution/attribution-conversion-through-cross-site-image-redirect.html
258                http/tests/adClickAttribution/attribution-conversion-through-image-redirect-with-priority.html
259                http/tests/adClickAttribution/attribution-conversion-through-image-redirect-without-priority.html
260
261         The existing API tests were expanded too.
262
263         * html/HTMLAnchorElement.cpp:
264         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
265            Enhanced the use of AdClickAttribution::MaxEntropy.
266         * loader/AdClickAttribution.cpp:
267         (WebCore::AdClickAttribution::parseConversionRequest):
268             New function to parse and validate URLs with a path starting with
269             /.well-known/ad-click-attribution/.
270         (WebCore::AdClickAttribution::toString const):
271             Added output for the conversion priority for testing purposes.
272         * loader/AdClickAttribution.h:
273         (WebCore::AdClickAttribution::Campaign::isValid const):
274         (WebCore::AdClickAttribution::Conversion::isValid const):
275            Enhanced the use of AdClickAttribution::MaxEntropy.
276
277 2019-04-09  Don Olmstead  <don.olmstead@sony.com>
278
279         [CMake] Apple builds should use ICU_INCLUDE_DIRS
280         https://bugs.webkit.org/show_bug.cgi?id=196720
281
282         Reviewed by Konstantin Tokarev.
283
284         * PlatformMac.cmake:
285
286 2019-04-09  Jer Noble  <jer.noble@apple.com>
287
288         Test for: 196095 Inband Text Track cues interspersed with Data cues can display out of order.
289         https://bugs.webkit.org/show_bug.cgi?id=196097
290
291         Reviewed by Eric Carlson.
292
293         Test: media/track/track-in-band-metadata-display-order.html
294
295         Add a method in Internals to create a TextTrackCueGeneric (which can normally only be created
296         by parsing an in-band media track). This requires adding IDL for TextTrackCueGeneric, and exporting
297         TextTrackCueGeneric for testing.
298
299         Drive-by fixes:
300
301         Add runtime logging to MediaControlTextTrackContainerElement. This necessitates modifying the
302         parentMediaElement() method to take a const Node*, and const_cast that constness away in order to return
303         a HTMLMediaElement*
304
305         TextTrackCue, VTTCue, TextTrackCueGeneric, and DataCue should all use the WTF TypeCasts macros to
306         enable use of is<> and downcast<>.
307
308         * Source/WebCore/CMakeLists.txt:
309         * DerivedSources-input.xcfilelist:
310         * DerivedSources-output.xcfilelist:
311         * DerivedSources.make:
312         * WebCore.xcodeproj/project.pbxproj:
313         * Sources.txt:
314         * html/shadow/MediaControlElementTypes.cpp:
315         (WebCore::parentMediaElement):
316         * html/shadow/MediaControlElementTypes.h:
317         * html/shadow/MediaControlElements.cpp:
318         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
319         (WebCore::MediaControlTextTrackContainerElement::logger const):
320         (WebCore::MediaControlTextTrackContainerElement::logIdentifier const):
321         (WebCore::MediaControlTextTrackContainerElement::logChannel const):
322         * html/shadow/MediaControlElements.h:
323         * html/track/DataCue.h:
324         (isType):
325         * html/track/TextTrackCueGeneric.h:
326         (isType):
327         * html/track/TextTrackCueGeneric.idl: Added.
328         * html/track/VTTCue.h:
329         (isType):
330         * testing/Internals.cpp:
331         (WebCore::Internals::createGenericCue):
332         * testing/Internals.h:
333         * testing/Internals.idl:
334
335 2019-04-09  Sihui Liu  <sihui_liu@apple.com>
336
337         Remove unnecessary network process assertion for IDB close
338         https://bugs.webkit.org/show_bug.cgi?id=196693
339
340         Reviewed by Geoffrey Garen.
341
342         We already took assertion at WebCore::SQLiteDatabase::close.
343
344         * Modules/indexeddb/server/IDBServer.cpp:
345         (WebCore::IDBServer::IDBServer::create):
346         (WebCore::IDBServer::IDBServer::IDBServer):
347         (WebCore::IDBServer::m_quotaManagerGetter): Deleted.
348         (WebCore::IDBServer::IDBServer::closeDatabase): Deleted.
349         (WebCore::IDBServer::IDBServer::didCloseDatabase): Deleted.
350         * Modules/indexeddb/server/IDBServer.h:
351         (WebCore::IDBServer::IDBServer::create): Deleted.
352         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
353         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
354         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
355         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
356         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
357         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
358         (WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose): Deleted.
359         * Modules/indexeddb/server/UniqueIDBDatabase.h:
360
361 2019-04-09  Eike Rathke  <erack@redhat.com>
362
363         Initialize trackTypeAsString for call to GST_INFO_OBJECT() in TrackType::Text
364         https://bugs.webkit.org/show_bug.cgi?id=196350
365
366         Reviewed by Xabier Rodriguez-Calvar.
367
368         trackTypeAsString was uninitialized in the
369         TrackPrivateBaseGStreamer::TrackType::Text case when calling
370         GST_INFO_OBJECT().
371
372         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
373         (WebCore::MediaPlayerPrivateGStreamer::enableTrack):
374
375 2019-04-09  Carlos Garcia Campos  <cgarcia@igalia.com>
376
377         [ATK] Cleanup WebKitAccessibleHyperlink
378         https://bugs.webkit.org/show_bug.cgi?id=196602
379
380         Reviewed by Michael Catanzaro.
381
382         Cleanups:
383
384          - Rename webkitAccessibleHyperlinkNew() as webkitAccessibleHyperlinkGetOrCreate() and move the code to get/set
385            the object data here.
386          - Use WEBKIT_DEFINE_TYPE instead of custom type registration. This ensures that all CStrings used in private
387            struct are no longer leaked.
388          - Remove all confusing core() functions and simply use webkitAccessibleGetAccessibilityObject().
389          - Use nullptr instead of 0 and other coding style issues.
390
391         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
392         (webkitAccessibleHyperlinkActionDoAction):
393         (webkitAccessibleHyperlinkActionGetNActions):
394         (webkitAccessibleHyperlinkActionGetDescription):
395         (webkitAccessibleHyperlinkActionGetKeybinding):
396         (webkitAccessibleHyperlinkActionGetName):
397         (atk_action_interface_init):
398         (webkitAccessibleHyperlinkGetURI):
399         (webkitAccessibleHyperlinkGetObject):
400         (rangeLengthForObject):
401         (webkitAccessibleHyperlinkGetStartIndex):
402         (webkitAccessibleHyperlinkGetEndIndex):
403         (webkitAccessibleHyperlinkIsValid):
404         (webkitAccessibleHyperlinkGetNAnchors):
405         (webkitAccessibleHyperlinkIsSelectedLink):
406         (webkitAccessibleHyperlinkGetProperty):
407         (webkitAccessibleHyperlinkSetProperty):
408         (webkit_accessible_hyperlink_class_init):
409         (webkitAccessibleHyperlinkGetOrCreate):
410         (core): Deleted.
411         (atkActionInterfaceInit): Deleted.
412         (getRangeLengthForObject): Deleted.
413         (webkitAccessibleHyperlinkFinalize): Deleted.
414         (webkitAccessibleHyperlinkClassInit): Deleted.
415         (webkitAccessibleHyperlinkInit): Deleted.
416         (webkitAccessibleHyperlinkGetType): Deleted.
417         (webkitAccessibleHyperlinkNew): Deleted.
418         (webkitAccessibleHyperlinkGetAccessibilityObject): Deleted.
419         * accessibility/atk/WebKitAccessibleHyperlink.h:
420         * accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp:
421         (webkitAccessibleHyperlinkImplGetHyperlink):
422         (webkitAccessibleHyperlinkImplInterfaceInit):
423
424 2019-04-08  Simon Fraser  <simon.fraser@apple.com>
425
426         Remove some iOS #ifdefs around sticky-related code
427         https://bugs.webkit.org/show_bug.cgi?id=196726
428
429         Reviewed by Zalan Bujtas.
430
431         Now that async overflow scrolling can be enabled on macOS, RenderLayerCompositor::isAsyncScrollableStickyLayer()
432         should not have iOS-only code.
433
434         The answer to the FIXME in RenderLayerCompositor::computeStickyViewportConstraints is obvious: composited
435         overflow:scroll can be the container for sticky. The assertion can be removed.
436
437         * rendering/RenderLayer.cpp: Fix spacing in some logging.
438         (WebCore::outputPaintOrderTreeRecursive):
439         * rendering/RenderLayerCompositor.cpp:
440         (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const):
441         (WebCore::RenderLayerCompositor::computeStickyViewportConstraints const):
442
443 2019-04-08  Don Olmstead  <don.olmstead@sony.com>
444
445         [CMake][WinCairo] Separate copied headers into different directories
446         https://bugs.webkit.org/show_bug.cgi?id=196655
447
448         Reviewed by Michael Catanzaro.
449
450         * CMakeLists.txt:
451         * PlatformWin.cmake:
452
453 2019-04-08  Chris Fleizach  <cfleizach@apple.com>
454
455         AX: Automatically compute accessibility labels for Apple Pay buttons
456         https://bugs.webkit.org/show_bug.cgi?id=196661
457
458         Reviewed by Joanmarie Diggs.
459
460         Detect Apple Pay buttons and return a standard role and label for them based on their type.
461
462         Test: accessibility/mac/apple-pay-labels.html
463               accessibility/mac/apple-pay-session-v4.html
464
465         * accessibility/AccessibilityNodeObject.cpp:
466         (WebCore::AccessibilityNodeObject::isControl const):
467         * accessibility/AccessibilityNodeObject.h:
468         * accessibility/AccessibilityRenderObject.cpp:
469         (WebCore::AccessibilityRenderObject::applePayButtonDescription const):
470         (WebCore::AccessibilityRenderObject::titleElementText const):
471         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
472         (WebCore::AccessibilityRenderObject::isApplePayButton const):
473         (WebCore::AccessibilityRenderObject::applePayButtonType const):
474         * accessibility/AccessibilityRenderObject.h:
475         * en.lproj/Localizable.strings:
476         * platform/LocalizedStrings.cpp:
477         (WebCore::AXApplePayPlainLabel):
478         (WebCore::AXApplePayBuyLabel):
479         (WebCore::AXApplePaySetupLabel):
480         (WebCore::AXApplePayDonateLabel):
481         (WebCore::AXApplePayCheckOutLabel):
482         (WebCore::AXApplePayBookLabel):
483         (WebCore::AXApplePaySubscribeLabel):
484         * platform/LocalizedStrings.h:
485
486 2019-04-08  Chris Fleizach  <cfleizach@apple.com>
487
488         AX: Support API: accessibilityReplaceRange:withText
489         https://bugs.webkit.org/show_bug.cgi?id=196636
490
491         Reviewed by Daniel Bates.
492
493         Support this platform API on mac to provide a way to replace a range of editable text.
494
495         Test: accessibility/mac/replace-text-with-range.html
496
497         * accessibility/AccessibilityObject.cpp:
498         (WebCore::AccessibilityObject::replaceTextInRange):
499         * accessibility/AccessibilityObject.h:
500         * accessibility/mac/AccessibilityObjectBase.mm:
501         (WebCore::PlainTextRange::PlainTextRange):
502         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
503         (-[WebAccessibilityObjectWrapper accessibilityReplaceRange:withText:]):
504
505 2019-04-08  Wenson Hsieh  <wenson_hsieh@apple.com>
506
507         [iOS] Do not allow starting selection drags when selection views are not visible
508         https://bugs.webkit.org/show_bug.cgi?id=196686
509         <rdar://problem/49399192>
510
511         Reviewed by Tim Horton.
512
513         See WebKit ChangeLog for more details.
514
515         Tests:  DragAndDropTests.CanDragImageWhenNotFirstResponder
516                 DragAndDropTests.DoNotPerformSelectionDragWhenNotFirstResponder
517
518         * page/DragController.cpp:
519         (WebCore::DragController::draggableElement const):
520
521         Make this respect the case where m_dragSourceAction does not include DragSourceActionSelection. All the other
522         drag source types are currently consulted in this method, with the exception of DragSourceActionSelection.
523
524 2019-04-08  Youenn Fablet  <youenn@apple.com>
525
526         Add a test to check for the service worker process name
527         https://bugs.webkit.org/show_bug.cgi?id=196621
528
529         Reviewed by Chris Dumez.
530
531         Add a service worker internal API to get process name.
532         Covered by updated test.
533
534         * WebCore.xcodeproj/project.pbxproj:
535         * testing/ServiceWorkerInternals.cpp:
536         (WebCore::ServiceWorkerInternals::processName const):
537         * testing/ServiceWorkerInternals.h:
538         * testing/ServiceWorkerInternals.idl:
539         * testing/ServiceWorkerInternals.mm: Added.
540
541 2019-04-08  Yusuke Suzuki  <ysuzuki@apple.com>
542
543         Unreviewed, speculative fix for build failure in old macOS after r243887
544         https://bugs.webkit.org/show_bug.cgi?id=196475
545
546         * dom/NodeList.h:
547
548 2019-04-08  Justin Fan  <justin_fan@apple.com>
549
550         [Web GPU] Fix Web GPU experimental feature on iOS
551         https://bugs.webkit.org/show_bug.cgi?id=196632
552
553         Reviewed by Myles C. Maxfield.
554
555         Add feature conditionals for iOS 11.
556         Properly make Web GPU available on iOS 11+.
557
558         * Configurations/FeatureDefines.xcconfig:
559         * Configurations/WebKitTargetConditionals.xcconfig:
560
561 2019-04-08  Timothy Hatcher  <timothy@apple.com>
562
563         Unreviewed build fix for iOSMac after r243893.
564         https://bugs.webkit.org/show_bug.cgi?id=196707
565
566         * dom/Element.cpp:
567         (WebCore::parentCrossingFrameBoundaries): Remove ENABLE(POINTER_EVENTS) since computedTouchActions()
568         no longer uses parentCrossingFrameBoundaries().
569
570 2019-04-08  Youenn Fablet  <youenn@apple.com>
571
572         Lazily construct Navigator serviceWorker
573         https://bugs.webkit.org/show_bug.cgi?id=196692
574
575         Reviewed by Chris Dumez.
576
577         Make NavigatorBase a ContextDestructionObserver.
578         This allows to get the navigator script execution context.
579         Use it when creating the navigator ServiceWorkerContainer object.
580         For GC, introduce serviceWorkerIfAny which returns the container if created.
581         No JS observable change of behavior.
582         Covered by existing tests.
583
584         * bindings/js/JSNavigatorCustom.cpp:
585         (WebCore::JSNavigator::visitAdditionalChildren):
586         * bindings/js/JSWorkerNavigatorCustom.cpp:
587         (WebCore::JSWorkerNavigator::visitAdditionalChildren):
588         * page/NavigatorBase.cpp:
589         (WebCore::NavigatorBase::NavigatorBase):
590         (WebCore::NavigatorBase::serviceWorkerIfAny):
591         (WebCore::NavigatorBase::serviceWorker):
592         * page/NavigatorBase.h:
593
594 2019-04-08  Antti Koivisto  <antti@apple.com>
595
596         Update touch-action region on property changes
597         https://bugs.webkit.org/show_bug.cgi?id=196608
598
599         Reviewed by Simon Fraser.
600
601         Test: pointerevents/ios/touch-action-region-dynamic.html
602
603         * rendering/EventRegion.cpp:
604         (WebCore::EventRegion::touchActionsForPoint const):
605
606         Correctly return 'auto' when nothing is found from the regions (this code is not used yet).
607
608         * rendering/RenderElement.cpp:
609         (WebCore::RenderElement::styleWillChange):
610
611         React to 'touch-action' property changes, similarly to 'pointer-events'.
612
613         * rendering/RenderLayer.cpp:
614         (WebCore::RenderLayer::invalidateEventRegion):
615
616         Test if need to invalidate.
617
618         * rendering/RenderLayerBacking.cpp:
619         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
620         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
621
622         Call invalidateEventRegion explicitly instead of relying on compositing update. This ensures
623         that we update the top level event region correctly when we have touch-actions.
624
625 2019-04-08  Javier Fernandez  <jfernandez@igalia.com>
626
627         Implement white-space:break-spaces value
628         https://bugs.webkit.org/show_bug.cgi?id=177327
629
630         Reviewed by Myles Maxfield and Zalan Bujtas.
631
632         Finally the CSS WG decided [1] to move back the 'break-spaces' value to
633         the 'white-space' property. This makes the parsing logic easier than
634         the previous approach of using the 'overflow-wrap' property.
635
636         This new value prevents the white-space sequence to collapse and gives
637         breaking opportunities after every preserved white-space.
638
639         https://drafts.csswg.org/css-text-3/#valdef-white-space-break-spaces
640
641         Additionally, unlike 'pre-wrap', non-collapsible spaces or tabs at the
642         end of a line cannot be hung or visually collapsed, since we want them
643         to be preserved and broken.
644
645         [1] https://github.com/w3c/csswg-drafts/pull/2841
646
647         Tests: imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-008.html
648                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-003.html
649                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-009.html
650
651         * css/CSSPrimitiveValueMappings.h:
652         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): New mapping for CSSVaueBreakSpaces.
653         (WebCore::CSSPrimitiveValue::operator WhiteSpace const): New value BreakSpaces for the Whitespace enum.
654         * css/CSSProperties.json: new 'break-spaces' value for the 'white-space' property.
655         * css/CSSValueKeywords.in: new break-spaces keyword
656         * css/parser/CSSParserFastPaths.cpp:
657         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
658         * rendering/SimpleLineLayout.cpp:  The SimpleLineLayut codepath must handle properly the new behavior of preserved whitespaces.
659         (WebCore::SimpleLineLayout::LineState::hasTrailingWhitespace const): Require that m_trailingWhitespaceWidth being greater than zero.
660         (WebCore::SimpleLineLayout::LineState::hasWhitespaceFragments const): New function to detect former whitespae fragments that could be breaking opportunities.
661         (WebCore::SimpleLineLayout::removeTrailingWhitespace): The 'break-spaces' feature forbids to remove any trailing whitespace.
662         (WebCore::SimpleLineLayout::firstFragment): We have now leading whitespace sequences comming from the previous line.
663         (WebCore::SimpleLineLayout::createLineRuns): We should revert some breaking opportunities if others were formerly found in the line.
664         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
665         (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.
666         * rendering/SimpleLineLayoutTextFragmentIterator.h:
667         * rendering/line/BreakingContext.h: Different codepath but similar changes to properly handle the new behavior of preserved whitespace.
668         (WebCore::BreakingContext::BreakingContext): New class field to determine whether there are some whitespace that may prevent the word ot be broken.
669         (WebCore::BreakingContext::handleText): New line-breaking logic to implement the break-spaces behavior.
670         (WebCore::BreakingContext::trailingSpacesHang): Cases where the preserved breakspaces should hand or overflow.
671         * rendering/style/RenderStyle.h:
672         (WebCore::RenderStyle::collapseWhiteSpace): With break-spaces collapsing whitespaces is not allowed.
673         (WebCore::RenderStyle::breakOnlyAfterWhiteSpace const): Add the WhiteSpace::BreakSpaces to this group.
674         * rendering/style/RenderStyleConstants.h: A new constan added.
675
676 2019-04-08  Youenn Fablet  <youenn@apple.com>
677
678         LibWebRTCMediaEndpoint does not need to hop to the signaling thread to gather stats
679         https://bugs.webkit.org/show_bug.cgi?id=196697
680         <rdar://problem/47477113>
681
682         Reviewed by Eric Carlson.
683
684         It is not thread safe to use m_backend in another thread than the main thread.
685         It is not useful anymore to hop to the signaling thread to gather stats.
686         No change of behavior.
687
688         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
689         (WebCore::LibWebRTCMediaEndpoint::getStats):
690         (WebCore::LibWebRTCMediaEndpoint::gatherStatsForLogging):
691
692 2019-04-08  Antoine Quint  <graouts@apple.com>
693
694         [ Mac WK2 iOS Debug ] REGRESSION(r233667) Layout Test imported/w3c/web-platform-tests/web-animations/interfaces/DocumentTimeline/constructor.html is a flaky failure
695         https://bugs.webkit.org/show_bug.cgi?id=195233
696         <rdar://problem/48527231>
697
698         Reviewed by Dean Jackson.
699
700         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.
701
702         * animation/DocumentTimeline.cpp:
703         (WebCore::DocumentTimeline::currentTime):
704
705 2019-04-08  Antoine Quint  <graouts@apple.com>
706
707         [Web Animations] JS wrapper may be deleted while animation is yet to dispatch its finish event
708         https://bugs.webkit.org/show_bug.cgi?id=196118
709         <rdar://problem/46614137>
710
711         Reviewed by Chris Dumez.
712
713         Test: webanimations/js-wrapper-kept-alive.html
714
715         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.
716         We also need to ensure that the new implementation of hasPendingActivity() does not interfere with the ability of pages to enter the page
717         cache when running animations.
718
719         * animation/WebAnimation.cpp:
720         (WebCore::WebAnimation::canSuspendForDocumentSuspension const):
721         (WebCore::WebAnimation::stop):
722         (WebCore::WebAnimation::hasPendingActivity const):
723         * animation/WebAnimation.h:
724
725 2019-04-08  Eric Liang  <ericliang@apple.com>
726
727         AX: <svg> elements with labels and no accessible contents are exposed as empty AXGroups
728         https://bugs.webkit.org/show_bug.cgi?id=156774
729
730         Reviewed by Chris Fleizach.
731
732         Labelled SVGs without accessible descendants are exposed as AXImage rather than groups.
733
734         Unlabelled equivalents are not exposed. Otherwise, SVGs with accessible descendants are exposed as AXGroup. 
735         Also added back functionalities from last patch of determining whether a SVG element should be ignored.
736         
737         Test: accessibility/svg-shape-labelled.html
738
739         * accessibility/AccessibilityRenderObject.cpp:
740         (WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation):
741         * accessibility/AccessibilitySVGElement.cpp:
742         (WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored const):
743
744 2019-04-08  Youenn Fablet  <youenn@apple.com>
745
746         Make sure UniqueIDBDatabaseConnection unregisters itself even if its database is gone
747         https://bugs.webkit.org/show_bug.cgi?id=196651
748
749         Reviewed by Brady Eidson.
750
751         In UniqueIDBDatabase methods, many operations are refing the transaction
752         so that it stays alive until a quota check decision is made.
753         This extends the lifetime of the transaction which may be lasting
754         longer than its database that may be cleared without waiting for the quota check decisions.
755
756         We therefore need to make sure that the transaction is cleaning itself correctly at destruction time.
757
758         Make sure that the transaction is unregistering itself from its IDBServer.
759         To do so, the transaction keeps a weak ref to the IDBServer.
760
761         This is timing sensitive hence difficult to test.
762
763         * Modules/indexeddb/server/IDBServer.h:
764         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
765         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
766         Like done below for UniqueIDBDatabaseConnection::didCommitTransaction,
767         add a check to ensure that either the database is we are in an error case.
768         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
769         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
770         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::~UniqueIDBDatabaseTransaction):
771         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
772
773 2019-04-08  Christopher Reid  <chris.reid@sony.com>
774
775         Undefined Behavior: m_experimentalImageMenuEnabled isn't initialized in HTMLImageElement when SERVICE_CONTROLS is disabled
776         https://bugs.webkit.org/show_bug.cgi?id=196664
777
778         Reviewed by Ross Kirsling.
779
780         No observable change in behavior.
781
782         Initialize m_experimentalImageMenuEnabled regardless of ENABLE(SERVICE_CONTROLS)
783
784         * html/HTMLImageElement.cpp:
785
786 2019-04-08  Ryan Haddad  <ryanhaddad@apple.com>
787
788         Unreviewed, rolling out r243943.
789
790         Caused test262 failures.
791
792         Reverted changeset:
793
794         "[JSC] Filter DontEnum properties in
795         ProxyObject::getOwnPropertyNames()"
796         https://bugs.webkit.org/show_bug.cgi?id=176810
797         https://trac.webkit.org/changeset/243943
798
799 2019-04-05  Sergio Villar Senin  <svillar@igalia.com>
800
801         [GTK][WPE] outlook.live.com displays old-fashioned UI
802         https://bugs.webkit.org/show_bug.cgi?id=196642
803
804         Reviewed by Carlos Garcia Campos.
805
806         The new good looking UI is shown as long as pretend we're a Mac in the UA.
807
808         * platform/UserAgentQuirks.cpp:
809         (WebCore::urlRequiresChromeBrowser):
810
811 2019-04-08  Carlos Garcia Campos  <cgarcia@igalia.com>
812
813         [ATK] Cleanup accessible wrapper base class
814         https://bugs.webkit.org/show_bug.cgi?id=196601
815
816         Reviewed by Mario Sanchez Prada.
817
818         Cleanups:
819
820          - Rename WebKitAccessibleWrapperAtk cpp and header as WebKitAccessible for consistency with the class name.
821          - Use WEBKIT_DEFINE_TYPE instead of custom type registration. This ensures that all CStrings used in private
822            struct are no longer leaked.
823          - Move core object pointer to the private struct.
824          - Remove confusing core() function and simply get the core object from the private struct.
825          - Use nullptr instead of 0 and other coding style issues.
826          - Rename cacheAndReturnAtkProperty as webkitAccessibleCacheAndReturnAtkProperty and use WebKitAccessible as
827            instance parameter.
828          - Make webkitAccessibleGetAccessibilityObject() return a reference, since we use a fallback object on detach it
829            never returns nullptr.
830          - Move objectFocusedAndCaretOffsetUnignored() to WebKitAccessibleUtil.
831
832         * SourcesGTK.txt:
833         * accessibility/atk/AXObjectCacheAtk.cpp:
834         * accessibility/atk/WebKitAccessible.cpp: Renamed from Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp.
835         (webkitAccessibleGetName):
836         (webkitAccessibleGetDescription):
837         (setAtkRelationSetFromCoreObject):
838         (isRootObject):
839         (webkitAccessibleGetParent):
840         (webkitAccessibleGetNChildren):
841         (webkitAccessibleRefChild):
842         (webkitAccessibleGetIndexInParent):
843         (webkitAccessibleGetAttributes):
844         (atkRole):
845         (webkitAccessibleGetRole):
846         (webkitAccessibleRefStateSet):
847         (webkitAccessibleRefRelationSet):
848         (webkitAccessibleInit):
849         (webkitAccessibleGetObjectLocale):
850         (webkit_accessible_class_init):
851         (interfaceMaskFromObject):
852         (uniqueAccessibilityTypeName):
853         (accessibilityTypeFromObject):
854         (webkitAccessibleNew):
855         (webkitAccessibleGetAccessibilityObject):
856         (webkitAccessibleDetach):
857         (webkitAccessibleIsDetached):
858         (webkitAccessibleCacheAndReturnAtkProperty):
859         * accessibility/atk/WebKitAccessible.h: Renamed from Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.h.
860         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
861         (core):
862         * accessibility/atk/WebKitAccessibleInterfaceAction.cpp:
863         (core):
864         (webkitAccessibleActionGetKeybinding):
865         (webkitAccessibleActionGetName):
866         * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
867         (core):
868         * accessibility/atk/WebKitAccessibleInterfaceDocument.cpp:
869         (core):
870         (documentAttributeValue):
871         * accessibility/atk/WebKitAccessibleInterfaceEditableText.cpp:
872         (core):
873         * accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp:
874         (core):
875         * accessibility/atk/WebKitAccessibleInterfaceImage.cpp:
876         (core):
877         (webkitAccessibleImageGetImageDescription):
878         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
879         (core):
880         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
881         (core):
882         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
883         (core):
884         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
885         (core):
886         * accessibility/atk/WebKitAccessibleInterfaceValue.cpp:
887         (core):
888         * accessibility/atk/WebKitAccessibleUtil.cpp:
889         (objectFocusedAndCaretOffsetUnignored):
890         * accessibility/atk/WebKitAccessibleUtil.h:
891         * editing/atk/FrameSelectionAtk.cpp:
892
893 2019-04-06  Antti Koivisto  <antti@apple.com>
894
895         Combine event and touch action regions into a single class
896         https://bugs.webkit.org/show_bug.cgi?id=196644
897         <rdar://problem/49643614>
898
899         Reviewed by Darin Adler.
900
901         This patch replaces the existing TouchActionRegion class with the more general EventRegion class.
902         It collects both the overall event region and the touch action regions. This avoids duplication
903         and simplifies the code.
904
905         The patch also adds serialization support for EventRegion, so touch-action regions gets passed
906         to the UI process too.
907
908         * Sources.txt:
909         * WebCore.xcodeproj/project.pbxproj:
910         * platform/graphics/GraphicsLayer.cpp:
911         (WebCore::GraphicsLayer::setEventRegion):
912         (WebCore::GraphicsLayer::dumpProperties const):
913         (WebCore::GraphicsLayer::setTouchActionRegion): Deleted.
914         * platform/graphics/GraphicsLayer.h:
915         (WebCore::GraphicsLayer::eventRegion const):
916         (WebCore::GraphicsLayer::touchActionRegion const): Deleted.
917         * platform/graphics/Region.cpp:
918         (WebCore::operator<<):
919         * platform/graphics/ca/GraphicsLayerCA.cpp:
920         (WebCore::GraphicsLayerCA::setEventRegion):
921         (WebCore::GraphicsLayerCA::setTouchActionRegion): Deleted.
922         * platform/graphics/ca/GraphicsLayerCA.h:
923         * platform/graphics/ca/PlatformCALayer.h:
924         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
925         * rendering/EventRegion.cpp: Copied from Source/WebCore/rendering/TouchActionRegion.cpp.
926         (WebCore::EventRegion::operator== const):
927         (WebCore::EventRegion::unite):
928         (WebCore::EventRegion::translate):
929         (WebCore::EventRegion::uniteTouchActions):
930         (WebCore::EventRegion::touchActionsForPoint const):
931         (WebCore::operator<<):
932         (WebCore::TouchActionRegion::unite): Deleted.
933         (WebCore::TouchActionRegion::actionsForPoint const): Deleted.
934         (WebCore::TouchActionRegion::translate): Deleted.
935         * rendering/EventRegion.h: Copied from Source/WebCore/rendering/TouchActionRegion.h.
936         (WebCore::EventRegion::isEmpty const):
937         (WebCore::EventRegion::contains const):
938         (WebCore::EventRegion::hasTouchActions const):
939         (WebCore::EventRegion::encode const):
940         (WebCore::EventRegion::decode):
941         (WebCore::TouchActionRegion::isEmpty const): Deleted.
942         (WebCore::TouchActionRegion::operator== const): Deleted.
943         * rendering/InlineTextBox.cpp:
944         (WebCore::InlineTextBox::paint):
945         * rendering/PaintInfo.h:
946         * rendering/RenderBlock.cpp:
947         (WebCore::RenderBlock::paintObject):
948         * rendering/RenderLayer.cpp:
949         (WebCore::RenderLayer::collectEventRegionForFragments):
950         * rendering/RenderLayer.h:
951         * rendering/RenderLayerBacking.cpp:
952         (WebCore::RenderLayerBacking::updateEventRegion):
953         * rendering/RenderLayerModelObject.cpp:
954         * rendering/SimpleLineLayoutFunctions.cpp:
955         (WebCore::SimpleLineLayout::paintFlow):
956         * rendering/TouchActionRegion.cpp: Removed.
957         * rendering/TouchActionRegion.h: Removed.
958
959 2019-04-05  Yongjun Zhang  <yongjun_zhang@apple.com>
960
961         We should pass minimumEffectiveDeviceWidth to web process on new page creation.
962         https://bugs.webkit.org/show_bug.cgi?id=196077
963         <rdar://problem/49108202>
964
965         Reviewed by Chris Dumez.
966
967         If the page doesn't specify it requires to use the device width in viewport tag, we should try to scale down
968         the page to fit the window width.
969
970         Test: fast/viewport/ios/shrink-to-fit-for-page-without-viewport-meta.html
971
972         * page/ViewportConfiguration.cpp:
973         (WebCore::ViewportConfiguration::updateDefaultConfiguration): Also update the minimum layout size
974             when the default configuration is changed.
975         (WebCore::ViewportConfiguration::nativeWebpageParametersWithShrinkToFit): Make sure we fit the content
976             to window width.
977
978 2019-04-05  Jer Noble  <jer.noble@apple.com>
979
980         [Cocoa] Deactivate the audio session before the WebProcess suspends.
981         https://bugs.webkit.org/show_bug.cgi?id=196658
982
983         Reviewed by Eric Carlson.
984
985         Test: platform/mac/media/audio-session-deactivated-when-suspended.html
986
987         Deactivate the audio session when we are notified that the session will suspend.
988
989         Drive-by fix: don't try to begin playback when the process is suspended.
990
991         * platform/audio/PlatformMediaSessionManager.cpp:
992         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
993         (WebCore::PlatformMediaSessionManager::processWillSuspend):
994         (WebCore::PlatformMediaSessionManager::processDidResume):
995         * platform/audio/PlatformMediaSessionManager.h:
996         (WebCore::PlatformMediaSessionManager::processIsSuspended const):
997         * testing/InternalSettings.cpp:
998         (WebCore::InternalSettings::Backup::Backup):
999         (WebCore::InternalSettings::Backup::restoreTo):
1000         (WebCore::InternalSettings::setShouldDeactivateAudioSession):
1001         * testing/InternalSettings.h:
1002         * testing/InternalSettings.idl:
1003         * testing/Internals.cpp:
1004         (WebCore::Internals::processWillSuspend):
1005         (WebCore::Internals::processDidResume):
1006         * testing/Internals.h:
1007         * testing/Internals.idl:
1008
1009 2019-04-05  Sihui Liu  <sihui_liu@apple.com>
1010
1011         [iOS] Web process gets suspended while holding locked database files
1012         https://bugs.webkit.org/show_bug.cgi?id=196519
1013         <rdar://problem/49531797>
1014
1015         Reviewed by Chris Dumez.
1016
1017         Don't use DatabaseTracker singleton before it is initialized.
1018
1019         * Modules/webdatabase/DatabaseTracker.cpp:
1020         (WebCore::DatabaseTracker::isInitialized):
1021         * Modules/webdatabase/DatabaseTracker.h:
1022
1023 2019-04-05  Ryosuke Niwa  <rniwa@webkit.org>
1024
1025         Make WeakPtr<Element> possible and deploy it in form associated elements code
1026         https://bugs.webkit.org/show_bug.cgi?id=196626
1027
1028         Reviewed by Antti Koivisto.
1029
1030         Make Element inherit from CanMakeWeakPtr and deploy WeakPtr<*Element> in FormAssociatedElement and HTMLFormElement.
1031
1032         No new tests sine there should be no behavioral change.
1033
1034         * dom/Element.h:
1035         * html/FormAssociatedElement.cpp:
1036         (WebCore::FormAssociatedElement::FormAssociatedElement):
1037         (WebCore::FormAssociatedElement::insertedIntoAncestor):
1038         (WebCore::FormAssociatedElement::setForm):
1039         (WebCore::FormAssociatedElement::resetFormOwner):
1040         (WebCore::FormAssociatedElement::formAttributeChanged):
1041         * html/FormAssociatedElement.h:
1042         (WebCore::FormAssociatedElement::form const):
1043         * html/HTMLElement.cpp:
1044         (WebCore::HTMLElement::asFormNamedItem):
1045         (WebCore::HTMLElement::asFormAssociatedElement):
1046         * html/HTMLElement.h:
1047         (WebCore::HTMLElement::asFormNamedItem): Deleted.
1048         * html/HTMLFormControlElement.h:
1049         * html/HTMLFormControlsCollection.cpp:
1050         (WebCore::HTMLFormControlsCollection::formImageElements const): Inlined into updateNamedElementCache.
1051         (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
1052         * html/HTMLFormControlsCollection.h:
1053         * html/HTMLFormElement.cpp:
1054         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
1055         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
1056         (WebCore::HTMLFormElement::registerImgElement):
1057         (WebCore::HTMLFormElement::defaultButton const):
1058         (WebCore::HTMLFormElement::resetDefaultButton):
1059         (WebCore::HTMLFormElement::matchesValidPseudoClass const):
1060         (WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
1061         * html/HTMLFormElement.h:
1062         * html/HTMLImageElement.cpp:
1063         (WebCore::HTMLImageElement::HTMLImageElement):
1064         (WebCore::HTMLImageElement::insertedIntoAncestor):
1065         * html/HTMLImageElement.h:
1066         * html/HTMLInputElement.h:
1067         * html/HTMLMediaElement.h:
1068         * html/HTMLObjectElement.h:
1069         * html/HTMLPictureElement.h:
1070         * html/HTMLSlotElement.h:
1071         * svg/SVGElement.h:
1072
1073 2019-04-05  Caitlin Potter  <caitp@igalia.com>
1074
1075         [JSC] Filter DontEnum properties in ProxyObject::getOwnPropertyNames()
1076         https://bugs.webkit.org/show_bug.cgi?id=176810
1077
1078         Reviewed by Saam Barati.
1079
1080         Previously, there was a comment here indicating uncertainty of whether it
1081         was necessary to filter DontEnum properties explicitly or not. It turns
1082         out that it was necessary in the case of JSC ProxyObjects.
1083
1084         This patch adds DontEnum filtering for ProxyObjects, however we continue
1085         to explicitly filter them in JSDOMConvertRecord, which needs to use the
1086         property descriptor after filtering. This change prevents observably
1087         fetching the property descriptor twice per property.
1088
1089         * bindings/js/JSDOMConvertRecord.h:
1090
1091 2019-04-05  Michael Catanzaro  <mcatanzaro@igalia.com>
1092
1093         Unreviewed manual rollout of r243929
1094         https://bugs.webkit.org/show_bug.cgi?id=196626
1095
1096         * dom/Element.h:
1097         * html/FormAssociatedElement.cpp:
1098         (WebCore::FormAssociatedElement::FormAssociatedElement):
1099         (WebCore::FormAssociatedElement::insertedIntoAncestor):
1100         (WebCore::FormAssociatedElement::setForm):
1101         (WebCore::FormAssociatedElement::resetFormOwner):
1102         (WebCore::FormAssociatedElement::formAttributeChanged):
1103         * html/FormAssociatedElement.h:
1104         (WebCore::FormAssociatedElement::form const):
1105         * html/HTMLElement.cpp:
1106         (WebCore::HTMLElement::asFormNamedItem): Deleted.
1107         (WebCore::HTMLElement::asFormAssociatedElement): Deleted.
1108         * html/HTMLElement.h:
1109         (WebCore::HTMLElement::asFormNamedItem):
1110         * html/HTMLFormControlElement.h:
1111         * html/HTMLFormControlsCollection.cpp:
1112         (WebCore:: const):
1113         (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
1114         * html/HTMLFormControlsCollection.h:
1115         * html/HTMLFormElement.cpp:
1116         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
1117         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
1118         (WebCore::HTMLFormElement::registerImgElement):
1119         (WebCore::HTMLFormElement::defaultButton const):
1120         (WebCore::HTMLFormElement::resetDefaultButton):
1121         (WebCore::HTMLFormElement::matchesValidPseudoClass const):
1122         (WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
1123         * html/HTMLFormElement.h:
1124         * html/HTMLImageElement.cpp:
1125         (WebCore::HTMLImageElement::HTMLImageElement):
1126         (WebCore::HTMLImageElement::insertedIntoAncestor):
1127         * html/HTMLImageElement.h:
1128         * html/HTMLInputElement.h:
1129         * html/HTMLMediaElement.h:
1130         * html/HTMLObjectElement.h:
1131         * html/HTMLPictureElement.h:
1132         * html/HTMLSlotElement.h:
1133         * svg/SVGElement.h:
1134
1135 2019-04-05  Sihui Liu  <sihui_liu@apple.com>
1136
1137         [iOS] Web process gets suspended while holding locked database files
1138         https://bugs.webkit.org/show_bug.cgi?id=196519
1139         <rdar://problem/49531797>
1140
1141         Reviewed by Chris Dumez.
1142
1143         We should close all databases and make sure not open new databases when web process is ready to suspend.
1144
1145         * platform/sql/SQLiteDatabase.cpp:
1146         (WebCore::SQLiteDatabase::setIsDatabaseOpeningForbidden):
1147         (WebCore::SQLiteDatabase::open):
1148         * platform/sql/SQLiteDatabase.h:
1149         * platform/sql/SQLiteDatabaseTracker.cpp:
1150         (WebCore::SQLiteDatabaseTracker::setClient):
1151         (WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount):
1152         (WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount):
1153         (WebCore::SQLiteDatabaseTracker::hasTransactionInProgress):
1154
1155 2019-04-05  Commit Queue  <commit-queue@webkit.org>
1156
1157         Unreviewed, rolling out r243833.
1158         https://bugs.webkit.org/show_bug.cgi?id=196645
1159
1160         This change breaks build of WPE and GTK ports (Requested by
1161         annulen on #webkit).
1162
1163         Reverted changeset:
1164
1165         "[CMake][WTF] Mirror XCode header directories"
1166         https://bugs.webkit.org/show_bug.cgi?id=191662
1167         https://trac.webkit.org/changeset/243833
1168
1169 2019-04-05  David Kilzer  <ddkilzer@apple.com>
1170
1171         REGRESSION(r243887): Try to fix Windows builds by including <wtf/IsoMalloc.h>
1172
1173         Caused by:
1174             [WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
1175             https://bugs.webkit.org/show_bug.cgi?id=196475
1176
1177         * css/CSSComputedStyleDeclaration.h:
1178         * dom/DOMRectReadOnly.h:
1179         * dom/LiveNodeList.h:
1180         * dom/NodeIterator.h:
1181         * dom/TreeWalker.h:
1182         * fileapi/Blob.h:
1183         * fileapi/File.h:
1184         * fileapi/FileList.h:
1185         * html/CachedHTMLCollection.h:
1186         * html/HTMLFormElement.h:
1187         * html/HTMLNameCollection.h:
1188         * html/canvas/GPUBasedCanvasRenderingContext.h:
1189         * page/RemoteDOMWindow.h:
1190
1191 2019-04-05  Ryosuke Niwa  <rniwa@webkit.org>
1192
1193         Make WeakPtr<Element> possible and deploy it in form associated elements code
1194         https://bugs.webkit.org/show_bug.cgi?id=196626
1195
1196         Reviewed by Antti Koivisto.
1197
1198         Make Element inherit from CanMakeWeakPtr and deploy WeakPtr<*Element> in FormAssociatedElement and HTMLFormElement.
1199
1200         No new tests sine there should be no behavioral change.
1201
1202         * dom/Element.h:
1203         * html/FormAssociatedElement.cpp:
1204         (WebCore::FormAssociatedElement::FormAssociatedElement):
1205         (WebCore::FormAssociatedElement::insertedIntoAncestor):
1206         (WebCore::FormAssociatedElement::setForm):
1207         (WebCore::FormAssociatedElement::resetFormOwner):
1208         (WebCore::FormAssociatedElement::formAttributeChanged):
1209         * html/FormAssociatedElement.h:
1210         (WebCore::FormAssociatedElement::form const):
1211         * html/HTMLElement.cpp:
1212         (WebCore::HTMLElement::asFormNamedItem):
1213         (WebCore::HTMLElement::asFormAssociatedElement):
1214         * html/HTMLElement.h:
1215         (WebCore::HTMLElement::asFormNamedItem): Deleted.
1216         * html/HTMLFormControlElement.h:
1217         * html/HTMLFormControlsCollection.cpp:
1218         (WebCore::HTMLFormControlsCollection::formImageElements const): Inlined into updateNamedElementCache.
1219         (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
1220         * html/HTMLFormControlsCollection.h:
1221         * html/HTMLFormElement.cpp:
1222         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
1223         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
1224         (WebCore::HTMLFormElement::registerImgElement):
1225         (WebCore::HTMLFormElement::defaultButton const):
1226         (WebCore::HTMLFormElement::resetDefaultButton):
1227         (WebCore::HTMLFormElement::matchesValidPseudoClass const):
1228         (WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
1229         * html/HTMLFormElement.h:
1230         * html/HTMLImageElement.cpp:
1231         (WebCore::HTMLImageElement::HTMLImageElement):
1232         (WebCore::HTMLImageElement::insertedIntoAncestor):
1233         * html/HTMLImageElement.h:
1234         * html/HTMLInputElement.h:
1235         * html/HTMLMediaElement.h:
1236         * html/HTMLObjectElement.h:
1237         * html/HTMLPictureElement.h:
1238         * html/HTMLSlotElement.h:
1239         * svg/SVGElement.h:
1240
1241 2019-04-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1242
1243         [ATK] Use a smart pointer for AccessibilityObject wrapper and remove GTK specific code
1244         https://bugs.webkit.org/show_bug.cgi?id=196593
1245         <rdar://problem/49599153>
1246
1247         Reviewed by Michael Catanzaro.
1248
1249         We have specific code for GTK to get/set the wrapper only because we don't use smart pointers. Also use
1250         WebKitAccessible as AccessibilityObjectWrapper instead of generic AtkObject, to enforce wrappers to be
1251         WebKitAccessible instances. This requires a few casts to AtkObject.
1252
1253         * accessibility/AccessibilityObject.h:
1254         (WebCore::AccessibilityObject::setWrapper):
1255         * accessibility/AccessibilityObjectInterface.h:
1256         * accessibility/atk/AXObjectCacheAtk.cpp:
1257         (WebCore::AXObjectCache::detachWrapper):
1258         (WebCore::AXObjectCache::attachWrapper):
1259         (WebCore::notifyChildrenSelectionChange):
1260         (WebCore::AXObjectCache::postPlatformNotification):
1261         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
1262         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
1263         (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
1264         * accessibility/atk/AccessibilityObjectAtk.cpp:
1265         * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
1266         (webkitAccessibleComponentRefAccessibleAtPoint):
1267         * accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp:
1268         (webkitAccessibleHypertextGetLink):
1269         (webkitAccessibleHypertextGetNLinks):
1270         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
1271         (webkitAccessibleSelectionRefSelection):
1272         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
1273         (webkitAccessibleTableRefAt):
1274         (webkitAccessibleTableGetColumnHeader):
1275         (webkitAccessibleTableGetRowHeader):
1276         (webkitAccessibleTableGetCaption):
1277         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
1278         (convertToGPtrArray):
1279         (webkitAccessibleTableCellGetTable):
1280         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
1281         (accessibilityObjectLength):
1282         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1283         (setAtkRelationSetFromCoreObject):
1284         (atkParentOfRootObject):
1285         (webkitAccessibleGetParent):
1286         (webkitAccessibleRefChild):
1287         (isTextWithCaret):
1288         * editing/atk/FrameSelectionAtk.cpp:
1289         (WebCore::emitTextSelectionChange):
1290         (WebCore::maybeEmitTextFocusChange):
1291
1292 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
1293
1294         [iOS WK2] REGRESSION (r242687): Programmatic scroll of overflow scroll results in bad rendering
1295         https://bugs.webkit.org/show_bug.cgi?id=195584
1296
1297         Reviewed by Zalan Bujtas.
1298
1299         Push data to the scrolling tree about whether an overflow:scroll scroll was programmatic, by having
1300         RenderLayer::scrollToOffset() call into AsyncScrollingCoordinator::requestScrollPositionUpdate(),
1301         just as we do for frames.
1302
1303         AsyncScrollingCoordinator::requestScrollPositionUpdate() is generalized to take any ScrollableArea.
1304
1305         Fix an assumption in the ScrollingTree that we only care about programmatic scrolls on the root node.
1306         ScrollingTree::commitTreeState() no longer sets isHandlingProgrammaticScroll; instead,
1307         callers of ScrollingTreeScrollingNode::scrollTo() pass a ScrollType. Commit functions pass
1308         ScrollType::Programmatic when handling RequestedScrollPosition changes as necessary.
1309
1310         Programmatic scrolls need to get to the scrolling tree in the UI process so that we update
1311         the tree's notion of scroll position, and trigger actual UIScrollView scrolls (layers may have
1312         already been put in the right locations, but the UI process needs to know that a scroll happened).
1313         However, we need to prevent notifications from programmatic scrolls getting back to the
1314         web process, because this causes jumpiness. This is done via an early return in
1315         RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll().
1316
1317         Tests: scrollingcoordinator/ios/programmatic-overflow-scroll.html
1318                scrollingcoordinator/ios/programmatic-page-scroll.html
1319
1320         * page/scrolling/AsyncScrollingCoordinator.cpp:
1321         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
1322         * page/scrolling/AsyncScrollingCoordinator.h:
1323         * page/scrolling/ScrollingCoordinator.h:
1324         (WebCore::ScrollingCoordinator::requestScrollPositionUpdate):
1325         * page/scrolling/ScrollingTree.cpp:
1326         (WebCore::ScrollingTree::commitTreeState):
1327         (WebCore::ScrollingTree::isHandlingProgrammaticScroll): Deleted.
1328         * page/scrolling/ScrollingTree.h:
1329         (WebCore::ScrollingTree::isHandlingProgrammaticScroll const):
1330         (WebCore::ScrollingTree::setIsHandlingProgrammaticScroll):
1331         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1332         (WebCore::ScrollingTreeScrollingNode::scrollBy):
1333         (WebCore::ScrollingTreeScrollingNode::scrollTo):
1334         * page/scrolling/ScrollingTreeScrollingNode.h:
1335         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1336         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
1337         * rendering/RenderLayer.cpp:
1338         (WebCore::RenderLayer::scrollToOffset):
1339         (WebCore::RenderLayer::scrollingNodeID const):
1340         * rendering/RenderLayer.h:
1341         * rendering/RenderMarquee.cpp:
1342         (WebCore::RenderMarquee::timerFired):
1343
1344 2019-04-04  Yusuke Suzuki  <ysuzuki@apple.com>
1345
1346         Unreviewed, speculative fix for build failure
1347         https://bugs.webkit.org/show_bug.cgi?id=196475
1348
1349         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
1350
1351 2019-04-04  Ryosuke Niwa  <rniwa@webkit.org>
1352
1353         Element::isFocusable() debug asserts too frequently
1354         https://bugs.webkit.org/show_bug.cgi?id=196634
1355
1356         Reviewed by Geoffrey Garen.
1357
1358         Remove the debug assertion for now.
1359
1360         * dom/Element.cpp:
1361         (WebCore::Element::isFocusable const):
1362
1363 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
1364
1365         Have ScrollableArea store a ScrollType for the current scroll
1366         https://bugs.webkit.org/show_bug.cgi?id=196627
1367
1368         Reviewed by Zalan Bujtas.
1369
1370         RenderLayer had isInUserScroll() which is the opposite of ScrollableArea::inProgrammaticScroll(),
1371         so just have ScrollableArea store a ScrollType.
1372
1373         RenderLayer's scrolling bottleneck, scrollToOffset(), now takes a ScrollType, and pushes
1374         it onto the base class.
1375
1376         AsyncScrollingCoordinator::requestScrollPositionUpdate() can use the incoming scrollType (currently
1377         incorrect for iOS WK2 overflow) rather than deducing a user scroll from ScrollingLayerPositionAction.
1378
1379         No behavior change.
1380
1381         * page/FrameView.cpp:
1382         (WebCore::FrameView::setFrameRect):
1383         (WebCore::FrameView::topContentInsetDidChange):
1384         (WebCore::FrameView::updateLayoutViewport):
1385         (WebCore::FrameView::setScrollPosition):
1386         (WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling const):
1387         (WebCore::FrameView::setWasScrolledByUser):
1388         * page/FrameViewLayoutContext.cpp:
1389         (WebCore::LayoutScope::LayoutScope):
1390         (WebCore::LayoutScope::~LayoutScope):
1391         * page/ios/FrameIOS.mm:
1392         (WebCore::Frame::overflowScrollPositionChangedForNode):
1393         * page/scrolling/AsyncScrollingCoordinator.cpp:
1394         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
1395         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
1396         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
1397         * platform/ScrollView.cpp:
1398         (WebCore::ScrollView::setScrollPosition):
1399         * platform/ScrollableArea.cpp:
1400         (WebCore::ScrollableArea::ScrollableArea):
1401         * platform/ScrollableArea.h:
1402         (WebCore::ScrollableArea::currentScrollType const):
1403         (WebCore::ScrollableArea::setCurrentScrollType):
1404         (WebCore::ScrollableArea::setIsUserScroll): Deleted.
1405         (WebCore::ScrollableArea::inProgrammaticScroll const): Deleted.
1406         (WebCore::ScrollableArea::setInProgrammaticScroll): Deleted.
1407         * rendering/RenderLayer.cpp:
1408         (WebCore::RenderLayer::RenderLayer):
1409         (WebCore::RenderLayer::scrollToXPosition):
1410         (WebCore::RenderLayer::scrollToYPosition):
1411         (WebCore::RenderLayer::scrollToOffset):
1412         (WebCore::RenderLayer::scrollTo):
1413         * rendering/RenderLayer.h:
1414         * rendering/RenderLayerBacking.cpp:
1415         (WebCore::RenderLayerBacking::updateScrollOffset):
1416         * rendering/RenderMarquee.cpp:
1417         (WebCore::RenderMarquee::start):
1418
1419 2019-04-04  Shawn Roberts  <sroberts@apple.com>
1420
1421         Unreviewed, rolling out r243868.
1422
1423         Causing timeouts failures on several queues
1424
1425         Reverted changeset:
1426
1427         "[Web Animations] JS wrapper may be deleted while animation is
1428         yet to dispatch its finish event"
1429         https://bugs.webkit.org/show_bug.cgi?id=196118
1430         https://trac.webkit.org/changeset/243868
1431
1432 2019-04-04  Youenn Fablet  <youenn@apple.com>
1433
1434         Pass storage quota parameters from UIProcess to NetworkProcess as part of WebsiteDataStore parameters
1435         https://bugs.webkit.org/show_bug.cgi?id=196543
1436
1437         Reviewed by Alex Christensen.
1438
1439         Add a default routine to compute a third party quota from a per origin quota.
1440         No change of behavior.
1441
1442         * storage/StorageQuotaManager.h:
1443         (WebCore::StorageQuotaManager::defaultThirdPartyQuotaFromPerOriginQuota):
1444         (WebCore::StorageQuotaManager::defaultThirdPartyQuota):
1445
1446 2019-04-04  Commit Queue  <commit-queue@webkit.org>
1447
1448         Unreviewed, rolling out r243807 and r243824.
1449         https://bugs.webkit.org/show_bug.cgi?id=196611
1450
1451         Test added is a flaky timeout on iOS Simulator, 3 tests
1452         unskipped are flaky failures (Requested by ShawnRoberts on
1453         #webkit).
1454
1455         Reverted changesets:
1456
1457         "Blob type cannot be stored correctly in IDB when
1458         IDBObjectStore has autoIncrement and keyPath options"
1459         https://bugs.webkit.org/show_bug.cgi?id=196128
1460         https://trac.webkit.org/changeset/243807
1461
1462         "Follow up fix for r243807: Use MarkedArgumentBuffer instead
1463         of Vector for JSValue"
1464         https://bugs.webkit.org/show_bug.cgi?id=196547
1465         https://trac.webkit.org/changeset/243824
1466
1467 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
1468
1469         Fix rare crash under collectRelatedCoordinatedScrollingNodes()
1470         https://bugs.webkit.org/show_bug.cgi?id=196610
1471         rdar://problem/49595426
1472
1473         Reviewed by Zalan Bujtas.
1474
1475         hasCompositedScrollableOverflow() doesn't check whether a layer is composited (it has
1476         to report the right status before layers have been created), so collectRelatedCoordinatedScrollingNodes()
1477         needs to check whether there's backing.
1478
1479         * rendering/RenderLayerCompositor.cpp:
1480         (WebCore::collectRelatedCoordinatedScrollingNodes):
1481
1482 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
1483
1484         Move "inProgrammaticScroll" down to ScrollableArea
1485         https://bugs.webkit.org/show_bug.cgi?id=196614
1486
1487         Reviewed by Zalan Bujtas.
1488
1489         A future patch will need to update "inProgrammaticScroll" on RenderLayers, so push
1490         inProgrammaticScroll() down to ScrollableArea.
1491
1492         ScrollableArea already has "isScrolledProgrammatically", which I rename to "scrollShouldClearLatchedState"
1493         to reduce confusion. It might be possible to remove this in future with some refactoring.
1494
1495         Sadly we can no longer use SetForScope<> in FrameView after this change so add some manual save/restore code.
1496
1497         * dom/Element.cpp:
1498         (WebCore::Element::setScrollLeft):
1499         (WebCore::Element::setScrollTop):
1500         * page/EventHandler.cpp:
1501         (WebCore::EventHandler::completeWidgetWheelEvent):
1502         (WebCore::EventHandler::handleWheelEvent):
1503         * page/FrameView.cpp:
1504         (WebCore::FrameView::setFrameRect):
1505         (WebCore::FrameView::topContentInsetDidChange):
1506         (WebCore::FrameView::updateLayoutViewport):
1507         (WebCore::FrameView::setScrollPosition):
1508         (WebCore::FrameView::setWasScrolledByUser):
1509         * page/FrameView.h:
1510         * platform/ScrollView.h:
1511         (WebCore::ScrollView::inProgrammaticScroll const): Deleted.
1512         * platform/ScrollableArea.cpp:
1513         (WebCore::ScrollableArea::ScrollableArea):
1514         * platform/ScrollableArea.h:
1515         (WebCore::ScrollableArea::inProgrammaticScroll const):
1516         (WebCore::ScrollableArea::setInProgrammaticScroll):
1517         (WebCore::ScrollableArea::scrollShouldClearLatchedState const):
1518         (WebCore::ScrollableArea::setScrollShouldClearLatchedState):
1519         (WebCore::ScrollableArea::isScrolledProgrammatically const): Deleted.
1520         (WebCore::ScrollableArea::setScrolledProgrammatically): Deleted.
1521
1522 2019-04-04  Sihui Liu  <sihui_liu@apple.com>
1523
1524         Leak of UniqueIDBDatabase in network process running layout tests
1525         https://bugs.webkit.org/show_bug.cgi?id=196565
1526         <rdar://problem/49346139>
1527
1528         Reviewed by Geoffrey Garen.
1529
1530         UniqueIDBDatabase will null itself after it receives confirmation about connecton close from its clients, but it
1531         is possible that the web process to network process connection closes before servers gets the 
1532         confirmDidCloseFromServer. Therefore, we should let UniqueIDBDatabase forget connection when it receives a 
1533         conenctionClosedFromClient.
1534
1535         No new test because this bug is caused by race between network receiving conenctionClosedFromClient and 
1536         receiving confirmDidCloseFromServer. This is testable by running some existing layout tests in a row with leak 
1537         option.
1538
1539         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1540         (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
1541         (WebCore::IDBServer::UniqueIDBDatabase::confirmDidCloseFromServer):
1542
1543 2019-04-04  Chris Dumez  <cdumez@apple.com>
1544
1545         Unreviewed, fix iOS build with recent SDKs.
1546
1547         * platform/gamepad/cocoa/GameControllerGamepad.mm:
1548         (WebCore::GameControllerGamepad::GameControllerGamepad):
1549
1550 2019-04-04  Eric Carlson  <eric.carlson@apple.com>
1551
1552         [MediaStream] Host should be able to mute screen capture and camera/microphone independently
1553         https://bugs.webkit.org/show_bug.cgi?id=196555
1554         <rdar://problem/47303865>
1555
1556         Reviewed by Youenn Fablet.
1557
1558         Test: fast/mediastream/media-stream-page-muted.html
1559
1560         * Modules/mediastream/MediaStream.cpp:
1561         (WebCore::MediaStream::MediaStream): Call setCaptureTracksMuted to pass page muted 
1562         state to tracks.
1563         (WebCore::MediaStream::startProducingData): Ditto.
1564         (WebCore::MediaStream::setCaptureTracksMuted): New.
1565         * Modules/mediastream/MediaStream.h:
1566
1567         * Modules/mediastream/MediaStreamTrack.cpp:
1568         (WebCore::MediaStreamTrack::MediaStreamTrack): Call setMuted with page muted state.
1569         (WebCore::MediaStreamTrack::setMuted): Set muted according to page state and source type.
1570         (WebCore::MediaStreamTrack::pageMutedStateDidChange): Call setMuted.
1571         (WebCore::MediaStreamTrack::mediaState const): Update for new page state.
1572         * Modules/mediastream/MediaStreamTrack.h:
1573
1574         * page/MediaProducer.h: Split capture muted state into two: camera/microphone and screen.
1575
1576         * page/Page.h:
1577         (WebCore::Page::isMediaCaptureMuted const): Update for state changes.
1578
1579         * platform/mediastream/MediaStreamPrivate.cpp:
1580         (WebCore::MediaStreamPrivate::setCaptureTracksMuted): Deleted.
1581         (WebCore::MediaStreamPrivate::hasCaptureVideoSource const): Deleted.
1582         * platform/mediastream/MediaStreamPrivate.h:
1583
1584         * platform/mediastream/RealtimeMediaSource.cpp:
1585         (WebCore::RealtimeMediaSource::setMuted): Log state.
1586         (WebCore::RealtimeMediaSource::notifyMutedChange): Call notifyMutedObservers on the
1587         next runloop so events aren't dispatched synchronously.
1588
1589         * testing/Internals.cpp:
1590         (WebCore::Internals::setPageMuted): Add new state.
1591
1592 2019-04-04  Chris Dumez  <cdumez@apple.com>
1593
1594         Unreviewed, update r243884 to use macros in Compiler.h instead.
1595
1596         * platform/ios/LegacyTileGrid.mm:
1597         (WebCore::LegacyTileGrid::dropDistantTiles):
1598
1599 2019-04-04  Chris Fleizach  <cfleizach@apple.com>
1600
1601         AX: Crash under WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored()
1602         https://bugs.webkit.org/show_bug.cgi?id=196600
1603         <rdar://problem/49572996>
1604
1605         Reviewed by Joanmarie Diggs.
1606
1607         Audit AX code to not dereference renderer before checking if it's null.
1608         Not clear how to reproduce at this time.
1609
1610         * accessibility/AccessibilityRenderObject.cpp:
1611         (WebCore::webAreaIsPresentational):
1612         (WebCore::AccessibilityRenderObject::layoutCount const):
1613         (WebCore::AccessibilityRenderObject::widget const):
1614
1615 2019-04-04  Antti Koivisto  <antti@apple.com>
1616
1617         Compute accurate regions for touch-action
1618         https://bugs.webkit.org/show_bug.cgi?id=196536
1619         <rdar://problem/49516022>
1620
1621         Reviewed by Simon Fraser.
1622
1623         Tests: pointerevents/ios/touch-action-region-basic.html
1624                pointerevents/ios/touch-action-region-layers.html
1625                pointerevents/ios/touch-action-region-pan-x-y.html
1626
1627         - Use style system to compute effective touch-action without additional tree walks.
1628         - Compute touch-action region in a fake paint, at the same time with the event region.
1629
1630         This patch doesn't yet use the computed region for anything except test output.
1631
1632         * Sources.txt:
1633         * WebCore.xcodeproj/project.pbxproj:
1634         * css/StyleResolver.cpp:
1635         (WebCore::computeEffectiveTouchActions):
1636         (WebCore::StyleResolver::adjustRenderStyle):
1637
1638         Update RenderStyle::effectiveTouchAction.
1639
1640         * dom/Element.cpp:
1641         (WebCore::Element::computedTouchActions const):
1642
1643         Just get it from the style.
1644
1645         * platform/graphics/GraphicsLayer.cpp:
1646         (WebCore::GraphicsLayer::setEventRegion):
1647         (WebCore::GraphicsLayer::setTouchActionRegion):
1648         (WebCore::GraphicsLayer::dumpProperties const):
1649         * platform/graphics/GraphicsLayer.h:
1650         (WebCore::GraphicsLayer::touchActionRegion const):
1651         * platform/graphics/ca/GraphicsLayerCA.cpp:
1652         (WebCore::GraphicsLayerCA::setTouchActionRegion):
1653         * platform/graphics/ca/GraphicsLayerCA.h:
1654         * rendering/PaintInfo.h:
1655         * rendering/RenderBlock.cpp:
1656         (WebCore::RenderBlock::paintObject):
1657         * rendering/RenderLayer.cpp:
1658         (WebCore::RenderLayer::collectEventRegionForFragments):
1659         * rendering/RenderLayer.h:
1660         * rendering/RenderLayerBacking.cpp:
1661         (WebCore::RenderLayerBacking::updateConfiguration):
1662
1663         Need to do this for the top compositing layer too.
1664
1665         (WebCore::RenderLayerBacking::updateEventRegion):
1666
1667         Compute touch-action region too.
1668         As a basic optimization avoid doing any extra work if there are no elements with non-default touch-action property.
1669
1670         * rendering/TouchActionRegion.cpp: Added.
1671         (WebCore::toIndex):
1672         (WebCore::toTouchAction):
1673         (WebCore::toString):
1674         (WebCore::TouchActionRegion::unite):
1675         (WebCore::TouchActionRegion::actionsForPoint const):
1676         (WebCore::TouchActionRegion::translate):
1677         (WebCore::operator<<):
1678         * rendering/TouchActionRegion.h: Added.
1679
1680         Class for collecting and maintaining touch-action region.
1681
1682         (WebCore::TouchActionRegion::isEmpty const):
1683         (WebCore::TouchActionRegion::operator== const):
1684         * rendering/style/RenderStyle.h:
1685         (WebCore::RenderStyle::effectiveTouchActions const):
1686         (WebCore::RenderStyle::setEffectiveTouchActions):
1687
1688         Implement as inherited property for efficiency (touch-action itself is non-inherited).
1689
1690         * rendering/style/StyleRareInheritedData.cpp:
1691         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1692         (WebCore::StyleRareInheritedData::operator== const):
1693         * rendering/style/StyleRareInheritedData.h:
1694
1695 2019-04-04  Yusuke Suzuki  <ysuzuki@apple.com>
1696
1697         Unreviewed, fix linking error because the build of RTCIceTransport.cpp is handled in Xcode project side accidentally
1698         https://bugs.webkit.org/show_bug.cgi?id=196475
1699
1700         We did not have RTCIceTransport.cpp in Sources.txt.
1701
1702         * WebCore.xcodeproj/project.pbxproj:
1703
1704 2019-04-04  Yusuke Suzuki  <ysuzuki@apple.com>
1705
1706         [WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
1707         https://bugs.webkit.org/show_bug.cgi?id=196475
1708
1709         Reviewed by Saam Barati.
1710
1711         This patch puts most of derived classes of ScriptWrappable into IsoHeap. We do not include derived classes of Event simply
1712         because Internal repository code also inherits it. After watching the result of this patch, we will try Event and its derived
1713         classes into IsoHeap too.
1714
1715         This patch makes the following things IsoHeap-allocated. These classes are listed by using lldb python script.
1716
1717             1. DOM collections (HTMLCollection etc.)
1718             2. WebAudio nodes
1719             3. IDB classes
1720             4. FileSystem API classes
1721             5. Canvas contexts
1722             6. WebRTC classses
1723             7. XMLHttpRequest related classes
1724             8. WebSocket related classes
1725             9. Worker and Worklet related classes
1726             10. Other misc classes
1727
1728         * Modules/applepay/ApplePaySession.cpp:
1729         * Modules/applepay/ApplePaySession.h:
1730         * Modules/encryptedmedia/MediaKeySession.cpp:
1731         * Modules/encryptedmedia/MediaKeySession.h:
1732         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1733         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
1734         * Modules/entriesapi/DOMFileSystem.cpp:
1735         * Modules/entriesapi/DOMFileSystem.h:
1736         (WebCore::DOMFileSystem::createEntryForFile): Deleted.
1737         (WebCore::DOMFileSystem::name const): Deleted.
1738         * Modules/entriesapi/FileSystemDirectoryEntry.h:
1739         * Modules/entriesapi/FileSystemDirectoryReader.cpp:
1740         * Modules/entriesapi/FileSystemDirectoryReader.h:
1741         * Modules/entriesapi/FileSystemEntry.cpp:
1742         * Modules/entriesapi/FileSystemEntry.h:
1743         * Modules/entriesapi/FileSystemFileEntry.h:
1744         * Modules/geolocation/Geolocation.cpp:
1745         * Modules/geolocation/Geolocation.h:
1746         (WebCore::Geolocation::document const): Deleted.
1747         (WebCore::Geolocation::frame const): Deleted.
1748         (WebCore::Geolocation::resetIsAllowed): Deleted.
1749         (WebCore::Geolocation::isAllowed const): Deleted.
1750         (WebCore::Geolocation::isDenied const): Deleted.
1751         (WebCore::Geolocation::hasListeners const): Deleted.
1752         * Modules/indexeddb/IDBCursor.cpp:
1753         * Modules/indexeddb/IDBCursor.h:
1754         * Modules/indexeddb/IDBCursorWithValue.cpp:
1755         * Modules/indexeddb/IDBCursorWithValue.h:
1756         * Modules/indexeddb/IDBDatabase.cpp:
1757         * Modules/indexeddb/IDBDatabase.h:
1758         (WebCore::IDBDatabase::info const): Deleted.
1759         (WebCore::IDBDatabase::databaseConnectionIdentifier const): Deleted.
1760         (WebCore::IDBDatabase::connectionProxy): Deleted.
1761         (WebCore::IDBDatabase::isClosingOrClosed const): Deleted.
1762         * Modules/indexeddb/IDBKeyRange.cpp:
1763         * Modules/indexeddb/IDBKeyRange.h:
1764         (WebCore::IDBKeyRange::lower const): Deleted.
1765         (WebCore::IDBKeyRange::upper const): Deleted.
1766         (WebCore::IDBKeyRange::lowerOpen const): Deleted.
1767         (WebCore::IDBKeyRange::upperOpen const): Deleted.
1768         * Modules/indexeddb/IDBOpenDBRequest.cpp:
1769         * Modules/indexeddb/IDBOpenDBRequest.h:
1770         * Modules/indexeddb/IDBRequest.cpp:
1771         * Modules/indexeddb/IDBRequest.h:
1772         * Modules/indexeddb/IDBTransaction.cpp:
1773         * Modules/indexeddb/IDBTransaction.h:
1774         (WebCore::IDBTransaction::mode const): Deleted.
1775         (WebCore::IDBTransaction::info const): Deleted.
1776         (WebCore::IDBTransaction::database): Deleted.
1777         (WebCore::IDBTransaction::database const): Deleted.
1778         (WebCore::IDBTransaction::originalDatabaseInfo const): Deleted.
1779         (WebCore::IDBTransaction::isVersionChange const): Deleted.
1780         (WebCore::IDBTransaction::isReadOnly const): Deleted.
1781         (WebCore::IDBTransaction::isFinished const): Deleted.
1782         * Modules/mediarecorder/MediaRecorder.cpp:
1783         * Modules/mediarecorder/MediaRecorder.h:
1784         * Modules/mediasession/MediaRemoteControls.cpp:
1785         * Modules/mediasession/MediaRemoteControls.h:
1786         (WebCore::MediaRemoteControls::create): Deleted.
1787         (WebCore::MediaRemoteControls::previousTrackEnabled const): Deleted.
1788         (WebCore::MediaRemoteControls::nextTrackEnabled const): Deleted.
1789         * Modules/mediasource/MediaSource.cpp:
1790         * Modules/mediasource/MediaSource.h:
1791         * Modules/mediasource/SourceBuffer.cpp:
1792         * Modules/mediasource/SourceBuffer.h:
1793         * Modules/mediasource/SourceBufferList.cpp:
1794         * Modules/mediasource/SourceBufferList.h:
1795         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
1796         * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
1797         * Modules/mediastream/MediaDeviceInfo.cpp:
1798         * Modules/mediastream/MediaDeviceInfo.h:
1799         (WebCore::MediaDeviceInfo::label const): Deleted.
1800         (WebCore::MediaDeviceInfo::deviceId const): Deleted.
1801         (WebCore::MediaDeviceInfo::groupId const): Deleted.
1802         (WebCore::MediaDeviceInfo::kind const): Deleted.
1803         * Modules/mediastream/MediaDevices.cpp:
1804         * Modules/mediastream/MediaDevices.h:
1805         * Modules/mediastream/MediaStream.cpp:
1806         * Modules/mediastream/MediaStream.h:
1807         * Modules/mediastream/MediaStreamTrack.cpp:
1808         * Modules/mediastream/MediaStreamTrack.h:
1809         * Modules/mediastream/RTCDTMFSender.cpp:
1810         * Modules/mediastream/RTCDTMFSender.h:
1811         * Modules/mediastream/RTCDataChannel.cpp:
1812         * Modules/mediastream/RTCDataChannel.h:
1813         * Modules/mediastream/RTCIceCandidate.cpp:
1814         * Modules/mediastream/RTCIceCandidate.h:
1815         (WebCore::RTCIceCandidate::candidate const): Deleted.
1816         (WebCore::RTCIceCandidate::sdpMid const): Deleted.
1817         (WebCore::RTCIceCandidate::sdpMLineIndex const): Deleted.
1818         (WebCore::RTCIceCandidate::setCandidate): Deleted.
1819         * Modules/mediastream/RTCIceTransport.cpp:
1820         * Modules/mediastream/RTCIceTransport.h:
1821         (WebCore::RTCIceTransport::create): Deleted.
1822         (WebCore::RTCIceTransport::state const): Deleted.
1823         (WebCore::RTCIceTransport::setState): Deleted.
1824         (WebCore::RTCIceTransport::gatheringState const): Deleted.
1825         (WebCore::RTCIceTransport::setGatheringState): Deleted.
1826         (WebCore::RTCIceTransport::RTCIceTransport): Deleted.
1827         * Modules/mediastream/RTCPeerConnection.cpp:
1828         * Modules/mediastream/RTCPeerConnection.h:
1829         * Modules/mediastream/RTCRtpReceiver.cpp:
1830         * Modules/mediastream/RTCRtpReceiver.h:
1831         (WebCore::RTCRtpReceiver::create): Deleted.
1832         (WebCore::RTCRtpReceiver::setBackend): Deleted.
1833         (WebCore::RTCRtpReceiver::getParameters): Deleted.
1834         (WebCore::RTCRtpReceiver::getContributingSources const): Deleted.
1835         (WebCore::RTCRtpReceiver::getSynchronizationSources const): Deleted.
1836         (WebCore::RTCRtpReceiver::track): Deleted.
1837         (WebCore::RTCRtpReceiver::backend): Deleted.
1838         * Modules/mediastream/RTCRtpSender.cpp:
1839         * Modules/mediastream/RTCRtpSender.h:
1840         (WebCore::RTCRtpSender::track): Deleted.
1841         (WebCore::RTCRtpSender::trackId const): Deleted.
1842         (WebCore::RTCRtpSender::trackKind const): Deleted.
1843         (WebCore::RTCRtpSender::mediaStreamIds const): Deleted.
1844         (WebCore::RTCRtpSender::setMediaStreamIds): Deleted.
1845         (WebCore::RTCRtpSender::isStopped const): Deleted.
1846         (WebCore::RTCRtpSender::backend): Deleted.
1847         * Modules/mediastream/RTCRtpTransceiver.cpp:
1848         * Modules/mediastream/RTCRtpTransceiver.h:
1849         (WebCore::RTCRtpTransceiver::create): Deleted.
1850         (WebCore::RTCRtpTransceiver::sender): Deleted.
1851         (WebCore::RTCRtpTransceiver::receiver): Deleted.
1852         (WebCore::RTCRtpTransceiver::iceTransport): Deleted.
1853         (WebCore::RTCRtpTransceiver::backend): Deleted.
1854         * Modules/mediastream/RTCSessionDescription.cpp:
1855         * Modules/mediastream/RTCSessionDescription.h:
1856         (WebCore::RTCSessionDescription::type const): Deleted.
1857         (WebCore::RTCSessionDescription::sdp const): Deleted.
1858         (WebCore::RTCSessionDescription::setSdp): Deleted.
1859         * Modules/notifications/Notification.cpp:
1860         * Modules/notifications/Notification.h:
1861         * Modules/paymentrequest/PaymentRequest.cpp:
1862         * Modules/paymentrequest/PaymentRequest.h:
1863         * Modules/paymentrequest/PaymentResponse.cpp:
1864         * Modules/paymentrequest/PaymentResponse.h:
1865         * Modules/speech/SpeechSynthesisUtterance.cpp:
1866         * Modules/speech/SpeechSynthesisUtterance.h:
1867         * Modules/webaudio/AnalyserNode.cpp:
1868         * Modules/webaudio/AnalyserNode.h:
1869         * Modules/webaudio/AudioBasicInspectorNode.cpp:
1870         * Modules/webaudio/AudioBasicInspectorNode.h:
1871         * Modules/webaudio/AudioBasicProcessorNode.cpp:
1872         * Modules/webaudio/AudioBasicProcessorNode.h:
1873         * Modules/webaudio/AudioBufferSourceNode.cpp:
1874         * Modules/webaudio/AudioBufferSourceNode.h:
1875         * Modules/webaudio/AudioContext.cpp:
1876         * Modules/webaudio/AudioContext.h:
1877         * Modules/webaudio/AudioDestinationNode.cpp:
1878         * Modules/webaudio/AudioDestinationNode.h:
1879         * Modules/webaudio/AudioNode.cpp:
1880         * Modules/webaudio/AudioNode.h:
1881         * Modules/webaudio/AudioScheduledSourceNode.cpp:
1882         * Modules/webaudio/AudioScheduledSourceNode.h:
1883         * Modules/webaudio/BiquadFilterNode.cpp:
1884         * Modules/webaudio/BiquadFilterNode.h:
1885         * Modules/webaudio/ChannelMergerNode.cpp:
1886         * Modules/webaudio/ChannelMergerNode.h:
1887         * Modules/webaudio/ChannelSplitterNode.cpp:
1888         * Modules/webaudio/ChannelSplitterNode.h:
1889         * Modules/webaudio/ConvolverNode.cpp:
1890         * Modules/webaudio/ConvolverNode.h:
1891         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
1892         * Modules/webaudio/DefaultAudioDestinationNode.h:
1893         * Modules/webaudio/DelayNode.cpp:
1894         * Modules/webaudio/DelayNode.h:
1895         * Modules/webaudio/DynamicsCompressorNode.cpp:
1896         * Modules/webaudio/DynamicsCompressorNode.h:
1897         * Modules/webaudio/GainNode.cpp:
1898         * Modules/webaudio/GainNode.h:
1899         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
1900         * Modules/webaudio/MediaElementAudioSourceNode.h:
1901         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
1902         * Modules/webaudio/MediaStreamAudioDestinationNode.h:
1903         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
1904         * Modules/webaudio/MediaStreamAudioSourceNode.h:
1905         * Modules/webaudio/OfflineAudioContext.cpp:
1906         * Modules/webaudio/OfflineAudioContext.h:
1907         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
1908         * Modules/webaudio/OfflineAudioDestinationNode.h:
1909         * Modules/webaudio/OscillatorNode.cpp:
1910         * Modules/webaudio/OscillatorNode.h:
1911         * Modules/webaudio/PannerNode.cpp:
1912         * Modules/webaudio/PannerNode.h:
1913         * Modules/webaudio/ScriptProcessorNode.cpp:
1914         * Modules/webaudio/ScriptProcessorNode.h:
1915         * Modules/webaudio/WaveShaperNode.cpp:
1916         * Modules/webaudio/WaveShaperNode.h:
1917         * Modules/webgpu/GPUCanvasContext.cpp:
1918         * Modules/webgpu/GPUCanvasContext.h:
1919         * Modules/websockets/WebSocket.cpp:
1920         * Modules/websockets/WebSocket.h:
1921         * Modules/webvr/VRDisplay.cpp:
1922         * Modules/webvr/VRDisplay.h:
1923         (WebCore::VRDisplay::isPresenting const): Deleted.
1924         (WebCore::VRDisplay::displayName const): Deleted.
1925         (WebCore::VRDisplay::displayId const): Deleted.
1926         (WebCore::VRDisplay::depthNear const): Deleted.
1927         (WebCore::VRDisplay::setDepthNear): Deleted.
1928         (WebCore::VRDisplay::depthFar const): Deleted.
1929         (WebCore::VRDisplay::setDepthFar): Deleted.
1930         (WebCore::VRDisplay::document): Deleted.
1931         * Sources.txt:
1932         * WebCore.xcodeproj/project.pbxproj:
1933         * animation/CSSAnimation.cpp:
1934         * animation/CSSAnimation.h:
1935         * animation/CSSTransition.cpp:
1936         * animation/CSSTransition.h:
1937         * animation/DeclarativeAnimation.cpp:
1938         * animation/DeclarativeAnimation.h:
1939         * animation/WebAnimation.cpp:
1940         * animation/WebAnimation.h:
1941         * bindings/js/ScriptWrappable.h:
1942         * css/CSSComputedStyleDeclaration.cpp:
1943         * css/CSSComputedStyleDeclaration.h:
1944         * css/CSSStyleDeclaration.cpp:
1945         (): Deleted.
1946         * css/CSSStyleDeclaration.h:
1947         * css/DOMMatrix.h:
1948         * css/DOMMatrixReadOnly.cpp:
1949         * css/DOMMatrixReadOnly.h:
1950         * css/FontFaceSet.cpp:
1951         * css/FontFaceSet.h:
1952         * css/PropertySetCSSStyleDeclaration.cpp:
1953         * css/PropertySetCSSStyleDeclaration.h:
1954         * css/WebKitCSSMatrix.cpp:
1955         * css/WebKitCSSMatrix.h:
1956         * css/typedom/TypedOMCSSImageValue.cpp: Added.
1957         * css/typedom/TypedOMCSSImageValue.h:
1958         * css/typedom/TypedOMCSSNumericValue.cpp: Added.
1959         * css/typedom/TypedOMCSSNumericValue.h:
1960         * css/typedom/TypedOMCSSStyleValue.cpp: Added.
1961         * css/typedom/TypedOMCSSStyleValue.h:
1962         * css/typedom/TypedOMCSSUnitValue.cpp: Added.
1963         * css/typedom/TypedOMCSSUnitValue.h:
1964         * css/typedom/TypedOMCSSUnparsedValue.cpp: Added.
1965         * css/typedom/TypedOMCSSUnparsedValue.h:
1966         * dom/AbortController.cpp:
1967         * dom/AbortController.h:
1968         * dom/AbortSignal.cpp:
1969         * dom/AbortSignal.h:
1970         * dom/AllDescendantsCollection.cpp: Copied from Source/WebCore/xml/XMLHttpRequestEventTarget.h.
1971         * dom/AllDescendantsCollection.h:
1972         * dom/ChildNodeList.cpp:
1973         * dom/ChildNodeList.h:
1974         * dom/ClassCollection.cpp:
1975         * dom/ClassCollection.h:
1976         * dom/DOMImplementation.cpp:
1977         * dom/DOMImplementation.h:
1978         (WebCore::DOMImplementation::ref): Deleted.
1979         (WebCore::DOMImplementation::deref): Deleted.
1980         (WebCore::DOMImplementation::document): Deleted.
1981         (WebCore::DOMImplementation::hasFeature): Deleted.
1982         * dom/DOMPoint.h:
1983         * dom/DOMPointReadOnly.cpp:
1984         * dom/DOMPointReadOnly.h:
1985         * dom/DOMQuad.cpp:
1986         * dom/DOMQuad.h:
1987         * dom/DOMRect.h:
1988         * dom/DOMRectReadOnly.cpp: Copied from Source/WebCore/dom/DOMPointReadOnly.cpp.
1989         * dom/DOMRectReadOnly.h:
1990         * dom/DataTransferItemList.cpp:
1991         * dom/DataTransferItemList.h:
1992         (WebCore::DataTransferItemList::ref): Deleted.
1993         (WebCore::DataTransferItemList::deref): Deleted.
1994         (WebCore::DataTransferItemList::dataTransfer): Deleted.
1995         (WebCore::DataTransferItemList::hasItems const): Deleted.
1996         (WebCore::DataTransferItemList::items const): Deleted.
1997         * dom/DatasetDOMStringMap.cpp:
1998         * dom/DatasetDOMStringMap.h:
1999         * dom/DocumentParser.h:
2000         * dom/EventTarget.cpp:
2001         * dom/EventTarget.h:
2002         * dom/LiveNodeList.cpp:
2003         * dom/LiveNodeList.h:
2004         * dom/MessageChannel.cpp:
2005         * dom/MessagePort.cpp:
2006         * dom/MessagePort.h:
2007         * dom/NameNodeList.cpp:
2008         * dom/NameNodeList.h:
2009         * dom/NamedNodeMap.cpp:
2010         * dom/NamedNodeMap.h:
2011         (WebCore::NamedNodeMap::NamedNodeMap): Deleted.
2012         (WebCore::NamedNodeMap::element): Deleted.
2013         * dom/NodeIterator.cpp:
2014         * dom/NodeIterator.h:
2015         (WebCore::NodeIterator::detach): Deleted.
2016         (WebCore::NodeIterator::referenceNode const): Deleted.
2017         (WebCore::NodeIterator::pointerBeforeReferenceNode const): Deleted.
2018         * dom/NodeList.cpp: Copied from Source/WebCore/xml/XMLHttpRequestEventTarget.h.
2019         * dom/NodeList.h:
2020         * dom/NodeRareData.cpp:
2021         * dom/ScriptExecutionContext.cpp:
2022         * dom/SimulatedClick.cpp:
2023         * dom/StaticNodeList.cpp:
2024         * dom/StaticNodeList.h:
2025         * dom/TagCollection.cpp:
2026         * dom/TagCollection.h:
2027         * dom/TreeWalker.cpp:
2028         * dom/TreeWalker.h:
2029         (WebCore::TreeWalker::create): Deleted.
2030         (WebCore::TreeWalker::currentNode): Deleted.
2031         (WebCore::TreeWalker::currentNode const): Deleted.
2032         * fileapi/Blob.cpp:
2033         * fileapi/Blob.h:
2034         * fileapi/File.cpp:
2035         * fileapi/File.h:
2036         * fileapi/FileList.cpp:
2037         * fileapi/FileList.h:
2038         (WebCore::FileList::create): Deleted.
2039         (WebCore::FileList::length const): Deleted.
2040         (WebCore::FileList::isEmpty const): Deleted.
2041         (WebCore::FileList::files const): Deleted.
2042         (WebCore::FileList::file const): Deleted.
2043         (WebCore::FileList::FileList): Deleted.
2044         (WebCore::FileList::append): Deleted.
2045         (WebCore::FileList::clear): Deleted.
2046         * fileapi/FileReader.cpp:
2047         * fileapi/FileReader.h:
2048         * html/CachedHTMLCollection.h:
2049         * html/GenericCachedHTMLCollection.cpp:
2050         * html/GenericCachedHTMLCollection.h:
2051         * html/HTMLAllCollection.cpp:
2052         * html/HTMLAllCollection.h:
2053         * html/HTMLCollection.cpp:
2054         * html/HTMLCollection.h:
2055         * html/HTMLFormControlsCollection.cpp:
2056         * html/HTMLFormControlsCollection.h:
2057         * html/HTMLNameCollection.cpp:
2058         * html/HTMLNameCollection.h:
2059         * html/HTMLOptionsCollection.cpp:
2060         * html/HTMLOptionsCollection.h:
2061         * html/HTMLTableRowsCollection.cpp:
2062         * html/HTMLTableRowsCollection.h:
2063         * html/ImageBitmap.cpp:
2064         * html/ImageBitmap.h:
2065         (WebCore::ImageBitmap::isDetached const): Deleted.
2066         (WebCore::ImageBitmap::buffer): Deleted.
2067         (WebCore::ImageBitmap::originClean const): Deleted.
2068         * html/LabelsNodeList.cpp:
2069         * html/LabelsNodeList.h:
2070         * html/MediaController.cpp:
2071         * html/MediaController.h:
2072         * html/OffscreenCanvas.cpp:
2073         * html/OffscreenCanvas.h:
2074         * html/RadioNodeList.cpp:
2075         * html/RadioNodeList.h:
2076         * html/canvas/CanvasRenderingContext.cpp:
2077         * html/canvas/CanvasRenderingContext.h:
2078         * html/canvas/CanvasRenderingContext2D.cpp:
2079         * html/canvas/CanvasRenderingContext2D.h:
2080         * html/canvas/CanvasRenderingContext2DBase.cpp:
2081         * html/canvas/CanvasRenderingContext2DBase.h:
2082         * html/canvas/GPUBasedCanvasRenderingContext.h:
2083         * html/canvas/ImageBitmapRenderingContext.cpp:
2084         * html/canvas/ImageBitmapRenderingContext.h:
2085         * html/canvas/OffscreenCanvasRenderingContext2D.cpp:
2086         * html/canvas/OffscreenCanvasRenderingContext2D.h:
2087         * html/canvas/PaintRenderingContext2D.cpp:
2088         * html/canvas/PaintRenderingContext2D.h:
2089         * html/canvas/PlaceholderRenderingContext.cpp:
2090         * html/canvas/PlaceholderRenderingContext.h:
2091         * html/canvas/WebGL2RenderingContext.cpp:
2092         * html/canvas/WebGL2RenderingContext.h:
2093         * html/canvas/WebGLRenderingContext.cpp:
2094         * html/canvas/WebGLRenderingContext.h:
2095         * html/canvas/WebGLRenderingContextBase.cpp:
2096         * html/canvas/WebGLRenderingContextBase.h:
2097         * html/track/AudioTrackList.h:
2098         * html/track/DataCue.cpp:
2099         * html/track/DataCue.h:
2100         * html/track/InbandDataTextTrack.cpp:
2101         * html/track/InbandDataTextTrack.h:
2102         * html/track/InbandGenericTextTrack.cpp:
2103         * html/track/InbandGenericTextTrack.h:
2104         * html/track/InbandTextTrack.cpp:
2105         * html/track/InbandTextTrack.h:
2106         * html/track/InbandWebVTTTextTrack.cpp:
2107         * html/track/InbandWebVTTTextTrack.h:
2108         * html/track/LoadableTextTrack.cpp:
2109         * html/track/LoadableTextTrack.h:
2110         * html/track/TextTrack.cpp:
2111         * html/track/TextTrack.h:
2112         * html/track/TextTrackCue.cpp:
2113         * html/track/TextTrackCue.h:
2114         * html/track/TextTrackCueGeneric.cpp:
2115         * html/track/TextTrackCueGeneric.h:
2116         * html/track/TextTrackList.cpp:
2117         * html/track/TextTrackList.h:
2118         * html/track/TrackListBase.cpp:
2119         * html/track/TrackListBase.h:
2120         * html/track/VTTCue.cpp:
2121         * html/track/VTTCue.h:
2122         * html/track/VideoTrackList.h:
2123         * loader/appcache/DOMApplicationCache.cpp:
2124         * loader/appcache/DOMApplicationCache.h:
2125         * page/AbstractDOMWindow.cpp:
2126         * page/AbstractDOMWindow.h:
2127         * page/BarProp.cpp:
2128         * page/BarProp.h:
2129         (WebCore::BarProp::create): Deleted.
2130         * page/DOMWindow.cpp:
2131         * page/DOMWindow.h:
2132         * page/EventSource.cpp:
2133         * page/EventSource.h:
2134         * page/History.cpp:
2135         * page/History.h:
2136         * page/Location.cpp:
2137         * page/Location.h:
2138         (WebCore::Location::create): Deleted.
2139         (WebCore::Location::toString const): Deleted.
2140         * page/Navigator.cpp:
2141         * page/Navigator.h:
2142         * page/Performance.cpp:
2143         * page/Performance.h:
2144         * page/RemoteDOMWindow.cpp:
2145         * page/RemoteDOMWindow.h:
2146         * page/Screen.cpp:
2147         * page/Screen.h:
2148         * page/VisualViewport.cpp:
2149         * page/VisualViewport.h:
2150         * plugins/DOMMimeTypeArray.cpp:
2151         * plugins/DOMMimeTypeArray.h:
2152         (WebCore::DOMMimeTypeArray::create): Deleted.
2153         * plugins/DOMPlugin.cpp:
2154         * plugins/DOMPlugin.h:
2155         (WebCore::DOMPlugin::create): Deleted.
2156         * plugins/DOMPluginArray.cpp:
2157         * plugins/DOMPluginArray.h:
2158         (WebCore::DOMPluginArray::create): Deleted.
2159         * storage/Storage.cpp:
2160         * storage/Storage.h:
2161         (WebCore::Storage::area const): Deleted.
2162         * workers/AbstractWorker.cpp:
2163         * workers/AbstractWorker.h:
2164         * workers/DedicatedWorkerGlobalScope.cpp:
2165         * workers/DedicatedWorkerGlobalScope.h:
2166         * workers/Worker.cpp:
2167         * workers/Worker.h:
2168         * workers/WorkerGlobalScope.cpp:
2169         * workers/WorkerGlobalScope.h:
2170         * workers/service/ServiceWorker.cpp:
2171         * workers/service/ServiceWorker.h:
2172         * workers/service/ServiceWorkerContainer.cpp:
2173         * workers/service/ServiceWorkerContainer.h:
2174         * workers/service/ServiceWorkerGlobalScope.cpp:
2175         * workers/service/ServiceWorkerGlobalScope.h:
2176         * workers/service/ServiceWorkerRegistration.cpp:
2177         * workers/service/ServiceWorkerRegistration.h:
2178         * worklets/PaintWorkletGlobalScope.cpp:
2179         * worklets/PaintWorkletGlobalScope.h:
2180         * worklets/Worklet.cpp:
2181         * worklets/Worklet.h:
2182         * worklets/WorkletGlobalScope.cpp:
2183         * worklets/WorkletGlobalScope.h:
2184         * xml/XMLHttpRequest.cpp:
2185         * xml/XMLHttpRequest.h:
2186         * xml/XMLHttpRequestEventTarget.h:
2187         * xml/XMLHttpRequestUpload.cpp:
2188         * xml/XMLHttpRequestUpload.h:
2189         * xml/XPathParser.cpp:
2190
2191 2019-04-04  Chris Dumez  <cdumez@apple.com>
2192
2193         Unreviewed, fix iOS build with recent SDKs.
2194
2195         std::ptr_fun() is deprecated.
2196
2197         * platform/ios/LegacyTileGrid.mm:
2198         (WebCore::LegacyTileGrid::dropDistantTiles):
2199
2200 2019-04-04  Antoine Quint  <graouts@apple.com>
2201
2202         [Web Animations] JS wrapper may be deleted while animation is yet to dispatch its finish event
2203         https://bugs.webkit.org/show_bug.cgi?id=196118
2204         <rdar://problem/46614137>
2205
2206         Reviewed by Ryosuke Niwa.
2207
2208         Test: webanimations/js-wrapper-kept-alive.html
2209
2210         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.
2211
2212         * animation/WebAnimation.cpp:
2213         (WebCore::WebAnimation::stop): Drive-by fix for the missing superclass method call.
2214         (WebCore::WebAnimation::hasPendingActivity const):
2215         * animation/WebAnimation.h:
2216
2217 2019-04-04  Miguel Gomez  <magomez@igalia.com>
2218
2219         [GTK][WPE] Use a timer to request the creation of pending tiles
2220         https://bugs.webkit.org/show_bug.cgi?id=196594
2221
2222         Reviewed by Žan Doberšek.
2223
2224         Use a timer to request pending tile creation, as calls to notifyFlushRequired() are discarded
2225         while inside a layer flush.
2226
2227         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2228         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
2229         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
2230         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
2231         (WebCore::CoordinatedGraphicsLayer::requestPendingTileCreationTimerFired):
2232         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2233
2234 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2235
2236         [ATK] Wrong index passed to AtkObject::children-changed::add signal in AXObjectCache::attachWrapper()
2237         https://bugs.webkit.org/show_bug.cgi?id=196538
2238
2239         Reviewed by Michael Catanzaro.
2240
2241         In most of the cases the parent is not found, probably because the child is not a direct descendant of the
2242         parent returned by parentObjectUnignored(). We need to handle the case of find() returning notFound.
2243
2244         * accessibility/atk/AXObjectCacheAtk.cpp:
2245         (WebCore::AXObjectCache::attachWrapper): Use -1 as the index when find() returns notFound.
2246
2247 2019-04-03  Timothy Hatcher  <timothy@apple.com>
2248
2249         Update AutoFill field icons to be SVG instead of PNG images.
2250         https://bugs.webkit.org/show_bug.cgi?id=196557
2251         rdar://problem/48292514
2252
2253         Reviewed by Tim Horton.
2254
2255         * css/html.css:
2256         (input::-webkit-credentials-auto-fill-button):
2257         (input::-webkit-contacts-auto-fill-button):
2258         (input::-webkit-credit-card-auto-fill-button):
2259
2260 2019-04-03  Simon Fraser  <simon.fraser@apple.com>
2261
2262         Simplify some "programmaticScroll" code paths
2263         https://bugs.webkit.org/show_bug.cgi?id=196589
2264
2265         Reviewed by Zalan Bujtas.
2266
2267         AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll() just returned early if programmaticScroll
2268         was true, so instead, just never call it. This means we can remove the "programmaticScroll" argument from 
2269         scheduleUpdateScrollPositionAfterAsyncScroll(). Also change some callers to use the ScrollType enum
2270         instead of a bool.
2271
2272         Now, ThreadedScrollingTree::scrollingTreeNodeDidScroll() just returns early. Programmatic scrolls
2273         update state on the main thread before updating the scrolling tree, so this makes sense.
2274
2275         * page/scrolling/AsyncScrollingCoordinator.cpp:
2276         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
2277         (WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll):
2278         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScrollTimerFired):
2279         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
2280         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
2281         * page/scrolling/AsyncScrollingCoordinator.h:
2282         (WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::ScheduledScrollUpdate):
2283         (WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::matchesUpdateType const):
2284         * page/scrolling/ScrollingCoordinator.cpp:
2285         (WebCore::operator<<):
2286         * page/scrolling/ScrollingCoordinator.h:
2287         (WebCore::ScrollingCoordinator::reconcileScrollingState):
2288         * page/scrolling/ThreadedScrollingTree.cpp:
2289         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
2290
2291 2019-04-03  Youenn Fablet  <youenn@apple.com>
2292
2293         Add logging and ASSERTs to investigate issue with VPModuleInitialize
2294         https://bugs.webkit.org/show_bug.cgi?id=196573
2295
2296         Reviewed by Eric Carlson.
2297
2298         Add some ASSERTs.
2299         No change of behavior.
2300
2301         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
2302         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
2303         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
2304
2305 2019-04-03  Simon Fraser  <simon.fraser@apple.com>
2306
2307         Remove some redundant memebers from ScrollingStateFrameScrollingNode
2308         https://bugs.webkit.org/show_bug.cgi?id=196571
2309
2310         Reviewed by Zalan Bujtas.
2311
2312         m_requestedScrollPosition and m_requestedScrollPositionRepresentsProgrammaticScroll were
2313         duplicated on ScrollingStateFrameScrollingNode and ScrollingStateScrollingNode, so
2314         remove them from the derived class.
2315
2316         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2317         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
2318         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
2319         * page/scrolling/ScrollingStateFrameScrollingNode.h:
2320
2321 2019-04-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
2322
2323         REGRESSION (r220717): Assertion fires when animating an SVG rounded corner rect till it collapses
2324         https://bugs.webkit.org/show_bug.cgi?id=196518
2325
2326         Reviewed by Simon Fraser.
2327
2328         r220717 made RenderSVGRect clear its m_path in updateShapeFromElement().
2329
2330         RenderSVGRect tries to optimize its layout and drawing if the rectangle
2331         is not rounded. So it uses the flag m_usePathFallback to know whether to
2332         use m_path or m_innerStrokeRect and m_outerStrokeRect. If the rectangle
2333         is rounded but its boundingSize is empty, m_path will be cleared,
2334         m_innerStrokeRect and m_outerStrokeRect will be recalculated but
2335         m_usePathFallback will not be reset to false. Therefore when calling 
2336         RenderSVGRect::isEmpty(), it will call RenderSVGShape::isEmpty() which
2337         will assert since m_path is null.
2338
2339         Test: svg/animations/animate-rounded-corner-rect-zero-height.svg
2340
2341         * rendering/svg/RenderSVGRect.cpp:
2342         (WebCore::RenderSVGRect::updateShapeFromElement):
2343         Reset m_usePathFallback to false once clearPath() is called.
2344
2345 2019-04-03  Ryosuke Niwa  <rniwa@webkit.org>
2346
2347         Nullptr crash in InlineTextBox::selectionState via TextIndicator::createWithRange
2348         https://bugs.webkit.org/show_bug.cgi?id=196579
2349
2350         Reviewed by Simon Fraser.
2351
2352         Avoid crashing accessing the unengated optional's value in relese builds for now.
2353
2354         Unfortunately, fixing the underlying cause of the selection states of RenderView & RenderObject
2355         getting out out of sync would require a significant re-architecturing of the whole selection
2356         repainting / state managing mechanism.
2357
2358         * rendering/SelectionRangeData.h:
2359         (WebCore::SelectionRangeData::startPosition const):
2360         (WebCore::SelectionRangeData::endPosition const):
2361
2362 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
2363
2364         -apple-trailing-word is needed for browser detection
2365         https://bugs.webkit.org/show_bug.cgi?id=196575
2366
2367         Unreviewed.
2368
2369         This is an unreviewed partial revert of r243819. Turns out there are some websites
2370         which use this property to do browser detection. So, we need to continue to parse
2371         the property, but we don't need the property to do anything.
2372
2373         Test: fast/text/trailing-word-detection.html
2374
2375         * Configurations/FeatureDefines.xcconfig:
2376         * css/CSSComputedStyleDeclaration.cpp:
2377         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2378         * css/CSSPrimitiveValueMappings.h:
2379         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2380         (WebCore::CSSPrimitiveValue::operator TrailingWord const):
2381         * css/CSSProperties.json:
2382         * css/CSSValueKeywords.in:
2383         * css/parser/CSSParserFastPaths.cpp:
2384         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2385         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
2386         * rendering/style/RenderStyle.h:
2387         (WebCore::RenderStyle::trailingWord const):
2388         (WebCore::RenderStyle::setTrailingWord):
2389         (WebCore::RenderStyle::initialTrailingWord):
2390         * rendering/style/RenderStyleConstants.h:
2391
2392 2019-04-03  Don Olmstead  <don.olmstead@sony.com>
2393
2394         [CMake][WTF] Mirror XCode header directories
2395         https://bugs.webkit.org/show_bug.cgi?id=191662
2396
2397         Reviewed by Konstantin Tokarev.
2398
2399         Use WTFFramework as a dependency and include frameworks/WTF.cmake for AppleWin internal
2400         builds.
2401
2402         * CMakeLists.txt:
2403         * PlatformWin.cmake:
2404
2405 2019-04-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
2406
2407         Remove SVG properties tear-off objects
2408         https://bugs.webkit.org/show_bug.cgi?id=191237
2409
2410         Reviewed by Simon Fraser.
2411
2412         This patch cleans the code from unused SVG sources and get rid off the
2413         remaining SVG properties tear-off objects. Here are more details:
2414
2415         -- Remove the SVGAttributeAnimationController and move its code to the
2416            SVGAnimateElementBase. SVGAttributeAnimationController was introduced
2417            to allow animating the SVG properties whether they are backed by tear
2418            off objects or not. Since there will be no tear off objects anymore,
2419            one animation controller will be needed. But in this case, it will be
2420            better if we make SVGAnimateElementBase is the animation controller
2421            and make it manage the animator directly.
2422
2423         -- Remove SVGAttributeRegistry, SVGAttributeOwnerProxy and the virtual
2424            function SVGElement::attributeOwnerProxy(). Remove also all the
2425            overriding functions attributeOwnerProxy() from all the SVGElements.
2426
2427         -- Remove isKnownAttribute() from all the SVG header files except from 
2428            four classes: SVGURIReference, SVGFitToViewBox, SVGLangSpace
2429            and SVGExternalResourcesRequired.
2430
2431         -- Remove all the SVG animated properties classifying functions from
2432            SVGElement. This is now handled by SVGPropertyRegistry.
2433
2434         -- There is no need for the enum AnimatedPropertyType anymore. The SVG
2435            property accessor knows its type, knows how to access it and know what
2436            animator it should be created for it.
2437
2438         * Sources.txt:
2439         * WebCore.xcodeproj/project.pbxproj:
2440         * dom/Element.cpp:
2441         (WebCore::Element::synchronizeAllAttributes const):
2442         (WebCore::Element::synchronizeAttribute const):
2443         (WebCore::Element::fastAttributeLookupAllowed const):
2444         These functions are surprisingly marked 'const'. They were calling 'const'
2445         functions in SVGElement and SVGElement was casting 'this' as non 'const'
2446         before calling the non 'const' functions through the non 'const' 'this'
2447         pointer. Change this by moving the casting to the Element functions.
2448
2449         * rendering/svg/RenderSVGResourceGradient.cpp:
2450         (WebCore::RenderSVGResourceGradient::applyResource):
2451         * rendering/svg/RenderSVGResourcePattern.cpp:
2452         (WebCore::RenderSVGResourcePattern::applyResource):
2453         * svg/SVGAElement.h:
2454         * svg/SVGAltGlyphElement.h:
2455         * svg/SVGAnimateElementBase.cpp:
2456         (WebCore::SVGAnimateElementBase::SVGAnimateElementBase):
2457         (WebCore::SVGAnimateElementBase::animator const):
2458         (WebCore::SVGAnimateElementBase::hasInvalidCSSAttributeType const):
2459         (WebCore::SVGAnimateElementBase::isDiscreteAnimator const):
2460         (WebCore::SVGAnimateElementBase::setTargetElement):
2461         (WebCore::SVGAnimateElementBase::setAttributeName):
2462         (WebCore::SVGAnimateElementBase::resetAnimation):
2463         (WebCore::SVGAnimateElementBase::calculateFromAndToValues):
2464         (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
2465         (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):
2466         (WebCore::SVGAnimateElementBase::resetAnimatedType):
2467         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
2468         (WebCore::SVGAnimateElementBase::applyResultsToTarget):
2469         (WebCore::SVGAnimateElementBase::clearAnimatedType):
2470         (WebCore::SVGAnimateElementBase::calculateDistance):
2471         (WebCore::SVGAnimateElementBase::attributeAnimationController): Deleted.
2472         (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType const): Deleted.
2473         (WebCore::SVGAnimateElementBase::isAdditive const): Deleted.
2474         * svg/SVGAnimateElementBase.h:
2475         (WebCore::SVGAnimateElementBase::animatorIfExists const):
2476         (WebCore::SVGAnimateElementBase::attributeAnimationControllerIfExists const): Deleted.
2477         The order of the functions was changed to resemble the order of running
2478         the animation:
2479           -- Setting the animation range
2480           -- Starting the animation
2481           -- Progressing the animation
2482           -- Applying the the progressed animaVal() to the target element
2483           -- Stopping the animation
2484
2485         * svg/SVGAnimateMotionElement.cpp:
2486         (WebCore::SVGAnimateMotionElement::calculateDistance):
2487         * svg/SVGAnimateMotionElement.h:
2488         * svg/SVGAnimationElement.cpp:
2489         (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced):
2490         (WebCore::SVGAnimationElement::shouldApplyAnimation): Deleted.
2491         * svg/SVGAnimationElement.h:
2492         (WebCore::SVGAnimationElement::attributeRegistry): Deleted.
2493         (WebCore::SVGAnimationElement::calculateDistance): Deleted.
2494         * svg/SVGAttributeAnimationController.cpp: Removed.
2495         * svg/SVGAttributeAnimationController.h: Removed.
2496         * svg/SVGAttributeAnimationControllerBase.cpp: Removed.
2497         * svg/SVGAttributeAnimationControllerBase.h: Removed.
2498         * svg/SVGCircleElement.h:
2499         * svg/SVGClipPathElement.h:
2500         * svg/SVGComponentTransferFunctionElement.h:
2501         * svg/SVGCursorElement.h:
2502         * svg/SVGDefsElement.h:
2503         * svg/SVGElement.cpp:
2504         (WebCore::SVGElement::synchronizeAttribute):
2505         (WebCore::SVGElement::synchronizeAllAttributes):
2506         (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute):
2507         (WebCore::createAttributeNameToAnimatedPropertyTypeMap): Deleted.
2508         (WebCore::attributeNameToAnimatedPropertyTypeMap): Deleted.
2509         (WebCore::createCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted.
2510         (WebCore::cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted.
2511         (WebCore::SVGElement::animatedPropertyTypesForAttribute): Deleted.
2512         (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const): Deleted.
2513         (WebCore::SVGElement::isAnimatableCSSProperty): Deleted.
2514         (WebCore::SVGElement::isPresentationAttributeWithSVGDOM): Deleted.
2515         * svg/SVGElement.h:
2516         (WebCore::SVGElement::attributeOwnerProxy const): Deleted.
2517         (WebCore::SVGElement::attributeRegistry): Deleted.
2518         (WebCore::SVGElement::synchronizeAttribute): Deleted.
2519         (WebCore::SVGElement::synchronizeAttributes): Deleted.
2520         (WebCore::SVGElement::animatedTypes const): Deleted.
2521         (WebCore::SVGElement::lookupAnimatedProperty const): Deleted.
2522         (WebCore::SVGElement::lookupOrCreateAnimatedProperty): Deleted.
2523         (WebCore::SVGElement::lookupOrCreateAnimatedProperties): Deleted.
2524         (WebCore::SVGElement::isKnownAttribute): Deleted.
2525         * svg/SVGEllipseElement.h:
2526         * svg/SVGExternalResourcesRequired.h:
2527         (WebCore::SVGExternalResourcesRequired::attributeRegistry): Deleted.
2528         (WebCore::SVGExternalResourcesRequired::attributeOwnerProxy): Deleted.
2529         * svg/SVGFEBlendElement.h:
2530         * svg/SVGFEColorMatrixElement.h:
2531         * svg/SVGFEComponentTransferElement.h:
2532         * svg/SVGFECompositeElement.h:
2533         * svg/SVGFEConvolveMatrixElement.h:
2534         * svg/SVGFEDiffuseLightingElement.h:
2535         * svg/SVGFEDisplacementMapElement.h:
2536         * svg/SVGFEDropShadowElement.h:
2537         * svg/SVGFEGaussianBlurElement.h:
2538         * svg/SVGFEImageElement.h:
2539         * svg/SVGFELightElement.h:
2540         * svg/SVGFEMergeNodeElement.h:
2541         * svg/SVGFEMorphologyElement.h:
2542         * svg/SVGFEOffsetElement.h:
2543         * svg/SVGFESpecularLightingElement.h:
2544         * svg/SVGFETileElement.h:
2545         * svg/SVGFETurbulenceElement.h:
2546         * svg/SVGFilterElement.h:
2547         * svg/SVGFilterPrimitiveStandardAttributes.h:
2548         (WebCore::SVGFilterPrimitiveStandardAttributes::attributeRegistry): Deleted.
2549         * svg/SVGFitToViewBox.h:
2550         (WebCore::SVGFitToViewBox::attributeRegistry): Deleted.
2551         * svg/SVGFontElement.h:
2552         * svg/SVGForeignObjectElement.h:
2553         * svg/SVGGElement.h:
2554         * svg/SVGGeometryElement.h:
2555         * svg/SVGGlyphRefElement.h:
2556         * svg/SVGGradientElement.cpp:
2557         (WebCore::SVGGradientElement::svgAttributeChanged):
2558         * svg/SVGGradientElement.h:
2559         (WebCore::SVGGradientElement::attributeRegistry): Deleted.
2560         (WebCore::SVGGradientElement::isKnownAttribute): Deleted.
2561         * svg/SVGGraphicsElement.h:
2562         (WebCore::SVGGraphicsElement::attributeRegistry): Deleted.
2563         * svg/SVGImageElement.h:
2564         * svg/SVGLineElement.h:
2565         * svg/SVGLinearGradientElement.h:
2566         * svg/SVGMPathElement.h:
2567         * svg/SVGMarkerElement.cpp:
2568         * svg/SVGMarkerElement.h:
2569         * svg/SVGMaskElement.h:
2570         * svg/SVGPathElement.h:
2571         * svg/SVGPatternElement.h:
2572         * svg/SVGPolyElement.h:
2573         * svg/SVGRadialGradientElement.h:
2574         * svg/SVGRectElement.h:
2575         * svg/SVGSVGElement.h:
2576         * svg/SVGScriptElement.h:
2577         * svg/SVGStopElement.h:
2578         * svg/SVGSwitchElement.h:
2579         * svg/SVGSymbolElement.h:
2580         * svg/SVGTRefElement.h:
2581         * svg/SVGTests.cpp:
2582         (WebCore::SVGTests::svgAttributeChanged):
2583         (WebCore::SVGTests::attributeRegistry): Deleted.
2584         (WebCore::SVGTests::isKnownAttribute): Deleted.
2585         * svg/SVGTests.h:
2586         * svg/SVGTextContentElement.cpp:
2587         * svg/SVGTextContentElement.h:
2588         (WebCore::SVGTextContentElement::attributeRegistry): Deleted.
2589         * svg/SVGTextPathElement.h:
2590         * svg/SVGTextPositioningElement.h:
2591         (WebCore::SVGTextPositioningElement::attributeRegistry): Deleted.
2592         * svg/SVGURIReference.cpp:
2593         (WebCore::SVGURIReference::SVGURIReference):
2594         (WebCore::SVGURIReference::attributeRegistry): Deleted.
2595         * svg/SVGURIReference.h:
2596         * svg/SVGUseElement.h:
2597         * svg/SVGViewElement.h:
2598         * svg/SVGViewSpec.cpp:
2599         (WebCore::SVGViewSpec::SVGViewSpec):
2600         * svg/SVGViewSpec.h:
2601         * svg/SVGZoomAndPanType.h:
2602         * svg/properties/SVGAnimatedListPropertyTearOff.h: Removed.
2603         * svg/properties/SVGAnimatedPropertyAnimator.h:
2604         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
2605         * svg/properties/SVGAnimatedPropertyPairAnimator.h:
2606         * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
2607         * svg/properties/SVGAnimatedPropertyTearOff.h: Removed.
2608         * svg/properties/SVGAnimatedPropertyType.h: Removed.
2609
2610         * svg/properties/SVGAnimationAdditiveFunction.h:
2611         (WebCore::SVGAnimationAdditiveFunction::animate):
2612         (WebCore::SVGAnimationAdditiveFunction::progress): Deleted.
2613         * svg/properties/SVGAnimationAdditiveListFunctionImpl.h:
2614         (WebCore::SVGAnimationLengthListFunction::animate):
2615         (WebCore::SVGAnimationNumberListFunction::animate):
2616         (WebCore::SVGAnimationPointListFunction::animate):
2617         (WebCore::SVGAnimationTransformListFunction::animate):
2618         (WebCore::SVGAnimationLengthListFunction::progress): Deleted.
2619         (WebCore::SVGAnimationNumberListFunction::progress): Deleted.
2620         (WebCore::SVGAnimationPointListFunction::progress): Deleted.
2621         (WebCore::SVGAnimationTransformListFunction::progress): Deleted.
2622         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
2623         (WebCore::SVGAnimationAngleFunction::animate):
2624         (WebCore::SVGAnimationColorFunction::animate):
2625         (WebCore::SVGAnimationIntegerFunction::animate):
2626         (WebCore::SVGAnimationLengthFunction::animate):
2627         (WebCore::SVGAnimationNumberFunction::animate):
2628         (WebCore::SVGAnimationPathSegListFunction::animate):
2629         (WebCore::SVGAnimationRectFunction::animate):
2630         (WebCore::SVGAnimationAngleFunction::progress): Deleted.
2631         (WebCore::SVGAnimationColorFunction::progress): Deleted.
2632         (WebCore::SVGAnimationIntegerFunction::progress): Deleted.
2633         (WebCore::SVGAnimationLengthFunction::progress): Deleted.
2634         (WebCore::SVGAnimationNumberFunction::progress): Deleted.
2635         (WebCore::SVGAnimationPathSegListFunction::progress): Deleted.
2636         (WebCore::SVGAnimationRectFunction::progress): Deleted.
2637         * svg/properties/SVGAnimationDiscreteFunction.h:
2638         (WebCore::SVGAnimationDiscreteFunction::animate):
2639         (WebCore::SVGAnimationDiscreteFunction::progress): Deleted.
2640         * svg/properties/SVGAnimationFunction.h:
2641         (WebCore::SVGAnimationFunction::calculateDistance const):
2642         -- Rename the 'progress()' functions of SVGAttributeAnimator and SVGAnimationFunction
2643            to 'animate()'.
2644         -- Rename the argument 'percentage' of these function to 'progress'
2645         -- Make calculateDistance return Optional<float> so it does not have to
2646            return -1 in case of error.
2647
2648         * svg/properties/SVGAttribute.h: Removed.
2649         * svg/properties/SVGAttributeAccessor.h: Removed.
2650         * svg/properties/SVGAttributeAnimator.h:
2651         (WebCore::SVGAttributeAnimator::calculateDistance const):
2652         * svg/properties/SVGAttributeOwnerProxy.cpp: Removed.
2653         * svg/properties/SVGAttributeOwnerProxy.h: Removed.
2654         * svg/properties/SVGAttributeOwnerProxyImpl.h: Removed.
2655         * svg/properties/SVGAttributeRegistry.h: Removed.
2656         * svg/properties/SVGLegacyAnimatedProperty.cpp: Removed.
2657         * svg/properties/SVGLegacyAnimatedProperty.h: Removed.
2658         * svg/properties/SVGLegacyProperty.h: Removed.
2659         * svg/properties/SVGListProperty.h: Removed.
2660         * svg/properties/SVGListPropertyTearOff.h: Removed.
2661         * svg/properties/SVGPrimitivePropertyAnimator.h:
2662         * svg/properties/SVGProperty.h:
2663         * svg/properties/SVGPropertyAnimator.h:
2664         * svg/properties/SVGPropertyTearOff.h: Removed.
2665         * svg/properties/SVGValuePropertyAnimator.h:
2666         * svg/properties/SVGValuePropertyListAnimator.h:
2667
2668 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
2669
2670         Documents can be destroyed before their CSSFontFaceSet is destroyed
2671         https://bugs.webkit.org/show_bug.cgi?id=195830
2672
2673         Reviewed by Darin Adler.
2674
2675         CSSFontFaceSet has a raw pointer to its owning document. JS can keep the CSSFontFaceSet alive (by using FontFaceSet)
2676         and can destroy the document at any time. When the document is destroyed, the link between the two objects needs to
2677         be severed.
2678
2679         Test: fast/text/font-face-set-destroy-document.html
2680
2681         * css/CSSFontFace.cpp:
2682         (WebCore::CSSFontFace::CSSFontFace):
2683         * css/CSSFontFace.h:
2684         * css/CSSFontFaceSet.cpp:
2685         (WebCore::CSSFontFaceSet::CSSFontFaceSet):
2686         (WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered):
2687         * css/CSSFontFaceSet.h:
2688         * css/CSSFontSelector.cpp:
2689         (WebCore::CSSFontSelector::CSSFontSelector):
2690         (WebCore::CSSFontSelector::addFontFaceRule):
2691         * css/CSSFontSelector.h:
2692         * css/FontFace.cpp:
2693         (WebCore::FontFace::FontFace):
2694
2695 2019-04-03  Sihui Liu  <sihui_liu@apple.com>
2696
2697         Follow up fix for r243807: Use MarkedArgumentBuffer instead of Vector for JSValue
2698         https://bugs.webkit.org/show_bug.cgi?id=196547
2699
2700         Reviewed by Geoffrey Garen.
2701
2702         JSValue in Vector could be garbage collected because GC doesn't know Vector memory on C++ heap.
2703
2704         * bindings/js/JSIDBRequestCustom.cpp:
2705         (WebCore::JSIDBRequest::result const):
2706
2707 2019-04-03  Chris Dumez  <cdumez@apple.com>
2708
2709         HTML fragment serialization should not strip whitespace from URL attribute values
2710         https://bugs.webkit.org/show_bug.cgi?id=196551
2711
2712         Reviewed by Ryosuke Niwa.
2713
2714         HTML fragment serialization should not strip whitespace from URL attribute values as per:
2715         - https://html.spec.whatwg.org/multipage/parsing.html#html-fragment-serialisation-algorithm
2716
2717         WebKit was stripping such whitespace, Gecko and Blink are not. Align WebKit with other
2718         browser engines and the specification.
2719
2720         No new tests, rebaselined existing test.
2721
2722         * editing/MarkupAccumulator.cpp:
2723         (WebCore::MarkupAccumulator::appendQuotedURLAttributeValue):
2724
2725 2019-04-02  Ryosuke Niwa  <rniwa@webkit.org>
2726
2727         Crash in HTMLCanvasElement::createContext2d after the element got adopted to a new document
2728         https://bugs.webkit.org/show_bug.cgi?id=196527
2729
2730         Reviewed by Antti Koivisto.
2731
2732         We need to update CanvasBase::m_scriptExecutionContext when HTMLCanvasElement moves from
2733         one document to another. Fixed the bug by making CanvasBase::scriptExecutionContext make
2734         a virtual function call instead of directly storing a raw pointer. In HTMLCanvasElement,
2735         we use Node::scriptExecutionContext(). Use ContextDestructionObserver in CustomPaintCanvas
2736         and OffscreenCanvas instead of a raw pointer.
2737
2738         Unfortunately, no new tests since there is no reproducible test case.
2739
2740         * html/CanvasBase.cpp:
2741         (WebCore::CanvasBase::CanvasBase):
2742         * html/CanvasBase.h:
2743         (WebCore::CanvasBase::scriptExecutionContext const):
2744         * html/CustomPaintCanvas.cpp:
2745         (WebCore::CustomPaintCanvas::CustomPaintCanvas):
2746         * html/CustomPaintCanvas.h:
2747         * html/HTMLCanvasElement.cpp:
2748         (WebCore::HTMLCanvasElement::HTMLCanvasElement):
2749         * html/HTMLCanvasElement.h:
2750         * html/OffscreenCanvas.cpp:
2751         (WebCore::OffscreenCanvas::OffscreenCanvas):
2752         * html/OffscreenCanvas.h:
2753
2754 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
2755
2756         Remove support for -apple-trailing-word
2757         https://bugs.webkit.org/show_bug.cgi?id=196525
2758
2759         Reviewed by Zalan Bujtas.
2760
2761         This CSS property is nonstandard and not used.
2762
2763         * Configurations/FeatureDefines.xcconfig:
2764         * css/CSSComputedStyleDeclaration.cpp:
2765         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2766         * css/CSSPrimitiveValueMappings.h:
2767         (WebCore::CSSPrimitiveValue::operator TrailingWord const): Deleted.
2768         * css/CSSProperties.json:
2769         * css/CSSValueKeywords.in:
2770         * css/parser/CSSParserFastPaths.cpp:
2771         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2772         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
2773         * rendering/SimpleLineLayout.cpp:
2774         (WebCore::SimpleLineLayout::canUseForStyle):
2775         * rendering/SimpleLineLayoutCoverage.cpp:
2776         (WebCore::SimpleLineLayout::printReason):
2777         * rendering/SimpleLineLayoutCoverage.h:
2778         * rendering/line/BreakingContext.h:
2779         (WebCore::BreakingContext::BreakingContext):
2780         (WebCore::BreakingContext::lineBreak):
2781         (WebCore::BreakingContext::clearLineBreakIfFitsOnLine):
2782         (WebCore::BreakingContext::commitLineBreakClear):
2783         (WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
2784         (WebCore::BreakingContext::handleBR):
2785         (WebCore::BreakingContext::handleFloat):
2786         (WebCore::BreakingContext::handleText):
2787         (WebCore::BreakingContext::handleEndOfLine):
2788         (WebCore::BreakingContext::InlineIteratorHistory::InlineIteratorHistory): Deleted.
2789         (WebCore::BreakingContext::InlineIteratorHistory::push): Deleted.
2790         (WebCore::BreakingContext::InlineIteratorHistory::update): Deleted.
2791         (WebCore::BreakingContext::InlineIteratorHistory::renderer const): Deleted.
2792         (WebCore::BreakingContext::InlineIteratorHistory::offset const): Deleted.
2793         (WebCore::BreakingContext::InlineIteratorHistory::nextBreakablePosition const): Deleted.
2794         (WebCore::BreakingContext::InlineIteratorHistory::atTextParagraphSeparator const): Deleted.
2795         (WebCore::BreakingContext::InlineIteratorHistory::previousInSameNode const): Deleted.
2796         (WebCore::BreakingContext::InlineIteratorHistory::get const): Deleted.
2797         (WebCore::BreakingContext::InlineIteratorHistory::current const): Deleted.
2798         (WebCore::BreakingContext::InlineIteratorHistory::historyLength const): Deleted.
2799         (WebCore::BreakingContext::InlineIteratorHistory::moveTo): Deleted.
2800         (WebCore::BreakingContext::InlineIteratorHistory::increment): Deleted.
2801         (WebCore::BreakingContext::InlineIteratorHistory::clear): Deleted.
2802         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord): Deleted.
2803         * rendering/style/RenderStyle.h:
2804         (WebCore::RenderStyle::trailingWord const): Deleted.
2805         (WebCore::RenderStyle::setTrailingWord): Deleted.
2806         (WebCore::RenderStyle::initialTrailingWord): Deleted.
2807         * rendering/style/RenderStyleConstants.h:
2808         * rendering/style/StyleRareInheritedData.cpp:
2809         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
2810         (WebCore::StyleRareInheritedData::operator== const):
2811         * rendering/style/StyleRareInheritedData.h:
2812
2813 2019-04-03  Youenn Fablet  <youenn@apple.com>
2814
2815         Use makePendingActivity in DOMCache
2816         https://bugs.webkit.org/show_bug.cgi?id=196515
2817
2818         Reviewed by Geoffrey Garen.
2819
2820         No change of behavior, just modernizing the code.
2821
2822         * Modules/cache/DOMCache.cpp:
2823         (WebCore::DOMCache::retrieveRecords):
2824         (WebCore::DOMCache::batchDeleteOperation):
2825         (WebCore::DOMCache::batchPutOperation):
2826         * Modules/cache/DOMCacheStorage.cpp:
2827         (WebCore::DOMCacheStorage::match):
2828
2829 2019-04-03  Chris Dumez  <cdumez@apple.com>
2830
2831         [XML Parser] Insert the error message block when stopping parsing and an error occurred
2832         https://bugs.webkit.org/show_bug.cgi?id=196546
2833
2834         Reviewed by Alexey Proskuryakov.
2835
2836         Insert the error message block when stopping parsing and an error occurred. This is based
2837         on the following Blink commit:
2838         - https://chromium.googlesource.com/chromium/src.git/+/565958bc22e2d49fed7af144482c2bf4d416fec5
2839
2840         No new tests, rebaselined existing test.
2841
2842         * xml/parser/XMLDocumentParser.cpp:
2843         (WebCore::XMLDocumentParser::end):
2844         Avoid showing the error message block twice in some cases. No need to ever call
2845         insertErrorMessageBlock() if we're already stopped since stopParsing() already
2846         takes care of doing this.
2847
2848         * xml/parser/XMLDocumentParserLibxml2.cpp:
2849         (WebCore::XMLDocumentParser::stopParsing):
2850         When XMLDocumentParser::stopParsing() is called to stop parsing, call
2851         insertErrorMessageBlock() to insert the <parsererror> element if an error
2852         occurred.
2853
2854 2019-04-03  Youenn Fablet  <youenn@apple.com>
2855
2856         Clear WorkerCacheStorageConnection callbacks on WorkerGlobalScope termination
2857         https://bugs.webkit.org/show_bug.cgi?id=196521
2858
2859         Reviewed by Alex Christensen.
2860
2861         When the worker global scope is preparing for termination,
2862         all ActiveDOMObjects are stopped.
2863         At that time, the completion handlers related to
2864         WorkerCacheStorageConnection should be cleared to be able to free
2865         memory, and as they are now no-op anyway.
2866
2867         We clear the completion handlers once the active DOM objects are stopped
2868         to limit the processing triggered by clearing them.
2869
2870         Introducing a new Stopped error code to handle this case.
2871         Add an assertion so that this error does not surface to JS.
2872
2873         Covered by existing tests.
2874
2875         * Modules/cache/CacheStorageConnection.cpp:
2876         (WebCore::CacheStorageConnection::clearPendingRequests):
2877         * Modules/cache/CacheStorageConnection.h:
2878         * Modules/cache/DOMCacheEngine.cpp:
2879         (WebCore::DOMCacheEngine::errorToException):
2880         * Modules/cache/DOMCacheEngine.h:
2881         * workers/WorkerGlobalScope.cpp:
2882         (WebCore::WorkerGlobalScope::prepareForTermination):
2883         (WebCore::WorkerGlobalScope::stopIndexedDatabase):
2884
2885 2019-04-03  Youenn Fablet  <youenn@apple.com>
2886
2887         Adopt new VCP SPI
2888         https://bugs.webkit.org/show_bug.cgi?id=193357
2889         <rdar://problem/43656651>
2890
2891         Reviewed by Eric Carlson.
2892
2893         Covered by existing tests.
2894
2895         * testing/Internals.cpp:
2896         (WebCore::Internals::supportsVCPEncoder):
2897
2898 2019-04-03  Chris Dumez  <cdumez@apple.com>
2899
2900         Remove legacy webkitRequestAnimationFrame time quirk
2901         https://bugs.webkit.org/show_bug.cgi?id=196458
2902         <rdar://problem/49490207>
2903
2904         Reviewed by Simon Fraser.
2905
2906         Remove legacy webkitRequestAnimationFrame time quirk and log a deprecation
2907         warning whenever webkitRequestAnimationFrame is called.
2908
2909         * dom/ScriptedAnimationController.cpp:
2910         (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
2911         * page/DOMWindow.cpp:
2912         (WebCore::DOMWindow::requestAnimationFrame):
2913         (WebCore::DOMWindow::webkitRequestAnimationFrame):
2914
2915 2019-04-03  Sihui Liu  <sihui_liu@apple.com>
2916
2917         Blob type cannot be stored correctly in IDB when IDBObjectStore has autoIncrement and keyPath options
2918         https://bugs.webkit.org/show_bug.cgi?id=196128
2919
2920         Reviewed by Geoffrey Garen.
2921
2922         If a key is auto-generated, it should become a property of the value object. Network process would perform the 
2923         key injection by deserializing IDBValue into script value, setting the property, serializing the result and 
2924         storing it in a database record. But network process does not have a JSDOMGlobalObject, so it would fail to 
2925         deserialize types including Blob and File.
2926
2927         To solve this issue, we move the key injection to web process and let network process store the original value 
2928         it gets. In this case, when web process asks for some value, network process should return key, value and key 
2929         path so that web process can decide whether it should perform a key injection before returning the result. Note
2930         that the auto-generated key would always be stored as the key in a ObjectStore record.
2931
2932         Test: storage/indexeddb/modern/objectstore-autoincrement-types.html
2933
2934         * Modules/indexeddb/IDBCursor.cpp:
2935         (WebCore::IDBCursor::setGetResult):
2936         * Modules/indexeddb/IDBCursor.h:
2937         (WebCore::IDBCursor::primaryKeyPath):
2938         * Modules/indexeddb/IDBGetAllResult.cpp:
2939         (WebCore::IDBGetAllResult::isolatedCopy):
2940         (WebCore::IDBGetAllResult::addKey):
2941         (WebCore::IDBGetAllResult::addValue):
2942         (WebCore::IDBGetAllResult::keys const):
2943         (WebCore::IDBGetAllResult::values const):
2944         (WebCore::IDBGetAllResult::allBlobFilePaths const):
2945         (WebCore::isolatedCopyOfVariant): Deleted.
2946
2947         * Modules/indexeddb/IDBGetAllResult.h: Introduce an IDBKeyPath parameter. Also replace Variant with two Vectors,
2948         because we only needed to store either key or value before, and now the stored value could be incomplete.
2949         (WebCore::IDBGetAllResult::IDBGetAllResult):
2950         (WebCore::IDBGetAllResult::keyPath const):
2951         (WebCore::IDBGetAllResult::encode const):
2952         (WebCore::IDBGetAllResult::decode):
2953
2954         * Modules/indexeddb/IDBGetResult.cpp:
2955         (WebCore::IDBGetResult::setValue):
2956         * Modules/indexeddb/IDBGetResult.h:
2957         (WebCore::IDBGetResult::IDBGetResult):
2958         (WebCore::IDBGetResult::keyPath const):
2959         * Modules/indexeddb/IDBObjectStore.cpp:
2960         * Modules/indexeddb/IDBRequest.cpp:
2961         (WebCore::IDBRequest::setResult):
2962         (WebCore::IDBRequest::setResultToStructuredClone):
2963         * Modules/indexeddb/IDBRequest.h:
2964         * Modules/indexeddb/IDBTransaction.cpp:
2965         (WebCore::IDBTransaction::didGetAllRecordsOnServer):
2966         (WebCore::IDBTransaction::didGetRecordOnServer):
2967         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2968         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
2969         * Modules/indexeddb/server/MemoryIndex.cpp:
2970         (WebCore::IDBServer::MemoryIndex::getResultForKeyRange const):
2971         (WebCore::IDBServer::MemoryIndex::getAllRecords const):
2972         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
2973         (WebCore::IDBServer::MemoryIndexCursor::currentData):
2974         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2975         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
2976         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
2977         (WebCore::IDBServer::MemoryObjectStore::getAllRecords const):
2978         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
2979         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
2980         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2981         (WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord):
2982         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
2983         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
2984         (WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords):
2985         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
2986         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
2987         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
2988         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
2989         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
2990         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
2991         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
2992         (WebCore::IDBServer::SQLiteIDBCursor::currentData):
2993         * Modules/indexeddb/server/SQLiteIDBCursor.h:
2994
2995         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2996         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Remove the key injection from network process. 
2997         UniqueIDBDatabase stores any value it gets from IDBClient.
2998
2999         * Modules/indexeddb/shared/IDBResultData.cpp:
3000         (WebCore::IDBResultData::getResultRef):
3001         * Modules/indexeddb/shared/IDBResultData.h:
3002
3003         * bindings/js/IDBBindingUtilities.cpp:
3004         (WebCore::injectIDBKeyIntoScriptValue): If property is read-only, set would fail and injectKeyIntoResult would
3005         return null, but we expect it to return result as long as the property value is the same as target. Therefore, 
3006         we can add an early return here.
3007         (WebCore::createKeyPathArray):
3008
3009         (WebCore::generateIndexKeyForValue): We used to generate IndexKey from value stored in database but now the
3010         value gets stored does not include auto-generated key, as we remove the key injection from network process. In 
3011         this case if the IDBIndex has the same key path as the auto-generated key, IndexKey would be failed to create
3012         for it cannot extract auto-generated key from value. Since the auto-generated key would always be the key in 
3013         database record, we could use value of that key when we find a match in key path.
3014
3015         (WebCore::deserializeIDBValueWithKeyInjection): If the key path in the result is single entry, the key is 
3016         probably auto-generated, so we could inject the result key into the result value unconditionally.
3017
3018         * bindings/js/IDBBindingUtilities.h:
3019         * bindings/js/JSIDBCursorWithValueCustom.cpp:
3020         (WebCore::JSIDBCursorWithValue::value const):
3021         * bindings/js/JSIDBRequestCustom.cpp:
3022         (WebCore::JSIDBRequest::result const):
3023
3024 2019-04-03  Michael Catanzaro  <mcatanzaro@igalia.com>
3025
3026         Get rid of HTMLInputElement::setEditingValue
3027         https://bugs.webkit.org/show_bug.cgi?id=196402
3028
3029         Reviewed by Darin Adler.
3030
3031         HTMLInputElement::setEditingValue is only used for Epiphany password autofill. We did it
3032         this way because that's what Chrome uses for autofill, but Apple uses
3033         HTMLInputElement::setValueForUser. Let's switch to that instead, then we can get rid of
3034         setEditingValue.
3035
3036         This fixes logging into ting.com after username and password are autofilled by Epiphany.
3037         Before this change, the login would fail unless you first manually edit either the username
3038         or the password field.
3039
3040         * html/HTMLInputElement.cpp:
3041         (WebCore::HTMLInputElement::setEditingValue): Deleted.
3042         * html/HTMLInputElement.h:
3043         * testing/Internals.cpp:
3044         (WebCore::Internals::setEditingValue): Deleted.
3045         * testing/Internals.h:
3046         * testing/Internals.idl:
3047
3048 2019-04-03  Pablo Saavedra  <psaavedra@igalia.com>
3049
3050         Missing includes that were previously provided via UnifiedSources
3051         https://bugs.webkit.org/show_bug.cgi?id=196434
3052
3053         Unreviewed build fix.
3054
3055         * html/InputType.h:
3056
3057 2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
3058
3059         Introduce and add plumbing for a website policy for meta viewport tag handling
3060         https://bugs.webkit.org/show_bug.cgi?id=196285
3061
3062         Reviewed by Tim Horton.
3063
3064         Add MetaViewportPolicy to DocumentLoader. See WebKit ChangeLog for more detail.
3065
3066         * loader/DocumentLoader.h:
3067         (WebCore::DocumentLoader::metaViewportPolicy const):
3068         (WebCore::DocumentLoader::setMetaViewportPolicy):
3069
3070 2019-04-03  Joseph Pecoraro  <pecoraro@apple.com>
3071
3072         Web Inspector: Remote Inspector indicate callback should always happen on the main thread
3073         https://bugs.webkit.org/show_bug.cgi?id=196513
3074         <rdar://problem/49498284>
3075
3076         Reviewed by Devin Rousso.
3077
3078         * platform/ios/wak/WebCoreThreadSystemInterface.cpp:
3079         (InitWebCoreThreadSystemInterface):
3080
3081 2019-04-02  Simon Fraser  <simon.fraser@apple.com>
3082
3083         REGRESSION (r238266): Exchange 2013 Outlook Web Access displays partially blank page when creating new e-mail
3084         https://bugs.webkit.org/show_bug.cgi?id=196522
3085         rdar://problem/49472941
3086
3087         Reviewed by Zalan Bujtas.
3088
3089         In this content a layer is composited to clip descendants, and has negative z-order children,
3090         so we compute that it "paints into ancestor", and has a foreground layer. This combination doesn't
3091         make sense, and when the layer becomes scrollable, we end up with bad paint phases on layers, and
3092         fail to paint the contents.
3093
3094         Fix by ensuring that a layer has its own backing store if it requires a foreground layer
3095         by virtue of having negative z-order children.
3096
3097         Test: compositing/backing/foreground-layer-no-paints-into-ancestor.html
3098
3099         * rendering/RenderLayerCompositor.cpp:
3100         (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
3101
3102 2019-04-02  Timothy Hatcher  <timothy@apple.com>
3103
3104         Cursor count badge reverts to Zero during Drag & Drop of multiple items.
3105         https://bugs.webkit.org/show_bug.cgi?id=196511
3106
3107         Reviewed by Daniel Bates.
3108
3109         * page/DragController.cpp:
3110         (WebCore::DragController::tryDocumentDrag): Don't set m_numberOfItemsToBeAccepted to
3111         zero when dragging to a non-file input element.
3112
3113 2019-04-02  Chris Dumez  <cdumez@apple.com>
3114
3115         HTML Parser: Remove conditional parsing of <noembed> content
3116         https://bugs.webkit.org/show_bug.cgi?id=196514
3117
3118         Reviewed by Geoffrey Garen.
3119
3120         Our HTML Parser has raw text handling for <noembed> content only if plugins are runnable.
3121         However, the HTML specification doesn't ask such behavior [1], and it doesn't match to
3122         our HTML serializer. We should always handle it as raw text.
3123
3124         Blink already made this change in https://chromium-review.googlesource.com/c/1477556.
3125
3126         [1] https://html.spec.whatwg.org/multipage/parsing.html#parsing-html-fragments:noembed
3127
3128         No new tests, updated existing test.
3129
3130         * html/parser/HTMLParserOptions.cpp:
3131         (WebCore::HTMLParserOptions::HTMLParserOptions):
3132         * html/parser/HTMLParserOptions.h:
3133         * html/parser/HTMLTokenizer.cpp:
3134         (WebCore::HTMLTokenizer::updateStateFor):
3135         * html/parser/HTMLTreeBuilder.cpp:
3136         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
3137
3138 2019-04-02  Chris Dumez  <cdumez@apple.com>
3139
3140         XMLHttpRequestUpload's loadstart event not correct initialized
3141         https://bugs.webkit.org/show_bug.cgi?id=196174
3142         <rdar://problem/49191412>
3143
3144         Reviewed by Alex Christensen.
3145
3146         Align progress event firing with the XHR specification.
3147
3148         No new tests, rebaselined existing tests.
3149
3150         * xml/XMLHttpRequest.cpp:
3151         (WebCore::XMLHttpRequest::createRequest):
3152         As per [1], the loadstart event fired on the XMLHttpRequestUpload object should use
3153         loaded=0 and total=`req’s body’s total bytes`.
3154         [1] https://xhr.spec.whatwg.org/#the-send()-method (step 11.2.)
3155
3156         (WebCore::XMLHttpRequest::didSendData):
3157         As per [2], the progress / load / loadend should use loaded=transmitted and total=length.
3158         [2] https://xhr.spec.whatwg.org/#ref-for-process-request-end-of-body (steps 5, 6 and 7)
3159
3160         (WebCore::XMLHttpRequest::didReceiveData):
3161         As per [3], we should fire the readystatechange event *before* the progress event.
3162         This is covered by web-platform-tests/xhr/send-response-event-order.htm which was failing
3163         differently after the other changes in this patch.
3164         [3] https://xhr.spec.whatwg.org/#ref-for-process-response (steps 9.4 and 9.5)
3165
3166         (WebCore::XMLHttpRequest::dispatchErrorEvents):
3167         As per [4], in case of an error, we should fire the provided 'event' and 'loadend' with
3168         loaded=0 and total=0.
3169         [4] https://xhr.spec.whatwg.org/#request-error-steps (steps 7 and 8)
3170
3171         * xml/XMLHttpRequestUpload.cpp:
3172         (WebCore::XMLHttpRequestUpload::dispatchProgressEvent):
3173         * xml/XMLHttpRequestUpload.h:
3174         Simplify XMLHttpRequestUpload. It no longer needs to store loaded / total as data
3175         members now that they are always passed by the call site. lengthComputable is set
3176         to !!total as [5] says to set it to true if length/total is not 0. 
3177         [5] https://xhr.spec.whatwg.org/#concept-event-fire-progress
3178
3179 2019-04-02  Devin Rousso  <drousso@apple.com>
3180
3181         Web Inspector: Canvas: add support for showing WebGPU contexts
3182         https://bugs.webkit.org/show_bug.cgi?id=196413
3183         <rdar://problem/49438898>
3184
3185         Reviewed by Timothy Hatcher.
3186
3187         Tests: inspector/canvas/create-context-webgpu.html
3188                inspector/canvas/resolveCanvasContext-webgpu.html
3189
3190         * Modules/webgpu/GPUCanvasContext.idl:
3191         * Modules/webgpu/GPUCanvasContext.h:
3192         (WebCore::GPUCanvasContext::canvas const): Added.
3193         * Modules/webgpu/GPUCanvasContext.cpp:
3194         (WebCore::GPUCanvasContext::create):
3195
3196         * testing/InternalSettings.idl:
3197         * testing/InternalSettings.h:
3198         * testing/InternalSettings.cpp:
3199         (WebCore::InternalSettings::setWebGPUEnabled): Added.
3200
3201 2019-04-02  Chris Dumez  <cdumez@apple.com>
3202
3203         [WK2] Add support for Window's beforeprint / afterprint events
3204         https://bugs.webkit.org/show_bug.cgi?id=196478
3205
3206         Reviewed by Alex Christensen.
3207
3208         Add support for Window's beforeprint / afterprint events as per:
3209         - https://html.spec.whatwg.org/#dom-print
3210
3211         Blink and Gecko already support this.
3212
3213         Test: printing/printing-events.html
3214
3215         * dom/EventNames.h:
3216         * html/HTMLAttributeNames.in:
3217         * html/HTMLBodyElement.cpp:
3218         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
3219         * page/Page.cpp:
3220         (WebCore::dispatchPrintEvent):
3221         (WebCore::Page::dispatchBeforePrintEvent):
3222         (WebCore::Page::dispatchAfterPrintEvent):
3223         * page/Page.h:
3224         * page/WindowEventHandlers.idl:
3225
3226 2019-04-02  Zalan Bujtas  <zalan@apple.com>
3227
3228         [ContentChangeObserver] Hover menus do not function on fidelity.com
3229         https://bugs.webkit.org/show_bug.cgi?id=196507
3230         <rdar://problem/49496520>
3231
3232         Reviewed by Simon Fraser.
3233
3234         fidelity.com has 400ms hover intent timer to bring up the main menus.
3235
3236         Test: fast/events/touch/ios/content-observation/400ms-hover-intent.html
3237
3238         * page/ios/ContentChangeObserver.cpp:
3239
3240 2019-04-02  Timothy Hatcher  <timothy@apple.com>
3241
3242         NSAttributedString crashes when encoding text attachment cell for missing image.
3243         https://bugs.webkit.org/show_bug.cgi?id=196504
3244         rdar://problem/49161281
3245
3246         Reviewed by Tim Horton.
3247
3248         Clean up and fix a couple of errors and crashes in the missing image path of our
3249         attributed string converter.
3250
3251         Fixes include:
3252         * Removed manual call to release on a RetainPtr, leading to autorelease pool crash.
3253         * No longer try to load an image that is missing on disk and has long been renamed.
3254         * No longer use a NSTextAttachmentCell in the Mac code path which can't be encoded
3255           for sending to the UIProcess, so it was pretty useless in the web content process.
3256         * Stopped using NSFileWrapper for the missing image so the attachment can contain the
3257           retina versions of the missing image.
3258         * Simplified bundle finding code, since WebCore is assumed to be loaded.
3259         * Fix leak of attachment by adding missing adoptNS().
3260
3261         * editing/cocoa/HTMLConverter.mm:
3262         (HTMLConverter::_addAttachmentForElement): Unify and simplify missing image path.
3263         (_NSFirstPathForDirectoriesInDomains): Deleted.
3264         (_NSSystemLibraryPath): Deleted.
3265         (_webKitBundle): Deleted.
3266
3267 2019-04-02  Chris Dumez  <cdumez@apple.com>
3268
3269         [Fetch API] Allow used body replacement in Request constructor
3270         https://bugs.webkit.org/show_bug.cgi?id=183703
3271         <rdar://problem/49425609>
3272
3273         Reviewed by Youenn Fablet.
3274
3275         Allow used body replacement in Request constructor as per:
3276         - https://github.com/whatwg/fetch/pull/675
3277
3278         No new tests, rebaseline existing test.
3279
3280         * Modules/fetch/FetchRequest.cpp:
3281         (WebCore::FetchRequest::initializeWith):
3282
3283 2019-04-02  Chris Dumez  <cdumez@apple.com>
3284
3285         Unreviewed, rolling out r243551.
3286
3287         Seems to have broken file uploads to SoundCloud
3288
3289         Reverted changeset:
3290
3291         "XMLHttpRequestUpload's loadstart event not correct
3292         initialized"
3293         https://bugs.webkit.org/show_bug.cgi?id=196174
3294         https://trac.webkit.org/changeset/243551
3295
3296 2019-04-02  Justin Fan  <justin_fan@apple.com>
3297
3298         [Web GPU] Implement blend states and color write mask for GPUColorStateDescriptor
3299         https://bugs.webkit.org/show_bug.cgi?id=196474
3300
3301         Reviewed by Myles C. Maxfield.
3302
3303         Blend states and color write masks must now be specified on GPUColorStateDescriptor instead of 
3304         relying on underlying MTLRenderPipelineColorAttachmentDescriptor defaults.
3305
3306         Test: webgpu/blend-triangle-strip.html, webgpu/color-write-mask-triangle-strip.html
3307
3308         * CMakeLists.txt:
3309         * DerivedSources-input.xcfilelist:
3310         * DerivedSources-output.xcfilelist:
3311         * DerivedSources.make:
3312         * Modules/webgpu/GPUBlendDescriptor.idl: 
3313         * Modules/webgpu/GPUColorStateDescriptor.idl:
3314         * Modules/webgpu/GPUColorWriteBits.idl: 
3315         * Sources.txt:
3316         * WebCore.xcodeproj/project.pbxproj:
3317         * bindings/js/WebCoreBuiltinNames.h:
3318         * platform/graphics/gpu/GPUBlendDescriptor.h:
3319         * platform/graphics/gpu/GPUColorStateDescriptor.h:
3320         * platform/graphics/gpu/GPUColorWriteBits.h:
3321         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
3322         (WebCore::mtlColorWriteMaskForGPUColorWriteFlags):
3323         (WebCore::mtlBlendOperationForGPUBlendOperation):
3324         (WebCore::mtlBlendFactorForGPUBlendFactor):
3325         (WebCore::setColorStatesForColorAttachmentArray):
3326         (WebCore::tryCreateMtlRenderPipelineState):
3327         (WebCore::trySetColorStatesForColorAttachmentArray): Deleted.
3328
3329 2019-04-02  Zalan Bujtas  <zalan@apple.com>
3330
3331         [ContentChangeObserver] Ignore reconstructed renderers when checking for visibility change
3332         https://bugs.webkit.org/show_bug.cgi?id=196483
3333         <rdar://problem/49288174>
3334
3335         Reviewed by Simon Fraser.
3336
3337         This patch fixes the cases when the content gets reconstructed in a way that existing and visible elements gain
3338         new renderers within one style recalc. We failed to recognize such cases and ended up detecting the newly constructed renderers
3339         as "visible change" thereby triggering hover.
3340
3341         Test: fast/events/touch/ios/content-observation/visible-content-gains-new-renderer.html
3342
3343         * page/ios/ContentChangeObserver.cpp:
3344         (WebCore::ContentChangeObserver::renderTreeUpdateDidStart):
3345         (WebCore::ContentChangeObserver::renderTreeUpdateDidFinish):
3346         (WebCore::ContentChangeObserver::reset):
3347         (WebCore::ContentChangeObserver::willDestroyRenderer):
3348         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
3349         (WebCore::ContentChangeObserver::RenderTreeUpdateScope::RenderTreeUpdateScope):
3350         (WebCore::ContentChangeObserver::RenderTreeUpdateScope::~RenderTreeUpdateScope):
3351         * page/ios/ContentChangeObserver.h:
3352         (WebCore::ContentChangeObserver::visibleRendererWasDestroyed const):
3353         * rendering/updating/RenderTreeUpdater.cpp:
3354         (WebCore::RenderTreeUpdater::updateRenderTree):
3355         (WebCore::RenderTreeUpdater::tearDownRenderers):
3356
3357 2019-04-02  Fujii Hironori  <Hironori.Fujii@sony.com>
3358
3359         [CMake] WEBKIT_MAKE_FORWARDING_HEADERS shouldn't use POST_BUILD to copy generated headers
3360         https://bugs.webkit.org/show_bug.cgi?id=182757
3361
3362         Reviewed by Don Olmstead.
3363
3364         No new tests because no behavior changes.
3365
3366         * PlatformWin.cmake: Do not use DERIVED_SOURCE_DIRECTORIES of
3367         WEBKIT_MAKE_FORWARDING_HEADERS. Added
3368         WebCore_PRIVATE_FRAMEWORK_HEADERS.
3369         * WebCoreMacros.cmake (GENERATE_DOM_NAMES): Added
3370         ${_namespace}ElementTypeHelpers.h to _outputfiles.
3371
3372 2019-04-02  Cathie Chen  <cathiechen@igalia.com>
3373
3374         Update the status of ResizeObserver in features.json.
3375         https://bugs.webkit.org/show_bug.cgi?id=196443
3376
3377         Reviewed by Rob Buis.
3378
3379         * features.json:
3380
3381 2019-04-01  Ryosuke Niwa  <rniwa@webkit.org>
3382
3383         Nullptr crash in Document::open after calling policyChecker().stopCheck()
3384         https://bugs.webkit.org/show_bug.cgi?id=196479
3385
3386         Reviewed by Antti Koivisto.
3387
3388         Added a missing nullptr check in Document::open after calling m_frame->loader().policyChecker().stopCheck()
3389         since it invokes m_willSubmitFormCompletionHandlers in WebKit2, and that could clear m_frame.
3390
3391         Unfortunately, we don't have any reproducible test case.
3392
3393         * dom/Document.cpp:
3394         (WebCore::Document::open):
3395
3396 2019-04-01  Timothy Hatcher  <timothy@apple.com>
3397
3398         Unreviewed build fix.
3399
3400         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
3401         (WebCore::createAndStoreMasterKey): Add ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END
3402         around SecTrustedApplicationCreateFromPath call.
3403
3404 2019-04-01  Simon Fraser  <simon.fraser@apple.com>
3405
3406         Remove some unused iOS scrolling-related code in Frame
3407         https://bugs.webkit.org/show_bug.cgi?id=196473
3408
3409         Reviewed by Zalan Bujtas.
3410
3411         This code has no callers.
3412
3413         * page/Frame.cpp:
3414         (WebCore::Frame::Frame):
3415         (WebCore::Frame::scrollOverflowLayer): Deleted.
3416         (WebCore::Frame::overflowAutoScrollTimerFired): Deleted.
3417         (WebCore::Frame::startOverflowAutoScroll): Deleted.
3418         (WebCore::Frame::checkOverflowScroll): Deleted.
3419         * page/Frame.h:
3420
3421 2019-04-01  Chris Dumez  <cdumez@apple.com>
3422
3423         Attr nodes are not cloned properly
3424         https://bugs.webkit.org/show_bug.cgi?id=196466
3425
3426         Reviewed by Ryosuke Niwa.
3427
3428         Attr nodes are not cloned properly according to:
3429         - https://dom.spec.whatwg.org/#concept-node-clone
3430
3431         A cloned Attr node should retain its prefix and namespace.
3432
3433         Both Gecko and Blink agree with the DOM specification here.
3434
3435         No new tests, rebaselined existing test.
3436
3437         * dom/Document.cpp:
3438         (WebCore::Document::importNode):
3439
3440 2019-04-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
3441
3442         Remove the SVG tear off objects for SVGMatrix, SVGTransfrom, SVGTransformList and SVGAnimatedTransformList
3443         https://bugs.webkit.org/show_bug.cgi?id=196086
3444
3445         Reviewed by Simon Fraser.
3446
3447         The IDL changes:
3448
3449         SVGTransform.idl:
3450             Remove the NewObject qualifier from matrix attribute. This matches 
3451             the specs: https://www.w3.org/TR/SVG11/coords.html#InterfaceSVGTransform.
3452             SVGTransform will internally hold an SVGMatrix. A change in this
3453             SVGMatrix will affect the container SVGTransform.
3454
3455         SVGTransformList.idl:
3456             Remove the NewObject qualifier from consolidate() method. This matches
3457             the specs:
3458             https://www.w3.org/TR/SVG11/coords.html#__svg__SVGTransformList__consolidate
3459             The method consolidate() should return a reference to the first item
3460             in the list after consolidating it.
3461
3462         Code changes:
3463
3464         -- SVGMatrix is now a superclass of SVGValueProperty<AffineTransform>.
3465            No need for SVGMatrixValue since it was wrapper of AffineTransform.
3466
3467         -- SVGTransformValue now holds a Ref<SVGMatrix> member in addition to the
3468            angle and the rotationCenter. Ref<SVGMatrix> is what SVGTransform.matrix
3469            will return. So a change in this matrix will change the owner SVGTransform.
3470
3471         -- SVGTransform is now the owner of SVGMatrix via its SVGTransformValue.
3472
3473         -- SVGTransformList is now a superclass of SVGValuePropertyList<SVGTransform>.
3474            It is responsible for parsing a String to items of SVGTransform.
3475
3476         -- SVGAnimatedTransformList is now defined as SVGAnimatedPropertyList<
3477            SVGTransformList>.
3478
3479         Note the ownership chain of these objects is the following:
3480
3481         -- SVGAnimatedTransformList owns the SVGTransformList via its baseVal 
3482            and animVal members.
3483
3484         -- SVGTransformList owns SVGTransform via its list of items
3485
3486         -- SVGTransform owns SVGMatrix via its SVGTransformValue.
3487
3488            So a change in SVGMatrix will propagate to the owner SVGElement through
3489            the following ownership chain:
3490
3491            SVGMatrix
3492              |_ SVGTransfrom
3493                   |_ SVGTransformList
3494                        |_ SVGAmimatedTransformList
3495                             |_ SVGElement
3496
3497         To get the mechanics of this change right, a new accessor, a new animator
3498         and animation functions are added for the SVGAnimatedTransformList.
3499
3500         -- SVGViewSpec used to hold an SVGAnimatedTransformListAttribute for the
3501         member m_transform although this member should not be animated. See the
3502         comment in the old SVGViewSpec::transform(). This has been changed in this
3503         patch. SVGViewSpec now holds Ref<SVGTransformList> which matches the specs:
3504         https://www.w3.org/TR/SVG11/types.html#InterfaceSVGViewSpec.
3505
3506         * Sources.txt:
3507         * WebCore.xcodeproj/project.pbxproj:
3508         * svg/SVGAnimateElementBase.cpp:
3509         (WebCore::SVGAnimateElementBase::attributeAnimationController):
3510         (WebCore::SVGAnimateElementBase::hasValidAttributeType const):
3511         (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):
3512         (WebCore::SVGAnimateElementBase::calculateFromAndToValues):
3513         (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
3514         * svg/SVGAnimateElementBase.h:
3515         (WebCore::SVGAnimateElementBase::animateRangeString const):
3516         * svg/SVGAnimateTransformElement.cpp:
3517         (WebCore::SVGAnimateTransformElement::animateRangeString const):
3518         * svg/SVGAnimateTransformElement.h:
3519                 This change is needed because animating the transform attribute can be
3520         written as
3521             <animate ... from="translate(100)" to="translate(200)"/>
3522         or
3523             <animateTransform type="translate" from="100" to="200"/>"
3524         So we need to surround the animation range string with the type qualifier
3525         for animateTransform.
3526
3527         * svg/SVGAnimatedTransformList.cpp: Removed.
3528         * svg/SVGAnimatedTransformList.h: Removed.
3529         * svg/SVGAnimatedType.h: Removed.
3530         * svg/SVGAnimatedTypeAnimator.cpp: Removed.
3531         * svg/SVGAnimatedTypeAnimator.h: Removed.
3532         * svg/SVGAnimationElement.cpp:
3533         (WebCore::SVGAnimationElement::adjustForInheritance): Deleted.
3534         * svg/SVGAnimationElement.h:
3535         (WebCore::SVGAnimationElement::adjustForInheritance): Deleted.
3536         (WebCore::SVGAnimationElement::adjustFromToListValues): Deleted.
3537         (WebCore::SVGAnimationElement::animateDiscreteType): Deleted.
3538         These functions were used by SVGLegacyAttributeAnimationController.
3539
3540         * svg/SVGAnimatorFactory.h: Removed.
3541         * svg/SVGExternalResourcesRequired.h:
3542         (WebCore::SVGExternalResourcesRequired::isKnownAttribute):
3543         * svg/SVGFEImageElement.h:
3544         * svg/SVGFEMorphologyElement.h:
3545         * svg/SVGFETileElement.h:
3546         * svg/SVGFitToViewBox.h:
3547         (WebCore::SVGFitToViewBox::isKnownAttribute):
3548         * svg/SVGGradientElement.cpp:
3549         (WebCore::SVGGradientElement::SVGGradientElement):
3550         (WebCore::SVGGradientElement::parseAttribute):
3551         (WebCore::SVGGradientElement::registerAttributes): Deleted.
3552         * svg/SVGGradientElement.h:
3553         (WebCore::SVGGradientElement::gradientTransform const):
3554         (WebCore::SVGGradientElement::gradientTransformAnimated):
3555         (WebCore::SVGGradientElement::isKnownAttribute):
3556         * svg/SVGGraphicsElement.cpp:
3557         (WebCore::SVGGraphicsElement::SVGGraphicsElement):
3558         (WebCore::SVGGraphicsElement::animatedLocalTransform const):
3559         (WebCore::SVGGraphicsElement::parseAttribute):
3560         (WebCore::SVGGraphicsElement::svgAttributeChanged):
3561         There is one attribute for this element which is "SVGNames::transformAttr"
3562         So there is no need to check for it twice.
3563
3564         (WebCore::SVGGraphicsElement::registerAttributes): Deleted.
3565         * svg/SVGGraphicsElement.h:
3566         (WebCore::SVGGraphicsElement::transform const):
3567         (WebCore::SVGGraphicsElement::transformAnimated):
3568         (WebCore::SVGGraphicsElement::isKnownAttribute): Deleted.
3569         * svg/SVGLangSpace.cpp:
3570         (WebCore::SVGLangSpace::SVGLangSpace):
3571         (WebCore::SVGLangSpace::xmlspace const):
3572         (WebCore::SVGLangSpace::isKnownAttribute):
3573         (WebCore::SVGLangSpace::svgAttributeChanged):
3574         (WebCore::SVGLangSpace::registerAttributes): Deleted.
3575         * svg/SVGLangSpace.h:
3576         (WebCore::SVGLangSpace::xmllang const):
3577         (WebCore::SVGLangSpace::setXmllang):
3578         (WebCore::SVGLangSpace::setXmlspace):
3579         (WebCore::SVGLangSpace::attributeRegistry): Deleted.
3580         (WebCore::SVGLangSpace::isKnownAttribute): Deleted.
3581         * svg/SVGLegacyAttributeAnimationController.cpp: Removed.
3582         * svg/SVGLegacyAttributeAnimationController.h: Removed.
3583         * svg/SVGLinearGradientElement.cpp:
3584         (WebCore::setGradientAttributes):
3585         * svg/SVGMaskElement.h:
3586         * svg/SVGMatrix.h:
3587         (WebCore::SVGMatrix::create):
3588         (WebCore::SVGMatrix::a const):
3589         (WebCore::SVGMatrix::setA):
3590         (WebCore::SVGMatrix::b const):
3591         (WebCore::SVGMatrix::setB):
3592         (WebCore::SVGMatrix::c const):
3593         (WebCore::SVGMatrix::setC):
3594         (WebCore::SVGMatrix::d const):
3595         (WebCore::SVGMatrix::setD):
3596         (WebCore::SVGMatrix::e const):
3597         (WebCore::SVGMatrix::setE):
3598         (WebCore::SVGMatrix::f const):
3599         (WebCore::SVGMatrix::setF):
3600         (WebCore::SVGMatrix::multiply const):
3601         (WebCore::SVGMatrix::inverse const):
3602         (WebCore::SVGMatrix::translate const):
3603         (WebCore::SVGMatrix::scale const):
3604         (WebCore::SVGMatrix::scaleNonUniform const):
3605         (WebCore::SVGMatrix::rotate const):
3606         (WebCore::SVGMatrix::rotateFromVector const):
3607         (WebCore::SVGMatrix::flipX const):
3608         (WebCore::SVGMatrix::flipY const):
3609         (WebCore::SVGMatrix::skewX const):
3610         (WebCore::SVGMatrix::skewY const):
3611         * svg/SVGPatternElement.cpp:
3612         (WebCore::SVGPatternElement::SVGPatternElement):
3613         (WebCore::SVGPatternElement::parseAttribute):
3614         (WebCore::SVGPatternElement::svgAttributeChanged):
3615         (WebCore::SVGPatternElement::collectPatternAttributes const):
3616         (WebCore::SVGPatternElement::localCoordinateSpaceTransform const):
3617         (WebCore::SVGPatternElement::registerAttributes): Deleted.
3618         * svg/SVGPatternElement.h:
3619         * svg/SVGPoint.h:
3620         (WebCore::SVGPoint::matrixTransform const):
3621         * svg/SVGPolyElement.h:
3622         (WebCore::SVGPolyElement::isKnownAttribute): Deleted.
3623         * svg/SVGRadialGradientElement.cpp:
3624         (WebCore::setGradientAttributes):
3625         * svg/SVGSVGElement.cpp:
3626         (WebCore::SVGSVGElement::createSVGTransform):
3627         (WebCore::SVGSVGElement::createSVGTransformFromMatrix):
3628         (WebCore::SVGSVGElement::viewBoxToViewTransform const):
3629         * svg/SVGTextElement.cpp:
3630         (WebCore::SVGTextElement::animatedLocalTransform const):
3631         * svg/SVGTransform.cpp: Removed.
3632         * svg/SVGTransform.h:
3633         (WebCore::SVGTransform::create):
3634         (WebCore::SVGTransform::~SVGTransform):
3635         (WebCore::SVGTransform::clone const):
3636         (WebCore::SVGTransform::type):
3637         (WebCore::SVGTransform::angle):
3638         (WebCore::SVGTransform::matrix):
3639         (WebCore::SVGTransform::setMatrix):
3640         (WebCore::SVGTransform::setTranslate):
3641         (WebCore::SVGTransform::setScale):
3642         (WebCore::SVGTransform::setRotate):
3643         (WebCore::SVGTransform::setSkewX):
3644         (WebCore::SVGTransform::setSkewY):
3645         (WebCore::SVGTransform::SVGTransform):
3646         * svg/SVGTransform.idl:
3647         * svg/SVGTransformList.h:
3648         * svg/SVGTransformList.idl:
3649         * svg/SVGTransformListValues.cpp: Removed.
3650         * svg/SVGTransformListValues.h: Removed.
3651         * svg/SVGTransformValue.cpp: Removed.
3652         * svg/SVGTransformValue.h:
3653         (WebCore::SVGTransformValue::SVGTransformValue):
3654         (WebCore::SVGTransformValue::operator=):
3655         (WebCore::SVGTransformValue::matrix const):
3656         (WebCore::SVGTransformValue::rotationCenter const):
3657         (WebCore::SVGTransformValue::isValid const):
3658         (WebCore::SVGTransformValue::setMatrix):
3659         (WebCore::SVGTransformValue::matrixDidChange):
3660         (WebCore::SVGTransformValue::translate const):
3661         (WebCore::SVGTransformValue::setTranslate):
3662         (WebCore::SVGTransformValue::scale const):
3663         (WebCore::SVGTransformValue::setScale):
3664         (WebCore::SVGTransformValue::setRotate):
3665         (WebCore::SVGTransformValue::setSkewX):
3666         (WebCore::SVGTransformValue::setSkewY):
3667         (WebCore::SVGTransformValue::valueAsString const):
3668         (WebCore::SVGTransformValue::prefixForTransfromType):
3669         (WebCore::SVGTransformValue::appendNumbers const):
3670         (WebCore::SVGTransformValue::appendMatrix const):
3671         (WebCore::SVGTransformValue::appendTranslate const):
3672         (WebCore::SVGTransformValue::appendScale const):
3673         (WebCore::SVGTransformValue::appendRotate const):
3674         (WebCore::SVGTransformValue::appendSkewX const):
3675         (WebCore::SVGTransformValue::appendSkewY const):
3676         (WebCore::SVGTransformValue::matrix): Deleted.
3677         * svg/SVGTransformable.cpp:
3678         (WebCore::SVGTransformable::parseAndSkipType):
3679         (WebCore::parseAndSkipType): Deleted.
3680         (WebCore::SVGTransformable::parseTransformAttribute): Deleted.
3681         The code of this function was moved to SVGTransformList::parse().
3682
3683         * svg/SVGTransformable.h:
3684         There is no need for enum TransformParsingMode. It was used by 
3685         SVGViewSpec::parseViewSpec() to tell SVGTransformable::parseTransformAttribute()
3686         not to clear the list. SVGTransfromList now has two parse() functions:
3687         one public and the second is private. The public one clear the list
3688         before parsing the input String. The private one just does the parsing.
3689         SVGViewSpec::parseViewSpec() calls the private once since it is a friend
3690         of SVGTransfromList.
3691
3692         * svg/SVGValue.h: Removed.
3693         * svg/SVGViewSpec.cpp:
3694         (WebCore::SVGViewSpec::SVGViewSpec):
3695         (WebCore::SVGViewSpec::reset):
3696         (WebCore::SVGViewSpec::parseViewSpec):
3697         (WebCore::SVGViewSpec::registerAttributes): Deleted.
3698         (WebCore::SVGViewSpec::transform): Deleted.
3699         * svg/SVGViewSpec.h:
3700         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
3701         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
3702         * svg/properties/SVGAnimatedPropertyImpl.h:
3703         * svg/properties/SVGAnimatedTransformListPropertyTearOff.h: Removed.
3704         * svg/properties/SVGAnimationAdditiveListFunctionImpl.h:
3705         (WebCore::SVGAnimationTransformListFunction::progress):
3706         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
3707         * svg/properties/SVGAttributeRegistry.h:
3708         * svg/properties/SVGMatrixTearOff.h: Removed.
3709         * svg/properties/SVGPropertyAccessorImpl.h:
3710         * svg/properties/SVGPropertyOwnerRegistry.h:
3711         (WebCore::SVGPropertyOwnerRegistry::registerProperty):
3712
3713 2019-04-01  Devin Rousso  <drousso@apple.com>
3714
3715         Web Inspector: DOMDebugger: breakpoints for attribute modifications still fire when breakpoints are disabled
3716         https://bugs.webkit.org/show_bug.cgi?id=196456
3717         <rdar://problem/49489747>
3718
3719         Reviewed by Joseph Pecoraro.
3720
3721         Test: inspector/dom-debugger/dom-breakpoints.html
3722
3723         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
3724         (WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr):
3725         (WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent):
3726
3727 2019-04-01  Wenson Hsieh  <wenson_hsieh@apple.com>
3728
3729         Unable to copy and paste a PDF from Notes into Mail compose body
3730         https://bugs.webkit.org/show_bug.cgi?id=196442
3731         <rdar://problem/48573098>
3732
3733         Reviewed by Tim Horton.
3734
3735         Refactor some logic for inserting attachment elements upon paste or drop. Currently, we only prefer inserting
3736         content as attachment elements if the items are annotated with UIPreferredPresentationStyleAttachment. However,
3737         many data sources around the system (both first and third party) have not adopted this API, which makes it
3738         difficult to determine whether a given item provider should be treated as a file or not. In this bug in
3739         particular, no preferred presentation style is set, so we fail to handle the paste command by inserting an
3740         attachment element.
3741
3742         However, most apps around the system that write file or attachment-like data to the pasteboard will at least
3743         offer a suggested name for the file, in the form of -[NSItemProvider suggestedName]. To address this, instead of
3744         relying solely on the preferredPresentationStyle, additionally take a suggested name as an indicator that the
3745         item is probably a file.
3746
3747         In fact, Pasteboard::fileContentState already has similar logic to check for either a suggested file name or
3748         explicitly specified presentation style. We pull this out into a separate helper method on PasteboardItemInfo,
3749         and use it for both Pasteboard::fileContentState and prefersAttachmentRepresentation.
3750
3751         Tests:  WKAttachmentTestsIOS.InsertPastedContactAsAttachment
3752                 WKAttachmentTestsIOS.InsertPastedMapItemAsAttachment
3753
3754         * editing/cocoa/WebContentReaderCocoa.mm:
3755         (WebCore::mimeTypeFromContentType):
3756
3757         Work around <rdar://problem/49478229> by using the "text/vcard" MIME type to handle "public.vcard". CoreServices
3758         currently maps "public.vcard" to "text/directory" when using UTTypeCopyPreferredTagWithClass, despite the SPI
3759         -[NSURLFileTypeMappings MIMETypeForExtension:] returning "text/vcard" for a ".vcf" file.
3760
3761         * platform/PasteboardItemInfo.h:
3762         (WebCore::PasteboardItemInfo::canBeTreatedAsAttachmentOrFile const):
3763
3764         Add a helper method to determine whether the PasteboardItemInfo prefers to be represented as inline data, or an
3765         attachment, or neither. This differs slightly from the existing value of preferredPresentationStyle in that we
3766         consider having a suggested file name as a strong indicator that the item should be treated as an attachment,
3767         even if the presentation style is unspecified.
3768
3769         * platform/cocoa/PasteboardCocoa.mm:
3770         (WebCore::Pasteboard::fileContentState):
3771
3772         Use PasteboardItemInfo::canBeTreatedAsAttachmentOrFile().
3773
3774         * platform/ios/PasteboardIOS.mm:
3775         (WebCore::prefersAttachmentRepresentation):
3776
3777         Use PasteboardItemInfo::canBeTreatedAsAttachmentOrFile().
3778
3779 2019-04-01  Tim Horton  <timothy_horton@apple.com>
3780
3781         Make UIWKDocumentContext rects per-character instead of per-word
3782         https://bugs.webkit.org/show_bug.cgi?id=196459
3783
3784         Reviewed by Wenson Hsieh.
3785
3786         No new tests; adjusted expected results of WebKit.DocumentEditingContext.
3787
3788         * editing/TextIterator.cpp:
3789         (WebCore::CharacterIterator::CharacterIterator):
3790         * editing/TextIterator.h:
3791         (WebCore::CharacterIterator::atEnd const):
3792         (WebCore::CharacterIterator::text const):
3793         Add WEBCORE_EXPORT to some things.
3794         Introduce a CharacterIterator constructor that takes Positions, like one that TextIterator has.
3795         Move initializers to the header.
3796
3797 2019-04-01  Antti Koivisto  <antti@apple.com>
3798
3799         Update event region when toggling pointer-events:none
3800         https://bugs.webkit.org/show_bug.cgi?id=195902
3801         <rdar://problem/48988384>
3802
3803         Reviewed by Simon Fraser.
3804
3805         Test: fast/scrolling/ios/event-region-pointer-events.html
3806
3807         Normally paint invalidation requests compositing configuration update whenever anything that would
3808         affect event region changes. However mutating 'pointer-events' property does not cause paint invalidation.
3809
3810         * rendering/RenderElement.cpp:
3811         (WebCore::RenderElement::styleWillChange):
3812
3813         Request compositing update explicitly from the containing layer.
3814
3815         * rendering/RenderLayer.cpp:
3816         (WebCore::RenderLayer::invalidateEventRegion):
3817         * rendering/RenderLayer.h:
3818
3819 2019-04-01  Chris Dumez  <cdumez@apple.com>
3820
3821         Support "noreferrer" for window.open()
3822         https://bugs.webkit.org/show_bug.cgi?id=194533
3823
3824         Reviewed by Geoffrey Garen.
3825
3826         Support "noreferrer" for window.open() as per:
3827         - https://github.com/whatwg/html/pull/4331
3828
3829         Tests: imported/w3c/web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-noreferrer.html
3830                http/wpt/html/browsers/the-window-object/window-open-noopener-webkit.html
3831
3832         * page/DOMWindow.cpp:
3833         (WebCore::DOMWindow::createWindow):
3834         * page/WindowFeatures.cpp:
3835         (WebCore::setWindowFeature):
3836         * page/WindowFeatures.h:
3837
3838 2019-04-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
3839
3840         SVGMatrix.IDL methods do not conform to the specs
3841         https://bugs.webkit.org/show_bug.cgi?id=196263
3842
3843         Reviewed by Simon Fraser.
3844
3845         I think there was a misconception about these functions. The specs link
3846         is: https://www.w3.org/TR/SVG11/coords.html#InterfaceSVGMatrix.
3847
3848         Notice that the specs does not state that the SVGMethod methods should
3849         raise the exception NO_MODIFICATION_ALLOWED_ERR if the object is read
3850         only. Notice setting the attribute 'a' for example may raise this
3851         exception. Therefore, I think the specs wanted to make these operations
3852         read-only. None of the methods should raise the exception
3853         NO_MODIFICATION_ALLOWED_ERR.
3854
3855         In fact the SVG code was doing the right thing. For example SVGMatrix::scale()
3856         was calling SVGMatrixValue::scale() which was making a copy of itself,
3857         applying the scale on the copy and then returning the copy. When 
3858         SVGMatrix::scale() receives the copy of the SVGMatrixValue it creates and
3859         returns a new SVGMatrix object.
3860
3861         * WebCore.xcodeproj/project.pbxproj:
3862         * svg/SVGMatrix.h:
3863         (WebCore::SVGMatrix::create):
3864         (WebCore::SVGMatrix::a const):
3865         (WebCore::SVGMatrix::b const):
3866         (WebCore::SVGMatrix::c const):
3867         (WebCore::SVGMatrix::d const):
3868         (WebCore::SVGMatrix::e const):
3869         (WebCore::SVGMatrix::f const):
3870         (WebCore::SVGMatrix::multiply const):
3871         (WebCore::SVGMatrix::inverse const):
3872         (WebCore::SVGMatrix::translate const):
3873         (WebCore::SVGMatrix::scale const):
3874         (WebCore::SVGMatrix::scaleNonUniform const):
3875         (WebCore::SVGMatrix::rotate const):
3876         (WebCore::SVGMatrix::rotateFromVector const):
3877         (WebCore::SVGMatrix::flipX const):
3878         (WebCore::SVGMatrix::flipY const):
3879         (WebCore::SVGMatrix::skewX const):
3880         (WebCore::SVGMatrix::skewY const):
3881         (WebCore::SVGMatrix::a): Deleted.
3882         (WebCore::SVGMatrix::b): Deleted.
3883         (WebCore::SVGMatrix::c): Deleted.
3884         (WebCore::SVGMatrix::d): Deleted.
3885         (WebCore::SVGMatrix::e): Deleted.
3886         (WebCore::SVGMatrix::f): Deleted.
3887         (WebCore::SVGMatrix::multiply): Deleted.
3888         (WebCore::SVGMatrix::inverse): Deleted.
3889         (WebCore::SVGMatrix::translate): Deleted.
3890         (WebCore::SVGMatrix::scale): Deleted.
3891         (WebCore::SVGMatrix::scaleNonUniform): Deleted.
3892         (WebCore::SVGMatrix::rotate): Deleted.
3893         (WebCore::SVGMatrix::rotateFromVector): Deleted.
3894         (WebCore::SVGMatrix::flipX): Deleted.
3895         (WebCore::SVGMatrix::flipY): Deleted.
3896         (WebCore::SVGMatrix::skewX): Deleted.
3897         (WebCore::SVGMatrix::skewY): Deleted.
3898         (WebCore::SVGMatrix::SVGMatrix): Deleted.
3899         * svg/SVGMatrix.idl:
3900         * svg/SVGMatrixValue.h: Removed.
3901         * svg/SVGTransform.cpp:
3902         (WebCore::SVGTransform::matrix):
3903         * svg/SVGTransformDistance.cpp:
3904         (WebCore::SVGTransformDistance::addToSVGTransform const):
3905         * svg/SVGTransformValue.h:
3906         (WebCore::SVGTransformValue::matrix const):
3907         (WebCore::SVGTransformValue::matrix):
3908         (WebCore::SVGTransformValue::svgMatrix): Deleted.
3909         (WebCore::operator==): Deleted.
3910         (WebCore::operator!=): Deleted.
3911         * svg/properties/SVGMatrixTearOff.h:
3912         * svg/properties/SVGPropertyTearOff.h:
3913         (WebCore::SVGPropertyTearOff::propertyReference const):
3914
3915 2019-04-01  Simon Fraser  <simon.fraser@apple.com>
3916
3917         Plumb through a ScrollType value that indicates whether a scroll was a user or programmatic scroll
3918         https://bugs.webkit.org/show_bug.cgi?id=196424
3919
3920         Reviewed by Zalan Bujtas.
3921
3922         In preparation for fixing webkit.org/b/195584, we need to know if an overflow scroll
3923         is programmatic, so plumb through an enum value. The functions touched by this patch are
3924         only ever called for programmatic scrolls.
3925
3926         * dom/Element.cpp:
3927         (WebCore::Element::scrollTo):
3928         (WebCore::Element::setScrollLeft):
3929         (WebCore::Element::setScrollTop):
3930         * platform/ScrollTypes.h:
3931         * rendering/RenderBox.cpp:
3932         (WebCore::RenderBox::setScrollLeft):
3933         (WebCore::RenderBox::setScrollTop):
3934         * rendering/RenderBox.h:
3935         * rendering/RenderLayer.cpp:
3936         (WebCore::RenderLayer::scrollToXPosition):
3937         (WebCore::RenderLayer::scrollToYPosition):
3938         * rendering/RenderLayer.h:
3939         * rendering/RenderListBox.cpp:
3940         (WebCore::RenderListBox::setScrollLeft):
3941         (WebCore::RenderListBox::setScrollTop):
3942         * rendering/RenderListBox.h:
3943         * rendering/RenderTextControlSingleLine.cpp:
3944         (WebCore::RenderTextControlSingleLine::setScrollLeft):
3945         (WebCore::RenderTextControlSingleLine::setScrollTop):
3946         * rendering/RenderTextControlSingleLine.h:
3947
3948 2019-04-01  Wenson Hsieh  <wenson_hsieh@apple.com>
3949
3950         [iOS] Refactor some logic for inserting pasted or dropped virtual card files as attachment elements
3951         https://bugs.webkit.org/show_bug.cgi?id=196435
3952         Work towards <rdar://problem/48573098>
3953
3954         Reviewed by Darin Adler.
3955
3956         Refactor some existing codepaths on iOS for inserting VCard files as attachment elements. Instead of using a
3957         separate readVirtualContactFile method for converting a vcard file or data into an attachment element (possibly
3958         accompanied by a link), use the existing readFilePaths WebContentReader method.
3959
3960         To handle links which may accompany the attachment element, add a helper method in PasteboardIOS that reads a
3961         titled URL prior to inserting an attachment element, in the case of pasting or dropping a VCF.
3962
3963         This means we no longer need to handle attachment reading in readPasteboardWebContentDataForType, so we can
3964         simply bail before reading "public.vcard" here and defer to reading other data types.
3965
3966         Covered by existing API tests in WKAttachmentTests and DragAndDropTestsIOS.
3967
3968         * editing/WebContentReader.h:
3969         * editing/cocoa/WebContentReaderCocoa.mm:
3970         (WebCore::WebContentReader::readVirtualContactFile): Deleted.
3971         * platform/Pasteboard.h:
3972         * platform/ios/PasteboardIOS.mm:
3973         (WebCore::Pasteboard::readPasteboardWebContentDataForType):
3974         (WebCore::readURLAlongsideAttachmentIfNecessary):
3975         (WebCore::prefersAttachmentRepresentation):
3976         (WebCore::Pasteboard::read):
3977         (WebCore::Pasteboard::readRespectingUTIFidelities):
3978
3979 2019-04-01  Antti Koivisto  <antti@apple.com>
3980
3981         Trying to scroll the compose pane on gmail.com scrolls the message list behind
3982         https://bugs.webkit.org/show_bug.cgi?id=196426
3983         <rdar://problem/49402667>
3984
3985         Reviewed by Darin Adler.
3986
3987         Test: fast/scrolling/ios/event-region-visibility-hidden.html
3988
3989         We fail to gather event region from desdendants of non-overflowing elements with 'visibility:hidden'.
3990
3991         * rendering/RenderBlock.cpp:
3992         (WebCore::RenderBlock::paintObject):
3993
3994         Skip the subtree walk only if the current region covers the box already.
3995
3996         * rendering/RenderLayer.cpp: