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