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