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