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