[Win] Remove -DUCHAR_TYPE=wchar_t stopgap and learn to live with char16_t.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-03-06  Ross Kirsling  <ross.kirsling@sony.com>
2
3         [Win] Remove -DUCHAR_TYPE=wchar_t stopgap and learn to live with char16_t.
4         https://bugs.webkit.org/show_bug.cgi?id=195346
5
6         Reviewed by Fujii Hironori.
7
8         * platform/graphics/win/FontCacheWin.cpp:
9         (WebCore::appendLinkedFonts):
10         (WebCore::getLinkedFonts):
11         (WebCore::FontCache::systemFallbackForCharacters):
12         (WebCore::FontCache::fontFromDescriptionAndLogFont):
13         (WebCore::createGDIFont):
14         (WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
15         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
16         (WebCore::FontCustomPlatformData::fontPlatformData):
17         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
18         (WebCore::GlyphPage::fill):
19         * platform/graphics/win/IconWin.cpp:
20         (WebCore::Icon::createIconForFiles):
21         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
22         (WebCore::mimeTypeCache):
23         (WebCore::MediaPlayerPrivateMediaFoundation::startCreateMediaSource):
24         * platform/graphics/win/UniscribeController.cpp:
25         (WebCore::UniscribeController::itemizeShapeAndPlace):
26         (WebCore::UniscribeController::shape):
27         * platform/network/win/DownloadBundleWin.cpp:
28         (WebCore::DownloadBundle::appendResumeData):
29         (WebCore::DownloadBundle::extractResumeData):
30         * platform/text/win/LocaleWin.cpp:
31         (WebCore::LCIDFromLocaleInternal):
32         (WebCore::LCIDFromLocale):
33         (WebCore::LocaleWin::getLocaleInfoString):
34         * platform/win/BString.cpp:
35         (WebCore::BString::BString):
36         * platform/win/ClipboardUtilitiesWin.cpp:
37         (WebCore::getWebLocData):
38         (WebCore::createGlobalData):
39         (WebCore::getFileDescriptorData):
40         (WebCore::getURL):
41         (WebCore::getCFData):
42         (WebCore::setCFData):
43         * platform/win/DragDataWin.cpp:
44         (WebCore::DragData::asFilenames const):
45         * platform/win/DragImageWin.cpp:
46         (WebCore::createDragImageIconForCachedImageFilename):
47         (WebCore::dragLabelFont):
48         * platform/win/MIMETypeRegistryWin.cpp:
49         (WebCore::mimeTypeForExtension):
50         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
51         * platform/win/PasteboardWin.cpp:
52         (WebCore::Pasteboard::read):
53         (WebCore::filesystemPathFromUrlOrTitle):
54         (WebCore::Pasteboard::writeURLToDataObject):
55         (WebCore::createGlobalImageFileDescriptor):
56         (WebCore::createGlobalHDropContent):
57         * platform/win/SSLKeyGeneratorWin.cpp:
58         (WebCore::signedPublicKeyAndChallengeString):
59         * platform/win/SharedBufferWin.cpp:
60         (WebCore::SharedBuffer::createFromReadingFile):
61         * rendering/RenderThemeWin.cpp:
62         (WebCore::fillFontDescription):
63         Use wchar helpers as needed.
64
65 2019-03-06  Devin Rousso  <drousso@apple.com>
66
67         Web Inspector: DOM Debugger: event breakpoints still fire when breakpoints are disabled
68         https://bugs.webkit.org/show_bug.cgi?id=195377
69         <rdar://problem/48651645>
70
71         Reviewed by Joseph Pecoraro and Matt Baker.
72
73         Test: inspector/dom-debugger/event-listener-breakpoints.html
74
75         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
76         (WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
77         (WebCore::InspectorDOMDebuggerAgent::willFireTimer):
78         (WebCore::InspectorDOMDebuggerAgent::willFireAnimationFrame):
79
80 2019-03-06  Wenson Hsieh  <wenson_hsieh@apple.com>
81
82         Crash when attempting to change input type while dismissing datalist suggestions
83         https://bugs.webkit.org/show_bug.cgi?id=195384
84         <rdar://problem/48563718>
85
86         Reviewed by Brent Fulgham.
87
88         When closing a datalist suggestion menu, WebPageProxy sends a message to WebPage instructing it to tell its
89         active datalist suggestions picker to close. However, for a myriad of reasons, the suggestions picker (kept
90         alive by its text input type) may have already gone away by this point. To mitigate this, make WebPage weakly
91         reference its active datalist suggestions picker.
92
93         Test: fast/forms/datalist/change-input-type-after-closing-datalist-suggestions.html
94
95         * platform/DataListSuggestionPicker.h:
96
97         Make DataListSuggestionPicker capable of being weakly referenced. Additionally, fix some minor preexisting
98         issues in this header (#imports instead of #includes, as well as an unnecessary include of IntRect.h).
99
100 2019-03-06  Ryan Haddad  <ryanhaddad@apple.com>
101
102         Remove an unneeded assert that was added with r242113
103         https://bugs.webkit.org/show_bug.cgi?id=195391
104
105         Reviewed by Simon Fraser.
106
107         Many layout tests are failing ASSERT(m_mediaBufferingIsSuspended). Since m_mediaBufferingIsSuspended is
108         protected by an 'if' statement directly afterwards, the assertion should be safe to remove.
109
110         * page/Page.cpp:
111         (WebCore::Page::resumeAllMediaBuffering):
112
113 2019-03-06  Justin Fan  <justin_fan@apple.com>
114
115         Unreviewed build fix. Replace a forward declaration with an include.
116
117         * Modules/webgpu/WebGPUTextureView.cpp:
118         * Modules/webgpu/WebGPUTextureView.h:
119
120 2019-03-06  Justin Fan  <justin_fan@apple.com>
121
122         [Web GPU] GPUTexture and GPUTextureView updates, and related GPUBindGroup updates
123         https://bugs.webkit.org/show_bug.cgi?id=195347
124
125         Reviewed by Dean Jackson.
126
127         Implement the ability to display image data as a GPUTexture in the rendering pipeline. Improve GPUTexture and 
128         GPUTextureView implementations. Rename various bind group classes to GPU* to match API.
129
130         Test: webgpu/texture-triangle-strip.html
131
132         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
133         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Update to validate GPUTextureView resources.
134         * Modules/webgpu/WebGPUCommandBuffer.cpp: Move instead of copy the converted view objects.
135         (WebCore::WebGPUCommandBuffer::copyBufferToTexture):
136         (WebCore::WebGPUCommandBuffer::copyTextureToBuffer):
137         (WebCore::WebGPUCommandBuffer::copyTextureToTexture):
138         * Modules/webgpu/WebGPUCommandBuffer.h:
139         (WebCore::WebGPUCommandBuffer::commandBuffer const): No longer returns const so used resources can be registered on it.
140         * Modules/webgpu/WebGPUDevice.cpp:
141         (WebCore::WebGPUDevice::createBindGroupLayout const): Rename WebGPUBindGroupLayoutDescriptor and replace unnecessary rvalue reference.
142         * Modules/webgpu/WebGPUDevice.h: Ditto.
143         * Modules/webgpu/WebGPUDevice.idl: Ditto.
144         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
145         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
146         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
147         * Modules/webgpu/WebGPUQueue.cpp:
148         (WebCore::WebGPUQueue::submit):
149         * Modules/webgpu/WebGPURenderPassDescriptor.cpp:
150         (WebCore::WebGPURenderPassDescriptor::asGPURenderPassDescriptor const):
151         * Modules/webgpu/WebGPUTexture.cpp:
152         (WebCore::WebGPUTexture::~WebGPUTexture): Clean up any resources created for and from this WebGPUTexture.
153         (WebCore::WebGPUTexture::createDefaultTextureView): Now returns an empty object other than null on failure.
154         (WebCore::WebGPUTexture::destroy):
155         (WebCore::WebGPUTexture::destroyImpl):
156         * Modules/webgpu/WebGPUTexture.h: Keep a list of any views created from this texture.
157         * Modules/webgpu/WebGPUTexture.idl: Enable destroy.
158         * Modules/webgpu/WebGPUTextureView.cpp:
159         (WebCore::WebGPUTextureView::create):
160         (WebCore::WebGPUTextureView::WebGPUTextureView):
161         (WebCore::WebGPUTextureView::destroy):
162         * Modules/webgpu/WebGPUTextureView.h:
163         (WebCore::WebGPUTextureView::~WebGPUTextureView): Clean up any resources backing this WebGPUTextureView.
164         (WebCore::WebGPUTextureView::texture const):
165         (WebCore::WebGPUTextureView::texture): Deleted.
166         * platform/graphics/gpu/GPUBindGroupLayout.h:
167         * platform/graphics/gpu/GPUCommandBuffer.h:
168         (WebCore::GPUCommandBuffer::usedTextures const): Keep a list of all texture resources that will be used by this command buffer on submit.
169         (WebCore::GPUCommandBuffer::isEncodingPass const): Added to prevent multiple pass encoders from being active on one command buffer.
170         (WebCore::GPUCommandBuffer::setIsEncodingPass):
171         (WebCore::GPUCommandBuffer::useTexture):
172         * platform/graphics/gpu/GPUDevice.cpp:
173         (WebCore::GPUDevice::tryCreateBindGroupLayout const):
174         * platform/graphics/gpu/GPUDevice.h:
175         * platform/graphics/gpu/GPUPipelineLayout.cpp:
176         (WebCore::GPUPipelineLayout::GPUPipelineLayout):
177         * platform/graphics/gpu/GPUProgrammablePassEncoder.cpp:
178         (WebCore::GPUProgrammablePassEncoder::GPUProgrammablePassEncoder):
179         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
180         (WebCore::GPUProgrammablePassEncoder::setVertexBuffer):
181         (WebCore::GPUProgrammablePassEncoder::setFragmentBuffer):
182         (): Deleted.
183         * platform/graphics/gpu/GPUQueue.h:
184         * platform/graphics/gpu/GPURenderPassEncoder.h:
185         * platform/graphics/gpu/GPUTexture.h:
186         (WebCore::GPUTexture::isReadOnly const):
187         (WebCore::GPUTexture::destroy):
188         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
189         (WebCore::MTLDataTypeForBindingType):
190         (WebCore::GPUBindGroupLayout::tryCreate):
191         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
192         (WebCore::GPUCommandBuffer::create):
193         (WebCore::GPUCommandBuffer::~GPUCommandBuffer): Ensure blitEncoder is ended before releasing it.
194         (WebCore::GPUCommandBuffer::endBlitEncoding):
195         (WebCore::GPUCommandBuffer::copyBufferToTexture): Ensure textures are marked for usage before submission occurs.
196         (WebCore::GPUCommandBuffer::copyTextureToBuffer):
197         (WebCore::GPUCommandBuffer::copyTextureToTexture):
198         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
199         (WebCore::GPUDevice::create):
200         (WebCore::GPUDevice::GPUDevice):
201         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
202         (WebCore::GPUProgrammablePassEncoder::endPass):
203         (WebCore::GPUProgrammablePassEncoder::setBindGroup): Now supports texture resources.
204         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Just moved.
205         (WebCore::GPUProgrammablePassEncoder::setResourceAsTextureOnEncoder):
206         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
207         (WebCore::GPUQueue::submit): Ensures destroyed GPUTextures are not submitted.
208         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
209         (WebCore::GPURenderPassEncoder::tryCreate): Ensure any other encoders are ended before attempting to activate a new one.
210         (WebCore::GPURenderPassEncoder::platformPassEncoder const):
211         (WebCore::GPURenderPassEncoder::endPass): Invalidates the MTLCommandEncoder upon success.
212         (WebCore::GPURenderPassEncoder::setPipeline):
213         (WebCore::GPURenderPassEncoder::setVertexBuffers):
214         (WebCore::GPURenderPassEncoder::draw):
215         (WebCore::GPURenderPassEncoder::useResource):
216         (WebCore::GPURenderPassEncoder::setVertexBuffer):
217         (WebCore::GPURenderPassEncoder::setFragmentBuffer):
218         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
219         (WebCore::GPUSwapChain::getNextTexture):
220         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
221         (WebCore::storageModeForPixelFormatAndSampleCount): 
222                 Always create MTLStorageModePrivate textures on macOS, as Web GPU doesn't provide CPU access to textures anyway.
223         (WebCore::tryCreateMtlTextureDescriptor):
224         (WebCore::GPUTexture::create):
225         (WebCore::GPUTexture::GPUTexture):
226         (WebCore::GPUTexture::tryCreateDefaultTextureView): Renamed from createDefaultTextureView.
227
228         Update files and symbols in project:
229         * CMakeLists.txt:
230         * DerivedSources-input.xcfilelist:
231         * DerivedSources-output.xcfilelist:
232         * DerivedSources.make:
233         * Modules/streams/WebGPUBindGroupLayoutDescriptor.h: Removed.
234         * Modules/webgpu/GPUBindGroupLayoutBinding.h: Renamed from Source/WebCore/platform/graphics/gpu/GPUBindGroupLayoutBinding.h.
235         * Modules/webgpu/GPUBindGroupLayoutBinding.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBindGroupLayoutBinding.idl.
236         * Modules/webgpu/GPUBindGroupLayoutDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h.
237         * Modules/webgpu/GPUBindGroupLayoutDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBindGroupLayoutDescriptor.idl.
238         * Modules/webgpu/GPUShaderStageBit.h: Renamed from Source/WebCore/Modules/webgpu/WebGPUShaderStageBit.h.
239         * Modules/webgpu/GPUShaderStageBit.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUShaderStageBit.idl.
240         * Sources.txt:
241         * WebCore.xcodeproj/project.pbxproj:
242         * bindings/js/WebCoreBuiltinNames.h:
243
244 2019-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
245
246         [WHLSL] Pack and unpack data at entry points and exit points
247         https://bugs.webkit.org/show_bug.cgi?id=193877
248
249         Reviewed by Dean Jackson.
250
251         This implements the bulk of the rest of the Metal code generation piece.
252         Specifically, this patch adds support for the packing and unpacking steps
253         at the beginning of the entry point functions and all returns from those
254         functions. It does this by creating an object, EntryPointScaffolding, that
255         knows how to emit all the helper types, packing / unpacking code, and the
256         function signature. This patch also accepts parts of the
257         PipelineStateDescriptor so we know the data layout we should be packing and
258         unpacking.
259
260         This is the last patch before enough of the compiler is present that we can
261         start testing it. The next patch will start porting the test suite.
262
263         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
264         (WebCore::WHLSL::Metal::attributeForSemantic):
265         (WebCore::WHLSL::Metal::EntryPointScaffolding::EntryPointScaffolding):
266         (WebCore::WHLSL::Metal::EntryPointScaffolding::mappedBindGroups const):
267         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
268         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceSignature):
269         (WebCore::WHLSL::Metal::EntryPointScaffolding::builtInsSignature):
270         (WebCore::WHLSL::Metal::EntryPointScaffolding::mangledInputPath):
271         (WebCore::WHLSL::Metal::EntryPointScaffolding::mangledOutputPath):
272         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns):
273         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::VertexEntryPointScaffolding):
274         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::helperTypes):
275         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::signature):
276         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::unpack):
277         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::pack):
278         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::FragmentEntryPointScaffolding):
279         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes):
280         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::signature):
281         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::unpack):
282         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::pack):
283         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::ComputeEntryPointScaffolding):
284         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::helperTypes):
285         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::signature):
286         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::unpack):
287         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::pack):
288         (WebCore::WHLSL::Metal::EntryPointScaffolding::helperTypes): Deleted.
289         (WebCore::WHLSL::Metal::EntryPointScaffolding::signature): Deleted.
290         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpack): Deleted.
291         (WebCore::WHLSL::Metal::EntryPointScaffolding::pack): Deleted.
292         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
293         (WebCore::WHLSL::Metal::EntryPointScaffolding::parameterVariables):
294         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
295         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::toString):
296         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::visit):
297         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
298         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::generateNextVariableName):
299         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
300         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
301         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::RenderFunctionDefinitionWriter):
302         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::takeVertexMappedBindGroups):
303         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::takeFragmentMappedBindGroups):
304         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::createEntryPointScaffolding):
305         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::ComputeFunctionDefinitionWriter):
306         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::takeMappedBindGroups):
307         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::createEntryPointScaffolding):
308         (WebCore::WHLSL::Metal::sharedMetalFunctions):
309         (WebCore::WHLSL::Metal::metalFunctions):
310         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h:
311         * Modules/webgpu/WHLSL/Metal/WHLSLMappedBindings.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h.
312         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp:
313         (WebCore::WHLSL::Metal::generateMetalCodeShared):
314         (WebCore::WHLSL::Metal::generateMetalCode):
315         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h:
316         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
317         (WebCore::WHLSL::Intrinsics::float2Type const):
318         * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h: Added.
319         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp: Added.
320         (WebCore::WHLSL::prepareShared):
321         (WebCore::WHLSL::prepare):
322         * Modules/webgpu/WHLSL/WHLSLPrepare.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h.
323         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp: Added.
324         (WebCore::WHLSL::findEntryPoint):
325         (WebCore::WHLSL::matchMode):
326         (WebCore::WHLSL::matchResources):
327         (WebCore::WHLSL::matchInputsOutputs):
328         (WebCore::WHLSL::isAcceptableFormat):
329         (WebCore::WHLSL::matchVertexAttributes):
330         (WebCore::WHLSL::matchColorAttachments):
331         (WebCore::WHLSL::matchDepthAttachment):
332         (WebCore::WHLSL::matchSemantics):
333         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp.
334         * Sources.txt:
335         * WebCore.xcodeproj/project.pbxproj:
336
337 2019-03-06  Wenson Hsieh  <wenson_hsieh@apple.com>
338
339         Move RenderObject::isTransparentOrFullyClippedRespectingParentFrames() to RenderLayer
340         https://bugs.webkit.org/show_bug.cgi?id=195300
341
342         Reviewed by Simon Fraser.
343
344         Move isTransparentOrFullyClippedRespectingParentFrames() from RenderObject to RenderLayer, since this function
345         asks questions about RenderLayers rather than their renderers. No change in behavior.
346
347         * rendering/RenderLayer.cpp:
348         (WebCore::enclosingFrameRenderLayer):
349         (WebCore::parentLayerCrossFrame):
350
351         Some static helpers currently in RenderObject that walk up the layer hierarchy through subframes are redundant
352         with static helpers in RenderLayer. Now that isTransparentOrFullyClippedRespectingParentFrames exists in
353         RenderLayer, simply use this existing helper instead and split logic to grab the enclosing layer around the
354         owner element of a frame into a separate helper.
355
356         * rendering/RenderLayer.h:
357         * rendering/RenderObject.cpp:
358         (WebCore::enclosingFrameRenderLayer): Deleted.
359         (WebCore::parentLayerCrossingFrameBoundaries): Deleted.
360         (WebCore::RenderObject::isTransparentOrFullyClippedRespectingParentFrames const): Deleted.
361
362         Moved from RenderObject.
363
364         * rendering/RenderObject.h:
365
366 2019-03-06  Sihui Liu  <sihui_liu@apple.com>
367
368         Assertion Failed: m_databaseQueue.isKilled() in UniqueIDBDatabase::~UniqueIDBDatabase()
369         https://bugs.webkit.org/show_bug.cgi?id=195073
370         <rdar://problem/48285200>
371
372         Reviewed by Geoffrey Garen.
373
374         r240931 removed a retain cycle between IDBConnectionToServer and IDBConnectionToServerDelegate, so 
375         IDBConnectionToServerDelegate, or InProcessIDBServer would not live forever. When IDBDatabase is gone, 
376         InProcessIDBServer would schedule a notifification to IDBServer with databaseConnectionClosed. IDBServer would 
377         then notify UniqueIDBDatabase. When UniqueIDBDatabase finds all database connections are gone, it would acquires
378         its only reference pointer from IDBServer schedule and perform a shutdown that kills its database task queue.
379
380         The assertion failure tells us UniqueIDBDatabase was destructed at when IDBServer was destructed, which means 
381         UniqueIDBDatabase had not acquired its pointer. It's probably because UniqueIDBDatabase had unfinished tasks or
382         the operation timer function had not been executed. Since UniqueIDBDatabase needs to complete shutdown process,
383         we should make IDBServer live as long as UniqueIDBDatabase by keeping a reference pointer of IDBServer in 
384         UniqueIDBDatabase. 
385
386         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
387         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
388         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
389         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
390         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
391         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
392         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
393         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
394         (WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose):
395         * Modules/indexeddb/server/UniqueIDBDatabase.h:
396         (WebCore::IDBServer::UniqueIDBDatabase::server):
397
398 2019-03-06  Rob Buis  <rbuis@igalia.com>
399
400         Consider supporting the `referrerpolicy` attribute.
401         https://bugs.webkit.org/show_bug.cgi?id=179053
402
403         Reviewed by Darin Adler.
404
405         This patch adds 'referrerpolicy' attribute support for iframe.
406         If set, the value is restricted to the ReferrerPolicy enum, and
407         if valid it is used for the subframe load.
408         If not set or invalid, the current behavior is kept.
409
410         Tests: http/tests/referrer-policy-iframe/no-referrer-when-downgrade/cross-origin-http-http.html
411                http/tests/referrer-policy-iframe/no-referrer-when-downgrade/cross-origin-http.https.html
412                http/tests/referrer-policy-iframe/no-referrer-when-downgrade/same-origin.html
413                http/tests/referrer-policy-iframe/no-referrer/cross-origin-http-http.html
414                http/tests/referrer-policy-iframe/no-referrer/cross-origin-http.https.html
415                http/tests/referrer-policy-iframe/no-referrer/same-origin.html
416                http/tests/referrer-policy-iframe/origin-when-cross-origin/cross-origin-http-http.html
417                http/tests/referrer-policy-iframe/origin-when-cross-origin/cross-origin-http.https.html
418                http/tests/referrer-policy-iframe/origin-when-cross-origin/same-origin.html
419                http/tests/referrer-policy-iframe/origin/cross-origin-http-http.html
420                http/tests/referrer-policy-iframe/origin/cross-origin-http.https.html
421                http/tests/referrer-policy-iframe/origin/same-origin.html
422                http/tests/referrer-policy-iframe/same-origin/cross-origin-http-http.html
423                http/tests/referrer-policy-iframe/same-origin/cross-origin-http.https.html
424                http/tests/referrer-policy-iframe/same-origin/same-origin.html
425                http/tests/referrer-policy-iframe/strict-origin-when-cross-origin/cross-origin-http-http.html
426                http/tests/referrer-policy-iframe/strict-origin-when-cross-origin/cross-origin-http.https.html
427                http/tests/referrer-policy-iframe/strict-origin-when-cross-origin/same-origin.html
428                http/tests/referrer-policy-iframe/strict-origin/cross-origin-http-http.html
429                http/tests/referrer-policy-iframe/strict-origin/cross-origin-http.https.html
430                http/tests/referrer-policy-iframe/strict-origin/same-origin.html
431                http/tests/referrer-policy-iframe/unsafe-url/cross-origin-http-http.html
432                http/tests/referrer-policy-iframe/unsafe-url/cross-origin-http.https.html
433                http/tests/referrer-policy-iframe/unsafe-url/same-origin.html
434
435         * html/HTMLAttributeNames.in:
436         * html/HTMLFrameOwnerElement.h:
437         (WebCore::HTMLFrameOwnerElement::referrerPolicy const):
438         * html/HTMLIFrameElement.cpp:
439         (WebCore::HTMLIFrameElement::setReferrerPolicyForBindings):
440         (WebCore::HTMLIFrameElement::referrerPolicyForBindings const):
441         (WebCore::HTMLIFrameElement::referrerPolicy const):
442         * html/HTMLIFrameElement.h:
443         * html/HTMLIFrameElement.idl:
444         * loader/SubframeLoader.cpp:
445         (WebCore::SubframeLoader::loadSubframe):
446         * page/RuntimeEnabledFeatures.h:
447         (WebCore::RuntimeEnabledFeatures::referrerPolicyAttributeEnabled const):
448         (WebCore::RuntimeEnabledFeatures::setReferrerPolicyAttributeEnabled):
449         * platform/ReferrerPolicy.cpp:
450         (WebCore::parseReferrerPolicy):
451         * platform/ReferrerPolicy.h:
452
453 2019-03-05  Takashi Komori  <Takashi.Komori@sony.com>
454
455         [curl] Remove unnecessary file.
456         https://bugs.webkit.org/show_bug.cgi?id=195350
457
458         Reviewed by Fujii Hironori.
459
460         Removed unused file.
461
462         No new tests. No change in behavior.
463
464         * platform/network/curl/CookieJarCurlDatabase.cpp: Removed.
465
466 2019-03-05  Eric Liang  <ericliang@apple.com>
467
468         AX: Add remote search support for keyboard focusable element search type
469         https://bugs.webkit.org/show_bug.cgi?id=195336
470
471         Reviewed by Chris Fleizach.
472
473         Added AXKeyboardFocusable search key to return default keyboard-focusable elements for accessibility.
474
475         Test: accessibility/mac/search-predicate-keyboard-focusable.html
476
477         * accessibility/AccessibilityObject.cpp:
478         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
479         (WebCore::AccessibilityObject::isKeyboardFocusable const):
480         * accessibility/AccessibilityObject.h:
481         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
482         (createAccessibilitySearchKeyMap):
483
484 2019-03-05  Don Olmstead  <don.olmstead@sony.com>
485
486         [WinCairo] Enable CSS Typed OM
487         https://bugs.webkit.org/show_bug.cgi?id=195340
488
489         Reviewed by Myles C. Maxfield.
490
491         * bindings/js/CallTracerTypes.h:
492
493 2019-03-05  Sihui Liu  <sihui_liu@apple.com>
494
495         Fix a typo in Web SQL quirk
496         https://bugs.webkit.org/show_bug.cgi?id=195338
497
498         Reviewed by Geoffrey Garen.
499
500         * page/Quirks.cpp:
501         (WebCore::Quirks::hasWebSQLSupportQuirk const):
502
503 2019-03-05  Daniel Bates  <dabates@apple.com>
504
505         [iOS] Should not scroll when checkbox, radio, submit, reset, or button is spacebar activated
506         https://bugs.webkit.org/show_bug.cgi?id=195281
507         <rdar://problem/48564347>
508
509         Reviewed by Simon Fraser.
510
511         Do not call the base class's default event handler (HTMLTextFormControlElement::defaultEventHandler())
512         when WebCore sees a keydown of the spacebar as we consider such an event as handled.
513         Otherwise, calling the base class's default event handler ultimately gives the embedding
514         client a chance to wrongly handle the event. In the case of iOS, keydown of the spacebar
515         causes the page to scroll.
516
517         WebCore implements spacebar activation on keydown for form controls. For IE compatibility
518         WebCore does not mark such keydown events as handled so that a DOM keypress event will
519         be subsequently dispatched. The current logic only skips calling the base class's default
520         event handler if the DOM event was not marked handled. This is insufficient. We need to
521         know whether WebCore handled the event. If asking the input type to handle the key down
522         marks the DOM event as handled then, clearly, WebCore handled the event. However, if the
523         event is not marked as handled, but WebCore actually accounted for this event then we need
524         to know this so that we do not call the base class's default event handler and ultimately
525         the embedding client asking for an interpretation of the key event. Towards this, have
526         InputType::handleKeydownEvent() return a bit whether or not the base class's default
527         event handler should be invoked.
528
529         Tests: fast/events/ios/activating-button-should-not-scroll-page.html
530                fast/events/ios/activating-checkbox-should-not-scroll-page.html
531                fast/events/ios/activating-radio-button-should-not-scroll-page.html
532                fast/events/ios/activating-reset-button-should-not-scroll-page.html
533                fast/events/ios/activating-submit-button-should-not-scroll-page.html
534
535         * html/BaseCheckableInputType.cpp:
536         (WebCore::BaseCheckableInputType::handleKeydownEvent): Return ShouldCallBaseEventHandler::No
537         if WebCore handled the spacebar activation. Otherewise, return ShouldCallBaseEventHandler::Yes.
538         * html/BaseCheckableInputType.h:
539         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
540         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent): Ditto.
541         * html/BaseChooserOnlyDateAndTimeInputType.h:
542         * html/BaseClickableWithKeyInputType.cpp:
543         (WebCore::BaseClickableWithKeyInputType::handleKeydownEvent): Keep our current behavior by returning ShouldCallBaseEventHandler::Yes.
544         * html/BaseClickableWithKeyInputType.h:
545         * html/HTMLInputElement.cpp:
546         (WebCore::HTMLInputElement::defaultEventHandler): Do not fallthrough and call the base class's default
547         event handler if the input type told us it handled the event regardless of whether the event was handled
548         from the perspective of the DOM.
549         * html/InputType.cpp:
550         (WebCore::InputType::handleKeydownEvent): Keep our current behavior by returning ShouldCallBaseEventHandler::Yes.
551         * html/InputType.h:
552
553         * html/NumberInputType.cpp:
554         (WebCore::NumberInputType::handleKeydownEvent):
555         * html/NumberInputType.h:
556         * html/RadioInputType.cpp:
557         (WebCore::RadioInputType::handleKeydownEvent):
558         * html/RadioInputType.h:
559         * html/RangeInputType.cpp:
560         (WebCore::RangeInputType::handleKeydownEvent):
561         * html/RangeInputType.h:
562         * html/SearchInputType.cpp:
563         (WebCore::SearchInputType::handleKeydownEvent):
564         * html/SearchInputType.h:
565         * html/TextFieldInputType.cpp:
566         (WebCore::TextFieldInputType::handleKeydownEvent):
567         * html/TextFieldInputType.h:
568         Keep our current behavior by returning ShouldCallBaseEventHandler::Yes.
569
570 2019-03-05  Takashi Komori  <Takashi.Komori@sony.com>
571
572         [Curl] Implement Cookie Accept Policy.
573         https://bugs.webkit.org/show_bug.cgi?id=191645
574
575         Reviewed by Fujii Hironori.
576
577         Make Curl network layer respect to coookie accept policy.
578         This patch fixes tests below on TestRunner, but doesn't fix tests on DumpRenderTree.
579
580         Tests: http/tests/cookies/only-accept-first-party-cookies.html
581                http/tests/cookies/third-party-cookie-relaxing.html
582                http/tests/security/cookies/third-party-cookie-blocking-redirect.html
583                http/tests/security/cookies/third-party-cookie-blocking-user-action.html
584                http/tests/security/cookies/third-party-cookie-blocking-xslt.xml
585                http/tests/security/cookies/third-party-cookie-blocking.html
586
587         * platform/network/curl/CookieJarCurl.cpp:
588         (WebCore::cookiesForSession):
589         (WebCore::CookieJarCurl::setCookiesFromDOM const):
590         (WebCore::CookieJarCurl::setCookiesFromHTTPResponse const):
591         (WebCore::CookieJarCurl::setCookieAcceptPolicy const):
592         (WebCore::CookieJarCurl::cookieAcceptPolicy const):
593         (WebCore::CookieJarCurl::getRawCookies const):
594         * platform/network/curl/CookieJarCurl.h:
595         * platform/network/curl/CookieJarDB.cpp:
596         (WebCore::CookieJarDB::openDatabase):
597         (WebCore::CookieJarDB::isEnabled const):
598         (WebCore::CookieJarDB::checkCookieAcceptPolicy):
599         (WebCore::CookieJarDB::hasCookies):
600         (WebCore::CookieJarDB::searchCookies):
601         (WebCore::CookieJarDB::canAcceptCookie):
602         (WebCore::CookieJarDB::setCookie):
603         (WebCore::CookieJarDB::setEnabled): Deleted.
604         * platform/network/curl/CookieJarDB.h:
605         (WebCore::CookieJarDB::setAcceptPolicy):
606         (WebCore::CookieJarDB::acceptPolicy const):
607         * platform/network/curl/CookieUtil.cpp:
608         (WebCore::CookieUtil::parseCookieAttributes):
609         (WebCore::CookieUtil::parseCookieHeader):
610         * platform/network/curl/CurlResourceHandleDelegate.cpp:
611         (WebCore::handleCookieHeaders):
612         (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
613
614 2019-03-05  Zalan Bujtas  <zalan@apple.com>
615
616         [ContentChangeObserver] Assert on if notify content change is allowed
617         https://bugs.webkit.org/show_bug.cgi?id=195332
618         <rdar://problem/48603276>
619
620         Reviewed by Simon Fraser.
621
622         Assert we don't notify the client about the state change while in handleSyntheticClick().
623
624         * page/ios/ContentChangeObserver.cpp:
625         (WebCore::ContentChangeObserver::domTimerExecuteDidStart):
626         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
627         (WebCore::ContentChangeObserver::adjustObservedState):
628         * page/ios/ContentChangeObserver.h:
629         (WebCore::ContentChangeObserver::isObservingContentChanges const):
630         (WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const):
631
632 2019-03-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
633
634         SVGPathSegList.insertItemBefore() should fail if the newItem belongs to an animating animPathSegList
635         https://bugs.webkit.org/show_bug.cgi?id=195333
636         <rdar://problem/48475802>
637
638         Reviewed by Simon Fraser.
639
640         Because the SVG1.1 specs states that the newItem should be removed from
641         its original list before adding it to another list,
642         SVGPathSegList.insertItemBefore() should fail if the new item belongs to
643         an animating animPathSegList since it is read-only.
644
645         Test: svg/dom/SVGPathSegList-insert-from-animating-animPathSegList.svg
646
647         * svg/SVGPathSegList.cpp:
648         (WebCore::SVGPathSegList::processIncomingListItemValue):
649
650 2019-03-05  Zalan Bujtas  <zalan@apple.com>
651
652         [ContentChangeObserver] Send content change notification through adjustObservedState
653         https://bugs.webkit.org/show_bug.cgi?id=195328
654         <rdar://problem/48601143>
655
656         Reviewed by Simon Fraser.
657
658         Have a dedicated place for the notification logic.
659
660         * page/ios/ContentChangeObserver.cpp:
661         (WebCore::ContentChangeObserver::stopDurationBasedContentObservation):
662         (WebCore::ContentChangeObserver::didInstallDOMTimer):
663         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
664         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
665         (WebCore::ContentChangeObserver::styleRecalcDidFinish):
666         (WebCore::ContentChangeObserver::mouseMovedDidStart):
667         (WebCore::ContentChangeObserver::adjustObservedState):
668         (WebCore::ContentChangeObserver::registerDOMTimer): Deleted.
669         (WebCore::ContentChangeObserver::unregisterDOMTimer): Deleted.
670         (WebCore::ContentChangeObserver::notifyContentChangeIfNeeded): Deleted.
671         * page/ios/ContentChangeObserver.h:
672         (WebCore::ContentChangeObserver::registerDOMTimer):
673         (WebCore::ContentChangeObserver::unregisterDOMTimer):
674
675 2019-03-05  Youenn Fablet  <youenn@apple.com>
676
677         MockLibWebRTCPeerConnection is leaking some session description
678         https://bugs.webkit.org/show_bug.cgi?id=195315
679         <rdar://problem/47840038>
680
681         Reviewed by David Kilzer.
682
683         Make sure to release raw pointers given from WebCore to mock libwebrtc layer.
684         Covered by existing tests when run in leaks mode.
685
686         * testing/MockLibWebRTCPeerConnection.cpp:
687         (WebCore::MockLibWebRTCPeerConnection::SetLocalDescription):
688         (WebCore::MockLibWebRTCPeerConnection::SetRemoteDescription):
689
690 2019-03-05  Ryan Haddad  <ryanhaddad@apple.com>
691
692         Unreviewed, rolling out r242403.
693
694         Caused layout test crashes on iOS simulator.
695
696         Reverted changeset:
697
698         "[ContentChangeObserver] Introduce fixed duration content
699         observation"
700         https://bugs.webkit.org/show_bug.cgi?id=195295
701         https://trac.webkit.org/changeset/242403
702
703 2019-03-05  Frederic Wang  <fwang@igalia.com>
704
705         Web Inspector: Better categorize CPU usage per-thread / worker
706         https://bugs.webkit.org/show_bug.cgi?id=194564
707
708         Unreviewed compilation fix.
709
710         * page/ResourceUsageData.h: Add missing headers.
711
712 2019-03-05  Frederic Wang  <fwang@igalia.com>
713
714         Share more code for updating the state of frame scrolling nodes
715         https://bugs.webkit.org/show_bug.cgi?id=195254
716
717         Unreviewed compilation warning fix.
718
719         * page/scrolling/AsyncScrollingCoordinator.cpp:
720         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Add UNUSED_PARAM on non-Cocoa
721         platforms.
722
723 2019-03-05  Cathie Chen  <cathiechen@igalia.com>
724
725         The include file in ScrollingStateFrameHostingNode.h is wrong.
726         https://bugs.webkit.org/show_bug.cgi?id=195280
727
728         Reviewed by Frédéric Wang.
729
730         * page/scrolling/ScrollingStateFrameHostingNode.h:
731
732 2019-03-04  Justin Fan  <justin_fan@apple.com>
733
734         Unreviewed build fix for High Sierra.
735
736         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Should fix "global constructor" error.
737
738 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
739
740         Use a SQLite database to hold the ResourceLoadStatistics data
741         https://bugs.webkit.org/show_bug.cgi?id=194867
742         <rdar://problem/24240854>
743
744         Reviewed by Chris Dumez.
745
746         Add a new runtime feature flag to support use of an experimental database
747         back-end. Also expose some SQLite function calls for use outside of WebCore.
748
749         No change in functionality, so no new tests.
750
751         * page/RuntimeEnabledFeatures.h:
752         (WebCore::RuntimeEnabledFeatures::setItpDatabaseModeEnabled):
753         (WebCore::RuntimeEnabledFeatures::itpDatabaseModeEnabled const):
754         * platform/sql/SQLiteDatabase.h:
755         * platform/sql/SQLiteStatement.h:
756
757 2019-03-04  Justin Fan  <justin_fan@apple.com>
758
759         [Web GPU] Blitting function prototypes
760         https://bugs.webkit.org/show_bug.cgi?id=195224
761         <rdar://problem/48538902>
762
763         Reviewed by Dean Jackson.
764
765         Implement barebones GPUCommandBuffer::copy* prototypes while rounding out GPUTexture implementation details.
766
767         Test: webgpu/blit-commands.html
768
769         * Modules/webgpu/GPUOrigin3D.h: Added.
770         * Modules/webgpu/GPUOrigin3D.idl: Added.
771         * Modules/webgpu/WebGPUCommandBuffer.cpp: Add copy view struct implementations.
772         (WebCore::WebGPUBufferCopyView::asGPUBufferCopyView const): Added.
773         (WebCore::WebGPUTextureCopyView::asGPUTextureCopyView const): Added.
774         (WebCore::WebGPUCommandBuffer::copyBufferToBuffer): Added.
775         (WebCore::WebGPUCommandBuffer::copyBufferToTexture): Added.
776         (WebCore::WebGPUCommandBuffer::copyTextureToBuffer): Added.
777         (WebCore::WebGPUCommandBuffer::copyTextureToTexture): Added.
778         * Modules/webgpu/WebGPUCommandBuffer.h: Add new functions and supporting structs.
779         * Modules/webgpu/WebGPUCommandBuffer.idl: Ditto.
780         * Modules/webgpu/WebGPURenderPassDescriptor.cpp: Refactor constructors to copy the entire base class.
781         (WebCore::GPURenderPassColorAttachmentDescriptor::GPURenderPassColorAttachmentDescriptor):
782         (WebCore::GPURenderPassDepthStencilAttachmentDescriptor::GPURenderPassDepthStencilAttachmentDescriptor):
783         (WebCore::WebGPURenderPassDescriptor::asGPURenderPassDescriptor const):
784         (WebCore::attachment): Deleted.
785         * Modules/webgpu/WebGPUTexture.h:
786         (WebCore::WebGPUTexture::texture const): Added.
787         * platform/graphics/gpu/GPUBuffer.h:
788         (WebCore::GPUBuffer::byteLength const): Added.
789         (WebCore::GPUBuffer::isTransferSource const): Added.
790         (WebCore::GPUBuffer::isTransferDestination const): Renamed from isTransferDst. Refactored for OptionSet API.
791         (WebCore::GPUBuffer::isVertex const): Ditto.
792         (WebCore::GPUBuffer::isUniform const): Ditto.
793         (WebCore::GPUBuffer::isStorage const): Ditto.
794         (WebCore::GPUBuffer::isMappable const): Ditto.
795         (WebCore::GPUBuffer::isMapWrite const): Ditto.
796         (WebCore::GPUBuffer::isMapRead const): Ditto.
797         * platform/graphics/gpu/GPUBufferUsage.h: Refactored for better bit flag style.
798         * platform/graphics/gpu/GPUCommandBuffer.h:
799         (WebCore::GPUCommandBuffer::blitEncoder const): Added.
800         * platform/graphics/gpu/GPURenderPassDescriptor.h: 
801         * platform/graphics/gpu/GPUTexture.h: Cache usage flags for reference.
802         (WebCore::GPUTexture::isTransferSrc const): Added.
803         (WebCore::GPUTexture::isTransferDst const): Added.
804         (WebCore::GPUTexture::isOutputAttachment const): Added.
805         * platform/graphics/gpu/GPUTextureUsage.h: Refactor to match GPUBufferUsage.h.
806         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
807         (WebCore::GPUBuffer::validateBufferUsage): Renamed from validateBufferCreate, refactored for OptionSet.
808         (WebCore::GPUBuffer::tryCreate):
809         (WebCore::GPUBuffer::GPUBuffer):
810         (WebCore::GPUBuffer::isReadOnly const):
811         (WebCore::GPUBuffer::setSubData): Add alignment check according to Metal docs.
812         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: 
813         (WebCore::GPUCommandBuffer::create): No need to use this alias here.
814         (WebCore::GPUCommandBuffer::GPUCommandBuffer): Ditto.
815         (WebCore::GPUCommandBuffer::copyBufferToBuffer): Added.
816         (WebCore::GPUCommandBuffer::copyBufferToTexture): Added.
817         (WebCore::GPUCommandBuffer::copyTextureToBuffer): Added. 
818         (WebCore::GPUCommandBuffer::copyTextureToTexture): Added. 
819         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
820         (WebCore::GPUQueue::submit): End encoding on the MTLCommandBuffer's blitCommandEncoder if it was used.
821         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
822         (WebCore::GPUSwapChain::getNextTexture): Now provide usage flags to texture creation.
823         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
824         (WebCore::mtlTextureUsageForGPUTextureUsageFlags): Refactor validation.
825         (WebCore::tryCreateMtlTextureDescriptor): Ditto.
826         (WebCore::GPUTexture::tryCreate): Now provide usage flags to texture creation.
827         (WebCore::GPUTexture::create): Ditto.
828         (WebCore::GPUTexture::GPUTexture): Ditto.
829         (WebCore::GPUTexture::createDefaultTextureView): Ditto.
830
831 2019-03-04  Zalan Bujtas  <zalan@apple.com>
832
833         [ContentChangeObserver] Introduce fixed duration content observation
834         https://bugs.webkit.org/show_bug.cgi?id=195295
835         <rdar://problem/48579913>
836
837         Reviewed by Simon Fraser.
838
839         Some pages have a runloop-like scheduling setup where the content triggering change happens at a nested timer firing.
840         This patch helps finding cases like that using a 32ms long fixed window. Currently nested timers get dropped on the floor and
841         we stop observing for content changes before they even get fired.
842
843         Test: fast/events/touch/ios/visibility-change-happens-on-timer-hops.html
844
845         * page/ios/ContentChangeObserver.cpp:
846         (WebCore::ContentChangeObserver::ContentChangeObserver):
847         (WebCore::ContentChangeObserver::startContentObservationForDuration):
848         (WebCore::ContentChangeObserver::stopDurationBasedContentObservation):
849         (WebCore::ContentChangeObserver::hasDeterminateState const):
850         (WebCore::ContentChangeObserver::adjustObservedState):
851         * page/ios/ContentChangeObserver.h:
852         (WebCore::ContentChangeObserver::isObservingContentChanges const):
853         (WebCore::ContentChangeObserver::hasPendingActivity const):
854
855 2019-03-04  Wenson Hsieh  <wenson_hsieh@apple.com>
856
857         Native text selection UI is incorrectly suppressed in Microsoft Visio
858         https://bugs.webkit.org/show_bug.cgi?id=195178
859         <rdar://problem/48519394>
860
861         Reviewed by Darin Adler.
862
863         Currently, our heuristics for detecting hidden editable areas attempt to search for empty parent renderers with
864         "overflow: hidden". It does this by ascending the layer tree in search of renderers that have an empty content
865         size, and whose renderers' styles indicate that they have overflow: hidden in the X or Y directions. This fails
866         in the case where a child renderer is positioned out of flow, relative to one of its parent layers, since the
867         child will be visible, but we'll incorrectly believe that it is hidden. This leads to selection UI unexpectedly
868         disappearing in the online version of Microsoft Visio.
869
870         To fix this, we check whether the enclosing layer around the editable element has an empty clip rect; if the
871         element is inside of a subframe, we additionally walk up to each enclosing frame's layer and check if that
872         frame's layer has an empty clip rect.
873
874         Test: editing/selection/ios/do-not-hide-selection-in-visible-container.html
875
876         * rendering/RenderObject.cpp:
877         (WebCore::RenderObject::isTransparentOrFullyClippedRespectingParentFrames const):
878
879 2019-03-01  Ryosuke Niwa  <rniwa@webkit.org>
880
881         gPictureOwnerMap is unnecessary
882         https://bugs.webkit.org/show_bug.cgi?id=195228
883
884         Reviewed by Zalan Bujtas.
885
886         Just store in HTMLImageElement. An extra pointer isn't going to affect the memory use here.
887         If anything, we should worry about m_editableImage and m_pendingClonedAttachmentID instead.
888
889         * html/HTMLImageElement.cpp:
890         (WebCore::HTMLImageElement::pictureElement const):
891         (WebCore::HTMLImageElement::setPictureElement):
892         * html/HTMLImageElement.h:
893
894 2019-03-04  Daniel Bates  <dabates@apple.com>
895
896         [iOS] Caret x-position in empty text area does not match text field
897         https://bugs.webkit.org/show_bug.cgi?id=195125
898         <rdar://problem/47161070>
899
900         Remove the word "use" in the added comment to make it read well.
901
902         * css/html.css:
903         (textarea):
904
905 2019-03-04  Joseph Pecoraro  <pecoraro@apple.com>
906
907         ITMLKit Inspector: Data Bindings / Associated Data for nodes
908         https://bugs.webkit.org/show_bug.cgi?id=195290
909         <rdar://problem/48304019>
910
911         Reviewed by Devin Rousso.
912
913         * inspector/agents/InspectorDOMAgent.h:
914         * inspector/agents/InspectorDOMAgent.cpp:
915         (WebCore::InspectorDOMAgent::getDataBindingsForNode):
916         (WebCore::InspectorDOMAgent::getAssociatedDataForNode):
917         Stub these for web pages, they will only be used for ITMLKit right now.
918
919 2019-03-04  Daniel Bates  <dabates@apple.com>
920
921         [iOS] Caret x-position in empty text area does not match text field
922         https://bugs.webkit.org/show_bug.cgi?id=195125
923         <rdar://problem/47161070>
924
925         Reviewed by Darin Adler.
926
927         Fix up User Agent styles for <textarea> on iOS such that they have the same left padding
928         width and same text-indent as <input type="text">. This makes the x-position of the caret
929         in an empty textarea match the position of the caret in an empty text field.
930
931         Test: fast/forms/textarea/ios/caret-x-position-in-textarea-matches-textfield.html
932
933         * css/html.css:
934         (textarea): For iOS Family, do not use the padding shorthand property. Instead explicitly specify
935         padding-top and padding-bottom to be 2px to keep our current behavior (because it looks reasonable)
936         and do not specify left and right padding so that we inherit the padding set earlier in this file.
937         (textarea::placeholder): Deleted. This was added to "try" to make fix up the position of the placeholder
938         text so as to match the position of the textarea's inner text and the position of a text field's inner
939         text. This fix up may have worked out visually when it was added, but based on the discovery of the
940         hardcoded 3px left and right padding (see below remark) it looks like it was always one pixel too short.
941         * html/HTMLTextAreaElement.cpp:
942         (WebCore::HTMLTextAreaElement::createInnerTextStyle): Remove hardcoded 3px left and right padding.
943
944 2019-03-04  Youenn Fablet  <youenn@apple.com>
945
946         Make sure to correctly notify of end of a ServiceWorkerJob when the context is stopped
947         https://bugs.webkit.org/show_bug.cgi?id=195195
948
949         Reviewed by Chris Dumez.
950
951         Before the patch, we were notifying that some jobs were finished too aggressively at context stop time.
952         This was confusing the Network Process.
953         Only notify such jobs that have pending loads.
954         Improve the tracking of jobs doing registration resolution to ensure the Network Process gets notified
955         in case of a registration promise being resolved but the settling callback being not yet called while the context is stopped.
956
957         Covered by existing tests not crashing anymore, in particular imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting.https.html.
958
959         * workers/service/ServiceWorkerContainer.cpp:
960         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
961         (WebCore::ServiceWorkerContainer::notifyRegistrationIsSettled):
962         (WebCore::ServiceWorkerContainer::stop):
963         * workers/service/ServiceWorkerContainer.h:
964         * workers/service/ServiceWorkerJob.cpp:
965         (WebCore::ServiceWorkerJob::cancelPendingLoad):
966         * workers/service/ServiceWorkerJob.h:
967         (WebCore::ServiceWorkerJob::isLoading const):
968
969 2019-03-04  Chris Dumez  <cdumez@apple.com>
970
971         [iOS] Improve our file picker
972         https://bugs.webkit.org/show_bug.cgi?id=195284
973         <rdar://problem/45655856>
974
975         Reviewed by Tim Horton and Wenson Hsieh.
976
977         Export UTIUtilities.h so that it can be used from WebKit2.
978
979         * WebCore.xcodeproj/project.pbxproj:
980
981 2019-03-04  Zalan Bujtas  <zalan@apple.com>
982
983         [ContentChangeObserver] Decouple mouseMoved event and the "is observing content change" status.
984         https://bugs.webkit.org/show_bug.cgi?id=195286
985
986         Reviewed by Simon Fraser.
987
988         Now isObservingContentChanges returns true only when we are actively observing content change during timer firing and/or style recalculating.
989         This patch also renames a couple of functions to follow the didStart/didFinish pattern.
990
991         * page/ios/ContentChangeObserver.cpp:
992         (WebCore::ContentChangeObserver::domTimerExecuteDidStart):
993         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
994         (WebCore::ContentChangeObserver::styleRecalcDidStart):
995         (WebCore::ContentChangeObserver::styleRecalcDidFinish):
996         (WebCore::ContentChangeObserver::mouseMovedDidStart):
997         (WebCore::ContentChangeObserver::mouseMovedDidFinish):
998         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
999         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
1000         (WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
1001         (WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
1002         (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
1003         (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
1004         (WebCore::ContentChangeObserver::DOMTimerScope::DOMTimerScope):
1005         (WebCore::ContentChangeObserver::DOMTimerScope::~DOMTimerScope):
1006         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute): Deleted.
1007         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute): Deleted.
1008         (WebCore::ContentChangeObserver::startObservingStyleRecalc): Deleted.
1009         (WebCore::ContentChangeObserver::stopObservingStyleRecalc): Deleted.
1010         (WebCore::ContentChangeObserver::startObservingMouseMoved): Deleted.
1011         (WebCore::ContentChangeObserver::stopObservingMouseMoved): Deleted.
1012         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc): Deleted.
1013         * page/ios/ContentChangeObserver.h:
1014         (WebCore::ContentChangeObserver::setShouldObserveDOMTimerScheduling):
1015         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
1016         (WebCore::ContentChangeObserver::isObservingStyleRecalc const):
1017         (WebCore::ContentChangeObserver::isObservingContentChanges const):
1018         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling): Deleted.
1019         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling): Deleted.
1020         (WebCore::ContentChangeObserver::shouldObserveStyleRecalc const): Deleted.
1021
1022 2019-03-04  Yusuke Suzuki  <ysuzuki@apple.com>
1023
1024         [JSC] Offer @makeTypeError instead of exposing @TypeError
1025         https://bugs.webkit.org/show_bug.cgi?id=193858
1026
1027         Reviewed by Mark Lam.
1028
1029         Use @makeTypeError instead.
1030
1031         * Modules/mediastream/RTCPeerConnection.js:
1032         * Modules/mediastream/RTCPeerConnectionInternals.js:
1033         * Modules/streams/ReadableByteStreamInternals.js:
1034         (readableByteStreamControllerClose):
1035         (readableByteStreamControllerPullInto):
1036         * Modules/streams/ReadableStream.js:
1037         (cancel):
1038         (pipeTo):
1039         * Modules/streams/ReadableStreamBYOBReader.js:
1040         (cancel):
1041         (read):
1042         * Modules/streams/ReadableStreamDefaultReader.js:
1043         (cancel):
1044         (read):
1045         * Modules/streams/ReadableStreamInternals.js:
1046         (readableStreamReaderGenericRelease):
1047         * Modules/streams/WritableStream.js:
1048         (abort):
1049         (close):
1050         (write):
1051         (getter.closed):
1052         (getter.ready):
1053
1054 2019-03-04  Simon Fraser  <simon.fraser@apple.com>
1055
1056         Share more code between overflow and frame scrolling nodes, fixing overflow scrollbar display
1057         https://bugs.webkit.org/show_bug.cgi?id=195258
1058
1059         Reviewed by Antti Koivisto.
1060
1061         This patch moves management of scrollbar layers and scrollbar painters ("NSScrollerImp") down to
1062         ScrollingStateScrollingNode to be shared between frame and overflow nodes, allowing for
1063         scrolling thread updates of overflow scrollbars. It also moves some scrolling tree-side code
1064         to ScrollingTreeScrollingNodeDelegateMac to be shared between the "tree" nodes for overflow and frames.
1065
1066         Layers for scrollbars are given to scrolling state nodes via setNodeLayers() now, and
1067         RenderLayerCompositor::updateScrollingNodeLayers() is added to provide a bottleneck to call that.
1068         At some point AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() should be relieved
1069         of the responsibility of pushing scrollbar layers (but the scrolling state tree needs to hold
1070         references to GraphicsLayers before that becomes safe).
1071         
1072         The actual fix that allows overflow scrollbars to show is the change in
1073         AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() that calls scrollableArea.*ScrollbarLayerDidChange()
1074         for all ScrollableAreas. This ensures that the CALayer is pushed onto the NSScrollerImp.
1075
1076         * SourcesCocoa.txt:
1077         * WebCore.xcodeproj/project.pbxproj:
1078         * page/scrolling/AsyncScrollingCoordinator.cpp:
1079         (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
1080         (WebCore::AsyncScrollingCoordinator::setNodeLayers):
1081         (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
1082         (WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
1083         * page/scrolling/ScrollingCoordinator.h:
1084         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1085         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
1086         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
1087         (WebCore::ScrollingStateFrameScrollingNode::setVerticalScrollbarLayer): Deleted.
1088         (WebCore::ScrollingStateFrameScrollingNode::setHorizontalScrollbarLayer): Deleted.
1089         (WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars): Deleted.
1090         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1091         * page/scrolling/ScrollingStateScrollingNode.cpp:
1092         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
1093         (WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
1094         (WebCore::ScrollingStateScrollingNode::setHorizontalScrollbarLayer):
1095         (WebCore::ScrollingStateScrollingNode::setVerticalScrollbarLayer):
1096         (WebCore::ScrollingStateScrollingNode::setScrollerImpsFromScrollbars):
1097         * page/scrolling/ScrollingStateScrollingNode.h:
1098         (WebCore::ScrollingStateScrollingNode::horizontalScrollbarLayer const):
1099         (WebCore::ScrollingStateScrollingNode::verticalScrollbarLayer const):
1100         (WebCore::ScrollingStateScrollingNode::verticalScrollerImp const):
1101         (WebCore::ScrollingStateScrollingNode::horizontalScrollerImp const):
1102         * page/scrolling/ScrollingTree.cpp:
1103         (WebCore::ScrollingTree::setOrClearLatchedNode):
1104         (WebCore::ScrollingTree::handleWheelEvent):
1105         * page/scrolling/mac/ScrollingStateScrollingNodeMac.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm.
1106         (WebCore::ScrollingStateScrollingNode::setScrollerImpsFromScrollbars):
1107         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1108         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1109         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
1110         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
1111         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
1112         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac): Deleted.
1113         (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollerImpsOnTheMainThread): Deleted.
1114         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
1115         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1116         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
1117         (WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent):
1118         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionRelatedLayers):
1119         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
1120         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
1121         (WebCore::ScrollingTreeScrollingNodeDelegateMac::~ScrollingTreeScrollingNodeDelegateMac):
1122         (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateFromStateNode):
1123         (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
1124         (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateScrollbarPainters):
1125         (WebCore::ScrollingTreeScrollingNodeDelegateMac::releaseReferencesToScrollerImpsOnTheMainThread):
1126         * platform/ScrollbarThemeComposite.h:
1127         * rendering/RenderLayerCompositor.cpp:
1128         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
1129         (WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
1130         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
1131         * rendering/RenderLayerCompositor.h:
1132
1133 2019-03-04  Jer Noble  <jer.noble@apple.com>
1134
1135         Remove HEVC as a codec requiring hardware support.
1136         https://bugs.webkit.org/show_bug.cgi?id=194960
1137         <rdar://problem/47741432>
1138
1139         Reviewed by Eric Carlson.
1140
1141         * page/cocoa/SettingsBaseCocoa.mm:
1142         (WebCore::SettingsBase::defaultMediaContentTypesRequiringHardwareSupport):
1143
1144 2019-03-04  Jer Noble  <jer.noble@apple.com>
1145
1146         [iOS] Fullscreen "stay in page" option breaks video playback
1147         https://bugs.webkit.org/show_bug.cgi?id=195277
1148         <rdar://problem/48537317>
1149
1150         Reviewed by Eric Carlson.
1151
1152         Add a LOG entry when playback is rejected due to media playback suspension.
1153
1154         * html/MediaElementSession.cpp:
1155         (WebCore::MediaElementSession::playbackPermitted const):
1156
1157 2019-03-04  Tim Horton  <timothy_horton@apple.com>
1158
1159         Fix the build.
1160
1161         * dom/Document.h:
1162
1163 2019-03-03  Zalan Bujtas  <zalan@apple.com>
1164
1165         [ContentChangeObserver] Content observation should be limited to the current document.
1166         https://bugs.webkit.org/show_bug.cgi?id=195256
1167         <rdar://problem/48544402>
1168
1169         Move ContentChangeObserver from Page to Document.
1170         It limits content observation to the target node's owner document.
1171
1172         Reviewed by Simon Fraser.
1173
1174         * dom/Document.cpp:
1175         (WebCore::m_contentChangeObserver):
1176         (WebCore::Document::updateStyleIfNeeded):
1177         (WebCore::Document::willDetachPage):
1178         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
1179         (WebCore::m_undoManager): Deleted.
1180         * dom/Document.h:
1181         (WebCore::Document::contentChangeObserver):
1182         * page/DOMTimer.cpp:
1183         (WebCore::DOMTimer::install):
1184         (WebCore::DOMTimer::removeById):
1185         (WebCore::DOMTimer::fired):
1186         * page/Frame.cpp:
1187         (WebCore::Frame::willDetachPage):
1188         * page/Page.cpp:
1189         (WebCore::Page::Page):
1190         * page/Page.h:
1191         (WebCore::Page::pointerLockController const):
1192         (WebCore::Page::contentChangeObserver): Deleted.
1193         * page/ios/ContentChangeObserver.cpp:
1194         (WebCore::ContentChangeObserver::ContentChangeObserver):
1195         (WebCore::ContentChangeObserver::didInstallDOMTimer):
1196         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
1197         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
1198         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
1199         (WebCore::ContentChangeObserver::startObservingMouseMoved):
1200         (WebCore::ContentChangeObserver::hasDeterminateState const):
1201         (WebCore::ContentChangeObserver::adjustObservedState):
1202         (WebCore::ContentChangeObserver::notifyContentChangeIfNeeded):
1203         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
1204         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
1205         (WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
1206         (WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
1207         (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
1208         (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
1209         (WebCore::ContentChangeObserver::DOMTimerScope::DOMTimerScope):
1210         (WebCore::ContentChangeObserver::DOMTimerScope::~DOMTimerScope):
1211         (WebCore::hasPendingStyleRecalc): Deleted.
1212         * page/ios/ContentChangeObserver.h:
1213         * page/ios/EventHandlerIOS.mm:
1214         (WebCore::EventHandler::mouseMoved):
1215         * rendering/updating/RenderTreeUpdater.cpp:
1216         (WebCore::RenderTreeUpdater::updateElementRenderer):
1217
1218 2019-03-02  Simon Fraser  <simon.fraser@apple.com>
1219
1220         Share more code for updating the state of frame scrolling nodes
1221         https://bugs.webkit.org/show_bug.cgi?id=195254
1222
1223         Reviewed by Antti Koivisto.
1224
1225         Responsibility for updating state on ScrollingStateFrameScrolling nodes was split between
1226         AsyncScrollingCoordinator::frameViewLayoutUpdated(), which is called post-layout, and
1227         RenderLayerCompositor. This patch gives that responsibility entirely to RenderLayerCompositor,
1228         ensuring that we update frame scrolling nodes at the same time as the rest of the scrolling
1229         state tree.
1230         
1231         We also share code between updating ScrollingStateFrameScrollingNodes and
1232         ScrollingStateOverflowScrollingNodews, since both can be updated from a ScrollableArea.
1233         Some minor cleanup of ScrollableArea is doing to help. For the first time, we're pushing
1234         ScrollableAreaParameters for overflow scrolling nodes, allowing rubber-banding to work
1235         on macOS.
1236
1237         * page/scrolling/AsyncScrollingCoordinator.cpp:
1238         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1239         (WebCore::AsyncScrollingCoordinator::setRectRelativeToParentNode):
1240         (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
1241         (WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
1242         (WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeConstraints):
1243         (WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry): Deleted.
1244         (WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeGeometry): Deleted.
1245         * page/scrolling/AsyncScrollingCoordinator.h:
1246         * page/scrolling/ScrollingCoordinator.h:
1247         (WebCore::ScrollingCoordinator::setRectRelativeToParentNode):
1248         (WebCore::ScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
1249         (WebCore::ScrollingCoordinator::setFrameScrollingNodeState):
1250         (WebCore::ScrollingCoordinator::setViewportConstraintedNodeConstraints):
1251         (WebCore::ScrollingCoordinator::setScrollingNodeGeometry): Deleted.
1252         (WebCore::ScrollingCoordinator::setViewportConstraintedNodeGeometry): Deleted.
1253         * platform/ScrollView.h:
1254         (WebCore::ScrollView::horizontalScrollbarMode const): Deleted.
1255         (WebCore::ScrollView::verticalScrollbarMode const): Deleted.
1256         * platform/ScrollableArea.cpp:
1257         (WebCore::ScrollableArea::reachableTotalContentsSize const):
1258         * platform/ScrollableArea.h:
1259         (WebCore::ScrollableArea::horizontalScrollbarMode const):
1260         (WebCore::ScrollableArea::verticalScrollbarMode const):
1261         * rendering/RenderLayer.cpp:
1262         (WebCore::RenderLayer::overhangAmount const):
1263         (WebCore::RenderLayer::reachableTotalContentsSize const):
1264         (WebCore::RenderLayer::scrollableContentsSize const): Deleted.
1265         * rendering/RenderLayer.h:
1266         * rendering/RenderLayerCompositor.cpp:
1267         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1268         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
1269         (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
1270         (WebCore::RenderLayerCompositor::rootParentRelativeScrollableRect const):
1271         (WebCore::RenderLayerCompositor::parentRelativeScrollableRect const):
1272         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
1273         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
1274         (WebCore::RenderLayerCompositor::computeFrameScrollingGeometry const): Deleted.
1275         (WebCore::RenderLayerCompositor::computeFrameHostingGeometry const): Deleted.
1276         (WebCore::RenderLayerCompositor::computeOverflowScrollingGeometry const): Deleted.
1277         * rendering/RenderLayerCompositor.h:
1278
1279 2019-03-02  Darin Adler  <darin@apple.com>
1280
1281         Retire legacy dtoa function and DecimalNumber class
1282         https://bugs.webkit.org/show_bug.cgi?id=195253
1283
1284         Reviewed by Daniel Bates.
1285
1286         * css/CSSPrimitiveValue.cpp:
1287         (WebCore::CSSPrimitiveValue::formatNumberValue const): Use makeString instead
1288         of DecimalNumber. Also changed return type to String and use StringView and
1289         removed special handling of literals.
1290         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const): Removed an
1291         unnecessary use of StringBuilder.
1292
1293         * css/CSSPrimitiveValue.h: Updated for changes to formatNumberValue.
1294
1295 2019-03-03  Michael Catanzaro  <mcatanzaro@igalia.com>
1296
1297         [SOUP] Cleanups in SoupNetworkSession
1298         https://bugs.webkit.org/show_bug.cgi?id=195247
1299
1300         Reviewed by Daniel Bates.
1301
1302         This renames clientCertificates to allowedCertificates, since they are not client
1303         certificates at all, but server certificates. It also adds a using statement to avoid
1304         repeating the long type of the map, and avoids an unnecessary copy.
1305
1306         * platform/network/soup/SoupNetworkSession.cpp:
1307         (WebCore::allowedCertificates):
1308         (WebCore::SoupNetworkSession::checkTLSErrors):
1309         (WebCore::SoupNetworkSession::allowSpecificHTTPSCertificateForHost):
1310         (WebCore::clientCertificates): Deleted.
1311
1312 2019-03-03  Michael Catanzaro  <mcatanzaro@igalia.com>
1313
1314         -Wformat error in SharedBuffer::tryCreateArrayBuffer
1315         https://bugs.webkit.org/show_bug.cgi?id=195004
1316
1317         Reviewed by Darin Adler.
1318
1319         Seems C++ has no format specifier appropriate for printing the result of sizeof. We should
1320         just not try to print it. Anyway, that's easy in this case, because sizeof(char) is
1321         guaranteed to be 1. This code was an attempt to be pedantic to account for mythical systems
1322         with char larger than one byte, but perhaps it didn't realize sizeof always returns
1323         multiples of char and so sizeof(char) is always one even on such mythical systems.
1324
1325         Note the sizeof(char) use two lines up is left since it's not clear that switching it to 1
1326         would actually be more readable.
1327
1328         * platform/SharedBuffer.cpp:
1329         (WebCore::SharedBuffer::tryCreateArrayBuffer const):
1330
1331 2019-03-03  Tim Horton  <timothy_horton@apple.com>
1332
1333         Remove some more unused 32-bit code
1334         https://bugs.webkit.org/show_bug.cgi?id=195255
1335
1336         Reviewed by Darin Adler.
1337
1338         * platform/gamepad/cocoa/GameControllerGamepad.h:
1339         * platform/gamepad/cocoa/GameControllerGamepad.mm:
1340         * platform/gamepad/cocoa/GameControllerGamepadProvider.h:
1341         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
1342         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1343         * platform/mac/PlatformEventFactoryMac.mm:
1344         (WebCore::globalPointForEvent):
1345         (WebCore::pointForEvent):
1346         (WebCore::mouseButtonForEvent):
1347         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
1348         * rendering/RenderThemeMac.mm:
1349         (WebCore::RenderThemeMac::servicesRolloverButtonCell const):
1350         (WebCore::RenderThemeMac::paintImageControlsButton):
1351         (WebCore::RenderThemeMac::imageControlsButtonSize const):
1352         (WebCore::RenderThemeMac::imageControlsButtonPositionOffset const):
1353
1354 2019-03-02  Zalan Bujtas  <zalan@apple.com>
1355
1356         [ContentChangeObserver] Introduce ContentChangeObserver::MouseMovedScope
1357         https://bugs.webkit.org/show_bug.cgi?id=195252
1358         <rdar://problem/48539446>
1359
1360         Reviewed by Simon Fraser.
1361
1362         Scope the mouse-moved event to make the callsites less error-prone. 
1363
1364         * page/ios/ContentChangeObserver.cpp:
1365         (WebCore::ContentChangeObserver::startObservingMouseMoved):
1366         (WebCore::ContentChangeObserver::stopObservingMouseMoved):
1367         (WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
1368         (WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
1369         (WebCore::ContentChangeObserver::startObservingContentChanges): Deleted.
1370         (WebCore::ContentChangeObserver::stopObservingContentChanges): Deleted.
1371         * page/ios/ContentChangeObserver.h:
1372         * page/ios/EventHandlerIOS.mm:
1373         (WebCore::EventHandler::mouseMoved):
1374
1375 2019-03-02  Zalan Bujtas  <zalan@apple.com>
1376
1377         [ContentChangeObserver] Introduce ContentChangeObserver::adjustObservedState
1378         https://bugs.webkit.org/show_bug.cgi?id=195244
1379         <rdar://problem/48536737>
1380
1381         Reviewed by Simon Fraser.
1382
1383         Move state change handling code to adjustObservedState() and introduce signalContentChangeIfNeeded() to
1384         let the client know about the state change (or lack of state change).
1385
1386         Test: fast/events/touch/ios/visibility-change-happens-at-the-second-timer.html
1387
1388         * page/ios/ContentChangeObserver.cpp:
1389         (WebCore::ContentChangeObserver::didInstallDOMTimer):
1390         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
1391         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
1392         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
1393         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
1394         (WebCore::ContentChangeObserver::didContentVisibilityChange):
1395         (WebCore::ContentChangeObserver::addObservedDOMTimer):
1396         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
1397         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
1398         (WebCore::ContentChangeObserver::adjustObservedState):
1399         (WebCore::ContentChangeObserver::signalContentChangeIfNeeded):
1400         * page/ios/ContentChangeObserver.h:
1401         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
1402         (WebCore::ContentChangeObserver::addObservedDOMTimer): Deleted.
1403         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc): Deleted.
1404
1405 2019-03-02  Zalan Bujtas  <zalan@apple.com>
1406
1407         [ContentChangeObserver] Move away from WKContentChange values
1408         https://bugs.webkit.org/show_bug.cgi?id=195240
1409         <rdar://problem/48532358>
1410
1411         Reviewed by Simon Fraser.
1412
1413         This is in preparation for moving towards a state machine-like implementation.
1414
1415         * page/ios/ContentChangeObserver.cpp:
1416         (WebCore::ContentChangeObserver::didInstallDOMTimer): Do not install the timer if we are already in "hover" state.
1417         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
1418         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
1419         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
1420         (WebCore::ContentChangeObserver::startObservingStyleRecalc): No need to start observing the style recalc if we are already in "hover" state.
1421         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
1422         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
1423         (WebCore::ContentChangeObserver::didContentVisibilityChange):
1424         (WebCore::ContentChangeObserver::startObservingContentChanges):
1425         (WebCore::ContentChangeObserver::observedContentChange const):
1426         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
1427         (WebCore::ContentChangeObserver::hasDeterminedState const):
1428         (WebCore::ContentChangeObserver::observedContentChange): Deleted.
1429         (WebCore::ContentChangeObserver::resetObservedContentChange): Deleted.
1430         (WebCore::ContentChangeObserver::setObservedContentChange): Deleted.
1431         (WebCore::ContentChangeObserver::addObservedDOMTimer): Deleted.
1432         * page/ios/ContentChangeObserver.h:
1433         (WebCore::ContentChangeObserver::addObservedDOMTimer):
1434         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
1435         (WebCore::ContentChangeObserver::hasVisibleChangeState const):
1436         (WebCore::ContentChangeObserver::hasObservedDOMTimer const):
1437         (WebCore::ContentChangeObserver::setHasNoChangeState):
1438         (WebCore::ContentChangeObserver::setHasIndeterminateState):
1439         (WebCore::ContentChangeObserver::setHasVisibleChangeState):
1440         (WebCore::ContentChangeObserver::countOfObservedDOMTimers const): Deleted.
1441
1442 2019-03-02  Wenson Hsieh  <wenson_hsieh@apple.com>
1443
1444         [iOS] Programmatic paste access should be granted when copying and pasting within the same origin
1445         https://bugs.webkit.org/show_bug.cgi?id=195053
1446         <rdar://problem/48134710>
1447
1448         Reviewed by Ryosuke Niwa.
1449
1450         Plumb the document pasteboard identifier through the client when making a DOM paste access request. See WebKit
1451         ChangeLog for more details.
1452
1453         Test: editing/pasteboard/ios/dom-paste-same-origin.html
1454
1455         * WebCore.xcodeproj/project.pbxproj:
1456         * dom/DOMPasteAccess.h: Renamed from Source/WebCore/dom/DOMPasteAccessPolicy.h.
1457
1458         Introduce DOMPasteAccessResponse, which is either DeniedForGesture, GrantedForCommand, or GrantedForGesture. In
1459         particular, when pasteboard identifiers match, we only grant access for the current paste command, rather than
1460         throughout the user gesture.
1461
1462         * dom/UserGestureIndicator.h:
1463         (WebCore::UserGestureToken::didRequestDOMPasteAccess):
1464         * loader/EmptyClients.cpp:
1465         * page/EditorClient.h:
1466         * page/Frame.cpp:
1467         (WebCore::Frame::requestDOMPasteAccess):
1468
1469 2019-02-27  Darin Adler  <darin@apple.com>
1470
1471         Fixed makeString(float) to do shortest-form serialization without first converting to double
1472         https://bugs.webkit.org/show_bug.cgi?id=195142
1473
1474         Reviewed by Daniel Bates.
1475
1476         * platform/graphics/Color.cpp: Removed unneeded include of DecimalNumber.h.
1477
1478 2019-03-02  Simon Fraser  <simon.fraser@apple.com>
1479
1480         REGRESSION (r242132): Incorrect positioning with multiple position:fixed elements
1481         https://bugs.webkit.org/show_bug.cgi?id=195246
1482
1483         Reviewed by Frederic Wang.
1484
1485         r242132 introduced a bug where the management of 'cumulativeDelta' in ScrollingTree::notifyRelatedNodesRecursive
1486         was incorrect. This value should propagate from ancestors to descendants, but not between siblings in the scrolling
1487         tree, which it did, causing sibling position:fixed to behave incorrectly.
1488
1489         Test: scrollingcoordinator/mac/multiple-fixed.html
1490
1491         * page/scrolling/ScrollingTree.cpp:
1492         (WebCore::ScrollingTree::notifyRelatedNodesRecursive):
1493         * page/scrolling/ScrollingTree.h:
1494
1495 2019-03-02  Darin Adler  <darin@apple.com>
1496
1497         Improve some comments
1498         https://bugs.webkit.org/show_bug.cgi?id=195243
1499
1500         Reviewed by Daniel Bates.
1501
1502         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1503         (-[WebAccessibilityObjectWrapper _addAccessibilityObject:toTextMarkerArray:]):
1504         Fix a typo in a comment.
1505
1506         * dom/RadioButtonGroups.cpp: Fix a typo in a comment.
1507         (WebCore::RadioButtonGroups::checkedButtonForGroup const): Use nullptr instead of 0.
1508
1509         * html/HTMLInputElement.cpp:
1510         (WebCore::HTMLInputElement::~HTMLInputElement): Improved a comment, but sadly made
1511         it a bit longer. Use nullptr instead of 0.
1512         (WebCore::HTMLInputElement::didMoveToNewDocument): Added a comment.
1513
1514 2019-03-01  Wenson Hsieh  <wenson_hsieh@apple.com>
1515
1516         [Datalist] fast/forms/datalist/datalist-child-validation.html crashes with a debug assertion in isValidFormControlElement()
1517         https://bugs.webkit.org/show_bug.cgi?id=190620
1518         <rdar://problem/19226679>
1519
1520         Reviewed by Ryosuke Niwa.
1521
1522         Fixes and re-enables an existing layout test that is asserting on debug builds (and failing on release builds).
1523         To understand why we hit this assertion, we first note several observations:
1524
1525             -   The validity of a form control (`isValid()`) depends on the value of `willValidate()`.
1526             -   Both of these results are cached in member variables: `m_isValid` and `m_willValidate`, respectively.
1527             -   `willValidate()` changes the cached value of `m_willValidate` if necessary, but `isValid()` uses the
1528                 cached value without update.
1529
1530         Now, consider the following scenario:
1531
1532             1.  Something changes in the DOM that changes the result of `willValidate()`. This can happen as a result of
1533                 several things:
1534                 a.  The form control changes readonly state
1535                 b.  The form control changes disabled state
1536                 c.  The form control is added to a datalist element
1537                 d.  The form control is removed from a datalist element
1538             2.  Call `willValidate()`.
1539             3.  Call `isValid()`.
1540
1541         In scenarios (a) - (c), we ensure that cached form control validity (`m_isValid`) is updated alongside
1542         `m_willValidate` by invoking `setNeedsWillValidateCheck()`, such that the result of `isValid()` matches the
1543         result of `m_isValid` in step (3). However, in the last scenario (d), we don't do this, which causes form
1544         control validity to fall out of sync with the result of `isValid()`. To fix the bug, we update willValidate and
1545         isValid when a form control is removed from an ancestor, only if one of its ancestors is a datalist element.
1546
1547         * html/HTMLFormControlElement.cpp:
1548         (WebCore::HTMLFormControlElement::insertedIntoAncestor):
1549         (WebCore::HTMLFormControlElement::removedFromAncestor):
1550
1551         Make a couple of minor tweaks:
1552           - Currently, we always invalidate `m_dataListAncestorState` by resetting the state to `Unknown` when the form
1553             control is removed from an ancestor or inserted. Instead, we only need to reset it when the form control
1554             already has an ancestor that is a datalist (in the case where it's being removed) or when the form control
1555             does not yet have an ancestor (in the case where it is being added).
1556           - If the form control was inside a datalist prior to removal, recompute its cached value of `m_willValidate`,
1557             as well as its cached validity (`m_isValid`).
1558
1559 2019-03-01  Darin Adler  <darin@apple.com>
1560
1561         Finish removing String::format
1562         https://bugs.webkit.org/show_bug.cgi?id=194893
1563
1564         Reviewed by Daniel Bates.
1565
1566         * dom/Document.cpp:
1567         (WebCore::Document::lastModified const): Use makeString and pad.
1568         * html/FTPDirectoryDocument.cpp:
1569         (WebCore::processFileDateString): Ditto.
1570
1571         * mathml/MathMLElement.cpp:
1572         (WebCore::convertToPercentageIfNeeded): Use makeString and FormattedNumber.
1573
1574         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1575         (WebCore::ResourceUsageOverlay::platformDraw): Use makeString and pad.
1576
1577         * page/linux/ResourceUsageOverlayLinux.cpp:
1578         (WebCore::cpuUsageString): Use makeString, FormattedNumber, and pad.
1579         (WebCore::gcTimerString): Use String::number.
1580
1581         * platform/DateComponents.cpp:
1582         (WebCore::DateComponents::toStringForTime const): Use makeString and pad.
1583         (WebCore::DateComponents::toString const): Ditto.
1584
1585         * platform/LocalizedStrings.cpp: Removed comment that mentioned String::format,
1586         and that was also inaccurate.
1587
1588         * platform/audio/HRTFElevation.cpp:
1589         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
1590         Use makeString and pad.
1591         * platform/mock/MockRealtimeVideoSource.cpp:
1592         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
1593         * rendering/RenderLayerCompositor.cpp:
1594         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
1595         * rendering/RenderTheme.cpp:
1596         (WebCore::RenderTheme::formatMediaControlsTime const): Ditto.
1597
1598 2019-03-01  Chris Dumez  <cdumez@apple.com>
1599
1600         Do not attempt to set WAL Journal mode on a readonly SQLite database
1601         https://bugs.webkit.org/show_bug.cgi?id=195237
1602
1603         Reviewed by Simon Fraser.
1604
1605         This avoids logging errors when opening the database.
1606
1607         * platform/sql/SQLiteDatabase.cpp:
1608         (WebCore::SQLiteDatabase::open):
1609         (WebCore::SQLiteDatabase::useWALJournalMode):
1610         * platform/sql/SQLiteDatabase.h:
1611
1612 2019-03-01  Antoine Quint  <graouts@apple.com>
1613
1614         [iOS] Turn mouse event simulation on by default
1615         https://bugs.webkit.org/show_bug.cgi?id=195218
1616         <rdar://problem/48516794>
1617
1618         Reviewed by Dean Jackson.
1619
1620         * page/RuntimeEnabledFeatures.h:
1621
1622 2019-03-01  Chris Dumez  <cdumez@apple.com>
1623
1624         Disable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThread is enabled
1625         https://bugs.webkit.org/show_bug.cgi?id=195230
1626         <rdar://problem/47925359>
1627
1628         Reviewed by Ryosuke Niwa.
1629
1630         Disable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThread is enabled
1631         to address crashes on iOS WK1.
1632
1633         * platform/network/NetworkStateNotifier.cpp:
1634         (WebCore::shouldSuppressThreadSafetyCheck):
1635         (WebCore::NetworkStateNotifier::singleton):
1636
1637 2019-03-01  Simon Fraser  <simon.fraser@apple.com>
1638
1639         Show mouse event regions in the overlay
1640         https://bugs.webkit.org/show_bug.cgi?id=195227
1641
1642         Reviewed by Tim Horton.
1643
1644         Enhance event region overlays to show more kinds of events.
1645
1646         * page/DebugPageOverlays.cpp:
1647         (WebCore::touchEventRegionColors):
1648         (WebCore::NonFastScrollableRegionOverlay::drawRect):
1649
1650 2019-03-01  Zalan Bujtas  <zalan@apple.com>
1651
1652         [ContentChangeObserver] Check for pending style recalcs at the end of each timer run.
1653         https://bugs.webkit.org/show_bug.cgi?id=195220
1654         <rdar://problem/48518979>
1655
1656         Reviewed by Simon Fraser.
1657
1658         didScheduleStyleRecalc callback was introduced to see if a style recalc is scheduled while firing the DOM timer. However it does not handle the case
1659         when in addition to this style recalc scheduling, something later (though during the same timer firing) triggers a sync style recalc.
1660         Let's just check if we've got a pending style recalc when the DOM timer comes back.
1661
1662         Test: fast/events/touch/ios/style-recalc-schedule-and-force-relalc.html
1663
1664         * dom/Document.cpp:
1665         (WebCore::Document::scheduleStyleRecalc):
1666         * page/ios/ContentChangeObserver.cpp:
1667         (WebCore::hasPendingStyleRecalc):
1668         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
1669         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
1670         (WebCore::ContentChangeObserver::startObservingContentChanges):
1671         (WebCore::ContentChangeObserver::didScheduleStyleRecalc): Deleted.
1672         * page/ios/ContentChangeObserver.h:
1673         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
1674         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
1675         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const): Deleted.
1676
1677 2019-03-01  John Wilander  <wilander@apple.com>
1678
1679         Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration
1680         https://bugs.webkit.org/show_bug.cgi?id=195196
1681         <rdar://problem/48006419>
1682
1683         Reviewed by Brent Fulgham.
1684
1685         Tests: http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site.html
1686                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource.html
1687                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource.html
1688                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource.html
1689                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource.html
1690
1691         Trackers abuse link query parameters to transport user identifiers cross-site.
1692         This patch detects such navigations and applies further restrictions to
1693         client-site cookies on the destination page.
1694
1695         * platform/network/NetworkStorageSession.cpp:
1696         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
1697             Now sets the regular 7-day cap and a reduced 1-day cap.
1698         (WebCore::NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics):
1699             Renamed NetworkStorageSession::removeStorageAccessForAllFramesOnPage() to
1700             NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics since
1701             it now clears out two types of page-specific data.
1702         (WebCore::NetworkStorageSession::committedCrossSiteLoadWithLinkDecoration):
1703             This function receives a cross-site navigation and checks if the originating
1704             site is a prevalent resource. If so, it marks the page or stricter cookie
1705             rules.
1706         (WebCore::NetworkStorageSession::resetCrossSiteLoadsWithLinkDecorationForTesting):
1707             Test infrastructure. This sets a state that overrides the regular per-page
1708             clear of data. The reason is that the double clear was racy and caused test
1709             failures.
1710         (WebCore::NetworkStorageSession::clientSideCookieCap const):
1711             New function that returns the current cookie lifetime cap.
1712         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): Deleted.
1713             Renamed to NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics().
1714         * platform/network/NetworkStorageSession.h:
1715         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
1716         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
1717             Now calls NetworkStorageSession::clientSideCookieCap() to set the cap.
1718
1719 2019-03-01  Rob Buis  <rbuis@igalia.com>
1720
1721         Adjust XMLHttpRequest Content-Type handling
1722         https://bugs.webkit.org/show_bug.cgi?id=184645
1723
1724         Reviewed by Youenn Fablet.
1725
1726         Implement steps 4.4.1.2 and 4.4.1.3 of send() [1].
1727
1728         Test: web-platform-tests/xhr/send-content-type-charset.htm
1729
1730         [1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send
1731
1732         * platform/network/ParsedContentType.cpp:
1733         (WebCore::ParsedContentType::setCharset):
1734         * platform/network/ParsedContentType.h:
1735         * xml/XMLHttpRequest.cpp:
1736         (WebCore::replaceCharsetInMediaTypeIfNeeded):
1737         (WebCore::XMLHttpRequest::send):
1738         (WebCore::replaceCharsetInMediaType): Deleted.
1739
1740 2019-03-01  Youenn Fablet  <youenn@apple.com>
1741
1742         Update originsMatch to handle the case of file origins which enforce file path separation
1743         https://bugs.webkit.org/show_bug.cgi?id=195216
1744
1745         Reviewed by Brady Eidson.
1746
1747         Covered by the assertion and existing tests like fast/xmlhttprequest/xmlhttprequest-no-file-access.html.
1748         Make sure originsMatch returns true if either compared origins are the same object
1749         or they have the same file path separation behavior.
1750
1751         * page/SecurityOrigin.cpp:
1752         (WebCore::areOriginsMatching):
1753         (WebCore::originsMatch):
1754
1755 2019-03-01  Youenn Fablet  <youenn@apple.com>
1756
1757         Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
1758         https://bugs.webkit.org/show_bug.cgi?id=195213
1759
1760         Reviewed by Alex Christensen.
1761
1762         Add traits to enable enum IPC encoding.
1763         No change of behavior.
1764
1765         * Modules/indexeddb/IndexedDB.h:
1766
1767 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
1768
1769         [WinCairo] Enable service worker
1770         https://bugs.webkit.org/show_bug.cgi?id=188318
1771
1772         Reviewed by Youenn Fablet.
1773
1774         * WebCorePrefix.h:
1775         * testing/ServiceWorkerInternals.h:
1776         * workers/service/context/SWContextManager.cpp:
1777         (WebCore::SWContextManager::serviceWorkerFailedToTerminate):
1778         * workers/service/context/SWContextManager.h:
1779
1780 2019-03-01  Sihui Liu  <sihui_liu@apple.com>
1781
1782         Add a quirk for bostongloble.com and latimes.com
1783         https://bugs.webkit.org/show_bug.cgi?id=195155
1784
1785         Reviewed by Geoffrey Garen.
1786
1787         Covered by manual testing.
1788
1789         * Modules/webdatabase/DOMWindowWebDatabase.idl:
1790         * bindings/scripts/CodeGeneratorJS.pm:
1791         (GenerateRuntimeEnableConditionalString):
1792         * bindings/scripts/IDLAttributes.json:
1793         * bindings/scripts/preprocess-idls.pl:
1794         (GenerateConstructorAttributes):
1795         * page/Quirks.cpp:
1796         (WebCore::Quirks::hasWebSQLSupportQuirk const):
1797         * page/Quirks.h:
1798
1799 2019-03-01  Zalan Bujtas  <zalan@apple.com>
1800
1801         [ContentChangeObserver] Rename members and move implementation to header.
1802         https://bugs.webkit.org/show_bug.cgi?id=195198
1803         <rdar://problem/48499967>
1804
1805         Reviewed by Simon Fraser.
1806
1807         * page/ios/ContentChangeObserver.cpp:
1808         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
1809         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
1810         (WebCore::ContentChangeObserver::startObservingStyleRecalc):
1811         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
1812         (WebCore::ContentChangeObserver::startObservingContentChanges):
1813         (WebCore::ContentChangeObserver::stopObservingContentChanges):
1814         (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
1815         (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
1816         (WebCore::ContentChangeObserver::startObservingStyleResolve): Deleted.
1817         (WebCore::ContentChangeObserver::stopObservingStyleResolve): Deleted.
1818         (WebCore::ContentChangeObserver::isObservingContentChanges): Deleted.
1819         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling): Deleted.
1820         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling): Deleted.
1821         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling): Deleted.
1822         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
1823         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
1824         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling): Deleted.
1825         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc): Deleted.
1826         (WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc): Deleted.
1827         (WebCore::ContentChangeObserver::countOfObservedDOMTimers): Deleted.
1828         (WebCore::ContentChangeObserver::clearObservedDOMTimers): Deleted.
1829         (WebCore::ContentChangeObserver::containsObservedDOMTimer): Deleted.
1830         * page/ios/ContentChangeObserver.h:
1831         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
1832         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
1833         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
1834         (WebCore::ContentChangeObserver::containsObservedDOMTimer const):
1835         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
1836         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
1837         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const):
1838         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
1839         (WebCore::ContentChangeObserver::shouldObserveStyleRecalc const):
1840         (WebCore::ContentChangeObserver::isObservingContentChanges const):
1841         (WebCore::ContentChangeObserver::countOfObservedDOMTimers const):
1842         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
1843
1844 2019-03-01  Zalan Bujtas  <zalan@apple.com>
1845
1846         [ContentChangeObserver] ContentChangeObserver::StyleChangeScope should not set WKContentVisibilityChange directly
1847         https://bugs.webkit.org/show_bug.cgi?id=195197
1848         <rdar://problem/48498332>
1849
1850         Reviewed by Simon Fraser.
1851
1852         Add didContentVisibilityChange to hide WKContentVisibilityChange value. We might also want to add some logic to didContentVisibilityChange at some point.
1853
1854         * page/ios/ContentChangeObserver.cpp:
1855         (WebCore::ContentChangeObserver::didContentVisibilityChange):
1856         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
1857         * page/ios/ContentChangeObserver.h:
1858
1859 2019-03-01  Jer Noble  <jer.noble@apple.com>
1860
1861         [EME] Make sure the hasSessionSemaphore is set even if HAVE(AVSTREAMSESSION) is false
1862         https://bugs.webkit.org/show_bug.cgi?id=195217
1863
1864         Reviewed by Eric Carlson.
1865
1866         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1867         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
1868
1869 2019-03-01  Justin Fan  <justin_fan@apple.com>
1870
1871         [Web GPU] 32-bit builds broken by attempt to disable WebGPU on 32-bit
1872         https://bugs.webkit.org/show_bug.cgi?id=195191
1873
1874         Rubber-stamped by Dean Jackson.
1875
1876         Dropping support for 32-bit entirely, so I'm intentionally leaving 32-bit broken.
1877
1878         * Configurations/FeatureDefines.xcconfig:
1879
1880 2019-02-28  Fujii Hironori  <Hironori.Fujii@sony.com>
1881
1882         HTTPSUpgradeList.db database should be opened in readonly mode
1883         https://bugs.webkit.org/show_bug.cgi?id=195194
1884         <rdar://problem/47103889>
1885
1886         Unreviewed build fix for curl.
1887
1888         * platform/network/curl/CookieJarDB.cpp:
1889         (WebCore::CookieJarDB::openDatabase): Removed the second arguemnt of SQLiteDatabase::open.
1890
1891 2019-02-28  Chris Dumez  <cdumez@apple.com>
1892
1893         Unreviewed Windows build fix after r242251.
1894
1895         * platform/win/SearchPopupMenuDB.cpp:
1896         (WebCore::SearchPopupMenuDB::openDatabase):
1897
1898 2019-02-28  Zalan Bujtas  <zalan@apple.com>
1899
1900         [ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
1901         https://bugs.webkit.org/show_bug.cgi?id=195143
1902         <rdar://problem/48462351>
1903
1904         Reviewed by Simon Fraser.
1905
1906         Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.
1907
1908         * page/DOMTimer.cpp:
1909         (WebCore::DOMTimer::removeById):
1910         * page/DOMWindow.cpp:
1911         (WebCore::DOMWindow::clearTimeout):
1912         * page/ios/ContentChangeObserver.cpp:
1913         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
1914         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
1915         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
1916         (WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
1917         * page/ios/ContentChangeObserver.h:
1918
1919 2019-02-28  Chris Dumez  <cdumez@apple.com>
1920
1921         HTTPSUpgradeList.db database should be opened in readonly mode
1922         https://bugs.webkit.org/show_bug.cgi?id=195194
1923         <rdar://problem/47103889>
1924
1925         Reviewed by Youenn Fablet.
1926
1927         Add parameter to SQLiteDatabase::open() to specific the open flags.
1928
1929         * Modules/webdatabase/Database.cpp:
1930         (WebCore::Database::performOpenAndVerify):
1931         * platform/sql/SQLiteDatabase.cpp:
1932         (WebCore::SQLiteDatabase::open):
1933         * platform/sql/SQLiteDatabase.h:
1934         * platform/sql/SQLiteFileSystem.cpp:
1935         * platform/sql/SQLiteFileSystem.h:
1936
1937 2019-02-28  Brady Eidson  <beidson@apple.com>
1938
1939         Followup to:
1940         Universal links from Google search results pages don't open the app
1941         https://bugs.webkit.org/show_bug.cgi?id=195126
1942
1943         Unreviewed.
1944
1945         * page/SecurityOrigin.cpp:
1946         (WebCore::originsMatch): Remove a bogus assertion (reasoning in bugzilla)
1947
1948 2019-02-28  Simon Fraser  <simon.fraser@apple.com>
1949
1950         [iOS] Dark flash when opening Google AMP pages
1951         https://bugs.webkit.org/show_bug.cgi?id=195193
1952         rdar://problem/48326442
1953
1954         Reviewed by Zalan Bujtas.
1955
1956         After the incremental compositing updates changes, it was possible for a change in the size
1957         of an overflow:hidden element to fail to update the "ancestor clipping layer" geometry on
1958         a composited descendant that is not a descendant in z-order. When Google search results
1959         create the <iframe> that contain AMP contents, we'd fail to update a zero-sized clipping layer,
1960         leaving the #222 background of an intermediate element visible.
1961
1962         Fix by setting a flag in RenderLayer::updateLayerPosition() (which is called in containing block order)
1963         that sets the "needs geometry update" dirty bit on containing-block-descendant layers. Currently
1964         this flag affects all descendants; in future, we might be able to clear it for grand-children.
1965
1966         Tests: compositing/geometry/ancestor-clip-change-interleaved-stacking-context.html
1967                compositing/geometry/ancestor-clip-change.html
1968
1969         * rendering/RenderLayer.cpp:
1970         (WebCore::RenderLayer::updateLayerPositions):
1971         (WebCore::RenderLayer::updateLayerPosition):
1972         * rendering/RenderLayer.h:
1973         * rendering/RenderLayerBacking.cpp:
1974         (WebCore::RenderLayerBacking::updateAfterLayout):
1975         * rendering/RenderLayerBacking.h:
1976
1977 2019-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
1978
1979         Use-after-move in RenderCombineText::combineTextIfNeeded()
1980         https://bugs.webkit.org/show_bug.cgi?id=195188
1981
1982         Reviewed by Zalan Bujtas.
1983
1984         r241288 uncovered an existing problem with our text-combine code. r242204 alleviated the
1985         symptom, but this patch fixes the source of the problem (and reverts r242204).
1986
1987         The code in RenderCombineText::combineTextIfNeeded() has a bit that’s like:
1988
1989         FontDescription bestFitDescription;
1990         while (...) {
1991             FontCascade compressedFont(WTFMove(bestFitDescription), ...);
1992             ...
1993         }
1994
1995         Clearly this is wrong.
1996
1997         Test: fast/text/text-combine-crash-2.html
1998
1999         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
2000         (WebCore::FontDescription::platformResolveGenericFamily):
2001         * rendering/RenderCombineText.cpp:
2002         (WebCore::RenderCombineText::combineTextIfNeeded):
2003
2004 2019-02-28  Zalan Bujtas  <zalan@apple.com>
2005
2006         [ContentChangeObserver] Introduce observer subclasses to scope content change observing.
2007         https://bugs.webkit.org/show_bug.cgi?id=195172
2008         <rdar://problem/48479259>
2009
2010         Reviewed by Simon Fraser.
2011
2012         Let's scope start/stopObserving call pairs.
2013
2014         * dom/Document.cpp:
2015         (WebCore::Document::updateStyleIfNeeded):
2016         * page/DOMTimer.cpp:
2017         (WebCore::DOMTimer::fired):
2018         * page/ios/ContentChangeObserver.cpp:
2019         (WebCore::ContentChangeObserver::StyleChangeObserver::StyleChangeObserver):
2020         (WebCore::ContentChangeObserver::StyleChangeObserver::~StyleChangeObserver):
2021         (WebCore::ContentChangeObserver::StyleRecalcObserver::StyleRecalcObserver):
2022         (WebCore::ContentChangeObserver::StyleRecalcObserver::~StyleRecalcObserver):
2023         (WebCore::ContentChangeObserver::DOMTimerObserver::DOMTimerObserver):
2024         (WebCore::ContentChangeObserver::DOMTimerObserver::~DOMTimerObserver):
2025         (WebCore::ContentChangeObserver::StyleChange::StyleChange): Deleted.
2026         (WebCore::ContentChangeObserver::StyleChange::~StyleChange): Deleted.
2027         * page/ios/ContentChangeObserver.h:
2028         * rendering/updating/RenderTreeUpdater.cpp:
2029         (WebCore::RenderTreeUpdater::updateElementRenderer):
2030
2031 2019-02-28  Antoine Quint  <graouts@apple.com>
2032
2033         Enable the Pointer Events runtime flag by default
2034         https://bugs.webkit.org/show_bug.cgi?id=195156
2035
2036         Reviewed by Dean Jackson.
2037
2038         * page/RuntimeEnabledFeatures.h:
2039
2040 2019-02-28  Zalan Bujtas  <zalan@apple.com>
2041
2042         [ContentChangeObserver] Make observed state reset explicit.
2043         https://bugs.webkit.org/show_bug.cgi?id=195185
2044         <rdar://problem/48488342>
2045
2046         Reviewed by Simon Fraser.
2047
2048         Use setObservedContentChange only for setting the observed change while observing.
2049
2050         * page/ios/ContentChangeObserver.cpp:
2051         (WebCore::ContentChangeObserver::startObservingContentChanges):
2052         (WebCore::ContentChangeObserver::resetObservedContentChange):
2053         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
2054         * page/ios/ContentChangeObserver.h:
2055
2056 2019-02-28  Commit Queue  <commit-queue@webkit.org>
2057
2058         Unreviewed, rolling out r242210.
2059         https://bugs.webkit.org/show_bug.cgi?id=195179
2060
2061         it broke hover menus on losaltosonline.com (Requested by zalan
2062         on #webkit).
2063
2064         Reverted changeset:
2065
2066         "[ContentChangeObserver] Move timer removal code from
2067         DOMWindow::clearTimeout to DOMTimer::removeById"
2068         https://bugs.webkit.org/show_bug.cgi?id=195143
2069         https://trac.webkit.org/changeset/242210
2070
2071 2019-02-28  Zalan Bujtas  <zalan@apple.com>
2072
2073         [ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
2074         https://bugs.webkit.org/show_bug.cgi?id=195143
2075         <rdar://problem/48462351>
2076
2077         Reviewed by Simon Fraser.
2078
2079         Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.
2080
2081         * page/DOMTimer.cpp:
2082         (WebCore::DOMTimer::removeById):
2083         * page/DOMWindow.cpp:
2084         (WebCore::DOMWindow::clearTimeout):
2085         * page/ios/ContentChangeObserver.cpp:
2086         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
2087         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
2088         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
2089         (WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
2090         * page/ios/ContentChangeObserver.h:
2091
2092 2019-02-28  Charles Vazac  <cvazac@akamai.com>
2093
2094         Fix Resource Timing buffer edge cases for WPT
2095         https://bugs.webkit.org/show_bug.cgi?id=193213
2096
2097         Reviewed by Youenn Fablet.
2098
2099         Test coverage by LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer*.html
2100
2101         * page/Performance.cpp:
2102         (WebCore::Performance::resourceTimingBufferFullTimerFired): Only dispatch the
2103         resourcetimingbufferfull event if the buffer is still full (as it may have been cleared or
2104         expanded). Also, avoid infinite loops if we aren't able to decrease the number of entries in
2105         the secondary buffer.
2106
2107 2019-02-28  Takashi Komori  <Takashi.Komori@sony.com>
2108
2109         [Curl] HTTP Body is missing with redirection.
2110         https://bugs.webkit.org/show_bug.cgi?id=191651
2111
2112         Reviewed by Don Olmstead.
2113
2114         Implement updateFromDelegatePreservingOldProperties for curl port.
2115
2116         Tests: http/tests/navigation/post-301-response.html
2117                http/tests/navigation/post-302-response.html
2118                http/tests/navigation/post-303-response.html
2119                http/tests/navigation/post-307-response.html
2120                http/tests/navigation/post-308-response.html
2121
2122         * platform/Curl.cmake:
2123         * platform/network/curl/ResourceRequest.h:
2124         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): Deleted.
2125         * platform/network/curl/ResourceRequestCurl.cpp: Added.
2126         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
2127
2128 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2129
2130         [CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
2131         https://bugs.webkit.org/show_bug.cgi?id=195159
2132
2133         Reviewed by Don Olmstead.
2134
2135         Use COORDINATED_GRAPHICS instead.
2136
2137         * platform/graphics/GraphicsContext3D.h:
2138         * platform/graphics/PlatformLayer.h:
2139         * platform/graphics/cairo/ImageBufferCairo.cpp:
2140         (WebCore::ImageBufferData::ImageBufferData):
2141         (WebCore::ImageBufferData::~ImageBufferData):
2142         * platform/graphics/cairo/ImageBufferDataCairo.h:
2143         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
2144         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
2145         * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp:
2146         (Nicosia::GC3DLayer::swapBuffersIfNeeded):
2147         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
2148         (WebCore::GraphicsContext3D::reshapeFBOs):
2149         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2150         (WebCore::GraphicsContext3D::prepareTexture):
2151         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
2152         (WebCore::GraphicsContext3D::reshapeFBOs):
2153         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
2154         (WebCore::GraphicsContext3D::GraphicsContext3D):
2155         (WebCore::GraphicsContext3D::~GraphicsContext3D):
2156         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
2157         (WebCore::TextureMapperGC3DPlatformLayer::TextureMapperGC3DPlatformLayer):
2158         (WebCore::TextureMapperGC3DPlatformLayer::~TextureMapperGC3DPlatformLayer):
2159         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
2160         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
2161         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
2162         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
2163         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
2164         * platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h:
2165         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2166         (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
2167         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
2168         (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
2169         * rendering/RenderLayerBacking.cpp:
2170         (WebCore::RenderLayerBacking::paintsIntoWindow const):
2171         * rendering/RenderLayerCompositor.cpp:
2172         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
2173
2174 2019-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
2175
2176         Locale names can be nullptr
2177         https://bugs.webkit.org/show_bug.cgi?id=195171
2178         <rdar://problem/48262376>
2179
2180         Reviewed by Dean Jackson.
2181
2182         Nullptr can't be used in keys to HashMaps, so take an early out in this case.
2183
2184         This is a partial revert of r241288.
2185
2186         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
2187         (WebCore::FontDescription::platformResolveGenericFamily):
2188
2189 2019-02-28  Justin Fan  <justin_fan@apple.com>
2190
2191         [Web GPU] Enable Web GPU only on 64-bit
2192         https://bugs.webkit.org/show_bug.cgi?id=195139
2193
2194         Because Metal is only supported on 64 bit apps.
2195
2196         Unreviewed build fix.
2197
2198         * Configurations/FeatureDefines.xcconfig:
2199
2200 2019-02-27  Zalan Bujtas  <zalan@apple.com>
2201
2202         [ContentChangeObserver] Move WKSetObservedContentChange logic to ContentChangeObserver class.
2203         https://bugs.webkit.org/show_bug.cgi?id=195128
2204         <rdar://problem/48456752>
2205
2206         Reviewed by Simon Fraser.
2207
2208         Move the final bits over to ContentChangeObserver and delete WKContentObservationInternal.h.
2209
2210         * WebCore.xcodeproj/project.pbxproj:
2211         * page/ios/ContentChangeObserver.mm:
2212         (WebCore::ContentChangeObserver::setObservedContentChange):
2213         * platform/ios/wak/WKContentObservation.cpp:
2214         (WKSetObservedContentChange):
2215         * platform/ios/wak/WKContentObservation.h:
2216         * platform/ios/wak/WKContentObservationInternal.h: Removed.
2217
2218 2019-02-27  Simon Fraser  <simon.fraser@apple.com>
2219
2220         Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
2221
2222         * dom/Document.cpp:
2223         (WebCore::Document::lastModified const):
2224         * html/FTPDirectoryDocument.cpp:
2225         (WebCore::processFileDateString):
2226         * mathml/MathMLElement.cpp:
2227         (WebCore::convertToPercentageIfNeeded):
2228         (WebCore::MathMLElement::collectStyleForPresentationAttribute):
2229         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2230         (WebCore::ResourceUsageOverlay::platformDraw):
2231         * page/linux/ResourceUsageOverlayLinux.cpp:
2232         (WebCore::cpuUsageString):
2233         (WebCore::gcTimerString):
2234         * platform/DateComponents.cpp:
2235         (WebCore::DateComponents::toStringForTime const):
2236         (WebCore::DateComponents::toString const):
2237         * platform/LocalizedStrings.cpp:
2238         (WebCore::localizedString):
2239         * platform/audio/HRTFElevation.cpp:
2240         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
2241         * platform/mock/MockRealtimeVideoSource.cpp:
2242         (WebCore::MockRealtimeVideoSource::drawText):
2243         * rendering/RenderLayerCompositor.cpp:
2244         (WebCore::RenderLayerCompositor::logLayerInfo):
2245         * rendering/RenderTheme.cpp:
2246         (WebCore::RenderTheme::formatMediaControlsTime const):
2247
2248 2019-02-27  Zalan Bujtas  <zalan@apple.com>
2249
2250         [ContentChangeObserver] Move _WKObservingContentChanges from global to ContentChangeObserver class
2251         https://bugs.webkit.org/show_bug.cgi?id=195091
2252         <rdar://problem/48427271>
2253
2254         Reviewed by Tim Horton.
2255
2256         * page/ios/ContentChangeObserver.h:
2257         * page/ios/ContentChangeObserver.mm:
2258         (WebCore::ContentChangeObserver::startObservingContentChanges):
2259         (WebCore::ContentChangeObserver::stopObservingContentChanges):
2260         (WebCore::ContentChangeObserver::isObservingContentChanges):
2261         * platform/ios/wak/WKContentObservation.cpp:
2262         (WKObservingContentChanges): Deleted.
2263         (WKStartObservingContentChanges): Deleted.
2264         (WKStopObservingContentChanges): Deleted.
2265         * platform/ios/wak/WKContentObservation.h:
2266         * platform/ios/wak/WKContentObservationInternal.h:
2267
2268 2019-02-27  Brady Eidson  <beidson@apple.com>
2269
2270         Universal links from Google search results pages don't open the app.
2271         <rdar://problem/46887179> and https://bugs.webkit.org/show_bug.cgi?id=195126
2272
2273         Reviewed by Geoffrey Garen.
2274
2275         Covered by new API tests.
2276
2277         * loader/DocumentLoader.cpp:
2278         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate const): Propagate the external URL policy from
2279           an iframe if it is from the same security origin as the main frame.
2280
2281 2019-02-27  Zalan Bujtas  <zalan@apple.com>
2282
2283         [ContentChangeObserver] Move DOMTimer schedule handling from global to ContentChangeObserver class
2284         https://bugs.webkit.org/show_bug.cgi?id=195090
2285         <rdar://problem/48426771>
2286
2287         Reviewed by Tim Horton.
2288
2289         Also remove some unused functions from WKContentObservationInternal.
2290
2291         * page/ios/ContentChangeObserver.h:
2292         * page/ios/ContentChangeObserver.mm:
2293         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
2294         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
2295         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling):
2296         * platform/ios/wak/WKContentObservation.cpp:
2297         (WKStartObservingDOMTimerScheduling): Deleted.
2298         (WKStopObservingDOMTimerScheduling): Deleted.
2299         (WKIsObservingDOMTimerScheduling): Deleted.
2300         * platform/ios/wak/WKContentObservation.h:
2301         * platform/ios/wak/WKContentObservationInternal.h:
2302
2303 2019-02-27  Zalan Bujtas  <zalan@apple.com>
2304
2305         [ContentChangeObserver] Move style recalc handling from global to ContentChangeObserver class
2306         https://bugs.webkit.org/show_bug.cgi?id=195087
2307
2308         Reviewed by Simon Fraser.
2309
2310         Add m_observingNextStyleRecalc/m_observingStyleRecalcScheduling to ContentChangeObserver and move the related code over from WK functions.
2311
2312         * page/ios/ContentChangeObserver.h:
2313         * page/ios/ContentChangeObserver.mm:
2314         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
2315         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
2316         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling):
2317         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
2318         (WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc):
2319         (WebCore::ContentChangeObserver::setObservedContentChange):
2320         * platform/ios/wak/WKContentObservation.cpp:
2321         (WKSetObservedContentChange):
2322         (WKStartObservingStyleRecalcScheduling): Deleted.
2323         (WKStopObservingStyleRecalcScheduling): Deleted.
2324         (WKIsObservingStyleRecalcScheduling): Deleted.
2325         (WKSetShouldObserveNextStyleRecalc): Deleted.
2326         (WKShouldObserveNextStyleRecalc): Deleted.
2327         * platform/ios/wak/WKContentObservation.h:
2328
2329 2019-02-27  Zalan Bujtas  <zalan@apple.com>
2330
2331         [ContentChangeObserver] Move DOM timer handling from global to ContentChangeObserver class
2332         https://bugs.webkit.org/show_bug.cgi?id=195070
2333         <rdar://problem/48417650>
2334
2335         Reviewed by Tim Horton.
2336
2337         Add DOM timer list to ContentChangeObserver and move the related code over from WK functions.
2338
2339         * page/ios/ContentChangeObserver.h:
2340         * page/ios/ContentChangeObserver.mm:
2341         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
2342         (WebCore::ContentChangeObserver::countOfObservedDOMTimers):
2343         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
2344         (WebCore::ContentChangeObserver::setObservedContentChange):
2345         (WebCore::ContentChangeObserver::containsObservedDOMTimer):
2346         (WebCore::ContentChangeObserver::addObservedDOMTimer):
2347         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
2348         * platform/ios/wak/WKContentObservation.cpp:
2349         (WKStartObservingDOMTimerScheduling):
2350         (WKSetObservedContentChange):
2351         (WebThreadGetObservedDOMTimers): Deleted.
2352         (WebThreadCountOfObservedDOMTimers): Deleted.
2353         (WebThreadClearObservedDOMTimers): Deleted.
2354         (WebThreadContainsObservedDOMTimer): Deleted.
2355         (WebThreadAddObservedDOMTimer): Deleted.
2356         (WebThreadRemoveObservedDOMTimer): Deleted.
2357         * platform/ios/wak/WKContentObservation.h:
2358
2359 2019-02-27  Justin Fan  <justin_fan@apple.com>
2360         Fix build errors after Web GPU buffer updates changed some IDL fields from unsigned long to unsigned long long.
2361
2362         Unreviewed build fix.
2363
2364         * Modules/webgpu/WebGPUBuffer.cpp:
2365         (WebCore::WebGPUBuffer::setSubData):
2366         * Modules/webgpu/WebGPUBuffer.h:
2367         * Modules/webgpu/WebGPUBufferBinding.h:
2368         * Modules/webgpu/WebGPURenderPassEncoder.idl:
2369         * platform/graphics/gpu/GPUBufferBinding.h:
2370         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
2371         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
2372
2373 2019-02-27  John Wilander  <wilander@apple.com>
2374
2375         Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::NetworkProcessProxy
2376         https://bugs.webkit.org/show_bug.cgi?id=195071
2377         <rdar://problem/48417690>
2378
2379         Reviewed by Alex Christensen and Brent Fulgham.
2380
2381         No new tests. This patch maintains functionality covered by plenty of layout
2382         tests under http/tests/resourceLoadStatistics/ and http/tests/storageAccess.
2383
2384         This patch adopts WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics
2385         and makes the necessary infrastructure changes to support that.
2386
2387         The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
2388         HashSets since we never used the counts for anything. This change simplified
2389         encoding and decoding for IPC and will eventually simplify encoding and
2390         decoding in loader/ResourceLoadStatistics.cpp when we obsolete statistics
2391         model version 14 and below.
2392
2393         The patch also makes WebCore::RegistrableDomain's String constructor private.
2394         A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
2395         is introduced to better signal to users that creating a registrable domain
2396         object with a string may create an object that doesn't match a registrable
2397         domain in a valid HTTP-family URL. This change (private String constructor)
2398         motivated a change in WebCore::AdClickAttribution where the Source and
2399         Destination structs now take a URL as parameter instead of a String.
2400
2401         Finally, this patch harmonizes parameter and variable naming, going from
2402         "origin" to "domain" and "mainFrame" to "topFrame."
2403
2404         * html/HTMLAnchorElement.cpp:
2405         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
2406         * html/HTMLMediaElement.cpp:
2407         (WebCore::HTMLMediaElement::mediaSessionTitle const):
2408         * loader/AdClickAttribution.h:
2409         (WebCore::AdClickAttribution::Source::Source):
2410         (WebCore::AdClickAttribution::Source::deletedValue):
2411         (WebCore::AdClickAttribution::Destination::Destination):
2412         (WebCore::AdClickAttribution::Destination::deletedValue):
2413         (WebCore::AdClickAttribution::decode):
2414         * loader/ResourceLoadObserver.cpp:
2415         (WebCore::ResourceLoadObserver::logSubresourceLoading):
2416         (WebCore::ResourceLoadObserver::logWebSocketLoading):
2417         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2418         (WebCore::ResourceLoadObserver::statisticsForURL):
2419         (WebCore::ResourceLoadObserver::statisticsForOrigin): Deleted.
2420         * loader/ResourceLoadObserver.h:
2421         * loader/ResourceLoadStatistics.cpp:
2422         (WebCore::encodeHashSet):
2423         (WebCore::ResourceLoadStatistics::encode const):
2424         (WebCore::decodeHashCountedSet):
2425         (WebCore::decodeHashSet):
2426         (WebCore::ResourceLoadStatistics::decode):
2427         (WebCore::appendHashSet):
2428         (WebCore::ResourceLoadStatistics::toString const):
2429         (WebCore::ResourceLoadStatistics::merge):
2430         (WebCore::encodeHashCountedSet): Deleted.
2431         (WebCore::encodeOriginHashSet): Deleted.
2432         (WebCore::decodeOriginHashSet): Deleted.
2433         (WebCore::appendHashCountedSet): Deleted.
2434         * loader/ResourceLoadStatistics.h:
2435         * platform/RegistrableDomain.h:
2436         (WebCore::RegistrableDomain::uncheckedCreateFromString):
2437         (WebCore::RegistrableDomain::RegistrableDomain):
2438         * testing/Internals.cpp:
2439         (WebCore::Internals::resourceLoadStatisticsForURL):
2440         (WebCore::Internals::resourceLoadStatisticsForOrigin): Deleted.
2441         * testing/Internals.h:
2442         * testing/Internals.idl:
2443
2444 2019-02-27  Justin Fan  <justin_fan@apple.com>
2445
2446         [Web GPU] Buffer updates part 2: setSubData, GPU/CPU synchronization
2447         https://bugs.webkit.org/show_bug.cgi?id=195077
2448         <rdar://problem/47805229>
2449
2450         Reviewed by Dean Jackson.
2451
2452         Implement GPUBuffer.setSubData and prevent the resolving of mapping promises if the buffer is scheduled to be 
2453         used on the GPU, and add handlers to resolve such promises after command buffer execution completes. In addition,
2454         update buffer sizes to u64 (unsigned long in C++) as per the updated Web GPU API.
2455
2456         Tests: webgpu/buffer-command-buffer-races.html
2457                webgpu/map-read-buffers.html
2458
2459         * Modules/webgpu/WebGPUBindGroup.h:
2460         (WebCore::WebGPUBindGroup::bindGroup const):
2461         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
2462         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Rename binding -> bufferBinding to reduce confusion.
2463         * Modules/webgpu/WebGPUBuffer.cpp: Small tweaks.
2464         (WebCore::WebGPUBuffer::setSubData):
2465         (WebCore::WebGPUBuffer::unmap): Correctly fail if buffer is destroyed.
2466         (WebCore::WebGPUBuffer::destroy):
2467         (WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback):
2468         * Modules/webgpu/WebGPUBuffer.h:
2469         (WebCore::WebGPUBuffer::buffer const): Returned buffer is no longer const so that it can be used in completed handler callbacks.
2470         * Modules/webgpu/WebGPUBuffer.idl: Enable setSubData.
2471         * Modules/webgpu/WebGPUCommandBuffer.cpp:
2472         (WebCore::WebGPUCommandBuffer::beginRenderPass):
2473         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
2474         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
2475         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
2476         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
2477         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
2478         * Sources.txt:
2479         * WebCore.xcodeproj/project.pbxproj:
2480         * platform/graphics/gpu/GPUBuffer.h:
2481         (WebCore::GPUBuffer::isTransferDst const): Added various state and flag getters.
2482         (WebCore::GPUBuffer::isVertex const):
2483         (WebCore::GPUBuffer::isUniform const):
2484         (WebCore::GPUBuffer::isStorage const):
2485         (WebCore::GPUBuffer::isReadOnly const):
2486         (WebCore::GPUBuffer::isMappable const):
2487         (WebCore::GPUBuffer::isMapWrite const):
2488         (WebCore::GPUBuffer::isMapRead const):
2489         (WebCore::GPUBuffer::isMapWriteable const):
2490         (WebCore::GPUBuffer::isMapReadable const):
2491         * platform/graphics/gpu/GPUBufferBinding.h:
2492         * platform/graphics/gpu/GPUCommandBuffer.h:
2493         (WebCore::GPUCommandBuffer::usedBuffers const):
2494         (WebCore::GPUCommandBuffer::useBuffer):
2495         * platform/graphics/gpu/GPUDevice.cpp:
2496         (WebCore::GPUDevice::tryCreateBuffer): Pass Ref of itself for Buffer to request the Queue later, if needed.
2497         (WebCore::GPUDevice::tryCreateBuffer const): Deleted.
2498         * platform/graphics/gpu/GPUDevice.h:
2499         * platform/graphics/gpu/GPUProgrammablePassEncoder.cpp: Retain the encoder's commandBuffer to reference its used resource buffers.
2500         (WebCore::GPUProgrammablePassEncoder::GPUProgrammablePassEncoder):
2501         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
2502         (WebCore::GPUProgrammablePassEncoder::commandBuffer const):
2503         * platform/graphics/gpu/GPURenderPassEncoder.h:
2504         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2505         (WebCore::GPUBuffer::validateBufferCreate): Move validation out of tryCreate.
2506         (WebCore::GPUBuffer::tryCreate): Create both shared and private buffers, depending on usage.
2507         (WebCore::GPUBuffer::GPUBuffer):
2508         (WebCore::GPUBuffer::~GPUBuffer): Call destroy instead of just unmap.
2509         (WebCore::GPUBuffer::state const):
2510         (WebCore::GPUBuffer::setSubData): Uses a cached collection of staging MTLBuffers to encode data copies to the implementation MTLBuffer.
2511         (WebCore::GPUBuffer::commandBufferCommitted): Register on the GPUBuffer that the provided MTLCommandBuffer uses it, and is about to be committed.
2512         (WebCore::GPUBuffer::commandBufferCompleted): MTLCommandBuffer's onCompletedHandler calls this.
2513         (WebCore::GPUBuffer::reuseSubDataBuffer): SetSubData's blit command buffers call this to return a staging buffer to the pool.
2514         (WebCore::GPUBuffer::registerMappingCallback):
2515         (WebCore::GPUBuffer::runMappingCallback):
2516         (WebCore::GPUBuffer::unmap):
2517         (WebCore::GPUBuffer::destroy):
2518         (WebCore::GPUBuffer::tryCreateSharedBuffer): Deleted.
2519         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
2520         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder):
2521         (WebCore::GPUProgrammablePassEncoder::setBindGroup):
2522         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
2523         (WebCore::GPUQueue::submit): Ensure submitted buffers are in the correct state, and add completed handlers for synchronization.
2524         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
2525         (WebCore::GPURenderPassEncoder::tryCreate):
2526         (WebCore::GPURenderPassEncoder::GPURenderPassEncoder): Retain the commandBuffer for later reference.
2527         (WebCore::GPURenderPassEncoder::setVertexBuffers): Mark vertex buffers as used before submission.
2528         (WebCore::GPURenderPassEncoder::create): Deleted.
2529
2530         Buffer size updates in the IDL:
2531         * Modules/webgpu/GPUBufferDescriptor.idl:
2532         * Modules/webgpu/WebGPUBuffer.idl:
2533         * Modules/webgpu/WebGPUBufferBinding.idl:
2534         * Modules/webgpu/WebGPUCommandBuffer.idl:
2535         * Modules/webgpu/WebGPURenderPassEncoder.idl:
2536         * Modules/webgpu/WebGPUVertexAttributeDescriptor.idl:
2537         * Modules/webgpu/WebGPUVertexInputDescriptor.idl:
2538
2539 2019-02-27  Youenn Fablet  <youenn@apple.com>
2540
2541         Remove LeetCode FetchRequest quirk
2542         https://bugs.webkit.org/show_bug.cgi?id=195100
2543
2544         Reviewed by Alex Christensen.
2545
2546         Covered by manual testing.
2547
2548         * Modules/fetch/FetchRequest.cpp:
2549         (WebCore::needsSignalQuirk):
2550
2551 2019-02-27  Chris Dumez  <cdumez@apple.com>
2552
2553         Unable to log into chase.com on iPad when DeviceMotionEvent API is disabled
2554         https://bugs.webkit.org/show_bug.cgi?id=195101
2555         <rdar://problem/48423023>
2556
2557         Reviewed by Geoffrey Garen.
2558
2559         Add site-specific quirk for chase.com on iOS where we fire a dummy DeviceMotionEvent if the page
2560         tries to register a "devicemotion" event listener and fails because the API is disabled. This is
2561         needed to unblock the site and proceed with the login flow.
2562
2563         Unfortunately, document()->settings().needsSiteSpecificQuirks() is false on iOS so I could not
2564         guard the quirk behind this flag.
2565
2566         * page/DOMWindow.cpp:
2567         (WebCore::DOMWindow::addEventListener):
2568         (WebCore::DOMWindow::failedToRegisterDeviceMotionEventListener):
2569         * page/DOMWindow.h:
2570
2571 2019-02-27  Antoine Quint  <graouts@apple.com>
2572
2573         Support Pointer Events on macOS
2574         https://bugs.webkit.org/show_bug.cgi?id=195008
2575         <rdar://problem/47454419>
2576
2577         Reviewed by Dean Jackson.
2578
2579         We now dispatch relevant pointer events as we prepare to dispatch mouse events. In most cases, this means we dispatch
2580         a pointer event of the same type, with "mouse" being substituted by "pointer", and with the same properties with the
2581         exception that if preventDefault() is called for a "pointerdown" event, the matching "mousedown" will not be dispatched,
2582         and the same behavior also extends to "pointerup".
2583
2584         Tests: pointerevents/mouse/over-enter-out-leave.html
2585                pointerevents/mouse/pointer-capture.html
2586                pointerevents/mouse/pointer-event-basic-properties.html
2587                pointerevents/mouse/pointer-events-before-mouse-events.html
2588                pointerevents/mouse/pointerdown-prevent-default.html
2589
2590         * Configurations/FeatureDefines.xcconfig:
2591         * dom/Document.cpp: All of the touch-action related members and functions should be iOS-specific since the touch-action
2592         property does not have any effect on macOS.
2593         (WebCore::Document::invalidateRenderingDependentRegions):
2594         (WebCore::Document::nodeWillBeRemoved):
2595         (WebCore::Document::updateTouchActionElements):
2596         * dom/Document.h:
2597         * dom/Element.cpp:
2598         (WebCore::Element::dispatchMouseEvent): Dispatch a pointer event matching the mouse event that is about to be dispatched.
2599         If preventDefault() is called in the event handler for either "pointerdown" or "pointerup", do not proceed with dispatching
2600         the mouse event.
2601         * dom/PointerEvent.cpp:
2602         (WebCore::pointerEventType):
2603         (WebCore::PointerEvent::create):
2604         * dom/PointerEvent.h:
2605         * page/EventHandler.cpp: Check both the pointer and mouse events to see if we need to dispatch "enter" and "leave" events.
2606         (WebCore::hierarchyHasCapturingEventListeners):
2607         (WebCore::EventHandler::updateMouseEventTargetNode):
2608         * page/PointerCaptureController.cpp: Fix a build error which only happened on macOS.
2609         (WebCore::PointerCaptureController::PointerCaptureController): Create the CapturingData for the unique mouse pointer.
2610         (WebCore::PointerCaptureController::hasPointerCapture): The code did not match the spec cited in the comment, only the
2611         pending target override needs to be considered to determine whether a given element has pointer capture enabled.
2612         (WebCore::PointerCaptureController::dispatchEvent): Dispatch the provided pointer event, accounting for pointer capture if
2613         it is set.
2614         * page/PointerLockController.cpp: Fix a build error which only happened on macOS.
2615         * style/StyleTreeResolver.cpp:
2616         (WebCore::Style::TreeResolver::resolveElement): Code related to touch-action is only relevant to iOS.
2617
2618 2019-02-27  Sihui Liu  <sihui_liu@apple.com>
2619
2620         Network Process is put to suspended when holding locked IndexedDB files
2621         https://bugs.webkit.org/show_bug.cgi?id=195024
2622         <rdar://problem/45194169>
2623
2624         Reviewed by Geoffrey Garen.
2625
2626         We found network process was suspended when IDBDatabase was being closed in the background database thread, 
2627         holding locks to its database file. To avoid starvation or deadlock, we need to keep network process alive by 
2628         taking background assertion in UI process until the closes are done and locks are released.
2629
2630         * Modules/indexeddb/server/IDBServer.cpp:
2631         (WebCore::IDBServer::IDBServer::create):
2632         (WebCore::IDBServer::IDBServer::IDBServer):
2633         (WebCore::IDBServer::IDBServer::createBackingStore):
2634         (WebCore::IDBServer::IDBServer::closeDatabase):
2635         (WebCore::IDBServer::IDBServer::didCloseDatabase):
2636         * Modules/indexeddb/server/IDBServer.h:
2637         (WebCore::IDBServer::IDBServer::create):
2638         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2639         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
2640         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
2641         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
2642         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
2643         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
2644         (WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose):
2645         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2646
2647 2019-02-26  Simon Fraser  <simon.fraser@apple.com>
2648
2649         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
2650         https://bugs.webkit.org/show_bug.cgi?id=194973
2651
2652         Reviewed by Antti Koivisto.
2653
2654         This patch cleans up how the scrolling tree responds to scrolls.
2655
2656         First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
2657         UI process scroll position.
2658
2659         On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
2660         bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
2661         update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
2662         updates related layers on this node (counter-scrolling layers etc), and then tells the
2663         scrolling tree, which recurses through descendant nodes so they can adjust their layer
2664         positions.
2665
2666         On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
2667         which does the above other than setting scrolledContentsLayer (since we're reacting to
2668         layer state changes, not producing them).
2669
2670         updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
2671         ScrollingTree does the tree walk so classes don't have to implement
2672         updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
2673         how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
2674         need to cross frame boundaries).
2675
2676         We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
2677         since the fixed state was computed with the "layout" scroll position, so we have to account
2678         for the scroll delta since the last committed position. It's possible we could improve this
2679         in future.
2680
2681         * page/scrolling/ScrollingTree.cpp:
2682         (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
2683         (WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
2684         (WebCore::ScrollingTree::notifyRelatedNodesRecursive):
2685         (WebCore::ScrollingTree::mainFrameLayoutViewport):
2686         (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): Deleted.
2687         * page/scrolling/ScrollingTree.h:
2688         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
2689         (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange): Deleted.
2690         * page/scrolling/ScrollingTreeFrameHostingNode.h:
2691         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2692         (WebCore::ScrollingTreeFrameScrollingNode::updateViewportForCurrentScrollPosition):
2693         (WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const):
2694         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2695         * page/scrolling/ScrollingTreeNode.cpp:
2696         (WebCore::ScrollingTreeNode::relatedNodeScrollPositionDidChange):
2697         (WebCore::ScrollingTreeNode::enclosingScrollingNodeIncludingSelf):
2698         * page/scrolling/ScrollingTreeNode.h:
2699         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2700         (WebCore::ScrollingTreeScrollingNode::minimumScrollPosition const):
2701         (WebCore::ScrollingTreeScrollingNode::scrollLimitReached const):
2702         (WebCore::ScrollingTreeScrollingNode::adjustedScrollPosition const):
2703         (WebCore::ScrollingTreeScrollingNode::scrollBy):
2704         (WebCore::ScrollingTreeScrollingNode::scrollTo):
2705         (WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged):
2706         (WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
2707         (WebCore::ScrollingTreeScrollingNode::localToContentsPoint const):
2708         (WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange): Deleted.
2709         (WebCore::ScrollingTreeScrollingNode::setScrollPosition): Deleted.
2710         * page/scrolling/ScrollingTreeScrollingNode.h:
2711         * page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
2712         (WebCore::ScrollingTreeScrollingNodeDelegate::currentScrollPosition const):
2713         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollPosition const): Deleted.
2714         * page/scrolling/ThreadedScrollingTree.cpp:
2715         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
2716         * page/scrolling/ThreadedScrollingTree.h:
2717         * page/scrolling/cocoa/ScrollingTreeFixedNode.h:
2718         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
2719         (WebCore::ScrollingTreeFixedNode::relatedNodeScrollPositionDidChange):
2720         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange): Deleted.
2721         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
2722         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
2723         (WebCore::ScrollingTreeStickyNode::relatedNodeScrollPositionDidChange):
2724         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange): Deleted.
2725         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2726         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2727         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
2728         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
2729         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
2730         (WebCore::ScrollingTreeFrameScrollingNodeMac::adjustedScrollPosition const):
2731         (WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
2732         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
2733         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
2734         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
2735         (WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea const):
2736         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
2737         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition): Deleted.
2738         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition): Deleted.
2739         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateLayersAfterViewportChange): Deleted.
2740         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
2741         (): Deleted.
2742         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2743         (WebCore::ScrollingTreeOverflowScrollingNodeMac::adjustedScrollPosition const):
2744         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
2745         (WebCore::ScrollingTreeOverflowScrollingNodeMac::~ScrollingTreeOverflowScrollingNodeMac): Deleted.
2746         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange): Deleted.
2747         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
2748         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition): Deleted.
2749         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition): Deleted.
2750         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterDelegatedScroll): Deleted.
2751         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
2752         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture):
2753         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
2754         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection):
2755         (WebCore::ScrollingTreeScrollingNodeDelegateMac::adjustScrollPositionToBoundsIfNecessary):
2756         (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const):
2757         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollOnAxis):
2758
2759 2019-02-22  Simon Fraser  <simon.fraser@apple.com>
2760
2761         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
2762         https://bugs.webkit.org/show_bug.cgi?id=194973
2763
2764         Reviewed by Antti Koivisto.
2765
2766         The "master" value for the scroll position of a ScrollingTreeScrollingNode is now its m_scrollPosition member;
2767         layout viewports and layer positions will be set from this. This allows scrollPosition() to no longer be virtual
2768         and require different code for each scrolling node subclass, and adds a choke point that we can use to update
2769         the layout viewport.
2770         
2771         We can remove m_probableMainThreadScrollPosition on ScrollingTreeFrameScrollingNodeMac because this was really just
2772         an alias for the scroll position.
2773
2774         Add some isRootNode() checks for things that should only affect the main frame.
2775
2776         * page/scrolling/ScrollingTree.h: Remove fixedPositionRect() which was unused, and is a per-frame thing so makes
2777         no sense here.
2778         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2779         (WebCore::ScrollingTreeFrameScrollingNode::didChangeScrollPosition):
2780         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2781         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewport const):
2782         (WebCore::ScrollingTreeFrameScrollingNode::setLayoutViewport):
2783         (WebCore::ScrollingTreeFrameScrollingNode::fixedPositionRect): Deleted.
2784         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2785         (WebCore::ScrollingTreeScrollingNode::setScrollPosition):
2786         (WebCore::ScrollingTreeScrollingNode::setScrollPositionInternal):
2787         (WebCore::ScrollingTreeScrollingNode::didChangeScrollPosition):
2788         * page/scrolling/ScrollingTreeScrollingNode.h:
2789         (WebCore::ScrollingTreeScrollingNode::scrollPosition const):
2790         * page/scrolling/ios/ScrollingTreeIOS.cpp:
2791         (WebCore::ScrollingTreeIOS::fixedPositionRect): Deleted.
2792         * page/scrolling/ios/ScrollingTreeIOS.h:
2793         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2794         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2795         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
2796         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
2797         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
2798         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
2799         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
2800         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
2801         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
2802         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2803         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
2804
2805 2019-02-27  Ulrich Pflueger  <up@nanocosmos.de>
2806
2807         [MSE] SourceBuffer sample time increment vs. last frame duration check is broken
2808         https://bugs.webkit.org/show_bug.cgi?id=194747
2809         <rdar://problem/48148469>
2810
2811         Reviewed by Jer Noble.
2812
2813         Prevent unintended frame drops by including last frame duration in discontinuity check. 
2814
2815         Test: media/media-source/media-source-append-variable-frame-lengths-with-matching-durations.html
2816
2817         * Modules/mediasource/SourceBuffer.cpp:
2818         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2819
2820 2019-02-27  Timothy Hatcher  <timothy@apple.com>
2821
2822         REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
2823         https://bugs.webkit.org/show_bug.cgi?id=195086
2824         rdar://problem/48419124
2825
2826         Reviewed by Tim Horton.
2827
2828         * platform/mac/ScrollAnimatorMac.mm:
2829         (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.
2830
2831 2019-02-26  Wenson Hsieh  <wenson_hsieh@apple.com>
2832
2833         Remove conditional compile guard for InsertIntoTextNodeCommand::doReapply
2834         https://bugs.webkit.org/show_bug.cgi?id=195067
2835         <rdar://problem/44812080>
2836
2837         Reviewed by Tim Horton.
2838
2839         This iOS-specific override was introduced to fix <rdar://problem/7114425>, in which the last typed character
2840         would be revealed when redoing text input on iOS inside a password field. The associated change fixed this bug
2841         by overriding doReapply on iOS to only insert text (instead of additionally handling password echo); however, it
2842         really makes sense to skip password echo when redoing on all platforms, so we can just remove the platform-
2843         specific guards around this logic.
2844
2845         Doing this allows us to add the `hasEditableStyle()` check on iOS when redoing text insertion, which results in
2846         a very subtle behavior change covered by the new layout test below.
2847
2848         Test: editing/undo/redo-text-insertion-in-non-editable-node.html
2849
2850         * editing/InsertIntoTextNodeCommand.cpp:
2851         (WebCore::InsertIntoTextNodeCommand::doReapply):
2852         * editing/InsertIntoTextNodeCommand.h:
2853
2854 2019-02-26  Keith Miller  <keith_miller@apple.com>
2855
2856         Code quality cleanup in NeverDestroyed
2857         https://bugs.webkit.org/show_bug.cgi?id=194824
2858
2859         Reviewed by Mark Lam.
2860
2861         name_names.pl should not just assume the layout of LazyNeverDestroyed.
2862
2863         * dom/make_names.pl:
2864         (printNamesCppFile):
2865
2866 2019-02-26  Zalan Bujtas  <zalan@apple.com>
2867
2868         Do not try to observe the timer when Page is nullptr
2869         https://bugs.webkit.org/show_bug.cgi?id=195076
2870
2871         Reviewed by Tim Horton.
2872
2873         Covered by fast/dom/Window/timer-null-script-execution-context.html.
2874
2875         * page/DOMTimer.cpp:
2876         (WebCore::DOMTimer::install):
2877
2878 2019-02-20  Jer Noble  <jer.noble@apple.com>
2879
2880         [Cocoa] Media elements will restart network buffering just before suspending
2881         https://bugs.webkit.org/show_bug.cgi?id=193691
2882
2883         Reviewed by Eric Carlson.
2884
2885         API Test: WebKit.ProcessSuspendMediaBuffering
2886
2887         Allow the Page to suspend all media buffering in its child Documents.
2888
2889         * dom/Document.cpp:
2890         (WebCore::Document::suspendAllMediaBuffering):
2891         (WebCore::Document::resumeAllMediaBuffering):
2892         * dom/Document.h:
2893         * html/MediaElementSession.cpp:
2894         (WebCore::MediaElementSession::dataBufferingPermitted const):
2895         (WebCore::MediaElementSession::suspendBuffering):
2896         (WebCore::MediaElementSession::resumeBuffering):
2897         (WebCore::MediaElementSession::bufferingSuspended const):
2898         * html/MediaElementSession.h:
2899         * page/Page.cpp:
2900         (WebCore::Page::suspendAllMediaBuffering):
2901         (WebCore::Page::resumeAllMediaBuffering):
2902         * page/Page.h:
2903         (WebCore::Page::mediaPlaybackIsSuspended const):
2904         (WebCore::Page::mediaBufferingIsSuspended const):
2905         (WebCore::Page::mediaPlaybackIsSuspended): Deleted.
2906         * platform/audio/PlatformMediaSession.h:
2907         (WebCore::PlatformMediaSession::suspendBuffering):
2908         (WebCore::PlatformMediaSession::resumeBuffering):
2909         * platform/audio/PlatformMediaSessionManager.cpp:
2910         (WebCore::PlatformMediaSessionManager::suspendAllMediaBufferingForDocument):
2911         (WebCore::PlatformMediaSessionManager::resumeAllMediaBufferingForDocument):
2912         * platform/audio/PlatformMediaSessionManager.h:
2913
2914 2019-02-26  Youenn Fablet  <youenn@apple.com>
2915
2916         Move service worker response validation from the service worker client to the service worker itself
2917         https://bugs.webkit.org/show_bug.cgi?id=194716
2918
2919         Reviewed by Geoffrey Garen.
2920
2921         Added response validation at service worker side.
2922
2923         No change of behavior except for now logging validation error messages in the console.
2924         Covered by rebased tests.
2925
2926         * workers/service/context/ServiceWorkerFetch.cpp:
2927         (WebCore::ServiceWorkerFetch::validateResponse):
2928         (WebCore::ServiceWorkerFetch::processResponse):
2929         (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
2930
2931 2019-02-26  Sihui Liu  <sihui_liu@apple.com>
2932
2933         [Mac WK2] storage/indexeddb/IDBObject-leak.html is flaky
2934         https://bugs.webkit.org/show_bug.cgi?id=195036
2935
2936         Reviewed by Geoffrey Garen.
2937
2938         When connection to IDBServer is lost, IDBDatabase in web process should not only stop active transactions, but 
2939         also transactions in committing process.
2940
2941         Also, TransactionOpration should clear its perform function when the operation is being completed, otherwise 
2942         there is a reference cycle of TransactionOpration.
2943
2944         Covered by existing tests storage/indexeddb/IDBObject-leak.html.
2945
2946         * Modules/indexeddb/IDBDatabase.cpp:
2947         (WebCore::IDBDatabase::connectionToServerLost): notify committing transasctions that connection is lost.
2948         * Modules/indexeddb/IDBTransaction.cpp:
2949         (WebCore::IDBTransaction::connectionClosedFromServer): notify IDBConnectionProxy that transaction ends.
2950         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2951         (WebCore::IDBClient::IDBConnectionProxy::forgetTransaction): clear finished transactions.
2952         * Modules/indexeddb/client/IDBConnectionProxy.h:
2953         * Modules/indexeddb/client/TransactionOperation.h:
2954         (WebCore::IDBClient::TransactionOperation::doComplete): clear perform function unconditionally when the 
2955         operation is in completion process. 
2956
2957 2019-02-26  Zalan Bujtas  <zalan@apple.com>
2958
2959         [ContentChangeObserver] clearContentChangeObservers should be internal to ContentChangeObserver class
2960         https://bugs.webkit.org/show_bug.cgi?id=195066
2961         <rdar://problem/48411682>
2962
2963         Reviewed by Tim Horton.
2964
2965         Now all the empty clearContentChangeObservers() implementations can be removed.
2966
2967         * dom/Document.cpp:
2968         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
2969         * loader/EmptyClients.h:
2970         * page/ChromeClient.h:
2971         * page/Frame.cpp:
2972         (WebCore::Frame::willDetachPage):
2973         * page/ios/ContentChangeObserver.h:
2974         * page/ios/ContentChangeObserver.mm:
2975         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
2976         (WebCore::ContentChangeObserver::didSuspendActiveDOMObjects): Might need to merge them.
2977         (WebCore::ContentChangeObserver::willDetachPage):
2978
2979 2019-02-26  Zalan Bujtas  <zalan@apple.com>
2980
2981         [ContentChangeObserver] Move style recalc schedule observation logic to ContentChangeObserver
2982         https://bugs.webkit.org/show_bug.cgi?id=195062
2983         <rdar://problem/48409258>
2984
2985         Reviewed by Tim Horton.
2986
2987         Also rename registerDOMTimerForContentObservationIfNeeded to be consistent with the did* naming style.
2988
2989         * dom/Document.cpp:
2990         (WebCore::Document::scheduleStyleRecalc):
2991         * page/DOMTimer.cpp:
2992         (WebCore::DOMTimer::install):
2993         * page/ios/ContentChangeObserver.h:
2994         * page/ios/ContentChangeObserver.mm:
2995         (WebCore::ContentChangeObserver::didInstallDOMTimer):
2996         (WebCore::ContentChangeObserver::didScheduleStyleRecalc):
2997         (WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded): Deleted.
2998
2999 2019-02-26  Chris Dumez  <cdumez@apple.com>
3000
3001         [iOS] Regression(PSON) Scroll position is no longer restored when navigating back to reddit.com
3002         https://bugs.webkit.org/show_bug.cgi?id=195054
3003         <rdar://problem/48330549>
3004
3005         Reviewed by Geoff Garen.
3006
3007         Add MaintainMemoryCache flag to indicate that the memory cache should not get purged.
3008
3009         * page/MemoryRelease.cpp:
3010         (WebCore::releaseNoncriticalMemory):
3011         (WebCore::releaseCriticalMemory):
3012         (WebCore::releaseMemory):
3013         * page/MemoryRelease.h:
3014
3015 2019-02-26  Commit Queue  <commit-queue@webkit.org>
3016
3017         Unreviewed, rolling out r241970.
3018         https://bugs.webkit.org/show_bug.cgi?id=195057
3019
3020         made the QuickLook.LegacyQuickLookContent API test flakey
3021         (Requested by estes on #webkit).
3022
3023         Reverted changeset:
3024
3025         "[iOS] Break a reference cycle between PreviewLoader and
3026         ResourceLoader"
3027         https://bugs.webkit.org/show_bug.cgi?id=194964
3028         https://trac.webkit.org/changeset/241970
3029
3030 2019-02-26  Zalan Bujtas  <zalan@apple.com>
3031
3032         [ContentChangeObserver] Simplify content observation API by removing explicit DOMTimer observation.
3033         https://bugs.webkit.org/show_bug.cgi?id=195023
3034         <rdar://problem/48381885>
3035
3036         Reviewed by Tim Horton.
3037
3038         In the future we might decide that certain activities don't require DOMTimer observation, but that should
3039         be internal to ContentChangeObserver.
3040
3041         * page/ios/ContentChangeObserver.h:
3042         * page/ios/ContentChangeObserver.mm:
3043         (WebCore::ContentChangeObserver::startObservingContentChanges):
3044         (WebCore::ContentChangeObserver::stopObservingContentChanges):
3045         * page/ios/EventHandlerIOS.mm:
3046         (WebCore::EventHandler::mouseMoved):
3047
3048 2019-02-26  Zalan Bujtas  <zalan@apple.com>
3049
3050         [ContentChangeObserver] Move observing logic from Document::updateStyleIfNeeded to ContentChangeObserver
3051         https://bugs.webkit.org/show_bug.cgi?id=195032
3052         <rdar://problem/48388063>
3053
3054         Reviewed by Tim Horton.
3055
3056         This might eventually turn into a regular start/stop content observing call.
3057
3058         * dom/Document.cpp:
3059         (WebCore::Document::updateStyleIfNeeded):
3060         * page/ios/ContentChangeObserver.h:
3061         * page/ios/ContentChangeObserver.mm:
3062         (WebCore::ContentChangeObserver::startObservingStyleResolve):
3063         (WebCore::ContentChangeObserver::stopObservingStyleResolve):
3064
3065 2019-02-26  Zalan Bujtas  <zalan@apple.com>
3066
3067         [ContentChangeObserver] Move CheckForVisibilityChange to ContentChangeObserver class
3068         https://bugs.webkit.org/show_bug.cgi?id=195035
3069         <rdar://problem/48389123>
3070
3071         Reviewed by Tim Horton.
3072
3073         Visibility checking logic belongs to ContentChangeObserver.
3074
3075         * page/ios/ContentChangeObserver.h:
3076         * page/ios/ContentChangeObserver.mm:
3077         (WebCore::elementImplicitVisibility):
3078         (WebCore::ContentChangeObserver::StyleChange::StyleChange):
3079         (WebCore::ContentChangeObserver::StyleChange::~StyleChange):
3080         * rendering/updating/RenderTreeUpdater.cpp:
3081         (WebCore::RenderTreeUpdater::updateElementRenderer):
3082         (WebCore::elementImplicitVisibility): Deleted.
3083         (WebCore::CheckForVisibilityChange::CheckForVisibilityChange): Deleted.
3084         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange): Deleted.
3085
3086 2019-02-26  Philippe Normand  <pnormand@igalia.com>
3087
3088         [EGL] Runtime support for RGB565 pixel layout
3089         https://bugs.webkit.org/show_bug.cgi?id=194817
3090
3091         Reviewed by Carlos Garcia Campos.
3092
3093         Currently our graphics pipeline always relies on a ARGB8888 (32
3094         bpp) pixel configuration. On some low-end (old) embedded platforms
3095         the graphics driver is sometimes optimized for 16 bpp
3096         configurations, such as RGB565. On those platforms the application
3097         can now set the WEBKIT_EGL_PIXEL_LAYOUT environment variable to
3098         "RGB565" to adjust to the best pixel configuration supported by
3099         the screen and graphics driver.
3100
3101         * platform/graphics/egl/GLContextEGL.cpp:
3102         (WebCore::GLContextEGL::getEGLConfig):
3103
3104 2019-02-26  Philippe Normand  <pnormand@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
3105
3106         [WPE] Add API for webview background color configuration
3107         https://bugs.webkit.org/show_bug.cgi?id=192305
3108
3109         Reviewed by Michael Catanzaro.
3110
3111         Adapt the FrameView API to allow a default non-white background color.
3112
3113         * page/Frame.cpp:
3114         (WebCore::Frame::createView): Replace isTransparent argument with a background color one.
3115         * page/Frame.h:
3116         * page/FrameView.cpp:
3117         (WebCore::FrameView::recalculateBaseBackgroundColor): Use Color::transparent if m_isTransparent is true.
3118         (WebCore::FrameView::updateBackgroundRecursively): Allow the fallback background color to be non-white, this is
3119         used only in non-dark-mode-css build configurations.
3120         * page/FrameView.h:
3121         * testing/Internals.cpp:
3122         (WebCore::Internals::setViewIsTransparent): Use Color::transparent if transparent is true.
3123
3124 2019-02-25  Yongjun Zhang  <yongjun_zhang@apple.com>
3125
3126         scalableNativeWebpageParameters() is not preserved on new page navigation.
3127         https://bugs.webkit.org/show_bug.cgi?id=194892
3128         <rdar://problem/47538280>
3129
3130         If a page's current default viewport configuration is scalableNativeWebpageParameters due to
3131         the fact that m_canIgnoreScalingConstraints is true, loading a new page should preserve this
3132         configuration until we derive the right values from viewport meta-tag.
3133
3134         Reviewed by Wenson Hsieh.
3135
3136         Test: fast/viewport/ios/viewport-shrink-to-fit-on-new-navigation.html
3137
3138         * page/ViewportConfiguration.cpp:
3139         (WebCore::ViewportConfiguration::canOverrideConfigurationParameters const): Use fixedNativeWebpageParameters().
3140         (WebCore::ViewportConfiguration::updateDefaultConfiguration): Use nativeWebpageParameters.
3141         (WebCore::ViewportConfiguration::nativeWebpageParameters): Return the appropriate default configuration
3142             based on m_canIgnoreScalingConstraints and shouldIgnoreMinimumEffectiveDeviceWidth().
3143         (WebCore::ViewportConfiguration::fixedNativeWebpageParameters): Renamed from nativeWebpageParameters()
3144         (WebCore::ViewportConfiguration::scalableNativeWebpageParameters): Use fixedNativeWebpageParameters.
3145         * page/ViewportConfiguration.h: Make nativeWebpageParameters() an instance method and change the old
3146             static method to fixedNativeWebpageParameters which better reflects the actual behavior.
3147
3148 2019-02-25  Zalan Bujtas  <zalan@apple.com>
3149
3150         [ContentChangeObserver] Move observing logic from DOMWindow::clearTimeout to ContentChangeObserver
3151         https://bugs.webkit.org/show_bug.cgi?id=194988
3152         <rdar://problem/48343040>
3153
3154         Reviewed by Tim Horton.
3155
3156         ContentChangeObserver::removeDOMTimer takes care of the canceled timer removal.
3157
3158         * page/DOMWindow.cpp:
3159         (WebCore::DOMWindow::clearTimeout):
3160         * page/ios/ContentChangeObserver.h:
3161         * page/ios/ContentChangeObserver.mm:
3162         (WebCore::ContentChangeObserver::startObservingDOMTimer):
3163         (WebCore::ContentChangeObserver::stopObservingDOMTimer):
3164         (WebCore::ContentChangeObserver::removeDOMTimer):
3165
3166 2019-02-25  Zalan Bujtas  <zalan@apple.com>
3167
3168         [ContentChangeObserver] Move observing logic from DOMTimer to ContentChangeObserver
3169         https://bugs.webkit.org/show_bug.cgi?id=194987
3170         <rdar://problem/48342910>
3171
3172         Reviewed by Tim Horton.
3173
3174         Content obvservation logic should all move to the ContentChangeObserver class.
3175
3176         * page/DOMTimer.cpp:
3177         (WebCore::DOMTimer::install):
3178         (WebCore::DOMTimer::fired):
3179         * page/Page.cpp:
3180         (WebCore::Page::Page):
3181         * page/Page.h:
3182         (WebCore::Page::contentChangeObserver):
3183         * page/ios/ContentChangeObserver.h:
3184         * page/ios/ContentChangeObserver.mm:
3185         (WebCore::ContentChangeObserver::ContentChangeObserver):
3186         (WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded):
3187         (WebCore::ContentChangeObserver::startObservingDOMTimer):
3188         (WebCore::ContentChangeObserver::stopObservingDOMTimer):
3189         (WebCore::ContentChangeObserver::containsObservedDOMTimer):
3190         (WebCore::ContentChangeObserver::addObservedDOMTimer):
3191         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
3192
3193 2019-02-25  John Wilander  <wilander@apple.com>
3194
3195         Introduce and adopt new class RegistrableDomain for eTLD+1
3196         https://bugs.webkit.org/show_bug.cgi?id=194791
3197         <rdar://problem/48179240>
3198
3199         Reviewed by Alex Christensen, Fujii Hironori, and Brent Fulgham.
3200
3201         A new API test was added. Plenty of existing layout tests under
3202         http/tests/resourceLoadStatistics/ and http/tests/storageAccess/ test the code.
3203
3204         This patch introduces and adopts a new class called WebCore::RegistrableDomain
3205         which represents a domain's eTLD+1 (effective top level domain plus one) and is
3206         the basis for the term "site," as in same-site. Other popular names include
3207         high-level domain, primary domain, and top privately controlled/owned domain.
3208         Effective top level domains are enumerated on the Public Suffix List
3209         (https://publicsuffix.org).
3210
3211         This class just uses the full domain for when the Public Suffix List cannot help
3212         finding the registrable domain and for WebKit ports that haven't enabled
3213         PUBLIC_SUFFIX_LIST. It also uses the string "nullOrigin" as a representation
3214         for the null or unique origin (this matches how these origins were handled
3215         before).
3216
3217         The implementation is a wrapper around a String and the functions and class
3218         members that now make use of this new class used to handle regular String
3219         objects which didn't help much in terms of type safety or guarantees that the
3220         string had already been converted to an eTLD+1.
3221
3222         We've at least two bad bugs in the Storage Access API because of confusion
3223         between a URL's eTLD+1 and its host. The usage of WebCore::RegistrableDomain
3224         will prohibit such bugs in the future.
3225
3226         Partitioning in WebKit also uses eTLD+1 to a large extent. I plan to adopt
3227         WebCore::RegistrableDomain for partitioning in a later patch.
3228
3229         This patch also enhances parameter naming by:
3230         - Removing parts that refer to "primary" as in primaryDomain.
3231         - Replacing references to "TopPrivatelyControlledDomain" with "RegistrableDomain."
3232         - Replacing references to "TopPrivatelyOwnedDomain" with "RegistrableDomain."
3233         - Using the term "domain" consistently instead of e.g. "host."
3234
3235         * WebCore.xcodeproj/project.pbxproj:
3236         * dom/Document.cpp:
3237         (WebCore::Document::hasRequestedPageSpecificStorageAccessWithUserInteraction):
3238         (WebCore::Document::setHasRequestedPageSpecificStorageAccessWithUserInteraction):
3239         * dom/Document.h:
3240         * html/HTMLAnchorElement.cpp:
3241         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
3242         * html/HTMLMediaElement.cpp:
3243         (WebCore::HTMLMediaElement::mediaSessionTitle const):
3244         * loader/AdClickAttribution.cpp:
3245         (WebCore::AdClickAttribution::url const):
3246         (WebCore::AdClickAttribution::referrer const):
3247         (WebCore::AdClickAttribution::toString const):
3248         * loader/AdClickAttribution.h:
3249         (WebCore::AdClickAttribution::Source::Source):
3250         (WebCore::AdClickAttribution::Source::matches const):
3251         (WebCore::AdClickAttribution::Source::deleteValue):
3252         (WebCore::AdClickAttribution::Destination::Destination):
3253         (WebCore::AdClickAttribution::Destination::matches const):
3254         (WebCore::AdClickAttribution::Destination::deleteValue):
3255         * loader/ResourceLoadObserver.cpp:
3256         (WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
3257         (WebCore::ResourceLoadObserver::setLogUserInteractionNotificationCallback):
3258         (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback):
3259         (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback):
3260         (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback):
3261         (WebCore::ResourceLoadObserver::logSubresourceLoading):
3262         (WebCore::ResourceLoadObserver::logWebSocketLoading):
3263         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3264         (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
3265         (WebCore::ResourceLoadObserver::logFontLoad):
3266         (WebCore::ResourceLoadObserver::logCanvasRead):
3267         (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
3268         (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
3269         (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
3270         (WebCore::ResourceLoadObserver::ensureResourceStatisticsForRegistrableDomain):
3271         (WebCore::ResourceLoadObserver::statisticsForOrigin):
3272         (WebCore::primaryDomain): Deleted.
3273         (WebCore::ResourceLoadObserver::ensureResourceStatisticsForPrimaryDomain): Deleted.
3274         * loader/ResourceLoadObserver.h:
3275         * loader/ResourceLoadStatistics.cpp:
3276         (WebCore::ResourceLoadStatistics::encode const):
3277         (WebCore::ResourceLoadStatistics::decode):
3278         (WebCore::ResourceLoadStatistics::toString const):
3279         (WebCore::ResourceLoadStatistics::merge):
3280         (WebCore::ResourceLoadStatistics::primaryDomain): Deleted.
3281         * loader/ResourceLoadStatistics.h:
3282         (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):
3283         * page/Page.cpp:
3284         (WebCore::Page::logNavigation):
3285         (WebCore::Page::mainFrameLoadStarted):
3286         * page/Page.h:
3287         * page/PerformanceMonitor.cpp:
3288         (WebCore::reportPageOverPostLoadResourceThreshold):
3289         * platform/RegistrableDomain.h: Added.
3290         (WebCore::RegistrableDomain::RegistrableDomain):
3291         (WebCore::RegistrableDomain::isEmpty const):
3292         (WebCore::RegistrableDomain::string const):
3293         (WebCore::RegistrableDomain::operator!= const):
3294         (WebCore::RegistrableDomain::operator== const):
3295         (WebCore::RegistrableDomain::matches const):
3296         (WebCore::RegistrableDomain::isolatedCopy const):
3297         (WebCore::RegistrableDomain::isHashTableDeletedValue const):
3298         (WebCore::RegistrableDomain::hash const):
3299         (WebCore::RegistrableDomain::RegistrableDomainHash::hash):
3300         (WebCore::RegistrableDomain::RegistrableDomainHash::equal):
3301         (WebCore::RegistrableDomain::encode const):
3302         (WebCore::RegistrableDomain::decode):
3303         * platform/network/NetworkStorageSession.cpp:
3304         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const):
3305         (WebCore::NetworkStorageSession::shouldBlockCookies const):
3306         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
3307         (WebCore::NetworkStorageSession::removePrevalentDomains):
3308         (WebCore::NetworkStorageSession::hasStorageAccess const):
3309         (WebCore::NetworkStorageSession::getAllStorageAccessEntries const):
3310         (WebCore::NetworkStorageSession::grantStorageAccess):
3311         (WebCore::getPartitioningDomain): Deleted.
3312         * platform/network/NetworkStorageSession.h:
3313
3314 2019-02-25  Chris Fleizach  <cfleizach@apple.com>
3315
3316         AX: <footer> HTML5 tag not reading as ARIA Landmark to VoiceOver
3317         https://bugs.webkit.org/show_bug.cgi?id=190138
3318         <rdar://problem/44907695>
3319
3320         Reviewed by Joanmarie Diggs.
3321
3322         Make sure that footer elements use the right role depending on their context.
3323         If scoped to body, they become contentinfo. Otherwise they are just delineated by
3324         a footer subrole.
3325
3326         * accessibility/AccessibilityObject.cpp:
3327         (WebCore::AccessibilityObject::isLandmark const):
3328         * accessibility/AccessibilityRenderObject.cpp:
3329         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
3330         (WebCore::AccessibilityRenderObject::isDescendantOfElementType const):
3331         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3332         * accessibility/AccessibilityRenderObject.h:
3333         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3334         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
3335         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3336         (-[WebAccessibilityObjectWrapper subrole]):
3337
3338 2019-02-25  Sihui Liu  <sihui_liu@apple.com>
3339
3340         IndexedDB: IDBDatabase and IDBTransaction are leaked in layout tests
3341         https://bugs.webkit.org/show_bug.cgi?id=194709
3342
3343         Reviewed by Geoffrey Garen.
3344
3345         When connection to IDB server is closed, IDBTransaction would abort without notifying IDBDatabase, so 
3346         IDBDatabase didn't clear its reference to IDBTransaction which created a reference cycle. 
3347  
3348         Also IDBTransaction didn't clear its reference to IDBRequest in this case and it led to another reference cycle
3349         between IDBOpenDBRequest and IDBTransaction.
3350
3351         Test: storage/indexeddb/IDBObject-leak.html
3352
3353         * Modules/indexeddb/IDBDatabase.cpp:
3354         (WebCore::IDBDatabase::connectionToServerLost):
3355         * Modules/indexeddb/IDBTransaction.cpp:
3356         (WebCore::IDBTransaction::IDBTransaction):
3357         (WebCore::IDBTransaction::~IDBTransaction):
3358         (WebCore::IDBTransaction::connectionClosedFromServer):
3359         * Modules/indexeddb/IDBTransaction.h:
3360         * testing/Internals.cpp:
3361         (WebCore::Internals::numberOfIDBTransactions const):
3362         * testing/Internals.h:
3363         * testing/Internals.idl:
3364
3365 2019-02-25  Zalan Bujtas  <zalan@apple.com>
3366
3367         Add missing stream parameter. Unreviewed.
3368
3369         * page/DOMTimer.cpp:
3370         (WebCore::DOMTimer::fired):
3371
3372 2019-02-25  Zalan Bujtas  <zalan@apple.com>
3373
3374         Unreviewed build fix after r242032.
3375
3376         * page/DOMTimer.cpp:
3377         (WebCore::DOMTimer::install):
3378
3379 2019-02-20  Darin Adler  <darin@apple.com>