Tables with vertical-lr writing-mode doesn't apply correctly vertical-align: baseline
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-11-22  Javier Fernandez  <jfernandez@igalia.com>
2
3         Tables with vertical-lr writing-mode doesn't apply correctly vertical-align: baseline
4         https://bugs.webkit.org/show_bug.cgi?id=191881
5
6         Reviewed by Manuel Rego Casasnovas.
7
8         We should use the font's descent value when wriring-mode flips line flow (vertical-lr).
9
10         This change also fixes bug 170175, since Flexbox use the same code to determine the first
11         line baseline of a flex item.
12
13         Test: fast/writing-mode/vertical-align-table-baseline-latin.html
14
15         * rendering/RenderBlockFlow.cpp:
16         (WebCore::RenderBlockFlow::firstLineBaseline const):
17
18 2018-11-21  Ryosuke Niwa  <rniwa@webkit.org>
19
20         Phantom focus/blur events fire on clicking between text input fields when listening with addEventListener
21         https://bugs.webkit.org/show_bug.cgi?id=179990
22
23         Reviewed by Tim Horton.
24
25         The bug was caused by TemporarySelectionChange which is used by TextIndicator::createWithRange
26         to set and restore the selection putting the focus on the newly mouse-down'ed input element
27         and restoring the focus back to the input element which originally had the focus immediately.
28
29         Fixed the bug by avoiding to set the focus since only selection highlights need to be updated here.
30         Also made TemporarySelectionOption an enum class.
31
32         Unfortunately, no new tests since force click testing is broken :( See <rdar://problem/31301721>.
33
34         * editing/Editor.cpp:
35         (WebCore::TemporarySelectionChange::TemporarySelectionChange):
36         (WebCore::TemporarySelectionChange::~TemporarySelectionChange):
37         (WebCore::TemporarySelectionChange::setSelection): Extracted. Fixed the bug by adding
38         FrameSelection::DoNotSetFocus to the option when TemporarySelectionOption::DoNotSetFocus is set.
39         * editing/Editor.h:
40         * page/DragController.cpp:
41         (WebCore::DragController::performDragOperation):
42         * page/TextIndicator.cpp:
43         (WebCore::TextIndicator::createWithRange): Set TemporarySelectionOption::DoNotSetFocus.
44
45 2018-11-21  Wenson Hsieh  <wenson_hsieh@apple.com>
46
47         [Cocoa] [WebKit2] Add support for replacing find-in-page text matches
48         https://bugs.webkit.org/show_bug.cgi?id=191786
49         <rdar://problem/45813871>
50
51         Reviewed by Ryosuke Niwa.
52
53         Add support for replacing Find-in-Page matches. See below for details. Covered by new layout tests as well as a
54         new API test.
55
56         Tests: editing/find/find-and-replace-adjacent-words.html
57                editing/find/find-and-replace-at-editing-boundary.html
58                editing/find/find-and-replace-basic.html
59                editing/find/find-and-replace-in-subframes.html
60                editing/find/find-and-replace-no-matches.html
61                editing/find/find-and-replace-noneditable-matches.html
62                editing/find/find-and-replace-replacement-text-input-events.html
63
64         API test: WebKit.FindAndReplace
65
66         * page/Page.cpp:
67         (WebCore::replaceRanges):
68         (WebCore::Page::replaceRangesWithText):
69
70         Add a helper that, given a list of Ranges, replaces each range with the given text. To do this, we first map
71         each Range to editing offsets within the topmost editable root for each Range. This results in a map of editable
72         root to list of editing offsets we need to replace. To apply the replacements, for each editable root in the
73         map, we iterate over each replacement range (i.e. an offset and length), set the current selection to contain
74         that replacement range, and use `Editor::replaceSelectionWithText`. To prevent prior text replacements from
75         clobbering the offsets of latter text replacement ranges, we also iterate backwards through text replacement
76         ranges when performing each replacement.
77
78         Likewise, we also apply text replacement to each editing container in backwards order: for nodes in the same
79         frame, we compare their position in the document, and for nodes in different frames, we instead compare their
80         frames in frame tree traversal order.
81
82         We map Ranges to editing offsets and back when performing text replacement because each text replacement may
83         split or merge text nodes, which causes adjacent Ranges to shrink or extend while replacing text. In an earlier
84         attempt to implement this, I simply iterated over each Range to replace and carried out text replacement for
85         each Range. This led to incorrect behavior in some cases, such as replacing adjacent matches. Thus, by computing
86         the set of text replacement offsets prior to replacing any text, we're able to target the correct ranges for
87         replacement.
88
89         (WebCore::Page::replaceSelectionWithText):
90
91         Add a helper method on Page to replace the current selection with some text. This simply calls out to
92         `Editor::replaceSelectionWithText`.
93
94         * page/Page.h:
95
96 2018-11-21  Andy Estes  <aestes@apple.com>
97
98         [Cocoa] Create a soft-linking file for PassKit
99         https://bugs.webkit.org/show_bug.cgi?id=191875
100         <rdar://problem/46203215>
101
102         Reviewed by Myles Maxfield.
103
104         * Modules/applepay/cocoa/PaymentContactCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead.
105         * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm: Ditto.
106         * SourcesCocoa.txt: Removed @no-unify from PaymentMerchantSessionCocoa.mm.
107         * WebCore.xcodeproj/project.pbxproj: Removed PaymentMerchantSessionCocoa.mm from the WebCore target.
108         * rendering/RenderThemeCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead.
109
110 2018-11-21  Zalan Bujtas  <zalan@apple.com>
111
112         [LFC] LayoutState should always be initialized with the initial containing block.
113         https://bugs.webkit.org/show_bug.cgi?id=191896
114
115         Reviewed by Antti Koivisto.
116
117         There should always be only one LayoutState per layout tree (it does not mean that layout always starts at the ICB).
118         The ICB is a special formatting context root because it does not have a parent formatting context. All the other formatting contexts
119         first need to be laid out (partially at least e.g margin) in their parent formatting context.
120         Having a non-null parent formatting context as root could lead to undefined behaviour.
121
122         * layout/LayoutFormattingState.cpp:
123         (WebCore::Layout::LayoutState::LayoutState):
124         (WebCore::Layout::LayoutState::initializeRoot): Deleted.
125         * layout/LayoutFormattingState.h:
126         * layout/Verification.cpp:
127         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
128         * page/FrameViewLayoutContext.cpp:
129         (WebCore::layoutUsingFormattingContext):
130
131 2018-11-21  Zalan Bujtas  <zalan@apple.com>
132
133         [LFC][IFC] Horizontal margins should be considered as non-breakable space
134         https://bugs.webkit.org/show_bug.cgi?id=191894
135
136         Reviewed by Antti Koivisto.
137
138         Like padding and border, horizontal margins also force run breaks and offset them.
139
140         Test: fast/inline/inline-content-with-margin-left-right.html
141
142         * layout/inlineformatting/InlineFormattingContext.cpp:
143         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
144
145 2018-11-20  Ryosuke Niwa  <rniwa@webkit.org>
146
147         Mutation observers doesn't get notified of character data mutation made by the parser
148         https://bugs.webkit.org/show_bug.cgi?id=191874
149
150         Reviewed by Antti Koivisto.
151
152         Fixed the bug that CharacterData::parserAppendData was never notifying MutationObserver.
153
154         Test: fast/dom/MutationObserver/observe-parser-character-data-change.html
155
156         * dom/CharacterData.cpp:
157         (WebCore::CharacterData::parserAppendData):
158
159 2018-11-21  Claudio Saavedra  <csaavedra@igalia.com>
160
161         [SOUP] Follow-up robustness improvements to the certificate decoder
162         https://bugs.webkit.org/show_bug.cgi?id=191892
163
164         Reviewed by Michael Catanzaro.
165
166         If at any point the certificate fails to be constructed from
167         the DER data, bail out. Likewise, if the certificate returned
168         is NULL, return false from the decoder to notify the failure
169         to decode it.
170
171         * platform/network/soup/CertificateInfo.h:
172         (WTF::Persistence::certificateFromCertificatesDataList):
173         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
174
175 2018-11-21  Zalan Bujtas  <zalan@apple.com>
176
177         [LFC][IFC] Border should be considered as non-breakable space
178         https://bugs.webkit.org/show_bug.cgi?id=191891
179
180         Reviewed by Antti Koivisto.
181
182         Like padding, border also forces run breaks and offsets them.
183
184         Test: fast/inline/inline-content-with-border-left-right.html
185
186         * layout/inlineformatting/InlineFormattingContext.cpp:
187         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
188
189 2018-11-21  Zalan Bujtas  <zalan@apple.com>
190
191         [LFC][IFC] Use contains and containsAll in InlineFormattingContext::splitInlineRunIfNeeded consistently
192         https://bugs.webkit.org/show_bug.cgi?id=191890
193
194         Rearrange the comment numbers to match the logic below.
195
196         Reviewed by Antti Koivisto.
197
198         * layout/inlineformatting/InlineFormattingContext.cpp:
199         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
200
201 2018-11-20  Dean Jackson  <dino@apple.com>
202
203         Move WebGPU platform code to platform/graphics/gpu
204         https://bugs.webkit.org/show_bug.cgi?id=191867
205         <rdar://problem/46190993>
206
207         Reviewed by Antoine Quint.
208
209         The underlying implementation of WebGPU doesn't need to live in
210         Modules, since it technically could be used by other parts of the system. It
211         makes more sense for it to be in platform/graphics/gpu.
212
213         Move...
214         - Modules/webgpu/GPU* -> platform/graphics/gpu
215         - Modules/webgpu/cocoa -> platform/graphics/gpu/cocoa
216         - platform/graphics/gpu/GPULegacy* -> platform/graphics/gpu/legacy/
217         - platform/graphics/gpu/cocoa/GPULegacy* -> platform/graphics/gpu/legacy/cocoa
218
219         * Sources.txt:
220         * SourcesCocoa.txt:
221         * WebCore.xcodeproj/project.pbxproj:
222         * platform/graphics/gpu/GPUCommandBuffer.h: Renamed from Source/WebCore/Modules/webgpu/GPUCommandBuffer.h.
223         * platform/graphics/gpu/GPUDevice.cpp: Renamed from Source/WebCore/Modules/webgpu/GPUDevice.cpp.
224         (WebCore::GPUDevice::createShaderModule const):
225         (WebCore::GPUDevice::createRenderPipeline const):
226         (WebCore::GPUDevice::createCommandBuffer):
227         (WebCore::GPUDevice::getQueue):
228         * platform/graphics/gpu/GPUDevice.h: Renamed from Source/WebCore/Modules/webgpu/GPUDevice.h.
229         (WebCore::GPUDevice::platformDevice const):
230         * platform/graphics/gpu/GPUPipelineDescriptorBase.h: Renamed from Source/WebCore/Modules/webgpu/GPUPipelineDescriptorBase.h.
231         * platform/graphics/gpu/GPUPipelineStageDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPUPipelineStageDescriptor.h.
232         * platform/graphics/gpu/GPUQueue.h: Renamed from Source/WebCore/Modules/webgpu/GPUQueue.h.
233         (WebCore::GPUQueue::platformQueue const):
234         * platform/graphics/gpu/GPURenderPipeline.h: Renamed from Source/WebCore/Modules/webgpu/GPURenderPipeline.h.
235         (WebCore::GPURenderPipeline::platformRenderPipeline const):
236         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPURenderPipelineDescriptor.h.
237         * platform/graphics/gpu/GPUShaderModule.h: Renamed from Source/WebCore/Modules/webgpu/GPUShaderModule.h.
238         (WebCore::GPUShaderModule::platformShaderModule const):
239         * platform/graphics/gpu/GPUShaderModuleDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPUShaderModuleDescriptor.h.
240         * platform/graphics/gpu/GPUSwapChain.h: Renamed from Source/WebCore/Modules/webgpu/GPUSwapChain.h.
241         (WebCore::GPUSwapChain::platformLayer const):
242         * platform/graphics/gpu/GPUTexture.h: Renamed from Source/WebCore/Modules/webgpu/GPUTexture.h.
243         * platform/graphics/gpu/GPUTextureFormatEnum.h: Renamed from Source/WebCore/Modules/webgpu/GPUTextureFormatEnum.h.
244         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUCommandBufferMetal.mm.
245         (WebCore::GPUCommandBuffer::create):
246         (WebCore::GPUCommandBuffer::GPUCommandBuffer):
247         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUDeviceMetal.mm.
248         (WebCore::GPUDevice::create):
249         (WebCore::GPUDevice::GPUDevice):
250         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUQueueMetal.mm.
251         (WebCore::GPUQueue::create):
252         (WebCore::GPUQueue::GPUQueue):
253         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPURenderPipelineMetal.mm.
254         (WebCore::setFunctionsForPipelineDescriptor):
255         (WebCore::GPURenderPipeline::create):
256         (WebCore::GPURenderPipeline::GPURenderPipeline):
257         * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUShaderModuleMetal.mm.
258         (WebCore::GPUShaderModule::create):
259         (WebCore::GPUShaderModule::GPUShaderModule):
260         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUSwapChainMetal.mm.
261         (WebCore::GPUSwapChain::create):
262         (WebCore::GPUSwapChain::GPUSwapChain):
263         (WebCore::GPUSwapChain::setDevice):
264         (WebCore::platformTextureFormatForGPUTextureFormat):
265         (WebCore::GPUSwapChain::setFormat):
266         (WebCore::GPUSwapChain::reshape):
267         (WebCore::GPUSwapChain::getNextTexture):
268         (WebCore::GPUSwapChain::present):
269         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUTextureMetal.mm.
270         (WebCore::GPUTexture::create):
271         (WebCore::GPUTexture::GPUTexture):
272         (WebCore::GPUTexture::createDefaultTextureView):
273         * platform/graphics/gpu/legacy/GPULegacyBuffer.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyBuffer.cpp.
274         (WebCore::GPULegacyBuffer::~GPULegacyBuffer):
275         (WebCore::GPULegacyBuffer::length const):
276         * platform/graphics/gpu/legacy/GPULegacyBuffer.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyBuffer.h.
277         (WebCore::GPULegacyBuffer::contents const):
278         (WebCore::GPULegacyBuffer::metal const):
279         * platform/graphics/gpu/legacy/GPULegacyCommandBuffer.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandBuffer.cpp.
280         (WebCore::GPULegacyCommandBuffer::~GPULegacyCommandBuffer):
281         * platform/graphics/gpu/legacy/GPULegacyCommandBuffer.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandBuffer.h.
282         (WebCore::GPULegacyCommandBuffer::metal const):
283         * platform/graphics/gpu/legacy/GPULegacyCommandQueue.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandQueue.cpp.
284         (WebCore::GPULegacyCommandQueue::~GPULegacyCommandQueue):
285         * platform/graphics/gpu/legacy/GPULegacyCommandQueue.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandQueue.h.
286         (WebCore::GPULegacyCommandQueue::metal const):
287         * platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputeCommandEncoder.cpp.
288         (WebCore::GPULegacyComputeCommandEncoder::~GPULegacyComputeCommandEncoder):
289         * platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputeCommandEncoder.h.
290         * platform/graphics/gpu/legacy/GPULegacyComputePipelineState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputePipelineState.cpp.
291         (WebCore::GPULegacyComputePipelineState::~GPULegacyComputePipelineState):
292         * platform/graphics/gpu/legacy/GPULegacyComputePipelineState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputePipelineState.h.
293         (WebCore::GPULegacyComputePipelineState::metal const):
294         * platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilDescriptor.cpp.
295         (WebCore::GPULegacyDepthStencilDescriptor::~GPULegacyDepthStencilDescriptor):
296         * platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilDescriptor.h.
297         (WebCore::GPULegacyDepthStencilDescriptor::metal const):
298         * platform/graphics/gpu/legacy/GPULegacyDepthStencilState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilState.cpp.
299         (WebCore::GPULegacyDepthStencilState::~GPULegacyDepthStencilState):
300         * platform/graphics/gpu/legacy/GPULegacyDepthStencilState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilState.h.
301         (WebCore::GPULegacyDepthStencilState::metal const):
302         * platform/graphics/gpu/legacy/GPULegacyDevice.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDevice.cpp.
303         (WebCore::GPULegacyDevice::~GPULegacyDevice):
304         * platform/graphics/gpu/legacy/GPULegacyDevice.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDevice.h.
305         (WebCore::GPULegacyDevice::layer const):
306         (WebCore::GPULegacyDevice::metal const):
307         (WebCore::GPULegacyDevice::markLayerComposited const):
308         * platform/graphics/gpu/legacy/GPULegacyDrawable.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDrawable.cpp.
309         (WebCore::GPULegacyDrawable::~GPULegacyDrawable):
310         * platform/graphics/gpu/legacy/GPULegacyDrawable.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDrawable.h.
311         * platform/graphics/gpu/legacy/GPULegacyEnums.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyEnums.h.
312         * platform/graphics/gpu/legacy/GPULegacyFunction.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyFunction.cpp.
313         (WebCore::GPULegacyFunction::~GPULegacyFunction):
314         * platform/graphics/gpu/legacy/GPULegacyFunction.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyFunction.h.
315         (WebCore::GPULegacyFunction::metal const):
316         * platform/graphics/gpu/legacy/GPULegacyLibrary.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyLibrary.cpp.
317         (WebCore::GPULegacyLibrary::~GPULegacyLibrary):
318         * platform/graphics/gpu/legacy/GPULegacyLibrary.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyLibrary.h.
319         (WebCore::GPULegacyLibrary::metal const):
320         * platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderCommandEncoder.cpp.
321         (WebCore::GPULegacyRenderCommandEncoder::~GPULegacyRenderCommandEncoder):
322         * platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderCommandEncoder.h.
323         * platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassAttachmentDescriptor.cpp.
324         (WebCore::GPULegacyRenderPassAttachmentDescriptor::~GPULegacyRenderPassAttachmentDescriptor):
325         * platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassAttachmentDescriptor.h.
326         * platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassColorAttachmentDescriptor.cpp.
327         (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::~GPULegacyRenderPassColorAttachmentDescriptor):
328         * platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassColorAttachmentDescriptor.h.
329         * platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDepthAttachmentDescriptor.cpp.
330         (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::~GPULegacyRenderPassDepthAttachmentDescriptor):
331         * platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDepthAttachmentDescriptor.h.
332         * platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDescriptor.cpp.
333         (WebCore::GPULegacyRenderPassDescriptor::~GPULegacyRenderPassDescriptor):
334         * platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDescriptor.h.
335         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineColorAttachmentDescriptor.cpp.
336         (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::~GPULegacyRenderPipelineColorAttachmentDescriptor):
337         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineColorAttachmentDescriptor.h.
338         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineDescriptor.cpp.
339         (WebCore::GPULegacyRenderPipelineDescriptor::~GPULegacyRenderPipelineDescriptor):
340         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineDescriptor.h.
341         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineState.cpp.
342         (WebCore::GPULegacyRenderPipelineState::~GPULegacyRenderPipelineState):
343         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineState.h.
344         * platform/graphics/gpu/legacy/GPULegacySize.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacySize.h.
345         * platform/graphics/gpu/legacy/GPULegacyTexture.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTexture.cpp.
346         (WebCore::GPULegacyTexture::~GPULegacyTexture):
347         * platform/graphics/gpu/legacy/GPULegacyTexture.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTexture.h.
348         * platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTextureDescriptor.cpp.
349         (WebCore::GPULegacyTextureDescriptor::~GPULegacyTextureDescriptor):
350         * platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTextureDescriptor.h.
351         * platform/graphics/gpu/legacy/cocoa/GPULegacyBufferMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyBufferMetal.mm.
352         (WebCore::GPULegacyBuffer::GPULegacyBuffer):
353         * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandBufferMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyCommandBufferMetal.mm.
354         (WebCore::GPULegacyCommandBuffer::GPULegacyCommandBuffer):
355         (WebCore::GPULegacyCommandBuffer::presentDrawable const):
356         (WebCore::GPULegacyCommandBuffer::commit const):
357         * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandQueueMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyCommandQueueMetal.mm.
358         (WebCore::GPULegacyCommandQueue::GPULegacyCommandQueue):
359         (WebCore::GPULegacyCommandQueue::label const):
360         (WebCore::GPULegacyCommandQueue::setLabel const):
361         * platform/graphics/gpu/legacy/cocoa/GPULegacyComputeCommandEncoderMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyComputeCommandEncoderMetal.mm.
362         (WebCore::MTLSizeMake):
363         (WebCore::GPULegacyComputeCommandEncoder::GPULegacyComputeCommandEncoder):
364         (WebCore::GPULegacyComputeCommandEncoder::setComputePipelineState const):
365         (WebCore::GPULegacyComputeCommandEncoder::setBuffer const):
366         (WebCore::GPULegacyComputeCommandEncoder::dispatch const):
367         (WebCore::GPULegacyComputeCommandEncoder::endEncoding const):
368         * platform/graphics/gpu/legacy/cocoa/GPULegacyComputePipelineStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyComputePipelineStateMetal.mm.
369         (WebCore::GPULegacyComputePipelineState::GPULegacyComputePipelineState):
370         * platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDepthStencilDescriptorMetal.mm.
371         (WebCore::GPULegacyDepthStencilDescriptor::GPULegacyDepthStencilDescriptor):
372         (WebCore::GPULegacyDepthStencilDescriptor::depthWriteEnabled const):
373         (WebCore::GPULegacyDepthStencilDescriptor::setDepthWriteEnabled const):
374         (WebCore::GPULegacyDepthStencilDescriptor::depthCompareFunction const):
375         (WebCore::GPULegacyDepthStencilDescriptor::setDepthCompareFunction const):
376         * platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDepthStencilStateMetal.mm.
377         (WebCore::GPULegacyDepthStencilState::GPULegacyDepthStencilState):
378         (WebCore::GPULegacyDepthStencilState::label const):
379         (WebCore::GPULegacyDepthStencilState::setLabel const):
380         * platform/graphics/gpu/legacy/cocoa/GPULegacyDeviceMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDeviceMetal.mm.
381         (WebCore::GPULegacyDevice::GPULegacyDevice):
382         (WebCore::GPULegacyDevice::disconnect):
383         (WebCore::GPULegacyDevice::reshape const):
384         (WebCore::GPULegacyDevice::platformLayer const):
385         (WebCore::GPULegacyDevice::operator! const):
386         * platform/graphics/gpu/legacy/cocoa/GPULegacyDrawableMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDrawableMetal.mm.
387         (WebCore::GPULegacyDrawable::GPULegacyDrawable):
388         (WebCore::GPULegacyDrawable::release):
389         (WebCore::GPULegacyDrawable::metal const):
390         (WebCore::GPULegacyDrawable::texture const):
391         * platform/graphics/gpu/legacy/cocoa/GPULegacyFunctionMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyFunctionMetal.mm.
392         (WebCore::GPULegacyFunction::GPULegacyFunction):
393         (WebCore::GPULegacyFunction::name const):
394         (WebCore::GPULegacyFunction::operator! const):
395         * platform/graphics/gpu/legacy/cocoa/GPULegacyLibraryMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyLibraryMetal.mm.
396         (WebCore::GPULegacyLibrary::GPULegacyLibrary):
397         (WebCore::GPULegacyLibrary::label const):
398         (WebCore::GPULegacyLibrary::setLabel const):
399         (WebCore::GPULegacyLibrary::functionNames const):
400         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderCommandEncoderMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderCommandEncoderMetal.mm.
401         (WebCore::GPULegacyRenderCommandEncoder::GPULegacyRenderCommandEncoder):
402         (WebCore::GPULegacyRenderCommandEncoder::setRenderPipelineState const):
403         (WebCore::GPULegacyRenderCommandEncoder::setDepthStencilState const):
404         (WebCore::GPULegacyRenderCommandEncoder::setVertexBuffer const):
405         (WebCore::GPULegacyRenderCommandEncoder::setFragmentBuffer const):
406         (WebCore::GPULegacyRenderCommandEncoder::drawPrimitives const):
407         (WebCore::GPULegacyRenderCommandEncoder::endEncoding const):
408         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassAttachmentDescriptorMetal.mm.
409         (WebCore::GPULegacyRenderPassAttachmentDescriptor::GPULegacyRenderPassAttachmentDescriptor):
410         (WebCore::GPULegacyRenderPassAttachmentDescriptor::loadAction const):
411         (WebCore::GPULegacyRenderPassAttachmentDescriptor::setLoadAction const):
412         (WebCore::GPULegacyRenderPassAttachmentDescriptor::storeAction const):
413         (WebCore::GPULegacyRenderPassAttachmentDescriptor::setStoreAction const):
414         (WebCore::GPULegacyRenderPassAttachmentDescriptor::setTexture const):
415         (WebCore::GPULegacyRenderPassAttachmentDescriptor::metal const):
416         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassColorAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassColorAttachmentDescriptorMetal.mm.
417         (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::GPULegacyRenderPassColorAttachmentDescriptor):
418         (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::clearColor const):
419         (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::setClearColor const):
420         (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::metal const):
421         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm.
422         (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::GPULegacyRenderPassDepthAttachmentDescriptor):
423         (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::clearDepth const):
424         (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::setClearDepth const):
425         (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::metal const):
426         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassDescriptorMetal.mm.
427         (WebCore::GPULegacyRenderPassDescriptor::GPULegacyRenderPassDescriptor):
428         (WebCore::GPULegacyRenderPassDescriptor::colorAttachments const):
429         (WebCore::GPULegacyRenderPassDescriptor::depthAttachment const):
430         (WebCore::GPULegacyRenderPassDescriptor::metal const):
431         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm.
432         (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::GPULegacyRenderPipelineColorAttachmentDescriptor):
433         (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::pixelFormat const):
434         (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::setPixelFormat const):
435         (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::metal const):
436         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineDescriptorMetal.mm.
437         (WebCore::GPULegacyRenderPipelineDescriptor::GPULegacyRenderPipelineDescriptor):
438         (WebCore::GPULegacyRenderPipelineDescriptor::depthAttachmentPixelFormat const):
439         (WebCore::GPULegacyRenderPipelineDescriptor::setDepthAttachmentPixelFormat const):
440         (WebCore::GPULegacyRenderPipelineDescriptor::setVertexFunction const):
441         (WebCore::GPULegacyRenderPipelineDescriptor::setFragmentFunction const):
442         (WebCore::GPULegacyRenderPipelineDescriptor::colorAttachments const):
443         (WebCore::GPULegacyRenderPipelineDescriptor::reset const):
444         (WebCore::GPULegacyRenderPipelineDescriptor::metal const):
445         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineStateMetal.mm.
446         (WebCore::GPULegacyRenderPipelineState::GPULegacyRenderPipelineState):
447         (WebCore::GPULegacyRenderPipelineState::label const):
448         (WebCore::GPULegacyRenderPipelineState::setLabel const):
449         (WebCore::GPULegacyRenderPipelineState::metal const):
450         * platform/graphics/gpu/legacy/cocoa/GPULegacyTextureDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyTextureDescriptorMetal.mm.
451         (WebCore::GPULegacyTextureDescriptor::GPULegacyTextureDescriptor):
452         (WebCore::GPULegacyTextureDescriptor::width const):
453         (WebCore::GPULegacyTextureDescriptor::setWidth const):
454         (WebCore::GPULegacyTextureDescriptor::height const):
455         (WebCore::GPULegacyTextureDescriptor::setHeight const):
456         (WebCore::GPULegacyTextureDescriptor::sampleCount const):
457         (WebCore::GPULegacyTextureDescriptor::setSampleCount const):
458         (WebCore::GPULegacyTextureDescriptor::textureType const):
459         (WebCore::GPULegacyTextureDescriptor::setTextureType const):
460         (WebCore::GPULegacyTextureDescriptor::storageMode const):
461         (WebCore::GPULegacyTextureDescriptor::setStorageMode const):
462         (WebCore::GPULegacyTextureDescriptor::usage const):
463         (WebCore::GPULegacyTextureDescriptor::setUsage const):
464         (WebCore::GPULegacyTextureDescriptor::metal const):
465         * platform/graphics/gpu/legacy/cocoa/GPULegacyTextureMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyTextureMetal.mm.
466         (WebCore::GPULegacyTexture::GPULegacyTexture):
467         (WebCore::GPULegacyTexture::width const):
468         (WebCore::GPULegacyTexture::height const):
469         (WebCore::GPULegacyTexture::metal const):
470
471 2018-11-21  Adrian Perez de Castro  <aperez@igalia.com>
472
473         [SOUP] Certificate decoder always returns GByteArray with zero size
474         https://bugs.webkit.org/show_bug.cgi?id=191888
475
476         Reviewed by Žan Doberšek.
477
478         No new tests needed.
479
480         * platform/network/soup/CertificateInfo.h:
481         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode): Add missing
482         call to g_byte_array_set_size() to make sure byteArray->len has the
483         correct value.
484
485 2018-11-21  Zalan Butjas  <zalan@apple.com>
486
487         [LFC][IFC] Take nonBreakableStart/End into use.
488         https://bugs.webkit.org/show_bug.cgi?id=191873
489
490         Reviewed by Antti Koivisto.
491
492         Offset the final inline runs with the nonBreakableStart/End values.
493         (This patch also fixes relative positioned run verification.)
494
495         Test: fast/inline/inline-content-with-padding-left-right.html
496
497         * layout/Verification.cpp:
498         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
499         * layout/inlineformatting/InlineFormattingContext.cpp:
500         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
501
502 2018-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
503
504         REGRESSION(r237845): [cairo] Hyperlink underscore layout issue
505         https://bugs.webkit.org/show_bug.cgi?id=191630
506
507         Reviewed by Michael Catanzaro.
508
509         Only flip Y in GlyphToPathTranslator for ports using CG.
510
511         * platform/graphics/FontCascade.cpp:
512         (WebCore::GlyphToPathTranslator::GlyphToPathTranslator):
513
514 2018-11-21  Alicia Boya García  <aboya@igalia.com>
515
516         [MSE][GStreamer] Refactor AppendPipeline deinitialization
517         https://bugs.webkit.org/show_bug.cgi?id=191759
518
519         Reviewed by Xabier Rodriguez-Calvar.
520
521         AppendPipeline currently has a method, clearPlayerPrivate(), that the
522         client code uses to deinitialize most of the AppendPipeline... just
523         before actually destructing it in the next line of code.
524
525         Since at that point there should not be alive RefPtr's pointing to the
526         AppendPipeline there is no need for this kind of pre-deinitialization
527         in this usage pattern. Instead, we can just rely on C++ destructors,
528         cleaning the code a bit and removing the potential for the question
529         "what if `clearPlayerPrivate() has been called before?`": it has not.
530
531         Assertions have been added to ensure that there is only one alive
532         RefPtr pointing to AppendPipeline, therefore guaranteeing its immediate
533         destruction.
534
535         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
536         (WebCore::AppendPipeline::~AppendPipeline):
537         (WebCore::AppendPipeline::deinitialize):
538         (WebCore::AppendPipeline::clearPlayerPrivate): Deleted.
539         * platform/graphics/gstreamer/mse/AppendPipeline.h:
540         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
541         (WebCore::MediaPlayerPrivateGStreamerMSE::~MediaPlayerPrivateGStreamerMSE):
542         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
543         (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
544
545 2018-11-20  Dean Jackson  <dino@apple.com>
546
547         Removing using namespace WebCore from WebLayer
548         https://bugs.webkit.org/show_bug.cgi?id=191870
549         <rdar://problem/46192206>
550
551         Rubber-stamped by Sam Weinig.
552
553         Remove "using namespace WebCore" from WebLayer.mm
554         because it will cause type clashes in unified source
555         builds.
556
557         * platform/graphics/mac/WebLayer.mm:
558         (-[WebLayer drawInContext:]):
559         (-[WebSimpleLayer setNeedsDisplay]):
560         (-[WebSimpleLayer setNeedsDisplayInRect:]):
561         (-[WebSimpleLayer display]):
562         (-[WebSimpleLayer drawInContext:]):
563
564 2018-11-20  Ryosuke Niwa  <rniwa@webkit.org>
565
566         Input element gains focus when a selectstart event listener on document prevents the default action
567         https://bugs.webkit.org/show_bug.cgi?id=191714
568         <rdar://problem/46174389>
569
570         Reviewed by Antti Koivisto.
571
572         The bug was caused by WebKit keep firing selectstart upon mousemove after the drag had already started
573         when preventDefault had been called in the previous firings of selectstart event. Because input element
574         has its own editable element and fires selectstart on the input element itself, which won't be prevented
575         by selectstart on docuemnt, this allowed the selection to be set inside the input element even though
576         the mouse cursor was simply passing over the input element after the drag had already started.
577
578         Fixed the bug by not firing selectstart if the default action had been prevented by the initial firing
579         of selectstart by setting m_mouseDownMayStartDrag to false. This also matches the behaviors of Chrome
580         and Firefox.
581
582         Test: fast/events/selectstart-prevent-default-should-not-focus-input.html
583
584         * page/EventHandler.cpp:
585         (WebCore::EventHandler::updateSelectionForMouseDownDispatchingSelectStart):
586         (WebCore::EventHandler::updateSelectionForMouseDrag):
587
588 2018-11-20  Christopher Reid  <chris.reid@sony.com>
589
590         Remove the need for LocalizedStringsWPE.cpp
591         https://bugs.webkit.org/show_bug.cgi?id=191854
592
593         Reviewed by Michael Catanzaro.
594
595         No change in behavior.
596
597         Consolidate "Search the Web" as the default search context menu text on non-COCOA ports.
598
599         GTK, WPE, and non-CF WIN all had the same default localizedString function
600         of String::fromUTF8. Move that to LocalizedString.cpp as the default implementation
601         for all ports not using CF.
602
603         * en.lproj/Localizable.strings:
604         * platform/LocalizedStrings.cpp:
605         * platform/gtk/LocalizedStringsGtk.cpp:
606         * platform/win/LocalizedStringsWin.cpp:
607         * platform/wpe/LocalizedStringsWPE.cpp: Removed.
608
609 2018-11-20  Zan Dobersek  <zdobersek@igalia.com>
610
611         Segfaults on https://terminalizer.com/
612         https://bugs.webkit.org/show_bug.cgi?id=191805
613
614         Reviewed by Michael Catanzaro.
615
616         In HarfBuzzFace, the CacheEntry's HashMap object that caches Unicode
617         codepoints and their corresponding glyph indices should allow zero
618         values as valid keys since zero is a valid Unicode codepoint.
619
620         This change enables properly caching zero codepoints, avoiding
621         repetitive additions to the HashMap cache that end up in a crash.
622
623         * platform/graphics/harfbuzz/HarfBuzzFace.h: Move the elongated
624         GlyphCache type alias to the public section of HarfBuzzFace class
625         declaration, making it reusable in the helper HarfBuzzFontData struct.
626         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
627
628 2018-11-20  Antti Koivisto  <antti@apple.com>
629
630         Update hover state in composed tree
631         https://bugs.webkit.org/show_bug.cgi?id=191860
632
633         Reviewed by Zalan Bujtas.
634
635         The code was already mostly switched over from render tree to composed tree.
636         This patch replaces the remaining common ancestor search code with a DOM based equivalent.
637
638         * dom/Document.cpp:
639         (WebCore::findNearestCommonComposedAncestor):
640         (WebCore::Document::updateHoverActiveState):
641         (WebCore::nearestCommonHoverAncestor): Deleted.
642         * rendering/RenderBlock.cpp:
643         (WebCore::RenderBlock::hoverAncestor const): Deleted.
644         * rendering/RenderBlock.h:
645         * rendering/RenderElement.cpp:
646         (WebCore::RenderElement::hoverAncestor const): Deleted.
647
648         No longer needed.
649
650         * rendering/RenderElement.h:
651
652 2018-11-20  Zalan Bujtas  <zalan@apple.com>
653
654         [LFC][IFC] Measure run with non-breakable start/end.
655         https://bugs.webkit.org/show_bug.cgi?id=191850
656
657         Reviewed by Antti Koivisto.
658
659         Line breaking needs to know the complete width of the run including padding etc.
660
661         * layout/Verification.cpp:
662         (WebCore::Layout::collectFlowBoxSubtree):
663         (WebCore::Layout::collectInlineBoxes):
664         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
665         * layout/inlineformatting/InlineFormattingContext.cpp:
666         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
667         * layout/inlineformatting/InlineFormattingContext.h:
668         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
669         (WebCore::Layout::InlineFormattingContext::Geometry::runWidth):
670         * layout/inlineformatting/InlineLineBreaker.cpp:
671         (WebCore::Layout::InlineLineBreaker::InlineLineBreaker):
672         (WebCore::Layout::InlineLineBreaker::runWidth const):
673         (WebCore::Layout::InlineLineBreaker::textWidth const):
674         * layout/inlineformatting/InlineLineBreaker.h:
675         * layout/inlineformatting/text/TextUtil.cpp:
676         (WebCore::Layout::TextUtil::hyphenPositionBefore):
677         (WebCore::Layout::TextUtil::width):
678         (WebCore::Layout::TextUtil::fixedPitchWidth):
679         (WebCore::Layout::TextUtil::TextUtil): Deleted.
680         (WebCore::Layout::TextUtil::width const): Deleted.
681         (WebCore::Layout::TextUtil::hyphenPositionBefore const): Deleted.
682         (WebCore::Layout::TextUtil::textWidth const): Deleted.
683         (WebCore::Layout::TextUtil::fixedPitchWidth const): Deleted.
684         * layout/inlineformatting/text/TextUtil.h:
685
686 2018-11-20  Zalan Bujtas  <zalan@apple.com>
687
688         [LFC][IFC] InlineFormattingContext::Line should hold the list of runs for the current line.
689         https://bugs.webkit.org/show_bug.cgi?id=191845
690
691         Reviewed by Antti Koivisto.
692
693         Collect the runs in InlineFormattingContext::Line and transfer them to InlineFormattingState during line closing.
694         (In the most common cases, this is only one extra vector::append() call.)
695
696         * layout/inlineformatting/InlineFormattingContext.cpp:
697         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
698         (WebCore::Layout::InlineFormattingContext::createFinalRuns const):
699         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
700         (WebCore::Layout::InlineFormattingContext::closeLine const):
701         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
702         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
703         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
704         (WebCore::Layout::InlineFormattingContext::splitInlineRunsIfNeeded const): Deleted.
705         * layout/inlineformatting/InlineFormattingContext.h:
706         (WebCore::Layout::InlineFormattingContext::Line::hasContent const):
707         (WebCore::Layout::InlineFormattingContext::Line::runs):
708         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
709         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
710         (WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities):
711         (WebCore::Layout::InlineFormattingContext::Geometry::alignRuns):
712         * layout/inlineformatting/Line.cpp:
713         (WebCore::Layout::InlineFormattingContext::Line::init):
714         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
715         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const):
716         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
717         (WebCore::Layout::InlineFormattingContext::Line::close):
718         (WebCore::Layout::InlineFormattingContext::Line::Line): Deleted.
719
720 2018-11-20  Zalan Butjas  <zalan@apple.com>
721
722         [LFC][IFC] Introduce InlineItem::nonBreakableStart/End
723         https://bugs.webkit.org/show_bug.cgi?id=191839
724
725         Reviewed by Antti Koivisto.
726
727         Non-breakable start/end marks margin/padding/border space (even when it does not directly come from the associated layout box)
728
729         <span style="padding: 5px"><span>nested content with padding parent</span</span>
730         <nested content with padding parent> <- inline run has 5px non-breakable start/end.
731
732         <span style="border: 5px solid green"><span style="padding-right: 10px; margin-right: 1px">1</span>2</span><span>    3</span>
733         <1> <- inline run has 5px non-breakable start and 11px non-breakable end.
734         <2> <- inline run has 0px non-breakable start and 5px non-breakable end.
735         <3> <- no non-breakable values.
736
737         This is what the runs look like (input to line breaking)
738         <     1           2     >
739         < > (whitespace)
740         <3>
741         The line breaking treats the paddding/border etc space as part of the run and as non-breaking opportunity.
742         With the given runs the first position where we can break the line is at the whitespace.
743
744         * layout/inlineformatting/InlineFormattingContext.cpp:
745         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
746         * layout/inlineformatting/InlineItem.h:
747         (WebCore::Layout::InlineItem::nonBreakableStart const):
748         (WebCore::Layout::InlineItem::nonBreakableEnd const):
749         (WebCore::Layout::InlineItem::addNonBreakableStart):
750         (WebCore::Layout::InlineItem::addNonBreakableEnd):
751
752 2018-11-20  Zalan Bujtas  <zalan@apple.com>
753
754         [LFC][IFC] Move detaching rules from InlineFormattingState to InlineItem
755         https://bugs.webkit.org/show_bug.cgi?id=191838
756
757         Reviewed by Antti Koivisto.
758
759         This is in preparation for adding more context to InlineItem. In addition to
760         detaching rules it will also hold non-breakable start/end information.
761
762         * layout/inlineformatting/InlineFormattingContext.cpp:
763         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
764         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
765         * layout/inlineformatting/InlineFormattingState.cpp:
766         (WebCore::Layout::InlineFormattingState::addDetachingRule): Deleted.
767         (WebCore::Layout::InlineFormattingState::detachingRules const): Deleted.
768         * layout/inlineformatting/InlineFormattingState.h:
769         (WebCore::Layout::InlineFormattingState::setDetachingRules): Deleted.
770         * layout/inlineformatting/InlineItem.h:
771         (WebCore::Layout::InlineItem::addDetachingRule):
772         (WebCore::Layout::InlineItem::detachingRules const):
773
774 2018-11-20  Zalan Bujjtas  <zalan@apple.com>
775
776         [LFC][IFC] InlineRunProvider::append() should just take const InlineItem&.
777         https://bugs.webkit.org/show_bug.cgi?id=191837
778
779         Reviewed by Antti Koivisto.
780
781         This allows us to remove the InlineFormattingState dependency as well.
782
783         * layout/inlineformatting/InlineFormattingContext.cpp:
784         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
785         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
786         * layout/inlineformatting/InlineRunProvider.cpp:
787         (WebCore::Layout::InlineRunProvider::InlineRunProvider):
788         (WebCore::Layout::InlineRunProvider::append):
789         * layout/inlineformatting/InlineRunProvider.h:
790
791 2018-11-20  Thibault Saunier  <tsaunier@igalia.com>
792
793         [GStreamer] Enhance debugging by making sure to print the pipeline in MediaPlayerPrivateGStreamer
794         https://bugs.webkit.org/show_bug.cgi?id=191586
795
796         Reviewed by Xabier Rodriguez-Calvar.
797
798         This is minor changes that do not require tests.
799
800         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
801         (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
802         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
803         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
804         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
805         (WebCore::MediaPlayerPrivateGStreamer::commitLoad):
806         (WebCore::MediaPlayerPrivateGStreamer::readyTimerFired):
807         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
808         (WebCore::MediaPlayerPrivateGStreamer::prepareToPlay):
809         (WebCore::MediaPlayerPrivateGStreamer::play):
810         (WebCore::MediaPlayerPrivateGStreamer::pause):
811         (WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const):
812         (WebCore::MediaPlayerPrivateGStreamer::seek):
813         (WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
814         (WebCore::MediaPlayerPrivateGStreamer::paused const):
815         (WebCore::MediaPlayerPrivateGStreamer::enableTrack):
816         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
817         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
818         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
819         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
820         (WebCore::MediaPlayerPrivateGStreamer::processBufferingStats):
821         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
822         (WebCore::MediaPlayerPrivateGStreamer::maxMediaTimeSeekable const):
823         (WebCore::MediaPlayerPrivateGStreamer::totalBytes const):
824         (WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback):
825         (WebCore::MediaPlayerPrivateGStreamer::downloadBufferFileCreatedCallback):
826         (WebCore::MediaPlayerPrivateGStreamer::sourceSetup):
827         (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
828         (WebCore::MediaPlayerPrivateGStreamer::updateStates):
829         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
830         (WebCore::MediaPlayerPrivateGStreamer::didEnd):
831         (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
832         (WebCore::MediaPlayerPrivateGStreamer::setPreload):
833         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
834
835 2018-11-20  Manuel Rego Casasnovas  <rego@igalia.com>
836
837         [css-grid] Consider scrollbars in populateGridPositionsForDirection()
838         https://bugs.webkit.org/show_bug.cgi?id=191656
839
840         Reviewed by Javier Fernandez.
841
842         We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(),
843         that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction)
844         but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction).
845
846         The patch modifies the method so it takes into account scrollbar size
847         in order to compute the position of the columns/rows depending on the direction and the writing mode.
848
849         Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html
850                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html
851                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html
852
853         * rendering/RenderGrid.cpp:
854         (WebCore::RenderGrid::populateGridPositionsForDirection):
855
856 2018-11-19  Ryosuke Niwa  <rniwa@webkit.org>
857
858         Click on node assigned to slot in button's shadow cause loss of button focus
859         https://bugs.webkit.org/show_bug.cgi?id=191694
860         <rdar://problem/46107920>
861
862         Reviewed by Wenson Hsieh.
863
864         Fixed the bug by traversing the parent in the composed tree when looking for an element to focus.
865
866         Test: fast/shadow-dom/focus-slot-parent.html
867
868         * page/EventHandler.cpp:
869         (WebCore::EventHandler::dispatchMouseEvent): Fixed the bug. Also use RefPtr instead of a raw pointer.
870
871 2018-11-19  Fujii Hironori  <Hironori.Fujii@sony.com>
872
873         REGRESSION(r238350) [curl] CertificateInfo.h: error: template specialization requires 'template<>'
874         https://bugs.webkit.org/show_bug.cgi?id=191849
875
876         Unreviewed build fix for clang-cl builds.
877
878         No new tests because there's no behaviour change.
879
880         * platform/network/curl/CertificateInfo.h:
881         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
882         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
883
884 2018-11-19  Basuke Suzuki  <basuke.suzuki@sony.com>
885
886         [Curl] Add API for CertificateInfo.
887         https://bugs.webkit.org/show_bug.cgi?id=191647
888
889         Reviewed by Alex Christensen.
890
891         Minor changes for WebKit API.
892
893         Tests: TestWebKitAPI/Tests/WebKit/curl/Certificates.cpp
894
895         * platform/network/curl/CertificateInfo.h:
896         * platform/network/curl/CertificateInfoCurl.cpp:
897         (WebCore::CertificateInfo::CertificateInfo):
898         (WebCore::CertificateInfo::makeCertificate):
899         * platform/network/curl/CurlSSLVerifier.cpp:
900         (WebCore::BIOHolder::asCertificate):
901
902 2018-11-19  Justin Fan  <justin_fan@apple.com>
903
904         [WebGPU] Begin implementing WebGPUTexture, WebGPUTextureView, and WebGPUTextureFormatEnum, and WebGPUSwapChain::configure upgrades
905         https://bugs.webkit.org/show_bug.cgi?id=191794
906
907         Reviewed by Dean Jackson.
908
909         Test: webgpu/textures-textureviews.html
910
911         Implement basic functionality for getting the next WebGPUTexture and TextureView from the WebGPURenderingContext
912         to use as a render destination for the next draw call. Also introduce WebGPUTextureFormatEnum and the ability to 
913         configure the context with a chosen texture format. 
914
915         * CMakeLists.txt:
916         * DerivedSources.make:
917         * Modules/webgpu/GPUSwapChain.h: Texture/Pixel format can now be set.
918         * Modules/webgpu/GPUTexture.h: Added. Interface to a MTLTexture.
919         * Modules/webgpu/GPUTextureFormatEnum.h: Added.
920         * Modules/webgpu/WebGPUDevice.cpp:
921         (WebCore::WebGPUDevice::createRenderPipeline const): Removed now-unnecessary enum class cast.
922         * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Rather than duplicate GPURenderPipelineDescriptor::PrimitiveTopology, alias to it.
923         * Modules/webgpu/WebGPUSwapChain.cpp:
924         (WebCore::WebGPUSwapChain::configure): Can now specify a specific texture format for the underlying CAMetalLayer.
925         (WebCore::WebGPUSwapChain::getNextTexture): Added. Request the next drawable texture.
926         * Modules/webgpu/WebGPUSwapChain.h: Expose getNextTexture().
927         * Modules/webgpu/WebGPUSwapChain.idl:
928         * Modules/webgpu/WebGPUTexture.cpp: Added. 
929         (WebCore::WebGPUTexture::create):
930         (WebCore::WebGPUTexture::WebGPUTexture):
931         (WebCore::WebGPUTexture::createDefaultTextureView):
932         * Modules/webgpu/WebGPUTexture.h: Added.
933         * Modules/webgpu/WebGPUTexture.idl: Added.
934         * Modules/webgpu/WebGPUTextureFormatEnum.h: Added. Type alias for GPUTextureFormatEnum.
935         * Modules/webgpu/WebGPUTextureFormatEnum.idl: Added. Used to represent any texture format used by WebGPU.
936         * Modules/webgpu/WebGPUTextureView.cpp: Added.
937         (WebCore::WebGPUTextureView::create):
938         (WebCore::WebGPUTextureView::WebGPUTextureView):
939         * Modules/webgpu/WebGPUTextureView.h: Added.
940         * Modules/webgpu/WebGPUTextureView.idl: Added.
941         * Modules/webgpu/cocoa/GPUSwapChainMetal.mm: 
942         (WebCore::GPUSwapChain::create):
943         (WebCore::GPUSwapChain::setFormat): Called by WebGPUSwapChain::configure().
944         (WebCore::GPUSwapChain::getNextTexture):
945         * Modules/webgpu/cocoa/GPUTextureFormatEnumMetal.mm: Added.
946         (WebCore::convertAndValidate): Convert the WebGPUTextureFormatEnum to a MTLPixelFormat.
947         * Modules/webgpu/cocoa/GPUTextureMetal.mm: Added.
948         (WebCore::GPUTexture::create):
949         (WebCore::GPUTexture::GPUTexture):
950         (WebCore::GPUTexture::createDefaultTextureView): Uses the pixelFormat of the original texture.
951         * Sources.txt:
952         * SourcesCocoa.txt:
953         * WebCore.xcodeproj/project.pbxproj:
954         * bindings/js/WebCoreBuiltinNames.h:
955
956 2018-11-19  Joseph Pecoraro  <pecoraro@apple.com>
957
958         Web Inspector: "Reload Web Inspector" button no longer partially works
959         https://bugs.webkit.org/show_bug.cgi?id=191773
960         <rdar://problem/46139932>
961
962         Reviewed by Devin Rousso.
963
964         * inspector/InspectorFrontendClient.h:
965         * inspector/InspectorFrontendHost.cpp:
966         (WebCore::InspectorFrontendHost::reopen):
967         * inspector/InspectorFrontendHost.h:
968         * inspector/InspectorFrontendHost.idl:
969         Provide a host call to reopen an inspector window to reload it.
970
971         * testing/Internals.cpp:
972         Stub implementation, this is not used in tests.
973
974 2018-11-19  Rob Buis  <rbuis@igalia.com>
975
976         Setting document.title should have no effect for non SVG/HTML documents
977         https://bugs.webkit.org/show_bug.cgi?id=191643
978
979         Reviewed by Chris Dumez.
980
981         Setting document.title should have no effect for non SVG/HTML documents,
982         see https://html.spec.whatwg.org/multipage/dom.html#document.title.
983
984         Behavior matches Firefox and Chrome.
985
986         Test: imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-not-in-html-svg.html
987
988         * dom/Document.cpp:
989         (WebCore::Document::setTitle):
990
991 2018-11-19  Wenson Hsieh  <wenson_hsieh@apple.com>
992
993         Dragging image with a border-image larger than the image element crashes
994         https://bugs.webkit.org/show_bug.cgi?id=191817
995         <rdar://problem/46159222>
996
997         Reviewed by Ryosuke Niwa.
998
999         When dragging an image element, if the image element has:
1000
1001         (1) box-sizing: border-box;
1002         (2) a border-image
1003         (3) a border-top-width that is at least as large as the height of the element and/or a border-left-width that is
1004             at least as large as the width of the element
1005
1006         ...then upon drag, we will fail to create a suitable drag image using the bounding box of the image element
1007         since the size is empty, thereby causing a crash. To fix this, we bail out of this bounding-rect-dependent
1008         codepath for generating a drag image in the case where the bounding rect is empty, and instead fall back to an
1009         icon representation for the drag image.
1010
1011         Test: fast/events/drag-image-with-border-image.html
1012
1013         * page/DragController.cpp:
1014         (WebCore::DragController::doImageDrag):
1015
1016 2018-11-18  Zan Dobersek  <zdobersek@igalia.com>
1017
1018         HarfBuzzFace::CacheEntry should use 32-bit values in its HashMap
1019         https://bugs.webkit.org/show_bug.cgi?id=191825
1020
1021         Reviewed by Michael Catanzaro.
1022
1023         The HashMap-based glyph cache contained in HarfBuzzFace::CacheEntry
1024         objects is used to map given Unicode codepoints to corresponding
1025         glyph indices (which occurs in the harfBuzzGetGlyph() function that's
1026         invoked by HarfBuzz).
1027
1028         The 16-bit unsigned integer as the map's value type is not enough here
1029         when the glyph index mapping is done through Freetype -- its API returns
1030         32-bit glyph indices, and Cairo assigns this value to the 64-bit
1031         unsigned index variable in the cairo_glyph_t struct. The value type is
1032         thus bumped to 32 bits to match the unsigned type size of the index's
1033         origin.
1034
1035         * platform/graphics/harfbuzz/HarfBuzzFace.h:
1036         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
1037
1038 2018-11-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1039
1040         [iOS] Remove all usages of UIItemProvider, UIItemProviderReading, and related classes
1041         https://bugs.webkit.org/show_bug.cgi?id=191819
1042
1043         Reviewed by Dan Bernstein.
1044
1045         Replace UIItemProvider (and related classes) with NSItemProvider.
1046
1047         * platform/ios/PlatformPasteboardIOS.mm:
1048         (WebCore::registerItemToPasteboard):
1049         * platform/ios/WebItemProviderPasteboard.h:
1050         * platform/ios/WebItemProviderPasteboard.mm:
1051         (-[WebItemProviderDataRegistrar registerItemProvider:]):
1052         (-[WebItemProviderWritableObjectRegistrar initWithObject:]):
1053         (-[WebItemProviderWritableObjectRegistrar representingObject]):
1054         (-[WebItemProviderWritableObjectRegistrar registerItemProvider:]):
1055         (-[WebItemProviderRegistrationInfoList addRepresentingObject:]):
1056         (-[WebItemProviderRegistrationInfoList itemProvider]):
1057         (-[WebItemProviderPasteboard pasteboardTypes]):
1058         (-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]):
1059         (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
1060         (allLoadableClasses):
1061         (classForTypeIdentifier):
1062         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
1063         (-[WebItemProviderPasteboard numberOfFiles]):
1064         (-[WebItemProviderPasteboard itemProviderAtIndex:]):
1065         (-[WebItemProviderPasteboard enumerateItemProvidersWithBlock:]):
1066         * platform/mac/DragDataMac.mm:
1067         (WebCore::DragData::containsURL const):
1068
1069 2018-11-17  Ross Kirsling  <ross.kirsling@sony.com>
1070
1071         Remove superfluous LayoutUnit initializations
1072         https://bugs.webkit.org/show_bug.cgi?id=191791
1073
1074         Reviewed by Simon Fraser.
1075
1076         First step toward making LayoutUnit constructors explicit:
1077         eliminate `= 0` when constructing LayoutUnit lvalues.
1078
1079         * editing/Editor.cpp:
1080         (WebCore::Editor::firstRectForRange const):
1081         * editing/FrameSelection.cpp:
1082         (WebCore::FrameSelection::modify):
1083         (WebCore::FrameSelection::lineDirectionPointForBlockDirectionNavigation):
1084         * html/shadow/SliderThumbElement.cpp:
1085         (WebCore::RenderSliderContainer::computeLogicalHeight const):
1086         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1087         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
1088         * page/FrameView.cpp:
1089         (WebCore::FrameView::forceLayoutForPagination):
1090         * page/SpatialNavigation.cpp:
1091         (WebCore::scrollInDirection):
1092         (WebCore::distanceDataForNode):
1093         * rendering/AutoTableLayout.cpp:
1094         (WebCore::AutoTableLayout::layout):
1095         * rendering/GridTrackSizingAlgorithm.cpp:
1096         (WebCore::marginIntrinsicLogicalWidthForChild):
1097         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
1098         * rendering/InlineFlowBox.cpp:
1099         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
1100         (WebCore::InlineFlowBox::paintFillLayer):
1101         (WebCore::InlineFlowBox::paintBoxDecorations):
1102         (WebCore::InlineFlowBox::paintMask):
1103         (WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
1104         (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):
1105         * rendering/RenderBlock.cpp:
1106         (WebCore::RenderBlock::marginIntrinsicLogicalWidthForChild const):
1107         (WebCore::RenderBlock::layoutPositionedObject):
1108         (WebCore::RenderBlock::selectionGapRectsForRepaint):
1109         (WebCore::RenderBlock::paintSelection):
1110         (WebCore::RenderBlock::textIndentOffset const):
1111         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
1112         * rendering/RenderBlockFlow.cpp:
1113         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
1114         (WebCore::RenderBlockFlow::layoutBlock):
1115         (WebCore::RenderBlockFlow::layoutBlockChildren):
1116         (WebCore::RenderBlockFlow::marginValuesForChild const):
1117         (WebCore::RenderBlockFlow::estimateLogicalTopPosition):
1118         (WebCore::RenderBlockFlow::applyBeforeBreak):
1119         (WebCore::RenderBlockFlow::applyAfterBreak):
1120         (WebCore::RenderBlockFlow::adjustBlockChildForPagination):
1121         (WebCore::RenderBlockFlow::clearFloats):
1122         (WebCore::RenderBlockFlow::lowestFloatLogicalBottom const):
1123         (WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom const):
1124         (WebCore::RenderBlockFlow::addOverhangingFloats):
1125         (WebCore::RenderBlockFlow::getClearDelta):
1126         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
1127         * rendering/RenderBlockLineLayout.cpp:
1128         (WebCore::setLogicalWidthForTextRun):
1129         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
1130         (WebCore::RenderBlockFlow::determineStartPosition):
1131         * rendering/RenderBox.cpp:
1132         (WebCore::RenderBox::fillAvailableMeasure const):
1133         (WebCore::RenderBox::computeIntrinsicLogicalWidthUsing const):
1134         (WebCore::RenderBox::computeLogicalWidthInFragmentUsing const):
1135         (WebCore::RenderBox::computePercentageLogicalHeight const):
1136         (WebCore::RenderBox::computeReplacedLogicalWidthUsing const):
1137         (WebCore::RenderBox::computePositionedLogicalWidthUsing const):
1138         (WebCore::RenderBox::computePositionedLogicalHeightUsing const):
1139         (WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
1140         (WebCore::RenderBox::computePositionedLogicalHeightReplaced const):
1141         * rendering/RenderBoxModelObject.cpp:
1142         (WebCore::RenderBoxModelObject::computedCSSPadding const):
1143         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry const):
1144         * rendering/RenderDeprecatedFlexibleBox.cpp:
1145         (WebCore::marginWidthForChild):
1146         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
1147         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
1148         * rendering/RenderFileUploadControl.cpp:
1149         (WebCore::RenderFileUploadControl::paintObject):
1150         * rendering/RenderFragmentedFlow.cpp:
1151         (WebCore::RenderFragmentedFlow::validateFragments):
1152         (WebCore::RenderFragmentedFlow::adjustedPositionRelativeToOffsetParent const):
1153         (WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect):
1154         * rendering/RenderFrameSet.cpp:
1155         (WebCore::RenderFrameSet::paint):
1156         * rendering/RenderListItem.cpp:
1157         (WebCore::RenderListItem::positionListMarker):
1158         * rendering/RenderListMarker.cpp:
1159         (WebCore::RenderListMarker::computePreferredLogicalWidths):
1160         (WebCore::RenderListMarker::updateMargins):
1161         * rendering/RenderMultiColumnSet.cpp:
1162         (WebCore::RenderMultiColumnSet::initialBlockOffsetForPainting const):
1163         * rendering/RenderRubyRun.cpp:
1164         (WebCore::RenderRubyRun::layoutBlock):
1165         * rendering/RenderTable.cpp:
1166         (WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
1167         (WebCore::RenderTable::layout):
1168         (WebCore::RenderTable::offsetWidthForColumn const):
1169         (WebCore::RenderTable::offsetHeightForColumn const):
1170         (WebCore::RenderTable::outerBorderBefore const):
1171         (WebCore::RenderTable::outerBorderAfter const):
1172         (WebCore::RenderTable::outerBorderStart const):
1173         (WebCore::RenderTable::outerBorderEnd const):
1174         * rendering/RenderTableCell.cpp:
1175         (WebCore::RenderTableCell::logicalWidthFromColumns const):
1176         (WebCore::RenderTableCell::computeIntrinsicPadding):
1177         * rendering/RenderTableSection.cpp:
1178         (WebCore::RenderTableSection::calcRowLogicalHeight):
1179         (WebCore::RenderTableSection::distributeExtraLogicalHeightToPercentRows):
1180         (WebCore::RenderTableSection::distributeExtraLogicalHeightToAutoRows):
1181         (WebCore::RenderTableSection::distributeRemainingExtraLogicalHeight):
1182         (WebCore::RenderTableSection::layoutRows):
1183         (WebCore::RenderTableSection::calcOuterBorderBefore const):
1184         (WebCore::RenderTableSection::calcOuterBorderAfter const):
1185         (WebCore::RenderTableSection::calcOuterBorderStart const):
1186         (WebCore::RenderTableSection::calcOuterBorderEnd const):
1187         * rendering/RootInlineBox.cpp:
1188         (WebCore::RootInlineBox::alignBoxesInBlockDirection):
1189         (WebCore::RootInlineBox::beforeAnnotationsAdjustment const):
1190         (WebCore::RootInlineBox::lineSnapAdjustment const):
1191         (WebCore::RootInlineBox::verticalPositionForBox):
1192         * rendering/line/BreakingContext.h:
1193         (WebCore::inlineLogicalWidth):
1194         * rendering/mathml/RenderMathMLBlock.cpp:
1195         (WebCore::RenderMathMLBlock::layoutItems):
1196         * rendering/mathml/RenderMathMLFraction.cpp:
1197         (WebCore::RenderMathMLFraction::layoutBlock):
1198         * rendering/mathml/RenderMathMLOperator.cpp:
1199         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
1200         * rendering/mathml/RenderMathMLRoot.cpp:
1201         (WebCore::RenderMathMLRoot::computePreferredLogicalWidths):
1202         (WebCore::RenderMathMLRoot::paint):
1203         * rendering/mathml/RenderMathMLRow.cpp:
1204         (WebCore::RenderMathMLRow::computePreferredLogicalWidths):
1205         * rendering/mathml/RenderMathMLScripts.cpp:
1206         (WebCore::RenderMathMLScripts::layoutBlock):
1207         * rendering/mathml/RenderMathMLUnderOver.cpp:
1208         (WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren):
1209         (WebCore::RenderMathMLUnderOver::layoutBlock):
1210         * rendering/style/RenderStyle.cpp:
1211         (WebCore::RenderStyle::getShadowInsetExtent const):
1212         * rendering/svg/RenderSVGText.cpp:
1213         (WebCore::RenderSVGText::layout):
1214
1215 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
1216
1217         Avoid triggering compositing updates when only the root layer is composited
1218         https://bugs.webkit.org/show_bug.cgi?id=191813
1219
1220         Reviewed by Zalan Bujtas.
1221
1222         If we know that the only composited layer is the root, we can avoid triggering deep
1223         compositing updates sometimes, for example when layout changes size or position,
1224         or when z-order lists change.
1225
1226         * rendering/RenderLayer.cpp:
1227         (WebCore::RenderLayer::addChild):
1228         (WebCore::RenderLayer::removeChild):
1229         (WebCore::RenderLayer::updateLayerPosition):
1230         (WebCore::RenderLayer::scrollTo):
1231         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
1232         (WebCore::outputPaintOrderTreeRecursive):
1233         * rendering/RenderLayerCompositor.cpp:
1234         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): Consult the layer.hasCompositingDescendant()
1235         flag to cut off descendants traversal when possible.
1236         (WebCore::RenderLayerCompositor::layerStyleChanged):
1237
1238 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
1239
1240         Fix an error in 238354 - !=, not ==.
1241         
1242         Fixes test failures.
1243
1244         * rendering/RenderLayerCompositor.cpp:
1245         (WebCore::RenderLayerCompositor::layerBecameNonComposited):
1246
1247 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
1248
1249         Clarify RenderLayerCompositor::hasAnyAdditionalCompositedLayers() and related code.
1250         https://bugs.webkit.org/show_bug.cgi?id=191810
1251
1252         Reviewed by Zalan Bujtas.
1253
1254         Rename m_compositedLayerCount to m_contentLayersCount and have it track layers other
1255         than the RenderView's layer.
1256
1257         hasAnyAdditionalCompositedLayers() is really about whether we can drop out of compositing
1258         because no content layer is composited, and overlays don't require compositing, so
1259         rename it.
1260
1261         * rendering/RenderLayerCompositor.cpp:
1262         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1263         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1264         (WebCore::RenderLayerCompositor::needsCompositingForContentOrOverlays const):
1265         (WebCore::RenderLayerCompositor::layerBecameComposited):
1266         (WebCore::RenderLayerCompositor::layerBecameNonComposited):
1267         (WebCore::RenderLayerCompositor::layerTreeAsText):
1268         (WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers const): Deleted.
1269         * rendering/RenderLayerCompositor.h:
1270
1271 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
1272
1273         Rename RenderLayerCompositor::inCompositingMode() to usesCompositing()
1274         https://bugs.webkit.org/show_bug.cgi?id=191808
1275
1276         Reviewed by Zalan Bujtas.
1277
1278         Other code uses "usesCompositing" so standardize on that (future changes will make
1279         "compositing mode" more ambiguous). Also remove a FrameView function that only
1280         had one caller.
1281
1282         * page/FrameView.cpp:
1283         (WebCore::FrameView::clearBackingStores):
1284         (WebCore::FrameView::handleDeferredScrollbarsUpdateAfterDirectionChange):
1285         (WebCore::FrameView::delegatesScrollingDidChange):
1286         (WebCore::FrameView::hasCompositedContent const): Deleted.
1287         * page/FrameView.h:
1288         * rendering/RenderLayer.cpp:
1289         (WebCore::RenderLayer::addChild):
1290         (WebCore::RenderLayer::removeChild):
1291         (WebCore::RenderLayer::rebuildZOrderLists):
1292         (WebCore::RenderLayer::updateLayerPosition):
1293         (WebCore::RenderLayer::scrollTo):
1294         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
1295         * rendering/RenderLayerCompositor.cpp:
1296         (WebCore::RenderLayerCompositor::updateCompositingPolicy):
1297         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1298         (WebCore::RenderLayerCompositor::layerStyleChanged):
1299         (WebCore::RenderLayerCompositor::updateBacking):
1300         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
1301         (WebCore::RenderLayerCompositor::setIsInWindow):
1302         (WebCore::RenderLayerCompositor::needsToBeComposited const):
1303         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
1304         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
1305         (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
1306         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
1307         * rendering/RenderLayerCompositor.h:
1308         * rendering/RenderView.cpp:
1309         (WebCore::RenderView::repaintViewAndCompositedLayers):
1310         (WebCore::RenderView::usesCompositing const):
1311
1312 2018-11-17  Devin Rousso  <drousso@apple.com>
1313
1314         Web Inspector: Network: add button to show system certificate dialog
1315         https://bugs.webkit.org/show_bug.cgi?id=191458
1316         <rdar://problem/45977019>
1317
1318         Reviewed by Joseph Pecoraro.
1319
1320         Test: http/tests/inspector/network/getSerializedCertificate.html
1321
1322         * inspector/agents/InspectorNetworkAgent.h:
1323         * inspector/agents/InspectorNetworkAgent.cpp:
1324         (WebCore::InspectorNetworkAgent::getSerializedCertificate): Added.
1325
1326         * inspector/InspectorFrontendHost.idl:
1327         * inspector/InspectorFrontendHost.h:
1328         * inspector/InspectorFrontendHost.cpp:
1329         (WebCore::InspectorFrontendHost::supportsShowCertificate): Added.
1330         (WebCore::InspectorFrontendHost::showCertificate): Added.
1331         * inspector/InspectorFrontendClient.h:
1332         (InspectorFrontendClient::showCertificate): Added.
1333         * testing/Internals.cpp:
1334         (InspectorStubFrontend::showCertificate): Added.
1335
1336         * platform/network/cf/CertificateInfo.h:
1337         (WTF::Persistence::encodeCFData): Added.
1338         (WTF::Persistence::decodeCFData): Added.
1339         (WTF::Persistence::encodeSecTrustRef): Added.
1340         (WTF::Persistence::decodeSecTrustRef): Added.
1341         (WTF::Persistence::encodeCertificateChain): Added.
1342         (WTF::Persistence::decodeCertificateChain): Added.
1343         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
1344         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
1345         * platform/network/cf/CertificateInfoCFNet.cpp:
1346         * platform/network/cocoa/CertificateInfoCocoa.mm:
1347
1348         * platform/network/curl/CertificateInfo.h:
1349         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
1350         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
1351
1352         * platform/network/soup/CertificateInfo.h:
1353         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::encode): Added.
1354         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode): Added.
1355         (WTF::Persistence::certificatesDataListFromCertificateInfo): Added.
1356         (WTF::Persistence::certificateFromCertificatesDataList): Added.
1357         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
1358         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
1359
1360 2018-11-17  Zalan Bujtas  <zalan@apple.com>
1361
1362         [LFC][IFC] InlineFormattingState::addDetachingRule should accumulate rules.
1363         https://bugs.webkit.org/show_bug.cgi?id=191801
1364
1365         Reviewed by Antti Koivisto.
1366
1367         before<span style="position: relative">positioned</span>after
1368         In the example above the <positioned> inline box has both the BreakAtStart and the BreakAtEnd rules.
1369         While walking through the inline tree, we add BreakAtStart first and when we figure it's the last child too,
1370         we add BreakAtEnd as well. BreakAtEnd should not clear the BreakAtStart rule.
1371
1372         Test: fast/inline/simple-inline-with-out-of-flow-descendant2.html
1373
1374         * layout/inlineformatting/InlineFormattingContext.cpp:
1375         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
1376         * layout/inlineformatting/InlineFormattingState.cpp:
1377         (WebCore::Layout::InlineFormattingState::addDetachingRule):
1378         * layout/inlineformatting/InlineFormattingState.h:
1379         (WebCore::Layout::InlineFormattingState::addDetachingRule): Deleted.
1380
1381 2018-11-17  Jonathan Hammer  <jonathan@e3software.com>
1382
1383         Caret stops blinking after context menu shown
1384         https://bugs.webkit.org/show_bug.cgi?id=191715
1385
1386         Reviewed by Ryosuke Niwa.
1387
1388         Changed EventHandler::sendContextMenuEvent to un-suspend caret blinking so that
1389         the caret continues to blink even after the context menu is dismissed. The normal
1390         way of un-suspendeding caret blinking (in EventHandler::handleMouseReleaseEvent) does
1391         not apply in the case of context menus because handleMouseReleaseEvent is not
1392         called once the context menu is up.
1393
1394         Test: fast/events/contextmenu-dismiss-blink-caret.html
1395
1396         * page/EventHandler.cpp:
1397         (WebCore::EventHandler::sendContextMenuEvent):
1398         * testing/Internals.cpp:
1399         (WebCore::Internals::isCaretBlinkingSuspended):
1400         * testing/Internals.h:
1401         * testing/Internals.idl:
1402
1403 2018-11-16  Antoine Quint  <graouts@apple.com>
1404
1405         [Pointer Events] event.isPrimary doesn't always represent the oldest active touch
1406         https://bugs.webkit.org/show_bug.cgi?id=191752
1407         <rdar://problem/46129270>
1408
1409         Reviewed by Dean Jackson.
1410
1411         Provide isPrimary to the constructor so its value can be determined at the call site.
1412
1413         Test: pointerevents/ios/pointer-events-is-primary.html
1414
1415         * dom/PointerEvent.h:
1416         * dom/ios/PointerEventIOS.cpp:
1417         (WebCore::PointerEvent::create):
1418         (WebCore::PointerEvent::PointerEvent):
1419         (WebCore::m_isPrimary):
1420
1421 2018-11-16  Alex Christensen  <achristensen@webkit.org>
1422
1423         Tweak _showSafeBrowsingWarningWithTitle SPI
1424         https://bugs.webkit.org/show_bug.cgi?id=191799
1425
1426         Reviewed by Wenson Hsieh.
1427
1428         It turns out I needed to expose both sentinel values used in safe browsing for my application of this SPI in Mac Safari.
1429         Allowing the caller to make its own sentinel values is insufficient because the malware confirmation needs to be over the warning.
1430         The completion handler parameter should just be a bool indicating whether the user has chosen to continue after all warnings.
1431
1432         Covered by updated API tests.
1433
1434         * en.lproj/Localizable.strings:
1435         * platform/LocalizedStrings.cpp:
1436         (WebCore::formControlCancelButtonTitle):
1437         Make "Cancel"'s description a little more generic.
1438
1439 2018-11-16  Simon Fraser  <simon.fraser@apple.com>
1440
1441         Optimize composited iframe layer hookup
1442         https://bugs.webkit.org/show_bug.cgi?id=191778
1443
1444         Reviewed by Zalan Bujtas.
1445
1446         The change made in r238229 can be more targeted; we only need to hook up iframe content
1447         layers when the layer is already composited (otherwise the updateBacking() above would have triggered
1448         the work), and when it's a RenderWidget layer.
1449         
1450         Tested by existing tests.
1451
1452         * rendering/RenderLayer.cpp:
1453         (WebCore::outputPaintOrderTreeRecursive):
1454         * rendering/RenderLayerCompositor.cpp:
1455         (WebCore::RenderLayerCompositor::layerStyleChanged):
1456
1457 2018-11-16  Ross Kirsling  <ross.kirsling@sony.com>
1458
1459         Provide default implementation of Widget
1460         https://bugs.webkit.org/show_bug.cgi?id=191784
1461
1462         Reviewed by Michael Catanzaro.
1463
1464         * SourcesWPE.txt:
1465         * platform/Widget.cpp:
1466         (WebCore::Widget::Widget):
1467         (WebCore::Widget::frameRect const):
1468         (WebCore::Widget::~Widget):
1469         (WebCore::Widget::setFrameRect):
1470         (WebCore::Widget::paint):
1471         (WebCore::Widget::setFocus):
1472         (WebCore::Widget::setCursor):
1473         (WebCore::Widget::show):
1474         (WebCore::Widget::hide):
1475         (WebCore::Widget::setIsSelected):
1476         * platform/gtk/WidgetGtk.cpp:
1477         (WebCore::Widget::Widget): Deleted.
1478         (WebCore::Widget::frameRect const): Deleted.
1479         * platform/win/WidgetWin.cpp:
1480         (WebCore::Widget::Widget): Deleted.
1481         (WebCore::Widget::frameRect const): Deleted.
1482         * platform/wpe/WidgetWPE.cpp: Removed.
1483
1484 2018-11-16  Chris Dumez  <cdumez@apple.com>
1485
1486         [macOS] Label "prewarmed" WebContent processes in Activity Monitor
1487         https://bugs.webkit.org/show_bug.cgi?id=191765
1488         <rdar://problem/45953463>
1489
1490         Reviewed by Geoffrey Garen.
1491
1492         * en.lproj/Localizable.strings:
1493
1494 2018-11-16  Jeremy Jones  <jeremyj@apple.com>
1495
1496         Enable external playback for video in element fullscreen.
1497         https://bugs.webkit.org/show_bug.cgi?id=190359
1498         rdar://problem/42560085
1499
1500         Reviewed by Jer Noble.
1501
1502         No new tests because we don't have a good way to test external playback.
1503
1504         Any video that might be auto-pipped from element fullscreen should also enable external playback for video out.
1505         PiP and external playback are mutually exclusive. Instead of preventing PiP when external playback is active,
1506         allow PiP, but disable external playback while PiP is active.
1507
1508         * html/HTMLMediaElement.cpp:
1509         (WebCore::HTMLMediaElement::setVideoFullscreenStandby):
1510         * html/HTMLMediaElement.h:
1511         * platform/graphics/MediaPlayer.cpp:
1512         (WebCore::MediaPlayer::setVideoFullscreenStandby):
1513         (WebCore::MediaPlayer::videoFullscreenStandby const):
1514         * platform/graphics/MediaPlayer.h:
1515         (WebCore::MediaPlayerClient::mediaPlayerVideoFullscreenStandby const):
1516         * platform/graphics/MediaPlayerPrivate.h:
1517         (WebCore::MediaPlayerPrivateInterface::setVideoFullscreenStandby):
1518         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1519         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenStandby):
1520         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
1521
1522 2018-11-16  Jer Noble  <jer.noble@apple.com>
1523
1524         Regression(r233865): Causes synchronous IPC in the middle of layout
1525         https://bugs.webkit.org/show_bug.cgi?id=188307
1526         <rdar://problem/42807306>
1527
1528         Reviewed by Eric Carlson.
1529
1530         Revert the changes added in r233865. Rather than make a syncronous call to the UIProcess to
1531         query whether the view has been backgrounded while (e.g.) JS has been spinning, perform the
1532         steps of the requestFullscreen() method on the next run loop, allowing messages from the
1533         UIProcess about page visibilty to be delivered first.
1534
1535         * dom/Document.cpp:
1536         (WebCore::Document::requestFullScreenForElement):
1537         * html/HTMLMediaElement.cpp:
1538         (WebCore::HTMLMediaElement::enterFullscreen):
1539         * html/HTMLMediaElement.h:
1540         * page/ChromeClient.h:
1541
1542 2018-11-16  Ross Kirsling  <ross.kirsling@sony.com>
1543
1544         Provide default implementation of Cursor
1545         https://bugs.webkit.org/show_bug.cgi?id=191772
1546
1547         Reviewed by Michael Catanzaro.
1548
1549         * SourcesWPE.txt:
1550         * platform/Cursor.cpp:
1551         (WebCore::Cursor::ensurePlatformCursor const):
1552         * platform/wpe/CursorWPE.cpp: Removed.
1553
1554 2018-11-16  Don Olmstead  <don.olmstead@sony.com>
1555
1556         EditorWPE should be EditorLibWPE
1557         https://bugs.webkit.org/show_bug.cgi?id=191774
1558
1559         Reviewed by Michael Catanzaro.
1560
1561         The platform specific implementations of Editor are all around the
1562         platform's Pasteboard. Since the Pasteboard implementation is now based
1563         around USE(LIBWPE) EditorWPE should be renamed to EditorLibWPE.
1564
1565         * SourcesWPE.txt:
1566         * editing/libwpe/EditorLibWPE.cpp: Renamed from Source/WebCore/editing/wpe/EditorWPE.cpp.
1567
1568 2018-11-16  Jeremy Jones  <jeremyj@apple.com>
1569
1570         Include AirPlay destination name in AirPlay placard.
1571         https://bugs.webkit.org/show_bug.cgi?id=191574
1572         rdar://problem/45536144
1573
1574         Reviewed by Eric Carlson.
1575
1576         Updated existing tests.
1577
1578         Include the name of the AirPlay destination in the video element's AirPlay placard.
1579
1580         * Modules/modern-media-controls/controls/airplay-placard.js:
1581         (AirplayPlacard):
1582         * Modules/modern-media-controls/controls/placard.js:
1583         * Modules/modern-media-controls/media/placard-support.js:
1584         (PlacardSupport.prototype._updatePlacard):
1585         (PlacardSupport.prototype._updateAirPlayPlacard):
1586         (PlacardSupport):
1587         * en.lproj/modern-media-controls-localized-strings.js:
1588
1589 2018-11-16  Zalan Bujtas  <zalan@apple.com>
1590
1591         Add DidFirstMeaningfulPaint milestone.
1592         https://bugs.webkit.org/show_bug.cgi?id=191754
1593
1594         Reviewed by Simon Fraser.
1595
1596         This milestone fires sone after the paint triggered by the first visually non-empty layout.
1597
1598         * page/FrameView.cpp:
1599         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
1600         (WebCore::FrameView::firePaintRelatedMilestonesIfNeeded):
1601         * page/LayoutMilestone.h:
1602
1603 2018-11-16  Don Olmstead  <don.olmstead@sony.com>
1604
1605         Provide default implementations of Image and Icon
1606         https://bugs.webkit.org/show_bug.cgi?id=191764
1607
1608         Reviewed by Michael Catanzaro.
1609
1610         Makes IconWPE and ImageWPE implementations the default.
1611
1612         * Sources.txt:
1613         * SourcesWPE.txt:
1614         * platform/graphics/Icon.cpp: Renamed from Source/WebCore/platform/graphics/wpe/IconWPE.cpp.
1615         * platform/graphics/Image.cpp:
1616         (WebCore::BitmapImage::invalidatePlatformData): Placed here for consistency with implementing ports.
1617         (WebCore::Image::loadPlatformResource):
1618         * platform/graphics/wpe/ImageWPE.cpp: Removed.
1619
1620 2018-11-16  Brent Fulgham  <bfulgham@apple.com>
1621
1622         [Win] Reduce the use of WKSI library calls: CFNetwork
1623         https://bugs.webkit.org/show_bug.cgi?id=191718
1624         <rdar://problem/46108732>
1625
1626         Reviewed by Alex Christensen.
1627
1628         Remove custom WKSI CFNetwork calls, since the SPI is already documented in PAL. Just
1629         make the same calls on Windows, like we did for iOS and macOS back in 2017.
1630
1631         Stop including WebKitSystemInterface.h for files that used to rely on it
1632         for font-related features.
1633         
1634         Tested by existing Windows regression tests. There should be no change in behavior.
1635
1636         * platform/graphics/win/FontCacheWin.cpp:
1637         * platform/graphics/win/FontCustomPlatformData.cpp:
1638         * platform/graphics/win/FontPlatformDataCGWin.cpp:
1639         * platform/network/cf/CookieStorageCFNet.cpp:
1640         * platform/network/cf/CredentialStorageCFNet.cpp:
1641         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1642         (WebCore::createPrivateStorageSession):
1643         (WebCore::NetworkStorageSession::switchToNewTestingSession):
1644         (WebCore::NetworkStorageSession::ensureSession):
1645         * platform/network/cf/ResourceError.h:
1646         * platform/network/cf/ResourceErrorCF.cpp:
1647         (WebCore::getSSLPeerCertificateData):
1648         (WebCore::setSSLPeerCertificateData):
1649         (WebCore::ResourceError::getSSLPeerCertificateDataBytePtr):
1650         (WebCore::ResourceError::platformLazyInit):
1651         (WebCore::ResourceError::cfError const):
1652         * platform/network/cf/ResourceHandleCFNet.cpp:
1653         (WebCore::setClientCertificateInSSLProperties):
1654         (WebCore::ResourceHandle::createCFURLConnection):
1655         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
1656         * platform/network/cf/ResourceRequestCFNet.cpp:
1657         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1658
1659 2018-11-16  Timothy Hatcher  <timothy@apple.com>
1660
1661         Add html{color:text} to the simpleUserAgentStyleSheet on macOS.
1662         https://bugs.webkit.org/show_bug.cgi?id=191760
1663
1664         Reviewed by Antti Koivisto.
1665
1666         * css/CSSDefaultStyleSheets.cpp: Added html{color:text} to simpleUserAgentStyleSheet inside
1667         a PLATFORM(MAC) copy of the string.
1668
1669 2018-11-16  Jer Noble  <jer.noble@apple.com>
1670
1671         An early return from updateSchedulingInfo can leave some variables uninitialized.
1672         https://bugs.webkit.org/show_bug.cgi?id=191755
1673         <rdar://problem/39910089>
1674
1675         Reviewed by Brent Fulgham.
1676
1677         * Modules/webaudio/AudioBufferSourceNode.cpp:
1678         (WebCore::AudioBufferSourceNode::process):
1679         * Modules/webaudio/AudioScheduledSourceNode.cpp:
1680         (WebCore::AudioScheduledSourceNode::updateSchedulingInfo):
1681         * Modules/webaudio/OscillatorNode.cpp:
1682         (WebCore::OscillatorNode::process):
1683
1684 2018-11-16  Alicia Boya García  <aboya@igalia.com>
1685
1686         [MSE][GStreamer] Ignore caps notifications when tearing down the pipeline
1687         https://bugs.webkit.org/show_bug.cgi?id=191578
1688
1689         Reviewed by Xabier Rodriguez-Calvar.
1690
1691         Changing the demuxer to READY state (which is done only in the main
1692         thread) triggers the unlinking of its srcpads, which in turns emits a
1693         caps change notification in the previously linked element since they
1694         become unnegotiated again.
1695
1696         We are not interested in caps notifications in these cases, so let's
1697         just ignore caps notifications emitted from the main thread.
1698
1699         This fixes an assertion failure in the debug builds.
1700
1701         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1702         (WebCore::AppendPipeline::AppendPipeline):
1703
1704 2018-11-16  Sihui Liu  <sihui_liu@apple.com>
1705
1706         Storing blobs in IDB on iOS: "Error preparing blob/file"
1707         https://bugs.webkit.org/show_bug.cgi?id=188438
1708         <rdar://problem/43097279>
1709
1710         Reviewed by Alex Christensen.
1711
1712         Grant sandbox extension of temp folder to network process, because we suggested network process had access to 
1713         the folder on iOS device but it didn't. 
1714
1715         This makes some existing tests about IDB blob pass on iOS device.
1716
1717         * Modules/indexeddb/server/IDBBackingStore.h:
1718         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
1719         (WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
1720         (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
1721         (WebCore::IDBServer::SQLiteIDBTransaction::abort):
1722         * Modules/indexeddb/shared/InProcessIDBServer.h:
1723
1724 2018-11-16  Don Olmstead  <don.olmstead@sony.com>
1725
1726         Add USE(LIBWPE) to WebCore
1727         https://bugs.webkit.org/show_bug.cgi?id=191401
1728
1729         Reviewed by Michael Catanzaro.
1730
1731         No new tests. No change in behavior.
1732
1733         Migrates all PLATFORM(WPE) code that calls into wpe_* APIs to
1734         USE(LIBWPE) instead.
1735
1736         Renames classes and files to use the suffix LibWPE.
1737
1738         * PlatformWPE.cmake:
1739         * SourcesWPE.txt:
1740         * platform/Pasteboard.h:
1741         * platform/PasteboardStrategy.h:
1742         * platform/PlatformKeyboardEvent.h:
1743         * platform/PlatformPasteboard.h:
1744         * platform/graphics/PlatformDisplay.cpp:
1745         (WebCore::PlatformDisplay::createPlatformDisplay):
1746         * platform/graphics/PlatformDisplay.h:
1747         * platform/graphics/egl/GLContextEGL.h:
1748         * platform/graphics/egl/GLContextEGLLibWPE.cpp: Renamed from Source/WebCore/platform/graphics/egl/GLContextEGLWPE.cpp.
1749         (WebCore::GLContextEGL::createWPEContext):
1750         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1751         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
1752         * platform/graphics/libwpe/PlatformDisplayLibWPE.cpp: Renamed from Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.cpp.
1753         (WebCore::PlatformDisplayLibWPE::create):
1754         (WebCore::PlatformDisplayLibWPE::PlatformDisplayLibWPE):
1755         (WebCore::PlatformDisplayLibWPE::~PlatformDisplayLibWPE):
1756         (WebCore::PlatformDisplayLibWPE::initialize):
1757         * platform/graphics/libwpe/PlatformDisplayLibWPE.h: Renamed from Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.h.
1758         * platform/libwpe/PasteboardLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PasteboardWPE.cpp.
1759         * platform/libwpe/PlatformKeyboardEventLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PlatformKeyboardEventWPE.cpp.
1760         * platform/libwpe/PlatformPasteboardLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PlatformPasteboardWPE.cpp.
1761
1762 2018-11-16  Zalan Bujtas  <zalan@apple.com>
1763
1764         [iOS] 2 subsequent taps are required to trigger certain tasks on the desktop version of YouTube.com (hover vs click).
1765         https://bugs.webkit.org/show_bug.cgi?id=191712
1766         <rdar://problem/45612900>
1767
1768         Reviewed by Simon Fraser.
1769
1770         In handleSyntheticClick() we use WKContentObservation to figure out whether the tap should be treated as a hover or a click.
1771         In general, if the mouse-move event triggers a visible content change, we assume we hit a hover-like drop down menu (or something similar)
1772         and no need to dispatch a click event.
1773         The idea here is that if the new content (result of the mouse-move event) does not respond to mouse click, it is most likely
1774         only for tooltip-like reasons and it's ok to proceed with the click event.
1775
1776         Test: fast/events/touch/ios/click-instead-of-hover-simple.html
1777
1778         * rendering/updating/RenderTreeUpdater.cpp:
1779         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
1780
1781 2018-11-16  Zalan Bujtas  <zalan@apple.com>
1782
1783         [LFC][IFC] Add support for out-of-flow positioned boxes
1784         https://bugs.webkit.org/show_bug.cgi?id=191726
1785
1786         Reviewed by Antti Koivisto.
1787
1788         While laying out formatting context roots (inline-block, floats) in an inline formatting context, we need to make sure
1789         that their out-of-flow descendants get laid out as well.
1790
1791         Test: fast/inline/simple-inline-with-out-of-flow-descendant.html
1792
1793         * layout/inlineformatting/InlineFormattingContext.cpp:
1794         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
1795         * layout/layouttree/LayoutTreeBuilder.cpp: This was returning the wrong context root when the container was also a context root.
1796         (WebCore::Layout::TreeBuilder::createSubTree):
1797
1798 2018-11-16  Thibault Saunier  <tsaunier@igalia.com>
1799
1800         [GStreamer][WebRTC] Add API to enable/disable device mocks
1801         https://bugs.webkit.org/show_bug.cgi?id=191699
1802
1803         This basically us to test MediaStream/WebRTC support without
1804         requiring cameras or microphones and is quite useful.
1805
1806         Also fix the GStreamerAudioMock by:
1807           - Stop setting `leaky-upstream` on the GStreamerCapturer queue,
1808             this was usefull when we were trying to bring the MediaStream
1809             sources inside the main pipeline, it is not the case anymore
1810             (and not doable with latest version of LibWebRTC).
1811           - Use a 'ticks' wave on the gstreamer audiotestsrc so the test
1812             stream is similar to what Apple port does.
1813
1814         Reviewed by Xabier Rodriguez-Calvar.
1815
1816         The mocks are already tested and the API is really simple.
1817
1818         * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
1819         (WebCore::GStreamerAudioCapturer::createSource):
1820         * platform/mediastream/gstreamer/GStreamerAudioCapturer.h:
1821         * platform/mediastream/gstreamer/GStreamerCapturer.cpp:
1822         (WebCore::GStreamerCapturer::addSink):
1823         * platform/mediastream/gstreamer/GStreamerCapturer.h:
1824
1825 2018-11-16  Thibault Saunier  <tsaunier@igalia.com>
1826
1827         [GStreamer][MediaStream] Handle track addition and removal
1828         https://bugs.webkit.org/show_bug.cgi?id=191599
1829
1830         Reviewed by Xabier Rodriguez-Calvar.
1831
1832         Test: fast/mediastream/MediaStream-video-element-remove-track.html
1833
1834         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
1835         (WebCore::WebKitMediaStreamObserver::~WebKitMediaStreamObserver):
1836         (WebCore::WebKitMediaStreamObserver::WebKitMediaStreamObserver):
1837         (WebCore::webkitMediaStreamSrcFinalize):
1838         (WebCore::webkitMediaStreamSrcChangeState):
1839         (WebCore::webkit_media_stream_src_init):
1840         (WebCore::webkitMediaStreamSrcSetupSrc):
1841         (WebCore::webkitMediaStreamSrcAddTrack):
1842         (WebCore::webkitMediaStreamSrcRemoveTrackByType):
1843         (WebCore::webkitMediaStreamSrcSetStream):
1844
1845 2018-11-16  Zan Dobersek  <zdobersek@igalia.com>
1846
1847         ScalableImageDecoder: don't forcefully decode image data when querying frame completeness, duration
1848         https://bugs.webkit.org/show_bug.cgi?id=191354
1849
1850         Reviewed by Michael Catanzaro.
1851
1852         ScalableImageDecoder::frameIsCompleteAtIndex() should only check the
1853         index validity and, if the index is valid, check for completeness of the
1854         corresponding frame. ScalableImageDecoder::frameDurationAtIndex() should
1855         also only retrieve duration for already-complete frames.
1856
1857         Both methods avoid calling ScalableImageDecoder::frameBufferAtIndex()
1858         as that method goes on and decodes image data to determine specific
1859         information. The ImageSource class that's querying this information
1860         doesn't anticipate this, and doesn't handle the increased memory
1861         consumption of the decoded data, leaving MemoryCache in the blind about
1862         the image resource's actual amount of consumed memory. ImageSource can
1863         instead gracefully handle any incomplete frame by marking the decoding
1864         status for this frame as only partial.
1865
1866         * platform/image-decoders/ScalableImageDecoder.cpp:
1867         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
1868         (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
1869         (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
1870
1871 2018-11-16  Antoine Quint  <graouts@apple.com>
1872
1873         PointerEvents should not require touch event listeners to be registered
1874         https://bugs.webkit.org/show_bug.cgi?id=191333
1875         <rdar://problem/45857523>
1876
1877         Reviewed by Dean Jackson.
1878
1879         Tests: pointerevents/ios/pointer-events-dispatch-on-touch.html
1880                pointerevents/ios/pointer-events-prevent-default.html
1881
1882         * dom/EventNames.h:
1883         (WebCore::EventNames::isTouchEventType const):
1884         (WebCore::EventNames::touchAndPointerEventNames const):
1885         (WebCore::EventNames::touchEventNames const): Deleted.
1886         * dom/Node.cpp:
1887         (WebCore::Node::moveNodeToNewDocument):
1888
1889 2018-11-15  Zalan Bujtas  <zalan@apple.com>
1890
1891         [iOS] Do not get stuck in indeterminate content observation state.
1892         https://bugs.webkit.org/show_bug.cgi?id=191719
1893
1894         Reviewed by Simon Fraser.
1895
1896         Reset the _WKContentChange flag to WKContentNoChange when the last observing timer is removed and we are in
1897         the "can't decide yet if it's a hover or click" state.
1898         This bug prevents us from firing click event when JS installs and removes the same set of timer(s) during mouse-move dispatch.
1899
1900         Test: fast/events/touch/ios/stuck-with-hover-state.html
1901
1902         * platform/ios/wak/WKContentObservation.cpp:
1903         (WebThreadRemoveObservedContentModifier):
1904
1905 2018-11-15  Simon Fraser  <simon.fraser@apple.com>
1906
1907         REGRESSION (r238090) Composited iframes that resize from zero don't show
1908         https://bugs.webkit.org/show_bug.cgi?id=191733
1909         rdar://problem/46107764
1910
1911         Reviewed by Zalan Bujtas.
1912         
1913         A zero-sized iframe whose contents are composited should not trigger compositing in the
1914         parent document (see code in requiresCompositingForFrame()), but when the <iframe> element
1915         was resized without a style change (e.g. because it's width: 100%, height: 100% and the
1916         parent resizes), there was no code that triggered a compositing update.
1917
1918         Fix by having RenderLayer::updateLayerPosition() trigger an update when the size changes,
1919         for a RenderWidget whose contents are composited.
1920
1921         Test: compositing/iframes/resize-from-zero-size.html
1922
1923         * rendering/RenderLayer.cpp:
1924         (WebCore::RenderLayer::updateLayerPosition):
1925
1926 2018-11-15  Simon Fraser  <simon.fraser@apple.com>
1927
1928         Overlay with -webkit-overflow-scrolling:touch doesn't become scrollable after added text makes it taller
1929         https://bugs.webkit.org/show_bug.cgi?id=158342
1930         rdar://problem/26652811
1931
1932         Reviewed by Zalan Bujtas.
1933         
1934         Patch partly by Frédéric Wang.
1935
1936         This commit fixes an issue when resizing the content of a -webkit-overflow-scrolling: touch
1937         overflow node on iOS. Indeed, the RenderLayerBacking's scrolling layer may not be properly
1938         created and hence the UIProcess receives a null UIScrollView pointer. This triggers an
1939         assertion in debug mode and prevents the user from scrolling the overflow node in release
1940         mode. This was partially fixed by the refactoring of bug 90342 but this commit addresses
1941         the remaining issues by forcing a configuration update after layout in order to ensure that
1942         RenderLayerBacking's scrolling layer is available. For an overflow element that is not yet
1943         composited, trigger a post-layout update that is necessary to check if we need to make it
1944         composited when it gains scrollable overflow.
1945
1946         Tests: fast/scrolling/ios/change-scrollability-on-content-resize-nested.html
1947                fast/scrolling/ios/change-scrollability-on-content-resize.html
1948
1949         * rendering/RenderLayer.cpp:
1950         (WebCore::RenderLayer::updateScrollInfoAfterLayout): Force a configuration update so that
1951         RenderLayerCompositor::updateBackingAndHierarchy will later instantiate
1952         RenderLayerBacking::m_scrollingLayer.
1953
1954 2018-11-15  Fujii Hironori  <Hironori.Fujii@sony.com>
1955
1956         [curl] warning: delete called on non-final 'WebCore::CurlDownload' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
1957         https://bugs.webkit.org/show_bug.cgi?id=191582
1958
1959         Reviewed by Alex Christensen.
1960
1961         No new tests because there's no behaviour change.
1962
1963         * platform/network/curl/CurlDownload.h: Marked CurlDownload final.
1964
1965 2018-11-15  Truitt Savell  <tsavell@apple.com>
1966
1967         Unreviewed, rolling out r238244.
1968
1969         Caused High Sierra test runs to fail early with 50 crashes and
1970         casued 25 API failures.
1971
1972         Reverted changeset:
1973
1974         "[css-logical] Implement flow-relative margin, padding and
1975         border shorthands"
1976         https://bugs.webkit.org/show_bug.cgi?id=188697
1977         https://trac.webkit.org/changeset/238244
1978
1979 2018-11-15  Jer Noble  <jer.noble@apple.com>
1980
1981         AVKit will set videoGravity to a nil string when building against iosmac
1982         https://bugs.webkit.org/show_bug.cgi?id=191573
1983
1984         Reviewed by Dean Jackson.
1985
1986         Workaround AVKit behavior by treating nil videoGravity as the default,
1987         which is AVLayerVideoGravityResizeAspect.
1988
1989         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1990         (-[WebAVPlayerLayer setVideoGravity:]):
1991
1992 2018-11-15  Brent Fulgham  <bfulgham@apple.com>
1993
1994         [Win] Reduce the use of WKSI library calls: Font Handling
1995         https://bugs.webkit.org/show_bug.cgi?id=191701
1996         <rdar://problem/46104809>
1997
1998         Reviewed by Myles C. Maxfield.
1999
2000         Move the old Windows font handling code out of WKSI to our regular
2001         repository. We now handle SPI differently, and don't need to keep
2002         these implementations in a separate library. This should also help
2003         avoid the somewhat frequent build failures caused when WKSI is not
2004         updated in sync with WebKit.
2005
2006         Tested by existing Windows test cases.
2007
2008         * platform/graphics/FontCascade.h:
2009         * platform/graphics/win/FontCGWin.cpp:
2010         (WebCore::FontCascade::drawGlyphs):
2011         (WebCore::FontCascade::setFontSmoothingLevel):
2012         (WebCore::setCGFontSmoothingStyle):
2013         (WebCore::FontCascade::setFontSmoothingStyle):
2014         (WebCore::FontCascade::setFontSmoothingContrast):
2015         (WebCore::clearTypeContrast):
2016         (WebCore::FontCascade::systemFontSmoothingChanged):
2017         (WebCore::FontCascade::setCGContextFontRenderingStyle):
2018         (WebCore::renderingStyleForFont):
2019         (WebCore::FontCascade::getGlyphAdvances):
2020         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
2021         (WebCore::GlyphPage::fill):
2022         * platform/graphics/win/GraphicsContextCGWin.cpp:
2023         (WebCore::GraphicsContext::drawFocusRing):
2024         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
2025         * platform/graphics/win/SimpleFontDataCGWin.cpp:
2026         (WebCore::Font::platformWidthForGlyph const):
2027         * rendering/RenderMediaControls.cpp:
2028         (WebCore::RenderMediaControls::adjustMediaSliderThumbSize):
2029
2030 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
2031
2032         [WebAuthN] Use a real nonce for CTAPHID_INIT
2033         https://bugs.webkit.org/show_bug.cgi?id=191533
2034         <rdar://problem/46103502>
2035
2036         Reviewed by Brent Fulgham.
2037
2038         New tests are added into existing test files.
2039
2040         * Modules/webauthn/fido/FidoConstants.h:
2041
2042 2018-11-15  Justin Fan  <justin_fan@apple.com>
2043
2044         [WebGPU] WebGPUCommandBuffer prototype
2045         https://bugs.webkit.org/show_bug.cgi?id=191663
2046
2047         Reviewed by Dean Jackson.
2048
2049         Begin implementation of WebGPUCommandBuffers as well as GPUQueues (MTLCommandBuffer, MTLCommandQueue).
2050
2051         Test: webgpu/command-buffers.html
2052
2053         * CMakeLists.txt:
2054         * DerivedSources.make:
2055         * Modules/webgpu/GPUCommandBuffer.h: Added. Wrapper class around a MTLCommandBuffer.
2056         * Modules/webgpu/GPUDevice.cpp:
2057         (WebCore::GPUDevice::createCommandBuffer): Added.
2058         (WebCore::GPUDevice::getQueue): Returns RefPtr to the device's singleton queue.
2059         * Modules/webgpu/GPUDevice.h: Now manages the device's GPUQueue.
2060         (WebCore::GPUDevice::platformDevice const):
2061         * Modules/webgpu/GPUQueue.h: Added. Wrapper class around a MTLCommandQueue.
2062         (WebCore::GPUQueue::platformQueue const):
2063         * Modules/webgpu/GPURenderPipeline.h: Moved from Source/WebCore/Modules/webgpu/cocoa/GPURenderPipeline.h.
2064         (WebCore::GPURenderPipeline::platformRenderPipeline const):
2065         * Modules/webgpu/GPUShaderModule.h:
2066         (WebCore::GPUShaderModule::platformShaderModule const):
2067         * Modules/webgpu/GPUSwapChain.h: Moved from Source/WebCore/Modules/webgpu/cocoa/GPUSwapChain.h.
2068         (WebCore::GPUSwapChain::platformLayer const):
2069         * Modules/webgpu/WebGPUCommandBuffer.cpp: Added. Web interface for a GPU device's command buffer.
2070         (WebCore::WebGPUCommandBuffer::create):
2071         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
2072         * Modules/webgpu/WebGPUCommandBuffer.h: Added.
2073         * Modules/webgpu/WebGPUCommandBuffer.idl: Added.
2074         * Modules/webgpu/WebGPUDevice.cpp:
2075         (WebCore::WebGPUDevice::createCommandBuffer const): Added.
2076         * Modules/webgpu/WebGPUDevice.h:
2077         * Modules/webgpu/WebGPUDevice.idl:
2078         * Modules/webgpu/cocoa/GPUCommandBufferMetal.mm: Added. MTLCommandBuffer impl for GPUCommandBuffer.
2079         (WebCore::GPUCommandBuffer::create): Create a MTLCommandBuffer from the MTLCommandQueue.
2080         (WebCore::GPUCommandBuffer::GPUCommandBuffer):
2081         * Modules/webgpu/cocoa/GPUDeviceMetal.mm:
2082         (WebCore::GPUDevice::GPUDevice):
2083         * Modules/webgpu/cocoa/GPUQueueMetal.mm: Added. MTLCommandQueue impl for GPUQueue.
2084         (WebCore::GPUQueue::create):
2085         (WebCore::GPUQueue::GPUQueue):
2086         * Modules/webgpu/cocoa/GPURenderPipelineMetal.mm:
2087         (WebCore::GPURenderPipeline::GPURenderPipeline):
2088         * Modules/webgpu/cocoa/GPUShaderModuleMetal.mm:
2089         (WebCore::GPUShaderModule::create):
2090         (WebCore::GPUShaderModule::GPUShaderModule):
2091         * Sources.txt:
2092         * SourcesCocoa.txt:
2093         * WebCore.xcodeproj/project.pbxproj:
2094         * bindings/js/WebCoreBuiltinNames.h:
2095
2096 2018-11-15  Oriol Brufau  <obrufau@igalia.com>
2097
2098         [css-logical] Implement flow-relative margin, padding and border shorthands
2099         https://bugs.webkit.org/show_bug.cgi?id=188697
2100
2101         Reviewed by Simon Fraser and Antti Koivisto.
2102
2103         Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
2104                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
2105                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
2106                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
2107                imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
2108                imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
2109                webexposed/css-properties-as-js-properties.html
2110                webexposed/css-properties-behind-flags.html
2111                webexposed/css-property-listing.html
2112
2113         * css/CSSComputedStyleDeclaration.cpp:
2114         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2115         Allow the new properties to serialize their computed value.
2116
2117         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
2118         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
2119         * css/CSSComputedStyleDeclaration.h:
2120         Rename getCSSPropertyValuesForSidesShorthand to getCSSPropertyValuesFor4SidesShorthand,
2121         and add analogous getCSSPropertyValuesFor2SidesShorthand for serializing 2-sided
2122         shorthands.
2123
2124         * css/CSSProperties.json:
2125         Add the new properties behind the CSSLogicalEnabled runtime flag.
2126
2127         * css/CSSStyleDeclaration.cpp:
2128         (WebCore::CSSStyleDeclaration::supportedPropertyNames const):
2129         Prevent CSS properties disabled behind a runtime flag from being exposed in
2130         style declarations.
2131
2132         * css/StyleProperties.cpp:
2133         (WebCore::StyleProperties::getPropertyValue const):
2134         Allow the new properties to serialize their specified value.
2135
2136         (WebCore::StyleProperties::get2Values const):
2137         Add get2Values, analogous to get4Values, for serializing 2-sided shorthands.
2138
2139         (WebCore::StyleProperties::borderPropertyValue const):
2140         Allow borderPropertyValue to serialize arbitrary multi-sided border shorthands
2141         corresponding to width, style and color.
2142
2143         (WebCore::MutableStyleProperties::setProperty):
2144         Prevent CSS properties disabled behind a runtime flag from being set a value.
2145
2146         (WebCore::StyleProperties::asText const):
2147         Allow the new properties to be serialized in cssText.
2148         Prevent CSS shorthands disabled behind a runtime flag from appearing in cssText,
2149         and serialize the longhands instead. Note that there could be another shorthand
2150         available which is enabled, but a proper solution would require bug 190496.
2151
2152         * css/StyleProperties.h:
2153         Update declarations of borderPropertyValue and get2Values.
2154
2155         * css/makeprop.pl:
2156         (addProperty):
2157         Add isEnabledCSSProperty function for checking that a CSS property is not
2158         disabled behind a runtime flag.
2159
2160         * css/parser/CSSPropertyParser.cpp:
2161         (WebCore::cssPropertyID):
2162         Prevent CSS properties disabled behind a runtime flag from being exposed in
2163         computed styles.
2164
2165         (WebCore::CSSPropertyParser::addProperty):
2166         Prevent CSS properties disabled behind a runtime flag from being set a value.
2167
2168         (WebCore::CSSPropertyParser::consumeBorder):
2169         Change consumeBorder to provide the caller with the parsed values instead of
2170         setting properties. Then the caller can decide to which properties the values
2171         should be set, and whether border-image should be reset or not.
2172
2173         (WebCore::CSSPropertyParser::consume2ValueShorthand):
2174         (WebCore::CSSPropertyParser::consume4ValueShorthand):
2175         Rename consume4Values to consume4ValueShorthand, and add analogous
2176         consume2ValueShorthand for parsing shorthands with two longhands.
2177
2178         (WebCore::CSSPropertyParser::parseShorthand):
2179         Allow the new properties to be parsed.
2180
2181         * css/parser/CSSPropertyParser.h:
2182         Update declarations of consumeBorder, consume2ValueShorthand and
2183         consume4ValueShorthand.
2184
2185         * inspector/agents/InspectorCSSAgent.cpp:
2186         (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
2187         Prevent CSS properties disabled behind a runtime flag from being exposed in
2188         the CSS inspector tool.
2189
2190         * page/RuntimeEnabledFeatures.h:
2191         (WebCore::RuntimeEnabledFeatures::setCSSLogicalEnabled):
2192         (WebCore::RuntimeEnabledFeatures::cssLogicalEnabled const):
2193         Add the CSSLogicalEnabled runtime flag.
2194
2195 2018-11-15  Truitt Savell  <tsavell@apple.com>
2196
2197         Unreviewed, rolling out r238220.
2198
2199         Introduced failing tests to iOS and is slowing down EWS
2200
2201         Reverted changeset:
2202
2203         "[css-grid] Consider scrollbars in
2204         populateGridPositionsForDirection()"
2205         https://bugs.webkit.org/show_bug.cgi?id=191656
2206         https://trac.webkit.org/changeset/238220
2207
2208 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
2209
2210         [WebAuthN] PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional
2211         https://bugs.webkit.org/show_bug.cgi?id=191522
2212
2213         Reviewed by Brent Fulgham.
2214
2215         Accordign to the WebIDL, AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional.
2216         https://www.w3.org/TR/webauthn/#dictdef-authenticatorselectioncriteria
2217
2218         Covered by existing tests.
2219
2220         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
2221         (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):
2222
2223 2018-11-15  Ross Kirsling  <ross.kirsling@sony.com>
2224
2225         DragImage should have a complete default implementation
2226         https://bugs.webkit.org/show_bug.cgi?id=191666
2227
2228         Reviewed by Dean Jackson.
2229
2230         Move WPE's stub implementation down into the base implementation file.
2231
2232         * SourcesWPE.txt:
2233         * platform/DragImage.cpp:
2234         (WebCore::dragImageSize):
2235         (WebCore::deleteDragImage):
2236         (WebCore::scaleDragImage):
2237         (WebCore::dissolveDragImageToFraction):
2238         (WebCore::createDragImageFromImage):
2239         (WebCore::createDragImageIconForCachedImageFilename):
2240         (WebCore::createDragImageForLink):
2241         * platform/wpe/DragImageWPE.cpp: Removed.
2242
2243 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
2244
2245         [WebAuthN] UserHandle can be null
2246         https://bugs.webkit.org/show_bug.cgi?id=191521
2247
2248         Reviewed by Alex Christensen.
2249
2250         According to the newest spec as of 7 August, 2018: https://www.w3.org/TR/webauthn/#conforming-authenticators-u2f.
2251         UserHandle can now be null.
2252
2253         Covered by existing tests.
2254
2255         * Modules/webauthn/AuthenticatorAssertionResponse.h:
2256         (WebCore::AuthenticatorAssertionResponse::create):
2257         (WebCore::AuthenticatorAssertionResponse::userHandle const):
2258         (WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
2259         * Modules/webauthn/AuthenticatorAssertionResponse.idl:
2260         * Modules/webauthn/PublicKeyCredential.cpp:
2261         (WebCore::PublicKeyCredential::tryCreate):
2262         * Modules/webauthn/PublicKeyCredentialData.h:
2263         (WebCore::PublicKeyCredentialData::encode const):
2264         (WebCore::PublicKeyCredentialData::decode):
2265         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
2266         (fido::readCTAPGetAssertionResponse):
2267
2268 2018-11-15  Youenn Fablet  <youenn@apple.com>
2269
2270         Modernize RTCPeerConnection handling of pendingActivity
2271         https://bugs.webkit.org/show_bug.cgi?id=191661
2272
2273         Reviewed by Eric Carlson.
2274
2275         makePendingActivity is the modern way to handle set/unset of pending activity.
2276         No change of behavior.
2277
2278         * Modules/mediastream/RTCPeerConnection.cpp:
2279         (WebCore::RTCPeerConnection::create):
2280         (WebCore::RTCPeerConnection::doStop):
2281         * Modules/mediastream/RTCPeerConnection.h:
2282
2283 2018-11-15  Keith Rollin  <krollin@apple.com>
2284
2285         Delete old .xcfilelist files
2286         https://bugs.webkit.org/show_bug.cgi?id=191669
2287         <rdar://problem/46081994>
2288
2289         Reviewed by Chris Dumez.
2290
2291         .xcfilelist files were created and added to the Xcode project files in
2292         https://trac.webkit.org/changeset/238008/webkit. However, they caused
2293         build issues and they were removed from the Xcode projects in
2294         https://trac.webkit.org/changeset/238055/webkit. This check-in removes
2295         the files from the repository altogether. They'll ultimately be
2296         replaced with new files with names that indicate whether the
2297         associated files are inputs to the Run Script phase or are files
2298         created by the Run Script phase.
2299
2300         No new tests -- no changed functionality.
2301
2302         * DerivedSources.xcfilelist: Removed.
2303         * UnifiedSources.xcfilelist: Removed.
2304
2305 2018-11-15  Youenn Fablet  <youenn@apple.com>
2306
2307         Update RTCPeerConnection JS built-ins to be closer to specWe
2308         https://bugs.webkit.org/show_bug.cgi?id=191665
2309
2310         Reviewed by Eric Carlson.
2311
2312         Simplify JS built-ins since we no longer need to support callback versions of the API.
2313         Make sure to have the right number of parameters in the JS built-in functions.
2314         Make some simplification to the code.
2315         Covered by existing tests and rebased test.
2316
2317         * Modules/mediastream/RTCPeerConnection.js:
2318         (createOffer):
2319         (createAnswer):
2320         (setLocalDescription):
2321         (setRemoteDescription):
2322         (addIceCandidate):
2323         * Modules/mediastream/RTCPeerConnectionInternals.js:
2324         (enqueueOperation):
2325         (callbacksAndDictionaryOverload): Deleted.
2326
2327 2018-11-15  Simon Fraser  <simon.fraser@apple.com>
2328
2329         REGRESSION(r238090): Composited iframe contents disappear after switching tabs in Safari
2330         https://bugs.webkit.org/show_bug.cgi?id=191673
2331         rdar://problem/46083440
2332
2333         Reviewed by Antti Koivisto.
2334
2335         Switching tabs in Safari triggers the "setIsInWindow" code path, that detaches the layer
2336         tree for every Frame. They get re-attached on tab show, and for subframes this involves
2337         the triggering of a fake style recalc in the parent document via scheduleInvalidateStyleAndLayerComposition().
2338         
2339         The style diff that's sent to RenderLayerCompositor::layerStyleChanged() as a result of that
2340         fake style recalc is RecompositeLayer, but the code was failing to trigger the necessary
2341         layer configuration update that gets iframe layers parented.
2342         
2343         This stop-gap patch triggers layer config updates on every RecompositeLayer diff. A future
2344         patch will optimize this, and add a layout test.
2345
2346         * rendering/RenderLayerCompositor.cpp:
2347         (WebCore::RenderLayerCompositor::layerStyleChanged):
2348
2349 2018-11-15  Zalan Bujtas  <zalan@apple.com>
2350
2351         [LFC][IFC] Skip non-inflow boxes while splitting the inline runs.
2352         https://bugs.webkit.org/show_bug.cgi?id=191690
2353
2354         Reviewed by Antti Koivisto.
2355
2356         Skip all non-inflow boxes (floats, out-of-flow positioned elements). They don't participate in the inline run context.
2357
2358         * layout/Verification.cpp:
2359         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
2360         * layout/inlineformatting/InlineFormattingContext.cpp:
2361         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2362
2363 2018-11-15  Zalan Bujtas  <zalan@apple.com>
2364
2365         [LFC] FormattingContext base class should not declare computeStaticPosition.
2366         https://bugs.webkit.org/show_bug.cgi?id=191683
2367
2368         Reviewed by Antti Koivisto.
2369
2370         Apparently only BlockFormattingContext uses it.
2371
2372         * layout/FormattingContext.h:
2373         * layout/blockformatting/BlockFormattingContext.h:
2374         * layout/inlineformatting/InlineFormattingContext.cpp:
2375         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const): Deleted.
2376         * layout/inlineformatting/InlineFormattingContext.h:
2377
2378 2018-11-14  Zalan Bujtas  <zalan@apple.com>
2379
2380         [LFC][IFC] Add support for in-flow positioned inline boxes.
2381         https://bugs.webkit.org/show_bug.cgi?id=191672
2382
2383         Reviewed by Antti Koivisto.
2384
2385         We might offset the in-flow positioned runs differently once runs are moved over to the display tree.
2386
2387         Test: fast/inline/simple-inline-inflow-positioned.html
2388
2389         * layout/Verification.cpp:
2390         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
2391         * layout/inlineformatting/InlineFormattingContext.cpp:
2392         (WebCore::Layout::InlineFormattingContext::splitInlineRunsIfNeeded const):
2393         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
2394         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
2395         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2396         * layout/inlineformatting/InlineFormattingContext.h:
2397         * layout/inlineformatting/InlineRun.h:
2398         (WebCore::Layout::InlineRun::moveVertically):
2399         * layout/layouttree/LayoutTreeBuilder.cpp:
2400         (WebCore::Layout::outputInlineRuns):
2401
2402 2018-11-15  Thibault Saunier  <tsaunier@igalia.com>
2403
2404         [GStreamer][WebRTC] Add support for sending silence or silencing an incoming track
2405         https://bugs.webkit.org/show_bug.cgi?id=191631
2406
2407         Reviewed by Xabier Rodriguez-Calvar.
2408
2409         This will be tested once webkit.org/b/186933 is implemented.
2410
2411         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
2412         (WebCore::RealtimeIncomingAudioSourceLibWebRTC::OnData):
2413         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
2414         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
2415
2416 2018-11-15  Antti Koivisto  <antti@apple.com>
2417
2418         REGRESSION(r238178): fast/forms/access-key-mutated.html and fast/forms/access-key-case-insensitive.html are timing out
2419         https://bugs.webkit.org/show_bug.cgi?id=191642
2420
2421         Reviewed by Zalan Bujtas.
2422
2423         Invalidate access key map even when thorttling style recalcs.
2424
2425         * dom/Document.cpp:
2426         (WebCore::Document::scheduleStyleRecalc):
2427
2428 2018-11-15  Antti Koivisto  <antti@apple.com>
2429
2430         Remove fonts from CSSFontFaceSet safely
2431         https://bugs.webkit.org/show_bug.cgi?id=191676
2432
2433         Reviewed by Zalan Bujtas.
2434
2435         Test: fast/text/font-face-set-remove-safely.html
2436
2437         * css/CSSFontFaceSet.cpp:
2438         (WebCore::CSSFontFaceSet::remove):
2439
2440 2018-11-15  Manuel Rego Casasnovas  <rego@igalia.com>
2441
2442         [css-grid] Consider scrollbars in populateGridPositionsForDirection()
2443         https://bugs.webkit.org/show_bug.cgi?id=191656
2444
2445         Reviewed by Javier Fernandez.
2446
2447         We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(),
2448         that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction)
2449         but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction).
2450
2451         The patch modifies the method so it takes into account scrollbar size
2452         in order to compute the position of the columns/rows depending on the direction and the writing mode.
2453
2454         Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html
2455                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html
2456                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html
2457
2458         * rendering/RenderGrid.cpp:
2459         (WebCore::RenderGrid::populateGridPositionsForDirection):
2460
2461 2018-11-14  Keith Rollin  <krollin@apple.com>
2462
2463         Move scripts for Derived and Unified Sources to external files
2464         https://bugs.webkit.org/show_bug.cgi?id=191670
2465         <rdar://problem/46082278>
2466
2467         Reviewed by Keith Miller.
2468
2469         Move the scripts in the Generate Derived Sources and Generate Unified
2470         Sources Run Script phases from the Xcode projects to external shell
2471         script files. Then invoke those scripts from the Run Script phases.
2472         This refactoring is being performed to support later work that will
2473         invoke these scripts in other contexts.
2474
2475         The scripts were maintained as-is when making the move. I did a little
2476         reformatting and added 'set -e' to the top of each file, but that's
2477         it.
2478
2479         No new tests -- no changed functionality.
2480
2481         * Scripts/generate-derived-sources.sh: Added.
2482         * Scripts/generate-unified-sources.sh: Added.
2483         * WebCore.xcodeproj/project.pbxproj:
2484
2485 2018-11-14  Keith Rollin  <krollin@apple.com>
2486
2487         Fix #end vs. #endif typo.
2488         https://bugs.webkit.org/show_bug.cgi?id=191668
2489         <rdar://problem/46081704>
2490
2491         Reviewed by Alexey Proskuryakov.
2492
2493         Source/WebCore/SourcesCocoa.txt had a #end that should have been a
2494         #endif. Fix this, an add a check to generate-unified-source-bundles.rb
2495         to detect similar typos.
2496
2497         No new tests -- no changed functionality.
2498
2499         * SourcesCocoa.txt:
2500
2501 2018-11-14  Keith Rollin  <krollin@apple.com>
2502
2503         Remove VideoFullscreenLayerManager.mm from WebCore/SourcesCocoa.txt
2504         https://bugs.webkit.org/show_bug.cgi?id=191667
2505         <rdar://problem/46081286>
2506
2507         Reviewed by Eric Carlson.
2508
2509         VideoFullscreenLayerManager.mm no longer exists.
2510
2511         No new tests -- No changed functionality.
2512
2513         * SourcesCocoa.txt:
2514
2515 2018-11-14  Timothy Hatcher  <timothy@apple.com>
2516
2517         Enabled dark mode CSS support by default.
2518         https://bugs.webkit.org/show_bug.cgi?id=191609
2519         rdar://problem/46046861
2520
2521         Reviewed by Megan Gardner.
2522
2523         * page/RuntimeEnabledFeatures.h: Set m_isDarkModeCSSEnabled to true.
2524
2525 2018-11-14  Timothy Hatcher  <timothy@apple.com>
2526
2527         Default the view background color and text color to different values when in dark mode.
2528         https://bugs.webkit.org/show_bug.cgi?id=191607
2529         rdar://problem/46045854
2530
2531         Reviewed by Dean Jackson.
2532
2533         Test: css-dark-mode/default-colors.html
2534
2535         * css/html.css:
2536         (html): Set color: text on macOS.
2537         * dom/Document.cpp:
2538         (WebCore::Document::processSupportedColorSchemes): Call recalculateBaseBackgroundColor().
2539         * editing/EditingStyle.cpp:
2540         (WebCore::caretColorFromStyle): Added.
2541         (WebCore::EditingStyle::prepareToApplyAt): Use equalIgnoringSemanticColor. Check for
2542         caret-color directly since removeEquivalentProperties fails with semantic colors.
2543         (WebCore::extractPropertiesNotIn): Use equalIgnoringSemanticColor. Check for caret-color
2544         directly since removeEquivalentProperties fails with semantic colors.
2545         * page/Frame.cpp:
2546         (WebCore::Frame::createView): Drop backgroundColor.
2547         * page/Frame.h:
2548         * page/FrameView.cpp:
2549         (WebCore::FrameView::recalculateBaseBackgroundColor): Added.
2550         (WebCore::FrameView::updateBackgroundRecursively): Drop backgroundColor argument.
2551         Calculate the backgroundColor based on the transparent argument only.
2552         * page/FrameView.h:
2553         * platform/graphics/Color.h:
2554         (WebCore::equalIgnoringSemanticColor): Added for EditingStyle.
2555         * rendering/RenderBox.cpp:
2556         (WebCore::RenderBox::styleDidChange): Call recalculateBaseBackgroundColor().
2557         * rendering/RenderLayerBacking.cpp:
2558         (WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const): Use isWhiteColor()
2559         since it ignores the semantic color flag.
2560         * testing/Internals.cpp:
2561         (WebCore::Internals::setViewIsTransparent): Drop backgroundColor.
2562         (WebCore::Internals::viewBaseBackgroundColor): Added.
2563         * testing/Internals.h:
2564         * testing/Internals.idl: Added viewBaseBackgroundColor.
2565
2566 2018-11-14  Justin Fan  <justin_fan@apple.com>
2567
2568         [WebGPU] Code quality concerns raised for 191291: [WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain
2569         https://bugs.webkit.org/show_bug.cgi?id=191383
2570
2571         Reviewed by Dean Jackson.
2572
2573         Covered by existing WebGPU tests introduced in original patch.
2574
2575         * Modules/webgpu/GPUDevice.h:
2576         * Modules/webgpu/GPUPipelineStageDescriptor.h:
2577         * Modules/webgpu/GPURenderPipelineDescriptor.h: Now a base struct with a guaranteed vertex stage member.
2578         (): Refactored into enum class.
2579         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Removed in favor of init-list construction.
2580         (WebCore::GPURenderPipelineDescriptor::primitiveTopology): Now a proper enum class member.
2581         * Modules/webgpu/GPUShaderModule.h:
2582         * Modules/webgpu/WebGPUDevice.cpp:
2583         (WebCore::WebGPUDevice::createRenderPipeline const):
2584         * Modules/webgpu/WebGPUShaderModule.h:
2585         (WebCore::WebGPUShaderModule::module const):
2586         * Modules/webgpu/WebGPUShaderStage.h: Replaced enum with constants to better reflect IDL.
2587         * Modules/webgpu/cocoa/GPURenderPipeline.h:
2588         * Modules/webgpu/cocoa/GPURenderPipelineMetal.mm:
2589         (WebCore::setFunctionsForPipelineDescriptor):
2590         (WebCore::GPURenderPipeline::create):
2591         * Modules/webgpu/cocoa/GPUSwapChain.h:
2592         * WebCore.xcodeproj/project.pbxproj: Removed GPUPipelineDescriptorBase.
2593
2594 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
2595
2596         Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
2597         https://bugs.webkit.org/show_bug.cgi?id=191612
2598
2599         Reviewed by Matt Baker.
2600
2601         * inspector/InspectorController.cpp:
2602         (WebCore::InspectorController::connectFrontend):
2603         (WebCore::InspectorController::disconnectFrontend):
2604         (WebCore::InspectorController::show):
2605         * inspector/InspectorController.h:
2606         * inspector/WorkerInspectorController.cpp:
2607         (WebCore::WorkerInspectorController::connectFrontend):
2608         (WebCore::WorkerInspectorController::disconnectFrontend):
2609         * page/PageDebuggable.cpp:
2610         (WebCore::PageDebuggable::connect):
2611         (WebCore::PageDebuggable::disconnect):
2612         * page/PageDebuggable.h:
2613         * testing/Internals.cpp:
2614         (WebCore::InspectorStubFrontend::InspectorStubFrontend):
2615         (WebCore::InspectorStubFrontend::closeWindow):
2616         * workers/service/context/ServiceWorkerDebuggable.cpp:
2617         (WebCore::ServiceWorkerDebuggable::connect):
2618         (WebCore::ServiceWorkerDebuggable::disconnect):
2619         * workers/service/context/ServiceWorkerDebuggable.h:
2620         * workers/service/context/ServiceWorkerInspectorProxy.cpp:
2621         (WebCore::ServiceWorkerInspectorProxy::connectToWorker):
2622         (WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker):
2623         * workers/service/context/ServiceWorkerInspectorProxy.h:
2624
2625 2018-11-14  Timothy Hatcher  <timothy@apple.com>
2626
2627         Update prefers-color-scheme media query matching based on GitHub issue #3278.
2628         https://bugs.webkit.org/show_bug.cgi?id=191654
2629         rdar://problem/46074307
2630
2631         Reviewed by Simon Fraser.
2632
2633         Test: css-dark-mode/prefers-color-scheme.html
2634
2635         * css/MediaQueryEvaluator.cpp:
2636         (WebCore::prefersColorSchemeEvaluate): Return true when there is no value. Return false
2637         for `no-preference` since there is no macOS option for no user preference.
2638         * css/MediaQueryExpression.cpp:
2639         (WebCore::isFeatureValidWithoutValue): Added prefers-color-scheme.
2640
2641 2018-11-14  Devin Rousso  <drousso@apple.com>
2642
2643         Web Inspector: Canvas: send a call stack with each action instead of an array of call frames
2644         https://bugs.webkit.org/show_bug.cgi?id=191628
2645
2646         Reviewed by Dean Jackson.
2647
2648         Updated existing test: inspector/model/recording.html
2649
2650         * inspector/InspectorCanvas.h:
2651         * inspector/InspectorCanvas.cpp:
2652         (WebCore::InspectorCanvas::indexForData):
2653         (WebCore::InspectorCanvas::buildInitialState):
2654         (WebCore::InspectorCanvas::buildAction):
2655         Drive-by: prevent de-duplicated objects from being destroyed while recording.
2656
2657 2018-11-14  Stephan Szabo  <stephan.szabo@sony.com>
2658
2659         [Win] Compile Service Worker support
2660         https://bugs.webkit.org/show_bug.cgi?id=191409
2661
2662         Reviewed by Youenn Fablet.
2663
2664         Fix compilation errors when ENABLE(SERVICE_WORKER)
2665         on Windows with clang-cl. Clang on dllexport
2666         platforms does not support specifying the
2667         dllexport on both a class and members of the class
2668         and unistd.h isn't provided but also appeared to
2669         not be used.
2670
2671         No new tests, should be covered by existing tests.
2672
2673         * workers/service/ServiceWorkerProvider.h:
2674         * workers/service/context/SWContextManager.cpp:
2675
2676 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
2677
2678         Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Remote Inspector)
2679         https://bugs.webkit.org/show_bug.cgi?id=191494
2680         <rdar://problem/45469854>
2681
2682         Reviewed by Devin Rousso.
2683
2684         * inspector/InspectorClient.h:
2685         (WebCore::InspectorClient::allowRemoteInspectionToPageDirectly const):
2686         Provide a hook so that a client may wish to allow direct remote inspection of the Page.
2687         This is used by WebKitLegacy only.
2688
2689         * page/Page.cpp:
2690         (Page::Page):
2691         Only enable the PageDebuggable if the client wishes remote inspection of the Page directly.
2692         This is used by WebKitLegacy only.
2693
2694         * inspector/InspectorController.cpp:
2695         (WebCore::InspectorController::connectFrontend):
2696         * inspector/InspectorController.h:
2697         * page/PageDebuggable.cpp:
2698         (WebCore::PageDebuggable::connect):
2699         (WebCore::PageDebuggable::disconnect):
2700         * page/PageDebuggable.h:
2701         When a frontend connects, always enable the developer extras for the Page.
2702         This is pretty much only for the remote path, which allows inspection if developer
2703         extras were not already enabled (iOS). This simplifies the logic, and toggling
2704         developer extras after it was already enabled is not really important.
2705
2706 2018-11-14  Per Arne Vollan  <pvollan@apple.com>
2707
2708         REGRESSION (WEBPROCESS_WINDOWSERVER_BLOCKING): requestAnimationFrame Stops Completing
2709         https://bugs.webkit.org/show_bug.cgi?id=190884
2710
2711         Reviewed by Dean Jackson.
2712
2713         Only notify display refresh monitors with matching display ID.
2714
2715         Test: fast/animation/request-animation-frame-in-two-pages.html
2716
2717         * platform/graphics/DisplayRefreshMonitorManager.cpp:
2718         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
2719         * platform/graphics/DisplayRefreshMonitorManager.h:
2720
2721 2018-11-14  Youenn Fablet  <youenn@apple.com>
2722
2723         Convert libwebrtc error types to DOM exceptions
2724         https://bugs.webkit.org/show_bug.cgi?id=191590
2725
2726         Reviewed by Alex Christensen.
2727
2728         Make use of overloaded callback method that provides an error type.
2729         This type is then used to create a DOM exception with the correct type.
2730         Covered by existing tests.
2731
2732         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2733         (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
2734         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
2735         (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
2736         (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
2737         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2738         * Modules/mediastream/libwebrtc/LibWebRTCObservers.h:
2739         (WebCore::toExceptionCode):
2740
2741 2018-11-14  Youenn Fablet  <youenn@apple.com>
2742
2743         Allow to remove MediaStreamPrivate observers when iterating over observers
2744         https://bugs.webkit.org/show_bug.cgi?id=187256
2745
2746         Reviewed by Eric Carlson.
2747
2748         Migrate the observer list from a Vector to a HashSet.
2749         This is more robust to multiple observing and keeping of order of observers is not required.
2750         Copy the set of observers to a vector before iterating over it.
2751         This allows to remove an observer while iterating, which is now used in UserMediaRequest.
2752
2753         Covered by existing tests.
2754
2755         * Modules/mediastream/UserMediaRequest.cpp:
2756         (WebCore::UserMediaRequest::mediaStreamIsReady):
2757         * platform/mediastream/MediaStreamPrivate.cpp:
2758         (WebCore::MediaStreamPrivate::addObserver):
2759         (WebCore::MediaStreamPrivate::removeObserver):
2760         (WebCore::MediaStreamPrivate::forEachObserver const):
2761         (WebCore::MediaStreamPrivate::updateActiveState):
2762         (WebCore::MediaStreamPrivate::addTrack):
2763         (WebCore::MediaStreamPrivate::removeTrack):
2764         (WebCore::MediaStreamPrivate::characteristicsChanged):
2765         * platform/mediastream/MediaStreamPrivate.h:
2766
2767 2018-11-14  Youenn Fablet  <youenn@apple.com>
2768
2769         Calling removeTrack on different RTCPeerConnection should throw InvalidAccessError
2770         https://bugs.webkit.org/show_bug.cgi?id=191603
2771
2772         Reviewed by Chris Dumez.
2773
2774         Make sure to check that the sender peer connection backend is matching.
2775         Covered by rebased WPT test.
2776
2777         * Modules/mediastream/RTCPeerConnection.cpp:
2778         (WebCore::RTCPeerConnection::removeTrack):
2779         * Modules/mediastream/RTCRtpSender.cpp:
2780         (WebCore::RTCRtpSender::isCreatedBy const):
2781         * Modules/mediastream/RTCRtpSender.h:
2782
2783 2018-11-14  Fujii Hironori  <Hironori.Fujii@sony.com>
2784
2785         [curl] Unify CookieJarCurlDatabase and the abstract class CookieJarCurl
2786         https://bugs.webkit.org/show_bug.cgi?id=191620
2787
2788         Reviewed by Alex Christensen.
2789
2790         Remove a abstract class CookieJarCurl which is not needed anymore.
2791         And, rename CookieJarCurlDatabase to CookieJarCurl.
2792
2793         No new tests because there's no behaviour change in WebCore.
2794
2795         * platform/Curl.cmake: Replaced CookieJarCurlDatabase.cpp with CookieJarCurl.cpp.
2796         * platform/network/curl/CookieJarCurl.cpp: Renamed from Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp.
2797         * platform/network/curl/CookieJarCurl.h: Merged CookieJarCurl.h and CookieJarCurlDatabase.h.
2798         * platform/network/curl/CookieJarCurlDatabase.h: Removed.
2799         * platform/network/curl/NetworkStorageSessionCurl.cpp:
2800         (WebCore::NetworkStorageSession::NetworkStorageSession): Replaced CookieJarCurlDatabase with CookieJarCurl.
2801
2802 2018-11-14  Christopher Reid  <chris.reid@sony.com>
2803
2804         [WPE] Remove glib usage in PlatformKeyboardEventWPE.cpp
2805         https://bugs.webkit.org/show_bug.cgi?id=191606
2806
2807         Reviewed by Michael Catanzaro.
2808
2809         No behavior change.
2810
2811         Use StringBuilder::append(UChar32) as a generic way to convert a uint32_t code point to WTFString.
2812
2813         * platform/wpe/PlatformKeyboardEventWPE.cpp:
2814         (WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode):
2815         (WebCore::PlatformKeyboardEvent::singleCharacterString):
2816
2817 2018-11-13  Zalan Bujtas  <zalan@apple.com>
2818
2819         [LFC][IFC] Construct dedicated runs when the inline element requires it (part 2)
2820         https://bugs.webkit.org/show_bug.cgi?id=191623
2821
2822         Reviewed by Antti Koivisto.
2823
2824         This patch expands the breaking behaviour to support separate start/end breaks.
2825
2826         <span>parent </span><span style="padding: 10px;">start<span> middle </span>end</span><span> parent</span>
2827
2828         input to line breaking -> <parent start middle end parent>
2829         output of line breaking (considering infinite constraint) -> <parent start middle end parent>
2830         due to padding, final runs -> <parent><start middle end><parent>
2831
2832         "parent" -> n/a
2833         "start" -> BreakAtStart
2834         " middle " -> n/a
2835         "end" -> BreakAtEnd
2836         "parent" -> n/a
2837
2838         Another example:
2839         <span>parent </span><span style="padding-right: 10px;">start<span> middle </span>end</span><span> parent</span>
2840
2841         line breaking -> <parent start middle end parent>
2842         due to padding-right, final runs -> <parent start middle end><parent>
2843
2844         "parent" -> n/a
2845         "start" -> n/a
2846         " middle " -> n/a
2847         "end" -> BreakAtEnd
2848         "parent" -> n/a
2849
2850         * layout/inlineformatting/InlineFormattingContext.cpp:
2851         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2852         (WebCore::Layout::InlineFormattingContext::collectInlineContent const): Move to a recursive algorithm (which is fine, inline contents don't tend to be too deep)
2853         (WebCore::Layout::InlineFormattingContext::contentRequiresSeparateRun const): Deleted.
2854         * layout/inlineformatting/InlineFormattingContext.h:
2855         * layout/inlineformatting/InlineFormattingState.cpp:
2856         (WebCore::Layout::InlineFormattingState::detachingRules const):
2857         * layout/inlineformatting/InlineFormattingState.h:
2858         (WebCore::Layout::InlineFormattingState::lastInlineItem const):
2859         (WebCore::Layout::InlineFormattingState::addDetachingRule):
2860
2861 2018-11-14  Youenn Fablet  <youenn@apple.com>
2862
2863         Add support for RTCRtpCodecParameters.sdpFmtpLine
2864         https://bugs.webkit.org/show_bug.cgi?id=191591
2865
2866         Reviewed by Eric Carlson.
2867
2868         Covered by rebased test.
2869
2870         * Modules/mediastream/RTCRtpCodecParameters.h:
2871         * Modules/mediastream/RTCRtpCodecParameters.idl:
2872         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
2873         (WebCore::toRTCCodecParameters):
2874
2875 2018-11-14  Youenn Fablet  <youenn@apple.com>
2876
2877         Add support for transport and peerConnection stats
2878         https://bugs.webkit.org/show_bug.cgi?id=191592
2879
2880         Reviewed by Alex Christensen.
2881
2882         Covered by rebased tests.
2883
2884         * Modules/mediastream/RTCStatsReport.h:
2885         (WebCore::RTCStatsReport::TransportStats::TransportStats):
2886         (WebCore::RTCStatsReport::PeerConnectionStats::PeerConnectionStats):
2887         * Modules/mediastream/RTCStatsReport.idl:
2888         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
2889         (WebCore::fillRTCTransportStats):
2890         (WebCore::fillRTCPeerConnectionStats):
2891         (WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
2892
2893 2018-11-14  Ali Juma  <ajuma@chromium.org>
2894
2895         Transform of composited layer not updated when layer also needs repaint
2896         https://bugs.webkit.org/show_bug.cgi?id=191598
2897
2898         Reviewed by Simon Fraser.
2899
2900         Trigger a compositing geometry update whenever a RenderLayer's transform changes,
2901         even when other parts of its style have changed in a way that produces a
2902         StyleDifference greater than RecompositeLayer.
2903
2904         Test: compositing/geometry/transform-and-repaint-updates-geometry.html
2905
2906         * rendering/RenderLayerCompositor.cpp:
2907         (WebCore::RenderLayerCompositor::layerStyleChanged):
2908
2909 2018-11-13  Jiewen Tan  <jiewen_tan@apple.com>
2910
2911         [WebAuthN] Support CTAP HID authenticators on macOS
2912         https://bugs.webkit.org/show_bug.cgi?id=188623
2913         <rdar://problem/43353777>
2914
2915         Reviewed by Brent Fulgham and Chris Dumez.
2916
2917         This patch removes AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient to ignore
2918         any incompleted CompletionHandlers as calling them in destructors could cause unexpected cyclic
2919         dependency. Also, it adds a hack to temporarily deal with nullable userhandle.
2920
2921         Tests: http/wpt/webauthn/ctap-hid-failure.https.html
2922                http/wpt/webauthn/ctap-hid-success.https.html
2923                http/wpt/webauthn/public-key-credential-create-failure-hid-silent.https.html
2924                http/wpt/webauthn/public-key-credential-create-failure-hid.https.html
2925                http/wpt/webauthn/public-key-credential-create-success-hid.https.html
2926                http/wpt/webauthn/public-key-credential-get-failure-hid-silent.https.html
2927                http/wpt/webauthn/public-key-credential-get-failure-hid.https.html
2928                http/wpt/webauthn/public-key-credential-get-success-hid.https.html
2929
2930         * Modules/webauthn/AuthenticatorCoordinatorClient.cpp:
2931         (WebCore::AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient): Deleted.
2932         * Modules/webauthn/AuthenticatorCoordinatorClient.h:
2933         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
2934         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
2935         (fido::readCTAPGetAssertionResponse):
2936         * Modules/webauthn/fido/FidoConstants.h:
2937
2938 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
2939
2940         [WebRTC] Provide default implementation of LibWebRTCProvider
2941         https://bugs.webkit.org/show_bug.cgi?id=191611
2942
2943         Reviewed by Michael Catanzaro.
2944
2945         Refactor LibWebRTCProvider such that platform-specific implementations need not worry about specifying defaults.
2946
2947         * PlatformWin.cmake:
2948         * platform/GStreamer.cmake:
2949         * platform/SourcesGLib.txt:
2950         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2951         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
2952         * platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.cpp: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp.
2953         * platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.h: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h.
2954         * platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp: Removed.
2955
2956 2018-11-13  Timothy Hatcher  <timothy@apple.com>
2957
2958         Use a light scrollbar for transparent web views in dark mode.
2959         https://bugs.webkit.org/show_bug.cgi?id=191559
2960         rdar://problem/46000489
2961
2962         Reviewed by Dean Jackson.
2963
2964         Test: css-dark-mode/supported-color-schemes-scrollbar.html
2965
2966         * css/CSSProperties.json: Marked supported-color-schemes as a custom Value.
2967         * css/StyleBuilderCustom.h:
2968         (WebCore::StyleBuilderCustom::applyValueSupportedColorSchemes):
2969         * editing/cocoa/WebContentReaderCocoa.mm: Use FrameView's useDarkAppearance().
2970         (WebCore::createFragment):
2971         * inspector/InspectorOverlay.cpp:
2972         (WebCore::InspectorOverlay::paint): Use FrameView's useDarkAppearance().
2973         * page/FrameView.cpp:
2974         (WebCore::FrameView::recalculateScrollbarOverlayStyle): Use a light scrollbar for
2975         transparent web views in dark mode.
2976         (WebCore::FrameView::rendererForSupportedColorSchemes const): Added.
2977         Return the body for document element renderer.
2978         (WebCore::FrameView::useDarkAppearance const): Use rendererForSupportedColorSchemes.
2979         (WebCore::FrameView::styleColorOptions const): Added. Ditto.
2980         * page/FrameView.h:
2981         * rendering/style/RenderStyle.cpp:
2982         (WebCore::rareInheritedDataChangeRequiresRepaint): Drive-by fix. Added supportedColorSchemes.
2983         * rendering/style/RenderStyle.h:
2984         (WebCore::RenderStyle::setHasExplicitlySetSupportedColorSchemes): Added.
2985         (WebCore::RenderStyle::hasExplicitlySetSupportedColorSchemes const): Added.
2986         (WebCore::RenderStyle::NonInheritedFlags::operator== const): Added supportedColorSchemes.
2987         * svg/graphics/SVGImage.cpp:
2988         (WebCore::SVGImage::draw): Use FrameView's useDarkAppearance().
2989         * testing/Internals.cpp:
2990         (WebCore::Internals::setViewIsTransparent): Added.
2991         (WebCore::Internals::scrollbarOverlayStyle const): Added.
2992         * testing/Internals.h:
2993         * testing/Internals.idl: Added setViewIsTransparent and scrollbarOverlayStyle.
2994
2995 2018-11-13  Ross Kirsling  <ross.kirsling@sony.com>
2996
2997         [AppleWin] Unreviewed build fix after r238108.
2998
2999         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
3000         (printLayer):
3001         (PlatformCALayerWin::embeddedViewID const):
3002         * platform/graphics/ca/win/PlatformCALayerWin.h:
3003
3004 2018-11-13  Youenn Fablet  <youenn@apple.com>
3005
3006         RTCPeerConnection.getTransceivers is not always exposing all transceivers
3007         https://bugs.webkit.org/show_bug.cgi?id=191589
3008
3009         Reviewed by Eric Carlson.
3010
3011         Implement the collect transceiver algorithm using libwebrtc backend.
3012         Call this algorithm everytime transceivers are retrieved from JS.
3013         For Plan B, make this a no-op as this is not supported.
3014         Introduce senders/receivers/transceivers getters where we just look at already created transceivers.
3015
3016         Covered by existing and rebased tests.
3017
3018         * Modules/mediastream/PeerConnectionBackend.h:
3019         (WebCore::PeerConnectionBackend::collectTransceivers):
3020         * Modules/mediastream/RTCPeerConnection.cpp:
3021         (WebCore::RTCPeerConnection::getSenders const):
3022         (WebCore::RTCPeerConnection::getReceivers const):
3023         (WebCore::RTCPeerConnection::getTransceivers const):
3024         * Modules/mediastream/RTCPeerConnection.h:
3025         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3026         (WebCore::LibWebRTCMediaEndpoint::collectTransceivers):
3027         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3028         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3029         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
3030         (WebCore::LibWebRTCPeerConnectionBackend::existingTransceiver):
3031         (WebCore::LibWebRTCPeerConnectionBackend::collectTransceivers):
3032         (WebCore::LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources):
3033         (WebCore::LibWebRTCPeerConnectionBackend::shouldOfferAllowToReceive const):
3034         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
3035
3036 2018-11-13  Wenson Hsieh  <wenson_hsieh@apple.com>
3037
3038         [iOS] Do not show selection UI for editable elements with opacity near zero
3039         https://bugs.webkit.org/show_bug.cgi?id=191442
3040         <rdar://problem/45958625>
3041
3042         Reviewed by Simon Fraser.
3043
3044         Tests: editing/selection/ios/do-not-zoom-to-focused-hidden-contenteditable.html
3045                editing/selection/ios/hide-selection-after-hiding-contenteditable.html
3046                editing/selection/ios/hide-selection-in-contenteditable-nested-transparency.html
3047                editing/selection/ios/hide-selection-in-hidden-contenteditable-frame.html
3048                editing/selection/ios/hide-selection-in-hidden-contenteditable.html
3049
3050         * rendering/RenderObject.cpp:
3051         (WebCore::RenderObject::isTransparentRespectingParentFrames const):
3052
3053         Add a helper function to determine whether a RenderObject is contained within a transparent layer, taking parent
3054         frames into account. A layer is considered transparent if its opacity is less than a small threshold (i.e. 0.01).
3055         Opacity on ancestor elements is applied multiplicatively.
3056
3057         * rendering/RenderObject.h:
3058
3059 2018-11-13  Eric Carlson  <eric.carlson@apple.com>
3060
3061         [MediaStream] Observer AVCaptureDevice "suspended" property
3062         https://bugs.webkit.org/show_bug.cgi?id=191587
3063         <rdar://problem/46030598>
3064
3065         Reviewed by Youenn Fablet.
3066
3067         No new tests, AVCapture can only be tested manually.
3068
3069         * platform/mediastream/mac/AVCaptureDeviceManager.h:
3070         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
3071         (WebCore::AVCaptureDeviceManager::captureDevicesInternal): Don't notify of devices "changes"
3072         the first time the device list is scanned.
3073         (WebCore::deviceIsAvailable): Don't check for "isInUseByAnotherApplication", it doesn't
3074         change device availability.
3075         (WebCore::AVCaptureDeviceManager::beginObservingDevices): New, observe "suspended" on all 
3076         devices and add them to the cached list.
3077         (WebCore::AVCaptureDeviceManager::stopObservingDevices): New, opposite of above.
3078         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices): Watch for changes in the list of
3079         devices.
3080         (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager): Stop observing all cached devices.
3081         (WebCore::AVCaptureDeviceManager::registerForDeviceNotifications):
3082         (-[WebCoreAVCaptureDeviceManagerObserver disconnect]):
3083         (-[WebCoreAVCaptureDeviceManagerObserver deviceConnectedDidChange:]):
3084         (-[WebCoreAVCaptureDeviceManagerObserver observeValueForKeyPath:ofObject:change:context:]):
3085         (WebCore::AVCaptureDeviceManager::refreshAVCaptureDevicesOfType): Deleted.
3086         (WebCore::AVCaptureDeviceManager::deviceConnected): Deleted.
3087         (WebCore::AVCaptureDeviceManager::deviceDisconnected): Deleted.
3088         (-[WebCoreAVCaptureDeviceManagerObserver deviceDisconnected:]): Deleted.
3089         (-[WebCoreAVCaptureDeviceManagerObserver deviceConnected:]): Deleted.
3090
3091         * platform/mediastream/mac/AVVideoCaptureSource.h:
3092         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3093         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): Stop observing "running" (not "rate")
3094         and "suspended".
3095         (WebCore::AVVideoCaptureSource::setupSession): Observe "running" (not "rate"), and "suspended".
3096         (WebCore::AVVideoCaptureSource::captureDeviceSuspendedDidChange):
3097         (-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]):
3098
3099 2018-11-13  Devin Rousso  <drousso@apple.com>
3100
3101         Web Inspector: REGRESSION(r238122): fetching the CertificateInfo triggers an ASSERT in workers
3102         https://bugs.webkit.org/show_bug.cgi?id=191597
3103
3104         Reviewed by Joseph Pecoraro.
3105
3106         When WebInspector is open, the `CertificateInfo` for every `ResourceResponse` is now fetched,
3107         meaning that we may try to fetch in situations previously unexpected.
3108
3109         * platform/network/cocoa/ResourceResponseCocoa.mm:
3110         (WebCore::ResourceResponse::platformCertificateInfo const):
3111
3112 2018-11-13  Timothy Hatcher  <timothy@apple.com>
3113
3114         Treat supported-color-schemes as the second highest priority property.
3115         https://bugs.webkit.org/show_bug.cgi?id=191556
3116         rdar://problem/46000076
3117
3118         Reviewed by Dean Jackson.
3119
3120         Test: css-dark-mode/supported-color-schemes-priority.html
3121
3122         * css/CSSProperties.json: Make supported-color-schemes high-priority and add a comment.
3123         * css/StyleResolver.cpp:
3124         (WebCore::StyleResolver::applyMatchedProperties): Manually handle supported-color-schemes
3125         after -webkit-ruby-position, before other properties, so it can affect resolved colors.
3126
3127 2018-11-13  Charlie Turner  <cturner@igalia.com>
3128
3129         [EME][GStreamer] Make CDMInstance's available in decryptors, and factor out some EME utility classes.
3130         https://bugs.webkit.org/show_bug.cgi?id=191316
3131
3132         Reviewed by Xabier Rodriguez-Calvar.
3133
3134         Another preparation in patch getting ready to move the decryption
3135         logic behind the CDMInstance and out of the GStreamer decryptors
3136         themselves. The first step taken here is to arrange for the
3137         instances to always be available in the decryptors when they need
3138         to decrypt content.
3139
3140         In doing so, there were a number of hairy bits of code that could
3141         use some abstraction, so the opportunity was taken to do that as
3142         well.
3143
3144         Covered by tests in media/encrypted-media and
3145         imported/w3c/web-platform-tests/encrypted-media.
3146
3147         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3148         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Remove
3149         drm-key-needed since it was not being used anywhere.
3150         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3151         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
3152         Factor out the parsing of decryption system information from
3153         GStreamer, since it was not clear what that code was doing unless
3154         you squinted pretty hard. Also remove the duplicated
3155         initialization-data-encountered posting.
3156         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
3157         Refactored to make it a more general method and usable in more
3158         situations. It now has an optional to stop it from eliding init
3159         datas for a different key system. This is required the first time
3160         we post them, since if a CDM instance has already been set, and if
3161         the stream init datas are for different systems, we ended up never
3162         posting an encrypted event.
3163         (WebCore::MediaPlayerPrivateGStreamerBase::attemptToDecryptWithLocalInstance):
3164         Actually send a CDMInstance now when in regular playback mode.
3165         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
3166         Remove m_needToSendCredentials, it was not being used.
3167         (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
3168         Refactored to use the new initializationDataEncountered.
3169         (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey):
3170         Log the waiting state, since it was currently not clear what that
3171         logging message was even telling you!
3172         (WebCore::extractEventsAndSystemsFromMessage): Deleted.
3173         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3174         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
3175         (WebCore::InitData::InitData): New class that encapsulates both
3176         single instantiation and streaming instantiation.
3177         (WebCore::InitData::append): Used for the streaming mode, when you
3178         are concatenating init datas together.
3179         (WebCore::InitData::payload const):
3180         (WebCore::InitData::systemId const):
3181         (WebCore::InitData::payloadContainerType const):
3182         (WebCore::InitData::isFromDifferentContainer):
3183         (WebCore::ProtectionSystemEvents::ProtectionSystemEvents):
3184         (WebCore::ProtectionSystemEvents::events const):
3185         (WebCore::ProtectionSystemEvents::availableSystems const):
3186         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
3187         (webkitMediaCommonEncryptionDecryptTransformInPlace): If you post
3188         waiting-for-key after requesting a CDM instance, it will flap back
3189         to not waiting for a key almost immediately, didn't make sense
3190         positing after requesting an instance. Also post key-received when
3191         we receive the key.
3192         (webkitMediaCommonEncryptionDecryptSinkEventHandler): It has now
3193         been arranged that a CDMInstance will always be present in an OOB
3194         message, so parse it out here.
3195         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
3196         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
3197         As above, make sure when posting the OOB that a CDMInstance is present.
3198
3199 2018-11-13  Charlie Turner  <cturner@igalia.com>
3200
3201         Various compiler warnings/errors fixes.
3202         https://bugs.webkit.org/show_bug.cgi?id=191583
3203
3204         Reviewed by Frédéric Wang.
3205
3206         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3207         (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
3208         ASSERT is only compiled in DEBUG mode, so guarding with
3209         !LOG_DISABLED is wrong.
3210         * rendering/RenderLayerCompositor.cpp:
3211         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3212         showPaintOrderTree is only compiled in ENABLE(TREE_DEBUGGING)
3213         mode, so guarding with !LOG_DISABLED was wrong.
3214         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3215         Ditto, this time with member .depth.
3216         (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): Ditto.
3217         * rendering/svg/SVGRenderSupport.cpp:
3218         (WebCore::SVGRenderSupport::styleChanged): Add another unused
3219         parameter.
3220
3221 2018-11-12  Antoine Quint  <graouts@apple.com>
3222
3223         [Web Animations] Don't schedule animation frames or update style while an accelerated animation is running
3224         https://bugs.webkit.org/show_bug.cgi?id=191542
3225         <rdar://problem/45356027>
3226
3227         Reviewed by Simon Fraser.
3228
3229         Test: animations/no-style-recalc-during-accelerated-animation.html
3230
3231         In order to be more power-efficient, we stop scheduling calls to updateAnimationsAndSendEvents() when running only accelerated
3232         animations. To do that, we prevent scheduling further animation resolution if we're in the process of updating animations, and
3233         when we are done, call the new DocumentTimeline::scheduleNextTick() method that will check whether we have only accelerated
3234         animations running, and in that case check which of those animations needs an update the soonest and starts a timer scheduled
3235         for that time when we'll schedule animation resolution.
3236
3237         By default, animations compute the time until their natural completion but in the case of CSS Animations, we want to make sure
3238         we also update animations in-flight to dispatch "animationiteration" events.
3239
3240         * animation/AnimationEffect.h: Make the simpleIterationProgress() public so it can be called by WebAnimation::timeToNextTick().
3241         * animation/DocumentTimeline.cpp:
3242         (WebCore::DocumentTimeline::DocumentTimeline): Create the m_tickScheduleTimer and set it up to call scheduleAnimationResolutionIfNeeded().
3243         (WebCore::DocumentTimeline::suspendAnimations): If we don't already have a cached current time, cache the current time.
3244         (WebCore::DocumentTimeline::resumeAnimations): Reset the cached current time to ensure we'll get a fresh one when updating animations next.
3245         (WebCore::DocumentTimeline::liveCurrentTime const): Factor the code to compute the current time out of currentTime() so that we can
3246         cache the current time in suspendAnimations() without also automatically clearing the current time.
3247         (WebCore::DocumentTimeline::currentTime): Use liveCurrentTime() and cacheCurrentTime() since much of the code from this function has been
3248         factored out into those. Additionally, we were failing to clear the current time if called inside an animation frame, which we now do correctly
3249         by virtue of using cacheCurrentTime(). This fixes some flakiness.
3250         (WebCore::DocumentTimeline::cacheCurrentTime): Factor the code to cache the current time out of currentTime(). 
3251         (WebCore::DocumentTimeline::maybeClearCachedCurrentTime): No need to clear the current time if we get suspended.
3252         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Prevent scheduling an animation update if we're in the middle of one already,
3253         scheduleNextTick() will be called after animations are updated to see if we should schedule an animation update instead.
3254         (WebCore::DocumentTimeline::unscheduleAnimationResolution): Cancel the m_tickScheduleTimer if we need to unschedule animation resolution.
3255         (WebCore::DocumentTimeline::animationResolutionTimerFired): Factor the call to applyPendingAcceleratedAnimations() out of updateAnimationsAndSendEvents()
3256         and call scheduleNextTick().
3257         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Set the new m_isUpdatingAnimations member variable to true while this function is running.
3258         (WebCore::DocumentTimeline::scheduleNextTick): Schedule an animation update immediately if we have any relevant animation that is not accelerated.
3259         Otherwise, iterate through all animations to figure out the earliest moment at which we need to update animations.
3260         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): Use the new WebAnimation::isRunningAccelerated() function.
3261         * animation/DocumentTimeline.h:
3262         * animation/WebAnimation.cpp:
3263         (WebCore::WebAnimation::isRunningAccelerated const): Since we end up checking if an animation is running with an accelerated effect, we introduce a new
3264         function to get that information directly through the WebAnimation object without bothering about its effect.
3265         (WebCore::WebAnimation::resolve): We should only call updateFinishedState() here since timingDidChange() would also notify the timeline about a potential
3266         change in relevance, which is not necessary and which would schedule an animation frame even for animations that are accelerated.
3267         (WebCore::WebAnimation::timeToNextTick const): Compute the time until our animation completion or, in the case of CSS animations, the next iteration.
3268         * animation/WebAnimation.h:
3269
3270 2018-11-13  Miguel Gomez  <magomez@igalia.com>
3271
3272         [GTK][WPE] Incorrect tile coverage when resizing a layer out of the visible area
3273         https://bugs.webkit.org/show_bug.cgi?id=191545
3274
3275         Reviewed by Žan Doberšek.
3276
3277         Keep track of layer size changes even if they happen when the layer is not in the visible
3278         area, so we can update edge tiles when the layer gets visible.
3279
3280         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
3281         (WebCore::TiledBackingStore::createTiles):
3282         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
3283
3284 2018-11-12  Rob Buis  <rbuis@igalia.com>
3285
3286         Content-Type parameter values should allow empty quoted strings
3287         https://bugs.webkit.org/show_bug.cgi?id=191388
3288
3289         Reviewed by Dean Jackson.
3290
3291         According to RFC 2045 and https://mimesniff.spec.whatwg.org/#parsing-a-mime-type empty
3292         quoted strings are acceptable for Content-Type parameter values. They
3293         are accepted by Firefox and Chrome implementations as well.
3294
3295         Test: web-platform-tests/xhr/overridemimetype-blob.html
3296
3297         * platform/network/ParsedContentType.cpp:
3298         (WebCore::parseToken):
3299         (WebCore::parseQuotedString):
3300         (WebCore::parseContentType):
3301         * platform/network/ParsedContentType.h:
3302
3303 2018-11-12  Christopher Reid  <chris.reid@sony.com>
3304
3305         [Curl] Reject entire cookie if the domain fails a tailmatch.
3306         https://bugs.webkit.org/show_bug.cgi?id=191406
3307
3308         Reviewed by Youenn Fablet.
3309
3310         Currently we don't put domain attribute of cookie when it fails a tailmatch. As Firefox
3311         and Chrome do, we are going to reject the entire cookie if the domain fails a tailmatch instead.
3312         Also cleanup Cookie database implementation to make them testable better.
3313
3314         Tests: TestWebKitAPI/Tests/WebCore/curl/Cookies.cpp
3315
3316         * platform/network/curl/CookieJarDB.cpp:
3317         (WebCore::CookieJarDB::canAcceptCookie): Added.
3318         (WebCore::CookieJarDB::setCookie):
3319         * platform/network/curl/CookieUtil.cpp:
3320         (WebCore::CookieUtil::parseCookieAttributes):
3321         (WebCore::CookieUtil::parseCookieHeader):
3322         * platform/network/curl/CookieUtil.h:
3323
3324 2018-11-12  Devin Rousso  <drousso@apple.com>
3325
3326         Web Inspector: Network: show secure certificate details per-request
3327         https://bugs.webkit.org/show_bug.cgi?id=191447
3328         <rdar://problem/30019476>
3329
3330         Reviewed by Joseph Pecoraro.
3331
3332         Test: http/tests/inspector/network/resource-response-security.html
3333
3334         * loader/ResourceLoader.h:
3335         (WebCore::ResourceLoader::shouldIncludeCertificateInfo const):
3336         * loader/ResourceLoader.cpp:
3337         (WebCore::ResourceLoader::shouldIncludeCertificateInfo const): Added.
3338         Always save certificate information when WebInspector is open.
3339
3340         * platform/network/CertificateInfoBase.h: Added.
3341         (WebCore::CertificateInfoBase::containsNonRootSHA1SignedCertificate const):
3342         (WebCore::CertificateInfoBase::summaryInfo const):
3343         (WebCore::CertificateInfoBase::isEmpty const):
3344         * platform/network/cf/CertificateInfo.h:
3345         (WebCore::CertificateInfo::summaryInfo const): Added.
3346         * platform/network/cf/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
3347         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
3348         (WebCore::CertificateInfo::summaryInfo const): Added.
3349         * platform/network/curl/CertificateInfo.h:
3350         (WebCore::CertificateInfo::summaryInfo const): Added.
3351         (WebCore::CertificateInfo::isEmpty const): Added.
3352         * platform/network/soup/CertificateInfo.h:
3353         (WebCore::CertificateInfo::summaryInfo const): Added.
3354         (WebCore::CertificateInfo::isEmpty const): Added.
3355         Create base class for `CertificateInfo` so that `InspectorNetworkAgent` doesn't need to have
3356         platform-specific code in its implementation.
3357
3358         * platform/network/cocoa/CertificateInfoCocoa.mm: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
3359         * platform/network/curl/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/curl/CertificateInfo.cpp.
3360         * platform/network/soup/CertificateInfoSoup.cpp: Renamed from Source/WebCore/platform/network/soup/CertificateInfo.cpp.
3361
3362         * inspector/NetworkResourcesData.h:
3363         (WebCore::NetworkResourcesData::ResourceData::certificateInfo const): Added.
3364         (WebCore::NetworkResourcesData::ResourceData::setCertificateInfo): Added.
3365         * inspector/NetworkResourcesData.cpp:
3366         (WebCore::NetworkResourcesData::responseReceived):
3367
3368         * inspector/agents/InspectorNetworkAgent.cpp:
3369         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
3370
3371         * PlatformAppleWin.cmake:
3372         * PlatformMac.cmake:
3373         * SourcesCocoa.txt:
3374         * WebCore.xcodeproj/project.pbxproj:
3375         * platform/Curl.cmake:
3376         * platform/SourcesSoup.txt: