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