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