1 2019-09-20 Antti Koivisto <antti@apple.com>
3 Implement Position::upstream and Position::downstream with line layout iterator
4 https://bugs.webkit.org/show_bug.cgi?id=202043
6 Reviewed by Zalan Bujtas.
8 These can eventually work without switching to lineboxes.
11 (WebCore::Position::upstream const):
12 (WebCore::Position::downstream const):
14 Factor the loops into TextBox::isLastOnLine function.
16 * rendering/line/LineLayoutInterfaceTextBoxes.cpp:
17 (WebCore::LineLayoutInterface::TextBox::isLastOnLine const):
19 Looking into root boxes is a much more efficient way to figure this out.
21 (WebCore::LineLayoutInterface::TextBox::isLast const):
22 (WebCore::LineLayoutInterface::TextBoxIterator::ComplexPath::nextInlineTextBoxInTextOrder const):
23 (WebCore::LineLayoutInterface::TextBoxIterator::traverseNextInTextOrder):
24 * rendering/line/LineLayoutInterfaceTextBoxes.h:
26 2019-09-20 Zalan Bujtas <zalan@apple.com>
28 [LFC] Introduce LayoutContext class
29 https://bugs.webkit.org/show_bug.cgi?id=202026
30 <rdar://problem/55546622>
32 Reviewed by Antti Koivisto.
34 Move context related functionality from LayoutState to LayoutContext.
35 To initiate a layout, create a LayoutContext, pass the current LayoutState object in and call layout().
38 * WebCore.xcodeproj/project.pbxproj:
39 * layout/FormattingContext.cpp:
40 (WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
41 * layout/FormattingContext.h:
42 * layout/FormattingContextGeometry.cpp:
43 (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
44 * layout/LayoutState.cpp:
45 (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded):
46 (WebCore::Layout::LayoutState::updateLayout): Deleted.
47 (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): Deleted.
48 (WebCore::Layout::LayoutState::styleChanged): Deleted.
49 (WebCore::Layout::LayoutState::markNeedsUpdate): Deleted.
50 (WebCore::Layout::LayoutState::createFormattingContext): Deleted.
51 (WebCore::Layout::LayoutState::run): Deleted.
52 * layout/LayoutState.h:
53 (WebCore::Layout::LayoutState::hasFormattingState const):
54 (WebCore::Layout::LayoutState::setQuirksMode):
55 (WebCore::Layout::LayoutState::inNoQuirksMode const):
56 (WebCore::Layout::LayoutState::updateAll): Deleted.
57 * layout/Verification.cpp:
58 (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree):
59 (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): Deleted.
60 * layout/blockformatting/BlockFormattingContext.cpp:
61 (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot):
62 * layout/blockformatting/BlockFormattingContextGeometry.cpp:
63 (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
64 * layout/blockformatting/BlockInvalidation.cpp:
65 (WebCore::Layout::computeUpdateType):
66 (WebCore::Layout::computeUpdateTypeForAncestor):
67 (WebCore::Layout::BlockInvalidation::invalidate):
68 * layout/blockformatting/BlockInvalidation.h:
69 * layout/displaytree/DisplayBox.h:
70 * layout/inlineformatting/InlineFormattingContext.cpp:
71 (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
72 (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
73 * layout/inlineformatting/InlineInvalidation.cpp:
74 (WebCore::Layout::InlineInvalidation::invalidate):
75 * layout/inlineformatting/InlineInvalidation.h:
76 * layout/layouttree/LayoutTreeBuilder.cpp:
77 (WebCore::Layout::printLayoutTreeForLiveDocuments):
78 * layout/tableformatting/TableFormattingContext.cpp:
79 (WebCore::Layout::TableFormattingContext::layoutTableCellBox):
80 (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
81 * layout/tableformatting/TableInvalidation.cpp:
82 (WebCore::Layout::TableInvalidation::invalidate):
83 * layout/tableformatting/TableInvalidation.h:
84 * page/FrameViewLayoutContext.cpp:
85 (WebCore::layoutUsingFormattingContext):
87 2019-09-19 Joonghun Park <pjh0718@gmail.com>
89 Unreviewed. Fix Build error below since r248879.
91 warning: unused variable ‘canvas’ [-Wunused-variable]
93 No new tests, no new behavioral changes.
95 * html/canvas/GPUBasedCanvasRenderingContext.cpp:
96 (WebCore::GPUBasedCanvasRenderingContext::notifyCanvasContentChanged):
98 2019-09-19 Devin Rousso <drousso@apple.com>
100 Web Inspector: Canvas: show WebGPU shader pipelines
101 https://bugs.webkit.org/show_bug.cgi?id=201675
103 Reviewed by Joseph Pecoraro.
105 Tests: inspector/canvas/requestShaderSource-webgpu.html
106 inspector/canvas/shaderProgram-add-remove-webgpu.html
107 inspector/canvas/updateShader-webgpu.html
109 Create common base classes for `WebGPUPipeline` and `GPUPipeline` so that Web Inspector can
110 instrument both render and compute shader pipelines.
112 Refactor `InspectorShaderProgram` to support both `WebGLProgram` and `WebGPUPipeline` so
113 that the same object can be used for all types of shader "program"s.
115 Keep a copy of each shader module's source, and allow the shader module to be updated.
117 * Modules/webgpu/WebGPUDevice.h:
118 * Modules/webgpu/WebGPUDevice.cpp:
119 (WebCore::WebGPUDevice::createShaderModule const):
120 (WebCore::WebGPUDevice::createRenderPipeline): Added.
121 (WebCore::WebGPUDevice::createComputePipeline): Added.
122 (WebCore::WebGPUDevice::createRenderPipeline const): Deleted.
123 (WebCore::WebGPUDevice::createComputePipeline const): Deleted.
125 * Modules/webgpu/WebGPUPipeline.h: Added.
126 (WebCore::WebGPUPipeline::isRenderPipeline const):
127 (WebCore::WebGPUPipeline::isComputePipeline const):
128 (WebCore::WebGPUPipeline::scriptExecutionContext const):
129 * Modules/webgpu/WebGPUPipeline.cpp: Added.
130 (WebCore::WebGPUPipeline::instancesMutex):
131 (WebCore::WebGPUPipeline::WebGPUPipeline):
132 (WebCore::WebGPUPipeline::~WebGPUPipeline):
133 * platform/graphics/gpu/GPUPipeline.cpp: Added.
134 * platform/graphics/gpu/GPUPipeline.h: Added.
135 (WebCore::GPUPipeline::isRenderPipeline const):
136 (WebCore::GPUPipeline::isComputePipeline const):
138 * Modules/webgpu/WebGPUComputePipeline.idl:
139 * Modules/webgpu/WebGPUComputePipeline.h:
140 (WebCore::WebGPUComputePipeline::computePipeline const): Deleted.
141 * Modules/webgpu/WebGPUComputePipeline.cpp:
142 (WebCore::WebGPUComputePipeline::create):
143 (WebCore::WebGPUComputePipeline::WebGPUComputePipeline):
144 (WebCore::WebGPUComputePipeline::recompile): Added.
145 * platform/graphics/gpu/GPUComputePipeline.h:
146 (WebCore::GPUComputePipeline::isComputePipeline): Added.
147 * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
148 (WebCore::GPUComputePipeline::tryCreate):
149 (WebCore::GPUComputePipeline::GPUComputePipeline):
150 (WebCore::GPUComputePipeline::recompile): Added.
152 * Modules/webgpu/WebGPURenderPipeline.idl:
153 * Modules/webgpu/WebGPURenderPipeline.h:
154 (WebCore::WebGPURenderPipeline::renderPipeline const): Deleted.
155 * Modules/webgpu/WebGPURenderPipeline.cpp:
156 (WebCore::WebGPURenderPipeline::create):
157 (WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
158 (WebCore::WebGPURenderPipeline::recompile): Added.
159 * platform/graphics/gpu/GPURenderPipeline.h:
160 (WebCore::GPURenderPipeline::isRenderPipeline): Added.
161 * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
162 (WebCore::tryCreateMtlRenderPipelineState):
163 (WebCore::GPURenderPipeline::tryCreate):
164 (WebCore::GPURenderPipeline::GPURenderPipeline):
165 (WebCore::GPURenderPipeline::recompile): Added.
167 * Modules/webgpu/WebGPUShaderModule.h:
168 (WebCore::WebGPUShaderModule::source const): Added.
169 * Modules/webgpu/WebGPUShaderModule.cpp:
170 (WebCore::WebGPUShaderModule::update): Added.
171 * Modules/webgpu/WebGPUProgrammableStageDescriptor.h:
172 * platform/graphics/gpu/GPUProgrammableStageDescriptor.h:
173 (WebCore::GPUProgrammableStageDescriptor::GPUProgrammableStageDescriptor):
175 * inspector/InspectorShaderProgram.h:
176 * inspector/InspectorShaderProgram.cpp:
177 (WebCore::InspectorShaderProgram::create):
178 (WebCore::InspectorShaderProgram::InspectorShaderProgram):
179 (WebCore::InspectorShaderProgram::program const): Added.
180 (WebCore::InspectorShaderProgram::pipeline const): Added.
181 (WebCore::shaderForType): Added.
182 (WebCore::InspectorShaderProgram::requestShaderSource): Added.
183 (WebCore::InspectorShaderProgram::updateShader): Added.
184 (WebCore::InspectorShaderProgram::context const): Deleted.
185 (WebCore::InspectorShaderProgram::shaderForType): Deleted.
187 * inspector/agents/InspectorCanvasAgent.h:
188 * inspector/agents/InspectorCanvasAgent.cpp:
189 (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
190 (WebCore::InspectorCanvasAgent::discardAgent):
191 (WebCore::InspectorCanvasAgent::enable):
192 (WebCore::InspectorCanvasAgent::disable):
193 (WebCore::InspectorCanvasAgent::requestShaderSource):
194 (WebCore::InspectorCanvasAgent::updateShader):
195 (WebCore::InspectorCanvasAgent::setShaderProgramDisabled):
196 (WebCore::InspectorCanvasAgent::setShaderProgramHighlighted):
197 (WebCore::InspectorCanvasAgent::frameNavigated):
198 (WebCore::InspectorCanvasAgent::didCreateWebGLProgram): Added.
199 (WebCore::InspectorCanvasAgent::willDestroyWebGLProgram): Added.
200 (WebCore::InspectorCanvasAgent::isWebGLProgramDisabled): Added.
201 (WebCore::InspectorCanvasAgent::isWebGLProgramHighlighted): Added.
202 (WebCore::InspectorCanvasAgent::didCreateWebGPUPipeline): Added.
203 (WebCore::InspectorCanvasAgent::willDestroyWebGPUPipeline): Added.
204 (WebCore::InspectorCanvasAgent::programDestroyedTimerFired): Added.
205 (WebCore::InspectorCanvasAgent::reset): Added.
206 (WebCore::InspectorCanvasAgent::unbindProgram):
207 (WebCore::InspectorCanvasAgent::findInspectorProgram):
208 (WebCore::InspectorCanvasAgent::didCreateProgram): Deleted.
209 (WebCore::InspectorCanvasAgent::willDeleteProgram): Deleted.
210 (WebCore::InspectorCanvasAgent::isShaderProgramDisabled): Deleted.
211 (WebCore::InspectorCanvasAgent::isShaderProgramHighlighted): Deleted.
212 (WebCore::InspectorCanvasAgent::clearCanvasData): Deleted.
213 * inspector/InspectorInstrumentation.h:
214 (WebCore::InspectorInstrumentation::didCreateWebGLProgram): Added.
215 (WebCore::InspectorInstrumentation::willDestroyWebGLProgram): Added.
216 (WebCore::InspectorInstrumentation::isWebGLProgramDisabled): Added.
217 (WebCore::InspectorInstrumentation::isWebGLProgramHighlighted): Added.
218 (WebCore::InspectorInstrumentation::didCreateWebGPUPipeline): Added.
219 (WebCore::InspectorInstrumentation::willDestroyWebGPUPipeline): Added.
220 (WebCore::InspectorInstrumentation::didCreateProgram): Deleted.
221 (WebCore::InspectorInstrumentation::willDeleteProgram): Deleted.
222 (WebCore::InspectorInstrumentation::isShaderProgramDisabled): Deleted.
223 (WebCore::InspectorInstrumentation::isShaderProgramHighlighted): Deleted.
224 * inspector/InspectorInstrumentation.cpp:
225 (WebCore::InspectorInstrumentation::didCreateWebGLProgramImpl): Added.
226 (WebCore::InspectorInstrumentation::willDestroyWebGLProgramImpl): Added.
227 (WebCore::InspectorInstrumentation::isWebGLProgramDisabledImpl): Added.
228 (WebCore::InspectorInstrumentation::isWebGLProgramHighlightedImpl): Added.
229 (WebCore::InspectorInstrumentation::didCreateWebGPUPipelineImpl): Added.
230 (WebCore::InspectorInstrumentation::willDestroyWebGPUPipelineImpl): Added.
231 (WebCore::InspectorInstrumentation::didCreateProgramImpl): Deleted.
232 (WebCore::InspectorInstrumentation::willDeleteProgramImpl): Deleted.
233 (WebCore::InspectorInstrumentation::isShaderProgramDisabledImpl): Deleted.
234 (WebCore::InspectorInstrumentation::isShaderProgramHighlightedImpl): Deleted.
236 * html/canvas/WebGLProgram.h:
237 * html/canvas/WebGLProgram.cpp:
238 (WebCore::WebGLProgram::WebGLProgram):
239 (WebCore::WebGLProgram::~WebGLProgram):
240 * html/canvas/WebGLRenderingContextBase.cpp:
241 (WebCore::InspectorScopedShaderProgramHighlight::showHightlight):
242 (WebCore::WebGLRenderingContextBase::createProgram):
243 (WebCore::WebGLRenderingContextBase::deleteProgram):
244 (WebCore::WebGLRenderingContextBase::drawArrays):
245 (WebCore::WebGLRenderingContextBase::drawElements):
246 Rename WebGL program instrumentation points to be less ambiguous.
249 * WebCore.xcodeproj/project.pbxproj:
251 2019-09-19 Chris Dumez <cdumez@apple.com>
253 WorkerGlobalScope does not need a SessionID
254 https://bugs.webkit.org/show_bug.cgi?id=201991
256 Reviewed by Alex Christensen.
258 WorkerGlobalScope does not need a SessionID, now that we have a single session
262 (WebCore::Document::resume):
263 (WebCore::Document::privateBrowsingStateDidChange):
265 * dom/ScriptExecutionContext.h:
266 * loader/DocumentLoader.cpp:
267 (WebCore::DocumentLoader::matchRegistration):
268 (WebCore::DocumentLoader::commitData):
269 (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
270 (WebCore::DocumentLoader::unregisterTemporaryServiceWorkerClient):
271 * testing/Internals.cpp:
272 (WebCore::Internals::serviceWorkerClientIdentifier const):
273 (WebCore::Internals::storeRegistrationsOnDisk):
274 (WebCore::Internals::hasServiceWorkerRegistration):
275 (WebCore::Internals::terminateServiceWorker):
276 (WebCore::Internals::hasServiceWorkerConnection):
277 * workers/DedicatedWorkerGlobalScope.cpp:
278 (WebCore::DedicatedWorkerGlobalScope::create):
279 (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
280 * workers/DedicatedWorkerGlobalScope.h:
281 * workers/DedicatedWorkerThread.cpp:
282 (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
283 (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
284 * workers/DedicatedWorkerThread.h:
285 * workers/Worker.cpp:
286 (WebCore::Worker::notifyFinished):
287 * workers/WorkerGlobalScope.cpp:
288 (WebCore::WorkerGlobalScope::WorkerGlobalScope):
289 * workers/WorkerGlobalScope.h:
290 * workers/WorkerGlobalScopeProxy.h:
291 * workers/WorkerMessagingProxy.cpp:
292 (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
293 * workers/WorkerMessagingProxy.h:
294 * workers/WorkerThread.cpp:
295 (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
296 (WebCore::WorkerThread::WorkerThread):
297 (WebCore::WorkerThread::workerThread):
298 * workers/WorkerThread.h:
299 * workers/service/ServiceWorker.cpp:
300 (WebCore::ServiceWorker::postMessage):
301 * workers/service/ServiceWorkerContainer.cpp:
302 (WebCore::mainThreadConnection):
303 (WebCore::ServiceWorkerContainer::addRegistration):
304 (WebCore::ServiceWorkerContainer::removeRegistration):
305 (WebCore::ServiceWorkerContainer::updateRegistration):
306 (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
307 (WebCore::ServiceWorkerContainer::notifyRegistrationIsSettled):
308 (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
309 (WebCore::ServiceWorkerContainer::notifyFailedFetchingScript):
310 (WebCore::ServiceWorkerContainer::ensureSWClientConnection):
311 * workers/service/ServiceWorkerGlobalScope.cpp:
312 (WebCore::ServiceWorkerGlobalScope::create):
313 (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
314 * workers/service/ServiceWorkerGlobalScope.h:
315 * workers/service/ServiceWorkerProvider.cpp:
316 (WebCore::ServiceWorkerProvider::mayHaveServiceWorkerRegisteredForOrigin):
317 (WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
318 * workers/service/ServiceWorkerProvider.h:
319 * workers/service/WorkerSWClientConnection.cpp:
320 (WebCore::WorkerSWClientConnection::WorkerSWClientConnection):
321 (WebCore::WorkerSWClientConnection::matchRegistration):
322 (WebCore::WorkerSWClientConnection::getRegistrations):
323 (WebCore::WorkerSWClientConnection::whenRegistrationReady):
324 (WebCore::WorkerSWClientConnection::addServiceWorkerRegistrationInServer):
325 (WebCore::WorkerSWClientConnection::removeServiceWorkerRegistrationInServer):
326 (WebCore::WorkerSWClientConnection::didResolveRegistrationPromise):
327 (WebCore::WorkerSWClientConnection::postMessageToServiceWorker):
328 (WebCore::WorkerSWClientConnection::serverConnectionIdentifier const):
329 (WebCore::WorkerSWClientConnection::syncTerminateWorker):
330 (WebCore::WorkerSWClientConnection::registerServiceWorkerClient):
331 (WebCore::WorkerSWClientConnection::finishFetchingScriptInServer):
332 (WebCore::WorkerSWClientConnection::scheduleJob):
333 * workers/service/WorkerSWClientConnection.h:
334 * workers/service/context/ServiceWorkerThread.cpp:
335 (WebCore::ServiceWorkerThread::ServiceWorkerThread):
336 (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
337 * workers/service/context/ServiceWorkerThread.h:
338 * workers/service/context/ServiceWorkerThreadProxy.cpp:
339 (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
340 * workers/service/context/ServiceWorkerThreadProxy.h:
341 * worklets/WorkletGlobalScope.h:
342 (WebCore::WorkletGlobalScope::sessionID const):
344 (WebCore::DOMParser::parseFromString):
347 * xml/XMLHttpRequest.cpp:
349 2019-09-19 Said Abou-Hallawa <sabouhallawa@apple.com>
351 [SVG2]: Add auto behavior for rx and ry to the SVG <ellipse> and<rect> elements
352 https://bugs.webkit.org/show_bug.cgi?id=199843
354 Reviewed by Simon Fraser, Nikolas Zimmermann.
356 The specification is: https://www.w3.org/TR/SVG2/geometry.html#RxProperty.
358 Change the initial value of rx and ry to be "auto". Change the parser to
359 parse LengthOrAuto for these properties. Handle the case if one of them
362 Tests: svg/custom/ellipse-radius-auto-dynamic.svg
363 svg/custom/ellipse-radius-auto-initial.svg
364 svg/custom/ellipse-radius-length-initial.svg
365 svg/custom/rect-radius-auto-dynamic.svg
366 svg/custom/rect-radius-auto-initial.svg
367 svg/custom/rect-radius-length-initial.svg
369 * css/CSSProperties.json:
370 * css/parser/CSSPropertyParser.cpp:
371 (WebCore::consumeRxOrRy):
372 * rendering/style/RenderStyle.h:
373 (WebCore::RenderStyle::initialRadius):
374 * rendering/style/SVGRenderStyleDefs.cpp:
375 (WebCore::StyleLayoutData::StyleLayoutData):
376 * rendering/svg/RenderSVGEllipse.cpp:
377 (WebCore::RenderSVGEllipse::calculateRadiiAndCenter):
379 2019-09-19 Peng Liu <peng.liu6@apple.com>
381 HTMLVideoElement with a broken poster image will take square dimension
382 https://bugs.webkit.org/show_bug.cgi?id=174122
383 <rdar://problem/33121806>
385 Reviewed by Daniel Bates.
387 For a video element, if only the width attribute is given and the height attribute is missing,
388 an invalid poster image will make its aspect ratio to be 1, which is the historical WebKit behavior
389 if we're painting alt text and/or a broken image. This fix prevents that behavior to impact video elements.
391 We add a virtual function shouldDisplayBrokenImageIcon() to RenderImage and it will return true
392 only when the image source is given but cannot be downloaded. RenderMedia overrides this virtual function
393 and always return false because it never shows the broken image icon. RenderVideo inherits
394 that behavior from RenderMedia.
396 Then, in RenderImage::computeIntrinsicRatioInformation(), we only set the aspect ratio to 1
397 when we need to show the broken image icon. It is the historical WebKit behavior that we want to keep
398 for image element, but we also want to avoid its impact (this bug) on video elements.
400 We also replace the imageResource().errorOccurred() with shouldDisplayBrokenImageIcon() in
401 TreeBuilder::createLayoutBox() for the same reason.
403 The logic to display the broken image icon in RenderImage::renderReplaced() is also cleaned up.
405 Test: media/video-poster-not-found.html
407 * layout/layouttree/LayoutTreeBuilder.cpp:
408 (WebCore::Layout::TreeBuilder::createLayoutBox):
409 * rendering/RenderImage.cpp:
410 (WebCore::RenderImage::shouldDisplayBrokenImageIcon const):
411 (WebCore::RenderImage::paintReplaced):
412 (WebCore::RenderImage::computeIntrinsicRatioInformation const):
413 * rendering/RenderImage.h:
414 * rendering/RenderMedia.h:
416 2019-09-19 Antti Koivisto <antti@apple.com>
418 Turn static DocumentRuleSets::s_isInvalidatingStyleWithRuleSets assertion bit into a member
419 https://bugs.webkit.org/show_bug.cgi?id=201985
420 <rdar://problem/54851871>
422 Reviewed by Zalan Bujtas.
424 This assert bit was catching cases that are not dangerous. Turn it into a member to narrow the scope.
426 * css/DocumentRuleSets.cpp:
427 (WebCore::DocumentRuleSets::~DocumentRuleSets):
428 (WebCore::DocumentRuleSets::collectFeatures const):
430 * css/DocumentRuleSets.h:
431 (WebCore::DocumentRuleSets::isInvalidatingStyleWithRuleSets):
432 * style/AttributeChangeInvalidation.cpp:
433 (WebCore::Style::AttributeChangeInvalidation::invalidateStyleWithRuleSets):
434 * style/ClassChangeInvalidation.cpp:
435 (WebCore::Style::ClassChangeInvalidation::invalidateStyleWithRuleSets):
437 2019-09-19 Zalan Bujtas <zalan@apple.com>
439 [LFC] Remove redundant Layout::Box::ElementTypes
440 https://bugs.webkit.org/show_bug.cgi?id=201963
442 Reviewed by Antti Koivisto.
444 These types can be solved through RenderStyle.
446 * layout/layouttree/LayoutBox.cpp:
447 (WebCore::Layout::Box::isPaddingApplicable const):
448 * layout/layouttree/LayoutBox.h:
449 (WebCore::Layout::Box::isTableHeader const):
450 (WebCore::Layout::Box::isTableBody const):
451 (WebCore::Layout::Box::isTableFooter const):
452 (WebCore::Layout::Box::isTableRow const):
453 (WebCore::Layout::Box::isTableColumnGroup const):
454 (WebCore::Layout::Box::isTableColumn const):
455 (WebCore::Layout::Box::isTableCell const):
456 * layout/layouttree/LayoutTreeBuilder.cpp:
457 (WebCore::Layout::TreeBuilder::createLayoutBox):
458 * page/FrameViewLayoutContext.cpp:
459 (WebCore::layoutUsingFormattingContext):
461 2019-09-19 Zalan Bujtas <zalan@apple.com>
463 [LFC][IFC] InlineFormattingContext::InlineLayout should not need to call LayoutState::establishedFormattingState
464 https://bugs.webkit.org/show_bug.cgi?id=201972
465 <rdar://problem/55505869>
467 Reviewed by Antti Koivisto.
469 InlineLayout has access to InlineFormattingContext, so it should just query it instead of calling LayoutState::establishedFormattingState.
471 * layout/inlineformatting/InlineFormattingContext.h:
472 (WebCore::Layout::InlineFormattingContext::InlineLayout::formattingContext const):
473 (WebCore::Layout::InlineFormattingContext::InlineLayout::formattingState):
474 * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
475 (WebCore::Layout::InlineFormattingContext::InlineLayout::InlineLayout):
476 (WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
477 (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
478 (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const): Deleted.
479 (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const): Deleted.
481 2019-09-19 Zalan Bujtas <zalan@apple.com>
483 [LFC] FloatingContext should take the root container.
484 https://bugs.webkit.org/show_bug.cgi?id=201968
485 <rdar://problem/55505090>
487 Reviewed by Antti Koivisto.
489 Now FormattingContext::root() does not need to be public anymore.
491 * layout/FormattingContext.h:
492 (WebCore::Layout::FormattingContext::root const):
493 * layout/blockformatting/BlockFormattingContext.cpp:
494 (WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
495 * layout/floats/FloatingContext.cpp:
496 (WebCore::Layout::FloatingContext::FloatingContext):
497 (WebCore::Layout::FloatingContext::mapPointFromFormattingContextRootToFloatingStateRoot const):
498 * layout/floats/FloatingContext.h:
499 (WebCore::Layout::FloatingContext::root const):
500 * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
501 (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
502 (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
504 2019-09-18 Brent Fulgham <bfulgham@apple.com>
506 [FTW] Correct ImageBufferData and clear operations
507 https://bugs.webkit.org/show_bug.cgi?id=201862
509 Reviewed by Fujii Hironori.
511 This patch corrects several problems in the canvas implementation:
512 1. The implementation of ImageBufferDataDirect2D did not properly handle the case of a
513 'getData' request for less than the size of the full bitmap.
514 2. The implementation of 'Clear' was not correct when the size of the region to be
515 cleared is less than the size of the render target.
516 3. 'endDraw' fails if any clip regions are active at the end of the operation. The
517 stack needs to be unwound when endDraw is called.
519 This patch corrects all three problems.
521 Tested by canvas LayoutTests.
523 * platform/graphics/win/Direct2DOperations.cpp:
524 (WebCore::Direct2D::clearRect): Correct partial render target case.
525 * platform/graphics/win/ImageBufferDataDirect2D.cpp:
526 (WebCore::ImageBufferData::getData const): Correct partial buffer case.
527 (WebCore::ImageBufferData::putData): Ditto.
528 (WebCore::ImageBufferData::readDataFromBitmapIfNeeded): Added.
529 (WebCore::copyRectFromSourceToDest): Added.
530 (WebCore::ImageBufferData::copyRectFromSourceToData): Added.
531 * platform/graphics/win/PlatformContextDirect2D.cpp:
532 (WebCore::PlatformContextDirect2D::endDraw): Correct failures caused by
533 dangling clip regions when 'endDraw' is called.
534 (WebCore::PlatformContextDirect2D::flush): Don't call post-draw observer;
535 this is already handled in the draw operations, and endDraw.
536 (WebCore::PlatformContextDirect2D::restore): Recognize that the clip
537 and transparency stack might be empty when restore is called.
539 2019-09-18 Andy Estes <aestes@apple.com>
541 Unreviewed, fixed a crash in ssl/applepay/ApplePayCancelEvent.https.html
543 After r250060 (which landed very shortly after the patch that introduced ApplePayCancelEvent),
544 all Events must be IsoHeap-ed. ApplePayCancelEvent was not IsoHeap-ed, and so this caused
545 assertion failures in ssl/applepay/ApplePayCancelEvent.https.html.
547 Added the WTF_MAKE_ISO_ALLOCATED macros to ApplePayCancelEvent without a review to stop the
548 test from failing in EWS.
550 * Modules/applepay/ApplePayCancelEvent.cpp:
551 * Modules/applepay/ApplePayCancelEvent.h:
553 2019-09-18 Chris Dumez <cdumez@apple.com>
555 WebSocketStream does not need a SessionID
556 https://bugs.webkit.org/show_bug.cgi?id=201960
558 Reviewed by Geoffrey Garen.
560 WebSocketStream does not need a SessionID, now that we have a single session per WebProcess.
562 * platform/network/cf/SocketStreamHandleImpl.h:
563 * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
564 (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
566 2019-09-18 Chris Dumez <cdumez@apple.com>
568 LibWebRTCProvider does not need sessionIDs anymore
569 https://bugs.webkit.org/show_bug.cgi?id=201959
571 Reviewed by Geoffrey Garen.
573 LibWebRTCProvider does not need sessionIDs anymore, now that we have a single session per WebProcess.
575 * Modules/mediastream/PeerConnectionBackend.cpp:
576 (WebCore::PeerConnectionBackend::registerMDNSName):
577 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
578 (WebCore::LibWebRTCMediaEndpoint::setConfiguration):
579 * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
581 2019-09-18 Zalan Bujtas <zalan@apple.com>
583 [LFC] FormattingContext::Geometry/MarginCollapse/Quirk classes should not need to access non-const Display::Box
584 https://bugs.webkit.org/show_bug.cgi?id=201944
585 <rdar://problem/55493279>
587 Reviewed by Antti Koivisto.
589 This patch improves const correctness so that the Geometry/MarginCollapse/Quirk objects could not access non-const Display::Boxes (to mutate the display tree).
590 (The MarginCollapse::Update* functions are about updating the margin values on previously processed boxes so strictly speaking they are not margin collapsing related, but they somewhat belong to the MarginCollapse class -since they deal with margins.)
592 * layout/FormattingContext.h:
593 (WebCore::Layout::FormattingContext::formattingState const):
594 (WebCore::Layout::FormattingContext::formattingState):
595 * layout/FormattingState.cpp:
596 (WebCore::Layout::FormattingState::displayBox):
597 (WebCore::Layout::FormattingState::displayBox const): Deleted.
598 * layout/FormattingState.h:
599 * layout/blockformatting/BlockFormattingContext.cpp:
600 (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
601 * layout/blockformatting/BlockFormattingContext.h:
602 (WebCore::Layout::BlockFormattingContext::formattingState const):
603 (WebCore::Layout::BlockFormattingContext::formattingState):
604 * layout/blockformatting/BlockMarginCollapse.cpp:
605 (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling):
606 (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues const):
607 (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore const):
608 (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter const):
609 (WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues):
610 (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling const): Deleted.
611 (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues): Deleted.
612 (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore): Deleted.
613 (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter): Deleted.
614 * layout/inlineformatting/InlineFormattingContext.cpp:
615 (WebCore::Layout::InlineFormattingContext::collectInlineContent):
616 (WebCore::Layout::InlineFormattingContext::collectInlineContent const): Deleted.
617 * layout/inlineformatting/InlineFormattingContext.h:
618 (WebCore::Layout::InlineFormattingContext::formattingState const):
619 (WebCore::Layout::InlineFormattingContext::formattingState):
620 * layout/tableformatting/TableFormattingContext.h:
621 (WebCore::Layout::TableFormattingContext::formattingState const):
622 (WebCore::Layout::TableFormattingContext::formattingState):
624 2019-09-18 Chris Dumez <cdumez@apple.com>
626 BlobRegistry no longer needs SessionIDs
627 https://bugs.webkit.org/show_bug.cgi?id=201936
629 Reviewed by Geoffrey Garen.
631 BlobRegistry no longer needs SessionIDs, now that we have a single session per WebProcess.
633 * Modules/entriesapi/DOMFileSystem.cpp:
634 (WebCore::DOMFileSystem::getFile):
635 * Modules/entriesapi/DOMFileSystem.h:
636 * Modules/entriesapi/FileSystemFileEntry.cpp:
637 (WebCore::FileSystemFileEntry::file):
638 * Modules/entriesapi/FileSystemFileEntry.h:
639 * Modules/entriesapi/FileSystemFileEntry.idl:
640 * Modules/fetch/FetchBody.cpp:
641 (WebCore::FetchBody::fromFormData):
642 * Modules/fetch/FetchBody.h:
643 * Modules/fetch/FetchBodyConsumer.cpp:
644 (WebCore::blobFromData):
645 (WebCore::resolveWithTypeAndData):
646 (WebCore::FetchBodyConsumer::resolve):
647 (WebCore::FetchBodyConsumer::takeAsBlob):
648 * Modules/fetch/FetchBodyConsumer.h:
649 * Modules/fetch/FetchBodyOwner.cpp:
650 (WebCore::FetchBodyOwner::blob):
651 * Modules/fetch/FetchLoader.cpp:
652 (WebCore::FetchLoader::~FetchLoader):
653 (WebCore::FetchLoader::startLoadingBlobURL):
654 * Modules/fetch/FetchLoader.h:
655 * Modules/indexeddb/IDBTransaction.cpp:
656 (WebCore::IDBTransaction::putOrAddOnServer):
657 * Modules/mediarecorder/MediaRecorder.cpp:
658 (WebCore::MediaRecorder::createRecordingDataBlob):
659 * Modules/mediasource/MediaSourceRegistry.cpp:
660 (WebCore::MediaSourceRegistry::unregisterURL):
661 * Modules/mediasource/MediaSourceRegistry.h:
662 * Modules/mediastream/RTCDataChannel.cpp:
663 (WebCore::RTCDataChannel::didReceiveRawData):
664 * Modules/websockets/WebSocket.cpp:
665 (WebCore::WebSocket::didReceiveBinaryData):
666 * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
667 (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
668 * bindings/js/SerializedScriptValue.cpp:
669 (WebCore::CloneDeserializer::readFile):
670 (WebCore::CloneDeserializer::readTerminal):
671 (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
672 (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDBSynchronously):
673 * bindings/js/SerializedScriptValue.h:
674 * dom/DataTransfer.cpp:
675 (WebCore::DataTransfer::DataTransfer):
676 (WebCore::DataTransfer::createForCopyAndPaste):
677 (WebCore::DataTransfer::filesFromPasteboardAndItemList const):
678 (WebCore::DataTransfer::createForInputEvent):
679 (WebCore::DataTransfer::createForDrag):
680 (WebCore::DataTransfer::createForDragStartEvent):
681 (WebCore::DataTransfer::createForDrop):
682 (WebCore::DataTransfer::createForUpdatingDropTarget):
683 * dom/DataTransfer.h:
684 * editing/ReplaceRangeWithTextCommand.cpp:
685 (WebCore::ReplaceRangeWithTextCommand::inputEventDataTransfer const):
686 * editing/ReplaceSelectionCommand.cpp:
687 (WebCore::ReplaceSelectionCommand::inputEventDataTransfer const):
688 * editing/SpellingCorrectionCommand.cpp:
689 (WebCore::SpellingCorrectionCommand::inputEventDataTransfer const):
690 * editing/TypingCommand.cpp:
691 (WebCore::TypingCommand::inputEventDataTransfer const):
692 * editing/WebCorePasteboardFileReader.cpp:
693 (WebCore::WebCorePasteboardFileReader::readFilename):
694 (WebCore::WebCorePasteboardFileReader::readBuffer):
695 * editing/WebCorePasteboardFileReader.h:
696 * editing/cocoa/WebContentReaderCocoa.mm:
697 (WebCore::createFragmentForImageAttachment):
698 (WebCore::replaceRichContentWithAttachments):
699 (WebCore::createFragmentAndAddResources):
700 (WebCore::sanitizeMarkupWithArchive):
701 (WebCore::WebContentReader::readImage):
702 (WebCore::attachmentForFilePath):
703 (WebCore::attachmentForData):
704 * editing/markup.cpp:
705 (WebCore::restoreAttachmentElementsInFragment):
707 (WebCore::BlobURLRegistry::registerURL):
708 (WebCore::BlobURLRegistry::unregisterURL):
709 (WebCore::Blob::Blob):
710 (WebCore::Blob::~Blob):
712 (WebCore::Blob::create):
713 (WebCore::Blob::deserialize):
714 (WebCore::Blob::slice const):
717 (WebCore::File::createWithRelativePath):
718 (WebCore::File::create):
719 (WebCore::File::File):
722 * fileapi/FileReaderLoader.cpp:
723 (WebCore::FileReaderLoader::~FileReaderLoader):
724 (WebCore::FileReaderLoader::start):
725 * fileapi/FileReaderLoader.h:
726 * fileapi/ThreadableBlobRegistry.cpp:
727 (WebCore::ThreadableBlobRegistry::registerFileBlobURL):
728 (WebCore::ThreadableBlobRegistry::registerBlobURL):
729 (WebCore::ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked):
730 (WebCore::ThreadableBlobRegistry::registerBlobURLForSlice):
731 (WebCore::ThreadableBlobRegistry::unregisterBlobURL):
732 * fileapi/ThreadableBlobRegistry.h:
733 * html/FileInputType.cpp:
734 (WebCore::FileInputType::appendFormData const):
735 (WebCore::FileInputType::filesChosen):
736 * html/FileListCreator.cpp:
737 (WebCore::appendDirectoryFiles):
738 (WebCore::FileListCreator::FileListCreator):
739 (WebCore::FileListCreator::createFileList):
740 * html/FileListCreator.h:
741 (WebCore::FileListCreator::create):
742 * html/HTMLAttachmentElement.cpp:
743 (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
744 * html/HTMLCanvasElement.cpp:
745 (WebCore::HTMLCanvasElement::toBlob):
746 * html/PublicURLManager.cpp:
747 (WebCore::PublicURLManager::revoke):
748 (WebCore::PublicURLManager::stop):
749 * html/URLRegistry.h:
750 * loader/PolicyChecker.cpp:
751 (WebCore::PolicyChecker::extendBlobURLLifetimeIfNecessary const):
752 * page/EventHandler.cpp:
753 (WebCore::EventHandler::handleDrag):
754 * platform/network/BlobRegistry.h:
755 * testing/Internals.cpp:
756 (WebCore::Internals::createFile):
757 * testing/ServiceWorkerInternals.cpp:
758 (WebCore::ServiceWorkerInternals::createOpaqueWithBlobBodyResponse):
759 * workers/service/context/ServiceWorkerFetch.cpp:
760 (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
761 * xml/XMLHttpRequest.cpp:
762 (WebCore::XMLHttpRequest::createResponseBlob):
764 2019-09-18 Yusuke Suzuki <ysuzuki@apple.com>
766 Make all ScriptWrappable IsoHeap-ed
767 https://bugs.webkit.org/show_bug.cgi?id=201846
768 <rdar://problem/55407535>
770 Reviewed by Mark Lam.
772 This patch puts Event and derived classes under IsoHeap to make all ScriptWrappable classes IsoHeap-ed.
774 * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp:
775 * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
776 (WebCore::WebKitPlaybackTargetAvailabilityEvent::create): Deleted.
777 (WebCore::WebKitPlaybackTargetAvailabilityEvent::availability const): Deleted.
778 * Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp:
779 * Modules/applepay/ApplePayPaymentAuthorizedEvent.h:
780 * Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp:
781 * Modules/applepay/ApplePayPaymentMethodSelectedEvent.h:
782 (WebCore::ApplePayPaymentMethodSelectedEvent::create): Deleted.
783 (WebCore::ApplePayPaymentMethodSelectedEvent::paymentMethod): Deleted.
784 * Modules/applepay/ApplePayShippingContactSelectedEvent.cpp:
785 * Modules/applepay/ApplePayShippingContactSelectedEvent.h:
786 * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
787 * Modules/applepay/ApplePayShippingMethodSelectedEvent.h:
788 * Modules/applepay/ApplePayValidateMerchantEvent.cpp:
789 * Modules/applepay/ApplePayValidateMerchantEvent.h:
790 (WebCore::ApplePayValidateMerchantEvent::create): Deleted.
791 (WebCore::ApplePayValidateMerchantEvent::validationURL const): Deleted.
792 * Modules/encryptedmedia/MediaKeyMessageEvent.cpp:
793 * Modules/encryptedmedia/MediaKeyMessageEvent.h:
794 * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
795 * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.h:
796 (WebCore::WebKitMediaKeyMessageEvent::create): Deleted.
797 (WebCore::WebKitMediaKeyMessageEvent::message const): Deleted.
798 (WebCore::WebKitMediaKeyMessageEvent::destinationURL const): Deleted.
799 * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
800 * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.h:
801 (WebCore::WebKitMediaKeyNeededEvent::create): Deleted.
802 (WebCore::WebKitMediaKeyNeededEvent::initData const): Deleted.
803 * Modules/gamepad/GamepadEvent.cpp:
804 * Modules/gamepad/GamepadEvent.h:
805 (WebCore::GamepadEvent::create): Deleted.
806 (WebCore::GamepadEvent::gamepad const): Deleted.
807 * Modules/indexeddb/IDBRequestCompletionEvent.cpp:
808 * Modules/indexeddb/IDBRequestCompletionEvent.h:
809 (WebCore::IDBRequestCompletionEvent::create): Deleted.
810 * Modules/indexeddb/IDBVersionChangeEvent.cpp:
811 * Modules/indexeddb/IDBVersionChangeEvent.h:
812 * Modules/mediarecorder/BlobEvent.cpp:
813 * Modules/mediarecorder/BlobEvent.h:
814 * Modules/mediarecorder/MediaRecorderErrorEvent.cpp:
815 * Modules/mediarecorder/MediaRecorderErrorEvent.h:
816 * Modules/mediastream/MediaStreamTrackEvent.cpp:
817 * Modules/mediastream/MediaStreamTrackEvent.h:
818 * Modules/mediastream/OverconstrainedErrorEvent.cpp: Copied from Source/WebCore/Modules/mediarecorder/BlobEvent.h.
819 * Modules/mediastream/OverconstrainedErrorEvent.h:
820 (WebCore::OverconstrainedErrorEvent::create): Deleted.
821 (WebCore::OverconstrainedErrorEvent::error const): Deleted.
822 (WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent): Deleted.
823 * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
824 * Modules/mediastream/RTCDTMFToneChangeEvent.h:
825 * Modules/mediastream/RTCDataChannelEvent.cpp:
826 * Modules/mediastream/RTCDataChannelEvent.h:
827 * Modules/mediastream/RTCPeerConnectionIceEvent.cpp:
828 * Modules/mediastream/RTCPeerConnectionIceEvent.h:
829 (WebCore::RTCPeerConnectionIceEvent::url const): Deleted.
830 * Modules/mediastream/RTCTrackEvent.cpp:
831 * Modules/mediastream/RTCTrackEvent.h:
832 (WebCore::RTCTrackEvent::receiver const): Deleted.
833 (WebCore::RTCTrackEvent::track const): Deleted.
834 (WebCore::RTCTrackEvent::streams const): Deleted.
835 (WebCore::RTCTrackEvent::transceiver const): Deleted.
836 (WebCore::RTCTrackEvent::eventInterface const): Deleted.
837 * Modules/paymentrequest/MerchantValidationEvent.cpp:
838 * Modules/paymentrequest/MerchantValidationEvent.h:
839 * Modules/paymentrequest/PaymentMethodChangeEvent.cpp:
840 * Modules/paymentrequest/PaymentMethodChangeEvent.h:
841 * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
842 * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
843 * Modules/speech/SpeechSynthesisEvent.cpp:
844 * Modules/speech/SpeechSynthesisEvent.h:
845 (WebCore::SpeechSynthesisEvent::charIndex const): Deleted.
846 (WebCore::SpeechSynthesisEvent::elapsedTime const): Deleted.
847 (WebCore::SpeechSynthesisEvent::name const): Deleted.
848 (WebCore::SpeechSynthesisEvent::eventInterface const): Deleted.
849 * Modules/webaudio/AudioProcessingEvent.cpp:
850 * Modules/webaudio/AudioProcessingEvent.h:
851 * Modules/webaudio/OfflineAudioCompletionEvent.cpp:
852 * Modules/webaudio/OfflineAudioCompletionEvent.h:
853 * Modules/webgpu/GPUUncapturedErrorEvent.cpp:
854 * Modules/webgpu/GPUUncapturedErrorEvent.h:
855 * Modules/websockets/CloseEvent.cpp: Copied from Source/WebCore/dom/BeforeTextInsertedEvent.cpp.
856 * Modules/websockets/CloseEvent.h:
857 (WebCore::CloseEvent::create): Deleted.
858 (WebCore::CloseEvent::wasClean const): Deleted.
859 (WebCore::CloseEvent::code const): Deleted.
860 (WebCore::CloseEvent::reason const): Deleted.
861 (WebCore::CloseEvent::CloseEvent): Deleted.
862 * Modules/webvr/VRDisplayEvent.cpp:
863 * Modules/webvr/VRDisplayEvent.h:
865 * WebCore.xcodeproj/project.pbxproj:
866 * accessibility/AccessibleSetValueEvent.cpp:
867 * accessibility/AccessibleSetValueEvent.h:
868 (WebCore::AccessibleSetValueEvent::create): Deleted.
869 (WebCore::AccessibleSetValueEvent::value const): Deleted.
870 * animation/AnimationPlaybackEvent.cpp:
871 * animation/AnimationPlaybackEvent.h:
872 * bindings/js/ScriptWrappable.cpp: Copied from Source/WebCore/html/canvas/WebGLContextEvent.cpp.
873 * bindings/js/ScriptWrappable.h:
874 * dom/AnimationEvent.cpp:
875 * dom/AnimationEvent.h:
876 * dom/BeforeLoadEvent.cpp: Copied from Source/WebCore/dom/BeforeTextInsertedEvent.cpp.
877 * dom/BeforeLoadEvent.h:
878 * dom/BeforeTextInsertedEvent.cpp:
879 * dom/BeforeTextInsertedEvent.h:
880 * dom/BeforeUnloadEvent.cpp:
881 * dom/BeforeUnloadEvent.h:
882 * dom/ClipboardEvent.cpp:
883 * dom/ClipboardEvent.h:
884 * dom/CompositionEvent.cpp:
885 * dom/CompositionEvent.h:
886 * dom/CustomEvent.cpp:
888 * dom/DeviceMotionEvent.cpp:
889 * dom/DeviceMotionEvent.h:
890 * dom/DeviceOrientationEvent.cpp:
891 * dom/DeviceOrientationEvent.h:
892 * dom/ErrorEvent.cpp:
896 * dom/FocusEvent.cpp:
898 * dom/HashChangeEvent.cpp: Copied from Source/WebCore/dom/BeforeTextInsertedEvent.cpp.
899 * dom/HashChangeEvent.h:
900 * dom/InputEvent.cpp:
902 * dom/KeyboardEvent.cpp:
903 * dom/KeyboardEvent.h:
904 * dom/MessageEvent.cpp:
905 * dom/MessageEvent.h:
906 * dom/MouseEvent.cpp:
908 * dom/MouseRelatedEvent.cpp:
909 * dom/MouseRelatedEvent.h:
910 * dom/MutationEvent.cpp:
911 * dom/MutationEvent.h:
912 * dom/OverflowEvent.cpp:
913 * dom/OverflowEvent.h:
914 * dom/PageTransitionEvent.cpp:
915 * dom/PageTransitionEvent.h:
916 * dom/PointerEvent.cpp:
917 * dom/PointerEvent.h:
918 * dom/PopStateEvent.cpp:
919 * dom/PopStateEvent.h:
920 * dom/ProgressEvent.cpp:
921 * dom/ProgressEvent.h:
922 * dom/PromiseRejectionEvent.cpp:
923 * dom/PromiseRejectionEvent.h:
924 * dom/SecurityPolicyViolationEvent.cpp: Copied from Source/WebCore/dom/BeforeTextInsertedEvent.cpp.
925 * dom/SecurityPolicyViolationEvent.h:
928 * dom/TouchEvent.cpp:
930 * dom/TransitionEvent.cpp:
931 * dom/TransitionEvent.h:
934 * dom/UIEventWithKeyState.cpp:
935 * dom/UIEventWithKeyState.h:
936 * dom/WebKitAnimationEvent.cpp:
937 * dom/WebKitAnimationEvent.h:
938 * dom/WebKitTransitionEvent.cpp:
939 * dom/WebKitTransitionEvent.h:
940 * dom/WheelEvent.cpp:
942 * html/MediaEncryptedEvent.cpp:
943 * html/MediaEncryptedEvent.h:
944 * html/canvas/WebGLContextEvent.cpp:
945 * html/canvas/WebGLContextEvent.h:
946 * html/shadow/ProgressShadowElement.h:
947 * html/track/TrackEvent.cpp:
948 * html/track/TrackEvent.h:
949 * storage/StorageEvent.cpp:
950 * storage/StorageEvent.h:
951 (WebCore::StorageEvent::key const): Deleted.
952 (WebCore::StorageEvent::oldValue const): Deleted.
953 (WebCore::StorageEvent::newValue const): Deleted.
954 (WebCore::StorageEvent::url const): Deleted.
955 (WebCore::StorageEvent::storageArea const): Deleted.
956 * svg/SVGFEDistantLightElement.h:
957 * svg/SVGFEFuncAElement.h:
958 * svg/SVGFEFuncBElement.h:
959 * svg/SVGFEFuncGElement.h:
960 * svg/SVGFEFuncRElement.h:
961 * svg/SVGFEPointLightElement.h:
962 * svg/SVGFESpotLightElement.h:
963 * svg/SVGZoomEvent.cpp:
964 * svg/SVGZoomEvent.h:
965 * workers/service/ExtendableEvent.cpp:
966 * workers/service/ExtendableEvent.h:
967 * workers/service/ExtendableMessageEvent.cpp:
968 * workers/service/ExtendableMessageEvent.h:
969 * workers/service/FetchEvent.cpp:
970 * workers/service/FetchEvent.h:
971 * xml/XMLHttpRequestProgressEvent.cpp: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.cpp.
972 * xml/XMLHttpRequestProgressEvent.h:
973 (WebCore::XMLHttpRequestProgressEvent::create): Deleted.
974 (WebCore::XMLHttpRequestProgressEvent::position const): Deleted.
975 (WebCore::XMLHttpRequestProgressEvent::totalSize const): Deleted.
976 (WebCore::XMLHttpRequestProgressEvent::XMLHttpRequestProgressEvent): Deleted.
978 2019-09-18 Zalan Bujtas <zalan@apple.com>
980 [LFC] Introduce UsedVerticalValues::Constraints
981 https://bugs.webkit.org/show_bug.cgi?id=201933
982 <rdar://problem/55487485>
984 Reviewed by Antti Koivisto.
986 UsedVerticalValues::Constraints holds the constraint values ((optional)containing block height and contentbox top) for a particular box geometry computation.
987 This is in preparation for using constraint values instead of querying the display tree for containing block geometry information.
988 See webkit.org/b/201795
990 * layout/FormattingContext.cpp:
991 (WebCore::Layout::outOfFlowHorizontalConstraints):
992 (WebCore::Layout::outOfFlowVerticalConstraints):
993 (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
994 (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
995 (WebCore::Layout::outOfFlowConstraints): Deleted.
996 * layout/FormattingContext.h:
997 * layout/FormattingContextGeometry.cpp:
998 (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const):
999 (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
1000 (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
1001 (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
1002 (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin const):
1003 * layout/LayoutUnits.cpp:
1004 (WebCore::Layout::UsedVerticalValues::Constraints::Constraints):
1005 * layout/LayoutUnits.h:
1006 (WebCore::Layout::UsedVerticalValues::Constraints::Constraints):
1007 (WebCore::Layout::UsedVerticalValues::UsedVerticalValues):
1008 * layout/blockformatting/BlockFormattingContext.cpp:
1009 (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition):
1010 (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
1011 * layout/blockformatting/BlockFormattingContext.h:
1012 * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1013 (WebCore::Layout::BlockFormattingContext::Geometry::staticVerticalPosition const):
1014 (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition const):
1015 * layout/inlineformatting/InlineFormattingContext.cpp:
1016 (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
1017 * layout/inlineformatting/InlineFormattingContext.h:
1018 * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1019 (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin const):
1021 2019-09-18 Chris Dumez <cdumez@apple.com>
1023 Unreviewed, WinCairo build fix after r250045.
1025 * platform/network/curl/CurlFormDataStream.cpp:
1026 (WebCore::CurlFormDataStream::computeContentLength):
1028 2019-09-18 Zalan Bujtas <zalan@apple.com>
1030 [LFC] Add contentbox left constraint to UsedHorizontalValues::Constraints
1031 https://bugs.webkit.org/show_bug.cgi?id=201923
1032 <rdar://problem/55485796>
1034 Reviewed by Antti Koivisto.
1036 Pass in the contentbox left constraint value to the FormattingContext::compute*() functions so that they don't need to read the containg block's geometry.
1037 This is in preparation for using constraint values instead of querying the display tree for containing block geometry information.
1038 See webkit.org/b/201795
1040 * layout/FormattingContext.cpp:
1041 (WebCore::Layout::outOfFlowConstraints):
1042 (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
1043 (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
1044 * layout/FormattingContext.h:
1045 * layout/FormattingContextGeometry.cpp:
1046 (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const):
1047 (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1048 (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const):
1049 * layout/LayoutUnits.cpp:
1050 (WebCore::Layout::UsedHorizontalValues::Constraints::Constraints):
1051 * layout/LayoutUnits.h:
1052 (WebCore::Layout::UsedHorizontalValues::Constraints::Constraints):
1053 * layout/blockformatting/BlockFormattingContext.cpp:
1054 (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition):
1055 (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
1056 * layout/blockformatting/BlockFormattingContext.h:
1057 * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1058 (WebCore::Layout::BlockFormattingContext::Geometry::staticHorizontalPosition const):
1059 (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition const):
1060 * layout/inlineformatting/InlineFormattingContext.cpp:
1061 (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
1062 (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
1063 * layout/tableformatting/TableFormattingContext.cpp:
1064 (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
1066 2019-09-18 Zalan Bujtas <zalan@apple.com>
1068 [LFC] Introduce UsedHorizontalValues::Constraints
1069 https://bugs.webkit.org/show_bug.cgi?id=201919
1070 <rdar://problem/55481927>
1072 Reviewed by Antti Koivisto.
1074 UsedHorizontalValues::Constraints holds the constraint values for a particular box geometry computation (currently it only has the horizontal width constraint)
1077 * WebCore.xcodeproj/project.pbxproj:
1078 * layout/FormattingContext.cpp:
1079 (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
1080 (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
1081 (WebCore::Layout::FormattingContext::computeBorderAndPadding):
1082 * layout/FormattingContextGeometry.cpp:
1083 (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
1084 (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1085 (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
1086 (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const):
1087 (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1088 (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin const):
1089 (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin const):
1090 (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset const):
1091 (WebCore::Layout::FormattingContext::Geometry::computedPadding const):
1092 (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin const):
1093 (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin const):
1094 * layout/FormattingContextQuirks.cpp:
1095 (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
1096 * layout/LayoutUnits.h:
1097 (WebCore::Layout::UsedHorizontalValues::Constraints::Constraints):
1098 (WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
1099 * layout/blockformatting/BlockFormattingContext.cpp:
1100 (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren):
1101 (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition):
1102 (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
1103 (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
1104 * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1105 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
1106 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
1107 * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1108 (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
1109 * layout/blockformatting/BlockMarginCollapse.cpp:
1110 (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
1111 * layout/floats/FloatingContext.h:
1112 * layout/inlineformatting/InlineFormattingContext.cpp:
1113 (WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
1114 (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
1115 (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
1116 (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
1117 * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1118 (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
1119 * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1120 (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
1121 * layout/tableformatting/TableFormattingContext.cpp:
1122 (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
1124 2019-09-18 Andy Estes <aestes@apple.com>
1126 [Apple Pay] Tell websites why a session was cancelled
1127 https://bugs.webkit.org/show_bug.cgi?id=201912
1129 Reviewed by Brady Eidson.
1131 Added ApplePayCancelEvent as the interface for ApplePaySession's cancel event. This event
1132 object includes a `sessionError` attribute that exposes a Web-safe version of the PassKit
1133 domain error we received from PKPaymentAuthorization(View)Controller. Currently, we report
1134 all errors with code "unknown", but more codes will be added in future patches.
1136 Test: http/tests/ssl/applepay/ApplePayCancelEvent.https.html
1138 * DerivedSources-input.xcfilelist:
1139 * DerivedSources-output.xcfilelist:
1140 * DerivedSources.make:
1141 * Modules/applepay/ApplePayCancelEvent.cpp: Copied from Source/WebCore/Modules/applepay/PaymentHeaders.h.
1142 (WebCore::ApplePayCancelEvent::ApplePayCancelEvent):
1143 (WebCore::ApplePayCancelEvent::sessionError const):
1144 (WebCore::ApplePayCancelEvent::eventInterface const):
1145 * Modules/applepay/ApplePayCancelEvent.h: Copied from Source/WebCore/Modules/applepay/PaymentHeaders.h.
1146 (WebCore::ApplePayCancelEvent::create):
1147 * Modules/applepay/ApplePayCancelEvent.idl: Copied from Source/WebCore/Modules/applepay/PaymentHeaders.h.
1148 * Modules/applepay/ApplePaySession.cpp:
1149 (WebCore::ApplePaySession::didCancelPaymentSession):
1150 * Modules/applepay/ApplePaySession.h:
1151 * Modules/applepay/ApplePaySessionError.h: Copied from Source/WebCore/Modules/applepay/PaymentHeaders.h.
1152 * Modules/applepay/ApplePaySessionError.idl: Copied from Source/WebCore/Modules/applepay/PaymentHeaders.h.
1153 * Modules/applepay/PaymentCoordinator.cpp:
1154 (WebCore::PaymentCoordinator::didCancelPaymentSession):
1155 * Modules/applepay/PaymentCoordinator.h:
1156 * Modules/applepay/PaymentHeaders.h:
1157 * Modules/applepay/PaymentSession.cpp:
1158 * Modules/applepay/PaymentSession.h:
1159 * Modules/applepay/PaymentSessionError.h: Copied from Source/WebCore/Modules/applepay/PaymentHeaders.h.
1160 * Modules/applepay/cocoa/PaymentSessionErrorCocoa.mm: Copied from Source/WebCore/Modules/applepay/PaymentSession.h.
1161 (WebCore::additionalError):
1162 (WebCore::PaymentSessionError::PaymentSessionError):
1163 (WebCore::PaymentSessionError::sessionError const):
1164 (WebCore::PaymentSessionError::platformError const):
1165 (WebCore::PaymentSessionError::unknownError const):
1166 * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1167 (WebCore::ApplePayPaymentHandler::didCancelPaymentSession):
1168 * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
1169 * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:
1170 * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
1172 * WebCore.xcodeproj/project.pbxproj:
1173 * dom/EventNames.in:
1174 * testing/MockPaymentCoordinator.cpp:
1175 (WebCore::MockPaymentCoordinator::cancelPayment):
1177 2019-09-18 Chris Dumez <cdumez@apple.com>
1179 WebSWContextManagerConnection::installServiceWorker IPC no longer need a sessionID
1180 https://bugs.webkit.org/show_bug.cgi?id=201882
1182 Reviewed by Geoffrey Garen.
1184 WebSWContextManagerConnection::installServiceWorker IPC no longer need a sessionID now that we have a single
1185 sessionID per WebProcess.
1187 * workers/service/server/SWServer.cpp:
1188 (WebCore::SWServer::installContextData):
1189 (WebCore::SWServer::runServiceWorker):
1190 * workers/service/server/SWServerToContextConnection.h:
1192 2019-09-18 Chris Dumez <cdumez@apple.com>
1194 CacheStorageProvider::createCacheStorageConnection() does not need to take in a SessionID
1195 https://bugs.webkit.org/show_bug.cgi?id=201920
1197 Reviewed by Geoffrey Garen.
1199 CacheStorageProvider::createCacheStorageConnection() does not need to take in a SessionID.
1200 This sessionID is no longer used now that we have a session per WebProcess.
1202 * Modules/cache/CacheStorageConnection.cpp:
1203 (WebCore::formDataSize):
1204 (WebCore::CacheStorageConnection::computeRealBodySize):
1205 * Modules/cache/CacheStorageConnection.h:
1206 * Modules/cache/DOMWindowCaches.cpp:
1207 (WebCore::DOMWindowCaches::caches const):
1208 * Modules/cache/WorkerCacheStorageConnection.cpp:
1209 (WebCore::WorkerCacheStorageConnection::sessionID const): Deleted.
1210 * Modules/cache/WorkerCacheStorageConnection.h:
1212 (WebCore::Blob::size const):
1213 * fileapi/ThreadableBlobRegistry.cpp:
1214 (WebCore::ThreadableBlobRegistry::blobSize):
1215 * fileapi/ThreadableBlobRegistry.h:
1216 * loader/cache/KeepaliveRequestTracker.cpp:
1217 (WebCore::KeepaliveRequestTracker::tryRegisterRequest):
1218 (WebCore::KeepaliveRequestTracker::registerRequest):
1219 (WebCore::KeepaliveRequestTracker::unregisterRequest):
1220 * page/CacheStorageProvider.h:
1221 (WebCore::CacheStorageProvider::createCacheStorageConnection):
1222 * platform/network/BlobRegistry.h:
1223 * platform/network/FormData.cpp:
1224 (WebCore::FormDataElement::lengthInBytes const):
1225 (WebCore::FormData::lengthInBytes const):
1226 * platform/network/FormData.h:
1227 * testing/Internals.cpp:
1228 (WebCore::Internals::clearCacheStorageMemoryRepresentation):
1229 (WebCore::Internals::cacheStorageEngineRepresentation):
1230 (WebCore::Internals::updateQuotaBasedOnSpaceUsage):
1231 * workers/WorkerMessagingProxy.cpp:
1232 (WebCore::WorkerMessagingProxy::createCacheStorageConnection):
1233 * workers/service/context/ServiceWorkerThreadProxy.cpp:
1234 (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
1235 (WebCore::ServiceWorkerThreadProxy::createCacheStorageConnection):
1236 * workers/service/context/ServiceWorkerThreadProxy.h:
1237 * xml/XMLHttpRequest.cpp:
1238 (WebCore::XMLHttpRequest::createRequest):
1240 2019-09-18 Chris Dumez <cdumez@apple.com>
1242 Drop FrameLoaderClient::sessionID()
1243 https://bugs.webkit.org/show_bug.cgi?id=201916
1245 Reviewed by Geoffrey Garen.
1247 Drop FrameLoaderClient::sessionID(). The Frame can get the sessionID from its page (Which is
1248 what the FrameLoaderClient::sessionID() ended up doing) and other call sites at WebKit2 layer
1249 can get the sessionID from the WebProcess singleton.
1251 * loader/EmptyClients.cpp:
1252 * loader/EmptyFrameLoaderClient.h:
1253 * loader/FrameLoaderClient.h:
1255 (WebCore::Frame::sessionID const):
1257 2019-09-18 Chris Dumez <cdumez@apple.com>
1259 WebSWServerToContextConnection::PostMessageToServiceWorkerClient IPC no longer needs to take a sessionID
1260 https://bugs.webkit.org/show_bug.cgi?id=201883
1262 Reviewed by Geoffrey Garen.
1264 WebSWServerToContextConnection::PostMessageToServiceWorkerClient IPC no longer needs to take a sessionID,
1265 now that we have a single session per WebProcess.
1267 * workers/service/ServiceWorkerClient.cpp:
1268 (WebCore::ServiceWorkerClient::postMessage):
1269 * workers/service/context/SWContextManager.h:
1271 2019-09-18 Russell Epstein <repstein@apple.com>
1273 Unreviewed, rolling out r250030.
1275 Cause of Recent Build Failures.
1279 "Make all ScriptWrappable IsoHeap-ed"
1280 https://bugs.webkit.org/show_bug.cgi?id=201846
1281 https://trac.webkit.org/changeset/250030
1283 2019-09-18 Zalan Bujtas <zalan@apple.com>
1285 [LFC] FormattingContext::Geometry::computedHeight* functions need containingBlockHeight only.
1286 https://bugs.webkit.org/show_bug.cgi?id=201880
1287 <rdar://problem/55449623>
1289 Reviewed by Antti Koivisto.
1291 Let's tighten the incoming vertical parameter.
1293 * layout/FormattingContext.cpp:
1294 (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
1295 (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
1296 * layout/FormattingContext.h:
1297 * layout/FormattingContextGeometry.cpp:
1298 (WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
1299 (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight const):
1300 (WebCore::Layout::FormattingContext::Geometry::computedMinHeight const):
1301 (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
1302 (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const):
1303 (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
1304 (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
1305 (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin const):
1307 2019-09-18 Antti Koivisto <antti@apple.com>
1309 DocumentMarkerController should not invoke ensureLineBoxes during TextIterator traversal
1310 https://bugs.webkit.org/show_bug.cgi?id=201911
1311 <rdar://problem/55455458>
1313 Reviewed by Zalan Bujtas.
1315 DocumentMarkerController::addMarker may call ensureLineBoxes but TextIterator doesn't expect mutations during traversal.
1316 Fix by doing range collection as a separate step.
1318 * dom/DocumentMarkerController.cpp:
1319 (WebCore::DocumentMarkerController::collectTextRanges):
1320 (WebCore::DocumentMarkerController::addMarker):
1321 (WebCore::DocumentMarkerController::addTextMatchMarker):
1322 (WebCore::DocumentMarkerController::addDictationPhraseWithAlternativesMarker):
1323 (WebCore::DocumentMarkerController::addDictationResultMarker):
1324 (WebCore::DocumentMarkerController::addDraggedContentMarker):
1325 (WebCore::DocumentMarkerController::addPlatformTextCheckingMarker):
1326 (WebCore::DocumentMarkerController::removeMarkers):
1327 (WebCore::DocumentMarkerController::filterMarkers):
1328 * dom/DocumentMarkerController.h:
1330 2019-09-18 Zalan Bujtas <zalan@apple.com>
1332 [LFC] Shrink-to-fit-width needs the available width constraint value only
1333 https://bugs.webkit.org/show_bug.cgi?id=201896
1334 <rdar://problem/55465382>
1336 Reviewed by Antti Koivisto.
1338 * layout/FormattingContext.h:
1339 * layout/FormattingContextGeometry.cpp:
1340 (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
1341 (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1342 (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1343 * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1344 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
1345 * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1346 (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
1348 2019-09-18 David Kilzer <ddkilzer@apple.com>
1350 REGRESSION (r247566): Leak of UICTFontDescriptor in WebCore::FontDatabase::InstalledFont::InstalledFont()
1351 <https://webkit.org/b/201893>
1352 <rdar://problem/55464115>
1354 Reviewed by Brent Fulgham.
1356 * platform/graphics/cocoa/FontCacheCoreText.cpp:
1357 (WebCore::FontDatabase::InstalledFont::InstalledFont): Use
1358 adoptCF() to fix the leak.
1360 2019-09-18 Yusuke Suzuki <ysuzuki@apple.com>
1362 Make all ScriptWrappable IsoHeap-ed
1363 https://bugs.webkit.org/show_bug.cgi?id=201846
1364 <rdar://problem/55407535>
1366 Reviewed by Mark Lam.
1368 This patch puts Event and derived classes under IsoHeap to make all ScriptWrappable classes IsoHeap-ed.
1370 * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp:
1371 * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
1372 (WebCore::WebKitPlaybackTargetAvailabilityEvent::create): Deleted.
1373 (WebCore::WebKitPlaybackTargetAvailabilityEvent::availability const): Deleted.
1374 * Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp:
1375 * Modules/applepay/ApplePayPaymentAuthorizedEvent.h:
1376 * Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp:
1377 * Modules/applepay/ApplePayPaymentMethodSelectedEvent.h:
1378 (WebCore::ApplePayPaymentMethodSelectedEvent::create): Deleted.
1379 (WebCore::ApplePayPaymentMethodSelectedEvent::paymentMethod): Deleted.
1380 * Modules/applepay/ApplePayShippingContactSelectedEvent.cpp:
1381 * Modules/applepay/ApplePayShippingContactSelectedEvent.h:
1382 * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
1383 * Modules/applepay/ApplePayShippingMethodSelectedEvent.h:
1384 * Modules/applepay/ApplePayValidateMerchantEvent.cpp:
1385 * Modules/applepay/ApplePayValidateMerchantEvent.h:
1386 (WebCore::ApplePayValidateMerchantEvent::create): Deleted.
1387 (WebCore::ApplePayValidateMerchantEvent::validationURL const): Deleted.
1388 * Modules/encryptedmedia/MediaKeyMessageEvent.cpp:
1389 * Modules/encryptedmedia/MediaKeyMessageEvent.h:
1390 * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
1391 * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.h:
1392 (WebCore::WebKitMediaKeyMessageEvent::create): Deleted.
1393 (WebCore::WebKitMediaKeyMessageEvent::message const): Deleted.
1394 (WebCore::WebKitMediaKeyMessageEvent::destinationURL const): Deleted.
1395 * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
1396 * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.h:
1397 (WebCore::WebKitMediaKeyNeededEvent::create): Deleted.
1398 (WebCore::WebKitMediaKeyNeededEvent::initData const): Deleted.
1399 * Modules/gamepad/GamepadEvent.cpp:
1400 * Modules/gamepad/GamepadEvent.h:
1401 (WebCore::GamepadEvent::create): Deleted.
1402 (WebCore::GamepadEvent::gamepad const): Deleted.
1403 * Modules/indexeddb/IDBRequestCompletionEvent.cpp:
1404 * Modules/indexeddb/IDBRequestCompletionEvent.h:
1405 (WebCore::IDBRequestCompletionEvent::create): Deleted.
1406 * Modules/indexeddb/IDBVersionChangeEvent.cpp:
1407 * Modules/indexeddb/IDBVersionChangeEvent.h:
1408 * Modules/mediarecorder/BlobEvent.cpp:
1409 * Modules/mediarecorder/BlobEvent.h:
1410 * Modules/mediarecorder/MediaRecorderErrorEvent.cpp:
1411 * Modules/mediarecorder/MediaRecorderErrorEvent.h:
1412 * Modules/mediastream/MediaStreamTrackEvent.cpp:
1413 * Modules/mediastream/MediaStreamTrackEvent.h:
1414 * Modules/mediastream/OverconstrainedErrorEvent.cpp: Copied from Source/WebCore/Modules/mediastream/RTCDataChannelEvent.h.
1415 * Modules/mediastream/OverconstrainedErrorEvent.h:
1416 (WebCore::OverconstrainedErrorEvent::create): Deleted.
1417 (WebCore::OverconstrainedErrorEvent::error const): Deleted.
1418 (WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent): Deleted.
1419 * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
1420 * Modules/mediastream/RTCDTMFToneChangeEvent.h:
1421 * Modules/mediastream/RTCDataChannelEvent.cpp:
1422 * Modules/mediastream/RTCDataChannelEvent.h:
1423 * Modules/mediastream/RTCPeerConnectionIceEvent.cpp:
1424 * Modules/mediastream/RTCPeerConnectionIceEvent.h:
1425 (WebCore::RTCPeerConnectionIceEvent::url const): Deleted.
1426 * Modules/mediastream/RTCTrackEvent.cpp:
1427 * Modules/mediastream/RTCTrackEvent.h:
1428 (WebCore::RTCTrackEvent::receiver const): Deleted.
1429 (WebCore::RTCTrackEvent::track const): Deleted.
1430 (WebCore::RTCTrackEvent::streams const): Deleted.
1431 (WebCore::RTCTrackEvent::transceiver const): Deleted.
1432 (WebCore::RTCTrackEvent::eventInterface const): Deleted.
1433 * Modules/paymentrequest/MerchantValidationEvent.cpp:
1434 * Modules/paymentrequest/MerchantValidationEvent.h:
1435 * Modules/paymentrequest/PaymentMethodChangeEvent.cpp:
1436 * Modules/paymentrequest/PaymentMethodChangeEvent.h:
1437 * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
1438 * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
1439 * Modules/speech/SpeechSynthesisEvent.cpp:
1440 * Modules/speech/SpeechSynthesisEvent.h:
1441 (WebCore::SpeechSynthesisEvent::charIndex const): Deleted.
1442 (WebCore::SpeechSynthesisEvent::elapsedTime const): Deleted.
1443 (WebCore::SpeechSynthesisEvent::name const): Deleted.
1444 (WebCore::SpeechSynthesisEvent::eventInterface const): Deleted.
1445 * Modules/webaudio/AudioProcessingEvent.cpp:
1446 * Modules/webaudio/AudioProcessingEvent.h:
1447 * Modules/webaudio/OfflineAudioCompletionEvent.cpp:
1448 * Modules/webaudio/OfflineAudioCompletionEvent.h:
1449 * Modules/webgpu/GPUUncapturedErrorEvent.cpp:
1450 * Modules/webgpu/GPUUncapturedErrorEvent.h:
1451 * Modules/websockets/CloseEvent.cpp: Copied from Source/WebCore/dom/BeforeTextInsertedEvent.cpp.
1452 * Modules/websockets/CloseEvent.h:
1453 (WebCore::CloseEvent::create): Deleted.
1454 (WebCore::CloseEvent::wasClean const): Deleted.
1455 (WebCore::CloseEvent::code const): Deleted.
1456 (WebCore::CloseEvent::reason const): Deleted.
1457 (WebCore::CloseEvent::CloseEvent): Deleted.
1458 * Modules/webvr/VRDisplayEvent.cpp:
1459 * Modules/webvr/VRDisplayEvent.h:
1461 * WebCore.xcodeproj/project.pbxproj:
1462 * accessibility/AccessibleSetValueEvent.cpp:
1463 * accessibility/AccessibleSetValueEvent.h:
1464 (WebCore::AccessibleSetValueEvent::create): Deleted.
1465 (WebCore::AccessibleSetValueEvent::value const): Deleted.
1466 * animation/AnimationPlaybackEvent.cpp:
1467 * animation/AnimationPlaybackEvent.h:
1468 * bindings/js/ScriptWrappable.cpp: Copied from Source/WebCore/html/canvas/WebGLContextEvent.cpp.
1469 * bindings/js/ScriptWrappable.h:
1470 * dom/AnimationEvent.cpp:
1471 * dom/AnimationEvent.h:
1472 * dom/BeforeLoadEvent.cpp: Copied from Source/WebCore/dom/BeforeTextInsertedEvent.cpp.
1473 * dom/BeforeLoadEvent.h:
1474 * dom/BeforeTextInsertedEvent.cpp:
1475 * dom/BeforeTextInsertedEvent.h:
1476 * dom/BeforeUnloadEvent.cpp:
1477 * dom/BeforeUnloadEvent.h:
1478 * dom/ClipboardEvent.cpp:
1479 * dom/ClipboardEvent.h:
1480 * dom/CompositionEvent.cpp:
1481 * dom/CompositionEvent.h:
1482 * dom/CustomEvent.cpp:
1483 * dom/CustomEvent.h:
1484 * dom/DeviceMotionEvent.cpp:
1485 * dom/DeviceMotionEvent.h:
1486 * dom/DeviceOrientationEvent.cpp:
1487 * dom/DeviceOrientationEvent.h:
1488 * dom/ErrorEvent.cpp:
1492 * dom/FocusEvent.cpp:
1494 * dom/HashChangeEvent.cpp: Copied from Source/WebCore/dom/BeforeTextInsertedEvent.cpp.
1495 * dom/HashChangeEvent.h:
1496 * dom/InputEvent.cpp:
1498 * dom/KeyboardEvent.cpp:
1499 * dom/KeyboardEvent.h:
1500 * dom/MessageEvent.cpp:
1501 * dom/MessageEvent.h:
1502 * dom/MouseEvent.cpp:
1504 * dom/MouseRelatedEvent.cpp:
1505 * dom/MouseRelatedEvent.h:
1506 * dom/MutationEvent.cpp:
1507 * dom/MutationEvent.h:
1508 * dom/OverflowEvent.cpp:
1509 * dom/OverflowEvent.h:
1510 * dom/PageTransitionEvent.cpp:
1511 * dom/PageTransitionEvent.h:
1512 * dom/PointerEvent.cpp:
1513 * dom/PointerEvent.h:
1514 * dom/PopStateEvent.cpp:
1515 * dom/PopStateEvent.h:
1516 * dom/ProgressEvent.cpp:
1517 * dom/ProgressEvent.h:
1518 * dom/PromiseRejectionEvent.cpp:
1519 * dom/PromiseRejectionEvent.h:
1520 * dom/SecurityPolicyViolationEvent.cpp: Copied from Source/WebCore/dom/BeforeTextInsertedEvent.cpp.
1521 * dom/SecurityPolicyViolationEvent.h:
1522 * dom/TextEvent.cpp:
1524 * dom/TouchEvent.cpp:
1526 * dom/TransitionEvent.cpp:
1527 * dom/TransitionEvent.h:
1530 * dom/UIEventWithKeyState.cpp:
1531 * dom/UIEventWithKeyState.h:
1532 * dom/WebKitAnimationEvent.cpp:
1533 * dom/WebKitAnimationEvent.h:
1534 * dom/WebKitTransitionEvent.cpp:
1535 * dom/WebKitTransitionEvent.h:
1536 * dom/WheelEvent.cpp:
1538 * html/MediaEncryptedEvent.cpp:
1539 * html/MediaEncryptedEvent.h:
1540 * html/canvas/WebGLContextEvent.cpp:
1541 * html/canvas/WebGLContextEvent.h:
1542 * html/shadow/ProgressShadowElement.h:
1543 * html/track/TrackEvent.cpp:
1544 * html/track/TrackEvent.h:
1545 * storage/StorageEvent.cpp:
1546 * storage/StorageEvent.h:
1547 (WebCore::StorageEvent::key const): Deleted.
1548 (WebCore::StorageEvent::oldValue const): Deleted.
1549 (WebCore::StorageEvent::newValue const): Deleted.
1550 (WebCore::StorageEvent::url const): Deleted.
1551 (WebCore::StorageEvent::storageArea const): Deleted.
1552 * svg/SVGFEDistantLightElement.h:
1553 * svg/SVGFEFuncAElement.h:
1554 * svg/SVGFEFuncBElement.h:
1555 * svg/SVGFEFuncGElement.h:
1556 * svg/SVGFEFuncRElement.h:
1557 * svg/SVGFEPointLightElement.h:
1558 * svg/SVGFESpotLightElement.h:
1559 * svg/SVGZoomEvent.cpp:
1560 * svg/SVGZoomEvent.h:
1561 * workers/service/ExtendableEvent.cpp:
1562 * workers/service/ExtendableEvent.h:
1563 * workers/service/ExtendableMessageEvent.cpp:
1564 * workers/service/ExtendableMessageEvent.h:
1565 * workers/service/FetchEvent.cpp:
1566 * workers/service/FetchEvent.h:
1567 * xml/XMLHttpRequestProgressEvent.cpp: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.cpp.
1568 * xml/XMLHttpRequestProgressEvent.h:
1569 (WebCore::XMLHttpRequestProgressEvent::create): Deleted.
1570 (WebCore::XMLHttpRequestProgressEvent::position const): Deleted.
1571 (WebCore::XMLHttpRequestProgressEvent::totalSize const): Deleted.
1572 (WebCore::XMLHttpRequestProgressEvent::XMLHttpRequestProgressEvent): Deleted.
1574 2019-09-18 Loïc Yhuel <loic.yhuel@softathome.com> and Fujii Hironori <Hironori.Fujii@sony.com>
1576 JPEGImageDecoder: use libjpeg-turbo RGBA output path even for Adobe transform=0 JPEGs
1577 https://bugs.webkit.org/show_bug.cgi?id=200163
1579 Reviewed by Carlos Garcia Campos.
1581 Remove the workaround for old libjpeg-turbo which doesn't support
1582 BGRA output for Adobe transform=0 images. The bug was fixed in
1583 libjpeg-turbo 1.2.1.
1585 No new tests, no behavior change.
1587 * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
1588 (WebCore::JPEGImageReader::decode): Removed code in #if defined(TURBO_JPEG_RGB_SWIZZLE).
1589 (colorSpaceHasAlpha): Removed an unused inline function.
1591 2019-09-18 Joonghun Park <jh718.park@samsung.com>
1593 Unreviewed. Remove build warning since r248998.
1595 This patch removes build warning below.
1596 warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
1598 No new tests, no behavioral change.
1600 * platform/image-decoders/png/PNGImageDecoder.cpp:
1601 (WebCore::PNGImageDecoder::rowAvailable):
1603 2019-09-18 Fujii Hironori <Hironori.Fujii@sony.com>
1605 [cairo] Incorrect targetRect in BackingStoreBackendCairoImpl::scroll
1606 https://bugs.webkit.org/show_bug.cgi?id=201895
1608 Reviewed by Carlos Garcia Campos.
1610 In BackingStoreBackendCairoImpl::scroll, targetRect is calculated
1611 wrongly by shifting maxX and maxY. Bug 59655 fixed the issue by
1612 removing the shifting, but only for BackingStoreBackendCairoX11::scroll.
1614 No new tests, no behavior change.
1616 * platform/graphics/cairo/BackingStoreBackendCairoImpl.cpp:
1617 (WebCore::BackingStoreBackendCairoImpl::scroll): Take intersection of targetRect and scrollRect.
1619 2019-09-18 Andy Estes <aestes@apple.com>
1621 [Cocoa] Add a WKA extension point
1622 https://bugs.webkit.org/show_bug.cgi?id=201801
1623 <rdar://problem/55372507>
1625 Reviewed by Alexey Proskuryakov.
1627 * Modules/applepay/ApplePayRequestBase.cpp:
1628 (WebCore::requiresSupportedNetworks):
1629 (WebCore::convertAndValidate):
1631 2019-09-17 Chris Dumez <cdumez@apple.com>
1633 Unreviewed, revert change that Alex mistakenly committed at the same time as r250006 and broke the build.
1635 * page/PerformanceObserver.idl:
1637 2019-09-17 Chris Dumez <cdumez@apple.com>
1639 Stop calling Page::setSessionID() from WebKit2
1640 https://bugs.webkit.org/show_bug.cgi?id=201888
1642 Reviewed by Alex Christensen.
1644 Stop calling Page::setSessionID() from WebKit2 since Page's sessionID can never change when
1645 using WebKit2 (We process-swap and create a new Page in a new process when changing data
1646 store). Instead, we now pass the sessionID ID when constructing the Page, as part of the
1647 PageConfiguration structure.
1649 * editing/markup.cpp:
1650 (WebCore::createPageForSanitizingWebContent):
1651 * loader/EmptyClients.cpp:
1652 (WebCore::pageConfigurationWithEmptyClients):
1653 * loader/EmptyClients.h:
1655 (WebCore::Page::Page):
1656 (WebCore::Page::setSessionID):
1657 * page/PageConfiguration.cpp:
1658 (WebCore::PageConfiguration::PageConfiguration):
1659 * page/PageConfiguration.h:
1660 * svg/graphics/SVGImage.cpp:
1661 (WebCore::SVGImage::dataChanged):
1662 * workers/service/context/ServiceWorkerThreadProxy.cpp:
1663 (WebCore::createPageForServiceWorker):
1664 (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
1666 2019-09-17 Mark Lam <mark.lam@apple.com>
1668 Use constexpr instead of const in symbol definitions that are obviously constexpr.
1669 https://bugs.webkit.org/show_bug.cgi?id=201879
1671 Rubber-stamped by Joseph Pecoraro.
1673 No new tests. Covered by existing tests.
1675 * bindings/js/JSDOMConstructorBase.h:
1676 * bindings/js/JSDOMWindowProperties.h:
1677 * bindings/scripts/CodeGeneratorJS.pm:
1679 (GeneratePrototypeDeclaration):
1680 * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1681 * bindings/scripts/test/JS/JSTestEnabledBySetting.h:
1682 * bindings/scripts/test/JS/JSTestEnabledForContext.h:
1683 * bindings/scripts/test/JS/JSTestEventTarget.h:
1684 * bindings/scripts/test/JS/JSTestGlobalObject.h:
1685 * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h:
1686 * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h:
1687 * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h:
1688 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h:
1689 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h:
1690 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h:
1691 * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
1692 * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
1693 * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
1694 * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
1695 * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h:
1696 * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h:
1697 * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h:
1698 * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h:
1699 * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h:
1700 * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h:
1701 * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h:
1702 * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h:
1703 * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h:
1704 * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h:
1705 * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
1706 * bindings/scripts/test/JS/JSTestObj.h:
1707 * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
1708 * bindings/scripts/test/JS/JSTestPluginInterface.h:
1709 * bindings/scripts/test/JS/JSTestTypedefs.h:
1710 * bridge/objc/objc_runtime.h:
1711 * bridge/runtime_array.h:
1712 * bridge/runtime_method.h:
1713 * bridge/runtime_object.h:
1715 2019-09-17 Ross Kirsling <ross.kirsling@sony.com>
1717 Unreviewed restabilization of non-unified build.
1719 * inspector/InspectorCanvas.cpp:
1720 (WebCore::InspectorCanvas::resolveContext const):
1721 * platform/win/BString.h:
1722 * svg/PatternAttributes.h:
1723 * svg/SVGLengthValue.cpp:
1724 * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
1725 * workers/service/ServiceWorkerJob.cpp:
1726 * workers/service/WorkerSWClientConnection.cpp:
1727 * workers/service/server/SWServerRegistration.cpp:
1729 2019-09-17 Keith Rollin <krollin@apple.com>
1731 Remove some support for < iOS 12
1732 https://bugs.webkit.org/show_bug.cgi?id=201851
1733 <rdar://problem/55422044>
1735 Reviewed by Jiewen Tan and Alexey Proskuryakov.
1737 Remove some support for iOS versions less than 12.0.
1739 Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
1740 and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
1741 values >= 120000. This means that expressions like
1742 "__IPHONE_OS_VERSION_MIN_REQUIRED < 101200" are always False and
1743 "__IPHONE_OS_VERSION_MIN_REQUIRED >= 101200" are always True.
1745 This removal is part of a series of patches effecting such removal.
1747 No new tests -- no new or changed functionality.
1749 * crypto/mac/CryptoKeyRSAMac.cpp:
1750 (WebCore::CryptoKeyRSA::create):
1751 (WebCore::castDataArgumentToCCRSACryptorCreateFromDataIfNeeded): Deleted.
1753 2019-09-17 Nikolas Zimmermann <zimmermann@kde.org>
1755 SVG <animateMotion> does not reset the element to its first animation frame if its fill is "remove"
1756 https://bugs.webkit.org/show_bug.cgi?id=201565
1758 Reviewed by Said Abou-Hallawa.
1760 Fix fill="remove" support for <animateMotion>: properly trigger visual updates.
1761 Motion animations are implemented by provding an additional transformation on
1762 SVGGraphicsElements: the supplementalTransform().
1764 When an <animateMotion> element specifies fill="remove" the supplemental transform is
1765 correctly reset, when the animation is finished. However, nobody is notified about the
1766 change of transformation matrix. Fix by marking the target elements renderer as
1767 setNeedsTransformUpdate() and call markForLayoutAndParentResourceInvalidation().
1769 <animate> elements are not affected by the bug:
1770 SVGAnimateElementBase::clearAnimatedType()
1771 -> invokes SVGAttributeAnimator::stop()
1772 -> invokes applyAnimatedPropertyChange() [via SVGAnimatedPropertyAnimator]
1773 -> invokes SVGXXXElement::svgAttributeChanged().
1775 When animating e.g. the 'transform' attribute SVGGraphicsElement::svgAttributeChanged()
1776 will use exactly the same mechanism to trigger visul updates: first call
1777 setNeedsTransformUpdate() on the associated renderer, followd by a call to
1778 markForLayoutAndParentResourceInvalidation().
1780 --> Both code paths are now consistent.
1781 Also fixes http://web-platform-tests.live/svg/animations/animateMotion-fill-remove.html.
1783 Tests: svg/animations/fill-remove-support.html
1784 svg/animations/animateMotion-remove-freeze-use.svg
1786 * svg/SVGAnimateMotionElement.cpp:
1787 (WebCore::SVGAnimateMotionElement::clearAnimatedType): Call applyResultsToTarget().
1788 (WebCore::SVGAnimateMotionElement::calculateAnimatedValue): Stop calling
1789 setNeedsTransformUpdate() on the target elements renderer, since applyResultsToTarget()
1790 is responsible for modifications of the renderer state.
1791 (WebCore::SVGAnimateMotionElement::applyResultsToTarget): Always mark the renderer
1792 as setNeedsTransformUpdate() when applying the results, before the call to
1793 RenderSVGResource::markForLayoutAndParentResourceInvalidation(). This is more consistent
1794 with respect to the code path that updates the SVGElements instances (<use> support).
1796 2019-09-17 Andy Estes <aestes@apple.com>
1798 [Cocoa] Add a WKA extension point
1799 https://bugs.webkit.org/show_bug.cgi?id=201801
1800 <rdar://problem/55372507>
1802 Reviewed by Alexey Proskuryakov.
1804 * Modules/applepay/ApplePayRequestBase.cpp:
1805 (WebCore::requiresSupportedNetworks):
1806 (WebCore::convertAndValidate):
1808 2019-09-17 Antti Koivisto <antti@apple.com>
1810 TextIterator should convert tabs to spaces
1811 https://bugs.webkit.org/show_bug.cgi?id=201863
1813 Reviewed by Zalan Bujtas.
1817 imported/w3c/web-platform-tests/innerText/getter.html
1818 imported/w3c/web-platform-tests/html/dom/elements/the-innertext-idl-attribute/getter.html
1820 The old simple line layout path in TextIterator used to do this.
1822 * editing/TextIterator.cpp:
1823 (WebCore::TextIterator::handleTextBox):
1825 2019-09-17 Zalan Bujtas <zalan@apple.com>
1827 [LFC[MarginCollapsing] MarginCollapse::estimatedMarginBefore should take pre-computed non-collapsed margin values.
1828 https://bugs.webkit.org/show_bug.cgi?id=201848
1829 <rdar://problem/55419419>
1831 Reviewed by Antti Koivisto.
1833 This is in preparation for using constraint values instead of querying the display tree for containing block geometry information.
1834 See webkit.org/b/201795
1836 * layout/blockformatting/BlockFormattingContext.cpp:
1837 (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition):
1838 * layout/blockformatting/BlockFormattingContext.h:
1839 * layout/blockformatting/BlockMarginCollapse.cpp:
1840 (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
1841 (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
1842 (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
1843 (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeIgnoringCollapsingThrough):
1844 (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
1846 2019-09-17 Zalan Bujtas <zalan@apple.com>
1848 [First-letter] Use WeakPtr for the first-letter insertion point.
1849 https://bugs.webkit.org/show_bug.cgi?id=201842
1850 <rdar://problem/51373788>
1852 Reviewed by Antti Koivisto.
1854 The about-to-be-removed first letter renderer's sibling could potentially be destroyed too as the result of the anonymous subtree collapsing logic (when the next sibling is a generated anonymous block and it is not needed anymore.)
1856 Test: fast/text/first-letter-with-columns-crash.html
1858 * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
1859 (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
1861 2019-09-17 Carlos Garcia Campos <cgarcia@igalia.com>
1863 [GTK] Cannot create EGL window surface: EGL_BAD_ALLOC
1864 https://bugs.webkit.org/show_bug.cgi?id=201505
1866 Reviewed by Žan Doberšek.
1868 This happens because eglCreateWindowSurface() is called twice for the same window when not using the WPE
1869 renderer. New versions of Mesa fail the second time with a EGL_BAD_ALLOC.
1871 * platform/graphics/egl/GLContextEGL.cpp:
1872 (WebCore::GLContextEGL::createWindowContext): Check surface is nullptr before falling back to use
1873 eglCreateWindowSurface().
1875 2019-09-17 Jiewen Tan <jiewen_tan@apple.com>
1877 [WebAuthn] Use WebPreferences instead of RuntimeEnabledFeatures in UIProcess
1878 https://bugs.webkit.org/show_bug.cgi?id=198176
1879 <rdar://problem/55285709>
1881 Reviewed by Youenn Fablet.
1883 No changes of behavior.
1885 * Modules/webauthn/PublicKeyCredential.cpp:
1886 (WebCore::PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable):
1887 Resolves the promise with false immediately when the feature flag is false.
1889 2019-09-17 Rob Buis <rbuis@igalia.com>
1891 Access-Control-Expose-Headers parsed incorrectly
1892 https://bugs.webkit.org/show_bug.cgi?id=172357
1894 Reviewed by Youenn Fablet.
1896 When parsing the list, strip HTTP spaces and verify
1897 that the list items are valid HTTP tokens.
1899 Behavior matches Firefox and Chrome.
1901 Test: imported/w3c/web-platform-tests/cors/access-control-expose-headers-parsing.window.html
1903 * platform/network/HTTPParsers.h:
1904 (WebCore::addToAccessControlAllowList):
1905 (WebCore::parseAccessControlAllowList):
1907 2019-09-17 Youenn Fablet <youenn@apple.com>
1909 Content-Type should be preserved on responses created from DOMCache
1910 https://bugs.webkit.org/show_bug.cgi?id=201815
1912 Reviewed by Alex Christensen.
1914 Covered by updated test expectations
1916 * Modules/fetch/FetchResponse.cpp:
1917 (WebCore::FetchResponse::create):
1918 Update content type when creating the response from DOMCache.
1920 2019-09-16 Antti Koivisto <antti@apple.com>
1922 Move code for traversing reversed text boxes from TextIterator to TextBoxIterator
1923 https://bugs.webkit.org/show_bug.cgi?id=201819
1925 Reviewed by Zalan Bujtas.
1927 Handle traversal order in TextBoxIterator.
1929 * editing/TextIterator.cpp:
1930 (WebCore::TextIterator::handleTextNode):
1931 (WebCore::TextIterator::handleTextBox):
1932 (WebCore::TextIterator::handleTextNodeFirstLetter):
1933 * editing/TextIterator.h:
1934 * rendering/line/LineLayoutInterfaceTextBoxes.cpp:
1935 (WebCore::LineLayoutInterface::TextBox::rect const):
1936 (WebCore::LineLayoutInterface::TextBox::logicalRect const):
1937 (WebCore::LineLayoutInterface::TextBox::hasHyphen const):
1938 (WebCore::LineLayoutInterface::TextBox::isLeftToRightDirection const):
1939 (WebCore::LineLayoutInterface::TextBox::dirOverride const):
1940 (WebCore::LineLayoutInterface::TextBox::text const):
1941 (WebCore::LineLayoutInterface::TextBox::localStartOffset const):
1942 (WebCore::LineLayoutInterface::TextBox::localEndOffset const):
1943 (WebCore::LineLayoutInterface::TextBox::length const):
1944 (WebCore::LineLayoutInterface::TextBoxIterator::TextBoxIterator):
1945 (WebCore::LineLayoutInterface::TextBoxIterator::traverseNextInVisualOrder):
1946 (WebCore::LineLayoutInterface::TextBoxIterator::traverseNextInTextOrder):
1947 (WebCore::LineLayoutInterface::TextBoxIterator::operator== const):
1948 (WebCore::LineLayoutInterface::TextBoxIterator::atEnd const):
1949 (WebCore::LineLayoutInterface::Provider::firstTextBoxInVisualOrderFor):
1950 (WebCore::LineLayoutInterface::Provider::firstTextBoxInTextOrderFor):
1951 (WebCore::LineLayoutInterface::Provider::textBoxRangeFor):
1952 * rendering/line/LineLayoutInterfaceTextBoxes.h:
1953 (WebCore::LineLayoutInterface::TextBoxIterator::TextBoxIterator):
1954 (WebCore::LineLayoutInterface::TextBoxIterator::operator++):
1955 (WebCore::LineLayoutInterface::Provider::firstTextBoxFor):
1957 2019-09-16 Fujii Hironori <Hironori.Fujii@sony.com>
1959 [WinCairo][curl] Don't compile unused CertificateCFWin.cpp
1960 https://bugs.webkit.org/show_bug.cgi?id=201860
1962 Reviewed by Alex Christensen.
1964 Curl port is using ResourceHandle::setClientCertificateInfo
1965 instead of ResourceHandle::setClientCertificate.
1967 * PlatformWin.cmake: Added CertificateCFWin.cpp to WebCore_SOURCES only if USE_CFURLCONNECTION.
1968 * platform/network/ResourceHandle.h: Removed an unused method setClientCertificate.
1969 * platform/network/curl/ResourceHandleCurl.cpp:
1970 (WebCore::ResourceHandle::setClientCertificate): Deleted.
1972 2019-09-16 Fujii Hironori <Hironori.Fujii@sony.com>
1974 [AppleWin] Assertion failure in defaultSupportedImageTypes in UTIRegistry.cpp
1975 https://bugs.webkit.org/show_bug.cgi?id=198286
1977 Reviewed by Brent Fulgham.
1979 Some image types aren't supported by CG for Windows.
1981 No new tests, covered by existing tests.
1983 * platform/graphics/cg/ImageSourceCGWin.cpp:
1984 (WebCore::MIMETypeForImageType): Return the correct MIME types for
1985 com.microsoft.cur and com.microsoft.ico.
1986 * platform/graphics/cg/UTIRegistry.cpp:
1987 (WebCore::defaultSupportedImageTypes): Excluded public.jpeg-2000 and public.mpo-image if PLATFORM(WIN).
1989 2019-09-16 Fujii Hironori <Hironori.Fujii@sony.com>
1991 [Cairo] Image::drawTiled → Cairo::drawSurface → cairo_paint_with_alpha → segfault happens in pixman
1992 https://bugs.webkit.org/show_bug.cgi?id=201755
1994 Reviewed by Don Olmstead.
1996 Segmentation faults happened in pixman while painting a image. In
1997 Cairo::drawSurface, originalSrcRect can be slightly larger than
1998 the surface size because of floating number calculations.
1999 Cairo::drawSurface created a subsurface which is running over the
2000 parent surface boundaries.
2002 * platform/graphics/cairo/CairoOperations.cpp:
2003 (WebCore::Cairo::drawSurface): Calculated a intersection with
2004 expandedSrcRect and the parent surface size for subsurface size.
2006 2019-09-16 Eric Liang <ericliang@apple.com>
2008 AX: USER: VO: Messages > Message > Shift-VO-M doesn't reveal correct actions
2009 https://bugs.webkit.org/show_bug.cgi?id=201840
2011 Reviewed by Chris Fleizach.
2013 menuForEvent: expects event-position in window's space, but we pass the position in Core's space. In this case, we need to convert core's space to window's space.
2014 Tested that existing tests passed with WK1 and WK2
2016 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2017 (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
2019 2019-09-16 Jiewen Tan <jiewen_tan@apple.com>
2021 [WebAuthn] Support more than two FIDO protocol versions
2022 https://bugs.webkit.org/show_bug.cgi?id=198408
2023 <rdar://problem/51292176>
2025 Reviewed by Chris Dumez.
2027 Covered by new API tests.
2029 * Modules/webauthn/fido/DeviceResponseConverter.cpp:
2030 (fido::readCTAPGetInfoResponse):
2031 Remove the check for the array size.
2033 2019-09-16 Brent Fulgham <bfulgham@apple.com>
2035 [FTW] Correct lifespan of other SharedBitmaps
2036 https://bugs.webkit.org/show_bug.cgi?id=201800
2038 Reviewed by Dean Jackson.
2040 The pop-up menu code creates its own SharedBitmap in the WebContent process,
2041 which needs to release its handle before destruction, otherwise the UIProcess
2042 will be unable to access the GPU texture (since it will have been cleaned up).
2044 This patch also audits other uses of SharedBitmap to make sure a similar
2045 problem doesn't exist elsewhere.
2047 * platform/graphics/win/Direct2DUtilities.cpp:
2048 (WebCore::Direct2D::toDXGIDevice): Switch to IDXGIDevice1 (since that is our
2050 (WebCore::Direct2D::factoryForDXGIDevice): Ditto.
2051 (WebCore::Direct2D::swapChainOfSizeForWindowAndDevice): Added.
2052 * platform/graphics/win/Direct2DUtilities.h:
2053 * platform/graphics/win/GraphicsContextDirect2D.cpp:
2054 (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate): Correct
2055 a very silly use-after-move in the implementation.
2056 * platform/graphics/win/PlatformContextDirect2D.h:
2057 (WebCore::PlatformContextDirect2D::d3dDevice const): Added.
2058 (WebCore::PlatformContextDirect2D::setD3DDevice):
2060 2019-09-16 Chris Dumez <cdumez@apple.com>
2062 Simplify WebResourceLoadObserver now that we have one WebProcess per session
2063 https://bugs.webkit.org/show_bug.cgi?id=201821
2065 Reviewed by Brent Fulgham.
2067 * Modules/websockets/WebSocket.cpp:
2068 (WebCore::WebSocket::connect):
2069 * loader/ResourceLoadObserver.h:
2070 (WebCore::ResourceLoadObserver::logWebSocketLoading):
2071 (WebCore::ResourceLoadObserver::statisticsForURL):
2072 * testing/Internals.cpp:
2073 (WebCore::Internals::resourceLoadStatisticsForURL):
2075 2019-09-16 ChangSeok Oh <changseok@webkit.org>
2077 [GTK] Remove GraphicsContext3D dependency from the outside of WebGL
2078 https://bugs.webkit.org/show_bug.cgi?id=201748
2080 Reviewed by Alex Christensen.
2082 This is a preliminary change to bring ANGLE support for WebGL to GTK port.
2083 GraphicsContext3DANGLE has its own egl context but we want to make ANGLE egl context
2084 for WebGL and other GL contexts (i.e., glx, gles/egl) for TextureMapper live together.
2085 Mixed uses of GraphicsContext3D outside of WebGL code could cause unintended behaviors.
2086 We want to make sure that only WebGL code uses it.
2088 No new tests since no functionality changed.
2090 * platform/graphics/GLContext.cpp:
2091 * platform/graphics/GLContext.h:
2092 * platform/graphics/glx/GLContextGLX.cpp:
2093 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2094 (WebCore::GstVideoFrameHolder::platformLayerBuffer):
2095 (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
2096 * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
2098 2019-09-16 Zalan Bujtas <zalan@apple.com>
2100 [LFC] Make the nested Geometry/MarginCollapse/Quirks c'tors private.
2101 https://bugs.webkit.org/show_bug.cgi?id=201825
2102 <rdar://problem/55403474>
2104 Reviewed by Antti Koivisto.
2106 The Geometry/MarginCollapse/Quirks objects should be constructed through the corresponding accessor functions.
2107 This is also a preparation for being able to pass the layout box in to these stack objects and call geometry(layoutBox)->outOfFlowVerticalGeometry() vs. geometry()->outOfFlowVerticalGeometry(layoutBox).
2109 * layout/FormattingContext.h:
2110 * layout/blockformatting/BlockFormattingContext.h:
2111 * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2112 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2113 * layout/blockformatting/BlockFormattingContextQuirks.cpp:
2114 (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
2115 * layout/inlineformatting/InlineFormattingContext.h:
2116 * layout/tableformatting/TableFormattingContext.h:
2118 2019-09-16 Jon Davis <jond@apple.com>
2120 Update feature status for Battery Status API, WebGL 2, and Dialog Element
2121 https://bugs.webkit.org/show_bug.cgi?id=201469
2123 Reviewed by Joseph Pecoraro.
2127 2019-09-16 Andres Gonzalez <andresg_22@apple.com>
2129 Rename [WebAccessibilityObjectWrapper _accessibilityInsertText] to accessibilityInsertText to match accessibility client.
2130 https://bugs.webkit.org/show_bug.cgi?id=201820
2132 Reviewed by Chris Fleizach.
2134 No new tests necessary since this is a method rename.
2136 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2137 (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
2138 (-[WebAccessibilityObjectWrapper _accessibilityInsertText:]): Deleted.
2139 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2140 (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
2141 (-[WebAccessibilityObjectWrapper _accessibilityInsertText:]): Deleted.
2143 2019-09-16 Zalan Bujtas <zalan@apple.com>
2145 [LFC] Always provide a containing block width value to compute* functions.
2146 https://bugs.webkit.org/show_bug.cgi?id=201809
2147 <rdar://problem/55383153>
2149 Reviewed by Antti Koivisto.
2151 The caller can always make a more informative decision about the default value when the containing block width is not available.
2152 (Currently the only case is when computing the preferred width.)
2154 * layout/FormattingContext.cpp:
2155 (WebCore::Layout::FormattingContext::computeBorderAndPadding):
2156 * layout/FormattingContextGeometry.cpp:
2157 (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
2158 (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
2159 (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2160 (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
2161 (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const):
2162 (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
2163 (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin const):
2164 (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
2165 (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin const):
2166 (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset const):
2167 (WebCore::Layout::FormattingContext::Geometry::computedPadding const):
2168 (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin const):
2169 (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin const):
2170 * layout/LayoutUnits.h:
2171 (WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
2172 * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2173 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2174 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
2175 * layout/inlineformatting/InlineFormattingContext.cpp:
2176 (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
2177 (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
2178 (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
2179 (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox):
2180 * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2181 (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
2183 2019-09-16 Zalan Bujtas <zalan@apple.com>
2185 [LFC][BFC] BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin should not read containing block's width
2186 https://bugs.webkit.org/show_bug.cgi?id=201807
2187 <rdar://problem/55381342>
2189 Reviewed by Antti Koivisto.
2191 This is in preparation for using constraint values instead of querying the display tree for containing block geometry information.
2192 See webkit.org/b/201795
2194 * layout/blockformatting/BlockFormattingContext.h:
2195 * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2196 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2197 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
2198 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2200 2019-09-16 Antti Koivisto <antti@apple.com>
2202 Eliminate separate simple line layout path from TextIterator
2203 https://bugs.webkit.org/show_bug.cgi?id=201760
2205 Reviewed by Zalan Bujtas.
2207 Use the new line layout iterator to implement linebox traversal in TextIterator.
2209 * WebCore.xcodeproj/project.pbxproj:
2210 * editing/TextIterator.cpp:
2211 (WebCore::TextIterator::advance):
2212 (WebCore::TextIterator::handleTextNode):
2213 (WebCore::TextIterator::handleTextBox):
2215 InlineTextBox* -> LineLayoutInterface::TextBoxIterator
2216 Delete the seperate simple line layout path.
2218 (WebCore::TextIterator::handleTextNodeFirstLetter):
2219 (WebCore::TextIterator::emitCharacter):
2220 (WebCore::TextIterator::emitText):
2221 * editing/TextIterator.h:
2222 * rendering/RenderTreeAsText.cpp:
2223 (WebCore::RenderTreeAsText::writeRenderObject):
2225 * rendering/SimpleLineLayoutResolver.cpp:
2226 (WebCore::SimpleLineLayout::RunResolver::Iterator::Iterator):
2227 (WebCore::SimpleLineLayout::RunResolver::Iterator::advanceLines):
2228 * rendering/SimpleLineLayoutResolver.h:
2229 (WebCore::SimpleLineLayout::RunResolver::Iterator::resolver const):
2230 (WebCore::SimpleLineLayout::RunResolver::Iterator::inQuirksMode const):
2231 (WebCore::SimpleLineLayout::RunResolver::Iterator::operator== const):
2232 (WebCore::SimpleLineLayout::RunResolver::Iterator::simpleRun const):
2234 Make RunResolver::Iterator copyable (so TextBoxIterator becomes copyable too).
2236 * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2237 (WebCore::SimpleLineLayout::TextFragmentIterator::findNextTextFragment):
2238 * rendering/line/LineLayoutInterfaceTextBoxes.cpp:
2239 (WebCore::LineLayoutInterface::TextBox::rect const):
2240 (WebCore::LineLayoutInterface::TextBox::logicalRect const):
2241 (WebCore::LineLayoutInterface::TextBox::hasHyphen const):
2242 (WebCore::LineLayoutInterface::TextBox::isLeftToRightDirection const):
2243 (WebCore::LineLayoutInterface::TextBox::dirOverride const):
2244 (WebCore::LineLayoutInterface::TextBox::text const):
2245 (WebCore::LineLayoutInterface::TextBox::localStartOffset const):
2246 (WebCore::LineLayoutInterface::TextBox::localEndOffset const):
2247 (WebCore::LineLayoutInterface::TextBox::length const):
2249 Add offset and length functions.
2251 (WebCore::LineLayoutInterface::TextBox::iterator const):
2252 (WebCore::LineLayoutInterface::TextBoxIterator::TextBoxIterator):
2253 (WebCore::LineLayoutInterface::TextBoxIterator::traverseNext):
2254 (WebCore::LineLayoutInterface::TextBoxIterator::operator== const):
2255 (WebCore::LineLayoutInterface::TextBoxIterator::atEnd const):
2256 (WebCore::LineLayoutInterface::Provider::firstTextBoxFor):
2257 (WebCore::LineLayoutInterface::Provider::textBoxRangeFor):
2258 (WebCore::LineLayoutInterface::Provider::iteratorForInlineTextBox):
2260 Add Provider class for making iterators. It constructs and keeps SimpleLineLayout::Resolvers alive during traversal as needed.
2262 * rendering/line/LineLayoutInterfaceTextBoxes.h:
2263 (WebCore::LineLayoutInterface::TextBoxIterator::TextBoxIterator):
2264 (WebCore::LineLayoutInterface::TextBoxIterator::operator bool const):
2265 (WebCore::LineLayoutInterface::TextBoxIterator::operator== const):
2266 (WebCore::LineLayoutInterface::TextBoxIterator::operator!= const):
2267 (WebCore::LineLayoutInterface::TextBoxIterator::operator* const):
2268 (WebCore::LineLayoutInterface::TextBoxIterator::operator-> const):
2270 Make TextBoxIterator privately inherit TextBox. This way we don't need to construct temporaries and can easily implement operator->.
2272 (WebCore::LineLayoutInterface::TextBoxRange::TextBoxRange):
2273 (WebCore::LineLayoutInterface::TextBoxRange::begin const):
2274 (WebCore::LineLayoutInterface::TextBoxRange::end const):
2276 Use separate end() type of C++17 ranges.
2278 2019-09-16 Andres Gonzalez <andresg_22@apple.com>
2280 Expose misspelling ranges for editable content to accessibility clients.
2281 https://bugs.webkit.org/show_bug.cgi?id=201752
2282 <rdar://problem/49556828>
2284 Reviewed by Chris Fleizach.
2286 Test: accessibility/misspelling-range.html
2288 Added [WebAccessibilityObjectWrapper misspellingTextMarkerRange] and
2289 underlying AccessibilityObject implementation to expose misspellings to
2290 accessibility clients that provide an alternative user interface to
2292 * accessibility/AccessibilityObject.cpp:
2293 (WebCore::AccessibilityObject::getMisspellingRange const):
2294 * accessibility/AccessibilityObject.h:
2295 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2296 (-[WebAccessibilityObjectWrapper misspellingTextMarkerRange:direction:]):
2297 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2298 (accessibilityMisspellingSearchCriteriaForParameterizedAttribute):
2299 (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
2301 2019-09-15 Andy Estes <aestes@apple.com>
2303 [WebIDL] Derived dictionaries should inherit their inherited dictionaries' partials
2304 https://bugs.webkit.org/show_bug.cgi?id=201802
2306 Reviewed by Sam Weinig.
2308 Prior to this change, a dictionary D that inherits from dictionary B would not inherit B's
2309 partial dictionaries. Fixed this by moving supplemental dependencies processing from
2310 generate-bindings.pl to CodeGenerator.pm and reusing it in GetDictionaryByType.
2312 Added new bindings tests.
2314 * bindings/scripts/CodeGenerator.pm:
2317 (ProcessSupplementalDependencies):
2318 (shouldPropertyBeExposed):
2319 (GetDictionaryByType):
2320 * bindings/scripts/generate-bindings.pl:
2322 (shouldPropertyBeExposed): Deleted.
2323 * bindings/scripts/test/JS/JSTestDerivedDictionary.cpp: Added.
2324 (WebCore::convertDictionary<TestDerivedDictionary>):
2325 (WebCore::convertDictionaryToJS):
2326 * bindings/scripts/test/JS/JSTestDerivedDictionary.h: Added.
2327 * bindings/scripts/test/JS/JSTestInheritedDictionary.cpp: Added.
2328 (WebCore::convertDictionary<TestInheritedDictionary>):
2329 (WebCore::convertDictionaryToJS):
2330 * bindings/scripts/test/JS/JSTestInheritedDictionary.h: Added.
2331 * bindings/scripts/test/TestDerivedDictionary.idl: Added.
2332 * bindings/scripts/test/TestInheritedDictionary.idl: Added.
2333 * bindings/scripts/test/TestSupplemental.idl:
2335 2019-09-15 David Kilzer <ddkilzer@apple.com>
2337 Missing call to [self init] in -[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]
2338 <https://webkit.org/b/201806>
2340 Reviewed by Simon Fraser.
2342 * platform/mac/ScrollAnimatorMac.mm:
2343 (-[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]):
2344 Call [self init] and return early if the result is nil.
2346 2019-09-14 Justin Fan <justin_fan@apple.com>
2348 [WebGPU] Make WebGPURenderPipeline and WebGPUComputePipeline inherit from GPUObjectBase
2349 https://bugs.webkit.org/show_bug.cgi?id=201207
2351 Reviewed by Dean Jackson.
2353 Make remaining WebGPU "client" classes manage their error scopes, instead of the internal classes.
2354 Matches Web/GPUBuffer, and allows "invalid" WebGPU objects to create errors.
2356 Covered by existing tests.
2358 * Modules/webgpu/WebGPUComputePipeline.cpp:
2359 (WebCore::WebGPUComputePipeline::create):
2360 (WebCore::WebGPUComputePipeline::WebGPUComputePipeline):
2361 * Modules/webgpu/WebGPUComputePipeline.h:
2362 * Modules/webgpu/WebGPUDevice.cpp:
2363 (WebCore::WebGPUDevice::createRenderPipeline const):
2364 (WebCore::WebGPUDevice::createComputePipeline const):
2365 * Modules/webgpu/WebGPURenderPipeline.cpp:
2366 (WebCore::WebGPURenderPipeline::create):
2367 (WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
2368 * Modules/webgpu/WebGPURenderPipeline.h:
2369 * WebCore.xcodeproj/project.pbxproj:
2370 * platform/graphics/gpu/GPUComputePipeline.h:
2371 * platform/graphics/gpu/GPURenderPipeline.h:
2372 * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
2373 (WebCore::GPUComputePipeline::tryCreate):
2374 (WebCore::GPUComputePipeline::GPUComputePipeline):
2375 * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2376 (WebCore::GPURenderPipeline::tryCreate):
2377 (WebCore::GPURenderPipeline::GPURenderPipeline):
2379 2019-09-14 Yusuke Suzuki <ysuzuki@apple.com>
2381 Retire x86 32bit JIT support
2382 https://bugs.webkit.org/show_bug.cgi?id=201790
2384 Reviewed by Mark Lam.
2386 * cssjit/FunctionCall.h:
2387 (WebCore::FunctionCall::callAndBranchOnBooleanReturnValue):
2388 (WebCore::FunctionCall::swapArguments):
2390 2019-09-14 Zalan Bujtas <zalan@apple.com>
2392 [LFC] FormattingContext::Geometry::inFlowPositionedPositionOffset should not read containing block's width
2393 https://bugs.webkit.org/show_bug.cgi?id=201797
2394 <rdar://problem/55366244>
2396 Reviewed by Antti Koivisto.
2398 This is in preparation for using constraint values instead of querying the display tree for containing block geometry information.
2399 See webkit.org/b/201795
2401 * layout/FormattingContext.h:
2402 * layout/FormattingContextGeometry.cpp:
2403 (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset const):
2404 * layout/blockformatting/BlockFormattingContext.cpp:
2405 (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren):
2406 * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2407 (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
2409 2019-09-14 Zalan Bujtas <zalan@apple.com>
2411 [LFC] FormattingContext::Geometry::inlineReplacedHeightAndMargin should not read containing block's width
2412 https://bugs.webkit.org/show_bug.cgi?id=201796
2413 <rdar://problem/55366109>
2415 Reviewed by Antti Koivisto.
2417 This is in preparation for using constraint values instead of querying the display tree for containing block geometry information.
2418 See webkit.org/b/201795
2420 * layout/FormattingContext.h:
2421 * layout/FormattingContextGeometry.cpp:
2422 (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
2423 (WebCore::Layout::FormattingContext::Geometry::complicatedCases const):
2424 (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin const):
2425 (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin const):
2426 (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
2427 * layout/blockformatting/BlockFormattingContext.cpp:
2428 (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
2429 * layout/blockformatting/BlockFormattingContext.h:
2430 * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2431 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2432 * layout/inlineformatting/InlineFormattingContext.cpp:
2433 (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
2434 * layout/inlineformatting/InlineFormattingContext.h:
2435 * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2436 (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin const):
2438 2019-09-14 Zalan Bujtas <zalan@apple.com>
2440 [LFC] FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry should not read containing block's width.
2441 https://bugs.webkit.org/show_bug.cgi?id=201794
2442 <rdar://problem/55365669>
2444 Reviewed by Antti Koivisto.
2446 This is in preparation for using constraint values instead of querying the display tree for containing block geometry information.
2447 See webkit.org/b/201795
2449 * layout/FormattingContext.cpp:
2450 (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
2451 * layout/FormattingContext.h:
2452 * layout/FormattingContextGeometry.cpp:
2453 (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
2454 (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
2455 (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry const):
2457 2019-09-14 Chris Dumez <cdumez@apple.com>
2459 newController may be moved several times under SWClientConnection::notifyClientsOfControllerChange()
2460 https://bugs.webkit.org/show_bug.cgi?id=201792
2461 <rdar://problem/55351284>
2463 Reviewed by Youenn Fablet.
2465 Stop WTFMove()'ing inside the for loop.
2467 * workers/service/SWClientConnection.cpp:
2468 (WebCore::SWClientConnection::notifyClientsOfControllerChange):
2470 2019-09-14 Zalan Bujtas <zalan@apple.com>
2472 [LFC] FormattingContext::Geometry::computedHeightValue should not read containing block's height.
2473 https://bugs.webkit.org/show_bug.cgi?id=201791
2474 <rdar://problem/55361695>
2476 Reviewed by Antti Koivisto.
2478 While sizing/positioning a particular box, we oftentimes need some containing block geometry information.
2479 The idea here is that instead of calling formattingContext().geometry(containingBlock), these constraint values
2480 would be pushed in to those compute* functions. It helps controlling the access to the display box tree and
2481 prevents formatting context escaping.
2483 * layout/FormattingContext.cpp:
2484 (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
2485 * layout/FormattingContext.h:
2486 * layout/FormattingContextGeometry.cpp:
2487 (WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
2488 (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight const):
2489 (WebCore::Layout::FormattingContext::Geometry::computedMinHeight const):
2490 (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
2491 (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
2492 (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry const):
2493 (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
2494 * layout/LayoutUnits.h:
2495 * layout/blockformatting/BlockFormattingContext.cpp:
2496 (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
2498 2019-09-11 Dean Jackson <dino@apple.com>
2500 Provide a prototype for AR QuickLook to trigger processing in the originating page
2501 https://bugs.webkit.org/show_bug.cgi?id=201371
2504 Reviewed by Simon Fraser.
2507 (WebCore::Document::dispatchSystemPreviewActionEvent): Create and dispatch a MessageEvent.
2510 * html/HTMLAnchorElement.cpp: Send along the page and frame identifiers for this
2511 object to ensure that any reply goes to the correct place.
2512 (WebCore::HTMLAnchorElement::handleClick):
2514 * loader/FrameLoadRequest.h: Use the new SystemPreviewInfo type.
2515 (WebCore::FrameLoadRequest::isSystemPreview const):
2516 (WebCore::FrameLoadRequest::systemPreviewInfo const):
2517 (WebCore::FrameLoadRequest::systemPreviewRect const): Deleted.
2518 * loader/FrameLoader.cpp:
2519 (WebCore::FrameLoader::loadURL):
2521 * loader/FrameLoaderTypes.h: Provide encoders for the type.
2522 (WebCore::SystemPreviewInfo::encode const):
2523 (WebCore::SystemPreviewInfo::decode):
2525 * platform/network/ResourceRequestBase.cpp: Use the new type.
2526 (WebCore::ResourceRequestBase::isSystemPreview const):
2527 (WebCore::ResourceRequestBase::systemPreviewInfo const):
2528 (WebCore::ResourceRequestBase::setSystemPreviewInfo):
2529 (WebCore::ResourceRequestBase::setSystemPreview): Deleted.
2530 (WebCore::ResourceRequestBase::systemPreviewRect const): Deleted.
2531 (WebCore::ResourceRequestBase::setSystemPreviewRect): Deleted.
2532 * platform/network/ResourceRequestBase.h:
2534 * testing/Internals.cpp: Expose the frame and page identifiers to testing.
2535 (WebCore::Internals::frameIdentifier const):
2536 (WebCore::Internals::pageIdentifier const):
2537 * testing/Internals.h:
2538 * testing/Internals.idl:
2540 2019-09-13 Chris Dumez <cdumez@apple.com>
2542 Crash under WebCore::firstPositionInNode()
2543 https://bugs.webkit.org/show_bug.cgi?id=201764
2544 <rdar://problem/54823754>
2546 Reviewed by Wenson Hsieh and Geoff Garen.
2548 Make sure to keep a Ref<> to the textNode when we call insertNodeAtTabSpanPosition()
2551 Test: editing/firstPositionInNode-crash.html
2553 * editing/InsertTextCommand.cpp:
2554 (WebCore::InsertTextCommand::positionInsideTextNode):
2556 2019-09-13 Youenn Fablet <youenn@apple.com>
2558 Partition processes running service workers by session ID
2559 https://bugs.webkit.org/show_bug.cgi?id=201643
2561 Reviewed by Chris Dumez.
2563 Move the creation of service worker context connection management to SWServer.
2564 This allows to partition service worker context connections by registrable domain and sessionID.
2565 WebKit2 is still responsible to create the IPC creation through a Function given to SWServer at construction
2567 SWServer now keeps a map of registrable domain -> context connection to use for running workers.
2568 It also keeps a map of being-created connections.
2569 In case a context connection is removed from the SWServer, the SWServer will notify all related worker instances
2570 that they are not running. The SWServer will also recreate a context connection if needed.
2572 This allows removing the global server context connection map.
2573 Make SWServerToContextConnection no longer refcounted to simplify the lifetime management.
2575 Covered by API test.
2577 * workers/service/server/SWServer.cpp:
2578 (WebCore::SWServer::SWServer):
2579 (WebCore::SWServer::tryInstallContextData):
2580 (WebCore::SWServer::contextConnectionCreated):
2581 (WebCore::SWServer::unregisterServiceWorkerClient):
2582 (WebCore::SWServer::needsContextConnectionForRegistrableDomain const):
2583 (WebCore::SWServer::addContextConnection):
2584 (WebCore::SWServer::removeContextConnection):
2585 (WebCore::SWServer::createContextConnection):
2586 * workers/service/server/SWServer.h:
2587 (WebCore::SWServer::contextConnectionForRegistrableDomain):
2588 * workers/service/server/SWServerToContextConnection.cpp:
2589 (WebCore::SWServerToContextConnection::SWServerToContextConnection):
2590 (WebCore::SWServerToContextConnection::~SWServerToContextConnection):
2591 * workers/service/server/SWServerToContextConnection.h:
2592 * workers/service/server/SWServerWorker.cpp:
2593 (WebCore::SWServerWorker::contextConnection):
2595 2019-09-13 Zalan Bujtas <zalan@apple.com>
2597 [LFC] Do not create FormattingContext unless the root has child boxes.
2598 https://bugs.webkit.org/show_bug.cgi?id=201766
2599 <rdar://problem/55344449>
2601 Reviewed by Antti Koivisto.
2603 Just because a box establishes a formatting context, it does not necessarily mean we need to create a formatting context object for it.
2604 The established formatting context is responsible for laying out the descendant content. The formatting context root itself is
2605 laid out in the formatting context it lives in. So if there's no descendent content, we don't need to construct the context objects.
2607 <body><div style="float: left;"></div></body> <- this div establishes a block formatting context (float) but it does not have any content so laying
2608 it out simply means sizing and positioning it in the initial block formatting context.
2610 * layout/FormattingContext.cpp:
2611 (WebCore::Layout::FormattingContext::FormattingContext):
2612 (WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
2613 (WebCore::Layout::FormattingContext::mapTopToFormattingContextRoot const):
2614 (WebCore::Layout::FormattingContext::mapLeftToFormattingContextRoot const):
2615 (WebCore::Layout::FormattingContext::mapRightToFormattingContextRoot const):
2616 (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
2617 * layout/FormattingContext.h:
2618 (WebCore::Layout::FormattingContext::root const):
2619 * layout/FormattingContextGeometry.cpp:
2620 (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
2621 (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
2622 * layout/LayoutState.cpp:
2623 (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
2624 (WebCore::Layout::LayoutState::establishedFormattingState const):
2625 (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded):
2626 (WebCore::Layout::LayoutState::createFormattingContext):
2627 * layout/LayoutState.h:
2628 (WebCore::Layout::LayoutState::hasFormattingState const):
2629 * layout/blockformatting/BlockFormattingContext.cpp:
2630 (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
2631 (WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
2632 (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
2633 (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot):
2634 (WebCore::Layout::BlockFormattingContext::computedIntrinsicWidthConstraints):
2635 * layout/blockformatting/BlockFormattingContext.h:
2636 * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2637 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2638 (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
2639 * layout/blockformatting/BlockMarginCollapse.cpp:
2640 (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const):
2641 * layout/floats/FloatingContext.h:
2642 (WebCore::Layout::FloatingContext::root const):
2643 * layout/floats/FloatingState.cpp:
2644 (WebCore::Layout::FloatingState::FloatingState):
2645 (WebCore::Layout::FloatingState::bottom const):
2646 (WebCore::Layout::FloatingState::top const):
2647 * layout/floats/FloatingState.h:
2648 (WebCore::Layout::FloatingState::create):
2649 (WebCore::Layout::FloatingState::root const):
2650 (WebCore::Layout::FloatingState::leftBottom const):
2651 (WebCore::Layout::FloatingState::rightBottom const):
2652 (WebCore::Layout::FloatingState::bottom const):
2653 (WebCore::Layout::FloatingState::FloatItem::isDescendantOfFormattingRoot const):
2654 * layout/inlineformatting/InlineFormattingContext.cpp:
2655 (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
2656 (WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
2657 (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
2658 (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
2659 (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
2660 (WebCore::Layout::InlineFormattingContext::collectInlineContent const):
2661 * layout/inlineformatting/InlineFormattingContext.h:
2662 (WebCore::Layout::InlineFormattingContext::InlineLayout::formattingRoot const):
2663 * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
2664 (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
2665 * layout/inlineformatting/InlineLine.cpp:
2666 (WebCore::Layout::Line::close):
2667 (WebCore::Layout::Line::adjustBaselineAndLineHeight):
2668 * layout/tableformatting/TableFormattingContext.cpp:
2669 (WebCore::Layout::TableFormattingContext::TableFormattingContext):
2670 (WebCore::Layout::TableFormattingContext::layoutTableCellBox):
2671 (WebCore::Layout::TableFormattingContext::setComputedGeometryForSections):
2672 (WebCore::Layout::TableFormattingContext::ensureTableGrid):
2673 (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
2674 * layout/tableformatting/TableFormattingContext.h:
2676 2019-09-13 Ali Juma <ajuma@chromium.org>
2678 IntersectionObserverEntry#intersectionRatio can be larger than 1
2679 https://bugs.webkit.org/show_bug.cgi?id=200776
2681 Reviewed by Simon Fraser.
2683 When computing the intersection between a target and an intersection observer's
2684 root, RenderBox::computeVisibleRectInContainer is used to map the target rect
2685 up the containing block chain, clipping along the way. When a RenderBox has
2686 a transform, this method expands the given rect to the enclosing rect in device
2687 pixels. This is fine for the use case of computing an invalidation rect, but for
2688 the intersection observer use case it means that it is possible for the computed
2689 intersection rect to be slightly larger than the original target rect, resulting
2690 in an intersection ratio greater than 1.
2692 Fix this by performing a final intersection between the intersection rect as
2693 computed above and the target rect.
2695 Test: intersection-observer/intersection-clipped-to-target.html
2698 (WebCore::computeIntersectionState):
2700 2019-09-13 Nikolas Zimmermann <zimmermann@kde.org>
2702 SMIL animations of SVG <view> element have no effect
2703 https://bugs.webkit.org/show_bug.cgi?id=94469
2705 Reviewed by Said Abou-Hallawa.
2707 SMIL animations of the attributes associated with SVGViewElement work fine, but without any
2708 visual effect. When loading an SVG document with a given fragment identifier
2709 (e.g. test.svg#customView) where 'customView' references to an embedded SVGViewElement, the
2710 viewBox/preserveAspectRatio settings should be taken from the SVGViewElement. Currently
2711 there is no link between the SVGViewElement and the SVGSVGElement. The settings from the
2712 SVGViewElement are only pasrsed onco in SVGSVGElement::scrollToFragment(). Dynamic updates
2713 of the 'viewBox' and 'preserveAspectRatio' attributes of the SVGViewElement thus have no
2714 visual effect, since the SVGSVGElement does not re-evaluates its viewBox.
2716 Store a RefPtr to the currently used SVGViewElement in SVGSVGElement, and a WeakPtr back
2717 to the SVGSVGElement that currently references the SVGViewElement. This allows us to
2718 propagate SVGViewElement attribute changes to SVGSVGElement and re-evaluate the viewBox
2719 stored in SVGSVGElement and trigger visual updates.
2721 Tests: svg/custom/animation-on-view-element.html
2722 svg/custom/multiple-view-elements.html
2724 * svg/SVGSVGElement.cpp:
2725 (WebCore::SVGSVGElement::scrollToFragment):
2726 * svg/SVGSVGElement.h:
2727 * svg/SVGViewElement.cpp:
2728 (WebCore::SVGViewElement::svgAttributeChanged): Add missing implementation, tracked by
2729 webkit.org/b/196554. Correctly handle SVGFitToViewBox property changes. Update the viewBox
2730 stored in the SVGSVGElement, that references the SVGViewElement. Afterwards invalidate the
2731 renderer associated with the SVGSVGElement, which properly triggers visual updates.
2732 * svg/SVGViewElement.h:
2734 2019-09-13 Brent Fulgham <bfulgham@apple.com>
2736 [FTW] ImageBuffer/ImageBufferData is highly inefficient
2737 https://bugs.webkit.org/show_bug.cgi?id=201594
2739 Reviewed by Said Abou-Hallawa.
2741 My initial implementation of ImageBuffer and ImageBufferData for Direct2D involves too
2742 much moving of data from GPU to CPU and back. We only need to make a renderable version
2743 of the ImageBuffer when ImageBuffer::sinkIntoNativeImage or ImageBuffer::copyNativeImage
2746 Currently, each ImageBuffer putData operation uploads the data to the GPU, and each
2747 ImageBuffer getData pulls the data from the GPU.
2749 This patch does the following:
2751 1. It makes the assumption that the ID2D1Bitmap it holds is under its control (i.e.,
2752 external draw operations do not manipulate the bitmap without marking it dirty).
2753 2. It holds a CPU copy of the data from the ID2D1Bitmap originally used to create it.
2754 It uses this data for all manipulations, and uploads to the bitmap only when
2755 an ID2D1Bitmap is requested for drawing, and before a drawing operation is performed
2756 on the associated ImageBuffer context.
2757 3. It does not read back from the ID2D1Bitmap unless it is told that it is dirty.
2758 4. It does not call 'ID2D1RenderTarget::SetTags' if ASSERTS are disabled because
2759 they are costly, and don't help in release builds.
2761 * platform/graphics/win/Direct2DOperations.cpp:
2762 (WebCore::Direct2D::fillRect): Use new 'setTags' method.
2763 (WebCore::Direct2D::fillRoundedRect): Ditto.
2764 (WebCore::Direct2D::fillRectWithRoundedHole): Ditto.
2765 (WebCore::Direct2D::fillRectWithGradient): Ditto.
2766 (WebCore::Direct2D::fillPath): Ditto.
2767 (WebCore::Direct2D::strokeRect): Ditto.
2768 (WebCore::Direct2D::strokePath): Ditto.
2769 (WebCore::Direct2D::drawPath): Ditto.
2770 (WebCore::Direct2D::drawWithShadow): Notify observers before and after we drew.
2771 (WebCore::Direct2D::drawWithoutShadow): Ditto.
2772 (WebCore::Direct2D::clearRect): Use new 'setTags' method.
2773 (WebCore::Direct2D::drawGlyphs): Ditto.
2774 (WebCore::Direct2D::drawNativeImage): Ditto.
2775 (WebCore::Direct2D::drawRect): Ditto.
2776 (WebCore::Direct2D::drawLine): Ditto.
2777 (WebCore::Direct2D::fillEllipse): Ditto.
2778 (WebCore::Direct2D::drawEllipse): Ditto.
2779 (WebCore::Direct2D::flush): Notify observer after we drew.
2780 * platform/graphics/win/GradientDirect2D.cpp:
2781 (WebCore::Gradient::fill): Don't call SetTags in non-ASSERT builds.
2782 * platform/graphics/win/ImageBufferDataDirect2D.cpp:
2783 (WebCore::ImageBufferData::ensureBackingStore const): Added.
2784 (WebCore::ImageBufferData::getData const): Only read from the GPU if the in-memory
2785 store is empty or out-of-sync.
2786 (WebCore::ImageBufferData::putData): Mark the bitmap as out-of-sync, but don't
2787 upload the data yet.
2788 (WebCore::ImageBufferData::loadDataToBitmapIfNeeded): Helper function to upload data to the GPU.
2789 (WebCore::ImageBufferData::compatibleBitmap): Only upload data if the relevant
2790 bitmap is out of date.
2791 * platform/graphics/win/ImageBufferDataDirect2D.h:
2792 * platform/graphics/win/ImageBufferDirect2D.cpp:
2793 (WebCore::ImageBuffer::ImageBuffer): Update constructor to register the ImageBufferData
2794 lambdas as observer for draw operations.
2795 * platform/graphics/win/PlatformContextDirect2D.cpp:
2796 (WebCore::PlatformContextDirect2D::PlatformContextDirect2D): Update constructor to accept
2797 lambdas to run before and after draw operations.
2798 (WebCore::PlatformContextDirect2D::setTags): Added.
2799 (WebCore::PlatformContextDirect2D::notifyPreDrawObserver): Added.
2800 (WebCore::PlatformContextDirect2D::notifyPostDrawObserver): Added.
2801 * platform/graphics/win/PlatformContextDirect2D.h:
2802 (WebCore::PlatformContextDirect2D::PlatformContextDirect2D):
2804 2019-09-13 Russell Epstein <repstein@apple.com>
2806 Unreviewed, rolling out r249709.
2808 Layout test added in this patch has been consistently failing
2813 "Option + arrow moves caret past whitespace on iOS"
2814 https://bugs.webkit.org/show_bug.cgi?id=201575
2815 https://trac.webkit.org/changeset/249709
2817 2019-09-13 Zalan Bujtas <zalan@apple.com>
2819 [LFC] Rename FormattingContext::layout to layoutInFlowContent()
2820 https://bugs.webkit.org/show_bug.cgi?id=201763
2821 <rdar://problem/55340435>
2823 Reviewed by Antti Koivisto.
2825 FormattingContext::layout() only takes care of the inflow content. Out-out-flow boxes are laid out through FormattingContext::layoutOutOfFlowContent.
2827 * layout/FormattingContext.cpp:
2828 (WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
2829 * layout/FormattingContext.h:
2830 * layout/LayoutState.cpp:
2831 (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
2832 * layout/blockformatting/BlockFormattingContext.cpp:
2833 (WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
2834 (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot):
2835 (WebCore::Layout::BlockFormattingContext::layout): Deleted.
2836 * layout/blockformatting/BlockFormattingContext.h:
2837 * layout/inlineformatting/InlineFormattingContext.cpp:
2838 (WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
2839 (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
2840 (WebCore::Layout::InlineFormattingContext::layout): Deleted.
2841 * layout/inlineformatting/InlineFormattingContext.h:
2842 * layout/tableformatting/TableFormattingContext.cpp:
2843 (WebCore::Layout::TableFormattingContext::layoutInFlowContent):
2844 (WebCore::Layout::TableFormattingContext::layoutTableCellBox):
2845 (WebCore::Layout::TableFormattingContext::layout): Deleted.
2846 * layout/tableformatting/TableFormattingContext.h:
2848 2019-09-13 Zalan Bujtas <zalan@apple.com>
2850 [LFC] FormattingContext::displayBoxForLayoutBox should be split into 2 functions
2851 https://bugs.webkit.org/show_bug.cgi?id=201754
2852 <rdar://problem/55328753>
2854 Reviewed by Antti Koivisto.
2856 1. FormattingContext::geometryForBox() returns a const Display::Box. Use this function to access
2857 already computed geometry such as the containing block's content box width.
2858 This function can escape the current formatting context in certain cases and read geometry from parent/ancestor formatting contexts.
2859 2. FormattingState::displayBox() returns a non-const version of the Display::Box. Use this function to
2860 create/get the display box of a particular layout box to set computed values. This call should never escape the
2861 current formatting context (as no one should mutate ancestor boxes).
2863 Normally while laying out a particular box, we need to collect some geometry information from other boxes in the tree like previous sibling, containing block.
2864 <div style="width: 100px"><div></div></div> <- the inner div's used width is based on the outer div's width.
2865 However we should never mutate the geometry information on those other boxes (outer div). This patch helps avoiding accidental mutation on ancestors by
2866 returning a const version of the Display::Box.
2868 * layout/FormattingContext.cpp:
2869 (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
2870 (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
2871 (WebCore::Layout::FormattingContext::computeBorderAndPadding):
2872 (WebCore::Layout::mapHorizontalPositionToAncestor):
2873 (WebCore::Layout::FormattingContext::mapTopToFormattingContextRoot const):
2874 (WebCore::Layout::FormattingContext::mapLeftToFormattingContextRoot const):
2875 (WebCore::Layout::FormattingContext::mapRightToFormattingContextRoot const):
2876 (WebCore::Layout::FormattingContext::geometryForBox const):
2877 (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
2878 (WebCore::Layout::FormattingContext::displayBoxForLayoutBox const): Deleted.
2879 * layout/FormattingContext.h:
2880 (WebCore::Layout::FormattingContext::hasDisplayBox const): Deleted.
2881 * layout/FormattingContextGeometry.cpp:
2882 (WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
2883 (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
2884 (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const):
2885 (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const):
2886 (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
2887 (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2888 (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
2889 (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const):
2890 (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
2891 (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset const):
2892 * layout/FormattingContextQuirks.cpp:
2893 (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
2894 * layout/FormattingState.cpp:
2895 (WebCore::Layout::FormattingState::displayBox const):
2896 * layout/FormattingState.h:
2897 * layout/blockformatting/BlockFormattingContext.cpp:
2898 (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
2899 (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren):
2900 (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition):
2901 (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition):
2902 (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition):
2903 (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear):
2904 (WebCore::Layout::BlockFormattingContext::computeFloatingPosition):
2905 (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
2906 (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
2907 (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
2908 (WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const):
2909 * layout/blockformatting/BlockFormattingContext.h:
2910 * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2911 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2912 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
2913 (WebCore::Layout::BlockFormattingContext::Geometry::staticVerticalPosition const):
2914 (WebCore::Layout::BlockFormattingContext::Geometry::staticHorizontalPosition const):
2915 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2916 * layout/blockformatting/BlockFormattingContextQuirks.cpp:
2917 (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
2918 * layout/blockformatting/BlockMarginCollapse.cpp:
2919 (WebCore::Layout::BlockFormattingContext::MarginCollapse::hasClearance const):
2920 (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore const):
2921 (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter const):
2922 (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore const):
2923 (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance const):
2924 (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter const):
2925 (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling const):
2926 (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
2927 (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
2928 (WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues):
2929 (WebCore::Layout::hasClearance): Deleted.
2930 * layout/floats/FloatingContext.cpp:
2931 (WebCore::Layout::FloatingContext::positionForFloat const):
2932 (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
2933 (WebCore::Layout::FloatingContext::absoluteDisplayBoxCoordinates const):
2934 (WebCore::Layout::FloatingContext::mapToFloatingStateRoot const):
2935 (WebCore::Layout::FloatingContext::mapTopToFloatingStateRoot const):
2936 (WebCore::Layout::FloatingContext::mapPointFromFormattingContextRootToFloatingStateRoot const):
2937 * layout/inlineformatting/InlineFormattingContext.cpp:
2938 (WebCore::Layout::InlineFormattingContext::layout):
2939 (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
2940 (WebCore::Layout::InlineFormattingContext::initializeMarginBorderAndPaddingForGenericInlineBox):
2941 (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer):
2942 (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
2943 (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin):
2944 (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
2945 (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
2946 (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
2947 * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2948 (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin const):
2949 * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2950 (WebCore::Layout::inlineItemWidth):
2951 (WebCore::Layout::LineLayout::placeInlineItem):
2952 (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
2953 (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
2954 (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
2955 * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
2956 (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
2957 * layout/inlineformatting/InlineLine.cpp:
2958 (WebCore::Layout::isInlineContainerConsideredEmpty):
2959 (WebCore::Layout::Line::isVisuallyEmpty const):
2960 (WebCore::Layout::Line::close):
2961 (WebCore::Layout::Line::appendNonReplacedInlineBox):
2962 (WebCore::Layout::Line::inlineItemContentHeight const):
2963 * layout/tableformatting/TableFormattingContext.cpp:
2964 (WebCore::Layout::TableFormattingContext::layout):
2965 (WebCore::Layout::TableFormattingContext::layoutTableCellBox):
2966 (WebCore::Layout::TableFormattingContext::positionTableCells):
2967 (WebCore::Layout::TableFormattingContext::setComputedGeometryForRows):
2968 (WebCore::Layout::TableFormattingContext::setComputedGeometryForSections):
2969 (WebCore::Layout::TableFormattingContext::computedTableWidth):
2971 2019-09-13 Youenn Fablet <youenn@apple.com>
2973 Use WebProcess processIdentifier to identify Service Worker connections
2974 https://bugs.webkit.org/show_bug.cgi?id=201459
2976 Reviewed by Chris Dumez.
2978 No observable change of behavior.
2980 * workers/service/ServiceWorkerClient.cpp:
2981 (WebCore::ServiceWorkerClient::postMessage):
2982 Pass sessionID to ease NetworkProcess selection of the client process connection.
2983 * workers/service/ServiceWorkerTypes.h:
2984 Mark server connection identifier be process identifier based.
2985 * workers/service/context/SWContextManager.h:
2986 * workers/service/server/SWServer.cpp:
2987 (WebCore::SWServer::Connection::Connection):
2988 * workers/service/server/SWServer.h:
2989 Let connection identifier be set in constructor instead of generated.
2991 2019-09-13 Adrian Perez de Castro <aperez@igalia.com>
2993 Factor out duplicated functions from HTTPParsers.cpp and HTTPHeaderField.cpp
2994 https://bugs.webkit.org/show_bug.cgi?id=201721
2996 Reviewed by Don Olmstead.
2998 No new tests needed.
3000 * loader/HTTPHeaderField.cpp: Remove "static" from prototypes of functions needed in HTTPParsers.cpp.
3001 (WebCore::RFC7230::isDelimiter):
3002 (WebCore::RFC7230::isQuotedPairSecondOctet):
3003 (WebCore::RFC7230::isCommentText):
3004 * loader/HTTPHeaderField.h: Add prototypes of functions needed in HTTPParsers.cpp.
3005 * platform/network/HTTPParsers.cpp: Use functionality from WebCore::RFC7230 where possible.
3006 (WebCore::skipWhile): Moved to allow implementing skipWhiteSpace() in terms of skipWhile().
3007 (WebCore::skipWhiteSpace): Implement using skipWhile() and the RFC7230::isWhitespace() predicate.
3008 (WebCore::isValidAcceptHeaderValue): Replace usage of isDelimiterCharacter() with RFC7230::isDelimiter().
3009 (WebCore::isValidHTTPToken): Replace usage of isHTTPTokenCharacter() with RFC7230::isTokenCharacter().
3010 (WebCore::skipQuotedPair): Partially reimplement in terms of RFC7230::isQuotedPairSecondOctet().
3011 (WebCore::skipComment): Replace usage of isCommentTextCharacter() with RFC7230::isCommentText().
3012 (WebCore::skipHTTPToken): Replace usage of isHTTPTokenCharacter() with RFC7230::isTokenCharacter().
3014 2019-09-12 Zan Dobersek <zdobersek@igalia.com>
3016 Unreviewed debug build fix for GLib-based ports.
3018 * platform/glib/UserAgentGLib.cpp: Add the HTTPParsers.h header
3019 inclusion to bring in the isValidUserAgentHeaderValue() declaration as
3020 required for an assertion check.
3022 2019-09-12 Said Abou-Hallawa <sabouhallawa@apple.com>
3024 SVGLengthValue should use two enums for 'type' and 'mode' instead of one unsigned for 'units'
3025 https://bugs.webkit.org/show_bug.cgi?id=201663
3027 Reviewed by Simon Fraser, Nikolas Zimmermann.
3029 SVGLengthValue had one unsigned to store SVGLengthMode and SVGLengthType.
3030 It used to allocate the least significant 4 bits of this unsigned to the
3031 SVGLengthMode while it leaves the rest for SVGLengthType.
3033 This will not be needed if SVGLengthMode and SVGLengthType are made of
3038 -- SVGLengthNegativeValuesMode is made enum class.
3040 -- SVGLengthValue::blend() is moved to SVGLengthValue.cpp so we do not
3041 need to include SVGLengthContext.h in SVGLengthValue.h.
3043 -- SVGLengthType and SVGLengthMode are moved to SVGLengthValue.h. Instead
3044 of having SVGLengthValue.h includes SVGLengthConttext.h, the opposite
3047 -- SVGAnimatedPropertyDescription.h is deleted. It should have been deleted
3048 with the SVG tear off objects removal.
3050 -- SVGPropertyTraits<SVGAngleValue> and SVGPropertyTraits<SVGLengthValue>
3051 are deleted. They should have been deleted with SVGAnimatedType removal.
3053 -- SVGLengthValue::lengthModeForAnimatedLengthAttribute() is deleted. It
3054 was only called from SVGPropertyTraits<SVGLengthValue>.
3056 * WebCore.xcodeproj/project.pbxproj:
3057 * css/StyleResolver.h:
3058 * page/animation/CSSPropertyAnimation.cpp:
3059 (WebCore::blendFunc):
3060 * rendering/style/SVGRenderStyle.h:
3061 (WebCore::SVGRenderStyle::initialBaselineShiftValue):
3062 (WebCore::SVGRenderStyle::initialKerning):
3063 * rendering/svg/RenderSVGEllipse.cpp:
3064 (WebCore::RenderSVGEllipse::calculateRadiiAndCenter):
3065 * rendering/svg/RenderSVGRect.cpp:
3066 (WebCore::RenderSVGRect::updateShapeFromElement):
3067 * rendering/svg/SVGPathData.cpp:
3068 (WebCore::pathFromCircleElement):
3069 (WebCore::pathFromEllipseElement):
3070 (WebCore::pathFromRectElement):
3071 * rendering/svg/SVGTextLayoutEngineBaseline.cpp:
3072 (WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift const):
3073 * rendering/svg/SVGTextLayoutEngineSpacing.cpp:
3074 (WebCore::SVGTextLayoutEngineSpacing::calculateCSSKerningAndSpacing):
3075 * svg/LinearGradientAttributes.h:
3076 (WebCore::LinearGradientAttributes::LinearGradientAttributes):
3077 * svg/RadialGradientAttributes.h:
3078 (WebCore::RadialGradientAttributes::RadialGradientAttributes):
3079 * svg/SVGAngleValue.h:
3080 (WebCore::SVGPropertyTraits<SVGAngleValue>::initialValue): Deleted.
3081 (WebCore::SVGPropertyTraits<SVGAngleValue>::toString): Deleted.
3082 * svg/SVGCircleElement.cpp:
3083 (WebCore::SVGCircleElement::parseAttribute):
3084 * svg/SVGCircleElement.h:
3085 * svg/SVGCursorElement.cpp:
3086 (WebCore::SVGCursorElement::parseAttribute):
3087 * svg/SVGCursorElement.h:
3088 * svg/SVGEllipseElement.cpp:
3089 (WebCore::SVGEllipseElement::parseAttribute):
3090 * svg/SVGEllipseElement.h:
3091 * svg/SVGFilterElement.cpp:
3092 (WebCore::SVGFilterElement::parseAttribute):
3093 * svg/SVGFilterElement.h:
3094 * svg/SVGFilterPrimitiveStandardAttributes.cpp:
3095 (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
3096 * svg/SVGFilterPrimitiveStandardAttributes.h:
3097 * svg/SVGForeignObjectElement.cpp:
3098 (WebCore::SVGForeignObjectElement::parseAttribute):
3099 * svg/SVGForeignObjectElement.h:
3100 * svg/SVGImageElement.cpp:
3101 (WebCore::SVGImageElement::parseAttribute):
3102 * svg/SVGImageElement.h:
3104 (WebCore::SVGLength::unitType const):
3105 (WebCore::SVGLength::setValueForBindings):
3106 (WebCore::SVGLength::newValueSpecifiedUnits):
3107 (WebCore::SVGLength::convertToSpecifiedUnits):
3108 (WebCore::SVGLength::unitType): Deleted.
3109 * svg/SVGLengthContext.cpp:
3110 (WebCore::SVGLengthContext::valueForLength):
3111 (WebCore::SVGLengthContext::convertValueToUserUnits const):
3112 (WebCore::SVGLengthContext::convertValueFromUserUnits const):
3113 (WebCore::SVGLengthContext::convertValueFromUserUnitsToPercentage const):
3114 (WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits const):
3115 * svg/SVGLengthContext.h:
3117 * svg/SVGLengthList.h:
3118 (WebCore::SVGLengthList::create):
3119 * svg/SVGLengthValue.cpp:
3120 (WebCore::lengthTypeToString):
3121 (WebCore::parseLengthType):
3122 (WebCore::primitiveTypeToLengthType):
3123 (WebCore::lengthTypeToPrimitiveType):
3124 (WebCore::SVGLengthValue::SVGLengthValue):
3125 (WebCore::SVGLengthValue::construct):
3126 (WebCore::SVGLengthValue::blend):
3127 (WebCore::SVGLengthValue::fromCSSPrimitiveValue):
3128 (WebCore::SVGLengthValue::toCSSPrimitiveValue):
3129 (WebCore::SVGLengthValue::setValueAsString):
3130 (WebCore::SVGLengthValue::valueAsString const):
3131 (WebCore::SVGLengthValue::valueForBindings const):
3132 (WebCore::SVGLengthValue::setValue):
3133 (WebCore::SVGLengthValue::convertToSpecifiedUnits):
3134 (WebCore::storeUnit): Deleted.
3135 (WebCore::extractMode): Deleted.
3136 (WebCore::extractType): Deleted.
3137 (WebCore::SVGLengthValue::operator== const): Deleted.
3138 (WebCore::SVGLengthValue::operator!= const): Deleted.
3139 (WebCore::SVGLengthValue::unitType const): Deleted.
3140 (WebCore::SVGLengthValue::unitMode const): Deleted.
3141 (WebCore::SVGLengthValue::valueAsPercentage const): Deleted.
3142 (WebCore::SVGLengthValue::newValueSpecifiedUnits): Deleted.
3143 (WebCore::SVGLengthValue::lengthModeForAnimatedLengthAttribute): Deleted.
3144 * svg/SVGLengthValue.h:
3145 (WebCore::SVGLengthValue::lengthType const):
3146 (WebCore::SVGLengthValue::lengthMode const):
3147 (WebCore::SVGLengthValue::isZero const):
3148 (WebCore::SVGLengthValue::isRelative const):
3149 (WebCore::SVGLengthValue::valueAsPercentage const):
3150 (WebCore::SVGLengthValue::valueInSpecifiedUnits const):
3151 (WebCore::operator==):
3152 (WebCore::operator!=):
3153 (WebCore::SVGLengthValue::blend const): Deleted.
3154 (WebCore::SVGPropertyTraits<SVGLengthValue>::initialValue): Deleted.
3155 (WebCore::SVGPropertyTraits<SVGLengthValue>::parse): Deleted.
3156 (WebCore::SVGPropertyTraits<SVGLengthValue>::toString): Deleted.
3157 * svg/SVGLineElement.cpp:
3158 (WebCore::SVGLineElement::parseAttribute):
3159 * svg/SVGLineElement.h:
3160 * svg/SVGLinearGradientElement.cpp:
3161 (WebCore::SVGLinearGradientElement::parseAttribute):
3162 * svg/SVGLinearGradientElement.h:
3163 * svg/SVGMarkerElement.cpp:
3164 (WebCore::SVGMarkerElement::parseAttribute):
3165 * svg/SVGMarkerElement.h:
3166 * svg/SVGMaskElement.cpp:
3167 (WebCore::SVGMaskElement::parseAttribute):
3168 * svg/SVGMaskElement.h:
3169 * svg/SVGPatternElement.cpp:
3170 (WebCore::SVGPatternElement::parseAttribute):
3171 * svg/SVGPatternElement.h:
3172 * svg/SVGRadialGradientElement.cpp:
3173 (WebCore::SVGRadialGradientElement::parseAttribute):
3174 * svg/SVGRadialGradientElement.h:
3175 * svg/SVGRectElement.cpp:
3176 (WebCore::SVGRectElement::parseAttribute):
3177 * svg/SVGRectElement.h:
3178 * svg/SVGSVGElement.cpp:
3179 (WebCore::SVGSVGElement::parseAttribute):
3180 (WebCore::SVGSVGElement::hasIntrinsicWidth const):
3181 (WebCore::SVGSVGElement::hasIntrinsicHeight const):
3182 (WebCore::SVGSVGElement::intrinsicWidth const):
3183 (WebCore::SVGSVGElement::intrinsicHeight const):
3184 * svg/SVGSVGElement.h:
3185 * svg/SVGTextContentElement.cpp:
3186 (WebCore::SVGTextContentElement::parseAttribute):
3187 (WebCore::SVGTextContentElement::textLengthAnimated):
3188 * svg/SVGTextContentElement.h:
3189 * svg/SVGTextPathElement.cpp:
3190 (WebCore::SVGTextPathElement::parseAttribute):
3191 * svg/SVGTextPathElement.h:
3192 * svg/SVGTextPositioningElement.h:
3193 * svg/SVGUseElement.cpp:
3194 (WebCore::SVGUseElement::parseAttribute):
3195 * svg/SVGUseElement.h:
3196 * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
3197 * svg/properties/SVGAnimatedPropertyDescription.h: Removed.
3198 * svg/properties/SVGAnimationAdditiveListFunctionImpl.h:
3199 (WebCore::SVGAnimationLengthListFunction::animate):
3200 * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
3201 (WebCore::SVGAnimationLengthFunction::animate):
3202 * svg/properties/SVGValuePropertyAnimatorImpl.h:
3203 * svg/properties/SVGValuePropertyListAnimatorImpl.h:
3205 2019-09-12 Chris Dumez <cdumez@apple.com>
3207 Node.replaceChild()'s pre-replacement validations are not done in the right order
3208 https://bugs.webkit.org/show_bug.cgi?id=201741
3210 Reviewed by Geoffrey Garen.
3212 Node.replaceChild()'s pre-replacement validations are not done in the right order (spec order):
3213 - https://dom.spec.whatwg.org/#concept-node-replace
3215 In particular, we do not do check 3 (If child’s parent is not parent, then throw a
3216 "NotFoundError" DOMException.) at the right time, because we were making this check
3217 *after* checkPreReplacementValidity(), instead of *during*.
3219 No new tests, rebaselined existing test.
3221 * dom/ContainerNode.cpp:
3222 (WebCore::checkAcceptChild):
3223 (WebCore::ContainerNode::ensurePreInsertionValidity):
3224 (WebCore::checkPreReplacementValidity):
3225 (WebCore::ContainerNode::replaceChild):
3227 2019-09-12 Ryan Haddad <ryanhaddad@apple.com>
3229 Unreviewed, rolling out r249801.
3231 Caused two servier worker layout tests to become flaky.
3235 "Use WebProcess processIdentifier to identify Service Worker
3237 https://bugs.webkit.org/show_bug.cgi?id=201459
3238 https://trac.webkit.org/changeset/249801
3240 2019-09-12 Chris Dumez <cdumez@apple.com>
3242 [WKTR] Drop TestRunner.setPrivateBrowsingEnabled_DEPRECATED()
3243 https://bugs.webkit.org/show_bug.cgi?id=201546
3245 Reviewed by Alex Christensen.
3247 Drop TestRunner.setPrivateBrowsingEnabled_DEPRECATED() from WebKitTestRunner as it does not do
3248 the right thing for WebKit2 and tests have been rewritten to not use it.
3250 * page/PageGroup.cpp:
3251 (WebCore::PageGroup::addPage):
3252 (WebCore::PageGroup::setSessionIDForTesting): Deleted.
3256 2019-09-12 Saam Barati <sbarati@apple.com>
3258 [WHLSL] Slim down WSLMatrix and inline constructors in native code
3259 https://bugs.webkit.org/show_bug.cgi?id=201568
3261 Reviewed by Robin Morisset.
3263 Before, our WSL Matrix in MSL had templates to figure out how we're
3264 constructing it. For example, with a list of elements, or a list of
3265 columns. However, we can remove this template code since when we're
3266 emitting Metal code, we know exactly how we're constructing the WSL
3267 matrix. So the NativeFunctionWriter now inlines the proper stores
3268 into the WSLMatrix elements.
3270 This patch speeds up Metal compile times in boids by ~4ms (16%) with
3271 a p-value of 0.0001.
3273 Covered by existing tests.
3275 * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp:
3276 (WebCore::WHLSL::Metal::metalCodePrologue):
3277 * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
3278 (WebCore::WHLSL::Metal::inlineNativeFunction):
3280 2019-09-12 Wenson Hsieh <wenson_hsieh@apple.com>
3282 [Cocoa] Text indicator for an image link on the front page of apple.com looks wrong
3283 https://bugs.webkit.org/show_bug.cgi?id=201724
3284 <rdar://problem/54622894>
3286 Reviewed by Tim Horton.
3288 When computing the bounds of the range (<a>, 0) to (<a>, 1) for a text indicator snapshot where <a> is a link
3289 with a single non-breaking whitespace character, we currently use the text rect of the single space. This leads
3290 to a confusing text indicator, as the resulting snapshot is a tiny blank square in the top left corner of the
3291 link. This problem manifests when starting a drag or showing the system context menu on iOS, or force clicking
3292 or three-finger tapping to show a preview on macOS.
3294 To address this scenario, tweak the heuristic in the case where the text indicator option
3295 TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges is specified, such that we consider a range
3296 containing only text with whitespaces to be "complex"; additionally, instead of falling back to the range's
3297 bounding rect (which in this case is still tiny), fall back to the common ancestor container's bounding rect,
3298 which encompasses not only the text inside the range but also the element containing the range (in this case,
3299 the anchor element).
3301 Test: fast/text-indicator/text-indicator-empty-link.html
3303 * page/TextIndicator.cpp:
3304 (WebCore::containsOnlyWhiteSpaceText):
3306 Add a helper to determine whether a Range is comprised only of rendered text that only contains whitespace
3309 (WebCore::initializeIndicator):
3311 See ChangeLog entry above for more detail.
3313 2019-09-12 Brady Eidson <beidson@apple.com>
3315 PDF exporting on iOS should include URL rects.
3316 <rdar://problem/54900133> and https://bugs.webkit.org/show_bug.cgi?id=201693
3318 Reviewed by Tim Horton.
3320 Turns out that PDF exporting on iOS works fine.
3322 Tracking back through history it was disabled at least pre-2014.
3324 It was almost certainly disabled because it didn't work way back then,
3325 but it works great now.
3327 * platform/graphics/cg/GraphicsContextCG.cpp:
3328 (WebCore::GraphicsContext::setURLForRect): Remove the iOS platform exclusion.
3330 2019-09-12 Adrian Perez de Castro <aperez@igalia.com>
3332 [GTK][WPE] webkit_settings_set_user_agent() allows content forbidden in HTTP headers
3333 https://bugs.webkit.org/show_bug.cgi?id=201077
3335 Reviewed by Carlos Garcia Campos.
3337 Add a function to validate whether a string contains a valid value
3338 which can be used in a HTTP User-Agent header.
3340 Covered by new WebCore API test HTTPParsers.ValidateUserAgentValues.
3342 * platform/glib/UserAgentGLib.cpp:
3343 (WebCore::standardUserAgent): Assert that the returned string is a valid User-Agent.
3344 (WebCore::standardUserAgentForURL): Ditto.
3345 * platform/network/HTTPParsers.cpp: Added a series of helper functions which skip over
3346 characters of a string, which can be used to scan over the different elements of an
3347 User-Agent value; all of them receive the position from the input string where to start
3348 scanning, updating it to the position right after the scanned item (this follow the
3349 convention already in use by other functions in the source file). Each of them has
3350 been annotated with the RFC number and section which contains the definition of the
3351 scanned item, and the corresponding BNF rules to make the code easier to follow.
3352 (WebCore::skipWhile): Added.
3353 (WebCore::isVisibleCharacter): Added.
3354 (WebCore::isOctectInFieldContentCharacter): Added.
3355 (WebCore::isCommentTextCharacter): Added.
3356 (WebCore::isHTTPTokenCharacter): Added.
3357 (WebCore::isValidHTTPToken): Refactored to use the new isHTTPTokenCharacter()
3358 helper function instead of having the test inside the loop.
3359 (WebCore::skipCharacter): Added.
3360 (WebCore::skipQuotedPair): Added.
3361 (WebCore::skipComment): Added.
3362 (WebCore::skipHTTPToken): Added.
3363 (WebCore::skipUserAgentProduct): Added.
3364 (WebCore::isValidUserAgentHeaderValue): Added.
3365 * platform/network/HTTPParsers.h: Add prototype for isValidUserAgentHeaderValue().
3367 2019-09-12 Mark Lam <mark.lam@apple.com>
3369 Harden JSC against the abuse of runtime options.
3370 https://bugs.webkit.org/show_bug.cgi?id=201597
3371 <rdar://problem/55167068>
3373 Reviewed by Filip Pizlo.
3375 No new tests. Covered by existing tests.
3377 Enable Options::useDollarVM before we tell the JSGlobalObject to exposeDollarVM().
3378 The $vm utility is now hardened to require that Options::useDollarVM be
3379 enabled in order for it to be used.
3381 * testing/js/WebCoreTestSupport.cpp:
3382 (WebCoreTestSupport::injectInternalsObject):
3384 2019-09-12 Youenn Fablet <youenn@apple.com>
3386 Use typed identifiers for IDB connection identifiers
3387 https://bugs.webkit.org/show_bug.cgi?id=201682
3389 Reviewed by Chris Dumez.
3391 Migrate from uint64_t to a typed identifier for IDB connection identifiers.
3392 The identifier is reusing the process identifier type.
3393 No change of behavior.
3395 * Modules/indexeddb/client/IDBConnectionProxy.h:
3396 (WebCore::IDBClient::IDBConnectionProxy::serverConnectionIdentifier const):
3397 * Modules/indexeddb/client/IDBConnectionToServer.cpp:
3398 (WebCore::IDBClient::IDBConnectionToServer::identifier const):
3399 * Modules/indexeddb/client/IDBConnectionToServer.h:
3400 * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
3401 * Modules/indexeddb/server/IDBConnectionToClient.cpp:
3402 (WebCore::IDBServer::IDBConnectionToClient::identifier const):
3403 * Modules/indexeddb/server/IDBConnectionToClient.h:
3404 * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
3405 * Modules/indexeddb/server/IDBServer.cpp:
3406 (WebCore::IDBServer::IDBServer::getAllDatabaseNames):
3407 (WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
3408 (WebCore::IDBServer::IDBServer::didGetAllDatabaseNames):
3409 * Modules/indexeddb/server/IDBServer.h:
3410 * Modules/indexeddb/shared/IDBRequestData.cpp:
3411 (WebCore::IDBRequestData::serverConnectionIdentifier const):
3412 * Modules/indexeddb/shared/IDBRequestData.h:
3413 * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
3414 (WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
3415 (WebCore::IDBResourceIdentifier::emptyValue):
3416 (WebCore::IDBResourceIdentifier::deletedValue):
3417 (WebCore::IDBResourceIdentifier::isHashTableDeletedValue const):
3418 (WebCore::IDBResourceIdentifier::loggingString const):
3419 * Modules/indexeddb/shared/IDBResourceIdentifier.h:
3420 (WebCore::IDBResourceIdentifier::hash const):
3421 (WebCore::IDBResourceIdentifier::connectionIdentifier const):
3422 (WTF::crossThreadCopy):
3423 * Modules/indexeddb/shared/InProcessIDBServer.cpp:
3424 (WebCore::InProcessIDBServer::identifier const):
3425 * Modules/indexeddb/shared/InProcessIDBServer.h:
3427 2019-09-12 Youenn Fablet <youenn@apple.com>
3429 Use WebProcess processIdentifier to identify Service Worker connections
3430 https://bugs.webkit.org/show_bug.cgi?id=201459
3432 Reviewed by Chris Dumez.
3434 No observable change of behavior.
3436 * workers/service/ServiceWorkerClient.cpp:
3437 (WebCore::ServiceWorkerClient::postMessage):
3438 Pass sessionID to ease NetworkProcess selection of the client process connection.
3439 * workers/service/ServiceWorkerTypes.h:
3440 Mark server connection identifier be process identifier based.
3441 * workers/service/context/SWContextManager.h:
3442 * workers/service/server/SWServer.cpp:
3443 (WebCore::SWServer::Connection::Connection):
3444 * workers/service/server/SWServer.h:
3445 Let connection identifier be set in constructor instead of generated.
3447 2019-09-11 Youenn Fablet <youenn@apple.com>
3450 https://bugs.webkit.org/show_bug.cgi?id=201679
3452 Reviewed by Alex Christensen.
3454 Add an option to force to use DTLS1.0 and nothing else.
3455 Add internals API to enter in that mode to verify that normal configurations cannot communicate with DTLS1.0.
3457 Test: webrtc/datachannel/dtls10.html
3459 * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3460 (WebCore::LibWebRTCProvider::setEnableWebRTCEncryption):
3461 (WebCore::LibWebRTCProvider::setUseDTLS10):
3462 * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3463 * testing/Internals.cpp:
3464 (WebCore::Internals::setUseDTLS10):
3465 * testing/Internals.h:
3466 * testing/Internals.idl:
3468 2019-09-11 Keith Rollin <krollin@apple.com>
3470 Log timeoutValue passed on to CFNetwork
3471 https://bugs.webkit.org/show_bug.cgi?id=201701
3472 <rdar://problem/55279683>
3474 Reviewed by Chris Dumez.
3476 Export ResourceRequest::timeoutValue for use in WebKit.
3478 No new tests -- no new or changed functionality.
3480 * platform/network/ResourceRequestBase.h:
3482 2019-09-11 Saam Barati <sbarati@apple.com>
3484 [WHLSL] Remove null from the standard library
3485 https://bugs.webkit.org/show_bug.cgi?id=201672
3487 Reviewed by Robin Morisset.
3489 I meant to remove `null` from the standard library in r249351, but
3490 I had omitted the code I wrote to do that when I rebased that patch.
3491 This patch removes it and ensures all tests pass when parsing the entire
3494 * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
3496 2019-09-11 Chris Dumez <cdumez@apple.com>
3498 Use same parser for <meta http-equiv="refresh"> and `Refresh` HTTP header
3499 https://bugs.webkit.org/show_bug.cgi?id=201694
3501 Reviewed by Alex Christensen.
3503 Use same parser for <meta http-equiv="refresh"> and `Refresh` HTTP header. This aligns
3504 our behavior with Blink and makes us more compliant on web-platform-tests. This also
3505 simplifies our code.
3507 No new tests, rebaselined existing test.
3509 * loader/FrameLoader.cpp:
3510 (WebCore::FrameLoader::receivedFirstData):
3511 * platform/network/HTTPParsers.cpp:
3512 (WebCore::parseHTTPRefresh): Deleted.
3513 * platform/network/HTTPParsers.h:
3515 2019-09-11 Saam Barati <sbarati@apple.com>
3517 [WHLSL] Ensure structs/arrays with pointers as fields are disallowed
3518 https://bugs.webkit.org/show_bug.cgi?id=201525
3520 Reviewed by Robin Morisset.
3522 This patch adds a pass which both ensures that references are always initialized with
3523 concrete values and that we support logical mode validation by disallowing nested references.
3525 Specifically, the pass:
3527 1. Disallows structs to have fields which are references. This prevents us from having to
3528 figure out how to default initialize such a struct. We could relax this in the future if we
3529 did an analysis on which structs contain reference fields, and ensure such struct variables
3530 always have initializers. This would also require us to create constructors for structs which
3531 initialize each field.
3532 2. We also do the same for arrays.
3533 3. References can only be one level deep. So no pointers to pointers. No references to
3534 references, etc. This is to support logical mode validation rules.
3536 Test: webgpu/whlsl/ensure-proper-pointer-usage.html
3538 * Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.cpp: Added.
3539 (WebCore::WHLSL::checkReferenceTypes):
3540 * Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.h: Added.
3541 * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
3542 (WebCore::WHLSL::Checker::visit):
3543 * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
3544 (WebCore::WHLSL::prepareShared):
3546 * WebCore.xcodeproj/project.pbxproj:
3548 2019-09-11 Devin Rousso <drousso@apple.com>
3550 Web Inspector: Canvas: instrument WebGPUDevice instead of GPUCanvasContext
3551 https://bugs.webkit.org/show_bug.cgi?id=201650
3553 Reviewed by Joseph Pecoraro.
3555 Most of the actual "work" done with Web GPU actually uses a `WebGPUDevice`.
3557 A `GPUCanvasContext` is basically just a display "client" of the device, and isn't even
3558 required (e.g. compute pipeline). We should treat the `GPUCanvasContext` almost like a
3559 `-webkit-canvas` client of a `WebGPUDevice`.
3561 Tests: inspector/canvas/create-context-webgpu.html
3562 inspector/canvas/requestClientNodes-webgpu.html
3563 inspector/canvas/resolveContext-webgpu.html
3565 * Modules/webgpu/WebGPUAdapter.cpp:
3566 (WebCore::WebGPUAdapter::requestDevice const):
3567 Notify web inspector after a device is created.
3569 * Modules/webgpu/WebGPUDevice.idl:
3570 * Modules/webgpu/WebGPUDevice.h:
3571 * Modules/webgpu/WebGPUDevice.cpp:
3572 (WebCore::WebGPUDevice::instances): Added.
3573 (WebCore::WebGPUDevice::instancesMutex): Added.
3574 (WebCore::WebGPUDevice::~WebGPUDevice): Added.
3575 Notify web inspector when the device is about to be destructed.
3577 * Modules/webgpu/GPUCanvasContext.h:
3578 * Modules/webgpu/GPUCanvasContext.cpp:
3579 (WebCore::GPUCanvasContext::create):
3580 (WebCore::GPUCanvasContext::configureSwapChain):
3582 * inspector/InspectorCanvas.h:
3583 * inspector/InspectorCanvas.cpp:
3584 (WebCore::canvasIfContextMatchesDevice): Added.
3585 (WebCore::InspectorCanvas::create):
3586 (WebCore::InspectorCanvas::InspectorCanvas):
3587 (WebCore::InspectorCanvas::canvasContext const): Added.
3588 (WebCore::InspectorCanvas::canvasElement const): Added.
3589 (WebCore::InspectorCanvas::isDeviceForCanvasContext const): Added.
3590 (WebCore::InspectorCanvas::deviceContext const): Added.
3591 (WebCore::InspectorCanvas::scriptExecutionContext const): Added.
3592 (WebCore::InspectorCanvas::resolveContext const): Added.
3593 (WebCore::InspectorCanvas::clientNodes const): Added.
3594 (WebCore::InspectorCanvas::canvasChanged):
3595 (WebCore::InspectorCanvas::resetRecordingData):
3596 (WebCore::InspectorCanvas::recordAction):
3597 (WebCore::InspectorCanvas::buildObjectForCanvas):
3598 (WebCore::InspectorCanvas::releaseObjectForRecording):
3599 (WebCore::InspectorCanvas::getCanvasContentAsDataURL):
3600 (WebCore::InspectorCanvas::buildInitialState):
3601 (WebCore::InspectorCanvas::canvasElement): Deleted.
3602 * inspector/InspectorInstrumentation.cpp:
3603 (WebCore::InspectorInstrumentation::didCreateWebGPUDeviceImpl): Added.
3604 (WebCore::InspectorInstrumentation::willDestroyWebGPUDeviceImpl): Added.
3605 (WebCore::InspectorInstrumentation::willConfigureSwapChainImpl): Added.
3606 * inspector/InspectorInstrumentation.h:
3607 (WebCore::InspectorInstrumentation::didCreateWebGPUDevice): Added.
3608 (WebCore::InspectorInstrumentation::willDestroyWebGPUDevice): Added.
3609 (WebCore::InspectorInstrumentation::willConfigureSwapChain): Added.
3611 * inspector/agents/InspectorCanvasAgent.h:
3612 * inspector/agents/InspectorCanvasAgent.cpp:
3613 (WebCore::InspectorCanvasAgent::enable):
3614 (WebCore::InspectorCanvasAgent::requestClientNodes): Added.
3615 (WebCore::InspectorCanvasAgent::resolveContext): Added.
3616 (WebCore::InspectorCanvasAgent::startRecording):
3617 (WebCore::InspectorCanvasAgent::stopRecording):
3618 (WebCore::InspectorCanvasAgent::frameNavigated):
3619 (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
3620 (WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
3621 (WebCore::InspectorCanvasAgent::canvasDestroyed):
3622 (WebCore::InspectorCanvasAgent::recordCanvasAction):
3623 (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
3624 (WebCore::InspectorCanvasAgent::didCreateWebGPUDevice): Added.
3625 (WebCore::InspectorCanvasAgent::willDestroyWebGPUDevice): Added.
3626 (WebCore::InspectorCanvasAgent::willConfigureSwapChain): Added.
3627 (WebCore::InspectorCanvasAgent::clearCanvasData):
3628 (WebCore::InspectorCanvasAgent::bindCanvas):
3629 (WebCore::InspectorCanvasAgent::unbindCanvas):
3630 (WebCore::InspectorCanvasAgent::findInspectorCanvas):
3631 (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes): Deleted.
3632 (WebCore::contextAsScriptValue): Deleted.
3633 (WebCore::InspectorCanvasAgent::resolveCanvasContext): Deleted.
3635 * inspector/InspectorShaderProgram.cpp:
3636 (WebCore::InspectorShaderProgram::context const):
3638 2019-09-11 Chris Dumez <cdumez@apple.com>
3640 Posting a message to a redundant service worker should fail silently instead of throwing
3641 https://bugs.webkit.org/show_bug.cgi?id=201696
3643 Reviewed by Geoffrey Garen.
3645 Posting a message to a redundant service worker should fail silently instead of throwing:
3646 - https://w3c.github.io/ServiceWorker/#dom-serviceworker-postmessage-message-options
3647 - https://w3c.github.io/ServiceWorker/#run-service-worker (step 2)
3649 No new tests, rebaselined existing test.
3651 * workers/service/ServiceWorker.cpp:
3652 (WebCore::ServiceWorker::postMessage):
3653 * workers/service/server/SWServer.cpp:
3654 (WebCore::SWServer::runServiceWorkerIfNecessary):
3656 2019-09-11 Chris Dumez <cdumez@apple.com>
3658 Align our XPath API with the specification and other browsers
3659 https://bugs.webkit.org/show_bug.cgi?id=201660
3661 Reviewed by Geoffrey Garen.
3663 Align our XPath API with the specification and other browsers:
3664 - Document/XPathEvaluator.createExpression()'s first parameter should be mandatory
3665 - Document/XPathEvaluator.evaluate()'s first 2 parameters should be mandatory
3666 - XPathExpression.evaluate()'s first parameter should be mandatory
3668 I have confirmed in the latest Chrome and Firefox that they match the specification.
3670 No new tests, rebaselined existing test.
3673 (WebCore::Document::evaluate):
3676 * inspector/InspectorNodeFinder.cpp:
3677 (WebCore::InspectorNodeFinder::searchUsingXPath):
3678 * xml/XPathEvaluator.cpp:
3679 (WebCore::XPathEvaluator::evaluate):
3680 * xml/XPathEvaluator.h:
3681 * xml/XPathEvaluator.idl:
3682 * xml/XPathExpression.cpp:
3683 (WebCore::XPathExpression::evaluate):
3684 * xml/XPathExpression.h:
3685 * xml/XPathExpression.idl:
3686 * xml/XPathUtil.cpp:
3687 (WebCore::XPath::isValidContextNode):
3690 2019-09-11 Simon Fraser <simon.fraser@apple.com>
3692 REGRESSION (iOS 13): Top fixed element on apple.com flickers in size while pinching in
3693 https://bugs.webkit.org/show_bug.cgi?id=201668
3694 rdar://problem/51934041
3696 Reviewed by Frédéric Wang.
3698 When computing the new layout viewport rect in ScrollingTreeFrameScrollingNode, use
3699 "StickToDocumentBounds" mode, not "StickToViewportBounds", because otherwise we'll compute
3700 a layout viewport that has negative top/left offsets which causes fixed elements to jump outside
3701 the viewport. The only code that should be moving things outside the viewport (a temporary effect
3702 that happens when pinching) is the 'isBelowMinimumScale' path in WebPageProxy::computeCustomFixedPositionRect().
3704 With this change ScrollingTreeFrameScrollingNode no longer needs m_behaviorForFixed; it can be removed later.
3706 Not currently testable, since it involves pinching in past minimum zoom and transients state.
3708 * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
3709 (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
3711 2019-09-11 Truitt Savell <tsavell@apple.com>
3713 Unreviewed, rolling out r249753.
3715 caused inspector/canvas/shaderProgram-add-remove-webgl.html to
3716 crash on all Mac platforms.
3720 "Web Inspector: Canvas: instrument WebGPUDevice instead of
3722 https://bugs.webkit.org/show_bug.cgi?id=201650
3723 https://trac.webkit.org/changeset/249753
3725 2019-09-11 Antti Koivisto <antti@apple.com>
3727 REGRESSION (245006): can't scroll in "read more" view in Eventbrite app
3728 https://bugs.webkit.org/show_bug.cgi?id=201683
3729 <rdar://problem/54582602>
3731 Reviewed by Simon Fraser.
3733 * platform/RuntimeApplicationChecks.h:
3734 * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
3735 (WebCore::IOSApplication::isEventbrite):
3737 2019-09-11 Ryan Haddad <ryanhaddad@apple.com>
3739 Unreviewed, rolling out r249758.
3741 Breaks the watchOS build.
3745 "[WHLSL] Ensure structs/arrays with pointers as fields are
3747 https://bugs.webkit.org/show_bug.cgi?id=201525
3748 https://trac.webkit.org/changeset/249758
3750 2019-09-11 Ali Juma <ajuma@chromium.org>
3752 Prevent reentrancy FrameLoader::dispatchUnloadEvents()
3753 https://bugs.webkit.org/show_bug.cgi?id=200738
3755 Reviewed by Brady Eidson.
3757 Reentrancy causes m_pageDismissalEventBeingDispatched to be incorrectly
3758 updated, so don't allow reentrancy.
3760 Since this prevents m_pageDismissalEventBeingDispatched from being reset
3761 inside a reentrant call, it can have the unintended effect of causing
3762 FrameLoader::stopAllLoaders to early-out when called from
3763 FrameLoader::detachFromParent while a frame's unload event handler
3764 calls document.open() on a parent frame and causes itself to become
3765 detached. Allowing a load to continue in a detached frame will lead to
3766 a crash. To prevent this, add a new argument to FrameLoader::stopAllLoaders
3767 that FrameLoader::detachFromParent can use to prevent an early-out.
3769 * loader/FrameLoader.cpp:
3770 (WebCore::FrameLoader::stopAllLoaders):
3771 (WebCore::FrameLoader::detachFromParent):
3772 (WebCore::FrameLoader::dispatchUnloadEvents):
3773 (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
3774 Ensure that m_pageDismissalEventBeingDispatched is reset to its previous value, even if this is not None.
3775 * loader/FrameLoader.h:
3776 * loader/FrameLoaderTypes.h:
3777 Add a StopLoadingPolicy enum.
3779 2019-09-11 Charlie Turner <cturner@igalia.com>
3781 [GStreamer] Do not adopt floating references.
3782 https://bugs.webkit.org/show_bug.cgi?id=201685
3784 Reviewed by Carlos Garcia Campos.
3786 Covered by existing tests.
3788 * platform/graphics/gstreamer/GStreamerCommon.cpp:
3789 (WebCore::initializeGStreamer): gst_element_factory_make returns
3790 floating references, you do not adopt such references, rather you
3793 2019-09-11 Saam Barati <sbarati@apple.com>
3795 [WHLSL] Ensure structs/arrays with pointers as fields are disallowed
3796 https://bugs.webkit.org/show_bug.cgi?id=201525
3798 Reviewed by Robin Morisset.
3800 This patch adds a pass which both ensures that references are always initialized with
3801 concrete values and that we support logical mode validation by disallowing nested references.
3803 Specifically, the pass:
3805 1. Disallows structs to have fields which are references. This prevents us from having to
3806 figure out how to default initialize such a struct. We could relax this in the future if we
3807 did an analysis on which structs contain reference fields, and ensure such struct variables
3808 always have initializers. This would also require us to create constructors for structs which
3809 initialize each field.
3810 2. We also do the same for arrays.
3811 3. References can only be one level deep. So no pointers to pointers. No references to
3812 references, etc. This is to support logical mode validation rules.
3814 Test: webgpu/whlsl/ensure-proper-pointer-usage.html
3816 * Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.cpp: Added.
3817 (WebCore::WHLSL::checkReferenceTypes):
3818 * Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.h: Added.
3819 * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
3820 (WebCore::WHLSL::Checker::visit):
3821 * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
3822 (WebCore::WHLSL::prepareShared):
3824 * WebCore.xcodeproj/project.pbxproj:
3826 2019-09-10 Devin Rousso <drousso@apple.com>
3828 Web Inspector: Canvas: instrument WebGPUDevice instead of GPUCanvasContext
3829 https://bugs.webkit.org/show_bug.cgi?id=201650
3831 Reviewed by Joseph Pecoraro.
3833 Most of the actual "work" done with Web GPU actually uses a `WebGPUDevice`.
3835 A `GPUCanvasContext` is basically just a display "client" of the device, and isn't even
3836 required (e.g. compute pipeline). We should treat the `GPUCanvasContext` almost like a
3837 `-webkit-canvas` client of a `WebGPUDevice`.
3839 Tests: inspector/canvas/create-context-webgpu.html
3840 inspector/canvas/requestClientNodes-webgpu.html
3841 inspector/canvas/resolveContext-webgpu.html
3843 * Modules/webgpu/WebGPUAdapter.cpp:
3844 (WebCore::WebGPUAdapter::requestDevice const):
3845 Notify web inspector after a device is created.
3847 * Modules/webgpu/WebGPUDevice.idl:
3848 * Modules/webgpu/WebGPUDevice.h:
3849 * Modules/webgpu/WebGPUDevice.cpp:
3850 (WebCore::WebGPUDevice::instances): Added.
3851 (WebCore::WebGPUDevice::instancesMutex): Added.
3852 (WebCore::WebGPUDevice::~WebGPUDevice): Added.
3853 Notify web inspector when the device is about to be destructed.
3855 * Modules/webgpu/GPUCanvasContext.h:
3856 * Modules/webgpu/GPUCanvasContext.cpp:
3857 (WebCore::GPUCanvasContext::create):
3858 (WebCore::GPUCanvasContext::configureSwapChain):
3860 * inspector/InspectorCanvas.h:
3861 * inspector/InspectorCanvas.cpp:
3862 (WebCore::canvasIfContextMatchesDevice): Added.
3863 (WebCore::InspectorCanvas::create):
3864 (WebCore::InspectorCanvas::InspectorCanvas):
3865 (WebCore::InspectorCanvas::canvasContext const): Added.
3866 (WebCore::InspectorCanvas::canvasElement const): Added.
3867 (WebCore::InspectorCanvas::isDeviceForCanvasContext const): Added.
3868 (WebCore::InspectorCanvas::deviceContext const): Added.
3869 (WebCore::InspectorCanvas::scriptExecutionContext const): Added.
3870 (WebCore::InspectorCanvas::resolveContext const): Added.
3871 (WebCore::InspectorCanvas::clientNodes const): Added.
3872 (WebCore::InspectorCanvas::canvasChanged):
3873 (WebCore::InspectorCanvas::resetRecordingData):
3874 (WebCore::InspectorCanvas::recordAction):
3875 (WebCore::InspectorCanvas::buildObjectForCanvas):
3876 (WebCore::InspectorCanvas::releaseObjectForRecording):
3877 (WebCore::InspectorCanvas::getCanvasContentAsDataURL):
3878 (WebCore::InspectorCanvas::buildInitialState):
3879 (WebCore::InspectorCanvas::canvasElement): Deleted.
3880 * inspector/InspectorInstrumentation.cpp:
3881 (WebCore::InspectorInstrumentation::didCreateWebGPUDeviceImpl): Added.
3882 (WebCore::InspectorInstrumentation::willDestroyWebGPUDeviceImpl): Added.
3883 (WebCore::InspectorInstrumentation::willConfigureSwapChainImpl): Added.
3884 * inspector/InspectorInstrumentation.h:
3885 (WebCore::InspectorInstrumentation::didCreateWebGPUDevice): Added.
3886 (WebCore::InspectorInstrumentation::willDestroyWebGPUDevice): Added.
3887 (WebCore::InspectorInstrumentation::willConfigureSwapChain): Added.
3889 * inspector/agents/InspectorCanvasAgent.h:
3890 * inspector/agents/InspectorCanvasAgent.cpp:
3891 (WebCore::InspectorCanvasAgent::enable):
3892 (WebCore::InspectorCanvasAgent::requestClientNodes): Added.
3893 (WebCore::InspectorCanvasAgent::resolveContext): Added.
3894 (WebCore::InspectorCanvasAgent::startRecording):
3895 (WebCore::InspectorCanvasAgent::stopRecording):
3896 (WebCore::InspectorCanvasAgent::frameNavigated):
3897 (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
3898 (WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
3899 (WebCore::InspectorCanvasAgent::canvasDestroyed):
3900 (WebCore::InspectorCanvasAgent::recordCanvasAction):
3901 (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
3902 (WebCore::InspectorCanvasAgent::didCreateWebGPUDevice): Added.
3903 (WebCore::InspectorCanvasAgent::willDestroyWebGPUDevice): Added.
3904 (WebCore::InspectorCanvasAgent::willConfigureSwapChain): Added.
3905 (WebCore::InspectorCanvasAgent::clearCanvasData):
3906 (WebCore::InspectorCanvasAgent::bindCanvas):
3907 (WebCore::InspectorCanvasAgent::unbindCanvas):
3908 (WebCore::InspectorCanvasAgent::findInspectorCanvas):
3909 (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes): Deleted.
3910 (WebCore::contextAsScriptValue): Deleted.
3911 (WebCore::InspectorCanvasAgent::resolveCanvasContext): Deleted.
3913 * inspector/InspectorShaderProgram.cpp:
3914 (WebCore::InspectorShaderProgram::context const):
3916 2019-09-10 Chris Dumez <cdumez@apple.com>
3918 Nullptr crash in Page::sessionID() via WebKit::WebFrameLoaderClient::detachedFromParent2()
3919 https://bugs.webkit.org/show_bug.cgi?id=201625
3921 Reviewed by Ryosuke Niwa.
3923 This is based on a patch from Ryosuke Niwa.
3925 Drop setHasFrameSpecificStorageAccess() in WebCore and call it from the WebKit layer instead.
3927 * dom/DocumentStorageAccess.cpp:
3928 (WebCore::DocumentStorageAccess::requestStorageAccess):
3929 (WebCore::DocumentStorageAccess::setHasFrameSpecificStorageAccess): Deleted.
3930 * dom/DocumentStorageAccess.h:
3931 * loader/EmptyFrameLoaderClient.h:
3932 * loader/FrameLoaderClient.h:
3934 2019-09-10 Brady Eidson <beidson@apple.com>
3936 Add SPI to save a PDF from the contents of a WKWebView.
3937 <rdar://problem/48955900> and https://bugs.webkit.org/show_bug.cgi?id=195765
3939 Reviewed by Tim Horton.
3941 Covered by API tests.
3943 * page/FrameView.cpp:
3944 (WebCore::FrameView::paintContents): Don't paint the debug color outside of the FrameRect.
3946 * platform/graphics/cg/GraphicsContextCG.cpp:
3947 (WebCore::GraphicsContext::setURLForRect):
3949 * rendering/PaintPhase.h: Add "AnnotateLinks" option to always gather and annotation links.
3951 * rendering/RenderElement.cpp:
3952 (WebCore::RenderElement::hasOutlineAnnotation const): Also return true when the PaintOptions include "AnnotateLinks"
3954 2019-09-10 Jiewen Tan <jiewen_tan@apple.com>